#
Junjie
21 小时以前 5e644156839fbb018fe63972ee74be550540a06a
src/main/java/com/zy/core/thread/impl/ZySiemensCrnThread.java
@@ -43,6 +43,7 @@
    private RedisUtil redisUtil;
    private ZyCrnConnectDriver zyCrnConnectDriver;
    private CrnProtocol crnProtocol;
    private int deviceLogCollectTime = 200;
    private boolean resetFlag = false;
    public ZySiemensCrnThread(DeviceConfig deviceConfig, RedisUtil redisUtil) {
@@ -57,6 +58,7 @@
        this.initCrn();
        while (true) {
            try {
                deviceLogCollectTime = Utils.getDeviceLogCollectTime();
                int step = 1;
                Task task = MessageQueue.poll(SlaveType.Crn, deviceConfig.getDeviceNo());
                if (task != null) {
@@ -172,7 +174,7 @@
            crnProtocol.setLastCommandTime(System.currentTimeMillis());
        }
        if (System.currentTimeMillis() - crnProtocol.getDeviceDataLog() > 200) {
        if (System.currentTimeMillis() - crnProtocol.getDeviceDataLog() > deviceLogCollectTime) {
            //保存数据记录
            DeviceDataLog deviceDataLog = new DeviceDataLog();
            deviceDataLog.setOriginData(JSON.toJSONString(crnStatus));
@@ -186,7 +188,12 @@
            crnProtocol.setDeviceDataLog(System.currentTimeMillis());
        }
        BasCrnpService basCrnpService = SpringUtils.getBean(BasCrnpService.class);
        BasCrnpService basCrnpService = null;
        try {
            basCrnpService = SpringUtils.getBean(BasCrnpService.class);
        }catch (Exception e){
        }
        if (basCrnpService != null) {
            BasCrnp basCrnp = basCrnpService.selectOne(new EntityWrapper<BasCrnp>().eq("crn_no", deviceConfig.getDeviceNo()));
            if(basCrnp == null) {