|
|
|
@ -169,7 +169,7 @@ public class SubServiceImpl implements SubService {
|
|
|
|
|
|
|
|
|
|
private static int intOrdNum = 0;
|
|
|
|
|
|
|
|
|
|
private static int intGrpNum = 0;
|
|
|
|
|
// private static int intGrpNum = 0;
|
|
|
|
|
|
|
|
|
|
private static int intGrp2Num = 0;
|
|
|
|
|
|
|
|
|
@ -272,6 +272,7 @@ public class SubServiceImpl implements SubService {
|
|
|
|
|
|
|
|
|
|
private static List<ChkLowResult> plistLowChkRsult= new ArrayList<>();
|
|
|
|
|
//endregion
|
|
|
|
|
private static AtomicInteger intGrpNum = new AtomicInteger(0);
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public JsonData SubData(PmSubHis pmSubHis, Long organizationId) {
|
|
|
|
@ -449,6 +450,7 @@ public class SubServiceImpl implements SubService {
|
|
|
|
|
subLogStr += "-----结果数据数量1" + gltGGrpCalRslt.size() + "-----结果数据数量2" + gltSelGGrpCalRslt.size();
|
|
|
|
|
}
|
|
|
|
|
subLog.setSubLog(subLogStr);
|
|
|
|
|
|
|
|
|
|
if (gltSelGGrpCalRslt.size() > 0) {
|
|
|
|
|
now = new Date();
|
|
|
|
|
//存储数据,组板结果
|
|
|
|
@ -1189,7 +1191,16 @@ public class SubServiceImpl implements SubService {
|
|
|
|
|
&& e.getThk().compareTo(f.getThk())==0
|
|
|
|
|
&& e.getST_NO().equals(f.getST_NO())
|
|
|
|
|
&& e.getMscLineNo().equals(f.getMscLineNo())
|
|
|
|
|
&& ChkCombinationGrpFlag(e,f)
|
|
|
|
|
&& nvl(e.getWHOLE_HEAT_TREATMENT_TYPE(),"").equals(nvl(f.getWHOLE_HEAT_TREATMENT_TYPE(),""))
|
|
|
|
|
&& nvl(e.getCUT_MODE_CODE(),"").equals(nvl(f.getCUT_MODE_CODE(),""))
|
|
|
|
|
&& nvl(e.getCOOL_CODE(),"").equals(nvl(f.getCOOL_CODE(),""))
|
|
|
|
|
&& nvl(e.getTWO_ROLL_FLAG(),"").equals(nvl(f.getTWO_ROLL_FLAG(),""))
|
|
|
|
|
&& nvl(e.getPROD_SIDE_MARK(),"").equals(nvl(f.getPROD_SIDE_MARK(),""))
|
|
|
|
|
&& nvl(e.getCHECK_METHOD_CODE(),"").equals(nvl(f.getCHECK_METHOD_CODE(),""))
|
|
|
|
|
&& nvl(e.getACCP_AUTH_CODE(),"").equals(nvl(f.getACCP_AUTH_CODE(),""))
|
|
|
|
|
&& nvl(e.getFIN_CUST_CODE(),"").equals(nvl(f.getFIN_CUST_CODE(),""))
|
|
|
|
|
&& nvl(e.getULT_CODE(),"").equals(nvl(f.getULT_CODE(),""))
|
|
|
|
|
&& nvl(e.getTRIM_CODE(),"").equals(nvl(f.getTRIM_CODE(),""))
|
|
|
|
|
&& e.getThickTolMin().compareTo(f.getThickTolMin())==0
|
|
|
|
|
&& e.getThickTolMax().compareTo(f.getThickTolMax())==0
|
|
|
|
|
){
|
|
|
|
@ -2350,14 +2361,32 @@ public class SubServiceImpl implements SubService {
|
|
|
|
|
if (gltGrpOrderFir.stream().anyMatch(e -> e.getWid().equals(p.getInfoPmProContProdAttrDO().getOrderWidth())
|
|
|
|
|
&& e.getThk().equals(p.getInfoPmProContProdAttrDO().getOrderThick())
|
|
|
|
|
&& e.getST_NO().equals(p.getInfoPmContMscTechDO().getStNo())
|
|
|
|
|
&& ChkCombinationOrderFlag(e,p)
|
|
|
|
|
&& nvl(e.getWHOLE_HEAT_TREATMENT_TYPE(),"").equals(nvl(p.getWHOLE_HEAT_TREATMENT_TYPE(),""))
|
|
|
|
|
&& nvl(e.getCUT_MODE_CODE(),"").equals(nvl(p.getCUT_MODE_CODE(),""))
|
|
|
|
|
&& nvl(e.getCOOL_CODE(),"").equals(nvl(p.getCOOL_CODE(),""))
|
|
|
|
|
&& nvl(e.getTWO_ROLL_FLAG(),"").equals(nvl(p.getTWO_ROLL_FLAG(),""))
|
|
|
|
|
&& nvl(e.getPROD_SIDE_MARK(),"").equals(nvl(p.getPROD_SIDE_MARK(),""))
|
|
|
|
|
&& nvl(e.getCHECK_METHOD_CODE(),"").equals(nvl(p.getCHECK_METHOD_CODE(),""))
|
|
|
|
|
&& nvl(e.getACCP_AUTH_CODE(),"").equals(nvl(p.getACCP_AUTH_CODE(),""))
|
|
|
|
|
&& nvl(e.getFIN_CUST_CODE(),"").equals(nvl(p.getFIN_CUST_CODE(),""))
|
|
|
|
|
&& nvl(e.getULT_CODE(),"").equals(nvl(p.getULT_CODE(),""))
|
|
|
|
|
&& nvl(e.getTRIM_CODE(),"").equals(nvl(p.getTRIM_CODE(),""))
|
|
|
|
|
&& e.getLine().equals(p.getInfoPmContMscTechDO().getMscLineNo()))) {
|
|
|
|
|
|
|
|
|
|
// 如果匹配成功,将订单添加到相应的分组中
|
|
|
|
|
GGrpOrderFir GGOF = gltGrpOrderFir.stream().filter(e -> e.getWid().equals(p.getInfoPmProContProdAttrDO().getOrderWidth())
|
|
|
|
|
&& e.getThk().equals(p.getInfoPmProContProdAttrDO().getOrderThick())
|
|
|
|
|
&& e.getST_NO().equals(p.getInfoPmContMscTechDO().getStNo())
|
|
|
|
|
&& ChkCombinationOrderFlag(e,p)
|
|
|
|
|
&& nvl(e.getWHOLE_HEAT_TREATMENT_TYPE(),"").equals(nvl(p.getWHOLE_HEAT_TREATMENT_TYPE(),""))
|
|
|
|
|
&& nvl(e.getCUT_MODE_CODE(),"").equals(nvl(p.getCUT_MODE_CODE(),""))
|
|
|
|
|
&& nvl(e.getCOOL_CODE(),"").equals(nvl(p.getCOOL_CODE(),""))
|
|
|
|
|
&& nvl(e.getTWO_ROLL_FLAG(),"").equals(nvl(p.getTWO_ROLL_FLAG(),""))
|
|
|
|
|
&& nvl(e.getPROD_SIDE_MARK(),"").equals(nvl(p.getPROD_SIDE_MARK(),""))
|
|
|
|
|
&& nvl(e.getCHECK_METHOD_CODE(),"").equals(nvl(p.getCHECK_METHOD_CODE(),""))
|
|
|
|
|
&& nvl(e.getACCP_AUTH_CODE(),"").equals(nvl(p.getACCP_AUTH_CODE(),""))
|
|
|
|
|
&& nvl(e.getFIN_CUST_CODE(),"").equals(nvl(p.getFIN_CUST_CODE(),""))
|
|
|
|
|
&& nvl(e.getULT_CODE(),"").equals(nvl(p.getULT_CODE(),""))
|
|
|
|
|
&& nvl(e.getTRIM_CODE(),"").equals(nvl(p.getTRIM_CODE(),""))
|
|
|
|
|
&& e.getLine().equals(p.getInfoPmContMscTechDO().getMscLineNo())
|
|
|
|
|
).findFirst().orElse(null);
|
|
|
|
|
if (GGOF.getLtInfoGPreOrder() == null) {
|
|
|
|
@ -2369,7 +2398,7 @@ public class SubServiceImpl implements SubService {
|
|
|
|
|
|
|
|
|
|
// 如果没有匹配的分组,创建一个新的分组并添加该订单
|
|
|
|
|
GGrpOrderFir GGOF = new GGrpOrderFir();
|
|
|
|
|
GGOF.setIDValue(intGrpNum++);
|
|
|
|
|
GGOF.setIDValue(intGrpNum.getAndIncrement());
|
|
|
|
|
GGOF.setWid(p.getInfoPmProContProdAttrDO().getOrderWidth());
|
|
|
|
|
GGOF.setThk(p.getInfoPmProContProdAttrDO().getOrderThick());
|
|
|
|
|
//GGOF.setLen(p.getInfoPmProContProdAttrDO().getOrderLen());
|
|
|
|
@ -2406,7 +2435,6 @@ public class SubServiceImpl implements SubService {
|
|
|
|
|
GGOF.setTRIM_CODE(p.getTRIM_CODE());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GGOF.setLtInfoGPreOrder(new ArrayList<>()); // 初始化列表
|
|
|
|
|
GGOF.getLtInfoGPreOrder().add(p);
|
|
|
|
|
gltGrpOrderFir.add(GGOF);
|
|
|
|
@ -2421,6 +2449,64 @@ public class SubServiceImpl implements SubService {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SetGroupOrderFir2() {
|
|
|
|
|
// 使用 Map 来简化分组逻辑
|
|
|
|
|
Map<String, GGrpOrderFir> groupMap = new ConcurrentHashMap<>();
|
|
|
|
|
|
|
|
|
|
gltOrder.forEach(p -> {
|
|
|
|
|
String key = generateGroupKey(p);
|
|
|
|
|
|
|
|
|
|
// 使用 computeIfAbsent 来简化分组逻辑
|
|
|
|
|
GGrpOrderFir group = groupMap.computeIfAbsent(key, k -> {
|
|
|
|
|
GGrpOrderFir GGOF = new GGrpOrderFir();
|
|
|
|
|
GGOF.setIDValue(intGrpNum.getAndIncrement());
|
|
|
|
|
GGOF.setWid(BigDecimal.valueOf( p.getWid()));
|
|
|
|
|
GGOF.setThk(p.getThk());
|
|
|
|
|
GGOF.setSG_STD(p.getInfoPmProContProdAttrDO().getSgStd());
|
|
|
|
|
GGOF.setST_NO(p.getST_NO());
|
|
|
|
|
GGOF.setLine(p.getLine());
|
|
|
|
|
|
|
|
|
|
// 其他属性设置
|
|
|
|
|
GGOF.setWHOLE_HEAT_TREATMENT_TYPE(p.getWHOLE_HEAT_TREATMENT_TYPE());
|
|
|
|
|
GGOF.setCUT_MODE_CODE(p.getCUT_MODE_CODE());
|
|
|
|
|
GGOF.setCOOL_CODE(p.getCOOL_CODE());
|
|
|
|
|
GGOF.setTWO_ROLL_FLAG(p.getTWO_ROLL_FLAG());
|
|
|
|
|
GGOF.setAD_MODE_CODE(p.getAD_MODE_CODE());
|
|
|
|
|
GGOF.setCTRL_ROLL_CODE(p.getCTRL_ROLL_CODE());
|
|
|
|
|
GGOF.setPROD_SIDE_MARK(p.getPROD_SIDE_MARK());
|
|
|
|
|
GGOF.setCHECK_METHOD_CODE(p.getCHECK_METHOD_CODE());
|
|
|
|
|
GGOF.setACCP_AUTH_CODE(p.getACCP_AUTH_CODE());
|
|
|
|
|
GGOF.setFIN_CUST_CODE(p.getFIN_CUST_CODE());
|
|
|
|
|
GGOF.setULT_CODE(p.getULT_CODE());
|
|
|
|
|
GGOF.setTRIM_CODE(p.getTRIM_CODE());
|
|
|
|
|
|
|
|
|
|
GGOF.setLtInfoGPreOrder(new ArrayList<>()); // 初始化列表
|
|
|
|
|
return GGOF;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 将订单添加到相应的分组中
|
|
|
|
|
group.getLtInfoGPreOrder().add(p);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 将 Map 中的分组添加到 gltGrpOrderFir 列表中
|
|
|
|
|
gltGrpOrderFir.addAll(groupMap.values());
|
|
|
|
|
|
|
|
|
|
// 输出初始分组数量
|
|
|
|
|
logger.info("***初始分组数量:" + gltGrpOrderFir.size());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 生成分组的唯一键
|
|
|
|
|
*/
|
|
|
|
|
private String generateGroupKey(GPreOrder p) {
|
|
|
|
|
return String.format("%s_%s_%s_%s",
|
|
|
|
|
p.getInfoPmProContProdAttrDO().getOrderWidth().toString(),
|
|
|
|
|
p.getInfoPmProContProdAttrDO().getOrderThick().toString(),
|
|
|
|
|
p.getInfoPmContMscTechDO().getStNo(),
|
|
|
|
|
p.getInfoPmContMscTechDO().getMscLineNo());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean ChkCombinationOrderFlag(GGrpOrderFir GOF, GPreOrder GPO) {
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
@ -2683,7 +2769,7 @@ public class SubServiceImpl implements SubService {
|
|
|
|
|
|
|
|
|
|
gltGGrpCalRslt.add(GGCR);
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
logger.info("***计算结果异常:" + ex.getMessage());
|
|
|
|
|
logger.info("***计算结果异常1:" + ex);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -2713,7 +2799,16 @@ public class SubServiceImpl implements SubService {
|
|
|
|
|
&& e.getThk().compareTo(f.getThk()) == 0
|
|
|
|
|
&& e.getST_NO().equals(f.getST_NO())
|
|
|
|
|
&& e.getMscLineNo().equals(f.getMscLineNo())
|
|
|
|
|
&& ChkCombinationGrpFlag(e,f)
|
|
|
|
|
&& nvl(e.getWHOLE_HEAT_TREATMENT_TYPE(),"").equals(nvl(f.getWHOLE_HEAT_TREATMENT_TYPE(),""))
|
|
|
|
|
&& nvl(e.getCUT_MODE_CODE(),"").equals(nvl(f.getCUT_MODE_CODE(),""))
|
|
|
|
|
&& nvl(e.getCOOL_CODE(),"").equals(nvl(f.getCOOL_CODE(),""))
|
|
|
|
|
&& nvl(e.getTWO_ROLL_FLAG(),"").equals(nvl(f.getTWO_ROLL_FLAG(),""))
|
|
|
|
|
&& nvl(e.getPROD_SIDE_MARK(),"").equals(nvl(f.getPROD_SIDE_MARK(),""))
|
|
|
|
|
&& nvl(e.getCHECK_METHOD_CODE(),"").equals(nvl(f.getCHECK_METHOD_CODE(),""))
|
|
|
|
|
&& nvl(e.getACCP_AUTH_CODE(),"").equals(nvl(f.getACCP_AUTH_CODE(),""))
|
|
|
|
|
&& nvl(e.getFIN_CUST_CODE(),"").equals(nvl(f.getFIN_CUST_CODE(),""))
|
|
|
|
|
&& nvl(e.getULT_CODE(),"").equals(nvl(f.getULT_CODE(),""))
|
|
|
|
|
&& nvl(e.getTRIM_CODE(),"").equals(nvl(f.getTRIM_CODE(),""))
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
|
|
//实例化计算结果数组
|
|
|
|
@ -2776,7 +2871,7 @@ public class SubServiceImpl implements SubService {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
logger.info("***计算结果异常:" + ex.getMessage());
|
|
|
|
|
logger.info("***计算结果异常2:" + ex);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|