Procházet zdrojové kódy

feat(violation): 更新违规举报相关字段和逻辑

- 修改SQL查询字段别名,将dict_detail重命名为violation_type_name
- 在服务层设置dto的nickname属性值
- 修复动态信息查询逻辑,使用正确的ID字段
- 更正评论信息查询为StoreComment实体
- 补充动态信息查询并更新图片路径处理逻辑
- 映射新增的comment_id和dynamics_id字段到VO对象
zjy před 5 dny
rodič
revize
3fc15514f4

+ 2 - 2
alien-entity/src/main/java/shop/alien/entity/second/vo/SecondUserViolationDetailVo.java

@@ -5,8 +5,8 @@ import com.fasterxml.jackson.annotation.JsonInclude;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
-import shop.alien.entity.store.LifeComment;
 import shop.alien.entity.store.LifeUserDynamics;
+import shop.alien.entity.store.StoreComment;
 
 import java.util.List;
 import java.util.Map;
@@ -40,6 +40,6 @@ public class SecondUserViolationDetailVo extends SecondUserViolationVo{
 
     // 评论信息
     @ApiModelProperty(value = "评论信息")
-    LifeComment commentInfo;
+    StoreComment commentInfo;
 
 }

+ 1 - 1
alien-entity/src/main/java/shop/alien/mapper/LifeUserViolationMapper.java

@@ -136,7 +136,7 @@ public interface LifeUserViolationMapper extends BaseMapper<LifeUserViolation> {
             " where luv.delete_flag = 0 and luv.report_context_type in ('1', '2', '3') " +
             " union all " +
             " select " +
-            " luv.id, lu.user_name nick_name, lu.user_phone phone, luv.report_context_type, sd.dict_detail,  " +
+            " luv.id, lu.user_name nick_name, lu.user_phone phone, luv.report_context_type, sd.dict_detail violation_type_name,  " +
             " case when luv.report_context_type = '4' then '商品' else '用户' end report_context_name,  " +
             " luv.processing_status, case when luv.processing_status = 0 then '待处理' when luv.processing_status = 1 then '已通过' else '已驳回' end processing_name, " +
             " luv.processing_time, luv.created_time, '' image, luv.updated_time " +

+ 3 - 1
alien-entity/src/main/resources/mapper/second/SecondUserViolationMapper.xml

@@ -113,7 +113,9 @@
             v.report_evidence_img,
             v.processing_time,
             v.report_result,
-            v.video_first_frame
+            v.video_first_frame,
+            v.comment_id,
+            v.dynamics_id
         from
             life_user_violation v
             left join life_user u on v.reported_user_id = u.id

+ 9 - 5
alien-store/src/main/java/shop/alien/store/service/impl/LifeUserViolationServiceImpl.java

@@ -755,6 +755,7 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
         return resultPage.convert(e -> {
             LifeUserViolationDto dto = new LifeUserViolationDto();
             BeanUtils.copyProperties(e, dto);
+            dto.setNickname(e.getNickName());
             return dto;
         });
     }
@@ -769,7 +770,7 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
         List<String> videoFileType = Arrays.asList("mp4", "avi", "mov", "wmv", "flv", "mkv");
 
         if ("2".equals(item.getReportContextType())) {
-            LifeUserDynamics dynamicsInfo = lifeUserDynamicsMapper.selectById(id);
+            LifeUserDynamics dynamicsInfo = lifeUserDynamicsMapper.selectById(item.getDynamicsId());
             item.setDynamicsInfo(dynamicsInfo);
             // 将逗号分隔的图片路径拆分成 List<String>
             if (dynamicsInfo != null && StringUtils.isNotEmpty(dynamicsInfo.getImagePath())) {
@@ -783,15 +784,18 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
 
         if ("3".equals(item.getReportContextType())) {
             // TODO: 处理评论类型
-            LifeComment commentInfo = lifeCommentMapper.selectById(id);
+            StoreComment commentInfo = storeCommentMapper.selectById(item.getBusinessId());
             item.setCommentInfo(commentInfo);
+
+            LifeUserDynamics dynamicsInfo = lifeUserDynamicsMapper.selectById(commentInfo.getBusinessId());
+            item.setDynamicsInfo(dynamicsInfo);
             // 将逗号分隔的图片路径拆分成 List<String>
-            if (commentInfo != null && StringUtils.isNotEmpty(commentInfo.getImagePath())) {
-                List<String> imagePathList = Arrays.stream(commentInfo.getImagePath().split(","))
+            if (dynamicsInfo != null && StringUtils.isNotEmpty(dynamicsInfo.getImagePath())) {
+                List<String> imagePathList = Arrays.stream(dynamicsInfo.getImagePath().split(","))
                         .map(String::trim)
                         .filter(StringUtils::isNotEmpty)
                         .collect(Collectors.toList());
-                item.setCommentImg(imagePathList);
+                item.setDynamicsImg(imagePathList);
             }
         }