|
|
@@ -12,10 +12,12 @@ import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
import shop.alien.entity.second.SecondGoodsRecord;
|
|
|
+import shop.alien.entity.second.vo.SecondUserViolationDetailVo;
|
|
|
import shop.alien.entity.store.*;
|
|
|
import shop.alien.entity.store.dto.LifeUserViolationDto;
|
|
|
import shop.alien.entity.store.excelVo.LifeUserOrderExcelVo;
|
|
|
@@ -25,6 +27,7 @@ import shop.alien.entity.store.vo.LifeUserViolationVo;
|
|
|
import shop.alien.entity.store.vo.WebSocketVo;
|
|
|
import shop.alien.mapper.*;
|
|
|
import shop.alien.mapper.second.SecondGoodsRecordMapper;
|
|
|
+import shop.alien.mapper.second.SecondUserViolationMapper;
|
|
|
import shop.alien.store.config.WebSocketProcess;
|
|
|
import shop.alien.store.service.*;
|
|
|
import shop.alien.store.util.AiUserViolationUtils;
|
|
|
@@ -90,6 +93,9 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
|
|
|
|
|
|
private final AiUserViolationUtils aiUserViolationUtils;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private SecondUserViolationMapper mapper;
|
|
|
+
|
|
|
@Value("${spring.web.resources.excel-path}")
|
|
|
private String excelPath;
|
|
|
|
|
|
@@ -744,7 +750,7 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
|
|
|
}
|
|
|
queryWrapper.orderByDesc("updated_time");
|
|
|
|
|
|
- IPage<LifeUserViolationVo> resultPage = lifeUserViolationMapper.getViolationPage(pageRequest, queryWrapper);
|
|
|
+ IPage<LifeUserViolationVo> resultPage = lifeUserViolationMapper.getAllViolationPage(pageRequest, queryWrapper);
|
|
|
|
|
|
return resultPage.convert(e -> {
|
|
|
LifeUserViolationDto dto = new LifeUserViolationDto();
|
|
|
@@ -752,4 +758,64 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
|
|
|
return dto;
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public SecondUserViolationDetailVo queryViolationDetail(Integer id) {
|
|
|
+ // 查询举报信息
|
|
|
+ SecondUserViolationDetailVo item = mapper.getUserViolationDetailInfo(id);
|
|
|
+
|
|
|
+ // 视频文件类型
|
|
|
+ List<String> videoFileType = Arrays.asList("mp4", "avi", "mov", "wmv", "flv", "mkv");
|
|
|
+
|
|
|
+ if ("2".equals(item.getReportContextType())) {
|
|
|
+ LifeUserDynamics dynamicsList = lifeUserDynamicsMapper.selectById(id);
|
|
|
+ // 将逗号分隔的图片路径拆分成 List<String>
|
|
|
+ if (dynamicsList != null && StringUtils.isNotEmpty(dynamicsList.getImagePath())) {
|
|
|
+ List<String> imagePathList = Arrays.stream(dynamicsList.getImagePath().split(","))
|
|
|
+ .map(String::trim)
|
|
|
+ .filter(StringUtils::isNotEmpty)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ item.setDynamicsImg(imagePathList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if ("3".equals(item.getReportContextType())) {
|
|
|
+ // TODO: 处理评论类型
|
|
|
+ LifeComment commentList = lifeCommentMapper.selectById(id);
|
|
|
+ // 将逗号分隔的图片路径拆分成 List<String>
|
|
|
+ if (commentList != null && StringUtils.isNotEmpty(commentList.getImagePath())) {
|
|
|
+ List<String> imagePathList = Arrays.stream(commentList.getImagePath().split(","))
|
|
|
+ .map(String::trim)
|
|
|
+ .filter(StringUtils::isNotEmpty)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+ item.setCommentImg(imagePathList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ List<Map<String, Object>> list = new ArrayList<>();
|
|
|
+ // 将逗号分隔的图片路径拆分成 List<String>
|
|
|
+ if (item != null && StringUtils.isNotEmpty(item.getReportEvidenceImg())) {
|
|
|
+ List<String> imagePathList = Arrays.stream(item.getReportEvidenceImg().split(","))
|
|
|
+ .map(String::trim)
|
|
|
+ .filter(StringUtils::isNotEmpty)
|
|
|
+ .collect(Collectors.toList());
|
|
|
+
|
|
|
+ for (String imgUrl : imagePathList) {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ String fileType = imgUrl.substring(imgUrl.lastIndexOf(".") + 1);
|
|
|
+ if (videoFileType.contains(fileType.toLowerCase())) {
|
|
|
+ map.put("type", "video");
|
|
|
+ } else {
|
|
|
+ map.put("type", "image");
|
|
|
+ }
|
|
|
+ map.put("imgUrl", imgUrl);
|
|
|
+ list.add(map);
|
|
|
+ }
|
|
|
+
|
|
|
+ item.setImgList(list);
|
|
|
+ }
|
|
|
+
|
|
|
+ return item;
|
|
|
+ }
|
|
|
}
|