基于javaweb+mysql的社区养老医疗综合服务系统(java+SpringBoot+bootstrap+HTML+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或8.0版本;

6.是否Maven项目:是;

技术栈

  1. 后端:SpringBoot+mybatis-plus

  2. 前端:HTML+CSS+javascript+jQuery+bootstrap+ztree

使用说明

  1. 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
  2. 使用IDEA/Eclipse/MyEclipse导入项目,导入成功后请执行maven clean;maven install命令,然后运行;
  3. 将项目中application.yml配置文件中的数据库配置改为自己的配置;
  4. 运行项目,在浏览器中输入http://localhost:8080/ 登录
    管理员账号/密码:admin/111111
    医生账号/密码:doctor/111111
    病人账号/密码:doctor/111111请添加图片描述
    请添加图片描述
    请添加图片描述
    请添加图片描述
    请添加图片描述
    请添加图片描述

适用

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

     * 删除病人用户
     * @param id
     * @return
     */
    @RequestMapping(value="/delete",method=RequestMethod.POST)
    @ResponseBody
    public Result<Boolean> delete(@RequestParam(name="id",required=true)Long id){
        try {
            Patient patient = patientService.find(id);
            patientService.deleteById(id);
            userService.delete(patient.getUser().getId());
        } catch (Exception e) {
            return Result.error(CodeMsg.ADMIN_UPATIENT_ERROR);
        }
        operaterLogService.add("添加病人用户,病人用户ID:" + id);
        return Result.success(true);
    }
            return Result.error(CodeMsg.ADMIN_PUBLIC_NO_ISEXIST_EMAIL);
        }
        if(Objects.isNull(doctor.getUser().getMobile())){
            return Result.error(CodeMsg.ADMIN_PUBLIC_NO_ISEXIST_MOBILE);
        }
        if (!StringUtil.isMobile(doctor.getUser().getMobile())) {
            return Result.error(CodeMsg.ADMIN_PUBLIC_MOBILE);
        }
        if (!StringUtil.emailFormat(doctor.getUser().getEmail())) {
            return Result.error(CodeMsg.ADMIN_PUBLIC_EMAIL);
        }
        User user = doc.getUser();
        user.setEmail(doctor.getUser().getEmail());
        user.setMobile(doctor.getUser().getMobile());
        user.setStatus(doctor.getStatus());
        doc.setStatus(doctor.getStatus());
        doc.setDescription(doctor.getDescription());
        doc.setExperience(doctor.getExperience());
        BeanUtils.copyProperties(user, doctor.getUser(), "id", "createTime", "updateTime", "password", "username", "role", "sex", "age", "birthday");
        doctorService.save(doc);
        return Result.success(true);
    }
    /**
     * 医生查询接单记录
     * @param model
     * @param pageBean
    }
    /**
     * 病人查询个人住院信息
     */
    @RequestMapping(value="/bedAllot")
    public String bedAllotSelf(Model model,PageBean<BedAllot> pageBean){
        Patient loginPatientUser = patientService.findByLoginPatientUser();
        Long patientId = loginPatientUser.getId();
        model.addAttribute("title","住院信息");
        model.addAttribute("pageBean",bedAllotService.findByPatient(pageBean,patientId));
        return "admin/patient/bedAllot";
    }
}
后台用户管理控制器:
/**
 * 后台用户管理控制器
 * @author yy
 *
 */
    public Result<Boolean> editSelf(Patient patient){
        Patient findPatient = patientService.find(patient.getId());
        List<Patient> patients = patientService.findByPatientPno(findPatient.getPatientPno());
        if (patients.size() > 1 || patients.size() <= 0) {
            return Result.error(CodeMsg.ADMIN_PATIENT_PNO_ERROR);
        }
        if (patients.get(0).getId() != patient.getId()) {
            return Result.error(CodeMsg.ADMIN_PATIENT_PNO_ERROR);
        }
        if(Objects.isNull(patient.getUser().getEmail())){
            return Result.error(CodeMsg.ADMIN_PUBLIC_NO_ISEXIST_EMAIL);
        }
        if(Objects.isNull(patient.getUser().getMobile())){
            return Result.error(CodeMsg.ADMIN_PUBLIC_NO_ISEXIST_MOBILE);
        }
        if (!StringUtil.emailFormat(patient.getUser().getEmail())){
            return   Result.error(CodeMsg.ADMIN_PUBLIC_EMAIL);
        }
        if (!StringUtil.isMobile(patient.getUser().getMobile())){
            return   Result.error(CodeMsg.ADMIN_PUBLIC_MOBILE);
        }
        int age = DateUtil.getAge(patient.getUser().getBirthDay());
        if (age < 0) {
            return   Result.error(CodeMsg.ADMIN_PUBLIC_AGE);
        }
        User user = patient.getUser();
        user.setAge(age);
	/**
	 * 编辑用户信息表单提交处理
	 * @param user
	 * @return
	 */
	@RequestMapping(value="/edit",method=RequestMethod.POST)
	@ResponseBody
	public Result<Boolean> edit(User user){
		//用统一验证实体方法验证是否合法
		CodeMsg validate = ValidateEntityUtil.validate(user);
		if(validate.getCode() != CodeMsg.SUCCESS.getCode()){
			return Result.error(validate);
		}
		if(user.getRole() == null || user.getRole().getId() == null){
			return Result.error(CodeMsg.ADMIN_USER_ROLE_EMPTY_EDIT);
		}
		if(user.getRole().getId() == Doctor.DOCTOR_ROLE_ID || user.getRole().getId() == Patient.PATIENT_ROLE_ID){
			return Result.error(CodeMsg.ADMIN_USER_ROLE_CANNOT_CHANGE);
		}
		if(user.getId() == null || user.getId().longValue() <= 0){
			return Result.error(CodeMsg.ADMIN_USE_NO_EXIST);
		}
		if(userService.isExistUsername(user.getUsername(), user.getId())){
			return Result.error(CodeMsg.ADMIN_USERNAME_EXIST);
		}
		//到这说明一切符合条件,进行数据库保存
		}
		if(user.getRole() == null || user.getRole().getId() == null){
			return Result.error(CodeMsg.ADMIN_USER_ROLE_EMPTY_EDIT);
		}
		if(user.getRole().getId() == Doctor.DOCTOR_ROLE_ID || user.getRole().getId() == Patient.PATIENT_ROLE_ID){
			return Result.error(CodeMsg.ADMIN_USER_ROLE_CANNOT_CHANGE);
		}
		if(user.getId() == null || user.getId().longValue() <= 0){
			return Result.error(CodeMsg.ADMIN_USE_NO_EXIST);
		}
		if(userService.isExistUsername(user.getUsername(), user.getId())){
			return Result.error(CodeMsg.ADMIN_USERNAME_EXIST);
		}
    public Result<Boolean> add(Patient patient){
        CodeMsg validate = ValidateEntityUtil.validate(patient);
        if(validate.getCode() != CodeMsg.SUCCESS.getCode()){
            return Result.error(validate);
        }
        if(Objects.isNull(patient.getUser().getEmail())){
            return Result.error(CodeMsg.ADMIN_PUBLIC_NO_ISEXIST_EMAIL);
        }
        if(Objects.isNull(patient.getUser().getMobile())){
            return Result.error(CodeMsg.ADMIN_PUBLIC_NO_ISEXIST_MOBILE);
        }
        if (!StringUtil.emailFormat(patient.getUser().getEmail())){
            return   Result.error(CodeMsg.ADMIN_PUBLIC_EMAIL);
        }
        if (!StringUtil.isMobile(patient.getUser().getMobile())){
            return   Result.error(CodeMsg.ADMIN_PUBLIC_MOBILE);
        }
        Role role = roleService.find(Patient.PATIENT_ROLE_ID);
        String pNo = StringUtil.generateSn(Patient.PATIENT_ROLE_PNO);
        int age = DateUtil.getAge(patient.getUser().getBirthDay());
        if (age < 0) {
            return   Result.error(CodeMsg.ADMIN_PUBLIC_AGE);
        }
        patient.getUser().setAge(age);
        patient.setPatientPno(pNo);
        patient.getUser().setPassword(pNo);
    public String updateDoctorStatus(Model model) {
        Doctor doctor = doctorService.findByLoginDoctorUser();
        model.addAttribute("title","个人出诊信息修改");
        model.addAttribute("doctor", doctor);
        return "admin/doctor/visitingStatus";
    }
    /**
     * 提交修改个人出诊状态
     * @param doctor
     * @return
     */
    @RequestMapping(value = "/updateStatus", method = RequestMethod.POST)
    @ResponseBody
    public Result<Boolean> editStatus(Doctor doctor) {
	
	/**
	 * 用户编辑页面
	 * @param model
	 * @return
	 */
	@RequestMapping(value="/edit",method=RequestMethod.GET)
	public String edit(Model model,@RequestParam(name="id",required=true)Long id){
		model.addAttribute("roles", roleService.findSome());
		model.addAttribute("user", userService.find(id));
		return "admin/user/edit";
	}
	
	/**
	 * 编辑用户信息表单提交处理
	 * @param user
	 * @return
	 */
	@RequestMapping(value="/edit",method=RequestMethod.POST)
	@ResponseBody
	public Result<Boolean> edit(User user){
        int age = DateUtil.getAge(patient.getUser().getBirthDay());
        if (age < 0) {
            return   Result.error(CodeMsg.ADMIN_PUBLIC_AGE);
        }
        User user = patient.getUser();
        user.setAge(age);
        BeanUtils.copyProperties(user,findPatient.getUser(), "id","createTime","updateTime","password","username","role");
        userService.save(findPatient.getUser());
        patientService.save(findPatient);
        return Result.success(true);
    }
    /**
     * 跳转到病人修改个人信息页面
     * @param model
     * @param id
     * @return
     */
    @RequestMapping(value="/editSelf",method=RequestMethod.GET)
    public String editSelf(Model model,@RequestParam(name="id")Long id){
        model.addAttribute("patient", patientService.find(id));

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值