基于javaweb的SpringBoot+MyBatis宠物医院预约管理系统(管理员、医生、用户)(java+springboot+ssm+thymeleaf+html+layui+maven)

运行环境

Java≥8、MySQL≥5.7

开发工具

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

适用

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

功能说明

用户管理(管理员、医生、用户)、宠物管理、预约就诊、预约审核、日常健康管理、医院管理、统计分析等……

032124083108

130123222502

570123212502

580123212502

590123212502

000123222502

010123222502

020123222502

030123222502

040123222502

050123222502

060123222502

080123222502

090123222502

100123222502

110123222502

120123222502

技术框架

SpringBoot SpringMVC MyBatis Shiro Thymeleaf HTML JavaScript Layui……

基于javaweb的SpringBoot+MyBatis宠物医院预约管理系统(管理员、医生、用户)(java+springboot+ssm+thymeleaf+html+layui+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
46
47
48
49
50
51
 * Description: 跳转到页面设置页面 <BR>
*
* @param model
* @return String<BR>
*/
@RequestMapping("/page")
public String page(Model model) {
List<Page> pageList = pageService.getAllPage();
model.addAttribute("pageList", pageList);
return "sa/page";
}

/**
* Method name: role <BR>
* Description: 跳转到角色设置页面 <BR>
*
* @param model
* @return String<BR>
*/
@RequestMapping("/role")
public String role(Model model) {
return "sa/role";
}

/**
* Method name: getAllRole <BR>
* Description: 获取所有权限 <BR>
*
* @return List<Role><BR>
*/
@RequestMapping("/getAllRole")
@ResponseBody
public List<Role> getAllRole() {
return roleService.getAllRole();
}

/**
* Method name: getAllPage <BR>
* Description: 获取所有页面 <BR>
*
* @return List<Page><BR>
*/
@RequestMapping("/getAllPage")
@ResponseBody
public List<Page> getAllPage() {
return pageService.getAllPage();
}

/**
* Method name: getPageByRole <BR>
* Description: 获取某个角色的权限页面 <BR>
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
@RequestMapping("/listDoctor")
public String listDoctor() {
return "/user/wordListDoctor";
}

/**
* 医生发布指南页面/user/word.html
*/
@RequestMapping("/publish")
public String publish() {
return "/user/word";
}

/**
* 添加到数据库
*/
@ResponseBody
@RequestMapping("/addWord")
public String addWord(Notice notice) {
try {
notice.setCreateTime(new Date());
notice.setViewCount(0L);
noticeService.add(notice);
return "SUCCESS";
} catch (Exception e) {
e.printStackTrace();
return "ERR";
}
}

/**
* 获取所有指南数据
*/
@RequestMapping("/getAllWordByLimit")
@ResponseBody
public Object getAllWordByLimit(Notice word) {
return noticeService.getAllByLimit(word);
}

/**
* 删除指南
*/
@ResponseBody
@RequestMapping("/delWord")
public String delWord(String[] ids) {
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
}

/**
* 插入数据库
*/
@RequestMapping(value = "/doAdd")
@ResponseBody
@Transactional
public String doAdd(Diagnosis diagnosis) {
Subject subject = SecurityUtils.getSubject();
User user = (User) subject.getPrincipal();
try {
// 医生登录id
diagnosis.setDoctorId(user.getId());
diagnosis.setCreateTime(new Date());
// 状态:1申请中,2申请通过,3不通过,4已完成
diagnosis.setStatus(1);
diagnosisService.add(diagnosis);
return "SUCCESS";
} catch (Exception e) {
logger.error("添加异常", e);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return "ERROR";
}
}

/**
* 修改状态
*/
@RequestMapping(value = "/chStatus")
@ResponseBody
@Transactional
public String chStatus(Diagnosis diagnosis) {
Subject subject = SecurityUtils.getSubject();
User user = (User) subject.getPrincipal();
try {
// 医生登录id
diagnosis.setDoctorId(user.getId());
diagnosisService.update(diagnosis);
return "SUCCESS";
} catch (Exception e) {
logger.error("添加异常", e);
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
@RequestMapping(value = "/freeTime")
public String freeTime(Model model) {
List<User> doctors = userService.listDoctor();
model.addAttribute("doctors", doctors);

Long docId = doctors.get(0).getId();
model.addAttribute("docName", doctors.get(0).getName());
String nowDateYMD = MyUtils.getNowDateYMD();

List<Map<String, Object>> map = appointmentService.getFreeTimeById(docId, nowDateYMD+MyUtils.START_HOUR);
List<String> time = new ArrayList<>();
List<Long> value = new ArrayList<>();

for (Map<String, Object> m : map){
String df = (String) m.get("df");
time.add(df);
Long v = (Long) m.get("c");
if (v == null) {
value.add(0L);
}else {
value.add(v);
}
}

model.addAttribute("time", time);
model.addAttribute("value", value);

return "tj/freeTime";
}

@RequestMapping(value = "/getFreeTime")
@ResponseBody
public Object getFreeTime(Long id, String date) {
User doctors = userService.selectByPrimaryKey(id);
Map<String, Object> result = new HashMap<>();
result.put("n", doctors.getName());
List<Map<String, Object>> map = appointmentService.getFreeTimeById(id, date+MyUtils.START_HOUR);
List<String> time = new ArrayList<>();
List<Long> value = new ArrayList<>();

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
47
48
49
50
51

FileResponse fileResponse = new FileResponse();
File dest = new File(filePath + fileName);

if (!dest.getParentFile().exists()) {
dest.getParentFile().mkdirs();
}
try {
file.transferTo(dest);
out = response.getWriter();
String filename = "/file/" + fileName;
String s = fileResponse.success(1, fileName, filename, null);
// 返回"图像"选项卡并显示图片 request.getContextPath()为web项目名
out.println(s);
} catch (IOException e) {
String s = fileResponse.error(0, "上传失败!");
// 返回"图像"选项卡并显示图片 request.getContextPath()为web项目名
out.println(s);
}
}

@RequestMapping(value = "/layuiUpload", method = RequestMethod.POST)
@ResponseBody
public void layuiUpload(MultipartFile file,
HttpServletRequest request, HttpServletResponse response){
if (file.isEmpty()) {
System.out.println("文件为空空");
}
PrintWriter out=null;
// CKEditor提交的很重要的一个参数 ,回调函数的序号
String callback = request.getParameter("CKEditorFuncNum");


String fileName = file.getOriginalFilename(); // 文件名
String suffixName = fileName.substring(fileName.lastIndexOf(".")); // 后缀名
String filePath = "D://upload//"; // 上传后的路径
fileName = UUID.randomUUID() + suffixName; // 新文件名

FileResponse fileResponse = new FileResponse();
File dest = new File(filePath + fileName);

if (!dest.getParentFile().exists()) {
dest.getParentFile().mkdirs();
}
try {
file.transferTo(dest);
out = response.getWriter();
String filename = "/file/" + fileName;
String s = fileResponse.success(1, fileName, filename, null);
// 返回"图像"选项卡并显示图片 request.getContextPath()为web项目名
out.println(s);
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
 * Description: 批量删除用户 <BR>
*
* @param ids
* @return String<BR>
*/
@RequestMapping(value = "delUser")
@ResponseBody
@Transactional
public String delUser(Long[] ids) {
Subject subject = SecurityUtils.getSubject();
User user = (User) subject.getPrincipal();
try {
for (Long id : ids) {
if (id.equals(user.getId())) {
return "DontOP";
}
userService.delUserById(id);
}
return "SUCCESS";
} catch (Exception e) {
logger.error("根据用户id更新用户异常", e);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return "ERROR";
}
}

/**
* Method name: addUserPage <BR>
* Description: 增加用户界面 <BR>
*
* @return String<BR>
*/
@RequestMapping(value = "/addUserPage")
public String addUserPage(Long userId, Model model) {
model.addAttribute("manageUser", userId);
if (null != userId) {
User user = userService.selectByPrimaryKey(userId);
model.addAttribute("manageUser", user);
}
return "sa/userAdd";
}

/**
* Method name: checkUserId <BR>
* Description: 检测用户账号是否存在 <BR>


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