|
@@ -212,14 +212,19 @@ public class TaskWorkNode {
|
|
|
|
|
|
//业务类型-1、是普通的节点类型,2-是线边库轮询 6-刀具节点类型的节点类型
|
|
|
String bizType = jsonObject.getString("bizType");
|
|
|
+
|
|
|
if("6".equals(bizType)){
|
|
|
+
|
|
|
//当前节点为刀具任务
|
|
|
ToolTaskExecute toolTaskExecute = toolTaskExecuteService.getById(taskNodeId);
|
|
|
if(toolTaskExecute == null){
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- ToolNodeOperationService toolNodeOperationService = new ToolRobotNodeServiceImpl();
|
|
|
+ ToolNodeOperationService toolNodeOperationService = MsgUtil.getBean(ToolRobotNodeServiceImpl.class);
|
|
|
+ if (jsonObject.containsKey(toolTaskExecute.getId() + "count")) {
|
|
|
+ conMap.put(toolTaskExecute.getId() + "count", jsonObject.getString(toolTaskExecute.getId() + "count"));
|
|
|
+ }
|
|
|
toolNodeOperationService.checkCondition(toolTaskExecute,conMap);
|
|
|
}else{
|
|
|
//判断是否存在优先级
|
|
@@ -230,28 +235,38 @@ public class TaskWorkNode {
|
|
|
throw new InterruptedException("存在优先任务:"+priorityTaskNodeId+",当前消息重新进入队尾");
|
|
|
}
|
|
|
}*/
|
|
|
+ //判断是否存在刀具优先执行标识
|
|
|
+ Object toolPriorityExecute = msgUtil.redis_get("TOOL_PRIORITY_EXECUTE");//刀具优先执行标识
|
|
|
+ if(!Objects.isNull(toolPriorityExecute) && "2".equals(toolPriorityExecute.toString())){
|
|
|
+ logger.info("存在刀具优先执行标识");
|
|
|
+ throw new InterruptedException("存在刀具优先执行标识,消息重新进入队尾");
|
|
|
+ }
|
|
|
|
|
|
taskNode = taskNodeService.getById(taskNodeId);
|
|
|
|
|
|
if(null == taskNode){
|
|
|
return;
|
|
|
}
|
|
|
+ if ("04".equals(taskNode.getInterfaceType())&&!"3".equals(bizType)) {
|
|
|
+ //直接跳过
|
|
|
+ }else{
|
|
|
+ boolean changeFlag = this.checkRobotHand(DictionaryKey.CARRY_TYPE.get("TRAY_HAND")); //更换机器人手抓标识
|
|
|
+ if(changeFlag){
|
|
|
+ //需要更新机器人手抓
|
|
|
+ msgUtil.redis_set("CHANGE_HAND_OP","2");
|
|
|
+ msgUtil.redis_set("CHANGE_TARGET_HAND",DictionaryKey.CARRY_TYPE.get("TRAY_HAND"));
|
|
|
+ try{
|
|
|
+ this.changeRobotHand(taskNode);
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }finally {
|
|
|
+ //当前任务回到队尾
|
|
|
+ throw new InterruptedException("设备资源不通过,消息重新进入队尾");
|
|
|
+ }
|
|
|
|
|
|
- boolean changeFlag = this.checkRobotHand(DictionaryKey.CARRY_TYPE.get("TRAY_HAND")); //更换机器人手抓标识
|
|
|
- if(changeFlag){
|
|
|
- //需要更新机器人手抓
|
|
|
- msgUtil.redis_set("CHANGE_HAND_OP","2");
|
|
|
- msgUtil.redis_set("CHANGE_TARGET_HAND",DictionaryKey.CARRY_TYPE.get("TRAY_HAND"));
|
|
|
- try{
|
|
|
- this.changeRobotHand(taskNode);
|
|
|
- }catch (Exception e){
|
|
|
- e.printStackTrace();
|
|
|
- }finally {
|
|
|
- //当前任务回到队尾
|
|
|
- throw new InterruptedException("设备资源不通过,消息重新进入队尾");
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
+
|
|
|
// add by yejian on 20220726 使用完成后释放redis资源
|
|
|
if(taskNode.getCompleteBatchSort() != 1){
|
|
|
TaskNode beforTaskNode = taskNodeService.getNextNTaskNode(taskNode, -1);
|
|
@@ -678,6 +693,13 @@ public class TaskWorkNode {
|
|
|
map.put("destLocation",DictionaryKey.ROBOT_PONIT.get("CHANGE_HAND"));
|
|
|
jsonObject.put("data", map);
|
|
|
|
|
|
+ //换手抓
|
|
|
+ JSONObject callBackParam = new JSONObject();
|
|
|
+ callBackParam.put(DemoLineConstant.DEMOLINE_STOCK_TYPE + "_" + taskNode.getId(),DemoLineConstant.TASK_TYPE_CHANGE);
|
|
|
+ callBackParam.put(taskNode.getId() + "HAND_TYPE",DictionaryKey.CARRY_TYPE.get("TRAY_HAND"));
|
|
|
+ //回调参数
|
|
|
+ msgUtil.redis_set(YunjianConstant.TOOL_CALLBACK_PARAM + "_" + taskNode.getId(),callBackParam.toString(),10,TimeUnit.DAYS);
|
|
|
+
|
|
|
//msgUtil.httpForPost("http://192.168.10.150",jsonObject.toString());
|
|
|
}
|
|
|
|
|
@@ -1181,7 +1203,7 @@ public class TaskWorkNode {
|
|
|
dataMap.put("toStorge", hcwStorge);
|
|
|
dataMap.put("result", true);
|
|
|
}
|
|
|
- if (count == 3) {
|
|
|
+ if (count == 4) {
|
|
|
// begin add by yejian on 20220819 for 将机器人上的缓存位利用历来:如果缓存位数量n-1 >= 1,则可以将工件不放到线边库,直接放在缓存位上暂存后轮训线边库逻辑
|
|
|
TaskNode beforTaskNode = taskNodeService.getNextNTaskNode(taskNode,-1);
|
|
|
String targetHcwXbk =(String)msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_HCW_XBK_FLAG + taskNode.getId());
|