|
|
|
@ -387,10 +387,15 @@ public class SubController {
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
gltGCalGrp = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
gltGCal2Grp = new ArrayList<>();
|
|
|
|
|
//二次分组
|
|
|
|
|
SetGrpDataBySlab(p);
|
|
|
|
|
|
|
|
|
|
SetGrpConBinDataBySlab(p);
|
|
|
|
|
//数据小的情况,计算拼板。数据量大不计算
|
|
|
|
|
if (gltGCalGrp.size()<=100)
|
|
|
|
|
{
|
|
|
|
|
SetGrpConBinDataBySlab(p);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
logger.info("***二次分组1数量*** " + gltGCalGrp.size());
|
|
|
|
|
|
|
|
|
@ -448,24 +453,24 @@ public class SubController {
|
|
|
|
|
logger.info("所有结果数据板坯号:{};数量:{}", p.getSlabNo(), gltGGrpCalRslt.size());
|
|
|
|
|
logger.info("选择结果数据板坯号:{};数量:{}", p.getSlabNo(), gltSelGGrpCalRslt.size());
|
|
|
|
|
}
|
|
|
|
|
// if (gltSelGGrpCalRslt.size() > 0) {
|
|
|
|
|
// now = new Date();
|
|
|
|
|
// //存储数据,组板结果
|
|
|
|
|
// SaveHisData(p);
|
|
|
|
|
// //数据整理
|
|
|
|
|
// SetSaveDate(p,organizationId);
|
|
|
|
|
// //开启事务
|
|
|
|
|
// //TransactionStatus transactionStatus = transactionService.begin();
|
|
|
|
|
// try {
|
|
|
|
|
// //保存数据
|
|
|
|
|
// SaveData(p,organizationId);
|
|
|
|
|
// //transactionService.commit(transactionStatus);
|
|
|
|
|
// } catch (Exception e) {
|
|
|
|
|
// logger.error("保存事务回滚:" + p.getSlabNo(), e);
|
|
|
|
|
// //回滚事务
|
|
|
|
|
// //transactionService.rollback(transactionStatus);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
if (gltSelGGrpCalRslt.size() > 0) {
|
|
|
|
|
now = new Date();
|
|
|
|
|
//存储数据,组板结果
|
|
|
|
|
SaveHisData(p);
|
|
|
|
|
//数据整理
|
|
|
|
|
SetSaveDate(p,organizationId);
|
|
|
|
|
//开启事务
|
|
|
|
|
//TransactionStatus transactionStatus = transactionService.begin();
|
|
|
|
|
try {
|
|
|
|
|
//保存数据
|
|
|
|
|
SaveData(p,organizationId);
|
|
|
|
|
//transactionService.commit(transactionStatus);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("保存事务回滚:" + p.getSlabNo(), e);
|
|
|
|
|
//回滚事务
|
|
|
|
|
//transactionService.rollback(transactionStatus);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("板坯报错:" + p.getSlabNo(), e);
|
|
|
|
@ -957,6 +962,9 @@ public class SubController {
|
|
|
|
|
//标准
|
|
|
|
|
GCG.setSG_STD(GCG.getLtInfoGPreOrder().get(0).getInfoPmProContProdAttrDO().getSgStd());
|
|
|
|
|
|
|
|
|
|
//内部钢种
|
|
|
|
|
GCG.setST_NO(GCG.getLtInfoGPreOrder().get(0).getST_NO());
|
|
|
|
|
|
|
|
|
|
//压缩比
|
|
|
|
|
BigDecimal decThkRate =decThkOrd.divide(SInfo.getSlabActThk(), 2, RoundingMode.HALF_UP);
|
|
|
|
|
|
|
|
|
@ -1089,8 +1097,6 @@ public class SubController {
|
|
|
|
|
//厚度
|
|
|
|
|
GCG.setThk(decThk);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//切边
|
|
|
|
|
GCG.setWid_Add(intTrimWid);
|
|
|
|
|
|
|
|
|
@ -1121,7 +1127,7 @@ public class SubController {
|
|
|
|
|
//宽度满足要求和厚度相同
|
|
|
|
|
if (f.getWid()+e.getWid()<4980
|
|
|
|
|
&& e.getThk().compareTo(f.getThk())==0
|
|
|
|
|
&& e.getSG_STD().equals(f.getSG_STD())
|
|
|
|
|
&& e.getST_NO().equals(f.getST_NO())
|
|
|
|
|
&& e.getThickTolMin().compareTo(f.getThickTolMin())==0
|
|
|
|
|
&& e.getThickTolMax().compareTo(f.getThickTolMax())==0
|
|
|
|
|
){
|
|
|
|
@ -1176,6 +1182,9 @@ public class SubController {
|
|
|
|
|
|
|
|
|
|
GPO.getLtInfoCombGPreOrder().add(GCB2);
|
|
|
|
|
|
|
|
|
|
//内部钢种
|
|
|
|
|
GPO.setST_NO(GPO1.getST_NO());
|
|
|
|
|
|
|
|
|
|
// 设置厚度
|
|
|
|
|
GPO.setThk(GPO1.getInfoPmProContProdAttrDO().getOrderThick());
|
|
|
|
|
// 设置宽度
|
|
|
|
@ -1208,9 +1217,12 @@ public class SubController {
|
|
|
|
|
if (gltGCal2Grp.stream().filter(p ->
|
|
|
|
|
p.getLtInfoGPreOrder().stream().anyMatch(q ->
|
|
|
|
|
q.getLtInfoCombGPreOrder().stream().anyMatch(r ->
|
|
|
|
|
r.getInfoGPreOrder()!=null && r.getInfoGPreOrder().getOrderNo().equals(GPO1.getOrderNo()) )
|
|
|
|
|
r.getInfoGPreOrder()!=null
|
|
|
|
|
&& r.getInfoGPreOrder().getOrderNo().equals(GPO1.getOrderNo()) )
|
|
|
|
|
&& q.getLtInfoCombGPreOrder().stream().anyMatch(r ->
|
|
|
|
|
r.getInfoGPreOrder()!=null && r.getInfoGPreOrder().getOrderNo().equals(GPO2.getOrderNo())))).count() > 0) {
|
|
|
|
|
r.getInfoGPreOrder()!=null
|
|
|
|
|
&& r.getInfoGPreOrder().getOrderNo().equals(GPO2.getOrderNo()))))
|
|
|
|
|
.count() > 0) {
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
@ -1247,6 +1259,9 @@ public class SubController {
|
|
|
|
|
//相同组合信息
|
|
|
|
|
GCG.getLtInfoGPreOrder().add(GPO);
|
|
|
|
|
|
|
|
|
|
//内部钢种
|
|
|
|
|
GCG.setST_NO(GPO.getST_NO());
|
|
|
|
|
|
|
|
|
|
//标准
|
|
|
|
|
GCG.setSG_STD(GPO.getInfoPmProContProdAttrDO().getSgStd());
|
|
|
|
|
|
|
|
|
@ -1464,9 +1479,9 @@ public class SubController {
|
|
|
|
|
ltLrc = plistQdToLineupResultCheDO.stream().filter(p -> p.getOrderNo().equals(GrpOrd.getOrderNo()) && p.getCheType().equals("RX")).collect(Collectors.toList());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//信息不存在返回
|
|
|
|
|
//信息不存在返回 TODO:订单信息不存在,化学成分验证成功
|
|
|
|
|
if (ltLrc.size() == 0) {
|
|
|
|
|
return false;
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<QeTqHeatcheStandResultDO> ltQthsr = plistQeTqHeatcheStandResultDO.stream().filter(p -> p.getPono().equals(SInfo.getPono())).collect(Collectors.toList());
|
|
|
|
@ -1986,6 +2001,8 @@ public class SubController {
|
|
|
|
|
GPO.setInfoPmContMscTechDO(pcmt);
|
|
|
|
|
//合同
|
|
|
|
|
GPO.setInfoQdToPoOrderDO(qtpo);
|
|
|
|
|
//内部钢种
|
|
|
|
|
GPO.setST_NO(pcmt.getStNo());
|
|
|
|
|
|
|
|
|
|
// 将创建的订单对象添加到全局订单列表中
|
|
|
|
|
gltOrder.add(GPO);
|
|
|
|
@ -2078,12 +2095,12 @@ public class SubController {
|
|
|
|
|
// 检查当前订单是否与已有的分组匹配
|
|
|
|
|
if (gltGrpOrderFir.stream().anyMatch(e -> e.getWid().equals(p.getInfoPmProContProdAttrDO().getOrderWidth()) &&
|
|
|
|
|
e.getThk().equals(p.getInfoPmProContProdAttrDO().getOrderThick()) &&
|
|
|
|
|
e.getSG_STD().equals(p.getInfoPmProContProdAttrDO().getSgStd()))) {
|
|
|
|
|
e.getST_NO().equals(p.getInfoPmContMscTechDO().getStNo()))) {
|
|
|
|
|
|
|
|
|
|
// 如果匹配成功,将订单添加到相应的分组中
|
|
|
|
|
GGrpOrderFir GGOF = gltGrpOrderFir.stream().filter(e -> e.getWid().equals(p.getInfoPmProContProdAttrDO().getOrderWidth())
|
|
|
|
|
&& e.getThk().equals(p.getInfoPmProContProdAttrDO().getOrderThick())
|
|
|
|
|
&& e.getSG_STD().equals(p.getInfoPmProContProdAttrDO().getSgStd())
|
|
|
|
|
&& e.getST_NO().equals(p.getInfoPmContMscTechDO().getStNo())
|
|
|
|
|
).findFirst().orElse(null);
|
|
|
|
|
if (GGOF.getLtInfoGPreOrder() == null) {
|
|
|
|
|
GGOF.setLtInfoGPreOrder(new ArrayList<>()); // 确保列表已初始化
|
|
|
|
@ -2099,7 +2116,7 @@ public class SubController {
|
|
|
|
|
GGOF.setThk(p.getInfoPmProContProdAttrDO().getOrderThick());
|
|
|
|
|
//GGOF.setLen(p.getInfoPmProContProdAttrDO().getOrderLen());
|
|
|
|
|
GGOF.setSG_STD(p.getInfoPmProContProdAttrDO().getSgStd());
|
|
|
|
|
|
|
|
|
|
GGOF.setST_NO(p.getInfoPmContMscTechDO().getStNo());
|
|
|
|
|
GGOF.setLtInfoGPreOrder(new ArrayList<>()); // 初始化列表
|
|
|
|
|
GGOF.getLtInfoGPreOrder().add(p);
|
|
|
|
|
gltGrpOrderFir.add(GGOF);
|
|
|
|
@ -2198,13 +2215,14 @@ public class SubController {
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
logger.info("***交叉分组ID:" + e.getIDValue() + "--" + f.getIDValue());
|
|
|
|
|
logger.info("***交叉分组Wid:" + e.getWid() + "--" + f.getWid());
|
|
|
|
|
//e和f的宽度差绝对值小于500,宽度合小于4980,厚度相同
|
|
|
|
|
if (Math.abs(e.getWid() - f.getWid()) <500
|
|
|
|
|
&& e.getWid() + f.getWid() < 4980
|
|
|
|
|
&& Math.max(e.getWid(),f.getWid()) < 4900
|
|
|
|
|
&& e.getThk().compareTo(f.getThk()) == 0
|
|
|
|
|
&& e.getSG_STD().equals(f.getSG_STD())
|
|
|
|
|
&& e.getThickTolMin().compareTo(f.getThickTolMin()) == 0
|
|
|
|
|
&& e.getThickTolMax().compareTo(f.getThickTolMax()) == 0
|
|
|
|
|
&& e.getST_NO().equals(f.getST_NO())
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
|
|
//实例化计算结果数组
|
|
|
|
@ -2703,7 +2721,11 @@ public class SubController {
|
|
|
|
|
|
|
|
|
|
// 筛选 UseFlg == 1 的数据
|
|
|
|
|
List<GGrpCalRslt> filteredList = gltGGrpCalRslt.stream()
|
|
|
|
|
.filter(g -> Objects.nonNull(g) && Objects.nonNull(g.getIntUseFlg()) && g.getIntUseFlg() == 1)
|
|
|
|
|
.filter(g -> Objects.nonNull(g)
|
|
|
|
|
&& Objects.nonNull(g.getIntUseFlg())
|
|
|
|
|
&& g.getIntUseFlg() == 1
|
|
|
|
|
&& g.getLtActInfoGPreOrder().stream().anyMatch(m->m.getCombinationFlag()==1)
|
|
|
|
|
&& g.getLtActInfoGPreOrder().stream().anyMatch(m->m.getCombinationFlag()==0))
|
|
|
|
|
.collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
// 找到重量最大成材率最大的数据
|
|
|
|
|