MSL Availability Stock Facing Changes

This commit is contained in:
gagangoel290
2017-04-26 11:29:50 +05:30
parent 96f12d1041
commit 9429c20587
5 changed files with 73 additions and 33 deletions
+1 -1
View File
@@ -41,7 +41,7 @@
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
@@ -4841,7 +4841,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
Cursor dbcursor = null;
try {
dbcursor = db.rawQuery("Select DISTINCT SK.SKU_ID,SK.SKU,SK.MRP,SK.SKU_SEQUENCE,M.MBQ,BR.COMPANY_ID " +
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 " +
"on M.SKU_ID=SK.SKU_ID " +
@@ -4853,7 +4853,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
"on SB.CATEGORY_ID=CA.CATEGORY_ID " +
"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 + "'", null);
"' AND M.CLASS_ID = '" + class_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 " +
@@ -4881,6 +4881,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
cd.setSku_sequence(dbcursor.getString(dbcursor.getColumnIndexOrThrow("SKU_SEQUENCE")));
cd.setMbq(dbcursor.getString(dbcursor.getColumnIndexOrThrow("MBQ")));
cd.setCompany_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("COMPANY_ID")));
cd.setMust_have(dbcursor.getString(dbcursor.getColumnIndexOrThrow("MUST_HAVE")));
cd.setToggleValue("1");
cd.setFacing("");
cd.setStock("");
@@ -4921,6 +4922,7 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
cd.setFacing(dbcursor.getString(dbcursor.getColumnIndexOrThrow("FACING")));
cd.setStock(dbcursor.getString(dbcursor.getColumnIndexOrThrow("STOCK")));
cd.setCompany_id(dbcursor.getString(dbcursor.getColumnIndexOrThrow("COMPANY_ID")));
cd.setMust_have(dbcursor.getString(dbcursor.getColumnIndexOrThrow("MUST_HAVE")));
list.add(cd);
dbcursor.moveToNext();
@@ -4955,9 +4957,14 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
values.put("SKU_SEQUENCE", data.getSku_sequence());
values.put("MBQ", data.getMbq());
values.put("TOGGLE_VALUE", data.getToggleValue());
values.put("FACING", data.getFacing());
if (data.getFacing().equals("")) {
values.put("FACING", "0");
} else {
values.put("FACING", data.getFacing());
}
values.put("STOCK", data.getStock());
values.put("COMPANY_ID", data.getCompany_id());
values.put("MUST_HAVE", data.getMust_have());
db.insert(CommonString.TABLE_INSERT_MSL_AVAILABILITY_STOCK_FACING, null, values);
}
@@ -4983,9 +4990,14 @@ public class GSKOrangeDB extends SQLiteOpenHelper {
MSL_AvailabilityStockFacingGetterSetter data = hashMapListChildData.get(hashMapListHeaderData.get(i)).get(j);
values.put("TOGGLE_VALUE", data.getToggleValue());
values.put("FACING", data.getFacing());
values.put("STOCK", data.getStock());
if (data.getFacing().equals("")) {
values.put("FACING", "0");
} else {
values.put("FACING", data.getFacing());
}
db.update(CommonString.TABLE_INSERT_MSL_AVAILABILITY_STOCK_FACING, values,
"Brand_Id ='" + hashMapListHeaderData.get(i).getBrand_id() + "' AND SKU_ID ='" + data.getSku_id() +
"' AND Category_Id='" + categoryId + "' AND Store_Id='" + storeId + "'", null);
@@ -798,6 +798,9 @@ public class CommonString {
+ " VARCHAR,"
+ "TOGGLE_VALUE"
+ " VARCHAR,"
+ "MUST_HAVE"
+ " VARCHAR"
+ ")";
@@ -132,7 +132,7 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
str = CommonString.FILE_PATH ;
str = CommonString.FILE_PATH;
prepareList();
@@ -581,35 +581,38 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
//Company_id
if (listDataChild.get(listDataHeader.get(i)).get(j).getCompany_id().equals("1")) {
if (!camera_allow.equalsIgnoreCase("1")) {
if (!(planogramShelfHeaderDataList.size() > 0)) {
flag = false;
Error_Message = getResources().getString(R.string.stock_planogram_data_noCamera_data);
break;
}
}
if (faceup.equals("")) {
if (!checkHeaderArray.contains(i)) {
checkHeaderArray.add(i);
}
flag = false;
Error_Message = getResources().getString(R.string.faceup_value);
break;
} else {
if (data.getToggleValue().equals("0")) {
if (stock.equals("")) {
if (!checkHeaderArray.contains(i)) {
checkHeaderArray.add(i);
}
if (data.getMust_have().equals("1")) {
if (!camera_allow.equalsIgnoreCase("1")) {
if (!(planogramShelfHeaderDataList.size() > 0)) {
flag = false;
Error_Message = getResources().getString(R.string.stock_value);
Error_Message = getResources().getString(R.string.stock_planogram_data_noCamera_data);
break;
}
}
if (faceup.equals("")) {
if (!checkHeaderArray.contains(i)) {
checkHeaderArray.add(i);
}
flag = false;
Error_Message = getResources().getString(R.string.faceup_value);
break;
} else {
if (data.getToggleValue().equals("0")) {
if (stock.equals("")) {
if (!checkHeaderArray.contains(i)) {
checkHeaderArray.add(i);
}
flag = false;
Error_Message = getResources().getString(R.string.stock_value);
break;
}
}
}
}
} else {
if (faceup.equals("")) {
@@ -784,8 +787,10 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
holder.txt_skuName.setText(childData.getSku());
holder.txt_mbq.setText(childData.getMbq());
if (childData.getCompany_id().equals("1")) {
if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.colorOrange));
holder.txt_skuName.setTextColor(getResources().getColor(R.color.colorPrimary));
holder.txt_mbq.setVisibility(View.VISIBLE);
holder.toggle_available.setVisibility(View.VISIBLE);
holder.facing.setVisibility(View.VISIBLE);
@@ -796,13 +801,25 @@ public class MSL_Availability_StockFacingActivity extends AppCompatActivity {
holder.stock.setVisibility(View.VISIBLE);
}
} else {
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
holder.txt_skuName.setTextColor(getResources().getColor(R.color.black));
holder.txt_mbq.setVisibility(View.GONE);
holder.toggle_available.setVisibility(View.GONE);
holder.facing.setVisibility(View.VISIBLE);
holder.stock.setVisibility(View.GONE);
}
/* if (childData.getCompany_id().equals("1") && childData.getMust_have().equals("1")) {
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.colorOrange));
} else {
holder.lin_category.setBackgroundColor(getResources().getColor(R.color.white));
*//*holder.txt_mbq.setVisibility(View.GONE);
holder.toggle_available.setVisibility(View.GONE);
holder.facing.setVisibility(View.VISIBLE);
holder.stock.setVisibility(View.GONE);*//*
}*/
final ViewHolder finalHolder = holder;
holder.toggle_available.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@@ -6,7 +6,7 @@ package cpm.com.gskmtorange.xmlGetterSetter;
public class MSL_AvailabilityStockFacingGetterSetter {
String sub_category_id, sub_category, brand_id, brand,
sku_id, sku, mrp, sku_sequence, toggleValue, mbq, category_id, facing, stock,company_id;
sku_id, sku, mrp, sku_sequence, toggleValue, mbq, category_id, facing, stock,company_id,must_have;
public String getSub_category_id() {
return sub_category_id;
@@ -119,4 +119,12 @@ public class MSL_AvailabilityStockFacingGetterSetter {
public void setCompany_id(String company_id) {
this.company_id = company_id;
}
public String getMust_have() {
return must_have;
}
public void setMust_have(String must_have) {
this.must_have = must_have;
}
}