update 预约充电

This commit is contained in:
2023-03-29 13:45:10 +08:00
parent c40fe4e2b7
commit 1aaff6aff4
5 changed files with 90 additions and 18 deletions

View File

@@ -288,28 +288,25 @@ public class OrderService {
orderInfo.setPayTime(new Date());
orderBasicInfoService.updateOrderBasicInfo(orderInfo);
if (StringUtils.equals(orderInfo.getStartType(), StartTypeEnum.NOW.getValue())) {
startCharging(orderInfo);
if (StringUtils.equals(orderInfo.getStartType(), StartTypeEnum.NOW.getValue())) { // 立即启动充电
String pileSn = orderInfo.getPileSn();
// 发送启动充电指令前,再次下发计费模板
BillingTemplateVO billingTemplateVO = pileBillingTemplateService.selectBillingTemplateDetailByPileSn(pileSn);
if (billingTemplateVO != null) {
pileRemoteService.publishPileBillingTemplate(pileSn, billingTemplateVO);
}
// 发送启动指令
pileRemoteService.remoteStartCharging(pileSn, orderInfo.getConnectorCode(), orderInfo.getTransactionCode(), orderInfo.getPayAmount());
} else { // 预约充电
// 修改枪口状态为 占用预约
// 下发修改充电桩设置指令
}
}
/**
* 启动充电
* @param orderInfo
*/
public void startCharging(OrderBasicInfo orderInfo) {
String pileSn = orderInfo.getPileSn();
// 发送启动充电指令前,再次下发计费模板
BillingTemplateVO billingTemplateVO = pileBillingTemplateService.selectBillingTemplateDetailByPileSn(pileSn);
if (billingTemplateVO != null) {
pileRemoteService.publishPileBillingTemplate(pileSn, billingTemplateVO);
}
// 发送启动指令
pileRemoteService.remoteStartCharging(pileSn, orderInfo.getConnectorCode(), orderInfo.getTransactionCode(), orderInfo.getPayAmount());
}
/**
* 保存订单信息到数据库
*