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

package com.tuoheng.admin.service.accident.query; package com.tuoheng.admin.service.accident.query;


import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tuoheng.admin.conver.AccidentConverMapper; import com.tuoheng.admin.conver.AccidentConverMapper;
* @return * @return
*/ */
private Map<String, String> getDeptMap(List<Accident> accidentList) { 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<String> deptIdList = accidentList.stream().map(o -> o.getDeptId()).collect(Collectors.toList());
List<Dept> deptList = deptMapper.selectListByIdList(deptIdList); 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); Map<String, String> deptNameMap = deptList.stream().collect(HashMap::new, (m, v) -> m.put(v.getId(), v.getName()), HashMap::putAll);
} }


private Map<String, InspectionFile> getInspectionFileMap(List<Accident> accidentList) { 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<String> inspectionFileIdList = accidentList.stream().map(o -> o.getInspectionFileId()).collect(Collectors.toList());
List<InspectionFile> inspectionFileList = inspectionFileMapper.selectList(new LambdaQueryWrapper<InspectionFile>() List<InspectionFile> inspectionFileList = inspectionFileMapper.selectList(new LambdaQueryWrapper<InspectionFile>()
.in(InspectionFile::getId, inspectionFileIdList) .in(InspectionFile::getId, inspectionFileIdList)

Loading…
Cancel
Save