姚云青 3 лет назад
Родитель
Сommit
69caf40f3e

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

@@ -2,17 +2,10 @@ package com.github.zuihou.business.mq;
 
 import cn.hutool.core.collection.CollectionUtil;
 import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
-import com.github.zuihou.base.R;
 import com.github.zuihou.business.DemoLine.DemoCacheKey;
 import com.github.zuihou.business.DemoLine.DemoLineConstant;
 import com.github.zuihou.business.DemoLine.YunjianConstant;
-import com.github.zuihou.business.dispatchRecord.entity.DispatchException;
-import com.github.zuihou.business.dispatchRecord.entity.DispatchRecord;
-import com.github.zuihou.business.dispatchRecord.service.DispatchExceptionService;
-import com.github.zuihou.business.dispatchRecord.service.DispatchRecordService;
 import com.github.zuihou.business.edgeLibrary.dao.StockInfoMapper;
-import com.github.zuihou.business.edgeLibrary.dao.StorgeMapper;
 import com.github.zuihou.business.edgeLibrary.entity.StockInfo;
 import com.github.zuihou.business.edgeLibrary.entity.Storge;
 import com.github.zuihou.business.edgeLibrary.service.StorgeService;
@@ -28,13 +21,14 @@ import com.github.zuihou.business.operationManagementCenter.service.TaskNodeServ
 import com.github.zuihou.business.operationManagementCenter.service.WorkpieceService;
 import com.github.zuihou.business.productionReadyCenter.dao.AAutoNodeLogMapper;
 import com.github.zuihou.business.productionReadyCenter.dao.BBomMapper;
-import com.github.zuihou.business.productionReadyCenter.dao.BomProcedureMapper;
-import com.github.zuihou.business.productionReadyCenter.dao.BomProcedureTrayMapper;
-import com.github.zuihou.business.productionReadyCenter.entity.*;
+import com.github.zuihou.business.productionReadyCenter.entity.AAutoNodeLog;
+import com.github.zuihou.business.productionReadyCenter.entity.BBom;
 import com.github.zuihou.business.productionReadyCenter.service.AAutoNodeLogService;
 import com.github.zuihou.business.productionReadyCenter.service.BomProcedureProductionresourceService;
-import com.github.zuihou.business.productionReadyCenter.service.BomProcedureVersionService;
-import com.github.zuihou.business.productionResourceCenter.dao.*;
+import com.github.zuihou.business.productionResourceCenter.dao.ProductionresourceBizMapper;
+import com.github.zuihou.business.productionResourceCenter.dao.ProductionresourcePositionMapper;
+import com.github.zuihou.business.productionResourceCenter.dao.ResourceAutoCodeMapper;
+import com.github.zuihou.business.productionResourceCenter.dao.ZZoneProductionresourceMapper;
 import com.github.zuihou.business.productionResourceCenter.entity.*;
 import com.github.zuihou.business.productionResourceCenter.service.*;
 import com.github.zuihou.business.productionResourceCenter.service.impl.AGVNodeServiceImpl;
@@ -46,19 +40,15 @@ import com.github.zuihou.common.constant.BizConstant;
 import com.github.zuihou.common.constant.CacheKey;
 import com.github.zuihou.common.constant.DictionaryKey;
 import com.github.zuihou.common.constant.UrlConfConstant;
-import com.github.zuihou.common.enums.HandModeTypeEnum;
 import com.github.zuihou.common.util.StringUtil;
 import com.github.zuihou.context.BaseContextHandler;
 import com.github.zuihou.database.mybatis.conditions.Wraps;
 import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
-import com.github.zuihou.database.mybatis.conditions.query.QueryWrap;
 import com.github.zuihou.exception.BizException;
-import com.github.zuihou.msgs.service.MsgsCenterInfoService;
 import com.github.zuihou.tenant.entity.Module;
 import com.github.zuihou.tenant.entity.ModuleInstruction;
 import com.github.zuihou.tenant.service.ModuleInstructionService;
 import com.github.zuihou.tenant.service.ModuleService;
-import com.github.zuihou.tenant.service.ProductionresourceService;
 import com.google.common.collect.Maps;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -73,9 +63,6 @@ import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.concurrent.CompletableFuture;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
@@ -473,7 +460,7 @@ public class TaskWorkNode {
         //判断节点设备类型
         ResourceAutoCode resourceAutoCode = taskNode.getAutoNode();
         String category = resourceAutoCode.getCategory();
-        String robotType = resourceAutoCode.getResourceId().toString();
+//        String robotType = resourceAutoCode.getResourceId().toString();
 
         //获取节点指令集
         Module module  = getModuleInfo(task.getResourceId().toString());
@@ -498,7 +485,7 @@ public class TaskWorkNode {
         } else if ("3".equals(category)) {
             //默认示范线设备
             //map.put("robotType", DictionaryKey.LINE_ROBOT_NODES.get(robotType));
-            map.put("robotType", DictionaryKey.YJ_ROBOT_NODES.get(robotType));
+//            map.put("robotType", DictionaryKey.YJ_ROBOT_NODES.get(robotType));
             nodeOperationService = MsgUtil.getBean(RobotNodeServiceImpl.class);
         } else if("4".equals(category)) {
             nodeOperationService  = MsgUtil.getBean(OtherNodeServiceImpl.class);

+ 1 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/TaskNodeServiceImpl.java

@@ -1255,7 +1255,7 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
                 nextTaskNode = taskNodeList.get(n - 1);
             }
         } else {//取前面
-            List<TaskNode> taskNodeList = baseMapper.selectList(Wraps.<TaskNode>lbQ().eq(TaskNode::getCompleteBatchNo, taskNode.getCompleteBatchNo()).orderByAsc(TaskNode::getCompleteBatchSort).lt(TaskNode::getCompleteBatchSort, taskNode.getCompleteBatchSort()));
+            List<TaskNode> taskNodeList = baseMapper.selectList(Wraps.<TaskNode>lbQ().eq(TaskNode::getCompleteBatchNo, taskNode.getCompleteBatchNo()).orderByDesc(TaskNode::getCompleteBatchSort).lt(TaskNode::getCompleteBatchSort, taskNode.getCompleteBatchSort()));
             if (CollectionUtil.isNotEmpty(taskNodeList)) {
                 nextTaskNode = taskNodeList.get(-n - 1);
             }

+ 5 - 3
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/WorkpieceServiceImpl.java

@@ -505,9 +505,11 @@ public class WorkpieceServiceImpl extends SuperServiceImpl<WorkpieceMapper, TWor
         List<TWorkpiece>list = baseMapper.selectList(Wraps.<TWorkpiece>lbQ().eq(TWorkpiece::getCompleteBatchNo,completeBatchNo));
         if(CollectionUtil.isNotEmpty(list)){
             TWorkpiece tWorkpiece = list.get(0);
-            Storge storge = storgeMapper.selectById(currStorgeId);
-            tWorkpiece.setStorgeId(Long.parseLong(currStorgeId));
-            tWorkpiece.setPointId(storge.getPointId());
+            if(StringUtil.isNotEmpty(currStorgeId)){
+                Storge storge = storgeMapper.selectById(currStorgeId);
+                tWorkpiece.setStorgeId(Long.parseLong(currStorgeId));
+                tWorkpiece.setPointId(storge.getPointId());
+            }
 
             if(StringUtil.isNotEmpty(parentStorgeId)){
                 Storge pstorge = storgeMapper.selectById(parentStorgeId);

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

@@ -146,8 +146,8 @@ public class MachineNodeServiceImpl implements NodeOperationService {
 //        //具体的搬运类型
 //        String carryType = dataMap.get("carryType") == null ? "" : dataMap.get("carryType").toString();
 //
-//        map.put("taskNode", taskNode);
-//        map.put("task", task);
+        map.put("taskNode", taskNode);
+        map.put("task", task);
 //        map.put("bizType", bizType);
 //
 //        String moduleName = dataMap.get("moduleName").toString();
@@ -169,23 +169,23 @@ public class MachineNodeServiceImpl implements NodeOperationService {
             return map;
         }
 
-        ProductionresourcePosition productionresourcePosition = this.logical(deviceList, true);
-        boolean bool =  productionresourcePosition!=null ? true : false;
-        if(!bool){
-            map.put("result", false);
-            return map;
-        }
+//        ProductionresourcePosition productionresourcePosition = this.logical(deviceList, true);
+//        boolean bool =  productionresourcePosition!=null ? true : false;
+//        if(!bool){
+//            map.put("result", false);
+//            return map;
+//        }
         // 设备占用 当前节点锁定线边库
-        boolean isXbk = map.get("useXbk") == null ? false : true;
-        if(isXbk){
-            //获取锁定线边库的库位信息
-            Storge storge = storgeService.getById(productionresourcePosition.getStorgeId());
-            //锁定当前节点与线边库库位
-            storgeService.lockStorge(storge, taskNode.getId());
-            //更新零件节点的库位信息————workpiece
-            map.put("result", false);
-            return map;
-        }
+//        boolean isXbk = map.get("useXbk") == null ? false : true;
+//        if(isXbk){
+//            //获取锁定线边库的库位信息
+//            Storge storge = storgeService.getById(productionresourcePosition.getStorgeId());
+//            //锁定当前节点与线边库库位
+//            storgeService.lockStorge(storge, taskNode.getId());
+//            //更新零件节点的库位信息————workpiece
+//            map.put("result", false);
+//            return map;
+//        }
 
         //获取设备指令集合
         List<ModuleInstruction> moduleInstructions = (List<ModuleInstruction>)dataMap.get("instructions");