Browse Source

添加后台ui框架

yuliang 5 years ago
parent
commit
ef70283483

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

@@ -82,6 +82,19 @@ public interface RbMapper extends BaseMapper<sysUptownUnit> {
     List<ExcelRiBao> selectExcelRiBao(@Param("uptownId") Long uptownId, @Param("date") String date);
 
     @Select(
+            "select suu.ridgepole,suu.unit,suh.doorplate,suho.linkman,suho.phone,msr.safety_num as safetyNum," +
+                    "msr.sure_num as sureNum,msr.suspected_num as suspectedNum,msr.normal_num as normalNum," +
+                    "msr.single_num as singleNum,mss.user_name as userName,mss.grender," +
+                    "mss.age,mss.family_status as familyStatus,mss.medical,mss.temperature,mss.cough,mss.muscle ,mss.dyspnea," +
+                    "mss.fatigue,mss.diarrhea,mss.single_room as singleRoom from ms_suspected mss "+
+                    "inner join ms_report msr on msr.report_id = mss.report_id and msr.report_date = #{date} "+
+                    "inner join sys_uptown_house suh on suh.house_id = msr.house_id "+
+                    "inner join sys_uptown_unit suu on suu.unit_id = suh.unit_id and suu.uptown_id=#{uptownId} "+
+                    "left join sys_uptown_home suho on suho.house_id = suh.house_id order by doorplate asc"
+    )
+    List<ExcelRiBaoPrivate> selectExcelRiBaoPrivate(@Param("uptownId") Long uptownId, @Param("date") String date);
+
+    @Select(
             "select u.* from sys_user_role ur " +
                     "left join sys_uptown_house up on up.house_id = ur.property_id " +
                     "left join sys_uptown_unit uu on uu.unit_id = up.unit_id " +

+ 202 - 0
whepi-web/src/main/java/com/bofeng/entity/ExcelRiBaoPrivate.java

@@ -0,0 +1,202 @@
+package com.bofeng.entity;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.google.common.base.Strings;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.math.BigDecimal;
+
+@Getter
+@Setter
+public class ExcelRiBaoPrivate {
+
+    private String ridgepole;
+    private String unit;
+    private String doorplate;
+    private int grender;
+    private int familyStatus;
+    private int medical;
+    private int cough;
+    private int muscle;
+    private int dyspnea;
+    private int fatigue;
+    private int diarrhea;
+    private int singleRoom;
+    private String statusDesp = "";
+    private String others = "";
+
+
+    @ExcelProperty(value = "楼栋", index = 0)
+    private String loudong = "";
+
+    public String getLoudong() {
+        if (loudong.length() <= 0) {
+            loudong = ridgepole + "栋" + unit + "单元";
+        }
+        return loudong;
+    }
+
+    @ExcelProperty(value = "房号", index = 1)
+    private String fanghao = "";
+
+    public String getFanghao() {
+        if (fanghao.length() <= 0) {
+            fanghao = doorplate;
+        }
+        return fanghao;
+    }
+
+    @ExcelProperty(value = "联系人", index = 2)
+    private String linkman;
+
+    @ExcelProperty(value = "联系电话", index = 3)
+    private String phone;
+
+    @ExcelProperty(value = "今日居家人数", index = 4)
+    private int safetyNum;
+
+    @ExcelProperty(value = "确诊人数", index = 5)
+    private int sureNum;
+
+    @ExcelProperty(value = "隔离人数", index = 6)
+    private int singleNum;
+
+    @ExcelProperty(value = "异常观察人数", index = 7)
+    private int suspectedNum;
+
+    @ExcelProperty(value = "身体正常人数", index = 8)
+    private int normalNum;
+
+    @ExcelProperty(value = "居家人员姓名", index = 9)
+    private String userName;
+
+    @ExcelProperty(value = "性别", index = 10)
+    private String grenderStr;
+
+    public String getGrenderStr() {
+        if (grender == 1) {
+            grenderStr = "男";
+        } else if (grender == 2) {
+            grenderStr = "女";
+        } else {
+            grenderStr = "未知";
+        }
+        return grenderStr;
+    }
+
+    @ExcelProperty(value = "年龄", index = 11)
+    private String age;
+
+    @ExcelProperty(value = "体温", index = 12)
+    private BigDecimal temperature;
+
+    @ExcelProperty(value = "确诊", index = 13)
+    private String medicalStr;
+    public String getMedicalStr() {
+        if (medical == 0) {
+            medicalStr = "否";
+        } else {
+            medicalStr = "是";
+        }
+        return medicalStr;
+    }
+
+    @ExcelProperty(value = "单间隔离", index = 14)
+    private String singleRoomStr;
+    public String getSingleRoomStr() {
+        if (singleRoom == 0) {
+            singleRoomStr = "否";
+        } else {
+            singleRoomStr = "是";
+        }
+        return singleRoomStr;
+    }
+
+    @ExcelProperty(value = "身体基本情况", index = 15)
+    private String baseDesc;
+    public String getBaseDesc() {
+        if (familyStatus == 0) {
+            baseDesc = "无病史";
+        } else if (familyStatus == 1) {
+            baseDesc = "心血管疾病(服用ARB)";
+        } else if (familyStatus == 2) {
+            baseDesc = "心血管疾病(未服用ARB)";
+        } else if (familyStatus == 3) {
+            baseDesc = "呼吸系统病史";
+        } else if (familyStatus == 4) {
+            baseDesc = "肿瘤病史";
+        } else if (familyStatus == 5) {
+            baseDesc = "糖尿病史";
+        } else if (familyStatus == 6) {
+            baseDesc = "服用过激素药物";
+        } else if (familyStatus == 7) {
+            baseDesc = "妊娠期";
+        } else {
+            baseDesc = "其他";
+        }
+        return baseDesc;
+    }
+
+    @ExcelProperty(value = "病情描述", index = 16)
+    private String bingqingDesc = "";
+    public String getBingqingDesc() {
+
+        if (medical == 1) {
+            bingqingDesc += "已确诊、";
+        }
+
+        if (singleRoom == 1) {
+            bingqingDesc += "单间隔离、";
+        }
+
+        bingqingDesc = bingqingDesc + "体温:" + temperature + "、";
+
+        if (cough == 1) {
+            bingqingDesc += "偶尔短暂咳嗽、";
+        } else if (cough == 2) {
+            bingqingDesc += "咳嗽轻度影响生活、";
+        } else if (cough == 3) {
+            bingqingDesc += "咳嗽严重影响生活、";
+        }
+        if (muscle == 1) {
+            bingqingDesc += "肌肉按压有酸痛、";
+        } else if (muscle == 2) {
+            bingqingDesc += "偶尔肌肉按压酸痛、";
+        } else if (muscle == 3) {
+            bingqingDesc += "肌肉按压持续酸痛、";
+        }
+        if (dyspnea == 1) {
+            bingqingDesc += "呼吸急走或上坡气短、";
+        } else if (dyspnea == 2) {
+            bingqingDesc += "呼吸气短而走路变慢、";
+        } else if (dyspnea == 3) {
+            bingqingDesc += "呼吸走路数分钟后气短、";
+        } else if (dyspnea == 4) {
+            bingqingDesc += "呼吸气短无法离开房间、";
+        }
+        if (fatigue == 1) {
+            bingqingDesc += "可体力劳动但觉得累、";
+        } else if (fatigue == 2) {
+            bingqingDesc += "轻体力劳动后长时间不能恢复、";
+        } else if (fatigue == 3) {
+            bingqingDesc += "不能正常生活、";
+        }
+        if (diarrhea == 1) {
+            bingqingDesc += "轻度腹泻少于于3次、";
+        } else if (diarrhea == 2) {
+            bingqingDesc += "中度腹泻4-6次、";
+        } else if (diarrhea == 3) {
+            bingqingDesc += "重度腹泻超过6次、";
+        }
+
+        if (!Strings.isNullOrEmpty(statusDesp)) {
+            bingqingDesc += statusDesp;
+            bingqingDesc += "、";
+        }
+        if (!Strings.isNullOrEmpty(others)) {
+            bingqingDesc += others;
+        }
+        return bingqingDesc;
+    }
+}

+ 4 - 3
whepi-web/src/main/java/com/bofeng/entity/Uptown.java

@@ -1,6 +1,7 @@
 package com.bofeng.entity;
 
 import com.baomidou.mybatisplus.annotations.TableField;
+import com.baomidou.mybatisplus.annotations.TableId;
 import com.baomidou.mybatisplus.annotations.TableName;
 import lombok.Getter;
 import lombok.Setter;
@@ -14,7 +15,7 @@ import org.joda.time.DateTime;
 @TableName("sys_uptown")
 public class Uptown {
 
-    @TableField("uptown_id")
+    @TableId("uptown_id")
     private Long uptownId;
 
     @TableField("uptown_name")
@@ -38,13 +39,13 @@ public class Uptown {
     @TableField("status")
     private Integer status;
 
-    @TableField("user_create")
+    @TableField(exist = false)
     private Long userCreate;
 
     @TableField(exist = false)
     private DateTime timeCreate;
 
-    @TableField("user_update")
+    @TableField(exist = false)
     private Long userUpdate;
 
     @TableField(exist = false)

+ 23 - 0
whepi-web/src/main/java/com/bofeng/wx/controller/YeWeiHuiController.java

@@ -1,6 +1,7 @@
 package com.bofeng.wx.controller;
 
 import com.bofeng.dao.RbMapper;
+import com.bofeng.dao.UptownMapper;
 import com.bofeng.entity.*;
 import com.bofeng.excel.ExcelUtils;
 import com.bofeng.service.HomeService;
@@ -45,6 +46,9 @@ public class YeWeiHuiController {
     private HomeService homeService;
 
     @Autowired
+    private UptownMapper uptownMapper;
+
+    @Autowired
     private RbMapper rbMapper;
 
     @GetMapping("/yeweihui/home.html")
@@ -228,4 +232,23 @@ public class YeWeiHuiController {
             ExcelUtils.writeSheet(ExcelRiBao.class, list).export(resp, fileName);
         }
     }
+
+    @ApiOperation("导出家庭上报明细")
+    @GetMapping("/yeweihui/EXR")
+    @SneakyThrows
+    public void exportRiBaoByXiaoQu(@Pd(name = "xid") Long xid,
+                            @Pd(name = "d") String d,
+                            HttpServletResponse resp) {
+
+        Uptown uptown = uptownMapper.selectById(xid);
+
+        if (uptown!=null && uptown.getUptownId()>0) {
+            Long upId = uptown.getUptownId();
+            String fileName = uptown.getUptownName();
+            fileName += "上报信息-";
+            fileName += d;
+            List<ExcelRiBaoPrivate> list = rbMapper.selectExcelRiBaoPrivate(upId,d);
+            ExcelUtils.writeSheet(ExcelRiBaoPrivate.class, list).export(resp, fileName);
+        }
+    }
 }