编辑提交
This commit is contained in:
parent
81a1bd6112
commit
f4f992e328
|
|
@ -8,7 +8,7 @@ import lombok.Getter;
|
|||
@Getter
|
||||
public enum EbomEditStatusEnum implements ValueEnum<Integer> {
|
||||
|
||||
HANDLER_CREATED(1, "待处理 "),
|
||||
HANDLER_CREATED(1, "待处理"),
|
||||
HANDLER_FINISHED(2, "处理完成");
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1130,17 +1130,19 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
});
|
||||
|
||||
|
||||
if(CollectionUtil.isNotEmpty(eBomEdit.childEntities)){
|
||||
|
||||
|
||||
List<BomNewEbomParentVO> allBom = Convert.convert(new TypeReference<List<BomNewEbomParentVO>>() {
|
||||
}, eBomEdit.childEntities);
|
||||
|
||||
if (CollectionUtil.isNotEmpty(eBomEdit.parentEntities)) {
|
||||
allBom.add(Convert.convert(BomNewEbomParentVO.class, eBomEdit.parentEntities.get(0)));
|
||||
}
|
||||
|
||||
CheckEBomException checkEBomException = new CheckEBomException(allBom);
|
||||
checkEBomException.initException();
|
||||
checkEBomException.initException("material", "materialTexture", "projectType");
|
||||
|
||||
checkEBomException.checkContainExcept(checkStatus);
|
||||
|
||||
}
|
||||
|
||||
if (CollectionUtil.isNotEmpty(eBomEdit.parentEntities)) {
|
||||
this.saveOrUpdateBatch(eBomEdit.parentEntities);
|
||||
|
|
@ -1157,7 +1159,9 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
deleteBomChild(dto.getDelDatas());
|
||||
}
|
||||
}
|
||||
ebomChildService.getBaseMapper().updateEBomMaterialUse();
|
||||
|
||||
// ebomChildService.getBaseMapper().updateEBomMaterialUse();
|
||||
ThreadUtil.execAsync(() -> computeLevelNumAndRootState());
|
||||
return true;
|
||||
|
||||
}
|
||||
|
|
@ -1175,6 +1179,8 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
|
|||
return;
|
||||
}
|
||||
List<BomNewEbomParentVO> delTagList = new ArrayList<>();
|
||||
CheckEBomException checkEBomException = new CheckEBomException(delList);
|
||||
checkEBomException.initException("material", "materialTexture", "projectType");
|
||||
//原始bom不正常
|
||||
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());
|
||||
|
|
|
|||
|
|
@ -146,8 +146,8 @@ public class EBomEdit {
|
|||
|
||||
}
|
||||
child.setEditStatus(dto.getOpType());
|
||||
parent.setCreatedJob(roleList.contains(EBomConstant.TECHNICIAN)?UserJobEnum.ENGINEER.getValue():UserJobEnum.DESIGNER.getValue());
|
||||
parent.setTotalWeight(NumberUtil.mul(child.getUnitWeight(), child.getNum()));
|
||||
// parent.setCreatedJob(roleList.contains(EBomConstant.TECHNICIAN)?UserJobEnum.ENGINEER.getValue():UserJobEnum.DESIGNER.getValue());
|
||||
// parent.setTotalWeight(NumberUtil.mul(child.getUnitWeight(), child.getNum()));
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -185,24 +185,26 @@ public class EBomEdit {
|
|||
} else {
|
||||
BomNewEbomParentEntity parent;
|
||||
|
||||
List<BomNewEbomParentVO> exceptList=new ArrayList<>();
|
||||
exceptList.addAll(dto.getDatas());
|
||||
|
||||
//缺bom
|
||||
if (dto.getParent().getBomRowId() == null || dto.getParent().getBomRowId().longValue() == 0) {
|
||||
dto.getParent().setBomRowId(dto.getParent().getRowId());
|
||||
exceptList.add(dto.getParent());
|
||||
CheckEBomException eBomException=new CheckEBomException( exceptList );
|
||||
eBomException.checkException();
|
||||
parent = createParentBomInfo(dto.getParent());
|
||||
parent.setEditStatus(dto.getOpType());
|
||||
|
||||
//工艺人员
|
||||
if(roleList.contains(EBomConstant.TECHNICIAN)){
|
||||
parent.setStatus(EBomStatusEnum.CHECKED.getValue());
|
||||
}
|
||||
|
||||
parentEntities.add(parent);
|
||||
}else {
|
||||
exceptList.add(dto.getParent());
|
||||
CheckEBomException eBomException=new CheckEBomException( exceptList );
|
||||
eBomException.checkException();
|
||||
parent = Convert.convert(BomNewEbomParentEntity.class, dto.getParent());
|
||||
parent.setEditStatus(dto.getOpType());
|
||||
//工艺人员
|
||||
if(roleList.contains(EBomConstant.TECHNICIAN)){
|
||||
parent.setStatus(EBomStatusEnum.CHECKED.getValue());
|
||||
}
|
||||
|
||||
parentEntities.add(parent);
|
||||
}
|
||||
|
||||
|
|
@ -216,31 +218,28 @@ public class EBomEdit {
|
|||
|
||||
//child.setProjectTypeInputType(ProjectTypeInputTypeEnum.MANUAL_INPUT.getValue());
|
||||
child.setTotalWeight(NumberUtil.mul(child.getUnitWeight(), child.getNum()));
|
||||
|
||||
child.setEditStatus(dto.getOpType());
|
||||
//新增数据
|
||||
if(child.getRowId()==null || child.getRowId().longValue()==0){
|
||||
child.setRowId(IdWorker.getId());
|
||||
child.setIdentityNo(StrUtil.join("-", parent.getRowId(), parent.getRowId()));
|
||||
|
||||
child.setSource(source);
|
||||
child.setEditStatus(EbomEditStatusEnum.HANDLER_CREATED.getValue());
|
||||
|
||||
child.setCreatedTime(LocalDateTime.now());
|
||||
child.setCreatedBy(SessionUtil.getUserCode());
|
||||
child.setSourceRowId(0l);
|
||||
child.setParentRowId(parent.getRowId());
|
||||
child.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue());
|
||||
parent.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue());
|
||||
|
||||
//工艺人员
|
||||
if(roleList.contains(EBomConstant.TECHNICIAN)){
|
||||
parent.setStatus(EBomStatusEnum.CHECKED.getValue());
|
||||
}
|
||||
// parent.setExceptionStatus(EBomExceptionStatusEnum.OK.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())){
|
||||
child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_8.getValue());
|
||||
|
|
|
|||
Loading…
Reference in New Issue