Ver código fonte

湖北和昌新材料科技股份有限公司

peiguo 5 anos atrás
pai
commit
b304679312

+ 23 - 0
admin-ui/app/whepi/home/selectHCbumen.js

@@ -0,0 +1,23 @@
+// 查询类型
+define(function (require) {
+  return function (context) {
+    return {
+      xtype: 'widget',
+      title: '部门搜索',
+      width: 550,
+      height: 600,
+      grid: {
+        url: api('/qrImg/getHCBumen'),
+        mtype: 'post',
+        pagination: false,
+        autoSizeColumns: true,
+        queryParams: {query: context.query},
+        idField: 'unitId',
+        columns: [[
+          {title: 'ID', field: 'unitId', hidden: true},
+          {title: '部门', field: 'unit'},
+        ]]
+      }
+    };
+  };
+});

+ 21 - 0
admin-ui/app/whepi/index.js

@@ -134,6 +134,27 @@ $(function () {
         onLoadSuccess: function (node, data) {
         }
       });
+    } else if (userRole == "8") {//湖北和昌管理员
+      $('#menutree').tree({
+        url: '/app/whepi/mock/menu8.json',
+        onDblClick: function (node) {
+          var $this = $(this);
+          if (!$this.tree('isLeaf', node.target)) {
+            $this.tree(node.state === 'closed' ? 'expand' : 'collapse', node.target);
+          }
+        },
+        onSelect: function () {
+          return false;
+        },
+        onClick: function (node) {
+          var href = node.href;
+          if ($.trim(href)) {
+            App.addTab({title: node.text, url: node.href, id: node.id, iconCls: node.iconCls});
+          }
+        },
+        onLoadSuccess: function (node, data) {
+        }
+      });
     }
 
 

+ 239 - 0
admin-ui/app/whepi/lingyun/HCUser.js

@@ -0,0 +1,239 @@
+define(function (require) {
+    return function (context) {
+
+      var $grid1, $form;
+
+      // 输入搜索文本后点击回车按钮查询列表
+      function enterQueryGrid1(e) {
+        if (e.keyCode === 13) {
+          var tmp = $(this).val();
+          $form.formSet({queryProperties: tmp});
+          queryGrid1();
+        }
+      }
+
+      // 弹框的方式
+      var widgets = {
+        // 搜索分类检索
+        selectTableUnit: {
+          url: 'app/whepi/home/selectHCbumen.js',
+          bind: {
+            unitId: 'unitId',
+            unit: 'unit',
+          },
+        },
+      };
+
+      // 检索条件查询
+      function queryGrid1() {
+        var queryForm = $form.formGet();
+        $grid1.reload({
+          mtype: 'POST',
+          url: api('/sweepCode/HCUser'),
+          queryParams: queryForm
+        }, true);
+      }
+
+      var queryToolbar = {
+        xtype: 'toolbar',
+        title: '用户管理',
+        items: [
+          {
+            text: '查询', iconCls: 'fa fa-search', onClick: function () {
+              queryGrid1();
+            }
+          }, {
+            text: '重置', iconCls: 'fa fa-refresh', onClick: function () {
+              $form.formClear();
+              queryGrid1();
+            }
+          }, {
+            text: '关闭', iconCls: 'fa fa-times-circle', onClick: function () {
+              App.closeMe(this);
+            }
+          }
+        ]
+      };
+
+      var queryForm = {
+        onRender: function () {
+          $form = $(this);
+        },
+        xtype: 'form',
+        items: [[
+          {
+            xtype: 'textbox',
+            label: '检索条件',
+            name: 'queryProperties',
+            prompt: "用户名称/电话号码",
+            labelWidth: 'auto',
+            events: {keydown: enterQueryGrid1}, width: 200
+          },
+          {xtype: 'hidden', name: 'unitId'},
+          {
+            name: 'reportStatus',
+            xtype: 'combobox',
+            label: '是否上报',
+            data: [{id: '', text: '全部'}, {id: '0', text: '有数据未上报'}, {id: '1', text: '已上报'}, {id: '2', text: '无数据'}],
+            value: '',
+            onChange: function (value) {
+              queryGrid1();
+            },
+          },
+          {
+            xtype: 'searchbox',
+            label: '部门',
+            labelWidth: 'auto',
+            name: 'unit',
+            prompt: "部门",
+            width: 250,
+            widget: widgets.selectTableUnit,// 弹出框方法
+            onChange: function (value) {
+              if (!isNotNullOrEmpty(value)) {
+                $form.formSet({
+                  unitId : ''
+                })
+              }
+              queryGrid1();
+            },
+          },
+          {
+            name: 'date',
+            label: '导出时间',
+            prompt: '导出时间',
+            xtype: 'datebox',
+            labelWidth: 'auto',
+            width: 200,
+          },
+        ]]
+      };
+
+      return {
+        north: {
+          height: 88,
+          /* split: true,
+           border: false,*///底框是否可变动
+          items: [
+            queryToolbar,
+            queryForm
+          ]
+        },
+        center: {
+          height: '60%',
+          split: true,
+          items:
+            {
+              onRender: function () {
+                $grid1 = $(this);
+                queryGrid1()
+              },
+              xtype: 'grid',
+              toolbar: {
+                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 queryProperties = $form.formGet().queryProperties;
+                      var unitId = $form.formGet().unitId;
+                      var date = $form.formGet().date;
+                      if ( date == null || date == "") {
+                        $.yvan.msg('请选择导出时间');
+                        return
+                      }
+                      window.open(api('/sweepCode/exSelectLingyunUser?queryProperties='+queryProperties+"&unitId="+unitId + "&date="+date));
+                    }
+                  },
+                  {
+                    text: '查看人员上报情况', iconCls: 'fa fa-search', onClick: function () {
+                      var row = $grid1.rowData();
+                      if ( row == null || row == undefined || row.userId == null || row.userId == "") {
+                        $.yvan.msg('请选择数据');
+                        return
+                      }
+                      $.yvan.showDialog(this,
+                        require('/app/whepi/lingyun/dialogDetail.js')({
+                          userId: row.userId,
+                          linkman: row.linkman,
+                          confirm: function () {
+                            // $grid2.reload();
+                          }
+                        })
+                      );
+                    }
+                  },
+                  {
+                    text: '查看人员可复工状况', iconCls: 'fa fa-search', onClick: function () {
+                      var row = $grid1.rowData();
+                      if ( row == null || row == undefined || row.userId == null || row.userId == "") {
+                        $.yvan.msg('请选择数据');
+                        return
+                      }
+                      $.yvan.showDialog(this,
+                        require('/app/whepi/lingyun/dialogFugong.js')({
+                          userId: row.userId,
+                          confirm: function () {
+                            // $grid2.reload();
+                          }
+                        })
+                      );
+                    }
+                  },
+                ]
+              },
+              multiselect: true, /// 表格多选
+              idField: 'userId',
+              editable: true,
+              editOnSelected: true,
+              autoSizeColumns: true,
+              columns:
+                [
+                  [
+                    {field: 'userId', title: '用户ID', hidden: true},
+                    {field: 'linkman', title: '姓名', maxWidth: 200, align: 'left',},
+                    {field: 'loudong', title: '部门名称', maxWidth: 200, align: 'left',},
+                    {field: 'phone', title: '联系电话', maxWidth: 200, align: 'left',},
+                    {field: 'doorplate', title: '工号', maxWidth: 200, align: 'left',},
+                    {field: 'bingqingDesc', title: '病情表述', align: 'left',},
+                    {field: 'workLoalDesc', title: '工作驻地', maxWidth: 200, align: 'left',},
+                    {field: 'todayLoalDesc', title: '今晚住地', maxWidth: 200, align: 'left',},
+                    {field: 'isTripDesc', title: '是否出行', maxWidth: 200, align: 'left',},
+                    {field: 'tripDetDesc', title: '出行详细', align: 'left',},
+                  ]
+                ]
+            }
+        }
+      };
+    };
+  }
+);

+ 57 - 15
admin-ui/app/whepi/mock/menu.json

@@ -34,14 +34,6 @@
           "children": []
         },
         {
-          "id": "ENT100023",
-          "text": "凌云出入记录",
-          "href": "/app/whepi/scan/xqmanageLY.js",
-          "iconCls": "icon-blank fa fa-align-justify",
-          "state": "close",
-          "children": []
-        },
-        {
           "id": "ENT100024",
           "text": "巡检扫码记录",
           "href": "/app/whepi/scan/xunJian.js",
@@ -56,24 +48,74 @@
           "iconCls": "icon-blank fa fa-align-justify",
           "state": "close",
           "children": []
+        }
+      ]
+    },
+    {
+      "id": "ENT101",
+      "text": "凌云信息",
+      "href": "",
+      "iconCls": "icon-blank fa fa-bars",
+      "state": "closed",
+      "children": [
+        {
+          "id": "ENT101001",
+          "text": "凌云出入记录",
+          "href": "/app/whepi/scan/xqmanageLY.js",
+          "iconCls": "icon-blank fa fa-align-justify",
+          "state": "close",
+          "children": []
         },
         {
-          "id": "ENT100026",
+          "id": "ENT101002",
           "text": "凌云特殊人员管理",
           "href": "/app/whepi/scan/specialPersonnelLY.js",
           "iconCls": "icon-blank fa fa-align-justify",
           "state": "close",
           "children": []
+        },
+        {
+          "id": "ENT101003",
+          "text": "凌云导出报表",
+          "href": "/app/whepi/lingyun/lingyunUser.js",
+          "iconCls": "icon-blank fa fa-align-justify",
+          "state": "close",
+          "children": []
         }
       ]
     },
     {
-      "id": "ENT100025",
-      "text": "凌云导出报表",
-      "href": "/app/whepi/lingyun/lingyunUser.js",
-      "iconCls": "icon-blank fa fa-align-justify",
-      "state": "close",
-      "children": []
+      "id": "ENT102",
+      "text": "和昌信息",
+      "href": "",
+      "iconCls": "icon-blank fa fa-bars",
+      "state": "closed",
+      "children": [
+        {
+          "id": "ENT102001",
+          "text": "和昌出入记录",
+          "href": "/app/whepi/scan/xqmanageHC.js",
+          "iconCls": "icon-blank fa fa-align-justify",
+          "state": "close",
+          "children": []
+        },
+        {
+          "id": "ENT102002",
+          "text": "和昌特殊人员管理",
+          "href": "/app/whepi/scan/specialPersonnelHC.js",
+          "iconCls": "icon-blank fa fa-align-justify",
+          "state": "close",
+          "children": []
+        },
+        {
+          "id": "ENT102003",
+          "text": "和昌导出报表",
+          "href": "/app/whepi/lingyun/HCUser.js",
+          "iconCls": "icon-blank fa fa-align-justify",
+          "state": "close",
+          "children": []
+        }
+      ]
     }
   ]
 }

+ 30 - 0
admin-ui/app/whepi/mock/menu8.json

@@ -0,0 +1,30 @@
+{
+  "success": true,
+  "msg": "",
+  "data": [
+    {
+      "id": "ENT10001",
+      "text": "导出报表",
+      "href": "/app/whepi/lingyun/HCUser.js",
+      "iconCls": "icon-blank fa fa-align-justify",
+      "state": "close",
+      "children": []
+    },
+    {
+      "id": "ENT10002",
+      "text": "出入记录",
+      "href": "/app/whepi/scan/xqmanageHC.js",
+      "iconCls": "icon-blank fa fa-align-justify",
+      "state": "close",
+      "children": []
+    },
+    {
+      "id": "ENT10003",
+      "text": "特殊人员管理",
+      "href": "/app/whepi/scan/specialPersonnelHC.js",
+      "iconCls": "icon-blank fa fa-align-justify",
+      "state": "close",
+      "children": []
+    }
+  ]
+}

+ 102 - 0
admin-ui/app/whepi/scan/addOutUserHC.js

@@ -0,0 +1,102 @@
+define(function (require) {
+    return function (context) {
+
+        var $dlg, $form, isEdit = false;
+
+        return {
+            xtype: 'dialog',
+            dialogId: 'dialogEnvLog',
+            title: context.isEdit ? '编辑特殊人员信息' : '新增特殊人员信息',
+            width: 450,
+            height: 300,
+            onOpen: function () {
+                $dlg = $(this);
+                if (context.isEdit) {
+                    $.yvan.ajax({
+                        loadingMask: false,
+                        url: api('/qrImg/getDoorById'),
+                        type: 'GET',
+                        data: {tuId: context.tuId},
+                        success: function (data) {
+                            $dlg.find('form');
+                            $form.formSet(data.data);
+                        }
+                    });
+                }
+            },
+            center: {
+                items: {
+                    width: 450,
+                    height: 756,
+                    autoSizeColumns: true,
+                    xtype: 'formgroup',
+                    onRender: function () {
+                        $form = $(this);
+                    },
+                    items: [
+                        [
+                            {name: 'tuId', xtype: 'hidden'},
+                            {
+                                name: 'phone',
+                                label: '电话',
+                                required: true,
+                                validType: 'phoneNum',
+                                maxlength: 60,
+                                width: 350,
+                            },
+                            {
+                                name: 'name',
+                                label: '联系人姓名',
+                                required: true,
+                                maxlength: 60,
+                                width: 350,
+                            },
+                        ]
+                    ],
+                }
+            },
+            buttons: [
+                {
+                    text: "检查电话", iconCls: "fa fa-save", onClick: function () {
+                        var queryForm = $form.formGet();
+                        if (queryForm.phone == "") {
+                            $.yvan.msg('请先选输入电话号码');
+                            return;
+                        }
+                        $.yvan.ajax({
+                            url: api('/OutUser/getUptownHomeByPhone'),
+                            data: {phone: queryForm.phone},
+                            method: 'post',
+                            async: false,
+                            success: function (data) {
+                                if (data.data.linkman != null) {
+                                    $form.formSet({name: data.data.linkman});
+                                }
+                            }
+                        });
+                    }
+                },
+                {
+                    text: "保存", iconCls: "fa fa-save", onClick: function () {
+                        $.yvan.postForm($form, {
+                            url: api('/OutUser/saveOutUserHC'),
+                            success: function (data) {
+                                if (data.data == 1) {
+                                    $.yvan.msg('保存成功');
+                                    $dlg.window('close');
+                                    if ($.type(context.confirm) === 'function') {
+                                        context.confirm();
+                                    }
+                                }
+                            }
+                        });
+                    }
+                }, {
+                    text: "关闭", iconCls: "fa fa-times", onClick: function () {
+                        $dlg.dialog('close');
+                    }
+                }
+            ]
+        };
+    };
+});

+ 252 - 0
admin-ui/app/whepi/scan/specialPersonnelHC.js

@@ -0,0 +1,252 @@
+define(function (require) {
+        return function (context) {
+
+            var $grid1, $form;
+
+            // 输入搜索文本后点击回车按钮查询列表
+            function enterQueryGrid1(e) {
+                if (e.keyCode === 13) {
+                    var tmp = $(this).val();
+                    $form.formSet({queryProperties: tmp});
+                    queryGrid1();
+                }
+            }
+
+            // 检索条件查询
+            function queryGrid1() {
+                var queryForm = $form.formGet();
+                queryForm.tuType = 3;
+                $grid1.reload({
+                    mtype: 'POST',
+                    url: api('/OutUser/selectAllOutUserLY'),
+                    queryParams: queryForm
+                }, true);
+            }
+
+            var queryToolbar = {
+                xtype: 'toolbar',
+                title: '特殊人员详情',
+                items: [
+                    {
+                        text: '查询', iconCls: 'fa fa-search', onClick: function () {
+                            queryGrid1();
+                        }
+                    }, {
+                        text: '重置', iconCls: 'fa fa-refresh', onClick: function () {
+                            $form.formClear();
+                            queryGrid1();
+                        }
+                    }, {
+                        text: '关闭', iconCls: 'fa fa-times-circle', onClick: function () {
+                            App.closeMe(this);
+                        }
+                    }
+                ]
+            };
+
+            var queryForm = {
+                onRender: function () {
+                    $form = $(this);
+                },
+                xtype: 'form',
+                items: [[
+                    {
+                        xtype: 'textbox',
+                        label: '检索条件',
+                        name: 'queryProperties',
+                        prompt: "联系人姓名/工号",
+                        labelWidth: 'auto',
+                        events: {keydown: enterQueryGrid1}, width: 350
+                    },
+                    {
+                        xtype: 'textbox',
+                        label: '电话',
+                        name: 'phone',
+                        prompt: "小区名称",
+                        labelWidth: 'auto',
+                        events: {keydown: enterQueryGrid1}, width: 350
+                    },
+                ]]
+            };
+
+            return {
+                north: {
+                    height: 88,
+                    /* split: true,
+                     border: false,*///底框是否可变动
+                    items: [
+                        queryToolbar,
+                        queryForm
+                    ]
+                },
+                center: {
+                    height: '60%',
+                    split: true,
+                    items:
+                        {
+                            onRender: function () {
+                                $grid1 = $(this);
+                                queryGrid1()
+                            },
+                            xtype: 'grid',
+                            toolbar: {
+                                xtype: 'toolbar',
+                                title: '特殊人员详情',
+                                items: [
+                                    {
+                                        text: '添加', iconCls: 'fa fa-plus-circle fa-lg', onClick: function () {
+                                            $.yvan.showDialog(this,
+                                                require('/app/whepi/scan/addOutUserHC.js')({
+                                                    isEdit: false,
+                                                    confirm: function () {
+                                                        queryGrid1();
+                                                    }
+                                                })
+                                            );
+                                        }
+                                    },
+                                    // {
+                                    //     text: '保存', iconCls: 'fa fa-pencil-square-o', onClick: function () {
+                                    //         var row = $grid1.rowData();
+                                    //         if (!row) {
+                                    //             $.yvan.msg('请选择一条要保存的数据');
+                                    //             return;
+                                    //         }
+                                    //         var startDateStr = row.startDateStr;
+                                    //         var endDateStr = row.endDateStr;
+                                    //         if (startDateStr > endDateStr) {
+                                    //             $.yvan.msg('开始时间必须小于等于结束时间');
+                                    //             return;
+                                    //         }
+                                    //         $.yvan.ajax({
+                                    //             url: api('/OutUser/updateOutUser'),
+                                    //             data: {
+                                    //                 tuId: row.tuId,
+                                    //                 startDate: row.startDateStr,
+                                    //                 endDate: row.endDateStr
+                                    //             },
+                                    //             method: 'post',
+                                    //             async: false,
+                                    //             success: function (data) {
+                                    //                 $.yvan.msg("操作成功");
+                                    //                 $grid1.reload();
+                                    //                 queryGrid1();
+                                    //             }
+                                    //         });
+                                    //     }
+                                    // },
+                                    {
+                                        text: '删除', iconCls: 'fa fa fa-pencil-square-o fa-lg', 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].tuId + ","
+                                            }
+                                            $.yvan.confirm('确定删除勾选的这' + row.length + '条特殊人员吗?', {
+                                                yes: function (index) {
+                                                    $.yvan.ajax({
+                                                        method: 'post',
+                                                        url: api('/OutUser/deleteOutUser'),
+                                                        data: {ids: ids},
+                                                        success: function (data) {
+                                                            $.yvan.msg("删除成功");
+                                                            $grid1.reload();
+                                                            queryGrid1();
+                                                        }
+                                                    });
+                                                }
+                                            });
+                                        }
+                                    }
+                                ]
+                            },
+                            multiselect: true, /// 表格多选
+                            idField: 'tuId',
+                            editable: true,
+                            editOnSelected: true,
+                            autoSizeColumns: true,
+                            columns:
+                                [
+                                    [
+                                        {field: 'tuId', title: '用户ID', hidden: true},
+                                        {field: 'userId', title: '用户ID', hidden: true},
+                                        {field: 'unit', title: '部门', maxWidth: 200, align: 'left',},
+                                        {field: 'name', title: '名字', maxWidth: 200, align: 'left',},
+                                        {field: 'phone', title: '电话', maxWidth: 200, align: 'left',},
+                                        {field: 'doorplate', title: '工号', maxWidth: 200, align: 'left',},
+                                        {
+                                            field: 'startDateStr', title: '开始时间', minWidth: 120, maxWidth: 300, align: 'left', editor: {
+                                                xtype: 'datebox',
+                                                required: true,
+                                                onChange: function (value) {
+                                                    console.log(value)
+                                                    var row = $grid1.rowData();
+                                                    var startDateStr = row.startDateStr;
+                                                    var endDateStr = row.endDateStr;
+                                                    if (startDateStr > endDateStr) {
+                                                        $.yvan.msg('开始时间必须小于等于结束时间');
+                                                        return;
+                                                    } else {
+                                                        $.yvan.ajax({
+                                                            url: api('/OutUser/updateOutUser'),
+                                                            data: {
+                                                                tuId: row.tuId,
+                                                                startDate: row.startDateStr,
+                                                                endDate: row.endDateStr
+                                                            },
+                                                            method: 'post',
+                                                            async: false,
+                                                            success: function (data) {
+                                                                $.yvan.msg("操作成功");
+                                                                return;
+                                                            }
+                                                        });
+                                                    }
+                                                },
+                                                maxlength: 50
+                                            }
+                                        },
+                                        {
+                                            field: 'endDateStr', title: '结束时间', minWidth: 120, maxWidth: 200, align: 'left', editor: {
+                                                xtype: 'datebox',
+                                                required: true,
+                                                onChange: function (value) {
+                                                    console.log(value)
+                                                    var row = $grid1.rowData();
+                                                    var startDateStr = row.startDateStr;
+                                                    var endDateStr = row.endDateStr;
+                                                    if (startDateStr > endDateStr) {
+                                                        $.yvan.msg('开始时间必须小于等于结束时间');
+                                                        return;
+                                                    } else {
+                                                        $.yvan.ajax({
+                                                            url: api('/OutUser/updateOutUser'),
+                                                            data: {
+                                                                tuId: row.tuId,
+                                                                startDate: row.startDateStr,
+                                                                endDate: row.endDateStr
+                                                            },
+                                                            method: 'post',
+                                                            async: false,
+                                                            success: function (data) {
+                                                                $.yvan.msg("操作成功");
+                                                                return;
+                                                            }
+                                                        });
+                                                    }
+                                                },
+                                                maxlength: 50
+                                            }
+                                        },
+                                    ]
+                                ]
+                        }
+                }
+            };
+        };
+    }
+);

+ 261 - 0
admin-ui/app/whepi/scan/xqmanageHC.js

@@ -0,0 +1,261 @@
+define(function (require) {
+        return function (context) {
+
+            var $grid1, $form;
+
+            // 弹框的方式
+            var widgets = {
+                // 搜索分类检索
+                selectTableUnit: {
+                    url: 'app/whepi/home/selectHCbumen.js',
+                    bind: {
+                        unitId: 'unitId',
+                        unit: 'unit',
+                    },
+                },
+            }
+
+
+            // 导出
+            function exportExcel() {
+                var queryForm = $form.formGet();
+                $.yvan.download({
+                    method: 'post',
+                    url: api('/sweepCode/exportHC?queryProperties=' + queryForm.queryProperties + '&unitId=' + queryForm.unitId + '&goStatus=' + queryForm.goStatus + '&dateSta=' + queryForm.dateSta + '&dateEnd=' + queryForm.dateEnd),
+                    fileName: '进出管理-' + $.yvan.getMoment().format('YYYY-MM-DD HH:mm:ss') + '.xlsx'
+
+                });
+            }
+
+            // 输入搜索文本后点击回车按钮查询列表
+            function enterQueryGrid1(e) {
+                if (e.keyCode === 13) {
+                    var tmp = $(this).val();
+                    $form.formSet({queryProperties: tmp});
+                    queryGrid1();
+                }
+            }
+
+            // 检索条件查询
+            function queryGrid1() {
+                var queryUrl = '/sweepCode/selectCodeHC';// 自行替换此参数
+                var queryForm = $form.formGet();
+                if (!queryForm.dateSta) {
+                    $form.formSet({dateSta: getFormatDate() + " 00:00:00"});
+                    queryForm.dateSta = getFormatDate() + " 00:00:00";
+                }
+                if (!queryForm.dateEnd) {
+                    $form.formSet({dateEnd: getFormatDate() + " 23:59:59"});
+                    queryForm.dateEnd = getFormatDate() + " 23:59:59";
+                }
+                queryForm.roleCode = App.currentRoleCode;
+                $grid1.reload({
+                    mtype: 'POST',
+                    url: api(queryUrl),
+                    queryParams: queryForm
+                }, true);
+            }
+
+            // 搜索按钮
+            var queryToolbarTitle = '进出管理';// 自行替换此参数
+            var queryToolbar = {
+                xtype: 'toolbar', title: queryToolbarTitle, items: [
+                    {
+                        text: '查询', iconCls: 'fa fa-search', onClick: function () {
+                            queryGrid1();
+                        }
+                    }, {
+                        text: '重置', iconCls: 'fa fa-refresh', onClick: function () {
+                            $form.formClear();
+                            queryGrid1();
+                        }
+                    }, {
+                        text: '关闭', iconCls: 'fa fa-times-circle', onClick: function () {
+                            App.closeMe(this);
+                        }
+                    }
+                ]
+            };
+
+            // 搜索条件
+            var queryForm = {
+                onRender: function () {
+                    $form = $(this);
+                },
+                xtype: 'form',
+                items: [[
+                    {
+                        xtype: 'textbox',
+                        label: '大门名称',
+                        name: 'queryProperties',
+                        prompt: "大门名称",
+                        labelWidth: 'auto',
+                        events: {keydown: enterQueryGrid1}, width: 250
+                    },
+                    {xtype: 'hidden', name: 'unitId'},
+                    {
+                        xtype: 'searchbox',
+                        label: '部门',
+                        name: 'unit',
+                        prompt: "部门",
+                        width: '300px',
+                        widget: widgets.selectTableUnit,// 弹出框方法
+                        labelWidth: '70px',
+                        onChange: function (value) {
+                            if (!isNotNullOrEmpty(value)) {
+                                $form.formSet({
+                                    unitId: ''
+                                })
+                            }
+                            queryGrid1();
+                        },
+                    },
+                    {
+                        xtype: 'yvselect', label: '通行状态', name: 'goStatus', labelWidth: 'auto', value: '', width: 220,
+                        data: [
+                            {id: '1', text: '允许'},
+                            {id: '-1', text: '禁止'},
+                        ],
+                        onChange: function () {
+                            queryGrid1();
+                        }
+                    },
+                    {
+                        xtype: 'datetimebox',
+                        name: 'dateSta',
+                        label: '进出时间',
+                        labelWidth: 'auto',
+                        width: 230,
+                        onChange: function (data) {
+                          /*  var expDateStart = $form.formGet().nextRepairDate;
+                            var expDateEnd = $form.formGet().expDateEnd;
+                            var expDateStart = new Date(expDateStart.replace("-", "/"));
+                            var expDateEnd = new Date(expDateEnd.replace("-", "/"));
+                            if (expDateStart > expDateEnd) {
+                                $.yvan.msg('起止日期必须大于起始日期');
+                                return;
+                            }*/
+                        }
+                    },
+                    {
+                        xtype: 'datetimebox', label: '--', name: 'dateEnd', labelWidth: 'auto', width: 220,
+                        onChange: function (data) {
+                           /* var expDateStart = $form.formGet().nextRepairDate;
+                            var expDateEnd = $form.formGet().expDateEnd;
+                            var expDateStart = new Date(expDateStart.replace("-", "/"));
+                            var expDateEnd = new Date(expDateEnd.replace("-", "/"));
+                            if (expDateStart > expDateEnd) {
+                                $.yvan.msg('起止日期必须大于起始日期');
+                                return;
+                            }*/
+                        }
+                    }
+                ]]
+            };
+
+            var gridToolbarTitle = '出入列表';// 自行替换此参数
+            var gridToolbar = {
+                xtype: 'toolbar',
+                title: gridToolbarTitle,
+                items: [
+                    {
+                        text: '导出', iconCls: 'fa fa-cloud-upload', onClick: function () {
+                            exportExcel();
+                        }
+                    },
+                ]
+            };
+
+            return {
+                north: {
+                    height: 88,
+                    /* split: true,
+                     border: false,*///底框是否可变动
+                    items: [
+                        queryToolbar,
+                        queryForm
+                    ]
+                },
+                center: {
+                    height: '60%',
+                    split: true,
+                    items:
+                        {
+                            onRender: function () {
+                                $grid1 = $(this);
+                                queryGrid1()
+                            },
+                            xtype: 'grid',
+                            toolbar:
+                            gridToolbar,
+                            idField: 'joId',
+                            autoSizeColumns: true,//序号多  正确显示
+                            columns:
+                                [
+                                    [
+                                        {field: 'uptownId', title: '小区id', maxWidth: 200, align: 'left', hidden: true},
+                                        // {field: 'uptownName', title: '小区名称', maxWidth: 200, align: 'left',},
+                                        // {field: 'ridgepole', title: '楼栋', maxWidth: 200, align: 'left',},
+                                        {field: 'unit', title: '部门', maxWidth: 200,},
+                                        {
+                                            field: 'doorplate',
+                                            title: '工号', maxWidth: 200,
+                                        },
+                                        {
+                                            field: 'linkman',
+                                            title: '用户名',
+                                        },
+                                        {
+                                            field: 'phone',
+                                            title: '电话',
+                                        },
+                                        {
+                                            field: 'doorName',
+                                            title: '出入大门',
+                                            align: 'left',
+                                        },
+                                        {
+                                            field: 'date',
+                                            title: '进出时间',
+                                            align: 'left',
+                                        },
+                                        {
+                                            field: 'inType',
+                                            title: '记录状态',
+                                            align: 'center',
+                                            formatter:function (value) {
+                                                if(value==1){
+                                                    return "进入"
+                                                }else if(value ==2){
+                                                    return "外出"
+                                                }
+
+                                            }
+                                        },
+                                        {
+                                            field: 'goStatus',
+                                            title: '通行状态',
+                                            align: 'center',
+                                            formatter:function (value) {
+                                                if(value==1){
+                                                    return "允许"
+                                                }else if(value ==-1){
+                                                    return "禁止"
+                                                }
+
+                                            }
+                                        },
+                                        {
+                                            field: 'errorInfo',
+                                            title: '禁止提示',
+                                            align: 'left',
+                                        },
+
+                                    ]
+                                ]
+                        }
+                }
+            };
+        };
+    }
+);

+ 1 - 1
whepi-doc/login.sql

@@ -210,7 +210,7 @@ CREATE TABLE out_scan  (
 DROP TABLE IF EXISTS out_user;
 CREATE TABLE out_user  (
   tu_id             bigint(20) NOT NULL DEFAULT 0 COMMENT '特殊ID',
-  tu_type           int(11) NOT NULL DEFAULT 0 COMMENT '特殊人员类型:1凌云,2非凌云',
+  tu_type           int(11) NOT NULL DEFAULT 0 COMMENT '特殊人员类型:1凌云,2非凌云,3湖北和昌',
   name              varchar(100)  NOT NULL DEFAULT '' COMMENT '特殊人员姓名',
   phone             bigint(20) NOT NULL DEFAULT 0 COMMENT '电话号码',
   start_date        date NOT NULL DEFAULT '0000-01-01' COMMENT '开始时间',

BIN
whepi-ui/hc.png


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

@@ -0,0 +1,35 @@
+<#assign title="${tittle!''}复工许可证"/>
+<#include "/home/frag.head.ftl" />
+
+<div class="weui-tab">
+    <div class="weui-tab__bd">
+        <div class="weui-tab__bd-item weui-tab__bd-item--active">
+            <div class="page__bd">
+                <header class="user-header">
+                    <br/>
+                    <#if (uptownId??) && (uptownId == 100000002)>
+                        <img class="user-title" style="height: 60px;width: 70px;" id="qr" src="/hc.png"/>
+                    </#if>
+                    <#if (uptownId??) && (uptownId != 100000002)>
+                        <br/>
+                        <br/>
+                    </#if>
+                    <p class="user-title-long">${doorplate!''}</p>
+                    <p class="user-title-long">${name!''}</p>
+                    <br/>
+                    <h1 class="user-title-big ${collor!''}">${into!""}</h1>
+                    <br/>
+                    <br/>
+                    <p class="user-title-long-two">${errorMsg!""}</p>
+                </header>
+                <br/>
+                <p class="user-title-long ${collor2!''}">${now!''}</p>
+            </div>
+        </div>
+    </div>
+</div>
+</div>
+</body>
+<#include "/home/frag.foot.ftl" />
+<script>
+</script>

+ 33 - 0
whepi-ui/templates/user/scanHC.ftl

@@ -0,0 +1,33 @@
+<#assign title="${tittle!''}证"/>
+<#include "/home/frag.head.ftl" />
+
+<div class="weui-tab">
+    <div class="weui-tab__bd">
+        <div class="weui-tab__bd-item weui-tab__bd-item--active">
+            <div class="page__bd">
+                <header class="user-header">
+                    <br/>
+                    <#if (uptownId??) && (uptownId == 100000002)><img class="user-title" style="height: 60px;width: 70px;" id="qr" src="/hc.png"/></#if>
+                    <#if (uptownId??) && (uptownId != 100000002)><br/>
+                        <br/>
+                        <br/></#if>
+                    <p class="user-title-long">${doorplate!''}</p>
+                    <p class="user-title-long">${name!''}</p>
+                    <h1 class="user-title-long ${collor!''}">${door!''}</h1>
+                    <br/>
+                    <h1 class="user-title-big ${collor!''}">${into!""}</h1>
+                    <br/>
+                    <br/>
+                    <p class="user-title-long-two">${errorMsg!""}</p>
+                </header>
+                <br/>
+                <p class="user-title-long ${collor2!''}">${now!''}</p>
+            </div>
+        </div>
+    </div>
+</div>
+</div>
+</body>
+<#include "/home/frag.foot.ftl" />
+<script>
+</script>

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

@@ -18,4 +18,7 @@ public interface SweepCodeMapper {
 
     List<SysUptownHouseLY> selectCodeLY(PageDb pageDb, Map<String, Object> queryParam);
     List<SysUptownHouseLY> exportLY(Map<String, Object> queryParam);
+
+    List<SysUptownHouseLY> selectCodeHC(PageDb pageDb, Map<String, Object> queryParam);
+    List<SysUptownHouseLY> exportHC(Map<String, Object> queryParam);
 }

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

@@ -47,4 +47,7 @@ public interface UptownUnitMapper extends BaseMapper<UptownUnit> {
 
     @Select("select * from(select unit_id,CONCAT(ridgepole,unit) as unit from sys_uptown_unit where status = 1 and uptown_id = 1238790987234) tt where unit like concat('%', #{unit}, '%')")
     List<UptownUnit> getDLYbumen(@Param("unit") String unit);
+
+    @Select("select * from(select unit_id,CONCAT(ridgepole,unit) as unit from sys_uptown_unit where status = 1 and uptown_id = 100000002) tt where unit like concat('%', #{unit}, '%')")
+    List<UptownUnit> getHCBumen(@Param("unit") String unit);
 }

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

@@ -73,6 +73,29 @@ public class SweepCodeService {
         return sysUptownHouses;
     }
 
+    public List<ExcelRiBaoLYBM4> HCUser(PageDb pageDb, Map<String, Object> queryParam) {
+        queryParam.put("uptownId", 100000002L);
+        List<ExcelRiBaoLYBM4> sysUptownHouses = rbMapper.exSelectLingyunUserPage(pageDb,queryParam);
+        if (sysUptownHouses != null && sysUptownHouses.size() > 0) {
+            String tripDet;
+            for (ExcelRiBaoLYBM4 excelRiBaoLYBM4 : sysUptownHouses) {
+                tripDet = "";
+                //出行详细
+                List<MsTripDet> listDet = msSuspectedMapper.selectTripSuspected(excelRiBaoLYBM4.getTripId());
+                if (listDet != null && listDet.size() > 0) {
+                    for (MsTripDet msTripDet : listDet) {
+                        tripDet += "出发地:" + msReportService.getLocalOther(msTripDet.getStartLocal(), msTripDet.getStartLocalOther()) + ",";
+                        tripDet += "目的地:" + msReportService.getLocalOther(msTripDet.getEndLocal(), msTripDet.getEndLocalOther()) + ",";
+                        tripDet += "出行方式:" + msReportService.getTripType(msTripDet.getTripType()) + ",";
+                        tripDet += "车次/航班/车牌:" + msTripDet.getTripTypeDesp() + ",";
+                    }
+                    excelRiBaoLYBM4.setTripDetDesc(tripDet.substring(0, tripDet.length() - 1));
+                }
+            }
+        }
+        return sysUptownHouses;
+    }
+
     public List<ExcelRiBaoLYBM4> selectLingyunUserHistory(PageDb pageDb, Long userId) {
 
         List<ExcelRiBaoLYBM4> sysUptownHouses = rbMapper.exSelectLingyunUserHistory(pageDb,userId);
@@ -164,6 +187,30 @@ public class SweepCodeService {
         return sysUptownHouses;
     }
 
+    public List<SysUptownHouseLY> selectCodeHC(PageDb pageDb, Map<String, Object> queryParam) {
+        List<SysUptownHouseLY> sysUptownHouses = sweepCodeMapper.selectCodeHC(pageDb,queryParam);
+        return sysUptownHouses;
+    }
+
+    public List<SysUptownHouseLY> exportHC(Map<String, Object> queryParam) {
+        List<SysUptownHouseLY> sysUptownHouses = sweepCodeMapper.exportHC(queryParam);
+        if(sysUptownHouses.size() != 0){
+            for (int i = 0; i < sysUptownHouses.size(); i++) {
+                if(sysUptownHouses.get(i).getInType() == 1 ){
+                    sysUptownHouses.get(i).setInTypeStr("进入");
+                }else if(sysUptownHouses.get(i).getInType() == 2 ){
+                    sysUptownHouses.get(i).setInTypeStr("外出");
+                }
+                if(sysUptownHouses.get(i).getGoStatus() == 1 ){
+                    sysUptownHouses.get(i).setGoStatusStr("允许");
+                }else if(sysUptownHouses.get(i).getGoStatus() == -1 ){
+                    sysUptownHouses.get(i).setGoStatusStr("禁止");
+                }
+            }
+        }
+        return sysUptownHouses;
+    }
+
     public List<OutScanEstate> selectXunJian(PageDb pageDb, Map<String, Object> queryParam) {
         List<OutScanEstate> outScanEstates = outScanEstateMapper.selectXunJian(pageDb,queryParam);
         return outScanEstates;

+ 47 - 0
whepi-web/src/main/java/com/bofeng/wx/controller/ScanAdminController.java

@@ -85,6 +85,13 @@ public class ScanAdminController {
         return Model.newSuccess(pageDb,sysUptownHouses);
     }
 
+    @ApiOperation("凌云用户管理")
+    @PostMapping("/whepi/sweepCode/HCUser")
+    public Model<List<ExcelRiBaoLYBM4>> HCUser(PageDb pageDb,HttpParameterParser parser) {
+        List<ExcelRiBaoLYBM4> sysUptownHouses = sweepCodeService.HCUser(pageDb,parser.getMap());
+        return Model.newSuccess(pageDb,sysUptownHouses);
+    }
+
     @ApiOperation("凌云用户管理,上报明细")
     @GetMapping("/whepi/sweepCode/selectLingyunUserHistory")
     public Model<List<ExcelRiBaoLYBM4>> selectLingyunUserHistory(PageDb pageDb,@Pd(name = "userId") Long userId) {
@@ -141,6 +148,21 @@ public class ScanAdminController {
         ExcelUtils.writeSheet(SysUptownHouseLY.class, sysUptownHouses).export(resp,"凌云集团出入管理");
     }
 
+    @ApiOperation("和昌出入查询")
+    @PostMapping("/whepi/sweepCode/selectCodeHC")
+    public Model<List<SysUptownHouseLY>> selectCodeHC(PageDb pageDb,HttpParameterParser parser) {
+        List<SysUptownHouseLY> sysUptownHouses = sweepCodeService.selectCodeHC(pageDb,parser.getMap());
+        return Model.newSuccess(pageDb,sysUptownHouses);
+    }
+
+    @ApiOperation("和昌导出")
+    @PostMapping("/whepi/sweepCode/exportHC")
+    @SneakyThrows
+    public void exportHC(HttpParameterParser parser,HttpServletResponse resp) {
+        List<SysUptownHouseLY> sysUptownHouses = sweepCodeService.exportHC(parser.getMap());
+        ExcelUtils.writeSheet(SysUptownHouseLY.class, sysUptownHouses).export(resp,"湖北和昌新材料科技出入管理");
+    }
+
     @ApiOperation("出入查询")
     @PostMapping("/whepi/sweepCode/selectXunJian")
     public Model<List<OutScanEstate>> selectXunJian(PageDb pageDb,HttpParameterParser parser) {
@@ -231,6 +253,25 @@ public class ScanAdminController {
         return Model.newSuccess(outUserMapper.insert(outUser));
     }
 
+    @ApiOperation("湖北和昌新材料科技保存特殊人员")
+    @PostMapping("/whepi/OutUser/saveOutUserHC")
+    public Model saveOutUserHC(@JsonBody OutUser outUser) {
+        OutUser outUser1 = outUserMapper.queryOutUserByPhone(3, outUser.getPhone());
+        if (outUser1 != null) {
+            return Model.newFail("该号码已经添加为特殊人员,请仔细检查该号码。");
+        }
+        List<UptownHome> uptownHomes = uptownHomeMapper.getUptownHomeByPhone(outUser.getPhone().toString());
+        if (uptownHomes.size() > 0) {
+            outUser.setName(uptownHomes.get(0).getLinkman());
+        }
+        outUser.setTuId(IdWorker.getId());
+        outUser.setTuType(3);
+        outUser.setStartDate(new Date());
+        outUser.setEndDate(new Date());
+        outUser.setTime(1);
+        return Model.newSuccess(outUserMapper.insert(outUser));
+    }
+
     @ApiOperation("删除特殊人员的时间")
     @PostMapping("/whepi/OutUser/deleteOutUser")
     public Model deleteOutUser(@Pd(name = "ids") String ids) {
@@ -281,6 +322,12 @@ public class ScanAdminController {
         return Model.newSuccess(uptownUnitMapper.getDLYbumen(query));
     }
 
+    @ApiOperation("获取部门数据")
+    @PostMapping("/whepi/qrImg/getHCBumen")
+    public Model<List<UptownUnit>> getHCBumen(@Pd(name = "query", required = false, defaultValue = "") String query) {
+        return Model.newSuccess(uptownUnitMapper.getHCBumen(query));
+    }
+
     @ApiOperation("保存小区大门信息")
     @PostMapping("/whepi/qrImg/insertDoor")
     public Model insert(@JsonBody UptownDoor uptownDoor) {

+ 101 - 1
whepi-web/src/main/java/com/bofeng/wx/controller/ScanController.java

@@ -92,6 +92,7 @@ public class ScanController {
             return new ModelAndView("/user/home.ftl", model);
         } else {
             Boolean ly = false;
+            Boolean hc = false;
             UptownDoor uptownDoor = uptownDoorMapper.getUptownDoorById(doorId);
             List<UptownHome> uptownHomes = uptownHomeMapper.getUptownHomeByUserId(userOpen.getUserId());
             UptownUnit unit = uptownUnitMapper.getUptownUnitByUser(userOpen.getUserId());
@@ -101,7 +102,11 @@ public class ScanController {
                 model.put("tittle", "凌云集团电子通行");
                 ly = true;
             }
-            if (ly) {
+            if (unit.getUptownId() == 100000002L) {
+                model.put("tittle", "湖北和昌电子通行");
+                hc = true;
+            }
+            if (ly || hc) {
                 model.put("doorplate", unit.getRidgepole() + unit.getUnit());
                 model.put("door", uptownDoor.getDoorName());
             } else {
@@ -206,6 +211,54 @@ public class ScanController {
                     scanService.saveOutScan(userOpen.getUserId(), inType, uptownDoor.getUptownId(), uptownDoor.getDoorId(), 1, "");
                     return new ModelAndView("/user/scan.ftl", model);
                 }
+                if (hc) {
+                    OutUser outUser = outUserMapper.getOutUserByPhone(3, uptownHomes.get(0).getLinkman(), Long.parseLong(uptownHomes.get(0).getPhone()));
+                    if (outUser != null) {
+                        model.put("collor", "green");
+                        model.put("collor2", "green");
+                        model.put("into", "允许通行");
+                        model.put("errorMsg", "特殊人员允许通行,请保证生产同时注意自身安全。");
+                        scanService.saveOutScan(userOpen.getUserId(), inType, uptownDoor.getUptownId(), uptownDoor.getDoorId(), 1, "");
+                        return new ModelAndView("/user/scanHC.ftl", model);
+                    }
+                    MsReport msReport = msReportMapper.queryMsReportIsXG(userOpen.getUserId());
+                    SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd");
+                    if (msReport != null) {
+                        List<MsReport> msReports1 = msReportMapper.queryLateStatus(userOpen.getUserId(), s.format(msReport.getReportDate()));
+                        if (msReports1.size() == 0) {
+                            model.put("collor", "red");
+                            model.put("collor2", "red");
+                            model.put("into", "不许进入");
+                            model.put("errorMsg", "由于您上报过新冠确诊、新冠疑似或密切接触者,且未解除医学隔离,不许进入,如有疑问请联系直管领导。");
+                            scanService.saveOutScan(userOpen.getUserId(), inType, uptownDoor.getUptownId(), uptownDoor.getDoorId(), -1, model.get("errorMsg").toString());
+                            return new ModelAndView("/user/scanHC.ftl", model);
+                        }
+                    }
+                    List<MsReport> msReports = msReportMapper.selectMsReportLate(userOpen.getUserId());
+                    if (msReports.size() < 3) {
+                        model.put("collor", "red");
+                        model.put("collor2", "red");
+                        model.put("into", "不许进入");
+                        model.put("errorMsg", "由于您近3日未连续报告日报,不许进入,如有疑问请联系直管领导。");
+                        scanService.saveOutScan(userOpen.getUserId(), inType, uptownDoor.getUptownId(), uptownDoor.getDoorId(), -1, model.get("errorMsg").toString());
+                        return new ModelAndView("/user/scanHC.ftl", model);
+                    }
+                    List<MsReport> msReports2 = msReportMapper.selectMsReportThereError(userOpen.getUserId());
+                    if (msReports2.size() > 0) {
+                        model.put("collor", "red");
+                        model.put("collor2", "red");
+                        model.put("into", "不许进入");
+                        model.put("errorMsg", "由于近期您健康评估存在问题,不许进入,如有疑问请联系直管领导。");
+                        scanService.saveOutScan(userOpen.getUserId(), inType, uptownDoor.getUptownId(), uptownDoor.getDoorId(), -1, model.get("errorMsg").toString());
+                        return new ModelAndView("/user/scanHC.ftl", model);
+                    }
+                    model.put("collor", "green");
+                    model.put("collor2", "green");
+                    model.put("into", "允许进入");
+                    model.put("errorMsg", "声明:复工通行证是根据员工自主填写健康日报,结合湖北和昌新材料科技股份有限公司复工条件自动产生。原则上代表员工可以通行,在接受规定检查后,方可入厂。");
+                    scanService.saveOutScan(userOpen.getUserId(), inType, uptownDoor.getUptownId(), uptownDoor.getDoorId(), 1, "");
+                    return new ModelAndView("/user/scanHC.ftl", model);
+                }
             }
             if (inType == 2) {
                 OutUser outUser = outUserMapper.getOutUserByPhone(2, uptownHomes.get(0).getLinkman(), Long.parseLong(uptownHomes.get(0).getPhone()));
@@ -513,6 +566,53 @@ public class ScanController {
             model.put("errorMsg", "声明:复工许可证是根据员工自主填写健康日报,结合凌云集团复工条件自动产生。原则上代表员工可以复工,在厂门口扫描二维码生成绿色复工通行证,并接受规定检查后,方可入厂。");
             return new ModelAndView("/user/returnWork.ftl", model);
             //您近期内离开过工作单位驻地,请遵守返回工作驻地15日隔离规定,您目前未满15日,禁止进入。
+        }else if (unit.getUptownId() == 100000002L) {
+            model.put("tittle", "湖北和昌");
+            model.put("doorplate", unit.getRidgepole() + unit.getUnit());
+            model.put("name", uptownHomes.get(0).getLinkman());
+            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+            SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd");
+            model.put("now", sdf.format(new Date()));
+            OutUser outUser = outUserMapper.getOutUserByPhone(3, uptownHomes.get(0).getLinkman(), Long.parseLong(uptownHomes.get(0).getPhone()));
+            if (outUser != null) {
+                model.put("collor", "green");
+                model.put("collor2", "green");
+                model.put("into", "允许复工");
+                model.put("errorMsg", "特殊人员允许复工,请保证生产同时注意自身安全。");
+                return new ModelAndView("/user/returnWorkHC.ftl", model);
+            }
+            MsReport msReport = msReportMapper.queryMsReportIsXG(userId);
+            if (msReport != null) {
+                List<MsReport> msReports1 = msReportMapper.queryLateStatus(userId, s.format(msReport.getReportDate()));
+                if (msReports1.size() == 0) {
+                    model.put("collor", "red");
+                    model.put("collor2", "red");
+                    model.put("into", "不可复工");
+                    model.put("errorMsg", "由于您上报过新冠确诊、新冠疑似或密切接触者,且未解除医学隔离,不可复工,如有疑问请联系直管领导。");
+                    return new ModelAndView("/user/returnWorkHC.ftl", model);
+                }
+            }
+            List<MsReport> msReports = msReportMapper.selectMsReportLate(userId);
+            if (msReports.size() < 3) {
+                model.put("collor", "red");
+                model.put("collor2", "red");
+                model.put("into", "不可复工");
+                model.put("errorMsg", "由于您近3日未连续报告日报,不可复工,如有疑问请联系直管领导。");
+                return new ModelAndView("/user/returnWorkHC.ftl", model);
+            }
+            List<MsReport> msReports2 = msReportMapper.selectMsReportThereError(userId);
+            if (msReports2.size() > 0) {
+                model.put("collor", "red");
+                model.put("collor2", "red");
+                model.put("into", "不可复工");
+                model.put("errorMsg", "由于近期您健康评估存在问题,不可复工,如有疑问请联系直管领导。");
+                return new ModelAndView("/user/returnWorkHC.ftl", model);
+            }
+            model.put("collor", "green");
+            model.put("collor2", "green");
+            model.put("into", "允许复工");
+            model.put("errorMsg", "声明:复工许可证是根据员工自主填写健康日报,结合湖北和昌新材料科技股份有限公司复工条件自动产生。原则上代表员工可以复工,在厂门口扫描二维码生成绿色复工通行证,并接受规定检查后,方可入厂。");
+            return new ModelAndView("/user/returnWorkHC.ftl", model);
         } else {
             model.put("into", "此功能暂未开放");
             model.put("errorMsg", "复工期间请请注意安全。");

+ 81 - 0
whepi-web/src/main/resources/mapper/SweepCodeMapper.xml

@@ -190,4 +190,85 @@
         order by c.time_update desc
     </select>
 
+    <select id="selectCodeHC" resultType="com.bofeng.entity.SysUptownHouseLY">
+        select DISTINCT
+        a.uptown_name,
+        CONCAT(d.ridgepole,d.unit) as unit,
+        e.doorplate,
+        b.door_name,
+        DATE_FORMAT(c.date,'%Y-%m-%d %H:%i:%s') as date,
+        c.in_type,
+        c.go_status as goStatus,
+        c.error_info as errorInfo,
+        g.linkman,
+        g.phone,
+        c.time_update
+        from out_scan c
+        inner join sys_user_role t on c.user_id = t.user_id and role_id =1
+        inner join sys_uptown_home g on g.house_id = t.property_id
+        inner join sys_uptown a on c.uptown_id = a.uptown_id
+        inner join sys_uptown_door b on c.door_id = b.door_id
+        inner join sys_uptown_house e on e.house_id = t.property_id
+        inner join sys_uptown_unit d on d.unit_id = e.unit_id
+        <where>
+            a.uptown_id = 100000002
+            <if test="queryProperties != null and queryProperties != ''">
+                and b.door_name like concat('%',#{queryProperties},'%')
+            </if>
+            <if test="unitId != null and unitId != ''">
+                and d.unit_id = #{unitId}
+            </if>
+            <if test="goStatus != null and goStatus !=''">
+                and c.go_status = #{goStatus}
+            </if>
+            <if test="dateSta != null and dateSta !=''">
+                and c.date >= #{dateSta}
+            </if>
+            <if test="dateEnd != null and dateEnd !=''">
+                and c.date &lt; #{dateEnd}
+            </if>
+        </where>
+        order by c.time_update desc
+    </select>
+    <select id="exportHC" resultType="com.bofeng.entity.SysUptownHouseLY">
+        select DISTINCT
+        a.uptown_name,
+        CONCAT(d.ridgepole,d.unit) as unit,
+        e.doorplate,
+        b.door_name,
+        DATE_FORMAT(c.date,'%Y-%m-%d %H:%i:%s') as date,
+        c.in_type,
+        c.go_status as goStatus,
+        c.error_info as errorInfo,
+        g.linkman,
+        g.phone,
+        c.time_update
+        from out_scan c
+        inner join sys_user_role t on c.user_id = t.user_id and role_id =1
+        inner join sys_uptown_home g on g.house_id = t.property_id
+        inner join sys_uptown a on c.uptown_id = a.uptown_id
+        inner join sys_uptown_door b on c.door_id = b.door_id
+        inner join sys_uptown_house e on e.house_id = t.property_id
+        inner join sys_uptown_unit d on d.unit_id = e.unit_id
+        <where>
+            a.uptown_id = 100000002
+            <if test="queryProperties != null and queryProperties != ''">
+                and b.door_name like concat('%',#{queryProperties},'%')
+            </if>
+            <if test="unitId != null and unitId != ''">
+                and d.unit_id = #{unitId}
+            </if>
+            <if test="goStatus != null and goStatus !=''">
+                and c.go_status = #{goStatus}
+            </if>
+            <if test="dateSta != null and dateSta !=''">
+                and c.date >= #{dateSta}
+            </if>
+            <if test="dateEnd != null and dateEnd !=''">
+                and c.date &lt; #{dateEnd}
+            </if>
+        </where>
+        order by c.time_update desc
+    </select>
+
 </mapper>