编辑提交

This commit is contained in:
jing's 2023-12-28 13:36:34 +08:00
parent 81a1bd6112
commit f4f992e328
3 changed files with 33 additions and 28 deletions

View File

@ -8,7 +8,7 @@ import lombok.Getter;
@Getter @Getter
public enum EbomEditStatusEnum implements ValueEnum<Integer> { public enum EbomEditStatusEnum implements ValueEnum<Integer> {
HANDLER_CREATED(1, "待处理 "), HANDLER_CREATED(1, "待处理"),
HANDLER_FINISHED(2, "处理完成"); HANDLER_FINISHED(2, "处理完成");

View File

@ -1130,17 +1130,19 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
}); });
if(CollectionUtil.isNotEmpty(eBomEdit.childEntities)){
List<BomNewEbomParentVO> allBom = Convert.convert(new TypeReference<List<BomNewEbomParentVO>>() { List<BomNewEbomParentVO> allBom = Convert.convert(new TypeReference<List<BomNewEbomParentVO>>() {
}, eBomEdit.childEntities); }, eBomEdit.childEntities);
if (CollectionUtil.isNotEmpty(eBomEdit.parentEntities)) {
allBom.add(Convert.convert(BomNewEbomParentVO.class, eBomEdit.parentEntities.get(0)));
}
CheckEBomException checkEBomException = new CheckEBomException(allBom); CheckEBomException checkEBomException = new CheckEBomException(allBom);
checkEBomException.initException(); checkEBomException.initException("material", "materialTexture", "projectType");
checkEBomException.checkContainExcept(checkStatus); checkEBomException.checkContainExcept(checkStatus);
}
if (CollectionUtil.isNotEmpty(eBomEdit.parentEntities)) { if (CollectionUtil.isNotEmpty(eBomEdit.parentEntities)) {
this.saveOrUpdateBatch(eBomEdit.parentEntities); this.saveOrUpdateBatch(eBomEdit.parentEntities);
@ -1157,7 +1159,9 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
deleteBomChild(dto.getDelDatas()); deleteBomChild(dto.getDelDatas());
} }
} }
ebomChildService.getBaseMapper().updateEBomMaterialUse();
// ebomChildService.getBaseMapper().updateEBomMaterialUse();
ThreadUtil.execAsync(() -> computeLevelNumAndRootState());
return true; return true;
} }
@ -1175,6 +1179,8 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
return; return;
} }
List<BomNewEbomParentVO> delTagList = new ArrayList<>(); List<BomNewEbomParentVO> delTagList = new ArrayList<>();
CheckEBomException checkEBomException = new CheckEBomException(delList);
checkEBomException.initException("material", "materialTexture", "projectType");
//原始bom不正常 //原始bom不正常
List<BomNewEbomParentVO> s1List = delList.stream().filter(u -> Objects.equals(EBomSourceEnum.FROM_BOM.getValue(), u.getSource()) List<BomNewEbomParentVO> s1List = delList.stream().filter(u -> Objects.equals(EBomSourceEnum.FROM_BOM.getValue(), u.getSource())
&& !Objects.equals(u.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue())).collect(Collectors.toList()); && !Objects.equals(u.getExceptionStatus(), EBomExceptionStatusEnum.OK.getValue())).collect(Collectors.toList());

View File

@ -146,8 +146,8 @@ public class EBomEdit {
} }
child.setEditStatus(dto.getOpType()); child.setEditStatus(dto.getOpType());
parent.setCreatedJob(roleList.contains(EBomConstant.TECHNICIAN)?UserJobEnum.ENGINEER.getValue():UserJobEnum.DESIGNER.getValue()); // parent.setCreatedJob(roleList.contains(EBomConstant.TECHNICIAN)?UserJobEnum.ENGINEER.getValue():UserJobEnum.DESIGNER.getValue());
parent.setTotalWeight(NumberUtil.mul(child.getUnitWeight(), child.getNum())); // parent.setTotalWeight(NumberUtil.mul(child.getUnitWeight(), child.getNum()));
} }
@ -185,24 +185,26 @@ public class EBomEdit {
} else { } else {
BomNewEbomParentEntity parent; BomNewEbomParentEntity parent;
List<BomNewEbomParentVO> exceptList=new ArrayList<>();
exceptList.addAll(dto.getDatas());
//缺bom //缺bom
if (dto.getParent().getBomRowId() == null || dto.getParent().getBomRowId().longValue() == 0) { if (dto.getParent().getBomRowId() == null || dto.getParent().getBomRowId().longValue() == 0) {
dto.getParent().setBomRowId(dto.getParent().getRowId()); dto.getParent().setBomRowId(dto.getParent().getRowId());
exceptList.add(dto.getParent());
CheckEBomException eBomException=new CheckEBomException( exceptList );
eBomException.checkException();
parent = createParentBomInfo(dto.getParent()); parent = createParentBomInfo(dto.getParent());
parent.setEditStatus(dto.getOpType()); parent.setEditStatus(dto.getOpType());
//工艺人员
if(roleList.contains(EBomConstant.TECHNICIAN)){
parent.setStatus(EBomStatusEnum.CHECKED.getValue());
}
parentEntities.add(parent); parentEntities.add(parent);
}else { }else {
exceptList.add(dto.getParent());
CheckEBomException eBomException=new CheckEBomException( exceptList );
eBomException.checkException();
parent = Convert.convert(BomNewEbomParentEntity.class, dto.getParent()); parent = Convert.convert(BomNewEbomParentEntity.class, dto.getParent());
parent.setEditStatus(dto.getOpType()); parent.setEditStatus(dto.getOpType());
//工艺人员
if(roleList.contains(EBomConstant.TECHNICIAN)){
parent.setStatus(EBomStatusEnum.CHECKED.getValue());
}
parentEntities.add(parent); parentEntities.add(parent);
} }
@ -216,31 +218,28 @@ public class EBomEdit {
//child.setProjectTypeInputType(ProjectTypeInputTypeEnum.MANUAL_INPUT.getValue()); //child.setProjectTypeInputType(ProjectTypeInputTypeEnum.MANUAL_INPUT.getValue());
child.setTotalWeight(NumberUtil.mul(child.getUnitWeight(), child.getNum())); child.setTotalWeight(NumberUtil.mul(child.getUnitWeight(), child.getNum()));
child.setEditStatus(dto.getOpType());
//新增数据 //新增数据
if(child.getRowId()==null || child.getRowId().longValue()==0){ if(child.getRowId()==null || child.getRowId().longValue()==0){
child.setRowId(IdWorker.getId()); child.setRowId(IdWorker.getId());
child.setIdentityNo(StrUtil.join("-", parent.getRowId(), parent.getRowId())); child.setIdentityNo(StrUtil.join("-", parent.getRowId(), parent.getRowId()));
child.setSource(source); child.setSource(source);
child.setEditStatus(EbomEditStatusEnum.HANDLER_CREATED.getValue());
child.setCreatedTime(LocalDateTime.now()); child.setCreatedTime(LocalDateTime.now());
child.setCreatedBy(SessionUtil.getUserCode()); child.setCreatedBy(SessionUtil.getUserCode());
child.setSourceRowId(0l); child.setSourceRowId(0l);
child.setParentRowId(parent.getRowId()); child.setParentRowId(parent.getRowId());
child.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue()); child.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue());
parent.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue()); // parent.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue());
//工艺人员
if(roleList.contains(EBomConstant.TECHNICIAN)){
parent.setStatus(EBomStatusEnum.CHECKED.getValue());
}
} }
child.setEditStatus(dto.getOpType());
parent.setCreatedJob(roleList.contains(EBomConstant.TECHNICIAN)?UserJobEnum.ENGINEER.getValue():UserJobEnum.DESIGNER.getValue());
parent.setTotalWeight(NumberUtil.mul(child.getUnitWeight(), child.getNum()));
child.setEditStatus(dto.getOpType());
// parent.setCreatedJob(roleList.contains(EBomConstant.TECHNICIAN)?UserJobEnum.ENGINEER.getValue():UserJobEnum.DESIGNER.getValue());
// parent.setTotalWeight(NumberUtil.mul(child.getUnitWeight(), child.getNum()));
if(StrUtil.isEmpty(child.getProjectType())){ if(StrUtil.isEmpty(child.getProjectType())){
child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_8.getValue()); child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_8.getValue());