Merge branch 'cc_20260415_trans'

This commit is contained in:
suzhuhong
2026-04-20 16:43:02 +08:00
23 changed files with 702 additions and 17 deletions

View File

@@ -1,7 +1,10 @@
package com.cool.store.controller.webb;
import com.cool.store.request.store.PreAllocationAddRequest;
import com.cool.store.request.store.PreAllocationEditRequest;
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,9 +36,34 @@ 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){
return ResponseResult.success(preAllocationRecordService.queryByShop(shopId));
}
@ApiOperation("新增预分账记录")
@PostMapping("/add")
public ResponseResult<Boolean> add(@RequestBody @Valid PreAllocationAddRequest request){
return ResponseResult.success(preAllocationRecordService.add(request));
}
@ApiOperation("编辑预分账记录")
@PostMapping("/edit")
public ResponseResult<Boolean> edit(@RequestBody @Valid PreAllocationEditRequest request){
return ResponseResult.success(preAllocationRecordService.edit(request));
}
@ApiOperation("删除预分账记录")
@PostMapping("/delete")
public ResponseResult<Boolean> delete(@RequestParam(value = "id" ,required = true) Long id){
return ResponseResult.success(preAllocationRecordService.delete(id));
}
}

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")