|
|
@@ -1,12 +1,20 @@
|
|
|
package com.uas.yitao_productionline.fragment;
|
|
|
|
|
|
+import android.app.Activity;
|
|
|
+import android.app.AlertDialog;
|
|
|
+import android.content.DialogInterface;
|
|
|
+import android.content.Intent;
|
|
|
import android.graphics.Color;
|
|
|
import android.os.Handler;
|
|
|
import android.support.v4.content.ContextCompat;
|
|
|
+import android.text.Editable;
|
|
|
+import android.text.TextWatcher;
|
|
|
import android.util.Log;
|
|
|
import android.view.KeyEvent;
|
|
|
import android.view.View;
|
|
|
import android.view.WindowManager;
|
|
|
+import android.view.inputmethod.EditorInfo;
|
|
|
+import android.widget.ImageView;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
@@ -20,17 +28,22 @@ import com.bin.david.form.data.column.Column;
|
|
|
import com.bin.david.form.data.format.bg.BaseCellBackgroundFormat;
|
|
|
import com.bin.david.form.data.style.FontStyle;
|
|
|
import com.bin.david.form.data.table.TableData;
|
|
|
+import com.bin.david.form.listener.OnColumnItemClickListener;
|
|
|
import com.uas.yitao_productionline.R;
|
|
|
import com.uas.yitao_productionline.application.PdaApplication;
|
|
|
-import com.uas.yitao_productionline.bean.CollectNotBean;
|
|
|
+import com.uas.yitao_productionline.bean.FilldataGridViewBean;
|
|
|
import com.uas.yitao_productionline.bean.SourceLocationBean;
|
|
|
import com.uas.yitao_productionline.global.GloableParams;
|
|
|
+import com.uas.yitao_productionline.util.CameraUtil;
|
|
|
import com.uas.yitao_productionline.util.CommonUtil;
|
|
|
import com.uas.yitao_productionline.util.Constants;
|
|
|
+import com.uas.yitao_productionline.util.FastjsonUtil;
|
|
|
import com.uas.yitao_productionline.util.HttpCallback;
|
|
|
import com.uas.yitao_productionline.util.HttpParams;
|
|
|
import com.uas.yitao_productionline.util.VolleyRequest;
|
|
|
import com.uas.yitao_productionline.view.ClearableEditText;
|
|
|
+import com.uuzuche.lib_zxing.activity.CaptureActivity;
|
|
|
+import com.uuzuche.lib_zxing.activity.CodeUtils;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
@@ -38,19 +51,27 @@ import java.util.List;
|
|
|
/**
|
|
|
* Created by cjh-sail on 2023-03-08
|
|
|
*/
|
|
|
-public class PostStockAdvocateFragment extends BaseFragment{
|
|
|
-
|
|
|
+public class PostStockAdvocateFragment extends BaseFragment implements OnColumnItemClickListener<String> {
|
|
|
+ private int mFocusId;
|
|
|
+ private static final int SCAN_BARCODE_CODE = 111;
|
|
|
+ private static final int SCAN_BARCODE_CODE2 = 222;
|
|
|
private SmartTable mSmartTable;
|
|
|
- private Column<String> mTypeColumn, mcontentColumn, mCnColumn, mOrispeccodeColumn, mCodeColumn, mDetailColumn,mDeleteColumn;
|
|
|
- private TableData<CollectNotBean> mTableData;
|
|
|
- private List<CollectNotBean> mFilterStorageInBeans;
|
|
|
- private ClearableEditText modify_barcode_quantity_barcode_cet;
|
|
|
- private ClearableEditText ce_ma_craftcode;
|
|
|
+ private Column<String> mTypeColumn, mcontentColumn, mCnColumn, mOrispeccodeColumn, mCodeColumn, mMSS_USEQTYColumn, mDetailColumn,mSp_regexColumn,mDeleteColumn;
|
|
|
+ private TableData<FilldataGridViewBean> mTableData;
|
|
|
+ private List<FilldataGridViewBean> mFilterStorageInBeans;
|
|
|
+ private TextView modify_barcode_quantity_barcode_cet;
|
|
|
+ private TextView ce_ma_craftcode;
|
|
|
private TextView tv_step_code;
|
|
|
private TextView tv_sc_code;
|
|
|
private TextView tv_pr_detail;
|
|
|
private SourceLocationBean dataCacheFromMap;
|
|
|
private TextView tv_refresh;
|
|
|
+ private ClearableEditText ce_station;
|
|
|
+ private ImageView iv_station;
|
|
|
+ private ClearableEditText ce_material_lot_number;
|
|
|
+ private ImageView iv_material_lot_number;
|
|
|
+ private TextView tv_hint;
|
|
|
+ private TextView tv_all_delete;
|
|
|
|
|
|
@Override
|
|
|
protected int getLayout() {
|
|
|
@@ -67,17 +88,27 @@ public class PostStockAdvocateFragment extends BaseFragment{
|
|
|
tv_sc_code = root.findViewById(R.id.tv_sc_code);
|
|
|
tv_pr_detail = root.findViewById(R.id.tv_pr_detail);
|
|
|
tv_refresh = root.findViewById(R.id.tv_refresh);
|
|
|
+ mSmartTable = root.findViewById(R.id.jlt_storage_in_filter_list_st);
|
|
|
+ ce_station = root.findViewById(R.id.ce_station);
|
|
|
+ iv_station = root.findViewById(R.id.iv_station);
|
|
|
+ ce_material_lot_number = root.findViewById(R.id.ce_material_lot_number);
|
|
|
+ iv_material_lot_number = root.findViewById(R.id.iv_material_lot_number);
|
|
|
+ tv_hint = root.findViewById(R.id.tv_hint);
|
|
|
+ tv_all_delete = root.findViewById(R.id.tv_all_delete);
|
|
|
|
|
|
+ mSp_regexColumn = new Column<String>("工位", "SP_REGEX");
|
|
|
+ mTypeColumn = new Column<String>("物料编号", "SP_FSONCODE");
|
|
|
+ mcontentColumn = new Column<String>("单位用量", "SP_ONEUSEQTY");
|
|
|
+ mCnColumn = new Column<String>("条码号", "MSS_BARCODE");
|
|
|
+ mOrispeccodeColumn = new Column<String>("备料数", "MSS_QTY");
|
|
|
+ mCodeColumn = new Column<String>("剩余数", "MSS_REMAIN");
|
|
|
+ mMSS_USEQTYColumn = new Column<String>("已用数", "MSS_USEQTY");
|
|
|
+ mDetailColumn = new Column<String>("物料名称", "PR_DETAIL");
|
|
|
+ mDeleteColumn = new Column<String>("删除", "DELETEID");
|
|
|
+ mSp_regexColumn.setFixed(true);
|
|
|
+
|
|
|
+ mDeleteColumn.setOnColumnItemClickListener(this);
|
|
|
|
|
|
- mSmartTable = root.findViewById(R.id.jlt_storage_in_filter_list_st);
|
|
|
- mTypeColumn = new Column<String>("类型", "PIM_TYPE");
|
|
|
- mcontentColumn = new Column<String>("内容", "CONTENT");
|
|
|
- mCnColumn = new Column<String>("数量", "CN");
|
|
|
- mOrispeccodeColumn = new Column<String>("型号", "PR_ORISPECCODE");
|
|
|
- mCodeColumn = new Column<String>("料号", "PR_CODE");
|
|
|
- mDetailColumn = new Column<String>("名称", "PR_DETAIL");
|
|
|
- mDeleteColumn = new Column<String>("删除", "×");
|
|
|
- mDetailColumn.setFixed(true);
|
|
|
mFilterStorageInBeans = new ArrayList<>();
|
|
|
WindowManager wm = mActivity.getWindowManager();
|
|
|
int screenWith = wm.getDefaultDisplay().getWidth();
|
|
|
@@ -105,18 +136,51 @@ public class PostStockAdvocateFragment extends BaseFragment{
|
|
|
|
|
|
@Override
|
|
|
protected void initEvents() {
|
|
|
-
|
|
|
+ iv_station.requestFocus();
|
|
|
+ iv_station.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ if (CameraUtil.hasCamera()) {
|
|
|
+ if (root.findFocus() != null) {
|
|
|
+ mFocusId = root.findFocus().getId();
|
|
|
+ Intent intent = new Intent();
|
|
|
+ intent.setClass(mActivity, CaptureActivity.class);
|
|
|
+ startActivityForResult(intent, SCAN_BARCODE_CODE);
|
|
|
+ } else {
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, "请选择您要操作的输入框");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, getString(R.string.no_camera_detected));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ iv_station.requestFocus();
|
|
|
+ iv_material_lot_number.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ if (CameraUtil.hasCamera()) {
|
|
|
+ if (root.findFocus() != null) {
|
|
|
+ mFocusId = root.findFocus().getId();
|
|
|
+ Intent intent = new Intent();
|
|
|
+ intent.setClass(mActivity, CaptureActivity.class);
|
|
|
+ startActivityForResult(intent, SCAN_BARCODE_CODE2);
|
|
|
+ } else {
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, "请选择您要操作的输入框");
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, getString(R.string.no_camera_detected));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
protected void initDatas() {
|
|
|
-
|
|
|
dataCacheFromMap = (SourceLocationBean) PdaApplication.getDataCacheFromMap(Constants.FLAG.SMT_DEVICE_LINE_CACHES);
|
|
|
-
|
|
|
modify_barcode_quantity_barcode_cet.setText(dataCacheFromMap.getMa_code());
|
|
|
ce_ma_craftcode.setText(dataCacheFromMap.getMa_craftcode());
|
|
|
tv_step_code.setText(dataCacheFromMap.getStep_code());
|
|
|
- tv_sc_code.setText(dataCacheFromMap.getSc_code());
|
|
|
+ tv_sc_code.setText(dataCacheFromMap.getMa_prodcode());
|
|
|
tv_pr_detail.setText(dataCacheFromMap.getPr_detail());
|
|
|
|
|
|
|
|
|
@@ -127,9 +191,75 @@ public class PostStockAdvocateFragment extends BaseFragment{
|
|
|
getCollectList();
|
|
|
}
|
|
|
});
|
|
|
+ ce_station.requestFocus();
|
|
|
+ ce_material_lot_number.setEnabled(false);
|
|
|
+ ce_material_lot_number.setFocusable(false);
|
|
|
+ ce_material_lot_number.setFocusableInTouchMode(false);
|
|
|
+ ce_station.addTextChangedListener(new TextWatcher() {
|
|
|
+ @Override
|
|
|
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onTextChanged(CharSequence s, int start, int before, int count) {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void afterTextChanged(Editable s) {
|
|
|
+ if (s == null || s.length() == 0) {
|
|
|
+ ce_material_lot_number.setEnabled(false);
|
|
|
+ ce_material_lot_number.setFocusable(false);
|
|
|
+ ce_material_lot_number.setFocusableInTouchMode(false);
|
|
|
+ } else {
|
|
|
+ ce_material_lot_number.setEnabled(true);
|
|
|
+ ce_material_lot_number.setFocusable(true);
|
|
|
+ ce_material_lot_number.setFocusableInTouchMode(true);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ ce_station.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
|
|
+ @Override
|
|
|
+ public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
|
|
+ if (actionId == EditorInfo.IME_ACTION_DONE
|
|
|
+ || actionId == EditorInfo.IME_ACTION_SEND
|
|
|
+ || (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
|
|
|
|
|
|
+ getPositionLocation();
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ ce_material_lot_number.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
|
|
+ @Override
|
|
|
+ public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
|
|
+ if (actionId == EditorInfo.IME_ACTION_DONE
|
|
|
+ || actionId == EditorInfo.IME_ACTION_SEND
|
|
|
+ || (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
|
|
|
|
|
|
+ getDataByBarcode();
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
+ //全部删除
|
|
|
+ tv_all_delete.setOnClickListener(new View.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(View v) {
|
|
|
+ new AlertDialog.Builder(getActivity()).setTitle("提示").setMessage("确定要全部下料吗?")
|
|
|
+ .setPositiveButton(getString(R.string.confirm), new DialogInterface.OnClickListener() {
|
|
|
+ @Override
|
|
|
+ public void onClick(DialogInterface dialog, int which) {
|
|
|
+ setalldelete();
|
|
|
+
|
|
|
+ }
|
|
|
+ }).setNegativeButton(getString(R.string.cancel), null).create().show();
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -159,21 +289,32 @@ public class PostStockAdvocateFragment extends BaseFragment{
|
|
|
String result = o.toString();
|
|
|
JSONObject resultObject = JSON.parseObject(result);
|
|
|
JSONArray dataArray = resultObject.getJSONArray("data");
|
|
|
-// List<CollectNotBean> list=new ArrayList<>();
|
|
|
-// if (dataArray != null && dataArray.size() > 0) {
|
|
|
-// for (int i = 0; i < dataArray.size(); i++) {
|
|
|
-// JSONObject dataObject = dataArray.getJSONObject(i);
|
|
|
-// if (dataObject != null) {
|
|
|
-//
|
|
|
-// CollectNotBean collectListBean = new CollectNotBean();
|
|
|
-//// collectListBean.setPIM_TYPE(FastjsonUtil.getText(dataObject, "PIM_TYPE"));
|
|
|
-// list.add(collectListBean);
|
|
|
-// }
|
|
|
-// }
|
|
|
-// }
|
|
|
-// mFilterStorageInBeans = list;//PI_INOUTNO
|
|
|
-// setFilterTableData(mFilterStorageInBeans);
|
|
|
+ List<FilldataGridViewBean> list=new ArrayList<>();
|
|
|
+ list.clear();
|
|
|
+ if (dataArray != null && dataArray.size() > 0) {
|
|
|
+ for (int i = 0; i < dataArray.size(); i++) {
|
|
|
+ JSONObject dataObject = dataArray.getJSONObject(i);
|
|
|
+ if (dataObject != null) {
|
|
|
+ FilldataGridViewBean collectListBean = new FilldataGridViewBean();
|
|
|
+ collectListBean.setSP_FSONCODE(FastjsonUtil.getText(dataObject, "SP_FSONCODE"));
|
|
|
+ collectListBean.setSP_ONEUSEQTY(FastjsonUtil.getText(dataObject, "SP_ONEUSEQTY"));
|
|
|
+ collectListBean.setMSS_BARCODE(FastjsonUtil.getText(dataObject, "MSS_BARCODE"));
|
|
|
+ collectListBean.setMSS_QTY(FastjsonUtil.getText(dataObject, "MSS_QTY"));
|
|
|
+ collectListBean.setMSS_REMAIN(FastjsonUtil.getText(dataObject, "MSS_REMAIN"));
|
|
|
+ collectListBean.setMSS_USEQTY(FastjsonUtil.getText(dataObject, "MSS_USEQTY"));
|
|
|
+ collectListBean.setPR_DETAIL(FastjsonUtil.getText(dataObject, "PR_DETAIL"));
|
|
|
+ collectListBean.setSP_REGEX(FastjsonUtil.getText(dataObject, "SP_REGEX"));
|
|
|
+ collectListBean.setMSS_ID(FastjsonUtil.getText(dataObject, "MSS_ID"));
|
|
|
+ collectListBean.setDELETEID("x");
|
|
|
+
|
|
|
+ list.add(collectListBean);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ mFilterStorageInBeans = list;//PI_INOUTNO
|
|
|
+ setFilterTableData(mFilterStorageInBeans);
|
|
|
} catch (Exception e) {
|
|
|
+ setFilterTableData(mFilterStorageInBeans);
|
|
|
e.printStackTrace();
|
|
|
progressDialog.dismiss();
|
|
|
}
|
|
|
@@ -187,9 +328,9 @@ public class PostStockAdvocateFragment extends BaseFragment{
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
- private void setFilterTableData(List<CollectNotBean> filterTableData) {
|
|
|
- mTableData = new TableData<CollectNotBean>("入库单列表", filterTableData,
|
|
|
- mTypeColumn, mcontentColumn, mCnColumn, mOrispeccodeColumn, mCodeColumn, mDetailColumn,mDeleteColumn);
|
|
|
+ private void setFilterTableData(List<FilldataGridViewBean> filterTableData) {
|
|
|
+ mTableData = new TableData<FilldataGridViewBean>("入库单列表", filterTableData,
|
|
|
+ mSp_regexColumn , mTypeColumn,mcontentColumn, mCnColumn, mOrispeccodeColumn, mCodeColumn, mMSS_USEQTYColumn,mDetailColumn,mDeleteColumn);
|
|
|
mSmartTable.setTableData(mTableData);
|
|
|
// mSmartTable.requestLayout();
|
|
|
new Handler().postDelayed(new Runnable() {
|
|
|
@@ -199,6 +340,128 @@ public class PostStockAdvocateFragment extends BaseFragment{
|
|
|
}
|
|
|
}, 100);
|
|
|
}
|
|
|
+ public void getPositionLocation(){
|
|
|
+ dataCacheFromMap = (SourceLocationBean) PdaApplication.getDataCacheFromMap(Constants.FLAG.SMT_DEVICE_LINE_CACHES);
|
|
|
+ ArrayList<SourceLocationBean> list=new ArrayList<>();
|
|
|
+ list.add(dataCacheFromMap);
|
|
|
+ JSONArray jsonArray = new JSONArray();
|
|
|
+ jsonArray.add(list);
|
|
|
+ String substring = jsonArray.toString().substring(0, jsonArray.toString().length() - 1);//去除尾部
|
|
|
+ String substring1 = substring.substring(1, substring.length());//去除首部
|
|
|
+ progressDialog.show();
|
|
|
+ VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
+ .url(GloableParams.ADDRESS_SMT_POSITIONLOCATION)
|
|
|
+ .method(Request.Method.POST)
|
|
|
+ .tag(TAG + "getindatalist")
|
|
|
+ .flag(0)
|
|
|
+ .addParam("linemessage",substring1)
|
|
|
+ .addParam("location",ce_station.getText().toString().trim())
|
|
|
+ .build(), new HttpCallback() {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ ce_material_lot_number.requestFocus();
|
|
|
+ ce_station.setSelection(ce_material_lot_number.getText().toString().length());
|
|
|
+ String result = o.toString();
|
|
|
+ Log.e("result",result);
|
|
|
+ com.alibaba.fastjson.JSONObject resultObject = JSON.parseObject(result);
|
|
|
+ String data = FastjsonUtil.getText(resultObject, "data");
|
|
|
+ setColorText(getResources().getColor(R.color.green),data);
|
|
|
+ }
|
|
|
+ @Override
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ setColorText(getResources().getColor(R.color.red),failStr);
|
|
|
+ ce_station.setText("");
|
|
|
+ setFilterTableData(mFilterStorageInBeans);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ public void getDataByBarcode(){
|
|
|
+ dataCacheFromMap = (SourceLocationBean) PdaApplication.getDataCacheFromMap(Constants.FLAG.SMT_DEVICE_LINE_CACHES);
|
|
|
+ ArrayList<SourceLocationBean> list=new ArrayList<>();
|
|
|
+ list.add(dataCacheFromMap);
|
|
|
+ JSONArray jsonArray = new JSONArray();
|
|
|
+ jsonArray.add(list);
|
|
|
+ String substring = jsonArray.toString().substring(0, jsonArray.toString().length() - 1);//去除尾部
|
|
|
+ String substring1 = substring.substring(1, substring.length());//去除首部
|
|
|
+ progressDialog.show();
|
|
|
+ VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
+ .url(GloableParams.ADDRESS_SMT_POSITIONBARCODE)
|
|
|
+ .method(Request.Method.POST)
|
|
|
+ .tag(TAG + "getindatalist")
|
|
|
+ .flag(0)
|
|
|
+ .addParam("linemessage",substring1)
|
|
|
+ .addParam("location",ce_station.getText().toString().trim())
|
|
|
+ .addParam("barcode",ce_material_lot_number.getText().toString().trim())
|
|
|
+ .build(), new HttpCallback() {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ String result = o.toString();
|
|
|
+ Log.e("result",result);
|
|
|
+ com.alibaba.fastjson.JSONObject resultObject = JSON.parseObject(result);
|
|
|
+ String data = FastjsonUtil.getText(resultObject, "data");
|
|
|
+ setColorText(getResources().getColor(R.color.green),data);
|
|
|
+ getCollectList();
|
|
|
+ ce_material_lot_number.setText("");
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ ce_material_lot_number.setText("");
|
|
|
+ setColorText(getResources().getColor(R.color.red),failStr);
|
|
|
+ setFilterTableData(mFilterStorageInBeans);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public void getdePositionBarcode(String mss_id,String barcode){
|
|
|
+ dataCacheFromMap = (SourceLocationBean) PdaApplication.getDataCacheFromMap(Constants.FLAG.SMT_DEVICE_LINE_CACHES);
|
|
|
+ ArrayList<SourceLocationBean> list=new ArrayList<>();
|
|
|
+ list.add(dataCacheFromMap);
|
|
|
+ JSONArray jsonArray = new JSONArray();
|
|
|
+ jsonArray.add(list);
|
|
|
+ String substring = jsonArray.toString().substring(0, jsonArray.toString().length() - 1);//去除尾部
|
|
|
+ String substring1 = substring.substring(1, substring.length());//去除首部
|
|
|
+ progressDialog.show();
|
|
|
+ VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
+ .url(GloableParams.ADDRESS_SMT_DEPOSITIONBARCODE)
|
|
|
+ .method(Request.Method.POST)
|
|
|
+ .tag(TAG + "getindatalist")
|
|
|
+ .flag(0)
|
|
|
+ .addParam("linemessage",substring1)
|
|
|
+ .addParam("mss_id",mss_id)
|
|
|
+ .addParam("barcode",barcode)
|
|
|
+ .build(), new HttpCallback() {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ String result = o.toString();
|
|
|
+ com.alibaba.fastjson.JSONObject resultObject = JSON.parseObject(result);
|
|
|
+ String data = FastjsonUtil.getText(resultObject, "data");
|
|
|
+ setColorText(getResources().getColor(R.color.green),data);
|
|
|
+ getCollectList();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ setColorText(getResources().getColor(R.color.red),failStr);
|
|
|
+ setFilterTableData(mFilterStorageInBeans);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setColorText(int color,String text){
|
|
|
+ tv_hint.setTextColor(color);
|
|
|
+ tv_hint.setText(text);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
@Override
|
|
|
public boolean onKeyDown(int keyCode, KeyEvent event) {
|
|
|
return false;
|
|
|
@@ -207,5 +470,106 @@ public class PostStockAdvocateFragment extends BaseFragment{
|
|
|
@Override
|
|
|
public boolean onFragmentBackPressed() {
|
|
|
return false;
|
|
|
+ }
|
|
|
+ @Override
|
|
|
+ public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
|
|
+ super.onActivityResult(requestCode, resultCode, data);
|
|
|
+ if (resultCode != Activity.RESULT_OK) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (requestCode == SCAN_BARCODE_CODE && data != null) {
|
|
|
+ if (data.getExtras() != null) {
|
|
|
+ String result = data.getExtras().getString(CodeUtils.RESULT_STRING);
|
|
|
+ if (mFocusId == R.id.ce_station) {
|
|
|
+ ce_station.setText(result);
|
|
|
+ ce_station.setSelection(result.length());
|
|
|
+ getPositionLocation();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (requestCode == SCAN_BARCODE_CODE2 && data != null) {
|
|
|
+ if (data.getExtras() != null) {
|
|
|
+ String result = data.getExtras().getString(CodeUtils.RESULT_STRING);
|
|
|
+ if (mFocusId == R.id.ce_material_lot_number) {
|
|
|
+ ce_material_lot_number.setText(result);
|
|
|
+ ce_material_lot_number.setSelection(result.length());
|
|
|
+ getDataByBarcode();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //表格点击
|
|
|
+ @Override
|
|
|
+ public void onClick(Column<String> column, String s, String s2, int i) {
|
|
|
+ String mss_id = mFilterStorageInBeans.get(i).getMSS_ID();
|
|
|
+ String mss_barcode = mFilterStorageInBeans.get(i).getMSS_BARCODE();
|
|
|
+ if (!mss_id.isEmpty()){
|
|
|
+ if (!mss_id.equals("0")){
|
|
|
+ getdePositionBarcode(mss_id,mss_barcode);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public void setalldelete(){
|
|
|
+ ArrayList<String> jsonList=new ArrayList<>();
|
|
|
+ jsonList.clear();
|
|
|
+ for (int i=0;i<mFilterStorageInBeans.size();i++){
|
|
|
+ if (!mFilterStorageInBeans.get(i).getMSS_ID().equals("0")){
|
|
|
+ jsonList.add(mFilterStorageInBeans.get(i).getMSS_ID());
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ JSONArray jsonArrayall = new JSONArray();
|
|
|
+ jsonArrayall.add(jsonList);
|
|
|
+ String allsubstring = jsonArrayall.toString().substring(0, jsonArrayall.toString().length() - 1);//去除尾部
|
|
|
+ String allsubstring1 = allsubstring.substring(1, allsubstring.length());//去除首部
|
|
|
+ String substringall = allsubstring1.substring(0, allsubstring1.length() - 1);
|
|
|
+ String substring1all = substringall.substring(1, substringall.length());
|
|
|
+ String replace = substring1all.replace("\"", "");
|
|
|
+
|
|
|
+ dataCacheFromMap = (SourceLocationBean) PdaApplication.getDataCacheFromMap(Constants.FLAG.SMT_DEVICE_LINE_CACHES);
|
|
|
+ ArrayList<SourceLocationBean> list=new ArrayList<>();
|
|
|
+ list.add(dataCacheFromMap);
|
|
|
+ JSONArray jsonArray = new JSONArray();
|
|
|
+ jsonArray.add(list);
|
|
|
+ String substring = jsonArray.toString().substring(0, jsonArray.toString().length() - 1);//去除尾部
|
|
|
+ String substring1 = substring.substring(1, substring.length());//去除首部
|
|
|
+ progressDialog.show();
|
|
|
+ VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
+ .url(GloableParams.ADDRESS_SMT_DEALLPOSITIONBARCODE)
|
|
|
+ .method(Request.Method.POST)
|
|
|
+ .tag(TAG + "getindatalist")
|
|
|
+ .flag(0)
|
|
|
+ .addParam("linemessage",substring1)
|
|
|
+ .addParam("mss_idlist",replace)
|
|
|
+ .build(), new HttpCallback() {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ String result = o.toString();
|
|
|
+ com.alibaba.fastjson.JSONObject resultObject = JSON.parseObject(result);
|
|
|
+ String data = FastjsonUtil.getText(resultObject, "data");
|
|
|
+ setColorText(getResources().getColor(R.color.green),data);
|
|
|
+ getCollectList();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ setColorText(getResources().getColor(R.color.red),failStr);
|
|
|
+ setFilterTableData(mFilterStorageInBeans);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|