提交 67c8a6fc authored 作者: renjiancai's avatar renjiancai

--no commit message

上级 d0faf480
......@@ -299,7 +299,6 @@ public class EbookController {
clservice.insertList(new ArrayList(ev.getChapterSet()));
return CallBack.success();
}
}
// 资源类型
ev.getBook().setStatus(BookSaleStatusEnum.STATUS_1.getCode());
......
package com.zrqx.resource.bg.controller.ebook;
import java.text.ParseException;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -36,7 +37,7 @@ public class EbookMainBodyController {
@ApiOperation("保存杂志主体")
@PostMapping(ResourceRequestPath.SAVE)
public CallBack<?> saveBook(@RequestBody SaveUpdateEbookMainBodyForm form) {
public CallBack<?> saveBook(@RequestBody SaveUpdateEbookMainBodyForm form) throws ParseException {
if (!ebookMainBodyService.saveOrUpdate(form)) {
throw new BusinessValidateException("操作失败");
}
......@@ -44,7 +45,7 @@ public class EbookMainBodyController {
}
@ApiOperation("修改杂志主体")
@PostMapping(ResourceRequestPath.UPDATE)
public CallBack<?> updateBook(@RequestBody SaveUpdateEbookMainBodyForm form) {
public CallBack<?> updateBook(@RequestBody SaveUpdateEbookMainBodyForm form) throws ParseException {
if (!ebookMainBodyService.saveOrUpdate(form)) {
throw new BusinessValidateException("操作失败");
}
......
......@@ -8,7 +8,6 @@ import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.jboss.logging.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
......@@ -50,7 +49,6 @@ import tk.mybatis.mapper.entity.Example;
@RequestMapping(ResourceRequestPath.BG + ResourceRequestPath.RESOURCE)
@Api(description = "资源的公共接口")
public class ResourceLibraryController {
private static final Logger log = Logger.getLogger(ResourceLibraryController.class);
@Autowired
private ArticleLibraryService articleLibraryService;
@Autowired
......
package com.zrqx.resource.bg.service.ebook;
import java.text.ParseException;
import com.zrqx.core.form.resource.bg.ebook.QueryEbookMainBodyForm;
import com.zrqx.core.form.resource.bg.ebook.SaveUpdateEbookMainBodyForm;
import com.zrqx.core.model.resource.ebook.EbookMainBody;
......@@ -22,7 +24,7 @@ public interface EbookMainBodyService extends BaseService<EbookMainBody, String>
* @author rjc
* @date: 2019年9月10日 上午9:25:20
*/
boolean saveOrUpdate(SaveUpdateEbookMainBodyForm form);
boolean saveOrUpdate(SaveUpdateEbookMainBodyForm form) throws ParseException;
/**
* 分页查询
* @param form
......
package com.zrqx.resource.bg.service.ebook;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
......@@ -14,7 +16,6 @@ import com.zrqx.core.model.resource.ebook.EbookMainBody;
import com.zrqx.core.service.BaseServiceImpl;
import com.zrqx.core.util.page.PageInfo;
import com.zrqx.core.util.page.PageParam;
import com.zrqx.core.vo.resource.ebook.EbookListVO;
import com.zrqx.core.vo.resource.ebook.EbookMainBodyListVO;
import com.zrqx.resource.bg.mapper.ebook.EbookMainBodyMapper;
......@@ -35,15 +36,22 @@ public class EbookMainBodyServiceImpl extends BaseServiceImpl<EbookMainBody, Str
}
@Override
public boolean saveOrUpdate(SaveUpdateEbookMainBodyForm form) {
public boolean saveOrUpdate(SaveUpdateEbookMainBodyForm form) throws ParseException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
EbookMainBody body = new EbookMainBody();
BeanUtils.copyProperties(form, body);
if (body.getId() == null) {
if(form.getPublishTime()!=null && !form.getPublishTime().equals("")) {
body.setPublishTime(sdf.parse(form.getPublishTime()));
}
body.setStatus(1);
body.setUploadTime(new Date());
ebookMainBodyMapper.insertSelective(body);
} else {
body.setUpdateTime(new Date());
if(form.getPublishTime()!=null && !form.getPublishTime().equals("")) {
body.setPublishTime(sdf.parse(form.getPublishTime()));
}
ebookMainBodyMapper.updateByPrimaryKeySelective(body);
}
return true;
......
......@@ -37,11 +37,9 @@ import com.zrqx.core.vo.resource.fg.articlelibrary.FgArticleLibraryListVO;
import com.zrqx.core.vo.resource.fg.articlelibrary.FgArticleLibraryOneVO;
import com.zrqx.core.vo.resource.fg.diytype.FgDiyTypeVo;
import com.zrqx.core.vo.resource.fg.resource.FgAboutListVo;
import com.zrqx.resource.fg.client.sysuser.FgSysuserClient;
import com.zrqx.resource.fg.service.articlelibrary.FgArticleLibraryDiyTypeService;
import com.zrqx.resource.fg.service.articlelibrary.FgArticleLibraryService;
import com.zrqx.resource.fg.service.articlelibrary.FgChapterLibraryService;
import com.zrqx.resource.fg.service.ebook.FgEbookService;
import com.zrqx.resource.fg.service.record.FgRecordService;
import io.swagger.annotations.Api;
......
package com.zrqx.resource.fg.controller.ebook;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zrqx.core.constant.resource.ResourceRequestPath;
import com.zrqx.core.form.resource.fg.ebook.FgQueryEbookInfoForm;
import com.zrqx.core.model.resource.ebook.EbookMainBody;
import com.zrqx.core.util.page.PageInfo;
import com.zrqx.core.util.page.PageParam;
import com.zrqx.core.util.response.CallBack;
import com.zrqx.core.vo.resource.fg.ebook.FgEbookListVO;
import com.zrqx.resource.bg.service.ebook.EbookMainBodyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
* 电子书管理-controller
* @author Conan
* @date 2018年7月13日上午10:02:31
*/
@RestController
@RequestMapping(ResourceRequestPath.FG+ResourceRequestPath.EBOOKMAIABODY)
@Api(description="前台-杂志主体")
public class FgEbookMainBodyController {
@Autowired
private EbookMainBodyService ebookMainBodyService;
@ApiOperation("查询电子书列表")
@GetMapping(ResourceRequestPath.PAGE)
public CallBack<List<EbookMainBody>> getBookMainBodyList() {
List<EbookMainBody> list = ebookMainBodyService.selectAll();
for (EbookMainBody body : list) {
String[] str = body.getPeriodsNumber().split(",");
for (EbookMainBody ebookMainBody : list) {
}
//body.setPeriodsNumber(periodsNumber);
}
return CallBack.success();
}
}
......@@ -124,31 +124,18 @@ public interface FgEbookMapper extends BaseMapper<Ebook>{
* @date: 2019年1月11日 下午3:50:49
*/
@Select("<script>"
+ "select DISTINCT bb.id, bb.name, bb.authorId, bb.author, bb.translatorId, bb.translator, "
+ "bb.publishTime, bb.status, bb.nationsType, be.realPrice, be.priceOption, be.price, be.bookCover, be.summary, be.bookStatus, be.browseNum, be.goodsType "
+ "FROM res_book bb "
+ "LEFT JOIN res_ebook be ON bb.id = be.id "
+ "LEFT JOIN res_ebook_diy_type bdt ON be.id = bdt.ebookId "
+ "LEFT JOIN res_ebook_label_content_diy_type blcdt on be.id = blcdt.ebookId "
+ "WHERE be.bookStatus = 4 "
+ "<if test='diyTypeCode != null and diyTypeCode.size > 0'>"
+ "and bdt.diytypeCode in "
+ " <foreach collection=\"diyTypeCode\" index=\"index\" item=\"code\" open=\"(\" separator=\",\" close=\")\">"
+ " concat(#{code},'%') "
+ "select bb.id, bb.year, bb.periods, bb.bookCover,bb.status,bb.mainBody,bb.year "
+ "FROM res_book bb WHERE bb.status = 1 "
+ "<if test='year != null and year.size > 0'>"
+ "and bb.year in "
+ " <foreach collection=\"year\" index=\"index\" item=\"year\" open=\"(\" separator=\",\" close=\")\">"
+ " concat(#{year},'%') "
+ "</foreach>"
+ "</if>"
+ "<if test='labelContentDiyTypeCode != null and labelContentDiyTypeCode.size > 0'>"
+ "and blcdt.labelContentDiyTypeCode in "
+ " <foreach collection=\"labelContentDiyTypeCode\" index=\"index\" item=\"code\" open=\"(\" separator=\",\" close=\")\">"
+ " concat(#{code},'%') "
+ "</foreach>"
+ "</if>"
+ "<if test = 'nationsType != null' >"
+ "and bb.nationsType = #{nationsType} "
+ "<if test = 'mainBody != null' >"
+ "and bb.mainBody = #{mainBody} "
+ "</if>"
+ "<if test = 'authorId != null' >"
+ "and bb.authorId = #{authorId} "
+ "</if>"
+ "</script>")
List<FgEbookListVO> page(FgQueryEbookInfoForm form);
......
......@@ -148,13 +148,9 @@ public class FgEbookServiceImpl extends BaseServiceImpl<Ebook, String> implement
public List<FgEbookListVO> page(FgQueryEbookInfoForm form, PageParam pageParam){
startPage(pageParam);
List<FgEbookListVO> list = ebookMapper.page(form);
// 调用
list.forEach(li ->{
FgEbookVO one = ebookOneInfoById(li.getId());
BeanUtils.copyProperties(one, li);
});
//去标签
regEx(list);
for (FgEbookListVO vo : list) {
vo.setName(vo.getYear()+"年第"+vo.getPeriods()+"期");
}
return list;
}
......@@ -387,9 +383,9 @@ public class FgEbookServiceImpl extends BaseServiceImpl<Ebook, String> implement
private void regEx(List<FgEbookListVO> list){
if(ArrayUtils.isNotEmpty(list)){
list.forEach(li -> {
if(StringUtils.isNotBlank(li.getSummary())){
/*if(StringUtils.isNotBlank(li.getSummary())){
li.setSummary(removeLabel(li.getSummary()));
}
}*/
});
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论