|
@@ -159,121 +159,244 @@ public class MsgUtil implements ApplicationContextAware {
|
|
|
if(n<taskNodeList.size()-1){//尚未执行到最后一个
|
|
|
TaskNode nextTaskNode = taskNodeList.get(n+1);
|
|
|
|
|
|
- //如果是三坐标检测
|
|
|
- if("3".equals(taskNode.getNodeType())){
|
|
|
- // TODO 后续改成动态拼接
|
|
|
- //组装接口参数
|
|
|
- ZZoneProductionresource zoneProductionresource = zZoneProductionresourceMapper.selectOne(Wraps.<ZZoneProductionresource>lbQ().eq(ZZoneProductionresource::getResourceId,taskNode.getResourceId()));
|
|
|
- long zoneId = zoneProductionresource.getZoneId();
|
|
|
- ZZone zZone = zoneService.getById(zoneId);
|
|
|
- Map<String, String> plcInfo = DictionaryKey.PLC_CATEGORY.get(zZone.getNo());
|
|
|
-
|
|
|
- HttpHeaders headers = new HttpHeaders();
|
|
|
- headers.setContentType(MediaType.parseMediaType("application/json;charset=UTF-8"));
|
|
|
- JSONObject jsonParam = new JSONObject();
|
|
|
- jsonParam.put("tagname","DB200.38");
|
|
|
- jsonParam.put("ip",plcInfo.get("url"));
|
|
|
- HttpEntity<String> formEntity = new HttpEntity<String>(jsonParam.toJSONString(), headers);
|
|
|
-
|
|
|
- //动态调用接口和新增指令执行时间
|
|
|
- plcInfo = DictionaryKey.PLC_CATEGORY.get(zZone.getNo());
|
|
|
- String paramKey = zZone.getNo() + "_plc";
|
|
|
- String plcUrl = (null == msgUtil.redis_get(ParameterKey.PARAMETERS)? "": ((Map<String,String>)msgUtil.redis_get(ParameterKey.PARAMETERS)).get(paramKey).toString());
|
|
|
- // TODO 改成虚拟端口,后续删除
|
|
|
- plcUrl = plcUrl.replace("8081","8083");
|
|
|
-
|
|
|
-
|
|
|
- String instructionUrl = plcUrl + "/api/GetTagValue";
|
|
|
- System.out.println("instructionUrl=" + instructionUrl);
|
|
|
- System.out.println("jsonParam=" + jsonParam);
|
|
|
- String returnData = restTemplate.postForObject(instructionUrl, formEntity, String.class);
|
|
|
-
|
|
|
- // TODO modify by yejian on 20220525 for 添加三坐标模拟
|
|
|
- Random random = new Random();
|
|
|
- Boolean measuringFlag = random.nextBoolean();
|
|
|
+ String zoneType = (null == redis_get(ParameterKey.PARAMETERS)? "": ((Map<String,String>)redis_get(ParameterKey.PARAMETERS)).get(ParameterKey.ZONE_TYPE).toString());
|
|
|
+ if(zoneType.equals(ParameterKey.ZONE_SFX)){
|
|
|
+ //如果是三坐标检测
|
|
|
+ if("3".equals(taskNode.getNodeType())){
|
|
|
+ // TODO 后续改成动态拼接
|
|
|
+ //组装接口参数
|
|
|
+ ZZoneProductionresource zoneProductionresource = zZoneProductionresourceMapper.selectOne(Wraps.<ZZoneProductionresource>lbQ().eq(ZZoneProductionresource::getResourceId,taskNode.getResourceId()));
|
|
|
+ long zoneId = zoneProductionresource.getZoneId();
|
|
|
+ ZZone zZone = zoneService.getById(zoneId);
|
|
|
+ Map<String, String> plcInfo = DictionaryKey.PLC_CATEGORY.get(zZone.getNo());
|
|
|
+
|
|
|
+ HttpHeaders headers = new HttpHeaders();
|
|
|
+ headers.setContentType(MediaType.parseMediaType("application/json;charset=UTF-8"));
|
|
|
+ JSONObject jsonParam = new JSONObject();
|
|
|
+ jsonParam.put("tagname","DB200.38");
|
|
|
+ jsonParam.put("ip",plcInfo.get("url"));
|
|
|
+ HttpEntity<String> formEntity = new HttpEntity<String>(jsonParam.toJSONString(), headers);
|
|
|
+
|
|
|
+ //动态调用接口和新增指令执行时间
|
|
|
+ plcInfo = DictionaryKey.PLC_CATEGORY.get(zZone.getNo());
|
|
|
+ String paramKey = zZone.getNo() + "_plc";
|
|
|
+ String plcUrl = (null == msgUtil.redis_get(ParameterKey.PARAMETERS)? "": ((Map<String,String>)msgUtil.redis_get(ParameterKey.PARAMETERS)).get(paramKey).toString());
|
|
|
+ // TODO 改成虚拟端口,后续删除
|
|
|
+ plcUrl = plcUrl.replace("8081","8083");
|
|
|
+
|
|
|
+
|
|
|
+ String instructionUrl = plcUrl + "/api/GetTagValue";
|
|
|
+ System.out.println("instructionUrl=" + instructionUrl);
|
|
|
+ System.out.println("jsonParam=" + jsonParam);
|
|
|
+ String returnData = restTemplate.postForObject(instructionUrl, formEntity, String.class);
|
|
|
+
|
|
|
+ // TODO modify by yejian on 20220525 for 添加三坐标模拟
|
|
|
+ Random random = new Random();
|
|
|
+ Boolean measuringFlag = random.nextBoolean();
|
|
|
// int measuringResult = measuringFlag ? 0 : 1;
|
|
|
- int measuringResult = 1;
|
|
|
- String measuringResultFile = filePath + taskNode.getCompleteBatchNo() + "_" + task.getProcedureNo() + ".csv";
|
|
|
- List<String> fileContents = new ArrayList<>();
|
|
|
- OrderQuality orderQuality = new OrderQuality();
|
|
|
- TTaskTestUnqualifiedBom taskTestUnqualifiedBom = new TTaskTestUnqualifiedBom();
|
|
|
-
|
|
|
- TWorkpiece workpiece = workpieceMapper.selectOne(Wraps.<TWorkpiece>lbQ().eq(TWorkpiece::getCompleteBatchNo,task.getCompleteBatchNo()));
|
|
|
- logger.info("三坐标测量结果{}", measuringResult);
|
|
|
- if(measuringResult == 0){
|
|
|
- fileContents.add("OK");
|
|
|
- orderQuality.setOkFlag("OK");
|
|
|
- workpiece.setTestResult("1");
|
|
|
- taskTestUnqualifiedBom.setTestResult("1");
|
|
|
- }else{
|
|
|
- fileContents.add("NG");
|
|
|
- orderQuality.setOkFlag("NG");
|
|
|
- workpiece.setTestResult("0");
|
|
|
- taskTestUnqualifiedBom.setTestResult("0");
|
|
|
- }
|
|
|
- SmbShareFileUtil.writeShareFileContent(measuringResultFile,fileContents,userName,password,fileIp);
|
|
|
- Order order = orderMapper.selectById(task.getOrderId());
|
|
|
- Plan plan = planMapper.selectById(task.getPlanId());
|
|
|
- BBom bom = bBomMapper.selectById(task.getBomId());
|
|
|
-
|
|
|
- orderQuality.setOrderNo(order.getOrderNo());
|
|
|
- orderQuality.setOrderId(order.getId());
|
|
|
- orderQuality.setTaskId(task.getId());
|
|
|
- orderQuality.setWorkpieceId(task.getCompleteBatchNo());
|
|
|
- orderQuality.setWorkpieceName(bom.getName());
|
|
|
- orderQuality.setProcedureId(task.getProcedureId());
|
|
|
- orderQuality.setProcedureName(task.getProcedureName());
|
|
|
- orderQuality.setMeasuringType(1);
|
|
|
- orderQuality.setMeasuringReport(measuringResultFile);
|
|
|
- orderQualityMapper.insert(orderQuality);
|
|
|
-
|
|
|
- taskTestUnqualifiedBom.setTaskId(task.getId());
|
|
|
- taskTestUnqualifiedBom.setTaskNo(task.getTaskNo());
|
|
|
- taskTestUnqualifiedBom.setOrderId(order.getId());
|
|
|
- taskTestUnqualifiedBom.setOrderNo(order.getOrderNo());
|
|
|
- taskTestUnqualifiedBom.setPlanId(plan.getId());
|
|
|
- taskTestUnqualifiedBom.setPlanNo(plan.getPlanNo());
|
|
|
- taskTestUnqualifiedBom.setProcedureId(task.getProcedureId());
|
|
|
- taskTestUnqualifiedBom.setBomId(task.getBomId());
|
|
|
- taskTestUnqualifiedBom.setBomName(bom.getName());
|
|
|
- taskTestUnqualifiedBom.setUniqueCode(workpiece.getUniqueCode());
|
|
|
- taskTestUnqualifiedBom.setBomNum(1);
|
|
|
- taskTestUnqualifiedBomMapper.insert(taskTestUnqualifiedBom);
|
|
|
-
|
|
|
- workpieceMapper.updateById(workpiece);
|
|
|
-
|
|
|
-
|
|
|
- if(1 == measuringResult){
|
|
|
- logger.info("三坐标测量失败直接下料");
|
|
|
-
|
|
|
- // 清楚当前节点工序的redis暂存值
|
|
|
- List<TaskNode> operationTaskNodes = taskNodeService.list(Wraps.<TaskNode>lbQ().eq(TaskNode::getTaskId, taskNode.getTaskId()));
|
|
|
- List<Long> operationTaskNodeIds = operationTaskNodes.stream().map(operationTaskNode -> operationTaskNode.getId()).collect(Collectors.toList());
|
|
|
- for(Long operationTaskNodeId : operationTaskNodeIds){
|
|
|
- // 清除redis里面的内容
|
|
|
- msgUtil.redis_del(YunjianConstant.YUNJIAN_CALLBACK_PARAM + "_" + operationTaskNodeId);
|
|
|
- msgUtil.redis_del(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_JXS + operationTaskNodeId);
|
|
|
- msgUtil.redis_del(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_HCW + operationTaskNodeId);
|
|
|
- msgUtil.redis_del(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_XBK_FLAG + operationTaskNodeId);
|
|
|
- msgUtil.redis_del(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_HCW_XBK_FLAG + operationTaskNodeId);
|
|
|
- msgUtil.redis_del(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_STORE + operationTaskNodeId);
|
|
|
- msgUtil.redis_del(CacheKey.TASK_CURRENT_NODE + "_" + operationTaskNodeId);
|
|
|
+ int measuringResult = 1;
|
|
|
+ String measuringResultFile = filePath + taskNode.getCompleteBatchNo() + "_" + task.getProcedureNo() + ".csv";
|
|
|
+ List<String> fileContents = new ArrayList<>();
|
|
|
+ OrderQuality orderQuality = new OrderQuality();
|
|
|
+ TTaskTestUnqualifiedBom taskTestUnqualifiedBom = new TTaskTestUnqualifiedBom();
|
|
|
+
|
|
|
+ TWorkpiece workpiece = workpieceMapper.selectOne(Wraps.<TWorkpiece>lbQ().eq(TWorkpiece::getCompleteBatchNo,task.getCompleteBatchNo()));
|
|
|
+ logger.info("三坐标测量结果{}", measuringResult);
|
|
|
+ if(measuringResult == 0){
|
|
|
+ fileContents.add("OK");
|
|
|
+ orderQuality.setOkFlag("OK");
|
|
|
+ workpiece.setTestResult("1");
|
|
|
+ taskTestUnqualifiedBom.setTestResult("1");
|
|
|
+ }else{
|
|
|
+ fileContents.add("NG");
|
|
|
+ orderQuality.setOkFlag("NG");
|
|
|
+ workpiece.setTestResult("0");
|
|
|
+ taskTestUnqualifiedBom.setTestResult("0");
|
|
|
}
|
|
|
+ SmbShareFileUtil.writeShareFileContent(measuringResultFile,fileContents,userName,password,fileIp);
|
|
|
+ Order order = orderMapper.selectById(task.getOrderId());
|
|
|
+ Plan plan = planMapper.selectById(task.getPlanId());
|
|
|
+ BBom bom = bBomMapper.selectById(task.getBomId());
|
|
|
+
|
|
|
+ orderQuality.setOrderNo(order.getOrderNo());
|
|
|
+ orderQuality.setOrderId(order.getId());
|
|
|
+ orderQuality.setTaskId(task.getId());
|
|
|
+ orderQuality.setWorkpieceId(task.getCompleteBatchNo());
|
|
|
+ orderQuality.setWorkpieceName(bom.getName());
|
|
|
+ orderQuality.setProcedureId(task.getProcedureId());
|
|
|
+ orderQuality.setProcedureName(task.getProcedureName());
|
|
|
+ orderQuality.setMeasuringType(1);
|
|
|
+ orderQuality.setMeasuringReport(measuringResultFile);
|
|
|
+ orderQualityMapper.insert(orderQuality);
|
|
|
+
|
|
|
+ taskTestUnqualifiedBom.setTaskId(task.getId());
|
|
|
+ taskTestUnqualifiedBom.setTaskNo(task.getTaskNo());
|
|
|
+ taskTestUnqualifiedBom.setOrderId(order.getId());
|
|
|
+ taskTestUnqualifiedBom.setOrderNo(order.getOrderNo());
|
|
|
+ taskTestUnqualifiedBom.setPlanId(plan.getId());
|
|
|
+ taskTestUnqualifiedBom.setPlanNo(plan.getPlanNo());
|
|
|
+ taskTestUnqualifiedBom.setProcedureId(task.getProcedureId());
|
|
|
+ taskTestUnqualifiedBom.setBomId(task.getBomId());
|
|
|
+ taskTestUnqualifiedBom.setBomName(bom.getName());
|
|
|
+ taskTestUnqualifiedBom.setUniqueCode(workpiece.getUniqueCode());
|
|
|
+ taskTestUnqualifiedBom.setBomNum(1);
|
|
|
+ taskTestUnqualifiedBomMapper.insert(taskTestUnqualifiedBom);
|
|
|
+
|
|
|
+ workpieceMapper.updateById(workpiece);
|
|
|
+
|
|
|
+
|
|
|
+ if(1 == measuringResult){
|
|
|
+ logger.info("三坐标测量失败直接下料");
|
|
|
+
|
|
|
+ // 清楚当前节点工序的redis暂存值
|
|
|
+ List<TaskNode> operationTaskNodes = taskNodeService.list(Wraps.<TaskNode>lbQ().eq(TaskNode::getTaskId, taskNode.getTaskId()));
|
|
|
+ List<Long> operationTaskNodeIds = operationTaskNodes.stream().map(operationTaskNode -> operationTaskNode.getId()).collect(Collectors.toList());
|
|
|
+ for(Long operationTaskNodeId : operationTaskNodeIds){
|
|
|
+ // 清除redis里面的内容
|
|
|
+ msgUtil.redis_del(YunjianConstant.YUNJIAN_CALLBACK_PARAM + "_" + operationTaskNodeId);
|
|
|
+ msgUtil.redis_del(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_JXS + operationTaskNodeId);
|
|
|
+ msgUtil.redis_del(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_HCW + operationTaskNodeId);
|
|
|
+ msgUtil.redis_del(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_XBK_FLAG + operationTaskNodeId);
|
|
|
+ msgUtil.redis_del(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_HCW_XBK_FLAG + operationTaskNodeId);
|
|
|
+ msgUtil.redis_del(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_STORE + operationTaskNodeId);
|
|
|
+ msgUtil.redis_del(CacheKey.TASK_CURRENT_NODE + "_" + operationTaskNodeId);
|
|
|
+ }
|
|
|
|
|
|
- //获取下料工序
|
|
|
- List<BomProcedure> bomProcedureList = bomProcedureService.list(Wraps.<BomProcedure>lbQ().eq(BomProcedure::getBomId,task.getBomId()).eq(BomProcedure::getType,"下料").orderByAsc(BomProcedure::getSort));
|
|
|
- if(CollectionUtil.isNotEmpty(bomProcedureList)){
|
|
|
- //获取下料序的第一个节点
|
|
|
- List<TaskNode> taskNodes = taskNodeService.list(Wraps.<TaskNode>lbQ().eq(TaskNode::getProcedureId,bomProcedureList.get(0).getId()).eq(TaskNode::getCompleteBatchNo,task.getCompleteBatchNo()).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;
|
|
|
+ //获取下料工序
|
|
|
+ List<BomProcedure> bomProcedureList = bomProcedureService.list(Wraps.<BomProcedure>lbQ().eq(BomProcedure::getBomId,task.getBomId()).eq(BomProcedure::getType,"下料").orderByAsc(BomProcedure::getSort));
|
|
|
+ if(CollectionUtil.isNotEmpty(bomProcedureList)){
|
|
|
+ //获取下料序的第一个节点
|
|
|
+ List<TaskNode> taskNodes = taskNodeService.list(Wraps.<TaskNode>lbQ().eq(TaskNode::getProcedureId,bomProcedureList.get(0).getId()).eq(TaskNode::getCompleteBatchNo,task.getCompleteBatchNo()).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;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ }else if (zoneType.equals(ParameterKey.ZONE_YJ)){
|
|
|
+ //如果是三坐标检测
|
|
|
+// if("3".equals(nextTaskNode.getNodeType())){
|
|
|
+// // TODO 后续改成动态拼接
|
|
|
+// //组装接口参数
|
|
|
+// ZZoneProductionresource zoneProductionresource = zZoneProductionresourceMapper.selectOne(Wraps.<ZZoneProductionresource>lbQ().eq(ZZoneProductionresource::getResourceId,taskNode.getResourceId()));
|
|
|
+// long zoneId = zoneProductionresource.getZoneId();
|
|
|
+// ZZone zZone = zoneService.getById(zoneId);
|
|
|
+// Map<String, String> plcInfo = DictionaryKey.PLC_CATEGORY.get(zZone.getNo());
|
|
|
+//
|
|
|
+// HttpHeaders headers = new HttpHeaders();
|
|
|
+// headers.setContentType(MediaType.parseMediaType("application/json;charset=UTF-8"));
|
|
|
+// JSONObject jsonParam = new JSONObject();
|
|
|
+// jsonParam.put("tagname","DB200.38");
|
|
|
+// jsonParam.put("ip",plcInfo.get("url"));
|
|
|
+// HttpEntity<String> formEntity = new HttpEntity<String>(jsonParam.toJSONString(), headers);
|
|
|
+//
|
|
|
+// //动态调用接口和新增指令执行时间
|
|
|
+// plcInfo = DictionaryKey.PLC_CATEGORY.get(zZone.getNo());
|
|
|
+// String paramKey = zZone.getNo() + "_plc";
|
|
|
+// String plcUrl = (null == msgUtil.redis_get(ParameterKey.PARAMETERS)? "": ((Map<String,String>)msgUtil.redis_get(ParameterKey.PARAMETERS)).get(paramKey).toString());
|
|
|
+// // TODO 改成虚拟端口,后续删除
|
|
|
+// plcUrl = plcUrl.replace("8081","8083");
|
|
|
+//
|
|
|
+//
|
|
|
+// String instructionUrl = plcUrl + "/api/GetTagValue";
|
|
|
+// System.out.println("instructionUrl=" + instructionUrl);
|
|
|
+// System.out.println("jsonParam=" + jsonParam);
|
|
|
+// String returnData = restTemplate.postForObject(instructionUrl, formEntity, String.class);
|
|
|
+//
|
|
|
+// // TODO modify by yejian on 20220525 for 添加三坐标模拟
|
|
|
+// Random random = new Random();
|
|
|
+// Boolean measuringFlag = random.nextBoolean();
|
|
|
+//// int measuringResult = measuringFlag ? 0 : 1;
|
|
|
+// int measuringResult = 1;
|
|
|
+// String measuringResultFile = filePath + taskNode.getCompleteBatchNo() + "_" + task.getProcedureNo() + ".csv";
|
|
|
+// List<String> fileContents = new ArrayList<>();
|
|
|
+// OrderQuality orderQuality = new OrderQuality();
|
|
|
+// TTaskTestUnqualifiedBom taskTestUnqualifiedBom = new TTaskTestUnqualifiedBom();
|
|
|
+//
|
|
|
+// TWorkpiece workpiece = workpieceMapper.selectOne(Wraps.<TWorkpiece>lbQ().eq(TWorkpiece::getCompleteBatchNo,task.getCompleteBatchNo()));
|
|
|
+// logger.info("三坐标测量结果{}", measuringResult);
|
|
|
+// if(measuringResult == 0){
|
|
|
+// fileContents.add("OK");
|
|
|
+// orderQuality.setOkFlag("OK");
|
|
|
+// workpiece.setTestResult("1");
|
|
|
+// taskTestUnqualifiedBom.setTestResult("1");
|
|
|
+// }else{
|
|
|
+// fileContents.add("NG");
|
|
|
+// orderQuality.setOkFlag("NG");
|
|
|
+// workpiece.setTestResult("0");
|
|
|
+// taskTestUnqualifiedBom.setTestResult("0");
|
|
|
+// }
|
|
|
+// SmbShareFileUtil.writeShareFileContent(measuringResultFile,fileContents,userName,password,fileIp);
|
|
|
+// Order order = orderMapper.selectById(task.getOrderId());
|
|
|
+// Plan plan = planMapper.selectById(task.getPlanId());
|
|
|
+// BBom bom = bBomMapper.selectById(task.getBomId());
|
|
|
+//
|
|
|
+// orderQuality.setOrderNo(order.getOrderNo());
|
|
|
+// orderQuality.setOrderId(order.getId());
|
|
|
+// orderQuality.setTaskId(task.getId());
|
|
|
+// orderQuality.setWorkpieceId(task.getCompleteBatchNo());
|
|
|
+// orderQuality.setWorkpieceName(bom.getName());
|
|
|
+// orderQuality.setProcedureId(task.getProcedureId());
|
|
|
+// orderQuality.setProcedureName(task.getProcedureName());
|
|
|
+// orderQuality.setMeasuringType(1);
|
|
|
+// orderQuality.setMeasuringReport(measuringResultFile);
|
|
|
+// orderQualityMapper.insert(orderQuality);
|
|
|
+//
|
|
|
+// taskTestUnqualifiedBom.setTaskId(task.getId());
|
|
|
+// taskTestUnqualifiedBom.setTaskNo(task.getTaskNo());
|
|
|
+// taskTestUnqualifiedBom.setOrderId(order.getId());
|
|
|
+// taskTestUnqualifiedBom.setOrderNo(order.getOrderNo());
|
|
|
+// taskTestUnqualifiedBom.setPlanId(plan.getId());
|
|
|
+// taskTestUnqualifiedBom.setPlanNo(plan.getPlanNo());
|
|
|
+// taskTestUnqualifiedBom.setProcedureId(task.getProcedureId());
|
|
|
+// taskTestUnqualifiedBom.setBomId(task.getBomId());
|
|
|
+// taskTestUnqualifiedBom.setBomName(bom.getName());
|
|
|
+// taskTestUnqualifiedBom.setUniqueCode(workpiece.getUniqueCode());
|
|
|
+// taskTestUnqualifiedBom.setBomNum(1);
|
|
|
+// taskTestUnqualifiedBomMapper.insert(taskTestUnqualifiedBom);
|
|
|
+//
|
|
|
+// workpieceMapper.updateById(workpiece);
|
|
|
+//
|
|
|
+//
|
|
|
+// if(1 == measuringResult){
|
|
|
+// logger.info("三坐标测量失败直接下料");
|
|
|
+//
|
|
|
+// // 清楚当前节点工序的redis暂存值
|
|
|
+// List<TaskNode> operationTaskNodes = taskNodeService.list(Wraps.<TaskNode>lbQ().eq(TaskNode::getTaskId, taskNode.getTaskId()));
|
|
|
+// List<Long> operationTaskNodeIds = operationTaskNodes.stream().map(operationTaskNode -> operationTaskNode.getId()).collect(Collectors.toList());
|
|
|
+// for(Long operationTaskNodeId : operationTaskNodeIds){
|
|
|
+// // 清除redis里面的内容
|
|
|
+// msgUtil.redis_del(YunjianConstant.YUNJIAN_CALLBACK_PARAM + "_" + operationTaskNodeId);
|
|
|
+// msgUtil.redis_del(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_JXS + operationTaskNodeId);
|
|
|
+// msgUtil.redis_del(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_HCW + operationTaskNodeId);
|
|
|
+// msgUtil.redis_del(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_XBK_FLAG + operationTaskNodeId);
|
|
|
+// msgUtil.redis_del(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_HCW_XBK_FLAG + operationTaskNodeId);
|
|
|
+// msgUtil.redis_del(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_STORE + operationTaskNodeId);
|
|
|
+// msgUtil.redis_del(CacheKey.TASK_CURRENT_NODE + "_" + operationTaskNodeId);
|
|
|
+// }
|
|
|
+//
|
|
|
+// //获取下料工序
|
|
|
+// List<BomProcedure> bomProcedureList = bomProcedureService.list(Wraps.<BomProcedure>lbQ().eq(BomProcedure::getBomId,task.getBomId()).eq(BomProcedure::getType,"下料").orderByAsc(BomProcedure::getSort));
|
|
|
+// if(CollectionUtil.isNotEmpty(bomProcedureList)){
|
|
|
+// //获取下料序的第一个节点
|
|
|
+// List<TaskNode> taskNodes = taskNodeService.list(Wraps.<TaskNode>lbQ().eq(TaskNode::getProcedureId,bomProcedureList.get(0).getId()).eq(TaskNode::getCompleteBatchNo,task.getCompleteBatchNo()).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;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }else if ("5".equals(nextTaskNode.getNodeType())){
|
|
|
+// // 工件坐标系检测
|
|
|
+// String measuringResultFile = filePath + taskNode.getCompleteBatchNo() + "_" + task.getProcedureNo() + ".xlxs";
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
//如果切换成了手动档,则只把当前工序走完
|