Forráskód Böngészése

Merge remote-tracking branch 'origin/master' into master

yejian 3 éve
szülő
commit
a0417fc0a4

+ 3 - 4
imcs-admin-boot/imcs-authority-server/src/main/java/com/github/zuihou/job/DashboardJob.java

@@ -147,10 +147,9 @@ public class DashboardJob {
             LbqWrapper<AAutoNodeLog> warnWrapper = warnWrap.lambda();
             //Date start = new Date();
             //警报弹框只执行一次
-            //返回还未处理、执行状态为失败,并且还未推送的日志记录
-            warnWrapper.eq(AAutoNodeLog::getExeResult,"0").eq(AAutoNodeLog::getStatus,"0")
-                    //.eq(AAutoNodeLog::getSendStatus,"0")
-                    .orderByDesc(AAutoNodeLog::getCreateTime);
+            //返回还未处理、执行状态为失败、需要人工处理,并且还未推送的日志记录
+            warnWrapper.eq(AAutoNodeLog::getExeResult,"0").eq(AAutoNodeLog::getStatus,"0").eq(AAutoNodeLog::getManual, "1")
+                       .orderByDesc(AAutoNodeLog::getCreateTime);
             IPage<AAutoNodeLog> warnData = autoNodeLogService.pageList(new Page<AAutoNodeLog>(1L, 5), warnWrapper);
 
             Map warnMap = Maps.newHashMap();

+ 2 - 2
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/edgeLibrary/service/impl/StockInfoServiceImpl.java

@@ -385,8 +385,8 @@ public class StockInfoServiceImpl extends SuperServiceImpl<StockInfoMapper, Stoc
         StockInfo infoBean = new StockInfo();
         infoBean.setStorgeId(storgeId);
         infoBean.setLockStatus("1");
-        infoBean.setGoodsId(bomProcedureMeterial.getMeterialSpeId());
-        infoBean.setSpecId(bomProcedureMeterial.getMeterialSpeId());
+        infoBean.setGoodsId(bomProcedureMeterial.getMeterialId());
+        infoBean.setSpecId(bomProcedureMeterial.getMeterialId());
         infoBean.setGoodsType("1");
         infoBean.setNum(1);
         infoBean.setCompleteBatchNo(completeBatchNo);

+ 34 - 13
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/mq/TaskWorkNode.java

@@ -7,6 +7,10 @@ import com.github.zuihou.base.R;
 import com.github.zuihou.business.DemoLine.DemoCacheKey;
 import com.github.zuihou.business.DemoLine.DemoLineConstant;
 import com.github.zuihou.business.DemoLine.YunjianConstant;
+import com.github.zuihou.business.dispatchRecord.entity.DispatchException;
+import com.github.zuihou.business.dispatchRecord.entity.DispatchRecord;
+import com.github.zuihou.business.dispatchRecord.service.DispatchExceptionService;
+import com.github.zuihou.business.dispatchRecord.service.DispatchRecordService;
 import com.github.zuihou.business.edgeLibrary.dao.StockInfoMapper;
 import com.github.zuihou.business.edgeLibrary.dao.StorgeMapper;
 import com.github.zuihou.business.edgeLibrary.entity.StockInfo;
@@ -48,6 +52,8 @@ import com.github.zuihou.context.BaseContextHandler;
 import com.github.zuihou.database.mybatis.conditions.Wraps;
 import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
 import com.github.zuihou.database.mybatis.conditions.query.QueryWrap;
+import com.github.zuihou.exception.BizException;
+import com.github.zuihou.msgs.service.MsgsCenterInfoService;
 import com.github.zuihou.tenant.entity.Module;
 import com.github.zuihou.tenant.entity.ModuleInstruction;
 import com.github.zuihou.tenant.service.ModuleInstructionService;
@@ -142,6 +148,7 @@ public class TaskWorkNode {
     @Autowired
     private BBomMapper bBomMapper;
 
+
     //总控端口
     private final String ZK_port = "120";
 
@@ -153,6 +160,7 @@ public class TaskWorkNode {
 
     public void updateTaskStatusJob(String data) throws InterruptedException {
         JSONObject jsonObject = JSONObject.parseObject(data);
+        System.out.println("返回请求数据: "+data);
         String taskNodeId = jsonObject.getString("taskNodeId");
         //业务类型-1、是普通的节点类型,2-是线边库轮询
         String bizType = jsonObject.getString("bizType");
@@ -160,7 +168,7 @@ public class TaskWorkNode {
         //多产品搬运类型
         String carryType = jsonObject.getString("carryType");
         if(StringUtil.isEmpty(taskNodeId) || StringUtil.isEmpty(bizType)){
-            throw new InterruptedException("数据传输有误");
+            throw new InterruptedException("全局通知异常");
         }
         logger.info("=======================" + taskNodeId);
         BaseContextHandler.setTenant("0000");
@@ -168,11 +176,12 @@ public class TaskWorkNode {
         TaskNode taskNode = taskNodeService.getById(taskNodeId);
 //
         if (taskNode == null || taskNode.getTaskId()== null) {
-            throw new InterruptedException("当前任务节点为空");
+            //模拟处理数据
+            throw new BizException(-1, "当前任务节点为空");
         }
         TTask tTask = taskMapper.selectById(taskNode.getTaskId());
         if (tTask == null || tTask.getStatus() == "3") {
-            throw new InterruptedException("当前任务为空");
+            throw new BizException(-1, "当前任务为空");
         }
 //        //获取配置序数据
         //任务初始化判断
@@ -234,6 +243,7 @@ public class TaskWorkNode {
                 queryMap.put("zone",zZone);
                 //运行条件验证
                 Map conMap = checkCon(taskNode, tTask, queryMap);
+                msgUtil.redis_set_map(CacheKey.TASK_CURRENT_NODE_CONDITION+ "_" + taskNode.getId(), conMap);
 
                 if("03".equals(taskNode.getInterfaceType())){
                     TaskNode beforTaskNode = taskNodeService.getNextNTaskNode(taskNode,-1);
@@ -249,34 +259,45 @@ public class TaskWorkNode {
                     HttpHeaders headers = new HttpHeaders();
                     headers.setContentType(MediaType.parseMediaType("application/json;charset=UTF-8"));
                     String jsonParam = getRequestParam(conMap);
+                    //缓存执行当前节点传参
+                    msgUtil.redis_set(CacheKey.TASK_CURRENT_NODE_PARAMS+"_" + taskNode.getId(), jsonParam);
                     HttpEntity<String> formEntity = new HttpEntity<String>(jsonParam, headers);
-                    //动态调用接口
+
+                    //动态调用接口和新增指令执行时间
+                    log.setMethod(conMap.get("method").toString()).setExecuteTime(new Date());
                     String instructionUrl = DictionaryKey.INSTRUCTION_URL +"/api/"+ conMap.get("method").toString() ;
                     logger.info("instructionUrl=", instructionUrl);
                     logger.info("jsonParam=", jsonParam);
                     returnData = restTemplate.postForObject(instructionUrl, formEntity, String.class);
+
                     logger.info("returnData=", returnData);
                 }
             }
-        } catch (Exception e) {
+        } catch (BizException e) {
             e.printStackTrace();
             JSONObject errJsonObject = new JSONObject();
+            errJsonObject.put("code", "2");
             errJsonObject.put("msg", e.getMessage());
             returnData = errJsonObject.toJSONString();
             logger.error("调用接口发生异常" + e.getMessage());
-            log.setExeResult("0").setFeedback(e.getMessage());
         }
         logger.info("===============================接口返回" + returnData);
         JSONObject retJson = JSONObject.parseObject(returnData);
-//        if(jsonObject.getString("Code").trim() == "1") {
+        String code = retJson.getString("code").trim();
+        if(code == "1") {
             //回调处理
-
             taskNode.setExeStatus("3").setEndTime(new Date()).setExeResult("1");
             taskNodeService.updateAllById(taskNode);
-            log.setExeStatus("3").setEndTime(new Date()).setExeResult("1");
-//        }else{
-//            log.setExeResult("0").setFeedback(jsonObject.getString("Msg"));
-//        }
+            log.setExeStatus("3").setEndTime(new Date()).setExeResult("1").setFeedback("");
+            msgUtil.redis_del(CacheKey.TASK_CURRENT_NODE_CONDITION + "_" + taskNode.getId());
+            msgUtil.redis_del(CacheKey.TASK_CURRENT_NODE_PARAMS + "_" + taskNode.getId());
+        }else if(code == "0"){
+            //需要人工处理解决警报异常
+            log.setExeResult("0").setManual("1").setFeedback(retJson.getString("msg"));
+        }else if(code == "2"){
+            //执行异常处理(无须人工处理和警报提示)
+            log.setExeResult("0").setManual("0").setFeedback(retJson.getString("msg"));
+        }
         if(log.getId()==null){
             autoNodeLogService.save(log);
         }else{
@@ -392,7 +413,7 @@ public class TaskWorkNode {
      * @return
      * @throws Exception
      */
-     public Map checkCon(TaskNode taskNode, TTask task, Map<String, Object> dataMap) throws Exception {
+     public Map checkCon(TaskNode taskNode, TTask task, Map<String, Object> dataMap) throws BizException, InterruptedException {
         Map map = getCheckCon(taskNode, task, dataMap);
         boolean b = (boolean) map.get("result");
         if (!b) {

+ 8 - 6
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/impl/RobotNodeServiceImpl.java

@@ -314,26 +314,26 @@ public class RobotNodeServiceImpl implements NodeOperationService {
             case "柔性线机器人":
                 //操作柔性线边库 具有取、移动、放三种指令
                 //取放加工设备  设备存在缓存位
-                map = this.commandHandle(map, currStore,flikustockInfos,functionName);
+                map = this.commandHandle(map,flikustockInfos,functionName);
                 map.put("deviceUrl", ZK_ip_rxx);
                 break;
             case "智能单元机器人":
                 //操作智能单元线边库 具有取、移动、放三种指令
                 //取放加工设备 无缓存位处理
-                map = this.commandHandle(map, currStore , flikustockInfos,functionName);
+                map = this.commandHandle(map , flikustockInfos,functionName);
                 map.put("deviceUrl", ZK_ip_zndy);
                 break;
             case "舱体类加工单元":
                 //操作舱体线边库 具有取、移动、放三种指令
                 //取放加工设备
-                map = this.commandHandle(map, currStore,flikustockInfos, functionName);
+                map = this.commandHandle(map,flikustockInfos, functionName);
                 break;
             case "智能生产保障系统":
-                map = this.commandHandle(map, currStore,flikustockInfos, functionName);
+                map = this.commandHandle(map,flikustockInfos, functionName);
                 map.put("deviceUrl", ZK_ip_rxx);
                 break;
             case "框体类加工单元":
-                map = this.commandHandle(map, currStore,flikustockInfos, functionName);
+                map = this.commandHandle(map,flikustockInfos, functionName);
                 map.put("deviceUrl", ZK_ip_rxx);
                 break;
         }
@@ -362,10 +362,12 @@ public class RobotNodeServiceImpl implements NodeOperationService {
     }
 
     //机器人功能操作
-    private Map<String, Object>  commandHandle(Map<String, Object> dataMap, Storge startStore,List<StockInfo>flikustockInfos, String functionName){
+    private Map<String, Object>  commandHandle(Map<String, Object> dataMap, List<StockInfo>flikustockInfos, String functionName){
         TaskNode taskNode = (TaskNode) dataMap.get("taskNode");
         TTask task = (TTask) dataMap.get("task");
         int count = Integer.parseInt(dataMap.get(taskNode.getId().toString() + "count") == null ? "0" : dataMap.get(taskNode.getId().toString() + "count").toString());
+
+        Storge startStore = workpieceService.getWorkPieceStock(taskNode.getCompleteBatchNo(), false);
         //目的库位
         Storge jqrStorge = null;
         //缓存位判断处理

+ 8 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/util/MsgUtil.java

@@ -169,4 +169,12 @@ public class MsgUtil implements ApplicationContextAware {
             redisTemplate.delete(key);
         }
     }
+
+    public void redis_set_map(String key, Map<String, Object> map){
+        redisTemplate.opsForHash().putAll(key,  map);
+    }
+
+    public Map redis_get_map(String key){
+        return redisTemplate.opsForHash().entries(key);
+    }
 }

+ 3 - 1
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/productionReadyCenter/AAutoNodeLogMapper.xml

@@ -16,12 +16,14 @@
         <result column="end_time" jdbcType="TIMESTAMP" property="endTime"/>
         <result column="feedback" jdbcType="VARCHAR" property="feedback"/>
         <result column="status" jdbcType="VARCHAR" property="status"/>
+        <result column="method" jdbcType="VARCHAR" property="method"/>
+        <result column="execute_time" jdbcType="TIMESTAMP" property="executeTime"/>
         <result column="feedback_file" jdbcType="VARCHAR" property="feedbackFile"/>
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id,create_time ,create_user,update_time,update_user,
+        id,create_time ,create_user,update_time,update_user,method, execute_time,
         auto_node_id, exe_status, exe_result, start_time, end_time, feedback, feedback_file, status, resourceName,instructionName,procedureName,nodeNo
     </sql>
 

+ 91 - 17
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/dispatchRecord/DispatchExceptionController.java

@@ -3,7 +3,10 @@ package com.github.zuihou.business.controller.dispatchRecord;
 import cn.hutool.core.collection.CollUtil;
 import cn.hutool.core.util.ReflectUtil;
 import cn.hutool.core.util.StrUtil;
+import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.zuihou.base.R;
 import com.github.zuihou.base.controller.SuperSimpleController;
@@ -13,8 +16,15 @@ import com.github.zuihou.business.dispatchRecord.entity.DispatchRecord;
 import com.github.zuihou.business.dispatchRecord.service.DispatchExceptionService;
 import com.github.zuihou.business.dispatchRecord.service.DispatchRecordService;
 import com.github.zuihou.business.operationManagementCenter.entity.Order;
+import com.github.zuihou.business.operationManagementCenter.entity.TWorkpiece;
+import com.github.zuihou.business.operationManagementCenter.service.WorkpieceService;
 import com.github.zuihou.business.productionReadyCenter.entity.AAutoNodeLog;
+import com.github.zuihou.business.productionReadyCenter.service.AAutoNodeLogService;
+import com.github.zuihou.business.util.MsgUtil;
+import com.github.zuihou.common.constant.CacheKey;
+import com.github.zuihou.common.constant.DictionaryKey;
 import com.github.zuihou.common.util.DateUtil;
+import com.github.zuihou.context.BaseContextHandler;
 import com.github.zuihou.database.mybatis.conditions.Wraps;
 import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
 import com.github.zuihou.database.mybatis.conditions.query.QueryWrap;
@@ -24,16 +34,21 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.client.RestTemplate;
 
+import java.lang.invoke.MethodType;
 import java.lang.reflect.Field;
+import java.lang.reflect.Method;
 import java.time.LocalDateTime;
 import java.util.Date;
 import java.util.Iterator;
+import java.util.List;
 import java.util.Map;
 
 @Slf4j
@@ -42,26 +57,40 @@ import java.util.Map;
 @RequestMapping("/dispatchException")
 @Api(value = "dispatchException", tags = "调度异常")
 @SysLog(enabled = true)
-public class DispatchExceptionController extends SuperSimpleController<DispatchExceptionService, DispatchException> {
+public class DispatchExceptionController extends SuperSimpleController<AAutoNodeLogService, AAutoNodeLog> {
 
-    @ApiOperation(value = "查询设备刀具管理", notes = "查询设备刀具管理")
+    @Autowired
+    private AAutoNodeLogService aAutoNodeLogService;
+
+    @Autowired
+    private WorkpieceService workpieceService;
+
+    @Autowired
+    private MsgUtil msgUtil;
+
+    @Autowired
+    private RestTemplate restTemplate;
+
+    @ApiOperation(value = "查询对话调度异常", notes = "查询对话调度异常")
     @PostMapping("/page")
-    public R<IPage<DispatchException>> page(@RequestBody @Validated PageParams<DispatchException> params) {
-        IPage<DispatchException> page = params.buildPage();
-        QueryWrap<DispatchException> wrap = handlerWrapper(null, params);
-        LbqWrapper<DispatchException> wrapper = wrap.lambda();
-        wrapper.like(DispatchException::getName, params.getModel().getName())
+    public R<IPage<AAutoNodeLog>> page(@RequestBody @Validated PageParams<AAutoNodeLog> params) {
+        IPage<AAutoNodeLog> page = params.buildPage();
+        QueryWrap<AAutoNodeLog> wrap = handlerWrapper(null, params);
+        LbqWrapper<AAutoNodeLog> wrapper = wrap.lambda();
+        wrapper.like(AAutoNodeLog::getInstructionName, params.getModel().getInstructionName())
                 //.geHeader(DispatchException::getOperationTime, StrUtil.isEmpty(params.getModel().getOperationTime_st())?null: LocalDateTime.parse(params.getModel().getOperationTime_st()))
-                .ge(DispatchException::getOperationTime, DateUtil.stringToDate3(params.getModel().getOperationTime_st()))
-                .le(DispatchException::getOperationTime, DateUtil.stringToDate3(params.getModel().getOperationTime_ed()))
+                .ge(AAutoNodeLog::getExecuteTime, DateUtil.stringToDate3(params.getModel().getExecuteTime_st()))
+                .le(AAutoNodeLog::getExecuteTime, DateUtil.stringToDate3(params.getModel().getExecuteTime_ed()))
 //                .leFooter(DispatchException::getOperationTime, StrUtil.isEmpty(params.getModel().getOperationTime_ed())?null:LocalDateTime.parse(params.getModel().getOperationTime_ed()))
-                .orderByDesc(DispatchException::getCreateTime);
-        baseService.page(page, wrapper);
+                .orderByDesc(AAutoNodeLog::getCreateTime);
+        //查询弹框异常
+        wrapper.eq(AAutoNodeLog::getExeResult,"0").eq(AAutoNodeLog::getManual, "1").eq(AAutoNodeLog::getStatus, "0");
+        aAutoNodeLogService.page(page, wrapper);
         return this.success(page);
     }
 
-    private QueryWrap<DispatchException> handlerWrapper(DispatchException model, PageParams<DispatchException> params) {
-       QueryWrap<DispatchException> wrapper = model == null ? Wraps.q() : Wraps.q(model);
+    private QueryWrap<AAutoNodeLog> handlerWrapper(AAutoNodeLog model, PageParams<AAutoNodeLog> params) {
+       QueryWrap<AAutoNodeLog> wrapper = model == null ? Wraps.q() : Wraps.q(model);
        if (CollUtil.isNotEmpty(params.getMap())) {
            Map<String, String> map = params.getMap();
            Iterator var5 = map.entrySet().iterator();
@@ -102,4 +131,49 @@ public class DispatchExceptionController extends SuperSimpleController<DispatchE
            }
        }
 
+    @ApiOperation(value = "修改状态", notes = "修改状态")
+    @GetMapping("/updateStatus")
+    public R<Boolean> updateStatus(@RequestParam(value="ids[]") List<Long> ids) {
+        return R.success(aAutoNodeLogService.updateStatus(ids));
+    }
+
+    @ApiOperation(value = "标记指令完成", notes = "标记指令完成")
+    @PostMapping("/complete")
+    public R<Boolean> complete(@RequestBody Map<String, Long> map) {
+        //return R.success(aAutoNodeLogService.updateStatus(ids));
+        AAutoNodeLog autoNodeLog = aAutoNodeLogService.getById(map.get("id"));
+        Long taskNodeId = autoNodeLog.getTaskNodeId();
+        TWorkpiece tWorkpiece = workpieceService.getWorkPiece(taskNodeId);
+        //节点逻辑处理(待定)
+
+        LambdaUpdateWrapper<AAutoNodeLog> updateWrapper = new UpdateWrapper<AAutoNodeLog>().lambda();
+        updateWrapper.eq(AAutoNodeLog::getId, map.get("id")).set(AAutoNodeLog::getStatus, "1").set(AAutoNodeLog::getExeResult ,"1")
+                .set(AAutoNodeLog::getUpdateUser, BaseContextHandler.getUserId()).set(AAutoNodeLog::getUpdateTime, new Date());
+
+        return R.success(aAutoNodeLogService.update(updateWrapper));
+    }
+
+    @ApiOperation(value = "重发数据节点", notes = "重发数据节点")
+    @PostMapping("/resend")
+    private R<Boolean> resend(@RequestBody Map<String, Long> map){
+        AAutoNodeLog autoNodeLog = aAutoNodeLogService.getById(map.get("id"));
+        Long taskNodeId = autoNodeLog.getTaskNodeId();
+        TWorkpiece tWorkpiece = workpieceService.getWorkPiece(taskNodeId);
+        //判断重发节点操作条件(待定)
+        Map<String, Object> conMap = msgUtil.redis_get_map(CacheKey.TASK_CURRENT_NODE_CONDITION + "_" + taskNodeId);
+        //获取重发执行传参
+        String jsonParam = msgUtil.redis_get(CacheKey.TASK_CURRENT_NODE_PARAMS + "_" + taskNodeId).toString();
+
+        HttpHeaders headers = new HttpHeaders();
+        headers.setContentType(MediaType.parseMediaType("application/json;charset=UTF-8"));
+        HttpEntity<String> formEntity = new HttpEntity<String>(jsonParam, headers);
+
+        String instructionUrl = DictionaryKey.INSTRUCTION_URL +"/api/"+ autoNodeLog.getMethod().toString() ;
+        String returnData = restTemplate.postForObject(instructionUrl, formEntity, String.class);
+        JSONObject retJson = JSONObject.parseObject(returnData);
+        String code = retJson.getString("code").trim();
+
+        return R.success(("1" == code)? true: false);
+    }
+
 }

+ 21 - 13
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/dispatchRecord/DispatchRecordController.java

@@ -11,6 +11,8 @@ import com.github.zuihou.base.request.PageParams;
 import com.github.zuihou.business.dispatchRecord.entity.DispatchException;
 import com.github.zuihou.business.dispatchRecord.entity.DispatchRecord;
 import com.github.zuihou.business.dispatchRecord.service.DispatchRecordService;
+import com.github.zuihou.business.productionReadyCenter.entity.AAutoNodeLog;
+import com.github.zuihou.business.productionReadyCenter.service.AAutoNodeLogService;
 import com.github.zuihou.business.productionResourceCenter.entity.Tool;
 import com.github.zuihou.common.util.DateUtil;
 import com.github.zuihou.database.mybatis.conditions.Wraps;
@@ -22,6 +24,7 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -40,24 +43,29 @@ import java.util.Map;
 @RequestMapping("/dispatchRecord")
 @Api(value = "dispatchRecord", tags = "调度对话")
 @SysLog(enabled = true)
-public class DispatchRecordController extends SuperSimpleController<DispatchRecordService, DispatchRecord> {
+public class DispatchRecordController extends SuperSimpleController<AAutoNodeLogService, AAutoNodeLog> {
 
-    @ApiOperation(value = "查询设备刀具管理", notes = "查询设备刀具管理")
+    @Autowired
+    private AAutoNodeLogService aAutoNodeLogService;
+
+    @ApiOperation(value = "查询对话调度记录", notes = "查询对话调度记录")
     @PostMapping("/page")
-    public R<IPage<DispatchRecord>> page(@RequestBody @Validated PageParams<DispatchRecord> params) {
-        IPage<DispatchRecord> page = params.buildPage();
-        QueryWrap<DispatchRecord> wrap = handlerWrapper(null, params);
-        LbqWrapper<DispatchRecord> wrapper = wrap.lambda();
-        wrapper.like(DispatchRecord::getName, params.getModel().getName())
-                .ge(DispatchRecord::getDistributeTime, StrUtil.isEmpty(params.getModel().getDistributeTime_st())?null: DateUtil.stringToDate3(params.getModel().getDistributeTime_st()))
-                .le(DispatchRecord::getDistributeTime, StrUtil.isEmpty(params.getModel().getDistributeTime_ed())?null:DateUtil.stringToDate3(params.getModel().getDistributeTime_ed()))
-                .orderByDesc(DispatchRecord::getCreateTime);
-        baseService.page(page, wrapper);
+    public R<IPage<AAutoNodeLog>> page(@RequestBody @Validated PageParams<AAutoNodeLog> params) {
+        IPage<AAutoNodeLog> page = params.buildPage();
+        QueryWrap<AAutoNodeLog> wrap = handlerWrapper(null, params);
+        LbqWrapper<AAutoNodeLog> wrapper = wrap.lambda();
+        wrapper.like(AAutoNodeLog::getInstructionName, params.getModel().getInstructionName())
+                .ge(AAutoNodeLog::getExecuteTime, StrUtil.isEmpty(params.getModel().getExecuteTime_st())?null: DateUtil.stringToDate3(params.getModel().getExecuteTime_st()))
+                .le(AAutoNodeLog::getExecuteTime, StrUtil.isEmpty(params.getModel().getExecuteTime_ed())?null:DateUtil.stringToDate3(params.getModel().getExecuteTime_ed()))
+                .orderByDesc(AAutoNodeLog::getCreateTime);
+        //只展示执行成功的调度指令
+        wrapper.eq(AAutoNodeLog::getExeResult, "1");
+        aAutoNodeLogService.page(page, wrapper);
         return this.success(page);
     }
 
-    private QueryWrap<DispatchRecord> handlerWrapper(DispatchRecord model, PageParams<DispatchRecord> params) {
-       QueryWrap<DispatchRecord> wrapper = model == null ? Wraps.q() : Wraps.q(model);
+    private QueryWrap<AAutoNodeLog> handlerWrapper(AAutoNodeLog model, PageParams<AAutoNodeLog> params) {
+       QueryWrap<AAutoNodeLog> wrapper = model == null ? Wraps.q() : Wraps.q(model);
        if (CollUtil.isNotEmpty(params.getMap())) {
            Map<String, String> map = params.getMap();
            Iterator var5 = map.entrySet().iterator();

+ 18 - 7
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionReadyCenter/entity/AAutoNodeLog.java

@@ -95,13 +95,13 @@ public class AAutoNodeLog extends Entity<Long> {
 
 
     /**
-     * 是否推送(1-已处理0-未处理)
+     * 是否人工处理(1-是0-否)
      */
-    @ApiModelProperty(value = "是否推送(1-已处理0-未处理)")
-    @Length(max = 4, message = "是否推送(1-已处理0-未处理)长度不能超过4")
-    @TableField(value = "send_status", condition = LIKE)
-    @Excel(name = "处理状态(1-已处理0-未处理)")
-    private String sendStatus;
+    @ApiModelProperty(value = "是否人工处理(1-是0-否)")
+    @Length(max = 4, message = "是否人工处理(1-是0-否)长度不能超过4")
+    @TableField(value = "manual", condition = LIKE)
+    @Excel(name = "是否人工处理(1-是0-否)")
+    private String manual;
 
     /**
      * 指令方法名
@@ -112,7 +112,13 @@ public class AAutoNodeLog extends Entity<Long> {
     @Excel(name = "指令方法")
     private String method;
 
-
+    /**
+     * 截止时间
+     */
+    @ApiModelProperty(value = "指令执行时间")
+    @TableField("execute_time")
+    @Excel(name = "指令执行时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
+    private Date executeTime;
 
     /**
      * 开始时间
@@ -196,6 +202,11 @@ public class AAutoNodeLog extends Entity<Long> {
     @TableField(exist = false)
     private String nodeNo;
 
+    @TableField(exist = false)
+    private String executeTime_st;
+    @TableField(exist = false)
+    private String executeTime_ed;
+
     @Builder
     public AAutoNodeLog(Long id, LocalDateTime createTime, Long createUser, LocalDateTime updateTime, Long updateUser,
                     Long autoNodeId, String exeStatus, String exeResult, Date startTime, Date endTime,

+ 10 - 0
imcs-admin-boot/imcs-common/src/main/java/com/github/zuihou/common/constant/CacheKey.java

@@ -246,6 +246,16 @@ public interface CacheKey {
      */
     String TASK_CURRENT_NODE_STATUS = "TASK_CURRENT_NODE_STATUS";
 
+    /**
+     * 任务当前节点条件
+     */
+    String TASK_CURRENT_NODE_CONDITION = "TASK_CURRENT_NODE_CONDITION";
+
+    /**
+     * 任务当前节点参数
+     */
+    String TASK_CURRENT_NODE_PARAMS = "TASK_NODE_CURRENT_NODE_CONDITION";
+
     /**
      * 任务询问当前位置
      */