package com.hrms.action;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.sf.json.JSONObject;
import org.apache.struts2.ServletActionContext;
import com.hrms.models.CheckingInfo;
import com.hrms.models.DepartmentInfo;
import com.hrms.models.JoinIn;
import com.hrms.models.PersonalInfo;
import com.hrms.models.RegisterInfo;
import com.hrms.models.SalaryInfo;
import com.hrms.models.TrainInfo;
import com.hrms.models.TransferRecord;
import com.hrms.service.DAOService;
import com.opensymphony.xwork2.ActionSupport;
public class search extends ActionSupport {
/**
*
*/
private static final long serialVersionUID = 1L;
private HttpServletResponse response = ServletActionContext.getResponse();
private HttpServletRequest request = ServletActionContext.getRequest();
@SuppressWarnings({ "rawtypes", "unchecked" })
public String personalInfo() {
String employeeID = request.getParameter("employeeID");
System.out.println(employeeID);
DAOService.startTransaction();
List<PersonalInfo> listPersonalInfo = (List<PersonalInfo>) DAOService
.getPersonalinfodao().findByEmployeeID(employeeID);
DAOService.commitinfo();
Map map=new HashMap();
map.put("employeeID", listPersonalInfo.get(0).getEmployeeID());
map.put("name", listPersonalInfo.get(0).getName());
map.put("age", listPersonalInfo.get(0).getAge().toString());
map.put("sex", listPersonalInfo.get(0).getSex());
map.put("departmentName", listPersonalInfo.get(0).getDepartmentName());
map.put("jobName", listPersonalInfo.get(0).getJobName());
map.put("cardID", listPersonalInfo.get(0).getCardID());
map.put("phone", listPersonalInfo.get(0).getPhone());
map.put("graduteSchool", listPersonalInfo.get(0).getGraduateSchool());
map.put("politicsStatus", listPersonalInfo.get(0).getPoliticsStatus());
map.put("nativePlace", listPersonalInfo.get(0).getNativePlace());
map.put("localAddress", listPersonalInfo.get(0).getLocalAddress());
map.put("education", listPersonalInfo.get(0).getEducation());
System.out.println(map);
JSONObject json=new JSONObject();
json=JSONObject.fromObject(map); //返回json格式的数据到页面
System.out.println(json);
try {
response.setContentType("application/json;charset=utf-8");
response.getWriter().print(json);
response.getWriter().close();
response.getWriter().flush();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
public String departmentInfo(){
DAOService.startTransaction();
List<DepartmentInfo> listAll=(List<DepartmentInfo>)DAOService.getDepartmentinfodao().findAll();
DAOService.commitinfo();
System.out.println(listAll);
Map map = new HashMap();
map.put("total", listAll.size());
map.put("rows", listAll); // 将list对象封装成map对象
JSONObject jObject=new JSONObject();
jObject = JSONObject.fromObject(map); // 将map对象转换成为json对象
System.out.println(jObject);
try {
response.setContentLength(jObject.toString().getBytes("UTF-8").length);
response.setContentType("application/json;charset=utf-8");
response.getWriter().write(jObject.toString());
response.getWriter().flush();
response.getWriter().close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
public String transferRecord(){
String employeeID = request.getParameter("employeeID");
DAOService.startTransaction();
List<TransferRecord> listTransferRecords=(List<TransferRecord>)DAOService.getTransferrecorddao().findByEmployeeID(employeeID);
DAOService.commitinfo();
System.out.println(listTransferRecords);
Map map = new HashMap();
map.put("total", listTransferRecords.size());
map.put("rows", listTransferRecords); // 将list对象封装成map对象
System.out.println(map);
JSONObject jObject=new JSONObject();
jObject = JSONObject.fromObject(map); // 将map对象转换成为json对象
System.out.println(jObject);
try {
response.setContentLength(jObject.toString().getBytes("UTF-8").length);
response.setContentType("application/json;charset=utf-8");
response.getWriter().write(jObject.toString());
response.getWriter().flush();
response.getWriter().close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
public String trainInfo(){
String employeeID = request.getParameter("employeeID");
DAOService.startTransaction();
List<JoinIn> listJoinInfo=(List<JoinIn>)DAOService.getJoinindao().findByEmployeeID(employeeID);
List<TrainInfo> listTrainInfo=(List<TrainInfo>)DAOService.getTraininfodao().findByTrainID(listJoinInfo.get(0).getTrainID());
DAOService.commitinfo();
System.out.println(listTrainInfo);
Map map = new HashMap();
map.put("total", listTrainInfo.size());
map.put("rows", listTrainInfo); // 将list对象封装成map对象
System.out.println(map);
JSONObject jObject=new JSONObject();
jObject = JSONObject.fromObject(map); // 将map对象转换成为json对象
System.out.println(jObject);
try {
response.setContentLength(jObject.toString().getBytes("UTF-8").length);
response.setContentType("application/json;charset=utf-8");
response.getWriter().write(jObject.toString());
response.getWriter().flush();
response.getWriter().close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
public String checkingInfo(){
String employeeID = request.getParameter("employeeID");
String startTime=request.getParameter("startTime")+" 00:00:00:0";
String endTime=request.getParameter("endTime")+" 00:00:00:0";
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); //将页面传来的String型时间转化为指定格式的Date型时间
Date starttime=new Date();
Date endtime=new Date();
try {
starttime = sdf.parse(startTime);
endtime=sdf.parse(endTime);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
DAOService.startTransaction();
List<CheckingInfo> listcCheckingInfos=(List<CheckingInfo>)DAOService.getCheckinginfodao().findByTime( employeeID, starttime, endtime);
DAOService.commitinfo();
System.out.println(listcCheckingInfos);
Map map = new HashMap();
map.put("total", listcCheckingInfos.size());
map.put("rows", listcCheckingInfos); // 将list对象封装成map对象
System.out.println(map);
JSONObject jObject=new JSONObject();
jObject = JSONObject.fromObject(map); // 将map对象转换成为json对象
System.out.println(jObject);
try {
response.setContentLength(jObject.toString().getBytes("UTF-8").length);
response.setContentType("application/json;charset=utf-8");
response.getWriter().write(jObject.toString());
response.getWriter().flush();
response.getWriter().close();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
public String salaryInfo(){
String employeeID = request.getParameter("employeeID");
String startTime=request.getParameter("startTime")+" 00:00:00:0";
String endTime=request.getParameter("endTime")+" 00:00:00:0";
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); //将页面传来的String型时间转化为指定格式的Date型时间
Date starttime=new Date();
Date endtime=new Date();
try {
starttime = sdf.parse(startTim
没有合适的资源?快使用搜索试试~ 我知道了~
HRMS.zip_HRMS
共177个文件
jar:51个
java:27个
class:27个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 63 浏览量
2022-09-14
22:13:05
上传
评论
收藏 19.68MB ZIP 举报
温馨提示
基于web开发的一个人力资源管理系统,同时也涉及到连接MySQL数据库对信息进行管理。
资源推荐
资源详情
资源评论
收起资源包目录
HRMS.zip_HRMS (177个子文件)
background.bmp 2.08MB
search.class 9KB
CheckingInfoDAO.class 5KB
SalaryInfoDAO.class 5KB
TransferRecordDAO.class 5KB
ApplicationInfo.class 5KB
RegisterInfoDAO.class 5KB
PersonalInfoDAO.class 5KB
TrainInfoDAO.class 5KB
JoinInDAO.class 5KB
ApplicationInfoDAO.class 5KB
DepartmentInfoDAO.class 5KB
CompanyInfoDAO.class 5KB
searchMa.class 5KB
PersonalInfo.class 4KB
DAOService.class 3KB
SalaryInfo.class 3KB
CheckingInfo.class 3KB
HibernateSessionFactory.class 3KB
TrainInfo.class 3KB
CompanyInfo.class 3KB
login.class 2KB
DepartmentInfo.class 2KB
TransferRecord.class 2KB
RegisterInfo.class 1KB
JoinIn.class 1KB
BaseHibernateDAO.class 494B
IBaseHibernateDAO.class 178B
.classpath 5KB
org.eclipse.wst.common.component 473B
org.eclipse.wst.jsdt.ui.superType.container 49B
easyui.css 50KB
datepicker.css 4KB
datepicker.css 4KB
icon.css 2KB
style.css 491B
demo.css 306B
WdatePicker.css 192B
loading.gif 2KB
img.gif 2KB
img.gif 2KB
datePicker.gif 1KB
blank.gif 43B
hibernate-core-4.1.4.Final.jar 4.21MB
hibernate-core-4.1.1.Final.jar 4.18MB
xwork-core-2.2.1.jar 997KB
freemarker-2.3.19.jar 909KB
struts2-core-2.2.1.jar 755KB
struts2-embeddedjsp-plugin-2.2.1.jar 662KB
xwork-core-2.3.16.3.jar 639KB
javassist-3.15.0-GA.jar 633KB
javassist-3.11.0.GA.jar 600KB
commons-collections.jar 558KB
commons-collections-3.2.jar 558KB
dwr.jar 491KB
log4j-1.2.17.jar 478KB
hibernate-entitymanager-4.1.4.Final.jar 466KB
sqljdbc4.jar 455KB
antlr-2.7.7.jar 435KB
commons-lang3-3.1.jar 308KB
dom4j-1.6.1.jar 307KB
commons-lang-2.4.jar 256KB
commons-lang.jar 237KB
ognl-3.0.jar 224KB
ognl-3.0.6.jar 223KB
servlet-api.jar 193KB
commons-beanutils.jar 184KB
commons-beanutils-1.7.0.jar 184KB
commons-io-2.2.jar 170KB
json-lib-2.4-jdk15.jar 155KB
commons-digester-2.0.jar 145KB
commons-validator-1.3.1.jar 136KB
json-lib-2.1-jdk15.jar 122KB
hibernate-jpa-2.0-api-1.0.1.Final.jar 100KB
commons-chain-1.2.jar 90KB
ezmorph-1.0.6.jar 84KB
hibernate-commons-annotations-4.0.1.Final.jar 79KB
commons-fileupload-1.3.1.jar 67KB
struts2-convention-plugin-2.2.1.jar 64KB
oro-2.0.8.jar 64KB
commons-logging-1.1.3.jar 61KB
commons-logging.jar 59KB
jboss-logging-3.1.0.GA.jar 59KB
struts2-json-plugin-2.2.1.jar 55KB
commons-logging-api-1.1.jar 44KB
asm-3.3.jar 43KB
asm-commons-3.3.jar 37KB
classworlds-1.1.jar 37KB
sslext-1.2-0.jar 26KB
slf4j-api-1.6.1.jar 25KB
asm-tree-3.3.jar 21KB
jboss-transaction-api_1.1_spec-1.0.0.Final.jar 11KB
slf4j-log4j12-1.7.7.jar 9KB
aopalliance-1.0.jar 4KB
search.java 10KB
searchMa.java 5KB
ApplicationInfo.java 4KB
CheckingInfoDAO.java 4KB
SalaryInfoDAO.java 4KB
TransferRecordDAO.java 4KB
共 177 条
- 1
- 2
资源评论
weixin_42651887
- 粉丝: 79
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功