/**
* 数据查询 * 李宗桓 * page * */ @ResponseBody @RequestMapping("/noticeList.json") public AjaxPageData<MarketingNotice> noticeList_json (XPaging<MarketingNotice> page) { //<MarketingNotice> 封装的实体类, XPaging<MarketingNotice> page把获取的值封装到page中 page.put("NOTICE_STATE", "3").notEqual(); //page对象的查询条件NOTICE_STATE属性存了一个不等于3的值, return getAjaxPageData(noticeService.findPage(page)); } /** * 公告添加页面 * @author 李宗桓 * @param request * @param response * @return */ @RequestMapping("/noticeAddShow") public String noticeAddShow(HttpServletRequest request, HttpServletResponse response) { return "marketing/notice_editer"; } /** * 公告添加操作 * @author 李宗桓 * @param request * @param response * @return */ @RequestMapping("/noticeAdd.do") public String gameAdd(HttpServletRequest request, HttpServletResponse response, MarketingNotice marketingNotice) { //获取当前用户 SysStaff loginUser = getLoginUser(request); Long rowId = loginUser.getRowId(); String staffAccount = loginUser.getStaffAccount(); //获取前台数据 String noticeTitle = getStringValue(request, "noticeTitle"); request.setAttribute("pageCode",1);//把1的标识放到pageCode if(StringUtils.isBlank(noticeTitle) ){ //-1,代表缺失标题 request.setAttribute("msg",-1); return noticeList(request); } // Long noticeTypeId = getLongValue(request, "noticeTypeId"); // Integer noticeTopFlag = getIntValue(request, "noticeTopFlag"); // Integer noticeState = getIntValue(request, "noticeState"); // Integer noticeHotFlag = getIntValue(request, "noticeHotFlag"); String noticeCentent = getStringValue(request, "content"); // MarketingNotice marketingNotice = new MarketingNotice(); // marketingNotice.setNoticeTypeId(noticeTypeId); // marketingNotice.setNoticeTitle(noticeTitle); marketingNotice.setOperatorId(rowId); marketingNotice.setOperatorAccount(staffAccount); // marketingNotice.setEditId(rowId); // marketingNotice.setEditAccount(staffAccount); marketingNotice.setNoticeCentent(noticeCentent); // marketingNotice.setNoticeState(noticeState); // marketingNotice.setNoticeHotFlag(noticeHotFlag); // marketingNotice.setNoticeTopFlag(noticeTopFlag); //Long addResult = 0L; try { //addResult = noticeService.saveNotice(marketingNotice); noticeService.saveObj(marketingNotice); /*if(addResult >0 ){ request.setAttribute("msg", 1);//代表成功 //return noticeList(request); }*/ } catch (Exception e) { log.error("添加出错"); request.setAttribute("msg",-2); //-6代表未知错误 //return noticeList(request); } return noticeList(request); }