| | |
| | | import com.ruoyi.account.api.model.TAppUser; |
| | | import com.ruoyi.account.api.model.TAppUserCar; |
| | | import com.ruoyi.account.api.model.TAppUserTag; |
| | | import com.ruoyi.account.api.vo.AppUserWhitelistMatchVO; |
| | | import com.ruoyi.account.api.query.ExchangeRecordGoodsQuery; |
| | | import com.ruoyi.account.service.TAppUserService; |
| | | import com.ruoyi.account.service.TAppUserTagService; |
| | | import com.ruoyi.account.service.TAppUserWhitelistService; |
| | | import com.ruoyi.chargingPile.api.feignClient.ChargingGunClient; |
| | | import com.ruoyi.chargingPile.api.model.TChargingGun; |
| | | import com.ruoyi.chargingPile.api.model.TChargingPile; |
| | |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import com.ruoyi.order.api.feignClient.ChargingOrderClient; |
| | | import com.ruoyi.other.api.domain.TCoupon; |
| | | import com.ruoyi.other.api.dto.ExchangeCodeBindDTO; |
| | | import com.ruoyi.other.api.feignClient.OtherClient; |
| | | import com.ruoyi.other.api.vo.ExchangeCodeBindResultVO; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.redisson.api.RLock; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | |
| | | private TAppUserTagService appUserTagService; |
| | | @Autowired |
| | | private TAppUserService appUserService; |
| | | @Resource |
| | | private TAppUserWhitelistService whitelistService; |
| | | |
| | | @Autowired |
| | | private RedissonClient redissonClient; |
| | |
| | | String token = SecurityUtils.getToken(ServletUtils.getRequest()); |
| | | if(com.ruoyi.common.core.utils.StringUtils.isNotEmpty(token)){ |
| | | List<TAppUserCar> cars = appUserCarService.list(new QueryWrapper<TAppUserCar>() |
| | | .eq("app_user_id",tokenService.getLoginUserApplet().getUserId()) |
| | | .eq("app_user_id",tokenService.getLoginUserApplet().getUserId()) |
| | | .eq("del_flag", 0) |
| | | .orderByDesc("create_time")); |
| | | if (!cars.isEmpty()){ |
| | |
| | | data.setVehicleBrand(cars.get(0).getVehicleBrand()); |
| | | data.setId(cars.get(0).getId().toString()); |
| | | } |
| | | AppUserWhitelistMatchVO whitelist = whitelistService.matchWhitelist(tokenService.getLoginUserApplet().getUserId(), chargingGun.getSiteId()); |
| | | data.setWhitelistMatched(Boolean.TRUE.equals(whitelist.getMatched())); |
| | | data.setWhitelistBenefitType(whitelist.getBenefitType()); |
| | | data.setWhitelistBenefitName(whitelist.getBenefitName()); |
| | | } |
| | | Integer data2 = otherClient.getAddCarIntegral().getData(); |
| | | data.setIntegral(data2); |
| | |
| | | count = 0L; |
| | | } |
| | | return R.ok(count); |
| | | } |
| | | |
| | | @ApiOperation(value = "兑换码绑定", tags = {"小程序-兑换码"}) |
| | | @PostMapping(value = "/exchangeCode/bind") |
| | | public AjaxResult<ExchangeCodeBindResultVO> bindExchangeCode(@RequestBody ExchangeCodeBindDTO dto) { |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | TAppUser user = appUserService.getById(userId); |
| | | ExchangeCodeBindResultVO data = otherClient.bindExchangeCode(dto, userId, user == null ? "" : user.getPhone()).getData(); |
| | | return AjaxResult.ok(data); |
| | | } |
| | | |
| | | |
| | |
| | | return R.ok(); |
| | | } |
| | | } |
| | | |