Browse Source

增加盘点内容, 按条码拆分增加弹窗放大镜功能, 修改报工页面,修改成品入库表格及相关跳转和菜单的跳转, 货物彻查页面修改

songw 1 year ago
parent
commit
ca4caab290
45 changed files with 7225 additions and 322 deletions
  1. 3 1
      app/src/main/java/com/uas/jc_wms/adapter/StockTaskMultipleAdapter.java
  2. 5 3
      app/src/main/java/com/uas/jc_wms/adapter/WHCheckMakeMaterialListAdapter.java
  3. 58 0
      app/src/main/java/com/uas/jc_wms/adapter/WHCheckMakeMaterialListAdapterNew.java
  4. 1 1
      app/src/main/java/com/uas/jc_wms/application/PdaApplication.java
  5. 80 0
      app/src/main/java/com/uas/jc_wms/bean/InventoryCollctBean.java
  6. 53 0
      app/src/main/java/com/uas/jc_wms/bean/MaintainitemBean.java
  7. 10 0
      app/src/main/java/com/uas/jc_wms/bean/MaterialInformationBean.java
  8. 9 0
      app/src/main/java/com/uas/jc_wms/bean/OutBoundListAddDalieBean.java
  9. 11 0
      app/src/main/java/com/uas/jc_wms/bean/StockTaskMultipleBean.java
  10. 78 0
      app/src/main/java/com/uas/jc_wms/bean/WHBreakingBatchBreakingBtnClickEventNew.java
  11. 102 0
      app/src/main/java/com/uas/jc_wms/bean/WHMakeMaterialProductNew.java
  12. 335 11
      app/src/main/java/com/uas/jc_wms/fragment/BarcodeInCollectFragment.java
  13. 3 3
      app/src/main/java/com/uas/jc_wms/fragment/GoodOrBadFragment.java
  14. 4 2
      app/src/main/java/com/uas/jc_wms/fragment/IOCOutMakeMaterial.java
  15. 3097 0
      app/src/main/java/com/uas/jc_wms/fragment/IOCOutMakeMaterialOperNew.java
  16. 1 0
      app/src/main/java/com/uas/jc_wms/fragment/IndexWareHouseContentFragment.java
  17. 287 51
      app/src/main/java/com/uas/jc_wms/fragment/InventoryCollectFragment.java
  18. 1 0
      app/src/main/java/com/uas/jc_wms/fragment/MaterialOutStockTaskMultipleFragment.java
  19. 444 0
      app/src/main/java/com/uas/jc_wms/fragment/NewWHCheckMakeMaterialFragment.java
  20. 3 12
      app/src/main/java/com/uas/jc_wms/fragment/OutAddList_fragment.java
  21. 3 5
      app/src/main/java/com/uas/jc_wms/fragment/OutboundLis_Two_fragment.java
  22. 476 32
      app/src/main/java/com/uas/jc_wms/fragment/OutboundListAdd_Fragment.java
  23. 799 0
      app/src/main/java/com/uas/jc_wms/fragment/StorageTwoIQCInFragment.java
  24. 51 40
      app/src/main/java/com/uas/jc_wms/fragment/VersionUpgradeFragment.java
  25. 2 1
      app/src/main/java/com/uas/jc_wms/fragment/WHCheckContentFragment.java
  26. 27 0
      app/src/main/java/com/uas/jc_wms/global/GloableParams.java
  27. 31 1
      app/src/main/java/com/uas/jc_wms/tools/DataSourceManager.java
  28. 26 1
      app/src/main/java/com/uas/jc_wms/tools/VolleyUtil.java
  29. 30 1
      app/src/main/java/com/uas/jc_wms/util/CommonUtil.java
  30. 3 0
      app/src/main/java/com/uas/jc_wms/util/download/ProgressDownloader.java
  31. 31 0
      app/src/main/res/layout/dialog_confirm_quantity.xml
  32. 41 33
      app/src/main/res/layout/fragment_barcode_in_collect.xml
  33. 36 1
      app/src/main/res/layout/fragment_inventory_collect.xml
  34. 6 0
      app/src/main/res/layout/fragment_iocout_make_material_oper.xml
  35. 0 1
      app/src/main/res/layout/fragment_material_out_stock_task_multiple.xml
  36. 224 119
      app/src/main/res/layout/fragment_outboundlistadd.xml
  37. 580 0
      app/src/main/res/layout/fragment_two_storage_iqc_in.xml
  38. 94 0
      app/src/main/res/layout/fragment_whcheck_makematerial_new.xml
  39. 13 0
      app/src/main/res/layout/item_list_table.xml
  40. 58 0
      app/src/main/res/layout/item_list_table_new.xml
  41. 0 1
      app/src/main/res/layout/pop_material_out_menu.xml
  42. 37 0
      app/src/main/res/layout/pop_whcode_dlert_dialog.xml
  43. 67 0
      app/src/main/res/layout/recyclerview_item2.xml
  44. 3 0
      app/src/main/res/values/strings.xml
  45. 2 2
      build.gradle

+ 3 - 1
app/src/main/java/com/uas/jc_wms/adapter/StockTaskMultipleAdapter.java

@@ -70,7 +70,9 @@ public class StockTaskMultipleAdapter extends BaseAdapter {
         holder.stockTaskMultipleLocation.setText(object.getBAR_LOCATION());
         holder.stockTaskMultipleDcTv.setText(object.getDC());
         holder.stockTaskMultipleHave.setText((object.getBA_HASBARCODE() == 0 ? "无" : "有"));
-        holder.stockTaskMultipleDetailSpec.setText(object.getPR_DETAIL() + "  " + object.getPR_SPEC());
+        holder.stockTaskMultipleDetailSpec.setText(object.getPR_DETAIL() + " "
+                + object.getPR_SPEC()+ " "
+                + object.getV_RESTQTY());
 
         if (object.getNOS().size() > 0) {
             holder.stockTaskMultipleSpreadTv.setVisibility(View.VISIBLE);

+ 5 - 3
app/src/main/java/com/uas/jc_wms/adapter/WHCheckMakeMaterialListAdapter.java

@@ -8,7 +8,7 @@ import android.widget.BaseAdapter;
 import android.widget.TextView;
 
 import com.uas.jc_wms.R;
-import com.uas.jc_wms.bean.WHMakeMaterialProduct;
+import com.uas.jc_wms.bean.WHMakeMaterialProductNew;
 
 import java.util.List;
 
@@ -45,10 +45,12 @@ public class WHCheckMakeMaterialListAdapter extends BaseAdapter {
         TextView tvColumn1 = (TextView) view.findViewById(R.id.tv_table_1);
         TextView tvColumn2 = (TextView) view.findViewById(R.id.tv_table_2);
         TextView tvColumn3 = (TextView) view.findViewById(R.id.tv_table_3);
-        WHMakeMaterialProduct tmpProduct = (WHMakeMaterialProduct) getItem(position);
+        TextView tvColumn4 = (TextView) view.findViewById(R.id.tv_table_4);
+        WHMakeMaterialProductNew tmpProduct = (WHMakeMaterialProductNew) getItem(position);
         tvColumn1.setText("" + tmpProduct.getBAR_WHCODE());
         tvColumn2.setText("" + tmpProduct.getBAR_LOCATION());
-        tvColumn3.setText("" + tmpProduct.getBAR_REMAIN());
+        tvColumn3.setText("" + tmpProduct.getREMAIN());
+        tvColumn4.setText("" + tmpProduct.getMADEDATE());
         int[] colors = {Color.WHITE, Color.rgb(219, 238, 244)};
         view.setBackgroundColor(colors[position % 2]);
         return view;

+ 58 - 0
app/src/main/java/com/uas/jc_wms/adapter/WHCheckMakeMaterialListAdapterNew.java

@@ -0,0 +1,58 @@
+package com.uas.jc_wms.adapter;
+
+import android.content.Context;
+import android.graphics.Color;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.TextView;
+
+import com.uas.jc_wms.R;
+import com.uas.jc_wms.bean.WHMakeMaterialProductNew;
+
+import java.util.List;
+
+/**
+ * @note:仓库管理:物料存储详细数据表格ListAdapter
+ */
+public class WHCheckMakeMaterialListAdapterNew extends BaseAdapter {
+    List itemList;
+    Context context;
+
+    public WHCheckMakeMaterialListAdapterNew(List itemList, Context context) {
+        this.itemList = itemList;
+        this.context = context;
+    }
+
+    @Override
+    public int getCount() {
+        return itemList.size();
+    }
+
+    @Override
+    public Object getItem(int position) {
+        return itemList.get(position);
+    }
+
+    @Override
+    public long getItemId(int position) {
+        return 0;
+    }
+
+    @Override
+    public View getView(int position, View convertView, ViewGroup parent) {
+        View view = View.inflate(context, R.layout.item_list_table_new, null);
+        TextView tvColumn1 = (TextView) view.findViewById(R.id.tv_table_1);
+        TextView tvColumn2 = (TextView) view.findViewById(R.id.tv_table_2);
+        TextView tvColumn3 = (TextView) view.findViewById(R.id.tv_table_3);
+        TextView tvColumn4 = (TextView) view.findViewById(R.id.tv_table_4);
+        WHMakeMaterialProductNew tmpProduct = (WHMakeMaterialProductNew) getItem(position);
+        tvColumn1.setText("" + tmpProduct.getBAR_WHCODE());
+        tvColumn2.setText("" + tmpProduct.getBAR_LOCATION());
+        tvColumn3.setText("" + tmpProduct.getREMAIN());
+        tvColumn4.setText("" + tmpProduct.getMADEDATE());
+        int[] colors = {Color.WHITE, Color.rgb(219, 238, 244)};
+        view.setBackgroundColor(colors[position % 2]);
+        return view;
+    }
+}

+ 1 - 1
app/src/main/java/com/uas/jc_wms/application/PdaApplication.java

@@ -85,7 +85,7 @@ public class PdaApplication extends Application {
         mSoundMap.put(SoundUtil.SOUND_TETHYS, mSoundPool.load(this, R.raw.tethys, 1));
         mSoundMap.put(SoundUtil.SOUND_TITAN, mSoundPool.load(this, R.raw.titan, 1));
         //友盟统计SDK
-        initUmeng();
+//        initUmeng();
     }
 
 

+ 80 - 0
app/src/main/java/com/uas/jc_wms/bean/InventoryCollctBean.java

@@ -0,0 +1,80 @@
+package com.uas.jc_wms.bean;
+
+public
+        /**
+         * Created by sw on 2024-12-03
+         */
+class InventoryCollctBean {
+
+    //ST_WHCODE 仓库
+    //STD_PRODCODE 料号
+    // PR_DETAIL 名称
+    // BAR_LOCATION 储位
+    //STD_BATCHQTY 账面库存
+    // STD_ACTQTY 实盘库存
+    //PR_SPEC 规格
+
+    private String ST_WHCODE;
+    private String STD_PRODCODE;
+    private String PR_DETAIL;
+    private String BAR_LOCATION;
+    private double STD_BATCHQTY;
+    private double STD_ACTQTY;
+    private String PR_SPEC;
+
+    public String getST_WHCODE() {
+        return ST_WHCODE;
+    }
+
+    public void setST_WHCODE(String ST_WHCODE) {
+        this.ST_WHCODE = ST_WHCODE;
+    }
+
+    public String getSTD_PRODCODE() {
+        return STD_PRODCODE;
+    }
+
+    public void setSTD_PRODCODE(String STD_PRODCODE) {
+        this.STD_PRODCODE = STD_PRODCODE;
+    }
+
+    public String getPR_DETAIL() {
+        return PR_DETAIL;
+    }
+
+    public void setPR_DETAIL(String PR_DETAIL) {
+        this.PR_DETAIL = PR_DETAIL;
+    }
+
+    public String getBAR_LOCATION() {
+        return BAR_LOCATION;
+    }
+
+    public void setBAR_LOCATION(String BAR_LOCATION) {
+        this.BAR_LOCATION = BAR_LOCATION;
+    }
+
+    public double getSTD_BATCHQTY() {
+        return STD_BATCHQTY;
+    }
+
+    public void setSTD_BATCHQTY(double STD_BATCHQTY) {
+        this.STD_BATCHQTY = STD_BATCHQTY;
+    }
+
+    public double getSTD_ACTQTY() {
+        return STD_ACTQTY;
+    }
+
+    public void setSTD_ACTQTY(double STD_ACTQTY) {
+        this.STD_ACTQTY = STD_ACTQTY;
+    }
+
+    public String getPR_SPEC() {
+        return PR_SPEC;
+    }
+
+    public void setPR_SPEC(String PR_SPEC) {
+        this.PR_SPEC = PR_SPEC;
+    }
+}

+ 53 - 0
app/src/main/java/com/uas/jc_wms/bean/MaintainitemBean.java

@@ -0,0 +1,53 @@
+package com.uas.jc_wms.bean;
+
+/**
+ * Created by cjh-sail on 2023-01-31
+ */
+public class MaintainitemBean {
+    private String BAN_BARCODE;
+    private String PR_DETAIL;
+    private String PR_SPEC;
+    private int BAN_QTY;
+    private boolean isChecked;
+
+    public boolean isChecked() {
+        return isChecked;
+    }
+
+    public void setChecked(boolean checked) {
+        isChecked = checked;
+    }
+
+
+    public String getBAN_BARCODE() {
+        return BAN_BARCODE;
+    }
+
+    public void setBAN_BARCODE(String BAN_BARCODE) {
+        this.BAN_BARCODE = BAN_BARCODE;
+    }
+
+    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 int getBAN_QTY() {
+        return BAN_QTY;
+    }
+
+    public void setBAN_QTY(int BAN_QTY) {
+        this.BAN_QTY = BAN_QTY;
+    }
+}

+ 10 - 0
app/src/main/java/com/uas/jc_wms/bean/MaterialInformationBean.java

@@ -41,6 +41,7 @@ public class MaterialInformationBean {
          * PD_BATCHCODE : 批次号
          * BA_REMAIN : 23
          * DC:xxx
+         * V_RESTQTY  线别仓可用库存
          */
 
         private String PR_ORISPECCODE;
@@ -54,6 +55,15 @@ public class MaterialInformationBean {
         private String PD_BATCHCODE;
         private double BAR_REMAIN;
         private String DC;
+        private String V_RESTQTY;
+
+        public String getV_RESTQTY() {
+            return V_RESTQTY;
+        }
+
+        public void setV_RESTQTY(String v_RESTQTY) {
+            V_RESTQTY = v_RESTQTY;
+        }
 
         public String getPR_ORISPECCODE() {
             return PR_ORISPECCODE;

+ 9 - 0
app/src/main/java/com/uas/jc_wms/bean/OutBoundListAddDalieBean.java

@@ -20,6 +20,7 @@ public class OutBoundListAddDalieBean {
     private String PI_INVOSTATUSCODE;
 
     private String PI_STATUSCODE;
+    private String PI_ID;
 
     private String PI_WHCODE;
     private String PI_WHNAME;
@@ -34,6 +35,14 @@ public class OutBoundListAddDalieBean {
     private String BI_OUTQTY;
     private String BI_PRODCODE;
 
+    public String getPI_ID() {
+        return PI_ID;
+    }
+
+    public void setPI_ID(String PI_ID) {
+        this.PI_ID = PI_ID;
+    }
+
     public String getBI_OUTQTY() {
         return BI_OUTQTY;
     }

+ 11 - 0
app/src/main/java/com/uas/jc_wms/bean/StockTaskMultipleBean.java

@@ -19,6 +19,7 @@ public class StockTaskMultipleBean {
      * BA_HASBARCODE : 0
      * BAR_REMAIN : 批数量
      * NOS : [{"PI_INOUTNO":"MG12333","PD_OUTQTY":12,"PD_RESTQTY":12}]
+     * V_RESTQTY : 线别仓可用库存
      */
 
     private String PR_ORISPECCODE;
@@ -40,6 +41,16 @@ public class StockTaskMultipleBean {
     private double PD_PDAQTY1;
     private List<NOSBean> NOS;
 
+    public String getV_RESTQTY() {
+        return V_RESTQTY;
+    }
+
+    public void setV_RESTQTY(String v_RESTQTY) {
+        V_RESTQTY = v_RESTQTY;
+    }
+
+    private String V_RESTQTY;
+
     public double getPD_PDAQTY() {
         return PD_PDAQTY;
     }

+ 78 - 0
app/src/main/java/com/uas/jc_wms/bean/WHBreakingBatchBreakingBtnClickEventNew.java

@@ -0,0 +1,78 @@
+package com.uas.jc_wms.bean;
+
+import java.util.List;
+
+/**
+ * Created by Administrator on 2016/3/11.
+ * 分拆批次页
+ */
+public class WHBreakingBatchBreakingBtnClickEventNew {
+    /**
+     * success : true
+     * data : [{"BAR_REMAIN":11,"BAR_CODE":"XX","BAR_ID":12}]
+     */
+
+    private boolean success;
+    private List<DataBean> data;
+
+    public boolean isSuccess() {
+        return success;
+    }
+
+    public void setSuccess(boolean success) {
+        this.success = success;
+    }
+
+    public List<DataBean> getData() {
+        return data;
+    }
+
+    public void setData(List<DataBean> data) {
+        this.data = data;
+    }
+
+    public static class DataBean {
+        /**
+         * BAR_REMAIN : 11
+         * BAR_CODE : XX
+         * BAR_ID : 12
+         */
+
+        private String BAR_REMAIN;
+        private String BAR_CODE;
+        private int BAR_ID;
+
+        public String getBAR_REMAIN() {
+            return BAR_REMAIN;
+        }
+
+        public void setBAR_REMAIN(String BAR_REMAIN) {
+            this.BAR_REMAIN = BAR_REMAIN;
+        }
+
+        public String getBAR_CODE() {
+            return BAR_CODE;
+        }
+
+        public void setBAR_CODE(String BAR_CODE) {
+            this.BAR_CODE = BAR_CODE;
+        }
+
+        public int getBAR_ID() {
+            return BAR_ID;
+        }
+
+        public void setBAR_ID(int BAR_ID) {
+            this.BAR_ID = BAR_ID;
+        }
+    }
+
+
+
+   /* public List<Message> message;
+    public class Message{
+            public String bar_code;
+            public String bar_remain;
+            public String bar_id;
+    }*/
+}

+ 102 - 0
app/src/main/java/com/uas/jc_wms/bean/WHMakeMaterialProductNew.java

@@ -0,0 +1,102 @@
+package com.uas.jc_wms.bean;
+
+/**
+ * @note:仓库管理:物料库存核查中物料Bean
+ */
+public class WHMakeMaterialProductNew {
+    private int BAR_REMAIN;
+    private String BAR_PRODCODE;
+    private String PR_DETAIL;
+    private String PR_SPEC;
+    private String BAR_LOCATION;
+    private String BAR_WHCODE;
+    private String REMAIN;
+    private String MADEDATE;
+
+    private String PR_CODE;
+
+    public String getPR_CODE() {
+        return PR_CODE;
+    }
+
+    public void setPR_CODE(String PR_CODE) {
+        this.PR_CODE = PR_CODE;
+    }
+
+
+    public String getREMAIN() {
+        return REMAIN;
+    }
+
+    public void setREMAIN(String REMAIN) {
+        this.REMAIN = REMAIN;
+    }
+
+    public String getMADEDATE() {
+        return MADEDATE;
+    }
+
+    public void setMADEDATE(String MADEDATE) {
+        this.MADEDATE = MADEDATE;
+    }
+
+    public int getBAR_REMAIN() {
+        return BAR_REMAIN;
+    }
+
+    public void setBAR_REMAIN(int BAR_REMAIN) {
+        this.BAR_REMAIN = BAR_REMAIN;
+    }
+
+    public String getBAR_PRODCODE() {
+        return BAR_PRODCODE;
+    }
+
+    public void setBAR_PRODCODE(String BAR_PRODCODE) {
+        this.BAR_PRODCODE = BAR_PRODCODE;
+    }
+
+    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 String getBAR_LOCATION() {
+        return BAR_LOCATION;
+    }
+
+    public void setBAR_LOCATION(String BAR_LOCATION) {
+        this.BAR_LOCATION = BAR_LOCATION;
+    }
+
+    public String getBAR_WHCODE() {
+        return BAR_WHCODE;
+    }
+
+    public void setBAR_WHCODE(String BAR_WHCODE) {
+        this.BAR_WHCODE = BAR_WHCODE;
+    }
+
+    @Override
+    public String toString() {
+        return "WHMakeMaterialProduct{" +
+                "BAR_WHCODE='" + BAR_WHCODE + '\'' +
+                ", BAR_LOCATION='" + BAR_LOCATION + '\'' +
+                ", PR_SPEC='" + PR_SPEC + '\'' +
+                ", PR_DETAIL='" + PR_DETAIL + '\'' +
+                ", BAR_PRODCODE='" + BAR_PRODCODE + '\'' +
+                ", BAR_REMAIN=" + BAR_REMAIN +
+                '}';
+    }
+}

+ 335 - 11
app/src/main/java/com/uas/jc_wms/fragment/BarcodeInCollectFragment.java

@@ -1,33 +1,50 @@
 package com.uas.jc_wms.fragment;
 
+import android.annotation.SuppressLint;
 import android.content.Intent;
+import android.support.annotation.NonNull;
+import android.support.v7.widget.DefaultItemAnimator;
+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.TextUtils;
+import android.text.TextWatcher;
+import android.util.SparseBooleanArray;
 import android.view.KeyEvent;
+import android.view.LayoutInflater;
 import android.view.View;
+import android.view.ViewGroup;
 import android.view.inputmethod.EditorInfo;
 import android.widget.Button;
 import android.widget.CheckBox;
+import android.widget.CompoundButton;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.TextView;
 
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.android.volley.Request;
 import com.android.volley.toolbox.StringRequest;
 import com.uas.jc_wms.R;
 import com.uas.jc_wms.activity.FunctionActivity;
+import com.uas.jc_wms.bean.MaintainitemBean;
 import com.uas.jc_wms.global.GloableParams;
 import com.uas.jc_wms.util.CameraUtil;
 import com.uas.jc_wms.util.CommonUtil;
 import com.uas.jc_wms.util.FastjsonUtil;
 import com.uas.jc_wms.util.HttpCallback;
 import com.uas.jc_wms.util.HttpParams;
+import com.uas.jc_wms.util.LogUtil;
 import com.uas.jc_wms.util.VolleyRequest;
 import com.uas.jc_wms.view.ClearableEditText;
 import com.uuzuche.lib_zxing.activity.CaptureActivity;
 import com.uuzuche.lib_zxing.activity.CodeUtils;
 
+import java.util.ArrayList;
+
 /**
  * @author RaoMeng
  * @describe 条码入库
@@ -45,6 +62,11 @@ public class BarcodeInCollectFragment extends BaseFragment {
     private static final int SCAN_BARCODE_CODE = 101;
     private CheckBox ck_isclear;
 
+    private RecyclerView mRecyclerView;
+    private ArrayList<MaintainitemBean> mFeededList;
+    private SelectAdapter myAdapter;
+    private String barcodes = "";       //组合条码号
+
     @Override
     protected int getLayout() {
         return R.layout.fragment_barcode_in_collect;
@@ -69,6 +91,16 @@ public class BarcodeInCollectFragment extends BaseFragment {
         mPrdetailTextView = root.findViewById(R.id.barcode_in_collect_result_prdetail_tv);
         ck_isclear = root.findViewById(R.id.ck_isclear);
 
+        mBarcodeEditText.requestFocus();
+        //        mBarcodeEditText.post(new Runnable() {
+        //            @Override
+        //            public void run() {
+        //                // 显示软键盘
+        //                InputMethodManager imm = (InputMethodManager) mActivity.getSystemService(Context.INPUT_METHOD_SERVICE);
+        //                imm.showSoftInput(mBarcodeEditText, InputMethodManager.SHOW_IMPLICIT);
+        //            }
+        //        });
+
         CommonUtil.editTextGetFocus(mBarcodeEditText);
     }
 
@@ -80,20 +112,52 @@ public class BarcodeInCollectFragment extends BaseFragment {
                 if (actionId == EditorInfo.IME_ACTION_DONE
                         || actionId == EditorInfo.IME_ACTION_SEND
                         || (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
-                    getConfirmbarlocation();
+                    if (!TextUtils.isEmpty(mLocationEditText.getText().toString().trim())) {
+                        getOldConfirmbarlocation();
+                    } else {
+                        getbarlocation();
+                        mLocationEditText.requestFocus();
+                    }
                     return true;
                 }
                 return false;
             }
         });
 
+        mBarcodeEditText.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.toString().length() <= 0) {
+                    mFeededList.clear();
+                    barcodes = "";
+                    setAdapter(mFeededList);
+                }else {
+                    mRecyclerView.setVisibility(View.VISIBLE);
+                }
+            }
+        });
+
         mLocationEditText.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)) {
-                    mBarcodeEditText.requestFocus();
+                    if (!TextUtils.isEmpty(mBarcodeEditText.getText().toString().trim())) {
+                        getOldConfirmbarlocation();
+                    } else {
+                        mBarcodeEditText.requestFocus();
+                    }
                     return true;
                 }
                 return false;
@@ -119,12 +183,83 @@ public class BarcodeInCollectFragment extends BaseFragment {
         mConfirmButton.setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View view) {
-                getConfirmbarlocation();
+                getOldConfirmbarlocation();
             }
         });
     }
 
-    private void getConfirmbarlocation(){
+    private void getbarlocation() {
+        String barcode = mBarcodeEditText.getText().toString();
+        String location = mLocationEditText.getText().toString();
+        if (TextUtils.isEmpty(barcode)) {
+            CommonUtil.toastNoRepeat(mActivity, "请采集条码号");
+            return;
+        }
+        progressDialog.show();
+        VolleyRequest.getInstance().stringRequest(mStringRequest,
+                new HttpParams.Builder()
+                        .url(GloableParams.ADDRESS_BARCODE_ENTER)
+                        .method(Request.Method.POST)
+                        .addParam("barcode", barcode)
+                        .addParam("location", location)
+                        .tag(TAG + "CONFIRMBARLOCATION")
+                        .flag(1)
+                        .build(), new HttpCallback() {
+                    @Override
+                    public void onSuccess(int flag, Object o) throws Exception {
+                        mResultLayout.setVisibility(View.GONE);
+                        mBarcodeTextView.setText("");
+                        mInqtyTextView.setText("");
+                        mPrcodeTextView.setText("");
+                        mOrispeccodeTextView.setText("");
+                        mBatchcodeTextView.setText("");
+                        mLocationTextView.setText("");
+                        mPrdetailTextView.setText("");
+
+                        mRecyclerView.setVisibility(View.VISIBLE);
+
+                        progressDialog.dismiss();
+                        try {
+                            if (!ck_isclear.isChecked()) {
+                                mLocationEditText.setText("");
+                                mLocationEditText.requestFocus();
+                            } else {
+                                mBarcodeEditText.requestFocus();
+                            }
+                            String result = o.toString();
+                            JSONArray dataArray = FastjsonUtil.getJSONArray(result, "data");
+                            handleFeededData(dataArray);
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+                    }
+
+                    @Override
+                    public void onFail(int flag, String failStr) throws Exception {
+                        progressDialog.dismiss();
+                        CommonUtil.toastNoRepeat(mActivity, failStr);
+                    }
+                });
+    }
+
+    private void handleFeededData(JSONArray dataArray) {
+        MaintainitemBean bean;
+        mFeededList.clear();
+        barcodes = "";
+        for (Object index : dataArray) {
+            JSONObject data = (JSONObject) index;
+            bean = new MaintainitemBean();
+            bean.setBAN_BARCODE(data.getString("BAN_BARCODE"));
+            bean.setPR_DETAIL(data.getString("PR_DETAIL"));
+            bean.setPR_SPEC(data.getString("PR_SPEC"));
+            bean.setBAN_QTY(data.getInteger("BAN_QTY"));
+            bean.setChecked(false);
+            mFeededList.add(bean);
+        }
+        setAdapter(mFeededList);
+    }
+
+    private void getOldConfirmbarlocation() {
         String barcode = mBarcodeEditText.getText().toString();
         String location = mLocationEditText.getText().toString();
         if (TextUtils.isEmpty(barcode)) {
@@ -142,6 +277,7 @@ public class BarcodeInCollectFragment extends BaseFragment {
                         .method(Request.Method.POST)
                         .addParam("barcode", barcode)
                         .addParam("location", location)
+                        .addParam("barcodes", barcodes.length() > 1 ? barcodes.substring(0, barcodes.length() - 1) : barcodes)
                         .tag(TAG + "CONFIRMBARLOCATION")
                         .flag(1)
                         .build(), new HttpCallback() {
@@ -156,17 +292,19 @@ public class BarcodeInCollectFragment extends BaseFragment {
                         mLocationTextView.setText("");
                         mPrdetailTextView.setText("");
 
+                        mFeededList.clear();
+                        barcodes = "";
+                        setAdapter(mFeededList);
+
                         progressDialog.dismiss();
                         try {
                             mBarcodeEditText.setText("");
-                            if (!ck_isclear.isChecked()){
+                            if (!ck_isclear.isChecked()) {
                                 mLocationEditText.setText("");
                                 mLocationEditText.requestFocus();
-                            }else {
+                            } else {
                                 mBarcodeEditText.requestFocus();
                             }
-
-
                             String result = o.toString();
                             if (FastjsonUtil.validate(result)) {
                                 JSONObject resultObject = JSON.parseObject(result);
@@ -215,9 +353,9 @@ public class BarcodeInCollectFragment extends BaseFragment {
                                     }
                                 }
                             }
-                            getConfirmbarlocation();
+                            //  getConfirmbarlocation();
                         } catch (Exception e) {
-
+                            e.printStackTrace();
                         }
                     }
 
@@ -231,7 +369,21 @@ public class BarcodeInCollectFragment extends BaseFragment {
 
     @Override
     protected void initDatas() {
+        mFeededList = new ArrayList<>();
+        myAdapter = new SelectAdapter(mFeededList);
+        mRecyclerView = root.findViewById(R.id.feeded_rv);
+        mRecyclerView.addItemDecoration(new DividerItemDecoration(mActivity, LinearLayout.VERTICAL));
+        mRecyclerView.setLayoutManager(new LinearLayoutManager(mActivity));
+        //设置Item增加、移除动画
+        mRecyclerView.setItemAnimator(new DefaultItemAnimator());
+        setAdapter(mFeededList);
+        mRecyclerView.setAdapter(myAdapter);
+    }
 
+    private void setAdapter(ArrayList<MaintainitemBean> mList) {
+        LogUtil.i("mList", JSON.toJSONString(mList));
+        myAdapter = new SelectAdapter(mList);
+        mRecyclerView.setAdapter(myAdapter);
     }
 
     @Override
@@ -251,11 +403,21 @@ public class BarcodeInCollectFragment extends BaseFragment {
                 if (mFocusId == R.id.barcode_in_collect_barcode_et) {
                     mBarcodeEditText.setText(result);
                     mBarcodeEditText.setSelection(result.length());
+                    if (!TextUtils.isEmpty(mLocationEditText.getText().toString().trim())) {
+                        getOldConfirmbarlocation();
+                    } else {
+                        getbarlocation();
+                        mLocationEditText.requestFocus();
+                    }
                 } else if (mFocusId == R.id.barcode_in_collect_location_et) {
                     mLocationEditText.setText(result);
                     mLocationEditText.setSelection(result.length());
+                    if (!TextUtils.isEmpty(mBarcodeEditText.getText().toString().trim())) {
+                        getOldConfirmbarlocation();
+                    } else {
+                        mBarcodeEditText.requestFocus();
+                    }
                 }
-
             }
         }
     }
@@ -275,4 +437,166 @@ public class BarcodeInCollectFragment extends BaseFragment {
         super.onDestroyView();
         ((FunctionActivity) getActivity()).setScanIvVisible(false);
     }
+
+    public class SelectAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {
+
+        private ArrayList<MaintainitemBean> mList = new ArrayList<>();
+        private SparseBooleanArray mSelectedPositions = new SparseBooleanArray();
+        private boolean mIsSelectable = false;
+
+        public SelectAdapter(ArrayList<MaintainitemBean> list) {
+            if (list == null) {
+                throw new IllegalArgumentException("model Data must not be null");
+            }
+            mList = list;
+        }
+
+        //更新adpter的数据和选择状态
+        public void updateDataSet(ArrayList<MaintainitemBean> list) {
+            this.mList = list;
+            mSelectedPositions = new SparseBooleanArray();
+            //            ab.setTitle("已选择" + 0 + "项");
+        }
+
+        //获得选中条目的结果
+        public ArrayList<MaintainitemBean> getSelectedItem() {
+            ArrayList<MaintainitemBean> selectList = new ArrayList<>();
+            for (int i = 0; i < mList.size(); i++) {
+                if (isItemChecked(i)) {
+                    selectList.add(mList.get(i));
+                }
+            }
+            return selectList;
+        }
+
+
+        @Override
+        public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
+            View itemView = LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.recyclerview_item2, viewGroup, false);
+            return new ListItemViewHolder(itemView);
+        }
+
+        //设置给定位置条目的选择状态
+        private void setItemChecked(int position, boolean isChecked) {
+            mSelectedPositions.put(position, isChecked);
+        }
+
+        //根据位置判断条目是否选中
+        private boolean isItemChecked(int position) {
+            return mSelectedPositions.get(position);
+        }
+
+        //根据位置判断条目是否可选
+        private boolean isSelectable() {
+            return mIsSelectable;
+        }
+
+        //设置给定位置条目的可选与否的状态
+        private void setSelectable(boolean selectable) {
+            mIsSelectable = selectable;
+        }
+
+        //绑定界面,设置监听
+        @Override
+        public void onBindViewHolder(final @NonNull RecyclerView.ViewHolder holder, @SuppressLint("RecyclerView") int i) {
+            //设置条目状态
+            ((ListItemViewHolder) holder).tv_liaocode.setText("条码号:" + mList.get(i).getBAN_BARCODE());
+            ((ListItemViewHolder) holder).tv_liaotetall.setText("物料名称:" + mList.get(i).getPR_DETAIL());
+            ((ListItemViewHolder) holder).tv_liaospec.setText("物料规格:" + mList.get(i).getPR_SPEC());
+            ((ListItemViewHolder) holder).tv_liaospec3.setText("数量:" + mList.get(i).getBAN_QTY());
+
+            ((ListItemViewHolder) holder).checkBox.setChecked(mList.get(i).isChecked());
+
+            ((ListItemViewHolder) holder).checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+                @Override
+                public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+                    if (buttonView.isPressed()) {   //只有当用户主动点击时才处理选中状态变化
+                        if (isChecked) {
+                            if (!TextUtils.isEmpty(barcodes)) {
+                                if (!barcodes.contains(mList.get(i).getBAN_BARCODE())) {
+                                    barcodes += mList.get(i).getBAN_BARCODE() + ",";
+                                }
+                            } else {
+                                barcodes = mList.get(i).getBAN_BARCODE() + ",";
+                            }
+                        } else {
+                            if (!TextUtils.isEmpty(barcodes)) {
+                                if (barcodes.contains(mList.get(i).getBAN_BARCODE())) {
+                                    // barcodes += mList.get(i).getBAN_BARCODE() + ",";
+                                    int startIndex = barcodes.indexOf(mList.get(i).getBAN_BARCODE());
+                                    int endIndex = startIndex + mList.get(i).getBAN_BARCODE().length() + 1;
+                                    // 删除子串
+                                    barcodes = barcodes.substring(0, startIndex).concat(barcodes.substring(endIndex));
+                                }
+                            }
+                        }
+                    }
+
+                }
+            });
+
+
+            //条目view的监听
+            ((ListItemViewHolder) holder).itemView.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    LogUtil.e("aaa", "执行了: " + "itemView.setOnClickListener");
+                }
+            });
+
+            ((ListItemViewHolder) holder).ll_layout.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    LogUtil.e("aaa", "执行了: " + "ll_layout.setOnClickListener");
+                    boolean bbb = ((ListItemViewHolder) holder).checkBox.isChecked();
+                    ((ListItemViewHolder) holder).checkBox.setChecked(!bbb);
+                    mList.get(i).setChecked(!bbb);
+                    if (!bbb) {
+                        if (!TextUtils.isEmpty(barcodes)) {
+                            if (!barcodes.contains(mList.get(i).getBAN_BARCODE())) {
+                                barcodes += mList.get(i).getBAN_BARCODE() + ",";
+                            }
+                        } else {
+                            barcodes = mList.get(i).getBAN_BARCODE() + ",";
+                        }
+                    } else {
+                        if (!TextUtils.isEmpty(barcodes)) {
+                            if (barcodes.contains(mList.get(i).getBAN_BARCODE())) {
+                                // barcodes += mList.get(i).getBAN_BARCODE() + ",";
+                                int startIndex = barcodes.indexOf(mList.get(i).getBAN_BARCODE());
+                                int endIndex = startIndex + mList.get(i).getBAN_BARCODE().length() + 1;
+                                // 删除子串
+                                barcodes = barcodes.substring(0, startIndex).concat(barcodes.substring(endIndex));
+                            }
+                        }
+                    }
+                }
+            });
+        }
+
+        @Override
+        public int getItemCount() {
+            return mList == null ? 0 : mList.size();
+        }
+
+        public class ListItemViewHolder extends RecyclerView.ViewHolder {
+            //ViewHolder
+            CheckBox checkBox;
+            TextView tv_liaocode;
+            TextView tv_liaotetall;
+            TextView tv_liaospec;
+            TextView tv_liaospec3;
+            LinearLayout ll_layout;
+
+            ListItemViewHolder(View view) {
+                super(view);
+                this.tv_liaocode = (TextView) view.findViewById(R.id.tv_liaocode);
+                this.tv_liaotetall = (TextView) view.findViewById(R.id.tv_liaotetall);
+                this.tv_liaospec = (TextView) view.findViewById(R.id.tv_liaospec);
+                this.checkBox = (CheckBox) view.findViewById(R.id.select_checkbox);
+                this.tv_liaospec3 = (TextView) view.findViewById(R.id.tv_liaospec3);
+                this.ll_layout = (LinearLayout) view.findViewById(R.id.ll_layout);
+            }
+        }
+    }
 }

+ 3 - 3
app/src/main/java/com/uas/jc_wms/fragment/GoodOrBadFragment.java

@@ -298,7 +298,9 @@ public class GoodOrBadFragment extends BaseFragment implements View.OnClickListe
                     public void onSuccess(int flag, Object o) throws Exception {
                         progressDialog.dismiss();
                         Boolean isSuccess = FastjsonUtil.getBoolean(o.toString(),"success");
-                        JSONArray dataArray = FastjsonUtil.getJSONArray(o.toString(), "data");
+                        JSONObject data = FastjsonUtil.getJSONObject(o.toString(), "data");
+                        JSONArray dataArray = FastjsonUtil.getJSONArray(data.toString(), "whcode");
+//                        JSONArray dataArray = FastjsonUtil.getJSONArray(data.toString(), "data");
                         if (isSuccess){
                             if (dataArray == null){
                                 CommonUtil.toastNoRepeat(mActivity,"未搜索到匹配数据");
@@ -612,7 +614,6 @@ public class GoodOrBadFragment extends BaseFragment implements View.OnClickListe
                                 String pi_whcode = dataObject.getString("PI_WHCODE") == null ? "" : dataObject.getString("PI_WHCODE");
                                 String pi_whname = dataObject.getString("PI_WHNAME") == null ? "" : dataObject.getString("PI_WHNAME");
                                 jumpToStorageInAddDetail(pi_id,pi_inoutno,pi_whcode,pi_whname);
-
                             }
                         }
                     }
@@ -642,7 +643,6 @@ public class GoodOrBadFragment extends BaseFragment implements View.OnClickListe
         newOutboundDeliveryOrderDetailFragment.setArguments(bundle);
         //        jltStorageInBarcodeFragment.setOnFinishListener(this);
         FragmentUtils.switchFragment(GoodOrBadFragment.this, newOutboundDeliveryOrderDetailFragment);
-
     }
 
     @Override

+ 4 - 2
app/src/main/java/com/uas/jc_wms/fragment/IOCOutMakeMaterial.java

@@ -261,7 +261,8 @@ public class IOCOutMakeMaterial extends BaseFragment {
                         pi_id.append(dataList.get(i).getPI_ID() + ",");
                     }
 
-                    IOCOutMakeMaterialOper iocOutMakeMaterialOper = new IOCOutMakeMaterialOper();
+                    //IOCOutMakeMaterialOper iocOutMakeMaterialOper = new IOCOutMakeMaterialOper();
+                    IOCOutMakeMaterialOperNew iocOutMakeMaterialOper = new IOCOutMakeMaterialOperNew();
 
                     Bundle bundle = new Bundle();
                     if (pi_inoutno.length() >= 1)
@@ -434,7 +435,8 @@ public class IOCOutMakeMaterial extends BaseFragment {
         String pi_inoutno = dataList.get(i).getPI_INOUTNO();
         String pd_whcode = dataList.get(i).getPD_WHCODE();
         String pi_id = dataList.get(i).getPI_ID() + "";
-        IOCOutMakeMaterialOper iocOutMakeMaterialOper = new IOCOutMakeMaterialOper();
+//        IOCOutMakeMaterialOper iocOutMakeMaterialOper = new IOCOutMakeMaterialOper();
+        IOCOutMakeMaterialOperNew iocOutMakeMaterialOper = new IOCOutMakeMaterialOperNew();
 
         Bundle bundle = new Bundle();
         bundle.putString("pi_inoutno", pi_inoutno);

+ 3097 - 0
app/src/main/java/com/uas/jc_wms/fragment/IOCOutMakeMaterialOperNew.java

@@ -0,0 +1,3097 @@
+package com.uas.jc_wms.fragment;
+
+
+import android.app.Activity;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.graphics.drawable.BitmapDrawable;
+import android.net.Uri;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.support.annotation.Nullable;
+import android.support.v4.app.Fragment;
+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.TextUtils;
+import android.text.TextWatcher;
+import android.util.Log;
+import android.view.Gravity;
+import android.view.KeyEvent;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.Window;
+import android.view.inputmethod.EditorInfo;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.BaseAdapter;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.ListView;
+import android.widget.PopupWindow;
+import android.widget.RadioButton;
+import android.widget.RadioGroup;
+import android.widget.Spinner;
+import android.widget.TableLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.alibaba.fastjson.JSON;
+import com.android.volley.AuthFailureError;
+import com.android.volley.DefaultRetryPolicy;
+import com.android.volley.NetworkResponse;
+import com.android.volley.Request;
+import com.android.volley.Response;
+import com.android.volley.VolleyError;
+import com.android.volley.toolbox.HttpHeaderParser;
+import com.android.volley.toolbox.JsonObjectRequest;
+import com.android.volley.toolbox.StringRequest;
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
+import com.uas.jc_wms.R;
+import com.uas.jc_wms.activity.FunctionActivity;
+import com.uas.jc_wms.application.PdaApplication;
+import com.uas.jc_wms.bean.ErrorMsg;
+import com.uas.jc_wms.bean.IOCOutMakeMaterialOperMsd;
+import com.uas.jc_wms.bean.IOCOutmakeMaterialSplitBean;
+import com.uas.jc_wms.bean.MaterialInformationBean;
+import com.uas.jc_wms.bean.SubmitNotParam;
+import com.uas.jc_wms.bean.WHBreakingBatchBreakingBtnClickEventNew;
+import com.uas.jc_wms.database.DBManager;
+import com.uas.jc_wms.global.GloableParams;
+import com.uas.jc_wms.table.TableLBARCODEIO;
+import com.uas.jc_wms.table.TableLPRODIONEEDGET;
+import com.uas.jc_wms.tools.SharedPreUtil;
+import com.uas.jc_wms.tools.VolleyUtil;
+import com.uas.jc_wms.util.CameraUtil;
+import com.uas.jc_wms.util.CommonUtil;
+import com.uas.jc_wms.util.Constants;
+import com.uas.jc_wms.util.FastjsonUtil;
+import com.uas.jc_wms.util.FileUtils;
+import com.uas.jc_wms.util.FragmentUtils;
+import com.uas.jc_wms.util.HttpCallback;
+import com.uas.jc_wms.util.HttpParams;
+import com.uas.jc_wms.util.JsonTools;
+import com.uas.jc_wms.util.JsonUtils;
+import com.uas.jc_wms.util.LogUtil;
+import com.uas.jc_wms.util.PrintUtils;
+import com.uas.jc_wms.util.StringUtil;
+import com.uas.jc_wms.util.VolleyRequest;
+import com.uas.jc_wms.util.VollyRequest;
+import com.uas.jc_wms.view.ClearableEditText;
+import com.uuzuche.lib_zxing.activity.CaptureActivity;
+import com.uuzuche.lib_zxing.activity.CodeUtils;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.File;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.TimeUnit;
+
+import okhttp3.OkHttpClient;
+import razerdp.basepopup.BasePopupWindow;
+
+/**
+ * Created by RaoMeng on 2016/7/27.
+ * 材料出库采集页面
+ */
+public class IOCOutMakeMaterialOperNew extends BaseFragment implements View.OnClickListener, RadioGroup.OnCheckedChangeListener, HttpCallback {
+    private static final int SCAN_BARCODE_CODE = 103;
+    private static final int SPLIT_BARCODE_SUCCESS = 104;
+    private static final int SPLIT_BARCODE_FAIL = 105;
+    private static final int FLAG_CONFIRM_POST = 0x05;
+    private static final int BarcodeSplitting = 0x06;      //按条码拆分
+
+    private ImageView mScanImageView;
+
+    private JsonObjectRequest jsonRequest;
+    private static final String TAG = "IOCOutMakeMaterialOper";
+    private Button btnActionbarWithback, btnActionbarRight;
+    private String pi_inoutno;
+    private String pd_whcode;
+    private String pi_id;
+    private boolean isMultiple;
+    private Fragment mFragment;
+    private String mCollectType;
+
+    private PopupWindow listPopupWindow;
+    private StringRequest stringRequestPost;
+    private String mProdOutType;
+    private List<WHBreakingBatchBreakingBtnClickEventNew.DataBean> messages = new ArrayList<>();
+
+    private int mCollectModel = 1;//采集模式:1代表在线,0代表离线
+    private String mBarRemain, mRestqty;
+    private String mResult1, mResult2, mResult3, mResult4;
+    private List<String> mResults;
+
+    private TextWatcher watcher = new TextWatcher() {
+        @Override
+        public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+        }
+
+        @Override
+        public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
+
+        }
+
+        @Override
+        public void afterTextChanged(Editable editable) {
+            if (editable.length() == 0) {
+                btnConfirm.setEnabled(false);
+            } else {
+                btnConfirm.setEnabled(true);
+            }
+        }
+    };
+    private StringRequest stringRequest;
+    private PopupWindow splitPop;
+    private String strPrintDataList;
+    private StringRequest stringRequestSplit;
+    private DBManager mDbManager;
+    private StringRequest mStringRequest;
+    private ArrayAdapter mTypeSpAdapter;
+    private ArrayList<String> mCollectTypes;
+    private String mPrintUrl = "";
+    private Handler mHandler = new Handler() {
+        @Override
+        public void handleMessage(Message msg) {
+            super.handleMessage(msg);
+            switch (msg.what) {
+                case Constants.CONSTANT.PRINT_SUCCESS:
+                    if (progressDialog.isShowing())
+                        progressDialog.dismiss();
+                    closeSplitPopupWindow();
+                    Toast.makeText(mActivity, R.string.obtain_print_file_success, Toast.LENGTH_LONG).show();
+                    try {
+                        Intent intent = new Intent();
+                        ComponentName comp = new ComponentName("com.dynamixsoftware.printershare", "com.dynamixsoftware.printershare.ActivityPrintPDF");
+                        intent = new Intent();
+                        intent.setComponent(comp);
+                        intent.setAction("android.intent.action.VIEW");
+                        intent.setType("application/pdf");
+                        intent.setData(Uri.fromFile(new File(Constants.CONSTANT.PRINT_FILE_PATH, Constants.CONSTANT.PRINT_FILE_NAME)));
+                        startActivity(intent);
+                    } catch (Exception e) {
+                        Toast.makeText(mActivity, "打印失败", Toast.LENGTH_LONG).show();
+                        e.printStackTrace();
+                    }
+                    break;
+                case Constants.CONSTANT.PRINT_FAILED:
+                    if (progressDialog.isShowing())
+                        progressDialog.dismiss();
+                    Toast.makeText(mActivity, R.string.obtain_print_file_failed, Toast.LENGTH_LONG).show();
+                    break;
+                case Constants.CONSTANT.PRINT_OVERLOAD:
+                    if (progressDialog.isShowing())
+                        progressDialog.dismiss();
+                    Toast.makeText(mActivity, R.string.obtain_print_file_overload, Toast.LENGTH_LONG).show();
+                    break;
+                case SPLIT_BARCODE_SUCCESS:
+                    String s = (String) msg.obj;
+                    if (popupWindow != null && popupWindow.isShowing())
+                        closePopupWindow();
+                    mResults = new ArrayList<>();
+                    mCollectTypeRadioGroup.setEnabled(true);
+                    LogUtil.e("breaking", s);
+                    try {
+                        JSONObject jsonObject = new JSONObject(s);
+                        JSONObject dataObject = jsonObject.optJSONObject("data");
+                        if (dataObject == null) {
+                            return;
+                        }
+                        JSONObject messageObject = dataObject.optJSONObject("barcode");
+                        if (messageObject == null) {
+                            return;
+                        }
+                        if (messageObject.has("ISMSD")) {
+                            if (messageObject.optBoolean("ISMSD")) {
+                                //成功,有返回值,判断返回值message中isMsd是否存在,存在判断if(isMsd)true,弹出显示框
+                                iocOutMakeMaterialOperMsd = JsonTools.parseJsonToBean(jsonObject.toString(), IOCOutMakeMaterialOperMsd.class);
+                                //                            Log.i("msdresult", iocOutMakeMaterialOperMsd.toString());
+                                mBarRemain = CommonUtil.doubleFormat(iocOutMakeMaterialOperMsd.getData().getBarcode().getBAR_REMAIN());
+                                mRestqty = CommonUtil.doubleFormat(iocOutMakeMaterialOperMsd.getData().getBarcode().getRESTQTY());
+                                showDewPopupWindow();
+                            } else {
+                                mIocoutMaterialSplitBean = JsonTools.parseJsonToBean(messageObject.toString(), IOCOutmakeMaterialSplitBean.class);
+                                mBarRemain = CommonUtil.doubleFormat(mIocoutMaterialSplitBean.getBAR_REMAIN());
+                                mRestqty = CommonUtil.doubleFormat(mIocoutMaterialSplitBean.getRESTQTY());
+                                if (CommonUtil.doubleCompare(mIocoutMaterialSplitBean.getBAR_REMAIN(), mIocoutMaterialSplitBean.getRESTQTY()) == 1) {
+                                    spliteBarcode(currentBarcode, mBarRemain, mRestqty);
+                                }
+                            }
+                        } else {
+                            mCollectResultTextView.setVisibility(View.VISIBLE);
+                            mCollectResultTextView.setTextColor(getResources().getColor(R.color.green));
+                            mCollectResultTextView.setText(null);
+                            JSONArray listArray = dataObject.optJSONArray("nolist");
+                            if (mCollectType.equals("byBarcode") || mCollectType.equals("byBatchcode")) {
+                                String barcodeResult = "采集成功;" + JsonUtils.optStringNotNull(dataObject, "finishno")
+                                        + "\n条码:" + JsonUtils.optStringNotNull(messageObject, "BAR_CODE")
+                                        + ";数量:" + CommonUtil.doubleFormat(messageObject.optDouble("BAR_REMAIN"))
+                                        + ";批号:" + JsonUtils.optStringNotNull(messageObject, "BAR_BATCHCODE")
+                                        + ";料号:" + JsonUtils.optStringNotNull(messageObject, "BAR_PRODCODE")
+                                        + ";名称规格:" + messageObject.optString("PR_DETAIL")
+                                        + "  " + JsonUtils.optStringNotNull(messageObject, "PR_SPEC")
+                                        + ";仓位:" + JsonUtils.optStringNotNull(messageObject, "BAR_LOCATION");
+
+                                if (listArray != null && listArray.length() > 0) {
+                                    for (int i = 0; i < listArray.length(); i++) {
+                                        JSONObject listObject = listArray.optJSONObject(i);
+                                        barcodeResult = barcodeResult
+                                                + "\n单号:" + JsonUtils.optStringNotNull(listObject, "PI_INOUTNO")
+                                                + ";条码号:" + JsonUtils.optStringNotNull(listObject, "BAR_CODE")
+                                                + ";数量:" + CommonUtil.doubleFormat(JsonUtils.optDoubleNotNull(listObject, "BAR_REMAIN"));
+                                    }
+
+                                    //弹出拆分结果弹框
+                                    //                                    initBreakPopupWindow(listArray);
+                                }
+
+                                mCollectResultTextView.setText(barcodeResult);
+                                mCollectResultTextView.setTextColor(getResources().getColor(R.color.green));
+
+                                mBarcodeTableLayout.setVisibility(View.GONE);
+                                mBoxTableLayout.setVisibility(View.GONE);
+
+                                tvBarcodeCollectionSuccess.setVisibility(View.VISIBLE);
+                                tvBarcodeCollectionSuccess.setText("采集成功");
+
+                                mResult1 = messageObject.optString("BAR_CODE");
+                                mResult2 = messageObject.optDouble("BAR_REMAIN") + "";
+                                mResult3 = messageObject.optString("BAR_PRODCODE");
+
+                                mResults.add(mResult1);
+                                mResults.add(mResult2);
+                                mResults.add(mResult3);
+
+                                mCollectBarcodeTv.setText(mResult1);
+                                mCollectBarRemainTv.setText(mResult2);
+                                mCollectBarProdcodeTv.setText(mResult3);
+
+                                PdaApplication.putDataCache2Map(Constants.FLAG.MATERIAL_COLLECT_BARCODE_RESULT + pi_inoutno, mResults);
+                            } else if (false) {
+                                String boxResult = "采集成功;" + JsonUtils.optStringNotNull(dataObject, "finishno")
+                                        + "\n箱号:" + JsonUtils.optStringNotNull(messageObject, "BAR_OUTBOXCODE1")
+                                        + ";数量:" + CommonUtil.doubleFormat(messageObject.optDouble("BAR_REMAIN"))
+                                        + ";批号:" + JsonUtils.optStringNotNull(messageObject, "BAR_BATCHCODE")
+                                        + ";料号:" + JsonUtils.optStringNotNull(messageObject, "BAR_PRODCODE")
+                                        + ";名称规格:" + JsonUtils.optStringNotNull(messageObject, "PR_DETAIL")
+                                        + "  " + JsonUtils.optStringNotNull(messageObject, "PR_SPEC");
+
+
+                                if (listArray != null && listArray.length() > 0) {
+                                    for (int i = 0; i < listArray.length(); i++) {
+                                        JSONObject listObject = listArray.optJSONObject(i);
+                                        boxResult = boxResult
+                                                + "\n单号:" + JsonUtils.optStringNotNull(listObject, "PI_INOUTNO")
+                                                + ";条码号:" + JsonUtils.optStringNotNull(listObject, "BAR_CODE")
+                                                + ";数量:" + CommonUtil.doubleFormat(JsonUtils.optDoubleNotNull(listObject, "BAR_REMAIN"));
+                                    }
+                                }
+
+                                mCollectResultTextView.setText(boxResult);
+                                mCollectResultTextView.setTextColor(getResources().getColor(R.color.green));
+
+                                mBarcodeTableLayout.setVisibility(View.GONE);
+                                mBoxTableLayout.setVisibility(View.GONE);
+
+                                tvBoxCollectionSuccess.setVisibility(View.VISIBLE);
+                                tvBoxCollectionSuccess.setText("采集成功");
+
+                                mResult1 = messageObject.optString("PA_OUTBOXCODE");
+                                mResult2 = messageObject.optInt("PA_TOTALQTY") + "";
+                                mResult3 = messageObject.optString("PA_PRODCODE");
+                                mResult4 = messageObject.optString("PA_WHCODE");
+
+                                mResults.add(mResult1);
+                                mResults.add(mResult2);
+                                mResults.add(mResult3);
+                                mResults.add(mResult4);
+
+                                mCollectBoxTv.setText(mResult1);
+                                mCollectBoxNumTv.setText(mResult2);
+                                mCollectBoxrProdcodeTv.setText(mResult3);
+                                mCollectBoxWhcodeTv.setText(mResult4);
+
+                                PdaApplication.putDataCache2Map(Constants.FLAG.MATERIAL_COLLECT_BOX_RESULT + pi_inoutno, mResults);
+                            }
+                            CommonUtil.toastNoRepeat(getActivity(), "采集成功");
+
+                            Object next = jsonObject.getJSONObject("data").get("next");
+                            if (next != null && !"null".equals(next.toString())) {
+                                JSONObject nextObject = jsonObject.getJSONObject("data").getJSONObject("next");
+                                MaterialInformationBean.DataBean materialInformationBean = JsonTools.parseJsonToBean(nextObject.toString(), MaterialInformationBean.DataBean.class);
+                                if (materialInformationBean != null) {
+                                    String materialInfo =
+                                            "型号:" + (materialInformationBean.getPR_ORISPECCODE() == null ? "" : materialInformationBean.getPR_ORISPECCODE())
+                                                    + "物料:" + (materialInformationBean.getPD_PRODCODE() == null ? "" : materialInformationBean.getPD_PRODCODE())
+                                                    + "; 名称规格:" + (materialInformationBean.getPR_DETAIL() == null ? "" : materialInformationBean.getPR_DETAIL())
+                                                    + "  " + (materialInformationBean.getPR_SPEC() == null ? "" : materialInformationBean.getPR_SPEC())
+                                                    + "; 未备料数:" + (materialInformationBean.getPD_RESTQTY() == null ? "" : materialInformationBean.getPD_RESTQTY())
+                                                    + "; 批数量:" + (CommonUtil.doubleFormat(materialInformationBean.getBAR_REMAIN()))
+                                                    + "; 仓位:" + (materialInformationBean.getBAR_LOCATION() == null ? "" : materialInformationBean.getBAR_LOCATION());
+                                    if (materialInformationBean.getPD_BATCHCODE() != null) {
+                                        materialInfo = materialInfo + "; 批号:" + materialInformationBean.getPD_BATCHCODE();
+                                    }
+                                    mMaterialInforTextView.setText(materialInfo);
+                                }
+                            } else {
+                                mMaterialInforTextView.setText("该出库单已经完成备料");
+                            }
+                        }
+
+                    } catch (JSONException e) {
+                        e.printStackTrace();
+                    }
+                    break;
+                case SPLIT_BARCODE_FAIL:
+                    s = (String) msg.obj;
+                    String errorStr = "请求失败";
+                    if (JsonUtils.validate(s)) {
+                        try {
+                            JSONObject errorObject = new JSONObject(s);
+                            String exceptionInfo = JsonUtils.optStringNotNull(errorObject, "exceptionInfo");
+                            if (TextUtils.isEmpty(exceptionInfo)) {
+                                errorStr = "系统错误";
+                            } else {
+                                errorStr = exceptionInfo;
+                            }
+                        } catch (JSONException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                    if (getActivity() != null) {
+                        try {
+                            etBarCode.setText(null);
+                            CommonUtil.editTextGetFocus(etBarCode);
+                            CommonUtil.makeNotice();
+                            CommonUtil.toastNoRepeat(getActivity(), errorStr);
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                        }
+
+                    }
+                    break;
+                default:
+                    break;
+            }
+        }
+    };
+    private okhttp3.Request mRequest;
+    private OkHttpClient mOkHttpClient;
+    private int mFocusId;
+    private String currentBarcode;
+    private boolean isConnected = false;
+    private String mOldAddress = "";
+    private int mPrintDpi = 203;
+    private boolean isPrinting = false;
+    private TextView tvPiInoutno;
+    private TextView tvPdWhcode;
+    private ClearableEditText etBarCode;
+    private Button btnConfirm;
+    private RadioGroup mCollectTypeRadioGroup;
+    private RadioButton mBarcodeRadioButton;
+    private RadioButton mBoxRadioButton;
+    private TableLayout mBarcodeTableLayout;
+    private TableLayout mBoxTableLayout;
+    private TextView tvBarcodeCollectionSuccess;
+    private TextView mCollectBarcodeTv;
+    private TextView mCollectBarRemainTv;
+    private TextView mCollectBarProdcodeTv;
+    private TextView tvBoxCollectionSuccess;
+    private TextView mCollectBoxTv;
+    private TextView mCollectBoxNumTv;
+    private TextView mCollectBoxrProdcodeTv;
+    private TextView mCollectBoxWhcodeTv;
+    private Button mCollectModelBtn;
+    private TextView mtypeNameTv;
+    private Spinner mTypeSpinner;
+    private TextView mMaterialInforTextView;
+    private TextView mCollectResultTextView;
+    private Button btn_oneprint;
+    private com.alibaba.fastjson.JSONArray listArray;
+
+    private RecyclerView rv_line_ip_port_data;
+    private IpAndResourcesPortAdapter ipAndResourcesPortAdapter;
+    private ArrayList<ComDataBean> ComDataBeanList;
+    private PopupWindow editPW;
+    private ClearableEditText edit_et;
+    private String sc_name, sc_code;
+
+    @Override
+    protected int getLayout() {
+        return R.layout.fragment_iocout_make_material_oper;
+    }
+
+    @Override
+    protected void initViews() {
+        ((TextView) (getActivity().findViewById(R.id.tv_actionbar_withback))).setText(getString(R.string.out_material_collect));
+        //        ((FunctionActivity) getActivity()).fragment = new IOCOutMakeMaterialOper();
+        ((FunctionActivity) getActivity()).setMoreBtnVisible(true);
+        ((FunctionActivity) getActivity()).setScanIvVisible(true);
+
+        ComDataBeanList = new ArrayList<>();
+
+        mScanImageView = (ImageView) mActivity.findViewById(R.id.btn_actionbar_scan_iv);
+        tvPiInoutno = mActivity.findViewById(R.id.tv_pi_inoutno);
+        tvPdWhcode = mActivity.findViewById(R.id.tv_pd_whcode);
+        etBarCode = mActivity.findViewById(R.id.et_bar_code);
+        btnConfirm = mActivity.findViewById(R.id.btn_confirm);
+
+        mCollectTypeRadioGroup = mActivity.findViewById(R.id.iocout_collect_rg);
+        mBarcodeRadioButton = mActivity.findViewById(R.id.iocout_collect_barcode_rb);
+        mBoxRadioButton = mActivity.findViewById(R.id.iocout_collect_box_rb);
+        mBarcodeTableLayout = mActivity.findViewById(R.id.iocout_collect_barcode_tl);
+        mBoxTableLayout = mActivity.findViewById(R.id.iocout_collect_box_tl);
+
+        tvBarcodeCollectionSuccess = mActivity.findViewById(R.id.tv_barcode_collection_success);
+        mCollectBarcodeTv = mActivity.findViewById(R.id.iocout_bar_code_tv);
+        mCollectBarRemainTv = mActivity.findViewById(R.id.iocout_bar_remain_tv);
+        mCollectBarProdcodeTv = mActivity.findViewById(R.id.iocout_bar_prodcode_tv);
+        tvBoxCollectionSuccess = mActivity.findViewById(R.id.tv_box_collection_success);
+        mCollectBoxTv = mActivity.findViewById(R.id.iocout_box_tv);
+        mCollectBoxNumTv = mActivity.findViewById(R.id.iocout_box_num_tv);
+        mCollectBoxrProdcodeTv = mActivity.findViewById(R.id.iocout_box_prodcode_tv);
+        mCollectBoxWhcodeTv = mActivity.findViewById(R.id.iocout_box_whcode_tv);
+        mCollectModelBtn = mActivity.findViewById(R.id.iocout_collect_model_btn);
+        mtypeNameTv = mActivity.findViewById(R.id.iocout_material_type_tv);
+        mTypeSpinner = mActivity.findViewById(R.id.iocout_material_type_sp);
+        mMaterialInforTextView = mActivity.findViewById(R.id.iocout_next_material_information);
+        mCollectResultTextView = mActivity.findViewById(R.id.iocout_collect_result);
+        btn_oneprint = root.findViewById(R.id.btn_oneprint);
+
+        mDbManager = new DBManager(getActivity().getApplicationContext());
+        mOkHttpClient = new OkHttpClient.Builder()
+                .sslSocketFactory(FileUtils.createSSLSocketFactory(), new FileUtils.TrustAllCerts())
+                .hostnameVerifier(new FileUtils.TrustAllHostnameVerifier())
+                .connectTimeout(30, TimeUnit.SECONDS)
+                .readTimeout(30, TimeUnit.SECONDS).build();
+
+        mProdOutType = SharedPreUtil.getString(getActivity().getApplicationContext(), Constants.FLAG.PRODOUT_TYPE_CACHE, "byBatch");
+        //获取上一个Fragment(即IOCOutMakeMaterial里面的数据)
+        Bundle bundle = getArguments();
+        if (bundle != null) {
+            pi_inoutno = bundle.getString("pi_inoutno");
+            pd_whcode = bundle.getString("pd_whcode") == null ? "" : bundle.getString("pd_whcode");
+            pi_id = bundle.getString("pi_id");
+            isMultiple = bundle.getBoolean("isMultiple");
+        }
+
+        mResults = new ArrayList<>();
+        if (mCollectModel == 1) {
+            mCollectModelBtn.setText("在线");
+        } else if (mCollectModel == 0) {
+            mCollectModelBtn.setText("离线");
+        }
+
+        //条码输入框获取焦点
+        etBarCode.requestFocus();
+
+        tvPiInoutno.setText(pi_inoutno);
+        tvPdWhcode.setText(pd_whcode);
+
+        mCollectTypes = new ArrayList<>();
+        mCollectTypes.add("条码号");
+        mCollectTypes.add("外箱号");
+
+        mTypeSpAdapter = new ArrayAdapter<>(getActivity(), R.layout.layout_myspinner, mCollectTypes);
+        mTypeSpAdapter.setDropDownViewResource(R.layout.layout_myspinner_dropdown);
+        mTypeSpinner.setAdapter(mTypeSpAdapter);
+
+        mBarcodeTableLayout.setVisibility(View.GONE);
+        mBoxTableLayout.setVisibility(View.GONE);
+        mCollectType = SharedPreUtil.getString(getActivity().getApplicationContext(), Constants.FLAG.MATERIAL_OUT_COLLECT_TYPE, "byBarcode");
+
+        if (mCollectType != null) {
+            //取消箱号采集
+            if (mCollectType.equals("byBarcode")) {
+                mCollectType = "byBarcode";
+                CommonUtil.setSpinnerItemSelectedByValue(mTypeSpinner, "条码号");
+                etBarCode.setHint(R.string.please_collect_barcode);
+                mtypeNameTv.setText("条码");
+            } else if (mCollectType.equals("byBatchcode")) {
+                CommonUtil.setSpinnerItemSelectedByValue(mTypeSpinner, "箱号");
+                etBarCode.setHint("请采集箱号");
+                mtypeNameTv.setText("箱号");
+            }
+        }
+        btnActionbarRight = (Button) getActivity().findViewById(R.id.btn_actionbar_more);
+
+        isConnected = (SharedPreUtil.getInt(mActivity, "printConnect", 0) == 1);
+        mOldAddress = SharedPreUtil.getString(mActivity, "printAddress", "");
+        mPrintDpi = SharedPreUtil.getInt(mActivity, "printDpi", 203);
+    }
+
+    @Override
+    protected void initEvents() {
+        btnActionbarRight.setOnClickListener(this);
+        etBarCode.addTextChangedListener(watcher);
+        mCollectTypeRadioGroup.setOnCheckedChangeListener(this);
+        mCollectModelBtn.setOnClickListener(this);
+        mScanImageView.setOnClickListener(this);
+
+        etBarCode.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+            @Override
+            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+                if (actionId == EditorInfo.IME_ACTION_SEND
+                        || (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
+                    confirmEvent();
+                    return true;
+                }
+                return false;
+            }
+        });
+
+        mtypeNameTv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                String typeName = mtypeNameTv.getText().toString().trim();
+                if ("条码".equals(typeName)) {
+                    changeToTypeBatch();
+                } else if ("箱号".equals(typeName)) {
+                    changeToTypeBarcode();
+                }
+            }
+        });
+
+        mTypeSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
+            @Override
+            public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
+                if (mCollectTypes != null) {
+                    if (mCollectTypes.get(position).equals("条码号")) {
+                        changeToTypeBarcode();
+                    } else if (mCollectTypes.get(position).equals("外箱号")) {
+                        changeToTypeBatch();
+                    }
+                }
+            }
+
+            @Override
+            public void onNothingSelected(AdapterView<?> parent) {
+
+            }
+        });
+        btn_oneprint.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (listArray != null && listArray.size() > 0) {
+                    printEvent(listArray);
+                } else {
+                    CommonUtil.toastNoRepeat(mActivity, "数据为空");
+                }
+            }
+        });
+    }
+
+    /**
+     * 采集方式切换成箱号
+     */
+    private void changeToTypeBatch() {
+        etBarCode.setHint("请采集箱号");
+        mtypeNameTv.setText("箱号");
+        SharedPreUtil.saveString(getActivity().getApplicationContext(), Constants.FLAG.MATERIAL_OUT_COLLECT_TYPE, "byBatchcode");
+        mCollectType = "byBatchcode";
+
+        mBarcodeTableLayout.setVisibility(View.GONE);
+        mBoxTableLayout.setVisibility(View.GONE);
+
+        mResults = (List<String>) PdaApplication.getDataCacheFromMap(Constants.FLAG.MATERIAL_COLLECT_BOX_RESULT + pi_inoutno);
+
+        if (mResults != null && mResults.size() == 4) {
+            tvBoxCollectionSuccess.setVisibility(View.VISIBLE);
+            tvBoxCollectionSuccess.setText("采集成功");
+
+            mCollectBoxTv.setText(mResults.get(0));
+            mCollectBoxNumTv.setText(mResults.get(1));
+            mCollectBoxrProdcodeTv.setText(mResults.get(2));
+            mCollectBoxWhcodeTv.setText(mResults.get(3));
+        } else {
+            tvBoxCollectionSuccess.setVisibility(View.GONE);
+            mCollectBoxTv.setText(null);
+            mCollectBoxNumTv.setText(null);
+            mCollectBoxrProdcodeTv.setText(null);
+            mCollectBoxWhcodeTv.setText(null);
+        }
+    }
+
+    /**
+     * 采集方式切换成条码号
+     */
+    private void changeToTypeBarcode() {
+        etBarCode.setHint(R.string.please_collect_barcode);
+        mtypeNameTv.setText("条码");
+        SharedPreUtil.saveString(getActivity().getApplicationContext(), Constants.FLAG.MATERIAL_OUT_COLLECT_TYPE, "byBarcode");
+        mCollectType = "byBarcode";
+
+        //        mBarcodeTableLayout.setVisibility(View.VISIBLE);
+        mBarcodeTableLayout.setVisibility(View.GONE);
+        mBoxTableLayout.setVisibility(View.GONE);
+
+        mResults = (List<String>) PdaApplication.getDataCacheFromMap(Constants.FLAG.MATERIAL_COLLECT_BARCODE_RESULT + pi_inoutno);
+
+        if (mResults != null && mResults.size() == 3) {
+            tvBarcodeCollectionSuccess.setVisibility(View.VISIBLE);
+            tvBarcodeCollectionSuccess.setText("采集成功");
+
+            mCollectBarcodeTv.setText(mResults.get(0));
+            mCollectBarRemainTv.setText(mResults.get(1));
+            mCollectBarProdcodeTv.setText(mResults.get(2));
+        } else {
+            tvBarcodeCollectionSuccess.setVisibility(View.GONE);
+            mCollectBarcodeTv.setText(null);
+            mCollectBarRemainTv.setText(null);
+            mCollectBarProdcodeTv.setText(null);
+        }
+    }
+
+    @Override
+    protected void initDatas() {
+        if (CommonUtil.isNetWorkConnected(mActivity)) {
+            getNextMaterialInfo();
+        } else {
+            CommonUtil.toastNoRepeat(mActivity, getString(R.string.net_not_connect));
+            mMaterialInforTextView.setText(getString(R.string.net_not_connect));
+        }
+    }
+
+    /**
+     * 获取下一采集货品信息
+     */
+    private void getNextMaterialInfo() {
+        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;
+            }
+        }
+
+        PdaApplication.mRequestQueue.cancelAll(TAG + "getnext");
+        mStringRequest = new StringRequest(Request.Method.GET, url,
+                new Response.Listener<String>() {
+                    @Override
+                    public void onResponse(String s) {
+                        progressDialog.dismiss();
+                        Log.i("materialinfo", s);
+                        MaterialInformationBean materialInformationBean = JsonTools.parseJsonToBean(s, MaterialInformationBean.class);
+                        if (materialInformationBean != null && materialInformationBean.getData() != null) {
+                            String materialInfo =
+                                    "型号:" + (materialInformationBean.getData().getPR_ORISPECCODE() == null ? "" : materialInformationBean.getData().getPR_ORISPECCODE())
+                                            + "物料:" + (materialInformationBean.getData().getPD_PRODCODE() == null ? "" : materialInformationBean.getData().getPD_PRODCODE())
+                                            + "; 名称规格:" + (materialInformationBean.getData().getPR_DETAIL() == null ? "" : materialInformationBean.getData().getPR_DETAIL())
+                                            + "  " + (materialInformationBean.getData().getPR_SPEC() == null ? "" : materialInformationBean.getData().getPR_SPEC())
+                                            + "; 未备料数:" + (materialInformationBean.getData().getPD_RESTQTY() == null ? "" : materialInformationBean.getData().getPD_RESTQTY())
+                                            + "; 批数量:" + (CommonUtil.doubleFormat(materialInformationBean.getData().getBAR_REMAIN()))
+                                            + "; 仓位:" + (materialInformationBean.getData().getBAR_LOCATION() == null ? "" : materialInformationBean.getData().getBAR_LOCATION())
+                                            + "; DC:" + (materialInformationBean.getData().getDC() == null ? "" : materialInformationBean.getData().getDC())
+                                            + "; 线别仓可用库存:" + (materialInformationBean.getData().getV_RESTQTY() == null ? "" : materialInformationBean.getData().getV_RESTQTY());
+                            if (materialInformationBean.getData().getPD_BATCHCODE() != null) {
+                                materialInfo = materialInfo + "; 批号:" + materialInformationBean.getData().getPD_BATCHCODE();
+                            }
+                            if (mMaterialInforTextView != null)
+                                mMaterialInforTextView.setText(materialInfo);
+                        } else {
+                            if (mMaterialInforTextView != null)
+                                mMaterialInforTextView.setText("该出库单当前的仓库已经完成备料");
+                        }
+                    }
+                },
+                new Response.ErrorListener() {
+                    @Override
+                    public void onErrorResponse(VolleyError volleyError) {
+                        progressDialog.dismiss();
+                        String errorMsg = CommonUtil.showErrorToast(volleyError);
+                        if (mMaterialInforTextView != null)
+                            mMaterialInforTextView.setText(errorMsg);
+                    }
+                }) {
+            @Override
+            public Map<String, String> getHeaders() throws AuthFailureError {
+                return VolleyUtil.getVolleyUtil().setCookies();
+            }
+        };
+        mStringRequest.setRetryPolicy(new DefaultRetryPolicy(10 * 1000, 0, 1f));
+        mStringRequest.setTag(TAG + "getnext");
+        PdaApplication.mRequestQueue.add(mStringRequest);
+    }
+
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        return false;
+    }
+
+    //  材料出库确认
+    private IOCOutMakeMaterialOperMsd iocOutMakeMaterialOperMsd;
+    // 需要拆分材料
+    private IOCOutmakeMaterialSplitBean mIocoutMaterialSplitBean;
+
+    /**
+     * 在线模式确认按钮提交事件
+     */
+    private void barcodeEnterEvent(boolean msdcheck, boolean datecheck) {
+        progressDialog.show();
+        //        currentBarcode = etBarCode.getText().toString().trim();
+        String url = (isMultiple ? GloableParams.ADDRESS_OUT_BYBATCH_DEAL : GloableParams.ADDRESS_OUT_BYBATCH_DEAL)
+                + "?barcode=" + currentBarcode
+                + (isMultiple ? "&ids=" : "&ids=")
+                + pi_id + "&whcode=" + pd_whcode
+                + "&type=barcode&msdcheck=" + msdcheck
+                + "&datecheck=" + datecheck;
+        try {
+            if (mProdOutType != null && mCollectType != null) {
+                if (mProdOutType.equals("byProdcode")) {
+                    if (mCollectType.equals("byBarcode")) {
+                        url = (isMultiple ? GloableParams.ADDRESS_OUT_BYBATCH_DEAL : GloableParams.ADDRESS_OUT_BYBATCH_DEAL)
+                                + "?barcode=" + URLEncoder.encode(currentBarcode, "utf-8")
+                                + (isMultiple ? "&ids=" : "&ids=")
+                                + pi_id + "&whcode=" + pd_whcode
+                                + "&type=barcode&msdcheck=" + msdcheck
+                                + "&datecheck=" + datecheck;
+
+                    } else if (mCollectType.equals("byBatchcode")) {
+                        url = (isMultiple ? GloableParams.ADDRESS_OUT_BYBATCH_DEAL : GloableParams.ADDRESS_OUT_BYBATCH_DEAL)
+                                + "?barcode=" + URLEncoder.encode(currentBarcode, "utf-8")
+                                + (isMultiple ? "&ids=" : "&ids=")
+                                + pi_id + "&whcode=" + pd_whcode
+                                + "&type=boxcode&msdcheck=" + msdcheck
+                                + "&datecheck=" + datecheck;
+                    }
+                } else if (mProdOutType.equals("byBatch")) {
+                    if (mCollectType.equals("byBarcode")) {
+                        url = (isMultiple ? GloableParams.ADDRESS_OUT_BYBATCH_DEAL : GloableParams.ADDRESS_OUT_BYBATCH_DEAL)
+                                + "?barcode=" + URLEncoder.encode(currentBarcode, "utf-8")
+                                + (isMultiple ? "&ids=" : "&ids=")
+                                + pi_id + "&whcode=" + pd_whcode
+                                + "&type=barcode&msdcheck=" + msdcheck
+                                + "&datecheck=" + datecheck;
+                    } else if (mCollectType.equals("byBatchcode")) {
+                        url = (isMultiple ? GloableParams.ADDRESS_OUT_BYBATCH_DEAL : GloableParams.ADDRESS_OUT_BYBATCH_DEAL)
+                                + "?barcode=" + URLEncoder.encode(currentBarcode, "utf-8")
+                                + (isMultiple ? "&ids=" : "&ids=")
+                                + pi_id + "&whcode=" + pd_whcode
+                                + "&type=boxcode&msdcheck=" + msdcheck
+                                + "&datecheck=" + datecheck;
+                    }
+
+                }
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+        LogUtil.i("iocouturl", url);
+        etBarCode.setText(null);
+        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();
+                mResults = new ArrayList<>();
+                mCollectTypeRadioGroup.setEnabled(true);
+                LogUtil.e("!!!ok", jsonObject.toString());
+                try {
+                    JSONObject dataObject = jsonObject.optJSONObject("data");
+                    if (dataObject == null) {
+                        CommonUtil.toastNoRepeat(mActivity, "采集结果获取失败!");
+                        return;
+                    }
+                    JSONObject messageObject = dataObject.getJSONObject("barcode");
+
+                    if (messageObject.has("IFOVER") && messageObject.optBoolean("IFOVER")) {
+                        new AlertDialog.Builder(mActivity)
+                                .setMessage("采集条码[" + messageObject.optString("BAR_CODE") + "]有效期已过,是否继续采集?")
+                                .setNegativeButton(R.string.cancel, null)
+                                .setPositiveButton(R.string.confirm, new DialogInterface.OnClickListener() {
+                                    @Override
+                                    public void onClick(DialogInterface dialogInterface, int i) {
+                                        dialogInterface.dismiss();
+                                        barcodeEnterEvent(false, false);
+                                    }
+                                }).create().show();
+                    } else if (messageObject.has("ISMSD")) {
+                        if (messageObject.optBoolean("ISMSD")) {
+                            //成功,有返回值,判断返回值message中isMsd是否存在,存在判断if(isMsd)true,弹出显示框
+                            iocOutMakeMaterialOperMsd = JsonTools.parseJsonToBean(jsonObject.toString(), IOCOutMakeMaterialOperMsd.class);
+                            if (iocOutMakeMaterialOperMsd != null) {
+                                Log.i("msdresult", iocOutMakeMaterialOperMsd.toString());
+                                mBarRemain = CommonUtil.doubleFormat(iocOutMakeMaterialOperMsd.getData().getBarcode().getBAR_REMAIN());
+                                mRestqty = CommonUtil.doubleFormat(iocOutMakeMaterialOperMsd.getData().getBarcode().getRESTQTY());
+                                showDewPopupWindow();
+                            }
+                        } else {
+                            mIocoutMaterialSplitBean = JsonTools.parseJsonToBean(messageObject.toString(), IOCOutmakeMaterialSplitBean.class);
+                            mBarRemain = CommonUtil.doubleFormat(mIocoutMaterialSplitBean.getBAR_REMAIN());
+                            mRestqty = CommonUtil.doubleFormat(mIocoutMaterialSplitBean.getRESTQTY());
+                            if (CommonUtil.doubleCompare(mIocoutMaterialSplitBean.getBAR_REMAIN(), mIocoutMaterialSplitBean.getRESTQTY()) == 1) {
+                                spliteBarcode(currentBarcode, mBarRemain, mRestqty);
+                            }
+                        }
+                    } else {
+                        mCollectResultTextView.setVisibility(View.VISIBLE);
+                        mCollectResultTextView.setTextColor(getResources().getColor(R.color.green));
+                        mCollectResultTextView.setText(null);
+                        JSONArray listArray = dataObject.optJSONArray("nolist");
+                        if (mCollectType.equals("byBarcode") || mCollectType.equals("byBatchcode")) {
+                            String barcodeResult = "采集成功;" + JsonUtils.optStringNotNull(dataObject, "finishno")
+                                    + "\n条码:" + JsonUtils.optStringNotNull(messageObject, "BAR_CODE")
+                                    + ";数量:" + CommonUtil.doubleFormat(messageObject.optDouble("BAR_REMAIN"))
+                                    + ";批号:" + JsonUtils.optStringNotNull(messageObject, "BAR_BATCHCODE")
+                                    + ";料号:" + JsonUtils.optStringNotNull(messageObject, "BAR_PRODCODE")
+                                    + ";名称规格:" + messageObject.optString("PR_DETAIL")
+                                    + "  " + JsonUtils.optStringNotNull(messageObject, "PR_SPEC")
+                                    + ";仓位:" + JsonUtils.optStringNotNull(messageObject, "BAR_LOCATION");
+
+                            if (listArray != null && listArray.length() > 0) {
+                                for (int i = 0; i < listArray.length(); i++) {
+                                    JSONObject listObject = listArray.optJSONObject(i);
+                                    barcodeResult = barcodeResult
+                                            + "\n单号:" + JsonUtils.optStringNotNull(listObject, "PI_INOUTNO")
+                                            + ";条码号:" + JsonUtils.optStringNotNull(listObject, "BAR_CODE")
+                                            + ";数量:" + CommonUtil.doubleFormat(JsonUtils.optDoubleNotNull(listObject, "BAR_REMAIN"));
+                                }
+                            }
+
+                            mCollectResultTextView.setText(barcodeResult);
+                            mCollectResultTextView.setTextColor(getResources().getColor(R.color.green));
+
+                            mBarcodeTableLayout.setVisibility(View.GONE);
+                            mBoxTableLayout.setVisibility(View.GONE);
+
+                            tvBarcodeCollectionSuccess.setVisibility(View.VISIBLE);
+                            tvBarcodeCollectionSuccess.setText("采集成功");
+
+                            mResult1 = messageObject.optString("BAR_CODE");
+                            mResult2 = messageObject.optDouble("BAR_REMAIN") + "";
+                            mResult3 = messageObject.optString("BAR_PRODCODE");
+
+                            mResults.add(mResult1);
+                            mResults.add(mResult2);
+                            mResults.add(mResult3);
+
+                            mCollectBarcodeTv.setText(mResult1);
+                            mCollectBarRemainTv.setText(mResult2);
+                            mCollectBarProdcodeTv.setText(mResult3);
+
+                            PdaApplication.putDataCache2Map(Constants.FLAG.MATERIAL_COLLECT_BARCODE_RESULT + pi_inoutno, mResults);
+                        } else if (false) {
+                            String boxResult = "采集成功;" + JsonUtils.optStringNotNull(dataObject, "finishno")
+                                    + "\n箱号:" + JsonUtils.optStringNotNull(messageObject, "BAR_OUTBOXCODE1")
+                                    + ";数量:" + CommonUtil.doubleFormat(messageObject.optDouble("BAR_REMAIN"))
+                                    + ";批号:" + JsonUtils.optStringNotNull(messageObject, "BAR_BATCHCODE")
+                                    + ";料号:" + JsonUtils.optStringNotNull(messageObject, "BAR_PRODCODE")
+                                    + ";名称规格:" + JsonUtils.optStringNotNull(messageObject, "PR_DETAIL")
+                                    + "  " + JsonUtils.optStringNotNull(messageObject, "PR_SPEC");
+
+                            if (listArray != null && listArray.length() > 0) {
+                                for (int i = 0; i < listArray.length(); i++) {
+                                    JSONObject listObject = listArray.optJSONObject(i);
+                                    boxResult = boxResult
+                                            + "\n单号:" + JsonUtils.optStringNotNull(listObject, "PI_INOUTNO")
+                                            + ";条码号:" + JsonUtils.optStringNotNull(listObject, "BAR_CODE")
+                                            + ";数量:" + CommonUtil.doubleFormat(JsonUtils.optDoubleNotNull(listObject, "BAR_REMAIN"));
+                                }
+                            }
+
+                            mCollectResultTextView.setText(boxResult);
+                            mCollectResultTextView.setTextColor(getResources().getColor(R.color.green));
+
+
+                            mBarcodeTableLayout.setVisibility(View.GONE);
+                            mBoxTableLayout.setVisibility(View.GONE);
+
+                            tvBoxCollectionSuccess.setVisibility(View.VISIBLE);
+                            tvBoxCollectionSuccess.setText("采集成功");
+
+                            mResult1 = messageObject.optString("PA_OUTBOXCODE");
+                            mResult2 = messageObject.optInt("PA_TOTALQTY") + "";
+                            mResult3 = messageObject.optString("PA_PRODCODE");
+                            mResult4 = messageObject.optString("PA_WHCODE");
+
+                            mResults.add(mResult1);
+                            mResults.add(mResult2);
+                            mResults.add(mResult3);
+                            mResults.add(mResult4);
+
+                            mCollectBoxTv.setText(mResult1);
+                            mCollectBoxNumTv.setText(mResult2);
+                            mCollectBoxrProdcodeTv.setText(mResult3);
+                            mCollectBoxWhcodeTv.setText(mResult4);
+
+                            PdaApplication.putDataCache2Map(Constants.FLAG.MATERIAL_COLLECT_BOX_RESULT + pi_inoutno, mResults);
+                        }
+                        CommonUtil.toastNoRepeat(getActivity(), "采集成功");
+
+                        Object next = jsonObject.getJSONObject("data").get("next");
+                        if (next != null && !"null".equals(next.toString())) {
+                            JSONObject nextObject = jsonObject.getJSONObject("data").getJSONObject("next");
+                            MaterialInformationBean.DataBean materialInformationBean = JsonTools.parseJsonToBean(nextObject.toString(), MaterialInformationBean.DataBean.class);
+                            if (materialInformationBean != null) {
+                                String materialInfo =
+                                        "型号:" + (materialInformationBean.getPR_ORISPECCODE() == null ? "" : materialInformationBean.getPR_ORISPECCODE())
+                                                + "物料:" + (materialInformationBean.getPD_PRODCODE() == null ? "" : materialInformationBean.getPD_PRODCODE())
+                                                + "; 名称规格:" + (materialInformationBean.getPR_DETAIL() == null ? "" : materialInformationBean.getPR_DETAIL())
+                                                + "  " + (materialInformationBean.getPR_SPEC() == null ? "" : materialInformationBean.getPR_SPEC())
+                                                + "; 未备料数:" + (materialInformationBean.getPD_RESTQTY() == null ? "" : materialInformationBean.getPD_RESTQTY())
+                                                + "; 批数量:" + (CommonUtil.doubleFormat(materialInformationBean.getBAR_REMAIN()))
+                                                + "; 仓位:" + (materialInformationBean.getBAR_LOCATION() == null ? "" : materialInformationBean.getBAR_LOCATION());
+                                if (materialInformationBean.getPD_BATCHCODE() != null) {
+                                    materialInfo = materialInfo + "; 批号:" + materialInformationBean.getPD_BATCHCODE();
+                                }
+                                mMaterialInforTextView.setText(materialInfo);
+                            }
+                        } else {
+                            mMaterialInforTextView.setText("该出库单已经完成备料");
+                        }
+                    }
+
+                } catch (JSONException e) {
+                    e.printStackTrace();
+                }
+            }
+        }, new Response.ErrorListener() {
+            @Override
+            public void onErrorResponse(VolleyError volleyError) {
+                progressDialog.dismiss();
+                if (getActivity() != null) {
+                    mCollectTypeRadioGroup.setEnabled(true);
+                    CommonUtil.editTextGetFocus(etBarCode);
+                    String errorToast = CommonUtil.showErrorToast(volleyError, true);
+                    mCollectResultTextView.setVisibility(View.VISIBLE);
+                    mCollectResultTextView.setTextColor(getResources().getColor(R.color.red));
+                    mCollectResultTextView.setText(errorToast);
+                }
+
+            }
+        }) {
+            @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);
+    }
+
+    /**
+     * 创建PopupWindow
+     */
+    private PopupWindow popupWindow;
+    private AdapterPopupWindow adapterPopupWindow;
+    private Button dewOperConfirmBtn, btnDewCancel;
+
+    protected void showDewPopupWindow() {
+        try {
+            LayoutInflater inflater = LayoutInflater.from(getActivity());
+            View contentView = inflater.inflate(R.layout.popupwindow_ioc_out_make_material_oper, null);
+
+            ListView dewOperLv = (ListView) contentView.findViewById(R.id.dew_oper_lv);
+            ((TextView) contentView.findViewById(R.id.tv_ms_level)).setText(iocOutMakeMaterialOperMsd.getData().getBarcode().getMsd().getMS_LEVEL());
+            ((TextView) contentView.findViewById(R.id.tv_status)).setText(iocOutMakeMaterialOperMsd.getData().getBarcode().getMsd().getSTATUS());
+            if (iocOutMakeMaterialOperMsd.getData().getBarcode().getMsd().getMS_RESTTIME() == -1) {
+                ((TextView) contentView.findViewById(R.id.tv_ms_resttime)).setText("999");
+            } else {
+                ((TextView) contentView.findViewById(R.id.tv_ms_resttime)).setText(iocOutMakeMaterialOperMsd.getData().getBarcode().getMsd().getMS_RESTTIME() + "");
+            }
+
+            dewOperConfirmBtn = (Button) contentView.findViewById(R.id.dew_oper_confirm_btn);
+            btnDewCancel = (Button) contentView.findViewById(R.id.btn_dew_cancel);
+
+            dewOperConfirmBtn.setOnClickListener(this);
+            btnDewCancel.setOnClickListener(this);
+            adapterPopupWindow = new AdapterPopupWindow(getActivity(), R.layout.item_list_ioc_out_make_material_oper, iocOutMakeMaterialOperMsd.getData().getBarcode().getMsd().getLog());
+            dewOperLv.setAdapter(adapterPopupWindow);
+            //item 的点击事件
+            dewOperLv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+                @Override
+                public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
+            /*    IOCOutMakeMaterialSubmit.Data data = dataListPopupWindow.get(i);
+                dataList.add(data);
+                adapterListView.notifyDataSetChanged();
+                closePopupWindow();
+                reset();*/
+                }
+            });
+            // PopupWindow实例化
+            popupWindow = new PopupWindow(contentView, LinearLayout.LayoutParams.WRAP_CONTENT,
+                    LinearLayout.LayoutParams.WRAP_CONTENT, true);
+            popupWindow.setAnimationStyle(R.style.MenuAnimationFade);
+            // 弹出窗口显示内容视图,默认以锚定视图的左下角为起点,这里为点击按钮
+            popupWindow.showAtLocation(btnConfirm, Gravity.CENTER, 0, 0);
+            popupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
+                @Override
+                public void onDismiss() {
+                    closePopupWindow();
+                }
+            });
+            //获取最底层窗口的参数,背景变灰色效果
+            CommonUtil.setBackgroundAlpha(mActivity, 0.5f);
+
+        } catch (Exception e) {
+
+        }
+
+    }
+
+    @Override
+    public void onCheckedChanged(RadioGroup group, int checkedId) {
+        switch (checkedId) {
+            case R.id.iocout_collect_barcode_rb:
+                etBarCode.setHint(R.string.please_collect_barcode);
+                mtypeNameTv.setText("条码号");
+                SharedPreUtil.saveString(getActivity().getApplicationContext(), Constants.FLAG.MATERIAL_OUT_COLLECT_TYPE, "byBarcode");
+                mCollectType = "byBarcode";
+
+                mBarcodeTableLayout.setVisibility(View.VISIBLE);
+                mBoxTableLayout.setVisibility(View.GONE);
+
+                mResults = (List<String>) PdaApplication.getDataCacheFromMap(Constants.FLAG.MATERIAL_COLLECT_BARCODE_RESULT + pi_inoutno);
+
+                if (mResults != null && mResults.size() == 3) {
+                    tvBarcodeCollectionSuccess.setVisibility(View.VISIBLE);
+                    tvBarcodeCollectionSuccess.setText("采集成功");
+
+                    mCollectBarcodeTv.setText(mResults.get(0));
+                    mCollectBarRemainTv.setText(mResults.get(1));
+                    mCollectBarProdcodeTv.setText(mResults.get(2));
+                } else {
+                    tvBarcodeCollectionSuccess.setVisibility(View.GONE);
+                    mCollectBarcodeTv.setText(null);
+                    mCollectBarRemainTv.setText(null);
+                    mCollectBarProdcodeTv.setText(null);
+                }
+                break;
+            case R.id.iocout_collect_box_rb:
+                etBarCode.setHint(R.string.please_collect_box);
+                mtypeNameTv.setText("外箱号");
+                SharedPreUtil.saveString(getActivity().getApplicationContext(), Constants.FLAG.MATERIAL_OUT_COLLECT_TYPE, "byBatchcode");
+                mCollectType = "byBatchcode";
+
+                mBarcodeTableLayout.setVisibility(View.GONE);
+                mBoxTableLayout.setVisibility(View.VISIBLE);
+
+                mResults = (List<String>) PdaApplication.getDataCacheFromMap(Constants.FLAG.MATERIAL_COLLECT_BOX_RESULT + pi_inoutno);
+
+                if (mResults != null && mResults.size() == 4) {
+                    tvBoxCollectionSuccess.setVisibility(View.VISIBLE);
+                    tvBoxCollectionSuccess.setText("采集成功");
+
+                    mCollectBoxTv.setText(mResults.get(0));
+                    mCollectBoxNumTv.setText(mResults.get(1));
+                    mCollectBoxrProdcodeTv.setText(mResults.get(2));
+                    mCollectBoxWhcodeTv.setText(mResults.get(3));
+                } else {
+                    mCollectBoxTv.setText(null);
+                    mCollectBoxNumTv.setText(null);
+                    mCollectBoxrProdcodeTv.setText(null);
+                    mCollectBoxWhcodeTv.setText(null);
+                }
+                break;
+        }
+    }
+
+    @Override
+    public void onSuccess(int flag, Object o) throws Exception {
+        if (flag == FLAG_CONFIRM_POST) {
+            progressDialog.dismiss();
+            CommonUtil.toastNoRepeat(mActivity, "过账成功");
+        } else if (flag == BarcodeSplitting) {
+            progressDialog.dismiss();
+            try {
+                String result = o.toString();
+                if (FastjsonUtil.validate(result)) {
+                    com.alibaba.fastjson.JSONObject resultObject = JSON.parseObject(result);
+                    if (resultObject != null) {
+                        CommonUtil.toastNoRepeat(mActivity, FastjsonUtil.getText(resultObject, "data"));
+                    }
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    @Override
+    public void onFail(int flag, String failStr) throws Exception {
+        if (flag == FLAG_CONFIRM_POST) {
+            progressDialog.dismiss();
+            CommonUtil.toastNoRepeat(mActivity, failStr);
+        } else if (flag == BarcodeSplitting) {
+            progressDialog.dismiss();
+            CommonUtil.toastNoRepeat(mActivity, failStr);
+        }
+    }
+
+    /**
+     * popupWindow 设置适配器
+     */
+    private class AdapterPopupWindow extends BaseAdapter {
+        private int resourceId;
+        private List<IOCOutMakeMaterialOperMsd.DataBean.BarcodeBean.MsdBean.LogBean> objects;
+        private Context mContext;
+
+        public AdapterPopupWindow(Context context, int resource, List<IOCOutMakeMaterialOperMsd.DataBean.BarcodeBean.MsdBean.LogBean> objects) {
+            resourceId = resource;
+            this.objects = objects;
+            mContext = context;
+        }
+
+        @Override
+        public int getCount() {
+            return objects == null ? 0 : objects.size();
+        }
+
+        @Override
+        public Object getItem(int position) {
+            return objects == null ? null : objects.get(position);
+        }
+
+        @Override
+        public long getItemId(int position) {
+            return position;
+        }
+
+        @Override
+        public View getView(int position, View convertView, ViewGroup parent) {
+            ViewHolder viewHolder = null;
+            if (convertView == null) {
+                convertView = View.inflate(mContext, resourceId, null);
+                viewHolder = new ViewHolder();
+
+                viewHolder.dateTextView = (TextView) convertView.findViewById(R.id.tv_date);
+                viewHolder.lifeTimeTextView = (TextView) convertView.findViewById(R.id.tv_lifetime);
+                viewHolder.actionTextView = (TextView) convertView.findViewById(R.id.tv_action);
+                viewHolder.manTextView = (TextView) convertView.findViewById(R.id.tv_man);
+                convertView.setTag(viewHolder);
+            } else {
+                viewHolder = (ViewHolder) convertView.getTag();
+            }
+
+            viewHolder.actionTextView.setText(objects.get(position).getMS_ACTION());
+            viewHolder.dateTextView.setText(objects.get(position).getMS_DATE() + "");
+            viewHolder.lifeTimeTextView.setText(objects.get(position).getMS_LIFETIME() + "");
+            viewHolder.manTextView.setText(objects.get(position).getMS_MAN());
+            return convertView;
+        }
+    }
+
+    class ViewHolder {
+        TextView dateTextView;
+        TextView lifeTimeTextView;
+        TextView actionTextView;
+        TextView manTextView;
+    }
+
+    @Override
+    public void onClick(View view) {
+        switch (view.getId()) {
+            case R.id.btn_actionbar_more:
+                View materialOutMoreView = View.inflate(getActivity(), R.layout.pop_material_out_menu, null);
+                Button stockTaskBtn = (Button) materialOutMoreView.findViewById(R.id.pop_material_out_menu_1);
+                Button stockAlreadyBtn = (Button) materialOutMoreView.findViewById(R.id.pop_material_out_menu_2);
+                Button stockRevokeBtn = (Button) materialOutMoreView.findViewById(R.id.pop_material_out_menu_3);
+                Button stockModifyBtn = (Button) materialOutMoreView.findViewById(R.id.pop_material_out_menu_4);
+                Button stockSpecialBtn = (Button) materialOutMoreView.findViewById(R.id.pop_material_out_menu_5);
+                Button passBillBtn = (Button) materialOutMoreView.findViewById(R.id.pop_material_out_menu_6);
+                Button stockDataSummary = (Button) materialOutMoreView.findViewById(R.id.pop_material_out_menu_7);
+                Button barcodeSplitting = (Button) materialOutMoreView.findViewById(R.id.pop_material_out_menu_8);
+
+                stockTaskBtn.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        closeListPopupWindow();
+                        ((FunctionActivity) getActivity()).setMoreBtnVisible(false);
+                        ((FunctionActivity) getActivity()).setScanIvVisible(false);
+                        if (isMultiple) {
+                            clickToFragment(new MaterialOutStockTaskMultipleFragment());
+                        } else {
+                            clickToFragment(new MaterialOutStockTaskMultipleFragment());
+                            //                            clickToFragment(new MaterialOutStockTaskFragment());
+                        }
+                    }
+                });
+
+                stockDataSummary.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        closeListPopupWindow();
+                        ((FunctionActivity) getActivity()).setMoreBtnVisible(false);
+                        ((FunctionActivity) getActivity()).setScanIvVisible(false);
+                        clickToFragment(new StockDataSummaryFragment());
+                    }
+                });
+
+                stockAlreadyBtn.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        closeListPopupWindow();
+                        ((FunctionActivity) getActivity()).setMoreBtnVisible(false);
+                        ((FunctionActivity) getActivity()).setScanIvVisible(false);
+                        clickToFragment(new MaterialOutStockAlreadyFragment());
+                    }
+                });
+
+                stockRevokeBtn.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        closeListPopupWindow();
+                        ((FunctionActivity) getActivity()).setMoreBtnVisible(false);
+                        //                        ((FunctionActivity) getActivity()).setScanIvVisible(false);
+                        clickToFragment(new MaterialOutRevocationStockFragment());
+                    }
+                });
+
+                stockModifyBtn.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        closeListPopupWindow();
+                        ((FunctionActivity) getActivity()).setMoreBtnVisible(false);
+                        //                        ((FunctionActivity) getActivity()).setScanIvVisible(false);
+                        clickToFragment(new ModifyQuantityOutFragment());
+                    }
+                });
+
+                stockSpecialBtn.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        closeListPopupWindow();
+                        ((FunctionActivity) getActivity()).setMoreBtnVisible(false);
+                        //                        ((FunctionActivity) getActivity()).setScanIvVisible(false);
+                        clickToFragment(new SpecialMaterialOutFragment());
+                    }
+                });
+
+                passBillBtn.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View view) {
+                        closeListPopupWindow();
+                        new AlertDialog.Builder(mActivity)
+                                .setMessage("确认将单据过账?")
+                                .setNegativeButton(R.string.cancel, null)
+                                .setPositiveButton(R.string.confirm, new DialogInterface.OnClickListener() {
+                                    @Override
+                                    public void onClick(DialogInterface dialogInterface, int i) {
+                                        dialogInterface.dismiss();
+                                        progressDialog.show();
+                                        VolleyRequest.getInstance().stringRequest(mStringRequest,
+                                                new HttpParams.Builder()
+                                                        .url(GloableParams.ADDRESS_INMATERIAL_CONFIRMPOST)
+                                                        .method(Request.Method.POST)
+                                                        .addParam("piid", pi_id)
+                                                        .tag(TAG + "confirmpost")
+                                                        .flag(FLAG_CONFIRM_POST).build(),
+                                                30 * 1000, IOCOutMakeMaterialOperNew.this);
+                                    }
+                                }).create().show();
+                    }
+                });
+
+                barcodeSplitting.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        closeListPopupWindow();
+                        //弹出拨入仓
+                        getRepairStep("");
+                        //getWhcode(0);
+                    }
+                });
+
+                listPopupWindow = new PopupWindow(materialOutMoreView, LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT, true);
+                listPopupWindow.setBackgroundDrawable(new BitmapDrawable());
+                listPopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
+                    @Override
+                    public void onDismiss() {
+                        closeListPopupWindow();
+                    }
+                });
+                CommonUtil.setBackgroundAlpha(getActivity(), 0.5f);
+                listPopupWindow.showAsDropDown(btnActionbarRight);
+
+
+                /*View materialOutMoreView = View.inflate(getActivity(), R.layout.popupwindow_material_out_listview, null);
+                Button hadCollectBtn = (Button) materialOutMoreView.findViewById(R.id.material_out_menu_1);
+                Button noCollectBtn = (Button) materialOutMoreView.findViewById(R.id.material_out_menu_2);
+                Button reCollectBtn = (Button) materialOutMoreView.findViewById(R.id.material_out_menu_3);
+                Button noSubmitBtn = (Button) materialOutMoreView.findViewById(R.id.material_out_menu_4);
+
+                if (mCollectModel == 1) {
+                    noSubmitBtn.setVisibility(View.GONE);
+                } else {
+                    noSubmitBtn.setVisibility(View.VISIBLE);
+                }
+
+                hadCollectBtn.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        closeListPopupWindow();
+                        ((FunctionActivity) getActivity()).setMoreBtnVisible(false);
+                        clickToFragment(new CollectAlreadyFragment());
+                    }
+                });
+
+                noCollectBtn.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        closeListPopupWindow();
+                        ((FunctionActivity) getActivity()).setMoreBtnVisible(false);
+                        clickToFragment(new CollectNotFragment());
+                    }
+                });
+
+                reCollectBtn.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        closeListPopupWindow();
+                        progressDialog.show();
+                        mDbManager.deleteFromBarcodeIo(new String[]{pi_id, pd_whcode}, "LBI_PIID=? and LBI_WHCODE=?");
+                        getAgainEvent();
+                    }
+                });
+
+                noSubmitBtn.setOnClickListener(new View.OnClickListener() {
+                    @Override
+                    public void onClick(View v) {
+                        closeListPopupWindow();
+                        ((FunctionActivity) getActivity()).setMoreBtnVisible(false);
+                        clickToFragment(new SubmitNotFragment());
+                    }
+                });
+
+                listPopupWindow = new PopupWindow(materialOutMoreView, LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT, true);
+//                popupWindow.setAnimationStyle(R.style.MenuAnimationFade);
+                listPopupWindow.setBackgroundDrawable(new BitmapDrawable());
+                listPopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
+                    @Override
+                    public void onDismiss() {
+                        closeListPopupWindow();
+                    }
+                });
+                CommonUtil.setBackgroundAlpha(getActivity(), 0.5f);
+                listPopupWindow.showAsDropDown(btnActionbarRight);*/
+
+                break;
+            case R.id.dew_oper_confirm_btn:
+                if (iocOutMakeMaterialOperMsd.getData().getBarcode().getMsd().getSTATUS().equals("在烘烤")) {
+                    new AlertDialog.Builder(getActivity()).setTitle("提示")
+                            .setMessage("是否出烤箱?")
+                            .setPositiveButton("确定", new DialogInterface.OnClickListener() {
+                                @Override
+                                public void onClick(DialogInterface dialog, int which) {
+                                    dialog.dismiss();
+                                    popupWindow.dismiss();
+                                    progressDialog.show();
+                                    outOvenEvent();
+                                }
+                            })
+                            .setNegativeButton("取消", new DialogInterface.OnClickListener() {
+                                @Override
+                                public void onClick(DialogInterface dialog, int which) {
+                                    dialog.dismiss();
+                                }
+                            })
+                            .show();
+                } else {
+                    double bar_remain = iocOutMakeMaterialOperMsd.getData().getBarcode().getBAR_REMAIN();
+                    double restqty = iocOutMakeMaterialOperMsd.getData().getBarcode().getRESTQTY();
+                    if (CommonUtil.doubleCompare(bar_remain, restqty) == 1) {
+                        spliteBarcode(currentBarcode, bar_remain + "", restqty + "");
+                    } else {
+                        closePopupWindow();
+                        barcodeEnterEvent(true, false);
+                    }
+                }
+
+                break;
+            case R.id.btn_dew_cancel:
+                //点击取消按钮,关闭窗口
+                closePopupWindow();
+                //                clearAll();
+                break;
+            case R.id.iocout_collect_model_btn:
+                if (mCollectModelBtn.getText().toString().trim().equals("在线")) {
+                    mCollectModelBtn.setText("离线");
+                    mCollectModel = 0;
+                } else if (mCollectModelBtn.getText().toString().trim().equals("离线")) {
+                    List<TableLBARCODEIO> allBarcodeIo = new ArrayList<>();
+                    if (mDbManager.getDb().isOpen()) {
+                        allBarcodeIo = mDbManager.queryFromBarcodeIo(new String[]{"out", pi_id, pd_whcode}, "inOrOut=? and LBI_PIID=? and LBI_WHCODE=?");
+                    }
+                    if (CommonUtil.isNetWorkConnected(getActivity())) {
+                        if (allBarcodeIo.size() != 0) {
+                            CommonUtil.toastNoRepeat(getActivity(), getResources().getString(R.string.auto_upload_offline_data));
+                            submitOfflineData(allBarcodeIo, false);
+                        } else {
+                            mCollectModelBtn.setText("在线");
+                            mCollectModel = 1;
+                        }
+                    } else {
+                        mCollectModelBtn.setText("离线");
+                        mCollectModel = 0;
+                        CommonUtil.toastNoRepeat(getActivity(), getResources().getString(R.string.str_net_not_connect));
+                    }
+
+                }
+                break;
+            case R.id.btn_actionbar_scan_iv:
+                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));
+                }
+                break;
+            default:
+                break;
+        }
+    }
+
+    //    private void getWhcode() {
+    //        View mPopView = View.inflate(mActivity, R.layout.pop_whcode_dlert_dialog, null);
+    //        ClearableEditText cet_whcode = (ClearableEditText) mPopView.findViewById(R.id.cet_whcode);
+    //        Button bt_ok = (Button) mPopView.findViewById(R.id.bt_ok);
+    //        AlertDialog mWarehouseDialog = new AlertDialog.Builder(mActivity)
+    //                .setView(mPopView)
+    //                .create();
+    //        mWarehouseDialog.show();
+    //
+    //        bt_ok.setOnClickListener(new View.OnClickListener() {
+    //            @Override
+    //            public void onClick(View v) {
+    //                mWarehouseDialog.cancel();
+    //                VolleyRequest.getInstance().stringRequest(mStringRequest,
+    //                        new HttpParams.Builder()
+    //                                .url(GloableParams.ADDRESS_BARCODE_SPLITTING)
+    //                                .method(Request.Method.GET)
+    //                                .addParam("id", pi_id)
+    //                                .addParam("whcode", cet_whcode.getText().toString().trim())
+    //                                .tag(TAG + "_barcodeSplitting")
+    //                                .flag(BarcodeSplitting).build(),
+    //                        30 * 1000, IOCOutMakeMaterialOperNew.this);
+    //            }
+    //        });
+    //    }
+
+    private void getRepairStep(String trim) {
+//        String pi_class = "完工入库单";
+//        String pi_type = "良品";
+        String pi_class = "";
+        String pi_type = "";
+        progressDialog.show();
+        VollyRequest.getInstance().stringRequest(mStringRequest,
+                new HttpParams.Builder()
+                        .url(GloableParams.ADDRESS_PDAIO_IN_GETWHCODE)
+                        .method(Request.Method.GET)
+                        .tag(TAG + "getMaCode")
+                        .addParam("condition", trim)
+                        .addParam("piclass", pi_class)
+                        .addParam("pi_type", pi_type)
+                        .flag(0)
+                        .build(), new HttpCallback() {
+                    @Override
+                    public void onSuccess(int flag, Object o) throws Exception {
+                        progressDialog.dismiss();
+                        Boolean isSuccess = FastjsonUtil.getBoolean(o.toString(), "success");
+                        com.alibaba.fastjson.JSONObject data = FastjsonUtil.getJSONObject(o.toString(), "data");
+                        com.alibaba.fastjson.JSONArray dataArray = FastjsonUtil.getJSONArray(data.toString(), "whcode");
+                        //                        JSONArray dataArray = FastjsonUtil.getJSONArray(data.toString(), "data");
+                        if (isSuccess) {
+                            if (dataArray == null) {
+                                CommonUtil.toastNoRepeat(mActivity, "未搜索到匹配数据");
+                            } else {
+                                handleFeededlineData(dataArray, trim);
+                            }
+                        }
+                    }
+
+                    @Override
+                    public void onFail(int flag, String failStr) throws Exception {
+                        progressDialog.dismiss();
+                        CommonUtil.toastNoRepeat(mActivity, failStr);
+                    }
+                });
+    }
+
+    private void handleFeededlineData(com.alibaba.fastjson.JSONArray dataArray, String trim) {
+        ComDataBean bean;
+        ComDataBeanList.clear();
+        for (Object index : dataArray) {
+            com.alibaba.fastjson.JSONObject data = (com.alibaba.fastjson.JSONObject) index;
+            bean = new ComDataBean();
+            bean.setItemName(data.getString("WH_DESCRIPTION"));
+            bean.setItemremark(data.getString("WH_CODE"));
+            ComDataBeanList.add(bean);
+        }
+        if (trim.isEmpty()) {
+            initresourcesPopupWindow();
+        } else {
+            ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(ComDataBeanList);
+            ipAndResourcesPortAdapter.setmList(ComDataBeanList);
+            rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
+            ;
+        }
+    }
+
+    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);
+        LinearLayout line_top = contView.findViewById(R.id.line_top);
+        rv_line_ip_port_data = contView.findViewById(R.id.rv_ip_port_data);
+        rv_line_ip_port_data.addItemDecoration(new DividerItemDecoration(mActivity, LinearLayout.VERTICAL));
+        rv_line_ip_port_data.setLayoutManager(new LinearLayoutManager(mActivity));
+        ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(ComDataBeanList);
+        ipAndResourcesPortAdapter.setmList(ComDataBeanList);
+        rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
+        setlineAdapter(ComDataBeanList);
+        //        edit_et.setText(ct_qty.getText().toString().trim());
+
+        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() {
+                closePopListPopupWindow();
+            }
+        });
+        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<ComDataBean> thisList = new ArrayList<>();
+                        for (int i = 0; i < ComDataBeanList.size(); i++) {
+                            if (ComDataBeanList.get(i).getItemremark().contains(mSearchStr) || ComDataBeanList.get(i).getItemName().contains(mSearchStr)) {
+                                thisList.add(ComDataBeanList.get(i));
+                            }
+                            if (i == ComDataBeanList.size() - 1) {
+                                ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(thisList);
+                                rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
+                                LogUtil.i("mSearchStr", JSON.toJSONString(thisList));
+
+                            }
+                            List<ComDataBean> lineCodeEntities = ipAndResourcesPortAdapter.getmList();
+                            for (int j = 0; j < lineCodeEntities.size(); j++) {
+                                lineCodeEntities.get(j).setChecked(false);
+                            }
+                            ipAndResourcesPortAdapter.notifyDataSetChanged();
+                        }
+                    } else {
+                        ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(ComDataBeanList);
+                        rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
+                        List<ComDataBean> lineCodeEntities = ipAndResourcesPortAdapter.getmList();
+                        for (int i = 0; i < lineCodeEntities.size(); i++) {
+                            lineCodeEntities.get(i).setChecked(false);
+                        }
+                        ipAndResourcesPortAdapter.notifyDataSetChanged();
+                    }
+                    ipAndResourcesPortAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
+
+                        @Override
+                        public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
+                            List<ComDataBean> ipAndPortBeans = ipAndResourcesPortAdapter.getmList();
+                            sc_name = ipAndPortBeans.get(position).getItemName();
+                            sc_code = ipAndPortBeans.get(position).getItemremark();
+                            for (int i = 0; i < ipAndPortBeans.size(); i++) {
+                                ipAndPortBeans.get(i).setChecked(false);
+                            }
+                            ipAndPortBeans.get(position).setChecked(true);
+                            ipAndResourcesPortAdapter.notifyDataSetChanged();
+                        }
+                    });
+                    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<ComDataBean> thisList = new ArrayList<>();
+                    for (int i = 0; i < ComDataBeanList.size(); i++) {
+                        if (ComDataBeanList.get(i).getItemremark().contains(mSearchStr) || ComDataBeanList.get(i).getItemName().contains(mSearchStr)) {
+                            thisList.add(ComDataBeanList.get(i));
+                        }
+                        if (i == ComDataBeanList.size() - 1) {
+                            ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(thisList);
+                            rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
+                            LogUtil.i("mSearchStr", JSON.toJSONString(thisList));
+
+                        }
+                        List<ComDataBean> lineCodeEntities = ipAndResourcesPortAdapter.getmList();
+                        for (int j = 0; j < lineCodeEntities.size(); j++) {
+                            lineCodeEntities.get(j).setChecked(false);
+                        }
+                        ipAndResourcesPortAdapter.notifyDataSetChanged();
+                    }
+                } else {
+                    ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(ComDataBeanList);
+                    rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
+                    List<ComDataBean> lineCodeEntities = ipAndResourcesPortAdapter.getmList();
+                    for (int i = 0; i < lineCodeEntities.size(); i++) {
+                        lineCodeEntities.get(i).setChecked(false);
+                    }
+                    ipAndResourcesPortAdapter.notifyDataSetChanged();
+
+                }
+                //                getRepairStep(mSearchStr);
+                ipAndResourcesPortAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
+                    @Override
+                    public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
+                        List<ComDataBean> ipAndPortBeans = ipAndResourcesPortAdapter.getmList();
+                        sc_name = ipAndPortBeans.get(position).getItemName();
+                        sc_code = ipAndPortBeans.get(position).getItemremark();
+                        for (int i = 0; i < ipAndPortBeans.size(); i++) {
+                            ipAndPortBeans.get(i).setChecked(false);
+                        }
+                        ipAndPortBeans.get(position).setChecked(true);
+                        ipAndResourcesPortAdapter.notifyDataSetChanged();
+                    }
+                });
+            }
+        });
+
+        List<String> list = new ArrayList<>();
+        //确定
+        sure_tv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                list.clear();
+                if (StringUtil.isEmpty(sc_code)) {
+                    CommonUtil.toastNoRepeat(mActivity, "请选择仓库编号");
+                    return;
+                }
+                progressDialog.show();
+                VolleyRequest.getInstance().stringRequest(mStringRequest,
+                        new HttpParams.Builder()
+                                .url(GloableParams.ADDRESS_BARCODE_SPLITTING)
+                                .method(Request.Method.GET)
+                                .addParam("id", pi_id)
+                                .addParam("whcode", sc_code)
+                                .tag(TAG + "_barcodeSplitting")
+                                .flag(BarcodeSplitting).build(),
+                        30 * 1000, IOCOutMakeMaterialOperNew.this);
+
+                closePopListPopupWindow();
+            }
+        });
+
+        //取消
+        cancle_tv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                closePopListPopupWindow();
+            }
+        });
+
+        String mSearchStr = edit_et.getText().toString().trim();
+        if (mSearchStr.isEmpty()) {
+            ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(ComDataBeanList);
+            rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
+            List<ComDataBean> lineCodeEntities = ipAndResourcesPortAdapter.getmList();
+            for (int i = 0; i < lineCodeEntities.size(); i++) {
+                lineCodeEntities.get(i).setChecked(false);
+            }
+            ipAndResourcesPortAdapter.notifyDataSetChanged();
+
+            ipAndResourcesPortAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
+                @Override
+                public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
+                    List<ComDataBean> ipAndPortBeans = ipAndResourcesPortAdapter.getmList();
+                    sc_name = ipAndPortBeans.get(position).getItemName();
+                    sc_code = ipAndPortBeans.get(position).getItemremark();
+                    for (int i = 0; i < ipAndPortBeans.size(); i++) {
+                        ipAndPortBeans.get(i).setChecked(false);
+                    }
+                    ipAndPortBeans.get(position).setChecked(true);
+                    ipAndResourcesPortAdapter.notifyDataSetChanged();
+                }
+            });
+        }
+    }
+
+    private void setlineAdapter(ArrayList<ComDataBean> mList) {
+        LogUtil.i("mList", JSON.toJSONString(mList));
+        ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(mList);
+        ipAndResourcesPortAdapter.setmList(ComDataBeanList);
+        ipAndResourcesPortAdapter.notifyDataSetChanged();
+        rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
+    }
+
+    private void closePopListPopupWindow() {
+        if (editPW != null) {
+            editPW.dismiss();
+            editPW = null;
+            CommonUtil.setBackgroundAlpha(mActivity, 1f);
+        }
+    }
+
+    @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.et_bar_code) {
+                    etBarCode.setText(result);
+                    etBarCode.setSelection(result.length());
+                }
+            }
+        }
+    }
+
+    @Override
+    public void onHiddenChanged(boolean hidden) {
+        super.onHiddenChanged(hidden);
+        if (!hidden) {
+            FunctionActivity.setTitle(getResources().getString(R.string.out_material_collect));
+            ((FunctionActivity) getActivity()).setMoreBtnVisible(true);
+            ((FunctionActivity) getActivity()).setScanIvVisible(true);
+            mScanImageView.setOnClickListener(this);
+            etBarCode.requestFocus();
+
+            isConnected = (SharedPreUtil.getInt(mActivity, "printConnect", 0) == 1);
+            mOldAddress = SharedPreUtil.getString(mActivity, "printAddress", "");
+            mPrintDpi = SharedPreUtil.getInt(mActivity, "printDpi", 203);
+        } else {
+            ((FunctionActivity) getActivity()).setMoreBtnVisible(false);
+            ((FunctionActivity) getActivity()).setScanIvVisible(false);
+        }
+    }
+
+    /**
+     * 出烘烤
+     */
+    private void outOvenEvent() {
+        String url = GloableParams.ADDRESS_MSDOUTOVEN + "?code=" + currentBarcode;
+        stringRequest = new StringRequest(Request.Method.GET, url, new Response.Listener<String>() {
+            @Override
+            public void onResponse(String s) {
+                progressDialog.dismiss();
+                Toast.makeText(getActivity().getApplicationContext(), "出烘烤成功", Toast.LENGTH_SHORT).show();
+                double bar_remain = iocOutMakeMaterialOperMsd.getData().getBarcode().getBAR_REMAIN();
+                double restqty = iocOutMakeMaterialOperMsd.getData().getBarcode().getRESTQTY();
+                if (CommonUtil.doubleCompare(bar_remain, restqty) == 1) {
+                    spliteBarcode(currentBarcode, bar_remain + "", restqty + "");
+                } else {
+                    closePopupWindow();
+                }
+            }
+        }, new Response.ErrorListener() {
+            @Override
+            public void onErrorResponse(VolleyError volleyError) {
+                //显示处理后的错误信息
+                progressDialog.dismiss();
+                if (volleyError != null && volleyError.networkResponse != null && volleyError.networkResponse.data != null) {
+                    ErrorMsg errorMsg = JsonTools.parseJsonToBean(new String(volleyError.networkResponse.data), ErrorMsg.class);
+                    if (errorMsg == null) {
+                        Toast.makeText(mActivity, "系统错误", Toast.LENGTH_LONG).show();
+                    } else {
+                        String exceptionInfo = errorMsg.exceptionInfo;
+                        if (exceptionInfo.contains("无需出")) {
+                            Toast.makeText(mActivity, "已出烘烤", Toast.LENGTH_LONG).show();
+
+                        } else {
+                            Toast.makeText(mActivity, "出烘烤失败", Toast.LENGTH_LONG).show();
+                            //                            etBarCode.setText("");
+                            //                            CommonUtil.editTextGetFocus(etBarCode);
+                        }
+                    }
+                }
+
+            }
+        }) {
+            @Override
+            public Map<String, String> getHeaders() throws AuthFailureError {
+                String cookie = SharedPreUtil.getString(getActivity().getApplicationContext(), "cookie", null);
+                Map<String, String> headers = new HashMap<>();
+                headers.put("Cookie", cookie);
+                return headers;
+            }
+        };
+        stringRequest.setRetryPolicy(new DefaultRetryPolicy(10 * 1000, 0, 1f));
+        stringRequest.setTag(TAG);
+        PdaApplication.mRequestQueue.add(stringRequest);
+    }
+
+    private void spliteBarcode(final String currentBarcode, String barRemain, String restqty) {
+        new AlertDialog.Builder(getActivity()).setTitle("提示")
+                .setMessage("条码数量(" + barRemain + ")大于剩余需要采集数量(" + restqty + "),确认拆分?")
+                .setPositiveButton("确认", new DialogInterface.OnClickListener() {
+                    @Override
+                    public void onClick(DialogInterface dialog, int which) {
+                        if (!CommonUtil.isRepeatClick())
+                            breakingBtnClickEvent(currentBarcode);
+                    }
+                })
+                .setNegativeButton("取消", new DialogInterface.OnClickListener() {
+                    @Override
+                    public void onClick(DialogInterface dialog, int which) {
+                        dialog.dismiss();
+                    }
+                })
+                .show();
+    }
+
+    /**
+     * 分拆批次
+     *
+     * @param currentBarcode
+     */
+    private void breakingBtnClickEvent(final String currentBarcode) {
+        progressDialog.show();
+        String url = isMultiple ? GloableParams.ADDRESS_OUT_BYBATCH_BREAK_DEAL : GloableParams.ADDRESS_OUT_BYBATCH_BREAK_DEAL;
+        Log.d("breakDeal", url);
+
+        VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
+                .url(url)
+                .method(Request.Method.POST)
+                .addParam("ids", pi_id)
+                .addParam("barcode", currentBarcode)
+                .addParam("or_remain", mBarRemain)
+                .addParam("bar_remain", mRestqty)
+                .build(), new HttpCallback() {
+            @Override
+            public void onSuccess(int flag, Object o) throws Exception {
+                progressDialog.dismiss();
+
+                String s = o.toString();
+                if (popupWindow != null && popupWindow.isShowing())
+                    closePopupWindow();
+                mResults = new ArrayList<>();
+                mCollectTypeRadioGroup.setEnabled(true);
+                LogUtil.e("breaking", s);
+                try {
+                    JSONObject jsonObject = new JSONObject(s);
+                    JSONObject dataObject = jsonObject.optJSONObject("data");
+                    if (dataObject == null) {
+                        return;
+                    }
+                    JSONObject messageObject = dataObject.optJSONObject("barcode");
+                    if (messageObject == null) {
+                        return;
+                    }
+                    if (messageObject.has("ISMSD")) {
+                        if (messageObject.optBoolean("ISMSD")) {
+                            //成功,有返回值,判断返回值message中isMsd是否存在,存在判断if(isMsd)true,弹出显示框
+                            iocOutMakeMaterialOperMsd = JsonTools.parseJsonToBean(jsonObject.toString(), IOCOutMakeMaterialOperMsd.class);
+                            //                            Log.i("msdresult", iocOutMakeMaterialOperMsd.toString());
+                            mBarRemain = CommonUtil.doubleFormat(iocOutMakeMaterialOperMsd.getData().getBarcode().getBAR_REMAIN());
+                            mRestqty = CommonUtil.doubleFormat(iocOutMakeMaterialOperMsd.getData().getBarcode().getRESTQTY());
+                            showDewPopupWindow();
+                        } else {
+                            mIocoutMaterialSplitBean = JsonTools.parseJsonToBean(messageObject.toString(), IOCOutmakeMaterialSplitBean.class);
+                            mBarRemain = CommonUtil.doubleFormat(mIocoutMaterialSplitBean.getBAR_REMAIN());
+                            mRestqty = CommonUtil.doubleFormat(mIocoutMaterialSplitBean.getRESTQTY());
+                            if (CommonUtil.doubleCompare(mIocoutMaterialSplitBean.getBAR_REMAIN(), mIocoutMaterialSplitBean.getRESTQTY()) == 1) {
+                                spliteBarcode(currentBarcode, mBarRemain, mRestqty);
+                            }
+                        }
+                    } else {
+                        mCollectResultTextView.setVisibility(View.VISIBLE);
+                        mCollectResultTextView.setTextColor(getResources().getColor(R.color.green));
+                        mCollectResultTextView.setText(null);
+                        //                        listArray = dataObject.optJSONArray("nolist");
+                        listArray = FastjsonUtil.getJSONArray(dataObject.toString(), "nolist");
+                        Log.e("listArraydata", listArray.toString());
+                        if (mCollectType.equals("byBarcode") || mCollectType.equals("byBatchcode")) {
+                            String barcodeResult = "采集成功;" + JsonUtils.optStringNotNull(dataObject, "finishno")
+                                    + "\n条码:" + JsonUtils.optStringNotNull(messageObject, "BAR_CODE")
+                                    + ";数量:" + CommonUtil.doubleFormat(messageObject.optDouble("BAR_REMAIN"))
+                                    + ";批号:" + JsonUtils.optStringNotNull(messageObject, "BAR_BATCHCODE")
+                                    + ";料号:" + JsonUtils.optStringNotNull(messageObject, "BAR_PRODCODE")
+                                    + ";名称规格:" + messageObject.optString("PR_DETAIL")
+                                    + "  " + JsonUtils.optStringNotNull(messageObject, "PR_SPEC")
+                                    + ";仓位:" + JsonUtils.optStringNotNull(messageObject, "BAR_LOCATION");
+
+                            if (listArray != null && listArray.size() > 0) {
+                                for (int i = 0; i < listArray.size(); i++) {
+                                    com.alibaba.fastjson.JSONObject listObject = listArray.getJSONObject(i);
+                                    //JsonUtils.optStringNotNull(listObject, "PI_INOUTNO")
+                                    //JsonUtils.optStringNotNull(listObject, "BAR_CODE")
+                                    //CommonUtil.doubleFormat(JsonUtils.optDoubleNotNull(listObject, "RESTQTY"));
+                                    barcodeResult = barcodeResult
+                                            + "\n单号:" + listObject.getString("PI_INOUTNO")
+                                            + ";条码号:" + listObject.getString("BAR_CODE")
+                                            + ";数量:" + listObject.getString("RESTQTY");
+                                }
+
+                                //弹出拆分结果弹框
+                                initBreakPopupWindow(listArray);
+                            }
+
+                            mCollectResultTextView.setText(barcodeResult);
+                            mCollectResultTextView.setTextColor(getResources().getColor(R.color.green));
+
+
+                            mBarcodeTableLayout.setVisibility(View.GONE);
+                            mBoxTableLayout.setVisibility(View.GONE);
+
+                            tvBarcodeCollectionSuccess.setVisibility(View.VISIBLE);
+                            tvBarcodeCollectionSuccess.setText("采集成功");
+
+                            mResult1 = messageObject.optString("BAR_CODE");
+                            mResult2 = messageObject.optDouble("BAR_REMAIN") + "";
+                            mResult3 = messageObject.optString("BAR_PRODCODE");
+
+                            mResults.add(mResult1);
+                            mResults.add(mResult2);
+                            mResults.add(mResult3);
+
+                            mCollectBarcodeTv.setText(mResult1);
+                            mCollectBarRemainTv.setText(mResult2);
+                            mCollectBarProdcodeTv.setText(mResult3);
+
+                            PdaApplication.putDataCache2Map(Constants.FLAG.MATERIAL_COLLECT_BARCODE_RESULT + pi_inoutno, mResults);
+                        } else if (false) {
+                            String boxResult = "采集成功;" + JsonUtils.optStringNotNull(dataObject, "finishno")
+                                    + "\n箱号:" + JsonUtils.optStringNotNull(messageObject, "BAR_OUTBOXCODE1")
+                                    + ";数量:" + CommonUtil.doubleFormat(messageObject.optDouble("BAR_REMAIN"))
+                                    + ";批号:" + JsonUtils.optStringNotNull(messageObject, "BAR_BATCHCODE")
+                                    + ";料号:" + JsonUtils.optStringNotNull(messageObject, "BAR_PRODCODE")
+                                    + ";名称规格:" + JsonUtils.optStringNotNull(messageObject, "PR_DETAIL")
+                                    + "  " + JsonUtils.optStringNotNull(messageObject, "PR_SPEC");
+
+
+                            if (listArray != null && listArray.size() > 0) {
+                                for (int i = 0; i < listArray.size(); i++) {
+                                    com.alibaba.fastjson.JSONObject listObject = listArray.getJSONObject(i);
+                                    //                                    + "\n单号:" + JsonUtils.optStringNotNull(listObject, "PI_INOUTNO")
+                                    //                                            + ";条码号:" + JsonUtils.optStringNotNull(listObject, "BAR_CODE")
+                                    //                                            + ";数量:" + CommonUtil.doubleFormat(JsonUtils.optDoubleNotNull(listObject, "BAR_REMAIN"));
+                                    boxResult = boxResult
+                                            + "\n单号:" + listObject.getString("PI_INOUTNO")
+                                            + ";条码号:" + listObject.getString("BAR_CODE")
+                                            + ";数量:" + listObject.getDouble("BAR_REMAIN");
+                                }
+                            }
+
+                            mCollectResultTextView.setText(boxResult);
+                            mCollectResultTextView.setTextColor(getResources().getColor(R.color.green));
+
+
+                            mBarcodeTableLayout.setVisibility(View.GONE);
+                            mBoxTableLayout.setVisibility(View.GONE);
+
+                            tvBoxCollectionSuccess.setVisibility(View.VISIBLE);
+                            tvBoxCollectionSuccess.setText("采集成功");
+
+                            mResult1 = messageObject.optString("PA_OUTBOXCODE");
+                            mResult2 = messageObject.optInt("PA_TOTALQTY") + "";
+                            mResult3 = messageObject.optString("PA_PRODCODE");
+                            mResult4 = messageObject.optString("PA_WHCODE");
+
+                            mResults.add(mResult1);
+                            mResults.add(mResult2);
+                            mResults.add(mResult3);
+                            mResults.add(mResult4);
+
+                            mCollectBoxTv.setText(mResult1);
+                            mCollectBoxNumTv.setText(mResult2);
+                            mCollectBoxrProdcodeTv.setText(mResult3);
+                            mCollectBoxWhcodeTv.setText(mResult4);
+
+                            PdaApplication.putDataCache2Map(Constants.FLAG.MATERIAL_COLLECT_BOX_RESULT + pi_inoutno, mResults);
+                        }
+                        CommonUtil.toastNoRepeat(getActivity(), "采集成功");
+
+                        Object next = jsonObject.getJSONObject("data").get("next");
+                        if (next != null && !"null".equals(next.toString())) {
+                            JSONObject nextObject = jsonObject.getJSONObject("data").getJSONObject("next");
+                            MaterialInformationBean.DataBean materialInformationBean = JsonTools.parseJsonToBean(nextObject.toString(), MaterialInformationBean.DataBean.class);
+                            if (materialInformationBean != null) {
+                                String materialInfo =
+                                        "型号:" + (materialInformationBean.getPR_ORISPECCODE() == null ? "" : materialInformationBean.getPR_ORISPECCODE())
+                                                + "物料:" + (materialInformationBean.getPD_PRODCODE() == null ? "" : materialInformationBean.getPD_PRODCODE())
+                                                + "; 名称规格:" + (materialInformationBean.getPR_DETAIL() == null ? "" : materialInformationBean.getPR_DETAIL())
+                                                + "  " + (materialInformationBean.getPR_SPEC() == null ? "" : materialInformationBean.getPR_SPEC())
+                                                + "; 未备料数:" + (materialInformationBean.getPD_RESTQTY() == null ? "" : materialInformationBean.getPD_RESTQTY())
+                                                + "; 批数量:" + (CommonUtil.doubleFormat(materialInformationBean.getBAR_REMAIN()))
+                                                + "; 仓位:" + (materialInformationBean.getBAR_LOCATION() == null ? "" : materialInformationBean.getBAR_LOCATION());
+                                if (materialInformationBean.getPD_BATCHCODE() != null) {
+                                    materialInfo = materialInfo + "; 批号:" + materialInformationBean.getPD_BATCHCODE();
+                                }
+                                mMaterialInforTextView.setText(materialInfo);
+                            }
+                        } else {
+                            mMaterialInforTextView.setText("该出库单已经完成备料");
+                        }
+                    }
+
+                } catch (JSONException e) {
+                    e.printStackTrace();
+                }
+            }
+
+            @Override
+            public void onFail(int flag, String failStr) throws Exception {
+                progressDialog.dismiss();
+                if (getActivity() != null) {
+                    try {
+                        etBarCode.setText(null);
+                        CommonUtil.editTextGetFocus(etBarCode);
+                        CommonUtil.makeNotice();
+                        CommonUtil.toastNoRepeat(getActivity(), failStr);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+
+                }
+            }
+        });
+
+        /*RequestBody requestBody = new FormBody.Builder()
+                .add("ids", pi_id)
+                .add("barcode", currentBarcode)
+                .add("or_remain", mBarRemain)
+                .add("bar_remain", mRestqty)
+                .build();
+
+        okhttp3.Request.Builder builder = new okhttp3.Request.Builder().url(url).post(requestBody);
+
+        Map<String, String> cookiesMap = VolleyUtil.getVolleyUtil().setCookies();
+        if (cookiesMap != null) {
+            Set<String> keys = cookiesMap.keySet();
+            Iterator<String> iterator = keys.iterator();
+            while (iterator.hasNext()) {
+                String key = iterator.next();
+                String value = cookiesMap.get(key);
+                builder.addHeader(key, value);
+            }
+        }
+
+        mRequest = builder.build();
+        mOkHttpClient.newCall(mRequest).enqueue(new Callback() {
+            @Override
+            public void onFailure(Call call, IOException e) {
+                progressDialog.dismiss();
+                Message message = Message.obtain();
+                message.what = SPLIT_BARCODE_FAIL;
+                message.obj = "{\"exceptionInfo\":\"条码拆分异常\"}";
+                mHandler.sendMessage(message);
+            }
+
+            @Override
+            public void onResponse(Call call, okhttp3.Response response) throws IOException {
+                progressDialog.dismiss();
+                String s = response.body().string();
+                if (response.code() == 200) {
+                    Message message = Message.obtain();
+                    message.what = SPLIT_BARCODE_SUCCESS;
+                    message.obj = s;
+                    mHandler.sendMessage(message);
+                } else {
+                    Message message = Message.obtain();
+                    message.what = SPLIT_BARCODE_FAIL;
+                    message.obj = s;
+                    mHandler.sendMessage(message);
+                }
+            }
+        });
+*/
+        /*stringRequest = new StringRequest(Request.Method.POST, url,
+                new Response.Listener<String>() {
+                    @Override
+                    public void onResponse(String s) {
+                        progressDialog.dismiss();
+
+                        if (popupWindow != null && popupWindow.isShowing())
+                            closePopupWindow();
+                        mResults = new ArrayList<>();
+                        mCollectTypeRadioGroup.setEnabled(true);
+                        LogUtil.e("breaking", s);
+                        try {
+                            JSONObject jsonObject = new JSONObject(s);
+                            JSONObject dataObject = jsonObject.optJSONObject("data");
+                            if (dataObject == null) {
+                                return;
+                            }
+                            JSONObject messageObject = dataObject.optJSONObject("barcode");
+                            if (messageObject == null) {
+                                return;
+                            }
+                            if (messageObject.has("ISMSD")) {
+                                if (messageObject.optBoolean("ISMSD")) {
+                                    //成功,有返回值,判断返回值message中isMsd是否存在,存在判断if(isMsd)true,弹出显示框
+                                    iocOutMakeMaterialOperMsd = JsonTools.parseJsonToBean(jsonObject.toString(), IOCOutMakeMaterialOperMsd.class);
+//                            Log.i("msdresult", iocOutMakeMaterialOperMsd.toString());
+                                    mBarRemain = CommonUtil.doubleFormat(iocOutMakeMaterialOperMsd.getData().getBarcode().getBAR_REMAIN());
+                                    mRestqty = CommonUtil.doubleFormat(iocOutMakeMaterialOperMsd.getData().getBarcode().getRESTQTY());
+                                    showDewPopupWindow();
+                                } else {
+                                    mIocoutMaterialSplitBean = JsonTools.parseJsonToBean(messageObject.toString(), IOCOutmakeMaterialSplitBean.class);
+                                    mBarRemain = CommonUtil.doubleFormat(mIocoutMaterialSplitBean.getBAR_REMAIN());
+                                    mRestqty = CommonUtil.doubleFormat(mIocoutMaterialSplitBean.getRESTQTY());
+                                    if (CommonUtil.doubleCompare(mIocoutMaterialSplitBean.getBAR_REMAIN(), mIocoutMaterialSplitBean.getRESTQTY()) == 1) {
+                                        spliteBarcode(currentBarcode);
+                                    }
+                                }
+                            } else {
+                                mCollectResultTextView.setVisibility(View.VISIBLE);
+                                mCollectResultTextView.setText(null);
+                                JSONArray listArray = dataObject.optJSONArray("nolist");
+                                if (mCollectType.equals("byBarcode")) {
+                                    String barcodeResult = "采集成功;" + JsonUtils.optStringNotNull(dataObject, "finishno")
+                                            + "\n条码:" + JsonUtils.optStringNotNull(messageObject, "BAR_CODE")
+                                            + ";数量:" + CommonUtil.doubleFormat(messageObject.optDouble("BAR_REMAIN"))
+                                            + ";批号:" + JsonUtils.optStringNotNull(messageObject, "BAR_BATCHCODE")
+                                            + ";料号:" + JsonUtils.optStringNotNull(messageObject, "BAR_PRODCODE")
+                                            + ";名称规格:" + messageObject.optString("PR_DETAIL")
+                                            + "  " + JsonUtils.optStringNotNull(messageObject, "PR_SPEC")
+                                            + ";仓位:" + JsonUtils.optStringNotNull(messageObject, "BAR_LOCATION");
+
+                                    if (listArray != null && listArray.length() > 0) {
+                                        for (int i = 0; i < listArray.length(); i++) {
+                                            JSONObject listObject = listArray.optJSONObject(i);
+                                            barcodeResult = barcodeResult
+                                                    + "\n单号:" + JsonUtils.optStringNotNull(listObject, "PI_INOUTNO")
+                                                    + ";条码号:" + JsonUtils.optStringNotNull(listObject, "BAR_CODE")
+                                                    + ";数量:" + CommonUtil.doubleFormat(JsonUtils.optDoubleNotNull(listObject, "BAR_REMAIN"));
+                                        }
+                                    }
+
+                                    mCollectResultTextView.setText(barcodeResult);
+
+
+                                    mBarcodeTableLayout.setVisibility(View.GONE);
+                                    mBoxTableLayout.setVisibility(View.GONE);
+
+                                    tvBarcodeCollectionSuccess.setVisibility(View.VISIBLE);
+                                    tvBarcodeCollectionSuccess.setText("采集成功");
+
+                                    mResult1 = messageObject.optString("BAR_CODE");
+                                    mResult2 = messageObject.optDouble("BAR_REMAIN") + "";
+                                    mResult3 = messageObject.optString("BAR_PRODCODE");
+
+                                    mResults.add(mResult1);
+                                    mResults.add(mResult2);
+                                    mResults.add(mResult3);
+
+                                    mCollectBarcodeTv.setText(mResult1);
+                                    mCollectBarRemainTv.setText(mResult2);
+                                    mCollectBarProdcodeTv.setText(mResult3);
+
+                                    PdaApplication.putDataCache2Map(Constants.FLAG.MATERIAL_COLLECT_BARCODE_RESULT + pi_inoutno, mResults);
+                                } else if (mCollectType.equals("byBatchcode")) {
+                                    String boxResult = "采集成功;" + JsonUtils.optStringNotNull(dataObject, "finishno")
+                                            + "\n箱号:" + JsonUtils.optStringNotNull(messageObject, "BAR_OUTBOXCODE1")
+                                            + ";数量:" + CommonUtil.doubleFormat(messageObject.optDouble("BAR_REMAIN"))
+                                            + ";批号:" + JsonUtils.optStringNotNull(messageObject, "BAR_BATCHCODE")
+                                            + ";料号:" + JsonUtils.optStringNotNull(messageObject, "BAR_PRODCODE")
+                                            + ";名称规格:" + JsonUtils.optStringNotNull(messageObject, "PR_DETAIL")
+                                            + "  " + JsonUtils.optStringNotNull(messageObject, "PR_SPEC");
+
+
+                                    if (listArray != null && listArray.length() > 0) {
+                                        for (int i = 0; i < listArray.length(); i++) {
+                                            JSONObject listObject = listArray.optJSONObject(i);
+                                            boxResult = boxResult
+                                                    + "\n单号:" + JsonUtils.optStringNotNull(listObject, "PI_INOUTNO")
+                                                    + ";条码号:" + JsonUtils.optStringNotNull(listObject, "BAR_CODE")
+                                                    + ";数量:" + CommonUtil.doubleFormat(JsonUtils.optDoubleNotNull(listObject, "BAR_REMAIN"));
+                                        }
+                                    }
+
+                                    mCollectResultTextView.setText(boxResult);
+
+
+                                    mBarcodeTableLayout.setVisibility(View.GONE);
+                                    mBoxTableLayout.setVisibility(View.GONE);
+
+                                    tvBoxCollectionSuccess.setVisibility(View.VISIBLE);
+                                    tvBoxCollectionSuccess.setText("采集成功");
+
+                                    mResult1 = messageObject.optString("PA_OUTBOXCODE");
+                                    mResult2 = messageObject.optInt("PA_TOTALQTY") + "";
+                                    mResult3 = messageObject.optString("PA_PRODCODE");
+                                    mResult4 = messageObject.optString("PA_WHCODE");
+
+                                    mResults.add(mResult1);
+                                    mResults.add(mResult2);
+                                    mResults.add(mResult3);
+                                    mResults.add(mResult4);
+
+                                    mCollectBoxTv.setText(mResult1);
+                                    mCollectBoxNumTv.setText(mResult2);
+                                    mCollectBoxrProdcodeTv.setText(mResult3);
+                                    mCollectBoxWhcodeTv.setText(mResult4);
+
+                                    PdaApplication.putDataCache2Map(Constants.FLAG.MATERIAL_COLLECT_BOX_RESULT + pi_inoutno, mResults);
+                                }
+                                CommonUtil.toastNoRepeat(getActivity(), "采集成功");
+
+                                Object next = jsonObject.getJSONObject("data").get("next");
+                                if (next != null && !"null".equals(next.toString())) {
+                                    JSONObject nextObject = jsonObject.getJSONObject("data").getJSONObject("next");
+                                    MaterialInformationBean.DataBean materialInformationBean = JsonTools.parseJsonToBean(nextObject.toString(), MaterialInformationBean.DataBean.class);
+                                    if (materialInformationBean != null) {
+                                        String materialInfo =
+                                                "物料:" + (materialInformationBean.getPD_PRODCODE() == null ? "" : materialInformationBean.getPD_PRODCODE())
+                                                        + "; 名称规格:" + (materialInformationBean.getPR_DETAIL() == null ? "" : materialInformationBean.getPR_DETAIL())
+                                                        + "  " + (materialInformationBean.getPR_SPEC() == null ? "" : materialInformationBean.getPR_SPEC())
+                                                        + "; 未备料数:" + (materialInformationBean.getPD_RESTQTY() == null ? "" : materialInformationBean.getPD_RESTQTY())
+                                                        + "; 批数量:" + (CommonUtil.doubleFormat(materialInformationBean.getBAR_REMAIN()))
+                                                        + "; 仓位:" + (materialInformationBean.getBAR_LOCATION() == null ? "" : materialInformationBean.getBAR_LOCATION());
+                                        if (materialInformationBean.getPD_BATCHCODE() != null) {
+                                            materialInfo = materialInfo + "; 批号:" + materialInformationBean.getPD_BATCHCODE();
+                                        }
+                                        mMaterialInforTextView.setText(materialInfo);
+                                    }
+                                } else {
+                                    mMaterialInforTextView.setText("该出库单已经完成备料");
+                                }
+                            }
+
+                        } catch (JSONException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                },
+                new Response.ErrorListener() {
+
+                    @Override
+                    public void onErrorResponse(VolleyError volleyError) {
+                        progressDialog.dismiss();
+//                        Toast.makeText(getActivity().getApplicationContext(), "拆分失败", Toast.LENGTH_LONG).show();
+                        if (getActivity() != null) {
+                            etBarCode.setText(null);
+                            CommonUtil.editTextGetFocus(etBarCode);
+                            CommonUtil.showErrorToast(volleyError);
+                        }
+                    }
+                }) {
+            @Override
+            public Map<String, String> getHeaders() throws AuthFailureError {
+                return VolleyUtil.getVolleyUtil().setCookies();
+            }
+
+            @Override
+            protected Map<String, String> getParams() throws AuthFailureError {
+                Map<String, String> params = new HashMap<>();
+//                if (isMultiple) {
+                params.put("ids", pi_id);
+//                } else {
+//                    params.put("id", pi_id);
+//                    params.put("whcode", pd_whcode);
+//                }
+                params.put("barcode", currentBarcode);
+                params.put("or_remain", mBarRemain);
+                params.put("bar_remain", mRestqty);
+                Log.e(TAG, params.toString());
+                return params;
+            }
+
+        };
+        stringRequest.setRetryPolicy(new DefaultRetryPolicy(20 * 1000, 0, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
+        int timeoutMs = stringRequest.getTimeoutMs();
+        stringRequest.setTag(TAG);
+        PdaApplication.mRequestQueue.add(stringRequest);*/
+    }
+
+    protected void initBreakPopupWindow(com.alibaba.fastjson.JSONArray listArray) {
+        messages.clear();
+        for (int i = 0; i < listArray.size(); i++) {
+            try {
+                com.alibaba.fastjson.JSONObject barcodeObject = listArray.getJSONObject(i);
+
+                if (barcodeObject != null) {
+                    WHBreakingBatchBreakingBtnClickEventNew.DataBean dataBean = new WHBreakingBatchBreakingBtnClickEventNew.DataBean();
+
+                    //                    dataBean.setBAR_CODE(JsonUtils.optStringNotNull(barcodeObject, "BAR_CODE"));
+                    //                    dataBean.setBAR_REMAIN(JsonUtils.optStringNotNull(barcodeObject, "BAR_REMAIN"));//RESTQTY
+                    dataBean.setBAR_CODE(barcodeObject.getString("BAR_CODE"));
+                    dataBean.setBAR_REMAIN(barcodeObject.getString("BAR_REMAIN"));//RESTQTY
+
+                    messages.add(dataBean);
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+
+        View popView = LayoutInflater.from(getActivity()).inflate(R.layout.popupwindow_whbreaking_batch, null);
+        ListView listView = (ListView) popView.findViewById(R.id.list_view);
+        Button btnPrintf = (Button) popView.findViewById(R.id.btn_print);
+        Button btnPrintfSet = (Button) popView.findViewById(R.id.btn_print_setting);
+        Button btnClose = (Button) popView.findViewById(R.id.btn_close);
+        Button btnBack = (Button) popView.findViewById(R.id.btn_back);
+
+        btnBack.setVisibility(View.GONE);
+        btnClose.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                closeSplitPopupWindow();
+            }
+        });
+        btnPrintf.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (isConnected) {
+                    progressDialog.show();
+                    printEvent(listArray);
+                } else {
+                    closeSplitPopupWindow();
+                    BlueToothPrintFragment blueToothPrintFragment = new BlueToothPrintFragment();
+
+                    Bundle bundle = new Bundle();
+                    bundle.putString(Constants.KEY.BARCODE_PRINT_ARRAY, listArray.toString());
+                    blueToothPrintFragment.setArguments(bundle);
+                    FragmentUtils.switchFragment(IOCOutMakeMaterialOperNew.this, blueToothPrintFragment);
+                }
+            }
+        });
+
+        btnPrintfSet.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                closeSplitPopupWindow();
+                BlueToothPrintFragment blueToothPrintFragment = new BlueToothPrintFragment();
+
+                Bundle bundle = new Bundle();
+                bundle.putString(Constants.KEY.BARCODE_PRINT_ARRAY, listArray.toString());
+                blueToothPrintFragment.setArguments(bundle);
+                FragmentUtils.switchFragment(IOCOutMakeMaterialOperNew.this, blueToothPrintFragment);
+            }
+        });
+
+        MyAdapter adapter = new MyAdapter(getActivity(), R.layout.item_list_whbreakingbatchfragment, messages);
+        listView.setAdapter(adapter);
+        //当只有一条数据的时候可以加上
+        /*
+        if (messages.size()>1){
+            btnBack.setVisibility(View.GONE);
+        }*/
+        // PopupWindow实例化,参数的意思是 view,长(不包括状态栏),高(不包括状态栏),是否聚焦
+        splitPop = new PopupWindow(popView, LinearLayout.LayoutParams.WRAP_CONTENT,
+                LinearLayout.LayoutParams.WRAP_CONTENT, true);
+        splitPop.setAnimationStyle(R.style.MenuAnimationFade);
+        splitPop.setBackgroundDrawable(new BitmapDrawable());
+        // 弹出窗口显示内容视图,默认以锚定视图的左下角为起点,这里为点击按钮
+        splitPop.showAtLocation(getActivity().getWindow().getDecorView(), Gravity.CENTER, 0, 0);
+        splitPop.setOnDismissListener(new PopupWindow.OnDismissListener() {
+            @Override
+            public void onDismiss() {
+                closeSplitPopupWindow();
+                //                confirmEvent();
+            }
+        });
+        CommonUtil.setBackgroundAlpha(mActivity, 0.5f);
+    }
+
+    private void printEvent(com.alibaba.fastjson.JSONArray printArray) {
+        if (isPrinting) {
+            CommonUtil.toastNoRepeat(mActivity, "正在打印中,请勿重复操作");
+            return;
+        }
+        isPrinting = true;
+        if (printArray != null && printArray.size() > 0) {
+            boolean isFail = false;
+            for (int i = 0; i < printArray.size(); i++) {
+                try {
+                    com.alibaba.fastjson.JSONObject printObject = printArray.getJSONObject(i);
+                    int printResult = PrintUtils.printBar(mActivity, printObject.toString(), mPrintDpi, null);
+                    if (printResult <= 0) {
+                        isFail = true;
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+            closeSplitPopupWindow();
+            progressDialog.dismiss();
+            if (isFail) {
+                isConnected = false;
+                SharedPreUtil.saveInt(mActivity, "printConnect", 0);
+                CommonUtil.toastNoRepeat(mActivity, "打印失败,请重新连接打印机");
+
+                BlueToothPrintFragment blueToothPrintFragment = new BlueToothPrintFragment();
+
+                Bundle bundle = new Bundle();
+                bundle.putString(Constants.KEY.BARCODE_PRINT_ARRAY, printArray.toString());
+                blueToothPrintFragment.setArguments(bundle);
+                FragmentUtils.switchFragment(IOCOutMakeMaterialOperNew.this, blueToothPrintFragment);
+            } else {
+                CommonUtil.toastNoRepeat(mActivity, "打印成功");
+            }
+        } else {
+            CommonUtil.toastNoRepeat(mActivity, "打印失败,条码数据为空");
+        }
+        isPrinting = false;
+    }
+
+    public static final String GETPRINTDATA = "getPrintData";
+
+    /**
+     * 获取打印文件
+     */
+    private void getPrintData() {
+        progressDialog.show();
+        String url = GloableParams.ADDRESS_LABELPRINT + "?data=" + strPrintDataList;
+        stringRequestSplit = new StringRequest(Request.Method.GET, url, new Response.Listener<String>() {
+            @Override
+            public void onResponse(String s) {
+                try {
+                    JSONObject resultObject = new JSONObject(s);
+                    if (resultObject.optBoolean("success")) {
+                        mPrintUrl = resultObject.optString("data");
+                        FileUtils.printBarcode(mPrintUrl, mHandler);
+                    }
+                } catch (JSONException e) {
+                    if (progressDialog.isShowing())
+                        progressDialog.dismiss();
+                    e.printStackTrace();
+                }
+            }
+        }, new Response.ErrorListener() {
+            @Override
+            public void onErrorResponse(VolleyError volleyError) {
+                if (progressDialog.isShowing())
+                    progressDialog.dismiss();
+                CommonUtil.showErrorToast(volleyError);
+            }
+        }) {
+            @Override
+            public Map<String, String> getHeaders() throws AuthFailureError {
+                Map map = VolleyUtil.getVolleyUtil().setCookies();
+                //不用改动
+                map.put("Content-Type", "text/html; charset=UTF-8");
+                return map;
+            }
+
+        };
+        stringRequestSplit.setRetryPolicy(new DefaultRetryPolicy(10 * 1000, 0, 1f));
+        stringRequestSplit.setTag(GETPRINTDATA);
+        PdaApplication.mRequestQueue.add(stringRequestSplit);
+    }
+
+    private class MyAdapter extends ArrayAdapter<WHBreakingBatchBreakingBtnClickEventNew.DataBean> {
+        private int resourceId;
+
+        public MyAdapter(Context context, int resource, List<WHBreakingBatchBreakingBtnClickEventNew.DataBean> objects) {
+            super(context, resource, objects);
+            resourceId = resource;
+        }
+
+        @Override
+        public View getView(int position, View convertView, ViewGroup parent) {
+            //WHBreakingBatchBreakingBtnClickEventNew.Message target = getItem(position);
+            WHBreakingBatchBreakingBtnClickEventNew.DataBean person = getItem(position);
+            convertView = LayoutInflater.from(getContext()).inflate(resourceId,
+                    null);
+            TextView tv_bar_code = (TextView) convertView.findViewById(R.id.tv_bar_code);
+            TextView tv_bar_remain = (TextView) convertView.findViewById(R.id.tv_bar_remain);
+            // tv_bar_code.setText(target.bar_code);
+            // tv_bar_remain.setText(target.bar_remain);
+            tv_bar_code.setText(person.getBAR_CODE());
+            tv_bar_remain.setText(person.getBAR_REMAIN());
+            return convertView;
+        }
+
+    }
+
+    /**
+     * 条码输入框的enter事件以及确认按钮点击事件
+     */
+    private void confirmEvent() {
+        currentBarcode = etBarCode.getText().toString().trim();
+        if (TextUtils.isEmpty(currentBarcode)) {
+            CommonUtil.toastNoRepeat(getActivity(), "请输入号码");
+        } else if (!currentBarcode.matches(Constants.REGEX.NO_CN_SYMBOL)) {
+            CommonUtil.toastNoRepeat(getActivity(), getResources().getString(R.string.barcode_cannot_contain_special));
+        } else {
+            if (mCollectModel == 1) {
+                if (CommonUtil.isNetWorkConnected(getActivity())) {
+                    barcodeEnterEvent(false, true);
+                } else {
+                    CommonUtil.toastNoRepeat(getActivity(), getResources().getString(R.string.str_net_not_connect));
+                }
+            } else if (mCollectModel == 0) {
+                //离线模式
+                saveToDatabase(currentBarcode);
+            }
+        }
+    }
+
+    private void saveToDatabase(String currentText) {
+        progressDialog.show();
+        List<TableLBARCODEIO> allBarcodeIo = new ArrayList<>();
+        if (mDbManager.getDb().isOpen()) {
+            allBarcodeIo = mDbManager.queryFromBarcodeIo(new String[]{"out", pi_id, pd_whcode}, "inOrOut=? and LBI_PIID=? and LBI_WHCODE=? ");
+        }
+
+        //如果用户采集的离线数据超过30条,提示用户请先将采集的数据上传,限制用户必须先将数据上传
+        if (allBarcodeIo.size() >= 30) {
+            progressDialog.dismiss();
+            final List<TableLBARCODEIO> finalAllBarcodeIo = allBarcodeIo;
+            new android.app.AlertDialog.Builder(getActivity())
+                    .setTitle("提示")
+                    .setMessage("您采集的离线数据已经达到30条,请先将离线数据上传再继续采集。是否上传数据?")
+                    .setPositiveButton("上传", new DialogInterface.OnClickListener() {
+                        @Override
+                        public void onClick(DialogInterface dialog, int which) {
+                            if (CommonUtil.isNetWorkConnected(getActivity())) {
+                                submitOfflineData(finalAllBarcodeIo, false);
+                            } else {
+                                CommonUtil.toastNoRepeat(getActivity(), getResources().getString(R.string.str_net_not_connect));
+                            }
+                        }
+                    })
+                    .setNegativeButton("取消", new DialogInterface.OnClickListener() {
+                        @Override
+                        public void onClick(DialogInterface dialog, int which) {
+                            dialog.dismiss();
+                        }
+                    }).show();
+            return;
+        }
+
+
+        boolean isExist = false;
+        for (int i = 0; i < allBarcodeIo.size(); i++) {
+            if (pi_id.equals(allBarcodeIo.get(i).getLBI_PIID() + "") && pd_whcode.equals(allBarcodeIo.get(i).getLBI_WHCODE())
+                    && "out".equals(allBarcodeIo.get(i).getInOrOut())
+                    && ((currentText.equals(allBarcodeIo.get(i).getLBI_BARCODE()) && mCollectType.equals("byBarcode"))
+                    || (currentText.equals(allBarcodeIo.get(i).getLBI_OUTBOXCODE()) && mCollectType.equals("byBatchcode")))) {
+                isExist = true;
+                break;
+            }
+        }
+        if (isExist) {
+            progressDialog.dismiss();
+            if (mCollectType.equals("byBarcode"))
+                Toast.makeText(getActivity(), "条码 " + currentText + " 已经在已采集待提交数据中", Toast.LENGTH_SHORT).show();
+            else if (mCollectType.equals("byBatchcode"))
+                Toast.makeText(getActivity(), "外箱 " + currentText + " 已经在已采集待提交数据中", Toast.LENGTH_SHORT).show();
+            etBarCode.setText(null);
+            etBarCode.requestFocus();
+
+        } else {
+            TableLBARCODEIO newBarcodeIo = new TableLBARCODEIO();
+            newBarcodeIo.setLBI_PIID(Long.parseLong(pi_id));
+            if (mCollectType.equals("byBarcode")) {
+                newBarcodeIo.setLBI_BARCODE(etBarCode.getText().toString().trim());
+                newBarcodeIo.setLBI_OUTBOXCODE("");
+                newBarcodeIo.setLBI_BOXTYPE("byBarcode");
+            } else if (mCollectType.equals("byBatchcode")) {
+                newBarcodeIo.setLBI_BARCODE("");
+                newBarcodeIo.setLBI_OUTBOXCODE(etBarCode.getText().toString().trim());
+                newBarcodeIo.setLBI_BOXTYPE("byBatchcode");
+            }
+            newBarcodeIo.setLBI_WHCODE(pd_whcode);
+            newBarcodeIo.setLBI_INOUTNO(pi_inoutno);
+            newBarcodeIo.setLBI_PRODCODE("");
+            newBarcodeIo.setLBI_INQTY(0);
+            newBarcodeIo.setLBI_LOCATION("");
+            newBarcodeIo.setLBI_PRDETAIL("");
+            newBarcodeIo.setLBI_OUTQTY(0);
+            newBarcodeIo.setLBI_PRID(0);
+            newBarcodeIo.setInOrOut("out");
+            try {
+                mDbManager.saveToBarcodeIo(newBarcodeIo);
+                new Handler().postDelayed(new Runnable() {
+                    @Override
+                    public void run() {
+                        progressDialog.dismiss();
+                        Toast.makeText(getActivity(), "成功保存至未提交列表", Toast.LENGTH_SHORT).show();
+                    }
+                }, 400);
+                etBarCode.setText(null);
+            } catch (Exception e) {
+                progressDialog.dismiss();
+                Toast.makeText(getActivity(), "数据保存失败", Toast.LENGTH_SHORT).show();
+                etBarCode.setText(null);
+            }
+        }
+    }
+
+    private void submitOfflineData(final List<TableLBARCODEIO> mNotSubmitList, final boolean isPop) {
+        progressDialog.show();
+        final List<SubmitNotParam> submitNotParams = new ArrayList<SubmitNotParam>();
+        for (int i = 0; i < mNotSubmitList.size(); i++) {
+            SubmitNotParam submitNotParam = new SubmitNotParam();
+            TableLBARCODEIO lbarcodeio = mNotSubmitList.get(i);
+
+            submitNotParam.setBi_barcode(lbarcodeio.getLBI_BARCODE());
+            submitNotParam.setBi_inoutno(lbarcodeio.getLBI_INOUTNO());
+            submitNotParam.setBi_inqty(lbarcodeio.getLBI_INQTY() + "");
+            submitNotParam.setBi_location(lbarcodeio.getLBI_LOCATION());
+            submitNotParam.setBi_piid(lbarcodeio.getLBI_PIID() + "");
+            submitNotParam.setBi_prodcode(lbarcodeio.getLBI_PRODCODE());
+            submitNotParam.setBi_prodid(lbarcodeio.getLBI_PRID() + "");
+            submitNotParam.setBi_whcode(lbarcodeio.getLBI_WHCODE());
+            submitNotParam.setBi_outboxcode(lbarcodeio.getLBI_OUTBOXCODE());
+            submitNotParam.setBi_boxtype(lbarcodeio.getLBI_BOXTYPE());
+
+            submitNotParams.add(submitNotParam);
+        }
+
+        try {
+            String url = GloableParams.ADDRESS_OUT_SAVE_BARCODE;
+            PdaApplication.mRequestQueue.cancelAll(TAG + "submit");
+
+            mStringRequest = new StringRequest(Request.Method.POST, url,
+                    new Response.Listener<String>() {
+                        @Override
+                        public void onResponse(String s) {
+                            progressDialog.dismiss();
+                            try {
+                                JSONObject resultJsonObject = new JSONObject(s);
+                                JSONObject dataJsonObject = resultJsonObject.getJSONObject("data");
+
+                                Iterator<String> resultKeys = dataJsonObject.keys();
+
+                                if (resultKeys.hasNext()) {
+                                    int successCount = 0;
+                                    int failCount = 0;
+                                    while (resultKeys.hasNext()) {
+                                        String barcodeKey = resultKeys.next().toString();
+                                        String barcodeResult = JsonUtils.optStringNotNull(dataJsonObject, barcodeKey);
+
+                                        if (barcodeKey.contains("byBarcode:")) {
+                                            barcodeKey = barcodeKey.substring(10);
+                                        } else if (barcodeKey.contains("byBatchcode:")) {
+                                            barcodeKey = barcodeKey.substring(6);
+                                        }
+                                        if ("success".equals(barcodeResult)) {
+                                            successCount++;
+                                            for (int i = 0; i < mNotSubmitList.size(); i++) {
+                                                TableLBARCODEIO lbarcodeio = mNotSubmitList.get(i);
+                                                if (barcodeKey.equals(lbarcodeio.getLBI_BARCODE())) {
+                                                    mDbManager.deleteFromBarcodeIo(lbarcodeio);
+                                                }
+                                            }
+                                        } else {
+                                            failCount++;
+                                        }
+                                    }
+
+                                    if (failCount == 0) {
+                                        mCollectModelBtn.setText("在线");
+                                        mCollectModel = 1;
+                                        Toast.makeText(getActivity(), getResources().getString(R.string.submit_success), Toast.LENGTH_SHORT).show();
+                                        if (isPop)
+                                            getActivity().getSupportFragmentManager().popBackStack();
+                                    } else {
+                                        mCollectModelBtn.setText("离线");
+                                        mCollectModel = 0;
+                                        CommonUtil.toastNoRepeat(getActivity(), successCount + "条数据提交成功\n" + failCount + "条数据提交失败");
+
+                                    }
+                                }
+
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                            }
+                        }
+                    },
+                    new Response.ErrorListener() {
+                        @Override
+                        public void onErrorResponse(VolleyError volleyError) {
+                            progressDialog.dismiss();
+                            if (getActivity() != null) {
+                                mCollectModelBtn.setText("离线");
+                                mCollectModel = 0;
+                                CommonUtil.showErrorToast(volleyError);
+                            }
+                        }
+                    }) {
+                @Override
+                public Map<String, String> getHeaders() throws AuthFailureError {
+                    return VolleyUtil.getVolleyUtil().setCookies();
+                }
+
+                @Override
+                protected Map<String, String> getParams() throws AuthFailureError {
+                    Map<String, String> param = new HashMap<>();
+                    param.put("data", JSON.toJSONString(submitNotParams));
+                    param.put("type", mProdOutType);
+                    return param;
+                }
+            };
+            mStringRequest.setRetryPolicy(new DefaultRetryPolicy(10 * 1000, 0, 1f));
+            mStringRequest.setTag(TAG + "submit");
+            PdaApplication.mRequestQueue.add(mStringRequest);
+
+        } catch (Exception e) {
+            progressDialog.dismiss();
+            e.printStackTrace();
+        }
+
+    }
+
+
+    private void getAgainEvent() {
+        String url = GloableParams.ADDRESS_CLEARGET;
+
+        PdaApplication.mRequestQueue.cancelAll(TAG);
+        stringRequestPost = new StringRequest(Request.Method.POST, url, new Response.Listener<String>() {
+            @Override
+            public void onResponse(String s) {
+                LogUtil.e("已空", s + "");
+                //                progressDialog.dismiss();
+                CommonUtil.toastNoRepeat(getActivity(), "已清空采集数据");
+                getCollectNotListOnline(pi_id, pd_whcode);
+            }
+        }, new Response.ErrorListener() {
+            @Override
+            public void onErrorResponse(VolleyError volleyError) {
+                progressDialog.dismiss();
+                if (getActivity() != null) {
+                    closeListPopupWindow();
+                    //                getCollectNotListOnline(pi_id, pd_whcode);
+                    CommonUtil.showErrorToast(volleyError);
+                }
+            }
+        }) {
+            @Override
+            public Map<String, String> getHeaders() throws AuthFailureError {
+                return VolleyUtil.getVolleyUtil().setCookies();
+            }
+
+            @Override
+            protected Map<String, String> getParams() throws AuthFailureError {
+                Map<String, String> params = new HashMap<>();
+                params.put("id", pi_id);
+                params.put("whcode", pd_whcode);
+                return params;
+            }
+        };
+        stringRequestPost.setRetryPolicy(new DefaultRetryPolicy(10 * 1000, 0, 1f));
+        stringRequestPost.setTag(TAG);
+        PdaApplication.mRequestQueue.add(stringRequestPost);
+    }
+
+    /**
+     * 获取材料未采集列表
+     *
+     * @param pi_id
+     * @param pd_whcode
+     */
+    private void getCollectNotListOnline(String pi_id, String pd_whcode) {
+        progressDialog.show();
+        String url = GloableParams.ADDRESS_OUT_NEED_GET_LIST + "?id=" + pi_id + "&whcode=" + pd_whcode + "&type=" + mProdOutType;
+
+        PdaApplication.mRequestQueue.cancelAll(TAG + "online");
+
+        jsonRequest = new JsonObjectRequest(Request.Method.GET, url, null,
+                new Response.Listener<JSONObject>() {
+                    @Override
+                    public void onResponse(JSONObject jsonObject) {
+                        progressDialog.dismiss();
+                        try {
+                            if (!"success".equals(jsonObject.getJSONObject("data").optString("message"))) {
+                                CommonUtil.toastNoRepeat(getActivity(), jsonObject.getJSONObject("data").optString("message"));
+                            }
+                            JSONArray jsonArray = jsonObject.getJSONObject("data").getJSONArray("data");
+                            LogUtil.i("jsonArray", jsonArray.toString());
+                            if (jsonArray != null) {
+                                List<TableLPRODIONEEDGET> lprodioneedgetList = new ArrayList<>();
+                                for (int i = 0; i < jsonArray.length(); i++) {
+                                    LogUtil.i("jsonObject", jsonArray.get(i).toString());
+
+                                    JSONObject notCollectObject = jsonArray.getJSONObject(i);
+                                    TableLPRODIONEEDGET lprodioneedget = new TableLPRODIONEEDGET();
+                                    lprodioneedget.setLPN_PRODCODE(notCollectObject.optString("PD_PRODCODE"));
+                                    lprodioneedget.setLPN_RESTQTY(notCollectObject.optDouble("PD_RESTQTY"));
+                                    lprodioneedget.setLPN_PRDETAIL(notCollectObject.optString("PR_DETAIL"));
+                                    lprodioneedget.setLPN_PRSPEC(JsonUtils.optStringNotNull(notCollectObject, "PR_SPEC"));
+                                    lprodioneedget.setLPN_ZXBZS(notCollectObject.optDouble("PR_ZXBZS"));
+
+                                    lprodioneedget.setLPN_IFBARCODECHECK("");
+
+                                    lprodioneedget.setLPN_PIID(notCollectObject.optInt("PD_PIID"));
+                                    lprodioneedget.setLPN_INOUTNO(notCollectObject.optString("PD_INOUTNO"));
+                                    lprodioneedget.setLPN_WHCODE(notCollectObject.optString("PD_WHCODE"));
+                                    lprodioneedget.setLPN_PRID(notCollectObject.optInt("PR_ID"));
+                                    lprodioneedget.setLPN_BATCHCODE(notCollectObject.optString("PD_BATCHCODE"));
+
+                                    lprodioneedget.setInOrOut("out");
+                                    lprodioneedget.setLPN_ORDERCODE("");
+                                    lprodioneedget.setLPN_TRACEKIND(-1);
+
+                                    lprodioneedgetList.add(lprodioneedget);
+                                }
+
+                                try {
+                                    if (mDbManager.getDb().isOpen()) {
+                                        mDbManager.deleteInOrOutProductWaitCollect("out");
+                                        mDbManager.saveListToProductWaitCollect(lprodioneedgetList);
+                                    }
+                                } catch (Exception e) {
+                                    e.printStackTrace();
+                                }
+                            }
+                        } catch (JSONException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                },
+                new Response.ErrorListener() {
+                    @Override
+                    public void onErrorResponse(VolleyError volleyError) {
+                        progressDialog.dismiss();
+                        CommonUtil.showErrorToast(volleyError);
+                    }
+                }) {
+            @Override
+            public Map<String, String> getHeaders() throws AuthFailureError {
+                return VolleyUtil.getVolleyUtil().setCookies();
+            }
+
+            @Override
+            protected Response<JSONObject> parseNetworkResponse(NetworkResponse response) {
+                if (response.data == null || response.data.length == 0) {
+                    JSONObject jsonObject = new JSONObject();
+                    try {
+                        jsonObject.put("msg", "成功:服务器无返回");
+                    } catch (JSONException e) {
+                        e.printStackTrace();
+                    }
+                    return Response.success(jsonObject, HttpHeaderParser.parseCacheHeaders(response));
+                } else {
+                    return super.parseNetworkResponse(response);
+
+                }
+            }
+        };
+        jsonRequest.setRetryPolicy(new DefaultRetryPolicy(10 * 1000, 0, 1f));
+        jsonRequest.setTag(TAG + "online");
+        PdaApplication.mRequestQueue.add(jsonRequest);
+    }
+
+    private void clickToFragment(BaseFragment baseFragment) {
+        Bundle bundle = new Bundle();
+        bundle.putString("pi_id", pi_id);
+        bundle.putString("pi_inoutno", pi_inoutno);
+        bundle.putString("pd_whcode", pd_whcode);
+        bundle.putString("whichpage", "materialout");
+        bundle.putBoolean("isMultiple", isMultiple);
+        if (mCollectModel == 1) {
+            bundle.putInt("modeType", 3);
+        } else if (mCollectModel == 0) {
+            bundle.putInt("modeType", 2);
+        }
+        mFragment = baseFragment;
+        mFragment.setArguments(bundle);
+        FragmentUtils.switchFragment(this, mFragment);
+    }
+
+    private void closeListPopupWindow() {
+        if (listPopupWindow != null) {
+            listPopupWindow.dismiss();
+            listPopupWindow = null;
+            CommonUtil.setBackgroundAlpha(mActivity, 1f);
+        }
+
+    }
+
+    private void closeSplitPopupWindow() {
+        if (splitPop != null) {
+            splitPop.dismiss();
+            splitPop = null;
+            CommonUtil.setBackgroundAlpha(mActivity, 1f);
+        }
+    }
+
+    private void closePopupWindow() {
+        if (popupWindow != null) {
+            popupWindow.dismiss();
+            popupWindow = null;
+            CommonUtil.setBackgroundAlpha(mActivity, 1f);
+        }
+    }
+
+    /**
+     * 清除所有信息
+     */
+    private void clearAll() {
+        //清空输入框
+        etBarCode.setText("");
+
+    }
+
+    @Override
+    public void onDestroyView() {
+        super.onDestroyView();
+        ((FunctionActivity) getActivity()).setMoreBtnVisible(false);
+        ((FunctionActivity) getActivity()).setScanIvVisible(false);
+        ((TextView) (getActivity().findViewById(R.id.tv_actionbar_withback))).setText(getString(R.string.out_management));
+        mDbManager.closeDB();
+        CommonUtil.closeKeybord(((EditText) etBarCode), mActivity);
+        ((FunctionActivity) getActivity()).fragment = new IOCOutMakeMaterial();
+    }
+
+    /**
+     * 其返回一个布尔值;意思是,如果对返回事件进行了处理就返回TRUE,如果不做处理就返回FALSE,让上层进行处理。
+     *
+     * @return 是否交与activity处理返回事件
+     */
+    public boolean onFragmentBackPressed() {
+        List<TableLBARCODEIO> allBarcodeIo = new ArrayList<>();
+        if (mDbManager == null || !mDbManager.getDb().isOpen()) {
+            mDbManager = new DBManager(PdaApplication.getmContext());
+        }
+        allBarcodeIo = mDbManager.queryFromBarcodeIo(new String[]{"out", pi_inoutno, pd_whcode}, "inOrOut=? and LBI_INOUTNO=? and LBI_WHCODE=?");
+        if (allBarcodeIo != null && allBarcodeIo.size() != 0) {
+            final List<TableLBARCODEIO> finalAllBarcodeIo = allBarcodeIo;
+            new android.app.AlertDialog.Builder(getActivity())
+                    .setTitle("提示")
+                    .setMessage("存在未提交的离线采集数据,点击上传将把未提交数据上传,点击取消将清空未采集数据")
+                    .setPositiveButton("上传", new DialogInterface.OnClickListener() {
+                        @Override
+                        public void onClick(DialogInterface dialog, int which) {
+                            if (CommonUtil.isNetWorkConnected(getActivity())) {
+                                submitOfflineData(finalAllBarcodeIo, true);
+                            } else {
+                                CommonUtil.toastNoRepeat(getActivity(), getResources().getString(R.string.str_net_not_connect));
+                            }
+                        }
+                    })
+                    .setNegativeButton("取消", new DialogInterface.OnClickListener() {
+                        @Override
+                        public void onClick(DialogInterface dialog, int which) {
+                            dialog.dismiss();
+                            try {
+                                mDbManager.deleteListFromBarcodeIo(finalAllBarcodeIo);
+                                List<TableLPRODIONEEDGET> allLprodioneedgets = mDbManager.queryFromProductWaitCollect(new String[]{"out"}, "inOrOut=? ");
+                                if (allLprodioneedgets != null) {
+                                    for (int j = 0; j < finalAllBarcodeIo.size(); j++) {
+                                        TableLBARCODEIO deleteLbarcodeio = finalAllBarcodeIo.get(j);
+                                        for (int i = 0; i < allLprodioneedgets.size(); i++) {
+                                            TableLPRODIONEEDGET tableLPRODIONEEDGET = allLprodioneedgets.get(i);
+                                            if (tableLPRODIONEEDGET.getLPN_PIID() == deleteLbarcodeio.getLBI_PIID()
+                                                    && tableLPRODIONEEDGET.getLPN_WHCODE().equals(deleteLbarcodeio.getLBI_WHCODE())
+                                                //                                                    && tableLPRODIONEEDGET.getLPN_PRODCODE().equals(deleteLbarcodeio.getLBI_PRODCODE())
+                                            ) {
+                                                tableLPRODIONEEDGET.setLPN_RESTQTY(CommonUtil.doubleAddition(tableLPRODIONEEDGET.getLPN_RESTQTY(), deleteLbarcodeio.getLBI_INQTY()));
+                                                mDbManager.updateProductWaitCollect(tableLPRODIONEEDGET);
+                                            }
+                                        }
+                                    }
+
+                                }
+                                CommonUtil.toastNoRepeat(getActivity(), "清除数据成功");
+                                getActivity().getSupportFragmentManager().popBackStack();
+                            } catch (Exception e) {
+                                CommonUtil.toastNoRepeat(getActivity(), "清除失败");
+                                getActivity().getSupportFragmentManager().popBackStack();
+                            }
+                        }
+                    }).show();
+            //            ((FunctionActivity) getActivity()).fragment = new MaterialStorageFragment();
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private class IpAndResourcesPortAdapter extends BaseQuickAdapter<ComDataBean, BaseViewHolder> {
+        private List<ComDataBean> mmmmList;
+
+        public List<ComDataBean> getmList() {
+            return mmmmList;
+        }
+
+        public void setmList(List<ComDataBean> mList) {
+            this.mmmmList = mList;
+        }
+
+        public ComDataBean getBeanByPositon(int position) {
+            return mmmmList.get(position);
+        }
+
+        private IpAndResourcesPortAdapter(@Nullable List<ComDataBean> data) {
+            super(R.layout.fuzzy_ipandport_item, data);
+            this.mmmmList = data;
+        }
+
+        @Override
+        protected void convert(BaseViewHolder helper, ComDataBean item) {
+            helper.setText(R.id.macode_ip__Tv, item.getItemremark() + "-(" + item.getItemName() + ")");
+            LinearLayout line_true = helper.itemView.findViewById(R.id.line_true);
+            if (item.getChecked()) {
+                line_true.setSelected(true);
+            } else {
+                line_true.setSelected(false);
+            }
+        }
+    }
+
+    private class ComDataBean {
+        String itemName = null;
+        String itemremark = null;
+        boolean Checked;
+
+        public boolean getChecked() {
+            return Checked;
+        }
+
+        public void setChecked(boolean checked) {
+            Checked = checked;
+        }
+
+        public String getItemName() {
+            return itemName;
+        }
+
+        public void setItemName(String itemName) {
+            this.itemName = itemName;
+        }
+
+        public String getItemremark() {
+            return itemremark;
+        }
+
+        public void setItemremark(String itemremark) {
+            this.itemremark = itemremark;
+        }
+    }
+
+}

+ 1 - 0
app/src/main/java/com/uas/jc_wms/fragment/IndexWareHouseContentFragment.java

@@ -145,6 +145,7 @@ public class IndexWareHouseContentFragment extends BaseFragment implements Adapt
 //                    getFragmentManager().beginTransaction().addToBackStack(null)
 //                            .replace(R.id.container_function_fragment, fragment).commit();
 //                    break;
+                //库存条码绑定
                 case GloableParams.MENU_STORAGE_STOCK_INFO_COLLECT:
                     fragment = new InventoryBindingFragment();
                     getFragmentManager().beginTransaction().addToBackStack(null)

+ 287 - 51
app/src/main/java/com/uas/jc_wms/fragment/InventoryCollectFragment.java

@@ -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.jc_wms.R;
 import com.uas.jc_wms.activity.FunctionActivity;
+import com.uas.jc_wms.bean.InventoryCollctBean;
 import com.uas.jc_wms.global.GloableParams;
 import com.uas.jc_wms.listener.MyEditorActionListener;
 import com.uas.jc_wms.util.CameraUtil;
@@ -29,11 +36,15 @@ import com.uas.jc_wms.util.FastjsonUtil;
 import com.uas.jc_wms.util.FragmentUtils;
 import com.uas.jc_wms.util.HttpCallback;
 import com.uas.jc_wms.util.HttpParams;
+import com.uas.jc_wms.util.StringUtil;
 import com.uas.jc_wms.util.VolleyRequest;
 import com.uas.jc_wms.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,13 +53,21 @@ 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 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() {
         return R.layout.fragment_inventory_collect;
@@ -69,6 +88,27 @@ public class InventoryCollectFragment extends BaseFragment implements View.OnCli
         cb_caiji=root.findViewById(R.id.cb_caiji);
 
         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
@@ -113,64 +153,189 @@ public class InventoryCollectFragment extends BaseFragment implements View.OnCli
                     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();
             }
         });
     }
@@ -194,6 +359,77 @@ public class InventoryCollectFragment extends BaseFragment implements View.OnCli
 //        } 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

+ 1 - 0
app/src/main/java/com/uas/jc_wms/fragment/MaterialOutStockTaskMultipleFragment.java

@@ -216,6 +216,7 @@ public class MaterialOutStockTaskMultipleFragment extends BaseFragment {
                                         stockTaskItemBean.setPD_BATCHCODE(JsonUtils.optStringNotNull(dataObject, "PD_BATCHCODE"));
                                         stockTaskItemBean.setDC(JsonUtils.optStringNotNull(dataObject, "DC"));
                                         stockTaskItemBean.setBAR_REMAIN(JsonUtils.optDoubleNotNull(dataObject, "BAR_REMAIN"));
+                                        stockTaskItemBean.setV_RESTQTY(JsonUtils.optStringNotNull(dataObject, "V_RESTQTY"));
 
                                         List<StockTaskMultipleBean.NOSBean> nosBeans = new ArrayList<>();
                                         JSONArray nosArray = dataObject.optJSONArray("NOS");

+ 444 - 0
app/src/main/java/com/uas/jc_wms/fragment/NewWHCheckMakeMaterialFragment.java

@@ -0,0 +1,444 @@
+package com.uas.jc_wms.fragment;
+
+import android.app.ActionBar;
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.graphics.drawable.BitmapDrawable;
+import android.os.AsyncTask;
+import android.util.Log;
+import android.view.Gravity;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.Window;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.ListView;
+import android.widget.PopupWindow;
+import android.widget.TextView;
+
+import com.bin.david.form.core.SmartTable;
+import com.bin.david.form.data.column.Column;
+import com.bin.david.form.data.table.TableData;
+import com.google.gson.reflect.TypeToken;
+import com.uas.jc_wms.R;
+import com.uas.jc_wms.activity.FunctionActivity;
+import com.uas.jc_wms.adapter.WHCheckMakeDetailListAdapter;
+import com.uas.jc_wms.adapter.WHCheckMakeMaterialListAdapter;
+import com.uas.jc_wms.bean.WHMakeMaterialDetail;
+import com.uas.jc_wms.bean.WHMakeMaterialProductNew;
+import com.uas.jc_wms.global.GloableParams;
+import com.uas.jc_wms.tools.DataSourceManager;
+import com.uas.jc_wms.tools.GsonUtil;
+import com.uas.jc_wms.tools.VolleyUtil;
+import com.uas.jc_wms.util.CameraUtil;
+import com.uas.jc_wms.util.CommonUtil;
+import com.uas.jc_wms.view.ClearableEditText;
+import com.uas.jc_wms.view.ConfirmDialog;
+import com.uuzuche.lib_zxing.activity.CaptureActivity;
+import com.uuzuche.lib_zxing.activity.CodeUtils;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.List;
+
+/**
+ * @note:物料库存核查Fragment
+ */
+public class NewWHCheckMakeMaterialFragment extends BaseFragment implements View.OnClickListener, DataSourceManager.NotifyData,
+//        AdapterView.OnItemClickListener,
+        VolleyUtil.VolleyFinishListener {
+    private static final int SCAN_BARCODE_CODE = 301;
+    ClearableEditText etProdcode, etWhcode,cet_item_number;
+    TextView tvPrDetail, tvPrSpec;
+    TextView btnSearch;
+    WHCheckMakeMaterialListAdapter adapter;
+    List<WHMakeMaterialProductNew> detailItemList;
+    int requestType = -1;
+    private ListView lvDetail;
+    private ImageView mScanImageView;
+    private int mFocusId;
+
+    private SmartTable mSmartTable;
+    private Column<String> mPR_CODE,mBAR_WHCODE,mBAR_LOCATION,mREMAIN,mMADEDATE,mPR_SPEC;
+//    private Column<Double> mMADEDATE;
+    private TableData mTableData;
+
+    @Override
+    protected int getLayout() {
+        return R.layout.fragment_whcheck_makematerial_new;
+    }
+
+    @Override
+    protected void initViews() {
+        ((FunctionActivity) mActivity).setScanIvVisible(true);
+        detailItemList = DataSourceManager.getDataSourceManager().getMakeMaterialCheckItemList2();
+        detailItemList.clear();
+        //接口回调
+        //VolleyUtil.setVolleyHandler(volleyHandler);
+        VolleyUtil.getVolleyUtil().setOnVolleyFinishListener(this);
+        DataSourceManager.getDataSourceManager().setNotifyData(this);
+        //获取组件
+        //->List
+        lvDetail = (ListView) root.findViewById(R.id.lv_detail_whmm);
+        Log.e("tableList", detailItemList.toString());
+        adapter = new WHCheckMakeMaterialListAdapter(detailItemList, getActivity());
+        lvDetail.setAdapter(adapter);
+        //->采集
+        etProdcode = (ClearableEditText) root.findViewById(R.id.et_prodcode_whmm);
+        etWhcode = (ClearableEditText) root.findViewById(R.id.et_whcode_whmm);
+        cet_item_number = (ClearableEditText) root.findViewById(R.id.cet_item_number);
+        btnSearch = (TextView) root.findViewById(R.id.btn_search_whmm);
+        //->信息显示
+        tvPrDetail = (TextView) root.findViewById(R.id.tv_pr_detail);
+        tvPrSpec = (TextView) root.findViewById(R.id.tv_pr_spec);
+
+        mScanImageView = (ImageView) mActivity.findViewById(R.id.btn_actionbar_scan_iv);
+        mSmartTable = root.findViewById(R.id.st_smart_table);
+
+        CommonUtil.getLeftDefaultTable(mActivity, mSmartTable);
+        //物料编号,规格,仓库,储位,数量,dc
+        mPR_CODE = new Column<String>("物料编号", "PR_CODE");
+        mBAR_WHCODE = new Column<String>("仓库", "BAR_WHCODE");
+        mBAR_LOCATION = new Column<String>("储位", "BAR_LOCATION");
+        mREMAIN = new Column<String>("数量", "REMAIN");
+        mMADEDATE = new Column<String>("dc", "MADEDATE");
+        mPR_SPEC = new Column<String>("规格", "PR_SPEC");
+    }
+
+    @Override
+    protected void initEvents() {
+        btnSearch.setOnClickListener(this);
+//        lvDetail.setOnItemClickListener(this);
+        etProdcode.setOnKeyListener(new View.OnKeyListener() {
+            @Override
+            public boolean onKey(View v, int keyCode, KeyEvent event) {
+                if (keyCode == KeyEvent.KEYCODE_ENTER && event.getAction() == KeyEvent.ACTION_UP) {
+                    disposeOnClickEnter();
+                    etWhcode.requestFocus();
+                    etWhcode.setSelection(etWhcode.getText().toString().length());
+                    return true;
+                }
+                return false;
+            }
+        });
+        etWhcode.setOnKeyListener(new View.OnKeyListener() {
+            @Override
+            public boolean onKey(View v, int keyCode, KeyEvent event) {
+                if (keyCode == KeyEvent.KEYCODE_ENTER && event.getAction() == KeyEvent.ACTION_UP) {
+                    disposeOnClickEnter();
+                    return true;
+                }
+                return false;
+            }
+        });
+
+        mScanImageView.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, getString(R.string.no_camera_detected));
+                }
+            }
+        });
+    }
+
+    @Override
+    protected void initDatas() {
+        editTextGetFocus(etProdcode);
+        //->Actionbar
+        ((TextView) (getActivity().findViewById(R.id.tv_actionbar_withback))).setText(R.string.title_makematerial_whmm);
+
+        setTableData(detailItemList);
+    }
+
+    private void setTableData(List<WHMakeMaterialProductNew> filterTableData) {
+        mTableData = new TableData<WHMakeMaterialProductNew>("出库单列表", filterTableData,
+                mPR_CODE, mBAR_WHCODE,mBAR_LOCATION, mREMAIN,mMADEDATE, mPR_SPEC);
+        mSmartTable.setTableData(mTableData);
+        mSmartTable.postDelayed(new Runnable() {
+            @Override
+            public void run() {
+                mSmartTable.postInvalidate();
+            }
+        }, 100);
+    }
+
+    @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.et_prodcode_whmm) {
+                    etProdcode.setText(result);
+                    etProdcode.setSelection(result.length());
+                } else if (mFocusId == R.id.et_whcode_whmm) {
+                    etWhcode.setText(result);
+                    etWhcode.setSelection(result.length());
+                }
+            }
+        }
+    }
+
+    //按钮点击事件
+    private void disposeOnClickEnter() {
+        String strProdcode = etProdcode.getText().toString().trim();
+        String strNumbssser = cet_item_number.getText().toString().trim();
+        String strWhcode = etWhcode.getText().toString().trim();
+//        if (strProdcode.equals("") || strProdcode == null) {
+//            etProdcode.setWarnIconVisible();
+//            return;
+//        }
+        //请求详细数据
+        showLoadingView();
+        requestType = VolleyUtil.FRAGMETN_WHCHECK_PRODUCT_CHECK;
+        VolleyUtil.getVolleyUtil().requestMakeMaterialCheck2(getActivity(), GloableParams.ADDRESS_WH_PRODUCT, VolleyUtil.METHOD_GET,
+                requestType, strProdcode,strNumbssser, strWhcode);
+    }
+
+    @Override
+    public void onDestroy() {
+        //清理数据
+        detailItemList.removeAll(detailItemList);
+        hideKeyboard(etProdcode);
+        VolleyUtil.distoryVolley();
+
+        ((FunctionActivity) mActivity).setScanIvVisible(false);
+        super.onDestroy();
+    }
+
+
+    /*=============================明细PopWin页面============================*/
+
+    /**
+     * @注释:明细popwin页面
+     */
+    PopupWindow detailPopwin;
+
+    private void showDetailPopwin(List dataList) {
+        if (dataList == null || dataList.size() == 0) {
+            showNotice("无明细数据");
+            return;
+        }
+        View contentView = View.inflate(getActivity(), R.layout.popwin_whcheck_detail, null);
+        //获取组件
+        //->List
+        ListView lvDetail = (ListView) contentView.findViewById(R.id.lv_detail);
+        WHCheckMakeDetailListAdapter adapter = new WHCheckMakeDetailListAdapter(getActivity(), dataList);
+        lvDetail.setAdapter(adapter);
+        TextView tv = (TextView) contentView.findViewById(R.id.tv_table_3);
+        //PopupWindow
+        detailPopwin = new PopupWindow(contentView, ActionBar.LayoutParams.MATCH_PARENT, ActionBar.LayoutParams.WRAP_CONTENT);
+        detailPopwin.setBackgroundDrawable(new BitmapDrawable());
+        detailPopwin.setFocusable(true);
+        detailPopwin.setOutsideTouchable(true);
+        View parentView = ((Activity) getActivity()).getWindow().findViewById(Window.ID_ANDROID_CONTENT);
+        //当pop菜单超出屏幕时,平移位置
+        detailPopwin.showAtLocation(parentView, Gravity.CENTER, 0, 0);
+    }
+
+    /*=============================公用方法===================================*/
+    /**
+     * @注释:显示错误提示
+     */
+    ConfirmDialog noticeDialog;
+
+    private void showNotice(String noticeMsg) {
+        noticeDialog = new ConfirmDialog(getActivity());
+        noticeDialog.show(noticeMsg, ConfirmDialog.NOTICE);
+
+        new AsyncTask<String, Void, Float>() {
+            @Override
+            protected Float doInBackground(String... params) {
+                try {
+                    //notice显示1.5s
+                    Thread.sleep(1000);
+                } catch (InterruptedException e) {
+                    e.printStackTrace();
+                }
+                return null;
+            }
+
+            @Override
+            protected void onPostExecute(Float aFloat) {
+                noticeDialog.dismiss();
+            }
+        }.execute();
+    }
+
+    /**
+     * 获取输入框焦点
+     */
+    private void editTextGetFocus(EditText editText) {
+        editText.setFocusable(true);
+        editText.setFocusableInTouchMode(true);
+        editText.setEnabled(true);
+        editText.setClickable(true);
+        editText.requestFocus();
+    }
+
+    /**
+     * 显示loadingView
+     */
+    private void showLoadingView() {
+        if (!progressDialog.isShowing()) {
+            progressDialog.show();
+        }
+    }
+
+    //隐藏键盘
+    InputMethodManager inputManager;
+
+    private void hideKeyboard(final EditText view) {
+        inputManager = (InputMethodManager) view.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
+        //获取键盘管理对象
+        inputManager.hideSoftInputFromWindow(view.getWindowToken(), 0);
+    }
+
+    String TAG = "WHCheck:";
+
+    /*=============================数据源发生变化===================================*/
+    @Override
+    public void NotifyDataChanged(int noticeType) {
+        //修改信息显示区域的信息
+        String strDetail = detailItemList.get(0).getPR_DETAIL();
+        String strSpec = detailItemList.get(0).getPR_SPEC();
+
+        //信息区域显示
+        tvPrDetail.setText("" + strDetail);
+        tvPrSpec.setText("" + strSpec);
+
+        //table数据源修改
+        adapter.notifyDataSetChanged();
+        //修改为新的列表
+        setTableData(detailItemList);
+    }
+
+    /*=========================监听事件===================================*/
+//    @Override
+//    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+//        //获取点击行所对应的detail对象
+//        WHMakeMaterialProductNew tmpProd = detailItemList.get(position);
+//        String strPrcode = tmpProd.getBAR_PRODCODE().trim();
+//        String strWhcode = tmpProd.getBAR_WHCODE().trim();
+//        String strLocation = tmpProd.getBAR_LOCATION();
+//        String bar_madedate = tmpProd.getBAR_MADEDATE();
+//
+//        if (strLocation == null || strLocation.equals("null") || strLocation.equals("")) {
+//            strLocation = "null";
+//        }
+//        //请求服务器获取明细
+//        JSONObject paramJson = new JSONObject();
+//        try {
+//            paramJson.put("pr_code", strPrcode);
+//            paramJson.put("wh_code", strWhcode);
+//            paramJson.put("bar_location", strLocation);
+//            paramJson.put("bar_madedate", bar_madedate);
+//
+//        } catch (JSONException e) {
+//            e.printStackTrace();
+//        }
+//        Log.e("WHCheck", "!!!" + paramJson.toString());
+//        requestType = VolleyUtil.FRAGMETN_WHCHECK_PRODUCT_DETAIL;
+//        VolleyUtil.getVolleyUtil().requestMakeMaterialDetail(getActivity(), GloableParams.ADDRESS_WH_DETAIL, VolleyUtil.METHOD_GET,
+//                requestType, strPrcode, strWhcode, strLocation);
+//    }
+
+    @Override
+    public void onClick(View v) {
+        disposeOnClickEnter();
+    }
+
+    @Override
+    public void onVolleyFinish(int isSuccess, Object result) {
+        switch (isSuccess) {
+            case VolleyUtil.SUCCESS_SUCCESS:
+                disposeVolleySuccess(result);
+                break;
+            case VolleyUtil.FAILED_FAILED:
+                disposeVolleyFailed(result);
+                break;
+        }
+        progressDialog.dismiss();
+    }
+
+    //Volley失败
+    private void disposeVolleyFailed(Object result) {
+        showNotice(result.toString());
+    }
+
+    //Volley成功
+    private void disposeVolleySuccess(Object result) {
+        String str = (String) result;
+        switch (requestType) {
+            //物料库存核查:Check数据
+            case VolleyUtil.FRAGMETN_WHCHECK_PRODUCT_CHECK:
+                break;
+            //物料库存核查:明细数据
+            case VolleyUtil.FRAGMETN_WHCHECK_PRODUCT_DETAIL:
+                Log.e("WHCHECK:make", "" + result.toString());
+                //显示明细数据弹框
+                //disposeVolleyDetail(result);
+                showDetailPopwin(disposeVolleyDetail(result));
+                break;
+        }
+    }
+
+    //Volley明细数据->list
+    private List disposeVolleyDetail(Object result) {
+        List<WHMakeMaterialDetail> list = null;
+        String strResult = (String) result;
+        try {
+            JSONObject resultJson = new JSONObject(strResult);
+            JSONArray targetJsonArray = resultJson.getJSONArray("target");
+            list = GsonUtil.changeGsonToList(targetJsonArray.toString(),
+                    new TypeToken<List<WHMakeMaterialDetail>>() {
+                    }.getType());
+            Log.e(TAG, "detaillist:" + list.toString());
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+        return list;
+    }
+
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
+            if (progressDialog != null && progressDialog.isShowing()) {
+//                loadingView.dismiss();
+//                VolleyUtil.distoryVolley();
+                return true;
+            }
+            if (detailPopwin != null && detailPopwin.isShowing()) {
+                detailPopwin.dismiss();
+                return true;
+            }
+            if (noticeDialog != null && noticeDialog.isShowing()) {
+                noticeDialog.dismiss();
+                return true;
+            }
+        }
+        return false;
+    }
+
+    @Override
+    public boolean onFragmentBackPressed() {
+        return false;
+    }
+}

+ 3 - 12
app/src/main/java/com/uas/jc_wms/fragment/OutAddList_fragment.java

@@ -76,14 +76,12 @@ public class OutAddList_fragment extends BaseFragment implements OnColumnItemCli
 
     @Override
     protected void initViews() {
-        FunctionActivity.setTitle(getString(R.string.outboundlist));
+        FunctionActivity.setTitle(getString(R.string.List_of_outbound_orders));
         ((FunctionActivity) getActivity()).setListIconIvVisible(false);
         storage_recharge_collect_et = mActivity.findViewById(R.id.storage_recharge_collect_et);
         mRefreshLayout = mActivity.findViewById(R.id.pda_wms_in_filter_list_srl);
         mSmartTable = mActivity.findViewById(R.id.jlt_storage_in_filter_list_st);
         mScanImageView = (ImageView) mActivity.findViewById(R.id.storage_recharge_scan_iv);
-
-
     }
 
     @Override
@@ -265,12 +263,8 @@ public class OutAddList_fragment extends BaseFragment implements OnColumnItemCli
                 mSmartTable.postInvalidate();
             }
         }, 100);
-
     }
 
-
-
-
     @Override
     public boolean onKeyDown(int keyCode, KeyEvent event) {
         return false;
@@ -286,8 +280,7 @@ public class OutAddList_fragment extends BaseFragment implements OnColumnItemCli
         if (hidden) {
             ((FunctionActivity) getActivity()).setMoreBtnVisible(false);
         } else {
-            FunctionActivity.setTitle(getString(R.string.outboundlist));
-
+            FunctionActivity.setTitle(getString(R.string.List_of_outbound_orders));
         }
     }
 
@@ -306,10 +299,9 @@ public class OutAddList_fragment extends BaseFragment implements OnColumnItemCli
         super.onDestroyView();
         ((FunctionActivity) getActivity()).setMoreBtnVisible(false);
         CommonUtil.closeKeybord(storage_recharge_collect_et, mActivity);
-        ((TextView) (getActivity().findViewById(R.id.tv_actionbar_withback))).setText(getString(R.string.outboundlist));
+        ((TextView) (getActivity().findViewById(R.id.tv_actionbar_withback))).setText(getString(R.string.List_of_outbound_orders));
     }
 
-
     @Override
     public void onClick(View v) {
         switch (v.getId()) {
@@ -343,7 +335,6 @@ public class OutAddList_fragment extends BaseFragment implements OnColumnItemCli
                 if (mFocusId == R.id.storage_recharge_collect_et) {
                     storage_recharge_collect_et.setText(result);
                     storage_recharge_collect_et.setSelection(result.length());
-
                     getDatalistCodes(result);
                 }
             }

+ 3 - 5
app/src/main/java/com/uas/jc_wms/fragment/OutboundLis_Two_fragment.java

@@ -81,7 +81,7 @@ public class OutboundLis_Two_fragment extends BaseFragment implements OnColumnIt
 
     @Override
     protected void initViews() {
-        FunctionActivity.setTitle(getString(R.string.outboundlist));
+        FunctionActivity.setTitle(getString(R.string.List_of_outbound_orders));
 //        ((FunctionActivity) getActivity()).setMoreBtnVisible(true);
         ((FunctionActivity) getActivity()).setListIconIvVisible(false);
         storage_recharge_collect_et = mActivity.findViewById(R.id.storage_recharge_collect_et);
@@ -138,8 +138,6 @@ public class OutboundLis_Two_fragment extends BaseFragment implements OnColumnIt
                     }
                 });
 
-
-
         va_classColumn = new Column<String>("单号", "PI_INOUTNO");
         va_classColumn.setFixed(true);
         va_codeColumn = new Column<String>("单据类型", "PI_CLASS");
@@ -354,7 +352,7 @@ public class OutboundLis_Two_fragment extends BaseFragment implements OnColumnIt
             ((FunctionActivity) getActivity()).setMoreBtnVisible(false);
             ((FunctionActivity) getActivity()).setListIconIvVisible(false);
         } else {
-            FunctionActivity.setTitle(getString(R.string.outboundlist));
+            FunctionActivity.setTitle(getString(R.string.List_of_outbound_orders));
 //            ((FunctionActivity) getActivity()).setMoreBtnVisible(true);
             ((FunctionActivity) getActivity()).setListIconIvVisible(false);
             pop_material_out_resolution.setVisibility(View.GONE);
@@ -379,7 +377,7 @@ public class OutboundLis_Two_fragment extends BaseFragment implements OnColumnIt
         ((FunctionActivity) getActivity()).setMoreBtnVisible(false);
         ((FunctionActivity) getActivity()).setListIconIvVisible(false);
         CommonUtil.closeKeybord(storage_recharge_collect_et, mActivity);
-        ((TextView) (getActivity().findViewById(R.id.tv_actionbar_withback))).setText(getString(R.string.outboundlist));
+        ((TextView) (getActivity().findViewById(R.id.tv_actionbar_withback))).setText(getString(R.string.List_of_outbound_orders));
     }
 
 

+ 476 - 32
app/src/main/java/com/uas/jc_wms/fragment/OutboundListAdd_Fragment.java

@@ -7,7 +7,11 @@ import android.content.Intent;
 import android.graphics.Color;
 import android.graphics.drawable.BitmapDrawable;
 import android.os.Bundle;
+import android.support.annotation.Nullable;
 import android.support.v4.content.ContextCompat;
+import android.support.v7.widget.DividerItemDecoration;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
 import android.text.TextUtils;
 import android.view.Gravity;
 import android.view.KeyEvent;
@@ -29,6 +33,7 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.android.volley.Request;
+import com.android.volley.toolbox.StringRequest;
 import com.bin.david.form.core.SmartTable;
 import com.bin.david.form.core.TableConfig;
 import com.bin.david.form.data.CellInfo;
@@ -37,6 +42,8 @@ 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.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
 import com.uas.jc_wms.R;
 import com.uas.jc_wms.activity.FunctionActivity;
 import com.uas.jc_wms.bean.OutBoundListAddDalieBean;
@@ -49,8 +56,10 @@ import com.uas.jc_wms.util.Constants;
 import com.uas.jc_wms.util.FastjsonUtil;
 import com.uas.jc_wms.util.HttpCallback;
 import com.uas.jc_wms.util.HttpParams;
+import com.uas.jc_wms.util.LogUtil;
 import com.uas.jc_wms.util.StringUtil;
 import com.uas.jc_wms.util.VolleyRequest;
+import com.uas.jc_wms.util.VollyRequest;
 import com.uas.jc_wms.view.ClearableEditText;
 import com.uuzuche.lib_zxing.activity.CaptureActivity;
 import com.uuzuche.lib_zxing.activity.CodeUtils;
@@ -79,6 +88,7 @@ public class OutboundListAdd_Fragment extends BaseFragment implements OnColumnIt
     private CheckBox add_checkbos;
     private Button jlt_storage_in_generate_detailed_btn;
     private CheckBox ck_special_outbound;
+    private Button bt_guozhang;
 
     private ClearableEditText edit_et;
     private PopupWindow editPW;
@@ -95,6 +105,18 @@ public class OutboundListAdd_Fragment extends BaseFragment implements OnColumnIt
     private ImageView mMoreButton;
     private View mMenuView;
     private String pi_inoutno;
+    private ClearableEditText cet_pull_out;
+    private ClearableEditText cet_dial_in;
+    private ClearableEditText edit_pop_et;
+    private ImageView iv_pull_out,iv_dial_in;
+    private StringRequest mStringRequest;
+    private ArrayList<ComDataBean> ComDataBeanList;
+    private RecyclerView rv_line_ip_port_data;
+    private IpAndResourcesPortAdapter ipAndResourcesPortAdapter;
+    private String bochu_name, bochu_code;
+    private String boru_name, boru_code;
+    private String pi_id;
+
 
     @Override
     protected int getLayout() {
@@ -113,6 +135,11 @@ public class OutboundListAdd_Fragment extends BaseFragment implements OnColumnIt
         add_checkbos = mActivity.findViewById(R.id.add_checkbos);
         jlt_storage_in_generate_detailed_btn = mActivity.findViewById(R.id.jlt_storage_in_generate_detailed_btn);
         ck_special_outbound = mActivity.findViewById(R.id.ck_special_outbound);
+        bt_guozhang = mActivity.findViewById(R.id.bt_guozhang);
+        cet_pull_out = (ClearableEditText) mActivity.findViewById(R.id.cet_pull_out);
+        cet_dial_in = (ClearableEditText) mActivity.findViewById(R.id.cet_dial_in);
+        iv_pull_out = (ImageView) mActivity.findViewById(R.id.iv_pull_out);
+        iv_dial_in = (ImageView) mActivity.findViewById(R.id.iv_dial_in);
 
         imm = (InputMethodManager) mActivity.getSystemService(Context.INPUT_METHOD_SERVICE);
     }
@@ -123,11 +150,14 @@ public class OutboundListAdd_Fragment extends BaseFragment implements OnColumnIt
         if (arguments != null) {
             pi_inoutno = arguments.getString("pi_inoutno");
         }
+        pi_inoutno = "500102000048";
         if (!TextUtils.isEmpty(pi_inoutno)) {
             tv_documents_code.setText(pi_inoutno);
             getDataCommitList();
+        }else {
+            bt_guozhang.setEnabled(false);
         }
-
+        ComDataBeanList = new ArrayList<>();
 
         SharedPreUtil.removeString(mActivity,Constants.STORAGEERECHADD);
         storage_recharge_scan_ivs.setOnClickListener(this);
@@ -140,6 +170,16 @@ public class OutboundListAdd_Fragment extends BaseFragment implements OnColumnIt
                 if (actionId == EditorInfo.IME_ACTION_DONE
                         || actionId == EditorInfo.IME_ACTION_SEND
                         || (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
+                    if (TextUtils.isEmpty(bochu_code)) {
+                        CommonUtil.toastNoRepeat(mActivity, "拨出仓不能为空");
+                        storage_recharge_collect_ets.setText("");
+                        return true;
+                    }
+                    if (TextUtils.isEmpty(boru_code)) {
+                        storage_recharge_collect_ets.setText("");
+                        CommonUtil.toastNoRepeat(mActivity, "拨入仓不能为空");
+                        return true;
+                    }
                     String data = storage_recharge_collect_ets.getText().toString().trim();
                     storage_recharge_collect_ets.selectAll();
                     storage_recharge_collect_ets.requestFocus();
@@ -167,6 +207,26 @@ public class OutboundListAdd_Fragment extends BaseFragment implements OnColumnIt
                 }
             }
         });
+        bt_guozhang.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                getGuoZhang();
+            }
+        });
+
+        iv_pull_out.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                getRepairStep("","BoChuDan");
+            }
+        });
+
+        iv_dial_in.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                getRepairStep("","BoRuDan");
+            }
+        });
 
         mFilterStorageInBeans = Collections.synchronizedList(new ArrayList<>());
         va_detnoColumn = new Column<String>("出库数量", "BI_OUTQTY");
@@ -175,6 +235,37 @@ public class OutboundListAdd_Fragment extends BaseFragment implements OnColumnIt
         va_pucodeCoulmn = new Column<String>("物料名称", "PR_DETAIL");
 ;
     }
+
+    private void getGuoZhang() {
+        if (TextUtils.isEmpty(pi_id)) {
+            CommonUtil.toastNoRepeat(mActivity, "缺少piid号");
+            return;
+        }
+        progressDialog.show();
+        VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
+                .url(GloableParams.ADDRESS_INMATERIAL_CONFIRMPOST)
+                .method(Request.Method.POST)
+                .addParam("piid", pi_id)
+                .tag(TAG + "piid")
+                .flag(0)
+                .build(), new HttpCallback() {
+            @Override
+            public void onSuccess(int flag, Object o) throws Exception {
+                progressDialog.dismiss();
+                CommonUtil.toastNoRepeat(mActivity, "过账成功");
+            }
+
+            @Override
+            public void onFail(int flag, String failStr) throws Exception {
+                progressDialog.dismiss();
+                CommonUtil.toastNoRepeat(mActivity, failStr);
+            }
+        });
+        storage_recharge_collect_ets.selectAll();
+        storage_recharge_collect_ets.requestFocus();
+        imm.showSoftInput(storage_recharge_collect_ets, InputMethodManager.RESULT_HIDDEN);
+    }
+
     @Override
     protected void initDatas() {
         WindowManager wm = mActivity.getWindowManager();
@@ -193,17 +284,12 @@ public class OutboundListAdd_Fragment extends BaseFragment implements OnColumnIt
                 .setContentCellBackgroundFormat(new BaseCellBackgroundFormat<CellInfo>() {
                     @Override
                     public int getBackGroundColor(CellInfo cellInfo) {
-
                         if (cellInfo.row  == 0) {
                             return ContextCompat.getColor(mActivity, R.color.text_blue);
-
                         }
                         return TableConfig.INVALID_COLOR;
                     }
                 });
-
-
-
     }
 
     @Override
@@ -245,6 +331,8 @@ public class OutboundListAdd_Fragment extends BaseFragment implements OnColumnIt
                 .addParam("inoutno", tv_documents_code.getText().toString().trim())
                 .addParam("ifspecial",ifspecial)//是否勾选了特殊出库
                 .addParam("ifcancel",ifcancel)//是否勾选了取消采集
+                .addParam("outwhcode",bochu_code)
+                .addParam("inwhcode",boru_code)
                 .build(), new HttpCallback() {
             @Override
             public void onSuccess(int flag, Object o) throws Exception {
@@ -254,9 +342,13 @@ public class OutboundListAdd_Fragment extends BaseFragment implements OnColumnIt
                 JSONObject dataObject = resultObject.getJSONObject("data");
                 if (dataObject != null) {
                     bar_remain = FastjsonUtil.getText(dataObject, "pi_inoutno");
+                    pi_id = FastjsonUtil.getText(dataObject, "pi_id");
 //                    if (!add_checkbos.isChecked()){
 //                        initEditPopupWindow();
 //                    }
+                    if (!TextUtils.isEmpty(pi_id)) {
+                        bt_guozhang.setEnabled(true);
+                    }
 
                     if (!tv_documents_code.getText().toString().trim().isEmpty()){
                         getDataCommitList();
@@ -268,18 +360,16 @@ public class OutboundListAdd_Fragment extends BaseFragment implements OnColumnIt
                     }else {
                         tv_documents_code.setText(bar_remain);
                     }
-
                 }
-
             }
 
             @Override
             public void onFail(int flag, String failStr) throws Exception {
                 progressDialog.dismiss();
                 CommonUtil.toastNoRepeat(mActivity, failStr);
-
             }
         });
+
         storage_recharge_collect_ets.selectAll();
         storage_recharge_collect_ets.requestFocus();
         imm.showSoftInput(storage_recharge_collect_ets, InputMethodManager.RESULT_HIDDEN);
@@ -288,7 +378,6 @@ public class OutboundListAdd_Fragment extends BaseFragment implements OnColumnIt
     /**
      * 弹框保存按钮
      */
-
     //弹窗
     private void initEditPopupWindow() {
         View contView = LayoutInflater.from(mActivity).inflate(R.layout.index_edit_pup, null);
@@ -333,21 +422,18 @@ public class OutboundListAdd_Fragment extends BaseFragment implements OnColumnIt
                 closeListPopupWindow();
             }
         });
-
-
     }
+
     private void closeListPopupWindow() {
         if (editPW != null) {
             editPW.dismiss();
             editPW = null;
             CommonUtil.setBackgroundAlpha(mActivity, 1f);
         }
-
     }
 
     private void getDialogDatalistCodes(String data,String number) {
         String pd_pdnoid = SharedPreUtil.getString(mActivity, "positionid", null);
-
             if (!StringUtil.isEmpty(pd_pdnoid)){
                 integer = Integer.valueOf(pd_pdnoid);
                 String pd_barcodeqty = mFilterStorageInBeans.get(integer).getPD_BARCODEQTY();//条码数量
@@ -377,9 +463,9 @@ public class OutboundListAdd_Fragment extends BaseFragment implements OnColumnIt
                     baoucn(data,number);
                 }
              }
-
             }
     }
+
     //保存
     public void baoucn(String data,String number){
         String positionid = SharedPreUtil.getString(mActivity, "pd_pdnoid", null);
@@ -429,7 +515,6 @@ public class OutboundListAdd_Fragment extends BaseFragment implements OnColumnIt
                 }else {
                     CommonUtil.toastNoRepeat(mActivity,"采集成功");
                 }
-
             }
 
             @Override
@@ -441,7 +526,6 @@ public class OutboundListAdd_Fragment extends BaseFragment implements OnColumnIt
         });
     }
 
-
     public void dialosDatas(String data,String number,Double v,Double pd_outqtyDouble){
         new AlertDialog.Builder(getActivity()).setTitle("提示").setMessage("本次条码数量:"+v+"大于出库数量:"+pd_outqtyDouble)
                 .setPositiveButton(getString(R.string.confirm), new DialogInterface.OnClickListener() {
@@ -455,6 +539,15 @@ public class OutboundListAdd_Fragment extends BaseFragment implements OnColumnIt
     //生成明细数据
     private void getDataadCommitList(){
         if (tv_documents_code.getText().toString().isEmpty()){
+            CommonUtil.toastNoRepeat(mActivity, "没有单据编号");
+            return;
+        }
+        if (cet_pull_out.getText().toString().isEmpty()){
+            CommonUtil.toastNoRepeat(mActivity, "请输出拨出仓");
+            return;
+        }
+        if (cet_dial_in.getText().toString().isEmpty()){
+            CommonUtil.toastNoRepeat(mActivity, "请输出拨入仓");
             return;
         }
         progressDialog.show();
@@ -464,6 +557,8 @@ public class OutboundListAdd_Fragment extends BaseFragment implements OnColumnIt
                 .tag(TAG + "datalist")
                 .flag(0)
                 .addParam("inoutno",tv_documents_code.getText().toString().trim())
+//                .addParam("outwhcode",bochu_code)       //拨出仓
+//                .addParam("inwhcode",boru_code)     //拨入仓
                 .build(), new HttpCallback() {
             @Override
             public void onSuccess(int flag, Object o) throws Exception {
@@ -479,6 +574,40 @@ public class OutboundListAdd_Fragment extends BaseFragment implements OnColumnIt
         });
     }
 
+    //拨出仓和拔入仓
+    private void getRepairStep(String trim,String source) {
+        progressDialog.show();
+        VollyRequest.getInstance().stringRequest(mStringRequest,
+                new HttpParams.Builder()
+                        .url(GloableParams.ADDRESS_PDAIO_IN_GETWHCODE)
+                        .method(Request.Method.GET)
+                        .tag(TAG + "getMaCode")
+                        .addParam("condition",trim)
+                        .addParam("piclass","拨出单")
+                        .addParam("pi_type","")
+                        .flag(0)
+                        .build(), new HttpCallback() {
+                    @Override
+                    public void onSuccess(int flag, Object o) throws Exception {
+                        progressDialog.dismiss();
+                        Boolean isSuccess = FastjsonUtil.getBoolean(o.toString(),"success");
+                        JSONObject data = FastjsonUtil.getJSONObject(o.toString(), "data");
+                        JSONArray dataArray = FastjsonUtil.getJSONArray(data.toString(), "whcode");
+                        if (isSuccess){
+                            if (dataArray == null){
+                                CommonUtil.toastNoRepeat(mActivity,"未搜索到匹配数据");
+                            }else {
+                                handleFeededlineData(dataArray,trim,source);
+                            }
+                        }
+                    }
+                    @Override
+                    public void onFail(int flag, String failStr) throws Exception {
+                        progressDialog.dismiss();
+                        CommonUtil.toastNoRepeat(mActivity, failStr);
+                    }
+                });
+    }
 
     //展示明细数据
     private void getDataCommitList(){
@@ -498,13 +627,13 @@ public class OutboundListAdd_Fragment extends BaseFragment implements OnColumnIt
                 .addParam("inoutno",tv_documents_code.getText().toString().trim())
                 .build(), new HttpCallback() {
 
-
             @Override
             public void onSuccess(int flag, Object o) throws Exception {
                 progressDialog.dismiss();
                 try {
                     mFilterStorageInBeans.clear();
                     String result = o.toString();
+//                    String result = "{\"success\":true,\"data\":[{\"PI_ID\":50975358,\"PI_PURPOSE\":\"INV-2F-001\",\"PI_PURPOSENAME\":\"二楼仓库\",\"PI_WHCODE\":\"INV-WX-002\",\"PI_WHNAME\":\"华天委外仓\",\"BI_PIID\":50975358,\"BI_OUTQTY\":1000,\"BI_PRODCODE\":\"510703000325\",\"PR_DETAIL\":\"精密电阻\"},{\"PI_ID\":50975358,\"PI_PURPOSE\":\"INV-2F-001\",\"PI_PURPOSENAME\":\"二楼仓库\",\"PI_WHCODE\":\"INV-WX-002\",\"PI_WHNAME\":\"华天委外仓\",\"BI_PIID\":50975358,\"BI_OUTQTY\":3760,\"BI_PRODCODE\":\"510703000261\",\"PR_DETAIL\":\"精密电阻\"}]}";
                     JSONObject resultObject = JSON.parseObject(result);
                     JSONArray dataArray = resultObject.getJSONArray("data");
                     List<OutBoundListAddDalieBean> list = new ArrayList<>();
@@ -517,15 +646,31 @@ public class OutboundListAdd_Fragment extends BaseFragment implements OnColumnIt
                                 jltStorageInBean.setBI_OUTQTY(FastjsonUtil.getText(dataObject, "BI_OUTQTY"));
                                 jltStorageInBean.setBI_PRODCODE(FastjsonUtil.getText(dataObject, "BI_PRODCODE"));
                                 jltStorageInBean.setPR_DETAIL(FastjsonUtil.getText(dataObject, "PR_DETAIL"));
+                                jltStorageInBean.setPI_PURPOSE(FastjsonUtil.getText(dataObject, "PI_PURPOSE"));
+                                jltStorageInBean.setPI_PURPOSENAME(FastjsonUtil.getText(dataObject, "PI_PURPOSENAME"));
+                                jltStorageInBean.setPI_WHCODE(FastjsonUtil.getText(dataObject, "PI_WHCODE"));
+                                jltStorageInBean.setPI_WHNAME(FastjsonUtil.getText(dataObject, "PI_WHNAME"));
+                                jltStorageInBean.setPI_ID(FastjsonUtil.getText(dataObject, "PI_ID"));
                                 list.add(jltStorageInBean);
                             }
                         }
-
                     }
-//                    mFilterStorageInBeans = list;
-
                     mFilterStorageInBeans = list;//PI_INOUTNO
                     setFilterTableData(mFilterStorageInBeans);
+
+                    if (mFilterStorageInBeans.size() > 0) {
+                        bochu_name = mFilterStorageInBeans.get(0).getPI_WHNAME();
+                        bochu_code = mFilterStorageInBeans.get(0).getPI_WHCODE();
+
+                        boru_name = mFilterStorageInBeans.get(0).getPI_PURPOSENAME();
+                        boru_code = mFilterStorageInBeans.get(0).getPI_PURPOSE();
+
+                        cet_pull_out.setText(bochu_code + "(" +bochu_name+ ")");
+                        cet_dial_in.setText(boru_code + "(" +boru_name+ ")");
+
+                        pi_id = mFilterStorageInBeans.get(0).getPI_ID();
+                    }
+
                     progressDialog.dismiss();
                 } catch (Exception e) {
                     e.printStackTrace();
@@ -543,6 +688,255 @@ public class OutboundListAdd_Fragment extends BaseFragment implements OnColumnIt
         progressDialog.dismiss();
     }
 
+    private void handleFeededlineData(JSONArray dataArray,String trim,String source) {
+        ComDataBean bean;
+        ComDataBeanList.clear();
+        for (Object index : dataArray) {
+            JSONObject data = (JSONObject) index;
+            bean= new ComDataBean();
+            bean.setItemName(data.getString("WH_DESCRIPTION"));
+            bean.setItemremark(data.getString("WH_CODE"));
+            ComDataBeanList.add(bean);
+        }
+        initresourcesPopupWindow(source);
+    }
+
+    private void initresourcesPopupWindow(String source) {
+        View contView = LayoutInflater.from(mActivity).inflate(R.layout.index_recycle_item, null);
+        edit_pop_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);
+        LinearLayout line_top = contView.findViewById(R.id.line_top);
+        rv_line_ip_port_data = contView.findViewById(R.id.rv_ip_port_data);
+        rv_line_ip_port_data.addItemDecoration(new DividerItemDecoration(mActivity, LinearLayout.VERTICAL));
+        rv_line_ip_port_data.setLayoutManager(new LinearLayoutManager(mActivity));
+        ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(ComDataBeanList);
+        ipAndResourcesPortAdapter.setmList(ComDataBeanList);
+        rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
+        setlineAdapter(ComDataBeanList);
+        //        edit_pop_et.setText(ct_qty.getText().toString().trim());
+
+        edit_pop_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() {
+                closeCodeListPopupWindow();
+            }
+        });
+        View parentView = mActivity.getWindow().findViewById(Window.ID_ANDROID_CONTENT);
+        editPW.showAtLocation(parentView, Gravity.CENTER, 0, 0);
+        CommonUtil.setBackgroundAlpha(mActivity, 0.5f);
+        edit_pop_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_pop_et.getText().toString().trim();
+                    if (!mSearchStr.isEmpty()) {
+                        List<ComDataBean> thisList = new ArrayList<>();
+                        for(int i=0;i<ComDataBeanList.size();i++){
+                            if(ComDataBeanList.get(i).getItemremark().contains(mSearchStr)||ComDataBeanList.get(i).getItemName().contains(mSearchStr)){
+                                thisList.add(ComDataBeanList.get(i));
+                            }
+                            if(i == ComDataBeanList.size() -1){
+                                ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(thisList);
+                                rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
+                                LogUtil.i("mSearchStr", JSON.toJSONString(thisList));
+
+                            }
+                            List<ComDataBean> lineCodeEntities = ipAndResourcesPortAdapter.getmList();
+                            for (int j = 0; j < lineCodeEntities.size(); j++) {
+                                lineCodeEntities.get(j).setChecked(false);
+                            }
+                            ipAndResourcesPortAdapter.notifyDataSetChanged();
+                        }
+                    } else {
+                        ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(ComDataBeanList);
+                        rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
+                        List<ComDataBean> lineCodeEntities = ipAndResourcesPortAdapter.getmList();
+                        for (int i = 0; i < lineCodeEntities.size(); i++) {
+                            lineCodeEntities.get(i).setChecked(false);
+                        }
+                        ipAndResourcesPortAdapter.notifyDataSetChanged();
+                    }
+                    ipAndResourcesPortAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
+
+                        @Override
+                        public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
+                            List<ComDataBean> ipAndPortBeans = ipAndResourcesPortAdapter.getmList();
+                            if (source.equals("BoChuDan")) {
+                                bochu_name = ipAndPortBeans.get(position).getItemName();
+                                bochu_code = ipAndPortBeans.get(position).getItemremark();
+                            }else  if (source.equals("BoRuDan")) {
+                                boru_name = ipAndPortBeans.get(position).getItemName();
+                                boru_code = ipAndPortBeans.get(position).getItemremark();
+                            }else {
+                                bochu_name = ipAndPortBeans.get(position).getItemName();
+                                bochu_code = ipAndPortBeans.get(position).getItemremark();
+                            }
+                            for (int i = 0; i < ipAndPortBeans.size(); i++) {
+                                ipAndPortBeans.get(i).setChecked(false);
+                            }
+                            ipAndPortBeans.get(position).setChecked(true);
+                            ipAndResourcesPortAdapter.notifyDataSetChanged();
+                        }
+                    });
+                    return true;
+                }
+                return false;
+            }
+        });
+
+        search_im.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                String mSearchStr = edit_pop_et.getText().toString().trim();
+                if (!mSearchStr.isEmpty()) {
+                    List<ComDataBean> thisList = new ArrayList<>();
+                    for(int i=0;i<ComDataBeanList.size();i++){
+                        if(ComDataBeanList.get(i).getItemremark().contains(mSearchStr)||ComDataBeanList.get(i).getItemName().contains(mSearchStr)){
+                            thisList.add(ComDataBeanList.get(i));
+                        }
+                        if(i == ComDataBeanList.size() -1){
+                            ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(thisList);
+                            rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
+                            LogUtil.i("mSearchStr", JSON.toJSONString(thisList));
+
+                        }
+                        List<ComDataBean> lineCodeEntities = ipAndResourcesPortAdapter.getmList();
+                        for (int j = 0; j < lineCodeEntities.size(); j++) {
+                            lineCodeEntities.get(j).setChecked(false);
+                        }
+                        ipAndResourcesPortAdapter.notifyDataSetChanged();
+                    }
+
+
+                } else {
+                    ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(ComDataBeanList);
+                    rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
+                    List<ComDataBean> lineCodeEntities = ipAndResourcesPortAdapter.getmList();
+                    for (int i = 0; i < lineCodeEntities.size(); i++) {
+                        lineCodeEntities.get(i).setChecked(false);
+                    }
+                    ipAndResourcesPortAdapter.notifyDataSetChanged();
+
+                }
+                //                getRepairStep(mSearchStr);
+                ipAndResourcesPortAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
+                    @Override
+                    public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
+                        List<ComDataBean> ipAndPortBeans = ipAndResourcesPortAdapter.getmList();
+                        if (source.equals("BoChuDan")) {
+                            bochu_name = ipAndPortBeans.get(position).getItemName();
+                            bochu_code = ipAndPortBeans.get(position).getItemremark();
+                        }else  if (source.equals("BoRuDan")) {
+                            boru_name = ipAndPortBeans.get(position).getItemName();
+                            boru_code = ipAndPortBeans.get(position).getItemremark();
+                        }else {
+                            bochu_name = ipAndPortBeans.get(position).getItemName();
+                            bochu_code = ipAndPortBeans.get(position).getItemremark();
+                        }
+
+                        for (int i = 0; i < ipAndPortBeans.size(); i++) {
+                            ipAndPortBeans.get(i).setChecked(false);
+                        }
+                        ipAndPortBeans.get(position).setChecked(true);
+                        ipAndResourcesPortAdapter.notifyDataSetChanged();
+                    }
+                });
+            }
+        });
+
+        List<String> list=new ArrayList<>();
+        //确定
+        sure_tv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                list.clear();
+                if (StringUtil.isEmpty(bochu_code)){
+                    CommonUtil.toastNoRepeat(mActivity,"请选择工序");
+                    return;
+                }
+                if (source.equals("BoChuDan")) {
+                    cet_pull_out.setText(bochu_code + "(" +bochu_name+ ")");
+                    cet_pull_out.requestFocus();
+                    cet_pull_out.setSelection(cet_pull_out.getText().length());
+                }else  if (source.equals("BoRuDan")) {
+                    cet_dial_in.setText(boru_code + "(" +boru_name+ ")");
+                    cet_dial_in.requestFocus();
+                    cet_dial_in.setSelection(cet_dial_in.getText().length());
+                }else {
+                    cet_pull_out.setText(bochu_code + "(" +bochu_name+ ")");
+                    cet_pull_out.requestFocus();
+                    cet_pull_out.setSelection(cet_pull_out.getText().length());
+                }
+                closeCodeListPopupWindow();
+            }
+        });
+
+        //取消
+        cancle_tv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                closeCodeListPopupWindow();
+            }
+        });
+
+        String mSearchStr = edit_pop_et.getText().toString().trim();
+        if (mSearchStr.isEmpty()) {
+            ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(ComDataBeanList);
+            rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
+            List<ComDataBean> lineCodeEntities = ipAndResourcesPortAdapter.getmList();
+            for (int i = 0; i < lineCodeEntities.size(); i++) {
+                lineCodeEntities.get(i).setChecked(false);
+            }
+            ipAndResourcesPortAdapter.notifyDataSetChanged();
+
+            ipAndResourcesPortAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
+                @Override
+                public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
+                    List<ComDataBean> ipAndPortBeans = ipAndResourcesPortAdapter.getmList();
+                    if (source.equals("BoChuDan")) {
+                        bochu_name = ipAndPortBeans.get(position).getItemName();
+                        bochu_code = ipAndPortBeans.get(position).getItemremark();
+                    }else  if (source.equals("BoRuDan")) {
+                        boru_name = ipAndPortBeans.get(position).getItemName();
+                        boru_code = ipAndPortBeans.get(position).getItemremark();
+                    }else {
+                        bochu_name = ipAndPortBeans.get(position).getItemName();
+                        bochu_code = ipAndPortBeans.get(position).getItemremark();
+                    }
+                    for (int i = 0; i < ipAndPortBeans.size(); i++) {
+                        ipAndPortBeans.get(i).setChecked(false);
+                    }
+                    ipAndPortBeans.get(position).setChecked(true);
+                    ipAndResourcesPortAdapter.notifyDataSetChanged();
+                }
+            });
+        }
+    }
+
+    private void setlineAdapter(ArrayList<ComDataBean> mList) {
+        LogUtil.i("mList", JSON.toJSONString(mList));
+        ipAndResourcesPortAdapter = new IpAndResourcesPortAdapter(mList);
+        ipAndResourcesPortAdapter.setmList(ComDataBeanList);
+        ipAndResourcesPortAdapter.notifyDataSetChanged();
+        rv_line_ip_port_data.setAdapter(ipAndResourcesPortAdapter);
+    }
+
+    private void closeCodeListPopupWindow() {
+        if (editPW != null) {
+            editPW.dismiss();
+            editPW = null;
+            CommonUtil.setBackgroundAlpha(mActivity, 1f);
+        }
+    }
+
 
     @Override
     public void onStop() {
@@ -564,10 +958,6 @@ public class OutboundListAdd_Fragment extends BaseFragment implements OnColumnIt
 
     }
 
-
-
-
-
     @Override
     public void onClick(View v) {
         switch (v.getId()) {
@@ -591,7 +981,6 @@ public class OutboundListAdd_Fragment extends BaseFragment implements OnColumnIt
             }
         }
 
-
         @Override
         public void onClick (Column < String > column, String value, String s,int position){
             String pd_pdno = mFilterStorageInBeans.get(position).getPD_PDNO();
@@ -601,8 +990,6 @@ public class OutboundListAdd_Fragment extends BaseFragment implements OnColumnIt
                 SharedPreUtil.saveString(mActivity,"pd_pdnoid",pd_pdno+"");
                 SharedPreUtil.saveString(mActivity,"pd_wmpdno",pd_wmpdno+"");
 
-
-
                 mSmartTable.getConfig()
                         .setContentCellBackgroundFormat(new BaseCellBackgroundFormat<CellInfo>() {
                             @Override
@@ -625,7 +1012,6 @@ public class OutboundListAdd_Fragment extends BaseFragment implements OnColumnIt
                         mSmartTable.postInvalidate();
                     }
                 }, 100);
-
         }
     @Override
     public void onActivityResult(int requestCode, int resultCode, Intent data) {
@@ -644,9 +1030,8 @@ public class OutboundListAdd_Fragment extends BaseFragment implements OnColumnIt
                     }
                 }
             }
-
-
     }
+
     @Override
     public void onDestroyView() {
         super.onDestroyView();
@@ -662,12 +1047,71 @@ public class OutboundListAdd_Fragment extends BaseFragment implements OnColumnIt
             ((FunctionActivity) getActivity()).setMoreBtnVisible(false);
         } else {
             FunctionActivity.setTitle(getString(R.string.title_outbound_rechargeadd));
-
         }
     }
+
     @Override
     public void onDestroy() {
         super.onDestroy();
+    }
+
+    private class IpAndResourcesPortAdapter extends BaseQuickAdapter<ComDataBean, BaseViewHolder> {
+        private List<ComDataBean> mmmmList;
+
+        public List<ComDataBean> getmList() {
+            return mmmmList;
+        }
+
+        public void setmList(List<ComDataBean> mList) {
+            this.mmmmList = mList;
+        }
+        public ComDataBean getBeanByPositon(int position){
+            return mmmmList.get(position);
+        }
 
+        private IpAndResourcesPortAdapter(@Nullable List<ComDataBean> data) {
+            super(R.layout.fuzzy_ipandport_item, data);
+            this.mmmmList = data;
+        }
+        @Override
+        protected void convert(BaseViewHolder helper, ComDataBean item) {
+            helper.setText(R.id.macode_ip__Tv,item.getItemremark()+"-("+item.getItemName()+")");
+            LinearLayout line_true = helper.itemView.findViewById(R.id.line_true);
+            if (item.getChecked()) {
+                line_true.setSelected(true);
+            } else {
+                line_true.setSelected(false);
+            }
+        }
+    }
+
+    private class ComDataBean{
+        String itemName = null;
+        String itemremark = null;
+        boolean Checked;
+
+        public boolean getChecked() {
+            return Checked;
+        }
+
+        public void setChecked(boolean checked) {
+            Checked = checked;
+        }
+
+        public String getItemName() {
+            return itemName;
+        }
+
+        public void setItemName(String itemName) {
+            this.itemName = itemName;
+        }
+
+        public String getItemremark() {
+            return itemremark;
+        }
+
+        public void setItemremark(String itemremark) {
+            this.itemremark = itemremark;
+        }
     }
 }

+ 799 - 0
app/src/main/java/com/uas/jc_wms/fragment/StorageTwoIQCInFragment.java

@@ -0,0 +1,799 @@
+package com.uas.jc_wms.fragment;
+
+import android.app.Activity;
+import android.app.Dialog;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.graphics.Color;
+import android.graphics.drawable.BitmapDrawable;
+import android.os.Bundle;
+import android.support.v4.app.Fragment;
+import android.support.v7.app.AlertDialog;
+import android.text.SpannableStringBuilder;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.inputmethod.EditorInfo;
+import android.widget.AdapterView;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.ListView;
+import android.widget.PopupWindow;
+import android.widget.RadioButton;
+import android.widget.RadioGroup;
+import android.widget.ScrollView;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.android.volley.Request;
+import com.android.volley.toolbox.StringRequest;
+import com.uas.jc_wms.R;
+import com.uas.jc_wms.activity.FunctionActivity;
+import com.uas.jc_wms.adapter.CaptionValueItemAdapter;
+import com.uas.jc_wms.adapter.WarehouseCacheAdapter;
+import com.uas.jc_wms.bean.CaptionValueBean;
+import com.uas.jc_wms.bean.WarehouseCacheBean;
+import com.uas.jc_wms.global.GloableParams;
+import com.uas.jc_wms.tools.SharedPreUtil;
+import com.uas.jc_wms.util.CameraUtil;
+import com.uas.jc_wms.util.CommonUtil;
+import com.uas.jc_wms.util.Constants;
+import com.uas.jc_wms.util.FastjsonUtil;
+import com.uas.jc_wms.util.FragmentUtils;
+import com.uas.jc_wms.util.HttpCallback;
+import com.uas.jc_wms.util.HttpParams;
+import com.uas.jc_wms.util.SpanUtils;
+import com.uas.jc_wms.util.VolleyRequest;
+import com.uas.jc_wms.view.ClearableEditText;
+import com.uuzuche.lib_zxing.activity.CaptureActivity;
+import com.uuzuche.lib_zxing.activity.CodeUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author RaoMeng
+ * @describe 入库管理-IQC检验页面
+ * @date 2018/4/22 17:14
+ */
+
+public class StorageTwoIQCInFragment extends BaseFragment implements View.OnClickListener, HttpCallback {
+    private static final int SCAN_BARCODE_CODE = 113;
+    private static final int FLAG_GET_BARCODE = 0x06;
+    private static final int FLAG_IQC_IN = 0x07;
+
+    private int mFocusId;
+    private ClearableEditText mBarcodeEditText;
+    private Button mMenuButton, mCommitButton;
+    private ImageView mScanImageView, mGoodImageView, mBadImageView;
+    private ListView mDataListView, mWarehouseListView;
+    private TextView mErrorTextView, mGoodEditText, mBadEditText;
+    private ScrollView mErrorScrollView;
+    private LinearLayout mDataLinearLayout;
+    private List<CaptionValueBean> mCaptionValueBeans;
+    private CaptionValueItemAdapter mCaptionValueItemAdapter;
+    private String mGoodWarehouse = "", mBadWarehouse = "";
+    private Dialog mWarehouseDialog;
+    private List<WarehouseCacheBean> mWarehouseCacheBeans;
+    private WarehouseCacheAdapter mWarehouseCacheAdapter;
+    private View mPopView;
+    private int mVeId = 0;
+    private String text_rb= "合格";
+
+    private StringRequest mStringRequest;
+    private PopupWindow mMenuPopupWindow;
+    private Fragment mFragment;
+    private SpanUtils mSpanUtils;
+    private double mOkQty;
+    private TextView tv_barcode;
+    private TextView tv_veCode;
+    private TextView tv_vadCode;
+    private TextView tv_prodcode;
+    private TextView tv_prDetail;
+    private TextView tv_prSpec;
+    private TextView tv_veOrderCode;
+    private TextView tv_veOrderNo;
+    private TextView tv_veVendName;
+    private TextView tv_testMethod;
+    private TextView tv_testResult;
+    private TextView tv_vadQty;
+    private TextView tv_checkQty;
+    private TextView tv_mOkQty;
+    private TextView tv_ngQty;
+    private TextView tv_status;
+    private RadioGroup rg_yesorno;
+    private RadioButton rb_yse;
+    private RadioButton rb_no;
+    private Button btn_shen;
+    private String datastring;
+
+    @Override
+    public void onDestroyView() {
+        super.onDestroyView();
+        ((FunctionActivity) getActivity()).setMoreBtnVisible(false);
+        CommonUtil.closeKeybord(mBarcodeEditText, mActivity);
+        ((TextView) (getActivity().findViewById(R.id.tv_actionbar_withback))).setText(getString(R.string.title_storage_in));
+    }
+
+    @Override
+    protected int getLayout() {
+        return R.layout.fragment_two_storage_iqc_in;
+    }
+
+    @Override
+    protected void initViews() {
+        FunctionActivity.setTitle(getString(R.string.title_storage_iqc));
+        ((FunctionActivity) getActivity()).setMoreBtnVisible(true);
+
+        mMenuButton = (Button) mActivity.findViewById(R.id.btn_actionbar_more);
+        mBarcodeEditText = (ClearableEditText) root.findViewById(R.id.storage_iqc_collect_et);
+        mBarcodeEditText.requestFocus();
+        mScanImageView = (ImageView) root.findViewById(R.id.storage_iqc_scan_iv);
+
+        mCommitButton = (Button) root.findViewById(R.id.storage_iqc_in_commit_btn);
+        mDataLinearLayout = (LinearLayout) root.findViewById(R.id.storage_iqc_in_data_ll);
+        mDataListView = (ListView) root.findViewById(R.id.storage_iqc_in_data_lv);
+        mGoodEditText = (TextView) root.findViewById(R.id.storage_iqc_good_warehouse_et);
+        mBadEditText = (TextView) root.findViewById(R.id.storage_iqc_bad_warehouse_et);
+        mGoodImageView = (ImageView) root.findViewById(R.id.storage_iqc_good_warehouse_iv);
+        mBadImageView = (ImageView) root.findViewById(R.id.storage_iqc_bad_warehouse_iv);
+        mErrorTextView = (TextView) root.findViewById(R.id.storage_iqc_in_error_tv);
+        mErrorScrollView = (ScrollView) root.findViewById(R.id.storage_iqc_in_error_sv);
+
+        tv_barcode = root.findViewById(R.id.tv_barcode);
+        tv_veCode = root.findViewById(R.id.tv_veCode);
+        tv_vadCode = root.findViewById(R.id.tv_vadCode);
+        tv_prodcode = root.findViewById(R.id.tv_prodcode);
+        tv_prDetail = root.findViewById(R.id.tv_prDetail);
+        tv_prSpec = root.findViewById(R.id.tv_prSpec);
+        tv_veOrderCode = root.findViewById(R.id.tv_veOrderCode);
+        tv_veOrderNo = root.findViewById(R.id.tv_veOrderNo);
+        tv_veVendName = root.findViewById(R.id.tv_veVendName);
+        tv_testMethod = root.findViewById(R.id.tv_testMethod);
+        tv_testResult = root.findViewById(R.id.tv_testResult);
+        tv_vadQty = root.findViewById(R.id.tv_vadQty);
+        tv_checkQty = root.findViewById(R.id.tv_checkQty);
+        tv_mOkQty = root.findViewById(R.id.tv_mOkQty);
+        tv_ngQty = root.findViewById(R.id.tv_ngQty);
+        tv_status = root.findViewById(R.id.tv_status);
+        rg_yesorno = root.findViewById(R.id.rg_yesorno);
+        rb_yse = root.findViewById(R.id.rb_yse);
+        rb_no = root.findViewById(R.id.rb_no);
+        btn_shen = root.findViewById(R.id.btn_shen);
+
+
+        mCaptionValueBeans = new ArrayList<>();
+        mCaptionValueItemAdapter = new CaptionValueItemAdapter(mActivity, mCaptionValueBeans);
+        mDataListView.setAdapter(mCaptionValueItemAdapter);
+
+        mPopView = View.inflate(mActivity, R.layout.pop_ip_history, null);
+        mWarehouseListView = (ListView) mPopView.findViewById(R.id.pop_ip_history_lv);
+        mWarehouseCacheBeans = new ArrayList<>();
+        mWarehouseCacheAdapter = new WarehouseCacheAdapter(mActivity, mWarehouseCacheBeans);
+        mWarehouseListView.setAdapter(mWarehouseCacheAdapter);
+        mWarehouseDialog = new AlertDialog.Builder(mActivity).setView(mPopView).create();
+
+        initPopupWindow();
+    }
+
+    @Override
+    protected void initEvents() {
+        mMenuButton.setOnClickListener(this);
+        mScanImageView.setOnClickListener(this);
+//        mBadImageView.setOnClickListener(this);
+//        mBadEditText.setOnClickListener(this);
+        mGoodImageView.setOnClickListener(this);
+        mGoodEditText.setOnClickListener(this);
+        mCommitButton.setOnClickListener(this);
+
+        mBarcodeEditText.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 barcode = mBarcodeEditText.getText().toString().trim();
+                    getDataByBarcode(barcode);
+                    return true;
+                }
+                return false;
+            }
+        });
+        rg_yesorno.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
+            @Override
+            public void onCheckedChanged(RadioGroup group, int checkedId) {
+                if (checkedId == R.id.rb_yse) {
+                    text_rb="合格";
+                } else if (checkedId == R.id.rb_no) {
+                    text_rb="不合格";
+                }
+            }
+        });
+        btn_shen.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                new AlertDialog.Builder(mActivity)
+                        .setMessage("确定是否是要审核")
+                        .setPositiveButton("是", new DialogInterface.OnClickListener() {
+                            @Override
+                            public void onClick(DialogInterface dialog, int which) {
+                                Yessehn();
+                            }
+                        })
+                        .setNegativeButton("否", new DialogInterface.OnClickListener() {
+                            @Override
+                            public void onClick(DialogInterface dialog, int which) {
+                                dialog.dismiss();
+                            }
+                        }).create().show();
+
+            }
+        });
+    }
+    private static final int FLAG_UPDATEANDINQTY = 0x05;
+    public void Yessehn(){
+        if (mVeId == 0) {
+            CommonUtil.toastNoRepeat(mActivity, "单据id获取失败,请重新获取条码信息");
+            return;
+        }
+
+//        if (TextUtils.isEmpty(mGoodWarehouse) && mOkQty > 0) {
+//            CommonUtil.toastNoRepeat(mActivity, "该检验单存在合格数,良品仓必填\n");
+//            return;
+//        }
+        progressDialog.show();
+        VolleyRequest.getInstance().stringRequest(mStringRequest,
+                new HttpParams.Builder()
+                        .url(GloableParams.ADDRESS_DOCUMENTLIBRARY_AUTIQC)
+                        .method(Request.Method.POST)
+                        .tag(TAG + "updateandinqty")
+                        .flag(FLAG_UPDATEANDINQTY)
+                        .addParam("ve_id", mVeId+"")
+                        .addParam("ve_result", text_rb)
+                        .addParam("bar_code", text_rb)
+                        .build(), new HttpCallback() {
+                    @Override
+                    public void onSuccess(int flag, Object o) throws Exception {
+                        progressDialog.dismiss();
+                        String result = o.toString();
+                        JSONObject resultObject = JSON.parseObject(result);
+                        datastring = FastjsonUtil.getText(resultObject, "data");
+                        CommonUtil.toastNoRepeat(mActivity, datastring);
+//                        mDataLinearLayout.setVisibility(View.GONE);
+//                        mErrorScrollView.setVisibility(View.VISIBLE);
+                        if (!CommonUtil.isNetWorkConnected(mActivity)) {
+                            CommonUtil.toastNoRepeat(mActivity, mActivity.getString(R.string.net_not_connect));
+                        } else {
+
+                            if (!CommonUtil.isRepeatClick()) {
+
+                                hideAllViews();
+                                YessehnSTORAGE();
+                            }
+                        }
+                        mBarcodeEditText.setText("");
+                    }
+
+                    @Override
+                    public void onFail(int flag, String failStr) throws Exception {
+                        progressDialog.dismiss();
+                        CommonUtil.toastNoRepeat(mActivity, failStr);
+                    }
+                });
+    }
+    public void YessehnSTORAGE(){
+        progressDialog.show();
+        VolleyRequest.getInstance().stringRequest(mStringRequest,
+                new HttpParams.Builder()
+                        .url(GloableParams.ADDRESS_TURNPURCBARCODE)
+                        .method(Request.Method.POST)
+                        .flag(FLAG_IQC_IN)
+                        .tag(TAG + "turnQc")
+                        .addParam("ve_id", mVeId + "")
+                        .addParam("okwh", mGoodWarehouse)
+                        .addParam("ngwh", mBadWarehouse)
+                        .build(), new HttpCallback() {
+                    @Override
+                    public void onSuccess(int flag, Object o) throws Exception {
+                        try {
+                            progressDialog.dismiss();
+                            String result = o.toString();
+                            JSONObject resultObject = JSON.parseObject(result);
+                            JSONObject dataObject = resultObject.getJSONObject("data");
+                            Log.e("dataObject===",dataObject.toString());
+                            if (dataObject != null) {
+                                CommonUtil.toastNoRepeat(mActivity, "入库单"+FastjsonUtil.getText(dataObject, "okNO")+"生成成功");
+
+                            }
+                        } catch (Exception e) {
+
+                        }
+                    }
+
+                    @Override
+                    public void onFail(int flag, String failStr) throws Exception {
+                        progressDialog.dismiss();
+                        CommonUtil.toastNoRepeat(mActivity, failStr);
+                    }
+                });
+    }
+    @Override
+    protected void initDatas() {
+        //        mBadWarehouse = SharedPreUtil.getString(mActivity
+//                , Constants.FLAG.CACHE_DEFAULT_REJECTS_WAREHOUSE + CommonUtil.getUserName(mActivity), null);
+
+        mSpanUtils = new SpanUtils();
+        SpannableStringBuilder badWareHouse = mSpanUtils.append("IQC").setForegroundColor(Color.BLACK)
+                .append("(IQC判退仓)").setForegroundColor(Color.GRAY).create();
+        mBadWarehouse = "IQC";
+        mGoodEditText.setText(mGoodWarehouse);
+        mBadEditText.setText(badWareHouse);
+
+        String allWarehouse = SharedPreUtil.getString(mActivity, Constants.FLAG.ALL_WAREHOUSE_CACHE, null);
+        try {
+            JSONArray warehouseArray = JSON.parseArray(allWarehouse);
+            if (warehouseArray != null) {
+                for (int i = 0; i < warehouseArray.size(); i++) {
+                    JSONObject warehouseObject = warehouseArray.getJSONObject(i);
+                    if (warehouseObject != null) {
+                        WarehouseCacheBean warehouseCacheBean = new WarehouseCacheBean();
+                        warehouseCacheBean.setWhcode(FastjsonUtil.getText(warehouseObject, "WH_CODE"));
+                        warehouseCacheBean.setDescription(FastjsonUtil.getText(warehouseObject, "WH_DESCRIPTION"));
+
+                        mWarehouseCacheBeans.add(warehouseCacheBean);
+                    }
+                }
+                mWarehouseCacheAdapter.notifyDataSetChanged();
+            }
+        } catch (Exception e) {
+
+        }
+    }
+
+    private CaptionValueBean createItem(String caption, String value, int color) {
+        CaptionValueBean captionValueBean = new CaptionValueBean();
+        captionValueBean.setCaption(caption);
+        captionValueBean.setValue(value);
+        captionValueBean.setColor(color);
+
+        return captionValueBean;
+    }
+
+    private void initPopupWindow() {
+        View view = View.inflate(getActivity(), R.layout.pop_storage_iqc_in_menu, null);
+
+        Button doneButton = (Button) view.findViewById(R.id.pop_storage_iqc_in_menu_1);
+        Button todoButton = (Button) view.findViewById(R.id.pop_storage_iqc_in_menu_2);
+
+        mFragment = new StorageIQCInListFragment();
+
+        doneButton.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                closeMenuPopupWindow();
+                Bundle bundle = new Bundle();
+                bundle.putString(Constants.FLAG.FLAG_IQC_IN_CALLER, "VerifyApplyDetail!Have");
+                mFragment.setArguments(bundle);
+                ((FunctionActivity) getActivity()).setMoreBtnVisible(false);
+                FragmentUtils.switchFragment(StorageTwoIQCInFragment.this, mFragment);
+            }
+        });
+
+        todoButton.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                closeMenuPopupWindow();
+                Bundle bundle = new Bundle();
+                bundle.putString(Constants.FLAG.FLAG_IQC_IN_CALLER, "VerifyApplyDetail!Need");
+                mFragment.setArguments(bundle);
+                ((FunctionActivity) getActivity()).setMoreBtnVisible(false);
+                FragmentUtils.switchFragment(StorageTwoIQCInFragment.this, mFragment);
+            }
+        });
+
+        mMenuPopupWindow = new PopupWindow(view, LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT, true);
+        mMenuPopupWindow.setBackgroundDrawable(new BitmapDrawable());
+        mMenuPopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
+            @Override
+            public void onDismiss() {
+                closeMenuPopupWindow();
+            }
+        });
+    }
+
+    private void closeMenuPopupWindow() {
+        if (mMenuPopupWindow != null) {
+            mMenuPopupWindow.dismiss();
+            CommonUtil.setBackgroundAlpha(mActivity, 1f);
+        }
+    }
+
+    @Override
+    public void onHiddenChanged(boolean hidden) {
+        super.onHiddenChanged(hidden);
+        if (!hidden) {
+            FunctionActivity.setTitle(getString(R.string.title_storage_iqc));
+            ((FunctionActivity) getActivity()).setMoreBtnVisible(true);
+        }
+    }
+
+    @Override
+    public void onClick(View v) {
+        switch (v.getId()) {
+            case R.id.storage_iqc_scan_iv:
+                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));
+                }
+                break;
+            case R.id.btn_actionbar_more:
+                CommonUtil.setBackgroundAlpha(getActivity(), 0.5f);
+                mMenuPopupWindow.showAsDropDown(mMenuButton);
+                break;
+            case R.id.storage_iqc_good_warehouse_iv:
+            case R.id.storage_iqc_good_warehouse_et:
+                if (mWarehouseCacheBeans.size() == 0) {
+                    CommonUtil.toastNoRepeat(mActivity, "仓库列表获取失败,请重新登录获取数据");
+                } else {
+                    mWarehouseListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+                        @Override
+                        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+                            WarehouseCacheBean warehouseCacheBean = mWarehouseCacheBeans.get(position);
+                            String whcode = warehouseCacheBean.getWhcode();
+                            String description = warehouseCacheBean.getDescription();
+
+                            mGoodWarehouse = whcode;
+                            SharedPreUtil.saveString(mActivity
+                                    , Constants.FLAG.IQC_GOOD_WAREHOUSE_CACHE + CommonUtil.getUserName(mActivity), mGoodWarehouse);
+
+                            mSpanUtils = new SpanUtils();
+                            SpannableStringBuilder result = mSpanUtils.append(whcode).setForegroundColor(Color.BLACK).append("(" + description + ")").setForegroundColor(Color.GRAY).create();
+
+                            mGoodEditText.setText(result);
+
+                            if (mWarehouseDialog != null) {
+                                mWarehouseDialog.dismiss();
+                            }
+                        }
+                    });
+                    mWarehouseDialog.show();
+                }
+                break;
+            case R.id.storage_iqc_bad_warehouse_iv:
+            case R.id.storage_iqc_bad_warehouse_et:
+                if (mWarehouseCacheBeans.size() == 0) {
+                    CommonUtil.toastNoRepeat(mActivity, "仓库列表获取失败,请重新登录获取数据");
+                } else {
+                    mWarehouseListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+                        @Override
+                        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+                            WarehouseCacheBean warehouseCacheBean = mWarehouseCacheBeans.get(position);
+                            mBadEditText.setText(warehouseCacheBean.getWhcode());
+
+                            if (mWarehouseDialog != null) {
+                                mWarehouseDialog.dismiss();
+                            }
+                        }
+                    });
+                    mWarehouseDialog.show();
+                }
+                break;
+            case R.id.storage_iqc_in_commit_btn:
+                if (!CommonUtil.isNetWorkConnected(mActivity)) {
+                    CommonUtil.toastNoRepeat(mActivity, mActivity.getString(R.string.net_not_connect));
+                } else {
+                    if (mVeId == 0) {
+                        CommonUtil.toastNoRepeat(mActivity, "单据id获取失败,请重新获取条码信息");
+                        return;
+                    }
+                    if (!CommonUtil.isRepeatClick()) {
+                        String good = mGoodEditText.getText().toString().trim();
+                        String bad = mBadEditText.getText().toString().trim();
+//                        if (TextUtils.isEmpty(mGoodWarehouse) && mOkQty > 0) {
+//                            CommonUtil.toastNoRepeat(mActivity, "该检验单存在合格数,良品仓必填\n");
+//                            return;
+//                        }
+                        hideAllViews();
+                        progressDialog.show();
+                        VolleyRequest.getInstance().stringRequest(mStringRequest,
+                                new HttpParams.Builder()
+                                        .url(GloableParams.ADDRESS_IQC_TURN_PURC_STORAGE)
+                                        .method(Request.Method.POST)
+                                        .flag(FLAG_IQC_IN)
+                                        .tag(TAG + "turnQc")
+                                        .addParam("ve_id", mVeId + "")
+                                        .addParam("okwh", mGoodWarehouse)
+                                        .addParam("ngwh", mBadWarehouse)
+                                        .build(), this);
+                    }
+                }
+                break;
+            default:
+                break;
+        }
+    }
+
+    @Override
+    public void onSuccess(final int flag, Object o) throws Exception {
+        progressDialog.dismiss();
+        switch (flag) {
+            case FLAG_GET_BARCODE:
+                try {
+                    progressDialog.dismiss();
+                    String result = o.toString();
+                    JSONObject resultObject = JSON.parseObject(result);
+                    JSONObject dataObject = resultObject.getJSONObject("data");
+                    if (dataObject != null) {
+                        mVeId = FastjsonUtil.getInt(dataObject, "VE_ID");
+                        String barcode = FastjsonUtil.getText(dataObject, "barcode");
+                        String veCode = FastjsonUtil.getText(dataObject, "VE_CODE");
+                        String vadCode = FastjsonUtil.getText(dataObject, "VAD_CODE");
+                        String prodcode = FastjsonUtil.getText(dataObject, "VAD_PRODCODE");
+                        String prDetail = FastjsonUtil.getText(dataObject, "PR_DETAIL");
+                        String prSpec = FastjsonUtil.getText(dataObject, "PR_SPEC");
+                        String veOrderCode = FastjsonUtil.getText(dataObject, "VE_ORDERCODE");
+                        String veOrderNo = FastjsonUtil.getText(dataObject, "VE_ORDERDETNO");
+                        String veVendName = FastjsonUtil.getText(dataObject, "VAD_VENDNAME");
+                        String testMethod = FastjsonUtil.getText(dataObject, "VE_METHOD");
+                        String testResult = FastjsonUtil.getText(dataObject, "VE_RESULT");
+                        String vadQty = FastjsonUtil.getText(dataObject, "VAD_QTY");
+                        String checkQty = FastjsonUtil.getText(dataObject, "CHECKQTY");
+                        mOkQty = FastjsonUtil.getDouble(dataObject, "OKQTY");
+                        String ngQty = FastjsonUtil.getText(dataObject, "NGQTY");
+                        String status = FastjsonUtil.getText(dataObject, "VE_STATUS");
+                        String goodWhcode = FastjsonUtil.getText(dataObject, "DEFAULTWHCODE");
+                        String goodWhname = FastjsonUtil.getText(dataObject, "DEFAULTWHNAME");
+                        String vad_whcode = FastjsonUtil.getText(dataObject, "vad_whcode");
+                        mGoodWarehouse = vad_whcode;
+                        mGoodEditText.setText(mGoodWarehouse);
+                        tv_barcode.setText(barcode);
+                        tv_veCode.setText(veCode);
+                        tv_vadCode.setText(vadCode);
+                        tv_prodcode.setText(prodcode);
+                        tv_prDetail.setText(prDetail);
+                        tv_prSpec.setText(prSpec);
+                        tv_veOrderCode.setText(veOrderCode);
+                        tv_veOrderNo.setText(veOrderNo);
+                        tv_veVendName.setText(veVendName);
+                        tv_testMethod.setText(testMethod);
+                        tv_vadQty.setText(vadQty);
+                        tv_checkQty.setText(checkQty);
+                        tv_mOkQty.setText(mOkQty+"");
+                        tv_ngQty.setText(ngQty);
+                        tv_status.setText(status);
+                    }
+                    mErrorScrollView.setVisibility(View.GONE);
+                    mDataLinearLayout.setVisibility(View.VISIBLE);
+//                    analysisGetBarcode(result);
+                } catch (Exception e) {
+                    mDataLinearLayout.setVisibility(View.GONE);
+                    mErrorTextView.setText("条码数据获取异常,请重新获取");
+                    mErrorScrollView.setVisibility(View.VISIBLE);
+                }
+                break;
+            case FLAG_IQC_IN:
+                try {
+                    progressDialog.dismiss();
+                    String result = o.toString();
+                    JSONObject resultObject = JSON.parseObject(result);
+                    JSONObject dataObject = resultObject.getJSONObject("data");
+                    Log.e("dataObject===",dataObject.toString());
+                    if (dataObject != null) {
+                        final JSONObject okNoObject = dataObject.getJSONObject("okNO");
+                        if (okNoObject == null) {
+                            mErrorScrollView.setVisibility(View.VISIBLE);
+                            mErrorTextView.setText("不良品入库成功\n单号:" + FastjsonUtil.getText(dataObject, "ngNO"));
+                        } else {
+                            mErrorScrollView.setVisibility(View.GONE);
+                            mDataLinearLayout.setVisibility(View.GONE);
+                            String ngNO = FastjsonUtil.getText(dataObject, "ngNO");
+                            String message = "验收成功\n"
+                                    + "单号:" + FastjsonUtil.getText(okNoObject, "PI_INOUTNO");
+                            if (!TextUtils.isEmpty(ngNO)) {
+                                message += "\n不良品入库成功\n单号:" + ngNO;
+                            }
+                            message += "\n是否进行条码入库采集?";
+                            new AlertDialog.Builder(mActivity)
+                                    .setMessage(message)
+                                    .setPositiveButton("是", new DialogInterface.OnClickListener() {
+                                        @Override
+                                        public void onClick(DialogInterface dialog, int which) {
+                                            if (!CommonUtil.isRepeatClick()) {
+                                                dialog.dismiss();
+                                                Fragment fragment = new MaterialInCollectFragment();
+                                                Bundle bundle = new Bundle();
+                                                bundle.putString(Constants.FLAG.FLAG_IQC_IN_JSON, okNoObject.toJSONString());
+
+                                                fragment.setArguments(bundle);
+                                                FragmentUtils.switchFragment(StorageTwoIQCInFragment.this, fragment);
+                                            }
+                                        }
+                                    })
+                                    .setNegativeButton("否", new DialogInterface.OnClickListener() {
+                                        @Override
+                                        public void onClick(DialogInterface dialog, int which) {
+                                            dialog.dismiss();
+                                        }
+                                    }).create().show();
+                        }
+                    }
+                } catch (Exception e) {
+
+                }
+                break;
+            default:
+                break;
+        }
+    }
+
+    @Override
+    public void onFail(int flag, String failStr) throws Exception {
+
+        switch (flag) {
+            case FLAG_GET_BARCODE:
+                mBarcodeEditText.setText("");
+                progressDialog.dismiss();
+                mDataLinearLayout.setVisibility(View.GONE);
+                mErrorTextView.setText(failStr);
+                mErrorScrollView.setVisibility(View.VISIBLE);
+                break;
+            case FLAG_IQC_IN:
+                progressDialog.dismiss();
+                mErrorTextView.setText(failStr);
+                mErrorScrollView.setVisibility(View.VISIBLE);
+                break;
+            default:
+                break;
+        }
+    }
+
+    private void analysisGetBarcode(String result) {
+        Log.d("iqcBarcode", result);
+        try {
+            JSONObject resultObject = JSON.parseObject(result);
+            JSONObject dataObject = resultObject.getJSONObject("data");
+            if (dataObject != null) {
+                String barcode;
+                String veCode;
+                String vadCode;
+                String prodcode;
+                String prDetail;
+                String prSpec;
+                String veOrderCode;
+                String veOrderNo;
+                String veVendName;
+                String testMethod;
+                String testResult;
+                String vadQty;
+                String checkQty;
+                String ngQty;
+                String status;
+                String goodWhcode;
+                String goodWhname;
+
+                mVeId = FastjsonUtil.getInt(dataObject, "VE_ID");
+                barcode = FastjsonUtil.getText(dataObject, "barcode");
+                veCode = FastjsonUtil.getText(dataObject, "VE_CODE");
+                vadCode = FastjsonUtil.getText(dataObject, "VAD_CODE");
+                prodcode = FastjsonUtil.getText(dataObject, "VAD_PRODCODE");
+                prDetail = FastjsonUtil.getText(dataObject, "PR_DETAIL");
+                prSpec = FastjsonUtil.getText(dataObject, "PR_SPEC");
+                veOrderCode = FastjsonUtil.getText(dataObject, "VE_ORDERCODE");
+                veOrderNo = FastjsonUtil.getText(dataObject, "VE_ORDERDETNO");
+                veVendName = FastjsonUtil.getText(dataObject, "VAD_VENDNAME");
+                testMethod = FastjsonUtil.getText(dataObject, "VE_METHOD");
+                testResult = FastjsonUtil.getText(dataObject, "VE_RESULT");
+                vadQty = FastjsonUtil.getText(dataObject, "VAD_QTY");
+                checkQty = FastjsonUtil.getText(dataObject, "CHECKQTY");
+                mOkQty = FastjsonUtil.getDouble(dataObject, "OKQTY");
+                ngQty = FastjsonUtil.getText(dataObject, "NGQTY");
+                status = FastjsonUtil.getText(dataObject, "VE_STATUS");
+                goodWhcode = FastjsonUtil.getText(dataObject, "DEFAULTWHCODE");
+                goodWhname = FastjsonUtil.getText(dataObject, "DEFAULTWHNAME");
+
+                if (TextUtils.isEmpty(goodWhcode)) {
+                    mGoodWarehouse = SharedPreUtil.getString(mActivity
+                            , Constants.FLAG.IQC_GOOD_WAREHOUSE_CACHE + CommonUtil.getUserName(mActivity), null);
+                } else {
+                    mGoodWarehouse = goodWhcode;
+                }
+                mSpanUtils = new SpanUtils();
+                SpannableStringBuilder goodWareHouse = mSpanUtils.append(goodWhcode).setForegroundColor(Color.BLACK)
+                        .append(TextUtils.isEmpty(goodWhname) ? "" : ("(" + goodWhname + ")")).setForegroundColor(Color.GRAY).create();
+                mGoodEditText.setText(goodWareHouse);
+
+                mCaptionValueBeans.add(createItem("条码号", barcode, 0));
+                mCaptionValueBeans.add(createItem("检验单号", veCode, 0));
+                mCaptionValueBeans.add(createItem("收料单号", vadCode, 0));
+                mCaptionValueBeans.add(createItem("物料编号", prodcode, 0));
+                mCaptionValueBeans.add(createItem("物料名称", prDetail, 0));
+                mCaptionValueBeans.add(createItem("物料规格", prSpec, 0));
+                mCaptionValueBeans.add(createItem("采购单", veOrderCode, 0));
+                mCaptionValueBeans.add(createItem("序号", veOrderNo, 0));
+                mCaptionValueBeans.add(createItem("供应商", veVendName, 0));
+                mCaptionValueBeans.add(createItem("检验方式", testMethod, 0));
+                mCaptionValueBeans.add(createItem("检验结果", testResult, 0));
+                mCaptionValueBeans.add(createItem("收料数", vadQty, 0));
+                mCaptionValueBeans.add(createItem("送检数", checkQty, 0));
+                mCaptionValueBeans.add(createItem("合格数", mOkQty + "", 0));
+                mCaptionValueBeans.add(createItem("不合格数", ngQty, 0));
+                mCaptionValueBeans.add(createItem("状态", status, 0));
+
+                mCaptionValueItemAdapter.notifyDataSetChanged();
+            }
+        } catch (Exception e) {
+
+        }
+        mErrorScrollView.setVisibility(View.GONE);
+        mDataLinearLayout.setVisibility(View.VISIBLE);
+    }
+
+    private void getDataByBarcode(String barcode) {
+        if (TextUtils.isEmpty(barcode)) {
+            return;
+        }
+
+        hideAllViews();
+        progressDialog.show();
+
+        VolleyRequest.getInstance().stringRequest(mStringRequest,
+                new HttpParams.Builder()
+                        .url(GloableParams.ADDRESS_IQC_GETDATA_BARCODE + "?bar_code=" + barcode)
+                        .method(Request.Method.GET)
+                        .flag(FLAG_GET_BARCODE)
+                        .tag(TAG + "barcode")
+                        .build(), this);
+    }
+
+    private void hideAllViews() {
+        mDataLinearLayout.setVisibility(View.GONE);
+        mErrorTextView.setText("");
+        mErrorScrollView.setVisibility(View.GONE);
+        mCaptionValueBeans.clear();
+//        mCaptionValueItemAdapter.notifyDataSetChanged();
+    }
+
+    @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.storage_iqc_collect_et) {
+                    mBarcodeEditText.setText(result);
+                    mBarcodeEditText.setSelection(result.length());
+
+                    getDataByBarcode(result);
+                }
+            }
+        }
+    }
+
+
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        return false;
+    }
+
+    @Override
+    public boolean onFragmentBackPressed() {
+        return false;
+    }
+
+}

+ 51 - 40
app/src/main/java/com/uas/jc_wms/fragment/VersionUpgradeFragment.java

@@ -13,11 +13,9 @@ import android.widget.Button;
 import android.widget.TextView;
 
 import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.android.volley.Request;
 import com.uas.jc_wms.R;
-import com.uas.jc_wms.bean.VersionUpgradeBean;
 import com.uas.jc_wms.global.GloableParams;
 import com.uas.jc_wms.util.AndroidUtil;
 import com.uas.jc_wms.util.CommonUtil;
@@ -33,8 +31,6 @@ import com.uas.jc_wms.view.business.CommonProgressPop;
 
 import java.io.File;
 import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
 
 import static com.uas.jc_wms.util.Constants.CONSTANT.APK_FILE_NAME;
 import static com.uas.jc_wms.util.Constants.CONSTANT.APK_FILE_PATH;
@@ -117,44 +113,59 @@ public class VersionUpgradeFragment extends BaseFragment implements ProgressResp
                 progressDialog.dismiss();
                 String result = o.toString();
                 JSONObject resultObject = JSON.parseObject(result);
-                JSONArray dataArray = resultObject.getJSONArray("data");
-                List<VersionUpgradeBean> 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) {
-                            VersionUpgradeBean jltStorageInBean = new VersionUpgradeBean();
-                            if (FastjsonUtil.getText(dataObject, "PP_PDACODE").equals("UAS仓储管理")){
-                                jltStorageInBean.setPP_PDACODE(FastjsonUtil.getText(dataObject, "PP_PDACODE"));
-                                jltStorageInBean.setPP_VERSIONNUM(FastjsonUtil.getText(dataObject, "PP_VERSIONNUM"));
-                                jltStorageInBean.setPP_ATTACH(FastjsonUtil.getText(dataObject, "PP_ATTACH"));
-                                jltStorageInBean.setPP_REMARK(FastjsonUtil.getText(dataObject, "PP_REMARK"));
-                                jltStorageInBean.setPP_VERSIONNAME(FastjsonUtil.getText(dataObject, "PP_VERSIONNAME"));
-                                list.add(jltStorageInBean);
-                                mUpgradeButton.setVisibility(View.VISIBLE);
-                            }else {
-                                mUpgradeButton.setVisibility(View.GONE);
-                            }
+                JSONObject dataObject = resultObject.getJSONObject("data");
+                if (dataObject != null) {
+                    mNewVersionTv.setText(FastjsonUtil.getText(dataObject, "pp_versionname"));
+                    mMsgTextView.setText(FastjsonUtil.getText(dataObject, "pp_remark"));
 
-                        }
-                    }
-                }
-                if (list == null || list.size() == 0){
-                    mUpgradeButton.setVisibility(View.GONE);
-                }else {
-                    for (int i=0;i<list.size();i++){
-                        VersionUpgradeBean versionUpgradeBean = list.get(0);
-                        mNewVersionTv.setText(versionUpgradeBean.getPP_VERSIONNAME());
-                        mMsgTextView.setText(versionUpgradeBean.getPP_REMARK());
-                        mAttachId = versionUpgradeBean.getPP_ATTACH();
-                        if (!TextUtils.isEmpty(mAttachId)) {
-                            mUpgradeButton.setVisibility(View.VISIBLE);
-                        } else {
-                            mUpgradeButton.setVisibility(View.VISIBLE);
-                        }
+                    mAttachId = FastjsonUtil.getText(dataObject, "pp_attach");
+                    if (!TextUtils.isEmpty(mAttachId)) {
+                        mUpgradeButton.setVisibility(View.VISIBLE);
+                    } else {
+                        mUpgradeButton.setVisibility(View.GONE);
                     }
                 }
+
+//                String result = o.toString();
+//                JSONObject resultObject = JSON.parseObject(result);
+//                JSONArray dataArray = resultObject.getJSONArray("data");
+//                List<VersionUpgradeBean> 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) {
+//                            VersionUpgradeBean jltStorageInBean = new VersionUpgradeBean();
+//                            if (FastjsonUtil.getText(dataObject, "PP_PDACODE").equals("UAS仓储管理")){
+//                                jltStorageInBean.setPP_PDACODE(FastjsonUtil.getText(dataObject, "PP_PDACODE"));
+//                                jltStorageInBean.setPP_VERSIONNUM(FastjsonUtil.getText(dataObject, "PP_VERSIONNUM"));
+//                                jltStorageInBean.setPP_ATTACH(FastjsonUtil.getText(dataObject, "PP_ATTACH"));
+//                                jltStorageInBean.setPP_REMARK(FastjsonUtil.getText(dataObject, "PP_REMARK"));
+//                                jltStorageInBean.setPP_VERSIONNAME(FastjsonUtil.getText(dataObject, "PP_VERSIONNAME"));
+//                                list.add(jltStorageInBean);
+//                                mUpgradeButton.setVisibility(View.VISIBLE);
+//                            }else {
+//                                mUpgradeButton.setVisibility(View.GONE);
+//                            }
+//
+//                        }
+//                    }
+//                }
+//                if (list == null || list.size() == 0){
+//                    mUpgradeButton.setVisibility(View.GONE);
+//                }else {
+//                    for (int i=0;i<list.size();i++){
+//                        VersionUpgradeBean versionUpgradeBean = list.get(0);
+//                        mNewVersionTv.setText(versionUpgradeBean.getPP_VERSIONNAME());
+//                        mMsgTextView.setText(versionUpgradeBean.getPP_REMARK());
+//                        mAttachId = versionUpgradeBean.getPP_ATTACH();
+//                        if (!TextUtils.isEmpty(mAttachId)) {
+//                            mUpgradeButton.setVisibility(View.VISIBLE);
+//                        } else {
+//                            mUpgradeButton.setVisibility(View.VISIBLE);
+//                        }
+//                    }
+//                }
             }
 
             @Override
@@ -204,7 +215,7 @@ public class VersionUpgradeFragment extends BaseFragment implements ProgressResp
 //                            remain = 0;
 //                        }
                     } catch (Exception e) {
-
+                        e.printStackTrace();
                     }
                     break;
                 case Constants.CONSTANT.DOWNLOAD_SUCCESS:

+ 2 - 1
app/src/main/java/com/uas/jc_wms/fragment/WHCheckContentFragment.java

@@ -60,7 +60,8 @@ public class WHCheckContentFragment extends BaseFragment implements AdapterView.
         switch (selected){
             //物料库存核查
             case GloableParams.LISTNAME_WH_CHECKCONTENT_MAKEMATERIAL:
-                fragment = new WHCheckMakeMaterialFragment();
+//                fragment = new WHCheckMakeMaterialFragment();
+                fragment = new NewWHCheckMakeMaterialFragment();    //修改为仓库通用版的 物料库存核查
                 getFragmentManager().beginTransaction().addToBackStack(null)
                         .replace(R.id.container_function_fragment,fragment).commit();
                 break;

+ 27 - 0
app/src/main/java/com/uas/jc_wms/global/GloableParams.java

@@ -259,6 +259,12 @@ public class GloableParams {
     public static String ADDRESS_OUTMATERIAL_NEWPRODINOUT;
     public static String ADDRESS_DOCUMENT_DETAILS;
     public static String ADDRESS_BARCODE_SPLITTING;      //按条码拆分
+    public static String ADDRESS_BARCODE_ENTER;      //条码入库的条码回车
+    public static String ADDRESS_DOCUMENTLIBRARY_AUTIQC;
+    public static String ADDRESS_TURNPURCBARCODE;
+
+    public static String ADDRESS_GET_BARCODE_DATA;
+    public static String ADDRESS_GET_PRE_MATERIAL_LIST;
 
     //连接服务器请求地址
     private static final String ADDRESSTAIL_CONNECT_SERVER = "/api/pda/getAllMasters.action";
@@ -279,6 +285,8 @@ public class GloableParams {
     private static final String ADDRESSTAIL_DOCUMENT_DETAILS = "/api/pda/receiving/GenProdiodetail.action";
     //按条码拆分
     private static final String ADDRESSTAIL_BARCODE_SPLITTING = "/api/pda/outMaterial/splitProdAppropriationOut.action";
+    //条码入库的条码Enter
+    private static final String ADDRESSTAIL_BARCODE_ENTER = "/api/pda/inBarCode/GetInBarCode.action";
 
     /**
      * 条码信息采集
@@ -719,6 +727,10 @@ public class GloableParams {
     //真空密封登记
     private static String ADDRESSTAIL_MSD_CONFIRMSEALBARCODE = "/api/pda/msd/confirmSealBarcode.action";
 
+    //IQC审核
+    private static String ADDRESSTAIL_RECHARGE_AUTIQC = "/api/pda/QCToPurcCheckin/autiQc.action";
+    private static String ADDRESSTAIL_IQC_GETLIST_TURNPURCBARCODE = "/api/pda/QCToPurcCheckin/turnPurcBarCode.action";
+
     /**
      * 设置页面
      */
@@ -729,6 +741,13 @@ public class GloableParams {
     //切换账套
     private static final String ADDRESSTAIL_CHANGE_MASTER = "/api/pda/changeMaster.action";
 
+    //修改数量弹窗
+    private static final String ADDRESSTAIL_GET_BARCODE_DATA = "/api/pda/outMaterial/getBarcodeData.action";
+
+    private static final String ADDRESSTAIL_GET_PRE_MATERIAL_LIST = "/api/pda/outMaterial/getStockMaterialList.action";
+
+
+
     /***********************************************************************************************/
     /*界面文字和图片资源,控制后续数据一致*/
     //主界面
@@ -1157,6 +1176,14 @@ public class GloableParams {
         GloableParams.ADDRESS_OUTMATERIAL_NEWPRODINOUT = uriHead + GloableParams.ADDRESSTAIL_COUNTING_NEWPRODINOUT;
         GloableParams.ADDRESS_DOCUMENT_DETAILS = uriHead + GloableParams.ADDRESSTAIL_DOCUMENT_DETAILS;
         GloableParams.ADDRESS_BARCODE_SPLITTING = uriHead + GloableParams.ADDRESSTAIL_BARCODE_SPLITTING;
+        GloableParams.ADDRESS_BARCODE_ENTER = uriHead + GloableParams.ADDRESSTAIL_BARCODE_ENTER;
+
+        GloableParams.ADDRESS_DOCUMENTLIBRARY_AUTIQC= uriHead + GloableParams.ADDRESSTAIL_RECHARGE_AUTIQC;
+        GloableParams.ADDRESS_TURNPURCBARCODE= uriHead + GloableParams.ADDRESSTAIL_IQC_GETLIST_TURNPURCBARCODE;
+
+        GloableParams.ADDRESS_GET_BARCODE_DATA = uriHead + GloableParams.ADDRESSTAIL_GET_BARCODE_DATA;
+        GloableParams.ADDRESS_GET_PRE_MATERIAL_LIST = uriHead + GloableParams.ADDRESSTAIL_GET_PRE_MATERIAL_LIST;
+
 
 
 

+ 31 - 1
app/src/main/java/com/uas/jc_wms/tools/DataSourceManager.java

@@ -7,7 +7,6 @@ import android.os.Build;
 import android.util.Log;
 
 import com.google.gson.reflect.TypeToken;
-import com.uas.jc_wms.global.GloableParams;
 import com.uas.jc_wms.bean.FeederDetail;
 import com.uas.jc_wms.bean.Master;
 import com.uas.jc_wms.bean.Mpcode;
@@ -15,12 +14,14 @@ import com.uas.jc_wms.bean.ProductIn;
 import com.uas.jc_wms.bean.SMTQuery;
 import com.uas.jc_wms.bean.UnCollect;
 import com.uas.jc_wms.bean.WHMakeMaterialProduct;
+import com.uas.jc_wms.bean.WHMakeMaterialProductNew;
 import com.uas.jc_wms.bean.Whcode;
 import com.uas.jc_wms.exception.NullListException;
 import com.uas.jc_wms.fragment.IOCInMakeMaterialFragment;
 import com.uas.jc_wms.fragment.LoginFragment;
 import com.uas.jc_wms.fragment.SCFeederGetFragment;
 import com.uas.jc_wms.fragment.SCMakePrepareListFragment;
+import com.uas.jc_wms.global.GloableParams;
 
 import org.json.JSONArray;
 import org.json.JSONException;
@@ -76,6 +77,35 @@ public class DataSourceManager {
         notifyData.NotifyDataChanged(-1);
     }
 
+    /*********
+     * 仓库管理:货物核查:物料库存核查22222222
+     ***************/
+    List<WHMakeMaterialProductNew> makeMaterialItemListNews = null;
+
+    public List<WHMakeMaterialProductNew> getMakeMaterialCheckItemList2() {
+        if (makeMaterialItemListNews == null) {
+            makeMaterialItemListNews = new ArrayList();
+        }
+        return makeMaterialItemListNews;
+    }
+
+    public void setMakeMaterialCheckItemList2(String result) {
+        makeMaterialItemListNews.removeAll(makeMaterialItemListNews);
+        try {
+            JSONObject tmpJson = new JSONObject(result);
+            //            String strTarget = tmpJson.getJSONArray("target").toString();
+            String strTarget = tmpJson.getJSONArray("data").toString();
+            List tmpList = GsonUtil.changeGsonToList(strTarget,
+                    new TypeToken<List<WHMakeMaterialProductNew>>() {
+                    }.getType());
+            makeMaterialItemListNews.addAll(tmpList);
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+        Log.e(TAG, "makeList:" + makeMaterialItemListNews.toString());
+        notifyData.NotifyDataChanged(-1);
+    }
+
     /*********
      * 仓库管理:货物核查Index
      ***************/

+ 26 - 1
app/src/main/java/com/uas/jc_wms/tools/VolleyUtil.java

@@ -346,6 +346,30 @@ public class VolleyUtil {
         PdaApplication.mRequestQueue.add(stringRequest);
     }
 
+    /**
+     * @注释:物料库存核查:获取详细物料数据,增加(料号/条码号)参数
+     */
+    public void requestMakeMaterialCheck2(Context pContext, String pUrl, int method, int pRequestType, final String pProcode,String bar_code, final String pWhcode) {
+        //String  pr_code  //料号   测试数据:2CX-X028M-0002R01
+        //String  bar_code  // 条码号 测试数据:240903B0377
+        //String  wh_code  //仓库编号  测试数据:B0101
+        getVolleyUtil();
+        context = pContext;
+        requestType = pRequestType;
+        //        pUrl = pUrl + "?pr_code=" + pProcode + "&bar_code=" + bar_code + "&wh_code=" + pWhcode;
+        pUrl = pUrl + "?pr_code=" + pProcode + "&wh_code=" + pWhcode;
+        Log.e("VOLLEYURL", pUrl);
+        stringRequest = new StringRequest(Request.Method.GET, pUrl, stringListener, errorListener) {
+            @Override
+            public Map<String, String> getHeaders() throws AuthFailureError {
+                return setCookies();
+            }
+        };
+        stringRequest.setRetryPolicy(new DefaultRetryPolicy(10 * 1000, 0, 1f));
+        PdaApplication.mRequestQueue.add(stringRequest);
+    }
+
+
     /**
      * @注释:尾料还仓
      */
@@ -1512,7 +1536,8 @@ public class VolleyUtil {
      * @note:仓库管理:物料库存核查详细信息
      */
     private void disposeProductDetail(String result) {
-        DataSourceManager.getDataSourceManager().setMakeMaterialCheckItemList(result);
+//        DataSourceManager.getDataSourceManager().setMakeMaterialCheckItemList(result);
+        DataSourceManager.getDataSourceManager().setMakeMaterialCheckItemList2(result);
         volleyFinishListener.onVolleyFinish(SUCCESS_SUCCESS, result);
     }
 

+ 30 - 1
app/src/main/java/com/uas/jc_wms/util/CommonUtil.java

@@ -6,6 +6,7 @@ import android.content.Intent;
 import android.content.pm.PackageInfo;
 import android.content.pm.PackageManager;
 import android.graphics.Color;
+import android.graphics.Paint;
 import android.net.ConnectivityManager;
 import android.net.NetworkInfo;
 import android.os.AsyncTask;
@@ -40,8 +41,8 @@ import android.widget.Toast;
 import com.alibaba.fastjson.JSON;
 import com.android.volley.VolleyError;
 import com.bin.david.form.core.SmartTable;
-import com.bin.david.form.data.CellInfo;
 import com.bin.david.form.core.TableConfig;
+import com.bin.david.form.data.CellInfo;
 import com.bin.david.form.data.format.bg.BaseCellBackgroundFormat;
 import com.bin.david.form.data.style.FontStyle;
 import com.uas.jc_wms.R;
@@ -1016,4 +1017,32 @@ public class CommonUtil {
                     }
                 });
     }
+
+    //表格内容左对齐
+    public static void getLeftDefaultTable(Activity mActivity, SmartTable mSmartTable) {
+        WindowManager wm = mActivity.getWindowManager();
+        int screenWith = wm.getDefaultDisplay().getWidth();
+        FontStyle.setDefaultTextAlign(Paint.Align.LEFT);
+        mSmartTable.getConfig().setMinTableWidth(screenWith)
+                .setShowXSequence(false)
+                .setShowYSequence(false)
+                .setShowTableTitle(false)
+                .setFixedTitle(true)
+                .setVerticalPadding(CommonUtil.dip2px(mActivity, 10))
+                .setColumnTitleVerticalPadding(CommonUtil.dip2px(mActivity, 10))
+                .setHorizontalPadding(CommonUtil.dip2px(mActivity, 10))
+                .setSequenceHorizontalPadding(CommonUtil.dip2px(mActivity, 10))
+                .setColumnTitleHorizontalPadding(CommonUtil.dip2px(mActivity, 10))
+                .setContentStyle(new FontStyle(CommonUtil.sp2px(mActivity, 12), Color.parseColor("#333333")))
+                .setColumnTitleStyle(new FontStyle(CommonUtil.sp2px(mActivity, 14), Color.parseColor("#000000")))
+                .setContentCellBackgroundFormat(new BaseCellBackgroundFormat<CellInfo>() {
+                    @Override
+                    public int getBackGroundColor(CellInfo cellInfo) {
+                        if (cellInfo.row % 2 == 0) {
+                            return ContextCompat.getColor(mActivity, R.color.blue_50);
+                        }
+                        return TableConfig.INVALID_COLOR;
+                    }
+                });
+    }
 }

+ 3 - 0
app/src/main/java/com/uas/jc_wms/util/download/ProgressDownloader.java

@@ -1,5 +1,7 @@
 package com.uas.jc_wms.util.download;
 
+import android.util.Log;
+
 import com.uas.jc_wms.application.PdaApplication;
 import com.uas.jc_wms.tools.SharedPreUtil;
 
@@ -118,6 +120,7 @@ public class ProgressDownloader {
             channelOut = randomAccessFile.getChannel();
             // 内存映射,直接使用RandomAccessFile,是用其seek方法指定下载的起始位置,使用缓存下载,在这里指定下载位置。
             MappedByteBuffer mappedBuffer = channelOut.map(FileChannel.MapMode.READ_WRITE, startsPoint, body.contentLength());
+            Log.e("aaa","文件的总大小是:" + body.contentLength());
             byte[] buffer = new byte[1024];
             int len;
             while ((len = in.read(buffer)) != -1) {

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

@@ -0,0 +1,31 @@
+<?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:orientation="vertical"
+    android:paddingLeft="24dp"
+    android:paddingTop="14dp"
+    android:paddingRight="24dp"
+    android:paddingBottom="14dp">
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal">
+
+        <EditText
+            android:id="@+id/recharge_modify_et"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:background="@drawable/bg_line_edittext"
+            android:inputType="numberDecimal"
+            android:padding="10dp" />
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="条码数量"/>
+
+    </LinearLayout>
+
+</LinearLayout>

+ 41 - 33
app/src/main/res/layout/fragment_barcode_in_collect.xml

@@ -13,39 +13,6 @@
         android:layout_marginTop="@dimen/spacing_big"
         android:stretchColumns="1">
 
-        <TableRow
-            android:id="@+id/material_in_collect_location_tr"
-            android:layout_marginTop="5dp">
-
-            <TextView
-                style="@style/tl_tv_style"
-                android:layout_height="match_parent"
-                android:background="@color/white"
-                android:gravity="center"
-                android:padding="10dp"
-                android:text="仓位"
-                android:textColor="@color/body_text_1"
-                android:textSize="16sp" />
-
-            <com.uas.jc_wms.view.ClearableEditText
-                android:id="@+id/barcode_in_collect_location_et"
-                style="@style/EditTextStyle"
-                android:layout_width="0dp"
-                android:layout_weight="1"
-                android:focusable="true"
-                android:focusableInTouchMode="true"
-                android:hint="请输入仓位"
-                android:textColor="@color/black" />
-            <CheckBox
-                android:id="@+id/ck_isclear"
-                android:layout_gravity="center"
-                android:gravity="center"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="保留仓位"
-                android:checked="true"/>
-        </TableRow>
-
         <TableRow
             android:background="@color/white">
 
@@ -79,6 +46,39 @@
 
         </TableRow>
 
+        <TableRow
+            android:id="@+id/material_in_collect_location_tr"
+            android:layout_marginTop="5dp">
+
+            <TextView
+                style="@style/tl_tv_style"
+                android:layout_height="match_parent"
+                android:background="@color/white"
+                android:gravity="center"
+                android:padding="10dp"
+                android:text="仓位"
+                android:textColor="@color/body_text_1"
+                android:textSize="16sp" />
+
+            <com.uas.jc_wms.view.ClearableEditText
+                android:id="@+id/barcode_in_collect_location_et"
+                style="@style/EditTextStyle"
+                android:layout_width="0dp"
+                android:layout_weight="1"
+                android:focusable="true"
+                android:focusableInTouchMode="true"
+                android:hint="请输入仓位"
+                android:textColor="@color/black" />
+            <CheckBox
+                android:id="@+id/ck_isclear"
+                android:layout_gravity="center"
+                android:gravity="center"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="保留仓位"
+                android:checked="false"/>
+        </TableRow>
+
         <TableRow
             android:id="@+id/material_in_collect_old_tr"
             android:layout_marginTop="5dp"
@@ -251,4 +251,12 @@
                 tools:text='xxxxxxxxxxxx' />
         </LinearLayout>
     </LinearLayout>
+
+    <android.support.v7.widget.RecyclerView
+        android:id="@+id/feeded_rv"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_marginLeft="@dimen/dp_10"
+        android:layout_marginRight="@dimen/dp_10" />
+
 </LinearLayout>

+ 36 - 1
app/src/main/res/layout/fragment_inventory_collect.xml

@@ -91,7 +91,6 @@
             android:src="@drawable/ic_edittext_scan" />
     </LinearLayout>
 
-
     <TextView
         android:id="@+id/inventory_collect_result_tv"
         android:layout_width="match_parent"
@@ -103,4 +102,40 @@
         android:visibility="gone"
         tools:text="采集成功,条码:786528238;数量:2;料号:209837;名称规格:瓶子" />
 
+    <LinearLayout
+        android:layout_marginTop="10dp"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal">
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="单号:"
+            android:textColor="@color/body_text_1"
+            android:textSize="14sp" />
+
+        <TextView
+            android:id="@+id/tv_pi_inoutno"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:textColor="@color/body_text_1"
+            android:textSize="14sp"
+            tools:text="YS1506002" />
+
+        <CheckBox
+            android:id="@+id/stock_data_summary_cb"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:checked="true"
+            android:text="未完成" />
+
+    </LinearLayout>
+
+    <com.bin.david.form.core.SmartTable
+        android:id="@+id/st_data"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent" />
+
 </LinearLayout>

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

@@ -11,6 +11,12 @@
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:orientation="vertical">
+        <Button
+            android:id="@+id/btn_oneprint"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="打印">
+        </Button>
         <!--no use-->
         <LinearLayout
             android:layout_width="match_parent"

+ 0 - 1
app/src/main/res/layout/fragment_material_out_stock_task_multiple.xml

@@ -63,7 +63,6 @@
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_alignParentLeft="true"
-            android:layout_toLeftOf="@id/barcode_generation_select_count_ll"
             android:checked="true"
             android:text="有条码" />
     </RelativeLayout>

+ 224 - 119
app/src/main/res/layout/fragment_outboundlistadd.xml

@@ -5,136 +5,241 @@
     android:orientation="vertical"
     android:background="@color/white">
 
-
-    <LinearLayout
-        android:paddingLeft="@dimen/dp_10"
-        android:orientation="horizontal"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content">
+<!--    <android.support.v4.widget.NestedScrollView-->
+<!--        android:layout_width="match_parent"-->
+<!--        android:layout_height="match_parent"-->
+<!--        >-->
 
         <LinearLayout
-            android:layout_gravity="center"
-            android:layout_weight="1"
             android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:background="@drawable/bg_line_edittext">
-
-<!--            <com.uas.uas_mes_zb_p.view.ClearableEditText-->
-<!--                android:id="@+id/storage_recharge_collect_ets"-->
-<!--                style="@style/EditTextStyle"-->
-<!--                android:layout_weight="1"-->
-<!--                android:background="@null"-->
-<!--                android:focusable="true"-->
-<!--                android:lines="1"-->
-<!--                android:focusableInTouchMode="true"-->
-<!--                android:hint="请采集单号"-->
-<!--                android:imeOptions="actionSend"-->
-<!--                android:textColor="@color/black" />-->
-            <com.uas.jc_wms.view.ClearableEditText
-                android:id="@+id/storage_recharge_collect_ets"
-                style="@style/EditTextStyle"
-                android:layout_weight="1"
-                android:background="@null"
-                android:focusable="true"
-                android:focusableInTouchMode="true"
-                android:hint="请采集条码"
-                android:imeOptions="actionSend"
-                android:textColor="@color/black" />
-
-            <ImageView
-                android:id="@+id/storage_recharge_scan_ivs"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:layout_gravity="center"
-                android:layout_marginRight="10dp"
-                android:clickable="false"
-                android:src="@drawable/ic_edittext_scan" />
-
-        </LinearLayout>
-        <LinearLayout
-            android:layout_gravity="center"
-            android:background="@color/white"
+            android:layout_height="match_parent"
             android:orientation="vertical"
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content">
-            <CheckBox
-                android:layout_gravity="center"
-                android:id="@+id/add_checkbos"
-                android:text="取消采集"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content">
-            </CheckBox>
-            <CheckBox
-                android:layout_gravity="center"
-                android:id="@+id/ck_special_outbound"
-                android:text="特殊出库"
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content">
-            </CheckBox>
-        </LinearLayout>
-    </LinearLayout>
-    <LinearLayout
-        android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:layout_weight="1"
-        android:orientation="vertical"
-        android:background="@color/white"
-        android:padding="5dp">
+            >
 
-        <LinearLayout
-            android:background="@color/white"
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="4dp">
+            <LinearLayout
+                android:paddingLeft="@dimen/dp_10"
+                android:orientation="horizontal"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content">
 
-            <TextView
-                style="@style/tl_tv_style"
-                android:layout_height="match_parent"
-                android:gravity="center"
-                android:minWidth="60dp"
-                android:text="单据编号: "
-                android:textColor="@color/body_text_1"
-                android:textSize="16sp" />
-            <TextView
-                android:id="@+id/tv_documents_code"
-                style="@style/tl_tv_style"
+                <LinearLayout
+                    android:layout_gravity="center"
+                    android:layout_weight="1"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:background="@drawable/bg_line_edittext">
+
+                    <!--            <com.uas.uas_mes_zb_p.view.ClearableEditText-->
+                    <!--                android:id="@+id/storage_recharge_collect_ets"-->
+                    <!--                style="@style/EditTextStyle"-->
+                    <!--                android:layout_weight="1"-->
+                    <!--                android:background="@null"-->
+                    <!--                android:focusable="true"-->
+                    <!--                android:lines="1"-->
+                    <!--                android:focusableInTouchMode="true"-->
+                    <!--                android:hint="请采集单号"-->
+                    <!--                android:imeOptions="actionSend"-->
+                    <!--                android:textColor="@color/black" />-->
+                    <com.uas.jc_wms.view.ClearableEditText
+                        android:id="@+id/storage_recharge_collect_ets"
+                        style="@style/EditTextStyle"
+                        android:layout_weight="1"
+                        android:background="@null"
+                        android:focusable="true"
+                        android:focusableInTouchMode="true"
+                        android:hint="请采集条码"
+                        android:imeOptions="actionSend"
+                        android:textColor="@color/black" />
+
+                    <ImageView
+                        android:id="@+id/storage_recharge_scan_ivs"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center"
+                        android:layout_marginRight="10dp"
+                        android:clickable="false"
+                        android:src="@drawable/ic_edittext_scan" />
+
+                </LinearLayout>
+                <LinearLayout
+                    android:layout_gravity="center"
+                    android:background="@color/white"
+                    android:orientation="vertical"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content">
+                    <CheckBox
+                        android:layout_gravity="center"
+                        android:id="@+id/add_checkbos"
+                        android:text="取消采集"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content">
+                    </CheckBox>
+                    <CheckBox
+                        android:layout_gravity="center"
+                        android:id="@+id/ck_special_outbound"
+                        android:text="特殊出库"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content">
+                    </CheckBox>
+                </LinearLayout>
+            </LinearLayout>
+
+            <LinearLayout
+                android:orientation="horizontal"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:paddingStart="@dimen/dp_10"
+                android:paddingEnd="@dimen/dp_10"
+                android:layout_marginTop="5dp"
+                >
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:background="@drawable/bg_line_edittext"
+                    android:orientation="horizontal"
+                    android:layout_weight="1">
+
+                    <com.uas.jc_wms.view.ClearableEditText
+                        android:id="@+id/cet_pull_out"
+                        style="@style/EditTextStyle"
+                        android:layout_weight="1"
+                        android:background="@null"
+                        android:focusable="true"
+                        android:focusableInTouchMode="true"
+                        android:hint="拨出仓"
+                        android:imeOptions="actionSend"
+                        android:textColor="@color/black" />
+
+                </LinearLayout>
+
+                <ImageView
+                    android:id="@+id/iv_pull_out"
+                    android:layout_width="@dimen/dp_40"
+                    android:layout_height="@dimen/dp_40"
+                    android:layout_gravity="center_vertical"
+                    android:background="@drawable/bg_button"
+                    android:layout_marginStart="@dimen/space_left_5"
+                    android:src="@drawable/search_48"/>
+
+            </LinearLayout>
+
+            <LinearLayout
+                android:orientation="horizontal"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:paddingStart="@dimen/dp_10"
+                android:paddingEnd="@dimen/dp_10"
+                android:layout_marginTop="5dp"
+                android:layout_marginBottom="5dp"
+                >
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:background="@drawable/bg_line_edittext"
+                    android:orientation="horizontal"
+                    android:layout_weight="1">
+
+                    <com.uas.jc_wms.view.ClearableEditText
+                        android:id="@+id/cet_dial_in"
+                        style="@style/EditTextStyle"
+                        android:layout_weight="1"
+                        android:background="@null"
+                        android:focusable="true"
+                        android:focusableInTouchMode="true"
+                        android:hint="拨入仓"
+                        android:imeOptions="actionSend"
+                        android:textColor="@color/black" />
+
+                </LinearLayout>
+
+                <ImageView
+                    android:id="@+id/iv_dial_in"
+                    android:layout_width="@dimen/dp_40"
+                    android:layout_height="@dimen/dp_40"
+                    android:layout_gravity="center_vertical"
+                    android:background="@drawable/bg_button"
+                    android:layout_marginLeft="@dimen/space_left_5"
+                    android:src="@drawable/search_48"/>
+
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
                 android:layout_height="match_parent"
-                android:gravity="center"
-                android:minWidth="60dp"
-                android:text=""
-                android:textColor="@color/body_text_1"
-                android:textSize="16sp" />
+                android:layout_weight="1"
+                android:orientation="vertical"
+                android:background="@color/white"
+                android:padding="5dp">
+
+                <LinearLayout
+                    android:background="@color/white"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="4dp">
+
+                    <TextView
+                        style="@style/tl_tv_style"
+                        android:layout_height="match_parent"
+                        android:gravity="center"
+                        android:minWidth="60dp"
+                        android:text="单据编号: "
+                        android:textColor="@color/body_text_1"
+                        android:textSize="16sp" />
+                    <TextView
+                        android:id="@+id/tv_documents_code"
+                        style="@style/tl_tv_style"
+                        android:layout_height="match_parent"
+                        android:gravity="center"
+                        android:minWidth="60dp"
+                        android:text=""
+                        android:textColor="@color/body_text_1"
+                        android:textSize="16sp" />
+
+                </LinearLayout>
+
+
+                <com.bin.david.form.core.SmartTable
+                    android:layout_marginTop="@dimen/textsize_20"
+                    android:layout_marginBottom="@dimen/textsize_20"
+                    android:id="@+id/jlt_storage_in_filter_list_sts"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent" />
+
+            </LinearLayout>
+
+            <LinearLayout
+                android:background="@color/white"
+                android:paddingLeft="@dimen/sp_16"
+                android:paddingRight="@dimen/sp_16"
+                android:orientation="horizontal"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content">
+                <Button
+                    android:id="@+id/jlt_storage_in_generate_detailed_btn"
+                    style="@style/ButtonStyle"
+                    android:layout_width="0dp"
+                    android:layout_margin="5dp"
+                    android:layout_weight="1"
+                    android:text="生成明细"
+                    />
+
+                <Button
+                    android:id="@+id/bt_guozhang"
+                    style="@style/ButtonStyle"
+                    android:layout_width="0dp"
+                    android:layout_margin="5dp"
+                    android:layout_weight="1"
+                    android:text="过账"
+                    />
+
+            </LinearLayout>
 
         </LinearLayout>
 
+<!--    </android.support.v4.widget.NestedScrollView>-->
 
-        <com.bin.david.form.core.SmartTable
-            android:layout_marginTop="@dimen/textsize_20"
-            android:layout_marginBottom="@dimen/textsize_20"
-            android:id="@+id/jlt_storage_in_filter_list_sts"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent" />
-
-    </LinearLayout>
-
-
-
-    <LinearLayout
-        android:background="@color/white"
-        android:paddingLeft="@dimen/sp_16"
-        android:paddingRight="@dimen/sp_16"
-        android:orientation="horizontal"
-        android:layout_width="match_parent"
-        android:layout_height="wrap_content">
-        <Button
-            android:id="@+id/jlt_storage_in_generate_detailed_btn"
-            style="@style/ButtonStyle"
-            android:layout_width="0dp"
-            android:layout_margin="5dp"
-            android:layout_weight="1"
-            android:text="生成明细"
-            />
 
-    </LinearLayout>
 
 </LinearLayout>

+ 580 - 0
app/src/main/res/layout/fragment_two_storage_iqc_in.xml

@@ -0,0 +1,580 @@
+<?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="match_parent"
+    android:orientation="vertical"
+    android:padding="16dp">
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:background="@drawable/bg_line_edittext">
+
+        <com.uas.jc_wms.view.ClearableEditText
+            android:id="@+id/storage_iqc_collect_et"
+            style="@style/EditTextStyle"
+            android:layout_weight="1"
+            android:background="@null"
+            android:focusable="true"
+            android:focusableInTouchMode="true"
+            android:hint="请采集物料最小包装条码/箱号"
+            android:imeOptions="actionSend"
+            android:textColor="@color/black" />
+
+        <ImageView
+            android:id="@+id/storage_iqc_scan_iv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center"
+            android:layout_marginRight="10dp"
+            android:clickable="false"
+            android:src="@drawable/ic_edittext_scan" />
+    </LinearLayout>
+    <ScrollView
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+        <FrameLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:layout_marginTop="12dp">
+
+            <LinearLayout
+                android:id="@+id/storage_iqc_in_data_ll"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:orientation="vertical">
+                <LinearLayout
+                    android:layout_marginTop="5dp"
+                    android:orientation="horizontal"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content">
+                    <TextView
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="1"
+                        android:textSize="14sp"
+                        android:text="条码号:" />
+
+                    <TextView
+                        android:id="@+id/tv_barcode"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="3"
+                        android:textColor="@color/black"
+                        android:textSize="14sp"
+                        android:text=" " />
+                </LinearLayout>
+                <LinearLayout
+                    android:layout_marginTop="5dp"
+                    android:orientation="horizontal"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content">
+                    <TextView
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="1"
+                        android:textSize="14sp"
+                        android:text="检验单号:" />
+
+                    <TextView
+                        android:id="@+id/tv_veCode"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="3"
+                        android:textColor="@color/black"
+                        android:textSize="14sp"
+                        android:text=" " />
+                </LinearLayout>
+                <LinearLayout
+                    android:layout_marginTop="5dp"
+                    android:orientation="horizontal"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content">
+                    <TextView
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="1"
+                        android:textSize="14sp"
+                        android:text="收料单号:" />
+
+                    <TextView
+                        android:id="@+id/tv_vadCode"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="3"
+                        android:textColor="@color/black"
+                        android:textSize="14sp"
+                        android:text=" " />
+                </LinearLayout>
+                <LinearLayout
+                    android:layout_marginTop="5dp"
+                    android:orientation="horizontal"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content">
+                    <TextView
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="1"
+                        android:textSize="14sp"
+                        android:text="物料编号:" />
+
+                    <TextView
+                        android:id="@+id/tv_prodcode"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="3"
+                        android:textColor="@color/black"
+                        android:textSize="14sp"
+                        android:text=" " />
+                </LinearLayout>
+                <LinearLayout
+                    android:layout_marginTop="5dp"
+                    android:orientation="horizontal"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content">
+                    <TextView
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="1"
+                        android:textSize="14sp"
+                        android:text="物料名称:" />
+
+                    <TextView
+                        android:id="@+id/tv_prDetail"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="3"
+                        android:textColor="@color/black"
+                        android:textSize="14sp"
+                        android:text=" " />
+                </LinearLayout>
+                <LinearLayout
+                    android:layout_marginTop="5dp"
+                    android:orientation="horizontal"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content">
+                    <TextView
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="1"
+                        android:textSize="14sp"
+                        android:text="物料规格:" />
+
+                    <TextView
+                        android:id="@+id/tv_prSpec"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="3"
+                        android:textColor="@color/black"
+                        android:textSize="14sp"
+                        android:text=" " />
+                </LinearLayout>
+                <LinearLayout
+                    android:layout_marginTop="5dp"
+                    android:orientation="horizontal"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content">
+                    <TextView
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="1"
+                        android:textSize="14sp"
+                        android:text="采购单:" />
+
+                    <TextView
+                        android:id="@+id/tv_veOrderCode"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="3"
+                        android:textColor="@color/black"
+                        android:textSize="14sp"
+                        android:text=" " />
+                </LinearLayout>
+                <LinearLayout
+                    android:layout_marginTop="5dp"
+                    android:orientation="horizontal"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content">
+                    <TextView
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="1"
+                        android:textSize="14sp"
+                        android:text="序号:" />
+
+                    <TextView
+                        android:id="@+id/tv_veOrderNo"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="3"
+                        android:textColor="@color/black"
+                        android:textSize="14sp"
+                        android:text=" " />
+                </LinearLayout>
+                <LinearLayout
+                    android:layout_marginTop="5dp"
+                    android:orientation="horizontal"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content">
+                    <TextView
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="1"
+                        android:textSize="14sp"
+                        android:text="供应商:" />
+
+                    <TextView
+                        android:id="@+id/tv_veVendName"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="3"
+                        android:textColor="@color/black"
+                        android:textSize="14sp"
+                        android:text=" " />
+                </LinearLayout>
+                <LinearLayout
+                    android:layout_marginTop="5dp"
+                    android:orientation="horizontal"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content">
+                    <TextView
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="1"
+                        android:textSize="14sp"
+                        android:text="检验方式:" />
+
+                    <TextView
+                        android:id="@+id/tv_testMethod"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="3"
+                        android:textColor="@color/black"
+                        android:textSize="14sp"
+                        android:text=" " />
+                </LinearLayout>
+                <LinearLayout
+                    android:layout_marginTop="5dp"
+                    android:orientation="horizontal"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content">
+                    <TextView
+                        android:layout_gravity="center"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="1"
+                        android:textSize="14sp"
+                        android:text="检验结果:" />
+                    <RadioGroup
+                        android:id="@+id/rg_yesorno"
+                        android:orientation="horizontal"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="3">
+                        <RadioButton
+                            android:id="@+id/rb_yse"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:textSize="14sp"
+                            android:checked="true"
+                            android:text="合格">
+                        </RadioButton>
+                        <RadioButton
+                            android:id="@+id/rb_no"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:textSize="14sp"
+                            android:text="不合格">
+                        </RadioButton>
+                    </RadioGroup>
+                    <TextView
+                        android:id="@+id/tv_testResult"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="3"
+                        android:textColor="@color/black"
+                        android:textSize="14sp"
+                        android:text=" "
+                        android:visibility="gone"/>
+                </LinearLayout>
+                <LinearLayout
+                    android:layout_marginTop="5dp"
+                    android:orientation="horizontal"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content">
+                    <TextView
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="1"
+                        android:textSize="14sp"
+                        android:text="收料数:" />
+
+                    <TextView
+                        android:id="@+id/tv_vadQty"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="3"
+                        android:textColor="@color/black"
+                        android:textSize="14sp"
+                        android:text=" " />
+                </LinearLayout>
+                <LinearLayout
+                    android:layout_marginTop="5dp"
+                    android:orientation="horizontal"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content">
+                    <TextView
+                        android:layout_gravity="center"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="1"
+                        android:textSize="14sp"
+                        android:text="送检数:" />
+
+
+                    <TextView
+                        android:id="@+id/tv_checkQty"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="3"
+                        android:textColor="@color/black"
+                        android:textSize="14sp"
+                        android:text=" " />
+                </LinearLayout>
+                <LinearLayout
+                    android:layout_marginTop="5dp"
+                    android:orientation="horizontal"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content">
+                    <TextView
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="1"
+                        android:textSize="14sp"
+                        android:text="合格数:" />
+
+                    <TextView
+                        android:id="@+id/tv_mOkQty"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="3"
+                        android:textColor="@color/black"
+                        android:textSize="14sp"
+                        android:text=" " />
+                </LinearLayout>
+                <LinearLayout
+                    android:layout_marginTop="5dp"
+                    android:orientation="horizontal"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content">
+                    <TextView
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="1"
+                        android:textSize="14sp"
+                        android:text="不合格数:" />
+
+                    <TextView
+                        android:id="@+id/tv_ngQty"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="3"
+                        android:textColor="@color/black"
+                        android:textSize="14sp"
+                        android:text=" " />
+                </LinearLayout>
+                <LinearLayout
+                    android:layout_marginTop="5dp"
+                    android:orientation="horizontal"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content">
+                    <TextView
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="1"
+                        android:textSize="14sp"
+                        android:text="状态:" />
+
+                    <TextView
+                        android:id="@+id/tv_status"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_marginLeft="4dp"
+                        android:layout_weight="3"
+                        android:textColor="@color/black"
+                        android:textSize="14sp"
+                        android:text=" " />
+                </LinearLayout>
+
+                <ListView
+                    android:visibility="gone"
+                    android:id="@+id/storage_iqc_in_data_lv"
+                    android:layout_width="match_parent"
+                    android:layout_height="0dp"
+                    android:layout_weight="1"
+                    android:divider="@null" />
+                <LinearLayout
+                    android:visibility="gone"
+                    android:layout_width="match_parent"
+                    android:layout_height="36dp"
+                    android:gravity="center_vertical"
+                    android:orientation="horizontal"
+                    android:paddingBottom="3dp"
+                    android:paddingLeft="12dp"
+                    android:paddingRight="15dp"
+                    android:paddingTop="3dp">
+
+                    <TextView
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="2"
+                        android:text="良品仓:"
+                        android:textColor="@color/black"
+                        android:textSize="14sp" />
+
+                    <RelativeLayout
+                        android:layout_width="0dp"
+                        android:layout_height="match_parent"
+                        android:layout_weight="5">
+
+                        <TextView
+                            android:id="@+id/storage_iqc_good_warehouse_et"
+                            android:layout_width="match_parent"
+                            android:layout_height="match_parent"
+                            android:background="@drawable/bg_line_edittext"
+                            android:gravity="center_vertical"
+                            android:hint="请选择"
+                            android:paddingLeft="10dp"
+                            android:paddingRight="10dp"
+                            android:textSize="14sp" />
+
+                        <ImageView
+                            android:id="@+id/storage_iqc_good_warehouse_iv"
+                            android:layout_width="36dp"
+                            android:layout_height="match_parent"
+                            android:layout_alignParentEnd="true"
+                            android:layout_alignParentRight="true"
+                            android:layout_centerVertical="true"
+                            android:paddingRight="4dp"
+                            android:scaleType="center"
+                            android:src="@drawable/ic_menu_retract" />
+                    </RelativeLayout>
+                </LinearLayout>
+
+                <LinearLayout
+                    android:visibility="gone"
+                    android:layout_width="match_parent"
+                    android:layout_height="36dp"
+                    android:gravity="center_vertical"
+                    android:orientation="horizontal"
+                    android:paddingBottom="3dp"
+                    android:paddingLeft="12dp"
+                    android:paddingRight="15dp"
+                    android:paddingTop="3dp">
+
+                    <TextView
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="2"
+                        android:text="不良品仓:"
+                        android:textColor="@color/black"
+                        android:textSize="14sp" />
+
+                    <RelativeLayout
+                        android:layout_width="0dp"
+                        android:layout_height="match_parent"
+                        android:layout_weight="5">
+
+                        <TextView
+                            android:id="@+id/storage_iqc_bad_warehouse_et"
+                            android:layout_width="match_parent"
+                            android:layout_height="match_parent"
+                            android:background="@drawable/bg_line_edittext"
+                            android:gravity="center_vertical"
+                            android:hint="请选择"
+                            android:paddingLeft="10dp"
+                            android:paddingRight="10dp"
+                            android:textSize="14sp" />
+
+                        <ImageView
+                            android:id="@+id/storage_iqc_bad_warehouse_iv"
+                            android:layout_width="36dp"
+                            android:layout_height="match_parent"
+                            android:layout_alignParentEnd="true"
+                            android:layout_alignParentRight="true"
+                            android:layout_centerVertical="true"
+                            android:paddingRight="4dp"
+                            android:scaleType="center"
+                            android:src="@drawable/ic_menu_retract"
+                            android:visibility="gone" />
+                    </RelativeLayout>
+                </LinearLayout>
+                <Button
+                    android:layout_marginBottom="@dimen/dp_10"
+                    android:id="@+id/btn_shen"
+                    style="@style/ButtonStyle"
+                    android:layout_marginTop="10dp"
+                    android:text="审核" />
+
+
+                <Button
+                    android:id="@+id/storage_iqc_in_commit_btn"
+                    style="@style/ButtonStyle"
+                    android:layout_marginTop="10dp"
+                    android:text="入库"
+                    android:visibility="gone"/>
+            </LinearLayout>
+
+            <ScrollView
+                android:id="@+id/storage_iqc_in_error_sv"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:background="@color/white"
+                android:visibility="gone">
+
+                <TextView
+                    android:id="@+id/storage_iqc_in_error_tv"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:padding="10dp"
+                    android:textSize="16sp"
+                    android:text="错误信息" />
+            </ScrollView>
+        </FrameLayout>
+    </ScrollView>
+
+
+</LinearLayout>

+ 94 - 0
app/src/main/res/layout/fragment_whcheck_makematerial_new.xml

@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--仓库管理:物料库存核查-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical" android:layout_width="match_parent"
+    android:layout_height="match_parent">
+    <!--搜索-->
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="@dimen/space_top_8"
+        android:layout_marginLeft="@dimen/space_left_8"
+        android:layout_marginRight="@dimen/space_right_8"
+        android:orientation="vertical"
+        >
+
+        <com.uas.jc_wms.view.ClearableEditText
+            android:id="@+id/et_prodcode_whmm"
+            android:hint="条码号"
+            style="@style/PopWinEditTextStyle"
+            android:layout_weight="2"/>
+
+        <com.uas.jc_wms.view.ClearableEditText
+            android:visibility="gone"
+            android:id="@+id/cet_item_number"
+            android:hint="料号"
+            style="@style/PopWinEditTextStyle"
+            android:layout_marginTop="8dp"
+            android:layout_weight="2"/>
+
+        <com.uas.jc_wms.view.ClearableEditText
+            android:id="@+id/et_whcode_whmm"
+            android:layout_marginTop="8dp"
+            style="@style/PopWinEditTextStyle"
+            android:hint="仓位"
+            android:layout_weight="3"/>
+
+        <TextView
+            android:id="@+id/btn_search_whmm"
+            android:layout_marginTop="8dp"
+            style="@style/PopWinButtonStyle"
+            android:layout_weight="4"
+            android:background="@drawable/search_16"/>
+    </LinearLayout>
+    <!--中部-->
+    <TableLayout
+        android:layout_marginTop="@dimen/space_top_8"
+        style="@style/CardWhiteStyle_wrapheight">
+
+        <TableRow>
+            <TextView
+                style="@style/CardContentTextStyle"
+                android:text="@string/text_fragment_whcheck_pr_detail"/>
+            <TextView
+                android:id="@+id/tv_pr_detail"
+                style="@style/CardContentTextStyle"
+                android:textColor="@color/text_search"/>
+        </TableRow>
+        <TableRow>
+            <TextView
+                style="@style/CardContentTextStyle"
+                android:text="@string/text_fragment_whcheck_pr_spec" />
+            <TextView
+                android:id="@+id/tv_pr_spec"
+                style="@style/CardContentTextStyle"
+                android:textColor="@color/text_search" />
+        </TableRow>
+    </TableLayout>
+
+    <com.bin.david.form.core.SmartTable
+        android:id="@+id/st_smart_table"
+        android:layout_marginStart="10dp"
+        android:layout_marginEnd="10dp"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent" />
+
+    <LinearLayout
+        android:visibility="gone"
+        style="@style/CardWhiteSytle_fillheight"
+        android:background="@color/white">
+        <include layout="@layout/item_list_table_new"/>
+        <!--信息列表-->
+        <ScrollView
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:fillViewport="true"
+            android:background="@color/transparent">
+            <ListView
+                android:id="@+id/lv_detail_whmm"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:background="@color/transparent"/>
+        </ScrollView>
+    </LinearLayout>
+</LinearLayout>

+ 13 - 0
app/src/main/res/layout/item_list_table.xml

@@ -42,4 +42,17 @@
         android:layout_width="0.5px"
         android:layout_height="fill_parent"
         android:background="#B8B8B8" />
+    <TextView
+        android:id="@+id/tv_table_4"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="3dp"
+        android:layout_marginBottom="3dp"
+        android:layout_marginLeft="@dimen/space_left_inner"
+        android:layout_marginRight="@dimen/space_right_inner"
+        android:layout_weight="1"
+        android:textStyle="bold"
+        android:gravity="center_vertical"
+        android:textSize="@dimen/space_top_line_15"
+        android:text="DC" />
 </LinearLayout>

+ 58 - 0
app/src/main/res/layout/item_list_table_new.xml

@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?><!--表格ListItem:三列-->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:background="@color/button_normal"
+    android:orientation="horizontal">
+
+    <View
+        android:layout_width="0.5px"
+        android:layout_height="fill_parent"
+        android:background="#B8B8B8" />
+    <!--第一列-->
+    <TextView
+        android:id="@+id/tv_table_1"
+        style="@style/CardContentTextStyle"
+        android:layout_weight="1"
+        android:text="仓库" />
+
+    <View
+        android:layout_width="0.5px"
+        android:layout_height="fill_parent"
+        android:background="#B8B8B8" />
+    <!--第二列-->
+    <TextView
+        android:id="@+id/tv_table_2"
+        style="@style/CardContentTextStyle"
+        android:layout_weight="1"
+        android:text="储位" />
+
+    <View
+        android:layout_width="0.5px"
+        android:layout_height="fill_parent"
+        android:background="#B8B8B8" />
+    <!--第三列-->
+    <TextView
+        android:id="@+id/tv_table_3"
+        style="@style/CardContentTextStyle"
+        android:layout_weight="1"
+        android:text="数量" />
+
+    <View
+        android:layout_width="0.5px"
+        android:layout_height="fill_parent"
+        android:background="#B8B8B8" />
+    <TextView
+        android:id="@+id/tv_table_4"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="3dp"
+        android:layout_marginBottom="3dp"
+        android:layout_marginLeft="@dimen/space_left_inner"
+        android:layout_marginRight="@dimen/space_right_inner"
+        android:layout_weight="1"
+        android:textStyle="bold"
+        android:gravity="center_vertical"
+        android:textSize="@dimen/space_top_line_15"
+        android:text="DC" />
+</LinearLayout>

+ 0 - 1
app/src/main/res/layout/pop_material_out_menu.xml

@@ -73,7 +73,6 @@
         android:layout_marginLeft="10dp"
         android:layout_marginRight="10dp"
         android:background="@color/transparent"
-        android:visibility="gone"
         android:text="单据过账"
         android:textSize="@dimen/app_text_size_body_2" />
 

+ 37 - 0
app/src/main/res/layout/pop_whcode_dlert_dialog.xml

@@ -0,0 +1,37 @@
+<?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:layout_margin="10dp"
+    android:orientation="vertical"
+    >
+
+
+    <com.uas.jc_wms.view.ClearableEditText
+        android:id="@+id/cet_whcode"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:padding="10dp"
+        android:background="@drawable/bg_line_edittext"
+        android:focusable="true"
+        android:selectAllOnFocus="true"
+        android:hint="请输入仓库编号"
+        android:imeOptions="actionSend"
+        android:textColor="@color/black"
+        android:textSize="14sp"
+        />
+
+    <Button
+        android:layout_marginTop="10dp"
+        android:id="@+id/bt_ok"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:background="@color/button_normal"
+        android:paddingTop="@dimen/space_top_8"
+        android:paddingBottom="@dimen/space_bottom_8"
+        android:text="确定"
+        android:textSize="14sp"
+        />
+
+</LinearLayout>

+ 67 - 0
app/src/main/res/layout/recyclerview_item2.xml

@@ -0,0 +1,67 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:id="@+id/ll_layout"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="vertical">
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal">
+
+        <CheckBox
+            android:id="@+id/select_checkbox"
+            android:layout_width="@dimen/dp_40"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center"
+            />
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center"
+            android:orientation="vertical">
+
+            <TextView
+                android:id="@+id/tv_liaocode"
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:gravity="start"
+                android:text="11234123ee21234er"/>
+
+            <TextView
+                android:id="@+id/tv_liaotetall"
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:gravity="start"
+                android:text="11234123ee21234er"/>
+
+            <TextView
+                android:id="@+id/tv_liaospec"
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:gravity="start"
+                android:text="11234123ee21234er"/>
+            <TextView
+                android:id="@+id/tv_liaospec3"
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:gravity="start"
+                android:text="11234123ee21234er"/>
+
+        </LinearLayout>
+
+    </LinearLayout>
+
+
+</LinearLayout>

+ 3 - 0
app/src/main/res/values/strings.xml

@@ -430,4 +430,7 @@
         <item>重新采集</item>
         <item>未提交列表</item>
     </string-array>
+
+    <string name="List_of_outbound_orders">出库单列表</string>
+
 </resources>

+ 2 - 2
build.gradle

@@ -55,8 +55,8 @@ ext {
             targetSdkVersion : 28,
             compileSdkVersion: 28,
             buildToolsVersion: "28.0.3",
-            versionCode      : 37,
-            versionName      : "v2.4.3"
+            versionCode      : 36,
+            versionName      : "v2.5.0"
     ]
 
     depsVersion = [