import com.tuoheng.common.core.enums.ServiceExceptionEnum; | import com.tuoheng.common.core.enums.ServiceExceptionEnum; | ||||
import com.tuoheng.common.core.exception.ServiceException; | import com.tuoheng.common.core.exception.ServiceException; | ||||
import com.tuoheng.common.core.utils.JsonResult; | import com.tuoheng.common.core.utils.JsonResult; | ||||
import com.tuoheng.common.core.utils.SecurityUserUtils; | |||||
import com.tuoheng.common.core.utils.StringUtils; | import com.tuoheng.common.core.utils.StringUtils; | ||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
import org.springframework.beans.BeanUtils; | import org.springframework.beans.BeanUtils; | ||||
@Override | @Override | ||||
public JsonResult getQuestionList() { | public JsonResult getQuestionList() { | ||||
//获取当前登录人租户id | //获取当前登录人租户id | ||||
//String username = SecurityUserUtils.username(); | |||||
String username = "admin"; | |||||
String username = SecurityUserUtils.username(); | |||||
User user = userMapper.selectOne(new LambdaQueryWrapper<User>() | User user = userMapper.selectOne(new LambdaQueryWrapper<User>() | ||||
.eq(User::getMark, 1) | .eq(User::getMark, 1) | ||||
.eq(User::getStatus,1) | |||||
.eq(User::getUsername, username)); | .eq(User::getUsername, username)); | ||||
if(ObjectUtil.isNull(user)){ | if(ObjectUtil.isNull(user)){ | ||||
return null; | return null; | ||||
// JsonResult.error(ListByDeptUserTypeEnum.QUERY_IS_FAILED.getCode(),ListByDeptUserTypeEnum.QUERY_IS_FAILED.getMsg()); | // JsonResult.error(ListByDeptUserTypeEnum.QUERY_IS_FAILED.getCode(),ListByDeptUserTypeEnum.QUERY_IS_FAILED.getMsg()); | ||||
// } | // } | ||||
//获取当前登录人信息 | //获取当前登录人信息 | ||||
//String username = SecurityUserUtils.username(); | |||||
String username = "admin"; | |||||
String username = SecurityUserUtils.username(); | |||||
if(StringUtils.isEmpty(username)){ | if(StringUtils.isEmpty(username)){ | ||||
JsonResult.error(ListByDeptUserTypeEnum.USER_NAME_IS_NULL.getCode(),ListByDeptUserTypeEnum.USER_NAME_IS_NULL.getMsg()); | JsonResult.error(ListByDeptUserTypeEnum.USER_NAME_IS_NULL.getCode(),ListByDeptUserTypeEnum.USER_NAME_IS_NULL.getMsg()); | ||||
} | } | ||||
User user = userMapper.selectOne(new LambdaQueryWrapper<User>() | User user = userMapper.selectOne(new LambdaQueryWrapper<User>() | ||||
.eq(User::getMark, 1).eq(User::getUsername, username)); | |||||
.eq(User::getMark, 1) | |||||
.eq(User::getStatus,1) | |||||
.eq(User::getUsername, username)); | |||||
if(ObjectUtil.isNull(user)){ | if(ObjectUtil.isNull(user)){ | ||||
JsonResult.error(ListByDeptUserTypeEnum.USER_IS_NULL.getCode(),ListByDeptUserTypeEnum.USER_IS_NULL.getMsg()); | JsonResult.error(ListByDeptUserTypeEnum.USER_IS_NULL.getCode(),ListByDeptUserTypeEnum.USER_IS_NULL.getMsg()); | ||||
} | } |
// if(null == dto.getAirportId() && StringUtils.isEmpty(dto.getUserId())){ | // if(null == dto.getAirportId() && StringUtils.isEmpty(dto.getUserId())){ | ||||
// return JsonResult.error(QueryInspectionListServiceEnum.QUERY_IS_FAILED.getCode(),QueryInspectionListServiceEnum.QUERY_IS_FAILED.getMsg()); | // return JsonResult.error(QueryInspectionListServiceEnum.QUERY_IS_FAILED.getCode(),QueryInspectionListServiceEnum.QUERY_IS_FAILED.getMsg()); | ||||
// } | // } | ||||
//String username = SecurityUserUtils.username(); | |||||
String username = "admin"; | |||||
String username = SecurityUserUtils.username(); | |||||
if(StringUtils.isEmpty(username)){ | if(StringUtils.isEmpty(username)){ | ||||
return JsonResult.error(QueryInspectionListServiceEnum.QUERY_IS_FAILED.getCode(),QueryInspectionListServiceEnum.QUERY_IS_FAILED.getMsg()); | return JsonResult.error(QueryInspectionListServiceEnum.QUERY_IS_FAILED.getCode(),QueryInspectionListServiceEnum.QUERY_IS_FAILED.getMsg()); | ||||
} | } | ||||
User user = userMapper.selectOne(Wrappers.<User>lambdaQuery() | User user = userMapper.selectOne(Wrappers.<User>lambdaQuery() | ||||
.eq(User::getMark, 1).eq(User::getUsername,username)); | |||||
.eq(User::getMark, 1).eq(User::getStatus,1) | |||||
.eq(User::getUsername,username)); | |||||
if(ObjectUtil.isNull(user)){ | if(ObjectUtil.isNull(user)){ | ||||
return JsonResult.error(QueryInspectionListServiceEnum.USER_IS_NOT_EXIST.getCode(),QueryInspectionListServiceEnum.USER_IS_NOT_EXIST.getMsg()); | return JsonResult.error(QueryInspectionListServiceEnum.USER_IS_NOT_EXIST.getCode(),QueryInspectionListServiceEnum.USER_IS_NOT_EXIST.getMsg()); |
import com.tuoheng.common.core.enums.ServiceExceptionEnum; | import com.tuoheng.common.core.enums.ServiceExceptionEnum; | ||||
import com.tuoheng.common.core.exception.ServiceException; | import com.tuoheng.common.core.exception.ServiceException; | ||||
import com.tuoheng.common.core.utils.JsonResult; | import com.tuoheng.common.core.utils.JsonResult; | ||||
import com.tuoheng.common.core.utils.SecurityUserUtils; | |||||
import com.tuoheng.common.core.utils.StringUtils; | import com.tuoheng.common.core.utils.StringUtils; | ||||
import lombok.extern.slf4j.Slf4j; | import lombok.extern.slf4j.Slf4j; | ||||
import org.springframework.beans.BeanUtils; | import org.springframework.beans.BeanUtils; | ||||
public JsonResult getList() { | public JsonResult getList() { | ||||
//获取登录用户信息 | //获取登录用户信息 | ||||
//String username = SecurityUserUtils.username(); | |||||
String username = "admin"; | |||||
String username = SecurityUserUtils.username(); | |||||
if(StringUtils.isEmpty(username)){ | if(StringUtils.isEmpty(username)){ | ||||
JsonResult.error(ListByDeptUserTypeEnum.USER_NAME_IS_NULL.getCode(),ListByDeptUserTypeEnum.USER_NAME_IS_NULL.getMsg()); | JsonResult.error(ListByDeptUserTypeEnum.USER_NAME_IS_NULL.getCode(),ListByDeptUserTypeEnum.USER_NAME_IS_NULL.getMsg()); | ||||
} | } | ||||
User user = userMapper.selectOne(Wrappers.<User>lambdaQuery() | User user = userMapper.selectOne(Wrappers.<User>lambdaQuery() | ||||
.eq(User::getUsername, username).eq(User::getMark, 1)); | |||||
.eq(User::getUsername, username) | |||||
.eq(User::getStatus,1) | |||||
.eq(User::getMark, 1)); | |||||
if(ObjectUtil.isNull(user)){ | if(ObjectUtil.isNull(user)){ | ||||
JsonResult.error(ListByDeptUserTypeEnum.USER_IS_NULL.getCode(),ListByDeptUserTypeEnum.USER_IS_NULL.getMsg()); | JsonResult.error(ListByDeptUserTypeEnum.USER_IS_NULL.getCode(),ListByDeptUserTypeEnum.USER_IS_NULL.getMsg()); | ||||
} | } |