|
@@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.json.JSONArray;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.github.zuihou.authority.dto.priority.TaskNodePriorityDto;
|
|
|
import com.github.zuihou.business.DemoLine.DemoCacheKey;
|
|
|
import com.github.zuihou.business.DemoLine.DemoLineConstant;
|
|
@@ -527,7 +528,7 @@ public class MsgUtil implements ApplicationContextAware {
|
|
|
jsonObject.put("bizType", BizConstant.MQ_TASK_NODE_TYPE_COMMON);
|
|
|
//机床刀具任务缓存处理
|
|
|
Object cutToolAction = msgUtil.redis_get(DemoLineConstant.DEMOLINE_CUT_DEVICE_ACTION);
|
|
|
- if(ObjectUtil.isEmpty(cutToolAction)&& cutToolAction.toString().equals(taskNode.getId().toString())){
|
|
|
+ if(ObjectUtil.isNotEmpty(cutToolAction)&& cutToolAction.toString().equals(taskNode.getId().toString())){
|
|
|
msgUtil.redis_del(DemoLineConstant.DEMOLINE_CUT_DEVICE_ACTION);
|
|
|
}
|
|
|
if(callBackJson.containsKey(YunjianConstant.YUNJIAN_ROBORT_CACHE_FLAG)){//带缓存位机器人的多步骤执行
|
|
@@ -580,7 +581,7 @@ public class MsgUtil implements ApplicationContextAware {
|
|
|
logger.warn("【节点任务放入MQ】节点id:{}",nextTaskNode);
|
|
|
TaskNode nextNextNode = taskNodeService.getNextNTaskNode(nextTaskNode, 1);
|
|
|
boolean bool = nextTaskNode.getTargetResourceId()==null && nextNextNode!=null && nextNextNode.getTargetResourceId()!=null ;
|
|
|
- if(!"1".equals(taskNode.getNodeType()) && "0".equals(nextTaskNode.getNodeType())){
|
|
|
+ if(!"1".equals(taskNode.getNodeType()) && "0".equals(nextTaskNode.getNodeType()) && nextNextNode!=null){
|
|
|
Productionresource productionresource = productionresourceBizMapper.selectById(nextNextNode.getTargetResourceId());
|
|
|
if(bool && StringUtil.isNotEmpty(productionresource.getModeSpecification())){
|
|
|
addPriorityList(nextTaskNode);
|
|
@@ -714,10 +715,24 @@ public class MsgUtil implements ApplicationContextAware {
|
|
|
* @param method
|
|
|
*/
|
|
|
public void createWarnLog(String content, String method){
|
|
|
- AAutoNodeLog autoNodeLog = AAutoNodeLog.builder().build();
|
|
|
- autoNodeLog.setStatus("0").setManual("1").setExeStatus("2").setMethod(method).setExecuteTime(new Date())
|
|
|
- .setExeResult("0").setFeedback(content);
|
|
|
- autoNodeLogService.save(autoNodeLog);
|
|
|
+ LambdaQueryWrapper<AAutoNodeLog> lbqWrapper = new LambdaQueryWrapper<AAutoNodeLog>();
|
|
|
+ lbqWrapper.eq(AAutoNodeLog::getStatus, "0").eq(AAutoNodeLog::getExeStatus, "2").eq(AAutoNodeLog::getManual, "1")
|
|
|
+ .eq(AAutoNodeLog::getMethod, method).eq(AAutoNodeLog::getExeResult, "0").eq(AAutoNodeLog::getFeedback, content);
|
|
|
+ AAutoNodeLog exist = autoNodeLogService.getOne(lbqWrapper);
|
|
|
+ if(null == exist) {
|
|
|
+ AAutoNodeLog autoNodeLog = AAutoNodeLog.builder().build();
|
|
|
+ autoNodeLog.setStatus("0").setManual("1").setExeStatus("2").setMethod(method).setExeResult("0").setFeedback(content);
|
|
|
+ autoNodeLog.setExecuteTime(new Date());
|
|
|
+ if(method.contains("Exception") || method.contains("Warn")){
|
|
|
+ //数据异常默认归类到保障中心异常
|
|
|
+ ZZone zone = zoneService.getOne(Wraps.<ZZone>lbQ().eq(ZZone::getNo, "safeguard").last("limit 1"));
|
|
|
+ autoNodeLog.setZoneId(zone.getId());
|
|
|
+ }
|
|
|
+ autoNodeLogService.save(autoNodeLog);
|
|
|
+ }else{
|
|
|
+ exist.setExecuteTime(new Date());
|
|
|
+ autoNodeLogService.updateAllById(exist);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public void pushDetailTask(TTask task) {
|