Browse Source

Merge remote-tracking branch 'origin/master'

guojing 5 years ago
parent
commit
2599db287d

+ 14 - 4
whepi-doc/login.sql

@@ -129,15 +129,25 @@ CREATE TABLE sys_uptown  (
   PRIMARY KEY (uptown_id) USING BTREE
   PRIMARY KEY (uptown_id) USING BTREE
 ) ENGINE = InnoDB default charset=utf8 comment = '小区表';
 ) ENGINE = InnoDB default charset=utf8 comment = '小区表';
 
 
-DROP TABLE IF EXISTS sys_uptown_house;
-CREATE TABLE sys_uptown_house  (
-  house_id         bigint(20) NOT NULL DEFAULT 0 COMMENT '门牌ID',
+DROP TABLE IF EXISTS sys_uptown_unit;
+CREATE TABLE sys_uptown_unit  (
+  unit_id         bigint(20) NOT NULL DEFAULT 0 COMMENT '单元ID',
   uptown_id         bigint(20) NOT NULL DEFAULT 0 COMMENT '小区ID',
   uptown_id         bigint(20) NOT NULL DEFAULT 0 COMMENT '小区ID',
   ridgepole         varchar(20) NOT NULL DEFAULT '' COMMENT '栋',
   ridgepole         varchar(20) NOT NULL DEFAULT '' COMMENT '栋',
   unit              varchar(20) NOT NULL DEFAULT '' COMMENT '单元',
   unit              varchar(20) NOT NULL DEFAULT '' COMMENT '单元',
+  status            int(11) NOT NULL DEFAULT 0 COMMENT '状态:1正常,0草稿,-1删除',
+  time_create       datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '新增时间',
+  time_update       datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
+  PRIMARY KEY (unit_id) USING BTREE
+) ENGINE = InnoDB default charset=utf8 comment = '栋,单元信息表';
+
+DROP TABLE IF EXISTS sys_uptown_house;
+CREATE TABLE sys_uptown_house  (
+  house_id         bigint(20) NOT NULL DEFAULT 0 COMMENT '门牌ID',
+  unit_id          bigint(20) NOT NULL DEFAULT 0 COMMENT '单元ID',
   doorplate         varchar(20)  NOT NULL DEFAULT '' COMMENT '门牌',
   doorplate         varchar(20)  NOT NULL DEFAULT '' COMMENT '门牌',
   status            int(11) NOT NULL DEFAULT 0 COMMENT '状态:1正常,0草稿,-1删除',
   status            int(11) NOT NULL DEFAULT 0 COMMENT '状态:1正常,0草稿,-1删除',
   time_create       datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '新增时间',
   time_create       datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '新增时间',
   time_update       datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
   time_update       datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
   PRIMARY KEY (house_id) USING BTREE
   PRIMARY KEY (house_id) USING BTREE
-) ENGINE = InnoDB default charset=utf8 comment = '门牌信息表';
+) ENGINE = InnoDB default charset=utf8 comment = '门牌信息表';

+ 3 - 2
whepi-doc/mrsb.sql

@@ -8,6 +8,7 @@ CREATE TABLE ms_report  (
   safety_num        int(11) NOT NULL DEFAULT 0                              COMMENT '平安人数',
   safety_num        int(11) NOT NULL DEFAULT 0                              COMMENT '平安人数',
   suspected_num     int(11) NOT NULL DEFAULT 0                              COMMENT '疑似人数',
   suspected_num     int(11) NOT NULL DEFAULT 0                              COMMENT '疑似人数',
   remarks           varchar(100)  NOT NULL DEFAULT ''                       COMMENT '异常备注',
   remarks           varchar(100)  NOT NULL DEFAULT ''                       COMMENT '异常备注',
+  report_date       date (0)                                                COMMENT '上报日期',
   ms_status         int(11) NOT NULL DEFAULT 1                              COMMENT '健康状态:1正常,2异常',
   ms_status         int(11) NOT NULL DEFAULT 1                              COMMENT '健康状态:1正常,2异常',
   user_create       bigint(20) NOT NULL DEFAULT 0                           COMMENT '新增人',
   user_create       bigint(20) NOT NULL DEFAULT 0                           COMMENT '新增人',
   time_create       datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0)       COMMENT '新增时间',
   time_create       datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0)       COMMENT '新增时间',
@@ -24,11 +25,11 @@ DROP TABLE IF EXISTS ms_suspected;
 CREATE TABLE ms_suspected  (
 CREATE TABLE ms_suspected  (
   suspected_id      bigint(20) NOT NULL DEFAULT 0                           COMMENT '疑似ID',
   suspected_id      bigint(20) NOT NULL DEFAULT 0                           COMMENT '疑似ID',
   report_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 '家人姓名',
   family_relative   int(11)    NOT NULL DEFAULT 1                           COMMENT '是否家庭成员:1是,2暂住亲友',
   family_relative   int(11)    NOT NULL DEFAULT 1                           COMMENT '是否家庭成员:1是,2暂住亲友',
   medical           int(11)    NOT NULL DEFAULT 1                           COMMENT '是否就医:1否,1是',
   medical           int(11)    NOT NULL DEFAULT 1                           COMMENT '是否就医:1否,1是',
-  condition_status  int(11)    NOT NULL DEFAULT 0                           COMMENT '疑似情况:1咳嗽,2发烧,3腹泻,4胸痛,5咽痛,6其他 ',
+  condition_status  varchar(50)  NOT NULL DEFAULT ''                        COMMENT '疑似情况:1咳嗽,2发烧,3腹泻,4胸痛,5咽痛,6其他 ',
   remarks           varchar(100)  NOT NULL DEFAULT ''                       COMMENT '异常备注',
   remarks           varchar(100)  NOT NULL DEFAULT ''                       COMMENT '异常备注',
-
   user_create       bigint(20) NOT NULL DEFAULT 0                           COMMENT '新增人',
   user_create       bigint(20) NOT NULL DEFAULT 0                           COMMENT '新增人',
   time_create       datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0)       COMMENT '新增时间',
   time_create       datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0)       COMMENT '新增时间',
   user_update       bigint(20) NOT NULL DEFAULT 0                           COMMENT '修改人',
   user_update       bigint(20) NOT NULL DEFAULT 0                           COMMENT '修改人',

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

@@ -91,7 +91,8 @@
     }
     }
 
 
     function familyValue(v) {
     function familyValue(v) {
-        $('#notitle').append($('<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="form" href="javascript:;">\n' +
+        $('#notitle').append($('<a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="form" ' +
+                '                               onclick=\'xiaoQuItemClick(' + JSON.stringify(v) + ')\'>\n' +
                 '                        <div class="weui-cell__bd" taskId="1212>\n' +
                 '                        <div class="weui-cell__bd" taskId="1212>\n' +
                 '                            <div class="weui-media-box weui-media-box_text" id="title">\n' +
                 '                            <div class="weui-media-box weui-media-box_text" id="title">\n' +
                 '                                <p class="weui-media-box__desc" >' + v.taskTitle + '</p>\n' +
                 '                                <p class="weui-media-box__desc" >' + v.taskTitle + '</p>\n' +
@@ -102,5 +103,9 @@
 
 
     }
     }
 
 
+function xiaoQuItemClick(v) {
+      debugger
+}
+
 
 
 </script>
 </script>

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

@@ -269,7 +269,7 @@
 
 
     function helpValue(v) {
     function helpValue(v) {
         $('#valueQz').append($(' <a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="form"\n' +
         $('#valueQz').append($(' <a class="weui-cell weui-cell_active weui-cell_access js_item" data-id="form"\n' +
-                '                               href="javascript:;">\n' +
+                '                               onclick=\'myItemClick(' + JSON.stringify(v) + ')\'>\n' +
                 '                                <div class="weui-cell__bd">\n' +
                 '                                <div class="weui-cell__bd">\n' +
                 '                                    <div class="weui-media-box weui-media-box_text" id="title">\n' +
                 '                                    <div class="weui-media-box weui-media-box_text" id="title">\n' +
                 '                                        <p class="weui-media-box__desc">' + v.taskTitle + '</p>\n' +
                 '                                        <p class="weui-media-box__desc">' + v.taskTitle + '</p>\n' +
@@ -279,5 +279,9 @@
                 '                            </a><br />'));
                 '                            </a><br />'));
     }
     }
 
 
+    function myItemClick(v) {
+        debugger
+    }
+
 </script>
 </script>
 
 

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

@@ -66,7 +66,7 @@
                                 <div class="weui-cell weui-cell_active" id="js_cell">
                                 <div class="weui-cell weui-cell_active" id="js_cell">
                                     <div class="weui-cell__hd"><label class="weui-label">家人</label></div>
                                     <div class="weui-cell__hd"><label class="weui-label">家人</label></div>
                                     <div class="weui-cell__bd weui-flex">
                                     <div class="weui-cell__bd weui-flex">
-                                        <input id="js_input_xingming" class="weui-input" autofocus="" type="text"
+                                        <input id="js_input_user_name" class="weui-input" autofocus="" type="text"
                                                placeholder="请输入姓名" maxlength="20">
                                                placeholder="请输入姓名" maxlength="20">
                                     </div>
                                     </div>
                                 </div>
                                 </div>
@@ -110,7 +110,7 @@
                                 </div>
                                 </div>
                                 <div class="weui-cell ">
                                 <div class="weui-cell ">
                                     <div class="weui-cell__bd">
                                     <div class="weui-cell__bd">
-                                        <textarea class="weui-textarea" placeholder="请输入病情描述" rows="3"></textarea>
+                                        <textarea id="rb_remarks" class="weui-textarea" placeholder="请输入病情描述" rows="3"></textarea>
                                         <div class="weui-textarea-counter"><span>0</span>/200</div>
                                         <div class="weui-textarea-counter"><span>0</span>/200</div>
                                     </div>
                                     </div>
                                 </div>
                                 </div>

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

@@ -45,21 +45,21 @@ function ribao_commit() {
 
 
 
 
 function ribaoCommit() {
 function ribaoCommit() {
-  var userType = $('input:radio:checked').val();
-  var linkman = $("#linkman").val();
-  var phone = $("#phone").val();
-  console.log(userType)
-  console.log(linkman)
-  console.log(phone)
+  var user_name = $("#js_input_user_name").val();
+  var remarks = $("#rb_remarks").val();
+  var medical = $('input:radio:checked').val();
+  console.log(user_name)
+  console.log(remarks)
+  console.log(medical)
 
 
   $.ajax({
   $.ajax({
     url: '/home/addRibao.json',
     url: '/home/addRibao.json',
     type: "post",
     type: "post",
     data: {
     data: {
-      "userId": 123,
-      "userType": userType,
-      "linkman": '',
-      "phone": '',
+      "userName": user_name,
+      "conditionStatus": "",
+      "medical": medical,
+      "remarks": remarks,
     },
     },
   });
   });
 }
 }

+ 85 - 88
whepi-ui/templates/user/home.ftl

@@ -153,15 +153,25 @@
                             </select>
                             </select>
                         </div>
                         </div>
                     </div>
                     </div>
-                    <div class="weui-cell weui-cell_select weui-cell_select-after">
+                    <div class="weui-cell weui-cell_select weui-cell_select-after" id="unitMsg">
                         <div class="weui-cell__hd">
                         <div class="weui-cell__hd">
-                            <label for="" class="weui-label">栋/单元/门牌</label>
+                            <label for="" class="weui-label">栋/单元</label>
                         </div>
                         </div>
                         <div class="weui-cell__bd">
                         <div class="weui-cell__bd">
-                            <select class="weui-select" id="houseId" name="select4">
+                            <select class="weui-select" id="unitId" name="select4">
                             </select>
                             </select>
                         </div>
                         </div>
                     </div>
                     </div>
+                    <div id="doorplateMsg">
+                        <div class="weui-cells__title">门牌号输入</div>
+                        <div class="weui-cells">
+                            <div class="weui-cell">
+                                <div class="weui-cell__bd">
+                                    <input class="weui-input" type="text" id="doorplate" placeholder="请输入文本"/>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
                     <br/>
                     <br/>
                     <br/>
                     <br/>
                     <br/>
                     <br/>
@@ -170,49 +180,6 @@
                         <a class="weui-btn weui-btn_primary" href="javascript:;" onclick="save();" id="save">确定</a>
                         <a class="weui-btn weui-btn_primary" href="javascript:;" onclick="save();" id="save">确定</a>
                     </div>
                     </div>
 
 
-
-                    <div class="page" id="tpl_msg_warn_userType" hidden="hidden">
-                        <div class="weui-msg">
-                            <div class="weui-msg__icon-area"><i class="weui-icon-warn weui-icon_msg"></i></div>
-                            <div class="weui-msg__text-area">
-                                <h2 class="weui-msg__title">操作失败</h2>
-                                <p class="weui-msg__desc" id="errorMsg">用户类型不能为空</p>
-                            </div>
-                            <div class="weui-msg__opr-area">
-                                <p class="weui-btn-area">
-                                    <a href="javascript:;" onclick="back();" class="weui-btn weui-btn_default">返回</a>
-                                </p>
-                            </div>
-                        </div>
-                    </div>
-                    <div class="page" id="tpl_msg_warn_linkman" hidden="hidden">
-                        <div class="weui-msg">
-                            <div class="weui-msg__icon-area"><i class="weui-icon-warn weui-icon_msg"></i></div>
-                            <div class="weui-msg__text-area">
-                                <h2 class="weui-msg__title">操作失败</h2>
-                                <p class="weui-msg__desc" id="errorMsg">联系人不能为空</p>
-                            </div>
-                            <div class="weui-msg__opr-area">
-                                <p class="weui-btn-area">
-                                    <a href="javascript:;" onclick="back();" class="weui-btn weui-btn_default">返回</a>
-                                </p>
-                            </div>
-                        </div>
-                    </div>
-                    <div class="page" id="tpl_msg_warn_phone" hidden="hidden">
-                        <div class="weui-msg">
-                            <div class="weui-msg__icon-area"><i class="weui-icon-warn weui-icon_msg"></i></div>
-                            <div class="weui-msg__text-area">
-                                <h2 class="weui-msg__title">操作失败</h2>
-                                <p class="weui-msg__desc" id="errorMsg">电话号码校验失败</p>
-                            </div>
-                            <div class="weui-msg__opr-area">
-                                <p class="weui-btn-area">
-                                    <a href="javascript:;" onclick="back();" class="weui-btn weui-btn_default">返回</a>
-                                </p>
-                            </div>
-                        </div>
-                    </div>
                 </div>
                 </div>
             </div>
             </div>
         </div>
         </div>
@@ -232,7 +199,7 @@
             getUptownData(area);
             getUptownData(area);
         });
         });
         $("#uptownId").on("change", function () {
         $("#uptownId").on("change", function () {
-            getUptownHouseData();
+            getUptownUnitData();
             $("#houseId").empty();
             $("#houseId").empty();
         })
         })
     })
     })
@@ -251,26 +218,27 @@
                     }
                     }
                     $('#uptownId').append(html);
                     $('#uptownId').append(html);
                     $("#uptownId").val(data[0].uptownId);
                     $("#uptownId").val(data[0].uptownId);
-                    getUptownHouseData();
+                    getUptownUnitData();
                 }
                 }
             }
             }
         });
         });
     }
     }
 
 
-    function getUptownHouseData() {
+    function getUptownUnitData() {
         $.ajax({
         $.ajax({
             type: "GET",
             type: "GET",
-            url: "/home/getUptownHouseData.json?uptownId=" + $("#uptownId").val(),
+            url: "/home/getUptownUnitData.json?uptownId=" + $("#uptownId").val(),
             data: {},
             data: {},
             dataType: "json",
             dataType: "json",
             success: function (data) {
             success: function (data) {
                 if (data.length > 0) {
                 if (data.length > 0) {
-                    $("#houseId").empty();
+                    $("#unitId").empty();
                     var html = "";
                     var html = "";
                     for (var i = 0; i < data.length; i++) {
                     for (var i = 0; i < data.length; i++) {
-                        html += '<option value="' + data[i].houseId + '">'+data[i].ridgepole+'栋'+data[i].unit+'单元'+data[i].doorplate+'号' + '</option>';
+                        html += '<option value="' + data[i].unitId + '">'+data[i].ridgepole+'栋'+data[i].unit+'单元' + '</option>';
                     }
                     }
-                    $('#houseId').append(html);
+                    $('#unitId').append(html);
+                    $("#unitId").val(data[0].unitId);
                 }
                 }
             }
             }
         });
         });
@@ -279,6 +247,7 @@
         <#if user ??>var userId = ${user.userId!''}</#if>;
         <#if user ??>var userId = ${user.userId!''}</#if>;
 
 
     function save() {
     function save() {
+        var userType = $('input:radio:checked').val();
         var city = $("#city").val();
         var city = $("#city").val();
         if (!city) {
         if (!city) {
             alert("请选择城市!")
             alert("请选择城市!")
@@ -294,45 +263,70 @@
             alert("请选择小区!")
             alert("请选择小区!")
             return false;
             return false;
         }
         }
-        var houseId = $("#houseId").val();
-        if (!houseId) {
-            alert("请选择门牌信息!")
-            return false;
+        var unitId = $("#unitId").val();
+        var doorplate = $("#doorplate").val();
+        if(userType == 1) {
+            if (!unitId) {
+                alert("栋/单元!")
+                return false;
+            }
+            if (!doorplate) {
+                alert("请选择门牌信息!")
+                return false;
+            }
         }
         }
         console.log(city)
         console.log(city)
         console.log(area)
         console.log(area)
         console.log(uptownId)
         console.log(uptownId)
-        console.log(houseId)
-
-
-
-        $.ajax({
-            url: '/home/checkHouseId.json',
-            type: "post",
-            data: {
-                "houseId": houseId,
-            },success: function (data) {
-                if (!data.success) {
-                    alert(data.msg);
-                    return false;
-                } else {
-                    $.ajax({
-                        url: '/home/saveUser.json',
-                        type: "post",
-                        data: {
-                            "userId": userId,
-                            "userType": $('input:radio:checked').val(),
-                            "linkman": $("#linkman").val(),
-                            "phone": $("#phone").val(),
-                            "city": city,
-                            "area": area,
-                            "uptownId": uptownId,
-                            "houseId": houseId,
-                        },
-                    });
+        console.log(unitId)
+        console.log(doorplate)
+        if (userType == 1) {
+            $.ajax({
+                url: '/home/checkHouseId.json',
+                type: "post",
+                data: {
+                    "unitId": unitId,
+                    "doorplate": doorplate,
+                },success: function (data) {
+                    if (!data.success) {
+                        alert(data.msg);
+                        return false;
+                    } else {
+                        $.ajax({
+                            url: '/home/saveUser.json',
+                            type: "post",
+                            data: {
+                                "userId": 111,
+                                "userType": $('input:radio:checked').val(),
+                                "linkman": $("#linkman").val(),
+                                "phone": $("#phone").val(),
+                                "city": city,
+                                "area": area,
+                                "unitId": unitId,
+                                "uptownId": uptownId,
+                                "doorplate": doorplate,
+                            },
+                        });
+                    }
                 }
                 }
-            }
-        });
+            });
+        } else {
+            $.ajax({
+                url: '/home/saveUser.json',
+                type: "post",
+                data: {
+                    "userId": 111,
+                    "userType": $('input:radio:checked').val(),
+                    "linkman": $("#linkman").val(),
+                    "phone": $("#phone").val(),
+                    "city": city,
+                    "area": area,
+                    "unitId": unitId,
+                    "uptownId": uptownId,
+                    "doorplate": doorplate,
+                },
+            });
+        }
     }
     }
 
 
     function goOn() {
     function goOn() {
@@ -368,7 +362,10 @@
         console.log(userType)
         console.log(userType)
         console.log(linkman)
         console.log(linkman)
         console.log(phone)
         console.log(phone)
-
+        if (userType == 2) {
+            $("#unitMsg").hide();
+            $("#doorplateMsg").hide();
+        }
     }
     }
 
 
     function back() {
     function back() {

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

@@ -65,7 +65,7 @@
                 for (var i = 0; i < data.data.length; i++) {
                 for (var i = 0; i < data.data.length; i++) {
 
 
                     var v = data.data[i];
                     var v = data.data[i];
-                        $('#btnRBmp').append('<td>'+v.doorplate+'</td>');
+                        $('#btnRBmp').append('<td >'+v.doorplate+'</td>');
 
 
                 }
                 }
 
 

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

@@ -2,10 +2,20 @@ package com.bofeng.dao;
 
 
 import com.baomidou.mybatisplus.mapper.BaseMapper;
 import com.baomidou.mybatisplus.mapper.BaseMapper;
 import com.bofeng.entity.MsReport;
 import com.bofeng.entity.MsReport;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
 
 
 /**
 /**
  * @Author: xielianghe
  * @Author: xielianghe
  * @Date: 2020/2/4 15:45
  * @Date: 2020/2/4 15:45
  */
  */
+@Mapper
+@Repository
 public interface MsReportMapper extends BaseMapper<MsReport> {
 public interface MsReportMapper extends BaseMapper<MsReport> {
+
+    List<MsReport> selectByReportDate(@Param("reportDate") String reportDate);
+
 }
 }

+ 6 - 0
whepi-web/src/main/java/com/bofeng/dao/MsSuspectedMapper.java

@@ -2,10 +2,14 @@ package com.bofeng.dao;
 
 
 
 
 import com.baomidou.mybatisplus.mapper.BaseMapper;
 import com.baomidou.mybatisplus.mapper.BaseMapper;
+import com.bofeng.entity.MsReport;
 import com.bofeng.entity.MsSuspected;
 import com.bofeng.entity.MsSuspected;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 import org.springframework.stereotype.Repository;
 
 
+import java.util.List;
+
 /**
 /**
  * @Author: xielianghe
  * @Author: xielianghe
  * @Date: 2020/2/4 15:39
  * @Date: 2020/2/4 15:39
@@ -13,4 +17,6 @@ import org.springframework.stereotype.Repository;
 @Mapper
 @Mapper
 @Repository
 @Repository
 public interface MsSuspectedMapper extends BaseMapper<MsSuspected> {
 public interface MsSuspectedMapper extends BaseMapper<MsSuspected> {
+
+    List<MsSuspected> selectByReportId(@Param("reportId") Long reportId);
 }
 }

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

@@ -14,5 +14,5 @@ import java.util.List;
 public interface UptownHomeMapper extends BaseMapper<UptownHome> {
 public interface UptownHomeMapper extends BaseMapper<UptownHome> {
 
 
     @Select("select * from sys_uptown_home where house_id = #{houseId} and status = 1")
     @Select("select * from sys_uptown_home where house_id = #{houseId} and status = 1")
-    List<UptownHome> getUptownHomeBy(@Param("houseId")Long houseId);
+    List<UptownHome> getUptownHomeBy(@Param("houseId")Long houseId, @Param("doorplate")String doorplate);
 }
 }

+ 4 - 0
whepi-web/src/main/java/com/bofeng/dao/UptownHouseMapper.java

@@ -1,6 +1,7 @@
 package com.bofeng.dao;
 package com.bofeng.dao;
 
 
 import com.baomidou.mybatisplus.mapper.BaseMapper;
 import com.baomidou.mybatisplus.mapper.BaseMapper;
+import com.bofeng.entity.UptownHome;
 import com.bofeng.entity.UptownHouse;
 import com.bofeng.entity.UptownHouse;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Param;
@@ -15,4 +16,7 @@ public interface UptownHouseMapper extends BaseMapper<UptownHouse> {
 
 
     @Select("select * from sys_uptown_house where status = 1 and uptown_id = #{uptownId}")
     @Select("select * from sys_uptown_house where status = 1 and uptown_id = #{uptownId}")
     List<UptownHouse> getAllUptownHouse(@Param("uptownId") Long uptownId);
     List<UptownHouse> getAllUptownHouse(@Param("uptownId") Long uptownId);
+
+    @Select("select * from sys_uptown_house where status = 1 and unit_id = #{unitId} and doorplate = #{doorplate}")
+    List<UptownHome> getUptownHouseBy(@Param("unitId") Long unitId, @Param("doorplate") String doorplate);
 }
 }

+ 18 - 0
whepi-web/src/main/java/com/bofeng/dao/UptownUnitMapper.java

@@ -0,0 +1,18 @@
+package com.bofeng.dao;
+
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+import com.bofeng.entity.UptownUnit;
+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 UptownUnitMapper extends BaseMapper<UptownUnit> {
+
+    @Select("select * from sys_uptown_unit where status = 1 and uptown_id = #{uptownId}")
+    List<UptownUnit> getUptownUnitData(@Param("uptownId") Long uptownId);
+}

+ 5 - 0
whepi-web/src/main/java/com/bofeng/entity/MsReport.java

@@ -9,6 +9,8 @@ import lombok.Getter;
 import lombok.Setter;
 import lombok.Setter;
 import org.joda.time.DateTime;
 import org.joda.time.DateTime;
 
 
+import java.util.Date;
+
 /**
 /**
  * @Author: xielianghe
  * @Author: xielianghe
  * @Date: 2020/2/4 14:54
  * @Date: 2020/2/4 14:54
@@ -33,6 +35,9 @@ public class MsReport {
     @TableField("remarks")
     @TableField("remarks")
     private String remarks;
     private String remarks;
 
 
+    @TableField("report_date")
+    private Date reportDate;
+
     @TableField("ms_status")
     @TableField("ms_status")
     private Integer msStatus;
     private Integer msStatus;
 
 

+ 4 - 1
whepi-web/src/main/java/com/bofeng/entity/MsSuspected.java

@@ -24,6 +24,9 @@ public class MsSuspected {
     @TableField("report_id")
     @TableField("report_id")
     private Long reportId;
     private Long reportId;
 
 
+    @TableField("user_name")
+    private String userName;
+
     @TableField("family_relative")
     @TableField("family_relative")
     private Integer familyRelative;
     private Integer familyRelative;
 
 
@@ -31,7 +34,7 @@ public class MsSuspected {
     private Integer medical;
     private Integer medical;
 
 
     @TableField("condition_status")
     @TableField("condition_status")
-    private Integer conditionStatus;
+    private String conditionStatus;
 
 
     @TableField("remarks")
     @TableField("remarks")
     private String remarks;
     private String remarks;

+ 2 - 14
whepi-web/src/main/java/com/bofeng/entity/UptownHouse.java

@@ -19,14 +19,8 @@ public class UptownHouse {
     @TableField("house_id")
     @TableField("house_id")
     private Long houseId;
     private Long houseId;
 
 
-    @TableField("uptown_id")
-    private Long uptownId;
-
-    @TableField("ridgepole")
-    private String ridgepole;
-
-    @TableField("unit")
-    private String unit;
+    @TableField("unit_id")
+    private Long unitId;
 
 
     @TableField("doorplate")
     @TableField("doorplate")
     private String doorplate;
     private String doorplate;
@@ -37,15 +31,9 @@ public class UptownHouse {
     @TableField("status")
     @TableField("status")
     private Integer status;
     private Integer status;
 
 
-    @TableField("user_create")
-    private Long userCreate;
-
     @TableField(exist = false)
     @TableField(exist = false)
     private DateTime timeCreate;
     private DateTime timeCreate;
 
 
-    @TableField("user_update")
-    private Long userUpdate;
-
     @TableField(exist = false)
     @TableField(exist = false)
     private DateTime timeUpdate;
     private DateTime timeUpdate;
 }
 }

+ 46 - 0
whepi-web/src/main/java/com/bofeng/entity/UptownUnit.java

@@ -0,0 +1,46 @@
+package com.bofeng.entity;
+
+import com.baomidou.mybatisplus.annotations.TableField;
+import com.baomidou.mybatisplus.annotations.TableName;
+import lombok.Getter;
+import lombok.Setter;
+import org.joda.time.DateTime;
+
+/**
+ * 门牌信息表
+ */
+@Getter
+@Setter
+@TableName("sys_uptown_unit")
+public class UptownUnit {
+
+    @TableField("unit_id")
+    private Long unitId;
+
+    @TableField("uptown_id")
+    private Long uptown_id;
+
+    @TableField("ridgepole")
+    private String ridgepole;
+
+    @TableField("unit")
+    private String unit;
+
+    /**
+     * 状态:1正常,0草稿,-1删除
+     */
+    @TableField("status")
+    private Integer status;
+
+    @TableField("user_create")
+    private Long userCreate;
+
+    @TableField(exist = false)
+    private DateTime timeCreate;
+
+    @TableField("user_update")
+    private Long userUpdate;
+
+    @TableField(exist = false)
+    private DateTime timeUpdate;
+}

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

@@ -1,9 +1,41 @@
 package com.bofeng.service;
 package com.bofeng.service;
 
 
 
 
+import com.bofeng.dao.MsReportMapper;
+import com.bofeng.dao.MsSuspectedMapper;
+import com.bofeng.entity.MsReport;
+import com.bofeng.entity.MsSuspected;
+import com.bofeng.entity.NotifyOpen;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+
 /**
 /**
  * @Author: xielianghe
  * @Author: xielianghe
  * @Date: 2020/2/4 15:44
  * @Date: 2020/2/4 15:44
  */
  */
+@Service
+@Transactional(readOnly = true)
 public class MsReportService {
 public class MsReportService {
+
+    @Autowired
+    private MsSuspectedMapper msSuspectedMapper;
+    @Autowired
+    private MsReportMapper msReportMapper;
+
+    public List<MsSuspected> getByDateNow() {
+        Date t = new Date();
+        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
+        String reportDate = df.format(t);
+        List<MsReport> listReport = msReportMapper.selectByReportDate(reportDate);
+        List<MsSuspected> listSuspected = null;
+        if (listReport != null && listReport.size() > 0) {
+            listSuspected = msSuspectedMapper.selectByReportId(Long.parseLong(listReport.get(0).getReportId().toString()));
+        }
+        return listSuspected;
+    }
 }
 }

+ 44 - 13
whepi-web/src/main/java/com/bofeng/service/MsSuspectedService.java

@@ -2,18 +2,21 @@ package com.bofeng.service;
 
 
 
 
 import com.baomidou.mybatisplus.toolkit.IdWorker;
 import com.baomidou.mybatisplus.toolkit.IdWorker;
+import com.bofeng.dao.MsReportMapper;
 import com.bofeng.dao.MsSuspectedMapper;
 import com.bofeng.dao.MsSuspectedMapper;
-import com.bofeng.dao.UserOpenMapper;
+import com.bofeng.entity.MsReport;
 import com.bofeng.entity.MsSuspected;
 import com.bofeng.entity.MsSuspected;
-import com.bofeng.entity.Owner;
-import com.bofeng.entity.UptownHome;
-import com.bofeng.entity.UserRole;
+import com.sun.org.apache.bcel.internal.generic.NEW;
 import org.joda.time.DateTime;
 import org.joda.time.DateTime;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.transaction.annotation.Transactional;
 
 
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+
 /**
 /**
  * @Author: xielianghe
  * @Author: xielianghe
  * @Date: 2020/2/4 15:44
  * @Date: 2020/2/4 15:44
@@ -25,22 +28,50 @@ public class MsSuspectedService {
 
 
     @Autowired
     @Autowired
     private MsSuspectedMapper msSuspectedMapper;
     private MsSuspectedMapper msSuspectedMapper;
+    @Autowired
+    private MsReportMapper msReportMapper;
 
 
 
 
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
-    public void addRibao(Long userId, Integer userType, String linkman, String phone) {
+    public void addSuspected(String userName, String conditionStatus, Integer medical, String remarks) {
+        Long reportId=0L;
+        //如果是当前日期 已经添加
+        Date t = new Date();
+        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
+        String reportDate=df.format(t);
+        List<MsReport> listReport = msReportMapper.selectByReportDate(reportDate);
+        if (listReport == null|| listReport.size()==0) {
+            MsReport msReport = new MsReport();
+            msReport.setReportId(IdWorker.getId());
+            msReport.setHouseId(0L);
+            msReport.setSafetyNum(0);
+            msReport.setSuspectedNum(0);
+            msReport.setRemarks("");
+            msReport.setReportDate(DateTime.now().toDate());
+            msReport.setMsStatus(0);
+            msReport.setUserCreate(0L);
+            msReport.setTimeCreate(DateTime.now());
+            msReport.setUserUpdate(0L);
+            msReport.setTimeUpdate(DateTime.now());
+            msReportMapper.insert(msReport);
+            reportId=msReport.getReportId();
+        }
+        else
+            reportId=listReport.get(0).getReportId();
+
+        //添加家人
         MsSuspected msSuspected = new MsSuspected();
         MsSuspected msSuspected = new MsSuspected();
         msSuspected.setSuspectedId(IdWorker.getId());
         msSuspected.setSuspectedId(IdWorker.getId());
-        msSuspected.setReportId(userId);
-        msSuspected.setFamilyRelative(userType);
-        msSuspected.setConditionStatus(0);
-        msSuspected.setMedical(0);
-        msSuspected.setRemarks("测试");
-        msSuspected.setUserCreate(userId);
+        msSuspected.setReportId(reportId);
+        msSuspected.setUserName(userName);
+        msSuspected.setFamilyRelative(1);//默认为家人
+        msSuspected.setConditionStatus(conditionStatus);
+        msSuspected.setMedical(medical);
+        msSuspected.setRemarks(remarks);
+        msSuspected.setUserCreate(0L);
         msSuspected.setTimeCreate(DateTime.now());
         msSuspected.setTimeCreate(DateTime.now());
-        msSuspected.setUserUpdate(userId);
+        msSuspected.setUserUpdate(0L);
         msSuspected.setTimeUpdate(DateTime.now());
         msSuspected.setTimeUpdate(DateTime.now());
         msSuspectedMapper.insert(msSuspected);
         msSuspectedMapper.insert(msSuspected);
     }
     }
-
 }
 }

+ 10 - 2
whepi-web/src/main/java/com/bofeng/service/UserOpenService.java

@@ -54,9 +54,11 @@ public class UserOpenService {
     private OwnerMapper ownerMapper;
     private OwnerMapper ownerMapper;
     @Autowired
     @Autowired
     private UserRoleMapper userRoleMapper;
     private UserRoleMapper userRoleMapper;
+    @Autowired
+    private UptownHouseMapper uptownHouseMapper;
 
 
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
     @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
-    public void saveUserInfo(Long userId, Integer userType, String linkman, String phone, Integer area, Long uptownId, Long houseId) {
+    public void saveUserInfo(Long userId, Integer userType, String linkman, String phone, Integer area, Long uptownId, Long unitId, String doorplate) {
         UserRole userRole = new UserRole();
         UserRole userRole = new UserRole();
         userRole.setUrId(IdWorker.getId());
         userRole.setUrId(IdWorker.getId());
         userRole.setUserId(userId);
         userRole.setUserId(userId);
@@ -64,8 +66,14 @@ public class UserOpenService {
         userRole.setUserCreate(userId);
         userRole.setUserCreate(userId);
         userRole.setUserUpdate(userId);
         userRole.setUserUpdate(userId);
         if (userType == 1) {
         if (userType == 1) {
+            UptownHouse uptownHouse = new UptownHouse();
+            uptownHouse.setHouseId(IdWorker.getId());
+            uptownHouse.setUnitId(unitId);
+            uptownHouse.setDoorplate(doorplate);
+            uptownHouse.setStatus(1);
+            uptownHouseMapper.insert(uptownHouse);
             UptownHome uptownHome = new UptownHome();
             UptownHome uptownHome = new UptownHome();
-            uptownHome.setHouseId(houseId);
+            uptownHome.setHouseId(uptownHouse.getHouseId());
             uptownHome.setLinkman(linkman);
             uptownHome.setLinkman(linkman);
             uptownHome.setPhone(phone);
             uptownHome.setPhone(phone);
             uptownHome.setYoung(0);
             uptownHome.setYoung(0);

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

@@ -23,11 +23,11 @@ public class MsReportController {
 
 
     @PostMapping("/home/addRibao.json")
     @PostMapping("/home/addRibao.json")
     public ModelAndView saveUser(HttpServletRequest request) {
     public ModelAndView saveUser(HttpServletRequest request) {
-        Long userId = Long.parseLong(request.getParameter("userId"));
-        Integer userType = Integer.parseInt(request.getParameter("userType"));
-        String linkman = request.getParameter("linkman");
-        String phone = request.getParameter("phone");
-        msSuspectedService.addRibao(userId, userType, linkman, phone);
+        String userName = request.getParameter("userName");
+        String conditionStatus = request.getParameter("conditionStatus");
+        Integer medical = request.getParameter("medical").equals("on") ? 1 : 0;
+        String remarks = request.getParameter("remarks");
+        msSuspectedService.addSuspected(userName, conditionStatus, medical, remarks);
         return new ModelAndView("/home/home.ftl");
         return new ModelAndView("/home/home.ftl");
     }
     }
 }
 }

+ 16 - 8
whepi-web/src/main/java/com/bofeng/wx/controller/UserOpenController.java

@@ -37,14 +37,16 @@ public class UserOpenController {
     @Autowired
     @Autowired
     private UserRoleMapper userRoleMapper;
     private UserRoleMapper userRoleMapper;
     @Autowired
     @Autowired
+    private UptownUnitMapper uptownUnitMapper;
+    @Autowired
     private QzTaskService qzTaskService;
     private QzTaskService qzTaskService;
 
 
     @GetMapping("/user/home.html")
     @GetMapping("/user/home.html")
     public ModelAndView home(ModelMap model) {
     public ModelAndView home(ModelMap model) {
         UserOpen userOpen = homeService.getUserOpen();
         UserOpen userOpen = homeService.getUserOpen();
         List<UserRole> list = userRoleMapper.getUserRoleByUserId(userOpen.getUserId());
         List<UserRole> list = userRoleMapper.getUserRoleByUserId(userOpen.getUserId());
-//        List<UserRole> list = userRoleMapper.getUserRoleByUserId(1224239062748065800L);
         model.put("user", userOpen);
         model.put("user", userOpen);
+//        List<UserRole> list = userRoleMapper.getUserRoleByUserId(1224239062748065800L);
         if (list.size() == 0) {
         if (list.size() == 0) {
             return new ModelAndView("/user/home.ftl", model);
             return new ModelAndView("/user/home.ftl", model);
         } else if (list.size()>0) {
         } else if (list.size()>0) {
@@ -64,16 +66,17 @@ public class UserOpenController {
         return uptownMapper.getAllUptown(area);
         return uptownMapper.getAllUptown(area);
     }
     }
 
 
-    @GetMapping("/home/getUptownHouseData.json")
-    public List<UptownHouse> getUptownHouseData(HttpServletRequest request, @RequestParam(value = "uptownId") Long uptownId) {
-        return uptownHouseMapper.getAllUptownHouse(uptownId);
+    @GetMapping("/home/getUptownUnitData.json")
+    public List<UptownUnit> getUptownUnitData(HttpServletRequest request, @RequestParam(value = "uptownId") Long uptownId) {
+        return uptownUnitMapper.getUptownUnitData(uptownId);
     }
     }
 
 
     @PostMapping("/home/checkHouseId.json")
     @PostMapping("/home/checkHouseId.json")
     public ResultModel checkHouseId(HttpServletRequest request) {
     public ResultModel checkHouseId(HttpServletRequest request) {
         ResultModel resultModel = new ResultModel();
         ResultModel resultModel = new ResultModel();
-        Long houseId = Long.parseLong(request.getParameter("houseId"));
-        List<UptownHome> list = uptownHomeMapper.getUptownHomeBy(houseId);
+        Long unitId = Long.parseLong(request.getParameter("unitId"));
+        String doorplate = request.getParameter("doorplate");
+        List<UptownHome> list = uptownHouseMapper.getUptownHouseBy(unitId, doorplate);
         if (list.size() > 0) {
         if (list.size() > 0) {
             resultModel.put("success", false);
             resultModel.put("success", false);
             resultModel.put("msg", "该门牌已有人入住!");
             resultModel.put("msg", "该门牌已有人入住!");
@@ -92,8 +95,13 @@ public class UserOpenController {
         String phone = request.getParameter("phone");
         String phone = request.getParameter("phone");
         Integer area = Integer.parseInt(request.getParameter("area"));
         Integer area = Integer.parseInt(request.getParameter("area"));
         Long uptownId = Long.parseLong(request.getParameter("uptownId"));
         Long uptownId = Long.parseLong(request.getParameter("uptownId"));
-        Long houseId = Long.parseLong(request.getParameter("houseId"));
-        userOpenService.saveUserInfo(userId,userType,linkman,phone,area,uptownId,houseId);
+        Long unitId = 0L;
+        String doorplate = "";
+        if (userType == 1) {
+            unitId = Long.parseLong(request.getParameter("unitId"));
+            doorplate = request.getParameter("doorplate");
+        }
+        userOpenService.saveUserInfo(userId,userType,linkman,phone,area,uptownId,unitId,doorplate);
         UserOpen userOpen = userOpenMapper.selectByUserId(userId);
         UserOpen userOpen = userOpenMapper.selectByUserId(userId);
         model.put("user", userOpen);
         model.put("user", userOpen);
         if (userType == 1) {
         if (userType == 1) {

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

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!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}
+    </select>
+</mapper>

+ 7 - 0
whepi-web/src/main/resources/mapper/MsSuspected.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.bofeng.dao.MsSuspectedMapper">
+    <select id="selectByReportId" resultType="com.bofeng.entity.MsSuspected">
+        select * from ms_report where report_id = #{reportId}
+    </select>
+</mapper>