From dd9e2352e425c359fc7464fa2a0366a236dc161d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E6=A5=9A?= <823169880@qq.com> Date: Mon, 14 Jan 2019 10:06:12 +0800 Subject: [PATCH 1/6] Merge remote-tracking branch 'remotes/origin/master' into hechu1 # Conflicts: # src/core/operation/Select.json # src/core/process/Process.java --- web/login.jsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/login.jsp b/web/login.jsp index 48b257a..658a59e 100644 --- a/web/login.jsp +++ b/web/login.jsp @@ -53,7 +53,7 @@ placeholder="请输入电话"> - From bd36c4a1f5cdec3fb3f0b3a6da914041cc3b4498 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E6=A5=9A?= <823169880@qq.com> Date: Mon, 14 Jan 2019 11:36:31 +0800 Subject: [PATCH 2/6] Merge remote-tracking branch 'remotes/origin/master' into hechu1 # Conflicts: # src/core/operation/Select.json # src/core/process/Process.java --- .idea/misc.xml | 2 +- GDMS.iml | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 11bca97..35bdbab 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/GDMS.iml b/GDMS.iml index 0c72c10..17b0b6c 100644 --- a/GDMS.iml +++ b/GDMS.iml @@ -19,8 +19,16 @@ - - + + + + + + + + + + \ No newline at end of file From f82ba25a312142d6de6cfff83022ef49378dc436 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E6=A5=9A?= <823169880@qq.com> Date: Mon, 14 Jan 2019 18:54:04 +0800 Subject: [PATCH 3/6] Merge remote-tracking branch 'remotes/origin/master' into hechu1 # Conflicts: # src/core/operation/Select.json # src/core/process/Process.java --- web/cssFile/blank-style.css | 94 +++++++++++++++++++++++++++++++++ web/cssFile/home.css | 3 +- web/cssFile/images/filText.png | Bin 0 -> 334 bytes web/fillSbjMsg.jsp | 65 +++++++++++++++++++++++ web/fill_Information.jsp | 28 ++++++---- web/home.jsp | 12 ++++- web/jsFile/sub-msg-input.js | 33 ++++++++++++ web/select.jsp | 59 +++++++++++---------- 8 files changed, 254 insertions(+), 40 deletions(-) create mode 100644 web/cssFile/blank-style.css create mode 100644 web/cssFile/images/filText.png create mode 100644 web/fillSbjMsg.jsp create mode 100644 web/jsFile/sub-msg-input.js diff --git a/web/cssFile/blank-style.css b/web/cssFile/blank-style.css new file mode 100644 index 0000000..fa2bd36 --- /dev/null +++ b/web/cssFile/blank-style.css @@ -0,0 +1,94 @@ +.blank-frame-sub{ + width: 100%; + min-height: 825px; + border: 1px solid rgba(255, 255, 255, 0); + } +.sub-msg{ + background-color: white; + width: 960px; + min-height: 400px; + border-radius: 5px; + margin: 100px 10px 0px 18px; + border: 1px solid rgba(0, 0, 0, 0.23); +} +.sub-fill-frame{ + height: 80px; + width: 940px; + margin: 20px 10px; +} +.sub-fill-frame input{ + float: left; + margin-right: 10px; + padding-left: 12px; + background-color: #f5f5f5; + border-radius: 5px; + height: 40px; + width: 300px; + border:1px solid rgba(0, 0, 0, 0.27); +} +.sub-fill-frame input:hover{ + border:1px solid rgb(120, 190, 255); + background-color: #ffffff; +} +.sub-fill-frame input:focus{ + border:1px solid rgb(120, 190, 255); + background-color: #ffffff; +} +.sub-fill-frame select{ + appearance:none; + -moz-appearance:none; + -webkit-appearance:none; + width: 150px; + height: 40px; + color: rgba(0,0,0,0.58); + border:1px solid rgba(0, 0, 0, 0.41); + padding-left: 12px; + border-radius: 5px; +} +.sub-scb-text{ + width: 700px; + height: 120px; + border-radius: 10px; + border: 1px solid rgba(0, 0, 0, 0.2); + resize: none; + padding: 10px 10px; + background-color: #f4f4f4; +} +.sub-scb-text:focus{ + border: 1px solid rgb(55, 157, 255); + background-color: white; +} +.sub-scb-text:hover{ + background-color: white; + border: 1px solid rgb(55, 157, 255); +} +.sub-fill-frame.sub-scb{ + height:120px ; +} +.sub-tips{ + text-align: right; + line-height: 40px; + margin-right: 20px; + width: 150px; + height: 100%; + float: left; +} +.sub-input-button{ + width: 100px; + height: 40px; + color: white; + background-color: #d74144; + border-radius: 5px; + margin: 20px 430px; + border: 0px; + cursor: pointer; +} +.sub-input-button:hover{ + background-color: #eb4548; +} +.sub-fill-frame select:focus{ + border: 1px solid rgb(55, 157, 255); +} +.sub-fill-frame select:hover{ + border: 1px solid rgb(55, 157, 255); +} \ No newline at end of file diff --git a/web/cssFile/home.css b/web/cssFile/home.css index b16aac0..a02349a 100644 --- a/web/cssFile/home.css +++ b/web/cssFile/home.css @@ -410,8 +410,9 @@ ul{ color: #7b7b7b; } .model-info{ + text-align: center; float: left; - width: 100px; + width: 150px; height: 40px; margin: 15px 10px; background-color: #e4e4e4; diff --git a/web/cssFile/images/filText.png b/web/cssFile/images/filText.png new file mode 100644 index 0000000000000000000000000000000000000000..6859d43942a7d1ad062652d828d98faf1021c011 GIT binary patch literal 334 zcmeAS@N?(olHy`uVBq!ia0vp^DImNOnpBiKW%F@3H=U`tkC)rO!&w z-7`-)kEetd?^(QZ#Hj!Xc#W(W3xlSnRZ@ILk?_F<`3-x0xSn s0h@5<2j9o~565SKoxlk8PDA}SroC%qyHlp~y#@(*y85}Sb4q9e0N1T{j{pDw literal 0 HcmV?d00001 diff --git a/web/fillSbjMsg.jsp b/web/fillSbjMsg.jsp new file mode 100644 index 0000000..422ac55 --- /dev/null +++ b/web/fillSbjMsg.jsp @@ -0,0 +1,65 @@ +<%-- + Created by IntelliJ IDEA. + User: lenovo + Date: 2019/1/14 + Time: 15:53 + To change this template use File | Settings | File Templates. +--%> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> + + + 填写选题信息 + + + + + +
+
+
填写选题信息
+ +
+
+
+
论文题目:
+ + +
+
+
题目类别:
+ +
+
+
题目来源:
+ +
+
+
题目性质:
+ +
+
+
题目描述:
+ +
+ +
+
+
+
+ + + diff --git a/web/fill_Information.jsp b/web/fill_Information.jsp index 94913d4..5b34830 100644 --- a/web/fill_Information.jsp +++ b/web/fill_Information.jsp @@ -1,6 +1,8 @@ <%@ page import="core.user.User" %> <%@ page import="java.util.Map" %> -<%@ page import="java.util.HashMap" %><%-- +<%@ page import="java.util.HashMap" %> +<%@ page import="java.util.List" %> +<%@ page import="java.util.ArrayList" %><%-- Created by IntelliJ IDEA. User: lenovo Date: 2019/1/12 @@ -17,15 +19,19 @@ -<%Map map2=new HashMap(); +<% + Map map2=new HashMap(); + Map map3=new HashMap(); map2.put("姓名","李先生"); map2.put("学号","201630126050"); map2.put("电话","18711191679"); - map2.put("题目","论文"); - map2.put("5","李先生2"); - map2.put("6","李先生2"); + map3.put("姓名","王先生"); + map3.put("学号","201630126051"); + map3.put("电话","18711191679"); + List> list=new ArrayList>(); pageContext.setAttribute("map",map2); - String type ="student"; + User user=(User)session.getAttribute("user"); + String type=user.getType(); pageContext.setAttribute("type",type); %>
@@ -33,16 +39,18 @@
${map.姓名}
-
-
+ +
+
+
${z.key}:${z.value}
- - + + diff --git a/web/home.jsp b/web/home.jsp index c68ff37..56d3d00 100644 --- a/web/home.jsp +++ b/web/home.jsp @@ -16,6 +16,7 @@ + @@ -23,6 +24,7 @@ + <%String type="teacher";pageContext.setAttribute("userType",type);%> @@ -40,7 +42,7 @@
@@ -91,6 +93,14 @@
+
diff --git a/web/jsFile/sub-msg-input.js b/web/jsFile/sub-msg-input.js new file mode 100644 index 0000000..f01d9bb --- /dev/null +++ b/web/jsFile/sub-msg-input.js @@ -0,0 +1,33 @@ +$(document).ready( + function () { + $(document).off('click',sendSub).on('click','.sub-input-button',sendSub); + } +) +function sendSub() { + var Url3='testfrom.jsp'; + if( $('.sub-input').eq(0).val()==''|| $('.sub-input').eq(1).val()=='' + || $('.sub-input').eq(2).val()=='') + { + alert("请将信息填写完整"); + return; + } + + if( $('.sub-select').eq(0).val()==''|| $('.sub-select').eq(1).val()=='') + { + alert("请将信息填写完整"); + return; + } + if($('.sub-scb-text').val()=='') + { + alert("请将信息填写完整"); + return; + } + var fillDate=$(this).parent().serialize(); + $.post(Url3,fillDate,function(data,status) { + if(status=='success') + { + alert("提交成功"); + } + } + ); +} \ No newline at end of file diff --git a/web/select.jsp b/web/select.jsp index 7f60717..be2c265 100644 --- a/web/select.jsp +++ b/web/select.jsp @@ -6,6 +6,13 @@ To change this template use File | Settings | File Templates. --%> <%@ page contentType="text/html;charset=UTF-8" language="java" import="java.util.Date" %> +<%@ page import="core.user.User" %> +<%@ page import="java.util.Map" %> +<%@ page import="java.util.HashMap" %> +<%@ page import="java.util.List" %> +<%@ page import="java.util.ArrayList" %> +<%@ page import="core.process.C_TeacherSearchStudent" %> +<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> Title @@ -14,10 +21,25 @@ +<% + C_TeacherSearchStudent searchStudent=new C_TeacherSearchStudent(); + List> list=new ArrayList<>(); + pageContext.setAttribute("list",list); + User user=(User)session.getAttribute("user"); + String type=user.getType(); + pageContext.setAttribute("type",type); +%>
-
选择学生
+
+ + ${"选择学生"} + + + ${"选择老师"} + +
@@ -28,37 +50,18 @@
-
c +
+
-
李先生
+
${z.姓名}
-
电话号码:18711191679
-
邮箱:823169880@qq.com
-
年级:2016
-
专业:软件工程
-
电话号码:18711191679
-
邮箱:823169880@qq.com
+ +
${msg.key}:${msg.value}
+
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- +
+
From 050de7008799bd10b42575a84df6d2b25e71c90f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E6=A5=9A?= <823169880@qq.com> Date: Mon, 14 Jan 2019 20:59:00 +0800 Subject: [PATCH 4/6] Merge remote-tracking branch 'remotes/origin/master' into hechu1 # Conflicts: # src/core/operation/Select.json # src/core/process/Process.java --- web/cssFile/fill-style.css | 9 --------- web/cssFile/home.css | 14 ++++++++++++-- web/cssFile/personal.css | 3 +-- web/cssFile/select-style.css | 12 +++--------- web/fill_Information.jsp | 2 +- web/jsFile/fill-action.js | 3 ++- web/jsFile/homeActive.js | 6 +++++- web/jsFile/search.js | 25 ++++++++++++++++--------- web/jsFile/upload_action.js | 2 ++ web/select.jsp | 21 +++++++++++++++++---- 10 files changed, 59 insertions(+), 38 deletions(-) diff --git a/web/cssFile/fill-style.css b/web/cssFile/fill-style.css index aa4a574..e63055f 100644 --- a/web/cssFile/fill-style.css +++ b/web/cssFile/fill-style.css @@ -119,12 +119,3 @@ right: 220px; padding-left: 15px; } -.fill-top-blank{ - border-radius: 5px; - height: 70px; - width: 960px; - position: absolute; - top: 20px; - right: 10px; - background-color: #323232; -} diff --git a/web/cssFile/home.css b/web/cssFile/home.css index a02349a..f0985a6 100644 --- a/web/cssFile/home.css +++ b/web/cssFile/home.css @@ -5,6 +5,15 @@ body{ width: 100%; height: 100%; } +.fill-top-blank{ + border-radius: 5px; + height: 70px; + width: 960px; + position: absolute; + top: 20px; + right: 10px; + background-color: #323232; +} .main2{ background-color:#fafafa; } @@ -412,13 +421,14 @@ ul{ .model-info{ text-align: center; float: left; - width: 150px; + width: 400px; height: 40px; margin: 15px 10px; background-color: #e4e4e4; border-radius: 5px; - color: #1b1b1b; + color: rgba(27, 27, 27, 0.87); padding-left: 10px; line-height: 35px; font-size: 18px; + font-weight: 400; } \ No newline at end of file diff --git a/web/cssFile/personal.css b/web/cssFile/personal.css index c621e6a..623656e 100644 --- a/web/cssFile/personal.css +++ b/web/cssFile/personal.css @@ -41,9 +41,8 @@ ul{ top: 70px; left: 250px; width: 600px; - border: 1px solid rgba(0, 0, 0, 0.27); + border: 1px solid rgba(0, 0, 0, 0.2); border-radius: 5px; - box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.23); } .personal-msg-frame .personal-msg-part{ width: 100%; diff --git a/web/cssFile/select-style.css b/web/cssFile/select-style.css index d06576a..ac9a999 100644 --- a/web/cssFile/select-style.css +++ b/web/cssFile/select-style.css @@ -77,6 +77,9 @@ a{ border: 0px; transition: all 0.3s; } +.select-it.on{ + background-color: rgba(88, 137, 238, 0.97); +} .select-it:hover{ width: 100px; } @@ -161,13 +164,4 @@ a{ } .one-msg:hover{ background-color: rgba(39, 39, 39, 0.78); -} -.top-blank{ - position: absolute; - height: 70px; - width: 960px; - top: 20px; - left: 20px; - background-color: #323232; - border-radius: 5px; } \ No newline at end of file diff --git a/web/fill_Information.jsp b/web/fill_Information.jsp index 5b34830..1bcd5ca 100644 --- a/web/fill_Information.jsp +++ b/web/fill_Information.jsp @@ -48,7 +48,7 @@
${z.key}:${z.value}
- + diff --git a/web/jsFile/fill-action.js b/web/jsFile/fill-action.js index 7193b17..d7dd3bc 100644 --- a/web/jsFile/fill-action.js +++ b/web/jsFile/fill-action.js @@ -2,7 +2,8 @@ $(document).ready(function () { $(document).off('click',submit_text).on('click','.submit-text',submit_text); }) function submit_text() { - var Url3='testfrom.jsp'; + var Url3=$(this).parent().attr("action"); + alert(Url3); var fillDate=$(this).parent().serialize(); var upddateit=$('.updated'); alert(fillDate); diff --git a/web/jsFile/homeActive.js b/web/jsFile/homeActive.js index 933c1f7..027511c 100644 --- a/web/jsFile/homeActive.js +++ b/web/jsFile/homeActive.js @@ -1,6 +1,6 @@ $(document).ready(function () { $('.a-process').on('click',moveBar); - $('.update-to-perm').on('click',upadateFrame); + $('.update-to-perm').on('click',showPerMsg); $('.notice-child').on('mouseenter',shownoticeText).on('mouseleave',hideText); }) function moveBar() { @@ -53,4 +53,8 @@ function shownoticeText() { } function hideText() { $(this).removeClass("select"); +} +function showPerMsg(e) { + e.preventDefault(); + $('.link-point').eq(0).click(); } \ No newline at end of file diff --git a/web/jsFile/search.js b/web/jsFile/search.js index 5801730..c4482c1 100644 --- a/web/jsFile/search.js +++ b/web/jsFile/search.js @@ -1,7 +1,8 @@ $(document).ready(function () { $(document).off('click',searchmsg).on('click','.search-button',searchmsg); $(document).off('keydown',searchmsg).on('keydown','.search-input',KDsearchmsg); - $(document).off('click',select_one).on('click','.select-it',select_one); + $(document).off('click',teacherSelect).on('click','.select-it.teacher',teacherSelect); + $(document).off('click',studentSelect).on('click','.select-it.teacher',studentSelect); }) function searchmsg(e) { if($('.search-input').val()=='') @@ -22,16 +23,22 @@ function KDsearchmsg(e) { searchmsg(e); } } -function select_one() { - var id=$(this).val(); - var button=$(this); +function select_one(Url2,button) { + var id=button.val(); var selectDate={"id":id}; - var Url2='testfrom.jsp'; - $.post(Url2,selectDate,function (data,status) { + if(button.html()!="已选") + {$.post(Url2,selectDate,function (data,status) { if(status=='success') { - button.css('background-color','rgba(88, 137, 238, 0.97)') - .html("已选") + button.addClass('on').html("已选"); } - }); + })} +} +function studentSelect() { + var button=$(this); + select_one("testfrom.jsp",button); +} +function teacherSelect() { + var button=$(this); + select_one("testfrom.jsp",button); } \ No newline at end of file diff --git a/web/jsFile/upload_action.js b/web/jsFile/upload_action.js index 3e08fba..c3214c9 100644 --- a/web/jsFile/upload_action.js +++ b/web/jsFile/upload_action.js @@ -41,4 +41,6 @@ function showMsg() { $('.file-name').html(filename); $('.file-msg').css("left","340px"); $('.file-input-frame').css("right","20px") + $('.select-file').html("重新选择"); + $('.select-file').css("background-color","#eb4548"); } \ No newline at end of file diff --git a/web/select.jsp b/web/select.jsp index be2c265..9bbf45f 100644 --- a/web/select.jsp +++ b/web/select.jsp @@ -13,6 +13,7 @@ <%@ page import="java.util.ArrayList" %> <%@ page import="core.process.C_TeacherSearchStudent" %> <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> Title @@ -22,8 +23,19 @@ <% - C_TeacherSearchStudent searchStudent=new C_TeacherSearchStudent(); + Map map1=new HashMap(); + Map map2=new HashMap<>(); + map1.put("姓名","hehcu"); + map1.put("学号","201630126050"); + map1.put("电话","18711191679"); + map1.put("状态","选择"); + map2.put("姓名","laoshi"); + map2.put("学号","54646546"); + map2.put("电话","18711191679"); + map2.put("状态","已选"); List> list=new ArrayList<>(); + list.add(map1); + list.add(map2); pageContext.setAttribute("list",list); User user=(User)session.getAttribute("user"); String type=user.getType(); @@ -31,7 +43,7 @@ %>
-
+
${"选择学生"} @@ -55,11 +67,12 @@
${z.姓名}
- +
${msg.key}:${msg.value}
- +
From 2bd6e8c4c993901b8a43936b825633c55317084e Mon Sep 17 00:00:00 2001 From: zhai_lw Date: Mon, 14 Jan 2019 22:34:13 +0800 Subject: [PATCH 5/6] =?UTF-8?q?S=5FServlet=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .idea/misc.xml | 2 +- .../process/C_StudentUploadOpeningReport.java | 28 +++++++++---------- .../C_TeacherFillTopicInformation.java | 6 ++-- .../S_CollegeFillOpeningReportOpinion.java | 12 ++++---- src/servlet/S_CollegeFillScoreOpinion.java | 12 ++++---- .../S_MentorFillOpeningReportOpinion.java | 12 ++++---- src/servlet/S_MentorFillReview.java | 12 ++++---- src/servlet/S_ReviewerFillReview.java | 12 ++++---- src/servlet/S_SchoolFillScoreOpinion.java | 12 ++++---- .../S_SecretaryFillOpeningReportRecord.java | 12 ++++---- src/servlet/S_SecretaryFillReplyRecord.java | 12 ++++---- ...tudentFillGraduationDesignInformation.java | 20 ++++++++----- src/servlet/S_StudentSelectTeacher.java | 8 +++--- .../S_StudentUploadFinishedProduct.java | 8 ++---- src/servlet/S_TeacherSelectStudent.java | 8 +++--- ...S_TeacherTeamFillOpeningReportOpinion.java | 14 ++++++---- .../S_TeacherTeamFillScoreOpinion.java | 14 ++++++---- src/servlet/Utils.java | 14 ++++++++++ 18 files changed, 128 insertions(+), 90 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 9486b47..11bca97 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/src/core/process/C_StudentUploadOpeningReport.java b/src/core/process/C_StudentUploadOpeningReport.java index 88ed26e..736c2fb 100644 --- a/src/core/process/C_StudentUploadOpeningReport.java +++ b/src/core/process/C_StudentUploadOpeningReport.java @@ -1,6 +1,6 @@ package core.process; -import core.operation.UploadFileOperation; +import core.operation.UploadFile; import error.GExcptInit; import java.io.File; @@ -9,24 +9,24 @@ import java.util.Map; public class C_StudentUploadOpeningReport extends TempProcess{ File openingReport; - String gaduationDesignId; + String graduationDesignId; static String file_type = "opening_report"; public void uploadOpeningReport() throws Exception{ if(!check()) throw new GExcptInit("Upload OpeningReport Attrs init error!"); - UploadFileOperation uploadFileOperation=new UploadFileOperation(); - uploadFileOperation.setOptions(new HashMap<>()); - uploadFileOperation.addOptions("file",this.getOpeningReport()); - uploadFileOperation.addOptions("file_type",file_type); + UploadFile uploadFile=new UploadFile(); + uploadFile.setOptions(new HashMap<>()); + uploadFile.addOptions("file",this.getOpeningReport()); + uploadFile.addOptions("file_type",file_type); Maplimits = new HashMap<>(); - limits.put("id",this.getGaduationDesignId()); - uploadFileOperation.addOptions("limits",limits); - uploadFileOperation.execute(null); + limits.put("id",this.getGraduationDesignId()); + uploadFile.addOptions("limits",limits); + uploadFile.execute(null); } protected boolean check() { - if(this.getGaduationDesignId()==null||this.getOpeningReport()==null) + if(this.getGraduationDesignId()==null||this.getOpeningReport()==null) return false; return true; } @@ -39,11 +39,11 @@ public class C_StudentUploadOpeningReport extends TempProcess{ this.openingReport = openingReport; } - public String getGaduationDesignId() { - return gaduationDesignId; + public String getGraduationDesignId() { + return graduationDesignId; } - public void setGaduationDesignId(String gaduationDesignId) { - this.gaduationDesignId = gaduationDesignId; + public void setGraduationDesignId(String graduationDesignId) { + this.graduationDesignId = graduationDesignId; } } diff --git a/src/core/process/C_TeacherFillTopicInformation.java b/src/core/process/C_TeacherFillTopicInformation.java index 6d72cd4..fe0b59c 100644 --- a/src/core/process/C_TeacherFillTopicInformation.java +++ b/src/core/process/C_TeacherFillTopicInformation.java @@ -9,7 +9,7 @@ import java.util.Map; public class C_TeacherFillTopicInformation extends TempProcess{ - String StudentId; + String studentId; String mentor_opinion; Date mentor_opinion_date; @@ -36,11 +36,11 @@ public class C_TeacherFillTopicInformation extends TempProcess{ return true; } public String getStudentId() { - return StudentId; + return studentId; } public void setStudentId(String studentId) { - StudentId = studentId; + this.studentId = studentId; } public String getMentor_opinion() { return mentor_opinion; diff --git a/src/servlet/S_CollegeFillOpeningReportOpinion.java b/src/servlet/S_CollegeFillOpeningReportOpinion.java index 774b28f..6162fa5 100644 --- a/src/servlet/S_CollegeFillOpeningReportOpinion.java +++ b/src/servlet/S_CollegeFillOpeningReportOpinion.java @@ -6,14 +6,16 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.Map; @WebServlet(name = "S_CollegeFillOpeningReportOpinion") public class S_CollegeFillOpeningReportOpinion extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + String id = request.getParameter("id"); + Map vMap = servlet.Utils.getVMap(vName,request); } - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - } -} + static String[] vName = { + "" + }; +} \ No newline at end of file diff --git a/src/servlet/S_CollegeFillScoreOpinion.java b/src/servlet/S_CollegeFillScoreOpinion.java index e937d1d..0d25745 100644 --- a/src/servlet/S_CollegeFillScoreOpinion.java +++ b/src/servlet/S_CollegeFillScoreOpinion.java @@ -6,14 +6,16 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.Map; @WebServlet(name = "S_CollegeFillScoreOpinion") public class S_CollegeFillScoreOpinion extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + String id = request.getParameter("id"); + Map vMap = servlet.Utils.getVMap(vName,request); } - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - } -} + static String[] vName = { + "" + }; +} \ No newline at end of file diff --git a/src/servlet/S_MentorFillOpeningReportOpinion.java b/src/servlet/S_MentorFillOpeningReportOpinion.java index 409ff1f..625520f 100644 --- a/src/servlet/S_MentorFillOpeningReportOpinion.java +++ b/src/servlet/S_MentorFillOpeningReportOpinion.java @@ -6,14 +6,16 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.Map; @WebServlet(name = "S_MentorFillOpeningReportOpinion") public class S_MentorFillOpeningReportOpinion extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + String id = request.getParameter("id"); + Map vMap = servlet.Utils.getVMap(vName,request); } - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - } -} + static String[] vName = { + "" + }; +} \ No newline at end of file diff --git a/src/servlet/S_MentorFillReview.java b/src/servlet/S_MentorFillReview.java index 732bf0e..f28b2d1 100644 --- a/src/servlet/S_MentorFillReview.java +++ b/src/servlet/S_MentorFillReview.java @@ -6,14 +6,16 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.Map; @WebServlet(name = "S_MentorFillReview") public class S_MentorFillReview extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + String id = request.getParameter("id"); + Map vMap = servlet.Utils.getVMap(vName,request); } - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - } -} + static String[] vName = { + "" + }; +} \ No newline at end of file diff --git a/src/servlet/S_ReviewerFillReview.java b/src/servlet/S_ReviewerFillReview.java index 437556e..a23d80a 100644 --- a/src/servlet/S_ReviewerFillReview.java +++ b/src/servlet/S_ReviewerFillReview.java @@ -6,14 +6,16 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.Map; @WebServlet(name = "S_ReviewerFillReview") public class S_ReviewerFillReview extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + String id = request.getParameter("id"); + Map vMap = servlet.Utils.getVMap(vName,request); } - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - } -} + static String[] vName = { + "" + }; +} \ No newline at end of file diff --git a/src/servlet/S_SchoolFillScoreOpinion.java b/src/servlet/S_SchoolFillScoreOpinion.java index 4ece4f4..97d7cd5 100644 --- a/src/servlet/S_SchoolFillScoreOpinion.java +++ b/src/servlet/S_SchoolFillScoreOpinion.java @@ -6,14 +6,16 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.Map; @WebServlet(name = "S_SchoolFillScoreOpinion") public class S_SchoolFillScoreOpinion extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + String id = request.getParameter("id"); + Map vMap = servlet.Utils.getVMap(vName,request); } - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - } -} + static String[] vName = { + "" + }; +} \ No newline at end of file diff --git a/src/servlet/S_SecretaryFillOpeningReportRecord.java b/src/servlet/S_SecretaryFillOpeningReportRecord.java index 74926a9..0fc9fb5 100644 --- a/src/servlet/S_SecretaryFillOpeningReportRecord.java +++ b/src/servlet/S_SecretaryFillOpeningReportRecord.java @@ -6,14 +6,16 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.Map; @WebServlet(name = "S_SecretaryFillOpeningReportRecord") public class S_SecretaryFillOpeningReportRecord extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + String id = request.getParameter("id"); + Map vMap = servlet.Utils.getVMap(vName,request); } - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - } -} + static String[] vName = { + "" + }; +} \ No newline at end of file diff --git a/src/servlet/S_SecretaryFillReplyRecord.java b/src/servlet/S_SecretaryFillReplyRecord.java index ea217f6..7b20ab4 100644 --- a/src/servlet/S_SecretaryFillReplyRecord.java +++ b/src/servlet/S_SecretaryFillReplyRecord.java @@ -6,14 +6,16 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.Map; -@WebServlet(name = "S_SecretaryFillReplyRecord") +@WebServlet(name = "secretary-fill-reply-record") public class S_SecretaryFillReplyRecord extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + String id = request.getParameter("id"); + Map vMap = servlet.Utils.getVMap(vName,request); } - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - } + static String[] vName = { + "" + }; } diff --git a/src/servlet/S_StudentFillGraduationDesignInformation.java b/src/servlet/S_StudentFillGraduationDesignInformation.java index 142b43d..d91779c 100644 --- a/src/servlet/S_StudentFillGraduationDesignInformation.java +++ b/src/servlet/S_StudentFillGraduationDesignInformation.java @@ -1,23 +1,29 @@ package servlet; +import core.user.User; + import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.Map; @WebServlet("/student-fill-graduation-design-information") public class S_StudentFillGraduationDesignInformation extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - super.doPost(request, response); - String content1=new String(request.getParameter("text").getBytes("ISO8859-1"),"UTF-8"); - String content2=request.getParameter("score"); - try { + String id = request.getParameter("id"); + Map vMap = servlet.Utils.getVMap(vName,request); - } catch (Exception e) { - e.printStackTrace(); - } } + static String[] vName = { + "chinese_name", + "english_name", + "type_of_topic", + "source_of_design", + "nature_of_design", + "description_of_topic" + }; } diff --git a/src/servlet/S_StudentSelectTeacher.java b/src/servlet/S_StudentSelectTeacher.java index bc76e6c..69b8893 100644 --- a/src/servlet/S_StudentSelectTeacher.java +++ b/src/servlet/S_StudentSelectTeacher.java @@ -13,13 +13,13 @@ import java.io.IOException; public class S_StudentSelectTeacher extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { super.doPost(request, response); - String teacher_id=request.getParameter("id"); + String teacherId=request.getParameter("id"); User user=(User)request.getSession().getAttribute("user"); - String student_id=user.getId(); + String studentId=user.getId(); try { C_StudentSelectTeacher SST=new C_StudentSelectTeacher(); - SST.setTeacherId(teacher_id); - SST.setStudentId(student_id); + SST.setTeacherId(teacherId); + SST.setStudentId(studentId); SST.select(); } catch (Exception e) { e.printStackTrace(); diff --git a/src/servlet/S_StudentUploadFinishedProduct.java b/src/servlet/S_StudentUploadFinishedProduct.java index 0389973..9eaec19 100644 --- a/src/servlet/S_StudentUploadFinishedProduct.java +++ b/src/servlet/S_StudentUploadFinishedProduct.java @@ -1,19 +1,17 @@ package servlet; import javax.servlet.ServletException; +import javax.servlet.annotation.MultipartConfig; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; -@WebServlet(name = "S_StudentUploadFinishedProduct") +@WebServlet(name = "student-upload-finished-product") +@MultipartConfig public class S_StudentUploadFinishedProduct extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { } - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - } } diff --git a/src/servlet/S_TeacherSelectStudent.java b/src/servlet/S_TeacherSelectStudent.java index fe20103..ab880eb 100644 --- a/src/servlet/S_TeacherSelectStudent.java +++ b/src/servlet/S_TeacherSelectStudent.java @@ -13,13 +13,13 @@ import java.io.IOException; public class S_TeacherSelectStudent extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { super.doPost(request, response); - String student_id=request.getParameter("id"); + String studentId=request.getParameter("id"); User user=(User)request.getSession().getAttribute("user"); - String teacher_id=user.getId(); + String teacherId=user.getId(); try { C_TeacherSelectStudent TSS=new C_TeacherSelectStudent(); - TSS.setTeacherId(teacher_id); - TSS.setStudentId(student_id); + TSS.setTeacherId(teacherId); + TSS.setStudentId(studentId); TSS.select(); } catch (Exception e) { e.printStackTrace(); diff --git a/src/servlet/S_TeacherTeamFillOpeningReportOpinion.java b/src/servlet/S_TeacherTeamFillOpeningReportOpinion.java index ac47c5b..4e55b0a 100644 --- a/src/servlet/S_TeacherTeamFillOpeningReportOpinion.java +++ b/src/servlet/S_TeacherTeamFillOpeningReportOpinion.java @@ -6,14 +6,16 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.Map; -@WebServlet(name = "S_TeacherTeamFillOpeningReportOpinion") +@WebServlet(name = "teacher-team-fill-opening-report-opinion") public class S_TeacherTeamFillOpeningReportOpinion extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + String id = request.getParameter("id"); + Map vMap = servlet.Utils.getVMap(vName,request); } - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - } -} + static String[] vName = { + "" + }; +} \ No newline at end of file diff --git a/src/servlet/S_TeacherTeamFillScoreOpinion.java b/src/servlet/S_TeacherTeamFillScoreOpinion.java index e3418ef..a72ac08 100644 --- a/src/servlet/S_TeacherTeamFillScoreOpinion.java +++ b/src/servlet/S_TeacherTeamFillScoreOpinion.java @@ -6,14 +6,16 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; +import java.util.Map; -@WebServlet(name = "S_TeacherFillTeamFillScoreOpinion") -public class S_TeacherFillTeamFillScoreOpinion extends HttpServlet { +@WebServlet(name = "S_TeacherTeamFillScoreOpinion") +public class S_TeacherTeamFillScoreOpinion extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + String id = request.getParameter("id"); + Map vMap = servlet.Utils.getVMap(vName,request); } - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - } + static String[] vName = { + "" + }; } diff --git a/src/servlet/Utils.java b/src/servlet/Utils.java index 06037af..7176796 100644 --- a/src/servlet/Utils.java +++ b/src/servlet/Utils.java @@ -1,4 +1,18 @@ package servlet; +import org.apache.coyote.Request; + +import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + public interface Utils { + static Map getVMap(String[] vName, HttpServletRequest request){ + Map vMap = new HashMap<>(); + for(int i=0;i Date: Mon, 14 Jan 2019 23:47:22 +0800 Subject: [PATCH 6/6] =?UTF-8?q?S=5FServlet=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/operation/UploadFile.java | 8 +--- src/core/operation/UploadFile.json | 2 +- src/core/operation/utils/Utils.java | 15 ------- ...tudentFillGraduationDesignInformation.java | 2 - .../S_StudentUploadFinishedProduct.java | 6 ++- src/servlet/S_StudentUploadOpeningReport.java | 26 ++---------- src/servlet/Utils.java | 42 +++++++++++++++++++ 7 files changed, 51 insertions(+), 50 deletions(-) diff --git a/src/core/operation/UploadFile.java b/src/core/operation/UploadFile.java index b75dcfa..75c76cb 100644 --- a/src/core/operation/UploadFile.java +++ b/src/core/operation/UploadFile.java @@ -14,18 +14,12 @@ import java.util.Map; public class UploadFile extends Operation { @Override public Map execute(User subject) throws Exception { - File file = (File) this.getOptions().get("file"); String table = (String) this.getOptions().get("file_type"); Map limits = (Map) this.getOptions().get("limits"); - String field = core.operation.utils.Utils.getFileField(table); - String filePath = core.operation.utils.Utils.getFilePathName(table,file.getName()); + String filePath = (String) this.getOptions().get("file_url"); Map vMap = new HashMap<>(); vMap.put(field,filePath); - - file.renameTo(new File(filePath)); - //todo - List ls = new ArrayList<>(); ls.add(field); List resultLs = DBManagement.select(ls,table,limits,0,1); diff --git a/src/core/operation/UploadFile.json b/src/core/operation/UploadFile.json index c2a2f65..0181176 100644 --- a/src/core/operation/UploadFile.json +++ b/src/core/operation/UploadFile.json @@ -1,6 +1,6 @@ { "options":{ - "file": "File", + "file_url": "String", "file_type": "String", "limits":"Map" }, diff --git a/src/core/operation/utils/Utils.java b/src/core/operation/utils/Utils.java index 217e8be..6b09955 100644 --- a/src/core/operation/utils/Utils.java +++ b/src/core/operation/utils/Utils.java @@ -35,19 +35,4 @@ public interface Utils { static String getFileField(String table){ return fileTableField.get(table); } - static String getFilePath(String table){ - return Configuration.filePath+table+"/"; - } - static String getFileName(String fileName){ - SimpleDateFormat simpleDateFormat; - simpleDateFormat = new SimpleDateFormat("yyMMddHHmmssSSS"); - Date date = new Date(); - String str = simpleDateFormat.format(date); - str+=(int)(Math.random()*100000); - str+= utils.Utils.getFileType(fileName); - return str; - } - static String getFilePathName(String table, String fileName){ - return getFilePath(table)+getFileName(fileName); - } } diff --git a/src/servlet/S_StudentFillGraduationDesignInformation.java b/src/servlet/S_StudentFillGraduationDesignInformation.java index d91779c..9838562 100644 --- a/src/servlet/S_StudentFillGraduationDesignInformation.java +++ b/src/servlet/S_StudentFillGraduationDesignInformation.java @@ -1,7 +1,5 @@ package servlet; -import core.user.User; - import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; diff --git a/src/servlet/S_StudentUploadFinishedProduct.java b/src/servlet/S_StudentUploadFinishedProduct.java index 9eaec19..266671c 100644 --- a/src/servlet/S_StudentUploadFinishedProduct.java +++ b/src/servlet/S_StudentUploadFinishedProduct.java @@ -8,10 +8,12 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; -@WebServlet(name = "student-upload-finished-product") +@WebServlet("/student-upload-finished-product") @MultipartConfig public class S_StudentUploadFinishedProduct extends HttpServlet { + static String fileType = "graduation_design_finished_product"; protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - + String id = request.getParameter("id"); + String fileURL = servlet.Utils.saveFile(request, fileType); } } diff --git a/src/servlet/S_StudentUploadOpeningReport.java b/src/servlet/S_StudentUploadOpeningReport.java index df0f052..4102e91 100644 --- a/src/servlet/S_StudentUploadOpeningReport.java +++ b/src/servlet/S_StudentUploadOpeningReport.java @@ -14,30 +14,10 @@ import java.util.UUID; @WebServlet("/student-upload-opening-report") @MultipartConfig -//学生id+文件 public class S_StudentUploadOpeningReport extends HttpServlet { - private static final long serialVersionUID = 1L; + static String fileType = "graduation_design_opening_report"; protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - super.doPost(request, response); - User user=(User) request.getSession().getAttribute("user"); - String student_id=user.getId(); - - try { - - //获取上传的文件 - Part part=request.getPart("file"); - //获取请求的信息 - String name=part.getHeader("content-disposition"); - //获取上传文件的目录 - String root=request.getServletContext().getRealPath("/upload"); - - - request.setAttribute("info", "上传文件成功"); - } catch (Exception e) { - e.printStackTrace(); - request.setAttribute("info", "上传文件失败"); - } - - request.getRequestDispatcher("/upload.jsp").forward(request, response); + String id = request.getParameter("id"); + String fileURL = servlet.Utils.saveFile(request, fileType); } } diff --git a/src/servlet/Utils.java b/src/servlet/Utils.java index 7176796..687b7e9 100644 --- a/src/servlet/Utils.java +++ b/src/servlet/Utils.java @@ -1,8 +1,17 @@ package servlet; +import gdms.Configuration; import org.apache.coyote.Request; +import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.Part; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.text.SimpleDateFormat; +import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -15,4 +24,37 @@ public interface Utils { } return vMap; } + static String getFilePath(String table){ + return Configuration.filePath+table+"/"; + } + static String getFileName(String fileName){ + SimpleDateFormat simpleDateFormat; + simpleDateFormat = new SimpleDateFormat("yyMMddHHmmssSSS"); + Date date = new Date(); + String str = simpleDateFormat.format(date); + str+=(int)(Math.random()*100000); + str+= utils.Utils.getFileType(fileName); + return str; + } + static String getFilePathName(String table, String fileName){ + return getFilePath(table)+getFileName(fileName); + } + static String saveFile(HttpServletRequest request, String table) throws IOException, ServletException { + Part part = request.getPart("graduation_design"); + String header = part.getHeader("content-disposition"); + String path = header.substring(header.indexOf("filename=") + 10, header.length() - 1); + String filePathName = servlet.Utils.getFilePathName(table,path); + File file = new File(filePathName); + InputStream inputStream = part.getInputStream(); + FileOutputStream outputStream = new FileOutputStream(file); + int len; + byte[] bytes = new byte[1024]; + while ((len = inputStream.read(bytes)) != -1) { + outputStream.write(bytes, 0, len); + } + outputStream.close(); + inputStream.close(); + part.delete(); + return filePathName; + } }