Fix: Fingerprint now checked and is working
Version bump: v8.2.3
This commit is contained in:
@ -1 +1 @@
|
|||||||
__version__ = "8.2.2"
|
__version__ = "8.2.3"
|
||||||
|
|||||||
@ -42,7 +42,7 @@ def upload_prints(
|
|||||||
for id_, code in db.query(Employee.id, Employee.code).all():
|
for id_, code in db.query(Employee.id, Employee.code).all():
|
||||||
employees[code] = id_
|
employees[code] = id_
|
||||||
file_data = read_file(fingerprints)
|
file_data = read_file(fingerprints)
|
||||||
prints = [d for d in fp(file_data, employees) if start <= d["date"] <= finish]
|
prints = [d for d in fp(file_data, employees) if start <= d["date"].date() <= finish]
|
||||||
paged_data = [prints[i : i + 100] for i in range(0, len(prints), 100)]
|
paged_data = [prints[i : i + 100] for i in range(0, len(prints), 100)]
|
||||||
for i, page in enumerate(paged_data):
|
for i, page in enumerate(paged_data):
|
||||||
print(f"Processing page {i} of {len(paged_data)}")
|
print(f"Processing page {i} of {len(paged_data)}")
|
||||||
@ -50,9 +50,9 @@ def upload_prints(
|
|||||||
pg_insert(Fingerprint)
|
pg_insert(Fingerprint)
|
||||||
.values(
|
.values(
|
||||||
{
|
{
|
||||||
"FingerprintID": bindparam("id"),
|
"id": bindparam("id"),
|
||||||
"EmployeeID": bindparam("employee_id"),
|
"employee_id": bindparam("employee_id"),
|
||||||
"Date": bindparam("date"),
|
"date": bindparam("date"),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.on_conflict_do_nothing(),
|
.on_conflict_do_nothing(),
|
||||||
@ -72,10 +72,10 @@ def upload_prints(
|
|||||||
|
|
||||||
|
|
||||||
def read_file(input_file: UploadFile):
|
def read_file(input_file: UploadFile):
|
||||||
input_file.seek(0)
|
input_file.file.seek(0)
|
||||||
output = bytearray()
|
output = bytearray()
|
||||||
while 1:
|
while 1:
|
||||||
data = input_file.read(2 << 16)
|
data = input_file.file.read(2 << 16)
|
||||||
if not data:
|
if not data:
|
||||||
break
|
break
|
||||||
output.extend(data)
|
output.extend(data)
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "brewman"
|
name = "brewman"
|
||||||
version = "8.2.2"
|
version = "8.2.3"
|
||||||
description = "Accounting plus inventory management for a restaurant."
|
description = "Accounting plus inventory management for a restaurant."
|
||||||
authors = ["tanshu <git@tanshu.com>"]
|
authors = ["tanshu <git@tanshu.com>"]
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "overlord",
|
"name": "overlord",
|
||||||
"version": "8.2.2",
|
"version": "8.2.3",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"ng": "ng",
|
"ng": "ng",
|
||||||
"start": "ng serve",
|
"start": "ng serve",
|
||||||
|
|||||||
@ -21,7 +21,7 @@ export class EmployeeFunctionsService {
|
|||||||
uploadFingerprints(fingerprintFile: File): Observable<boolean> {
|
uploadFingerprints(fingerprintFile: File): Observable<boolean> {
|
||||||
const url = '/api/fingerprint';
|
const url = '/api/fingerprint';
|
||||||
const fd = new FormData();
|
const fd = new FormData();
|
||||||
fd.append('uploadedFile', fingerprintFile);
|
fd.append('fingerprints', fingerprintFile);
|
||||||
return <Observable<boolean>>(
|
return <Observable<boolean>>(
|
||||||
this.http
|
this.http
|
||||||
.post<boolean>(url, fd)
|
.post<boolean>(url, fd)
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
export const environment = {
|
export const environment = {
|
||||||
production: true,
|
production: true,
|
||||||
ACCESS_TOKEN_REFRESH_MINUTES: 10, // refresh token 10 minutes before expiry
|
ACCESS_TOKEN_REFRESH_MINUTES: 10, // refresh token 10 minutes before expiry
|
||||||
version: '8.2.2',
|
version: '8.2.3',
|
||||||
};
|
};
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
export const environment = {
|
export const environment = {
|
||||||
production: false,
|
production: false,
|
||||||
ACCESS_TOKEN_REFRESH_MINUTES: 10, // refresh token 10 minutes before expiry
|
ACCESS_TOKEN_REFRESH_MINUTES: 10, // refresh token 10 minutes before expiry
|
||||||
version: '8.2.2',
|
version: '8.2.3',
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user