|
|
|
@ -1355,7 +1355,7 @@ public class OemStatementServiceImpl extends BaseServiceImpl<OemStatementMapper, |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void matchStandardProcess(List<StatementVO> settlementVOs) { |
|
|
|
private void matchStandardProcess(List<StatementVO> settlementVOs) { |
|
|
|
// 根据工序Id分组
|
|
|
|
// 根据工序Id分组
|
|
|
|
Map<Long, List<StatementVO>> groupByPsId = settlementVOs.stream().collect(Collectors.groupingBy(StatementVO::getPsId)); |
|
|
|
Map<Long, List<StatementVO>> groupByPsId = settlementVOs.stream().collect(Collectors.groupingBy(StatementVO::getPpsId)); |
|
|
|
Set<Long> psIds = groupByPsId.keySet(); |
|
|
|
Set<Long> psIds = groupByPsId.keySet(); |
|
|
|
final int batchSize = 500; |
|
|
|
final int batchSize = 500; |
|
|
|
List<OemStandardProcessEntity> allStandardList = new ArrayList<>(); |
|
|
|
List<OemStandardProcessEntity> allStandardList = new ArrayList<>(); |
|
|
|
@ -1390,31 +1390,31 @@ public class OemStatementServiceImpl extends BaseServiceImpl<OemStatementMapper, |
|
|
|
} |
|
|
|
} |
|
|
|
// ====================== 规则1:仅【工序】,其他全为null ======================
|
|
|
|
// ====================== 规则1:仅【工序】,其他全为null ======================
|
|
|
|
for (OemStandardProcessEntity s : allStandardList) { |
|
|
|
for (OemStandardProcessEntity s : allStandardList) { |
|
|
|
boolean rule1 = Objects.equals(s.getProcessId(), statementVO.getPsId()) && StringUtils.isEmpty(s.getPlate()) && StringUtils.isEmpty(s.getPlateThickness()) && StringUtils.isEmpty(s.getPartName()); |
|
|
|
boolean rule1 = Objects.equals(s.getProcessId(), statementVO.getPpsId()) && StringUtils.isEmpty(s.getPlate()) && StringUtils.isEmpty(s.getPlateThickness()) && StringUtils.isEmpty(s.getPartName()); |
|
|
|
|
|
|
|
|
|
|
|
if (rule1) return s; |
|
|
|
if (rule1) return s; |
|
|
|
} |
|
|
|
} |
|
|
|
// ====================== 规则2:仅【工序+镀种】,其他null ======================
|
|
|
|
// ====================== 规则2:仅【工序+镀种】,其他null ======================
|
|
|
|
for (OemStandardProcessEntity s : allStandardList) { |
|
|
|
for (OemStandardProcessEntity s : allStandardList) { |
|
|
|
boolean rule2 = Objects.equals(s.getProcessId(), statementVO.getPsId()) && StringUtils.equals(s.getPlate(), statementVO.getPlate()) && StringUtils.isEmpty(s.getPlateThickness()) && StringUtils.isEmpty(s.getPartName()); |
|
|
|
boolean rule2 = Objects.equals(s.getProcessId(), statementVO.getPpsId()) && StringUtils.equals(s.getPlate(), statementVO.getPlate()) && StringUtils.isEmpty(s.getPlateThickness()) && StringUtils.isEmpty(s.getPartName()); |
|
|
|
|
|
|
|
|
|
|
|
if (rule2) return s; |
|
|
|
if (rule2) return s; |
|
|
|
} |
|
|
|
} |
|
|
|
// ====================== 规则3:仅【工序+镀层厚度】,其他null ======================
|
|
|
|
// ====================== 规则3:仅【工序+镀层厚度】,其他null ======================
|
|
|
|
for (OemStandardProcessEntity s : allStandardList) { |
|
|
|
for (OemStandardProcessEntity s : allStandardList) { |
|
|
|
boolean rule3 = Objects.equals(s.getProcessId(), statementVO.getPsId()) && StringUtils.isEmpty(s.getPlate()) && StringUtils.equals(s.getPlateThickness(), statementVO.getPlateThickness()) && StringUtils.isEmpty(s.getPartName()); |
|
|
|
boolean rule3 = Objects.equals(s.getProcessId(), statementVO.getPpsId()) && StringUtils.isEmpty(s.getPlate()) && StringUtils.equals(s.getPlateThickness(), statementVO.getPlateThickness()) && StringUtils.isEmpty(s.getPartName()); |
|
|
|
if (rule3) return s; |
|
|
|
if (rule3) return s; |
|
|
|
} |
|
|
|
} |
|
|
|
// ====================== 规则4:仅【工序+零件名】,其他null ======================
|
|
|
|
// ====================== 规则4:仅【工序+零件名】,其他null ======================
|
|
|
|
for (OemStandardProcessEntity s : allStandardList) { |
|
|
|
for (OemStandardProcessEntity s : allStandardList) { |
|
|
|
boolean rule4 = Objects.equals(s.getProcessId(), statementVO.getPsId()) && StringUtils.isEmpty(s.getPlate()) && StringUtils.isEmpty(s.getPlateThickness()) && StringUtils.equals(s.getPartName(), statementVO.getPartName()); |
|
|
|
boolean rule4 = Objects.equals(s.getProcessId(), statementVO.getPpsId()) && StringUtils.isEmpty(s.getPlate()) && StringUtils.isEmpty(s.getPlateThickness()) && StringUtils.equals(s.getPartName(), statementVO.getPartName()); |
|
|
|
|
|
|
|
|
|
|
|
if (rule4) return s; |
|
|
|
if (rule4) return s; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// ====================== 规则5:【工序+镀层厚度+零件名】,镀种null ======================
|
|
|
|
// ====================== 规则5:【工序+镀层厚度+零件名】,镀种null ======================
|
|
|
|
for (OemStandardProcessEntity s : allStandardList) { |
|
|
|
for (OemStandardProcessEntity s : allStandardList) { |
|
|
|
boolean rule5 = Objects.equals(s.getProcessId(), statementVO.getPsId()) && StringUtils.isEmpty(s.getPlate()) && StringUtils.equals(s.getPlateThickness(), statementVO.getPlateThickness()) && StringUtils.equals(s.getPartName(), statementVO.getPartName()); |
|
|
|
boolean rule5 = Objects.equals(s.getProcessId(), statementVO.getPpsId()) && StringUtils.isEmpty(s.getPlate()) && StringUtils.equals(s.getPlateThickness(), statementVO.getPlateThickness()) && StringUtils.equals(s.getPartName(), statementVO.getPartName()); |
|
|
|
if (rule5) return s; |
|
|
|
if (rule5) return s; |
|
|
|
} |
|
|
|
} |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
|