From 9392cd85c0c04fac4889b723a79085ad7c911372 Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期三, 06 五月 2020 11:14:47 +0800
Subject: [PATCH] 用户申请超级会员发送邮件
---
fanli/src/main/java/com/yeshi/fanli/controller/admin/shop/BanLiShopGoodsSetAdminController.java | 47 ++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 44 insertions(+), 3 deletions(-)
diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/admin/shop/BanLiShopGoodsSetAdminController.java b/fanli/src/main/java/com/yeshi/fanli/controller/admin/shop/BanLiShopGoodsSetAdminController.java
index 5fdd832..1417e12 100644
--- a/fanli/src/main/java/com/yeshi/fanli/controller/admin/shop/BanLiShopGoodsSetAdminController.java
+++ b/fanli/src/main/java/com/yeshi/fanli/controller/admin/shop/BanLiShopGoodsSetAdminController.java
@@ -5,6 +5,7 @@
import java.util.List;
import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -14,6 +15,7 @@
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import com.yeshi.fanli.entity.shop.BanLiShopGoodsSets;
+import com.yeshi.fanli.exception.shop.BanLiShopGoodsSetException;
import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsSetService;
import com.yeshi.fanli.tag.PageEntity;
import com.yeshi.fanli.util.Constant;
@@ -28,6 +30,45 @@
@Resource
private BanLiShopGoodsSetService banLiShopGoodsSetService;
+
+ /**
+ * 淇濆瓨淇℃伅
+ *
+ * @param callback
+ * @param special
+ * @param out
+ */
+ @RequestMapping(value = "save")
+ public void save(String callback, BanLiShopGoodsSets record, HttpServletRequest request, PrintWriter out) {
+ try {
+ banLiShopGoodsSetService.saveObject(record);
+ JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("淇濆瓨鎴愬姛"));
+ } catch (BanLiShopGoodsSetException e) {
+ JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
+ } catch (Exception e) {
+ e.printStackTrace();
+ JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鎿嶄綔寮傚父"));
+ }
+ }
+
+ /**
+ * 淇敼鐘舵��
+ * @param callback
+ * @param id
+ * @param out
+ */
+ @RequestMapping(value = "switchState")
+ public void switchState(String callback, Long id, PrintWriter out) {
+ try {
+ banLiShopGoodsSetService.switchState(id);
+ JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("鎿嶄綔鎴愬姛"));
+ } catch (BanLiShopGoodsSetException e) {
+ JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
+ } catch (Exception e) {
+ JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鎿嶄綔澶辫触"));
+ e.printStackTrace();
+ }
+ }
/**
* 鍒犻櫎
@@ -68,7 +109,7 @@
* @param out
*/
@RequestMapping(value = "query")
- public void query(String callback, Integer pageIndex, Integer pageSize, String key, PrintWriter out) {
+ public void query(String callback, Integer pageIndex, Integer pageSize, String key, Long goodsId, PrintWriter out) {
try {
if (pageIndex == null || pageIndex < 1)
pageIndex = 1;
@@ -76,13 +117,13 @@
if (pageSize == null || pageSize < 1)
pageSize = Constant.PAGE_SIZE;
- List<BanLiShopGoodsSets> list = banLiShopGoodsSetService.listQuery(pageIndex, pageSize, key);
+ List<BanLiShopGoodsSets> list = banLiShopGoodsSetService.listQuery(pageIndex, pageSize, key, goodsId);
if (list == null || list.size() == 0) {
JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏆傛棤鏁版嵁"));
return;
}
- long count = banLiShopGoodsSetService.countQuery(key);
+ long count = banLiShopGoodsSetService.countQuery(key, goodsId);
int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
--
Gitblit v1.8.0