feat:独立分账

This commit is contained in:
suzhuhong
2026-04-16 11:03:52 +08:00
parent 33f47db7e7
commit d90f8eb2a8
11 changed files with 371 additions and 15 deletions

View File

@@ -2,6 +2,7 @@ package com.cool.store.controller.webb;
import com.cool.store.request.store.PreAllocationQueryShopRequest;
import com.cool.store.request.store.PreAllocationSaveRequest;
import com.cool.store.request.store.TransRequest;
import com.cool.store.response.ResponseResult;
import com.cool.store.service.store.PreAllocationRecordService;
import com.cool.store.vo.order.PreAllocationRecordVO;
@@ -33,6 +34,12 @@ public class PreAllocationRecordController {
return ResponseResult.success(preAllocationRecordService.saveBatch(req));
}
@ApiOperation("单费用类型独立分账")
@PostMapping("/trans")
public ResponseResult<Boolean> queryByShop(@RequestBody @Valid TransRequest request ){
return ResponseResult.success(preAllocationRecordService.trans(request));
}
@ApiOperation("按门店查询预分账明细")
@GetMapping("/queryByShop")
public ResponseResult<List<PreAllocationRecordVO>> queryByShop(@RequestParam(value = "shopId" ,required = true) Long shopId){

View File

@@ -676,6 +676,33 @@ public class XxlJobHandler {
pageNum++;
}
log.info("------end batchTransferStandardStore------");
//开始单个分账状态查询
transferStandardStore();
}
public void transferStandardStore() {
log.info("------start transferStandardStore------");
boolean hasNext = true;
int pageNum = 1;
int pageSize = CommonConstants.BATCH_SIZE;
while (hasNext) {
PageHelper.startPage(pageNum, pageSize);
List<WalletTradeDO> list = walletTradeDAO.getPayingOrder(WalletTradeModuleEnum.STANDARD_STORE.getModule(), 1);
hasNext = list.size() >= pageSize;
if (CollectionUtils.isEmpty(list)) {
break;
}
for (WalletTradeDO walletTradeDO : list) {
try {
preAllocationRecordService.transStatusRefresh(walletTradeDO);
} catch (Exception e) {
log.error("钱包单费用类型转账分账支付状态查询失败, walletTradeDO:{}", walletTradeDO, e);
}
}
pageNum++;
}
log.info("------end transferStandardStore------");
}
@XxlJob("transfer")