Przeglądaj źródła

排程模式配置

fangpy 6 miesięcy temu
rodzic
commit
b4513b7f51

+ 9 - 0
rw-aps-server/src/main/java/com/rongwei/rwapsserver/aps/domain/ApsOverallConfig.java

@@ -1,6 +1,7 @@
 package com.rongwei.rwapsserver.aps.domain;
 
 import com.fasterxml.jackson.annotation.JsonFormat;
+import com.rongwei.rwapsserver.aps.vo.ApsTypeVo;
 import lombok.Data;
 
 import java.io.Serializable;
@@ -88,4 +89,12 @@ public class ApsOverallConfig implements Serializable {
      */
     private BigDecimal midweightdifference;
 
+    /**
+     * 排程模式:
+     * default:分批排程(默认排程)
+     * mix:混合排程
+     * mixNotThMerge: 混合排程不提前合并退火
+     */
+    private ApsTypeVo scheduleType;
+
 }

+ 4 - 4
rw-aps-server/src/main/java/com/rongwei/rwapsserver/aps/domain/ProductionProcesses.java

@@ -453,15 +453,15 @@ public class ProductionProcesses implements Serializable {
         Integer maxDelay = 1;
         if(!this.ifLock){
             if(this.processType.equals("成退") || this.processType.equals("中退") || this.processType.equals("小卷成退")){
-                maxDelay = 300;
+                maxDelay = 100;
             }else if(this.processType.equals("铸轧")){
                 maxDelay = 5000;
             } else if (this.processType.equals("冷轧")) {
-                maxDelay = 2000;
+                maxDelay = 1000;
             }else if (this.processType.equals("箔轧")) {
-                maxDelay = 5000;
-            } else{
                 maxDelay = 1000;
+            } else{
+                maxDelay = 500;
             }
         }
         return ValueRangeFactory.createIntValueRange(0, maxDelay);

+ 13 - 3
rw-aps-server/src/main/java/com/rongwei/rwapsserver/aps/score/ApsConstraintProvider.java

@@ -4,6 +4,7 @@ import cn.hutool.core.date.DateUnit;
 import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.util.StrUtil;
 import com.rongwei.rwapsserver.aps.domain.*;
+import com.rongwei.rwapsserver.aps.vo.ApsTypeVo;
 import org.optaplanner.core.api.score.buildin.hardmediumsoft.HardMediumSoftScore;
 import org.optaplanner.core.api.score.buildin.hardsoft.HardSoftScore;
 import org.optaplanner.core.api.score.stream.*;
@@ -2756,7 +2757,12 @@ public class ApsConstraintProvider implements ConstraintProvider {
                             ppMap.remove(hasMergeOldKey);
                         }
                     }
-                    return ppMap.size()*1000;
+                    int qz = 1;
+                    ApsTypeVo scheduleType = processes.get(0).getApsOverallConfig().getScheduleType();
+                    if(scheduleType == null || scheduleType.getConstraintMode() == null || "th".equals(scheduleType.getConstraintMode())){
+                        qz = 1000;
+                    }
+                    return ppMap.size()*qz;
                 })
                 .asConstraint("mergeTuihuo");
     }
@@ -2813,8 +2819,12 @@ public class ApsConstraintProvider implements ConstraintProvider {
                             }
                         }
                     }
-
-                    return b*1000;
+                    int qz = 1;
+                    ApsTypeVo scheduleType = processes.get(0).getApsOverallConfig().getScheduleType();
+                    if(scheduleType == null || scheduleType.getConstraintMode() == null || "th".equals(scheduleType.getConstraintMode())){
+                        qz = 1000;
+                    }
+                    return b*qz;
                 })
                 .asConstraint("tuihuoSp");
     }

+ 7 - 3
rw-aps-server/src/main/java/com/rongwei/rwapsserver/aps/service/impl/ProductionScheduleServiceImpl.java

@@ -164,8 +164,11 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
 
         // 退火提前排序
         Map<String,List<String>> ordergrous = new HashMap<>();
-        apsService.tuihuoApsSch(apsSolution,otherThproces,otherNotZzFirstProces,productionScheduleVo,ordergrous);
-        log.info("退火提前合并排程结束,合并订单列表:"+JSONUtil.toJsonStr(ordergrous));
+        if(productionScheduleVo.getScheduleType() == null || productionScheduleVo.getScheduleType().getThMergeMode() == null
+            || !"notThMergeBf".equals(productionScheduleVo.getScheduleType().getThMergeMode())){
+            apsService.tuihuoApsSch(apsSolution,otherThproces,otherNotZzFirstProces,productionScheduleVo,ordergrous);
+            log.info("退火提前合并排程结束,合并订单列表:"+JSONUtil.toJsonStr(ordergrous));
+        }
         /*if(1 == 1){
             return null;
         }*/
@@ -191,7 +194,7 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
         // 异常坯料计划ID
         List<String> exOrderIds = new ArrayList<>();
         // 混合排程
-        if("2".equals(productionScheduleVo.getScheduleType())){
+        if(productionScheduleVo.getScheduleType() != null && "mix".equals(productionScheduleVo.getScheduleType().getMixIf())){
             // optaplanner 求解器配置实例化
             SolverFactory<ApsSolution> solverFactory = SolverFactory.create(new SolverConfig()
                     .withEnvironmentMode(mode)
@@ -1293,6 +1296,7 @@ public class ProductionScheduleServiceImpl implements ProductionScheduleService
             process.getApsOverallConfig().setFurnacedifference(productionScheduleVo.getFurnacedifference());
             process.getApsOverallConfig().setWeightdifference(productionScheduleVo.getWeightdifference());
             process.getApsOverallConfig().setMidweightdifference(productionScheduleVo.getMidweightdifference());
+            process.getApsOverallConfig().setScheduleType(productionScheduleVo.getScheduleType());
 
             if(StrUtil.isBlank(process.getTaskType())){
                 process.setTaskType("processes");

+ 29 - 0
rw-aps-server/src/main/java/com/rongwei/rwapsserver/aps/vo/ApsTypeVo.java

@@ -0,0 +1,29 @@
+package com.rongwei.rwapsserver.aps.vo;
+
+import lombok.Data;
+
+@Data
+public class ApsTypeVo {
+
+    /**
+     * 是否混排:
+     * default:分批排程(默认排程)
+     * mix:混合排程
+     */
+    private String mixIf;
+
+    /**
+     * 是否退火提前合并:
+     * thMergeBf:退火提前合并
+     * notThMergeBf:退火不提前合并
+     */
+    private String thMergeMode;
+
+    /**
+     * 约束优先级:
+     * lz:冷轧优先
+     * th:退火优先
+     */
+    private String constraintMode;
+
+}

+ 2 - 1
rw-aps-server/src/main/java/com/rongwei/rwapsserver/aps/vo/ProductionScheduleVo.java

@@ -29,8 +29,9 @@ public class ProductionScheduleVo {
      * 排程模式:
      * default:分批排程(默认排程)
      * mix:混合排程
+     * mixNotThMerge: 混合排程不提前合并退火
      */
-    private String scheduleType;
+    private ApsTypeVo scheduleType;
 
     /**
      * 生产工序集合