Browse Source

修改根据工单ID获取问题列表返回结果中问题图片的类型,list改为string

tags/v1.0.0^2
wanjing 1 year ago
parent
commit
58cae81a9c
3 changed files with 24 additions and 21 deletions
  1. +7
    -4
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/handle/QueryInspectionFileHandleByInspectionFileIdService.java
  2. +15
    -15
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/query/QueryInspectionFilePageListByWorkOrderIdService.java
  3. +2
    -2
      tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/inspection/InspectionFileHandleVo.java

+ 7
- 4
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/handle/QueryInspectionFileHandleByInspectionFileIdService.java View File

*/ */
private InspectionFileHandleVo buildInspectionFileHandleVo(InspectionFile inspectionFile, InspectionFileHandle inspectionFileHandle) { private InspectionFileHandleVo buildInspectionFileHandleVo(InspectionFile inspectionFile, InspectionFileHandle inspectionFileHandle) {
InspectionFileHandleVo inspectionFileHandleVo; InspectionFileHandleVo inspectionFileHandleVo;
List<String> handlerImageList = null;
String handlerImages = "";
if (null != inspectionFileHandle) { if (null != inspectionFileHandle) {
inspectionFileHandleVo = InspectionFileHandleConverMapper.INSTANCE.fromInspectionFileHandleToInspectionFileHandleVo(inspectionFileHandle); inspectionFileHandleVo = InspectionFileHandleConverMapper.INSTANCE.fromInspectionFileHandleToInspectionFileHandleVo(inspectionFileHandle);


if (!StringUtils.isEmpty(inspectionFileHandle.getHandlerImage())) { if (!StringUtils.isEmpty(inspectionFileHandle.getHandlerImage())) {
handlerImageList = new ArrayList<>();
String[] arr = inspectionFileHandle.getHandlerImage().split(","); String[] arr = inspectionFileHandle.getHandlerImage().split(",");
List<String> list = Arrays.stream(arr).map(String::toString).collect(Collectors.toList()); List<String> list = Arrays.stream(arr).map(String::toString).collect(Collectors.toList());
for (String str : list) { for (String str : list) {
handlerImageList.add(CommonConfig.imageURL + str);
handlerImages += CommonConfig.imageURL + str + ",";
} }
} }
} else { } else {
inspectionFileHandleVo = new InspectionFileHandleVo(); inspectionFileHandleVo = new InspectionFileHandleVo();
} }
if (StringUtils.isNotEmpty(handlerImages)) {
handlerImages = handlerImages.substring(0, handlerImages.length() - 1);
inspectionFileHandleVo.setHandlerImages(handlerImages);
}

QuestionType questionType = questionTypeMapper.selectOne(new LambdaQueryWrapper<QuestionType>() QuestionType questionType = questionTypeMapper.selectOne(new LambdaQueryWrapper<QuestionType>()
.eq(QuestionType::getId, inspectionFile.getQuestionId()) .eq(QuestionType::getId, inspectionFile.getQuestionId())
.eq(QuestionType::getMark, 1)); .eq(QuestionType::getMark, 1));
} }
inspectionFileHandleVo.setQuestionId(inspectionFile.getQuestionId()); inspectionFileHandleVo.setQuestionId(inspectionFile.getQuestionId());
inspectionFileHandleVo.setFileThumbnail(CommonConfig.imageURL + inspectionFile.getFileThumbnail()); inspectionFileHandleVo.setFileThumbnail(CommonConfig.imageURL + inspectionFile.getFileThumbnail());
inspectionFileHandleVo.setHandlerImageList(handlerImageList);
return inspectionFileHandleVo; return inspectionFileHandleVo;
} }
} }

+ 15
- 15
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/service/inspectionfile/query/QueryInspectionFilePageListByWorkOrderIdService.java View File

InspectionFileHandleVo inspectionFileHandleVo; InspectionFileHandleVo inspectionFileHandleVo;
User user; User user;
QuestionType questionType; QuestionType questionType;
List<String> handlerImageList = null;
String handlerImages = "";
InspectionFileHandle inspectionFileHandle; InspectionFileHandle inspectionFileHandle;
for (InspectionFile inspectionFile : inspectionFileList) { for (InspectionFile inspectionFile : inspectionFileList) {
inspectionFileHandleVo = new InspectionFileHandleVo(); inspectionFileHandleVo = new InspectionFileHandleVo();
if (ObjectUtil.isNotNull(inspectionFileHandleMap)) { if (ObjectUtil.isNotNull(inspectionFileHandleMap)) {
inspectionFileHandle = inspectionFileHandleMap.get(inspectionFile.getId()); inspectionFileHandle = inspectionFileHandleMap.get(inspectionFile.getId());
if (null != inspectionFileHandle) { 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(inspectionFileHandleUserMap)) { if (ObjectUtil.isNotNull(inspectionFileHandleUserMap)) {
user = inspectionFileHandleUserMap.get(inspectionFileHandle.getHandlerUser()); user = inspectionFileHandleUserMap.get(inspectionFileHandle.getHandlerUser());
if (null != user) { if (null != user) {
inspectionFileHandleVo.setHandlerUsername(user.getRealname()); inspectionFileHandleVo.setHandlerUsername(user.getRealname());
} }

inspectionFileHandleVo.setHandlerUser(inspectionFileHandle.getHandlerUser());
inspectionFileHandleVo.setHandlerImageList(handlerImageList);
inspectionFileHandleVo.setHandlerTime(inspectionFileHandle.getHandlerTime());
inspectionFileHandleVo.setHandlerResult(inspectionFileHandle.getHandlerResult());
} }
if (StringUtils.isNotEmpty(inspectionFileHandle.getHandlerImage())) {
String[] arr = inspectionFileHandle.getHandlerImage().split(",");
List<String> list = Arrays.stream(arr).map(String::toString).collect(Collectors.toList());
for (String str : list) {
handlerImages += CommonConfig.imageURL + str + ",";
}
}
if (StringUtils.isNotEmpty(handlerImages)) {
handlerImages = handlerImages.substring(0, handlerImages.length() - 1);
inspectionFileHandleVo.setHandlerImages(handlerImages);
}
inspectionFileHandleVo.setHandlerUser(inspectionFileHandle.getHandlerUser());
inspectionFileHandleVo.setHandlerTime(inspectionFileHandle.getHandlerTime());
inspectionFileHandleVo.setHandlerResult(inspectionFileHandle.getHandlerResult());
} }
} }
inspectionFileHandleVoList.add(inspectionFileHandleVo); inspectionFileHandleVoList.add(inspectionFileHandleVo);

+ 2
- 2
tuoheng-service/tuoheng-admin/src/main/java/com/tuoheng/admin/vo/inspection/InspectionFileHandleVo.java View File

private String handlerUsername; private String handlerUsername;


/** /**
* 处理后图片列表
* 处理后图片列表,多个用","隔开
*/ */
private List<String> handlerImageList;
private String handlerImages;


/** /**
* 处理结果 * 处理结果

Loading…
Cancel
Save