ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/controller/VipCenterController.java
@@ -133,7 +133,7 @@ LoginUser loginUser = tokenService.getLoginUser(); Long userid = loginUser.getUserid(); if (type == 4){ return R.ok(vipCenterService.checkReadyToBeProxy(userid)); return R.ok(vipCenterService.checkReadyToBeProxy(userid, type)); }else if (type == 5){ return R.ok(vipCenterService.checkReadyToBeAgent(userid)); }else if (type == 6){ ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/VipCenterService.java
@@ -5,7 +5,7 @@ /** * 校验准代理的申请条件 */ Boolean checkReadyToBeProxy(Long userId); Boolean checkReadyToBeProxy(Long userId,Integer vipId); /** * 校验代理的申请条件 ruoyi-service/ruoyi-account/src/main/java/com/ruoyi/account/service/impl/VipCenterServiceImpl.java
@@ -6,13 +6,14 @@ import com.ruoyi.account.api.model.AppUser; import com.ruoyi.account.service.AppUserService; import com.ruoyi.account.service.VipCenterService; import com.ruoyi.account.service.VipSettingService; import com.ruoyi.common.core.domain.R; import com.ruoyi.order.feignClient.RemoteOrderGoodsClient; import com.ruoyi.order.model.Order; import com.ruoyi.other.api.domain.Goods; import com.ruoyi.other.api.domain.VipGood; import com.ruoyi.other.api.domain.VipSetting; import com.ruoyi.other.api.feignClient.VipGoodClient; import lombok.RequiredArgsConstructor; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -27,14 +28,22 @@ private RemoteOrderGoodsClient remoteOrderGoodsClient; @Resource private VipGoodClient vipGoodClient; @Resource private VipSettingService vipSettingService; @Override public Boolean checkReadyToBeProxy(Long userId) { public Boolean checkReadyToBeProxy(Long userId,Integer vipId) { AppUser appUser = appUserService.getById(userId); if (appUser.getShopPoint() >= 500){ VipSetting vipSetting = vipSettingService.getVipSettingById(vipId); if (vipSetting.getVipLevelUpShopRole() == 0){ return false; } Integer vipLevelUpShop = vipSetting.getVipLevelUpShop(); if (appUser.getShopPoint() >= vipLevelUpShop){ return true; } if (appUser.getSharePoint() >= 400){ Integer vipLevelUpShare = vipSetting.getVipLevelUpShare(); if (appUser.getSharePoint() >= vipLevelUpShare){ return true; } ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/GoodsEvaluateController.java
@@ -1,10 +1,12 @@ package com.ruoyi.other.controller; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.ruoyi.account.api.feignClient.AppUserClient; import com.ruoyi.account.api.model.AppUser; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.web.page.TableDataInfo; import com.ruoyi.order.model.Order; import com.ruoyi.other.api.domain.Goods; import com.ruoyi.other.api.domain.GoodsEvaluate; import com.ruoyi.other.service.GoodsEvaluateService; @@ -50,19 +52,21 @@ */ @PostMapping("/addGoodsEvaluate") @ApiOperation(value = "发布商品评价", tags = {"小程序-发布商品评价"}) public R<Void> addGoodsEvaluate(GoodsEvaluate goodsEvaluate){ goodsEvaluateService.save(goodsEvaluate); public R<Void> addGoodsEvaluate(@RequestBody List<GoodsEvaluate> goodsEvaluates){ // todo return R.ok(); } /** * 评论详情 */ @GetMapping("/detail/{id}") @GetMapping("/detail/{orderId}") @ApiOperation(value = "评论详情", tags = {"小程序-评论详情"}) public R<GoodsEvaluate> detail(@PathVariable("id") Long id){ GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(id); return R.ok(goodsEvaluate); public R<List<GoodsEvaluate>> detail(@PathVariable("orderId") Long orderId){ List<GoodsEvaluate> list = goodsEvaluateService.list(new LambdaQueryWrapper<GoodsEvaluate>() .eq(GoodsEvaluate::getStatus, 2) .eq(GoodsEvaluate::getOrderId, orderId)); return R.ok(list); } }