excel导入判断
This commit is contained in:
parent
996d5365c9
commit
2813a655e9
|
|
@ -615,18 +615,19 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
||||||
|
|
||||||
List<BomNewEBomImportExcelDTO> result = EecExcelUtil.getExcelContext(inputStream, BomNewEBomImportExcelDTO.class);
|
List<BomNewEBomImportExcelDTO> result = EecExcelUtil.getExcelContext(inputStream, BomNewEBomImportExcelDTO.class);
|
||||||
|
|
||||||
|
if(CollectionUtil.isEmpty(result)){
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
List<String> materialNos = result.stream().map(u -> u.getMaterialNo()).collect(Collectors.toList());
|
||||||
|
|
||||||
|
CheckEBomException.checkMaterialNoInMain1(materialNos));
|
||||||
|
EBomImportExcelCheck eBomImportExcelCheck=new EBomImportExcelCheck();
|
||||||
|
eBomImportExcelCheck.validData(result);
|
||||||
List<BomNewEbomParentVO> datas = Convert.convert(new TypeReference<List<BomNewEbomParentVO>>() {
|
List<BomNewEbomParentVO> datas = Convert.convert(new TypeReference<List<BomNewEbomParentVO>>() {
|
||||||
}, result);
|
}, result);
|
||||||
|
|
||||||
|
|
||||||
List<String> materialNos = datas.stream().map(u -> u.getMaterialNo()).collect(Collectors.toList());
|
|
||||||
//检查物料编码是否在主数据中存在
|
|
||||||
List<BaseMaterialVO> materialBaseInfo = SpringUtil.getBean(MaterialMainService.class).getMaterialBaseInfo(materialNos);
|
|
||||||
List<String> effectiveMaterialNos = materialBaseInfo.stream().map(u -> u.getMaterialNo()).collect(Collectors.toList());
|
|
||||||
Set<String> difference = Sets.difference(new HashSet<>(materialNos), new HashSet<>(effectiveMaterialNos));
|
|
||||||
VUtils.isTure(CollUtil.isNotEmpty(difference)).throwMessage(StrUtil.join(",", difference) + "在物料档案中不存在");
|
|
||||||
|
|
||||||
|
|
||||||
materialMainService.intiMaterialInfo(datas, BomNewEbomParentVO::getMaterialNo);
|
materialMainService.intiMaterialInfo(datas, BomNewEbomParentVO::getMaterialNo);
|
||||||
EBomEdit eBomEdit = new EBomEdit(EBomSourceEnum.FROM_EXCE.getValue());
|
EBomEdit eBomEdit = new EBomEdit(EBomSourceEnum.FROM_EXCE.getValue());
|
||||||
BomNewEBomParentEditDTO bomNewEBomParentEditDTO = new BomNewEBomParentEditDTO();
|
BomNewEBomParentEditDTO bomNewEBomParentEditDTO = new BomNewEBomParentEditDTO();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue