@@ -43,6 +43,11 @@ public class AccidentQuery extends BaseQuery { | |||
*/ | |||
private Date accidentEndTime; | |||
/** | |||
* 部门ID | |||
*/ | |||
private String deptId; | |||
/** | |||
* 部门集合 | |||
*/ |
@@ -1,10 +1,7 @@ | |||
package com.tuoheng.admin.request.accident; | |||
import com.fasterxml.jackson.annotation.JsonFormat; | |||
import lombok.Data; | |||
import org.springframework.format.annotation.DateTimeFormat; | |||
import java.util.Date; | |||
import java.util.List; | |||
/** |
@@ -153,7 +153,7 @@ public class QueryAccidentCardPageListService { | |||
//当前租户下 | |||
User user = CurrentUserUtil.getUserInfo(); | |||
String tenantId = user.getTenantId(); | |||
List<String> deptIdList = this.getDeptIdList(user); | |||
List<String> deptIdList = this.getDeptIdList(user, query.getDeptId()); | |||
query.setDeptIdList(deptIdList); | |||
query.setTenantId(tenantId); | |||
IPage<Accident> page = new Page<>(query.getPage(), query.getLimit()); | |||
@@ -207,8 +207,12 @@ public class QueryAccidentCardPageListService { | |||
* @param user | |||
* @return | |||
*/ | |||
private List<String> getDeptIdList(User user) { | |||
private List<String> getDeptIdList(User user, String deptId) { | |||
List<String> deptIdList = new ArrayList<>(); | |||
if (StringUtils.isNotEmpty(deptId)) { | |||
deptIdList.add(deptId); | |||
return deptIdList; | |||
} | |||
if (DataPermissionEnum.ALL.getCode() == user.getDataPermission()) { | |||
return null; | |||
} else if (DataPermissionEnum.DEPT_AND_SUB_DEPT.getCode() == user.getDataPermission()) { |
@@ -60,7 +60,7 @@ public class QueryAccidentPageListService { | |||
User user = CurrentUserUtil.getUserInfo(); | |||
String tenantId = user.getTenantId(); | |||
List<String> deptIdList = this.getDeptIdList(user); | |||
List<String> deptIdList = this.getDeptIdList(user, query.getDeptId()); | |||
query.setDeptIdList(deptIdList); | |||
query.setTenantId(tenantId); | |||
@@ -116,8 +116,12 @@ public class QueryAccidentPageListService { | |||
* @param user | |||
* @return | |||
*/ | |||
private List<String> getDeptIdList(User user) { | |||
private List<String> getDeptIdList(User user, String deptId) { | |||
List<String> deptIdList = new ArrayList<>(); | |||
if (StringUtils.isNotEmpty(deptId)) { | |||
deptIdList.add(deptId); | |||
return deptIdList; | |||
} | |||
if (DataPermissionEnum.ALL.getCode() == user.getDataPermission()) { | |||
return null; | |||
} else if (DataPermissionEnum.DEPT_AND_SUB_DEPT.getCode() == user.getDataPermission()) { |
@@ -99,8 +99,9 @@ public class QueryInspectionPageListService { | |||
public JsonResult getPageList(QueryInspectionPageListRequest request) { | |||
// log.info("进入查询巡检任务分页列表业务"); | |||
String userId = CurrentUserUtil.getUserId(); | |||
String tenantId = CurrentUserUtil.getTenantId(); | |||
User user = CurrentUserUtil.getUserInfo(); | |||
String userId = user.getId(); | |||
String tenantId = user.getTenantId(); | |||
request.setTenantId(tenantId); | |||
// 不查应急任务 | |||
@@ -112,11 +113,6 @@ public class QueryInspectionPageListService { | |||
return result; | |||
} | |||
User user = userMapper.selectOne(new LambdaQueryWrapper<User>() | |||
.eq(User::getTenantId, tenantId) | |||
.eq(User::getId, userId) | |||
.eq(User::getMark, 1)); | |||
Dept dept = deptMapper.selectOne(new LambdaQueryWrapper<Dept>() | |||
.eq(Dept::getTenantId, tenantId) | |||
.eq(Dept::getId, user.getDeptId()) |