| | |
| | | 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; |
| | |
| | | private THtmlService htmlService; |
| | | @Autowired |
| | | private TIntegralRuleService integralRuleService; |
| | | @Autowired |
| | | private AppUserClient appUserClient; |
| | | |
| | | |
| | | /** |
| | |
| | | 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<>()); |
| | | 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); |
| | | } |
| | | |