Browse Source

导入下载错误数据excel

master
chenfang 2 years ago
parent
commit
fbd994a85f
  1. 21
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/itembasic/ItembasicServiceImpl.java

21
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/itembasic/ItembasicServiceImpl.java

@ -196,17 +196,18 @@ public class ItembasicServiceImpl implements ItembasicService {
if(StrUtil.isNotEmpty(massage)){ if(StrUtil.isNotEmpty(massage)){
massage.substring(0,massage.length()-1); massage.substring(0,massage.length()-1);
errorList.add(importItembasic); errorList.add(importItembasic);
return;
} }
// 判断如果不存在,在进行插入 if(errorList != null){
ItembasicDO existItembasic = itembasicMapper.selectByCode(importItembasic.getCode()); // 判断如果不存在,在进行插入
if (existItembasic == null&& mode != 3) { ItembasicDO existItembasic = itembasicMapper.selectByCode(importItembasic.getCode());
itembasicMapper.insert(ItembasicConvert.INSTANCE.convert(importItembasic)); if (existItembasic == null&& mode != 3) {
} itembasicMapper.insert(ItembasicConvert.INSTANCE.convert(importItembasic));
else if (existItembasic != null && mode != 2) {// 如果存在,判断是否允许更新 }
ItembasicDO itembasicDO = ItembasicConvert.INSTANCE.convert(importItembasic); else if (existItembasic != null && mode != 2) {// 如果存在,判断是否允许更新
itembasicDO.setId(existItembasic.getId()); ItembasicDO itembasicDO = ItembasicConvert.INSTANCE.convert(importItembasic);
itembasicMapper.updateById(itembasicDO); itembasicDO.setId(existItembasic.getId());
itembasicMapper.updateById(itembasicDO);
}
} }
}); });
//错误不为空并非部分更新,手工回滚 //错误不为空并非部分更新,手工回滚

Loading…
Cancel
Save