From af7759852175239571753975c260eb107578658e Mon Sep 17 00:00:00 2001
From: yujian <yujian>
Date: 星期三, 13 三月 2019 11:54:01 +0800
Subject: [PATCH] 用户封禁+ 邀请红包统计修该

---
 fanli/src/main/java/com/yeshi/fanli/controller/admin/UserInfoAdminController.java |  103 ++++++++++++++++-----------------------------------
 1 files changed, 32 insertions(+), 71 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/admin/UserInfoAdminController.java b/fanli/src/main/java/com/yeshi/fanli/controller/admin/UserInfoAdminController.java
index a4485a6..2b95ac7 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/admin/UserInfoAdminController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/admin/UserInfoAdminController.java
@@ -31,7 +31,6 @@
 import com.google.gson.reflect.TypeToken;
 import com.yeshi.fanli.controller.admin.utils.AdminUtils;
 import com.yeshi.fanli.dto.money.AccountDetails;
-import com.yeshi.fanli.entity.admin.UserInfoAdmin;
 import com.yeshi.fanli.entity.bus.user.BindingAccount;
 import com.yeshi.fanli.entity.bus.user.Extract;
 import com.yeshi.fanli.entity.bus.user.ForbiddenUserIdentifyCode;
@@ -73,7 +72,7 @@
 import com.yeshi.fanli.util.StringUtil;
 import com.yeshi.fanli.util.TimeUtil;
 import com.yeshi.fanli.util.factory.AccountDetailsFactory;
-import com.yeshi.fanli.vo.user.ForbiddenUserIdentifyCodeVO;
+import com.yeshi.fanli.vo.user.UserInfoVO;
 
 import net.sf.json.JSONArray;
 import net.sf.json.JSONObject;
@@ -643,22 +642,15 @@
 	 * @param out
 	 */
 	@RequestMapping(value = "query")
-	public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer userType, Integer days,
-			String startTime, String endTime, Integer orderMode, PrintWriter out) {
+	public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer keyType, Integer rank,
+			Integer days, String startTime, String endTime, Integer orderMode, Integer type, PrintWriter out) {
 
 		try {
-
-			// 缁撴潫鏃堕棿 2018-06-06 00:00:00 鍔犱笂涓�澶�
-			if (!StringUtil.isNullOrEmpty(endTime)) {
-
-				SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-				Date enddate = sdf.parse(endTime);
-				Calendar c = Calendar.getInstance();
-				c.setTime(enddate);
-				c.add(Calendar.DAY_OF_MONTH, 1);// 浠婂ぉ+1澶�
-				endTime = sdf.format(c.getTime());
+			if (type == null) {
+				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鐢ㄦ埛绫诲瀷type涓嶈兘涓虹┖"));
+				return;
 			}
-
+			
 			if (pageIndex == null)
 				pageIndex = 1;
 
@@ -679,15 +671,35 @@
 				}
 			}
 
-			List<UserInfoAdmin> userList = userInfoService.query((pageIndex - 1) * pageSize, pageSize, key, userType,
-					days, startTime, endTime, orderField, orderMode);
+			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.query((pageIndex - 1) * pageSize, pageSize, type, key, keyType,
+					userRank, days, startTime, endTime, orderField, orderMode);
 
 			if (userList == null || userList.size() == 0) {
 				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏆傛棤鐩稿叧鏁版嵁"));
 				return;
 			}
 
-			long count = userInfoService.queryCount(key, userType, days, startTime, endTime);
+			long count = userInfoService.queryCount(type, key, keyType, userRank, days, startTime, endTime);
 
 			int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
 			PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
@@ -698,7 +710,6 @@
 
 			JSONObject data = new JSONObject();
 			data.put("pe", pe);
-			// data.put("sumMoney", sumMoney);
 			data.put("resultList", gson.toJson(userList));
 
 			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
@@ -1626,56 +1637,6 @@
 	}
 
 	
-	/**
-	 * 鏌ヨ灏佺
-	 * @param callback
-	 * @param pageIndex
-	 * @param pageSize
-	 * @param key
-	 * @param type
-	 * @param out
-	 */
-	@RequestMapping(value = "forbiddenQuery")
-	public void forbiddenQuery(String callback, Integer pageIndex, Integer pageSize, String key, Integer type, PrintWriter out) {
-
-		try {
-
-			if (pageIndex == null)
-				pageIndex = 1;
-
-			if (pageSize == null)
-				pageSize = Constant.PAGE_SIZE;
-
-			
-			List<ForbiddenUserIdentifyCodeVO> list = forbiddenUserIdentifyCodeService.listQuery((pageIndex - 1) * pageSize, 
-					pageSize, key, type);
-			
-			if (list == null || list.size() == 0) {
-				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏆傛棤鐩稿叧鏁版嵁"));
-				return;
-			}
-
-			long count = forbiddenUserIdentifyCodeService.countQuery(key, type);
-			
-			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("result_list", gson.toJson(list));
-
-			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
-
-		} catch (Exception e) {
-			e.printStackTrace();
-			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鎿嶄綔寮傚父"));
-		}
-	}
-
 	
 	/**
 	 * 鐢ㄦ埛璐﹀彿- 灏佺/瑙e皝 
@@ -1685,13 +1646,13 @@
 	 * @param out
 	 */
 	@RequestMapping(value = "saveForbiddenInfo")
-	public void saveForbiddenInfo(String callback, String code, Integer type, boolean state, PrintWriter out) {
+	public void saveForbiddenInfo(String callback, String code, Integer type, PrintWriter out) {
 		try {
 			if (code == null || code.trim().length() == 0 || type == null) {
 				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鍙傛暟涓嶈兘涓虹┖"));
 			}
 			
-			forbiddenUserIdentifyCodeService.saveForbiddenInfo(code, type, state);
+			forbiddenUserIdentifyCodeService.saveForbiddenInfo(code, type);
 			
 			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("淇敼鎴愬姛"));
 

--
Gitblit v1.8.0