Inspection is often used in workshops, communities, ships and other scenes. Bar codes are put on the key corners of these places, so that inspection personnel can scan the code “punch in” when they arrive there, so as to indicate that they have been to that place for inspection. Although many places now use IC cards or fingerprint, facial recognition to punch, but the equipment itself is expensive, the late operation and maintenance costs are not small, and need to power operation, may also be malicious damage, so during the failure can not punch.

In comparison, the cost of pasting a PVC barcode is much smaller. But this will produce another bug, that is, inspection personnel lazy to take a picture of the bar code, and then directly scan the bar code without inspection “complete” a fake inspection. How to fix this bug? In fact, you can scan the code to obtain the geographical location to solve, in addition to the general channel has a camera, scan the bar code on the photo or the scene scan the bar code will be caught, I believe that there are such concerns security can not easily muddle through.

So what happens when the bar code paper is ready? It must have a supporting system ah, when the inspection personnel scan the bar code when recording the bar code content, and time. Bar code content is a number, corresponding to each location, to arrange their own. In order to accommodate more information, qr codes can be used, such as “Building 21 west side” and “Building 36 North fire door on the roof”, thus eliminating the corresponding work of numbers and actual locations.

Inspectors scan codes and punch cards at inspection points

The system must be developed by programmers. If it is BS architecture, then there is a front end and a back end, the back end must have a database, to keep these history records.

The system model

The front end is mainly the data display, as well as a scan button, click it to call the camera to scan. In this way, the inspection work of one point for the inspection personnel is completed. The front-end code is simple:

<input type="text" id="sn">
<a href="https://www.996315.com/api/scan/">Scan</a>

<script type="text/javascript">
var qr=GetQueryString("qrresult");
if(qr){
    qr=qr.split(",") [1];
    document.all.sn.value=qr;
}
 
function GetQueryString(name){
    var reg = new RegExp("\b"+ name +"= (/ ^ & *)");
    var r = location.href.match(reg);
    if(r! =null) return decodeURIComponent(r[1]);
}
</script>
Copy the code

Just a few lines. On the back end, you submit data to the server.

The simple model