AffairReqAction.java
上传用户:lm2018
上传日期:2015-12-12
资源大小:30449k
文件大小:23k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. //Created by MyEclipse Struts
  2. // XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_4.1.0/xslt/JavaClass.xsl
  3. package com.oa.module.affair.affairreq;
  4. import java.io.File;
  5. import java.io.FileNotFoundException;
  6. import java.io.FileOutputStream;
  7. import java.io.IOException;
  8. import java.io.InputStream;
  9. import java.io.OutputStream;
  10. import java.io.PrintWriter;
  11. import java.io.UnsupportedEncodingException;
  12. import java.lang.reflect.InvocationTargetException;
  13. import java.util.Iterator;
  14. import java.util.List;
  15. import java.util.Map;
  16. import javax.servlet.ServletException;
  17. import javax.servlet.http.HttpServletRequest;
  18. import javax.servlet.http.HttpServletResponse;
  19. import javax.servlet.http.HttpSession;
  20. import org.apache.commons.beanutils.BeanUtils;
  21. import org.apache.commons.fileupload.FileItem;
  22. import org.apache.commons.fileupload.FileUploadException;
  23. import org.apache.struts.action.ActionForm;
  24. import org.apache.struts.action.ActionForward;
  25. import org.apache.struts.action.ActionMapping;
  26. import org.apache.struts.actions.DispatchAction;
  27. import org.apache.struts.upload.FormFile;
  28. import org.jdom.Document;
  29. import org.jdom.Element;
  30. import org.jdom.output.Format;
  31. import org.jdom.output.XMLOutputter;
  32. import com.oa.module.affair.affair.Transstep;
  33. import com.oa.module.affair.affairdao.IAffair;
  34. import com.oa.module.affair.affairtype.AffairTypeForm;
  35. import com.oa.module.affair.affairtype.Transtype;
  36. import com.oa.module.office.user.Tuser;
  37. /**
  38.  * 事务发起ACTION
  39.  * @author admin
  40.  *
  41.  */
  42. public class AffairReqAction extends DispatchAction {
  43. // --------------------------------------------------------- Instance Variables
  44. private IAffair affairdao ;
  45. private ReqPage reqpage;
  46. // --------------------------------------------------------- Methods
  47. /** 
  48.  * Method execute
  49.  * @param mapping
  50.  * @param form
  51.  * @param request
  52.  * @param response
  53.  * @return ActionForward
  54.  */
  55. public ActionForward init(
  56. ActionMapping mapping,
  57. ActionForm form,
  58. HttpServletRequest request,
  59. HttpServletResponse response) {
  60. AffairReqForm affairReqForm = (AffairReqForm) form;
  61. HttpSession httpsession  = request.getSession();
  62. PrintWriter out = null;
  63. try {
  64. out = response.getWriter();
  65. } catch (IOException e1) {
  66. // TODO 自动生成 catch 块
  67. e1.printStackTrace();
  68. }
  69. Tuser user = (Tuser)httpsession.getAttribute("user");
  70. if (user != null) {
  71. List list = affairdao.init(String.valueOf(user.getUno()));
  72. request.setAttribute("affair", list);
  73. return new ActionForward("/Jsp_file/affair/affairreq.jsp");
  74. } else {
  75. out.print("<script>alert('登录时间过期,请重新登录');"
  76. + "window.top.location.href='" + request.getContextPath()
  77. + "/Jsp_file/login/login.jsp';");
  78. out.print("</script>");
  79. }
  80. return null;
  81. }
  82. public ActionForward getReqList(
  83. ActionMapping mapping,
  84. ActionForm form,
  85. HttpServletRequest request,
  86. HttpServletResponse response) throws ServletException, IOException {
  87. AffairReqForm affairReqForm = (AffairReqForm) form;
  88. request.setCharacterEncoding("GBK");
  89. response.setCharacterEncoding("GBK");
  90. HttpSession httpsession  = request.getSession();
  91. Tuser user = (Tuser)httpsession.getAttribute("user");
  92. PrintWriter out = null;
  93. try {
  94. out = response.getWriter();
  95. } catch (IOException e1) {
  96. // TODO 自动生成 catch 块
  97. e1.printStackTrace();
  98. }
  99. if (user != null) {
  100. int currentPage = 1;
  101. try {
  102. currentPage = Integer.parseInt(request.getParameter("currentPage"));
  103. } catch (Exception e) {
  104. currentPage = 1;
  105. }
  106. int count = 10;
  107. String username = request.getParameter("reqUsername");
  108. String rgrade = request.getParameter("rgrade");
  109. String starttime = request.getParameter("starttime");
  110. String endtime = request.getParameter("endtime");
  111. Transreq reqbean = new Transreq();
  112. reqbean.setReqUsername(username);
  113. reqbean.setRstatus(rgrade);
  114. reqbean.setRstarttime(starttime);
  115. reqbean.setRendtime(endtime);
  116. List reqList = affairdao.reqList(currentPage,count,reqbean,request);
  117. String sql =""; 
  118. String centent = "";
  119. String path = request.getContextPath()+"/affairReq.do?task=getReqList&";
  120. sql ="select count(*) from transreq req";
  121. sql =sql + " inner join tuser usr on req.uno =  usr.uno ";
  122. sql =sql +" inner join transtype typ on typ.rtid = req.tno where 1=1 and req.rstatus = '0' ";
  123. if(username!=null&&!username.trim().equals("")){
  124. centent=centent+" and usr.utruename like '%"+username.trim()+"%'";
  125. path = path+"reqUsername="+username+"&";
  126. }
  127. if(rgrade !=null && !rgrade.trim().equals("")){
  128. centent=centent+" and req.rgrade ='"+rgrade.trim()+"'";
  129. path = path+"rgrade="+rgrade+"&";
  130. }
  131. if(starttime!=null &&!starttime.trim().equals("")){
  132. centent=centent+" and req.rlasttime between'"+starttime.trim()+"'";
  133. centent=centent+" and '"+endtime.trim()+"'";
  134. path = path+"starttime="+starttime+"&";
  135. path = path+"endtime="+endtime+"&";
  136. }
  137. sql =sql +centent;
  138. ReqPage reqpages = reqpage.getPage(currentPage,count,sql);
  139. reqpages.setPath(path);
  140. request.setAttribute("reqList",reqList);
  141. request.setAttribute("reqpage", reqpages);
  142. return mapping.findForward("getlist");
  143. } else {
  144. out.print("<script>alert('登录时间过期,请重新登录');"
  145. + "window.top.location.href='" + request.getContextPath()
  146. + "/Jsp_file/login/login.jsp';");
  147. out.print("</script>");
  148. }
  149. return null;
  150. }
  151. public ActionForward transreq(
  152. ActionMapping mapping,
  153. ActionForm form,
  154. HttpServletRequest request,
  155. HttpServletResponse response) {
  156. AffairReqForm affairReqForm = (AffairReqForm) form;
  157. PrintWriter out = null;
  158. try {
  159. out = response.getWriter();
  160. } catch (IOException e1) {
  161. // TODO 自动生成 catch 块
  162. e1.printStackTrace();
  163. }
  164. HttpSession httpsession  = request.getSession();
  165. Tuser user = (Tuser)httpsession.getAttribute("user");
  166. if (user != null) {
  167. affairReqForm.setUno(user.getUno());
  168. affairReqForm.setRstatus("0");
  169. boolean flag = affairdao.AffairReq(affairReqForm ,request);
  170. if (flag == true) {
  171. out.print("<script>alert('发起事务成功'); if (confirm('是否要继续发起事务?(选择否则返回首页)')){ window.location.href='"
  172. + request.getContextPath()
  173. + "/affairReq.do?task=init'}else {"
  174. + "window.location.href='"
  175. + request.getContextPath()
  176. + "/login.do?method=main'}");
  177. out.print("</script>");
  178. } else {
  179. out.print("<script>alert('发起事务失败');" + "window.history.back()");
  180. out.print("</script>");
  181. }
  182. } else {
  183. out.print("<script>alert('登录时间过期,请重新登录');"
  184. + "window.top.location.href='" + request.getContextPath()
  185. + "/Jsp_file/login/login.jsp';");
  186. out.print("</script>");
  187. }
  188. return null;
  189. }
  190. public ActionForward getProcessers(
  191. ActionMapping mapping,
  192. ActionForm form,
  193. HttpServletRequest request,
  194. HttpServletResponse response) {
  195. AffairReqForm affairReqForm = (AffairReqForm) form;
  196. String type = request.getParameter("type");
  197. String rtid = request.getParameter("rtid");
  198. String step = request.getParameter("step");
  199. Map affair = affairdao.getaffair(rtid);
  200. int steps = Integer.parseInt(affair.get("tstep").toString());
  201. String dir = servlet.getServletContext().getRealPath("upload")+"\affairXml"+ File.separator+affair.get("txmlpath").toString();
  202. List stepList = affairdao.getSteps(dir, steps);
  203. Document doc = new Document();
  204. Map affairType = (Map) stepList.get(Integer.parseInt(step));
  205. if (type.equals("role")) {
  206. Element root = new Element("role");
  207. if (affairType.get("roleid") != null&& !affairType.get("roleid").toString().equals("")) {
  208. String[] roleids = affairType.get("roleid").toString().split(",");
  209. String[] rolenames = affairType.get("rolename").toString().split(",");
  210. List list = affairdao.getroles(affairType.get("roleid").toString());
  211. Iterator iter = list.iterator();
  212. //以下出错
  213. for (int i = 0; i < roleids.length; i++) {
  214. Element roleid = new Element("roleid");
  215. roleid.setAttribute("id", roleids[i]);
  216. roleid.setAttribute("rolename", rolenames[i]);
  217. if (iter.hasNext()) {
  218. iter.next();
  219. String[] userids = ((Map) list.get(i)).get("userid").toString().split(",");
  220. String[] usernames = ((Map) list.get(i)).get("username").toString().split(",");
  221. for (int j = 0; j < userids.length; j++) {
  222. Element userid = new Element("userid");
  223. userid.setAttribute("id", userids[j]);
  224. userid.setAttribute("username", usernames[j]);
  225. roleid.addContent(userid);
  226. }
  227. }
  228. root.addContent(roleid);
  229. }
  230. }
  231. doc.addContent(root);
  232. } else {
  233. Element root = new Element("users");
  234. if (affairType.get("userid") != null
  235. && !affairType.get("userid").toString().equals("")) {
  236. String[] userids = affairType.get("userid").toString().split(",");
  237. String[] usernames = affairType.get("username").toString().split(",");
  238. for (int i = 0; i < userids.length; i++) {
  239. Element userid = new Element("userid");
  240. userid.setAttribute("id", userids[i]);
  241. userid.setText(usernames[i]);
  242. root.addContent(userid);
  243. }
  244. }
  245. doc.addContent(root);
  246. }
  247. response.setContentType("application/xml;charset=GB2312");
  248. Format format = Format.getPrettyFormat();
  249. format.setEncoding("GB2312");
  250. XMLOutputter outer = new XMLOutputter(format);
  251. try {
  252. outer.output(doc, response.getWriter());
  253. } catch (IOException e) {
  254. // TODO 自动生成 catch 块
  255. e.printStackTrace();
  256. }
  257. return null;
  258. }
  259. public ActionForward gettoAudit(
  260. ActionMapping mapping,
  261. ActionForm form,
  262. HttpServletRequest request,
  263. HttpServletResponse response) {
  264. AffairReqForm affairReqForm = (AffairReqForm) form;
  265. PrintWriter out = null;
  266. try {
  267. out = response.getWriter();
  268. } catch (IOException e1) {
  269. // TODO 自动生成 catch 块
  270. e1.printStackTrace();
  271. }
  272. HttpSession httpsession  = request.getSession();
  273. Tuser user = (Tuser)httpsession.getAttribute("user");
  274. if (user != null) {
  275. List auditlist = affairdao.getaudit(request);
  276. request.setAttribute("audit", auditlist);
  277. return mapping.findForward("doaudit");
  278. } else {
  279. out.print("<script>alert('登录时间过期,请重新登录');"
  280. + "window.top.location.href='" + request.getContextPath()
  281. + "/Jsp_file/login/login.jsp';");
  282. out.print("</script>");
  283. }
  284. return null;
  285. }
  286. public ActionForward doaudit(
  287. ActionMapping mapping,
  288. ActionForm form,
  289. HttpServletRequest request,
  290. HttpServletResponse response) {
  291. AffairReqForm affairReqForm = (AffairReqForm) form;
  292. boolean flag = false;
  293. PrintWriter out = null;
  294. try {
  295. out = response.getWriter();
  296. } catch (IOException e1) {
  297. // TODO 自动生成 catch 块
  298. e1.printStackTrace();
  299. }
  300. HttpSession httpsession  = request.getSession();
  301. Tuser user = (Tuser)httpsession.getAttribute("user");
  302. if (user != null) {
  303. request.setAttribute("userid",user.getUno());
  304. String rqid = request.getParameter("rqid");
  305. String type = request.getParameter("type");
  306. FormFile file = affairReqForm.getFile();
  307. if (file.getFileName() != null && !file.getFileName().equals("")) {
  308. if (file.getFileSize() > 5 * 1024 * 1024) {
  309. out.print("<script>alert('附件大小不能大于5M')</script>");
  310. out.print("<script>window.history.back()</script>");
  311. return null;
  312. } else {
  313. String dir = getServlet().getServletContext().getRealPath("/")+ "upload/affair";
  314. String filename = file.getFileName();
  315. String filepath = "";
  316. InputStream input;
  317. try {
  318. input = file.getInputStream();
  319. filepath = System.currentTimeMillis()+ filename.substring(filename.lastIndexOf("."), filename.length());
  320. OutputStream output = new FileOutputStream(dir + "/" + filepath);
  321. byte[] b = new byte[10240];
  322. int i = 0;
  323. while ((i = input.read(b, 0, 10240)) != -1) {
  324. output.write(b, 0, i);
  325. }
  326. } catch (FileNotFoundException e) {
  327. // TODO 自动生成 catch 块
  328. e.printStackTrace();
  329. } catch (IOException e) {
  330. // TODO 自动生成 catch 块
  331. e.printStackTrace();
  332. }
  333. affairReqForm.setSname(filename);
  334. affairReqForm.setSpath(filepath);
  335. }
  336. }
  337. //修改环节状态
  338. affairdao.setread(rqid);
  339. //// 审核通过并未完结该事务
  340. if (type.equals("noEnd")){
  341. //审核通过
  342. flag = affairdao.affairPass("noend", request, affairReqForm);
  343. }
  344. //审核通过并完结该事务
  345. if (type.equals("End")){
  346. //先插入 实际完结时间 到 步骤表
  347. flag = affairdao.affairPass("end", request, affairReqForm);
  348. }
  349. if (flag == true) {
  350. out.print("<script>alert('处理事务成功'); ");
  351. out.print("window.location.href='"+ request.getContextPath()+ "/affairReq.do?task=getReqList'");
  352. out.print("</script>");
  353. } else {
  354. out.print("<script>alert('处理事务失败');" + "window.history.back()");
  355. out.print("</script>");
  356. return null;
  357. }
  358. } else {
  359. out.print("<script>alert('登录时间过期,请重新登录');"
  360. + "window.top.location.href='" + request.getContextPath()
  361. + "/Jsp_file/login/login.jsp';");
  362. out.print("</script>");
  363. }
  364. return null;
  365. }
  366. public ActionForward doaudit2(
  367. ActionMapping mapping,
  368. ActionForm form,
  369. HttpServletRequest request,
  370. HttpServletResponse response) {
  371. AffairReqForm affairReqForm = (AffairReqForm) form;
  372. boolean flag = false;
  373. PrintWriter out = null;
  374. try {
  375. out = response.getWriter();
  376. } catch (IOException e1) {
  377. // TODO 自动生成 catch 块
  378. e1.printStackTrace();
  379. }
  380. HttpSession httpsession  = request.getSession();
  381. Tuser user = (Tuser)httpsession.getAttribute("user");
  382. if (user != null) {
  383. request.setAttribute("userid",user.getUno());
  384. String rqid = request.getParameter("rqid");
  385. String type = request.getParameter("type");
  386. FormFile file = affairReqForm.getFile();
  387. if (file.getFileName() != null && !file.getFileName().equals("")) {
  388. if (file.getFileSize() > 5 * 1024 * 1024) {
  389. out.print("<script>alert('附件大小不能大于5M')</script>");
  390. out.print("<script>window.history.back()</script>");
  391. return null;
  392. } else {
  393. String dir = getServlet().getServletContext().getRealPath("/")+ "upload/affair";
  394. String filename = file.getFileName();
  395. String filepath = "";
  396. InputStream input;
  397. try {
  398. input = file.getInputStream();
  399. filepath = System.currentTimeMillis()+ filename.substring(filename.lastIndexOf("."), filename.length());
  400. OutputStream output = new FileOutputStream(dir + "/" + filepath);
  401. byte[] b = new byte[10240];
  402. int i = 0;
  403. while ((i = input.read(b, 0, 10240)) != -1) {
  404. output.write(b, 0, i);
  405. }
  406. } catch (FileNotFoundException e) {
  407. // TODO 自动生成 catch 块
  408. e.printStackTrace();
  409. } catch (IOException e) {
  410. // TODO 自动生成 catch 块
  411. e.printStackTrace();
  412. }
  413. affairReqForm.setSname(filename);
  414. affairReqForm.setSpath(filepath);
  415. }
  416. }
  417. //修改环节状态
  418. affairdao.setread(rqid);
  419. //// 审核不通过返回上一环节
  420. if (type.equals("back")){
  421. //审核不通过
  422. flag = affairdao.affairPass("back", request, affairReqForm);
  423. }
  424. //审核不通过并完结该事务
  425. if (type.equals("nopass")){
  426. //先插入 实际完结时间 到 步骤表
  427. flag = affairdao.affairPass("nopass", request, affairReqForm);
  428. }
  429. if (flag == true) {
  430. out.print("<script>alert('处理事务成功'); ");
  431. out.print("window.location.href='"+ request.getContextPath()+ "/affairReq.do?task=showlList'");
  432. out.print("</script>");
  433. } else {
  434. out.print("<script>alert('处理事务失败');" + "window.history.back()");
  435. out.print("</script>");
  436. return null;
  437. }
  438. } else {
  439. out.print("<script>alert('登录时间过期,请重新登录');"
  440. + "window.top.location.href='" + request.getContextPath()
  441. + "/Jsp_file/login/login.jsp';");
  442. out.print("</script>");
  443. }
  444. return null;
  445. }
  446. public ActionForward getmyaffair(ActionMapping mapping,
  447. ActionForm form,
  448. HttpServletRequest request,
  449. HttpServletResponse response) throws ServletException, IOException {
  450. AffairReqForm affairReqForm = (AffairReqForm) form;
  451. request.setCharacterEncoding("GBK");
  452. response.setCharacterEncoding("GBK");
  453. HttpSession httpsession  = request.getSession();
  454. Tuser user = (Tuser)httpsession.getAttribute("user");
  455. PrintWriter out = null;
  456. try {
  457. out = response.getWriter();
  458. } catch (IOException e1) {
  459. // TODO 自动生成 catch 块
  460. e1.printStackTrace();
  461. }
  462. if (user != null) {
  463. int currentPage = 1;
  464. try {
  465. currentPage = Integer.parseInt(request.getParameter("currentPage"));
  466. } catch (Exception e) {
  467. currentPage = 1;
  468. }
  469. int count = 10;
  470. String rgrade = request.getParameter("rgrade");
  471. String starttime = request.getParameter("starttime");
  472. String endtime = request.getParameter("endtime");
  473. request.setAttribute("uno",user.getUno());
  474. Transreq reqbean = new Transreq();
  475. reqbean.setRstatus(rgrade);
  476. reqbean.setRstarttime(starttime);
  477. reqbean.setRendtime(endtime);
  478. List reqList = affairdao.myarrairList(currentPage,count,reqbean,request);
  479. String sql =""; 
  480. String centent = "";
  481. String path = request.getContextPath()+"/affairReq.do?task=getmyaffair&";
  482. sql ="select count(*)  from transreq a left join transtype b on b.rtid = a.tno ";
  483. sql =sql +" left join tuser c on c.uno = a.uno   where c.uno =  '"+user.getUno()+"'";
  484. if(rgrade !=null && !rgrade.trim().equals("")){
  485. centent=centent+" and a.rgrade ='"+rgrade.trim()+"'";
  486. path = path+"rgrade="+rgrade+"&";
  487. }
  488. if(starttime!=null &&!starttime.trim().equals("")){
  489. centent=centent+" and a.rlasttime between'"+starttime.trim()+"'";
  490. centent=centent+" and '"+endtime.trim()+"'";
  491. path = path+"starttime="+starttime+"&";
  492. path = path+"endtime="+endtime+"&";
  493. }
  494. sql =sql +centent;
  495. ReqPage reqpages = reqpage.getPage(currentPage,count,sql);
  496. reqpages.setPath(path);
  497. request.setAttribute("reqLists",reqList);
  498. request.setAttribute("reqpage", reqpages);
  499. request.setAttribute("flag", "2");
  500. return mapping.findForward("getmyaffair");
  501. } else {
  502. out.print("<script>alert('登录时间过期,请重新登录');"
  503. + "window.top.location.href='" + request.getContextPath()
  504. + "/Jsp_file/login/login.jsp';");
  505. out.print("</script>");
  506. }
  507. return null;
  508. }
  509. public ActionForward myaffair(
  510. ActionMapping mapping,
  511. ActionForm form,
  512. HttpServletRequest request,
  513. HttpServletResponse response) throws ServletException, IOException {
  514. AffairReqForm affairReqForm = (AffairReqForm) form;
  515. request.setCharacterEncoding("GBK");
  516. response.setCharacterEncoding("GBK");
  517. HttpSession httpsession  = request.getSession();
  518. Tuser user = (Tuser)httpsession.getAttribute("user");
  519. PrintWriter out = null;
  520. try {
  521. out = response.getWriter();
  522. } catch (IOException e1) {
  523. // TODO 自动生成 catch 块
  524. e1.printStackTrace();
  525. }
  526. if (user != null) {
  527. int currentPage = 1;
  528. try {
  529. currentPage = Integer.parseInt(request.getParameter("currentPage"));
  530. } catch (Exception e) {
  531. currentPage = 1;
  532. }
  533. int count = 10;
  534. String username = request.getParameter("reqUsername");
  535. String rgrade = request.getParameter("rgrade");
  536. String starttime = request.getParameter("starttime");
  537. String endtime = request.getParameter("endtime");
  538. request.setAttribute("uno",user.getUno());
  539. Transreq reqbean = new Transreq();
  540. reqbean.setReqUsername(username);
  541. reqbean.setRstatus(rgrade);
  542. reqbean.setRstarttime(starttime);
  543. reqbean.setRendtime(endtime);
  544. List reqList = affairdao.myreqList(currentPage,count,reqbean,request);
  545. String sql =""; 
  546. String centent = "";
  547. String path = request.getContextPath()+"/affairReq.do?task=myaffair&";
  548. sql ="select count(*) from transstep a ";
  549. sql =sql + " left join transreq b on a.rqid = b.rqid  ";
  550. sql =sql + " left join tuser c on b.uno = c.uno   ";
  551. sql =sql +" left join transtype d on d.rtid = b.tno  where a.sstatus<>'0'  and c.uno = '"+user.getUno()+"'";
  552. if(username!=null&&!username.trim().equals("")){
  553. centent=centent+" and c.utruename like '%"+username.trim()+"%'";
  554. path = path+"reqUsername="+username+"&";
  555. }
  556. if(rgrade !=null && !rgrade.trim().equals("")){
  557. centent=centent+" and b.rgrade ='"+rgrade.trim()+"'";
  558. path = path+"rgrade="+rgrade+"&";
  559. }
  560. if(starttime!=null &&!starttime.trim().equals("")){
  561. centent=centent+" and b.rlasttime between'"+starttime.trim()+"'";
  562. centent=centent+" and '"+endtime.trim()+"'";
  563. path = path+"starttime="+starttime+"&";
  564. path = path+"endtime="+endtime+"&";
  565. }
  566. sql =sql +centent;
  567. ReqPage reqpages = reqpage.getPage(currentPage,count,sql);
  568. reqpages.setPath(path);
  569. request.setAttribute("reqList",reqList);
  570. request.setAttribute("reqpage", reqpages);
  571. return mapping.findForward("getmyaffair");
  572. } else {
  573. out.print("<script>alert('登录时间过期,请重新登录');"
  574. + "window.top.location.href='" + request.getContextPath()
  575. + "/Jsp_file/login/login.jsp';");
  576. out.print("</script>");
  577. }
  578. return null;
  579. }
  580. public ActionForward showmyaffair(
  581. ActionMapping mapping,
  582. ActionForm form,
  583. HttpServletRequest request,
  584. HttpServletResponse response) {
  585. AffairReqForm affairReqForm = (AffairReqForm) form;
  586. String rqid = request.getParameter("rqid");
  587. String currentid = request.getParameter("currentid");
  588. PrintWriter out = null;
  589. try {
  590. out = response.getWriter();
  591. } catch (IOException e1) {
  592. // TODO 自动生成 catch 块
  593. e1.printStackTrace();
  594. }
  595. HttpSession httpsession  = request.getSession();
  596. Tuser user = (Tuser)httpsession.getAttribute("user");
  597. if (user != null) {
  598. List auditlist = affairdao.getaudit(request);
  599. request.setAttribute("audit", auditlist);
  600. request.setAttribute("rqid",rqid);
  601. request.setAttribute("currentid",currentid);
  602. return new ActionForward("/Jsp_file/affair/affairdetail.jsp");
  603. } else {
  604. out.print("<script>alert('登录时间过期,请重新登录');"
  605. + "window.top.location.href='" + request.getContextPath()
  606. + "/Jsp_file/login/login.jsp';");
  607. out.print("</script>");
  608. }
  609. return null;
  610. }
  611. public IAffair getAffairdao() {
  612. return affairdao;
  613. }
  614. public void setAffairdao(IAffair affairdao) {
  615. this.affairdao = affairdao;
  616. }
  617. public ReqPage getReqpage() {
  618. return reqpage;
  619. }
  620. public void setReqpage(ReqPage reqpage) {
  621. this.reqpage = reqpage;
  622. }
  623. }