update 启动充电之前,再次下发计费模板

This commit is contained in:
2023-03-10 11:53:11 +08:00
parent 34834dda91
commit f4251e0bd1
2 changed files with 34 additions and 4 deletions

View File

@@ -16,14 +16,15 @@ import com.jsowell.common.enums.ykc.OrderPayRecordEnum;
import com.jsowell.common.enums.ykc.OrderPayStatusEnum;
import com.jsowell.common.enums.ykc.OrderStatusEnum;
import com.jsowell.common.enums.ykc.PayModeEnum;
import com.jsowell.common.enums.ykc.ScenarioEnum;
import com.jsowell.common.enums.ykc.PileConnectorDataBaseStatusEnum;
import com.jsowell.common.enums.ykc.ReturnCodeEnum;
import com.jsowell.common.enums.ykc.ScenarioEnum;
import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.util.DateUtils;
import com.jsowell.common.util.StringUtils;
import com.jsowell.common.util.bean.BeanUtils;
import com.jsowell.common.util.id.IdUtils;
import com.jsowell.netty.command.ykc.PublishPileBillingTemplateCommand;
import com.jsowell.netty.command.ykc.StartChargingCommand;
import com.jsowell.netty.service.yunkuaichong.YKCPushCommandService;
import com.jsowell.pile.domain.MemberTransactionRecord;
@@ -42,7 +43,15 @@ import com.jsowell.pile.dto.SettleOrderDTO;
import com.jsowell.pile.dto.StopChargingDTO;
import com.jsowell.pile.dto.UniAppQueryOrderDTO;
import com.jsowell.pile.dto.WeixinPayDTO;
import com.jsowell.pile.service.*;
import com.jsowell.pile.service.IMemberBasicInfoService;
import com.jsowell.pile.service.IMemberTransactionRecordService;
import com.jsowell.pile.service.IOrderBasicInfoService;
import com.jsowell.pile.service.IOrderPayRecordService;
import com.jsowell.pile.service.IPileBillingTemplateService;
import com.jsowell.pile.service.IPileConnectorInfoService;
import com.jsowell.pile.service.IPileStationInfoService;
import com.jsowell.pile.service.WechatPayService;
import com.jsowell.pile.service.WxpayCallbackRecordService;
import com.jsowell.pile.transaction.dto.OrderTransactionDTO;
import com.jsowell.pile.transaction.service.TransactionService;
import com.jsowell.pile.vo.base.PileInfoVO;
@@ -66,7 +75,13 @@ import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
@@ -279,9 +294,20 @@ public class OrderService {
orderInfo.setPayTime(new Date());
orderBasicInfoService.updateOrderBasicInfo(orderInfo);
String pileSn = orderInfo.getPileSn();
// 发送启动充电指令前,再次下发计费模板
BillingTemplateVO billingTemplateVO = pileBillingTemplateService.selectBillingTemplateDetailByPileSn(pileSn);
if (billingTemplateVO != null) {
PublishPileBillingTemplateCommand templateCommand = new PublishPileBillingTemplateCommand();
templateCommand.setBillingTemplateVO(billingTemplateVO);
templateCommand.setPileSn(pileSn);
ykcPushCommandService.pushPublishPileBillingTemplate(templateCommand);
}
// 发送启动指令
StartChargingCommand startChargingCommand = StartChargingCommand.builder()
.pileSn(orderInfo.getPileSn())
.pileSn(pileSn)
.connectorCode(orderInfo.getConnectorCode())
.orderCode(dto.getOrderCode())
.chargeAmount(payAmount)