项目介绍:
登录、注册、用户管理、角色管理、体检人管理、体检健康史、体检人档案、体检中心管理
环境需要
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版本;
6.是否Maven项目:是;
技术栈
JSP +SpringBoot + MyBatis + html+ css + JavaScript + JQuery + Ajax + layui+ maven等等
使用说明
- 使用Navicat或者其它工具,在mysql中创建对应名称的数据库,并导入项目的sql文件;
- 使用IDEA/Eclipse/MyEclipse导入项目,Eclipse/MyEclipse导入时,若为maven项目请选择maven;
若为maven项目,导入成功后请执行maven clean;maven install命令,然后运行; - 将项目中springmvc-servlet.xml配置文件中的数据库配置改为自己的配置;
- 运行项目
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
/**
* @throws ParseException
*/
@RequestMapping(value = "/doctortouList")
@ResponseBody
public List<Doctor> doctortouList() {
PageInfo<Doctor> pageInfo = doctorService.selectDoctorList(null,1,4);
return pageInfo.getList();
}
/**
* @throws ParseException
*/
@RequestMapping(value = "/datatimeGua")
/**
*时间格式转换
*/
@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 {
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);
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);
/*
* 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.addAttribute("pageInfo",pageInfo);
model.addAttribute("patient",patient);
return "patient/patientList";
}
//判断父级文件是否存在
if (!file.getParentFile().exists()) {
file.getParentFile().mkdir();
}
mufile.transferTo(file);
} catch (IllegalStateException | IOException e) {
e.printStackTrace();
}
Doctor doctor = new Doctor();
if(id != -1){
doctor.setId(id);
doctor.setImg("/files/"+filename);
doctorService.updateByPrimaryKeySelective(doctor);
}else {
//添加图片路径
doctor.setImg("/files/"+filename);
doctorService.insertSelective(doctor);
}
doctorService.updateByPrimaryKeySelective(doctor);
}
model.addAttribute("type",1);
return "login";
}
/**
* 管理员注册界面
*/
@RequestMapping("/mimaPageUptate")
public String mimaPageUptate(Integer type,Model model) {
//1医生 2 管理员
if(type == 1 ) {
return "doctorRegister";
}
return "adminRegister";
public Map<String,String> passwordUpate(Model model, String zhanghao) {
Map<String, String> map = new HashMap<String, String>();
Admin ad = new Admin();
ad.setUsername(zhanghao);
List<Admin> selectAdmin = adminService.selectAdmin(ad);
if(selectAdmin.size() > 0){
map.put("pan","err");
}else{
map.put("pan","ok");
}
return map;
}
/**
* 判断医生账号
*/
@RequestMapping("/panzhanghao")
@ResponseBody
if(merchants.size() <= 0){
model.addAttribute("message","密码错误");
model.addAttribute("type",type);
return "behind/login";
}
session.setAttribute("MERCHANT",merchants.get(0));
return "redirect:/merchant/index";
}
Admin admin = new Admin();
admin.setUsername(username);
admin.setPassword(password);
List<Admin> adminlist = adminService.selectAdmin(admin);
if(adminlist.size() <= 0){
model.addAttribute("message","密码错误");
model.addAttribute("type",type);
return "behind/login";
}
session.setAttribute("ADMIN",adminlist.get(0));
return "redirect:/admin/index";
@RequestMapping("/sessionInvalidate")
public String boot(HttpServletRequest request,Model model) {
HttpSession session = request.getSession();
Integer type = (Integer) session.getAttribute("type");
if(type == null){
type=1;
}
if(type == 3){
model.addAttribute("type",type);
session.invalidate(); //session销毁
return "loginByPatient";
}
model.addAttribute("type",type);
session.invalidate(); //session销毁
return "login";
}
*医生列表查询
*/
@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;
}