iis服务器助手广告广告
返回顶部
首页 > 资讯 > 精选 >Java怎么实现宠物医院与商城一体的系统
  • 409
分享到

Java怎么实现宠物医院与商城一体的系统

2023-06-29 01:06:43 409人浏览 八月长安
摘要

本篇内容主要讲解“Java怎么实现宠物医院与商城一体的系统”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“Java怎么实现宠物医院与商城一体的系统”吧!项目运行:环境配置:jdk1.8 + Tom

本篇内容主要讲解“Java怎么实现宠物医院与商城一体的系统”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“Java怎么实现宠物医院与商城一体的系统”吧!

项目运行:

环境配置:

jdk1.8 + Tomcat8.5 + mysql + Eclispe(IntelliJ idea,Eclispe,MyEclispe,Sts都支持)

项目技术:

SpringBoot+ springMVC + mybatis + jsp + html+ javascript + Jquery + ajax + Maven等等

宠物医院与商城一体的系统

Java怎么实现宠物医院与商城一体的系统

Java怎么实现宠物医院与商城一体的系统

Java怎么实现宠物医院与商城一体的系统

Java怎么实现宠物医院与商城一体的系统

Java怎么实现宠物医院与商城一体的系统

Java怎么实现宠物医院与商城一体的系统

Java怎么实现宠物医院与商城一体的系统

后端管理员控制层:

@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";    }             @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;      }            @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";    }                               @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";       }          @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;    }        @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;    }                           @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;      }                   @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;    }            @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";         }         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";     }        @RequestMapping(value = "/patienDel")    @ResponseBody    public  List<Patient>   patienDel(Integer id) {    if(id != null) {    patientService.deleteByPrimaryKey(id);    }    List<Patient> selectByExample = patientService.selectByExample(null);        return  selectByExample;    }            @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;    }                    @RequestMapping(value = "/messagesSave")    public  String  messagesSave(Messages patient,HttpServletRequest request) throws ParseException {     HttpSession session =  request.getSession();         Patient       patient1   =  (Patient) session.getAttribute("PATIENT");        Messages  hui = null;        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");        Date shijian = simpleDateFormat.parse(patient.getSname());          patient.setTime(shijian);          patient.setType(1);//待预约                   Doctor doctor = doctorService.selectByPrimaryKey(patient.getDid());//医生          if(doctor != null) {          patient.setDname(doctor.getName());          if(doctor.getYipeoples() == null) {          doctor.setYipeoples(0);          }          doctor.setYipeoples(doctor.getYipeoples()+1);          doctorService.updateByPrimaryKeySelective(doctor);                    }          Section section = sectionService.selectByPrimaryKey(patient.getSid());//科室          if(section != null) {          patient.setSname(section.getName());          }                    Patient pa = patientService.selectByPrimaryKey(patient1.getId()); //患者          if(pa != null) {          patient.setUid(pa.getPid());          patient.setUserid(pa.getId());          patient.setPhone(pa.getPhone());           patient.setUsername(pa.getUsername());          patient.setAge(pa.getAge());          int countByExample = messagesService.countByExample(null);          patient.setBianhao(countByExample+1);          //排序          Messages message = new Messages();//          message.setUid(patient.getUid());      message.setTime(patient.getTime());      message.setDid(patient.getDid());      message.setType(-1);      List<Messages>  list  = messagesService.selectMessages(message);      if(list.size() <= 0) {      patient.setPai(1);      }else {      patient.setPai(list.size()+1);      }          }    messagesService.insertSelective(patient);    if(patient.getId() != null) {    hui= messagesService.selectByPrimaryKey(patient.getId());    Messages xin = new Messages();    xin.setDid(hui.getDid());    xin.setType(1);    xin.setTime(shijian);    List<Messages> selectMessagesPai = messagesService.selectMessagesPai(xin);    hui.setAge(selectMessagesPai.size());        }     return "redirect:/api/doctorList1";    }                    @RequestMapping(value = "/messagesQuXiao")    public  String  messagesQuXiao(Integer id) throws ParseException {    Messages ma  = new  Messages();    ma.setId(id);    ma.setType(2); //取消预约    messagesService.updateByPrimaryKeySelective(ma);    Messages mes = messagesService.selectByPrimaryKey(id);    Messages messages  =  new  Messages();    messages.setType(1);    messages.setUid(mes.getUid());    messages.setTime(new Date());    List<Messages>  list  = messagesService.selectMessages(messages);    return "redirect:/api/patientList2";    }            @RequestMapping(value = "/messagesUidList")    @ResponseBody    public  List<Messages>  messagesUidList(@RequestBody Messages message) throws ParseException {    List<Messages>  list = null;    if(message.getType() != null && message.getType() == 1) {    message.setTime(new Date());        list  = messagesService.selectMessagesPai(message);    }else {      list  = messagesService.selectMessagesTWO(message);      }      Messages me  = new  Messages();      me.setType(1);      me.setTime(new Date());  for (int i = 0; i < list.size(); i++) {  me.setDid(list.get(i).getDid());  List<Messages> lin = messagesService.selectMessagesPai(me);  list.get(i).setAge(lin.size());             }    return  list;    }        @RequestMapping(value = "/messagesList")    @ResponseBody    public  List<Messages>  messagesList(@RequestParam("type")Integer type,@RequestParam("uid")Integer uid) throws ParseException {    Messages message = new Messages();    List<Messages>  list = null;    message.setType(type);    message.setUid(uid);    if(type != null && type == 1) {      message.setTime(new Date());      list  = messagesService.selectMessagesPai(message);        Messages me  = new  Messages();          me.setType(1);          me.setTime(new Date());      for (int i = 0; i < list.size(); i++) {      me.setDid(list.get(i).getDid());      List<Messages> lin = messagesService.selectMessagesPai(me);       list.get(i).setAge(lin.size());           }    }else {      list  = messagesService.selectMessagesTWO(message);      }                  return  list;    }            @RequestMapping(value = "/messagesLists")    @ResponseBody    public  List<Messages>  messagesLists(Integer uid) throws ParseException {    Messages message = new Messages();    message.setUid(uid);    List<Messages>  list  = messagesService.selectMessagesTWO(message);      Messages me  = new  Messages();      me.setType(1);      me.setTime(new Date());  for (int i = 0; i < list.size(); i++) {  if(list.get(i).getType() == 1) {   me.setDid(list.get(i).getDid());   List<Messages> lin = messagesService.selectMessagesPai(me);   list.get(i).setAge(lin.size());   }           }    return  list;    }                        @RequestMapping(value = "/doctortouList")    @ResponseBody    public  List<Doctor>  doctortouList() {      PageInfo<Doctor> pageInfo  =  doctorService.selectDoctorList(null,1,4);    return   pageInfo.getList();    }                @RequestMapping(value = "/datatimeGua")    @ResponseBody    public  Integer  datatimeGua(@RequestParam("datetime")String datetime,@RequestParam("did")Integer did) throws ParseException {        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");        Date parse = sdf.parse(datetime);        Messages message = new Messages();    message.setTime(parse);    message.setDid(did);    message.setType(-1);    List<Messages>  list  = messagesService.selectMessages(message);    return  list.size();    }    }

登录控制层:

@Controller@RequestMapping("/login")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("/afterView")    public String afterLogin(Integer type,Model model) {        if(type == null) {            type = 1;        }        model.addAttribute("type",type);        return "login";    }         @RequestMapping("/index")   public String index(Integer type,Model model) {       if(type == null){           type = 1;       }       model.addAttribute("type",type);       return "login";   }      @RequestMapping("/font/index")  public String fontIndex(Integer type,Model model) {      if(type == null){          type = 3;      }      model.addAttribute("type",type);      return "loginByPatient";  }       @RequestMapping(value ="/zixunAdd")   @ResponseBody   public  Map<String, Object>  zixunAdd(@RequestParam("mf")MultipartFile mufile,@RequestParam("id")Integer  id) throws IOException{       Map<String, Object> map =  new HashMap<String, Object>();       String random   =  StringRandom.getRandom();       String filename =  mufile.getOriginalFilename();       //随机字符+原图片名用作新的图片名       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);       doctor.setImg("/files/"+filename);       doctorService.updateByPrimaryKeySelective(doctor);       }else {           //添加图片路径       doctor.setImg("/files/"+filename);       doctorService.insertSelective(doctor);           System.out.println("id:"+doctor.getId());           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;    }              @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("/panzhanghao")    @ResponseBody    public Map<String,String> panzhanghao(Model model, String zhanghao) {            Map<String, String> map =  new HashMap<String, String>();        DoctorExample se  = new  DoctorExample();    DoctorExample.Criteria criteria = se.createCriteria();    criteria.andUsernameEqualTo(zhanghao);            List<Doctor> selectByExample = doctorService.selectByExample(se);            if(selectByExample.size() > 0){                map.put("pan","err");            }else{                map.put("pan","ok");            }           return    map;    }             @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";   }            @RequestMapping("/mimaPageUptate")    public String  mimaPageUptate(Integer type,Model model) {    //1医生  2 管理员    if(type == 1 ) {      return "doctorRegister";    }    return "adminRegister";    }            @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();    section.setPid(sectionlist.get(0).getId());    section.setType(2);    sectionlist2 = sectionService.selectByExample(section);        }     model.addAttribute("sectionlist", sectionlist);     model.addAttribute("sectionlist2", sectionlist2);    return "doctorRegister";    }                   @RequestMapping("/admin_Register")   public String admin_Register(Admin admin,Model model) {   int insertSelective = adminService.insertSelective(admin);   model.addAttribute("type",2);       return "login";   }                      @RequestMapping("/verificatio")    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);         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));        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";    }         }

医生端:

@Controller@RequestMapping("/doctor")public class DoctorController {     @Autowired     private AdminService adminService;      @Autowired     private DoctorService doctorService;          @Autowired     private SectionService sectionService;          @Autowired     private  PatientService  patientService;               @Autowired     private   MessagesService  messagesService;               private Integer size  = 8;//每页显示数量                          @RequestMapping("/tiaomessagelist")     public String tiaomessagelist(@RequestBody  List<Messages> mlist,Model model) {      System.out.println(mlist.size());              model.addAttribute("mlist",mlist);         return    "doctor/messageList";     }                    @RequestMapping("/index")     public String index(Model model,HttpServletRequest request) {      HttpSession session = request.getSession();          Doctor dt = (Doctor) session.getAttribute("DOCTOR");          if(dt == null) {          return  "redirect:/login/index";            }         int  doctor  = doctorService.countByExample(null); //医生总数         int  section = sectionService.count(); //科室总数         //患者总数         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);          if(pageInfo.getList() != null && pageInfo.getList().size() >0 ) {            List<Doctor> list = pageInfo.getList();            StringBuffer sb = new StringBuffer();            StringBuffer shu = new StringBuffer();            int v = list.size()-1;            for(int i=0;i<list.size();i++) {         if(v==i) {         sb.append(list.get(i).getName());         shu.append(list.get(i).getYipeoples());        }else {         sb.append(list.get(i).getName()+",");         shu.append(list.get(i).getYipeoples()+",");        }         }           model.addAttribute("name",sb.toString());               model.addAttribute("nu",shu.toString());          }         return  "doctor/index";     }                   @RequestMapping("/doctorUptatePage")     public String doctorUptatePage(Model model,HttpServletRequest request) {         HttpSession session = request.getSession();         Doctor dt = (Doctor) session.getAttribute("DOCTOR");         if(dt != null) {         Doctor  doctor = doctorService.selectByPrimaryKey(dt.getId()); List<Section> sectionlist2  = null; 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";     }                         @RequestMapping("/messageTime")     public String messageTime(String name,Model model,HttpServletRequest request) {   HttpSession session = request.getSession();        Doctor dt = (Doctor) session.getAttribute("DOCTOR");        if(name !=  null) {        Messages  mess  = new Messages();        mess.setDid(dt.getId());      mess.setUsername(name);         List<Messages> selectMessages = messagesService.selectMessagesTWO(mess);         model.addAttribute("messagesList", selectMessages);        }         return  "doctor/messageTime";     }                    @RequestMapping("/admindoctorUptate")     public String adminUptatePassword(Doctor doctor,Model model) {        if(doctor !=  null && doctor.getId() != null) {        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";     }                    @RequestMapping("/messageList")     public String doctorList(Model model,  Messages messages, @RequestParam(value="page",defaultValue="1")Integer page,Integer type,HttpServletRequest request) {     if(messages == null) {     messages = new Messages();     }         HttpSession session = request.getSession();         Doctor dt = (Doctor) session.getAttribute("DOCTOR");         if(dt != null){         messages.setDid(dt.getId());         }else{          return  "redirect:/login/index";         }          messages.setType(type);     //底层数据     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";     }                   @RequestMapping(value = "/messageAjax")    @ResponseBody    public  List<Messages>  doctorList(HttpServletRequest request) {     Messagesmessages = new Messages();         HttpSession session = request.getSession();         Doctor dt = (Doctor) session.getAttribute("DOCTOR");         messages.setDid(dt.getId());            messages.setType(1);     messages.setTime(new Date());    PageInfo<Messages> pageInfo2 = messagesService.selectMessagesListDemo(messages,1,99);              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++) {    list.get(i).setPai(i+1);    messagesService.updateByPrimaryKeySelective(list.get(i));}        }              return "ok";    }                       @RequestMapping("/patientList")     public String messageList(Model model, Patient patient, @RequestParam(value="page",defaultValue="1")Integer page,HttpServletRequest request) {     if(patient == null) {     patient = new Patient();     }        HttpSession session = request.getSession();         Doctor dt = (Doctor) session.getAttribute("DOCTOR");         if(dt == null){          return  "redirect:/login/index";         }         Messages messages = new Messages();//         messages.setTime(new Date());         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";     }             @RequestMapping(value = "/tiaozhuanList")    @ResponseBody    public  String  messagesList(@RequestParam("xiao")Integer xiao,@RequestParam("da")Integer da)  {    Messages message = new Messages();    if(xiao != null & da != null) {    Messages mexiao = messagesService.selectByPrimaryKey(xiao);    Integer px = mexiao.getPai();    Messages meda = messagesService.selectByPrimaryKey(da);    mexiao.setPai(meda.getPai());    meda.setPai(px);    messagesService.updateByPrimaryKeySelective(mexiao);    messagesService.updateByPrimaryKeySelective(meda);      }      return  null;    }            @RequestMapping("/messagesUptate")     public String messagesUptate(Integer id) {        if(id != null) {        Messages messages = new Messages();        messages.setId(id);        messages.setType(3); //3表示预约成功        messagesService.updateByPrimaryKeySelective(messages);        }         return  "redirect:/doctor/messageList?type=1";     }               @RequestMapping("/messagesQuXiao")     public String messagesQuXiao(Integer id) {        if(id != null) {        Messages messages = new Messages();        messages.setId(id);        messages.setType(2); //2取消预约        messagesService.updateByPrimaryKeySelective(messages);        }         return  "redirect:/doctor/messageList?type=1";     }                    @RequestMapping("/messagesTui")     public String messagesTui(Integer id) {        if(id != null) {        Messages messages = new Messages();        messages.setId(id);        messages.setType(4); //4退号失败        messagesService.updateByPrimaryKeySelective(messages);        }         return  "redirect:/doctor/messageList?type=3";     }          }

到此,相信大家对“Java怎么实现宠物医院与商城一体的系统”有了更深的了解,不妨来实际操作一番吧!这里是编程网网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!

--结束END--

本文标题: Java怎么实现宠物医院与商城一体的系统

本文链接: https://www.lsjlt.com/news/321928.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • Java怎么实现宠物医院与商城一体的系统
    本篇内容主要讲解“Java怎么实现宠物医院与商城一体的系统”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“Java怎么实现宠物医院与商城一体的系统”吧!项目运行:环境配置:Jdk1.8 + Tom...
    99+
    2023-06-29
  • Java毕业设计实战之宠物医院与商城一体的系统的实现
    项目运行: 环境配置: Jdk1.8 + Tomcat8.5 + mysql + Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持) 项目...
    99+
    2024-04-02
  • Java如何实现宠物医院预约挂号系统
    这篇文章主要为大家展示了“Java如何实现宠物医院预约挂号系统”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“Java如何实现宠物医院预约挂号系统”这篇文章吧。一、项目简述功能包括:用户分为宠物,...
    99+
    2023-06-22
  • Java实战宠物医院预约挂号系统的实现流程
    一、项目简述 功能包括: 用户分为宠物,医生,管理员,宠物主人可进行注册选择医生挂号,选择日期,选择号源,医生可进行宠物接诊,管理员可对宠物,医生信息的维护等等功能。 二、项目运行 ...
    99+
    2024-04-02
  • Springboot实例讲解实现宠物医院管理系统流程
    项目编号:BS-XX-098 本系统前台面向的用户是客户,客户可以进行预约、浏览医院发布的文章、进入医院商城为宠物购物、如有疑问可以向官方留言、还可以查看关于自己的所有记录信息,如:...
    99+
    2024-04-02
  • 基于Java+Springboot+Vue+elememt宠物用品商城系统设计实现
    博主介绍:✌全网粉丝30W+,csdn特邀作者、博客专家、CSDN新星计划导师、java领域优质创作者,博客之星、掘金/华为云/阿里云/InfoQ等平台优质作者、专注于Java技术领域和毕业项目实战✌ 🍅文末获取联系&...
    99+
    2023-09-18
    spring boot java 宠物商城系统 前后端分离 Java+vue项目实战
  • Java毕业设计实战项目之宠物商城系统的实现流程
    一、项目运行 环境配置: Jdk1.8 + Tomcat8.5 + Mysql + HBuilderX(Webstorm也行)+ Eclispe(IntelliJ IDEA,Ecli...
    99+
    2024-04-02
  • Java 实战交易平台项目之宠物在线商城系统
    该系统分为前台和后台,前台可以自主注册,后台管理员角色,除基础脚手架外,实现的功能有: 后台管理员功能有:商品分类管理、商品管理、套餐管理、新闻分类管理、新闻管理、常见问题、关于我...
    99+
    2024-04-02
  • 基于Java web的购物商城系统设计与实现
    目 录 1 绪 论 1 1.1 本课题研究的背景和意义 1 1.1.1 本课题研究的背景 1 1.1.2 本课题研究的意义 2 1.1.3 本课题的发展现状及前景 2 1.2 系统的实现任务 7 2 ...
    99+
    2023-10-08
    java 前端 开发语言
  • Java实战之医院管理系统的实现
    目录项目介绍环境需要技术栈使用说明效果图展示核心代码用户管理控制层医生管理控制层病房管理控制层项目介绍 医院管理系统,分为管理员、医生、病人三种角色; 管理员主要功能包括: 首页、系...
    99+
    2024-04-02
  • 网上商城购物系统设计与实现(Java+Web+SSM+MySQL)
    目 录 1 绪论 1 1.1 研究背景 1 1.2 目的和意义 1 1.3 开发工具及技术 1 2 需求分析 3 2.1 功能需求分析 3 2.1.1 网站前台功能 3 2.1.2 网站后台功能 3 ...
    99+
    2023-08-31
    java mysql SSM 购物商城系统 毕业设计
  • 怎么用java多态实现电子宠物系统
    今天小编给大家分享一下怎么用java多态实现电子宠物系统的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。效果实现:代码实现:主...
    99+
    2023-06-29
  • 基于Java(SpringBoot框架)毕业设计作品成品(23)在线网上宠物商城系统设计与实现
    博主介绍:《Vue.js入门与商城开发实战》《微信小程序商城开发》图书作者,CSDN博客专家,在线教育专家,CSDN钻石讲师;专注大学生毕业设计教育和辅导。 所有项目都配有从入门到精通的基础知识视频课程,免费 项目配有对应开发文档、开题...
    99+
    2023-10-22
    宠物 宠物商城毕业设计 python毕业设计 django框架 大学生 大四
  • HTML5 WebGL怎么实现的医疗物流系统
    小编给大家分享一下HTML5 WebGL怎么实现的医疗物流系统,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!前言物联网( IoT ),简单的理解就是物体之间通过互...
    99+
    2023-06-09
  • Java+Swing实现医院管理系统的完整代码
    目录一、系统介绍二、系统展示三、系统实现一、系统介绍 本系统实现的以下功能 管理员功能:登录系统、病人信息的增删改查、就医档案的录入、医生信息的增删改查、科室信息的增删改查、收费统计...
    99+
    2024-04-02
  • 鲜花商城系统设计与实现(Java+Web+MySQL)
    目 录 摘 要 I Abstract II 1 绪论 1 1.1 现状分析 1 1.2 研究意义 1 1.3 研究方法 1 2 系统的开发环境及技术简介 3 2.1 系统开发环境简介 3 2.2 系统...
    99+
    2023-09-16
    java mysql Web 鲜花商城 毕业设计
  • Java文创商城系统的实现流程
    一、项目简述 功能:本系统分用户前台和管理员后台。 前台展示+后台管理,前台界面可实现用户登录,用户注 册,商品展示,商品明细展示,用户信息修改,密码修 改,购物车添加,商品购买,商...
    99+
    2024-04-02
  • Java女装商城系统的实现流程
    一、项目简述功能 javaweb 网上商城系统,前台+后台管理,用户注册,登录,上哦展示,分组展示,搜索,收货地址管理,购物车管理,添加,购买,个人信息修改。订单查询等等,后台商品管...
    99+
    2024-04-02
  • Java实战之鲜花商城系统的实现
    目录项目介绍环境需要技术栈使用说明效果图展示核心代码商品管理控制层订单管理控制层用户管理控制层项目介绍 该项目为前后台项目,分为普通用户与管理员两种角色,前台普通用户登录,后台管理员...
    99+
    2024-04-02
  • jQuery怎么实现简易商城系统
    本篇内容主要讲解“jQuery怎么实现简易商城系统”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“jQuery怎么实现简易商城系统”吧!一.效果图二.body<body> &...
    99+
    2023-07-02
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作