diff --git a/GDMS.iml b/GDMS.iml index 23fde1f..10b7704 100644 --- a/GDMS.iml +++ b/GDMS.iml @@ -17,14 +17,23 @@ - + - - + - + + + + + + + + + + + diff --git a/src/servlet/S_CollegeFillOpeningReportOpinion.java b/src/servlet/S_CollegeFillOpeningReportOpinion.java index f84de95..c7f7367 100644 --- a/src/servlet/S_CollegeFillOpeningReportOpinion.java +++ b/src/servlet/S_CollegeFillOpeningReportOpinion.java @@ -10,7 +10,7 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Map; -@WebServlet("college-fill-opening-report-opinion") +@WebServlet("/college-fill-opening-report-opinion") public class S_CollegeFillOpeningReportOpinion extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String id = request.getParameter("id"); diff --git a/src/servlet/S_CollegeFillScoreOpinion.java b/src/servlet/S_CollegeFillScoreOpinion.java index b66ec58..360e082 100644 --- a/src/servlet/S_CollegeFillScoreOpinion.java +++ b/src/servlet/S_CollegeFillScoreOpinion.java @@ -10,7 +10,7 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Map; -@WebServlet("college-fill-score-opinion") +@WebServlet("/college-fill-score-opinion") public class S_CollegeFillScoreOpinion extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String id = request.getParameter("id"); diff --git a/src/servlet/S_MentorFillOpeningReportOpinion.java b/src/servlet/S_MentorFillOpeningReportOpinion.java index 588215b..d35293a 100644 --- a/src/servlet/S_MentorFillOpeningReportOpinion.java +++ b/src/servlet/S_MentorFillOpeningReportOpinion.java @@ -10,7 +10,7 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Map; -@WebServlet("mentor-fill-opening-report-opinion") +@WebServlet("/mentor-fill-opening-report-opinion") public class S_MentorFillOpeningReportOpinion extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String id = request.getParameter("id"); diff --git a/src/servlet/S_MentorFillReview.java b/src/servlet/S_MentorFillReview.java index 1ece272..a10cf5c 100644 --- a/src/servlet/S_MentorFillReview.java +++ b/src/servlet/S_MentorFillReview.java @@ -8,7 +8,7 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Map; -@WebServlet("mentor-fill-review") +@WebServlet("/mentor-fill-review") public class S_MentorFillReview extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String id = request.getParameter("id"); diff --git a/src/servlet/S_ReviewerFillReview.java b/src/servlet/S_ReviewerFillReview.java index f950771..f3c754d 100644 --- a/src/servlet/S_ReviewerFillReview.java +++ b/src/servlet/S_ReviewerFillReview.java @@ -8,7 +8,7 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Map; -@WebServlet("reviewer-fill-review") +@WebServlet("/reviewer-fill-review") public class S_ReviewerFillReview extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String id = request.getParameter("id"); diff --git a/src/servlet/S_SchoolFillScoreOpinion.java b/src/servlet/S_SchoolFillScoreOpinion.java index d6b0e9d..fa1fa02 100644 --- a/src/servlet/S_SchoolFillScoreOpinion.java +++ b/src/servlet/S_SchoolFillScoreOpinion.java @@ -8,7 +8,7 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Map; -@WebServlet("school-fill-score-opinion") +@WebServlet("/school-fill-score-opinion") public class S_SchoolFillScoreOpinion extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String id = request.getParameter("id"); diff --git a/src/servlet/S_SecretaryFillOpeningReportRecord.java b/src/servlet/S_SecretaryFillOpeningReportRecord.java index 2ef4f62..94f5ee1 100644 --- a/src/servlet/S_SecretaryFillOpeningReportRecord.java +++ b/src/servlet/S_SecretaryFillOpeningReportRecord.java @@ -8,7 +8,7 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Map; -@WebServlet("secretary-fill-opening-report-record") +@WebServlet("/secretary-fill-opening-report-record") public class S_SecretaryFillOpeningReportRecord extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String id = request.getParameter("id"); diff --git a/src/servlet/S_SecretaryFillReplyRecord.java b/src/servlet/S_SecretaryFillReplyRecord.java index 90a10fa..9efee5e 100644 --- a/src/servlet/S_SecretaryFillReplyRecord.java +++ b/src/servlet/S_SecretaryFillReplyRecord.java @@ -8,7 +8,7 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Map; -@WebServlet("secretary-fill-reply-record") +@WebServlet("/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"); diff --git a/src/servlet/S_StudentUploadFinishedProduct.java b/src/servlet/S_StudentUploadFinishedProduct.java index 20f2fb5..b7271e4 100644 --- a/src/servlet/S_StudentUploadFinishedProduct.java +++ b/src/servlet/S_StudentUploadFinishedProduct.java @@ -14,7 +14,16 @@ 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 = "000"; - //String id = request.getParameter("id"); - String fileURL = servlet.Utils.saveFile(request, fileType); + //String files = request.getParameter("file"); + System.out.print("123"); + System.out.print( request.getPart("file")); + System.out.print("123"); + try { + String fileURL = servlet.Utils.saveFile(request, fileType); + }catch (Exception e) + { + System.out.print(e); + } + System.out.print("222"); } } diff --git a/src/servlet/S_TeacherTeamFillOpeningReportOpinion.java b/src/servlet/S_TeacherTeamFillOpeningReportOpinion.java index c43e7fd..2e35294 100644 --- a/src/servlet/S_TeacherTeamFillOpeningReportOpinion.java +++ b/src/servlet/S_TeacherTeamFillOpeningReportOpinion.java @@ -8,7 +8,7 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Map; -@WebServlet("teacher-team-fill-opening-report-opinion") +@WebServlet("/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"); diff --git a/src/servlet/S_TeacherTeamFillScoreOpinion.java b/src/servlet/S_TeacherTeamFillScoreOpinion.java index a82b234..3a70590 100644 --- a/src/servlet/S_TeacherTeamFillScoreOpinion.java +++ b/src/servlet/S_TeacherTeamFillScoreOpinion.java @@ -8,7 +8,7 @@ import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Map; -@WebServlet("teacher-team-fill-score-opinion") +@WebServlet("/teacher-team-fill-score-opinion") public class S_TeacherTeamFillScoreOpinion extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String id = request.getParameter("id"); diff --git a/src/servlet/Utils.java b/src/servlet/Utils.java index 3cea1d0..42e08b9 100644 --- a/src/servlet/Utils.java +++ b/src/servlet/Utils.java @@ -39,7 +39,7 @@ public interface Utils { return getFilePath(table)+getFileName(fileName); } static String saveFile(HttpServletRequest request, String table) throws IOException, ServletException { - Part part = request.getPart("graduation_design"); + Part part = request.getPart("file"); String header = part.getHeader("content-disposition"); String path = header.substring(header.indexOf("filename=") + 10, header.length() - 1); String filePathName = servlet.Utils.getFilePathName(table,path); diff --git a/web/home.jsp b/web/home.jsp index 69b6a30..d2bc92d 100644 --- a/web/home.jsp +++ b/web/home.jsp @@ -1,5 +1,8 @@ <%@ page import="java.util.List" %> -<%@ page import="java.util.ArrayList" %><%-- +<%@ page import="java.util.ArrayList" %> +<%@ page import="core.user.User" %> +<%@ page import="core.process.Condition" %> +<%@ page import="core.process.Process" %><%-- Created by IntelliJ IDEA. User: lenovo Date: 2019/1/9 @@ -28,13 +31,14 @@ -<%String type="teacher";pageContext.setAttribute("userType",type);%> -<%List list=new ArrayList<>(); - list.add("001"); - list.add("002"); +<% + User user=(User)session.getAttribute("user"); + String type=user.getType(); + pageContext.setAttribute("userType",type); + Condition condition=user.getCondition(); + //List pList=condition.getProcesses(); + int length=0; int index=0; - pageContext.setAttribute("list",list); - session.setAttribute("list",list); %>
diff --git a/web/jsFile/upload_action.js b/web/jsFile/upload_action.js index c756a06..866ac3a 100644 --- a/web/jsFile/upload_action.js +++ b/web/jsFile/upload_action.js @@ -6,17 +6,18 @@ $(document).ready(function () { function sendFile() { var fileData =new FormData(); var Url4='student-upload-finished-product'; - var file=$('.true-select').files; + var file=$('#select')[0].files[0]; if($('.true-select').val()=='') { alert("请选择文件"); return; } + alert(file); fileData.append("file",file); $.ajax({ type:"post", url:Url4, - date:fileData, + data:fileData, processData:false, contentType:false, success:function (data,status) { diff --git a/web/upload_file.jsp b/web/upload_file.jsp index 3047a1e..e91e272 100644 --- a/web/upload_file.jsp +++ b/web/upload_file.jsp @@ -23,9 +23,11 @@
-
+
+
选择文件
-
上传文件
+
上传文件
+