Просмотр исходного кода

fix:任务报工执行优化

wang.sq@aliyun.com 15 часов назад
Родитель
Сommit
bae0fad7e6

+ 1 - 0
imcs-admin-boot/imcs-authority-server/src/main/resources/bootstrap.yml

@@ -11,6 +11,7 @@ logging:
   file:
     path: /data/projects/logs
     name: ${logging.file.path}/${spring.application.name}/root.log
+    max-size: 10MB          # 单个日志文件的最大大小,超过会创建新文件
 
 machine:
   #  ip: 192.168.170.32

+ 1 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/mq/TaskWorkNode.java

@@ -792,7 +792,7 @@ public class TaskWorkNode {
                 // 释放占用资源并在autolog表中增加日志,方便指令重发
                 JSONObject errJsonObject = new JSONObject();
                 errJsonObject.put("code", "exception");
-                errJsonObject.put("msg", e.getMessage());
+                errJsonObject.put("msg", e.getMessage()==null?e:e.getMessage());
                 errJsonObject.put("result", "false");
                 returnData = errJsonObject.toJSONString();
                 //插入执行日志

+ 16 - 6
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/strategy/impl/CacheRobotStrategy.java

@@ -151,6 +151,9 @@ public class CacheRobotStrategy implements RobotStrategy {
         List<ProductionresourcePosition> xbkList = productionresourcePositionService.getFreeProductionresourcePositionByNos(DictionaryKey.YJ_ZONE_XBK.get(zoneName).split(","));
         //处理目标库位
         returnMap = this.robotTarget(taskNode, robotInfo, xbkList, bomProcedure,returnMap);
+        if(returnMap.containsKey("result") && "false".equalsIgnoreCase(returnMap.get("result").toString())){
+            return returnMap;
+        }
 
         Storge targetStorge = !returnMap.containsKey("store") ? null : (Storge) returnMap.get("store");
         Long targetStorgeResourceId = !returnMap.containsKey("storeResourceId") ? null : Long.valueOf(returnMap.get("storeResourceId").toString());
@@ -395,6 +398,9 @@ public class CacheRobotStrategy implements RobotStrategy {
         List<ProductionresourcePosition> xbkList = productionresourcePositionService.getFreeProductionresourcePositionByNos(DictionaryKey.YJ_ZONE_XBK.get(zoneName).split(","));
 
         Map returnMap = this.robotTarget(taskNode, robotInfo, xbkList, bomProcedure, dataMap);
+        if(returnMap.containsKey("result") && "false".equalsIgnoreCase(returnMap.get("result").toString())){
+            return returnMap;
+        }
         //线边库处理
         Storge startStore = workpieceService.getWorkPieceStock(taskNode.getCompleteBatchNo(), false);
         Storge targetStorge = !returnMap.containsKey("store") ? null : (Storge) returnMap.get("store");
@@ -548,12 +554,16 @@ public class CacheRobotStrategy implements RobotStrategy {
         }
 
         if ("1".equals(xbkFlag)) {
-
-            ProductionresourcePosition position = xbkList.get(0);
-            targetStorge = storgeService.getById(position.getStorgeId());
-            returnMap.put("storeResourceId", position.getResourceId());
-            returnMap.put("store", targetStorge);
-            returnMap.put("targetxbk", "1");
+            if(xbkList.isEmpty()){
+                returnMap.put("result", false);
+                returnMap.put("resultMsg", returnMap.containsKey("resultMsg")?returnMap.get("resultMsg"):"线边库查询不到可以用库位");
+            }else {
+                ProductionresourcePosition position = xbkList.get(0);
+                targetStorge = storgeService.getById(position.getStorgeId());
+                returnMap.put("storeResourceId", position.getResourceId());
+                returnMap.put("store", targetStorge);
+                returnMap.put("targetxbk", "1");
+            }
         }
 
         return returnMap;

+ 1 - 3
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/operationManagementCenter/OrderMapper.xml

@@ -214,9 +214,7 @@
                 FROM
                     imcs_t_task t
                         LEFT JOIN imcs_tenant_productionresource p ON t.resource_id = p.id
-                        LEFT JOIN imcs_z_zone z ON Locate(
-                            z.abbreviate,LEFT (p.name, 5)
-		                )
+                        LEFT JOIN imcs_z_zone z ON  p.zone_id = z.id
                 WHERE
                     t.start_time IS NOT NULL
                   AND (

+ 1 - 0
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/productionResourceCenter/ToolController.java

@@ -151,6 +151,7 @@ public class ToolController extends SuperController<ToolService, Long, Tool, Too
 //    @Scheduled(cron = "0 0/2 * * * *")
     @ApiOperation(value = "同步刀具", notes = "同步刀具")
     @PostMapping("/synchronousTool")
+    @Deprecated
     public R<Boolean> synchronousTool() throws Exception {
         long l = System.currentTimeMillis();
         log.info("===============同步机床刀具=============时间组{}",l);

+ 4 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionResourceCenter/entity/Productionresource.java

@@ -277,6 +277,10 @@ public class Productionresource extends Entity<Long> {
     @Excel(name = "hand_type")
     private String handType;
 
+    @ApiModelProperty(value = "产线id")
+    @Excel(name = "zone_id")
+    private String zoneId;
+
 
     @ApiModelProperty(value = "产线名称")
     @TableField(exist=false)

+ 2 - 2
imcs-admin-boot/imcs-jobs/imcs-jobs-server/src/main/resources/application-dev.yml

@@ -1,9 +1,9 @@
 zuihou:
   mysql:
-    ip: ${MYSQL_IP:117.78.49.203}
+    ip: ${MYSQL_IP:127.0.0.1}
     port: 3306
     username: root
-    password: LomdtE@ShiTong2021
+    password: 123456
 
 xxl.job:
   executor:

+ 4 - 4
imcs-admin-boot/imcs-jobs/imcs-jobs-server/src/main/resources/application.yml

@@ -1,17 +1,17 @@
 zuihou:
   mysql:
-    ip: ${MYSQL_IP:117.78.49.203}
+    ip: ${MYSQL_IP:127.0.0.1}
     port: 3306
     username: root
-    password: LomdtE@ShiTong2021
+    password: 123456
     database: zuihou_defaults_yj
     driverClassName: com.mysql.cj.jdbc.Driver
     url: jdbc:mysql://${zuihou.mysql.ip}:${zuihou.mysql.port}/${zuihou.mysql.database}?serverTimezone=CTT&characterEncoding=utf8&useUnicode=true&useSSL=false&autoReconnect=true&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
   redis:
-    ip: 127.0.0.1
+    ip: 192.168.50.111
     port: 6379
+    password: 123456
     database: 0
-    password:
   database:
     multiTenantType: SCHEMA
     tenantDatabasePrefix: imcs_base_331