Sfoglia il codice sorgente

bugfix:3007举报成功后的查询详情,删除的能查到

刘云鑫 2 mesi fa
parent
commit
44a87ffec9

+ 4 - 0
alien-entity/src/main/java/shop/alien/mapper/CommonCommentMapper.java

@@ -1,5 +1,6 @@
 package shop.alien.mapper;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
@@ -67,5 +68,8 @@ public interface CommonCommentMapper extends BaseMapper<CommonComment> {
     @Update("UPDATE common_comment SET delete_flag = 1, updated_time = NOW() " +
             "WHERE source_type = #{sourceType} AND source_id = #{sourceId} AND delete_flag = 0")
     int logicDeleteBySourceId(@Param("sourceType") Integer sourceType, @Param("sourceId") Integer sourceId);
+
+    @Select("select * from common_comment ${ew.customSqlSegment}")
+    CommonComment selectAll(@Param(Constants.WRAPPER) LambdaQueryWrapper<CommonComment> and);
 }
 

+ 4 - 0
alien-entity/src/main/java/shop/alien/mapper/LifeUserDynamicsMapper.java

@@ -1,5 +1,6 @@
 package shop.alien.mapper;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
@@ -93,4 +94,7 @@ public interface LifeUserDynamicsMapper extends BaseMapper<LifeUserDynamics> {
     List<LifeUserDynamicsVo> getDynamicsDetail(@Param("id") Integer id);
 
     List<LifeUserDynamicsVo> getStoreDynamicslist(@Param("userId") String userId, @Param("phoneId") String phoneId);
+
+    @Select("select * from life_user_dynamics ${ew.customSqlSegment}")
+    LifeUserDynamics selectAll(@Param(Constants.WRAPPER) LambdaQueryWrapper<LifeUserDynamics> and);
 }

+ 4 - 6
alien-store/src/main/java/shop/alien/store/service/impl/LifeUserViolationServiceImpl.java

@@ -774,7 +774,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.selectOne(new LambdaQueryWrapper<LifeUserDynamics>()
+            LifeUserDynamics dynamicsInfo = lifeUserDynamicsMapper.selectAll(new LambdaQueryWrapper<LifeUserDynamics>()
                     .eq(LifeUserDynamics::getId, item.getDynamicsId())
                     .and(d -> d.eq(LifeUserDynamics::getDeleteFlag, 1)
                             .or(c-> c.eq(LifeUserDynamics::getDeleteFlag, 0))));
@@ -791,17 +791,15 @@ public class LifeUserViolationServiceImpl extends ServiceImpl<LifeUserViolationM
 
         if ("3".equals(item.getReportContextType())) {
             // TODO: 处理评论类型
-            CommonComment commonComment = commonCommentMapper.selectOne(new LambdaQueryWrapper<CommonComment>()
-                    .eq(CommonComment::getId, item.getBusinessId())
-                    .and(d -> d.eq(CommonComment::getDeleteFlag, 1)
-                            .or(c-> c.eq(CommonComment::getDeleteFlag, 0))));
+            CommonComment commonComment = commonCommentMapper.selectAll(new LambdaQueryWrapper<CommonComment>()
+                    .eq(CommonComment::getId, item.getBusinessId()));
 
 
             item.setCommonCommentInfo(commonComment);
 
 //            StoreComment commentInfo = storeCommentMapper.selectById(item.getBusinessId());
 //            item.setCommentInfo(commentInfo);
-            LifeUserDynamics dynamicsInfo = lifeUserDynamicsMapper.selectOne(new LambdaQueryWrapper<LifeUserDynamics>()
+            LifeUserDynamics dynamicsInfo = lifeUserDynamicsMapper.selectAll(new LambdaQueryWrapper<LifeUserDynamics>()
                     .eq(LifeUserDynamics::getId, commonComment.getSourceId())
                     .and(d -> d.eq(LifeUserDynamics::getDeleteFlag, 1)
                             .or(c-> c.eq(LifeUserDynamics::getDeleteFlag, 0))));