fixed wifi issue

MOHEMM-Q3-DEV-LATEST
umasoodch 4 years ago
parent 7f0b90bf6f
commit d2045776ba

@ -70,9 +70,16 @@ export class HMGUtils {
const location = _res.split(',') const location = _res.split(',')
console.log(location); console.log(location);
if (location.length == 3) { if (location.length == 3) {
let mock = false;
const lat = Number(_res.split(',')[0]); const lat = Number(_res.split(',')[0]);
const long = Number(_res.split(',')[1]); const long = Number(_res.split(',')[1]);
const mock = Boolean(_res.split(',')[2]); const mockValue = _res.split(',')[2];
if (mockValue == 'true') {
mock = true;
} else {
mock = false;
}
callBack({"latitude":lat, "longitude":long, "isfake":mock}) callBack({"latitude":lat, "longitude":long, "isfake":mock})
} else { } else {
this.common.presentAlert(this.ts.trPK('general', 'invalid-huawei-location')); this.common.presentAlert(this.ts.trPK('general', 'invalid-huawei-location'));

@ -27,8 +27,8 @@ export class ConnectorService {
public static retryTimes = 0; public static retryTimes = 0;
public static timeOut = 120 * 1000; public static timeOut = 120 * 1000;
public static host = 'https://uat.hmgwebservices.com/'; // public static host = 'https://uat.hmgwebservices.com/';
// public static host = 'https://hmgwebservices.com/'; public static host = 'https://hmgwebservices.com/';
constructor(public httpClient: HttpClient, constructor(public httpClient: HttpClient,
public cs: CommonService, public cs: CommonService,

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

Loading…
Cancel
Save