基于javaweb的宠物医院预约挂号系统(java+JSP+Spring+SpringBoot+MyBatis+html+layui+maven+Mysql)
一、项目简述
功能包括:
用户分为宠物,医生,管理员,宠物主人可进行注册选择医生挂号,选择日期,选择号源,医生可进行宠物接诊,管理员可对宠物,医生信息的维护等等功能。
二、项目运行
环境配置:
Jdk1.8 + Tomcat8.5 + mysql + Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)
项目技术:
JSP +Spring + SpringBoot + MyBatis + html+ css + JavaScript + JQuery + Ajax + layui+ maven等等
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
if(doctor.getSid() != null) {
Section section = sectionService.selectByPrimaryKey(doctor.getSid());
doctor.setSid(section.getId());
doctor.setSname(section.getName());
}
doctorService.updateByPrimaryKeySelective(doctor);
}
return "redirect:/doctor/index";
}
return pageInfo2.getList();
}
/**
*医生列表查询
*/
@RequestMapping(value = "/messagesQundingUptate")
@ResponseBody
public String messagesQundingUptate(Integer id) {
if(id != null) {
Messages messages = new Messages();
messages.setId(id);
messages.setType(3); //3表示预约成功
messagesService.updateByPrimaryKeySelective(messages);
Messages selectByPrimaryKey = messagesService.selectByPrimaryKey(id);
Messages mes = new Messages();
mes.setType(1);
mes.setTime(new Date());
mes.setDid(selectByPrimaryKey.getDid());
List<Messages> list = messagesService.selectMessagesPai(mes);
for (int i = 0; i < list.size(); i++) {
}else{
map.put("massage","删除失败");
}
}else{
sb.append(split[i]+",");
}
}
}
}
Banners banners = new Banners();
banners.setId(id);
banners.setImg(sb.toString());
System.out.println(mlist.size());
model.addAttribute("mlist",mlist);
return "doctor/messageList";
}
@RequestMapping("/index")
public String index(Model model,HttpServletRequest request) {
filename = random+".jpg";
try {
//文件保存路径 D:/xxxx/xxxx/
File file = new File(filePath+filename);
//判断父级文件是否存在
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);
*//**
* 管理员-人物列表
*//*
@RequestMapping("/personList")
public String personList(Model model,Person person,@RequestParam(value="page",defaultValue="1")Integer page,String sou) {
PageInfo<Person> pageInfo = personService.selectPageList(person,page,size);
List<Person> list = pageInfo.getList();
List<Person> list2 = new ArrayList<Person>();
//默认显示第一张图片
for(int i =0; i<list.size();i++){
Person sh = list.get(i);
String[] img = sh.getImg().split(",");
if(img.length > 0){
sh.setImg(img[0]);
model.addAttribute("doctor",doctor);
//科室
Section se = new Section();
se.setType(1);
List<Section> sectionlist = sectionService.selectByExample(se);
model.addAttribute("sectionlist", sectionlist);
//科室详情
Section se1 = sectionService.selectByPrimaryKey(doctor.getSid());
if(se1 != null) {
Section section = new Section();
section.setPid(se1.getPid());
section.setType(2);
sectionlist2 = sectionService.selectByExample(section);
model.addAttribute("sectionlist2", sectionlist2);
model.addAttribute("se1", se1);
}
}
return "doctor/doctorUptate";
}
/**
if(Character.isUpperCase(sz)){
sz = StringRandom.toLower(sz); //大写转小写
}
for(int i =0; i<list.size();i++){
Person sh = list.get(i);
if(sh.getName() != null){
char names = StringRandom.getPinYinHeadChar(sh.getName()); //名字的首字母
if(names == sz){
list2.add(sh);
}
}
}
model.addAttribute("personList",list2);
}else{
model.addAttribute("personList",list);
}
model.addAttribute("sou",sou);
model.addAttribute("pageInfo",pageInfo);
model.addAttribute("person",person);
return "behind/admin/feiyi_personList";
}
*//**
* 人物删除
* @param model
}
return selectByExample;
}
/**
* 判断管理员账号
*/
@RequestMapping("/mimaUpate")
@ResponseBody
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("/adminUptatePassword")
public String adminUptatePassword(Model model,Admin admin,HttpServletRequest request) {
HttpSession session = request.getSession();
Admin ad = (Admin) session.getAttribute("ADMIN");
if(ad != null && admin.getPassword() != null){
admin.setId(ad.getId());
adminService.updateByPrimaryKeySelective(admin);
}
return "redirect:/admin/index";
}
/**
* 添加科室
*/
@RequestMapping("/sectionAdd")
@ResponseBody
public Map<String,String> sectionAdd(String name) {
Map<String, String> map = new HashMap<String, String>();
if(name != null ){
Section section = new Section();
section.setName(name);
section.setType(1);
sectionService.insertSelective(section);
public Map<String,String> sectionAdd(String name) {
Map<String, String> map = new HashMap<String, String>();
if(name != null ){
Section section = new Section();
section.setName(name);
section.setType(1);
sectionService.insertSelective(section);
map.put("pan","ok");
}else{
map.put("pan","err");
}
return map;
}
/**
map.put("id",doctor.getId());
}
return map;
}
/**
* 判断管理员账号
*/
@RequestMapping("/sectionxList")
@ResponseBody
public List<Section> sectionxList(Model model, Integer id) {
List<Section> selectByExample = null;
if(id != null) {
Section section = new Section();
section.setPid(id);
selectByExample = sectionService.selectByExample(section);
}
return selectByExample;
patient.setUsername(username);
patient.setPassword(password);
List<Patient> list = patientService.selectPatient(patient);
if(list.size() <= 0) {
model.addAttribute("message","密码错误");
model.addAttribute("type",type);
return "loginByPatient";
}
session.setAttribute("PATIENT",list.get(0));
return "redirect:/api/doctorList1";
}
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 "login";
}
session.setAttribute("ADMIN",adminlist.get(0));
@Autowired
private SectionService sectionService;
@Autowired
private PatientService patientService;
@Value("${fileUrl}") //在配置文件中获取文件的保存路径
private String filePath;
/**
* 后台登陆界面
* @param zixun
* @return
*/
@RequestMapping("/zixunInsert")
public String zixunInsert(Model model,Doctor doctor){
if(doctor.getId() != null){
if(doctor.getSid() != null) {
Section selectByPrimaryKey = sectionService.selectByPrimaryKey(doctor.getSid());
doctor.setSname(selectByPrimaryKey.getName());
}
doctorService.updateByPrimaryKeySelective(doctor);
}
model.addAttribute("type",1);
return "login";
}
/**
@Autowired
private AdminService adminService;
@Autowired
private DoctorService doctorService;
@Autowired
private SectionService sectionService;
@Autowired
private PatientService patientService;
@Value("${fileUrl}") //在配置文件中获取文件的保存路径
private String filePath;
/**
* 后台登陆界面
* @throws IOException
//类型为1是商户后台 2是管理员
if(type == 1){
Merchant merchant = new Merchant();
merchant.setZhanghao(username);
merchant.setMima(password);
merchant.setState(1);
List<Merchant> merchants = merchantService.selectMerchant(merchant);
if(merchants.size() <= 0){
model.addAttribute("message","密码错误");
model.addAttribute("type",type);
messagesService.updateByPrimaryKeySelective(messages);
Messages selectByPrimaryKey = messagesService.selectByPrimaryKey(id);
Messages mes = new Messages();
mes.setType(1);
mes.setTime(new Date());
mes.setDid(selectByPrimaryKey.getDid());
List<Messages> list = messagesService.selectMessagesPai(mes);
for (int i = 0; i < list.size(); i++) {
list.get(i).setPai(i+1);
messagesService.updateByPrimaryKeySelective(list.get(i));
}
}
return "ok";
}
/**
*患者信息列表
* 医生注册界面
*/
@RequestMapping("/doctorRegisterPage")
public String doctorRegister(Model model) {
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();
}
bannersService.updateByPrimaryKeySelective(banners);
}
return map;
}
/*
*//**
* 管理员-非遗讲堂
*//*
@RequestMapping(value="/feiyi_videoList")
public String feiyi_VideoList(Model model, Video video, @RequestParam(value="page",defaultValue="1")Integer page) {
PageInfo<Video> pageInfo = videoService.selectPageList(video,page,size);
model.addAttribute("videoList",pageInfo.getList());
model.addAttribute("pageInfo",pageInfo);
if(video.getTitle() != null){
model.addAttribute("title",video.getTitle());
public String verificatio(String username, String password, Integer type, HttpServletRequest request,Model model) {
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);
mes.setDid(selectByPrimaryKey.getDid());
List<Messages> list = messagesService.selectMessagesPai(mes);
for (int i = 0; i < list.size(); i++) {
list.get(i).setPai(i+1);
messagesService.updateByPrimaryKeySelective(list.get(i));
}
}
return "ok";
}
/**
@Value("${fileUrl}") //在配置文件中获取文件的保存路径
private String filePath;
/**
* 导入
* @param file
* @param response
* @throws IOException
*/
@RequestMapping("/excelInput")
model.addAttribute("sectionlist", sectionlist);
//科室详情
Section se1 = sectionService.selectByPrimaryKey(doctor.getSid());
if(se1 != null) {
Section section = new Section();
section.setPid(se1.getPid());
section.setType(2);
sectionlist2 = sectionService.selectByExample(section);
model.addAttribute("sectionlist2", sectionlist2);
model.addAttribute("se1", se1);
}
}
return "doctor/doctorUptate";
}
String urlsrls = video.getUrls();
String name = urlsrls.substring(urlsrls.indexOf("s") + 2); //获取文件名
File file = new File(filePath +name);
if(file.exists()){
file.delete();
}
videoService.deleteByPrimaryKey(id);
}
return "redirect:/admin/feiyi_videoList";
}
*//**
* 管理员-人物列表
*//*
@RequestMapping("/personList")
public String personList(Model model,Person person,@RequestParam(value="page",defaultValue="1")Integer page,String sou) {
PageInfo<Person> pageInfo = personService.selectPageList(person,page,size);
List<Person> list = pageInfo.getList();
List<Person> list2 = new ArrayList<Person>();
//默认显示第一张图片
for(int i =0; i<list.size();i++){
Person sh = list.get(i);
String[] img = sh.getImg().split(",");
model.addAttribute("facount",facount);
//总评论数
int commentcount = commentService.countByExample(null);
//用户数
int usercount = usertService.countByExample(null);
//商品数量
int shopcount = shopService.countByExample(null);
//资讯数量
int zixuncount = zixunService.countByExample(null);
model.addAttribute("commentcount",commentcount);
model.addAttribute("usercount",usercount);
model.addAttribute("shopcount",shopcount);
model.addAttribute("zixuncount",zixuncount);
return "behind/admin/index";
}
*//**
* 资讯列表
* @param model
* @return
*//*
@RequestMapping("/zixunList")