fix(ebom): 编辑页面添加T类型物料的设置优化

This commit is contained in:
曹鹏飞 2024-05-17 17:29:33 +08:00
parent 33fd163cbd
commit e9ed71800c
1 changed files with 33 additions and 16 deletions

View File

@ -209,12 +209,25 @@ public class EBomEdit {
if(StrUtil.isEmpty(child.getOrderNumber())){ if(StrUtil.isEmpty(child.getOrderNumber())){
child.setOrderNumber("00"); child.setOrderNumber("00");
} }
child.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue()); if (dto.getOpType() == 2) {
// parent.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue()); child.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue());
checkExcept(dto.getParent(), child); // parent.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue());
checkExcept(dto.getParent(), child);
}
if (StrUtil.isNotBlank(child.getProjectType())) { if (StrUtil.isNotBlank(child.getProjectType())) {
child.setProjectType(child.getProjectType().toUpperCase()); child.setProjectType(child.getProjectType().toUpperCase());
} }
if (StrUtil.equals(BomConstant.PROJECT_TYPE_TEMPORARY, child.getProjectType(), true)) {
if (StrUtil.isBlank(child.getMaterialUnit())) {
child.setMaterialUnit("PC");
}
if (StrUtil.isBlank(child.getMaterialOriginalUnit())) {
child.setMaterialOriginalUnit("PC");
}
if (Objects.isNull(child.getNum())) {
child.setNum(BigDecimal.ONE);
}
}
} }
@ -224,23 +237,27 @@ public class EBomEdit {
private void checkExcept(BomNewEbomParentVO parent, BomNewEbomChildEntity child) { private void checkExcept(BomNewEbomParentVO parent, BomNewEbomChildEntity child) {
if (StrUtil.equals(BomConstant.PROJECT_TYPE_TEMPORARY, child.getProjectType(), true)) {
if (StrUtil.isBlank(child.getMaterialNo()) || Objects.isNull(child.getNum()) if (StrUtil.isBlank(child.getMaterialDesc())) {
|| BigDecimal.ZERO.compareTo(child.getNum()) >= 0) { child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_4.getValue());
child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_4.getValue());
} else if (StrUtil.isEmpty(child.getProjectType())) {
child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_8.getValue());
} else if (StrUtil.isNotBlank(parent.getProjectType())
&& StrUtil.containsAny(parent.getProjectType(), ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_Q.getValue(), ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_F.getValue())) {
if (StrUtil.equals(ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_Q.getValue(), child.getProjectType())) {
child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_9.getValue());
} }
if (StrUtil.equals(ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_F.getValue(), child.getProjectType())) { } else {
child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_10.getValue()); if (StrUtil.isBlank(child.getMaterialNo()) || Objects.isNull(child.getNum())
|| BigDecimal.ZERO.compareTo(child.getNum()) >= 0) {
child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_4.getValue());
} else if (StrUtil.isEmpty(child.getProjectType())) {
child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_8.getValue());
} else if (StrUtil.isNotBlank(parent.getProjectType())
&& StrUtil.containsAny(parent.getProjectType(), ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_Q.getValue(), ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_F.getValue())) {
if (StrUtil.equals(ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_Q.getValue(), child.getProjectType())) {
child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_9.getValue());
}
if (StrUtil.equals(ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_F.getValue(), child.getProjectType())) {
child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_10.getValue());
}
} }
} }
} }
void checkDataRule(BomNewEBomParentEditDTO dto) { void checkDataRule(BomNewEBomParentEditDTO dto) {