Merge pull request #57 from CPM-INDIA-SALES-AND-MARKETING-PVT-LTD/SouthAfrica_YSY
South africa ysy
This commit is contained in:
Generated
+1
@@ -9,6 +9,7 @@
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/GSKMTOrange" />
|
||||
<option value="$PROJECT_DIR$/library" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveModulePerSourceSet" value="false" />
|
||||
|
||||
Generated
+1
@@ -4,6 +4,7 @@
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/GSKMTOrange/GSKMTOrange.iml" filepath="$PROJECT_DIR$/GSKMTOrange/GSKMTOrange.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/GSKORANGEV2.iml" filepath="$PROJECT_DIR$/GSKORANGEV2.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/library/library.iml" filepath="$PROJECT_DIR$/library/library.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
+24
-19
@@ -21,20 +21,24 @@ android {
|
||||
targetSdkVersion 22
|
||||
|
||||
//For Egypt
|
||||
/* versionCode 14
|
||||
versionName "2.6"*/
|
||||
/*versionCode 21
|
||||
versionName "3.3"*/
|
||||
|
||||
//For UAE
|
||||
versionCode 18
|
||||
versionName "3.0"
|
||||
/*versionCode 18
|
||||
versionName "3.0"*/
|
||||
|
||||
//For Turkey
|
||||
/* versionCode 15
|
||||
versionName "2.7"*/
|
||||
/*versionCode 21
|
||||
versionName "3.3"*/
|
||||
|
||||
//For KSA
|
||||
/* versionCode 18
|
||||
versionName "3.0"*/
|
||||
/*versionCode 22
|
||||
versionName "3.4"*/
|
||||
|
||||
//For SA
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
|
||||
multiDexEnabled true
|
||||
@@ -53,9 +57,9 @@ dependencies {
|
||||
|
||||
//implementation 'com.google.firebase:firebase-crash:11.8.0'
|
||||
implementation 'com.google.firebase:firebase-messaging:11.8.0'
|
||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||
compile files('libs/ksoap2-android-assembly-3.6.2-jar-with-dependencies.jar')
|
||||
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation files('libs/ksoap2-android-assembly-3.6.2-jar-with-dependencies.jar')
|
||||
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
|
||||
exclude group: 'com.android.support', module: 'support-annotations'
|
||||
})
|
||||
|
||||
@@ -65,21 +69,22 @@ dependencies {
|
||||
implementation 'com.android.support:cardview-v7:26.1.0'
|
||||
implementation 'com.android.support:recyclerview-v7:26.1.0'
|
||||
|
||||
compile 'com.google.code.gson:gson:2.7'
|
||||
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha4'
|
||||
implementation 'com.google.code.gson:gson:2.7'
|
||||
implementation 'com.android.support.constraint:constraint-layout:1.0.0-alpha4'
|
||||
|
||||
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta1'
|
||||
implementation 'com.squareup.retrofit:converter-gson:2.0.0-beta1'
|
||||
implementation 'com.google.android.gms:play-services-location:11.8.0'
|
||||
implementation 'com.google.android.gms:play-services-maps:11.8.0'
|
||||
compile 'com.google.firebase:firebase-appindexing:11.8.0'
|
||||
compile 'com.google.firebase:firebase-perf:11.8.0'
|
||||
implementation 'com.google.firebase:firebase-appindexing:11.8.0'
|
||||
implementation 'com.google.firebase:firebase-perf:11.8.0'
|
||||
|
||||
compile('com.crashlytics.sdk.android:crashlytics:2.7.1@aar') {
|
||||
implementation('com.crashlytics.sdk.android:crashlytics:2.7.1@aar') {
|
||||
transitive = true;
|
||||
}
|
||||
compile 'com.google.firebase:firebase-core:11.8.0'
|
||||
implementation 'com.google.firebase:firebase-core:11.8.0'
|
||||
|
||||
testCompile 'junit:junit:4.12'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
implementation project(':library')
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -237,6 +237,7 @@
|
||||
<activity
|
||||
android:name=".dailyentry.AuditActivity"
|
||||
android:label="@string/audit"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme.NoActionBar" />
|
||||
|
||||
<service
|
||||
@@ -266,36 +267,51 @@
|
||||
|
||||
<activity
|
||||
android:name=".storeinmap.StoreListMapActivity"
|
||||
android:label="@string/title_activity_store_list_map"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/title_activity_store_list_map"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan"/>
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity
|
||||
android:name=".storeinmap.StoreListRouteActivity"
|
||||
android:label="@string/title_activity_store_list_route"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/title_activity_store_list_route"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan"/>
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity
|
||||
android:name=".storeinmap.StoreRouteActivity"
|
||||
android:label="@string/title_activity_store_route"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/title_activity_store_route"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan"/>
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity
|
||||
android:name=".dailyentry.MessageActivity"
|
||||
android:label="@string/title_activity_message"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/title_activity_message"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan"/>
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity
|
||||
android:name=".dailyentry.ConversationActivity"
|
||||
android:label="@string/title_activity_conversation"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:configChanges="screenSize|orientation|keyboardHidden"
|
||||
android:label="@string/title_activity_conversation"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan" ></activity>
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:windowSoftInputMode="adjustPan" />
|
||||
<activity
|
||||
android:name=".dailyentry.CoachingVisitActivity"
|
||||
android:label="@string/title_activity_coaching_visit"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
android:name=".dailyentry.DeliveryCallActivity"
|
||||
android:label="@string/delivery_call"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:screenOrientation="portrait"/>
|
||||
<activity
|
||||
android:name=".dailyentry.DeliveryCallAddStoreActivity"
|
||||
android:label="@string/delivery_call"
|
||||
android:theme="@style/AppTheme.NoActionBar"
|
||||
android:screenOrientation="portrait"/>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -208,6 +208,7 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
// Write your code here to invoke NO event
|
||||
|
||||
dialog.cancel();
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -702,7 +703,7 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
|
||||
if (result.toString().equalsIgnoreCase(
|
||||
CommonString.KEY_FALSE)) {
|
||||
return CommonString.METHOD_UPLOAD_ASSET;
|
||||
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||
}
|
||||
|
||||
// for failure
|
||||
@@ -719,7 +720,7 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
|
||||
if (failureGetterSetter.getStatus().equalsIgnoreCase(
|
||||
CommonString.KEY_FAILURE)) {
|
||||
return CommonString.METHOD_UPLOAD_ASSET + ","
|
||||
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA + ","
|
||||
+ failureGetterSetter.getErrorMsg();
|
||||
|
||||
} else {
|
||||
@@ -862,7 +863,7 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
&& !geotaglistImage.get(i).getUrl1()
|
||||
.equalsIgnoreCase("")) {
|
||||
|
||||
if (new File(Environment.getExternalStorageDirectory() + "/GSK_MT_ORANGE_IMAGES/"
|
||||
if (new File(CommonString.FILE_PATH
|
||||
+ geotaglistImage.get(i).getUrl1()).exists()) {
|
||||
result = UploadGeoImage(geotaglistImage.get(i).getUrl1(), "GeotagImages");
|
||||
|
||||
@@ -952,7 +953,6 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
|
||||
db.deleteGeoTagData(geotaglistImage.get(i).getStoreid());
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1005,7 +1005,7 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
errormsg = "";
|
||||
BitmapFactory.Options o = new BitmapFactory.Options();
|
||||
o.inJustDecodeBounds = true;
|
||||
BitmapFactory.decodeFile(Environment.getExternalStorageDirectory() + "/GSK_MT_ORANGE_IMAGES/" + path, o);
|
||||
BitmapFactory.decodeFile(CommonString.FILE_PATH + path, o);
|
||||
|
||||
// The new size we want to scale to
|
||||
final int REQUIRED_SIZE = 1024;
|
||||
@@ -1025,7 +1025,7 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
// Decode with inSampleSize
|
||||
BitmapFactory.Options o2 = new BitmapFactory.Options();
|
||||
o2.inSampleSize = scale;
|
||||
Bitmap bitmap = BitmapFactory.decodeFile(Environment.getExternalStorageDirectory() + "/GSK_MT_ORANGE_IMAGES/" + path, o2);
|
||||
Bitmap bitmap = BitmapFactory.decodeFile(CommonString.FILE_PATH + path, o2);
|
||||
|
||||
ByteArrayOutputStream bao = new ByteArrayOutputStream();
|
||||
bitmap.compress(Bitmap.CompressFormat.JPEG, 90, bao);
|
||||
@@ -1051,7 +1051,7 @@ public class GeoTagActivity extends AppCompatActivity implements OnMapReadyCallb
|
||||
|
||||
if (result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
|
||||
new File(Environment.getExternalStorageDirectory() + "/GSK_MT_ORANGE_IMAGES/" + path).delete();
|
||||
new File(CommonString.FILE_PATH + path).delete();
|
||||
|
||||
|
||||
|
||||
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package cpm.com.gskmtorange.GetterSetter;
|
||||
|
||||
public class CoachingVisitGetterSetter {
|
||||
|
||||
String emp_id, img_path = "";
|
||||
boolean exists;
|
||||
|
||||
public String getEmp_id() {
|
||||
return emp_id;
|
||||
}
|
||||
|
||||
public void setEmp_id(String emp_id) {
|
||||
this.emp_id = emp_id;
|
||||
}
|
||||
|
||||
public String getImg_path() {
|
||||
return img_path;
|
||||
}
|
||||
|
||||
public void setImg_path(String img_path) {
|
||||
this.img_path = img_path;
|
||||
}
|
||||
|
||||
public boolean isExists() {
|
||||
return exists;
|
||||
}
|
||||
|
||||
public void setExists(boolean exists) {
|
||||
this.exists = exists;
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,7 @@ public class StoreBean implements Serializable{
|
||||
String UPLOAD_STATUS;
|
||||
String LATITUDE;
|
||||
String LONGITUDE;
|
||||
String POG_TYPE_ID;
|
||||
|
||||
public String getSTORE_ID() {
|
||||
return STORE_ID;
|
||||
@@ -172,4 +173,12 @@ public class StoreBean implements Serializable{
|
||||
public void setLONGITUDE(String LONGITUDE) {
|
||||
this.LONGITUDE = LONGITUDE;
|
||||
}
|
||||
|
||||
public String getPOG_TYPE_ID() {
|
||||
return POG_TYPE_ID;
|
||||
}
|
||||
|
||||
public void setPOG_TYPE_ID(String POG_TYPE_ID) {
|
||||
this.POG_TYPE_ID = POG_TYPE_ID;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,9 +192,9 @@ public class LoginActivity extends AppCompatActivity {
|
||||
if (!file.isDirectory()) {
|
||||
file.mkdir();
|
||||
}
|
||||
File fileold = new File(Environment.getExternalStorageDirectory(), "GSK_MT_ORANGE_IMAGES");
|
||||
if (!fileold.isDirectory()) {
|
||||
fileold.mkdir();
|
||||
File file_planogram = new File(Environment.getExternalStorageDirectory(), "GSK_MT_ORANGE_Planogram_Images");
|
||||
if (!file_planogram.isDirectory()) {
|
||||
file_planogram.mkdir();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -566,7 +566,6 @@ public class LoginActivity extends AppCompatActivity {
|
||||
editor.putString(CommonString.KEY_PATH, lgs.getAPP_PATH());
|
||||
editor.putString(CommonString.KEY_DATE, lgs.getCURRENTDATE());
|
||||
editor.putString(CommonString.KEY_COUNTRY_ID, lgs.getCOUNTRY_ID());
|
||||
//editor.putString(CommonString.KEY_DATE, "02/04/2018");
|
||||
|
||||
editor.commit();
|
||||
|
||||
@@ -666,13 +665,13 @@ public class LoginActivity extends AppCompatActivity {
|
||||
|
||||
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
|
||||
/*Intent intent = new Intent(getBaseContext(),
|
||||
Intent intent = new Intent(getBaseContext(),
|
||||
MainActivity.class);
|
||||
startActivity(intent);
|
||||
|
||||
finish();*/
|
||||
finish();
|
||||
|
||||
uploadPreviousImages();
|
||||
//uploadPreviousImages();
|
||||
|
||||
}
|
||||
|
||||
@@ -752,7 +751,7 @@ public class LoginActivity extends AppCompatActivity {
|
||||
|
||||
public void uploadPreviousImages(){
|
||||
try {
|
||||
File f = new File(CommonString.FILE_PATH_OLD);
|
||||
File f = new File(CommonString.FILE_PATH);
|
||||
if(f!=null){
|
||||
File file[] = f.listFiles();
|
||||
if(file!=null && file.length>0){
|
||||
@@ -788,8 +787,8 @@ public class LoginActivity extends AppCompatActivity {
|
||||
if(file.length>0){
|
||||
UploadImageWithRetrofit.uploadedFiles = 0;
|
||||
UploadImageWithRetrofit.totalFiles = file.length;
|
||||
UploadImageWithRetrofit uploadImg = new UploadImageWithRetrofit( LoginActivity.this);
|
||||
uploadImg.UploadImageRecursive(LoginActivity.this);
|
||||
UploadImageWithRetrofit uploadImg = new UploadImageWithRetrofit( "", userid,LoginActivity.this);
|
||||
//uploadImg.UploadImageRecursive(LoginActivity.this);
|
||||
}
|
||||
else {
|
||||
sendToMain();
|
||||
|
||||
@@ -37,6 +37,7 @@ import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
||||
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.dailyentry.DeliveryCallActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.FutureJCPActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.PlanogramPDFActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.ServiceActivity;
|
||||
@@ -46,6 +47,7 @@ import cpm.com.gskmtorange.download.DownloadActivity;
|
||||
import cpm.com.gskmtorange.upload.PreviousDataUploadActivity;
|
||||
import cpm.com.gskmtorange.upload.UploadActivity;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationContrywiseGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationMasterGetterSetter;
|
||||
import io.fabric.sdk.android.Fabric;
|
||||
|
||||
public class MainActivity extends AppCompatActivity
|
||||
@@ -146,13 +148,43 @@ public class MainActivity extends AppCompatActivity
|
||||
|
||||
db.open();
|
||||
|
||||
//Deviation - Ad hoc Stores - enable
|
||||
/*//Deviation - Ad hoc Stores - enable
|
||||
ArrayList<ConfigurationContrywiseGetterSetter> configuration_data = db.getConfigurationData(country_id);
|
||||
if(configuration_data.size()>0){
|
||||
if(configuration_data.get(0).getADHOC_REPORTING().get(0).equals("1")){
|
||||
Menu nav_Menu = navigationView.getMenu();
|
||||
nav_Menu.findItem(R.id.nav_deviation).setVisible(true);
|
||||
}
|
||||
|
||||
if(configuration_data.get(0).getPDF_ALLOW().get(0).equals("1")){
|
||||
Menu nav_Menu = navigationView.getMenu();
|
||||
nav_Menu.findItem(R.id.nav_planogram).setVisible(true);
|
||||
}
|
||||
}*/
|
||||
|
||||
//Enable disable According to Configuration
|
||||
ArrayList<ConfigurationMasterGetterSetter> configurationData = db.getConfigurationMasterData(country_id);
|
||||
if(configurationData.size()>0){
|
||||
for(int i=0; i<configurationData.size();i++){
|
||||
|
||||
if(configurationData.get(i).getCONFIGURE().get(0).equalsIgnoreCase("ADHOC REPORTING") &&
|
||||
configurationData.get(i).getACTIVE().get(0).equalsIgnoreCase("1")){
|
||||
Menu nav_Menu = navigationView.getMenu();
|
||||
nav_Menu.findItem(R.id.nav_deviation).setVisible(true);
|
||||
}
|
||||
|
||||
if(configurationData.get(i).getCONFIGURE().get(0).equalsIgnoreCase("PDF ALLOW") &&
|
||||
configurationData.get(i).getACTIVE().get(0).equalsIgnoreCase("1")){
|
||||
Menu nav_Menu = navigationView.getMenu();
|
||||
nav_Menu.findItem(R.id.nav_planogram).setVisible(true);
|
||||
}
|
||||
|
||||
if(configurationData.get(i).getCONFIGURE().get(0).equalsIgnoreCase("DELIVERY CALLS") &&
|
||||
configurationData.get(i).getACTIVE().get(0).equalsIgnoreCase("1")){
|
||||
Menu nav_Menu = navigationView.getMenu();
|
||||
nav_Menu.findItem(R.id.nav_delivery_call).setVisible(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
coverageList = db.getCoverageData(date, null);
|
||||
@@ -361,9 +393,27 @@ public class MainActivity extends AppCompatActivity
|
||||
}
|
||||
|
||||
}else if(id == R.id.nav_deviation){
|
||||
Intent in = new Intent(this, StoreListActivity.class);
|
||||
in.putExtra(CommonString.KEY_STORE_FLAG, CommonString.FROM_DEVIATION);
|
||||
|
||||
db.open();
|
||||
|
||||
if ( db.getSKUMasterData().size() == 0) {
|
||||
|
||||
Snackbar.make(webView, R.string.title_store_list_download_data, Snackbar.LENGTH_SHORT)
|
||||
.setAction("Action", null).show();
|
||||
|
||||
// Toast.makeText(getBaseContext(), "Please Download Data First", Toast.LENGTH_LONG).show();
|
||||
} else {
|
||||
|
||||
Intent in = new Intent(this, StoreListActivity.class);
|
||||
in.putExtra(CommonString.KEY_STORE_FLAG, CommonString.FROM_DEVIATION);
|
||||
|
||||
startActivity(in);
|
||||
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
}
|
||||
|
||||
}else if(id == R.id.nav_delivery_call){
|
||||
Intent in = new Intent(this, DeliveryCallActivity.class);
|
||||
startActivity(in);
|
||||
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
|
||||
@@ -58,7 +58,8 @@ public class CommonFunctions {
|
||||
|
||||
public static String getCurrentTimeWithLanguage(Context context) {
|
||||
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss"); Calendar m_cal = Calendar.getInstance();
|
||||
SimpleDateFormat formatter = new SimpleDateFormat("HH:mm:ss");
|
||||
Calendar m_cal = Calendar.getInstance();
|
||||
|
||||
String cdate = formatter.format(m_cal.getTime());
|
||||
SharedPreferences preferences = preferences = PreferenceManager.getDefaultSharedPreferences(context);;
|
||||
|
||||
@@ -50,6 +50,7 @@ public class CommonString {
|
||||
public static final String KEY_LONGITUDE = "LONGITUDE";
|
||||
public static final String KEY_COVERAGE_STATUS = "Coverage";
|
||||
public static final String KEY_REASON_ID = "REASON_ID";
|
||||
public static final String KEY_SUB_REASON_ID = "SUB_REASON_ID";
|
||||
public static final String KEY_REASON = "REASON";
|
||||
public static final String KEY_COVERAGE_REMARK = "REMARK";
|
||||
public static final String KEY_CHECKOUT_IMAGE = "Checkout_Image";
|
||||
@@ -60,6 +61,7 @@ public class CommonString {
|
||||
public static final String KEY_IMAGE_PATH = "IMAGE_PATH";
|
||||
public static final String KEY_ID = "Id";
|
||||
public static final String KEY_MERCHANDISER_ID = "MERCHANDISER_ID";
|
||||
public static final String KEY_POG_TYPE_ID = "POG_TYPE_ID";
|
||||
|
||||
public static final String KEY_LOOGIN_PREF = "LOGIN_PREF";
|
||||
|
||||
@@ -165,6 +167,7 @@ public class CommonString {
|
||||
|
||||
//public static final String METHOD_UPLOAD_COVERAGE = "UPLOAD_COVERAGENEW";
|
||||
public static final String METHOD_UPLOAD_COVERAGE = "UPLOAD_COVERAGENEW1";
|
||||
public static final String METHOD_UPLOAD_COVERAGE_NEW = "UPLOAD_COVERAGENEW2";
|
||||
|
||||
public static final String METHOD_UPLOAD_COVERAGE_STATUS = "UploadCoverage_Status";
|
||||
|
||||
@@ -173,6 +176,9 @@ public class CommonString {
|
||||
public static final String SOAP_ACTION_UPLOAD_STORE_COVERAGE = "http://tempuri.org/"
|
||||
+ METHOD_UPLOAD_COVERAGE;
|
||||
|
||||
public static final String SOAP_ACTION_UPLOAD_STORE_COVERAGE_NEW = "http://tempuri.org/"
|
||||
+ METHOD_UPLOAD_COVERAGE_NEW;
|
||||
|
||||
public static final String METHOD_UPLOAD_IMAGE = "GetImageWithFolderName";
|
||||
|
||||
public static final String SOAP_ACTION_UPLOAD_IMAGE = "http://tempuri.org/" + METHOD_UPLOAD_IMAGE;
|
||||
@@ -193,7 +199,7 @@ public class CommonString {
|
||||
public static final String CREATE_TABLE_COVERAGE_DATA = "CREATE TABLE IF NOT EXISTS " + TABLE_COVERAGE_DATA
|
||||
+ " ("
|
||||
+ KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||
+ KEY_STORE_ID + " VARCHAR,USER_ID VARCHAR, "
|
||||
+ KEY_STORE_ID + " INTEGER,USER_ID VARCHAR, "
|
||||
+ KEY_IN_TIME + " VARCHAR,"
|
||||
+ KEY_OUT_TIME + " VARCHAR,"
|
||||
+ KEY_VISIT_DATE + " VARCHAR,"
|
||||
@@ -203,13 +209,45 @@ public class CommonString {
|
||||
+ KEY_COVERAGE_STATUS + " VARCHAR,"
|
||||
+ KEY_IMAGE + " VARCHAR,"
|
||||
+ KEY_GEO_TAG + " VARCHAR,"
|
||||
+ KEY_REASON_ID + " VARCHAR,"
|
||||
+ KEY_REASON_ID + " INTEGER,"
|
||||
+ KEY_SUB_REASON_ID + " INTEGER,"
|
||||
+ KEY_COVERAGE_REMARK + " VARCHAR,"
|
||||
+ KEY_CHECKOUT_IMAGE + " VARCHAR,"
|
||||
+ KEY_STORE_FLAG + " VARCHAR,"
|
||||
+ KEY_REASON + " VARCHAR)";
|
||||
|
||||
|
||||
public static final String TABLE_COACHING_VISIT = "COACHING_VISIT";
|
||||
public static final String KEY_EXIST = "EXIST";
|
||||
|
||||
|
||||
public static final String CREATE_TABLE_COACHING_VISIT = "CREATE TABLE IF NOT EXISTS " + TABLE_COACHING_VISIT
|
||||
+ " ("
|
||||
+ KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||
+ KEY_STORE_ID + " INTEGER,USER_ID VARCHAR, "
|
||||
+ KEY_EMP_ID + " VARCHAR,"
|
||||
+ KEY_IMAGE + " VARCHAR,"
|
||||
+ KEY_EXIST + " INTEGER)";
|
||||
|
||||
|
||||
public static final String TABLE_DELIVERY_CALLS = "DELIVERY_CALLS";
|
||||
|
||||
public static final String KEY_ADDRESS = "ADDRESS";
|
||||
|
||||
public static final String CREATE_TABLE_DELIVERY_CALLS= "CREATE TABLE IF NOT EXISTS " + TABLE_DELIVERY_CALLS
|
||||
+ " ("
|
||||
+ KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||
+ KEY_STORE_NAME+ " NVARCHAR,"
|
||||
+ KEY_ADDRESS + " VARCHAR,"
|
||||
+ KEY_IMAGE + " VARCHAR,"
|
||||
+ KEY_IMAGE1 + " VARCHAR,"
|
||||
+ KEY_IN_TIME + " VARCHAR,"
|
||||
+ KEY_OUT_TIME + " VARCHAR,"
|
||||
+ KEY_UPLOAD_STATUS + " VARCHAR,"
|
||||
+ KEY_LATITUDE + " VARCHAR,"
|
||||
+ KEY_LONGITUDE + " VARCHAR,"
|
||||
+ KEY_VISIT_DATE + " VARCHAR)";
|
||||
|
||||
public static final String CREATE_TABLE_STORE_GEOTAGGING = "CREATE TABLE IF NOT EXISTS "
|
||||
+ TABLE_STORE_GEOTAGGING
|
||||
+ " ("
|
||||
@@ -238,6 +276,7 @@ public class CommonString {
|
||||
|
||||
//File Path
|
||||
public static final String FILE_PATH = Environment.getExternalStorageDirectory() + "/.GSK_MT_ORANGE_IMAGES/";
|
||||
public static final String FILE_PATH_PLANOGRAM = Environment.getExternalStorageDirectory() + "/GSK_MT_ORANGE_Planogram_Images/";
|
||||
public static final String FILE_PATH_OLD = Environment.getExternalStorageDirectory() + "/GSK_MT_ORANGE_IMAGES/";
|
||||
public static final String FILE_PATH_PDF = Environment.getExternalStorageDirectory() + "/GSK_MT_ORANGE_Planogram/";
|
||||
|
||||
@@ -852,7 +891,7 @@ public class CommonString {
|
||||
public static final String KEY_ROW_NO = "ROW_NO";
|
||||
public static final String KEY_COLUMN_NO = "COLUMN_NO";
|
||||
public static final String KEY_FACING = "FACING";
|
||||
public static final String KEY_ISVERTICAL = "ISVERTICAL";
|
||||
public static final String KEY_ISVERTICAL = "IS_VERTICAL";
|
||||
|
||||
public static final String CREATE_TABLE_INSERT_NO_CAMERA_FACING_DATA = "CREATE TABLE IF NOT EXISTS " + TABLE_INSERT_NO_CAMERA_FACING_DATA
|
||||
+ " ("
|
||||
@@ -918,6 +957,9 @@ public class CommonString {
|
||||
+ "QUESTION"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "QTYPE"
|
||||
+ " VARCHAR,"
|
||||
|
||||
+ "ANSWER_ID"
|
||||
+ " INTEGER,"
|
||||
|
||||
|
||||
@@ -1138,7 +1138,13 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
|
||||
public void showSkuDialog() {
|
||||
|
||||
final ArrayList<BrandMasterGetterSetter> brandList = db.getBrandT2PData(store_type_id, class_id, key_account_id, categoryId);
|
||||
final ArrayList<BrandMasterGetterSetter> brandList;
|
||||
if(country_id.equals("7")){
|
||||
brandList = db.getBrandT2PData(null, null, null, categoryId, store_id);
|
||||
}
|
||||
else {
|
||||
brandList = db.getBrandT2PData(store_type_id, class_id, key_account_id, categoryId, store_id);
|
||||
}
|
||||
|
||||
BrandMasterGetterSetter brand = new BrandMasterGetterSetter();
|
||||
brand.setBRAND(getResources().getString(R.string.select));
|
||||
@@ -1272,7 +1278,13 @@ public class AdditionalVisibility extends AppCompatActivity implements View.OnCl
|
||||
brand_id = brandList.get(position).getBRAND_ID().get(0);
|
||||
brand_name = brandList.get(position).getBRAND().get(0);
|
||||
|
||||
sku_list = db.getSkuT2PData(store_type_id, class_id, key_account_id, brand_id);
|
||||
if(country_id.equals("7")){
|
||||
sku_list = db.getSkuT2PData(null, null, null, brand_id, store_id);
|
||||
}
|
||||
else {
|
||||
sku_list = db.getSkuT2PData(store_type_id, class_id, key_account_id, brand_id, store_id);
|
||||
}
|
||||
|
||||
SkuGetterSetter select = new SkuGetterSetter();
|
||||
select.setSKU(getResources().getString(R.string.select));
|
||||
sku_list.add(0, select);
|
||||
|
||||
@@ -31,6 +31,7 @@ import android.widget.ArrayAdapter;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ExpandableListView;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
@@ -42,12 +43,14 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||
import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.AdditionalQuestiongetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.AuditDataGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityStockFacingGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.T2PGetterSetter;
|
||||
|
||||
public class AuditActivity extends AppCompatActivity {
|
||||
|
||||
@@ -57,7 +60,7 @@ public class AuditActivity extends AppCompatActivity {
|
||||
String categoryName, categoryId, Error_Message = "", pathforcheck = "", _path = "", str, img_str = "", img_str2 = "";
|
||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id;
|
||||
GSKOrangeDB db;
|
||||
ArrayList<AuditDataGetterSetter> question_list, childListData;
|
||||
ArrayList<AuditDataGetterSetter> question_list = new ArrayList<>(), childListData;
|
||||
HashMap<AuditDataGetterSetter, ArrayList<AuditDataGetterSetter>> hashMapAnsListChildData;
|
||||
AnswerAdapter questionAdapter;
|
||||
RecyclerView recyclerView;
|
||||
@@ -66,6 +69,7 @@ public class AuditActivity extends AppCompatActivity {
|
||||
int child_position = -1;
|
||||
String error_msg = "";
|
||||
Toolbar toolbar;
|
||||
LinearLayout no_data_lay;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -76,6 +80,9 @@ public class AuditActivity extends AppCompatActivity {
|
||||
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
no_data_lay = (LinearLayout) findViewById(R.id.no_data_lay);
|
||||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
|
||||
@@ -103,7 +110,10 @@ public class AuditActivity extends AppCompatActivity {
|
||||
//Header
|
||||
question_list = db.getAfterSaveAuditQuestionAnswerData(store_id, categoryId);
|
||||
if (question_list.size() == 0) {
|
||||
question_list = db.getAuditCategoryWise(categoryId, storeType_id);
|
||||
|
||||
question_list = getAuditQnsRemoved();
|
||||
|
||||
/* question_list = db.getAuditCategoryWise(categoryId, storeType_id);
|
||||
|
||||
Iterator<AuditDataGetterSetter> iterator = question_list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
@@ -111,8 +121,13 @@ public class AuditActivity extends AppCompatActivity {
|
||||
// Check condition
|
||||
if (!item.getKEYACCOUNT_ID().equals("0") && !item.getKEYACCOUNT_ID().equals(keyAccount_id)) {
|
||||
iterator.remove();
|
||||
} else if (!item.getCHECK_TYPE().equals("NA") && item.getCHECK_TYPE().equals("T2P")) {
|
||||
|
||||
if (!db.isMappingT2PData(store_id, categoryId)) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
hashMapAnsListChildData = new HashMap<>();
|
||||
@@ -130,45 +145,104 @@ public class AuditActivity extends AppCompatActivity {
|
||||
|
||||
hashMapAnsListChildData.put(question_list.get(i), answerList); // Header, Child data
|
||||
}
|
||||
|
||||
questionAdapter = new AnswerAdapter(question_list, hashMapAnsListChildData);
|
||||
recyclerView.setAdapter(questionAdapter);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||
} else {
|
||||
no_data_lay.setVisibility(View.VISIBLE);
|
||||
fab.setVisibility(View.GONE);
|
||||
recyclerView.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
|
||||
questionAdapter = new AnswerAdapter(question_list, hashMapAnsListChildData);
|
||||
recyclerView.setAdapter(questionAdapter);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||
|
||||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (validateData(question_list)) {
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(AuditActivity.this);
|
||||
builder.setMessage(R.string.title_activity_Want_save)
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
if (question_list.size() > 0) {
|
||||
if (validateData(question_list)) {
|
||||
|
||||
db.saveAuditQuestionAnswerData(question_list, store_id, categoryId);
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
})
|
||||
.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(AuditActivity.this);
|
||||
builder.setMessage(R.string.title_activity_Want_save)
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
||||
db.saveAuditQuestionAnswerData(question_list, store_id, categoryId);
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
})
|
||||
.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
} else {
|
||||
questionAdapter.notifyDataSetChanged();
|
||||
Snackbar.make(recyclerView, error_msg, Snackbar.LENGTH_SHORT).show();
|
||||
}
|
||||
} else {
|
||||
questionAdapter.notifyDataSetChanged();
|
||||
Snackbar.make(recyclerView, error_msg, Snackbar.LENGTH_SHORT).show();
|
||||
Snackbar.make(recyclerView, getString(R.string.NodataAvailable), Snackbar.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ArrayList<AuditDataGetterSetter> getAuditQnsRemoved() {
|
||||
|
||||
boolean t2p_flag = false;
|
||||
|
||||
if (db.isMappingT2PData(store_id, categoryId)) {
|
||||
if (db.isFilledT2P(store_id, categoryId)) {
|
||||
ArrayList<T2PGetterSetter> t2PList = db.getT2pComplianceData(store_id, categoryId);
|
||||
|
||||
for (int i = 0; i < t2PList.size(); i++) {
|
||||
if (t2PList.get(i).getPresent() == 1) {
|
||||
t2p_flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!t2p_flag) {
|
||||
if (db.additionalVisibilitydata(store_id, categoryId)) {
|
||||
ArrayList<AddittionalGetterSetter> additionalList = db.getAdditionalMainStock(store_id, categoryId);
|
||||
|
||||
for (int i = 0; i < additionalList.size(); i++) {
|
||||
if (additionalList.get(i).getBtn_toogle().equals("1")) {
|
||||
t2p_flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ArrayList<AuditDataGetterSetter> question_list = db.getAuditCategoryWise(categoryId, storeType_id);
|
||||
|
||||
Iterator<AuditDataGetterSetter> iterator = question_list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
AuditDataGetterSetter item = iterator.next(); // must be called before you can call iterator.remove()
|
||||
// Check condition
|
||||
if (!item.getKEYACCOUNT_ID().equals("0") && !item.getKEYACCOUNT_ID().equals(keyAccount_id)) {
|
||||
iterator.remove();
|
||||
} else if (!item.getCHECK_TYPE().equals("NA") && item.getCHECK_TYPE().equals("T2P")) {
|
||||
|
||||
if (!t2p_flag) {
|
||||
iterator.remove();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return question_list;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
@@ -185,6 +259,39 @@ public class AuditActivity extends AppCompatActivity {
|
||||
|
||||
if (id == android.R.id.home) {
|
||||
|
||||
if (question_list.size() > 0) {
|
||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(AuditActivity.this);
|
||||
builder.setTitle("Parinaam");
|
||||
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
|
||||
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
||||
}
|
||||
});
|
||||
android.app.AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
} else {
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
//super.onBackPressed();
|
||||
|
||||
if (question_list.size() > 0) {
|
||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(AuditActivity.this);
|
||||
builder.setTitle("Parinaam");
|
||||
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
|
||||
@@ -203,33 +310,10 @@ public class AuditActivity extends AppCompatActivity {
|
||||
});
|
||||
android.app.AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
} else {
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
//super.onBackPressed();
|
||||
|
||||
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(AuditActivity.this);
|
||||
builder.setTitle("Parinaam");
|
||||
builder.setMessage(getResources().getString(R.string.data_will_be_lost)).setCancelable(false)
|
||||
.setPositiveButton(getString(R.string.ok), new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
})
|
||||
.setNegativeButton(getString(R.string.cancel), new DialogInterface.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
||||
}
|
||||
});
|
||||
android.app.AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
}
|
||||
|
||||
class AnswerAdapter extends RecyclerView.Adapter<AnswerAdapter.ViewHolder> {
|
||||
@@ -472,7 +556,7 @@ public class AuditActivity extends AppCompatActivity {
|
||||
} else if (data.get(i).getCAMERA_ALLOW().equals("1") && data.get(i).getNO_OF_CAMERA().equals("2") && data.get(i).getCAM_IMAGE2().equals("")) {
|
||||
error_msg = getString(R.string.click_image);
|
||||
checkflag = false;
|
||||
}else {
|
||||
} else {
|
||||
checkflag = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
String _pathforcheck1, _pathforcheck2, _pathforcheck3, _pathforcheck4, Camerapath1, Camerapath2, _path, CaMpath, str, msg, categoryName, categoryId;
|
||||
ImageView im1, im2, im3, im4;
|
||||
ListView listview;
|
||||
String store_id, date, intime, img_str1="", img_str2="", img_str3="", img_str4="", togglevalue = "1", CATEGORY_ID, camera_allow, store_type_id, class_id, key_account_id;
|
||||
String store_id, date, intime, img_str1="", img_str2="", img_str3="", img_str4="", togglevalue = "1", CATEGORY_ID, camera_allow, store_type_id, class_id, key_account_id, country_id;
|
||||
private SharedPreferences preferences;
|
||||
Uri outputFileUri;
|
||||
String gallery_package = "";
|
||||
@@ -74,6 +74,7 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
store_type_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
||||
class_id = preferences.getString(CommonString.KEY_CLASS_ID, "");
|
||||
key_account_id = preferences.getString(CommonString.KEY_KEYACCOUNT_ID, "");
|
||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, "");
|
||||
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
|
||||
categoryName = getIntent().getStringExtra("categoryName");
|
||||
@@ -137,8 +138,12 @@ public class CategoryPicture extends AppCompatActivity {
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
listdat = db.getCategoryPicturedata(categoryId, key_account_id, store_type_id, class_id);
|
||||
if(country_id.equals("7")){
|
||||
listdat = db.getCategoryPicturedata(categoryId, null, null, null, store_id);
|
||||
}
|
||||
else {
|
||||
listdat = db.getCategoryPicturedata(categoryId, key_account_id, store_type_id, class_id, store_id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,459 @@
|
||||
package cpm.com.gskmtorange.dailyentry;
|
||||
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.provider.MediaStore;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.util.Log;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.androidbuts.multispinnerfilter.KeyPairBoolData;
|
||||
import com.androidbuts.multispinnerfilter.MultiSpinnerSearch;
|
||||
import com.androidbuts.multispinnerfilter.SpinnerListener;
|
||||
import com.crashlytics.android.Crashlytics;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||
import cpm.com.gskmtorange.GetterSetter.CoachingVisitGetterSetter;
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.SupervisorListGetterSetter;
|
||||
|
||||
public class CoachingVisitActivity extends AppCompatActivity implements AdapterView.OnItemSelectedListener, View.OnClickListener {
|
||||
|
||||
private GSKOrangeDB database;
|
||||
ArrayList<SupervisorListGetterSetter> supervisorList;
|
||||
private Spinner exist_spinner; //supervisor_spinner;
|
||||
private ArrayAdapter<CharSequence> exist_adapter, supervisor_adapter;
|
||||
int coaching_visit;
|
||||
LinearLayout linear_supervisor;
|
||||
ImageView img_cam;
|
||||
FloatingActionButton fab_next, fab_save;
|
||||
String emp_id;
|
||||
protected String _pathforcheck = "", _path, image_name = "", str, country_id, store_flag_str;
|
||||
String visit_date, store_id, username;
|
||||
private SharedPreferences preferences;
|
||||
String gallery_package = "";
|
||||
Uri outputFileUri;
|
||||
boolean saved_flag = false, update_flag = false;
|
||||
ArrayList<CoachingVisitGetterSetter> coachingVisitdata;
|
||||
boolean coaching_visit_camera_flag = false;
|
||||
MultiSpinnerSearch multi_spinner_supervisor;
|
||||
|
||||
ArrayList<String> selectedSupervisorList = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_coaching_visit);
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
linear_supervisor = (LinearLayout) findViewById(R.id.linear_supervisor);
|
||||
exist_spinner = (Spinner) findViewById(R.id.spinner_coaching_visit);
|
||||
//supervisor_spinner = (Spinner) findViewById(R.id.spinner_supervisor);
|
||||
img_cam = (ImageView) findViewById(R.id.img_cam);
|
||||
|
||||
multi_spinner_supervisor = (MultiSpinnerSearch) findViewById(R.id.multi_spinner_supervisor);
|
||||
|
||||
getSupportActionBar().setHomeButtonEnabled(true);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
|
||||
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
|
||||
toolbar.setTitle(getResources().getString(R.string.title_activity_coaching_visit));
|
||||
|
||||
str = CommonString.FILE_PATH;
|
||||
|
||||
store_id = getIntent().getStringExtra(CommonString.KEY_STORE_ID);
|
||||
store_flag_str = getIntent().getStringExtra(CommonString.KEY_STORE_FLAG);
|
||||
|
||||
username = preferences.getString(CommonString.KEY_USERNAME, "");
|
||||
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||
//store_id = preferences.getString(CommonString.KEY_STORE_ID, null);
|
||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, null);
|
||||
|
||||
fab_next = (FloatingActionButton) findViewById(R.id.fab);
|
||||
fab_save = (FloatingActionButton) findViewById(R.id.fab_save);
|
||||
|
||||
database = new GSKOrangeDB(this);
|
||||
database.open();
|
||||
|
||||
coachingVisitdata = database.getCoachingVisitData(store_id);
|
||||
|
||||
//Enable disable According to Configuration
|
||||
ArrayList<ConfigurationMasterGetterSetter> configurationData = database.getConfigurationMasterData(country_id);
|
||||
if (configurationData.size() > 0) {
|
||||
|
||||
for (int i = 0; i < configurationData.size(); i++) {
|
||||
if (configurationData.get(i).getCONFIGURE().get(0).equalsIgnoreCase("COACHING VISIT IMAGE") &&
|
||||
configurationData.get(i).getACTIVE().get(0).equalsIgnoreCase("1")) {
|
||||
coaching_visit_camera_flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (coaching_visit_camera_flag) {
|
||||
img_cam.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
img_cam.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
|
||||
supervisorList = database.getSupervisorListData();
|
||||
|
||||
exist_adapter = new ArrayAdapter<>(this,
|
||||
android.R.layout.simple_spinner_item);
|
||||
|
||||
String select_str = getResources().getString(R.string.select);
|
||||
|
||||
exist_adapter.add(select_str);
|
||||
exist_adapter.add(getResources().getString(R.string.yes));
|
||||
exist_adapter.add(getResources().getString(R.string.no));
|
||||
|
||||
exist_spinner.setAdapter(exist_adapter);
|
||||
|
||||
exist_adapter
|
||||
.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
|
||||
exist_spinner.setOnItemSelectedListener(this);
|
||||
|
||||
if (coachingVisitdata.size() != 0) {
|
||||
update_flag = true;
|
||||
fab_save.setVisibility(View.GONE);
|
||||
fab_next.setVisibility(View.VISIBLE);
|
||||
if (coachingVisitdata.get(0).isExists()) {
|
||||
exist_spinner.setSelection(1);
|
||||
} else {
|
||||
exist_spinner.setSelection(2);
|
||||
}
|
||||
exist_spinner.setEnabled(false);
|
||||
}
|
||||
|
||||
fab_next.setOnClickListener(this);
|
||||
fab_save.setOnClickListener(this);
|
||||
img_cam.setOnClickListener(this);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
|
||||
switch (parent.getId()) {
|
||||
case R.id.spinner_coaching_visit:
|
||||
if (position != 0) {
|
||||
|
||||
if (!update_flag) {
|
||||
|
||||
fab_save.setVisibility(View.VISIBLE);
|
||||
|
||||
if (position == 1) {
|
||||
|
||||
linear_supervisor.setVisibility(View.VISIBLE);
|
||||
|
||||
coaching_visit = 1;
|
||||
|
||||
/*supervisor_adapter = new ArrayAdapter<CharSequence>(this,
|
||||
android.R.layout.simple_spinner_item);
|
||||
|
||||
String select_str = getResources().getString(R.string.select_promo);
|
||||
|
||||
supervisor_adapter.add(select_str);
|
||||
|
||||
for (int i = 0; i < supervisorList.size(); i++) {
|
||||
supervisor_adapter.add(supervisorList.get(i).getSUPERVISOR().get(0));
|
||||
}
|
||||
|
||||
supervisor_spinner.setAdapter(supervisor_adapter);
|
||||
|
||||
supervisor_adapter
|
||||
.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
|
||||
supervisor_spinner.setOnItemSelectedListener(this);*/
|
||||
|
||||
/**
|
||||
* Getting array of String to Bind in Spinner
|
||||
*/
|
||||
//final List<String> list = Arrays.asList(getResources().getStringArray(R.array.sports_array));
|
||||
|
||||
final List<KeyPairBoolData> listArray0 = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < supervisorList.size(); i++) {
|
||||
KeyPairBoolData h = new KeyPairBoolData();
|
||||
h.setId(i + 1);
|
||||
h.setName(supervisorList.get(i).getSUPERVISOR().get(0));
|
||||
h.setSelected(false);
|
||||
listArray0.add(h);
|
||||
}
|
||||
|
||||
multi_spinner_supervisor.setItems(listArray0, -1, new SpinnerListener() {
|
||||
|
||||
@Override
|
||||
public void onItemsSelected(List<KeyPairBoolData> items) {
|
||||
|
||||
selectedSupervisorList.clear();
|
||||
|
||||
for (int i = 0; i < items.size(); i++) {
|
||||
if (items.get(i).isSelected()) {
|
||||
|
||||
selectedSupervisorList.add(items.get(i).getName());
|
||||
Log.i("MultiSpinner", i + " : " + items.get(i).getName() + " : " + items.get(i).isSelected());
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
} else {
|
||||
coaching_visit = 0;
|
||||
selectedSupervisorList.clear();
|
||||
linear_supervisor.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
coaching_visit = -1;
|
||||
linear_supervisor.setVisibility(View.GONE);
|
||||
fab_save.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case R.id.multi_spinner_supervisor:
|
||||
|
||||
/* if(position!=0){
|
||||
emp_id = supervisorList.get(position-1).getEMP_ID().get(0);
|
||||
}
|
||||
else {
|
||||
emp_id = "";
|
||||
}*/
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
switch (v.getId()) {
|
||||
case R.id.img_cam:
|
||||
_pathforcheck = store_id + "CoachingVisit" + visit_date.replace("/", "") + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||
|
||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
||||
|
||||
startCameraActivity();
|
||||
break;
|
||||
|
||||
case R.id.fab_save:
|
||||
|
||||
if (coaching_visit == 1) {
|
||||
|
||||
String error_msg = "";
|
||||
boolean flag = true;
|
||||
//if(emp_id.equals("")){
|
||||
if (selectedSupervisorList.size() == 0) {
|
||||
flag = false;
|
||||
error_msg = getString(R.string.title_activity_select_dropdown);
|
||||
} else if (coaching_visit_camera_flag && image_name.equals("")) {
|
||||
flag = false;
|
||||
error_msg = getString(R.string.clickimage);
|
||||
}
|
||||
|
||||
if (flag) {
|
||||
|
||||
for (int i = 0; i < selectedSupervisorList.size(); i++) {
|
||||
CoachingVisitGetterSetter coachingVisitGetterSetter = new CoachingVisitGetterSetter();
|
||||
coachingVisitGetterSetter.setEmp_id(getEmp_idFromName(selectedSupervisorList.get(i)));
|
||||
coachingVisitGetterSetter.setImg_path(image_name);
|
||||
coachingVisitGetterSetter.setExists(coaching_visit == 1);
|
||||
|
||||
database.insertCoachingVisitData(coachingVisitGetterSetter, store_id);
|
||||
}
|
||||
|
||||
Toast.makeText(getApplicationContext(), getString(R.string.save_message), Toast.LENGTH_SHORT).show();
|
||||
|
||||
saved_flag = true;
|
||||
|
||||
fab_next.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
Snackbar.make(linear_supervisor, error_msg, Snackbar.LENGTH_SHORT).show();
|
||||
}
|
||||
} else {
|
||||
CoachingVisitGetterSetter coachingVisitGetterSetter = new CoachingVisitGetterSetter();
|
||||
coachingVisitGetterSetter.setEmp_id("0");
|
||||
coachingVisitGetterSetter.setImg_path(image_name);
|
||||
coachingVisitGetterSetter.setExists(coaching_visit == 1);
|
||||
|
||||
database.insertCoachingVisitData(coachingVisitGetterSetter, store_id);
|
||||
|
||||
Toast.makeText(getApplicationContext(), getString(R.string.save_message), Toast.LENGTH_SHORT).show();
|
||||
saved_flag = true;
|
||||
fab_next.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case R.id.fab:
|
||||
|
||||
if (saved_flag || update_flag) {
|
||||
|
||||
Intent i = new Intent(CoachingVisitActivity.this, StoreCheckoutImageActivity.class);
|
||||
i.putExtra(CommonString.KEY_STORE_ID, store_id);
|
||||
i.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||
startActivity(i);
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
} else {
|
||||
Snackbar.make(linear_supervisor, getString(R.string.please_save_data), Snackbar.LENGTH_SHORT).show();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
String getEmp_idFromName(String name) {
|
||||
String emp_id = "0";
|
||||
|
||||
for (int i = 0; i < supervisorList.size(); i++) {
|
||||
if (supervisorList.get(i).getSUPERVISOR().get(0).equalsIgnoreCase(name)) {
|
||||
emp_id = supervisorList.get(i).getEMP_ID().get(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return emp_id;
|
||||
}
|
||||
|
||||
protected void startCameraActivity() {
|
||||
try {
|
||||
|
||||
Log.i("MakeMachine", "startCameraActivity()");
|
||||
File file = new File(_path);
|
||||
outputFileUri = Uri.fromFile(file);
|
||||
|
||||
String defaultCameraPackage = "";
|
||||
final PackageManager packageManager = getPackageManager();
|
||||
List<ApplicationInfo> list = packageManager.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
|
||||
for (int n = 0; n < list.size(); n++) {
|
||||
if ((list.get(n).flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
|
||||
Log.e("TAG", "Installed Applications : " + list.get(n).loadLabel(packageManager).toString());
|
||||
Log.e("TAG", "package name : " + list.get(n).packageName);
|
||||
|
||||
//temp value in case camera is gallery app above jellybean
|
||||
String packag = list.get(n).loadLabel(packageManager).toString();
|
||||
if (packag.equalsIgnoreCase("Gallery") || packag.equalsIgnoreCase("Galeri") || packag.equalsIgnoreCase("الاستوديو")) {
|
||||
gallery_package = list.get(n).packageName;
|
||||
}
|
||||
|
||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
if (packag.equalsIgnoreCase("Camera") || packag.equalsIgnoreCase("Kamera") || packag.equalsIgnoreCase("الكاميرا")) {
|
||||
defaultCameraPackage = list.get(n).packageName;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
||||
if (packag.equalsIgnoreCase("Camera") || packag.equalsIgnoreCase("Kamera") || packag.equalsIgnoreCase("الكاميرا")) {
|
||||
|
||||
defaultCameraPackage = list.get(n).packageName;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//com.android.gallery3d
|
||||
|
||||
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||
intent.setPackage(defaultCameraPackage);
|
||||
startActivityForResult(intent, 0);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||
intent.setPackage(gallery_package);
|
||||
startActivityForResult(intent, 0);
|
||||
|
||||
} catch (Exception e) {
|
||||
Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
Crashlytics.logException(e.getCause());
|
||||
Crashlytics.logException(new Exception(e.getCause()));
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
Log.i("MakeMachine", "resultCode: " + resultCode);
|
||||
switch (resultCode) {
|
||||
case 0:
|
||||
Log.i("MakeMachine", "User cancelled");
|
||||
break;
|
||||
|
||||
case -1:
|
||||
|
||||
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
||||
if (new File(str + _pathforcheck).exists()) {
|
||||
|
||||
img_cam.setImageDrawable(getResources().getDrawable(R.mipmap.camera_green));
|
||||
|
||||
image_name = _pathforcheck;
|
||||
|
||||
_pathforcheck = "";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
// Handle action bar item clicks here. The action bar will
|
||||
// automatically handle clicks on the Home/Up button, so long
|
||||
// as you specify a parent activity in AndroidManifest.xml.
|
||||
int id = item.getItemId();
|
||||
|
||||
if (id == android.R.id.home) {
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
}
|
||||
@@ -114,6 +114,12 @@ public class CreateSelfActivity extends AppCompatActivity {
|
||||
subCategory.setSub_category_id(sub_category_list.get(i).getSub_category_id());
|
||||
added_sub_category_list.add(subCategory);
|
||||
}
|
||||
else if(db.getNoCameraLastVisitCategoryData(store_id, categoryId, sub_category_list.get(i).getSub_category_id()).size()>0){
|
||||
MSL_AvailabilityStockFacingGetterSetter subCategory = new MSL_AvailabilityStockFacingGetterSetter();
|
||||
subCategory.setSub_category(sub_category_list.get(i).getSub_category());
|
||||
subCategory.setSub_category_id(sub_category_list.get(i).getSub_category_id());
|
||||
added_sub_category_list.add(subCategory);
|
||||
}
|
||||
}
|
||||
|
||||
if(added_sub_category_list.size()>0){
|
||||
|
||||
@@ -0,0 +1,402 @@
|
||||
package cpm.com.gskmtorange.dailyentry;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.CardView;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.crashlytics.android.Crashlytics;
|
||||
|
||||
import org.ksoap2.SoapEnvelope;
|
||||
import org.ksoap2.serialization.SoapObject;
|
||||
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
||||
import org.ksoap2.transport.HttpTransportSE;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.upload.UploadActivity;
|
||||
import cpm.com.gskmtorange.upload.UploadImageWithRetrofit;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.DeliveryCallsGetterSetter;
|
||||
|
||||
public class DeliveryCallActivity extends AppCompatActivity implements View.OnClickListener {
|
||||
|
||||
private SharedPreferences preferences;
|
||||
private GSKOrangeDB database;
|
||||
String visit_date, userId;
|
||||
ArrayList<DeliveryCallsGetterSetter> deliveryCallsList;
|
||||
RecyclerView recyclerView;
|
||||
DeliveryAdapter deliveryAdapter;
|
||||
FloatingActionButton fab_upload, fab;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_delivery_call);
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
recyclerView = (RecyclerView) findViewById(R.id.rec_delivery_calls);
|
||||
fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||
fab_upload = (FloatingActionButton) findViewById(R.id.fab_upload);
|
||||
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||
userId = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||
|
||||
database = new GSKOrangeDB(this);
|
||||
database.open();
|
||||
|
||||
fab.setOnClickListener(this);
|
||||
fab_upload.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
int id = v.getId();
|
||||
|
||||
switch (id) {
|
||||
|
||||
case R.id.fab_upload:
|
||||
|
||||
new UploadTask().execute();
|
||||
break;
|
||||
|
||||
case R.id.fab:
|
||||
|
||||
if (isCheckedIn()) {
|
||||
Snackbar.make(recyclerView, getString(R.string.title_store_list_checkout_current), Snackbar.LENGTH_SHORT).show();
|
||||
} else {
|
||||
|
||||
Intent in = new Intent(getApplicationContext(), DeliveryCallAddStoreActivity.class);
|
||||
startActivity(in);
|
||||
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
class DeliveryAdapter extends RecyclerView.Adapter<DeliveryAdapter.MyViewHolder> {
|
||||
|
||||
private LayoutInflater inflator;
|
||||
|
||||
List<DeliveryCallsGetterSetter> data = Collections.emptyList();
|
||||
|
||||
public DeliveryAdapter(Context context, List<DeliveryCallsGetterSetter> data) {
|
||||
|
||||
inflator = LayoutInflater.from(context);
|
||||
this.data = data;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeliveryAdapter.MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View view = inflator.inflate(R.layout.delivery_calls_item, parent, false);
|
||||
|
||||
DeliveryAdapter.MyViewHolder holder = new DeliveryAdapter.MyViewHolder(view);
|
||||
|
||||
return holder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(DeliveryAdapter.MyViewHolder holder, int position) {
|
||||
final DeliveryCallsGetterSetter current = data.get(position);
|
||||
holder.tv_store_name.setText(current.getSTORE_NAME());
|
||||
holder.tv_store_address.setText(current.getADDRESS());
|
||||
|
||||
if (current.getUPLOAD_STATUS().equals(CommonString.KEY_CHECK_IN)) {
|
||||
holder.imageview.setVisibility(View.INVISIBLE);
|
||||
holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.green));
|
||||
} else if (current.getUPLOAD_STATUS().equals(CommonString.KEY_U)) {
|
||||
holder.imageview.setVisibility(View.VISIBLE);
|
||||
holder.imageview.setBackgroundResource(R.mipmap.tick);
|
||||
holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||
}else if (current.getUPLOAD_STATUS().equals(CommonString.KEY_C)) {
|
||||
holder.imageview.setVisibility(View.VISIBLE);
|
||||
holder.imageview.setBackgroundResource(R.mipmap.exclamation);
|
||||
holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||
} else {
|
||||
holder.imageview.setVisibility(View.INVISIBLE);
|
||||
holder.cardView.setCardBackgroundColor(getResources().getColor(R.color.colorOrange));
|
||||
}
|
||||
|
||||
holder.cardView.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (current.getUPLOAD_STATUS().equals(CommonString.KEY_CHECK_IN)) {
|
||||
|
||||
Intent in = new Intent(getApplicationContext(), DeliveryCallAddStoreActivity.class);
|
||||
in.putExtra(CommonString.KEY_STORE_ID, current);
|
||||
in.putExtra(CommonString.KEY_STORE_FLAG, false);
|
||||
startActivity(in);
|
||||
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
} else if (current.getUPLOAD_STATUS().equals(CommonString.KEY_U)) {
|
||||
Snackbar.make(v, R.string.title_store_list_activity_store_already_done, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
} else if (current.getUPLOAD_STATUS().equals(CommonString.KEY_C)) {
|
||||
Snackbar.make(v, R.string.title_store_list_activity_store_already_checkout, Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return deliveryCallsList.size();
|
||||
}
|
||||
|
||||
class MyViewHolder extends RecyclerView.ViewHolder {
|
||||
|
||||
TextView tv_store_name, tv_store_address;
|
||||
CardView cardView;
|
||||
ImageView imageview;
|
||||
|
||||
public MyViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
|
||||
tv_store_name = (TextView) itemView.findViewById(R.id.tv_store_name);
|
||||
tv_store_address = (TextView) itemView.findViewById(R.id.tv_store_address);
|
||||
cardView = (CardView) itemView.findViewById(R.id.card_view);
|
||||
imageview = (ImageView) itemView.findViewById(R.id.delivery_ico);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
|
||||
deliveryCallsList = database.getDeliveryCallsData(visit_date);
|
||||
|
||||
if (deliveryCallsList.size() > 0) {
|
||||
//list.setAdapter(new MyAdaptor());
|
||||
deliveryAdapter = new DeliveryAdapter(getApplicationContext(), deliveryCallsList);
|
||||
recyclerView.setAdapter(deliveryAdapter);
|
||||
recyclerView.setLayoutManager(new LinearLayoutManager(this));
|
||||
|
||||
if (isCheckedIn()) {
|
||||
fab_upload.setVisibility(View.GONE);
|
||||
} else if (isUploadAble()) {
|
||||
fab_upload.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private Dialog dialog;
|
||||
private ProgressBar pb;
|
||||
private TextView percentage, message;
|
||||
Object result = "";
|
||||
|
||||
class Data {
|
||||
int value;
|
||||
String name;
|
||||
}
|
||||
|
||||
class UploadTask extends AsyncTask<Void, Data, String> {
|
||||
|
||||
@Override
|
||||
protected void onPreExecute() {
|
||||
super.onPreExecute();
|
||||
dialog = new Dialog(DeliveryCallActivity.this);
|
||||
dialog.setContentView(R.layout.custom);
|
||||
dialog.setTitle(getString(R.string.uploaddata));
|
||||
dialog.setCancelable(false);
|
||||
dialog.show();
|
||||
|
||||
pb = (ProgressBar) dialog.findViewById(R.id.progressBar1);
|
||||
percentage = (TextView) dialog.findViewById(R.id.percentage);
|
||||
message = (TextView) dialog.findViewById(R.id.message);
|
||||
((TextView) dialog.findViewById(R.id.tv_title)).setText(getString(R.string.uploaddata));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onProgressUpdate(Data... values) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
pb.setProgress(values[0].value);
|
||||
percentage.setText(values[0].value + "%");
|
||||
message.setText(values[0].name);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String doInBackground(Void... voids) {
|
||||
try {
|
||||
Data data = new Data();
|
||||
ArrayList<DeliveryCallsGetterSetter> _deliveryCallsList = database.getDeliveryCallsData(null);
|
||||
for (int i = 0; i < _deliveryCallsList.size(); i++) {
|
||||
|
||||
if (_deliveryCallsList.get(i).getUPLOAD_STATUS().equals(CommonString.KEY_C)) {
|
||||
|
||||
data.value = 50;
|
||||
data.name = getString(R.string.delivery_call);
|
||||
publishProgress(data);
|
||||
|
||||
String store_name = URLEncoder.encode(_deliveryCallsList.get(i).getSTORE_NAME(), "utf-8");
|
||||
String store_address = URLEncoder.encode(_deliveryCallsList.get(i).getADDRESS(), "utf-8");
|
||||
|
||||
String onXML = "[DELIVERY_CALLS_DATA]"
|
||||
+ "[USER_ID]" + userId + "[/USER_ID]"
|
||||
+ "[VISIT_DATE]" + _deliveryCallsList.get(i).getVISIT_DATE() + "[/VISIT_DATE]"
|
||||
+ "[STORE_NAME]" + store_name + "[/STORE_NAME]"
|
||||
+ "[STORE_ADDRESS]" + store_address + "[/STORE_ADDRESS]"
|
||||
+ "[IN_TIME]" + _deliveryCallsList.get(i).getIn_time() + "[/IN_TIME]"
|
||||
+ "[OUT_TIME]" + _deliveryCallsList.get(i).getOut_time() + "[/OUT_TIME]"
|
||||
+ "[IN_TIME_IMAGE]" + _deliveryCallsList.get(i).getIN_TIME_IMAGE() + "[/IN_TIME_IMAGE]"
|
||||
+ "[OUT_TIME_IMAGE]" + _deliveryCallsList.get(i).getOUT_TIME_IMAGE()+ "[/OUT_TIME_IMAGE]"
|
||||
+ "[LATITUDE]" + _deliveryCallsList.get(i).getLATITUDE()+ "[/LATITUDE]"
|
||||
+ "[LONGITUDE]" + _deliveryCallsList.get(i).getLONGITUDE()+ "[/LONGITUDE]"
|
||||
+ "[/DELIVERY_CALLS_DATA]";
|
||||
|
||||
final String delivery_xml = "[DATA]" + onXML + "[/DATA]";
|
||||
|
||||
SoapObject request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||
request.addProperty("XMLDATA", delivery_xml);
|
||||
request.addProperty("KEYS", "DELIVERY_CALLS");
|
||||
request.addProperty("USERNAME", userId);
|
||||
request.addProperty("MID", 0);
|
||||
|
||||
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||
result = envelope.getResponse();
|
||||
if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return CommonString.METHOD_UPLOAD_STOCK_XML_DATA;
|
||||
}
|
||||
else {
|
||||
database.open();
|
||||
database.updateDeliveryCallsUploadStatus(_deliveryCallsList.get(i).getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result.toString();
|
||||
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
Crashlytics.logException(e.getCause());
|
||||
Crashlytics.logException(new Exception(e.getCause()));
|
||||
e.printStackTrace();
|
||||
} catch (XmlPullParserException e) {
|
||||
e.printStackTrace();
|
||||
} catch (Exception e) {
|
||||
Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
Crashlytics.logException(e.getCause());
|
||||
Crashlytics.logException(new Exception(e.getCause()));
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(String result) {
|
||||
super.onPostExecute(result);
|
||||
|
||||
dialog.dismiss();
|
||||
if (result.contains(CommonString.KEY_SUCCESS)) {
|
||||
//db.deleteAllTables();
|
||||
|
||||
File f = new File(CommonString.FILE_PATH);
|
||||
File fileAll[] = f.listFiles();
|
||||
ArrayList<String> file_list = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < fileAll.length; i++) {
|
||||
String name = fileAll[i].getName();
|
||||
if(name.contains("DeliveryCalls")){
|
||||
file_list.add(name);
|
||||
}
|
||||
}
|
||||
|
||||
UploadImageWithRetrofit.uploadedFiles = 0;
|
||||
UploadImageWithRetrofit.totalFiles = file_list.size();
|
||||
UploadImageWithRetrofit uploadImg = new UploadImageWithRetrofit(visit_date, userId, DeliveryCallActivity.this);
|
||||
uploadImg.UploadDeliveryImageRecursive(DeliveryCallActivity.this, file_list, 0);
|
||||
|
||||
} else {
|
||||
showAlert(getString(R.string.error) + result.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void showAlert(String str) {
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(DeliveryCallActivity.this);
|
||||
builder.setTitle("Parinaam");
|
||||
builder.setMessage(str).setCancelable(false)
|
||||
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
||||
/* Intent i = new Intent(activity, StorelistActivity.class);
|
||||
activity.startActivity(i);
|
||||
activity.finish();*/
|
||||
finish();
|
||||
|
||||
}
|
||||
});
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
}
|
||||
|
||||
|
||||
boolean isCheckedIn() {
|
||||
boolean flag = false;
|
||||
for (int i = 0; i < deliveryCallsList.size(); i++) {
|
||||
if (deliveryCallsList.get(i).getUPLOAD_STATUS().equals(CommonString.KEY_CHECK_IN)) {
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
boolean isUploadAble() {
|
||||
boolean flag = false;
|
||||
for (int i = 0; i < deliveryCallsList.size(); i++) {
|
||||
if (deliveryCallsList.get(i).getUPLOAD_STATUS().equals(CommonString.KEY_C)) {
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
+558
@@ -0,0 +1,558 @@
|
||||
package cpm.com.gskmtorange.dailyentry;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentSender;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.location.Location;
|
||||
import android.location.LocationManager;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.provider.MediaStore;
|
||||
import android.provider.Settings;
|
||||
import android.support.design.widget.BaseTransientBottomBar;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.crashlytics.android.Crashlytics;
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.GooglePlayServicesUtil;
|
||||
import com.google.android.gms.common.api.GoogleApiClient;
|
||||
import com.google.android.gms.common.api.PendingResult;
|
||||
import com.google.android.gms.common.api.ResultCallback;
|
||||
import com.google.android.gms.common.api.Status;
|
||||
import com.google.android.gms.location.LocationListener;
|
||||
import com.google.android.gms.location.LocationRequest;
|
||||
import com.google.android.gms.location.LocationServices;
|
||||
import com.google.android.gms.location.LocationSettingsRequest;
|
||||
import com.google.android.gms.location.LocationSettingsResult;
|
||||
import com.google.android.gms.location.LocationSettingsStatusCodes;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.DeliveryCallsGetterSetter;
|
||||
|
||||
public class DeliveryCallAddStoreActivity extends AppCompatActivity implements View.OnClickListener, GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener {
|
||||
|
||||
EditText et_customer, et_address;
|
||||
ImageView img_checkin, img_checkout;
|
||||
String name, address, error_msg, img_checkin_path="", img_checkout_path="";
|
||||
boolean checkin_flag = true;
|
||||
protected String _pathforcheck = "", _path, str, visit_date, in_time, out_time;
|
||||
private SharedPreferences preferences;
|
||||
Uri outputFileUri;
|
||||
String gallery_package = "";
|
||||
private GSKOrangeDB database;
|
||||
DeliveryCallsGetterSetter deliveryCallsData;
|
||||
|
||||
LocationManager locationManager;
|
||||
boolean enabled;
|
||||
private final static int PLAY_SERVICES_RESOLUTION_REQUEST = 1000;
|
||||
|
||||
private LocationRequest mLocationRequest;
|
||||
private static int UPDATE_INTERVAL = 500; // 5 sec
|
||||
private static int FATEST_INTERVAL = 100; // 1 sec
|
||||
private static int DISPLACEMENT = 5; // 10 meters
|
||||
private static final int REQUEST_LOCATION = 1;
|
||||
private Location mLastLocation;
|
||||
|
||||
double lat = 0.0, lon = 0.0;
|
||||
GoogleApiClient mGoogleApiClient;
|
||||
private static final String TAG = DeliveryCallAddStoreActivity.class.getSimpleName();
|
||||
Context context;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_delivery_call_add_store);
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
|
||||
database = new GSKOrangeDB(this);
|
||||
database.open();
|
||||
|
||||
context = this;
|
||||
|
||||
et_customer = findViewById(R.id.et_customer_name);
|
||||
et_address = findViewById(R.id.et_address);
|
||||
img_checkin = findViewById(R.id.img_checkin);
|
||||
img_checkout = findViewById(R.id.img_checkout);
|
||||
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
visit_date = preferences.getString(CommonString.KEY_DATE, null);
|
||||
|
||||
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
|
||||
checkin_flag = getIntent().getBooleanExtra(CommonString.KEY_STORE_FLAG, true);
|
||||
deliveryCallsData = (DeliveryCallsGetterSetter) getIntent().getSerializableExtra(CommonString.KEY_STORE_ID);
|
||||
|
||||
if(checkin_flag){
|
||||
img_checkin.setOnClickListener(this);
|
||||
}
|
||||
else {
|
||||
et_customer.setText(deliveryCallsData.getSTORE_NAME());
|
||||
et_address.setText(deliveryCallsData.getADDRESS());
|
||||
et_customer.setEnabled(false);
|
||||
et_address.setEnabled(false);
|
||||
img_checkin.setImageDrawable(getResources().getDrawable(R.mipmap.camera_green));
|
||||
img_checkout.setOnClickListener(this);
|
||||
}
|
||||
|
||||
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if(isValid()){
|
||||
|
||||
if(checkin_flag){
|
||||
|
||||
if(lat == 0.0 || lon == 0.0){
|
||||
|
||||
}
|
||||
else {
|
||||
DeliveryCallsGetterSetter deliveryCallsGetterSetter = new DeliveryCallsGetterSetter();
|
||||
deliveryCallsGetterSetter.setSTORE_NAME(name);
|
||||
deliveryCallsGetterSetter.setADDRESS(address);
|
||||
deliveryCallsGetterSetter.setIN_TIME_IMAGE(img_checkin_path);
|
||||
deliveryCallsGetterSetter.setOUT_TIME_IMAGE(img_checkout_path);
|
||||
deliveryCallsGetterSetter.setUPLOAD_STATUS(CommonString.KEY_CHECK_IN);
|
||||
deliveryCallsGetterSetter.setVISIT_DATE(visit_date);
|
||||
deliveryCallsGetterSetter.setIn_time(in_time);
|
||||
deliveryCallsGetterSetter.setLATITUDE(lat);
|
||||
deliveryCallsGetterSetter.setLONGITUDE(lon);
|
||||
|
||||
database.InsertDeliveryCalls(deliveryCallsGetterSetter);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
deliveryCallsData.setOut_time(out_time);
|
||||
database.updateDeliveryCallsOut(deliveryCallsData, CommonString.KEY_C, img_checkout_path);
|
||||
}
|
||||
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
else {
|
||||
Snackbar.make(et_customer,error_msg,Snackbar.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
str = CommonString.FILE_PATH;
|
||||
|
||||
if (checkPlayServices()) {
|
||||
|
||||
// Building the GoogleApi client
|
||||
buildGoogleApiClient();
|
||||
|
||||
createLocationRequest();
|
||||
}
|
||||
|
||||
/* locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
|
||||
enabled = locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
|
||||
|
||||
if (!enabled) {
|
||||
AlertDialog.Builder alertDialog = new AlertDialog.Builder(
|
||||
DeliveryCallAddStoreActivity.this);
|
||||
|
||||
// Setting Dialog Title
|
||||
alertDialog.setTitle(getResources().getString(R.string.gps));
|
||||
|
||||
// Setting Dialog Message
|
||||
alertDialog.setMessage(getResources().getString(R.string.gpsebale));
|
||||
|
||||
// Setting Positive "Yes" Button
|
||||
alertDialog.setPositiveButton(getResources().getString(R.string.yes),
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
|
||||
Intent intent = new Intent(
|
||||
Settings.ACTION_LOCATION_SOURCE_SETTINGS);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
// Setting Negative "NO" Button
|
||||
alertDialog.setNegativeButton(getResources().getString(R.string.no),
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
// Write your code here to invoke NO event
|
||||
|
||||
dialog.cancel();
|
||||
}
|
||||
});
|
||||
|
||||
// Showing Alert Message
|
||||
alertDialog.show();
|
||||
|
||||
}*/
|
||||
|
||||
// Create an instance of GoogleAPIClient.
|
||||
if (mGoogleApiClient == null) {
|
||||
mGoogleApiClient = new GoogleApiClient.Builder(this)
|
||||
.addConnectionCallbacks(this)
|
||||
.addOnConnectionFailedListener(this)
|
||||
.addApi(LocationServices.API)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
|
||||
|
||||
checkgpsEnableDevice();
|
||||
// Resuming the periodic location updates
|
||||
if (mGoogleApiClient.isConnected()) {
|
||||
startLocationUpdates();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkgpsEnableDevice() {
|
||||
boolean flag = true;
|
||||
if (!hasGPSDevice(context)) {
|
||||
Toast.makeText(context, "Gps not Supported",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
final LocationManager manager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
|
||||
if (!manager.isProviderEnabled(LocationManager.GPS_PROVIDER) && hasGPSDevice(context)) {
|
||||
enableLoc();
|
||||
flag = false;
|
||||
} else if (manager.isProviderEnabled(LocationManager.GPS_PROVIDER) && hasGPSDevice(context)) {
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
private boolean hasGPSDevice(Context context) {
|
||||
final LocationManager mgr = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
|
||||
if (mgr == null)
|
||||
return false;
|
||||
final List<String> providers = mgr.getAllProviders();
|
||||
if (providers == null)
|
||||
return false;
|
||||
return providers.contains(LocationManager.GPS_PROVIDER);
|
||||
}
|
||||
|
||||
private void enableLoc() {
|
||||
LocationRequest locationRequest = LocationRequest.create();
|
||||
locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
|
||||
locationRequest.setInterval(30 * 1000);
|
||||
locationRequest.setFastestInterval(5 * 1000);
|
||||
LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder().addLocationRequest(locationRequest);
|
||||
builder.setAlwaysShow(true);
|
||||
if (mGoogleApiClient != null) {
|
||||
PendingResult<LocationSettingsResult> result = LocationServices.SettingsApi.checkLocationSettings(mGoogleApiClient, builder.build());
|
||||
result.setResultCallback(new ResultCallback<LocationSettingsResult>() {
|
||||
@Override
|
||||
public void onResult(LocationSettingsResult result) {
|
||||
final Status status = result.getStatus();
|
||||
switch (status.getStatusCode()) {
|
||||
case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:
|
||||
try {
|
||||
// Show the dialog by calling startResolutionForResult(),
|
||||
// and check the result in onActivityResult().
|
||||
status.startResolutionForResult((Activity) context, REQUEST_LOCATION);
|
||||
} catch (IntentSender.SendIntentException e) {
|
||||
// Ignore the error.
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean isValid(){
|
||||
boolean flag = true;
|
||||
|
||||
name = et_customer.getText().toString().replaceAll("[&^<>{}'$]", " ");
|
||||
address = et_address.getText().toString().replaceAll("[&^<>{}'$]", " ");
|
||||
|
||||
if(name.equals("")){
|
||||
error_msg = getString(R.string.please_fill) + " "+ getString(R.string.customer_store_name);
|
||||
flag = false;
|
||||
}
|
||||
else if(address.equals("")){
|
||||
error_msg = getString(R.string.please_fill) + " "+ getString(R.string.address);
|
||||
flag = false;
|
||||
}
|
||||
else if(checkin_flag){
|
||||
if(img_checkin_path.equals("")){
|
||||
error_msg = getString(R.string.please_click) + " "+ getString(R.string.intime_image).toLowerCase();
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
else if(img_checkout_path.equals("")){
|
||||
error_msg = getString(R.string.please_click) + " "+ getString(R.string.outtime_image).toLowerCase();
|
||||
flag = false;
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()){
|
||||
case R.id.img_checkin:
|
||||
|
||||
in_time = CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext());
|
||||
|
||||
_pathforcheck = "DeliveryCalls" + visit_date.replace("/", "")+ "InTime" + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||
|
||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
||||
|
||||
startCameraActivity(0);
|
||||
break;
|
||||
|
||||
case R.id.img_checkout:
|
||||
|
||||
out_time = CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext());
|
||||
|
||||
_pathforcheck = "DeliveryCalls" + visit_date.replace("/", "")+ "OutTime" + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||
|
||||
_path = CommonString.FILE_PATH + _pathforcheck;
|
||||
|
||||
startCameraActivity(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
protected void startCameraActivity(int request_code) {
|
||||
try {
|
||||
|
||||
Log.i("MakeMachine", "startCameraActivity()");
|
||||
File file = new File(_path);
|
||||
outputFileUri = Uri.fromFile(file);
|
||||
|
||||
String defaultCameraPackage = "";
|
||||
final PackageManager packageManager = getPackageManager();
|
||||
List<ApplicationInfo> list = packageManager.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES);
|
||||
for (int n = 0; n < list.size(); n++) {
|
||||
if ((list.get(n).flags & ApplicationInfo.FLAG_SYSTEM) == 1) {
|
||||
Log.e("TAG", "Installed Applications : " + list.get(n).loadLabel(packageManager).toString());
|
||||
Log.e("TAG", "package name : " + list.get(n).packageName);
|
||||
|
||||
//temp value in case camera is gallery app above jellybean
|
||||
String packag = list.get(n).loadLabel(packageManager).toString();
|
||||
if (packag.equalsIgnoreCase("Gallery") || packag.equalsIgnoreCase("Galeri") ||packag.equalsIgnoreCase("الاستوديو") ) {
|
||||
gallery_package = list.get(n).packageName;
|
||||
}
|
||||
|
||||
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
|
||||
if (packag.equalsIgnoreCase("Camera") || packag.equalsIgnoreCase("Kamera")|| packag.equalsIgnoreCase("الكاميرا")) {
|
||||
defaultCameraPackage = list.get(n).packageName;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
||||
if (packag.equalsIgnoreCase("Camera") || packag.equalsIgnoreCase("Kamera")|| packag.equalsIgnoreCase("الكاميرا")) {
|
||||
|
||||
defaultCameraPackage = list.get(n).packageName;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//com.android.gallery3d
|
||||
|
||||
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||
intent.setPackage(defaultCameraPackage);
|
||||
startActivityForResult(intent, request_code);
|
||||
} catch (ActivityNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
|
||||
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
|
||||
intent.setPackage(gallery_package);
|
||||
startActivityForResult(intent, request_code);
|
||||
|
||||
} catch (Exception e) {
|
||||
Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
Crashlytics.logException(e.getCause());
|
||||
Crashlytics.logException(new Exception(e.getCause()));
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
Log.i("MakeMachine", "resultCode: " + resultCode);
|
||||
switch (resultCode) {
|
||||
case 0:
|
||||
Log.i("MakeMachine", "User cancelled");
|
||||
break;
|
||||
|
||||
case -1:
|
||||
|
||||
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
||||
if (new File(str + _pathforcheck).exists()) {
|
||||
|
||||
if(requestCode == 0){
|
||||
img_checkin.setImageDrawable(getResources().getDrawable(R.mipmap.camera_green));
|
||||
img_checkin_path = _pathforcheck;
|
||||
}
|
||||
else {
|
||||
img_checkout.setImageDrawable(getResources().getDrawable(R.mipmap.camera_green));
|
||||
img_checkout_path = _pathforcheck;
|
||||
}
|
||||
_pathforcheck = "";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private boolean checkPlayServices() {
|
||||
int resultCode = GooglePlayServicesUtil
|
||||
.isGooglePlayServicesAvailable(this);
|
||||
if (resultCode != ConnectionResult.SUCCESS) {
|
||||
if (GooglePlayServicesUtil.isUserRecoverableError(resultCode)) {
|
||||
GooglePlayServicesUtil.getErrorDialog(resultCode, this,
|
||||
PLAY_SERVICES_RESOLUTION_REQUEST).show();
|
||||
} else {
|
||||
Toast.makeText(getApplicationContext(), getResources().getString(R.string.notsuppoted)
|
||||
, Toast.LENGTH_LONG)
|
||||
.show();
|
||||
finish();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected synchronized void buildGoogleApiClient() {
|
||||
mGoogleApiClient = new GoogleApiClient.Builder(this)
|
||||
.addConnectionCallbacks(this)
|
||||
.addOnConnectionFailedListener(this)
|
||||
.addApi(LocationServices.API).build();
|
||||
}
|
||||
|
||||
|
||||
protected void createLocationRequest() {
|
||||
mLocationRequest = new LocationRequest();
|
||||
mLocationRequest.setInterval(UPDATE_INTERVAL);
|
||||
mLocationRequest.setFastestInterval(FATEST_INTERVAL);
|
||||
mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
|
||||
mLocationRequest.setSmallestDisplacement(DISPLACEMENT);
|
||||
}
|
||||
|
||||
protected void startLocationUpdates() {
|
||||
|
||||
|
||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED
|
||||
|| ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
|
||||
|
||||
LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Stopping location updates
|
||||
*/
|
||||
protected void stopLocationUpdates() {
|
||||
LocationServices.FusedLocationApi.removeLocationUpdates(mGoogleApiClient, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnected(Bundle bundle) {
|
||||
|
||||
mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
|
||||
|
||||
if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED
|
||||
|| ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
|
||||
if (mLastLocation != null) {
|
||||
lat = mLastLocation.getLatitude();
|
||||
lon = mLastLocation.getLongitude();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// if (mRequestingLocationUpdates) {
|
||||
startLocationUpdates();
|
||||
// }
|
||||
|
||||
// startLocationUpdates();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectionSuspended(int i) {
|
||||
mGoogleApiClient.connect();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onConnectionFailed(ConnectionResult connectionResult) {
|
||||
Log.i(TAG, "Connection failed: ConnectionResult.getErrorCode() = " + connectionResult.getErrorCode());
|
||||
}
|
||||
|
||||
|
||||
protected void onStart() {
|
||||
super.onStart();// ATTENTION: This was auto-generated to implement the App Indexing API.
|
||||
// See https://g.co/AppIndexing/AndroidStudio for more information.
|
||||
//client.connect();
|
||||
if (mGoogleApiClient != null) {
|
||||
mGoogleApiClient.connect();
|
||||
}
|
||||
// ATTENTION: This was auto-generated to implement the App Indexing API.
|
||||
// See https://g.co/AppIndexing/AndroidStudio for more information.
|
||||
// AppIndex.AppIndexApi.start(client, getIndexApiAction());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();// ATTENTION: This was auto-generated to implement the App Indexing API.
|
||||
// See https://g.co/AppIndexing/AndroidStudio for more information.
|
||||
// AppIndex.AppIndexApi.end(client, getIndexApiAction());
|
||||
/* if (mGoogleApiClient.isConnected()) {
|
||||
mGoogleApiClient.disconnect();
|
||||
}*/
|
||||
// ATTENTION: This was auto-generated to implement the App Indexing API.
|
||||
// See https://g.co/AppIndexing/AndroidStudio for more information.
|
||||
//client.disconnect();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
//stopLocationUpdates();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocationChanged(Location location) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -137,8 +137,15 @@ public class NoCameraActivity extends AppCompatActivity implements Listener {
|
||||
rvTop.setOnDragListener(topListAdapter.getDragInstance());
|
||||
|
||||
if (FROM == 1) {
|
||||
ArrayList<RowColumnGetterSetter> rows_data = db.getrowColumnNoCamera(store_id, categoryId, sub_category_data.getSub_category_id());
|
||||
String table_name = "NO_CAMERA_FACING_DATA";
|
||||
ArrayList<RowColumnGetterSetter> rows_data = db.getrowColumnNoCamera(store_id, categoryId, sub_category_data.getSub_category_id(), table_name);
|
||||
number_of_rows = rows_data.size();
|
||||
if(number_of_rows==0){
|
||||
table_name = "NO_CAMERA_LAST_VISIT_DATA";
|
||||
rows_data = db.getrowColumnNoCamera(store_id, categoryId, sub_category_data.getSub_category_id(), table_name);
|
||||
number_of_rows = rows_data.size();
|
||||
}
|
||||
|
||||
for (int i = 1; i <= rows_data.size(); i++) {
|
||||
|
||||
DynamycIdsGetterSetter dynamic_ids = new DynamycIdsGetterSetter();
|
||||
@@ -200,7 +207,7 @@ public class NoCameraActivity extends AppCompatActivity implements Listener {
|
||||
|
||||
for (int j = 1; j <= rows_data.get(i - 1).getColumn(); j++) {
|
||||
NoCameraDataGetterSetter column_data = new NoCameraDataGetterSetter();
|
||||
column_data = db.getRowSkuGroupCamera(store_id, categoryId, sub_category_data.getSub_category_id(), i, j);
|
||||
column_data = db.getRowSkuGroupCamera(store_id, categoryId, sub_category_data.getSub_category_id(), i, j, table_name);
|
||||
sku_group_master.add(column_data);
|
||||
}
|
||||
|
||||
@@ -838,7 +845,10 @@ public class NoCameraActivity extends AppCompatActivity implements Listener {
|
||||
for (int i = 0; i < ids.size(); i++) {
|
||||
List<NoCameraDataGetterSetter> customList = biglistMap.get(ids.get(i));
|
||||
|
||||
if(customList.size()>0 && !customList.get(0).getSKUGROUP_ID().equals("25")){
|
||||
if(customList.size()>0 && customList.get(0).getSKUGROUP_ID().equals("25")){
|
||||
|
||||
}
|
||||
else{
|
||||
|
||||
//if (customList.size() < max) {
|
||||
if (ids.get(i).getTotal_unit() < max) {
|
||||
@@ -1028,13 +1038,13 @@ public class NoCameraActivity extends AppCompatActivity implements Listener {
|
||||
planogram_image = mappingPlanogramList.get(0).getPLANOGRAM_IMAGE();
|
||||
}
|
||||
if (!planogram_image.equals("")) {
|
||||
if (new File(str + planogram_image).exists()) {
|
||||
Bitmap bmp = BitmapFactory.decodeFile(str + planogram_image);
|
||||
if (new File(CommonString.FILE_PATH_PLANOGRAM + planogram_image).exists()) {
|
||||
Bitmap bmp = BitmapFactory.decodeFile(CommonString.FILE_PATH_PLANOGRAM + planogram_image);
|
||||
// img_planogram.setRotation(90);
|
||||
//img_planogram.setImageBitmap(bmp);
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||
|
||||
String imagePath = "file://" + CommonString.FILE_PATH + "/" + planogram_image;
|
||||
String imagePath = "file://" + CommonString.FILE_PATH_PLANOGRAM + "/" + planogram_image;
|
||||
String html = "<html><head></head><body><img src=\"" + imagePath + "\"></body></html>";
|
||||
webView.loadDataWithBaseURL("", html, "text/html", "utf-8", "");
|
||||
|
||||
|
||||
@@ -65,6 +65,7 @@ import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingSubReasonGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlHandlers.FailureXMLHandler;
|
||||
|
||||
|
||||
@@ -72,12 +73,13 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
OnItemSelectedListener, OnClickListener {
|
||||
|
||||
ArrayList<NonWorkingReasonGetterSetter> reasondata = new ArrayList<NonWorkingReasonGetterSetter>();
|
||||
private Spinner reasonspinner;
|
||||
ArrayList<NonWorkingSubReasonGetterSetter> sub_reasondata = new ArrayList<>();
|
||||
private Spinner reasonspinner, subreason_spinner;
|
||||
private GSKOrangeDB database;
|
||||
String reasonname, reasonid, entry_allow, image, entry, reason_reamrk, intime, image_allow;
|
||||
String reasonname, reasonid, entry_allow, image, entry, reason_reamrk, intime, image_allow, remark_allow, remark_type, sub_reason_id="";
|
||||
Button save;
|
||||
boolean ResultFlag = true;
|
||||
private ArrayAdapter<CharSequence> reason_adapter;
|
||||
private ArrayAdapter<CharSequence> reason_adapter, sub_reason_adapter;
|
||||
protected String _path, str,strflag;
|
||||
protected String _pathforcheck = "";
|
||||
private ArrayList<StoreBean> storedata = new ArrayList<StoreBean>();
|
||||
@@ -104,18 +106,23 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
private FailureGetterSetter failureGetterSetter = null;
|
||||
boolean nonflag=true;
|
||||
String store_flag_str;
|
||||
|
||||
TextView tv_remark;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
// TODO Auto-generated method stub
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.nonworkingmainlayout);
|
||||
|
||||
reasonspinner = (Spinner) findViewById(R.id.spinner2);
|
||||
reasonspinner = (Spinner) findViewById(R.id.spinner_reason);
|
||||
camera = (ImageButton) findViewById(R.id.imgcam);
|
||||
save = (Button) findViewById(R.id.save);
|
||||
text = (EditText) findViewById(R.id.reasontxt);
|
||||
tv_remark = (TextView) findViewById(R.id.tv_remark);
|
||||
reason_lay = (RelativeLayout) findViewById(R.id.layout_reason);
|
||||
rel_cam = (RelativeLayout) findViewById(R.id.relimgcam);
|
||||
subreason_spinner = (Spinner) findViewById(R.id.spinner_sub_reason);
|
||||
|
||||
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
|
||||
setSupportActionBar(toolbar);
|
||||
@@ -154,7 +161,6 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
{
|
||||
nonflag=false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (nonflag) {
|
||||
@@ -165,7 +171,6 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
|
||||
}
|
||||
|
||||
|
||||
intime = CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext());
|
||||
|
||||
camera.setOnClickListener(this);
|
||||
@@ -203,13 +208,15 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
switch (arg0.getId()) {
|
||||
case R.id.spinner2:
|
||||
case R.id.spinner_reason:
|
||||
if (position != 0) {
|
||||
reasonname = reasondata.get(position - 1).getREASON().get(0);
|
||||
reasonid = reasondata.get(position - 1).getREASON_ID().get(0);
|
||||
entry_allow = reasondata.get(position - 1).getENTRY_ALLOW().get(0);
|
||||
|
||||
image_allow = reasondata.get(position - 1).getIMAGE_ALLOW().get(0);
|
||||
remark_allow = reasondata.get(position - 1).getREMARK_REQUIRED().get(0);
|
||||
remark_type = reasondata.get(position - 1).getREMARK_TYPE().get(0);
|
||||
|
||||
if (image_allow.equalsIgnoreCase("1")) {
|
||||
rel_cam.setVisibility(View.VISIBLE);
|
||||
@@ -218,15 +225,55 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
rel_cam.setVisibility(View.GONE);
|
||||
image = "false";
|
||||
}
|
||||
reason_reamrk = "true";
|
||||
if (reason_reamrk.equalsIgnoreCase("true")) {
|
||||
//reason_reamrk = "true";
|
||||
if (remark_allow.equalsIgnoreCase("1")) {
|
||||
reason_lay.setVisibility(View.VISIBLE);
|
||||
if(remark_type.equalsIgnoreCase("Text")){
|
||||
text.setVisibility(View.VISIBLE);
|
||||
subreason_spinner.setVisibility(View.GONE);
|
||||
}
|
||||
else {
|
||||
text.setVisibility(View.GONE);
|
||||
subreason_spinner.setVisibility(View.VISIBLE);
|
||||
|
||||
sub_reasondata = database.getNonWorkingSubReasonData(reasonid);
|
||||
|
||||
sub_reason_adapter = new ArrayAdapter<CharSequence>(this,
|
||||
android.R.layout.simple_spinner_item);
|
||||
|
||||
String select_str = getResources().getString(R.string.select_promo) + " " +reasondata.get(position - 1).getREMARK_LABEL().get(0);
|
||||
|
||||
sub_reason_adapter.add(select_str);
|
||||
|
||||
for (int i = 0; i < sub_reasondata.size(); i++) {
|
||||
sub_reason_adapter.add(sub_reasondata.get(i).getSUB_REASON().get(0));
|
||||
}
|
||||
|
||||
subreason_spinner.setAdapter(sub_reason_adapter);
|
||||
|
||||
sub_reason_adapter
|
||||
.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
|
||||
subreason_spinner.setOnItemSelectedListener(this);
|
||||
}
|
||||
tv_remark.setText(reasondata.get(position - 1).getREMARK_LABEL().get(0));
|
||||
} else {
|
||||
reason_lay.setVisibility(View.GONE);
|
||||
}
|
||||
} else {
|
||||
reasonname = "";
|
||||
reasonid = "";
|
||||
reason_lay.setVisibility(View.GONE);
|
||||
}
|
||||
break;
|
||||
|
||||
case R.id.spinner_sub_reason:
|
||||
|
||||
if (position != 0) {
|
||||
sub_reason_id = sub_reasondata.get(position-1).getSUB_REASON_ID().get(0);
|
||||
}
|
||||
else {
|
||||
sub_reason_id = "";
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -315,7 +362,6 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
|
||||
camera.setImageDrawable(getResources().getDrawable(R.mipmap.camera_green));
|
||||
|
||||
|
||||
image1 = _pathforcheck;
|
||||
|
||||
_pathforcheck = "";
|
||||
@@ -347,11 +393,11 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
public boolean textAllowed() {
|
||||
boolean result = true;
|
||||
|
||||
if(remark_type!=null && remark_type.equalsIgnoreCase("Text")){
|
||||
if (text.getText().toString().trim().equals("")) {
|
||||
|
||||
if (text.getText().toString().trim().equals("")) {
|
||||
|
||||
result = false;
|
||||
|
||||
result = false;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
@@ -374,7 +420,25 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
|
||||
if (imageAllowed()) {
|
||||
|
||||
if (textAllowed()) {
|
||||
boolean valid_flag = true;
|
||||
if(remark_allow.equalsIgnoreCase("1")){
|
||||
|
||||
if (textAllowed()) {
|
||||
|
||||
if(!validateSubReasonData()){
|
||||
valid_flag = false;
|
||||
Toast.makeText(getApplicationContext(), R.string.title_activity_select_dropdown,
|
||||
Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
} else {
|
||||
valid_flag = false;
|
||||
Toast.makeText(getApplicationContext(), R.string.pleaseenterRemarks,
|
||||
Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
if(valid_flag){
|
||||
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(
|
||||
NonWorkingReason.this);
|
||||
@@ -411,6 +475,7 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
cdata.setLatitude("0.0");
|
||||
cdata.setLongitude("0.0");
|
||||
cdata.setImage(image1);
|
||||
cdata.setSub_reasonId(sub_reason_id);
|
||||
|
||||
cdata.setRemark(text.getText().toString().replaceAll("[&^<>{}'$]", " "));
|
||||
cdata.setStatus(CommonString.STORE_STATUS_LEAVE);
|
||||
@@ -444,6 +509,7 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
cdata.setLatitude("0.0");
|
||||
cdata.setLongitude("0.0");
|
||||
cdata.setImage(image1);
|
||||
cdata.setSub_reasonId(sub_reason_id);
|
||||
|
||||
cdata.setRemark(text
|
||||
.getText()
|
||||
@@ -480,7 +546,7 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
|
||||
new NonWorkingReason.GeoTagUpload(NonWorkingReason.this).execute();
|
||||
|
||||
// finish();
|
||||
// finish();
|
||||
}
|
||||
})
|
||||
.setNegativeButton(R.string.closed,
|
||||
@@ -495,10 +561,8 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
alert = builder.create();
|
||||
alert.show();
|
||||
|
||||
} else {
|
||||
Toast.makeText(getApplicationContext(), R.string.pleaseenterRemarks,
|
||||
Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
} else {
|
||||
Toast.makeText(getApplicationContext(),
|
||||
R.string.title_activity_take_image, Toast.LENGTH_SHORT).show();
|
||||
@@ -517,9 +581,21 @@ public class NonWorkingReason extends AppCompatActivity implements
|
||||
if (reasonid != null && !reasonid.equalsIgnoreCase("")) {
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public boolean validateSubReasonData() {
|
||||
boolean result = false;
|
||||
if(remark_type!=null && remark_type.equalsIgnoreCase("List")){
|
||||
if (sub_reason_id != null && !sub_reason_id.equalsIgnoreCase("")) {
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
result = true;
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
private static String arabicToenglish(String number) {
|
||||
|
||||
@@ -50,7 +50,7 @@ public class POGQuestionsActivity extends AppCompatActivity {
|
||||
ExpandableListView expandableListView;
|
||||
|
||||
String categoryName, categoryId, Error_Message = "";
|
||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, country_id;
|
||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, country_id, pog_type_id;
|
||||
boolean isDialogOpen = true;
|
||||
private SharedPreferences preferences;
|
||||
int scrollPosition = 0;
|
||||
@@ -91,6 +91,7 @@ public class POGQuestionsActivity extends AppCompatActivity {
|
||||
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
||||
camera_allow = preferences.getString(CommonString.KEY_CAMERA_ALLOW, "");
|
||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, "");
|
||||
pog_type_id = preferences.getString(CommonString.KEY_POG_TYPE_ID, "");
|
||||
|
||||
//Intent data
|
||||
categoryName = getIntent().getStringExtra("categoryName");
|
||||
@@ -198,7 +199,7 @@ public class POGQuestionsActivity extends AppCompatActivity {
|
||||
void prepareListData(){
|
||||
headerDataList = new ArrayList<>();
|
||||
|
||||
headerDataList = db.getSubCategoryMasterForPOG(categoryId);
|
||||
headerDataList = db.getSubCategoryMasterForPOG(categoryId, storeType_id, pog_type_id);
|
||||
|
||||
if (headerDataList.size() > 0) {
|
||||
for (int i = 0; i < headerDataList.size(); i++) {
|
||||
@@ -206,7 +207,7 @@ public class POGQuestionsActivity extends AppCompatActivity {
|
||||
ArrayList<POGGetterSetter> quizDataList = db.getAfterSavePOGQuestionAnswerData(store_id, categoryId, headerDataList.get(i).getSub_category_id());
|
||||
|
||||
if(quizDataList.size()==0){
|
||||
quizDataList = db.getPOGSubCategoryWise(headerDataList.get(i).getSub_category_id());
|
||||
quizDataList = db.getPOGSubCategoryWise(headerDataList.get(i).getSub_category_id(), pog_type_id, storeType_id);
|
||||
}
|
||||
|
||||
//hashMapListChildData = new HashMap<>();
|
||||
@@ -368,7 +369,7 @@ public class POGQuestionsActivity extends AppCompatActivity {
|
||||
}
|
||||
});
|
||||
|
||||
holder.txt_question.setText(childData.getQUESTION());
|
||||
holder.txt_question.setText(childData.getQUESTION() + " ("+childData.getQTYPE()+")");
|
||||
|
||||
for (int i = 0; i < ans_list.size(); i++) {
|
||||
if ( ans_list.get(i).getANSWER_ID().equals(childData.getANSWER_ID())) {
|
||||
|
||||
@@ -45,7 +45,7 @@ public class StockDataActivity extends AppCompatActivity {
|
||||
GSKOrangeDB db;
|
||||
|
||||
String categoryName, categoryId, storeId, Error_Message = "";
|
||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id;
|
||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, country_id;
|
||||
boolean isDialogOpen = true;
|
||||
private SharedPreferences preferences;
|
||||
int scrollPosition = 0;
|
||||
@@ -79,6 +79,7 @@ public class StockDataActivity extends AppCompatActivity {
|
||||
keyAccount_id = preferences.getString(CommonString.KEY_KEYACCOUNT_ID, "");
|
||||
class_id = preferences.getString(CommonString.KEY_CLASS_ID, "");
|
||||
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, "");
|
||||
|
||||
expandableListView = (ExpandableListView) findViewById(R.id.expandableListView);
|
||||
|
||||
@@ -232,7 +233,12 @@ public class StockDataActivity extends AppCompatActivity {
|
||||
hashMapListChildData = new HashMap<>();
|
||||
|
||||
//Header
|
||||
headerDataList = db.getStockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id);
|
||||
if(country_id.equals("7")){
|
||||
headerDataList = db.getStockFacingHeaderData(categoryId, null, null, null, store_id);
|
||||
}
|
||||
else {
|
||||
headerDataList = db.getStockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id);
|
||||
}
|
||||
|
||||
if (headerDataList.size() > 0) {
|
||||
for (int i = 0; i < headerDataList.size(); i++) {
|
||||
@@ -241,7 +247,7 @@ public class StockDataActivity extends AppCompatActivity {
|
||||
//childDataList = new ArrayList<>();
|
||||
childDataList = db.getMSL_Availability_StockFacingSKU_AfterSaveData(categoryId, headerDataList.get(i).getBrand_id(), store_id);
|
||||
if (!(childDataList.size() > 0)) {
|
||||
childDataList = db.getMSL_Availability_StockFacingSKUData(categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id);
|
||||
childDataList = db.getMSL_Availability_StockFacingSKUData(categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, null);
|
||||
}
|
||||
|
||||
hashMapListChildData.put(hashMapListHeaderData.get(i), childDataList);
|
||||
|
||||
@@ -1,19 +1,28 @@
|
||||
package cpm.com.gskmtorange.dailyentry;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentSender;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.location.Location;
|
||||
import android.location.LocationManager;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.provider.Settings;
|
||||
import android.support.design.widget.FloatingActionButton;
|
||||
import android.support.design.widget.Snackbar;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.app.AppCompatActivity;
|
||||
import android.support.v7.widget.CardView;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
@@ -32,6 +41,21 @@ import android.widget.LinearLayout;
|
||||
import android.widget.RadioGroup;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.google.android.gms.common.ConnectionResult;
|
||||
import com.google.android.gms.common.GooglePlayServicesUtil;
|
||||
import com.google.android.gms.common.api.GoogleApiClient;
|
||||
import com.google.android.gms.common.api.PendingResult;
|
||||
import com.google.android.gms.common.api.ResultCallback;
|
||||
import com.google.android.gms.common.api.Status;
|
||||
import com.google.android.gms.location.LocationListener;
|
||||
import com.google.android.gms.location.LocationRequest;
|
||||
import com.google.android.gms.location.LocationServices;
|
||||
import com.google.android.gms.location.LocationSettingsRequest;
|
||||
import com.google.android.gms.location.LocationSettingsResult;
|
||||
import com.google.android.gms.location.LocationSettingsStatusCodes;
|
||||
import com.google.android.gms.maps.model.LatLng;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -40,6 +64,7 @@ import java.util.Locale;
|
||||
|
||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
||||
import cpm.com.gskmtorange.GetterSetter.GeotaggingBeans;
|
||||
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||
@@ -49,12 +74,14 @@ import cpm.com.gskmtorange.gsk_dailyentry.StoreWisePerformanceActivity;
|
||||
import cpm.com.gskmtorange.storeinmap.StoreListMapActivity;
|
||||
import cpm.com.gskmtorange.storeinmap.StoreListRouteActivity;
|
||||
import cpm.com.gskmtorange.storeinmap.StoreRouteActivity;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.GeoFencingGetterSetter;
|
||||
|
||||
/**
|
||||
* Created by ashishc on 29-12-2016.
|
||||
*/
|
||||
|
||||
public class StoreListActivity extends AppCompatActivity {
|
||||
public class StoreListActivity extends AppCompatActivity implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, LocationListener {
|
||||
ArrayList<CoverageBean> coverage = new ArrayList<CoverageBean>();
|
||||
ArrayList<StoreBean> storelist = new ArrayList<StoreBean>();
|
||||
//ListView list;
|
||||
@@ -71,9 +98,27 @@ public class StoreListActivity extends AppCompatActivity {
|
||||
FloatingActionButton fab;
|
||||
//String storeid;
|
||||
Toolbar toolbar;
|
||||
String language;
|
||||
String language, country_id;
|
||||
String store_flag_str;
|
||||
|
||||
Context context;
|
||||
boolean enabled = true;
|
||||
GoogleApiClient mGoogleApiClient;
|
||||
double lat = 0.0, lon = 0.0;
|
||||
private LocationManager locmanager = null;
|
||||
ArrayList<GeotaggingBeans> geolist;
|
||||
//ArrayList<GeoPhencingGetterSetter> geoPhenceGetSet;
|
||||
int distanceGeoPhence = 500;
|
||||
private static int UPDATE_INTERVAL = 200; // 5 sec
|
||||
private static int FATEST_INTERVAL = 100; // 1 sec
|
||||
private static int DISPLACEMENT = 1; // 10 meters
|
||||
private static final int REQUEST_LOCATION = 1;
|
||||
private final static int PLAY_SERVICES_RESOLUTION_REQUEST = 1000;
|
||||
private Location mLastLocation;
|
||||
private LocationRequest mLocationRequest;
|
||||
|
||||
ArrayList<GeoFencingGetterSetter> geoFencingGetterSetters;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -84,6 +129,8 @@ public class StoreListActivity extends AppCompatActivity {
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
preferences = PreferenceManager.getDefaultSharedPreferences(this);
|
||||
|
||||
context = this;
|
||||
|
||||
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
|
||||
store_flag_str = getIntent().getStringExtra(CommonString.KEY_STORE_FLAG);
|
||||
@@ -91,6 +138,7 @@ public class StoreListActivity extends AppCompatActivity {
|
||||
date = preferences.getString(CommonString.KEY_DATE, null);
|
||||
visit_status = preferences.getString(CommonString.KEY_STOREVISITED_STATUS, "");
|
||||
language = preferences.getString(CommonString.KEY_LANGUAGE, "");
|
||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, "");
|
||||
db = new GSKOrangeDB(StoreListActivity.this);
|
||||
db.open();
|
||||
|
||||
@@ -110,6 +158,206 @@ public class StoreListActivity extends AppCompatActivity {
|
||||
}
|
||||
});
|
||||
|
||||
if (Build.VERSION.SDK_INT >= 23 && ContextCompat.checkSelfPermission(getApplicationContext(),
|
||||
android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&
|
||||
ContextCompat.checkSelfPermission(getApplicationContext(),
|
||||
android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (checkPlayServices()) {
|
||||
// Building the GoogleApi client
|
||||
buildGoogleApiClient();
|
||||
|
||||
createLocationRequest();
|
||||
}
|
||||
|
||||
// Create an instance of GoogleAPIClient.
|
||||
if (mGoogleApiClient == null) {
|
||||
mGoogleApiClient = new GoogleApiClient.Builder(this)
|
||||
.addConnectionCallbacks(this)
|
||||
.addOnConnectionFailedListener(this)
|
||||
.addApi(LocationServices.API)
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private boolean checkPlayServices() {
|
||||
int resultCode = GooglePlayServicesUtil
|
||||
.isGooglePlayServicesAvailable(this);
|
||||
if (resultCode != ConnectionResult.SUCCESS) {
|
||||
if (GooglePlayServicesUtil.isUserRecoverableError(resultCode)) {
|
||||
GooglePlayServicesUtil.getErrorDialog(resultCode, this,
|
||||
PLAY_SERVICES_RESOLUTION_REQUEST).show();
|
||||
} else {
|
||||
Toast.makeText(getApplicationContext(), getResources().getString(R.string.notsuppoted)
|
||||
, Toast.LENGTH_LONG)
|
||||
.show();
|
||||
finish();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected synchronized void buildGoogleApiClient() {
|
||||
if (mGoogleApiClient == null) {
|
||||
mGoogleApiClient = new GoogleApiClient.Builder(context)
|
||||
.addConnectionCallbacks(this)
|
||||
.addOnConnectionFailedListener(this)
|
||||
.addApi(LocationServices.API)
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
||||
protected void createLocationRequest() {
|
||||
mLocationRequest = new LocationRequest();
|
||||
mLocationRequest.setInterval(UPDATE_INTERVAL);
|
||||
mLocationRequest.setFastestInterval(FATEST_INTERVAL);
|
||||
mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
|
||||
mLocationRequest.setSmallestDisplacement(DISPLACEMENT);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectionSuspended(int i) {
|
||||
mGoogleApiClient.connect();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLocationChanged(Location location) {
|
||||
LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());
|
||||
|
||||
// Toast.makeText(this, " WORKS_lat_lon " + latLng, Toast.LENGTH_LONG).show();
|
||||
// updateLocation(latLng);
|
||||
if (mGoogleApiClient != null) {
|
||||
LocationServices.FusedLocationApi.removeLocationUpdates(mGoogleApiClient, this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void startLocationUpdates() {
|
||||
|
||||
if (ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED
|
||||
|| ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
|
||||
if (mGoogleApiClient != null) {
|
||||
LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);
|
||||
// Toast.makeText(getApplicationContext(), "startLocation - Lat" + lat + "Long" + lon, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static int distFrom(double lat1, double lng1, double lat2, double lng2) {
|
||||
double earthRadius = 6371000; //meters
|
||||
double dLat = Math.toRadians(lat2 - lat1);
|
||||
double dLng = Math.toRadians(lng2 - lng1);
|
||||
double a = Math.sin(dLat / 2) * Math.sin(dLat / 2) +
|
||||
Math.cos(Math.toRadians(lat1)) * Math.cos(Math.toRadians(lat2)) *
|
||||
Math.sin(dLng / 2) * Math.sin(dLng / 2);
|
||||
double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));
|
||||
int dist = (int) (earthRadius * c);
|
||||
|
||||
return dist;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnected(Bundle bundle) {
|
||||
mLastLocation = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient);
|
||||
if (ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED
|
||||
|| ContextCompat.checkSelfPermission(context, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
|
||||
if (mLastLocation != null) {
|
||||
lat = mLastLocation.getLatitude();
|
||||
lon = mLastLocation.getLongitude();
|
||||
// Toast.makeText(getApplicationContext(), "onconnected lat-" + lat + " Long-" + lon, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
startLocationUpdates();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectionFailed(ConnectionResult connectionResult) {
|
||||
if (mGoogleApiClient != null) {
|
||||
mGoogleApiClient.connect();
|
||||
}
|
||||
}
|
||||
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
if (mGoogleApiClient != null) {
|
||||
mGoogleApiClient.connect();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkgpsEnableDevice() {
|
||||
boolean flag = true;
|
||||
if (!hasGPSDevice(context)) {
|
||||
Toast.makeText(context, "Gps not Supported",Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
final LocationManager manager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
|
||||
if (!manager.isProviderEnabled(LocationManager.GPS_PROVIDER) && hasGPSDevice(context)) {
|
||||
enableLoc();
|
||||
flag = false;
|
||||
} else if (manager.isProviderEnabled(LocationManager.GPS_PROVIDER) && hasGPSDevice(context)) {
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
private boolean hasGPSDevice(Context context) {
|
||||
final LocationManager mgr = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE);
|
||||
if (mgr == null)
|
||||
return false;
|
||||
final List<String> providers = mgr.getAllProviders();
|
||||
if (providers == null)
|
||||
return false;
|
||||
return providers.contains(LocationManager.GPS_PROVIDER);
|
||||
}
|
||||
|
||||
private void enableLoc() {
|
||||
LocationRequest locationRequest = LocationRequest.create();
|
||||
locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
|
||||
locationRequest.setInterval(30 * 1000);
|
||||
locationRequest.setFastestInterval(5 * 1000);
|
||||
LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder().addLocationRequest(locationRequest);
|
||||
builder.setAlwaysShow(true);
|
||||
if (mGoogleApiClient != null) {
|
||||
PendingResult<LocationSettingsResult> result = LocationServices.SettingsApi.checkLocationSettings(mGoogleApiClient, builder.build());
|
||||
result.setResultCallback(new ResultCallback<LocationSettingsResult>() {
|
||||
@Override
|
||||
public void onResult(LocationSettingsResult result) {
|
||||
final Status status = result.getStatus();
|
||||
switch (status.getStatusCode()) {
|
||||
case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:
|
||||
try {
|
||||
// Show the dialog by calling startResolutionForResult(),
|
||||
// and check the result in onActivityResult().
|
||||
status.startResolutionForResult((Activity) context, REQUEST_LOCATION);
|
||||
} catch (IntentSender.SendIntentException e) {
|
||||
// Ignore the error.
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void GPSAlert() {
|
||||
AlertDialog.Builder alertDialog = new AlertDialog.Builder(context);
|
||||
alertDialog.setTitle("GPS IS DISABLED...");
|
||||
alertDialog.setMessage("Click ok to enable GPS.");
|
||||
alertDialog.setCancelable(false);
|
||||
alertDialog.setPositiveButton("YES",
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int which) {
|
||||
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
|
||||
startActivity(intent);
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
alertDialog.show();
|
||||
}
|
||||
|
||||
|
||||
@@ -117,6 +365,12 @@ public class StoreListActivity extends AppCompatActivity {
|
||||
// TODO Auto-generated method stub
|
||||
super.onResume();
|
||||
|
||||
if (mGoogleApiClient != null) {
|
||||
mGoogleApiClient.connect();
|
||||
|
||||
}
|
||||
checkgpsEnableDevice();
|
||||
|
||||
CommonFunctions.updateLangResources(getApplicationContext(), preferences.getString(CommonString.KEY_LANGUAGE, ""));
|
||||
//toolbar.setTitle(getString(R.string.title_activity_store_list));
|
||||
db.open();
|
||||
@@ -132,6 +386,8 @@ public class StoreListActivity extends AppCompatActivity {
|
||||
|
||||
coverage = db.getCoverageData(date, store_flag_str);
|
||||
|
||||
geoFencingGetterSetters = db.getGeoFencing(country_id);
|
||||
|
||||
|
||||
if (storelist.size() > 0) {
|
||||
//list.setAdapter(new MyAdaptor());
|
||||
@@ -487,18 +743,43 @@ public class StoreListActivity extends AppCompatActivity {
|
||||
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
||||
if (CheckNetAvailability()) {
|
||||
boolean coaching_visit_flag=false;
|
||||
//Enable disable According to Configuration
|
||||
ArrayList<ConfigurationMasterGetterSetter> configurationData = db.getConfigurationMasterData(country_id);
|
||||
if(configurationData.size()>0){
|
||||
|
||||
for(int i=0; i<configurationData.size();i++){
|
||||
if(configurationData.get(i).getCONFIGURE().get(0).equalsIgnoreCase("COACHING VISIT") &&
|
||||
configurationData.get(i).getACTIVE().get(0).equalsIgnoreCase("1")){
|
||||
coaching_visit_flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(coaching_visit_flag){
|
||||
Intent intent = new Intent(StoreListActivity.this, CoachingVisitActivity.class);
|
||||
intent.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||
intent.putExtra(CommonString.KEY_STORE_ID, current.getSTORE_ID());
|
||||
startActivity(intent);
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
}
|
||||
else {
|
||||
if (CheckNetAvailability()) {
|
||||
/*Intent i = new Intent(StoreListActivity.this, CheckoutActivity.class);
|
||||
i.putExtra(CommonString.KEY_STORE_ID, current.getSTORE_ID());
|
||||
startActivity(i);*/
|
||||
|
||||
Intent i = new Intent(StoreListActivity.this, StoreCheckoutImageActivity.class);
|
||||
i.putExtra(CommonString.KEY_STORE_ID, current.getSTORE_ID());
|
||||
i.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||
startActivity(i);
|
||||
} else {
|
||||
Snackbar.make(recyclerView, R.string.nonetwork, Snackbar.LENGTH_SHORT)
|
||||
.setAction("Action", null).show();
|
||||
Intent i = new Intent(StoreListActivity.this, StoreCheckoutImageActivity.class);
|
||||
i.putExtra(CommonString.KEY_STORE_ID, current.getSTORE_ID());
|
||||
i.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||
startActivity(i);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
} else {
|
||||
Snackbar.make(recyclerView, R.string.nonetwork, Snackbar.LENGTH_SHORT)
|
||||
.setAction("Action", null).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -580,22 +861,6 @@ public class StoreListActivity extends AppCompatActivity {
|
||||
|
||||
if (!GeotagStatus.equalsIgnoreCase("N")) {
|
||||
|
||||
editor = preferences.edit();
|
||||
editor.putString(CommonString.KEY_STORE_ID, current.getSTORE_ID());
|
||||
editor.putString(CommonString.KEY_STORE_NAME, current.getSTORE_NAME());
|
||||
editor.putString(CommonString.KEY_VISIT_DATE, current.getVISIT_DATE());
|
||||
editor.putString(CommonString.KEY_CAMERA_ALLOW, current.getCAMERA_ALLOW());
|
||||
editor.putString(CommonString.KEY_CHECKOUT_STATUS, current.getCHECKOUT_STATUS());
|
||||
editor.putString(CommonString.KEY_CLASS_ID, current.getCLASS_ID());
|
||||
editor.putString(CommonString.KEY_EMP_ID, current.getEMP_ID());
|
||||
editor.putString(CommonString.KEY_GEO_TAG, current.getGEO_TAG());
|
||||
editor.putString(CommonString.KEY_KEYACCOUNT_ID, current.getKEYACCOUNT_ID());
|
||||
editor.putString(CommonString.KEY_STORETYPE_ID, current.getSTORETYPE_ID());
|
||||
editor.putString(CommonString.KEY_UPLOAD_STATUS, current.getUPLOAD_STATUS());
|
||||
|
||||
editor.commit();
|
||||
|
||||
|
||||
boolean flag = true;
|
||||
if (coverage.size() > 0) {
|
||||
for (int i = 0; i < coverage.size(); i++) {
|
||||
@@ -605,19 +870,87 @@ public class StoreListActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (flag == true) {
|
||||
|
||||
Intent in = new Intent(StoreListActivity.this, StoreimageActivity.class);
|
||||
in.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||
in.putExtra(CommonString.KEY_STORE_ID, current.getSTORE_ID());
|
||||
startActivity(in);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
dialog.cancel();
|
||||
} else {
|
||||
Intent in = new Intent(StoreListActivity.this, StoreWisePerformanceActivity.class);
|
||||
startActivity(in);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
boolean flag_entry = true;
|
||||
|
||||
int distance = 0;
|
||||
//geo fencing enabled only if GEO_FENCING equals 1 for COUNTRY_ID
|
||||
if(flag && geoFencingGetterSetters.size()>0 && geoFencingGetterSetters.get(0).getGEO_FENCING().get(0).equals("1")){
|
||||
distanceGeoPhence = Integer.parseInt(geoFencingGetterSetters.get(0).getDISTANCE_MTR().get(0));
|
||||
|
||||
double store_lat = Double.parseDouble(current.getLATITUDE());
|
||||
double store_lon = Double.parseDouble(current.getLONGITUDE());
|
||||
|
||||
if(store_lat!=0.0 && store_lon!=0.0){
|
||||
distance = distFrom(store_lat, store_lon, lat, lon);
|
||||
|
||||
if (/*true*/distance > distanceGeoPhence) {
|
||||
flag_entry = false;
|
||||
}
|
||||
else {
|
||||
String msg = getString(R.string.distance_from_the_store) + " " + distance + " meters";
|
||||
|
||||
Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(flag_entry){
|
||||
|
||||
|
||||
|
||||
editor = preferences.edit();
|
||||
editor.putString(CommonString.KEY_STORE_ID, current.getSTORE_ID());
|
||||
editor.putString(CommonString.KEY_STORE_NAME, current.getSTORE_NAME());
|
||||
editor.putString(CommonString.KEY_VISIT_DATE, current.getVISIT_DATE());
|
||||
editor.putString(CommonString.KEY_CAMERA_ALLOW, current.getCAMERA_ALLOW());
|
||||
editor.putString(CommonString.KEY_CHECKOUT_STATUS, current.getCHECKOUT_STATUS());
|
||||
editor.putString(CommonString.KEY_CLASS_ID, current.getCLASS_ID());
|
||||
editor.putString(CommonString.KEY_EMP_ID, current.getEMP_ID());
|
||||
editor.putString(CommonString.KEY_GEO_TAG, current.getGEO_TAG());
|
||||
editor.putString(CommonString.KEY_KEYACCOUNT_ID, current.getKEYACCOUNT_ID());
|
||||
editor.putString(CommonString.KEY_STORETYPE_ID, current.getSTORETYPE_ID());
|
||||
editor.putString(CommonString.KEY_POG_TYPE_ID, current.getPOG_TYPE_ID());
|
||||
editor.putString(CommonString.KEY_UPLOAD_STATUS, current.getUPLOAD_STATUS());
|
||||
|
||||
editor.commit();
|
||||
|
||||
|
||||
if (flag == true) {
|
||||
|
||||
Intent in = new Intent(StoreListActivity.this, StoreimageActivity.class);
|
||||
in.putExtra(CommonString.KEY_STORE_FLAG, store_flag_str);
|
||||
in.putExtra(CommonString.KEY_STORE_ID, current.getSTORE_ID());
|
||||
startActivity(in);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
dialog.cancel();
|
||||
} else {
|
||||
Intent in = new Intent(StoreListActivity.this, StoreWisePerformanceActivity.class);
|
||||
startActivity(in);
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
dialog.cancel();
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
String msg = getString(R.string.you_need_to_be_in_the_store) + "\n " + getString(R.string.distance_from_the_store)+ " - " + distance + " "+getString(R.string.meters);
|
||||
dialog.cancel();
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(StoreListActivity.this);
|
||||
builder.setTitle(getResources().getString(R.string.dialog_title));
|
||||
builder.setMessage(msg).setCancelable(false)
|
||||
.setPositiveButton(getResources().getString(R.string.ok),
|
||||
new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog1,
|
||||
int id) {
|
||||
|
||||
dialog1.cancel();
|
||||
}
|
||||
});
|
||||
|
||||
AlertDialog alert = builder.create();
|
||||
|
||||
alert.show();
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -634,7 +967,6 @@ public class StoreListActivity extends AppCompatActivity {
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
AlertDialog alert = builder.create();
|
||||
|
||||
alert.show();
|
||||
|
||||
@@ -12,6 +12,8 @@ import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.RectF;
|
||||
import android.location.Location;
|
||||
import android.location.LocationManager;
|
||||
import android.net.Uri;
|
||||
@@ -50,7 +52,10 @@ import org.xml.sax.XMLReader;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InterruptedIOException;
|
||||
import java.io.StringReader;
|
||||
import java.net.MalformedURLException;
|
||||
@@ -191,6 +196,7 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
// Write your code here to invoke NO event
|
||||
|
||||
dialog.cancel();
|
||||
finish();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -239,7 +245,7 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
GooglePlayServicesUtil.getErrorDialog(resultCode, this,
|
||||
PLAY_SERVICES_RESOLUTION_REQUEST).show();
|
||||
} else {
|
||||
Toast.makeText(getApplicationContext(),getResources().getString(R.string.notsuppoted)
|
||||
Toast.makeText(getApplicationContext(), getResources().getString(R.string.notsuppoted)
|
||||
, Toast.LENGTH_LONG)
|
||||
.show();
|
||||
finish();
|
||||
@@ -327,7 +333,7 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
}
|
||||
// ATTENTION: This was auto-generated to implement the App Indexing API.
|
||||
// See https://g.co/AppIndexing/AndroidStudio for more information.
|
||||
// AppIndex.AppIndexApi.start(client, getIndexApiAction());
|
||||
// AppIndex.AppIndexApi.start(client, getIndexApiAction());
|
||||
}
|
||||
|
||||
|
||||
@@ -335,7 +341,7 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
protected void onStop() {
|
||||
super.onStop();// ATTENTION: This was auto-generated to implement the App Indexing API.
|
||||
// See https://g.co/AppIndexing/AndroidStudio for more information.
|
||||
// AppIndex.AppIndexApi.end(client, getIndexApiAction());
|
||||
// AppIndex.AppIndexApi.end(client, getIndexApiAction());
|
||||
/* if (mGoogleApiClient.isConnected()) {
|
||||
mGoogleApiClient.disconnect();
|
||||
}*/
|
||||
@@ -359,6 +365,96 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
|
||||
|
||||
public File saveBitmapToFileSmaller(File file) {
|
||||
File file2 = file;
|
||||
try {
|
||||
int inWidth = 0;
|
||||
int inHeight = 0;
|
||||
|
||||
InputStream in = new FileInputStream(file2);
|
||||
// decode image size (decode metadata only, not the whole image)
|
||||
BitmapFactory.Options options = new BitmapFactory.Options();
|
||||
options.inJustDecodeBounds = true;
|
||||
BitmapFactory.decodeStream(in, null, options);
|
||||
in.close();
|
||||
in = null;
|
||||
|
||||
// save width and height
|
||||
inWidth = options.outWidth;
|
||||
inHeight = options.outHeight;
|
||||
|
||||
// decode full image pre-resized
|
||||
in = new FileInputStream(file2);
|
||||
options = new BitmapFactory.Options();
|
||||
// calc rough re-size (this is no exact resize)
|
||||
options.inSampleSize = Math.max(inWidth / 1632, inHeight / 1224);
|
||||
// decode full image
|
||||
Bitmap roughBitmap = BitmapFactory.decodeStream(in, null, options);
|
||||
|
||||
// calc exact destination size
|
||||
Matrix m = new Matrix();
|
||||
RectF inRect = new RectF(0, 0, roughBitmap.getWidth(), roughBitmap.getHeight());
|
||||
RectF outRect = new RectF(0, 0, 1632, 1224);
|
||||
m.setRectToRect(inRect, outRect, Matrix.ScaleToFit.CENTER);
|
||||
float[] values = new float[9];
|
||||
m.getValues(values);
|
||||
// resize bitmap
|
||||
Bitmap resizedBitmap = Bitmap.createScaledBitmap(roughBitmap, (int) (roughBitmap.getWidth() * values[0]), (int) (roughBitmap.getHeight() * values[4]), true);
|
||||
// save image
|
||||
FileOutputStream out = new FileOutputStream(file2);
|
||||
resizedBitmap.compress(Bitmap.CompressFormat.JPEG, 80, out);
|
||||
|
||||
} catch (Exception e) {
|
||||
Log.e("Image", e.toString(), e);
|
||||
return file;
|
||||
}
|
||||
return file2;
|
||||
}
|
||||
|
||||
public File saveBitmapToFile(File file) {
|
||||
try {
|
||||
|
||||
// BitmapFactory options to downsize the image
|
||||
BitmapFactory.Options o = new BitmapFactory.Options();
|
||||
o.inJustDecodeBounds = true;
|
||||
o.inSampleSize = 6;
|
||||
// factor of downsizing the image
|
||||
|
||||
FileInputStream inputStream = new FileInputStream(file);
|
||||
//Bitmap selectedBitmap = null;
|
||||
BitmapFactory.decodeStream(inputStream, null, o);
|
||||
inputStream.close();
|
||||
|
||||
// The new size we want to scale to
|
||||
final int REQUIRED_SIZE = 75;
|
||||
|
||||
// Find the correct scale value. It should be the power of 2.
|
||||
int scale = 1;
|
||||
while (o.outWidth / scale / 2 >= REQUIRED_SIZE &&
|
||||
o.outHeight / scale / 2 >= REQUIRED_SIZE) {
|
||||
scale *= 2;
|
||||
}
|
||||
|
||||
BitmapFactory.Options o2 = new BitmapFactory.Options();
|
||||
o2.inSampleSize = scale;
|
||||
inputStream = new FileInputStream(file);
|
||||
|
||||
Bitmap selectedBitmap = BitmapFactory.decodeStream(inputStream, null, o2);
|
||||
inputStream.close();
|
||||
|
||||
// here i override the original image file
|
||||
//file.createNewFile();
|
||||
FileOutputStream outputStream = new FileOutputStream(file);
|
||||
|
||||
selectedBitmap.compress(Bitmap.CompressFormat.JPEG, 100, outputStream);
|
||||
|
||||
return file;
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
@@ -392,11 +488,10 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
|
||||
String status;
|
||||
|
||||
if(store_flag_str.equals(CommonString.FROM_JCP)){
|
||||
status =CommonString.KEY_INVALID;
|
||||
}
|
||||
else {
|
||||
status =CommonString.KEY_VALID;
|
||||
if (store_flag_str.equals(CommonString.FROM_JCP)) {
|
||||
status = CommonString.KEY_INVALID;
|
||||
} else {
|
||||
status = CommonString.KEY_VALID;
|
||||
}
|
||||
|
||||
CoverageBean cdata = new CoverageBean();
|
||||
@@ -406,9 +501,10 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
cdata.setInTime(intime);
|
||||
cdata.setReason("");
|
||||
cdata.setReasonid("0");
|
||||
cdata.setLatitude(lat+"");
|
||||
cdata.setLongitude(lon+"");
|
||||
cdata.setLatitude(lat + "");
|
||||
cdata.setLongitude(lon + "");
|
||||
cdata.setImage(img_str);
|
||||
cdata.setSub_reasonId("0");
|
||||
cdata.setRemark("");
|
||||
|
||||
cdata.setStatus(status);
|
||||
@@ -419,10 +515,9 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
database.InsertCoverageData(cdata);
|
||||
|
||||
String table;
|
||||
if(store_flag_str.equals(CommonString.FROM_JCP)){
|
||||
if (store_flag_str.equals(CommonString.FROM_JCP)) {
|
||||
table = CommonString.KEY_JOURNEY_PLAN;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
table = CommonString.KEY_ADHOC_JOURNEY_PLAN;
|
||||
}
|
||||
|
||||
@@ -538,6 +633,12 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
if (_pathforcheck != null && !_pathforcheck.equals("")) {
|
||||
if (new File(str + _pathforcheck).exists()) {
|
||||
|
||||
//temp check--------
|
||||
/*File file = new File(str + _pathforcheck);
|
||||
saveBitmapToFileSmaller(file);*/
|
||||
//saveBitmapToFile(file);
|
||||
//-------------------
|
||||
|
||||
try {
|
||||
|
||||
Bitmap bmp = BitmapFactory.decodeFile(str + _pathforcheck);
|
||||
@@ -574,7 +675,6 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
@@ -582,7 +682,7 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
toolbar.setTitle(R.string.title_activity_store_image);
|
||||
|
||||
// Resuming the periodic location updates
|
||||
if (mGoogleApiClient.isConnected() ) {
|
||||
if (mGoogleApiClient.isConnected()) {
|
||||
startLocationUpdates();
|
||||
}
|
||||
|
||||
@@ -799,14 +899,13 @@ public class StoreimageActivity extends AppCompatActivity implements View.OnClic
|
||||
if (result.equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
dialog.dismiss();
|
||||
|
||||
if(store_flag_str.equals(CommonString.FROM_JCP)){
|
||||
if (store_flag_str.equals(CommonString.FROM_JCP)) {
|
||||
Intent in = new Intent(StoreimageActivity.this, StoreWisePerformanceActivity.class);
|
||||
startActivity(in);
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
}
|
||||
else {
|
||||
finish();
|
||||
} else {
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_back_in, R.anim.activity_back_out);
|
||||
}
|
||||
|
||||
|
||||
+23
-5
@@ -816,7 +816,13 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
final SkuGetterSetter[] sku_selected = new SkuGetterSetter[1];
|
||||
final BrandMasterGetterSetter[] brand_selected = new BrandMasterGetterSetter[1];
|
||||
|
||||
final ArrayList<BrandMasterGetterSetter> brandList = db.getBrandT2PData(storeType_id, class_id, keyAccount_id, categoryId);
|
||||
final ArrayList<BrandMasterGetterSetter> brandList;
|
||||
if(country_id.equals("7")){
|
||||
brandList = db.getBrandT2PData(null, null, null, categoryId, store_id);
|
||||
}
|
||||
else {
|
||||
brandList = db.getBrandT2PData(storeType_id, class_id, keyAccount_id, categoryId, store_id);
|
||||
}
|
||||
BrandMasterGetterSetter brand = new BrandMasterGetterSetter();
|
||||
brand.setBRAND("select");
|
||||
brandList.add(0, brand);
|
||||
@@ -919,7 +925,13 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
|
||||
String brand_id = brandList.get(position).getBRAND_ID().get(0);
|
||||
|
||||
ArrayList<SkuGetterSetter> temp_list = db.getSkuT2PData(storeType_id, class_id, keyAccount_id, brand_id);
|
||||
ArrayList<SkuGetterSetter> temp_list;
|
||||
if(country_id.equals("7")){
|
||||
temp_list = db.getSkuT2PData(null, null, null, brand_id, store_id);
|
||||
}
|
||||
else {
|
||||
temp_list = db.getSkuT2PData(storeType_id, class_id, keyAccount_id, brand_id, store_id);
|
||||
}
|
||||
|
||||
for (int k = 0; k < temp_list.size(); k++) {
|
||||
sku_list.add(temp_list.get(k));
|
||||
@@ -1540,9 +1552,9 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
webView.getSettings().setBuiltInZoomControls(true);
|
||||
|
||||
//String planogram_image = mp.get(0).getPLANOGRAM_IMAGE();
|
||||
if (new File(str + planogram_image).exists()) {
|
||||
if (new File(CommonString.FILE_PATH_PLANOGRAM + planogram_image).exists()) {
|
||||
|
||||
String imagePath = "file://" + CommonString.FILE_PATH + "/" + planogram_image;
|
||||
String imagePath = "file://" + CommonString.FILE_PATH_PLANOGRAM + "/" + planogram_image;
|
||||
//String imagePath = "file://" + CommonString.FILE_PATH + "/" + "image_ref.png";
|
||||
String html = "<html><head></head><body><img src=\"" + imagePath + "\"></body></html>";
|
||||
webView.loadDataWithBaseURL("", html, "text/html", "utf-8", "");
|
||||
@@ -1586,7 +1598,13 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
||||
|
||||
public void showBrandAvabilitydialog(final ArrayList<BrandAvabilityGetterSetter> brandGetdata) {
|
||||
|
||||
final ArrayList<BrandAvabilityGetterSetter> brandList = db.getBrandAvailbilitydata(store_id, categoryId, keyAccount_id, class_id, storeType_id);
|
||||
final ArrayList<BrandAvabilityGetterSetter> brandList;
|
||||
if(country_id.equals("7")){
|
||||
brandList = db.getBrandAvailbilitydata(store_id, categoryId, null, null, null);
|
||||
}
|
||||
else {
|
||||
brandList = db.getBrandAvailbilitydata(store_id, categoryId, keyAccount_id, class_id, storeType_id);
|
||||
}
|
||||
|
||||
BrandAvabilityGetterSetter brand = new BrandAvabilityGetterSetter();
|
||||
brand.setBRAND(getResources().getString(R.string.select));
|
||||
|
||||
@@ -46,8 +46,10 @@ import cpm.com.gskmtorange.xmlGetterSetter.AdditionalQuestiongetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationContrywiseGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.DisplayChecklistMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.DisplayMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.GeoFencingGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPINGT2PGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_ADDITIONAL_PROMOTION_MasterGetterSetter;
|
||||
@@ -58,15 +60,19 @@ import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingPlanogramCountrywiseGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingPromotionGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockStorewiseGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingSubCategoryImageAllowGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.NoCameraLastVisitGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.NonT2pReasonGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingSubReasonGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.POGQuestionGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.STORE_PERFORMANCE_MasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.ShelfMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.SkuGroupMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.SubCategoryMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.SupervisorListGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
|
||||
import cpm.com.gskmtorange.xmlHandlers.XMLHandlers;
|
||||
|
||||
@@ -75,7 +81,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
Data data;
|
||||
int eventType;
|
||||
GSKOrangeDB db;
|
||||
String userId, culture_id;
|
||||
String userId, culture_id, country_id;
|
||||
JourneyPlanGetterSetter jcpgettersetter;
|
||||
JourneyPlanGetterSetter adhoc_jcpgettersetter;
|
||||
SkuMasterGetterSetter skumastergettersetter;
|
||||
@@ -84,6 +90,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
CategoryMasterGetterSetter categoryMasterGetterSetter;
|
||||
DisplayMasterGetterSetter displayMasterGetterSetter;
|
||||
MappingStockGetterSetter mappingStockGetterSetter;
|
||||
MappingStockStorewiseGetterSetter mappingStockStorewiseGetterSetter;
|
||||
MAPPINGT2PGetterSetter mappingt2PGetterSetter;
|
||||
DisplayChecklistMasterGetterSetter checklistMasterGetterSetter;
|
||||
MappingDisplayChecklistGetterSetter mappingChecklistGetterSetter;
|
||||
@@ -103,6 +110,11 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
POGQuestionGetterSetter pogQuestionGetterSetter;
|
||||
NonT2pReasonGetterSetter nonT2pReasonGetterSetter;
|
||||
ConfigurationContrywiseGetterSetter configurationContrywiseGetterSetter;
|
||||
NoCameraLastVisitGetterSetter noCameraLastVisitGetterSetter;
|
||||
GeoFencingGetterSetter geoFencingGetterSetter;
|
||||
NonWorkingSubReasonGetterSetter nonWorkingSubReasonGetterSetter;
|
||||
SupervisorListGetterSetter supervisorListGetterSetter;
|
||||
ConfigurationMasterGetterSetter configurationMasterGetterSetter;
|
||||
|
||||
private Dialog dialog;
|
||||
private ProgressBar pb;
|
||||
@@ -128,6 +140,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
|
||||
userId = preferences.getString(CommonString.KEY_USERNAME, null);
|
||||
culture_id = preferences.getString(CommonString.KEY_CULTURE_ID, "");
|
||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, null);
|
||||
new UploadTask(DownloadActivity.this).execute();
|
||||
}
|
||||
|
||||
@@ -201,10 +214,12 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
|
||||
jcpgettersetter = XMLHandlers.JCPXMLHandler(xpp, eventType);
|
||||
|
||||
String jcpTable = jcpgettersetter.getTable_journey_plan();
|
||||
if (jcpTable != null)
|
||||
TableBean.setJourneyPlan(jcpTable);
|
||||
|
||||
if (jcpgettersetter.getSTORE_ID().size() > 0) {
|
||||
resultHttp = CommonString.KEY_SUCCESS;
|
||||
String jcpTable = jcpgettersetter.getTable_journey_plan();
|
||||
TableBean.setJourneyPlan(jcpTable);
|
||||
} else {
|
||||
//return "JOURNEY_PLAN";
|
||||
no_jcp_flag = true;
|
||||
@@ -249,15 +264,49 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
if (adhoc_jcpgettersetter.getSTORE_ID().size() > 0) {
|
||||
data.value = 15;
|
||||
data.name = "ADHOC JOURNEYPLAN " + getResources().getString(R.string.download_data);
|
||||
}
|
||||
else {
|
||||
if(no_jcp_flag){
|
||||
} else {
|
||||
if (no_jcp_flag) {
|
||||
return "JOURNEY_PLAN";
|
||||
}
|
||||
}
|
||||
}
|
||||
publishProgress(data);
|
||||
|
||||
//GEO_FENCING
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
request.addProperty("UserName", userId);
|
||||
request.addProperty("Type", "GEO_FENCING");
|
||||
request.addProperty("cultureid", culture_id);
|
||||
|
||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
// xpp.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);
|
||||
// xpp.setInput(stream,"UTF-8");
|
||||
xpp.next();
|
||||
eventType = xpp.getEventType();
|
||||
|
||||
geoFencingGetterSetter = XMLHandlers.geoFencingXMLHandler(xpp, eventType);
|
||||
|
||||
String geofencingTable = geoFencingGetterSetter.getTable_GEO_FENCING();
|
||||
TableBean.setTable_GEO_FENCING(geofencingTable);
|
||||
|
||||
if (geoFencingGetterSetter.getGEO_FENCING().size() > 0) {
|
||||
data.value = 17;
|
||||
data.name = "GEO FENCING" + getResources().getString(R.string.download_data);
|
||||
}
|
||||
|
||||
}
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
// Store List Master
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
@@ -472,6 +521,46 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
}
|
||||
publishProgress(data);
|
||||
|
||||
//Added on 04/12/2018
|
||||
// MAPPING_STOCK_STOREWISE
|
||||
if (country_id.equals("7")) {
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
request.addProperty("UserName", userId);
|
||||
request.addProperty("Type", "MAPPING_STOCK_STOREWISE");
|
||||
request.addProperty("cultureid", culture_id);
|
||||
|
||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
xpp.next();
|
||||
eventType = xpp.getEventType();
|
||||
mappingStockStorewiseGetterSetter = XMLHandlers.mappingStockStorewiseXMLHandler(xpp, eventType);
|
||||
|
||||
String stocktable = mappingStockStorewiseGetterSetter.getTable_MAPPING_STOCK_STOREWISE();
|
||||
if (stocktable != null) {
|
||||
resultHttp = CommonString.KEY_SUCCESS;
|
||||
TableBean.setTable_MAPPING_STOCK_STOREWISE(stocktable);
|
||||
}
|
||||
|
||||
if (mappingStockStorewiseGetterSetter.getSKU_ID().size() > 0) {
|
||||
data.value = 45;
|
||||
data.name = "_MAPPING_STOCK_STOREWISE " + getResources().getString(R.string.download_data);
|
||||
} else {
|
||||
// return "MAPPING_STOCK";
|
||||
}
|
||||
|
||||
}
|
||||
publishProgress(data);
|
||||
}
|
||||
|
||||
|
||||
// MAPPING_T2P
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
@@ -586,7 +675,8 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
// NON_WORKING_REASON
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
request.addProperty("UserName", userId);
|
||||
request.addProperty("Type", "NON_WORKING_REASON");
|
||||
//request.addProperty("Type", "NON_WORKING_REASON");
|
||||
request.addProperty("Type", "NON_WORKING_REASON_NEW");
|
||||
request.addProperty("cultureid", culture_id);
|
||||
|
||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
@@ -617,6 +707,43 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
}
|
||||
publishProgress(data);
|
||||
|
||||
// NON_WORKING_SUB_REASON
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
request.addProperty("UserName", userId);
|
||||
request.addProperty("Type", "NON_WORKING_SUB_REASON");
|
||||
request.addProperty("cultureid", culture_id);
|
||||
|
||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
xpp.next();
|
||||
eventType = xpp.getEventType();
|
||||
nonWorkingSubReasonGetterSetter = XMLHandlers.nonWorkingSubReasonXMLHandler(xpp, eventType);
|
||||
|
||||
String reasontable = nonWorkingSubReasonGetterSetter.getTable_NON_WORKING_SUB_REASON();
|
||||
if (reasontable != null) {
|
||||
resultHttp = CommonString.KEY_SUCCESS;
|
||||
TableBean.setTable_NON_WORKING_SUB_REASON(reasontable);
|
||||
}
|
||||
|
||||
if (nonWorkingSubReasonGetterSetter.getREASON_ID().size() > 0) {
|
||||
data.value = 70;
|
||||
data.name = "NON_WORKING_SUB_REASON " + getResources().getString(R.string.download_data);
|
||||
} else {
|
||||
//return "NON_WORKING_SUB_REASON";
|
||||
}
|
||||
|
||||
}
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
// MAPPING_PROMOTION
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
@@ -925,7 +1052,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
xpp.next();
|
||||
eventType = xpp.getEventType();
|
||||
skuGroupMasterGetterSetter = XMLHandlers.skuGroupMasterXMLHandler(xpp, eventType);
|
||||
@@ -960,7 +1087,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
xpp.next();
|
||||
eventType = xpp.getEventType();
|
||||
mappingCategoryImageAllowGetterSetter = XMLHandlers.mappingCategoryImageAllowXMLHandler(xpp, eventType);
|
||||
@@ -994,7 +1121,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
xpp.next();
|
||||
eventType = xpp.getEventType();
|
||||
additionalQuestiongetterSetter = XMLHandlers.additionalXMLHandler(xpp, eventType);
|
||||
@@ -1015,7 +1142,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
//ADDITIONAL_QUESTION
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
request.addProperty("UserName", userId);
|
||||
request.addProperty("Type", "POG_QUESTION");
|
||||
request.addProperty("Type", "POG_QUESTION_NEW");
|
||||
request.addProperty("cultureid", culture_id);
|
||||
|
||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
@@ -1114,6 +1241,108 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
}
|
||||
publishProgress(data);
|
||||
|
||||
//NO_CAMERA_LAST_VISIT_DATA
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
request.addProperty("UserName", userId);
|
||||
request.addProperty("Type", "NO_CAMERA_LAST_VISIT_DATA");
|
||||
request.addProperty("cultureid", culture_id);
|
||||
|
||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
xpp.next();
|
||||
eventType = xpp.getEventType();
|
||||
noCameraLastVisitGetterSetter = XMLHandlers.noCameraLastVisitXMLHandler(xpp, eventType);
|
||||
|
||||
String table_no_camera = noCameraLastVisitGetterSetter.getTable_NO_CAMERA_LAST_VISIT_DATA();
|
||||
if (table_no_camera != null) {
|
||||
resultHttp = CommonString.KEY_SUCCESS;
|
||||
TableBean.setTable_NO_CAMERA_LAST_VISIT_DATA(table_no_camera);
|
||||
}
|
||||
|
||||
if (noCameraLastVisitGetterSetter.getSKUGROUP_ID().size() > 0) {
|
||||
data.value = 97;
|
||||
data.name = "NO CAMERA LAST VISIT DATA" + getResources().getString(R.string.download_data);
|
||||
}
|
||||
}
|
||||
publishProgress(data);
|
||||
|
||||
//SUPERVISOR_LIST
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
request.addProperty("UserName", userId);
|
||||
request.addProperty("Type", "SUPERVISOR_LIST");
|
||||
request.addProperty("cultureid", culture_id);
|
||||
|
||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
xpp.next();
|
||||
eventType = xpp.getEventType();
|
||||
supervisorListGetterSetter = XMLHandlers.supervisorListXMLHandler(xpp, eventType);
|
||||
|
||||
String table_sup_list = supervisorListGetterSetter.getTable_SUPERVISOR_LIST();
|
||||
if (table_sup_list != null) {
|
||||
resultHttp = CommonString.KEY_SUCCESS;
|
||||
TableBean.setTable_SUPERVISOR_LIST(table_sup_list);
|
||||
}
|
||||
|
||||
if (supervisorListGetterSetter.getEMP_ID().size() > 0) {
|
||||
data.value = 97;
|
||||
data.name = "SUPERVISOR LIST DATA" + getResources().getString(R.string.download_data);
|
||||
}
|
||||
}
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
//CONFIGURATION_MASTER
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
request.addProperty("UserName", userId);
|
||||
request.addProperty("Type", "CONFIGURATION_MASTER");
|
||||
request.addProperty("cultureid", culture_id);
|
||||
|
||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
|
||||
if (result.toString() != null) {
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
xpp.next();
|
||||
eventType = xpp.getEventType();
|
||||
configurationMasterGetterSetter = XMLHandlers.configurationMasterXMLHandler(xpp, eventType);
|
||||
|
||||
String table_configiration = configurationMasterGetterSetter.getTable_CONFIGURATION_MASTER();
|
||||
if (table_configiration != null) {
|
||||
resultHttp = CommonString.KEY_SUCCESS;
|
||||
TableBean.setTable_CONFIGURATION_MASTER(table_configiration);
|
||||
}
|
||||
|
||||
if (configurationMasterGetterSetter.getCOUNTRY_ID().size() > 0) {
|
||||
data.value = 97;
|
||||
data.name = "CONFIGURATION MASTER DATA" + getResources().getString(R.string.download_data);
|
||||
}
|
||||
}
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
/* //MAPPING_COUNTRYWISE_PLANOGRAM
|
||||
@@ -1180,7 +1409,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
String size = new DecimalFormat("##.##").format((double) length / 1024) + " KB";
|
||||
|
||||
//String PATH = Environment.getExternalStorageDirectory() + "/Download/GT_GSK_Images/";
|
||||
String PATH = CommonString.FILE_PATH;
|
||||
String PATH = CommonString.FILE_PATH_PLANOGRAM;
|
||||
File file = new File(PATH);
|
||||
if (!file.isDirectory()) {
|
||||
file.mkdir();
|
||||
@@ -1239,7 +1468,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
String size = new DecimalFormat("##.##").format((double) length / 1024) + " KB";
|
||||
|
||||
//String PATH = Environment.getExternalStorageDirectory() + "/Download/GT_GSK_Images/";
|
||||
String PATH = CommonString.FILE_PATH;
|
||||
String PATH = CommonString.FILE_PATH_PLANOGRAM;
|
||||
File file = new File(PATH);
|
||||
if (!file.isDirectory()) {
|
||||
file.mkdir();
|
||||
@@ -1269,7 +1498,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
//MAPPING_PLANOGRAM Image save into folder
|
||||
/* //MAPPING_PLANOGRAM Image save into folder
|
||||
if (mapping_planogram_masterGetterSetter != null) {
|
||||
|
||||
for (int i = 0; i < mapping_planogram_masterGetterSetter.getIMAGE_PATH().size(); i++) {
|
||||
@@ -1296,7 +1525,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
String size = new DecimalFormat("##.##").format((double) length / 1024) + " KB";
|
||||
|
||||
//String PATH = Environment.getExternalStorageDirectory() + "/Download/GT_GSK_Images/";
|
||||
String PATH = CommonString.FILE_PATH;
|
||||
String PATH = CommonString.FILE_PATH_PLANOGRAM;
|
||||
File file = new File(PATH);
|
||||
if (!file.isDirectory()) {
|
||||
file.mkdir();
|
||||
@@ -1324,7 +1553,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
//MAPPING_COUNTRYWISE_PLANOGRAM file save into folder
|
||||
/*if (mappingPlanogramCountrywiseGetterSetter != null) {
|
||||
@@ -1400,6 +1629,9 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
|
||||
db.insertNonWorkingData(nonWorkingReasonGetterSetter);
|
||||
|
||||
//NON_WORKING_SUB_REASON added - 26.09.2018
|
||||
db.insertNonWorkingSubreasonData(nonWorkingSubReasonGetterSetter);
|
||||
|
||||
db.InsertSTORE_PERFORMANCE(store_performance_masterGetterSetter);
|
||||
db.InsertMAPPING_PLANOGRAM(mapping_planogram_masterGetterSetter);
|
||||
db.InsertADDITIONAL_DISPLAY(additional_display_getter_setter);
|
||||
@@ -1414,6 +1646,11 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
db.InsertPOGQUESTION(pogQuestionGetterSetter);
|
||||
db.InsertNON_T2P_REASON(nonT2pReasonGetterSetter);
|
||||
db.InsertCONFIGURATION_COUNTRY_WISE(configurationContrywiseGetterSetter);
|
||||
db.InsertNO_CAMERA_LAST_VISIT_DATA(noCameraLastVisitGetterSetter);
|
||||
db.insertSUPERVISOR_LIST_DATA(supervisorListGetterSetter);
|
||||
db.InsertGeoTag_DATA(geoFencingGetterSetter);
|
||||
db.InsertCONFIGURATION_MASTER(configurationMasterGetterSetter);
|
||||
db.InsertMappingStockSTOREWISE(mappingStockStorewiseGetterSetter);
|
||||
|
||||
} catch (MalformedURLException e) {
|
||||
|
||||
|
||||
+111
-9
@@ -24,14 +24,19 @@ import android.widget.TextView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||
import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.AdditionalQuestiongetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.AuditDataGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.T2PGetterSetter;
|
||||
|
||||
public class CategoryListActivity extends AppCompatActivity {
|
||||
RecyclerView recyclerView;
|
||||
@@ -41,7 +46,7 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
CategoryListAdapter adapter;
|
||||
|
||||
GSKOrangeDB db;
|
||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id,camera_allow;
|
||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id,camera_allow, country_id;
|
||||
private SharedPreferences preferences;
|
||||
|
||||
@Override
|
||||
@@ -67,6 +72,7 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
class_id = preferences.getString(CommonString.KEY_CLASS_ID, "");
|
||||
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
||||
camera_allow = preferences.getString(CommonString.KEY_CAMERA_ALLOW, "");
|
||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, null);
|
||||
|
||||
|
||||
/*txt_categoryName = (TextView) findViewById(R.id.txt_categoryName);
|
||||
@@ -95,7 +101,12 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
recyclerView = (RecyclerView) findViewById(R.id.recyclerView);
|
||||
categoryList = new ArrayList<>();
|
||||
|
||||
categoryList = db.getCategoryListData(keyAccount_id, storeType_id, class_id);
|
||||
if(country_id.equals("7")){
|
||||
categoryList = db.getCategoryListData(null, null, null, store_id);
|
||||
}
|
||||
else {
|
||||
categoryList = db.getCategoryListData(keyAccount_id, storeType_id, class_id, store_id);
|
||||
}
|
||||
|
||||
if (categoryList.size() > 0) {
|
||||
|
||||
@@ -124,8 +135,15 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
}
|
||||
}*/
|
||||
|
||||
boolean flag_mapping_stock;
|
||||
//New MSL_Availability_StockFacing
|
||||
if (db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id)) {
|
||||
if(country_id.equals("7")){
|
||||
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, null, null, null, store_id);
|
||||
}
|
||||
else {
|
||||
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id);
|
||||
}
|
||||
if (flag_mapping_stock) {
|
||||
if (!db.checkMsl_Availability_StockFacingData(store_id, category_id)) {
|
||||
flag = false;
|
||||
}
|
||||
@@ -158,12 +176,19 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
if (flag)
|
||||
if(db.getAuditCategoryWise(category_id,storeType_id).size()>0){
|
||||
if (flag){
|
||||
|
||||
if(db.getAfterSaveAuditQuestionAnswerData(store_id, category_id).size() == 0){
|
||||
flag = false;
|
||||
//changed on 23.10.2018
|
||||
//ArrayList<AuditDataGetterSetter> question_list = getAuditAfterDeletion(category_id);
|
||||
//changed on 03.12.2018
|
||||
ArrayList<AuditDataGetterSetter> question_list = getAuditQnsRemoved(category_id);
|
||||
|
||||
if(question_list.size()>0){
|
||||
|
||||
if(db.getAfterSaveAuditQuestionAnswerData(store_id, category_id).size() == 0){
|
||||
flag = false;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -198,6 +223,76 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
|
||||
}
|
||||
|
||||
ArrayList<AuditDataGetterSetter> getAuditAfterDeletion(String category_id){
|
||||
ArrayList<AuditDataGetterSetter> question_list = db.getAuditCategoryWise(category_id,storeType_id);
|
||||
|
||||
Iterator<AuditDataGetterSetter> iterator = question_list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
AuditDataGetterSetter item = iterator.next(); // must be called before you can call iterator.remove()
|
||||
// Check condition
|
||||
if (!item.getKEYACCOUNT_ID().equals("0") && !item.getKEYACCOUNT_ID().equals(keyAccount_id)) {
|
||||
iterator.remove();
|
||||
} else if (!item.getCHECK_TYPE().equals("NA") && item.getCHECK_TYPE().equals("T2P")) {
|
||||
|
||||
if (!db.isMappingT2PData(store_id, category_id)) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return question_list;
|
||||
}
|
||||
|
||||
ArrayList<AuditDataGetterSetter> getAuditQnsRemoved(String categoryId) {
|
||||
|
||||
boolean t2p_flag = false;
|
||||
|
||||
if (db.isMappingT2PData(store_id, categoryId)) {
|
||||
if (db.isFilledT2P(store_id, categoryId)) {
|
||||
ArrayList<T2PGetterSetter> t2PList = db.getT2pComplianceData(store_id, categoryId);
|
||||
|
||||
for (int i = 0; i < t2PList.size(); i++) {
|
||||
if (t2PList.get(i).getPresent() == 1) {
|
||||
t2p_flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!t2p_flag) {
|
||||
if (db.additionalVisibilitydata(store_id, categoryId)) {
|
||||
ArrayList<AddittionalGetterSetter> additionalList = db.getAdditionalMainStock(store_id, categoryId);
|
||||
|
||||
for (int i = 0; i < additionalList.size(); i++) {
|
||||
if (additionalList.get(i).getBtn_toogle().equals("1")) {
|
||||
t2p_flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ArrayList<AuditDataGetterSetter> question_list = db.getAuditCategoryWise(categoryId, storeType_id);
|
||||
|
||||
Iterator<AuditDataGetterSetter> iterator = question_list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
AuditDataGetterSetter item = iterator.next(); // must be called before you can call iterator.remove()
|
||||
// Check condition
|
||||
if (!item.getKEYACCOUNT_ID().equals("0") && !item.getKEYACCOUNT_ID().equals(keyAccount_id)) {
|
||||
iterator.remove();
|
||||
} else if (!item.getCHECK_TYPE().equals("NA") && item.getCHECK_TYPE().equals("T2P")) {
|
||||
|
||||
if (!t2p_flag) {
|
||||
iterator.remove();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return question_list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCreateOptionsMenu(Menu menu) {
|
||||
// Inflate the menu; this adds items to the action bar if it is present.
|
||||
@@ -326,8 +421,15 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
}
|
||||
}*/
|
||||
|
||||
boolean flag_mapping_stock;
|
||||
//New MSL_Availability_StockFacing
|
||||
if (db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id)) {
|
||||
if(country_id.equals("7")){
|
||||
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, null, null, null, store_id);
|
||||
}
|
||||
else {
|
||||
flag_mapping_stock = db.isMappingStockDataStockFacing(category_id, keyAccount_id, storeType_id, class_id, store_id);
|
||||
}
|
||||
if (flag_mapping_stock) {
|
||||
if (!db.checkMsl_Availability_StockFacingData(store_id, category_id)) {
|
||||
flag_filled = false;
|
||||
break;
|
||||
@@ -358,7 +460,7 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
if(db.getAuditCategoryWise(category_id, storeType_id).size()>0){
|
||||
if(getAuditQnsRemoved(category_id).size()>0){
|
||||
|
||||
if(db.getAfterSaveAuditQuestionAnswerData(store_id, category_id).size() == 0){
|
||||
flag_filled = false;
|
||||
|
||||
+92
-19
@@ -22,10 +22,12 @@ import android.widget.TextView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||
import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
|
||||
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter;
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||
@@ -37,7 +39,9 @@ import cpm.com.gskmtorange.dailyentry.CreateSelfActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.POGQuestionsActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.StockDataActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.T2PComplianceActivity;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.AuditDataGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.DailyDataMenuGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.T2PGetterSetter;
|
||||
|
||||
public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
RecyclerView recyclerView;
|
||||
@@ -47,7 +51,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
|
||||
GSKOrangeDB db;
|
||||
String categoryName = "", categoryId;
|
||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, country_id;
|
||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, country_id, pog_type_id;
|
||||
private SharedPreferences preferences;
|
||||
|
||||
ArrayList<CategoryPictureGetterSetter> category_camera_list;
|
||||
@@ -81,6 +85,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
||||
camera_allow = preferences.getString(CommonString.KEY_CAMERA_ALLOW, "");
|
||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, "");
|
||||
pog_type_id = preferences.getString(CommonString.KEY_POG_TYPE_ID, "");
|
||||
//Intent data
|
||||
categoryName = getIntent().getStringExtra("categoryName");
|
||||
categoryId = getIntent().getStringExtra("categoryId");
|
||||
@@ -115,10 +120,11 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
|
||||
DailyDataMenuGetterSetter data = new DailyDataMenuGetterSetter();
|
||||
|
||||
|
||||
if (country_id.equals("6") && categoryId.equals("3")) {
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_stock_facing));
|
||||
if (db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id)) {
|
||||
if (isMappingStockData()) {
|
||||
if (db.checkMsl_Availability_StockFacingData(store_id, categoryId)) {
|
||||
data.setCategory_img(R.mipmap.msl_availability_done);
|
||||
} else {
|
||||
@@ -131,7 +137,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
} else {
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
data.setCategory_name(getResources().getString(R.string.daily_data_menu_msl_availability));
|
||||
if (db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id)) {
|
||||
if (isMappingStockData()) {
|
||||
if (db.checkMsl_Availability_StockFacingData(store_id, categoryId)) {
|
||||
data.setCategory_img(R.mipmap.msl_availability_done);
|
||||
} else {
|
||||
@@ -238,13 +244,18 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
|
||||
//Audit
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
if (db.getAuditCategoryWise(categoryId, storeType_id).size() > 0) {
|
||||
|
||||
ArrayList<AuditDataGetterSetter> question_list;
|
||||
|
||||
question_list = getAuditQnsRemoved();
|
||||
|
||||
if (question_list.size() > 0) {
|
||||
if (db.getAfterSaveAuditQuestionAnswerData(store_id, categoryId).size() > 0) {
|
||||
data.setCategory_img(R.mipmap.msl_availability_done);
|
||||
} else {
|
||||
data.setCategory_img(R.mipmap.msl_availability);
|
||||
}
|
||||
} else{
|
||||
} else {
|
||||
data.setCategory_img(R.mipmap.msl_availability_grey);
|
||||
}
|
||||
|
||||
@@ -253,14 +264,14 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
|
||||
//POG
|
||||
data = new DailyDataMenuGetterSetter();
|
||||
if (db.getSubCategoryMasterForPOG(categoryId).size()>0) {
|
||||
if (db.getSubCategoryMasterForPOG(categoryId, storeType_id, pog_type_id).size() > 0) {
|
||||
if (db.getAfterSavePOGUploadQuestionAnswerData(store_id, categoryId).size() > 0) {
|
||||
data.setCategory_img(R.mipmap.msl_availability_done);
|
||||
} else {
|
||||
data.setCategory_img(R.mipmap.msl_availability);
|
||||
}
|
||||
|
||||
} else{
|
||||
} else {
|
||||
data.setCategory_img(R.mipmap.msl_availability_grey);
|
||||
}
|
||||
|
||||
@@ -315,6 +326,56 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
return super.onOptionsItemSelected(item);
|
||||
}
|
||||
|
||||
ArrayList<AuditDataGetterSetter> getAuditQnsRemoved() {
|
||||
|
||||
boolean t2p_flag = false;
|
||||
|
||||
if (db.isMappingT2PData(store_id, categoryId)) {
|
||||
if (db.isFilledT2P(store_id, categoryId)) {
|
||||
ArrayList<T2PGetterSetter> t2PList = db.getT2pComplianceData(store_id, categoryId);
|
||||
|
||||
for (int i = 0; i < t2PList.size(); i++) {
|
||||
if (t2PList.get(i).getPresent() == 1) {
|
||||
t2p_flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!t2p_flag) {
|
||||
if (db.additionalVisibilitydata(store_id, categoryId)) {
|
||||
ArrayList<AddittionalGetterSetter> additionalList = db.getAdditionalMainStock(store_id, categoryId);
|
||||
|
||||
for (int i = 0; i < additionalList.size(); i++) {
|
||||
if (additionalList.get(i).getBtn_toogle().equals("1")) {
|
||||
t2p_flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ArrayList<AuditDataGetterSetter> question_list = db.getAuditCategoryWise(categoryId, storeType_id);
|
||||
|
||||
Iterator<AuditDataGetterSetter> iterator = question_list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
AuditDataGetterSetter item = iterator.next(); // must be called before you can call iterator.remove()
|
||||
// Check condition
|
||||
if (!item.getKEYACCOUNT_ID().equals("0") && !item.getKEYACCOUNT_ID().equals(keyAccount_id)) {
|
||||
iterator.remove();
|
||||
} else if (!item.getCHECK_TYPE().equals("NA") && item.getCHECK_TYPE().equals("T2P")) {
|
||||
|
||||
if (!t2p_flag) {
|
||||
iterator.remove();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return question_list;
|
||||
}
|
||||
|
||||
public class DailyDataMenuAdapter extends RecyclerView.Adapter<DailyDataMenuAdapter.MyViewHolder> {
|
||||
List<DailyDataMenuGetterSetter> list = Collections.emptyList();
|
||||
Context context;
|
||||
@@ -372,27 +433,26 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||
}*/
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_msl_availability))) {
|
||||
if (db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id)) {
|
||||
if (isMappingStockData()) {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
} else {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||
}
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_stock_facing))) {
|
||||
if (db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id)) {
|
||||
if (isMappingStockData()) {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
} else {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||
}
|
||||
}else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.audit))) {
|
||||
if (db.getAuditCategoryWise(categoryId, storeType_id).size()>0) {
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.audit))) {
|
||||
if (getAuditQnsRemoved().size() > 0) {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
} else {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||
}
|
||||
|
||||
}
|
||||
else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.pog))) {
|
||||
if (db.getSubCategoryMasterForPOG(categoryId).size()>0) {
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.pog))) {
|
||||
if (db.getSubCategoryMasterForPOG(categoryId, storeType_id, pog_type_id).size() > 0) {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.colorPrimaryDark));
|
||||
} else {
|
||||
holder.categoryName.setTextColor(getResources().getColor(R.color.grey_background));
|
||||
@@ -460,7 +520,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_msl_availability))) {
|
||||
if (db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id)) {
|
||||
if (isMappingStockData()) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, MSL_Availability_StockFacingActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
intent.putExtra("categoryId", categoryId);
|
||||
@@ -469,7 +529,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_stock_facing))) {
|
||||
if (db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id)) {
|
||||
if (isMappingStockData()) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, StockDataActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
intent.putExtra("categoryId", categoryId);
|
||||
@@ -478,7 +538,9 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.audit))) {
|
||||
if (db.getAuditCategoryWise(categoryId, storeType_id).size()>0) {
|
||||
//if (db.getAuditCategoryWise(categoryId, storeType_id).size()>0) {
|
||||
|
||||
if (getAuditQnsRemoved().size() > 0) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, AuditActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
intent.putExtra("categoryId", categoryId);
|
||||
@@ -486,9 +548,9 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
}
|
||||
|
||||
}else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.pog))) {
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.pog))) {
|
||||
|
||||
if( db.getSubCategoryMasterForPOG(categoryId).size()>0){
|
||||
if (db.getSubCategoryMasterForPOG(categoryId, storeType_id, pog_type_id).size() > 0) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, POGQuestionsActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
intent.putExtra("categoryId", categoryId);
|
||||
@@ -521,6 +583,17 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
boolean isMappingStockData(){
|
||||
boolean flag;
|
||||
if(country_id.equals("7")){
|
||||
flag = db.isMappingStockDataStockFacing(categoryId, null, null, null, store_id);
|
||||
}
|
||||
else {
|
||||
flag = db.isMappingStockDataStockFacing(categoryId, keyAccount_id, storeType_id, class_id, store_id);
|
||||
}
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
+32
-20
@@ -85,7 +85,7 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
||||
private SharedPreferences preferences;
|
||||
int scrollPosition = 0;
|
||||
|
||||
String str = "", _pathforcheck = "";
|
||||
String str_planogram= "", _pathforcheck = "";
|
||||
|
||||
ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> planogramShelfHeaderDataList = new ArrayList<>();
|
||||
ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> planogramSkuChildDataList;
|
||||
@@ -140,7 +140,7 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
||||
getSupportActionBar().setHomeButtonEnabled(true);
|
||||
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
|
||||
|
||||
str = CommonString.FILE_PATH;
|
||||
str_planogram= CommonString.FILE_PATH_PLANOGRAM;
|
||||
|
||||
prepareList();
|
||||
|
||||
@@ -188,11 +188,11 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
||||
.setCancelable(false)
|
||||
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
expandableListView.smoothScrollToPosition(scrollPosition);
|
||||
//expandableListView.smoothScrollToPosition(scrollPosition);
|
||||
|
||||
if (!expandableListView.isGroupExpanded(scrollPosition)) {
|
||||
/* if (!expandableListView.isGroupExpanded(scrollPosition)) {
|
||||
expandableListView.expandGroup(scrollPosition);
|
||||
}
|
||||
}*/
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
@@ -345,13 +345,13 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
||||
planogram_image = mappingPlanogramList.get(0).getPLANOGRAM_IMAGE();
|
||||
}
|
||||
if (!planogram_image.equals("")) {
|
||||
if (new File(str + planogram_image).exists()) {
|
||||
Bitmap bmp = BitmapFactory.decodeFile(str + planogram_image);
|
||||
if (new File(str_planogram+ planogram_image).exists()) {
|
||||
Bitmap bmp = BitmapFactory.decodeFile(str_planogram+ planogram_image);
|
||||
// img_planogram.setRotation(90);
|
||||
//img_planogram.setImageBitmap(bmp);
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||
|
||||
String imagePath = "file://" + CommonString.FILE_PATH + "/" + planogram_image;
|
||||
String imagePath = "file://" + CommonString.FILE_PATH_PLANOGRAM + "/" + planogram_image;
|
||||
String html = "<html><head></head><body><img src=\"" + imagePath + "\"></body></html>";
|
||||
webView.loadDataWithBaseURL("", html, "text/html", "utf-8", "");
|
||||
|
||||
@@ -451,7 +451,7 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
||||
public void onClick(View view) {
|
||||
_pathforcheck = "Stock_Camera1_" + store_id + "_" + categoryId
|
||||
+ "_" + visit_date.replace("/", "") + "_" + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||
path = str + _pathforcheck;
|
||||
path = str_planogram+ _pathforcheck;
|
||||
|
||||
startCameraActivity(3);
|
||||
}
|
||||
@@ -462,7 +462,7 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
||||
public void onClick(View view) {
|
||||
_pathforcheck = "Stock_Camera2_" + store_id + "_" + categoryId
|
||||
+ "_" + visit_date.replace("/", "") + "_" + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||
path = str + _pathforcheck;
|
||||
path = str_planogram+ _pathforcheck;
|
||||
|
||||
startCameraActivity(4);
|
||||
}
|
||||
@@ -473,7 +473,7 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
||||
public void onClick(View view) {
|
||||
_pathforcheck = "Stock_Camera3_" + store_id + "_" + categoryId
|
||||
+ "_" + visit_date.replace("/", "") + "_" + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||
path = str + _pathforcheck;
|
||||
path = str_planogram+ _pathforcheck;
|
||||
|
||||
startCameraActivity(5);
|
||||
}
|
||||
@@ -484,7 +484,7 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
||||
public void onClick(View view) {
|
||||
_pathforcheck = "Stock_Camera4_" + store_id + "_" + categoryId
|
||||
+ "_" + visit_date.replace("/", "") + "_" + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
|
||||
path = str + _pathforcheck;
|
||||
path = str_planogram+ _pathforcheck;
|
||||
|
||||
startCameraActivity(6);
|
||||
}
|
||||
@@ -561,7 +561,13 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
||||
hashMapListChildData = new HashMap<>();
|
||||
|
||||
//Header
|
||||
headerDataList = db.getMSL_Availability_StockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id);
|
||||
if(country_id.equals("7")){
|
||||
headerDataList = db.getMSL_Availability_StockFacingHeaderData(categoryId, null, null, null, store_id);
|
||||
}
|
||||
else {
|
||||
headerDataList = db.getMSL_Availability_StockFacingHeaderData(categoryId, keyAccount_id, storeType_id, class_id, store_id);
|
||||
}
|
||||
|
||||
|
||||
if (headerDataList.size() > 0) {
|
||||
for (int i = 0; i < headerDataList.size(); i++) {
|
||||
@@ -570,7 +576,12 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
||||
//childDataList = new ArrayList<>();
|
||||
childDataList = db.getMSL_Availability_StockFacingSKU_AfterSaveData(categoryId, headerDataList.get(i).getBrand_id(), store_id);
|
||||
if (!(childDataList.size() > 0)) {
|
||||
childDataList = db.getMSL_Availability_StockFacingSKUData(categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id);
|
||||
if(country_id.equals("7")){
|
||||
childDataList = db.getMSL_Availability_StockFacingSKUData(categoryId, headerDataList.get(i).getBrand_id(), null, null, null, store_id);
|
||||
}
|
||||
else {
|
||||
childDataList = db.getMSL_Availability_StockFacingSKUData(categoryId, headerDataList.get(i).getBrand_id(), keyAccount_id, storeType_id, class_id, store_id);
|
||||
}
|
||||
}
|
||||
|
||||
hashMapListChildData.put(hashMapListHeaderData.get(i), childDataList);
|
||||
@@ -1009,7 +1020,7 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
||||
final EditText caption = (EditText) v;
|
||||
String edFaceup = caption.getText().toString().replaceFirst("^0+(?!$)", "");
|
||||
|
||||
if (edFaceup != null && !edFaceup.equals("")) {
|
||||
if (edFaceup != null && !edFaceup.equals("") && !edFaceup.equals(".")) {
|
||||
//int num = Integer.parseInt(edFaceup);
|
||||
double faceup = Double.parseDouble(edFaceup);
|
||||
int num = (int) faceup;
|
||||
@@ -1049,7 +1060,7 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
||||
AlertDialog alert = builder.create();
|
||||
alert.show();
|
||||
} else {*/
|
||||
if (edFaceup != null && !edFaceup.equals("")) {
|
||||
if (edFaceup != null && !edFaceup.equals("") && !edFaceup.equals(".")) {
|
||||
int mbq = Integer.parseInt(childData.getMbq());
|
||||
if(mbq!=0){
|
||||
if (Double.parseDouble(edFaceup) >= 0 && Double.parseDouble(edFaceup) < mbq) {
|
||||
@@ -1152,10 +1163,10 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
||||
|
||||
|
||||
if (isFill) {
|
||||
if (!edFaceup.equals("")) {
|
||||
if (!edFaceup.equals("") && !edFaceup.equals(".")) {
|
||||
String faceup = "";
|
||||
if(edFaceup.equals("0")){
|
||||
faceup = edFaceup;
|
||||
if(edFaceup.equals("0") ||edFaceup.equals(".0")){
|
||||
faceup = "0";
|
||||
}
|
||||
else{
|
||||
faceup = edFaceup.replaceFirst("^0+(?!$)", "");
|
||||
@@ -1168,6 +1179,7 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
||||
childData.setFacing("");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1291,7 +1303,7 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
public String PerfectDecimal(String str, int MAX_BEFORE_POINT, int MAX_DECIMAL) {
|
||||
if (str.charAt(0) == '.') str = "0" + str;
|
||||
if (str.charAt(0) == '.') str= "0" + str;
|
||||
int max = str.length();
|
||||
|
||||
String rFinal = "";
|
||||
|
||||
+3
-3
@@ -1186,13 +1186,13 @@ public class Stock_FacingActivity extends AppCompatActivity {
|
||||
planogram_image = mappingPlanogramList.get(0).getPLANOGRAM_IMAGE();
|
||||
}
|
||||
if (!planogram_image.equals("")) {
|
||||
if (new File(str + planogram_image).exists()) {
|
||||
Bitmap bmp = BitmapFactory.decodeFile(str + planogram_image);
|
||||
if (new File(CommonString.FILE_PATH_PLANOGRAM + planogram_image).exists()) {
|
||||
Bitmap bmp = BitmapFactory.decodeFile(CommonString.FILE_PATH_PLANOGRAM + planogram_image);
|
||||
// img_planogram.setRotation(90);
|
||||
//img_planogram.setImageBitmap(bmp);
|
||||
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
|
||||
|
||||
String imagePath = "file://" + CommonString.FILE_PATH + "/" + planogram_image;
|
||||
String imagePath = "file://" + CommonString.FILE_PATH_PLANOGRAM + "/" + planogram_image;
|
||||
String html = "<html><head></head><body><img src=\"" + imagePath + "\"></body></html>";
|
||||
webView.loadDataWithBaseURL("", html, "text/html", "utf-8", "");
|
||||
|
||||
|
||||
+36
-1
@@ -13,6 +13,7 @@ import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
@@ -28,8 +29,10 @@ import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.dailyentry.CoachingVisitActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.MessageActivity;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryWisePerformaceGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.StoreWisePerformaceGetterSetter;
|
||||
|
||||
public class StoreWisePerformanceActivity extends AppCompatActivity {
|
||||
@@ -40,7 +43,7 @@ public class StoreWisePerformanceActivity extends AppCompatActivity {
|
||||
StoreWisePerformaceAdapter adapter;
|
||||
|
||||
GSKOrangeDB db;
|
||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id;
|
||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, country_id;
|
||||
private SharedPreferences preferences;
|
||||
|
||||
|
||||
@@ -67,6 +70,7 @@ public class StoreWisePerformanceActivity extends AppCompatActivity {
|
||||
keyAccount_id = preferences.getString(CommonString.KEY_KEYACCOUNT_ID, "");
|
||||
class_id = preferences.getString(CommonString.KEY_CLASS_ID, "");
|
||||
storeType_id = preferences.getString(CommonString.KEY_STORETYPE_ID, "");
|
||||
country_id = preferences.getString(CommonString.KEY_COUNTRY_ID, null);
|
||||
|
||||
toolbar.setTitle(getResources().getString(R.string.title_activity_store_wise_performance));
|
||||
setSupportActionBar(toolbar);
|
||||
@@ -78,10 +82,41 @@ public class StoreWisePerformanceActivity extends AppCompatActivity {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
//Intent intent = new Intent(StoreWisePerformanceActivity.this, CategoryListActivity.class);
|
||||
//Intent intent = new Intent(StoreWisePerformanceActivity.this, MessageActivity.class);
|
||||
|
||||
|
||||
/*boolean coaching_visit_flag=false;
|
||||
//Enable disable According to Configuration
|
||||
ArrayList<ConfigurationMasterGetterSetter> configurationData = db.getConfigurationMasterData(country_id);
|
||||
if(configurationData.size()>0){
|
||||
|
||||
for(int i=0; i<configurationData.size();i++){
|
||||
if(configurationData.get(i).getCONFIGURE().get(0).equalsIgnoreCase("COACHING VISIT") &&
|
||||
configurationData.get(i).getACTIVE().get(0).equalsIgnoreCase("1")){
|
||||
coaching_visit_flag = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(coaching_visit_flag){
|
||||
Intent intent = new Intent(StoreWisePerformanceActivity.this, CoachingVisitActivity.class);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
}
|
||||
else {
|
||||
Intent intent = new Intent(StoreWisePerformanceActivity.this, MessageActivity.class);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
}*/
|
||||
|
||||
Intent intent = new Intent(StoreWisePerformanceActivity.this, MessageActivity.class);
|
||||
startActivity(intent);
|
||||
finish();
|
||||
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
|
||||
|
||||
}
|
||||
});
|
||||
} catch (Resources.NotFoundException e) {
|
||||
|
||||
+118
-50
@@ -40,6 +40,7 @@ import cpm.com.gskmtorange.GetterSetter.AdditionalDialogGetterSetter;
|
||||
import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
|
||||
import cpm.com.gskmtorange.GetterSetter.BrandAvabilityGetterSetter;
|
||||
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter;
|
||||
import cpm.com.gskmtorange.GetterSetter.CoachingVisitGetterSetter;
|
||||
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
||||
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||
import cpm.com.gskmtorange.R;
|
||||
@@ -88,6 +89,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
private int factor, k = 0;
|
||||
ArrayList<CategoryPictureGetterSetter> adddata = new ArrayList<CategoryPictureGetterSetter>();
|
||||
ArrayList<CategoryPictureGetterSetter> listdat = new ArrayList<CategoryPictureGetterSetter>();
|
||||
ArrayList<CoachingVisitGetterSetter> coachingVisitData;
|
||||
|
||||
Object result = "";
|
||||
|
||||
@@ -248,7 +250,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
for (int i = 0; i < coverageList.size(); i++) {
|
||||
|
||||
storeData = db.getSpecificStoreData(date, coverageList.get(i).getStoreId(), coverageList.get(i).getFlag_from());
|
||||
storeData = db.getSpecificStoreData(coverageList.get(i).getVisitDate(), coverageList.get(i).getStoreId(), coverageList.get(i).getFlag_from());
|
||||
if (storeData.getSTORE_ID() != null) {
|
||||
|
||||
if (storeData.getCHECKOUT_STATUS().equals(CommonString.KEY_Y) ||
|
||||
@@ -1075,10 +1077,62 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
data.name = getString(R.string.pog);
|
||||
publishProgress(data);
|
||||
|
||||
//Coaching visit data----------------------------------------
|
||||
db.open();
|
||||
coachingVisitData = db.getCoachingVisitData(coverageList.get(i).getStoreId());
|
||||
|
||||
if (coachingVisitData.size()>0) {
|
||||
|
||||
String onXml_coaching_data = "", coaching_xml="";
|
||||
for(int j=0;j<coachingVisitData.size();j++){
|
||||
|
||||
String exist;
|
||||
|
||||
if(coachingVisitData.get(j).isExists()){
|
||||
exist = "1";
|
||||
}
|
||||
else {
|
||||
exist = "0";
|
||||
}
|
||||
|
||||
coaching_xml = "[COACHING_VISIT_DATA]"
|
||||
+ "[MID]" + mid + "[/MID]"
|
||||
+ "[USER_ID]" + userId + "[/USER_ID]"
|
||||
+ "[EMP_ID]" + coachingVisitData.get(j).getEmp_id() + "[/EMP_ID]"
|
||||
+ "[IMAGE]" + coachingVisitData.get(j).getImg_path() + "[/IMAGE]"
|
||||
+ "[IS_EXIST]" + exist + "[/IS_EXIST]"
|
||||
+ "[/COACHING_VISIT_DATA]";
|
||||
onXml_coaching_data = onXml_coaching_data + coaching_xml;
|
||||
}
|
||||
|
||||
final String sos_xml = "[DATA]" + onXml_coaching_data + "[/DATA]";
|
||||
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||
request.addProperty("XMLDATA", sos_xml);
|
||||
request.addProperty("KEYS", "COACHING_VISIT_DATA");
|
||||
request.addProperty("USERNAME", userId);
|
||||
request.addProperty("MID", mid);
|
||||
|
||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
|
||||
data.value = 64;
|
||||
data.name = getString(R.string.coaching_visit);
|
||||
publishProgress(data);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
// Images Upload
|
||||
|
||||
// ashish visibility image start
|
||||
if (additionalVisibilityList.size() > 0) {
|
||||
/* if (additionalVisibilityList.size() > 0) {
|
||||
for (int i1 = 0; i1 < additionalVisibilityList.size(); i1++) {
|
||||
|
||||
if (additionalVisibilityList.get(i1).getImage() != null && !additionalVisibilityList.get(i1).getImage().equals("")) {
|
||||
@@ -1086,9 +1140,9 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(additionalVisibilityList.get(i1).getImage(), "AdditionalVisibilityImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "AdditionalVisibilityImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1106,9 +1160,9 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(additionalVisibilityList.get(i1).getImage2(), "AdditionalVisibilityImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "AdditionalVisibilityImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1127,9 +1181,9 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(additionalVisibilityList.get(i1).getImage3(), "AdditionalVisibilityImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "AdditionalVisibilityImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1165,9 +1219,9 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(listdat.get(i1).getSubCategoryCamera1(), "CategoryImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "CategoryImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1185,9 +1239,9 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(listdat.get(i1).getSubCategoryCamera2(), "CategoryImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "CategoryImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1217,9 +1271,9 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(adddata.get(i1).getCategoryImage1(), "CategoryImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "CategoryImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1237,9 +1291,9 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(adddata.get(i1).getCategoryImage2(), "CategoryImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "CategoryImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1257,9 +1311,9 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(adddata.get(i1).getCategoryImage3(), "CategoryImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "CategoryImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1276,9 +1330,9 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(adddata.get(i1).getCategoryImage4(), "CategoryImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "CategoryImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1305,9 +1359,9 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(adddata.get(i1).getCategoryImage1(), "CategoryImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "CategoryImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1325,9 +1379,9 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(adddata.get(i1).getCategoryImage2(), "CategoryImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "CategoryImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1345,9 +1399,9 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(adddata.get(i1).getCategoryImage3(), "CategoryImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "CategoryImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1364,9 +1418,9 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(adddata.get(i1).getCategoryImage4(), "CategoryImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "CategoryImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1393,9 +1447,9 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(coverageList.get(i1).getImage(), "StoreImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "StoreImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1422,9 +1476,9 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(promotionSkuList.get(i1).getImage_promotion(), "PromotionImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "StoreImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1451,9 +1505,9 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(additionalPromotionList.get(i1).getImage_promotion(), "AdditionalPromotionImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "StoreImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1480,9 +1534,9 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(coverageList.get(i1).getCheckOut_Image(), "StoreImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "StoreImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1508,9 +1562,9 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(t2PGetterSetters.get(m).getImage(), "T2PImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "T2PImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1528,9 +1582,9 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(t2PGetterSetters.get(m).getImage1(), "T2PImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "T2PImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1548,9 +1602,9 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(t2PGetterSetters.get(m).getImage2(), "T2PImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "T2PImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1588,7 +1642,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
data.value = 90;
|
||||
publishProgress(data);
|
||||
|
||||
*/
|
||||
|
||||
// SET COVERAGE STATUS
|
||||
String final_xml = "";
|
||||
@@ -1597,7 +1651,7 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
+ "[STORE_ID]" + coverageList.get(i).getStoreId() + "[/STORE_ID]"
|
||||
+ "[VISIT_DATE]" + coverageList.get(i).getVisitDate() + "[/VISIT_DATE]"
|
||||
+ "[USER_ID]" + coverageList.get(i).getUserId() + "[/USER_ID]"
|
||||
+ "[STATUS]" + CommonString.KEY_U + "[/STATUS]"
|
||||
+ "[STATUS]" + CommonString.KEY_D + "[/STATUS]"
|
||||
+ "[/COVERAGE_STATUS]";
|
||||
|
||||
final_xml = final_xml + onXML;
|
||||
@@ -1616,6 +1670,9 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
result = envelope.getResponse();
|
||||
|
||||
//to set previous date for further use in UploadImageWithRetrofit
|
||||
date = coverageList.get(i).getVisitDate();
|
||||
|
||||
//If Result is success then status of that store is update
|
||||
if (result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
k = k + factor;
|
||||
@@ -1624,18 +1681,19 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
publishProgress(data);
|
||||
|
||||
db.open();
|
||||
db.updateCoverageStatus(coverageList.get(i).getStoreId(), CommonString.KEY_U);
|
||||
//db.updateCoverageStatus(coverageList.get(i).getStoreId(), CommonString.KEY_D);
|
||||
db.updateStoreStatusOnLeave(coverageList.get(i).getStoreId(), coverageList.get(i)
|
||||
.getVisitDate(), CommonString.KEY_U, coverageList.get(i).getFlag_from());
|
||||
.getVisitDate(), CommonString.KEY_D, coverageList.get(i).getFlag_from());
|
||||
|
||||
db.deleteTableWithStoreID(coverageList.get(i).getStoreId());
|
||||
//db.deleteTableWithStoreID(coverageList.get(i).getStoreId());
|
||||
}
|
||||
|
||||
data.value = 100;
|
||||
publishProgress(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toString();
|
||||
return CommonString.KEY_SUCCESS;
|
||||
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
@@ -1670,8 +1728,18 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
if (result.contains(CommonString.KEY_SUCCESS)) {
|
||||
//db.deleteAllTables();
|
||||
showAlert(getString(R.string.data_downloaded_successfully));
|
||||
db.deleteAllTables();
|
||||
|
||||
File f = new File(CommonString.FILE_PATH);
|
||||
//if (f != null && f.listFiles().length > 0) {
|
||||
File file[] = f.listFiles();
|
||||
UploadImageWithRetrofit.uploadedFiles = 0;
|
||||
UploadImageWithRetrofit.totalFiles = file.length;
|
||||
UploadImageWithRetrofit uploadImg = new UploadImageWithRetrofit(date, userId, PreviousDataUploadActivity.this);
|
||||
uploadImg.UploadImageRecursiveNew(PreviousDataUploadActivity.this);
|
||||
/* }
|
||||
else {
|
||||
showAlert(getString(R.string.data_uploaded_successfully));
|
||||
}*/
|
||||
//showAlert(getString(R.string.menu_upload_data));
|
||||
} else {
|
||||
showAlert(getString(R.string.error) + result.toString());
|
||||
|
||||
@@ -44,6 +44,7 @@ import java.net.MalformedURLException;
|
||||
import java.net.SocketException;
|
||||
import java.net.SocketTimeoutException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import javax.xml.parsers.SAXParser;
|
||||
import javax.xml.parsers.SAXParserFactory;
|
||||
@@ -53,6 +54,7 @@ import cpm.com.gskmtorange.GetterSetter.AdditionalDialogGetterSetter;
|
||||
import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
|
||||
import cpm.com.gskmtorange.GetterSetter.BrandAvabilityGetterSetter;
|
||||
import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter;
|
||||
import cpm.com.gskmtorange.GetterSetter.CoachingVisitGetterSetter;
|
||||
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
||||
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||
import cpm.com.gskmtorange.R;
|
||||
@@ -95,6 +97,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
ArrayList<AddittionalGetterSetter> additionalVisibilityList;
|
||||
ArrayList<AdditionalDialogGetterSetter> additionalVisibilitySkuList;
|
||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> msl_availabilityStockFacingList;
|
||||
ArrayList<CoachingVisitGetterSetter> coachingVisitData;
|
||||
|
||||
private Dialog dialog;
|
||||
private ProgressBar pb;
|
||||
@@ -265,7 +268,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
try {
|
||||
data = new Data();
|
||||
|
||||
ArrayList<CoverageBean> adhoc_coverageList = db.getCoverageData(date, CommonString.FROM_DEVIATION);
|
||||
ArrayList<CoverageBean> adhoc_coverageList = db.getCoverageData(date, CommonString.FROM_DEVIATION);
|
||||
|
||||
if (adhoc_coverageList.size() > 0) {
|
||||
|
||||
@@ -314,17 +317,22 @@ public class UploadActivity extends AppCompatActivity {
|
||||
storeData = db.getSpecificStoreData(date, coverageList.get(i).getStoreId(), coverageList.get(i).getFlag_from());
|
||||
if (storeData.getSTORE_ID() != null) {
|
||||
|
||||
if (storeData.getCHECKOUT_STATUS().equals(CommonString.KEY_Y) ||
|
||||
if (!storeData.getUPLOAD_STATUS().equals(CommonString.KEY_D) && (storeData.getCHECKOUT_STATUS().equals(CommonString.KEY_Y) ||
|
||||
storeData.getCHECKOUT_STATUS().equals(CommonString.KEY_L) ||
|
||||
!storeData.getUPLOAD_STATUS().equals(CommonString.KEY_U)) {
|
||||
!storeData.getUPLOAD_STATUS().equals(CommonString.KEY_U))) {
|
||||
|
||||
String camera_allow = storeData.getCAMERA_ALLOW();
|
||||
String adhoc;
|
||||
if(coverageList.get(i).getFlag_from().equals(CommonString.FROM_DEVIATION)){
|
||||
adhoc ="1";
|
||||
if (coverageList.get(i).getFlag_from().equals(CommonString.FROM_DEVIATION)) {
|
||||
adhoc = "1";
|
||||
} else {
|
||||
adhoc = "0";
|
||||
}
|
||||
else {
|
||||
adhoc ="0";
|
||||
|
||||
|
||||
String sub_reason_id = coverageList.get(i).getSub_reasonId();
|
||||
if(sub_reason_id.equals("")){
|
||||
sub_reason_id = "0";
|
||||
}
|
||||
|
||||
String onXML = "[DATA]"
|
||||
@@ -344,10 +352,11 @@ public class UploadActivity extends AppCompatActivity {
|
||||
+ "[CAMERA_ALLOWED]" + camera_allow + "[/CAMERA_ALLOWED]"
|
||||
+ "[CHECKOUT_IMAGE]" + coverageList.get(i).getCheckOut_Image() + "[/CHECKOUT_IMAGE]"
|
||||
+ "[ADHOC]" + adhoc + "[/ADHOC]"
|
||||
+ "[SUBREASONID]" + sub_reason_id + "[/SUBREASONID]"
|
||||
+ "[/USER_DATA]"
|
||||
+ "[/DATA]";
|
||||
|
||||
SoapObject request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_COVERAGE);
|
||||
SoapObject request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_COVERAGE_NEW);
|
||||
request.addProperty("onXML", onXML);
|
||||
|
||||
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
@@ -355,7 +364,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UPLOAD_STORE_COVERAGE, envelope);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION_UPLOAD_STORE_COVERAGE_NEW, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
|
||||
@@ -1027,6 +1036,14 @@ public class UploadActivity extends AppCompatActivity {
|
||||
String onXml_nodata = "", No_camera_data = "";
|
||||
for (int n = 0; n < nocamera_data_list.size(); n++) {
|
||||
|
||||
int vertical;
|
||||
if(nocamera_data_list.get(n).isVertical()){
|
||||
vertical = 1;
|
||||
}
|
||||
else {
|
||||
vertical = 0;
|
||||
}
|
||||
|
||||
onXml_nodata = "[NO_CAMERA_POG_DATA]"
|
||||
+ "[MID]" + mid + "[/MID]"
|
||||
+ "[USER_ID]" + userId + "[/USER_ID]"
|
||||
@@ -1036,6 +1053,7 @@ public class UploadActivity extends AppCompatActivity {
|
||||
+ "[ROW_NO]" + nocamera_data_list.get(n).getRow_no() + "[/ROW_NO]"
|
||||
+ "[COLUMN_NO]" + nocamera_data_list.get(n).getColumn_no() + "[/COLUMN_NO]"
|
||||
+ "[FACING]" + nocamera_data_list.get(n).getFacing() + "[/FACING]"
|
||||
+ "[IS_VERTICAL]" + vertical + "[/IS_VERTICAL]"
|
||||
+ "[/NO_CAMERA_POG_DATA]";
|
||||
|
||||
No_camera_data = No_camera_data + onXml_nodata;
|
||||
@@ -1151,10 +1169,104 @@ public class UploadActivity extends AppCompatActivity {
|
||||
data.name = getString(R.string.pog);
|
||||
publishProgress(data);
|
||||
|
||||
//Coaching visit data
|
||||
db.open();
|
||||
coachingVisitData = db.getCoachingVisitData(coverageList.get(i).getStoreId());
|
||||
|
||||
if (coachingVisitData.size()>0) {
|
||||
|
||||
String onXml_coaching_data = "", coaching_xml="";
|
||||
for(int j=0;j<coachingVisitData.size();j++){
|
||||
|
||||
String exist;
|
||||
|
||||
if(coachingVisitData.get(j).isExists()){
|
||||
exist = "1";
|
||||
}
|
||||
else {
|
||||
exist = "0";
|
||||
}
|
||||
|
||||
coaching_xml = "[COACHING_VISIT_DATA]"
|
||||
+ "[MID]" + mid + "[/MID]"
|
||||
+ "[USER_ID]" + userId + "[/USER_ID]"
|
||||
+ "[EMP_ID]" + coachingVisitData.get(j).getEmp_id() + "[/EMP_ID]"
|
||||
+ "[IMAGE]" + coachingVisitData.get(j).getImg_path() + "[/IMAGE]"
|
||||
+ "[IS_EXIST]" + exist + "[/IS_EXIST]"
|
||||
+ "[/COACHING_VISIT_DATA]";
|
||||
onXml_coaching_data = onXml_coaching_data + coaching_xml;
|
||||
}
|
||||
|
||||
final String sos_xml = "[DATA]" + onXml_coaching_data + "[/DATA]";
|
||||
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||
request.addProperty("XMLDATA", sos_xml);
|
||||
request.addProperty("KEYS", "COACHING_VISIT_DATA");
|
||||
request.addProperty("USERNAME", userId);
|
||||
request.addProperty("MID", mid);
|
||||
|
||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_STOCK_XML_DATA, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
|
||||
data.value = 64;
|
||||
data.name = getString(R.string.coaching_visit);
|
||||
publishProgress(data);
|
||||
}
|
||||
|
||||
// SET COVERAGE STATUS
|
||||
String final_xml = "";
|
||||
onXML = "";
|
||||
onXML = "[COVERAGE_STATUS]"
|
||||
+ "[STORE_ID]" + coverageList.get(i).getStoreId() + "[/STORE_ID]"
|
||||
+ "[VISIT_DATE]" + coverageList.get(i).getVisitDate() + "[/VISIT_DATE]"
|
||||
+ "[USER_ID]" + coverageList.get(i).getUserId() + "[/USER_ID]"
|
||||
+ "[STATUS]" + CommonString.KEY_D + "[/STATUS]"
|
||||
+ "[/COVERAGE_STATUS]";
|
||||
|
||||
final_xml = final_xml + onXML;
|
||||
|
||||
final String sos_xml = "[DATA]" + final_xml + "[/DATA]";
|
||||
|
||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_COVERAGE_STATUS);
|
||||
request.addProperty("onXML", sos_xml);
|
||||
|
||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_COVERAGE_STATUS, envelope);
|
||||
|
||||
result = envelope.getResponse();
|
||||
|
||||
//If Result is success then status of that store is update
|
||||
if (result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
k = k + factor;
|
||||
data.value = k;
|
||||
data.name = "Uploading";
|
||||
publishProgress(data);
|
||||
|
||||
db.open();
|
||||
//db.updateCoverageStatus(coverageList.get(i).getStoreId(), CommonString.KEY_D);
|
||||
db.updateStoreStatusOnLeave(coverageList.get(i).getStoreId(), coverageList.get(i)
|
||||
.getVisitDate(), CommonString.KEY_D, coverageList.get(i).getFlag_from());
|
||||
|
||||
//db.deleteTableWithStoreID(coverageList.get(i).getStoreId());
|
||||
}
|
||||
data.value = 100;
|
||||
publishProgress(data);
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
// Images Upload
|
||||
|
||||
// ashish visibility image start
|
||||
if (additionalVisibilityList.size() > 0) {
|
||||
/* if (additionalVisibilityList.size() > 0) {
|
||||
for (int i1 = 0; i1 < additionalVisibilityList.size(); i1++) {
|
||||
|
||||
if (additionalVisibilityList.get(i1).getImage() != null && !additionalVisibilityList.get(i1).getImage().equals("")) {
|
||||
@@ -1162,9 +1274,9 @@ public class UploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(additionalVisibilityList.get(i1).getImage(), "AdditionalVisibilityImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "AdditionalVisibilityImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1182,9 +1294,9 @@ public class UploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(additionalVisibilityList.get(i1).getImage2(), "AdditionalVisibilityImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "AdditionalVisibilityImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1203,9 +1315,9 @@ public class UploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(additionalVisibilityList.get(i1).getImage3(), "AdditionalVisibilityImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "AdditionalVisibilityImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1241,9 +1353,9 @@ public class UploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(listdat.get(i1).getSubCategoryCamera1(), "CategoryImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "CategoryImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1261,9 +1373,9 @@ public class UploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(listdat.get(i1).getSubCategoryCamera2(), "CategoryImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "CategoryImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1293,9 +1405,9 @@ public class UploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(adddata.get(i1).getCategoryImage1(), "CategoryImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "CategoryImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1313,9 +1425,9 @@ public class UploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(adddata.get(i1).getCategoryImage2(), "CategoryImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "CategoryImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1333,9 +1445,9 @@ public class UploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(adddata.get(i1).getCategoryImage3(), "CategoryImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "CategoryImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1352,9 +1464,9 @@ public class UploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(adddata.get(i1).getCategoryImage4(), "CategoryImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "CategoryImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1381,9 +1493,9 @@ public class UploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(adddata.get(i1).getCategoryImage1(), "CategoryImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "CategoryImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1401,9 +1513,9 @@ public class UploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(adddata.get(i1).getCategoryImage2(), "CategoryImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "CategoryImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1421,9 +1533,9 @@ public class UploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(adddata.get(i1).getCategoryImage3(), "CategoryImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "CategoryImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1440,9 +1552,9 @@ public class UploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(adddata.get(i1).getCategoryImage4(), "CategoryImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "CategoryImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1469,9 +1581,9 @@ public class UploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(coverageList.get(i1).getImage(), "StoreImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "StoreImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1498,9 +1610,9 @@ public class UploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(promotionSkuList.get(i1).getImage_promotion(), "PromotionImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "StoreImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1527,9 +1639,9 @@ public class UploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(additionalPromotionList.get(i1).getImage_promotion(), "AdditionalPromotionImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "StoreImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1556,9 +1668,9 @@ public class UploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(coverageList.get(i1).getCheckOut_Image(), "StoreImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "StoreImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1584,9 +1696,9 @@ public class UploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(t2PGetterSetters.get(m).getImage(), "T2PImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "T2PImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1604,9 +1716,9 @@ public class UploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(t2PGetterSetters.get(m).getImage1(), "T2PImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "T2PImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1624,9 +1736,9 @@ public class UploadActivity extends AppCompatActivity {
|
||||
|
||||
try {
|
||||
result = UploadImage(t2PGetterSetters.get(m).getImage2(), "T2PImages");
|
||||
/*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
*//*if (!result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
return "T2PImages";
|
||||
}*/
|
||||
}*//*
|
||||
|
||||
runOnUiThread(new Runnable() {
|
||||
public void run() {
|
||||
@@ -1675,14 +1787,14 @@ public class UploadActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
data.value = 90;
|
||||
publishProgress(data);
|
||||
|
||||
|
||||
// SET COVERAGE STATUS
|
||||
String final_xml = "";
|
||||
/* String final_xml = "";
|
||||
onXML = "";
|
||||
onXML = "[COVERAGE_STATUS]"
|
||||
+ "[STORE_ID]" + coverageList.get(i).getStoreId() + "[/STORE_ID]"
|
||||
@@ -1722,12 +1834,12 @@ public class UploadActivity extends AppCompatActivity {
|
||||
db.deleteTableWithStoreID(coverageList.get(i).getStoreId());
|
||||
}
|
||||
data.value = 100;
|
||||
publishProgress(data);
|
||||
publishProgress(data);*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result.toString();
|
||||
return CommonString.KEY_SUCCESS;
|
||||
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
@@ -1755,7 +1867,18 @@ public class UploadActivity extends AppCompatActivity {
|
||||
dialog.dismiss();
|
||||
if (result.contains(CommonString.KEY_SUCCESS)) {
|
||||
//db.deleteAllTables();
|
||||
showAlert(getString(R.string.data_uploaded_successfully));
|
||||
|
||||
File f = new File(CommonString.FILE_PATH);
|
||||
//if (f != null && f.listFiles().length > 0) {
|
||||
File file[] = f.listFiles();
|
||||
UploadImageWithRetrofit.uploadedFiles = 0;
|
||||
UploadImageWithRetrofit.totalFiles = file.length;
|
||||
UploadImageWithRetrofit uploadImg = new UploadImageWithRetrofit(date, userId, UploadActivity.this);
|
||||
uploadImg.UploadImageRecursiveNew(UploadActivity.this);
|
||||
/* }
|
||||
else {
|
||||
showAlert(getString(R.string.data_uploaded_successfully));
|
||||
}*/
|
||||
//showAlert(getString(R.string.menu_upload_data));
|
||||
} else {
|
||||
showAlert(getString(R.string.error) + result.toString());
|
||||
|
||||
+389
-11
@@ -10,27 +10,41 @@ import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.RectF;
|
||||
import android.os.AsyncTask;
|
||||
import android.util.Log;
|
||||
|
||||
import com.crashlytics.android.Crashlytics;
|
||||
import com.google.gson.JsonSyntaxException;
|
||||
import com.squareup.okhttp.MultipartBuilder;
|
||||
import com.squareup.okhttp.OkHttpClient;
|
||||
import com.squareup.okhttp.RequestBody;
|
||||
|
||||
import org.json.JSONObject;
|
||||
import org.ksoap2.SoapEnvelope;
|
||||
import org.ksoap2.serialization.SoapObject;
|
||||
import org.ksoap2.serialization.SoapSerializationEnvelope;
|
||||
import org.ksoap2.transport.HttpTransportSE;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.SocketException;
|
||||
import java.net.SocketTimeoutException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||
import cpm.com.gskmtorange.MainActivity;
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.retrofit.PostApiForFile;
|
||||
import cpm.com.gskmtorange.retrofit.StringConverterFactory;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
|
||||
import retrofit.Retrofit;
|
||||
|
||||
/**
|
||||
@@ -48,14 +62,16 @@ public class UploadImageWithRetrofit {
|
||||
Context context;
|
||||
String visitDate, userID, uploadStatus;
|
||||
int storeId = 0;
|
||||
//GSKGTMerDB db;
|
||||
GSKOrangeDB db;
|
||||
ProgressDialog pd;
|
||||
//ArrayList<JourneyPlan> storeList;
|
||||
ArrayList<StoreBean> storeList, storeList_deviation;
|
||||
private int factor, k = 0;
|
||||
Data data;
|
||||
|
||||
|
||||
public UploadImageWithRetrofit(Context context) {
|
||||
/*this.visitDate = visitDate;
|
||||
this.userID = userId;*/
|
||||
public UploadImageWithRetrofit(String visitDate, String userId, Context context) {
|
||||
this.visitDate = visitDate;
|
||||
this.userID = userId;
|
||||
this.context = context;
|
||||
pd = new ProgressDialog(context);
|
||||
pd.setCancelable(false);
|
||||
@@ -64,7 +80,7 @@ public class UploadImageWithRetrofit {
|
||||
pd.show();
|
||||
}
|
||||
|
||||
public void UploadImageRecursive(final Context context) {
|
||||
/*public void UploadImageRecursive(final Context context) {
|
||||
try {
|
||||
|
||||
status = 0;
|
||||
@@ -91,7 +107,7 @@ public class UploadImageWithRetrofit {
|
||||
foldername = "PromotionImages";
|
||||
} else if (file[i].getName().contains("CategoryPicture")) {
|
||||
foldername = "CategoryImages";
|
||||
} else if (file[i].getName().contains("AuditAnsPic ")) {
|
||||
} else if (file[i].getName().contains("AuditAnsPic")) {
|
||||
foldername = "AuditImages";
|
||||
} else {
|
||||
foldername = "Bulkimages";
|
||||
@@ -183,6 +199,230 @@ public class UploadImageWithRetrofit {
|
||||
}
|
||||
}
|
||||
|
||||
}*/
|
||||
|
||||
public void UploadImageRecursiveNew(final Context context) {
|
||||
try {
|
||||
|
||||
status = 0;
|
||||
String filename = null, foldername = null;
|
||||
int totalfiles = 0;
|
||||
File f = new File(CommonString.FILE_PATH);
|
||||
File file[] = f.listFiles();
|
||||
count = file.length;
|
||||
if (file.length > 0) {
|
||||
filename = "";
|
||||
totalfiles = f.listFiles().length;
|
||||
pd.setMessage(context.getString(R.string.uploaddata)+" - " +context.getString(R.string.image) + " (" + uploadedFiles + "/" + totalFiles + ")");
|
||||
for (int i = 0; i < file.length; i++) {
|
||||
if (new File(CommonString.FILE_PATH + file[i].getName()).exists()) {
|
||||
if (file[i].getName().contains("SI_") || file[i].getName().contains("CHK_SI_") || file[i].getName().contains("NonWorking")) {
|
||||
foldername = "StoreImages";
|
||||
} else if (file[i].getName().contains("GeoTag")) {
|
||||
foldername = "GeotagImages";
|
||||
} else if (file[i].getName().contains("T2P_Image")) {
|
||||
foldername = "T2PImages";
|
||||
} else if (file[i].getName().contains("AddPromo_Image")) {
|
||||
foldername = "AdditionalPromotionImages";
|
||||
}else if (file[i].getName().contains("AdditionalImage")) {
|
||||
foldername = "AdditionalVisibilityImages";
|
||||
} else if (file[i].getName().contains("Promo_Image")) {
|
||||
foldername = "PromotionImages";
|
||||
} else if (file[i].getName().contains("CategoryPicture")) {
|
||||
foldername = "CategoryImages";
|
||||
} else if (file[i].getName().contains("AuditAnsPic")) {
|
||||
foldername = "AuditImages";
|
||||
} else if (file[i].getName().contains("CoachingVisit")) {
|
||||
foldername = "CoachingVisits";
|
||||
} else if (file[i].getName().contains("DeliveryCalls")) {
|
||||
foldername = "DeliveryCallsImages";
|
||||
} else{
|
||||
foldername = "Bulkimages";
|
||||
}
|
||||
|
||||
filename = file[i].getName();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
File originalFile = new File(CommonString.FILE_PATH+ filename);
|
||||
final File finalFile = saveBitmapToFileSmaller(originalFile);
|
||||
|
||||
OkHttpClient okHttpClient = new OkHttpClient();
|
||||
okHttpClient.setConnectTimeout(20, TimeUnit.SECONDS);
|
||||
okHttpClient.setWriteTimeout(20, TimeUnit.SECONDS);
|
||||
okHttpClient.setReadTimeout(20, TimeUnit.SECONDS);
|
||||
|
||||
com.squareup.okhttp.RequestBody photo = com.squareup.okhttp.RequestBody.create(com.squareup.okhttp.MediaType.parse("application/octet-stream"), finalFile);
|
||||
body1 = new MultipartBuilder()
|
||||
.type(MultipartBuilder.FORM)
|
||||
.addFormDataPart("file", finalFile.getName(), photo)
|
||||
.addFormDataPart("FolderName", foldername)
|
||||
.build();
|
||||
|
||||
adapter = new retrofit.Retrofit.Builder()
|
||||
.baseUrl(CommonString.URL + "/")
|
||||
.addConverterFactory(new StringConverterFactory())
|
||||
.build();
|
||||
PostApiForFile api = adapter.create(PostApiForFile.class);
|
||||
|
||||
retrofit.Call<String> call = api.getUploadImage(body1);
|
||||
call.enqueue(new retrofit.Callback<String>() {
|
||||
@Override
|
||||
public void onResponse(retrofit.Response<String> response) {
|
||||
if (response.isSuccess() && response.body().contains("Success")) {
|
||||
finalFile.delete();
|
||||
status = 1;
|
||||
uploadedFiles++;
|
||||
} else {
|
||||
status = 0;
|
||||
//uploadedFiles = 0;
|
||||
}
|
||||
if (status == 0) {
|
||||
pd.dismiss();
|
||||
if (!((Activity) context).isFinishing()) {
|
||||
showAlert((Activity) context, context.getString(R.string.DataNot),false);
|
||||
}
|
||||
} else {
|
||||
UploadImageRecursiveNew(context);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable t) {
|
||||
if (t instanceof IOException || t instanceof SocketTimeoutException || t instanceof SocketException) {
|
||||
status = -1;
|
||||
//uploadedFiles = 0;
|
||||
pd.dismiss();
|
||||
// AlertandMessages.showAlert((Activity) context, "Network Error in upload", false);
|
||||
if (!((Activity) context).isFinishing()) {
|
||||
showAlert((Activity) context, context.getString(R.string.NetworkError),false);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
} else {
|
||||
if (totalFiles == uploadedFiles) {
|
||||
//region Coverage upload status Data
|
||||
new StatusUpload().execute();
|
||||
//endregion
|
||||
//pd.cancel();
|
||||
//showAlert((Activity) context, context.getString(R.string.data_uploaded_successfully),true);
|
||||
}
|
||||
|
||||
}
|
||||
} catch (JsonSyntaxException e) {
|
||||
e.printStackTrace();
|
||||
showAlert((Activity) context, "Invalid Json",false);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
if (totalFiles == uploadedFiles) {
|
||||
showAlert((Activity) context, context.getString(R.string.data_uploaded_successfully),true);
|
||||
} else {
|
||||
showAlert((Activity) context, CommonString.KEY_FAILURE,false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void UploadDeliveryImageRecursive(final Context context, final ArrayList<String> file_list, final int index) {
|
||||
try {
|
||||
final int[] _index = {index};
|
||||
status = 0;
|
||||
String filename = null, foldername = "DeliveryCallsImages";
|
||||
|
||||
if (_index[0] < file_list.size()) {
|
||||
filename = file_list.get(_index[0]);
|
||||
|
||||
pd.setMessage(context.getString(R.string.uploaddata)+" - " +context.getString(R.string.image) + " (" + uploadedFiles + "/" + totalFiles + ")");
|
||||
|
||||
File originalFile = new File(CommonString.FILE_PATH + filename);
|
||||
final File finalFile = saveBitmapToFileSmaller(originalFile);
|
||||
|
||||
OkHttpClient okHttpClient = new OkHttpClient();
|
||||
okHttpClient.setConnectTimeout(20, TimeUnit.SECONDS);
|
||||
okHttpClient.setWriteTimeout(20, TimeUnit.SECONDS);
|
||||
okHttpClient.setReadTimeout(20, TimeUnit.SECONDS);
|
||||
|
||||
com.squareup.okhttp.RequestBody photo = com.squareup.okhttp.RequestBody.create(com.squareup.okhttp.MediaType.parse("application/octet-stream"), finalFile);
|
||||
body1 = new MultipartBuilder()
|
||||
.type(MultipartBuilder.FORM)
|
||||
.addFormDataPart("file", finalFile.getName(), photo)
|
||||
.addFormDataPart("FolderName", foldername)
|
||||
.build();
|
||||
|
||||
adapter = new retrofit.Retrofit.Builder()
|
||||
.baseUrl(CommonString.URL + "/")
|
||||
.addConverterFactory(new StringConverterFactory())
|
||||
.build();
|
||||
PostApiForFile api = adapter.create(PostApiForFile.class);
|
||||
|
||||
retrofit.Call<String> call = api.getUploadImage(body1);
|
||||
call.enqueue(new retrofit.Callback<String>() {
|
||||
@Override
|
||||
public void onResponse(retrofit.Response<String> response) {
|
||||
if (response.isSuccess() && response.body().contains("Success")) {
|
||||
finalFile.delete();
|
||||
status = 1;
|
||||
uploadedFiles++;
|
||||
} else {
|
||||
status = 0;
|
||||
//uploadedFiles = 0;
|
||||
}
|
||||
if (status == 0) {
|
||||
pd.dismiss();
|
||||
if (!((Activity) context).isFinishing()) {
|
||||
showAlert((Activity) context, context.getString(R.string.DataNot),false);
|
||||
}
|
||||
} else {
|
||||
UploadDeliveryImageRecursive(context, file_list, ++_index[0]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable t) {
|
||||
if (t instanceof IOException || t instanceof SocketTimeoutException || t instanceof SocketException) {
|
||||
status = -1;
|
||||
//uploadedFiles = 0;
|
||||
pd.dismiss();
|
||||
// AlertandMessages.showAlert((Activity) context, "Network Error in upload", false);
|
||||
if (!((Activity) context).isFinishing()) {
|
||||
showAlert((Activity) context, context.getString(R.string.NetworkError),false);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
pd.dismiss();
|
||||
if (totalFiles == uploadedFiles) {
|
||||
//region Coverage upload status Data
|
||||
/*db = new GSKOrangeDB(context);
|
||||
db.open();
|
||||
db.updateDeliveryCallsUploadStatus();*/
|
||||
//endregion
|
||||
//pd.cancel();
|
||||
//showAlert((Activity) context, context.getString(R.string.data_uploaded_successfully),true);
|
||||
}
|
||||
showAlert((Activity) context, context.getString(R.string.data_uploaded_successfully),true);
|
||||
}
|
||||
} catch (JsonSyntaxException e) {
|
||||
e.printStackTrace();
|
||||
showAlert((Activity) context, "Invalid Json",false);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
if (totalFiles == uploadedFiles) {
|
||||
showAlert((Activity) context, context.getString(R.string.data_uploaded_successfully),true);
|
||||
} else {
|
||||
showAlert((Activity) context, CommonString.KEY_FAILURE,false);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public File saveBitmapToFileSmaller(File file) {
|
||||
@@ -206,15 +446,15 @@ public class UploadImageWithRetrofit {
|
||||
// decode full image pre-resized
|
||||
in = new FileInputStream(file2);
|
||||
options = new BitmapFactory.Options();
|
||||
// calc rought re-size (this is no exact resize)
|
||||
options.inSampleSize = Math.max(inWidth / 800, inHeight / 500);
|
||||
// calc rough re-size (this is no exact resize)
|
||||
options.inSampleSize = Math.max(inWidth / 1632, inHeight / 1224);
|
||||
// decode full image
|
||||
Bitmap roughBitmap = BitmapFactory.decodeStream(in, null, options);
|
||||
|
||||
// calc exact destination size
|
||||
Matrix m = new Matrix();
|
||||
RectF inRect = new RectF(0, 0, roughBitmap.getWidth(), roughBitmap.getHeight());
|
||||
RectF outRect = new RectF(0, 0, 800, 500);
|
||||
RectF outRect = new RectF(0, 0, 1632, 1224);
|
||||
m.setRectToRect(inRect, outRect, Matrix.ScaleToFit.CENTER);
|
||||
float[] values = new float[9];
|
||||
m.getValues(values);
|
||||
@@ -222,7 +462,7 @@ public class UploadImageWithRetrofit {
|
||||
Bitmap resizedBitmap = Bitmap.createScaledBitmap(roughBitmap, (int) (roughBitmap.getWidth() * values[0]), (int) (roughBitmap.getHeight() * values[4]), true);
|
||||
// save image
|
||||
FileOutputStream out = new FileOutputStream(file2);
|
||||
resizedBitmap.compress(Bitmap.CompressFormat.JPEG, 90, out);
|
||||
resizedBitmap.compress(Bitmap.CompressFormat.JPEG, 80, out);
|
||||
|
||||
} catch (Exception e) {
|
||||
Log.e("Image", e.toString(), e);
|
||||
@@ -252,4 +492,142 @@ public class UploadImageWithRetrofit {
|
||||
alert.show();
|
||||
}
|
||||
|
||||
public class StatusUpload extends AsyncTask<String, String, String> {
|
||||
|
||||
@Override
|
||||
protected String doInBackground(String... strings) {
|
||||
|
||||
try {
|
||||
db = new GSKOrangeDB(context);
|
||||
db.open();
|
||||
data = new Data();
|
||||
storeList = db.getStoreData(visitDate, CommonString.KEY_JOURNEY_PLAN);
|
||||
for (int i = 0; i < storeList.size(); i++) {
|
||||
if (storeList.get(i).getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_D)) {
|
||||
// SET COVERAGE STATUS
|
||||
String final_xml = "";
|
||||
String onXML = "";
|
||||
onXML = "[COVERAGE_STATUS]"
|
||||
+ "[STORE_ID]" + storeList.get(i).getSTORE_ID() + "[/STORE_ID]"
|
||||
+ "[VISIT_DATE]" + storeList.get(i).getVISIT_DATE()+ "[/VISIT_DATE]"
|
||||
+ "[USER_ID]" + userID + "[/USER_ID]"
|
||||
+ "[STATUS]" + CommonString.KEY_U + "[/STATUS]"
|
||||
+ "[/COVERAGE_STATUS]";
|
||||
|
||||
final_xml = final_xml + onXML;
|
||||
|
||||
final String sos_xml = "[DATA]" + final_xml + "[/DATA]";
|
||||
|
||||
SoapObject request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_COVERAGE_STATUS);
|
||||
request.addProperty("onXML", sos_xml);
|
||||
|
||||
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_COVERAGE_STATUS, envelope);
|
||||
|
||||
Object result = envelope.getResponse();
|
||||
|
||||
//If Result is success then status of that store is update
|
||||
if (result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
|
||||
db.open();
|
||||
db.updateCoverageStatus(storeList.get(i).getSTORE_ID(), CommonString.KEY_U);
|
||||
db.updateStoreStatusOnLeave(storeList.get(i).getSTORE_ID(), storeList.get(i).getVISIT_DATE(),
|
||||
CommonString.KEY_U, CommonString.FROM_JCP);
|
||||
|
||||
db.deleteTableWithStoreID(storeList.get(i).getSTORE_ID());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
db.open();
|
||||
storeList_deviation = db.getStoreData(visitDate, CommonString.KEY_ADHOC_JOURNEY_PLAN);
|
||||
for (int i = 0; i < storeList_deviation.size(); i++) {
|
||||
if (storeList_deviation.get(i).getUPLOAD_STATUS().equalsIgnoreCase(CommonString.KEY_D)) {
|
||||
// SET COVERAGE STATUS
|
||||
String final_xml = "";
|
||||
String onXML = "";
|
||||
onXML = "[COVERAGE_STATUS]"
|
||||
+ "[STORE_ID]" + storeList_deviation.get(i).getSTORE_ID() + "[/STORE_ID]"
|
||||
+ "[VISIT_DATE]" + storeList_deviation.get(i).getVISIT_DATE()+ "[/VISIT_DATE]"
|
||||
+ "[USER_ID]" + userID + "[/USER_ID]"
|
||||
+ "[STATUS]" + CommonString.KEY_U + "[/STATUS]"
|
||||
+ "[/COVERAGE_STATUS]";
|
||||
|
||||
final_xml = final_xml + onXML;
|
||||
|
||||
final String sos_xml = "[DATA]" + final_xml + "[/DATA]";
|
||||
|
||||
SoapObject request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_COVERAGE_STATUS);
|
||||
request.addProperty("onXML", sos_xml);
|
||||
|
||||
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
HttpTransportSE androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
androidHttpTransport.call(CommonString.SOAP_ACTION + CommonString.METHOD_UPLOAD_COVERAGE_STATUS, envelope);
|
||||
|
||||
Object result = envelope.getResponse();
|
||||
|
||||
//If Result is success then status of that store is update
|
||||
if (result.toString().equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
|
||||
db.open();
|
||||
db.updateCoverageStatus(storeList_deviation.get(i).getSTORE_ID(), CommonString.KEY_U);
|
||||
db.updateStoreStatusOnLeave(storeList_deviation.get(i).getSTORE_ID(), storeList_deviation.get(i).getVISIT_DATE(),
|
||||
CommonString.KEY_U, CommonString.KEY_ADHOC_JOURNEY_PLAN);
|
||||
|
||||
db.deleteTableWithStoreID(storeList_deviation.get(i).getSTORE_ID());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
Crashlytics.logException(e.getCause());
|
||||
Crashlytics.logException(new Exception(e.getCause()));
|
||||
e.printStackTrace();
|
||||
} catch (XmlPullParserException e) {
|
||||
e.printStackTrace();
|
||||
} catch (Exception e) {
|
||||
Crashlytics.log(7, CommonString.MESSAGE_EXCEPTION, e.toString());
|
||||
Crashlytics.logException(e.getCause());
|
||||
Crashlytics.logException(new Exception(e.getCause()));
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (statusUpdated) {
|
||||
return CommonString.KEY_SUCCESS;
|
||||
} else {
|
||||
return CommonString.KEY_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPostExecute(String s) {
|
||||
super.onPostExecute(s);
|
||||
pd.dismiss();
|
||||
if (s.equalsIgnoreCase(CommonString.KEY_SUCCESS)) {
|
||||
if (totalFiles == uploadedFiles) {
|
||||
//AlertandMessages.showAlert((Activity) context, "All images uploaded Successfully", true);
|
||||
showAlert((Activity) context, context.getString(R.string.data_uploaded_successfully),true);
|
||||
} else {
|
||||
showAlert((Activity) context, context.getString(R.string.DataNot),true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class Data {
|
||||
int value;
|
||||
String name;
|
||||
}
|
||||
}
|
||||
|
||||
+9
@@ -21,6 +21,7 @@ public class AdditionalQuestiongetterSetter {
|
||||
ArrayList<String> CAMERA_ALLOW = new ArrayList<>();
|
||||
ArrayList<String> KEYACCOUNT_ID = new ArrayList<>();
|
||||
ArrayList<String> NO_OF_CAMERA = new ArrayList<>();
|
||||
ArrayList<String> TYPE = new ArrayList<>();
|
||||
|
||||
public String getTable_ADDITIONAL_QUESTION() {
|
||||
return table_ADDITIONAL_QUESTION;
|
||||
@@ -117,4 +118,12 @@ public class AdditionalQuestiongetterSetter {
|
||||
public void setNO_OF_CAMERA(String NO_OF_CAMERA) {
|
||||
this.NO_OF_CAMERA.add(NO_OF_CAMERA);
|
||||
}
|
||||
|
||||
public ArrayList<String> getTYPE() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
public void setTYPE(String TYPE) {
|
||||
this.TYPE.add(TYPE);
|
||||
}
|
||||
}
|
||||
|
||||
+9
-1
@@ -6,7 +6,7 @@ package cpm.com.gskmtorange.xmlGetterSetter;
|
||||
|
||||
public class AuditDataGetterSetter {
|
||||
|
||||
String QUESTION_ID, CULTURE_ID, CATEGORY_ID, QUESTION, ANSWER_TYPE, ANSWER_ID, ANSWER, CAM_IMAGE="", CAMERA_ALLOW="0", KEYACCOUNT_ID="0", NO_OF_CAMERA ="1", CAM_IMAGE2="";
|
||||
String QUESTION_ID, CULTURE_ID, CATEGORY_ID, QUESTION, ANSWER_TYPE, ANSWER_ID, ANSWER, CAM_IMAGE="", CAMERA_ALLOW="0", KEYACCOUNT_ID="0", NO_OF_CAMERA ="1", CAM_IMAGE2="", CHECK_TYPE;
|
||||
|
||||
|
||||
public String getQUESTION_ID() {
|
||||
@@ -104,4 +104,12 @@ public class AuditDataGetterSetter {
|
||||
public void setCAM_IMAGE2(String CAM_IMAGE2) {
|
||||
this.CAM_IMAGE2 = CAM_IMAGE2;
|
||||
}
|
||||
|
||||
public String getCHECK_TYPE() {
|
||||
return CHECK_TYPE;
|
||||
}
|
||||
|
||||
public void setCHECK_TYPE(String CHECK_TYPE) {
|
||||
this.CHECK_TYPE = CHECK_TYPE;
|
||||
}
|
||||
}
|
||||
|
||||
+9
@@ -8,6 +8,7 @@ public class ConfigurationContrywiseGetterSetter {
|
||||
|
||||
ArrayList<String> COUNTRY_ID = new ArrayList<>();
|
||||
ArrayList<String> ADHOC_REPORTING = new ArrayList<>();
|
||||
ArrayList<String> PDF_ALLOW = new ArrayList<>();
|
||||
|
||||
public String getTable_CONFIGURATION_COUNTRY_WISE() {
|
||||
return table_CONFIGURATION_COUNTRY_WISE;
|
||||
@@ -32,4 +33,12 @@ public class ConfigurationContrywiseGetterSetter {
|
||||
public void setADHOC_REPORTING(String ADHOC_REPORTING) {
|
||||
this.ADHOC_REPORTING.add(ADHOC_REPORTING);
|
||||
}
|
||||
|
||||
public ArrayList<String> getPDF_ALLOW() {
|
||||
return PDF_ALLOW;
|
||||
}
|
||||
|
||||
public void setPDF_ALLOW(String PDF_ALLOW) {
|
||||
this.PDF_ALLOW.add(PDF_ALLOW);
|
||||
}
|
||||
}
|
||||
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class ConfigurationMasterGetterSetter {
|
||||
|
||||
String table_CONFIGURATION_MASTER;
|
||||
|
||||
ArrayList<String> COUNTRY_ID = new ArrayList<>();
|
||||
ArrayList<String> CONFIGURE = new ArrayList<>();
|
||||
ArrayList<String> ACTIVE = new ArrayList<>();
|
||||
|
||||
public String getTable_CONFIGURATION_MASTER() {
|
||||
return table_CONFIGURATION_MASTER;
|
||||
}
|
||||
|
||||
public void setTable_CONFIGURATION_MASTER(String table_CONFIGURATION_MASTER) {
|
||||
this.table_CONFIGURATION_MASTER = table_CONFIGURATION_MASTER;
|
||||
}
|
||||
|
||||
public ArrayList<String> getCOUNTRY_ID() {
|
||||
return COUNTRY_ID;
|
||||
}
|
||||
|
||||
public void setCOUNTRY_ID(String COUNTRY_ID) {
|
||||
this.COUNTRY_ID.add(COUNTRY_ID);
|
||||
}
|
||||
|
||||
public ArrayList<String> getCONFIGURE() {
|
||||
return CONFIGURE;
|
||||
}
|
||||
|
||||
public void setCONFIGURE(String CONFIGURE) {
|
||||
this.CONFIGURE.add(CONFIGURE);
|
||||
}
|
||||
|
||||
public ArrayList<String> getACTIVE() {
|
||||
return ACTIVE;
|
||||
}
|
||||
|
||||
public void setACTIVE(String ACTIVE) {
|
||||
this.ACTIVE.add(ACTIVE);
|
||||
}
|
||||
}
|
||||
+97
@@ -0,0 +1,97 @@
|
||||
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class DeliveryCallsGetterSetter implements Serializable{
|
||||
|
||||
String STORE_NAME, ADDRESS, IN_TIME_IMAGE, OUT_TIME_IMAGE, UPLOAD_STATUS, VISIT_DATE, id, in_time, out_time;
|
||||
double LATITUDE, LONGITUDE;
|
||||
|
||||
public String getSTORE_NAME() {
|
||||
return STORE_NAME;
|
||||
}
|
||||
|
||||
public void setSTORE_NAME(String STORE_NAME) {
|
||||
this.STORE_NAME = STORE_NAME;
|
||||
}
|
||||
|
||||
public String getADDRESS() {
|
||||
return ADDRESS;
|
||||
}
|
||||
|
||||
public void setADDRESS(String ADDRESS) {
|
||||
this.ADDRESS = ADDRESS;
|
||||
}
|
||||
|
||||
public String getIN_TIME_IMAGE() {
|
||||
return IN_TIME_IMAGE;
|
||||
}
|
||||
|
||||
public void setIN_TIME_IMAGE(String IN_TIME_IMAGE) {
|
||||
this.IN_TIME_IMAGE = IN_TIME_IMAGE;
|
||||
}
|
||||
|
||||
public String getOUT_TIME_IMAGE() {
|
||||
return OUT_TIME_IMAGE;
|
||||
}
|
||||
|
||||
public void setOUT_TIME_IMAGE(String OUT_TIME_IMAGE) {
|
||||
this.OUT_TIME_IMAGE = OUT_TIME_IMAGE;
|
||||
}
|
||||
|
||||
public String getUPLOAD_STATUS() {
|
||||
return UPLOAD_STATUS;
|
||||
}
|
||||
|
||||
public void setUPLOAD_STATUS(String UPLOAD_STATUS) {
|
||||
this.UPLOAD_STATUS = UPLOAD_STATUS;
|
||||
}
|
||||
|
||||
public String getVISIT_DATE() {
|
||||
return VISIT_DATE;
|
||||
}
|
||||
|
||||
public void setVISIT_DATE(String VISIT_DATE) {
|
||||
this.VISIT_DATE = VISIT_DATE;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getIn_time() {
|
||||
return in_time;
|
||||
}
|
||||
|
||||
public void setIn_time(String in_time) {
|
||||
this.in_time = in_time;
|
||||
}
|
||||
|
||||
public String getOut_time() {
|
||||
return out_time;
|
||||
}
|
||||
|
||||
public void setOut_time(String out_time) {
|
||||
this.out_time = out_time;
|
||||
}
|
||||
|
||||
public double getLATITUDE() {
|
||||
return LATITUDE;
|
||||
}
|
||||
|
||||
public void setLATITUDE(double LATITUDE) {
|
||||
this.LATITUDE = LATITUDE;
|
||||
}
|
||||
|
||||
public double getLONGITUDE() {
|
||||
return LONGITUDE;
|
||||
}
|
||||
|
||||
public void setLONGITUDE(double LONGITUDE) {
|
||||
this.LONGITUDE = LONGITUDE;
|
||||
}
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class GeoFencingGetterSetter {
|
||||
|
||||
String table_GEO_FENCING;
|
||||
|
||||
ArrayList<String> COUNTRY_ID = new ArrayList<>();
|
||||
ArrayList<String> DISTANCE_MTR = new ArrayList<>();
|
||||
ArrayList<String> GEO_FENCING = new ArrayList<>();
|
||||
|
||||
public String getTable_GEO_FENCING() {
|
||||
return table_GEO_FENCING;
|
||||
}
|
||||
|
||||
public void setTable_GEO_FENCING(String table_GEO_FENCING) {
|
||||
this.table_GEO_FENCING = table_GEO_FENCING;
|
||||
}
|
||||
|
||||
public ArrayList<String> getCOUNTRY_ID() {
|
||||
return COUNTRY_ID;
|
||||
}
|
||||
|
||||
public void setCOUNTRY_ID(String COUNTRY_ID) {
|
||||
this.COUNTRY_ID.add(COUNTRY_ID);
|
||||
}
|
||||
|
||||
public ArrayList<String> getDISTANCE_MTR() {
|
||||
return DISTANCE_MTR;
|
||||
}
|
||||
|
||||
public void setDISTANCE_MTR(String DISTANCE_MTR) {
|
||||
this.DISTANCE_MTR.add(DISTANCE_MTR);
|
||||
}
|
||||
|
||||
public ArrayList<String> getGEO_FENCING() {
|
||||
return GEO_FENCING;
|
||||
}
|
||||
|
||||
public void setGEO_FENCING(String GEO_FENCING) {
|
||||
this.GEO_FENCING.add(GEO_FENCING);
|
||||
}
|
||||
}
|
||||
+9
@@ -28,6 +28,7 @@ public class JourneyPlanGetterSetter implements Serializable{
|
||||
ArrayList<String> LATITUDE = new ArrayList<String>();
|
||||
ArrayList<String> LONGITUDE = new ArrayList<String>();
|
||||
|
||||
ArrayList<String> POG_TYPE_ID = new ArrayList<String>();
|
||||
|
||||
public ArrayList<String> getCHANNEL_ID() {
|
||||
return CHANNEL_ID;
|
||||
@@ -183,4 +184,12 @@ public class JourneyPlanGetterSetter implements Serializable{
|
||||
public void setLONGITUDE(String LONGITUDE) {
|
||||
this.LONGITUDE.add(LONGITUDE);
|
||||
}
|
||||
|
||||
public ArrayList<String> getPOG_TYPE_ID() {
|
||||
return POG_TYPE_ID;
|
||||
}
|
||||
|
||||
public void setPOG_TYPE_ID(String POG_TYPE_ID) {
|
||||
this.POG_TYPE_ID.add(POG_TYPE_ID);
|
||||
}
|
||||
}
|
||||
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class MappingStockStorewiseGetterSetter {
|
||||
|
||||
String table_MAPPING_STOCK_STOREWISE;
|
||||
|
||||
ArrayList<String> STORE_ID = new ArrayList<>();
|
||||
ArrayList<String> SKU_ID = new ArrayList<>();
|
||||
ArrayList<String> MUST_HAVE = new ArrayList<>();
|
||||
ArrayList<String> MBQ = new ArrayList<>();
|
||||
ArrayList<String> SHOW_ADDITIONAL_VISIBILITY = new ArrayList<>();
|
||||
|
||||
public String getTable_MAPPING_STOCK_STOREWISE() {
|
||||
return table_MAPPING_STOCK_STOREWISE;
|
||||
}
|
||||
|
||||
public void setTable_MAPPING_STOCK_STOREWISE(String table_MAPPING_STOCK_STOREWISE) {
|
||||
this.table_MAPPING_STOCK_STOREWISE = table_MAPPING_STOCK_STOREWISE;
|
||||
}
|
||||
|
||||
public ArrayList<String> getSTORE_ID() {
|
||||
return STORE_ID;
|
||||
}
|
||||
|
||||
public void setSTORE_ID(String STORE_ID) {
|
||||
this.STORE_ID.add(STORE_ID);
|
||||
}
|
||||
|
||||
public ArrayList<String> getSKU_ID() {
|
||||
return SKU_ID;
|
||||
}
|
||||
|
||||
public void setSKU_ID(String SKU_ID) {
|
||||
this.SKU_ID.add(SKU_ID);
|
||||
}
|
||||
|
||||
public ArrayList<String> getMUST_HAVE() {
|
||||
return MUST_HAVE;
|
||||
}
|
||||
|
||||
public void setMUST_HAVE(String MUST_HAVE) {
|
||||
this.MUST_HAVE.add(MUST_HAVE);
|
||||
}
|
||||
|
||||
public ArrayList<String> getMBQ() {
|
||||
return MBQ;
|
||||
}
|
||||
|
||||
public void setMBQ(String MBQ) {
|
||||
this.MBQ.add(MBQ);
|
||||
}
|
||||
|
||||
public ArrayList<String> getSHOW_ADDITIONAL_VISIBILITY() {
|
||||
return SHOW_ADDITIONAL_VISIBILITY;
|
||||
}
|
||||
|
||||
public void setSHOW_ADDITIONAL_VISIBILITY(String SHOW_ADDITIONAL_VISIBILITY) {
|
||||
this.SHOW_ADDITIONAL_VISIBILITY.add(SHOW_ADDITIONAL_VISIBILITY);
|
||||
}
|
||||
}
|
||||
+4
-3
@@ -11,6 +11,10 @@ public class NoCameraDataGetterSetter {
|
||||
|
||||
boolean isVertical=false;
|
||||
|
||||
String SUB_CATEGORY_ID;
|
||||
String SUB_CATEGORY;
|
||||
int facing, row_no, column_no;
|
||||
|
||||
public String getSKUGROUP_ID() {
|
||||
return SKUGROUP_ID;
|
||||
}
|
||||
@@ -28,9 +32,6 @@ public class NoCameraDataGetterSetter {
|
||||
}
|
||||
|
||||
String CATEGORY_ID;
|
||||
String SUB_CATEGORY_ID;
|
||||
String SUB_CATEGORY;
|
||||
int facing, row_no, column_no;
|
||||
|
||||
public int getFacing() {
|
||||
return facing;
|
||||
|
||||
+108
@@ -0,0 +1,108 @@
|
||||
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class NoCameraLastVisitGetterSetter {
|
||||
|
||||
String table_NO_CAMERA_LAST_VISIT_DATA;
|
||||
|
||||
ArrayList<String> MID = new ArrayList<>();
|
||||
ArrayList<String> STORE_ID = new ArrayList<>();
|
||||
ArrayList<String> VISIT_DATE = new ArrayList<>();
|
||||
ArrayList<String> SKUGROUP_ID = new ArrayList<>();
|
||||
ArrayList<String> ROW_NO = new ArrayList<>();
|
||||
ArrayList<String> COLUMN_NO = new ArrayList<>();
|
||||
ArrayList<String> FACING = new ArrayList<>();
|
||||
ArrayList<String> IS_VERTICAL = new ArrayList<>();
|
||||
|
||||
public ArrayList<String> getCATEGORY_ID() {
|
||||
return CATEGORY_ID;
|
||||
}
|
||||
|
||||
public void setCATEGORY_ID(String CATEGORY_ID) {
|
||||
this.CATEGORY_ID.add(CATEGORY_ID);
|
||||
}
|
||||
|
||||
public ArrayList<String> getSUB_CATEGORY_ID() {
|
||||
return SUB_CATEGORY_ID;
|
||||
}
|
||||
|
||||
public void setSUB_CATEGORY_ID(String SUB_CATEGORY_ID) {
|
||||
this.SUB_CATEGORY_ID.add(SUB_CATEGORY_ID);
|
||||
}
|
||||
|
||||
ArrayList<String> CATEGORY_ID = new ArrayList<>();
|
||||
ArrayList<String> SUB_CATEGORY_ID = new ArrayList<>();
|
||||
|
||||
public String getTable_NO_CAMERA_LAST_VISIT_DATA() {
|
||||
return table_NO_CAMERA_LAST_VISIT_DATA;
|
||||
}
|
||||
|
||||
public void setTable_NO_CAMERA_LAST_VISIT_DATA(String table_NO_CAMERA_LAST_VISIT_DATA) {
|
||||
this.table_NO_CAMERA_LAST_VISIT_DATA = table_NO_CAMERA_LAST_VISIT_DATA;
|
||||
}
|
||||
|
||||
public ArrayList<String> getMID() {
|
||||
return MID;
|
||||
}
|
||||
|
||||
public void setMID(String MID) {
|
||||
this.MID.add(MID);
|
||||
}
|
||||
|
||||
public ArrayList<String> getSTORE_ID() {
|
||||
return STORE_ID;
|
||||
}
|
||||
|
||||
public void setSTORE_ID(String STORE_ID) {
|
||||
this.STORE_ID.add(STORE_ID);
|
||||
}
|
||||
|
||||
public ArrayList<String> getVISIT_DATE() {
|
||||
return VISIT_DATE;
|
||||
}
|
||||
|
||||
public void setVISIT_DATE(String VISIT_DATE) {
|
||||
this.VISIT_DATE.add(VISIT_DATE);
|
||||
}
|
||||
|
||||
public ArrayList<String> getSKUGROUP_ID() {
|
||||
return SKUGROUP_ID;
|
||||
}
|
||||
|
||||
public void setSKUGROUP_ID(String SKUGROUP_ID) {
|
||||
this.SKUGROUP_ID.add(SKUGROUP_ID);
|
||||
}
|
||||
|
||||
public ArrayList<String> getROW_NO() {
|
||||
return ROW_NO;
|
||||
}
|
||||
|
||||
public void setROW_NO(String ROW_NO) {
|
||||
this.ROW_NO.add(ROW_NO);
|
||||
}
|
||||
|
||||
public ArrayList<String> getCOLUMN_NO() {
|
||||
return COLUMN_NO;
|
||||
}
|
||||
|
||||
public void setCOLUMN_NO(String COLUMN_NO) {
|
||||
this.COLUMN_NO.add(COLUMN_NO);
|
||||
}
|
||||
|
||||
public ArrayList<String> getFACING() {
|
||||
return FACING;
|
||||
}
|
||||
|
||||
public void setFACING(String FACING) {
|
||||
this.FACING.add(FACING);
|
||||
}
|
||||
|
||||
public ArrayList<String> getIS_VERTICAL() {
|
||||
return IS_VERTICAL;
|
||||
}
|
||||
|
||||
public void setIS_VERTICAL(String IS_VERTICAL) {
|
||||
this.IS_VERTICAL.add(IS_VERTICAL);
|
||||
}
|
||||
}
|
||||
+37
@@ -14,6 +14,11 @@ public class NonWorkingReasonGetterSetter {
|
||||
ArrayList<String> REASON = new ArrayList<>();
|
||||
ArrayList<String> ENTRY_ALLOW = new ArrayList<>();
|
||||
ArrayList<String> IMAGE_ALLOW = new ArrayList<>();
|
||||
ArrayList<String> REMARK_REQUIRED = new ArrayList<>();
|
||||
ArrayList<String> REMARK_TYPE = new ArrayList<>();
|
||||
ArrayList<String> REMARK_LABEL = new ArrayList<>();
|
||||
ArrayList<String> REMARK_MANDATORY = new ArrayList<>();
|
||||
|
||||
|
||||
public String getTable_NON_WORKING_REASON() {
|
||||
return table_NON_WORKING_REASON;
|
||||
@@ -54,4 +59,36 @@ public class NonWorkingReasonGetterSetter {
|
||||
public void setIMAGE_ALLOW(String IMAGE_ALLOW) {
|
||||
this.IMAGE_ALLOW.add(IMAGE_ALLOW);
|
||||
}
|
||||
|
||||
public ArrayList<String> getREMARK_REQUIRED() {
|
||||
return REMARK_REQUIRED;
|
||||
}
|
||||
|
||||
public void setREMARK_REQUIRED(String REMARK_REQUIRED) {
|
||||
this.REMARK_REQUIRED.add(REMARK_REQUIRED);
|
||||
}
|
||||
|
||||
public ArrayList<String> getREMARK_TYPE() {
|
||||
return REMARK_TYPE;
|
||||
}
|
||||
|
||||
public void setREMARK_TYPE(String REMARK_TYPE) {
|
||||
this.REMARK_TYPE.add(REMARK_TYPE);
|
||||
}
|
||||
|
||||
public ArrayList<String> getREMARK_LABEL() {
|
||||
return REMARK_LABEL;
|
||||
}
|
||||
|
||||
public void setREMARK_LABEL(String REMARK_LABEL) {
|
||||
this.REMARK_LABEL.add(REMARK_LABEL);
|
||||
}
|
||||
|
||||
public ArrayList<String> getREMARK_MANDATORY() {
|
||||
return REMARK_MANDATORY;
|
||||
}
|
||||
|
||||
public void setREMARK_MANDATORY(String REMARK_MANDATORY) {
|
||||
this.REMARK_MANDATORY.add(REMARK_MANDATORY);
|
||||
}
|
||||
}
|
||||
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class NonWorkingSubReasonGetterSetter {
|
||||
|
||||
String table_NON_WORKING_SUB_REASON;
|
||||
|
||||
ArrayList<String> SUB_REASON_ID = new ArrayList<>();
|
||||
ArrayList<String> SUB_REASON = new ArrayList<>();
|
||||
ArrayList<String> REASON_ID = new ArrayList<>();
|
||||
|
||||
|
||||
public String getTable_NON_WORKING_SUB_REASON() {
|
||||
return table_NON_WORKING_SUB_REASON;
|
||||
}
|
||||
|
||||
public void setTable_NON_WORKING_SUB_REASON(String table_NON_WORKING_SUB_REASON) {
|
||||
this.table_NON_WORKING_SUB_REASON = table_NON_WORKING_SUB_REASON;
|
||||
}
|
||||
|
||||
public ArrayList<String> getSUB_REASON_ID() {
|
||||
return SUB_REASON_ID;
|
||||
}
|
||||
|
||||
public void setSUB_REASON_ID(String SUB_REASON_ID) {
|
||||
this.SUB_REASON_ID.add(SUB_REASON_ID);
|
||||
}
|
||||
|
||||
public ArrayList<String> getSUB_REASON() {
|
||||
return SUB_REASON;
|
||||
}
|
||||
|
||||
public void setSUB_REASON(String SUB_REASON) {
|
||||
this.SUB_REASON.add(SUB_REASON);
|
||||
}
|
||||
|
||||
public ArrayList<String> getREASON_ID() {
|
||||
return REASON_ID;
|
||||
}
|
||||
|
||||
public void setREASON_ID(String REASON_ID) {
|
||||
this.REASON_ID.add(REASON_ID);
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import java.util.ArrayList;
|
||||
|
||||
public class POGGetterSetter {
|
||||
|
||||
String QUESTION_ID, CULTURE_ID, SUB_CATEGORY_ID, QUESTION, ANSWER_TYPE, ANSWER_ID, ANSWER, CAM_IMAGE="", CAMERA_ALLOW="0",QTYPE_ID,QTYPE, CATEGORY_ID;
|
||||
String QUESTION_ID, CULTURE_ID, SUB_CATEGORY_ID, QUESTION, ANSWER_TYPE, ANSWER_ID = "0", ANSWER, CAM_IMAGE="", CAMERA_ALLOW="0",QTYPE_ID,QTYPE, CATEGORY_ID;
|
||||
|
||||
ArrayList<POGGetterSetter> answerList = new ArrayList<>();
|
||||
|
||||
|
||||
+19
@@ -15,6 +15,9 @@ public class POGQuestionGetterSetter {
|
||||
ArrayList<String> ANSWER_ID = new ArrayList<>();
|
||||
ArrayList<String> ANSWER = new ArrayList<>();
|
||||
|
||||
ArrayList<String> STORETYPE_ID = new ArrayList<>();
|
||||
ArrayList<String> POG_TYPE_ID = new ArrayList<>();
|
||||
|
||||
public String getTable_POG_QUESTION() {
|
||||
return table_POG_QUESTION;
|
||||
}
|
||||
@@ -94,4 +97,20 @@ public class POGQuestionGetterSetter {
|
||||
public void setANSWER(String ANSWER) {
|
||||
this.ANSWER.add(ANSWER);
|
||||
}
|
||||
|
||||
public ArrayList<String> getSTORETYPE_ID() {
|
||||
return STORETYPE_ID;
|
||||
}
|
||||
|
||||
public void setSTORETYPE_ID(String STORETYPE_ID) {
|
||||
this.STORETYPE_ID.add(STORETYPE_ID);
|
||||
}
|
||||
|
||||
public ArrayList<String> getPOG_TYPE_ID() {
|
||||
return POG_TYPE_ID;
|
||||
}
|
||||
|
||||
public void setPOG_TYPE_ID(String POG_TYPE_ID) {
|
||||
this.POG_TYPE_ID.add(POG_TYPE_ID);
|
||||
}
|
||||
}
|
||||
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class SupervisorListGetterSetter {
|
||||
|
||||
String table_SUPERVISOR_LIST;
|
||||
|
||||
ArrayList<String> EMP_ID = new ArrayList<>();
|
||||
ArrayList<String> SUPERVISOR = new ArrayList<>();
|
||||
ArrayList<String> COUNTRY_ID = new ArrayList<>();
|
||||
|
||||
public String getTable_SUPERVISOR_LIST() {
|
||||
return table_SUPERVISOR_LIST;
|
||||
}
|
||||
|
||||
public void setTable_SUPERVISOR_LIST(String table_SUPERVISOR_LIST) {
|
||||
this.table_SUPERVISOR_LIST = table_SUPERVISOR_LIST;
|
||||
}
|
||||
|
||||
public ArrayList<String> getEMP_ID() {
|
||||
return EMP_ID;
|
||||
}
|
||||
|
||||
public void setEMP_ID(String EMP_ID) {
|
||||
this.EMP_ID.add(EMP_ID);
|
||||
}
|
||||
|
||||
public ArrayList<String> getSUPERVISOR() {
|
||||
return SUPERVISOR;
|
||||
}
|
||||
|
||||
public void setSUPERVISOR(String SUPERVISOR) {
|
||||
this.SUPERVISOR.add(SUPERVISOR);
|
||||
}
|
||||
|
||||
public ArrayList<String> getCOUNTRY_ID() {
|
||||
return COUNTRY_ID;
|
||||
}
|
||||
|
||||
public void setCOUNTRY_ID(String COUNTRY_ID) {
|
||||
this.COUNTRY_ID.add(COUNTRY_ID);
|
||||
}
|
||||
}
|
||||
@@ -36,7 +36,20 @@ public class TableBean {
|
||||
public static String Table_POG_QUESTION;
|
||||
public static String Table_NON_T2P_REASON;
|
||||
public static String Table_CONFIGURATION_COUNTRY_WISE;
|
||||
public static String Table_NO_CAMERA_LAST_VISIT_DATA;
|
||||
public static String Table_GEO_FENCING;
|
||||
public static String Table_NON_WORKING_SUB_REASON;
|
||||
public static String Table_SUPERVISOR_LIST;
|
||||
public static String Table_CONFIGURATION_MASTER;
|
||||
public static String Table_MAPPING_STOCK_STOREWISE;
|
||||
|
||||
public static String getTable_NON_WORKING_SUB_REASON() {
|
||||
return Table_NON_WORKING_SUB_REASON;
|
||||
}
|
||||
|
||||
public static void setTable_NON_WORKING_SUB_REASON(String table_NON_WORKING_SUB_REASON) {
|
||||
Table_NON_WORKING_SUB_REASON = table_NON_WORKING_SUB_REASON;
|
||||
}
|
||||
|
||||
public static String getAdditionalDisplay() {
|
||||
return ADDITIONAL_DISPLAY;
|
||||
@@ -262,4 +275,44 @@ public class TableBean {
|
||||
public static void setTable_CONFIGURATION_COUNTRY_WISE(String table_CONFIGURATION_COUNTRY_WISE) {
|
||||
Table_CONFIGURATION_COUNTRY_WISE = table_CONFIGURATION_COUNTRY_WISE;
|
||||
}
|
||||
|
||||
public static String getTable_NO_CAMERA_LAST_VISIT_DATA() {
|
||||
return Table_NO_CAMERA_LAST_VISIT_DATA;
|
||||
}
|
||||
|
||||
public static void setTable_NO_CAMERA_LAST_VISIT_DATA(String table_NO_CAMERA_LAST_VISIT_DATA) {
|
||||
Table_NO_CAMERA_LAST_VISIT_DATA = table_NO_CAMERA_LAST_VISIT_DATA;
|
||||
}
|
||||
|
||||
public static String getTable_GEO_FENCING() {
|
||||
return Table_GEO_FENCING;
|
||||
}
|
||||
|
||||
public static void setTable_GEO_FENCING(String table_GEO_FENCING) {
|
||||
Table_GEO_FENCING = table_GEO_FENCING;
|
||||
}
|
||||
|
||||
public static String getTable_SUPERVISOR_LIST() {
|
||||
return Table_SUPERVISOR_LIST;
|
||||
}
|
||||
|
||||
public static void setTable_SUPERVISOR_LIST(String table_SUPERVISOR_LIST) {
|
||||
Table_SUPERVISOR_LIST = table_SUPERVISOR_LIST;
|
||||
}
|
||||
|
||||
public static String getTable_CONFIGURATION_MASTER() {
|
||||
return Table_CONFIGURATION_MASTER;
|
||||
}
|
||||
|
||||
public static void setTable_CONFIGURATION_MASTER(String table_CONFIGURATION_MASTER) {
|
||||
Table_CONFIGURATION_MASTER = table_CONFIGURATION_MASTER;
|
||||
}
|
||||
|
||||
public static String getTable_MAPPING_STOCK_STOREWISE() {
|
||||
return Table_MAPPING_STOCK_STOREWISE;
|
||||
}
|
||||
|
||||
public static void setTable_MAPPING_STOCK_STOREWISE(String table_MAPPING_STOCK_STOREWISE) {
|
||||
Table_MAPPING_STOCK_STOREWISE = table_MAPPING_STOCK_STOREWISE;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,9 +11,11 @@ import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.ChatMessageDownloadGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationContrywiseGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.ConfigurationMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.DisplayChecklistMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.DisplayMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.GeoFencingGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.LoginGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPINGT2PGetterSetter;
|
||||
@@ -25,15 +27,20 @@ import cpm.com.gskmtorange.xmlGetterSetter.MappingDisplayChecklistGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingPlanogramCountrywiseGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingPromotionGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockStorewiseGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingSubCategoryImageAllowGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.NoCameraDataGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.NoCameraLastVisitGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.NonT2pReasonGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingReasonGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.NonWorkingSubReasonGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.POGQuestionGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.STORE_PERFORMANCE_MasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.ShelfMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.SkuGroupMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.SubCategoryMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.SupervisorListGetterSetter;
|
||||
|
||||
/**
|
||||
* Created by yadavendras on 21-12-2016.
|
||||
@@ -206,6 +213,9 @@ public class XMLHandlers {
|
||||
if (xpp.getName().equals("LONGITUDE")) {
|
||||
jcpGetterSetter.setLONGITUDE(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("POG_TYPE_ID")) {
|
||||
jcpGetterSetter.setPOG_TYPE_ID(xpp.nextText());
|
||||
}
|
||||
}
|
||||
xpp.next();
|
||||
}
|
||||
@@ -451,6 +461,44 @@ public class XMLHandlers {
|
||||
return stock;
|
||||
}
|
||||
|
||||
// MAPPING_STOCK_STOREWISE XML HANDLER
|
||||
public static MappingStockStorewiseGetterSetter mappingStockStorewiseXMLHandler(XmlPullParser xpp,
|
||||
int eventType) {
|
||||
MappingStockStorewiseGetterSetter stock = new MappingStockStorewiseGetterSetter();
|
||||
|
||||
try {
|
||||
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
|
||||
if (xpp.getEventType() == XmlPullParser.START_TAG) {
|
||||
if (xpp.getName().equals("META_DATA")) {
|
||||
stock.setTable_MAPPING_STOCK_STOREWISE(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("STORE_ID")) {
|
||||
stock.setSTORE_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("SKU_ID")) {
|
||||
stock.setSKU_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("MUST_HAVE")) {
|
||||
stock.setMUST_HAVE(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("MBQ")) {
|
||||
stock.setMBQ(xpp.nextText());
|
||||
}if (xpp.getName().equals("SHOW_ADDITIONAL_VISIBILITY")) {
|
||||
stock.setSHOW_ADDITIONAL_VISIBILITY(xpp.nextText());
|
||||
}
|
||||
}
|
||||
xpp.next();
|
||||
}
|
||||
} catch (XmlPullParserException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
return stock;
|
||||
}
|
||||
|
||||
// MAPPING_T2P XML HANDLER
|
||||
public static MAPPINGT2PGetterSetter mappingT2pXMLHandler(XmlPullParser xpp,
|
||||
int eventType) {
|
||||
@@ -571,6 +619,19 @@ public class XMLHandlers {
|
||||
if (xpp.getName().equals("IMAGE_ALLOW")) {
|
||||
reason.setIMAGE_ALLOW(xpp.nextText());
|
||||
}
|
||||
|
||||
if (xpp.getName().equals("REMARK_REQUIRED")) {
|
||||
reason.setREMARK_REQUIRED(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("REMARK_TYPE")) {
|
||||
reason.setREMARK_TYPE(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("REMARK_LABEL")) {
|
||||
reason.setREMARK_LABEL(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("REMARK_MANDATORY")) {
|
||||
reason.setREMARK_MANDATORY(xpp.nextText());
|
||||
}
|
||||
}
|
||||
xpp.next();
|
||||
}
|
||||
@@ -1032,6 +1093,9 @@ public class XMLHandlers {
|
||||
if (xpp.getName().equals("NO_OF_CAMERA")) {
|
||||
st.setNO_OF_CAMERA(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("QTYPE")) {
|
||||
st.setTYPE(xpp.nextText());
|
||||
}
|
||||
}
|
||||
xpp.next();
|
||||
}
|
||||
@@ -1081,6 +1145,12 @@ public class XMLHandlers {
|
||||
if (xpp.getName().equals("KPI")) {
|
||||
st.setKPI(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("STORETYPE_ID")) {
|
||||
st.setSTORETYPE_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("POG_TYPE_ID")) {
|
||||
st.setPOG_TYPE_ID(xpp.nextText());
|
||||
}
|
||||
}
|
||||
xpp.next();
|
||||
}
|
||||
@@ -1198,6 +1268,192 @@ public class XMLHandlers {
|
||||
if (xpp.getName().equals("ADHOC_REPORTING")) {
|
||||
st.setADHOC_REPORTING(xpp.nextText());
|
||||
}
|
||||
|
||||
if (xpp.getName().equals("PDF_ALLOW")) {
|
||||
st.setPDF_ALLOW(xpp.nextText());
|
||||
}
|
||||
}
|
||||
xpp.next();
|
||||
}
|
||||
} catch (XmlPullParserException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return st;
|
||||
}
|
||||
|
||||
//NO_CAMERA_LAST_VISIT_DATA
|
||||
public static NoCameraLastVisitGetterSetter noCameraLastVisitXMLHandler(XmlPullParser xpp, int eventType) {
|
||||
NoCameraLastVisitGetterSetter st = new NoCameraLastVisitGetterSetter();
|
||||
|
||||
try {
|
||||
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
|
||||
if (xpp.getEventType() == XmlPullParser.START_TAG) {
|
||||
|
||||
if (xpp.getName().equals("META_DATA")) {
|
||||
st.setTable_NO_CAMERA_LAST_VISIT_DATA(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("MID")) {
|
||||
st.setMID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("STORE_ID")) {
|
||||
st.setSTORE_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("VISIT_DATE")) {
|
||||
st.setVISIT_DATE(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("CATEGORY_ID")) {
|
||||
st.setCATEGORY_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("SUB_CATEGORY_ID")) {
|
||||
st.setSUB_CATEGORY_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("SKUGROUP_ID")) {
|
||||
st.setSKUGROUP_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("ROW_NO")) {
|
||||
st.setROW_NO(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("COLUMN_NO")) {
|
||||
st.setCOLUMN_NO(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("FACING")) {
|
||||
st.setFACING(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("IS_VERTICAL")) {
|
||||
st.setIS_VERTICAL(xpp.nextText());
|
||||
}
|
||||
|
||||
}
|
||||
xpp.next();
|
||||
}
|
||||
} catch (XmlPullParserException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return st;
|
||||
}
|
||||
|
||||
//GEO_FENCING
|
||||
public static GeoFencingGetterSetter geoFencingXMLHandler(XmlPullParser xpp, int eventType) {
|
||||
GeoFencingGetterSetter st = new GeoFencingGetterSetter();
|
||||
|
||||
try {
|
||||
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
|
||||
if (xpp.getEventType() == XmlPullParser.START_TAG) {
|
||||
|
||||
if (xpp.getName().equals("META_DATA")) {
|
||||
st.setTable_GEO_FENCING(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("COUNTRY_ID")) {
|
||||
st.setCOUNTRY_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("DISTANCE_MTR")) {
|
||||
st.setDISTANCE_MTR(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("GEO_FENCING")) {
|
||||
st.setGEO_FENCING(xpp.nextText());
|
||||
}
|
||||
}
|
||||
|
||||
xpp.next();
|
||||
}
|
||||
} catch (XmlPullParserException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return st;
|
||||
}
|
||||
|
||||
// NON_WORKING_SUB_REASON XML HANDLER
|
||||
public static NonWorkingSubReasonGetterSetter nonWorkingSubReasonXMLHandler(XmlPullParser xpp,
|
||||
int eventType) {
|
||||
NonWorkingSubReasonGetterSetter reason = new NonWorkingSubReasonGetterSetter();
|
||||
|
||||
try {
|
||||
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
|
||||
if (xpp.getEventType() == XmlPullParser.START_TAG) {
|
||||
if (xpp.getName().equals("META_DATA")) {
|
||||
reason.setTable_NON_WORKING_SUB_REASON(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("REASON_ID")) {
|
||||
reason.setREASON_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("SUB_REASON_ID")) {
|
||||
reason.setSUB_REASON_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("SUB_REASON")) {
|
||||
reason.setSUB_REASON(xpp.nextText());
|
||||
}
|
||||
}
|
||||
xpp.next();
|
||||
}
|
||||
} catch (XmlPullParserException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
return reason;
|
||||
}
|
||||
|
||||
//SUPERVISOR_LIST
|
||||
public static SupervisorListGetterSetter supervisorListXMLHandler(XmlPullParser xpp, int eventType) {
|
||||
SupervisorListGetterSetter st = new SupervisorListGetterSetter();
|
||||
|
||||
try {
|
||||
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
|
||||
if (xpp.getEventType() == XmlPullParser.START_TAG) {
|
||||
|
||||
if (xpp.getName().equals("META_DATA")) {
|
||||
st.setTable_SUPERVISOR_LIST(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("COUNTRY_ID")) {
|
||||
st.setCOUNTRY_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("EMP_ID")) {
|
||||
st.setEMP_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("SUPERVISOR")) {
|
||||
st.setSUPERVISOR(xpp.nextText());
|
||||
}
|
||||
}
|
||||
|
||||
xpp.next();
|
||||
}
|
||||
} catch (XmlPullParserException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return st;
|
||||
}
|
||||
|
||||
//CONFIGURATION_MASTER
|
||||
public static ConfigurationMasterGetterSetter configurationMasterXMLHandler(XmlPullParser xpp, int eventType) {
|
||||
ConfigurationMasterGetterSetter st = new ConfigurationMasterGetterSetter();
|
||||
|
||||
try {
|
||||
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
|
||||
if (xpp.getEventType() == XmlPullParser.START_TAG) {
|
||||
|
||||
if (xpp.getName().equals("META_DATA")) {
|
||||
st.setTable_CONFIGURATION_MASTER(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("COUNTRY_ID")) {
|
||||
st.setCOUNTRY_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("CONFIGURE")) {
|
||||
st.setCONFIGURE(xpp.nextText());
|
||||
}
|
||||
|
||||
if (xpp.getName().equals("ACTIVE")) {
|
||||
st.setACTIVE(xpp.nextText());
|
||||
}
|
||||
}
|
||||
xpp.next();
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 5.1 KiB |
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context=".dailyentry.CoachingVisitActivity">
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/AppTheme.AppBarOverlay">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay" />
|
||||
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<include layout="@layout/content_coaching_visit" />
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
app:srcCompat="@drawable/right_arrow"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab_save"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|left"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
app:srcCompat="@drawable/save_icon" />
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
@@ -0,0 +1,43 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context=".dailyentry.DeliveryCallActivity">
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/AppTheme.AppBarOverlay">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay" />
|
||||
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<include layout="@layout/content_delivery_call" />
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
app:srcCompat="@drawable/add" />
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab_upload"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|left"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
app:srcCompat="@drawable/upload"
|
||||
android:visibility="gone"/>
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context=".dailyentry.DeliveryCallAddStoreActivity">
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/AppTheme.AppBarOverlay">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="?attr/colorPrimary"
|
||||
app:popupTheme="@style/AppTheme.PopupOverlay" />
|
||||
|
||||
</android.support.design.widget.AppBarLayout>
|
||||
|
||||
<include layout="@layout/content_delivery_call_add_store" />
|
||||
|
||||
<android.support.design.widget.FloatingActionButton
|
||||
android:id="@+id/fab"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom|end"
|
||||
android:layout_margin="@dimen/fab_margin"
|
||||
app:srcCompat="@drawable/save_icon" />
|
||||
|
||||
</android.support.design.widget.CoordinatorLayout>
|
||||
@@ -26,11 +26,81 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
/>
|
||||
android:layout_marginRight="5dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/no_data_lay"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/grey_background"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone"
|
||||
android:weightSum="10">
|
||||
|
||||
<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_weight="1"
|
||||
card_view:cardBackgroundColor="@color/white"
|
||||
card_view:cardCornerRadius="5dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="@string/NodataAvailable"
|
||||
android:textSize="25sp"
|
||||
android:textStyle="bold" />
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/imageView3"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="0dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_weight="4"
|
||||
android:background="@drawable/sad_cloud" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:layout_marginRight="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_weight="1"
|
||||
android:visibility="gone"
|
||||
card_view:cardBackgroundColor="@color/white"
|
||||
card_view:cardCornerRadius="5dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="@string/Pleasedownaloaddata"
|
||||
android:textSize="25sp"
|
||||
android:textStyle="bold" />
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
tools:context=".dailyentry.CoachingVisitActivity"
|
||||
tools:showIn="@layout/activity_coaching_visit"
|
||||
android:background="@color/grey_background"
|
||||
>
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:elevation="10dp"
|
||||
app:cardCornerRadius="5dp"
|
||||
android:layout_margin="10dp"
|
||||
>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginBottom="10dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/coaching_visit"
|
||||
android:textSize="@dimen/text_size_normal"
|
||||
android:textColor="@color/black"
|
||||
android:layout_marginRight="10dp"/>
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/spinner_coaching_visit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"></Spinner>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/linear_supervisor"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<!-- <Spinner
|
||||
android:id="@+id/spinner_supervisor"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="20dp"
|
||||
android:layout_marginTop="10dp"/>-->
|
||||
|
||||
<com.androidbuts.multispinnerfilter.MultiSpinnerSearch
|
||||
android:id="@+id/multi_spinner_supervisor"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="20dp"
|
||||
android:layout_marginTop="10dp"
|
||||
app:hintText="@string/select_coach" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_cam"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@mipmap/camera_orange"
|
||||
android:layout_centerInParent="true"/>
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
tools:context=".dailyentry.DeliveryCallActivity"
|
||||
tools:showIn="@layout/activity_delivery_call"
|
||||
android:background="@color/grey_background">
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/rec_delivery_calls"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:padding="5dp"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior"
|
||||
tools:context=".dailyentry.DeliveryCallAddStoreActivity"
|
||||
tools:showIn="@layout/activity_delivery_call_add_store"
|
||||
android:background="@color/grey_background">
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="5dp"
|
||||
android:elevation="5dp">
|
||||
|
||||
<android.support.constraint.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_customer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/customer_store_name"
|
||||
android:textSize="@dimen/text_size_normal"
|
||||
android:padding="5dp"
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_customer_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_customer"
|
||||
android:padding="5dp"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_address"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="16dp"
|
||||
app:layout_constraintTop_toBottomOf="@+id/et_customer_name"
|
||||
android:text="@string/address"
|
||||
android:textSize="@dimen/text_size_normal"
|
||||
android:padding="5dp"
|
||||
/>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_address"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_address"
|
||||
android:padding="5dp"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintTop_toBottomOf="@+id/et_address"
|
||||
android:layout_marginTop="10dp">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_intime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/intime_image"
|
||||
android:textSize="@dimen/text_size_small"
|
||||
android:layout_centerHorizontal="true"/>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_checkin"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@mipmap/camera_orange"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_below="@+id/tv_intime"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_outtime"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/outtime_image"
|
||||
android:textSize="@dimen/text_size_small"
|
||||
android:layout_centerHorizontal="true"/>
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/img_checkout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@mipmap/camera_orange"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_below="@+id/tv_outtime"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
@@ -0,0 +1,104 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/delivery_listview_layout">
|
||||
|
||||
<android.support.v7.widget.CardView
|
||||
android:id="@+id/card_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:layout_marginLeft="2dp"
|
||||
android:layout_marginRight="2dp"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_weight="35"
|
||||
card_view:cardBackgroundColor="@color/colorOrange"
|
||||
card_view:cardCornerRadius="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:weightSum="10">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/delivery_ico"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
|
||||
android:padding="10dp" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_weight="7.5"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_store_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/GSKMT"
|
||||
android:textColor="#1F3A6C"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_store_address"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/address"
|
||||
android:textColor="#666666"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="normal" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1.5">
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/chkout"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginRight="5dp"
|
||||
android:background="@mipmap/checkout"
|
||||
android:focusable="false"
|
||||
android:visibility="gone"/>
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_cancel"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_marginRight="5dp"
|
||||
android:background="@mipmap/cancel_icon"
|
||||
android:focusable="false"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
</LinearLayout>
|
||||
@@ -47,7 +47,7 @@
|
||||
android:textStyle="bold" />
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/spinner2"
|
||||
android:id="@+id/spinner_reason"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50sp"
|
||||
android:layout_alignParentLeft="true"
|
||||
@@ -87,10 +87,9 @@
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_remark"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_above="@+id/reasontxt"
|
||||
|
||||
android:paddingLeft="10dp"
|
||||
android:text="@string/Remark"
|
||||
android:textColor="@color/colorPrimary"
|
||||
@@ -102,7 +101,20 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:ems="20" />
|
||||
android:layout_below="@id/tv_remark"
|
||||
android:ems="20"
|
||||
/>
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/spinner_sub_reason"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50sp"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_below="@id/tv_remark"
|
||||
android:layout_marginTop="5dp"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
|
||||
@@ -28,6 +28,13 @@
|
||||
android:title="@string/menu_deviation_data"
|
||||
android:visible="false"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/nav_delivery_call"
|
||||
android:icon="@mipmap/baseline_local_shipping_black_48"
|
||||
android:title="@string/delivery_call"
|
||||
android:visible="false"
|
||||
/>
|
||||
|
||||
<item
|
||||
android:id="@+id/nav_future_jcp"
|
||||
android:icon="@drawable/ic_date_range_black"
|
||||
@@ -36,7 +43,8 @@
|
||||
<item
|
||||
android:id="@+id/nav_planogram"
|
||||
android:icon="@mipmap/ic_view_quilt_black_48dp"
|
||||
android:title="@string/category_performance_PLANOGRAM" />
|
||||
android:title="@string/category_performance_PLANOGRAM"
|
||||
android:visible="false"/>
|
||||
|
||||
<item
|
||||
android:id="@+id/nav_exit"
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 992 B |
@@ -24,7 +24,7 @@
|
||||
<string name="availability_data_uploading">توافر تحميل البيانات</string>
|
||||
<string name="brand">العلامة التجارية</string>
|
||||
<string name="brandname">اسم العلامة التجارية</string>
|
||||
<string name="address">C 126, Okhla II,</string>
|
||||
|
||||
<string name="camera">الكاميرا</string>
|
||||
<string name="cancel">إلغاء الأمر</string>
|
||||
<string name="title_activity_category_list">قائمة الفئات</string>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<string name="availability_data_uploading">توافر تحميل البيانات</string>
|
||||
<string name="brand">العلامة التجارية</string>
|
||||
<string name="brandname">اسم العلامة التجارية</string>
|
||||
<string name="address">C 126, Okhla II,</string>
|
||||
|
||||
<string name="camera">الكاميرا</string>
|
||||
<string name="cancel">إلغاء الأمر</string>
|
||||
<string name="title_activity_category_list">قائمة الفئات</string>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<string name="availability_data_uploading">توافر تحميل البيانات</string>
|
||||
<string name="brand">العلامة التجارية</string>
|
||||
<string name="brandname">اسم العلامة التجارية</string>
|
||||
<string name="address">C 126, Okhla II,</string>
|
||||
|
||||
<string name="camera">الكاميرا</string>
|
||||
<string name="cancel">إلغاء الأمر</string>
|
||||
<string name="title_activity_category_list">قائمة الفئات</string>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<string name="availability_data_uploading">توافر تحميل البيانات</string>
|
||||
<string name="brand">العلامة التجارية</string>
|
||||
<string name="brandname">اسم العلامة التجارية</string>
|
||||
<string name="address">C 126, Okhla II,</string>
|
||||
|
||||
<string name="camera">الكاميرا</string>
|
||||
<string name="cancel">إلغاء الأمر</string>
|
||||
<string name="title_activity_category_list">قائمة الفئات</string>
|
||||
@@ -276,4 +276,22 @@
|
||||
<string name="adhoc">غير مخططة</string>
|
||||
<string name="hint_reply">أدخل الرد</string>
|
||||
|
||||
<string name="you_need_to_be_in_the_store">يجب ان تكون داخل المحل حتى تتمكن من فتح/اغلاق الزيارة</string>
|
||||
<string name="distance_from_the_store">المسافة عن المحل</string>
|
||||
|
||||
<string name="meters">meters</string>
|
||||
<string name="title_activity_coaching_visit">تدريب يزور</string>
|
||||
<string name="select_supervisor">Select Supervisor</string>
|
||||
<string name="coaching_visit">تدريب يزور</string>
|
||||
<string name="please_save_data">الرجاء حفظ المعلومات</string>
|
||||
<string name="delivery_call">زيارات توصيل</string>
|
||||
<string name="add_store">اضافة محل</string>
|
||||
<string name="please_fill">الرجاء تعبئة</string>
|
||||
<string name="address">العنوان</string>
|
||||
<string name="customer_store_name">اسم العميل / المحل</string>
|
||||
<string name="please_click">الرجاء الضغط على</string>
|
||||
<string name="intime_image">صورة الدخول</string>
|
||||
<string name="outtime_image">صورة الخروج</string>
|
||||
<string name="select_coach">أختار مدرب</string>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -313,6 +313,10 @@
|
||||
<string name="adhoc">Ad hoc</string>
|
||||
<string name="hint_reply">cevap giriniz</string>
|
||||
|
||||
<!--Geofencing-->
|
||||
<string name="you_need_to_be_in_the_store">Giriş/Çıkış yapmak için mağazada olmalısınız</string>
|
||||
<string name="distance_from_the_store">Mağazadan uzaklık</string>
|
||||
|
||||
</resources>
|
||||
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<string name="delete">Delete</string>
|
||||
<string name="StoreVisited"> Store Visited</string>
|
||||
<string name="GSKMT">GSK MT ORANGE STORE</string>
|
||||
<string name="address">C 126, Okhla II,</string>
|
||||
|
||||
<string name="storefront">Click Store Front Image</string>
|
||||
|
||||
<string name="select_language">Please select language</string>
|
||||
@@ -368,4 +368,23 @@
|
||||
<string name="adhoc">Ad hoc</string>
|
||||
<string name="hint_reply">Type response</string>
|
||||
|
||||
<!--Geofencing-->
|
||||
<string name="you_need_to_be_in_the_store">You need to be in the store to Checkin/Checkout</string>
|
||||
<string name="distance_from_the_store">Distance from Store</string>
|
||||
<string name="meters">meters</string>
|
||||
<string name="title_activity_coaching_visit">Coaching Visit</string>
|
||||
<string name="select_supervisor">Select Supervisor</string>
|
||||
<string name="coaching_visit">Coaching Visit</string>
|
||||
<string name="please_save_data">Please save data</string>
|
||||
<string name="delivery_call">Delivery Calls</string>
|
||||
<string name="add_store">Add Store</string>
|
||||
<string name="please_fill">Please fill</string>
|
||||
<string name="address">Address</string>
|
||||
<string name="customer_store_name">Customer Store Name</string>
|
||||
<string name="please_click">Please click</string>
|
||||
<string name="intime_image">In time image</string>
|
||||
<string name="outtime_image">Out time image</string>
|
||||
<string name="select_coach">Select Coach</string>
|
||||
|
||||
|
||||
</resources>
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ buildscript {
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.1.2'
|
||||
classpath 'com.android.tools.build:gradle:3.1.4'
|
||||
classpath 'io.fabric.tools:gradle:1.24.4'
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
include ':GSKMTOrange'
|
||||
include ':library',':GSKMTOrange'
|
||||
|
||||
Reference in New Issue
Block a user