CLOCK UPDATE SCHOOL

dev
PeterAlbus 4 years ago
parent 2c4006bf58
commit c9ce96c931

@ -1,2 +1,5 @@
# EpidemicTraces # EpidemicTraces
A web project that shows latest change of COVID-19 A web project that shows latest change of COVID-19

@ -26,6 +26,7 @@ public class InfoCollectController
@RequestMapping("/clock_in") @RequestMapping("/clock_in")
public ModelAndView ClockIn(HttpServletRequest request, HttpServletResponse response) public ModelAndView ClockIn(HttpServletRequest request, HttpServletResponse response)
{ {
String stu_school=request.getParameter("stu_school");
int stu_id= Integer.parseInt(request.getParameter("stu_id")); int stu_id= Integer.parseInt(request.getParameter("stu_id"));
String stu_name=request.getParameter("stu_name"); String stu_name=request.getParameter("stu_name");
String stu_address=request.getParameter("stu_address"); String stu_address=request.getParameter("stu_address");
@ -38,9 +39,8 @@ public class InfoCollectController
Date date = new Date(); Date date = new Date();
SimpleDateFormat sdf = new SimpleDateFormat( " yyyy-MM-dd" ); SimpleDateFormat sdf = new SimpleDateFormat( " yyyy-MM-dd" );
String nowTime = sdf.format(date); String nowTime = sdf.format(date);
ClockInInfo clockInInfo=new ClockInInfo(stu_id,stu_name,stu_address,stu_class,stu_tmp,is_out,stu_des,stu_out,stu_back,nowTime); ClockInInfo clockInInfo=new ClockInInfo(stu_school,stu_id,stu_name,stu_address,stu_class,stu_tmp,is_out,stu_des,stu_out,stu_back,nowTime);
int id=infoCollectService.ClockIn(clockInInfo); int id=infoCollectService.ClockIn(clockInInfo);
System.out.println(id);
ModelAndView modelAndView=new ModelAndView(); ModelAndView modelAndView=new ModelAndView();
modelAndView.addObject("clock_in",clockInInfo); modelAndView.addObject("clock_in",clockInInfo);
modelAndView.setViewName("/pages/info_collection/success.jsp"); modelAndView.setViewName("/pages/info_collection/success.jsp");

@ -4,6 +4,7 @@ import java.sql.Date;
public class ClockInInfo public class ClockInInfo
{ {
String stu_school;
int clock_id; int clock_id;
int stu_id; int stu_id;
String stu_name; String stu_name;
@ -16,8 +17,24 @@ public class ClockInInfo
String stu_back; String stu_back;
String clock_date; String clock_date;
public ClockInInfo(int stu_id, String stu_name, String stu_address, String stu_class, double stu_tmp, boolean is_out, String stu_des, String stu_out, String stu_back, String clock_date) { public String getStu_school() {
clock_id=0; return stu_school;
}
public void setStu_school(String stu_school) {
this.stu_school = stu_school;
}
public int getClock_id() {
return clock_id;
}
public void setClock_id(int clock_id) {
this.clock_id = clock_id;
}
public ClockInInfo(String stu_school, int stu_id, String stu_name, String stu_address, String stu_class, double stu_tmp, boolean is_out, String stu_des, String stu_out, String stu_back, String clock_date) {
this.stu_school = stu_school;
this.stu_id = stu_id; this.stu_id = stu_id;
this.stu_name = stu_name; this.stu_name = stu_name;
this.stu_address = stu_address; this.stu_address = stu_address;
@ -30,7 +47,8 @@ public class ClockInInfo
this.clock_date = clock_date; this.clock_date = clock_date;
} }
public ClockInInfo(int clock_id,int stu_id, String stu_name, String stu_address, String stu_class, double stu_tmp, boolean is_out, String stu_des, String stu_out, String stu_back, Date clock_date) { public ClockInInfo( int clock_id,String stu_school, int stu_id, String stu_name, String stu_address, String stu_class, double stu_tmp, boolean is_out, String stu_des, String stu_out, String stu_back, Date clock_date) {
this.stu_school = stu_school;
this.clock_id = clock_id; this.clock_id = clock_id;
this.stu_id = stu_id; this.stu_id = stu_id;
this.stu_name = stu_name; this.stu_name = stu_name;
@ -123,4 +141,22 @@ public class ClockInInfo
public void setStu_back(String stu_back) { public void setStu_back(String stu_back) {
this.stu_back = stu_back; this.stu_back = stu_back;
} }
@Override
public String toString() {
return "ClockInInfo{" +
"stu_school='" + stu_school + '\'' +
", clock_id=" + clock_id +
", stu_id=" + stu_id +
", stu_name='" + stu_name + '\'' +
", stu_address='" + stu_address + '\'' +
", stu_class='" + stu_class + '\'' +
", stu_tmp=" + stu_tmp +
", is_out=" + is_out +
", stu_des='" + stu_des + '\'' +
", stu_out='" + stu_out + '\'' +
", stu_back='" + stu_back + '\'' +
", clock_date='" + clock_date + '\'' +
'}';
}
} }

@ -7,7 +7,7 @@
<selectKey resultType="int" order="AFTER"> <selectKey resultType="int" order="AFTER">
select last_insert_id() select last_insert_id()
</selectKey> </selectKey>
insert into epidemic.clock_in(stu_id, stu_name, stu_address, stu_class, stu_tmp, is_out, stu_des, stu_out, stu_back, clock_date) VALUES (#{stu_id},#{stu_name},#{stu_address},#{stu_class},#{stu_tmp},#{is_out},#{stu_des},#{stu_out},#{stu_back},#{clock_date}) insert into epidemic.clock_in(stu_school,stu_id, stu_name, stu_address, stu_class, stu_tmp, is_out, stu_des, stu_out, stu_back, clock_date) VALUES (#{stu_school},#{stu_id},#{stu_name},#{stu_address},#{stu_class},#{stu_tmp},#{is_out},#{stu_des},#{stu_out},#{stu_back},#{clock_date})
</insert> </insert>
<select id="findAll" resultType="ClockInInfo"> <select id="findAll" resultType="ClockInInfo">
select * from epidemic.clock_in select * from epidemic.clock_in

@ -44,6 +44,10 @@
<div class="container"> <div class="container">
<form role="form" action="${pageContext.request.contextPath}/clock_in" method="post"> <form role="form" action="${pageContext.request.contextPath}/clock_in" method="post">
<div class="row"> <div class="row">
<div class="form-group text-left col-sm-12 col-md-12">
<label for="stu_school">学校</label>
<input type="text" class="form-control" id="stu_school" name="stu_school" placeholder="请输入所在学校">
</div>
<div class="form-group text-left col-sm-12 col-md-4"> <div class="form-group text-left col-sm-12 col-md-4">
<label for="stu_id">学号</label> <label for="stu_id">学号</label>
<input type="text" class="form-control" id="stu_id" name="stu_id" placeholder="请输入学号"> <input type="text" class="form-control" id="stu_id" name="stu_id" placeholder="请输入学号">
@ -54,7 +58,9 @@
</div> </div>
<div class="form-group text-left col-sm-12 col-md-4"> <div class="form-group text-left col-sm-12 col-md-4">
<label for="stu_class">班级</label> <label for="stu_class">班级</label>
<select id="stu_class" class="form-control" name="stu_class"> <select class="form-control" id="spec_num1" name="spec_num1"
onchange="document.getElementById('stu_class').value=$('#spec_num1 option:selected').text()">
<option>可从本下拉菜单选择</option>
<option>19计科1</option> <option>19计科1</option>
<option>19计科2</option> <option>19计科2</option>
<option>19计科3</option> <option>19计科3</option>
@ -62,6 +68,7 @@
<option>18计科2</option> <option>18计科2</option>
<option>18计科3</option> <option>18计科3</option>
</select> </select>
<input type="text" class="form-control selectInput" id="stu_class" name="stu_class" placeholder="请选择"/>
</div> </div>
</div> </div>
<div class="form-group text-left selectInput"> <div class="form-group text-left selectInput">

Loading…
Cancel
Save