Home Backend Development PHP Tutorial 【微信企业号考勤】用什么方法来判断职工在常驻办公室签到签退

【微信企业号考勤】用什么方法来判断职工在常驻办公室签到签退

Jun 13, 2016 pm 12:15 PM
cos nbsp

【微信企业号考勤】用什么方法来判断员工在常驻办公室签到签退
新手一枚,在此请教各位前辈一个问题。
最近在做微信企业号的考勤签到签退功能,现在服务器后台已经可以接收到微信用户发送过来的地理位置(经纬度),我的需求是用户只允许在常驻办公室区域(假设办公室很大,几百个平方,在这区域内都可签到签退,区域外则不允许)的地理位置进行签到签退。

获取到用户返回的经纬度后用什么办法判断其是否允许签到签退??

如果采用在数据库存储员工的办公地点地理位置信息然后与其返回的经纬度进行比较的方法判断,可这办公地点很大,地理位置信息如何存储?判断又如何判断?
------解决思路----------------------
首先!目前的地图定位误差也不算太准,好在是在公司,不管是wifi,gps定位还算准确,一般误差在100米之内,姑且最好达到50米。
1:
数据库中存储公司人员半年办公地点所处中心位置经纬度。且以改点为圆心,存储改点到所允许最大办公距离之间的距离,也就是半径了。每次用户签到或则签退,假如A,B两点,A点经度,纬度分别为λA和ΦA,B点的经度、纬度分别为λB和ΦB,d为距离。
利用如下方法:
d=111.12cos{1/[sinΦAsinΦB十 cosΦAcosΦBcos(λB-λA)]}
计算之间距离与数据库中对应用户所允许的距离(半径)比较。在半径发范围内,则允许签到签退。

2:和1类似。问题转化为,已知一个点坐标,求以该点位圆心,半径为r,圆上的所有点的坐标。
    2.1:
         选取工作人员经常办公地点中心存入数据库,计算改点距离最大允许范围的所有经纬度,存入数据库(不建议,也不科学,数据量大了吃不消。)。
   2.2:
      。求得是矩形的四个点存入数据库。用户在签到签退的时候比较数据库中的值。
      希望这篇文章帮得到你http://digdeeply.org/archives/06152067.html

建议2.2方法。

误差肯定是有的。



给点分吧

------解决思路----------------------
范围小就定个中心点,判断半径呗.
不过有时候不准,不好解决啊

想问的是除了经纬度能搞到网络状态么?
或者提交时候的ip是公司外网/内网ip就可以签到之类
------解决思路----------------------

引用:
首先!目前的地图定位误差也不算太准,好在是在公司,不管是wifi,gps定位还算准确,一般误差在100米之内,姑且最好达到50米。
1:
数据库中存储公司人员半年办公地点所处中心位置经纬度。且以改点为圆心,存储改点到所允许最大办公距离之间的距离,也就是半径了。每次用户签到或则签退,假如A,B两点,A点经度,纬度分别为λA和ΦA,B点的经度、纬度分别为λB和ΦB,d为距离。
利用如下方法:
d=111.12cos{1/[sinΦAsinΦB十 cosΦAcosΦBcos(λB-λA)]}
计算之间距离与数据库中对应用户所允许的距离(半径)比较。在半径发范围内,则允许签到签退。

2:和1类似。问题转化为,已知一个点坐标,求以该点位圆心,半径为r,圆上的所有点的坐标。
    2.1:
         选取工作人员经常办公地点中心存入数据库,计算改点距离最大允许范围的所有经纬度,存入数据库(不建议,也不科学,数据量大了吃不消。)。
   2.2:
      。求得是矩形的四个点存入数据库。用户在签到签退的时候比较数据库中的值。
      希望这篇文章帮得到你http://digdeeply.org/archives/06152067.html

建议2.2方法。

误差肯定是有的。



给点分吧
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Roblox: Bubble Gum Simulator Infinity - How To Get And Use Royal Keys
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Nordhold: Fusion System, Explained
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1664
14
PHP Tutorial
1269
29
C# Tutorial
1248
24
Four ways to implement multithreading in C language Four ways to implement multithreading in C language Apr 03, 2025 pm 03:00 PM

Multithreading in the language can greatly improve program efficiency. There are four main ways to implement multithreading in C language: Create independent processes: Create multiple independently running processes, each process has its own memory space. Pseudo-multithreading: Create multiple execution streams in a process that share the same memory space and execute alternately. Multi-threaded library: Use multi-threaded libraries such as pthreads to create and manage threads, providing rich thread operation functions. Coroutine: A lightweight multi-threaded implementation that divides tasks into small subtasks and executes them in turn.

How to use CSS3 and JavaScript to achieve the effect of scattering and enlarging the surrounding pictures after clicking? How to use CSS3 and JavaScript to achieve the effect of scattering and enlarging the surrounding pictures after clicking? Apr 05, 2025 am 06:15 AM

To achieve the effect of scattering and enlarging the surrounding images after clicking on the image, many web designs need to achieve an interactive effect: click on a certain image to make the surrounding...

How to view the results after Bootstrap is modified How to view the results after Bootstrap is modified Apr 07, 2025 am 10:03 AM

Steps to view modified Bootstrap results: Open the HTML file directly in the browser to ensure that the Bootstrap file is referenced correctly. Clear the browser cache (Ctrl Shift R). If you use CDN, you can directly modify CSS in the developer tool to view the effects in real time. If you modify the Bootstrap source code, download and replace the local file, or rerun the build command using a build tool such as Webpack.

How to copy and paste mysql How to copy and paste mysql Apr 08, 2025 pm 07:18 PM

Copy and paste in MySQL includes the following steps: select the data, copy with Ctrl C (Windows) or Cmd C (Mac); right-click at the target location, select Paste or use Ctrl V (Windows) or Cmd V (Mac); the copied data is inserted into the target location, or replace existing data (depending on whether the data already exists at the target location).

How to download okx trading platform How to download okx trading platform Mar 26, 2025 pm 05:18 PM

The OKX trading platform can be downloaded through mobile devices (Android and iOS) and computers (Windows and macOS). 1. Android users can download it from the official website or Google Play, and they need to pay attention to security settings. 2. iOS users can download it through the App Store or follow the official announcement to obtain other methods. 3. Computer users can download the client of the corresponding system from the official website. Always make sure to use official channels when downloading, and register, log in and security settings after installation.

What is the reason why the Python process pool handles concurrent TCP requests and causes the client to get stuck? What is the reason why the Python process pool handles concurrent TCP requests and causes the client to get stuck? Apr 01, 2025 pm 04:09 PM

Python process pool handles concurrent TCP requests that cause client to get stuck. When using Python for network programming, it is crucial to efficiently handle concurrent TCP requests. ...

What is the C# programming language? What is the C# programming language? Apr 03, 2025 pm 04:15 PM

Originally known as Cool, C# was invented by Anders Hejlsberg of Microsoft and launched in July 2000. C# is designed from scratch and is suitable for managed and embedded systems. For example, C# can run both on desktop computers and on IoT developers

How to configure apscheduler timing task as a service on macOS? How to configure apscheduler timing task as a service on macOS? Apr 01, 2025 pm 06:09 PM

Configure the apscheduler timing task as a service on macOS platform, if you want to configure the apscheduler timing task as a service, similar to ngin...

See all articles