资源简介
使用ssm+jsp开发的一款人力资源管理系统,本系统界面没有美化,但是功能齐全,含数据库文件
代码片段和文件信息
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 < h && h <= 3) {
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 < h && h <= 3) {
checkon.setGowork_state(“迟到“);
}
if (h > 3) {
checkon.set
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-03-22 15:04 HumanResource\
目录 0 2018-03-22 15:01 HumanResource\HRSSM\
文件 6148 2018-02-28 19:20 HumanResource\HRSSM\.DS_Store
文件 6113 2018-03-01 13:36 HumanResource\HRSSM\.classpath
目录 0 2018-03-22 15:01 HumanResource\HRSSM\.idea\
目录 0 2018-03-22 15:05 HumanResource\HRSSM\.idea\inspectionProfiles\
文件 258 2018-02-28 16:54 HumanResource\HRSSM\.idea\misc.xm
文件 250 2018-02-28 16:55 HumanResource\HRSSM\.idea\modules.xm
文件 27376 2018-02-28 16:57 HumanResource\HRSSM\.idea\workspace.xm
目录 0 2018-03-22 15:05 HumanResource\HRSSM\.myeclipse\
文件 288 2018-03-14 14:55 HumanResource\HRSSM\.myme
文件 1615 2018-03-01 09:35 HumanResource\HRSSM\.project
目录 0 2018-03-22 15:01 HumanResource\HRSSM\.settings\
文件 510 2018-02-28 17:30 HumanResource\HRSSM\.settings\.jsdtscope
文件 118 2018-03-01 08:47 HumanResource\HRSSM\.settings\com.genuitec.eclipse.core.prefs
文件 414 2018-02-28 17:30 HumanResource\HRSSM\.settings\com.genuitec.eclipse.migration.prefs
文件 88 2018-02-28 16:49 HumanResource\HRSSM\.settings\org.eclipse.core.resources.prefs
文件 629 2018-03-01 13:36 HumanResource\HRSSM\.settings\org.eclipse.jdt.core.prefs
文件 532 2018-02-28 17:30 HumanResource\HRSSM\.settings\org.eclipse.wst.common.component
文件 401 2018-02-28 17:30 HumanResource\HRSSM\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2018-02-28 17:30 HumanResource\HRSSM\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2018-02-28 17:30 HumanResource\HRSSM\.settings\org.eclipse.wst.jsdt.ui.superType.name
目录 0 2018-03-22 15:01 HumanResource\HRSSM\WebRoot\
目录 0 2018-03-22 15:01 HumanResource\HRSSM\WebRoot\me
文件 36 2018-02-28 16:36 HumanResource\HRSSM\WebRoot\me
文件 303 2018-02-28 16:40 HumanResource\HRSSM\WebRoot\UpdateSalary.jsp
目录 0 2018-03-22 15:02 HumanResource\HRSSM\WebRoot\WEB-INF\
目录 0 2018-03-22 15:02 HumanResource\HRSSM\WebRoot\WEB-INF\classes\
目录 0 2018-03-22 15:02 HumanResource\HRSSM\WebRoot\WEB-INF\classes\me
文件 25 2018-02-28 17:30 HumanResource\HRSSM\WebRoot\WEB-INF\classes\me
目录 0 2018-03-22 15:01 HumanResource\HRSSM\WebRoot\WEB-INF\classes\com\
............此处省略350个文件信息
评论
共有 条评论