ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/AppUserController.java
@@ -57,8 +57,7 @@ @RestController @RequestMapping("/app-user") public class AppUserController extends BaseController { @Resource private TokenService tokenService; @Resource @@ -653,7 +652,6 @@ @GetMapping("/detail") @ApiOperation(value = "用户列表-详情", tags = {"管理后台"}) public R<AppUser> detail(Long id,Integer shopId) { Long userid = tokenService.getLoginUser().getUserid(); SysUser sysUser = sysUserClient.getSysUser(userid).getData(); AppUser byId = appUserService.getById(id); @@ -686,7 +684,10 @@ List<AppUser> list = appUserService.lambdaQuery().eq(AppUser::getInviteUserId, id).list(); byId.setBottomUsers(list); //消费总金额 R<List<Order>> orderR = remoteOrderGoodsClient.byShopIdAndUserId(id,shopId); if(null == shopId){ shopId = -1; } R<List<Order>> orderR = remoteOrderGoodsClient.byShopIdAndUserId(id, shopId); List<Order> orderList = orderR.getData(); if (!CollectionUtils.isEmpty(orderList)){ BigDecimal paymentAmount = orderList.stream().map(Order::getPaymentAmount).reduce(BigDecimal.ZERO, BigDecimal::add); @@ -831,8 +832,6 @@ if (cd.getStartTime().isAfter(cd.getEndTime())) { return R.fail("开始时间不能大于结束时间"); } Map<String, Map<Integer, BigDecimal>> dailyVipCommissions = new TreeMap<>(); getDatesBetween(cd.getStartTime(), cd.getEndTime()).forEach(date -> { for (int i = 1; i < 8; i++){ @@ -1001,7 +1000,7 @@ * 检查会员降级 * @param appUserId */ @PostMapping("/app-user/vipDemotion") @PostMapping("/vipDemotion") public void vipDemotion(@RequestParam("appUserId") Long appUserId){ appUserService.vipDemotion(appUserId); } ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/AppUserServiceImpl.java
@@ -673,7 +673,7 @@ return; } } if(appUser.getVipId() > 2){ if(appUser.getVipId() >= 2){ appUser.setVipId(1); this.updateById(appUser); //添加等级变化记录 ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java
@@ -249,7 +249,7 @@ @PostMapping("/byShopIdAndUserId") public R<List<Order>> byShopIdAndUserId(@RequestParam("appUserId") Long appUserId,@RequestParam("shopId") Integer shopId){ List<Order> list = orderService.lambdaQuery().isNotNull(Order::getEndTime) .eq(Order::getShopId, shopId) .eq(null != shopId && -1 != shopId, Order::getShopId, shopId) .eq(Order::getAppUserId, appUserId) .in(Order::getOrderStatus, 4, 7, 8).list(); return R.ok(list); ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
@@ -531,8 +531,7 @@ appUserClient.editAppUserById(appUser); //降级检测 boolean vipDemotion = vipDemotion(appUser.getShopPoint(), appUser.getVipId()); if(vipDemotion){ if(1 < appUser.getVipId() && appUser.getVipId() < 4){ appUserClient.vipDemotion(appUser.getId()); } //回退优惠券状态 @@ -668,8 +667,7 @@ appUserClient.editAppUserById(appUser); //降级检测 boolean vipDemotion = vipDemotion(appUser.getShopPoint(), appUser.getVipId()); if(vipDemotion){ if(1 < appUser.getVipId() && appUser.getVipId() < 4){ appUserClient.vipDemotion(appUser.getId()); } @@ -730,18 +728,7 @@ return R.ok(); } /** * 会员降级检测 */ public boolean vipDemotion(Integer shopPoint, Integer vipId){ if(vipId == 1 || vipId > 3){ return false; } VipSetting vipSetting = vipSettingClient.getVipSetting(vipId).getData(); Integer vipLevelUpShopRole = vipSetting.getVipLevelUpShopRole(); Integer vipLevelUpShop = vipSetting.getVipLevelUpShop(); return 1 == vipLevelUpShopRole && shopPoint < vipLevelUpShop; } /**