回调分销实现

This commit is contained in:
张松 2025-10-27 16:33:13 +08:00
parent b73ca2c6e7
commit e6ad8baeeb
2 changed files with 2 additions and 3 deletions

View File

@ -58,8 +58,7 @@ public class DistributionPayController {
*/
@PostMapping("/mchRecharge")
@Debounce(value = "#payParam.userId")
public CzgResult<Map<String, String>> mchRecharge(@RequestHeader Long shopId, HttpServletRequest request, @Validated @RequestBody MkDistributionPayDTO payParam) {
payParam.setShopId(shopId);
public CzgResult<Map<String, String>> mchRecharge(HttpServletRequest request, @Validated @RequestBody MkDistributionPayDTO payParam) {
AssertUtil.isBlank(payParam.getCode(), "微信code不为空");
return CzgResult.success(payService.mchRecharge(ServletUtil.getClientIP(request), payParam));
}

View File

@ -69,7 +69,7 @@ public class DistributionPayServiceImpl implements DistributionPayService {
throw new CzgException("当前未开启购买分销配置");
}
OrderPayment orderPayment = new OrderPayment().setShopId(payParam.getShopId()).setSourceId(userId)
OrderPayment orderPayment = new OrderPayment().setShopId(payParam.getShopId()).setSourceId(isRecharge ? payParam.getShopId() : userId)
.setPayType(isRecharge ? "distributionRecharge" : "distribution").setOrderNo(payParam.getPlatformType() + IdUtil.getSnowflakeNextId()).setAmount(detail.getPayAmount());
orderPaymentService.save(orderPayment);