Browse Source

思拓微增加智能上架(感应式)功能,出库采集页面增加料号放大镜及其功能弹窗,该页面所有接口增加料号参数.

songw 1 year ago
parent
commit
83b0ea10cd

+ 66 - 0
app/src/main/java/com/uas/uas_mes_stw/bean/ItemNumberBean.java

@@ -0,0 +1,66 @@
+package com.uas.uas_mes_stw.bean;
+
+public class ItemNumberBean {
+    /**
+     * PD_PRODCODE : 2-009-03-507-02
+     * PD_OUTQTY : 10100
+     * V_RESQTY : 10100
+     * PR_DETAIL : 2521充电板
+     * PR_SPEC : STW-2521-B-V1.2/白灯/A0
+     */
+
+    private String PD_PRODCODE;
+    private int PD_OUTQTY;
+    private int V_RESQTY;
+    private String PR_DETAIL;
+    private String PR_SPEC;
+    private boolean isSelect;   //是否选中
+
+    public String getPD_PRODCODE() {
+        return PD_PRODCODE;
+    }
+
+    public void setPD_PRODCODE(String PD_PRODCODE) {
+        this.PD_PRODCODE = PD_PRODCODE;
+    }
+
+    public int getPD_OUTQTY() {
+        return PD_OUTQTY;
+    }
+
+    public void setPD_OUTQTY(int PD_OUTQTY) {
+        this.PD_OUTQTY = PD_OUTQTY;
+    }
+
+    public int getV_RESQTY() {
+        return V_RESQTY;
+    }
+
+    public void setV_RESQTY(int V_RESQTY) {
+        this.V_RESQTY = V_RESQTY;
+    }
+
+    public String getPR_DETAIL() {
+        return PR_DETAIL;
+    }
+
+    public void setPR_DETAIL(String PR_DETAIL) {
+        this.PR_DETAIL = PR_DETAIL;
+    }
+
+    public String getPR_SPEC() {
+        return PR_SPEC;
+    }
+
+    public void setPR_SPEC(String PR_SPEC) {
+        this.PR_SPEC = PR_SPEC;
+    }
+
+    public boolean isSelect() {
+        return isSelect;
+    }
+
+    public void setSelect(boolean select) {
+        isSelect = select;
+    }
+}

+ 332 - 27
app/src/main/java/com/uas/uas_mes_stw/fragment/IOCOutMakeMaterialOper.java

@@ -11,8 +11,12 @@ import android.net.Uri;
 import android.os.Bundle;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Handler;
 import android.os.Message;
 import android.os.Message;
+import android.support.annotation.Nullable;
 import android.support.v4.app.Fragment;
 import android.support.v4.app.Fragment;
 import android.support.v7.app.AlertDialog;
 import android.support.v7.app.AlertDialog;
+import android.support.v7.widget.DividerItemDecoration;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
 import android.text.Editable;
 import android.text.Editable;
 import android.text.TextUtils;
 import android.text.TextUtils;
 import android.text.TextWatcher;
 import android.text.TextWatcher;
@@ -22,6 +26,7 @@ import android.view.KeyEvent;
 import android.view.LayoutInflater;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.ViewGroup;
+import android.view.Window;
 import android.view.inputmethod.EditorInfo;
 import android.view.inputmethod.EditorInfo;
 import android.widget.AdapterView;
 import android.widget.AdapterView;
 import android.widget.ArrayAdapter;
 import android.widget.ArrayAdapter;
@@ -51,12 +56,15 @@ import com.android.volley.VolleyError;
 import com.android.volley.toolbox.HttpHeaderParser;
 import com.android.volley.toolbox.HttpHeaderParser;
 import com.android.volley.toolbox.JsonObjectRequest;
 import com.android.volley.toolbox.JsonObjectRequest;
 import com.android.volley.toolbox.StringRequest;
 import com.android.volley.toolbox.StringRequest;
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
 import com.uas.uas_mes_stw.R;
 import com.uas.uas_mes_stw.R;
 import com.uas.uas_mes_stw.activity.FunctionActivity;
 import com.uas.uas_mes_stw.activity.FunctionActivity;
 import com.uas.uas_mes_stw.application.PdaApplication;
 import com.uas.uas_mes_stw.application.PdaApplication;
 import com.uas.uas_mes_stw.bean.ErrorMsg;
 import com.uas.uas_mes_stw.bean.ErrorMsg;
 import com.uas.uas_mes_stw.bean.IOCOutMakeMaterialOperMsd;
 import com.uas.uas_mes_stw.bean.IOCOutMakeMaterialOperMsd;
 import com.uas.uas_mes_stw.bean.IOCOutmakeMaterialSplitBean;
 import com.uas.uas_mes_stw.bean.IOCOutmakeMaterialSplitBean;
+import com.uas.uas_mes_stw.bean.ItemNumberBean;
 import com.uas.uas_mes_stw.bean.MaterialInformationBean;
 import com.uas.uas_mes_stw.bean.MaterialInformationBean;
 import com.uas.uas_mes_stw.bean.SubmitNotParam;
 import com.uas.uas_mes_stw.bean.SubmitNotParam;
 import com.uas.uas_mes_stw.bean.WHBreakingBatchBreakingBtnClickEvent;
 import com.uas.uas_mes_stw.bean.WHBreakingBatchBreakingBtnClickEvent;
@@ -78,6 +86,7 @@ import com.uas.uas_mes_stw.util.JsonTools;
 import com.uas.uas_mes_stw.util.JsonUtils;
 import com.uas.uas_mes_stw.util.JsonUtils;
 import com.uas.uas_mes_stw.util.LogUtil;
 import com.uas.uas_mes_stw.util.LogUtil;
 import com.uas.uas_mes_stw.util.PrintUtils;
 import com.uas.uas_mes_stw.util.PrintUtils;
+import com.uas.uas_mes_stw.util.StringUtil;
 import com.uas.uas_mes_stw.util.VolleyRequest;
 import com.uas.uas_mes_stw.util.VolleyRequest;
 import com.uas.uas_mes_stw.view.ClearableEditText;
 import com.uas.uas_mes_stw.view.ClearableEditText;
 import com.uuzuche.lib_zxing.activity.CaptureActivity;
 import com.uuzuche.lib_zxing.activity.CaptureActivity;
@@ -99,6 +108,7 @@ import java.util.concurrent.TimeUnit;
 
 
 import butterknife.ButterKnife;
 import butterknife.ButterKnife;
 import okhttp3.OkHttpClient;
 import okhttp3.OkHttpClient;
+import razerdp.basepopup.BasePopupWindow;
 
 
 /**
 /**
  * Created by RaoMeng on 2016/7/27.
  * Created by RaoMeng on 2016/7/27.
@@ -110,8 +120,6 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
     private static final int SPLIT_BARCODE_FAIL = 105;
     private static final int SPLIT_BARCODE_FAIL = 105;
     private static final int FLAG_CONFIRM_POST = 0x05;
     private static final int FLAG_CONFIRM_POST = 0x05;
 
 
-
-
     private ImageView mScanImageView;
     private ImageView mScanImageView;
 
 
     private JsonObjectRequest jsonRequest;
     private JsonObjectRequest jsonRequest;
@@ -133,6 +141,7 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
     private String mBarRemain, mRestqty;
     private String mBarRemain, mRestqty;
     private String mResult1, mResult2, mResult3, mResult4;
     private String mResult1, mResult2, mResult3, mResult4;
     private List<String> mResults;
     private List<String> mResults;
+    private List<ItemNumberBean> itemNumberList;  //料号数据
 
 
     private TextWatcher watcher = new TextWatcher() {
     private TextWatcher watcher = new TextWatcher() {
         @Override
         @Override
@@ -424,6 +433,11 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
     private TextView text_finishno;
     private TextView text_finishno;
     private Button btn_startoutku;
     private Button btn_startoutku;
     private Button btn_stopoutku;
     private Button btn_stopoutku;
+    private ClearableEditText cet_item_number;
+    private ImageView iv_item_number_search;
+    private ClearableEditText edit_et;
+    private PopupWindow editPW;
+    private String pd_prodcode = "";     //物料编号
 
 
 
 
     @Override
     @Override
@@ -460,6 +474,9 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
         btn_startoutku = root.findViewById(R.id.btn_startoutku);
         btn_startoutku = root.findViewById(R.id.btn_startoutku);
         btn_stopoutku = root.findViewById(R.id.btn_stopoutku);
         btn_stopoutku = root.findViewById(R.id.btn_stopoutku);
 
 
+        cet_item_number = root.findViewById(R.id.cet_item_number);
+        iv_item_number_search = root.findViewById(R.id.iv_item_number_search);
+
         text_finishno = root.findViewById(R.id.text_finishno);
         text_finishno = root.findViewById(R.id.text_finishno);
         ((TextView) (getActivity().findViewById(R.id.tv_actionbar_withback))).setText(getString(R.string.out_material_collect));
         ((TextView) (getActivity().findViewById(R.id.tv_actionbar_withback))).setText(getString(R.string.out_material_collect));
 //        ((FunctionActivity) getActivity()).fragment = new IOCOutMakeMaterialOper();
 //        ((FunctionActivity) getActivity()).fragment = new IOCOutMakeMaterialOper();
@@ -487,7 +504,7 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
         }
         }
 
 
         ButterKnife.bind(this, root);
         ButterKnife.bind(this, root);
-
+        itemNumberList = new ArrayList<>();
         mResults = new ArrayList<>();
         mResults = new ArrayList<>();
         if (mCollectModel == 1) {
         if (mCollectModel == 1) {
             mCollectModelBtn.setText("在线");
             mCollectModelBtn.setText("在线");
@@ -546,7 +563,6 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
 
 
     @Override
     @Override
     protected void initEvents() {
     protected void initEvents() {
-
         btnActionbarRight.setOnClickListener(this);
         btnActionbarRight.setOnClickListener(this);
         etBarCode.addTextChangedListener(watcher);
         etBarCode.addTextChangedListener(watcher);
         mCollectTypeRadioGroup.setOnCheckedChangeListener(this);
         mCollectTypeRadioGroup.setOnCheckedChangeListener(this);
@@ -602,6 +618,7 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
                 startchuku();
                 startchuku();
             }
             }
         });
         });
+
         btn_stopoutku.setOnClickListener(new View.OnClickListener() {
         btn_stopoutku.setOnClickListener(new View.OnClickListener() {
             @Override
             @Override
             public void onClick(View v) {
             public void onClick(View v) {
@@ -623,8 +640,250 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
                         .show();
                         .show();
             }
             }
         });
         });
+        cet_item_number.setOnKeyListener(new View.OnKeyListener() {
+            @Override
+            public boolean onKey(View v, int keyCode, KeyEvent event) {
+                if (keyCode == KeyEvent.KEYCODE_ENTER && event.getAction() == KeyEvent.ACTION_UP) {
+//                    getOutbybatch();
+                    return true;
+                }
+                return false;
+            }
+        });
+        iv_item_number_search.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                String search = cet_item_number.getText().toString().trim();
+                getItemNumberData(search);
+            }
+        });
+    }
+
+    private void getOutbybatch() {
+        try {
+            String url = GloableParams.ADDRESS_GETPRODOUTPROD + "?id="+pi_id;
+            VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
+                    .url(url)
+                    .method(Request.Method.GET)
+                    .build(), new HttpCallback() {
+                @Override
+                public void onSuccess(int flag, Object o) throws Exception {
+                    progressDialog.dismiss();
+                    try {
+                        //FastjsonUtil.getJSONObject(o.toString(), "success");
+                        JSONObject jsonObject = new JSONObject(o.toString());
+                        boolean success = jsonObject.getBoolean("success");
+                        if (success) {
+                            JSONArray dataArray = jsonObject.getJSONArray("data");
+                            if (dataArray == null) {
+                                CommonUtil.toastNoRepeat(mActivity, "未搜索到匹配数据");
+                            } else {
+                                handleItemNumberData(dataArray);
+                            }
+                        }
+                    } catch (JSONException e) {
+                        e.printStackTrace();
+                    }
+                }
+
+                @Override
+                public void onFail(int flag, String failStr) throws Exception {
+                    progressDialog.dismiss();
+                    CommonUtil.toastNoRepeat(getActivity(), failStr);
+                }
+            });
+        } catch (Exception e) {
+            progressDialog.dismiss();
+            e.printStackTrace();
+        }
     }
     }
 
 
+    private void getItemNumberData(String itemNumber) {
+        Log.e("pi_id",pi_id);
+        progressDialog.show();
+        String url = GloableParams.ADDRESS_GETPRODOUTPROD+ "?id="+pi_id;
+        PdaApplication.mRequestQueue.cancelAll(TAG);
+        mCollectTypeRadioGroup.setEnabled(false);
+        jsonRequest = new JsonObjectRequest(Request.Method.GET, url, null, new Response.Listener<JSONObject>() {
+            @Override
+            public void onResponse(JSONObject jsonObject) {
+                progressDialog.dismiss();
+                try {
+                    String success = jsonObject.getString("success");
+                    if (success.equals("true")) {
+                        JSONArray dataArray = jsonObject.getJSONArray("data");
+                        if (dataArray == null) {
+                            CommonUtil.toastNoRepeat(mActivity, "未搜索到匹配数据");
+                        } else {
+                            handleItemNumberData(dataArray);
+                        }
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        }, new Response.ErrorListener() {
+            @Override
+            public void onErrorResponse(VolleyError volleyError) {
+                progressDialog.dismiss();
+                CommonUtil.toastNoRepeat(mActivity, volleyError.getMessage());
+
+            }
+        }) {
+            @Override
+            public Map<String, String> getHeaders() throws AuthFailureError {
+                return VolleyUtil.getVolleyUtil().setCookies();
+            }
+        };
+        jsonRequest.setRetryPolicy(new DefaultRetryPolicy(10 * 1000, 0, 1f));
+        jsonRequest.setTag(TAG);
+        PdaApplication.mRequestQueue.add(jsonRequest);
+    }
+
+    private void handleItemNumberData(JSONArray dataArray) {
+        ItemNumberBean bean = null;
+        itemNumberList.clear();
+        for (int i = 0; i < dataArray.length(); i++) {
+            try {
+                JSONObject jsonObject = dataArray.getJSONObject(i);
+                bean = new ItemNumberBean();
+                bean.setPD_PRODCODE(jsonObject.getString("PD_PRODCODE"));
+                bean.setPD_OUTQTY(jsonObject.getInt("PD_OUTQTY"));
+                bean.setV_RESQTY(jsonObject.getInt("V_RESQTY"));
+                bean.setPR_DETAIL(jsonObject.getString("PR_DETAIL"));
+                bean.setPR_DETAIL(jsonObject.getString("PR_SPEC"));
+                bean.setSelect(false);
+                itemNumberList.add(bean);
+            } catch (JSONException e) {
+                e.printStackTrace();
+            }
+        }
+        initresourcesPopupWindow();
+    }
+
+    private void initresourcesPopupWindow() {
+        View contView = LayoutInflater.from(mActivity).inflate(R.layout.index_recycle_item, null);
+        edit_et = (ClearableEditText) contView.findViewById(R.id.edit_et);
+        TextView sure_tv = (TextView) contView.findViewById(R.id.sure_tv);
+        TextView cancle_tv = (TextView) contView.findViewById(R.id.cancle_tv);
+        ImageView search_im = contView.findViewById(R.id.search_im);
+        RecyclerView rv_ip_port_data = contView.findViewById(R.id.rv_ip_port_data);
+        rv_ip_port_data.addItemDecoration(new DividerItemDecoration(mActivity, LinearLayout.VERTICAL));
+        rv_ip_port_data.setLayoutManager(new LinearLayoutManager(mActivity));
+        MaterialAdapter materialAdapter = new MaterialAdapter(itemNumberList);
+        materialAdapter.setmList(itemNumberList);
+        rv_ip_port_data.setAdapter(materialAdapter);
+        edit_et.requestFocus();
+        editPW = new PopupWindow(contView, LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT, true);
+        editPW.setTouchable(true);
+        editPW.setBackgroundDrawable(new BitmapDrawable());
+        editPW.setOnDismissListener(new BasePopupWindow.OnDismissListener() {
+            @Override
+            public void onDismiss() {
+                closeItemNumberPopupWindow();
+            }
+        });
+        View parentView = mActivity.getWindow().findViewById(Window.ID_ANDROID_CONTENT);
+        editPW.showAtLocation(parentView, Gravity.CENTER, 0, 0);
+        CommonUtil.setBackgroundAlpha(mActivity, 0.5f);
+        edit_et.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)) {
+                    String mSearchStr = edit_et.getText().toString().trim();
+                    if (!mSearchStr.isEmpty()) {
+                        List<ItemNumberBean> thisList = new ArrayList<>();
+                        for (int i = 0; i < itemNumberList.size(); i++) {
+                            if (itemNumberList.get(i).getPD_PRODCODE().contains(mSearchStr)
+                                    || itemNumberList.get(i).getPR_DETAIL().contains(mSearchStr)
+                                    || itemNumberList.get(i).getPR_SPEC().contains(mSearchStr)
+                            ) {
+                                thisList.add(itemNumberList.get(i));
+                            }
+                        }
+                        if (thisList.size() > 0) {
+                            materialAdapter.setmList(thisList);
+                        }
+                    } else {
+                        materialAdapter.setmList(itemNumberList);
+                    }
+
+                    return true;
+                }
+                return false;
+            }
+        });
+
+        search_im.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                String mSearchStr = edit_et.getText().toString().trim();
+                if (!mSearchStr.isEmpty()) {
+                    List<ItemNumberBean> thisList = new ArrayList<>();
+                    for (int i = 0; i < itemNumberList.size(); i++) {
+                        if (itemNumberList.get(i).getPD_PRODCODE().contains(mSearchStr)
+                                || itemNumberList.get(i).getPR_DETAIL().contains(mSearchStr)
+                                || itemNumberList.get(i).getPR_SPEC().contains(mSearchStr)
+                        ) {
+                            thisList.add(itemNumberList.get(i));
+                        }
+                    }
+                    if (thisList.size() > 0) {
+                        materialAdapter.setmList(thisList);
+                    }else {
+                        materialAdapter.setmList(itemNumberList);
+                    }
+                }
+            }
+
+        });
+
+        //确定
+        sure_tv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (StringUtil.isEmpty(pd_prodcode)) {
+                    CommonUtil.toastNoRepeat(mActivity, "请选择物料编号");
+                    return;
+                }
+                cet_item_number.setText(pd_prodcode);
+                cet_item_number.requestFocus();
+                cet_item_number.setSelection(cet_item_number.getText().length());
+                closeItemNumberPopupWindow();
+            }
+        });
+
+        //取消
+        cancle_tv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                closeItemNumberPopupWindow();
+            }
+        });
+
+        materialAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
+            @Override
+            public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
+                List<ItemNumberBean> ipAndPortBeans = materialAdapter.getmList();
+                pd_prodcode = ipAndPortBeans.get(position).getPD_PRODCODE();
+                edit_et.setText(pd_prodcode);
+                ipAndPortBeans.get(position).setSelect(true);
+                materialAdapter.notifyDataSetChanged();
+            }
+        });
+    }
+
+    private void closeItemNumberPopupWindow() {
+        if (editPW != null) {
+            editPW.dismiss();
+            editPW = null;
+            CommonUtil.setBackgroundAlpha(mActivity, 1f);
+        }
+    }
+
+
     /**
     /**
      * 采集方式切换成箱号
      * 采集方式切换成箱号
      */
      */
@@ -701,22 +960,24 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
      */
      */
     private void getNextMaterialInfo() {
     private void getNextMaterialInfo() {
         progressDialog.show();
         progressDialog.show();
-        String url = GloableParams.ADDRESS_OUT_GET_NEXT_BATCH + "?pi_id=" + pi_id + "&pd_whcode=" + pd_whcode;
-//        if (!isMultiple) {
-        if (false) {
-            if (mProdOutType.equals("byProdcode")) {
-                url = GloableParams.ADDRESS_OUT_GET_NEXT_PRODCODE + "?pi_id=" + pi_id + "&pd_whcode=" + pd_whcode;
-            } else if (mProdOutType.equals("byBatch")) {
-                url = GloableParams.ADDRESS_OUT_GET_NEXT_BATCH + "?pi_id=" + pi_id + "&pd_whcode=" + pd_whcode;
-            }
-        } else {
-            url = GloableParams.ADDRESS_OUT_GET_NEXT_BATCH_DEAL + "?ids=" + pi_id;
-            if (mProdOutType.equals("byProdcode")) {
-                url = GloableParams.ADDRESS_OUT_GET_NEXT_BATCH_DEAL + "?ids=" + pi_id;
-            } else if (mProdOutType.equals("byBatch")) {
-                url = GloableParams.ADDRESS_OUT_GET_NEXT_BATCH_DEAL + "?ids=" + pi_id;
-            }
-        }
+        String url = GloableParams.ADDRESS_OUT_GET_NEXT_BATCH_DEAL + "?ids=" + pi_id + "&prodcode=" + cet_item_number.getText().toString().trim();
+
+//        String url = GloableParams.ADDRESS_OUT_GET_NEXT_BATCH + "?pi_id=" + pi_id + "&pd_whcode=" + pd_whcode;
+////        if (!isMultiple) {
+//        if (false) {
+//            if (mProdOutType.equals("byProdcode")) {
+//                url = GloableParams.ADDRESS_OUT_GET_NEXT_PRODCODE + "?pi_id=" + pi_id + "&pd_whcode=" + pd_whcode;
+//            } else if (mProdOutType.equals("byBatch")) {
+//                url = GloableParams.ADDRESS_OUT_GET_NEXT_BATCH + "?pi_id=" + pi_id + "&pd_whcode=" + pd_whcode;
+//            }
+//        } else {
+//            url = GloableParams.ADDRESS_OUT_GET_NEXT_BATCH_DEAL + "?ids=" + pi_id;
+//            if (mProdOutType.equals("byProdcode")) {
+//                url = GloableParams.ADDRESS_OUT_GET_NEXT_BATCH_DEAL + "?ids=" + pi_id;
+//            } else if (mProdOutType.equals("byBatch")) {
+//                url = GloableParams.ADDRESS_OUT_GET_NEXT_BATCH_DEAL + "?ids=" + pi_id;
+//            }
+//        }
 
 
         PdaApplication.mRequestQueue.cancelAll(TAG + "getnext");
         PdaApplication.mRequestQueue.cancelAll(TAG + "getnext");
         mStringRequest = new StringRequest(Request.Method.GET, url,
         mStringRequest = new StringRequest(Request.Method.GET, url,
@@ -772,7 +1033,7 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
     private void startchuku(){
     private void startchuku(){
         Log.e("pi_id",pi_id);
         Log.e("pi_id",pi_id);
         progressDialog.show();
         progressDialog.show();
-        String url = GloableParams.ADDRESS_PAD_STARTPRODOUT+ "?id="+pi_id;
+        String url = GloableParams.ADDRESS_PAD_STARTPRODOUT+ "?id="+pi_id +"&prodcode="+ cet_item_number.getText().toString().trim();
         PdaApplication.mRequestQueue.cancelAll(TAG);
         PdaApplication.mRequestQueue.cancelAll(TAG);
         mCollectTypeRadioGroup.setEnabled(false);
         mCollectTypeRadioGroup.setEnabled(false);
         jsonRequest = new JsonObjectRequest(Request.Method.POST, url, null, new Response.Listener<JSONObject>() {
         jsonRequest = new JsonObjectRequest(Request.Method.POST, url, null, new Response.Listener<JSONObject>() {
@@ -840,7 +1101,7 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
      */
      */
     private void stopchuku(){
     private void stopchuku(){
         progressDialog.show();
         progressDialog.show();
-        String url = GloableParams.ADDRESS_COMMON_ENDPRODOUT+ "?id="+pi_id;
+        String url = GloableParams.ADDRESS_COMMON_ENDPRODOUT+ "?id="+pi_id + "&prodcode=" + cet_item_number.getText().toString().trim();
         PdaApplication.mRequestQueue.cancelAll(TAG);
         PdaApplication.mRequestQueue.cancelAll(TAG);
         mCollectTypeRadioGroup.setEnabled(false);
         mCollectTypeRadioGroup.setEnabled(false);
         jsonRequest = new JsonObjectRequest(Request.Method.POST, url, null, new Response.Listener<JSONObject>() {
         jsonRequest = new JsonObjectRequest(Request.Method.POST, url, null, new Response.Listener<JSONObject>() {
@@ -910,7 +1171,8 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
                 + pi_id + "&whcode=" + pd_whcode
                 + pi_id + "&whcode=" + pd_whcode
                 + "&type=barcode&msdcheck=" + msdcheck
                 + "&type=barcode&msdcheck=" + msdcheck
                 + "&datecheck=" + datecheck
                 + "&datecheck=" + datecheck
-                +"&ifspecial="+checkeds;
+                +"&ifspecial="+checkeds
+                +"&prodcode="+ cet_item_number.getText().toString().trim();
         try {
         try {
             if (mProdOutType != null && mCollectType != null) {
             if (mProdOutType != null && mCollectType != null) {
                 if (mProdOutType.equals("byProdcode")) {
                 if (mProdOutType.equals("byProdcode")) {
@@ -921,7 +1183,8 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
                                 + pi_id + "&whcode=" + pd_whcode
                                 + pi_id + "&whcode=" + pd_whcode
                                 + "&type=barcode&msdcheck=" + msdcheck
                                 + "&type=barcode&msdcheck=" + msdcheck
                                 + "&datecheck=" + datecheck
                                 + "&datecheck=" + datecheck
-                                +"&ifspecial="+checkeds;
+                                +"&ifspecial="+checkeds
+                        + "&prodcode=" + cet_item_number.getText().toString().trim();
 
 
                     } else if (mCollectType.equals("byBatchcode")) {
                     } else if (mCollectType.equals("byBatchcode")) {
                         url = (isMultiple ? GloableParams.ADDRESS_OUT_BYBATCH_DEAL : GloableParams.ADDRESS_OUT_BYBATCH_DEAL)
                         url = (isMultiple ? GloableParams.ADDRESS_OUT_BYBATCH_DEAL : GloableParams.ADDRESS_OUT_BYBATCH_DEAL)
@@ -930,7 +1193,8 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
                                 + pi_id + "&whcode=" + pd_whcode
                                 + pi_id + "&whcode=" + pd_whcode
                                 + "&type=boxcode&msdcheck=" + msdcheck
                                 + "&type=boxcode&msdcheck=" + msdcheck
                                 + "&datecheck=" + datecheck
                                 + "&datecheck=" + datecheck
-                                +"&ifspecial="+checkeds;
+                                +"&ifspecial="+checkeds
+                        + "&prodcode=" + cet_item_number.getText().toString().trim();
                     }
                     }
                 } else if (mProdOutType.equals("byBatch")) {
                 } else if (mProdOutType.equals("byBatch")) {
                     if (mCollectType.equals("byBarcode")) {
                     if (mCollectType.equals("byBarcode")) {
@@ -940,7 +1204,8 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
                                 + pi_id + "&whcode=" + pd_whcode
                                 + pi_id + "&whcode=" + pd_whcode
                                 + "&type=barcode&msdcheck=" + msdcheck
                                 + "&type=barcode&msdcheck=" + msdcheck
                                 + "&datecheck=" + datecheck
                                 + "&datecheck=" + datecheck
-                                +"&ifspecial="+checkeds;
+                                +"&ifspecial="+checkeds
+                        + "&prodcode=" + cet_item_number.getText().toString().trim();
                     } else if (mCollectType.equals("byBatchcode")) {
                     } else if (mCollectType.equals("byBatchcode")) {
                         url = (isMultiple ? GloableParams.ADDRESS_OUT_BYBATCH_DEAL : GloableParams.ADDRESS_OUT_BYBATCH_DEAL)
                         url = (isMultiple ? GloableParams.ADDRESS_OUT_BYBATCH_DEAL : GloableParams.ADDRESS_OUT_BYBATCH_DEAL)
                                 + "?barcode=" + URLEncoder.encode(currentBarcode, "utf-8")
                                 + "?barcode=" + URLEncoder.encode(currentBarcode, "utf-8")
@@ -948,7 +1213,8 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
                                 + pi_id + "&whcode=" + pd_whcode
                                 + pi_id + "&whcode=" + pd_whcode
                                 + "&type=boxcode&msdcheck=" + msdcheck
                                 + "&type=boxcode&msdcheck=" + msdcheck
                                 + "&datecheck=" + datecheck
                                 + "&datecheck=" + datecheck
-                                +"&ifspecial="+checkeds;
+                                +"&ifspecial="+checkeds
+                        + "&prodcode=" + cet_item_number.getText().toString().trim();
                     }
                     }
 
 
                 }
                 }
@@ -1752,6 +2018,7 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
                 .addParam("barcode", currentBarcode)
                 .addParam("barcode", currentBarcode)
                 .addParam("or_remain", mBarRemain)
                 .addParam("or_remain", mBarRemain)
                 .addParam("bar_remain", mRestqty)
                 .addParam("bar_remain", mRestqty)
+                .addParam("prodcode", cet_item_number.getText().toString().trim())
                 .build(), new HttpCallback() {
                 .build(), new HttpCallback() {
             @Override
             @Override
             public void onSuccess(int flag, Object o) throws Exception {
             public void onSuccess(int flag, Object o) throws Exception {
@@ -2899,4 +3166,42 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
         }
         }
     }
     }
 
 
+
+    private class MaterialAdapter extends BaseQuickAdapter<ItemNumberBean, BaseViewHolder> {
+        private List<ItemNumberBean> mmmmList;
+
+        public List<ItemNumberBean> getmList() {
+            return mmmmList;
+        }
+
+        public void setmList(List<ItemNumberBean> mList) {
+            this.mmmmList = mList;
+            notifyDataSetChanged();
+        }
+
+        public ItemNumberBean getBeanByPositon(int position) {
+            return mmmmList.get(position);
+        }
+
+        private MaterialAdapter(@Nullable List<ItemNumberBean> data) {
+            super(R.layout.pop_item_material, data);
+            this.mmmmList = data;
+        }
+
+        @Override
+        protected void convert(BaseViewHolder helper, ItemNumberBean item) {
+            helper.setText(R.id.tv_material_number, "物料编号: " + item.getPD_PRODCODE());
+            helper.setText(R.id.tv_name, "名称: " + item.getPR_DETAIL());
+            helper.setText(R.id.tv_specs, "规格: " + item.getPR_SPEC());
+            helper.setText(R.id.tv_outbound_number, "出库数量: " + item.getPD_OUTQTY());
+            helper.setText(R.id.tv_unprepared_materials_number, "未备料数量: " + item.getV_RESQTY());
+            if (item.isSelect()) {
+                helper.setBackgroundColor(R.id.ll_item_bg, getResources().getColor(R.color.blue));
+            }else {
+                helper.setBackgroundColor(R.id.ll_item_bg, getResources().getColor(R.color.white));
+            }
+        }
+    }
+
+
 }
 }

+ 2 - 2
app/src/main/java/com/uas/uas_mes_stw/fragment/IndexWareHouseContentFragment.java

@@ -155,12 +155,12 @@ public class IndexWareHouseContentFragment extends BaseFragment implements Adapt
                     getFragmentManager().beginTransaction().addToBackStack(null)
                     getFragmentManager().beginTransaction().addToBackStack(null)
                             .replace(R.id.container_function_fragment, fragment).commit();
                             .replace(R.id.container_function_fragment, fragment).commit();
                     break;
                     break;
-                case GloableParams.GRIDNAME_SMART_SHELVES:
+                case GloableParams.GRIDNAME_SMART_SHELVES: //感应上架(扫码)
                     fragment = new SmartShelvestFragment();
                     fragment = new SmartShelvestFragment();
                     getFragmentManager().beginTransaction().addToBackStack(null)
                     getFragmentManager().beginTransaction().addToBackStack(null)
                             .replace(R.id.container_function_fragment, fragment).commit();
                             .replace(R.id.container_function_fragment, fragment).commit();
                     break;
                     break;
-                case GloableParams.GRIDNAME_SMART_GYS:
+                case GloableParams.GRIDNAME_SMART_GYS:      //智能上架(感应式)
                     fragment = new IntelligentShelvingFragment();
                     fragment = new IntelligentShelvingFragment();
                     getFragmentManager().beginTransaction().addToBackStack(null)
                     getFragmentManager().beginTransaction().addToBackStack(null)
                             .replace(R.id.container_function_fragment, fragment).commit();
                             .replace(R.id.container_function_fragment, fragment).commit();

+ 33 - 131
app/src/main/java/com/uas/uas_mes_stw/fragment/IntelligentShelvingFragment.java

@@ -37,14 +37,13 @@ import com.uuzuche.lib_zxing.activity.CodeUtils;
 public class IntelligentShelvingFragment extends BaseFragment {
 public class IntelligentShelvingFragment extends BaseFragment {
     private static final int SCAN_BARCODE_CODE = 101;
     private static final int SCAN_BARCODE_CODE = 101;
     private ClearableEditText mBarcodeEditText;
     private ClearableEditText mBarcodeEditText;
-    private TextView mResultTextView;
-    private ImageView mScanImageView;
+    private Button mConfirmButton;
     private int mFocusId;
     private int mFocusId;
     private String mBarCode;
     private String mBarCode;
     private org.json.JSONObject jsonObject;
     private org.json.JSONObject jsonObject;
     private Button btn_kill;
     private Button btn_kill;
-    private TextView tv_newtext1;
-    private TextView tv_newtext2;
+    private TextView tv_text_content;
+
     private Button mMenuButton;
     private Button mMenuButton;
     private PopupWindow mMenuPopupWindow;
     private PopupWindow mMenuPopupWindow;
     private Fragment mFragment;
     private Fragment mFragment;
@@ -58,12 +57,11 @@ public class IntelligentShelvingFragment extends BaseFragment {
         FunctionActivity.setTitle("智能上架(感应式)");
         FunctionActivity.setTitle("智能上架(感应式)");
         ((FunctionActivity) getActivity()).setMoreBtnVisible(true);
         ((FunctionActivity) getActivity()).setMoreBtnVisible(true);
         mMenuButton = (Button) mActivity.findViewById(R.id.btn_actionbar_more);
         mMenuButton = (Button) mActivity.findViewById(R.id.btn_actionbar_more);
-        mScanImageView = (ImageView) mActivity.findViewById(R.id.btn_actionbar_scan_iv);
         mBarcodeEditText = root.findViewById(R.id.barcode_info_collect_barcode_et);
         mBarcodeEditText = root.findViewById(R.id.barcode_info_collect_barcode_et);
-        mResultTextView = root.findViewById(R.id.barcode_info_collect_result_tv);
+        mConfirmButton = root.findViewById(R.id.barcode_info_collect_confirm_btn);
         btn_kill = mActivity.findViewById(R.id.btn_kill);
         btn_kill = mActivity.findViewById(R.id.btn_kill);
-        tv_newtext1 = mActivity.findViewById(R.id.tv_newtext1);
-        tv_newtext2 = mActivity.findViewById(R.id.tv_newtext2);
+        tv_text_content = mActivity.findViewById(R.id.tv_text_content);
+        tv_text_content = mActivity.findViewById(R.id.tv_text_content);
         mBarcodeEditText.requestFocus();
         mBarcodeEditText.requestFocus();
         jsonObject=new org.json.JSONObject();
         jsonObject=new org.json.JSONObject();
     }
     }
@@ -77,8 +75,6 @@ public class IntelligentShelvingFragment extends BaseFragment {
             }
             }
         });
         });
 
 
-
-
         btn_kill.setOnClickListener(new View.OnClickListener() {
         btn_kill.setOnClickListener(new View.OnClickListener() {
             @Override
             @Override
             public void onClick(View v) {
             public void onClick(View v) {
@@ -86,21 +82,13 @@ public class IntelligentShelvingFragment extends BaseFragment {
             }
             }
         });
         });
 
 
-        mScanImageView.setOnClickListener(new View.OnClickListener() {
+        mConfirmButton.setOnClickListener(new View.OnClickListener() {
             @Override
             @Override
             public void onClick(View v) {
             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, getString(R.string.no_camera_detected));
-                }
+                //上架
             }
             }
         });
         });
+
         initPopupWindow();
         initPopupWindow();
         mMenuButton.setOnClickListener(new View.OnClickListener() {
         mMenuButton.setOnClickListener(new View.OnClickListener() {
             @Override
             @Override
@@ -110,9 +98,9 @@ public class IntelligentShelvingFragment extends BaseFragment {
             }
             }
         });
         });
     }
     }
+
     private void initPopupWindow() {
     private void initPopupWindow() {
         View view = View.inflate(getActivity(), R.layout.pop_storage_recharge_menu, null);
         View view = View.inflate(getActivity(), R.layout.pop_storage_recharge_menu, null);
-
         Button doneButton = (Button) view.findViewById(R.id.pop_storage_recharge_menu_1);
         Button doneButton = (Button) view.findViewById(R.id.pop_storage_recharge_menu_1);
         Button todoButton = (Button) view.findViewById(R.id.pop_storage_recharge_menu_2);
         Button todoButton = (Button) view.findViewById(R.id.pop_storage_recharge_menu_2);
         doneButton.setText("仓位物料查询");
         doneButton.setText("仓位物料查询");
@@ -148,23 +136,19 @@ public class IntelligentShelvingFragment extends BaseFragment {
         }
         }
     }
     }
     @Override
     @Override
-    protected void initDatas() { ;
+    protected void initDatas() {
 
 
     }
     }
 
 
-
-
-
     private void getBarAcceptCode(String barcode) {
     private void getBarAcceptCode(String barcode) {
         if (StringUtil.isEmpty(barcode)){
         if (StringUtil.isEmpty(barcode)){
             CommonUtil.toastNoRepeat(mActivity, "请输入条码号");
             CommonUtil.toastNoRepeat(mActivity, "请输入条码号");
             return;
             return;
         }
         }
-
         progressDialog.show();
         progressDialog.show();
         try {
         try {
             VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
             VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
-                    .url(GloableParams.ADDRESS_COMMON_SCANGETBARDATA)
+                    .url(GloableParams.ADDRESS_INDUCTIONGETBARDATA)
                     .method(Request.Method.GET)
                     .method(Request.Method.GET)
                     .addParam("code", barcode)
                     .addParam("code", barcode)
                     .build(), new HttpCallback() {
                     .build(), new HttpCallback() {
@@ -186,32 +170,27 @@ public class IntelligentShelvingFragment extends BaseFragment {
                     String LOCATION = dataObject.getString("LOCATION") == null ? "" : dataObject.getString("LOCATION");
                     String LOCATION = dataObject.getString("LOCATION") == null ? "" : dataObject.getString("LOCATION");
                     String TYPE = dataObject.getString("TYPE") == null ? "" : dataObject.getString("TYPE");
                     String TYPE = dataObject.getString("TYPE") == null ? "" : dataObject.getString("TYPE");
                     String LOCATIONS = dataObject.getString("LOCATIONS") == null ? "" : dataObject.getString("LOCATIONS");
                     String LOCATIONS = dataObject.getString("LOCATIONS") == null ? "" : dataObject.getString("LOCATIONS");
-                    mResultTextView.setTextColor(getResources().getColor(R.color.blue));
-                    mResultTextView.setVisibility(View.VISIBLE);
-                    tv_newtext1.setVisibility(View.VISIBLE);
-                    tv_newtext2.setVisibility(View.VISIBLE);
-                    mResultTextView.setText(TYPE+":"+mBarcodeEditText.getText().toString().trim()
-                                            +"\n编号:"+BAR_PRODCODE+" 数量:"+BAR_REMAIN
-                                            +"\n物料:"+PR_DETAIL
-                                            +"\n规格:"+PR_SPEC
-                                            +"\n默认仓位:"+PR_LOCATION);
-                    tv_newtext1.setText("目前仓位:"+BAR_LOCATION
-                            +"\n已存放仓位:"+LOCATIONS);
-                    tv_newtext2.setText("建议仓位:"+LOCATION);
+                    tv_text_content.setVisibility(View.VISIBLE);
+                    tv_text_content.setTextColor(getResources().getColor(R.color.blue));
+                    tv_text_content.setText("条码: " + BAR_CODE + "\n"
+                                            +"料号: "+ BAR_PRODCODE+" 数量:"+BAR_REMAIN + "\n"
+                                            +"名称: "+PR_DETAIL + "\n"
+                                            +"规格: "+PR_SPEC + "\n"
+                                            +"物料默认仓位: "+PR_LOCATION + "\n"
+                                            +"目前仓位: "+BAR_LOCATION + "\n"
+                                            +"建议仓位: "+LOCATION
+                    );
                 }
                 }
 
 
                 @Override
                 @Override
                 public void onFail(int flag, String failStr) throws Exception {
                 public void onFail(int flag, String failStr) throws Exception {
                     progressDialog.dismiss();
                     progressDialog.dismiss();
                     CommonUtil.toastNoRepeat(mActivity, failStr);
                     CommonUtil.toastNoRepeat(mActivity, failStr);
-                    mResultTextView.setTextColor(Color.RED);
-                    mResultTextView.setVisibility(View.VISIBLE);
-                    tv_newtext1.setVisibility(View.GONE);
-                    tv_newtext2.setVisibility(View.GONE);
-                    mResultTextView.setText(failStr);
+                    tv_text_content.setTextColor(Color.RED);
+                    tv_text_content.setVisibility(View.VISIBLE);
+                    tv_text_content.setText(failStr);
                     mBarcodeEditText.requestFocus();
                     mBarcodeEditText.requestFocus();
-                    mBarcodeEditText.setText(null);
-
+                    mBarcodeEditText.setText("");
                 }
                 }
             });
             });
         } catch (Exception e) {
         } catch (Exception e) {
@@ -220,107 +199,30 @@ public class IntelligentShelvingFragment extends BaseFragment {
     }
     }
 
 
 
 
-    private void saveBarAcceptCode(String ifmix) {
-        String barcode = mBarcodeEditText.getText().toString();
-        if (TextUtils.isEmpty(barcode)) {
-            CommonUtil.toastNoRepeat(mActivity, "请采集条码");
-            mBarcodeEditText.requestFocus();
-            return;
-        }
-
-        progressDialog.show();
-        VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
-                .url(GloableParams.ADDRESS_COMMON_SCANCONFIRMTRANS)
-                .method(Request.Method.POST)
-                .addParam("code", barcode)
-                .addParam("ifmix",ifmix)
-                .build(), new HttpCallback() {
-            @Override
-            public void onSuccess(int flag, Object o) throws Exception {
-                progressDialog.dismiss();
-                mResultTextView.setVisibility(View.VISIBLE);
-                tv_newtext1.setVisibility(View.GONE);
-                tv_newtext2.setVisibility(View.GONE);
-                mResultTextView.setTextColor(getResources().getColor(R.color.blue));
-
-
 
 
-                JSONObject dataObject = FastjsonUtil.getJSONObject(o.toString(),"data");
-                String LOG = dataObject.getString("log") == null ? "" : dataObject.getString("log");
-                String IFMIX = dataObject.getString("ifmix") == null ? "" : dataObject.getString("ifmix");
-                String PRODCODE = dataObject.getString("prodcode") == null ? "" : dataObject.getString("prodcode");
-                if (StringUtil.isEmpty(IFMIX)){
-                    mResultTextView.setText(null);
-                    mBarcodeEditText.setText(null);
-                }
-                if (StringUtil.isEmpty(IFMIX)){
-                    mResultTextView.setText(LOG);
-                }else {
-                    new AlertDialog.Builder(getActivity()).setTitle("提示")
-                            .setCancelable(true)
-                            .setMessage("是否允许混物料放置? 已经放置物料:"+PRODCODE)
-                            .setPositiveButton("是", new DialogInterface.OnClickListener() {
-                                @Override
-                                public void onClick(DialogInterface dialog, int which) {
-                                    saveBarAcceptCode(IFMIX);
-                                }
-                            })
-                            .setNegativeButton("否", null).show();
-                }
-
-                mBarcodeEditText.requestFocus();
-
-
-
-            }
-
-            @Override
-            public void onFail(int flag, String failStr) throws Exception {
-                progressDialog.dismiss();
-                CommonUtil.toastNoRepeat(mActivity, failStr);
-                mBarcodeEditText.requestFocus();
-                mBarcodeEditText.setText(null);
-                mResultTextView.setVisibility(View.VISIBLE);
-                tv_newtext1.setVisibility(View.GONE);
-                tv_newtext2.setVisibility(View.GONE);
-                mResultTextView.setTextColor(getResources().getColor(R.color.red));
-                mResultTextView.setText(failStr);
-
-
-            }
-        });
-
-    }
     private void savekillAcceptCode() {
     private void savekillAcceptCode() {
         progressDialog.show();
         progressDialog.show();
         VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
         VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
-                .url(GloableParams.ADDRESS_COMMON_SCANENDTRANS)
+                .url(GloableParams.ADDRESS_INDUCTIONENDTRANS)
                 .method(Request.Method.POST)
                 .method(Request.Method.POST)
                 .build(), new HttpCallback() {
                 .build(), new HttpCallback() {
             @Override
             @Override
             public void onSuccess(int flag, Object o) throws Exception {
             public void onSuccess(int flag, Object o) throws Exception {
                 progressDialog.dismiss();
                 progressDialog.dismiss();
-                mResultTextView.setVisibility(View.VISIBLE);
-                tv_newtext1.setVisibility(View.GONE);
-                tv_newtext2.setVisibility(View.GONE);
-                mResultTextView.setText(null);
+                tv_text_content.setVisibility(View.VISIBLE);
                 mBarcodeEditText.setText(null);
                 mBarcodeEditText.setText(null);
                 mBarcodeEditText.requestFocus();
                 mBarcodeEditText.requestFocus();
-                mResultTextView.setTextColor(getResources().getColor(R.color.blue));
-                mResultTextView.setText("结束上架操作成功");
-
-
+                tv_text_content.setTextColor(getResources().getColor(R.color.blue));
+                tv_text_content.setText("结束上架操作成功");
             }
             }
 
 
             @Override
             @Override
             public void onFail(int flag, String failStr) throws Exception {
             public void onFail(int flag, String failStr) throws Exception {
                 progressDialog.dismiss();
                 progressDialog.dismiss();
                 CommonUtil.toastNoRepeat(mActivity, failStr);
                 CommonUtil.toastNoRepeat(mActivity, failStr);
-                mResultTextView.setTextColor(getResources().getColor(R.color.red));
-                mResultTextView.setVisibility(View.VISIBLE);
-                tv_newtext1.setVisibility(View.GONE);
-                tv_newtext2.setVisibility(View.GONE);
-                mResultTextView.setText(failStr);
+                tv_text_content.setTextColor(getResources().getColor(R.color.red));
+                tv_text_content.setVisibility(View.VISIBLE);
+                tv_text_content.setText(failStr);
                 mBarcodeEditText.requestFocus();
                 mBarcodeEditText.requestFocus();
                 mBarcodeEditText.setText(null);
                 mBarcodeEditText.setText(null);
             }
             }

+ 18 - 2
app/src/main/java/com/uas/uas_mes_stw/global/GloableParams.java

@@ -307,7 +307,9 @@ public class GloableParams {
     public static String ADDRESS_SETWLLIST;//领料物料确定
     public static String ADDRESS_SETWLLIST;//领料物料确定
     public static String ADDRESS_KHBARCODE;//条码查询
     public static String ADDRESS_KHBARCODE;//条码查询
 
 
-
+    public static String ADDRESS_GETPRODOUTPROD;//物料放大镜事件
+    public static String ADDRESS_INDUCTIONGETBARDATA;//智能上架(扫码)条码号ENTER事件
+    public static String ADDRESS_INDUCTIONENDTRANS;//智能上架(扫码)结束上架
 
 
 
 
 
 
@@ -329,6 +331,13 @@ public class GloableParams {
     //条码查询
     //条码查询
     private static final String ADDRESSTAIL_KHBARCODE = "/api/pda/outMaterial/khbarcode.action";
     private static final String ADDRESSTAIL_KHBARCODE = "/api/pda/outMaterial/khbarcode.action";
 
 
+    //物料放大镜事件
+    private static final String ADDRESSTAIL_GETPRODOUTPROD = "/api/pda/outMaterial/getProdOutProd.action";
+    //智能上架(感应式) enter功能
+    private static final String ADDRESSTAIL_INDUCTIONGETBARDATA = "/api/pda/transfer/inductionGetBarData.action";
+    //智能上架(感应式) 结束上架
+    private static final String ADDRESSTAIL_INDUCTIONENDTRANS = "/api/pda/transfer/inductionEndTrans.action";
+
 
 
     /**
     /**
      * 条码信息采集
      * 条码信息采集
@@ -919,7 +928,10 @@ public class GloableParams {
             MENU_STORAGE_BARCODE_INFO_COLLECT,
             MENU_STORAGE_BARCODE_INFO_COLLECT,
 //            GRIDNAME_BOM_CHECK,
 //            GRIDNAME_BOM_CHECK,
             MENU_STORAGE_STOCK_INFO_COLLECT,
             MENU_STORAGE_STOCK_INFO_COLLECT,
-            GRIDNAME_SMART_SHELVES};
+            GRIDNAME_SMART_SHELVES,
+            GRIDNAME_SMART_GYS
+
+    };
     public static final int[] storageGridImgs = {
     public static final int[] storageGridImgs = {
             R.drawable.storage_good_search,
             R.drawable.storage_good_search,
             R.drawable.storage_bach_operation,
             R.drawable.storage_bach_operation,
@@ -927,6 +939,7 @@ public class GloableParams {
             R.drawable.storage_work_inventory,
             R.drawable.storage_work_inventory,
             R.drawable.ic_modify_quantity,
             R.drawable.ic_modify_quantity,
             R.drawable.storage_transfer,
             R.drawable.storage_transfer,
+            R.drawable.iv_shelves,
             R.drawable.iv_shelves};
             R.drawable.iv_shelves};
     //DETAIL:搜索备料单号,下拉列表
     //DETAIL:搜索备料单号,下拉列表
     public static final String SPINNER_PREPARE_SEARCH = "搜索备料单号";
     public static final String SPINNER_PREPARE_SEARCH = "搜索备料单号";
@@ -1355,6 +1368,9 @@ public class GloableParams {
         GloableParams.ADDRESS_COMMON_NEWPRODOUT = uriHead + GloableParams.ADDRESSTAIL_COMMON_NEWPRODOUT;
         GloableParams.ADDRESS_COMMON_NEWPRODOUT = uriHead + GloableParams.ADDRESSTAIL_COMMON_NEWPRODOUT;
         GloableParams.ADDRESS_SETWLLIST = uriHead + GloableParams.ADDRESSTAIL_SETWLLIST;
         GloableParams.ADDRESS_SETWLLIST = uriHead + GloableParams.ADDRESSTAIL_SETWLLIST;
         GloableParams.ADDRESS_KHBARCODE = uriHead + GloableParams.ADDRESSTAIL_KHBARCODE;
         GloableParams.ADDRESS_KHBARCODE = uriHead + GloableParams.ADDRESSTAIL_KHBARCODE;
+        GloableParams.ADDRESS_GETPRODOUTPROD = uriHead + GloableParams.ADDRESSTAIL_GETPRODOUTPROD;
+        GloableParams.ADDRESS_INDUCTIONGETBARDATA = uriHead + GloableParams.ADDRESSTAIL_INDUCTIONGETBARDATA;
+        GloableParams.ADDRESS_INDUCTIONENDTRANS = uriHead + GloableParams.ADDRESSTAIL_INDUCTIONENDTRANS;
 
 
 
 
 
 

+ 44 - 44
app/src/main/res/layout/fragment_intelligentshelving.xml

@@ -1,22 +1,23 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:ndroid="http://schemas.android.com/apk/res-auto"
     xmlns:tools="http://schemas.android.com/tools"
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:layout_height="match_parent"
-    xmlns:ndroid="http://schemas.android.com/apk/res-auto"
     android:orientation="vertical"
     android:orientation="vertical"
     android:padding="@dimen/root_layout_padding">
     android:padding="@dimen/root_layout_padding">
 
 
     <LinearLayout
     <LinearLayout
-        android:orientation="vertical"
         android:layout_width="match_parent"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content">
+        android:layout_height="wrap_content"
+        android:orientation="vertical">
 
 
         <LinearLayout
         <LinearLayout
-            android:layout_marginTop="@dimen/dp_10"
-            android:orientation="horizontal"
             android:layout_width="match_parent"
             android:layout_width="match_parent"
-            android:layout_height="wrap_content">
+            android:layout_height="wrap_content"
+            android:layout_marginTop="@dimen/dp_10"
+            android:orientation="horizontal">
+
             <TextView
             <TextView
                 android:layout_width="110dp"
                 android:layout_width="110dp"
                 android:layout_height="match_parent"
                 android:layout_height="match_parent"
@@ -26,69 +27,68 @@
                 android:text="条码"
                 android:text="条码"
                 android:textColor="@color/body_text_1"
                 android:textColor="@color/body_text_1"
                 android:textSize="16sp" />
                 android:textSize="16sp" />
-                <com.uas.uas_mes_stw.view.ClearableEditText
-                    android:id="@+id/barcode_info_collect_barcode_et"
-                    style="@style/EditTextStyle"
-                    android:layout_width="0dp"
-                    android:layout_weight="1"
-                    android:hint="@string/please_collect_barcode"
-                    android:focusable="true"
-                    android:focusableInTouchMode="true"
-                    android:imeOptions="actionSend"
-                    android:textColor="@color/black" />
-            </LinearLayout>
+
+            <com.uas.uas_mes_stw.view.ClearableEditText
+                android:id="@+id/barcode_info_collect_barcode_et"
+                style="@style/EditTextStyle"
+                android:layout_width="0dp"
+                android:layout_weight="1"
+                android:focusable="true"
+                android:focusableInTouchMode="true"
+                android:hint="@string/please_collect_barcode"
+                android:imeOptions="actionSend"
+                android:textColor="@color/black" />
+        </LinearLayout>
     </LinearLayout>
     </LinearLayout>
+
     <LinearLayout
     <LinearLayout
-        android:orientation="horizontal"
         android:layout_width="match_parent"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content">
+        android:layout_height="wrap_content"
+        android:orientation="horizontal">
+
         <Button
         <Button
+            android:visibility="gone"
             android:id="@+id/barcode_info_collect_confirm_btn"
             android:id="@+id/barcode_info_collect_confirm_btn"
             style="@style/ButtonStyle"
             style="@style/ButtonStyle"
             android:layout_marginTop="16dp"
             android:layout_marginTop="16dp"
-            android:text="上架"
-            android:layout_weight="1"/>
+            android:layout_weight="1"
+            android:text="上架" />
+
         <Button
         <Button
             android:id="@+id/btn_kill"
             android:id="@+id/btn_kill"
             style="@style/ButtonStyle"
             style="@style/ButtonStyle"
             android:layout_marginTop="16dp"
             android:layout_marginTop="16dp"
-            android:text="结束上架"
-            android:layout_weight="1"/>
+            android:layout_weight="1"
+            android:text="结束上架" />
 
 
     </LinearLayout>
     </LinearLayout>
 
 
 
 
     <LinearLayout
     <LinearLayout
-        android:orientation="vertical"
         android:layout_width="match_parent"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_height="wrap_content"
         android:layout_marginTop="@dimen/spacing_big"
         android:layout_marginTop="@dimen/spacing_big"
         android:background="@drawable/shape_msg_block"
         android:background="@drawable/shape_msg_block"
-        android:padding="10dp">
-        <TextView
-            android:id="@+id/barcode_info_collect_result_tv"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:visibility="gone"
-            tools:visibility="visible"
-            tools:text="采集成功,条码:786528238;数量:2;料号:1209837;名称规格:瓶子" />
+        android:orientation="vertical"
+      >
 
 
         <TextView
         <TextView
-            android:id="@+id/tv_newtext1"
+            android:id="@+id/tv_text_content"
             android:layout_width="match_parent"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_height="wrap_content"
-            android:visibility="gone"
-            tools:visibility="visible"
-            android:textColor="@color/green"
-            tools:text="采集成功,条码:786528238;数量:2;料号:1209837;名称规格:瓶子" />
-        <TextView
-            android:id="@+id/tv_newtext2"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:visibility="gone"
-            tools:visibility="visible"
+            android:padding="10dp"
             android:textColor="@color/blue"
             android:textColor="@color/blue"
-            tools:text="采集成功,条码:786528238;数量:2;料号:1209837;名称规格:瓶子" />
+            android:visibility="gone"
+            tools:text="
+            条码:xxxx code \n
+            料号:xxx   数量:XXX  \n
+            名称   \n
+            规格   \n
+            物料默认仓库:  \n
+            目前仓位:    \n
+            建议仓位:xxxx"
+            tools:visibility="visible" />
+
     </LinearLayout>
     </LinearLayout>
 
 
 
 

+ 31 - 0
app/src/main/res/layout/fragment_iocout_make_material_oper.xml

@@ -188,6 +188,37 @@
                     android:text="@string/confirm"
                     android:text="@string/confirm"
                     android:visibility="gone" />
                     android:visibility="gone" />
 
 
+
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal"
+
+                    android:minHeight="48dp"
+                    >
+
+                    <com.uas.uas_mes_stw.view.ClearableEditText
+                        android:id="@+id/cet_item_number"
+                        style="@style/PopWinEditTextStyle"
+                        android:layout_marginTop="8dp"
+                        android:layout_weight="1"
+                        android:hint="料号" />
+
+                    <ImageView
+                        android:id="@+id/iv_item_number_search"
+                        android:layout_width="@dimen/height_32"
+                        android:layout_height="@dimen/height_32"
+                        android:layout_gravity="center_vertical"
+                        android:layout_marginLeft="@dimen/space_left_5"
+                        android:layout_marginRight="@dimen/dp_10"
+                        android:background="@drawable/bg_button"
+                        android:src="@drawable/search_48" />
+
+                </LinearLayout>
+
+
+
                 <TableLayout
                 <TableLayout
                     android:id="@+id/iocout_collect_barcode_tl"
                     android:id="@+id/iocout_collect_barcode_tl"
                     android:layout_width="match_parent"
                     android:layout_width="match_parent"

+ 49 - 0
app/src/main/res/layout/pop_item_material.xml

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:gravity="center_horizontal"
+    android:id="@+id/ll_item_bg"
+    android:orientation="vertical">
+
+    <TextView
+        android:id="@+id/tv_material_number"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="5dp"
+        android:textColor="@color/black"
+        android:textSize="14sp" />
+
+    <TextView
+        android:id="@+id/tv_name"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="2dp"
+        android:textColor="@color/black"
+        android:textSize="14sp" />
+
+    <TextView
+        android:id="@+id/tv_specs"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="2dp"
+        android:textColor="@color/black"
+        android:textSize="14sp" />
+
+    <TextView
+        android:id="@+id/tv_outbound_number"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="2dp"
+        android:textColor="@color/black"
+        android:textSize="14sp" />
+
+    <TextView
+        android:id="@+id/tv_unprepared_materials_number"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="2dp"
+        android:textColor="@color/black"
+        android:textSize="14sp" />
+
+</LinearLayout>