自动化立体仓库 - WCS系统
Junjie
2023-08-09 dc51e6bf7f20b2786bd16dc3e951ab8a299f4a34
src/main/java/com/zy/core/thread/SiemensDevpThread.java
@@ -9,7 +9,10 @@
import com.core.common.DateUtils;
import com.core.common.SpringUtils;
import com.zy.asrs.entity.BasDevp;
import com.zy.asrs.entity.CommandInfo;
import com.zy.asrs.service.BasDevpService;
import com.zy.asrs.service.CommandInfoService;
import com.zy.asrs.service.DeviceErrorService;
import com.zy.core.DevpThread;
import com.zy.core.cache.MessageQueue;
import com.zy.core.cache.OutputQueue;
@@ -113,6 +116,8 @@
        } else {
            OutputQueue.DEVP.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:{}]", slave.getId(), slave.getIp(), slave.getPort());
            DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
            deviceErrorService.addDeviceError("devp", slave.getId(), "输送线plc连接失败");
        }
        siemensS7Net.ConnectClose();
        return result;
@@ -222,9 +227,13 @@
                log.error("更新数据库数据失败 ===>> [id:{}] [ip:{}] [port:{}] [rack:{}] [slot:{}]", slave.getId(), slave.getIp(), slave.getPort(), slave.getRack(), slave.getSlot());
            }
            DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
            deviceErrorService.deleteDeviceError("devp", slave.getId());
        } else {
            OutputQueue.DEVP.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());
            DeviceErrorService deviceErrorService = SpringUtils.getBean(DeviceErrorService.class);
            deviceErrorService.addDeviceError("devp", slave.getId(), "读取输送线plc状态信息失败");
        }
    }
@@ -302,6 +311,12 @@
            if ((siteId == 101 || siteId == 201)&&(staProtocol.getWorkNo() == 0 && staProtocol.getStaNo() ==0)) {
                staProtocol.setPakMk(true);
            }
            //更新指令状态
            CommandInfoService commandInfoService = SpringUtils.getBean(CommandInfoService.class);
            CommandInfo commandInfo = staProtocol.getCommandInfo();
            commandInfo.setCommandStatus(2);
            commandInfoService.updateById(commandInfo);
        }
    }