|
@@ -1,5 +1,6 @@
|
|
|
package shop.alien.second.service.impl;
|
|
package shop.alien.second.service.impl;
|
|
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -11,12 +12,14 @@ import shop.alien.entity.second.vo.SecondGoodsVo;
|
|
|
import shop.alien.entity.second.vo.SecondUserViolationDetailVo;
|
|
import shop.alien.entity.second.vo.SecondUserViolationDetailVo;
|
|
|
import shop.alien.entity.second.vo.SecondUserViolationVo;
|
|
import shop.alien.entity.second.vo.SecondUserViolationVo;
|
|
|
import shop.alien.entity.store.LifeUserViolation;
|
|
import shop.alien.entity.store.LifeUserViolation;
|
|
|
|
|
+import shop.alien.entity.store.StoreImg;
|
|
|
import shop.alien.mapper.LifeUserViolationMapper;
|
|
import shop.alien.mapper.LifeUserViolationMapper;
|
|
|
import shop.alien.mapper.StoreImgMapper;
|
|
import shop.alien.mapper.StoreImgMapper;
|
|
|
import shop.alien.mapper.second.SecondGoodsMapper;
|
|
import shop.alien.mapper.second.SecondGoodsMapper;
|
|
|
import shop.alien.mapper.second.SecondUserViolationMapper;
|
|
import shop.alien.mapper.second.SecondUserViolationMapper;
|
|
|
import shop.alien.second.service.PlatformUserViolationService;
|
|
import shop.alien.second.service.PlatformUserViolationService;
|
|
|
import shop.alien.second.service.SecondGoodsService;
|
|
import shop.alien.second.service.SecondGoodsService;
|
|
|
|
|
+import shop.alien.util.common.Constants;
|
|
|
|
|
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
|
|
@@ -66,37 +69,27 @@ public class PlatformUserViolationServiceImpl extends ServiceImpl<SecondUserViol
|
|
|
item.setSecondGoods(secondGoods);
|
|
item.setSecondGoods(secondGoods);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 拆分举报图片信息
|
|
|
|
|
- List<String> urlList = Arrays.asList(item.getReportEvidenceImg().split(","));
|
|
|
|
|
- // 存放已存在文件list
|
|
|
|
|
- List<String> videoList = new ArrayList<>();
|
|
|
|
|
-
|
|
|
|
|
|
|
+ // 图片list
|
|
|
List<Map<String, Object>> list = new ArrayList<>();
|
|
List<Map<String, Object>> list = new ArrayList<>();
|
|
|
|
|
|
|
|
- for (int i = 0; i < urlList.size(); i++) {
|
|
|
|
|
- Map<String, Object> map = new HashMap<>();
|
|
|
|
|
|
|
+ // 查询图片信息
|
|
|
|
|
+ LambdaQueryWrapper<StoreImg> wrapper = new LambdaQueryWrapper<>();
|
|
|
|
|
+ wrapper.eq(StoreImg::getStoreId, item.getBusinessId());
|
|
|
|
|
+ wrapper.eq(StoreImg::getImgType, Constants.ImageType.SECOND_HAND_REPORT);
|
|
|
|
|
+ List<StoreImg> imgList = storeImgMapper.selectList(wrapper);
|
|
|
|
|
|
|
|
- // 查找最后一个点的位置
|
|
|
|
|
- int lastDotIndex = urlList.get(i).lastIndexOf('.');
|
|
|
|
|
|
|
+ for (int i = 0; i < imgList.size(); i++) {
|
|
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
|
|
|
|
|
- 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 = imgList.get(i).getImgUrl().substring(imgList.get(i).getImgUrl().lastIndexOf(".") + 1);
|
|
|
|
|
|
|
|
- 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);
|
|
|
|
|
|
|
+ if (videoFileType.contains(fileType.toLowerCase())) {
|
|
|
|
|
+ map.put("type", "video");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ map.put("type", "image");
|
|
|
}
|
|
}
|
|
|
|
|
+ map.put("imgUrl", imgList.get(i).getImgUrl());
|
|
|
|
|
+ list.add(map);
|
|
|
}
|
|
}
|
|
|
item.setImgList(list);
|
|
item.setImgList(list);
|
|
|
return item;
|
|
return item;
|