Java Project: Private Dentist Management System (java+SpringBoot+html+layui+echarts+maven+mysql)

Get the source code: Download it from "Resources" on the homepage of the blog!

Project Introduction

Private Dentist Management System. The project is divided into front-end and back-end, with three roles: administrator, doctor, customer;

The main functions of the front desk include: home page, doctor introduction, news, about us, contact us and other functions; the
main functions of the background administrator include:
customer management: customer information statistics, customer list, adding customers;
doctor management: doctor list, case list, Add new cases, add doctors;
drug management: drug information statistics, drug list, drug addition;
article management: article list, add articles;

main functions of doctor login include:
case management: ongoing medical records, historical cases, new cases;
customers Management: customer list, new customers, appointment information;

the main functions of ordinary customer login include:
basic information, password modification, appointment information, case view;
a total of 10 tables;

environmental needs

1. Operating environment: preferably java jdk 1.8, we are running on this platform. Other versions are also theoretically possible.

2. IDE environment: IDEA, Eclipse, Myeclipse can be used. IDEA is recommended;
3. Tomcat environment: Tomcat 7.x, 8.x, 9.x versions are available
4. Hardware environment: Windows 7/8/10 with more than 1G memory; or Mac OS;
5. Maven project: Yes; Check whether pom.xml is included in the source code directory; if so, it is a maven project, otherwise it is a non-maven project

6. Database: MySql version 8.0;

technology stack

1. Backend: SpringBoot

2. Front end: html+jQuery+layui+echarts

Instructions for use

1. Use Navicat or other tools to create a database with the corresponding name in mysql, and import the sql file of
the project; 2. Change the database configuration in the db.properties configuration file in the project to your own configuration
3. Use IDEA/Eclipse/ MyEclipse imports the project, when Eclipse/MyEclipse imports, if it is a maven project, please select maven; if it is a maven project, after the import is successful, please execute the maven clean; maven install command, configure tomcat, and then run
;
: http://localhost:8087/user/toCusWel
Ordinary user login address: http://localhost:8087/login/toUserLogin

Background running address: administrator and doctor login: http://localhost:8087/login/toDocLogin

 

 

 

 

 

 

 

Doctor management control layer:

@Controller
@RequestMapping("doctor")
public class DoctorController {
    @Autowired
    private DoctorService doctorService;
    /*
     * 查询医生
     * */
    @RequestMapping("doctorList")
    @ResponseBody
    public Object doctorList(Doctor doctor, Integer page, Integer limit){
        PageHelper.startPage(page, limit);
        List<Doctor> listAll = doctorService.doctorList(doctor);
        PageInfo pageInfo = new PageInfo(listAll);
        Map<String, Object> tableData = new HashMap<String, Object>();
        //这是layui要求返回的json数据格式
        tableData.put("code", 0);
        tableData.put("msg", "");
        //将全部数据的条数作为count传给前台(一共多少条)
        tableData.put("count", pageInfo.getTotal());
        //将分页后的数据返回(每页要显示的数据)
        tableData.put("data", pageInfo.getList());

        return tableData;
    }
    /*
     * 添加医生
     * */
    @RequestMapping("addDoctor")
    @ResponseBody
    public Object addDoctor(Doctor doctor, Paiban paiban){
        int count = doctorService.count(doctor);
        if(count==0){
            int i = doctorService.addDoctor(doctor);
            if(i==1){
                return "添加成功";
            }else{
                return "添加失败";
            }
        }else{
            return doctor.getDoctorName()+"已存在";
        }

    }
    /*
     * 修改医生
     * */
    @RequestMapping("editDoctor")
    @ResponseBody
    public Object editDoctor(Doctor doctor){
        int i = doctorService.editDoctor(doctor);
        if(i==1){
            return "修改成功";
        }else{
            return "修改失败";
        }

    }
    /*
     * 删除医生
     * */
    @RequestMapping("deleteDoctor")
    @ResponseBody
    public Object deleteDoctor(Integer doctorId){
        int i1 = doctorService.checkCount(doctorId);
        if(i1>0){
           return "该医生还有病人";
        }else{
            int i = doctorService.deleteDoctor(doctorId);
            if(i==1){
                return "删除成功";
            }else{
                return "删除失败";
            }
        }

    }
    /*
     * 查询科室
     * */
    @RequestMapping("findAllDepartments")
    @ResponseBody
    public Object findAllDepartments(){
        List<Departments> allDepartments = doctorService.findAllDepartments();
        return allDepartments;
    }
    /*
     * 查询类型
     * */
    @RequestMapping("findAllRegisteredtype")
    @ResponseBody
    public Object findAllRegisteredtype(){
        List<Registeredtype> allRegisteredtype = doctorService.findAllRegisteredtype();
        return allRegisteredtype;
    }

}

User management control layer:

@Controller
@RequestMapping("user")
public class UserController {
    @Autowired
    private UserService userService;
    @RequestMapping("selectAllUser")
    @ResponseBody
    public Object selectAllUser(Integer page,Integer limit,User user){
        PageHelper.startPage(page, limit);
        List<User> allUser = userService.selectAllUser(user);
        PageInfo pageInfo = new PageInfo(allUser);
        Map<String, Object> tableData = new HashMap<String, Object>();
        //这是layui要求返回的json数据格式
        tableData.put("code", 0);
        tableData.put("msg", "");
        //将全部数据的条数作为count传给前台(一共多少条)
        tableData.put("count", pageInfo.getTotal());
        //将分页后的数据返回(每页要显示的数据)
        tableData.put("data", pageInfo.getList());

        return tableData;
    }
    /*
    * 修改用户
    * */
    @RequestMapping("updateUser")
    @ResponseBody
    public Object updateUser(User user){
        if(userService.updateUser(user)>0){
                return "修改成功";
            }else{
                return "修改失败";
            }


    }
    /*
     * 删除用户
     * */
    @RequestMapping("deleteUser")
    @ResponseBody
    public Object deleteUser(Integer userid){
        userService.deleteUser(userid);
       return "删除成功";
    }
    /*
     * 初始化用户分配角色
     * */
    @RequestMapping("initUserRole")
    @ResponseBody
    public DataGridView initUserRole(Integer userid){
        return userService.queryUserRole(userid);
    }
    /*
     * 添加用户
     * */
    @RequestMapping("addUser")
    @ResponseBody
    public Object addUser(User user){
        int i1 = userService.checkUser(user);
        if(i1==1){
            return "当前登陆名已存在";
        }else {
            //加盐
            String salt = UserCredentialsMatcher.generateSalt(6);
            //MD5加密迭代两次
            user.setPwd(UserCredentialsMatcher.encryptPassword("md5", "123456", salt, 2));
            user.setType(2);
            user.setSalt(salt);
            System.out.println(salt);
            int i = userService.addUser(user);
            if (i > 0) {
                return "添加成功";
            } else {
                return "添加失败";
            }
        }
    }
    /*
     * 重置密码
     * */
    @RequestMapping("resetUserPwd")
    @ResponseBody
    public Object resetUserPwd(User user,Integer userid){
        user.setUserid(userid);
        //加盐
        String salt = UserCredentialsMatcher.generateSalt(6);
        //MD5加密迭代两次
        user.setPwd(UserCredentialsMatcher.encryptPassword("md5", "123456", salt, 2));
        user.setType(2);
        user.setSalt(salt);
        userService.resetUserPwd(user);
        return "重置成功";

    }
    /*
     * 保存用户和角色的关系
     * */
    @RequestMapping("saveUserRole")
    @ResponseBody
    public Object saveUserRole(UserRole userRole){
        userService.saveUserRole(userRole);
        return "分配成功";
    }    /*
     * 修改资料
     * */
    @RequestMapping("editLogin")
    @ResponseBody
    public Object editLogin(User user){
        int i = userService.editLogin(user);
        if(i==1){
            return "修改成功";
        }else{
            return "修改失败";
        }

    }
    @Autowired
    private MenuService menuService;
    @RequestMapping("editPwd")
    @ResponseBody
    public Object editPwd(User user,String loginname,String pwd,String pwd1){
        //第一步:建立subject
        Subject subject = SecurityUtils.getSubject();
        //第二步:封装token  凭证
        UsernamePasswordToken token = new UsernamePasswordToken(loginname, pwd);
        try {
            //只要能通过认证就能通过了

            subject.login(token);
            //加盐
            String salt = UserCredentialsMatcher.generateSalt(6);
            //MD5加密迭代两次
            user.setPwd(UserCredentialsMatcher.encryptPassword("md5", pwd1, salt, 2));
            user.setSalt(salt);
            userService.editPwd(user);
            return "1";//修改成功
        } catch (IncorrectCredentialsException e) {
            return "0";//密码错误
        }

    }
}

System management control layer:

@Controller
public class SysController {
    @Autowired
    private UserService userService;

    /*
     * 跳转管理菜单
     * */
    @RequestMapping("toMenuManager")
    public String toMenuManager() {
        return "view/menu/menuManager";
    }

    /*
     * 跳转加载菜单管理左边的菜单树
     * */
    @RequestMapping("toMenuLeft")
    public String toMenuLeft() {
        return "view/menu/menuLeft";
    }

    /*
     * 跳转加载菜单管理左边的增删改
     * */
    @RequestMapping("toMenuRight")
    public String toMenuRight() {
        return "view/menu/menuRight";
    }
    /*
     * 跳转加载角色
     * */
    @RequestMapping("toLoadAllRole")
    public String toLoadAllRole() {
        return "view/role/roleManager";
    }
    /*
     * 跳转加载用户
     * */
    @RequestMapping("toLoadAllUser")
    public String toLoadAllUser() {
        return "view/user/userManager";
    }

    /*
     * 跳转加载doctor.html
     * */
    @RequestMapping("toDoctor")
    public String toDoctor() {
        return "view/center/doctor";
    }
    /*
     * 跳转加载departments.html
     * */
    @RequestMapping("toDepartments")
    public String toDepartments() {
        return "view/center/departments";
    }
    /*
     * 跳转加载registeredtype.html
     * */
    @RequestMapping("toRegisteredType")
    public String toRegisteredtype() {
        return "view/center/registeredType";
    }

    /*
     * 跳转加载icon.html
     * */
    @RequestMapping("icon")
    public String icon() {
        return "view/center/icon";
    }

    /*
     * 跳转加载type.html
     * */
    @RequestMapping("toType")
    public String toType() {
        return "view/center/type";
    }
    /*
     * 跳转加载area.html
     * */
    @RequestMapping("toArea")
    public String toArea() {
        return "view/center/area";
    }

    /*
     * 跳转加载skull.html
     * */
    @RequestMapping("toSkull")
    public String toSkull() {
        return "view/center/skull";
    }
    /*
     * 跳转加载warehuose.html
     * */
    @RequestMapping("toWarehuose")
    public String toWarehuose() {
        return "view/center/warehuose";
    }

    /*
     * 跳转加载supplyManage.html
     * */
    @RequestMapping("toSupplyManage")
    public String toSupplyManage() {
        return "view/center/supplyManage";
    }
    /*
     * 跳转加载supply.html
     * */
    @RequestMapping("toSupply")
    public String toSupply() {
        return "view/center/supply";
    }
    /*
     * 跳转加载unit.html
     * */
    @RequestMapping("toUnit")
    public String toUnit() {
        return "view/center/unit";
    }

    /*
     * 跳转加载updateLogin.html
     * */
    @RequestMapping("toUpdateLogin")
    public String toUpdateLogin(User user, Integer userid, Model model) {
        List<User> users = userService.updateLogin(user);
        model.addAttribute("usersLogin",users);
        return "view/user/updateLogin";
    }
    /*
     * 跳转加载projectTypeManage.html
     * */
    @RequestMapping("toProjectTypeManage")
    public String toProjectTypeManage() {
        return "view/center/projectTypeManage";
    }
    /*
     * 跳转加载paiban.html
     * */
    @RequestMapping("toPaiban")
    public String toPaiban() {
        return "view/center/paiban";
    }
    /*
     * 跳转加载drugdictionary.html
     * */
    @RequestMapping("toDrugdictionary")
    public String toDrugdictionary() {
        return "view/center/drugdictionary";
    }
    /*
     * 跳转加载main.html
     * */
    @RequestMapping("toMain")
    public String toMain() {
        return "view/main/main";
    }
    /*
     * 跳转加载reportManage.html
     * */
    @RequestMapping("toReportFinance")
    public String toReportFinance() {
        return "view/finance/reportManage";
    }

    /*
     * 跳转加载zhuYuanManage.html
     * */
    @RequestMapping("toZhuYaunManage")
    public String toZhuYaunManage() {
        return "view/finance/zhuYuanManage";
    }
    /*
     * 跳转加载zhuYuanManage.html
     * */
    @RequestMapping("toBingYear")
    public String toBingYear() {
        return "view/finance/reportBing";
    }
    /*
     * 跳转加载zhuYuanBing.html
     * */
    @RequestMapping("toBing2")
    public String toBing2() {
        return "view/finance/zhuYuanBing";
    }
    /*
     * 跳转加载doctorDuibi.html
     * */
    @RequestMapping("toDoctorDuibi")
    public String toDoctorDuibi() {
        return "view/finance/doctorDuibi";
    }

    /*
     * 跳转加载current.html
     * */
    @RequestMapping("toCurrent")
    public String toCurrenti() {
        return "view/finance/current";
    }
}

Get the source code: Download it from "Resources" on the homepage of the blog! 

Guess you like

Origin blog.csdn.net/yuyecsdn/article/details/124297322