|
|
@@ -5,12 +5,14 @@ import android.content.Intent;
|
|
|
import android.graphics.drawable.BitmapDrawable;
|
|
|
import android.os.Bundle;
|
|
|
import android.support.v4.app.Fragment;
|
|
|
+import android.support.v7.app.AlertDialog;
|
|
|
import android.text.TextUtils;
|
|
|
import android.view.KeyEvent;
|
|
|
import android.view.View;
|
|
|
import android.widget.Button;
|
|
|
import android.widget.CheckBox;
|
|
|
import android.widget.CompoundButton;
|
|
|
+import android.widget.EditText;
|
|
|
import android.widget.ImageView;
|
|
|
import android.widget.LinearLayout;
|
|
|
import android.widget.PopupWindow;
|
|
|
@@ -19,8 +21,13 @@ import android.widget.TextView;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.android.volley.Request;
|
|
|
+import com.bin.david.form.core.SmartTable;
|
|
|
+import com.bin.david.form.data.column.Column;
|
|
|
+import com.bin.david.form.data.format.IFormat;
|
|
|
+import com.bin.david.form.data.table.TableData;
|
|
|
import com.uas.pda_smart_com.R;
|
|
|
import com.uas.pda_smart_com.activity.FunctionActivity;
|
|
|
+import com.uas.pda_smart_com.bean.InventoryCollctBean;
|
|
|
import com.uas.pda_smart_com.global.GloableParams;
|
|
|
import com.uas.pda_smart_com.listener.MyEditorActionListener;
|
|
|
import com.uas.pda_smart_com.util.CameraUtil;
|
|
|
@@ -29,11 +36,15 @@ 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.StringUtil;
|
|
|
import com.uas.pda_smart_com.util.VolleyRequest;
|
|
|
import com.uas.pda_smart_com.view.ClearableEditText;
|
|
|
import com.uuzuche.lib_zxing.activity.CaptureActivity;
|
|
|
import com.uuzuche.lib_zxing.activity.CodeUtils;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
/**
|
|
|
* Created by RaoMeng on 2019/3/23
|
|
|
* Desc: 盘点采集页面
|
|
|
@@ -42,12 +53,20 @@ public class InventoryCollectFragment extends BaseFragment implements View.OnCli
|
|
|
private static final int SCAN_BARCODE_CODE = 101;
|
|
|
private ClearableEditText mTagEditText, mBarcodeEditText;
|
|
|
private ImageView mScanImageView;
|
|
|
- private TextView mResultTextView, mNumTextView, mClassTextView;
|
|
|
+ private TextView mResultTextView, mNumTextView, mClassTextView, tvPiInoutno;
|
|
|
private Button mMoreButton;
|
|
|
private PopupWindow mMenuPopupWindow;
|
|
|
private String pi_inoutno, pi_id, pi_class;
|
|
|
private CheckBox cb_caiji;
|
|
|
- private boolean isChecked=false;
|
|
|
+ private boolean isChecked = false;
|
|
|
+
|
|
|
+ private SmartTable mSmartTable;
|
|
|
+ private Column<String> ST_WHCODE, STD_PRODCODE, PR_DETAIL, BAR_LOCATION, PR_SPEC;
|
|
|
+ private Column<Double> STD_BATCHQTY, STD_ACTQTY;
|
|
|
+ private TableData<InventoryCollctBean> mTableData;
|
|
|
+ private List<InventoryCollctBean> mStockTaskMultipleBeans;
|
|
|
+ private CheckBox mCheckBox;
|
|
|
+ private String bar_remain;
|
|
|
|
|
|
@Override
|
|
|
protected int getLayout() {
|
|
|
@@ -66,9 +85,32 @@ public class InventoryCollectFragment extends BaseFragment implements View.OnCli
|
|
|
mResultTextView = root.findViewById(R.id.inventory_collect_result_tv);
|
|
|
mNumTextView = root.findViewById(R.id.inventory_collect_num_tv);
|
|
|
mClassTextView = root.findViewById(R.id.inventory_collect_class_tv);
|
|
|
- cb_caiji=root.findViewById(R.id.cb_caiji);
|
|
|
+ cb_caiji = root.findViewById(R.id.cb_caiji);
|
|
|
+ tvPiInoutno = mActivity.findViewById(R.id.tv_pi_inoutno);
|
|
|
|
|
|
mBarcodeEditText.requestFocus();
|
|
|
+
|
|
|
+ mCheckBox = root.findViewById(R.id.stock_data_summary_cb);
|
|
|
+ mSmartTable = root.findViewById(R.id.st_data);
|
|
|
+ CommonUtil.getDefaultTable(mActivity, mSmartTable);
|
|
|
+ ST_WHCODE = new Column<String>("仓库", "ST_WHCODE");
|
|
|
+ STD_PRODCODE = new Column<String>("料号", "STD_PRODCODE");
|
|
|
+ PR_DETAIL = new Column<String>("名称", "PR_DETAIL");
|
|
|
+ BAR_LOCATION = new Column<String>("储位", "BAR_LOCATION");
|
|
|
+ STD_BATCHQTY = new Column<Double>("账面库存", "STD_BATCHQTY", new IFormat<Double>() {
|
|
|
+ @Override
|
|
|
+ public String format(Double aDouble) {
|
|
|
+ return CommonUtil.doubleFormat(aDouble);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ STD_ACTQTY = new Column<Double>("实盘库存", "STD_ACTQTY", new IFormat<Double>() {
|
|
|
+ @Override
|
|
|
+ public String format(Double aDouble) {
|
|
|
+ return CommonUtil.doubleFormat(aDouble);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ PR_SPEC = new Column<String>("规格", "PR_SPEC");
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -78,99 +120,223 @@ public class InventoryCollectFragment extends BaseFragment implements View.OnCli
|
|
|
cb_caiji.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
@Override
|
|
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
|
|
- InventoryCollectFragment.this.isChecked=isChecked;
|
|
|
+ InventoryCollectFragment.this.isChecked = isChecked;
|
|
|
}
|
|
|
});
|
|
|
-// mTagEditText.setOnFocusChangeListener(new View.OnFocusChangeListen) {
|
|
|
-// @Override
|
|
|
-// public void onFocusChange(View v, boolean hasFocus) {
|
|
|
-// if (!hasFocus) {
|
|
|
-// String tag = mTagEditText.getText().toString().trim();
|
|
|
-// SharedPreUtil.saveString(mActivity, Constants.FLAG.INVENTORY_DC_TIME_CACHE, tag);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// });
|
|
|
-//
|
|
|
-// CommonUtil.setEditorActionListener(mTagEditText, new MyEditorActionListener() {
|
|
|
-// @Override
|
|
|
-// public void MyEditorAction(String text, int actionId, KeyEvent event) {
|
|
|
-// SharedPreUtil.saveString(mActivity, Constants.FLAG.INVENTORY_DC_TIME_CACHE, text);
|
|
|
-// }
|
|
|
-// });
|
|
|
+ // mTagEditText.setOnFocusChangeListener(new View.OnFocusChangeListen) {
|
|
|
+ // @Override
|
|
|
+ // public void onFocusChange(View v, boolean hasFocus) {
|
|
|
+ // if (!hasFocus) {
|
|
|
+ // String tag = mTagEditText.getText().toString().trim();
|
|
|
+ // SharedPreUtil.saveString(mActivity, Constants.FLAG.INVENTORY_DC_TIME_CACHE, tag);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ //
|
|
|
+ // CommonUtil.setEditorActionListener(mTagEditText, new MyEditorActionListener() {
|
|
|
+ // @Override
|
|
|
+ // public void MyEditorAction(String text, int actionId, KeyEvent event) {
|
|
|
+ // SharedPreUtil.saveString(mActivity, Constants.FLAG.INVENTORY_DC_TIME_CACHE, text);
|
|
|
+ // }
|
|
|
+ // });
|
|
|
|
|
|
CommonUtil.setEditorActionListener(mBarcodeEditText, new MyEditorActionListener() {
|
|
|
@Override
|
|
|
public void MyEditorAction(String text, int actionId, KeyEvent event) {
|
|
|
-// String deadLine = mTagEditText.getText().toString().trim();
|
|
|
+ // String deadLine = mTagEditText.getText().toString().trim();
|
|
|
String barcode = mBarcodeEditText.getText().toString().trim();
|
|
|
|
|
|
-// if (TextUtils.isEmpty(deadLine)) {
|
|
|
-// CommonUtil.toastNoRepeat(mActivity, "请输入临界校验日期");
|
|
|
-// return;
|
|
|
-// }
|
|
|
+ // if (TextUtils.isEmpty(deadLine)) {
|
|
|
+ // CommonUtil.toastNoRepeat(mActivity, "请输入临界校验日期");
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
|
|
|
if (TextUtils.isEmpty(barcode)) {
|
|
|
CommonUtil.toastNoRepeat(mActivity, "请采集条码");
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
progressDialog.show();
|
|
|
+ if (isChecked) {
|
|
|
+ VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
+ .url(GloableParams.ADDRESS_BARSTOCK_GETBARCODEINFO)
|
|
|
+ .method(Request.Method.GET)
|
|
|
+ .tag(TAG + "getbarcodeinfo")
|
|
|
+ .flag(0)
|
|
|
+ .addParam("inoutno", pi_inoutno)
|
|
|
+ //.addParam("deadline", deadLine)
|
|
|
+ .addParam("barcode", barcode)
|
|
|
+ .addParam("iscancel", isChecked + "")
|
|
|
+ .build(), new HttpCallback() {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
+ try {
|
|
|
+ mBarcodeEditText.setText("");
|
|
|
+ String result = o.toString();
|
|
|
+ JSONObject resultObject = JSON.parseObject(result);
|
|
|
+ JSONObject dataObject = resultObject.getJSONObject("data");
|
|
|
+ if (dataObject != null) {
|
|
|
+ String type = FastjsonUtil.getText(dataObject, "BI_TYPE");
|
|
|
+ String prompt = "采集成功!";
|
|
|
+ if (!"超期".equals(type)) {
|
|
|
+ mResultTextView.setTextColor(mActivity.getResources().getColor(R.color.black));
|
|
|
+ prompt = "采集成功!";
|
|
|
+ } else {
|
|
|
+ mResultTextView.setTextColor(mActivity.getResources().getColor(R.color.red));
|
|
|
+ prompt = "采集成功!已超期";
|
|
|
+ }
|
|
|
+ mResultTextView.setVisibility(View.VISIBLE);
|
|
|
+ mResultTextView.setText(prompt
|
|
|
+ + "\n物料:" + FastjsonUtil.getText(dataObject, "BI_PRODCODE")
|
|
|
+ // + "\n品牌:" + FastjsonUtil.getText(dataObject, "BI_BRAND")
|
|
|
+ // + "\nLOTNO:" + FastjsonUtil.getText(dataObject, "BI_LOTNO")
|
|
|
+ // + "\nDC:" + FastjsonUtil.getText(dataObject, "BI_DATECODE")
|
|
|
+ + "\n型号:" + FastjsonUtil.getText(dataObject, "PR_ORISPECCODE")
|
|
|
+ + "\n条码号:" + FastjsonUtil.getText(dataObject, "BI_BARCODE")
|
|
|
+ + "\n数量:" + FastjsonUtil.getText(dataObject, "BI_INQTY")
|
|
|
+ );
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
- .url(GloableParams.ADDRESS_BARSTOCK_GETBARCODEINFO)
|
|
|
- .method(Request.Method.GET)
|
|
|
- .tag(TAG + "getbarcodeinfo")
|
|
|
- .flag(0)
|
|
|
- .addParam("inoutno", pi_inoutno)
|
|
|
-// .addParam("deadline", deadLine)
|
|
|
- .addParam("barcode", barcode)
|
|
|
- .addParam("iscancel",isChecked+"")
|
|
|
- .build(), new HttpCallback() {
|
|
|
- @Override
|
|
|
- public void onSuccess(int flag, Object o) throws Exception {
|
|
|
- progressDialog.dismiss();
|
|
|
-
|
|
|
- try {
|
|
|
+ @Override
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
mBarcodeEditText.setText("");
|
|
|
- String result = o.toString();
|
|
|
- JSONObject resultObject = JSON.parseObject(result);
|
|
|
- JSONObject dataObject = resultObject.getJSONObject("data");
|
|
|
- if (dataObject != null) {
|
|
|
- String type = FastjsonUtil.getText(dataObject, "BI_TYPE");
|
|
|
- String prompt = "采集成功!";
|
|
|
- if (!"超期".equals(type)) {
|
|
|
- mResultTextView.setTextColor(mActivity.getResources().getColor(R.color.black));
|
|
|
- prompt = "采集成功!";
|
|
|
- } else {
|
|
|
- mResultTextView.setTextColor(mActivity.getResources().getColor(R.color.red));
|
|
|
- prompt = "采集成功!已超期";
|
|
|
+ progressDialog.dismiss();
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
+ mResultTextView.setVisibility(View.VISIBLE);
|
|
|
+ mResultTextView.setText(failStr);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
+ .url(GloableParams.ADDRESS_GET_BARCODE_DATA)
|
|
|
+ .method(Request.Method.GET)
|
|
|
+ .tag(TAG + "getbarcodeinfo")
|
|
|
+ .flag(0)
|
|
|
+ .addParam("barcode", barcode)
|
|
|
+ .build(), new HttpCallback() {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ bar_remain = "";
|
|
|
+ try {
|
|
|
+ String result = o.toString();
|
|
|
+ JSONObject resultObject = JSON.parseObject(result);
|
|
|
+ JSONObject dataObject = resultObject.getJSONObject("data");
|
|
|
+ if (dataObject != null) {
|
|
|
+ bar_remain = FastjsonUtil.getText(dataObject, "BAR_REMAIN");
|
|
|
}
|
|
|
|
|
|
- mResultTextView.setVisibility(View.VISIBLE);
|
|
|
- mResultTextView.setText(prompt
|
|
|
- + "\n物料:" + FastjsonUtil.getText(dataObject, "BI_PRODCODE")
|
|
|
-// + "\n品牌:" + FastjsonUtil.getText(dataObject, "BI_BRAND")
|
|
|
-// + "\nLOTNO:" + FastjsonUtil.getText(dataObject, "BI_LOTNO")
|
|
|
-// + "\nDC:" + FastjsonUtil.getText(dataObject, "BI_DATECODE")
|
|
|
- + "\n型号:" + FastjsonUtil.getText(dataObject, "PR_ORISPECCODE")
|
|
|
- + "\n条码号:" + FastjsonUtil.getText(dataObject, "BI_BARCODE")
|
|
|
- + "\n数量:" + FastjsonUtil.getText(dataObject, "BI_INQTY")
|
|
|
- );
|
|
|
+ View dialogView = View.inflate(getActivity(), R.layout.dialog_confirm_quantity, null);
|
|
|
+ final EditText modifyEditText = dialogView.findViewById(R.id.recharge_modify_et);
|
|
|
+ final AlertDialog alertDialog = new AlertDialog.Builder(getActivity()).setTitle("确认数量")
|
|
|
+ .setView(dialogView)
|
|
|
+ .setNegativeButton(R.string.cancel, null)
|
|
|
+ .setPositiveButton(R.string.confirm, null).create();
|
|
|
+ alertDialog.show();
|
|
|
+ modifyEditText.setText(bar_remain);
|
|
|
+ modifyEditText.setSelection(modifyEditText.getText().length());
|
|
|
+ alertDialog.getButton(AlertDialog.BUTTON_POSITIVE).setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View view) {
|
|
|
+ if (StringUtil.isEmpty(modifyEditText.getText().toString().trim())) {
|
|
|
+ CommonUtil.toastNoRepeat(getActivity(), "请输入条码数量");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ double quantity = -1;
|
|
|
+ try {
|
|
|
+ quantity = Double.parseDouble(modifyEditText.getText().toString().trim());
|
|
|
+ } catch (Exception e) {
|
|
|
+ CommonUtil.toastNoRepeat(getActivity(), "请输入正确的数字");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (quantity <= 0) {
|
|
|
+ CommonUtil.toastNoRepeat(getActivity(), "数量必须大于0");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
+ .url(GloableParams.ADDRESS_BARSTOCK_GETBARCODEINFO)
|
|
|
+ .method(Request.Method.GET)
|
|
|
+ .tag(TAG + "getbarcodeinfo")
|
|
|
+ .flag(0)
|
|
|
+ .addParam("inoutno", pi_inoutno)
|
|
|
+ //.addParam("deadline", deadLine)
|
|
|
+ .addParam("barcode", barcode)
|
|
|
+ .addParam("iscancel", isChecked + "")
|
|
|
+ .addParam("bar_remain", modifyEditText.getText().toString().trim())
|
|
|
+ .build(), new HttpCallback() {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
+ alertDialog.dismiss();
|
|
|
+ try {
|
|
|
+ mBarcodeEditText.setText("");
|
|
|
+ String result = o.toString();
|
|
|
+ JSONObject resultObject = JSON.parseObject(result);
|
|
|
+ JSONObject dataObject = resultObject.getJSONObject("data");
|
|
|
+ if (dataObject != null) {
|
|
|
+ String type = FastjsonUtil.getText(dataObject, "BI_TYPE");
|
|
|
+ String prompt = "采集成功!";
|
|
|
+ if (!"超期".equals(type)) {
|
|
|
+ mResultTextView.setTextColor(mActivity.getResources().getColor(R.color.black));
|
|
|
+ prompt = "采集成功!";
|
|
|
+ } else {
|
|
|
+ mResultTextView.setTextColor(mActivity.getResources().getColor(R.color.red));
|
|
|
+ prompt = "采集成功!已超期";
|
|
|
+ }
|
|
|
+
|
|
|
+ mResultTextView.setVisibility(View.VISIBLE);
|
|
|
+ mResultTextView.setText(prompt
|
|
|
+ + "\n物料:" + FastjsonUtil.getText(dataObject, "BI_PRODCODE")
|
|
|
+ // + "\n品牌:" + FastjsonUtil.getText(dataObject, "BI_BRAND")
|
|
|
+ // + "\nLOTNO:" + FastjsonUtil.getText(dataObject, "BI_LOTNO")
|
|
|
+ // + "\nDC:" + FastjsonUtil.getText(dataObject, "BI_DATECODE")
|
|
|
+ + "\n型号:" + FastjsonUtil.getText(dataObject, "PR_ORISPECCODE")
|
|
|
+ + "\n条码号:" + FastjsonUtil.getText(dataObject, "BI_BARCODE")
|
|
|
+ + "\n数量:" + FastjsonUtil.getText(dataObject, "BI_INQTY")
|
|
|
+ );
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
+ alertDialog.dismiss();
|
|
|
+ mBarcodeEditText.setText("");
|
|
|
+ progressDialog.dismiss();
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
+ mResultTextView.setVisibility(View.VISIBLE);
|
|
|
+ mResultTextView.setText(failStr);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
}
|
|
|
- }
|
|
|
|
|
|
- @Override
|
|
|
- public void onFail(int flag, String failStr) throws Exception {
|
|
|
- mBarcodeEditText.setText("");
|
|
|
- progressDialog.dismiss();
|
|
|
- CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
- mResultTextView.setVisibility(View.VISIBLE);
|
|
|
- mResultTextView.setText(failStr);
|
|
|
- }
|
|
|
- });
|
|
|
+ @Override
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
+ mBarcodeEditText.setText("");
|
|
|
+ progressDialog.dismiss();
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
+ mResultTextView.setVisibility(View.VISIBLE);
|
|
|
+ mResultTextView.setText(failStr);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ mCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
|
|
+ @Override
|
|
|
+ public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
|
|
+ getDataList();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
@@ -187,13 +353,84 @@ public class InventoryCollectFragment extends BaseFragment implements View.OnCli
|
|
|
mClassTextView.setText(pi_class);
|
|
|
}
|
|
|
|
|
|
-// String deadLine = SharedPreUtil.getString(mActivity, Constants.FLAG.INVENTORY_DC_TIME_CACHE, "");
|
|
|
-// if (!TextUtils.isEmpty(deadLine)) {
|
|
|
-// mTagEditText.setText(deadLine);
|
|
|
-// mBarcodeEditText.requestFocus();
|
|
|
-// } else {
|
|
|
-// mTagEditText.requestFocus();
|
|
|
-// }
|
|
|
+ // String deadLine = SharedPreUtil.getString(mActivity, Constants.FLAG.INVENTORY_DC_TIME_CACHE, "");
|
|
|
+ // if (!TextUtils.isEmpty(deadLine)) {
|
|
|
+ // mTagEditText.setText(deadLine);
|
|
|
+ // mBarcodeEditText.requestFocus();
|
|
|
+ // } else {
|
|
|
+ // mTagEditText.requestFocus();
|
|
|
+ // }
|
|
|
+
|
|
|
+ if (pi_inoutno != null) {
|
|
|
+ tvPiInoutno.setText(pi_inoutno);
|
|
|
+ }
|
|
|
+
|
|
|
+ mStockTaskMultipleBeans = new ArrayList<>();
|
|
|
+ setTableData(mStockTaskMultipleBeans);
|
|
|
+ getDataList();
|
|
|
+ }
|
|
|
+
|
|
|
+ private void getDataList() {
|
|
|
+ progressDialog.show();
|
|
|
+ mStockTaskMultipleBeans.clear();
|
|
|
+ VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
+ .url(GloableParams.ADDRESS_GET_PRE_MATERIAL_LIST)
|
|
|
+ .method(Request.Method.POST)
|
|
|
+ .addParam("code", pi_id)
|
|
|
+ .addParam("showall", mCheckBox.isChecked() ? "-1" : "0")
|
|
|
+ .build(), new HttpCallback() {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ try {
|
|
|
+ String result = o.toString();
|
|
|
+ com.alibaba.fastjson.JSONObject resultObject = JSON.parseObject(result);
|
|
|
+ com.alibaba.fastjson.JSONArray dataArray = resultObject.getJSONArray("data");
|
|
|
+ if (dataArray != null && dataArray.size() > 0) {
|
|
|
+ for (int i = 0; i < dataArray.size(); i++) {
|
|
|
+ com.alibaba.fastjson.JSONObject dataObject = dataArray.getJSONObject(i);
|
|
|
+ if (dataObject != null) {
|
|
|
+ //物料编号pr_code,物料名称pr_detail,出库数量pd_outqty,已采集数量pd_pdaqty,'
|
|
|
+ // 仓库pd_whcode,仓位V_PW_WHCODE,实物库存V_PW_ONHAND,
|
|
|
+ // 条码库存V_BA_REMAIN,型号PR_ORISPECCODE
|
|
|
+ InventoryCollctBean inventoryCollctBean = new InventoryCollctBean();
|
|
|
+ inventoryCollctBean.setST_WHCODE(FastjsonUtil.getText(dataObject, "ST_WHCODE"));
|
|
|
+ inventoryCollctBean.setSTD_PRODCODE(FastjsonUtil.getText(dataObject, "STD_PRODCODE"));
|
|
|
+ inventoryCollctBean.setPR_DETAIL(FastjsonUtil.getText(dataObject, "PR_DETAIL"));
|
|
|
+ inventoryCollctBean.setBAR_LOCATION(FastjsonUtil.getText(dataObject, "BAR_LOCATION"));
|
|
|
+ inventoryCollctBean.setSTD_BATCHQTY(FastjsonUtil.getDouble(dataObject, "STD_BATCHQTY"));
|
|
|
+ inventoryCollctBean.setSTD_ACTQTY(FastjsonUtil.getDouble(dataObject, "STD_ACTQTY"));
|
|
|
+ inventoryCollctBean.setPR_SPEC(FastjsonUtil.getText(dataObject, "PR_SPEC"));
|
|
|
+ mStockTaskMultipleBeans.add(inventoryCollctBean);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ setTableData(mStockTaskMultipleBeans);
|
|
|
+ } catch (Exception e) {
|
|
|
+ setTableData(mStockTaskMultipleBeans);
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
+ setTableData(mStockTaskMultipleBeans);
|
|
|
+ progressDialog.dismiss();
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ private void setTableData(List<InventoryCollctBean> filterTableData) {
|
|
|
+ mTableData = new TableData<InventoryCollctBean>("出库单列表", filterTableData,
|
|
|
+ ST_WHCODE, STD_PRODCODE, PR_DETAIL, BAR_LOCATION, STD_BATCHQTY, STD_ACTQTY, PR_SPEC);
|
|
|
+ mSmartTable.setTableData(mTableData);
|
|
|
+ mSmartTable.postDelayed(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ mSmartTable.postInvalidate();
|
|
|
+ }
|
|
|
+ }, 100);
|
|
|
}
|
|
|
|
|
|
@Override
|