一、项目简述
功能包括:
用户分为患者,医生,管理员,患者可进行注册选择医生挂号,选择日期,选择号源,医生可进行接诊,管理员可对用户,医生信息的维护等等功能。
二、项目运行
环境配置:
Jdk1.8 + Tomcat8.5 + mysql + Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)
项目技术:
JSP +Spring + SpringBoot + MyBatis + html+ css + JavaScript + JQuery + Ajax + layui+ maven等等
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
* @return
*//*
@RequestMapping("/merchantUptate")
public String merchantUptate(Model model) {
return "behind/merchant/merchantUptate";
}
*/
}
后端管理员控制层:
/**
* 后端管理员控制层
*/
@Controller
@RequestMapping("/api")
public class PatientController {
public class LoginController {
@Autowired
private AdminService adminService;
@Autowired
private DoctorService doctorService;
@Autowired
private SectionService sectionService;
@Autowired
private PatientService patientService;
@Value("${fileUrl}") //在配置文件中获取文件的保存路径
private String filePath;
/**
* 后台登陆界面
}
/**
*患者信息查看
*/
@RequestMapping(value = "/patientUpatePage")
@ResponseBody
public Patient patientUpatePage(Integer id) {
Patient patient = null;
if(id != null) {
patient = patientService.selectByPrimaryKey(id);
}
return patient;
}
/**
*患者信息修改
*/
@RequestMapping(value = "/patientUpdate")
@ResponseBody
public Patient patientUpdate(@RequestBody Patient patient) {
patientService.updateByPrimaryKeySelective(patient);
return null;
}
}
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
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);
}
/**
*添加患者信息
*/
PageInfo<Messages> pageInfo = messagesService.selectMessagesList(messages,page,size);
//工作区数据
messages.setTime(new Date());
List<Messages> list = messagesService.selectMessagesPai(messages);
model.addAttribute("mlist",list);
model.addAttribute("messagesList",pageInfo.getList());
model.addAttribute("pageInfo",pageInfo);
model.addAttribute("messages",messages);
model.addAttribute("type",type);
return "doctor/messageList";
}
/**
*医生列表查询
*/
HttpSession session = request.getSession();
session.setAttribute("type",type);
//类型为1是医院 2是管理员
if(type == 1){
Doctor doctor = new Doctor();
doctor.setUsername(username);
doctor.setPasswoed(password);
List<Doctor> doctorlist = doctorService.selectDoctor(doctor);
if(doctorlist.size() <= 0){
model.addAttribute("message","密码错误");
model.addAttribute("type",type);
return "login";
}
session.setAttribute("DOCTOR",doctorlist.get(0));
return "redirect:/doctor/index";
}
if(type == 3){
Patient patient = new Patient();
patient.setUsername(username);
patient.setPassword(password);
List<Patient> list = patientService.selectPatient(patient);
int patient = 0;
List<Patient> selectByExample = patientService.selectByExample(null);
Messages mess = new Messages();
for (Patient pa : selectByExample) {
if(pa.getName() != null) {
mess.setDid(dt.getId());
mess.setUsername(pa.getName());
List<Messages> selectMessages = messagesService.selectMessages(mess);
if(selectMessages.size() > 0 )
{
patient++;
}
}
}
//预约总数
MessagesExample me = new MessagesExample();
MessagesExample.Criteria mecriteria = me.createCriteria();
mecriteria.andDidEqualTo(dt.getId());
int messages = messagesService.countByExample(me);
model.addAttribute("doctor",doctor);
model.addAttribute("section",section);
model.addAttribute("patient",patient);
model.addAttribute("messages",messages);
PageInfo<Doctor> pageInfo = doctorService.selectDoctorList(null,1,4);
@RequestMapping(value = "/doctorIdList")
@ResponseBody
public Section doctorIdList(Integer sid) {
Section selectByPrimaryKey = sectionService.selectByPrimaryKey(sid);
return selectByPrimaryKey;
}
/**
*医生列表查询
* @throws ParseException
*/
@RequestMapping(value = "/doctortimeSelect")
@ResponseBody
messages.setType(1);
messages.setDid(dt.getId());
PageInfo<Messages> pageInfo = messagesService.selectMessagesList(messages, 1, size);
model.addAttribute("doctorList",pageInfo.getList());
model.addAttribute("pageInfo",pageInfo);
model.addAttribute("patient",patient);
return "doctor/patientList";
}
/**
*预约信息列表
* @throws ParseException
*/
@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")