|
|
@@ -1,11 +1,18 @@ |
|
|
|
package com.tuoheng.admin.service.inspection.query; |
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.tuoheng.admin.entity.User; |
|
|
|
import com.tuoheng.admin.enums.UserTypeEnum; |
|
|
|
import com.tuoheng.admin.enums.code.inspectionFile.ListByDeptUserTypeEnum; |
|
|
|
import com.tuoheng.admin.mapper.InspectionFileMapper; |
|
|
|
import com.tuoheng.admin.mapper.InspectionMapper; |
|
|
|
import com.tuoheng.admin.mapper.UserMapper; |
|
|
|
import com.tuoheng.admin.query.InspectionFileQuery; |
|
|
|
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.StringUtils; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
@@ -30,6 +37,30 @@ public class QueryNewInspectionListService { |
|
|
|
if(null == query.getUserId()){ |
|
|
|
JsonResult.error(ListByDeptUserTypeEnum.QUERY_IS_FAILED.getCode(),ListByDeptUserTypeEnum.QUERY_IS_FAILED.getMsg()); |
|
|
|
} |
|
|
|
//获取登录用户信息 |
|
|
|
//String username = SecurityUserUtils.username(); |
|
|
|
// String username = "admin"; |
|
|
|
// 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::getId, query.getUserId()).eq(User::getMark, 1)); |
|
|
|
if(ObjectUtil.isNull(user)){ |
|
|
|
JsonResult.error(ListByDeptUserTypeEnum.USER_IS_NULL.getCode(),ListByDeptUserTypeEnum.USER_IS_NULL.getMsg()); |
|
|
|
} |
|
|
|
String tenantId = user.getTenantId(); |
|
|
|
//判断用户角色 1超级管理员 2部门管理员 3普通用户 |
|
|
|
if(null == user.getType()){ |
|
|
|
throw new ServiceException(ServiceExceptionEnum.PARAMETER_IS_NULL); |
|
|
|
} |
|
|
|
//若角色为超级管理员,查询任务表最新五条数据 |
|
|
|
if(UserTypeEnum.SUPER_ADMIN.getCode()==user.getType()){ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|