会员退款
This commit is contained in:
parent
8a34342922
commit
8c344d674a
|
|
@ -38,6 +38,7 @@ import com.czg.system.service.SysParamsService;
|
|||
import com.czg.utils.AssertUtil;
|
||||
import com.czg.utils.MD5Util;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.mybatisflex.core.update.UpdateChain;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.NonNull;
|
||||
|
|
@ -315,10 +316,7 @@ public class PayServiceImpl implements PayService {
|
|||
}
|
||||
}
|
||||
if (shopUser.getIsVip().equals(0)) {
|
||||
shopUserService.updateChain()
|
||||
.set(ShopUser::getIsVip, 1)
|
||||
.eq(ShopUser::getId, payParam.getShopId())
|
||||
.update();
|
||||
UpdateChain.of(ShopUser.class).set(ShopUser::getIsVip, 1).eq(ShopUser::getId, payParam.getShopUserId()).update();
|
||||
}
|
||||
ShopUserMoneyEditDTO shopUserMoneyEditDTO = ShopUserMoneyEditDTO.builder()
|
||||
.id(shopUser.getId())
|
||||
|
|
@ -329,7 +327,7 @@ public class PayServiceImpl implements PayService {
|
|||
.build();
|
||||
if (isFree) {
|
||||
shopUserMoneyEditDTO.setBizEnum(ShopUserFlowBizEnum.FREE_IN);
|
||||
orderInfoService.updateChain().eq(OrderInfo::getId, payParam.getOrderId())
|
||||
UpdateChain.of(OrderInfo.class).eq(OrderInfo::getId, payParam.getOrderId())
|
||||
.set(OrderInfo::getStatus, OrderStatusEnums.DONE.getCode())
|
||||
.set(OrderInfo::getIsFreeDine, 1)
|
||||
.set(OrderInfo::getPayAmount, 0)
|
||||
|
|
@ -425,6 +423,9 @@ public class PayServiceImpl implements PayService {
|
|||
ShopUser shopUser = shopUserService.getShopUserInfo(refPayParam.getShopId(), refPayParam.getUserId());
|
||||
ShopUserFlow inFlow = userFlowService.getById(refPayParam.getFlowId());
|
||||
AssertUtil.isNull(inFlow, "充值记录不存在");
|
||||
if (inFlow.getBizCode().equals("cashIn")) {
|
||||
refPayParam.setCashRefund(true);
|
||||
}
|
||||
QueryWrapper queryWrapper = new QueryWrapper();
|
||||
queryWrapper.eq(ShopUserFlow::getRelationId, refPayParam.getFlowId());
|
||||
queryWrapper.eq(ShopUserFlow::getBizCode, ShopUserFlowBizEnum.AWARD_IN.getCode());
|
||||
|
|
@ -471,12 +472,12 @@ public class PayServiceImpl implements PayService {
|
|||
//更新会员余额 并生成流水
|
||||
shopUserService.updateMoney(shopUser.getShopId(), shopUserMoneyEditDTO);
|
||||
|
||||
userFlowService.updateChain()
|
||||
UpdateChain.of(ShopUserFlow.class)
|
||||
.setRaw(ShopUserFlow::getRefundAmount, "refund_amount" + refPayParam.getRefAmount())
|
||||
.eq(ShopUserFlow::getId, inFlow.getId())
|
||||
.update();
|
||||
if (giftFlow != null) {
|
||||
userFlowService.updateChain()
|
||||
UpdateChain.of(ShopUserFlow.class)
|
||||
.setRaw(ShopUserFlow::getRefundAmount, "refund_amount" + giftFlow.getAmount())
|
||||
.eq(ShopUserFlow::getId, giftFlow.getId())
|
||||
.update();
|
||||
|
|
|
|||
Loading…
Reference in New Issue