From e755145ce3a5d14468a09b4062c84d7c13a92f0c Mon Sep 17 00:00:00 2001 From: luodangjia <luodangjia> Date: 星期一, 04 十一月 2024 15:39:07 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TIntegralRuleController.java | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TIntegralRuleController.java b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TIntegralRuleController.java index 1813a92..39e822d 100644 --- a/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TIntegralRuleController.java +++ b/ruoyi-service/ruoyi-other/src/main/java/com/ruoyi/other/controller/TIntegralRuleController.java @@ -5,15 +5,22 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.ruoyi.account.api.feignClient.AppUserCarClient; +import com.ruoyi.account.api.feignClient.AppUserClient; +import com.ruoyi.account.api.model.TAppUser; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.web.domain.AjaxResult; import com.ruoyi.common.log.annotation.Log; import com.ruoyi.common.log.enums.BusinessType; +import com.ruoyi.common.security.service.TokenService; import com.ruoyi.other.api.domain.THtml; import com.ruoyi.other.api.domain.TIntegralRule; +import com.ruoyi.other.api.domain.TVip; import com.ruoyi.other.api.dto.SaveHtml; import com.ruoyi.other.service.THtmlService; import com.ruoyi.other.service.TIntegralRuleService; +import com.ruoyi.other.service.TVipService; +import com.ruoyi.system.api.model.LoginUserApplet; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; @@ -35,6 +42,8 @@ private THtmlService htmlService; @Autowired private TIntegralRuleService integralRuleService; + @Autowired + private AppUserClient appUserClient; /** @@ -54,12 +63,34 @@ point += jsonObject.getInteger("num4"); return R.ok(point); } + @Autowired + private TokenService tokenService; + @Autowired + private TVipService vipService; @GetMapping("/getSet") @ApiOperation(tags = {"管理后台-积分管理","小程序-个人中心-签到"},value = "获取积分设置") public R<TIntegralRule> getSet() { TIntegralRule res = integralRuleService.getOne(new QueryWrapper<>()); return R.ok(res); } + @GetMapping("/getSet1") + @ApiOperation(tags = {"小程序-个人中心-签到"},value = "获取积分设置") + public R<TIntegralRule> getSet1() { + TIntegralRule res = integralRuleService.getOne(new QueryWrapper<>()); + LoginUserApplet loginUserApplet = tokenService.getLoginUserApplet(); + res.setIsDouble(0); + if (loginUserApplet!=null){ + TAppUser data = appUserClient.getUserById(loginUserApplet.getUserId()).getData(); + if (data.getVipEndTime()!=null && data.getVipEndTime().isAfter(LocalDateTime.now())){ + TVip byId = vipService.getById(data.getVipId()); + Integer doubleIntegration = byId.getDoubleIntegration(); + if (doubleIntegration!=null&&doubleIntegration==1){ + res.setIsDouble(1); + } + } + } + return R.ok(res); + } @PostMapping("/saveSet") @ApiOperation(tags = {"管理后台-积分管理"},value = "保存积分设置") -- Gitblit v1.7.1