Compare commits

...

3 Commits

Author SHA1 Message Date
sunhao 8f05014193 2025-03-22 2 weeks ago
sunhao 4eb870c6f4 2025-03-22 2 weeks ago
sunhao 6bc02b1d9a 2025-03-22 2 weeks ago

@ -411,13 +411,13 @@ public class SubController {
SetGrpConBinDataBySlab(p);
}
logger.info("***二次分组1数量*** " + gltGCalGrp.size());
//执行日志保存
logger.info("***二次分组1数量*** " + gltGCalGrp.size());
//执行日志保存
subLogStr += "-----二次分组1数量" + gltGCalGrp.size();
logger.info("***二次分组2数量*** " + gltGCal2Grp.size());
logger.info("***二次分组2数量*** " + gltGCal2Grp.size());
//执行日志保存
//执行日志保存
subLogStr += "-----二次分组2数量" + gltGCal2Grp.size();
gltGCalGrp.addAll(gltGCal2Grp);
@ -912,8 +912,6 @@ public class SubController {
//压缩比 Compression ratio
//宽展比 Wide ratio
//GCG.getLtInfoGPreOrder().stream().filter(e->e.)
//最大宽度
@ -924,7 +922,6 @@ public class SubController {
GCG.setLtInfoGPreOrder(new CopyOnWriteArrayList<>());
e.getLtInfoGPreOrder().forEach(f -> {
try {
//同钢种判断
if (!SInfo.getStNo().equals(f.getInfoPmContMscTechDO().getStNo()))
@ -2028,6 +2025,8 @@ public class SubController {
GPO.setInfoQdToPoOrderDO(qtpo);
//内部钢种
GPO.setST_NO(pcmt.getStNo());
//产线
GPO.setLine(pcmt.getMscLineNo());
// 将创建的订单对象添加到全局订单列表中
gltOrder.add(GPO);
@ -2048,7 +2047,7 @@ public class SubController {
plistOrder.parallelStream().forEach(i -> {
PmProContProdTtr ppcpa = new PmProContProdTtr();
PmContMscTech pcmt = new PmContMscTech();
// PmContMscTech pcmt = new PmContMscTech();
QdToPoOrder qtpo = new QdToPoOrder();
try {
@ -2075,14 +2074,18 @@ public class SubController {
return;
}
if (plistPmContMscTechDO.stream().filter(p -> p.getOrderNo().equals(i.getOrderNo())).count() > 0) {
// 可能抛出异常的代码
pcmt = plistPmContMscTechDO.stream().filter(p -> p.getOrderNo().equals(i.getOrderNo())).findFirst().orElseThrow(() -> new NoSuchElementException("No PmContMscTechDO found with name Charlie " + i.getOrderNo()));
if (plistQdToPoOrderDO.stream().anyMatch(e ->e.getOrderNo().equals(i.getOrderNo())))
{
qtpo=plistQdToPoOrderDO.stream().filter(e -> e.getOrderNo().equals(i.getOrderNo())).findFirst().orElseThrow(() -> new NoSuchElementException("No PmContMscTechDO found with name Charlie " + i.getOrderNo()));
if (plistQdToPoOrderDO.stream().anyMatch(e -> e.getOrderNo().equals(i.getOrderNo()))) {
qtpo = plistQdToPoOrderDO.stream().filter(e -> e.getOrderNo().equals(i.getOrderNo())).findFirst().orElseThrow(() -> new NoSuchElementException("No PmContMscTechDO found with name Charlie " + i.getOrderNo()));
QdToPoOrder finalqtpo = qtpo;
if (plistPmContMscTechDO.stream().filter(p -> p.getOrderNo().equals(i.getOrderNo())).count() > 0) {
plistPmContMscTechDO.stream().filter(p -> p.getOrderNo().equals(i.getOrderNo())).collect(Collectors.toList()).forEach( pcmt -> {
SetAllOrder(i, finalPpcpa, pcmt, finalqtpo);
});
SetAllOrder(i, ppcpa, pcmt,qtpo);
}
} else {
@ -2120,12 +2123,14 @@ public class SubController {
// 检查当前订单是否与已有的分组匹配
if (gltGrpOrderFir.stream().anyMatch(e -> e.getWid().equals(p.getInfoPmProContProdAttrDO().getOrderWidth()) &&
e.getThk().equals(p.getInfoPmProContProdAttrDO().getOrderThick()) &&
e.getST_NO().equals(p.getInfoPmContMscTechDO().getStNo()))) {
e.getST_NO().equals(p.getInfoPmContMscTechDO().getStNo()) &&
e.getLine().equals(p.getInfoPmContMscTechDO().getMscLineNo()))) {
// 如果匹配成功,将订单添加到相应的分组中
GGrpOrderFir GGOF = gltGrpOrderFir.stream().filter(e -> e.getWid().equals(p.getInfoPmProContProdAttrDO().getOrderWidth())
&& e.getThk().equals(p.getInfoPmProContProdAttrDO().getOrderThick())
&& e.getST_NO().equals(p.getInfoPmContMscTechDO().getStNo())
&& e.getST_NO().equals(p.getInfoPmContMscTechDO().getStNo())&&
e.getLine().equals(p.getInfoPmContMscTechDO().getMscLineNo())
).findFirst().orElse(null);
if (GGOF.getLtInfoGPreOrder() == null) {
GGOF.setLtInfoGPreOrder(new ArrayList<>()); // 确保列表已初始化
@ -2142,6 +2147,7 @@ public class SubController {
//GGOF.setLen(p.getInfoPmProContProdAttrDO().getOrderLen());
GGOF.setSG_STD(p.getInfoPmProContProdAttrDO().getSgStd());
GGOF.setST_NO(p.getInfoPmContMscTechDO().getStNo());
GGOF.setLine(p.getInfoPmContMscTechDO().getMscLineNo());
GGOF.setLtInfoGPreOrder(new ArrayList<>()); // 初始化列表
GGOF.getLtInfoGPreOrder().add(p);
gltGrpOrderFir.add(GGOF);
@ -3578,6 +3584,7 @@ public class SubController {
public void SetPmSmallPltPos(String mscLineNo, Long organizationId) {
for (int i = 0; i < gltSelGGrpCalRslt.size(); i++) {
GGrpCalRslt ggcr = gltSelGGrpCalRslt.get(i);
Integer smallPlateNum = 0;
for (int j = 0; j < ggcr.getLtActInfoGPreOrder().size(); j++) {
if(ggcr.getLtActInfoGPreOrder().get(j).getCombinationFlag() == 1){
for (int k = 0; k < ggcr.getLtActInfoGPreOrder().get(j).getLtInfoCombGPreOrder().size(); k++) {
@ -3593,8 +3600,8 @@ public class SubController {
.findFirst();
if (resultPmProContProdAttrDO.get().getTrimCode().equals("0")) {
pmSmallPltPosDO.setSmallPlateDivNo("000");
} else {
pmSmallPltPosDO.setSmallPlateDivNo(SMALL_PLATE_DIV_NO[j]);
} else {
pmSmallPltPosDO.setSmallPlateDivNo(SMALL_PLATE_DIV_NO[smallPlateNum]);
}
pmSmallPltPosDO.setPickModeLenDir(Long.valueOf(j+1));
pmSmallPltPosDO.setPickModeWidDir(Long.valueOf(k+1));
@ -3619,6 +3626,7 @@ public class SubController {
SetPmCmdSmallPlt(pmSmallPltPosDO,resultPmProContProdAttrDO.get(),mscLineNo,organizationId);
pmSmallPltPosDOList.add(pmSmallPltPosDO);
smallPlateNum += 1;
}
}else{
GPreOrder gpo = ggcr.getLtActInfoGPreOrder().get(j);
@ -3635,7 +3643,7 @@ public class SubController {
if (resultPmProContProdAttrDO.get().getTrimCode().equals("0")) {
pmSmallPltPosDO.setSmallPlateDivNo("000");
} else {
pmSmallPltPosDO.setSmallPlateDivNo(SMALL_PLATE_DIV_NO[j]);
pmSmallPltPosDO.setSmallPlateDivNo(SMALL_PLATE_DIV_NO[smallPlateNum]);
}
pmSmallPltPosDO.setPickModeLenDir(Long.valueOf(j+1));//TODO 取板方式 长度方向 列数累加
pmSmallPltPosDO.setPickModeWidDir(1L);//TODO 取板方式 宽度方向 第一行
@ -3660,6 +3668,7 @@ public class SubController {
SetPmCmdSmallPlt(pmSmallPltPosDO,resultPmProContProdAttrDO.get(),mscLineNo,organizationId);
pmSmallPltPosDOList.add(pmSmallPltPosDO);
smallPlateNum += 1;
}
}
}
@ -3818,7 +3827,7 @@ public class SubController {
.findFirst();
pmCmdLargePltDO.setSampleLenGive(resultPmProContProdAttrDO.get().getSampleLenGive());
pmCmdLargePltDO.setProdDensity(resultPmProContProdAttrDO.get().getProdDensity());
pmCmdLargePltDO.setPlateDtCode(resultPmProContProdAttrDO.get().getProjectCode());
pmCmdLargePltDO.setPlateDtCode(pmContMscTechDO.getPlateDtCode());
pmCmdLargePltDO.setWithSideFlag(resultPmProContProdAttrDO.get().getProdSideMark());
pmCmdLargePltDO.setRsCode(pmPdSlabDO.getRsCode());
@ -4026,7 +4035,7 @@ public class SubController {
// subService.batchInsertPmCmdCont(pmCmdContDOList);
// System.out.println("PmCmdCont 命令参数 保存成功");
subService.SaveData(p,pmPdSlabDOList, pmPdPlateCutDOList, pmPdBlockPosDOList, pmPdContSumDOList, pmSmallPltPosDOList, pmCmdSlabDOList, pmCmdLargePltDOList, pmCmdContDOList, pmCmdSmallPltDOList,plistpmSubHisDO,plistpmSubOrdDO,pmPdRecs,organizationId,subLog);
subService.SaveData(p,pmPdSlabDOList, pmPdPlateCutDOList, pmPdBlockPosDOList, pmPdContSumDOList, pmSmallPltPosDOList, pmCmdSlabDOList, pmCmdLargePltDOList, pmCmdContDOList, pmCmdSmallPltDOList,plistpmSubHisDO,plistpmSubOrdDO,pmPdRecs,organizationId);
}

@ -3,6 +3,7 @@ package com.xisc.pm.app.service;
import com.xisc.pm.api.dto.PmPdRecDTO;
import com.xisc.pm.api.dto.model.*;
import com.xisc.pm.domain.entity.*;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@ -124,7 +125,7 @@ public interface SubService {
List<PmThickAddvBt> getPmThickAddvBt();
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, PmSubLog subLog);
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);

@ -444,9 +444,9 @@ public class SubServiceImpl implements SubService {
@Override
@Transactional(rollbackFor = Exception.class)
public 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, PmSubLog subLog) {
public 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) {
String subLogStr = subLog.getSubLog();
//抛合同事件
String bizId = pmPdRecDTOList.get(0).getKeyvalue1();
String key = String.format(PmPlateConstants.YIELD_EXEC_LOCK_KEY, organizationId.toString(), bizId);
@ -478,7 +478,6 @@ public class SubServiceImpl implements SubService {
Constants.SYSTEM_PD_CODE, "余材板坯组板");
System.out.println("抛合同组板事件 执行成功");
// 抛合同
subLogStr += "-----抛合同组板事件 执行成功";
} finally {
@ -492,58 +491,47 @@ public class SubServiceImpl implements SubService {
if (plistpmSubHisDO.size() > 0) {
pmSubHisRepository.batchInsertSelective(plistpmSubHisDO);
System.out.println("pmSubHis表 保存成功");
subLogStr += "-----pmSubHis表 保存成功";
}
if (plistpmSubOrdDO.size() > 0) {
pmSubOrdRepository.batchInsertSelective(plistpmSubOrdDO);
System.out.println("pmSubOrd表 保存成功");
subLogStr += "-----pmSubOrd表 保存成功";
}
//
if (pmPdSlabDOList.size() > 0) {
pmPdSlabRepository.batchInsertSelective(pmPdSlabDOList);
System.out.println("PmPdSlab表 保存成功");
subLogStr += "-----PmPdSlab表 保存成功";
}
if (pmPdPlateCutDOList.size() > 0) {
pmPdPlateCutRepository.batchInsertSelective(pmPdPlateCutDOList);
System.out.println("PmPdPlateCut 大板粗切位置 保存成功");
subLogStr += "-----PmPdPlateCut 大板粗切位置 保存成功";
}
if (pmPdBlockPosDOList.size() > 0) {
pmPdBlockPosRepository.batchInsertSelective(pmPdBlockPosDOList);
System.out.println("PmPdBlockPos 组合子板位置表 保存成功");
subLogStr += "-----PmPdBlockPos 组合子板位置表 保存成功";
}
if (pmPdContSumDOList.size() > 0) {
pmPdContSumRepository.batchInsertSelective(pmPdContSumDOList);
System.out.println("PmPdContSum 合同总量表 保存成功");
subLogStr += "-----PmPdContSum 合同总量表 保存成功";
}
if (pmSmallPltPosDOList.size() > 0) {
pmSmallPltPosRepository.batchInsertSelective(pmSmallPltPosDOList);
System.out.println("PmSmallPltPos 命令小板位置表 保存成功");
subLogStr += "-----PmSmallPltPos 命令小板位置表 保存成功";
}
if (pmCmdSlabDOList.size() > 0) {
pmCmdSlabRepository.batchInsertSelective(pmCmdSlabDOList);
System.out.println("PmCmdSlab 保存成功");
subLogStr += "-----PmCmdSlab 保存成功";
}
if (pmCmdLargePltDOList.size() > 0) {
pmCmdLargePltRepository.batchInsertSelective(pmCmdLargePltDOList);
System.out.println("pmCmdLargePltDO 命令大板 保存成功");
subLogStr += "-----pmCmdLargePltDO 命令大板 保存成功";
}
if (pmCmdContDOList.size() > 0) {
pmCmdContRepository.batchInsertSelective(pmCmdContDOList);
System.out.println("PmCmdCont 命令参数 保存成功");
subLogStr += "-----PmCmdCont 命令参数 保存成功";
}
if (pmCmdSmallPltDOList.size() > 0) {
pmCmdSmallPltRepository.batchInsertSelective(pmCmdSmallPltDOList);
System.out.println("PmCmdSmallPlt 命令小板表 保存成功");
subLogStr += "-----PmCmdSmallPlt 命令小板表 保存成功";
}
// 调用mm接口
@ -555,23 +543,16 @@ public class SubServiceImpl implements SubService {
pmPdSlabInfo = buildPmPdSlabInfo(pmPdSlabSplitDTO, p.getSlabNo(), p.getMscLineNo(), p.getTenantId());
pmPdSlabInfoRepository.insertSelective(pmPdSlabInfo);
System.out.println("pmPdSlabInfo表 保存成功");
subLogStr += "-----pmPdSlabInfo表 保存成功";
//抛合同
zbCtEventRec(organizationId, pmPdSlabDOList, pmCmdLargePltDOList, pmCmdSlabDOList, pmSmallPltPosDOList);
System.out.println("抛合同事件完成");
subLogStr += "-----抛合同事件完成";
// 轧钢模块“在制品材料管理封锁事件接口"
callMatStatusModify(pmPdSlabInfo);
System.out.println("mm模块接口 调用成功");
subLogStr += "-----mm模块接口 调用成功";
System.out.println("程序执行完成!");
subLogStr += "-----程序执行完成!";
subLog.setSubDate(new java.util.Date());
subLog.setSubLog(subLogStr);
pmSubLogRepository.insertSelective(subLog);
}
@Override

Loading…
Cancel
Save