#
Junjie
6 天以前 ff1aa7a9218e458dfd9255b1f87490af52afb62a
src/main/java/com/zy/core/thread/impl/ZySiemensCrnThread.java
@@ -114,6 +114,27 @@
        crnProtocol.setYDistance(0D);
        crnProtocol.setXDuration(0D);
        crnProtocol.setYDuration(0D);
        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) {
                basCrnp = new BasCrnp();
                basCrnp.setCrnNo(deviceConfig.getDeviceNo());
                basCrnp.setStatus(1);
                basCrnp.setInEnable("N");
                basCrnp.setOutEnable("N");
                basCrnp.setMaxInTask(5);
                basCrnp.setMaxOutTask(5);
                basCrnp.setCreateTime(new Date());
                basCrnpService.insert(basCrnp);
            }
        }
    }
    @Override
@@ -178,27 +199,6 @@
            redisUtil.set(RedisKeyType.DEVICE_LOG_KEY.key + System.currentTimeMillis(), deviceDataLog, 60 * 60 * 24);
            //更新采集时间
            crnProtocol.setDeviceDataLog(System.currentTimeMillis());
        }
        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) {
                basCrnp = new BasCrnp();
                basCrnp.setCrnNo(deviceConfig.getDeviceNo());
                basCrnp.setStatus(1);
                basCrnp.setInEnable("N");
                basCrnp.setOutEnable("N");
                basCrnp.setMaxInTask(5);
                basCrnp.setMaxOutTask(5);
                basCrnp.setCreateTime(new Date());
                basCrnpService.insert(basCrnp);
            }
        }
    }