瀏覽代碼

举报界面更新

fangqing 1 月之前
父節點
當前提交
122a7ab481

+ 20 - 6
ruoyi-generator/src/main/java/com/ruoyi/generator/controller/CommunityReportController.java

@@ -117,26 +117,39 @@ public class CommunityReportController {
 
 
     /**
-     * 管理员查看界面
-     * @param
+     *  管理员查看界面
+     * @param id  明细ID
+     * @param type 举报类型
+     * @param name 用户名称
+     * @param reason 举报理由
+     * @param userId 用户ID
      * @return
      */
     @ApiOperation("管理员查看界面")
     @GetMapping("/adminReport")
     //@Anonymous
-    public AjaxResult adminReport(Long id,Long type) {
+    public AjaxResult adminReport(Long id,Long type,String name,String reason,String userId) {
         List<CommunityReportUserVo> communityReportUsers = null;
+        int total = 0 ;
         try {
             int pageNum = Convert.toInt(ServletUtils.getParameter("pageNum"), 1);
             int pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10);
             int offset = (pageNum - 1) * pageSize;
             int searchType = Convert.toInt(ServletUtils.getParameter("searchType"), 0);
-            communityReportUsers = communityReportUserMapper.selectCommunityReportUser(offset, pageSize, searchType,id,type);
+            communityReportUsers = communityReportUserMapper.selectCommunityReportUser(offset, pageSize, searchType,id,type,name,reason,userId);
+
+            total = communityReportUserMapper.selectList(new QueryWrapper<CommunityReportUser>()
+                    .and((wrapper) -> {
+                        wrapper.ne("is_delete", true).or().isNull("is_delete");
+                    })).size();
+
+
+
         } catch (Exception e) {
             System.out.println(e.getMessage());
             throw new ProjectException();
         }
-        return AjaxResult.success(communityReportUsers);
+        return AjaxResult.successByCounts(communityReportUsers,total);
     }
 
     /**
@@ -154,7 +167,8 @@ public class CommunityReportController {
         List<CommunityReportUserVo> communityReportUsers = null;
         try {
             //判断已经处罚过的数据 不进行处理
-            communityReportUsers = communityReportUserMapper.selectCommunityReportUser(0, 100, 0,communityReportPunishVo.getId(),null);
+            communityReportUsers = communityReportUserMapper
+                    .selectCommunityReportUser(0, 100, 0,communityReportPunishVo.getId(),null,null,null,null);
             if (!communityReportUsers.isEmpty()) {
                 CommunityReportUserVo firstUser = communityReportUsers.get(0);
                 Long updateBy = firstUser.getUpdateBy();

+ 4 - 1
ruoyi-generator/src/main/java/com/ruoyi/generator/mapper/community/CommunityReportUserMapper.java

@@ -22,5 +22,8 @@ public interface CommunityReportUserMapper extends BaseMapper<CommunityReportUse
                                                                       @Param("limit") int limit,
                                                                       @Param("searchType") int searchType,
                                                                       @Param("id") Long  id,
-                                                                      @Param("type") Long  type);
+                                                                      @Param("type") Long  type,
+                                                                      @Param("name") String  name,
+                                                                      @Param("reason") String  reason,
+                                                                      @Param("userId") String  userId);
 }

+ 9 - 0
ruoyi-generator/src/main/resources/mapper/community/CommunityReportUserMapper.xml

@@ -75,6 +75,15 @@
            <if test="type != null and type != ''">
                AND type = #{type}
            </if>
+           <if test="name != null and name != ''">
+               AND user_name = #{name}
+           </if>
+           <if test="userId != null and userId != ''">
+               AND user_id = #{userId}
+           </if>
+           <if test="reason != null and reason != ''">
+               AND content  like concat('%', #{reason}, '%')
+           </if>
        </where>
         <if test="searchType == 1">
             order by a.create_time desc