zjy преди 3 месеца
родител
ревизия
f2071d54e9

+ 6 - 0
alien-entity/src/main/java/shop/alien/entity/second/vo/SecondUserViolationVo.java

@@ -27,6 +27,12 @@ public class SecondUserViolationVo extends LifeUserViolation {
     @ApiModelProperty(value = "分页条数")
     private Integer pageSize;
 
+    @ApiModelProperty(value = "被举报用户名称")
+    private String reportedUserName;
+
+    @ApiModelProperty(value = "被举报用户电话")
+    private String reportedUserPhone;
+
     @ApiModelProperty(value = "举报用户名称")
     private String reportingUserName;
 

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

@@ -19,6 +19,7 @@
         <result column="report_evidence_img" property="reportEvidenceImg" jdbcType="VARCHAR"/>
         <result column="processing_time" property="processingTime" jdbcType="TIMESTAMP"/>
         <result column="report_result" property="reportResult" jdbcType="VARCHAR"/>
+        <result column="video_first_frame" property="videoFirstFrame" jdbcType="VARCHAR"/>
     </resultMap>
 
     <!-- 分页查询举报信息 -->
@@ -76,7 +77,8 @@
             v.other_reason_content,
             v.report_evidence_img,
             v.processing_time,
-            v.report_result
+            v.report_result,
+            v.video_first_frame
         from
         life_user_violation v
         left join life_user u on v.reported_user_id = u.id

+ 18 - 25
alien-second/src/main/java/shop/alien/second/service/impl/PlatformUserViolationServiceImpl.java

@@ -1,5 +1,6 @@
 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.metadata.IPage;
 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.SecondUserViolationVo;
 import shop.alien.entity.store.LifeUserViolation;
+import shop.alien.entity.store.StoreImg;
 import shop.alien.mapper.LifeUserViolationMapper;
 import shop.alien.mapper.StoreImgMapper;
 import shop.alien.mapper.second.SecondGoodsMapper;
 import shop.alien.mapper.second.SecondUserViolationMapper;
 import shop.alien.second.service.PlatformUserViolationService;
 import shop.alien.second.service.SecondGoodsService;
+import shop.alien.util.common.Constants;
 
 import java.util.*;
 
@@ -66,37 +69,27 @@ public class PlatformUserViolationServiceImpl extends ServiceImpl<SecondUserViol
                 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<>();
 
-            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);
             return item;