期刊论文在线投稿审稿系统④(校稿人功能页-'内容查重'功能的实现)

此文接期刊论文在线投稿审稿系统③(校稿人功能页-'格式审查'功能的实现)

一、'内容查重'功能

期刊论文在线投稿审稿系统④(校稿人功能页-'内容查重'功能的实现)

二、效果如下

期刊论文在线投稿审稿系统④(校稿人功能页-'内容查重'功能的实现)

期刊论文在线投稿审稿系统④(校稿人功能页-'内容查重'功能的实现)

期刊论文在线投稿审稿系统④(校稿人功能页-'内容查重'功能的实现)

期刊论文在线投稿审稿系统④(校稿人功能页-'内容查重'功能的实现)

三、代码如下

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>

在ProofreadServlet.java文件内添加上以下语句

 1 protected void doPost(HttpServletRequest request, HttpServletResponse response)
 2             throws ServletException, IOException {
 3         // TODO Auto-generated method stub
 4         // doGet(request, response);
 5         request.setCharacterEncoding("utf-8");
 6         response.setCharacterEncoding("utf-8");
 7 
 8         System.out.println("进入ContributeServlet");
 9         String method = request.getParameter("method");
10         System.out.println(method);
11         if ("geshishencha".equals(method)) {
12             geshishencha(request, response);// 格式审查
13         } else if ("check".equals(method)) {
14             check(request, response);// 审查
15         } else if ("checkResult".equals(method)) {
16             checkResult(request, response);
17         } else if ("neirongchachong".equals(method)) {
18             neirongchachong(request, response);// 内容查重
19         } else if ("neirong_check".equals(method)) {
20             neirong_check(request, response);
21         } else if ("neirong_checkResult".equals(method)) {
22             neirong_checkResult(request, response);
23         } 
24     }
25 
26     public void neirongchachong(HttpServletRequest request, HttpServletResponse response)
27             throws ServletException, IOException {
28         response.setCharacterEncoding("UTF-8");
29         request.setCharacterEncoding("UTF-8");
30 
31         List<Story> list = dao.neirongchachong();
32         request.setAttribute("list", list);
33         request.getRequestDispatcher("Proofread_neirongchachong.jsp").forward(request, response);
34 
35     }
36 
37     public void neirong_check(HttpServletRequest request, HttpServletResponse response)
38             throws ServletException, IOException {
39         response.setCharacterEncoding("UTF-8");
40         request.setCharacterEncoding("UTF-8");
41 
42         String ctitle = request.getParameter("ctitle");
43         List<Story> list = dao.check(ctitle);
44         request.setAttribute("list", list);
45         request.getRequestDispatcher("Proofread_neirongchachong_check.jsp").forward(request, response);
46 
47     }
48 
49     public void neirong_checkResult(HttpServletRequest request, HttpServletResponse response)
50             throws ServletException, IOException {
51         response.setCharacterEncoding("UTF-8");
52         request.setCharacterEncoding("UTF-8");
53 
54         String ctitle = request.getParameter("judgectitle");
55         String chachongResult = request.getParameter("chachongResult");
56 
57         if (dao.neirong_checkResult(ctitle, chachongResult)) {
58             request.getRequestDispatcher("ProofreadServlet?method=neirongchachong").forward(request, response);
59         } else {
60             request.getRequestDispatcher("TestFail.jsp").forward(request, response);
61         }
62 
63     }

在ProofreadDao.java文件内添加上以下语句

 1     /**
 2      * 内容查重
 3      * @return
 4      */
 5     public List<Story> neirongchachong() {
 6         List<Story> list = new ArrayList<>();
 7         Connection conn = null;
 8         ResultSet rs = null;
 9         PreparedStatement pstm = null;
10         Story story = null;
11         try {
12             conn = Database.getConnection();
13             String sql = "select * from story where receiver=?";
14             pstm = conn.prepareStatement(sql);
15             pstm.setString(1, "审签同意");
16             rs = pstm.executeQuery();
17             while (rs.next()) {
18                 String ctitle = rs.getString("ctitle");
19                 String etitle = rs.getString("etitle");
20                 String cabstract = rs.getString("cabstract");
21                 String eabstract = rs.getString("eabstract");
22                 String ckey = rs.getString("ckey");
23                 String ekey = rs.getString("ekey");
24                 String content = rs.getString("content");
25                 String receiver = rs.getString("receiver");
26                 String status = rs.getString("status");
27                 String name = rs.getString("name");
28                 story = new Story(ctitle, etitle, cabstract, eabstract, ckey, ekey, content, receiver, status, name);
29                 list.add(story);
30             }
31         } catch (Exception e) {
32             e.printStackTrace();
33         } finally {
34             Database.close(conn, pstm, rs);
35         }
36         return list;
37     }
38     public boolean neirong_checkResult(String ctitle, String chachongResult) {
39         Connection conn = null;
40         PreparedStatement pstm = null;
41         PreparedStatement pstm1 = null;
42         boolean judge = false;
43         String receiver;
44         try {
45             if(chachongResult.equals("合格")) {
46                 receiver = "内容查重合格";
47             }else {
48                 receiver = "内容查重不合格";
49             }
50             conn = Database.getConnection();
51             String sql = "update story set receiver=? where ctitle=?";
52             String sql1 = "update storysituation set chachongResult=?,receiver=? where ctitle=?";
53             pstm = conn.prepareStatement(sql);
54             pstm.setString(1, receiver);
55             pstm.setString(2, ctitle);
56             pstm1 = conn.prepareStatement(sql1);
57             pstm1.setString(1, chachongResult);
58             pstm1.setString(2, receiver);
59             pstm1.setString(3, ctitle);
60             // 执行插入操作
61             int num = pstm.executeUpdate();
62             int num1 = pstm1.executeUpdate();
63             if (num > 0 & num1 > 0) {
64                 System.out.println("查重成功");
65                 judge = true;
66             } else {
67                 System.out.println("查重失败");
68                 judge = false;
69             }
70         } catch (Exception e) {
71             e.printStackTrace();
72         } finally {
73             // SQL执行完成后释放相关资源
74             Database.close(conn, pstm);
75         }
76         return judge;
77     }

 

上一篇:公文流转系统③——部门功能页


下一篇:计算ip地址归属地