|
|
|
@ -331,6 +331,13 @@ public class SubController {
|
|
|
|
|
public JsonData SubData( PmSubHis pmSubHis, @PathVariable Long organizationId) {
|
|
|
|
|
SecurityTokenHelper.validTokenIgnoreInsert(pmSubHis);
|
|
|
|
|
String strSlab = pmSubHis.getSlabNo();
|
|
|
|
|
|
|
|
|
|
long subMode = 1;
|
|
|
|
|
if (strSlab == null || strSlab == "") {
|
|
|
|
|
subMode = 2;
|
|
|
|
|
}
|
|
|
|
|
long finalSubMode = subMode;
|
|
|
|
|
|
|
|
|
|
SubParams subParams = new SubParams();
|
|
|
|
|
subParams.setSlabNo(strSlab);
|
|
|
|
|
//测试阶段需要指定板坯号
|
|
|
|
@ -346,43 +353,66 @@ public class SubController {
|
|
|
|
|
|
|
|
|
|
logger.info("***初次分组数量*** " + gltGrpOrderFir.size());
|
|
|
|
|
|
|
|
|
|
//执行日志保存
|
|
|
|
|
subService.saveSubLog("初次分组数量", finalSubMode, "成功", String.valueOf(gltGrpOrderFir.size()), organizationId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//被使用的订单数据实例化
|
|
|
|
|
plistOrdHis = new ArrayList<>();
|
|
|
|
|
|
|
|
|
|
//循环板坯
|
|
|
|
|
plistSlab.forEach(p -> {
|
|
|
|
|
logger.info("*************板坯开始{}************* ", p.getSlabNo());
|
|
|
|
|
logger.info("***板坯信息:{} 厚宽长:{}*{}*{} ", p.getSlabNo(), p.getSlabActThk(), p.getSlabActWid(), p.getSlabActLen());
|
|
|
|
|
logger.info("*************板坯开始{}************* ", p.getSlabNo());
|
|
|
|
|
logger.info("***板坯信息:{} 厚宽长:{}*{}*{} ", p.getSlabNo(), p.getSlabActThk(), p.getSlabActWid(), p.getSlabActLen());
|
|
|
|
|
//执行日志保存
|
|
|
|
|
subService.saveSubLog(p.getSlabNo(), finalSubMode, "成功", "板坯信息 厚宽长:" + p.getSlabActThk() + "*" + p.getSlabActWid() + "*" + p.getSlabActLen(), organizationId);
|
|
|
|
|
|
|
|
|
|
// 判断板坯的长度是否在plistpmAutoSubSettingDO配置的范围内
|
|
|
|
|
if (p.getSlabActLen().compareTo(plistpmAutoSubSettingDO.get(0).getMatLenMin()) < 0 && p.getSlabActLen().compareTo(plistpmAutoSubSettingDO.get(0).getMatLenMax()) > 0) {
|
|
|
|
|
logger.info("***板坯信息被排除:{} 长度不在范围内 ", p.getSlabNo());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// 判断板坯的长度是否在plistpmAutoSubSettingDO配置的范围内
|
|
|
|
|
if (p.getSlabActLen().compareTo(plistpmAutoSubSettingDO.get(0).getMatLenMin()) < 0 && p.getSlabActLen().compareTo(plistpmAutoSubSettingDO.get(0).getMatLenMax()) > 0) {
|
|
|
|
|
logger.info("***板坯信息被排除:{} 长度不在范围内 ", p.getSlabNo());
|
|
|
|
|
|
|
|
|
|
// 判断板坯的宽度是否在plistpmAutoSubSettingDO配置的范围内
|
|
|
|
|
if (p.getSlabActWid().compareTo(plistpmAutoSubSettingDO.get(0).getMatWidthMin()) < 0 && p.getSlabActWid().compareTo(plistpmAutoSubSettingDO.get(0).getMatWidthMax()) > 0) {
|
|
|
|
|
logger.info("***板坯信息被排除:{} 宽度不在范围内 ", p.getSlabNo());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//执行日志保存
|
|
|
|
|
subService.saveSubLog(p.getSlabNo(), finalSubMode, "失败", "板坯信息被排除 原因 长度不在范围内", organizationId);
|
|
|
|
|
|
|
|
|
|
// 判断板坯的厚度是否在plistpmAutoSubSettingDO配置的范围内
|
|
|
|
|
if (p.getSlabActThk().compareTo(plistpmAutoSubSettingDO.get(0).getMatThickMin()) < 0 && p.getSlabActThk().compareTo(plistpmAutoSubSettingDO.get(0).getMatThickMax()) > 0) {
|
|
|
|
|
logger.info("***板坯信息被排除:{} 厚度不在范围内 ", p.getSlabNo());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//判断plistpmIrsubableSlabDO是否包含P.SlabNO范围内
|
|
|
|
|
if (plistpmIrsubableSlabDO.stream().anyMatch(x -> x.getSlabNo().equals(p.getSlabNo()))) {
|
|
|
|
|
logger.info("***板坯信息被排除:{} 不可组板 ", p.getSlabNo());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// 判断板坯的宽度是否在plistpmAutoSubSettingDO配置的范围内
|
|
|
|
|
if (p.getSlabActWid().compareTo(plistpmAutoSubSettingDO.get(0).getMatWidthMin()) < 0 && p.getSlabActWid().compareTo(plistpmAutoSubSettingDO.get(0).getMatWidthMax()) > 0) {
|
|
|
|
|
logger.info("***板坯信息被排除:{} 宽度不在范围内 ", p.getSlabNo());
|
|
|
|
|
|
|
|
|
|
//判断plistpmRetainStDO是否包含P的钢种,判断这个板坯的钢种是否可组板
|
|
|
|
|
if (plistpmRetainStDO.stream().anyMatch(x -> x.getStNo().equals(p.getStNo()))) {
|
|
|
|
|
logger.info("***板坯信息被排除:{} 不可组板 ", p.getSlabNo());
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//执行日志保存
|
|
|
|
|
subService.saveSubLog(p.getSlabNo(), finalSubMode, "失败", "板坯信息被排除 原因 宽度不在范围内", organizationId);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 判断板坯的厚度是否在plistpmAutoSubSettingDO配置的范围内
|
|
|
|
|
if (p.getSlabActThk().compareTo(plistpmAutoSubSettingDO.get(0).getMatThickMin()) < 0 && p.getSlabActThk().compareTo(plistpmAutoSubSettingDO.get(0).getMatThickMax()) > 0) {
|
|
|
|
|
logger.info("***板坯信息被排除:{} 厚度不在范围内 ", p.getSlabNo());
|
|
|
|
|
|
|
|
|
|
//执行日志保存
|
|
|
|
|
subService.saveSubLog(p.getSlabNo(), finalSubMode, "失败", "板坯信息被排除 原因 厚度不在范围内", organizationId);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//判断plistpmIrsubableSlabDO是否包含P.SlabNO范围内
|
|
|
|
|
if (plistpmIrsubableSlabDO.stream().anyMatch(x -> x.getSlabNo().equals(p.getSlabNo()))) {
|
|
|
|
|
logger.info("***板坯信息被排除:{} 不可组板 ", p.getSlabNo());
|
|
|
|
|
|
|
|
|
|
//执行日志保存
|
|
|
|
|
subService.saveSubLog(p.getSlabNo(), finalSubMode, "失败", "板坯信息被排除 原因 判断plistpmIrsubableSlabDO是否包含P.SlabNO范围内 不可组板", organizationId);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//判断plistpmRetainStDO是否包含P的钢种,判断这个板坯的钢种是否可组板
|
|
|
|
|
if (plistpmRetainStDO.stream().anyMatch(x -> x.getStNo().equals(p.getStNo()))) {
|
|
|
|
|
logger.info("***板坯信息被排除:{} 不可组板 ", p.getSlabNo());
|
|
|
|
|
|
|
|
|
|
//执行日志保存
|
|
|
|
|
subService.saveSubLog(p.getSlabNo(), finalSubMode, "失败", "板坯信息被排除 原因 判断plistpmRetainStDO是否包含P的钢种,判断这个板坯的钢种是否可组板 不可组板", organizationId);
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
@ -397,9 +427,14 @@ public class SubController {
|
|
|
|
|
SetGrpConBinDataBySlab(p);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
logger.info("***二次分组1数量*** " + gltGCalGrp.size());
|
|
|
|
|
logger.info("***二次分组1数量*** " + gltGCalGrp.size());
|
|
|
|
|
//执行日志保存
|
|
|
|
|
subService.saveSubLog(p.getSlabNo(), finalSubMode, "成功", "二次分组1数量:" + gltGCalGrp.size(), organizationId);
|
|
|
|
|
|
|
|
|
|
logger.info("***二次分组2数量*** " + gltGCal2Grp.size());
|
|
|
|
|
|
|
|
|
|
logger.info("***二次分组2数量*** " + gltGCal2Grp.size());
|
|
|
|
|
//执行日志保存
|
|
|
|
|
subService.saveSubLog(p.getSlabNo(), finalSubMode, "成功", "二次分组2数量:" + gltGCal2Grp.size(), organizationId);
|
|
|
|
|
|
|
|
|
|
gltGCalGrp.addAll(gltGCal2Grp);
|
|
|
|
|
|
|
|
|
@ -452,6 +487,10 @@ public class SubController {
|
|
|
|
|
|
|
|
|
|
logger.info("所有结果数据板坯号:{};数量:{}", p.getSlabNo(), gltGGrpCalRslt.size());
|
|
|
|
|
logger.info("选择结果数据板坯号:{};数量:{}", p.getSlabNo(), gltSelGGrpCalRslt.size());
|
|
|
|
|
//执行日志保存
|
|
|
|
|
subService.saveSubLog(p.getSlabNo(), finalSubMode, "成功", "结果数据数量1" + gltGGrpCalRslt.size(), organizationId);
|
|
|
|
|
subService.saveSubLog(p.getSlabNo(), finalSubMode, "成功", "结果数据数量2" + gltSelGGrpCalRslt.size(), organizationId);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (gltSelGGrpCalRslt.size() > 0) {
|
|
|
|
|
now = new Date();
|
|
|
|
@ -472,12 +511,16 @@ public class SubController {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("板坯报错:" + p.getSlabNo(), e);
|
|
|
|
|
}
|
|
|
|
|
logger.info("*************板坯结束{}************* ", p.getSlabNo());
|
|
|
|
|
logger.info("");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("板坯报错:" + p.getSlabNo(), e);
|
|
|
|
|
//执行日志保存
|
|
|
|
|
subService.saveSubLog(p.getSlabNo(), finalSubMode, "失败", "板坯报错" + e, organizationId);
|
|
|
|
|
}
|
|
|
|
|
logger.info("*************板坯结束{}************* ", p.getSlabNo());
|
|
|
|
|
//执行日志保存
|
|
|
|
|
subService.saveSubLog(p.getSlabNo(), finalSubMode, "成功", "板坯结束", organizationId);
|
|
|
|
|
logger.info("");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
);
|
|
|
|
|
logger.info("*****处理结束*****");
|
|
|
|
@ -562,6 +605,8 @@ public class SubController {
|
|
|
|
|
*/
|
|
|
|
|
public void GetDataInfo(SubParams subParams) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
logger.info("*****开始获取数据******");
|
|
|
|
|
|
|
|
|
|
//region ***多线程获取基础数据***
|
|
|
|
@ -888,6 +933,8 @@ public class SubController {
|
|
|
|
|
|
|
|
|
|
//压缩比 Compression ratio
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//宽展比 Wide ratio
|
|
|
|
|
//GCG.getLtInfoGPreOrder().stream().filter(e->e.)
|
|
|
|
|
//最大宽度
|
|
|
|
@ -906,11 +953,10 @@ public class SubController {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// //产线相同
|
|
|
|
|
// if (!SInfo.getMscLineNo().equals(f.getInfoPmContMscTechDO().getMscLineNo()))
|
|
|
|
|
// {
|
|
|
|
|
// return;
|
|
|
|
|
// }
|
|
|
|
|
//产线相同
|
|
|
|
|
if (!SInfo.getMscLineNo().equals(f.getInfoPmContMscTechDO().getMscLineNo())) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//化学成分 chemical composition
|
|
|
|
|
if (!ChkChemical(SInfo, f)) {
|
|
|
|
@ -2216,8 +2262,8 @@ public class SubController {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
logger.info("***交叉分组ID:" + e.getIDValue() + "--" + f.getIDValue());
|
|
|
|
|
logger.info("***交叉分组Wid:" + e.getWid() + "--" + f.getWid());
|
|
|
|
|
// 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
|
|
|
|
|
&& Math.max(e.getWid(),f.getWid()) < 4900
|
|
|
|
|