协议:电桩在充电中则不得上送空闲状态,若实时数据中有两帧为空闲,平台会把此单列为异常订单。
This commit is contained in:
parent
06dc081fc1
commit
73c7593f68
@ -102,8 +102,10 @@ public class RealtimeDataLogic implements ServiceLogic {
|
||||
cacheTerminalStatusMap.put(terminalId, statusOrSOC);
|
||||
REDIS.setCacheMap(stationTermStatusKey, cacheTerminalStatusMap);
|
||||
Map<String, Object> cacheOrder = REDIS.getCacheMap(orderkey);
|
||||
if (!orderNo.equals("00000000000000000000000000000000") && statusInt == 3) {
|
||||
List<CacheRealtimeData> realtimeDataList = (List<CacheRealtimeData>) cacheOrder.get("realtimeDataList");
|
||||
if (!orderNo.equals("00000000000000000000000000000000")) {
|
||||
if (statusInt == 3) {
|
||||
List<CacheRealtimeData> realtimeDataList = (List<CacheRealtimeData>) cacheOrder.get(
|
||||
"realtimeDataList");
|
||||
cacheGun.put("idleCnt", 0);
|
||||
if (realtimeDataList == null) {
|
||||
realtimeDataList = new ArrayList<>();
|
||||
@ -118,7 +120,7 @@ public class RealtimeDataLogic implements ServiceLogic {
|
||||
// startChargingData.setPileNo(cacheOrder.get("pileNo").toString());
|
||||
// startChargingData.setGunId(cacheOrder.get("gunId").toString());
|
||||
// Thread.sleep(300);
|
||||
// chargingController.nativ-eRefreshBalance(startChargingData);
|
||||
// chargingController.nativeRefreshBalance(startChargingData);
|
||||
cacheRealtimeData.setCreateTime(DateUtil.now());
|
||||
String lord = orderkey.concat(".lord");
|
||||
REDIS.setCacheObject(lord, cacheRealtimeData);
|
||||
@ -145,7 +147,8 @@ public class RealtimeDataLogic implements ServiceLogic {
|
||||
HashMap<String, String> paramMap = new HashMap<>();
|
||||
paramMap.put("battery", stopSoc.toString());
|
||||
paramMap.put("phone", tel);
|
||||
paramMap.put("content", "【小华充电】尊敬的用户,你的车辆已充电达至设定的SOC("+stopSoc.toString()+"%)已自动停止充电,请您尽快将车辆挪走以方便他人使用充电桩,谢谢合作。");
|
||||
paramMap.put("content", "【小华充电】尊敬的用户,你的车辆已充电达至设定的SOC(" + stopSoc.toString() + "%)" +
|
||||
"已自动停止充电,请您尽快将车辆挪走以方便他人使用充电桩,谢谢合作。");
|
||||
smsService.sendNotice(paramMap);
|
||||
cacheOrder.put("socalerted", "true");
|
||||
}
|
||||
@ -167,6 +170,18 @@ public class RealtimeDataLogic implements ServiceLogic {
|
||||
cacheOrder.put("lordiss", "false");
|
||||
pileOrderService.pileStop(orderNo, 4, "订单实时数据恢复");
|
||||
}
|
||||
} else {
|
||||
Integer errorfreecnt = (Integer) cacheOrder.get("errorfreecnt");
|
||||
errorfreecnt = errorfreecnt == null ? 1 : ++errorfreecnt;
|
||||
if (errorfreecnt == 2) {
|
||||
final R r = pileOrderService.abnormalOrder(orderNo);
|
||||
if (r.getCode() != 200) {
|
||||
errorfreecnt = 1;
|
||||
}
|
||||
log.error("abnormal.1 order[{}]", orderNo);
|
||||
}
|
||||
cacheOrder.put("errorfreecnt", errorfreecnt);
|
||||
}
|
||||
REDIS.setCacheMap(orderkey, cacheOrder);
|
||||
} else {
|
||||
orderkey = (String) cacheGun.get("orderkey");
|
||||
@ -181,7 +196,7 @@ public class RealtimeDataLogic implements ServiceLogic {
|
||||
String status = (String) problematicOrder.get("status");
|
||||
if (!isInteger(status) && !status.equals("充电中") && orderData == null) {
|
||||
pileOrderService.abnormalOrder(orderNo);
|
||||
log.error("abnormal order[{}]", orderNo);
|
||||
log.error("abnormal.2 order[{}]", orderNo);
|
||||
cacheGun.put("orderkey", null);
|
||||
idleCnt = 0;
|
||||
}
|
||||
@ -199,7 +214,8 @@ public class RealtimeDataLogic implements ServiceLogic {
|
||||
return new ServiceResult(false);
|
||||
}
|
||||
|
||||
private CacheRealtimeData translate(RealtimeData realtimeData) throws InvocationTargetException, IllegalAccessException, InstantiationException {
|
||||
private CacheRealtimeData translate(RealtimeData realtimeData) throws InvocationTargetException, IllegalAccessException,
|
||||
InstantiationException {
|
||||
|
||||
Class<CacheRealtimeData> crdclz = CacheRealtimeData.class;
|
||||
Class<RealtimeData> rdclz = RealtimeData.class;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user