mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-05-16 15:58:41 +08:00
重试分账接口
This commit is contained in:
@@ -818,4 +818,21 @@ public class TempController extends BaseController {
|
|||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重试分账接口
|
||||||
|
* http://localhost:8080/temp/retryOrderSplit
|
||||||
|
*/
|
||||||
|
@PostMapping("/retryOrderSplit")
|
||||||
|
public RestApiResponse<?> retryOrderSplit(@RequestBody QueryOrderDTO dto) {
|
||||||
|
RestApiResponse<?> response;
|
||||||
|
try {
|
||||||
|
tempService.retrySplittingMethod(dto.getOrderCode());
|
||||||
|
response = new RestApiResponse<>();
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("重试分账接口error,", e);
|
||||||
|
response = new RestApiResponse<>(e);
|
||||||
|
}
|
||||||
|
return response;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -998,5 +998,41 @@ public class TempService {
|
|||||||
programLogic.settleOrder(data, orderBasicInfo);
|
programLogic.settleOrder(data, orderBasicInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 重试分账逻辑
|
||||||
|
* 用于订单金额都已经计算好, 但是没有分账, 用来重新执行分账
|
||||||
|
*/
|
||||||
|
public void retrySplittingMethod(String orderCode) {
|
||||||
|
if (StringUtils.isBlank(orderCode)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// 查询数据
|
||||||
|
OrderBasicInfo orderBasicInfo = orderBasicInfoService.getOrderInfoByOrderCode(orderCode);
|
||||||
|
if (orderBasicInfo == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
OrderDetail orderDetail = orderBasicInfoService.getOrderDetailByOrderCode(orderCode);
|
||||||
|
if (orderDetail == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 组装请求dto 组装after参数
|
||||||
|
AfterSettleOrderDTO afterSettleOrderDTO = AfterSettleOrderDTO.builder()
|
||||||
|
.orderCode(orderBasicInfo.getOrderCode())
|
||||||
|
.merchantId(orderBasicInfo.getMerchantId())
|
||||||
|
.stationId(orderBasicInfo.getStationId())
|
||||||
|
.orderPayAmount(orderBasicInfo.getPayAmount()) // 支付金额
|
||||||
|
.orderConsumeAmount(orderBasicInfo.getOrderAmount()) // 消费金额
|
||||||
|
.orderSettleAmount(orderBasicInfo.getSettleAmount()) // 结算金额
|
||||||
|
.orderElectricityAmount(orderDetail.getTotalElectricityAmount()) // 电费金额
|
||||||
|
.orderElectricityDiscountAmount(orderDetail.getDiscountElectricityAmount()) // 电费折扣金额
|
||||||
|
.orderServiceAmount(orderDetail.getTotalServiceAmount()) // 服务费金额
|
||||||
|
.orderServiceDiscountAmount(orderDetail.getDiscountServiceAmount()) // 服务费折扣金额
|
||||||
|
.orderRefundAmount(orderBasicInfo.getRefundAmount()) // 退款金额
|
||||||
|
.build();
|
||||||
|
logger.info("retrySplittingMethod, afterSettleOrderDTO:{}", JSON.toJSONString(afterSettleOrderDTO));
|
||||||
|
orderBasicInfoService.splittingMethod(afterSettleOrderDTO);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
002212024102416494410695447094223949824
|
002212025020412234910732706124918857728
|
||||||
002212024102419522510695493069857738752
|
002212025021320221410736088013681041408
|
||||||
002212024102423461110695551898497138688
|
002212025021418121210736417676767436800
|
||||||
002212024102508132610695679550910730240
|
002212025021710584010737395738021330944
|
||||||
002212024102508310310695683984625319936
|
002212025021915430610738192095246381056
|
||||||
002212024102508502610695688864317952000
|
002212025021917253410738217882149285888
|
||||||
002212024102513440210695762749414916096
|
002212025022414130110739981362939670528
|
||||||
|
002212025022712121610741038139879292928
|
||||||
|
002212025022814322610741435803697991680
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.jsowell.pile.service;
|
|||||||
|
|
||||||
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
||||||
import com.jsowell.adapay.dto.SplitData;
|
import com.jsowell.adapay.dto.SplitData;
|
||||||
|
import com.jsowell.adapay.response.PaymentConfirmResponse;
|
||||||
import com.jsowell.adapay.response.PaymentReverseResponse;
|
import com.jsowell.adapay.response.PaymentReverseResponse;
|
||||||
import com.jsowell.adapay.vo.OrderSplitResult;
|
import com.jsowell.adapay.vo.OrderSplitResult;
|
||||||
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
|
import com.jsowell.common.core.domain.ykc.RealTimeMonitorData;
|
||||||
@@ -212,6 +213,8 @@ public interface OrderBasicInfoService{
|
|||||||
|
|
||||||
OrderSplitResult realTimeOrderSplit(AfterSettleOrderDTO afterSettleOrderDTO) throws BaseAdaPayException;
|
OrderSplitResult realTimeOrderSplit(AfterSettleOrderDTO afterSettleOrderDTO) throws BaseAdaPayException;
|
||||||
|
|
||||||
|
PaymentConfirmResponse splittingMethod(AfterSettleOrderDTO afterSettleOrderDTO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计算分账数据
|
* 计算分账数据
|
||||||
* @param stationSplitConfigList
|
* @param stationSplitConfigList
|
||||||
|
|||||||
@@ -1986,7 +1986,8 @@ public class OrderBasicInfoServiceImpl implements OrderBasicInfoService {
|
|||||||
* 实时分账方法
|
* 实时分账方法
|
||||||
* @param afterSettleOrderDTO
|
* @param afterSettleOrderDTO
|
||||||
*/
|
*/
|
||||||
private PaymentConfirmResponse splittingMethod(AfterSettleOrderDTO afterSettleOrderDTO) {
|
@Override
|
||||||
|
public PaymentConfirmResponse splittingMethod(AfterSettleOrderDTO afterSettleOrderDTO) {
|
||||||
// 结算金额
|
// 结算金额
|
||||||
BigDecimal orderSettleAmount = afterSettleOrderDTO.getOrderSettleAmount();
|
BigDecimal orderSettleAmount = afterSettleOrderDTO.getOrderSettleAmount();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user