自动化立体仓库 - WCS系统
Junjie
2023-11-29 8b71bde8d68d5d2bb11fa51a297990cd1474e9c6
src/main/java/com/zy/core/thread/SiemensCrnThread.java
@@ -474,22 +474,24 @@
        CommandInfoLogService commandInfoLogService = SpringUtils.getBean(CommandInfoLogService.class);
        CommandInfoService commandInfoService = SpringUtils.getBean(CommandInfoService.class);
        CommandInfo commandInfo = commandInfoService.selectById(command.getCommandId());
        CommandInfoLog commandInfoLog = new CommandInfoLog();
        if (commandInfo != null) {
            commandInfoLog = JSON.parseObject(JSON.toJSONString(commandInfo), CommandInfoLog.class);
            commandInfoLog.setId(null);
        }else {
            Date now = new Date();
            commandInfoLog.setCommand(JSON.toJSONString(command));
            commandInfoLog.setCommandStatus(3);
            commandInfoLog.setStartTime(now);
            commandInfoLog.setExecuteTime(now);
            commandInfoLog.setCompleteTime(now);
            commandInfoLog.setDevice(SlaveType.Devp.toString());
            commandInfoLog.setWrkNo(9999);
            commandInfoLog.setTaskNo("9999");
            commandInfoLog.setCommandDesc("手动命令");
        }
        CommandInfoLog commandInfoLog = JSON.parseObject(JSON.toJSONString(commandInfo), CommandInfoLog.class);
        commandInfoLog.setId(null);
//        CommandInfoLog commandInfoLog = new CommandInfoLog();
//        if (commandInfo != null) {
//            commandInfoLog = JSON.parseObject(JSON.toJSONString(commandInfo), CommandInfoLog.class);
//            commandInfoLog.setId(null);
//        }else {
//            Date now = new Date();
//            commandInfoLog.setCommand(JSON.toJSONString(command));
//            commandInfoLog.setCommandStatus(3);
//            commandInfoLog.setStartTime(now);
//            commandInfoLog.setExecuteTime(now);
//            commandInfoLog.setCompleteTime(now);
//            commandInfoLog.setDevice(SlaveType.Devp.toString());
//            commandInfoLog.setWrkNo(9999);
//            commandInfoLog.setTaskNo("9999");
//            commandInfoLog.setCommandDesc("手动命令");
//        }
        if (result.IsSuccess) {
@@ -500,6 +502,13 @@
            commandInfoLog.setDeviceLog("指令下发成功");
            commandInfoLogService.insert(commandInfoLog);
            //线程暂存指令ID
            crnProtocol.setCommandId(command.getCommandId());
            //更新指令状态
            commandInfo.setCommandStatus(CommandStatusType.EXECUTE.id);//执行中
            commandInfoService.updateById(commandInfo);
            //更新任务步序
            TaskWrkService taskWrkService = SpringUtils.getBean(TaskWrkService.class);
            TaskWrk taskWrk = taskWrkService.selectByWrkNo(command.getTaskNo().intValue());