完成Notification_Stop_Charge_ResultTask,Notification_Charge_Order_Info,CheckCharge_Orders.
This commit is contained in:
parent
e2cd9cea69
commit
93cb85a7f6
@ -43,7 +43,7 @@ public class QueryStationsInfoController {
|
|||||||
|
|
||||||
@PostMapping("/v1/query_stations_info")
|
@PostMapping("/v1/query_stations_info")
|
||||||
public CommonResponse queryStationsInfo(@RequestBody(required = false) CommonRequest<PageRequest> commonRequest) throws Exception {
|
public CommonResponse queryStationsInfo(@RequestBody(required = false) CommonRequest<PageRequest> commonRequest) throws Exception {
|
||||||
// todo 电站状态更新逻辑,没必要做,全推
|
// 电站状态更新逻辑,没必要做,全推
|
||||||
// chargingStationPushStatusService.editStationStatus();
|
// chargingStationPushStatusService.editStationStatus();
|
||||||
// chargingStationPushStatusService.saveStationStatus();
|
// chargingStationPushStatusService.saveStationStatus();
|
||||||
|
|
||||||
|
|||||||
@ -52,7 +52,7 @@ public class CheckChargeOrders extends CoreDispatcher {
|
|||||||
}
|
}
|
||||||
String orderNo = pushOrderKey.substring(10);
|
String orderNo = pushOrderKey.substring(10);
|
||||||
Map<String, Object> order = REDIS.getCacheMap("order:" + orderNo);
|
Map<String, Object> order = REDIS.getCacheMap("order:" + orderNo);
|
||||||
String operatorId3rdpty = (String) order.get("operatorId3rdpty"); //todo zz
|
String operatorId3rdpty = (String) pushOrder.get("operatorId3rdpty");
|
||||||
if (operatorId3rdpty == null) {
|
if (operatorId3rdpty == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -58,7 +58,7 @@ public class NotificationChargeOrderInfo extends CoreDispatcher {
|
|||||||
}
|
}
|
||||||
String orderNo = pushOrderKey.substring(10);
|
String orderNo = pushOrderKey.substring(10);
|
||||||
Map<String, Object> order = REDIS.getCacheMap("order:" + orderNo);
|
Map<String, Object> order = REDIS.getCacheMap("order:" + orderNo);
|
||||||
String operatorId3rdpty = (String) order.get("operatorId3rdpty"); //todo zz
|
String operatorId3rdpty = (String) pushOrder.get("operatorId3rdpty");
|
||||||
if (operatorId3rdpty == null) {
|
if (operatorId3rdpty == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,7 +27,7 @@ public class NotificationStopChargeResultTask extends CoreDispatcher {
|
|||||||
@Scheduled(fixedRate = 1000 * 20)
|
@Scheduled(fixedRate = 1000 * 20)
|
||||||
public void run() throws IOException {
|
public void run() throws IOException {
|
||||||
|
|
||||||
notifyService();
|
//notifyService();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -41,7 +41,7 @@ public class NotificationStopChargeResultTask extends CoreDispatcher {
|
|||||||
* 出现异常逻辑
|
* 出现异常逻辑
|
||||||
* 如果当充电桩因为异常停止充电时,那么谁告诉我订单是个异常订单?
|
* 如果当充电桩因为异常停止充电时,那么谁告诉我订单是个异常订单?
|
||||||
*/
|
*/
|
||||||
public void notifyService() throws IOException {
|
public void notifyService() throws Exception {
|
||||||
|
|
||||||
//获取Redis中的所有订单状态数据
|
//获取Redis中的所有订单状态数据
|
||||||
Collection<String> pushOrders = REDIS.keys("pushOrder:*");
|
Collection<String> pushOrders = REDIS.keys("pushOrder:*");
|
||||||
@ -54,7 +54,7 @@ public class NotificationStopChargeResultTask extends CoreDispatcher {
|
|||||||
}
|
}
|
||||||
String orderNo = pushOrderKey.substring(10);
|
String orderNo = pushOrderKey.substring(10);
|
||||||
Map<String, Object> order = REDIS.getCacheMap("order:" + orderNo);
|
Map<String, Object> order = REDIS.getCacheMap("order:" + orderNo);
|
||||||
String operatorId3rdpty = (String) order.get("operatorId3rdpty"); //todo zz
|
String operatorId3rdpty = (String) pushOrder.get("operatorId3rdpty");
|
||||||
if (operatorId3rdpty == null) {
|
if (operatorId3rdpty == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -82,18 +82,27 @@ public class NotificationStopChargeResultTask extends CoreDispatcher {
|
|||||||
chargeResultRequest.setFailReason(failReason);
|
chargeResultRequest.setFailReason(failReason);
|
||||||
|
|
||||||
//将其转换为json
|
//将其转换为json
|
||||||
|
chargeResultRequestCommonRequest.setOperatorId(operatorId3rdpty);
|
||||||
String jsonData = JSONUtil.toJSONString(chargeResultRequest);
|
String jsonData = JSONUtil.toJSONString(chargeResultRequest);
|
||||||
chargeResultRequestCommonRequest.setData(jsonData);
|
chargeResultRequestCommonRequest.setData(jsonData);
|
||||||
String result = ok(chargeResultRequestCommonRequest, "/notification_stop_charge_result", authSecretTokenOut, operatorId3rdpty);
|
String result = ok(chargeResultRequestCommonRequest, "/notification_stop_charge_result", authSecretTokenOut, operatorId3rdpty);
|
||||||
|
|
||||||
ChargeResultResponse chargeResultResponse = JSONUtil.readParams(result, ChargeResultResponse.class);
|
ChargeResultResponse chargeResultResponse = JSONUtil.readParams(result, ChargeResultResponse.class);
|
||||||
succStat = chargeResultResponse.getSuccStat();
|
succStat = chargeResultResponse.getSuccStat();
|
||||||
//推送成功则排除这个已推送的订单,否则则继续推送该订单 //todo 用于测试暂时注释
|
//推送成功则排除这个已推送的订单,否则则继续推送该订单 // 用于测试暂时注释
|
||||||
// if (succStat==0){
|
// if (succStat==0){
|
||||||
// REDIS.deleteObject(pushOrderKey);
|
// REDIS.deleteObject(pushOrderKey);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//推送充电订单信息
|
||||||
|
new NotificationChargeOrderInfo().pushChargeOrderInfo();
|
||||||
|
|
||||||
|
//进行账单对账
|
||||||
|
new CheckChargeOrders().checkChargeOrder();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user