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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
1 months 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)

How to update the latest version of Bybit Exchange? Will there be any impact if it is not updated? How to update the latest version of Bybit Exchange? Will there be any impact if it is not updated? Feb 21, 2025 pm 10:54 PM

The way to update ByBit exchanges varies by platform and device: Mobile: Check for updates and install in the app store. Desktop Client: Check for updates in the Help menu and install automatically. Web page: You need to manually access the official website for updates. Failure to update the exchange can lead to security vulnerabilities, functional limitations, compatibility issues and reduced transaction execution efficiency.

BITGet official website installation (2025 beginner's guide) BITGet official website installation (2025 beginner's guide) Feb 21, 2025 pm 08:42 PM

BITGet is a cryptocurrency exchange that provides a variety of trading services including spot trading, contract trading and derivatives. Founded in 2018, the exchange is headquartered in Singapore and is committed to providing users with a safe and reliable trading platform. BITGet offers a variety of trading pairs, including BTC/USDT, ETH/USDT and XRP/USDT. Additionally, the exchange has a reputation for security and liquidity and offers a variety of features such as premium order types, leveraged trading and 24/7 customer support.

Coinsuper exchange software channel official website entrance Coinsuper exchange software channel official website entrance Feb 21, 2025 pm 10:39 PM

The official website entrance of the Coinsuper Exchange: https://www.coinsuper.com. The client download channels are: Windows client, macOS client, and mobile (iOS/Android). Registration requires an email, mobile phone number and password, and you need to complete real-name authentication before you can trade. The platform provides a variety of digital asset transactions, including Bitcoin, Ethereum, etc., with the transaction fee rate of 0.1% for both orders and acceptors. Security safeguards include cold wallet storage, dual-factor verification, anti-money laundering and anti-terrorism financing measures, and with security public

Ouyi okx installation package is directly included Ouyi okx installation package is directly included Feb 21, 2025 pm 08:00 PM

Ouyi OKX, the world's leading digital asset exchange, has now launched an official installation package to provide a safe and convenient trading experience. The OKX installation package of Ouyi does not need to be accessed through a browser. It can directly install independent applications on the device, creating a stable and efficient trading platform for users. The installation process is simple and easy to understand. Users only need to download the latest version of the installation package and follow the prompts to complete the installation step by step.

Ouyi Exchange Download Official Portal Ouyi Exchange Download Official Portal Feb 21, 2025 pm 07:51 PM

Ouyi, also known as OKX, is a world-leading cryptocurrency trading platform. The article provides a download portal for Ouyi's official installation package, which facilitates users to install Ouyi client on different devices. This installation package supports Windows, Mac, Android and iOS systems. Users can choose the corresponding version to download according to their device type. After the installation is completed, users can register or log in to the Ouyi account, start trading cryptocurrencies and enjoy other services provided by the platform.

Why are top venture capitalists like Pantera betting on Altius? Revealing the secret of how the modular execution layer cracks the performance bottleneck of blockchain Why are top venture capitalists like Pantera betting on Altius? Revealing the secret of how the modular execution layer cracks the performance bottleneck of blockchain Mar 04, 2025 pm 06:30 PM

Altius, a crypto startup, recently announced a $11 million financing round led by FoundersFund and Pantera Capital. It is remarkable that Altius only posted one tweet before the announcement of the financing news, which added a sense of mystery to it. What exactly attracts top venture capital institutions such as Pantera Capital? The answer lies in Altius' innovative reshaping of the blockchain execution layer. Altius is not a traditional single public chain project. It is committed to building a modular, plug-and-play execution layer solution - AltiusStack. This solution can be seamlessly integrated with any public chain using virtual machine (VM) mechanism

Mocaverse floor price exceeded 2.9ETH, with an increase of up to 79% in 24 hours! NFT warming up? Mocaverse floor price exceeded 2.9ETH, with an increase of up to 79% in 24 hours! NFT warming up? Mar 05, 2025 pm 02:48 PM

Signs of recovery in the NFT market! Mocaverse floor price soared, with a 24-hour increase of up to 79%. According to OpenSea data, the floor price of the well-known NFT project Mocaverse has recently exceeded 2.9ETH, and the current price is 2.96ETH (approximately US$11,860), with an astonishing 24-hour increase of 79%, reaching a maximum of 3.49ETH. This significant growth has attracted widespread attention from the market. Will the NFT market return to its bull market? Mocaverse Floor Price Chart NFT sector leads the crypto market Coingecko data shows that the overall crypto market has risen in the past 24 hours, while the NFT sector tops the list with an increase of 8.53%. Some projects are particularly good

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.

See all articles