Commit 04cca0d3 authored by sbalip's avatar sbalip

Variance report shown by place_time_ent table geopos

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@189531 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7ff2b514
...@@ -93,10 +93,13 @@ public class VarianceReportMR extends ValidatorEJB implements VarianceReportMRLo ...@@ -93,10 +93,13 @@ public class VarianceReportMR extends ValidatorEJB implements VarianceReportMRLo
"sm.chg_geopos, "+ "sm.chg_geopos, "+
"sm.geo_pos_name AS REPORTED_LOCATION, "+ "sm.geo_pos_name AS REPORTED_LOCATION, "+
"sm.chg_date AS REPORTED_DATE, "+ "sm.chg_date AS REPORTED_DATE, "+
"sm.event_time_start as REPORTED_TIME "+ "sm.event_time_start as REPORTED_TIME, "+
"pte.geo_pos as TAGGED_GEOPOS "+
"FROM strg_meet sm "+ "FROM strg_meet sm "+
"LEFT JOIN strg_customer sc "+ "LEFT JOIN strg_customer sc "+
"ON sm.strg_code=sc.sc_code, "+ "ON sm.strg_code=sc.sc_code "+
"LEFT JOIN place_time_ent pte "+
"ON sm.strg_code = pte.entity_code, "+
"sprs_route sr, "+ "sprs_route sr, "+
"employee employee LEFT OUTER JOIN "+ "employee employee LEFT OUTER JOIN "+
"org_structure emp on employee.emp_code = emp.emp_code "+ "org_structure emp on employee.emp_code = emp.emp_code "+
...@@ -170,10 +173,13 @@ public class VarianceReportMR extends ValidatorEJB implements VarianceReportMRLo ...@@ -170,10 +173,13 @@ public class VarianceReportMR extends ValidatorEJB implements VarianceReportMRLo
"sm.chg_geopos, "+ "sm.chg_geopos, "+
"sm.geo_pos_name AS REPORTED_LOCATION, "+ "sm.geo_pos_name AS REPORTED_LOCATION, "+
"sm.chg_date AS REPORTED_DATE, "+ "sm.chg_date AS REPORTED_DATE, "+
"sm.event_time_start as REPORTED_TIME "+ "sm.event_time_start as REPORTED_TIME, "+
"pte.geo_pos as TAGGED_GEOPOS "+
"FROM strg_meet sm "+ "FROM strg_meet sm "+
"LEFT JOIN strg_customer sc "+ "LEFT JOIN strg_customer sc "+
"ON sm.strg_code=sc.sc_code, "+ "ON sm.strg_code=sc.sc_code "+
"LEFT JOIN place_time_ent pte "+
"ON sm.strg_code = pte.entity_code, "+
"sprs_route sr, "+ "sprs_route sr, "+
"employee employee LEFT OUTER JOIN "+ "employee employee LEFT OUTER JOIN "+
"org_structure emp on employee.emp_code = emp.emp_code "+ "org_structure emp on employee.emp_code = emp.emp_code "+
...@@ -218,13 +224,24 @@ public class VarianceReportMR extends ValidatorEJB implements VarianceReportMRLo ...@@ -218,13 +224,24 @@ public class VarianceReportMR extends ValidatorEJB implements VarianceReportMRLo
{ {
String geo_pos = ""; String geo_pos = "";
String chg_geopos = ""; String chg_geopos = "";
String tagged_geopos = "";
JSONObject rowDataVar = new JSONObject(); JSONObject rowDataVar = new JSONObject();
geo_pos = E12GenericUtility.checkNull(mResultSet.getString("GEO_POS")); geo_pos = E12GenericUtility.checkNull(mResultSet.getString("GEO_POS"));
chg_geopos = E12GenericUtility.checkNull(mResultSet.getString("CHG_GEOPOS")); chg_geopos = E12GenericUtility.checkNull(mResultSet.getString("CHG_GEOPOS"));
if( geo_pos.trim().length() > 0 && chg_geopos.trim().length() > 0 ) tagged_geopos = E12GenericUtility.checkNull(mResultSet.getString("TAGGED_GEOPOS"));
if( ( tagged_geopos.trim().length() > 0 || geo_pos.trim().length() > 0 ) && chg_geopos.trim().length() > 0 )
{ {
double lat1 = Double.parseDouble( geo_pos.split(",")[0] ); double lat1,lng1;
double lng1 = Double.parseDouble( geo_pos.split(",")[1] ); if( tagged_geopos.trim().length() > 0 )
{
lat1 = Double.parseDouble( tagged_geopos.split(",")[0] );
lng1 = Double.parseDouble( tagged_geopos.split(",")[1] );
}
else
{
lat1 = Double.parseDouble( geo_pos.split(",")[0] );
lng1 = Double.parseDouble( geo_pos.split(",")[1] );
}
double lat2 = Double.parseDouble( chg_geopos.split(",")[0] ); double lat2 = Double.parseDouble( chg_geopos.split(",")[0] );
double lng2 = Double.parseDouble( chg_geopos.split(",")[1] ); double lng2 = Double.parseDouble( chg_geopos.split(",")[1] );
long distanceInMtrs = (long) getLatLngInMtr( lat1, lng1, lat2, lng2 ); long distanceInMtrs = (long) getLatLngInMtr( lat1, lng1, lat2, lng2 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment