当前位置: 首页> 文旅> 旅游 > 微信注册小程序步骤_seo专业培训seo专业培训_南昌seo推广公司_东莞关键词优化实力乐云seo

微信注册小程序步骤_seo专业培训seo专业培训_南昌seo推广公司_东莞关键词优化实力乐云seo

时间:2025/7/15 12:12:14来源:https://blog.csdn.net/m0_56095048/article/details/144151709 浏览次数:0次
微信注册小程序步骤_seo专业培训seo专业培训_南昌seo推广公司_东莞关键词优化实力乐云seo
/*** 用户画像 (一天)*/@PostMapping("/oneUserDetectionDetail")public AjaxResult oneUserDetectionDetail(@RequestBody Map<String, Object> map) {Object userId = map.get("userId");long l = Long.valueOf(String.valueOf(userId));map.remove("pageNum");map.remove("pageSize");List<UserScoreRule> userScoreRules = userScoreRuleService.selectUserScoreRuleList(null);UserScoreRule userScoreRule = userScoreRules.get(0);ax = userScoreRule.getAX();ay = userScoreRule.getAY();ta = userScoreRule.getTA();tb = userScoreRule.getTB();xm = userScoreRule.getXM();xn = userScoreRule.getXN();ar = userScoreRule.getAR();ars = userScoreRule.getARS();tr = userScoreRule.getTR();trs = userScoreRule.getTRS();xr = userScoreRule.getXR();xrs = userScoreRule.getXRS();Map<String, Object> mapA = new HashMap<>();double a1 = 0; // 当日的检测值Integer o1 = 0; // 正常Integer o2 = 0; // 低血氧String nickName = "";String sex = "";String phoneNumber = "";String deptName = "";String jobNumber = "";String roleName = "";String downloadPath = "";// 温度评分double MIN_NORMAL = ta; // 正常体温的最小值double MAX_NORMAL = tb; // 正常体温的最大值double PENALTY_PER_01 = trs;   // 每0.1度的扣分值double MAX_PASS_ALCOHOL = ax; // 通过的酒精检测值上限double PENALTY_PER_MG = ars;  // 分值List<Double> listAlcohol = new ArrayList<>();List<Integer> listSy = new ArrayList<>();List<Integer> listDia = new ArrayList<>();List<Integer> listHeartRate = new ArrayList<>();List<String> listUserInfo = new ArrayList<>();List<Integer> listBloodOx = new ArrayList<>();List<Double> listTemperature = new ArrayList<>();List<Double> bloodPressureScore = new ArrayList<>();List<Double> alcoholPressureScore = new ArrayList<>();List<Double> bloodOxPressureScore = new ArrayList<>();List<Double> temperatureScore = new ArrayList<>();List<SysUserExport> sysUserExports = sysUserInfoRecordService.oneUserDetectionDetail(map);for (SysUserExport sysUserExport : sysUserExports) {// 计算出这一周,滴酒未沾、轻度、 中度、 重度的次数 0、 <20、  >=20、  >80String alcoholDetectionResult = sysUserExport.getAlcoholDetectionResult();if (!alcoholDetectionResult.equals("0")) { // 为0的数据如何进行处理alcoholDetectionResult = alcoholDetectionResult.replace("测酒结果:", "");String alcoholValue = alcoholDetectionResult.substring(0, alcoholDetectionResult.indexOf("mg"));double alcoholNumber = Double.parseDouble(alcoholValue);a1 = alcoholNumber;// 计算酒精评分if (alcoholNumber < MAX_PASS_ALCOHOL) { // 酒精检测值低于20mg/100ml// 计算扣分double as1 = 100;alcoholPressureScore.add(as1);} else {// 酒精检测值高于20mg/100ml,分数依次减double penalty = (alcoholNumber - MAX_PASS_ALCOHOL) * PENALTY_PER_MG;  // 待测试double as2 = 100 - penalty;alcoholPressureScore.add(as2);}}// 计算出这一周 血氧 >=95正常   < 95异常String bloodO = sysUserExport.getBloodOxygenDetectionResult();if (!bloodO.equals("0")) {String[] parts = bloodO.split("血氧饱和度:");if (parts.length > 1) {String saturation = parts[1].split("%")[0]; // 分割百分号并取第一部分int bloodONum = Integer.parseInt(saturation);//血氧正常o1 = bloodONum;o2 = 0;// 评分if (bloodONum >= xm) {//血氧正常double os1 = 100;bloodOxPressureScore.add(os1);} else if (bloodONum < xn) {double os2 = 0;bloodOxPressureScore.add(os2);} else if (xn <= bloodONum && bloodONum < xm) {// 每下降0.1 就减一分double os3 = 100 - (xm - bloodONum) * 10;bloodOxPressureScore.add(os3);}}}// 正常  一级 二级 三级在一周内的次数String blood = sysUserExport.getBloodPressureDetectionResult();if (blood.contains("Error")) {Integer high = 0;Integer low = 0;Integer heartRate = 0;listSy.add(high);listDia.add(low);listHeartRate.add(heartRate);} else {if (blood.equals("0")) {Integer high = 0;Integer low = 0;Integer heartRate = 0;listSy.add(high);listDia.add(low);listHeartRate.add(heartRate);} else {// 定义收缩压和舒张压的起始和结束位置int systolicStart = blood.indexOf("收缩压:");int systolicEnd = blood.indexOf("mmhg", systolicStart);int diastolicStart = blood.indexOf("舒张压:");int diastolicEnd = blood.indexOf("mmhg", diastolicStart);int heartRateIndex = blood.indexOf("心率:");// 确保找到了"心率:"并且后面有空格,否则可能截取失败if (heartRateIndex != -1) {String heartRateStr = blood.substring(heartRateIndex + "心率:".length());int heartRate = Integer.parseInt(heartRateStr);listHeartRate.add(heartRate);}// 使用substring方法截取收缩压和舒张压的数值String systolicValue = blood.substring(systolicStart + "收缩压:".length(), systolicEnd);String diastolicValue = blood.substring(diastolicStart + "舒张压:".length(), diastolicEnd);Integer high = Integer.valueOf(systolicValue);Integer low = Integer.valueOf(diastolicValue);listSy.add(high);listDia.add(low);}}// 血压检测评分(未检测不进行统计)String booldScore = sysUserExport.getBloodPressureDetectionResult();if (booldScore.contains("Error")) {bloodPressureScore.add(0.0);} else {if (!booldScore.equals("0")) {int systolicStart = booldScore.indexOf("收缩压:");int systolicEnd = booldScore.indexOf("mmhg", systolicStart);int diastolicStart = booldScore.indexOf("舒张压:");int diastolicEnd = booldScore.indexOf("mmhg", diastolicStart);// 使用substring方法截取收缩压和舒张压的数值String systolicValue = booldScore.substring(systolicStart + "收缩压:".length(), systolicEnd);String diastolicValue = booldScore.substring(diastolicStart + "舒张压:".length(), diastolicEnd);Integer systolic = Integer.valueOf(systolicValue);Integer diastolic = Integer.valueOf(diastolicValue);if (systolic >= 140 || diastolic >= 90) {if (systolic >= 180 || diastolic >= 110) {// "3级高血压(重度)";double B1 = 0;bloodPressureScore.add(B1);} else if (systolic >= 160 || diastolic >= 100) {// "2级高血压(中度)";double B2 = 60;bloodPressureScore.add(B2);} else {// "1级高血压(轻度)";double B3 = 80;bloodPressureScore.add(B3);}} else if (systolic >= 130 || diastolic >= 85) {//  "正常值偏高";double B4 = 90;bloodPressureScore.add(B4);} else if (systolic >= 90 || diastolic >= 60) {// "正常血压";double B5 = 100;bloodPressureScore.add(B5);} else {// "低血压";double B6 = 0;bloodPressureScore.add(B6);}}}// 温度展示String temperature = sysUserExport.getTemperature();if (StringUtils.isEmpty(temperature)) {listTemperature.add(0.0);} else {double temperatureDouble = Double.parseDouble(temperature);listTemperature.add(temperatureDouble);// 检查体温是否在正常范围内if (temperatureDouble >= MIN_NORMAL && temperatureDouble <= MAX_NORMAL) {// 计算体温偏离正常范围的程度,并计算扣分double deviation = Math.max(Math.abs(temperatureDouble - MIN_NORMAL), Math.abs(temperatureDouble - MAX_NORMAL));int penalty = (int) (deviation * 10 / PENALTY_PER_01); // 每0.1度扣4分,所以乘以10double t1 = 100 - penalty;temperatureScore.add(t1);} else {// 体温不在正常范围内,不及格double t2 = 0;temperatureScore.add(t2);}}}UserIndex userIndex = userIndexService.selectUserIndexByUserIdAllInfo(l);if (userIndex != null) {// 个人信息nickName = userIndex.getNickName();jobNumber = userIndex.getJobNumber();deptName = userIndex.getDeptName();roleName = userIndex.getRoleName();phoneNumber = userIndex.getPhonenumber();downloadPath = userIndex.getDownloadPath();sex = userIndex.getSex();}// 将统计结果添加到list中listAlcohol.add(a1);listBloodOx.add(o1);listBloodOx.add(o2);listUserInfo.add(nickName);listUserInfo.add(jobNumber);listUserInfo.add(deptName);listUserInfo.add(roleName);listUserInfo.add(phoneNumber);listUserInfo.add(sex);listUserInfo.add(downloadPath);// 计算血压的评分String formattedNumberBlood = "0";if (bloodPressureScore.size() != 0) {double sum = 0.0;for (double bps : bloodPressureScore) {// 将每个元素的值累加到总和变量中sum += bps;}// 计算平均值double bloodAverage = sum / bloodPressureScore.size();DecimalFormat decimalFormatBlood = new DecimalFormat("#.#");formattedNumberBlood = decimalFormatBlood.format(bloodAverage);} else {formattedNumberBlood = "0";}// 计算酒精的评分String formattedNumberAlcoho = "";if (alcoholPressureScore.size() != 0) {double sumA = 0.0;for (double bps : alcoholPressureScore) {// 将每个元素的值累加到总和变量中sumA += bps;}// 计算平均值double bloodAAverage = sumA / alcoholPressureScore.size();DecimalFormat decimalFormat = new DecimalFormat("#.#");formattedNumberAlcoho = decimalFormat.format(bloodAAverage);} else {formattedNumberAlcoho = "0";}// 计算血氧的评分String formattedNumberBO = "0";if (bloodOxPressureScore.size() != 0) {double sumBO = 0.0;for (double bps : bloodOxPressureScore) {// 将每个元素的值累加到总和变量中sumBO += bps;}// 计算平均值double bloodBOverage = sumBO / bloodOxPressureScore.size();DecimalFormat decimalFormatBO = new DecimalFormat("#.#");formattedNumberBO = decimalFormatBO.format(bloodBOverage);} else {formattedNumberBO = "0";}// 计算温度的评分double sumT = 0.0;for (double bps : temperatureScore) {// 将每个元素的值累加到总和变量中sumT += bps;}// 计算平均值double Tempverage = sumT / temperatureScore.size();DecimalFormat decimalFormatTemp = new DecimalFormat("#.#");String formattedNumberTemp = decimalFormatTemp.format(Tempverage);mapA.put("listUserInfo", listUserInfo);   // 个人信息mapA.put("alcohoMap", listAlcohol);  // 酒精柱状图(原来是饼状图需要修改)mapA.put("bloodOxygenMap", listBloodOx);  // 血氧折线图mapA.put("bloodPressureSyMap", listSy);  //高血压mapA.put("bloodPressureDiaMap", listDia); // 低血压mapA.put("bloodPressureHeartRateMap", listHeartRate);  // 心率折线图mapA.put("temperatureMap", listTemperature);   // 体温柱状图mapA.put("bloodPressureScore", formattedNumberBlood); // 血压评分mapA.put("alcohoScore", formattedNumberAlcoho);  // 酒精评分mapA.put("bloodOXScore", formattedNumberBO);    // 血氧评分mapA.put("temperatureScore", formattedNumberTemp);  // 温度评分formattedNumberBloodPDF = formattedNumberBlood;formattedNumberAlcohoPDF = formattedNumberAlcoho;formattedNumberBOPDF = formattedNumberBO;formattedNumberTempPDF = formattedNumberTemp;// 计算综合评分Map<String, Object> mapB = new HashMap<>();mapB.put("bloodPressureScore", formattedNumberBlood); // 血压评分mapB.put("alcohoScore", formattedNumberAlcoho);  // 酒精评分mapB.put("bloodOXScore", formattedNumberBO);    // 血氧评分mapB.put("temperatureScore", formattedNumberTemp);  // 温度评分String overallScore = calculateOverallScore(mapB);mapA.put("overallScore", overallScore);  // 综合评分// 没有数据的时候如何进行数据处理// 获取当前日期LocalDate today = LocalDate.now();// 创建一个列表来存储最近12个月的日期List<LocalDate> recentMonths = new ArrayList<>();// 遍历12个月for (int i = 0; i < 12; i++) {// 获取当前月份的第一天LocalDate firstDayOfCurrentMonth = today.with(TemporalAdjusters.firstDayOfMonth());// 将其添加到列表中recentMonths.add(firstDayOfCurrentMonth);// 减去一个月today = today.minusMonths(1);}List<SysUserExport> sysUserExportAll = new ArrayList<>();// 输出最近12个月的日期for (LocalDate date : recentMonths) {// 计算最近12个月的评分map.put("year", date.getYear()); // TODO 今年map.put("month", date.getMonthValue()); // TODO 当月List<SysUserExport> monthlyData = sysUserInfoRecordService.selectUserIndexByUserIdAllInfo(map); // 输入每个月的参数sysUserExportAll.addAll(monthlyData); // 将每个月的数据添加到集合中}List<Integer> overallYearScore = calculateYearlyScores(sysUserExportAll);mapA.put("overallYearScore", overallYearScore);  // 评分折线图return AjaxResult.success(mapA);}// 计算综合评分String calculateOverallScore(Map<String, Object> scores) {int sum = 0;int count = 0;for (Map.Entry<String, Object> entry : scores.entrySet()) {// 确保值是字符串且非空if (entry.getValue() instanceof String && !((String) entry.getValue()).isEmpty()) {try {// 将字符串转换为doubleString scoreStr = (String) entry.getValue();double score = Double.parseDouble(scoreStr);// 只有非零值才计入总分和计数if (score != 0) {sum += score;count++;}} catch (NumberFormatException e) {// 如果转换失败,可以打印错误或进行其他处理System.err.println("评分值转换错误: " + entry.getValue());}}}String overallScoreAsString = "";// 如果有有效评分,则计算平均值并存入mapif (count > 0) {int average = sum / count;scores.put("overallScore", average);Object overallScore = scores.get("overallScore");overallScoreAsString = overallScore.toString();} else {// 如果没有有效评分,则可以存入合适的默认值scores.put("overallScore", "0");Object overallScore = scores.get("overallScore");overallScoreAsString = overallScore.toString();}return overallScoreAsString;}/*** 用户画像 (当周)* 只获取七天的数据* 查出当天的数据,往前推前天,没有数据就为空*/@PostMapping("/weekUserDetectionDetail")public AjaxResult weekUserDetectionDetail(@RequestBody Map<String, Object> map) {Object userId = map.get("userId");long l = Long.valueOf(String.valueOf(userId));map.remove("pageNum");map.remove("pageSize");List<UserScoreRule> userScoreRules = userScoreRuleService.selectUserScoreRuleList(null);UserScoreRule userScoreRule = userScoreRules.get(0);ax = userScoreRule.getAX();ay = userScoreRule.getAY();ta = userScoreRule.getTA();tb = userScoreRule.getTB();xm = userScoreRule.getXM();xn = userScoreRule.getXN();ar = userScoreRule.getAR();ars = userScoreRule.getARS();tr = userScoreRule.getTR();trs = userScoreRule.getTRS();xr = userScoreRule.getXR();xrs = userScoreRule.getXRS();Map<String, Object> mapA = new HashMap<>();Integer a1 = 0; // 滴酒不沾Integer a2 = 0; // 轻度Integer a3 = 0; // 中度Integer a4 = 0; // 重度Integer o1 = 0; // 正常Integer o2 = 0; // 低血氧Integer o3 = 0; // 高血氧String nickName = "";String sex = "";String phoneNumber = "";String deptName = "";String jobNumber = "";String roleName = "";String downloadPath = "";// 温度评分double MIN_NORMAL = ta; // 正常体温的最小值double MAX_NORMAL = tb; // 正常体温的最大值double PENALTY_PER_01 = trs;   // 每0.1度的扣分值double MAX_PASS_ALCOHOL = ax; // 通过的酒精检测值上限double PENALTY_PER_MG = ars; // 分值List<Integer> listA = new ArrayList<>();List<Integer> listSy = new ArrayList<>();List<Integer> listDia = new ArrayList<>();List<Integer> listHeartRate = new ArrayList<>();List<String> listUserInfo = new ArrayList<>();List<Integer> listBloodOx = new ArrayList<>();List<Double> listTemperature = new ArrayList<>();List<Double> bloodPressureScore = new ArrayList<>();List<Double> alcoholPressureScore = new ArrayList<>();List<Double> bloodOxPressureScore = new ArrayList<>();List<Double> temperatureScore = new ArrayList<>();List<SysUserExport> sysUserExports = sysUserInfoRecordService.weekUserDetectionDetail(map);for (SysUserExport sysUserExport : sysUserExports) {// 计算出这一周,滴酒未沾、轻度、 中度、 重度的次数 0、 <20、  >=20、  >80String alcoholDetectionResult = sysUserExport.getAlcoholDetectionResult();if (!alcoholDetectionResult.equals("0")) { // 为0的数据如何进行处理alcoholDetectionResult = alcoholDetectionResult.replace("测酒结果:", "");String alcoholValue = alcoholDetectionResult.substring(0, alcoholDetectionResult.indexOf("mg"));double alcoholNumber = Double.parseDouble(alcoholValue);if (alcoholNumber == 0) {a1 += 1;}if (alcoholNumber < 20 && alcoholNumber > 0) {a2 += 1;}if (alcoholNumber >= 20 && alcoholNumber < 80) {a3 += 1;}if (alcoholNumber >= 80) {a4 += 1;}// 计算酒精评分if (alcoholNumber < MAX_PASS_ALCOHOL) { // 酒精检测值低于20mg/100ml// 计算扣分double as1 = 100;alcoholPressureScore.add(as1);} else {// 酒精检测值高于20mg/100ml,分数依次减double penalty = (alcoholNumber - MAX_PASS_ALCOHOL) * PENALTY_PER_MG;double as2 = 100 - penalty;alcoholPressureScore.add(as2);}}// 计算出这一周 血氧 >=95正常   < 95异常String bloodO = sysUserExport.getBloodOxygenDetectionResult();if (!bloodO.equals("0")) {String[] parts = bloodO.split("血氧饱和度:");if (parts.length > 1) {String saturation = parts[1].split("%")[0]; // 分割百分号并取第一部分int bloodONum = Integer.parseInt(saturation);if (bloodONum >= 95 && bloodONum < 100) {//血氧正常o1 += 1;} else if (bloodONum < 95) {// 低血氧o2 += 1;} else {// 高血氧o3 += 1;}// 计算血氧评分if (bloodONum >= xm) {//血氧正常double os1 = 100;bloodOxPressureScore.add(os1);} else if (bloodONum < xn) {double os2 = 0;bloodOxPressureScore.add(os2);} else if (xn <= bloodONum && bloodONum < xm) {// 每下降xr 就减一分double os3 = 100 - (xm - bloodONum) / xr;bloodOxPressureScore.add(os3);}}}// 正常  一级 二级 三级在一周内的次数String blood = sysUserExport.getBloodPressureDetectionResult();if (blood.contains("Error")) {Integer high = 0;Integer low = 0;Integer heartRate = 0;listSy.add(high);listDia.add(low);listHeartRate.add(heartRate);} else {if (blood.equals("0")) {Integer high = 0;Integer low = 0;Integer heartRate = 0;listSy.add(high);listDia.add(low);listHeartRate.add(heartRate);} else {// 定义收缩压和舒张压的起始和结束位置int systolicStart = blood.indexOf("收缩压:");int systolicEnd = blood.indexOf("mmhg", systolicStart);int diastolicStart = blood.indexOf("舒张压:");int diastolicEnd = blood.indexOf("mmhg", diastolicStart);int heartRateIndex = blood.indexOf("心率:");// 确保找到了"心率:"并且后面有空格,否则可能截取失败if (heartRateIndex != -1) {String heartRateStr = blood.substring(heartRateIndex + "心率:".length());int heartRate = Integer.parseInt(heartRateStr);listHeartRate.add(heartRate);}// 使用substring方法截取收缩压和舒张压的数值String systolicValue = blood.substring(systolicStart + "收缩压:".length(), systolicEnd);String diastolicValue = blood.substring(diastolicStart + "舒张压:".length(), diastolicEnd);Integer high = Integer.valueOf(systolicValue);Integer low = Integer.valueOf(diastolicValue);listSy.add(high);listDia.add(low);}}// 温度展示String temperature = sysUserExport.getTemperature();if (StringUtils.isEmpty(temperature)) {listTemperature.add(0.0);} else {double temperatureDouble = Double.parseDouble(temperature);listTemperature.add(temperatureDouble);// 检查体温是否在正常范围内if (temperatureDouble >= MIN_NORMAL && temperatureDouble <= MAX_NORMAL) {double t1 = 100;temperatureScore.add(t1);} else if (temperatureDouble < MIN_NORMAL) {// 体温低于正常范围下限double L = 100 - ((MIN_NORMAL - temperatureDouble) / PENALTY_PER_01);temperatureScore.add(L);} else {// 体温高于正常范围上限double U = 100 - ((temperatureDouble - MAX_NORMAL) / PENALTY_PER_01);temperatureScore.add(U);}}// 血压检测(未检测不进行统计)String booldScore = sysUserExport.getBloodPressureDetectionResult();if (booldScore.contains("Error")) {bloodPressureScore.add(0.0);} else {if (!booldScore.equals("0")) {int systolicStart = booldScore.indexOf("收缩压:");int systolicEnd = booldScore.indexOf("mmhg", systolicStart);int diastolicStart = booldScore.indexOf("舒张压:");int diastolicEnd = booldScore.indexOf("mmhg", diastolicStart);// 使用substring方法截取收缩压和舒张压的数值String systolicValue = booldScore.substring(systolicStart + "收缩压:".length(), systolicEnd);String diastolicValue = booldScore.substring(diastolicStart + "舒张压:".length(), diastolicEnd);Integer systolic = Integer.valueOf(systolicValue);Integer diastolic = Integer.valueOf(diastolicValue);if (systolic >= 140 || diastolic >= 90) {if (systolic >= 180 || diastolic >= 110) {// "3级高血压(重度)";double B1 = 0;bloodPressureScore.add(B1);} else if (systolic >= 160 || diastolic >= 100) {// "2级高血压(中度)";double B2 = 60;bloodPressureScore.add(B2);} else {// "1级高血压(轻度)";double B3 = 80;bloodPressureScore.add(B3);}} else if (systolic >= 130 || diastolic >= 85) {//  "正常值偏高";double B4 = 90;bloodPressureScore.add(B4);} else if (systolic >= 90 || diastolic >= 60) {// "正常血压";double B5 = 100;bloodPressureScore.add(B5);} else {// "低血压";double B6 = 0;bloodPressureScore.add(B6);}}}}UserIndex userIndex = userIndexService.selectUserIndexByUserIdAllInfo(l);if (userIndex != null) {// 个人信息nickName = userIndex.getNickName();jobNumber = userIndex.getJobNumber();deptName = userIndex.getDeptName();roleName = userIndex.getRoleName();phoneNumber = userIndex.getPhonenumber();downloadPath = userIndex.getDownloadPath();sex = userIndex.getSex();}// 将统计结果添加到list中listA.add(a1);listA.add(a2);listA.add(a3);listA.add(a4);listBloodOx.add(o1);listBloodOx.add(o2);listBloodOx.add(o3);listUserInfo.add(nickName);listUserInfo.add(jobNumber);listUserInfo.add(deptName);listUserInfo.add(roleName);listUserInfo.add(phoneNumber);listUserInfo.add(sex);listUserInfo.add(downloadPath);// 计算血压的评分double sum = 0.0;for (double bps : bloodPressureScore) {// 将每个元素的值累加到总和变量中sum += bps;}// 计算平均值String formattedNumberBlood = "0";if (bloodPressureScore.size() > 0) {double bloodAverage = sum / bloodPressureScore.size();DecimalFormat decimalFormatBlood = new DecimalFormat("#.#");formattedNumberBlood = decimalFormatBlood.format(bloodAverage);}// 计算酒精的评分double sumA = 0.0;for (double bps : alcoholPressureScore) {// 将每个元素的值累加到总和变量中sumA += bps;}// 计算平均值String formattedNumberAlcoho = "0";if (alcoholPressureScore.size() > 0) {double bloodAAverage = sumA / alcoholPressureScore.size();DecimalFormat decimalFormat = new DecimalFormat("#.#");formattedNumberAlcoho = decimalFormat.format(bloodAAverage);}// 计算血氧的评分double sumBO = 0.0;for (double bps : bloodOxPressureScore) {// 将每个元素的值累加到总和变量中sumBO += bps;}// 计算平均值String formattedNumberBO = "0";if (bloodOxPressureScore.size() > 0) {double bloodBOverage = sumBO / bloodOxPressureScore.size();DecimalFormat decimalFormatBO = new DecimalFormat("#.#");formattedNumberBO = decimalFormatBO.format(bloodBOverage);}// 计算温度的评分double sumT = 0.0;for (double bps : temperatureScore) {// 将每个元素的值累加到总和变量中sumT += bps;}// 计算平均值String formattedNumberTemp = "0";if (temperatureScore.size() > 0) {double Tempverage = sumT / temperatureScore.size();DecimalFormat decimalFormatTemp = new DecimalFormat("#.#");formattedNumberTemp = decimalFormatTemp.format(Tempverage);}mapA.put("alcohoMap", listA);mapA.put("bloodOxygenMap", listBloodOx);mapA.put("bloodPressureSyMap", listSy);mapA.put("bloodPressureDiaMap", listDia);mapA.put("bloodPressureHeartRateMap", listHeartRate);mapA.put("temperatureMap", listTemperature);mapA.put("listMap", sysUserExports);mapA.put("listUserInfo", listUserInfo);mapA.put("bloodPressureScore", formattedNumberBlood);mapA.put("alcohoScore", formattedNumberAlcoho);mapA.put("bloodOXScore", formattedNumberBO);mapA.put("temperatureScore", formattedNumberTemp);// 实时获取破值插入PDF中formattedNumberBloodPDF = formattedNumberBlood;formattedNumberAlcohoPDF = formattedNumberAlcoho;formattedNumberBOPDF = formattedNumberBO;formattedNumberTempPDF = formattedNumberTemp;// 计算综合评分Map<String, Object> mapB = new HashMap<>();mapB.put("bloodPressureScore", formattedNumberBlood); // 血压评分mapB.put("alcohoScore", formattedNumberAlcoho);  // 酒精评分mapB.put("bloodOXScore", formattedNumberBO);    // 血氧评分mapB.put("temperatureScore", formattedNumberTemp);  // 温度评分String overallScore = calculateOverallScore(mapB);mapA.put("overallScore", overallScore);  // 综合评分// 获取当前日期LocalDate today = LocalDate.now();// 创建一个列表来存储最近12个月的日期List<LocalDate> recentMonths = new ArrayList<>();// 遍历12个月for (int i = 0; i < 12; i++) {// 获取当前月份的第一天LocalDate firstDayOfCurrentMonth = today.with(TemporalAdjusters.firstDayOfMonth());// 将其添加到列表中recentMonths.add(firstDayOfCurrentMonth);// 减去一个月today = today.minusMonths(1);}List<SysUserExport> sysUserExportAll = new ArrayList<>();// 输出最近12个月的日期for (LocalDate date : recentMonths) {// 计算最近12个月的评分map.put("year", date.getYear()); // TODO 今年map.put("month", date.getMonthValue()); // TODO 当月List<SysUserExport> monthlyData = sysUserInfoRecordService.selectUserIndexByUserIdAllInfo(map); // 输入每个月的参数sysUserExportAll.addAll(monthlyData); // 将每个月的数据添加到集合中}List<Integer> overallYearScore = calculateYearlyScores(sysUserExportAll);mapA.put("overallYearScore", overallYearScore);  // 评分折线图return AjaxResult.success(mapA);}/*** 用户画像 (当月)*/@PostMapping("/monthUserDetectionDetail")public AjaxResult monthUserDetectionDetail(@RequestBody Map<String, Object> map) {Object userId = map.get("userId");long l = Long.valueOf(String.valueOf(userId));map.remove("pageNum");map.remove("pageSize");List<UserScoreRule> userScoreRules = userScoreRuleService.selectUserScoreRuleList(null);UserScoreRule userScoreRule = userScoreRules.get(0);ax = userScoreRule.getAX();ay = userScoreRule.getAY();ta = userScoreRule.getTA();tb = userScoreRule.getTB();xm = userScoreRule.getXM();xn = userScoreRule.getXN();ar = userScoreRule.getAR();ars = userScoreRule.getARS();tr = userScoreRule.getTR();trs = userScoreRule.getTRS();xr = userScoreRule.getXR();xrs = userScoreRule.getXRS();Map<String, Object> mapA = new HashMap<>();Integer a1 = 0; // 滴酒不沾Integer a2 = 0; // 轻度Integer a3 = 0; // 中度Integer a4 = 0; // 重度Integer o1 = 0; // 正常Integer o2 = 0; // 低血氧Integer o3 = 0; // 高血氧String nickName = "";String sex = "";String phoneNumber = "";String deptName = "";String jobNumber = "";String roleName = "";String downloadPath = "";// 温度评分double MIN_NORMAL = ta; // 正常体温的最小值double MAX_NORMAL = tb; // 正常体温的最大值double PENALTY_PER_01 = trs;   // 每0.1度的扣分值double MAX_PASS_ALCOHOL = ax; // 通过的酒精检测值上限double PENALTY_PER_MG = ars;List<Integer> listA = new ArrayList<>();List<Integer> listSy = new ArrayList<>();List<Integer> listDia = new ArrayList<>();List<Integer> listHeartRate = new ArrayList<>();List<String> listUserInfo = new ArrayList<>();List<Integer> listBloodOx = new ArrayList<>();List<Double> listTemperature = new ArrayList<>();List<Double> bloodPressureScore = new ArrayList<>();List<Double> alcoholPressureScore = new ArrayList<>();List<Double> bloodOxPressureScore = new ArrayList<>();List<Double> temperatureScore = new ArrayList<>();List<SysUserExport> sysUserExports = sysUserInfoRecordService.monthUserDetectionDetail(map);for (SysUserExport sysUserExport : sysUserExports) {// 计算出这一周,滴酒未沾、轻度、 中度、 重度的次数 0、 <20、  >=20、  >80String alcoholDetectionResult = sysUserExport.getAlcoholDetectionResult();if (!alcoholDetectionResult.equals("0")) { // 为0的数据如何进行处理alcoholDetectionResult = alcoholDetectionResult.replace("测酒结果:", "");String alcoholValue = alcoholDetectionResult.substring(0, alcoholDetectionResult.indexOf("mg"));double alcoholNumber = Double.parseDouble(alcoholValue);if (alcoholNumber == 0) {a1 += 1;}if (alcoholNumber < 20 && alcoholNumber > 0) {a2 += 1;}if (alcoholNumber >= 20 && alcoholNumber < 80) {a3 += 1;}if (alcoholNumber >= 80) {a4 += 1;}// 计算酒精评分if (alcoholNumber < MAX_PASS_ALCOHOL) { // 酒精检测值低于20mg/100ml// 计算扣分double as1 = 100;alcoholPressureScore.add(as1);} else {// 酒精检测值高于20mg/100ml,分数依次减double penalty = (alcoholNumber - MAX_PASS_ALCOHOL) * PENALTY_PER_MG;double as2 = 100 - penalty;alcoholPressureScore.add(as2);}}// 计算出这一周 血氧 >=95正常   < 95异常String bloodO = sysUserExport.getBloodOxygenDetectionResult();if (!bloodO.equals("0")) {String[] parts = bloodO.split("血氧饱和度:");if (parts.length > 1) {String saturation = parts[1].split("%")[0]; // 分割百分号并取第一部分int bloodONum = Integer.parseInt(saturation);if (bloodONum >= 95 && bloodONum < 100) {//血氧正常o1 += 1;} else if (bloodONum < 95) {// 低血氧o2 += 1;} else {// 高血氧o3 += 1;}// 计算血氧的评分if (bloodONum >= xm) {//血氧正常double os1 = 100;bloodOxPressureScore.add(os1);} else if (bloodONum < xn) {double os2 = 0;bloodOxPressureScore.add(os2);} else if (xn <= bloodONum && bloodONum < xm) {// 每下降0.1 就减一分double os3 = 100 - (xm - bloodONum) * 10;bloodOxPressureScore.add(os3);}}}// 正常  一级 二级 三级在一周内的次数String blood = sysUserExport.getBloodPressureDetectionResult();if (blood.contains("Error")) {Integer high = 0;Integer low = 0;Integer heartRate = 0;listSy.add(high);listDia.add(low);listHeartRate.add(heartRate);} else {if (blood.equals("0")) {Integer high = 0;Integer low = 0;Integer heartRate = 0;listSy.add(high);listDia.add(low);listHeartRate.add(heartRate);} else {// 定义收缩压和舒张压的起始和结束位置int systolicStart = blood.indexOf("收缩压:");int systolicEnd = blood.indexOf("mmhg", systolicStart);int diastolicStart = blood.indexOf("舒张压:");int diastolicEnd = blood.indexOf("mmhg", diastolicStart);int heartRateIndex = blood.indexOf("心率:");// 确保找到了"心率:"并且后面有空格,否则可能截取失败if (heartRateIndex != -1) {String heartRateStr = blood.substring(heartRateIndex + "心率:".length());int heartRate = Integer.parseInt(heartRateStr);listHeartRate.add(heartRate);}// 使用substring方法截取收缩压和舒张压的数值String systolicValue = blood.substring(systolicStart + "收缩压:".length(), systolicEnd);String diastolicValue = blood.substring(diastolicStart + "舒张压:".length(), diastolicEnd);Integer high = Integer.valueOf(systolicValue);Integer low = Integer.valueOf(diastolicValue);listSy.add(high);listDia.add(low);}}// 温度展示String temperature = sysUserExport.getTemperature();if (StringUtils.isEmpty(temperature)) {listTemperature.add(0.0);} else {double temperatureDouble = Double.parseDouble(temperature);listTemperature.add(temperatureDouble);// 检查体温是否在正常范围内if (temperatureDouble >= MIN_NORMAL && temperatureDouble <= MAX_NORMAL) {// 计算体温偏离正常范围的程度,并计算扣分double deviation = Math.max(Math.abs(temperatureDouble - MIN_NORMAL), Math.abs(temperatureDouble - MAX_NORMAL));int penalty = (int) (deviation * 10 / PENALTY_PER_01); // 每0.1度扣4分,所以乘以10double t1 = 100 - penalty;temperatureScore.add(t1);} else {// 体温不在正常范围内,不及格double t2 = 0;temperatureScore.add(t2);}}// 综合评分// 血压检测(未检测不进行统计)String booldScore = sysUserExport.getBloodPressureDetectionResult();if (booldScore.contains("Error")) {bloodPressureScore.add(0.0);} else {if (!booldScore.equals("0")) {int systolicStart = booldScore.indexOf("收缩压:");int systolicEnd = booldScore.indexOf("mmhg", systolicStart);int diastolicStart = booldScore.indexOf("舒张压:");int diastolicEnd = booldScore.indexOf("mmhg", diastolicStart);// 使用substring方法截取收缩压和舒张压的数值String systolicValue = booldScore.substring(systolicStart + "收缩压:".length(), systolicEnd);String diastolicValue = booldScore.substring(diastolicStart + "舒张压:".length(), diastolicEnd);Integer systolic = Integer.valueOf(systolicValue);Integer diastolic = Integer.valueOf(diastolicValue);if (systolic >= 140 || diastolic >= 90) {if (systolic >= 180 || diastolic >= 110) {// "3级高血压(重度)";double B1 = 0;bloodPressureScore.add(B1);} else if (systolic >= 160 || diastolic >= 100) {// "2级高血压(中度)";double B2 = 60;bloodPressureScore.add(B2);} else {// "1级高血压(轻度)";double B3 = 80;bloodPressureScore.add(B3);}} else if (systolic >= 130 || diastolic >= 85) {//  "正常值偏高";double B4 = 90;bloodPressureScore.add(B4);} else if (systolic >= 90 || diastolic >= 60) {// "正常血压";double B5 = 100;bloodPressureScore.add(B5);} else {// "低血压";double B6 = 0;bloodPressureScore.add(B6);}}}}UserIndex userIndex = userIndexService.selectUserIndexByUserIdAllInfo(l);if (userIndex != null) {// 个人信息nickName = userIndex.getNickName();jobNumber = userIndex.getJobNumber();deptName = userIndex.getDeptName();roleName = userIndex.getRoleName();phoneNumber = userIndex.getPhonenumber();downloadPath = userIndex.getDownloadPath();sex = userIndex.getSex();}// 将统计结果添加到list中listA.add(a1);listA.add(a2);listA.add(a3);listA.add(a4);listBloodOx.add(o1);listBloodOx.add(o2);listBloodOx.add(o3);listUserInfo.add(nickName);listUserInfo.add(jobNumber);listUserInfo.add(deptName);listUserInfo.add(roleName);listUserInfo.add(phoneNumber);listUserInfo.add(sex);listUserInfo.add(downloadPath);// 计算血压的评分double sum = 0.0;for (double bps : bloodPressureScore) {// 将每个元素的值累加到总和变量中sum += bps;}// 计算平均值String formattedNumberBlood = "0";if (bloodPressureScore.size() > 0) {double bloodAverage = sum / bloodPressureScore.size();DecimalFormat decimalFormatBlood = new DecimalFormat("#.#");formattedNumberBlood = decimalFormatBlood.format(bloodAverage);}// 计算酒精的评分double sumA = 0.0;for (double bps : alcoholPressureScore) {// 将每个元素的值累加到总和变量中sumA += bps;}// 计算平均值String formattedNumberAlcoho = "0";if (alcoholPressureScore.size() > 0) {double bloodAAverage = sumA / alcoholPressureScore.size();DecimalFormat decimalFormat = new DecimalFormat("#.#");formattedNumberAlcoho = decimalFormat.format(bloodAAverage);}// 计算血氧的评分double sumBO = 0.0;for (double bps : bloodOxPressureScore) {// 将每个元素的值累加到总和变量中sumBO += bps;}// 计算平均值String formattedNumberBO = "0";if (bloodOxPressureScore.size() > 0) {double bloodBOverage = sumBO / bloodOxPressureScore.size();DecimalFormat decimalFormatBO = new DecimalFormat("#.#");formattedNumberBO = decimalFormatBO.format(bloodBOverage);}// 计算温度的评分double sumT = 0.0;for (double bps : temperatureScore) {// 将每个元素的值累加到总和变量中sumT += bps;}// 计算平均值String formattedNumberTemp = "0";if (temperatureScore.size() > 0) {double Tempverage = sumT / temperatureScore.size();DecimalFormat decimalFormatTemp = new DecimalFormat("#.#");formattedNumberTemp = decimalFormatTemp.format(Tempverage);}mapA.put("alcohoMap", listA);mapA.put("bloodOxygenMap", listBloodOx);mapA.put("bloodPressureSyMap", listSy);mapA.put("bloodPressureDiaMap", listDia);mapA.put("bloodPressureHeartRateMap", listHeartRate);mapA.put("temperatureMap", listTemperature);mapA.put("listMap", sysUserExports);mapA.put("listUserInfo", listUserInfo);mapA.put("bloodPressureScore", formattedNumberBlood);mapA.put("alcohoScore", formattedNumberAlcoho);mapA.put("bloodOXScore", formattedNumberBO);mapA.put("temperatureScore", formattedNumberTemp);formattedNumberBloodPDF = formattedNumberBlood;formattedNumberAlcohoPDF = formattedNumberAlcoho;formattedNumberBOPDF = formattedNumberBO;formattedNumberTempPDF = formattedNumberTemp;// 计算综合评分Map<String, Object> mapB = new HashMap<>();mapB.put("bloodPressureScore", formattedNumberBlood); // 血压评分mapB.put("alcohoScore", formattedNumberAlcoho);  // 酒精评分mapB.put("bloodOXScore", formattedNumberBO);    // 血氧评分mapB.put("temperatureScore", formattedNumberTemp);  // 温度评分String overallScore = calculateOverallScore(mapB);mapA.put("overallScore", overallScore);  // 综合评分// 获取当前日期LocalDate today = LocalDate.now();// 创建一个列表来存储最近12个月的日期List<LocalDate> recentMonths = new ArrayList<>();// 遍历12个月for (int i = 0; i < 12; i++) {// 获取当前月份的第一天LocalDate firstDayOfCurrentMonth = today.with(TemporalAdjusters.firstDayOfMonth());// 将其添加到列表中recentMonths.add(firstDayOfCurrentMonth);// 减去一个月today = today.minusMonths(1);}List<SysUserExport> sysUserExportAll = new ArrayList<>();// 输出最近12个月的日期for (LocalDate date : recentMonths) {// 计算最近12个月的评分map.put("year", date.getYear()); // TODO 今年map.put("month", date.getMonthValue()); // TODO 当月List<SysUserExport> monthlyData = sysUserInfoRecordService.selectUserIndexByUserIdAllInfo(map); // 输入每个月的参数sysUserExportAll.addAll(monthlyData); // 将每个月的数据添加到集合中}List<Integer> overallYearScore = calculateYearlyScores(sysUserExportAll);mapA.put("overallYearScore", overallYearScore);  // 评分折线图return AjaxResult.success(mapA);}// 计算过去12个月的评分数据private List<Integer> calculateYearlyScores(List<SysUserExport> sysUserExportAll) {List<Integer> overallYearScore = new ArrayList<>();// 初始化12个月的评分数据,假设每个月的评分初始值为0for (int i = 0; i < 12; i++) {overallYearScore.add(0);}List<Double> bloodPressureScore = new ArrayList<>();List<Double> alcoholPressureScore = new ArrayList<>();List<Double> bloodOxPressureScore = new ArrayList<>();List<Double> temperatureScore = new ArrayList<>();// 温度变量double MIN_NORMAL = ta; // 正常体温的最小值double MAX_NORMAL = tb; // 正常体温的最大值double PENALTY_PER_01 = trs;   // 每0.1度的扣分值double MAX_PASS_ALCOHOL = ax; // 通过的酒精检测值上限double PENALTY_PER_MG = ars;// 遍历用户信息列表,根据createTime的值更新对应月份的评分数据Integer overallScoreInteger = 0;// 初始化当前月份的评分统计int currentMonthScore = 0;// 初始化当前月份int currentMonth = -1;int month = 0;// 如果是同一个月,累加评分String formattedNumberTemp = "0";String formattedNumberBO = "0";String formattedNumberAlcoho = "0";String formattedNumberBlood = "0";if (sysUserExportAll.size() != 0) {for (SysUserExport sysUserExport : sysUserExportAll) {// 假设 createTime 是一个日期格式的字符串,例如 "2023-01-01"Date createTime = sysUserExport.getCreateTime(); // 目前还是所有的数据进行计算平均值,而不是某月// 将 Date 对象转换为字符串格式SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM");String monthYearStr = dateFormat.format(createTime);// 解析字符串获取月份month = Integer.parseInt(monthYearStr.substring(5));if (month != currentMonth) {if (currentMonth != -1) {}currentMonth = month;String alcoholDetectionResult = sysUserExport.getAlcoholDetectionResult();if (alcoholDetectionResult != null) {alcoholDetectionResult = alcoholDetectionResult.replace("测酒结果:", "");String alcoholValue = alcoholDetectionResult.substring(0, alcoholDetectionResult.indexOf("mg"));double alcoholNumber = Double.parseDouble(alcoholValue);// 计算酒精评分if (alcoholNumber < MAX_PASS_ALCOHOL) { // 酒精检测值低于20mg/100ml// 计算扣分double as1 = 100;alcoholPressureScore.add(as1);} else {// 酒精检测值高于20mg/100ml,分数依次减double penalty = (alcoholNumber - MAX_PASS_ALCOHOL) * PENALTY_PER_MG;double as2 = 100 - penalty;alcoholPressureScore.add(as2);}}// 计算血压评分String booldScore = sysUserExport.getBloodPressureDetectionResult();if (StringUtils.isNotEmpty(booldScore)) {if (booldScore.contains("Error")) {bloodPressureScore.add(0.0);} else {int systolicStart = booldScore.indexOf("收缩压:");int systolicEnd = booldScore.indexOf("mmhg", systolicStart);int diastolicStart = booldScore.indexOf("舒张压:");int diastolicEnd = booldScore.indexOf("mmhg", diastolicStart);// 使用substring方法截取收缩压和舒张压的数值String systolicValue = booldScore.substring(systolicStart + "收缩压:".length(), systolicEnd);String diastolicValue = booldScore.substring(diastolicStart + "舒张压:".length(), diastolicEnd);Integer systolic = Integer.valueOf(systolicValue);Integer diastolic = Integer.valueOf(diastolicValue);if (systolic >= 140 || diastolic >= 90) {if (systolic >= 180 || diastolic >= 110) {// "3级高血压(重度)";double B1 = 0;bloodPressureScore.add(B1);} else if (systolic >= 160 || diastolic >= 100) {// "2级高血压(中度)";double B2 = 60;bloodPressureScore.add(B2);} else {// "1级高血压(轻度)";double B3 = 80;bloodPressureScore.add(B3);}} else if (systolic >= 130 || diastolic >= 85) {//  "正常值偏高";double B4 = 90;bloodPressureScore.add(B4);} else if (systolic >= 90 || diastolic >= 60) {// "正常血压";double B5 = 100;bloodPressureScore.add(B5);} else {// "低血压";double B6 = 0;bloodPressureScore.add(B6);}}}// 检查体温是否在正常范围内String temperature = sysUserExport.getTemperature();//if (temperature != null || !temperature.equals("")) {if (StringUtils.isNotEmpty(temperature)) {double temperatureDouble = Double.parseDouble(temperature);if (temperatureDouble >= MIN_NORMAL && temperatureDouble <= MAX_NORMAL) {// 计算体温偏离正常范围的程度,并计算扣分double deviation = Math.max(Math.abs(temperatureDouble - MIN_NORMAL), Math.abs(temperatureDouble - MAX_NORMAL));int penalty = (int) (deviation * 10 / PENALTY_PER_01); // 每0.1度扣4分,所以乘以10double t1 = 100 - penalty;temperatureScore.add(t1);} else {// 体温不在正常范围内,不及格double t2 = 0;temperatureScore.add(t2);}}// 计算血氧的评分String bloodO = sysUserExport.getBloodOxygenDetectionResult();if (StringUtils.isNotEmpty(bloodO)) {String[] parts = bloodO.split("血氧饱和度:");if (parts.length > 1) {String saturation = parts[1].split("%")[0]; // 分割百分号并取第一部分int bloodONum = Integer.parseInt(saturation);Integer xm = this.xm;Integer xn = this.xn;if (bloodONum >= xm) {//血氧正常double os1 = 100;bloodOxPressureScore.add(os1);} else if (bloodONum < xn) {double os2 = 0;bloodOxPressureScore.add(os2);} else if (xn <= bloodONum && bloodONum < xm) {// 每下降0.1 就减一分double os3 = 100 - (xm - bloodONum) * 10;bloodOxPressureScore.add(os3);}}}// 计算血压的评分double sum = 0.0;for (double bps : bloodPressureScore) {// 将每个元素的值累加到总和变量中sum += bps;}// 计算平均值double bloodAverage = sum / bloodPressureScore.size();DecimalFormat decimalFormatBlood = new DecimalFormat("#.#");formattedNumberBlood = decimalFormatBlood.format(bloodAverage);// 计算酒精的评分double sumA = 0.0;for (double bps : alcoholPressureScore) {// 将每个元素的值累加到总和变量中sumA += bps;}// 计算平均值double bloodAAverage = sumA / alcoholPressureScore.size();DecimalFormat decimalFormat = new DecimalFormat("#.#");formattedNumberAlcoho = decimalFormat.format(bloodAAverage);// 计算血氧的评分double sumBO = 0.0;for (double bps : bloodOxPressureScore) {// 将每个元素的值累加到总和变量中sumBO += bps;}// 计算平均值if (bloodOxPressureScore.size() > 0) {double bloodBOverage = sumBO / bloodOxPressureScore.size();DecimalFormat decimalFormatBO = new DecimalFormat("#.#");formattedNumberBO = decimalFormatBO.format(bloodBOverage);}// 计算温度的评分double sumT = 0.0;for (double bps : temperatureScore) {// 将每个元素的值累加到总和变量中sumT += bps;}// 计算平均值double Tempverage = sumT / temperatureScore.size();DecimalFormat decimalFormatTemp = new DecimalFormat("#.#");formattedNumberTemp = decimalFormatTemp.format(Tempverage);// 计算每月的综合评分Map<String, Object> mapB = new HashMap<>();mapB.put("bloodPressureScore", formattedNumberBlood); // 血压评分mapB.put("alcohoScore", formattedNumberAlcoho);  // 酒精评分mapB.put("bloodOXScore", formattedNumberBO);    // 血氧评分mapB.put("temperatureScore", formattedNumberTemp);  // 温度评分String overallScore = calculateOverallScore(mapB);overallScoreInteger = Integer.valueOf(overallScore);overallYearScore.set(month, overallScoreInteger);} else {
//                    // 如果不是同一个月,将当前月的累加评分添加到结果列表中
//                    if (currentMonth != -1) {
//                        overallYearScore.set(month, overallScoreInteger);
//                    }
//                    // 重置当前月份的评分统计和当前月份
//                    //currentMonthScore = overallScoreInteger;
//                      currentMonth = month;//currentMonthScore = overallScoreInteger;//countForMonth++;}}// 循环结束后,确保存储最后一个月份的评分if (currentMonth != -1) {overallYearScore.set(month, overallScoreInteger);}}return overallYearScore;}
<select id="oneUserDetectionDetail" parameterType="Map"resultType="com.ruoyi.system.domain.export.SysUserExport">select a.click_date createTime,b.nickName,b.jobNumber,b.sex,b.phonenumber,b.roleName,b.deptName,b.downloadPath,ifnull(b.bloodOxygenDetectionResult,0) as bloodOxygenDetectionResult,ifnull(b.alcoholDetectionResult,0) as alcoholDetectionResult,ifnull(b.bloodPressureDetectionResult,0) as bloodPressureDetectionResult,ifnull(b.temperature,0) as temperaturefrom (SELECT curdate() as click_dateunion allSELECT date_sub(curdate(), interval 1 day) as click_dateunion allSELECT date_sub(curdate(), interval 2 day) as click_dateunion allSELECT date_sub(curdate(), interval 3 day) as click_dateunion allSELECT date_sub(curdate(), interval 4 day) as click_dateunion allSELECT date_sub(curdate(), interval 5 day) as click_dateunion allSELECT date_sub(curdate(), interval 6 day) as click_date) a left join (SELECTu.nick_name nickName, u.job_number jobNumber, u.cardkey,u.sex ,u.user_id userId,DATE_FORMAT(u.create_time,"%Y-%m-%d") as createtimes,u.alcohol_detection_result alcoholDetectionResult,u.phonenumber phonenumber,u.blood_pressure_detection_result bloodPressureDetectionResult,u.blood_oxygen_detection_result bloodOxygenDetectionResult,u.temperature,d.dept_name deptName, r.role_name roleName,p.download_path downloadPathfrom sys_user_index uleft join sys_dept d on u.dept_id = d.dept_idleft join sys_user_role ur on u.user_id = ur.user_idleft join sys_role r on r.role_id = ur.role_idLEFT JOIN sys_user_photo p ON u.job_number=p.job_numberwhere DATE(NOW()) = date(u.create_time) and u.user_id =#{userId} and u.del_flag = '0') b on a.click_date = b.createtimesORDER BY a.click_date desc</select><select id="selectUserIndexByUserIdAllInfo" parameterType="Map" resultType="com.ruoyi.system.domain.export.SysUserExport">SELECTu.nick_name, u.job_number,u.sex ,u.user_id userId,u.create_time createTime,u.alcohol_detection_result alcoholDetectionResult,u.phonenumber,u.blood_pressure_detection_result bloodPressureDetectionResult,u.blood_oxygen_detection_result bloodOxygenDetectionResult,u.temperature,d.dept_name deptName, r.role_name roleName,p.download_path downloadPathfrom sys_user_index uleft join sys_dept d on u.dept_id = d.dept_idleft join sys_user_role ur on u.user_id = ur.user_idleft join sys_role r on r.role_id = ur.role_idLEFT JOIN sys_user_photo p ON u.job_number=p.job_numberwhere  u.user_id =#{userId} and u.del_flag = '0'AND YEAR(u.create_time) = #{year}AND MONTH(u.create_time) = #{month};</select><select id="weekUserDetectionDetail" parameterType="Map"resultType="com.ruoyi.system.domain.export.SysUserExport">select a.click_date createTime,b.nickName,b.jobNumber,b.sex,b.phonenumber,b.roleName,b.deptName,b.downloadPath,ifnull(b.bloodOxygenDetectionResult,0) as bloodOxygenDetectionResult,ifnull(b.alcoholDetectionResult,0) as alcoholDetectionResult,ifnull(b.bloodPressureDetectionResult,0) as bloodPressureDetectionResult,ifnull(b.temperature,0) as temperaturefrom (SELECT curdate() as click_dateunion allSELECT date_sub(curdate(), interval 1 day) as click_dateunion allSELECT date_sub(curdate(), interval 2 day) as click_dateunion allSELECT date_sub(curdate(), interval 3 day) as click_dateunion allSELECT date_sub(curdate(), interval 4 day) as click_dateunion allSELECT date_sub(curdate(), interval 5 day) as click_dateunion allSELECT date_sub(curdate(), interval 6 day) as click_date) a left join (SELECTu.nick_name nickName, u.job_number jobNumber, u.cardkey,u.sex ,u.user_id userId,DATE_FORMAT(u.create_time,"%Y-%m-%d") as createtimes,u.alcohol_detection_result alcoholDetectionResult,u.phonenumber phonenumber,u.blood_pressure_detection_result bloodPressureDetectionResult,u.blood_oxygen_detection_result bloodOxygenDetectionResult,u.temperature,d.dept_name deptName, r.role_name roleName,p.download_path downloadPathfrom sys_user_index uleft join sys_dept d on u.dept_id = d.dept_idleft join sys_user_role ur on u.user_id = ur.user_idleft join sys_role r on r.role_id = ur.role_idLEFT JOIN sys_user_photo p ON u.job_number=p.job_numberwhere DATE_SUB(CURDATE(), INTERVAL 7 DAY) &lt;= date(u.create_time) and u.user_id =#{userId} and u.del_flag = '0') b on a.click_date = b.createtimesORDER BY a.click_date desc</select><select id="monthUserDetectionDetail" parameterType="Map"resultType="com.ruoyi.system.domain.export.SysUserExport">SELECTa.click_date AS createTime,b.nickName,b.jobNumber,b.sex,b.phonenumber,b.roleName,b.deptName,b.downloadPath,IFNULL(b.bloodOxygenDetectionResult, 0) AS bloodOxygenDetectionResult,IFNULL(b.alcoholDetectionResult, 0) AS alcoholDetectionResult,IFNULL(b.bloodPressureDetectionResult, 0) AS bloodPressureDetectionResult,IFNULL(b.temperature, 0) AS temperatureFROM (SELECT curdate() as click_dateUNION ALL SELECT date_sub(curdate(), interval 1 day) as click_dateUNION ALL SELECT date_sub(curdate(), interval 2 day) as click_dateUNION ALL SELECT date_sub(curdate(), interval 3 day) as click_dateUNION ALL SELECT date_sub(curdate(), interval 4 day) as click_dateUNION ALL SELECT date_sub(curdate(), interval 5 day) as click_dateUNION ALL SELECT date_sub(curdate(), interval 6 day) as click_dateUNION ALL SELECT date_sub(curdate(), interval 7 day) as click_dateUNION ALL SELECT date_sub(curdate(), interval 8 day) as click_dateUNION ALL SELECT date_sub(curdate(), interval 9 day) as click_dateUNION ALL SELECT date_sub(curdate(), interval 10 day) as click_dateUNION ALL SELECT date_sub(curdate(), interval 11 day) as click_dateUNION ALL SELECT date_sub(curdate(), interval 12 day) as click_dateUNION ALL SELECT date_sub(curdate(), interval 13 day) as click_dateUNION ALL SELECT date_sub(curdate(), interval 14 day) as click_dateUNION ALL SELECT date_sub(curdate(), interval 15 day) as click_dateUNION ALL SELECT date_sub(curdate(), interval 16 day) as click_dateUNION ALL SELECT date_sub(curdate(), interval 17 day) as click_dateUNION ALL SELECT date_sub(curdate(), interval 18 day) as click_dateUNION ALL SELECT date_sub(curdate(), interval 19 day) as click_dateUNION ALL SELECT date_sub(curdate(), interval 20 day) as click_dateUNION ALL SELECT date_sub(curdate(), interval 21 day) as click_dateUNION ALL SELECT date_sub(curdate(), interval 22 day) as click_dateUNION ALL SELECT date_sub(curdate(), interval 23 day) as click_dateUNION ALL SELECT date_sub(curdate(), interval 24 day) as click_dateUNION ALL SELECT date_sub(curdate(), interval 25 day) as click_dateUNION ALL SELECT date_sub(curdate(), interval 26 day) as click_dateUNION ALL SELECT date_sub(curdate(), interval 27 day) as click_dateUNION ALL SELECT date_sub(curdate(), interval 28 day) as click_dateUNION ALL SELECT date_sub(curdate(), interval 29 day) as click_date) aLEFT JOIN (SELECTu.nick_name AS nickName,u.job_number AS jobNumber,u.cardkey,u.sex AS sex,u.user_id AS userId,DATE_FORMAT(u.create_time,"%Y-%m-%d") AS createtimes,u.alcohol_detection_result AS alcoholDetectionResult,u.phonenumber AS phonenumber,u.blood_pressure_detection_result AS bloodPressureDetectionResult,u.blood_oxygen_detection_result AS bloodOxygenDetectionResult,u.temperature,d.dept_name AS deptName,r.role_name AS roleName,p.download_path AS downloadPathFROM sys_user_index uLEFT JOIN sys_dept d ON u.dept_id = d.dept_idLEFT JOIN sys_user_role ur ON u.user_id = ur.user_idLEFT JOIN sys_role r ON r.role_id = ur.role_idLEFT JOIN sys_user_photo p ON u.job_number=p.job_numberWHERE DATE_SUB(CURDATE(), INTERVAL 29 DAY) &lt;= DATE(u.create_time)AND u.user_id =#{userId}AND u.del_flag = '0') b ON a.click_date = b.createtimesORDER BY a.click_date DESC</select>
<template><div class="dashboard-editor-container"><div class="block"><div class="block-son"><el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"label-width="98px"><el-form-item label="驾驶员名称" prop="nickName"><el-input v-model="queryParams.nickName" placeholder="请输入驾驶员名称" clearable@keyup.enter.native="handleQuery" /></el-form-item><el-form-item class="button1"><!-- 今日按钮 --><el-button plain type="primary" size="mini" :class="{ 'selected': selectedPeriod === 'today' }" @click="handleJump('today')">今日</el-button><!-- 近一周按钮 --><el-button plain type="primary" size="mini"  :class="{ 'selected': selectedPeriod === 'week' }" @click="handleJump('week')">近一周</el-button><!-- 近一个月按钮 --><el-button plain type="primary" size="mini"  :class="{ 'selected': selectedPeriod === 'month' }" @click="handleJump('month')">近一个月</el-button></el-form-item><el-form-item label="检测时间"><el-date-pickerv-model="queryParams.date"type="date"placeholder="选择日期"></el-date-picker></el-form-item><!-- <el-form-item label="检测时间"><el-date-picker v-model="value3" type="daterange" align="right" unlink-panels range-separator="至"start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions"></el-date-picker></el-form-item> --><el-form-item><el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button><el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button></el-form-item><el-form-item class="container"><div class="but"><el-button type="primary" size="mini" @click="dialogVisible = true">评分规则</el-button><!-- <el-button type="primary" size="mini" @click="printpage" >导出PDF1</el-button> --><el-button type="primary" size="mini" @click="exportPDF"> 导出PDF </el-button></div></el-form-item></el-form></div></div><el-row :gutter="12"><el-col :xs="24" :sm="24" :lg="8"><div class="chart-wrapper1"><div class="chart-img"><el-popover placement="top-start" trigger="hover"><div class="row_reserve"><img class="big-img" :src="baseurl + `/system/` + src" style="width: 250px; height: 250px; margin-bottom: -4px" :onerror="defaultAct" /></div><div slot="reference"><img class="td-img" :src="baseurl + `/system/` + src"style="width: 150px; height: 150px; margin-bottom: -4px" :onerror="defaultAct" /></div></el-popover></div><div><div class="info-item"><strong>姓名:</strong><span style="color:#54a0ff;margin-left:10px">{{ userData.nickName }}</span></div><div class="info-item"><strong>性别:</strong><span style="color:#54a0ff;margin-left:10px">{{ userData.sex === '0' ? '男' : '女' }}</span></div><div class="info-item"><strong >手机号:</strong><span style="color:#54a0ff;margin-left:10px">{{ userData.phonenumber }}</span></div><div class="info-item"><strong>所属部门:</strong><span style="color:#54a0ff;margin-left:10px">{{ userData.deptName }}</span></div><div class="info-item"><strong>员工工号:</strong><span style="color:#54a0ff;margin-left:10px">{{ userData.jobNumber }}</span></div><div class="info-item"><strong>用户角色:</strong><span style="color:#54a0ff;margin-left:10px">{{ userData.roleName }}</span></div></div></div></el-col><el-col :xs="24" :sm="24" :lg="8"><div class="chart-wrapper2"><div class="score-section1"><div style="font-weight:bold; padding:20px 20px 10px">综合评分:{{overallScore}}</div></div><div style="display:flex"><div style="display:flex"><div class="score-section"><div>血压检测:{{bloodPressureScore}}</div></div><div class="score-section"><div>酒精检测:{{alcohoScore}}</div></div></div><div style="display:flex"><div class="score-section"><div>体温检测:{{temperatureScore}}</div></div><div class="score-section"><div>血氧检测:{{bloodOXScore}}</div></div></div></div><div class="health-status"><div style="font-weight:bold;margin:20px 20px 0px">健康状况</div><div style="display:flex"><div class="status-item"><div>血压</div><!-- <div class="stars">★★★★★</div> --><div class="score"><!--循序生成五星,原理是通过给span绑定类名设置星星背景图--><span class="star-item" v-for="star in starScore1" :class="star"></span><span>{{tempBlood.toFixed(1)}}</span></div></div><div class="status-item"><div>酒精</div><div class="score"><!--循序生成五星,原理是通过给span绑定类名设置星星背景图--><span class="star-item" v-for="star in starScore2" :class="star"></span><span>{{tempAlcoho.toFixed(1)}}</span></div></div></div><div style="display:flex"><div class="status-item"><div>血氧</div><div class="score"><!--循序生成五星,原理是通过给span绑定类名设置星星背景图--><span class="star-item" v-for="star in starScore3" :class="star"></span><span>{{tempBloodOX.toFixed(1)}}</span></div></div><div class="status-item"><div>体温</div><div class="score"><!--循序生成五星,原理是通过给span绑定类名设置星星背景图--><span class="star-item" v-for="star in starScore4" :class="star"></span><span>{{tempTempture.toFixed(1)}}</span></div></div></div></div></div></el-col><el-col :xs="24" :sm="24" :lg="8"><div class="chart-wrapper-z"><div style="font-weight:bold">历史趋势</div><div style="font-size:15px;color:#48dbfb;margin-bottom:-22px;margin-left:10px">评分</div><line-chart-x :chart-data="lineChartDataX"/></div></el-col></el-row><el-row :gutter="12"><el-col :xs="24" :sm="24" :lg="12"><div class="chart-wrapper"><div style="font-weight:bold">血压检测图表(mm/hg)</div><line-chart-o :chart-data="lineChartDataO" /></div></el-col><el-col :xs="24" :sm="24" :lg="12"><div class="chart-wrapper"><div style="font-weight:bold">酒精检测图表(mg/100ml)</div><bar-chart-o :chart-data="alcohoData"/></div></el-col></el-row><el-row :gutter="12"><el-col :xs="24" :sm="24" :lg="8"><div class="chart-wrapper"><div style="font-weight:bold">血氧饱和检测图表(%)</div><line-chart-ox :chart-data="bloodOXData"/></div></el-col><el-col :xs="24" :sm="24" :lg="8"><div class="chart-wrapper"><div style="font-weight:bold">体温检测图表(°C)</div><bar-chart :chart-data="tempertureData"/></div></el-col><el-col :xs="24" :sm="24" :lg="8"><div class="chart-wrapper"><div style="font-weight:bold">心率检测图表(bpm)</div><line-chart-or :chart-data="rateData"/></div></el-col></el-row><el-dialog title="" :visible.sync="dialogVisible" width="60%" height="80%" ><div class="rule-title-p"><div class="rule-title-all"> 综合评分规则:</div><span class="rule-description">每个检测项目满分100,60分及格。</span><spanclass="rule-description">每日综合评分为所有项目的总和/项目数。:只计算驾驶员做的项目,例如:如果驾驶员只做了体温检测和酒精检测,没有做血氧检测和血压检测,那么总和评分就是(体温得分+酒测得分)/2每周综合评分为该周每日的综合评分相加/日数。注:只计算驾驶员做了检测的日数。每月综合评分为该月每日的总和评分相加/日数。注:只计算驾驶员做了检测的日数。</span></div><div class="rule-title-p"><span class="rule-title">体温评分规则:</span><span class="rule-description">体温在a°-b°范围内,100,(a、b由客户设定)</span><span class="rule-description">体温每升高或降低c°,1,(c由客户设定)</span><span class="rule-description">如果司机体温在a°-b°之间,得分=100</span><span class="rule-description">如果司机体温低于a°,得分=100-[(-司机体温)/]</span><span class="rule-description">如果司机体温高于b°,得分=100-[(司机体温-)/]</span></div><div class="rule-title-p"><span class="rule-title"> 测酒评分规则:</span>  <span class="rule-description">酒精检测值低于x mg/100ml时,100,(x由客户设定)</span><span class="rule-description"> 酒精检测值每提高y mg/100ml,测酒评分减1,(y由客户设定)</span><span class="rule-description"> 司机测酒精评分=100-[(司机酒精检测值-x)/y]</span></div><div class="rule-title-p"><span class="rule-title"> 血氧饱和度评分规则:</span><span class="rule-description">血氧饱和度在m%以上时,100,(m由客户设定)</span><span class="rule-description">血氧饱和度每下降n%,血氧评分减1,(n由客户设定)</span><span class="rule-description">血氧饱和度评分=100-[(m-司机血氧饱和度)/n]</span></div><div class="rule-title-p"><span class="rule-title"> 血压评分规则:</span><span class="rule-description">100:收缩压<139和舒张压<89 </span><span class="rule-description">80:140<收缩压<15990<舒张压<99(一级轻度高血压) </span><span class="rule-description">60:160<收缩压<179100<舒张压<109(二级中度高血压) </span><span class="rule-description">60分以下:收缩压>=180或舒张压>=110(三级重度高血压)</span></div><span slot="footer" class="dialog-footer"><el-button @click="dialogVisible = false">关闭</el-button></span></el-dialog></div>
</template>
<script>
import pdf from 'vue-pdf'
import LineChart from './dashboard/LineChart'
import LineChartX from './dashboard/LineChartX'
import LineChartY from './dashboard/LineChartY'
import LineChartO from './dashboard/LineChartO'
import LineChartOr from './dashboard/LineChartOr'
import LineChartOx from './dashboard/LineChartOx'
import RaddarChart from './dashboard/RaddarChart'
import PieChart from './dashboard/PieChart'
import PieChartX from './dashboard/PieChartX'
import BarChart from './dashboard/BarChart'
import BarChartO from './dashboard/BarChartO'
import { oneUserDetectionDetail, exportUserIndexPDF } from "@/api/userIndex/userIndex";
import profile from "../assets/images/profile.jpg";
export default {name: 'Index',components: {pdf,LineChartX,LineChartY,LineChart,LineChartO,RaddarChart,PieChart,PieChartX,BarChart,LineChartOr,LineChartOx,BarChartO},data() {return {defaultAct: 'this.src="' + profile + '"',baseurl: process.env.VUE_APP_BASE_API,tempBlood:null,tempAlcoho:null,tempBloodOX:null,tempTempture:null,// 跟踪当前选中的按钮selectedPeriod: '', // 默认为空,表示没有按钮被选中bloodPressureScore:"",alcohoScore:"",bloodOXScore:"",temperatureScore:'',overallScore:"",RChartData:{a1:1,a2:3,a3:2,a4:0,},XChartData:{a1:4,a2:2,a3:1,},tempertureData:{temperture:[]},alcohoData:{temperture:[]},rateData:{heartRate:[]},bloodOXData:{systolicData: [],},lineChartDataX: {yearlyRateData: [],  },lineChartDataO: {systolicData: [],diastolicData: []},dialogVisible: false,value3: '',pickerOptions: {shortcuts: [{text: '最近一周',onClick(picker) {const end = new Date();const start = new Date();start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);picker.$emit('pick', [start, end]);}}, {text: '最近一个月',onClick(picker) {const end = new Date();const start = new Date();start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);picker.$emit('pick', [start, end]);}}]},userData: {phonenumber:'',sex:'',nickName:'',deptName:'',roleName:''}, // 个人信息 // 日期范围dateRange: [],src: 'https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png',userList: {},// 显示搜索条件showSearch: true,// 查询参数queryParams: {pageNum: 1,pageSize: 10,nickName: null,userId: null},}},created() {this.queryParams.userId = this.$route.params.userIdthis.getNowTime();this.getOneDayList();},computed:{starScore1(){let stars = [];   //定义一个空数组来存储类名let score = Math.floor(this.tempBlood * 2)/2;   //把评分转成整数或整数+0.5(如:4.7转成4.5,4.2转成4.0)let decimalScore = score%1 !== 0;   //取1的余数不等于0,说明有小数(显示半星)let integerScore = Math.floor(score);   //取整数分数(显示全星)for (let i=0; i<integerScore; i++){stars.push('on')      //整数分数为多少,就添加多少个全星}if (decimalScore){stars.push('half')    //存在小数分数,添加一个半星}while(stars.length<5){stars.push('off')     //如果星星数不满5颗,空星星填充}return stars},starScore2(){let stars = [];   //定义一个空数组来存储类名let score = Math.floor(this.tempAlcoho * 2)/2;   //把评分转成整数或整数+0.5(如:4.7转成4.5,4.2转成4.0)let decimalScore = score%1 !== 0;   //取1的余数不等于0,说明有小数(显示半星)let integerScore = Math.floor(score);   //取整数分数(显示全星)for (let i=0; i<integerScore; i++){stars.push('on')      //整数分数为多少,就添加多少个全星}if (decimalScore){stars.push('half')    //存在小数分数,添加一个半星}while(stars.length<5){stars.push('off')     //如果星星数不满5颗,空星星填充}return stars},starScore3(){let stars = [];   //定义一个空数组来存储类名let score = Math.floor(this.tempBloodOX * 2)/2;   //把评分转成整数或整数+0.5(如:4.7转成4.5,4.2转成4.0)let decimalScore = score%1 !== 0;   //取1的余数不等于0,说明有小数(显示半星)let integerScore = Math.floor(score);   //取整数分数(显示全星)for (let i=0; i<integerScore; i++){stars.push('on')      //整数分数为多少,就添加多少个全星}if (decimalScore){stars.push('half')    //存在小数分数,添加一个半星}while(stars.length<5){stars.push('off')     //如果星星数不满5颗,空星星填充}return stars},starScore4(){let stars = [];   //定义一个空数组来存储类名let score = Math.floor(this.tempTempture * 2)/2;   //把评分转成整数或整数+0.5(如:4.7转成4.5,4.2转成4.0)let decimalScore = score%1 !== 0;   //取1的余数不等于0,说明有小数(显示半星)let integerScore = Math.floor(score);   //取整数分数(显示全星)for (let i=0; i<integerScore; i++){stars.push('on')      //整数分数为多少,就添加多少个全星}if (decimalScore){stars.push('half')    //存在小数分数,添加一个半星}while(stars.length<5){stars.push('off')     //如果星星数不满5颗,空星星填充}return stars}},methods: {// 定义一个方法来处理按钮点击事件handleJump(timePeriod) {// 更新选中的按钮状态this.selectedPeriod = timePeriod;// 根据传入的参数决定跳转到哪个页面switch (timePeriod) {case 'today':// 跳转到今日页面的逻辑this.$router.push({ name: 'today'})break;case 'week':// 跳转到近一周页面的逻辑this.$router.push({ name: 'week'})break;case 'month':// 跳转到近一个月页面的逻辑this.$router.push({ name: 'month'})break;default:// 如果传入的参数不是预期的值,可以处理错误或默认行为console.error('未知的时间段');break;}},// 导出事件方法exportPDF() {exportUserIndexPDF(this.queryParams).then((res) => {//导出文件名var filename = new Date().getTime();//创建urllet url = window.URL.createObjectURL(res)//创建a标签 并设置属性let link = document.createElement('a')link.style.display = 'none'link.href = urllink.setAttribute('download', filename + '.pdf')//添加a标签document.body.appendChild(link)//执行下载link.click();//释放url对象URL.revokeObjectURL(link.href);//释放a标签document.body.removeChild(link);//this.download = false;});},printpage() {const printContent = document.querySelector('.dashboard-editor-container').innerHTML;const iframe = document.createElement('iframe');iframe.setAttribute('style', 'position: absolute; width: 0; height: 0;');document.body.appendChild(iframe);const iframeDoc = iframe.contentWindow.document;// 设置打印展示方式 - 横向展示iframeDoc.write('<style media="print">@page {size: landscape;}</style>');// 向 iframe 中注入 printContent 样式//iframeDoc.write(`<link href="./print.css" media="print" rel="stylesheet" />`);// 写入内容iframeDoc.write('<div>' + printContent + '</div>');setTimeout(function () {iframe.contentWindow?.print();document.body.removeChild(iframe);}, 50);},// 评分规则的弹窗handleClose(done) {this.$confirm('确认关闭?').then(_ => {done();}).catch(_ => { });},/** 查询用户数据 */getOneDayList() {this.loading = true;oneUserDetectionDetail(this.queryParams,).then((response) => {this.userWeekList = response.data;this.loading = false;console.log("userListWeek:");console.log(this.userWeekList);this.bloodOXData.systolicData = this.userWeekList.bloodOxygenMap,this.lineChartDataO.diastolicData = this.userWeekList.bloodPressureDiaMap;this.lineChartDataO.systolicData = this.userWeekList.bloodPressureSyMap;this.tempertureData.temperture = this.userWeekList.temperatureMap;this.userData.nickName = this.userWeekList.listUserInfo[0];this.userData.jobNumber = this.userWeekList.listUserInfo[1];this.userData.deptName = this.userWeekList.listUserInfo[2];this.userData.roleName = this.userWeekList.listUserInfo[3];this.userData.phonenumber = this.userWeekList.listUserInfo[4];this.userData.sex = this.userWeekList.listUserInfo[5];this.src = this.userWeekList.listUserInfo[6]; this.bloodPressureScore =this.userWeekList.bloodPressureScore;console.log(this.userWeekList.bloodPressureScore);this.alcohoScore =this.userWeekList.alcohoScore;console.log(this.userWeekList.alcohoScore);this.bloodOXScore =this.userWeekList.bloodOXScore;this.temperatureScore =this.userWeekList.temperatureScore;this.overallScore = this.userWeekList.overallScore;this.tempBlood = this.userWeekList.bloodPressureScore/100*5;this.tempAlcoho =this.userWeekList.alcohoScore/100*5;this.tempBloodOX =this.userWeekList.bloodOXScore/100*5;this.tempTempture = this.userWeekList.temperatureScore / 100.0 * 5;this.rateData.heartRate = this.userWeekList.bloodPressureHeartRateMap;this.lineChartDataX.yearlyRateData = this.userWeekList.overallYearScore;});},/** 搜索按钮操作 */handleQuery() {this.queryParams.pageNum = 1;this.getList();},/** 重置按钮操作 */resetQuery() {this.dateRange = [];this.resetForm("queryForm");this.handleQuery();},//获取区间时间getNowTime() {var now = new Date();var year = now.getFullYear(); //得到年份var month = now.getMonth(); //得到月份var date = now.getDate(); //得到日期month = month + 1;month = month.toString().padStart(2, "0");date = date.toString().padStart(2, "0");var defaultDate = `${year}-${month}-${date}`;this.queryParams.date = defaultDate;},}
}
</script><style lang="scss" scoped>
.status-item {display: flex;margin-left: 50px;margin-top: 10px;
}.stars {color: #10ac84;font-size: 18px;margin-left: 15px;
}.score-section {display: flex;margin-left: 40px;color: #00a8ff;font-size: 15px;
}.info-item {margin-left: 50px;font-size: 15px;margin-bottom: 3px;
}.chart-img {height: 180px;width: 150px;
}.dashboard-editor-container {padding: 12px;background-color: rgb(240, 242, 245);position: relative;.chart-wrapper {background: #fff;padding: 16px 16px 0;margin-bottom: 12px;}.chart-wrapper-z {margin-top: 20px;background: #fff;padding: 16px 16px 0;margin-bottom: 12px;height: 198px;}.chart-wrapper1 {margin-top: 20px;background: #fff;padding: 16px 16px 0;margin-bottom: 12px;height: 198px;display: flex;}.chart-wrapper2 {margin-top: 20px;background: #fff;margin-bottom: 12px;height: 198px;}}@media (max-width:1024px) {.chart-wrapper {padding: 8px;}
}.block {display: flex;background: #fff;height: 60px;align-items: center;/* 垂直居中 */}.block-son {margin-top: 20px;
}.container {//display: flex; /* 启用Flexbox布局 *///align-items: center; /* 垂直居中子元素 *///justify-content: flex-end; /* 将子元素推向右侧 */
}.but {margin-left: 200px;
}.rule-title-all {font-weight: bold;margin-top: 20px;font-size: 25px;
}/* 规则标题样式 */
.rule-title {font-weight: bold;margin-top: 20px;font-size: 20px;
}/* 规则描述样式 */
.rule-description {margin-left: 20px;font-size: 20px;
}.rule-title-p {margin-bottom: 10px;
}
.selected {background-color: #409EFF; /* 举例,将按钮背景色改为蓝色 */color: white; /* 白色文字 */
}
.score{display: flex;align-items: center;justify-content: center;.star-item{width: 20px;height: 20px;display: inline-block;margin: 0 5px;background: no-repeat;}.star-item.on{background: url("../assets/images/星实.png");  //全星background-size: contain;}.star-item.half{background: url("../assets/images/星半.png");  //半星background-size: contain;}.star-item.off{background: url("../assets/images/星空.png");   //空星星background-size: contain;}
}
</style>
<template><div class="dashboard-editor-container"><div class="block"><div class="block-son"><el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"label-width="98px"><el-form-item label="驾驶员名称" prop="nickName"><el-input v-model="queryParams.nickName" placeholder="请输入驾驶员名称" clearable@keyup.enter.native="handleQuery" /></el-form-item><el-form-item class="button1"><!-- 今日按钮 --><el-button plain type="primary" size="mini" :class="{ 'selected': selectedPeriod === 'today' }" @click="handleJump('today')">今日</el-button><!-- 近一周按钮 --><el-button plain type="primary" size="mini"  :class="{ 'selected': selectedPeriod === 'week' }" @click="handleJump('week')">近一周</el-button><!-- 近一个月按钮 --><el-button plain type="primary" size="mini"  :class="{ 'selected': selectedPeriod === 'month' }" @click="handleJump('month')">近一个月</el-button></el-form-item><!-- <el-form-item label="检测时间"><el-date-pickerv-model="dateRange"type="daterange"range-separator="至"start-placeholder="开始日期"end-placeholder="结束日期"></el-date-picker></el-form-item> --><el-form-item label="检测时间"><el-date-picker v-model="dateRange" type="daterange" align="right" unlink-panels range-separator="至"start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions"></el-date-picker></el-form-item><el-form-item><el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button><el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button></el-form-item><el-form-item class="container"><div class="but"><el-button type="primary" size="mini" @click="dialogVisible = true">评分规则</el-button><!-- <el-button type="primary" size="mini" @click="printpage" >导出PDF1</el-button> --><el-button type="primary" size="mini" @click="exportPDF"> 导出PDF </el-button></div></el-form-item></el-form></div></div><el-row :gutter="12"><el-col :xs="24" :sm="24" :lg="8"><div class="chart-wrapper1"><div class="chart-img"><el-popover placement="top-start" trigger="hover"><div class="row_reserve"><img class="big-img" :src="baseurl + `/system/` + src" style="width: 250px; height: 250px; margin-bottom: -4px" :onerror="defaultAct" /></div><div slot="reference"><img class="td-img" :src="baseurl + `/system/` + src"style="width: 150px; height: 150px; margin-bottom: -4px" :onerror="defaultAct" /></div></el-popover></div><div><div class="info-item"><strong>姓名:</strong><span style="color:#54a0ff;margin-left:10px">{{ userData.nickName }}</span></div><div class="info-item"><strong>性别:</strong><span style="color:#54a0ff;margin-left:10px">{{ userData.sex === '0' ? '男' : '女' }}</span></div><div class="info-item"><strong >手机号:</strong><span style="color:#54a0ff;margin-left:10px">{{ userData.phonenumber }}</span></div><div class="info-item"><strong>所属部门:</strong><span style="color:#54a0ff;margin-left:10px">{{ userData.deptName }}</span></div><div class="info-item"><strong>员工工号:</strong><span style="color:#54a0ff;margin-left:10px">{{ userData.jobNumber }}</span></div><div class="info-item"><strong>用户角色:</strong><span style="color:#54a0ff;margin-left:10px">{{ userData.roleName }}</span></div></div></div></el-col><el-col :xs="24" :sm="24" :lg="8"><div class="chart-wrapper2"><div class="score-section1"><div style="font-weight:bold; padding:20px 20px 10px">综合评分:{{overallScore}}</div></div><div style="display:flex"><div style="display:flex"><div class="score-section"><div>血压检测:{{bloodPressureScore}}</div></div><div class="score-section"><div>酒精检测:{{alcohoScore}}</div></div></div><div style="display:flex"><div class="score-section"><div>体温检测:{{temperatureScore}}</div></div><div class="score-section"><div>血氧检测:{{bloodOXScore}}</div></div></div></div><div class="health-status"><div style="font-weight:bold;margin:20px 20px 0px">健康状况</div><div style="display:flex"><div class="status-item"><div>血压</div><!-- <div class="stars">★★★★★</div> --><div class="score"><!--循序生成五星,原理是通过给span绑定类名设置星星背景图--><span class="star-item" v-for="star in starScore1" :class="star"></span><span>{{tempBlood.toFixed(1)}}</span></div></div><div class="status-item"><div>酒精</div><div class="score"><!--循序生成五星,原理是通过给span绑定类名设置星星背景图--><span class="star-item" v-for="star in starScore2" :class="star"></span><span>{{tempAlcoho.toFixed(1)}}</span></div></div></div><div style="display:flex"><div class="status-item"><div>血氧</div><div class="score"><!--循序生成五星,原理是通过给span绑定类名设置星星背景图--><span class="star-item" v-for="star in starScore3" :class="star"></span><span>{{tempBloodOX.toFixed(1)}}</span></div></div><div class="status-item"><div>体温</div><div class="score"><!--循序生成五星,原理是通过给span绑定类名设置星星背景图--><span class="star-item" v-for="star in starScore4" :class="star"></span><span>{{tempTempture.toFixed(1)}}</span></div></div></div></div></div></el-col><el-col :xs="24" :sm="24" :lg="8"><div class="chart-wrapper-z"><div style="font-weight:bold">历史趋势</div><div style="font-size:15px;color:#48dbfb;margin-bottom:-22px;margin-left:10px">评分</div><line-chart-x :chart-data="lineChartDataX"/></div></el-col></el-row><el-row :gutter="12"><el-col :xs="24" :sm="24" :lg="12"><div class="chart-wrapper"><div style="font-weight:bold">血压检测图表(mm/hg)</div><line-chart :chart-data="lineChartData" /></div></el-col><el-col :xs="24" :sm="24" :lg="12"><div class="chart-wrapper"><div style="font-weight:bold">酒精检测图表(mg/100ml)</div><pie-chart :chart-data="RChartData"/></div></el-col></el-row><el-row :gutter="12"><el-col :xs="24" :sm="24" :lg="8"><div class="chart-wrapper"><div style="font-weight:bold">心率检测图表(bpm)</div><line-chart-y :chart-data="rateData"/></div></el-col><el-col :xs="24" :sm="24" :lg="8"><div class="chart-wrapper"><div style="font-weight:bold">血氧饱和检测图表(%)</div><pie-chart-x :chart-data="XChartData"/></div></el-col><el-col :xs="24" :sm="24" :lg="8"><div class="chart-wrapper"><div style="font-weight:bold">体温检测图表(°C)</div><bar-chart :chart-data="tempertureData"/></div></el-col></el-row><el-dialog title="" :visible.sync="dialogVisible" width="60%" height="80%" ><div class="rule-title-p"><div class="rule-title-all"> 综合评分规则:</div><span class="rule-description">每个检测项目满分100,60分及格。</span><spanclass="rule-description">每日综合评分为所有项目的总和/项目数。:只计算驾驶员做的项目,例如:如果驾驶员只做了体温检测和酒精检测,没有做血氧检测和血压检测,那么总和评分就是(体温得分+酒测得分)/2每周综合评分为该周每日的综合评分相加/日数。注:只计算驾驶员做了检测的日数。每月综合评分为该月每日的总和评分相加/日数。注:只计算驾驶员做了检测的日数。</span></div><div class="rule-title-p"><span class="rule-title">体温评分规则:</span><span class="rule-description">体温在a°-b°范围内,100,(a、b由客户设定)</span><span class="rule-description">体温每升高或降低c°,1,(c由客户设定)</span><span class="rule-description">如果司机体温在a°-b°之间,得分=100</span><span class="rule-description">如果司机体温低于a°,得分=100-[(-司机体温)/]</span><span class="rule-description">如果司机体温高于b°,得分=100-[(司机体温-)/]</span></div><div class="rule-title-p"><span class="rule-title"> 测酒评分规则:</span>  <span class="rule-description">酒精检测值低于x mg/100ml时,100,(x由客户设定)</span><span class="rule-description"> 酒精检测值每提高y mg/100ml,测酒评分减1,(y由客户设定)</span><span class="rule-description"> 司机测酒精评分=100-[(司机酒精检测值-x)/y]</span></div><div class="rule-title-p"><span class="rule-title"> 血氧饱和度评分规则:</span><span class="rule-description">血氧饱和度在m%以上时,100,(m由客户设定)</span><span class="rule-description">血氧饱和度每下降n%,血氧评分减1,(n由客户设定)</span><span class="rule-description">血氧饱和度评分=100-[(m-司机血氧饱和度)/n]</span></div><div class="rule-title-p"><span class="rule-title"> 血压评分规则:</span><span class="rule-description">100:收缩压<139和舒张压<89 </span><span class="rule-description">80:140<收缩压<15990<舒张压<99(一级轻度高血压) </span><span class="rule-description">60:160<收缩压<179100<舒张压<109(二级中度高血压) </span><span class="rule-description">60分以下:收缩压>=180或舒张压>=110(三级重度高血压)</span></div><span slot="footer" class="dialog-footer"><el-button @click="dialogVisible = false">关闭</el-button></span></el-dialog></div>
</template>
<script>
import pdf from 'vue-pdf'
// import html2Canvas from 'html2canvas'
// import JsPDF from 'jspdf'
import LineChart from './dashboard/LineChart'
import LineChartX from './dashboard/LineChartX'
import LineChartY from './dashboard/LineChartY'
import RaddarChart from './dashboard/RaddarChart'
import PieChart from './dashboard/PieChart'
import PieChartX from './dashboard/PieChartX'
import BarChart from './dashboard/BarChart'
import { weekUserDetectionDetail, exportUserIndexPDF } from "@/api/userIndex/userIndex";
import profile from "../assets/images/profile.jpg";
export default {name: 'Index',components: {pdf,LineChartX,LineChartY,LineChart,RaddarChart,PieChart,PieChartX,BarChart,},data() {return {defaultAct: 'this.src="' + profile + '"',baseurl: process.env.VUE_APP_BASE_API,tempBlood:null,tempAlcoho:null,tempBloodOX:null,tempTempture:null,// 跟踪当前选中的按钮selectedPeriod: '', // 默认为空,表示没有按钮被选中bloodPressureScore:"",alcohoScore:"",bloodOXScore:"",temperatureScore:"",overallScore:"",RChartData:{a1:1,a2:3,a3:2,a4:0,},XChartData:{a1:4,a2:2,a3:1,},rateData:{heartRate:[]},tempertureData:{temperture:[]},lineChartDataX: {yearlyRateData: [],  },lineChartData: {systolicData: [],diastolicData: []},bloodPressureHeartRate:{temperture:[]},dialogVisible: false,value3: '',pickerOptions: {shortcuts: [{text: '最近一周',onClick(picker) {const end = new Date();const start = new Date();start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);picker.$emit('pick', [start, end]);}}, {text: '最近一个月',onClick(picker) {const end = new Date();const start = new Date();start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);picker.$emit('pick', [start, end]);}}]},userData: {phonenumber:'',sex:'',nickName:'',deptName:'',roleName:''}, // 个人信息 // 日期范围dateRange: [],src: '',userList: {},// 显示搜索条件showSearch: true,// 查询参数queryParams: {pageNum: 1,pageSize: 10,nickName: null,userId: null},}},created() {this.queryParams.userId = this.$route.params.userIdthis.getNowTime();this.getWeekList();},computed:{starScore1(){let stars = [];   //定义一个空数组来存储类名let score = Math.floor(this.tempBlood * 2)/2;   //把评分转成整数或整数+0.5(如:4.7转成4.5,4.2转成4.0)let decimalScore = score%1 !== 0;   //取1的余数不等于0,说明有小数(显示半星)let integerScore = Math.floor(score);   //取整数分数(显示全星)for (let i=0; i<integerScore; i++){stars.push('on')      //整数分数为多少,就添加多少个全星}if (decimalScore){stars.push('half')    //存在小数分数,添加一个半星}while(stars.length<5){stars.push('off')     //如果星星数不满5颗,空星星填充}return stars},starScore2(){let stars = [];   //定义一个空数组来存储类名let score = Math.floor(this.tempAlcoho * 2)/2;   //把评分转成整数或整数+0.5(如:4.7转成4.5,4.2转成4.0)let decimalScore = score%1 !== 0;   //取1的余数不等于0,说明有小数(显示半星)let integerScore = Math.floor(score);   //取整数分数(显示全星)for (let i=0; i<integerScore; i++){stars.push('on')      //整数分数为多少,就添加多少个全星}if (decimalScore){stars.push('half')    //存在小数分数,添加一个半星}while(stars.length<5){stars.push('off')     //如果星星数不满5颗,空星星填充}return stars},starScore3(){let stars = [];   //定义一个空数组来存储类名let score = Math.floor(this.tempBloodOX * 2)/2;   //把评分转成整数或整数+0.5(如:4.7转成4.5,4.2转成4.0)let decimalScore = score%1 !== 0;   //取1的余数不等于0,说明有小数(显示半星)let integerScore = Math.floor(score);   //取整数分数(显示全星)for (let i=0; i<integerScore; i++){stars.push('on')      //整数分数为多少,就添加多少个全星}if (decimalScore){stars.push('half')    //存在小数分数,添加一个半星}while(stars.length<5){stars.push('off')     //如果星星数不满5颗,空星星填充}return stars},starScore4(){let stars = [];   //定义一个空数组来存储类名let score = Math.floor(this.tempTempture * 2)/2;   //把评分转成整数或整数+0.5(如:4.7转成4.5,4.2转成4.0)let decimalScore = score%1 !== 0;   //取1的余数不等于0,说明有小数(显示半星)let integerScore = Math.floor(score);   //取整数分数(显示全星)for (let i=0; i<integerScore; i++){stars.push('on')      //整数分数为多少,就添加多少个全星}if (decimalScore){stars.push('half')    //存在小数分数,添加一个半星}while(stars.length<5){stars.push('off')     //如果星星数不满5颗,空星星填充}return stars}},methods: {// 定义一个方法来处理按钮点击事件handleJump(timePeriod) {// 更新选中的按钮状态this.selectedPeriod = timePeriod;console.log(timePeriod);// 根据传入的参数决定跳转到哪个页面switch (timePeriod) {case 'today':// 跳转到今日页面的逻辑this.$router.push({ name: 'today'})break;case 'week':// 跳转到近一周页面的逻辑this.$router.push({ name: 'week'})break;case 'month':// 跳转到近一个月页面的逻辑this.$router.push({ name: 'month'})break;default:// 如果传入的参数不是预期的值,可以处理错误或默认行为console.error('未知的时间段');break;}},// 导出事件方法exportPDF() {exportUserIndexPDF( this.addDateRange(this.queryParams, this.dateRange)).then((res) => {//导出文件名var filename = new Date().getTime();//创建urllet url = window.URL.createObjectURL(res)//创建a标签 并设置属性let link = document.createElement('a')link.style.display = 'none'link.href = urllink.setAttribute('download', filename + '.pdf')//添加a标签document.body.appendChild(link)//执行下载link.click();//释放url对象URL.revokeObjectURL(link.href);//释放a标签document.body.removeChild(link);//this.download = false;});},printpage() {const printContent = document.querySelector('.dashboard-editor-container').innerHTML;const iframe = document.createElement('iframe');iframe.setAttribute('style', 'position: absolute; width: 0; height: 0;');document.body.appendChild(iframe);const iframeDoc = iframe.contentWindow.document;// 设置打印展示方式 - 横向展示iframeDoc.write('<style media="print">@page {size: landscape;}</style>');// 向 iframe 中注入 printContent 样式//iframeDoc.write(`<link href="./print.css" media="print" rel="stylesheet" />`);// 写入内容iframeDoc.write('<div>' + printContent + '</div>');setTimeout(function () {iframe.contentWindow?.print();document.body.removeChild(iframe);}, 50);},// 评分规则的弹窗handleClose(done) {this.$confirm('确认关闭?').then(_ => {done();}).catch(_ => { });},/** 查询用户数据 */getWeekList() {this.loading = true;weekUserDetectionDetail(this.queryParams,).then((response) => {this.userWeekList = response.data;this.loading = false;console.log("userListWeek:");console.log(this.userWeekList);this.RChartData.a1 = this.userWeekList.alcohoMap[0];this.RChartData.a2 = this.userWeekList.alcohoMap[1];this.RChartData.a3 = this.userWeekList.alcohoMap[2];this.RChartData.a4 = this.userWeekList.alcohoMap[3];this.XChartData.a1 = this.userWeekList.bloodOxygenMap[0],this.XChartData.a2 = this.userWeekList.bloodOxygenMap[1],this.XChartData.a3 = this.userWeekList.bloodOxygenMap[2],this.lineChartData.diastolicData = this.userWeekList.bloodPressureDiaMap;this.lineChartData.systolicData = this.userWeekList.bloodPressureSyMap;this.tempertureData.temperture = this.userWeekList.temperatureMap;this.userData.nickName = this.userWeekList.listUserInfo[0];this.userData.jobNumber = this.userWeekList.listUserInfo[1];this.userData.deptName = this.userWeekList.listUserInfo[2];this.userData.roleName = this.userWeekList.listUserInfo[3];this.userData.phonenumber = this.userWeekList.listUserInfo[4];this.userData.sex = this.userWeekList.listUserInfo[5];this.src = this.userWeekList.listUserInfo[6]; this.bloodPressureScore =this.userWeekList.bloodPressureScore;this.alcohoScore =this.userWeekList.alcohoScore;this.bloodOXScore =this.userWeekList.bloodOXScore;this.temperatureScore =this.userWeekList.temperatureScore;this.overallScore = this.userWeekList.overallScore;this.tempBlood = this.userWeekList.bloodPressureScore/100*5;this.tempAlcoho =this.userWeekList.alcohoScore/100*5;this.tempBloodOX =this.userWeekList.bloodOXScore/100*5;this.tempTempture = this.userWeekList.temperatureScore / 100.0 * 5;this.bloodPressureHeartRate = this.userWeekList.bloodPressureHeartRateMap;this.rateData.heartRate = this.userWeekList.bloodPressureHeartRateMap;this.lineChartDataX.yearlyRateData = this.userWeekList.overallYearScore;});},/** 搜索按钮操作 */handleQuery() {this.queryParams.pageNum = 1;this.getList();},/** 重置按钮操作 */resetQuery() {this.dateRange = [];this.resetForm("queryForm");this.handleQuery();},//获取区间时间getNowTime() {var now = new Date();var year = now.getFullYear(); //得到年份var month = now.getMonth(); //得到月份var date = now.getDate(); //得到日期month = month + 1;month = month.toString().padStart(2, "0");date = date.toString().padStart(2, "0");var defaultDate = `${year}-${month}-${date}`;// 计算七天前的日期var oneWeekAgo = new Date(now);oneWeekAgo.setDate(now.getDate() - 7); // 从今天日期减去7天var yearAgo = oneWeekAgo.getFullYear();var monthAgo = (oneWeekAgo.getMonth() + 1).toString().padStart(2, "0");var dateAgo = oneWeekAgo.getDate().toString().padStart(2, "0");var sevenDaysAgo = `${yearAgo}-${monthAgo}-${dateAgo}`;this.dateRange = [sevenDaysAgo, defaultDate];},}
}
</script><style lang="scss" scoped>
.status-item {display: flex;margin-left: 50px;margin-top: 10px;
}.stars {color: #10ac84;font-size: 18px;margin-left: 15px;
}.score-section {display: flex;margin-left: 40px;color: #00a8ff;font-size: 15px;
}.info-item {margin-left: 50px;font-size: 15px;margin-bottom: 3px;
}.chart-img {height: 180px;width: 150px;
}.dashboard-editor-container {padding: 12px;background-color: rgb(240, 242, 245);position: relative;.chart-wrapper {background: #fff;padding: 16px 16px 0;margin-bottom: 12px;}.chart-wrapper-z {margin-top: 20px;background: #fff;padding: 16px 16px 0;margin-bottom: 12px;height: 198px;}.chart-wrapper1 {margin-top: 20px;background: #fff;padding: 16px 16px 0;margin-bottom: 12px;height: 198px;display: flex;}.chart-wrapper2 {margin-top: 20px;background: #fff;margin-bottom: 12px;height: 198px;}}@media (max-width:1024px) {.chart-wrapper {padding: 8px;}
}.block {display: flex;background: #fff;height: 60px;align-items: center;/* 垂直居中 */}.block-son {margin-top: 20px;
}.container {//display: flex; /* 启用Flexbox布局 *///align-items: center; /* 垂直居中子元素 *///justify-content: flex-end; /* 将子元素推向右侧 */
}.but {margin-left: 200px;
}.rule-title-all {font-weight: bold;margin-top: 20px;font-size: 25px;
}/* 规则标题样式 */
.rule-title {font-weight: bold;margin-top: 20px;font-size: 20px;
}/* 规则描述样式 */
.rule-description {margin-left: 20px;font-size: 20px;
}.rule-title-p {margin-bottom: 10px;
}
.selected {background-color: #409EFF; /* 举例,将按钮背景色改为蓝色 */color: white; /* 白色文字 */
}.score{display: flex;align-items: center;justify-content: center;.star-item{width: 20px;height: 20px;display: inline-block;margin: 0 5px;background: no-repeat;}.star-item.on{background: url("../assets/images/星实.png");  //全星background-size: contain;}.star-item.half{background: url("../assets/images/星半.png");  //半星background-size: contain;}.star-item.off{background: url("../assets/images/星空.png");   //空星星background-size: contain;}
}</style>
<template><div class="dashboard-editor-container"><div class="block"><div class="block-son"><el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"label-width="98px"><el-form-item label="驾驶员名称" prop="nickName"><el-input v-model="queryParams.nickName" placeholder="请输入驾驶员名称" clearable@keyup.enter.native="handleQuery" /></el-form-item><el-form-item class="button1"><!-- 今日按钮 --><el-button plain type="primary" size="mini" :class="{ 'selected': selectedPeriod === 'today' }" @click="handleJump('today')">今日</el-button><!-- 近一周按钮 --><el-button plain type="primary" size="mini"  :class="{ 'selected': selectedPeriod === 'week' }" @click="handleJump('week')">近一周</el-button><!-- 近一个月按钮 --><el-button plain type="primary" size="mini"  :class="{ 'selected': selectedPeriod === 'month' }" @click="handleJump('month')">近一个月</el-button></el-form-item><!-- <el-form-item label="检测时间"><el-date-pickerv-model="dateRange"type="daterange"range-separator="至"start-placeholder="开始日期"end-placeholder="结束日期"></el-date-picker></el-form-item> --><el-form-item label="检测时间"><el-date-picker v-model="dateRange" type="daterange" align="right" unlink-panels range-separator="至"start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="pickerOptions"></el-date-picker></el-form-item><el-form-item><el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button><el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button></el-form-item><el-form-item class="container"><div class="but"><el-button type="primary" size="mini" @click="dialogVisible = true">评分规则</el-button><!-- <el-button type="primary" size="mini" @click="printpage" >导出PDF</el-button> --><el-button type="primary" size="mini" @click="exportPDF"> 导出PDF </el-button></div></el-form-item></el-form></div></div><el-row :gutter="12"><el-col :xs="24" :sm="24" :lg="8"><div class="chart-wrapper1"><div class="chart-img"><el-popover placement="top-start" trigger="hover"><div class="row_reserve"><img class="big-img" :src="baseurl + `/system/` + src" style="width: 250px; height: 250px; margin-bottom: -4px" :onerror="defaultAct" /></div><div slot="reference"><img class="td-img" :src="baseurl + `/system/` + src"style="width: 150px; height: 150px; margin-bottom: -4px" :onerror="defaultAct" /></div></el-popover></div><div><div class="info-item"><strong>姓名:</strong><span style="color:#54a0ff;margin-left:10px">{{ userData.nickName }}</span></div><div class="info-item"><strong>性别:</strong><span style="color:#54a0ff;margin-left:10px">{{ userData.sex === '0' ? '男' : '女' }}</span></div><div class="info-item"><strong >手机号:</strong><span style="color:#54a0ff;margin-left:10px">{{ userData.phonenumber }}</span></div><div class="info-item"><strong>所属部门:</strong><span style="color:#54a0ff;margin-left:10px">{{ userData.deptName }}</span></div><div class="info-item"><strong>员工工号:</strong><span style="color:#54a0ff;margin-left:10px">{{ userData.jobNumber }}</span></div><div class="info-item"><strong>用户角色:</strong><span style="color:#54a0ff;margin-left:10px">{{ userData.roleName }}</span></div></div></div></el-col><el-col :xs="24" :sm="24" :lg="8"><div class="chart-wrapper2"><div class="score-section1"><div style="font-weight:bold; padding:20px 20px 10px">综合评分:{{overallScore}}</div></div><div style="display:flex"><div style="display:flex"><div class="score-section"><div>血压检测:{{bloodPressureScore}}</div></div><div class="score-section"><div>酒精检测:{{alcohoScore}}</div></div></div><div style="display:flex"><div class="score-section"><div>体温检测:{{temperatureScore}}</div></div><div class="score-section"><div>血氧检测:{{bloodOXScore}}</div></div></div></div><div class="health-status"><div style="font-weight:bold;margin:20px 20px 0px">健康状况</div><div style="display:flex"><div class="status-item"><div>血压</div><!-- <div class="stars">★★★★★</div> --><div class="score"><!--循序生成五星,原理是通过给span绑定类名设置星星背景图--><span class="star-item" v-for="star in starScore1" :class="star"></span><span>{{tempBlood.toFixed(1)}}</span></div></div><div class="status-item"><div>酒精</div><div class="score"><!--循序生成五星,原理是通过给span绑定类名设置星星背景图--><span class="star-item" v-for="star in starScore2" :class="star"></span><span>{{tempAlcoho.toFixed(1)}}</span></div></div></div><div style="display:flex"><div class="status-item"><div>血氧</div><div class="score"><!--循序生成五星,原理是通过给span绑定类名设置星星背景图--><span class="star-item" v-for="star in starScore3" :class="star"></span><span>{{tempBloodOX.toFixed(1)}}</span></div></div><div class="status-item"><div>体温</div><div class="score"><!--循序生成五星,原理是通过给span绑定类名设置星星背景图--><span class="star-item" v-for="star in starScore4" :class="star"></span><span>{{tempTempture.toFixed(1)}}</span></div></div></div></div></div></el-col><el-col :xs="24" :sm="24" :lg="8"><div class="chart-wrapper-z"><div style="font-weight:bold">历史趋势</div><div style="font-size:15px;color:#48dbfb;margin-bottom:-22px;margin-left:10px">评分</div><line-chart-x :chart-data="lineChartDataX"/></div></el-col></el-row><el-row :gutter="12"><el-col :xs="24" :sm="24" :lg="12"><div class="chart-wrapper"><div style="font-weight:bold">血压检测图表(mm/hg)</div><line-chart-m :chart-data="lineChartDataM" /></div></el-col><el-col :xs="24" :sm="24" :lg="12"><div class="chart-wrapper"><div style="font-weight:bold">酒精检测图表(mg/100ml)</div><pie-chart :chart-data="RChartData"/></div></el-col></el-row><el-row :gutter="12"><el-col :xs="24" :sm="24" :lg="8"><div class="chart-wrapper"><div style="font-weight:bold">心率检测图表(bpm)</div><line-chart-n :chart-data="rateData"/></div></el-col><el-col :xs="24" :sm="24" :lg="8"><div class="chart-wrapper"><div style="font-weight:bold">血氧饱和检测图表(%)</div><pie-chart-x :chart-data="XChartData"/></div></el-col><el-col :xs="24" :sm="24" :lg="8"><div class="chart-wrapper"><div style="font-weight:bold">体温检测图表(°C)</div><bar-chart-m :chart-data="tempertureDataM"/></div></el-col></el-row><el-dialog title="" :visible.sync="dialogVisible" width="60%" height="80%" ><div class="rule-title-p"><div class="rule-title-all"> 综合评分规则:</div><span class="rule-description">每个检测项目满分100,60分及格。</span><spanclass="rule-description">每日综合评分为所有项目的总和/项目数。:只计算驾驶员做的项目,例如:如果驾驶员只做了体温检测和酒精检测,没有做血氧检测和血压检测,那么总和评分就是(体温得分+酒测得分)/2每周综合评分为该周每日的综合评分相加/日数。注:只计算驾驶员做了检测的日数。每月综合评分为该月每日的总和评分相加/日数。注:只计算驾驶员做了检测的日数。</span></div><div class="rule-title-p"><span class="rule-title">体温评分规则:</span><span class="rule-description">体温在a°-b°范围内,100,(a、b由客户设定)</span><span class="rule-description">体温每升高或降低c°,1,(c由客户设定)</span><span class="rule-description">如果司机体温在a°-b°之间,得分=100</span><span class="rule-description">如果司机体温低于a°,得分=100-[(-司机体温)/]</span><span class="rule-description">如果司机体温高于b°,得分=100-[(司机体温-)/]</span></div><div class="rule-title-p"><span class="rule-title"> 测酒评分规则:</span>  <span class="rule-description">酒精检测值低于x mg/100ml时,100,(x由客户设定)</span><span class="rule-description"> 酒精检测值每提高y mg/100ml,测酒评分减1,(y由客户设定)</span><span class="rule-description"> 司机测酒精评分=100-[(司机酒精检测值-x)/y]</span></div><div class="rule-title-p"><span class="rule-title"> 血氧饱和度评分规则:</span><span class="rule-description">血氧饱和度在m%以上时,100,(m由客户设定)</span><span class="rule-description">血氧饱和度每下降n%,血氧评分减1,(n由客户设定)</span><span class="rule-description">血氧饱和度评分=100-[(m-司机血氧饱和度)/n]</span></div><div class="rule-title-p"><span class="rule-title"> 血压评分规则:</span><span class="rule-description">100:收缩压<139和舒张压<89 </span><span class="rule-description">80:140<收缩压<15990<舒张压<99(一级轻度高血压) </span><span class="rule-description">60:160<收缩压<179100<舒张压<109(二级中度高血压) </span><span class="rule-description">60分以下:收缩压>=180或舒张压>=110(三级重度高血压)</span></div><span slot="footer" class="dialog-footer"><el-button @click="dialogVisible = false">关闭</el-button></span></el-dialog></div>
</template>
<script>
import pdf from 'vue-pdf'
import LineChart from './dashboard/LineChart'
import LineChartX from './dashboard/LineChartX'
import LineChartY from './dashboard/LineChartY'
import LineChartM from './dashboard/LineChartM'
import LineChartN from './dashboard/LineChartN'
import RaddarChart from './dashboard/RaddarChart'
import PieChart from './dashboard/PieChart'
import PieChartX from './dashboard/PieChartX'
import BarChart from './dashboard/BarChart'
import BarChartM from './dashboard/BarChartM'
import { exportUserIndexPDF,monthUserDetectionDetail } from "@/api/userIndex/userIndex";
import profile from "../assets/images/profile.jpg";
export default {name: 'Index',components: {pdf,LineChartX,LineChartY,LineChartM,LineChartN,LineChart,LineChart,RaddarChart,PieChart,PieChartX,BarChart,BarChartM},data() {return {defaultAct: 'this.src="' + profile + '"',baseurl: process.env.VUE_APP_BASE_API,tempBlood:null,tempAlcoho:null,tempBloodOX:null,tempTempture:null,// 跟踪当前选中的按钮selectedPeriod: '', // 默认为空,表示没有按钮被选中bloodPressureScore:"",alcohoScore:"",bloodOXScore:"",temperatureScore:"",overallScore:"",RChartData:{ //酒精a1:1,a2:3,a3:2,a4:0,},XChartData:{ // 血氧a1:4,a2:2,a3:1,},tempertureData:{temperture:[]},tempertureDataM:{temperture:[]},rateData:{heartRate:[]},lineChartDataM: {systolicData:  [],diastolicData: []},lineChartDataX: {yearlyRateData: [],  },dialogVisible: false,value3: '',pickerOptions: {shortcuts: [{text: '最近一周',onClick(picker) {const end = new Date();const start = new Date();start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);picker.$emit('pick', [start, end]);}}, {text: '最近一个月',onClick(picker) {const end = new Date();const start = new Date();start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);picker.$emit('pick', [start, end]);}}]},userData: {phonenumber:'',sex:'',nickName:'',deptName:'',roleName:''}, // 个人信息 // 日期范围dateRange: [],src: 'https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png',userList: {},// 显示搜索条件showSearch: true,// 查询参数queryParams: {pageNum: 1,pageSize: 10,nickName: null,userId: null},}},created() {this.queryParams.userId = this.$route.params.userIdthis.getNowTime();this.getMonthList();},computed:{starScore1(){let stars = [];   //定义一个空数组来存储类名let score = Math.floor(this.tempBlood * 2)/2;   //把评分转成整数或整数+0.5(如:4.7转成4.5,4.2转成4.0)let decimalScore = score%1 !== 0;   //取1的余数不等于0,说明有小数(显示半星)let integerScore = Math.floor(score);   //取整数分数(显示全星)for (let i=0; i<integerScore; i++){stars.push('on')      //整数分数为多少,就添加多少个全星}if (decimalScore){stars.push('half')    //存在小数分数,添加一个半星}while(stars.length<5){stars.push('off')     //如果星星数不满5颗,空星星填充}return stars},starScore2(){let stars = [];   //定义一个空数组来存储类名let score = Math.floor(this.tempAlcoho * 2)/2;   //把评分转成整数或整数+0.5(如:4.7转成4.5,4.2转成4.0)let decimalScore = score%1 !== 0;   //取1的余数不等于0,说明有小数(显示半星)let integerScore = Math.floor(score);   //取整数分数(显示全星)for (let i=0; i<integerScore; i++){stars.push('on')      //整数分数为多少,就添加多少个全星}if (decimalScore){stars.push('half')    //存在小数分数,添加一个半星}while(stars.length<5){stars.push('off')     //如果星星数不满5颗,空星星填充}return stars},starScore3(){let stars = [];   //定义一个空数组来存储类名let score = Math.floor(this.tempBloodOX * 2)/2;   //把评分转成整数或整数+0.5(如:4.7转成4.5,4.2转成4.0)let decimalScore = score%1 !== 0;   //取1的余数不等于0,说明有小数(显示半星)let integerScore = Math.floor(score);   //取整数分数(显示全星)for (let i=0; i<integerScore; i++){stars.push('on')      //整数分数为多少,就添加多少个全星}if (decimalScore){stars.push('half')    //存在小数分数,添加一个半星}while(stars.length<5){stars.push('off')     //如果星星数不满5颗,空星星填充}return stars},starScore4(){let stars = [];   //定义一个空数组来存储类名let score = Math.floor(this.tempTempture * 2)/2;   //把评分转成整数或整数+0.5(如:4.7转成4.5,4.2转成4.0)let decimalScore = score%1 !== 0;   //取1的余数不等于0,说明有小数(显示半星)let integerScore = Math.floor(score);   //取整数分数(显示全星)for (let i=0; i<integerScore; i++){stars.push('on')      //整数分数为多少,就添加多少个全星}if (decimalScore){stars.push('half')    //存在小数分数,添加一个半星}while(stars.length<5){stars.push('off')     //如果星星数不满5颗,空星星填充}return stars}},methods: {// 定义一个方法来处理按钮点击事件handleJump(timePeriod) {// 更新选中的按钮状态this.selectedPeriod = timePeriod;// 根据传入的参数决定跳转到哪个页面switch (timePeriod) {case 'today':// 跳转到今日页面的逻辑this.$router.push({ name: 'today'})break;case 'week':// 跳转到近一周页面的逻辑this.$router.push({ name: 'week'})break;case 'month':// 跳转到近一个月页面的逻辑this.$router.push({ name: 'month'})break;default:// 如果传入的参数不是预期的值,可以处理错误或默认行为console.error('未知的时间段');break;}},// 导出事件方法exportPDF() {exportUserIndexPDF( this.addDateRange(this.queryParams, this.dateRange)).then((res) => {//导出文件名var filename = new Date().getTime();//创建urllet url = window.URL.createObjectURL(res)//创建a标签 并设置属性let link = document.createElement('a')link.style.display = 'none'link.href = urllink.setAttribute('download', filename + '.pdf')//添加a标签document.body.appendChild(link)//执行下载link.click();//释放url对象URL.revokeObjectURL(link.href);//释放a标签document.body.removeChild(link);//this.download = false;});},printpage() {const printContent = document.querySelector('.dashboard-editor-container').innerHTML;const iframe = document.createElement('iframe');iframe.setAttribute('style', 'position: absolute; width: 0; height: 0;');document.body.appendChild(iframe);const iframeDoc = iframe.contentWindow.document;// 设置打印展示方式 - 横向展示iframeDoc.write('<style media="print">@page {size: landscape;}</style>');// 向 iframe 中注入 printContent 样式//iframeDoc.write(`<link href="./print.css" media="print" rel="stylesheet" />`);// 写入内容iframeDoc.write('<div>' + printContent + '</div>');setTimeout(function () {iframe.contentWindow?.print();document.body.removeChild(iframe);}, 50);},// 评分规则的弹窗handleClose(done) {this.$confirm('确认关闭?').then(_ => {done();}).catch(_ => { });},/** 查询用户数据 */getMonthList() {this.loading = true;monthUserDetectionDetail(this.queryParams,).then((response) => {this.userWeekList = response.data;this.loading = false;console.log("userListWeek:");console.log(this.userWeekList);this.RChartData.a1 = this.userWeekList.alcohoMap[0];this.RChartData.a2 = this.userWeekList.alcohoMap[1];this.RChartData.a3 = this.userWeekList.alcohoMap[2];this.RChartData.a4 = this.userWeekList.alcohoMap[3];this.XChartData.a1 = this.userWeekList.bloodOxygenMap[0],this.XChartData.a2 = this.userWeekList.bloodOxygenMap[1],this.XChartData.a3 = this.userWeekList.bloodOxygenMap[2],this.lineChartDataM.diastolicData = this.userWeekList.bloodPressureDiaMap;this.lineChartDataM.systolicData = this.userWeekList.bloodPressureSyMap;this.tempertureData.temperture = this.userWeekList.temperatureMap;this.tempertureDataM.temperture = this.userWeekList.temperatureMap;this.userData.nickName = this.userWeekList.listUserInfo[0];this.userData.jobNumber = this.userWeekList.listUserInfo[1];this.userData.deptName = this.userWeekList.listUserInfo[2];this.userData.roleName = this.userWeekList.listUserInfo[3];this.userData.phonenumber = this.userWeekList.listUserInfo[4];this.userData.sex = this.userWeekList.listUserInfo[5];this.src = this.userWeekList.listUserInfo[6]; this.bloodPressureScore =this.userWeekList.bloodPressureScore;this.alcohoScore =this.userWeekList.alcohoScore;this.bloodOXScore =this.userWeekList.bloodOXScore;this.temperatureScore =this.userWeekList.temperatureScore;this.overallScore = this.userWeekList.overallScore;this.tempBlood = this.userWeekList.bloodPressureScore/100*5;this.tempAlcoho =this.userWeekList.alcohoScore/100*5;this.tempBloodOX =this.userWeekList.bloodOXScore/100*5;this.tempTempture = this.userWeekList.temperatureScore / 100.0 * 5;this.rateData.heartRate = this.userWeekList.bloodPressureHeartRateMap;this.lineChartDataX.yearlyRateData = this.userWeekList.overallYearScore;});},/** 搜索按钮操作 */handleQuery() {this.queryParams.pageNum = 1;this.getList();},/** 重置按钮操作 */resetQuery() {this.dateRange = [];this.resetForm("queryForm");this.handleQuery();},//获取区间时间getNowTime() {var now = new Date();var year = now.getFullYear(); //得到年份var month = now.getMonth(); //得到月份var date = now.getDate(); //得到日期month = month + 1;month = month.toString().padStart(2, "0");date = date.toString().padStart(2, "0");var defaultDate = `${year}-${month}-${date}`;// 计算七天前的日期var oneWeekAgo = new Date(now);oneWeekAgo.setDate(now.getDate() - 30); // 从今天日期减去7天var yearAgo = oneWeekAgo.getFullYear();var monthAgo = (oneWeekAgo.getMonth() + 1).toString().padStart(2, "0");var dateAgo = oneWeekAgo.getDate().toString().padStart(2, "0");var sevenDaysAgo = `${yearAgo}-${monthAgo}-${dateAgo}`;this.dateRange = [sevenDaysAgo, defaultDate];},}
}
</script><style lang="scss" scoped>
.status-item {display: flex;margin-left: 50px;margin-top: 10px;
}
.stars {color: #10ac84;font-size: 18px;margin-left: 15px;
}.score-section {display: flex;margin-left: 40px;color: #00a8ff;font-size: 15px;
}.info-item {margin-left: 50px;font-size: 15px;margin-bottom: 3px;
}.chart-img {height: 180px;width: 150px;
}.dashboard-editor-container {padding: 12px;background-color: rgb(240, 242, 245);position: relative;.chart-wrapper {background: #fff;padding: 16px 16px 0;margin-bottom: 12px;}.chart-wrapper-z {margin-top: 20px;background: #fff;padding: 16px 16px 0;margin-bottom: 12px;height: 198px;}.chart-wrapper1 {margin-top: 20px;background: #fff;padding: 16px 16px 0;margin-bottom: 12px;height: 198px;display: flex;}.chart-wrapper2 {margin-top: 20px;background: #fff;margin-bottom: 12px;height: 198px;}}@media (max-width:1024px) {.chart-wrapper {padding: 8px;}
}.block {display: flex;background: #fff;height: 60px;align-items: center;/* 垂直居中 */}.block-son {margin-top: 20px;
}.container {//display: flex; /* 启用Flexbox布局 *///align-items: center; /* 垂直居中子元素 *///justify-content: flex-end; /* 将子元素推向右侧 */
}.but {margin-left: 200px;
}.rule-title-all {font-weight: bold;margin-top: 20px;font-size: 25px;
}/* 规则标题样式 */
.rule-title {font-weight: bold;margin-top: 20px;font-size: 20px;
}/* 规则描述样式 */
.rule-description {margin-left: 20px;font-size: 20px;
}.rule-title-p {margin-bottom: 10px;
}
.selected {background-color: #409EFF; /* 举例,将按钮背景色改为蓝色 */color: white; /* 白色文字 */
}
.score{display: flex;align-items: center;justify-content: center;.star-item{width: 20px;height: 20px;display: inline-block;margin: 0 5px;background: no-repeat;}.star-item.on{background: url("../assets/images/星实.png");  //全星background-size: contain;}.star-item.half{background: url("../assets/images/星半.png");  //半星background-size: contain;}.star-item.off{background: url("../assets/images/星空.png");   //空星星background-size: contain;}
}
</style>
关键字:微信注册小程序步骤_seo专业培训seo专业培训_南昌seo推广公司_东莞关键词优化实力乐云seo

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: