|
|
@@ -11,6 +11,7 @@ import com.tuoheng.admin.mapper.InspectionFileMapper; |
|
|
|
import com.tuoheng.admin.mapper.InspectionMapper; |
|
|
|
import com.tuoheng.admin.mapper.UserMapper; |
|
|
|
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.factory.annotation.Autowired; |
|
|
@@ -36,11 +37,17 @@ public class QueryInspectionListService { |
|
|
|
private UserMapper userMapper; |
|
|
|
|
|
|
|
public JsonResult getListByAirportId(InspectionDto dto) { |
|
|
|
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()); |
|
|
|
// } |
|
|
|
//String username = SecurityUserUtils.username(); |
|
|
|
String username = "admin"; |
|
|
|
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::getId, dto.getUserId())); |
|
|
|
.eq(User::getMark, 1).eq(User::getUsername,username)); |
|
|
|
|
|
|
|
if(ObjectUtil.isNull(user)){ |
|
|
|
return JsonResult.error(QueryInspectionListServiceEnum.USER_IS_NOT_EXIST.getCode(),QueryInspectionListServiceEnum.USER_IS_NOT_EXIST.getMsg()); |
|
|
|
} |