|
|
@@ -47,6 +47,7 @@ import com.dongkesoft.ibossmini.adapter.InventorysearchAdapter;
|
|
|
import com.dongkesoft.ibossmini.constant.Comment;
|
|
|
import com.dongkesoft.ibossmini.constant.Constants;
|
|
|
import com.dongkesoft.ibossmini.model.BrandInfo;
|
|
|
+import com.dongkesoft.ibossmini.model.GradeBean;
|
|
|
import com.dongkesoft.ibossmini.model.InventoryInfo;
|
|
|
import com.dongkesoft.ibossmini.model.SearchInfo;
|
|
|
import com.dongkesoft.ibossmini.model.VarietyBean;
|
|
|
@@ -74,9 +75,11 @@ public class InventoryListActivity extends IBossBaseActivity implements
|
|
|
/**
|
|
|
* 仓库号,品牌ID
|
|
|
*/
|
|
|
- private String WarehouseCode, BrandID;
|
|
|
+ private String WarehouseCode, BrandID, GradeID;
|
|
|
// 规格
|
|
|
private String specification = "";
|
|
|
+ private String colornumber = "";
|
|
|
+ private String positionnumber = "";
|
|
|
/**
|
|
|
* 商品编码,唯一编码
|
|
|
*/
|
|
|
@@ -154,6 +157,8 @@ public class InventoryListActivity extends IBossBaseActivity implements
|
|
|
*/
|
|
|
private List<InventoryInfo> listData;
|
|
|
private List<VarietyBean> varietyListFilters;
|
|
|
+ private List<GradeBean> gradeListFilters;
|
|
|
+ private List<GradeBean> gradeList = new ArrayList<GradeBean>();
|
|
|
/**
|
|
|
* 库区数据
|
|
|
*/
|
|
|
@@ -184,6 +189,8 @@ public class InventoryListActivity extends IBossBaseActivity implements
|
|
|
private RelativeLayout rlOnlyCode;
|
|
|
private EditText etOnlyCode;
|
|
|
private EditText etSpecification;
|
|
|
+ private EditText etColorNumber;
|
|
|
+ private EditText etPositionNumber;
|
|
|
private EditText goodsName;
|
|
|
/**
|
|
|
* 库存
|
|
|
@@ -195,6 +202,8 @@ public class InventoryListActivity extends IBossBaseActivity implements
|
|
|
*/
|
|
|
private RelativeLayout rlBrand;
|
|
|
private TextView tvBrand;
|
|
|
+ private RelativeLayout rlGrade;
|
|
|
+ private TextView tvGrade;
|
|
|
/**
|
|
|
* 品种
|
|
|
*/
|
|
|
@@ -279,6 +288,9 @@ public class InventoryListActivity extends IBossBaseActivity implements
|
|
|
case R.id.rl_variety:
|
|
|
loadData("T_MST_Goods_Variety");
|
|
|
break;
|
|
|
+ case R.id.rl_grade:
|
|
|
+ loadData("T_MST_Goods_Grade");
|
|
|
+ break;
|
|
|
/**
|
|
|
* 重置
|
|
|
*/
|
|
|
@@ -288,8 +300,14 @@ public class InventoryListActivity extends IBossBaseActivity implements
|
|
|
etOnlyCode.setText("");
|
|
|
goodsName.setText("");
|
|
|
etSpecification.setText("");
|
|
|
+ etColorNumber.setText("");
|
|
|
+ etPositionNumber.setText("");
|
|
|
tvBrand.setText("请选择品牌");
|
|
|
tvBrand.setTextColor(Color.parseColor("#808080"));
|
|
|
+ tvVariety.setText("请选择品种");
|
|
|
+ tvVariety.setTextColor(Color.parseColor("#808080"));
|
|
|
+ tvGrade.setText("请选择等级");
|
|
|
+ tvGrade.setTextColor(Color.parseColor("#808080"));
|
|
|
tvReservoir.setText("请选择库区");
|
|
|
tvReservoir.setTextColor(Color.parseColor("#808080"));
|
|
|
break;
|
|
|
@@ -313,10 +331,18 @@ public class InventoryListActivity extends IBossBaseActivity implements
|
|
|
if (tvBrand.getText().toString().equals("请选择品牌")) {
|
|
|
BrandID = "";
|
|
|
}
|
|
|
+ if (tvVariety.getText().toString().equals("请选择品种")) {
|
|
|
+ variety = "";
|
|
|
+ }
|
|
|
+ if (tvGrade.getText().toString().equals("请选择等级")) {
|
|
|
+ GradeID = "";
|
|
|
+ }
|
|
|
if (tvReservoir.getText().toString().equals("请选择库区")) {
|
|
|
WarehouseCode = "";
|
|
|
}
|
|
|
specification = etSpecification.getText().toString();
|
|
|
+ colornumber = etColorNumber.getText().toString();
|
|
|
+ positionnumber = etPositionNumber.getText().toString();
|
|
|
mSearchInfoList = new ArrayList<SearchInfo>();
|
|
|
mCurrentPage = "1";
|
|
|
mInventorysearchAdapter = null;
|
|
|
@@ -353,6 +379,7 @@ public class InventoryListActivity extends IBossBaseActivity implements
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
|
|
BrandID = "";
|
|
|
+ GradeID = "";
|
|
|
WarehouseCode = "";
|
|
|
commodityCode = "";
|
|
|
distinguishedEncodingRules = "";
|
|
|
@@ -385,8 +412,10 @@ public class InventoryListActivity extends IBossBaseActivity implements
|
|
|
btnSure = (TextView) view.findViewById(R.id.btn_sure);
|
|
|
tvClose = (TextView) view.findViewById(R.id.tv_close);
|
|
|
tvBrand = (TextView) view.findViewById(R.id.tv_brand);
|
|
|
+ tvGrade = (TextView) view.findViewById(R.id.tv_grade);
|
|
|
tvReservoir = (TextView) view.findViewById(R.id.tv_reservoir);
|
|
|
rlBrand = (RelativeLayout) view.findViewById(R.id.rl_brand);
|
|
|
+ rlGrade = (RelativeLayout) view.findViewById(R.id.rl_grade);
|
|
|
rlReservoir = (RelativeLayout) view.findViewById(R.id.rl_reservoir);
|
|
|
rlOnlyCode = (RelativeLayout) view.findViewById(R.id.rl_only_code);
|
|
|
rlCommodityCode = (RelativeLayout) view
|
|
|
@@ -396,6 +425,8 @@ public class InventoryListActivity extends IBossBaseActivity implements
|
|
|
etOnlyCode = (EditText) view.findViewById(R.id.et_only_code);
|
|
|
goodsName = (EditText) view.findViewById(R.id.et_goods_name);
|
|
|
etSpecification = (EditText) view.findViewById(R.id.et_goods_specification);
|
|
|
+ etColorNumber = (EditText) view.findViewById(R.id.et_goods_colornumber);
|
|
|
+ etPositionNumber = (EditText) view.findViewById(R.id.et_goods_positionnumber);
|
|
|
|
|
|
etOnlyCode.setOnFocusChangeListener(mOnFocusChangeListener);
|
|
|
etCommodityCode = (EditText) view.findViewById(R.id.et_commodity_code);
|
|
|
@@ -514,6 +545,7 @@ public class InventoryListActivity extends IBossBaseActivity implements
|
|
|
rlOnlyCode.setOnClickListener(this);
|
|
|
rlReservoir.setOnClickListener(this);
|
|
|
rlBrand.setOnClickListener(this);
|
|
|
+ rlGrade.setOnClickListener(this);
|
|
|
btnReset.setOnClickListener(this);
|
|
|
btnSure.setOnClickListener(this);
|
|
|
rlZeroInventory.setOnClickListener(this);
|
|
|
@@ -628,6 +660,21 @@ public class InventoryListActivity extends IBossBaseActivity implements
|
|
|
Comment.varietyInfos = varietyList;
|
|
|
showltDialog(string);
|
|
|
}
|
|
|
+ if (string.equals("T_MST_Goods_Grade")) {
|
|
|
+ for (int i = 0; i < array.length(); i++) {
|
|
|
+ JSONObject jsonObjectGoods = new JSONObject(
|
|
|
+ array.getString(i));
|
|
|
+ // VarietyName VarietyID
|
|
|
+ GradeBean info = new GradeBean();
|
|
|
+ info.setGradeID(jsonObjectGoods
|
|
|
+ .getString("GradeID"));
|
|
|
+ info.setGradeName(jsonObjectGoods
|
|
|
+ .getString("GradeName"));
|
|
|
+ gradeList.add(info);
|
|
|
+ }
|
|
|
+ Comment.gradeBeanInfos = gradeList;
|
|
|
+ showltDialog(string);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
else if (jsonObject.getInt("Status") == Constants.ACTION_RESULT_STATUS
|
|
|
@@ -687,10 +734,11 @@ public class InventoryListActivity extends IBossBaseActivity implements
|
|
|
Comment.inventoryInfos = Comment.list;
|
|
|
Comment.brandLists = Comment.brandInfos;
|
|
|
Comment.varietyLists=Comment.varietyInfos;
|
|
|
+ Comment.gradeBeanLists=Comment.gradeBeanInfos;
|
|
|
lvDialogSelect = (ListView) view.findViewById(R.id.select_list);
|
|
|
etDialogSearch = (EditText) view.findViewById(R.id.et_search);
|
|
|
InventoryAdapter adapter = new InventoryAdapter(Comment.inventoryInfos,
|
|
|
- Comment.brandLists, Comment.varietyInfos, InventoryListActivity.this, string);
|
|
|
+ Comment.brandLists, Comment.varietyInfos,Comment.gradeBeanInfos, InventoryListActivity.this, string);
|
|
|
lvDialogSelect.setAdapter(adapter);
|
|
|
etDialogSearch.addTextChangedListener(new TextWatcher() {
|
|
|
@Override
|
|
|
@@ -708,6 +756,7 @@ public class InventoryListActivity extends IBossBaseActivity implements
|
|
|
listData = new ArrayList<InventoryInfo>();
|
|
|
brandListFilters = new ArrayList<BrandInfo>();
|
|
|
varietyListFilters = new ArrayList<VarietyBean>();
|
|
|
+ gradeListFilters = new ArrayList<GradeBean>();
|
|
|
if (string.equals("T_MST_Warehouse")) {
|
|
|
for (int i = 0; i < Comment.list.size(); i++) {
|
|
|
if ((Comment.list.get(i).getWarehouseName().toString()
|
|
|
@@ -737,7 +786,24 @@ public class InventoryListActivity extends IBossBaseActivity implements
|
|
|
InventoryListActivity.this, string);
|
|
|
lvDialogSelect.setAdapter(adapter);
|
|
|
|
|
|
- } else {
|
|
|
+ }
|
|
|
+ else if (string.equals("T_MST_Goods_Grade")) {
|
|
|
+
|
|
|
+ for (int i = 0; i < Comment.gradeBeanInfos.size(); i++) {
|
|
|
+ if ((Comment.gradeBeanInfos.get(i).getGradeName()
|
|
|
+ .toString().indexOf(etDialogSearch.getText()
|
|
|
+ .toString())) >= 0) {
|
|
|
+ gradeListFilters.add(Comment.gradeBeanInfos.get(i));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Comment.gradeBeanLists = gradeListFilters;
|
|
|
+
|
|
|
+ InventoryAdapter adapter = new InventoryAdapter(
|
|
|
+ Comment.inventoryInfos, Comment.brandLists, Comment.varietyLists,Comment.gradeBeanLists,
|
|
|
+ InventoryListActivity.this, string);
|
|
|
+ lvDialogSelect.setAdapter(adapter);
|
|
|
+
|
|
|
+ }else {
|
|
|
for (int i = 0; i < Comment.brandInfos.size(); i++) {
|
|
|
if ((Comment.brandInfos.get(i).getBrandName()
|
|
|
.toString().indexOf(etDialogSearch.getText()
|
|
|
@@ -774,7 +840,13 @@ public class InventoryListActivity extends IBossBaseActivity implements
|
|
|
.getVarietyName().toString());
|
|
|
variety = Comment.varietyLists.get(arg2).getVarietyID();
|
|
|
|
|
|
- } else {
|
|
|
+ } else if (string.equals("T_MST_Goods_Grade")) {
|
|
|
+ tvGrade.setTextColor(Color.parseColor("#000000"));
|
|
|
+ tvGrade.setText(Comment.gradeBeanLists.get(arg2).getGradeName()
|
|
|
+ .toString());
|
|
|
+ GradeID = Comment.gradeBeanLists.get(arg2).getGradeID();
|
|
|
+ }
|
|
|
+ else {
|
|
|
tvBrand.setTextColor(Color.parseColor("#000000"));
|
|
|
tvBrand.setText(Comment.brandLists.get(arg2).getBrandName()
|
|
|
.toString());
|
|
|
@@ -841,12 +913,15 @@ public class InventoryListActivity extends IBossBaseActivity implements
|
|
|
params.put("WarehouseCode", WarehouseCode + "");
|
|
|
params.put("VarietyID", variety + "");
|
|
|
params.put("BrandID", BrandID + "");
|
|
|
+ params.put("GradeID", GradeID + "");
|
|
|
params.put("PageSize", size);
|
|
|
params.put("PageNum", page);
|
|
|
params.put("isfilterQuantityEqZero",
|
|
|
String.valueOf(isFilterQuantityEqZero));
|
|
|
|
|
|
params.put("Specification", specification);
|
|
|
+ params.put("ColorNumber", colornumber);
|
|
|
+ params.put("PositionNumber", positionnumber);
|
|
|
|
|
|
client.post(String.format(Constants.URL, mServerAddressIp,
|
|
|
mServerAddressPort), params, new AsyncHttpResponseHandler(
|