|
|
|
|
@ -26,6 +26,14 @@ export class WifiModalComponent implements OnInit {
|
|
|
|
|
public enableLocationWIFI: boolean;
|
|
|
|
|
public lat: number;
|
|
|
|
|
public longt: number;
|
|
|
|
|
public failedObjectWIFI = {
|
|
|
|
|
modeOfAttendance: 0,
|
|
|
|
|
messageStatus: 0,
|
|
|
|
|
transactionID: 0,
|
|
|
|
|
userID: '',
|
|
|
|
|
pointID: 0,
|
|
|
|
|
branchDescription: 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
|
public common: CommonService,
|
|
|
|
|
@ -153,25 +161,39 @@ export class WifiModalComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
this.attendance_service
|
|
|
|
|
.attendanceSwipeScanner(request, () => {
|
|
|
|
|
console.debug("Error inside in swipe attendance");
|
|
|
|
|
if (enableFirestore) {
|
|
|
|
|
this.failedObjectWIFI.userID = this.userData.EMPLOYEE_NUMBER;
|
|
|
|
|
this.attendScanService.processFirebaseDocument(isPlatformValue, this.failedObjectWIFI);
|
|
|
|
|
}
|
|
|
|
|
this.closeModal();
|
|
|
|
|
this.disconnectWifi();
|
|
|
|
|
})
|
|
|
|
|
.subscribe((result: Response) => {
|
|
|
|
|
}).subscribe((result: Response) => {
|
|
|
|
|
if (enableFirestore) {
|
|
|
|
|
this.attendScanService.processFirebaseDocument(isPlatformValue, result);
|
|
|
|
|
}
|
|
|
|
|
this.disconnectWifi();
|
|
|
|
|
// this.disconnectWifi();
|
|
|
|
|
if (this.common.validResponse(result)) {
|
|
|
|
|
this.ngZone.run(() => {
|
|
|
|
|
this.gifStatus = true;
|
|
|
|
|
});
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.closeModal();
|
|
|
|
|
// this.common.openAttenTrackingpage();
|
|
|
|
|
}, 4000);
|
|
|
|
|
}else{
|
|
|
|
|
console.debug(result);
|
|
|
|
|
if (result.MessageStatus && result.MessageStatus === 1) {
|
|
|
|
|
this.ngZone.run(() => {
|
|
|
|
|
this.gifStatus = true;
|
|
|
|
|
});
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.closeModal();
|
|
|
|
|
}, 4000);
|
|
|
|
|
this.disconnectWifi();
|
|
|
|
|
} else {
|
|
|
|
|
if (enableFirestore) {
|
|
|
|
|
this.failedObjectWIFI.userID = this.userData.EMPLOYEE_NUMBER;
|
|
|
|
|
this.attendScanService.processFirebaseDocument(isPlatformValue, this.failedObjectWIFI);
|
|
|
|
|
}
|
|
|
|
|
this.disconnectWifi();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (enableFirestore) {
|
|
|
|
|
this.failedObjectWIFI.userID = this.userData.EMPLOYEE_NUMBER;
|
|
|
|
|
this.attendScanService.processFirebaseDocument(isPlatformValue, this.failedObjectWIFI);
|
|
|
|
|
}
|
|
|
|
|
this.disconnectWifi();
|
|
|
|
|
this.closeModal();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|