From fe646416d8d46de7b896ddbf65a3ad0cd30b729b Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 15 七月 2020 16:05:56 +0800
Subject: [PATCH] 大淘客与好单库与主包剥离

---
 fanli/src/main/java/com/yeshi/fanli/controller/admin/redpack/RedPackAdminController.java |   29 +++++++++++++++++++++++++----
 1 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/admin/redpack/RedPackAdminController.java b/fanli/src/main/java/com/yeshi/fanli/controller/admin/redpack/RedPackAdminController.java
index 01e9962..badb768 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/admin/redpack/RedPackAdminController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/admin/redpack/RedPackAdminController.java
@@ -8,6 +8,7 @@
 import javax.annotation.Resource;
 import javax.servlet.http.HttpServletRequest;
 
+import com.yeshi.fanli.entity.accept.AdminAcceptData;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.yeshi.utils.JsonUtil;
@@ -54,7 +55,7 @@
 	 * @param out
 	 */
 	@RequestMapping(value = "query")
-	public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer state, PrintWriter out) {
+	public void query(AdminAcceptData acceptData, String callback, Integer pageIndex, Integer pageSize, String key, Integer state, PrintWriter out) {
 		if (pageIndex == null || pageIndex < 1) {
 			pageIndex = 1;
 		}
@@ -111,7 +112,7 @@
 	 * @param out
 	 */
 	@RequestMapping(value = "getApplyInfo")
-	public void getAuditInfo(String callback, Long id, PrintWriter out) {
+	public void getAuditInfo(AdminAcceptData acceptData,String callback, Long id, PrintWriter out) {
 		RedPackExchange exchange = redPackExchangeService.selectByPrimaryKey(id);
 		if (exchange == null) {
 			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鐢宠璁板綍涓嶅瓨鍦�"));
@@ -147,7 +148,7 @@
 	 * @param request
 	 */
 	@RequestMapping(value = "passExchange")
-	public void passExchange(String callback, Long id, String code, PrintWriter out, HttpServletRequest request) {
+	public void passExchange(AdminAcceptData acceptData,String callback, Long id, String code, PrintWriter out, HttpServletRequest request) {
 		try {
 			/* 妫�楠屾槸鍚︾櫥闄� */
 			AdminUser admin = (AdminUser) request.getSession().getAttribute(Constant.SESSION_ADMIN);
@@ -186,7 +187,7 @@
 	 * @param request
 	 */
 	@RequestMapping(value = "rejectExchange")
-	public void rejectExchange(String callback, Long id, String code, String reason, PrintWriter out,
+	public void rejectExchange(AdminAcceptData acceptData,String callback, Long id, String code, String reason, PrintWriter out,
 			HttpServletRequest request) {
 		try {
 			/* 妫�楠屾槸鍚︾櫥闄� */
@@ -216,5 +217,25 @@
 		}
 	}
 
+	
+	/**
+	 * 绾㈠寘缁熻
+	 * @param callback
+	 * @param uid
+	 * @param out
+	 */
+	@RequestMapping(value = "statisticsRedPack")
+	public void statisticsRedPack(AdminAcceptData acceptData,String callback, Long uid, PrintWriter out) {
+		try {
+			JSONObject data = new JSONObject();
+			data.put("balance", redPackBalanceService.getBalance(uid));
+			data.put("exchanging", redPackExchangeService.countByUidAndState(uid, RedPackExchange.STATE_INIT));
+			data.put("exchangeSucceed", redPackExchangeService.countByUidAndState(uid, RedPackExchange.STATE_SUCCESS));
+			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
+		} catch (Exception e) {
+			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鎿嶄綔寮傚父"));
+			e.printStackTrace();
+		}
+	}
 
 }

--
Gitblit v1.8.0