提交 db43f884 authored 作者: zhouzhigang's avatar zhouzhigang

图书导入

上级 17c41e02
......@@ -585,11 +585,23 @@ public class PhyResourceServiceImpl extends BaseModelServiceImpl<PhyResource, St
return result;
}
importPhyResourceExcelVos.stream().forEach(importPhyResourceExcelVo -> {
//若ISBN已经存在则不导入
//若ISBN已经存在则覆盖
PhyResource phyResource1 = new PhyResource();
phyResource1.setIsbn(importPhyResourceExcelVo.getIsbn());
Integer count = selectCount(phyResource1);
if(count > 0){
List<PhyResource> phyList = phyResourceMapper.select(phyResource1);
if(phyList != null && phyList.size() > 0){
for (PhyResource phy : phyList) {
BeanUtils.copyProperties(importPhyResourceExcelVo, phy);
if(phy.getBindid() != null) phy.setBindid(PhyResourceBindEnum.getCode(phy.getBindid()));
if(phy.getForeignJournalsStatus() != null) phy.setForeignJournalsStatus(
"本版书".equals(phy.getForeignJournalsStatus()) ? "0" : "1");
if(phy.getApplyStatus() != null) phy.setApplyStatus(
"不可申请样书".equals(phy.getApplyStatus()) ? "0" : "1");
if(phy.getCountryStatus() != null) phy.setCountryStatus(
"否".equals(phy.getCountryStatus()) ? "0" : "1");
phy.setCreateTime(new Date());
this.updateByPrimaryKey(phy);
}
return;
}
PhyResource phyResource = new PhyResource();
......@@ -601,7 +613,7 @@ public class PhyResourceServiceImpl extends BaseModelServiceImpl<PhyResource, St
if(phyResource.getApplyStatus() != null) phyResource.setApplyStatus(
"不可申请样书".equals(phyResource.getApplyStatus()) ? "0" : "1");
if(phyResource.getCountryStatus() != null) phyResource.setCountryStatus(
"否".equals(phyResource.getCountryStatus()) ? "0" : "1");
"否".equals(phyResource.getCountryStatus()) ? "0" : "1");
String name = this.getPressInfo();
if(StringUtils.isNotEmpty(name)){
phyResource.setPublisher(name);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论