2025-03-21

main
sunhao 2 weeks ago
parent 69bf3cc4f3
commit 4af54bed32

@ -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());
// 找到重量最大成材率最大的数据

@ -40,6 +40,9 @@ public class GCalGrp {
//标准
private String SG_STD;
//标准
private String ST_NO;
//宽度余量
private int Wid_Add;
//最大轧制长度

@ -20,6 +20,9 @@ public class GGrpOrderFir {
private Integer Len;
//标准
private String SG_STD;
//内部钢种
private String ST_NO;
//合同产线
private String Line ;
//合同信息

@ -35,6 +35,9 @@ public class GPreOrder {
//厚度
private BigDecimal Thk;
//内部钢种
private String ST_NO;
//长度
private int Len;

@ -27,7 +27,7 @@
LEFT JOIN PM_PD_SLAB PPS ON PPS.SLAB_NO = MS.SLAB_NO --PM_PD_SLAB 组板板坯表
LEFT JOIN PM_PD_CONST_BT PPCB ON PPCB.ROLL_LINE_NO = SUBSTR(MS.MSC_LINE_NO, 3, 2)
WHERE 1 = 1
-- AND MS.MSC_LINE_NO = '1030' --5米轧线
AND MS.MSC_LINE_NO LIKE '%30' --5米轧线
-- AND MS.SLAB_NO = 'C50015130500'
-- AND MS.SLAB_NO = 'C50015130100'
<if test="slabNo != null and slabNo != ''">AND MS.SLAB_NO = #{slabNo}</if>
@ -53,7 +53,7 @@
LEFT JOIN PM_PD_SLAB_INFO PPSI ON PPSI.SLAB_NO = MS.SLAB_NO --PM_PD_SLAB 组板板坯表
LEFT JOIN PM_PD_CONST_BT PPCB ON PPCB.ROLL_LINE_NO = SUBSTR(MS.MSC_LINE_NO, 3, 2)
WHERE 1 = 1
-- AND MS.MSC_LINE_NO = '1030' --5米轧线
AND MS.MSC_LINE_NO LIKE '%30' --5米轧线
-- AND MS.SLAB_NO = 'C50015130500'
-- AND MS.SLAB_NO = 'C50015130100'
<if test="slabNo != null and slabNo != ''">AND MS.SLAB_NO = #{slabNo}</if>
@ -81,9 +81,9 @@
-- AND ppc.PRO_CONT_ID = pcmt.PRO_CONT_ID
-- AND cm.MSC_LINE_NO = pcmt.MSC_LINE_NO --PM_PRO_CONT没有MSC_LINE_NO
WHERE 1=1
-- AND pcmt.MSC_LINE_NO = '1030' --5米轧线
AND pcmt.MSC_LINE_NO LIKE '%30' --5米轧线
-- AND ppc.ORDER_NO IN ('J2502001208')
-- AND ppc.ORDER_NO IN ('52500095215','52500096023')
AND ppc.ORDER_NO IN ('52500095215','52500096023')
AND PCMT.FUR_TYPE ='C' --加热炉类型 C 没有注解C和S 都代表什么
AND ppcpa.ORDER_TYPE_CODE != 'QFH'
AND PPC.ON_PD_FLAG != 1 --不用验证操作者
@ -103,8 +103,8 @@
-- AND ppc.PRO_CONT_ID = pcmt.PRO_CONT_ID
-- AND cm.MSC_LINE_NO = pcmt.MSC_LINE_NO --PM_PRO_CONT没有MSC_LINE_NO
WHERE 1=1
-- AND pcmt.MSC_LINE_NO = '1030' --5米轧线
-- AND ppc.ORDER_NO IN ('52500095215','52500096023')
AND pcmt.MSC_LINE_NO LIKE '%30' --5米轧线
AND ppc.ORDER_NO IN ('52500095215','52500096023')
AND PCMT.FUR_TYPE ='C' --加热炉类型 C 没有注解C和S 都代表什么
AND ppcpa.ORDER_TYPE_CODE != 'QFH'
AND PPC.ON_PD_FLAG != 1 --不用验证操作者
@ -118,18 +118,59 @@
<!--生产合同产品属性表-->
<select id="getPmProCountProdAttr" resultType="com.xisc.pm.domain.entity.PmProContProdTtr">
SELECT *
FROM PM_PRO_CONT_PROD_ATTR
-- WHERE ORDER_NO ='522484Q020'
SELECT distinct ppcpa.* FROM PM_PRO_CONT ppc
LEFT JOIN XISC_CT.CT_MAIN CM ON PPC.ORDER_NO = CM.ORDER_NO
LEFT JOIN PM_PRO_CONT_PROD_ATTR ppcpa ON ppcpa.ORDER_NO = ppc.ORDER_NO
LEFT JOIN PM_CONT_MSC_TECH PCMT ON PCMT.ORDER_NO = ppc.ORDER_NO
-- AND ppc.PRO_CONT_ID = pcmt.PRO_CONT_ID
-- AND cm.MSC_LINE_NO = pcmt.MSC_LINE_NO --PM_PRO_CONT没有MSC_LINE_NO
WHERE 1=1
AND nvl(ppcpa.ORDER_NO,' ') !=' '
AND pcmt.MSC_LINE_NO LIKE '%30' --5米轧线
-- AND ppc.ORDER_NO IN ('52500095215','52500096023')
AND PCMT.FUR_TYPE ='C' --加热炉类型 C 没有注解C和S 都代表什么
AND ppcpa.ORDER_TYPE_CODE != 'QFH'
AND PPC.ON_PD_FLAG != 1 --不用验证操作者
AND PPC.PD_HOLD_FLAG != 1 -- 不能封锁状态
AND pcmt.ROLL_DIRECT_CODE ='L'--轧制方向代码
AND NVL(cm.ORDER_STATUS,0) &gt;= 40 AND NVL(cm.ORDER_STATUS,0) &lt; 67 --TODO 添加nvl处理 表中无效数字
-- AND PPC.PD_LACK_QTY &gt; 0 --欠量大于0 TODO 存在欠量小于0的数据
--
-- SELECT *
-- FROM PM_PRO_CONT_PROD_ATTR
-- -- WHERE ORDER_NO ='522484Q020'
</select>
<!--合同产线工艺参数表-->
<select id="getPmContMscTech" resultType="com.xisc.pm.domain.entity.PmContMscTech">
SELECT *
FROM PM_CONT_MSC_TECH
-- WHERE ORDER_NO ='522484Q020'
SELECT distinct PCMT.* FROM PM_PRO_CONT ppc
LEFT JOIN XISC_CT.CT_MAIN CM ON PPC.ORDER_NO = CM.ORDER_NO
LEFT JOIN PM_PRO_CONT_PROD_ATTR ppcpa ON ppcpa.ORDER_NO = ppc.ORDER_NO
LEFT JOIN PM_CONT_MSC_TECH PCMT ON PCMT.ORDER_NO = ppc.ORDER_NO
-- AND ppc.PRO_CONT_ID = pcmt.PRO_CONT_ID
-- AND cm.MSC_LINE_NO = pcmt.MSC_LINE_NO --PM_PRO_CONT没有MSC_LINE_NO
WHERE 1=1
AND nvl(pcmt.ORDER_NO,' ') !=' '
AND pcmt.MSC_LINE_NO LIKE '%30' --5米轧线
-- AND ppc.ORDER_NO IN ('52500095215','52500096023')
AND PCMT.FUR_TYPE ='C' --加热炉类型 C 没有注解C和S 都代表什么
AND ppcpa.ORDER_TYPE_CODE != 'QFH'
AND PPC.ON_PD_FLAG != 1 --不用验证操作者
AND PPC.PD_HOLD_FLAG != 1 -- 不能封锁状态
AND pcmt.ROLL_DIRECT_CODE ='L'--轧制方向代码
AND NVL(cm.ORDER_STATUS,0) &gt;= 40 AND NVL(cm.ORDER_STATUS,0) &lt; 67 --TODO 添加nvl处理 表中无效数字
-- AND PPC.PD_LACK_QTY &gt; 0 --欠量大于0 TODO 存在欠量小于0的数据
--
-- SELECT *
-- FROM PM_CONT_MSC_TECH
-- -- WHERE ORDER_NO ='522484Q020'
</select>

Loading…
Cancel
Save