YSY commit
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>
|
||||
@@ -21,20 +21,24 @@ android {
|
||||
targetSdkVersion 22
|
||||
|
||||
//For Egypt
|
||||
/*versionCode 20
|
||||
versionName "3.2"*/
|
||||
/*versionCode 21
|
||||
versionName "3.3"*/
|
||||
|
||||
//For UAE
|
||||
/*versionCode 18
|
||||
versionName "3.0"*/
|
||||
|
||||
//For Turkey
|
||||
/*versionCode 19
|
||||
versionName "3.1"*/
|
||||
/*versionCode 21
|
||||
versionName "3.3"*/
|
||||
|
||||
//For KSA
|
||||
versionCode 21
|
||||
versionName "3.3"
|
||||
/*versionCode 22
|
||||
versionName "3.4"*/
|
||||
|
||||
//For SA
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
|
||||
|
||||
multiDexEnabled true
|
||||
@@ -80,6 +84,7 @@ dependencies {
|
||||
implementation 'com.google.firebase:firebase-core:11.8.0'
|
||||
|
||||
testImplementation 'junit:junit:4.12'
|
||||
implementation project(':library')
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ 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;
|
||||
@@ -83,7 +84,7 @@ import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
|
||||
*/
|
||||
|
||||
public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
public static final String DATABASE_NAME = "GSK_ORANGE_DB40";
|
||||
public static final String DATABASE_NAME = "GSK_ORANGE_DB42";
|
||||
public static final int DATABASE_VERSION = 15;
|
||||
TableBean tableBean;
|
||||
private SQLiteDatabase db;
|
||||
@@ -185,6 +186,10 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
db.execSQL(TableBean.getTable_SUPERVISOR_LIST());//--Added 01.10.2018
|
||||
db.execSQL(TableBean.getTable_CONFIGURATION_MASTER());//--Added 03.10.2018
|
||||
|
||||
if(TableBean.getTable_MAPPING_STOCK_STOREWISE()!=null){
|
||||
db.execSQL(TableBean.getTable_MAPPING_STOCK_STOREWISE());//--Added 04.12.2018
|
||||
}
|
||||
|
||||
//15-03-2017
|
||||
db.execSQL(CommonString.CREATE_TABLE_INSERT_MSL_AVAILABILITY_STOCK_FACING);
|
||||
db.execSQL(CommonString.CREATE_TABLE_INSERT_NO_CAMERA_FACING_DATA);
|
||||
@@ -326,6 +331,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
values.put("VISIT_ORDER", data.getVISIT_ORDER().get(i));
|
||||
values.put("LATITUDE", data.getLATITUDE().get(i));
|
||||
values.put("LONGITUDE", data.getLONGITUDE().get(i));
|
||||
values.put("POG_TYPE_ID", data.getPOG_TYPE_ID().get(i));
|
||||
|
||||
db.insert("JOURNEY_PLAN", null, values);
|
||||
|
||||
@@ -445,15 +451,27 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
}
|
||||
|
||||
//get Brand data for T2P
|
||||
public ArrayList<BrandMasterGetterSetter> getBrandT2PData(String store_type_id, String class_id, String key_account_id, String category_id) {
|
||||
public ArrayList<BrandMasterGetterSetter> getBrandT2PData(String store_type_id, String class_id, String key_account_id, String category_id, String store_id) {
|
||||
|
||||
ArrayList<BrandMasterGetterSetter> brandList = new ArrayList<>();
|
||||
Cursor dbcursor = null;
|
||||
|
||||
try {
|
||||
|
||||
if(key_account_id!=null){
|
||||
dbcursor = db.rawQuery("SELECT * FROM(SELECT DISTINCT BR.BRAND_ID, SCM.SUB_CATEGORY||'-'||BR.BRAND AS BRAND FROM MAPPING_STOCK MS " +
|
||||
"INNER JOIN SKU_MASTER SM ON MS.SKU_ID = SM.SKU_ID INNER JOIN BRAND_MASTER BR ON SM.BRAND_ID=BR.BRAND_ID " +
|
||||
"INNER JOIN SUB_CATEGORY_MASTER SCM ON BR.SUB_CATEGORY_ID = SCM.SUB_CATEGORY_ID WHERE MS.KEYACCOUNT_ID ='" + key_account_id + "' " +
|
||||
"AND STORETYPE_ID ='" + store_type_id + "' AND CLASS_ID = '" + class_id + "' AND BR.COMPANY_ID ='1' AND SCM.CATEGORY_ID = '" + category_id + "' ORDER BY SCM.SUB_CATEGORY_SEQUENCE, BR.BRAND_SEQUENCE ) As Brand", null);
|
||||
}
|
||||
else {
|
||||
dbcursor = db.rawQuery("SELECT * FROM(SELECT DISTINCT BR.BRAND_ID, SCM.SUB_CATEGORY||'-'||BR.BRAND AS BRAND FROM MAPPING_STOCK_STOREWISE MS " +
|
||||
"INNER JOIN SKU_MASTER SM ON MS.SKU_ID = SM.SKU_ID INNER JOIN BRAND_MASTER BR ON SM.BRAND_ID=BR.BRAND_ID " +
|
||||
"INNER JOIN SUB_CATEGORY_MASTER SCM ON BR.SUB_CATEGORY_ID = SCM.SUB_CATEGORY_ID WHERE MS.STORE_ID ='" + store_id + "' " +
|
||||
" AND BR.COMPANY_ID ='1' AND SCM.CATEGORY_ID = '" + category_id + "' ORDER BY SCM.SUB_CATEGORY_SEQUENCE, BR.BRAND_SEQUENCE ) As Brand", null);
|
||||
|
||||
}
|
||||
|
||||
dbcursor = db.rawQuery("SELECT * FROM(SELECT DISTINCT BR.BRAND_ID, SCM.SUB_CATEGORY||'-'||BR.BRAND AS BRAND FROM MAPPING_STOCK MS INNER JOIN SKU_MASTER SM ON MS.SKU_ID = SM.SKU_ID INNER JOIN BRAND_MASTER BR ON SM.BRAND_ID=BR.BRAND_ID INNER JOIN SUB_CATEGORY_MASTER SCM ON BR.SUB_CATEGORY_ID = SCM.SUB_CATEGORY_ID WHERE MS.KEYACCOUNT_ID ='" + key_account_id + "' AND STORETYPE_ID ='" + store_type_id + "' AND CLASS_ID = '" + class_id + "' AND BR.COMPANY_ID ='1' AND SCM.CATEGORY_ID = '" + category_id + "' ORDER BY SCM.SUB_CATEGORY_SEQUENCE, BR.BRAND_SEQUENCE ) As Brand", null);
|
||||
if (dbcursor != null) {
|
||||
|
||||
dbcursor.moveToFirst();
|
||||
@@ -486,15 +504,26 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
}
|
||||
|
||||
//get Sku data for T2P
|
||||
public ArrayList<SkuGetterSetter> getSkuT2PData(String store_type_id, String class_id, String key_account_id, String brand_id) {
|
||||
public ArrayList<SkuGetterSetter> getSkuT2PData(String store_type_id, String class_id, String key_account_id, String brand_id, String store_id) {
|
||||
|
||||
ArrayList<SkuGetterSetter> skuList = new ArrayList<>();
|
||||
Cursor dbcursor = null;
|
||||
|
||||
try {
|
||||
|
||||
dbcursor = db.rawQuery("SELECT DISTINCT SM.SKU, SM.SKU_ID, BR.BRAND_ID FROM MAPPING_STOCK MS INNER JOIN SKU_MASTER SM ON MS.SKU_ID = SM.SKU_ID INNER JOIN BRAND_MASTER BR ON SM.BRAND_ID=BR.BRAND_ID INNER JOIN SUB_CATEGORY_MASTER SCM ON BR.SUB_CATEGORY_ID = SCM.SUB_CATEGORY_ID " +
|
||||
"WHERE MS.KEYACCOUNT_ID ='" + key_account_id + "' AND STORETYPE_ID ='" + store_type_id + "' AND CLASS_ID = '" + class_id + "' AND SM.BRAND_ID='" + brand_id + "' AND MS.SHOW_ADDITIONAL_VISIBILITY='1' ORDER BY SM.PROMO_SKU, SM.SKU", null);
|
||||
if(key_account_id!=null){
|
||||
dbcursor = db.rawQuery("SELECT DISTINCT SM.SKU, SM.SKU_ID, BR.BRAND_ID FROM MAPPING_STOCK MS INNER JOIN SKU_MASTER SM ON MS.SKU_ID = SM.SKU_ID " +
|
||||
"INNER JOIN BRAND_MASTER BR ON SM.BRAND_ID=BR.BRAND_ID INNER JOIN SUB_CATEGORY_MASTER SCM ON BR.SUB_CATEGORY_ID = SCM.SUB_CATEGORY_ID " +
|
||||
"WHERE MS.KEYACCOUNT_ID ='" + key_account_id + "' AND STORETYPE_ID ='" + store_type_id + "' AND CLASS_ID = '" + class_id + "' AND SM.BRAND_ID='" + brand_id + "' " +
|
||||
"AND MS.SHOW_ADDITIONAL_VISIBILITY='1' ORDER BY SM.PROMO_SKU, SM.SKU", null);
|
||||
}
|
||||
else {
|
||||
dbcursor = db.rawQuery("SELECT DISTINCT SM.SKU, SM.SKU_ID, BR.BRAND_ID FROM MAPPING_STOCK_STOREWISE MS INNER JOIN SKU_MASTER SM ON MS.SKU_ID = SM.SKU_ID " +
|
||||
"INNER JOIN BRAND_MASTER BR ON SM.BRAND_ID=BR.BRAND_ID INNER JOIN SUB_CATEGORY_MASTER SCM ON BR.SUB_CATEGORY_ID = SCM.SUB_CATEGORY_ID " +
|
||||
"WHERE MS.STORE_ID ='" + store_id + "' AND SM.BRAND_ID='" + brand_id + "' " +
|
||||
"AND MS.SHOW_ADDITIONAL_VISIBILITY='1' ORDER BY SM.PROMO_SKU, SM.SKU", null);
|
||||
}
|
||||
|
||||
if (dbcursor != null) {
|
||||
|
||||
dbcursor.moveToFirst();
|
||||
@@ -592,6 +621,8 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
|
||||
sb.setLONGITUDE(dbcursor.getString(dbcursor
|
||||
.getColumnIndexOrThrow("LONGITUDE")));
|
||||
sb.setPOG_TYPE_ID(dbcursor.getString(dbcursor
|
||||
.getColumnIndexOrThrow("POG_TYPE_ID")));
|
||||
|
||||
list.add(sb);
|
||||
dbcursor.moveToNext();
|
||||
@@ -624,7 +655,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
db.insert("MAPPING_DISPLAY_CHECKLIST", null, values);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Log.d("Exception ", " in MAPPING_STOCK " + ex.toString());
|
||||
Log.d("Exception ", " in MAPPING_DISPLAY_CHECKLIST " + ex.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -917,7 +948,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
db.insert("SUB_CATEGORY_MASTER", null, values);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Log.d("Exception ", " in MAPPING_STOCK " + ex.toString());
|
||||
Log.d("Exception ", " in MAPPING_DISPLAY_CHECKLIST " + ex.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1005,11 +1036,13 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
|
||||
|
||||
//Category List
|
||||
public ArrayList<CategoryGetterSetter> getCategoryListData(String keyAccountId, String storeTypeId, String classId) {
|
||||
public ArrayList<CategoryGetterSetter> getCategoryListData(String keyAccountId, String storeTypeId, String classId, String store_id) {
|
||||
ArrayList<CategoryGetterSetter> list = new ArrayList<>();
|
||||
Cursor dbcursor = null;
|
||||
|
||||
try {
|
||||
|
||||
if(keyAccountId!=null){
|
||||
dbcursor = db.rawQuery("Select DISTINCT CA.CATEGORY_ID,CA.CATEGORY " +
|
||||
"from MAPPING_STOCK M " +
|
||||
"inner join SKU_MASTER SK " +
|
||||
@@ -1023,6 +1056,20 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
"where M.KEYACCOUNT_ID='" + keyAccountId + "' AND " +
|
||||
"M.STORETYPE_ID='" + storeTypeId + "' AND " +
|
||||
"M.CLASS_ID='" + classId + "'", null);
|
||||
}
|
||||
else {
|
||||
dbcursor = db.rawQuery("Select DISTINCT CA.CATEGORY_ID,CA.CATEGORY " +
|
||||
"from MAPPING_STOCK_STOREWISE M " +
|
||||
"inner join SKU_MASTER SK " +
|
||||
"on M.SKU_ID=SK.SKU_ID " +
|
||||
"inner join BRAND_MASTER BR " +
|
||||
"on SK.BRAND_ID=BR.BRAND_ID " +
|
||||
"inner join SUB_CATEGORY_MASTER SB " +
|
||||
"on BR.SUB_CATEGORY_ID=SB.SUB_CATEGORY_ID " +
|
||||
"inner join CATEGORY_MASTER CA " +
|
||||
"on SB.CATEGORY_ID=CA.CATEGORY_ID " +
|
||||
"where M.STORE_ID='" + store_id + "'", null);
|
||||
}
|
||||
|
||||
if (dbcursor != null) {
|
||||
dbcursor.moveToFirst();
|
||||
@@ -3635,12 +3682,13 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
return filled;
|
||||
}
|
||||
|
||||
public boolean isMappingStockDataStockFacing(String category_id, String keyAccount_id, String storeType_id, String class_id) {
|
||||
public boolean isMappingStockDataStockFacing(String category_id, String keyAccount_id, String storeType_id, String class_id, String store_id) {
|
||||
boolean filled = false;
|
||||
Cursor dbcursor = null;
|
||||
|
||||
try {
|
||||
//dbcursor = db.rawQuery("SELECT * FROM MAPPING_STOCK ", null);
|
||||
|
||||
if(keyAccount_id!=null){
|
||||
dbcursor = db.rawQuery("Select M.* from MAPPING_STOCK M " +
|
||||
"inner join SKU_MASTER SK " +
|
||||
"on M.SKU_ID=SK.SKU_ID " +
|
||||
@@ -3653,6 +3701,23 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
"where CA.CATEGORY_ID='" + category_id + "' AND M.KEYACCOUNT_ID = '" + keyAccount_id + "' " +
|
||||
"AND M.STORETYPE_ID = '" + storeType_id + "' AND M.CLASS_ID = '" + class_id + "' " +
|
||||
"order by SB.SUB_CATEGORY,BR.BRAND ", null);
|
||||
}
|
||||
else {
|
||||
dbcursor = db.rawQuery("Select M.* from MAPPING_STOCK_STOREWISE M " +
|
||||
"inner join SKU_MASTER SK " +
|
||||
"on M.SKU_ID=SK.SKU_ID " +
|
||||
"inner join BRAND_MASTER BR " +
|
||||
"on SK.BRAND_ID=BR.BRAND_ID " +
|
||||
"inner join SUB_CATEGORY_MASTER SB " +
|
||||
"on BR.SUB_CATEGORY_ID=SB.SUB_CATEGORY_ID " +
|
||||
"inner join CATEGORY_MASTER CA " +
|
||||
"on SB.CATEGORY_ID=CA.CATEGORY_ID " +
|
||||
"where CA.CATEGORY_ID='" + category_id + "' AND M.STORE_ID = '" + store_id + "' "+
|
||||
"order by SB.SUB_CATEGORY,BR.BRAND ", null);
|
||||
}
|
||||
|
||||
//dbcursor = db.rawQuery("SELECT * FROM MAPPING_STOCK ", null);
|
||||
|
||||
|
||||
if (dbcursor != null) {
|
||||
dbcursor.moveToFirst();
|
||||
@@ -3792,6 +3857,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
|
||||
try {
|
||||
|
||||
if(keyAccount_id!=null){
|
||||
cursordata = db.rawQuery("SELECT DISTINCT BR.BRAND_ID, BR.BRAND FROM SKU_MASTER SK INNER JOIN BRAND_MASTER BR ON SK.BRAND_ID = BR.BRAND_ID " +
|
||||
"INNER JOIN SUB_CATEGORY_MASTER SB ON BR.SUB_CATEGORY_ID = SB.SUB_CATEGORY_ID " +
|
||||
"INNER JOIN CATEGORY_MASTER CA ON SB.CATEGORY_ID = CA.CATEGORY_ID " +
|
||||
@@ -3799,6 +3865,17 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
"(SELECT DISTINCT SKU_ID FROM MAPPING_STOCK WHERE KEYACCOUNT_ID = '" + keyAccount_id + "' AND STORETYPE_ID = '" + storeType_id + "' AND CLASS_ID = '" + class_id + "') A " +
|
||||
"ON SK.SKU_ID = A.SKU_ID " +
|
||||
"WHERE CA.CATEGORY_ID = '" + category_id + "'", null);
|
||||
}
|
||||
else {
|
||||
cursordata = db.rawQuery("SELECT DISTINCT BR.BRAND_ID, BR.BRAND FROM SKU_MASTER SK INNER JOIN BRAND_MASTER BR ON SK.BRAND_ID = BR.BRAND_ID " +
|
||||
"INNER JOIN SUB_CATEGORY_MASTER SB ON BR.SUB_CATEGORY_ID = SB.SUB_CATEGORY_ID " +
|
||||
"INNER JOIN CATEGORY_MASTER CA ON SB.CATEGORY_ID = CA.CATEGORY_ID " +
|
||||
"INNER JOIN " +
|
||||
"(SELECT DISTINCT SKU_ID FROM MAPPING_STOCK_STOREWISE WHERE STORE_ID = '" + store_id + "') A " +
|
||||
"ON SK.SKU_ID = A.SKU_ID " +
|
||||
"WHERE CA.CATEGORY_ID = '" + category_id + "'", null);
|
||||
}
|
||||
|
||||
|
||||
if (cursordata != null) {
|
||||
cursordata.moveToFirst();
|
||||
@@ -4338,12 +4415,13 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
|
||||
|
||||
// get CATEGORY PICTURE data
|
||||
public ArrayList<CategoryPictureGetterSetter> getCategoryPicturedata(String categoryId, String key_account_id, String store_type_id, String class_id) {
|
||||
public ArrayList<CategoryPictureGetterSetter> getCategoryPicturedata(String categoryId, String key_account_id, String store_type_id, String class_id, String store_id) {
|
||||
|
||||
ArrayList<CategoryPictureGetterSetter> list = new ArrayList<>();
|
||||
Cursor dbcursor = null;
|
||||
try {
|
||||
|
||||
if(key_account_id!=null){
|
||||
dbcursor = db.rawQuery("SELECT DISTINCT SB.SUB_CATEGORY_ID, MIA.IMAGE_ALLOW,SB.SUB_CATEGORY FROM MAPPING_STOCK M INNER JOIN SKU_MASTER SK ON M.SKU_ID = SK.SKU_ID" +
|
||||
" INNER JOIN BRAND_MASTER BR ON SK.BRAND_ID = BR.BRAND_ID" +
|
||||
" INNER JOIN SUB_CATEGORY_MASTER SB ON BR.SUB_CATEGORY_ID = SB.SUB_CATEGORY_ID" +
|
||||
@@ -4352,6 +4430,18 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
" WHERE M.KEYACCOUNT_ID = '" + key_account_id + " ' AND M.STORETYPE_ID = '" + store_type_id + "' AND M.CLASS_ID = '" + class_id + "' AND CA.CATEGORY_ID = '" + categoryId + "'", null);
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
dbcursor = db.rawQuery("SELECT DISTINCT SB.SUB_CATEGORY_ID, MIA.IMAGE_ALLOW,SB.SUB_CATEGORY FROM MAPPING_STOCK_STOREWISE M INNER JOIN SKU_MASTER SK ON M.SKU_ID = SK.SKU_ID" +
|
||||
" INNER JOIN BRAND_MASTER BR ON SK.BRAND_ID = BR.BRAND_ID" +
|
||||
" INNER JOIN SUB_CATEGORY_MASTER SB ON BR.SUB_CATEGORY_ID = SB.SUB_CATEGORY_ID" +
|
||||
" INNER JOIN CATEGORY_MASTER CA ON SB.CATEGORY_ID = CA.CATEGORY_ID" +
|
||||
" INNER JOIN MAPPING_SUB_CATEGORY_IMAGE_ALLOW MIA ON SB.SUB_CATEGORY_ID=MIA.SUB_CATEGORY_ID " +
|
||||
" WHERE M.STORE_ID = '" + store_id + "' AND CA.CATEGORY_ID = '" + categoryId + "'", null);
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (dbcursor != null) {
|
||||
dbcursor.moveToFirst();
|
||||
while (!dbcursor.isAfterLast()) {
|
||||
@@ -4936,13 +5026,14 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
//14-03-2017
|
||||
//MSL_Availability_StockFacing
|
||||
public ArrayList<MSL_AvailabilityStockFacingGetterSetter> getMSL_Availability_StockFacingHeaderData(
|
||||
String category_id, String keyAccount_id, String storeType_id, String class_id) {
|
||||
String category_id, String keyAccount_id, String storeType_id, String class_id, String store_id) {
|
||||
|
||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> list = new ArrayList<>();
|
||||
Cursor dbcursor = null;
|
||||
|
||||
try {
|
||||
|
||||
if(keyAccount_id!=null){
|
||||
dbcursor = db.rawQuery("Select DISTINCT SB.SUB_CATEGORY_ID,SB.SUB_CATEGORY,BR.BRAND_ID,BR.BRAND,BR.COMPANY_ID ," +
|
||||
" (SELECT SUM(SOS_TARGET) FROM MAPPING_SOS_TARGET WHERE STORE_ID = 1 AND BRAND_ID = BR.BRAND_ID)AS SOS_TARGET " +
|
||||
"from MAPPING_STOCK M " +
|
||||
@@ -4957,6 +5048,26 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
"where CA.CATEGORY_ID='" + category_id + "' AND M.KEYACCOUNT_ID = '" + keyAccount_id +
|
||||
"' AND M.STORETYPE_ID = '" + storeType_id + "' AND M.CLASS_ID = '" + class_id + "'" +
|
||||
"order by SB.SUB_CATEGORY,BR.COMPANY_ID,BR.BRAND", null);
|
||||
}
|
||||
else {
|
||||
dbcursor = db.rawQuery("Select DISTINCT SB.SUB_CATEGORY_ID,SB.SUB_CATEGORY,BR.BRAND_ID,BR.BRAND,BR.COMPANY_ID ," +
|
||||
" (SELECT SUM(SOS_TARGET) FROM MAPPING_SOS_TARGET WHERE STORE_ID = 1 AND BRAND_ID = BR.BRAND_ID)AS SOS_TARGET " +
|
||||
"from MAPPING_STOCK_STOREWISE M " +
|
||||
"inner join SKU_MASTER SK " +
|
||||
"on M.SKU_ID=SK.SKU_ID " +
|
||||
"inner join BRAND_MASTER BR " +
|
||||
"on SK.BRAND_ID=BR.BRAND_ID " +
|
||||
"inner join SUB_CATEGORY_MASTER SB " +
|
||||
"on BR.SUB_CATEGORY_ID=SB.SUB_CATEGORY_ID " +
|
||||
"inner join CATEGORY_MASTER CA " +
|
||||
"on SB.CATEGORY_ID=CA.CATEGORY_ID " +
|
||||
"where CA.CATEGORY_ID='" + category_id + "' AND M.STORE_ID = '" + store_id + "'" +
|
||||
" order by SB.SUB_CATEGORY,BR.COMPANY_ID,BR.BRAND", null);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*dbcursor = db.rawQuery("Select DISTINCT SB.SUB_CATEGORY_ID,SB.SUB_CATEGORY,BR.BRAND_ID,BR.BRAND " +
|
||||
"from MAPPING_STOCK M " +
|
||||
@@ -4999,12 +5110,14 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
}
|
||||
|
||||
public ArrayList<MSL_AvailabilityStockFacingGetterSetter> getMSL_Availability_StockFacingSKUData(
|
||||
String category_id, String brand_id, String keyAccount_id, String storeType_id, String class_id) {
|
||||
String category_id, String brand_id, String keyAccount_id, String storeType_id, String class_id, String store_id) {
|
||||
|
||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> list = new ArrayList<>();
|
||||
Cursor dbcursor = null;
|
||||
|
||||
try {
|
||||
|
||||
if(keyAccount_id!=null){
|
||||
dbcursor = db.rawQuery("Select DISTINCT SK.SKU_ID,SK.SKU,SK.MRP,SK.SKU_SEQUENCE,M.MBQ,BR.COMPANY_ID,M.MUST_HAVE " +
|
||||
"from MAPPING_STOCK M " +
|
||||
"inner join SKU_MASTER SK " +
|
||||
@@ -5018,6 +5131,22 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
"where CA.CATEGORY_ID='" + category_id + "' AND BR.BRAND_ID='" + brand_id +
|
||||
"' AND M.KEYACCOUNT_ID = '" + keyAccount_id + "' AND M.STORETYPE_ID = '" + storeType_id +
|
||||
"' AND M.CLASS_ID = '" + class_id + "' order by M.MUST_HAVE DESC", null);
|
||||
}
|
||||
else {
|
||||
dbcursor = db.rawQuery("Select DISTINCT SK.SKU_ID,SK.SKU,SK.MRP,SK.SKU_SEQUENCE,M.MBQ,BR.COMPANY_ID,M.MUST_HAVE " +
|
||||
"from MAPPING_STOCK_STOREWISE M " +
|
||||
"inner join SKU_MASTER SK " +
|
||||
"on M.SKU_ID=SK.SKU_ID " +
|
||||
"inner join BRAND_MASTER BR " +
|
||||
"on SK.BRAND_ID=BR.BRAND_ID " +
|
||||
"inner join SUB_CATEGORY_MASTER SB " +
|
||||
"on BR.SUB_CATEGORY_ID=SB.SUB_CATEGORY_ID " +
|
||||
"inner join CATEGORY_MASTER CA " +
|
||||
"on SB.CATEGORY_ID=CA.CATEGORY_ID " +
|
||||
"where CA.CATEGORY_ID='" + category_id + "' AND BR.BRAND_ID='" + brand_id +
|
||||
"' AND M.STORE_ID = '" + store_id + "' order by M.MUST_HAVE DESC", null);
|
||||
}
|
||||
|
||||
|
||||
/*dbcursor = db.rawQuery("Select DISTINCT SK.SKU_ID,SK.SKU,SK.MRP,SK.SKU_SEQUENCE,M.MBQ " +
|
||||
"from MAPPING_STOCK M " +
|
||||
@@ -5582,13 +5711,14 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
|
||||
//Stock N Facing
|
||||
public ArrayList<MSL_AvailabilityStockFacingGetterSetter> getStockFacingHeaderData(
|
||||
String category_id, String keyAccount_id, String storeType_id, String class_id) {
|
||||
String category_id, String keyAccount_id, String storeType_id, String class_id, String store_id) {
|
||||
|
||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> list = new ArrayList<>();
|
||||
Cursor dbcursor = null;
|
||||
|
||||
try {
|
||||
|
||||
if(keyAccount_id!=null){
|
||||
dbcursor = db.rawQuery("Select DISTINCT SB.SUB_CATEGORY_ID,SB.SUB_CATEGORY,BR.BRAND_ID,BR.BRAND,BR.COMPANY_ID ," +
|
||||
" (SELECT SUM(SOS_TARGET) FROM MAPPING_SOS_TARGET WHERE STORE_ID = 1 AND BRAND_ID = BR.BRAND_ID)AS SOS_TARGET " +
|
||||
"from MAPPING_STOCK M " +
|
||||
@@ -5603,7 +5733,23 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
"where CA.CATEGORY_ID='" + category_id + "' AND M.KEYACCOUNT_ID = '" + keyAccount_id +
|
||||
"' AND M.STORETYPE_ID = '" + storeType_id + "' AND M.CLASS_ID = '" + class_id + "' AND BR.COMPANY_ID='" + 1 + "' " +
|
||||
"order by SB.SUB_CATEGORY,BR.COMPANY_ID,BR.BRAND", null);
|
||||
|
||||
}
|
||||
else {
|
||||
dbcursor = db.rawQuery("Select DISTINCT SB.SUB_CATEGORY_ID,SB.SUB_CATEGORY,BR.BRAND_ID,BR.BRAND,BR.COMPANY_ID ," +
|
||||
" (SELECT SUM(SOS_TARGET) FROM MAPPING_SOS_TARGET WHERE STORE_ID = 1 AND BRAND_ID = BR.BRAND_ID)AS SOS_TARGET " +
|
||||
"from MAPPING_STOCK_STOREWISE M " +
|
||||
"inner join SKU_MASTER SK " +
|
||||
"on M.SKU_ID=SK.SKU_ID " +
|
||||
"inner join BRAND_MASTER BR " +
|
||||
"on SK.BRAND_ID=BR.BRAND_ID " +
|
||||
"inner join SUB_CATEGORY_MASTER SB " +
|
||||
"on BR.SUB_CATEGORY_ID=SB.SUB_CATEGORY_ID " +
|
||||
"inner join CATEGORY_MASTER CA " +
|
||||
"on SB.CATEGORY_ID=CA.CATEGORY_ID " +
|
||||
"where CA.CATEGORY_ID='" + category_id + "' AND M.STORE_ID = '" + store_id +
|
||||
"' AND BR.COMPANY_ID='" + 1 + "' " +
|
||||
"order by SB.SUB_CATEGORY,BR.COMPANY_ID,BR.BRAND", null);
|
||||
}
|
||||
|
||||
if (dbcursor != null) {
|
||||
dbcursor.moveToFirst();
|
||||
@@ -5616,7 +5762,6 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
cd.setBrand(dbcursor.getString(dbcursor.getColumnIndexOrThrow("BRAND")));
|
||||
cd.setCompany_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("COMPANY_ID")));
|
||||
|
||||
|
||||
list.add(cd);
|
||||
dbcursor.moveToNext();
|
||||
}
|
||||
@@ -5842,7 +5987,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
|
||||
//POG_QUESTION
|
||||
public void InsertPOGQUESTION(POGQuestionGetterSetter data) {
|
||||
db.delete("POG_QUESTION", null, null);
|
||||
db.delete("POG_QUESTION_NEW", null, null);
|
||||
|
||||
ContentValues values = new ContentValues();
|
||||
try {
|
||||
@@ -5857,8 +6002,10 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
values.put("ANSWER", data.getANSWER().get(i));
|
||||
values.put("QTYPE", data.getQTYPE().get(i));
|
||||
values.put("KPI", data.getKPI().get(i));
|
||||
values.put("POG_TYPE_ID", data.getPOG_TYPE_ID().get(i));
|
||||
values.put("STORETYPE_ID", data.getSTORETYPE_ID().get(i));
|
||||
|
||||
db.insert("POG_QUESTION", null, values);
|
||||
db.insert("POG_QUESTION_NEW", null, values);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Log.d("Exception ", " in POG_QUESTION " + ex.toString());
|
||||
@@ -5866,13 +6013,13 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
}
|
||||
|
||||
//Sub Category wise POG
|
||||
public ArrayList<POGGetterSetter> getPOGSubCategoryWise(String sub_category_id) {
|
||||
public ArrayList<POGGetterSetter> getPOGSubCategoryWise(String sub_category_id, String pog_type_id, String store_type_id) {
|
||||
Cursor cursordata = null;
|
||||
ArrayList<POGGetterSetter> pogData = new ArrayList<>();
|
||||
|
||||
try {
|
||||
|
||||
cursordata = db.rawQuery("Select DISTINCT QUESTION ,QUESTION_ID from POG_QUESTION " + "where SUB_CATEGORY_ID ='" + sub_category_id + "'", null);
|
||||
cursordata = db.rawQuery("Select DISTINCT QUESTION , QUESTION_ID, QTYPE from POG_QUESTION_NEW " + "where SUB_CATEGORY_ID ='" + sub_category_id + "'AND POG_TYPE_ID='" + pog_type_id +"' AND STORETYPE_ID='"+ store_type_id +"'", null);
|
||||
|
||||
if (cursordata != null) {
|
||||
cursordata.moveToFirst();
|
||||
@@ -5883,6 +6030,8 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
.getColumnIndexOrThrow("QUESTION")));
|
||||
sb.setQUESTION_ID(cursordata.getString(cursordata
|
||||
.getColumnIndexOrThrow("QUESTION_ID")));
|
||||
sb.setQTYPE(cursordata.getString(cursordata
|
||||
.getColumnIndexOrThrow("QTYPE")));
|
||||
|
||||
pogData.add(sb);
|
||||
cursordata.moveToNext();
|
||||
@@ -5910,7 +6059,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
Cursor dbcursor = null;
|
||||
|
||||
try {
|
||||
dbcursor = db.rawQuery("Select DISTINCT ANSWER_ID,ANSWER from POG_QUESTION " +
|
||||
dbcursor = db.rawQuery("Select DISTINCT ANSWER_ID,ANSWER from POG_QUESTION_NEW " +
|
||||
"where QUESTION_ID='" + question_id + "' AND SUB_CATEGORY_ID ='" + sub_category_id + "'", null);
|
||||
|
||||
if (dbcursor != null) {
|
||||
@@ -5955,6 +6104,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
values.put("QUESTION", data.getQUESTION());
|
||||
values.put("ANSWER_ID", data.getANSWER_ID());
|
||||
values.put("SUB_CATEGORY_ID", headerDataList.get(l).getSub_category_id());
|
||||
values.put("QTYPE", data.getQTYPE());
|
||||
values.put("CATEGORY_ID", category_cd);
|
||||
|
||||
db.insert(CommonString.TABLE_POG_DATA_SAVE, null, values);
|
||||
@@ -5967,14 +6117,16 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
}
|
||||
|
||||
public ArrayList<MSL_AvailabilityStockFacingGetterSetter> getSubCategoryMasterForPOG(
|
||||
String category_id) {
|
||||
String category_id, String store_type_id, String pog_type_id) {
|
||||
|
||||
ArrayList<MSL_AvailabilityStockFacingGetterSetter> list = new ArrayList<>();
|
||||
Cursor dbcursor = null;
|
||||
|
||||
try {
|
||||
|
||||
dbcursor = db.rawQuery("SELECT DISTINCT SM.SUB_CATEGORY_ID,SM.SUB_CATEGORY FROM SUB_CATEGORY_MASTER SM INNER JOIN POG_QUESTION PG ON SM.SUB_CATEGORY_ID = PG.SUB_CATEGORY_ID WHERE CATEGORY_ID = '" + category_id + "'", null);
|
||||
//dbcursor = db.rawQuery("SELECT DISTINCT SM.SUB_CATEGORY_ID,SM.SUB_CATEGORY FROM SUB_CATEGORY_MASTER SM INNER JOIN POG_QUESTION PG ON SM.SUB_CATEGORY_ID = PG.SUB_CATEGORY_ID WHERE CATEGORY_ID = '" + category_id + "'", null);
|
||||
dbcursor = db.rawQuery("SELECT DISTINCT SM.SUB_CATEGORY_ID,SM.SUB_CATEGORY FROM SUB_CATEGORY_MASTER SM INNER JOIN POG_QUESTION_NEW PG ON SM.SUB_CATEGORY_ID = PG.SUB_CATEGORY_ID " +
|
||||
"WHERE CATEGORY_ID = '" + category_id + "' AND POG_TYPE_ID='" + pog_type_id +"' AND STORETYPE_ID='"+ store_type_id +"'", null);
|
||||
|
||||
if (dbcursor != null) {
|
||||
dbcursor.moveToFirst();
|
||||
@@ -6013,6 +6165,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
sb.setQUESTION_ID(dbcursor.getString(dbcursor.getColumnIndexOrThrow("QUESTION_ID")));
|
||||
sb.setQUESTION(dbcursor.getString(dbcursor.getColumnIndexOrThrow("QUESTION")));
|
||||
sb.setANSWER_ID(dbcursor.getString(dbcursor.getColumnIndexOrThrow("ANSWER_ID")));
|
||||
sb.setQTYPE(dbcursor.getString(dbcursor.getColumnIndexOrThrow("QTYPE")));
|
||||
|
||||
list.add(sb);
|
||||
dbcursor.moveToNext();
|
||||
@@ -6595,7 +6748,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
}
|
||||
|
||||
public void insertCoachingVisitData(CoachingVisitGetterSetter data, String store_id) {
|
||||
db.delete("COACHING_VISIT", "STORE_ID" + "='" + store_id + "'", null);
|
||||
db.delete("COACHING_VISIT", "STORE_ID" + "='" + store_id + "' AND EMP_ID ='" + data.getEmp_id() +"'", null);
|
||||
ContentValues values = new ContentValues();
|
||||
|
||||
try {
|
||||
@@ -6621,9 +6774,10 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
}
|
||||
|
||||
// get coaching visit data
|
||||
public CoachingVisitGetterSetter getCoachingVisitData(String store_id) {
|
||||
public ArrayList<CoachingVisitGetterSetter> getCoachingVisitData(String store_id) {
|
||||
|
||||
ArrayList<CoachingVisitGetterSetter> coachingVisitList = new ArrayList<>();
|
||||
|
||||
CoachingVisitGetterSetter sb = new CoachingVisitGetterSetter();
|
||||
Cursor dbcursor = null;
|
||||
try {
|
||||
dbcursor = db.rawQuery("SELECT * FROM COACHING_VISIT where STORE_ID" + "='" + store_id + "'", null);
|
||||
@@ -6632,22 +6786,26 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
dbcursor.moveToFirst();
|
||||
while (!dbcursor.isAfterLast()) {
|
||||
|
||||
CoachingVisitGetterSetter sb = new CoachingVisitGetterSetter();
|
||||
|
||||
sb.setEmp_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_EMP_ID)));
|
||||
|
||||
sb.setImg_path(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_IMAGE)));
|
||||
sb.setExists(dbcursor.getInt(dbcursor.getColumnIndexOrThrow(CommonString.KEY_EXIST))==1);
|
||||
|
||||
coachingVisitList.add(sb);
|
||||
|
||||
dbcursor.moveToNext();
|
||||
}
|
||||
dbcursor.close();
|
||||
return sb;
|
||||
return coachingVisitList;
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
return sb;
|
||||
return coachingVisitList;
|
||||
}
|
||||
return sb;
|
||||
return coachingVisitList;
|
||||
}
|
||||
|
||||
//CONFIGURATION_MASTER
|
||||
@@ -6799,4 +6957,25 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
||||
|
||||
}
|
||||
|
||||
public void InsertMappingStockSTOREWISE(MappingStockStorewiseGetterSetter data) {
|
||||
|
||||
try {
|
||||
db.delete("MAPPING_STOCK_STOREWISE", null, null);
|
||||
|
||||
ContentValues values = new ContentValues();
|
||||
|
||||
for (int i = 0; i < data.getSTORE_ID().size(); i++) {
|
||||
|
||||
values.put("STORE_ID", data.getSTORE_ID().get(i));
|
||||
values.put("SKU_ID", data.getSKU_ID().get(i));
|
||||
values.put("MUST_HAVE", data.getMUST_HAVE().get(i));
|
||||
values.put("MBQ", data.getMBQ().get(i));
|
||||
values.put("SHOW_ADDITIONAL_VISIBILITY", data.getSHOW_ADDITIONAL_VISIBILITY().get(i));
|
||||
|
||||
db.insert("MAPPING_STOCK_STOREWISE", null, values);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Log.d("Exception ", " in MAPPING_STOCK_STOREWISE " + ex.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,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";
|
||||
|
||||
@@ -236,7 +237,7 @@ public class CommonString {
|
||||
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+ " VARCHAR,"
|
||||
+ KEY_STORE_NAME+ " NVARCHAR,"
|
||||
+ KEY_ADDRESS + " VARCHAR,"
|
||||
+ KEY_IMAGE + " VARCHAR,"
|
||||
+ KEY_IMAGE1 + " VARCHAR,"
|
||||
@@ -956,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);
|
||||
|
||||
@@ -43,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 {
|
||||
|
||||
@@ -58,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;
|
||||
@@ -108,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()) {
|
||||
@@ -122,7 +127,7 @@ public class AuditActivity extends AppCompatActivity {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
hashMapAnsListChildData = new HashMap<>();
|
||||
@@ -151,7 +156,6 @@ public class AuditActivity extends AppCompatActivity {
|
||||
}
|
||||
|
||||
|
||||
|
||||
fab.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
@@ -181,8 +185,7 @@ public class AuditActivity extends AppCompatActivity {
|
||||
questionAdapter.notifyDataSetChanged();
|
||||
Snackbar.make(recyclerView, error_msg, Snackbar.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Snackbar.make(recyclerView, getString(R.string.NodataAvailable), Snackbar.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
@@ -190,6 +193,56 @@ public class AuditActivity extends AppCompatActivity {
|
||||
});
|
||||
}
|
||||
|
||||
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();
|
||||
@@ -206,14 +259,15 @@ 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() {
|
||||
@@ -224,6 +278,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);
|
||||
@@ -233,6 +291,7 @@ public class AuditActivity extends AppCompatActivity {
|
||||
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)
|
||||
@@ -251,6 +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);
|
||||
}
|
||||
}
|
||||
|
||||
class AnswerAdapter extends RecyclerView.Adapter<AnswerAdapter.ViewHolder> {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
+86
-35
@@ -24,10 +24,14 @@ 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;
|
||||
@@ -42,21 +46,24 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
||||
|
||||
private GSKOrangeDB database;
|
||||
ArrayList<SupervisorListGetterSetter> supervisorList;
|
||||
private Spinner exist_spinner, supervisor_spinner;
|
||||
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;
|
||||
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;
|
||||
CoachingVisitGetterSetter coachingVisitdata;
|
||||
ArrayList<CoachingVisitGetterSetter> coachingVisitdata;
|
||||
boolean coaching_visit_camera_flag = false;
|
||||
MultiSpinnerSearch multi_spinner_supervisor;
|
||||
|
||||
ArrayList<String> selectedSupervisorList = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -67,9 +74,11 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
||||
|
||||
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);
|
||||
//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);
|
||||
|
||||
@@ -81,9 +90,12 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
||||
|
||||
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);
|
||||
//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);
|
||||
@@ -94,7 +106,6 @@ 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) {
|
||||
@@ -110,8 +121,7 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
||||
|
||||
if (coaching_visit_camera_flag) {
|
||||
img_cam.setVisibility(View.VISIBLE);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
img_cam.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
@@ -134,22 +144,18 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
||||
|
||||
exist_spinner.setOnItemSelectedListener(this);
|
||||
|
||||
if(coachingVisitdata!=null && coachingVisitdata.getEmp_id()!=null){
|
||||
if (coachingVisitdata.size() != 0) {
|
||||
update_flag = true;
|
||||
fab_save.setVisibility(View.GONE);
|
||||
fab_next.setVisibility(View.VISIBLE);
|
||||
if(coachingVisitdata.isExists()){
|
||||
if (coachingVisitdata.get(0).isExists()) {
|
||||
exist_spinner.setSelection(1);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
exist_spinner.setSelection(2);
|
||||
}
|
||||
|
||||
exist_spinner.setEnabled(false);
|
||||
|
||||
}
|
||||
|
||||
|
||||
fab_next.setOnClickListener(this);
|
||||
fab_save.setOnClickListener(this);
|
||||
img_cam.setOnClickListener(this);
|
||||
@@ -173,7 +179,7 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
||||
|
||||
coaching_visit = 1;
|
||||
|
||||
supervisor_adapter = new ArrayAdapter<CharSequence>(this,
|
||||
/*supervisor_adapter = new ArrayAdapter<CharSequence>(this,
|
||||
android.R.layout.simple_spinner_item);
|
||||
|
||||
String select_str = getResources().getString(R.string.select_promo);
|
||||
@@ -189,18 +195,48 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
||||
supervisor_adapter
|
||||
.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
|
||||
supervisor_spinner.setOnItemSelectedListener(this);
|
||||
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);
|
||||
}
|
||||
else {
|
||||
|
||||
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 {
|
||||
} else {
|
||||
|
||||
coaching_visit = -1;
|
||||
linear_supervisor.setVisibility(View.GONE);
|
||||
@@ -209,14 +245,14 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
||||
|
||||
break;
|
||||
|
||||
case R.id.spinner_supervisor:
|
||||
case R.id.multi_spinner_supervisor:
|
||||
|
||||
if(position!=0){
|
||||
/* if(position!=0){
|
||||
emp_id = supervisorList.get(position-1).getEMP_ID().get(0);
|
||||
}
|
||||
else {
|
||||
emp_id = "";
|
||||
}
|
||||
}*/
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -245,34 +281,35 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
||||
|
||||
String error_msg = "";
|
||||
boolean flag = true;
|
||||
if(emp_id.equals("")){
|
||||
//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("")){
|
||||
} 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(emp_id);
|
||||
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 {
|
||||
} else {
|
||||
Snackbar.make(linear_supervisor, error_msg, Snackbar.LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
CoachingVisitGetterSetter coachingVisitGetterSetter = new CoachingVisitGetterSetter();
|
||||
coachingVisitGetterSetter.setEmp_id("0");
|
||||
coachingVisitGetterSetter.setImg_path(image_name);
|
||||
@@ -292,18 +329,32 @@ public class CoachingVisitActivity extends AppCompatActivity implements AdapterV
|
||||
|
||||
if (saved_flag || update_flag) {
|
||||
|
||||
Intent intent = new Intent(CoachingVisitActivity.this, MessageActivity.class);
|
||||
startActivity(intent);
|
||||
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 {
|
||||
} 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 {
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ 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;
|
||||
@@ -264,11 +265,14 @@ public class DeliveryCallActivity extends AppCompatActivity implements View.OnCl
|
||||
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]" + _deliveryCallsList.get(i).getSTORE_NAME() + "[/STORE_NAME]"
|
||||
+ "[STORE_ADDRESS]" + _deliveryCallsList.get(i).getADDRESS() + "[/STORE_ADDRESS]"
|
||||
+ "[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]"
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -74,6 +74,7 @@ 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;
|
||||
|
||||
/**
|
||||
@@ -742,6 +743,29 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
||||
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
|
||||
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());
|
||||
@@ -751,11 +775,13 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
.setNegativeButton(R.string.closed, new DialogInterface.OnClickListener() {
|
||||
public void onClick(DialogInterface dialog, int id) {
|
||||
@@ -885,6 +911,7 @@ public class StoreListActivity extends AppCompatActivity implements GoogleApiCli
|
||||
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();
|
||||
|
||||
+21
-3
@@ -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));
|
||||
@@ -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));
|
||||
|
||||
@@ -60,6 +60,7 @@ 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;
|
||||
@@ -80,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;
|
||||
@@ -89,6 +90,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
CategoryMasterGetterSetter categoryMasterGetterSetter;
|
||||
DisplayMasterGetterSetter displayMasterGetterSetter;
|
||||
MappingStockGetterSetter mappingStockGetterSetter;
|
||||
MappingStockStorewiseGetterSetter mappingStockStorewiseGetterSetter;
|
||||
MAPPINGT2PGetterSetter mappingt2PGetterSetter;
|
||||
DisplayChecklistMasterGetterSetter checklistMasterGetterSetter;
|
||||
MappingDisplayChecklistGetterSetter mappingChecklistGetterSetter;
|
||||
@@ -138,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();
|
||||
}
|
||||
|
||||
@@ -261,8 +264,7 @@ 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 {
|
||||
} else {
|
||||
if (no_jcp_flag) {
|
||||
return "JOURNEY_PLAN";
|
||||
}
|
||||
@@ -519,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);
|
||||
@@ -1100,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);
|
||||
@@ -1608,6 +1650,7 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
db.insertSUPERVISOR_LIST_DATA(supervisorListGetterSetter);
|
||||
db.InsertGeoTag_DATA(geoFencingGetterSetter);
|
||||
db.InsertCONFIGURATION_MASTER(configurationMasterGetterSetter);
|
||||
db.InsertMappingStockSTOREWISE(mappingStockStorewiseGetterSetter);
|
||||
|
||||
} catch (MalformedURLException e) {
|
||||
|
||||
|
||||
+80
-6
@@ -29,12 +29,14 @@ 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;
|
||||
@@ -44,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
|
||||
@@ -70,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);
|
||||
@@ -98,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) {
|
||||
|
||||
@@ -127,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;
|
||||
}
|
||||
@@ -164,7 +179,9 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
if (flag){
|
||||
|
||||
//changed on 23.10.2018
|
||||
ArrayList<AuditDataGetterSetter> question_list = getAuditAfterDeletion(category_id);
|
||||
//ArrayList<AuditDataGetterSetter> question_list = getAuditAfterDeletion(category_id);
|
||||
//changed on 03.12.2018
|
||||
ArrayList<AuditDataGetterSetter> question_list = getAuditQnsRemoved(category_id);
|
||||
|
||||
if(question_list.size()>0){
|
||||
|
||||
@@ -226,6 +243,56 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
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.
|
||||
@@ -354,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;
|
||||
@@ -386,7 +460,7 @@ public class CategoryListActivity extends AppCompatActivity {
|
||||
}
|
||||
}
|
||||
|
||||
if(getAuditAfterDeletion(category_id).size()>0){
|
||||
if(getAuditQnsRemoved(category_id).size()>0){
|
||||
|
||||
if(db.getAfterSaveAuditQuestionAnswerData(store_id, category_id).size() == 0){
|
||||
flag_filled = false;
|
||||
|
||||
+88
-15
@@ -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,7 +244,12 @@ 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 {
|
||||
@@ -253,7 +264,7 @@ 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 {
|
||||
@@ -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) {
|
||||
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);
|
||||
@@ -488,7 +550,7 @@ public class DailyDataMenuActivity extends AppCompatActivity {
|
||||
|
||||
} 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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
+13
-2
@@ -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);
|
||||
|
||||
+7
-2
@@ -85,7 +85,7 @@ public class StoreWisePerformanceActivity extends AppCompatActivity {
|
||||
//Intent intent = new Intent(StoreWisePerformanceActivity.this, MessageActivity.class);
|
||||
|
||||
|
||||
boolean coaching_visit_flag=false;
|
||||
/*boolean coaching_visit_flag=false;
|
||||
//Enable disable According to Configuration
|
||||
ArrayList<ConfigurationMasterGetterSetter> configurationData = db.getConfigurationMasterData(country_id);
|
||||
if(configurationData.size()>0){
|
||||
@@ -110,7 +110,12 @@ public class StoreWisePerformanceActivity extends AppCompatActivity {
|
||||
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);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
+11
-7
@@ -89,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 = "";
|
||||
|
||||
@@ -1078,28 +1079,31 @@ public class PreviousDataUploadActivity extends AppCompatActivity {
|
||||
|
||||
//Coaching visit data----------------------------------------
|
||||
db.open();
|
||||
CoachingVisitGetterSetter coachingVisitData = db.getCoachingVisitData(coverageList.get(i).getStoreId());
|
||||
coachingVisitData = db.getCoachingVisitData(coverageList.get(i).getStoreId());
|
||||
|
||||
if (coachingVisitData!=null && coachingVisitData.getEmp_id()!=null) {
|
||||
if (coachingVisitData.size()>0) {
|
||||
|
||||
String onXml_coaching_data = "";
|
||||
String onXml_coaching_data = "", coaching_xml="";
|
||||
for(int j=0;j<coachingVisitData.size();j++){
|
||||
|
||||
String exist;
|
||||
|
||||
if(coachingVisitData.isExists()){
|
||||
if(coachingVisitData.get(j).isExists()){
|
||||
exist = "1";
|
||||
}
|
||||
else {
|
||||
exist = "0";
|
||||
}
|
||||
|
||||
onXml_coaching_data = "[COACHING_VISIT_DATA]"
|
||||
coaching_xml = "[COACHING_VISIT_DATA]"
|
||||
+ "[MID]" + mid + "[/MID]"
|
||||
+ "[USER_ID]" + userId + "[/USER_ID]"
|
||||
+ "[EMP_ID]" + coachingVisitData.getEmp_id() + "[/EMP_ID]"
|
||||
+ "[IMAGE]" + coachingVisitData.getImg_path() + "[/IMAGE]"
|
||||
+ "[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]";
|
||||
|
||||
|
||||
@@ -97,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;
|
||||
@@ -1170,28 +1171,31 @@ public class UploadActivity extends AppCompatActivity {
|
||||
|
||||
//Coaching visit data
|
||||
db.open();
|
||||
CoachingVisitGetterSetter coachingVisitData = db.getCoachingVisitData(coverageList.get(i).getStoreId());
|
||||
coachingVisitData = db.getCoachingVisitData(coverageList.get(i).getStoreId());
|
||||
|
||||
if (coachingVisitData!=null && coachingVisitData.getEmp_id()!=null) {
|
||||
if (coachingVisitData.size()>0) {
|
||||
|
||||
String onXml_coaching_data = "";
|
||||
String onXml_coaching_data = "", coaching_xml="";
|
||||
for(int j=0;j<coachingVisitData.size();j++){
|
||||
|
||||
String exist;
|
||||
|
||||
if(coachingVisitData.isExists()){
|
||||
if(coachingVisitData.get(j).isExists()){
|
||||
exist = "1";
|
||||
}
|
||||
else {
|
||||
exist = "0";
|
||||
}
|
||||
|
||||
onXml_coaching_data = "[COACHING_VISIT_DATA]"
|
||||
coaching_xml = "[COACHING_VISIT_DATA]"
|
||||
+ "[MID]" + mid + "[/MID]"
|
||||
+ "[USER_ID]" + userId + "[/USER_ID]"
|
||||
+ "[EMP_ID]" + coachingVisitData.getEmp_id() + "[/EMP_ID]"
|
||||
+ "[IMAGE]" + coachingVisitData.getImg_path() + "[/IMAGE]"
|
||||
+ "[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]";
|
||||
|
||||
|
||||
+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);
|
||||
}
|
||||
}
|
||||
+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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ public class TableBean {
|
||||
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;
|
||||
@@ -306,4 +307,12 @@ public class TableBean {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@ 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;
|
||||
@@ -212,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();
|
||||
}
|
||||
@@ -457,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) {
|
||||
@@ -1103,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();
|
||||
}
|
||||
|
||||
@@ -49,6 +49,8 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"></Spinner>
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -61,12 +63,20 @@
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<Spinner
|
||||
<!-- <Spinner
|
||||
android:id="@+id/spinner_supervisor"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="20dp"
|
||||
android:layout_marginTop="10dp"/>
|
||||
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"
|
||||
|
||||
@@ -292,5 +292,6 @@
|
||||
<string name="please_click">الرجاء الضغط على</string>
|
||||
<string name="intime_image">صورة الدخول</string>
|
||||
<string name="outtime_image">صورة الخروج</string>
|
||||
<string name="select_coach">أختار مدرب</string>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -384,6 +384,7 @@
|
||||
<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
@@ -1 +1 @@
|
||||
include ':GSKMTOrange'
|
||||
include ':library',':GSKMTOrange'
|
||||
|
||||
Reference in New Issue
Block a user