Browse Source

修改获取事故卡片列表代码

tags/v1.2.0^2
wanjing 1 year ago
parent
commit
b1a84855e3
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/accident/query/QueryAccidentCardListService.java

+ 7
- 0
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/accident/query/QueryAccidentCardListService.java View File

@@ -1,5 +1,6 @@
package com.tuoheng.admin.service.accident.query;

import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.conver.AccidentConverMapper;
@@ -124,6 +125,9 @@ public class QueryAccidentCardListService {
* @return
*/
private Map<String, String> getDeptMap(List<Accident> accidentList) {
if (CollectionUtil.isEmpty(accidentList)) {
return null;
}
List<String> deptIdList = accidentList.stream().map(o -> o.getDeptId()).collect(Collectors.toList());
List<Dept> deptList = deptMapper.selectListByIdList(deptIdList);
Map<String, String> deptNameMap = deptList.stream().collect(HashMap::new, (m, v) -> m.put(v.getId(), v.getName()), HashMap::putAll);
@@ -143,6 +147,9 @@ public class QueryAccidentCardListService {
}

private Map<String, InspectionFile> getInspectionFileMap(List<Accident> accidentList) {
if (CollectionUtil.isEmpty(accidentList)) {
return null;
}
List<String> inspectionFileIdList = accidentList.stream().map(o -> o.getInspectionFileId()).collect(Collectors.toList());
List<InspectionFile> inspectionFileList = inspectionFileMapper.selectList(new LambdaQueryWrapper<InspectionFile>()
.in(InspectionFile::getId, inspectionFileIdList)

Loading…
Cancel
Save