From ced9175e102d6b2c0bf75488f83f32c6b8af6d3a Mon Sep 17 00:00:00 2001 From: bin Date: Fri, 15 Jan 2021 01:49:46 +0800 Subject: [PATCH] 333 --- .../guizhou/controller/IotController.java | 9 +++++++-- .../guizhou/handle/GZResponseHandle.java | 4 ++-- .../guizhou/quartz/job/GZSyncSetting.java | 2 +- src/main/resources/application.properties | 16 ++++++++-------- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/ssjl/zhaobiao/guizhou/controller/IotController.java b/src/main/java/com/ssjl/zhaobiao/guizhou/controller/IotController.java index 436c853..7b254c7 100644 --- a/src/main/java/com/ssjl/zhaobiao/guizhou/controller/IotController.java +++ b/src/main/java/com/ssjl/zhaobiao/guizhou/controller/IotController.java @@ -293,10 +293,15 @@ public class IotController { } log.info(imei + ",wifi ,v=" + JSON.toJSONString(wifi)); GpsDeviceStatus gpsDeviceStatus = gpsDeviceStatusMapper.selectByImei(imei); - IOTDeviceStatus iotDeviceStatus = IOTDeviceStatus.build(gpsDeviceStatus.getDeviceStatus()); + int batty = 50; + if(gpsDeviceStatus != null){ + IOTDeviceStatus iotDeviceStatus = IOTDeviceStatus.build(gpsDeviceStatus.getDeviceStatus()); + batty = iotDeviceStatus.getBattery(); + } + GZDevicePower power = new GZDevicePower(); power.setCharge(false); - power.setPower(iotDeviceStatus.getBattery()); + power.setPower(batty); GZDeviceStatus deviceStatus = new GZDeviceStatus(); LocalDateTime time = LocalDateTime.now(); GZLocationExtend extend = new GZLocationExtend(); diff --git a/src/main/java/com/ssjl/zhaobiao/guizhou/handle/GZResponseHandle.java b/src/main/java/com/ssjl/zhaobiao/guizhou/handle/GZResponseHandle.java index dcf4d6e..87e900a 100644 --- a/src/main/java/com/ssjl/zhaobiao/guizhou/handle/GZResponseHandle.java +++ b/src/main/java/com/ssjl/zhaobiao/guizhou/handle/GZResponseHandle.java @@ -71,9 +71,9 @@ public class GZResponseHandle { gzRs.setPhone(phone); gzRs.setImei(sourceImei); gzRs.setErrorCode(GZResponseStatus.RECEIVE_SUCCESS); - log.info("应答报文:" + ByteUtil.bytesToHexString(gzRs.toBytes())); +// log.info("应答报文:" + ByteUtil.bytesToHexString(gzRs.toBytes())); byte[] responseRs = gzHttpUtil.send(gzRs.getImei(), gzRs.getPhone(), gzRs); - log.info("应答回复:" + ByteUtil.bytesToHexString(responseRs)); +// log.info("应答回复:" + ByteUtil.bytesToHexString(responseRs)); return serviceRs; // byte[] result = content.process(deviceFlag, flagType, msgIndex, status); diff --git a/src/main/java/com/ssjl/zhaobiao/guizhou/quartz/job/GZSyncSetting.java b/src/main/java/com/ssjl/zhaobiao/guizhou/quartz/job/GZSyncSetting.java index 304865a..b0ad448 100644 --- a/src/main/java/com/ssjl/zhaobiao/guizhou/quartz/job/GZSyncSetting.java +++ b/src/main/java/com/ssjl/zhaobiao/guizhou/quartz/job/GZSyncSetting.java @@ -38,7 +38,7 @@ public class GZSyncSetting extends QuartzJobBean { GZAskSetting askSetting = new GZAskSetting(); try { byte[] res = httpUtil.send(device.getImei(), device.getPhone(), askSetting); - System.out.println(ByteUtil.bytesToHexString(res)); +// System.out.println(ByteUtil.bytesToHexString(res)); res = (byte[]) responseHandle.process(device.getImei(), res); // System.out.println(ByteUtil.bytesToHexString(res)); } catch (IOException e) { diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index e9db67d..01c07d9 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -45,15 +45,15 @@ guizhou.protocol=T01.4 #guizhou.device.version=ACB_1001 #guizhou.device.testList= [{ "imei": "862622050253671","phone": "" },{ "imei": "862622050253358","phone": "" },{ "imei": "800115470000678","phone": "" }] -#guizhou.factory=zhizhong -#guizhou.device.model=RZL600 -#guizhou.device.version=RZL_2021 -#guizhou.device.testList= [{ "imei": "862622050654340","phone": "" },{ "imei": "862622050317740","phone": "" }] +guizhou.factory=zhizhong +guizhou.device.model=RZL600 +guizhou.device.version=RZL_2021 +guizhou.device.testList= [{ "imei": "862622050654340","phone": "" },{ "imei": "862622050317740","phone": "" }] -guizhou.factory=zhanneng -guizhou.device.model=TPE390 -guizhou.device.version=TPE_0056 -guizhou.device.testList= [{ "imei": "862622050925104","phone": "" },{ "imei": "862622050927027","phone": "" }] +#guizhou.factory=zhanneng +#guizhou.device.model=TPE390 +#guizhou.device.version=TPE_0056 +#guizhou.device.testList= [{ "imei": "862622050925104","phone": "" },{ "imei": "862622050927027","phone": "" }] guizhou.http.url=http://120.24.195.54:24183