回调分销实现
This commit is contained in:
@@ -58,8 +58,7 @@ public class DistributionPayController {
|
|||||||
*/
|
*/
|
||||||
@PostMapping("/mchRecharge")
|
@PostMapping("/mchRecharge")
|
||||||
@Debounce(value = "#payParam.userId")
|
@Debounce(value = "#payParam.userId")
|
||||||
public CzgResult<Map<String, String>> mchRecharge(@RequestHeader Long shopId, HttpServletRequest request, @Validated @RequestBody MkDistributionPayDTO payParam) {
|
public CzgResult<Map<String, String>> mchRecharge(HttpServletRequest request, @Validated @RequestBody MkDistributionPayDTO payParam) {
|
||||||
payParam.setShopId(shopId);
|
|
||||||
AssertUtil.isBlank(payParam.getCode(), "微信code不为空");
|
AssertUtil.isBlank(payParam.getCode(), "微信code不为空");
|
||||||
return CzgResult.success(payService.mchRecharge(ServletUtil.getClientIP(request), payParam));
|
return CzgResult.success(payService.mchRecharge(ServletUtil.getClientIP(request), payParam));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ public class DistributionPayServiceImpl implements DistributionPayService {
|
|||||||
throw new CzgException("当前未开启购买分销配置");
|
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());
|
.setPayType(isRecharge ? "distributionRecharge" : "distribution").setOrderNo(payParam.getPlatformType() + IdUtil.getSnowflakeNextId()).setAmount(detail.getPayAmount());
|
||||||
orderPaymentService.save(orderPayment);
|
orderPaymentService.save(orderPayment);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user