소스 검색

修改族友圈

Alex 4 년 전
부모
커밋
7f2a4fac70

+ 5 - 4
ruoyi-app/src/main/java/com/ruoyi/app/controller/MyPublishController.java

@@ -55,11 +55,12 @@ public class MyPublishController extends AppBaseController {
      */
     @ApiOperation("族友圈 分页列表")
     @GetMapping("/selectCircle")
-    public TableDataInfo selectCircle(){
+    public TableDataInfo selectCircle(Long familyId){
+        if (familyId == null) {
+            return new TableDataInfo();
+        }
         AppMemberVo user = getLoginUser().getUser();
-        List<TbMyPublish> list = publishService.selectPublish(new LambdaQueryWrapper<TbMyPublish>()
-                .eq(TbMyPublish::getAppUserId,user.getUserId())
-        );
+        List<TbMyPublish> list = publishService.selectPublish(user.getUserId(), familyId);
         return getDataTable(list);
     }
 

+ 3 - 2
ruoyi-system/src/main/java/com/ruoyi/app/mapper/TbMyPublishMapper.java

@@ -25,8 +25,9 @@ public interface TbMyPublishMapper extends BaseMapper<TbMyPublish> {
 
     /**
      * 族友圈列表
-     * @param wrapper
+     * @param appUserId
+     * @param familyId
      * @return
      */
-    List<TbMyPublish> selectPublish(@Param(Constants.WRAPPER) LambdaQueryWrapper<TbMyPublish> wrapper);
+    List<TbMyPublish> selectPublish(@Param("appUserId") Long appUserId, @Param("familyId") Long familyId);
 }

+ 1 - 3
ruoyi-system/src/main/java/com/ruoyi/app/service/ITbMyPublishService.java

@@ -27,8 +27,6 @@ public interface ITbMyPublishService extends IService<TbMyPublish> {
     boolean delComment(Long id);
     /**
      * 族友圈列表
-     * @param wrapper
-     * @return
      */
-    List<TbMyPublish> selectPublish(LambdaQueryWrapper<TbMyPublish> wrapper);
+    List<TbMyPublish> selectPublish(Long appUserId, Long familyId);
 }

+ 1 - 0
ruoyi-system/src/main/java/com/ruoyi/app/service/impl/TbFamilyMemberServiceImpl.java

@@ -138,6 +138,7 @@ public class TbFamilyMemberServiceImpl extends ServiceImpl<TbFamilyMemberMapper,
 
     public AppMemberVo getMemberDetail(Long familyId) {
         TableInfoHelper.initTableInfo(new MapperBuilderAssistant(new MybatisConfiguration(), ""), AppMemberVo.class);
+
         return null;
     }
     @Override

+ 2 - 4
ruoyi-system/src/main/java/com/ruoyi/app/service/impl/TbMyPublishServiceImpl.java

@@ -218,13 +218,11 @@ public class TbMyPublishServiceImpl extends ServiceImpl<TbMyPublishMapper, TbMyP
 
     /**
      * 族友圈列表
-     * @param wrapper
-     * @return
      */
     @Override
-    public List<TbMyPublish> selectPublish(LambdaQueryWrapper<TbMyPublish> wrapper) {
+    public List<TbMyPublish> selectPublish(Long appUserId, Long familyId) {
         startPage();
-        List<TbMyPublish> list = baseMapper.selectPublish(wrapper);
+        List<TbMyPublish> list = baseMapper.selectPublish(appUserId, familyId);
         if (list.size() <= 0) {
             return new ArrayList<>();
         }

+ 4 - 5
ruoyi-system/src/main/resources/mapper/app/TbMyPublishMapper.xml

@@ -31,13 +31,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             select a.*,
             (select nick_name from tb_app_user us where us.id = a.app_user_id)nick_name,
             (select nick_name from tb_app_user us where us.id = a.message_user_id)message_user,
-            (select count(1)  from tb_publish_thumbs where publish_id = 1)thumbs
+            (select count(1)  from tb_publish_thumbs where publish_id = a.id)thumbs
             from (
                 select * from tb_my_publish p
                 where deleted = 'N' and app_user_id in (
-                    select f.app_user_id uid from tb_my_friends f where friends_user_id = 2 and status = 2
+                    select f.app_user_id uid from tb_my_friends f where friends_user_id = #{appUserId} and status = 2
                     union all
-                    select g.friends_user_id uid from tb_my_friends g  where app_user_id = 2 and status = 2
+                    select g.friends_user_id uid from tb_my_friends g  where app_user_id = #{appUserId} and status = 2
                 )
                 union
                 select * from tb_my_publish p
@@ -45,11 +45,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                     select u.id from tb_app_user u
                     left join tb_family_member m on u.id = m.app_user_id
                     left join tb_member_middle mi on m.id = mi.member_id
-                    where family_id = 1 and deleted = 'N'
+                    where family_id = #{familiId} and deleted = 'N' and mi.status = 2
                 )
             ) a
         ) b
-        ${ew.customSqlSegment}
     </select>
 
 </mapper>