mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 19:45:09 +08:00
检查订单分账记录
This commit is contained in:
@@ -126,6 +126,11 @@ public class SplitBillService {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 重试运营商分账V2
|
||||
* @param dto
|
||||
* @throws BaseAdaPayException
|
||||
*/
|
||||
public void retryMerchantSplitV2(QueryOrderSplitRecordDTO dto) throws BaseAdaPayException {
|
||||
String startTime = dto.getStartTime();
|
||||
String endTime = dto.getEndTime();
|
||||
@@ -147,36 +152,64 @@ public class SplitBillService {
|
||||
}
|
||||
|
||||
// 判断订单是否已经成功分账, 将未分账的订单进行筛选、汇总
|
||||
List<String> unSplitPaymentIdList = adapayService.getSplitInfoByPaymentIdList(paymentIdList);
|
||||
if (CollectionUtils.isEmpty(unSplitPaymentIdList)) {
|
||||
log.info("重试运营商分账-所有订单都已经成功分账");
|
||||
Map<String, List<String>> splitInfoMap = adapayService.getSplitInfoMapByPaymentIdList(paymentIdList);
|
||||
if (splitInfoMap == null || splitInfoMap.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 将 paymentIdList 与 recordList 进行匹配,筛选出 orderCodeList
|
||||
List<String> orderCodeList = Lists.newArrayList();
|
||||
for (String unSplitPaymentId : unSplitPaymentIdList) {
|
||||
OrderPaymentDetailVO orderPaymentDetailVO = paymentIdMap.get(unSplitPaymentId);
|
||||
if (orderPaymentDetailVO != null) {
|
||||
orderCodeList.add(orderPaymentDetailVO.getOrderCode());
|
||||
// 未分帐paymentId列表
|
||||
List<String> unSplitPaymentIdList = splitInfoMap.get("unSplitList");
|
||||
// 已分帐paymentId列表
|
||||
List<String> splitPaymentIdList = splitInfoMap.get("splitList");
|
||||
|
||||
/*
|
||||
如果未分帐paymentId列表不为空,则循环每个paymentId进行debugOrder
|
||||
*/
|
||||
if (CollectionUtils.isNotEmpty(unSplitPaymentIdList)) {
|
||||
// 将 paymentIdList 与 recordList 进行匹配,筛选出 orderCodeList
|
||||
List<String> orderCodeList = Lists.newArrayList();
|
||||
for (String unSplitPaymentId : unSplitPaymentIdList) {
|
||||
OrderPaymentDetailVO orderPaymentDetailVO = paymentIdMap.get(unSplitPaymentId);
|
||||
if (orderPaymentDetailVO != null) {
|
||||
orderCodeList.add(orderPaymentDetailVO.getOrderCode());
|
||||
}
|
||||
}
|
||||
|
||||
// 调用 debugOrder 接口进行重新分账
|
||||
for (String orderCode : orderCodeList) {
|
||||
DebugOrderDTO debugOrderDTO = new DebugOrderDTO();
|
||||
debugOrderDTO.setOrderCode(orderCode);
|
||||
debugOrderDTO.setReSplitFlag(Constants.ONE);
|
||||
|
||||
try {
|
||||
Map<String, Object> stringObjectMap = tempService.debugOrder(debugOrderDTO);
|
||||
log.info("重试运营商分账-debugOrder接口调用成功, param:{}, result:{}", debugOrderDTO, stringObjectMap);
|
||||
} catch (Exception e) {
|
||||
log.error("重试运营商分账-debugOrder接口调用异常, param:{}", debugOrderDTO, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 调用 debugOrder 接口进行重新分账
|
||||
for (String orderCode : orderCodeList) {
|
||||
DebugOrderDTO debugOrderDTO = new DebugOrderDTO();
|
||||
debugOrderDTO.setOrderCode(orderCode);
|
||||
debugOrderDTO.setReSplitFlag(Constants.ONE);
|
||||
|
||||
try {
|
||||
Map<String, Object> stringObjectMap = tempService.debugOrder(debugOrderDTO);
|
||||
log.info("重试运营商分账-debugOrder接口调用成功, param:{}, result:{}", debugOrderDTO, stringObjectMap);
|
||||
} catch (Exception e) {
|
||||
log.error("重试运营商分账-debugOrder接口调用异常, param:{}", debugOrderDTO, e);
|
||||
/*
|
||||
如果已分帐paymentId列表不为空,则循环每个paymentId进行校验OrderSplitRecord数据是否正确
|
||||
*/
|
||||
if (CollectionUtils.isNotEmpty(splitPaymentIdList)) {
|
||||
// 将 paymentIdList 与 recordList 进行匹配,筛选出 orderCodeList
|
||||
List<String> orderCodeList = Lists.newArrayList();
|
||||
for (String unSplitPaymentId : splitPaymentIdList) {
|
||||
OrderPaymentDetailVO orderPaymentDetailVO = paymentIdMap.get(unSplitPaymentId);
|
||||
if (orderPaymentDetailVO != null) {
|
||||
orderCodeList.add(orderPaymentDetailVO.getOrderCode());
|
||||
}
|
||||
}
|
||||
for (String orderCode : orderCodeList) {
|
||||
tempService.checkOrderSplitRecord(orderCode);
|
||||
}
|
||||
}
|
||||
|
||||
// 重新计算站点日报和运营商日报
|
||||
/*
|
||||
重新计算站点日报和运营商日报
|
||||
*/
|
||||
// 获取日期区间内所有日期
|
||||
List<String> dateList = DateUtils.getAllDatesInTheDateRange(startTime, endTime);
|
||||
stationIdSet.parallelStream().forEach(stationId -> {
|
||||
@@ -201,6 +234,5 @@ public class SplitBillService {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user