|
@@ -16,14 +16,13 @@ import com.handmark.pulltorefresh.library.PullToRefreshBase;
|
|
|
import com.handmark.pulltorefresh.library.PullToRefreshListView;
|
|
|
import com.uas.pda_smart_com.R;
|
|
|
import com.uas.pda_smart_com.activity.FunctionActivity;
|
|
|
-import com.uas.pda_smart_com.adapter.StorageRechargeInspectionAdapter;
|
|
|
-import com.uas.pda_smart_com.bean.StorageRechargeInspectionBean;
|
|
|
+import com.uas.pda_smart_com.adapter.InventoryDetailsQueryAdapter;
|
|
|
+import com.uas.pda_smart_com.bean.InventoryDetailsQueryBean;
|
|
|
import com.uas.pda_smart_com.global.GloableParams;
|
|
|
import com.uas.pda_smart_com.listener.MyEditorActionListener;
|
|
|
import com.uas.pda_smart_com.util.CommonUtil;
|
|
|
import com.uas.pda_smart_com.util.Constants;
|
|
|
import com.uas.pda_smart_com.util.FastjsonUtil;
|
|
|
-import com.uas.pda_smart_com.util.FragmentUtils;
|
|
|
import com.uas.pda_smart_com.util.HttpCallback;
|
|
|
import com.uas.pda_smart_com.util.HttpParams;
|
|
|
import com.uas.pda_smart_com.util.JsonUtils;
|
|
@@ -45,8 +44,8 @@ public class InventoryDetailsQueryFragment extends BaseFragment implements HttpC
|
|
|
private String mKeyword = "";
|
|
|
private int mPageIndex = 1, mPageSize = 10;
|
|
|
private EmptyLayout mEmptyLayout;
|
|
|
- private List<StorageRechargeInspectionBean> mStorageRechargeInspectionBeans;
|
|
|
- private StorageRechargeInspectionAdapter mStorageRechargeInspectionAdapter;
|
|
|
+ private List<InventoryDetailsQueryBean> inventoryDetailsQueryBeans;
|
|
|
+ private InventoryDetailsQueryAdapter inventoryDetailsQueryAdapter;
|
|
|
|
|
|
@Override
|
|
|
protected int getLayout() {
|
|
@@ -70,10 +69,10 @@ public class InventoryDetailsQueryFragment extends BaseFragment implements HttpC
|
|
|
mSearchButton = root.findViewById(R.id.storage_recharge_search_btn);
|
|
|
mPullToRefreshListView = root.findViewById(R.id.storage_recharge_list_lv);
|
|
|
mPullToRefreshListView.setMode(PullToRefreshBase.Mode.BOTH);
|
|
|
- mStorageRechargeInspectionBeans = new ArrayList<>();
|
|
|
- mStorageRechargeInspectionAdapter = new StorageRechargeInspectionAdapter(mActivity, mStorageRechargeInspectionBeans);
|
|
|
- mStorageRechargeInspectionAdapter.setItemType(StorageRechargeInspectionAdapter.TYPE_STORAGE_RECHARGE);
|
|
|
- mPullToRefreshListView.setAdapter(mStorageRechargeInspectionAdapter);
|
|
|
+ inventoryDetailsQueryBeans = new ArrayList<>();
|
|
|
+ inventoryDetailsQueryAdapter = new InventoryDetailsQueryAdapter(mActivity, inventoryDetailsQueryBeans);
|
|
|
+// inventoryDetailsQueryAdapter.setItemType(StorageRechargeInspectionAdapter.TYPE_STORAGE_RECHARGE);
|
|
|
+ mPullToRefreshListView.setAdapter(inventoryDetailsQueryAdapter);
|
|
|
|
|
|
mEmptyLayout = new EmptyLayout(mActivity, mPullToRefreshListView.getRefreshableView());
|
|
|
mEmptyLayout.setShowLoadingButton(false);
|
|
@@ -121,22 +120,22 @@ public class InventoryDetailsQueryFragment extends BaseFragment implements HttpC
|
|
|
mPullToRefreshListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
|
|
@Override
|
|
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
|
|
- final int reallyPosition = (int) parent.getItemIdAtPosition(position);
|
|
|
- StorageRechargeInspectionBean storageRechargeInspectionBean = mStorageRechargeInspectionBeans.get(reallyPosition);
|
|
|
- StorageRechargeDetailFragment fragment = new StorageRechargeDetailFragment();
|
|
|
-
|
|
|
- fragment.setOnRechargeSuccessListener(new StorageRechargeDetailFragment.OnRechargeSuccessListener() {
|
|
|
- @Override
|
|
|
- public void onRechargeSuccess() {
|
|
|
- mStorageRechargeInspectionBeans.remove(reallyPosition);
|
|
|
- mStorageRechargeInspectionAdapter.notifyDataSetChanged();
|
|
|
- }
|
|
|
- });
|
|
|
- Bundle bundle = new Bundle();
|
|
|
- bundle.putSerializable(Constants.FLAG.FLAG_RECHARGE_DETAIL, storageRechargeInspectionBean);
|
|
|
- fragment.setArguments(bundle);
|
|
|
-
|
|
|
- FragmentUtils.switchFragment(InventoryDetailsQueryFragment.this, fragment);
|
|
|
+// final int reallyPosition = (int) parent.getItemIdAtPosition(position);
|
|
|
+// InventoryDetailsQueryBean inventoryDetailsQueryBean = inventoryDetailsQueryBeans.get(reallyPosition);
|
|
|
+// StorageRechargeDetailFragment fragment = new StorageRechargeDetailFragment();
|
|
|
+//
|
|
|
+// fragment.setOnRechargeSuccessListener(new StorageRechargeDetailFragment.OnRechargeSuccessListener() {
|
|
|
+// @Override
|
|
|
+// public void onRechargeSuccess() {
|
|
|
+// inventoryDetailsQueryBeans.remove(reallyPosition);
|
|
|
+// inventoryDetailsQueryAdapter.notifyDataSetChanged();
|
|
|
+// }
|
|
|
+// });
|
|
|
+// Bundle bundle = new Bundle();
|
|
|
+// bundle.putSerializable(Constants.FLAG.FLAG_RECHARGE_DETAIL, inventoryDetailsQueryBean);
|
|
|
+// fragment.setArguments(bundle);
|
|
|
+//
|
|
|
+// FragmentUtils.switchFragment(InventoryDetailsQueryFragment.this, fragment);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -145,8 +144,8 @@ public class InventoryDetailsQueryFragment extends BaseFragment implements HttpC
|
|
|
protected void initDatas() {
|
|
|
mKeyword = "";
|
|
|
mPageIndex = 1;
|
|
|
- progressDialog.show();
|
|
|
- getList();
|
|
|
+// progressDialog.show();
|
|
|
+// getList();
|
|
|
}
|
|
|
|
|
|
private void getList() {
|
|
@@ -183,7 +182,7 @@ public class InventoryDetailsQueryFragment extends BaseFragment implements HttpC
|
|
|
}
|
|
|
try {
|
|
|
if (mPageIndex == 1) {
|
|
|
- mStorageRechargeInspectionBeans.clear();
|
|
|
+ inventoryDetailsQueryBeans.clear();
|
|
|
}
|
|
|
if (o != null) {
|
|
|
String result = o.toString();
|
|
@@ -194,50 +193,60 @@ public class InventoryDetailsQueryFragment extends BaseFragment implements HttpC
|
|
|
for (int i = 0; i < dataArray.size(); i++) {
|
|
|
JSONObject dataObject = dataArray.getJSONObject(i);
|
|
|
if (dataObject != null) {
|
|
|
- JSONObject mainObject = dataObject.getJSONObject("main");
|
|
|
+// JSONObject mainObject = dataObject.getJSONObject("main");
|
|
|
+ // private String PD_PICLASS;
|
|
|
+ // private String PD_INOUTNO;
|
|
|
+ // private String PD_PRODCODE;
|
|
|
+ // private int PD_INQTY;
|
|
|
+ // private String PI_DATE;
|
|
|
+ // private String PI_TITLE;
|
|
|
+ // private String PR_DETAIL;
|
|
|
+ // private String PR_SPEC;
|
|
|
+ // private int RN;
|
|
|
+
|
|
|
+ // //返回字段pd_piclass 单据类型,pd_inoutno 单据编号,pd_prodcode 物料编号,pd_inqty 入库数量,pi_date
|
|
|
+ // 入库日期,pi_title 供应商,pr_detail 物料名称,pr_spec 物料规格
|
|
|
|
|
|
- StorageRechargeInspectionBean storageRechargeInspectionBean = new StorageRechargeInspectionBean();
|
|
|
- storageRechargeInspectionBean.setId(FastjsonUtil.getLong(mainObject, "AN_ID"));
|
|
|
- storageRechargeInspectionBean.setCode(FastjsonUtil.getText(mainObject, "AN_CODE"));
|
|
|
- storageRechargeInspectionBean.setBillClass(FastjsonUtil.getText(mainObject, ""));
|
|
|
- storageRechargeInspectionBean.setDate(FastjsonUtil.getLong(mainObject, "AN_DATE"));
|
|
|
- storageRechargeInspectionBean.setStates(FastjsonUtil.getText(mainObject, "AN_STATUS"));
|
|
|
- storageRechargeInspectionBean.setRecorder(FastjsonUtil.getText(mainObject, "AN_RECORDER"));
|
|
|
- storageRechargeInspectionBean.setVendcode(FastjsonUtil.getText(mainObject, "AN_VENDCODE"));
|
|
|
- storageRechargeInspectionBean.setVendname(FastjsonUtil.getText(mainObject, "AN_VENDNAME"));
|
|
|
- storageRechargeInspectionBean.setDetailJson(FastjsonUtil.getText(dataObject, "detail"));
|
|
|
- storageRechargeInspectionBean.setSlipable(FastjsonUtil.getBoolean(dataObject, "ifShowButton"));
|
|
|
- storageRechargeInspectionBean.setAN_INDATE(FastjsonUtil.getText(mainObject, "AN_INDATE"));
|
|
|
|
|
|
- mStorageRechargeInspectionBeans.add(storageRechargeInspectionBean);
|
|
|
+ InventoryDetailsQueryBean inventoryDetailsQueryBean = new InventoryDetailsQueryBean();
|
|
|
+ inventoryDetailsQueryBean.setPD_PICLASS(FastjsonUtil.getText(dataObject, "PD_PICLASS"));
|
|
|
+ inventoryDetailsQueryBean.setPD_INOUTNO(FastjsonUtil.getText(dataObject, "PD_INOUTNO"));
|
|
|
+ inventoryDetailsQueryBean.setPD_PRODCODE(FastjsonUtil.getText(dataObject, "PD_PRODCODE"));
|
|
|
+ inventoryDetailsQueryBean.setPD_INQTY(FastjsonUtil.getInt(dataObject, "PD_INQTY"));
|
|
|
+ inventoryDetailsQueryBean.setPI_DATE(FastjsonUtil.getText(dataObject, "PI_DATE"));
|
|
|
+ inventoryDetailsQueryBean.setPI_TITLE(FastjsonUtil.getText(dataObject, "PI_TITLE"));
|
|
|
+ inventoryDetailsQueryBean.setPR_DETAIL(FastjsonUtil.getText(dataObject, "PR_DETAIL"));
|
|
|
+ inventoryDetailsQueryBean.setPR_SPEC(FastjsonUtil.getText(dataObject, "PR_SPEC"));
|
|
|
+ inventoryDetailsQueryBean.setRN(FastjsonUtil.getInt(dataObject, "RN"));
|
|
|
+ inventoryDetailsQueryBeans.add(inventoryDetailsQueryBean);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- mStorageRechargeInspectionAdapter.notifyDataSetChanged();
|
|
|
- if (mStorageRechargeInspectionBeans.size() == 0) {
|
|
|
+ inventoryDetailsQueryAdapter.notifyDataSetChanged();
|
|
|
+ if (inventoryDetailsQueryBeans.size() == 0) {
|
|
|
mEmptyLayout.showEmpty();
|
|
|
}
|
|
|
} else {
|
|
|
- mStorageRechargeInspectionAdapter.notifyDataSetChanged();
|
|
|
- if (mStorageRechargeInspectionBeans.size() == 0) {
|
|
|
+ inventoryDetailsQueryAdapter.notifyDataSetChanged();
|
|
|
+ if (inventoryDetailsQueryBeans.size() == 0) {
|
|
|
mEmptyLayout.showEmpty();
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- mStorageRechargeInspectionAdapter.notifyDataSetChanged();
|
|
|
- if (mStorageRechargeInspectionBeans.size() == 0) {
|
|
|
+ inventoryDetailsQueryAdapter.notifyDataSetChanged();
|
|
|
+ if (inventoryDetailsQueryBeans.size() == 0) {
|
|
|
mEmptyLayout.showEmpty();
|
|
|
}
|
|
|
}
|
|
|
} else {
|
|
|
- mStorageRechargeInspectionAdapter.notifyDataSetChanged();
|
|
|
- if (mStorageRechargeInspectionBeans.size() == 0) {
|
|
|
+ inventoryDetailsQueryAdapter.notifyDataSetChanged();
|
|
|
+ if (inventoryDetailsQueryBeans.size() == 0) {
|
|
|
mEmptyLayout.showEmpty();
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
- mStorageRechargeInspectionAdapter.notifyDataSetChanged();
|
|
|
- if (mStorageRechargeInspectionBeans.size() == 0) {
|
|
|
+ inventoryDetailsQueryAdapter.notifyDataSetChanged();
|
|
|
+ if (inventoryDetailsQueryBeans.size() == 0) {
|
|
|
mEmptyLayout.showEmpty();
|
|
|
}
|
|
|
}
|
|
@@ -250,10 +259,10 @@ public class InventoryDetailsQueryFragment extends BaseFragment implements HttpC
|
|
|
mPullToRefreshListView.onRefreshComplete();
|
|
|
}
|
|
|
if (mPageIndex == 1) {
|
|
|
- mStorageRechargeInspectionBeans.clear();
|
|
|
+ inventoryDetailsQueryBeans.clear();
|
|
|
mEmptyLayout.setErrorMessage(failStr);
|
|
|
mEmptyLayout.showError();
|
|
|
- mStorageRechargeInspectionAdapter.notifyDataSetChanged();
|
|
|
+ inventoryDetailsQueryAdapter.notifyDataSetChanged();
|
|
|
} else {
|
|
|
mPageIndex--;
|
|
|
CommonUtil.toastNoRepeat(mActivity, failStr);
|