填负数系统报错,校验规则要优化

This commit is contained in:
jing's 2024-08-07 18:07:12 +08:00
parent a896dbd22e
commit 51a7f0c4a0
3 changed files with 13 additions and 14 deletions

View File

@ -2181,6 +2181,14 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
EBomExceptionStatusEnum.EXCEPT_NO_10.getValue() EBomExceptionStatusEnum.EXCEPT_NO_10.getValue()
}); });
if (CollectionUtil.isNotEmpty(eBomEdit.childEntities)) {
List<BomNewEbomParentVO> allBom = Convert.convert(new TypeReference<List<BomNewEbomParentVO>>() {
}, eBomEdit.childEntities);
CheckEBomException checkEBomException = new CheckEBomException(allBom);
checkEBomException.checkContainExcept(checkStatus);
}
if (eBomEdit.getParentEntity() != null) { if (eBomEdit.getParentEntity() != null) {
@ -2191,13 +2199,6 @@ public class BomNewEbomParentService extends ServiceImpl<BomNewEbomParentMapper,
} }
if (CollectionUtil.isNotEmpty(eBomEdit.childEntities)) {
List<BomNewEbomParentVO> allBom = Convert.convert(new TypeReference<List<BomNewEbomParentVO>>() {
}, eBomEdit.childEntities);
CheckEBomException checkEBomException = new CheckEBomException(allBom);
checkEBomException.checkContainExcept(checkStatus);
}
if (CollectionUtil.isNotEmpty(eBomEdit.childEntities)) { if (CollectionUtil.isNotEmpty(eBomEdit.childEntities)) {

View File

@ -130,7 +130,7 @@ public class CheckEBomException {
&& (MaterialGetEnum.MaterialStateEnum.STATE_NO_4.equalsValue(vo.getMaterialState()) && (MaterialGetEnum.MaterialStateEnum.STATE_NO_4.equalsValue(vo.getMaterialState())
|| MaterialGetEnum.MaterialStateEnum.STATE_NO_5.equalsValue(vo.getMaterialState()))) { || MaterialGetEnum.MaterialStateEnum.STATE_NO_5.equalsValue(vo.getMaterialState()))) {
vo.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_2.getValue()); vo.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_2.getValue());
} else if (StrUtil.isBlank(vo.getMaterialNo()) || Objects.isNull(vo.getNum()) || BigDecimal.ZERO.compareTo(vo.getNum()) >= 0) { } else if (StrUtil.isBlank(vo.getMaterialNo()) || Objects.isNull(vo.getNum())) {
vo.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_4.getValue()); vo.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_4.getValue());
} else if (StrUtil.isNotBlank(vo.getMaterialNo()) && Objects.isNull(vo.getMaterialState())) { } else if (StrUtil.isNotBlank(vo.getMaterialNo()) && Objects.isNull(vo.getMaterialState())) {
vo.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_7.getValue()); vo.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_7.getValue());

View File

@ -203,11 +203,12 @@ public class EBomEdit {
if(StrUtil.isEmpty(child.getOrderNumber())){ if(StrUtil.isEmpty(child.getOrderNumber())){
child.setOrderNumber("001"); child.setOrderNumber("001");
} }
if (dto.getOpType() == 2) { if (dto.getOpType() == EbomEditStatusEnum.HANDLER_FINISHED.getValue()) {
child.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue()); child.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue());
// parent.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue()); // parent.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue());
checkExcept(dto.getParent(), child); checkExcept(dto.getParent(), child);
} }
if (StrUtil.isNotBlank(child.getProjectType())) { if (StrUtil.isNotBlank(child.getProjectType())) {
child.setProjectType(child.getProjectType().toUpperCase()); child.setProjectType(child.getProjectType().toUpperCase());
} }
@ -241,8 +242,7 @@ public class EBomEdit {
child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_4.getValue()); child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_4.getValue());
} }
} else { } else {
if (StrUtil.isBlank(child.getMaterialNo()) || Objects.isNull(child.getNum()) if (StrUtil.isBlank(child.getMaterialNo()) || Objects.isNull(child.getNum())) {
|| 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())) { } else if (StrUtil.isEmpty(child.getProjectType())) {
child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_8.getValue()); child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_8.getValue());
@ -251,9 +251,7 @@ public class EBomEdit {
if (StrUtil.equals(ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_Q.getValue(), child.getProjectType())) { if (StrUtil.equals(ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_Q.getValue(), child.getProjectType())) {
child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_9.getValue()); child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_9.getValue());
} }
// if (StrUtil.equals(ProjectTypeInputTypeEnum.ProjectTypeEnum.TYPE_F.getValue(), child.getProjectType())) {
// child.setExceptionStatus(EBomExceptionStatusEnum.EXCEPT_NO_10.getValue());
// }
} }
} }