|
|
|
@ -1,10 +1,7 @@
|
|
|
|
|
package com.xisc.pm.api.controller.v1;
|
|
|
|
|
|
|
|
|
|
import com.google.common.collect.Maps;
|
|
|
|
|
import com.google.ortools.Loader;
|
|
|
|
|
import com.xisc.pm.api.dto.PmPdRecDTO;
|
|
|
|
|
import com.xisc.pm.api.dto.PmProContFilterResposeDTO;
|
|
|
|
|
import com.xisc.pm.api.dto.PmProductionPlanReqDTO;
|
|
|
|
|
import com.xisc.pm.api.dto.QdMatchParamDTO;
|
|
|
|
|
import com.xisc.pm.api.dto.QdSurplusLowMagnificationDTO;
|
|
|
|
|
import com.xisc.pm.api.dto.model.*;
|
|
|
|
@ -22,7 +19,6 @@ import org.hzero.mybatis.helper.SecurityTokenHelper;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
@ -353,8 +349,6 @@ public class SubController {
|
|
|
|
|
|
|
|
|
|
logger.info("***初次分组数量*** " + gltGrpOrderFir.size());
|
|
|
|
|
|
|
|
|
|
//执行日志保存
|
|
|
|
|
subService.saveSubLog("初次分组数量", finalSubMode, "成功", String.valueOf(gltGrpOrderFir.size()), organizationId);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//被使用的订单数据实例化
|
|
|
|
@ -362,55 +356,45 @@ public class SubController {
|
|
|
|
|
|
|
|
|
|
//循环板坯
|
|
|
|
|
plistSlab.forEach(p -> {
|
|
|
|
|
PmSubLog subLog = new PmSubLog();
|
|
|
|
|
subLog.setSlabNo(p.getSlabNo());
|
|
|
|
|
subLog.setSubMode(finalSubMode);
|
|
|
|
|
subLog.setSubRslt("成功");
|
|
|
|
|
subLog.setTenantId(organizationId);
|
|
|
|
|
|
|
|
|
|
String subLogStr = "";
|
|
|
|
|
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);
|
|
|
|
|
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());
|
|
|
|
|
|
|
|
|
|
//执行日志保存
|
|
|
|
|
subService.saveSubLog(p.getSlabNo(), finalSubMode, "失败", "板坯信息被排除 原因 长度不在范围内", organizationId);
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 判断板坯的宽度是否在plistpmAutoSubSettingDO配置的范围内
|
|
|
|
|
if (p.getSlabActWid().compareTo(plistpmAutoSubSettingDO.get(0).getMatWidthMin()) < 0 && p.getSlabActWid().compareTo(plistpmAutoSubSettingDO.get(0).getMatWidthMax()) > 0) {
|
|
|
|
|
logger.info("***板坯信息被排除:{} 宽度不在范围内 ", p.getSlabNo());
|
|
|
|
|
|
|
|
|
|
//执行日志保存
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -428,9 +412,14 @@ public class SubController {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
logger.info("***二次分组1数量*** " + gltGCalGrp.size());
|
|
|
|
|
//执行日志保存
|
|
|
|
|
subLogStr += "-----二次分组1数量:" + gltGCalGrp.size();
|
|
|
|
|
|
|
|
|
|
logger.info("***二次分组2数量*** " + gltGCal2Grp.size());
|
|
|
|
|
|
|
|
|
|
//执行日志保存
|
|
|
|
|
subLogStr += "-----二次分组2数量:" + gltGCal2Grp.size();
|
|
|
|
|
|
|
|
|
|
gltGCalGrp.addAll(gltGCal2Grp);
|
|
|
|
|
|
|
|
|
|
//分组设置ID
|
|
|
|
@ -483,10 +472,9 @@ 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);
|
|
|
|
|
|
|
|
|
|
subLogStr += "-----结果数据数量1" + gltGGrpCalRslt.size() + "-----结果数据数量2" + gltSelGGrpCalRslt.size();
|
|
|
|
|
}
|
|
|
|
|
subLog.setSubLog(subLogStr);
|
|
|
|
|
if (gltSelGGrpCalRslt.size() > 0) {
|
|
|
|
|
now = new Date();
|
|
|
|
|
//存储数据,组板结果
|
|
|
|
@ -497,7 +485,7 @@ public class SubController {
|
|
|
|
|
//TransactionStatus transactionStatus = transactionService.begin();
|
|
|
|
|
try {
|
|
|
|
|
//保存数据
|
|
|
|
|
SaveData(p,organizationId);
|
|
|
|
|
SaveData(p,organizationId,subLog);
|
|
|
|
|
//transactionService.commit(transactionStatus);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
logger.error("保存事务回滚:" + p.getSlabNo(), e);
|
|
|
|
@ -508,12 +496,8 @@ public class SubController {
|
|
|
|
|
|
|
|
|
|
} 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("");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -4031,7 +4015,7 @@ public class SubController {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SaveData(SlabInfoDO p,Long organizationId) {
|
|
|
|
|
public void SaveData(SlabInfoDO p, Long organizationId, PmSubLog subLog) {
|
|
|
|
|
// subService.batchInsertPmPdSlab(pmPdSlabDOList);
|
|
|
|
|
// System.out.println("PmPdSlab表一保存成功");
|
|
|
|
|
// subService.batchInsertPmCmdSlab(pmCmdSlabDOList);
|
|
|
|
|