Parcourir la source

后台优先级功能处理和调整

oyq28 il y a 1 semaine
Parent
commit
d4d3c807b5

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

@@ -1299,7 +1299,7 @@ public class TaskWorkNode {
                 dataMap.put("data", locationMap);
 
                 String uploadInfo = msgUtil.redis_get(DemoLineConstant.DEMOLINE_HEIDENHAIN_FILE_URL+"_"+task.getId())!=null? msgUtil.redis_get(DemoLineConstant.DEMOLINE_HEIDENHAIN_FILE_URL+"_"+task.getId()).toString(): null;
-                Productionresource productionresource =  productionresourceBizMapper.selectOne(Wraps.<Productionresource>lbQ().eq(Productionresource::getId,taskNode.getTargetResourceId()));
+                Productionresource productionresource =  productionresourceBizMapper.selectOne(Wraps.<Productionresource>lbQ().eq(Productionresource::getId,task.getResourceId()));
                 TTask tTask = taskMapper.selectById(taskNode.getTaskId());
                 Order currentOrder = orderMapper.selectById(tTask.getOrderId());
                 if(StringUtils.isNotEmpty(uploadInfo)){

+ 9 - 9
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/impl/RobotNodeServiceImpl.java

@@ -808,7 +808,7 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                                     log.info("jrqHcwPartPoint={}", jrqHcwPartPoint);
                                 if(jqrHcwStorgeTaskNodeResource.getPointId().equals(jrqHcwPartPoint)){
                                     hasJqrhcwPartFlag = true;
-                                    msgUtil.redis_set(DemoLineConstant.JQR_HCW_PART_PRIOTY_EXEC_FLAG + jqrHcwStorgeTaskNodeId,"1");
+                                    msgUtil.redis_set(DemoLineConstant.JQR_HCW_PART_PRIOTY_EXEC_FLAG + jqrHcwStorgeTaskNodeId,"1", 3, TimeUnit.DAYS);
                                     break;
                                 }
                             }
@@ -842,18 +842,18 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                         Storge hcwStorge = (Storge)msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_HCW + taskNode.getId());
 
                         String uploadInfo = msgUtil.redis_get(DemoLineConstant.DEMOLINE_HEIDENHAIN_FILE_URL+"_"+task.getId())!=null? msgUtil.redis_get(DemoLineConstant.DEMOLINE_HEIDENHAIN_FILE_URL+"_"+task.getId()).toString(): null;
-                        Productionresource productionresource =  productionresourceBizMapper.selectOne(Wraps.<Productionresource>lbQ().eq(Productionresource::getId,taskNode.getTargetResourceId()));
+                        Productionresource productionresource =  productionresourceBizMapper.selectOne(Wraps.<Productionresource>lbQ().eq(Productionresource::getId,task.getResourceId()));
                         if(StringUtils.isNotEmpty(uploadInfo)){
                             JSONObject jsonObject  = JSONObject.parseObject(uploadInfo);
                             //异步发送哈默预处理编号
                             boolean bool = this.asyncPost(jsonObject);
-                        }else if(currentOrder.getSingleTaskFlag().equals("1") && productionresource.getModeSpecification().equals("HEIDENHAIN")){
-                            JSONObject jsonObject = new JSONObject();
-                            jsonObject.put("url", productionresource.getIp());
-                            jsonObject.put("port", productionresource.getPort());
-                            String defaultFileName = this.storagePath+"/common/2.h";
-                            jsonObject.put("fileName", defaultFileName.replace("/", "\\"));
-                            boolean bool = this.asyncPost(jsonObject);
+                        }else if(currentOrder.getSingleTaskFlag().equals("1") && productionresource.getModeSpecification().equals("HEIDENHAIN") ){
+                                JSONObject jsonObject = new JSONObject();
+                                jsonObject.put("url", productionresource.getIp());
+                                jsonObject.put("port", productionresource.getPort());
+                                String defaultFileName = this.storagePath + "/common/2.h";
+                                jsonObject.put("fileName", defaultFileName.replace("/", "\\"));
+                                boolean bool = this.asyncPost(jsonObject);
                         }
 
                         Map locationMap = new HashMap();

+ 8 - 8
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/util/MsgUtil.java

@@ -638,13 +638,13 @@ public class MsgUtil implements ApplicationContextAware {
         if(StringUtil.isNotEmpty(taskNodeId) && null!=zZone){
             String symbol="";
             switch(zZone.getNo()){
-                case "capsule": symbol = "CT"; break;
-                case "framework": symbol = "KT"; break;
-                case "cabin": symbol = "ZC"; break;
-                case "wing": symbol = "YP"; break;
-                default: symbol = "bz";
+                case "capsule": symbol = "CT_jqr"; break;
+                case "framework": symbol = "KT_jqr"; break;
+                case "cabin": symbol = "ZC_jqr"; break;
+                case "wing": symbol = "YP_jqr"; break;
+                default: symbol = "BZ_371";
             }
-            Productionresource productionresource = productionresourceBizMapper.selectOne(new LbqWrapper<Productionresource>().eq(Productionresource::getCode, symbol+"_jqr").last("limit 1"));
+            Productionresource productionresource = productionresourceBizMapper.selectOne(new LbqWrapper<Productionresource>().eq(Productionresource::getCode, symbol).last("limit 1"));
             if(productionresource!=null) {
                 String consumerQueue = "device.queue." + productionresource.getId();
                 String key = "PRIORITY_" + consumerQueue.toUpperCase().replace(".", "_");
@@ -677,8 +677,8 @@ public class MsgUtil implements ApplicationContextAware {
             if(feedFirst){
                 priorityVal = isJbw? 3:(isMachine? 2: (isCleanMachine? 1: 0));
             }else{
-                //下料接驳位取优先,清洗机放,然后机床
-                priorityVal = isJbw? 3:(isCleanMachine? 2: (isMachine? 1: 0));
+                //下料机床取优先,接驳位取,然后清洗机
+                priorityVal = isJbw? 2:(isCleanMachine? 1: (isMachine? 3: 0));
             }
             logger.warn("进入优先级判断:taskNodId:{},isJbw:{},isMachine:{},isCleanMachine:{},上料优先:{},优先级数:{}",taskNode.getId(), isJbw, isMachine, isCleanMachine, feedFirst, priorityVal);
             jsonObject.put("taskNodeId",nextNode.getId().toString());