Egypt_stock_change
This commit is contained in:
Generated
BIN
Binary file not shown.
@@ -21,8 +21,8 @@ android {
|
||||
targetSdkVersion 26
|
||||
|
||||
//For Egypt
|
||||
versionCode 29
|
||||
versionName "4.1"
|
||||
versionCode 30
|
||||
versionName "4.2"
|
||||
|
||||
//For UAE
|
||||
/* versionCode 25
|
||||
|
||||
@@ -95,7 +95,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
|
||||
*/
|
||||
|
||||
public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
public static final String DATABASE_NAME = "GSK_ORANGE_DB64";
|
||||
public static final String DATABASE_NAME = "GSK_ORANGE_DB65";
|
||||
public static final int DATABASE_VERSION = 15;
|
||||
TableBean tableBean;
|
||||
private SQLiteDatabase db;
|
||||
@@ -346,6 +346,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
db.delete(CommonString.TABLE_INSERT_COUNTERFEIT_PRODUCT, null, null);
|
||||
db.delete(CommonString.TABLE_INSERT_COMPETIOTIONN_PROMO, null, null);
|
||||
db.delete(CommonString.TABLE_INSERT_COMPETIOTIONN_PROMO_EXISTS, null, null);
|
||||
|
||||
}
|
||||
|
||||
public void InsertJCP(JourneyPlanGetterSetter data) {
|
||||
@@ -8780,222 +8781,4 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
}
|
||||
|
||||
|
||||
//usk
|
||||
public void InsertMSL_Availability_StockFacingWelance(
|
||||
String storeId, String categoryId, List<MSL_AvailabilityStockFacingGetterSetter> hashMapListHeaderData,
|
||||
HashMap<MSL_AvailabilityStockFacingGetterSetter, List<MSL_AvailabilityStockFacingGetterSetter>> hashMapListChildData) {
|
||||
ContentValues values = new ContentValues();
|
||||
|
||||
try {
|
||||
db.beginTransaction();
|
||||
for (int i = 0; i < hashMapListHeaderData.size(); i++) {
|
||||
|
||||
for (int j = 0; j < hashMapListChildData.get(hashMapListHeaderData.get(i)).size(); j++) {
|
||||
MSL_AvailabilityStockFacingGetterSetter data = hashMapListChildData.get(hashMapListHeaderData.get(i)).get(j);
|
||||
|
||||
values.put("Store_Id", storeId);
|
||||
values.put("Category_Id", categoryId);
|
||||
values.put("Brand_Id", hashMapListHeaderData.get(i).getBrand_id());
|
||||
values.put("SKU_ID", data.getSku_id());
|
||||
values.put("SKU", data.getSku());
|
||||
values.put("SKU_SEQUENCE", data.getSku_sequence());
|
||||
values.put("MBQ", data.getMbq());
|
||||
values.put("TOGGLE_VALUE", data.getToggleValue());
|
||||
if (data.getFacing().equals("")) {
|
||||
values.put("FACING", "0");
|
||||
} else {
|
||||
values.put("FACING", data.getFacing());
|
||||
}
|
||||
values.put("STOCK", data.getStock());
|
||||
values.put("COMPANY_ID", data.getCompany_id());
|
||||
values.put("MUST_HAVE", data.getMust_have());
|
||||
|
||||
db.insert(CommonString.TABLE_INSERT_MSL_AVAILABILITY_STOCK_FACING, null, values);
|
||||
}
|
||||
}
|
||||
db.setTransactionSuccessful();
|
||||
db.endTransaction();
|
||||
} catch (Exception ex) {
|
||||
Log.d("Exception ", " in Insert MSL_Availability_StockFacing " + ex.toString());
|
||||
}
|
||||
}
|
||||
|
||||
public void updateMSL_Availability_StockFacingWelance(
|
||||
String storeId, String categoryId, List<MSL_AvailabilityStockFacingGetterSetter> hashMapListHeaderData,
|
||||
HashMap<MSL_AvailabilityStockFacingGetterSetter, List<MSL_AvailabilityStockFacingGetterSetter>> hashMapListChildData) {
|
||||
|
||||
ContentValues values = new ContentValues();
|
||||
|
||||
try {
|
||||
db.beginTransaction();
|
||||
for (int i = 0; i < hashMapListHeaderData.size(); i++) {
|
||||
|
||||
for (int j = 0; j < hashMapListChildData.get(hashMapListHeaderData.get(i)).size(); j++) {
|
||||
MSL_AvailabilityStockFacingGetterSetter data = hashMapListChildData.get(hashMapListHeaderData.get(i)).get(j);
|
||||
|
||||
values.put("TOGGLE_VALUE", data.getToggleValue());
|
||||
values.put("STOCK", data.getStock());
|
||||
|
||||
if (data.getFacing().equals("")) {
|
||||
values.put("FACING", "0");
|
||||
} else {
|
||||
values.put("FACING", data.getFacing());
|
||||
}
|
||||
|
||||
db.update(CommonString.TABLE_INSERT_MSL_AVAILABILITY_STOCK_FACING, values,
|
||||
"Brand_Id ='" + hashMapListHeaderData.get(i).getBrand_id() + "' AND SKU_ID ='" + data.getSku_id() +
|
||||
"' AND Category_Id='" + categoryId + "' AND Store_Id='" + storeId + "'", null);
|
||||
}
|
||||
}
|
||||
db.setTransactionSuccessful();
|
||||
db.endTransaction();
|
||||
} catch (Exception ex) {
|
||||
Log.d("Exception ", " in Insert MSL_Availability_StockFacing " + ex.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("LongLogTag")
|
||||
public boolean checkMsl_Availability_StockFacingDataWelance(String store_id, String category_id) {
|
||||
Log.d("MSL_Availability ", "Stock data--------------->Start<------------");
|
||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> list = new ArrayList<>();
|
||||
Cursor dbcursor = null;
|
||||
|
||||
try {
|
||||
dbcursor = db.rawQuery("Select * from Msl_Availability_Stock_Facing_Data " +
|
||||
"where category_id='" + category_id + "' and Store_Id='" + store_id + "'", null);
|
||||
|
||||
if (dbcursor != null) {
|
||||
if (dbcursor.moveToFirst()) {
|
||||
do {
|
||||
MSL_AvailabilityStockFacingGetterSetter sb = new MSL_AvailabilityStockFacingGetterSetter();
|
||||
|
||||
sb.setSku_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SKU_ID")));
|
||||
list.add(sb);
|
||||
} while (dbcursor.moveToNext());
|
||||
}
|
||||
dbcursor.close();
|
||||
|
||||
return list.size() > 0;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.d("Exception ", "when fetching Records!!!!!!!!!!!!!!!!!!!!!" + e.toString());
|
||||
return false;
|
||||
}
|
||||
|
||||
Log.d("MSL_Availability_StockFacing ", "midday---------------------->Stop<-----------");
|
||||
return false;
|
||||
}
|
||||
|
||||
public ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> getPlanogramAddShelfHeaderAfterSaveDataWelance(
|
||||
String store_id, String category_id) {
|
||||
|
||||
ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> list = new ArrayList<>();
|
||||
Cursor dbcursor = null;
|
||||
|
||||
try {
|
||||
dbcursor = db.rawQuery("Select * from Stock_Facing_Planogram_Header_Data " +
|
||||
"where Store_id='" + store_id + "' and category_id='" + category_id + "'", null);
|
||||
|
||||
if (dbcursor != null) {
|
||||
dbcursor.moveToFirst();
|
||||
while (!dbcursor.isAfterLast()) {
|
||||
StockFacing_PlanogramTrackerDataGetterSetter cd = new StockFacing_PlanogramTrackerDataGetterSetter();
|
||||
|
||||
cd.setKey_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("KEY_ID")));
|
||||
cd.setCategory_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("category_id")));
|
||||
cd.setSp_addShelf_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("Shelf_id")));
|
||||
cd.setSp_addShelf(dbcursor.getString(dbcursor.getColumnIndexOrThrow("Shelf")));
|
||||
cd.setSp_shelfPosition(dbcursor.getString(dbcursor.getColumnIndexOrThrow("Shelf_Position")));
|
||||
|
||||
list.add(cd);
|
||||
|
||||
dbcursor.moveToNext();
|
||||
}
|
||||
dbcursor.close();
|
||||
return list;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
Log.d("Exception ", "get Planogram Shelf Header After Save !" + e.toString());
|
||||
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> getStockAndFacingPlanogramAfterSKUDataWelance(
|
||||
String key_id) {
|
||||
|
||||
ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> list = new ArrayList<>();
|
||||
Cursor dbcursor = null;
|
||||
|
||||
try {
|
||||
|
||||
dbcursor = db.rawQuery("Select * from Stock_Facing_Planogram_Child_Data " +
|
||||
"where common_id='" + key_id + "'", null);
|
||||
|
||||
if (dbcursor != null) {
|
||||
|
||||
dbcursor.moveToFirst();
|
||||
while (!dbcursor.isAfterLast()) {
|
||||
StockFacing_PlanogramTrackerDataGetterSetter cd = new StockFacing_PlanogramTrackerDataGetterSetter();
|
||||
|
||||
cd.setSp_addShelf_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("Shelf_id")));
|
||||
cd.setSp_addShelf(dbcursor.getString(dbcursor.getColumnIndexOrThrow("Shelf")));
|
||||
cd.setSp_shelfPosition(dbcursor.getString(dbcursor.getColumnIndexOrThrow("Shelf_Position")));
|
||||
cd.setSku_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("sku_id")));
|
||||
cd.setSku(dbcursor.getString(dbcursor.getColumnIndexOrThrow("sku")));
|
||||
cd.setCheckbox_sku(dbcursor.getString(dbcursor.getColumnIndexOrThrow("checkbox_sku")));
|
||||
|
||||
list.add(cd);
|
||||
dbcursor.moveToNext();
|
||||
}
|
||||
dbcursor.close();
|
||||
return list;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.d("Exception ", "get MSL_AvailabilityHeader!" + e.toString());
|
||||
return list;
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
public ArrayList<MSL_AvailabilityStockFacingGetterSetter> getMSL_Availability_StockFacingSKU_AfterSaveDataWelance(
|
||||
String category_id, String brand_id, String store_id) {
|
||||
|
||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> list = new ArrayList<>();
|
||||
Cursor dbcursor = null;
|
||||
|
||||
try {
|
||||
dbcursor = db.rawQuery("Select * from Msl_Availability_Stock_Facing_Data " +
|
||||
"where category_id='" + category_id + "' and Brand_Id='" + brand_id + "' AND Store_Id='" + store_id + "'", null);
|
||||
|
||||
if (dbcursor != null) {
|
||||
dbcursor.moveToFirst();
|
||||
while (!dbcursor.isAfterLast()) {
|
||||
MSL_AvailabilityStockFacingGetterSetter cd = new MSL_AvailabilityStockFacingGetterSetter();
|
||||
|
||||
cd.setSku_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SKU_ID")));
|
||||
cd.setSku(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SKU")));
|
||||
cd.setSku_sequence(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SKU_SEQUENCE")));
|
||||
cd.setMbq(dbcursor.getString(dbcursor.getColumnIndexOrThrow("MBQ")));
|
||||
cd.setToggleValue(dbcursor.getString(dbcursor.getColumnIndexOrThrow("TOGGLE_VALUE")));
|
||||
cd.setFacing(dbcursor.getString(dbcursor.getColumnIndexOrThrow("FACING")));
|
||||
cd.setStock(dbcursor.getString(dbcursor.getColumnIndexOrThrow("STOCK")));
|
||||
cd.setCompany_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("COMPANY_ID")));
|
||||
cd.setMust_have(dbcursor.getString(dbcursor.getColumnIndexOrThrow("MUST_HAVE")));
|
||||
|
||||
list.add(cd);
|
||||
dbcursor.moveToNext();
|
||||
}
|
||||
dbcursor.close();
|
||||
return list;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.d("Exception ", "get MSL_Availability Sku After Save Data!" + e.toString());
|
||||
return list;
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1335,4 +1335,5 @@ public class CommonString {
|
||||
+ " INTEGER"
|
||||
|
||||
+ ")";
|
||||
|
||||
}
|
||||
|
||||
@@ -41,7 +41,6 @@ import cpm.com.gskmtorange.GetterSetter.CategoryPictureGetterSetter;
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.constant.CommonFunctions;
|
||||
import cpm.com.gskmtorange.gsk_dailyentry.MSL_Availability_StockFacingActivity;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryImagesAllowed;
|
||||
|
||||
public class CategoryPicture extends AppCompatActivity {
|
||||
|
||||
@@ -70,29 +70,22 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
|
||||
ExpandableListView expandableListView;
|
||||
TextView txt_mslAvailabilityName;
|
||||
|
||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> headerDataList;
|
||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> childDataList;
|
||||
List<MSL_AvailabilityStockFacingGetterSetter> hashMapListHeaderData;
|
||||
HashMap<MSL_AvailabilityStockFacingGetterSetter, List<MSL_AvailabilityStockFacingGetterSetter>> hashMapListChildData;
|
||||
|
||||
List<Integer> checkHeaderArray = new ArrayList<>();
|
||||
boolean checkflag = true;
|
||||
|
||||
ExpandableListAdapter adapter;
|
||||
ImageView camera1, camera2, camera3, camera4;
|
||||
LinearLayout lin_camera1, lin_camera2, lin_camera3, lin_camera4;
|
||||
|
||||
GSKOrangeDB db;
|
||||
|
||||
String categoryName, categoryId, storeId, Error_Message = "";
|
||||
String store_id, visit_date, username, intime, date, keyAccount_id, class_id, storeType_id, camera_allow, country_id, store_flag_str;
|
||||
boolean isDialogOpen = true;
|
||||
private SharedPreferences preferences;
|
||||
int scrollPosition = 0;
|
||||
|
||||
String str_planogram = "", _pathforcheck = "";
|
||||
|
||||
ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> planogramShelfHeaderDataList = new ArrayList<>();
|
||||
ArrayList<StockFacing_PlanogramTrackerDataGetterSetter> planogramSkuChildDataList;
|
||||
HashMap<StockFacing_PlanogramTrackerDataGetterSetter, ArrayList<StockFacing_PlanogramTrackerDataGetterSetter>> planogramHashMapListChildData = new HashMap<>();
|
||||
@@ -174,11 +167,11 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
|
||||
db.open();
|
||||
|
||||
if (db.checkMsl_Availability_StockFacingDataWelance(store_id, categoryId)) {
|
||||
db.updateMSL_Availability_StockFacingWelance(store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||
if (db.checkMsl_Availability_StockFacingData(store_id, categoryId)) {
|
||||
db.updateMSL_Availability_StockFacing(store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||
Snackbar.make(view, getResources().getString(R.string.update_message), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
} else {
|
||||
db.InsertMSL_Availability_StockFacingWelance(store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||
db.InsertMSL_Availability_StockFacing(store_id, categoryId, hashMapListHeaderData, hashMapListChildData);
|
||||
Snackbar.make(view, getResources().getString(R.string.save_message), Snackbar.LENGTH_LONG).setAction("Action", null).show();
|
||||
}
|
||||
finish();
|
||||
@@ -645,12 +638,12 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
//Planogram List for check and delete on backPress
|
||||
private void prepareDefaultList() {
|
||||
// Planogram After save shelf header data
|
||||
planogramShelfHeaderDataList = db.getPlanogramAddShelfHeaderAfterSaveDataWelance(store_id, categoryId);
|
||||
planogramShelfHeaderDataList = db.getPlanogramAddShelfHeaderAfterSaveData(store_id, categoryId);
|
||||
|
||||
if (planogramShelfHeaderDataList.size() > 0) {
|
||||
|
||||
for (int i = 0; i < planogramShelfHeaderDataList.size(); i++) {
|
||||
planogramSkuChildDataList = db.getStockAndFacingPlanogramAfterSKUDataWelance(planogramShelfHeaderDataList.get(i).getKey_id());
|
||||
planogramSkuChildDataList = db.getStockAndFacingPlanogramAfterSKUData(planogramShelfHeaderDataList.get(i).getKey_id());
|
||||
|
||||
//After save sku child data
|
||||
if (planogramSkuChildDataList.size() > 0) {
|
||||
@@ -686,7 +679,7 @@ public class NewStockDataActivity extends AppCompatActivity implements DialogCa
|
||||
hashMapListHeaderData.add(headerDataList.get(i));
|
||||
|
||||
//childDataList = new ArrayList<>();
|
||||
childDataList = db.getMSL_Availability_StockFacingSKU_AfterSaveDataWelance(categoryId, headerDataList.get(i).getBrand_id(), store_id);
|
||||
childDataList = db.getMSL_Availability_StockFacingSKU_AfterSaveData(categoryId, headerDataList.get(i).getBrand_id(), store_id);
|
||||
if (!(childDataList.size() > 0)) {
|
||||
if (country_id.equals("7")) {
|
||||
childDataList = db.getMSL_Availability_StockFacingSKUData(categoryId, headerDataList.get(i).getBrand_id(), null, null, null, store_id, CommonString.TABLE_MAPPING_STOCK_STOREWISE);
|
||||
|
||||
@@ -42,8 +42,6 @@ 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.gsk_dailyentry.MSL_Availability_StockFacingActivity;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.AuditDataGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityStockFacingGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.POGGetterSetter;
|
||||
|
||||
|
||||
@@ -46,9 +46,7 @@ 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.gsk_dailyentry.MSL_Availability_StockFacingActivity;
|
||||
import cpm.com.gskmtorange.interfaces.DialogCallbackListener;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPING_PLANOGRAM_DataGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MSL_AvailabilityStockFacingGetterSetter;
|
||||
|
||||
public class StockDataActivity extends AppCompatActivity implements DialogCallbackListener {
|
||||
|
||||
+3
-1
@@ -39,6 +39,7 @@ import cpm.com.gskmtorange.dailyentry.CategoryPicture;
|
||||
import cpm.com.gskmtorange.dailyentry.CompetitionPromoActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.CounterfeitProductsActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.CreateSelfActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.NewStockDataActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.POGQuestionsActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.StockActivity;
|
||||
import cpm.com.gskmtorange.dailyentry.StockDataActivity;
|
||||
@@ -694,7 +695,8 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
|
||||
} else if (dailyData.getCategory_name().equalsIgnoreCase(getResources().getString(R.string.daily_data_menu_stock_facing))) {
|
||||
if (isMappingStockData()) {
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, StockDataActivity.class);
|
||||
// Intent intent = new Intent(DailyDataMenuActivity.this, StockDataActivity.class);
|
||||
Intent intent = new Intent(DailyDataMenuActivity.this, NewStockDataActivity.class);
|
||||
intent.putExtra("categoryName", dailyData.getCategory_name());
|
||||
intent.putExtra("categoryId", categoryId);
|
||||
startActivity(intent);
|
||||
|
||||
Reference in New Issue
Block a user