基于javaweb+mysql的springboot宠物医院管理系统设计和实现(java+springboot+ssm+mysql+thymeleaf+html+maven)
私信源码获取及调试交流
运行环境
Java≥8、MySQL≥5.7
开发工具
eclipse/idea/myeclipse/sts等均可配置运行
适用
课程设计,大作业,毕业设计,项目练习,学习演示等
功能说明
基于javaweb的SpringBoot宠物医院管理系统设计和实现(java+springboot+ssm+mysql+thymeleaf+html+maven)
一、项目简述
功能描叙: 医生信息,客户信息,宠物管理,浏览管理,诊断管理, 医生管理,用户管理等等模块。
二、项目运行
环境配置: Jdk1.8 + mysql + Eclispe (IntelliJ IDEA,Eclispe,MyEclispe,Sts 都支持)
项目技术: JSP +Springboot+ SpringMVC + MyBatis + ThymeLeaf + HTML+ JavaScript + JQuery + Ajax + maven等等
@RestController
public class Forest_fileUploadController {
Forest_PetsEntity forest_petsEntity = new Forest_PetsEntity();
Forest_VetDoctorEntity forest_vetDoctorEntity = new Forest_VetDoctorEntity();
@Autowired
Forest_PetsService forest_petsService;
@Autowired
Forest_VetDoctorService forest_vetDoctorService;
/**
* 将图片存在对应文件中 宠物
*/
@RequestMapping("upload")
public Map fileUpload(@RequestParam MultipartFile file, String Forest_Pets_ID, HttpServletRequest request) {
Map map = new HashMap();
boolean rs = false;
if (!file.isEmpty()) {
String fileName = System.currentTimeMillis() + file.getOriginalFilename();
forest_petsEntity.setForest_Pets_ID(Integer.parseInt(Forest_Pets_ID));
forest_petsEntity.setForest_Pets_Photo(fileName);
forest_petsService.ForestPetsEntityUpdate(forest_petsEntity);
String savePath = WebMvcConfig.uploadImagePath;
File dest = new File(savePath + File.separator + fileName);
try {
file.transferTo(dest);
rs = true;
map.put("result", rs);
} catch (IOException e) {
e.printStackTrace();
map.put("result", rs);
}
} else if (file.isEmpty()) {
map.put("result", rs);
}
model.setNum(ss);
}
//查询的起始页
List<Forest_VetDoctorEntity> list = forest_vetDoctorService.ForestVetDoctorEntitySelect1(model);
//存储xiaoc的登录名
map.put("name", new Forest_variable().sessionName(request));
//存储的数据
map.put("doctor", list);
//存储页数1
map.put("num", num);
//状态码 200
map.put("code", 200);
return map;
}
/**
* 求出统计的数据
*/
public int count2(Forest_VetDoctorEntity model) {
//查询的统计数据
count = forest_vetDoctorService.ForestVetDoctorEntityRow1();
//判断求出页数
if (count % model.getSize() == 0) {
num = count / model.getSize();
} else {
num = count / model.getSize() + 1;
}
//如果信息大于8页 只显示8页
if (num >= 8) {
return 8;
}
return num;
}
//搜索数据
@RequestMapping("/ForestVetDoctorEntitySearch1")
public Map<String, Object> ForestVetDoctorEntitySearch1(@RequestBody Forest_VetDoctorEntity model, HttpServletRequest request) {
//求出统计的数据
num = count11(model);
//判断是否登录
if (new Forest_variable().variableNameSession(request) == 500) {
map.put("code", 500);
public Map<String,Object> ForestUserEntityIfExitCard(@RequestBody Forest_userEntity forest_userEntity){
list=forest_userService.ForestUserEntityIfExitCard(forest_userEntity);
if(list.size()==0){
map.put("code",200);
return map;
}
map.put("code",500);
return map;
}
@PostMapping("/ForestUserEntitySelect")
public Map<String, Object> insertSelective(@RequestBody Forest_userEntity model, HttpServletRequest request, HttpSession session) {
//求出统计的数据
num = count(model);
//判断是否登录
if (new Forest_variable().variableNameSession(request) == 500) {
map.put("code", 500);
return map;
}
String nums = String.valueOf(session.getAttribute("num"));
int tt = Integer.parseInt(nums);
if (tt != 2 ) {
map.put("code", 500);
return map;
}
//判断是否是首页
if (model.getNum() != 0) {
//若不是首页,则获取起始值
int ss = model.getNum() * model.getSize();
//存储起始值
model.setNum(ss);
}
//查询的起始页
List<Forest_userEntity> list = forest_userService.ForestUserEntitySelect(model);
//存储xiaoc的登录名
map.put("name", new Forest_variable().sessionName(request));
//存储的数据
map.put("user", list);
//存储页数
map.put("num", num);
//状态码 200
map.put("code", 200);
}
//新增数据
@PostMapping("/ForestVetDoctorEntityRegister")
public Map<String,Object> ForestVetDoctorEntityRegister(@RequestBody Forest_VetDoctorEntity forest_vetDoctorEntity){
//设置时间的格式
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//获取时间的方法
Date d = new Date();
//将获取的时间转换成设置的时间格式进行存储
forest_vetDoctorEntity.setForest_VetDoctor_Time(sf.format(d));
forest_vetDoctorEntity.setForest_VetDoctor_Detail("生活上:活泼开朗、乐观上进、待人热情,可以和老师、同学友好相处。\n" +
"学习上:能吃苦耐劳,用于承受压力,勇于创新。\n" +
"工作上:担任项目助理一职,对待工作认真负责,善于沟通、喜欢积极地去帮助同学,有较强的抗压能力");
int register=forest_vetDoctorService.ForestVetDoctorEntityRegister(forest_vetDoctorEntity);
if(register==1){
map.put("code",200);
return map;
}
map.put("code",500);
return map;
}
//编号详情
@PostMapping("/ForestVetDoctorEntityID")
public Map<String, Object> ForestVetDoctorEntityID(@RequestBody Forest_VetDoctorEntity model, HttpServletRequest request) {
//判断是否登录
if (new Forest_variable().variableNameSession(request) == 500) {
map.put("code", 500);
return map;
}
List<Forest_VetDoctorEntity> list = forest_vetDoctorService.ForestVetDoctorEntityID(model);
//存储的数据
map.put("doctor", list);
//状态码 200
map.put("code", 200);
return map;
}
//更改数据
@PostMapping("/ForestVetDoctorEntityUpdateAll")
public Map<String, Object> ForestVetDoctorEntityUpdateAll(@RequestBody Forest_VetDoctorEntity model) {
//设置时间的格式
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//获取时间的方法
return num;
}
//搜索数据
@PostMapping("/ForestPetsEntitySearch")
public Map<String, Object> ForestPetsEntitySearch(@RequestBody Forest_PetsEntity model, HttpServletRequest request) {
//求出统计的数据
num = count1(model);
//判断是否登录
if (new Forest_variable().variableNameSession(request) == 500) {
map.put("code", 500);
return map;
}
//判断是否是首页
if (model.getNum() != 0) {
//若不是首页,则获取起始值
int ss = model.getNum() * model.getSize();
//存储起始值
model.setNum(ss);
}
//查询的起始页
List<Forest_PetsEntity> list = forest_PetsService.ForestPetsEntitySearch(model);
//存储xiaoc的登录名
map.put("name", new Forest_variable().sessionName(request));
//存储的数据
map.put("Pets", list);
//存储页数
map.put("num", num);
//状态码 200
map.put("code", 200);
return map;
}
/**
* 求出统计的数据
*/
public int count1(Forest_PetsEntity model) {
//查询的统计数据
count = forest_PetsService.ForestPetsEntitySearchRow(model);
//判断求出页数
if (count % model.getSize() == 0) {
num = count / model.getSize();
Forest_PetsService forest_petsService;
@Autowired
Forest_VetDoctorService forest_vetDoctorService;
/**
* 将图片存在对应文件中 宠物
*/
@RequestMapping("upload")
public Map fileUpload(@RequestParam MultipartFile file, String Forest_Pets_ID, HttpServletRequest request) {
Map map = new HashMap();
boolean rs = false;
if (!file.isEmpty()) {
String fileName = System.currentTimeMillis() + file.getOriginalFilename();
forest_petsEntity.setForest_Pets_ID(Integer.parseInt(Forest_Pets_ID));
forest_petsEntity.setForest_Pets_Photo(fileName);
forest_petsService.ForestPetsEntityUpdate(forest_petsEntity);
String savePath = WebMvcConfig.uploadImagePath;
File dest = new File(savePath + File.separator + fileName);
try {
file.transferTo(dest);
rs = true;
map.put("result", rs);
} catch (IOException e) {
e.printStackTrace();
map.put("result", rs);
}
} else if (file.isEmpty()) {
map.put("result", rs);
}
return map;
}
/**
* 将图片存在对应文件中 宠物
*/
@RequestMapping("uploadAdministrator")
public Map uploadAdministrator(@RequestParam MultipartFile file, String Forest_VetDoctor_ID, HttpServletRequest request) {
Map map = new HashMap();
boolean rs = false;
if (!file.isEmpty()) {
String fileName = System.currentTimeMillis() + file.getOriginalFilename();
forest_vetDoctorEntity.setForest_VetDoctor_ID(Integer.parseInt(Forest_VetDoctor_ID));
forest_vetDoctorEntity.setForest_VetDoctor_Image(fileName);
//判断求出页数
if (count % model.getSize() == 0) {
num = count / model.getSize();
} else {
num = count / model.getSize() + 1;
}
//如果信息大于8页 只显示8页
if (num >= 8) {
return 8;
}
return num;
}
//新增数据
@PostMapping("/ForestUserPetsEntityAdd")
public Map<String,Object> ForestUserPetsEntityAdd(@RequestBody Forest_HistoryRecordEntity forest_customerEntity){
//设置时间的格式
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//获取时间的方法
Date d = new Date();
//将获取的时间转换成设置的时间格式进行存储
forest_customerEntity.setForest_User_Pets_Time(sf.format(d));
int register=forest_historyRecordService.ForestUserPetsEntityAdd(forest_customerEntity);
if(register==1){
map.put("code",200);
return map;
}
map.put("code",500);
return map;
}
}
@RestController
public class Forest_HistoryRecordController {
//使用map存储数据
private Map<String, Object> map = new HashMap<>();
//数据页数和起始值
private int count, num;
//映射
@Autowired
private Forest_HistoryRecordService forest_historyRecordService;
/**
* insertSelective
* 首次加载页面
*/
@PostMapping("/ForestUserPetsEntitySelect")
public Map<String, Object> ForestUserPetsEntitySelect(@RequestBody Forest_HistoryRecordEntity model, HttpServletRequest request) {
//求出统计的数据
num = count(model);
//判断是否登录
if (new Forest_variable().variableNameSession(request) == 500) {
map.put("code", 500);
return map;
}
//判断是否是首页
if (model.getNum() != 0) {
//若不是首页,则获取起始值
int ss = model.getNum() * model.getSize();
//存储起始值
@RestController
public class Forest_CustomerController {
//使用map存储数据
private Map<String, Object> map = new HashMap<>();
//数据页数和起始值
private int count, num;
//映射
@Autowired
private Forest_CustomerService forest_customerService;
@Autowired
private Forest_Customer_PetsService forest_customer_petsService;
/**
* insertSelective
* 首次加载页面
*/
@RequestMapping("/ForestCustomerEntitySelect")
public Map<String, Object> ForestCustomerEntitySelect(@RequestBody Forest_CustomerEntity model, HttpServletRequest request) {
//求出统计的数据
num = count(model);
//判断是否登录
if (new Forest_variable().variableNameSession(request) == 500) {
map.put("code", 500);
return map;
}
//判断是否是首页
if (model.getNum() != 0) {
//若不是首页,则获取起始值
int ss = model.getNum() * model.getSize();
//存储起始值
model.setNum(ss);
}
*/
public int count1(Forest_userEntity model) {
//查询的统计数据
count = forest_userService.ForestUserEntitySearchRow(model);
//判断求出页数
if (count % model.getSize() == 0) {
num = count / model.getSize();
} else {
num = count / model.getSize() + 1;
}
//如果信息大于8页 只显示8页
if (num >= 8) {
return 8;
}
return num;
}
@PostMapping("/ForestUserEntityState")
public Map<String, Object> ForestUserEntityState(@RequestBody Forest_userEntity model, HttpServletRequest request) {
//判断是否登录
if (new Forest_variable().variableNameSession(request) == 500) {
map.put("code", 500);
return map;
}
int list = forest_userService.ForestUserEntityState(model);
if(list==1){
map.put("code", 200);
return map;
}
//状态码 200
map.put("code", 400);
return map;
}
}
@PostMapping("/ForestPetsEntityRegister")
public Map<String,Object> ForestPetsEntityRegister(@RequestBody Forest_PetsEntity forest_PetsEntity){
//设置时间的格式
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//获取时间的方法
Date d = new Date();
//将获取的时间转换成设置的时间格式进行存储
forest_PetsEntity.setForest_Pets_Time(sf.format(d));
int register=forest_PetsService.ForestPetsEntityRegister(forest_PetsEntity);
forest_PetsEntity.setNum(0);
forest_PetsEntity.setSize(20);
List<Forest_PetsEntity> list = forest_PetsService.ForestPetsEntitySelect(forest_PetsEntity);
Forest_Customer_PetsEntity f=new Forest_Customer_PetsEntity();
f.setForest_Customer_ID(forest_PetsEntity.getForest_Customer_ID());
f.setForest_Pets_ID(list.get(0).getForest_Pets_ID());
f.setForest_Customer_Pets_Time(sf.format(d));
int forestRegister=forest_customer_petsService.ForestCustomerPetsEntityAdd(f);
if(register==1&&forestRegister==1){
map.put("code",200);
return map;
}
map.put("code",500);
return map;
}
//编号详情
@PostMapping("/ForestPetsEntityID")
public Map<String, Object> ForestPetsEntityID(@RequestBody Forest_PetsEntity model, HttpServletRequest request) {
//判断是否登录
if (new Forest_variable().variableNameSession(request) == 500) {
map.put("code", 500);
return map;
}
List<Forest_PetsEntity> list = forest_PetsService.ForestPetsEntityID(model);
//存储的数据
map.put("Pets", list);
//状态码 200
map.put("code", 200);
return map;
}
//更改数据
@PostMapping("/ForestPetsEntityUpdateAll")
public Map<String, Object> ForestPetsEntityUpdateAll(@RequestBody Forest_PetsEntity model) {
//设置时间的格式
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//获取时间的方法
Date d = new Date();
//将获取的时间转换成设置的时间格式进行存储
model.setForest_Pets_Time(sf.format(d));
}
//判断是否是首页
if (model.getNum() != 0) {
//若不是首页,则获取起始值
int ss = model.getNum() * model.getSize();
//存储起始值
model.setNum(ss);
}
//查询的起始页
List<Forest_HistoryRecordEntity> list = forest_historyRecordService.ForestUserPetsEntitySearch(model);
//存储xiaoc的登录名
map.put("name", new Forest_variable().sessionName(request));
//存储的数据
map.put("UserPet", list);
//存储页数
map.put("num", num);
//状态码 200
map.put("code", 200);
return map;
}
/**
* 求出统计的数据
*/
public int count1(Forest_HistoryRecordEntity model) {
//查询的统计数据
count = forest_historyRecordService.ForestUserPetsEntitySearchRow(model);
//判断求出页数
if (count % model.getSize() == 0) {
num = count / model.getSize();
} else {
num = count / model.getSize() + 1;
}
//如果信息大于8页 只显示8页
if (num >= 8) {
return 8;
}
return num;
}
//新增数据
@PostMapping("/ForestUserPetsEntityAdd")
public Map<String,Object> ForestUserPetsEntityAdd(@RequestBody Forest_HistoryRecordEntity forest_customerEntity){
//设置时间的格式
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//获取时间的方法
Date d = new Date();
//将获取的时间转换成设置的时间格式进行存储
forest_customerEntity.setForest_User_Pets_Time(sf.format(d));
map.put("code", 200);
return map;
}
/**
* 求出统计的数据
*/
public int count1(Forest_HistoryRecordEntity model) {
//查询的统计数据
count = forest_historyRecordService.ForestUserPetsEntitySearchRow(model);
//判断求出页数
if (count % model.getSize() == 0) {
num = count / model.getSize();
} else {
num = count / model.getSize() + 1;
}
//如果信息大于8页 只显示8页
if (num >= 8) {
return 8;
}
return num;
}
//新增数据
@PostMapping("/ForestUserPetsEntityAdd")
public Map<String,Object> ForestUserPetsEntityAdd(@RequestBody Forest_HistoryRecordEntity forest_customerEntity){
//设置时间的格式
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//获取时间的方法
Date d = new Date();
//将获取的时间转换成设置的时间格式进行存储
forest_customerEntity.setForest_User_Pets_Time(sf.format(d));
int register=forest_historyRecordService.ForestUserPetsEntityAdd(forest_customerEntity);
if(register==1){
map.put("code",200);
return map;
}
map.put("code",500);
return map;
}
}
* insertSelective
* 首次加载页面
*/
@PostMapping("/ForestPetsEntitySelect")
public Map<String, Object> ForestPetsEntitySelect(@RequestBody Forest_PetsEntity model, HttpServletRequest request) {
//求出统计的数据
num = count(model);
//判断是否登录
if (new Forest_variable().variableNameSession(request) == 500) {
map.put("code", 500);
return map;
}
//判断是否是首页
if (model.getNum() != 0) {
//若不是首页,则获取起始值
int ss = model.getNum() * model.getSize();
//存储起始值
model.setNum(ss);
}
//查询的起始页
List<Forest_PetsEntity> list = forest_PetsService.ForestPetsEntitySelect(model);
//存储xiaoc的登录名
map.put("name", new Forest_variable().sessionName(request));
//存储的数据
map.put("Pets", list);
//存储页数
map.put("num", num);
//状态码 200
map.put("code", 200);
return map;
}
/**
* 求出统计的数据
*/
public int count(Forest_PetsEntity model) {
//查询的统计数据
count = forest_PetsService.ForestPetsEntityRow();
//判断求出页数
if (count % model.getSize() == 0) {
num = count / model.getSize();
} else {
@RestController
public class Forest_DiagnosisController {
//使用map存储数据
private Map<String, Object> map = new HashMap<>();
//数据页数和起始值
private int count, num;
//映射
@Autowired
private Forest_DiagnosisService forest_diagnosisService;
@Autowired
private Forest_Customer_PetsService forest_customer_petsService;
/**
* insertSelective
* 首次加载页面
*/
@PostMapping("/ForestDiagnosisEntitySelect")
public Map<String, Object> ForestDiagnosisEntitySelect(@RequestBody Forest_DiagnosisEntity model, HttpServletRequest request) {
//求出统计的数据
num = count(model);
//判断是否登录
if (new Forest_variable().variableNameSession(request) == 500) {
map.put("code", 500);
return map;
}
//判断是否是首页
if (model.getNum() != 0) {
//若不是首页,则获取起始值
int ss = model.getNum() * model.getSize();
return map;
}
//判断是否是首页
if (model.getNum() != 0) {
//若不是首页,则获取起始值
int ss = model.getNum() * model.getSize();
//存储起始值
model.setNum(ss);
}
//查询的起始页
List<Forest_HistoryRecordEntity> list = forest_historyRecordService.ForestUserPetsEntitySearch(model);
//存储xiaoc的登录名
map.put("name", new Forest_variable().sessionName(request));
//存储的数据
map.put("UserPet", list);
//存储页数
map.put("num", num);
//状态码 200
map.put("code", 200);
return map;
}
/**
* 求出统计的数据
*/
public int count1(Forest_HistoryRecordEntity model) {
//查询的统计数据
count = forest_historyRecordService.ForestUserPetsEntitySearchRow(model);
//判断求出页数
if (count % model.getSize() == 0) {
num = count / model.getSize();
} else {
num = count / model.getSize() + 1;
}
//如果信息大于8页 只显示8页
if (num >= 8) {
return 8;
}
return num;
}
//新增数据
@PostMapping("/ForestUserPetsEntityAdd")
public Map<String,Object> ForestUserPetsEntityAdd(@RequestBody Forest_HistoryRecordEntity forest_customerEntity){
//设置时间的格式
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
//获取时间的方法
Date d = new Date();
//将获取的时间转换成设置的时间格式进行存储
forest_customerEntity.setForest_User_Pets_Time(sf.format(d));
int register=forest_historyRecordService.ForestUserPetsEntityAdd(forest_customerEntity);
if(register==1){
e.printStackTrace();
map.put("result", rs);
}
} else if (file.isEmpty()) {
map.put("result", rs);
}
return map;
}
/**
* 将图片存在对应文件中 宠物
*/
@RequestMapping("uploadAdministrator")
public Map uploadAdministrator(@RequestParam MultipartFile file, String Forest_VetDoctor_ID, HttpServletRequest request) {
Map map = new HashMap();
boolean rs = false;
if (!file.isEmpty()) {
String fileName = System.currentTimeMillis() + file.getOriginalFilename();
forest_vetDoctorEntity.setForest_VetDoctor_ID(Integer.parseInt(Forest_VetDoctor_ID));
forest_vetDoctorEntity.setForest_VetDoctor_Image(fileName);
forest_vetDoctorService.ForestVetDoctorEntityUpdate(forest_vetDoctorEntity);
String savePath = WebMvcConfig.uploadImagePath;
File dest = new File(savePath + File.separator + fileName);
try {
file.transferTo(dest);
rs = true;
map.put("result", rs);
} catch (IOException e) {
e.printStackTrace();
map.put("result", rs);
}
} else if (file.isEmpty()) {
map.put("result", rs);
}
return map;
}
}
//映射
@Autowired
private Forest_VetDoctorService forest_vetDoctorService;
/**
* insertSelective
* 首次加载页面
*/
@RequestMapping("/ForestVetDoctorEntitySelect")
public Map<String, Object> insertSelective(@RequestBody Forest_VetDoctorEntity model, HttpServletRequest request, HttpSession session) {
//求出统计的数据
num = count(model);
//判断是否登录
if (new Forest_variable().variableNameSession(request) == 500) {
map.put("code", 500);
return map;
}
String nums = String.valueOf(session.getAttribute("num"));
int tt = Integer.parseInt(nums);
if (tt != 2 ) {
map.put("code", 500);
return map;
}
//判断是否是首页
if (model.getNum() != 0) {
//若不是首页,则获取起始值
int ss = model.getNum() * model.getSize();
//存储起始值
model.setNum(ss);
}
//查询的起始页
List<Forest_VetDoctorEntity> list = forest_vetDoctorService.ForestVetDoctorEntitySelect(model);
//存储xiaoc的登录名
map.put("name", new Forest_variable().sessionName(request));
//存储的数据
map.put("doctor", list);
//存储页数
map.put("num", num);
//状态码 200
map.put("code", 200);
return map;
}
/**
* 求出统计的数据
*/
public int count(Forest_VetDoctorEntity model) {
//查询的统计数据