提交 a5749124 authored 作者: renjiancai's avatar renjiancai

--no commit message

上级 cf3a8725
......@@ -64,6 +64,7 @@ import com.zrqx.core.util.excelutil.ExcelUtil;
import com.zrqx.core.validate.SaveGroup;
import com.zrqx.core.vo.book.EpubVo;
import com.zrqx.core.vo.excel.ExcelBookVO;
import com.zrqx.core.vo.excel.ImportExcelBookVO;
import com.zrqx.core.vo.resource.ResourceRelationListVo;
import com.zrqx.core.vo.resource.ResourceRelationVo;
import com.zrqx.core.vo.resource.ebook.EbookListVO;
......@@ -174,7 +175,7 @@ public class EbookLibraryController {
List<BookDiyType> dtList = bookTypeService.selectByCriteria();
// 自定义标签
bookLableService.createCriteria().andEqualTo("objectId", oid);
List<BookLabelDiyType> listLable = bookLableService.selectByCriteria();
List<BookLabelDiyType> listLabel = bookLableService.selectByCriteria();
// 商品相册
bookAlbumService.createCriteria().andEqualTo("bookId", oid);
List<BookGoodsAlbum> album = bookAlbumService.selectByCriteria();
......@@ -189,23 +190,23 @@ public class EbookLibraryController {
BeanUtils.copyProperties(issued, vo);
}
// 自定义标签
if(listLable!=null && listLable.size()>0){
if(listLabel!=null && listLabel.size()>0){
vo.setLabelId(new ArrayList<String>());
vo.setLabelContentId(new ArrayList<String>());
vo.setLabelContentCode(new ArrayList<String>());
listLable.forEach(obj -> vo.getLabelId().add(obj.getLabelId()));
listLable.forEach(obj -> vo.getLabelContentId().add(obj.getLabelContentId()));
listLable.forEach(obj -> vo.getLabelContentCode().add(obj.getLabelContentCode()));
listLabel.forEach(obj -> vo.getLabelId().add(obj.getLabelId()));
listLabel.forEach(obj -> vo.getLabelContentId().add(obj.getLabelContentId()));
listLabel.forEach(obj -> vo.getLabelContentCode().add(obj.getLabelContentCode()));
}
// 自定义分类
vo.setDiyTypeId(new ArrayList<String>());
vo.setDiyTypeCode(new ArrayList<String>());
dtList.forEach(obj -> vo.getDiyTypeId().add(obj.getDtId()));
dtList.forEach(obj -> vo.getDiyTypeCode().add(obj.getCode()));
// 商品相册
vo.setGoodsCover(new ArrayList<String>());
album.forEach(obj -> vo.getGoodsCover().add(obj.getGoodsCover()));
//图书资源
BeanUtils.copyProperties(book, vo);
return CallBack.success(vo);
}
......@@ -382,8 +383,6 @@ public class EbookLibraryController {
return CallBack.success(new PageInfo<ResourceRelationVo>(resourceRelationService.queryRelationList(list)));
}
@ApiOperation(value = "保存相关资源", notes = "保存相关资源")
@PostMapping(value = ResourceRequestPath.RELATION_RESOURCE + ResourceRequestPath.SAVE)
public CallBack<Boolean> saveRelation(@RequestBody SaveResourceRelationForm entity) {
......@@ -414,17 +413,16 @@ public class EbookLibraryController {
return CallBack.success(resourceService.batchDeleteResource(ids));
}
@ApiOperation(value = "导入图书Excel")
@PostMapping(value = SysUserRequestPath.IMPORT, produces = "text/plain; charset=UTF-8")
public String importCard(@RequestParam("file") MultipartFile file) throws Exception {
@PostMapping(value = SysUserRequestPath.IMPORT, produces = "application/json;charset=UTF-8")
public CallBack<String> importBook(@RequestParam("file") MultipartFile file) throws Exception {
Book book = new Book();
Ebook ebook = new Ebook();
BookIssued issued = new BookIssued();
List<ExcelBookVO> list = ExcelUtil.importExcel(file.getInputStream(), ExcelBookVO.class, file.getOriginalFilename());
List<ImportExcelBookVO> list = ExcelUtil.importExcel(file.getInputStream(), ImportExcelBookVO.class, file.getOriginalFilename());
list.forEach(ec ->{
System.out.println(ec.toString());
BeanUtils.copyProperties(ec, book);
BeanUtils.copyProperties(ec, ebook);
BeanUtils.copyProperties(ec, issued);
BeanUtils.copyProperties(ec, book);
book.setUploadTime(new Date());
bookservice.insert(book);// 图书信息
ebook.setBookId(book.getId());
......@@ -434,7 +432,7 @@ public class EbookLibraryController {
issued.setObjectId(book.getId());
bookIssuedService.insert(issued);// 图书行业信息
});
return null;
return CallBack.success();
}
@ApiOperation(value = "添加附件", notes = "添加附件")
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论