mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-13 11:49:49 +08:00
发送停止充电指令时,校验交易流水号是否一致
This commit is contained in:
@@ -93,10 +93,11 @@ public class PileRemoteService {
|
|||||||
* 远程停止充电
|
* 远程停止充电
|
||||||
*/
|
*/
|
||||||
public void remoteStopCharging(String pileSn, String connectorCode, String transactionCode) {
|
public void remoteStopCharging(String pileSn, String connectorCode, String transactionCode) {
|
||||||
// TODO 获取充电桩0x13数据,校验交易流水号是否一致
|
// 获取充电桩0x13数据,校验交易流水号是否一致
|
||||||
String pileIsChargingKey = CacheConstants.PILE_IS_CHARGING + pileSn + connectorCode;
|
String pileIsChargingKey = CacheConstants.PILE_IS_CHARGING + pileSn + connectorCode;
|
||||||
String redisResult = redisCache.getCacheObject(pileIsChargingKey);
|
String redisResult = redisCache.getCacheObject(pileIsChargingKey);
|
||||||
if (!StringUtils.equals(redisResult, transactionCode)) {
|
if (!StringUtils.equals(redisResult, transactionCode)) {
|
||||||
|
log.info("发送远程停止充电指令-充电桩枪口编号:{}, 获取到正在充电中的交易流水号:{}与入参交易流水号:{}不一致", pileSn + connectorCode, redisResult, transactionCode);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
StopChargingCommand command = StopChargingCommand.builder()
|
StopChargingCommand command = StopChargingCommand.builder()
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ import com.jsowell.common.util.PageUtils;
|
|||||||
import com.jsowell.common.util.StringUtils;
|
import com.jsowell.common.util.StringUtils;
|
||||||
import com.jsowell.pile.domain.*;
|
import com.jsowell.pile.domain.*;
|
||||||
import com.jsowell.pile.domain.ykcCommond.StartChargingCommand;
|
import com.jsowell.pile.domain.ykcCommond.StartChargingCommand;
|
||||||
import com.jsowell.pile.domain.ykcCommond.StopChargingCommand;
|
|
||||||
import com.jsowell.pile.dto.*;
|
import com.jsowell.pile.dto.*;
|
||||||
import com.jsowell.pile.service.*;
|
import com.jsowell.pile.service.*;
|
||||||
import com.jsowell.pile.vo.base.ConnectorInfoVO;
|
import com.jsowell.pile.vo.base.ConnectorInfoVO;
|
||||||
@@ -93,6 +92,9 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private YKCPushCommandService ykcPushCommandService;
|
private YKCPushCommandService ykcPushCommandService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private PileRemoteService pileRemoteService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private YCBCService ycbcService;
|
private YCBCService ycbcService;
|
||||||
|
|
||||||
@@ -933,11 +935,12 @@ public class LianLianServiceImpl implements LianLianService {
|
|||||||
// 若状态为充电中,则发送停机指令
|
// 若状态为充电中,则发送停机指令
|
||||||
if (StringUtils.equals(OrderStatusEnum.IN_THE_CHARGING.getValue(), orderInfo.getOrderStatus())) {
|
if (StringUtils.equals(OrderStatusEnum.IN_THE_CHARGING.getValue(), orderInfo.getOrderStatus())) {
|
||||||
// 充电中
|
// 充电中
|
||||||
StopChargingCommand command = StopChargingCommand.builder()
|
// StopChargingCommand command = StopChargingCommand.builder()
|
||||||
.pileSn(orderInfo.getPileSn())
|
// .pileSn(orderInfo.getPileSn())
|
||||||
.connectorCode(orderInfo.getConnectorCode())
|
// .connectorCode(orderInfo.getConnectorCode())
|
||||||
.build();
|
// .build();
|
||||||
ykcPushCommandService.pushStopChargingCommand(command);
|
// ykcPushCommandService.pushStopChargingCommand(command);
|
||||||
|
pileRemoteService.remoteStopCharging(orderInfo.getPileSn(), orderInfo.getConnectorCode(), orderInfo.getTransactionCode());
|
||||||
vo.setStartChargeSeq(orderCode);
|
vo.setStartChargeSeq(orderCode);
|
||||||
vo.setStartChargeSeqStat(4); // 1、启动中 ;2、充电中;3、停止中;4、已结束;5、未知
|
vo.setStartChargeSeqStat(4); // 1、启动中 ;2、充电中;3、停止中;4、已结束;5、未知
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,6 +72,9 @@ public abstract class AbsInterfaceWithPlatformLogic implements InitializingBean
|
|||||||
@Autowired
|
@Autowired
|
||||||
protected YKCPushCommandService ykcPushCommandService;
|
protected YKCPushCommandService ykcPushCommandService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
protected PileRemoteService pileRemoteService;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
protected ZDLService zdlService;
|
protected ZDLService zdlService;
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ import com.jsowell.common.util.PageUtils;
|
|||||||
import com.jsowell.common.util.StringUtils;
|
import com.jsowell.common.util.StringUtils;
|
||||||
import com.jsowell.pile.domain.*;
|
import com.jsowell.pile.domain.*;
|
||||||
import com.jsowell.pile.domain.ykcCommond.StartChargingCommand;
|
import com.jsowell.pile.domain.ykcCommond.StartChargingCommand;
|
||||||
import com.jsowell.pile.domain.ykcCommond.StopChargingCommand;
|
|
||||||
import com.jsowell.pile.dto.*;
|
import com.jsowell.pile.dto.*;
|
||||||
import com.jsowell.pile.vo.base.ConnectorInfoVO;
|
import com.jsowell.pile.vo.base.ConnectorInfoVO;
|
||||||
import com.jsowell.pile.vo.base.ThirdPartyStationInfoVO;
|
import com.jsowell.pile.vo.base.ThirdPartyStationInfoVO;
|
||||||
@@ -903,11 +902,12 @@ public class HaiNanPlatformLogic extends AbsInterfaceWithPlatformLogic {
|
|||||||
// 若状态为充电中,则发送停机指令
|
// 若状态为充电中,则发送停机指令
|
||||||
if (StringUtils.equals(OrderStatusEnum.IN_THE_CHARGING.getValue(), orderInfo.getOrderStatus())) {
|
if (StringUtils.equals(OrderStatusEnum.IN_THE_CHARGING.getValue(), orderInfo.getOrderStatus())) {
|
||||||
// 充电中
|
// 充电中
|
||||||
StopChargingCommand command = StopChargingCommand.builder()
|
// StopChargingCommand command = StopChargingCommand.builder()
|
||||||
.pileSn(orderInfo.getPileSn())
|
// .pileSn(orderInfo.getPileSn())
|
||||||
.connectorCode(orderInfo.getConnectorCode())
|
// .connectorCode(orderInfo.getConnectorCode())
|
||||||
.build();
|
// .build();
|
||||||
ykcPushCommandService.pushStopChargingCommand(command);
|
// ykcPushCommandService.pushStopChargingCommand(command);
|
||||||
|
pileRemoteService.remoteStopCharging(orderInfo.getPileSn(), orderInfo.getConnectorCode(), orderInfo.getTransactionCode());
|
||||||
vo.setStartChargeSeq(orderCode);
|
vo.setStartChargeSeq(orderCode);
|
||||||
vo.setStartChargeSeqStat(4); // 1、启动中 ;2、充电中;3、停止中;4、已结束;5、未知
|
vo.setStartChargeSeqStat(4); // 1、启动中 ;2、充电中;3、停止中;4、已结束;5、未知
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user