@@ -30,6 +30,7 @@ import com.tuoheng.admin.vo.ListByDeptUserTypeVo; | |||
import com.tuoheng.common.core.enums.ServiceExceptionEnum; | |||
import com.tuoheng.common.core.exception.ServiceException; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
import com.tuoheng.common.core.utils.SecurityUserUtils; | |||
import com.tuoheng.common.core.utils.StringUtils; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.beans.BeanUtils; | |||
@@ -102,10 +103,10 @@ public class InspectionFileServiceImpl implements IInspectionFileService { | |||
@Override | |||
public JsonResult getQuestionList() { | |||
//获取当前登录人租户id | |||
//String username = SecurityUserUtils.username(); | |||
String username = "admin"; | |||
String username = SecurityUserUtils.username(); | |||
User user = userMapper.selectOne(new LambdaQueryWrapper<User>() | |||
.eq(User::getMark, 1) | |||
.eq(User::getStatus,1) | |||
.eq(User::getUsername, username)); | |||
if(ObjectUtil.isNull(user)){ | |||
return null; | |||
@@ -166,13 +167,14 @@ public class InspectionFileServiceImpl implements IInspectionFileService { | |||
// 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)){ | |||
JsonResult.error(ListByDeptUserTypeEnum.USER_NAME_IS_NULL.getCode(),ListByDeptUserTypeEnum.USER_NAME_IS_NULL.getMsg()); | |||
} | |||
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)){ | |||
JsonResult.error(ListByDeptUserTypeEnum.USER_IS_NULL.getCode(),ListByDeptUserTypeEnum.USER_IS_NULL.getMsg()); | |||
} |
@@ -40,13 +40,13 @@ public class QueryInspectionListService { | |||
// if(null == dto.getAirportId() && StringUtils.isEmpty(dto.getUserId())){ | |||
// 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)){ | |||
return JsonResult.error(QueryInspectionListServiceEnum.QUERY_IS_FAILED.getCode(),QueryInspectionListServiceEnum.QUERY_IS_FAILED.getMsg()); | |||
} | |||
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)){ | |||
return JsonResult.error(QueryInspectionListServiceEnum.USER_IS_NOT_EXIST.getCode(),QueryInspectionListServiceEnum.USER_IS_NOT_EXIST.getMsg()); |
@@ -14,6 +14,7 @@ import com.tuoheng.admin.vo.inspection.InspectionListVo; | |||
import com.tuoheng.common.core.enums.ServiceExceptionEnum; | |||
import com.tuoheng.common.core.exception.ServiceException; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
import com.tuoheng.common.core.utils.SecurityUserUtils; | |||
import com.tuoheng.common.core.utils.StringUtils; | |||
import lombok.extern.slf4j.Slf4j; | |||
import org.springframework.beans.BeanUtils; | |||
@@ -41,13 +42,14 @@ public class QueryNewInspectionListService { | |||
public JsonResult getList() { | |||
//获取登录用户信息 | |||
//String username = SecurityUserUtils.username(); | |||
String username = "admin"; | |||
String username = SecurityUserUtils.username(); | |||
if(StringUtils.isEmpty(username)){ | |||
JsonResult.error(ListByDeptUserTypeEnum.USER_NAME_IS_NULL.getCode(),ListByDeptUserTypeEnum.USER_NAME_IS_NULL.getMsg()); | |||
} | |||
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)){ | |||
JsonResult.error(ListByDeptUserTypeEnum.USER_IS_NULL.getCode(),ListByDeptUserTypeEnum.USER_IS_NULL.getMsg()); | |||
} |