Browse Source

222

develop
bin 3 years ago
parent
commit
ca481dc99d
4 changed files with 20 additions and 12 deletions
  1. +3
    -0
      src/main/java/com/ssjl/zhaobiao/guizhou/handle/GZResponseHandle.java
  2. +8
    -3
      src/main/java/com/ssjl/zhaobiao/guizhou/quartz/job/GZHeartJob.java
  3. +1
    -1
      src/main/java/com/ssjl/zhaobiao/guizhou/quartz/job/GZSyncSetting.java
  4. +8
    -8
      src/main/resources/application.properties

+ 3
- 0
src/main/java/com/ssjl/zhaobiao/guizhou/handle/GZResponseHandle.java View File

@@ -26,6 +26,9 @@ public class GZResponseHandle {
if(res[1] == (byte)0xFF){ if(res[1] == (byte)0xFF){
// 常规应答 // 常规应答


return null;
}else if(res[0] != (byte)0x7E){
// 非正常应答
return null; return null;
}else { }else {
// 其他命令 // 其他命令


+ 8
- 3
src/main/java/com/ssjl/zhaobiao/guizhou/quartz/job/GZHeartJob.java View File

@@ -42,13 +42,18 @@ public class GZHeartJob extends QuartzJobBean {
String imei = device.getImei(); String imei = device.getImei();
String phone = device.getPhone(); String phone = device.getPhone();
GpsDeviceStatus gpsDeviceStatus = statusMapper.selectByImei(imei); GpsDeviceStatus gpsDeviceStatus = statusMapper.selectByImei(imei);
String statusStr = gpsDeviceStatus.getDeviceStatus();
IOTDeviceStatus status = IOTDeviceStatus.build(statusStr);
int pow = 50;
if(gpsDeviceStatus != null){
String statusStr = gpsDeviceStatus.getDeviceStatus();
IOTDeviceStatus status = IOTDeviceStatus.build(statusStr);
pow = status.getBattery();
}



DianxinGzDeviceConfig config = configMapper.selectByImei(imei); DianxinGzDeviceConfig config = configMapper.selectByImei(imei);
GZHeart heart = new GZHeart(); GZHeart heart = new GZHeart();
GZDevicePower power = new GZDevicePower(); GZDevicePower power = new GZDevicePower();
power.setPower(status.getBattery());
power.setPower(pow);
power.setCharge(false); power.setCharge(false);
heart.setPower(power); heart.setPower(power);
GZDeviceStatus gzStatus = new GZDeviceStatus(); GZDeviceStatus gzStatus = new GZDeviceStatus();


+ 1
- 1
src/main/java/com/ssjl/zhaobiao/guizhou/quartz/job/GZSyncSetting.java View File

@@ -38,7 +38,7 @@ public class GZSyncSetting extends QuartzJobBean {
GZAskSetting askSetting = new GZAskSetting(); GZAskSetting askSetting = new GZAskSetting();
try { try {
byte[] res = httpUtil.send(device.getImei(), device.getPhone(), askSetting); 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); res = (byte[]) responseHandle.process(device.getImei(), res);
// System.out.println(ByteUtil.bytesToHexString(res)); // System.out.println(ByteUtil.bytesToHexString(res));
} catch (IOException e) { } catch (IOException e) {


+ 8
- 8
src/main/resources/application.properties View File

@@ -45,15 +45,15 @@ guizhou.protocol=T01.4
#guizhou.device.version=ACB_1001 #guizhou.device.version=ACB_1001
#guizhou.device.testList= [{ "imei": "862622050253671","phone": "" },{ "imei": "862622050253358","phone": "" },{ "imei": "800115470000678","phone": "" }] #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 guizhou.http.url=http://120.24.195.54:24183


Loading…
Cancel
Save