Merge pull request #57 from CPM-INDIA-SALES-AND-MARKETING-PVT-LTD/ysy_final_upload
T2P upload data newss
This commit is contained in:
Generated
+1
-1
@@ -41,7 +41,7 @@
|
||||
<ConfirmationsSetting value="0" id="Add" />
|
||||
<ConfirmationsSetting value="0" id="Remove" />
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
||||
@@ -392,7 +392,7 @@ public class MainActivity extends AppCompatActivity
|
||||
public boolean isStoreCheckedIn() {
|
||||
|
||||
boolean result_flag = true;
|
||||
for (int i = 0; i < coverageList.size(); i++) {
|
||||
/*for (int i = 0; i < coverageList.size(); i++) {
|
||||
|
||||
String status = coverageList.get(i).getStatus();
|
||||
if (status.equals(CommonString.KEY_INVALID) || status.equals(CommonString.KEY_VALID)) {
|
||||
@@ -400,7 +400,7 @@ public class MainActivity extends AppCompatActivity
|
||||
error_msg = getResources().getString(R.string.title_store_list_checkout_current);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
return result_flag;
|
||||
}
|
||||
@@ -411,9 +411,10 @@ public class MainActivity extends AppCompatActivity
|
||||
for (int i = 0; i < coverageList.size(); i++) {
|
||||
|
||||
storestatus = db.getSpecificStoreData(date, coverageList.get(i).getStoreId()).getUPLOAD_STATUS();
|
||||
String coverage_status = db.getSpecificStoreData(date, coverageList.get(i).getStoreId()).getCHECKOUT_STATUS();
|
||||
|
||||
if (!storestatus.equalsIgnoreCase(CommonString.KEY_U)) {
|
||||
if ((storestatus.equalsIgnoreCase(
|
||||
if ((coverage_status.equalsIgnoreCase(
|
||||
CommonString.KEY_C)
|
||||
|| storestatus.equalsIgnoreCase(CommonString.KEY_P) ||
|
||||
storestatus.equalsIgnoreCase(CommonString.STORE_STATUS_LEAVE))) {
|
||||
|
||||
@@ -50,6 +50,8 @@ public class CheckoutActivity extends AppCompatActivity {
|
||||
|
||||
CoverageBean coverageBean;
|
||||
|
||||
String lat,lon;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -66,9 +68,17 @@ public class CheckoutActivity extends AppCompatActivity {
|
||||
|
||||
updateResources(getApplicationContext(),preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
|
||||
String store_id = getIntent().getStringExtra(CommonString.KEY_STORE_ID);
|
||||
store_id = getIntent().getStringExtra(CommonString.KEY_STORE_ID);
|
||||
|
||||
coverageBean = db.getCoverageSpecificData(visit_date,store_id);
|
||||
lat = coverageBean.getLatitude();
|
||||
lon = coverageBean.getLongitude();
|
||||
if (lat==null || lat.equals("")){
|
||||
lat = "0.0";
|
||||
}
|
||||
if (lon==null || lon.equals("")){
|
||||
lon = "0.0";
|
||||
}
|
||||
/* FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
@@ -123,15 +133,15 @@ public class CheckoutActivity extends AppCompatActivity {
|
||||
+ "[/USER_ID]" + "[STORE_ID]"
|
||||
+ store_id
|
||||
+ "[/STORE_ID][LATITUDE]"
|
||||
+ coverageBean.getLatitude()
|
||||
+ lat
|
||||
+ "[/LATITUDE][LOGITUDE]"
|
||||
+ coverageBean.getLongitude()
|
||||
+ lon
|
||||
+ "[/LOGITUDE][CHECKOUT_DATE]"
|
||||
+ visit_date
|
||||
+ "[/CHECKOUT_DATE][CHECK_OUTTIME]"
|
||||
+ getCurrentTime()
|
||||
+ "[/CHECK_OUTTIME][CHECK_INTIME]"
|
||||
+ store_intime
|
||||
+ coverageBean.getInTime()
|
||||
+ "[/CHECK_INTIME][CREATED_BY]"
|
||||
+ username
|
||||
+ "[/CREATED_BY][/STORE_CHECK_OUT_STATUS]";
|
||||
@@ -160,6 +170,27 @@ public class CheckoutActivity extends AppCompatActivity {
|
||||
envelope);
|
||||
Object result = (Object) envelope.getResponse();
|
||||
|
||||
//temporary------------
|
||||
db.updateCheckoutOuttime(store_id, getCurrentTime());
|
||||
|
||||
SharedPreferences.Editor editor = preferences.edit();
|
||||
editor.putString(CommonString.KEY_STORE_ID, "");
|
||||
editor.putString(CommonString.KEY_STORE_NAME, "");
|
||||
editor.putString(CommonString.KEY_VISIT_DATE, "");
|
||||
editor.putString(CommonString.KEY_CAMERA_ALLOW, "");
|
||||
editor.putString(CommonString.KEY_CHECKOUT_STATUS, "");
|
||||
editor.putString(CommonString.KEY_CLASS_ID, "");
|
||||
editor.putString(CommonString.KEY_EMP_ID, "");
|
||||
editor.putString(CommonString.KEY_GEO_TAG, "");
|
||||
editor.putString(CommonString.KEY_KEYACCOUNT_ID, "");
|
||||
editor.putString(CommonString.KEY_STORETYPE_ID, "");
|
||||
editor.putString(CommonString.KEY_UPLOAD_STATUS, "");
|
||||
|
||||
editor.commit();
|
||||
|
||||
db.updateCheckoutStatus(store_id, CommonString.KEY_C);
|
||||
|
||||
|
||||
if (!result.toString().equalsIgnoreCase(
|
||||
CommonString.KEY_SUCCESS)) {
|
||||
return "Upload_Store_ChecOut_Status";
|
||||
@@ -185,7 +216,7 @@ public class CheckoutActivity extends AppCompatActivity {
|
||||
|
||||
db.updateCheckoutOuttime(store_id, getCurrentTime());
|
||||
|
||||
SharedPreferences.Editor editor = preferences.edit();
|
||||
editor = preferences.edit();
|
||||
editor.putString(CommonString.KEY_STORE_ID, "");
|
||||
editor.putString(CommonString.KEY_STORE_NAME, "");
|
||||
editor.putString(CommonString.KEY_VISIT_DATE, "");
|
||||
@@ -203,6 +234,9 @@ public class CheckoutActivity extends AppCompatActivity {
|
||||
db.updateCheckoutStatus(store_id, CommonString.KEY_C);
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
|
||||
if (result.toString().equalsIgnoreCase(
|
||||
CommonString.KEY_FALSE)) {
|
||||
return "Upload_Store_ChecOut_Status";
|
||||
|
||||
@@ -310,6 +310,7 @@ public class StoreListActivity extends AppCompatActivity {
|
||||
if (!store_id.equals(coverage.get(i).getStoreId())) {
|
||||
Snackbar.make(v, R.string.title_store_list_checkout_current, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
|
||||
enteryflag = false;
|
||||
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -343,11 +344,11 @@ public class StoreListActivity extends AppCompatActivity {
|
||||
if (CheckNetAvailability()) {
|
||||
|
||||
|
||||
/*Intent i = new Intent(StoreListActivity.this, CheckOutStoreActivity.class);
|
||||
Intent i = new Intent(StoreListActivity.this, CheckoutActivity.class);
|
||||
|
||||
intent.putExtra("storeId",store_id );
|
||||
i.putExtra(CommonString.KEY_STORE_ID,current.getSTORE_ID() );
|
||||
|
||||
startActivity(i);*/
|
||||
startActivity(i);
|
||||
} else {
|
||||
|
||||
Snackbar.make(recyclerView, R.string.nonetwork, Snackbar.LENGTH_SHORT).setAction("Action", null).show();
|
||||
|
||||
Reference in New Issue
Block a user