|
|
@@ -188,7 +188,7 @@ public class SecondGoodsServiceImpl extends ServiceImpl<SecondGoodsMapper, Secon
|
|
|
List<String> imageUrls = imageList.stream()
|
|
|
.map(StoreImg::getImgUrl)
|
|
|
.collect(Collectors.toList());
|
|
|
- List<Map<String, Object>> imgList = processReportImages(imageUrls,2);
|
|
|
+ List<Map<String, Object>> imgList = processReportImages(imageList,2);
|
|
|
detailVo.setImgList(imgList);
|
|
|
detailVo.setImageUrls(imageUrls);
|
|
|
}
|
|
|
@@ -271,7 +271,7 @@ public class SecondGoodsServiceImpl extends ServiceImpl<SecondGoodsMapper, Secon
|
|
|
List<String> imageUrls = imageList.stream()
|
|
|
.map(StoreImg::getImgUrl)
|
|
|
.collect(Collectors.toList());
|
|
|
- List<Map<String, Object>> imgList = processReportImages(imageUrls,2);
|
|
|
+ List<Map<String, Object>> imgList = processReportImages(imageList,2);
|
|
|
goodsInfo.setImgList(imgList);
|
|
|
goodsInfo.setImgUrl(imageUrls);
|
|
|
}
|
|
|
@@ -299,7 +299,7 @@ public class SecondGoodsServiceImpl extends ServiceImpl<SecondGoodsMapper, Secon
|
|
|
List<String> imageUrls = imageList.stream()
|
|
|
.map(StoreImg::getImgUrl)
|
|
|
.collect(Collectors.toList());
|
|
|
- List<Map<String, Object>> imgList = processReportImages(imageUrls,2);
|
|
|
+ List<Map<String, Object>> imgList = processReportImages(imageList,2);
|
|
|
goodsInfo.setImgList(imgList);
|
|
|
goodsInfo.setImgUrl(imageUrls);
|
|
|
}
|
|
|
@@ -471,7 +471,7 @@ public class SecondGoodsServiceImpl extends ServiceImpl<SecondGoodsMapper, Secon
|
|
|
List<String> urlList = imgList.stream()
|
|
|
.map(StoreImg::getImgUrl)
|
|
|
.collect(Collectors.toList());
|
|
|
- reportingVo.setImgList(processReportImages(urlList,1));
|
|
|
+ reportingVo.setImgList(processReportImages(imgList,1));
|
|
|
}
|
|
|
|
|
|
reportingVos.add(reportingVo);
|
|
|
@@ -482,41 +482,26 @@ public class SecondGoodsServiceImpl extends ServiceImpl<SecondGoodsMapper, Secon
|
|
|
|
|
|
/**
|
|
|
* 处理举报凭证图片
|
|
|
- * @param urlList 图片URL集合
|
|
|
+ * @param imageList 图片URL集合
|
|
|
* @param type 类型 1-举报 2-商品
|
|
|
* @return 图片列表
|
|
|
*/
|
|
|
- private List<Map<String, Object>> processReportImages(List<String> urlList, Integer type) {
|
|
|
+ private List<Map<String, Object>> processReportImages(List<StoreImg> imageList, Integer type) {
|
|
|
List<Map<String, Object>> list = new ArrayList<>();
|
|
|
- List<String> videoList = new ArrayList<>();
|
|
|
List<String> videoFileType = Arrays.asList("mp4", "avi", "flv", "mkv", "rmvb", "wmv", "3gp", "mov");
|
|
|
|
|
|
- for (int i = 0; i < urlList.size(); i++) {
|
|
|
+ for (StoreImg img : imageList) {
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
-
|
|
|
- // 查找最后一个点的位置
|
|
|
- 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);
|
|
|
+ String fileType = img.getImgUrl().substring(img.getImgUrl().lastIndexOf(".") + 1);
|
|
|
+ if (videoFileType.contains(fileType.toLowerCase())) {
|
|
|
+ map.put("type", "video");
|
|
|
+ } else {
|
|
|
+ map.put("type", "image");
|
|
|
}
|
|
|
-
|
|
|
- if (!StringUtils.isEmpty(contains)) {
|
|
|
- videoList.add(contains);
|
|
|
- if (videoFileType.contains(fileType.toLowerCase())) {
|
|
|
- map.put("type", "video");
|
|
|
- if (type == 1){
|
|
|
- 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);
|
|
|
+ if (type == 1) {
|
|
|
+ map.put("videoUrl", img.getImgUrl());
|
|
|
}
|
|
|
+ list.add(map);
|
|
|
}
|
|
|
|
|
|
return list;
|