基于javaweb的SpringBoot宠物医院管理系统设计和实现(java+springboot+ssm+mysql+thymeleaf+html+maven)

运行环境

Java≥8、MySQL≥5.7

开发工具

eclipse/idea/myeclipse/sts等均可配置运行

适用

课程设计,大作业,毕业设计,项目练习,学习演示等

功能说明

030023202402

040023202402

050023202402

060023202402

基于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等等

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45


@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);
}
return map;
}

/**
* 将图片存在对应文件中 宠物
*/
@RequestMapping("uploadAdministrator")
public Map uploadAdministrator(@RequestParam MultipartFile file, String Forest_VetDoctor_ID, HttpServletRequest request) {
Map map = new HashMap();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

@RestController
public class Forest_userCongtroller {
//map存储数据
private Map<String, Object> map = new HashMap<>();
//数据页数和起始值
private int count, num;
//service层的映射
@Autowired
Forest_userService forest_userService;
//全局访问类
private Forest_variable Forest_variable = new Forest_variable();
//存储数据
private List<Forest_userEntity> list;
//登录
@PostMapping("/login")
public Map<String,Object> login(@RequestBody Forest_userEntity forest_userEntity, HttpSession session){
//用户登录
forest_userEntity.setForest_User_Grade(1);
forest_userEntity.setForest_User_State(1);
list=forest_userService.ForestUserEntityLogin(forest_userEntity);
if(list.size()==0){
map.put("code",500);
return map;
}
forest_userEntity.setForest_User_ID(list.get(0).getForest_User_ID());
//使用全局变量存储 将编号 和 登录名存储到session中
session.setAttribute("num", 1);
Forest_variable.variableName(session, forest_userEntity);
map.put("code",200);
return map;
}
//管理登录
@PostMapping("/UserLogin")
public Map<String,Object> UserLogin(@RequestBody Forest_userEntity forest_userEntity, HttpSession session){
//用户登录
forest_userEntity.setForest_User_Grade(2);
forest_userEntity.setForest_User_State(1);
list=forest_userService.ForestUserEntityLogin(forest_userEntity);
if(list.size()==0){
map.put("code",500);
return map;
}
forest_userEntity.setForest_User_ID(list.get(0).getForest_User_ID());
//使用全局变量存储 将编号 和 登录名存储到session中
session.setAttribute("num", 2);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
    }
}
package com.forest.demo.Controller;



@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();
//存储起始值
model.setNum(ss);
}
//查询的起始页
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
        int ss = model.getNum() * model.getSize();
//存储起始值
model.setNum(ss);
}
//查询的起始页
List<Forest_VetDoctorEntity> list = forest_vetDoctorService.ForestVetDoctorEntitySearch(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 count1(Forest_VetDoctorEntity model) {
//查询的统计数据
count = forest_vetDoctorService.ForestVetDoctorEntitySearchRow(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("/Forest_VetDoctorEntityDetails")
public Map<String, Object> Forest_VetDoctorEntityDetails(@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.Forest_VetDoctorEntityDetails(model);
//存储的数据
map.put("doctor", list);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

@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);
}
//查询的起始页
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36


public int sessionID(HttpServletRequest request) {
HttpSession session = request.getSession();
Object userId = session.getAttribute("userId");
System.out.println(userId);
int u= (int) userId;
return u;
}
/**
* 如果500表示没有名字
* 如果200表示有名字
* @param request
* @return
*/
@Override
public int variableYeZhuNameSession(HttpServletRequest request) {
HttpSession session = request.getSession();
String name = (String) session.getAttribute("username");
if(name==null)
{
return 500;
}
return 200;
}

public String variableYeZhuName(HttpServletRequest request) {
HttpSession session = request.getSession();
String name = (String) session.getAttribute("username");
return name;
}

}
package com.forest.demo.Controller;



项目链接:
https://javayms.github.io?id=251422312105200ie
https://javayms.pages.dev?id=251422312105200ie