只能对充电中的端口停止充电
This commit is contained in:
parent
ac5d959214
commit
38b04df6a5
@ -74,11 +74,10 @@ public class ChargingController {
|
|||||||
r = R.fail("Native服务调用失败");
|
r = R.fail("Native服务调用失败");
|
||||||
} else {
|
} else {
|
||||||
int code = responseJson.getInteger("code");
|
int code = responseJson.getInteger("code");
|
||||||
|
log.info(response);
|
||||||
if (code != 200) {//todo rat
|
if (code != 200) {//todo rat
|
||||||
log.error("!200:" + response);
|
|
||||||
r = R.fail(code, responseJson.getString("msg"));
|
r = R.fail(code, responseJson.getString("msg"));
|
||||||
} else {
|
} else {
|
||||||
log.error("200:" + response);
|
|
||||||
r = R.ok(responseJson.get("data"), responseJson.getString("msg"));
|
r = R.ok(responseJson.get("data"), responseJson.getString("msg"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -146,6 +145,9 @@ public class ChargingController {
|
|||||||
if (!REGISTERED.equals(status)) {
|
if (!REGISTERED.equals(status)) {
|
||||||
r = R.fail("充电桩离线");
|
r = R.fail("充电桩离线");
|
||||||
}
|
}
|
||||||
|
String gunkey = pkey.concat(gunId);
|
||||||
|
String gunStatus = REDIS.getCacheMapValue(gunkey, "status");
|
||||||
|
if (!("空闲".equals(gunStatus) || "离线".equals(gunStatus) || "故障".equals(gunStatus))) {
|
||||||
if (r.getCode() == 200) {
|
if (r.getCode() == 200) {
|
||||||
String svcSrv = cachePile.get("svcSrv");
|
String svcSrv = cachePile.get("svcSrv");
|
||||||
String response = HttpUtils.get(fmt(svcSrv)
|
String response = HttpUtils.get(fmt(svcSrv)
|
||||||
@ -155,6 +157,9 @@ public class ChargingController {
|
|||||||
.concat(version));
|
.concat(version));
|
||||||
r = getRR(response);
|
r = getRR(response);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
r = R.fail("端口不在充电中");
|
||||||
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -36,6 +36,7 @@ public class RemoteStopReplyDataLogic implements ServiceLogic {
|
|||||||
String gunkey = "gun:".concat(remoteStopReplyData.getPileNo()).concat(remoteStopReplyData.getGunId());
|
String gunkey = "gun:".concat(remoteStopReplyData.getPileNo()).concat(remoteStopReplyData.getGunId());
|
||||||
Map<String, Object> cacheGun = REDIS.getCacheMap(gunkey);
|
Map<String, Object> cacheGun = REDIS.getCacheMap(gunkey);
|
||||||
String orderkey = (String) cacheGun.get("orderkey");
|
String orderkey = (String) cacheGun.get("orderkey");
|
||||||
|
if (orderkey != null) {
|
||||||
Map<String, Object> cacheOrder = REDIS.getCacheMap(orderkey);
|
Map<String, Object> cacheOrder = REDIS.getCacheMap(orderkey);
|
||||||
String stopResult = remoteStopReplyData.getStopResult();
|
String stopResult = remoteStopReplyData.getStopResult();
|
||||||
cacheOrder.put("stopResult", stopResult);
|
cacheOrder.put("stopResult", stopResult);
|
||||||
@ -46,6 +47,7 @@ public class RemoteStopReplyDataLogic implements ServiceLogic {
|
|||||||
} else {
|
} else {
|
||||||
pileOrderService.pileStop(orderNo, 2, frs[Integer.parseInt(remoteStopReplyData.getFailReason())]);
|
pileOrderService.pileStop(orderNo, 2, frs[Integer.parseInt(remoteStopReplyData.getFailReason())]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return new ServiceResult(false);
|
return new ServiceResult(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user