diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/customer/admin/CustomerMainApi.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/customer/admin/CustomerMainApi.java index c44359a5..3c27b7cd 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/customer/admin/CustomerMainApi.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/customer/admin/CustomerMainApi.java @@ -8,9 +8,13 @@ import cn.iocoder.yudao.module.conf.entity.BaseType; import cn.iocoder.yudao.module.custom.entity.CustomerMain; import cn.iocoder.yudao.module.custom.service.CustomerMainService; import cn.iocoder.yudao.module.custom.vo.CustomerMainRespVO; +import cn.iocoder.yudao.module.member.entity.MemberLevel; +import cn.iocoder.yudao.module.member.service.MemberLevelService; +import cn.iocoder.yudao.module.member.vo.MemberLevelPageReqVO; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; +import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -18,6 +22,8 @@ import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import java.util.List; + import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; /** @@ -31,6 +37,8 @@ public class CustomerMainApi { @Resource private CustomerMainService customerMainService; + @Resource + private MemberLevelService levelService; /** * 查询当前登录客户信息 @@ -44,4 +52,10 @@ public class CustomerMainApi { return success(customerMainService.getUserCustomer()); } + @GetMapping("/allMember") + @Operation(summary = "获得全部会员") + public CommonResult> getLevelAll(MemberLevelPageReqVO pageReqVO) { + return success(levelService.queryListAll(pageReqVO)); + } + } diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainRespVO.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainRespVO.java index 13ef1dac..c4a3ad32 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainRespVO.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/vo/CustomerMainRespVO.java @@ -41,6 +41,8 @@ public class CustomerMainRespVO extends CustomerMain { private BigDecimal forzeBalance; /**累计充值额度*/ private BigDecimal allBalance; + /**会员权益*/ + private String userEquity; } \ No newline at end of file diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/member/service/impl/MemberLevelServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/member/service/impl/MemberLevelServiceImpl.java index b5dd3b83..b078b057 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/member/service/impl/MemberLevelServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/member/service/impl/MemberLevelServiceImpl.java @@ -15,7 +15,9 @@ import org.springframework.stereotype.Service; import org.springframework.validation.annotation.Validated; import javax.annotation.Resource; +import java.util.Comparator; import java.util.List; +import java.util.stream.Collectors; /** * 会员等级 Service 实现类 @@ -88,9 +90,8 @@ public class MemberLevelServiceImpl extends ServiceImpl queryListAll(MemberLevelPageReqVO pageReqVO) { QueryWrapper q = new QueryWrapper<>(); - q.eq("status","01"); List memberLevels = this.levelMapper.selectList(q); - return memberLevels; + return memberLevels.stream().sorted(Comparator.comparing(MemberLevel::getSort)).collect(Collectors.toList()); } diff --git a/dl-module-base/src/main/resources/mapper/custom/CustomerMainMapper.xml b/dl-module-base/src/main/resources/mapper/custom/CustomerMainMapper.xml index 8bb4317b..e48e3c91 100644 --- a/dl-module-base/src/main/resources/mapper/custom/CustomerMainMapper.xml +++ b/dl-module-base/src/main/resources/mapper/custom/CustomerMainMapper.xml @@ -105,6 +105,7 @@ main.STATUS AS STATUS, group_concat( item.ser_content ) AS serContents, memberLevel.NAME AS levelName, + memberLevel.user_equity AS userEquity, COALESCE(bcb.balance, 0.00) AS balance, COALESCE(bcb.forze_balance, 0.00) AS forzeBalance, COALESCE(bcb.all_balance, 0.00) AS allBalance