|
@@ -6,6 +6,7 @@ import com.bofeng.dao.MsReportMapper;
|
|
|
import com.bofeng.dao.MsSuspectedMapper;
|
|
|
import com.bofeng.entity.MsReport;
|
|
|
import com.bofeng.entity.MsSuspected;
|
|
|
+import com.yvan.platform.Conv;
|
|
|
import io.swagger.models.auth.In;
|
|
|
import org.joda.time.DateTime;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -40,15 +41,15 @@ public class MsSuspectedService {
|
|
|
|
|
|
//判断家人是否添加
|
|
|
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
|
|
|
- public List<MsSuspected> selectUserNameNum(long reportId,String userName) {
|
|
|
- return msSuspectedMapper.selectUserNameNum(reportId,userName);
|
|
|
+ public List<MsSuspected> selectUserNameNum(long reportId, String userName) {
|
|
|
+ return msSuspectedMapper.selectUserNameNum(reportId, userName);
|
|
|
}
|
|
|
|
|
|
//添加家人
|
|
|
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
|
|
|
public Long addSuspected(Long suspectedId, String userName, Integer grender, Integer age, Integer familyStatus,
|
|
|
String statusDesp, Integer medical, BigDecimal temperature, Integer cough, Integer muscle,
|
|
|
- Integer dyspnea, Integer fatigue, Integer diarrhea, Integer singleRoom, String others, Long userCreate,Integer scoreRezult,Integer temperatureScore,Integer scoreHistroy, Integer score) {
|
|
|
+ Integer dyspnea, Integer fatigue, Integer diarrhea, Integer singleRoom, String others, Long userCreate, Integer scoreRezult, Integer temperatureScore, Integer scoreHistroy, Integer score) {
|
|
|
Long reportId = 0L;
|
|
|
//如果是当前日期 已经添加
|
|
|
Date t = new Date();
|
|
@@ -88,7 +89,7 @@ public class MsSuspectedService {
|
|
|
if (singleRoom == 1)
|
|
|
suspectedStatus = 1;
|
|
|
//体温
|
|
|
- if (temperature.compareTo(new BigDecimal(36)) == -1 || temperature.compareTo(new BigDecimal(37.3)) == 1)
|
|
|
+ if (Conv.NFloat(temperature) < Conv.NFloat(36) || Conv.NFloat(temperature) >= Conv.NFloat(37.3))
|
|
|
suspectedStatus = 1;
|
|
|
//咳嗽
|
|
|
if (cough > 0)
|
|
@@ -219,11 +220,11 @@ public class MsSuspectedService {
|
|
|
|
|
|
//健康评估
|
|
|
@Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
|
|
|
- public MsSuspected getScore(Long susprectedId,String userName, BigDecimal temperature, Integer cough, Integer muscle, Integer dyspnea, Integer fatigue, Integer diarrhea, Long userCreate) {
|
|
|
+ public MsSuspected getScore(Long susprectedId, String userName, BigDecimal temperature, Integer cough, Integer muscle, Integer dyspnea, Integer fatigue, Integer diarrhea, Long userCreate) {
|
|
|
MsSuspected msSuspected = new MsSuspected();
|
|
|
msSuspected.setTemperatureScore(getTemperatureScore(temperature));
|
|
|
msSuspected.setScore(addScore(temperature, cough, muscle, dyspnea, fatigue, diarrhea));
|
|
|
- Integer scoreHistroy = msSuspectedMapper.selectUserNameScore(userCreate, userName,susprectedId);
|
|
|
+ Integer scoreHistroy = msSuspectedMapper.selectUserNameScore(userCreate, userName, susprectedId);
|
|
|
if (scoreHistroy == null)
|
|
|
scoreHistroy = 0;
|
|
|
msSuspected.setScoreHistroy(scoreHistroy);
|
|
@@ -236,15 +237,15 @@ public class MsSuspectedService {
|
|
|
public Integer getTemperatureScore(BigDecimal temperature) {
|
|
|
Integer score = 0;
|
|
|
//温度
|
|
|
- if (temperature.compareTo(new BigDecimal(37.3)) == -1)//37.3以下0分
|
|
|
+ if (Conv.NFloat(temperature) < Conv.NFloat(37.3))//37.3以下0分
|
|
|
score += 0;
|
|
|
- if (temperature.compareTo(new BigDecimal(37.4)) > -1 && temperature.compareTo(new BigDecimal(38)) < 1)// 37.3~38℃为 1分
|
|
|
+ if (Conv.NFloat(temperature) >= Conv.NFloat(37.4) && Conv.NFloat(temperature) <= Conv.NFloat(38))// 37.3~38℃为 1分
|
|
|
score += 1;
|
|
|
- if (temperature.compareTo(new BigDecimal(38.1)) > -1 && temperature.compareTo(new BigDecimal(39)) < 1)// 38.1~39℃为中度发热 2分
|
|
|
+ if (Conv.NFloat(temperature) >= Conv.NFloat(38.1) && Conv.NFloat(temperature) <= Conv.NFloat(39))// 38.1~39℃为中度发热 2分
|
|
|
score += 2;
|
|
|
- if (temperature.compareTo(new BigDecimal(39.1)) > -1 && temperature.compareTo(new BigDecimal(34)) < 1)//39.1~40℃为高热 3分
|
|
|
+ if (Conv.NFloat(temperature) >= Conv.NFloat(39.1) && Conv.NFloat(temperature) <= Conv.NFloat(40))//39.1~40℃为高热 3分
|
|
|
score += 3;
|
|
|
- if (temperature.compareTo(new BigDecimal(39.1)) > -1 && temperature.compareTo(new BigDecimal(34)) < 1)//340℃以上为超高热 4分
|
|
|
+ if (Conv.NFloat(temperature) > Conv.NFloat(40))//340℃以上为超高热 4分
|
|
|
score += 4;
|
|
|
return score;
|
|
|
}
|
|
@@ -273,9 +274,9 @@ public class MsSuspectedService {
|
|
|
//判断用户是否含有历史评分
|
|
|
if (scoreHistory == 0) {
|
|
|
//判断结果
|
|
|
- if (score <= 1)
|
|
|
+ if (score < 1)
|
|
|
scoreRezult = 1;
|
|
|
- if (score >= 2 && score <= 3)
|
|
|
+ if (score >= 1 && score <= 3)
|
|
|
scoreRezult = 2;
|
|
|
if (score == 4)
|
|
|
scoreRezult = 3;
|
|
@@ -284,8 +285,6 @@ public class MsSuspectedService {
|
|
|
|
|
|
} else {
|
|
|
if (score - scoreHistory >= 3)
|
|
|
- return 3;
|
|
|
- if (score - scoreHistory > 4)
|
|
|
return 4;
|
|
|
else {
|
|
|
if (score <= 1)
|