From 573c491b4a1ba60e12a5678a01c1546c0077c1ee Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期二, 30 七月 2019 09:07:42 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 fanli/src/main/java/com/yeshi/fanli/controller/admin/UserInfoAdminController.java |  135 +++++++++++++++------------------------------
 1 files changed, 45 insertions(+), 90 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 af7a424..a1731be 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
@@ -9,6 +9,7 @@
 import java.util.Map;
 
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
 
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -26,13 +27,16 @@
 import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
 import com.yeshi.fanli.entity.bus.user.UserInfo;
 import com.yeshi.fanli.entity.bus.user.UserRank;
+import com.yeshi.fanli.entity.common.AdminUser;
 import com.yeshi.fanli.entity.money.UserMoneyDetail;
 import com.yeshi.fanli.exception.user.ForbiddenUserIdentifyCodeException;
 import com.yeshi.fanli.service.inter.count.UserInfoCountService;
 import com.yeshi.fanli.service.inter.hongbao.ThreeSaleSerivce;
 import com.yeshi.fanli.service.inter.user.BindingAccountService;
 import com.yeshi.fanli.service.inter.user.ForbiddenUserIdentifyCodeService;
+import com.yeshi.fanli.service.inter.user.UserAccountService;
 import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
+import com.yeshi.fanli.service.inter.user.UserInfoDeleteRecordService;
 import com.yeshi.fanli.service.inter.user.UserInfoExtraService;
 import com.yeshi.fanli.service.inter.user.UserInfoService;
 import com.yeshi.fanli.service.inter.user.UserMoneyDetailService;
@@ -62,7 +66,6 @@
 	@Resource
 	private UserInfoCountService userInfoCountService;
 
-
 	@Resource
 	private ForbiddenUserIdentifyCodeService forbiddenUserIdentifyCodeService;
 
@@ -74,13 +77,18 @@
 
 	@Resource
 	private UserRankService userRankService;
-	
+
 	@Resource
 	private UserMoneyDetailService userMoneyDetailService;
 
+	@Resource
+	private UserInfoDeleteRecordService userInfoDeleteRecordService;
+
+	@Resource
+	private UserAccountService userAccountService;
 
 	/**
-	 * 鏌ヨ鐢ㄦ埛淇℃伅鍒楄〃   姝e父鐢ㄦ埛/寮傚父鐢ㄦ埛
+	 * 鏌ヨ鐢ㄦ埛淇℃伅鍒楄〃 姝e父鐢ㄦ埛/寮傚父鐢ㄦ埛
 	 * 
 	 * @param callback
 	 * @param pageIndex
@@ -107,7 +115,7 @@
 				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鐢ㄦ埛绫诲瀷type涓嶈兘涓虹┖"));
 				return;
 			}
-			
+
 			if (pageIndex == null)
 				pageIndex = 1;
 
@@ -263,7 +271,6 @@
 		}
 	}
 
-
 	/**
 	 * 
 	 * @param data
@@ -279,15 +286,15 @@
 				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("娌℃湁鍙洿鏀圭殑鍐呭"));
 				return;
 			}
-			
+
 			Gson gson = new Gson();
-			List<Integer> list = gson.fromJson(typeArray, new TypeToken<ArrayList<Integer>>() {}.getType());
+			List<Integer> list = gson.fromJson(typeArray, new TypeToken<ArrayList<Integer>>() {
+			}.getType());
 			if (list == null || list.size() == 0) {
 				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("娌℃湁鍙洿鏀圭殑鍐呭"));
 				return;
 			}
-			
-			
+
 			if (uid == null) {
 				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鐢ㄦ埛id涓嶈兘涓虹┖"));
 				return;
@@ -298,9 +305,8 @@
 				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("涓嶅瓨鍦ㄨ鐢ㄦ埛锛�"));
 				return;
 			}
-			
-			
-			for (Integer type: list) {
+
+			for (Integer type : list) {
 				String openid = find.getOpenid();
 				String wxUnionId = find.getWxUnionId();
 				String phone = find.getPhone();
@@ -327,7 +333,8 @@
 					}
 				} else if (4 == type) {
 					// 鏌ヨ鏀粯瀹濈粦瀹�
-					BindingAccount account = bindingAccountService.getBindingAccountByUidAndType(uid, BindingAccount.TYPE_ALIPAY);
+					BindingAccount account = bindingAccountService.getBindingAccountByUidAndType(uid,
+							BindingAccount.TYPE_ALIPAY);
 					if (account == null) {
 						JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("褰撳墠鐢ㄦ埛鏈粦瀹氭敮浠樺疂锛�"));
 						return;
@@ -350,12 +357,13 @@
 
 	/**
 	 * 灏佺鐢ㄦ埛ID
+	 * 
 	 * @param callback
 	 * @param uid
 	 * @param out
 	 */
 	@RequestMapping(value = "forbiddenUser")
-	public void forbiddenUser(String callback, Long uid, PrintWriter out) {
+	public void forbiddenUser(String callback, Long uid, HttpServletRequest request, PrintWriter out) {
 		try {
 
 			if (uid == null) {
@@ -369,72 +377,26 @@
 				return;
 			}
 
-			currentInfo.setState(UserInfo.STATE_FORBIDDEN);
-			currentInfo.setStateDesc("绠$悊鍛樺皝绂�");
-			userInfoService.updateByPrimaryKeySelective(currentInfo);
-			
-			// 鍔犲叆灏佺鐨勮处鍙峰垪琛�
-			ForbiddenUserIdentifyCode forbiddenUserIdentifyCode = new ForbiddenUserIdentifyCode();
-			forbiddenUserIdentifyCode.setType(ForbiddenUserIdentifyCodeTypeEnum.wxUnionId);
-			forbiddenUserIdentifyCode.setIdentifyCode(currentInfo.getWxUnionId());
-			forbiddenUserIdentifyCode.setBeiZhu(currentInfo.getWxName());
-			try {
-				forbiddenUserIdentifyCodeService.forbiddenIdentifyCode(forbiddenUserIdentifyCode);
-			} catch (ForbiddenUserIdentifyCodeException e) {
-				e.printStackTrace();
+			AdminUser admin = (AdminUser) request.getSession().getAttribute(Constant.SESSION_ADMIN);
+			if (admin == null) {
+				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鐧诲綍澶辨晥,璇风櫥褰�"));
+				return;
 			}
 
-			// 鐢佃瘽鍙风爜
-			forbiddenUserIdentifyCode = new ForbiddenUserIdentifyCode();
-			forbiddenUserIdentifyCode.setType(ForbiddenUserIdentifyCodeTypeEnum.phone);
-			forbiddenUserIdentifyCode.setIdentifyCode(currentInfo.getPhone());
-			try {
-				forbiddenUserIdentifyCodeService.forbiddenIdentifyCode(forbiddenUserIdentifyCode);
-			} catch (ForbiddenUserIdentifyCodeException e) {
-				e.printStackTrace();
-			}
+			String reason = "鍚庡彴灏佺锛屾搷浣滀汉锛�" + admin.getId() + "-" + admin.getName();
+			userAccountService.forbiddenUserAll(uid, reason);
 
-			// 娣樺疂
-			UserExtraTaoBaoInfo taoBao = userExtraTaoBaoInfoService.getByUid(uid);
-			if (taoBao != null && !StringUtil.isNullOrEmpty(taoBao.getTaoBaoUid())) {
-				forbiddenUserIdentifyCode = new ForbiddenUserIdentifyCode();
-				forbiddenUserIdentifyCode.setType(ForbiddenUserIdentifyCodeTypeEnum.taobaoUid);
-				forbiddenUserIdentifyCode.setIdentifyCode(taoBao.getTaoBaoUid());
-				try {
-					forbiddenUserIdentifyCodeService.forbiddenIdentifyCode(forbiddenUserIdentifyCode);
-				} catch (ForbiddenUserIdentifyCodeException e) {
-					e.printStackTrace();
-				}
-			}
-
-			// 鏌ヨ鏀粯瀹濈粦瀹�
-
-			List<BindingAccount> list = bindingAccountService.getBindingAccountByUid(uid);
-			if (list != null) {
-				for (BindingAccount ba : list) {
-					forbiddenUserIdentifyCode = new ForbiddenUserIdentifyCode();
-					forbiddenUserIdentifyCode.setType(ForbiddenUserIdentifyCodeTypeEnum.alipayAccount);
-					forbiddenUserIdentifyCode.setIdentifyCode(ba.getAccount());
-					forbiddenUserIdentifyCode.setBeiZhu(ba.getName());
-					try {
-						forbiddenUserIdentifyCodeService.forbiddenIdentifyCode(forbiddenUserIdentifyCode);
-					} catch (ForbiddenUserIdentifyCodeException e) {
-						e.printStackTrace();
-					}
-				}
-			}
-			
 			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("鐢ㄦ埛灏佺鎴愬姛"));
-			
+
 		} catch (Exception e) {
 			e.printStackTrace();
 			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鎿嶄綔澶辫触"));
 		}
 	}
-	
-	
+
 	/**
 	 * 瑙i櫎灏佺鐢ㄦ埛ID
+	 * 
 	 * @param callback
 	 * @param uid
 	 * @param out
@@ -497,25 +459,26 @@
 			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鎿嶄綔澶辫触"));
 		}
 	}
-	
-	
+
 	/**
-	 * 鐢ㄦ埛璐﹀彿- 灏佺/瑙e皝 
+	 * 鐢ㄦ埛璐﹀彿- 灏佺/瑙e皝
+	 * 
 	 * @param callback
 	 * @param code
-	 * @param type 1("寰俊unionId"), 2("娣樺疂ID"), 3("鎵嬫満鍙�"), 4("鏀粯瀹濊处鍙�");
+	 * @param type
+	 *            1("寰俊unionId"), 2("娣樺疂ID"), 3("鎵嬫満鍙�"), 4("鏀粯瀹濊处鍙�");
 	 * @param out
 	 */
 	@RequestMapping(value = "saveForbiddenInfo")
 	public void saveForbiddenInfo(String callback, String code, Integer type, PrintWriter out) {
 		try {
-			if (code == null || code.trim().length() == 0 || type == null ||"NULL".equalsIgnoreCase(code)) {
+			if (code == null || code.trim().length() == 0 || type == null || "NULL".equalsIgnoreCase(code)) {
 				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鍙傛暟涓嶈兘涓虹┖"));
 				return;
 			}
-			
+
 			forbiddenUserIdentifyCodeService.saveForbiddenInfo(code, type);
-			
+
 			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("淇敼鎴愬姛"));
 
 		} catch (ForbiddenUserIdentifyCodeException e) {
@@ -526,9 +489,10 @@
 			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鎿嶄綔寮傚父"));
 		}
 	}
-	
+
 	/**
-	 *  鍒犻櫎闃熷憳鍏崇郴
+	 * 鍒犻櫎闃熷憳鍏崇郴
+	 * 
 	 * @param callback
 	 * @param id
 	 * @param out
@@ -555,8 +519,7 @@
 			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鎿嶄綔寮傚父"));
 		}
 	}
-	
-	
+
 	@RequestMapping(value = "queryMyFirstTeams")
 	public void queryMyFirstTeams(String callback, Integer pageIndex, Integer pageSize, String key, Long bossId,
 			PrintWriter out) {
@@ -679,7 +642,6 @@
 		}
 	}
 
-
 	/**
 	 * 闃熷憳鍏崇郴
 	 * 
@@ -801,7 +763,6 @@
 		}
 
 		try {
-
 			List<UserMoneyDetail> userMoneyDetailsList = userMoneyDetailService.listByUidWithState(uid, pageIndex,
 					pageSize);
 			if (userMoneyDetailsList == null || userMoneyDetailsList.size() == 0) {
@@ -809,18 +770,15 @@
 				return;
 			}
 
-			List<AccountDetails> detailList = new ArrayList<>();
-			for (UserMoneyDetail detail : userMoneyDetailsList)
-				detailList.add(AccountDetailsFactory.create(detail));
-
 			long count = userMoneyDetailService.countByUidWithState(uid);
 
 			int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
 			PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
 
+			Gson gson = new GsonBuilder().setDateFormat("yyyy-MM-dd HH:mm:ss").create();
 			JSONObject data = new JSONObject();
 			data.put("pe", pe);
-			data.put("result_list", GsonUtil.toJsonExpose(detailList));
+			data.put("result_list", gson.toJson(userMoneyDetailsList));
 
 			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
 
@@ -1132,7 +1090,4 @@
 		}
 	}
 
-	
-
-	
 }

--
Gitblit v1.8.0