会员退款前置
This commit is contained in:
parent
d06ba4de98
commit
5431e81191
|
|
@ -408,10 +408,10 @@ public class PayServiceImpl implements PayService {
|
|||
AssertUtil.isNull(shopUser, "该店铺用户不存在");
|
||||
ShopUserFlow inFlow = userFlowService.getById(payParam.getFlowId());
|
||||
AssertUtil.isNull(inFlow, "充值记录不存在");
|
||||
ShopUserFlow giftFlow = userFlowService.queryChain()
|
||||
.eq(ShopUserFlow::getRelationId, payParam.getFlowId())
|
||||
.eq(ShopUserFlow::getBizCode, ShopUserFlowBizEnum.AWARD_IN.getCode())
|
||||
.one();
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq(ShopUserFlow::getRelationId, payParam.getFlowId());
|
||||
queryWrapper.eq(ShopUserFlow::getBizCode, ShopUserFlowBizEnum.AWARD_IN.getCode());
|
||||
ShopUserFlow giftFlow = userFlowService.getOne(queryWrapper);
|
||||
resultMap.put("amount", shopUser.getAmount());
|
||||
resultMap.put("inAmount", inFlow.getAmount());
|
||||
resultMap.put("inRefundAmount", inFlow.getRefundAmount());
|
||||
|
|
@ -423,14 +423,12 @@ public class PayServiceImpl implements PayService {
|
|||
@Override
|
||||
public CzgResult<Object> refundVip(VipRefundDTO refPayParam) {
|
||||
ShopUser shopUser = shopUserService.getShopUserInfo(refPayParam.getShopId(), refPayParam.getUserId());
|
||||
ShopUserFlow inFlow = userFlowService.queryChain().select()
|
||||
.eq(ShopUserFlow::getId, refPayParam.getFlowId()).one();
|
||||
ShopUserFlow inFlow = userFlowService.getById(refPayParam.getFlowId());
|
||||
AssertUtil.isNull(inFlow, "充值记录不存在");
|
||||
ShopUserFlow giftFlow = userFlowService.queryChain().select()
|
||||
.eq(ShopUserFlow::getRelationId, refPayParam.getFlowId())
|
||||
.eq(ShopUserFlow::getBizCode, ShopUserFlowBizEnum.AWARD_IN.getCode())
|
||||
.one();
|
||||
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq(ShopUserFlow::getRelationId, refPayParam.getFlowId());
|
||||
queryWrapper.eq(ShopUserFlow::getBizCode, ShopUserFlowBizEnum.AWARD_IN.getCode());
|
||||
ShopUserFlow giftFlow = userFlowService.getOne(queryWrapper);
|
||||
if ((inFlow.getAmount().subtract(inFlow.getRefundAmount())).compareTo(refPayParam.getRefAmount()) < 0) {
|
||||
return CzgResult.failure("退款失败,退款金额不可大于可退金额");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue