Переглянути джерело

退火调度新老模型切换配置化

fangpy 2 місяців тому
батько
коміт
5911fde739

+ 16 - 2
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsServiceImpl.java

@@ -9,6 +9,7 @@ import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.ObjectUtil;
 import cn.hutool.core.util.StrUtil;
 import cn.hutool.json.JSONConfig;
+import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
@@ -794,8 +795,11 @@ public class ApsServiceImpl implements ApsService {
             if (apsType.getConstraintMode() != null && apsType.getConstraintMode().equals("lz") && "dd".equals(apsType.getScheduleType())) {
                 productionScheduleRetVo = rwApsServer.productionLzDdSchedule(apsProductionSchedule);
             }else if("dd".equals(apsType.getScheduleType()) && "thMergeBf".equals(apsType.getThMergeMode())){
-//                productionScheduleRetVo = rwApsServer.productionThDdSchedule(apsProductionSchedule);
-                productionScheduleRetVo = rwApsServer.productionSchedule(apsProductionSchedule);
+                if(StrUtil.isNotBlank(apsProductionSchedule.getThDdType()) && "newMode".equals(apsProductionSchedule.getThDdType())){
+                    productionScheduleRetVo = rwApsServer.productionThDdSchedule(apsProductionSchedule);
+                }else{
+                    productionScheduleRetVo = rwApsServer.productionSchedule(apsProductionSchedule);
+                }
             }else {
                 productionScheduleRetVo = rwApsServer.productionSchedule(apsProductionSchedule);
             }
@@ -1110,6 +1114,16 @@ public class ApsServiceImpl implements ApsService {
             // 默认卷重差配置
             productionScheduleVo.setWeightdifference(apsScheduleConfig.getWeightdifference());
             productionScheduleVo.setMidweightdifference(apsScheduleConfig.getMidweightdifference());
+            // 自定义扩展配置
+            if(StrUtil.isNotBlank(apsScheduleConfig.getRoption())){
+                try{
+                    JSONObject jsonObject = JSONUtil.parseObj(apsScheduleConfig.getRoption());
+                    String thDdType = jsonObject.getStr("thDdType");
+                    productionScheduleVo.setThDdType(thDdType);
+                }catch (Exception ex){
+                    logger.error("排程全局配置自定义扩展字段roption,格式化错误",ex);
+                }
+            }
         } else {
             throw new CustomException("排程参数缺失");
         }

+ 7 - 0
cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/vo/ProductionScheduleVo.java

@@ -40,6 +40,13 @@ public class ProductionScheduleVo {
      */
     private ApsTypeVo scheduleType;
 
+    /**
+     * 退火调度模型(为空时默认老模型):
+     * oldMode:老模型
+     * newMode:新模型
+     */
+    private String thDdType;
+
     /**
      * 生产工序集合
      */