浏览代码

Merge remote-tracking branch 'origin/master'

Longlin 5 年之前
父节点
当前提交
32cc08b555

+ 15 - 1
whepi-doc/login.sql

@@ -192,7 +192,7 @@ CREATE TABLE sys_uptown_house  (
 DROP TABLE IF EXISTS out_scan;
 CREATE TABLE out_scan  (
   scan_id           bigint(20) NOT NULL DEFAULT 0 COMMENT '扫码ID',
-  user_id           bigint(20) NOT NULL DEFAULT 0 COMMENT '人员ID',
+  user_id           bigint(20) NOT NULL DEFAULT 0 COMMENT '人员ID',
   uptown_id         bigint(20) NOT NULL DEFAULT 0 COMMENT '小区ID,下拉选ID',
   into_door_id      bigint(20) NOT NULL DEFAULT 0 COMMENT '进入小区大门ID',
   into_date         datetime(0) NOT NULL DEFAULT '0000-01-01 00:00:00' COMMENT '进入时间',
@@ -205,6 +205,20 @@ CREATE TABLE out_scan  (
   PRIMARY KEY (scan_id) USING BTREE
 ) ENGINE = InnoDB default charset=utf8mb4 comment = '用户外出扫码信息';
 
+DROP TABLE IF EXISTS out_scan_estate;
+CREATE TABLE out_scan_estate  (
+  se_id             bigint(20) NOT NULL DEFAULT 0 COMMENT '扫码ID',
+  user_id           bigint(20) NOT NULL DEFAULT 0 COMMENT '人员ID',
+  now_date          date NOT NULL DEFAULT '0000-01-01' COMMENT '当天时间',
+  scan_date         datetime(0) NOT NULL DEFAULT '0000-01-01 00:00:00' COMMENT '扫码时间',
+  user_create       bigint(20) NOT NULL DEFAULT 0 COMMENT '新增人',
+  time_create       datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '新增时间',
+  user_update       bigint(20) NOT NULL DEFAULT 0 COMMENT '修改人',
+  time_update       datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
+  PRIMARY KEY (se_id) USING BTREE,
+  INDEX user_id(user_id) USING BTREE
+) ENGINE = InnoDB default charset=utf8mb4 comment = '校园公共区域巡检扫码信息';
+
 DROP TABLE IF EXISTS out_scan_conf;
 CREATE TABLE out_scan_conf  (
   sc_id        		bigint(20) NOT NULL DEFAULT 0 COMMENT '扫码配置ID',

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

@@ -124,7 +124,7 @@
                     <input id="suspectedId" type="text" hidden="hidden" value=""/>
                     <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="color: gray;height: 5vh; line-height: 5vh; width: 70%;">是否确诊新冠肺炎</div>
+                        <div style="color: gray;height: 5vh; line-height: 5vh; width: 70%;">确诊新冠肺炎</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;"/>

+ 21 - 21
whepi-ui/templates/home/ribao.js

@@ -572,10 +572,10 @@ function updateSuspected(suspectedId) {
         $("#jibenmiaoshu").val(suspected.statusDesp);
 
         $("#switchQuezhen").val(getMedical(suspected.medical));
-        $("#switchQuezhen").attr("data-values", suspected.familyStatus);
+        $("#switchQuezhen").attr("data-values", suspected.medical);
 
         $("#switchDanjiangeli").val(getSingleRoom(suspected.singleRoom));
-        $("#switchDanjiangeli").attr("data-values", suspected.familyStatus);
+        $("#switchDanjiangeli").attr("data-values", suspected.singleRoom);
 
         $("#js_input_user_tiwen").val(suspected.temperature);
 
@@ -709,25 +709,25 @@ function getGreder(greder) {
   return "";
 }
 
-function getFamilyStatus(familyStatus) {
-  if (familyStatus == 0)
-    return "无病史";
-  if (familyStatus == 1)
-    return "心脑血管疾病(服用ARB)";
-  else if (familyStatus == 2)
-    return "心脑血管疾病(未服ARB)";
-  else if (familyStatus == 3)
-    return "呼吸系统病史";
-  else if (familyStatus == 4)
-    return "肿瘤病史";
-  else if (familyStatus == 5)
-    return "糖尿病史";
-  else if (familyStatus == 6)
-    return "服用过激素药物";
-  else if (familyStatus == 7)
-    return "妊娠期";
-  return "";
-}
+// function getFamilyStatus(familyStatus) {
+//   if (familyStatus == 0)
+//     return "无病史";
+//   if (familyStatus == 1)
+//     return "心脑血管疾病(服用ARB)";
+//   else if (familyStatus == 2)
+//     return "心脑血管疾病(未服ARB)";
+//   else if (familyStatus == 3)
+//     return "呼吸系统病史";
+//   else if (familyStatus == 4)
+//     return "肿瘤病史";
+//   else if (familyStatus == 5)
+//     return "糖尿病史";
+//   else if (familyStatus == 6)
+//     return "服用过激素药物";
+//   else if (familyStatus == 7)
+//     return "妊娠期";
+//   return "";
+// }
 
 function getCough(cough) {
   if (cough == 0)

+ 0 - 35
whepi-ui/templates/user/scan.ftl

@@ -3,9 +3,6 @@
 
 <div class="weui-tab">
     <div class="weui-tab__bd">
-        <input id="userId" type="text" hidden="hidden" value=${user_id!}/>
-        <input id="uptownId" type="text" hidden="hidden" value=${uptown_id!}/>
-        <input id="uptownName" type="text" hidden="hidden" value=${uptown_name!}/>
         <div class="weui-tab__bd-item weui-tab__bd-item--active">
             <div class="page__bd">
                 <header class="user-header">
@@ -23,22 +20,6 @@
                     <br/>
                     <br/>
                     <p class="user-title-long  ${collor!''}">${errorMsg!""}</p>
-
-
-<#--                    <#if (inType?? )&&(inType = 1) >-->
-<#--                        <#if (type?? )&&(type !="1") ><h1 class="user-title green">可以进入</h1></#if>-->
-<#--                        <#if (type?? )&&(type ="-1") ><h1 class="user-title red">禁止进入</h1></#if>-->
-<#--                        <#if (type?? )&&(type ="-1") ><p class="user-title-long">非本小区居民,禁止进入。</p></#if>-->
-<#--                    </#if>-->
-<#--                    <#if (inType?? )&&(inType != 1) ><#if (type?? )&&(type ="1") ><h1 class="user-title green">可以外出</h1></#if>-->
-<#--                            <#if (type?? )&&(type !="1") ><h1 class="user-title red">禁止外出</h1></#if>-->
-
-<#--                    <#if (type?? )&&(type ="1") ><p class="user-title-long">请佩戴口罩,避免近距离接触,不得长时间在外逗留。</p></#if>-->
-<#--                    <#if (type?? )&&(type ="-1") ><p class="user-title-long">非本小区居民,禁止外出。</p></#if>-->
-<#--                    <#if (type?? )&&(type ="-2") ><p class="user-title-long">外出时间间隔不满三日,禁止外出,请配合,上次外出时间 ${lastTime!''}。</p></#if>-->
-<#--                    <#if (type?? )&&(type ="-3") ><p class="user-title-long">因近期您未提交健康日报,无法确认您当前健康状态,静止外出,请配合。</p></#if>-->
-
-<#--                    </#if>-->
                     <br/>
                     <br/>
                 </header>
@@ -53,20 +34,4 @@
 </body>
 <#include "/home/frag.foot.ftl" />
 <script>
-
-    (function ($) {
-        if ($("#uptownId").val() == '1238790987234') {
-            $("#adminName").text('管理员');
-            $("#homeName").text('员工');
-        }
-    })(jQuery);
-
-    function yes() {
-        var userType = $('input:radio:checked').val();
-        if (!userType) {
-            $.alert("请选择用户角色!")
-            return false;
-        }
-        window.location.href = "/user/homeIndex.html?userId=" + $("#userId").val() + "&userType=" + userType;
-    }
 </script>

+ 36 - 0
whepi-ui/templates/user/scanEstate.ftl

@@ -0,0 +1,36 @@
+<#assign title="校园公共区域巡检"/>
+<#include "/home/frag.head.ftl" />
+
+<div class="weui-tab">
+    <div class="weui-tab__bd">
+        <div class="weui-tab__bd-item weui-tab__bd-item--active">
+            <div class="page__bd">
+                <header class="user-header">
+                    <br/>
+                    <br/>
+                    <br/>
+                    <br/>
+                    <br/>
+                    <p class="user-title-long">${doorplate!''}
+                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${name!''}</p>
+                    <br/>
+                    <br/>
+                    <h1 class="user-title ${collor!''}">${into!""}</h1>
+                    <br/>
+                    <br/>
+                    <p class="user-title-long  ${collor!''}">${errorMsg!""}</p>
+                    <br/>
+                    <br/>
+                </header>
+                <br/>
+                <br/>
+                <p class="user-title-long">${now!''}</p>
+            </div>
+        </div>
+    </div>
+</div>
+</div>
+</body>
+<#include "/home/frag.foot.ftl" />
+<script>
+</script>

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

@@ -53,4 +53,12 @@ public interface MsReportMapper extends BaseMapper<MsReport> {
             "select * from ms_report where report_status=1 and report_date=date_sub(curdate(),interval 3 day) and user_create=#{userId}")
     List<MsReport> selectMsReportLate(@Param("userId") Long userId);
 
+    /**
+     * 用户自身的健康状态, list大于0健康,等于0不健康
+     * @param userId
+     * @return
+     */
+    @Select("select * from ms_report where report_status=1 and report_date=curdate() and ms_status=1 and user_create=#{userId}")
+    List<MsReport> selectMsReportToday(@Param("userId") Long userId);
+
 }

+ 23 - 0
whepi-web/src/main/java/com/bofeng/dao/OutScanEstateMapper.java

@@ -0,0 +1,23 @@
+package com.bofeng.dao;
+
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+import com.bofeng.entity.OutScanEstate;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Mapper
+@Repository
+public interface OutScanEstateMapper extends BaseMapper<OutScanEstate> {
+
+    /**
+     * 该人员今天扫码次数
+     * @param userId
+     * @return
+     */
+    @Select("select * from out_scan_estate where now_date=curdate() and user_id=#{userId}")
+    List<OutScanEstate> getOutScanEstateTodayByUser(@Param("userId") Long userId);
+}

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

@@ -73,7 +73,7 @@ public interface RbMapper extends BaseMapper<sysUptownUnit> {
             "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 "+
+            "mss.fatigue,mss.diarrhea,mss.single_room as singleRoom,mss.score_rezult 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} "+
@@ -86,7 +86,7 @@ public interface RbMapper extends BaseMapper<sysUptownUnit> {
                     "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 "+
+                    "mss.fatigue,mss.diarrhea,mss.single_room as singleRoom,mss.score_rezult 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} "+
@@ -99,7 +99,7 @@ public interface RbMapper extends BaseMapper<sysUptownUnit> {
                     "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 "+
+                    "mss.fatigue,mss.diarrhea,mss.single_room as singleRoom,mss.score_rezult 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} "+

+ 26 - 21
whepi-web/src/main/java/com/bofeng/entity/ExcelRiBao.java

@@ -2,6 +2,7 @@ package com.bofeng.entity;
 
 import com.alibaba.excel.annotation.ExcelProperty;
 import com.google.common.base.Strings;
+import com.yvan.platform.Conv;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -16,7 +17,7 @@ public class ExcelRiBao {
     private String doorplate;
     private BigDecimal temperature;
     private int grender;
-    private int familyStatus;
+    private String familyStatus;
     private int medical;
     private int cough;
     private int muscle;
@@ -119,28 +120,32 @@ public class ExcelRiBao {
     }
 
     @ExcelProperty(value = "身体基本情况", index = 13)
-    private String baseDesc;
+    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 = "其他";
+
+        if (Conv.NI(familyStatus.split(",")[0]) == 1) {
+            baseDesc = "心血管疾病(服用ARB),";
+        }
+        if (Conv.NI(familyStatus.split(",")[1]) == 1) {
+            baseDesc += "心血管疾病(未服用ARB),";
+        }
+        if (Conv.NI(familyStatus.split(",")[2]) == 1) {
+            baseDesc += "呼吸系统病史,";
+        }
+        if (Conv.NI(familyStatus.split(",")[3]) == 1) {
+            baseDesc += "肿瘤病史,";
+        }
+        if (Conv.NI(familyStatus.split(",")[4]) == 1) {
+            baseDesc += "糖尿病史,";
+        }
+        if (Conv.NI(familyStatus.split(",")[5]) == 1) {
+            baseDesc += "服用过激素药物,";
+        }
+        if (Conv.NI(familyStatus.split(",")[6]) == 1) {
+            baseDesc += "妊娠期";
         }
-        return baseDesc;
+        return baseDesc.substring(0, baseDesc.length() - 1);
     }
 
     @ExcelProperty(value = "病情描述", index = 14)

+ 26 - 21
whepi-web/src/main/java/com/bofeng/entity/ExcelRiBaoLY.java

@@ -2,6 +2,7 @@ package com.bofeng.entity;
 
 import com.alibaba.excel.annotation.ExcelProperty;
 import com.google.common.base.Strings;
+import com.yvan.platform.Conv;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -16,7 +17,7 @@ public class ExcelRiBaoLY {
     private String doorplate;
     private BigDecimal temperature;
     private int grender;
-    private int familyStatus;
+    private String familyStatus;
     private int medical;
     private int cough;
     private int muscle;
@@ -121,28 +122,32 @@ public class ExcelRiBaoLY {
     }
 
     @ExcelProperty(value = "身体基本情况", index = 13)
-    private String baseDesc;
+    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 = "其他";
+
+        if (Conv.NI(familyStatus.split(",")[0]) == 1) {
+            baseDesc = "心血管疾病(服用ARB),";
+        }
+        if (Conv.NI(familyStatus.split(",")[1]) == 1) {
+            baseDesc += "心血管疾病(未服用ARB),";
+        }
+        if (Conv.NI(familyStatus.split(",")[2]) == 1) {
+            baseDesc += "呼吸系统病史,";
+        }
+        if (Conv.NI(familyStatus.split(",")[3]) == 1) {
+            baseDesc += "肿瘤病史,";
+        }
+        if (Conv.NI(familyStatus.split(",")[4]) == 1) {
+            baseDesc += "糖尿病史,";
+        }
+        if (Conv.NI(familyStatus.split(",")[5]) == 1) {
+            baseDesc += "服用过激素药物,";
+        }
+        if (Conv.NI(familyStatus.split(",")[6]) == 1) {
+            baseDesc += "妊娠期";
         }
-        return baseDesc;
+        return baseDesc.substring(0, baseDesc.length() - 1);
     }
 
     @ExcelProperty(value = "病情描述", index = 14)

+ 33 - 22
whepi-web/src/main/java/com/bofeng/entity/ExcelRiBaoPrivate.java

@@ -2,6 +2,7 @@ package com.bofeng.entity;
 
 import com.alibaba.excel.annotation.ExcelProperty;
 import com.google.common.base.Strings;
+import com.yvan.platform.Conv;
 import lombok.Getter;
 import lombok.Setter;
 
@@ -16,7 +17,7 @@ public class ExcelRiBaoPrivate {
     private String doorplate;
     private BigDecimal temperature;
     private int grender;
-    private int familyStatus;
+    private String familyStatus;
     private int medical;
     private int cough;
     private int muscle;
@@ -41,6 +42,7 @@ public class ExcelRiBaoPrivate {
 
     @ExcelProperty(value = "单元", index = 1)
     private String danyuan = "";
+
     public String getDanyuan() {
         if (danyuan.length() <= 0) {
             danyuan = unit;
@@ -101,13 +103,15 @@ public class ExcelRiBaoPrivate {
 
     @ExcelProperty(value = "体温", index = 13)
     private String temperatureStr;
+
     public String getTemperatureStr() {
-        temperatureStr = temperature.floatValue()>10?temperature+"":"未填报";
+        temperatureStr = temperature.floatValue() > 10 ? temperature + "" : "未填报";
         return temperatureStr;
     }
 
     @ExcelProperty(value = "确诊", index = 14)
     private String medicalStr;
+
     public String getMedicalStr() {
         if (medical == 0) {
             medicalStr = "否";
@@ -119,6 +123,7 @@ public class ExcelRiBaoPrivate {
 
     @ExcelProperty(value = "单间隔离", index = 15)
     private String singleRoomStr;
+
     public String getSingleRoomStr() {
         if (singleRoom == 0) {
             singleRoomStr = "否";
@@ -129,32 +134,37 @@ public class ExcelRiBaoPrivate {
     }
 
     @ExcelProperty(value = "身体基本情况", index = 16)
-    private String baseDesc;
+    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 = "其他";
+
+        if (Conv.NI(familyStatus.split(",")[0]) == 1) {
+            baseDesc = "心血管疾病(服用ARB),";
+        }
+        if (Conv.NI(familyStatus.split(",")[1]) == 1) {
+            baseDesc += "心血管疾病(未服用ARB),";
         }
-        return baseDesc;
+        if (Conv.NI(familyStatus.split(",")[2]) == 1) {
+            baseDesc += "呼吸系统病史,";
+        }
+        if (Conv.NI(familyStatus.split(",")[3]) == 1) {
+            baseDesc += "肿瘤病史,";
+        }
+        if (Conv.NI(familyStatus.split(",")[4]) == 1) {
+            baseDesc += "糖尿病史,";
+        }
+        if (Conv.NI(familyStatus.split(",")[5]) == 1) {
+            baseDesc += "服用过激素药物,";
+        }
+        if (Conv.NI(familyStatus.split(",")[6]) == 1) {
+            baseDesc += "妊娠期";
+        }
+        return baseDesc.substring(0, baseDesc.length() - 1);
     }
 
     @ExcelProperty(value = "病情描述", index = 17)
     private String bingqingDesc = "";
+
     public String getBingqingDesc() {
 
         if (medical == 1) {
@@ -218,6 +228,7 @@ public class ExcelRiBaoPrivate {
 
     @ExcelProperty(value = "健康评估", index = 18)
     private String scoreRezultStr;
+
     public String getScoreRezultStr() {
         if (scoreRezult == 0) {
             scoreRezultStr = "未评估";

+ 48 - 0
whepi-web/src/main/java/com/bofeng/entity/OutScanEstate.java

@@ -0,0 +1,48 @@
+package com.bofeng.entity;
+
+import com.baomidou.mybatisplus.annotations.TableField;
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.annotations.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Getter;
+import lombok.Setter;
+import org.joda.time.DateTime;
+
+import java.util.Date;
+
+/**
+ * 校园公共区域巡检扫码信息
+ */
+@Getter
+@Setter
+@TableName("out_scan_estate")
+public class OutScanEstate {
+
+    @ApiModelProperty("扫码ID")
+    @TableId("se_id")
+    private Long seId;
+
+    @ApiModelProperty("用户ID")
+    @TableField("user_id")
+    private Long userId;
+
+    @ApiModelProperty("当天时间")
+    @TableField("now_date")
+    private Date nowDate;
+
+    @ApiModelProperty("扫码时间")
+    @TableField("scan_date")
+    private DateTime scanDate;
+
+    @TableField("user_create")
+    private Long userCreate;
+
+    @TableField(exist = false)
+    private DateTime timeCreate;
+
+    @TableField("user_update")
+    private Long userUpdate;
+
+    @TableField(exist = false)
+    private DateTime timeUpdate;
+}

+ 18 - 0
whepi-web/src/main/java/com/bofeng/service/ScanService.java

@@ -1,20 +1,26 @@
 package com.bofeng.service;
 
 import com.baomidou.mybatisplus.toolkit.IdWorker;
+import com.bofeng.dao.OutScanEstateMapper;
 import com.bofeng.dao.OutScanMapper;
 import com.bofeng.entity.OutScan;
+import com.bofeng.entity.OutScanEstate;
 import org.joda.time.DateTime;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.Date;
+
 @Service
 @Transactional(readOnly = true)
 public class ScanService {
 
     @Autowired
     private OutScanMapper outScanMapper;
+    @Autowired
+    private OutScanEstateMapper outScanEstateMapper;
 
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
     public void saveOutScan(Long userId, Integer inType, Long uptownId, Long doorId) {
@@ -56,4 +62,16 @@ public class ScanService {
             outScanMapper.insert(outScan);
         }
     }
+
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+    public void saveOutScanEstate(Long userId) {
+        OutScanEstate o = new OutScanEstate();
+        o.setSeId(IdWorker.getId());
+        o.setUserId(userId);
+        o.setNowDate(new Date());
+        o.setScanDate(new DateTime());
+        o.setUserCreate(userId);
+        o.setUserUpdate(userId);
+        outScanEstateMapper.insert(o);
+    }
 }

+ 41 - 6
whepi-web/src/main/java/com/bofeng/wx/controller/ScanController.java

@@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 import org.springframework.web.servlet.ModelAndView;
 
+import javax.servlet.http.HttpServletRequest;
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
@@ -49,11 +50,14 @@ public class ScanController {
     private MsReportMapper msReportMapper;
     @Autowired
     private ScanService scanService;
+    @Autowired
+    private OutScanEstateMapper outScanEstateMapper;
 
     @ApiOperation("进出扫码页面")
     @GetMapping("/user/scan.html")
-    public ModelAndView home(ModelMap model, @RequestParam(value = "doorId", required = false, defaultValue = "0") Long doorId,
-            @RequestParam(value = "inType", required = false, defaultValue = "0") Integer inType) {
+    public ModelAndView scan(HttpServletRequest request, ModelMap model, @RequestParam(value = "doorId", required = false, defaultValue = "0") Long doorId,
+                             @RequestParam(value = "inType", required = false, defaultValue = "0") Integer inType) {
+//        String code = request.getParameter("code");
         UserOpen userOpen = homeService.getUserOpen();
         List<UserRole> list = userRoleMapper.getUserRoleByUserId(userOpen.getUserId());
 //        List<UserRole> list = userRoleMapper.getUserRoleByUserId(1L);
@@ -73,7 +77,6 @@ public class ScanController {
             model.put("now", format.format(new Date()));
             model.put("inType", inType);
             if (!unit.getUptownId().equals(uptownDoor.getUptownId())) {
-                model.put("type", "-1");//小区不对
                 model.put("into", "禁止" + getMsg(inType));
                 model.put("collor", "red");
                 model.put("errorMsg", "非本小区居民,禁止" + getMsg(inType) + "。");
@@ -83,7 +86,6 @@ public class ScanController {
                 OutScanConf outScanConf = outScanConfMapper.getOutScanConfByUptown(uptownDoor.getUptownId());
                 OutScan outScan = outScanMapper.getOutScanByUserlimit(userOpen.getUserId());
                 if (outScan != null && !compareTime(new Date(), outScan.getOutDate(), outScanConf.getGoOutFre())) {
-                    model.put("type", "-2");//时间短了
                     model.put("collor", "red");
                     model.put("into", "禁止" + getMsg(inType));
                     model.put("errorMsg", "外出时间间隔不满三日,禁止外出,请配合,上次外出时间 "+format.format(new Date(outScan.getOutDate().getMillis()))+"。");
@@ -91,14 +93,12 @@ public class ScanController {
                 }
                 List<MsReport> msReports = msReportMapper.selectMsReportLate(userOpen.getUserId());
                 if (msReports.size() != 3) {
-                    model.put("type", "-3");//最近3天未提交健康日报
                     model.put("collor", "red");
                     model.put("into", "禁止" + getMsg(inType));
                     model.put("errorMsg", "因近期您未提交健康日报,无法确认您当前健康状态,禁止外出,请配合。");
                     return new ModelAndView("/user/scan.ftl", model);
                 }
             }
-            model.put("type", "1");
             model.put("collor", "green");
             model.put("into", "可以" + getMsg(inType));
             if (inType == 2) {
@@ -109,6 +109,41 @@ public class ScanController {
         }
     }
 
+    @ApiOperation("巡检人员检查扫码信息")
+    @GetMapping("/user/scanEstate.html")
+    public ModelAndView scanEstate(HttpServletRequest request, ModelMap model) {
+        String code = request.getParameter("code");
+        UserOpen userOpen = homeService.getUserOpen();
+        List<UserRole> list = userRoleMapper.getUserRoleByUserId(userOpen.getUserId());
+//        List<UserRole> list = userRoleMapper.getUserRoleByUserId(1L);
+//        UserOpen userOpen = userOpenMapper.selectByUserId(1L);
+        model.put("user", userOpen);
+        model.put("user_id", "\"" + userOpen.getUserId() + "\"");
+        if (list.size() == 0) {
+            return new ModelAndView("/user/home.ftl", model);
+        } else {
+            List<UptownHome> uptownHomes =  uptownHomeMapper.getUptownHomeByUserId(userOpen.getUserId());
+            UptownUnit unit = uptownUnitMapper.getUptownUnitByUser(userOpen.getUserId());
+            model.put("doorplate", unit.getRidgepole() + "栋" + unit.getUnit() + "单元" +unit.getDoorplate());
+            model.put("name", uptownHomes.get(0).getLinkman());
+            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            model.put("now", format.format(new Date()));
+            List<OutScanEstate> list1 = outScanEstateMapper.getOutScanEstateTodayByUser(userOpen.getUserId());
+            int conut = list1.size() + 1;
+            if (list1.size() < 2) {
+                model.put("collor", "green");
+                model.put("into", "允许行动");
+                model.put("errorMsg", "这是您今天第" + conut + "次出行,允许同行,注意安全。");
+            } else {
+                model.put("collor", "red");
+                model.put("into", "劝您回家");
+                model.put("errorMsg", "这是您今天第" + conut + "次出行,为了您的安全,请尽快回家。");
+            }
+            scanService.saveOutScanEstate(userOpen.getUserId());
+            return new ModelAndView("/user/scanEstate.ftl", model);
+        }
+    }
+
     public Boolean compareTime(Date time1, DateTime time2, Integer day) {
         Date date = new Date(time2.getMillis() + 1000L*3600*24*day);
         if (changeTime(date).equals(changeTime(time1))) {

+ 1 - 1
whepi-web/src/main/resources/mapper/MsReport.xml

@@ -2,7 +2,7 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.bofeng.dao.MsReportMapper">
     <select id="selectByReportDate" resultType="com.bofeng.entity.MsReport">
-        select * from ms_report where report_date = #{reportDate} and  user_create = #{userCreate}
+        select * from ms_report where report_date = #{reportDate} and  user_create = #{userCreate} and report_status=1
         order by report_date desc
     </select>
 </mapper>