新增自动提现定时任务; 原定时分账任务改为生成运营商日报任务

This commit is contained in:
Guoqs
2025-02-20 15:44:35 +08:00
parent 6398ddf54d
commit a64f8ad2a5

View File

@@ -1,6 +1,5 @@
package com.jsowell.quartz.task;
import com.huifu.adapay.core.exception.BaseAdaPayException;
import com.jsowell.adapay.dto.WithdrawDTO;
import com.jsowell.adapay.service.AdapayService;
import com.jsowell.common.constant.CacheConstants;
@@ -215,33 +214,39 @@ public class JsowellTask {
}
// 调分账方法
// pileMerchantInfos.parallelStream().forEach(merchant -> {
// try {
// orderBasicInfoService.orderSplittingOperations(merchant.getId() + "", yesterday.toString());
// } catch (Exception e) {
// log.error("处理订单分账异常, merchantId:{}", merchant.getId(), e);
// }
// });
// 换为实时分账后, 此方法改为 自动提现并计算前一天的分账信息
pileMerchantInfos.parallelStream().forEach(merchant -> {
automaticPayouts(merchant.getId() + "");
try {
// orderBasicInfoService.orderSplittingOperations(merchant.getId() + "", yesterday.toString());
orderBasicInfoService.generateMerchantBill(merchant.getId() + "", yesterday.toString());
} catch (Exception e) {
log.error("生成运营商日报异常, merchantId:{}", merchant.getId(), e);
}
});
}
/**
* 自动提现并计算前一天的分账信息
* automaticPayouts
* 定时任务,自动提现
* jsowellTask.automaticPayouts()
*/
private void automaticPayouts(String merchantId) {
WithdrawDTO dto = new WithdrawDTO();
dto.setMerchantId(merchantId);
dto.setFeeAmt("0");
try {
adapayService.drawCash(dto);
} catch (BaseAdaPayException e) {
throw new RuntimeException(e);
public void automaticPayouts() {
// TODO 查询开启自动提现运营商列表
List<PileMerchantInfo> pileMerchantInfos = pileMerchantInfoService.selectPileMerchantInfoList(null);
if (CollectionUtils.isEmpty(pileMerchantInfos)) {
log.info("定时任务,自动提现, 未查询到运营商列表,直接返回");
return;
}
// 调提现方法
pileMerchantInfos.parallelStream().forEach(merchant -> {
try {
WithdrawDTO dto = new WithdrawDTO();
dto.setMerchantId(merchant.getId() + "");
dto.setFeeAmt("0");
adapayService.drawCash(dto);
} catch (Exception e) {
log.error("生成运营商日报异常, merchantId:{}", merchant.getId(), e);
}
});
}
}