期刊论文在线投稿审稿系统③(校稿人功能页)
一、'格式审查'功能
二、效果如下
三、代码如下
Proofread.jsp
1 <%@ page language="java" contentType="text/html; charset=UTF-8" 2 pageEncoding="UTF-8"%> 3 <!DOCTYPE html> 4 <html> 5 <head> 6 <meta charset="UTF-8"> 7 <title>校稿人功能页</title> 8 <link rel="stylesheet" href=".//layui/css/layui.css" media="all"> 9 <script src=".//layui/layui.all.js"></script> 10 <script src=".//layui/layui.js"></script> 11 <script type="text/javascript"> 12 //JavaScript代码区域 13 layui.use('element', function() { 14 var element = layui.element; 15 }); 16 </script> 17 </head> 18 <body class="layui-layout-body"> 19 20 <div class="layui-layout layui-layout-admin"> 21 <div class="layui-header"> 22 <div class="layui-logo"> 23 <% 24 String identity = (String) session.getAttribute("identity"); 25 out.print(identity); 26 %> 27 功能页欢迎 28 <% 29 String username = (String) session.getAttribute("username"); 30 out.print(username); 31 %> 32 </div> 33 <!-- 水平导航 --> 34 <ul class="layui-nav layui-layout-right"> 35 <li class="layui-nav-item "><a href="index.jsp">退出</a></li> 36 </ul> 37 </div> 38 39 <div class="layui-side layui-bg-black"> 40 <div class="layui-side-scroll"> 41 <!-- 左侧导航 --> 42 <ul class="layui-nav layui-nav-tree"> 43 <li class="layui-nav-item"><a href="ProofreadServlet?method=geshishencha" target="frame">格式审查</a></li> 44 <li class="layui-nav-item"><a href="ProofreadServlet?method=neirongchachong" 45 target="frame">内容查重</a></li> 46 <li class="layui-nav-item"><a href="ProofreadServlet?method=shengaoliucheng" 47 target="frame">审稿流程</a></li> 48 </ul> 49 </div> 50 </div> 51 <div class="layui-body"> 52 <!-- 内容主体区域 --> 53 <iframe name="frame" width="100%" height="100%" 54 style="border: 1px solid #CCC;"></iframe> 55 </div> 56 <div> 57 <div> 58 <input type="text" id="date" /> 59 </div> 60 </div> 61 </div> 62 63 </body> 64 </html>
Proofread_geshishencha.jsp
1 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 2 <%@ page language="java" contentType="text/html; charset=UTF-8" 3 pageEncoding="UTF-8"%> 4 <!DOCTYPE html> 5 <html> 6 <head> 7 <meta charset="UTF-8"> 8 <title>格式审查</title> 9 <link rel="stylesheet" href=".//layui/css/layui.css" media="all"> 10 <script src=".//layui/layui.all.js"></script> 11 <script src=".//layui/layui.js"></script> 12 </head> 13 <body> 14 <table class="layui-table"> 15 <colgroup> 16 <col width="150"> 17 <col width="200"> 18 <col> 19 </colgroup> 20 <thead> 21 <tr> 22 <th>id</th> 23 <th>中文标题</th> 24 <th>英文标题</th> 25 <th>投稿人</th> 26 <th>操作</th> 27 </tr> 28 </thead> 29 <tbody> 30 <c:forEach items="${list}" var="story" varStatus="status"> 31 <tr> 32 <td>${ status.index + 1}</td> 33 <td>${story.ctitle}</td> 34 <td>${story.etitle}</td> 35 <td>${story.name}</td> 36 <td><button class="layui-btn layui-btn-normal" 37 onclick="window.location.href='ProofreadServlet?method=check&ctitle=${story.ctitle}'">审查</button></td> 38 </tr> 39 </c:forEach> 40 </tbody> 41 </table> 42 </body> 43 </html>
Proofread_geshishencha_check.jsp
1 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 2 <%@ page language="java" contentType="text/html; charset=UTF-8" 3 pageEncoding="UTF-8"%> 4 <!DOCTYPE html> 5 <html> 6 <head> 7 <meta charset="UTF-8"> 8 <title>格式审查</title> 9 <link rel="stylesheet" href=".//layui/css/layui.css" media="all"> 10 <script src=".//layui/layui.all.js"></script> 11 <script src=".//layui/layui.js"></script> 12 </head> 13 <body> 14 <form class="layui-form" action="ProofreadServlet?method=checkResult" 15 method="post"> 16 <c:forEach items="${list}" var="story"> 17 <div class="layui-form-item"> 18 <label class="layui-form-label">中文标题</label> 19 <div class="layui-input-block"> 20 <input type="text" name="ctitle" required lay-verify="required" 21 placeholder="请输入中文标题" autocomplete="off" class="layui-input" 22 value="${story.ctitle}"> <input type="text" 23 name="judgectitle" required lay-verify="required" 24 placeholder="请输入中文标题" autocomplete="off" class="layui-input" 25 value="${story.ctitle}"> 26 </div> 27 <div class="layui-form-mid layui-word-aux">(限100字以内)</div> 28 </div> 29 <div class="layui-form-item layui-form-text"> 30 <label class="layui-form-label">英文标题</label> 31 <div class="layui-input-block"> 32 <input type="text" name="etitle" required lay-verify="required" 33 placeholder="请输入英文标题" autocomplete="off" class="layui-input" 34 value="${story.etitle}"> 35 </div> 36 <div class="layui-form-mid layui-word-aux">(限400个字符以内)</div> 37 </div> 38 <div class="layui-form-item"> 39 <label class="layui-form-label">中文摘要</label> 40 <div class="layui-inline"> 41 <input type="text" name="cabstract" required lay-verify="required" 42 placeholder="请输入中文摘要" autocomplete="off" class="layui-input" 43 value="${story.cabstract}"> 44 </div> 45 <div class="layui-form-mid layui-word-aux">(限300字以内)</div> 46 </div> 47 <div class="layui-form-item"> 48 <label class="layui-form-label">英文摘要</label> 49 <div class="layui-inline"> 50 <input type="text" name="eabstract" required lay-verify="required" 51 placeholder="请输入英文摘要" autocomplete="off" class="layui-input" 52 value="${story.eabstract}"> 53 </div> 54 <div class="layui-form-mid layui-word-aux">(限3000字符以内)</div> 55 </div> 56 <div class="layui-form-item"> 57 <label class="layui-form-label">中文关键字</label> 58 <div class="layui-inline"> 59 <input type="text" name="ckey" required lay-verify="required" 60 placeholder="请输入中文关键字" autocomplete="off" class="layui-input" 61 value="${story.ckey}"> 62 </div> 63 <div class="layui-form-mid layui-word-aux">(限100字以内)</div> 64 </div> 65 <div class="layui-form-item"> 66 <label class="layui-form-label">英文关键字</label> 67 <div class="layui-inline"> 68 <input type="text" name="ekey" required lay-verify="required" 69 placeholder="请输入英文关键字" autocomplete="off" class="layui-input" 70 value="${story.ekey}"> 71 </div> 72 <div class="layui-form-mid layui-word-aux">(限200个字符以内)</div> 73 </div> 74 <div class="layui-form-item layui-form-text"> 75 <label class="layui-form-label">稿件正文</label> 76 <div class="layui-input-block"> 77 <textarea name="content" placeholder="请输入稿件正文" 78 class="layui-textarea">${story.content}</textarea> 79 </div> 80 </div> 81 <div class="layui-form-item"> 82 <label class="layui-form-label">投稿人</label> 83 <div class="layui-input-block"> 84 <input type="text" name="name" required lay-verify="required" 85 placeholder="请输入您的账号" autocomplete="off" class="layui-input" 86 value="${story.name}"> 87 </div> 88 </div> 89 <div class="layui-form-item"> 90 <label class="layui-form-label">是否同意</label> 91 <div class="layui-input-block"> 92 <input type="radio" name="shenqianAgree" value="同意" title="同意" 93 checked> <input type="radio" name="shenqianAgree" 94 value="不同意" title="不同意"> 95 </div> 96 </div> 97 <div class="layui-form-item layui-form-text"> 98 <label class="layui-form-label">意见</label> 99 <div class="layui-input-block"> 100 <textarea name="shenqianOpinion" placeholder="请输入您的意见" 101 class="layui-textarea"></textarea> 102 </div> 103 </div> 104 <div class="layui-form-item"> 105 <div class="layui-input-block"> 106 <button class="layui-btn" lay-submit>修改</button> 107 <button type="reset" class="layui-btn layui-btn-primary">重置</button> 108 </div> 109 </div> 110 </c:forEach> 111 </form> 112 </body> 113 </html>
Proofread_neirongchachong.jsp
1 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 2 <%@ page language="java" contentType="text/html; charset=UTF-8" 3 pageEncoding="UTF-8"%> 4 <!DOCTYPE html> 5 <html> 6 <head> 7 <meta charset="UTF-8"> 8 <title>内容查重</title> 9 <link rel="stylesheet" href=".//layui/css/layui.css" media="all"> 10 <script src=".//layui/layui.all.js"></script> 11 <script src=".//layui/layui.js"></script> 12 </head> 13 <body> 14 <table class="layui-table"> 15 <colgroup> 16 <col width="150"> 17 <col width="200"> 18 <col> 19 </colgroup> 20 <thead> 21 <tr> 22 <th>id</th> 23 <th>中文标题</th> 24 <th>英文标题</th> 25 <th>投稿人</th> 26 <th>操作</th> 27 </tr> 28 </thead> 29 <tbody> 30 <c:forEach items="${list}" var="story" varStatus="status"> 31 <tr> 32 <td>${ status.index + 1}</td> 33 <td>${story.ctitle}</td> 34 <td>${story.etitle}</td> 35 <td>${story.name}</td> 36 <td><button class="layui-btn layui-btn-normal" 37 onclick="window.location.href='ProofreadServlet?method=neirong_check&ctitle=${story.ctitle}'">点击详情</button></td> 38 </tr> 39 </c:forEach> 40 </tbody> 41 </table> 42 </body> 43 </html>
Proofread_neirongchachong_check.jsp
1 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 2 <%@ page language="java" contentType="text/html; charset=UTF-8" 3 pageEncoding="UTF-8"%> 4 <!DOCTYPE html> 5 <html> 6 <head> 7 <meta charset="UTF-8"> 8 <title>内容查重</title> 9 <link rel="stylesheet" href=".//layui/css/layui.css" media="all"> 10 <script src=".//layui/layui.all.js"></script> 11 <script src=".//layui/layui.js"></script> 12 </head> 13 <body> 14 <form class="layui-form" 15 action="ProofreadServlet?method=neirong_checkResult" method="post"> 16 <c:forEach items="${list}" var="story"> 17 <div class="layui-form-item"> 18 <label class="layui-form-label">中文标题</label> 19 <div class="layui-input-block"> 20 <input type="text" name="ctitle" required lay-verify="required" 21 placeholder="请输入中文标题" autocomplete="off" class="layui-input" 22 value="${story.ctitle}"> <input type="text" 23 name="judgectitle" required lay-verify="required" 24 placeholder="请输入中文标题" autocomplete="off" class="layui-input" 25 value="${story.ctitle}"> 26 </div> 27 <div class="layui-form-mid layui-word-aux">(限100字以内)</div> 28 </div> 29 <div class="layui-form-item layui-form-text"> 30 <label class="layui-form-label">英文标题</label> 31 <div class="layui-input-block"> 32 <input type="text" name="etitle" required lay-verify="required" 33 placeholder="请输入英文标题" autocomplete="off" class="layui-input" 34 value="${story.etitle}"> 35 </div> 36 <div class="layui-form-mid layui-word-aux">(限400个字符以内)</div> 37 </div> 38 <div class="layui-form-item"> 39 <label class="layui-form-label">中文摘要</label> 40 <div class="layui-inline"> 41 <input type="text" name="cabstract" required lay-verify="required" 42 placeholder="请输入中文摘要" autocomplete="off" class="layui-input" 43 value="${story.cabstract}"> 44 </div> 45 <div class="layui-form-mid layui-word-aux">(限300字以内)</div> 46 </div> 47 <div class="layui-form-item"> 48 <label class="layui-form-label">英文摘要</label> 49 <div class="layui-inline"> 50 <input type="text" name="eabstract" required lay-verify="required" 51 placeholder="请输入英文摘要" autocomplete="off" class="layui-input" 52 value="${story.eabstract}"> 53 </div> 54 <div class="layui-form-mid layui-word-aux">(限3000字符以内)</div> 55 </div> 56 <div class="layui-form-item"> 57 <label class="layui-form-label">中文关键字</label> 58 <div class="layui-inline"> 59 <input type="text" name="ckey" required lay-verify="required" 60 placeholder="请输入中文关键字" autocomplete="off" class="layui-input" 61 value="${story.ckey}"> 62 </div> 63 <div class="layui-form-mid layui-word-aux">(限100字以内)</div> 64 </div> 65 <div class="layui-form-item"> 66 <label class="layui-form-label">英文关键字</label> 67 <div class="layui-inline"> 68 <input type="text" name="ekey" required lay-verify="required" 69 placeholder="请输入英文关键字" autocomplete="off" class="layui-input" 70 value="${story.ekey}"> 71 </div> 72 <div class="layui-form-mid layui-word-aux">(限200个字符以内)</div> 73 </div> 74 <div class="layui-form-item layui-form-text"> 75 <label class="layui-form-label">稿件正文</label> 76 <div class="layui-input-block"> 77 <textarea name="content" placeholder="请输入稿件正文" 78 class="layui-textarea">${story.content}</textarea> 79 </div> 80 </div> 81 <div class="layui-form-item"> 82 <label class="layui-form-label">投稿人</label> 83 <div class="layui-input-block"> 84 <input type="text" name="name" required lay-verify="required" 85 placeholder="请输入您的账号" autocomplete="off" class="layui-input" 86 value="${story.name}"> 87 </div> 88 </div> 89 <div class="layui-form-item"> 90 <label class="layui-form-label">是否合格</label> 91 <div class="layui-input-block"> 92 <input type="radio" name="chachongResult" value="合格" title="合格"> 93 <input type="radio" name="chachongResult" value="不合格" title="不合格"> 94 </div> 95 </div> 96 <div class="layui-form-item"> 97 <div class="layui-input-block"> 98 <button class="layui-btn" lay-submit>提交</button> 99 <button type="reset" class="layui-btn layui-btn-primary">重置</button> 100 </div> 101 </div> 102 </c:forEach> 103 </form> 104 </body> 105 </html>
Proofread_shengaoliucheng.jsp
1 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 2 <%@ page language="java" contentType="text/html; charset=UTF-8" 3 pageEncoding="UTF-8"%> 4 <!DOCTYPE html> 5 <html> 6 <head> 7 <meta charset="UTF-8"> 8 <title>审稿流程</title> 9 <link rel="stylesheet" href=".//layui/css/layui.css" media="all"> 10 <script src=".//layui/layui.all.js"></script> 11 <script src=".//layui/layui.js"></script> 12 </head> 13 <body> 14 <table class="layui-table"> 15 <colgroup> 16 <col width="150"> 17 <col width="200"> 18 <col> 19 </colgroup> 20 <thead> 21 <tr> 22 <th>id</th> 23 <th>中文标题</th> 24 <th>英文标题</th> 25 <th>投稿人</th> 26 <th>操作</th> 27 </tr> 28 </thead> 29 <tbody> 30 <c:forEach items="${list}" var="story" varStatus="status"> 31 <tr> 32 <td>${ status.index + 1}</td> 33 <td>${story.ctitle}</td> 34 <td>${story.etitle}</td> 35 <td>${story.name}</td> 36 <td><button class="layui-btn layui-btn-normal" 37 onclick="window.location.href='ProofreadServlet?method=shengao_check&ctitle=${story.ctitle}'">选择对应的审稿人</button></td> 38 </tr> 39 </c:forEach> 40 </tbody> 41 </table> 42 </body> 43 </html>
Proofread_shengaoliucheng_choose.jsp
1 <%@page import="util.User"%> 2 <%@ page language="java" contentType="text/html; charset=UTF-8" 3 pageEncoding="UTF-8" import="java.util.*"%> 4 <!DOCTYPE html> 5 <html> 6 <head> 7 <meta charset="UTF-8"> 8 <title>审稿流程</title> 9 <script src=".//layui/layui.js"></script> 10 <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script> 11 <meta name="renderer" content="webkit"> 12 <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 13 <meta name="viewport" 14 content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0"> 15 <link rel="stylesheet" href=".//layui/css/layui.css" media="all"> 16 <link rel="stylesheet" href=".//style/admin.css" media="all"> 17 <link rel="stylesheet" href=".//style/login.css" media="all"> 18 </head> 19 <body> 20 <form action="ProofreadServlet?method=shengao_choose" method="post"> 21 <div class="layadmin-user-login layadmin-user-display-show" 22 id="LAY-user-login" style="display: none;"> 23 <div class="layadmin-user-login-main"> 24 <div class="layadmin-user-login-box layadmin-user-login-header"> 25 <h2>请选择审稿人</h2> 26 </div> 27 <div 28 class="layadmin-user-login-box layadmin-user-login-body layui-form"> 29 <div class="layui-form-item"> 30 <label class="layui-form-label">审稿人1</label> 31 <div class="layui-input-inline"> 32 <select name="name1"> 33 <option value="">请选择</option> 34 <% 35 List<User> user = (List) session.getAttribute("List"); 36 for (User u : user) { 37 %> 38 <option value="<%=u.getName()%>"><%=u.getName()%></option> 39 <% 40 } 41 %> 42 </select> 43 </div> 44 </div> 45 <div class="layui-form-item"> 46 <label class="layui-form-label">审稿人2</label> 47 <div class="layui-input-inline"> 48 <select name="name2"> 49 <option value="">请选择</option> 50 <% 51 List<User> user1 = (List) session.getAttribute("List"); 52 for (User u : user1) { 53 %> 54 <option value="<%=u.getName()%>"><%=u.getName()%></option> 55 <% 56 } 57 %> 58 </select> 59 </div> 60 </div> 61 <div class="layui-form-item"> 62 <label class="layui-form-label">审稿人3</label> 63 <div class="layui-input-inline"> 64 <select name="name3"> 65 <option value="">请选择</option> 66 <% 67 List<User> user2 = (List) session.getAttribute("List"); 68 for (User u : user) { 69 %> 70 <option value="<%=u.getName()%>"><%=u.getName()%></option> 71 <% 72 } 73 %> 74 </select> 75 </div> 76 </div> 77 <div class="layui-form-item"> 78 <div class="layui-input-block"> 79 <button class="layui-btn" lay-submit>确认提交</button> 80 <button type="reset" class="layui-btn layui-btn-primary">重置</button> 81 </div> 82 </div> 83 </div> 84 </div> 85 </div> 86 </form> 87 </body> 88 </html>
ProofreadServlet.java(在servlet文件下建立此java文件)
1 package servlet; 2 3 import java.io.IOException; 4 import java.util.List; 5 6 import javax.servlet.ServletException; 7 import javax.servlet.annotation.WebServlet; 8 import javax.servlet.http.HttpServlet; 9 import javax.servlet.http.HttpServletRequest; 10 import javax.servlet.http.HttpServletResponse; 11 import javax.servlet.http.HttpSession; 12 import javax.swing.JOptionPane; 13 14 import dao.ProofreadDao; 15 import util.Story; 16 import util.User; 17 18 /** 19 * Servlet implementation class ProofreadServlet 20 */ 21 @WebServlet("/ProofreadServlet") 22 public class ProofreadServlet extends HttpServlet { 23 private static final long serialVersionUID = 1L; 24 25 /** 26 * @see HttpServlet#HttpServlet() 27 */ 28 public ProofreadServlet() { 29 super(); 30 // TODO Auto-generated constructor stub 31 } 32 33 ProofreadDao dao = new ProofreadDao(); 34 35 /** 36 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse 37 * response) 38 */ 39 protected void doGet(HttpServletRequest request, HttpServletResponse response) 40 throws ServletException, IOException { 41 // TODO Auto-generated method stub 42 // response.getWriter().append("Served at: ").append(request.getContextPath()); 43 doPost(request, response); 44 } 45 46 /** 47 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse 48 * response) 49 */ 50 protected void doPost(HttpServletRequest request, HttpServletResponse response) 51 throws ServletException, IOException { 52 // TODO Auto-generated method stub 53 // doGet(request, response); 54 request.setCharacterEncoding("utf-8"); 55 response.setCharacterEncoding("utf-8"); 56 57 System.out.println("进入ContributeServlet"); 58 String method = request.getParameter("method"); 59 System.out.println(method); 60 if ("geshishencha".equals(method)) { 61 geshishencha(request, response);// 格式审查 62 } else if ("check".equals(method)) { 63 check(request, response);// 审查 64 } else if ("checkResult".equals(method)) { 65 checkResult(request, response); 66 } else if ("neirongchachong".equals(method)) { 67 neirongchachong(request, response);// 内容查重 68 } else if ("neirong_check".equals(method)) { 69 neirong_check(request, response); 70 } else if ("neirong_checkResult".equals(method)) { 71 neirong_checkResult(request, response); 72 } else if ("shengaoliucheng".equals(method)) { 73 shengaoliucheng(request, response); 74 } else if ("shengao_check".equals(method)) { 75 shengao_check(request, response); 76 } else if ("shengao_choose".equals(method)) { 77 shengao_choose(request, response); 78 } 79 } 80 81 public void geshishencha(HttpServletRequest request, HttpServletResponse response) 82 throws ServletException, IOException { 83 response.setCharacterEncoding("UTF-8"); 84 request.setCharacterEncoding("UTF-8"); 85 86 System.out.println("进入geshishencha"); 87 List<Story> list = dao.geshishencha(); 88 request.setAttribute("list", list); 89 request.getRequestDispatcher("Proofread_geshishencha.jsp").forward(request, response); 90 91 } 92 93 public void check(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { 94 response.setCharacterEncoding("UTF-8"); 95 request.setCharacterEncoding("UTF-8"); 96 97 String ctitle = request.getParameter("ctitle"); 98 List<Story> list = dao.check(ctitle); 99 request.setAttribute("list", list); 100 request.getRequestDispatcher("Proofread_geshishencha_check.jsp").forward(request, response); 101 102 } 103 104 public void checkResult(HttpServletRequest request, HttpServletResponse response) 105 throws ServletException, IOException { 106 response.setCharacterEncoding("UTF-8"); 107 request.setCharacterEncoding("UTF-8"); 108 109 String ctitle = request.getParameter("judgectitle"); 110 String shenqianAgree = request.getParameter("shenqianAgree"); 111 String shenqianOpinion = request.getParameter("shenqianOpinion"); 112 113 if (dao.checkResult(ctitle, shenqianAgree, shenqianOpinion)) { 114 JOptionPane.showMessageDialog(null, "审查成功", "success", JOptionPane.PLAIN_MESSAGE); 115 request.getRequestDispatcher("ProofreadServlet?method=geshishencha").forward(request, response); 116 } else { 117 request.getRequestDispatcher("TestFail.jsp").forward(request, response); 118 } 119 120 } 121 122 public void neirongchachong(HttpServletRequest request, HttpServletResponse response) 123 throws ServletException, IOException { 124 response.setCharacterEncoding("UTF-8"); 125 request.setCharacterEncoding("UTF-8"); 126 127 List<Story> list = dao.neirongchachong(); 128 request.setAttribute("list", list); 129 request.getRequestDispatcher("Proofread_neirongchachong.jsp").forward(request, response); 130 131 } 132 133 public void neirong_check(HttpServletRequest request, HttpServletResponse response) 134 throws ServletException, IOException { 135 response.setCharacterEncoding("UTF-8"); 136 request.setCharacterEncoding("UTF-8"); 137 138 String ctitle = request.getParameter("ctitle"); 139 List<Story> list = dao.check(ctitle); 140 request.setAttribute("list", list); 141 request.getRequestDispatcher("Proofread_neirongchachong_check.jsp").forward(request, response); 142 143 } 144 145 public void neirong_checkResult(HttpServletRequest request, HttpServletResponse response) 146 throws ServletException, IOException { 147 response.setCharacterEncoding("UTF-8"); 148 request.setCharacterEncoding("UTF-8"); 149 150 String ctitle = request.getParameter("judgectitle"); 151 String chachongResult = request.getParameter("chachongResult"); 152 153 if (dao.neirong_checkResult(ctitle, chachongResult)) { 154 request.getRequestDispatcher("ProofreadServlet?method=neirongchachong").forward(request, response); 155 } else { 156 request.getRequestDispatcher("TestFail.jsp").forward(request, response); 157 } 158 159 } 160 161 public void shengaoliucheng(HttpServletRequest request, HttpServletResponse response) 162 throws ServletException, IOException { 163 response.setCharacterEncoding("UTF-8"); 164 request.setCharacterEncoding("UTF-8"); 165 166 List<Story> list = dao.shengaoliucheng(); 167 request.setAttribute("list", list); 168 request.getRequestDispatcher("Proofread_shengaoliucheng.jsp").forward(request, response); 169 170 } 171 172 public void shengao_check(HttpServletRequest request, HttpServletResponse response) 173 throws ServletException, IOException { 174 response.setCharacterEncoding("UTF-8"); 175 request.setCharacterEncoding("UTF-8"); 176 177 String ctitle = request.getParameter("ctitle"); 178 179 // 使用request对象的getSession()获取session,如果session不存在则创建一个 180 HttpSession session = request.getSession(); 181 // 将数据存储到session中 182 session.setAttribute("ctitle", ctitle); 183 184 List<User> list = dao.shengaoliucheng_check("审稿人"); 185 session.setAttribute("List", list); 186 187 request.getRequestDispatcher("Proofread_shengaoliucheng_choose.jsp").forward(request, response); 188 189 } 190 191 public void shengao_choose(HttpServletRequest request, HttpServletResponse response) 192 throws ServletException, IOException { 193 response.setCharacterEncoding("UTF-8"); 194 request.setCharacterEncoding("UTF-8"); 195 196 String name1 = request.getParameter("name1"); 197 String name2 = request.getParameter("name2"); 198 String name3 = request.getParameter("name3"); 199 200 System.out.println(name1 + "," + name2 + "," + name3); 201 202 if (name1.equals(name2) || name1.equals(name3) || name2.equals(name3)) { 203 JOptionPane.showMessageDialog(null, "不能选择相同的审稿人,请重新进行选择!!", "ERROR", JOptionPane.PLAIN_MESSAGE); 204 request.getRequestDispatcher("ProofreadServlet?method=shengaoliucheng").forward(request, response); 205 } else { 206 HttpSession session = request.getSession(); 207 String ctitle = (String) session.getAttribute("ctitle"); 208 if (dao.shengao_choose(ctitle, name1, name2, name3)) { 209 JOptionPane.showMessageDialog(null, "选择审稿人成功!", "SUCCESS", JOptionPane.PLAIN_MESSAGE); 210 request.getRequestDispatcher("ProofreadServlet?method=shengaoliucheng").forward(request, response); 211 } else { 212 request.getRequestDispatcher("TestFail.jsp").forward(request, response); 213 } 214 } 215 216 } 217 }
ProofreadDao.java(在dao文件下建立此java文件)
1 package dao; 2 3 import java.sql.Connection; 4 import java.sql.PreparedStatement; 5 import java.sql.ResultSet; 6 import java.util.ArrayList; 7 import java.util.List; 8 9 import databse.Database; 10 import util.Story; 11 import util.User; 12 13 public class ProofreadDao { 14 /** 15 * 格式审查 16 * @return 17 */ 18 public List<Story> geshishencha() { 19 List<Story> list = new ArrayList<>(); 20 Connection conn = null; 21 ResultSet rs = null; 22 PreparedStatement pstm = null; 23 Story story = null; 24 try { 25 conn = Database.getConnection(); 26 String sql = "select * from story where receiver=?"; 27 pstm = conn.prepareStatement(sql); 28 pstm.setString(1, "格式审查中"); 29 rs = pstm.executeQuery(); 30 while (rs.next()) { 31 String ctitle = rs.getString("ctitle"); 32 String etitle = rs.getString("etitle"); 33 String cabstract = rs.getString("cabstract"); 34 String eabstract = rs.getString("eabstract"); 35 String ckey = rs.getString("ckey"); 36 String ekey = rs.getString("ekey"); 37 String content = rs.getString("content"); 38 String receiver = rs.getString("receiver"); 39 String status = rs.getString("status"); 40 String name = rs.getString("name"); 41 story = new Story(ctitle, etitle, cabstract, eabstract, ckey, ekey, content, receiver, status, name); 42 list.add(story); 43 } 44 } catch (Exception e) { 45 e.printStackTrace(); 46 } finally { 47 Database.close(conn, pstm, rs); 48 } 49 return list; 50 } 51 public List<Story> check(String ctitle) { 52 List<Story> list = new ArrayList<>(); 53 Connection conn = null; 54 ResultSet rs = null; 55 PreparedStatement pstm = null; 56 Story story = null; 57 try { 58 conn = Database.getConnection(); 59 String sql = "select * from story where ctitle=?"; 60 pstm = conn.prepareStatement(sql); 61 pstm.setString(1, ctitle); 62 rs = pstm.executeQuery(); 63 while (rs.next()) { 64 String ctitlee = rs.getString("ctitle"); 65 String etitle = rs.getString("etitle"); 66 String cabstract = rs.getString("cabstract"); 67 String eabstract = rs.getString("eabstract"); 68 String ckey = rs.getString("ckey"); 69 String ekey = rs.getString("ekey"); 70 String content = rs.getString("content"); 71 String receiver = rs.getString("receiver"); 72 String status = rs.getString("status"); 73 String name = rs.getString("name"); 74 story = new Story(ctitlee, etitle, cabstract, eabstract, ckey, ekey, content, receiver, status, name); 75 list.add(story); 76 } 77 } catch (Exception e) { 78 e.printStackTrace(); 79 } finally { 80 Database.close(conn, pstm, rs); 81 } 82 return list; 83 } 84 85 public boolean checkResult(String ctitle, String shenqianAgree, String shenqianOpinion) { 86 Connection conn = null; 87 PreparedStatement pstm = null; 88 PreparedStatement pstm1 = null; 89 boolean judge = false; 90 String receiver; 91 try { 92 if(shenqianAgree.equals("同意")) { 93 receiver = "审签同意"; 94 }else { 95 receiver = "审签不同意"; 96 } 97 conn = Database.getConnection(); 98 String sql = "update story set receiver=? where ctitle=?"; 99 String sql1 = "update storysituation set shenqianAgree=?,shenqianOpinion=?,receiver=? where ctitle=?"; 100 pstm = conn.prepareStatement(sql); 101 pstm.setString(1, receiver); 102 pstm.setString(2, ctitle); 103 pstm1 = conn.prepareStatement(sql1); 104 pstm1.setString(1, shenqianAgree); 105 pstm1.setString(2, shenqianOpinion); 106 pstm1.setString(3, receiver); 107 pstm1.setString(4, ctitle); 108 // 执行插入操作 109 int num = pstm.executeUpdate(); 110 int num1 = pstm1.executeUpdate(); 111 if (num > 0 & num1 > 0) { 112 System.out.println("审签成功"); 113 judge = true; 114 } else { 115 System.out.println("审签失败"); 116 judge = false; 117 } 118 } catch (Exception e) { 119 e.printStackTrace(); 120 } finally { 121 // SQL执行完成后释放相关资源 122 Database.close(conn, pstm); 123 } 124 return judge; 125 } 126 /** 127 * 内容查重 128 * @return 129 */ 130 public List<Story> neirongchachong() { 131 List<Story> list = new ArrayList<>(); 132 Connection conn = null; 133 ResultSet rs = null; 134 PreparedStatement pstm = null; 135 Story story = null; 136 try { 137 conn = Database.getConnection(); 138 String sql = "select * from story where receiver=?"; 139 pstm = conn.prepareStatement(sql); 140 pstm.setString(1, "审签同意"); 141 rs = pstm.executeQuery(); 142 while (rs.next()) { 143 String ctitle = rs.getString("ctitle"); 144 String etitle = rs.getString("etitle"); 145 String cabstract = rs.getString("cabstract"); 146 String eabstract = rs.getString("eabstract"); 147 String ckey = rs.getString("ckey"); 148 String ekey = rs.getString("ekey"); 149 String content = rs.getString("content"); 150 String receiver = rs.getString("receiver"); 151 String status = rs.getString("status"); 152 String name = rs.getString("name"); 153 story = new Story(ctitle, etitle, cabstract, eabstract, ckey, ekey, content, receiver, status, name); 154 list.add(story); 155 } 156 } catch (Exception e) { 157 e.printStackTrace(); 158 } finally { 159 Database.close(conn, pstm, rs); 160 } 161 return list; 162 } 163 public boolean neirong_checkResult(String ctitle, String chachongResult) { 164 Connection conn = null; 165 PreparedStatement pstm = null; 166 PreparedStatement pstm1 = null; 167 boolean judge = false; 168 String receiver; 169 try { 170 if(chachongResult.equals("合格")) { 171 receiver = "内容查重合格"; 172 }else { 173 receiver = "内容查重不合格"; 174 } 175 conn = Database.getConnection(); 176 String sql = "update story set receiver=? where ctitle=?"; 177 String sql1 = "update storysituation set chachongResult=?,receiver=? where ctitle=?"; 178 pstm = conn.prepareStatement(sql); 179 pstm.setString(1, receiver); 180 pstm.setString(2, ctitle); 181 pstm1 = conn.prepareStatement(sql1); 182 pstm1.setString(1, chachongResult); 183 pstm1.setString(2, receiver); 184 pstm1.setString(3, ctitle); 185 // 执行插入操作 186 int num = pstm.executeUpdate(); 187 int num1 = pstm1.executeUpdate(); 188 if (num > 0 & num1 > 0) { 189 System.out.println("查重成功"); 190 judge = true; 191 } else { 192 System.out.println("查重失败"); 193 judge = false; 194 } 195 } catch (Exception e) { 196 e.printStackTrace(); 197 } finally { 198 // SQL执行完成后释放相关资源 199 Database.close(conn, pstm); 200 } 201 return judge; 202 } 203 /** 204 * 审稿流程 205 * @return 206 */ 207 public List<Story> shengaoliucheng() { 208 List<Story> list = new ArrayList<>(); 209 Connection conn = null; 210 ResultSet rs = null; 211 PreparedStatement pstm = null; 212 Story story = null; 213 try { 214 conn = Database.getConnection(); 215 String sql = "select * from story where receiver=?"; 216 pstm = conn.prepareStatement(sql); 217 pstm.setString(1, "内容查重合格"); 218 rs = pstm.executeQuery(); 219 while (rs.next()) { 220 String ctitle = rs.getString("ctitle"); 221 String etitle = rs.getString("etitle"); 222 String cabstract = rs.getString("cabstract"); 223 String eabstract = rs.getString("eabstract"); 224 String ckey = rs.getString("ckey"); 225 String ekey = rs.getString("ekey"); 226 String content = rs.getString("content"); 227 String receiver = rs.getString("receiver"); 228 String status = rs.getString("status"); 229 String name = rs.getString("name"); 230 story = new Story(ctitle, etitle, cabstract, eabstract, ckey, ekey, content, receiver, status, name); 231 list.add(story); 232 } 233 } catch (Exception e) { 234 e.printStackTrace(); 235 } finally { 236 Database.close(conn, pstm, rs); 237 } 238 return list; 239 } 240 241 public List<User> shengaoliucheng_check(String identity) { 242 List<User> list = new ArrayList<>(); 243 Connection conn = null; 244 ResultSet rs = null; 245 PreparedStatement pstm = null; 246 User user = null; 247 try { 248 conn = Database.getConnection(); 249 String sql = "select name from user where identity=?"; 250 pstm = conn.prepareStatement(sql); 251 pstm.setString(1, identity); 252 rs = pstm.executeQuery(); 253 while (rs.next()) { 254 String name = rs.getString("name"); 255 user = new User(name); 256 list.add(user); 257 } 258 } catch (Exception e) { 259 e.printStackTrace(); 260 } finally { 261 Database.close(conn, pstm, rs); 262 } 263 return list; 264 } 265 public boolean shengao_choose(String ctitle, String name1,String name2,String name3) { 266 Connection conn = null; 267 PreparedStatement pstm = null; 268 PreparedStatement pstm1 = null; 269 boolean judge = false; 270 String receiver="审稿流程已过"; 271 try { 272 conn = Database.getConnection(); 273 String sql = "update story set receiver=? where ctitle=?"; 274 String sql1 = "update storysituation set name_one=?,name_two=?,name_three=?,receiver=? where ctitle=?"; 275 pstm = conn.prepareStatement(sql); 276 pstm.setString(1, receiver); 277 pstm.setString(2, ctitle); 278 pstm1 = conn.prepareStatement(sql1); 279 pstm1.setString(1, name1); 280 pstm1.setString(2, name2); 281 pstm1.setString(3, name3); 282 pstm1.setString(4, receiver); 283 pstm1.setString(5, ctitle); 284 // 执行插入操作 285 int num = pstm.executeUpdate(); 286 int num1 = pstm1.executeUpdate(); 287 if (num > 0 & num1 > 0) { 288 System.out.println("提交成功"); 289 judge = true; 290 } else { 291 System.out.println("提交失败"); 292 judge = false; 293 } 294 } catch (Exception e) { 295 e.printStackTrace(); 296 } finally { 297 // SQL执行完成后释放相关资源 298 Database.close(conn, pstm); 299 } 300 return judge; 301 } 302 303 }