项目运行
环境配置:
Jdk1.8 + Tomcat8.5 + mysql + Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)
项目技术:
Springboot+ SpringMVC + MyBatis + Jsp + Html+ JavaScript + JQuery + Ajax + maven等等
宠物医院与商城一体的系统
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
@RequestMapping("/admin_Register")
public String admin_Register(Admin admin,Model model) {
int insertSelective = adminService.insertSelective(admin);
model.addAttribute("type",2);
return "login";
}
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 pageInfo = messagesService.selectMessagesList(messages,page,size);
//工作区数据
messages.setTime(new Date());
List list = messagesService.selectMessagesPai(messages);
model.addAttribute("mlist",list);
model.addAttribute("messagesList",pageInfo.getList());
model.addAttribute("pageInfo",pageInfo);
model.addAttribute("messages",messages);
} } ListselectByExample = patientService.selectByExample(se); if(selectByExample.size() >0 ) { List lmlist = messagesService.selectByExample(null); int j = 0 ; for (Messages me : lmlist) { if(me.getUid() == id) { return j; } j++; } } return -1;
public String doctorList(Model model, Doctor doctor, @RequestParam(value="page",defaultValue="1")Integer page) {
if(doctor == null) {
doctor = new Doctor();
}
PageInfo pageInfo = doctorService.selectDoctorList(doctor,page,size);
List list = pageInfo.getList();
model.addAttribute("doctorList",pageInfo.getList());
model.addAttribute("pageInfo",pageInfo);
model.addAttribute("doctor",doctor);
return "patient/doctorList";
}
@RequestMapping(value = "/userLogin")
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);
Doctor doctor = new Doctor(); doctor.setUsername(username); doctor.setPasswoed(password); Listdoctorlist = 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 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";
private Integer size = 8;//每页显示数量
@RequestMapping("/tiaomessagelist")
public String tiaomessagelist(@RequestBody List mlist,Model model) {
System.out.println(mlist.size());
model.addAttribute("mlist",mlist);
return "doctor/messageList";
}
@RequestMapping("/index")
public String index(Model model,HttpServletRequest request) {
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";
}
@RequestMapping(value = "/doctorGeRenList")
@ResponseBody
public Doctor doctorGeRenList(Integer id) throws ParseException {
Doctor doctor = doctorService.selectByPrimaryKey(id);
return doctor;
}
@RequestMapping(value = "/doctorYuyueTime")
@ResponseBody
public Map doctorYuyueTime(Integer id) {
Map map = new HashMap();
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 = "/patientUpatePage")
@ResponseBody
public Patient patientUpatePage(Integer id) {
Patient patient = null;
if(id != null) {
patient = patientService.selectByPrimaryKey(id);
Doctor doctor = doctorService.selectByPrimaryKey(id);
model.addAttribute("doctor",doctor);
}
return "patient/doctorTime";
}
@RequestMapping(value = "/doctorList")
@ResponseBody
public List doctorList(Integer sid) {
Doctor doctor = new Doctor();
doctor.setSid(sid);
List selectDoctor = doctorService.selectDoctor(doctor);
return selectDoctor;



