#
luxiaotao1123
2022-03-14 2f662f2a75ca9af4d28a9af5eebe3d2a67c5c17c
src/main/java/com/zy/core/thread/SteThread.java
@@ -9,6 +9,7 @@
import com.core.common.SpringUtils;
import com.core.exception.CoolException;
import com.zy.asrs.entity.BasSte;
import com.zy.asrs.service.BasSteOptService;
import com.zy.asrs.service.BasSteService;
import com.zy.core.ThreadHandler;
import com.zy.core.cache.MessageQueue;
@@ -188,12 +189,14 @@
                // 根据实时信息更新数据库
                BasSteService service = SpringUtils.getBean(BasSteService.class);
                BasSte basSte = new BasSte();
                basSte.setSteNo(slave.getId());
                if (!service.updateById(steProtocol.toSqlModel(basSte))){
                    log.error("穿梭车plc数据库更新失败 ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort());
                }
                if (null != service) {
                    BasSte basSte = new BasSte();
                    basSte.setSteNo(slave.getId());
                    if (!service.updateById(steProtocol.toSqlModel(basSte))){
                        log.error("穿梭车plc数据库更新失败 ===>> [id:{}] [ip:{}] [port:{}]", slave.getId(), slave.getIp(), slave.getPort());
                    }
                }
            } else {
                OutputQueue.CRN.offer(MessageFormat.format("【{0}】{1}穿梭车plc状态信息失败",DateUtils.convert(new Date()), slave.getId()));
                throw new CoolException(MessageFormat.format( "穿梭车plc状态信息失败 ===>> [id:{0}] [ip:{1}] [port:{2}]", slave.getId(), slave.getIp(), slave.getPort()));
@@ -236,12 +239,12 @@
        try {
            // 日志记录
//            BasCrnOptService bean = SpringUtils.getBean(BasCrnOptService.class);
//            BasCrnOpt basCrnOpt = new BasCrnOpt(
//                    command.getTaskNo().intValue(),    // 任务号
//                    command.getCrnNo(),    // 穿梭车[非空]
            BasSteOptService bean = SpringUtils.getBean(BasSteOptService.class);
//            BasSteOpt basSteOpt = new BasSteOpt(
//                    command.getTaskNo(),    // 任务号
//                    command.getSteNo(),    // 穿梭车[非空]
//                    new Date(),    // 下发时间
//                    command.getTaskModeType().toString(),    // 模式
//                    command.getTaskModeType().desc,    // 模式
//                    command.getSourcePosX().intValue(),    // 源排
//                    command.getSourcePosY().intValue(),    // 源列
//                    command.getSourcePosZ().intValue(),    // 源层
@@ -254,7 +257,7 @@
//                    null,    // 修改时间
//                    null    // 修改人员
//            );
//            bean.insert(basCrnOpt);
//            bean.insert(basSteOpt);
        } catch (Exception ignore) {}
        if (result.IsSuccess) {