基于javaweb+mysql的springboot企业考勤管理系统(java+springboot+layui+jsp+bootstrap+mysql+maven)

基于javaweb+mysql的springboot企业考勤管理系统(java+springboot+layui+jsp+bootstrap+mysql+maven)

私信源码获取及调试交流

运行环境

Java≥8、MySQL≥5.7

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

基于javaweb的SpringBoot企业考勤管理系统(java+springboot+layui+jsp+bootstrap+mysql+maven)

项目介绍

  • 基于SpringBoot-Layui开发的学生版企业考勤管理系统完整代码; - 分别为员工打卡系统和企业考勤管理两个系统 - 其中企业考勤管理系统主要功能包括: 员工信息管理、考勤信息管理、考勤统计、操作日志信息、登录日志信息、系统用户管理等功能。

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。

2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;

3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS;

4.数据库:MySql 5.7版本;

技术栈

  1. 后端:SpringBoot+Mybatis

  2. 前端:JSP+Bootstrap+jQuery+LayUI

使用说明

运行项目,输入http://localhost:8080/web/jsp/login.jsp

管理端用户名 admin 密码 123456

打卡端用户名 马云 密码 630021197005112121

public class KqxxglController {
    @Autowired
    private CheckService checkService;
    @Autowired
    private CzrzxxService czrzxxService;

    /****
     * 查询考勤表
     */
    @GetMapping("find_StaAndCheck")
    @ResponseBody
    public PageInfo<Map<String,Object>> find_StaAndCheck(HttpServletRequest request, String ssk){
        try {
            List<Map<String,Object>> list = null;
            PageHelper.startPage(Integer.valueOf(request.getParameter("page")),Integer.valueOf(request.getParameter("limit")));
            list = checkService.find_StaAndCheck(ssk);
            PageInfo info = new PageInfo(list);
            return info;
        }catch (Exception e){
            e.printStackTrace();
            return null;
        }
    }

    /**通过id删除考勤表信息*/
    @GetMapping("delete_CheckById")
    @ResponseBody
    public int delete_CheckById(String id,String name){
        int i = 0;
        i = checkService.delete_CheckById(id,name);
        if(i>0){
            String bz = "删除考勤信息";
            czrzxxService.addCzrzxx(bz,name);
        }
        return i;
    }

    /**通过id查询考勤表*/
    @PostMapping("getCheckById")
    @ResponseBody
    public Map<String,Object> getCheckById(String id){
        Map<String,Object> map = new HashMap<>();
        map = checkService.getCheckById(id);
        return map;
    }


    /****
     * 搜索员工表
     */
    @GetMapping("find_StaByZjhmAndXm")
    @ResponseBody
    public List<Map> find_StaByZjhmAndXm(String ssk){
        List<Map> list = null;
        list = staService.find_StaByZjhmAndXm(ssk);
        System.out.println(list);
        return list;
    }

    /**通过证件号码查询员工表*/
    @GetMapping("getStaByZjhm")
    @ResponseBody
    public int getStaByZjhm(Sta sta){
        List<Map> map = null;
        String zjhm = sta.getZjhm();
        map = staService.getStaByZjhm(zjhm);
        if (map.size()<1){
            return 1;
        }else{
            return 0;
        }
    }
    /**通过工号查询员工表*/
    @PostMapping("getStaByGh")
    @ResponseBody
    public Map<String,Object> getStaByGh(String gh){
        Map<String,Object> map = new HashMap<>();
        map = staService.getStaByGh(gh);
            return map;
    }
    /**查询部门表*/
    @GetMapping("getStaSsbm")
    @ResponseBody
    public List<Map<String,Object>> getStaSsbm(){
        List<Map<String,Object>> list = null;
        try{
            list = staService.getStaSsbm();
        }catch (Exception e){
            e.printStackTrace();
        }
        return list;
    }
    /**新增或修改员工表*/
    @PostMapping("saveOrUpdate_Sta")
    @ResponseBody

@Controller
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;
    @Autowired
    private CzrzxxService czrzxxService;

    /**通过id查询员工表,判断旧密码是否正确*/
    @GetMapping("get_UserPasswordById")
    @ResponseBody
    public int get_UserPasswordById(User user){
        List<Map> map = null;
        System.out.println(user);
        String id =  user.getId();
        String password = user.getPassword();
        map = userService.get_UserPasswordById(id,password);
        if (map.size()>0){
            return 1;
        }else{
            return 0;
        }
    }

    /**修改密码*/

    /**通过证件号码查询员工表*/
    @GetMapping("getStaByZjhm")
    @ResponseBody
    public int getStaByZjhm(Sta sta){
        List<Map> map = null;
        String zjhm = sta.getZjhm();
        map = staService.getStaByZjhm(zjhm);
        if (map.size()<1){
            return 1;
        }else{
            return 0;
        }
    }
    /**通过工号查询员工表*/
    @PostMapping("getStaByGh")
    @ResponseBody
    public Map<String,Object> getStaByGh(String gh){
        Map<String,Object> map = new HashMap<>();
        map = staService.getStaByGh(gh);
            return map;
    }
    /**查询部门表*/
    @GetMapping("getStaSsbm")
    @ResponseBody
    public List<Map<String,Object>> getStaSsbm(){
        List<Map<String,Object>> list = null;
        try{
            list = staService.getStaSsbm();
        }catch (Exception e){
            e.printStackTrace();
        }
        return list;
    }
    /**新增或修改员工表*/
    @PostMapping("saveOrUpdate_Sta")
    @ResponseBody
    public int saveOrUpdate_Sta(Sta sta){
        int i = 0;
        System.out.println(sta);
        i = staService.saveOrUpdate_Sta(sta);
        return i;
    }
    /**删除员工*/
    @GetMapping("delete_StaByGh")
    @ResponseBody
        }
        return i;
    }

}

@Controller
@RequestMapping("/com")
public class GdkqzydhController {
    @Autowired
    private ComService comService;
    @Autowired
    private CzrzxxService czrzxxService;

    /**查询各地考勤专员信息表*/
    @GetMapping("find_Com")
    @ResponseBody
    public PageInfo<Map<String,Object>> find_Com(HttpServletRequest request, String ssk){
        try {
            List<Map<String,Object>> list = null;
            PageHelper.startPage(Integer.valueOf(request.getParameter("page")),Integer.valueOf(request.getParameter("limit")));
            list = comService.find_Com(ssk);
            PageInfo info = new PageInfo(list);
            return info;
        }catch (Exception e){
            e.printStackTrace();
            return null;
        }
    }

    /**新增或修改各地考勤专员表*/
    @PostMapping("saveOrUpdate_Com")
    @ResponseBody
    public int saveOrUpdate_Com(Com com){
        return i;
    }

    /**删除用户表*/
    @GetMapping("delete_UserById")
    @ResponseBody
    public int delete_UserById(User user,String czyh){
        int i;
        try{
            i = userService.delete_UserById(user);
            if(i>0){
                //给操作日志表添加信息
                String bz = "删除系统用户";
                czrzxxService.addCzrzxx(bz,czyh);
            }
        }catch (Exception e){
            e.printStackTrace();
            i = 0;
        }
        return i;
    }

}

@Controller
@RequestMapping("/login")
public class GetLoginController {

    @Autowired
    private UserService userService;
    @Autowired
    private StaService staService;
    @Autowired
    private DlrzxxService dlrzxxService;
        try {
            List<Map<String,Object>> list = null;
            PageHelper.startPage(Integer.valueOf(request.getParameter("page")),Integer.valueOf(request.getParameter("limit")));
            list = userService.find_User(ssk);
            PageInfo info = new PageInfo(list);
            return info;
        }catch (Exception e){
            e.printStackTrace();
            return null;
        }

    }

    /**新增用户表*/
    @PostMapping("add_User")
    @ResponseBody
    public int add_User(User user,String czyh){
        int i;
        try{
            i = userService.add_User(user);
            if(i>0){
                //给操作日志表添加信息
                String bz = "新增系统用户信息";
                czrzxxService.addCzrzxx(bz,czyh);
            }
        }catch (Exception e){
            e.printStackTrace();
            i = -1;
        }
        return i;
    }

    /**删除用户表*/
    @GetMapping("delete_UserById")
    @ResponseBody
    public int delete_UserById(User user,String czyh){
        int i;
        try{
            i = userService.delete_UserById(user);
            if(i>0){
                //给操作日志表添加信息
                String bz = "删除系统用户";
                czrzxxService.addCzrzxx(bz,czyh);
            }
        }catch (Exception e){
            e.printStackTrace();
            i = 0;
        }
            System.out.println(map.get("xm"));
            if(null!=map){
                jobject.put("xm", map.get("xm"));
                jobject.put("zjhm", map.get("zjhm"));
                jobject.put("gh", map.get("gh"));
                jobject.put("ssbm", map.get("ssbm"));
            }
            out.print(jobject.toString());
        }catch (Exception e){
            jobject = new JSONObject();
            jobject.put("errorCode", "401");
            jobject.put("data", "");
            out.print(jobject.toString());
            e.printStackTrace();
        }
    }
}

@Controller
@RequestMapping("/sta")
public class StaController {
    @Autowired
    private StaService staService;
    @Autowired
    private CzrzxxService czrzxxService;

    /****
     * 查询员工表
     */
    @GetMapping("find_Sta")
    @ResponseBody
    public PageInfo<Map<String,Object>> find_Sta(HttpServletRequest request,String ssk){
        try {
            List<Map<String,Object>> list = null;
            PageHelper.startPage(Integer.valueOf(request.getParameter("page")),Integer.valueOf(request.getParameter("limit")));
            list = staService.find_Sta(ssk);
            PageInfo info = new PageInfo(list);
            return info;
        }catch (Exception e){
    @GetMapping("find_StaByZjhmAndXm")
    @ResponseBody
    public List<Map> find_StaByZjhmAndXm(String ssk){
        List<Map> list = null;
        list = staService.find_StaByZjhmAndXm(ssk);
        System.out.println(list);
        return list;
    }

    /**通过证件号码查询员工表*/
    @GetMapping("getStaByZjhm")
    @ResponseBody
    public int getStaByZjhm(Sta sta){
        List<Map> map = null;
        String zjhm = sta.getZjhm();
        map = staService.getStaByZjhm(zjhm);
        if (map.size()<1){
            return 1;
        }else{
            return 0;
        }
    }
    /**通过工号查询员工表*/
    @PostMapping("getStaByGh")
    @ResponseBody
    public Map<String,Object> getStaByGh(String gh){
        Map<String,Object> map = new HashMap<>();
        map = staService.getStaByGh(gh);
            return map;
    }
    /**查询部门表*/
    @GetMapping("getStaSsbm")
    @ResponseBody
    public List<Map<String,Object>> getStaSsbm(){
        List<Map<String,Object>> list = null;
        try{
            list = staService.getStaSsbm();
        }catch (Exception e){
            e.printStackTrace();
        }
        return list;
    }
    /**新增或修改员工表*/
    @PostMapping("saveOrUpdate_Sta")
    @ResponseBody
    public int saveOrUpdate_Sta(Sta sta){
        int i = 0;
        System.out.println(sta);
        i = staService.saveOrUpdate_Sta(sta);
        return i;
    }
    /**删除员工*/
    @GetMapping("delete_StaByGh")
            return info;
        }catch (Exception e){
            e.printStackTrace();
            return null;
        }

    }

    /**删除操作日志信息表*/
    @GetMapping("delete_Czrzxx")
    @ResponseBody
    public int delete_Czrzxx(String czyh){
        int i;
        try{
            i = czrzxxService.delete_Czrzxx();
            if(i>0){
                //给操作日志表添加信息
                String bz = "清除30天前操作日志信息";
                czrzxxService.addCzrzxx(bz,czyh);
            }
        }catch (Exception e){
            e.printStackTrace();
            i = -1;
        }
        return i;
    }

    /**删除登录日志信息表*/
    @GetMapping("delete_Dlrzxx")
    @ResponseBody
    public int delete_Dlrzxx(String czyh){
        int i;
        try{
            i = czrzxxService.delete_Dlrzxx();
            if(i>0){
                //给操作日志表添加信息
                String bz = "清除30天前登录日志信息";
                czrzxxService.addCzrzxx(bz,czyh);
            }
        }catch (Exception e){
            e.printStackTrace();
            i = -1;
        }
        return i;
    }

}

    @PostMapping("saveOrUpdate_Check")
    @ResponseBody
    public int saveOrUpdate_Check(Check check,String name){
        int i = 0;
        try{
            i = checkService.saveOrUpdate_Check(check,name);
        }catch (Exception e){
            e.printStackTrace();
            i=0;
        }
        return i;
    }

    /**新增考勤表手动打卡*/
    @PostMapping("add_ChackByScdk")
    @ResponseBody
    public int add_ChackByScdk(Check check){
        int i = 0;
        try{
            i = checkService.add_ChackByScdk(check);
        }catch (Exception e){
            e.printStackTrace();
            i=0;
        }
        return i;
    }
    /**修改考勤表手动打卡(添加最后打卡)*/
    @PostMapping("update_ChackByXbdk")
    @ResponseBody
    public int update_ChackByXbdk(Check check){
        int i = 0;
        try{
            i = checkService.update_ChackByXbdk(check);
        }catch (Exception e){
            e.printStackTrace();
            i=0;
        }
        return i;
    }

}

        }else{
            return 0;
        }
    }

    /**修改密码*/
    @PostMapping("Update_UserPassword")
    @ResponseBody
    public int Update_UserPassword(User user,String czyh){
        int i = userService.Update_UserPassword(user);
        if(i>0){
            //给操作日志表添加信息
            String bz = "用户修改个人密码";
            czrzxxService.addCzrzxx(bz,czyh);
        }
        return i;
    }

    /**修改用户表信息*/
    @PostMapping("Update_User")
    @ResponseBody
    public int Update_User(User user,String czyh){
        int i = userService.Update_User(user);
        if(i>0){
            //给操作日志表添加信息
            String bz = "修改系统用户信息";
            czrzxxService.addCzrzxx(bz,czyh);
        }
        return i;
    }

    /**通过id查询用户表*/
    @PostMapping("get_UserById")
    @ResponseBody
    public Map<String,Object> get_UserById(String id){
        Map<String,Object> map = new HashMap<>();
        map = userService.get_UserById(id);
        return map;
    }

    /**通过证件号码查询用户表*/
    @PostMapping("get_UserByZjhm")
    }

    /**登录打卡系统*/
    @PostMapping("get_StaLogin")
    public void get_StaLogin(Sta sta, HttpServletResponse response){
        response.setContentType("text/html;charset=utf-8");
        response.setCharacterEncoding("utf-8");
        PrintWriter out = null;
        JSONObject jobject = new JSONObject();
        Map<String,Object> map;
        try{
            out = response.getWriter();
            String xm = sta.getXm();
            String zjhm = sta.getZjhm();
            System.out.println(xm+zjhm);
            map = staService.get_StaLogin(xm,zjhm);
            System.out.println(map.get("xm"));
            if(null!=map){
                jobject.put("xm", map.get("xm"));
                jobject.put("zjhm", map.get("zjhm"));
                jobject.put("gh", map.get("gh"));
                jobject.put("ssbm", map.get("ssbm"));
            }
            out.print(jobject.toString());
        }catch (Exception e){
            jobject = new JSONObject();
            jobject.put("errorCode", "401");
            jobject.put("data", "");
            out.print(jobject.toString());
            e.printStackTrace();
        }
    }
}

        return i;
    }

    /**新增考勤表手动打卡*/
    @PostMapping("add_ChackByScdk")
    @ResponseBody
    public int add_ChackByScdk(Check check){
        int i = 0;
        try{
            i = checkService.add_ChackByScdk(check);
        }catch (Exception e){
            e.printStackTrace();
            i=0;
        }
        return i;
    }
    /**修改考勤表手动打卡(添加最后打卡)*/
    @PostMapping("update_ChackByXbdk")
    @ResponseBody
    public int update_ChackByXbdk(Check check){
        int i = 0;
        try{
            i = checkService.update_ChackByXbdk(check);
        }catch (Exception e){
            e.printStackTrace();
            i=0;
        }
        return i;
    }

}

@Controller
@RequestMapping("/rzxx")
public class RzxxglController {
    @Autowired
            e.printStackTrace();
            return null;
        }

    }

    /**新增用户表*/
    @PostMapping("add_User")
    @ResponseBody
    public int add_User(User user,String czyh){
        int i;
        try{
            i = userService.add_User(user);
            if(i>0){
                //给操作日志表添加信息
                String bz = "新增系统用户信息";
                czrzxxService.addCzrzxx(bz,czyh);
            }
        }catch (Exception e){
            e.printStackTrace();
            i = -1;
        }
        return i;
    }

    /**删除用户表*/
    @GetMapping("delete_UserById")
    @ResponseBody
    public int delete_UserById(User user,String czyh){
        int i;
        try{
            i = userService.delete_UserById(user);
            if(i>0){
                //给操作日志表添加信息
                String bz = "删除系统用户";
                czrzxxService.addCzrzxx(bz,czyh);
            }
        }catch (Exception e){
            e.printStackTrace();
            i = 0;
        }
        return i;
    }

}


@Controller
@RequestMapping("/sta")
public class StaController {
    @Autowired
    private StaService staService;
    @Autowired
    private CzrzxxService czrzxxService;

    /****
     * 查询员工表
     */
    @GetMapping("find_Sta")
    @ResponseBody
    public PageInfo<Map<String,Object>> find_Sta(HttpServletRequest request,String ssk){
        try {
            List<Map<String,Object>> list = null;
            PageHelper.startPage(Integer.valueOf(request.getParameter("page")),Integer.valueOf(request.getParameter("limit")));
            list = staService.find_Sta(ssk);
            PageInfo info = new PageInfo(list);
            return info;
        }catch (Exception e){
            e.printStackTrace();
            return null;
        }
    }

    /****
     * 员工表姓名和证件号码
     */
    @GetMapping("getXmAndZjhm_Sta")
    @ResponseBody
    public List<Map> getXmAndZjhm_Sta(){
        List<Map> list = null;
        list = staService.getXmAndZjhm_Sta();
        return list;
    }
        }
        return list;
    }
    /**新增或修改员工表*/
    @PostMapping("saveOrUpdate_Sta")
    @ResponseBody
    public int saveOrUpdate_Sta(Sta sta){
        int i = 0;
        System.out.println(sta);
        i = staService.saveOrUpdate_Sta(sta);
        return i;
    }
    /**删除员工*/
    @GetMapping("delete_StaByGh")
    @ResponseBody
    public int delete_StaByGh(String gh,String name){
        int i = 0;
        i = staService.delete_StaByGh(gh,name);
        if(i>0){
            String bz = "删除员工";
            System.out.println(name);
            czrzxxService.addCzrzxx(bz,name);
        }
        return i;
    }
}

@Controller
@RequestMapping("/check")
public class KqxxglController {
    @Autowired
    private CheckService checkService;
    @Autowired
    private CzrzxxService czrzxxService;

请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述
请添加图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值