刘琳琳 3 місяців тому
батько
коміт
6eea795457

+ 3 - 0
app.js

@@ -331,6 +331,8 @@ App({
       this.data.userInfo.phone = res.data.phone
       this.data.userInfo.visitorUnit = res.data.workPlace
       this.data.userInfo.carnum = res.data.carNumber
+      this.data.userInfo.verifyType = 6; // 二维码
+      this.data.userInfo.certContent = res.data; // 身份证阅读器返回全部
       let reminderAuth = this.globalData.snDisposition.reminderAuth;
       // 是否跳转到提示页
       if (reminderAuth) {
@@ -394,6 +396,7 @@ App({
       zfbQrcodeUrl: "https://tx.hz-hanghui.com:8088/yx-fyzd/faceCheckVisitor?type=2",
       visiteeUrl: "https://tx.hz-hanghui.com:8088/yx-fyzd/api/v1/fkj/visitee/list",
       areaUrl: "https://tx.hz-hanghui.com:8088/yx-fyzd/api/v1/fkj/area/info",
+      transitPushSwitch: true, // 启用进出记录推送 默认值:true
       transitPushUrl: "https://tx.hz-hanghui.com:8088/yx-fyzd/visitorReport",
       printVisitorList: false,
       signOut: true,

+ 2 - 0
pages/home/index.js

@@ -86,6 +86,8 @@ Page({
     app.data.userInfo.idCardPhoto = ''
     app.data.userInfo.workPlace = ''
     app.data.userInfo.carNumber = ''
+    app.data.userInfo.verifyType = 1;
+    app.data.userInfo.certContent = '';
     app.globalData.signOffQrcodeUrl = ''
     app.globalData.ethQrcodeUrl = ''
     app.globalData.gateGrcodeUrl = ''

+ 1 - 1
pages/inputPhone/index.js

@@ -76,7 +76,7 @@ Page({
     if (!app.data.userInfo.xm) {
       this.backToSpecifiedPage('/pages/resultPage/index?result=联网查询')
     } else {
-      this.backToSpecifiedPage('/pages/resultPage/index?result=1:1比对')
+      this.backToSpecifiedPage('/pages/resultPage/index?result=1:1比对&type=手输1:1')
     }
   },
   saveRef(ref){

+ 100 - 44
pages/interviewee/index.js

@@ -2,7 +2,7 @@ import {
   visiteeList,
   threeElements,
   configList,
-  riskQuery,
+  riskQuery, areaInfo,
 } from '../../utils/api/api'
 import {
   getWaterDrop,
@@ -170,7 +170,7 @@ Page({
   onLoad() {
     my.hideBackHome();
     const _this = this
-    this.initScreenType().then(isPortraitScreenRes=>{
+    this.initScreenType().then(isPortraitScreenRes => {
       console.log('isPortraitScreenRes', isPortraitScreenRes)
       _this.setData({
         isPortraitScreen: isPortraitScreenRes
@@ -204,7 +204,7 @@ Page({
   },
   initScreenType() {
     let that = this
-    return new Promise((resolve,reject) => {
+    return new Promise((resolve, reject) => {
       if (app.globalData.isPortraitScreen) {
         if (app.globalData.isPortraitScreen != null) {
           resolve(app.globalData.isPortraitScreen)
@@ -540,50 +540,106 @@ Page({
       carnum
     } = this.data
     console.log(
-        'remainingInfo',
-        remainingInfo)
+      'remainingInfo',
+      remainingInfo)
     console.log(
-        'intervieweeForm',
-        intervieweeForm)
+      'intervieweeForm',
+      intervieweeForm)
     let form = Object.assign({}, remainingInfo, intervieweeForm);
     console.log(form)
     form.carnum = carnum
     form.visitingTime = getDate()
     app.data.visitoMsgData = form
-    let data = {
-      "reason": form.causeMatterName,
-      "num_peoples": form.peopleNum, //人数
-      "machine_id": app.globalData.sn,
-      "xm": form.visitorName,
-      "sfzh": form.visitorIdCard,
-      "phone": form.visitorPhone,
-      // "xm": '张佳燕',
-      // "sfzh": '331082199910045826',
-      // "phone": '15888632412',
-      "company": form.visitorUnit,
-      "carno": form.carnum,
-      "visitee_xm": form.name, //受访人姓名
-      "visitee_bm": form.unitName,
-      "visitee_company": form.company,
-      "visitee_room": form.room,
-      "visiteePhone": intervieweeForm.phone,
-      "visitee_floor": form.floor,
-      xp: app.data.userInfo.idCardPhoto,
-      scene_xp: app.data.userInfo.avatar,
-      time: form.visitingTime,
-    }
-    console.log('data', data)
-    let url = app.globalData.snDisposition.transitPushUrl
-    try {
-      let res = await threeElements(url, data)
-      console.log('commonQrCode', res.data.commonQrCode);
-      console.log('ladderQrCode', res.data.ladderQrCode);
-      app.data.visitoMsgData.commonQrCode = res.data.commonQrCode
-      app.data.visitoMsgData.ladderQrCode = res.data.ladderQrCode
+
+    // 启用进出记录推送
+    let transitPushSwitch = app.globalData.snDisposition.transitPushSwitch
+    if (transitPushSwitch) {
+      // 获取辖区配置
+      let areaRes = await areaInfo({
+        sn: app.globalData.sn,
+      }).data || {}
+      /*let data = {
+        "reason": form.causeMatterName,
+        "num_peoples": form.peopleNum, //人数
+        "machine_id": app.globalData.sn,
+        "xm": form.visitorName,
+        "sfzh": form.visitorIdCard,
+        "phone": form.visitorPhone,
+        // "xm": '张佳燕',
+        // "sfzh": '331082199910045826',
+        // "phone": '15888632412',
+        "company": form.visitorUnit,
+        "carno": form.carnum,
+        "visitee_xm": form.name, //受访人姓名
+        "visitee_bm": form.unitName,
+        "visitee_company": form.company,
+        "visitee_room": form.room,
+        "visiteePhone": intervieweeForm.phone,
+        "visitee_floor": form.floor,
+        xp: app.data.userInfo.idCardPhoto,
+        scene_xp: app.data.userInfo.avatar,
+        time: form.visitingTime,
+      }
+      console.log('data', data)*/
+      console.log(JSON.stringify(areaRes))
+      let newPushData = {
+        "appType": "HHVisit",
+        "recordid": 0, // 没有
+        "sn": app.globalData.sn,
+        "adminId": null, // 没有
+        "pcsname": areaRes.policeStationName || '', // 所属辖区派出所名称
+        "pcsdm": areaRes.policeStationCode || '', // 所属辖区派出所代码
+        "provinceName": areaRes.provinceName || '', // 所属省份
+        "cityName": areaRes.cityName || '', // 所属城市
+        "areaName": areaRes.areaName || '', // 所属区/县
+        "streetName": areaRes.streetName || '', // 街道/乡/镇
+        "address": areaRes.address || '', // 详细地址
+        "deviceAddress": areaRes.deviceAddress || '', // 设备地点
+        "outType": 1, // 服务端设备所属进出口:  0 通用 1进门 2出门
+        "status": true,// 人员进入是否有效: true 有效 false 无效
+        "reasonType": null,// 无效原因: 1 未成年人禁止进入 2 黑名单
+        "userId": 0,// 服务端用户id
+        "verifyType": app.data.userInfo.verifyType,// todo 识别类型
+        "certName": form.visitorName, // 用户姓名
+        "certNo": form.visitorIdCard, // 用户证件号
+        "certContent": JSON.stringify(app.data.userInfo.certContent || '') || '', // 身份证阅读器返回全部 todo
+        "phone": form.visitorPhone, // 用户手机号
+        "cardidex": null, // 用户卡号
+        "photo": app.data.userInfo.avatar, // 用户现场照片
+        "originPhoto": '', // 比对源照片url todo
+        "originPhotoBase64": app.data.userInfo.idCardPhoto, // 比对源照片base64 todo
+        "verifyScore": null, // 人脸比对分值: 0-100 todo
+        "company": form.visitorUnit, // 用户单位名称
+        "carno": form.carnum, // 用户车牌号
+        "reason": form.causeMatterName, // 拜访事由
+        "time": form.visitingTime, // 刷脸时间
+        "visiteeXm": form.name, //受访人姓名
+        "visiteePhone": intervieweeForm.phone, // 受访人手机号
+        "visiteeCompany": form.company, // 受访人单位
+        "visiteeBm": form.unitName, // 受访人部门
+        "visiteeFloor": form.floor, // 受访人所在楼层
+        "visiteeRoom": form.room, // 受访人所在房间号
+        "startTime": null, // 有效期开始时间
+        "endTime": null, // 有效期结束时间
+        "event": 1 // 事件类型: 1 登记 2 签离
+      }
+      console.log(JSON.stringify(newPushData))
+      let url = app.globalData.snDisposition.transitPushUrl
+      try {
+        // 进出记录推送
+        let res = await threeElements(url, newPushData)
+        console.log('commonQrCode', res.data.commonQrCode);
+        console.log('ladderQrCode', res.data.ladderQrCode);
+        app.data.visitoMsgData.commonQrCode = res.data.commonQrCode
+        app.data.visitoMsgData.ladderQrCode = res.data.ladderQrCode
+        this.backToSpecifiedPage('/pages/resultPage/index?result=登记成功')
+        viceBroadcast(app.globalData.snDisposition.registerSuccessVoice)
+      } catch (error) {
+        this.backToSpecifiedPage('/pages/resultPage/index?result=登记失败')
+      }
+    } else {
       this.backToSpecifiedPage('/pages/resultPage/index?result=登记成功')
       viceBroadcast(app.globalData.snDisposition.registerSuccessVoice)
-    } catch (error) {
-      this.backToSpecifiedPage('/pages/resultPage/index?result=登记失败')
     }
   },
   closeCanNot() {
@@ -786,8 +842,8 @@ Page({
   closeSecondaryScreenFuc() {
     console.log('关闭副屏', app.data.isSecondaryScreenState)
     if (app.data.isSecondaryScreenState) {
-        closeSecondaryScreen()
-        // closeCycleSecondaryScreen()
+      closeSecondaryScreen()
+      // closeCycleSecondaryScreen()
     }
   },
   // 键盘函数结束
@@ -803,7 +859,7 @@ Page({
     my.reLaunch({
       url: url,
     })
-    setTimeout(()=> {
+    setTimeout(() => {
       this.closeSecondaryScreenFuc();
     }, 500)
   },
@@ -821,7 +877,7 @@ Page({
         if (url) {
           openSecondaryScreen(url)
         }
-        setTimeout(()=> {
+        setTimeout(() => {
           this.toTitleRef && this.toTitleRef.clearIntervalAll()
           my.reLaunch({
             url: '/pages/home/index',
@@ -833,7 +889,7 @@ Page({
         if (url) {
           openSecondaryScreen(url)
         }
-        setTimeout(()=> {
+        setTimeout(() => {
           this.toTitleRef && this.toTitleRef.clearIntervalAll()
           my.reLaunch({
             url: '/pages/home/index',

+ 40 - 15
pages/resultPage/index.js

@@ -58,11 +58,24 @@ Page({
       this.clickFaceScan()
       return;
     } else if (resultTag == '1:1比对') {
+      console.log(e.type)
+      let verifyType = 1;
+      switch (e.type) {
+        case '身份证1:1':
+          verifyType = 3;
+          break;
+        case '手输1:1':
+          verifyType = 15;
+          break;
+      }
       this.setData({
         showFaceScan: true,
         timer: app.globalData.snDisposition.oneToOneTimeout
       })
-      this.getFaceInfoPersonCard(app.data.brushingCardUserIInfo)
+      this.getFaceInfoPersonCard({
+        brushingCardUserIInfo: app.data.brushingCardUserIInfo,
+        verifyType
+      })
       return;
     } else if (resultTag == '联网查询') {
       console.log('联网查询');
@@ -86,9 +99,12 @@ Page({
         //  是否人证比对
         if (app.globalData.snDisposition.usePersonCard) {
           console.log('1:1比对-首页刷证');
-          _this.backToSpecifiedPage('/pages/resultPage/index?result=1:1比对')
+          _this.backToSpecifiedPage('/pages/resultPage/index?result=1:1比对&type=身份证1:1')
         } else {
-          _this.getUserInfo(app.data.brushingCardUserIInfo)
+          _this.getUserInfo({
+            brushingCardUserIInfo: app.data.brushingCardUserIInfo,
+            verifyType: 4  // 身份证
+          })
         }
       }, 1000)
       return;
@@ -147,6 +163,8 @@ Page({
             sfzh: res.data.idNum,
             phone: res.data.mobile,
             avatar: res.data.photoBase64,
+            verifyType: 2, // 支付宝人脸
+            certContent: res.data // 身份证阅读器返回全部
           }
           app.data.userInfo = form
           viceBroadcast(app.globalData.snDisposition.successVoice)
@@ -230,7 +248,7 @@ Page({
       }
       app.data.brushingCardUserIInfo = form
       console.log('1:1比对-联网查询', val);
-      that.backToSpecifiedPage('/pages/resultPage/index?result=1:1比对')
+      that.backToSpecifiedPage('/pages/resultPage/index?result=1:1比对&type=手输1:1')
     } else {
       setTimeout(function () {
         // 捕获到联网查询错误,跳转到重试页面
@@ -278,10 +296,8 @@ Page({
       let decrypted = JSON.parse(decryptedData.decrypted)
       app.data.userInfo = decrypted
       app.data.userInfo.avatar = decrypted.xp
-      // this.handleValue(app.data.userInfo.xm)
     } catch (error) {
       app.data.isNetworkQueryError = false
-      // this.handleValue(app.data.userInfo.xm)
     }
   },
 
@@ -299,15 +315,18 @@ Page({
     })
   },
   // 1:1比对
-  getFaceInfoPersonCard(form) {
+  getFaceInfoPersonCard({
+                          brushingCardUserIInfo,
+                          verifyType // 识别类型
+                        }) {
     let params1 = {
       "action": "getFaceInfoPersonCard",
       "event": "open",
       "taskId": "7",
       "params": {
-        "certName": form.name,
-        "certNo": form.idNum,
-        "certPhotoBase64Str": form.photoBase64
+        "certName": brushingCardUserIInfo.name,
+        "certNo": brushingCardUserIInfo.idNum,
+        "certPhotoBase64Str": brushingCardUserIInfo.photoBase64
       }
     }
     let that = this
@@ -319,7 +338,10 @@ Page({
           showFaceScan: false
         })
         if (res.success) {
-          that.getUserInfo(res.data)
+          that.getUserInfo({
+            brushingCardUserIInfo: res.data,
+            verifyType
+          })
         } else {
           if (!res.data || !res.data.originFaceInfo) {
             that.backToSpecifiedPage('/pages/resultPage/index?result=结果页超时&&timer=' + app.globalData.snDisposition.resultPageTimeout)
@@ -346,10 +368,13 @@ Page({
     }
   },
   // 用户信息赋值
-  getUserInfo(data) {
-    app.data.userInfo.avatar = data.photoBase64 || '';
-    app.data.userInfo.xm = data.name;
-    app.data.userInfo.sfzh = data.idNum;
+  getUserInfo({brushingCardUserIInfo, verifyType}) {
+    console.log('用户信息赋值', brushingCardUserIInfo, verifyType)
+    app.data.userInfo.avatar = brushingCardUserIInfo.photoBase64 || '';
+    app.data.userInfo.xm = brushingCardUserIInfo.name;
+    app.data.userInfo.sfzh = brushingCardUserIInfo.idNum;
+    app.data.userInfo.verifyType = verifyType;
+    app.data.userInfo.certContent = brushingCardUserIInfo; // 身份证阅读器返回全部
     // 是否跳转到提示页
     let reminderAuth = app.globalData.snDisposition.reminderAuth;
     if (reminderAuth) {

+ 1 - 1
pages/settings/advanced/index.axml

@@ -171,7 +171,7 @@
       </view>
 
 
-      <view class="form-box wid">
+      <view class="form-box wid" a:if="{{form.transitPushSwitch}}">
         <text>访客记录推送地址</text>
         <input
           class="form-input"

+ 1 - 1
utils/api/api.js

@@ -3,7 +3,7 @@ const {
   threeElementsRequest
 } = require("../func/request");
 
-// let path = 'http://192.168.8.21:9100/yx-fyzd'
+// let path = 'http://192.168.77.14:9100/yx-fyzd'
 // let path = 'https://test.hz-hanghui.com:18890/yx-fyzd'
 let path = 'https://tx.hz-hanghui.com:8088/yx-fyzd'
 // let platform = 'http://192.168.77.19:8081/hanghui-server-platform'