fangpy 9 месяцев назад
Родитель
Сommit
f2fc6ba54b

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

@@ -132,11 +132,11 @@ public class ApsServiceImpl implements ApsService {
                     }
                     apsBlankOrders.addAll(fbNotLock);
                 }
-//                apsOrderScheduleNew(apsBlankOrders,currentUser);
-                apsOrderSchedule(apsBlankOrders);
+                apsOrderScheduleNew(apsBlankOrders,currentUser);
+//                apsOrderSchedule(apsBlankOrders);
             } catch (Exception e) {
                 e.printStackTrace();
-                logger.info("排程异常" + e);
+                logger.info("排程异常",e);
                 String msg = "排程服务异常";
                 if(e instanceof CustomException){
                     msg = e.getMessage();
@@ -321,8 +321,16 @@ public class ApsServiceImpl implements ApsService {
                     apsOrderScheduleApsNew(v);
                 }catch (Exception e) {
                     e.printStackTrace();
-                    logger.info("排程异常" + e);
-                    String msg = "排程服务异常";
+                    logger.info("排程异常",e);
+                    String blankNos = "";
+                    for (ApsBlankOrderVo apsBlankOrderVo : v) {
+                        if("".equals(blankNos)){
+                            blankNos = apsBlankOrderVo.getBlanknumber();
+                        }else{
+                            blankNos = blankNos+";"+apsBlankOrderVo.getBlanknumber();
+                        }
+                    }
+                    String msg = "排程服务异常(坯料计划号:"+blankNos+")";
                     if(e instanceof CustomException){
                         msg = e.getMessage();
                     }
@@ -417,6 +425,8 @@ public class ApsServiceImpl implements ApsService {
         apsBlankOrders.forEach((bo)->{
             blankOrderIds.add(bo.getId());
         });
+        System.out.println("当前批次排程坯料计划ID:" + blankOrderIds);
+        logger.info("当前批次排程坯料计划ID:" + blankOrderIds);
         // 更新待排程的锁定的作业
         if(blankOrderIds != null && blankOrderIds.size()>0){
             String blankidStrs = CollUtil.join(blankOrderIds, "','");
@@ -447,26 +457,32 @@ public class ApsServiceImpl implements ApsService {
         List<ProductionScheduleVo> apsProductionSchedules = new ArrayList<>();
         // 多卷先排
         apsBlankOrders.forEach((bo)->{
-            List<ApsBlankOrderVo> v = new ArrayList<>();
-            v.add(bo);
-            dataMapOrder.put(bo.getId(),bo);
+            try{
+                List<ApsBlankOrderVo> v = new ArrayList<>();
+                v.add(bo);
+                dataMapOrder.put(bo.getId(),bo);
 
-            // 模型转换
-            ProductionScheduleVo productionScheduleVo = apsProductionScheduleInit(v);
-            productionScheduleVos.add(productionScheduleVo);
-            dataMap.put(productionScheduleVo.getProductionScheduleId(),v);
+                // 模型转换
+                ProductionScheduleVo productionScheduleVo = apsProductionScheduleInit(v);
+                productionScheduleVos.add(productionScheduleVo);
+                dataMap.put(productionScheduleVo.getProductionScheduleId(),v);
 //                        int mergeThNum = mergeThNum(bo, productionScheduleVo);
-            // 排程计划设备集合
-            List<Equipment> equipmentList1 = new ArrayList<>();
-            List<ApsProcessOperationDo> operationDos1 = apsProcessOperationService.list(new LambdaQueryWrapper<ApsProcessOperationDo>()
-                    .in(ApsProcessOperationDo::getBlankid, bo.getId()));
-            List<String> blankids = new ArrayList<>();
-            blankids.add(bo.getId());
-            for (ApsProcessOperationDo operationDo : operationDos1) {
-                List<String> optionalEquipments = equipmentListInit(operationDo,equipmentList1,eqMaps,blankids,null,productionScheduleVo,apsConfigs.get(0));
+                // 排程计划设备集合
+                List<Equipment> equipmentList1 = new ArrayList<>();
+                List<ApsProcessOperationDo> operationDos1 = apsProcessOperationService.list(new LambdaQueryWrapper<ApsProcessOperationDo>()
+                        .in(ApsProcessOperationDo::getBlankid, bo.getId()));
+                List<String> blankids = new ArrayList<>();
+                blankids.add(bo.getId());
+                for (ApsProcessOperationDo operationDo : operationDos1) {
+                    List<String> optionalEquipments = equipmentListInit(operationDo,equipmentList1,eqMaps,blankids,null,productionScheduleVo,apsConfigs.get(0));
+                }
+                productionScheduleVo.setEquipmentList(equipmentList1);
+                apsProductionSchedules.add(productionScheduleVo);
+            }catch(Exception e){
+                logger.info("坯料计划:+bo.getBlanknumber() + ;排程数据初始化异常",e);
+                String msg = "坯料计划:"+bo.getBlanknumber() + ";排程数据初始化异常";
+                throw new CustomException(msg);
             }
-            productionScheduleVo.setEquipmentList(equipmentList1);
-            apsProductionSchedules.add(productionScheduleVo);
         });
 
         // 多个坯料计划合并排程
@@ -600,8 +616,12 @@ public class ApsServiceImpl implements ApsService {
             if(productionScheduleVo.getStandingyield() == null){
                 productionScheduleVo.setStandingyield(60);
             }
+            // 默认宽差配置
             productionScheduleVo.setMiddifference(apsScheduleConfig.getMiddifference());
             productionScheduleVo.setFurnacedifference(apsScheduleConfig.getFurnacedifference());
+            // 默认卷重差配置
+            productionScheduleVo.setWeightdifference(apsScheduleConfig.getWeightdifference());
+            productionScheduleVo.setMidweightdifference(apsScheduleConfig.getMidweightdifference());
         } else {
             throw new CustomException("排程参数缺失");
         }

+ 3 - 3
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/utils/CodeGeneration.java

@@ -83,7 +83,7 @@ public class CodeGeneration {
         strategy.setSuperEntityClass(BaseDo.class);
         strategy.setRestControllerStyle(true);
         // 设置要映射的表名(重要,需要修改的地方)
-        strategy.setInclude("aps_furnace_installation");
+        strategy.setInclude("aps_schedule_config");
         strategy.setNaming(NamingStrategy.underline_to_camel); // 自动转换表名的驼峰命名法
         strategy.setColumnNaming(NamingStrategy.no_change); // 自动转换列名的驼峰命名法
         strategy.setEntityLombokModel(true); // 是否使用lombox
@@ -127,7 +127,7 @@ public class CodeGeneration {
                 return entityParentPath + tableInfo.getEntityName() + "Do" + StringPool.DOT_JAVA;
             }
         });
-        focList.add(new FileOutConfig("/gentemplates/mapper.java.vm") {
+        /*focList.add(new FileOutConfig("/gentemplates/mapper.java.vm") {
             @Override
             public String outputFile(TableInfo tableInfo) {
                 // 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
@@ -147,7 +147,7 @@ public class CodeGeneration {
                 // 自定义输出文件名 , 如果你 Entity 设置了前后缀、此处注意 xml 的名称会跟着发生变化!!
                 return commonPath + "service\\impl\\" + tableInfo.getEntityName() + "ServiceImpl" + StringPool.DOT_JAVA;
             }
-        });
+        });*/
         cfg.setFileOutConfigList(focList);
 
         autoGenerator.setCfg(cfg);

+ 11 - 1
cx-aps/cx-aps-entity/src/main/java/com/rongwei/bsentity/domain/ApsScheduleConfigDo.java

@@ -17,7 +17,7 @@ import lombok.experimental.Accessors;
  * </p>
  *
  * @author fpy
- * @since 2024-09-18
+ * @since 2024-11-04
  */
 @Data
 @EqualsAndHashCode(callSuper = true)
@@ -162,6 +162,16 @@ public class ApsScheduleConfigDo extends BaseDo {
      */
     @TableField("EXPECTEDDAYS")
     private Integer expecteddays;
+    /**
+     * 中退组炉卷重差(吨)
+     */
+    @TableField("WEIGHTDIFFERENCE")
+    private BigDecimal weightdifference;
+    /**
+     * 成退组炉卷重差(吨)
+     */
+    @TableField("MIDWEIGHTDIFFERENCE")
+    private BigDecimal midweightdifference;
 
 
 }

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

@@ -113,5 +113,13 @@ public class ProductionScheduleVo {
      * 成退组炉宽差,默认:200mm
      */
     private Integer furnacedifference;
+    /**
+     * 中退组炉卷重差(吨)
+     */
+    private BigDecimal weightdifference;
+    /**
+     * 成退组炉卷重差(吨)
+     */
+    private BigDecimal midweightdifference;
 
 }