一、个人简介
💖💖作者:计算机编程果茶熊 💙💙个人简介:曾长期从事计算机专业培训教学,担任过编程老师,同时本人也热爱上课教学,擅长Java、微信小程序、Python、Golang、安卓Android等多个IT方向。会做一些项目定制化开发、代码讲解、答辩教学、文档编写、也懂一些降重方面的技巧。平常喜欢分享一些自己开发中遇到的问题的解决办法,也喜欢交流技术,大家有技术代码这一块的问题可以问我! 💛💛想说的话:感谢大家的关注与支持! 💜💜 网站实战项目 安卓/小程序实战项目 大数据实战项目 计算机毕业设计选题 💕💕文末获取源码联系计算机编程果茶熊
二、系统介绍
开发语言:Java+Python 数据库:MySQL 系统架构:B/S 后端框架:SpringBoot(Spring+SpringMVC+Mybatis)+Django 前端:Vue+HTML+CSS+JavaScript+jQuery
职工健康监护管理系统是一款基于Spring Boot+Vue技术栈开发的B/S架构信息化管理平台,采用MySQL数据库进行数据存储。系统以职工健康管理为核心,围绕健康数据采集、分析、预警、干预等环节构建完整的健康管理闭环。平台提供职工基础信息管理、健康管理人员管理、健康知识分类与发布、疾病预防知识普及等基础功能,同时支持健康数据录入与监测、健康预警自动触发、体检报告电子化管理、健康评估模型构建、个性化健康计划制定、健康干预方案推送以及健康建议生成等核心业务功能。系统采用前后端分离架构,通过SpringMVC处理业务逻辑,MyBatis实现数据持久化,Vue构建交互界面,为企业建立规范化、科学化的职工健康监护体系提供技术支撑。
三、视频解说
四、部分功能展示
五、部分代码展示
/**
* 健康数据管理核心业务处理
*/
@Service
public class HealthDataService {
@Autowired
private HealthDataMapper healthDataMapper;
@Autowired
private HealthWarningService healthWarningService;
@Autowired
private EmployeeMapper employeeMapper;
/**
* 保存健康数据并触发预警检测
*/
@Transactional
public Result saveHealthData(HealthDataDTO healthDataDTO) {
// 验证职工是否存在
Employee employee = employeeMapper.selectById(healthDataDTO.getEmployeeId());
if (employee == null) {
return Result.error("职工信息不存在");
}
// 构建健康数据实体
HealthData healthData = new HealthData();
BeanUtils.copyProperties(healthDataDTO, healthData);
healthData.setCreateTime(new Date());
healthData.setUpdateTime(new Date());
// 计算BMI指数
if (healthData.getHeight() != null && healthData.getWeight() != null) {
double heightInMeters = healthData.getHeight() / 100.0;
double bmi = healthData.getWeight() / (heightInMeters * heightInMeters);
healthData.setBmi(new BigDecimal(bmi).setScale(2, RoundingMode.HALF_UP));
}
// 保存健康数据
int insertResult = healthDataMapper.insert(healthData);
if (insertResult == 0) {
throw new RuntimeException("健康数据保存失败");
}
// 检测各项指标是否异常并生成预警
List<String> warningMessages = new ArrayList<>();
// 血压检测
if (healthData.getSystolicPressure() != null && healthData.getDiastolicPressure() != null) {
if (healthData.getSystolicPressure() >= 140 || healthData.getDiastolicPressure() >= 90) {
warningMessages.add("血压偏高:收缩压" + healthData.getSystolicPressure() +
"mmHg,舒张压" + healthData.getDiastolicPressure() + "mmHg");
} else if (healthData.getSystolicPressure() < 90 || healthData.getDiastolicPressure() < 60) {
warningMessages.add("血压偏低:收缩压" + healthData.getSystolicPressure() +
"mmHg,舒张压" + healthData.getDiastolicPressure() + "mmHg");
}
}
// 血糖检测
if (healthData.getBloodSugar() != null) {
if (healthData.getBloodSugar().compareTo(new BigDecimal("6.1")) > 0) {
warningMessages.add("空腹血糖偏高:" + healthData.getBloodSugar() + "mmol/L");
} else if (healthData.getBloodSugar().compareTo(new BigDecimal("3.9")) < 0) {
warningMessages.add("血糖偏低:" + healthData.getBloodSugar() + "mmol/L");
}
}
// BMI检测
if (healthData.getBmi() != null) {
if (healthData.getBmi().compareTo(new BigDecimal("28")) > 0) {
warningMessages.add("BMI指数偏高,属于肥胖范围:" + healthData.getBmi());
} else if (healthData.getBmi().compareTo(new BigDecimal("18.5")) < 0) {
warningMessages.add("BMI指数偏低,体重不足:" + healthData.getBmi());
}
}
// 心率检测
if (healthData.getHeartRate() != null) {
if (healthData.getHeartRate() > 100) {
warningMessages.add("心率偏快:" + healthData.getHeartRate() + "次/分");
} else if (healthData.getHeartRate() < 60) {
warningMessages.add("心率偏慢:" + healthData.getHeartRate() + "次/分");
}
}
// 如果存在异常指标,创建预警记录
if (!warningMessages.isEmpty()) {
healthWarningService.createWarning(employee.getId(), employee.getName(),
String.join(";", warningMessages), healthData.getId());
}
return Result.success("健康数据保存成功", healthData.getId());
}
}
/**
* 健康评估管理核心业务处理
*/
@Service
public class HealthAssessmentService {
@Autowired
private HealthAssessmentMapper healthAssessmentMapper;
@Autowired
private HealthDataMapper healthDataMapper;
@Autowired
private PhysicalReportMapper physicalReportMapper;
/**
* 生成职工健康评估报告
*/
@Transactional
public Result generateAssessment(Long employeeId) {
// 查询最近一次体检报告
PhysicalReport latestReport = physicalReportMapper.selectLatestByEmployeeId(employeeId);
// 查询近三个月健康数据
Date threeMonthsAgo = DateUtils.addMonths(new Date(), -3);
List<HealthData> healthDataList = healthDataMapper.selectByEmployeeIdAndDateRange(
employeeId, threeMonthsAgo, new Date());
if (healthDataList.isEmpty() && latestReport == null) {
return Result.error("暂无足够的健康数据进行评估");
}
// 创建评估实体
HealthAssessment assessment = new HealthAssessment();
assessment.setEmployeeId(employeeId);
assessment.setAssessmentDate(new Date());
int totalScore = 100; // 基础分100分
List<String> riskFactors = new ArrayList<>();
List<String> suggestions = new ArrayList<>();
// 分析体检报告异常项
if (latestReport != null) {
if (latestReport.getAbnormalItems() != null && !latestReport.getAbnormalItems().isEmpty()) {
String[] abnormalItems = latestReport.getAbnormalItems().split(",");
totalScore -= abnormalItems.length * 5;
for (String item : abnormalItems) {
riskFactors.add("体检异常项:" + item);
}
}
}
// 分析血压趋势
long highBloodPressureCount = healthDataList.stream()
.filter(data -> data.getSystolicPressure() != null &&
(data.getSystolicPressure() >= 140 || data.getDiastolicPressure() >= 90))
.count();
if (highBloodPressureCount > healthDataList.size() * 0.5) {
totalScore -= 15;
riskFactors.add("血压持续偏高,高血压风险");
suggestions.add("建议低盐饮食,控制每日盐摄入量在6克以内");
suggestions.add("建议每周进行3-5次有氧运动,每次30分钟以上");
}
// 分析血糖趋势
long highBloodSugarCount = healthDataList.stream()
.filter(data -> data.getBloodSugar() != null &&
data.getBloodSugar().compareTo(new BigDecimal("6.1")) > 0)
.count();
if (highBloodSugarCount > healthDataList.size() * 0.5) {
totalScore -= 15;
riskFactors.add("血糖持续偏高,糖尿病风险");
suggestions.add("建议减少精制碳水化合物摄入,多食用粗粮");
suggestions.add("建议定期监测血糖变化,必要时就医");
}
// 分析BMI趋势
List<HealthData> dataWithBmi = healthDataList.stream()
.filter(data -> data.getBmi() != null)
.collect(Collectors.toList());
if (!dataWithBmi.isEmpty()) {
double avgBmi = dataWithBmi.stream()
.mapToDouble(data -> data.getBmi().doubleValue())
.average()
.orElse(0);
if (avgBmi > 28) {
totalScore -= 10;
riskFactors.add("体重超标,肥胖");
suggestions.add("建议控制每日总热量摄入,避免高油高糖食物");
} else if (avgBmi < 18.5) {
totalScore -= 8;
riskFactors.add("体重不足,营养不良风险");
suggestions.add("建议增加营养摄入,保证蛋白质供给");
}
}
// 分析心率趋势
List<HealthData> dataWithHeartRate = healthDataList.stream()
.filter(data -> data.getHeartRate() != null)
.collect(Collectors.toList());
if (!dataWithHeartRate.isEmpty()) {
double avgHeartRate = dataWithHeartRate.stream()
.mapToInt(HealthData::getHeartRate)
.average()
.orElse(0);
if (avgHeartRate > 100) {
totalScore -= 10;
riskFactors.add("心率偏快,心血管健康需关注");
suggestions.add("建议减少咖啡因摄入,保证充足睡眠");
}
}
// 确保分数不低于0
totalScore = Math.max(totalScore, 0);
// 根据总分确定健康等级
String healthLevel;
if (totalScore >= 90) {
healthLevel = "优秀";
} else if (totalScore >= 80) {
healthLevel = "良好";
} else if (totalScore >= 70) {
healthLevel = "一般";
} else if (totalScore >= 60) {
healthLevel = "较差";
} else {
healthLevel = "差";
}
assessment.setHealthScore(totalScore);
assessment.setHealthLevel(healthLevel);
assessment.setRiskFactors(String.join(";", riskFactors));
assessment.setSuggestions(String.join(";", suggestions));
assessment.setAssessmentContent("基于近期体检报告和健康监测数据综合评估");
assessment.setCreateTime(new Date());
healthAssessmentMapper.insert(assessment);
return Result.success("健康评估生成成功", assessment);
}
}
六、部分文档展示
七、END
💕💕文末获取源码联系计算机编程果茶熊