|
|
@@ -1,6 +1,7 @@ |
|
|
|
package com.tuoheng.admin.service.inspectionfile.query; |
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollectionUtil; |
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
@@ -160,26 +161,30 @@ public class QueryInspectionFilePageListByWorkOrderIdService { |
|
|
|
inspectionFileHandleVo.setQuestionContent(questionType.getContent()); |
|
|
|
} |
|
|
|
|
|
|
|
inspectionFileHandle = inspectionFileHandleMap.get(inspectionFile.getId()); |
|
|
|
if (null != inspectionFileHandle) { |
|
|
|
if (!StringUtils.isEmpty(inspectionFileHandle.getHandlerImage())) { |
|
|
|
handlerImageList = new ArrayList<>(); |
|
|
|
String[] arr = inspectionFileHandle.getHandlerImage().split(","); |
|
|
|
List<String> list = Arrays.stream(arr).map(String::toString).collect(Collectors.toList()); |
|
|
|
for (String str : list) { |
|
|
|
handlerImageList.add(CommonConfig.imageURL + str); |
|
|
|
if (ObjectUtil.isNotNull(inspectionFileHandleMap)) { |
|
|
|
inspectionFileHandle = inspectionFileHandleMap.get(inspectionFile.getId()); |
|
|
|
if (null != inspectionFileHandle) { |
|
|
|
if (!StringUtils.isEmpty(inspectionFileHandle.getHandlerImage())) { |
|
|
|
handlerImageList = new ArrayList<>(); |
|
|
|
String[] arr = inspectionFileHandle.getHandlerImage().split(","); |
|
|
|
List<String> list = Arrays.stream(arr).map(String::toString).collect(Collectors.toList()); |
|
|
|
for (String str : list) { |
|
|
|
handlerImageList.add(CommonConfig.imageURL + str); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
user = inspectionFileHandleUserMap.get(inspectionFileHandle.getHandlerUser()); |
|
|
|
if (null != user) { |
|
|
|
inspectionFileHandleVo.setHandlerUsername(user.getRealname()); |
|
|
|
} |
|
|
|
if (ObjectUtil.isNotNull(inspectionFileHandleUserMap)) { |
|
|
|
user = inspectionFileHandleUserMap.get(inspectionFileHandle.getHandlerUser()); |
|
|
|
if (null != user) { |
|
|
|
inspectionFileHandleVo.setHandlerUsername(user.getRealname()); |
|
|
|
} |
|
|
|
|
|
|
|
inspectionFileHandleVo.setHandlerUser(inspectionFileHandle.getHandlerUser()); |
|
|
|
inspectionFileHandleVo.setHandlerImageList(handlerImageList); |
|
|
|
inspectionFileHandleVo.setHandlerTime(inspectionFileHandle.getHandlerTime()); |
|
|
|
inspectionFileHandleVo.setHandlerResult(inspectionFileHandle.getHandlerResult()); |
|
|
|
inspectionFileHandleVo.setHandlerUser(inspectionFileHandle.getHandlerUser()); |
|
|
|
inspectionFileHandleVo.setHandlerImageList(handlerImageList); |
|
|
|
inspectionFileHandleVo.setHandlerTime(inspectionFileHandle.getHandlerTime()); |
|
|
|
inspectionFileHandleVo.setHandlerResult(inspectionFileHandle.getHandlerResult()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
inspectionFileHandleVoList.add(inspectionFileHandleVo); |
|
|
|
} |
|
|
@@ -217,11 +222,17 @@ public class QueryInspectionFilePageListByWorkOrderIdService { |
|
|
|
} |
|
|
|
|
|
|
|
private Map<String, InspectionFileHandle> getInspectionFileHandleMap(List<InspectionFileHandle> inspectionFileHandleList) { |
|
|
|
if (CollectionUtil.isEmpty(inspectionFileHandleList)) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
Map<String, InspectionFileHandle> inspectionFileHandleMap = inspectionFileHandleList.stream().collect(Collectors.toMap(InspectionFileHandle::getId, Function.identity())); |
|
|
|
return inspectionFileHandleMap; |
|
|
|
} |
|
|
|
|
|
|
|
private Map<String, User> getInspectionFileHandleUserMap(List<InspectionFileHandle> inspectionFileHandleList) { |
|
|
|
if (CollectionUtil.isEmpty(inspectionFileHandleList)) { |
|
|
|
return null; |
|
|
|
} |
|
|
|
List<String> userIdList = inspectionFileHandleList.stream().map(o -> o.getHandlerUser()).collect(Collectors.toList()); |
|
|
|
List<User> userList = userMapper.selectList(new LambdaQueryWrapper<User>() |
|
|
|
.in(User::getId, userIdList) |