Browse Source

排程优化-退火合并优化

fangpy 8 tháng trước cách đây
mục cha
commit
a6a8c6c00d

+ 5 - 0
rw-aps-server/src/main/java/com/rongwei/rwapsserver/aps/domain/ProduceOrder.java

@@ -34,6 +34,11 @@ public class ProduceOrder implements Serializable {
      */
     private String orderNo;
 
+    /**
+     * 客户订单ID
+     */
+    private String customerOrderId;
+
     /**
      * 交货日期
      */

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

@@ -675,7 +675,7 @@ public class ApsConstraintProvider implements ConstraintProvider {
             pp.setLastSerialLbWeight(equipment.getLastSerialLbWeight());
             hasStartTimeProcess.add(0,pp);
         }
-        if(hasStartTimeProcess.get(hasStartTimeProcess.size()-1).getId() != null && equipment.getId().equals("0001be252874536843730b100051")){
+        if(equipment.getId().equals("0001be252874536843730b100052")){
             int aa = 2;
         }
         // 周期立板已连续生产吨数

+ 24 - 16
rw-aps-server/src/main/java/com/rongwei/rwapsserver/aps/service/impl/ApsServiceImpl.java

@@ -1942,7 +1942,7 @@ public class ApsServiceImpl implements ApsService {
             List<ProductionProcesses> otherThproces = new ArrayList<>();
             // 铸轧提前排序
             int processNum1 = apsSolutionZz.getProcessesList().size();
-            int runPlanSeconds1 = (processNum1)*60;
+            int runPlanSeconds1 = (processNum1)*120;
             // CPU核数
             String cores = Runtime.getRuntime().availableProcessors() + "";
             SolverFactory<ApsSolution> solverFactory1 = SolverFactory.create(new SolverConfig()
@@ -1986,6 +1986,9 @@ public class ApsServiceImpl implements ApsService {
                 // 重量
                 BigDecimal singlerollweight1 = v1.getSinglerollweight();
                 BigDecimal singlerollweight2 = v2.getSinglerollweight();
+                // 客户订单ID
+                String customerOrderId1 = v1.getProduceOrder().get(0).getCustomerOrderId();
+                String customerOrderId2 = v2.getProduceOrder().get(0).getCustomerOrderId();
 
                 int a = 0;
                 // 合金
@@ -1994,27 +1997,32 @@ public class ApsServiceImpl implements ApsService {
                     if(producttype1 == null || producttype2 == null || producttype1.compareTo(producttype2) == 0){
                         // 宽度
                         if(prowidth1.compareTo(prowidth2) == 0){
-                            // 厚度
-                            if(thickness1.compareTo(thickness2) == 0){
-                                // 合金状态
-                                if(alloystatus1 == null || alloystatus2 == null || alloystatus1.compareTo(alloystatus2) == 0){
-                                    // 重量
-                                    if(singlerollweight1.compareTo(singlerollweight2) == 0){
-                                        a = 0;
-                                    }else if(singlerollweight1.compareTo(singlerollweight2) > 0){
+                            // 按照订单排序
+                            if(customerOrderId1.compareTo(customerOrderId2) == 0){
+                                // 厚度
+                                if(thickness1.compareTo(thickness2) == 0){
+                                    // 合金状态
+                                    if(alloystatus1 == null || alloystatus2 == null || alloystatus1.compareTo(alloystatus2) == 0){
+                                        // 重量
+                                        if(singlerollweight1.compareTo(singlerollweight2) == 0){
+                                            a = 0;
+                                        }else if(singlerollweight1.compareTo(singlerollweight2) > 0){
+                                            a = -1;
+                                        }else{
+                                            a = 1;
+                                        }
+                                    }else{
+                                        a = alloystatus1.compareTo(alloystatus2);
+                                    }
+                                }else{
+                                    if(thickness1.compareTo(thickness2) > 0){
                                         a = -1;
                                     }else{
                                         a = 1;
                                     }
-                                }else{
-                                    a = alloystatus1.compareTo(alloystatus2);
                                 }
                             }else{
-                                if(thickness1.compareTo(thickness2) > 0){
-                                    a = -1;
-                                }else{
-                                    a = 1;
-                                }
+                                a = customerOrderId1.compareTo(customerOrderId2);
                             }
                         }else{
                             if(prowidth1.compareTo(prowidth2) > 0){