| | |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.dao.business.model.DriverInfo; |
| | | import com.doumee.dao.business.model.Member; |
| | | import com.doumee.dao.business.model.ShopInfo; |
| | | import io.jsonwebtoken.JwtException; |
| | |
| | | if(StringUtils.isBlank(tokenRedis)){ |
| | | throw new BusinessException(ResponseStatus.BE_OVERDUE); |
| | | } |
| | | Integer memberId = getTokenId(token); |
| | | Integer driverId = getTokenId(token); |
| | | //查询司机信息 |
| | | Integer memberId = dao.queryForObject(" select COALESCE(member_id,0) from driver_info where VERSION_TYPE = 0 and id = ?", Integer.class, driverId); |
| | | if(Objects.isNull(memberId)||Constants.equalsInteger(memberId,Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"司机信息信息出错"); |
| | | } |
| | | Integer isDeleted = dao.queryForObject(" select COALESCE(DELETED,1) from member where user_type = 1 and id = ?", Integer.class, memberId); |
| | | if(isDeleted== Constants.ONE){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"司机信息已删除,请联系管理员"); |
| | |
| | | } |
| | | Integer count = dao.queryForObject("select count(1) from member where user_type = 1 and id = ?", Integer.class, memberId); |
| | | if (count != null && count > 0) { |
| | | request.setAttribute(JwtTokenUtil.DRIVER_ID, memberId); |
| | | request.setAttribute(JwtTokenUtil.DRIVER_ID, driverId); |
| | | return true; |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.BE_OVERDUE.getCode(),"司机信息出错"); |