update 电单车

This commit is contained in:
Guoqs
2024-09-20 14:45:47 +08:00
parent dbc037727e
commit 00b442572a
12 changed files with 74 additions and 34 deletions

View File

@@ -21,6 +21,7 @@ import com.jsowell.pile.dto.RemoteAccountBalanceUpdateDTO;
import com.jsowell.pile.dto.UpdateFirmwareDTO;
import com.jsowell.pile.vo.web.BillingTemplateVO;
import com.jsowell.pile.vo.web.PileDetailVO;
import com.jsowell.wxpay.service.WxAppletRemoteService;
import org.apache.commons.collections4.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -54,6 +55,9 @@ public class PileRemoteService {
@Autowired
private RedisCache redisCache;
@Autowired
private WxAppletRemoteService wxAppletRemoteService;
@Autowired
private EBikeSendCommandService eBikeSendCommandService;
@@ -108,6 +112,12 @@ public class PileRemoteService {
log.warn("远程启动充电, 充电桩编号和枪口号不能为空");
return;
}
// 发送启动充电指令前,再次下发计费模板
BillingTemplateVO billingTemplateVO = pileBillingTemplateService.selectBillingTemplateDetailByPileSn(pileSn);
this.publishPileBillingTemplate(pileSn, billingTemplateVO);
log.info("发送启动充电指令前,再次下发计费模板, transactionCode:{}, 计费模板:{}", transactionCode, JSON.toJSONString(billingTemplateVO));
log.info("【=====平台下发指令=====】: 远程启动充电, 桩号:{}, 枪口号:{}", pileSn, connectorCode);
StartChargingCommand startChargingCommand = StartChargingCommand.builder()
.pileSn(pileSn)
@@ -131,7 +141,12 @@ public class PileRemoteService {
startChargingCommand.setPileSn(pileSn);
startChargingCommand.setConnectorCode(connectorCode);
startChargingCommand.setTransactionCode(transactionCode);
startChargingCommand.setChargeAmount(chargeAmount);
startChargingCommand.setChargeAmount(chargeAmount); // 电单车这个字段表示具体度数
startChargingCommand.setRateMode(2);
// 根据启动金额计算电量
BigDecimal electricity = BigDecimal.ZERO;
startChargingCommand.setElectricity(electricity);
try {
ChargingOperationResponse startChargingResponse = eBikeSendCommandService.sendStartChargingCommand(startChargingCommand);