| | |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.core.tools.excl.ExcelSheetPO; |
| | | import com.matrix.core.tools.excl.ExcelUtil; |
| | |
| | | |
| | | |
| | | QueryUtil.setQueryLimit(vipInfo); |
| | | |
| | | return showList(vipInfoService, vipInfo, pageVo); |
| | | List<SysVipInfo> dataList = vipInfoService.findInPage(vipInfo, pageVo); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, vipInfoService.findTotal(vipInfo)); |
| | | return result; |
| | | } |
| | | |
| | | /** |
| | |
| | | public @ResponseBody |
| | | AjaxResult addOrModify(SysVipInfo vipInfo) { |
| | | if (vipInfo.getId() != null) { |
| | | return modify(vipInfoService, vipInfo, "会员信息"); |
| | | int i = vipInfoService.modify(vipInfo); |
| | | if (i > 0) { |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "会员信息修改成功"); |
| | | } else { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "会员信息修改失败"); |
| | | } |
| | | } else { |
| | | vipInfo.setVipState(Dictionary.VIP_STATE_HY); |
| | | SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | if(vipInfo.getShopId()==null){ |
| | | vipInfo.setShopId(users.getShopId()); |
| | | } |
| | | return add(vipInfoService, vipInfo, "会员信息"); |
| | | int i = vipInfoService.add(vipInfo); |
| | | if (i > 0) { |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "会员信息添加成功"); |
| | | } else { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "会员信息添加失败"); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 删除会员信息 |
| | | */ |
| | | @RequestMapping(value = "/del") |
| | | public @ResponseBody |
| | | AjaxResult del(String keys) { |
| | | List<Long> ids = StringUtils.strToCollToLong(keys, ","); |
| | | int i = vipInfoService.removeLogic(ids); |
| | | if (i > 0) { |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "成功删除" + i + "条数据"); |
| | | } else { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "删除失败"); |
| | | } |
| | | // return remove(vipInfoService, keys); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 弹出框,会员信息 |
| | |
| | | @RequestMapping(value = "/modifyVip") |
| | | public @ResponseBody |
| | | AjaxResult modifyVip(SysVipInfo vipInfo) { |
| | | return modify(vipInfoService, vipInfo, "会员"); |
| | | int i = vipInfoService.modify(vipInfo); |
| | | if (i > 0) { |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "会员修改成功"); |
| | | } else { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "会员修改失败"); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | @RequestMapping(value = "/findAllVipInfo") |
| | | @ResponseBody |
| | | public AjaxResult findAllVipInfo() { |
| | | return showList(vipInfoService, null, null); |
| | | List<SysVipInfo> dataList = vipInfoService.findInPage(null, null); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, vipInfoService.findTotal(null)); |
| | | return result; |
| | | } |
| | | |
| | | @RequestMapping(value = "/findAllVipInfoWithShop") |
| | |
| | | public AjaxResult findAllVipInfoWithShop() { |
| | | SysVipInfo info = new SysVipInfo(); |
| | | info.setShopId(getMe().getShopId()); |
| | | return showList(vipInfoService, info, null); |
| | | List<SysVipInfo> dataList = vipInfoService.findInPage(info, null); |
| | | AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, vipInfoService.findTotal(info)); |
| | | return result; |
| | | } |
| | | |
| | | |