資源簡介
人力資源管理系統,Spring+SpringMvc+MyBatis,畢業設計,web頁面簡單,邏輯清晰
代碼片段和文件信息
package?com.iotek.controller;
import?com.iotek.entity.Checkon;
import?com.iotek.entity.Employee;
import?com.iotek.service.CheckonService;
import?com.iotek.service.EmployeeService;
import?org.springframework.stereotype.Controller;
import?org.springframework.ui.ModelMap;
import?org.springframework.web.bind.annotation.RequestMapping;
import?javax.annotation.Resource;
import?javax.servlet.http.HttpSession;
import?java.text.ParseException;
import?java.text.SimpleDateFormat;
import?java.util.Date;
import?java.util.List;
/**
?*?Created?by?Mbenben?on?2017/4/21.
?*/
@Controller(“checkAction“)
public?class?CheckAction?{
????@Resource(name?=?“empolyeeService“)
????private?EmployeeService?employeeService;
????@Resource(name?=?“checkonService“)
????private?CheckonService?checkonService;
????//上班簽到
????@RequestMapping(“/addCheckon.action“)
????public?String?addCheckon(HttpSession?session?ModelMap?map)?throws?ParseException?{
????????Employee?employee?=?(Employee)?session.getAttribute(“employee“);
????????SimpleDateFormat?sdf?=?new?SimpleDateFormat(“HH:mm“);
????????SimpleDateFormat?sdf1?=?new?SimpleDateFormat(“yyyy-MM-dd“);
????????String?source?=?“9:00“;//上班規定時間
????????double?h?=?0;
????????Date?date?=?null;
????????Date?date1?=?null;
????????try?{
????????????date?=?sdf.parse(source);
????????????date1?=?sdf.parse(sdf.format(new?Date()));
????????????h?=?(date1.getTime()?-?date.getTime())?/?1000?/?3600.0;
????????}?catch?(ParseException?e)?{
????????????e.printStackTrace();
????????}
????????List?checkonList?=?checkonService.getCheckonByEid(employee.getEid());
????????if?(checkonList.size()?!=?0)?{
????????????Checkon?checkon?=?checkonList.get(checkonList.size()?-?1);
????????????Date?date2?=?sdf1.parse(sdf1.format(checkon.getStarttime()));
????????????Date?date3?=?sdf1.parse(sdf1.format(new?Date()));
????????????if?(!date2.equals(date3))?{
????????????????Checkon?checkon1?=?new?Checkon();
????????????????checkon1.setStarttime(new?Date());
????????????????checkon.setGowork_state(“正常“);
????????????????if?(0?????????????????????checkon1.setGowork_state(“遲到“);
????????????????}?else?if?(h?>?3)?{
????????????????????checkon1.setGowork_state(“曠工“);
????????????????}
????????????????checkon1.setEmployee(employee);
????????????????checkonService.addChechon(checkon1);
????????????????Checkon?checkon2?=?checkonService.getCheckonByTid(checkon1.getKid());
????????????????session.setAttribute(“checkon2“?checkon2);
????????????????map.addAttribute(“success“?“簽到成功“);
????????????}?else?{
????????????????map.addAttribute(“defeated“?“你已經打過卡了“);
????????????}
????????????return?“showCheckon.jsp“;
????????}
????????Checkon?checkon?=?new?Checkon();
????????checkon.setStarttime(new?Date());
????????checkon.setGowork_state(“正?!埃?
????????if?(0?????????????checkon.setGowork_state(“遲到“);
????????}
????????if?(h?>?3)?{
????????????checkon.set
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????6054??2017-04-12?12:42??HRSSM\.idea\artifacts\HRSSM_war_exploded.xm
?????文件????????449??2017-04-11?10:44??HRSSM\.idea\compiler.xm
?????文件????????124??2017-04-25?10:57??HRSSM\.idea\dataSources\0c37aae9-2238-47ff-8af5-8e31bda37bb1\storage.xm
?????文件??????65536??2017-04-25?18:03??HRSSM\.idea\dataSources\0c37aae9-2238-47ff-8af5-8e31bda37bb1\_me
?????文件???????4096??2017-04-25?18:03??HRSSM\.idea\dataSources\0c37aae9-2238-47ff-8af5-8e31bda37bb1\_me
?????文件??????????8??2017-04-25?18:03??HRSSM\.idea\dataSources\0c37aae9-2238-47ff-8af5-8e31bda37bb1\_me
?????文件??????????8??2017-04-25?18:03??HRSSM\.idea\dataSources\0c37aae9-2238-47ff-8af5-8e31bda37bb1\_me
?????文件?????????76??2017-04-25?18:03??HRSSM\.idea\dataSources\0c37aae9-2238-47ff-8af5-8e31bda37bb1\_me
?????文件??????32768??2017-04-25?18:03??HRSSM\.idea\dataSources\0c37aae9-2238-47ff-8af5-8e31bda37bb1\_me
?????文件??????????8??2017-04-25?18:03??HRSSM\.idea\dataSources\0c37aae9-2238-47ff-8af5-8e31bda37bb1\_me
?????文件????????476??2017-04-25?10:57??HRSSM\.idea\dataSources\0c37aae9-2238-47ff-8af5-8e31bda37bb1\_src_\schema\hr.zip
?????文件??????19027??2017-04-26?10:07??HRSSM\.idea\dataSources\0c37aae9-2238-47ff-8af5-8e31bda37bb1.xm
?????文件???????2323??2017-04-12?13:36??HRSSM\.idea\dataSources\5f5165b9-55e5-49cf-b6e5-8d3a0becc359.xm
?????文件???????1437??2017-04-12?13:43??HRSSM\.idea\dataSources.local.xm
?????文件???????1592??2017-04-12?13:35??HRSSM\.idea\dataSources.xm
?????文件?????????88??2017-04-11?11:03??HRSSM\.idea\dictionaries\Mbenben.xm
?????文件????????282??2017-04-12?12:32??HRSSM\.idea\encodings.xm
?????文件????????232??2017-04-12?13:43??HRSSM\.idea\kotlinc.xm
?????文件????????273??2017-04-11?11:03??HRSSM\.idea\misc.xm
?????文件????????250??2017-04-11?10:44??HRSSM\.idea\modules.xm
?????文件???????8792??2017-04-12?13:52??HRSSM\.idea\uiDesigner.xm
?????文件?????108340??2017-05-05?10:31??HRSSM\.idea\workspace.xm
?????文件???????1537??2017-04-12?13:43??HRSSM\HRSSM.iml
?????文件???????1559??2017-04-28?01:43??HRSSM\out\artifacts\HRSSM_war_exploded\addDept.jsp
?????文件???????2535??2017-04-20?17:23??HRSSM\out\artifacts\HRSSM_war_exploded\addEmployee.jsp
?????文件???????2212??2017-04-28?01:43??HRSSM\out\artifacts\HRSSM_war_exploded\addPost.jsp
?????文件???????3196??2017-04-28?01:43??HRSSM\out\artifacts\HRSSM_war_exploded\addRecruit.jsp
?????文件???????5855??2017-04-28?02:10??HRSSM\out\artifacts\HRSSM_war_exploded\addResume.jsp
?????文件???????2036??2017-04-28?01:43??HRSSM\out\artifacts\HRSSM_war_exploded\addRwandph.jsp
?????文件???????2347??2017-04-28?01:43??HRSSM\out\artifacts\HRSSM_war_exploded\addSalary.jsp
............此處省略570個文件信息
評論
共有 條評論