mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
update 并充启动充电给两把枪都下发启动充电指令
This commit is contained in:
@@ -12,13 +12,16 @@ import com.jsowell.common.enums.ykc.ReturnCodeEnum;
|
||||
import com.jsowell.common.exception.BusinessException;
|
||||
import com.jsowell.common.util.BytesUtil;
|
||||
import com.jsowell.common.util.StringUtils;
|
||||
import com.jsowell.common.util.YKCUtils;
|
||||
import com.jsowell.pile.domain.PileBillingTemplate;
|
||||
import com.jsowell.pile.domain.PileConnectorInfo;
|
||||
import com.jsowell.pile.domain.PileFirmwareInfo;
|
||||
import com.jsowell.pile.domain.ebike.deviceupload.ChargingOperationResponse;
|
||||
import com.jsowell.pile.domain.ykcCommond.*;
|
||||
import com.jsowell.pile.dto.PublishBillingTemplateDTO;
|
||||
import com.jsowell.pile.dto.RemoteAccountBalanceUpdateDTO;
|
||||
import com.jsowell.pile.dto.UpdateFirmwareDTO;
|
||||
import com.jsowell.pile.vo.base.ConnectorInfoVO;
|
||||
import com.jsowell.pile.vo.web.BillingTemplateVO;
|
||||
import com.jsowell.pile.vo.web.PileDetailVO;
|
||||
import com.jsowell.wxpay.service.WxAppletRemoteService;
|
||||
@@ -65,6 +68,9 @@ public class PileRemoteService {
|
||||
@Autowired
|
||||
private OrderBasicInfoService orderBasicInfoService;
|
||||
|
||||
@Autowired
|
||||
private PileConnectorInfoService pileConnectorInfoService;
|
||||
|
||||
@Value("${remoteUpdate.server}")
|
||||
private String serverAddress;
|
||||
|
||||
@@ -132,29 +138,42 @@ public class PileRemoteService {
|
||||
/**
|
||||
* 远程启动并充充电 0xA4
|
||||
* @param pileSn
|
||||
* @param connectorCode
|
||||
* @param transactionCode
|
||||
* @param chargeAmount
|
||||
*/
|
||||
public void remoteStartMergeCharging(String pileSn, String connectorCode, String transactionCode,
|
||||
public void remoteStartMergeCharging(String pileSn, String transactionCode,
|
||||
BigDecimal chargeAmount, String mergeChargeCode) {
|
||||
if (StringUtils.isEmpty(pileSn) || StringUtils.isEmpty(connectorCode)) {
|
||||
log.warn("远程启动充电, 充电桩编号和枪口号不能为空");
|
||||
if (StringUtils.isEmpty(pileSn)) {
|
||||
log.warn("远程启动并充充电, 充电桩编号不能为空");
|
||||
return;
|
||||
}
|
||||
log.info("【=====平台下发指令=====】: 远程启动并充充电, 桩号:{}, 枪口号:{}", pileSn, connectorCode);
|
||||
List<PileConnectorInfo> pileConnectorInfos = pileConnectorInfoService.selectPileConnectorInfoList(pileSn);
|
||||
log.info("【=====平台下发指令=====】: 远程启动并充充电, 桩号:{}", pileSn);
|
||||
|
||||
StartMergeChargeCommand command = StartMergeChargeCommand.builder()
|
||||
.pileSn(pileSn)
|
||||
.connectorCode(connectorCode)
|
||||
// .logicCardCode()
|
||||
.transactionCode(transactionCode)
|
||||
// .physicsCardCode()
|
||||
.accountAmount(chargeAmount)
|
||||
.mergeChargeCode(mergeChargeCode)
|
||||
if (CollectionUtils.isEmpty(pileConnectorInfos)) {
|
||||
log.info("远程启动并充充电, 枪口列表为空");
|
||||
return;
|
||||
}
|
||||
// 筛选出枪口号
|
||||
List<String> connectorCodeList = pileConnectorInfos.stream()
|
||||
.map(PileConnectorInfo::getPileConnectorCode)
|
||||
.collect(Collectors.toList());
|
||||
for (String pileConnectorCode : connectorCodeList) {
|
||||
// 获取枪口号
|
||||
String connectorCode = YKCUtils.getConnectorCode(pileConnectorCode);
|
||||
// 两把枪都要下发启动充电指令
|
||||
StartMergeChargeCommand command = StartMergeChargeCommand.builder()
|
||||
.pileSn(pileSn)
|
||||
.connectorCode(connectorCode)
|
||||
// .logicCardCode()
|
||||
.transactionCode(transactionCode)
|
||||
// .physicsCardCode()
|
||||
.accountAmount(chargeAmount)
|
||||
.mergeChargeCode(mergeChargeCode)
|
||||
|
||||
.build();
|
||||
ykcPushCommandService.pushStartMergeChargingCommand(command);
|
||||
.build();
|
||||
ykcPushCommandService.pushStartMergeChargingCommand(command);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4283,7 +4283,7 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
||||
String orderType = orderInfo.getOrderType();
|
||||
if (StringUtils.equals(OrderTypeEnum.MERGE_CHARGE_ORDER.getValue(), orderType)) {
|
||||
// 并充订单,调用并充启动充电
|
||||
pileRemoteService.remoteStartMergeCharging(pileSn, orderInfo.getConnectorCode(), orderInfo.getTransactionCode(), chargeAmount, orderInfo.getMergeChargeNumber());
|
||||
pileRemoteService.remoteStartMergeCharging(pileSn, orderInfo.getTransactionCode(), chargeAmount, orderInfo.getMergeChargeNumber());
|
||||
}else {
|
||||
// 普通订单启动充电
|
||||
pileRemoteService.remoteStartCharging(pileSn, orderInfo.getConnectorCode(), orderInfo.getTransactionCode(), chargeAmount);
|
||||
|
||||
Reference in New Issue
Block a user