@RequestMapping(value = "/deleteAll") @ResponseBody public Object deleteAll() { logBefore(logger, "批量删除Textmsg"); if (!PermissionHandler.buttonJurisdiction(menuUrl, "del")) { return null; } PageData pd = new PageData(); Map<String, Object> map = new HashMap<String, Object>(); try { pd = this.getPageData(); List<PageData> pdList = new ArrayList<PageData>(); String DATA_IDS = pd.getString("DATA_IDS"); if (null != DATA_IDS && !"".equals(DATA_IDS)) { String ArrayDATA_IDS[] = DATA_IDS.split(","); weixinTextMsgService.deleteAll(ArrayDATA_IDS); pd.put("msg", "ok"); } else { pd.put("msg", "no"); } pdList.add(pd); map.put("list", pdList); } catch (Exception e) { logger.error(e.toString(), e); } finally { logAfter(logger); } return AppUtil.returnObject(pd, map); }
/* * 导出到excel * @return */ @RequestMapping(value = "/excel") public ModelAndView exportExcel() { logBefore(logger, "导出Textmsg到excel"); if (!PermissionHandler.buttonJurisdiction(menuUrl, "cha")) { return null; } ModelAndView mv = new ModelAndView(); PageData pd = new PageData(); pd = this.getPageData(); try { Map<String, Object> dataMap = new HashMap<String, Object>(); List<String> titles = new ArrayList<String>(); titles.add("关键词"); // 1 titles.add("内容"); // 2 titles.add("创建时间"); // 3 titles.add("状态"); // 4 titles.add("备注"); // 5 dataMap.put("titles", titles); List<PageData> varOList = weixinTextMsgService.listAll(pd); List<PageData> varList = new ArrayList<PageData>(); for (int i = 0; i < varOList.size(); i++) { PageData vpd = new PageData(); vpd.put("var1", varOList.get(i).getString("KEYWORD")); // 1 vpd.put("var2", varOList.get(i).getString("CONTENT")); // 2 vpd.put("var3", varOList.get(i).getString("CREATETIME")); // 3 vpd.put("var4", varOList.get(i).get("STATUS").toString()); // 4 vpd.put("var5", varOList.get(i).getString("BZ")); // 5 varList.add(vpd); } dataMap.put("varList", varList); ObjectExcelView erv = new ObjectExcelView(); mv = new ModelAndView(erv, dataMap); } catch (Exception e) { logger.error(e.toString(), e); } return mv; }