自动化立体仓库 - WCS系统
#
LSH
2023-11-16 d051d72b3c8c91ce415b33efc9ee560c6aa29e5d
src/main/java/com/zy/core/thread/SiemensCrnThread.java
@@ -7,10 +7,7 @@
import com.alibaba.fastjson.JSON;
import com.core.common.DateUtils;
import com.core.common.SpringUtils;
import com.zy.asrs.entity.BasCrnOpt;
import com.zy.asrs.entity.BasCrnp;
import com.zy.asrs.entity.CommandInfo;
import com.zy.asrs.entity.TaskWrk;
import com.zy.asrs.entity.*;
import com.zy.asrs.service.*;
import com.zy.core.CrnThread;
import com.zy.core.cache.MessageQueue;
@@ -461,9 +458,20 @@
            }
        } catch (Exception ignore) {}
        //更新命令日志
        CommandInfoLogService commandInfoLogService = SpringUtils.getBean(CommandInfoLogService.class);
        CommandInfoService commandInfoService = SpringUtils.getBean(CommandInfoService.class);
        CommandInfo commandInfo = commandInfoService.selectById(command.getCommandId());
        CommandInfoLog commandInfoLog = JSON.parseObject(JSON.toJSONString(commandInfo), CommandInfoLog.class);
        commandInfoLog.setId(null);
        if (result.IsSuccess && result1.IsSuccess) {
            log.warn("堆垛机命令下发[id:{},时间:{}] >>>>> {}", slave.getId(), DateUtils.convert(new Date(), DateUtils.yyyyMMddHHmmsssss_F), JSON.toJSON(command));
            OutputQueue.CRN.offer(MessageFormat.format("【{0}】[id:{1}] >>>>> 命令下发: {2}", DateUtils.convert(new Date()), slave.getId(), JSON.toJSON(command)));
            //更新指令日志
            commandInfoLog.setDeviceLog("指令下发成功");
            commandInfoLogService.insert(commandInfoLog);
            //更新任务步序
            TaskWrkService taskWrkService = SpringUtils.getBean(TaskWrkService.class);
@@ -477,6 +485,10 @@
        } else {
            OutputQueue.CRN.offer(MessageFormat.format("【{0}】写入堆垛机plc数据失败 ===>> [id:{1}] [ip:{2}] [port:{3}] [rack:{4}] [slot:{5}]", DateUtils.convert(new Date()), slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot()));
            log.error("写入堆垛机plc数据失败 ===>> [id:{}] [ip:{}] [port:{}] [rack:{}] [slot:{}]", slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot());
            //更新指令日志
            commandInfoLog.setDeviceLog("指令下发失败");
            commandInfoLogService.insert(commandInfoLog);
            return false;
        }
    }