|
@@ -229,6 +229,7 @@ public class TaskWorkNode {
|
|
|
}
|
|
|
|
|
|
taskNode = taskNodeService.getById(taskNodeId);
|
|
|
+ if(null == taskNode || taskNode.getTaskId() == null) return;
|
|
|
String repeatKey = taskNodeId + taskNode.getTaskId();
|
|
|
String cacheUid = msgUtil.redis_get(repeatKey) == null ? "" : msgUtil.redis_get(repeatKey).toString();
|
|
|
if(StringUtils.isNotEmpty(cacheUid)){
|
|
@@ -244,7 +245,7 @@ public class TaskWorkNode {
|
|
|
}
|
|
|
|
|
|
//丢弃节点
|
|
|
- if(null == taskNode || taskNode.getExeStatus().equals("3")){
|
|
|
+ if(taskNode.getExeStatus().equals("3")){
|
|
|
String key = "PRIORITY_" + consumerQueue.toUpperCase().replace(".", "_");
|
|
|
if(priority > 0) {
|
|
|
msgUtil.redis_remove_list(key, taskNodeId+"_"+priority);
|
|
@@ -329,18 +330,10 @@ public class TaskWorkNode {
|
|
|
}
|
|
|
logger.info("=======================" + taskNodeId);
|
|
|
|
|
|
- //
|
|
|
- if (taskNode == null || taskNode.getTaskId() == null) {
|
|
|
- //模拟处理数据
|
|
|
- log.setExeResult("0").setManual("0").setFeedback("当前任务节点为空");
|
|
|
- autoNodeLogService.save(log);
|
|
|
- throw new RuntimeException("节点参数异常");
|
|
|
- }
|
|
|
-
|
|
|
if (tTask == null || tTask.getStatus() == "3") {
|
|
|
log.setTaskNodeId(taskNode.getId()).setExeResult("0").setManual("0").setFeedback("当前任务为空");
|
|
|
autoNodeLogService.save(log);
|
|
|
- throw new RuntimeException("节点参数异常");
|
|
|
+ return;
|
|
|
}
|
|
|
// //获取配置序数据
|
|
|
//任务初始化判断
|
|
@@ -396,12 +389,12 @@ public class TaskWorkNode {
|
|
|
autoNodeLogService.updateAllById(autoNodeLog);
|
|
|
}
|
|
|
//自定义订单后续处理
|
|
|
- if(order.getSingleTaskFlag().equals("1")){
|
|
|
+ if(order.getSingleTaskFlag().equals("1") && order.getHasMaterial().equals("0")){
|
|
|
OrderTask orderTask = orderTaskService.getOne(new LbqWrapper<OrderTask>().eq(OrderTask::getOrderId, order.getId()).last("limit 1"));
|
|
|
taskNodeService.remove(new LbqWrapper<TaskNode>().eq(TaskNode::getCompleteBatchNo, taskNode.getCompleteBatchNo()));
|
|
|
taskMapper.deleteById(tTask.getId());
|
|
|
workpieceService.removeById(currWorkpiece.getId());
|
|
|
- planMapper.deleteById(order.getPlanId());
|
|
|
+ planMapper.deleteById(plan.getId());
|
|
|
orderMapper.deleteById(order.getId());
|
|
|
if(StringUtils.isNotEmpty(orderTask.getConfBatchNo())){
|
|
|
//删除自动生成零件库位信息
|
|
@@ -528,30 +521,6 @@ public class TaskWorkNode {
|
|
|
}
|
|
|
msgUtil.pushToNextMq(taskNode,3);
|
|
|
}else{
|
|
|
- /**
|
|
|
- String zoneType = (null == msgUtil.redis_get(ParameterKey.PARAMETERS)? "": ((Map<String,String>)msgUtil.redis_get(ParameterKey.PARAMETERS)).get(ParameterKey.ZONE_TYPE).toString());
|
|
|
- if(zoneType.equals(ParameterKey.ZONE_YJ)){
|
|
|
- if("3".equals(taskNode.getNodeType()) || "5".equals(taskNode.getNodeType())){
|
|
|
- // 云箭三坐标启动不由总控系统发起,节点跳过执行
|
|
|
- specialCallBackMyselfFlag = true;
|
|
|
- String jsonParam = getRequestParam(conMap);
|
|
|
- //缓存执行当前节点传参
|
|
|
- msgUtil.redis_set(CacheKey.TASK_CURRENT_NODE_PARAMS + "_" + taskNode.getId(), jsonParam);
|
|
|
- JSONObject ret = new JSONObject();
|
|
|
- ret.put("result","true");
|
|
|
- returnData = ret.toJSONString();
|
|
|
- }
|
|
|
- }
|
|
|
- if(resourceBusiness.getName().indexOf("三坐标")>-1 && "SendServoStacker".equals(method)){
|
|
|
- // 判断三坐标质检或者三坐标偏置量检测 假放节点
|
|
|
- specialCallBackMyselfFlag = true;
|
|
|
- String jsonParam = getRequestParam(conMap);
|
|
|
- //缓存执行当前节点传参
|
|
|
- msgUtil.redis_set(CacheKey.TASK_CURRENT_NODE_PARAMS + "_" + taskNode.getId(), jsonParam);
|
|
|
- JSONObject ret = new JSONObject();
|
|
|
- ret.put("result","true");
|
|
|
- returnData = ret.toJSONString();
|
|
|
- }else **/
|
|
|
|
|
|
String jsonObjectE = conMap.containsKey("data") ? conMap.get("data").toString() : "";
|
|
|
if("打标业务".equals(resourceBusiness.getName()) && "SendServoStacker".equals(method)){
|
|
@@ -652,12 +621,14 @@ public class TaskWorkNode {
|
|
|
if(concurrency.equals("false")) {
|
|
|
//机床程序上传连续失败处理
|
|
|
if(isUpload.equals("true")){
|
|
|
- int uploadFailCount = (Integer) msgUtil.redis_get(CacheKey.TASK_UPLOAD_FAIL_COUNT+"_"+taskNode.getId());
|
|
|
- if(ObjectUtil.isEmpty(uploadFailCount)){
|
|
|
+ int uploadFailCount = 0;
|
|
|
+ Object uploadFailCountStr = msgUtil.redis_get(CacheKey.TASK_UPLOAD_FAIL_COUNT+"_"+taskNode.getId());
|
|
|
+ if(ObjectUtil.isEmpty(uploadFailCountStr)){
|
|
|
msgUtil.redis_set(CacheKey.TASK_UPLOAD_FAIL_COUNT+"_"+taskNode.getId(),0, 7, TimeUnit.DAYS);
|
|
|
}else{
|
|
|
+ uploadFailCount = (Integer)uploadFailCountStr;
|
|
|
if(uploadFailCount < 5){
|
|
|
- msgUtil.redis_set(CacheKey.TASK_UPLOAD_FAIL_COUNT+"_"+taskNode.getId(),uploadFailCount++, 7, TimeUnit.DAYS);
|
|
|
+ msgUtil.redis_set(CacheKey.TASK_UPLOAD_FAIL_COUNT+"_"+taskNode.getId(), ++uploadFailCount, 7, TimeUnit.DAYS);
|
|
|
}else{
|
|
|
//执行失败超过5次 直接改成暂存状态
|
|
|
taskNode.setExeStatus("4");
|