From f2070facdb5715e7349df69cfe257289c680d292 Mon Sep 17 00:00:00 2001 From: huliguo <2023611923@qq.com> Date: 星期三, 23 四月 2025 18:12:46 +0800 Subject: [PATCH] 前端联调 --- ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/UserPointServiceImpl.java | 50 ++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 44 insertions(+), 6 deletions(-) diff --git a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/UserPointServiceImpl.java b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/UserPointServiceImpl.java index 253cbec..2f1c2e9 100644 --- a/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/UserPointServiceImpl.java +++ b/ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/UserPointServiceImpl.java @@ -7,16 +7,19 @@ import com.ruoyi.account.api.model.*; import com.ruoyi.account.mapper.UserPointMapper; import com.ruoyi.account.service.*; -import com.ruoyi.account.vo.UserPointDetailVO; -import com.ruoyi.account.vo.UserPointStatistics; -import com.ruoyi.account.vo.UserPointVO; +import com.ruoyi.account.vo.*; +import com.ruoyi.common.core.annotation.Excel; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.utils.PhoneNumberValidator; +import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.core.web.page.PageInfo; import com.ruoyi.common.security.service.TokenService; import com.ruoyi.other.api.enums.PointChangeType; +import com.ruoyi.system.api.domain.SysConfig; +import com.ruoyi.system.api.feignClient.SysConfigClient; import com.ruoyi.system.api.model.LoginUser; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -42,9 +45,10 @@ private TokenService tokenService; @Resource private UserPointService userPointService; - - - + @Resource + private SysConfigClient sysConfigClient; + @Autowired + private UserPointMapper userPointMapper; @Override @@ -58,6 +62,16 @@ userPointVO.setExpendPoint(appUser.getExchangePoint()); userPointVO.setTransferableInPoint(appUser.getTransferableInPoint()); userPointVO.setTransferableOutPoint(appUser.getTransferableOutPoint()); + R<SysConfig> info = sysConfigClient.getInfo(9L); + if (info == null || info.getData() == null) { + throw new RuntimeException("获取积分兑换比例配置失败"); + } + String configValue = info.getData().getConfigValue(); + if (StringUtils.isBlank(configValue)) { + throw new RuntimeException("积分兑换比例配置值为空"); + } + Boolean isTransferable = Boolean.valueOf(configValue.trim()); + userPointVO.setIsTransferable(isTransferable); return userPointVO; } @@ -248,4 +262,28 @@ }); return userPointIPage; } + + @Override + public PageInfo<UserPointDetailVO> getUserPontDetailPageList(Collection<Integer> types, Long id, Integer pageCurr, Integer pageSize) { + PageInfo<UserPointDetailVO> pageInfo = new PageInfo<>(pageCurr, pageSize); + List<UserPointDetailVO> list =baseMapper.getUserPontDetailPageList(pageInfo,id,types); + pageInfo.setRecords(list); + return pageInfo; + } + + @Override + public Integer selectRechargeAndUse(String name, String phone, LocalDateTime beginTime, LocalDateTime endTime,Integer type) { + + return baseMapper.selectRechargeAndUse(name,phone,beginTime,endTime,type); + } + + @Override + public PageInfo<UserPointStatisticsPageVO> getUserPointStatisticsPageList(Collection<Integer> types, String name, String phone, LocalDateTime beginTime, LocalDateTime endTime, Integer pageCurr, Integer pageSize) { + PageInfo<UserPointStatisticsPageVO> pageInfo = new PageInfo<>(pageCurr, pageSize); + List<UserPointStatisticsPageVO>list=baseMapper.getUserPointStatisticsPageList(pageInfo,types,name,phone,beginTime,endTime); + pageInfo.setRecords(list); + return pageInfo; + } + + } -- Gitblit v1.7.1