Compare commits

...

3 Commits

Author SHA1 Message Date
sunhao a8aacbd692 Merge remote-tracking branch 'origin/main'
# Conflicts:
#	XG_Project1/src/main/java/com/xisc/pm/api/controller/v1/SubController.java
2 weeks ago
sunhao c93747a81b 2025-03-19
Line
2 weeks ago
sunhao e293896930 2025-03-14
DEV
2 weeks ago

@ -13,6 +13,14 @@
<name>xisc-pm</name>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<scope>runtime</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.hzero.boot</groupId>
<artifactId>hzero-boot-interface</artifactId>
@ -95,6 +103,14 @@
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
<addResources>true</addResources>
</configuration>
</plugin>
</plugins>
</build>

@ -1,12 +1,16 @@
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.*;
import com.xisc.pm.domain.entity.*;
import com.xisc.pm.domain.vo.util.JsonData;
import com.xisc.pm.infra.client.QdOrderClient;
import io.choerodon.core.iam.ResourceLevel;
import io.choerodon.core.oauth.CustomUserDetails;
import io.choerodon.core.oauth.DetailsHelper;
@ -18,6 +22,7 @@ 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;
@ -33,6 +38,7 @@ import static com.xisc.pm.tool.Tool.nvl;
import com.xisc.pm.app.service.SubService;
@RestController("subController.v1")
@Slf4j(topic = "xt-special1")
@RequestMapping("/v1/{organizationId}/Sub")
@ -40,7 +46,8 @@ public class SubController {
@Autowired
private SubService subService;
@Autowired
private QdOrderClient qdOrderClient;
// @Autowired
// private TransactionService transactionService;
@ -189,6 +196,9 @@ public class SubController {
//记录已被使用的订单号
private static List<GPreOrder> plistOrdHis = new ArrayList<>();
private static List<ChkChmResult> plistChmChkRsult= new ArrayList<>();
private static List<ChkLowResult> plistLowChkRsult= new ArrayList<>();
//endregion
@ApiOperation("求解处理")
@ -220,30 +230,114 @@ public class SubController {
}
@ApiOperation("数据处理")
@Permission(level = ResourceLevel.ORGANIZATION)
@PostMapping("/SubData1")
public JsonData SubData1( PmProductionPlanReqDTO dtoList, @PathVariable Long organizationId) {
@Permission(level = ResourceLevel.ORGANIZATION)
public JsonData SubData1( PmSubHis dtoListpr, @PathVariable Long organizationId) {
SecurityTokenHelper.validTokenIgnoreInsert(dtoListpr);
String strSlab = dtoListpr.getSlabNo();
SubParams subParams = new SubParams();
subParams.setSlabNo(strSlab);
//获取所有数据
GetDataInfo(subParams);
plistSlab.forEach(p -> {
try {
List<QdMatchParamDTO> dtoListChm = new ArrayList<QdMatchParamDTO>();
for (PmProCont gpo : plistOrder) {
QdMatchParamDTO phyFurnaceChemicalMatchDTO = new QdMatchParamDTO();
if (gpo.getOrderNo() == null || gpo.getOrderNo().equals("")) {
continue;
}
phyFurnaceChemicalMatchDTO.setOrderNo(gpo.getOrderNo());
phyFurnaceChemicalMatchDTO.setPono(p.getPono());
dtoListChm.add(phyFurnaceChemicalMatchDTO);
}
logger.info("数量:" + dtoListChm.size());
logger.info("数量:" + dtoListChm.size());
logger.info("数量:" + dtoListChm.size());
logger.info("数量:" + dtoListChm.size());
List<QdMatchParamDTO> reslutChm = qdOrderClient.phyFurnaceChemicalMatchApi(organizationId,
dtoListChm);
if (reslutChm != null && !reslutChm.isEmpty()) {
if (reslutChm != null && !reslutChm.isEmpty()) {
for (QdMatchParamDTO qdMatchParamDTO : reslutChm) {
if (!plistChmChkRsult.stream().anyMatch(m -> m.getPono().equals(p.getPono()) && m.getOrderNo().equals(qdMatchParamDTO.getOrderNo()))) {
ChkChmResult CR = new ChkChmResult();
CR.setPono(p.getPono());
CR.setOrderNo(qdMatchParamDTO.getOrderNo());
CR.setChmresult(qdMatchParamDTO.getResult());
plistChmChkRsult.add(CR);
}
}
}
}
} catch (Exception e) {
logger.info("错误信息:"+e);
}
try {
List<QdSurplusLowMagnificationDTO> dtoListLow = new ArrayList<QdSurplusLowMagnificationDTO>();
for (PmProCont gpo : plistOrder) {
if (gpo.getOrderNo() == null || gpo.getOrderNo().equals("")) {
continue;
}
QdSurplusLowMagnificationDTO phyFurnaceChemicalMatchDTO = new QdSurplusLowMagnificationDTO();
phyFurnaceChemicalMatchDTO.setOrderNo(gpo.getOrderNo());
phyFurnaceChemicalMatchDTO.setPono(p.getPono());
dtoListLow.add(phyFurnaceChemicalMatchDTO);
}
List<QdSurplusLowMagnificationDTO> reslutLow = qdOrderClient.surplusLowMagnificationMatchApi(organizationId,
dtoListLow);
if (reslutLow != null && !reslutLow.isEmpty()) {
if (reslutLow != null && !reslutLow.isEmpty()) {
for (QdSurplusLowMagnificationDTO qdSurplusLowMagnificationDTO : reslutLow) {
if (!plistLowChkRsult.stream().anyMatch(m -> m.getPono().equals(p.getPono()) && m.getOrderNo().equals(qdSurplusLowMagnificationDTO.getOrderNo()))) {
ChkLowResult CR = new ChkLowResult();
CR.setPono(p.getPono());
CR.setOrderNo(qdSurplusLowMagnificationDTO.getOrderNo());
CR.setLowresult(qdSurplusLowMagnificationDTO.getResult());
plistLowChkRsult.add(CR);
}
}
}
}
} catch (Exception e) {
logger.info("错误信息:"+e);
}
});
System.out.println("调用成功");
JsonData xx = new JsonData();
xx.setCode(0);
xx.setData(null);
xx.setMsg("123");
return xx;
}
@ApiOperation("数据处理")
@PostMapping("/SubData")
@Permission(level = ResourceLevel.ORGANIZATION)
public JsonData SubData(@RequestBody PmSubHis pmSubHis, @PathVariable Long organizationId) {
public JsonData SubData( PmSubHis pmSubHis, @PathVariable Long organizationId) {
SecurityTokenHelper.validTokenIgnoreInsert(pmSubHis);
String strSlab = pmSubHis.getSlabNo();
SubParams subParams = new SubParams();
subParams.setSlabNo(strSlab);
//测试阶段需要指定板坯号
if (strSlab==null || strSlab=="")
{
return null;
}
// if (strSlab==null || strSlab=="")
// {
// return null;
// }
//获取所有数据
GetDataInfo(subParams);
@ -291,6 +385,7 @@ public class SubController {
}
try {
gltGCalGrp = new ArrayList<>();
//二次分组
SetGrpDataBySlab(p);
@ -299,7 +394,7 @@ public class SubController {
logger.info("***二次分组1数量*** " + gltGCalGrp.size());
logger.info("***二次分组2数量*** " + gltGCal2Grp.size());
logger.info("***二次分组21数量*** " + gltGCal2Grp.size());
gltGCalGrp.addAll(gltGCal2Grp);
@ -350,27 +445,27 @@ public class SubController {
SetGroupCalRslt(p);
logger.info("结果数据板坯号:{};数量:{}", p.getSlabNo(), gltGGrpCalRslt.size());
logger.info("结果数据板坯号:{};数量:{}", p.getSlabNo(), gltSelGGrpCalRslt.size());
}
if (gltSelGGrpCalRslt.size() > 0) {
now = new Date();
//存储数据,组板结果
SaveHisData(p);
//数据整理
SetSaveDate(p,organizationId);
//开启事务
//TransactionStatus transactionStatus = transactionService.begin();
try {
//保存数据
SaveData(p,organizationId);
//transactionService.commit(transactionStatus);
} catch (Exception e) {
logger.error("保存事务回滚:" + p.getSlabNo(), e);
//回滚事务
//transactionService.rollback(transactionStatus);
}
logger.info("所有结果数据板坯号:{};数量:{}", p.getSlabNo(), gltGGrpCalRslt.size());
logger.info("选择结果数据板坯号:{};数量:{}", p.getSlabNo(), gltSelGGrpCalRslt.size());
}
// if (gltSelGGrpCalRslt.size() > 0) {
// now = new Date();
// //存储数据,组板结果
// SaveHisData(p);
// //数据整理
// SetSaveDate(p,organizationId);
// //开启事务
// //TransactionStatus transactionStatus = transactionService.begin();
// try {
// //保存数据
// SaveData(p,organizationId);
// //transactionService.commit(transactionStatus);
// } catch (Exception e) {
// logger.error("保存事务回滚:" + p.getSlabNo(), e);
// //回滚事务
// //transactionService.rollback(transactionStatus);
// }
// }
} catch (Exception e) {
logger.error("板坯报错:" + p.getSlabNo(), e);

@ -0,0 +1,20 @@
package com.xisc.pm.api.dto.model;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
public class ChkChmResult {
//命令号
private String pono;
// //板坯号
// private String SlabNo;
//订单号
private String orderNo;
//化学成分验证接口返回结果
private String Chmresult;
// //低倍验证接口返回结果
// private String Lowresult;
}

@ -0,0 +1,20 @@
package com.xisc.pm.api.dto.model;
import lombok.Data;
import lombok.EqualsAndHashCode;
@Data
@EqualsAndHashCode(callSuper = false)
public class ChkLowResult {
//命令号
private String pono;
// //板坯号
// private String SlabNo;
//订单号
private String orderNo;
//化学成分验证接口返回结果
private String Lowresult;
// //低倍验证接口返回结果
// private String Lowresult;
}

@ -20,7 +20,8 @@ public class GGrpOrderFir {
private Integer Len;
//标准
private String SG_STD;
//合同产线
private String Line ;
//合同信息
private List<GPreOrder> LtInfoGPreOrder;

@ -20,6 +20,9 @@ public class GPreOrder {
//合同号
private String orderNo;
//合同产线
private String Line ;
//实际长度
private Integer intActLen;

@ -1,6 +1,6 @@
spring:
application:
name: ${SPRING_APPLICATION_NAME:xisc-zb}
name: ${SPRING_APPLICATION_NAME:xisc-zb-sunh}
datasource:
url: ${SPRING_DATASOURCE_URL:jdbc:oracle:thin:@172.18.15.50:1521:momdev}
username: ${SPRING_DATASOURCE_USERNAME:xisc_pm}
@ -12,6 +12,10 @@ spring:
maximum-pool-size: ${SPRING_DATASOURCE_MAXIMUM_POOL_SIZE:200}
# 等待连接池分配连接的最大时长(毫秒)
connection-timeout: ${SPRING_DATASOURCE_CONNECTION_TIMEOUT:30000}
devtools:
restart:
enabled: true # 启用自动重启功能
interval: 5000 # 设置检查类路径变化的间隔时间为 5 秒5000 毫秒)
redis:
host: ${SPRING_REDIS_HOST:172.18.15.29}
port: ${SPRING_REDIS_PORT:6379}
@ -94,9 +98,9 @@ mybatis:
hzero:
service:
current:
name: ${HZERO_ROUTER_NAME:xisc-zb}
path: ${HZERO_SERVICE_PATH:/zb/**}
service-name: ${HZERO_SERVICE_NAME:xisc-zb}
name: ${HZERO_ROUTER_NAME:xisc-zb-sunh}
path: ${HZERO_SERVICE_PATH:/zb-sunh/**}
service-name: ${HZERO_SERVICE_NAME:xisc-zb-sunh}
scheduler:
auto-register: ${SCHEDULER_AUTO_REGISTER:true}
executor-code: ${SCHEDULER_EXECUTOR_CODE:PM_EXECUTOR}

@ -12,6 +12,10 @@ spring:
maximum-pool-size: ${SPRING_DATASOURCE_MAXIMUM_POOL_SIZE:200}
# 等待连接池分配连接的最大时长(毫秒)
connection-timeout: ${SPRING_DATASOURCE_CONNECTION_TIMEOUT:30000}
devtools:
restart:
enabled: true # 启用自动重启功能
interval: 5000 # 设置检查类路径变化的间隔时间为 5 秒5000 毫秒)
redis:
host: ${SPRING_REDIS_HOST:172.18.15.29}
port: ${SPRING_REDIS_PORT:6379}
@ -100,6 +104,8 @@ hzero:
executor-code: ${SCHEDULER_EXECUTOR_CODE:ZB_EXECUTOR}
upload-log: false
#seata 配置
seata:
enabled: ${SEATA_ENABLED:true}

@ -74,15 +74,16 @@
<select id="getOrderInfo" resultType="com.xisc.pm.domain.entity.PmProCont">
SELECT ppc.* FROM PM_PRO_CONT ppc
SELECT distinct ppc.* FROM PM_PRO_CONT ppc
LEFT JOIN XISC_CT.CT_MAIN CM ON PPC.ORDER_NO = CM.ORDER_NO
LEFT JOIN PM_PRO_CONT_PROD_ATTR ppcpa ON ppcpa.ORDER_NO = ppc.ORDER_NO
LEFT JOIN PM_CONT_MSC_TECH PCMT ON PCMT.ORDER_NO = ppc.ORDER_NO
AND ppc.PRO_CONT_ID = pcmt.PRO_CONT_ID
-- AND ppc.PRO_CONT_ID = pcmt.PRO_CONT_ID
-- AND cm.MSC_LINE_NO = pcmt.MSC_LINE_NO --PM_PRO_CONT没有MSC_LINE_NO
WHERE 1=1
-- AND pcmt.MSC_LINE_NO = '1030' --5米轧线
-- AND ppc.ORDER_NO IN ('J2502001208')
-- AND ppc.ORDER_NO IN ('52500095215','52500096023')
AND PCMT.FUR_TYPE ='C' --加热炉类型 C 没有注解C和S 都代表什么
AND ppcpa.ORDER_TYPE_CODE != 'QFH'
AND PPC.ON_PD_FLAG != 1 --不用验证操作者
@ -94,16 +95,16 @@
<select id="getQdToPoOrder" resultType="com.xisc.pm.domain.entity.QdToPoOrder">
SELECT QTPO.* FROM XISC_QD.QD_TO_PO_ORDER QTPO
SELECT distinct QTPO.* FROM XISC_QD.QD_TO_PO_ORDER QTPO
LEFT JOIN PM_PRO_CONT ppc ON QTPO.ORDER_NO = PPC.ORDER_NO
LEFT JOIN XISC_CT.CT_MAIN CM ON PPC.ORDER_NO = CM.ORDER_NO
LEFT JOIN PM_PRO_CONT_PROD_ATTR ppcpa ON ppcpa.ORDER_NO = ppc.ORDER_NO
LEFT JOIN PM_CONT_MSC_TECH PCMT ON PCMT.ORDER_NO = ppc.ORDER_NO
AND ppc.PRO_CONT_ID = pcmt.PRO_CONT_ID
-- AND ppc.PRO_CONT_ID = pcmt.PRO_CONT_ID
-- AND cm.MSC_LINE_NO = pcmt.MSC_LINE_NO --PM_PRO_CONT没有MSC_LINE_NO
WHERE 1=1
-- AND pcmt.MSC_LINE_NO = '1030' --5米轧线
-- AND ppc.ORDER_NO IN ('52500037002')
-- AND ppc.ORDER_NO IN ('52500095215','52500096023')
AND PCMT.FUR_TYPE ='C' --加热炉类型 C 没有注解C和S 都代表什么
AND ppcpa.ORDER_TYPE_CODE != 'QFH'
AND PPC.ON_PD_FLAG != 1 --不用验证操作者

Loading…
Cancel
Save