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

Merge remote-tracking branch 'origin/master' into master

姚云青 3 лет назад
Родитель
Сommit
c96bb09b8d
15 измененных файлов с 184 добавлено и 138 удалено
  1. 6 2
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/mq/TaskWorkNode.java
  2. 2 1
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/dao/OrderProductMapper.java
  3. 1 1
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/OrderProductService.java
  4. 3 2
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/OrderProductServiceImpl.java
  5. 1 0
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/OrderServiceImpl.java
  6. 6 2
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/TaskNodeServiceImpl.java
  7. 111 96
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/WorkpieceServiceImpl.java
  8. 5 12
      imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/operationManagementCenter/OrderProductMapper.xml
  9. 4 2
      imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/operationManagementCenter/OrderQualityMapper.xml
  10. 5 3
      imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/operationManagementCenter/PlanMapper.xml
  11. 2 2
      imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/productionReadyCenter/CuttingToolApplyMapper.xml
  12. 15 6
      imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/operationManagementCenter/InspectionController.java
  13. 8 9
      imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/operationManagementCenter/OrderProductController.java
  14. 7 0
      imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/operationManagementCenter/dto/OrderQualityPageDTO.java
  15. 8 0
      imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/operationManagementCenter/entity/OrderQuality.java

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

@@ -155,6 +155,7 @@ public class TaskWorkNode {
         String taskNodeId = jsonObject.getString("taskNodeId");
         //业务类型-1、是普通的节点类型,2-是线边库轮询
         String bizType = jsonObject.getString("bizType");
+        String handMode = jsonObject.getString("handMode");
 
         //多产品搬运类型
         String carryType = jsonObject.getString("carryType");
@@ -223,6 +224,7 @@ public class TaskWorkNode {
                 Map queryMap = Maps.newHashMap();
                 queryMap.put("bizType", bizType);
                 queryMap.put("carryType", carryType);
+                queryMap.put("handMode", handMode);
                 if (jsonObject.containsKey(taskNode.getId() + "count")) {
                     queryMap.put(taskNode.getId() + "count", jsonObject.getString(taskNode.getId() + "count"));
                 }
@@ -354,10 +356,9 @@ public class TaskWorkNode {
         TTask task = (TTask) conMap.get("task");
         //业务类型
         String bizType = conMap.get("bizType") == null ? "" : conMap.get("bizType").toString();
-
+        String handMode = conMap.get("handMode") == null ? "" : conMap.get("handMode").toString();
         String count = conMap.get(taskNode.getId() + "count") == null ? "" : conMap.get(taskNode.getId() + "count").toString();
 
-
         //出入库类型
         String stockType = conMap.get(DemoLineConstant.DEMOLINE_STOCK_TYPE) == null ? "" : conMap.get(DemoLineConstant.DEMOLINE_STOCK_TYPE).toString();
 
@@ -400,6 +401,7 @@ public class TaskWorkNode {
         bizJsonObject.put("targetPostion", tstorge == null ? "" : tstorge.getId().toString());
         bizJsonObject.put("aimStorge", aimStorge == null ? "" : aimStorge.getId().toString());
         bizJsonObject.put("bizType", bizType);
+        bizJsonObject.put("handMode", handMode);
 
         //放入到线边库
         String xbkFlag = conMap.get(DemoLineConstant.DEMOLINE_XBKFLAG) == null ? "" : conMap.get(DemoLineConstant.DEMOLINE_XBKFLAG).toString();
@@ -536,6 +538,7 @@ public class TaskWorkNode {
         logger.info("=============进入条件检测==============" + taskNode);
         //业务类型(区分正常设备节点和线边库节点)
         String bizType = dataMap.get("bizType") == null ? "" : dataMap.get("bizType").toString();
+        String handMode = dataMap.get("handMode") == null ? "" : dataMap.get("handMode").toString();
         String count = dataMap.get(taskNode.getId() + "count") == null ? "0" : dataMap.get(taskNode.getId() + "count").toString();
 //        //具体的搬运类型
 //        String carryType = dataMap.get("carryType") == null ? "" : dataMap.get("carryType").toString();
@@ -557,6 +560,7 @@ public class TaskWorkNode {
         map.put("task", task);
         map.put(taskNode.getId() + "count", count);
         map.put("bizType", bizType);
+        map.put("handMode", handMode);
         map.put("categoryName", DictionaryKey.RESOURCE_CATEGORY.get(category));
         map.put("instructions", moduleInstructions);
         map.put("moduleName", module.getName());

+ 2 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/dao/OrderProductMapper.java

@@ -7,6 +7,7 @@ import com.github.zuihou.base.mapper.SuperMapper;
 import com.github.zuihou.business.operationManagementCenter.entity.Order;
 import com.github.zuihou.business.operationManagementCenter.entity.OrderProduct;
 
+import com.github.zuihou.database.mybatis.auth.DataScope;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
@@ -26,6 +27,6 @@ public interface OrderProductMapper extends SuperMapper<OrderProduct> {
 
     List<OrderProduct> getList(OrderProduct bean);
 
-    IPage<OrderProduct> pageList(IPage page,@Param("orderNo")String orderNo,@Param("bomName")String bomName,@Param("produceStatus")String produceStatus, @Param(Constants.WRAPPER) Wrapper<OrderProduct> queryWrapper);
+    IPage<OrderProduct> pageList(IPage page, @Param("produceStatus")String produceStatus, @Param(Constants.WRAPPER) Wrapper<OrderProduct> queryWrapper, DataScope dataScope);
 
 }

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

@@ -21,6 +21,6 @@ public interface OrderProductService extends SuperService<OrderProduct> {
 
     List<OrderProduct> getlist(OrderProduct bean);
 
-    IPage<OrderProduct> pageList(IPage page,String orderNo,String bomName,String produceStatus, LbqWrapper<OrderProduct> wrapper);
+    IPage<OrderProduct> pageList(IPage page, String produceStatus, LbqWrapper<OrderProduct> wrapper);
 
 }

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

@@ -7,6 +7,7 @@ import com.github.zuihou.business.operationManagementCenter.entity.OrderProduct;
 import com.github.zuihou.business.operationManagementCenter.service.OrderProductService;
 import com.github.zuihou.base.service.SuperServiceImpl;
 
+import com.github.zuihou.database.mybatis.auth.DataScope;
 import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Service;
@@ -34,7 +35,7 @@ public class OrderProductServiceImpl extends SuperServiceImpl<OrderProductMapper
 
 
     @Override
-    public IPage<OrderProduct> pageList(IPage page,String orderNo,String bomName,String produceStatus, LbqWrapper<OrderProduct> wrapper) {
-        return baseMapper.pageList(page, orderNo, bomName, produceStatus, wrapper);
+    public IPage<OrderProduct> pageList(IPage page, String produceStatus, LbqWrapper<OrderProduct> wrapper) {
+        return baseMapper.pageList(page, produceStatus, wrapper, new DataScope());
     }
 }

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

@@ -1009,6 +1009,7 @@ public class OrderServiceImpl extends SuperServiceImpl<OrderMapper, Order> imple
                 JSONObject jsonObject = new JSONObject();
                 jsonObject.put("taskNodeId",taskNode0.getId().toString());
                 jsonObject.put("bizType",BizConstant.MQ_TASK_NODE_TYPE_COMMON);
+                jsonObject.put("handMode",0);
                 log.info("推送mq队列{}消息{}",taskNode0.getResourceId().toString(),jsonObject.toString());
                 dynamicRabbitMq.sendMsg(taskNode0.getResourceId().toString(),jsonObject.toString());
             }

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

@@ -1382,9 +1382,13 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
         //websocket推送TODO临时注释
 //        msgUtil.pushTask(task);
 
-        //推送到消息队列
-        msgUtil.pushToNextMq(taskNode, task, taskNodeList, n, callBackJson,currWorkpiece);
+        // 判断当前是手动模式还是自动模式,如果是自动模式继续走下一个节点,如果是手动模式,判断当前节点是否是该工序最后一个节点
+        TaskNode currProcedureLastNode =  baseMapper.selectOne(Wraps.<TaskNode>lbQ().eq(TaskNode::getTaskId, task.getId()).orderByDesc(TaskNode::getCompleteBatchSort).last("limit 1"));
 
+        if(!currProcedureLastNode.getId().equals(taskNode.getId())){
+            //推送到消息队列
+            msgUtil.pushToNextMq(taskNode, task, taskNodeList, n, callBackJson,currWorkpiece);
+        }
     }
 
     /**

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

@@ -35,8 +35,10 @@ import com.github.zuihou.business.productionResourceCenter.entity.Productionreso
 import com.github.zuihou.business.productionResourceCenter.entity.ZZone;
 import com.github.zuihou.business.productionResourceCenter.entity.ZZoneProductionresource;
 import com.github.zuihou.business.productionResourceCenter.service.ProductionresourcePositionService;
+import com.github.zuihou.business.util.DynamicRabbitMq;
 import com.github.zuihou.business.util.ManualTaskOperatorUtil;
 import com.github.zuihou.business.util.MsgUtil;
+import com.github.zuihou.common.constant.BizConstant;
 import com.github.zuihou.common.constant.DictionaryKey;
 import com.github.zuihou.common.util.StringUtil;
 import com.github.zuihou.context.BaseContextHandler;
@@ -116,6 +118,8 @@ public class WorkpieceServiceImpl extends SuperServiceImpl<WorkpieceMapper, TWor
     private BomProcedureTrayMapper bomProcedureTrayMapper;
     @Autowired
     private BBomMapper bBomMapper;
+    @Autowired
+    private DynamicRabbitMq dynamicRabbitMq;
 
     private static ArrayList<String> robotTaskNodes = new ArrayList<>();
     static {
@@ -654,102 +658,113 @@ public class WorkpieceServiceImpl extends SuperServiceImpl<WorkpieceMapper, TWor
         TTask tTask = tTaskMapper.selectById(taskId);
         // 工序节点子任务
         List<TaskNode> taskNodes = taskNodeService.list(Wraps.<TaskNode>lbQ().eq(TaskNode::getCompleteBatchNo,tTask.getCompleteBatchNo()).eq(TaskNode::getExeStatus,"1").orderByAsc(TaskNode:: getPrority));
-        // 工件信息
-        TWorkpiece workpiece = baseMapper.selectOne(Wraps.<TWorkpiece>lbQ().eq(TWorkpiece::getCompleteBatchNo,tTask.getCompleteBatchNo()));
-
-        // 查找工件所属产线
-        BBom bom = bBomMapper.selectById(workpiece.getBomId());
-        ZZone zZone = zZoneMapper.selectById(bom.getZoneId());
-        // 根据工序判断需要做什么任务
-        BomProcedure bomProcedure = bomProcedureMapper.selectOne(Wraps.<BomProcedure>lbQ().eq(BomProcedure::getBomId,workpiece.getBomId()).eq(BomProcedure::getId,tTask.getProcedureId()));
-        // 人工序只有上下料
-        if("上料".equals(bomProcedure.getType())){
-            // 判断当前任务所属产品,找出相应的子盘夹具
-            BomProcedureTray bomProcedureTray = bomProcedureTrayMapper.selectOne(Wraps.<BomProcedureTray>lbQ().eq(BomProcedureTray::getProcedureId,tTask.getProcedureId()));
-            // 判断夹具是否有可用的,查询330个库位信息中是否还有夹具
-            List<StockInfo> stockInfos = stockInfoMapper.selectList(Wraps.<StockInfo>lbQ().eq(StockInfo::getGoodsId,bomProcedureTray.getTrayId()).orderByAsc(StockInfo::getStorgeId));
-            if(stockInfos.size() <= 0){
-                return R.fail("托盘数量不足");
-            }
-            // 按照顺序将托盘移动到上下料站
-            // 获取抓取托盘起点及放设备重点
-            StockInfo metetailStockInfo = stockInfos.get(0);
-            ProductionresourcePosition startProductionresourcePosition = productionresourcePositionMapper.selectOne(Wraps.<ProductionresourcePosition>lbQ().eq(ProductionresourcePosition::getStorgeId, metetailStockInfo.getStorgeId()));
-            String startPointid = startProductionresourcePosition.getPointId();
-            ProductionresourcePosition endProductionresourcePosition = productionresourcePositionMapper.selectOne(Wraps.<ProductionresourcePosition>lbQ().eq(ProductionresourcePosition::getResourceId, tTask.getResourceId()));
-            String endPointid = endProductionresourcePosition.getPointId();
-            return processOperation(taskId, tTask, taskNodes, zZone, startPointid, endPointid);
-
-        }else if("下料".equals(bomProcedure.getType())){
-            // 按照顺序将托盘移动到上下料站
-            // 获取抓取托盘起点及放设备重点
-            List<StockInfo> stockInfos = stockInfoMapper.selectList(Wraps.<StockInfo>lbQ().eq(StockInfo::getCompleteBatchNo,tTask.getCompleteBatchNo()));
-            ProductionresourcePosition startProductionresourcePosition = productionresourcePositionMapper.selectOne(Wraps.<ProductionresourcePosition>lbQ().eq(ProductionresourcePosition::getStorgeId, stockInfos.get(0).getStorgeId()));
-            String startPointid = startProductionresourcePosition.getPointId();
-            ProductionresourcePosition endProductionresourcePosition = productionresourcePositionMapper.selectOne(Wraps.<ProductionresourcePosition>lbQ().eq(ProductionresourcePosition::getResourceId, tTask.getResourceId()));
-            String endPointid = endProductionresourcePosition.getPointId();
-            return processOperation(taskId, tTask, taskNodes, zZone, startPointid, endPointid);
-
-        }else if("翻面".equals(bomProcedure.getType())){
-            // 按照顺序将托盘移动到上下料站
-            // 获取抓取托盘起点及放设备重点
-            List<StockInfo> stockInfos = stockInfoMapper.selectList(Wraps.<StockInfo>lbQ().eq(StockInfo::getCompleteBatchNo,tTask.getCompleteBatchNo()));
-            ProductionresourcePosition startProductionresourcePosition = productionresourcePositionMapper.selectOne(Wraps.<ProductionresourcePosition>lbQ().eq(ProductionresourcePosition::getStorgeId, stockInfos.get(0).getStorgeId()));
-            String startPointid = startProductionresourcePosition.getPointId();
-            ProductionresourcePosition endProductionresourcePosition = productionresourcePositionMapper.selectOne(Wraps.<ProductionresourcePosition>lbQ().eq(ProductionresourcePosition::getResourceId, tTask.getResourceId()));
-            String endPointid = endProductionresourcePosition.getPointId();
-            return processOperation(taskId, tTask, taskNodes, zZone, startPointid, endPointid);
-
-        }else{
-            // 按照顺序将托盘移动到上下料站
-            // 根据动作节点拆分
-
-            // 判断当前第一个指令是的设备是机器人还是加工设备,如果是机器人指定起点和重点,如果是设备不需要传入起点和重点
-            Productionresource firstNodeResource = productionresourceBizMapper.selectById(taskNodes.get(0).getResourceId());
-            // TODO 先用名称判断
-            if(firstNodeResource.getName().contains("伺服舵机") || firstNodeResource.getName().contains("机器人")){
-                // 机器人需要有起点和终点
-            }else{
-
-            }
-
-            List<StockInfo> stockInfos = stockInfoMapper.selectList(Wraps.<StockInfo>lbQ().eq(StockInfo::getCompleteBatchNo,tTask.getCompleteBatchNo()));
-            ProductionresourcePosition startProductionresourcePosition = productionresourcePositionMapper.selectOne(Wraps.<ProductionresourcePosition>lbQ().eq(ProductionresourcePosition::getStorgeId, stockInfos.get(0).getStorgeId()));
-            String startPointid = startProductionresourcePosition.getPointId();
-
-            TaskNode lastActionTaskNode = getNextActionTaskNode(taskNodes,0);
-            TaskNode currentTaskNode = taskNodes.get(0);
-            ZZoneProductionresource zZoneProductionresource = zZoneProductionresourceMapper.selectOne(Wraps.<ZZoneProductionresource>lbQ().eq(ZZoneProductionresource::getResourceId,currentTaskNode.getResourceId()));
-//            ZZone zzone = zZoneMapper.selectOne(Wraps.<ZZone>lbQ().eq(ZZone::getId,zZoneProductionresource.getZoneId()));
-            ProductionresourcePosition endProductionresourcePosition = null;
-            if(null == lastActionTaskNode.getResourceId()){
-                // agv动作,动态查询agv接驳位
-                // 查询当前设备所在产线的接驳位
-                Map queryParams = new HashMap();
-                queryParams.put("zoneId",zZoneProductionresource.getZoneId());
-                queryParams.put("resourceName","接驳");
-                List<Productionresource> productionresources = productionresourceBizMapper.selectResouces(queryParams);
-
-                // 遍历接驳位判断是否有可用的接驳位
-                for(Productionresource productionresource : productionresources){
-                    endProductionresourcePosition = productionresourcePositionMapper.selectOne(Wraps.<ProductionresourcePosition>lbQ().eq(ProductionresourcePosition::getResourceId, productionresource.getId()));
-                    List<StockInfo> agvStationMeterails = stockInfoMapper.selectList(Wraps.<StockInfo>lbQ().eq(StockInfo::getStorgeId,endProductionresourcePosition.getStorgeId()));
-                    List<String> meterails = agvStationMeterails.stream().map(p -> p.getGoodsType()).collect(Collectors.toList());
-                    // 有托板但是没有托盘认为可放
-                    if(meterails.contains("5") &&  meterails.contains("2")){
-                        break;
-                    }
-                }
-            }
-            if(null == endProductionresourcePosition){
-                return R.fail("不具备搬运条件,AGV接驳位不可用");
-            }
-            // 满足条件的agv接驳位
-            String endPointid = endProductionresourcePosition.getPointId();
-
-            // 在回调中分段处理
-            return processOperation(taskId, tTask, taskNodes, zZone, startPointid, endPointid);
-        }
+//        // 工件信息
+//        TWorkpiece workpiece = baseMapper.selectOne(Wraps.<TWorkpiece>lbQ().eq(TWorkpiece::getCompleteBatchNo,tTask.getCompleteBatchNo()));
+//
+//        // 查找工件所属产线
+//        BBom bom = bBomMapper.selectById(workpiece.getBomId());
+//        ZZone zZone = zZoneMapper.selectById(bom.getZoneId());
+//        // 根据工序判断需要做什么任务
+//        BomProcedure bomProcedure = bomProcedureMapper.selectOne(Wraps.<BomProcedure>lbQ().eq(BomProcedure::getBomId,workpiece.getBomId()).eq(BomProcedure::getId,tTask.getProcedureId()));
+//        // 人工序只有上下料
+//        if("上料".equals(bomProcedure.getType())){
+//            // 判断当前任务所属产品,找出相应的子盘夹具
+//            BomProcedureTray bomProcedureTray = bomProcedureTrayMapper.selectOne(Wraps.<BomProcedureTray>lbQ().eq(BomProcedureTray::getProcedureId,tTask.getProcedureId()));
+//            // 判断夹具是否有可用的,查询330个库位信息中是否还有夹具
+//            List<StockInfo> stockInfos = stockInfoMapper.selectList(Wraps.<StockInfo>lbQ().eq(StockInfo::getGoodsId,bomProcedureTray.getTrayId()).orderByAsc(StockInfo::getStorgeId));
+//            if(stockInfos.size() <= 0){
+//                return R.fail("托盘数量不足");
+//            }
+//            // 按照顺序将托盘移动到上下料站
+//            // 获取抓取托盘起点及放设备重点
+//            StockInfo metetailStockInfo = stockInfos.get(0);
+//            ProductionresourcePosition startProductionresourcePosition = productionresourcePositionMapper.selectOne(Wraps.<ProductionresourcePosition>lbQ().eq(ProductionresourcePosition::getStorgeId, metetailStockInfo.getStorgeId()));
+//            String startPointid = startProductionresourcePosition.getPointId();
+//            ProductionresourcePosition endProductionresourcePosition = productionresourcePositionMapper.selectOne(Wraps.<ProductionresourcePosition>lbQ().eq(ProductionresourcePosition::getResourceId, tTask.getResourceId()));
+//            String endPointid = endProductionresourcePosition.getPointId();
+//            return processOperation(taskId, tTask, taskNodes, zZone, startPointid, endPointid);
+//
+//        }else if("下料".equals(bomProcedure.getType())){
+//            // 按照顺序将托盘移动到上下料站
+//            // 获取抓取托盘起点及放设备重点
+//            List<StockInfo> stockInfos = stockInfoMapper.selectList(Wraps.<StockInfo>lbQ().eq(StockInfo::getCompleteBatchNo,tTask.getCompleteBatchNo()));
+//            ProductionresourcePosition startProductionresourcePosition = productionresourcePositionMapper.selectOne(Wraps.<ProductionresourcePosition>lbQ().eq(ProductionresourcePosition::getStorgeId, stockInfos.get(0).getStorgeId()));
+//            String startPointid = startProductionresourcePosition.getPointId();
+//            ProductionresourcePosition endProductionresourcePosition = productionresourcePositionMapper.selectOne(Wraps.<ProductionresourcePosition>lbQ().eq(ProductionresourcePosition::getResourceId, tTask.getResourceId()));
+//            String endPointid = endProductionresourcePosition.getPointId();
+//            return processOperation(taskId, tTask, taskNodes, zZone, startPointid, endPointid);
+//
+//        }else if("翻面".equals(bomProcedure.getType())){
+//            // 按照顺序将托盘移动到上下料站
+//            // 获取抓取托盘起点及放设备重点
+//            List<StockInfo> stockInfos = stockInfoMapper.selectList(Wraps.<StockInfo>lbQ().eq(StockInfo::getCompleteBatchNo,tTask.getCompleteBatchNo()));
+//            ProductionresourcePosition startProductionresourcePosition = productionresourcePositionMapper.selectOne(Wraps.<ProductionresourcePosition>lbQ().eq(ProductionresourcePosition::getStorgeId, stockInfos.get(0).getStorgeId()));
+//            String startPointid = startProductionresourcePosition.getPointId();
+//            ProductionresourcePosition endProductionresourcePosition = productionresourcePositionMapper.selectOne(Wraps.<ProductionresourcePosition>lbQ().eq(ProductionresourcePosition::getResourceId, tTask.getResourceId()));
+//            String endPointid = endProductionresourcePosition.getPointId();
+//            return processOperation(taskId, tTask, taskNodes, zZone, startPointid, endPointid);
+//
+//        }else{
+//            // 按照顺序将托盘移动到上下料站
+//            // 根据动作节点拆分
+//
+//            // 判断当前第一个指令是的设备是机器人还是加工设备,如果是机器人指定起点和重点,如果是设备不需要传入起点和重点
+//            Productionresource firstNodeResource = productionresourceBizMapper.selectById(taskNodes.get(0).getResourceId());
+//            // TODO 先用名称判断
+//            if(firstNodeResource.getName().contains("伺服舵机") || firstNodeResource.getName().contains("机器人")){
+//                // 机器人需要有起点和终点
+//            }else{
+//
+//            }
+//
+//            List<StockInfo> stockInfos = stockInfoMapper.selectList(Wraps.<StockInfo>lbQ().eq(StockInfo::getCompleteBatchNo,tTask.getCompleteBatchNo()));
+//            ProductionresourcePosition startProductionresourcePosition = productionresourcePositionMapper.selectOne(Wraps.<ProductionresourcePosition>lbQ().eq(ProductionresourcePosition::getStorgeId, stockInfos.get(0).getStorgeId()));
+//            String startPointid = startProductionresourcePosition.getPointId();
+//
+//            TaskNode lastActionTaskNode = getNextActionTaskNode(taskNodes,0);
+//            TaskNode currentTaskNode = taskNodes.get(0);
+//            ZZoneProductionresource zZoneProductionresource = zZoneProductionresourceMapper.selectOne(Wraps.<ZZoneProductionresource>lbQ().eq(ZZoneProductionresource::getResourceId,currentTaskNode.getResourceId()));
+////            ZZone zzone = zZoneMapper.selectOne(Wraps.<ZZone>lbQ().eq(ZZone::getId,zZoneProductionresource.getZoneId()));
+//            ProductionresourcePosition endProductionresourcePosition = null;
+//            if(null == lastActionTaskNode.getResourceId()){
+//                // agv动作,动态查询agv接驳位
+//                // 查询当前设备所在产线的接驳位
+//                Map queryParams = new HashMap();
+//                queryParams.put("zoneId",zZoneProductionresource.getZoneId());
+//                queryParams.put("resourceName","接驳");
+//                List<Productionresource> productionresources = productionresourceBizMapper.selectResouces(queryParams);
+//
+//                // 遍历接驳位判断是否有可用的接驳位
+//                for(Productionresource productionresource : productionresources){
+//                    endProductionresourcePosition = productionresourcePositionMapper.selectOne(Wraps.<ProductionresourcePosition>lbQ().eq(ProductionresourcePosition::getResourceId, productionresource.getId()));
+//                    List<StockInfo> agvStationMeterails = stockInfoMapper.selectList(Wraps.<StockInfo>lbQ().eq(StockInfo::getStorgeId,endProductionresourcePosition.getStorgeId()));
+//                    List<String> meterails = agvStationMeterails.stream().map(p -> p.getGoodsType()).collect(Collectors.toList());
+//                    // 有托板但是没有托盘认为可放
+//                    if(meterails.contains("5") &&  meterails.contains("2")){
+//                        break;
+//                    }
+//                }
+//            }
+//            if(null == endProductionresourcePosition){
+//                return R.fail("不具备搬运条件,AGV接驳位不可用");
+//            }
+//            // 满足条件的agv接驳位
+//            String endPointid = endProductionresourcePosition.getPointId();
+//
+//            // 在回调中分段处理
+//            return processOperation(taskId, tTask, taskNodes, zZone, startPointid, endPointid);
+//        }
+        // 直接复用当前节点代码
+        JSONObject jsonObject = new JSONObject();
+        TaskNode taskNode = taskNodes.get(0);
+        jsonObject.put("taskNodeId",taskNode.getId().toString());
+        jsonObject.put("bizType", BizConstant.MQ_TASK_NODE_TYPE_COMMON);
+        // 手动模式
+        jsonObject.put("handMode", "1");
+        log.info("推送mq队列{}消息{}",taskNode.getResourceId().toString(),jsonObject.toString());
+        dynamicRabbitMq.sendMsg(taskNode.getResourceId().toString(),jsonObject.toString());
+
+        return R.success();
     }
 
     /**

+ 5 - 12
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/operationManagementCenter/OrderProductMapper.xml

@@ -19,38 +19,31 @@
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id,create_time,update_time,bomName,order_no,unqualifiedCount,addOrderCount,
-        order_id, bom_id, bom_num, delivery_time, remark, create_user, update_user, prority,produceStatus
+        id,create_time,update_time,bomName,bomNo, order_no,unqualifiedCount,addOrderCount,
+        order_id, bom_id, bom_num, delivery_time, remark, create_user, update_user, prority, produce_status
     </sql>
 
     <!-- 分页 -->
     <select id="pageList" parameterType="String" resultMap="BaseResultMap">
         select
         <include refid="Base_Column_List"/>
-        from (select a.*,b.name bomName,b.no as bomNo,b.specifications as specifications,b.model,b.brand,ifnull(c.planNum,0) as planNum,
-        (ifnull(a.bom_num,0)-ifnull(c.planNum,0)) as stayPlanNum,d.delivery_time as orderDeliveryTime,d.order_no orderNo,unqualifiedCount,addOrderCount,d.produce_status produceStatus
+        from (select a.*,b.name as bomName,b.no as bomNo,b.specifications ,b.model,b.brand,ifnull(c.planNum,0) as planNum,
+        (ifnull(a.bom_num,0)-ifnull(c.planNum,0)) as stayPlanNum,d.delivery_time as orderDeliveryTime, unqualifiedCount,addOrderCount,d.produce_status
         from imcs_o_order_product a
         left join imcs_b_bom b on a.bom_id = b.id
         left join (
           select order_product_id,count(1) as planNum from imcs_p_plan_product where 1=1 group by order_product_id
         )c on a.id= c.order_product_id
         left join imcs_o_order d on a.order_id = d.id
-
         LEFT JOIN
-        (select order_product_id,count(1) unqualifiedCount,count(u.add_order_id)addOrderCount from
+        (select order_product_id,count(1) as unqualifiedCount,count(u.add_order_id) as addOrderCount from
         imcs_t_task_test_unqualified_bom u
         GROUP BY u.order_product_id
         )e on a.id = e.order_product_id
         where 1=1
-        <if test="orderNo != null and orderNo != ''">
-            and d.order_no like concat('%', #{orderNo}, '%')
-        </if>
         <if test="produceStatus != null and produceStatus != ''">
             and d.produce_Status = #{produceStatus}
         </if>
-        <if test="bomName != null and bomName != ''">
-            and b.name like concat('%', #{bomName}, '%')
-        </if>
         ) s ${ew.customSqlSegment}
     </select>
 

+ 4 - 2
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/operationManagementCenter/OrderQualityMapper.xml

@@ -10,6 +10,7 @@
         <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
         <result column="update_user" jdbcType="BIGINT" property="updateUser"/>
         <result column="order_no" jdbcType="VARCHAR" property="orderNo"/>
+        <result column="order_name" jdbcType="VARCHAR" property="orderName"/>
         <result column="order_id" jdbcType="BIGINT" property="orderId"/>
         <result column="task_id" jdbcType="BIGINT" property="taskId"/>
         <result column="workpiece_id" jdbcType="VARCHAR" property="workpieceId"/>
@@ -37,7 +38,7 @@
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
         id,create_time,create_user,update_time,update_user,
-        order_no, order_id,task_id,workpiece_id,workpiece_name,procedure_id,procedure_name,measuring_type,measuring_program,ok_flag,
+        order_no, order_name, order_id,task_id,workpiece_id,workpiece_name,procedure_id,procedure_name,measuring_type,measuring_program,ok_flag,
         sketchy_xaxis_offset,sketchy_yaxis_offset,sketchy_zaxis_offset,sketchy_aaxis_offset,sketchy_baxis_offset,sketchy_caxis_offset,
         exact_xaxis_offset,exact_yaxis_offset,exact_zaxis_offset,exact_aaxis_offset,exact_baxis_offset,exact_caxis_offset,measuring_report
     </sql>
@@ -46,8 +47,9 @@
     <select id="pageList" resultMap="BaseResultMap">
         select
         <include refid="Base_Column_List"/>
-        from (select w.*
+        from (select w.*, o.order_name
         from imcs_order_quality_info w
+            left join imcs_o_order o on w.order_id = o.id
         ) s ${ew.customSqlSegment}
     </select>
 

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

@@ -106,7 +106,7 @@
 
     <select id="getFinishPlanList" resultType="java.util.Map" >
         SELECT
-            ipp.id,ippp.bom_id AS bomId,ibb.name,ibb.no,ippp.plan_bom_num as planBomNum,ioop.delivery_time as deliveryTime
+            ipp.id,ippp.bom_id AS bomId,ibb.name,ibb.parts_no as no,ippp.plan_bom_num as planBomNum,ioop.delivery_time as deliveryTime
         FROM imcs_p_plan ipp,
              imcs_p_plan_product ippp,
              imcs_o_order_product ioop,
@@ -229,13 +229,14 @@
                     itp.name
                 FROM imcs_tenant_productionresource itp
                 WHERE itp.id = ibbpp.resource_id) AS resourceName,
-                (SELECT ict.cutting_tool_name FROM imcs_cutting_tool ict WHERE ict.id = ibbpt.tool_id) AS needCuttingTools
+                ict.cutting_tool_name  AS needCuttingTools
         FROM imcs_p_plan_product ippp,
                 imcs_b_bom ibb,
                 imcs_b_bom_version_info ibbvi,
                 imcs_b_bom_procedure ibbp,
                 imcs_b_bom_procedure_tool ibbpt,
-                imcs_b_bom_procedure_productionresource ibbpp
+                imcs_b_bom_procedure_productionresource ibbpp,
+                imcs_cutting_tool ict
             WHERE ippp.bom_id = ibb.id
             AND ibb.id = ibbvi.bom_id
             AND ibbvi.use_status = '1'
@@ -243,6 +244,7 @@
             AND ibbp.id = ibbpt.procedure_id
             AND ibbp.program_conf = '2'
             AND ibbp.id = ibbpp.procedure_id
+            AND ict.id = ibbpt.tool_id
             <if test="planId != null and planId != ''">
                 and ippp.plan_id = #{planId}
             </if>

+ 2 - 2
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/productionReadyCenter/CuttingToolApplyMapper.xml

@@ -100,8 +100,8 @@
                 ioo.order_name AS orderName,
                 ioo.delivery_time AS orderDeliveryTime,
                 ioop.delivery_time AS orderPartDeliveryTime,
-                ibb.no AS partNo,
-                ibb.product_no AS productNo,
+                ibb.parts_no AS partNo,
+                ibb.parts_alias AS productNo,
                 ibb.name AS partName,
                 ibbp.no AS procedureNo,
                 ibbp.name AS procedureName

+ 15 - 6
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/operationManagementCenter/InspectionController.java

@@ -18,6 +18,7 @@ import com.github.zuihou.business.operationManagementCenter.service.WorkpieceSer
 import com.github.zuihou.business.productionReadyCenter.entity.BomProcedure;
 import com.github.zuihou.business.productionReadyCenter.service.BBomService;
 import com.github.zuihou.business.productionReadyCenter.service.BomProcedureService;
+import com.github.zuihou.business.productionResourceCenter.entity.ZZone;
 import com.github.zuihou.business.productionResourceCenter.service.ZZoneService;
 import com.github.zuihou.common.util.StringUtil;
 import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
@@ -26,10 +27,12 @@ import com.github.zuihou.log.annotation.SysLog;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.compress.utils.Lists;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -78,6 +81,13 @@ public class InspectionController extends SuperController<InspectionService, Lon
     @ApiOperation(value = "获取可抽检工序", notes = "获取可抽检工序")
     @PostMapping("/procedure")
     public R<List<TTask>> procedure(@RequestBody Map map) {
+
+        ZZone zZone = zZoneService.getById(map.get("zoneId").toString());
+        if(null==zZone || zZone.getNo().equals("safeguard")){
+            //排除保障中心设备序
+            return success(Lists.newArrayList());
+        }
+
         LbqWrapper<BomProcedure> wrapper = new LbqWrapper<BomProcedure>();
         //满足当前零件、属于设备序、工艺允许配置抽检、按照优先级降序排列
         wrapper.eq(BomProcedure::getBomId, map.get("bomId")).eq(BomProcedure::getType, "设备序").eq(BomProcedure::getRandomCheckConf, "1").orderByDesc(BomProcedure::getSort);
@@ -95,21 +105,20 @@ public class InspectionController extends SuperController<InspectionService, Lon
             //在当前零件加工工序之后
             wrapper.le(BomProcedure::getSort, sort);
         }
+        List<Long> procedureIds = bomProcedureService.list(wrapper).stream().map(item->item.getId()).collect(Collectors.toList());
 
-        List<Long> idList = bomProcedureService.list(wrapper).stream().filter(data -> {
-            //排除保障中心设备序
-            Long zone_id = bBomService.getById(data.getBomId()).getZoneId();
-            return zZoneService.getById(zone_id).getNo() != "safeguard";
-        }).map(BomProcedure::getId).collect(Collectors.toList());
         //获取已存在的工序的任务节点
         LbqWrapper<TTask> taskLbqWrapper = new LbqWrapper<TTask>();
-        taskLbqWrapper.eq(TTask::getCompleteBatchNo, workPiece.getCompleteBatchNo()).eq(TTask::getPlanId, map.get("planId").toString()).in(TTask::getProcedureId, idList.toArray());
+        taskLbqWrapper.eq(TTask::getCompleteBatchNo, workPiece.getCompleteBatchNo()).eq(TTask::getPlanId, map.get("planId").toString());
 
         List<Long> taskIds = baseService.list(new LbqWrapper<Inspection>().eq(Inspection::getWorkpieceId, workPiece.getId())).stream().map(item->item.getTaskId()).collect(Collectors.toList());
         //排除已经提交抽检的工序
         if (null != taskIds && taskIds.size()>0) {
             taskLbqWrapper.notIn(TTask::getId, taskIds.toArray());
         }
+        if(null!=procedureIds && procedureIds.size()>0){
+            taskLbqWrapper.in(TTask::getProcedureId, procedureIds.toArray());
+        }
         List<TTask> dataList = taskService.list(taskLbqWrapper);
         return success(dataList);
     }

+ 8 - 9
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/operationManagementCenter/OrderProductController.java

@@ -2,7 +2,9 @@ package com.github.zuihou.business.controller.operationManagementCenter;
 
 import cn.hutool.core.bean.BeanUtil;
 import cn.hutool.core.util.StrUtil;
+import com.baomidou.mybatisplus.core.MybatisConfiguration;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.metadata.TableInfoHelper;
 import com.github.zuihou.base.request.PageParams;
 import com.github.zuihou.business.operationManagementCenter.dto.PlanPageDTO;
 import com.github.zuihou.business.operationManagementCenter.entity.Order;
@@ -28,6 +30,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.ibatis.builder.MapperBuilderAssistant;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -60,16 +63,12 @@ public class OrderProductController extends SuperController<OrderProductService,
         LbqWrapper<OrderProduct> wrapper = wrap.lambda();
         OrderProduct orderProduct = BeanUtil.toBean(data, OrderProduct.class);
 
+        TableInfoHelper.initTableInfo(new MapperBuilderAssistant(new MybatisConfiguration(), ""), OrderProduct.class);
         //构建查询参数
-//        eq(OrderProduct::,plan.getAuditStatus())
-                /*.eq(Plan::getSource,plan.getSource())
-                .eq(Plan::getCustId,plan.getCustId())*/
-//                .eq(Plan::getOrderId,plan.getOrderId())
-//                .eq(Plan::getDraftFlag,plan.getDraftFlag())
-//        .geHeader(Order::getDeliveryTime, StrUtil.isEmpty(order.getDeliveryTime_st())?null: LocalDateTime.parse(order.getDeliveryTime_st()))
-//                .leFooter(Order::getDeliveryTime, StrUtil.isEmpty(order.getDeliveryTime_ed())?null:LocalDateTime.parse(order.getDeliveryTime_ed()))
-        wrapper.  orderByDesc(OrderProduct::getCreateTime);
-        baseService.pageList(page,orderProduct.getOrderNo(),orderProduct.getBomName(),orderProduct.getProduceStatus(),wrapper);
+        wrapper.like(StringUtil.isNotEmpty(orderProduct.getOrderNo()),OrderProduct::getOrderNo, orderProduct.getOrderNo())
+                .like(StringUtil.isNotEmpty(orderProduct.getBomName()),OrderProduct::getBomName, orderProduct.getBomName()).orderByDesc(OrderProduct::getCreateTime);
+
+        baseService.pageList(page,orderProduct.getProduceStatus(), wrapper);
 
     }
 

+ 7 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/operationManagementCenter/dto/OrderQualityPageDTO.java

@@ -44,6 +44,13 @@ public class OrderQualityPageDTO implements Serializable {
     @Excel(name = "订单编号")
     private String orderNo;
 
+    /**
+     * 订单名称
+     */
+    @ApiModelProperty(value = "订单名称")
+    @Excel(name = "订单名称")
+    private String orderName;
+
     /**
      * 订单ID
      */

+ 8 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/operationManagementCenter/entity/OrderQuality.java

@@ -54,6 +54,14 @@ public class OrderQuality extends Entity {
     @Excel(name = "订单ID")
     private Long orderId;
 
+    /**
+     * 订单ID
+     */
+    @ApiModelProperty(value = "订单名称")
+    @TableField(exist = false)
+    @Excel(name = "订单名称")
+    private String orderName;
+
     @ApiModelProperty(value = "任务ID")
     @TableField("task_id")
     @Excel(name = "任务ID")