|
@@ -1,5 +1,6 @@
|
|
|
package com.github.zuihou.business.util;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollectionUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.github.zuihou.business.DemoLine.DemoCacheKey;
|
|
|
import com.github.zuihou.business.DemoLine.DemoLineConstant;
|
|
@@ -9,14 +10,18 @@ import com.github.zuihou.business.edgeLibrary.service.impl.StockInfoServiceImpl;
|
|
|
import com.github.zuihou.business.operationManagementCenter.entity.TTask;
|
|
|
import com.github.zuihou.business.operationManagementCenter.entity.TWorkpiece;
|
|
|
import com.github.zuihou.business.operationManagementCenter.entity.TaskNode;
|
|
|
+import com.github.zuihou.business.operationManagementCenter.service.TaskNodeService;
|
|
|
import com.github.zuihou.business.operationManagementCenter.service.TaskService;
|
|
|
import com.github.zuihou.business.productionReadyCenter.dao.BBomMapper;
|
|
|
import com.github.zuihou.business.productionReadyCenter.entity.BBom;
|
|
|
+import com.github.zuihou.business.productionReadyCenter.entity.BomProcedure;
|
|
|
+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.business.productionResourceCenter.service.impl.ZZoneServiceImpl;
|
|
|
import com.github.zuihou.business.websocket.WebSocketServer;
|
|
|
import com.github.zuihou.common.constant.BizConstant;
|
|
|
+import com.github.zuihou.database.mybatis.conditions.Wraps;
|
|
|
import com.qiniu.common.Zone;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
@@ -55,6 +60,14 @@ public class MsgUtil implements ApplicationContextAware {
|
|
|
@Autowired
|
|
|
private ZZoneService zoneService;
|
|
|
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private BomProcedureService bomProcedureService;
|
|
|
+
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private TaskNodeService taskNodeService;
|
|
|
+
|
|
|
@Override
|
|
|
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
|
|
MsgUtil.applicationContext = applicationContext;
|
|
@@ -122,6 +135,25 @@ public class MsgUtil implements ApplicationContextAware {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ //如果是三坐标检测
|
|
|
+ if(callBackJson.containsKey("result")&&"NG".equals(callBackJson.getString("result"))){
|
|
|
+ //获取下料工序
|
|
|
+ List<BomProcedure> bomProcedureList = bomProcedureService.list(Wraps.<BomProcedure>lbQ().eq(BomProcedure::getBomId,task.getBomId()).orderByAsc(BomProcedure::getSort));
|
|
|
+ if(CollectionUtil.isNotEmpty(bomProcedureList)){
|
|
|
+ //获取下料序的第一个节点
|
|
|
+ List<TaskNode> taskNodes = taskNodeService.list(Wraps.<TaskNode>lbQ().eq(TaskNode::getProcedureId,bomProcedureList.get(0).getId()).orderByAsc(TaskNode::getCompleteBatchSort));
|
|
|
+ if(CollectionUtil.isNotEmpty(taskNodes)){
|
|
|
+ jsonObject.put("taskNodeId",taskNodes.get(0).getId());
|
|
|
+ //强制下线
|
|
|
+ jsonObject.put("bizType", BizConstant.MQ_TASK_NODE_TYPE_COMMON);
|
|
|
+ dynamicRabbitMq.sendMsg(taskNode.getResourceId().toString(),jsonObject.toString());
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
jsonObject.put("taskNodeId",nextTaskNode.getId().toString());
|
|
|
if(callBackJson.containsKey(DemoLineConstant.DEMOLINE_XBKFLAG)){//临时存放到了线边库,向虚拟线边库发一个MQ。
|
|
|
if(callBackJson.containsKey(YunjianConstant.YUNJIAN_ROBORT_CACHE_FLAG)){//带缓存位机器人的多步骤执行
|