sunhao 4 weeks ago
parent 797640322d
commit ae1839caf3

@ -343,15 +343,15 @@ public class SubController {
//数据整理
SetSaveDate(p,organizationId);
//开启事务
// TransactionStatus transactionStatus = transactionService.begin();
//TransactionStatus transactionStatus = transactionService.begin();
try {
//保存数据
SaveData(p);
// transactionService.commit(transactionStatus);
//transactionService.commit(transactionStatus);
} catch (Exception e) {
logger.error("保存事务回滚:" + p.getSlabNo(), e);
//回滚事务
// transactionService.rollback(transactionStatus);
//transactionService.rollback(transactionStatus);
}
}
@ -816,98 +816,102 @@ public class SubController {
GCG.getLtInfoGPreOrder().add(f);//添加订单信息
});
//存在订单,添加可计算分组
if (GCG.getLtInfoGPreOrder().size() > 0) {
try {
//存在订单,添加可计算分组
if (GCG.getLtInfoGPreOrder().size() > 0) {
//GCG.getLtInfoGPreOrder().stream().filter(e->e.)
//最大宽度
OptionalInt maxWidth = GCG.getLtInfoGPreOrder().stream()
.mapToInt(GPreOrder::getWid)
.max();
//最大宽度余量
OptionalInt maxAddWidth = GCG.getLtInfoGPreOrder().stream()
.mapToInt(GPreOrder::getWidthAddv)
.max();
//宽展比 保留2位小数
BigDecimal decWidRate = BigDecimal.valueOf(maxWidth.orElse(0)).divide(SInfo.getSlabActWid(), 2, RoundingMode.HALF_UP);
//最大厚度公差最小值
Optional<BigDecimal> maxTolThkMin = GCG.getLtInfoGPreOrder().stream()
.map(GPreOrder::getThickTolMin)
.reduce(BigDecimal::max);
//厚度追加值
BigDecimal decThkAdd= BigDecimal.ZERO;
String strThkTolType;
if (GCG.getLtInfoGPreOrder().get(0).getInfoQdToPoOrderDO().getThkTolType() != null) {
strThkTolType = GCG.getLtInfoGPreOrder().get(0).getInfoQdToPoOrderDO().getThkTolType();
} else {
strThkTolType = "*";
}
//存在数据,判断热处理模式
if (plistPmThickAddvBtDO.stream().anyMatch(p -> p.getMscLineNo().equals(SInfo.getMscLineNo())
&& p.getTolTypeCode().equals(strThkTolType)
&& p.getPlateThickFrom().compareTo(GCG.getLtInfoGPreOrder().get(0).getThk()) <= 0
&& p.getPlateThickTo().compareTo(GCG.getLtInfoGPreOrder().get(0).getThk()) >= 0
&& p.getCombinePlateWidthFrom().compareTo(BigDecimal.valueOf(maxWidth.orElse(0) + maxAddWidth.orElse(0))) <= 0
&& p.getCombinePlateWidthTo().compareTo(BigDecimal.valueOf(maxWidth.orElse(0) + maxAddWidth.orElse(0))) >= 0
)) {
if (GCG.getLtInfoGPreOrder().get(0)==null)
{
//GCG.getLtInfoGPreOrder().stream().filter(e->e.)
//最大宽度
OptionalInt maxWidth = GCG.getLtInfoGPreOrder().stream()
.mapToInt(GPreOrder::getWid)
.max();
//最大宽度余量
OptionalInt maxAddWidth = GCG.getLtInfoGPreOrder().stream()
.mapToInt(GPreOrder::getWidthAddv)
.max();
}
//宽展比 保留2位小数
BigDecimal decWidRate = BigDecimal.valueOf(maxWidth.orElse(0)).divide(SInfo.getSlabActWid(), 2, RoundingMode.HALF_UP);
if (GCG.getLtInfoGPreOrder().get(0).getInfoPmContMscTechDO()==null)
{
//最大厚度公差最小值
Optional<BigDecimal> maxTolThkMin = GCG.getLtInfoGPreOrder().stream()
.map(GPreOrder::getThickTolMin)
.reduce(BigDecimal::max);
//厚度追加值
BigDecimal decThkAdd= BigDecimal.ZERO;
}
String strThkTolType;
if (GCG.getLtInfoGPreOrder().get(0).getInfoQdToPoOrderDO().getThkTolType() != null) {
strThkTolType = GCG.getLtInfoGPreOrder().get(0).getInfoQdToPoOrderDO().getThkTolType();
} else {
strThkTolType = "*";
}
//存在数据,判断热处理模式
if (plistPmThickAddvBtDO.stream().anyMatch(p -> p.getMscLineNo().equals(SInfo.getMscLineNo())
&& p.getTolTypeCode().equals(strThkTolType)
&& p.getPlateThickFrom().compareTo(GCG.getLtInfoGPreOrder().get(0).getThk()) <= 0
&& p.getPlateThickTo().compareTo(GCG.getLtInfoGPreOrder().get(0).getThk()) >= 0
&& p.getCombinePlateWidthFrom().compareTo(BigDecimal.valueOf(maxWidth.orElse(0) + maxAddWidth.orElse(0))) <= 0
&& p.getCombinePlateWidthTo().compareTo(BigDecimal.valueOf(maxWidth.orElse(0) + maxAddWidth.orElse(0))) >= 0
)) {
if (GCG.getLtInfoGPreOrder().get(0).getInfoPmContMscTechDO().getWholeHeatTreatmentType().contains("Q")) {
decThkAdd = plistPmThickAddvBtDO.stream().filter(p -> p.getMscLineNo().equals(SInfo.getMscLineNo())
&& p.getTolTypeCode().equals(strThkTolType)
&& p.getWholeHeatTreatmentType().equals("Q")
&& p.getPlateThickFrom().compareTo(GCG.getLtInfoGPreOrder().get(0).getThk()) <= 0
&& p.getPlateThickTo().compareTo(GCG.getLtInfoGPreOrder().get(0).getThk()) >= 0
&& p.getCombinePlateWidthFrom().compareTo(BigDecimal.valueOf(maxWidth.orElse(0) + maxAddWidth.orElse(0))) <= 0
&& p.getCombinePlateWidthTo().compareTo(BigDecimal.valueOf(maxWidth.orElse(0) + maxAddWidth.orElse(0))) >= 0
).collect(Collectors.toList()).get(0).getThickAddv();
} else {
decThkAdd = plistPmThickAddvBtDO.stream().filter(p -> p.getMscLineNo().equals(SInfo.getMscLineNo())
&& p.getTolTypeCode().equals(strThkTolType)
&& p.getWholeHeatTreatmentType().equals("*")
&& p.getPlateThickFrom().compareTo(GCG.getLtInfoGPreOrder().get(0).getThk()) <= 0
&& p.getPlateThickTo().compareTo(GCG.getLtInfoGPreOrder().get(0).getThk()) >= 0
&& p.getCombinePlateWidthFrom().compareTo(BigDecimal.valueOf(maxWidth.orElse(0) + maxAddWidth.orElse(0))) <= 0
&& p.getCombinePlateWidthTo().compareTo(BigDecimal.valueOf(maxWidth.orElse(0) + maxAddWidth.orElse(0))) >= 0
).collect(Collectors.toList()).get(0).getThickAddv();
}
if (GCG.getLtInfoGPreOrder().get(0).getInfoPmContMscTechDO().getWholeHeatTreatmentType()==null)
{
}
}
//轧制厚度 厚度+厚度公差下限最大值+厚度追加值
BigDecimal decThk = e.getThk().add(maxTolThkMin.orElse(BigDecimal.ZERO)).add(decThkAdd);
if (GCG.getLtInfoGPreOrder().get(0).getInfoPmContMscTechDO().getWholeHeatTreatmentType() != null
&& GCG.getLtInfoGPreOrder().get(0).getInfoPmContMscTechDO().getWholeHeatTreatmentType().contains("Q")) {
decThkAdd = plistPmThickAddvBtDO.stream().filter(p -> p.getMscLineNo().equals(SInfo.getMscLineNo())
&& p.getTolTypeCode().equals(strThkTolType)
&& p.getWholeHeatTreatmentType().equals("Q")
&& p.getPlateThickFrom().compareTo(GCG.getLtInfoGPreOrder().get(0).getThk()) <= 0
&& p.getPlateThickTo().compareTo(GCG.getLtInfoGPreOrder().get(0).getThk()) >= 0
&& p.getCombinePlateWidthFrom().compareTo(BigDecimal.valueOf(maxWidth.orElse(0) + maxAddWidth.orElse(0))) <= 0
&& p.getCombinePlateWidthTo().compareTo(BigDecimal.valueOf(maxWidth.orElse(0) + maxAddWidth.orElse(0))) >= 0
).collect(Collectors.toList()).get(0).getThickAddv();
} else {
decThkAdd = plistPmThickAddvBtDO.stream().filter(p -> p.getMscLineNo().equals(SInfo.getMscLineNo())
&& p.getTolTypeCode().equals(strThkTolType)
&& p.getWholeHeatTreatmentType().equals("*")
&& p.getPlateThickFrom().compareTo(GCG.getLtInfoGPreOrder().get(0).getThk()) <= 0
&& p.getPlateThickTo().compareTo(GCG.getLtInfoGPreOrder().get(0).getThk()) >= 0
&& p.getCombinePlateWidthFrom().compareTo(BigDecimal.valueOf(maxWidth.orElse(0) + maxAddWidth.orElse(0))) <= 0
&& p.getCombinePlateWidthTo().compareTo(BigDecimal.valueOf(maxWidth.orElse(0) + maxAddWidth.orElse(0))) >= 0
).collect(Collectors.toList()).get(0).getThickAddv();
}
//轧制宽度 最大宽度+宽度余量
int intWid = maxWidth.orElse(0) + maxAddWidth.orElse(0);
}
//切边
int intTrimWid = 0;
//轧制厚度 厚度+厚度公差下限最大值+厚度追加值
BigDecimal decThk = e.getThk().add(maxTolThkMin.orElse(BigDecimal.ZERO)).add(decThkAdd);
String strWithSideFlag = "C";
if (GCG.getLtInfoGPreOrder().get(0).getInfoPmProContProdAttrDO().getProdAMark()==null
|| GCG.getLtInfoGPreOrder().get(0).getInfoPmProContProdAttrDO().getProdAMark().equals(""))
{
strWithSideFlag="C";
}else{
strWithSideFlag=GCG.getLtInfoGPreOrder().get(0).getInfoPmProContProdAttrDO().getProdAMark();
}
//切边量
String finalStrWithSideFlag = strWithSideFlag;
if (plistPmPlateTrimBtDO.stream().anyMatch(p -> p.getMscLineNo().equals(SInfo.getMscLineNo())
&& p.getPlateThickFrom().compareTo(decThk) <= 0
&& p.getPlateThickTo().compareTo(decThk) >= 0
&& p.getSmallPlateLenFrom().compareTo(BigDecimal.valueOf(GCG.getLtInfoGPreOrder().get(0).getLen())) <= 0
&& p.getSmallPlateLenTo().compareTo(BigDecimal.valueOf(GCG.getLtInfoGPreOrder().get(0).getLen())) >= 0
&& p.getCombinePlateWidthFrom().compareTo(BigDecimal.valueOf(maxWidth.orElse(0) + maxAddWidth.orElse(0))) <= 0
&& p.getCombinePlateWidthTo().compareTo(BigDecimal.valueOf(maxWidth.orElse(0) + maxAddWidth.orElse(0))) >= 0
&& p.getWidenFrom().compareTo(decWidRate) <= 0
&& p.getWidenTo().compareTo(decWidRate) >= 0
&& p.getWithSideFlag().equals(finalStrWithSideFlag)
)) {
//轧制宽度 最大宽度+宽度余量
int intWid = maxWidth.orElse(0) + maxAddWidth.orElse(0);
String finalStrWithSideFlag1 = strWithSideFlag;
intTrimWid = plistPmPlateTrimBtDO.stream().filter(p -> p.getMscLineNo().equals(SInfo.getMscLineNo())
//切边
int intTrimWid = 0;
String strWithSideFlag = "C";
if (GCG.getLtInfoGPreOrder().get(0).getInfoPmProContProdAttrDO().getProdAMark()==null
|| GCG.getLtInfoGPreOrder().get(0).getInfoPmProContProdAttrDO().getProdAMark().equals(""))
{
strWithSideFlag="C";
}else{
strWithSideFlag=GCG.getLtInfoGPreOrder().get(0).getInfoPmProContProdAttrDO().getProdAMark();
}
//切边量
String finalStrWithSideFlag = strWithSideFlag;
if (plistPmPlateTrimBtDO.stream().anyMatch(p -> p.getMscLineNo().equals(SInfo.getMscLineNo())
&& p.getPlateThickFrom().compareTo(decThk) <= 0
&& p.getPlateThickTo().compareTo(decThk) >= 0
&& p.getSmallPlateLenFrom().compareTo(BigDecimal.valueOf(GCG.getLtInfoGPreOrder().get(0).getLen())) <= 0
@ -916,23 +920,39 @@ public class SubController {
&& p.getCombinePlateWidthTo().compareTo(BigDecimal.valueOf(maxWidth.orElse(0) + maxAddWidth.orElse(0))) >= 0
&& p.getWidenFrom().compareTo(decWidRate) <= 0
&& p.getWidenTo().compareTo(decWidRate) >= 0
&& p.getWithSideFlag().equals(finalStrWithSideFlag1)
).collect(Collectors.toList()).get(0).getTrimWidth().intValue();
}
&& p.getWithSideFlag().equals(finalStrWithSideFlag)
)) {
String finalStrWithSideFlag1 = strWithSideFlag;
intTrimWid = plistPmPlateTrimBtDO.stream().filter(p -> p.getMscLineNo().equals(SInfo.getMscLineNo())
&& p.getPlateThickFrom().compareTo(decThk) <= 0
&& p.getPlateThickTo().compareTo(decThk) >= 0
&& p.getSmallPlateLenFrom().compareTo(BigDecimal.valueOf(GCG.getLtInfoGPreOrder().get(0).getLen())) <= 0
&& p.getSmallPlateLenTo().compareTo(BigDecimal.valueOf(GCG.getLtInfoGPreOrder().get(0).getLen())) >= 0
&& p.getCombinePlateWidthFrom().compareTo(BigDecimal.valueOf(maxWidth.orElse(0) + maxAddWidth.orElse(0))) <= 0
&& p.getCombinePlateWidthTo().compareTo(BigDecimal.valueOf(maxWidth.orElse(0) + maxAddWidth.orElse(0))) >= 0
&& p.getWidenFrom().compareTo(decWidRate) <= 0
&& p.getWidenTo().compareTo(decWidRate) >= 0
&& p.getWithSideFlag().equals(finalStrWithSideFlag1)
).collect(Collectors.toList()).get(0).getTrimWidth().intValue();
}
//轧制宽度= 最大宽度 + 最大宽度余量 + 切边量
intWid = intWid + intTrimWid;
//轧制宽度= 最大宽度 + 最大宽度余量 + 切边量
intWid = intWid + intTrimWid;
//宽度
GCG.setWid(intWid);
//宽度
GCG.setWid(intWid);
//厚度
GCG.setThk(decThk);
//厚度
GCG.setThk(decThk);
//切边
GCG.setWid_Add(intTrimWid);
//切边
GCG.setWid_Add(intTrimWid);
gltGCalGrp.add(GCG);
gltGCalGrp.add(GCG);
}
} catch (Exception ex) {
logger.error("SetGrpConBinDataBySlab", ex);
}
});
@ -1101,7 +1121,24 @@ public class SubController {
&& p.getCombinePlateWidthFrom().compareTo(BigDecimal.valueOf(maxWidth + maxAddWidth.orElse(0))) <= 0
&& p.getCombinePlateWidthTo().compareTo(BigDecimal.valueOf(maxWidth + maxAddWidth.orElse(0))) >= 0
)) {
if (GCG.getLtInfoGPreOrder().get(0).getInfoPmContMscTechDO().getWholeHeatTreatmentType().contains("Q")) {
if (GCG.getLtInfoGPreOrder().get(0)==null)
{
}
if (GCG.getLtInfoGPreOrder().get(0).getInfoPmContMscTechDO()==null)
{
}
if (GCG.getLtInfoGPreOrder().get(0).getInfoPmContMscTechDO().getWholeHeatTreatmentType()==null)
{
}
if (GCG.getLtInfoGPreOrder().get(0).getInfoPmContMscTechDO().getWholeHeatTreatmentType()!=null &&
GCG.getLtInfoGPreOrder().get(0).getInfoPmContMscTechDO().getWholeHeatTreatmentType().contains("Q")) {
decThkAdd = plistPmThickAddvBtDO.stream().filter(p -> p.getMscLineNo().equals(SInfo.getMscLineNo())
&& p.getTolTypeCode().equals(strThkTolType)
&& p.getWholeHeatTreatmentType().equals("Q")
@ -2453,8 +2490,15 @@ public class SubController {
// 使用 AtomicInteger 获取索引
AtomicInteger index = new AtomicInteger(0);
AtomicInteger intX = new AtomicInteger(maxRate.getHead_Len());
maxRate.getLtActInfoGPreOrder().forEach(
gPreOrder -> {
boolean Firstflag = true;
for(int m = 0; m < maxRate.getLtActInfoGPreOrder().size(); m++)
{
GPreOrder gPreOrder=maxRate.getLtActInfoGPreOrder().get(m);
if (gPreOrder.getCombinationFlag()==1)
{
BigDecimal intY = BigDecimal.valueOf(0);
for (int i = 0; i < gPreOrder.getLtInfoCombGPreOrder().size(); i++) {
int currentIndex = index.getAndIncrement();
// 实例化 PmSubOrdDO 对象
@ -2466,18 +2510,31 @@ public class SubController {
pmSubOrdDO.setSlabNo(SInfo.getSlabNo()); // 板坯号
// 手动为每个字段赋值
pmSubOrdDO.setOrderNo(gPreOrder.getOrderNo()); // 合同号
pmSubOrdDO.setSgSign(gPreOrder.getInfoPmProContProdAttrDO().getSgSign()); // 牌号
pmSubOrdDO.setOrderNo(gPreOrder.getLtInfoCombGPreOrder().get(i).getInfoGPreOrder().getOrderNo()); // 合同号
pmSubOrdDO.setSgSign(gPreOrder.getLtInfoCombGPreOrder().get(i).getInfoGPreOrder().getInfoPmProContProdAttrDO().getSgSign()); // 牌号
pmSubOrdDO.setStNo(SInfo.getStNo()); // 内部钢种
pmSubOrdDO.setOrderThick(gPreOrder.getThk()); // 订货厚度
pmSubOrdDO.setOrderWidth(BigDecimal.valueOf(gPreOrder.getWid())); // 订货宽度
pmSubOrdDO.setLenAim(BigDecimal.valueOf(gPreOrder.getLen())); // 订货长度
pmSubOrdDO.setOrderThick(gPreOrder.getLtInfoCombGPreOrder().get(i).getInfoGPreOrder().getThk()); // 订货厚度
pmSubOrdDO.setOrderWidth(BigDecimal.valueOf(gPreOrder.getLtInfoCombGPreOrder().get(i).getInfoGPreOrder().getWid())); // 订货宽度
pmSubOrdDO.setLenAim(BigDecimal.valueOf(gPreOrder.getLtInfoCombGPreOrder().get(i).getInfoGPreOrder().getLen())); // 订货长度
pmSubOrdDO.setPosX(BigDecimal.valueOf(intX.intValue())); // X坐标假设默认为0
intX.addAndGet(gPreOrder.getLen() + 5);//X坐标
pmSubOrdDO.setPosY(BigDecimal.valueOf(maxRate.getTrimming() + gPreOrder.getWidthAddv())); // Y坐标假设默认为0
//第一块
if (i == 0) {
intY = BigDecimal.valueOf(maxRate.getTrimming() + gPreOrder.getLtInfoCombGPreOrder().get(i).getInfoGPreOrder().getWidthAddv());
pmSubOrdDO.setPosY(intY); // Y坐标假设默认为0
intY = intY.add(BigDecimal.valueOf(gPreOrder.getLtInfoCombGPreOrder().get(i).getInfoGPreOrder().getWid()));
} else {
pmSubOrdDO.setPosY(intY); // Y坐标假设默认为0
}
pmSubOrdDO.setDelivyDate(new Date()); // 交货日期,假设默认为当前时间
if (Firstflag) {
pmSubOrdDO.setAxisOrd("1"); // 轴合同
Firstflag = false;
} else {
pmSubOrdDO.setAxisOrd("0"); // 轴合同
}
pmSubOrdDO.setAxisOrd("0"); // 轴合同
pmSubOrdDO.setLackNum(BigDecimal.ZERO); // 欠量假设默认为0
pmSubOrdDO.setOverNum(BigDecimal.ZERO); // 超投假设默认为0
@ -2498,10 +2555,57 @@ public class SubController {
plistpmSubOrdDO.add(pmSubOrdDO);
//记录被使用的订单数据
plistOrdHis.add(gPreOrder);
plistOrdHis.add(gPreOrder.getLtInfoCombGPreOrder().get(i).getInfoGPreOrder());
}
);
intX.addAndGet(gPreOrder.getLen() + 5);//X坐标
} else {
int currentIndex = index.getAndIncrement();
// 实例化 PmSubOrdDO 对象
PmSubOrd pmSubOrdDO = new PmSubOrd();
// 生成虚拟板坯号
pmSubOrdDO.setVirtualSlabNo(virtualSlabNo); // 虚拟板坯号
pmSubOrdDO.setRelKey(virtualSlabNo); // 关系号
pmSubOrdDO.setSlabNo(SInfo.getSlabNo()); // 板坯号
// 手动为每个字段赋值
pmSubOrdDO.setOrderNo(gPreOrder.getOrderNo()); // 合同号
pmSubOrdDO.setSgSign(gPreOrder.getInfoPmProContProdAttrDO().getSgSign()); // 牌号
pmSubOrdDO.setStNo(SInfo.getStNo()); // 内部钢种
pmSubOrdDO.setOrderThick(gPreOrder.getThk()); // 订货厚度
pmSubOrdDO.setOrderWidth(BigDecimal.valueOf(gPreOrder.getWid())); // 订货宽度
pmSubOrdDO.setLenAim(BigDecimal.valueOf(gPreOrder.getLen())); // 订货长度
pmSubOrdDO.setPosX(BigDecimal.valueOf(intX.intValue())); // X坐标假设默认为0
intX.addAndGet(gPreOrder.getLen() + 5);//X坐标
pmSubOrdDO.setPosY(BigDecimal.valueOf(maxRate.getTrimming() + gPreOrder.getWidthAddv())); // Y坐标假设默认为0
pmSubOrdDO.setDelivyDate(new Date()); // 交货日期,假设默认为当前时间
pmSubOrdDO.setAxisOrd("0"); // 轴合同
pmSubOrdDO.setLackNum(BigDecimal.ZERO); // 欠量假设默认为0
pmSubOrdDO.setOverNum(BigDecimal.ZERO); // 超投假设默认为0
pmSubOrdDO.setCreationDate(new Date()); // 创建时间
pmSubOrdDO.setCreatedBy(781L); // 创建人ID假设默认为781
pmSubOrdDO.setLastUpdatedBy(781L); // 最近更新人ID假设默认为781
pmSubOrdDO.setLastUpdateDate(new Date()); // 最近更新时间
pmSubOrdDO.setTenantId(1L); // 租户ID假设默认为0
pmSubOrdDO.setObjectVersionNumber(1L); // 行版本号假设默认为0
pmSubOrdDO.setAttribute1(""); // 假设没有对应字段,设置为默认值
pmSubOrdDO.setAttribute2(""); // 假设没有对应字段,设置为默认值
pmSubOrdDO.setAttribute3(""); // 假设没有对应字段,设置为默认值
pmSubOrdDO.setAttribute4(""); // 假设没有对应字段,设置为默认值
pmSubOrdDO.setAttribute5(""); // 假设没有对应字段,设置为默认值
pmSubOrdDO.setOrderSeqNo(Long.valueOf(currentIndex)); // 合同顺序号,假设使用合同号作为顺序号
// 将 PmSubOrdDO 对象添加到列表中
plistpmSubOrdDO.add(pmSubOrdDO);
//记录被使用的订单数据
plistOrdHis.add(gPreOrder);
}
}
//判断长宽大小
BigDecimal decLen = BigDecimal.valueOf(SInfo.getRemLen().intValue() - maxRate.getVirtualSlab_Len());
@ -2581,10 +2685,12 @@ public class SubController {
pmPdSlabDO.setAutoManualFlag("M");
pmPdSlabDO.setOrderRemainDiv("1");
pmPdSlabDO.setCanDelFlag("1");
//TODO合同个数取所有合同的数量
List<String> orderNoList = ggcr.getLtActInfoGPreOrder().stream().map(GPreOrder::getOrderNo).distinct().collect(Collectors.toList());//根据实际合同信息 的合同号去重 取出板内合同个数
pmPdSlabDO.setOrderNumInPlate(BigDecimal.valueOf(orderNoList.size()));
//TODO:合同数量,取所有小板的数据量
pmPdSlabDO.setTotSmallPlateNum(BigDecimal.valueOf(ggcr.getLtActInfoGPreOrder().size()));
//TODO轴合同获取
Optional<PmContMscTech> resultPmContMscTechDO = plistPmContMscTechDO.stream()
.filter(item -> ggcr.getLtActInfoGPreOrder().get(0).getOrderNo().equals(item.getOrderNo())) //TODO 根据轴合同号查询合同工艺表 暂时取第一条合同
.findFirst();

@ -24,6 +24,14 @@ public class GCalGrp {
private BigDecimal Thk;
//长度
private int Len;
//厚度
private BigDecimal Order_Thk;
// 厚度公差上限
private BigDecimal thickTolMax;
//厚度公差下限
private BigDecimal thickTolMin;
//标准
private String SG_STD;
//宽度余量

@ -59,7 +59,7 @@ public class GPreOrder {
private QdToPoOrder infoQdToPoOrderDO;
//组合标识
private int CombinationFlag;
private int CombinationFlag = 0;
//组合信息
private List<GComBOrder> LtInfoCombGPreOrder;
}

@ -416,21 +416,21 @@ public class SubServiceImpl implements SubService {
@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) {
// 调用mm接口
// 查询MM_SLAB 信息获取板坯信息
PmPdSlabSplitDTO pmPdSlabSplitDTO = pmPdSlabRepository.selectMmSlabBySlabId(p.getSlabId(),p.getTenantId());
// 查询板坯信息表。第一次查询可能无值
PmPdSlabInfo pmPdSlabInfo = pmPdSlabInfoRepository.selectBySlabNo(p.getSlabNo(), p.getTenantId());
if (pmPdSlabInfo == null) {
pmPdSlabInfo = buildPmPdSlabInfo(pmPdSlabSplitDTO , p.getSlabNo() , p.getMscLineNo() , p.getTenantId());
pmPdSlabInfoRepository.insertSelective(pmPdSlabInfo);
System.out.println("pmPdSlabInfo表 保存成功");
// 轧钢模块“在制品材料管理封锁事件接口"
callMatStatusModify(pmPdSlabInfo);
System.out.println("mm模块接口 调用成功");
}
// // 调用mm接口
// // 查询MM_SLAB 信息获取板坯信息
// PmPdSlabSplitDTO pmPdSlabSplitDTO = pmPdSlabRepository.selectMmSlabBySlabId(p.getSlabId(),p.getTenantId());
//
// // 查询板坯信息表。第一次查询可能无值
// PmPdSlabInfo pmPdSlabInfo = pmPdSlabInfoRepository.selectBySlabNo(p.getSlabNo(), p.getTenantId());
//
// if (pmPdSlabInfo == null) {
// pmPdSlabInfo = buildPmPdSlabInfo(pmPdSlabSplitDTO , p.getSlabNo() , p.getMscLineNo() , p.getTenantId());
// pmPdSlabInfoRepository.insertSelective(pmPdSlabInfo);
// System.out.println("pmPdSlabInfo表 保存成功");
// // 轧钢模块“在制品材料管理封锁事件接口"
// callMatStatusModify(pmPdSlabInfo);
// System.out.println("mm模块接口 调用成功");
// }
@ -442,43 +442,43 @@ public class SubServiceImpl implements SubService {
pmSubOrdRepository.batchInsertSelective(plistpmSubOrdDO);
System.out.println("pmSubOrd表 保存成功");
}
if(pmPdSlabDOList.size()>0){
pmPdSlabRepository.batchInsertSelective(pmPdSlabDOList);
System.out.println("PmPdSlab表 保存成功");
}
if(pmPdPlateCutDOList.size()>0){
pmPdPlateCutRepository.batchInsertSelective(pmPdPlateCutDOList);
System.out.println("PmPdPlateCut 大板粗切位置 保存成功");
}
if(pmPdBlockPosDOList.size()>0){
pmPdBlockPosRepository.batchInsertSelective(pmPdBlockPosDOList);
System.out.println("PmPdBlockPos 组合子板位置表 保存成功");
}
if(pmPdContSumDOList.size()>0){
pmPdContSumRepository.batchInsertSelective(pmPdContSumDOList);
System.out.println("PmPdContSum 合同总量表 保存成功");
}
if(pmSmallPltPosDOList.size()>0){
pmSmallPltPosRepository.batchInsertSelective(pmSmallPltPosDOList);
System.out.println("PmSmallPltPos 命令小板位置表 保存成功");
}
if(pmCmdSlabDOList.size()>0){
pmCmdSlabRepository.batchInsertSelective(pmCmdSlabDOList);
System.out.println("PmCmdSlab 保存成功");
}
if(pmCmdLargePltDOList.size()>0){
pmCmdLargePltRepository.batchInsertSelective(pmCmdLargePltDOList);
System.out.println("pmCmdLargePltDO 命令大板 保存成功");
}
if(pmCmdContDOList.size()>0){
pmCmdContRepository.batchInsertSelective(pmCmdContDOList);
System.out.println("PmCmdCont 命令参数 保存成功");
}
if(pmCmdSmallPltDOList.size()>0){
pmCmdSmallPltRepository.batchInsertSelective(pmCmdSmallPltDOList);
System.out.println("PmCmdSmallPlt 命令小板表 保存成功");
}
//
// if(pmPdSlabDOList.size()>0){
// pmPdSlabRepository.batchInsertSelective(pmPdSlabDOList);
// System.out.println("PmPdSlab表 保存成功");
// }
// if(pmPdPlateCutDOList.size()>0){
// pmPdPlateCutRepository.batchInsertSelective(pmPdPlateCutDOList);
// System.out.println("PmPdPlateCut 大板粗切位置 保存成功");
// }
// if(pmPdBlockPosDOList.size()>0){
// pmPdBlockPosRepository.batchInsertSelective(pmPdBlockPosDOList);
// System.out.println("PmPdBlockPos 组合子板位置表 保存成功");
// }
// if(pmPdContSumDOList.size()>0){
// pmPdContSumRepository.batchInsertSelective(pmPdContSumDOList);
// System.out.println("PmPdContSum 合同总量表 保存成功");
// }
// if(pmSmallPltPosDOList.size()>0){
// pmSmallPltPosRepository.batchInsertSelective(pmSmallPltPosDOList);
// System.out.println("PmSmallPltPos 命令小板位置表 保存成功");
// }
// if(pmCmdSlabDOList.size()>0){
// pmCmdSlabRepository.batchInsertSelective(pmCmdSlabDOList);
// System.out.println("PmCmdSlab 保存成功");
// }
// if(pmCmdLargePltDOList.size()>0){
// pmCmdLargePltRepository.batchInsertSelective(pmCmdLargePltDOList);
// System.out.println("pmCmdLargePltDO 命令大板 保存成功");
// }
// if(pmCmdContDOList.size()>0){
// pmCmdContRepository.batchInsertSelective(pmCmdContDOList);
// System.out.println("PmCmdCont 命令参数 保存成功");
// }
// if(pmCmdSmallPltDOList.size()>0){
// pmCmdSmallPltRepository.batchInsertSelective(pmCmdSmallPltDOList);
// System.out.println("PmCmdSmallPlt 命令小板表 保存成功");
// }
}
/**

Loading…
Cancel
Save