增加异步处理中间状态

This commit is contained in:
panshuling321 2022-06-29 17:32:39 +08:00
parent 58fefa9234
commit 09ad90bf59
3 changed files with 8 additions and 1 deletions

View File

@ -57,7 +57,7 @@ public class XhpcClearingCheckoutDomain implements Serializable {
*/
private BigDecimal receivedServiceAmount;
/**
* 状态0-已审核待清分1-提现中2-审核失败3-审核成功4-转账失败5-转账成功6-提现完成
* 状态0-已审核待清分1-提现中2-审核失败3-审核成功4-转账失败5-转账成功6-提现完成, 99-中间过渡状态大量数据异步处理展示
*/
private Integer status;

View File

@ -169,6 +169,7 @@ public class XhpcClearingCheckoutServiceImpl extends BaseService implements Xhpc
throw new CustomException("短信验证码错误,请重试");
}
domain.setStatus(99);
checkoutMapper.insert(domain);
if (StringUtils.isEmpty(domain.getClearingOrderIds())) {

View File

@ -1,6 +1,7 @@
package com.xhpc.activity.task;
import com.xhpc.activity.mapper.XhpcClearingCheckoutMapper;
import com.xhpc.activity.mapper.XhpcClearingHistoryOrderMapper;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
@ -12,6 +13,9 @@ public class AsyncService {
@Resource
XhpcClearingHistoryOrderMapper historyOrderMapper;
@Resource
XhpcClearingCheckoutMapper checkoutMapper;
/**
* 审核待清分订单处理
* @param orderIds
@ -27,11 +31,13 @@ public class AsyncService {
@Async
public void updateCheckoutByOperatorAsync(Long operatorId, Long checkoutId){
historyOrderMapper.updateCheckoutByOperator(operatorId, checkoutId);
checkoutMapper.updateStatusByIds(checkoutId.toString(), 1);
}
@Async
public void updateCheckoutByOrderIdsAsync(String orderIds, Long checkoutId){
historyOrderMapper.updateCheckoutByOrderId(orderIds, checkoutId);
checkoutMapper.updateStatusByIds(checkoutId.toString(), 1);
}
}