This commit is contained in:
Lemon
2023-07-20 16:04:03 +08:00
6 changed files with 24 additions and 29 deletions

View File

@@ -629,7 +629,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
// 有时候充电桩到达金额停止充电会多出一点金额比如实际需要充50元的电充电桩传来的消费金额为50.01元,在后台记录的时候需要舍去
if (orderAmount.compareTo(payAmount) > 0) {
logger.info("结算订单:【{}】充电桩传来的消费金额:【{}】大于付款金额:【{}】, 消费金额设置为付款金额相等数据", orderBasicInfo.getOrderCode(), orderAmount, payAmount);
logger.info("结算订单:【{}】充电桩传来的消费金额:【{}】大于付款金额:【{}】, 消费金额设置为付款金额相等数据", orderCode, orderAmount, payAmount);
orderAmount = payAmount;
}
@@ -640,7 +640,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
BigDecimal residue = payAmount.subtract(orderAmount);
if (residue.compareTo(BigDecimal.ZERO) > 0) {
// 查支付记录
List<OrderPayRecord> payRecordList = orderPayRecordService.getOrderPayRecordList(orderBasicInfo.getOrderCode());
List<OrderPayRecord> payRecordList = orderPayRecordService.getOrderPayRecordList(orderCode);
// 更新订单支付记录
List<OrderPayRecord> updatePayRecordList = Lists.newArrayList();
// 根据支付方式不同,走不同渠道退款
@@ -684,18 +684,18 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
.subType(MemberWalletEnum.SUBTYPE_ORDER_SETTLEMENT_REFUND.getValue()) // 订单结算退款
.updatePrincipalBalance(returnPrincipal)
.updateGiftBalance(returnGift)
.relatedOrderCode(orderBasicInfo.getOrderCode())
.relatedOrderCode(orderCode)
.build();
memberBasicInfoService.updateMemberBalance(updateMemberBalanceDTO);
} else if (StringUtils.equals(payMode, OrderPayModeEnum.PAYMENT_OF_WECHATPAY.getValue())) { // 微信支付
// 微信退款逻辑
WeChatRefundDTO weChatRefundDTO = new WeChatRefundDTO();
weChatRefundDTO.setOrderCode(orderBasicInfo.getOrderCode());
weChatRefundDTO.setOrderCode(orderCode);
weChatRefundDTO.setRefundType("1");
weChatRefundDTO.setRefundAmount(residue);
// 查到该笔订单付款金额到哪里了
MemberTransactionRecord transactionRecord = memberTransactionRecordService.selectByOrderCode(orderBasicInfo.getOrderCode(), ActionTypeEnum.FORWARD.getValue());
MemberTransactionRecord transactionRecord = memberTransactionRecordService.selectByOrderCode(orderCode, ActionTypeEnum.FORWARD.getValue());
logger.info("查到该笔订单付款金额到哪里了:{}", JSON.toJSONString(transactionRecord));
if (StringUtils.equals(transactionRecord.getPaymentInstitutions(), PaymentInstitutionsEnum.WECHAT_PAY.getValue())) {
this.weChatRefund(weChatRefundDTO);
@@ -710,7 +710,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
// 支付宝退款逻辑
} else {
// 白名单支付
logger.info("订单:{}使用白名单支付,不进行退款处理", orderBasicInfo.getOrderCode());
logger.info("订单:{}使用白名单支付,不进行退款处理", orderCode);
}
// 更新order_pay_record
@@ -723,7 +723,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
// 修改订单数据
// 查询订单详情
OrderDetail orderDetail = getOrderDetailByOrderCode(orderBasicInfo.getOrderCode());
OrderDetail orderDetail = getOrderDetailByOrderCode(orderCode);
// 把交易记录中的用电量,金额等信息 更新到orderBasicInfo和orderDetail
orderBasicInfo.setOrderAmount(orderAmount); // 订单总金额
@@ -815,7 +815,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
dto.setOrderBasicInfo(orderBasicInfo);
dto.setOrderDetail(orderDetail);
transactionService.doUpdateOrder(dto);
logger.info("结算订单 end OrderTransactionDTO:{}", JSONObject.toJSONString(dto));
logger.info("结算订单end:{} OrderTransactionDTO:{}", orderCode, JSONObject.toJSONString(dto));
try {
// 将卡/vin状态解锁
@@ -845,7 +845,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
sendMsg(orderBasicInfo);
// 从redis中取出实时记录保存到表中
realTimeMonitorDataRedis2DB(orderBasicInfo.getTransactionCode(), orderBasicInfo.getOrderCode());
realTimeMonitorDataRedis2DB(orderBasicInfo.getTransactionCode(), orderCode);
}
// uniApp 发送停止充电订阅消息

View File

@@ -670,6 +670,11 @@ public class PileBasicInfoServiceImpl implements IPileBasicInfoService {
return list;
}
/**
* 通过站点id查询充电桩列表
* @param stationId 站点id
* @return 充电桩列表
*/
@Override
public List<PileBasicInfo> getPileListByStationId(String stationId) {
String redisKey = CacheConstants.GET_PILE_LIST_BY_STATION_ID + stationId;