Browse Source

更新文件 articleTweetAction.java

陈士柏 2 years ago
parent
commit
4c7829f0a0
1 changed files with 31 additions and 0 deletions
  1. 31 0
      mhotel/src/com/happy/action/articleTweetAction.java

+ 31 - 0
mhotel/src/com/happy/action/articleTweetAction.java

@@ -1270,6 +1270,37 @@ public class articleTweetAction extends BaseController implements ModelDriven<Ar
         return null;
     }
 
+    public String getAllUserList() {
+        JSONObject jsonObject = new JSONObject();
+        if (adminId == null ){
+            jsonObject.put("code", 500);
+            jsonObject.put("message", "请传入管理员ID");
+            jsonObject.put("data", null);
+            ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
+            return null;
+        }
+        Admin admin = adminService.getById(Integer.parseInt(adminId));
+        if (admin==null || admin.getStatus()==0){
+            jsonObject.put("code", 500);
+            jsonObject.put("message", "该管理员已删除");
+            jsonObject.put("data", null);
+            ResponseUtil.writeJson(ServletActionContext.getResponse(), jsonObject.toString());
+            return null;
+        }
+
+        StringBuilder querySql = new StringBuilder("");
+        if (!Func.checkNull(articleTweetDto.getUserName())) {
+            querySql.append(" and user_name like '%").append(articleTweetDto.getUserName()).append("%' ");
+        }
+        querySql.append(" and data_type = '").append(DataType.游客数据.toString()).append("' ");
+        if (admin.getUserId()!=null && !admin.getUserId().equals("")){
+            querySql.append(" order by case when id in ( ").append(admin.getUserId()).append(") then 0 else 1 end");
+        }
+        IPage listPage = userService.queryUserPage2(querySql.toString(), page, rows,admin.getUserId()); // 查询分页
+        ResponseUtil.writeJsonIPage(ServletActionContext.getResponse(), listPage);
+        return null;
+    }
+
     /**
      * 社区首页推文列表
      */