瀏覽代碼

xielianghe

lange 5 年之前
父節點
當前提交
7b240d480a

+ 7 - 0
whepi-web/src/main/java/com/bofeng/dao/MsReportMapper.java

@@ -47,8 +47,13 @@ public interface MsReportMapper extends BaseMapper<MsReport> {
     @Select("select count(suspected_id) from ms_suspected where report_id=#{reportId} and suspected_status=1")
     Integer selectisNoSuspectedNum(@Param("reportId") Long reportId);
 
+    //异常
+    @Select("select count(suspected_id) from ms_suspected where report_id=#{reportId} and  medical in (1,2,3)")
+    Integer selectAbnormalNum(@Param("reportId") Long reportId);
+
     /**
      * 最近3天是否都有上报
+     *
      * @param userId
      * @return
      */
@@ -61,6 +66,7 @@ public interface MsReportMapper extends BaseMapper<MsReport> {
 
     /**
      * 最近提交的日报, msStatus 健康状态:1正常,2异常
+     *
      * @param userId
      * @return
      */
@@ -69,6 +75,7 @@ public interface MsReportMapper extends BaseMapper<MsReport> {
 
     /**
      * 最近15天确诊
+     *
      * @param userId
      * @return
      */

+ 13 - 4
whepi-web/src/main/java/com/bofeng/service/MsSuspectedService.java

@@ -256,7 +256,7 @@ public class MsSuspectedService {
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
     public void updateReport(Long reportId, Integer medical, Integer singleRoom, BigDecimal temperature) {
         //更新今日日报
-        Integer trueNum = 0, singleNum = 0, isSuspected = 0, isNoSuspected = 0, isFamliy = 0;
+        Integer trueNum = 0, singleNum = 0, isSuspected = 0, isNoSuspected = 0, isFamliy = 0, abnormalNum = 0;
 
         //确诊
         trueNum = msReportMapper.selectSuspectedNum(reportId);
@@ -270,6 +270,9 @@ public class MsSuspectedService {
         //疑似
         isNoSuspected = msReportMapper.selectisNoSuspectedNum(reportId);
 
+        //异常人数
+        abnormalNum = msReportMapper.selectAbnormalNum(reportId);
+
         //今日居家
         List<MsSuspected> list = msSuspectedMapper.selectByReportId(reportId);
         if (list != null && list.size() > 0)
@@ -281,7 +284,7 @@ public class MsSuspectedService {
             msReport.setSuspectedNum(isNoSuspected);
             msReport.setNormalNum(isSuspected);
             msReport.setSafetyNum(isFamliy);
-            if (isNoSuspected > 0)
+            if (isNoSuspected > 0 || abnormalNum > 0)
                 msReport.setMsStatus(2);
             else
                 msReport.setMsStatus(1);
@@ -324,8 +327,11 @@ public class MsSuspectedService {
     public Integer addScore(Integer medical, BigDecimal temperature, Integer cough, Integer muscle, Integer dyspnea, Integer fatigue, Integer diarrhea) {
         Integer score = 0;
 
-        if (medical == 1)
+        //确诊,疑似尽快就医
+        if (medical == 1 || medical==2)
             score = 5;
+        else if (medical == 3)
+            score = 1;
         else {
             //温度
             score += getTemperatureScore(temperature);
@@ -348,7 +354,10 @@ public class MsSuspectedService {
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
     public Integer scoreRezulte(Integer medical, Integer scoreHistory, Integer score) {
         Integer scoreRezult = 0;
-        if (medical == 1) scoreRezult = 4;
+        if (medical == 1 || medical==2)
+            scoreRezult = 4;
+        else if (medical == 3)
+            scoreRezult = 2;
         else {
             //判断用户是否含有历史评分
             if (scoreHistory == null) {