文章目录
Java精彩实战项目案例
Java精彩新手项目案例
Python精彩新手项目案例
前言
一、系统功能
1.1 开发环境
二、系统设计
2.1 研究思路分析
2.2 系统功能结构图
三、部分功能展示
四、部分代码设计
4.1.后端管理员控制层【代码如下(示例):】
4.2.医生管理控制层:【代码如下(示例):】
4.3.登录控制层:【代码如下(示例):】
4.4.后端管理员控制层::【代码如下(示例):】
总结
<font color=#999AAA >源码获取: <font color=#999AAA >
Java精彩实战项目案例
Java精彩新手项目案例
Python精彩新手项目案例
前言
本次文章主要是介绍Java+SprignBoot+BootStrap医院预约挂号系统的功能,系统有多个角色,可以动态分配权限
一、系统功能
1.1 开发环境
- 开发语言:Java - 技术:SprignBoot+BootStrap
- 数据库:MySQL - 架构:B/S - 源码类型: Web
- 编译工具:Idea、Eclipse、MyEclipse (选其一)
- 其他:jdk1.8、Tomcat8.5【内置】、Navicat
二、系统设计
2.1 研究思路分析
在系统流程分析当中调查分析它是比较重要的环节,因为在这个系统当中它都涉及到每个环节的业务流程,所以从Java+SprignBoot+BootStrap医院预约挂号系统的设计的整体设计上要保证各个信息的正确输入和输出以及对数据储存的完整,并结合实际的操作步骤来绘制出具体的流程图。具体流程图如下图所示:
2.2 系统功能结构图
管理员登陆后,主要包括主页,个人中心、用户管理、医生管理、门诊信息管理、预约挂号管理、取消预约管理、改约通知管理、留言板管理、系统管理等功能。
医生登陆后,主要包括主页、个人中心、门诊信息管理、预约挂号管理、取消预约管理等功能。
用户登陆后,主要包括主页、个人中心、预约挂号管理、取消预约管理、改约通知管理等功能。
三、部分功能展示
☀️系统首页界面图☀️
☀️门诊信息界面图☀️
☀️留言板界面图☀️
☀️个人中心界面图☀️
☀️管理员功能界面图☀️
☀️医生功能界面图☀️
☀️用户功能界面图☀️
四、部分代码设计
后端管理员控制层:
/**
* 后端管理员控制层
*/
@Controller
@RequestMapping("/api")
public class PatientController {
private Integer size = 6;//每页显示数量
@Autowired
private AdminService adminService;
@Autowired
private SectionService sectionService;
@Autowired
private BannersService bannersService;
@Autowired
private DoctorService doctorService;
@Autowired
private PatientService patientService;
@Autowired
private MessagesService messagesService;
/**
* 医生列表
*/
@RequestMapping("/doctorList1")
public String doctorList(Model model, Doctor doctor, @RequestParam(value="page",defaultValue="1")Integer page) {
if(doctor == null) {
doctor = new Doctor();
}
PageInfo<Doctor> pageInfo = doctorService.selectDoctorList(doctor,page,size);
List<Doctor> list = pageInfo.getList();
model.addAttribute("doctorList",pageInfo.getList());
model.addAttribute("pageInfo",pageInfo);
model.addAttribute("doctor",doctor);
return "patient/doctorList";
}
/**
*登录
* @throws ParseException
*/
@RequestMapping(value = "/userLogin")
@ResponseBody
public Patient userLogin(@RequestBody Patient patient) throws ParseException {
List<Patient> list = patientService.selectPatient(patient);
if(patient != null && patient.getUsername() != null && patient.getPassword() != null) {
if(list.size() > 0) {
return list.get(0);
}
}
return patient;
}
/**
*登录
* @throws ParseException
*/
@RequestMapping(value = "/passwordSave")
@ResponseBody
public String passwordSave(@RequestBody Patient patient ) throws ParseException {
if(patient != null && patient.getUsername() != null && patient.getPassword() != null) {
Patient pa = new Patient();
pa.setUsername(patient.getUsername());
List<Patient> list = patientService.selectPatient(pa);
if(list.size() > 0) {
return "err";
}
patientService.insertSelective(patient);
return "ok";
}
return "err";
}
/**
*登录验证
* @throws ParseException
*/
@RequestMapping(value = "/userLoginView")
@ResponseBody
public String userLoginView(HttpServletRequest request) throws ParseException {
HttpSession session = request.getSession();
Patient patient =(Patient) session.getAttribute("USER");
System.out.println("*********登陆验证********");
System.out.println(patient);
if(patient != null) {
return "ok";
}
return "err";
}
/**
*banner图
*/
@RequestMapping(value = "/bannerList")
@ResponseBody
public String[] formAdd() {
Banners banners = bannersService.selectByPrimaryKey(1);
String[] split = null;
if(banners != null && banners.getImg() != null) {
split = banners.getImg().split(",");
}
return split;
}
/**
*科室查询
*/
@RequestMapping(value = "/sectionList")
@ResponseBody
public Map<String,List<Section>> sectionList() {
Map<String,List<Section>> map = new HashMap<String,List<Section>>();
List<Section> sectionlist2 = null;
Section se = new Section();
se.setType(1);
List<Section> sectionlist = sectionService.selectByExample(se);
if(sectionlist.size() > 0 ) {
//科室详情
Section section = new Section();
section.setPid(sectionlist.get(0).getId());
section.setType(2);
sectionlist2 = sectionService.selectByExample(section);
}
map.put("sectionlist",sectionlist);
map.put("sectionlist2",sectionlist2);
return map;
}
/**
*科室下级查询
*/
@RequestMapping(value = "/sectionXiaList")
@ResponseBody
public List<Section> sectionXiaList(Integer id) {
Section se = new Section();
se.setPid(id);
se.setType(2);
List<Section> sectionlist = sectionService.selectByExample(se);
return sectionlist;
}
/**
*科室下级查询
*/
@RequestMapping(value = "/patientPai")
@ResponseBody
public Integer patientPai(Integer id) {
Patient pa = new Patient();
pa.setPid(id);
PatientExample se = new PatientExample();
PatientExample.Criteria criteria = se.createCriteria();
if(pa != null){
if(pa.getPid() != null) {
criteria.andPidEqualTo(pa.getPid());
}
}
List<Patient> selectByExample = patientService.selectByExample(se);
if(selectByExample.size() >0 ) {
List<Messages> lmlist = messagesService.selectByExample(null);
int j = 0 ;
for (Messages me : lmlist) {
if(me.getUid() == id) {
return j;
}
j++;
}
}
return -1;
}
/**
*查询科室
*/
@RequestMapping(value = "/sectioNameList")
@ResponseBody
public List<Section> sectioNameList(String name) {
Section se = new Section();
se.setName(name);
se.setType(2);
List<Section> sectionlist = sectionService.selectByExample(se);
if(sectionlist.size() > 0) {
//查询全部科室
se.setName(null);
se.setPid(sectionlist.get(0).getPid());
se.setType(2);
sectionlist = sectionService.selectByExample(se);
}
return sectionlist;
}
/**
* 坐诊时间yuyue
*/
@RequestMapping("/doctorTimePage")
public String doctorTimePage(Integer id,Model model) {
if(id != null) {
Doctor doctor = doctorService.selectByPrimaryKey(id);
model.addAttribute("doctor",doctor);
}
return "patient/doctorTime";
}
/**
*医生列表查询
*/
@RequestMapping(value = "/doctorList")
@ResponseBody
public List<Doctor> doctorList(Integer sid) {
Doctor doctor = new Doctor();
doctor.setSid(sid);
List<Doctor> selectDoctor = doctorService.selectDoctor(doctor);
return selectDoctor;
}
/**
*医生列表查询
*/
@RequestMapping(value = "/doctorLike")
@ResponseBody
public List<Doctor> doctorLike(String name) {
Doctor doctor = new Doctor();
doctor.setName(name);
List<Doctor> selectDoctor = doctorService.selectDoctor(doctor);
return selectDoctor;
}
/**
*科室查询
*/
@RequestMapping(value = "/doctorIdList")
@ResponseBody
public Section doctorIdList(Integer sid) {
Section selectByPrimaryKey = sectionService.selectByPrimaryKey(sid);
return selectByPrimaryKey;
}
/**
*医生列表查询
* @throws ParseException
*/
@RequestMapping(value = "/doctortimeSelect")
@ResponseBody
public List<Doctor> doctortimeSelect(@RequestParam("datetimei")String datetimei,@RequestParam("id")Integer id) throws ParseException {
Doctor doctor = new Doctor();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
doctor.setSid(id);
doctor.setBegindate(simpleDateFormat.parse(datetimei));
List<Doctor> selectDoctor = doctorService.selectTime(doctor);
return selectDoctor;
}
/**
*医生列表查询
* @throws ParseException
*/
@RequestMapping(value = "/doctorGeRenList")
@ResponseBody
public Doctor doctorGeRenList(Integer id) throws ParseException {
Doctor doctor = doctorService.selectByPrimaryKey(id);
return doctor;
}
/**
*时间格式转换
*/
@RequestMapping(value = "/doctorYuyueTime")
@ResponseBody
public Map<String,String> doctorYuyueTime(Integer id) {
Map<String,String> map = new HashMap<String,String>();
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
Doctor doctor = doctorService.selectByPrimaryKey(id);
map.put("begin",sdf.format(doctor.getBegintime()));
map.put("end",sdf.format(doctor.getEndtime()));
return map;
}
/**
*时间格式转换
* @throws ParseException
*/
@RequestMapping(value = "/timeZhuan")
@ResponseBody
public String timeZhuan(String time) throws ParseException {
Date parse = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
if(time != null) {
parse = sdf.parse(time);
}
return sdf.format(parse);
}
/**
*添加患者信息
*/
@RequestMapping(value = "/loginByPatient")
public String loginByPatient(@RequestBody Patient patient) {
return "loginByPatient";
}
/**
*添加患者信息
*/
@RequestMapping(value = "/patientSave")
public String patientSave(Patient patient) {
patientService.insertSelective(patient);
return "loginByPatient";
}
/**
* 判断患者账号
*/
@RequestMapping("/panzhanghao")
@ResponseBody
public Map<String,String> panzhanghao(Model model, String zhanghao) {
Map<String, String> map = new HashMap<String, String>();
PatientExample se = new PatientExample();
PatientExample.Criteria criteria = se.createCriteria();
criteria.andUsernameEqualTo(zhanghao);
List<Patient> selectByExample = patientService.selectByExample(se);
if(selectByExample.size() > 0){
map.put("pan","err");
}else{
map.put("pan","ok");
}
return map;
}
/**
* 患者注册界面
*/
@RequestMapping("/patientAddPage")
public String patientAddPage(Model model) {
return "patientRegister";
}
/**
*患者信息列表
*/
@RequestMapping(value = "/patientList")
@ResponseBody
public List<Patient> patientList(Integer pid,HttpServletRequest request) {
Patient pa = new Patient();
pa.setPid(pid);
List<Patient> selectPatient = patientService.selectPatient(pa);
return selectPatient;
}
/**
*患者信息列表
*/
@RequestMapping("/patientList2")
public String messageList2(Model model, Patient patient, @RequestParam(value="page",defaultValue="1")Integer page,HttpServletRequest request) {
if(patient == null) {
patient = new Patient();
}
HttpSession session = request.getSession();
Patient patient1 = (Patient) session.getAttribute("PATIENT");
if(patient1 == null){
return "redirect:/login/font/index";
}
/*
* PageInfo<Patient> pageInfo =
* patientService.selectPatientList(patient,1,size); List<Patient> list =
* pageInfo.getList(); List<Patient> list2 = new ArrayList<Patient>(); Messages
* messages = new Messages(); boolean pan = false; SimpleDateFormat sdf = new
* SimpleDateFormat("yyyy-MM-dd"); for (Patient pa : list) { if(pa.getPid() !=
* null && pa.getPid() != 0){ messages.setDid(dt.getId());
* messages.setUid(pa.getPid()); messages.setUsername(pa.getName());
* List<Messages> ml = messagesService.selectMessages(messages); if(ml.size() >
* 0 ){ Date time = ml.get(0).getTime(); pa.setUsername(sdf.format(time));
* pa.setPhone(dt.getName()); pa.setIdentitys(dt.getSname()); list2.add(pa); }
*
* } } if(list2.size() <= 8) { pageInfo.setPages(1); }
*/
Messages messages = new Messages();
// messages.setTime(new Date());
messages.setType(1);
messages.setUid(patient1.getPid());
PageInfo<Messages> pageInfo = messagesService.selectMessagesList(messages, 1, size);
model.addAttribute("doctorList",pageInfo.getList());
model.add