lange 5 yıl önce
ebeveyn
işleme
cda370ae39

+ 3 - 2
whepi-doc/mrsb.sql

@@ -30,8 +30,8 @@ CREATE TABLE ms_suspected  (
   suspected_id      bigint(20) NOT NULL DEFAULT 0                           COMMENT '疑似ID',
   report_id         bigint(20) NOT NULL DEFAULT 0                           COMMENT '上报ID',
   user_name         varchar(50)  NOT NULL DEFAULT ''                        COMMENT '家人姓名',
-  grender            int(11)    NOT NULL DEFAULT 1                          COMMENT '性别:0未设置,1男,2女',
-  age               int(11)    NOT NULL DEFAULT 1                           COMMENT '年龄',
+  grender            int(11)    NOT NULL DEFAULT 0                          COMMENT '性别:0未设置,1男,2女',
+  age               int(11)    NOT NULL DEFAULT 0                           COMMENT '年龄',
   family_status     int(11)    NOT NULL DEFAULT 0                           COMMENT '基本状态:0正常,1心血管疾病(服用ARB),2心血管疾病(未服用ARB),3呼吸系统病史,4肿瘤病史,5糖尿病史,6服用过激素药物,7妊娠期,8其他',
   status_desp       varchar(100)  NOT NULL DEFAULT ''                       COMMENT '状态描述',
   medical           int(11)    NOT NULL DEFAULT 0                           COMMENT '是否确诊:0否,1是',
@@ -42,6 +42,7 @@ CREATE TABLE ms_suspected  (
   fatigue           int(11)    NOT NULL DEFAULT 0                           COMMENT '乏力:0无,1可体力劳动但觉得累,2轻体力劳动后长时间不能恢复,3不能正常生活',
   diarrhea          int(11)    NOT NULL DEFAULT 0                           COMMENT '腹泻:0无,1轻度腹泻少于于3次,2中度腹泻4-6次,3重度腹泻超过6次',
   single_room       int(11)    NOT NULL DEFAULT 0                           COMMENT '单间隔离:0否,1是',
+  suspected_status         int(11)    NOT NULL DEFAULT 0                           COMMENT '是否疑似:0否,1是',
   others            varchar(600)  NOT NULL DEFAULT ''                       COMMENT '其他',
   user_create       bigint(20) NOT NULL DEFAULT 0                           COMMENT '新增人',
   time_create       datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0)       COMMENT '新增时间',

+ 60 - 60
whepi-web/src/main/java/com/bofeng/controller/AdminAreaController.java

@@ -1,60 +1,60 @@
-package com.bofeng.controller;
-
-import com.bofeng.Consts;
-import com.bofeng.entity.Place;
-import com.bofeng.service.PlaceService;
-import com.google.common.base.Strings;
-import com.yvan.Model;
-import com.yvan.ModelOps;
-import com.yvan.mvc.Pd;
-import lombok.val;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.servlet.ModelAndView;
-
-import java.util.List;
-
-@RestController
-@RequiresPermissions(Consts.USER_TYPE_ADMIN)
-public class AdminAreaController {
-
-    @Autowired
-    private PlaceService placeService;
-
-    @GetMapping("/admin/place.html")
-    public ModelAndView placeView() {
-        return new ModelAndView("/admin/place.ftl");
-    }
-
-    @GetMapping("/admin/sysArea")
-    public Model<List<Place>> getArea() {
-        return Model.newSuccess(placeService.selectAll());
-    }
-
-    @PostMapping("/admin/place_addnew.json")
-    public ModelOps placeAddNew(@RequestBody Place place) {
-        val msg = placeService.insert(place);
-        if (Strings.isNullOrEmpty(msg)) {
-            return ModelOps.newSuccess();
-        }
-        return ModelOps.newFail(msg);
-    }
-
-    @PostMapping("/admin/place_edit")
-    public ModelOps placeEdit(@RequestBody Place place) {
-        val msg = placeService.updateById(place);
-        if (Strings.isNullOrEmpty(msg)) {
-            return ModelOps.newSuccess();
-        }
-        return ModelOps.newFail(msg);
-    }
-
-    @PostMapping("/admin/place_delete.json")
-    public ModelOps placeDelete(@Pd(name = "placeId", desc = "") Long placeId) {
-        return ModelOps.newSuccess(placeService.deleteById(placeId));
-    }
-}
+// package com.bofeng.controller;
+//
+// import com.bofeng.Consts;
+// import com.bofeng.entity.Place;
+// import com.bofeng.service.PlaceService;
+// import com.google.common.base.Strings;
+// import com.yvan.Model;
+// import com.yvan.ModelOps;
+// import com.yvan.mvc.Pd;
+// import lombok.val;
+// import org.apache.shiro.authz.annotation.RequiresPermissions;
+// import org.springframework.beans.factory.annotation.Autowired;
+// import org.springframework.web.bind.annotation.GetMapping;
+// import org.springframework.web.bind.annotation.PostMapping;
+// import org.springframework.web.bind.annotation.RequestBody;
+// import org.springframework.web.bind.annotation.RestController;
+// import org.springframework.web.servlet.ModelAndView;
+//
+// import java.util.List;
+//
+// @RestController
+// @RequiresPermissions(Consts.USER_TYPE_ADMIN)
+// public class AdminAreaController {
+//
+//     @Autowired
+//     private PlaceService placeService;
+//
+//     @GetMapping("/admin/place.html")
+//     public ModelAndView placeView() {
+//         return new ModelAndView("/admin/place.ftl");
+//     }
+//
+//     @GetMapping("/admin/sysArea")
+//     public Model<List<Place>> getArea() {
+//         return Model.newSuccess(placeService.selectAll());
+//     }
+//
+//     @PostMapping("/admin/place_addnew.json")
+//     public ModelOps placeAddNew(@RequestBody Place place) {
+//         val msg = placeService.insert(place);
+//         if (Strings.isNullOrEmpty(msg)) {
+//             return ModelOps.newSuccess();
+//         }
+//         return ModelOps.newFail(msg);
+//     }
+//
+//     @PostMapping("/admin/place_edit")
+//     public ModelOps placeEdit(@RequestBody Place place) {
+//         val msg = placeService.updateById(place);
+//         if (Strings.isNullOrEmpty(msg)) {
+//             return ModelOps.newSuccess();
+//         }
+//         return ModelOps.newFail(msg);
+//     }
+//
+//     @PostMapping("/admin/place_delete.json")
+//     public ModelOps placeDelete(@Pd(name = "placeId", desc = "") Long placeId) {
+//         return ModelOps.newSuccess(placeService.deleteById(placeId));
+//     }
+// }

+ 60 - 60
whepi-web/src/main/java/com/bofeng/controller/AdminPlaceController.java

@@ -1,60 +1,60 @@
-package com.bofeng.controller;
-
-import com.bofeng.Consts;
-import com.bofeng.entity.Place;
-import com.bofeng.service.PlaceService;
-import com.google.common.base.Strings;
-import com.yvan.Model;
-import com.yvan.ModelOps;
-import com.yvan.mvc.Pd;
-import lombok.val;
-import org.apache.shiro.authz.annotation.RequiresPermissions;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.servlet.ModelAndView;
-
-import java.util.List;
-
-@RestController
-@RequiresPermissions(Consts.USER_TYPE_ADMIN)
-public class AdminPlaceController {
-
-    @Autowired
-    private PlaceService placeService;
-
-    @GetMapping("/admin/place.html")
-    public ModelAndView placeView() {
-        return new ModelAndView("/admin/place.ftl");
-    }
-
-    @GetMapping("/admin/place.json")
-    public Model<List<Place>> getPlace() {
-        return Model.newSuccess(placeService.selectAll());
-    }
-
-    @PostMapping("/admin/place_addnew.json")
-    public ModelOps placeAddNew(@RequestBody Place place) {
-        val msg = placeService.insert(place);
-        if (Strings.isNullOrEmpty(msg)) {
-            return ModelOps.newSuccess();
-        }
-        return ModelOps.newFail(msg);
-    }
-
-    @PostMapping("/admin/place_edit")
-    public ModelOps placeEdit(@RequestBody Place place) {
-        val msg = placeService.updateById(place);
-        if (Strings.isNullOrEmpty(msg)) {
-            return ModelOps.newSuccess();
-        }
-        return ModelOps.newFail(msg);
-    }
-
-    @PostMapping("/admin/place_delete.json")
-    public ModelOps placeDelete(@Pd(name = "placeId", desc = "") Long placeId) {
-        return ModelOps.newSuccess(placeService.deleteById(placeId));
-    }
-}
+// package com.bofeng.controller;
+//
+// import com.bofeng.Consts;
+// import com.bofeng.entity.Place;
+// import com.bofeng.service.PlaceService;
+// import com.google.common.base.Strings;
+// import com.yvan.Model;
+// import com.yvan.ModelOps;
+// import com.yvan.mvc.Pd;
+// import lombok.val;
+// import org.apache.shiro.authz.annotation.RequiresPermissions;
+// import org.springframework.beans.factory.annotation.Autowired;
+// import org.springframework.web.bind.annotation.GetMapping;
+// import org.springframework.web.bind.annotation.PostMapping;
+// import org.springframework.web.bind.annotation.RequestBody;
+// import org.springframework.web.bind.annotation.RestController;
+// import org.springframework.web.servlet.ModelAndView;
+//
+// import java.util.List;
+//
+// @RestController
+// @RequiresPermissions(Consts.USER_TYPE_ADMIN)
+// public class AdminPlaceController {
+//
+//     @Autowired
+//     private PlaceService placeService;
+//
+//     // @GetMapping("/admin/place.html")
+//     // public ModelAndView placeView() {
+//     //     return new ModelAndView("/admin/place.ftl");
+//     // }
+//
+//     @GetMapping("/admin/place.json")
+//     public Model<List<Place>> getPlace() {
+//         return Model.newSuccess(placeService.selectAll());
+//     }
+//
+//     @PostMapping("/admin/place_addnew.json")
+//     public ModelOps placeAddNew(@RequestBody Place place) {
+//         val msg = placeService.insert(place);
+//         if (Strings.isNullOrEmpty(msg)) {
+//             return ModelOps.newSuccess();
+//         }
+//         return ModelOps.newFail(msg);
+//     }
+//
+//     @PostMapping("/admin/place_edit")
+//     public ModelOps placeEdit(@RequestBody Place place) {
+//         val msg = placeService.updateById(place);
+//         if (Strings.isNullOrEmpty(msg)) {
+//             return ModelOps.newSuccess();
+//         }
+//         return ModelOps.newFail(msg);
+//     }
+//
+//     @PostMapping("/admin/place_delete.json")
+//     public ModelOps placeDelete(@Pd(name = "placeId", desc = "") Long placeId) {
+//         return ModelOps.newSuccess(placeService.deleteById(placeId));
+//     }
+// }

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

@@ -32,11 +32,11 @@ public interface MsReportMapper extends BaseMapper<MsReport> {
     Integer selectSingleRoomNum(@Param("reportId") Long reportId, @Param("singleRoom") Integer singleRoom);
 
     //正常
-    @Select("select count(*) from ms_suspected where report_id=#{reportId} and  temperature>= 36 and temperature<=37.3")
+    @Select("select count(*) from ms_suspected where report_id=#{reportId} and  suspected_status=0")
     Integer selectisSuspectedNum(@Param("reportId") Long reportId);
 
     //疑似
-    @Select("select count(*) from ms_suspected where report_id=#{reportId} and (temperature<36 or 37.3<temperature)")
+    @Select("select count(*) from ms_suspected where report_id=#{reportId} and suspected_status=1")
     Integer selectisNoSuspectedNum(@Param("reportId") Long reportId);
 
 }

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

@@ -83,6 +83,9 @@ public class MsSuspected {
     @TableField("single_room")
     private Integer singleRoom;
 
+    @TableField("suspected_status")
+    private Integer suspectedStatus;
+
     @TableField("others")
     private String others;
 

+ 2 - 0
whepi-web/src/main/java/com/bofeng/service/MsReportService.java

@@ -124,6 +124,7 @@ public class MsReportService {
                 msReport1.setSingleNum(msReport.getSingleNum());
                 msReport1.setRemarks(msReport.getRemarks());
                 msReport1.setReportDate(DateTime.now().toDate());
+                msReport1.setReportStatus(0);//未上报
                 msReport1.setMsStatus(msReport.getMsStatus());
                 msReport1.setUserCreate(userCreate);
                 msReport1.setTimeCreate(DateTime.now());
@@ -153,6 +154,7 @@ public class MsReportService {
                     msSuspected1.setDiarrhea(msSuspected.getDiarrhea());
                     msSuspected1.setSingleRoom(msSuspected.getSingleRoom());
                     msSuspected1.setOthers(msSuspected.getOthers());
+                    msSuspected1.setSuspectedStatus(0);
                     msSuspected1.setUserCreate(userCreate);
                     msSuspected1.setTimeCreate(DateTime.now());
                     msSuspected1.setUserUpdate(userCreate);

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

@@ -72,6 +72,26 @@ public class MsSuspectedService {
             reportId = listReport.get(0).getReportId();
         }
 
+        //判断是否疑似
+        Integer suspectedStatus = 0;
+        //体温
+        if (temperature.compareTo(new BigDecimal(36)) == -1 && temperature.compareTo(new BigDecimal(37.3)) == 1)
+            suspectedStatus = 1;
+        //咳嗽
+        if (cough > 0)
+            suspectedStatus = 1;
+        //肌肉酸痛
+        if (muscle > 0)
+            suspectedStatus = 1;
+        //呼吸困难
+        if (dyspnea > 0)
+            suspectedStatus = 1;
+        //乏力
+        if (fatigue > 0)
+            suspectedStatus = 1;
+        //腹泻
+        if (diarrhea > 0)
+            suspectedStatus = 1;
         if (suspectedId == 0L) {
             //添加家人
             MsSuspected msSuspected = new MsSuspected();
@@ -91,6 +111,7 @@ public class MsSuspectedService {
             msSuspected.setDiarrhea(diarrhea);
             msSuspected.setSingleRoom(singleRoom);
             msSuspected.setOthers(others);
+            msSuspected.setSuspectedStatus(suspectedStatus);
             msSuspected.setUserCreate(userCreate);
             msSuspected.setTimeCreate(DateTime.now());
             msSuspected.setUserUpdate(userCreate);
@@ -113,6 +134,7 @@ public class MsSuspectedService {
                 msSuspected1.setDiarrhea(diarrhea);
                 msSuspected1.setSingleRoom(singleRoom);
                 msSuspected1.setOthers(others);
+                msSuspected1.setSuspectedStatus(suspectedStatus);
                 msSuspectedMapper.updateById(msSuspected1);
             }
         }
@@ -123,14 +145,18 @@ public class MsSuspectedService {
     }
 
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
-    public void deleteSuspected(Long suspectedId) {
+    public Integer deleteSuspected(Long suspectedId) {
 
         MsSuspected msSuspected = msSuspectedMapper.selectById(suspectedId);
         if (msSuspected != null) {
             msSuspectedMapper.deleteById(suspectedId);
             //更新今日日报
             updateReport(msSuspected.getReportId(), msSuspected.getMedical(), msSuspected.getSingleRoom(), msSuspected.getTemperature());
+            MsReport msReport = msReportMapper.selectById(msSuspected.getReportId());
+            if (msReport != null)
+                return msReport.getSafetyNum();
         }
+        return 0;
     }
 
     //更新今日日报
@@ -146,6 +172,7 @@ public class MsSuspectedService {
             isSingle = msReportMapper.selectSingleRoomNum(reportId, singleRoom);
         //正常
         isSuspected = msReportMapper.selectisSuspectedNum(reportId);
+
         //疑似
         isNoSuspected = msReportMapper.selectisNoSuspectedNum(reportId);