diff --git a/README.md b/README.md index 6209089..0703013 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ # EpidemicTraces A web project that shows latest change of COVID-19 + + + diff --git a/src/main/java/com/peteralbus/controller/InfoCollectController.java b/src/main/java/com/peteralbus/controller/InfoCollectController.java index 837bd7a..58694ad 100644 --- a/src/main/java/com/peteralbus/controller/InfoCollectController.java +++ b/src/main/java/com/peteralbus/controller/InfoCollectController.java @@ -26,6 +26,7 @@ public class InfoCollectController @RequestMapping("/clock_in") public ModelAndView ClockIn(HttpServletRequest request, HttpServletResponse response) { + String stu_school=request.getParameter("stu_school"); int stu_id= Integer.parseInt(request.getParameter("stu_id")); String stu_name=request.getParameter("stu_name"); String stu_address=request.getParameter("stu_address"); @@ -38,9 +39,8 @@ public class InfoCollectController Date date = new Date(); SimpleDateFormat sdf = new SimpleDateFormat( " yyyy-MM-dd" ); 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); - System.out.println(id); ModelAndView modelAndView=new ModelAndView(); modelAndView.addObject("clock_in",clockInInfo); modelAndView.setViewName("/pages/info_collection/success.jsp"); diff --git a/src/main/java/com/peteralbus/domain/ClockInInfo.java b/src/main/java/com/peteralbus/domain/ClockInInfo.java index f262549..0a6f6a7 100644 --- a/src/main/java/com/peteralbus/domain/ClockInInfo.java +++ b/src/main/java/com/peteralbus/domain/ClockInInfo.java @@ -4,6 +4,7 @@ import java.sql.Date; public class ClockInInfo { + String stu_school; int clock_id; int stu_id; String stu_name; @@ -16,8 +17,24 @@ public class ClockInInfo String stu_back; 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) { - clock_id=0; + public String getStu_school() { + 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_name = stu_name; this.stu_address = stu_address; @@ -30,8 +47,9 @@ public class ClockInInfo 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) { - this.clock_id=clock_id; + 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.stu_id = stu_id; this.stu_name = stu_name; this.stu_address = stu_address; @@ -123,4 +141,22 @@ public class ClockInInfo public void setStu_back(String 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 + '\'' + + '}'; + } } diff --git a/src/main/resources/com/peteralbus/dao/StudentInfoDao.xml b/src/main/resources/com/peteralbus/dao/StudentInfoDao.xml index 95663c5..b19229a 100644 --- a/src/main/resources/com/peteralbus/dao/StudentInfoDao.xml +++ b/src/main/resources/com/peteralbus/dao/StudentInfoDao.xml @@ -7,7 +7,7 @@ select last_insert_id() - 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}) +
@@ -54,7 +58,9 @@
- + @@ -62,6 +68,7 @@ +