| package com.matrix.system.hive.action; | 
|   | 
| import com.matrix.core.constance.MatrixConstance; | 
| import com.matrix.core.pojo.AjaxResult; | 
| import com.matrix.core.pojo.PaginationVO; | 
| import com.matrix.core.tools.WebUtil; | 
| import com.matrix.system.common.bean.SysUsers; | 
| import com.matrix.system.hive.bean.SysVipLevel; | 
| import com.matrix.system.hive.service.SysVipLevelService; | 
| import org.springframework.stereotype.Controller; | 
| import org.springframework.web.bind.annotation.RequestMapping; | 
| import org.springframework.web.bind.annotation.ResponseBody; | 
|   | 
| import javax.annotation.Resource; | 
| import javax.servlet.http.HttpServletRequest; | 
|   | 
| /** | 
|  * @description 会员卡等级信息管理action | 
|  * @author jyy | 
|  * @date 2016-07-13 | 
|  */ | 
| @Controller | 
| @RequestMapping(value = "admin/cardLevel") | 
| public class CardLevelController extends BaseController{ | 
|   | 
|   | 
|     @Resource | 
|     private SysVipLevelService cardLevelService; | 
|      | 
|     /** | 
|      * 显示所有的会员卡等级信息 | 
|      */ | 
|     @RequestMapping(value = "/showList") | 
|     public @ResponseBody AjaxResult showList(SysVipLevel vipLevel,PaginationVO pageVo) { | 
|         SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); | 
|         vipLevel.setShopId(users.getShopId()); | 
|         return showList(cardLevelService,vipLevel,pageVo); | 
|     } | 
|     /** | 
|      * 添加或修改会员卡等级信息 | 
|      */ | 
|     @RequestMapping(value = "/addOrModify") | 
|     public @ResponseBody AjaxResult addOrModify(SysVipLevel vipLevel) { | 
|         SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); | 
|         vipLevel.setShopId(users.getShopId()); | 
|         vipLevel.setCompanyId(users.getCompanyId()); | 
|         if (vipLevel.getId() != null) { | 
|   | 
|             return modify(cardLevelService, vipLevel, "会员卡信息"); | 
|         } else { | 
|   | 
|             return add(cardLevelService, vipLevel, "会员卡信息"); | 
|         } | 
|     } | 
|     /** | 
|      * 删除会员卡信息 | 
|      */ | 
|     @RequestMapping(value = "/del") | 
|     public @ResponseBody AjaxResult del(String keys) { | 
|   | 
|         return remove(cardLevelService, keys); | 
|     } | 
|     /** | 
|      * 弹出框,会员卡信息 | 
|      */ | 
|     @RequestMapping(value = "/editForm") | 
|     public String editForm(Long id, HttpServletRequest request) { | 
|         SysVipLevel vipLevel; | 
|         if (id != null) { | 
|             vipLevel = cardLevelService.findById(id);  | 
|             request.setAttribute("obj", vipLevel); | 
|         } | 
|         return "admin/hive/vip/cardLevel-form"; | 
|     } | 
|      | 
|     /** | 
|      * 显示所有的会员卡等级信息,不分页 | 
|      */ | 
|     @RequestMapping(value = "/all") | 
|     public @ResponseBody AjaxResult all(SysVipLevel sysVipLevel) { | 
|         SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); | 
|         sysVipLevel.setShopId(users.getShopId()); | 
|         return new AjaxResult(AjaxResult.STATUS_SUCCESS, cardLevelService.findByModel(sysVipLevel), null); | 
|     } | 
| } |