|
@@ -10,64 +10,68 @@ public class MessageHandle {
|
|
|
|
|
|
public static final Logger log = LoggerFactory.getLogger(MessageHandle.class);
|
|
|
|
|
|
- public static void vehicleOnline(String s, JSONObject msg){
|
|
|
+ public static void vehicleOnline(String topic, JSONObject msg){
|
|
|
|
|
|
}
|
|
|
|
|
|
- public static void vehicleOffline(String s, JSONObject msg){
|
|
|
+ public static void vehicleOffline(String topic, JSONObject msg){
|
|
|
|
|
|
}
|
|
|
|
|
|
- public static void fuelState(String s, JSONObject msg){
|
|
|
+ public static void fuelState(String topic, JSONObject msg){
|
|
|
|
|
|
}
|
|
|
|
|
|
- public static void vehicleState(String s, JSONObject msg){
|
|
|
+ public static void vehicleState(String topic, JSONObject msg){
|
|
|
|
|
|
}
|
|
|
|
|
|
- public static void vehicleStart(String s, JSONObject msg){
|
|
|
- String capacityResourceObjectId = msg.getString("capacityResourceObjectId");
|
|
|
+ public static void vehicleStart(String topic, JSONObject msg){
|
|
|
+ JSONObject msgBody = JSONObject.parseObject(msg.getString("msgBody"));
|
|
|
+ String capacityResourceObjectId = msgBody.getString("capacityResourceObjectId");
|
|
|
String url = Common.getConfigByName("charging.interface.api.url.test") + "/tcpcarControl";
|
|
|
String param = "ivCapacityResourceld" + "=" + capacityResourceObjectId + "&" + "messageType" + "=" + "2";
|
|
|
+ log.info(param);
|
|
|
Object o = HttpRequest.sendPost(url, param);
|
|
|
- log.info(o.toString());
|
|
|
+ log.info(msg.toJSONString());
|
|
|
}
|
|
|
|
|
|
- public static void arriveStationRequest(String s, JSONObject msg){
|
|
|
- String capacityResourceObjectId = msg.getString("capacityResourceObjectId");
|
|
|
- JSONObject data = JSONObject.parseObject(msg.getString("data"));
|
|
|
- JSONObject station = JSONObject.parseObject(data.getString("station"));
|
|
|
+ public static void arriveStationRequest(String topic, JSONObject msg){
|
|
|
+ JSONObject msgBody = JSONObject.parseObject(msg.getString("msgBody"));
|
|
|
+ String capacityResourceObjectId = msgBody.getString("capacityResourceId");
|
|
|
+ JSONObject data = msgBody.getJSONObject("data");
|
|
|
+ JSONObject station = data.getJSONObject("station");
|
|
|
String stationId = station.getString("stationId");
|
|
|
String url = Common.getConfigByName("charging.interface.api.url.test") + "/tcpcarControl";
|
|
|
String param = "ivCapacityResourceld" + "=" + capacityResourceObjectId + "&" +
|
|
|
"ivParkPointId" + "=" + stationId + "&" +
|
|
|
"messageType" + "=" + "1";
|
|
|
+ log.info(param);
|
|
|
Object o = HttpRequest.sendPost(url, param);
|
|
|
- log.info(o.toString());
|
|
|
+ log.info(msg.toJSONString());
|
|
|
}
|
|
|
|
|
|
- public static void arrivePoint(String s, JSONObject msg){
|
|
|
+ public static void arrivePoint(String topic, JSONObject msg){
|
|
|
|
|
|
}
|
|
|
|
|
|
- public static void leavePoint(String s, JSONObject msg){
|
|
|
+ public static void leavePoint(String topic, JSONObject msg){
|
|
|
|
|
|
}
|
|
|
|
|
|
- public static void gotoPoint(String s, JSONObject msg){
|
|
|
+ public static void gotoPoint(String topic, JSONObject msg){
|
|
|
|
|
|
}
|
|
|
|
|
|
- public static void taskBegin(String s, JSONObject msg){
|
|
|
+ public static void taskBegin(String topic, JSONObject msg){
|
|
|
|
|
|
}
|
|
|
|
|
|
- public static void taskOver(String s, JSONObject msg){
|
|
|
+ public static void taskOver(String topic, JSONObject msg){
|
|
|
|
|
|
}
|
|
|
|
|
|
- public static void startCarFailMsg(String s, JSONObject msg){
|
|
|
+ public static void startCarFailMsg(String topic, JSONObject msg){
|
|
|
|
|
|
}
|
|
|
}
|