This commit is contained in:
PQZ 2024-09-24 21:32:11 +08:00
parent 5429922982
commit 4d75d2b1ac
4 changed files with 20 additions and 2 deletions

View File

@ -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.entity.CustomerMain;
import cn.iocoder.yudao.module.custom.service.CustomerMainService; import cn.iocoder.yudao.module.custom.service.CustomerMainService;
import cn.iocoder.yudao.module.custom.vo.CustomerMainRespVO; 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 com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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 org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
@ -18,6 +22,8 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
/** /**
@ -31,6 +37,8 @@ public class CustomerMainApi {
@Resource @Resource
private CustomerMainService customerMainService; private CustomerMainService customerMainService;
@Resource
private MemberLevelService levelService;
/** /**
* 查询当前登录客户信息 * 查询当前登录客户信息
@ -44,4 +52,10 @@ public class CustomerMainApi {
return success(customerMainService.getUserCustomer()); return success(customerMainService.getUserCustomer());
} }
@GetMapping("/allMember")
@Operation(summary = "获得全部会员")
public CommonResult<List<MemberLevel>> getLevelAll(MemberLevelPageReqVO pageReqVO) {
return success(levelService.queryListAll(pageReqVO));
}
} }

View File

@ -41,6 +41,8 @@ public class CustomerMainRespVO extends CustomerMain {
private BigDecimal forzeBalance; private BigDecimal forzeBalance;
/**累计充值额度*/ /**累计充值额度*/
private BigDecimal allBalance; private BigDecimal allBalance;
/**会员权益*/
private String userEquity;
} }

View File

@ -15,7 +15,9 @@ import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Comparator;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* 会员等级 Service 实现类 * 会员等级 Service 实现类
@ -88,9 +90,8 @@ public class MemberLevelServiceImpl extends ServiceImpl<MemberLevelMapper, Membe
public List<MemberLevel> queryListAll(MemberLevelPageReqVO pageReqVO) { public List<MemberLevel> queryListAll(MemberLevelPageReqVO pageReqVO) {
QueryWrapper<MemberLevel> q = new QueryWrapper<>(); QueryWrapper<MemberLevel> q = new QueryWrapper<>();
q.eq("status","01");
List<MemberLevel> memberLevels = this.levelMapper.selectList(q); List<MemberLevel> memberLevels = this.levelMapper.selectList(q);
return memberLevels; return memberLevels.stream().sorted(Comparator.comparing(MemberLevel::getSort)).collect(Collectors.toList());
} }

View File

@ -105,6 +105,7 @@
main.STATUS AS STATUS, main.STATUS AS STATUS,
group_concat( item.ser_content ) AS serContents, group_concat( item.ser_content ) AS serContents,
memberLevel.NAME AS levelName, memberLevel.NAME AS levelName,
memberLevel.user_equity AS userEquity,
COALESCE(bcb.balance, 0.00) AS balance, COALESCE(bcb.balance, 0.00) AS balance,
COALESCE(bcb.forze_balance, 0.00) AS forzeBalance, COALESCE(bcb.forze_balance, 0.00) AS forzeBalance,
COALESCE(bcb.all_balance, 0.00) AS allBalance COALESCE(bcb.all_balance, 0.00) AS allBalance