package com.service;
import java.util.HashMap;
import javax.swing.JOptionPane;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.Model;
import com.dao.DepartDao;
import com.dao.PostDao;
import com.dao.StaffDao;
import com.po.Staff;
@Service("staffService")
@Transactional
public class StaffServiceImpl implements StaffService{
@Autowired
private DepartDao departDao;
@Autowired
private PostDao postDao;
@Autowired
private StaffDao staffDao;
@Override
public String toAdd(Model model) {
model.addAttribute("staff", new Staff());
String sex[] = {"男","女"};
String workform[] = {"正式","临时"};
String staffsource[] = {"校园招聘","社会招聘","军转","其它"};
String politicalstatus[] = {"党员","预备党员","团员"};
String nation[] = {"汉族","蒙古族","回族","藏族","维吾尔族","苗族","彝族","壮族","布依族","朝鲜族","满族","侗族","瑶族","白族","土家族",
"哈尼族","哈萨克族","傣族","黎族","傈僳族","佤族","畲族","高山族","拉祜族","水族","东乡族","纳西族","景颇族","柯尔克孜族",
"土族","达斡尔族","仫佬族","羌族","布朗族","撒拉族","毛南族","仡佬族","锡伯族","阿昌族","普米族","塔吉克族","怒族", "乌孜别克族",
"俄罗斯族","鄂温克族","德昂族","保安族","裕固族","京族","塔塔尔族","独龙族","鄂伦春族","赫哲族","门巴族","珞巴族","基诺族"};
String bloodtype[] = {"A 型","B 型","AB 型","0 型","其他血型","未定血型"};
String maritalstatus[] = {"未婚","已婚","丧偶","离婚","其他"};
String education[] = {"高中及以下","大专","本科","研究生"};
String degree[] = {"无学位","学士","双学士","硕士","博士"};
model.addAttribute("sex", sex);
model.addAttribute("workform", workform);
model.addAttribute("staffsource", staffsource);
model.addAttribute("politicalstatus",politicalstatus);
model.addAttribute("nation", nation);
model.addAttribute("bloodtype", bloodtype);
model.addAttribute("maritalstatus", maritalstatus);
model.addAttribute("education", education);
model.addAttribute("degree", degree);
model.addAttribute("departs", departDao.selectAllDepart());
model.addAttribute("posts", postDao.selectAllPost());
return "staff/addStaff";
}
@Override
public String addStaff(Staff staff) {
staffDao.addStaff(staff);
JOptionPane.showMessageDialog(null, "添加成功!");
return "forward:/staff/selectStaff";
}
@Override
public String selectStaff(Model model, String act) {
model.addAttribute("staff", new Staff());
model.addAttribute("departs", departDao.selectAllDepart());
if("update".equals(act)) {
model.addAttribute("staffs", staffDao.selectAllStaff());
return "staff/updateStaffSelect";
}else if("peroid".equals(act)) {
model.addAttribute("posts", postDao.selectAllPost());
model.addAttribute("staffs", staffDao.selectPeriodStaff());
String status[] = {"正常","转正","延期","不录用"};
model.addAttribute("status", status);
return "staff/staffPeroidSelect";
}else if("ok".equals(act)) {
model.addAttribute("staffs", staffDao.selectOkStaff());
return "staff/staffOkSelect";
}
else {
model.addAttribute("staffs", staffDao.selectAllStaff());
return "staff/selectStaff";
}
}
@Override
public String selectAStaff(Model model, Integer id, String act) {
model.addAttribute("astaff", staffDao.selectAStaff(id));
if("update".equals(act)) {
model.addAttribute("staff", new Staff());
String sex[] = {"男","女"};
String workform[] = {"正式","临时"};
String staffsource[] = {"校园招聘","社会招聘","军转","其它"};
String politicalstatus[] = {"党员","预备党员","团员"};
String nation[] = {"汉族","蒙古族","回族","藏族","维吾尔族","苗族","彝族","壮族","布依族","朝鲜族","满族","侗族","瑶族","白族","土家族",
"哈尼族","哈萨克族","傣族","黎族","傈僳族","佤族","畲族","高山族","拉祜族","水族","东乡族","纳西族","景颇族","柯尔克孜族",
"土族","达斡尔族","仫佬族","羌族","布朗族","撒拉族","毛南族","仡佬族","锡伯族","阿昌族","普米族","塔吉克族","怒族", "乌孜别克族",
"俄罗斯族","鄂温克族","德昂族","保安族","裕固族","京族","塔塔尔族","独龙族","鄂伦春族","赫哲族","门巴族","珞巴族","基诺族"};
String bloodtype[] = {"A 型","B 型","AB 型","0 型","其他血型","未定血型"};
String maritalstatus[] = {"未婚","已婚","丧偶","离婚","其他"};
String education[] = {"高中及以下","大专","本科","研究生"};
String degree[] = {"无学位","学士","双学士","硕士","博士"};
model.addAttribute("sex", sex);
model.addAttribute("workform", workform);
model.addAttribute("staffsource", staffsource);
model.addAttribute("politicalstatus",politicalstatus);
model.addAttribute("nation", nation);
model.addAttribute("bloodtype", bloodtype);
model.addAttribute("maritalstatus", maritalstatus);
model.addAttribute("education", education);
model.addAttribute("degree", degree);
model.addAttribute("departs", departDao.selectAllDepart());
model.addAttribute("posts", postDao.selectAllPost());
return "staff/updateStaff";
}
return "staff/staffDetail";
}
@Override
public String updateStaff(Staff staff) {
staffDao.updateStaff(staff);
JOptionPane.showMessageDialog(null, "修改成功!");
return "forward:/staff/selectStaff?act=update";//转发到修改查询请求
}
@Override
public String selectStaffCon(Staff staff, Model model, String act) {
model.addAttribute("staff", staff);
model.addAttribute("departs", departDao.selectAllDepart());
if("update".equals(act)) {
model.addAttribute("staffs", staffDao.selectStaffCon(staff));
return "staff/updateStaffSelect";
}else if("peroid".equals(act)) {
model.addAttribute("posts", postDao.selectAllPost());
model.addAttribute("staffs", staffDao.selectPeriodStaffCon(staff));
String status[] = {"正常","转正","延期","不录用"};
model.addAttribute("status", status);
return "staff/staffPeroidSelect";
}else if("ok".equals(act)) {
model.addAttribute("staffs", staffDao.staffOkSelectCon(staff));
return "staff/staffOkSelect";
}else {
model.addAttribute("staffs", staffDao.selectStaffCon(staff));
return "staff/selectStaff";
}
}
@Override
public String peroidOp(Integer id, String act1) {
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("id", id);
if("ok".equals(act1)) {
map.put("status", "转正");
}else if("delay".equals(act1)) {
map.put("status", "延期");
}else {
map.put("status", "不录用");
}
staffDao.peroidOp(map);
JOptionPane.showMessageDialog(null, "修改成功!");
return "forward:/staff/selectStaff?act=peroid";
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
基于Java web ssm框架的人事管理系统(源码+数据库).zip
共199个文件
java:40个
class:40个
jar:33个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 31 浏览量
2022-12-05
23:49:53
上传
评论
收藏 14.57MB ZIP 举报
温馨提示
基于Java web ssm开发的人事管理系统,使用Java ee工具导入源码,脚本导入MySQL数据库,修改数据库连接语句,适用于课程设计或者大作业使用。
资源推荐
资源详情
资源评论
收起资源包目录
基于Java web ssm框架的人事管理系统(源码+数据库).zip (199个子文件)
Staff.class 8KB
StaffServiceImpl.class 7KB
DepartServiceImpl.class 4KB
Transfer.class 3KB
PostServiceImpl.class 3KB
TransferServiceImpl.class 3KB
QuitServiceImpl.class 3KB
Quit.class 2KB
Depart.class 2KB
DepartController.class 2KB
MyUtil.class 2KB
StaffController.class 2KB
PostController.class 2KB
AdminServiceImpl.class 2KB
ReportServiceImpl.class 2KB
TransferController.class 2KB
MyExceptionHandler.class 2KB
QuitController.class 1KB
AdminController.class 1KB
Post.class 1KB
ReportController.class 998B
BaseController.class 997B
DepartDao.class 875B
StaffDao.class 861B
Report.class 849B
PostDao.class 763B
DepartService.class 703B
Auser.class 689B
PostService.class 664B
StaffService.class 659B
TransferDao.class 648B
QuitDao.class 610B
ReportDao.class 510B
E.class 464B
TransferService.class 445B
UserLoginNoException.class 444B
AdminDao.class 437B
QuitService.class 413B
AdminService.class 321B
ReportService.class 228B
.classpath 846B
org.eclipse.wst.common.component 485B
org.eclipse.wst.jsdt.ui.superType.container 49B
laydate.css 6KB
laydate.css 3KB
laydate.css 3KB
laydate.css 3KB
laydate.css 3KB
laydate.css 3KB
laydate.css 3KB
laydate.css 3KB
common.css 248B
login.gif 1KB
input.gif 1KB
my_bj5.gif 801B
cancel.gif 451B
submit.gif 324B
ok.gif 323B
ant-1.9.6.jar 1.94MB
aspectjweaver-1.8.13.jar 1.84MB
mybatis-3.4.5.jar 1.55MB
spring-web-5.0.2.RELEASE.jar 1.18MB
spring-core-5.0.2.RELEASE.jar 1.16MB
spring-context-5.0.2.RELEASE.jar 1.03MB
mysql-connector-java-5.1.45-bin.jar 976KB
log4j-core-2.3.jar 808KB
spring-webmvc-5.0.2.RELEASE.jar 764KB
javassist-3.22.0-CR2.jar 721KB
spring-beans-5.0.2.RELEASE.jar 640KB
log4j-1.2.17.jar 478KB
spring-jdbc-5.0.2.RELEASE.jar 382KB
spring-aop-5.0.2.RELEASE.jar 352KB
cglib-3.2.5.jar 295KB
spring-expression-5.0.2.RELEASE.jar 257KB
spring-tx-5.0.2.RELEASE.jar 243KB
ognl-3.1.15.jar 230KB
taglibs-standard-impl-1.2.5.jar 202KB
commons-dbcp2-2.2.0.jar 182KB
commons-io-2.4.jar 181KB
log4j-api-2.3.jar 133KB
commons-pool2-2.5.0.jar 125KB
commons-fileupload-1.3.1.jar 67KB
commons-logging-1.2.jar 60KB
mybatis-spring-1.3.1.jar 52KB
asm-5.2.jar 52KB
slf4j-api-1.7.25.jar 40KB
spring-aspects-5.0.2.RELEASE.jar 40KB
taglibs-standard-spec-1.2.5.jar 39KB
ant-launcher-1.9.6.jar 18KB
slf4j-log4j12-1.7.25.jar 12KB
aopalliance-1.0.jar 4KB
StaffServiceImpl.java 7KB
Staff.java 7KB
DepartServiceImpl.java 3KB
Transfer.java 3KB
PostServiceImpl.java 2KB
TransferServiceImpl.java 2KB
QuitServiceImpl.java 2KB
Quit.java 2KB
Depart.java 2KB
共 199 条
- 1
- 2
资源评论
等天晴i
- 粉丝: 3523
- 资源: 10万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功