为生产环境回滚暂存
This commit is contained in:
parent
7ed701baea
commit
d5bbfca20f
@ -64,7 +64,12 @@ public class NotificationChargeOrderInfo4BonusTask extends CoreDispatcher {
|
|||||||
if (operatorIdEvcs == null) {
|
if (operatorIdEvcs == null) {
|
||||||
Long chargingStationId = xhpcHistoryOrder.getChargingStationId();
|
Long chargingStationId = xhpcHistoryOrder.getChargingStationId();
|
||||||
XhpcChargingStation station = chargingStationRepo.findById(chargingStationId).orElse(null);
|
XhpcChargingStation station = chargingStationRepo.findById(chargingStationId).orElse(null);
|
||||||
operatorIdEvcs = station.getOperatorIdEvcs();
|
String stationOperatorIdEvcs = station.getOperatorIdEvcs();
|
||||||
|
if (stationOperatorIdEvcs == null) {
|
||||||
|
logger.error("station[{}] operator id evcs not set", chargingStationId);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
operatorIdEvcs = stationOperatorIdEvcs.substring(8, 17);
|
||||||
}
|
}
|
||||||
EtOrderMapping etOrderMapping = saveOrderMapping(xhpcHistoryOrder, orderMappingRepository, operatorIdEvcs);
|
EtOrderMapping etOrderMapping = saveOrderMapping(xhpcHistoryOrder, orderMappingRepository, operatorIdEvcs);
|
||||||
CDChargeOrderInfo4BonusReq cdChargeOrderInfo4BonusReq = new CDChargeOrderInfo4BonusReq(xhpcHistoryOrder,
|
CDChargeOrderInfo4BonusReq cdChargeOrderInfo4BonusReq = new CDChargeOrderInfo4BonusReq(xhpcHistoryOrder,
|
||||||
|
|||||||
@ -86,7 +86,6 @@ public class NotificationStopChargeResultTask extends CoreDispatcher {
|
|||||||
chargeResultRequestCommonRequest.setData(jsonData);
|
chargeResultRequestCommonRequest.setData(jsonData);
|
||||||
String result = ok(chargeResultRequestCommonRequest, "/notification_stop_charge_result",
|
String result = ok(chargeResultRequestCommonRequest, "/notification_stop_charge_result",
|
||||||
authSecretTokenOut, operatorId3rdpty);
|
authSecretTokenOut, operatorId3rdpty);
|
||||||
|
|
||||||
ChargeResultResponse chargeResultResponse = JSONUtil.readParams(result, ChargeResultResponse.class);
|
ChargeResultResponse chargeResultResponse = JSONUtil.readParams(result, ChargeResultResponse.class);
|
||||||
succStat = chargeResultResponse.getSuccStat();
|
succStat = chargeResultResponse.getSuccStat();
|
||||||
//推送成功则排除这个已推送的订单,否则则继续推送该订单 // 用于测试暂时注释
|
//推送成功则排除这个已推送的订单,否则则继续推送该订单 // 用于测试暂时注释
|
||||||
|
|||||||
@ -270,8 +270,9 @@ public class ChargingController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("native/charging/stop/{pileNo}/{gunId}/{version}")
|
@GetMapping("native/charging/stop/{pileNo}/{connectorId}/{version}")
|
||||||
public R nativeStopCharging(@PathVariable("pileNo") String pileNo, @PathVariable("gunId") String gunId, @PathVariable("version") String version) {
|
public R nativeStopCharging(@PathVariable("pileNo") String pileNo, @PathVariable("connectorId") String connectorId,
|
||||||
|
@PathVariable("version") String version) {
|
||||||
|
|
||||||
ClientHandler handler = ChargingPileServer.getHandler(pileNo);
|
ClientHandler handler = ChargingPileServer.getHandler(pileNo);
|
||||||
if (handler == null) {
|
if (handler == null) {
|
||||||
@ -281,10 +282,10 @@ public class ChargingController {
|
|||||||
try {
|
try {
|
||||||
String pileKey = "pile:".concat(pileNo);
|
String pileKey = "pile:".concat(pileNo);
|
||||||
if (CacheDataUtils.hori(pileKey)) return R.fail("充电桩正在忙碌,请重试");
|
if (CacheDataUtils.hori(pileKey)) return R.fail("充电桩正在忙碌,请重试");
|
||||||
String gunkey = "gun:".concat(pileNo).concat(gunId);
|
String gunkey = "gun:".concat(pileNo).concat(connectorId);
|
||||||
String skey = gunkey.concat(".seqhex");
|
String skey = gunkey.concat(".seqhex");
|
||||||
String seq = seqHex(skey);
|
String seq = seqHex(skey);
|
||||||
byte[] msg = translateStop(pileNo, gunId, version, seq);
|
byte[] msg = translateStop(connectorId, version, seq);
|
||||||
if (!handler.isOpen()) {
|
if (!handler.isOpen()) {
|
||||||
log.error("send message failed. [{}]({}) connection lost", handler.getName(), pileNo);
|
log.error("send message failed. [{}]({}) connection lost", handler.getName(), pileNo);
|
||||||
removeHandler(pileNo);
|
removeHandler(pileNo);
|
||||||
@ -322,17 +323,16 @@ public class ChargingController {
|
|||||||
return HexUtils.toBytes(msg);
|
return HexUtils.toBytes(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
private byte[] translateStop(String pileNo, String gunId, String version, String seq) {
|
private byte[] translateStop(String connectorId, String version, String seq) {
|
||||||
|
|
||||||
byte[] data = new byte[0];
|
byte[] data = new byte[0];
|
||||||
data = ArrayUtils.addAll(data, HexUtils.toBytes("680C".concat(seq).concat("0036")));
|
data = ArrayUtils.addAll(data, HexUtils.toBytes("680C".concat(seq).concat("0036")));
|
||||||
if (default_version.equals(version)) {
|
if (default_version.equals(version)) {
|
||||||
data = ArrayUtils.addAll(data, HexUtils.toBytes(pileNo));
|
data = ArrayUtils.addAll(data, HexUtils.toBytes(connectorId));
|
||||||
data = ArrayUtils.addAll(data, HexUtils.toBytes(gunId));
|
|
||||||
}
|
}
|
||||||
String msg = HexUtils.toHex(data);
|
String msg = HexUtils.toHex(data);
|
||||||
msg = msg.concat(CRCCalculator.calcCrc(msg));
|
msg = msg.concat(CRCCalculator.calcCrc(msg));
|
||||||
log.info("stop charging, send msg to terminal ({}{}) >>>> {}", pileNo, gunId, msg);
|
log.info("stop charging, send msg to terminal ({}) >>>> {}", connectorId, msg);
|
||||||
return HexUtils.toBytes(msg);
|
return HexUtils.toBytes(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -18,10 +18,10 @@ spring:
|
|||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 127.0.0.1:8848
|
server-addr: 172.31.183.135:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user