Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	whepi-ui/templates/home/ribao.js
yuliang 5 years ago
parent
commit
2d87ff22d5

+ 1 - 1
whepi-ui/templates/home/home.ftl

@@ -62,7 +62,7 @@
         ribao_cancel();
         ribao_cancel();
 
 
         <#if msReport ??>var msReport = ${msReport}</#if>;
         <#if msReport ??>var msReport = ${msReport}</#if>;
-        $('#ribao_safety_num').val(msReport.safetyNum);
+        $('#ribao_jinrijujian').append(msReport.safetyNum);
         ribaoInitialization(msReport.reportId);
         ribaoInitialization(msReport.reportId);
         /*submit_back();*/
         /*submit_back();*/
         familyClick();
         familyClick();

+ 4 - 4
whepi-ui/templates/home/ribao.ftl

@@ -16,12 +16,12 @@
                             <div class="weui-cell__hd">
                             <div class="weui-cell__hd">
                                 <label class="weui-label">今日居家</label>
                                 <label class="weui-label">今日居家</label>
                             </div>
                             </div>
-                            <div class="weui-cell__bd">
-                                <input id="ribao_safety_num" class="weui-input" type="number" pattern="[0-2]*" placeholder="请输入今日家庭成员数量">
+                            <div class="weui-cell__bd" id="ribao_jinrijujian">
+
                             </div>
                             </div>
                             <div class="weui-cell__ft">
                             <div class="weui-cell__ft">
                                 <a id="btnAdd" href="javascript:"
                                 <a id="btnAdd" href="javascript:"
-                                   class="weui-btn weui-btn_mini weui-btn_primary">病情描述</a>
+                                   class="weui-btn weui-btn_mini weui-btn_primary">添加人员</a>
                             </div>
                             </div>
                         </div>
                         </div>
                     </div>
                     </div>
@@ -35,7 +35,7 @@
                         注:请如实上报情况,便以相互帮助,小区是我家,团结就是力量!
                         注:请如实上报情况,便以相互帮助,小区是我家,团结就是力量!
                     </span></div>
                     </span></div>
                     <div class="weui-btn-area">
                     <div class="weui-btn-area">
-                        <a id="btn_shangbao" class="weui-btn weui-btn_primary" href="javascript:" id="showTooltips" onclick="addReport()">全家报平安</a>
+                        <a id="btn_shangbao" class="weui-btn weui-btn_primary" href="javascript:" id="showTooltips" onclick="addReport()">上报</a>
                     </div>
                     </div>
                 </div>
                 </div>
                 <div id="ribao" class="weui-btn-area" style="display: none">
                 <div id="ribao" class="weui-btn-area" style="display: none">

+ 2 - 7
whepi-ui/templates/home/ribao.js

@@ -232,7 +232,7 @@ function ribaoInitialization(reportId) {
           ribao_cell(v);
           ribao_cell(v);
         });
         });
       } else {
       } else {
-        $('#btn_shangbao').text('全家报平安');
+        $('#btn_shangbao').text('上报');
       }
       }
     },
     },
     error: function () {
     error: function () {
@@ -354,6 +354,7 @@ function ribaoCommit() {
   var dyspnea = $("#js_input_user_huxi").attr("data-values") == undefined ? 0 : $("#js_input_user_huxi").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 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 diarrheaNum = 0;
   var others = $("#shuruqita").val()== undefined ? "" : $("#jibenmiaoshu").val();
   var others = $("#shuruqita").val()== undefined ? "" : $("#jibenmiaoshu").val();
 
 
   if (userName == undefined || userName == '') {
   if (userName == undefined || userName == '') {
@@ -471,17 +472,11 @@ function updateSuspected(suspectedId) {
 
 
 function addReport() {
 function addReport() {
   var userId = $("#userId").val();
   var userId = $("#userId").val();
-  var safety_num = $("#ribao_safety_num").val();
-  if (safety_num == "") {
-    alert("请填写居家人数");
-    return;
-  }
   $.ajax({
   $.ajax({
     url: '/home/addReport',
     url: '/home/addReport',
     type: "post",
     type: "post",
     data: {
     data: {
       "userCreate": userId,
       "userCreate": userId,
-      "safetyNum": safety_num,
     },
     },
     success: function (data) {
     success: function (data) {
       $.toast("操作成功");
       $.toast("操作成功");

+ 8 - 0
whepi-ui/templates/yeweihui/qiuzhuDetail.ftl

@@ -2,6 +2,10 @@
 <#include "/home/frag.head.ftl" />
 <#include "/home/frag.head.ftl" />
 
 
 <div class="weui-tab">
 <div class="weui-tab">
+    <div class="weui-btn-area" style="display: flex; flex-direction: row;">
+        <a class="weui-btn weui-btn_primary" href="javascript:goback();" style="width: 25vw; height: 6vh; line-height: 6vh;">返回</a>
+        <div style="width: 65%;"></div>
+    </div>
 
 
     <div class="weui-btn-area">
     <div class="weui-btn-area">
 
 
@@ -97,6 +101,10 @@
         });
         });
     }
     }
 
 
+    function goback() {
+        history.back();
+    }
+
     function getdealdetail() {
     function getdealdetail() {
         $.ajax({
         $.ajax({
             url: '/yeweihui/qiuzhu/reply/querybytaskid.json',
             url: '/yeweihui/qiuzhu/reply/querybytaskid.json',

+ 5 - 2
whepi-ui/templates/yeweihui/ribaoXq.ftl

@@ -24,6 +24,7 @@
                             <tr>
                             <tr>
                                 <td style="background-color: lightgrey" align="center">今日居家</td>
                                 <td style="background-color: lightgrey" align="center">今日居家</td>
                                 <td style="background-color: lightgrey" align="center">确诊入院</td>
                                 <td style="background-color: lightgrey" align="center">确诊入院</td>
+                                <td style="background-color: lightgrey" align="center">隔离人数</td>
                                 <td style="background-color: lightgrey" align="center">异常观察</td>
                                 <td style="background-color: lightgrey" align="center">异常观察</td>
                                 <td style="background-color: lightgrey" align="center">身体正常</td>
                                 <td style="background-color: lightgrey" align="center">身体正常</td>
                             </tr>
                             </tr>
@@ -86,12 +87,14 @@
                         $("#msh3").text(v.ridgepole+"栋"+v.unit+"单元"+v.doorplate+"室");
                         $("#msh3").text(v.ridgepole+"栋"+v.unit+"单元"+v.doorplate+"室");
                         var t1 = $('<td align="center">'+v.safetyNum+'</td>');
                         var t1 = $('<td align="center">'+v.safetyNum+'</td>');
                         var t2 = $('<td align="center">'+v.sureNum+'</td>');
                         var t2 = $('<td align="center">'+v.sureNum+'</td>');
-                        var t3 = $('<td align="center">'+v.suspectedNum+'</td>');
-                        var t4 = $('<td align="center">'+v.normalNum+'</td>');
+                        var t3 = $('<td align="center">'+v.singleNum+'</td>');//隔离
+                        var t4 = $('<td align="center">'+v.suspectedNum+'</td>');
+                        var t5 = $('<td align="center">'+v.normalNum+'</td>');
                         $("#zc").append(t1);
                         $("#zc").append(t1);
                         $("#zc").append(t2);
                         $("#zc").append(t2);
                         $("#zc").append(t3);
                         $("#zc").append(t3);
                         $("#zc").append(t4);
                         $("#zc").append(t4);
+                        $("#zc").append(t5);
                     }
                     }
 
 
                     var tr = $("<tr></tr>");
                     var tr = $("<tr></tr>");

+ 16 - 3
whepi-web/src/main/java/com/bofeng/dao/MsReportMapper.java

@@ -7,6 +7,7 @@ import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
 import org.apache.ibatis.annotations.Select;
 import org.springframework.stereotype.Repository;
 import org.springframework.stereotype.Repository;
 
 
+import java.math.BigDecimal;
 import java.util.List;
 import java.util.List;
 
 
 /**
 /**
@@ -17,13 +18,25 @@ import java.util.List;
 @Repository
 @Repository
 public interface MsReportMapper extends BaseMapper<MsReport> {
 public interface MsReportMapper extends BaseMapper<MsReport> {
 
 
-    List<MsReport> selectByReportDate(@Param("reportDate") String reportDate,@Param("userCreate") Long userCreate);
+    List<MsReport> selectByReportDate(@Param("reportDate") String reportDate, @Param("userCreate") Long userCreate);
 
 
     @Select("select property_id from sys_user_role where user_id=#{userId} and role_id=1")
     @Select("select property_id from sys_user_role where user_id=#{userId} and role_id=1")
     long selectHouseIdByUserId(@Param("userId") Long userId);
     long selectHouseIdByUserId(@Param("userId") Long userId);
 
 
-    //
+    //确诊
     @Select("select count(*) from ms_suspected where report_id=#{reportId} and  medical=#{medical}")
     @Select("select count(*) from ms_suspected where report_id=#{reportId} and  medical=#{medical}")
-    Integer selectSuspectedNum(@Param("reportId") Long reportId,@Param("medical") Integer medical);
+    Integer selectSuspectedNum(@Param("reportId") Long reportId, @Param("medical") Integer medical);
+
+    //隔离
+    @Select("select count(*) from ms_suspected where report_id=#{reportId} and  single_room=#{singleRoom}")
+    Integer selectSingleRoomNum(@Param("reportId") Long reportId, @Param("singleRoom") Integer singleRoom);
+
+    //正常
+    @Select("select count(*) from ms_suspected where report_id=#{reportId} and  36 &lt;= #{temperature} and #{temperature} &lt;= 37.3")
+    Integer selectisSuspectedNum(@Param("reportId") Long reportId, @Param("temperature") BigDecimal temperature);
+
+    //疑似
+    @Select("select count(*) from ms_suspected where report_id=#{reportId} and (#{temperature} &lt; 36 or 37.3 &lt; #{temperature})")
+    Integer selectisNoSuspectedNum(@Param("reportId") Long reportId, @Param("temperature") BigDecimal temperature);
 
 
 }
 }

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

@@ -33,7 +33,7 @@ public interface RbMapper extends BaseMapper<sysUptownUnit> {
 
 
     @Select("select a.normal_num as normalNum,e.ridgepole as ridgepole,e.unit as unit,b.doorplate as doorplate,a.safety_num as safetyNum,a.sure_num as sureNum,a.suspected_num as suspectedNum," +
     @Select("select a.normal_num as normalNum,e.ridgepole as ridgepole,e.unit as unit,b.doorplate as doorplate,a.safety_num as safetyNum,a.sure_num as sureNum,a.suspected_num as suspectedNum," +
             "c.user_name as userName,c.cough as cough,c.muscle as muscle,c.dyspnea as dyspnea," +
             "c.user_name as userName,c.cough as cough,c.muscle as muscle,c.dyspnea as dyspnea," +
-            "c.chest as chest,c.fatigue as fatigue,c.diarrhea as diarrhea,c.others as others " +
+            "c.fatigue as fatigue,c.diarrhea as diarrhea,c.others as others,c.single_room as singleRoom,a.single_num as singleNum " +
             "from ms_report a " +
             "from ms_report a " +
             "inner join sys_uptown_house b on b.house_id = a.house_id " +
             "inner join sys_uptown_house b on b.house_id = a.house_id " +
             "inner join sys_uptown_unit e on e.unit_id = b.unit_id " +
             "inner join sys_uptown_unit e on e.unit_id = b.unit_id " +

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

@@ -121,4 +121,10 @@ public class MsSuspected {
 
 
     @TableField(exist = false)
     @TableField(exist = false)
     private String doorplate;
     private String doorplate;
+
+    @TableField(exist = false)
+    private Integer singleNum;
+
+    @TableField("single_room")
+    private String singleRoomStr;
 }
 }

+ 73 - 28
whepi-web/src/main/java/com/bofeng/service/MsReportService.java

@@ -13,6 +13,7 @@ import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 
 
 import java.text.SimpleDateFormat;
 import java.text.SimpleDateFormat;
+import java.util.Calendar;
 import java.util.Date;
 import java.util.Date;
 import java.util.List;
 import java.util.List;
 
 
@@ -33,6 +34,7 @@ public class MsReportService {
         return msSuspectedMapper.selectByReportId(reportId);
         return msSuspectedMapper.selectByReportId(reportId);
     }
     }
 
 
+    //获取前一天数据
     public List<MsSuspected> getByReportReportDate(String reportDate, Long userCreate) {
     public List<MsSuspected> getByReportReportDate(String reportDate, Long userCreate) {
 
 
         List<MsReport> listReport = msReportMapper.selectByReportDate(reportDate, userCreate);
         List<MsReport> listReport = msReportMapper.selectByReportDate(reportDate, userCreate);
@@ -43,6 +45,7 @@ public class MsReportService {
         return listSuspected;
         return listSuspected;
     }
     }
 
 
+    //获取今天数据
     public MsReport getReportByDateNow(Long userCreate) {
     public MsReport getReportByDateNow(Long userCreate) {
         Date t = new Date();
         Date t = new Date();
         SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
         SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
@@ -55,44 +58,86 @@ public class MsReportService {
         return msReport;
         return msReport;
     }
     }
 
 
+    //上报
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
-    public void addReport(String safetyNum, Long userCreate) {
-        //如果是当前日期 已经添加
+    public void addReport(Long userCreate) {
         Date t = new Date();
         Date t = new Date();
         SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
         SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
         String reportDate = df.format(t);
         String reportDate = df.format(t);
         List<MsReport> listReport = msReportMapper.selectByReportDate(reportDate, userCreate);
         List<MsReport> listReport = msReportMapper.selectByReportDate(reportDate, userCreate);
-        Long houseId = msReportMapper.selectHouseIdByUserId(userCreate);
-        if (listReport == null || listReport.size() == 0) {
-            MsReport msReport = new MsReport();
-            msReport.setReportId(IdWorker.getId());
-            msReport.setHouseId(houseId);
-            msReport.setSafetyNum(Integer.parseInt(safetyNum));
-            msReport.setSuspectedNum(0);
-            msReport.setRemarks("");
-            msReport.setReportDate(DateTime.now().toDate());
+        MsReport msReport = msReportMapper.selectById(Long.parseLong(listReport.get(0).getReportId().toString()));
+        if (msReport != null) {
             msReport.setReportStatus(1);
             msReport.setReportStatus(1);
-            msReport.setMsStatus(1);
-            msReport.setUserCreate(userCreate);
-            msReport.setTimeCreate(DateTime.now());
             msReport.setUserUpdate(userCreate);
             msReport.setUserUpdate(userCreate);
             msReport.setTimeUpdate(DateTime.now());
             msReport.setTimeUpdate(DateTime.now());
-            msReportMapper.insert(msReport);
-        } else {
-            //更新居家成员
-            MsReport msReport = msReportMapper.selectById(listReport.get(0).getReportId());
+            msReportMapper.updateById(msReport);
+        }
+    }
+
+    //通过昨天数据更新今天数据
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+    public void getNowByYesterday(Long userCreate) {
+
+        //判断昨天是否有数据
+        SimpleDateFormat sj = new SimpleDateFormat("yyyy-MM-dd");
+        Date d = new Date();
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(d);
+        calendar.add(Calendar.DATE, -1);
+        String reportDate = sj.format(calendar.getTime());
+        List<MsReport> listReport = msReportMapper.selectByReportDate(reportDate, userCreate);
+        //有数据
+        if (listReport != null && listReport.size() > 0) {
+            //添加到今天日报
+            MsReport msReport = msReportMapper.selectById(Long.parseLong(listReport.get(0).getReportId().toString()));
             if (msReport != null) {
             if (msReport != null) {
-                List<MsSuspected> list= msSuspectedMapper.selectByReportId(msReport.getReportId());
-                if(list==null || list.size()==0)
-                    msReport.setMsStatus(1);
-                else
-                    msReport.setMsStatus(2);
-                msReport.setReportStatus(1);
-                msReport.setSafetyNum(Integer.parseInt(safetyNum));
-                msReport.setUserUpdate(0L);
-                msReport.setTimeUpdate(DateTime.now());
-                msReportMapper.updateById(msReport);
+                MsReport msReport1 = new MsReport();
+                msReport1.setReportId(IdWorker.getId());
+                msReport1.setHouseId(msReport.getHouseId());
+                msReport1.setSafetyNum(msReport.getSafetyNum());
+                msReport1.setSureNum(msReport.getSureNum());
+                msReport1.setSuspectedNum(msReport.getSuspectedNum());
+                msReport1.setNormalNum(msReport.getNormalNum());
+                msReport1.setSingleNum(msReport.getSingleNum());
+                msReport1.setRemarks(msReport.getRemarks());
+                msReport1.setReportDate(DateTime.now().toDate());
+                msReport1.setMsStatus(2);
+                msReport1.setUserCreate(userCreate);
+                msReport1.setTimeCreate(DateTime.now());
+                msReport1.setUserUpdate(userCreate);
+                msReport1.setTimeUpdate(DateTime.now());
+                msReportMapper.insert(msReport);
+            }
+            //添加今日家庭
+            List<MsSuspected> listSuspected = msSuspectedMapper.selectByReportId(Long.parseLong(listReport.get(0).getReportId().toString()));
+            if (listSuspected != null && listSuspected.size() > 0) {
+                for (MsSuspected msSuspected : listSuspected) {
+
+                    MsSuspected msSuspected1 = new MsSuspected();
+                    msSuspected1.setSuspectedId(IdWorker.getId());
+                    msSuspected1.setReportId(Long.parseLong(listReport.get(0).getReportId().toString()));
+                    msSuspected1.setUserName(msSuspected.getUserName());
+                    msSuspected1.setGrender(msSuspected.getGrender());
+                    msSuspected1.setAge(msSuspected.getAge());
+                    msSuspected1.setFamilyStatus(msSuspected.getFamilyStatus());
+                    msSuspected1.setStatusDesp(msSuspected.getStatusDesp());
+                    msSuspected1.setMedical(msSuspected.getMedical());
+                    msSuspected1.setTemperature(msSuspected.getTemperature());
+                    msSuspected1.setCough(msSuspected.getCough());
+                    msSuspected1.setMuscle(msSuspected.getMuscle());
+                    msSuspected1.setDiarrhea(msSuspected.getDiarrhea());
+                    msSuspected1.setFatigue(msSuspected.getFatigue());
+                    msSuspected1.setDiarrhea(msSuspected.getDiarrhea());
+                    msSuspected1.setSingleRoom(msSuspected.getSingleRoom());
+                    msSuspected1.setOthers(msSuspected.getOthers());
+                    msSuspected1.setUserCreate(userCreate);
+                    msSuspected1.setTimeCreate(DateTime.now());
+                    msSuspected1.setUserUpdate(userCreate);
+                    msSuspected1.setTimeUpdate(DateTime.now());
+                    msSuspectedMapper.insert(msSuspected);
+                }
             }
             }
         }
         }
     }
     }
+
 }
 }

+ 80 - 31
whepi-web/src/main/java/com/bofeng/service/MsSuspectedService.java

@@ -31,11 +31,18 @@ public class MsSuspectedService {
     @Autowired
     @Autowired
     private MsReportMapper msReportMapper;
     private MsReportMapper msReportMapper;
 
 
+    //查询家人
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+    public MsSuspected selectSuspected(long suspectedId) {
+
+        return msSuspectedMapper.selectById(suspectedId);
+    }
 
 
+    //添加家人
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
     public void addSuspected(String userName, Integer grender, Integer age, Integer familyStatus,
     public void addSuspected(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 chest, Integer fatigue, Integer diarrhea, Integer diarrheaNum, String others, Long userCreate) {
+                             Integer dyspnea, Integer fatigue, Integer diarrhea, Integer singleRoom, String others, Long userCreate) {
         Long reportId = 0L;
         Long reportId = 0L;
         //如果是当前日期 已经添加
         //如果是当前日期 已经添加
         Date t = new Date();
         Date t = new Date();
@@ -43,12 +50,16 @@ public class MsSuspectedService {
         String reportDate = df.format(t);
         String reportDate = df.format(t);
         List<MsReport> listReport = msReportMapper.selectByReportDate(reportDate, userCreate);
         List<MsReport> listReport = msReportMapper.selectByReportDate(reportDate, userCreate);
         Long houseId = msReportMapper.selectHouseIdByUserId(userCreate);
         Long houseId = msReportMapper.selectHouseIdByUserId(userCreate);
+        //首次进入。没有今日报告
         if (listReport == null || listReport.size() == 0) {
         if (listReport == null || listReport.size() == 0) {
             MsReport msReport = new MsReport();
             MsReport msReport = new MsReport();
             msReport.setReportId(IdWorker.getId());
             msReport.setReportId(IdWorker.getId());
             msReport.setHouseId(houseId);
             msReport.setHouseId(houseId);
             msReport.setSafetyNum(0);
             msReport.setSafetyNum(0);
+            msReport.setSureNum(0);
             msReport.setSuspectedNum(0);
             msReport.setSuspectedNum(0);
+            msReport.setNormalNum(0);
+            msReport.setSingleNum(0);
             msReport.setRemarks("");
             msReport.setRemarks("");
             msReport.setReportDate(DateTime.now().toDate());
             msReport.setReportDate(DateTime.now().toDate());
             msReport.setMsStatus(2);
             msReport.setMsStatus(2);
@@ -71,14 +82,14 @@ public class MsSuspectedService {
         msSuspected.setAge(age);
         msSuspected.setAge(age);
         msSuspected.setFamilyStatus(familyStatus);
         msSuspected.setFamilyStatus(familyStatus);
         msSuspected.setStatusDesp(statusDesp);
         msSuspected.setStatusDesp(statusDesp);
+        msSuspected.setMedical(medical);
         msSuspected.setTemperature(temperature);
         msSuspected.setTemperature(temperature);
         msSuspected.setCough(cough);
         msSuspected.setCough(cough);
         msSuspected.setMuscle(muscle);
         msSuspected.setMuscle(muscle);
         msSuspected.setDiarrhea(dyspnea);
         msSuspected.setDiarrhea(dyspnea);
-        msSuspected.setChest(chest);
         msSuspected.setFatigue(fatigue);
         msSuspected.setFatigue(fatigue);
         msSuspected.setDiarrhea(diarrhea);
         msSuspected.setDiarrhea(diarrhea);
-        msSuspected.setDiarrheaNum(diarrheaNum);
+        msSuspected.setSingleRoom(singleRoom);
         msSuspected.setOthers(others);
         msSuspected.setOthers(others);
         msSuspected.setUserCreate(userCreate);
         msSuspected.setUserCreate(userCreate);
         msSuspected.setTimeCreate(DateTime.now());
         msSuspected.setTimeCreate(DateTime.now());
@@ -86,18 +97,38 @@ public class MsSuspectedService {
         msSuspected.setTimeUpdate(DateTime.now());
         msSuspected.setTimeUpdate(DateTime.now());
         msSuspectedMapper.insert(msSuspected);
         msSuspectedMapper.insert(msSuspected);
 
 
-        //确证人数
-        Integer isTrue = msReportMapper.selectSuspectedNum(reportId, medical);
-        MsReport msReport = msReportMapper.selectById(reportId);
-        if (msReport != null) {
-            if (medical == 0)
-                msReport.setSuspectedNum(isTrue);
-            if (medical == 1)
-                msReport.setSureNum(isTrue);
-            msReport.setMsStatus(2);
-            // msReport.setUserUpdate(userCreate);
-            // msReport.setTimeUpdate(DateTime.now());
-            msReportMapper.updateById(msReport);
+        //更新今日日报
+        updateReport(msSuspected.getReportId(),msSuspected.getMedical(),msSuspected.getSingleRoom(),msSuspected.getTemperature());
+
+    }
+
+
+    //编辑家人
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+    public void editSuspected(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) {
+
+        MsSuspected msSuspected = msSuspectedMapper.selectById(suspectedId);
+        if (msSuspected != null) {
+            msSuspected.setUserName(userName);
+            msSuspected.setGrender(grender);//默认为家人
+            msSuspected.setAge(age);
+            msSuspected.setFamilyStatus(familyStatus);
+            msSuspected.setStatusDesp(statusDesp);
+            msSuspected.setMedical(medical);
+            msSuspected.setTemperature(temperature);
+            msSuspected.setCough(cough);
+            msSuspected.setMuscle(muscle);
+            msSuspected.setDiarrhea(dyspnea);
+            msSuspected.setFatigue(fatigue);
+            msSuspected.setDiarrhea(diarrhea);
+            msSuspected.setSingleRoom(singleRoom);
+            msSuspected.setOthers(others);
+            msSuspectedMapper.updateById(msSuspected);
+
+            //更新今日日报
+            updateReport(msSuspected.getReportId(),msSuspected.getMedical(),msSuspected.getSingleRoom(),msSuspected.getTemperature());
         }
         }
 
 
     }
     }
@@ -108,22 +139,40 @@ public class MsSuspectedService {
         MsSuspected msSuspected = msSuspectedMapper.selectById(suspectedId);
         MsSuspected msSuspected = msSuspectedMapper.selectById(suspectedId);
         if (msSuspected != null) {
         if (msSuspected != null) {
             msSuspectedMapper.deleteById(suspectedId);
             msSuspectedMapper.deleteById(suspectedId);
-            //确证人数
-            Integer isTrue = msReportMapper.selectSuspectedNum(msSuspected.getReportId(), msSuspected.getMedical());
-            MsReport msReport = msReportMapper.selectById(msSuspected.getReportId());
-            if (msReport != null) {
-                if (msSuspected.getMedical() == 0)
-                    msReport.setSuspectedNum(isTrue);
-                if (msSuspected.getMedical() == 1)
-                    msReport.setSureNum(isTrue);
-                if(isTrue==0)
-                    msReport.setMsStatus(1);
-                else
-                    msReport.setMsStatus(2);
-                msReport.setUserUpdate(msReport.getUserCreate());
-                msReport.setTimeUpdate(DateTime.now());
-                msReportMapper.updateById(msReport);
-            }
+            //更新今日日报
+            updateReport(msSuspected.getReportId(),msSuspected.getMedical(),msSuspected.getSingleRoom(),msSuspected.getTemperature());
+        }
+    }
+    //更新今日日报
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+    public void updateReport(Long reportId, Integer medical, Integer singleRoom, BigDecimal temperature) {
+        //更新今日日报
+        //确诊
+        Integer isTrue = 0, isSingle = 0, isSuspected = 0, isNoSuspected = 0, isFamliy = 0;
+        if (medical == 1)
+            isTrue = msReportMapper.selectSuspectedNum(reportId, medical);
+        //居家隔离
+        if (singleRoom == 1)
+            isSingle = msReportMapper.selectSingleRoomNum(reportId, singleRoom);
+        //疑似
+        if (temperature.compareTo(new BigDecimal(0)) == 1) {
+            //正常
+            isSuspected = msReportMapper.selectisSuspectedNum(reportId, temperature);
+            isNoSuspected = msReportMapper.selectisNoSuspectedNum(reportId, temperature);
+        }
+        //今日居家
+        List<MsSuspected> list = msSuspectedMapper.selectByReportId(reportId);
+        if (list != null && list.size() > 0)
+            isFamliy = list.size();
+        MsReport msReport = msReportMapper.selectById(reportId);
+        if (msReport != null) {
+            msReport.setSureNum(isTrue);
+            msReport.setSingleNum(isSingle);
+            msReport.setSuspectedNum(isSuspected);
+            msReport.setNormalNum(isNoSuspected);
+            msReport.setSafetyNum(isFamliy);
+            msReport.setMsStatus(2);
+            msReportMapper.updateById(msReport);
         }
         }
     }
     }
 }
 }

+ 28 - 27
whepi-web/src/main/java/com/bofeng/service/RbService.java

@@ -43,64 +43,65 @@ public class RbService {
 
 
                 Integer cough = sysUptownHouses.get(i).getCough();
                 Integer cough = sysUptownHouses.get(i).getCough();
                 if(cough != null && cough == 0){
                 if(cough != null && cough == 0){
-                    sysUptownHouses.get(i).setChestStr("无咳嗽");
+                    sysUptownHouses.get(i).setCoughStr("无咳嗽");
                 }else if(cough != null && cough ==1){
                 }else if(cough != null && cough ==1){
-                    sysUptownHouses.get(i).setChestStr("偶尔短暂咳嗽");
+                    sysUptownHouses.get(i).setCoughStr("偶尔短暂咳嗽");
                 }else if(cough != null && cough ==2){
                 }else if(cough != null && cough ==2){
-                    sysUptownHouses.get(i).setChestStr("频繁咳嗽轻重");
+                    sysUptownHouses.get(i).setCoughStr("咳嗽轻度影响生活");
                 }else if(cough != null && cough ==3){
                 }else if(cough != null && cough ==3){
-                    sysUptownHouses.get(i).setChestStr("频繁咳嗽重度");
+                    sysUptownHouses.get(i).setCoughStr("咳嗽严重影响生活");
                 }
                 }
                 Integer muscle = sysUptownHouses.get(i).getMuscle();
                 Integer muscle = sysUptownHouses.get(i).getMuscle();
                 if(muscle != null && muscle==0){
                 if(muscle != null && muscle==0){
                     sysUptownHouses.get(i).setMuscleStr("无肌肉酸痛");
                     sysUptownHouses.get(i).setMuscleStr("无肌肉酸痛");
                 }else if(muscle != null && muscle ==1){
                 }else if(muscle != null && muscle ==1){
-                    sysUptownHouses.get(i).setMuscleStr("肌肉酸痛加重");
+                    sysUptownHouses.get(i).setMuscleStr("肌肉按压有酸痛");
                 }else if(muscle != null && muscle ==2){
                 }else if(muscle != null && muscle ==2){
-                    sysUptownHouses.get(i).setMuscleStr("肌肉酸痛好转");
+                    sysUptownHouses.get(i).setMuscleStr("偶尔肌肉按压酸痛");
                 }else if(muscle != null && muscle ==3){
                 }else if(muscle != null && muscle ==3){
-                    sysUptownHouses.get(i).setMuscleStr("肌肉酸痛无变化");
+                    sysUptownHouses.get(i).setMuscleStr("肌肉按压持续酸痛");
                 }
                 }
                 Integer dyspnea = sysUptownHouses.get(i).getDyspnea();
                 Integer dyspnea = sysUptownHouses.get(i).getDyspnea();
                 if(dyspnea != null && dyspnea ==0){
                 if(dyspnea != null && dyspnea ==0){
                     sysUptownHouses.get(i).setDyspneaStr("无呼吸困难");
                     sysUptownHouses.get(i).setDyspneaStr("无呼吸困难");
                 }else if(dyspnea != null && dyspnea ==1){
                 }else if(dyspnea != null && dyspnea ==1){
-                    sysUptownHouses.get(i).setDyspneaStr("呼吸困难加重");
+                    sysUptownHouses.get(i).setDyspneaStr("呼吸急走或上坡气短");
                 }else if(dyspnea != null && dyspnea ==2){
                 }else if(dyspnea != null && dyspnea ==2){
-                    sysUptownHouses.get(i).setDyspneaStr("呼吸困难好转");
+                    sysUptownHouses.get(i).setDyspneaStr("呼吸气短而走路变慢");
                 }else if(dyspnea != null && dyspnea ==3){
                 }else if(dyspnea != null && dyspnea ==3){
-                    sysUptownHouses.get(i).setDyspneaStr("呼吸困难无变化");
+                    sysUptownHouses.get(i).setDyspneaStr("呼吸走路数分钟后气短");
                 }else if(dyspnea != null && dyspnea ==4){
                 }else if(dyspnea != null && dyspnea ==4){
-                    sysUptownHouses.get(i).setDyspneaStr("呼吸困难严重");
-                }
-                Integer chest = sysUptownHouses.get(i).getChest();
-                if(chest !=null && chest ==0){
-                    sysUptownHouses.get(i).setChestStr("无胸闷");
-                }else if(chest !=null && chest ==1){
-                    sysUptownHouses.get(i).setChestStr("端坐呼吸");
-                }else if(chest !=null && chest ==2){
-                    sysUptownHouses.get(i).setChestStr("活动无");
-                }else if(chest !=null && chest ==3){
-                    sysUptownHouses.get(i).setChestStr("无变化");
+                    sysUptownHouses.get(i).setDyspneaStr("呼吸气短无法离开房间");
                 }
                 }
                 Integer fatigue = sysUptownHouses.get(i).getFatigue();
                 Integer fatigue = sysUptownHouses.get(i).getFatigue();
                 if(fatigue !=null && fatigue == 0){
                 if(fatigue !=null && fatigue == 0){
                     sysUptownHouses.get(i).setFatigueStr("无乏力");
                     sysUptownHouses.get(i).setFatigueStr("无乏力");
                 }else if(fatigue !=null && fatigue == 1){
                 }else if(fatigue !=null && fatigue == 1){
-                    sysUptownHouses.get(i).setFatigueStr("乏力加重");
+                    sysUptownHouses.get(i).setFatigueStr("可体力劳动但觉得累");
                 }else if(fatigue !=null && fatigue == 2){
                 }else if(fatigue !=null && fatigue == 2){
-                    sysUptownHouses.get(i).setFatigueStr("乏力好转");
+                    sysUptownHouses.get(i).setFatigueStr("轻体力劳动后长时间不能恢复");
                 }else if(fatigue !=null && fatigue == 3){
                 }else if(fatigue !=null && fatigue == 3){
-                    sysUptownHouses.get(i).setFatigueStr("乏力无变化");
+                    sysUptownHouses.get(i).setFatigueStr("不能正常生活");
                 }
                 }
                 Integer diarrhea = sysUptownHouses.get(i).getDiarrhea();
                 Integer diarrhea = sysUptownHouses.get(i).getDiarrhea();
                 if(diarrhea !=null && diarrhea == 0){
                 if(diarrhea !=null && diarrhea == 0){
                     sysUptownHouses.get(i).setDiarrheaStr("无腹泻");
                     sysUptownHouses.get(i).setDiarrheaStr("无腹泻");
                 }else if(diarrhea !=null && diarrhea == 1){
                 }else if(diarrhea !=null && diarrhea == 1){
-                    sysUptownHouses.get(i).setDiarrheaStr("有腹泻");
+                    sysUptownHouses.get(i).setDiarrheaStr("轻度腹泻少于于3次");
+                }else if(diarrhea !=null && diarrhea == 2){
+                    sysUptownHouses.get(i).setDiarrheaStr("中度腹泻4-6次");
+                }else if(diarrhea !=null && diarrhea == 3){
+                    sysUptownHouses.get(i).setDiarrheaStr("重度腹泻超过6次");
+                }
+                Integer singleRoom = sysUptownHouses.get(i).getSingleRoom();
+                if(singleRoom != null && singleRoom ==0 ){
+                    sysUptownHouses.get(i).setSingleRoomStr("没有单间隔离");
+                }else if(singleRoom != null && singleRoom == 1){
+                    sysUptownHouses.get(i).setSingleRoomStr("单间隔离");
                 }
                 }
-                sysUptownHouses.get(i).setZhengzhuang(sysUptownHouses.get(i).getChestStr()+","+sysUptownHouses.get(i).getMuscleStr()+","+sysUptownHouses.get(i).getDyspneaStr()
-                        +","+sysUptownHouses.get(i).getChestStr()+","+sysUptownHouses.get(i).getFatigueStr()+","+sysUptownHouses.get(i).getDiarrheaStr());
+
+                sysUptownHouses.get(i).setZhengzhuang(sysUptownHouses.get(i).getCoughStr()+","+sysUptownHouses.get(i).getMuscleStr()+","+sysUptownHouses.get(i).getDyspneaStr()
+                        +","+sysUptownHouses.get(i).getFatigueStr()+","+sysUptownHouses.get(i).getDiarrheaStr()+","+sysUptownHouses.get(i).getSingleRoomStr());
             }
             }
         }
         }
 
 

+ 3 - 3
whepi-web/src/main/java/com/bofeng/wx/controller/HomeController.java

@@ -49,9 +49,9 @@ public class HomeController {
     public ModelAndView home(ModelMap model) throws JsonProcessingException {
     public ModelAndView home(ModelMap model) throws JsonProcessingException {
         model.put("user", new JsonWapper("{\"www\": \"er\"}"));
         model.put("user", new JsonWapper("{\"www\": \"er\"}"));
         //初始化今日日报
         //初始化今日日报
-        UserOpen userOpen = homeService.getUserOpen();
-        Long userId = userOpen.getUserId();
-       // Long userId = 1224706869998772226L;
+        // UserOpen userOpen = homeService.getUserOpen();
+        // Long userId = userOpen.getUserId();
+        Long userId = 1224706869998772226L;
         MsReport msReport = msReportService.getReportByDateNow(userId);
         MsReport msReport = msReportService.getReportByDateNow(userId);
         model.put("msReport", new JsonWapper(msReport));
         model.put("msReport", new JsonWapper(msReport));
         return new ModelAndView("/home/home.ftl", model);
         return new ModelAndView("/home/home.ftl", model);

+ 42 - 5
whepi-web/src/main/java/com/bofeng/wx/controller/MsReportController.java

@@ -44,12 +44,42 @@ public class MsReportController {
         Integer cough = Integer.parseInt(request.getParameter("cough"));
         Integer cough = Integer.parseInt(request.getParameter("cough"));
         Integer muscle = Integer.parseInt(request.getParameter("muscle"));
         Integer muscle = Integer.parseInt(request.getParameter("muscle"));
         Integer dyspnea = Integer.parseInt(request.getParameter("dyspnea"));
         Integer dyspnea = Integer.parseInt(request.getParameter("dyspnea"));
-        Integer chest = Integer.parseInt(request.getParameter("chest"));
         Integer fatigue = Integer.parseInt(request.getParameter("fatigue"));
         Integer fatigue = Integer.parseInt(request.getParameter("fatigue"));
         Integer diarrhea = Integer.parseInt(request.getParameter("diarrhea"));
         Integer diarrhea = Integer.parseInt(request.getParameter("diarrhea"));
-        Integer diarrheaNum = Integer.parseInt(request.getParameter("diarrheaNum"));
+        Integer singleRoom = Integer.parseInt(request.getParameter("singleRoom"));
         String others = request.getParameter("others");
         String others = request.getParameter("others");
-        msSuspectedService.addSuspected(userName, grender, age, familyStatus,statusDesp,medical,temperature,cough,muscle,dyspnea,chest,fatigue,diarrhea,diarrheaNum, others, userCreate);
+        msSuspectedService.addSuspected(userName, grender, age, familyStatus, statusDesp, medical, temperature, cough, muscle, dyspnea, fatigue, diarrhea, singleRoom, others, userCreate);
+        return 1;
+    }
+
+    //查询家人
+    @GetMapping("/home/selectSuspected")
+    public MsSuspected selectSuspected(HttpServletRequest request) {
+        //初始化今日日报
+        Long suspectedId = Long.parseLong(request.getParameter("suspectedId"));
+        return msSuspectedService.selectSuspected(suspectedId);
+    }
+
+    //修改家人
+    @PostMapping("/home/updateSuspected")
+    public Integer updateSuspected(HttpServletRequest request) {
+        //初始化今日日报
+        Long suspectedId = Long.parseLong(request.getParameter("suspectedId"));
+        String userName = request.getParameter("userName");
+        Integer grender = Integer.parseInt(request.getParameter("grender"));
+        Integer age = Integer.parseInt(request.getParameter("age"));
+        Integer familyStatus = Integer.parseInt(request.getParameter("familyStatus"));
+        String statusDesp = request.getParameter("statusDesp");
+        Integer medical = Integer.parseInt(request.getParameter("medical"));
+        BigDecimal temperature = new BigDecimal(request.getParameter("temperature"));
+        Integer cough = Integer.parseInt(request.getParameter("cough"));
+        Integer muscle = Integer.parseInt(request.getParameter("muscle"));
+        Integer dyspnea = Integer.parseInt(request.getParameter("dyspnea"));
+        Integer fatigue = Integer.parseInt(request.getParameter("fatigue"));
+        Integer diarrhea = Integer.parseInt(request.getParameter("diarrhea"));
+        Integer singleRoom = Integer.parseInt(request.getParameter("singleRoom"));
+        String others = request.getParameter("others");
+        msSuspectedService.editSuspected(suspectedId, userName, grender, age, familyStatus, statusDesp, medical, temperature, cough, muscle, dyspnea, fatigue, diarrhea, singleRoom, others);
         return 1;
         return 1;
     }
     }
 
 
@@ -80,8 +110,7 @@ public class MsReportController {
     @PostMapping("/home/addReport")
     @PostMapping("/home/addReport")
     public Integer addReport(HttpServletRequest request) {
     public Integer addReport(HttpServletRequest request) {
         Long userCreate = Long.parseLong(request.getParameter("userCreate"));
         Long userCreate = Long.parseLong(request.getParameter("userCreate"));
-        String safetyNum = request.getParameter("safetyNum");
-        msReportService.addReport(safetyNum, userCreate);
+        msReportService.addReport(userCreate);
         return 1;
         return 1;
     }
     }
 
 
@@ -90,4 +119,12 @@ public class MsReportController {
     public Model<List<MsSuspected>> queryRibaoReportDate(@Pd(name = "reportDate") String reportDate, @Pd(name = "userCreate") Long userCreate) {
     public Model<List<MsSuspected>> queryRibaoReportDate(@Pd(name = "reportDate") String reportDate, @Pd(name = "userCreate") Long userCreate) {
         return Model.newSuccess(msReportService.getByReportReportDate(reportDate, userCreate));
         return Model.newSuccess(msReportService.getByReportReportDate(reportDate, userCreate));
     }
     }
+
+    //通过昨天数据更新今天数据
+    @PostMapping("/home/getNowByYesterday")
+    public Integer getNowByYesterday(HttpServletRequest request) {
+        Long userCreate = Long.parseLong(request.getParameter("userCreate"));
+        msReportService.getNowByYesterday(userCreate);
+        return 1;
+    }
 }
 }