mirror of
				https://gitee.com/hhyykk/ipms-sjy.git
				synced 2025-11-04 12:18:42 +08:00 
			
		
		
		
	@@ -27,6 +27,9 @@ public class AfterSalePageReqVO extends PageParam {
 | 
				
			|||||||
    @Schema(description = "售后流水号", example = "202211190847450020500077")
 | 
					    @Schema(description = "售后流水号", example = "202211190847450020500077")
 | 
				
			||||||
    private String no;
 | 
					    private String no;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Schema(description = "用户编号", example = "1024")
 | 
				
			||||||
 | 
					    private Long userId;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Schema(description = "售后状态", example = "10")
 | 
					    @Schema(description = "售后状态", example = "10")
 | 
				
			||||||
    @InEnum(value = AfterSaleStatusEnum.class, message = "售后状态必须是 {value}")
 | 
					    @InEnum(value = AfterSaleStatusEnum.class, message = "售后状态必须是 {value}")
 | 
				
			||||||
    private Integer status;
 | 
					    private Integer status;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -18,6 +18,7 @@ public interface AfterSaleMapper extends BaseMapperX<AfterSaleDO> {
 | 
				
			|||||||
        return selectPage(reqVO, new LambdaQueryWrapperX<AfterSaleDO>()
 | 
					        return selectPage(reqVO, new LambdaQueryWrapperX<AfterSaleDO>()
 | 
				
			||||||
                .eqIfPresent(AfterSaleDO::getUserId, reqVO.getUserId())
 | 
					                .eqIfPresent(AfterSaleDO::getUserId, reqVO.getUserId())
 | 
				
			||||||
                .likeIfPresent(AfterSaleDO::getNo, reqVO.getNo())
 | 
					                .likeIfPresent(AfterSaleDO::getNo, reqVO.getNo())
 | 
				
			||||||
 | 
					                .eqIfPresent(AfterSaleDO::getUserId, reqVO.getUserId())
 | 
				
			||||||
                .eqIfPresent(AfterSaleDO::getStatus, reqVO.getStatus())
 | 
					                .eqIfPresent(AfterSaleDO::getStatus, reqVO.getStatus())
 | 
				
			||||||
                .eqIfPresent(AfterSaleDO::getType, reqVO.getType())
 | 
					                .eqIfPresent(AfterSaleDO::getType, reqVO.getType())
 | 
				
			||||||
                .eqIfPresent(AfterSaleDO::getWay, reqVO.getWay())
 | 
					                .eqIfPresent(AfterSaleDO::getWay, reqVO.getWay())
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -33,6 +33,11 @@
 | 
				
			|||||||
            <artifactId>yudao-module-infra-api</artifactId>
 | 
					            <artifactId>yudao-module-infra-api</artifactId>
 | 
				
			||||||
            <version>${revision}</version>
 | 
					            <version>${revision}</version>
 | 
				
			||||||
        </dependency>
 | 
					        </dependency>
 | 
				
			||||||
 | 
					        <dependency>
 | 
				
			||||||
 | 
					            <groupId>cn.iocoder.boot</groupId>
 | 
				
			||||||
 | 
					            <artifactId>yudao-module-pay-api</artifactId>
 | 
				
			||||||
 | 
					            <version>${revision}</version>
 | 
				
			||||||
 | 
					        </dependency>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <!-- 业务组件 -->
 | 
					        <!-- 业务组件 -->
 | 
				
			||||||
        <dependency>
 | 
					        <dependency>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.member.controller.admin.user;
 | 
				
			|||||||
import cn.hutool.core.collection.CollUtil;
 | 
					import cn.hutool.core.collection.CollUtil;
 | 
				
			||||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
 | 
					import cn.iocoder.yudao.framework.common.pojo.CommonResult;
 | 
				
			||||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
 | 
					import cn.iocoder.yudao.framework.common.pojo.PageResult;
 | 
				
			||||||
 | 
					import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
 | 
				
			||||||
import cn.iocoder.yudao.module.member.controller.admin.user.vo.*;
 | 
					import cn.iocoder.yudao.module.member.controller.admin.user.vo.*;
 | 
				
			||||||
import cn.iocoder.yudao.module.member.convert.user.MemberUserConvert;
 | 
					import cn.iocoder.yudao.module.member.convert.user.MemberUserConvert;
 | 
				
			||||||
import cn.iocoder.yudao.module.member.dal.dataobject.group.MemberGroupDO;
 | 
					import cn.iocoder.yudao.module.member.dal.dataobject.group.MemberGroupDO;
 | 
				
			||||||
@@ -15,15 +16,17 @@ import cn.iocoder.yudao.module.member.service.level.MemberLevelService;
 | 
				
			|||||||
import cn.iocoder.yudao.module.member.service.point.MemberPointRecordService;
 | 
					import cn.iocoder.yudao.module.member.service.point.MemberPointRecordService;
 | 
				
			||||||
import cn.iocoder.yudao.module.member.service.tag.MemberTagService;
 | 
					import cn.iocoder.yudao.module.member.service.tag.MemberTagService;
 | 
				
			||||||
import cn.iocoder.yudao.module.member.service.user.MemberUserService;
 | 
					import cn.iocoder.yudao.module.member.service.user.MemberUserService;
 | 
				
			||||||
 | 
					import cn.iocoder.yudao.module.pay.api.wallet.PayWalletApi;
 | 
				
			||||||
 | 
					import cn.iocoder.yudao.module.pay.api.wallet.dto.PayWalletUpdateBalanceReqDTO;
 | 
				
			||||||
import io.swagger.v3.oas.annotations.Operation;
 | 
					import io.swagger.v3.oas.annotations.Operation;
 | 
				
			||||||
import io.swagger.v3.oas.annotations.Parameter;
 | 
					import io.swagger.v3.oas.annotations.Parameter;
 | 
				
			||||||
import io.swagger.v3.oas.annotations.tags.Tag;
 | 
					import io.swagger.v3.oas.annotations.tags.Tag;
 | 
				
			||||||
 | 
					import jakarta.annotation.Resource;
 | 
				
			||||||
 | 
					import jakarta.validation.Valid;
 | 
				
			||||||
import org.springframework.security.access.prepost.PreAuthorize;
 | 
					import org.springframework.security.access.prepost.PreAuthorize;
 | 
				
			||||||
import org.springframework.validation.annotation.Validated;
 | 
					import org.springframework.validation.annotation.Validated;
 | 
				
			||||||
import org.springframework.web.bind.annotation.*;
 | 
					import org.springframework.web.bind.annotation.*;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import jakarta.annotation.Resource;
 | 
					 | 
				
			||||||
import jakarta.validation.Valid;
 | 
					 | 
				
			||||||
import java.util.Collection;
 | 
					import java.util.Collection;
 | 
				
			||||||
import java.util.List;
 | 
					import java.util.List;
 | 
				
			||||||
import java.util.Objects;
 | 
					import java.util.Objects;
 | 
				
			||||||
@@ -50,6 +53,8 @@ public class MemberUserController {
 | 
				
			|||||||
    private MemberGroupService memberGroupService;
 | 
					    private MemberGroupService memberGroupService;
 | 
				
			||||||
    @Resource
 | 
					    @Resource
 | 
				
			||||||
    private MemberPointRecordService memberPointRecordService;
 | 
					    private MemberPointRecordService memberPointRecordService;
 | 
				
			||||||
 | 
					    @Resource
 | 
				
			||||||
 | 
					    private PayWalletApi payWalletApi;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @PutMapping("/update")
 | 
					    @PutMapping("/update")
 | 
				
			||||||
    @Operation(summary = "更新会员用户")
 | 
					    @Operation(summary = "更新会员用户")
 | 
				
			||||||
@@ -79,8 +84,9 @@ public class MemberUserController {
 | 
				
			|||||||
    @PutMapping("/update-balance")
 | 
					    @PutMapping("/update-balance")
 | 
				
			||||||
    @Operation(summary = "更新会员用户余额")
 | 
					    @Operation(summary = "更新会员用户余额")
 | 
				
			||||||
    @PreAuthorize("@ss.hasPermission('member:user:update-balance')")
 | 
					    @PreAuthorize("@ss.hasPermission('member:user:update-balance')")
 | 
				
			||||||
    public CommonResult<Boolean> updateUserBalance(@Valid @RequestBody Long id) {
 | 
					    public CommonResult<Boolean> updateUserBalance(@Valid @RequestBody MemberUserUpdateBalanceReqVO updateReqVO) {
 | 
				
			||||||
        // todo @jason:增加一个【修改余额】
 | 
					        payWalletApi.updateBalance(BeanUtils.toBean(updateReqVO, PayWalletUpdateBalanceReqDTO.class)
 | 
				
			||||||
 | 
					                .setUserId(updateReqVO.getId()));
 | 
				
			||||||
        return success(true);
 | 
					        return success(true);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -0,0 +1,21 @@
 | 
				
			|||||||
 | 
					package cn.iocoder.yudao.module.member.controller.admin.user.vo;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import io.swagger.v3.oas.annotations.media.Schema;
 | 
				
			||||||
 | 
					import jakarta.validation.constraints.NotNull;
 | 
				
			||||||
 | 
					import lombok.Data;
 | 
				
			||||||
 | 
					import lombok.ToString;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					@Schema(description = "管理后台 - 用户修改余额 Request VO")
 | 
				
			||||||
 | 
					@Data
 | 
				
			||||||
 | 
					@ToString(callSuper = true)
 | 
				
			||||||
 | 
					public class MemberUserUpdateBalanceReqVO {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Schema(description = "用户编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "23788")
 | 
				
			||||||
 | 
					    @NotNull(message = "用户编号不能为空")
 | 
				
			||||||
 | 
					    private Long id;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Schema(description = "变动余额,正数为增加,负数为减少", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
 | 
				
			||||||
 | 
					    @NotNull(message = "变动余额不能为空")
 | 
				
			||||||
 | 
					    private Integer balance;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -0,0 +1,19 @@
 | 
				
			|||||||
 | 
					package cn.iocoder.yudao.module.pay.api.wallet;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import cn.iocoder.yudao.module.pay.api.wallet.dto.PayWalletUpdateBalanceReqDTO;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * 会员钱包 API 接口
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @author HUIHUI
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					public interface PayWalletApi {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * 更新钱包余额
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @param reqDTO 请求
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    void updateBalance(PayWalletUpdateBalanceReqDTO reqDTO);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -0,0 +1,23 @@
 | 
				
			|||||||
 | 
					package cn.iocoder.yudao.module.pay.api.wallet.dto;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import jakarta.validation.constraints.NotNull;
 | 
				
			||||||
 | 
					import lombok.Data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * 钱包余额更新 Request DTO
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @author HUIHUI
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					@Data
 | 
				
			||||||
 | 
					public class PayWalletUpdateBalanceReqDTO {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @NotNull(message = "用户编号不能为空")
 | 
				
			||||||
 | 
					    private Long userId;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * 变动余额,正数为增加,负数为减少
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    @NotNull(message = "变动余额不能为空")
 | 
				
			||||||
 | 
					    private Integer balance;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -18,7 +18,8 @@ public enum PayWalletBizTypeEnum implements IntArrayValuable {
 | 
				
			|||||||
    RECHARGE(1, "充值"),
 | 
					    RECHARGE(1, "充值"),
 | 
				
			||||||
    RECHARGE_REFUND(2, "充值退款"),
 | 
					    RECHARGE_REFUND(2, "充值退款"),
 | 
				
			||||||
    PAYMENT(3, "支付"),
 | 
					    PAYMENT(3, "支付"),
 | 
				
			||||||
    PAYMENT_REFUND(4, "支付退款");
 | 
					    PAYMENT_REFUND(4, "支付退款"),
 | 
				
			||||||
 | 
					    UPDATE_BALANCE(5, "更新余额");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // TODO 后续增加
 | 
					    // TODO 后续增加
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -0,0 +1,43 @@
 | 
				
			|||||||
 | 
					package cn.iocoder.yudao.module.pay.api.wallet;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import cn.iocoder.yudao.module.pay.api.wallet.dto.PayWalletUpdateBalanceReqDTO;
 | 
				
			||||||
 | 
					import cn.iocoder.yudao.module.pay.dal.dataobject.wallet.PayWalletDO;
 | 
				
			||||||
 | 
					import cn.iocoder.yudao.module.pay.enums.wallet.PayWalletBizTypeEnum;
 | 
				
			||||||
 | 
					import cn.iocoder.yudao.module.pay.service.wallet.PayWalletService;
 | 
				
			||||||
 | 
					import jakarta.annotation.Resource;
 | 
				
			||||||
 | 
					import lombok.extern.slf4j.Slf4j;
 | 
				
			||||||
 | 
					import org.springframework.stereotype.Service;
 | 
				
			||||||
 | 
					import org.springframework.validation.annotation.Validated;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import static cn.iocoder.yudao.framework.common.enums.UserTypeEnum.MEMBER;
 | 
				
			||||||
 | 
					import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
 | 
				
			||||||
 | 
					import static cn.iocoder.yudao.module.pay.enums.ErrorCodeConstants.WALLET_NOT_FOUND;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * 会员钱包 API 实现类
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @author HUIHUI
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					@Service
 | 
				
			||||||
 | 
					@Validated
 | 
				
			||||||
 | 
					@Slf4j
 | 
				
			||||||
 | 
					public class PayWalletApiImpl implements PayWalletApi {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Resource
 | 
				
			||||||
 | 
					    private PayWalletService payWalletService;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    @Override
 | 
				
			||||||
 | 
					    public void updateBalance(PayWalletUpdateBalanceReqDTO reqDTO) {
 | 
				
			||||||
 | 
					        // 获得用户钱包
 | 
				
			||||||
 | 
					        PayWalletDO wallet = payWalletService.getOrCreateWallet(reqDTO.getUserId(), MEMBER.getValue());
 | 
				
			||||||
 | 
					        if (wallet == null) {
 | 
				
			||||||
 | 
					            log.error("[updateBalance],reqDTO({}) 用户钱包不存在.", reqDTO);
 | 
				
			||||||
 | 
					            throw exception(WALLET_NOT_FOUND);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        // 更新钱包余额
 | 
				
			||||||
 | 
					        payWalletService.addWalletBalance(wallet.getId(), String.valueOf(reqDTO.getUserId()),
 | 
				
			||||||
 | 
					                PayWalletBizTypeEnum.UPDATE_BALANCE, reqDTO.getBalance());
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@@ -12,12 +12,12 @@ import cn.iocoder.yudao.module.pay.enums.wallet.PayWalletBizTypeEnum;
 | 
				
			|||||||
import cn.iocoder.yudao.module.pay.service.order.PayOrderService;
 | 
					import cn.iocoder.yudao.module.pay.service.order.PayOrderService;
 | 
				
			||||||
import cn.iocoder.yudao.module.pay.service.refund.PayRefundService;
 | 
					import cn.iocoder.yudao.module.pay.service.refund.PayRefundService;
 | 
				
			||||||
import cn.iocoder.yudao.module.pay.service.wallet.bo.WalletTransactionCreateReqBO;
 | 
					import cn.iocoder.yudao.module.pay.service.wallet.bo.WalletTransactionCreateReqBO;
 | 
				
			||||||
 | 
					import jakarta.annotation.Resource;
 | 
				
			||||||
import lombok.extern.slf4j.Slf4j;
 | 
					import lombok.extern.slf4j.Slf4j;
 | 
				
			||||||
import org.springframework.context.annotation.Lazy;
 | 
					import org.springframework.context.annotation.Lazy;
 | 
				
			||||||
import org.springframework.stereotype.Service;
 | 
					import org.springframework.stereotype.Service;
 | 
				
			||||||
import org.springframework.transaction.annotation.Transactional;
 | 
					import org.springframework.transaction.annotation.Transactional;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import jakarta.annotation.Resource;
 | 
					 | 
				
			||||||
import java.time.LocalDateTime;
 | 
					import java.time.LocalDateTime;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
 | 
					import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
 | 
				
			||||||
@@ -176,6 +176,9 @@ public class PayWalletServiceImpl implements  PayWalletService {
 | 
				
			|||||||
                walletMapper.updateWhenRecharge(payWallet.getId(), price);
 | 
					                walletMapper.updateWhenRecharge(payWallet.getId(), price);
 | 
				
			||||||
                break;
 | 
					                break;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					            case UPDATE_BALANCE: // 更新余额
 | 
				
			||||||
 | 
					                walletMapper.updateWhenRecharge(payWallet.getId(), price);
 | 
				
			||||||
 | 
					                break;
 | 
				
			||||||
            default: {
 | 
					            default: {
 | 
				
			||||||
                // TODO 其它类型待实现
 | 
					                // TODO 其它类型待实现
 | 
				
			||||||
                throw new UnsupportedOperationException("待实现");
 | 
					                throw new UnsupportedOperationException("待实现");
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user