作者主页:夜未央5788
简介:Java领域优质创作者、Java项目、学习资料、技术互助
文末获取源码
本项目包含管理员与普通员工两种角色,
管理员角色包含以下功能:
管理员登录,员工管理,部门管理,岗位管理,职称管理,工龄奖金管理,工资项管理,考勤管理,工资查询,统计图表等功能。
员工角色包含以下功能:
员工登录,个人信息管理,考勤管理,工资详情等功能。
PS:在折线图的工资展示分析模块,需要先结算某一个月的工资然后在折线图的地方查询才可以出来图哦
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项目:是;
1. 后端:Spring+SpringMVC+Mybatis
2. 前端:HTML+CSS+JavaScript+LayUI+jquery+bootstrap
1. 使用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
- @Controller
- public class RankBonusController {
- @Autowired
- private IRankBonusService service;
- //@Qualifier("rankBonusService")
-
- public void setiRankBonusService(IRankBonusService iRankBonusService) {
- this.service = iRankBonusService;
- }
-
-
- //插入数据
- @RequestMapping("/insertRankBonus.do")
- @ResponseBody
- public String doInsertRankBonus(int bonus,String name){
- if(service.CountByName(name)>0){
- return "exist";
- }
- if(!name.equals("")&& bonus>=0){
- RankBonus rb= new RankBonus();
- rb.setRankName(name);
- rb.setRbBonus(bonus);
- service.addRankBonus(rb);
-
- return "ok";
-
- }
- else{
- return "no";
- }
-
- }
- //查询出所有记录
- @RequestMapping("/findAll.do")
- public String doFindAll(@RequestParam(value="pn",defaultValue = "1") Integer pn, Model model){
- // 引入PageHelper分页插件
- // 在查询之前只需要调用,传入页码,以及每页的大小
- int pageSize = 10;
- PageHelper.startPage(pn, pageSize);
- // startPage后面紧跟的这个查询就是一个分页查询
- List
rbs = service.findAll(); - System.out.println(rbs+"=================================");
- /*for (RankBonus rb:rbs) {
- System.out.println(rb.getRankName());
- }*/
- // 使用pageInfo包装查询后的结果,只需要将pageInfo交给页面就行了。
- // 封装了详细的分页信息,包括有我们查询出来的数据,传入连续显示的页数
- PageInfo page = new PageInfo(rbs, 5);
- //ModelAndView modelAndView = new ModelAndView();
- // modelAndView.setViewName("admin/rank-list.jsp");
- // modelAndView.addObject("pageInfo",page);
- model.addAttribute("pageInfo", page);
- return "admin/rank-list.jsp";
- }
-
- @RequestMapping("/findRankBonusList.do")
- @ResponseBody
- public RankBonusPages findSelective(
- @RequestParam(value="page", defaultValue="1")int pageNum,
- @RequestParam(value="limit", defaultValue="10") int limit,
- @RequestParam(value="rb_name", defaultValue="") String rb_name) throws Exception {
- /*return rb_name;*/
- List
list; - //模糊查询,有多少个条件就接收多少个字段
- RankBonus rb = new RankBonus();
- rb.setRankName(rb_name);
- //pageNum:起始页面 pageSize:每页的大小
- PageHelper.startPage(pageNum,limit);
- //查找条件,一定要紧跟在startPage后
- list = service.findSelective(rb);
- PageInfo pageResult = new PageInfo(list);
-
- //设置前台需要的数据
- RankBonusPages rankBonusPages = new RankBonusPages();
- rankBonusPages.setCode(0);
- rankBonusPages.setMsg("");
- rankBonusPages.setCount((int) pageResult.getTotal());
- rankBonusPages.setData(pageResult.getList());
- return rankBonusPages;
- }
-
- //根据id删除数据
- @RequestMapping("rankBonusDelete.do")
- @ResponseBody
- public String doDelete(int id){
- if(service.CountByRbid(id)>0){
- return "exist";
- }
- if(service.moveRankBonus(id)==true)
- return "ok";
- else{
- return "no";}
- }
- //更新记录
- @RequestMapping("/updateRankBonus.do")
- @ResponseBody
- public String doUpdate(int id,String rank,int bonus){
- RankBonus rankBonus=service.findByName(rank);
- if(rankBonus!=null&& !rankBonus.getRbId().equals(id)){
- return "exist";
- }
- RankBonus rb=new RankBonus();
- rb.setRbId(id);
- rb.setRbBonus(bonus);
- rb.setRankName(rank);
- if(service.modifyRankName(rb)==true)
- return "ok";
- else
- return "no";
- }
-
-
- }
- @Controller
- public class SalaryController {
- @Autowired
- private SalaryServiceImpl salaryService = null;
-
- @RequestMapping("salarySettlementByAcount.do")
- @ResponseBody
- public Map
salarySettlementByAcount(String eAccount, String date) { - Map
stringMap = new HashMap(); - try {
- salaryService.insertSalaryByAcountAndDate(eAccount, date);
- stringMap.put("msg", "工资结算完成");
- return stringMap;
- } catch (CustomException e) {
- stringMap.put("msg", e.getMessage());
- return stringMap;
- }
- }
-
- @RequestMapping("salarySettlementAll.do")
- @ResponseBody
- public Map
salarySettlementAll(String date) { - Map
stringMap = new HashMap(); - try {
- salaryService.insertSalaryAllByDate(date);
- stringMap.put("msg", "工资结算完成");
- return stringMap;
- } catch (CustomException e) {
- stringMap.put("msg", e.getMessage());
- return stringMap;
- }
- }
-
- // 删除工资项目
- @RequestMapping("deleteSalaryByEid.do")
- @ResponseBody
- public int deleteSalaryByEid(@RequestParam(value = "arr")int[] ids) {
- salaryService.deleteSalaryByEid(ids);
- return 1;
- }
-
- // 发放工资项目
- @RequestMapping("issueSalaryByEid.do")
- @ResponseBody
- public void issueSalaryByEid(@RequestParam(value = "arr")int[] ids) {
- salaryService.updateSalaryBySid(ids);
- }
-
- @RequestMapping(value = "selectSalaryByEaccountDIdDate.do",
- produces = "application/json;charset=utf-8")
- @ResponseBody
- public String selectSalaryByEaccountDIdDate(@RequestParam(value = "page", defaultValue = "1") int pageNum,
- @RequestParam(value = "limit", defaultValue = "5") int limit,
- String eAccount, Integer dId, String sTime) {
- /**
- * @Author: 方宏泰
- * @Description: 工资查询
- * @Date: 12:37 2020/02/11
- * @Param: [pageNum , limit, eAccount, dId, sTime]
- * @Return: java.lang.String
- **/
- SalaryPages salaryPages = salaryService.selectSalaryByEaccountDIdDate(pageNum, limit, eAccount, dId, sTime);
- //使用fastjson以字符串形式返回数据
- JSON.DEFFAULT_DATE_FORMAT = "yyyy-MM";
- return JSON.toJSONString(salaryPages, SerializerFeature.WriteDateUseDateFormat);
- }
-
- @RequestMapping(value = "selectSalaryByEaccountDIdDateState.do",
- produces = "application/json;charset=utf-8")
- @ResponseBody
- public String selectSalaryByEaccountDIdDateState(@RequestParam(value = "page", defaultValue = "1") int pageNum,
- @RequestParam(value = "limit", defaultValue = "5") int limit,
- String eAccount, Integer dId, String sTime) {
- SalaryPages salaryPages = salaryService.selectSalaryByEaccountDIdDateState(pageNum, limit, eAccount, dId, sTime);
- //使用fastjson以字符串形式返回数据
- JSON.DEFFAULT_DATE_FORMAT = "yyyy-MM";
- return JSON.toJSONString(salaryPages, SerializerFeature.WriteDateUseDateFormat);
- }
-
- @RequestMapping(value = "updateSalaryByEidAndRissuePay.do")
- @ResponseBody
- public void updateSalaryByEidAndRissuePay(int sId, double rissuePay) {
- salaryService.updateSalaryByEidAndRissuePay(sId, rissuePay);
- }
- }
如果也想学习本系统,下面领取。关注并回复:108ssm