Browse Source

重构巡检报告代码

tags/v1.0.0^2
wanjing 1 year ago
parent
commit
48245a81e3
3 changed files with 15 additions and 5 deletions
  1. +3
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/query/QueryInspectionHandleReportService.java
  2. +0
    -1
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/section/SectionServiceImpl.java
  3. +12
    -4
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/section/query/QuerySectionListByRoadIdAndDeptIdService.java

+ 3
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/report/query/QueryInspectionHandleReportService.java View File

@@ -180,6 +180,9 @@ public class QueryInspectionHandleReportService {
* @return
*/
private Map<String, User> getUserMap(List<InspectionFileHandle> inspectionFileHandleList) {
if (CollectionUtil.isEmpty(inspectionFileHandleList)) {
return null;
}
List<String> userIdList = inspectionFileHandleList.stream().map(o -> o.getHandlerUser()).collect(Collectors.toList());
if (CollectionUtil.isEmpty(userIdList)) {
return null;

+ 0
- 1
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/section/SectionServiceImpl.java View File

@@ -17,7 +17,6 @@ import com.tuoheng.admin.mapper.RoadInformationMapper;
import com.tuoheng.admin.mapper.SectionDeptMapper;
import com.tuoheng.admin.mapper.SectionMapper;
import com.tuoheng.admin.query.SectionQuery;
import com.tuoheng.admin.service.section.ISectionService;
import com.tuoheng.admin.service.section.query.QuerySectionListByDeptIdService;
import com.tuoheng.admin.service.section.query.QuerySectionListByRoadIdAndDeptIdService;
import com.tuoheng.admin.service.section.query.QuerySectionListByRoadIdService;

+ 12
- 4
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/section/query/QuerySectionListByRoadIdAndDeptIdService.java View File

@@ -92,10 +92,18 @@ public class QuerySectionListByRoadIdAndDeptIdService {
return JsonResult.error(QuerySectionListByRoadIdCodeEnum.DEPT_ID_IS_NULL.getCode(), QuerySectionListByRoadIdCodeEnum.DEPT_ID_IS_NULL.getMsg());
}
// 判断部门是否存在
Dept dept = deptMapper.selectOne(new LambdaQueryWrapper<Dept>()
.eq(Dept::getTenantId, tenantId)
.eq(Dept::getId, deptId)
.eq(Dept::getMark, 1));
Dept dept;
if (SystemConstant.ROOT_DEPT_PID.equals(deptId)) {
dept = deptMapper.selectOne(new LambdaQueryWrapper<Dept>()
.eq(Dept::getTenantId, tenantId)
.eq(Dept::getPid, SystemConstant.ROOT_DEPT_PID)
.eq(Dept::getMark, 1));
} else {
dept = deptMapper.selectOne(new LambdaQueryWrapper<Dept>()
.eq(Dept::getTenantId, tenantId)
.eq(Dept::getId, deptId)
.eq(Dept::getMark, 1));
}
if (ObjectUtil.isNull(dept)) {
return JsonResult.error(QuerySectionListByRoadIdCodeEnum.DEPT_IS_NOT_EXIST.getCode(), QuerySectionListByRoadIdCodeEnum.DEPT_IS_NOT_EXIST.getMsg());
}

Loading…
Cancel
Save