mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
update
This commit is contained in:
@@ -189,6 +189,24 @@ public class SpringBootTestController {
|
||||
@Autowired
|
||||
private ClearingWithdrawInfoService clearingWithdrawInfoService;
|
||||
|
||||
@Test
|
||||
public void testCreateConfirmReverse() throws BaseAdaPayException {
|
||||
List<String> list = Lists.newArrayList();
|
||||
list.add("0022120230803181514990533118848148987904");
|
||||
list.add("0022120230803181514990533118849771606016");
|
||||
list.add("0022120230803181514990533118851194695680");
|
||||
list.add("0022120230803181515990533118852380536832");
|
||||
list.add("0022120230803181515990533118853825003520");
|
||||
list.add("0022120230803181515990533118855098966016");
|
||||
list.add("0022120230803181516990533118856510251008");
|
||||
list.add("0022120230803181516990533118858177568768");
|
||||
list.add("0022120230803181517990533118859674951680");
|
||||
list.add("0022120230803181517990533118861063364608");
|
||||
for (String s : list) {
|
||||
adapayMemberService.createConfirmReverse(s);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClearingWithdraw() {
|
||||
// 保存提现记录
|
||||
|
||||
@@ -563,4 +563,17 @@ public class AdapayMemberService {
|
||||
Map<String, Object> paymentResult = AdapayCommon.requestAdapay(balanceParam);
|
||||
log.info("创建余额支付param:{}, result:{}", JSON.toJSONString(balanceParam), JSON.toJSONString(paymentResult));
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建支付确认撤销
|
||||
*/
|
||||
public void createConfirmReverse(String paymentConfirmId) throws BaseAdaPayException {
|
||||
Map<String, Object> confirmReverseParams = Maps.newHashMap();
|
||||
confirmReverseParams.put("adapay_func_code", "payments.confirm.reverse");
|
||||
confirmReverseParams.put("payment_confirm_id", paymentConfirmId);
|
||||
confirmReverseParams.put("reason", "支付确认撤销");
|
||||
confirmReverseParams.put("order_no", IdUtils.fastSimpleUUID());
|
||||
Map<String, Object> confirmReverseResult = AdapayCommon.requestAdapay(confirmReverseParams);
|
||||
log.info("创建支付确认撤销param:{}, result:{}", JSON.toJSONString(confirmReverseParams), JSON.toJSONString(confirmReverseResult));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.jsowell.common.core.domain.ykc.TransactionRecordsData;
|
||||
import com.jsowell.pile.domain.AdapayMemberAccount;
|
||||
import com.jsowell.pile.domain.OrderBasicInfo;
|
||||
import com.jsowell.pile.domain.OrderDetail;
|
||||
import com.jsowell.pile.domain.SettleOrderReport;
|
||||
import com.jsowell.pile.dto.*;
|
||||
import com.jsowell.pile.vo.base.MerchantOrderInfoVO;
|
||||
import com.jsowell.pile.vo.base.OrderAmountDetailVO;
|
||||
@@ -142,7 +143,9 @@ public interface IOrderBasicInfoService {
|
||||
|
||||
List<OrderVO> getListByMemberIdAndOrderStatus(String memberId, List<String> orderStatusList, LocalDateTime dateTime, String stationId);
|
||||
|
||||
void orderSplittingOperations(String merchantId, String tradeDate);
|
||||
void orderSplittingOperations(AdapayMemberAccount adapayMemberAccount, List<SettleOrderReport> stationReportList);
|
||||
|
||||
void orderSplittingOperations(String merchantId, String tradeDate);
|
||||
|
||||
void tempOrderSplittingOperations(String merchantId, String tradeDate);
|
||||
|
||||
|
||||
@@ -873,22 +873,22 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
* 只有开通结算账户的运营商才走分账逻辑
|
||||
*/
|
||||
@Override
|
||||
public void orderSplittingOperations(String merchantId, String tradeDate) {
|
||||
logger.info("运营商:{}, 交易日期:{}, 进行分账处理start", merchantId, tradeDate);
|
||||
public void orderSplittingOperations(AdapayMemberAccount adapayMemberAccount, List<SettleOrderReport> stationReportList) {
|
||||
logger.info("运营商:{}, 交易日期:{}, 进行分账处理start", adapayMemberAccount, stationReportList);
|
||||
|
||||
// 查询运营商有没有开通结算账户
|
||||
AdapayMemberAccount adapayMemberAccount = adapayMemberAccountService.selectByMerchantId(merchantId);
|
||||
// 运营商有没有开通结算账户
|
||||
if (adapayMemberAccount == null) {
|
||||
logger.error("订单分账逻辑error, 运营商id:{}, 未配置结算账户", merchantId);
|
||||
return;
|
||||
}
|
||||
|
||||
// 根据交易日期查询运营商下面所有站点的交易日报
|
||||
List<SettleOrderReport> stationReportList = settleOrderReportService.selectByMerchantIdAndDate(merchantId, tradeDate);
|
||||
if (CollectionUtils.isEmpty(stationReportList)) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (SettleOrderReport orderReport : stationReportList) {
|
||||
String orderCodes = orderReport.getOrderCodes();
|
||||
if (StringUtils.isBlank(orderCodes)) {
|
||||
logger.info("站点:{}, 日期:{}, 没有查到订单数据", orderReport.getStationId(), tradeDate);
|
||||
logger.info("站点:{}, 日期:{}, 没有查到订单数据", orderReport.getStationId(), orderReport.getTradeDate());
|
||||
continue;
|
||||
}
|
||||
List<String> orderCodeList = Lists.newArrayList(StringUtils.split(orderCodes, ","));
|
||||
@@ -903,7 +903,7 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
String clearingBillCode = "CLE" + IdUtils.getOrderCode();
|
||||
clearingBillInfo.setClearingBillCode(clearingBillCode);
|
||||
clearingBillInfo.setClearingTime(DateUtils.getNowDate());
|
||||
clearingBillInfo.setMerchantId(merchantId);
|
||||
clearingBillInfo.setMerchantId(orderReport.getMerchantId());
|
||||
clearingBillInfo.setOrderSource("1");
|
||||
|
||||
// 应收金额
|
||||
@@ -967,9 +967,21 @@ public class OrderBasicInfoServiceImpl implements IOrderBasicInfoService {
|
||||
dto.setBillDetailList(billDetailList);
|
||||
transactionService.createClearingBill(dto);
|
||||
}
|
||||
logger.info("运营商:{}, 交易日期:{}, 进行分账处理end", merchantId, tradeDate);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void orderSplittingOperations(String merchantId, String tradeDate) {
|
||||
// 查询运营商有没有开通结算账户
|
||||
AdapayMemberAccount adapayMemberAccount = adapayMemberAccountService.selectByMerchantId(merchantId);
|
||||
if (adapayMemberAccount == null) {
|
||||
logger.error("订单分账逻辑error, 运营商id:{}, 未配置结算账户", merchantId);
|
||||
return;
|
||||
}
|
||||
|
||||
// 根据交易日期查询运营商下面所有站点的交易日报
|
||||
List<SettleOrderReport> stationReportList = settleOrderReportService.selectByMerchantIdAndDate(merchantId, tradeDate);
|
||||
orderSplittingOperations(adapayMemberAccount, stationReportList);
|
||||
}
|
||||
/**
|
||||
* 手动接口执行订单分账逻辑
|
||||
* 8月1号之前的交易,全部结算到本商户
|
||||
|
||||
Reference in New Issue
Block a user