Ver Fonte

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	whepi-ui/templates/home/ribao.ftl
#	whepi-ui/templates/home/ribao.js
c há 3 anos atrás
pai
commit
b849008649

+ 55 - 0
admin-ui/app/whepi/lingyun/dialogVaccine.js

@@ -0,0 +1,55 @@
+define(function (require) {
+    return function (context) {
+
+        var $dlg, $grid;
+
+        function queryGrid1() {
+            $grid.reload({
+                mtype: 'GET',
+                url: api('/sweepCode/selectVaccineByUserId'),
+                queryParams: {userId: context.userId}
+            }, true);
+        }
+
+        return {
+            xtype: 'dialog',
+            dialogId: 'dialogDetail',
+            title: '疫苗接种记录 >> ' + context.linkman,
+            width: '45%',
+            height: '50%',
+            onOpen: function () {
+                $dlg = $(this);
+            },
+            center: {
+                items: {
+                    onRender: function () {
+                        $grid = $(this);
+                        queryGrid1();
+                    },
+                    toolbar: {
+                        xtype: 'toolbar',
+                        title: '疫苗接种',
+                    },
+                    xtype: 'grid',
+                    idField: "reportDate",
+                    pagination: false,
+                    columns: [[
+                        {field: 'num', title: 'num', hidden: true},
+                        {field: 'times', title: '剂次', maxWidth: 150, align: 'right',},
+                        {field: 'time', title: '接种日期', align: 'left', formatter: 'tsymd'},
+                        {field: 'hospital', title: '接种医院', maxWidth: 200, align: 'right',},
+                        {field: 'unit', title: '接种单位', maxWidth: 200, align: 'right',},
+                    ]],
+                }
+            },
+            buttons: [
+                {
+                    text: "关闭", iconCls: "fa fa-times", onClick: function () {
+                        // $dlg.dialog('close');
+                        $dlg.window('close');
+                    }
+                }
+            ]
+        };
+    };
+});

+ 79 - 20
admin-ui/app/whepi/lingyun/lingyunUser.js

@@ -237,34 +237,68 @@ define(function (require) {
                 xtype: 'toolbar',
                 title: '用户列表',
                 items: [
+                  // {
+                  //   text: '生成健康及旅居申请表', iconCls: 'fa fa-cloud-upload', onClick: function () {
+                  //     var row = $grid1.checkedData();
+                  //     if (row.length == 0) {
+                  //       $.yvan.msg('请至少选择一行数据');
+                  //       return;
+                  //     }
+                  //     var ids = "";
+                  //     for (var i = 0; i < row.length; i++) {
+                  //       ids += row[i].userId + ","
+                  //     }
+                  //     ids=ids.substring(0,ids.length-1);
+                  //     window.open(api('/export/lyReports?userId=' + ids));
+                  //   }
+                  // },
+                  // {
+                  //   text: '生成隔离人员解除隔离审批表', iconCls: 'fa fa-cloud-upload', onClick: function () {
+                  //     var row = $grid1.checkedData();
+                  //     if (row.length == 0) {
+                  //       $.yvan.msg('请至少选择一行数据');
+                  //       return;
+                  //     }
+                  //     var ids = "";
+                  //     for (var i = 0; i < row.length; i++) {
+                  //       ids += row[i].userId + ","
+                  //     }
+                  //     ids=ids.substring(0,ids.length-1);
+                  //     window.open(api('/export/lyApproves?userId=' + ids));
+                  //   }
+                  // },
                   {
-                    text: '生成健康及旅居申请表', iconCls: 'fa fa-cloud-upload', onClick: function () {
-                      var row = $grid1.checkedData();
-                      if (row.length == 0) {
-                        $.yvan.msg('请至少选择一行数据');
-                        return;
+                    text: '查看人员接种记录', iconCls: 'fa fa-search', onClick: function () {
+                      var row = $grid1.rowData();
+                      if ( row == null || row == undefined || row.userId == null || row.userId == "") {
+                        $.yvan.msg('请选择数据');
+                        return
                       }
-                      var ids = "";
-                      for (var i = 0; i < row.length; i++) {
-                        ids += row[i].userId + ","
+                      if ( row.inoculateStatus.indexOf("是") < 0) {
+                        $.yvan.msg('该员工没有接种新冠疫苗');
+                        return
                       }
-                      ids=ids.substring(0,ids.length-1);
-                      window.open(api('/export/lyReports?userId=' + ids));
+                      $.yvan.showDialog(this,
+                          require('/app/whepi/lingyun/dialogVaccine.js')({
+                            userId: row.userId,
+                            linkman: row.linkman,
+                            confirm: function () {
+                            }
+                          })
+                      );
                     }
                   },
                   {
-                    text: '生成隔离人员解除隔离审批表', iconCls: 'fa fa-cloud-upload', onClick: function () {
-                      var row = $grid1.checkedData();
-                      if (row.length == 0) {
-                        $.yvan.msg('请至少选择一行数据');
-                        return;
+                    text: '导出接种明细', iconCls: 'fa fa-cloud-upload', onClick: function () {
+                      var unitId = $form.formGet().unitId;
+                      var departmentId = $form.formGet().departmentId;
+                      if (unitId == null || unitId == "") {
+                        unitId = 0
                       }
-                      var ids = "";
-                      for (var i = 0; i < row.length; i++) {
-                        ids += row[i].userId + ","
+                      if (departmentId == null || departmentId == "") {
+                        departmentId = 0
                       }
-                      ids=ids.substring(0,ids.length-1);
-                      window.open(api('/export/lyApproves?userId=' + ids));
+                      window.open(api('/sweepCode/exSelectVaccine?unitId='+unitId+'&departmentId='+departmentId));
                     }
                   },
                   {
@@ -344,6 +378,31 @@ define(function (require) {
                     {field: 'loudong', title: '部门名称', maxWidth: 200, align: 'left',},
                     {field: 'departmentName', title: '二级部门', maxWidth: 200, align: 'left',},
                     {
+                      field: 'inoculateStatus', title: '是否接种新冠疫苗', maxWidth: 130, align: 'center', formatter: function (value) {
+                        if (value == 1) {
+                          return "<span style='color: green;'>是<span>";
+                        } else if (value == 0) {
+                          return "<span style='color: red;'>否<span>";
+                        } else {
+                          return "";
+                        }
+                      }
+                    },
+                    {field: 'reason', title: '未接种原因', maxWidth: 200, align: 'left',},
+                    {
+                      field: 'vaccineType', title: '接种疫苗类别', maxWidth: 100, align: 'center', formatter: function (value) {
+                        if (value == 1) {
+                          return "<span>腺病毒疫苗<span>";
+                        } else if (value == 2) {
+                          return "<span>灭活疫苗<span>";
+                        } else if (value == 3) {
+                          return "<span>重组亚单位疫苗<span>";
+                        } else {
+                          return "";
+                        }
+                      }
+                    },
+                    {
                       field: 'living', title: '居家2公里', maxWidth: 100, align: 'center', formatter: function (value) {
                         if (value == 1) {
                           return "<span style='color: green;'>是<span>";

+ 80 - 20
admin-ui/app/whepi/lingyun/lingyunUser2.js

@@ -216,34 +216,69 @@ define(function (require) {
                 xtype: 'toolbar',
                 title: '用户列表',
                 items: [
+                  // {
+                  //   text: '生成健康及旅居申请表', iconCls: 'fa fa-cloud-upload', onClick: function () {
+                  //     var row = $grid1.checkedData();
+                  //     if (row.length == 0) {
+                  //       $.yvan.msg('请至少选择一行数据');
+                  //       return;
+                  //     }
+                  //     var ids = "";
+                  //     for (var i = 0; i < row.length; i++) {
+                  //       ids += row[i].userId + ","
+                  //     }
+                  //     ids=ids.substring(0,ids.length-1);
+                  //     window.open(api('/export/lyReports?userId=' + ids));
+                  //   }
+                  // },
+                  // {
+                  //   text: '生成隔离人员解除隔离审批表', iconCls: 'fa fa-cloud-upload', onClick: function () {
+                  //     var row = $grid1.checkedData();
+                  //     if (row.length == 0) {
+                  //       $.yvan.msg('请至少选择一行数据');
+                  //       return;
+                  //     }
+                  //     var ids = "";
+                  //     for (var i = 0; i < row.length; i++) {
+                  //       ids += row[i].userId + ","
+                  //     }
+                  //     ids=ids.substring(0,ids.length-1);
+                  //     window.open(api('/export/lyApproves?userId=' + ids));
+                  //   }
+                  // },
                   {
-                    text: '生成健康及旅居申请表', iconCls: 'fa fa-cloud-upload', onClick: function () {
-                      var row = $grid1.checkedData();
-                      if (row.length == 0) {
-                        $.yvan.msg('请至少选择一行数据');
-                        return;
+                    text: '查看人员接种记录', iconCls: 'fa fa-search', onClick: function () {
+                      var row = $grid1.rowData();
+                      if ( row == null || row == undefined || row.userId == null || row.userId == "") {
+                        $.yvan.msg('请选择数据');
+                        return
                       }
-                      var ids = "";
-                      for (var i = 0; i < row.length; i++) {
-                        ids += row[i].userId + ","
+                      if ( row.inoculateStatus.indexOf("是") < 0) {
+                        $.yvan.msg('该员工没有接种新冠疫苗');
+                        return
                       }
-                      ids=ids.substring(0,ids.length-1);
-                      window.open(api('/export/lyReports?userId=' + ids));
+                      $.yvan.showDialog(this,
+                          require('/app/whepi/lingyun/dialogVaccine.js')({
+                            userId: row.userId,
+                            linkman: row.linkman,
+                            confirm: function () {
+                              // $grid2.reload();
+                            }
+                          })
+                      );
                     }
                   },
                   {
-                    text: '生成隔离人员解除隔离审批表', iconCls: 'fa fa-cloud-upload', onClick: function () {
-                      var row = $grid1.checkedData();
-                      if (row.length == 0) {
-                        $.yvan.msg('请至少选择一行数据');
-                        return;
+                    text: '导出接种明细', iconCls: 'fa fa-cloud-upload', onClick: function () {
+                      var unitId = $form.formGet().unitId;
+                      var departmentId = $form.formGet().departmentId;
+                      if (unitId == null || unitId == "") {
+                        unitId = 0
                       }
-                      var ids = "";
-                      for (var i = 0; i < row.length; i++) {
-                        ids += row[i].userId + ","
+                      if (departmentId == null || departmentId == "") {
+                        departmentId = 0
                       }
-                      ids=ids.substring(0,ids.length-1);
-                      window.open(api('/export/lyApproves?userId=' + ids));
+                      window.open(api('/sweepCode/exSelectVaccine?unitId='+unitId+'&departmentId='+departmentId));
                     }
                   },
                   {
@@ -320,6 +355,31 @@ define(function (require) {
                     {field: 'loudong', title: '部门名称', maxWidth: 200, align: 'left',},
                     {field: 'departmentName', title: '二级部门', maxWidth: 200, align: 'left',},
                     {
+                      field: 'inoculateStatus', title: '是否接种新冠疫苗', maxWidth: 130, align: 'center', formatter: function (value) {
+                        if (value == 1) {
+                          return "<span style='color: green;'>是<span>";
+                        } else if (value == 0) {
+                          return "<span style='color: red;'>否<span>";
+                        } else {
+                          return "";
+                        }
+                      }
+                    },
+                    {field: 'reason', title: '未接种原因', maxWidth: 200, align: 'left',},
+                    {
+                      field: 'vaccineType', title: '接种疫苗类别', maxWidth: 100, align: 'center', formatter: function (value) {
+                        if (value == 1) {
+                          return "<span>腺病毒疫苗<span>";
+                        } else if (value == 2) {
+                          return "<span>灭活疫苗<span>";
+                        } else if (value == 3) {
+                          return "<span>重组亚单位疫苗<span>";
+                        } else {
+                          return "";
+                        }
+                      }
+                    },
+                    {
                       field: 'living', title: '居家2公里', maxWidth: 100, align: 'center', formatter: function (value) {
                         if (value == 1) {
                           return "<span style='color: green;'>是<span>";

+ 80 - 20
admin-ui/app/whepi/lingyun/lingyunUser7.js

@@ -237,34 +237,69 @@ define(function (require) {
                 xtype: 'toolbar',
                 title: '用户列表',
                 items: [
+                  // {
+                  //   text: '生成健康及旅居申请表', iconCls: 'fa fa-cloud-upload', onClick: function () {
+                  //     var row = $grid1.checkedData();
+                  //     if (row.length == 0) {
+                  //       $.yvan.msg('请至少选择一行数据');
+                  //       return;
+                  //     }
+                  //     var ids = "";
+                  //     for (var i = 0; i < row.length; i++) {
+                  //       ids += row[i].userId + ","
+                  //     }
+                  //     ids=ids.substring(0,ids.length-1);
+                  //     window.open(api('/export/lyReports?userId=' + ids));
+                  //   }
+                  // },
+                  // {
+                  //   text: '生成隔离人员解除隔离审批表', iconCls: 'fa fa-cloud-upload', onClick: function () {
+                  //     var row = $grid1.checkedData();
+                  //     if (row.length == 0) {
+                  //       $.yvan.msg('请至少选择一行数据');
+                  //       return;
+                  //     }
+                  //     var ids = "";
+                  //     for (var i = 0; i < row.length; i++) {
+                  //       ids += row[i].userId + ","
+                  //     }
+                  //     ids=ids.substring(0,ids.length-1);
+                  //     window.open(api('/export/lyApproves?userId=' + ids));
+                  //   }
+                  // },
                   {
-                    text: '生成健康及旅居申请表', iconCls: 'fa fa-cloud-upload', onClick: function () {
-                      var row = $grid1.checkedData();
-                      if (row.length == 0) {
-                        $.yvan.msg('请至少选择一行数据');
-                        return;
+                    text: '查看人员接种记录', iconCls: 'fa fa-search', onClick: function () {
+                      var row = $grid1.rowData();
+                      if ( row == null || row == undefined || row.userId == null || row.userId == "") {
+                        $.yvan.msg('请选择数据');
+                        return
                       }
-                      var ids = "";
-                      for (var i = 0; i < row.length; i++) {
-                        ids += row[i].userId + ","
+                      if ( row.inoculateStatus.indexOf("是") < 0) {
+                        $.yvan.msg('该员工没有接种新冠疫苗');
+                        return
                       }
-                      ids=ids.substring(0,ids.length-1);
-                      window.open(api('/export/lyReports?userId=' + ids));
+                      $.yvan.showDialog(this,
+                          require('/app/whepi/lingyun/dialogVaccine.js')({
+                            userId: row.userId,
+                            linkman: row.linkman,
+                            confirm: function () {
+                              // $grid2.reload();
+                            }
+                          })
+                      );
                     }
                   },
                   {
-                    text: '生成隔离人员解除隔离审批表', iconCls: 'fa fa-cloud-upload', onClick: function () {
-                      var row = $grid1.checkedData();
-                      if (row.length == 0) {
-                        $.yvan.msg('请至少选择一行数据');
-                        return;
+                    text: '导出接种明细', iconCls: 'fa fa-cloud-upload', onClick: function () {
+                      var unitId = $form.formGet().unitId;
+                      var departmentId = $form.formGet().departmentId;
+                      if (unitId == null || unitId == "") {
+                        unitId = 0
                       }
-                      var ids = "";
-                      for (var i = 0; i < row.length; i++) {
-                        ids += row[i].userId + ","
+                      if (departmentId == null || departmentId == "") {
+                        departmentId = 0
                       }
-                      ids=ids.substring(0,ids.length-1);
-                      window.open(api('/export/lyApproves?userId=' + ids));
+                      window.open(api('/sweepCode/exSelectVaccine?unitId='+unitId+'&departmentId='+departmentId));
                     }
                   },
                   {
@@ -341,6 +376,31 @@ define(function (require) {
                     {field: 'loudong', title: '部门名称', maxWidth: 200, align: 'left',},
                     {field: 'departmentName', title: '二级部门', maxWidth: 200, align: 'left',},
                     {
+                      field: 'inoculateStatus', title: '是否接种新冠疫苗', maxWidth: 130, align: 'center', formatter: function (value) {
+                        if (value == 1) {
+                          return "<span style='color: green;'>是<span>";
+                        } else if (value == 0) {
+                          return "<span style='color: red;'>否<span>";
+                        } else {
+                          return "";
+                        }
+                      }
+                    },
+                    {field: 'reason', title: '未接种原因', maxWidth: 200, align: 'left',},
+                    {
+                      field: 'vaccineType', title: '接种疫苗类别', maxWidth: 100, align: 'center', formatter: function (value) {
+                        if (value == 1) {
+                          return "<span>腺病毒疫苗<span>";
+                        } else if (value == 2) {
+                          return "<span>灭活疫苗<span>";
+                        } else if (value == 3) {
+                          return "<span>重组亚单位疫苗<span>";
+                        } else {
+                          return "";
+                        }
+                      }
+                    },
+                    {
                       field: 'living', title: '居家2公里', maxWidth: 100, align: 'center', formatter: function (value) {
                         if (value == 1) {
                           return "<span style='color: green;'>是<span>";

+ 131 - 49
whepi-ui/templates/home/ribao.ftl

@@ -642,7 +642,8 @@
                 </div>
             </div>
             <div id="rb_nav5" class="weui-tab__bd-item weui-cell ">
-
+                <input id="vacId" type="text" hidden="hidden" <#if vaccine?? && vaccine.vacId??>value="${vaccine.vacId}"
+                       <#else>value="0"</#if>/>
                 <div style="display:flex; display: -webkit-flex;flex-direction: row; -webkit-flex-direction: row;justify-content: space-between; -webkit-justify-content: space-between;margin-top: 5px;">
                     <div style="color: gray;height: 30px; line-height: 30px; flex: 8;-webkit-flex: 8;">
                         是否接种新冠疫苗
@@ -650,75 +651,156 @@
                     <div class="weui-cells_checkbox" style="flex: 7;-webkit-flex: 7;">
                         <label class="weui-radio weui-cell_active weui-check__label" for="s53"
                                style="padding: 10px 0 10px 10px;">
-                            <input type="radio" name="inoculate" value="1" class="weui-check" id="s53"
+                            <input type="radio" name="inoculate" value="1"
+                                   <#if vaccine?? && vaccine.inoculateStatus == 1>checked="checked"</#if>
+                                   class="weui-check" id="s53"
                                    style="width: 10%"/>
                             <i class="weui-icon-checked"></i>是
                         </label>
                         <label class="weui-radio weui-cell_active weui-check__label" for="s52"
                                style="padding: 10px 0 10px 10px;">
-                            <input type="radio" name="inoculate" value="0" class="weui-check" id="s52"
+                            <input type="radio" name="inoculate" value="0"
+                                   <#if vaccine?? && vaccine.inoculateStatus == 0>checked="checked"</#if>
+                                   class="weui-check" id="s52"
                                    style="width: 10%"/>
                             <i class="weui-icon-checked"></i>否
                         </label>
                     </div>
                 </div>
-                <div id="not_inoculate_view"
+                <div id="not_inoculate" hidden="hidden"
                      style="display:flex; display: -webkit-flex;flex-direction: row; -webkit-flex-direction: row;justify-content: space-between; -webkit-justify-content: space-between;margin-top: 5px;">
                     <div style="color: gray;height: 30px; line-height: 30px;width: 35%;">未接种原因</div>
-                    <textarea id="notInoculate" class="weui-textarea" placeholder="输入内容(300字内)" rows="2"
-                              style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; margin-top: 5px;"></textarea>
-                </div>
-                <div id="weui-uploader"
-                     style="display:flex; display: -webkit-flex;flex-direction: row; -webkit-flex-direction: row;justify-content: space-between; -webkit-justify-content: space-between;margin-top: 5px;">
-                    <div style="color: gray;height: 30px; line-height: 30px;width: 35%;">图片上传</div>
+                    <textarea id="reason" class="weui-textarea" placeholder="输入内容(300字内)" rows="4"
+                              style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; margin-top: 5px;"><#if vaccine?? && vaccine.reason??>${vaccine.reason}</#if></textarea>
+                    <#--                <div id="weui-uploader"-->
+                    <#--                     style="display:flex; display: -webkit-flex;flex-direction: row; -webkit-flex-direction: row;justify-content: space-between; -webkit-justify-content: space-between;margin-top: 5px;">-->
+                    <#--                    <div style="color: gray;height: 30px; line-height: 30px;width: 35%;">图片上传</div>-->
 
-                    <div class="weui-uploader__bd">
-                        <div class="weui-uploader__input-box">
-                            <input id="uploaderInput" class="weui-uploader__input" type="file" accept="image/*"
-                                   multiple/>
-                        </div>
-                    </div>
-                </div>
-
-
-                <div id="inoculate_type_view"
-                     style="display:flex; display: -webkit-flex;flex-direction: row; -webkit-flex-direction: row;justify-content: space-between; -webkit-justify-content: space-between;margin-top: 5px;">
-                    <div style="color: gray;height: 30px; line-height: 30px; width: 45%;">接种疫苗类别</div>
-                    <input id="inoculate_type" 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: 30px;"/>
+                    <#--                    <div class="weui-uploader__bd">-->
+                    <#--                        <div class="weui-uploader__input-box">-->
+                    <#--                            <input id="uploaderInput" class="weui-uploader__input" type="file" accept="image/*"-->
+                    <#--                                   multiple/>-->
+                    <#--                        </div>-->
+                    <#--                    </div>-->
+                    <#--                </div>-->
                 </div>
-                <div id="inoculate_type_view"
-                     style="display:flex; display: -webkit-flex;flex-direction: row; -webkit-flex-direction: row;justify-content: space-between; -webkit-justify-content: space-between;margin-top: 5px;">
-                    <div style="color: gray;height: 30px; line-height: 30px;">新冠疫苗接种记录</div>
+                <div id="yes_inoculate" hidden="hidden">
+                    <div style="display:flex; display: -webkit-flex;flex-direction: row; -webkit-flex-direction: row;justify-content: space-between; -webkit-justify-content: space-between;margin-top: 5px;">
+                        <div style="color: gray;height: 30px; line-height: 30px; width: 45%;">接种疫苗类别</div>
+                        <input id="vaccine_type" class="weui-input" autofocus="" type="text"
+                               <#if vaccine?? && vaccine.vaccineType == 1>value="腺病毒疫苗"
+                               <#elseif vaccine?? && vaccine.vaccineType == 2>value="灭活疫苗"
+                               <#elseif vaccine?? && vaccine.vaccineType == 3>value="重组亚单位疫苗"</#if>
+                               placeholder="请选择"
+                               maxlength="20"
+                               style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 30px;"/>
+                    </div>
+                    <div class="weui-loadmore weui-loadmore_line inoculate_yes"
+                         style="margin: 20px 0 0 0;width: 100%;height: 20px">
+                        <span class="weui-loadmore__tips">新冠疫苗接种记录</span>
+                    </div>
+                    <div class="weui-loadmore weui-loadmore_line inoculate_yes"
+                         style="margin: 20px 0 0 0;width: 100%;height: 20px">
+                        <span class="weui-loadmore__tips">接种第一剂</span>
+                    </div>
+                    <div class="inoculate_time_view"
+                         style="display:flex; display: -webkit-flex;flex-direction: row; -webkit-flex-direction: row;justify-content: space-between; -webkit-justify-content: space-between;margin-top: 5px;">
+                        <div style="color: gray;height: 30px; line-height: 30px; width: 35%;">接种日期</div>
+                        <div class="weui-cell__ft"></div>
+                        <input id="first_time" class="weui-input inoculate_time" type="text"
+                               placeholder="请选择"
+                               style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 30px;"/>
+                    </div>
+                    <div class="inoculate_hospital_view"
+                         style="display:flex; display: -webkit-flex;flex-direction: row; -webkit-flex-direction: row;justify-content: space-between; -webkit-justify-content: space-between;margin-top: 5px;">
+                        <div style="color: gray;height: 30px;line-height: 30px; width: 35%;">接种医院</div>
+                        <input id="first_hospital" class="weui-input" autofocus="" type="text"
+                               <#if vaccine?? && vaccine.firstHospital??>value="${vaccine.firstHospital}"</#if>
+                               placeholder="请选择"
+                               maxlength="20"
+                               style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 30px;"/>
+                    </div>
+                    <div class="inoculate_unit_view"
+                         style="display:flex; display: -webkit-flex;flex-direction: row; -webkit-flex-direction: row;justify-content: space-between; -webkit-justify-content: space-between;margin-top: 5px;">
+                        <div style="color: gray;height: 30px;line-height: 30px; width: 35%;">接种单位</div>
+                        <input id="first_unit" class="weui-input" autofocus="" type="text"
+                               <#if vaccine?? && vaccine.firstUnit??>value="${vaccine.firstUnit}"</#if>
+                               placeholder="请选择"
+                               maxlength="20"
+                               style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 30px;"/>
+                    </div>
+                    <div class="weui-loadmore weui-loadmore_line inoculate_yes"
+                         style="margin: 20px 0 0 0;width: 100%;height: 20px">
+                        <span class="weui-loadmore__tips">接种第二剂</span>
+                    </div>
+                    <div class="inoculate_time_view"
+                         style="display:flex; display: -webkit-flex;flex-direction: row; -webkit-flex-direction: row;justify-content: space-between; -webkit-justify-content: space-between;margin-top: 5px;">
+                        <div style="color: gray;height: 30px; line-height: 30px; width: 35%;">接种日期</div>
+                        <div class="weui-cell__ft"></div>
+                        <input id="second_time" class="weui-input inoculate_time" type="text"
+                               placeholder="请选择"
+                               style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 30px;"/>
+                    </div>
+                    <div class="inoculate_hospital_view"
+                         style="display:flex; display: -webkit-flex;flex-direction: row; -webkit-flex-direction: row;justify-content: space-between; -webkit-justify-content: space-between;margin-top: 5px;">
+                        <div style="color: gray;height: 30px;line-height: 30px; width: 35%;">接种医院</div>
+                        <input id="second_hospital" class="weui-input" autofocus="" type="text"
+                               <#if vaccine?? && vaccine.secondHospital??>value="${vaccine.secondHospital}"</#if>
+                               placeholder="请选择"
+                               maxlength="20"
+                               style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 30px;"/>
+                    </div>
+                    <div class="inoculate_unit_view"
+                         style="display:flex; display: -webkit-flex;flex-direction: row; -webkit-flex-direction: row;justify-content: space-between; -webkit-justify-content: space-between;margin-top: 5px;">
+                        <div style="color: gray;height: 30px;line-height: 30px; width: 35%;">接种单位</div>
+                        <input id="second_unit" class="weui-input" autofocus="" type="text"
+                               <#if vaccine?? && vaccine.secondUnit??>value="${vaccine.secondUnit}"</#if>
+                               placeholder="请选择"
+                               maxlength="20"
+                               style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 30px;"/>
+                    </div>
+                    <div class="weui-loadmore weui-loadmore_line inoculate_yes"
+                         style="margin: 20px 0 0 0;width: 100%;height: 20px">
+                        <span class="weui-loadmore__tips">接种第三剂</span>
+                    </div>
+                    <div class="inoculate_time_view"
+                         style="display:flex; display: -webkit-flex;flex-direction: row; -webkit-flex-direction: row;justify-content: space-between; -webkit-justify-content: space-between;margin-top: 5px;">
+                        <div style="color: gray;height: 30px; line-height: 30px; width: 35%;">接种日期</div>
+                        <div class="weui-cell__ft"></div>
+                        <input id="third_time" class="weui-input inoculate_time" type="text"
+                               placeholder="请选择"
+                               style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 30px;"/>
+                    </div>
+                    <div class="inoculate_hospital_view"
+                         style="display:flex; display: -webkit-flex;flex-direction: row; -webkit-flex-direction: row;justify-content: space-between; -webkit-justify-content: space-between;margin-top: 5px;">
+                        <div style="color: gray;height: 30px;line-height: 30px; width: 35%;">接种医院</div>
+                        <input id="third_hospital" class="weui-input" autofocus="" type="text"
+                               <#if vaccine?? && vaccine.thirdHospital??>value="${vaccine.thirdHospital}"</#if>
+                               placeholder="请选择"
+                               maxlength="20"
+                               style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 30px;"/>
+                    </div>
+                    <div class="inoculate_unit_view"
+                         style="display:flex; display: -webkit-flex;flex-direction: row; -webkit-flex-direction: row;justify-content: space-between; -webkit-justify-content: space-between;margin-top: 5px;">
+                        <div style="color: gray;height: 30px;line-height: 30px; width: 35%;">接种单位</div>
+                        <input id="third_unit" class="weui-input" autofocus="" type="text"
+                               <#if vaccine?? && vaccine.thirdUnit??>value="${vaccine.thirdUnit}"</#if>
+                               placeholder="请选择"
+                               maxlength="20"
+                               style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 30px;"/>
+                    </div>
                 </div>
-
                 <div class="weui-loadmore weui-loadmore_line inoculate_yes"
                      style="margin: 20px 0 0 0;width: 100%;height: 20px">
-                    <span class="weui-loadmore__tips">第一剂</span>
-                </div>
-                <div id="inoculate_first_view"
-                     style="display:flex; display: -webkit-flex;flex-direction: row; -webkit-flex-direction: row;justify-content: space-between; -webkit-justify-content: space-between;margin-top: 5px;">
-                    <div style="color: gray;height: 30px; line-height: 30px; width: 35%;">接种日期</div>
-                    <div class="weui-cell__ft"></div>
-                    <input id="inoculate_first" class="weui-input inoculate_time" type="text"
-                           placeholder="请选择"
-                           style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 30px;"/>
-                </div>
-                <div id="js_input_user_jirou_view"
-                     style="display:flex; display: -webkit-flex;flex-direction: row; -webkit-flex-direction: row;justify-content: space-between; -webkit-justify-content: space-between;margin-top: 5px;">
-                    <div style="color: gray;height: 30px;line-height: 30px; width: 35%;">接种医院</div>
-                    <input id="js_input_user_jirou" 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: 30px;"/>
-                </div>
+                    <div class="weui-form__opr-area">
+                        <a class="weui-btn weui-btn_primary" href="javascript:;"
+                           onclick="inoculateVacc();">提交</a>
+                    </div>
 
 
+                </div>
             </div>
         </div>
     </div>
-</div>
 
 

+ 149 - 28
whepi-ui/templates/home/ribao.js

@@ -470,7 +470,7 @@ function ribao_init() {
             }]
     });
 
-    $("#inoculate_type").select({
+    $("#vaccine_type").select({
         title: "请选择接种疫苗类别",
         items: [
             {
@@ -486,16 +486,44 @@ function ribao_init() {
                 value: "3",
             }]
     });
-    $("#inoculate_first").datetimePicker({
+    let firstTime = new Date().format("yyyy-MM-dd") + ' ';
+    <#if vaccine?? && vaccine.firstTime??>firstTime="${vaccine.firstTime?string("yyyy-MM-dd")}" + " "</#if>
+    $("#first_time").datetimePicker({
         times: function () {
             return [{values: ['']}];
         },
-        onClose:function (picker) {
-            if(!picker.value){
-                picker.setValue([new Date().getFullYear()+'',(new Date().getMonth()+1)+'',new Date().getDate()+'',''])
+        onClose: function (picker) {
+            if (!picker.value) {
+                picker.setValue([new Date().getFullYear() + '', (new Date().getMonth() + 1) + '', new Date().getDate() + '', ''])
             }
         },
-        value: new Date().format("yyyy-MM-dd") + ' ',
+        value: firstTime,
+    })
+    let secondTime = new Date().format("yyyy-MM-dd") + ' ';
+    <#if vaccine?? && vaccine.secondTime??>secondTime="${vaccine.secondTime?string("yyyy-MM-dd")}" + " "</#if>
+    $("#second_time").datetimePicker({
+        times: function () {
+            return [{values: ['']}];
+        },
+        onClose: function (picker) {
+            if (!picker.value) {
+                picker.setValue([new Date().getFullYear() + '', (new Date().getMonth() + 1) + '', new Date().getDate() + '', ''])
+            }
+        },
+        value: secondTime,
+    })
+    let thirdTime = new Date().format("yyyy-MM-dd") + ' ';
+    <#if vaccine?? && vaccine.thirdTime??>thirdTime="${vaccine.thirdTime?string("yyyy-MM-dd")}" + " "</#if>
+    $("#third_time").datetimePicker({
+        times: function () {
+            return [{values: ['']}];
+        },
+        onClose: function (picker) {
+            if (!picker.value) {
+                picker.setValue([new Date().getFullYear() + '', (new Date().getMonth() + 1) + '', new Date().getDate() + '', ''])
+            }
+        },
+        value: thirdTime,
     })
 
     // $('.inoculate_time').click(function(event) {
@@ -538,15 +566,15 @@ function ribao_init() {
     initRadioEvent()
 }
 
-function setTime() {
-    // if ($("#inoculate_first").val() == "") {
-    //     $("#inoculate_first").datetimePicker({
-    //         times: function () {
-    //             return [{values: ['&nbsp;']}];
-    //         }, value: new Date().format("yyyy-MM-dd") + ' ',
-    //     })
-    // }
-}
+// function setTime() {
+//     if ($("#inoculate_first").val() == "") {
+//         $("#inoculate_first").datetimePicker({
+//             times: function () {
+//                 return [{values: ['&nbsp;']}];
+//             }, value: new Date().format("yyyy-MM-dd") + ' ',
+//         })
+//     }
+// }
 
 function selectinput1(obj) {
     var grender = $("#js_input_gzzd").attr("data-values") == undefined ? 0 : $("#js_input_gzzd").attr("data-values");
@@ -2810,6 +2838,18 @@ function initRadioEvent() {
         var state = this.value
         resetTiwen(state == 0)
     })
+
+    let inoculateStatus = $('input[name="inoculate"]:checked').val();
+    if (inoculateStatus == undefined) {
+        $("#yes_inoculate").hide('fast');
+        $("#not_inoculate").hide('fast');
+    } else {
+        resetInoculate(inoculateStatus == 0)
+    }
+    //接种疫苗
+    $('input[name="inoculate"]').on('change', function () {
+        resetInoculate(this.value == 0)
+    })
 }
 
 function resetTiwen(bool) {
@@ -2822,23 +2862,104 @@ function resetTiwen(bool) {
     }
 }
 
+function resetInoculate(bool) {
+    if (bool) {
+        $("#yes_inoculate").hide('fast');
+        $("#not_inoculate").show('fast');
+    } else {
+        $("#yes_inoculate").show('fast');
+        $("#not_inoculate").hide('fast');
+    }
+}
+
+function inoculateVacc() {
+    let inoculateStatus = $('input[name="inoculate"]:checked').val();
+    let date = {};
+    date.vacId = $("#vacId").val();
+    date.userId = $("#userId").val();
+    date.inoculateStatus = inoculateStatus;
+    if (inoculateStatus == 0) {
+        date.reason = $("#reason").val().trim();
+        if (date.reason == "") {
+            $.alert("未接种疫苗请提交未接种原因")
+            return;
+        }
+        if (date.reason.length > 300) {
+            $.alert("未接种疫苗原因不能超过300字")
+            return;
+        }
+        $("#vaccine_type").val("");
+        $("#first_time").val(new Date().format("yyyy-MM-dd") + ' ');
+        $("#first_hospital").val("");
+        $("#first_unit").val("");
+        $("#second_time").val(new Date().format("yyyy-MM-dd") + ' ');
+        $("#second_hospital").val("");
+        $("#second_unit").val("");
+        $("#third_time").val(new Date().format("yyyy-MM-dd") + ' ');
+        $("#third_hospital").val("");
+        $("#third_unit").val("");
+    } else if (inoculateStatus == 1) {
+        let vaccineType = $("#vaccine_type").val();
+        if (!vaccineType || vaccineType == "") {
+            $.alert("请选择疫苗接种类型")
+            return;
+        }
+        if (vaccineType == "腺病毒疫苗") {
+            date.vaccineType = 1
+        } else if (vaccineType == "灭活疫苗") {
+            date.vaccineType = 2
+        } else if (vaccineType == "重组亚单位疫苗") {
+            date.vaccineType = 3
+        }
+        date.firstTime = $("#first_time").val();
+        date.firstHospital = $("#first_hospital").val().trim();
+        date.firstUnit = $("#first_unit").val().trim();
+        date.secondTime = $("#second_time").val();
+        date.secondHospital = $("#second_hospital").val().trim();
+        date.secondUnit = $("#second_unit").val().trim();
+        date.thirdTime = $("#third_time").val();
+        date.thirdHospital = $("#third_hospital").val().trim();
+        date.thirdUnit = $("#third_unit").val().trim();
+        if (date.firstHospital.length > 50 || date.firstUnit.length > 50 || date.secondHospital.length > 50 || date.secondUnit.length > 50
+            || date.thirdHospital.length > 50 || date.thirdUnit.length > 50) {
+            $.alert("输入文本不能超过50字")
+            return;
+        }
+        $("#reason").val("");
+    } else {
+        $.alert("请选择是否接种新冠疫苗")
+        return;
+    }
+    $.ajax({
+        url: '/home/addVaccine',
+        type: "post",
+        dataType: "json",
+        contentType: "application/json",
+        data: JSON.stringify(date),
+        success: function (data) {
+            if (data.success) {
+                $.alert("提交成功");
+            }
+        },
+    });
+}
 
-Date.prototype.format = function(fmt) {
+Date.prototype.format = function (fmt) {
     var o = {
-        "M+" : this.getMonth()+1,                 //月份
-        "d+" : this.getDate(),                    //日
-        "h+" : this.getHours(),                   //小时
-        "m+" : this.getMinutes(),                 //分
-        "s+" : this.getSeconds(),                 //秒
-        "q+" : Math.floor((this.getMonth()+3)/3), //季度
-        "S"  : this.getMilliseconds()             //毫秒
+        "M+": this.getMonth() + 1,                 //月份
+        "d+": this.getDate(),                    //日
+        "h+": this.getHours(),                   //小时
+        "m+": this.getMinutes(),                 //分
+        "s+": this.getSeconds(),                 //秒
+        "q+": Math.floor((this.getMonth() + 3) / 3), //季度
+        "S": this.getMilliseconds()             //毫秒
     };
-    if(/(y+)/.test(fmt)) {
-        fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
+    if (/(y+)/.test(fmt)) {
+        fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
     }
-    for(var k in o) {
-        if(new RegExp("("+ k +")").test(fmt)){
-            fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
+    for (var k in o) {
+        if (new RegExp("(" + k + ")").test(fmt)) {
+            fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
         }
     }
     return fmt;

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

@@ -0,0 +1,23 @@
+package com.bofeng.dao;
+
+import com.baomidou.mybatisplus.mapper.BaseMapper;
+import com.bofeng.entity.Vaccine;
+import com.yvan.PageDb;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+import java.util.Map;
+
+@Mapper
+public interface VaccineMapper extends BaseMapper<Vaccine> {
+
+    @Select("select * from ms_vaccine where user_id = #{userId}")
+    Vaccine selectByUserId(@Param("userId") Long userId);
+
+    @Select("select * from ms_vaccine where user_id = #{userId}")
+    List<Vaccine> selectVaccineByUserId(PageDb pageDb, Map<String, Object> map);
+
+    List<Vaccine> exSelectVaccine(Map<String, Object> map);
+}

+ 33 - 0
whepi-web/src/main/java/com/bofeng/entity/ExcelRiBaoLYBM4.java

@@ -63,6 +63,39 @@ public class ExcelRiBaoLYBM4 {
     @ExcelProperty(value = {"二级部门"}, index = 2)
     private String departmentName;
 
+    private Integer inoculateStatus;
+    private Integer vaccineType;
+    @ExcelProperty(value = "是否接种新冠疫苗", index = 16)
+    private String inoculateStatusStr = "";
+
+    public String getInoculateStatusStr() {
+        if (inoculateStatus == null) {
+            inoculateStatusStr = "";
+        } else if (inoculateStatus == 1) {
+            inoculateStatusStr = "是";
+        } else if (inoculateStatus == 2) {
+            inoculateStatusStr = "否";
+        }
+        return inoculateStatusStr;
+    }
+    @ExcelProperty(value = "未接种原因", index = 15)
+    private String reason;
+    @ExcelProperty(value = "接种疫苗类别", index = 17)
+    private String vaccineTypeStr;
+
+    public String getVaccineTypeStr() {
+        if (vaccineType == null) {
+            vaccineTypeStr = "";
+        } else if (vaccineType == 1) {
+            vaccineTypeStr = "腺病毒疫苗";
+        } else if (vaccineType == 2) {
+            vaccineTypeStr = "灭活疫苗";
+        } else if (vaccineType == 3) {
+            vaccineTypeStr = "重组亚单位疫苗";
+        }
+        return vaccineTypeStr;
+    }
+
     @ExcelProperty(value = "今日复工", index = 3)
     private String returnWorkMsg;
 

+ 181 - 0
whepi-web/src/main/java/com/bofeng/entity/Vaccine.java

@@ -0,0 +1,181 @@
+package com.bofeng.entity;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.baomidou.mybatisplus.annotations.TableField;
+import com.baomidou.mybatisplus.annotations.TableId;
+import com.baomidou.mybatisplus.annotations.TableName;
+import lombok.Getter;
+import lombok.Setter;
+
+import java.util.Date;
+
+/**
+ * 疫苗接种表
+ */
+@Getter
+@Setter
+@TableName("ms_vaccine")
+public class Vaccine {
+
+    @TableId("vac_id")
+    private Long vacId;
+
+    @TableField("user_id")
+    private Long userId;
+
+    /**
+     * 接种状态 0:未接种, 1:已接种
+     */
+    @TableField("inoculate_status")
+    private Integer inoculateStatus;
+
+    /**
+     * 疫苗类别
+     */
+    @TableField("vaccine_type")
+    private Integer vaccineType;
+
+    /**
+     * 未接种原因
+     */
+    @ExcelProperty(value = "未接种原因", index = 6)
+    @TableField("reason")
+    private String reason;
+
+    /**
+     * 第一剂接种日期
+     */
+    @TableField("first_time")
+    private Date firstTime;
+
+    /**
+     * 第一剂接种医院
+     */
+    @ExcelProperty(value = "第一剂接种医院", index = 9)
+    @TableField("first_hospital")
+    private String firstHospital;
+
+    /**
+     * 第一剂接种单位
+     */
+    @ExcelProperty(value = "第一剂接种单位", index = 10)
+    @TableField("first_unit")
+    private String firstUnit;
+
+    /**
+     * 第二剂接种日期
+     */
+    @TableField("second_time")
+    private Date secondTime;
+
+    /**
+     * 第二剂接种医院
+     */
+    @ExcelProperty(value = "第二剂接种医院", index = 12)
+    @TableField("second_hospital")
+    private String secondHospital;
+
+    /**
+     * 第二剂接种单位
+     */
+    @ExcelProperty(value = "第二剂接种单位", index = 13)
+    @TableField("second_unit")
+    private String secondUnit;
+
+    /**
+     * 第三剂接种日期
+     */
+    @TableField("third_time")
+    private Date thirdTime;
+
+    /**
+     * 第三剂接种医院
+     */
+    @ExcelProperty(value = "第三剂接种医院", index = 15)
+    @TableField("third_hospital")
+    private String thirdHospital;
+
+    /**
+     * 第三剂接种单位
+     */
+    @ExcelProperty(value = "第二剂接种单位", index = 16)
+    @TableField("third_unit")
+    private String thirdUnit;
+
+    /**
+     * 新增时间
+     */
+    @TableField("time_create")
+    private Date timeCreate;
+
+    /**
+     * 新增时间
+     */
+    @TableField("time_update")
+    private Date timeUpdate;
+
+    @ExcelProperty(value = "姓名", index = 0)
+    @TableField(exist = false)
+    private String userName;
+
+    @ExcelProperty(value = "部门名称", index = 1)
+    @TableField(exist = false)
+    private String unit;
+
+    @ExcelProperty(value = "二级部门", index = 2)
+    @TableField(exist = false)
+    private String departmentName;
+
+    @ExcelProperty(value = "联系电话", index = 3)
+    @TableField(exist = false)
+    private String phone;
+
+    @ExcelProperty(value = "工号", index = 4)
+    @TableField(exist = false)
+    private String doorplate;
+
+    @ExcelProperty(value = "是否接种新冠疫苗", index = 5)
+    @TableField(exist = false)
+    private String inoculateStatusStr;
+
+    public String getInoculateStatusStr() {
+        if (inoculateStatus == null) {
+            inoculateStatusStr = "";
+        } else if (inoculateStatus == 1) {
+            inoculateStatusStr = "是";
+        } else if (inoculateStatus == 2) {
+            inoculateStatusStr = "否";
+        }
+        return inoculateStatusStr;
+    }
+
+    @ExcelProperty(value = "接种疫苗类别", index = 7)
+    @TableField(exist = false)
+    private String vaccineTypeStr;
+
+    public String getVaccineTypeStr() {
+        if (vaccineType == null) {
+            vaccineTypeStr = "";
+        } else if (vaccineType == 1) {
+            vaccineTypeStr = "腺病毒疫苗";
+        } else if (vaccineType == 2) {
+            vaccineTypeStr = "灭活疫苗";
+        } else if (vaccineType == 3) {
+            vaccineTypeStr = "重组亚单位疫苗";
+        }
+        return vaccineTypeStr;
+    }
+
+    @ExcelProperty(value = "第一剂接种日期", index = 8)
+    @TableField(exist = false)
+    private String firstTimeStr;
+
+    @ExcelProperty(value = "第二剂接种日期", index = 11)
+    @TableField(exist = false)
+    private String secondTimeStr;
+
+    @ExcelProperty(value = "第三剂接种日期", index = 14)
+    @TableField(exist = false)
+    private String thirdTimeStr;
+
+}

+ 37 - 4
whepi-web/src/main/java/com/bofeng/service/MsReportService.java

@@ -5,15 +5,11 @@ import com.baomidou.mybatisplus.toolkit.IdWorker;
 import com.bofeng.dao.*;
 import com.bofeng.entity.*;
 import com.yvan.platform.Conv;
-import io.swagger.models.auth.In;
-import javassist.expr.NewArray;
-import org.apache.commons.lang3.tuple.Triple;
 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 org.springframework.web.servlet.ModelAndView;
 
 import java.math.BigDecimal;
 import java.text.ParseException;
@@ -38,6 +34,8 @@ public class MsReportService {
     private MsTripMapper msTripMapper;
     @Autowired
     private UptownUnitMapper uptownUnitMapper;
+    @Autowired
+    private VaccineMapper vaccineMapper;
 
     public List<MsSuspected> getByReportId(Long reportId) {
         List<MsSuspected> listSuspected = null;
@@ -776,4 +774,39 @@ public class MsReportService {
         return "";
     }
 
+    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+    public int addVaccine(Vaccine vaccine) {
+        Date now = new Date();
+        Vaccine v = vaccineMapper.selectByUserId(vaccine.getUserId());
+        if (v != null && v.getVacId() != 0) {
+            vaccine.setVacId(v.getVacId());
+        }
+        changeVaccine(vaccine);
+        if (vaccine.getVacId() == 0) {
+            vaccine.setVacId(IdWorker.getId());
+            vaccine.setTimeCreate(now);
+            vaccine.setTimeUpdate(now);
+            return vaccineMapper.insert(vaccine);
+        } else {
+            vaccine.setTimeUpdate(now);
+            return vaccineMapper.updateById(vaccine);
+        }
+    }
+
+    private void changeVaccine(Vaccine vaccine) {
+        if (vaccine.getInoculateStatus() == 0) {
+            vaccine.setVaccineType(0);
+            vaccine.setFirstTime(null);
+            vaccine.setFirstHospital("");
+            vaccine.setFirstUnit("");
+            vaccine.setSecondTime(null);
+            vaccine.setSecondHospital("");
+            vaccine.setSecondUnit("");
+            vaccine.setThirdTime(null);
+            vaccine.setThirdHospital("");
+            vaccine.setFirstUnit("");
+        } else if (vaccine.getInoculateStatus() == 1) {
+            vaccine.setReason("");
+        }
+    }
 }

+ 8 - 0
whepi-web/src/main/java/com/bofeng/service/SweepCodeService.java

@@ -38,6 +38,8 @@ public class SweepCodeService {
     private ScanService scanService;
     @Autowired
     private MsReportMapper msReportMapper;
+    @Autowired
+    private VaccineMapper vaccineMapper;
 
     public List<SysUptownHouse> selectCode(PageDb pageDb, Map<String, Object> queryParam) {
         List<SysUptownHouse> sysUptownHouses = sweepCodeMapper.selectCode(pageDb,queryParam);
@@ -497,4 +499,10 @@ public class SweepCodeService {
     public List<MsReportLog> selectLogAddrHistory(PageDb pageDb, Long userId, String reportDate) {
         return msReportLogMapper.selectLogAddrHistory(pageDb, userId, reportDate);
     }
+
+    public List<Vaccine> exSelectVaccine(Map map, long uptownId, Long userId) {
+        map.put("uptownId", uptownId);
+        map.put("unitType", 7000); // 对应的sql查询中部门大于7000
+        return vaccineMapper.exSelectVaccine(map);
+    }
 }

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

@@ -1,7 +1,10 @@
 package com.bofeng.wx.controller;
 
 
-import com.bofeng.entity.*;
+import com.bofeng.entity.MsReport;
+import com.bofeng.entity.MsSuspected;
+import com.bofeng.entity.MsTripDet;
+import com.bofeng.entity.Vaccine;
 import com.bofeng.service.MsReportService;
 import com.bofeng.service.MsSuspectedService;
 import com.bofeng.service.MsTripService;
@@ -13,6 +16,7 @@ import com.yvan.springmvc.HttpParameterParser;
 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 javax.servlet.http.HttpServletRequest;
@@ -157,6 +161,12 @@ public class MsReportController {
         return ModelOps.newFail("上报错误");
     }
 
+    //提交疫苗接种信息
+    @PostMapping("/home/addVaccine")
+    public ModelOps addVaccine(HttpServletRequest request, @RequestBody Vaccine vaccine) {
+        return ModelOps.newSuccess(msReportService.addVaccine(vaccine));
+    }
+
     //根据日期获取家人
     @GetMapping("/home/home/queryRibaoReportDate")
     public Model<List<MsSuspected>> queryRibaoReportDate(@Pd(name = "reportDate") String reportDate, @Pd(name = "userCreate") Long userCreate) {

+ 49 - 4
whepi-web/src/main/java/com/bofeng/wx/controller/ScanAdminController.java

@@ -30,10 +30,7 @@ import java.io.IOException;
 import java.net.URLEncoder;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 @Api("进出扫码后台信息")
 @RestController
@@ -66,6 +63,8 @@ public class ScanAdminController {
     private ScanService scanService;
     @Autowired
     private ReturnWorkLyMapper returnWorkLyMapper;
+    @Autowired
+    private VaccineMapper vaccineMapper;
 
     @ApiOperation("出入查询")
     @PostMapping("/whepi/sweepCode/selectCode")
@@ -229,6 +228,52 @@ public class ScanAdminController {
         return Model.newSuccess(pageDb,sysUptownHouses);
     }
 
+    @ApiOperation("凌云疫苗接种查询")
+    @GetMapping("/whepi/sweepCode/selectVaccineByUserId")
+    public Model<List<Map>> selectVaccineByUserId(HttpParameterParser parser) {
+        Vaccine vaccine = vaccineMapper.selectByUserId(Long.parseLong(parser.getMap().get("userId").toString()));
+        List list = new ArrayList();
+        Map map1 = new HashMap();
+        Map map2 = new HashMap();
+        Map map3 = new HashMap();
+        map1.put("num", 1);
+        map1.put("times", "第一剂次");
+        map1.put("time", vaccine.getFirstTime());
+        map1.put("hospital", vaccine.getFirstHospital());
+        map1.put("unit", vaccine.getFirstUnit());
+        list.add(map1);
+        map2.put("num", 2);
+        map2.put("times", "第二剂次");
+        map2.put("time", vaccine.getSecondTime());
+        map2.put("hospital", vaccine.getSecondHospital());
+        map2.put("unit", vaccine.getSecondUnit());
+        list.add(map2);
+        map3.put("num", 3);
+        map3.put("times", "第三剂次");
+        map3.put("time", vaccine.getThirdTime());
+        map3.put("hospital", vaccine.getThirdHospital());
+        map3.put("unit", vaccine.getThirdUnit());
+        list.add(map3);
+        return Model.newSuccess(list);
+    }
+
+    @ApiOperation("凌云导出疫苗接种")
+    @GetMapping("/whepi/sweepCode/exSelectVaccine")
+    @SneakyThrows
+    public void exSelectVaccine(HttpParameterParser parser,HttpServletResponse resp,
+                                @Pd(name = "departmentId", required = false, defaultValue = "0") Long departmentId,
+                                @Pd(name = "unitId", required = false, defaultValue = "0") Long unitId) {
+        Map map = new HashMap();
+        map.put("departmentId", departmentId);
+        Long userId = JwtHelper.getUserId();
+        if (userId > 7000 && userId < 8000) {
+            unitId = userId;
+        }
+        map.put("unitId", unitId);
+        List<Vaccine> list = sweepCodeService.exSelectVaccine(map, 1238790987234L, userId);
+        ExcelUtils.writeSheet(Vaccine.class, list).export(resp,"凌云集团疫苗接种");
+    }
+
     @ApiOperation("凌云导出")
     @PostMapping("/whepi/sweepCode/exportLY")
     @SneakyThrows

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

@@ -59,6 +59,8 @@ public class UserOpenController {
     private MsReportService msReportService;
     @Autowired
     private RbMapper rbMapper;
+    @Autowired
+    private VaccineMapper vaccineMapper;
 
     @ApiOperation("登陆首页")
     @ApiImplicitParams({@ApiImplicitParam(name = "userId", value = "用户ID", required = false, dataType = "Long", paramType = "query"),
@@ -80,6 +82,8 @@ public class UserOpenController {
             model.put("user", userOpen);
             model.put("user_id", "\"" + userOpen.getUserId() + "\"");
             List<Uptown> uptowns = rbMapper.selectUptown(userId);
+            // 新冠疫苗接种情况
+            model.put("vaccine", vaccineMapper.selectByUserId(userId));
             if (uptowns != null && uptowns.size() > 0) {
                 Long uptown_id = uptowns.get(0).getUptownId();
                 String uptown_name = uptowns.get(0).getUptownName();
@@ -100,7 +104,6 @@ public class UserOpenController {
                 }
             }
 
-
             if (list.size() == 0) {
                 return new ModelAndView("/user/home.ftl", model);
             }
@@ -170,6 +173,8 @@ public class UserOpenController {
             model.put("user", userOpen);
             model.put("user_id", "\"" + userOpen.getUserId() + "\"");
             List<Uptown> uptowns = rbMapper.selectUptown(userId);
+            // 新冠疫苗接种情况
+            model.put("vaccine", vaccineMapper.selectByUserId(userId));
             if (uptowns != null && uptowns.size() > 0) {
                 Long uptown_id = uptowns.get(0).getUptownId();
                 String uptown_name = uptowns.get(0).getUptownName();
@@ -292,6 +297,8 @@ public class UserOpenController {
         if (userId != 0 && userType != 0) {
             model.put("user_id", "\"" + userId + "\"");
             List<Uptown> uptowns = rbMapper.selectUptown(userId);
+            // 新冠疫苗接种情况
+            model.put("vaccine", vaccineMapper.selectByUserId(userId));
             if (uptowns != null && uptowns.size() > 0) {
                 Long uptown_id = uptowns.get(0).getUptownId();
                 String uptown_name = uptowns.get(0).getUptownName();

+ 6 - 2
whepi-web/src/main/resources/mapper/RbMapper.xml

@@ -35,7 +35,8 @@
         msr.sure_num as sureNum,msr.suspected_num as suspectedNum,msr.normal_num as normalNum,msr.ms_status as msStatus,op.old_open_id as oldOpenId,
         msr.single_num as singleNum,mss.user_name as userName,mss.grender, mss.age,mss.family_status as familyStatus,de.department_name as departmentName,
         mss.medical,mss.temperature,mss.cough,mss.muscle ,mss.dyspnea,mss.fatigue,mss.diarrhea,mss.single_room as singleRoom,mss.score_rezult,mss.is_contact,mss.is_suspected,
-        tr.trip_id,tr.is_trip,tr.today_local,tr.today_local_other,tr.work_local,tr.work_local_other, tr.auto_local, tr.auto_addr,ur.user_id as userId
+        tr.trip_id,tr.is_trip,tr.today_local,tr.today_local_other,tr.work_local,tr.work_local_other, tr.auto_local, tr.auto_addr,ur.user_id as userId,
+        v.inoculate_status as inoculateStatus,v.reason,v.vaccine_type as vaccineType
         from sys_uptown_house suh
         inner join sys_uptown_home suho on suho.house_id=suh.house_id
         INNER JOIN sys_uptown_unit suu ON suu.unit_id = suh.unit_id and suu.uptown_id=#{uptownId}
@@ -54,6 +55,7 @@
         INNER JOIN sys_user_role ur on ur.property_id = suho.house_id
         left JOIN sys_user_open op on op.user_id = ur.user_id
         left join sys_department de on de.department_id = suh.department_id
+        LEFT JOIN ms_vaccine v ON ur.user_id = v.user_id
         <where>
             <if test="unitId!=null and uptownId!='' and unitId!= '0'.toString()">
                 and suu.unit_id=#{unitId}
@@ -164,7 +166,8 @@
         msr.sure_num as sureNum,msr.suspected_num as suspectedNum,msr.normal_num as normalNum,msr.ms_status as msStatus,op.old_open_id as oldOpenId,
         msr.single_num as singleNum,mss.user_name as userName,mss.grender, mss.age,mss.family_status as familyStatus,de.department_name as departmentName,
         mss.medical,mss.temperature,mss.cough,mss.is_contact, mss.is_suspected,mss.muscle ,mss.dyspnea,mss.fatigue,mss.diarrhea,mss.single_room as singleRoom,mss.score_rezult,mss.temperature_score,mss.is_contact as isContact,mss.is_suspected as isSuspected,
-        tr.trip_id,tr.is_trip,tr.today_local,tr.today_local_other,tr.work_local,tr.work_local_other, tr.auto_local, tr.auto_addr,ur.user_id as userId,suh.house_id as houseId
+        tr.trip_id,tr.is_trip,tr.today_local,tr.today_local_other,tr.work_local,tr.work_local_other, tr.auto_local, tr.auto_addr,ur.user_id as userId,suh.house_id as houseId,
+        v.inoculate_status as inoculateStatus,v.reason,v.vaccine_type as vaccineType
         from sys_uptown_house suh
         left join sys_uptown_home suho on suho.house_id=suh.house_id
         left JOIN sys_uptown_unit suu ON suu.unit_id = suh.unit_id
@@ -183,6 +186,7 @@
         left JOIN sys_user_role ur on ur.property_id = suho.house_id
         left JOIN sys_user_open op on op.user_id = ur.user_id
         left join sys_department de on de.department_id = suh.department_id
+        left join ms_vaccine v on ur.user_id = v.user_id
         <where>
             <if test="uptownId != null and uptownId != ''">
                 and suu.uptown_id=#{uptownId}

+ 47 - 0
whepi-web/src/main/resources/mapper/VaccineMapper.xml

@@ -0,0 +1,47 @@
+<?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.VaccineMapper">
+
+    <select id="exSelectVaccine" resultType="com.bofeng.entity.Vaccine">
+        select suu.ridgepole,suu.unit,suh.doorplate,suho.linkman as userName,suho.phone,de.department_name as departmentName,
+        ur.user_id as userId,ifnull(v.inoculate_status, 2) inoculate_status,v.reason,ifnull(v.vaccine_type, 0) vaccine_type,
+        v.first_time,v.first_hospital,v.second_time,v.second_hospital,v.third_time,v.third_hospital,v.first_unit,v.second_unit,v.third_unit,
+        DATE_FORMAT(v.first_time,"%Y-%m-%d") as firstTimeStr,
+        DATE_FORMAT(v.second_time,"%Y-%m-%d") as secondTimeStr,
+        DATE_FORMAT(v.third_time,"%Y-%m-%d") as thirdTimeStr
+        from sys_uptown_house suh
+        inner join sys_uptown_home suho on suho.house_id=suh.house_id
+        INNER JOIN sys_uptown_unit suu ON suu.unit_id = suh.unit_id and suu.uptown_id=#{uptownId}
+        <if test="unitType != null and unitType != ''">
+            and suu.unit_id > 7000
+        </if>
+        INNER JOIN sys_user_role ur on ur.property_id = suho.house_id
+        left JOIN sys_user_open op on op.user_id = ur.user_id
+        left join sys_department de on de.department_id = suh.department_id
+        LEFT JOIN ms_vaccine v ON ur.user_id = v.user_id
+        <where>
+            <if test="unitId!=null and uptownId!='' and unitId!= '0'.toString()">
+                and suu.unit_id=#{unitId}
+            </if>
+            <if test="uptownId != null and uptownId != ''">
+                and suu.uptown_id=#{uptownId}
+            </if>
+            <if test="queryProperties != null and queryProperties != ''">
+                and (suho.linkman like concat('%',#{queryProperties},'%')
+                or suho.phone like concat('%',#{queryProperties},'%')
+                or suh.doorplate like concat('%',#{queryProperties},'%'))
+            </if>
+            <if test="departmentId != null and departmentId != ''">
+                and suh.department_id = #{departmentId}
+            </if>
+            <if test="isBand == '1'.toString()">
+                and (op.old_open_id is null or op.old_open_id = '')
+            </if>
+            <if test="isBand == '2'.toString()">
+                and op.old_open_id is not null and op.old_open_id != ''
+            </if>
+            and ur.role_id = 1
+        </where>
+        order by suu.unit_id asc,suho.linkman
+    </select>
+</mapper>