首页>代码>spring+spring mvc+hibernate开发工程财务管理辅助系统>/FMS/src/com/mvc/controller/content/NoticeController.java
package com.mvc.controller.content; import java.util.List; import java.util.Map; import javax.servlet.http.HttpSession; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import com.mvc.controller.base.BaseController; import com.mvc.framework.constant.GlobalConstant; import com.mvc.pageModel.base.Grid; import com.mvc.pageModel.base.Json; import com.mvc.pageModel.base.PageFilter; import com.mvc.pageModel.base.SessionInfo; import com.mvc.service.content.NoticeServiceI; @Controller @RequestMapping("/notice") public class NoticeController extends BaseController{ @Autowired private NoticeServiceI noticeServiceI; @RequestMapping("/index") public String index() { return "/content/notice"; } @RequestMapping("/getNotices") @ResponseBody public Grid dataGrid(String notice_title,String notice_content,HttpSession session,PageFilter ph) { Grid grid = new Grid(); try { SessionInfo sessionInfo = (SessionInfo) session.getAttribute(GlobalConstant.SESSION_INFO); Map<String,Object> result=noticeServiceI.dataGrid(null,notice_title,notice_content,sessionInfo.getOrgId(),ph); List<Map<String,Object>> viewList=(List<Map<String, Object>>) result.get("rows"); grid.setRows(viewList); grid.setTotal(Long.parseLong(result.get("total").toString())); } catch(Exception e) { e.printStackTrace(); } return grid; } @RequestMapping("/add") @ResponseBody public Json add(String notice_title,String notice_content,HttpSession session) { Json json=new Json(); try { SessionInfo sessionInfo = (SessionInfo) session.getAttribute(GlobalConstant.SESSION_INFO); noticeServiceI.add(notice_title, notice_content, sessionInfo.getOrgId(),sessionInfo.getId()); json.setSuccess(true); json.setMsg("发布成功!"); } catch(Exception e) { json.setSuccess(false); json.setMsg("发布失败!"); } return json; } @RequestMapping("/deleteNotice") @ResponseBody public Json deleteNotice(String ids,HttpSession session) { Json json=new Json(); try { noticeServiceI.delete(ids); json.setSuccess(true); json.setMsg("删除成功!"); } catch(Exception e) { e.printStackTrace(); json.setSuccess(false); json.setMsg("删除失败!"); } return json; } }
最近下载更多
qiaoxiansheng LV6
2023年8月8日
zhaoyangwfd LV17
2022年11月29日
1083912911 LV4
2022年4月18日
getset LV8
2022年3月25日
dchengl7300 LV3
2021年12月15日
wanglinddad LV54
2021年9月23日
1029162867 LV13
2021年6月7日
窗边的小豆豆 LV1
2021年5月7日
lizhoutao LV11
2020年12月11日
caochengbo LV6
2020年11月1日
最近浏览更多
educationAAA LV4
4月18日
荣》Cowboy LV12
4月11日
fff2003 LV6
2023年12月23日
WBelong LV7
2023年12月11日
fesfefe LV13
2023年10月20日
qiaoxiansheng LV6
2023年8月8日
dzlwindy LV8
2023年6月29日
1083912911 LV4
2023年6月28日
chenhs
2023年6月20日
暂无贡献等级
6389181 LV7
2023年6月1日