feat: 添加物料单位不一致的异常判断
This commit is contained in:
parent
2930ab3ba8
commit
349862a0de
|
|
@ -35,9 +35,8 @@ public enum EBomExceptionStatusEnum implements ValueEnum<Integer> {
|
|||
EXCEPT_NO_12(12, "数量需要用户确认"),
|
||||
EXCEPT_NO_13(13, "项目类型需要用户确认") ,
|
||||
EXCEPT_NO_14(14, "黄色警告(下级节点存在异常)"),
|
||||
EXCEPT_NO_15(15, "物料名称不一致");
|
||||
|
||||
|
||||
EXCEPT_NO_15(15, "物料名称不一致"),
|
||||
EXCEPT_NO_16(16, "物料单位不一致");
|
||||
|
||||
private final Integer value;
|
||||
private final String description;
|
||||
|
|
|
|||
|
|
@ -42,4 +42,12 @@ public class BomNewDQbomVO extends BomNewDQbomParentEntity implements Serializab
|
|||
@TableField(value = "order_number")
|
||||
@ApiModelProperty(value = "排序号")
|
||||
private String orderNumber;
|
||||
|
||||
/**
|
||||
* 异常状态
|
||||
* @see com.nflg.product.bomnew.constant.EBomExceptionStatusEnum
|
||||
*/
|
||||
@TableField(value = "exception_status")
|
||||
@ApiModelProperty(value = "异常状态")
|
||||
private Integer exceptionStatus = -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,8 +13,10 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
|
|
@ -90,14 +92,20 @@ public class BomNewDQbomExceptionCheckService {
|
|||
assert parent != null;
|
||||
if ("T".equals(parent.getProjectType())) {
|
||||
child.setExceptionStatus(EBomExceptionStatusEnum.OK.getValue());
|
||||
} else if (child.getMaterialNo().startsWith("M")) {
|
||||
status = EBomExceptionStatusEnum.EXCEPT_NO_4;
|
||||
} else {
|
||||
BaseMaterialVO materialVO = materialVOS.stream().filter(v -> v.getMaterialNo().equals(parent.getMaterialNo())).findFirst().orElse(null);
|
||||
BaseMaterialVO materialVO = materialVOS.stream().filter(v -> v.getMaterialNo().equals(child.getMaterialNo())).findFirst().orElse(null);
|
||||
if (materialVO == null) {
|
||||
status = EBomExceptionStatusEnum.EXCEPT_NO_7;
|
||||
} else if (materialVO.getMaterialState().equals(MaterialGetEnum.MaterialStateEnum.STATE_NO_4.getValue())) {
|
||||
status = EBomExceptionStatusEnum.EXCEPT_NO_2;
|
||||
} else if (!materialVO.getMaterialName().equals(parent.getMaterialName())) {
|
||||
status = EBomExceptionStatusEnum.EXCEPT_NO_15;
|
||||
} else if (Objects.isNull(child.getNum()) || child.getNum().equals(BigDecimal.ZERO)) {
|
||||
status = EBomExceptionStatusEnum.EXCEPT_NO_4;
|
||||
} else if (Objects.equals(materialVO.getMaterialUnit(), parent.getMaterialUnit())) {
|
||||
status = EBomExceptionStatusEnum.EXCEPT_NO_16;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue