Subversion Repositories SmartDukaan

Rev

Rev 27498 | Rev 27500 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 27498 Rev 27499
Line 120... Line 120...
120
		Request request1 = new Request.Builder()
120
		Request request1 = new Request.Builder()
121
				.url("https://v3.api.hypertrack.com/devices/" + hyperTrackKey.getHypertrackKeyId()).get()
121
				.url("https://v3.api.hypertrack.com/devices/" + hyperTrackKey.getHypertrackKeyId()).get()
122
				.addHeader("Authorization", authString).build();
122
				.addHeader("Authorization", authString).build();
123
 
123
 
124
		Response response = client.newCall(request1).execute();
124
		Response response = client.newCall(request1).execute();
125
		LOGGER.info("employeeAttendance" + employeeAttendances);
-
 
126
		JSONObject jsonObj = new JSONObject(response.body().string());
125
		JSONObject jsonObj = new JSONObject(response.body().string());
127
		JSONObject c = jsonObj.getJSONObject("location");
126
		JSONObject c = jsonObj.getJSONObject("location");
128
		JSONObject d = c.getJSONObject("geometry");
127
		JSONObject d = c.getJSONObject("geometry");
129
		JSONArray coords = d.getJSONArray("coordinates");
128
		JSONArray coords = d.getJSONArray("coordinates");
130
 
129
 
131
		double lat2 = coords.getDouble(1);
130
		double lat2 = coords.getDouble(1);
132
		double lng2 = coords.getDouble(0);
131
		double lng2 = coords.getDouble(0);
133
		double dist = distance(lat1, lng1, lat2, lng2, "m");
132
		double dist = distance(lat1, lng1, lat2, lng2, "m");
134
 
-
 
-
 
133
		LOGGER.info("employeeAttendance" + response.body().string());
135
		JSONObject deviceStatus = jsonObj.getJSONObject("device_status");
134
		JSONObject deviceStatus = jsonObj.getJSONObject("device_status");
136
		JSONObject deviceData = deviceStatus.getJSONObject("data");
135
		JSONObject deviceData = deviceStatus.getJSONObject("data");
137
		String status = deviceData.getString("value");
136
		String status = deviceData.getString("value");
138
 
137
 
139
		EmployeeAttendanceModel em = new EmployeeAttendanceModel();
138
		EmployeeAttendanceModel em = new EmployeeAttendanceModel();