cmd66解析
This commit is contained in:
parent
19877b00f0
commit
a5d1f2bdfd
@ -108,4 +108,9 @@ public class ResGPSDto {
|
|||||||
* 最后一次还车时间
|
* 最后一次还车时间
|
||||||
*/
|
*/
|
||||||
private Number latestTimestamp;
|
private Number latestTimestamp;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 放电状态:0-关闭(断电) 1-打开(通电)
|
||||||
|
*/
|
||||||
|
private Integer mosState;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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>
|
||||||
|
|||||||
@ -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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user