ソースを参照

Merge branch 'develop' of gitadmin/tuoheng_telecomumale into release

tags/V1.3.2
wanjing 11ヶ月前
コミット
4fb5749130
5個のファイルの変更28行の追加81行の削除
  1. +3
    -9
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryInspectionPageListService.java
  2. +1
    -26
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/handle/EditHandle.java
  3. +1
    -17
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/handle/ExecuteHandle.java
  4. +17
    -28
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/query/QueryReportPageListService.java
  5. +6
    -1
      tuoheng-service/tuoheng-admin/src/main/resources/mapper/ReportMapper.xml

+ 3
- 9
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/QueryInspectionPageListService.java ファイルの表示

@@ -99,9 +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);

JsonResult result = this.check(tenantId, request);
@@ -109,12 +109,6 @@ public class QueryInspectionPageListService {
log.info("进入查询巡检任务分页列表业务:校验失败:{}", result.getMsg());
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())

+ 1
- 26
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/handle/EditHandle.java ファイルの表示

@@ -62,32 +62,7 @@ public class EditHandle implements GenerateInspectionFieldHander {
}
return;
}
if (user.getId().equals(inspectionVo.getCreateUser())) {
// 自己创建的任务
inspectionVo.setEdit(true);
} else {
// 非本人创建,判断该用户是不是该部门管理员
// 本部门主管编辑本部门任务
// 查询部门管理员,若是部门管理员可修改,非部门管理员不能修改
User userTmp = userMapper.selectOne(new LambdaQueryWrapper<User>()
.eq(User::getDeptId, user.getDeptId())
.eq(User::getDataPermission, DataPermissionEnum.DEPT_AND_SUB_DEPT.getCode())
.eq(User::getMark, MarkEnum.VALID.getCode()));
if (ObjectUtil.isNull(userTmp)) {
if (null != handler) {
handler.handler(user, dept, inspectionVo);
return;
}
}
if (!user.getId().equals(userTmp.getId())) {
if (null != handler) {
handler.handler(user, dept, inspectionVo);
return;
}
}
inspectionVo.setEdit(true);
}

inspectionVo.setEdit(true);
if (null != handler) {
handler.handler(user, dept, inspectionVo);
return;

+ 1
- 17
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspection/query/handle/ExecuteHandle.java ファイルの表示

@@ -44,23 +44,7 @@ public class ExecuteHandle implements GenerateInspectionFieldHander {
}
return;
}

if (DataPermissionEnum.ALL.getCode() == user.getDataPermission()) {
// 超级管理员不能执行任务操作
inspectionVo.setExecute(false);
} else if (DataPermissionEnum.DEPT_AND_SUB_DEPT.getCode() == user.getDataPermission()) {
// 管理员可对本部门的任务执行此操作
if (user.getDeptId().equals(inspectionVo.getDeptId())) {
if (1 == inspectionVo.getExecutionStatus()) {
inspectionVo.setExecute(true);
}
}
} else if (DataPermissionEnum.DEPT.getCode() == user.getDataPermission()) {
// 普通用户可对自己创建的任务执行此操作
if (user.getId().equals(inspectionVo.getCreateUser())) {
inspectionVo.setExecute(true);
}
}
inspectionVo.setExecute(true);
if (null != handler) {
handler.handler(user, dept, inspectionVo);
}

+ 17
- 28
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/query/QueryReportPageListService.java ファイルの表示

@@ -62,7 +62,6 @@ public class QueryReportPageListService {
// log.info("进入查询报告分页列表业务");
User user = CurrentUserUtil.getUserInfo();
String tenantId = user.getTenantId();
request.setTenantId(tenantId);

JsonResult result = this.check(tenantId, request);
if (0 != result.getCode()) {
@@ -70,42 +69,32 @@ public class QueryReportPageListService {
return result;
}

// 设置分页参数
IPage<Report> page = new Page<>(request.getPage(), request.getLimit());
// 用户只能查看自己生成的报告 或者是当前租户下自动生成的报告
//request.setCreateUser(userId);

// 查询结果
IPage<Report> pageData = reportMapper.selectPageList(page, request);
if (null == pageData || pageData.getTotal() == 0) {
log.info("获取任务分页列表为空");
return JsonResult.success(pageData);
}
List<Report> reportList = pageData.getRecords();

List<Report> reportsData = new ArrayList<>();

List<String> deptIdList = new ArrayList<>();
if (DataPermissionEnum.ALL.getCode() == user.getDataPermission()) {
reportsData = this.getAllList(reportList);
// 查询该租户下所有部门的工单
} else if (DataPermissionEnum.DEPT_AND_SUB_DEPT.getCode() == user.getDataPermission()) {
reportsData = this.getListByDepts(reportList, user);
deptIdList = deptMapper.selectAllChildListById(user.getDeptId());
} else if (DataPermissionEnum.DEPT.getCode() == user.getDataPermission()) {
reportsData = this.getListByDept(reportList, user);
}
if(CollectionUtil.isEmpty(reportsData) || reportsData.size() == 0){
return JsonResult.success("当前用户对应数据权限下查询报告数据为空");
deptIdList.add(user.getDeptId());
}

IPage<Report> reportIPage = pageData.setRecords(reportsData);
request.setTenantId(tenantId);
request.setDeptIdList(deptIdList);

// 设置分页参数
IPage<Report> page = new Page<>(request.getPage(), request.getLimit());
// 查询结果
IPage<Report> pageData = reportMapper.selectPageList(page, request);

// 构造返回结果对象
List<ReportPageListVo> reportPageListVoList = this.buildReportPageListVoList(reportsData);
List<ReportPageListVo> reportPageListVoList = this.buildReportPageListVoList(pageData.getRecords());

// 重写返回结果对象
IPage<ReportPageListVo> reportVoPageData = new Page<>();
reportVoPageData.setPages(reportIPage.getPages());
reportVoPageData.setCurrent(reportIPage.getCurrent());
reportVoPageData.setSize(reportIPage.getSize());
reportVoPageData.setTotal(reportIPage.getTotal());
reportVoPageData.setPages(pageData.getPages());
reportVoPageData.setCurrent(pageData.getCurrent());
reportVoPageData.setSize(pageData.getSize());
reportVoPageData.setTotal(pageData.getTotal());
reportVoPageData.setRecords(reportPageListVoList);

return JsonResult.success(reportVoPageData);

+ 6
- 1
tuoheng-service/tuoheng-admin/src/main/resources/mapper/ReportMapper.xml ファイルの表示

@@ -76,7 +76,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<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>
<if test="request.createUser != null and request.createUser != ''"> and create_user = #{request.createUser} </if>
<if test="request.deptIdList != null and request.deptIdList.size() > 0">
and dept_id in
<foreach item="deptId" collection="request.deptIdList" open="(" separator="," close=")">
#{deptId}
</foreach>
</if>
</where>
order by create_time desc
</select>

読み込み中…
キャンセル
保存