Kaynağa Gözat

Merge branch 'master' of http://git.yvanui.com/hust/wuhan_epi

lange 5 yıl önce
ebeveyn
işleme
2a8c011d62

+ 8 - 0
admin-ui/app/whepi/mock/menu.json

@@ -81,6 +81,14 @@
           "iconCls": "icon-blank fa fa-align-justify",
           "state": "close",
           "children": []
+        },
+        {
+          "id": "ENT101004",
+          "text": "凌云六类人员管理",
+          "href": "/app/whepi/scan/specialPersonnelLYSix.js",
+          "iconCls": "icon-blank fa fa-align-justify",
+          "state": "close",
+          "children": []
         }
       ]
     },

+ 8 - 0
admin-ui/app/whepi/mock/menu7.json

@@ -25,6 +25,14 @@
       "iconCls": "icon-blank fa fa-align-justify",
       "state": "close",
       "children": []
+    },
+    {
+      "id": "ENT10004",
+      "text": "凌云六类人员管理",
+      "href": "/app/whepi/scan/specialPersonnelLYSix.js",
+      "iconCls": "icon-blank fa fa-align-justify",
+      "state": "close",
+      "children": []
     }
   ]
 }

+ 102 - 0
admin-ui/app/whepi/scan/addOutUserLYSix.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/saveOutUserLYSix'),
+                            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/specialPersonnelLYSix.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 = 4;
+                $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/addOutUserLYSix.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
+                                            }
+                                        },
+                                    ]
+                                ]
+                        }
+                }
+            };
+        };
+    }
+);

+ 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非凌云,3湖北和昌',
+  tu_type           int(11) NOT NULL DEFAULT 0 COMMENT '特殊人员类型:1凌云,2非凌云,3湖北和昌,4六类人员',
   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 '开始时间',

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

@@ -274,6 +274,25 @@ public class ScanAdminController {
         return Model.newSuccess(outUserMapper.insert(outUser));
     }
 
+    @ApiOperation("凌云保存六类人员")
+    @PostMapping("/whepi/OutUser/saveOutUserLYSix")
+    public Model saveOutUserLYSix(@JsonBody OutUser outUser) {
+        OutUser outUser1 = outUserMapper.queryOutUserByPhone(4, 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(4);
+        outUser.setStartDate(new Date());
+        outUser.setEndDate(new Date());
+        outUser.setTime(1);
+        return Model.newSuccess(outUserMapper.insert(outUser));
+    }
+
     @ApiOperation("湖北和昌新材料科技保存特殊人员")
     @PostMapping("/whepi/OutUser/saveOutUserHC")
     public Model saveOutUserHC(@JsonBody OutUser outUser) {

+ 26 - 7
whepi-web/src/main/java/com/bofeng/wx/controller/ScanController.java

@@ -117,12 +117,14 @@ public class ScanController {
             SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
             model.put("now", sdf.format(new Date()));
             model.put("inType", inType);
-            if (!unit.getUptownId().equals(uptownDoor.getUptownId())) {
-                model.put("into", "禁止" + getMsg(inType));
-                model.put("collor", "red");
-                model.put("errorMsg", "非本小区居民,禁止" + getMsg(inType) + "。");
-                scanService.saveOutScan(userOpen.getUserId(), inType, uptownDoor.getUptownId(), uptownDoor.getDoorId(), -1, model.get("errorMsg").toString());
-                return new ModelAndView("/user/scan.ftl", model);
+            if (!ly && !hc) {
+                if (!unit.getUptownId().equals(uptownDoor.getUptownId())) {
+                    model.put("into", "禁止" + getMsg(inType));
+                    model.put("collor", "red");
+                    model.put("errorMsg", "非本小区居民,禁止" + getMsg(inType) + "。");
+                    scanService.saveOutScan(userOpen.getUserId(), inType, uptownDoor.getUptownId(), uptownDoor.getDoorId(), -1, model.get("errorMsg").toString());
+                    return new ModelAndView("/user/scan.ftl", model);
+                }
             }
             OutScan o = outScanMapper.getOutScanLately(userOpen.getUserId(), inType);
             if (o != null && compareTime(o.getDate(), 1)) {
@@ -134,7 +136,7 @@ public class ScanController {
             if (inType == 1) {
                 OutScan outScan = outScanMapper.getOutScanByUserlimit(userOpen.getUserId());
                 if (outScan != null && new Date(outScan.getDate().getMillis() + 3600L * 1000 * 24).compareTo(new Date()) == -1) {
-                    if (!ly) {
+                    if (!ly && !hc) {
                         model.put("collor", "orange");
                         model.put("into", "允许进入");
                         model.put("errorMsg", "您在外驻留时间超过1日,请尽快上报您的健康状况,防止在外长时间逗留。");
@@ -143,6 +145,15 @@ public class ScanController {
                     }
                 }
                 if (ly) {
+                    OutUser outUser1 = outUserMapper.getOutUserByPhone(4, uptownHomes.get(0).getLinkman(), Long.parseLong(uptownHomes.get(0).getPhone()));
+                    if (outUser1 != null) {
+                        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/scan.ftl", model);
+                    }
                     OutUser outUser = outUserMapper.getOutUserByPhone(1, uptownHomes.get(0).getLinkman(), Long.parseLong(uptownHomes.get(0).getPhone()));
                     if (outUser != null) {
                         model.put("collor", "green");
@@ -507,6 +518,14 @@ public class ScanController {
             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 outUser1 = outUserMapper.getOutUserByPhone(4, uptownHomes.get(0).getLinkman(), Long.parseLong(uptownHomes.get(0).getPhone()));
+            if (outUser1 != null) {
+                model.put("collor", "red");
+                model.put("collor2", "red");
+                model.put("into", "不可复工");
+                model.put("errorMsg", "声明:根据凌云集团防疫指挥部复工条件,您属于不可复工六类人员之一,如有疑问请与上级管理部门联系。");
+                return new ModelAndView("/user/returnWork.ftl", model);
+            }
             OutUser outUser = outUserMapper.getOutUserByPhone(1, uptownHomes.get(0).getLinkman(), Long.parseLong(uptownHomes.get(0).getPhone()));
             if (outUser != null) {
                 model.put("collor", "green");