Merge remote-tracking branch 'origin/main'

# Conflicts:
#	XG_Project1/src/main/java/com/xisc/pm/api/controller/v1/SubController.java
main
sunhao 2 weeks ago
commit 1a2a7687bb

@ -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

@ -126,6 +126,8 @@ public interface SubService {
void SaveData(SlabInfoDO p, List<PmPdSlab> pmPdSlabDOList, List<PmPdPlateCut> pmPdPlateCutDOList, List<PmPdBlockPos> pmPdBlockPosDOList, List<PmPdContSum> pmPdContSumDOList, List<PmSmallPltPos> pmSmallPltPosDOList, List<PmCmdSlab> pmCmdSlabDOList, List<PmCmdLargePlt> pmCmdLargePltDOList, List<PmCmdCont> pmCmdContDOList, List<PmCmdSmallPlt> pmCmdSmallPltDOList, List<PmSubHis> plistpmSubHisDO, List<PmSubOrd> plistpmSubOrdDO, List<PmPdRecDTO> pmPdRecDTOList, Long organizationId);
void saveSubLog(String slabNo, long subMode, String subRslt, String subLog, Long organizationId);
// void SaveData(List<PmPdSlab> pmPdSlabDOList, List<PmPdPlateCut> pmPdPlateCutDOList, List<PmPdBlockPos> pmPdBlockPosDOList, List<PmPdContSum> pmPdContSumDOList, List<PmSmallPltPos> pmSmallPltPosDOList, List<PmCmdSlab> pmCmdSlabDOList, List<PmCmdLargePlt> pmCmdLargePltDOList, List<PmCmdCont> pmCmdContDOList, List<PmCmdSmallPlt> pmCmdSmallPltDOList);
}

@ -91,6 +91,9 @@ public class SubServiceImpl implements SubService {
@Autowired
private PmProContRepository pmProContRepository;
@Autowired
private PmSubLogRepository pmSubLogRepository;
@Autowired
protected EventClient eventClient;
@ -552,6 +555,18 @@ public class SubServiceImpl implements SubService {
}
@Override
public void saveSubLog(String slabNo, long subMode, String subRslt, String subLog, Long organizationId) {
PmSubLog pmSubLog = new PmSubLog();
pmSubLog.setSubDate(new java.util.Date());
pmSubLog.setSlabNo(slabNo);
pmSubLog.setSubMode(subMode);
pmSubLog.setSubRslt(subRslt);
pmSubLog.setSubLog(subLog);
pmSubLog.setTenantId(organizationId);
pmSubLogRepository.insertSelective(pmSubLog);
}
public void zbCtEventRec(Long organizationId, List<PmPdSlab> pmPdSlabDOList, List<PmCmdLargePlt> pmCmdLargePltDOList, List<PmCmdSlab> pmCmdSlabDOList, List<PmSmallPltPos> pmSmallPltPosDOList) {
for (PmPdSlab pmPdSlab : pmPdSlabDOList) {
List<PmSmallPltPos> smallPltPosList = pmSmallPltPosDOList.stream()
@ -570,11 +585,11 @@ public class SubServiceImpl implements SubService {
// 虚拟板坯维度
boardEndEventList.add(new ProContBoardEndDTO(axisPmProCont.getOrderNo()).setMatNo(pmPdSlab.getVirtualSlabNo())
.setLen(pmPdSlab.getPreCleanSlabLen()).setMoMatNo(null)
.setLen(pmPdSlab.getPreCleanSlabLen()).setMoMatNo(pmPdSlab.getSlabNo())
.setMscLineNo(pmPdSlab.getMscLineNo())
.setPdMatStatus(Constants.PdStatusHp.PD_STATUS_HP_12).setPpFlag(PdProdFlag.VIRTUAL_SLAB.getCode())
.setThk(slabList.get(0).getMoldThick())
.setWid(slabList.get(0).getMoldWid())
.setThk(pmPdSlab.getPreCleanSlabThick())
.setWid(pmPdSlab.getPreCleanSlabWidth())
.setWgt(pmPdSlab.getPreCleanSlabWt())
.setWholeBacklogCode(axisPmProCont.getWholeBacklogCode())
.setStNo(axisPmProCont.getStNo())
@ -584,7 +599,7 @@ public class SubServiceImpl implements SubService {
BigDecimal weight = largePltList.get(0).getRollAimLen().multiply(largePltList.get(0).getRollAimThick()).multiply(largePltList.get(0).getRollAimWidth()).multiply(new BigDecimal(7.85)).divide(new BigDecimal(1000000000), PmPlateConstants.WT_SCALE, RoundingMode.HALF_UP);
// 大板维度
boardEndEventList.add(new ProContBoardEndDTO(axisPmProCont.getOrderNo()).setMatNo(pmPdSlab.getVirtualSlabNo())
.setLen(largePltList.get(0).getRollAimLen()).setMoMatNo(null)
.setLen(largePltList.get(0).getRollAimLen()).setMoMatNo(pmPdSlab.getSlabNo())
.setMscLineNo(pmPdSlab.getMscLineNo())
.setPdMatStatus(Constants.PdStatusHp.PD_STATUS_HP_12).setPpFlag(PdProdFlag.VIRTUAL_COMPOSITE_SLAB.getCode())
.setThk(largePltList.get(0).getRollAimThick())
@ -599,10 +614,13 @@ public class SubServiceImpl implements SubService {
// 小板维度
boardEndEventList
.add(new ProContBoardEndDTO(pmSmallPltPos.getOrderNo()).setMatNo(pmPdSlab.getVirtualSlabNo() + pmSmallPltPos.getSmallPlateDivNo())
.setLen(pmSmallPltPos.getOrderLen()).setMoMatNo(pmSmallPltPos.getPdMatNo())
.setLen(pmSmallPltPos.getOrderLen())
.setMoMatNo(pmSmallPltPos.getPdMatNo())
.setMscLineNo(pmPdSlab.getMscLineNo())
.setPdMatStatus(Constants.PdStatusHp.PD_STATUS_HP_12).setPpFlag(PdProdFlag.SMALL_POS_VIRTUAL_SLAB.getCode())
.setThk(pmSmallPltPos.getOrderThick()).setWid(pmSmallPltPos.getOrderWidth())
.setPdMatStatus(Constants.PdStatusHp.PD_STATUS_HP_12)
.setPpFlag(PdProdFlag.SMALL_POS_VIRTUAL_SLAB.getCode())
.setThk(pmSmallPltPos.getOrderThick())
.setWid(pmSmallPltPos.getOrderWidth())
.setWgt(pmProContFilterResposeDTO.getOrderUnitAimWt())
.setWholeBacklogCode(axisPmProCont.getWholeBacklogCode())
.setStNo(pmProContFilterResposeDTO.getStNo())

Loading…
Cancel
Save