tjf 2 months ago
parent
commit
440109ec30
23 changed files with 229 additions and 58 deletions
  1. 8 3
      ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/constant/Constants.java
  2. 5 0
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysUserBo.java
  3. 13 8
      ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java
  4. 6 6
      ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/controller/communityNews/CommentIndexController.java
  5. 23 1
      ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/controller/communityNews/CommunityNewsController.java
  6. 1 1
      ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/controller/houseInfo/HouseInfoController.java
  7. 1 1
      ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/controller/residentInfo/ResidentInfoController.java
  8. 1 1
      ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/domain/communityNews/CommentContent.java
  9. 2 2
      ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/domain/communityNews/CommunityNews.java
  10. 2 0
      ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/domain/communityNews/bo/CommunityNewsBo.java
  11. 6 0
      ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/domain/communityNews/vo/CommunityNewsVo.java
  12. 2 0
      ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/domain/partyNews/PartyNews.java
  13. 2 0
      ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/domain/partyNews/bo/PartyNewsBo.java
  14. 2 0
      ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/domain/partyNews/vo/PartyNewsVo.java
  15. 5 0
      ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/domain/residentInfo/ResidentInfo.java
  16. 14 2
      ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/domain/residentInfo/bo/ResidentInfoBo.java
  17. 5 0
      ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/domain/residentInfo/vo/ResidentInfoVo.java
  18. 3 2
      ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/mapper/CommentIndexMapper.java
  19. 2 1
      ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/service/ICommentIndexService.java
  20. 25 3
      ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/service/impl/CommentIndexServiceImpl.java
  21. 6 0
      ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/service/impl/CommunityNewsServiceImpl.java
  22. 71 3
      ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/service/impl/ResidentInfoServiceImpl.java
  23. 24 24
      ruoyi-modules/ruoyi-wuye/src/main/resources/mapper/wuYe/CommentIndexMapper.xml

+ 8 - 3
ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/constant/Constants.java

@@ -94,8 +94,10 @@ public interface Constants {
     String DOWN = "down";
     String DOWN = "down";
     //持平
     //持平
     String FLAT = "flat";
     String FLAT = "flat";
-    //住户
+    //住户角色
     String TENEMENT = "tenement";
     String TENEMENT = "tenement";
+    //游客角色
+    String VISITOR = "visitor";
     //-----------------------web首页统计的key--------------
     //-----------------------web首页统计的key--------------
 //web首页统计上月外来车辆数量
 //web首页统计上月外来车辆数量
     String LAST_MONTH_VISITOR_CAR = "last_month_visitor_car:";
     String LAST_MONTH_VISITOR_CAR = "last_month_visitor_car:";
@@ -140,13 +142,16 @@ public interface Constants {
     String TWO_LIKE_COUNT = "two_like_count:";
     String TWO_LIKE_COUNT = "two_like_count:";
 
 
     //-------------------社区资讯收藏的key-----------------
     //-------------------社区资讯收藏的key-----------------
-//社区资讯收藏的人员集合的key = stars_community:{communityId} value = 该资讯收藏的[userId]
+    //社区资讯收藏的人员集合的key = stars_community:{communityId} value = 该资讯收藏的[userId]
     String STARS_COMMUNITY = "stars_community:";
     String STARS_COMMUNITY = "stars_community:";
     //社区资讯收藏的总数的key = stars_user_count:{communityId} value = 收藏的人数值
     //社区资讯收藏的总数的key = stars_user_count:{communityId} value = 收藏的人数值
     String STARS_USER_COUNT = "stars_user_count:";
     String STARS_USER_COUNT = "stars_user_count:";
+    //-------------------社区资讯分享的key-----------------
+    //社区资讯分享的数量 key = share_community:{communityId} value = 该资讯分享的数量
+    String SHARE_COMMUNITY = "share_community:";
 
 
     //-------------------党建资讯收藏的key-----------------
     //-------------------党建资讯收藏的key-----------------
-//党建资讯收藏的人员集合的key = stars_party_news:{userId} value = 该用户收藏的党建[partyId]
+    //党建资讯收藏的人员集合的key = stars_party_news:{userId} value = 该用户收藏的党建[partyId]
     String STARS_PARTY_NEWS = "stars_party_news:";
     String STARS_PARTY_NEWS = "stars_party_news:";
     //党建资讯对应资讯收藏的数量key =stars_party_news_count:{partyId} value = 收藏的数量
     //党建资讯对应资讯收藏的数量key =stars_party_news_count:{partyId} value = 收藏的数量
     String STARS_PARTY_NEWS_COUNT = "stars_party_news_count:";
     String STARS_PARTY_NEWS_COUNT = "stars_party_news_count:";

+ 5 - 0
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/domain/bo/SysUserBo.java

@@ -126,6 +126,11 @@ public class SysUserBo extends BaseEntity {
      */
      */
     private String isAuthentication;
     private String isAuthentication;
 
 
+    /**
+     * 人员类型:1:业主 2:租户 3:其他
+     */
+    private String residentType;
+
     public SysUserBo(Long userId) {
     public SysUserBo(Long userId) {
         this.userId = userId;
         this.userId = userId;
     }
     }

+ 13 - 8
ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysUserServiceImpl.java

@@ -41,6 +41,9 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map;
 import java.util.Set;
 import java.util.Set;
 
 
+import static org.dromara.common.core.constant.Constants.ONE;
+import static org.dromara.common.core.constant.Constants.THR;
+
 /**
 /**
  * 用户 业务层处理
  * 用户 业务层处理
  *
  *
@@ -436,7 +439,7 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
         if (TenantHelper.isEnable()) {
         if (TenantHelper.isEnable()) {
             tenantId = LoginHelper.getTenantId();
             tenantId = LoginHelper.getTenantId();
         }
         }
-        insertUserRole(userId, roleIds, tenantId, true);
+        insertUserRole(userId, roleIds, tenantId, true, ONE);
     }
     }
 
 
     /**
     /**
@@ -540,7 +543,7 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
      * @param clear 清除已存在的关联数据
      * @param clear 清除已存在的关联数据
      */
      */
     public void insertUserRole(SysUserBo user, boolean clear) {
     public void insertUserRole(SysUserBo user, boolean clear) {
-        this.insertUserRole(user.getUserId(), user.getRoleIds(), user.getTenantId(), clear);
+        this.insertUserRole(user.getUserId(), user.getRoleIds(), user.getTenantId(), clear, user.getResidentType());
     }
     }
 
 
     /**
     /**
@@ -574,17 +577,19 @@ public class SysUserServiceImpl implements ISysUserService, UserService {
      * @param roleIds 角色组
      * @param roleIds 角色组
      * @param clear   清除已存在的关联数据
      * @param clear   清除已存在的关联数据
      */
      */
-    private void insertUserRole(Long userId, Long[] roleIds, String tenantId, boolean clear) {
+    private void insertUserRole(Long userId, Long[] roleIds, String tenantId, boolean clear, String residentType) {
         if (ArrayUtil.isNotEmpty(roleIds)) {
         if (ArrayUtil.isNotEmpty(roleIds)) {
             List<Long> roleList = new ArrayList<>(List.of(roleIds));
             List<Long> roleList = new ArrayList<>(List.of(roleIds));
             if (!LoginHelper.isSuperAdmin(userId)) {
             if (!LoginHelper.isSuperAdmin(userId)) {
                 roleList.remove(SystemConstants.SUPER_ADMIN_ID);
                 roleList.remove(SystemConstants.SUPER_ADMIN_ID);
             }
             }
-            // 判断是否具有此角色的操作权限
-            List<SysRoleVo> roles = roleMapper.selectRoleList(
-                new QueryWrapper<SysRole>().in("r.role_id", roleList));
-            if (CollUtil.isEmpty(roles)) {
-                throw new ServiceException("没有权限访问角色的数据");
+            if (!THR.equals(residentType)) {
+                // 不是游客角色在来判断是否具有此角色的操作权限
+                List<SysRoleVo> roles = roleMapper.selectRoleList(
+                    new QueryWrapper<SysRole>().in("r.role_id", roleList));
+                if (CollUtil.isEmpty(roles)) {
+                    throw new ServiceException("没有权限访问角色的数据");
+                }
             }
             }
             if (clear) {
             if (clear) {
                 if (TenantHelper.isEnable()) {
                 if (TenantHelper.isEnable()) {

+ 6 - 6
ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/controller/communityNews/CommentIndexController.java

@@ -22,6 +22,7 @@ import org.dromara.domain.communityNews.bo.CommentIndexBo;
 import org.dromara.domain.communityNews.vo.CommentChildrenVo;
 import org.dromara.domain.communityNews.vo.CommentChildrenVo;
 import org.dromara.domain.communityNews.vo.CommentIndexShVo;
 import org.dromara.domain.communityNews.vo.CommentIndexShVo;
 import org.dromara.domain.communityNews.vo.CommentIndexVo;
 import org.dromara.domain.communityNews.vo.CommentIndexVo;
+import org.dromara.domain.communityNews.vo.CommentIndexVoOld;
 import org.dromara.service.ICommentIndexService;
 import org.dromara.service.ICommentIndexService;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
@@ -57,10 +58,9 @@ public class CommentIndexController extends BaseController {
     @SaCheckPermission("wuYe:commentIndex:commentSh")
     @SaCheckPermission("wuYe:commentIndex:commentSh")
     @GetMapping("/commentSh")
     @GetMapping("/commentSh")
     public TableDataInfo<CommentIndexShVo> commentSh(CommentIndexShVo commentIndexShVo, PageQuery pageQuery) {
     public TableDataInfo<CommentIndexShVo> commentSh(CommentIndexShVo commentIndexShVo, PageQuery pageQuery) {
-        commentIndexShVo.setTenantId(LoginHelper.getTenantId());
-        return TenantHelper.ignore(() -> {
-            return commentIndexService.commentSh(commentIndexShVo, pageQuery);
-        });
+        //commentIndexShVo.setTenantId(LoginHelper.getTenantId());
+        return commentIndexService.commentSh(commentIndexShVo, pageQuery);
+
     }
     }
 
 
     /**
     /**
@@ -68,7 +68,7 @@ public class CommentIndexController extends BaseController {
      */
      */
     @SaIgnore
     @SaIgnore
     @PostMapping(value = "/getRootComment", name = "查询一级评论")
     @PostMapping(value = "/getRootComment", name = "查询一级评论")
-    public TableDataInfo<CommentIndexVo> getRootComment(@RequestBody CommentIndex commentIndex, PageQuery pageQuery) {
+    public TableDataInfo<CommentIndexVoOld> getRootComment(@RequestBody CommentIndex commentIndex, PageQuery pageQuery) {
         commentIndex.setTenantId(LoginHelper.getTenantId());
         commentIndex.setTenantId(LoginHelper.getTenantId());
         return TenantHelper.ignore(() -> {
         return TenantHelper.ignore(() -> {
             return commentIndexService.getRootComment(commentIndex, pageQuery);
             return commentIndexService.getRootComment(commentIndex, pageQuery);
@@ -132,7 +132,7 @@ public class CommentIndexController extends BaseController {
         return toAjax(commentIndexService.updateByBo(bo));
         return toAjax(commentIndexService.updateByBo(bo));
     }
     }
 
 
-/*    *//**
+    /*    *//**
      * 删除社区资讯评论
      * 删除社区资讯评论
      *
      *
      * @param commentIds 主键串
      * @param commentIds 主键串

+ 23 - 1
ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/controller/communityNews/CommunityNewsController.java

@@ -14,6 +14,7 @@ import org.dromara.common.log.annotation.Log;
 import org.dromara.common.log.enums.BusinessType;
 import org.dromara.common.log.enums.BusinessType;
 import org.dromara.common.mybatis.core.page.PageQuery;
 import org.dromara.common.mybatis.core.page.PageQuery;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
+import org.dromara.common.redis.utils.RedisUtils;
 import org.dromara.common.web.core.BaseController;
 import org.dromara.common.web.core.BaseController;
 import org.dromara.domain.communityNews.bo.CommunityNewsBo;
 import org.dromara.domain.communityNews.bo.CommunityNewsBo;
 import org.dromara.domain.communityNews.vo.CommentInteractionVo;
 import org.dromara.domain.communityNews.vo.CommentInteractionVo;
@@ -25,6 +26,8 @@ import org.springframework.web.bind.annotation.*;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
+import static org.dromara.common.core.constant.Constants.SHARE_COMMUNITY;
+
 /**
 /**
  * 社区资讯
  * 社区资讯
  *
  *
@@ -67,7 +70,7 @@ public class CommunityNewsController extends BaseController {
     @SaCheckPermission("wuYe:news:query")
     @SaCheckPermission("wuYe:news:query")
     @GetMapping("/{communityId}")
     @GetMapping("/{communityId}")
     public R<CommunityNewsVo> getInfo(@NotNull(message = "主键不能为空")
     public R<CommunityNewsVo> getInfo(@NotNull(message = "主键不能为空")
-                                     @PathVariable Long communityId) {
+                                      @PathVariable Long communityId) {
         return R.ok(communityNewsService.queryById(communityId));
         return R.ok(communityNewsService.queryById(communityId));
     }
     }
 
 
@@ -114,6 +117,7 @@ public class CommunityNewsController extends BaseController {
     public R<Integer> getCommentInteractionCount(@RequestBody CommentInteractionVo commentInteractionVo) {
     public R<Integer> getCommentInteractionCount(@RequestBody CommentInteractionVo commentInteractionVo) {
         return communityNewsService.getCommentInteractionCount(commentInteractionVo);
         return communityNewsService.getCommentInteractionCount(commentInteractionVo);
     }
     }
+
     /**
     /**
      * 获取未读互动列表
      * 获取未读互动列表
      */
      */
@@ -122,4 +126,22 @@ public class CommunityNewsController extends BaseController {
     public R<Map<String, Object>> getCommentInteraction(@RequestBody CommentInteractionVo commentInteractionVo) {
     public R<Map<String, Object>> getCommentInteraction(@RequestBody CommentInteractionVo commentInteractionVo) {
         return communityNewsService.getCommentInteraction(commentInteractionVo);
         return communityNewsService.getCommentInteraction(commentInteractionVo);
     }
     }
+
+    /**
+     * 分享
+     * @param bo
+     * @return
+     */
+    @PostMapping("/setShare")
+    public R<Void> setShare(@RequestBody CommunityNewsBo bo) {
+        Long communityId = bo.getCommunityId();
+        String key = SHARE_COMMUNITY + communityId;
+        if (RedisUtils.hasKey(key)) {
+            long atomicValue = RedisUtils.getAtomicValue(key);
+            RedisUtils.setAtomicValue(SHARE_COMMUNITY, atomicValue + 1);
+        } else {
+            RedisUtils.setAtomicValue(SHARE_COMMUNITY, 1);
+        }
+        return R.ok();
+    }
 }
 }

+ 1 - 1
ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/controller/houseInfo/HouseInfoController.java

@@ -64,7 +64,7 @@ public class HouseInfoController extends BaseController {
     /**
     /**
      * 查询房屋信息列表不分页查询条件带租户
      * 查询房屋信息列表不分页查询条件带租户
      */
      */
-    @SaCheckPermission("wuYe:houseInfo:listNoPageTenant")
+   // @SaCheckPermission("wuYe:houseInfo:listNoPageTenant")
     @GetMapping("/listNoPageTenant")
     @GetMapping("/listNoPageTenant")
     public R<List<HouseInfoVo>> listNoPageTenant(HouseInfoBo bo) {
     public R<List<HouseInfoVo>> listNoPageTenant(HouseInfoBo bo) {
         List<HouseInfoVo> list = TenantHelper.ignore(() -> {
         List<HouseInfoVo> list = TenantHelper.ignore(() -> {

+ 1 - 1
ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/controller/residentInfo/ResidentInfoController.java

@@ -114,7 +114,7 @@ public class ResidentInfoController extends BaseController {
     /**
     /**
      * 新增居住人员提交认证信息
      * 新增居住人员提交认证信息
      */
      */
-    @SaCheckPermission("wuYe:residentInfo:add")
+    //@SaCheckPermission("wuYe:residentInfo:add")
     @Log(title = "新增居住人员提交认证信息", businessType = BusinessType.INSERT)
     @Log(title = "新增居住人员提交认证信息", businessType = BusinessType.INSERT)
     @RepeatSubmit()
     @RepeatSubmit()
     @PostMapping()
     @PostMapping()

+ 1 - 1
ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/domain/communityNews/CommentContent.java

@@ -58,7 +58,7 @@ public class CommentContent extends TenantEntity {
     private Long likeCount;
     private Long likeCount;
 
 
     /**
     /**
-     * 逻辑删除(Y:已删除,N:未删除)
+     * 逻辑删除(0,代表存在 1,代表删除)
      */
      */
     @TableLogic
     @TableLogic
     private String delFlag;
     private String delFlag;

+ 2 - 2
ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/domain/communityNews/CommunityNews.java

@@ -1,8 +1,8 @@
 package org.dromara.domain.communityNews;
 package org.dromara.domain.communityNews;
 
 
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableId;
-import com.baomidou.mybatisplus.annotation.TableLogic;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.EqualsAndHashCode;
 import org.dromara.common.tenant.core.TenantEntity;
 import org.dromara.common.tenant.core.TenantEntity;
@@ -48,12 +48,12 @@ public class CommunityNews extends TenantEntity {
     /**
     /**
      * 社区资讯状态(0正常 1关闭)
      * 社区资讯状态(0正常 1关闭)
      */
      */
-    @TableLogic
     private String status;
     private String status;
 
 
     /**
     /**
      * 发布时间
      * 发布时间
      */
      */
+    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date publishTime;
     private Date publishTime;
 
 
     /**
     /**

+ 2 - 0
ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/domain/communityNews/bo/CommunityNewsBo.java

@@ -1,5 +1,6 @@
 package org.dromara.domain.communityNews.bo;
 package org.dromara.domain.communityNews.bo;
 
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import io.github.linpeilie.annotations.AutoMapper;
 import io.github.linpeilie.annotations.AutoMapper;
 import jakarta.validation.constraints.NotBlank;
 import jakarta.validation.constraints.NotBlank;
 import jakarta.validation.constraints.NotNull;
 import jakarta.validation.constraints.NotNull;
@@ -54,6 +55,7 @@ public class CommunityNewsBo extends BaseEntity {
     /**
     /**
      * 发布时间
      * 发布时间
      */
      */
+    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date publishTime;
     private Date publishTime;
 
 
     /**
     /**

+ 6 - 0
ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/domain/communityNews/vo/CommunityNewsVo.java

@@ -2,6 +2,7 @@ package org.dromara.domain.communityNews.vo;
 
 
 import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
 import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
 import com.alibaba.excel.annotation.ExcelProperty;
 import com.alibaba.excel.annotation.ExcelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import io.github.linpeilie.annotations.AutoMapper;
 import io.github.linpeilie.annotations.AutoMapper;
 import lombok.Data;
 import lombok.Data;
 import org.dromara.common.excel.annotation.ExcelDictFormat;
 import org.dromara.common.excel.annotation.ExcelDictFormat;
@@ -66,6 +67,7 @@ public class CommunityNewsVo implements Serializable {
      * 发布时间
      * 发布时间
      */
      */
     @ExcelProperty(value = "发布时间")
     @ExcelProperty(value = "发布时间")
+    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date publishTime;
     private Date publishTime;
 
 
     /**
     /**
@@ -140,6 +142,10 @@ public class CommunityNewsVo implements Serializable {
      */
      */
     @ExcelProperty(value = "收藏数量")
     @ExcelProperty(value = "收藏数量")
     private String userStars;
     private String userStars;
+    /**
+     * 分享数量
+     */
+    private Long userShare;
 
 
     /**
     /**
      * 备注
      * 备注

+ 2 - 0
ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/domain/partyNews/PartyNews.java

@@ -2,6 +2,7 @@ package org.dromara.domain.partyNews;
 
 
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import lombok.Data;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.EqualsAndHashCode;
 import org.dromara.common.tenant.core.TenantEntity;
 import org.dromara.common.tenant.core.TenantEntity;
@@ -52,6 +53,7 @@ public class PartyNews extends TenantEntity {
     /**
     /**
      * 发布时间
      * 发布时间
      */
      */
+    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date publishTime;
     private Date publishTime;
 
 
     /**
     /**

+ 2 - 0
ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/domain/partyNews/bo/PartyNewsBo.java

@@ -1,5 +1,6 @@
 package org.dromara.domain.partyNews.bo;
 package org.dromara.domain.partyNews.bo;
 
 
+import com.fasterxml.jackson.annotation.JsonFormat;
 import io.github.linpeilie.annotations.AutoMapper;
 import io.github.linpeilie.annotations.AutoMapper;
 import jakarta.validation.constraints.NotBlank;
 import jakarta.validation.constraints.NotBlank;
 import jakarta.validation.constraints.NotNull;
 import jakarta.validation.constraints.NotNull;
@@ -54,6 +55,7 @@ public class PartyNewsBo extends BaseEntity {
     /**
     /**
      * 发布时间
      * 发布时间
      */
      */
+    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date publishTime;
     private Date publishTime;
 
 
     /**
     /**

+ 2 - 0
ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/domain/partyNews/vo/PartyNewsVo.java

@@ -2,6 +2,7 @@ package org.dromara.domain.partyNews.vo;
 
 
 import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
 import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
 import com.alibaba.excel.annotation.ExcelProperty;
 import com.alibaba.excel.annotation.ExcelProperty;
+import com.fasterxml.jackson.annotation.JsonFormat;
 import io.github.linpeilie.annotations.AutoMapper;
 import io.github.linpeilie.annotations.AutoMapper;
 import lombok.Data;
 import lombok.Data;
 import org.dromara.common.excel.annotation.ExcelDictFormat;
 import org.dromara.common.excel.annotation.ExcelDictFormat;
@@ -66,6 +67,7 @@ public class PartyNewsVo implements Serializable {
      * 发布时间
      * 发布时间
      */
      */
     @ExcelProperty(value = "发布时间")
     @ExcelProperty(value = "发布时间")
+    @JsonFormat(pattern = "yyyy-MM-dd")
     private Date publishTime;
     private Date publishTime;
 
 
     /**
     /**

+ 5 - 0
ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/domain/residentInfo/ResidentInfo.java

@@ -23,6 +23,11 @@ public class ResidentInfo extends TenantEntity {
 
 
     @TableField(exist = false)
     @TableField(exist = false)
     private String userType;
     private String userType;
+
+    /**
+     * 人员类型:1:业主 2:租户 3:其他
+     */
+    private String residentType;
     /**
     /**
      * 居住人员主键,唯一标识每条居住人员信息
      * 居住人员主键,唯一标识每条居住人员信息
      */
      */

+ 14 - 2
ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/domain/residentInfo/bo/ResidentInfoBo.java

@@ -4,11 +4,13 @@ import io.github.linpeilie.annotations.AutoMapper;
 import jakarta.validation.constraints.NotNull;
 import jakarta.validation.constraints.NotNull;
 import lombok.Data;
 import lombok.Data;
 import lombok.EqualsAndHashCode;
 import lombok.EqualsAndHashCode;
-import org.dromara.common.core.validate.AddGroup;
 import org.dromara.common.core.validate.EditGroup;
 import org.dromara.common.core.validate.EditGroup;
 import org.dromara.common.mybatis.core.domain.BaseEntity;
 import org.dromara.common.mybatis.core.domain.BaseEntity;
+import org.dromara.domain.houseInfo.HouseInfo;
 import org.dromara.domain.residentInfo.ResidentInfo;
 import org.dromara.domain.residentInfo.ResidentInfo;
 
 
+import java.util.List;
+
 /**
 /**
  * 居住人员信息,存储居住人员的详细信息业务对象 resident_info
  * 居住人员信息,存储居住人员的详细信息业务对象 resident_info
  *
  *
@@ -25,7 +27,12 @@ public class ResidentInfoBo extends BaseEntity {
      */
      */
     @NotNull(message = "居住人员主键,唯一标识每条居住人员信息不能为空", groups = { EditGroup.class })
     @NotNull(message = "居住人员主键,唯一标识每条居住人员信息不能为空", groups = { EditGroup.class })
     private Long residentId;
     private Long residentId;
+
     private String userType;
     private String userType;
+    /**
+     * 人员类型:1:业主 2:租户 3:其他
+     */
+    private String residentType;
     /**
     /**
      * 租户ID
      * 租户ID
      */
      */
@@ -34,7 +41,7 @@ public class ResidentInfoBo extends BaseEntity {
     /**
     /**
      * 关联房屋信息表的house_id,标识居住人员所属房屋
      * 关联房屋信息表的house_id,标识居住人员所属房屋
      */
      */
-    @NotNull(message = "关联房屋信息表的house_id", groups = { AddGroup.class, EditGroup.class })
+    //@NotNull(message = "关联房屋信息表的house_id", groups = { AddGroup.class, EditGroup.class })
     private Long houseId;
     private Long houseId;
 
 
     /**
     /**
@@ -139,4 +146,9 @@ public class ResidentInfoBo extends BaseEntity {
      * 是否需要过滤租户
      * 是否需要过滤租户
      */
      */
     private Boolean isFilter;
     private Boolean isFilter;
+
+    /**
+     * 用户房屋信息
+     */
+    private List<HouseInfo> houseInfoList;
 }
 }

+ 5 - 0
ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/domain/residentInfo/vo/ResidentInfoVo.java

@@ -31,6 +31,11 @@ public class ResidentInfoVo implements Serializable {
     @ExcelProperty(value = "居住人员主键,唯一标识每条居住人员信息")
     @ExcelProperty(value = "居住人员主键,唯一标识每条居住人员信息")
     private Long residentId;
     private Long residentId;
 
 
+    /**
+     * 人员类型:1:业主 2:租户 3:其他
+     */
+    private String residentType;
+
     /**
     /**
      * 租户ID
      * 租户ID
      */
      */

+ 3 - 2
ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/mapper/CommentIndexMapper.java

@@ -8,6 +8,7 @@ import org.dromara.domain.communityNews.CommentIndex;
 import org.dromara.domain.communityNews.vo.CommentChildrenVo;
 import org.dromara.domain.communityNews.vo.CommentChildrenVo;
 import org.dromara.domain.communityNews.vo.CommentIndexShVo;
 import org.dromara.domain.communityNews.vo.CommentIndexShVo;
 import org.dromara.domain.communityNews.vo.CommentIndexVo;
 import org.dromara.domain.communityNews.vo.CommentIndexVo;
+import org.dromara.domain.communityNews.vo.CommentIndexVoOld;
 
 
 import java.util.List;
 import java.util.List;
 
 
@@ -32,7 +33,7 @@ public interface CommentIndexMapper extends BaseMapperPlus<CommentIndex, Comment
      * @return
      * @return
      */
      */
     @InterceptorIgnore(tenantLine = "true", dataPermission = "false")
     @InterceptorIgnore(tenantLine = "true", dataPermission = "false")
-    Page<CommentIndexVo> getRootComment(@Param("page") Page<CommentIndex> page, @Param("commentIndex") CommentIndex commentIndex);
+    Page<CommentIndexVoOld> getRootComment(@Param("page") Page<CommentIndex> page, @Param("commentIndex") CommentIndex commentIndex);
 
 
 
 
     /**
     /**
@@ -42,7 +43,7 @@ public interface CommentIndexMapper extends BaseMapperPlus<CommentIndex, Comment
      * @return
      * @return
      */
      */
     @InterceptorIgnore(tenantLine = "true", dataPermission = "false")
     @InterceptorIgnore(tenantLine = "true", dataPermission = "false")
-    Page<CommentChildrenVo> getParentComment(@Param("page") Page<CommentIndex> page,CommentIndex commentIndex);
+    Page<CommentChildrenVo> getParentComment(@Param("page") Page<CommentIndex> page,@Param("commentIndex")CommentIndex commentIndex);
 
 
     /**
     /**
      * //查找出所有parent_id = commentId的commentId
      * //查找出所有parent_id = commentId的commentId

+ 2 - 1
ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/service/ICommentIndexService.java

@@ -7,6 +7,7 @@ import org.dromara.domain.communityNews.bo.CommentIndexBo;
 import org.dromara.domain.communityNews.vo.CommentChildrenVo;
 import org.dromara.domain.communityNews.vo.CommentChildrenVo;
 import org.dromara.domain.communityNews.vo.CommentIndexShVo;
 import org.dromara.domain.communityNews.vo.CommentIndexShVo;
 import org.dromara.domain.communityNews.vo.CommentIndexVo;
 import org.dromara.domain.communityNews.vo.CommentIndexVo;
+import org.dromara.domain.communityNews.vo.CommentIndexVoOld;
 
 
 import java.util.Collection;
 import java.util.Collection;
 import java.util.List;
 import java.util.List;
@@ -44,7 +45,7 @@ public interface ICommentIndexService {
      * @param commentIndex
      * @param commentIndex
      * @return
      * @return
      */
      */
-    TableDataInfo<CommentIndexVo> getRootComment(CommentIndex commentIndex, PageQuery pageQuery);
+    TableDataInfo<CommentIndexVoOld> getRootComment(CommentIndex commentIndex, PageQuery pageQuery);
     /**
     /**
      * 根据parent_id查询所有评论组装成前端所需要的子集数据结构 带分页
      * 根据parent_id查询所有评论组装成前端所需要的子集数据结构 带分页
      */
      */

+ 25 - 3
ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/service/impl/CommentIndexServiceImpl.java

@@ -20,6 +20,7 @@ import org.dromara.domain.communityNews.bo.CommentIndexBo;
 import org.dromara.domain.communityNews.vo.CommentChildrenVo;
 import org.dromara.domain.communityNews.vo.CommentChildrenVo;
 import org.dromara.domain.communityNews.vo.CommentIndexShVo;
 import org.dromara.domain.communityNews.vo.CommentIndexShVo;
 import org.dromara.domain.communityNews.vo.CommentIndexVo;
 import org.dromara.domain.communityNews.vo.CommentIndexVo;
+import org.dromara.domain.communityNews.vo.CommentIndexVoOld;
 import org.dromara.mapper.CommentContentMapper;
 import org.dromara.mapper.CommentContentMapper;
 import org.dromara.mapper.CommentIndexMapper;
 import org.dromara.mapper.CommentIndexMapper;
 import org.dromara.mapper.CommunityNewsMapper;
 import org.dromara.mapper.CommunityNewsMapper;
@@ -87,9 +88,30 @@ public class CommentIndexServiceImpl implements ICommentIndexService {
      * @return
      * @return
      */
      */
     @Override
     @Override
-    public TableDataInfo<CommentIndexVo> getRootComment(CommentIndex commentIndex, PageQuery pageQuery) {
-        Page<CommentIndexVo> result = baseMapper.getRootComment(pageQuery.build(), commentIndex);
-        return TableDataInfo.build(result);
+    public TableDataInfo<CommentIndexVoOld> getRootComment(CommentIndex commentIndex, PageQuery pageQuery) {
+        Page<CommentIndexVoOld> parentComment = baseMapper.getRootComment(pageQuery.build(), commentIndex);
+        Long userId = LoginHelper.getUserId();
+        List<CommentIndexVoOld> rootComment = parentComment.getRecords();
+        if (rootComment != null && rootComment.size() > 0) {
+            //要判断所有评论当前人员是否点赞过
+            //该用户点赞回复的key
+            String myLikeTwoKey = TWO_MY_LIKE + userId;
+            List<Long> communityIdList = RedisUtils.getCacheList(myLikeTwoKey);
+            if (communityIdList != null && communityIdList.size() > 0) {
+                for (CommentIndexVoOld commentIndexVo : rootComment) {
+                    if (communityIdList.contains(commentIndexVo.getId())) {
+                        commentIndexVo.setIsLike("Y");
+                    }
+                }
+            }
+            for (CommentIndexVoOld commentIndexVo : rootComment) {
+                //是否是自己的评论
+                if (commentIndexVo.getCommentUser().getId().equals(userId)) {
+                    commentIndexVo.setIsMyself("Y");
+                }
+            }
+        }
+        return TableDataInfo.build(parentComment);
     }
     }
 
 
     /**
     /**

+ 6 - 0
ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/service/impl/CommunityNewsServiceImpl.java

@@ -47,6 +47,12 @@ public class CommunityNewsServiceImpl implements ICommunityNewsService {
         CommunityNewsVo communityNews = baseMapper.selectVoById(communityId);
         CommunityNewsVo communityNews = baseMapper.selectVoById(communityId);
         communityNews.setIsStar("N");
         communityNews.setIsStar("N");
         communityNews.setIsLike("N");
         communityNews.setIsLike("N");
+        communityNews.setUserShare(0L);
+        String key = SHARE_COMMUNITY + communityId;
+        if (RedisUtils.hasKey(key)) {
+            long atomicValue = RedisUtils.getAtomicValue(key);
+            communityNews.setUserShare(atomicValue);
+        }
         Long userId = LoginHelper.getUserId();
         Long userId = LoginHelper.getUserId();
         String likeOneKey = ONE_LIKE + communityId;
         String likeOneKey = ONE_LIKE + communityId;
         List<Long> userIdList = RedisUtils.getCacheList(likeOneKey);
         List<Long> userIdList = RedisUtils.getCacheList(likeOneKey);

+ 71 - 3
ruoyi-modules/ruoyi-wuye/src/main/java/org/dromara/service/impl/ResidentInfoServiceImpl.java

@@ -16,9 +16,11 @@ import org.dromara.common.mybatis.core.page.PageQuery;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
 import org.dromara.common.mybatis.core.page.TableDataInfo;
 import org.dromara.common.satoken.utils.LoginHelper;
 import org.dromara.common.satoken.utils.LoginHelper;
 import org.dromara.common.tenant.helper.TenantHelper;
 import org.dromara.common.tenant.helper.TenantHelper;
+import org.dromara.domain.houseInfo.HouseInfo;
 import org.dromara.domain.residentInfo.ResidentInfo;
 import org.dromara.domain.residentInfo.ResidentInfo;
 import org.dromara.domain.residentInfo.bo.ResidentInfoBo;
 import org.dromara.domain.residentInfo.bo.ResidentInfoBo;
 import org.dromara.domain.residentInfo.vo.ResidentInfoVo;
 import org.dromara.domain.residentInfo.vo.ResidentInfoVo;
+import org.dromara.mapper.HouseInfoMapper;
 import org.dromara.mapper.ResidentInfoMapper;
 import org.dromara.mapper.ResidentInfoMapper;
 import org.dromara.service.IResidentInfoService;
 import org.dromara.service.IResidentInfoService;
 import org.dromara.system.domain.SysRole;
 import org.dromara.system.domain.SysRole;
@@ -58,6 +60,8 @@ public class ResidentInfoServiceImpl implements IResidentInfoService {
     private final ISysUserService userService;
     private final ISysUserService userService;
     private final SysRoleMapper sysRoleMapper;
     private final SysRoleMapper sysRoleMapper;
     private final SysUserRoleMapper userRoleMapper;
     private final SysUserRoleMapper userRoleMapper;
+    private final HouseInfoMapper houseInfoMapper;
+
 
 
     /**
     /**
      * 查询居住人员信息,存储居住人员的详细信息
      * 查询居住人员信息,存储居住人员的详细信息
@@ -140,6 +144,7 @@ public class ResidentInfoServiceImpl implements IResidentInfoService {
         lqw.eq(bo.getHouseId() != null, ResidentInfo::getHouseId, bo.getHouseId());
         lqw.eq(bo.getHouseId() != null, ResidentInfo::getHouseId, bo.getHouseId());
         lqw.eq(bo.getUserId() != null, ResidentInfo::getUserId, bo.getUserId());
         lqw.eq(bo.getUserId() != null, ResidentInfo::getUserId, bo.getUserId());
         lqw.eq(StringUtils.isNotBlank(bo.getDetailedAddress()), ResidentInfo::getDetailedAddress, bo.getDetailedAddress());
         lqw.eq(StringUtils.isNotBlank(bo.getDetailedAddress()), ResidentInfo::getDetailedAddress, bo.getDetailedAddress());
+        lqw.eq(StringUtils.isNotBlank(bo.getResidentType()), ResidentInfo::getResidentType, bo.getResidentType());
         lqw.like(StringUtils.isNotBlank(bo.getResidentName()), ResidentInfo::getResidentName, bo.getResidentName());
         lqw.like(StringUtils.isNotBlank(bo.getResidentName()), ResidentInfo::getResidentName, bo.getResidentName());
         lqw.eq(StringUtils.isNotBlank(bo.getResidentIdCard()), ResidentInfo::getResidentIdCard, bo.getResidentIdCard());
         lqw.eq(StringUtils.isNotBlank(bo.getResidentIdCard()), ResidentInfo::getResidentIdCard, bo.getResidentIdCard());
         lqw.eq(StringUtils.isNotBlank(bo.getResidentBirthday()), ResidentInfo::getResidentBirthday, bo.getResidentBirthday());
         lqw.eq(StringUtils.isNotBlank(bo.getResidentBirthday()), ResidentInfo::getResidentBirthday, bo.getResidentBirthday());
@@ -164,13 +169,64 @@ public class ResidentInfoServiceImpl implements IResidentInfoService {
      * 新增居住人员提交认证信息
      * 新增居住人员提交认证信息
      */
      */
     @Override
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public Boolean insertByBo(ResidentInfoBo bo) {
     public Boolean insertByBo(ResidentInfoBo bo) {
         ResidentInfo add = MapstructUtils.convert(bo, ResidentInfo.class);
         ResidentInfo add = MapstructUtils.convert(bo, ResidentInfo.class);
         //根据租户id houseId 手机号查询该居住人员是否存在
         //根据租户id houseId 手机号查询该居住人员是否存在
         if (checkIdCardUnique(add)) {
         if (checkIdCardUnique(add)) {
             throw new UserException("resident.register.save.error", add.getResidentName());
             throw new UserException("resident.register.save.error", add.getResidentName());
         }
         }
-        add.setUserId(LoginHelper.getUserId());
+        String tenantId = bo.getTenantId();
+        Long userId = LoginHelper.getUserId();
+        add.setUserId(userId);
+        String residentType = add.getResidentType();
+        String isHouseholder = add.getIsHouseholder();
+        //必须是业主和户主才能去修改房本信息
+        if (ONE.equals(residentType) && Y.equals(isHouseholder)) {
+            List<HouseInfo> houseInfoList = bo.getHouseInfoList();
+            if (houseInfoList != null && !houseInfoList.isEmpty()) {
+                //修改房屋信息
+                return TenantHelper.ignore(() -> {
+                    return houseInfoMapper.updateBatchById(houseInfoList);
+                });
+            }
+        }
+        if (THR.equals(residentType)){
+            SysUserBo user = new SysUserBo();
+            user.setUserId(userId);
+            user.setTenantId(tenantId);
+            user.setResidentType(residentType);
+            //默认审核通过
+            add.setExamine(TWO);
+            //赋予角色
+            //sys_user_tenant表中
+            SysUserTenant sysUserTenant = new SysUserTenant();
+            sysUserTenant.setUserId(userId);
+            sysUserTenant.setTenantId(tenantId);
+            sysUserTenantMapper.insert(sysUserTenant);
+            //给该userId赋予角色
+            // 新增用户与角色管理
+            //根据权限字符去查询角色id
+            SysRoleVo sysRoleVo = TenantHelper.ignore(() -> {
+                return sysRoleMapper.selectVoOne(new LambdaQueryWrapper<SysRole>()
+                    //TENEMENT住户固定角色名称
+                    .eq(SysRole::getRoleKey, VISITOR)
+                    .eq(SysRole::getTenantId, add.getTenantId()));
+            });
+            if (sysRoleVo != null) {
+                Long[] longArray = new Long[1];
+                longArray[0] = sysRoleVo.getRoleId();
+                user.setRoleIds(longArray);
+            }
+            userService.insertUserRole(user, false);
+
+            if (TenantHelper.isEnable()) {
+                //把租户id更新到sys_user表/sys_user_tenant表中
+                user.setIsAuthentication(Y);
+                userService.updateUserByIdNoTenantId(user);
+            }
+        }
+
         boolean flag = baseMapper.insert(add) > 0;
         boolean flag = baseMapper.insert(add) > 0;
         if (flag) {
         if (flag) {
             bo.setResidentId(add.getResidentId());
             bo.setResidentId(add.getResidentId());
@@ -270,9 +326,21 @@ public class ResidentInfoServiceImpl implements IResidentInfoService {
     public Boolean updateByBo(ResidentInfoBo bo) {
     public Boolean updateByBo(ResidentInfoBo bo) {
         ResidentInfo update = MapstructUtils.convert(bo, ResidentInfo.class);
         ResidentInfo update = MapstructUtils.convert(bo, ResidentInfo.class);
         validEntityBeforeSave(update);
         validEntityBeforeSave(update);
-        //根据租户id houseId 手机号查询该居住人员是否存在
+/*        //根据租户id houseId 手机号查询该居住人员是否存在
         if (checkIdCardUnique(update)) {
         if (checkIdCardUnique(update)) {
             throw new UserException("resident.register.save.error", update.getResidentName());
             throw new UserException("resident.register.save.error", update.getResidentName());
+        }*/
+        String residentType = update.getResidentType();
+        String isHouseholder = update.getIsHouseholder();
+        //必须是业主和户主才能去修改房本信息
+        if (ONE.equals(residentType) && Y.equals(isHouseholder)) {
+            List<HouseInfo> houseInfoList = bo.getHouseInfoList();
+            if (houseInfoList != null && !houseInfoList.isEmpty()) {
+                //修改房屋信息
+                 TenantHelper.ignore(() -> {
+                    return houseInfoMapper.updateBatchById(houseInfoList);
+                });
+            }
         }
         }
         if (bo.getIsFilter()) {
         if (bo.getIsFilter()) {
             return TenantHelper.ignore(() -> {
             return TenantHelper.ignore(() -> {
@@ -377,7 +445,7 @@ public class ResidentInfoServiceImpl implements IResidentInfoService {
 
 
 
 
     /**
     /**
-     *删除居住人员的认证信息
+     * 删除居住人员的认证信息
      *
      *
      * @param bo 主键串
      * @param bo 主键串
      */
      */

+ 24 - 24
ruoyi-modules/ruoyi-wuye/src/main/resources/mapper/wuYe/CommentIndexMapper.xml

@@ -111,21 +111,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         comment_index i
         comment_index i
         LEFT JOIN comment_content c ON i.content_id = c.content_id
         LEFT JOIN comment_content c ON i.content_id = c.content_id
         <where>
         <where>
-            i.del_flag = 'N'
-            and i.tenant_id = #{tenantId}
-            <if test="communityId != null ">and i.community_id = #{communityId}</if>
-            <if test="communityType != null  and communityType != ''">and i.community_type = #{communityType}</if>
-            <if test="isRoot != null ">and i.is_root = #{isRoot}</if>
-            <if test="parentId != null ">and i.parent_id = #{parentId}</if>
-            <if test="userId != null ">and i.user_id = #{userId}</if>
-            <if test="nickName != null  and nickName != ''">and i.nick_name like concat('%', #{nickName}, '%')</if>
-            <if test="avatar != null  and avatar != ''">and i.avatar = #{avatar}</if>
-            <if test="toUserId != null ">and i.to_user_id = #{toUserId}</if>
-            <if test="toNickName != null  and toNickName != ''">and i.to_nick_name like concat('%', #{toNickName}, '%')
+            i.del_flag = '0'
+            <if test="commentIndexShVo.tenantId != null ">  and i.tenant_id = #{commentIndexShVo.tenantId}</if>
+            <if test="commentIndexShVo.communityId != null ">and i.community_id = #{commentIndexShVo.communityId}</if>
+            <if test="commentIndexShVo.communityType != null  and commentIndexShVo.communityType != ''">and i.community_type = #{commentIndexShVo.communityType}</if>
+            <if test="commentIndexShVo.isRoot != null ">and i.is_root = #{commentIndexShVo.isRoot}</if>
+            <if test="commentIndexShVo.parentId != null ">and i.parent_id = #{commentIndexShVo.parentId}</if>
+            <if test="commentIndexShVo.userId != null ">and i.user_id = #{commentIndexShVo.userId}</if>
+            <if test="commentIndexShVo.nickName != null  and commentIndexShVo.nickName != ''">and i.nick_name like concat('%', #{commentIndexShVo.nickName}, '%')</if>
+            <if test="commentIndexShVo.avatar != null  and commentIndexShVo.avatar != ''">and i.avatar = #{commentIndexShVo.avatar}</if>
+            <if test="commentIndexShVo.toUserId != null ">and i.to_user_id = #{commentIndexShVo.toUserId}</if>
+            <if test="commentIndexShVo.toNickName != null  and commentIndexShVo.toNickName != ''">and i.to_nick_name like concat('%', #{commentIndexShVo.toNickName}, '%')
             </if>
             </if>
-            <if test="toAvatar != null  and toAvatar != ''">and i.to_avatar = #{toAvatar}</if>
-            <if test="status != null and status != ''"> and c.status = #{status}</if>
-            <if test="type != null "> and c.type = #{type}</if>
+            <if test="commentIndexShVo.toAvatar != null  and commentIndexShVo.toAvatar != ''">and i.to_avatar = #{commentIndexShVo.toAvatar}</if>
+            <if test="commentIndexShVo.status != null and commentIndexShVo.status != ''"> and c.status = #{commentIndexShVo.status}</if>
+            <if test="commentIndexShVo.type != null "> and c.type = #{commentIndexShVo.type}</if>
         </where>
         </where>
         order by i.create_time DESC
         order by i.create_time DESC
     </select>
     </select>
@@ -154,18 +154,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>
         <where>
             c.STATUS = '2'
             c.STATUS = '2'
             AND i.is_root = 2
             AND i.is_root = 2
-            AND c.del_flag = 'N'
-            AND i.del_flag = 'N'
-            <if test="communityId != null ">and i.community_id = #{communityId}</if>
+            AND c.del_flag = '0'
+            AND i.del_flag = '0'
+            <if test="commentIndex.communityId != null ">and i.community_id = #{commentIndex.communityId}</if>
         </where>
         </where>
         GROUP BY i.parent_id
         GROUP BY i.parent_id
         ) AS children ON children.ci_parent_id = i.comment_id
         ) AS children ON children.ci_parent_id = i.comment_id
         <where>
         <where>
             c.STATUS = '2'
             c.STATUS = '2'
             AND i.is_root = 1
             AND i.is_root = 1
-            AND c.del_flag = 'N'
-            AND i.del_flag = 'N'
-            <if test="communityId != null ">and i.community_id = #{communityId}</if>
+            AND c.del_flag = '0'
+            AND i.del_flag = '0'
+            <if test="commentIndex.communityId != null ">and i.community_id = #{commentIndex.communityId}</if>
         </where>
         </where>
         ORDER BY
         ORDER BY
         i.create_time DESC,
         i.create_time DESC,
@@ -192,9 +192,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <where>
         <where>
             c.STATUS = '2'
             c.STATUS = '2'
             AND i.is_root = 2
             AND i.is_root = 2
-            AND c.del_flag = 'N'
-            AND i.del_flag = 'N'
-            <if test="parentId != null ">and i.parent_id = #{parentId}</if>
+            AND c.del_flag = '0'
+            AND i.del_flag = '0'
+            <if test="commentIndex.parentId != null ">and i.parent_id = #{commentIndex.parentId}</if>
         </where>
         </where>
         order by i.create_time DESC,c.like_count DESC
         order by i.create_time DESC,c.like_count DESC
     </select>
     </select>
@@ -220,7 +220,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                 LEFT JOIN comment_content c ON i.comment_id = c.comment_id
                 LEFT JOIN comment_content c ON i.comment_id = c.comment_id
         WHERE
         WHERE
             i.parent_id = #{commentId}
             i.parent_id = #{commentId}
-          AND i.del_flag = 'N'
+          AND i.del_flag = '0'
           AND c.`status` = 2
           AND c.`status` = 2
     </select>
     </select>
 </mapper>
 </mapper>