| | |
| | | import com.ruoyi.account.util.GiveVipUtil; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.dto.PointChangeDto; |
| | | import com.ruoyi.common.core.enums.status.AppUserStatusEnum; |
| | | import com.ruoyi.common.core.utils.JwtUtils; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | |
| | | import com.ruoyi.order.api.feignClient.ExchangeOrderClient; |
| | | import com.ruoyi.order.api.model.TChargingOrder; |
| | | import com.ruoyi.order.api.model.TExchangeOrder; |
| | | import com.ruoyi.other.api.domain.*; |
| | | import com.ruoyi.other.api.dto.UnitListQueryDto; |
| | | import com.ruoyi.other.api.domain.TCompany; |
| | | import com.ruoyi.other.api.domain.TCoupon; |
| | | import com.ruoyi.other.api.domain.TIntegralRule; |
| | | import com.ruoyi.other.api.domain.TUserTag; |
| | | import com.ruoyi.other.api.feignClient.IntegralRuleClient; |
| | | import com.ruoyi.other.api.feignClient.OtherClient; |
| | | import com.ruoyi.other.api.feignClient.VipClient; |
| | | import com.ruoyi.system.api.model.LoginUserApplet; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | private TAppUserCarService carService; |
| | | @Resource |
| | | private IntegralRuleClient integralRuleClient; |
| | | |
| | | @Resource |
| | | private VipClient vipClient; |
| | | |
| | | |
| | | |
| | |
| | | public R pointsDetail(@RequestBody UserChangeDto userChangeDto) { |
| | | TAppUser appUser = appUserService.getById(userChangeDto.getUserId()); |
| | | appUser.setStatus(userChangeDto.getStatus()); |
| | | appUser.setRemark(userChangeDto.getRemark()); |
| | | appUserService.updateById(appUser); |
| | | return R.ok(); |
| | | } |
| | |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | TAppUser byId = appUserService.getById(userId); |
| | | AppUserInfoDto appUserInfoDto = new AppUserInfoDto(); |
| | | TVip data = vipClient.getVipInfoByType(2).getData(); |
| | | appUserInfoDto.setMinPrice(data.getMonthlyCard()); |
| | | |
| | | //判断会员 |
| | | if (byId.getVipEndTime()==null||byId.getVipEndTime().isBefore(LocalDateTime.now())){ |
| | |
| | | TCoupon coupon = JSON.toJavaObject(JSON.parseObject(tAppCoupon.getCouponJson()), TCoupon.class); |
| | | InfoCouponDto infoCouponDto = new InfoCouponDto(); |
| | | BeanUtils.copyProperties(coupon,infoCouponDto); |
| | | infoCouponDto.setId(tAppCoupon.getId()); |
| | | couponDtos.add(infoCouponDto); |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @ApiOperation(value = "签到", tags = {"小程序-个人中心-签到"}) |
| | | @PostMapping(value = "/user/sign") |
| | | @GetMapping(value = "/user/sign") |
| | | public R sign() { |
| | | LoginUserApplet loginUserApplet = tokenService.getLoginUserApplet(); |
| | | Long userId = loginUserApplet.getUserId(); |
| | |
| | | signService.updateById(appUserSign); |
| | | } |
| | | } |
| | | pointDetailUtil.addDetail(byId.getPoints(),byId.getPoints()+points,1,userId,"每日签到",""); |
| | | pointDetailUtil.addDetail(byId.getPoints(),byId.getPoints()+points,1,userId,"每日签到","JF"); |
| | | byId.setPoints(byId.getPoints()+points); |
| | | appUserService.updateById(byId); |
| | | return R.ok(); |
| | | } |
| | | |
| | | |
| | | //积分变化记录用 |
| | | @PostMapping(value = "/user/points/change") |
| | | public R change(@RequestBody PointChangeDto points) { |
| | | TAppUser byId = appUserService.getById(points.getUserId()); |
| | | pointDetailUtil.addDetail(byId.getPoints(),byId.getPoints()+points.getPoints(),points.getType(),points.getUserId(),points.getRemark(),"JF"); |
| | | byId.setPoints(byId.getPoints()+points.getPoints()); |
| | | appUserService.updateById(byId); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation(value = "添加编辑车辆", tags = {"小程序-个人中心-车辆"}) |
| | | @PostMapping(value = "/user/car/addOrUpdate") |
| | | public R carAdd(@RequestBody TAppUserCar appUserCar) { |