|
|
|
@ -387,23 +387,27 @@ public class SubController {
|
|
|
|
|
|
|
|
|
|
//被使用的订单数据实例化
|
|
|
|
|
plistOrdHis = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
// int intSlabCount = 0;
|
|
|
|
|
//循环板坯
|
|
|
|
|
plistSlab.forEach(p -> {
|
|
|
|
|
|
|
|
|
|
PmSubLog subLog = new PmSubLog();
|
|
|
|
|
subLog.setSlabNo(p.getSlabNo());
|
|
|
|
|
subLog.setSubMode(finalSubMode);
|
|
|
|
|
subLog.setSubRslt("成功");
|
|
|
|
|
subLog.setTenantId(organizationId);
|
|
|
|
|
PmSubLog subLog = new PmSubLog();
|
|
|
|
|
subLog.setSlabNo(p.getSlabNo());
|
|
|
|
|
subLog.setSubMode(finalSubMode);
|
|
|
|
|
subLog.setSubRslt("成功");
|
|
|
|
|
subLog.setTenantId(organizationId);
|
|
|
|
|
|
|
|
|
|
String subLogStr = "";
|
|
|
|
|
// int intSlabCountAdd=intSlabCount;
|
|
|
|
|
logger.info("*************--板坯开始{}************* ", p.getSlabNo());
|
|
|
|
|
|
|
|
|
|
String subLogStr = "";
|
|
|
|
|
logger.info("*************板坯开始{}************* ", p.getSlabNo());
|
|
|
|
|
logger.info("***板坯信息:{} 厚宽长:{}*{}*{} ", p.getSlabNo(), p.getSlabActThk(), p.getSlabActWid(), p.getSlabActLen());
|
|
|
|
|
//执行日志保存
|
|
|
|
|
subLogStr = "板坯信息 厚宽长:" + p.getSlabActThk() + "*" + p.getSlabActWid() + "*" + p.getSlabActLen();
|
|
|
|
|
// intSlabCount++;
|
|
|
|
|
|
|
|
|
|
// 判断板坯的长度是否在plistpmAutoSubSettingDO配置的范围内
|
|
|
|
|
logger.info("***板坯信息:{} 厚宽长:{}*{}*{} 钢种:{} ", p.getSlabNo(), p.getSlabActThk(), p.getSlabActWid(), p.getSlabActLen(), p.getStNo());
|
|
|
|
|
//执行日志保存
|
|
|
|
|
subLogStr = "板坯信息 厚宽长:" + p.getSlabActThk() + "*" + p.getSlabActWid() + "*" + p.getSlabActLen();
|
|
|
|
|
|
|
|
|
|
// 判断板坯的长度是否在plistpmAutoSubSettingDO配置的范围内
|
|
|
|
|
if (p.getSlabActLen().compareTo(plistpmAutoSubSettingDO.get(0).getMatLenMin()) < 0 && p.getSlabActLen().compareTo(plistpmAutoSubSettingDO.get(0).getMatLenMax()) > 0) {
|
|
|
|
|
logger.info("***板坯信息被排除:{} 长度不在范围内 ", p.getSlabNo());
|
|
|
|
|
return;
|
|
|
|
@ -515,22 +519,22 @@ public class SubController {
|
|
|
|
|
}
|
|
|
|
|
subLog.setSubLog(subLogStr);
|
|
|
|
|
if (gltSelGGrpCalRslt.size() > 0) {
|
|
|
|
|
// now = new Date();
|
|
|
|
|
// //存储数据,组板结果
|
|
|
|
|
// SaveHisData(p);
|
|
|
|
|
// //数据整理
|
|
|
|
|
// SetSaveDate(p,organizationId);
|
|
|
|
|
// //开启事务
|
|
|
|
|
// //TransactionStatus transactionStatus = transactionService.begin();
|
|
|
|
|
// try {
|
|
|
|
|
// //保存数据
|
|
|
|
|
// SaveData(p,organizationId,subLog);
|
|
|
|
|
// //transactionService.commit(transactionStatus);
|
|
|
|
|
// } catch (Exception e) {
|
|
|
|
|
// logger.error("保存事务回滚:" + p.getSlabNo(), e);
|
|
|
|
|
// //回滚事务
|
|
|
|
|
// //transactionService.rollback(transactionStatus);
|
|
|
|
|
// }
|
|
|
|
|
now = new Date();
|
|
|
|
|
//存储数据,组板结果
|
|
|
|
|
SaveHisData(p);
|
|
|
|
|
//数据整理
|
|
|
|
|
SetSaveDate(p,organizationId);
|
|
|
|
|
//开启事务
|
|
|
|
|
//TransactionStatus transactionStatus = transactionService.begin();
|
|
|
|
|
try {
|
|
|
|
|
//保存数据
|
|
|
|
|
SaveData(p,organizationId,subLog);
|
|
|
|
|
//transactionService.commit(transactionStatus);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("保存事务回滚:" + p.getSlabNo(), e);
|
|
|
|
|
//回滚事务
|
|
|
|
|
//transactionService.rollback(transactionStatus);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
@ -1293,39 +1297,25 @@ public class SubController {
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
//
|
|
|
|
|
if (gltGCal2Grp.stream().filter(p ->
|
|
|
|
|
p.getLtInfoGPreOrder().stream().anyMatch(q ->
|
|
|
|
|
q.getLtInfoCombGPreOrder().stream().anyMatch(r ->
|
|
|
|
|
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) {
|
|
|
|
|
if (gltGCal2Grp.stream().filter(p -> p.getLtInfoGPreOrder().stream().anyMatch(q -> q.getOrderNo().contains(GPO1.getOrderNo())
|
|
|
|
|
&& q.getOrderNo().contains(GPO2.getOrderNo())
|
|
|
|
|
&& (q.getOrderNo().equals(GPO1.getOrderNo() + "_" + GPO2.getOrderNo())
|
|
|
|
|
|| q.getOrderNo().equals(GPO2.getOrderNo() + "_" + GPO1.getOrderNo())))
|
|
|
|
|
).count() > 0) {
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
if (gltGCal2Grp.stream().filter(p ->
|
|
|
|
|
p.getLtInfoGPreOrder().stream().anyMatch(q ->
|
|
|
|
|
q.getLtInfoCombGPreOrder().stream().anyMatch(r ->
|
|
|
|
|
r.getInfoGPreOrder()!=null && r.getInfoGPreOrder().getIDValue()==GPO1.getIDValue())
|
|
|
|
|
|| q.getLtInfoCombGPreOrder().stream().anyMatch(r ->
|
|
|
|
|
r.getInfoGPreOrder()!=null && r.getInfoGPreOrder().getIDValue()==GPO2.getIDValue()))).count()== 0) {
|
|
|
|
|
|
|
|
|
|
Optional<GCalGrp> GCG = gltGCal2Grp.stream().filter(p ->
|
|
|
|
|
p.getLtInfoGPreOrder().stream().anyMatch(q ->
|
|
|
|
|
q.getLtInfoCombGPreOrder().stream().anyMatch(r ->
|
|
|
|
|
r.getInfoGPreOrder()!=null && r.getInfoGPreOrder().getOrderNo().equals(GPO1.getOrderNo()))
|
|
|
|
|
&& q.getLtInfoCombGPreOrder().stream().anyMatch(r ->
|
|
|
|
|
r.getInfoGPreOrder()!=null && r.getInfoGPreOrder().getOrderNo().equals(GPO2.getOrderNo())))).collect(Collectors.toList()).stream().findFirst();
|
|
|
|
|
|
|
|
|
|
GCG.ifPresent(gcg -> {
|
|
|
|
|
gcg.getLtInfoGPreOrder().add(GPO);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
Optional<GCalGrp> GCG = gltGCal2Grp.stream().filter(p -> p.getLtInfoGPreOrder().stream().anyMatch(q -> q.getOrderNo().contains(GPO1.getOrderNo())
|
|
|
|
|
&& q.getOrderNo().contains(GPO2.getOrderNo())
|
|
|
|
|
&& (q.getOrderNo().equals(GPO1.getOrderNo() + "_" + GPO2.getOrderNo())
|
|
|
|
|
|| q.getOrderNo().equals(GPO2.getOrderNo() + "_" + GPO1.getOrderNo())))).collect(Collectors.toList()).stream().findFirst();
|
|
|
|
|
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
GCG.ifPresent(gcg -> {
|
|
|
|
|
gcg.getLtInfoGPreOrder().add(GPO);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
logger.info("添加2分组报错!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
@ -1511,6 +1501,18 @@ public class SubController {
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
logger.info("分组处理报错:{}",ex);
|
|
|
|
|
logger.info("分组处理报错:{}",GPO1.getOrderNo());
|
|
|
|
|
logger.info("分组处理报错:{}",GPO2.getOrderNo());
|
|
|
|
|
|
|
|
|
|
gltGCal2Grp.forEach(n -> {
|
|
|
|
|
if (n.getLtInfoGPreOrder().size() > 0) {
|
|
|
|
|
n.getIDValue();
|
|
|
|
|
n.getLtInfoGPreOrder().forEach(g -> {
|
|
|
|
|
logger.info(g.getOrderNo());
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
@ -2459,10 +2461,18 @@ public class SubController {
|
|
|
|
|
GGCR.setThk(e.getLtInfoGPreOrder().get(0).getThk());
|
|
|
|
|
//最大长度
|
|
|
|
|
GGCR.setCal_Len(intMaxLen);
|
|
|
|
|
//订单信息
|
|
|
|
|
GGCR.setLtInfoGPreOrder(e.getLtInfoGPreOrder());
|
|
|
|
|
//合并订单信息
|
|
|
|
|
GGCR.getLtInfoGPreOrder().addAll(f.getLtInfoGPreOrder());
|
|
|
|
|
|
|
|
|
|
// 合并 e 和 f 的 LtInfoGPreOrder 列表
|
|
|
|
|
CopyOnWriteArrayList<GPreOrder> combinedList = new CopyOnWriteArrayList<>(e.getLtInfoGPreOrder());
|
|
|
|
|
combinedList.addAll(f.getLtInfoGPreOrder());
|
|
|
|
|
|
|
|
|
|
// 设置合并后的列表到 GGCR
|
|
|
|
|
GGCR.setLtInfoGPreOrder(combinedList);
|
|
|
|
|
//
|
|
|
|
|
// //合并订单信息
|
|
|
|
|
// GGCR.setLtInfoGPreOrder(e.getLtInfoGPreOrder() (f.getLtInfoGPreOrder()));
|
|
|
|
|
// //合并订单信息
|
|
|
|
|
// GGCR.getLtInfoGPreOrder().addAll();
|
|
|
|
|
|
|
|
|
|
ltTempGrp.add(GGCR);
|
|
|
|
|
|
|
|
|
@ -2812,6 +2822,8 @@ public class SubController {
|
|
|
|
|
log.error("new1", e);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
logger.info("计算gltGGrpCalRslt:" + gltGGrpCalRslt.size());
|
|
|
|
|
|
|
|
|
|
//判断结果数据是否存在
|
|
|
|
|
if (gltGGrpCalRslt.size() == 0) {
|
|
|
|
|
return;
|
|
|
|
|