基于javaweb+mysql的springboot宠物医院与商城一体的系统(java+springboot+jsp+maven+mysql)
运行环境
Java≥8、MySQL≥5.7
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb+mysql的SpringBoot宠物医院与商城一体的系统(java+springboot+jsp+maven+mysql)
项目运行
环境配置:
Jdk1.8 + Tomcat8.5 + mysql + Eclispe(IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持)
项目技术:
Springboot+ SpringMVC + MyBatis + Jsp + Html+ JavaScript + JQuery + Ajax + maven等等
宠物医院与商城一体的系统
@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);
/**
*添加患者信息
*/
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("/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";
/**
* 取消
*/
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("/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")
System.out.println(substring);
}*/
/**
* 医生图片上传
* @param mufile
* @param id
* @return
* @throws IOException
*/
@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>();
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;
/**
*预约信息列表
* @throws ParseException
*/
@RequestMapping(value = "/messagesList")
@ResponseBody
public List<Messages> messagesList(@RequestParam("type")Integer type,@RequestParam("uid")Integer uid) throws ParseException {
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);
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;
*//*
@RequestMapping("/afterView")
public String afterLogin(Integer type,Model model) {
if(type == null){
type = 1;
model.addAttribute("type",type);
return "behind/login";
*//**
* 登陆验证
* @return
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();
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
*/
@RequestMapping("/doctorTimePage")
public String doctorTimePage(Integer id,Model model) {
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";
/**
*登录验证
* @throws ParseException
*/
*科室查询
*/
@RequestMapping(value = "/doctorIdList")
@ResponseBody
public Section doctorIdList(Integer sid) {
Section selectByPrimaryKey = sectionService.selectByPrimaryKey(sid);
return selectByPrimaryKey;
/**
*医生列表查询
* @throws ParseException
*/
@RequestMapping(value = "/doctortimeSelect")
@ResponseBody
*/
@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")
if(adminlist.size() <= 0){
model.addAttribute("message","密码错误");
model.addAttribute("type",type);
return "login";
session.setAttribute("ADMIN",adminlist.get(0));
return "redirect:/admin/index";
/**
* 退出登录
* @param request
* @return
*/
patientService.updateByPrimaryKeySelective(patient);
return null;
/**
*预约信息
* @throws ParseException
*/
@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");
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();
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);
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 {
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();
登录控制层:
/**
* 登录控制层
*/
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);
type=1;
if(type == 3){
model.addAttribute("type",type);
session.invalidate(); //session销毁
return "loginByPatient";
model.addAttribute("type",type);
session.invalidate(); //session销毁
return "login";
/*
*//**
* 跳转忘记密码界面
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";
/**
*预约信息列表
* @throws ParseException
*/
@RequestMapping(value = "/messagesUidList")
*/
@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("/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";
/*
* PageInfo<Patient> pageInfo =