cmd66解析

This commit is contained in:
attiya 2025-09-28 14:05:07 +08:00
parent 19877b00f0
commit a5d1f2bdfd
3 changed files with 22 additions and 2 deletions

View File

@ -108,4 +108,9 @@ public class ResGPSDto {
* 最后一次还车时间 * 最后一次还车时间
*/ */
private Number latestTimestamp; private Number latestTimestamp;
/**
* 放电状态0-关闭断电 1-打开通电
*/
private Integer mosState;
} }

View File

@ -214,6 +214,7 @@
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<configuration> <configuration>
<parameters>true</parameters> <!-- 关键配置 -->
<compilerArgs> <compilerArgs>
<arg>-implicit:class</arg> <!-- 可选值none、class --> <arg>-implicit:class</arg> <!-- 可选值none、class -->
</compilerArgs> </compilerArgs>

View File

@ -35,10 +35,17 @@ public class ReoprtHandler {
*/ */
public void reportHandler(JSONObject response) { public void reportHandler(JSONObject response) {
Integer c = response.getInteger("c"); Integer c = response.getInteger("c");
if (c != null && c == 56) { if (c != null) {
String deviceId = response.getString("deviceId"); String deviceId = response.getString("deviceId");
JSONObject param = response.getJSONObject("param"); 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);
}
} }