diff --git a/ebike-common/src/main/java/com/cdzy/common/model/ResGPSDto.java b/ebike-common/src/main/java/com/cdzy/common/model/ResGPSDto.java index 472aa31e..f04e78c7 100644 --- a/ebike-common/src/main/java/com/cdzy/common/model/ResGPSDto.java +++ b/ebike-common/src/main/java/com/cdzy/common/model/ResGPSDto.java @@ -108,4 +108,9 @@ public class ResGPSDto { * 最后一次还车时间 */ private Number latestTimestamp; + + /** + * 放电状态:0-关闭(断电) 1-打开(通电) + */ + private Integer mosState; } diff --git a/ebike-maintenance/pom.xml b/ebike-maintenance/pom.xml index dff3fa47..1260524c 100644 --- a/ebike-maintenance/pom.xml +++ b/ebike-maintenance/pom.xml @@ -214,6 +214,7 @@ org.apache.maven.plugins maven-compiler-plugin + true -implicit:class diff --git a/ebike-report/src/main/java/com/cdzy/ebikereport/component/ReoprtHandler.java b/ebike-report/src/main/java/com/cdzy/ebikereport/component/ReoprtHandler.java index 26429da4..51fb7718 100644 --- a/ebike-report/src/main/java/com/cdzy/ebikereport/component/ReoprtHandler.java +++ b/ebike-report/src/main/java/com/cdzy/ebikereport/component/ReoprtHandler.java @@ -35,10 +35,17 @@ public class ReoprtHandler { */ public void reportHandler(JSONObject response) { Integer c = response.getInteger("c"); - if (c != null && c == 56) { + if (c != null) { String deviceId = response.getString("deviceId"); JSONObject param = response.getJSONObject("param"); - gpsMsgHandler(param, deviceId); + switch (c){ + case 56: + gpsMsgHandler(param,deviceId); + break; + case 66: + bmsMsgHandler(param,deviceId); + break; + } } } @@ -76,4 +83,11 @@ public class ReoprtHandler { } } + public void bmsMsgHandler(JSONObject param, String deviceId) { + ResGPSDto resGpsDto = (ResGPSDto)redisUtil.get(deviceId); + Integer mosState = param.getInteger("MOSState"); + resGpsDto.setMosState(mosState); + redisUtil.set(deviceId,resGpsDto); + } + }