@@ -60,4 +60,9 @@ public class QueryInspectionPageListRequest extends BaseQuery { | |||
*/ | |||
private List<String> deptIdList; | |||
/** | |||
* 租户Id | |||
*/ | |||
private String tenantId; | |||
} |
@@ -34,4 +34,8 @@ public class QueryInspectionFileDistributionListRequest { | |||
*/ | |||
private List<String> deptIdList; | |||
/** | |||
* 租户Id | |||
*/ | |||
private String tenantId; | |||
} |
@@ -57,4 +57,9 @@ public class QueryInspectionFilePageListRequest extends BaseQuery { | |||
*/ | |||
private List<String> deptIdList; | |||
/** | |||
* 租户ID | |||
*/ | |||
private String tenantId; | |||
} |
@@ -19,5 +19,4 @@ public class QueryInspectionFileWorkOrderPageListRequest extends BaseQuery { | |||
* 工单ID | |||
*/ | |||
private String workOrderId; | |||
} |
@@ -33,4 +33,10 @@ public class QueryReportPageListRequest extends BaseQuery { | |||
*/ | |||
private String createUser; | |||
/** | |||
* 租户Id | |||
*/ | |||
private String tenantId; | |||
} |
@@ -57,4 +57,9 @@ public class QueryWorkOrderPageListRequest extends BaseQuery { | |||
*/ | |||
private List<String> deptIdList; | |||
/** | |||
* 租户Id | |||
*/ | |||
private String tenantId; | |||
} |
@@ -6,6 +6,7 @@ import com.tuoheng.admin.conver.DeptConverMapper; | |||
import com.tuoheng.admin.entity.Dept; | |||
import com.tuoheng.admin.enums.code.dept.QueryDeptTreeListCodeEnum; | |||
import com.tuoheng.admin.mapper.DeptMapper; | |||
import com.tuoheng.admin.utils.CurrentUserUtil; | |||
import com.tuoheng.admin.vo.dept.DeptTreeVo; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
import lombok.extern.slf4j.Slf4j; | |||
@@ -39,8 +40,11 @@ public class QueryListTreeService { | |||
public JsonResult getListTree() { | |||
List<DeptTreeVo> deptTreeVoList = new ArrayList<>(); | |||
String tenantId = CurrentUserUtil.getTenantId(); | |||
// 查询所有有效的部门数据 | |||
List<Dept> deptList = deptMapper.selectList(new LambdaQueryWrapper<Dept>() | |||
.eq(Dept::getTenantId, tenantId) | |||
.eq(Dept::getMark, 1)); | |||
if (CollectionUtil.isEmpty(deptList)) { |
@@ -97,6 +97,7 @@ public class QueryInspectionPageListService { | |||
String userId = CurrentUserUtil.getUserId(); | |||
String tenantId = CurrentUserUtil.getTenantId(); | |||
request.setTenantId(tenantId); | |||
JsonResult result = this.check(tenantId, request); | |||
if (0 != result.getCode()) { |
@@ -52,6 +52,8 @@ public class QueryInspectionFileDistributionListService { | |||
log.info("进入查询任务问题分布列表业务, request:{}", request.toString()); | |||
String userId = CurrentUserUtil.getUserId(); | |||
String tenantId = CurrentUserUtil.getTenantId(); | |||
request.setTenantId(tenantId); | |||
JsonResult result = this.check(request); | |||
if (0 != result.getCode()) { |
@@ -65,11 +65,14 @@ public class QueryInspectionFilePageListByWorkOrderIdService { | |||
return result; | |||
} | |||
String tenantId = CurrentUserUtil.getTenantId(); | |||
// 设置分页参数 | |||
IPage<WorkOrderFile> page = new Page<>(request.getPage(), request.getLimit()); | |||
// 查询结果 | |||
IPage<WorkOrderFile> pageData = workOrderFileMapper.selectPage(page, new LambdaQueryWrapper<WorkOrderFile>() | |||
.eq(WorkOrderFile::getWorkOrderId, request.getWorkOrderId())); | |||
.eq(WorkOrderFile::getTenantId, tenantId) | |||
.eq(WorkOrderFile::getWorkOrderId, request.getWorkOrderId())); | |||
if (null == pageData || pageData.getTotal() == 0) { | |||
log.info("根据工单ID查询工单问题列表业务:获取任务分页列表为空"); | |||
@@ -82,6 +85,7 @@ public class QueryInspectionFilePageListByWorkOrderIdService { | |||
List<InspectionFile> inspectionFileList = inspectionFileMapper.selectList(new LambdaQueryWrapper<InspectionFile>() | |||
.in(InspectionFile::getId, inspectionFileIdList) | |||
.eq(InspectionFile::getTenantId, tenantId) | |||
.eq(InspectionFile::getMark, 1)); | |||
// 构造返回结果对象 |
@@ -57,6 +57,8 @@ public class QueryInspectionFilePageListService { | |||
log.info("进入查询任务问题分页列表业务, request:{}", request.toString()); | |||
String userId = CurrentUserUtil.getUserId(); | |||
String tenantId = CurrentUserUtil.getTenantId(); | |||
request.setTenantId(tenantId); | |||
JsonResult result = this.check(request); | |||
if (0 != result.getCode()) { | |||
@@ -65,7 +67,7 @@ public class QueryInspectionFilePageListService { | |||
} | |||
// 获取部门Id的查询范围 | |||
List<String> deptIdList = this.getDeptIdList(userId, request.getDeptId()); | |||
List<String> deptIdList = this.getDeptIdList(userId, tenantId, request.getDeptId()); | |||
request.setDeptIdList(deptIdList); | |||
// 设置分页参数 | |||
@@ -112,7 +114,7 @@ public class QueryInspectionFilePageListService { | |||
* @param deptId | |||
* @return | |||
*/ | |||
private List<String> getDeptIdList(String userId, String deptId) { | |||
private List<String> getDeptIdList(String userId, String tenantId, String deptId) { | |||
List<String> deptIdList = new ArrayList<>(); | |||
if (!StringUtils.isEmpty(deptId)) { | |||
deptIdList.add(deptId); | |||
@@ -120,6 +122,7 @@ public class QueryInspectionFilePageListService { | |||
} | |||
User user = userMapper.selectOne(new LambdaQueryWrapper<User>() | |||
.eq(User::getId, userId) | |||
.eq(User::getTenantId, tenantId) | |||
.eq(User::getMark, 1)); | |||
if (RoleEnum.SUPER_ADMIN.getCode() == user.getRoleId()) { | |||
return null; |
@@ -53,6 +53,7 @@ public class QueryReportPageListService { | |||
String userId = CurrentUserUtil.getUserId(); | |||
String tenantId = CurrentUserUtil.getTenantId(); | |||
request.setTenantId(tenantId); | |||
JsonResult result = this.check(tenantId, request); | |||
if (0 != result.getCode()) { |
@@ -76,7 +76,6 @@ public class UserServiceImpl implements IUserService { | |||
/** | |||
* 获取用户详情 | |||
* | |||
* @param username | |||
* @return | |||
*/ | |||
@Override |
@@ -9,6 +9,7 @@ import com.tuoheng.admin.enums.code.dept.QueryDeptChildListCodeEnum; | |||
import com.tuoheng.admin.enums.code.user.QueryUserListByDeptIdCodeEnum; | |||
import com.tuoheng.admin.mapper.DeptMapper; | |||
import com.tuoheng.admin.mapper.UserMapper; | |||
import com.tuoheng.admin.utils.CurrentUserUtil; | |||
import com.tuoheng.common.core.utils.JsonResult; | |||
import com.tuoheng.common.core.utils.StringUtils; | |||
import lombok.extern.slf4j.Slf4j; | |||
@@ -46,8 +47,9 @@ public class QueryUserListByDeptIdService { | |||
log.info("根据根据部门id查询用户列表业业务:校验失败:{}", result.getMsg()); | |||
return result; | |||
} | |||
String tenantId = CurrentUserUtil.getTenantId(); | |||
List<User> userList = userMapper.selectList(new LambdaQueryWrapper<User>() | |||
.eq(User::getTenantId, tenantId) | |||
.eq(User::getDeptId, deptId) | |||
.ne(User::getRoleId, RoleEnum.SUPER_ADMIN.getCode()) | |||
.eq(User::getMark, 1)); |
@@ -56,6 +56,8 @@ public class QueryWorkOrderPageListService { | |||
log.info("进入查询工单分页列表业务, request:{}", request.toString()); | |||
String userId = CurrentUserUtil.getUserId(); | |||
String tenantId = CurrentUserUtil.getTenantId(); | |||
request.setTenantId(tenantId); | |||
JsonResult result = this.check(request); | |||
if (0 != result.getCode()) { |
@@ -196,6 +196,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
<where> | |||
<if test="1 == 1"> and tif.mark = 1 </if> | |||
<if test="request.key != null and request.key != ''"> and (ti.code like concat('%', #{request.key}, '%') or ti.name like concat('%', #{request.key}, '%')) </if> | |||
<if test="request.tenantId != null and request.tenantId != ''"> and tenant_id = #{request.tenantId} </if> | |||
<if test="request.questionCode != null and request.questionCode != ''"> and tif.question_Code = #{request.questionCode} </if> | |||
<choose> | |||
<when test="request.status != null and request.status != 0"> | |||
@@ -228,6 +229,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
<where> | |||
<if test="1 == 1"> and tif.mark = 1 </if> | |||
<if test="request.inspectionName != null and request.inspectionName != ''"> and ti.name like concat('%', #{request.inspectionName}, '%') </if> | |||
<if test="request.tenantId != null and request.tenantId != ''"> and tenant_id = #{request.tenantId} </if> | |||
<if test="request.questionCode != null and request.questionCode != ''"> and tif.question_code = #{request.questionCode} </if> | |||
<if test="request.status != null"> | |||
<choose> |
@@ -93,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
<where> | |||
<if test="1 == 1"> and mark = 1 </if> | |||
<if test="request.code != null and request.code != ''"> and code like concat('%', #{request.code}, '%') </if> | |||
<if test="request.tenantId != null and request.tenantId != ''"> and tenant_id = #{request.tenantId} </if> | |||
<if test="request.airportId != null and request.airportId != 0"> and airport_id = #{request.airportId} </if> | |||
<if test="request.inspectionLine != null and request.inspectionLine != 0"> and inspection_line = #{request.inspectionLine} </if> | |||
<if test="request.type != null and request.type != 0"> and type = #{request.type} </if> |
@@ -73,6 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
<include refid="selectReportVo"/> | |||
<where> | |||
<if test="1 == 1"> and mark = 1 </if> | |||
<if test="request.tenantId != null and request.tenantId != ''"> and tenant_id = #{request.tenantId} </if> | |||
<if test="request.inspectionCode!= null and request.inspectionCode != ''"> and inspection_code like concat('%', #{request.inspectionCode}, '%') </if> | |||
<if test="request.airportId != null and request.airportId != 0"> and airport_id = #{request.airportId} </if> | |||
<if test="request.type != null and request.type != 0"> and type = #{request.type} </if> |
@@ -45,7 +45,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" | |||
<select id="selectPageList" parameterType="com.tuoheng.admin.request.workorder.QueryWorkOrderPageListRequest" resultMap="WorkOrderResult"> | |||
<include refid="selectThWorkOrderVo"/> | |||
<where> | |||
<if test="1 == 1"> and mark = 1 </if> | |||
<if test="request.tenantId != null and request.tenantId != ''"> and tenant_id = #{request.tenantId} </if> | |||
<if test="request.code != null and request.code != 0"> and code = #{request.code} </if> | |||
<if test="request.status != null and request.status != ''"> and status = #{request.status} </if> | |||
<if test="(request.userDeptId != null and request.userDeptId != '') or (request.deptIdList != null and request.deptIdList.size() > 0)"> |