|
@@ -97,19 +97,37 @@ public class SecondGoodsReportingServiceImpl implements SecondGoodsReportingServ
|
|
|
secondReportingVo.setReportingTime(lifeNotice.getCreatedTime());
|
|
secondReportingVo.setReportingTime(lifeNotice.getCreatedTime());
|
|
|
secondReportingVo.setFeedbackTime(lifeNotice.getCreatedTime());
|
|
secondReportingVo.setFeedbackTime(lifeNotice.getCreatedTime());
|
|
|
List<Map<String, Object>> list = new ArrayList<>();
|
|
List<Map<String, Object>> list = new ArrayList<>();
|
|
|
- for (String row : lifeUserViolation.getReportEvidenceImg().split(",")) {
|
|
|
|
|
|
|
+ List<String> urlList = Arrays.asList(lifeUserViolation.getReportEvidenceImg().split(","));
|
|
|
|
|
+ // 存放已存在文件list
|
|
|
|
|
+ List<String> videoList = new ArrayList<>();
|
|
|
|
|
+
|
|
|
|
|
+ for (int i = 0; i < urlList.size(); i++) {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
- String fileType = row.substring(row.lastIndexOf(".") + 1);
|
|
|
|
|
- if (videoFileType.contains(fileType.toLowerCase())) {
|
|
|
|
|
- map.put("type", "video");
|
|
|
|
|
- map.put("imgUrl", row);
|
|
|
|
|
- map.put("videoUrl", row);
|
|
|
|
|
- } else {
|
|
|
|
|
- map.put("type", "image");
|
|
|
|
|
- map.put("imgUrl", row);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // 查找最后一个点的位置
|
|
|
|
|
+ int lastDotIndex = urlList.get(i).lastIndexOf('.');
|
|
|
|
|
+
|
|
|
|
|
+ String fileType = urlList.get(i).substring(urlList.get(i).lastIndexOf(".") + 1);;
|
|
|
|
|
+ String contains = null;
|
|
|
|
|
+ if (lastDotIndex != -1) { // 确保存在
|
|
|
|
|
+ contains = urlList.get(i).substring(0, lastDotIndex);
|
|
|
}
|
|
}
|
|
|
- list.add(map);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (!videoList.contains(contains)){
|
|
|
|
|
+ videoList.add(contains);
|
|
|
|
|
+ if (videoFileType.contains(fileType.toLowerCase())) {
|
|
|
|
|
+ map.put("type", "video");
|
|
|
|
|
+ map.put("imgUrl", urlList.get(i + 1));
|
|
|
|
|
+ map.put("videoUrl", urlList.get(i));
|
|
|
|
|
+ } else {
|
|
|
|
|
+ map.put("type", "image");
|
|
|
|
|
+ map.put("imgUrl", urlList.get(i));
|
|
|
|
|
+ }
|
|
|
|
|
+ list.add(map);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
secondReportingVo.setImgList(list);
|
|
secondReportingVo.setImgList(list);
|
|
|
secondReportingVo.setReportContextType(lifeUserViolation.getReportContextType());
|
|
secondReportingVo.setReportContextType(lifeUserViolation.getReportContextType());
|
|
|
secondReportingVo.setId(id);
|
|
secondReportingVo.setId(id);
|