From d32f3a1e73dfc21588c62ed6ef6ec331760f9b94 Mon Sep 17 00:00:00 2001 From: yujian <yujian@123.com> Date: 星期四, 07 十一月 2019 18:19:14 +0800 Subject: [PATCH] 商城后台审核 --- fanli/src/main/java/com/yeshi/fanli/controller/admin/shop/BanLiShopGoodsSetsPayAdminController.java | 22 +++++++++++++++++++--- 1 files changed, 19 insertions(+), 3 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/controller/admin/shop/BanLiShopGoodsSetsPayAdminController.java b/fanli/src/main/java/com/yeshi/fanli/controller/admin/shop/BanLiShopGoodsSetsPayAdminController.java index 7997529..b6df234 100644 --- a/fanli/src/main/java/com/yeshi/fanli/controller/admin/shop/BanLiShopGoodsSetsPayAdminController.java +++ b/fanli/src/main/java/com/yeshi/fanli/controller/admin/shop/BanLiShopGoodsSetsPayAdminController.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.BanLiShopGoodsSetsPay; +import com.yeshi.fanli.exception.shop.BanLiShopGoodsSetPayException; import com.yeshi.fanli.service.inter.shop.BanLiShopGoodsSetPayService; import com.yeshi.fanli.tag.PageEntity; import com.yeshi.fanli.util.Constant; @@ -27,6 +29,20 @@ @Resource private BanLiShopGoodsSetPayService banLiShopGoodsSetPayService; + + + @RequestMapping(value = "save") + public void save(String callback, BanLiShopGoodsSetsPay record, HttpServletRequest request, PrintWriter out) { + try { + banLiShopGoodsSetPayService.addSetPay(record); + JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("淇濆瓨鎴愬姛")); + } catch (BanLiShopGoodsSetPayException e) { + JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg())); + } catch (Exception e) { + e.printStackTrace(); + JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鎿嶄綔寮傚父")); + } + } /** @@ -68,7 +84,7 @@ * @param out */ @RequestMapping(value = "query") - public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer payType, PrintWriter out) { + public void query(String callback, Integer pageIndex, Integer pageSize, Long setId, String key, Integer payType, PrintWriter out) { try { if (pageIndex == null || pageIndex < 1) pageIndex = 1; @@ -76,13 +92,13 @@ if (pageSize == null || pageSize < 1) pageSize = Constant.PAGE_SIZE; - List<BanLiShopGoodsSetsPay> list = banLiShopGoodsSetPayService.listQuery(pageIndex, pageSize, key, payType); + List<BanLiShopGoodsSetsPay> list = banLiShopGoodsSetPayService.listQuery(pageIndex, pageSize, key, payType, setId); if (list == null || list.size() == 0) { JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("鏆傛棤鏁版嵁")); return; } - long count = banLiShopGoodsSetPayService.countQuery(key, payType); + long count = banLiShopGoodsSetPayService.countQuery(key, payType, setId); int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1); PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage); -- Gitblit v1.8.0