| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.chargingPile.api.dto.ApplyChargingQuery; |
| | | import com.ruoyi.chargingPile.api.dto.ApplyChargingRemarkDto; |
| | | import com.ruoyi.chargingPile.api.dto.TApplyChargingPileDTO; |
| | | import com.ruoyi.chargingPile.api.model.TApplyChargingPile; |
| | | import com.ruoyi.chargingPile.dto.TApplyChargingPileExportDto; |
| | | import com.ruoyi.chargingPile.service.TApplyChargingPileService; |
| | | import com.ruoyi.common.core.constant.Constants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | 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.log.enums.OperatorType; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import com.ruoyi.common.security.service.TokenService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.codec.CharEncoding; |
| | |
| | | |
| | | private final TApplyChargingPileService applyChargingPileService; |
| | | private final TokenService tokenService; |
| | | private final RedisService redisService; |
| | | |
| | | @Autowired |
| | | public TApplyChargingPileController(TApplyChargingPileService applyChargingPileService, TokenService tokenService) { |
| | | public TApplyChargingPileController(TApplyChargingPileService applyChargingPileService, TokenService tokenService, RedisService redisService) { |
| | | this.applyChargingPileService = applyChargingPileService; |
| | | this.tokenService = tokenService; |
| | | this.redisService = redisService; |
| | | } |
| | | |
| | | /** |
| | |
| | | @Log(title = "建桩申请", businessType = BusinessType.INSERT,operatorType = OperatorType.MOBILE) |
| | | @ApiOperation(tags = {"小程序-建桩申请"},value = "建桩申请") |
| | | @PostMapping(value = "/add") |
| | | public AjaxResult<Boolean> add(@RequestBody TApplyChargingPile dto) { |
| | | public AjaxResult<Boolean> add(@RequestBody TApplyChargingPileDTO dto) { |
| | | // 验证验证码 |
| | | String code = redisService.getCacheObject(dto.getLandlordPhone() + Constants.APPLY_CHARGING); |
| | | if(StringUtils.isEmpty(code)){ |
| | | return AjaxResult.error("验证码已过期,请重新获取验证码!"); |
| | | } |
| | | if(!code.equals(dto.getCode())){ |
| | | return AjaxResult.error("验证码错误!"); |
| | | } |
| | | // 用户id |
| | | Long userId = tokenService.getLoginUserApplet().getUserId(); |
| | | dto.setAppUserId(userId); |