Deepak_commit_31_05_2018

This commit is contained in:
yadavendras
2018-10-08 18:46:28 +05:30
parent 34d8473e33
commit b0e2e05501
30 changed files with 841 additions and 42 deletions
+1 -1
View File
@@ -31,7 +31,7 @@
</value>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
+6 -6
View File
@@ -21,20 +21,20 @@ android {
targetSdkVersion 22
//For Egypt
versionCode 19
versionName "3.1"
/* versionCode 19
versionName "3.1"*/
//For UAE
/*versionCode 19
versionName "3.1"*/
/*versionCode 18
versionName "3.0"*/
//For Turkey
/*versionCode 15
versionName "2.7"*/
//For KSA
/*versionCode 19
versionName "3.1"*/
versionCode 20
versionName "3.2"
multiDexEnabled true
+12 -1
View File
@@ -299,7 +299,18 @@
<activity
android:name=".dailyentry.CoachingVisitActivity"
android:label="@string/title_activity_coaching_visit"
android:theme="@style/AppTheme.NoActionBar"></activity>
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>
@@ -35,6 +35,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.CategoryMasterGetterSetter;
import cpm.com.gskmtorange.xmlGetterSetter.CategoryWisePerformaceGetterSetter;
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.GapsChecklistGetterSetter;
@@ -81,7 +82,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
*/
public class GSKOrangeDB extends SQLiteOpenHelper {
public static final String DATABASE_NAME = "GSK_ORANGE_DB35";
public static final String DATABASE_NAME = "GSK_ORANGE_DB37";
public static final int DATABASE_VERSION = 15;
TableBean tableBean;
private SQLiteDatabase db;
@@ -181,6 +182,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
db.execSQL(TableBean.getTable_GEO_FENCING());
db.execSQL(TableBean.getTable_NON_WORKING_SUB_REASON());//--Added 26.09.2018
db.execSQL(TableBean.getTable_SUPERVISOR_LIST());//--Added 01.10.2018
db.execSQL(TableBean.getTable_CONFIGURATION_MASTER());//--Added 03.10.2018
//15-03-2017
db.execSQL(CommonString.CREATE_TABLE_INSERT_MSL_AVAILABILITY_STOCK_FACING);
@@ -6643,4 +6645,52 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
return sb;
}
//CONFIGURATION_MASTER
public void InsertCONFIGURATION_MASTER(ConfigurationMasterGetterSetter data) {
db.delete("CONFIGURATION_MASTER", null, null);
ContentValues values = new ContentValues();
try {
for (int i = 0; i < data.getCOUNTRY_ID().size(); i++) {
values.put("COUNTRY_ID", data.getCOUNTRY_ID().get(i));
values.put("CONFIGURE", data.getCONFIGURE().get(i));
values.put("ACTIVE", data.getACTIVE().get(i));
db.insert("CONFIGURATION_MASTER", null, values);
}
} catch (Exception ex) {
Log.d("Exception ", " in CONFIGURATION_MASTER " + ex.toString());
}
}
// get Configuration Master data
public ArrayList<ConfigurationMasterGetterSetter> getConfigurationMasterData(String country_id) {
ArrayList<ConfigurationMasterGetterSetter> list = new ArrayList<>();
Cursor dbcursor = null;
try {
dbcursor = db.rawQuery("SELECT * FROM CONFIGURATION_MASTER WHERE COUNTRY_ID='" + country_id + "'", null);
if (dbcursor != null) {
dbcursor.moveToFirst();
while (!dbcursor.isAfterLast()) {
ConfigurationMasterGetterSetter msg = new ConfigurationMasterGetterSetter();
msg.setCONFIGURE(dbcursor.getString(dbcursor.getColumnIndexOrThrow("CONFIGURE")));
msg.setACTIVE(dbcursor.getString(dbcursor.getColumnIndexOrThrow("ACTIVE")));
list.add(msg);
dbcursor.moveToNext();
}
dbcursor.close();
return list;
}
} catch (Exception e) {
Log.d("Exception ", "get Chat Message" + e.toString());
}
return list;
}
}
@@ -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,7 +148,7 @@ 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")){
@@ -158,6 +160,25 @@ public class MainActivity extends AppCompatActivity
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);
}
}
}
coverageList = db.getCoverageData(date, null);
@@ -371,6 +392,11 @@ public class MainActivity extends AppCompatActivity
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);
}
@@ -229,6 +229,20 @@ public class CommonString {
+ 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+ " INTEGER,"
+ KEY_ADDRESS + " VARCHAR,"
+ KEY_IMAGE + " VARCHAR,"
+ KEY_IMAGE1 + " VARCHAR,"
+ KEY_UPLOAD_STATUS + " VARCHAR,"
+ KEY_VISIT_DATE + " VARCHAR)";
public static final String CREATE_TABLE_STORE_GEOTAGGING = "CREATE TABLE IF NOT EXISTS "
+ TABLE_STORE_GEOTAGGING
+ " ("
@@ -35,6 +35,7 @@ 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{
@@ -48,13 +49,14 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
ImageView img_cam;
FloatingActionButton fab_next, fab_save;
String emp_id;
protected String _pathforcheck = "", _path, image_name="", str;
protected String _pathforcheck = "", _path, image_name="", str, country_id;
String visit_date, store_id, username;
private SharedPreferences preferences;
String gallery_package = "";
Uri outputFileUri;
boolean saved_flag = false, update_flag = false;
CoachingVisitGetterSetter coachingVisitdata;
boolean coaching_visit_camera_flag = false;
@Override
protected void onCreate(Bundle savedInstanceState) {
@@ -79,8 +81,8 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
username = preferences.getString(CommonString.KEY_USERNAME, "");
visit_date = preferences.getString(CommonString.KEY_DATE, null);
username = preferences.getString(CommonString.KEY_USERNAME, 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);
@@ -90,6 +92,28 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
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,
@@ -137,8 +161,6 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
case R.id.spinner_coaching_visit:
if (position != 0) {
if(!update_flag){
fab_save.setVisibility(View.VISIBLE);
@@ -183,8 +205,6 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
fab_save.setVisibility(View.GONE);
}
break;
case R.id.spinner_supervisor:
@@ -227,7 +247,7 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
flag = false;
error_msg = getString(R.string.title_activity_select_dropdown);
}
else if(image_name.equals("")){
else if(coaching_visit_camera_flag && image_name.equals("")){
flag = false;
error_msg = getString(R.string.clickimage);
}
@@ -0,0 +1,34 @@
package cpm.com.gskmtorange.dailyentry;
import android.content.Intent;
import android.os.Bundle;
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.view.View;
import cpm.com.gskmtorange.R;
public class DeliveryCallActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_delivery_call);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent in = new Intent(getApplicationContext(), DeliveryCallAddStoreActivity.class);
startActivity(in);
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
}
});
}
}
@@ -0,0 +1,221 @@
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.BaseTransientBottomBar;
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.View;
import android.widget.EditText;
import android.widget.ImageView;
import com.crashlytics.android.Crashlytics;
import java.io.File;
import java.util.List;
import cpm.com.gskmtorange.R;
import cpm.com.gskmtorange.constant.CommonFunctions;
import cpm.com.gskmtorange.constant.CommonString;
public class DeliveryCallAddStoreActivity extends AppCompatActivity implements View.OnClickListener{
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;
private SharedPreferences preferences;
Uri outputFileUri;
String gallery_package = "";
@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);
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);
if(checkin_flag){
img_checkin.setOnClickListener(this);
}
else {
img_checkout.setOnClickListener(this);
}
FloatingActionButton fab = (FloatingActionButton) findViewById(R.id.fab);
fab.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
if(isValid()){
}
else {
Snackbar.make(et_customer,error_msg,Snackbar.LENGTH_SHORT).show();
}
}
});
str = CommonString.FILE_PATH;
}
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.intime_image).toLowerCase();
flag = false;
}
return flag;
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.img_checkin:
_pathforcheck = "CoachingVisit" + visit_date.replace("/", "")+ "InTime" + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
_path = CommonString.FILE_PATH + _pathforcheck;
startCameraActivity(0);
break;
case R.id.img_checkout:
_pathforcheck = "CoachingVisit" + visit_date.replace("/", "")+ "OutTime" + CommonFunctions.getCurrentTimeWithLanguage(getApplicationContext()).replace(":", "") + ".jpg";
_path = CommonString.FILE_PATH + _pathforcheck;
startCameraActivity(0);
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;
}
}
}
@@ -852,15 +852,18 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
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){
String msg = getString(R.string.distance_from_the_store) + " " + distance + " meters";
Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_SHORT).show();
editor = preferences.edit();
editor.putString(CommonString.KEY_STORE_ID, current.getSTORE_ID());
@@ -46,6 +46,7 @@ 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;
@@ -111,6 +112,7 @@ public class DownloadActivity extends AppCompatActivity {
GeoFencingGetterSetter geoFencingGetterSetter;
NonWorkingSubReasonGetterSetter nonWorkingSubReasonGetterSetter;
SupervisorListGetterSetter supervisorListGetterSetter;
ConfigurationMasterGetterSetter configurationMasterGetterSetter;
private Dialog dialog;
private ProgressBar pb;
@@ -683,17 +685,20 @@ public class DownloadActivity extends AppCompatActivity {
xpp.next();
eventType = xpp.getEventType();
nonWorkingSubReasonGetterSetter = XMLHandlers.nonWorkingSubReasonXMLHandler(xpp, eventType);
if (nonWorkingSubReasonGetterSetter.getREASON_ID().size() > 0) {
String reasontable = nonWorkingSubReasonGetterSetter.getTable_NON_WORKING_SUB_REASON();
if (reasontable != null) {
resultHttp = CommonString.KEY_SUCCESS;
TableBean.setTable_NON_WORKING_SUB_REASON(reasontable);
}
} else {
return "NON_WORKING_SUB_REASON";
String reasontable = nonWorkingSubReasonGetterSetter.getTable_NON_WORKING_SUB_REASON();
if (reasontable != null) {
resultHttp = CommonString.KEY_SUCCESS;
TableBean.setTable_NON_WORKING_SUB_REASON(reasontable);
}
data.value = 70;
data.name = "NON_WORKING_SUB_REASON " + getResources().getString(R.string.download_data);
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);
@@ -1263,6 +1268,41 @@ public class DownloadActivity extends AppCompatActivity {
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
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
request.addProperty("UserName", userId);
@@ -1567,6 +1607,7 @@ public class DownloadActivity extends AppCompatActivity {
db.InsertNO_CAMERA_LAST_VISIT_DATA(noCameraLastVisitGetterSetter);
db.insertSUPERVISOR_LIST_DATA(supervisorListGetterSetter);
db.InsertGeoTag_DATA(geoFencingGetterSetter);
db.InsertCONFIGURATION_MASTER(configurationMasterGetterSetter);
} catch (MalformedURLException e) {
@@ -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;
@@ -31,6 +32,7 @@ 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 {
@@ -41,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;
@@ -68,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);
@@ -80,10 +83,35 @@ public class StoreWisePerformanceActivity extends AppCompatActivity {
public void onClick(View view) {
//Intent intent = new Intent(StoreWisePerformanceActivity.this, CategoryListActivity.class);
//Intent intent = new Intent(StoreWisePerformanceActivity.this, MessageActivity.class);
Intent intent = new Intent(StoreWisePerformanceActivity.this, CoachingVisitActivity.class);
startActivity(intent);
finish();
overridePendingTransition(R.anim.activity_in, R.anim.activity_out);
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);
}
}
});
} catch (Resources.NotFoundException e) {
@@ -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;
@@ -1075,6 +1076,53 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
data.name = getString(R.string.pog);
publishProgress(data);
//Coaching visit data----------------------------------------
db.open();
CoachingVisitGetterSetter coachingVisitData = db.getCoachingVisitData(coverageList.get(i).getStoreId());
if (coachingVisitData!=null && coachingVisitData.getEmp_id()!=null) {
String onXml_coaching_data = "";
String exist;
if(coachingVisitData.isExists()){
exist = "1";
}
else {
exist = "0";
}
onXml_coaching_data = "[COACHING_VISIT_DATA]"
+ "[MID]" + mid + "[/MID]"
+ "[USER_ID]" + userId + "[/USER_ID]"
+ "[EMP_ID]" + coachingVisitData.getEmp_id() + "[/EMP_ID]"
+ "[IMAGE]" + coachingVisitData.getImg_path() + "[/IMAGE]"
+ "[IS_EXIST]" + exist + "[/IS_EXIST]"
+ "[/COACHING_VISIT_DATA]";
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
@@ -1215,8 +1215,6 @@ public class UploadActivity extends AppCompatActivity {
publishProgress(data);
}
// SET COVERAGE STATUS
String final_xml = "";
onXML = "";
@@ -232,7 +232,9 @@ public class UploadImageWithRetrofit {
foldername = "CategoryImages";
} else if (file[i].getName().contains("AuditAnsPic")) {
foldername = "AuditImages";
} else {
} else if (file[i].getName().contains("CoachingVisit")) {
foldername = "CoachingVisits";
} else{
foldername = "Bulkimages";
}
@@ -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);
}
}
@@ -40,6 +40,7 @@ public class TableBean {
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 getTable_NON_WORKING_SUB_REASON() {
return Table_NON_WORKING_SUB_REASON;
@@ -297,4 +298,12 @@ public class TableBean {
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;
}
}
@@ -11,6 +11,7 @@ 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;
@@ -1380,4 +1381,36 @@ public class XMLHandlers {
}
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();
}
} catch (XmlPullParserException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return st;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

@@ -0,0 +1,33 @@
<?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"
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/save_icon" />
</android.support.design.widget.CoordinatorLayout>
@@ -0,0 +1,33 @@
<?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"
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>
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout 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.support.constraint.ConstraintLayout>
@@ -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>
@@ -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"
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>
+10 -1
View File
@@ -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>
@@ -376,5 +376,14 @@
<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 Call</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>
</resources>