大理访客登记改
diff --git a/src/main/java/com/supwisdom/dlpay/app/controller/AppController.java b/src/main/java/com/supwisdom/dlpay/app/controller/AppController.java
index 93c039f..cd2b0e5 100644
--- a/src/main/java/com/supwisdom/dlpay/app/controller/AppController.java
+++ b/src/main/java/com/supwisdom/dlpay/app/controller/AppController.java
@@ -76,7 +76,8 @@
         if(issuccess==1){

             return "apph5/attention";

         }

-        return "apph5/applyforvisitor";

+

+        return "apph5/visitorresult";

     }

     @RequestMapping("/qrcodemanage")

     public String qrcodemanage(Model model){

@@ -89,7 +90,7 @@
     @RequestMapping("/appvisitor")

     public String appvisitor(Model model){

 

-        return "apph5/appvisitor";

+        return "apph5/applyforvisitor";

     }

     @RequestMapping("/getqrcode")

     public String getcode(@RequestParam(value = "inoutflag")String inoutflag,Model model){

diff --git a/src/main/resources/templates/apph5/applyforvisitor.html b/src/main/resources/templates/apph5/applyforvisitor.html
new file mode 100644
index 0000000..0e4a094
--- /dev/null
+++ b/src/main/resources/templates/apph5/applyforvisitor.html
@@ -0,0 +1,180 @@
+<!DOCTYPE html>
+<html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity4">
+<head>
+    <title>首页</title>
+    <!--<meta name="_csrf_header" th:content="${_csrf.headerName}" />
+    <meta name="_csrf_token" th:content="${_csrf.parameterName}" th:value="${_csrf.token}" />-->
+    <meta charset="utf-8"/>
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+    <!-- 引入样式 -->
+    <!--<link rel="stylesheet" href="https://unpkg.com/mint-ui/lib/style.css">-->
+    <link rel="stylesheet" href="/static/res/assets/plugins/mintui/style.css" th:href="@{/static/res/assets/plugins/mintui/style.css}">
+    <script type="text/javascript" th:src="@{/static/res/assets/plugins/jquery/jquery.min.js}"></script>
+    <script type="text/javascript" th:src="@{/static/res/assets/plugins/layer/layer.js}"></script>
+    <!-- 先引入 Vue -->
+    <script type="text/javascript" th:src="@{/static/res/assets/plugins/nutui/vue.min.js}"></script>
+    <!-- 引入组件库 -->
+    <script type="text/javascript" th:src="@{/static/res/assets/plugins/mintui/index.js}"></script>
+
+    <!--<script src="https://unpkg.com/vue/dist/vue.js"></script>
+    <script src="https://unpkg.com/mint-ui/lib/index.js"></script>-->
+</head>
+<body>
+<div id="app">
+    <div class="block" style="background:#ffffff;">
+        <br>
+        <span class="mint-cell-title" style="text-align: center;display:block; font-size: 20px;color: #9932CC">访问申请</span><br><br>
+        <!--动态将图片轮播图的容器高度设置成与图片一致-->
+        <div class="mint-switch-input"></div>
+        <el-button type="success" @click="openDoor" style=" display:block;margin:0 auto;width:100px;height:100px;border-radius:50px;border:solid rgb(100,100,100) 0px; font-size: 20px" >开门</el-button>
+    </div>
+
+</div>
+</body>
+
+<script>
+    var mint_vue = new Vue({
+        el: '#app',
+        data:{
+            searchDoorForm: {
+                visitorname: '',
+                idno: '',
+                time: '',
+                phone: '',
+                sex: '',
+                custid: '',
+                deptcode: '',
+                company: '',
+                remarks: '',
+            },
+            regions: [],
+            regionoptions: [],
+            deptlist: [],
+            custlist: [],
+            operFlag: [],
+            selectList: [],
+            sexlist: [],
+        },
+        methods: {
+            openDoor:function (devId) {
+                mint_openDoor(devId);
+            },
+            loadListData:function (devName) {
+                mint_searchByDevName(devName);
+            },
+
+        },
+        watch:{
+            devName:function(newvs,oldvs){
+
+                if(!newvs){
+                    mint_searchByDevName('');
+                }
+            }
+        },
+        created:function(){
+            var _self = this;
+
+            var userId='[[${userId}]]';
+            _self.userId = userId;
+
+
+            $.ajax({
+                type: "get",
+                dataType: "json",
+                url: "[[@{/app/loadAppDevList?userId=}]]"+userId,
+                success: function (ret) {
+                    var ut = ret.devList;
+                    if (ut == null){
+                        confirm("不具有开门权限");
+                        return;
+                    }
+                    var devs = [];
+                    var names = [];
+                    var ids = [];
+                    for (var i = 0; i < ut.length; i++) {
+                        devs.push({
+                            label:ut[i].devname,
+                            value:ut[i].deviceid,
+                            building:ut[i].buildingname
+                        });
+                        names.push(ut[i].devname);
+                        ids.push(ut[i].deviceid);
+                    }
+                    _self.devList = devs;
+
+
+                }
+            })
+        }
+
+
+    })
+
+
+    function mint_openDoor(devId) {
+        var userId = mint_vue.userId;
+        console.log(userId);
+        layer.confirm('你确定要开启此门吗?',{icon: 3,title: '请确认',offset: '30%'},function (index) {
+            $.ajax({
+                type: "get",
+                dataType: "json",
+                url:encodeURI("[[@{/app/openDoorById?devId=}]]" +devId+"&userId="+userId),
+                success:function (ret) {
+                    if (ret.message == undefined){
+                        layer.msg('用户认证已过期,请重新登录',{icon: 2,time:1000});
+                        window.location = "[[@{/login}]]";
+                        return;
+                    }
+                    if (ret.message != "") {
+                        layer.msg(ret.message, {icon: 2, time: 2000});
+                    } else {
+                        layer.msg('开门成功', {icon: 1, time: 2000});
+                    }
+                }
+            })
+        });
+
+    }
+
+    function mint_searchByDevName(devName) {
+        var userId = mint_vue.userId;
+        $.ajax({
+            type: "get",
+            dataType: "json",
+            url: "[[@{/app/searchByDevName?userId=}]]"+userId+"&devName="+devName,
+            success: function (ret) {
+                var ut = ret.devNameList;
+                if (ut == null) {
+                    confirm("没有对应设备!");
+                    return;
+                }
+                var devs = [];
+                var names = [];
+                var ids = [];
+                for (var i = 0; i < ut.length; i++) {
+                    devs.push({
+                        label: ut[i].devname,
+                        value: ut[i].deviceid,
+                        building: ut[i].buildingname
+                    });
+                    names.push(ut[i].devname);
+                    ids.push(ut[i].deviceid);
+                }
+                mint_vue.devList = devs;
+            }
+        })
+    }
+</script>
+<style>
+    .mint-search{
+        height:50px;
+    }
+
+    .mint-searchbar{
+        padding:1px 1px 1px 1px;
+        box-sizing: border-box
+    }
+</style>
+</html>