From 58aa5c662b9a1ef41ae5749ee0ed7c721869d09c Mon Sep 17 00:00:00 2001 From: "autumn.g@foxmail.com" Date: Wed, 21 Feb 2024 16:30:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E9=80=81=E5=81=9C=E6=AD=A2=E5=85=85?= =?UTF-8?q?=E7=94=B5=E6=8C=87=E4=BB=A4=E6=97=B6=EF=BC=8C=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E4=BA=A4=E6=98=93=E6=B5=81=E6=B0=B4=E5=8F=B7=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsowell/pile/service/PileRemoteService.java | 3 ++- .../service/impl/LianLianServiceImpl.java | 15 +++++++++------ .../platform/AbsInterfaceWithPlatformLogic.java | 3 +++ .../hainan/service/HaiNanPlatformLogic.java | 12 ++++++------ 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/PileRemoteService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/PileRemoteService.java index 6f6b4cfad..5a88a4e69 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/PileRemoteService.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/PileRemoteService.java @@ -93,10 +93,11 @@ public class PileRemoteService { * 远程停止充电 */ public void remoteStopCharging(String pileSn, String connectorCode, String transactionCode) { - // TODO 获取充电桩0x13数据,校验交易流水号是否一致 + // 获取充电桩0x13数据,校验交易流水号是否一致 String pileIsChargingKey = CacheConstants.PILE_IS_CHARGING + pileSn + connectorCode; String redisResult = redisCache.getCacheObject(pileIsChargingKey); if (!StringUtils.equals(redisResult, transactionCode)) { + log.info("发送远程停止充电指令-充电桩枪口编号:{}, 获取到正在充电中的交易流水号:{}与入参交易流水号:{}不一致", pileSn + connectorCode, redisResult, transactionCode); return; } StopChargingCommand command = StopChargingCommand.builder() diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/service/impl/LianLianServiceImpl.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/service/impl/LianLianServiceImpl.java index bce7f5486..7981cfeec 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/service/impl/LianLianServiceImpl.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/lianlian/service/impl/LianLianServiceImpl.java @@ -26,7 +26,6 @@ import com.jsowell.common.util.PageUtils; import com.jsowell.common.util.StringUtils; import com.jsowell.pile.domain.*; import com.jsowell.pile.domain.ykcCommond.StartChargingCommand; -import com.jsowell.pile.domain.ykcCommond.StopChargingCommand; import com.jsowell.pile.dto.*; import com.jsowell.pile.service.*; import com.jsowell.pile.vo.base.ConnectorInfoVO; @@ -93,6 +92,9 @@ public class LianLianServiceImpl implements LianLianService { @Autowired private YKCPushCommandService ykcPushCommandService; + @Autowired + private PileRemoteService pileRemoteService; + @Autowired private YCBCService ycbcService; @@ -933,11 +935,12 @@ public class LianLianServiceImpl implements LianLianService { // 若状态为充电中,则发送停机指令 if (StringUtils.equals(OrderStatusEnum.IN_THE_CHARGING.getValue(), orderInfo.getOrderStatus())) { // 充电中 - StopChargingCommand command = StopChargingCommand.builder() - .pileSn(orderInfo.getPileSn()) - .connectorCode(orderInfo.getConnectorCode()) - .build(); - ykcPushCommandService.pushStopChargingCommand(command); + // StopChargingCommand command = StopChargingCommand.builder() + // .pileSn(orderInfo.getPileSn()) + // .connectorCode(orderInfo.getConnectorCode()) + // .build(); + // ykcPushCommandService.pushStopChargingCommand(command); + pileRemoteService.remoteStopCharging(orderInfo.getPileSn(), orderInfo.getConnectorCode(), orderInfo.getTransactionCode()); vo.setStartChargeSeq(orderCode); vo.setStartChargeSeqStat(4); // 1、启动中 ;2、充电中;3、停止中;4、已结束;5、未知 } diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/AbsInterfaceWithPlatformLogic.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/AbsInterfaceWithPlatformLogic.java index 02109e3e4..1b9a68c5a 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/AbsInterfaceWithPlatformLogic.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/AbsInterfaceWithPlatformLogic.java @@ -72,6 +72,9 @@ public abstract class AbsInterfaceWithPlatformLogic implements InitializingBean @Autowired protected YKCPushCommandService ykcPushCommandService; + @Autowired + protected PileRemoteService pileRemoteService; + @Autowired protected ZDLService zdlService; diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/hainan/service/HaiNanPlatformLogic.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/hainan/service/HaiNanPlatformLogic.java index 2a23546f6..4f79f7749 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/hainan/service/HaiNanPlatformLogic.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/hainan/service/HaiNanPlatformLogic.java @@ -19,7 +19,6 @@ import com.jsowell.common.util.PageUtils; import com.jsowell.common.util.StringUtils; import com.jsowell.pile.domain.*; import com.jsowell.pile.domain.ykcCommond.StartChargingCommand; -import com.jsowell.pile.domain.ykcCommond.StopChargingCommand; import com.jsowell.pile.dto.*; import com.jsowell.pile.vo.base.ConnectorInfoVO; 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())) { // 充电中 - StopChargingCommand command = StopChargingCommand.builder() - .pileSn(orderInfo.getPileSn()) - .connectorCode(orderInfo.getConnectorCode()) - .build(); - ykcPushCommandService.pushStopChargingCommand(command); + // StopChargingCommand command = StopChargingCommand.builder() + // .pileSn(orderInfo.getPileSn()) + // .connectorCode(orderInfo.getConnectorCode()) + // .build(); + // ykcPushCommandService.pushStopChargingCommand(command); + pileRemoteService.remoteStopCharging(orderInfo.getPileSn(), orderInfo.getConnectorCode(), orderInfo.getTransactionCode()); vo.setStartChargeSeq(orderCode); vo.setStartChargeSeqStat(4); // 1、启动中 ;2、充电中;3、停止中;4、已结束;5、未知 }