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/PushCouponController.java |   29 ++++++++++++++---------------
 1 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/admin/PushCouponController.java b/fanli/src/main/java/com/yeshi/fanli/controller/admin/PushCouponController.java
index 169b300..13317ab 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/admin/PushCouponController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/admin/PushCouponController.java
@@ -3,10 +3,12 @@
 import java.io.PrintWriter;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Date;
 import java.util.List;
 
 import javax.annotation.Resource;
 
+import com.yeshi.fanli.entity.accept.AdminAcceptData;
 import org.apache.commons.beanutils.PropertyUtils;
 import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -16,8 +18,8 @@
 import com.google.gson.GsonBuilder;
 import com.google.gson.reflect.TypeToken;
 import com.yeshi.fanli.entity.push.PushCoupon;
-import com.yeshi.fanli.exception.PushException;
 import com.yeshi.fanli.exception.push.PushCouponException;
+import com.yeshi.fanli.exception.push.PushException;
 import com.yeshi.fanli.service.inter.push.PushCouponRecordService;
 import com.yeshi.fanli.service.inter.push.PushCouponService;
 import com.yeshi.fanli.tag.PageEntity;
@@ -45,18 +47,16 @@
 	 * @param out
 	 */
 	@RequestMapping(value = "save")
-	public void save(String callback, PushCoupon pushCoupon, String arrayIOS, String arrayAndroid, PrintWriter out) {
+	public void save(AdminAcceptData acceptData,String callback, PushCoupon pushCoupon,  PrintWriter out) {
 		
 		try {
-			convertVersion(pushCoupon, arrayIOS, arrayAndroid);
-			
 			pushCouponService.save(pushCoupon);
 			
-			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("鎿嶄綔鎴愬姛"));
+			JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("鍙戞斁鎴愬姛"));
 		} catch (PushCouponException e) {
 			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
 		} catch (Exception e) {
-			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鎿嶄綔寮傚父"));
+			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鍙戦�佸け璐�"));
 			e.printStackTrace();
 		}
 	}
@@ -69,7 +69,7 @@
 	 * @param out
 	 */
 	@RequestMapping(value = "delete")
-	public void delete(String callback, String idArray, PrintWriter out) {
+	public void delete(AdminAcceptData acceptData,String callback, String idArray, PrintWriter out) {
 
 		try {
 			if (StringUtil.isNullOrEmpty(idArray)) {
@@ -103,7 +103,7 @@
 	 * @param out
 	 */
 	@RequestMapping(value = "getPushInfo")
-	public void getPushInfo(String callback, Long id, PrintWriter out) {
+	public void getPushInfo(AdminAcceptData acceptData,String callback, Long id, PrintWriter out) {
 
 		if (id == null) {
 			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鍙傛暟涓嶈兘涓虹┖"));
@@ -144,7 +144,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;
@@ -156,7 +156,7 @@
 
 		try {
 
-			List<PushCoupon> list = pushCouponService.listQuery((pageIndex - 1) * pageSize, pageSize, key, state);
+			List<PushCoupon> list = pushCouponService.listQuery((pageIndex - 1) * pageSize, pageSize, key, state,acceptData.getSystem());
 
 			if (list == null || list.size() == 0) {
 				JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏆傛棤鏁版嵁"));
@@ -175,11 +175,13 @@
 				
 				convertVersionList(pushCouponVO);
 				
+				Date createTime = pushCouponVO.getCreateTime();
+				pushCouponVO.setPushTime(createTime);
 				
 				listVO.add(pushCouponVO);
 			}
 
-			long count = pushCouponService.countQuery(key, state);
+			long count = pushCouponService.countQuery(key, state,acceptData.getSystem());
 
 			int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
 			PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
@@ -203,12 +205,11 @@
 	
 	/**
 	 * 鎺ㄩ��
-	 * @param id 鎺ㄩ�乮d
 	 * @param out
 	 * @throws Exception
 	 */
 	@RequestMapping(value = "push")
-	public void push(String callback, String idArray, PrintWriter out) throws Exception {
+	public void push(AdminAcceptData acceptData,String callback, String idArray, PrintWriter out) throws Exception {
 
 		if (idArray == null || idArray.trim().length() == 0) {
 			JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("浼犻�掑弬鏁颁笉鑳戒负绌�"));
@@ -242,7 +243,6 @@
 
 	/**
 	 * 鐗堟湰杞崲涓簂ist
-	 * @param pushGoods
 	 */
 	public void convertVersionList(PushCouponVO pushCouponVO) {
 	  String versions = pushCouponVO.getVersions();
@@ -270,7 +270,6 @@
 
 	/**
 	 * 杞崲json
-	 * @param pushGoods
 	 */
 	public void convertVersion(PushCoupon pushCoupon, String arrayIOS, String arrayAndroid) {
 		

--
Gitblit v1.8.0