|
@@ -4,19 +4,21 @@ package com.bofeng.service;
|
|
import com.baomidou.mybatisplus.toolkit.IdWorker;
|
|
import com.baomidou.mybatisplus.toolkit.IdWorker;
|
|
import com.bofeng.dao.*;
|
|
import com.bofeng.dao.*;
|
|
import com.bofeng.entity.*;
|
|
import com.bofeng.entity.*;
|
|
|
|
+import com.yvan.platform.Conv;
|
|
|
|
+import io.swagger.models.auth.In;
|
|
|
|
+import javassist.expr.NewArray;
|
|
import org.apache.commons.lang3.tuple.Triple;
|
|
import org.apache.commons.lang3.tuple.Triple;
|
|
import org.joda.time.DateTime;
|
|
import org.joda.time.DateTime;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
import org.springframework.transaction.annotation.Propagation;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
+import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
+import java.text.ParseException;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
-import java.util.Calendar;
|
|
|
|
-import java.util.Date;
|
|
|
|
-import java.util.List;
|
|
|
|
-import java.util.Map;
|
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
/**
|
|
* @Author: xielianghe
|
|
* @Author: xielianghe
|
|
@@ -646,7 +648,130 @@ public class MsReportService {
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
return msReports;
|
|
return msReports;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //统计LY异常情况
|
|
|
|
+ public List<MsReport> getByReportSuspected() throws ParseException {
|
|
|
|
+ //获取所有的ly人员
|
|
|
|
+ List<MsReport> list = msReportMapper.selectByReportSuspected();
|
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
+ SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
+ List<MsReport> listReport = new ArrayList<>();
|
|
|
|
+ if (list != null && list.size() > 0) {
|
|
|
|
+ for (MsReport msReport : list) {
|
|
|
|
+ //是否确诊
|
|
|
|
+ Integer isSure = msReportMapper.selectNum(msReport.getUserId(), 1) > 0 ? 1 : 0;
|
|
|
|
+ //是否疑似
|
|
|
|
+ Integer isSuspected = msReportMapper.selectNum(msReport.getUserId(), 2) > 0 ? 1 : 0;
|
|
|
|
+ //是否有异常症状
|
|
|
|
+ String isSymptom = "";
|
|
|
|
+ List<MsSuspected> listSuspected = msReportMapper.selectSymptomNum(msReport.getUserId());
|
|
|
|
+ if (listSuspected != null && listSuspected.size() > 0) {
|
|
|
|
+ for (MsSuspected msSuspected : listSuspected) {
|
|
|
|
+ isSymptom += s.format(msSuspected.getReportDate().getTime()) + ",";
|
|
|
|
+ if (Conv.NFloat(msSuspected.getTemperature()) < Conv.NFloat(35) || Conv.NFloat(msSuspected.getTemperature()) > Conv.NFloat(37.3))
|
|
|
|
+ isSymptom += "体温:异常,";
|
|
|
|
+ if (msSuspected.getCough() > 0)
|
|
|
|
+ isSymptom += "咳嗽现象:" + getCough(msSuspected.getCough()) + ",";
|
|
|
|
+ if (msSuspected.getMuscle() > 0)
|
|
|
|
+ isSymptom += "肌肉酸痛:" + getMuscle(msSuspected.getMuscle()) + ",";
|
|
|
|
+ if (msSuspected.getDyspnea() > 0)
|
|
|
|
+ isSymptom += "呼吸困难:" + getDyspnea(msSuspected.getDyspnea()) + ",";
|
|
|
|
+ if (msSuspected.getFatigue() > 0)
|
|
|
|
+ isSymptom += "乏力现象:" + getFatigue(msSuspected.getFatigue()) + ",";
|
|
|
|
+ if (msSuspected.getDiarrhea() > 0)
|
|
|
|
+ isSymptom += "腹泻现象:" + getDiarrhea(msSuspected.getDiarrhea()) + ",";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //是否有接触史
|
|
|
|
+ Integer isContact = msReportMapper.selectNum(msReport.getUserId(), 3) > 0 ? 1 : 0;
|
|
|
|
+ //家人是否有接触史
|
|
|
|
+ Integer isFamliyContact = msReportMapper.selectFamilyContactNum(msReport.getUserId()) > 0 ? 1 : 0;
|
|
|
|
+ //异地返工
|
|
|
|
+ Integer isWork = 0;
|
|
|
|
+ String returnWork = msReportMapper.returnWork(msReport.getUserId());
|
|
|
|
+ if (returnWork != null) {
|
|
|
|
+ if (sdf.parse(returnWork + " 00:00:00").getTime() + 1000L * 3600 * 24 * 15 > sdf.parse(s.format(new Date()) + " 00:00:00").getTime()) {
|
|
|
|
+ isWork = 1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //判断只要存在一种情况,就写进数据库
|
|
|
|
+ if (isSure > 0 || isSuspected > 0 || isSymptom != "" || isContact > 0 || isFamliyContact > 0 || isWork > 0) {
|
|
|
|
+ msReport.setIsSure(isSure);
|
|
|
|
+ msReport.setIsSuspected(isSuspected);
|
|
|
|
+ msReport.setIsSymptom(isSymptom);
|
|
|
|
+ msReport.setIsContact(isContact);
|
|
|
|
+ msReport.setIsFamliyContact(isFamliyContact);
|
|
|
|
+ msReport.setIsWork(isWork);
|
|
|
|
+ listReport.add(msReport);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return listReport;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public String getCough(Integer cough) {
|
|
|
|
+ if (cough == 0)
|
|
|
|
+ return "无咳嗽";
|
|
|
|
+ else if (cough == 1)
|
|
|
|
+ return "偶尔短暂咳嗽";
|
|
|
|
+ else if (cough == 2)
|
|
|
|
+ return "咳嗽轻度影响生活";
|
|
|
|
+ else if (cough == 3)
|
|
|
|
+ return "咳嗽严重影响生活";
|
|
|
|
+ return "";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public String getMuscle(Integer muscle) {
|
|
|
|
+ if (muscle == 0)
|
|
|
|
+ return "无";
|
|
|
|
+ else if (muscle == 1)
|
|
|
|
+ return "按压有";
|
|
|
|
+ else if (muscle == 2)
|
|
|
|
+ return "偶尔";
|
|
|
|
+ else if (muscle == 3)
|
|
|
|
+ return "持续有";
|
|
|
|
+ return "";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public String getDyspnea(Integer dyspnea) {
|
|
|
|
+ if (dyspnea == 0)
|
|
|
|
+ return "无";
|
|
|
|
+ else if (dyspnea == 1)
|
|
|
|
+ return "急走或上坡气短";
|
|
|
|
+ else if (dyspnea == 2)
|
|
|
|
+ return "气短而走路变慢";
|
|
|
|
+ else if (dyspnea == 3)
|
|
|
|
+ return "走路数分钟后气短";
|
|
|
|
+ else if (dyspnea == 4)
|
|
|
|
+ return "气短无法离开房间";
|
|
|
|
+ return "";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public String getFatigue(Integer fatigue) {
|
|
|
|
+ if (fatigue == 0)
|
|
|
|
+ return "无";
|
|
|
|
+ else if (fatigue == 1)
|
|
|
|
+ return "体力劳动后不能恢复";
|
|
|
|
+ else if (fatigue == 2)
|
|
|
|
+ return "轻体力活非常累";
|
|
|
|
+ else if (fatigue == 3)
|
|
|
|
+ return "不能正常生活";
|
|
|
|
+ return "";
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ public String getDiarrhea(Integer diarrhea) {
|
|
|
|
+ if (diarrhea == 0)
|
|
|
|
+ return "无";
|
|
|
|
+ else if (diarrhea == 1)
|
|
|
|
+ return "轻度腹泻(少于3次)";
|
|
|
|
+ else if (diarrhea == 2)
|
|
|
|
+ return "中度腹泻(4-6次)";
|
|
|
|
+ else if (diarrhea == 3)
|
|
|
|
+ return "重度腹泻(超过6次)";
|
|
|
|
+ return "";
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|