Java项目:医院预约挂号系统(java+jdbc+jsp+mysql+ajax)

 源码获取:博客首页 "资源" 里下载!

一、项目简述

功能: 用户分为患者,医生,管理员,患者可进行注册选择医生 挂号,选择日期,选择号源,医生可进行接诊,管理员可 对用户,医生信息的维护等等功能。

二、项目运行

环境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)

项目技术: Jdbc+ Servlert + Jsp + css + JavaScript + JQuery + Ajax + Fileupload等等。

管理员信息控制层:

@Controller
public class TmsController {
    @Autowired
    private TmsService tmsService;

    @RequestMapping(value = "/login")
    public String login(Tms tms, Model model, HttpSession session){
        // 通过账号和密码查询用户
        tms.setTmsPswd(MD5Util.MD5EncodeUtf8(tms.getTmsPswd()));
        Tms ad = tmsService.findTms(tms);
        if(ad!=null){
            session.setAttribute("ad", ad);
            return "homepage";
        }
        model.addAttribute("msg", "error");
        return "login";
    }

    /**
     * 退出登录
     */
    @RequestMapping(value = "/loginOut")
    public String loginOut(Tms tms, Model model, HttpSession session) {
        session.invalidate();
        return "login";

    }

    /**
     * 分页查询
     */
    @RequestMapping(value = "/findAdmin")
    public String findAdmin(String tmsUser, String tmsName,Integer pageIndex
            , Integer pageSize, Model model,HttpSession session) {
        PageInfo<Tms> ai = tmsService.findPageInfo(tmsUser,tmsName, pageIndex,pageSize);
        model.addAttribute("ai",ai);
        session.setAttribute("u",tmsUser);
        session.setAttribute("t",tmsName);
        return "admin_list";
    }

    /**
     * 添加管理员信息
     */
    @RequestMapping(value = "/addAdmin" ,method = RequestMethod.POST)
    @ResponseBody
    public String addAdmin(@RequestBody Tms tms) {
        tms.setTmsPswd(MD5Util.MD5EncodeUtf8(tms.getTmsPswd()));
        int a = tmsService.addTms(tms);
        return "admin_list";
    }


    /**
     * 删除管理员信息
     */
    @RequestMapping( "/deleteAdmin")
    @ResponseBody
    public String deleteAdmin(Integer tmsId) {
        int a = tmsService.deleteTms(tmsId);
        return "admin_list";
    }

    /**
     * 导出Excel
     */
    @RequestMapping(value = "/exportadminlist" , method = RequestMethod.POST)
    @ResponseBody
    public List<Tms> exportAdmin(){
        List<Tms> admin = tmsService.getAll();
        return admin;
    }

    /**
     * 根据管理员Id搜索;
     */
    @RequestMapping( "/findAdminById")
    public String findAdminById( Integer tmId,HttpSession session) {
        Tms a= tmsService.findTmsById(tmId);
        session.setAttribute("a",a);
        return "admin_edit";
    }

    /**
     * 修改管理员信息
     */
    /**
     * 将提交数据写入Tms对象
     */
    @RequestMapping( value = "/updateAdmin", method = RequestMethod.POST)
    public String updateAdmin(Tms tms) {
        tms.setTmsPswd(MD5Util.MD5EncodeUtf8(tms.getTmsPswd()));
        int a = tmsService.updateTms(tms);
        return "redirect:/findAdmin";
    }

}

 仪器信息控制层:

@Controller
public class PotionController {
    @Autowired
    private PotionService potionService;

    /**
     * 分页查询
     */
    @RequestMapping("/findPotion")
    public String findPotion(String potionNo, String potionName,Integer pageIndex
            , Integer pageSize, Model model,HttpSession session){
        PageInfo<Potion> po = potionService.findPageInfo(potionNo,potionName, pageIndex,pageSize);
        model.addAttribute("po",po);
        session.setAttribute("u",potionNo);
        session.setAttribute("t",potionName);
        return "potion_list";
    }

    /**
     * 添加管理员信息
     */
    @RequestMapping(value = "/addPotion" ,method = RequestMethod.POST)
    @ResponseBody
    public String addPotion(@RequestBody Potion potion) {
        int a = potionService.addPotion(potion);
        return "potion_list";
    }

    /**
     * 删除仪器信息
     */
    @RequestMapping( "/deletePotion")
    @ResponseBody
    public String deletePotion(Integer potionId) {
        int a = potionService.deletePotion(potionId);
        return "potion_list";
    }


    /**
     * 修改仪器信息
     */
    @RequestMapping( value = "/updatePotion", method = RequestMethod.POST)
    public String updatePotion(Potion potion) {
        int a = potionService.updatePotion(potion);
        return "redirect:/findPotion";
    }

    /**
     * 根据管理员Id搜索;将请求数据a_id写入参数a_id
     */
    @RequestMapping("/findPotionById")
    public String findPotionById(Integer potionId, HttpSession session) {
        Potion po2= potionService.findPotionById(potionId);
        session.setAttribute("po2",po2);
        return "potion_edit";
    }



    /**
     * 导出Excel
     */
    @RequestMapping(value = "/exportPotionlist" , method = RequestMethod.POST)
    @ResponseBody
    public List<Potion> exportPotion(){
        List<Potion> potions = potionService.getAll();
        return potions;
    }
}

部门信息控制层:

@Controller
public class DeptController {
    @Autowired
    private DeptService deptService;

    /**
     * 分页查询
     */
    @RequestMapping("/findDept")
    public String findDept(String deptNo, String deptName,Integer pageIndex
            , Integer pageSize, Model model,HttpSession session){
        PageInfo<Dept> de = deptService.findPageInfo(deptNo,deptName, pageIndex,pageSize);
        model.addAttribute("de",de);
        session.setAttribute("u",deptNo);
        session.setAttribute("t",deptName);
        return "Dept_list";
    }

    /**
     * 添加管理员信息
     */
    @RequestMapping(value = "/addDept" ,method = RequestMethod.POST)
    @ResponseBody
    public String addDept(@RequestBody Dept dept) {
        int a = deptService.addDept(dept);
        return "Dept_list";
    }


    /**
     * 修改信息
     */
    @RequestMapping( value = "/updateDept", method = RequestMethod.POST)
    public String updateDept(Dept dept) {
        int a = deptService.updateDept(dept);
        return "redirect:/findDept";
    }

    /**
     * 根据Id搜索;
     */
    @RequestMapping("/findDeptById")
    public String findDeptById(Integer deptId, HttpSession session) {
        Dept de2= deptService.findDeptById(deptId);
        session.setAttribute("de2",de2);
        return "Dept_edit";
    }



    /**
     * 导出Excel
     */
    @RequestMapping(value = "/exportDeptlist" , method = RequestMethod.POST)
    @ResponseBody
    public List<Dept> exportDept(){
        List<Dept> depts = deptService.getAll();
        return depts;
    }


    /**
     * 部门人员信息查询
     */
    @RequestMapping(value = "/findDeptPersonnel")
    public String findClassStudent(Dept dept,Model model, HttpSession session) {
        List<Dept> dep = deptService.findDeptPersonnel(dept);
        model.addAttribute("dep",dep);
        return "dept_Personnellist";
    }

}

源码获取:博客首页 "资源" 里下载!

  • 4
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 6
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

OldWinePot

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值