puzhibing
2024-12-05 aedbc07847148107a67ecab405ce66a2f6ed549d
Merge remote-tracking branch 'origin/master'
3个文件已修改
15 ■■■■■ 已修改文件
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/UserPointServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/UserPointDetailVO.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/UserPointVO.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/UserPointServiceImpl.java
@@ -12,6 +12,9 @@
import com.ruoyi.account.service.UserPointService;
import com.ruoyi.account.vo.UserPointDetailVO;
import com.ruoyi.account.vo.UserPointVO;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.other.api.domain.VipSetting;
import com.ruoyi.other.api.feignClient.RemoteVipSettingClient;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -34,6 +37,8 @@
public class UserPointServiceImpl extends ServiceImpl<UserPointMapper, UserPoint> implements UserPointService {
    @Resource
    private AppUserClient appUserClient;
    @Resource
    private RemoteVipSettingClient remoteVipSettingClient;
    @Override
    public UserPointVO getUserPoint(Long userId) {
@@ -44,6 +49,11 @@
        Map<Integer, Integer> userBalanceMap = userPointList.stream()
                .collect(Collectors.toMap(UserPoint::getType, UserPoint::getBalance));
        R<VipSetting> r = remoteVipSettingClient.getVipSettingById(appUser.getVipId());
        if (!R.isSuccess(r)){
            throw new RuntimeException("会员等级获取失败");
        }
        Integer lavePoint = appUser.getLavePoint();
        UserPointVO userPointVO = new UserPointVO();
        userPointVO.setTotalPoint(lavePoint);
@@ -53,6 +63,7 @@
        userPointVO.setPullNewPoint(userBalanceMap.get(PointChangeType.NEW_USER_REFERRAL.getCode()));
        userPointVO.setShopAchievementPoint(userBalanceMap.get(PointChangeType.STORE_PERFORMANCE.getCode()));
        userPointVO.setShopSharePoint(userBalanceMap.get(PointChangeType.STORE_COMMISSION_RETURN.getCode()));
        userPointVO.setGiftPoint(r.getData().getVipGiftRole());
        return userPointVO;
    }
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/UserPointDetailVO.java
@@ -20,4 +20,5 @@
    @ApiModelProperty(value = "变动时间")
    private LocalDateTime createTime;
}
ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/vo/UserPointVO.java
@@ -28,4 +28,7 @@
    @ApiModelProperty(value = "门店返佣积分")
    private Integer shopSharePoint;
    @ApiModelProperty(value = "是否可转赠积分")
    private Integer giftPoint;
}