lange il y a 5 ans
Parent
commit
9bfafce4d4

+ 17 - 9
whepi-ui/templates/home/ribao.ftl

@@ -53,42 +53,50 @@
                     <input id="suspectedId" type="text" hidden="hidden" value=""/>
                     <input id="suspectedId" type="text" hidden="hidden" value=""/>
                     <div style="height: 5vh; line-height: 5vh;margin-left: 2vw;">病情描述</div>
                     <div style="height: 5vh; line-height: 5vh;margin-left: 2vw;">病情描述</div>
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
-                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 40%;">是否确诊</div>
+                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 30%;">是否确诊</div>
                         <input id="switchQuezhen" class="weui-input" autofocus="" type="text" placeholder="请选择" maxlength="20" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
                         <input id="switchQuezhen" class="weui-input" autofocus="" type="text" placeholder="请选择" maxlength="20" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
                     </div>
                     </div>
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
-                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 40%;">单间隔离</div>
+                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 30%;">单间隔离</div>
                         <input id="switchDanjiangeli" class="weui-input" autofocus="" type="text" placeholder="请选择" maxlength="20" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
                         <input id="switchDanjiangeli" class="weui-input" autofocus="" type="text" placeholder="请选择" maxlength="20" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
                     </div>
                     </div>
 
 
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
-                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 40%;">体温</div>
+                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 30%;">体温</div>
                         <input id="js_input_user_tiwen" class="weui-input" autofocus="" type="number" placeholder="请输入" maxlength="4" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
                         <input id="js_input_user_tiwen" class="weui-input" autofocus="" type="number" placeholder="请输入" maxlength="4" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
                     </div>
                     </div>
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
-                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 40%;">咳嗽</div>
+                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 30%;">咳嗽现象</div>
                         <input id="js_input_user_kesou" class="weui-input" autofocus="" type="text" placeholder="请选择" maxlength="20" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
                         <input id="js_input_user_kesou" class="weui-input" autofocus="" type="text" placeholder="请选择" maxlength="20" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
                     </div>
                     </div>
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
-                        <div style="color: gray;height: 5vh;line-height: 5vh; width: 40%;">肌肉酸痛</div>
+                        <div style="color: gray;height: 5vh;line-height: 5vh; width: 30%;">肌肉酸痛</div>
                         <input id="js_input_user_jirou" class="weui-input" autofocus="" type="text" placeholder="请选择" maxlength="20" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
                         <input id="js_input_user_jirou" class="weui-input" autofocus="" type="text" placeholder="请选择" maxlength="20" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
                     </div>
                     </div>
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
-                        <div style="color: gray;height: 5vh;line-height: 5vh; width: 40%;">呼吸</div>
+                        <div style="color: gray;height: 5vh;line-height: 5vh; width: 30%;">呼吸困难</div>
                         <input id="js_input_user_huxi" class="weui-input" autofocus="" type="text" placeholder="请选择" maxlength="20" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
                         <input id="js_input_user_huxi" class="weui-input" autofocus="" type="text" placeholder="请选择" maxlength="20" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
                     </div>
                     </div>
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
-                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 40%;">乏力</div>
+                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 30%;">乏力现象</div>
                         <input id="js_input_user_fali" class="weui-input" autofocus="" type="text" placeholder="请选择" maxlength="20" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
                         <input id="js_input_user_fali" class="weui-input" autofocus="" type="text" placeholder="请选择" maxlength="20" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
                     </div>
                     </div>
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
-                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 40%;">腹泻</div>
+                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 30%;">腹泻现象</div>
                         <input id="js_input_user_fuxie" class="weui-input" autofocus="" type="text" placeholder="请选择" maxlength="20" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
                         <input id="js_input_user_fuxie" class="weui-input" autofocus="" type="text" placeholder="请选择" maxlength="20" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
                     </div>
                     </div>
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
                     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
-                        <div style="color: gray;height: 5vh; line-height: 5vh;margin-right: 2vw;width: 13%;">其他</div>
+                        <div style="color: gray;height: 5vh; line-height: 5vh;margin-right: 2vw;width: 30%;">其他描述</div>
                         <textarea id="shuruqita" class="weui-textarea" placeholder="输入内容(300字内)" rows="5" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; margin-top: 1vh;"></textarea>
                         <textarea id="shuruqita" class="weui-textarea" placeholder="输入内容(300字内)" rows="5" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; margin-top: 1vh;"></textarea>
                     </div>
                     </div>
+                    <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh;">
+                        <div style="color: gray;height: 5vh; line-height: 5vh;margin-right: 2vw;width: 30%;">
+                            <button id="ribao_score"  style="height:5vh;" class="weui-btn weui-btn_mini weui-btn_primary">健康评估</button></div>
+                            <input id="js_input_score_rezult" class="weui-input" autofocus="" type="number" maxlength="4" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
+                             <input id="js_input_temperature_score" type="text" hidden="hidden" />
+                             <input id="js_input_score_histroy" type="text" hidden="hidden" />
+                              <input id="js_input_score" type="text" hidden="hidden"/>
+                    </div>
                     <div style="display: flex; justify-content: center;">
                     <div style="display: flex; justify-content: center;">
                         <div style="width: 70%;color: red; text-align: center;">
                         <div style="width: 70%;color: red; text-align: center;">
                             大家可以自愿填写病情描述(温度为必填项),根据每天病情变化趋势给出就诊评估建议
                             大家可以自愿填写病情描述(温度为必填项),根据每天病情变化趋势给出就诊评估建议

+ 132 - 32
whepi-ui/templates/home/ribao.js

@@ -130,11 +130,11 @@ function ribao_init() {
         value: "0",
         value: "0",
       },
       },
       {
       {
-        title: "可体力劳动但觉得累",
+        title: "体力劳动后不能恢复",
         value: "1",
         value: "1",
       },
       },
       {
       {
-        title: "轻体力劳动后长时间不能恢复",
+        title: "轻体力活非常累",
         value: "2",
         value: "2",
       },
       },
       {
       {
@@ -231,6 +231,29 @@ function ribaoInitialization(reportId) {
         });
         });
       } else {
       } else {
         $('#btn_shangbao').text('上报');
         $('#btn_shangbao').text('上报');
+
+        $("#switchQuezhen").val(getMedical(0));
+        $("#switchQuezhen").attr("data-values", 0);
+
+        $("#switchDanjiangeli").val(getSingleRoom(0));
+        $("#switchDanjiangeli").attr("data-values", 0);
+
+        $("#js_input_user_tiwen").val(0);
+
+        $("#js_input_user_kesou").val(getCough(0));
+        $("#js_input_user_kesou").attr("data-values", 0);
+
+        $("#js_input_user_jirou").val(getMuscle(0));
+        $("#js_input_user_jirou").attr("data-values", 0);
+
+        $("#js_input_user_huxi").val(getDyspnea(0));
+        $("#js_input_user_huxi").attr("data-values", 0);
+
+        $("#js_input_user_fali").val(getFatigue(0));
+        $("#js_input_user_fali").attr("data-values", 0);
+
+        $("#js_input_user_fuxie").val(getDiarrhea(0));
+        $("#js_input_user_fuxie").attr("data-values", 0);
       }
       }
     },
     },
     error: function () {
     error: function () {
@@ -261,6 +284,29 @@ function ribao_refrash() {
           });
           });
         } else {
         } else {
 
 
+          $("#switchQuezhen").val(getMedical(0));
+          $("#switchQuezhen").attr("data-values", 0);
+
+          $("#switchDanjiangeli").val(getSingleRoom(0));
+          $("#switchDanjiangeli").attr("data-values", 0);
+
+          $("#js_input_user_tiwen").val(0);
+
+          $("#js_input_user_kesou").val(getCough(0));
+          $("#js_input_user_kesou").attr("data-values", 0);
+
+          $("#js_input_user_jirou").val(getMuscle(0));
+          $("#js_input_user_jirou").attr("data-values", 0);
+
+          $("#js_input_user_huxi").val(getDyspnea(0));
+          $("#js_input_user_huxi").attr("data-values", 0);
+
+          $("#js_input_user_fali").val(getFatigue(0));
+          $("#js_input_user_fali").attr("data-values", 0);
+
+          $("#js_input_user_fuxie").val(getDiarrhea(0));
+          $("#js_input_user_fuxie").attr("data-values", 0);
+
         }
         }
       }
       }
     },
     },
@@ -287,7 +333,7 @@ function ribao_cell(v) {
   var temperature = "体温:" + v.temperature + ";";
   var temperature = "体温:" + v.temperature + ";";
   var cough = "";
   var cough = "";
   if (v.cough != 0)
   if (v.cough != 0)
-    cough = "咳嗽:" + getCough(v.cough) + ";";
+    cough = "咳嗽现象:" + getCough(v.cough) + ";";
   var muscle = "";
   var muscle = "";
   if (v.muscle != 0)
   if (v.muscle != 0)
     muscle = "肌肉酸痛:" + getMuscle(v.muscle) + ";";
     muscle = "肌肉酸痛:" + getMuscle(v.muscle) + ";";
@@ -296,10 +342,10 @@ function ribao_cell(v) {
     dyspnea = "呼吸困难:" + getDyspnea(v.dyspnea) + ";";
     dyspnea = "呼吸困难:" + getDyspnea(v.dyspnea) + ";";
   var fatigue = "";
   var fatigue = "";
   if (v.fatigue != 0)
   if (v.fatigue != 0)
-    fatigue = "乏力:" + getFatigue(v.fatigue) + ";";
+    fatigue = "乏力现象:" + getFatigue(v.fatigue) + ";";
   var diarrhea = "";
   var diarrhea = "";
   if (v.diarrhea != 0)
   if (v.diarrhea != 0)
-    diarrhea = "腹泻:" + getDiarrhea(v.diarrhea) + ";";
+    diarrhea = "腹泻现象:" + getDiarrhea(v.diarrhea) + ";";
   var others = "";
   var others = "";
   if (v.others != "")
   if (v.others != "")
     others = "其他:" + v.others;
     others = "其他:" + v.others;
@@ -339,28 +385,6 @@ function ribao_cancel() {
 }
 }
 
 
 function ribaoCommit() {
 function ribaoCommit() {
-
-  // console.log("sss");
-  // console.log(
-  //     "姓名", $("#js_input_user_name").val(),
-  //     "性别", $("#js_input_user_sex").val(), "实际值", $("#js_input_user_sex").attr("data-values"),
-  //     "年龄", $("#js_input_user_age").val(),
-  //     "基本状况", $("#js_input_user_status").val(),
-  //     "状况描述", $("#jibenmiaoshu").val(),
-  //     "是否确诊", $("#switchQuezhen").val(),
-  //     "体温", $("#js_input_user_tiwen").val(),
-  //     "咳嗽", $("#js_input_user_kesou").val(),
-  //     "肌肉酸痛", $("#js_input_user_jirou").val(),
-  //     "呼吸困难", $("#js_input_user_huxi").val(),
-  //     "胸闷", $("#js_input_user_xiongmen").val(),
-  //     "乏力", $("#js_input_user_fali").val(),
-  //     "腹泻", $("#js_input_user_fuxie").val(),
-  //     "次数", $("#js_input_user_cishu").val(),
-  //     "其他", $("#shuruqita").val()
-  // );
-  // return;
-
-
   var suspectedId = $("#suspectedId").val();
   var suspectedId = $("#suspectedId").val();
   var userId = $("#userId").val();
   var userId = $("#userId").val();
   var userName = $("#js_input_user_name").val();
   var userName = $("#js_input_user_name").val();
@@ -377,6 +401,10 @@ function ribaoCommit() {
   var fatigue = $("#js_input_user_fali").attr("data-values") == undefined ? 0 : $("#js_input_user_fali").attr("data-values");
   var fatigue = $("#js_input_user_fali").attr("data-values") == undefined ? 0 : $("#js_input_user_fali").attr("data-values");
   var diarrhea = $("#js_input_user_fuxie").attr("data-values") == undefined ? 0 : $("#js_input_user_fuxie").attr("data-values");
   var diarrhea = $("#js_input_user_fuxie").attr("data-values") == undefined ? 0 : $("#js_input_user_fuxie").attr("data-values");
   var others = $("#shuruqita").val() == undefined ? "" : $("#shuruqita").val();
   var others = $("#shuruqita").val() == undefined ? "" : $("#shuruqita").val();
+  var scoreRezult = $("#js_input_score_rezult").val() == undefined ? "" : $("#js_input_score_rezult").val();
+  var temperatureScore = $("#js_input_temperature_score").val() == undefined ? "" : $("#js_input_temperature_score").val();
+  var scoreHistroy = $("#js_input_score_histroy").val() == undefined ? "" : $("#js_input_score_histroy").val();
+  var score = $("#js_input_score").val() == undefined ? "" : $("#js_input_score").val();
 
 
   if (userName == undefined || userName == '') {
   if (userName == undefined || userName == '') {
     $.alert("请填写姓名");
     $.alert("请填写姓名");
@@ -424,6 +452,10 @@ function ribaoCommit() {
       "fatigue": fatigue,
       "fatigue": fatigue,
       "diarrhea": diarrhea,
       "diarrhea": diarrhea,
       "others": others,
       "others": others,
+      "scoreRezult": scoreRezult,
+      "temperatureScore": temperatureScore,
+      "scoreHistroy": scoreHistroy,
+      "score": score,
     },
     },
     success: function (data) {
     success: function (data) {
       if ($('#ribao')[0].style.display == 'none') {
       if ($('#ribao')[0].style.display == 'none') {
@@ -586,7 +618,7 @@ function helpValue1(v) {
   var temperature = "体温:" + v.temperature + ";";
   var temperature = "体温:" + v.temperature + ";";
   var cough = "";
   var cough = "";
   if (v.cough != 0)
   if (v.cough != 0)
-    cough = "咳嗽:" + getCough(v.cough) + ";";
+    cough = "咳嗽现象:" + getCough(v.cough) + ";";
   var muscle = "";
   var muscle = "";
   if (v.muscle != 0)
   if (v.muscle != 0)
     muscle = "肌肉酸痛:" + getMuscle(v.muscle) + ";";
     muscle = "肌肉酸痛:" + getMuscle(v.muscle) + ";";
@@ -595,10 +627,10 @@ function helpValue1(v) {
     dyspnea = "呼吸困难:" + getDyspnea(v.dyspnea) + ";";
     dyspnea = "呼吸困难:" + getDyspnea(v.dyspnea) + ";";
   var fatigue = "";
   var fatigue = "";
   if (v.fatigue != 0)
   if (v.fatigue != 0)
-    fatigue = "乏力:" + getFatigue(v.fatigue) + ";";
+    fatigue = "乏力现象:" + getFatigue(v.fatigue) + ";";
   var diarrhea = "";
   var diarrhea = "";
   if (v.diarrhea != 0)
   if (v.diarrhea != 0)
-    diarrhea = "腹泻:" + getDiarrhea(v.diarrhea) + ";";
+    diarrhea = "腹泻现象:" + getDiarrhea(v.diarrhea) + ";";
   var others = "";
   var others = "";
   if (v.others != "")
   if (v.others != "")
     others = "其他:" + v.others;
     others = "其他:" + v.others;
@@ -680,9 +712,9 @@ function getFatigue(fatigue) {
   if (fatigue == 0)
   if (fatigue == 0)
     return "无";
     return "无";
   else if (fatigue == 1)
   else if (fatigue == 1)
-    return "可体力劳动但觉得累";
+    return "体力劳动后不能恢复";
   else if (fatigue == 2)
   else if (fatigue == 2)
-    return "轻体力劳动后长时间不能恢复";
+    return "轻体力活非常累";
   else if (fatigue == 3)
   else if (fatigue == 3)
     return "不能正常生活";
     return "不能正常生活";
   return "";
   return "";
@@ -755,4 +787,72 @@ function clearShow() {
   $("#shuruqita").val("");
   $("#shuruqita").val("");
 }
 }
 
 
+//健康评估
+$('#ribao_score').on('click', function () {
+  var suspectedId = $("#suspectedId").val();
+  var userId = $("#userId").val();
+  var userName = $("#js_input_user_name").val();
+  var temperature = $("#js_input_user_tiwen").val() == "" ? 0 : $("#js_input_user_tiwen").val();
+  var cough = $("#js_input_user_kesou").attr("data-values") == undefined ? 0 : $("#js_input_user_kesou").attr("data-values");
+  var muscle = $("#js_input_user_jirou").attr("data-values") == undefined ? 0 : $("#js_input_user_jirou").attr("data-values");
+  var dyspnea = $("#js_input_user_huxi").attr("data-values") == undefined ? 0 : $("#js_input_user_huxi").attr("data-values");
+  var fatigue = $("#js_input_user_fali").attr("data-values") == undefined ? 0 : $("#js_input_user_fali").attr("data-values");
+  var diarrhea = $("#js_input_user_fuxie").attr("data-values") == undefined ? 0 : $("#js_input_user_fuxie").attr("data-values");
+  if (userName == undefined || userName == '') {
+    $.alert("请填写姓名");
+    return;
+  }
+  if (temperature <= 0) {
+    $.alert("请填写体温");
+    return;
+  }
+  if (temperature > 50 || temperature < 30) {
+    $.alert("请填写正确的体温");
+    return;
+  }
+
+  $.ajax({
+    url: '/home/addScore',
+    type: "post",
+    data: {
+      "userName": userName,
+      "suspectedId": suspectedId,
+      "userCreate": userId,
+      "temperature": temperature,
+      "cough": cough,
+      "muscle": muscle,
+      "dyspnea": dyspnea,
+      "fatigue": fatigue,
+      "diarrhea": diarrhea,
+    },
+    success: function (data) {
+      if (data == undefined) {
+        $('#js_input_score_rezult').empty();
+      }
+      else {
+        var ScoreRezult = getScoreRezult(data.scoreRezult);
+        $("#js_input_score_rezult").val(ScoreRezult);
+        // $("#js_input_temperature_score").val(data.temperatureScore);
+        // $("#js_input_score_histroy").val(data.scoreHistory);
+        // $("#js_input_score").val(data.score);
+      }
+    },
+  });
+});
+
+
+function getScoreRezult(scoreRezult) {
+  if (scoreRezult == 0)
+    return "未评估";
+  else if (scoreRezult == 1)
+    return "安全";
+  else if (scoreRezult == 2)
+    return "注意观察";
+  else if (scoreRezult == 3)
+    return "联系医生";
+  else if (scoreRezult == 4)
+    return "尽快就诊";
+  return "";
+}
+
 
 

+ 5 - 1
whepi-web/src/main/java/com/bofeng/dao/MsSuspectedMapper.java

@@ -23,5 +23,9 @@ public interface MsSuspectedMapper extends BaseMapper<MsSuspected> {
 
 
     //判断家人姓名是否重复
     //判断家人姓名是否重复
     @Select("select count(*) from ms_suspected where report_id=#{reportId} and user_name=#{userName}")
     @Select("select count(*) from ms_suspected where report_id=#{reportId} and user_name=#{userName}")
-    Integer selectUserNameNum(@Param("reportId") Long reportId,@Param("userName") String userName);
+    Integer selectUserNameNum(@Param("reportId") Long reportId, @Param("userName") String userName);
+
+    //判断家人是否有历史评分
+    @Select("select score from ms_suspected where user_create=#{userCreate} and user_name=#{userName} order by time_update desc limit 1")
+    Integer selectUserNameScore(@Param("userCreate") Long userCreate, @Param("userName") String userName);
 }
 }

+ 12 - 0
whepi-web/src/main/java/com/bofeng/entity/MsSuspected.java

@@ -56,6 +56,9 @@ public class MsSuspected {
     @TableField("temperature")
     @TableField("temperature")
     private BigDecimal temperature;
     private BigDecimal temperature;
 
 
+    @TableField("temperature_score")
+    private Integer temperatureScore;
+
     @TableField("cough")
     @TableField("cough")
     private Integer cough;
     private Integer cough;
 
 
@@ -83,6 +86,15 @@ public class MsSuspected {
     @TableField("diarrhea")
     @TableField("diarrhea")
     private Integer diarrhea;
     private Integer diarrhea;
 
 
+    @TableField("score_history")
+    private Integer scoreHistory;
+
+    @TableField("score")
+    private Integer score;
+
+    @TableField("score_rezult")
+    private Integer scoreRezult;
+
     @TableField(exist = false)
     @TableField(exist = false)
     private String diarrheaStr = "";
     private String diarrheaStr = "";
 
 

+ 88 - 1
whepi-web/src/main/java/com/bofeng/service/MsSuspectedService.java

@@ -6,6 +6,7 @@ import com.bofeng.dao.MsReportMapper;
 import com.bofeng.dao.MsSuspectedMapper;
 import com.bofeng.dao.MsSuspectedMapper;
 import com.bofeng.entity.MsReport;
 import com.bofeng.entity.MsReport;
 import com.bofeng.entity.MsSuspected;
 import com.bofeng.entity.MsSuspected;
+import io.swagger.models.auth.In;
 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;
@@ -41,7 +42,7 @@ public class MsSuspectedService {
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
     public Long addSuspected(Long suspectedId, String userName, Integer grender, Integer age, Integer familyStatus,
     public Long addSuspected(Long suspectedId, String userName, Integer grender, Integer age, Integer familyStatus,
                              String statusDesp, Integer medical, BigDecimal temperature, Integer cough, Integer muscle,
                              String statusDesp, Integer medical, BigDecimal temperature, Integer cough, Integer muscle,
-                             Integer dyspnea, Integer fatigue, Integer diarrhea, Integer singleRoom, String others, Long userCreate) {
+                             Integer dyspnea, Integer fatigue, Integer diarrhea, Integer singleRoom, String others, Long userCreate,Integer scoreRezult,Integer temperatureScore,Integer scoreHistroy, Integer score) {
         Long reportId = 0L;
         Long reportId = 0L;
         //如果是当前日期 已经添加
         //如果是当前日期 已经添加
         Date t = new Date();
         Date t = new Date();
@@ -118,6 +119,10 @@ public class MsSuspectedService {
             msSuspected.setSingleRoom(singleRoom);
             msSuspected.setSingleRoom(singleRoom);
             msSuspected.setOthers(others);
             msSuspected.setOthers(others);
             msSuspected.setSuspectedStatus(suspectedStatus);
             msSuspected.setSuspectedStatus(suspectedStatus);
+            msSuspected.setScoreRezult(scoreRezult);
+            msSuspected.setScore(score);
+            msSuspected.setScoreHistory(scoreHistroy);
+            msSuspected.setTemperatureScore(temperatureScore);
             msSuspected.setUserCreate(userCreate);
             msSuspected.setUserCreate(userCreate);
             msSuspected.setTimeCreate(DateTime.now());
             msSuspected.setTimeCreate(DateTime.now());
             msSuspected.setUserUpdate(userCreate);
             msSuspected.setUserUpdate(userCreate);
@@ -202,4 +207,86 @@ public class MsSuspectedService {
             msReportMapper.updateById(msReport);
             msReportMapper.updateById(msReport);
         }
         }
     }
     }
+
+    //健康评估
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+    public MsSuspected getScore(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);
+        if (scoreHistroy == null)
+            scoreHistroy = 0;
+        msSuspected.setScoreHistory(scoreHistroy);
+        msSuspected.setScoreRezult(scoreRezulte(msSuspected.getScoreHistory(), msSuspected.getScore()));
+        return msSuspected;
+    }
+
+    //获取温度评分
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+    public Integer getTemperatureScore(BigDecimal temperature) {
+        Integer score = 0;
+        //温度
+        if (temperature.compareTo(new BigDecimal(37.3)) == -1)//37.3以下0分
+            score += 0;
+        if (temperature.compareTo(new BigDecimal(37.4)) > -1 && temperature.compareTo(new BigDecimal(38)) < 1)//   37.3~38℃为 1分
+            score += 1;
+        if (temperature.compareTo(new BigDecimal(38.1)) > -1 && temperature.compareTo(new BigDecimal(39)) < 1)// 38.1~39℃为中度发热 2分
+            score += 2;
+        if (temperature.compareTo(new BigDecimal(39.1)) > -1 && temperature.compareTo(new BigDecimal(34)) < 1)//39.1~40℃为高热 3分
+            score += 3;
+        if (temperature.compareTo(new BigDecimal(39.1)) > -1 && temperature.compareTo(new BigDecimal(34)) < 1)//340℃以上为超高热 4分
+            score += 4;
+        return score;
+    }
+
+    //获取总评分
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+    public Integer addScore(BigDecimal temperature, Integer cough, Integer muscle, Integer dyspnea, Integer fatigue, Integer diarrhea) {
+        Integer score = getTemperatureScore(temperature);
+        //咳嗽
+        score += cough;
+        //肌肉
+        score += muscle;
+        //肌肉
+        score += dyspnea;
+        //肌肉
+        score += fatigue;
+        //肌肉
+        score += diarrhea;
+        return score;
+    }
+
+    //评估结果
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+    public Integer scoreRezulte(Integer scoreHistory, Integer score) {
+        Integer scoreRezult = 0;
+        //判断用户是否含有历史评分
+        if (scoreHistory == 0) {
+            //判断结果
+            if (score <= 1)
+                scoreRezult = 1;
+            if (score >= 2 && score <= 3)
+                scoreRezult = 2;
+            if (score == 4)
+                scoreRezult = 3;
+            if (score > 4)
+                scoreRezult = 4;
+
+        } else {
+            if (score - scoreHistory >= 3)
+                return 4;
+            else {
+                if (score <= 1)
+                    scoreRezult = 1;
+                if (score >= 2 && score <= 3)
+                    scoreRezult = 2;
+                if (score == 4)
+                    scoreRezult = 3;
+                if (score > 4)
+                    scoreRezult = 4;
+            }
+        }
+        return scoreRezult;
+    }
 }
 }

+ 20 - 1
whepi-web/src/main/java/com/bofeng/wx/controller/MsReportController.java

@@ -51,7 +51,11 @@ public class MsReportController {
         Integer diarrhea = Conv.NI(request.getParameter("diarrhea"));
         Integer diarrhea = Conv.NI(request.getParameter("diarrhea"));
         Integer singleRoom = Conv.NI(request.getParameter("singleRoom"));
         Integer singleRoom = Conv.NI(request.getParameter("singleRoom"));
         String others = request.getParameter("others");
         String others = request.getParameter("others");
-        Long reportId =msSuspectedService.addSuspected(suspectedId, userName, grender, age, familyStatus, statusDesp, medical, temperature, cough, muscle, dyspnea, fatigue, diarrhea, singleRoom, others, userCreate);
+        Integer scoreRezult = Conv.NI(request.getParameter("scoreRezult"));
+        Integer temperatureScore = Conv.NI(request.getParameter("temperatureScore"));
+        Integer scoreHistroy = Conv.NI(request.getParameter("scoreHistroy"));
+        Integer score = Conv.NI(request.getParameter("score"));
+        Long reportId =msSuspectedService.addSuspected(suspectedId, userName, grender, age, familyStatus, statusDesp, medical, temperature, cough, muscle, dyspnea, fatigue, diarrhea, singleRoom, others, userCreate,scoreRezult,temperatureScore,scoreHistroy,score);
 
 
         return msReportService.getByReport(reportId);
         return msReportService.getByReport(reportId);
     }
     }
@@ -119,4 +123,19 @@ public class MsReportController {
         msReportService.getNowByYesterday(userCreate);
         msReportService.getNowByYesterday(userCreate);
         return 1;
         return 1;
     }
     }
+
+    //健康评估
+    @PostMapping("/home/addScore")
+    public MsSuspected addScore(HttpServletRequest request) {
+        String userName = request.getParameter("userName");
+        Long userCreate = Conv.NL(request.getParameter("userCreate"));
+        BigDecimal temperature = new BigDecimal(request.getParameter("temperature"));
+        Integer cough = Conv.NI(request.getParameter("cough"));
+        Integer muscle = Conv.NI(request.getParameter("muscle"));
+        Integer dyspnea = Conv.NI(request.getParameter("dyspnea"));
+        Integer fatigue = Conv.NI(request.getParameter("fatigue"));
+        Integer diarrhea = Conv.NI(request.getParameter("diarrhea"));
+        return msSuspectedService.getScore(userName,temperature, cough, muscle, dyspnea, fatigue, diarrhea, userCreate);
+    }
+
 }
 }