admin
2020-06-11 3a1b3cc04d2926d830f2a623d656d369ebfb5cb2
fanli/src/main/java/com/yeshi/fanli/controller/admin/UserInfoAdminController.java
@@ -218,6 +218,82 @@
   }
   /**
    * 用户基础信息查询
    * @param callback
    * @param pageIndex
    * @param pageSize
    * @param key
    * @param keyType
    * @param rank
    * @param userType
    * @param days
    * @param startTime
    * @param endTime
    * @param type
    * @param level
    * @param activeCode
    * @param out
    */
   @RequestMapping(value = "queryInfo")
   public void queryInfo(String callback, Integer pageIndex, Integer pageSize, String key, Integer keyType, Integer rank,Integer userType,
         Integer days, String startTime, String endTime, Integer state,String level,
         Integer activeCode, PrintWriter out) {
      try {
         if (pageIndex == null)
            pageIndex = 1;
         if (pageSize == null)
            pageSize = Constant.PAGE_SIZE;
         String userRank = null;
         if (rank != null) {
            switch (rank) {
            case 1:
               userRank = "青铜";
               break;
            case 2:
               userRank = "白银";
               break;
            case 3:
               userRank = "黄金";
               break;
            case 4:
               userRank = "铂金";
               break;
            default:
               break;
            }
         }
         List<UserInfoVO> userList = userInfoService.queryInfo((pageIndex - 1) * pageSize, pageSize, state, key, keyType,
               userRank, days, startTime, endTime, userType, level, activeCode);
         if (userList == null || userList.size() == 0) {
            JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无相关数据"));
            return;
         }
         long count = userInfoService.countInfo(state, key, keyType, userRank, days, startTime, endTime,userType, level, activeCode);
         int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
         PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
         GsonBuilder gsonBuilder = new GsonBuilder();
         gsonBuilder.serializeNulls();
         Gson gson = gsonBuilder.create();
         JSONObject data = new JSONObject();
         data.put("pe", pe);
         data.put("resultList", gson.toJson(userList));
         JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
      } catch (Exception e) {
         e.printStackTrace();
         JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
      }
   }
   /**
    * 统计今日用户总情况
    * 
    * @param callback