mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-22 03:55:17 +08:00
发送停止充电指令时,校验交易流水号是否一致
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package com.jsowell.pile.service;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.jsowell.common.constant.CacheConstants;
|
||||
import com.jsowell.common.core.redis.RedisCache;
|
||||
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
@@ -38,7 +40,8 @@ public class PileRemoteService {
|
||||
@Autowired
|
||||
private PileFirmwareInfoService pileFirmwareInfoService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private RedisCache redisCache;
|
||||
/**
|
||||
* 获取充电桩实时数据信息
|
||||
*
|
||||
@@ -89,9 +92,13 @@ public class PileRemoteService {
|
||||
/**
|
||||
* 远程停止充电
|
||||
*/
|
||||
public void remoteStopCharging(String pileSn, String connectorCode) {
|
||||
public void remoteStopCharging(String pileSn, String connectorCode, String transactionCode) {
|
||||
// TODO 获取充电桩0x13数据,校验交易流水号是否一致
|
||||
|
||||
String pileIsChargingKey = CacheConstants.PILE_IS_CHARGING + pileSn + connectorCode;
|
||||
String redisResult = redisCache.getCacheObject(pileIsChargingKey);
|
||||
if (!StringUtils.equals(redisResult, transactionCode)) {
|
||||
return;
|
||||
}
|
||||
StopChargingCommand command = StopChargingCommand.builder()
|
||||
.pileSn(pileSn)
|
||||
.connectorCode(connectorCode)
|
||||
|
||||
Reference in New Issue
Block a user