Merge remote-tracking branch 'remotes/origin/master' into zgl

zgl
zgl 6 years ago
commit 0cdb2e654c

@ -0,0 +1,16 @@
<component name="ArtifactManager">
<artifact type="exploded-war" name="gdms:Web exploded">
<output-path>$PROJECT_DIR$/out/artifacts/gdms_Web_exploded</output-path>
<root id="root">
<element id="javaee-facet-resources" facet="gdms/web/Web" />
<element id="directory" name="WEB-INF">
<element id="directory" name="classes">
<element id="module-output" name="gdms" />
</element>
<element id="directory" name="lib">
<element id="file-copy" path="C:/Program Files/Apache Software Foundation/Tomcat 9.0/lib/tomcat-jdbc.jar" />
</element>
</element>
</root>
</artifact>
</component>

@ -36,6 +36,25 @@ public class C_StudentSearchTeacher extends TempProcess{
TeacherInfo.put("phone_number",s[4]);
return TeacherInfo;
}
public List<Map<String,String>> _search() throws Exception{
if(!check()) throw new GExcptInit("teacherId Attrs init error!");
Search search = new Search() ;
search.setOptions(new HashMap<>());
search.addOptions("table",table);
List<String> fields = new ArrayList<>();
fields.add("*");
search.addOptions("field",fields);
Map<String,String> limits = new HashMap<>();
limits.put("id",this.getTeacherID());
search.addOptions("limits",limits);
search.addOptions("start",0);
search.addOptions("end",10);
Map<String, Object> options = search.execute(null);
List<String[]> result = (List<String[]>) options.get("result");
List<Map<String,String>> teachersInfo = new ArrayList<>();
core.process.Utils.formatResult(result, teachersInfo);
return teachersInfo;
}
protected boolean check() {
if(this.getTeacherID()==null)

@ -1,5 +1,6 @@
package core.process;
import core.operation.Search;
import core.operation.Select;
import error.GExcptInit;
@ -22,6 +23,24 @@ public class C_StudentSelectTeacher extends TempProcess {
select.addOptions("teacher_id",this.getTeacherId());
Map<String,Object> options=select.execute(null);
}
public List<Map<String,String>> search(String teacherId) throws Exception{
Search search = new Search() ;
search.setOptions(new HashMap<>());
search.addOptions("table","teacher");
List<String> fields = new ArrayList<>();
fields.add("*");
search.addOptions("field",fields);
Map<String,String> limits = new HashMap<>();
limits.put("id",teacherId);
search.addOptions("limits",limits);
search.addOptions("start",0);
search.addOptions("end",10);
Map<String, Object> options = search.execute(null);
List<String[]> result = (List<String[]>) options.get("result");
List<Map<String,String>> teachersInfo = new ArrayList<>();
core.process.Utils.formatResult(result, teachersInfo);
return teachersInfo;
}
protected boolean check() {
if(this.getStudentId()==null||this.getTeacherId()==null)
return false;

@ -48,18 +48,11 @@ public class C_TeacherSearchStudent extends TempProcess {
limits.put("id",this.getStudentId());
search.addOptions("limits",limits);
search.addOptions("start",0);
search.addOptions("end",1);
search.addOptions("end",10);
Map<String, Object> options = search.execute(null);
List<String[]> result = (List<String[]>) options.get("result");
List<Map<String,String>> studentsInfo = new ArrayList<>();
for(String[] s:result){
Map<String,String> studentInfo = new HashMap<>();
studentInfo.put("id",s[0]);
studentInfo.put("name",s[2]);
studentInfo.put("e_mail_location",s[3]);
studentInfo.put("phone_number",s[4]);
studentsInfo.add(studentInfo);
}
core.process.Utils.formatResult(result, studentsInfo);
return studentsInfo;
}
protected boolean check() {

@ -1,5 +1,6 @@
package core.process;
import core.operation.Search;
import core.operation.Select;
import error.GExcptInit;
@ -22,6 +23,24 @@ public class C_TeacherSelectStudent extends TempProcess {
select.addOptions("student_id",this.getStudentId());
Map<String,Object> options=select.execute(null);
}
public List<Map<String,String>> search(String studentId) throws Exception{
Search search = new Search() ;
search.setOptions(new HashMap<>());
search.addOptions("table","student");
List<String> fields = new ArrayList<>();
fields.add("*");
search.addOptions("field",fields);
Map<String,String> limits = new HashMap<>();
limits.put("id",studentId);
search.addOptions("limits",limits);
search.addOptions("start",0);
search.addOptions("end",10);
Map<String, Object> options = search.execute(null);
List<String[]> result = (List<String[]>) options.get("result");
List<Map<String,String>> studentsInfo = new ArrayList<>();
core.process.Utils.formatResult(result, studentsInfo);
return studentsInfo;
}
protected boolean check() {
if(this.getStudentId()==null||this.getTeacherId()==null)
return false;

@ -3,7 +3,7 @@ package core.process;
import java.util.ArrayList;
import java.util.List;
public class Condition {//条件
public class Condition {
public List<Process> getProcesses() {
return processes;
}

@ -0,0 +1,18 @@
package core.process;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public interface Utils {
static void formatResult(List<String[]> result, List<Map<String, String>> studentsInfo) {
for(String[] s:result){
Map<String,String> studentInfo = new HashMap<>();
studentInfo.put("id",s[0]);
studentInfo.put("name",s[2]);
studentInfo.put("e_mail_location",s[3]);
studentInfo.put("phone_number",s[4]);
studentsInfo.add(studentInfo);
}
}
}

@ -6,7 +6,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebFilter(filterName = "OnlineCheck",urlPatterns = "/home.jsp")
@WebFilter(filterName = "OnlineCheck",urlPatterns = "/home*")
public class OnlineCheck implements Filter {
public void destroy() {
}

@ -2,7 +2,7 @@ package gdms;
public interface Configuration {
//file
String filePath = "/";
String filePath = "C:/Users/zhai_/Desktop/";
//database
String dbUrl="jdbc:mariadb://localhost:3306/gdms";
String dbUsername="gdms";

@ -26,4 +26,5 @@ public class S_StudentSelectTeacher extends HttpServlet {
response.sendRedirect("/op_fail.jsp");
}
}
}

@ -13,17 +13,14 @@ import java.io.IOException;
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 files = request.getParameter("file");
System.out.print("123");
System.out.print( request.getPart("file"));
System.out.print("123");
String id = request.getParameter("id");
String fileURL;
try {
String fileURL = servlet.Utils.saveFile(request, fileType);
fileURL = servlet.Utils.saveFile(request, fileType);
}catch (Exception e)
{
System.out.print(e);
response.sendRedirect("/op_fail.jsp");
}
System.out.print("222");
}
}

@ -36,7 +36,7 @@
String type=user.getType();
pageContext.setAttribute("userType",type);
Condition condition=user.getCondition();
//List<Process> pList=condition.getProcesses();
/*List<Process> pList=condition.getProcesses();*/
int length=0;
int index=0;
%>

@ -7,19 +7,17 @@
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%String a=request.getParameter("id");
String b[][]=new String[3][3];
for(int i=0;i<3;i++)
for(int j=0;j<3;j++)
b[i][j]="hello";
<%
String id=request.getParameter("id");
String searchType=request.getParameter("searchType");
%>
<%%>
<div class="list-child">
<div class="name"><span class="the-name"><%=a%></span></div>
<div class="name"><span class="the-name"><%=searchType%></span></div>
<div class="other-msgs">
<%for(int k=0;k<2;k++)
for (int n=0;n<2;n++)
out.print(" <div class=\"one-msg\">电话号码:"+b[k][n]+"</div>");
out.print(" <div class=\"one-msg\">电话号码:"+k+n+"</div>");
%>
<div class="one-msg">电话号码18711191679</div>
</div>

@ -54,7 +54,7 @@
</div>
<div class="search-frame">
<input class="search-input" type="text" name="id" value="" placeholder="输入学号查找">
<div class="search-button"></div>
<div class="search-button ${type}"></div>
</div>
</div>
<div class="count-select">

@ -1,10 +1,12 @@
$(document).ready(function () {
$(document).off('click',searchmsg).on('click','.search-button',searchmsg);
$(document).off('keydown',searchmsg).on('keydown','.search-input',KDsearchmsg);
$(document).off('click',searchStuMsg).on('click','.search-button.teacher',searchStuMsg);
$(document).off('click',searchTeaMsg).on('click','.search-button.student',searchTeaMsg);
$(document).off('keydown',KDsearchSmsg).on('keydown','.search-button.teacher',KDsearchSmsg);
$(document).off('keydown',KDsearchTmsg).on('keydown','.search-button.student',KDsearchTmsg);
$(document).off('click',teacherSelect).on('click','.select-it.teacher',teacherSelect);
$(document).off('click',studentSelect).on('click','.select-it.student',studentSelect);
})
function searchmsg(e) {
function searchStuMsg(e) {
if($('.search-input').val()=='')
{
e.preventDefault();
@ -12,15 +14,36 @@ function searchmsg(e) {
}
else {
var id=$('.search-input').val();
var rqDate={"id":id};
var searchType='teacher';
var rqDate={"id":id,"searchType":searchType};
var Url1='result_list.jsp';
$('.list-frame').load(Url1,rqDate);
}
}
function KDsearchmsg(e) {
function searchTeaMsg(e) {
if($('.search-input').val()=='')
{
e.preventDefault();
alert('请输入学号');
}
else {
var id=$('.search-input').val();
var searchType='student';
var rqDate={"id":id,"searchType":searchType};
var Url1='result_list.jsp';
$('.list-frame').load(Url1,rqDate);
}
}
function KDsearchSmsg(e) {
if(e.keyCode==13)
{
searchStuMsg(e);
}
}
function KDsearchTmsg(e) {
if(e.keyCode==13)
{
searchmsg(e);
searchTeaMsg(e);
}
}
function select_one(Url2,button) {

@ -5,7 +5,7 @@ $(document).ready(function () {
})
function sendFile() {
var fileData =new FormData();
var Url4='student-upload-finished-product';
var Url4='/student-upload-finished-product';
var file=$('#select')[0].files[0];
if($('.true-select').val()=='')
{

Loading…
Cancel
Save