public ActionForward saveorupdate( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { boolean flag = false; System.out.println("~~~~增加或更新打印信息~~~~~"); FilePrintFrom fileform = (FilePrintFrom) form; RespFilePrint file = new RespFilePrint(); System.out.println("id===" + fileform.getId()); System.out.println("content===" + fileform.getPrintcontent()); System.out.println("procid===" + fileform.getSelectresp()); request.setAttribute("printres", fileform.getPrintcontent()); request.setAttribute("selectid", fileform.getSelectresp()); if (fileform.getId() == 0) { flag = true; file.setId(null); } else { file.setId(fileform.getId()); } file.setContent(fileform.getPrintcontent()); file.setRespInfo(respInfoService.findrespInfoById(fileform.getSelectresp())); respInfoService.saveorupdate(file); // 添加日志 OperatorDetails user = SecurityUserHolder.getCurrentUser(); SystemLog log = new SystemLog(); log.setUsername(user.getUsername()); List<Role> list = user.getRoleList(); String roles = ""; for (Role role : list) { roles += role.getRole() + ","; } log.setRoleName(roles.substring(0, roles.length() - 1)); log.setTime(new Timestamp(new Date().getTime())); log.setModuleName(SystemModelInfo.MOD_ERM); if (flag) { log.setOperationDesc( "应急响应模块文件打印,新增打印信息,ID为:" + file.getId() + ",所属预案名称为:" + file.getRespInfo().getName()); } else { log.setOperationDesc( "应急响应模块文件打印,修改打印信息,ID为:" + file.getId() + ",所属预案名称为:" + file.getRespInfo().getName()); } log.setControl("成功"); logService.saveSystemLog(log); request.setAttribute("respMenu", "fp"); return mapping.findForward("filecount"); }
public ActionForward showContent( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { System.out.println("~~~~~根据select条件查询对应的文本信息~~~~~~~~"); RespFilePrint file = new RespFilePrint(); String selectid = request.getParameter("selectid"); request.setAttribute("selectid", selectid); System.out.println("selectid=======" + selectid); if (null != selectid && !"".equals(selectid)) { RespFilePrint res = respInfoService.findFileContentById( respInfoService.findrespInfoById(Integer.parseInt(selectid))); if (null != res) { request.setAttribute("printid", res.getId()); // 打印信息编号 request.setAttribute("printres", res.getContent()); // 打印信息内容 request.setAttribute("printResp", res.getRespInfo()); // 打印信息对应的应急编号 } } request.setAttribute("respMenu", "fp"); return mapping.findForward("filecount"); }