From 6f91919a81c92766cb6a119dfe099b83a22ef446 Mon Sep 17 00:00:00 2001 From: luodangjia <luodangjia> Date: 星期四, 15 八月 2024 11:59:18 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 44 insertions(+), 0 deletions(-) diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java index b2f94b8..6868a19 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TVipController.java @@ -1,6 +1,7 @@ package com.ruoyi.other.controller; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.core.web.page.PageInfo; @@ -55,6 +56,23 @@ public AjaxResult<TVip> getInfo(Integer id) { return AjaxResult.ok(vipService.getById(id)); } + + + @GetMapping("/getById") + @ApiOperation(value = "通过id查会员") + public R<TVip> getById(Integer id) { + return R.ok(vipService.getById(id)); + } + + /** + * 远程调用 + * @param id + * @return + */ + @PostMapping("/getInfo1") + public R<TVip> getInfo1(@RequestParam("id")Integer id) { + return R.ok(vipService.getById(id)); + } @ApiOperation(value = "会员列表分页查询") @PostMapping(value = "/pageList") @ApiImplicitParams({ @@ -78,5 +96,31 @@ return R.ok(idNameMap); } + /** + * 获取最高抵扣、最低起步价,最高折扣的会员 + * @param type 1=最高抵扣、2=最低起步价,3=最高折扣 + * @return + */ + @PostMapping(value = "/getVipInfoByType") + public R<TVip> getVipInfoByType(@RequestParam("type") Integer type){ + switch (type){ + case 1: + return R.ok(vipService.getOne(Wrappers.lambdaQuery(TVip.class) + .eq(TVip::getReveal,1) + .orderByDesc(TVip::getMaximumDeduction) + .last("LIMIT 1"))); + case 2: + return R.ok(vipService.getOne(Wrappers.lambdaQuery(TVip.class) + .eq(TVip::getReveal,1) + .orderByAsc(TVip::getMonthlyCard) + .last("LIMIT 1"))); + default: + return R.ok(vipService.getOne(Wrappers.lambdaQuery(TVip.class) + .eq(TVip::getReveal,1) + .orderByDesc(TVip::getMonthlyCardDiscount) + .last("LIMIT 1"))); + } + } + } -- Gitblit v1.7.1