基于javaweb+mysql的ssm+maven企业绩效工资管理系统(java+ssm+html+layui+bootstrap+mysql)
运行环境
Java≥8、MySQL≥5.7、Tomcat≥8
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+mysql的SSM+Maven企业绩效工资管理系统(java+ssm+html+layui+bootstrap+mysql)
项目介绍
本项目包含管理员与普通员工两种角色, 管理员角色包含以下功能: 管理员登录,员工管理,部门管理,岗位管理,职称管理,工龄奖金管理,工资项管理,考勤管理,工资查询等功能。 员工角色包含以下功能: 员工登录,个人信息管理,考勤管理,工资详情等功能。
环境需要
1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。 2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA; 3.tomcat环境:Tomcat 7.x,8.x,9.x版本均可 4.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 5.数据库:MySql 5.7版本; 6.是否Maven项目:是;
技术栈
- 后端:Spring+SpringMVC+Mybatis 2. 前端:HTML+CSS+JavaScript+LayUI+jquery+bootstrap
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件; 2. 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven; 若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; 3. 将项目中dbconfig.properties配置文件中的数据库配置改为自己的配置; 4. 运行项目,输入localhost:8080/ssm_esms 登录 注:tomcat中需配置路径为/ssm_esms,否则会有异常 管理员账号/密码:admin/admin 用户账号/密码:18080833/123456
return map;
}
else {
map.put("result","导入的文件不存在,请重新选择文件");
return map;
}
}
}
package com.esms.controller;
/**
* @Description:
*/
@Controller
public class UploadPhotoController {
@RequestMapping("uploadPhoto.do")
@ResponseBody
public Object updateHeadPhoto(@RequestParam(value = "file", required = false) MultipartFile file, HttpServletRequest request, HttpServletResponse response) throws Exception {
// 文件后缀
String prefix = "";
// 时间前缀
String dateStr = "";
//保存上传
OutputStream out = null;
InputStream fileInput = null;
// 随机数前缀
double index = 1000 * (Math.random());
DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
try {
*/
@RequestMapping("/deleteByPrimaryKey.do")
@ResponseBody
public int deleteByPrimaryKey(int id) throws Exception {
//删除部门,调用更新操作,将状态改为0
Position position = new Position();
position.setpId(id);
positionService.deleteByPrimaryKey(id);
return 1;
}
/**
* 批量删除
* @param ids
*/
@RequestMapping("/deleteByQuery.do")
public void deleteByQuery (@RequestParam(value = "arr")int[] ids) {
//批量删除,实则修改状态为0
//如果有id才执行
if(ids.length > 0) {
positionService.deleteByQuery(ids);
}
}
}
package com.esms.controller;
EchMonthSalary e3 = new EchMonthSalary();
e3.setYear("2017年");
List<Double> salary3 = new ArrayList<Double>();
salary3.add(6000.00);
salary3.add(8800.00);
salary3.add(23000.00);
salary3.add(6000.00);
salary3.add(8800.00);
salary3.add(23000.00);
salary3.add(6000.00);
salary3.add(8800.00);
salary3.add(23000.00);
salary3.add(6000.00);
salary3.add(8800.00);
salary3.add(23000.00);
e3.setSalary(salary3);
echMonthSalaryList.add(e1);
echMonthSalaryList.add(e2);
echMonthSalaryList.add(e3);
stringListMap.put("list",echMonthSalaryList);
return stringListMap;*/
return echartsService.getMonthSalary();
}
}
package com.esms.controller;
/**
* @Description:
*/
@Controller
@RequestMapping("/employee")
public class EmployeeController {
@Autowired
private EmployeeService employeeService;
@Autowired
private EmployeeCustomVoMapper employeeCustomVoMapper = null;
@RequestMapping("/findSelective.do")
@ResponseBody
public EmployeePages findSelective(
@RequestParam(value="page", defaultValue="1")int pageNum,
@RequestParam(value="limit", defaultValue="5") int limit,
@RequestParam(value="e_account", defaultValue="") String e_account,
@RequestParam(value="e_name", defaultValue="") String e_name,
@RequestParam(value="d_id", defaultValue="0") int d_id) throws Exception {
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("e_account",e_account);
map.put("e_name",e_name);
map.put("d_id",d_id);
//pageNum:起始页面 pageSize:每页的大小
PageHelper.startPage(pageNum,limit);
//查找条件,一定要紧跟在startPage后
/**
* @Description: 图表制作类
**/
@Controller
public class EchartsController {
@Autowired
private IEchartsService echartsService;
@RequestMapping(value = "/showEmployeeNums.do")
@ResponseBody
public Map<String,List<EchEmployeeNums>> showEmployeeNums(){
/**
* 各部门的员工数量柱状图的数据
* json格式{"list":[{"department":"人事部","num":480},{"department":"行政部","num":380}]}
*/
/*
List<EchEmployeeNums> echEmployeeNumsList = new ArrayList();
Map<String,List<EchEmployeeNums>> map = new HashMap<String,List<EchEmployeeNums>>();
EchEmployeeNums e1 = new EchEmployeeNums();
e1.setDepartment("人事部");
e1.setNum(123);
EchEmployeeNums e2 = new EchEmployeeNums();
e2.setDepartment("行政部");
e2.setNum(123);
echEmployeeNumsList.add(e1);
echEmployeeNumsList.add(e2);
map.put("list",echEmployeeNumsList);*/
return echartsService.getEmployeeNums();
}
@RequestMapping(value = "/showDepartmentSalary.do")
@ResponseBody
public Map<String,List<EchDepartmentSalary>> showDepartmentSalary(String date){
/**
*各年月工资对比图的数据
* json格式{"list":[{"year":"1","salary":[480,500,600,..]},{"year":"2","salary":[480,500,600...]}]}
*/
/*
List<EchDepartmentSalary> echDepartmentSalaryList = new ArrayList<EchDepartmentSalary>();
@RequestParam(value="attendance_time", defaultValue="") String attendance_time) throws Exception {
HashMap<String, Object> map = new HashMap<String, Object>();
map.put("e_account",e_account);
map.put("d_id",d_id);
map.put("attendance_time",attendance_time);
//pageNum:起始页面 pageSize:每页的大小
PageHelper.startPage(pageNum,limit);
//查找条件,一定要紧跟在startPage后
List<MonthlyAttendanceCustomVo> list =
monthlyAttendanceCustomVoMapper.selectMonthlyAttendanceCustomVoMapperByeAccountAnddIdAndTime(map);
// System.out.println(list.get(0).getMonthlyAttendance().getAttendanceTime()+"========================");
PageInfo pageResult = new PageInfo(list);
//设置前台需要的数据
MonthlyAttendancePages monthlyAttendancePages = new MonthlyAttendancePages();
monthlyAttendancePages.setCode(0);
monthlyAttendancePages.setMsg("");
monthlyAttendancePages.setCount((int) pageResult.getTotal());
monthlyAttendancePages.setData(pageResult.getList());
return monthlyAttendancePages;
}
/**
* 查找一个
* @param id
* @return
*/
@RequestMapping("/selectVoByPrimaryKey.do")
@ResponseBody
public MonthlyAttendanceCustomVo selectVoByPrimaryKey(int id) {
MonthlyAttendanceCustomVo monthlyAttendanceCustomVo = new MonthlyAttendanceCustomVo();
monthlyAttendanceCustomVo = monthlyAttendanceCustomVoMapper.selectVoByPrimaryKey(id);
// System.out.println(monthlyAttendanceCustomVo+"=======================");
return monthlyAttendanceCustomVo;
}
/**
* 更新
* @param maId
* @param sickLeaveNum
* @param compassionateLeaveNum
* @param overtimeHour