WIP:三方对接逻辑
This commit is contained in:
parent
aa93392680
commit
63227d69b8
@ -90,7 +90,7 @@ public class QueryEquipChargeStatusController {
|
||||
equipChargeStatus.setConnectorStatus(connectorStatus);
|
||||
//A相电流
|
||||
String current = (String) cacheGunData.get("current");
|
||||
Double currentA = Double.valueOf(current);
|
||||
Double currentA = Double.valueOf(current); // todo 16-base/10
|
||||
equipChargeStatus.setCurrentA(currentA);
|
||||
//A相电压
|
||||
String voltage = (String) cacheGunData.get("voltage");
|
||||
|
||||
@ -126,7 +126,7 @@ public class QueryStopChargeController {
|
||||
commonResponse.setRet("1");
|
||||
commonResponse.setMsg("请求停止充电失败");
|
||||
commonResponse.setData(data);
|
||||
|
||||
return commonResponse;
|
||||
}
|
||||
|
||||
//设置该订单已经被停止的标识
|
||||
|
||||
@ -23,9 +23,9 @@ public interface PowerPileService {
|
||||
@PostMapping("/charging/balance/refresh")
|
||||
R refreshBalance(@Validated @RequestBody StartChargingData balanceRefreshData);
|
||||
|
||||
@PutMapping("charging/stop/{orderNo}/{pileNo}/{gunId}/{version}")
|
||||
@PutMapping("charging/stop/{orderNo}/{pileNo}/{connectorId}/{version}")
|
||||
R stopCharging(@PathVariable("orderNo") String orderNo, @PathVariable("pileNo") String pileNo,
|
||||
@PathVariable("gunId") String gunId, @PathVariable("version") String version);
|
||||
@PathVariable("connectorId") String connectorId, @PathVariable("version") String version);
|
||||
|
||||
@PostMapping("/pile/whitelist/add/{stationId}/{version}")
|
||||
R addPileWhitelist(@PathVariable("stationId") Long stationId,
|
||||
|
||||
@ -35,7 +35,7 @@ public class PowerPileFallbackFactory implements FallbackFactory<PowerPileServic
|
||||
}
|
||||
|
||||
@Override
|
||||
public R stopCharging(String orderNo, String pileNo, String gunId, String version) {
|
||||
public R stopCharging(String orderNo, String pileNo, String connectorId, String version) {
|
||||
|
||||
return R.fail("停止充电失败:" + cause.getMessage());
|
||||
}
|
||||
|
||||
@ -263,7 +263,8 @@ public class XhpcChargeOrderServiceImpl implements IXhpcChargeOrderService {
|
||||
XhpcChargeOrder order = xhpcChargeOrderMapper.getChargingOrderId(chargingOrderId);
|
||||
|
||||
|
||||
R oa = powerPileService.stopCharging(order.getSerialNumber(),xhpcTerminal.getPileSerialNumber(), xhpcTerminal.getSerialNumber().substring(14), version);
|
||||
R oa = powerPileService.stopCharging(order.getSerialNumber(), xhpcTerminal.getPileSerialNumber(),
|
||||
xhpcTerminal.getSerialNumber(), version);
|
||||
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<停止充电返回>>>>>>>>>>>>>>>>>");
|
||||
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<"+oa.getCode()+">>>>>>>>>>>>>>>>>");
|
||||
logger.info("<<<<<<<<<<<<<<<<<<<<<<<<"+oa.getMsg()+">>>>>>>>>>>>>>>>>");
|
||||
|
||||
@ -132,9 +132,9 @@ public class ChargingController {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
@PutMapping("charging/stop/{orderNo}/{pileNo}/{gunId}/{version}")
|
||||
@PutMapping("charging/stop/{orderNo}/{pileNo}/{connectorId}/{version}")
|
||||
public R stopCharging(@PathVariable("orderNo") String orderNo, @PathVariable("pileNo") String pileNo,
|
||||
@PathVariable("gunId") String gunId,
|
||||
@PathVariable("connectorId") String connectorId,
|
||||
@PathVariable(
|
||||
"version") String version) {
|
||||
|
||||
@ -148,7 +148,7 @@ public class ChargingController {
|
||||
if (!REGISTERED.equals(status)) {
|
||||
r = R.fail("充电桩离线");
|
||||
}
|
||||
String gunkey = pkey.concat(gunId).replace("pile", "gun");
|
||||
String gunkey = "gun:".concat(connectorId);
|
||||
final Map<String, Object> cacheGun = REDIS.getCacheMap(gunkey);
|
||||
if (cacheGun.get("orderkey") == null || !cacheGun.get("orderkey").toString().endsWith(orderNo) || !orderNo.contains(pileNo)) {
|
||||
r = R.fail("错误的订单号");
|
||||
@ -160,7 +160,7 @@ public class ChargingController {
|
||||
String response = HttpUtils.get(fmt(svcSrv)
|
||||
.concat("/native/charging/stop/")
|
||||
.concat(pileNo).concat("/")
|
||||
.concat(gunId).concat("/")
|
||||
.concat(connectorId).concat("/")
|
||||
.concat(version));
|
||||
r = getRR(response);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user