基于javaweb的SpringBoot体检管理系统(java+springboot+thymeleaf+layui+html+mysql+maven)

运行环境

Java≥8、MySQL≥5.7

开发工具

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

适用

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

功能说明

370023162402

380023162402

390023162402

410023162402

420023162402

基于javaweb的SpringBoot体检管理系统(java+springboot+thymeleaf+layui+html+mysql+maven)

1
2
分为:管理员、医生、体检人
体检人预约-管理员审核-医生问诊

项目介绍:

登录、注册、用户管理、角色管理、体检人管理、体检健康史、体检人档案、体检中心管理

环境需要

1.运行环境:最好是java jdk 1.8,我们在这个平台上运行的。其他版本理论上也可以。
2.IDE环境:IDEA,Eclipse,Myeclipse都可以。推荐IDEA;
3.硬件环境:windows 7/8/10 1G内存以上;或者 Mac OS; 
4.数据库:MySql 5.7版本;

技术栈

JSP +SpringBoot + MyBatis + html+ css + JavaScript + JQuery + Ajax + 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
    hsMin+=s.getHeightMin();
hsMax+=s.getHeightMax();
asMin+=s.getAppetiteMin();
asMax+=s.getAppetiteMax();
}
tsMin = tsMin / ssRows.size();
tsMax = tsMax / ssRows.size();
wsMin = wsMin / ssRows.size();
wsMax = wsMax / ssRows.size();
hsMin = hsMin / ssRows.size();
hsMax = hsMax / ssRows.size();
asMin = asMin / ssRows.size();
asMax = asMax / ssRows.size();

mt.add(tsMax);
mw.add(wsMax);
mh.add(hsMax);
ma.add(asMax);

if (t>=tsMin && t<=tsMax){
tsCount.add(" 体温正常");
}else if (t<tsMin){
tsCount.add( " 体温偏低");
}else if (t>tsMax){
tsCount.add( " 体温偏高");
}

if (w>=wsMin && w<=wsMax){
wsCount.add( " 体重正常");
}else if (w<wsMin){
wsCount.add(" 体重偏低");
}else if (w>wsMax){
wsCount.add(" 体重偏高");
}

if (h>=hsMin && h<=hsMax){
hsCount.add(" 身高正常");
}else if (h<hsMin){
hsCount.add( " 身高偏低");
}else if (h>hsMax){
hsCount.add(" 身高偏高");
}

if (a>=asMin && a<=asMax){
asCount.add( " 饭量正常");
}else if (a<asMin){
asCount.add(" 饭量偏低");
}else if (a>asMax){
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
        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);
} catch (IOException e) {
String s = fileResponse.error(0, "上传失败!");
// 返回"图像"选项卡并显示图片 request.getContextPath()为web项目名
out.println(s);
}
}
}
package com.phms.controller.user;



/**
* 用户体检管理
*/
@Controller("UserPetController")
@RequestMapping("/user/pet")
public class UserPetController {
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
            return "app";
}
try {
petService.deleteById(id);
return "SUCCESS";
} catch (Exception e) {
logger.error("删除异常", e);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return "ERROR";
}
}

/**
* 添加体检页面user/petAdd.html
*/
@RequestMapping(value = "/add")
public String add() {
return "user/petAdd";
}

/**
* 添加到数据库
*/
@RequestMapping(value = "/doAdd")
@ResponseBody
@Transactional
public String doAdd(Pet pojo) {
Subject subject = SecurityUtils.getSubject();
User user = (User) subject.getPrincipal();
try {
pojo.setUserId(user.getId());
pojo.setCreateTime(new Date());
petService.add(pojo);
return "SUCCESS";
} catch (Exception e) {
logger.error("添加异常", e);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return "ERROR";
}
}
}
package com.phms.controller.user;

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
PetDaily petDaily = new PetDaily();
petDaily.setPetId(p.getId());
petDaily.setPage(1);
petDaily.setLimit(10);
MMGridPageVoBean<PetDaily> ps = (MMGridPageVoBean<PetDaily>) petDailyService.getAllByLimit(petDaily);
List<PetDaily> psRows = ps.getRows();
double t = 0;
double w = 0;
double h = 0;
double a = 0;

for (PetDaily petDaily1 : psRows){
t+=petDaily1.getTemperature();
w+=petDaily1.getWeight();
h+=petDaily1.getHeight();
a+=petDaily1.getAppetite();
}
t = t/psRows.size();
w = w/psRows.size();
h = h/psRows.size();
a = a/psRows.size();

pt.add(t);
pw.add(w);
ph.add(h);
pa.add(a);

// 获取标准
Standard standard = new Standard();
// 对应体检类型
standard.setType(p.getType());
// 健康标准
standard.setStatus(1);
int petAge = MyUtils.get2DateDay(MyUtils.getDate2String(p.getBirthday(), "yyyy-MM-dd"), MyUtils.getDate2String(new Date(), "yyyy-MM-dd"));
petAge = (petAge<0? -petAge : petAge)/365;
// 年龄
standard.setAgeMax(petAge);
standard.setPage(1);
standard.setLimit(100);
MMGridPageVoBean<Standard> ss = (MMGridPageVoBean<Standard>) standardService.getAllByLimit(standard);
List<Standard> ssRows = ss.getRows();
double tsMin = 0;
double tsMax = 0;
double wsMin = 0;
double wsMax = 0;
double hsMin = 0;
double hsMax = 0;
double asMin = 0;
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
@RequestMapping("/getAllByLimitDoctor")
@ResponseBody
public Object getAllByLimitDoctor(PetDaily pojo) {
return petDailyService.getAllByLimit(pojo);
}

/**
* 删除
*/
@RequestMapping(value = "/del")
@ResponseBody
@Transactional
public String del(Long id) {
try {
petDailyService.deleteById(id);
return "SUCCESS";
} catch (Exception e) {
logger.error("删除异常", e);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return "ERROR";
}
}

/**
* 添加页面user/petDailyAdd.html
*/
@RequestMapping(value = "/add")
public String add(Model model) {
Subject subject = SecurityUtils.getSubject();
User user = (User) subject.getPrincipal();
Pet pet = new Pet();
pet.setUserId(user.getId());
pet.setPage(1);
pet.setLimit(100);
MMGridPageVoBean<Pet> voBean = (MMGridPageVoBean<Pet>) petService.getAllByLimit(pet);
List<Pet> rows = voBean.getRows();
// 获取到该用户下所有的体检
model.addAttribute("pets", rows);
return "user/petDailyAdd";
}

/**
* 插入数据库
*/
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
		ids[0] = user.getId()+"";
// 普通用户
userRoleService.addUserRole(2, ids);
return resultMap.success().message("注册成功");
}catch (Exception e){
e.printStackTrace();
return resultMap.fail().message("注册失败");
}
}

/**
* Method name: index <BR>
* Description: 登录页面 <BR>
*
* @return String login.html<BR>
*/
@RequestMapping(value = "/")
public String index(Model model) {
Subject subject = SecurityUtils.getSubject();
User user = (User) subject.getPrincipal();

if (null != user) {
model.addAttribute("user", user);

List<Page> pageList = pageService.getAllRolePageByUserId(user.getId()+"");

model.addAttribute("pageList", pageList);
return "index";
} else {
return "login";
}
}

/**
* Method name: main <BR>
* Description: 进入主页面 <BR>
* index.html
*/
@RequestMapping(value = "/main")
public String main(Model model) {
Subject subject = SecurityUtils.getSubject();
User user = (User) subject.getPrincipal();
if (null != user) {
model.addAttribute("user", user);
} else {
return "login";
}


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