review
This commit is contained in:
@@ -61,6 +61,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
TableBean tableBean;
|
TableBean tableBean;
|
||||||
private SQLiteDatabase db;
|
private SQLiteDatabase db;
|
||||||
Context context;
|
Context context;
|
||||||
|
ArrayList<T2PGetterSetter> t2PGetterSetters;
|
||||||
|
|
||||||
public GSKOrangeDB(Context context) {
|
public GSKOrangeDB(Context context) {
|
||||||
|
|
||||||
@@ -159,6 +160,16 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
db.delete(CommonString.TABLE_INSERT_PROMO_SKU, "STORE_ID='" + storeid + "'", null);
|
db.delete(CommonString.TABLE_INSERT_PROMO_SKU, "STORE_ID='" + storeid + "'", null);
|
||||||
//Gagan end code
|
//Gagan end code
|
||||||
|
|
||||||
|
t2PGetterSetters = getT2pCompliancedaletedata(storeid);
|
||||||
|
|
||||||
|
for (int q = 0; q < t2PGetterSetters.size(); q++) {
|
||||||
|
|
||||||
|
db.delete(CommonString.TABLE_INSERT_T2P_GAPS, "COMMON_ID='" + t2PGetterSetters.get(q).getKey_id() + "'", null);
|
||||||
|
db.delete(CommonString.TABLE_INSERT_T2P_SKU, "COMMON_ID='" + t2PGetterSetters.get(q).getKey_id() + "'", null);
|
||||||
|
db.delete(CommonString.TABLE_INSERT_BRAND_AVAIBILITY_DATA, "COMMON_ID='" + t2PGetterSetters.get(q).getKey_id() + "'", null);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
db.delete(CommonString.TABLE_INSERT_T2P_COMPLIANCE, "STORE_ID='" + storeid + "'", null);
|
db.delete(CommonString.TABLE_INSERT_T2P_COMPLIANCE, "STORE_ID='" + storeid + "'", null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -180,7 +191,9 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
//Gagan end code
|
//Gagan end code
|
||||||
|
|
||||||
db.delete(CommonString.TABLE_INSERT_T2P_COMPLIANCE, null, null);
|
db.delete(CommonString.TABLE_INSERT_T2P_COMPLIANCE, null, null);
|
||||||
|
db.delete(CommonString.TABLE_INSERT_T2P_GAPS, null, null);
|
||||||
|
db.delete(CommonString.TABLE_INSERT_T2P_SKU, null, null);
|
||||||
|
db.delete(CommonString.TABLE_INSERT_BRAND_AVAIBILITY_DATA, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InsertJCP(JourneyPlanGetterSetter data) {
|
public void InsertJCP(JourneyPlanGetterSetter data) {
|
||||||
@@ -2575,6 +2588,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
ContentValues values = new ContentValues();
|
ContentValues values = new ContentValues();
|
||||||
ContentValues values1 = new ContentValues();
|
ContentValues values1 = new ContentValues();
|
||||||
ContentValues values2 = new ContentValues();
|
ContentValues values2 = new ContentValues();
|
||||||
|
ContentValues values3 = new ContentValues();
|
||||||
try {
|
try {
|
||||||
for (int i = 0; i < data.size(); i++) {
|
for (int i = 0; i < data.size(); i++) {
|
||||||
|
|
||||||
@@ -2626,18 +2640,17 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
|
|
||||||
ArrayList<BrandAvabilityGetterSetter> brand = data.get(i).getBrandlist();
|
ArrayList<BrandAvabilityGetterSetter> brand = data.get(i).getBrandlist();
|
||||||
|
|
||||||
for (int k = 0; k < brand.size(); k++) {
|
for (int p = 0; p < brand.size(); p++) {
|
||||||
|
|
||||||
values.put("COMMON_ID", l);
|
values3.put("COMMON_ID", l);
|
||||||
values.put("BRAND_NAME", brand.get(i).getBRAND());
|
values3.put("BRAND_NAME", brand.get(p).getBRAND());
|
||||||
values.put("BRAND_ID", brand.get(i).getBRAND_ID());
|
values3.put("BRAND_ID", brand.get(p).getBRAND_ID());
|
||||||
|
|
||||||
db.insert(CommonString.TABLE_INSERT_BRAND_AVAIBILITY_DATA, null, values);
|
db.insert(CommonString.TABLE_INSERT_BRAND_AVAIBILITY_DATA, null, values3);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
Log.d("Exception ", " in T2P_COMPLIANCE " + ex.toString());
|
Log.d("Exception ", " in T2P_COMPLIANCE " + ex.toString());
|
||||||
@@ -3656,4 +3669,49 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// get T2P Compliance data
|
||||||
|
public ArrayList<T2PGetterSetter> getT2pCompliancedaletedata(String store_id) {
|
||||||
|
|
||||||
|
ArrayList<T2PGetterSetter> list = new ArrayList<>();
|
||||||
|
Cursor dbcursor = null;
|
||||||
|
try {
|
||||||
|
|
||||||
|
dbcursor = db.rawQuery("SELECT * FROM " + CommonString.TABLE_INSERT_T2P_COMPLIANCE + " where " +
|
||||||
|
CommonString.KEY_STORE_ID + "='" + store_id + "'", null);
|
||||||
|
|
||||||
|
|
||||||
|
if (dbcursor != null) {
|
||||||
|
dbcursor.moveToFirst();
|
||||||
|
while (!dbcursor.isAfterLast()) {
|
||||||
|
T2PGetterSetter tp = new T2PGetterSetter();
|
||||||
|
|
||||||
|
tp.setKey_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_ID)));
|
||||||
|
|
||||||
|
/* tp.setDisplay_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_DISPLAY_ID)));
|
||||||
|
tp.setBrand_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_BRAND_ID)));
|
||||||
|
tp.setBrand(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_BRAND)));
|
||||||
|
tp.setDisplay(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_DISPLAY)));
|
||||||
|
tp.setRef_image_url(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_IMAGE_URL)));
|
||||||
|
tp.setRef_image_path(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_IMAGE_PATH)));
|
||||||
|
tp.setImage(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_IMAGE)));
|
||||||
|
tp.setImage1(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_IMAGE1)));
|
||||||
|
tp.setImage2(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_IMAGE2)));
|
||||||
|
tp.setRemark(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_REMARK)));
|
||||||
|
tp.setCategory_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_CATEGORY_ID)));
|
||||||
|
tp.setPresent((dbcursor.getString(dbcursor.getColumnIndexOrThrow(CommonString.KEY_PRESENT)).equalsIgnoreCase("1")));
|
||||||
|
*/
|
||||||
|
list.add(tp);
|
||||||
|
dbcursor.moveToNext();
|
||||||
|
}
|
||||||
|
dbcursor.close();
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -560,13 +560,13 @@ public class CommonString {
|
|||||||
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
+ " INTEGER PRIMARY KEY AUTOINCREMENT ,"
|
||||||
|
|
||||||
+ "COMMON_ID"
|
+ "COMMON_ID"
|
||||||
+ " VARCHAR,"
|
+ " INTEGER,"
|
||||||
|
|
||||||
+ "BRAND_NAME"
|
+ "BRAND_NAME"
|
||||||
+ " VARCHAR,"
|
+ " VARCHAR,"
|
||||||
|
|
||||||
+ "BRAND_ID"
|
+ "BRAND_ID"
|
||||||
+ " VARCHAR"
|
+ " INTEGER"
|
||||||
|
|
||||||
+ ")";
|
+ ")";
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
Button btn_add,btn_close;
|
Button btn_add,btn_close;
|
||||||
ListView listview;
|
ListView listview;
|
||||||
LinearLayout linearlay;
|
LinearLayout linearlay;
|
||||||
CardView cardlay;
|
//CardView cardlay;
|
||||||
String brand_name="",brand_id="";
|
String brand_name="",brand_id="";
|
||||||
ArrayList<BrandAvabilityGetterSetter> brand_new_list=new ArrayList<BrandAvabilityGetterSetter>();
|
ArrayList<BrandAvabilityGetterSetter> brand_new_list=new ArrayList<BrandAvabilityGetterSetter>();
|
||||||
@Override
|
@Override
|
||||||
@@ -1272,7 +1272,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
listview = (ListView) dialog.findViewById(R.id.lv);
|
listview = (ListView) dialog.findViewById(R.id.lv);
|
||||||
linearlay = (LinearLayout) dialog.findViewById(R.id.list_layout);
|
linearlay = (LinearLayout) dialog.findViewById(R.id.list_layout);
|
||||||
cardlay = (CardView) dialog.findViewById(R.id.cardId);
|
// cardlay = (CardView) dialog.findViewById(R.id.cardId);
|
||||||
|
|
||||||
// Create custom adapter object ( see below CustomAdapter.java )
|
// Create custom adapter object ( see below CustomAdapter.java )
|
||||||
T2PComplianceActivity.CustomBRANDAdapter adapter = new T2PComplianceActivity.CustomBRANDAdapter(T2PComplianceActivity.this, R.layout.custom_spinner_item, brandList);
|
T2PComplianceActivity.CustomBRANDAdapter adapter = new T2PComplianceActivity.CustomBRANDAdapter(T2PComplianceActivity.this, R.layout.custom_spinner_item, brandList);
|
||||||
@@ -1281,13 +1281,13 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
if (brandGetdata.size() > 0) {
|
if (brandGetdata.size() > 0) {
|
||||||
linearlay.setVisibility(View.VISIBLE);
|
linearlay.setVisibility(View.VISIBLE);
|
||||||
cardlay.setVisibility(View.VISIBLE);
|
// cardlay.setVisibility(View.VISIBLE);
|
||||||
adapterData = new T2PComplianceActivity.MyAdaptorStock(T2PComplianceActivity.this, brandGetdata);
|
adapterData = new T2PComplianceActivity.MyAdaptorStock(T2PComplianceActivity.this, brandGetdata);
|
||||||
listview.setAdapter(adapterData);
|
listview.setAdapter(adapterData);
|
||||||
listview.invalidateViews();
|
listview.invalidateViews();
|
||||||
} else {
|
} else {
|
||||||
linearlay.setVisibility(View.GONE);
|
linearlay.setVisibility(View.GONE);
|
||||||
cardlay.setVisibility(View.GONE);
|
// cardlay.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
spinner_brand.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
spinner_brand.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||||
@@ -1337,7 +1337,7 @@ public class T2PComplianceActivity extends AppCompatActivity {
|
|||||||
listview.setAdapter(adapterData);
|
listview.setAdapter(adapterData);
|
||||||
listview.invalidateViews();
|
listview.invalidateViews();
|
||||||
|
|
||||||
cardlay.setVisibility(View.VISIBLE);
|
// cardlay.setVisibility(View.VISIBLE);
|
||||||
linearlay.setVisibility(View.VISIBLE);
|
linearlay.setVisibility(View.VISIBLE);
|
||||||
spinner_brand.setSelection(0);
|
spinner_brand.setSelection(0);
|
||||||
brand_name="";
|
brand_name="";
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ import javax.xml.parsers.SAXParserFactory;
|
|||||||
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
import cpm.com.gskmtorange.Database.GSKOrangeDB;
|
||||||
import cpm.com.gskmtorange.GetterSetter.AdditionalDialogGetterSetter;
|
import cpm.com.gskmtorange.GetterSetter.AdditionalDialogGetterSetter;
|
||||||
import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
|
import cpm.com.gskmtorange.GetterSetter.AddittionalGetterSetter;
|
||||||
|
import cpm.com.gskmtorange.GetterSetter.BrandAvabilityGetterSetter;
|
||||||
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
import cpm.com.gskmtorange.GetterSetter.CoverageBean;
|
||||||
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
import cpm.com.gskmtorange.GetterSetter.StoreBean;
|
||||||
import cpm.com.gskmtorange.R;
|
import cpm.com.gskmtorange.R;
|
||||||
@@ -726,7 +727,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
ArrayList<GapsChecklistGetterSetter> gapsList = db.getGapsData(t2PGetterSetters.get(i).getKey_id());
|
ArrayList<GapsChecklistGetterSetter> gapsList = db.getGapsData(t2PGetterSetters.get(i).getKey_id());
|
||||||
ArrayList<SkuGetterSetter> skuList = db.getT2PSKUData(t2PGetterSetters.get(i).getKey_id());
|
ArrayList<SkuGetterSetter> skuList = db.getT2PSKUData(t2PGetterSetters.get(i).getKey_id());
|
||||||
|
ArrayList<BrandAvabilityGetterSetter> brandList = db.getT2BrandData(t2PGetterSetters.get(i).getKey_id());
|
||||||
String gaps_xml = "";
|
String gaps_xml = "";
|
||||||
String gaps_child;
|
String gaps_child;
|
||||||
|
|
||||||
@@ -766,6 +767,24 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
sku_xml = sku_xml + sku_child;
|
sku_xml = sku_xml + sku_child;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
String brandxml = "";
|
||||||
|
String brandchild;
|
||||||
|
|
||||||
|
if (brandList.size() > 0) {
|
||||||
|
|
||||||
|
for (int M = 0; M < brandList.size(); M++) {
|
||||||
|
|
||||||
|
brandchild = "[BRAND]"
|
||||||
|
+ "[MID]" + mid + "[/MID]"
|
||||||
|
+ "[USER_ID]" + userId + "[/USER_ID]"
|
||||||
|
+ "[BRAND_ID]" + brandList.get(M).getBRAND_ID() + "[/BRAND_ID]"
|
||||||
|
/* + "[BRAND]" + brandList.get(M).getBRAND() + "[/BRAND]"*/
|
||||||
|
+ "[COMMON_ID]" + Integer.parseInt(t2PGetterSetters.get(i1).getKey_id()) + "[/COMMON_ID]"
|
||||||
|
+ "[/BRAND]";
|
||||||
|
brandxml = brandxml + brandchild;
|
||||||
|
}
|
||||||
|
}
|
||||||
String present = "";
|
String present = "";
|
||||||
if (t2PGetterSetters.get(i1).isPresent()) {
|
if (t2PGetterSetters.get(i1).isPresent()) {
|
||||||
present = "1";
|
present = "1";
|
||||||
@@ -786,6 +805,8 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
+ "[PRESENT]" + present + "[/PRESENT]"
|
+ "[PRESENT]" + present + "[/PRESENT]"
|
||||||
+ "[GAPS_DATA]" + gaps_xml + "[/GAPS_DATA]"
|
+ "[GAPS_DATA]" + gaps_xml + "[/GAPS_DATA]"
|
||||||
+ "[SKU_DATA]" + sku_xml + "[/SKU_DATA]"
|
+ "[SKU_DATA]" + sku_xml + "[/SKU_DATA]"
|
||||||
|
+ "[BRAND_DATA]" + brandxml + "[/BRAND_DATA]"
|
||||||
|
|
||||||
+ "[/T2P_DATA]";
|
+ "[/T2P_DATA]";
|
||||||
|
|
||||||
t2p_data_xml = t2p_data_xml + onXML;
|
t2p_data_xml = t2p_data_xml + onXML;
|
||||||
@@ -796,7 +817,7 @@ public class UploadActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
request = new SoapObject(CommonString.NAMESPACE, CommonString.METHOD_UPLOAD_STOCK_XML_DATA);
|
||||||
request.addProperty("XMLDATA", t2p_final_xml);
|
request.addProperty("XMLDATA", t2p_final_xml);
|
||||||
request.addProperty("KEYS", "T2P_DATA");
|
request.addProperty("KEYS", "T2P_DATA_NEW");
|
||||||
request.addProperty("USERNAME", userId);
|
request.addProperty("USERNAME", userId);
|
||||||
request.addProperty("MID", mid);
|
request.addProperty("MID", mid);
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,7 @@
|
|||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:padding="10dp"
|
android:padding="10dp"
|
||||||
card_view:cardBackgroundColor="@color/colorPrimary"
|
card_view:cardBackgroundColor="@color/colorPrimary"
|
||||||
card_view:cardCornerRadius="20dp"
|
card_view:cardCornerRadius="8dp">
|
||||||
>
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -72,9 +71,10 @@
|
|||||||
<Button
|
<Button
|
||||||
android:id="@+id/btn_add"
|
android:id="@+id/btn_add"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_weight="1"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
android:text="@string/add" />
|
android:text="@string/add" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/btn_cancel"
|
android:id="@+id/btn_cancel"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
@@ -93,28 +93,16 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"></android.support.v7.widget.RecyclerView>-->
|
android:layout_height="wrap_content"></android.support.v7.widget.RecyclerView>-->
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</android.support.v7.widget.CardView>
|
|
||||||
|
|
||||||
<android.support.v7.widget.CardView
|
|
||||||
android:id="@+id/cardId"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
|
|
||||||
android:padding="10dp"
|
|
||||||
card_view:cardBackgroundColor="@color/colorOrange"
|
|
||||||
card_view:cardCornerRadius="8dp"
|
|
||||||
android:visibility="gone"
|
|
||||||
|
|
||||||
>
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/list_layout"
|
android:id="@+id/list_layout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
android:layout_weight="95"
|
android:layout_weight="95"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
>
|
>
|
||||||
|
|
||||||
<ListView
|
<ListView
|
||||||
android:id="@+id/lv"
|
android:id="@+id/lv"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -127,5 +115,41 @@
|
|||||||
android:fastScrollEnabled="true"
|
android:fastScrollEnabled="true"
|
||||||
android:smoothScrollbar="true"></ListView>
|
android:smoothScrollbar="true"></ListView>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</android.support.v7.widget.CardView>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</android.support.v7.widget.CardView>
|
||||||
|
|
||||||
|
<!-- <android.support.v7.widget.CardView
|
||||||
|
android:id="@+id/cardId"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:padding="10dp"
|
||||||
|
|
||||||
|
card_view:cardBackgroundColor="@color/colorOrange"
|
||||||
|
card_view:cardCornerRadius="8dp">
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/list_layout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="95"
|
||||||
|
>
|
||||||
|
|
||||||
|
<ListView
|
||||||
|
android:id="@+id/lv"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:cacheColorHint="#00000000"
|
||||||
|
|
||||||
|
android:choiceMode="singleChoice"
|
||||||
|
android:divider="#ff9933"
|
||||||
|
android:dividerHeight="2dp"
|
||||||
|
android:fastScrollEnabled="true"
|
||||||
|
android:smoothScrollbar="true"></ListView>
|
||||||
|
</LinearLayout>
|
||||||
|
</android.support.v7.widget.CardView>-->
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|||||||
Reference in New Issue
Block a user