|
|
|
|
@ -1352,7 +1352,9 @@ public class OemStatementServiceImpl extends BaseServiceImpl<OemStatementMapper, |
|
|
|
|
Long caId = statementVO.getCaId(); |
|
|
|
|
String craftIds = statementVO.getCraftIds(); |
|
|
|
|
boolean isContain = false; |
|
|
|
|
if (caId != null && craftIds != null && !craftIds.isBlank()) { |
|
|
|
|
if (StringUtils.isEmpty(craftIds)) { |
|
|
|
|
isContain = true; |
|
|
|
|
} else if (caId != null) { |
|
|
|
|
String temp = "," + craftIds + ","; |
|
|
|
|
isContain = temp.contains("," + caId + ","); |
|
|
|
|
} |
|
|
|
|
@ -1529,21 +1531,29 @@ public class OemStatementServiceImpl extends BaseServiceImpl<OemStatementMapper, |
|
|
|
|
if (rule1(statementVO, price)) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
// (2) 供应商代码 + 工序 + 零件号 + 生产标识 + 现执行价格
|
|
|
|
|
// (2) 供应商代码 + 工序 + 零件号 + 计划单号 + 现执行价格
|
|
|
|
|
if (rule2(statementVO, price)) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
// (3) 供应商代码 + 生产标识 + 计划单号 + 标准工序代码
|
|
|
|
|
if (rule3(statementVO)) { |
|
|
|
|
// (3) 供应商代码 + 工序 + 零件号 + 生产标识 + 现执行价格
|
|
|
|
|
if (rule3(statementVO, price)) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
// (4) 供应商代码 + 生产标识 + 标准工序代码
|
|
|
|
|
if (rule4(statementVO)) { |
|
|
|
|
// (4) 供应商代码 + 工序 + 零件号 + 现执行价格
|
|
|
|
|
if (rule4(statementVO, price)) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
// (5) 供应商代码 + 生产标识 + 计划单号 + 标准工序代码
|
|
|
|
|
if (rule5(statementVO)) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
// (6) 供应商代码 + 生产标识 + 标准工序代码
|
|
|
|
|
if (rule6(statementVO)) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// (5) 供应商代码 + 标准工序代码 + 现执行价格
|
|
|
|
|
if (rule5(statementVO, price)) { |
|
|
|
|
// (7) 供应商代码 + 标准工序代码 + 现执行价格
|
|
|
|
|
if (rule7(statementVO, price)) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
statementVO.setRosStatus(StatementVO.ERR_SETTLEMENT); |
|
|
|
|
@ -1764,13 +1774,42 @@ public class OemStatementServiceImpl extends BaseServiceImpl<OemStatementMapper, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 匹配规则2 : 供应商代码 + 工序 + 零件号 + 生产标识 + 现执行价格 |
|
|
|
|
* 匹配规则2 : 供应商代码 + 工序 + 零件号 + 计划单号 + 现执行价格 |
|
|
|
|
* |
|
|
|
|
* @param statementVO |
|
|
|
|
* @param price |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private boolean rule2(StatementVO statementVO, BigDecimal price) { |
|
|
|
|
List<PriceSheetVO> priceSheetList = statementVO.getPriceSheetList(); |
|
|
|
|
if (CollectionUtils.isEmpty(priceSheetList)) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
// 结算单字段
|
|
|
|
|
String ocCode = statementVO.getOcCode(); |
|
|
|
|
String psName = statementVO.getPsName(); |
|
|
|
|
String partCode = statementVO.getPartCode(); |
|
|
|
|
String ypCode = statementVO.getYpCode(); |
|
|
|
|
for (PriceSheetVO sheet : priceSheetList) { |
|
|
|
|
boolean match = StringUtils.equals(sheet.getSplycode(), ocCode) && StringUtils.equals(sheet.getGxinfo(), psName) && StringUtils.equals(sheet.getPrtno(), partCode) && StringUtils.equals(sheet.getWono(), ypCode); |
|
|
|
|
if (match && price != null && price.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
|
match = PriceMatcher.isContainsPrice(sheet.getAu_ag_price(), price); |
|
|
|
|
} |
|
|
|
|
if (match && ruleTieredPricing(statementVO, sheet)) { |
|
|
|
|
return setSettlementInfo(statementVO, sheet); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 匹配规则3 : 供应商代码 + 工序 + 零件号 + 生产标识 + 现执行价格 |
|
|
|
|
* |
|
|
|
|
* @param statementVO |
|
|
|
|
* @param price |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private boolean rule3(StatementVO statementVO, BigDecimal price) { |
|
|
|
|
List<PriceSheetVO> priceSheetList = statementVO.getPriceSheetList(); |
|
|
|
|
if (CollectionUtils.isEmpty(priceSheetList)) { |
|
|
|
|
return false; |
|
|
|
|
@ -1793,12 +1832,40 @@ public class OemStatementServiceImpl extends BaseServiceImpl<OemStatementMapper, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 匹配规则3 : 供应商代码 + 生产标识 + 计划单号 + 标准工序代码 |
|
|
|
|
* 匹配规则4 : 供应商代码 + 工序 + 零件号 + 现执行价格 |
|
|
|
|
* |
|
|
|
|
* @param statementVO |
|
|
|
|
* @param price |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private boolean rule4(StatementVO statementVO, BigDecimal price) { |
|
|
|
|
List<PriceSheetVO> priceSheetList = statementVO.getPriceSheetList(); |
|
|
|
|
if (CollectionUtils.isEmpty(priceSheetList)) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
// 结算单字段
|
|
|
|
|
String ocCode = statementVO.getOcCode(); |
|
|
|
|
String psName = statementVO.getPsName(); |
|
|
|
|
String partCode = statementVO.getPartCode(); |
|
|
|
|
for (PriceSheetVO sheet : priceSheetList) { |
|
|
|
|
boolean match = StringUtils.equals(sheet.getSplycode(), ocCode) && StringUtils.equals(sheet.getGxinfo(), psName) && StringUtils.equals(sheet.getPrtno(), partCode); |
|
|
|
|
if (match && price != null && price.compareTo(BigDecimal.ZERO) != 0) { |
|
|
|
|
match = PriceMatcher.isContainsPrice(sheet.getAu_ag_price(), price); |
|
|
|
|
} |
|
|
|
|
if (match && ruleTieredPricing(statementVO, sheet)) { |
|
|
|
|
return setSettlementInfo(statementVO, sheet); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 匹配规则5 : 供应商代码 + 生产标识 + 计划单号 + 标准工序代码 |
|
|
|
|
* |
|
|
|
|
* @param statementVO |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private boolean rule3(StatementVO statementVO) { |
|
|
|
|
private boolean rule5(StatementVO statementVO) { |
|
|
|
|
List<PriceSheetVO> priceSheetList = statementVO.getPriceSheetList(); |
|
|
|
|
if (CollectionUtils.isEmpty(priceSheetList)) { |
|
|
|
|
return false; |
|
|
|
|
@ -1823,12 +1890,12 @@ public class OemStatementServiceImpl extends BaseServiceImpl<OemStatementMapper, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 匹配规则4 : 供应商代码 + 生产标识 + 标准工序代码 |
|
|
|
|
* 匹配规则6 : 供应商代码 + 生产标识 + 标准工序代码 |
|
|
|
|
* |
|
|
|
|
* @param statementVO |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private boolean rule4(StatementVO statementVO) { |
|
|
|
|
private boolean rule6(StatementVO statementVO) { |
|
|
|
|
List<PriceSheetVO> priceSheetList = statementVO.getPriceSheetList(); |
|
|
|
|
if (CollectionUtils.isEmpty(priceSheetList)) { |
|
|
|
|
return false; |
|
|
|
|
@ -1852,13 +1919,13 @@ public class OemStatementServiceImpl extends BaseServiceImpl<OemStatementMapper, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 匹配规则5 : 供应商代码 + 标准工序代码 + 现执行价格 |
|
|
|
|
* 匹配规则7 : 供应商代码 + 标准工序代码 + 现执行价格 |
|
|
|
|
* |
|
|
|
|
* @param statementVO |
|
|
|
|
* @param price |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
private boolean rule5(StatementVO statementVO, BigDecimal price) { |
|
|
|
|
private boolean rule7(StatementVO statementVO, BigDecimal price) { |
|
|
|
|
List<PriceSheetVO> priceSheetList = statementVO.getPriceSheetList(); |
|
|
|
|
if (CollectionUtils.isEmpty(priceSheetList)) { |
|
|
|
|
return false; |
|
|
|
|
|