1、相同物料异常检查(物料编码+项目类别)

This commit is contained in:
大米 2024-05-02 16:18:42 +08:00
parent 77197c169a
commit f050f869c4
2 changed files with 8 additions and 1 deletions

View File

@ -1,5 +1,6 @@
package com.nflg.product.bomnew.pojo.vo; package com.nflg.product.bomnew.pojo.vo;
import cn.hutool.core.util.StrUtil;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ -328,6 +329,12 @@ public class BomNewEbomParentVO extends BaseMaterialVO implements Serializable {
@ApiModelProperty(value = "待复核根节点") @ApiModelProperty(value = "待复核根节点")
private Integer rootIsForWaitReview; private Integer rootIsForWaitReview;
private String materialNoAndProductType;
public String getMaterialNoAndProductType() {
return (StrUtil.isBlank(getMaterialNo())?"":getMaterialNo())+(StrUtil.isBlank(getProjectType())?"":getProjectType());
}
private List<BomNewEbomParentVO> childNodes = Collections.emptyList(); private List<BomNewEbomParentVO> childNodes = Collections.emptyList();
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -156,7 +156,7 @@ public class CheckEBomException {
//是否存在重复物料 //是否存在重复物料
List<BomNewEbomParentVO> hasMaterialNoList = child.stream().filter(u -> StrUtil.isNotBlank(u.getMaterialNo())).collect(Collectors.toList()); List<BomNewEbomParentVO> hasMaterialNoList = child.stream().filter(u -> StrUtil.isNotBlank(u.getMaterialNo())).collect(Collectors.toList());
Map<String, List<BomNewEbomParentVO>> childMaterialMap = ListCommonUtil.listGroupMap(hasMaterialNoList, BomNewEbomParentVO::getMaterialNo); Map<String, List<BomNewEbomParentVO>> childMaterialMap = ListCommonUtil.listGroupMap(hasMaterialNoList, BomNewEbomParentVO::getMaterialNoAndProductType);
for (String key : childMaterialMap.keySet()) { for (String key : childMaterialMap.keySet()) {
List<BomNewEbomParentVO> materialGroupList = childMaterialMap.get(key); List<BomNewEbomParentVO> materialGroupList = childMaterialMap.get(key);
if (materialGroupList.size() > 1) { if (materialGroupList.size() > 1) {