Sfoglia il codice sorgente

添加不良采集+拆批+跳站+合批模块

shuij 4 anni fa
parent
commit
f98c171092
36 ha cambiato i file con 3759 aggiunte e 164 eliminazioni
  1. 98 9
      app/src/main/java/com/uas/gdstorage/activity/CommonSeclecActivity.java
  2. 20 0
      app/src/main/java/com/uas/gdstorage/activity/FunctionActivity.java
  3. 10 11
      app/src/main/java/com/uas/gdstorage/activity/IndexActivity.java
  4. 1 1
      app/src/main/java/com/uas/gdstorage/activity/MainActivity.java
  5. 38 0
      app/src/main/java/com/uas/gdstorage/adapter/HepiAdapter.java
  6. 31 0
      app/src/main/java/com/uas/gdstorage/adapter/ReportDetailAdapter.java
  7. 62 0
      app/src/main/java/com/uas/gdstorage/bean/HepiBean.java
  8. 52 0
      app/src/main/java/com/uas/gdstorage/bean/ReportDetailBean.java
  9. 326 0
      app/src/main/java/com/uas/gdstorage/fragment/CaiPiFragment.java
  10. 46 1
      app/src/main/java/com/uas/gdstorage/fragment/ComeInSiteFragment.java
  11. 7 10
      app/src/main/java/com/uas/gdstorage/fragment/GdMaterialInFragment.java
  12. 58 4
      app/src/main/java/com/uas/gdstorage/fragment/GdTimeReportFragment.java
  13. 42 3
      app/src/main/java/com/uas/gdstorage/fragment/GdWorkSwitchFragment.java
  14. 420 0
      app/src/main/java/com/uas/gdstorage/fragment/HePiFragment.java
  15. 352 0
      app/src/main/java/com/uas/gdstorage/fragment/JumpSiteFragment.java
  16. 430 0
      app/src/main/java/com/uas/gdstorage/fragment/NoGoodListFragment.java
  17. 399 0
      app/src/main/java/com/uas/gdstorage/fragment/NotGoodCaiJiFragment.java
  18. 27 16
      app/src/main/java/com/uas/gdstorage/fragment/ReportDetailFragment.java
  19. 42 1
      app/src/main/java/com/uas/gdstorage/fragment/WorkOrderSearchFragment.java
  20. 92 4
      app/src/main/java/com/uas/gdstorage/global/GloableParams.java
  21. 27 0
      app/src/main/java/com/uas/gdstorage/util/NullUtil.java
  22. 222 0
      app/src/main/java/com/uas/gdstorage/util/NumberUtil.java
  23. 6 0
      app/src/main/res/drawable/bg_edittext_grey.xml
  24. 6 0
      app/src/main/res/drawable/bg_edittext_unenable.xml
  25. 4 0
      app/src/main/res/layout/activity_index.xml
  26. 2 1
      app/src/main/res/layout/feeding_edit_pup.xml
  27. 131 0
      app/src/main/res/layout/fragment_caipi.xml
  28. 173 0
      app/src/main/res/layout/fragment_hepi.xml
  29. 139 0
      app/src/main/res/layout/fragment_jump_site.xml
  30. 36 0
      app/src/main/res/layout/fragment_no_good_list.xml
  31. 162 0
      app/src/main/res/layout/fragment_not_good_caiji.xml
  32. 6 103
      app/src/main/res/layout/fragment_report_detail.xml
  33. 144 0
      app/src/main/res/layout/item_has_caiji.xml
  34. 33 0
      app/src/main/res/layout/item_hepi.xml
  35. 113 0
      app/src/main/res/layout/item_report_detail.xml
  36. 2 0
      app/src/main/res/values/color.xml

+ 98 - 9
app/src/main/java/com/uas/gdstorage/activity/CommonSeclecActivity.java

@@ -53,7 +53,6 @@ public class CommonSeclecActivity extends BaseActivity implements View.OnClickLi
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
-
         LogUtil.i(Tag,"onCreate");
     }
 
@@ -114,11 +113,10 @@ public class CommonSeclecActivity extends BaseActivity implements View.OnClickLi
             @Override
             public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
                 ComDataBean bean = myAdapter.getBeanByPositon(position);
-                String itemStr = bean.getItemName();
-//                CommonUtil.toastNoRepeat(CommonSeclecActivity.this,itemStr);
-
+                String itemCode = bean.getItemName();
+                String itemName= bean.getItemremark();
                 Intent resultIntent = new Intent();
-                resultIntent.putExtra("ITEM_DATA",itemStr);
+                resultIntent.putExtra("ITEM_DATA",itemCode+"-"+itemName);
                 setResult(1847,resultIntent);
                 finish();
             }
@@ -127,23 +125,114 @@ public class CommonSeclecActivity extends BaseActivity implements View.OnClickLi
 
     @Override
     protected void initDatas() {
-
         Intent c_intent = getIntent();
         String title = c_intent.getStringExtra("title");
         type = c_intent.getIntExtra("type",-1);
         String sc_code = c_intent.getStringExtra("sc_code");
+        String cr_code=c_intent.getStringExtra("cr_code");//途程编号
         setTitle(title);
-
         switch (type){
             case 1:
-                getSC_CODEData();break;//获取岗位资源列表
+                getSC_CODEData();
+                break;//获取岗位资源列表
             case 2:
-                getWorkorderData(sc_code);break;//获取工单列表
+                getWorkorderData(sc_code);//获取工单列表
+                break;
+            case 3:
+                getNoGoodCode(sc_code);//获取不良代码列表
+                break;
+            case 4:
+                getJumpSiteList(sc_code,cr_code);//获取跳站工序列表
+                break;
                 default:
                     break;
         }
     }
 
+    private void getJumpSiteList(String sc_code, String cr_code) {
+        progressDialog.show();
+        VollyRequest.getInstance().stringRequest(mStringRequest,
+                new HttpParams.Builder()
+                        .url(GloableParams.ADDRESS_GET_JUMP_STEP)
+                        .method(Request.Method.GET)
+                        .tag(Tag + "getJumpStep")
+                        .flag(0)
+                        .addParam("sc_code",sc_code)
+                        .addParam("cr_code",cr_code)
+                        .build(), new HttpCallback() {
+
+                    @Override
+                    public void onSuccess(int flag, Object o) throws Exception {
+                        progressDialog.dismiss();
+                        Boolean isSuccess = FastjsonUtil.getBoolean(o.toString(),"success");
+                        if (isSuccess){
+                            JSONArray dataArray = FastjsonUtil.getJSONArray(o.toString(),"data");
+                            if (dataArray == null || dataArray.size() == 0){
+                                CommonUtil.toastNoRepeat(CommonSeclecActivity.this,"未搜索到匹配数据");
+                            }
+                            for(Object index:dataArray){
+                                JSONObject data = (JSONObject) index;
+                                ComDataBean bean = new ComDataBean();
+                                bean.setItemName(data.getString("CD_STEPCODE"));
+                                bean.setItemremark(data.getString("CD_STEPNAME") == null ? "(-)" : "("+data.getString("CD_STEPNAME")+")");
+                                mList.add(bean);
+                            }
+                            myAdapter.setmList(mList);
+                            myAdapter.notifyDataSetChanged();
+                        }
+                    }
+
+                    @Override
+                    public void onFail(int flag, String failStr) throws Exception {
+                        CommonUtil.toastNoRepeat(CommonSeclecActivity.this, failStr);
+                        progressDialog.dismiss();
+                    }
+
+                });
+
+    }
+
+    private void getNoGoodCode(String sc_code) {
+        progressDialog.show();
+        VollyRequest.getInstance().stringRequest(mStringRequest,
+                new HttpParams.Builder()
+                        .url(GloableParams.ADDRESS_GET_BAD_CODE_LIST)
+                        .method(Request.Method.GET)
+                        .tag(Tag + "getBadCodeList")
+                        .flag(0)
+                        .addParam("sc_code", sc_code)
+                        .build(), new HttpCallback() {
+
+                    @Override
+                    public void onSuccess(int flag, Object o) throws Exception {
+                        progressDialog.dismiss();
+                        Boolean isSuccess = FastjsonUtil.getBoolean(o.toString(),"success");
+                        if (isSuccess){
+                            JSONArray dataArray = FastjsonUtil.getJSONArray(o.toString(),"data");
+                            if (dataArray == null || dataArray.size() == 0){
+                                CommonUtil.toastNoRepeat(CommonSeclecActivity.this,"未搜索到匹配数据");
+                            }
+                            for(Object index:dataArray){
+                                JSONObject data = (JSONObject) index;
+                                ComDataBean bean = new ComDataBean();
+                                bean.setItemName(data.getString("BC_CODE"));
+                                bean.setItemremark(data.getString("BC_NAME") == null ? "(-)" : "("+data.getString("BC_NAME")+")");
+                                mList.add(bean);
+                            }
+                            myAdapter.setmList(mList);
+                            myAdapter.notifyDataSetChanged();
+                        }
+                    }
+
+                    @Override
+                    public void onFail(int flag, String failStr) throws Exception {
+                        CommonUtil.toastNoRepeat(CommonSeclecActivity.this, failStr);
+                        progressDialog.dismiss();
+                    }
+
+                });
+    }
+
     private void getWorkorderData(String scCode) {
         progressDialog.show();
         VollyRequest.getInstance().stringRequest(mStringRequest,

+ 20 - 0
app/src/main/java/com/uas/gdstorage/activity/FunctionActivity.java

@@ -14,12 +14,16 @@ import android.widget.TextView;
 import com.android.volley.toolbox.StringRequest;
 import com.uas.gdstorage.R;
 import com.uas.gdstorage.fragment.BaseFragment;
+import com.uas.gdstorage.fragment.CaiPiFragment;
 import com.uas.gdstorage.fragment.ChargingSummaryFragment;
 import com.uas.gdstorage.fragment.ComeInSiteFragment;
 import com.uas.gdstorage.fragment.GdMaterialInFragment;
 import com.uas.gdstorage.fragment.GdTimeReportFragment;
 import com.uas.gdstorage.fragment.GdWorkSwitchFragment;
+import com.uas.gdstorage.fragment.HePiFragment;
 import com.uas.gdstorage.fragment.IndexSettingFragment;
+import com.uas.gdstorage.fragment.JumpSiteFragment;
+import com.uas.gdstorage.fragment.NotGoodCaiJiFragment;
 import com.uas.gdstorage.fragment.QualityManageFragment;
 import com.uas.gdstorage.fragment.ReportDetailFragment;
 import com.uas.gdstorage.fragment.StepReceiveFragment;
@@ -118,6 +122,22 @@ public class FunctionActivity extends BaseActivity implements View.OnClickListen
                 case GloableParams.GRIDNAME_STEP_RECEIVE:
                     mFragment = new StepReceiveFragment();
                     break;
+                //不良采集
+                case GloableParams.GRIDNAME_BULIANG_CAIJI:
+                    mFragment = new NotGoodCaiJiFragment();
+                    break;
+                //拆批
+                case GloableParams.GRIDNAME_CHAI_PI:
+                    mFragment = new CaiPiFragment();
+                    break;
+                //跳站
+                case GloableParams.GRIDNAME_TIAO_ZHAN:
+                    mFragment = new JumpSiteFragment();
+                    break;
+                //合批
+                case GloableParams.GRIDNAME_HE_PI:
+                    mFragment = new HePiFragment();
+                    break;
                 case GloableParams.HOME_QUALITY_MANAGE:
                     mFragment = new QualityManageFragment();
                     break;

+ 10 - 11
app/src/main/java/com/uas/gdstorage/activity/IndexActivity.java

@@ -129,8 +129,12 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
                 closeExitPopupWindow();
             }
         });
-
         mFragment = new WorkOrderSearchFragment();
+        sc_code=SharedPreUtil.getString(this,Constants.FLAG.GANG_WEI_SOURCE_CODE,"");
+        sc_name=SharedPreUtil.getString(this,Constants.FLAG.GANG_WEI_SOURCE_NAME,"");
+        if (!StringUtil.isEmpty(sc_code)) {
+            handleCode(sc_code, true);
+        }
     }
 
     @Override
@@ -385,25 +389,18 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
                 sc_name = "-";
             }
             sc_name = "(" + sc_name + ")";
-
             mScName.setText(sc_name);
             SharedPreUtil.saveString(this,Constants.FLAG.GANG_WEI_SOURCE_NAME,sc_name);
         } else {
             CommonUtil.toastNoRepeat(this, "岗位资源数据为空");
             return;
         }
-//        if (!StringUtil.isEmpty(dataObject.getString("LI_NAME"))) {
-//            mFeeding.setText(dataObject.getString("LI_NAME"));
-//        } else {
-//            mFeeding.setText("-");
-//        }
         if (!StringUtil.isEmpty(dataObject.getString("DL_MACODE"))) {
             MACODE = dataObject.getString("DL_MACODE");
             SharedPreUtil.saveString(this, "MA_CODE", dataObject.getString("DL_MACODE"));
             mCurDoc.setText(MACODE);
         } else {
             mCurDoc.setText("");
-            CommonUtil.toastNoRepeat(this, "暂未在线工单,可点击工单绑定进行操作");
         }
         if (!StringUtil.isEmpty(dataObject.getString("UNFINISHQQTY"))) {
             mUnfinish.setText(dataObject.getString("UNFINISHQQTY"));
@@ -418,8 +415,6 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
         }
         //待设置
         tv_metrimal_name.setText("K002雾化棒半成品_金桔柠檬0mg");
-
-
         mScrapTextView.setText(FastjsonUtil.getText(dataObject, "MA_ONLINESCRAPQTY"));
         mStaffName = FastjsonUtil.getText(dataObject, "UO_EMNAME");
         mStaffCode = TextUtils.isEmpty(FastjsonUtil.getText(dataObject, "UO_EMCODE"))?
@@ -486,7 +481,11 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
                 String workOrder = mCurDoc.getText().toString().trim();
                 //工步移交和工步接收
                 if(GloableParams.GRIDNAME_STEP_TRANSFER.equals(itemName)
-                 ||GloableParams.GRIDNAME_STEP_RECEIVE.equals(itemName)){
+                 ||GloableParams.GRIDNAME_STEP_RECEIVE.equals(itemName)
+                 ||GloableParams.GRIDNAME_BULIANG_CAIJI.equals(itemName)
+                 ||GloableParams.GRIDNAME_CHAI_PI.equals(itemName)
+                 ||GloableParams.GRIDNAME_TIAO_ZHAN.equals(itemName)
+                 ||GloableParams.GRIDNAME_HE_PI.equals(itemName)){
                     goFragment(position);
                 }else if(GloableParams.GRIDNAME_WORK_PAUSE.equals(itemName)){//解除绑定
                     if(TextUtils.isEmpty(workOrder)){

+ 1 - 1
app/src/main/java/com/uas/gdstorage/activity/MainActivity.java

@@ -68,7 +68,7 @@ public class MainActivity extends BaseActivity implements BackHandlerInterface {
                     .commitAllowingStateLoss();
         } else {
             Fragment fragment = new ConnectServerFragment();
-
+           // Fragment fragment = new NotGoodCaiJiFragment();
             getSupportFragmentManager().beginTransaction()
                     .add(R.id.container_login_fragment, fragment)
                     .commit();

+ 38 - 0
app/src/main/java/com/uas/gdstorage/adapter/HepiAdapter.java

@@ -0,0 +1,38 @@
+package com.uas.gdstorage.adapter;
+
+import android.text.TextUtils;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
+import com.uas.gdstorage.R;
+import com.uas.gdstorage.bean.HepiBean;
+import com.uas.gdstorage.fragment.HePiFragment;
+
+public class HepiAdapter extends BaseQuickAdapter<HepiBean, BaseViewHolder> {
+    HePiFragment hePiFragment;
+    public HepiAdapter(HePiFragment fragment) {
+        super(R.layout.item_hepi, null);
+        this.hePiFragment=fragment;
+    }
+    @Override
+    protected void convert(BaseViewHolder helper, HepiBean item) {
+        TextView tv_pichi=helper.getView(R.id.tv_name);
+        TextView tv_num=helper.getView(R.id.tv_num);
+        ImageView iv_close=helper.getView(R.id.iv_close);
+        if(!TextUtils.isEmpty(item.getLotno())){
+            tv_pichi.setText(item.getLotno());
+        }
+        if(!TextUtils.isEmpty(item.getQty()+"")){
+            tv_num.setText(item.getQty()+"");
+        }
+        iv_close.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+               hePiFragment.deleteItem(helper.getLayoutPosition());
+            }
+        });
+    }
+}

+ 31 - 0
app/src/main/java/com/uas/gdstorage/adapter/ReportDetailAdapter.java

@@ -0,0 +1,31 @@
+package com.uas.gdstorage.adapter;
+
+import android.text.TextUtils;
+import android.widget.TextView;
+
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
+import com.uas.gdstorage.R;
+import com.uas.gdstorage.bean.ReportDetailBean;
+import com.uas.gdstorage.util.DateFormatUtils;
+
+public class ReportDetailAdapter extends BaseQuickAdapter<ReportDetailBean, BaseViewHolder> {
+    public ReportDetailAdapter() {
+        super(R.layout.item_report_detail, null);
+    }
+    @Override
+    protected void convert(BaseViewHolder helper, ReportDetailBean item) {
+        TextView tv_pichi=helper.getView(R.id.tv_pichi);
+        TextView tv_report_num=helper.getView(R.id.tv_report_num);
+        TextView tv_destory_num=helper.getView(R.id.tv_destory_num);
+        TextView tv_report_man=helper.getView(R.id.tv_report_man);
+        TextView tv_report_time=helper.getView(R.id.tv_report_time);
+        if(!TextUtils.isEmpty(item.getSp_lotno())){
+            tv_pichi.setText(item.getSp_lotno());
+        }
+        tv_report_num.setText(item.getSp_qty()+"");
+        tv_destory_num.setText(item.getSp_ngqty()+"");
+        tv_report_man.setText(item.getSp_inman());
+        tv_report_time.setText(DateFormatUtils.long2Str(item.getSp_date(),DateFormatUtils.YMD_HM));
+    }
+}

+ 62 - 0
app/src/main/java/com/uas/gdstorage/bean/HepiBean.java

@@ -0,0 +1,62 @@
+package com.uas.gdstorage.bean;
+
+import java.io.Serializable;
+
+
+public class HepiBean implements Serializable {
+
+    private String lotno;
+    private String makecode;
+    private String prodcode;
+    private String pr_detail;
+    private String pr_spec;
+    private int qty;
+
+    public String getLotno() {
+        return lotno;
+    }
+
+    public void setLotno(String lotno) {
+        this.lotno = lotno;
+    }
+
+    public String getMakecode() {
+        return makecode;
+    }
+
+    public void setMakecode(String makecode) {
+        this.makecode = makecode;
+    }
+
+    public String getProdcode() {
+        return prodcode;
+    }
+
+    public void setProdcode(String prodcode) {
+        this.prodcode = 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 int getQty() {
+        return qty;
+    }
+
+    public void setQty(int qty) {
+        this.qty = qty;
+    }
+}

+ 52 - 0
app/src/main/java/com/uas/gdstorage/bean/ReportDetailBean.java

@@ -0,0 +1,52 @@
+package com.uas.gdstorage.bean;
+
+import java.io.Serializable;
+
+public class ReportDetailBean  implements Serializable {
+
+    private long sp_date;
+    private String sp_inman;
+    private String sp_lotno;
+    private int sp_ngqty;
+    private int sp_qty;
+
+    public long getSp_date() {
+        return sp_date;
+    }
+
+    public void setSp_date(long sp_date) {
+        this.sp_date = sp_date;
+    }
+
+    public String getSp_inman() {
+        return sp_inman;
+    }
+
+    public void setSp_inman(String sp_inman) {
+        this.sp_inman = sp_inman;
+    }
+
+    public String getSp_lotno() {
+        return sp_lotno;
+    }
+
+    public void setSp_lotno(String sp_lotno) {
+        this.sp_lotno = sp_lotno;
+    }
+
+    public int getSp_ngqty() {
+        return sp_ngqty;
+    }
+
+    public void setSp_ngqty(int sp_ngqty) {
+        this.sp_ngqty = sp_ngqty;
+    }
+
+    public int getSp_qty() {
+        return sp_qty;
+    }
+
+    public void setSp_qty(int sp_qty) {
+        this.sp_qty = sp_qty;
+    }
+}

+ 326 - 0
app/src/main/java/com/uas/gdstorage/fragment/CaiPiFragment.java

@@ -0,0 +1,326 @@
+package com.uas.gdstorage.fragment;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.text.TextUtils;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.inputmethod.EditorInfo;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSONArray;
+import com.android.volley.AuthFailureError;
+import com.android.volley.DefaultRetryPolicy;
+import com.android.volley.Request;
+import com.android.volley.Response;
+import com.android.volley.VolleyError;
+import com.android.volley.toolbox.StringRequest;
+import com.uas.gdstorage.R;
+import com.uas.gdstorage.activity.FunctionActivity;
+import com.uas.gdstorage.application.PdaApplication;
+import com.uas.gdstorage.global.GloableParams;
+import com.uas.gdstorage.tools.VolleyUtil;
+import com.uas.gdstorage.util.CameraUtil;
+import com.uas.gdstorage.util.CommonUtil;
+import com.uas.gdstorage.util.Constants;
+import com.uas.gdstorage.util.FastjsonUtil;
+import com.uas.gdstorage.util.JsonUtils;
+import com.uas.gdstorage.util.NumberUtil;
+import com.uas.gdstorage.view.ClearableEditText;
+import com.uuzuche.lib_zxing.activity.CaptureActivity;
+import com.uuzuche.lib_zxing.activity.CodeUtils;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Created by RaoMeng on 2017/5/4.
+ * 不良采集页面
+ */
+public class CaiPiFragment extends BaseFragment {
+    private static final String TAG = "CaiPiFragment";
+    private static final int SCAN_BARCODE_CODE = 106;
+    private ClearableEditText ed_pihao;
+    private ClearableEditText ed_old_num;
+    private ClearableEditText ed_caifen_num;
+    private Button btn_confirm;
+    private TextView tv_result;
+    private StringRequest mStringRequest;
+    private ImageView mScanImageView;
+    private int mFocusId;
+    private String sc_code;
+    private String ma_code;
+
+    @Override
+    protected int getLayout() {
+        return R.layout.fragment_caipi;
+    }
+
+    @Override
+    protected void initViews() {
+        FunctionActivity.setTitle("拆批");
+        ((FunctionActivity) mActivity).setScanIvVisible(true);
+        ed_pihao = (ClearableEditText) root.findViewById(R.id.ed_pihao);
+        ed_old_num = (ClearableEditText) root.findViewById(R.id.ed_old_num);
+        ed_caifen_num=(ClearableEditText)root.findViewById(R.id.ed_caifen_num);
+        btn_confirm = (Button) root.findViewById(R.id.btn_confirm);
+        tv_result = (TextView) root.findViewById(R.id.tv_result);
+        mScanImageView = (ImageView) mActivity.findViewById(R.id.btn_actionbar_scan_iv);
+        ed_pihao.requestFocus();
+    }
+
+    @Override
+    protected void initEvents() {
+        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));
+                }
+            }
+        });
+
+        ed_pihao.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+            @Override
+            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+                if (actionId == EditorInfo.IME_ACTION_SEND
+                        || actionId == EditorInfo.IME_ACTION_DONE
+                        || (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
+                    getPihaoData();
+                    return true;
+                }
+                return false;
+            }
+        });
+
+        btn_confirm.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                splitLotno();
+            }
+        });
+    }
+
+
+    private void getPihaoData() {
+        String pihao = ed_pihao.getText().toString().trim();
+        if (!TextUtils.isEmpty(pihao)) {
+            progressDialog.show();
+            String url = null;
+            try {
+                url = GloableParams.ADDRESS_GET_SPLIT_LOTNO + "?lotno=" + URLEncoder.encode(pihao, "utf-8")
+                        +"&sc_code=" + URLEncoder.encode(sc_code, "utf-8");
+            } catch (UnsupportedEncodingException e) {
+                e.printStackTrace();
+            }
+            PdaApplication.mRequestQueue.cancelAll(TAG + "getLotSourceData");
+            mStringRequest = new StringRequest(Request.Method.GET, url,
+                    new Response.Listener<String>() {
+                        @Override
+                        public void onResponse(String s) {
+                            ed_old_num.requestFocus();
+                            progressDialog.dismiss();
+                            try {
+                                boolean isSuccess = new JSONObject(s).getBoolean("success");
+                                if(isSuccess){
+                                    JSONObject dataObject = new JSONObject(s).getJSONObject("data");
+                                    if (dataObject != null) {
+                                        String resultStr = "生产批号:" + JsonUtils.optStringNotNull(dataObject, "LOTNO")
+                                                + ",工单号:" + JsonUtils.optStringNotNull(dataObject, "MAKECODE") + "  " +
+                                                ",料号:" + JsonUtils.optStringNotNull(dataObject, "PRODCODE") + "  " +
+                                                ",名称:" + JsonUtils.optStringNotNull(dataObject, "PR_DETAIL")
+                                                + ",规格:" + JsonUtils.optStringNotNull(dataObject, "PR_SPEC");
+                                        String v_ngqty=JsonUtils.optStringNotNull(dataObject, "QTY")+"";
+                                        tv_result.setVisibility(View.VISIBLE);
+                                        tv_result.setText(resultStr);
+                                        ed_old_num.setText(v_ngqty);
+                                    }
+                                }
+                            } catch (JSONException e) {
+                                e.printStackTrace();
+                            }
+                        }
+                    },
+                    new Response.ErrorListener() {
+                        @Override
+                        public void onErrorResponse(VolleyError volleyError) {
+                            progressDialog.dismiss();
+                            String errorToast = CommonUtil.showErrorToast(volleyError, true);
+                            tv_result.setVisibility(View.VISIBLE);
+                            tv_result.setText(errorToast);
+                            ed_pihao.setText(null);
+                            ed_pihao.requestFocus();
+                            ed_old_num.setText("");
+                            ed_caifen_num.setText("");
+                        }
+                    }) {
+                @Override
+                public Map<String, String> getHeaders() throws AuthFailureError {
+                    return VolleyUtil.getVolleyUtil().setCookies();
+                }
+            };
+            mStringRequest.setRetryPolicy(new DefaultRetryPolicy(10 * 1000, 0, 1f));
+            mStringRequest.setTag(TAG + "getLotSourceData");
+            PdaApplication.mRequestQueue.add(mStringRequest);
+        }
+    }
+
+    private void splitLotno() {
+        String pihao = ed_pihao.getText().toString().trim();
+        String  old_numStr=ed_old_num.getText().toString().trim();
+        String caifen_numStr=ed_caifen_num.getText().toString().trim();
+        int old_num= NumberUtil.parseInt(old_numStr);
+        int caifen_num= NumberUtil.parseInt(caifen_numStr);
+        if(TextUtils.isEmpty(pihao)){
+            CommonUtil.toastNoRepeat(mActivity,"生产批号不能为空");
+            return;
+        }
+        if(caifen_num<=0){
+            CommonUtil.toastNoRepeat(mActivity,"拆分数量必须大于0");
+            return;
+        }
+        if(caifen_num>old_num){
+            CommonUtil.toastNoRepeat(mActivity,"拆分数量必须小于原数量");
+            return;
+        }
+        if (!TextUtils.isEmpty(pihao)) {
+            progressDialog.show();
+            PdaApplication.mRequestQueue.cancelAll(TAG + "splitLotno");
+            mStringRequest = new StringRequest(Request.Method.POST ,GloableParams.ADDRESS_SPLIT_LOTNO,
+                    new Response.Listener<String>() {
+                        @Override
+                        public void onResponse(String s) {
+                            progressDialog.dismiss();
+                            try {
+                                boolean issuccess = new JSONObject(s).getBoolean("success");
+                                if (issuccess) {
+                                    String resultStr = "拆分成功\n";
+                                    JSONArray dataArray = FastjsonUtil.getJSONArray(s.toString(), "data");
+                                    if(dataArray!=null&&dataArray.size()>0){
+                                        for(int i=0;i<dataArray.size();i++){
+                                            com.alibaba.fastjson.JSONObject  jsonObject=dataArray.getJSONObject(i);
+                                            resultStr+="生产批号:"+jsonObject.getString("LOTNO")+", 数量:"+jsonObject.getIntValue("QTY")+"\n";
+                                        }
+
+                                    }
+                                    tv_result.setVisibility(View.VISIBLE);
+                                    tv_result.setText(resultStr);
+                                    //清除数据
+                                    ed_pihao.setText(null);
+                                    ed_pihao.requestFocus();
+                                    ed_old_num.setText("");
+                                    ed_caifen_num.setText("");
+                                }
+                            } catch (JSONException e) {
+                                e.printStackTrace();
+                            }
+                        }
+                    },
+                    new Response.ErrorListener() {
+                        @Override
+                        public void onErrorResponse(VolleyError volleyError) {
+                            progressDialog.dismiss();
+                            String errorToast = CommonUtil.showErrorToast(volleyError, true);
+                            tv_result.setVisibility(View.VISIBLE);
+                            tv_result.setText(errorToast);
+                            //清除数据
+                            ed_pihao.setText(null);
+                            ed_pihao.requestFocus();
+                            ed_old_num.setText("");
+                            ed_caifen_num.setText("");
+                        }
+                    }) {
+                @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("lotno", pihao);
+                    params.put("sc_code", sc_code);
+                    params.put("oldqty", old_numStr);
+                    params.put("qty", caifen_numStr);
+                    return params;
+                }
+            };
+            mStringRequest.setRetryPolicy(new DefaultRetryPolicy(10 * 1000, 0, 1f));
+            mStringRequest.setTag(TAG + "splitLotno");
+            PdaApplication.mRequestQueue.add(mStringRequest);
+        }
+    }
+
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        if (resultCode == Activity.RESULT_OK&&requestCode == SCAN_BARCODE_CODE && data != null) {
+            if (data.getExtras() != null) {
+                String result = data.getExtras().getString(CodeUtils.RESULT_STRING);
+                if (mFocusId == R.id.ed_pihao) {
+                  ed_pihao.setText(result);
+                  ed_pihao.setSelection(result.length());
+                  getPihaoData();
+                }else if(mFocusId == R.id.ed_old_num){
+                    ed_old_num.setText(result);
+                    ed_old_num.setSelection(result.length());
+                }else if(mFocusId == R.id.ed_caifen_num){
+                    ed_caifen_num.setText(result);
+                    ed_caifen_num.setSelection(result.length());
+                }
+            }
+        }
+
+    }
+
+    @Override
+    protected void initDatas() {
+        Bundle bundle = getArguments();//从activity传过来的Bundle
+        if(bundle!=null){
+            sc_code = bundle.getString(Constants.FLAG.SC_CODE);
+            ma_code = bundle.getString(Constants.FLAG.MA_CODE);
+        }
+    }
+
+    @Override
+    public void onHiddenChanged(boolean hidden) {
+        super.onHiddenChanged(hidden);
+        if (!hidden) {
+            FunctionActivity.setTitle("拆分");
+            ((FunctionActivity) mActivity).setScanIvVisible(true);
+        }else{
+            ((FunctionActivity) mActivity).setScanIvVisible(false);
+        }
+    }
+
+    @Override
+    public void onDestroyView() {
+        super.onDestroyView();
+        ((FunctionActivity) mActivity).setScanIvVisible(false);
+    }
+
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        return false;
+    }
+
+    @Override
+    public boolean onFragmentBackPressed() {
+        return false;
+    }
+}

+ 46 - 1
app/src/main/java/com/uas/gdstorage/fragment/ComeInSiteFragment.java

@@ -1,11 +1,13 @@
 package com.uas.gdstorage.fragment;
 
+import android.app.Activity;
 import android.content.Intent;
 import android.os.Bundle;
 import android.text.TextUtils;
 import android.view.KeyEvent;
 import android.view.View;
 import android.widget.Button;
+import android.widget.ImageView;
 import android.widget.TextView;
 
 import com.android.volley.Request;
@@ -14,6 +16,7 @@ import com.uas.gdstorage.R;
 import com.uas.gdstorage.activity.FunctionActivity;
 import com.uas.gdstorage.activity.IndexActivity;
 import com.uas.gdstorage.global.GloableParams;
+import com.uas.gdstorage.util.CameraUtil;
 import com.uas.gdstorage.util.CommonUtil;
 import com.uas.gdstorage.util.Constants;
 import com.uas.gdstorage.util.FastjsonUtil;
@@ -21,6 +24,8 @@ import com.uas.gdstorage.util.HttpCallback;
 import com.uas.gdstorage.util.HttpParams;
 import com.uas.gdstorage.util.VollyRequest;
 import com.uas.gdstorage.view.ClearableEditText;
+import com.uuzuche.lib_zxing.activity.CaptureActivity;
+import com.uuzuche.lib_zxing.activity.CodeUtils;
 
 public class ComeInSiteFragment extends BaseFragment {
     private StringRequest mStringRequest;
@@ -28,9 +33,11 @@ public class ComeInSiteFragment extends BaseFragment {
     private TextView tv_order_num,tv_location;
     private ClearableEditText ed_pichi,ed_come_in_num;
     private Button btn_come_in;
-
     private String sc_code;
     private String ma_code;
+    private ImageView mScanImageView;
+    private int mFocusId;
+    private static final int SCAN_BARCODE_CODE = 201;
     @Override
     protected int getLayout() {
         return R.layout.fragment_come_in_site;
@@ -39,14 +46,32 @@ public class ComeInSiteFragment extends BaseFragment {
     @Override
     protected void initViews() {
         ((FunctionActivity) getActivity()).setTitle("进站");
+        ((FunctionActivity) getActivity()).setScanIvVisible(true);
+        mScanImageView=mActivity.findViewById(R.id.btn_actionbar_scan_iv);
         tv_order_num=root.findViewById(R.id.tv_order_num);
         tv_location=root.findViewById(R.id.tv_location);
         ed_pichi=root.findViewById(R.id.ed_pichi);
         ed_come_in_num=root.findViewById(R.id.ed_come_in_num);
         btn_come_in=root.findViewById(R.id.btn_come_in);
+        ed_pichi.requestFocus();
     }
     @Override
     protected void initEvents() {
+        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));
+                }
+            }
+        });
         mActivity.findViewById(R.id.btn_actionbar_withback).setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
@@ -127,4 +152,24 @@ public class ComeInSiteFragment extends BaseFragment {
     public boolean onFragmentBackPressed() {
         return false;
     }
+
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        if (resultCode != Activity.RESULT_OK) {
+            return;
+        }
+        if (requestCode == SCAN_BARCODE_CODE && data != null) {
+            if (data.getExtras() != null) {
+                String result = data.getExtras().getString(CodeUtils.RESULT_STRING);
+                if (mFocusId == R.id.ed_pichi) {
+                    ed_pichi.setText(result);
+                    ed_pichi.setSelection(result.length());
+                }else if (mFocusId==R.id.ed_come_in_num){
+                    ed_come_in_num.setText(result);
+                    ed_come_in_num.setSelection(result.length());
+                }
+            }
+        }
+    }
 }

+ 7 - 10
app/src/main/java/com/uas/gdstorage/fragment/GdMaterialInFragment.java

@@ -105,7 +105,6 @@ public class GdMaterialInFragment extends BaseFragment implements View.OnClickLi
         root.findViewById(R.id.edit_im).setOnClickListener(this);
         mCodeet = (ClearableEditText) root.findViewById(R.id.code_et);
         mCodeet.setOnClickListener(this);
-//        mCodeet.setText("0006171600201581812263539");
         mNumberset = (ClearableEditText) root.findViewById(R.id.numbers_et);
         mSurebtn = (Button) root.findViewById(R.id.sure_btn);
         mSurebtn.setOnClickListener(this);
@@ -115,16 +114,12 @@ public class GdMaterialInFragment extends BaseFragment implements View.OnClickLi
         mUnfeedLl = root.findViewById(R.id.unfeed_ll);
         mNnfeedNumberTv = root.findViewById(R.id.unfeed_number_tv);
         mRefreshLayout.setEnableLoadMore(false);
-
         mUnfeedingrv.addItemDecoration(new DividerItemDecoration(mActivity, LinearLayout.VERTICAL));
         mUnfeedingrv.setLayoutManager(new LinearLayoutManager(mActivity));
         myUnFeedBeanList = new ArrayList<>();
         myUnFeedListAdapter = new UnFeedListAdapter(myUnFeedBeanList);
         myUnFeedListAdapter.setmList(myUnFeedBeanList);
         mUnfeedingrv.setAdapter(myUnFeedListAdapter);
-
-//        mDocnumber.setText("BZMB20181225001");
-
         initPopupWindow();
     }
 
@@ -139,7 +134,7 @@ public class GdMaterialInFragment extends BaseFragment implements View.OnClickLi
         if (!StringUtil.isEmpty(ma_code) && !StringUtil.isEmpty(sc_code)) {
             getMaUnLoadingPrCode(ma_code);
         }
-        if (StringUtil.isEmpty(ma_code)) {
+        if(StringUtil.isEmpty(ma_code)) {
             CommonUtil.toastNoRepeat(mActivity, "请输入需要上料的工单");
             mCodeet.setEnabled(false);
             mNumberset.setEnabled(false);
@@ -246,10 +241,15 @@ public class GdMaterialInFragment extends BaseFragment implements View.OnClickLi
         if (StringUtil.isEmpty(mNumbersetStr)) {
             CommonUtil.toastNoRepeat(mActivity, "数量不可为空");
             return;
-        } else if (Double.parseDouble(mNumbersetStr) <= 0) {
+        }
+        if (Double.parseDouble(mNumbersetStr) <= 0) {
             CommonUtil.toastNoRepeat(mActivity, "数量不可小于0");
             return;
         }
+        if (barCodeDataObject==null) {
+            CommonUtil.toastNoRepeat(mActivity, "请先解析条码");
+            return;
+        }
         progressDialog.show();
         VollyRequest.getInstance().stringRequest(mStringRequest,
                 new HttpParams.Builder()
@@ -551,9 +551,6 @@ public class GdMaterialInFragment extends BaseFragment implements View.OnClickLi
                     @Override
                     public void onSuccess(int flag, Object o) throws Exception {
                         try {
-
-//                            SharedPreUtil.saveString();
-//                            SharedPreUtil.getString()
                             Boolean isSuccess = FastjsonUtil.getBoolean(o.toString(), "success");
                             if (isSuccess) {
                                 JSONObject barcode_dataObject = FastjsonUtil.getJSONObject(o.toString(), "data");

+ 58 - 4
app/src/main/java/com/uas/gdstorage/fragment/GdTimeReportFragment.java

@@ -1,5 +1,6 @@
 package com.uas.gdstorage.fragment;
 
+import android.app.Activity;
 import android.content.Intent;
 import android.os.Bundle;
 import android.text.Editable;
@@ -10,6 +11,7 @@ import android.view.View;
 import android.widget.AdapterView;
 import android.widget.ArrayAdapter;
 import android.widget.Button;
+import android.widget.ImageView;
 import android.widget.Spinner;
 import android.widget.TextView;
 
@@ -19,10 +21,10 @@ import com.android.volley.Request;
 import com.android.volley.toolbox.StringRequest;
 import com.uas.gdstorage.R;
 import com.uas.gdstorage.activity.FunctionActivity;
-import com.uas.gdstorage.activity.IndexActivity;
 import com.uas.gdstorage.global.GloableParams;
 import com.uas.gdstorage.listener.MyEditorActionListener;
 import com.uas.gdstorage.tools.SharedPreUtil;
+import com.uas.gdstorage.util.CameraUtil;
 import com.uas.gdstorage.util.CommonUtil;
 import com.uas.gdstorage.util.Constants;
 import com.uas.gdstorage.util.FastjsonUtil;
@@ -32,6 +34,8 @@ import com.uas.gdstorage.util.LogUtil;
 import com.uas.gdstorage.util.StringUtil;
 import com.uas.gdstorage.util.VollyRequest;
 import com.uas.gdstorage.view.ClearableEditText;
+import com.uuzuche.lib_zxing.activity.CaptureActivity;
+import com.uuzuche.lib_zxing.activity.CodeUtils;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -61,6 +65,9 @@ public class GdTimeReportFragment extends BaseFragment {
     private ClearableEditText ed_pichi;
     private String  reportNum="";
     private TextView tv_report_name;
+    private ImageView mScanImageView;
+    private int mFocusId;
+    private static final int SCAN_BARCODE_CODE = 201;
 
     @Override
     protected int getLayout() {
@@ -70,6 +77,8 @@ public class GdTimeReportFragment extends BaseFragment {
     @Override
     protected void initViews() {
         ((FunctionActivity) getActivity()).setTitle("报工");
+        ((FunctionActivity) getActivity()).setScanIvVisible(true);
+        mScanImageView=mActivity.findViewById(R.id.btn_actionbar_scan_iv);
         mOlIdTv = root.findViewById(R.id.ol_id_tv);
         mOlNUmbersTv = root.findViewById(R.id.olun_numbers_tv);
         mOlNameTv = root.findViewById(R.id.ol_name_tv);
@@ -81,11 +90,27 @@ public class GdTimeReportFragment extends BaseFragment {
         tv_report_name=root.findViewById(R.id.tv_report_name);
         String name = SharedPreUtil.getString(mActivity, Constants.FLAG.CACHE_USER_EMNAME,null);
         mOlNameTv.setText(name);
+        ed_pichi.requestFocus();
     }
 
     @Override
     protected void initEvents() {
         initUnitView();
+        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));
+                }
+            }
+        });
         //批次号Enter键
         CommonUtil.setEditorActionListener(ed_pichi, new MyEditorActionListener() {
             @Override
@@ -268,12 +293,15 @@ public class GdTimeReportFragment extends BaseFragment {
                         .build(), new HttpCallback() {
                     @Override
                     public void onSuccess(int flag, Object o) throws Exception {
+                        progressDialog.dismiss();
                         Boolean isSuccess = FastjsonUtil.getBoolean(o.toString(),"success");
                         if (isSuccess){
                             CommonUtil.toastNoRepeat(mActivity,"报工成功");
-                            Intent intent =  new Intent(mActivity, IndexActivity.class);
-                            intent.putExtra("SC_CODE",sc_code);
-                            startActivity(intent);
+                            ed_pichi.setText("");//生产批次
+                            mOlNumbersEt.setText("");//报工数
+                            mOlUnuseEt.setText("");//报废数
+                            mOlRemarkEt.setText("");//备注
+                            ed_pichi.requestFocus();
                         }
                     }
 
@@ -353,4 +381,30 @@ public class GdTimeReportFragment extends BaseFragment {
     public boolean onFragmentBackPressed() {
         return false;
     }
+
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        if (resultCode != Activity.RESULT_OK) {
+            return;
+        }
+        if (requestCode == SCAN_BARCODE_CODE && data != null) {
+            if (data.getExtras() != null) {
+                String result = data.getExtras().getString(CodeUtils.RESULT_STRING);
+                if (mFocusId == R.id.ed_pichi) {
+                    ed_pichi.setText(result);
+                    ed_pichi.setSelection(result.length());
+                }else if (mFocusId==R.id.ol_numbers_et){
+                    mOlNumbersEt.setText(result);
+                    mOlNumbersEt.setSelection(result.length());
+                }else if(mFocusId==R.id.ol_unuse_et){
+                    mOlUnuseEt.setText(result);
+                    mOlUnuseEt.setSelection(result.length());
+                }else if(mFocusId==R.id.ol_remark_et){
+                    mOlRemarkEt.setText(result);
+                    mOlRemarkEt.setSelection(result.length());
+                }
+            }
+        }
+    }
 }

+ 42 - 3
app/src/main/java/com/uas/gdstorage/fragment/GdWorkSwitchFragment.java

@@ -14,6 +14,7 @@ import android.view.View;
 import android.widget.AdapterView;
 import android.widget.ArrayAdapter;
 import android.widget.Button;
+import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.Spinner;
 import android.widget.TextView;
@@ -82,6 +83,9 @@ public class GdWorkSwitchFragment extends BaseFragment implements View.OnClickLi
     private TextView guigeTv;
     private JSONObject detailOne;
     private Button startBtn;
+    private ImageView mScanImageView;
+    private int mFocusId;
+    private static final int SCAN_BARCODE_CODE = 201;
     @Override
     protected int getLayout() {
         return R.layout.fragment_gd_work_switch;
@@ -90,6 +94,8 @@ public class GdWorkSwitchFragment extends BaseFragment implements View.OnClickLi
     @Override
     protected void initViews() {
         ((FunctionActivity) getActivity()).setTitle("工单切换");
+        ((FunctionActivity) mActivity).setScanIvVisible(true);//显示扫描控件
+        mScanImageView = (ImageView)mActivity.findViewById(R.id.btn_actionbar_scan_iv);
         startBtn = root.findViewById(R.id.start_btn);
         startLlS = root.findViewById(R.id.start_ll);
         gongdanhaoTv = root.findViewById(R.id.gongdanhao_tv);
@@ -122,11 +128,29 @@ public class GdWorkSwitchFragment extends BaseFragment implements View.OnClickLi
         fuzzyAdapter = new FuzzySearchAdapter(fuzzyBeans);
         fuzzyAdapter.setmList(fuzzyBeans);
         fuzzyRv.setAdapter(fuzzyAdapter);
+        mSearch.requestFocus();
     }
 
     @Override
     protected void initEvents() {
         initUnitView();
+        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));
+                }
+
+
+            }
+        });
         mSearch.addTextChangedListener(new TextWatcher() {
             @Override
             public void beforeTextChanged(CharSequence s, int start, int count, int after) { }
@@ -499,9 +523,9 @@ public class GdWorkSwitchFragment extends BaseFragment implements View.OnClickLi
         if (resultCode == Activity.RESULT_OK) {
             if (requestCode == Constants.FLAG.SCAN_BARCODE_CODE && data != null && data.getExtras() != null) {
                 String result = data.getExtras().getString(CodeUtils.RESULT_STRING) + "";
-                LogUtil.i("onActivityResult", result);
-                if (!StringUtil.isEmpty(result)) {
-                    mOlNextEt.setText(result);
+                if (mFocusId == R.id.fl_search_actext) {
+                    mSearch.setText(result);
+                    mSearch.setSelection(result.length());
                 }
             }
         }
@@ -511,6 +535,19 @@ public class GdWorkSwitchFragment extends BaseFragment implements View.OnClickLi
             mOlNextEt.setText(result);
         }
 
+
+
+
+        if (requestCode == SCAN_BARCODE_CODE && data != null) {
+            if (data.getExtras() != null) {
+                String result = data.getExtras().getString(CodeUtils.RESULT_STRING);
+                if (mFocusId == R.id.fl_search_actext) {
+                    mSearch.setText(result);
+                    mSearch.setSelection(result.length());
+                }
+            }
+        }
+
     }
     private class FuzzySearchAdapter extends BaseQuickAdapter<FuzzyBean, BaseViewHolder> {
         private List<FuzzyBean> mList;
@@ -548,4 +585,6 @@ public class GdWorkSwitchFragment extends BaseFragment implements View.OnClickLi
             return MA_CODE;
         }
     }
+
+
 }

+ 420 - 0
app/src/main/java/com/uas/gdstorage/fragment/HePiFragment.java

@@ -0,0 +1,420 @@
+package com.uas.gdstorage.fragment;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.inputmethod.EditorInfo;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.android.volley.AuthFailureError;
+import com.android.volley.DefaultRetryPolicy;
+import com.android.volley.Request;
+import com.android.volley.Response;
+import com.android.volley.VolleyError;
+import com.android.volley.toolbox.StringRequest;
+import com.google.gson.Gson;
+import com.uas.gdstorage.R;
+import com.uas.gdstorage.activity.FunctionActivity;
+import com.uas.gdstorage.adapter.HepiAdapter;
+import com.uas.gdstorage.application.PdaApplication;
+import com.uas.gdstorage.bean.HepiBean;
+import com.uas.gdstorage.global.GloableParams;
+import com.uas.gdstorage.tools.VolleyUtil;
+import com.uas.gdstorage.util.CameraUtil;
+import com.uas.gdstorage.util.CommonUtil;
+import com.uas.gdstorage.util.Constants;
+import com.uas.gdstorage.util.FastjsonUtil;
+import com.uas.gdstorage.view.ClearableEditText;
+import com.uuzuche.lib_zxing.activity.CaptureActivity;
+import com.uuzuche.lib_zxing.activity.CodeUtils;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Created by RaoMeng on 2017/5/4.
+ * 不良采集页面
+ */
+public class HePiFragment extends BaseFragment {
+    private static final String TAG = "CaiPiFragment";
+    private static final int SCAN_BARCODE_CODE = 106;
+    private ClearableEditText ed_pihao;
+    private ClearableEditText ed_hepi;
+    private Button btn_confirm;
+    private TextView tv_result;
+    private StringRequest mStringRequest;
+    private ImageView mScanImageView;
+    private int mFocusId;
+    private String sc_code;
+    private String ma_code;
+    private RecyclerView rv_content;
+    private HepiAdapter hepiAdapter;
+    private ArrayList<HepiBean> list=new ArrayList<>();
+    private ImageView iv_close;
+    private TextView tv_total_num;
+    private LinearLayout ll_title;
+
+    @Override
+    protected int getLayout() {
+        return R.layout.fragment_hepi;
+    }
+
+    @Override
+    protected void initViews() {
+        FunctionActivity.setTitle("合批");
+        ((FunctionActivity) mActivity).setScanIvVisible(true);
+        mScanImageView = (ImageView) mActivity.findViewById(R.id.btn_actionbar_scan_iv);
+        ed_pihao = (ClearableEditText)root.findViewById(R.id.ed_pihao);
+        ed_hepi = (ClearableEditText)root.findViewById(R.id.ed_hepi);
+        btn_confirm = (Button) root.findViewById(R.id.btn_confirm);
+        tv_result = (TextView) root.findViewById(R.id.tv_result);
+        ll_title=root.findViewById(R.id.ll_title);
+        iv_close=root.findViewById(R.id.iv_close);
+        rv_content=root.findViewById(R.id.rv_content);
+        tv_total_num=root.findViewById(R.id.tv_total_num);
+        rv_content.setLayoutManager(new LinearLayoutManager(mActivity));
+        hepiAdapter=new HepiAdapter(this);
+        rv_content.setAdapter(hepiAdapter);
+        ed_pihao.requestFocus();
+    }
+
+    @Override
+    protected void initEvents() {
+        iv_close.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                ed_pihao.setText("");
+                ed_pihao.setBackgroundResource(R.drawable.bg_edittext);
+                ed_pihao.setEnabled(true);
+                ed_pihao.setFocusableInTouchMode(true);
+                ed_pihao.requestFocus();
+                iv_close.setVisibility(View.GONE);
+                list.clear();
+                hepiAdapter.notifyDataSetChanged();
+                ll_title.setVisibility(View.GONE);
+            }
+        });
+        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));
+                }
+            }
+        });
+
+        ed_pihao.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+            @Override
+            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+                if (actionId == EditorInfo.IME_ACTION_SEND
+                        || actionId == EditorInfo.IME_ACTION_DONE
+                        || (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
+                    String pihao = ed_pihao.getText().toString().trim();
+                    if (TextUtils.isEmpty(pihao)) {
+                        CommonUtil.toastNoRepeat(mActivity,"请先输入生产批号.");
+                        return false;
+                    }
+                    getPihaoData(1,pihao);
+                }
+                return false;
+            }
+        });
+        ed_hepi.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+            @Override
+            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+                if (actionId == EditorInfo.IME_ACTION_SEND
+                        || actionId == EditorInfo.IME_ACTION_DONE
+                        || (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
+                    String pihao = ed_hepi.getText().toString().trim();
+                    if (TextUtils.isEmpty(pihao)) {
+                        CommonUtil.toastNoRepeat(mActivity,"请先输入合批批号.");
+                        return false;
+                    }
+                    getPihaoData(2,pihao);
+                    return true;
+                }
+                return false;
+            }
+        });
+        btn_confirm.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                mergeLotno();
+            }
+        });
+    }
+
+
+    private void getPihaoData(int type,String pihao) {
+        progressDialog.show();
+        String url = null;
+        try {
+            url = GloableParams.ADDRESS_GET_MERGE_LOTNO + "?lotno=" + URLEncoder.encode(pihao, "utf-8")
+                    +"&sc_code=" + URLEncoder.encode(sc_code, "utf-8");
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+        PdaApplication.mRequestQueue.cancelAll(TAG + "getMergeLotno");
+        mStringRequest = new StringRequest(Request.Method.GET, url,
+                new Response.Listener<String>() {
+                    @Override
+                    public void onResponse(String s) {
+                        progressDialog.dismiss();
+                        try {
+                            boolean isSuccess = new JSONObject(s).getBoolean("success");
+                            if(isSuccess){
+                                ll_title.setVisibility(View.VISIBLE);
+                                JSONObject dataObject = new JSONObject(s).getJSONObject("data");
+                                HepiBean hepiBean=null;
+                                if (dataObject != null) {
+                                    hepiBean=new HepiBean();
+                                    hepiBean.setLotno(dataObject.getString("LOTNO"));
+                                    hepiBean.setMakecode(dataObject.getString("MAKECODE"));
+                                    hepiBean.setPr_detail(dataObject.getString("PR_DETAIL"));
+                                    hepiBean.setProdcode(dataObject.getString("PRODCODE"));
+                                    hepiBean.setQty(dataObject.getInt("QTY"));
+                                    hepiBean.setPr_spec(dataObject.getString("PR_SPEC"));
+                                    if(type==1){
+                                        if(isContainPihao(hepiBean.getLotno())){
+                                            CommonUtil.toastNoRepeat(mActivity,"不可重复采集");
+                                        }else{
+                                            list.add(hepiBean);
+                                            CommonUtil.toastNoRepeat(mActivity,"请输入合批批号");
+                                        }
+                                        hepiAdapter.setNewData(list);
+                                        ed_pihao.setEnabled(false);
+                                        ed_pihao.setFocusable(false);
+                                        ed_pihao.setFocusableInTouchMode(false);
+                                        iv_close.setVisibility(View.VISIBLE);
+                                        ed_pihao.setBackgroundResource(R.drawable.bg_edittext_unenable);
+                                    }else{
+                                        if(isContainPihao(hepiBean.getLotno())){
+                                            CommonUtil.toastNoRepeat(mActivity,"不可重复采集");
+                                        }else{
+                                            list.add(hepiBean);
+                                        }
+                                        ed_hepi.setText("");
+                                        ed_hepi.requestFocus();
+                                        hepiAdapter.setNewData(list);
+                                    }
+                                    tv_total_num.setText(getTotalNum()+"");
+                                }
+                            }
+
+
+                        } catch (JSONException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                },
+                new Response.ErrorListener() {
+                    @Override
+                    public void onErrorResponse(VolleyError volleyError) {
+                        progressDialog.dismiss();
+                        String errorToast = CommonUtil.showErrorToast(volleyError, true);
+                        tv_result.setVisibility(View.VISIBLE);
+                        tv_result.setText(errorToast);
+                        if(type==1){
+                            ed_pihao.setText("");
+                            ed_pihao.requestFocus();
+                        }else{
+                            ed_hepi.setText("");
+                            ed_hepi.requestFocus();
+                        }
+                    }
+                }) {
+            @Override
+            public Map<String, String> getHeaders() throws AuthFailureError {
+                return VolleyUtil.getVolleyUtil().setCookies();
+            }
+        };
+        mStringRequest.setRetryPolicy(new DefaultRetryPolicy(10 * 1000, 0, 1f));
+        mStringRequest.setTag(TAG + "getMergeLotno");
+        PdaApplication.mRequestQueue.add(mStringRequest);
+    }
+
+    /***
+     * 判断列表中是否包含相同批号
+     * @return
+     */
+    public boolean isContainPihao(String pihao){
+        list= (ArrayList<HepiBean>) hepiAdapter.getData();
+        boolean isContain=false;
+
+         for(int i=0;i<list.size();i++){
+             if(list.get(i).getLotno().equals(pihao)){
+                 isContain=true;
+                 break;
+             }
+         }
+         return  isContain;
+    }
+
+
+    public int getTotalNum(){
+        list= (ArrayList<HepiBean>) hepiAdapter.getData();
+        int total=0;
+        for(int i=0;i<list.size();i++){
+            total+=list.get(i).getQty();
+        }
+        return  total;
+    }
+
+    public void deleteItem(int position){
+        hepiAdapter.getData().remove(position);
+        hepiAdapter.notifyDataSetChanged();
+        tv_total_num.setText(getTotalNum()+"");
+    }
+
+    private void mergeLotno() {
+        if(list.size()<2){
+            CommonUtil.toastNoRepeat(mActivity,"合批数据必须大于等于2条");
+            return;
+        }
+        String listJson=new Gson().toJson(list);
+        progressDialog.show();
+        PdaApplication.mRequestQueue.cancelAll(TAG + "mergeLotno");
+        mStringRequest = new StringRequest(Request.Method.POST ,GloableParams.ADDRESS_MERGE_LOTNO,
+                new Response.Listener<String>() {
+                    @Override
+                    public void onResponse(String s) {
+                        progressDialog.dismiss();
+                        try {
+                            boolean issuccess = new JSONObject(s).getBoolean("success");
+                            if (issuccess) {
+                                String resultStr = "合批成功\n";
+                                com.alibaba.fastjson.JSONObject jsonObject = FastjsonUtil.getJSONObject(s.toString(), "data");
+                                resultStr+="生产批号:"+jsonObject.getString("LOTNO")+", 数量:"+jsonObject.getIntValue("QTY")+"\n";
+                                tv_result.setVisibility(View.VISIBLE);
+                                tv_result.setText(resultStr);
+                                //清除数据
+                                ed_pihao.setText("");
+                                ed_pihao.setBackgroundResource(R.drawable.bg_edittext);
+                                ed_pihao.setEnabled(true);
+                                ed_pihao.setFocusableInTouchMode(true);
+                                ed_pihao.requestFocus();
+                                iv_close.setVisibility(View.GONE);
+                                list.clear();
+                                ed_hepi.setText("");
+                                tv_total_num.setText("");
+                                hepiAdapter.notifyDataSetChanged();
+                                ll_title.setVisibility(View.GONE);
+                            }
+                        } catch (JSONException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                },
+                new Response.ErrorListener() {
+                    @Override
+                    public void onErrorResponse(VolleyError volleyError) {
+                        progressDialog.dismiss();
+                        String errorToast = CommonUtil.showErrorToast(volleyError, true);
+                        tv_result.setVisibility(View.VISIBLE);
+                        tv_result.setText(errorToast);
+                        //清除数据
+                        ed_pihao.setText("");
+                        ed_pihao.setBackgroundResource(R.drawable.bg_edittext);
+                        ed_pihao.setEnabled(true);
+                        ed_pihao.setFocusableInTouchMode(true);
+                        ed_pihao.requestFocus();
+                        iv_close.setVisibility(View.GONE);
+                        list.clear();
+                        ed_hepi.setText("");
+                        tv_total_num.setText("0");
+                        hepiAdapter.notifyDataSetChanged();
+
+                    }
+                }) {
+            @Override
+            public Map<String, String> getHeaders() throws AuthFailureError {
+                return VolleyUtil.getVolleyUtil().setCookies();
+            }
+
+            @Override
+            protected Map<String, String> getParams() throws AuthFailureError {
+                Map<String, String> map = new HashMap<>();
+                map.put("sc_code", sc_code);
+                map.put("param",listJson);
+                return map;
+            }
+        };
+        mStringRequest.setRetryPolicy(new DefaultRetryPolicy(10 * 1000, 0, 1f));
+        mStringRequest.setTag(TAG + "splitLotno");
+        PdaApplication.mRequestQueue.add(mStringRequest);
+    }
+
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        if (resultCode == Activity.RESULT_OK&&requestCode == SCAN_BARCODE_CODE && data != null) {
+            if (data.getExtras() != null) {
+                String result = data.getExtras().getString(CodeUtils.RESULT_STRING);
+                if (mFocusId == R.id.ed_pihao) {
+                  ed_pihao.setText(result);
+                  ed_pihao.setSelection(result.length());
+                }else if(mFocusId == R.id.ed_hepi){
+                  ed_hepi.setText(result);
+                  ed_hepi.setSelection(result.length());
+                }
+            }
+        }
+    }
+
+    @Override
+    protected void initDatas() {
+        Bundle bundle = getArguments();//从activity传过来的Bundle
+        if(bundle!=null){
+            sc_code = bundle.getString(Constants.FLAG.SC_CODE);
+            ma_code = bundle.getString(Constants.FLAG.MA_CODE);
+        }
+    }
+
+    @Override
+    public void onHiddenChanged(boolean hidden) {
+        super.onHiddenChanged(hidden);
+        if (!hidden) {
+            FunctionActivity.setTitle("合批");
+            ((FunctionActivity) mActivity).setScanIvVisible(true);
+        }else{
+            ((FunctionActivity) mActivity).setScanIvVisible(false);
+        }
+    }
+
+    @Override
+    public void onDestroyView() {
+        super.onDestroyView();
+        ((FunctionActivity) mActivity).setScanIvVisible(false);
+    }
+
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        return false;
+    }
+
+    @Override
+    public boolean onFragmentBackPressed() {
+        return false;
+    }
+}

+ 352 - 0
app/src/main/java/com/uas/gdstorage/fragment/JumpSiteFragment.java

@@ -0,0 +1,352 @@
+package com.uas.gdstorage.fragment;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.text.TextUtils;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.inputmethod.EditorInfo;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.android.volley.AuthFailureError;
+import com.android.volley.DefaultRetryPolicy;
+import com.android.volley.Request;
+import com.android.volley.Response;
+import com.android.volley.VolleyError;
+import com.android.volley.toolbox.StringRequest;
+import com.uas.gdstorage.R;
+import com.uas.gdstorage.activity.CommonSeclecActivity;
+import com.uas.gdstorage.activity.FunctionActivity;
+import com.uas.gdstorage.application.PdaApplication;
+import com.uas.gdstorage.global.GloableParams;
+import com.uas.gdstorage.tools.VolleyUtil;
+import com.uas.gdstorage.util.CameraUtil;
+import com.uas.gdstorage.util.CommonUtil;
+import com.uas.gdstorage.util.Constants;
+import com.uas.gdstorage.util.JsonUtils;
+import com.uas.gdstorage.view.ClearableEditText;
+import com.uuzuche.lib_zxing.activity.CaptureActivity;
+import com.uuzuche.lib_zxing.activity.CodeUtils;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Created by RaoMeng on 2017/5/4.
+ * 不良采集页面
+ */
+public class JumpSiteFragment extends BaseFragment {
+    private static final String TAG = "NotGoodCaiJiFragment";
+    private static final int SCAN_BARCODE_CODE = 106;
+    private ClearableEditText ed_pihao;
+    private ClearableEditText ed_jump;
+    private Button btn_confirm;
+    private TextView tv_result;
+    private StringRequest mStringRequest;
+    private ImageView mScanImageView;
+    private int mFocusId;
+    private String sc_code;
+    private String ma_code;
+    private ImageView iv_search;
+    private TextView tv_current_gongxu;
+    private TextView tv_select_gongxu;
+    private String cr_code;//途程编号
+    private String stepcode;//当前工序
+    private String tostepcode;
+    @Override
+    protected int getLayout() {
+        return R.layout.fragment_jump_site;
+    }
+
+    @Override
+    protected void initViews() {
+        FunctionActivity.setTitle("跳站");
+        ((FunctionActivity) mActivity).setScanIvVisible(true);
+        ed_pihao = (ClearableEditText) root.findViewById(R.id.ed_pihao);
+        ed_jump = (ClearableEditText) root.findViewById(R.id.ed_jump);
+        btn_confirm = (Button) root.findViewById(R.id.btn_confirm);
+        tv_result = (TextView) root.findViewById(R.id.tv_result);
+        mScanImageView = (ImageView) mActivity.findViewById(R.id.btn_actionbar_scan_iv);
+        iv_search=mActivity.findViewById(R.id.iv_search);
+        tv_current_gongxu=mActivity.findViewById(R.id.tv_current_gongxu);
+        tv_select_gongxu=mActivity.findViewById(R.id.tv_select_gongxu);
+        ed_pihao.requestFocus();
+    }
+
+    @Override
+    protected void initEvents() {
+        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));
+                }
+            }
+        });
+
+        ed_pihao.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+            @Override
+            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+                if (actionId == EditorInfo.IME_ACTION_SEND
+                        || actionId == EditorInfo.IME_ACTION_DONE
+                        || (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
+                    getPihaoData();
+                    return true;
+                }
+                return false;
+            }
+        });
+
+        iv_search.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                String pihao=ed_pihao.getText().toString();
+                if(TextUtils.isEmpty(pihao)){
+                    CommonUtil.toastNoRepeat(mActivity,"请先输入生产批号");
+                    return;
+                }
+                if(TextUtils.isEmpty(cr_code)){
+                    CommonUtil.toastNoRepeat(mActivity,"请先解析生产批号");
+                    return;
+                }
+                Intent intent = new Intent(mActivity, CommonSeclecActivity.class);
+                intent.putExtra("sc_code", sc_code);
+                intent.putExtra("cr_code", cr_code);
+                intent.putExtra("title", "跳站工序");
+                intent.putExtra("type", 4);
+                startActivityForResult(intent, Constants.FLAG.GET_COMMON_ITEM);
+            }
+        });
+        btn_confirm.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                jumpLotno();
+            }
+        });
+    }
+
+    private void getPihaoData() {
+        String pihao = ed_pihao.getText().toString().trim();
+        if (!TextUtils.isEmpty(pihao)) {
+            progressDialog.show();
+            String url = null;
+            try {
+                url = GloableParams.ADDRESS_GET_JUMP_LOTNO + "?lotno=" + URLEncoder.encode(pihao, "utf-8")
+                        +"&sc_code=" + URLEncoder.encode(sc_code, "utf-8");
+            } catch (UnsupportedEncodingException e) {
+                e.printStackTrace();
+            }
+            PdaApplication.mRequestQueue.cancelAll(TAG + "getJumpLotno");
+            mStringRequest = new StringRequest(Request.Method.GET, url,
+                    new Response.Listener<String>() {
+                        @Override
+                        public void onResponse(String s) {
+                            progressDialog.dismiss();
+                            try {
+                                boolean isSuccess = new JSONObject(s).getBoolean("success");
+                                if(isSuccess){
+                                    JSONObject dataObject = new JSONObject(s).getJSONObject("data");
+                                    if (dataObject != null) {
+                                        String lotno=JsonUtils.optStringNotNull(dataObject, "LOTNO")+"";
+                                        String makecode=JsonUtils.optStringNotNull(dataObject, "MAKECODE")+"";
+                                        String stepName=JsonUtils.optStringNotNull(dataObject,"STEPNAME");
+                                        String resultStr = "生产批号:" + lotno +",工单号:"+makecode;
+                                        stepcode=JsonUtils.optStringNotNull(dataObject, "STEPCODE")+"";//当前工序
+                                        cr_code=JsonUtils.optStringNotNull(dataObject,"CRAFTCODE");//途程编号
+                                        tv_result.setVisibility(View.VISIBLE);
+                                        tv_result.setText(resultStr);
+                                        tv_current_gongxu.setText(stepcode+"("+stepName+")");
+                                        ed_jump.requestFocus();
+                                    }
+                                }
+                            } catch (JSONException e) {
+                                e.printStackTrace();
+                            }
+                        }
+                    },
+                    new Response.ErrorListener() {
+                        @Override
+                        public void onErrorResponse(VolleyError volleyError) {
+                            progressDialog.dismiss();
+                            String errorToast = CommonUtil.showErrorToast(volleyError, true);
+                            tv_result.setVisibility(View.VISIBLE);
+                            tv_result.setText(errorToast);
+                            ed_pihao.setText(null);
+                            ed_pihao.requestFocus();
+                        }
+                    }) {
+                @Override
+                public Map<String, String> getHeaders() throws AuthFailureError {
+                    return VolleyUtil.getVolleyUtil().setCookies();
+                }
+            };
+            mStringRequest.setRetryPolicy(new DefaultRetryPolicy(10 * 1000, 0, 1f));
+            mStringRequest.setTag(TAG + "getJumpLotno");
+            PdaApplication.mRequestQueue.add(mStringRequest);
+        }
+    }
+
+    private void jumpLotno() {
+        String pihao = ed_pihao.getText().toString().trim();
+        String tostepcode=ed_jump.getText().toString().trim();
+        if(TextUtils.isEmpty(pihao)){
+            CommonUtil.toastNoRepeat(mActivity,"生产批号不能为空");
+            return;
+        }
+        if(TextUtils.isEmpty(stepcode)){
+            CommonUtil.toastNoRepeat(mActivity,"请先解析生产批号");
+            return;
+        }
+        if(TextUtils.isEmpty(tostepcode)){
+            CommonUtil.toastNoRepeat(mActivity,"跳站工序不能为空");
+            return;
+        }
+
+        if (!TextUtils.isEmpty(pihao)) {
+            progressDialog.show();
+            PdaApplication.mRequestQueue.cancelAll(TAG + "jumpLotno");
+            mStringRequest = new StringRequest(Request.Method.POST ,GloableParams.ADDRESS_JUMP_LOTNO,
+                    new Response.Listener<String>() {
+                        @Override
+                        public void onResponse(String s) {
+                            progressDialog.dismiss();
+                            try {
+                                boolean issuccess = new JSONObject(s).getBoolean("success");
+                                if (issuccess) {
+                                    JSONObject dataObject = new JSONObject(s).getJSONObject("data");
+                                    if(dataObject!=null){
+                                        String resultStr = "跳站成功\n";
+                                        resultStr+="生产批号:"+JsonUtils.optStringNotNull(dataObject,"LOTNO")+" ";
+                                        resultStr+="当前工序:"+JsonUtils.optStringNotNull(dataObject,"STEPCODE");
+                                        tv_result.setVisibility(View.VISIBLE);
+                                        tv_result.setText(resultStr);
+                                        //清除数据
+                                        ed_pihao.setText(null);
+                                        ed_pihao.requestFocus();
+                                        tv_current_gongxu.setText("");
+                                        ed_jump.setText("");
+                                        tv_select_gongxu.setText("");
+                                        tv_select_gongxu.setVisibility(View.GONE);
+                                    }
+
+                                }
+                            } catch (JSONException e) {
+                                e.printStackTrace();
+                            }
+                        }
+                    },
+                    new Response.ErrorListener() {
+                        @Override
+                        public void onErrorResponse(VolleyError volleyError) {
+                            progressDialog.dismiss();
+                            String errorToast = CommonUtil.showErrorToast(volleyError, true);
+                            tv_result.setVisibility(View.VISIBLE);
+                            tv_result.setText(errorToast);
+                            //清除数据
+                            ed_pihao.setText(null);
+                            ed_pihao.requestFocus();
+                            tv_current_gongxu.setText("");
+                            ed_jump.setText("");
+                            tv_select_gongxu.setText("");
+                            tv_select_gongxu.setVisibility(View.GONE);
+                        }
+                    }) {
+                @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("lotno",pihao);
+                    params.put("sc_code",sc_code);
+                    params.put("stepcode",stepcode);
+                    params.put("tostepcode",tostepcode );
+                    return params;
+                }
+            };
+            mStringRequest.setRetryPolicy(new DefaultRetryPolicy(10 * 1000, 0, 1f));
+            mStringRequest.setTag(TAG + "saveBadData");
+            PdaApplication.mRequestQueue.add(mStringRequest);
+        }
+    }
+
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        if (resultCode == Activity.RESULT_OK&&requestCode == SCAN_BARCODE_CODE && data != null) {
+            if (data.getExtras() != null) {
+                String result = data.getExtras().getString(CodeUtils.RESULT_STRING);
+                if (mFocusId == R.id.ed_pihao) {
+                  ed_pihao.setText(result);
+                  getPihaoData();
+                }else if(mFocusId == R.id.ed_jump){
+                    ed_jump.setText(result);
+                    ed_jump.setSelection(result.length());
+                }
+            }
+        }
+        //不良代码选择之后回调
+        if (requestCode == Constants.FLAG.GET_COMMON_ITEM && resultCode == 1847) {
+            String result = data.getStringExtra("ITEM_DATA");
+            if(result.contains("-")&&result.split("-").length>=2){
+                ed_jump.setText(result.split("-")[0]);
+                ed_jump.setSelection(result.split("-")[0].length());
+                tv_select_gongxu.setText(result.split("-")[1]);
+                tv_select_gongxu.setVisibility(View.VISIBLE);
+            }
+        }
+    }
+
+    @Override
+    protected void initDatas() {
+        Bundle bundle = getArguments();//从activity传过来的Bundle
+        if(bundle!=null){
+            sc_code = bundle.getString(Constants.FLAG.SC_CODE);
+            ma_code = bundle.getString(Constants.FLAG.MA_CODE);
+        }
+    }
+
+    @Override
+    public void onHiddenChanged(boolean hidden) {
+        super.onHiddenChanged(hidden);
+        if (!hidden) {
+            FunctionActivity.setTitle("跳站");
+            ((FunctionActivity) mActivity).setScanIvVisible(true);
+        }else{
+            ((FunctionActivity) mActivity).setScanIvVisible(false);
+        }
+    }
+
+    @Override
+    public void onDestroyView() {
+        super.onDestroyView();
+        ((FunctionActivity) mActivity).setScanIvVisible(false);
+    }
+
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        return false;
+    }
+
+    @Override
+    public boolean onFragmentBackPressed() {
+        return false;
+    }
+}

+ 430 - 0
app/src/main/java/com/uas/gdstorage/fragment/NoGoodListFragment.java

@@ -0,0 +1,430 @@
+package com.uas.gdstorage.fragment;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.content.DialogInterface;
+import android.os.Bundle;
+import android.support.annotation.Nullable;
+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.view.KeyEvent;
+import android.view.View;
+import android.widget.AutoCompleteTextView;
+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.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
+import com.scwang.smartrefresh.layout.api.RefreshLayout;
+import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
+import com.uas.gdstorage.R;
+import com.uas.gdstorage.activity.FunctionActivity;
+import com.uas.gdstorage.global.GloableParams;
+import com.uas.gdstorage.util.CommonUtil;
+import com.uas.gdstorage.util.Constants;
+import com.uas.gdstorage.util.FastjsonUtil;
+import com.uas.gdstorage.util.HttpCallback;
+import com.uas.gdstorage.util.HttpParams;
+import com.uas.gdstorage.util.LogUtil;
+import com.uas.gdstorage.util.VollyRequest;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by FANGlh on 2018/12/17.
+ * function:已上料列表
+ */
+
+public class NoGoodListFragment extends BaseFragment {
+    private String sc_code;
+    private StringRequest mStringRequest;
+    private RefreshLayout mRefreshLayout;
+    List<FeededBean> mFeededList;
+    private RecyclerView mRecyclerView;
+    private FeededListAdapter myAdapter = null;
+    private AutoCompleteTextView mSearch;
+
+    @Override
+    protected int getLayout() {
+        return R.layout.fragment_no_good_list;
+    }
+
+    @Override
+    protected void initViews() {
+        ((FunctionActivity) mActivity).setTitle("已采集列表");
+        mRefreshLayout = (RefreshLayout) root.findViewById(R.id.SmartRefreshLayout_id);
+        mSearch = root.findViewById(R.id.fl_search_actext);
+        mFeededList = new ArrayList<>();
+        myAdapter = new FeededListAdapter(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);
+    }
+
+    @Override
+    protected void initDatas() {
+        Bundle bundle = getArguments();//从activity传过来的Bundle
+        if (bundle != null) {
+            sc_code = bundle.getString(Constants.FLAG.SC_CODE);
+            getLoadingData();
+        }
+    }
+
+    @Override
+    protected void initEvents() {
+        mRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
+            @Override
+            public void onRefresh(RefreshLayout refreshLayout) {
+                getLoadingData();
+            }
+        });
+        myAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
+            @Override
+            public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
+                FeededBean bean = myAdapter.getBeanByPositon(position);
+                LogUtil.i("addOnItemTouchListener", JSON.toJSONString(bean));
+            }
+        });
+        myAdapter.setOnItemLongClickListener(new BaseQuickAdapter.OnItemLongClickListener() {
+            @Override
+            public boolean onItemLongClick(BaseQuickAdapter adapter, View view, int position) {
+                new AlertDialog.Builder(mActivity).setTitle("提示").setMessage("是否确认删除此行?")
+                        .setPositiveButton(getString(R.string.confirm), new DialogInterface.OnClickListener() {
+                            @Override
+                            public void onClick(DialogInterface dialog, int which) {
+                                dodeleteMSSSingle(position);
+                            }
+                        }).setNegativeButton(getString(R.string.cancel), null).create().show();
+                return false;
+            }
+        });
+        mSearch.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.length() == 0) {
+                    myAdapter.setmFeededList(mFeededList);
+                    myAdapter.notifyDataSetChanged();
+                } else {
+                    String mSearchStr = s.toString().trim();
+                    LogUtil.i("mSearchStrg", mSearchStr);
+                    doSearchSelect(mSearchStr);
+                }
+            }
+        });
+    }
+
+    private void dodeleteMSSSingle(int position) {
+        if (mFeededList.size() - 1 < position || mFeededList.get(position) == null) return;
+        int mss_id = myAdapter.getBeanByPositon(position).getMb_id();
+        progressDialog.show();
+        VollyRequest.getInstance().stringRequest(mStringRequest,
+                new HttpParams.Builder()
+                        .url(GloableParams.ADDRESS_DELETE_BAD_DATA)
+                        .method(Request.Method.POST)
+                        .tag(TAG + "deleteBadData")
+                        .flag(0)
+                        .addParam("sc_code",sc_code)
+                        .addParam("mb_id", mss_id + "")
+                        .build(), new HttpCallback() {
+                    @Override
+                    public void onSuccess(int flag, Object o) throws Exception {
+                        try {
+                            Boolean isSuccess = FastjsonUtil.getBoolean(o.toString(), "success");
+                            if (isSuccess) {
+                                CommonUtil.toastNoRepeat(mActivity, "删除成功");
+                                mFeededList.remove(position);
+                                myAdapter.notifyDataSetChanged();
+                            }
+                            progressDialog.dismiss();
+                        } catch (Exception e) {
+                        }
+                    }
+                    @Override
+                    public void onFail(int flag, String failStr) throws Exception {
+                        progressDialog.dismiss();
+                        CommonUtil.toastNoRepeat(mActivity, failStr);
+                    }
+                });
+
+    }
+
+
+    //搜索查询刷选
+    private void doSearchSelect(String mSearchStr) {
+        if (mSearchStr.length() == 0) return;
+        List<FeededBean> selectList = new ArrayList<>();
+        for (int i = 0; i < mFeededList.size(); i++) {
+            if (mFeededList.get(i).getMb_lotno().contains(mSearchStr)
+                    || (mFeededList.get(i).getMb_badname() + "").contains(mSearchStr)) {
+                selectList.add(mFeededList.get(i));
+            }
+            if (i == mFeededList.size() - 1) {
+                setAdapter(selectList);
+                LogUtil.i("selectList", JSON.toJSONString(selectList));
+            }
+        }
+    }
+
+
+    private void getLoadingData() {
+        if (sc_code == null) {
+            CommonUtil.toastNoRepeat(mActivity, "岗位资源为空");
+            return;
+        }
+        mFeededList.clear();
+        progressDialog.show();
+        VollyRequest.getInstance().stringRequest(mStringRequest,
+                new HttpParams.Builder()
+                        .url(GloableParams.ADDRESS_GET_BAD_DATA_BY_SOURCE)
+                        .method(Request.Method.GET)
+                        .tag(TAG + "getBadDataBySource")
+                        .flag(0)
+                        .addParam("sc_code", sc_code)
+                        .build(), new HttpCallback() {
+                    @Override
+                    public void onSuccess(int flag, Object o) throws Exception {
+                        try {
+                            Boolean isSuccess = FastjsonUtil.getBoolean(o.toString(), "success");
+                            if (isSuccess) {
+                                JSONArray dataArray = FastjsonUtil.getJSONArray(o.toString(), "data");
+                                handleFeededData(dataArray);
+                            }
+                            progressDialog.dismiss();
+                            mRefreshLayout.finishRefresh(0);
+                        } catch (Exception e) {
+                        }
+                    }
+
+                    @Override
+                    public void onFail(int flag, String failStr) throws Exception {
+                        progressDialog.dismiss();
+                        mRefreshLayout.finishRefresh(0);
+                        CommonUtil.toastNoRepeat(mActivity, failStr);
+                    }
+                });
+
+    }
+
+    private void handleFeededData(JSONArray dataArray) {
+        FeededBean bean;
+        for (Object index : dataArray) {
+            JSONObject data = (JSONObject) index;
+            bean= new FeededBean(
+                    data.getString("MA_PRODCODE"),
+                    data.getString("MB_BADCODE"),
+                    data.getString("MB_BADNAME"),
+                    data.getIntValue("MB_ID"),
+                    data.getString("MB_INMAN"),
+                    data.getString("MB_LOTNO"),
+                    data.getString("MB_MAKECODE"),
+                    data.getIntValue("MB_QTY"),
+                    data.getString("PR_DETAIL"));
+            mFeededList.add(bean);
+        }
+        setAdapter(mFeededList);
+    }
+
+    @Override
+    public void onAttach(Activity activity) {
+        super.onAttach(activity);
+        this.mActivity = activity;
+    }
+
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        return false;
+    }
+
+    @Override
+    public boolean onFragmentBackPressed() {
+        return false;
+    }
+
+    @Override
+    public void onDestroyView() {
+        super.onDestroyView();
+        ((FunctionActivity) mActivity).setDeleteImageView(false);
+    }
+
+    private void setAdapter(List<FeededBean> mList) {
+        LogUtil.i("mList", JSON.toJSONString(mList));
+        if (myAdapter == null) {
+            myAdapter = new FeededListAdapter(mList);
+            mRecyclerView.setAdapter(myAdapter);
+        } else {
+            myAdapter.setNewData(mList);
+        }
+    }
+
+
+    class FeededListAdapter extends BaseQuickAdapter<FeededBean, BaseViewHolder> {
+        private List<FeededBean> mmmdList;
+
+        public void setmFeededList(List<FeededBean> mmmdList) {
+            this.mmmdList = mmmdList;
+        }
+
+        public FeededBean getBeanByPositon(int position) {
+            return mmmdList.get(position);
+        }
+
+        public FeededListAdapter(@Nullable List<FeededBean> data) {
+            super(R.layout.item_has_caiji, data);
+            this.mmmdList = data;
+        }
+
+        @Override
+        protected void convert(BaseViewHolder helper, FeededBean item) {
+            TextView tv_pihao=helper.getView(R.id.tv_pihao);
+            TextView tv_product_num=helper.getView(R.id.tv_product_num);
+            TextView tv_product_name=helper.getView(R.id.tv_product_name);
+            TextView tv_code=helper.getView(R.id.tv_code);
+            TextView tv_man=helper.getView(R.id.tv_man);
+            TextView tv_gongdan=helper.getView(R.id.tv_gongdan);
+            TextView tv_num=helper.getView(R.id.tv_num);
+            if(!TextUtils.isEmpty(item.getMb_lotno())){
+                tv_pihao.setText(item.getMb_lotno());
+            }
+            if(!TextUtils.isEmpty(item.getMa_prodcode())){
+                tv_product_num.setText(item.getMa_prodcode());
+            }
+            if(!TextUtils.isEmpty(item.getPr_detail())){
+                tv_product_name.setText(item.getPr_detail());
+            }
+            if(!TextUtils.isEmpty(item.getMb_badcode())){
+                tv_code.setText(item.getMb_badcode());
+            }
+            if(!TextUtils.isEmpty(item.getMb_inman())){
+                tv_man.setText(item.getMb_inman());
+            }
+            if(!TextUtils.isEmpty(item.getMb_qty()+"")){
+                tv_num.setText(item.getMb_qty()+"");
+            }
+            if(!TextUtils.isEmpty(item.getMb_makecode()+"")){
+                tv_gongdan.setText(item.getMb_makecode()+"");
+            }
+        }
+    }
+
+    private static class FeededBean {
+
+        private String ma_prodcode;
+        private String mb_badcode;
+        private String mb_badname;
+        private int mb_id;
+        private String mb_inman;
+        private String mb_lotno;
+        private String mb_makecode;
+        private int mb_qty;
+        private String pr_detail;
+
+        public FeededBean(String ma_prodcode, String mb_badcode, String mb_badname, int mb_id, String mb_inman, String mb_lotno, String mb_makecode, int mb_qty, String pr_detail) {
+            this.ma_prodcode = ma_prodcode;
+            this.mb_badcode = mb_badcode;
+            this.mb_badname = mb_badname;
+            this.mb_id = mb_id;
+            this.mb_inman = mb_inman;
+            this.mb_lotno = mb_lotno;
+            this.mb_makecode = mb_makecode;
+            this.mb_qty = mb_qty;
+            this.pr_detail = pr_detail;
+        }
+
+        public String getMa_prodcode() {
+            return ma_prodcode;
+        }
+
+        public void setMa_prodcode(String ma_prodcode) {
+            this.ma_prodcode = ma_prodcode;
+        }
+
+        public String getMb_badcode() {
+            return mb_badcode;
+        }
+
+        public void setMb_badcode(String mb_badcode) {
+            this.mb_badcode = mb_badcode;
+        }
+
+        public String getMb_badname() {
+            return mb_badname;
+        }
+
+        public void setMb_badname(String mb_badname) {
+            this.mb_badname = mb_badname;
+        }
+
+        public int getMb_id() {
+            return mb_id;
+        }
+
+        public void setMb_id(int mb_id) {
+            this.mb_id = mb_id;
+        }
+
+        public String getMb_inman() {
+            return mb_inman;
+        }
+
+        public void setMb_inman(String mb_inman) {
+            this.mb_inman = mb_inman;
+        }
+
+        public String getMb_lotno() {
+            return mb_lotno;
+        }
+
+        public void setMb_lotno(String mb_lotno) {
+            this.mb_lotno = mb_lotno;
+        }
+
+        public String getMb_makecode() {
+            return mb_makecode;
+        }
+
+        public void setMb_makecode(String mb_makecode) {
+            this.mb_makecode = mb_makecode;
+        }
+
+        public int getMb_qty() {
+            return mb_qty;
+        }
+
+        public void setMb_qty(int mb_qty) {
+            this.mb_qty = mb_qty;
+        }
+
+        public String getPr_detail() {
+            return pr_detail;
+        }
+
+        public void setPr_detail(String pr_detail) {
+            this.pr_detail = pr_detail;
+        }
+    }
+
+}

+ 399 - 0
app/src/main/java/com/uas/gdstorage/fragment/NotGoodCaiJiFragment.java

@@ -0,0 +1,399 @@
+package com.uas.gdstorage.fragment;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.graphics.drawable.BitmapDrawable;
+import android.os.Bundle;
+import android.text.TextUtils;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.inputmethod.EditorInfo;
+import android.widget.Button;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.PopupWindow;
+import android.widget.TextView;
+
+import com.android.volley.AuthFailureError;
+import com.android.volley.DefaultRetryPolicy;
+import com.android.volley.Request;
+import com.android.volley.Response;
+import com.android.volley.VolleyError;
+import com.android.volley.toolbox.StringRequest;
+import com.uas.gdstorage.R;
+import com.uas.gdstorage.activity.CommonSeclecActivity;
+import com.uas.gdstorage.activity.FunctionActivity;
+import com.uas.gdstorage.application.PdaApplication;
+import com.uas.gdstorage.global.GloableParams;
+import com.uas.gdstorage.tools.VolleyUtil;
+import com.uas.gdstorage.util.CameraUtil;
+import com.uas.gdstorage.util.CommonUtil;
+import com.uas.gdstorage.util.Constants;
+import com.uas.gdstorage.util.FragmentUtils;
+import com.uas.gdstorage.util.JsonUtils;
+import com.uas.gdstorage.util.NumberUtil;
+import com.uas.gdstorage.view.ClearableEditText;
+import com.uuzuche.lib_zxing.activity.CaptureActivity;
+import com.uuzuche.lib_zxing.activity.CodeUtils;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Created by RaoMeng on 2017/5/4.
+ * 不良采集页面
+ */
+public class NotGoodCaiJiFragment extends BaseFragment {
+    private static final String TAG = "NotGoodCaiJiFragment";
+    private static final int SCAN_BARCODE_CODE = 106;
+    private ClearableEditText ed_pihao;
+    private ClearableEditText ed_num;
+    private ClearableEditText ed_code;
+    private ClearableEditText ed_remark;
+    private Button btn_confirm;
+    private TextView tv_result;
+    private StringRequest mStringRequest;
+    private ImageView mScanImageView;
+    private Button mMoreBtn;
+    private int mFocusId;
+    private boolean mIgnoreFocusChange = false;
+    private boolean isShop = false;
+    private String sc_code;
+    private String ma_code;
+    private PopupWindow mMenuPopupWindow;
+    private ImageView iv_search;
+    private TextView tv_no_good_code;
+    @Override
+    protected int getLayout() {
+        return R.layout.fragment_not_good_caiji;
+    }
+
+    @Override
+    protected void initViews() {
+        FunctionActivity.setTitle("不良采集");
+        ((FunctionActivity) mActivity).setScanIvVisible(true);
+        ((FunctionActivity) mActivity).setMoreBtnVisible(true);
+        mMoreBtn=mActivity.findViewById(R.id.btn_actionbar_more);
+        ed_pihao = (ClearableEditText) root.findViewById(R.id.ed_pihao);
+        ed_num = (ClearableEditText) root.findViewById(R.id.ed_num);
+        ed_code=(ClearableEditText)root.findViewById(R.id.ed_code);
+        ed_remark=(ClearableEditText)root.findViewById(R.id.ed_remark);
+        btn_confirm = (Button) root.findViewById(R.id.btn_confirm);
+        tv_result = (TextView) root.findViewById(R.id.tv_result);
+        mScanImageView = (ImageView) mActivity.findViewById(R.id.btn_actionbar_scan_iv);
+        iv_search=mActivity.findViewById(R.id.iv_search);
+        tv_no_good_code=mActivity.findViewById(R.id.tv_no_good_code);
+        ed_pihao.requestFocus();
+        initPopupWindow();
+    }
+
+    @Override
+    protected void initEvents() {
+        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));
+                }
+            }
+        });
+
+        ed_pihao.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+            @Override
+            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+                if (actionId == EditorInfo.IME_ACTION_SEND
+                        || actionId == EditorInfo.IME_ACTION_DONE
+                        || (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
+                    getPihaoData();
+                    return true;
+                }
+                return false;
+            }
+        });
+        mMoreBtn.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                CommonUtil.setBackgroundAlpha(getActivity(), 0.5f);
+                mMenuPopupWindow.showAsDropDown(mMoreBtn);
+            }
+        });
+        iv_search.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                Intent intent = new Intent(mActivity, CommonSeclecActivity.class);
+                intent.putExtra("sc_code", sc_code);
+                intent.putExtra("title", "不良代码");
+                intent.putExtra("type", 3);
+                startActivityForResult(intent, Constants.FLAG.GET_COMMON_ITEM);
+            }
+        });
+        btn_confirm.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                saveBadData();
+            }
+        });
+    }
+    private void initPopupWindow() {
+        View view = View.inflate(getActivity(), R.layout.pop_storage_recharge_menu, null);
+        Button doneButton = (Button) view.findViewById(R.id.pop_storage_recharge_menu_1);
+        Button todoButton = (Button) view.findViewById(R.id.pop_storage_recharge_menu_2);
+        doneButton.setText("已采集列表");
+        todoButton.setVisibility(View.GONE);
+        doneButton.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                closeMenuPopupWindow();
+                Bundle mbundle = new Bundle();
+                mbundle.putString(Constants.FLAG.SC_CODE, sc_code);
+                FragmentUtils.switchFragment(NotGoodCaiJiFragment.this, new NoGoodListFragment(), mbundle);
+            }
+        });
+        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);
+        }
+    }
+
+    private void getPihaoData() {
+        String pihao = ed_pihao.getText().toString().trim();
+        if (!TextUtils.isEmpty(pihao)) {
+            progressDialog.show();
+            String url = null;
+            try {
+                url = GloableParams.ADDRESS_GET_LOT_SOURCE_DATA + "?code=" + URLEncoder.encode(pihao, "utf-8")
+                        +"&sc_code=" + URLEncoder.encode(sc_code, "utf-8");
+            } catch (UnsupportedEncodingException e) {
+                e.printStackTrace();
+            }
+            PdaApplication.mRequestQueue.cancelAll(TAG + "getLotSourceData");
+            mStringRequest = new StringRequest(Request.Method.GET, url,
+                    new Response.Listener<String>() {
+                        @Override
+                        public void onResponse(String s) {
+                            ed_num.requestFocus();
+                            progressDialog.dismiss();
+                            try {
+                                boolean issuccess = new JSONObject(s).getBoolean("success");
+                                if(issuccess){
+                                    JSONObject dataObject = new JSONObject(s).getJSONObject("data");
+                                    if (dataObject != null) {
+                                        String resultStr = "生产批号:" + JsonUtils.optStringNotNull(dataObject, "V_LOTNO")
+                                                + ",不良数:" + JsonUtils.optStringNotNull(dataObject, "V_NGQTY") + "  " +
+                                                ",已采集不良数:" + JsonUtils.optStringNotNull(dataObject, "V_GETNGQTY") + "  " +
+                                                ",进站数:" + JsonUtils.optStringNotNull(dataObject, "V_INQTY")
+                                                + ",出站数:" + JsonUtils.optStringNotNull(dataObject, "V_OUTQTY")
+                                                + ",工单号:" + JsonUtils.optStringNotNull(dataObject, "V_MAKECODE");
+                                        String v_ngqty=JsonUtils.optStringNotNull(dataObject, "V_NGQTY")+"";
+                                        tv_result.setVisibility(View.VISIBLE);
+                                        tv_result.setText(resultStr);
+                                        ed_num.setText(v_ngqty);
+                                        ed_num.setSelection(v_ngqty.length());
+                                    }
+                                }
+                            } catch (JSONException e) {
+                                e.printStackTrace();
+                            }
+                        }
+                    },
+                    new Response.ErrorListener() {
+                        @Override
+                        public void onErrorResponse(VolleyError volleyError) {
+                            progressDialog.dismiss();
+                            String errorToast = CommonUtil.showErrorToast(volleyError, true);
+                            tv_result.setVisibility(View.VISIBLE);
+                            tv_result.setText(errorToast);
+                            ed_pihao.setText(null);
+                            ed_pihao.requestFocus();
+                        }
+                    }) {
+                @Override
+                public Map<String, String> getHeaders() throws AuthFailureError {
+                    return VolleyUtil.getVolleyUtil().setCookies();
+                }
+            };
+            mStringRequest.setRetryPolicy(new DefaultRetryPolicy(10 * 1000, 0, 1f));
+            mStringRequest.setTag(TAG + "getLotSourceData");
+            PdaApplication.mRequestQueue.add(mStringRequest);
+        }
+    }
+
+    private void saveBadData() {
+        String pihao = ed_pihao.getText().toString().trim();
+        String  ngqtyStr=ed_num.getText().toString().trim();
+        String bc_code=ed_code.getText().toString().trim();
+        String remark=ed_remark.getText().toString().trim();
+        int ngqty= NumberUtil.parseInt(ngqtyStr);
+        if(TextUtils.isEmpty(pihao)){
+            CommonUtil.toastNoRepeat(mActivity,"生产批号不能为空");
+            return;
+        }
+        if(ngqty<=0){
+            CommonUtil.toastNoRepeat(mActivity,"不良数量必须大于0");
+            return;
+        }
+        if(TextUtils.isEmpty(bc_code)){
+            CommonUtil.toastNoRepeat(mActivity,"不良代码不能为空");
+            return;
+        }
+        if (!TextUtils.isEmpty(pihao)) {
+            progressDialog.show();
+            PdaApplication.mRequestQueue.cancelAll(TAG + "saveBadData");
+            mStringRequest = new StringRequest(Request.Method.POST ,GloableParams.ADDRESS_SAVE_BAD_DATA,
+                    new Response.Listener<String>() {
+                        @Override
+                        public void onResponse(String s) {
+                            progressDialog.dismiss();
+                            try {
+                                boolean issuccess = new JSONObject(s).getBoolean("success");
+                                if (issuccess) {
+                                    String resultStr = "不良采集成功。";
+                                    tv_result.setVisibility(View.VISIBLE);
+                                    tv_result.setText(resultStr);
+                                    //清除数据
+                                    ed_pihao.setText(null);
+                                    ed_pihao.requestFocus();
+                                    ed_num.setText("");
+                                    ed_code.setText("");
+                                    ed_remark.setText("");
+                                    tv_no_good_code.setText("");
+                                    tv_no_good_code.setVisibility(View.GONE);
+                                }
+                            } catch (JSONException e) {
+                                e.printStackTrace();
+                            }
+                        }
+                    },
+                    new Response.ErrorListener() {
+                        @Override
+                        public void onErrorResponse(VolleyError volleyError) {
+                            progressDialog.dismiss();
+                            String errorToast = CommonUtil.showErrorToast(volleyError, true);
+                            tv_result.setVisibility(View.VISIBLE);
+                            tv_result.setText(errorToast);
+                            //清除数据
+                            ed_pihao.setText(null);
+                            ed_pihao.requestFocus();
+                            ed_num.setText("");
+                            ed_code.setText("");
+                            ed_remark.setText("");
+                            tv_no_good_code.setText("");
+                            tv_no_good_code.setVisibility(View.GONE);
+                        }
+                    }) {
+                @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("code", pihao);
+                    params.put("sc_code", sc_code);
+                    params.put("bc_code", bc_code);
+                    params.put("ngqty", ngqtyStr);
+                    params.put("remark", remark);
+                    return params;
+                }
+            };
+            mStringRequest.setRetryPolicy(new DefaultRetryPolicy(10 * 1000, 0, 1f));
+            mStringRequest.setTag(TAG + "saveBadData");
+            PdaApplication.mRequestQueue.add(mStringRequest);
+        }
+    }
+
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        if (resultCode == Activity.RESULT_OK&&requestCode == SCAN_BARCODE_CODE && data != null) {
+            if (data.getExtras() != null) {
+                String result = data.getExtras().getString(CodeUtils.RESULT_STRING);
+                if (mFocusId == R.id.ed_pihao) {
+                  ed_pihao.setText(result);
+                  ed_pihao.setSelection(result.length());
+                }else if(mFocusId == R.id.ed_num){
+                    ed_num.setText(result);
+                    ed_num.setSelection(result.length());
+                }else if(mFocusId == R.id.ed_code){
+                    ed_code.setText(result);
+                    ed_code.setSelection(result.length());
+                }else if(mFocusId == R.id.ed_remark){
+                    ed_remark.setText(result);
+                    ed_remark.setSelection(result.length());
+                }
+            }
+        }
+        //不良代码选择之后回调
+        if (requestCode == Constants.FLAG.GET_COMMON_ITEM && resultCode == 1847) {
+            String result = data.getStringExtra("ITEM_DATA");
+            if(result.contains("-")&&result.split("-").length>=2){
+                ed_code.setText(result.split("-")[0]);
+                tv_no_good_code.setText(result.split("-")[1]);
+                tv_no_good_code.setVisibility(View.VISIBLE);
+            }
+        }
+    }
+
+    @Override
+    protected void initDatas() {
+        Bundle bundle = getArguments();//从activity传过来的Bundle
+        if(bundle!=null){
+            sc_code = bundle.getString(Constants.FLAG.SC_CODE);
+            ma_code = bundle.getString(Constants.FLAG.MA_CODE);
+        }
+    }
+
+    @Override
+    public void onHiddenChanged(boolean hidden) {
+        super.onHiddenChanged(hidden);
+        if (!hidden) {
+            FunctionActivity.setTitle("不良采集");
+            ((FunctionActivity) mActivity).setScanIvVisible(true);
+            ((FunctionActivity) mActivity).setMoreBtnVisible(true);
+        }else{
+            ((FunctionActivity) mActivity).setScanIvVisible(false);
+            ((FunctionActivity) mActivity).setMoreBtnVisible(false);
+        }
+    }
+
+    @Override
+    public void onDestroyView() {
+        super.onDestroyView();
+        ((FunctionActivity) mActivity).setScanIvVisible(false);
+        ((FunctionActivity) mActivity).setMoreBtnVisible(false);
+    }
+
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        return false;
+    }
+
+    @Override
+    public boolean onFragmentBackPressed() {
+        return false;
+    }
+}

+ 27 - 16
app/src/main/java/com/uas/gdstorage/fragment/ReportDetailFragment.java

@@ -1,16 +1,20 @@
 package com.uas.gdstorage.fragment;
 
 import android.os.Bundle;
-import android.text.TextUtils;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
 import android.view.KeyEvent;
 import android.view.View;
 import android.widget.TextView;
 
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.android.volley.Request;
 import com.android.volley.toolbox.StringRequest;
 import com.uas.gdstorage.R;
 import com.uas.gdstorage.activity.FunctionActivity;
+import com.uas.gdstorage.adapter.ReportDetailAdapter;
+import com.uas.gdstorage.bean.ReportDetailBean;
 import com.uas.gdstorage.global.GloableParams;
 import com.uas.gdstorage.util.CommonUtil;
 import com.uas.gdstorage.util.Constants;
@@ -19,12 +23,18 @@ import com.uas.gdstorage.util.HttpCallback;
 import com.uas.gdstorage.util.HttpParams;
 import com.uas.gdstorage.util.VollyRequest;
 
+import java.util.ArrayList;
+import java.util.List;
+
 public class ReportDetailFragment extends BaseFragment {
     private StringRequest mStringRequest;
     private Boolean canReturn = true;
     private TextView tv_pichi,tv_report_num,tv_destory_num,tv_report_man,tv_report_time;
     private String sc_code;
     private String ma_code;
+    private RecyclerView rv_content;
+    private ReportDetailAdapter reportDetailAdapter;
+    private List<ReportDetailBean> mList;
     @Override
     protected int getLayout() {
         return R.layout.fragment_report_detail;
@@ -38,6 +48,11 @@ public class ReportDetailFragment extends BaseFragment {
         tv_destory_num=root.findViewById(R.id.tv_destory_num);
         tv_report_man=root.findViewById(R.id.tv_report_man);
         tv_report_time=root.findViewById(R.id.tv_report_time);
+        rv_content=root.findViewById(R.id.rv_content);
+        mList = new ArrayList<>();
+        rv_content.setLayoutManager(new LinearLayoutManager(mActivity));
+        reportDetailAdapter=new ReportDetailAdapter();
+        rv_content.setAdapter(reportDetailAdapter);
     }
     @Override
     protected void initEvents() {
@@ -76,22 +91,18 @@ public class ReportDetailFragment extends BaseFragment {
                         try {
                             Boolean isSuccess = FastjsonUtil.getBoolean(o.toString(), "success");
                             if (isSuccess) {
-                                JSONObject dataObject = FastjsonUtil.getJSONObject(o.toString(), "data");
-                                if(!TextUtils.isEmpty(dataObject.getString("SP_LOTNO"))){
-                                    tv_pichi.setText(dataObject.getString("SP_LOTNO"));
-                                }
-                                if(!TextUtils.isEmpty(dataObject.getString("SP_QTY"))){
-                                    tv_report_num.setText(dataObject.getString("SP_QTY"));
-                                }
-                                if(!TextUtils.isEmpty(dataObject.getString("SP_NGQTY"))){
-                                    tv_destory_num.setText(dataObject.getString("SP_NGQTY"));
-                                }
-                                if(!TextUtils.isEmpty(dataObject.getString("SP_INMAN"))){
-                                    tv_report_man.setText(dataObject.getString("SP_INMAN"));
-                                }
-                                if(!TextUtils.isEmpty(dataObject.getString("SP_DATE"))){
-                                    tv_report_time.setText(dataObject.getString("SP_DATE"));
+                                JSONArray dataArray = FastjsonUtil.getJSONArray(o.toString(),"data");
+                                for(Object index:dataArray){
+                                    JSONObject data = (JSONObject) index;
+                                    ReportDetailBean bean = new ReportDetailBean();
+                                    bean.setSp_date(data.getLong("SP_DATE"));
+                                    bean.setSp_inman(data.getString("SP_INMAN"));
+                                    bean.setSp_lotno(data.getString("SP_LOTNO"));
+                                    bean.setSp_ngqty(data.getIntValue("SP_NGQTY"));
+                                    bean.setSp_qty(data.getIntValue("SP_QTY"));
+                                    mList.add(bean);
                                 }
+                                reportDetailAdapter.setNewData(mList);
                             }
                         } catch (Exception e) {
 

+ 42 - 1
app/src/main/java/com/uas/gdstorage/fragment/WorkOrderSearchFragment.java

@@ -1,5 +1,6 @@
 package com.uas.gdstorage.fragment;
 
+import android.app.Activity;
 import android.content.Intent;
 import android.os.Bundle;
 import android.support.annotation.Nullable;
@@ -12,6 +13,7 @@ import android.view.KeyEvent;
 import android.view.View;
 import android.view.inputmethod.EditorInfo;
 import android.widget.Button;
+import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.TextView;
 
@@ -28,6 +30,7 @@ import com.uas.gdstorage.R;
 import com.uas.gdstorage.activity.FunctionActivity;
 import com.uas.gdstorage.activity.IndexActivity;
 import com.uas.gdstorage.global.GloableParams;
+import com.uas.gdstorage.util.CameraUtil;
 import com.uas.gdstorage.util.CommonUtil;
 import com.uas.gdstorage.util.Constants;
 import com.uas.gdstorage.util.FastjsonUtil;
@@ -37,6 +40,8 @@ import com.uas.gdstorage.util.LogUtil;
 import com.uas.gdstorage.util.StringUtil;
 import com.uas.gdstorage.util.VollyRequest;
 import com.uas.gdstorage.view.ClearableEditText;
+import com.uuzuche.lib_zxing.activity.CaptureActivity;
+import com.uuzuche.lib_zxing.activity.CodeUtils;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -62,7 +67,9 @@ public class WorkOrderSearchFragment extends BaseFragment {
     private TextView guigeTv;
     private JSONObject detailOne;
     private String sc_code;
-
+    private ImageView mScanImageView;
+    private int mFocusId;
+    private static final int SCAN_BARCODE_CODE = 201;
     @Override
     protected int getLayout() {
         return R.layout.work_order_search_fragment;
@@ -71,6 +78,8 @@ public class WorkOrderSearchFragment extends BaseFragment {
     @Override
     protected void initViews() {
         FunctionActivity.setTitle("工单绑定");
+        ((FunctionActivity) mActivity).setScanIvVisible(true);
+        mScanImageView = (ImageView)mActivity.findViewById(R.id.btn_actionbar_scan_iv);
         initStartView();
         mSearch = root.findViewById(R.id.fl_search_actext);
         mRefreshLayout = root.findViewById(R.id.SmartRefreshLayout_id);
@@ -87,6 +96,7 @@ public class WorkOrderSearchFragment extends BaseFragment {
 
         mRefreshLayout.setEnableRefresh(false);
         mRefreshLayout.setEnableLoadMore(false);
+        mSearch.requestFocus();
     }
 
     private void initStartView() {
@@ -102,6 +112,21 @@ public class WorkOrderSearchFragment extends BaseFragment {
 
     @Override
     protected void initEvents() {
+        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));
+                }
+            }
+        });
         mRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
             @Override
             public void onRefresh(RefreshLayout refreshLayout) {
@@ -392,5 +417,21 @@ public class WorkOrderSearchFragment extends BaseFragment {
         return false;
     }
 
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        if (resultCode != Activity.RESULT_OK) {
+            return;
+        }
 
+        if (requestCode == SCAN_BARCODE_CODE && data != null) {
+            if (data.getExtras() != null) {
+                String result = data.getExtras().getString(CodeUtils.RESULT_STRING);
+                if (mFocusId == R.id.fl_search_actext) {
+                    mSearch.setText(result);
+                    mSearch.setSelection(result.length());
+                }
+            }
+        }
+    }
 }

+ 92 - 4
app/src/main/java/com/uas/gdstorage/global/GloableParams.java

@@ -257,11 +257,50 @@ public class GloableParams {
     public static String ADDRESS_SPOTCHECK_SAVEMAKEQUALITYYC;
     public static String ADDRESS_WIPSTEPTURN_SEND;
     public static String ADDRESS_WIPSTEPTURN_ACCEPT;
+    //不良采集
+    public static String ADDRESS_GET_LOT_SOURCE_DATA;
+    public static String ADDRESS_GET_BAD_CODE_LIST;
+    public static String ADDRESS_GET_BAD_CODE;
+    public static String ADDRESS_SAVE_BAD_DATA;
+    //不良信息列表
+    public static String ADDRESS_GET_BAD_DATA_BY_SOURCE;
+    public static String ADDRESS_DELETE_BAD_DATA;
+    //拆批
+    public static String ADDRESS_GET_SPLIT_LOTNO;
+    public static String ADDRESS_SPLIT_LOTNO;
+    //跳站 getJumpLotno getJumpStep jumpLotno
+    public static String ADDRESS_GET_JUMP_LOTNO;
+    public static String ADDRESS_GET_JUMP_STEP;
+    public static String ADDRESS_JUMP_LOTNO;
+    //合批
+    public static String ADDRESS_GET_MERGE_LOTNO;
+    public static String ADDRESS_MERGE_LOTNO;
+
 
 
     /**
      * 高登
      */
+    //不良采集
+    public static String ADDRESSTAIL_GET_LOT_SOURCE_DATA="/api/pdashop/makebad/getLotSourceData.action";
+    public static String ADDRESSTAIL_GET_BAD_CODE_LIST="/api/pdashop/makebad/getBadCodeList.action";
+    public static String ADDRESSTAIL_GET_BAD_CODE="/api/pdashop/makebad/getBadCode.action";
+    public static String ADDRESSTAIL_SAVE_BAD_DATA="/api/pdashop/makebad/saveBadData.action";
+    //不良信息列表
+    public static String ADDRESSTAIL_GET_BAD_DATA_BY_SOURCE="/api/pdashop/makebad/getBadDataBySource.action";
+    public static String ADDRESSTAIL_DELETE_BAD_DATA="/api/pdashop/makebad/deleteBadData.action";
+    //拆批
+    public static String ADDRESSTAIL_GET_SPLIT_LOTNO="/api/pdashop/special/getSplitLotno.action";
+    public static String ADDRESSTAIL_SPLIT_LOTNO="/api/pdashop/special/splitLotno.action";
+    //跳站 getJumpLotno getJumpStep jumpLotno
+    public static String ADDRESSTAIL_GET_JUMP_LOTNO="/api/pdashop/special/getJumpLotno.action";
+    public static String ADDRESSTAIL_GET_JUMP_STEP="/api/pdashop/special/getJumpStep.action";
+    public static String ADDRESSTAIL_JUMP_LOTNO="/api/pdashop/special/jumpLotno.action";
+    //合批
+    public static String ADDRESSTAIL_GET_MERGE_LOTNO="/api/pdashop/special/getMergeLotno.action";
+    public static String ADDRESSTAIL_MERGE_LOTNO="/api/pdashop/special/mergeLotno.action";
+
+
     //内部质量投诉单保存
     private static final String ADDRESSTAIL_SPOTCHECK_SAVEQUACOMPLAIN = "/api/pda/spotcheck/savequaComplain.action";
     //过程异常反馈处理单保存
@@ -735,6 +774,14 @@ public class GloableParams {
      */
     private static final String ADDRESSTAIL_WIPSTEPTURN_ACCEPT = "/api/pdashop/wipStepTurn/accept.action";
 
+
+
+
+
+
+
+
+
     /***********************************************************************************************/
     /*界面文字和图片资源,控制后续数据一致*/
     //home主页面
@@ -757,20 +804,31 @@ public class GloableParams {
     public static final String GRIDNAME_STEP_TRANSFER = "工步移交";
     public static final String GRIDNAME_STEP_RECEIVE = "工步接收";
     public static final String GRIDNAME_COME_IN_SITE = "进站";
+    public static final String GRIDNAME_BULIANG_CAIJI = "不良采集";
+    public static final String GRIDNAME_CHAI_PI = "拆批";
+    public static final String GRIDNAME_TIAO_ZHAN= "跳站";
+    public static final String GRIDNAME_HE_PI= "合批";
    // public static final String GRIDNAME_STAFF_CHANGE = "人员换岗";
     //public static final String GRIDNAME_STAFF_UP = "人员上线";
   //  public static final String GRIDNAME_STAFF_DOWN = "人员下线";
     public static String[] indexMainGridNames = {GRIDNAME_WORK_START,
-            GRIDNAME_WORK_PAUSE, GRIDNAME_WORK_SWITCH, GRIDNAME_COME_IN_SITE,GRIDNAME_IN_MATERIAL, GRIDNAME_TIME_REPORT,
+           GRIDNAME_WORK_PAUSE, GRIDNAME_WORK_SWITCH,
+           GRIDNAME_COME_IN_SITE,GRIDNAME_IN_MATERIAL, GRIDNAME_TIME_REPORT,
            GRIDNAME_TIME_REPORT_DETAIL,GRIDNAME_TIME_METRIAL_DETAIL,
-           GRIDNAME_STEP_TRANSFER,GRIDNAME_STEP_RECEIVE};
+           GRIDNAME_STEP_TRANSFER,GRIDNAME_STEP_RECEIVE,
+           GRIDNAME_BULIANG_CAIJI,GRIDNAME_CHAI_PI,
+           GRIDNAME_TIAO_ZHAN,GRIDNAME_HE_PI
+   };
 
     public static int[] indexMainGridImgs = {
             R.drawable.start, R.drawable.pause, R.drawable.swich,
             R.drawable.ic_storage_finish_in,
             R.drawable.feeded,R.drawable.report,
             R.drawable.ic_staff_up,R.drawable.ic_staff_down,
-            R.drawable.ic_storage_out,R.drawable.ic_storage_in};
+            R.drawable.ic_storage_out,R.drawable.ic_storage_in,
+            R.drawable.ic_exception_handle,R.drawable.storage_bach_operation,
+            R.drawable.index_smt_up,R.drawable.ic_merge_batch
+    };
 
     //INDEX:出入库管理Index
     public static final String GRIDNAME_CODEBAR_COLLECT = "入库";
@@ -1130,6 +1188,36 @@ public class GloableParams {
         GloableParams.ADDRESS_SPOTCHECK_SAVEMAKEQUALITYYC = uriHead + GloableParams.ADDRESSTAIL_SPOTCHECK_SAVEMAKEQUALITYYC;
         GloableParams.ADDRESS_WIPSTEPTURN_SEND = uriHead + GloableParams.ADDRESSTAIL_WIPSTEPTURN_SEND;
         GloableParams.ADDRESS_WIPSTEPTURN_ACCEPT = uriHead + GloableParams.ADDRESSTAIL_WIPSTEPTURN_ACCEPT;
-
+//        //不良采集
+//        public static String ADDRESS_GET_LOT_SOURCE_DATA;
+//        public static String ADDRESS_GET_BAD_CODE_LIST;
+//        public static String ADDRESS_GET_BAD_CODE;
+//        public static String ADDRESS_SAVE_BAD_DATA;
+        GloableParams.ADDRESS_GET_LOT_SOURCE_DATA = uriHead + GloableParams.ADDRESSTAIL_GET_LOT_SOURCE_DATA;
+        GloableParams.ADDRESS_GET_BAD_CODE_LIST = uriHead + GloableParams.ADDRESSTAIL_GET_BAD_CODE_LIST;
+        GloableParams.ADDRESS_GET_BAD_CODE = uriHead + GloableParams.ADDRESSTAIL_GET_BAD_CODE;
+        GloableParams.ADDRESS_SAVE_BAD_DATA = uriHead + GloableParams.ADDRESSTAIL_SAVE_BAD_DATA;
+//        //不良信息列表
+//        public static String ADDRESS_GET_BAD_DATA_BY_SOURCE;
+//        public static String ADDRESS_DELETE_BAD_DATA;
+//        //拆批
+//        public static String ADDRESS_GET_SPLIT_LOTNO;
+//        public static String ADDRESS_SPLIT_LOTNO;
+        GloableParams.ADDRESS_GET_BAD_DATA_BY_SOURCE = uriHead + GloableParams.ADDRESSTAIL_GET_BAD_DATA_BY_SOURCE;
+        GloableParams.ADDRESS_DELETE_BAD_DATA = uriHead + GloableParams.ADDRESSTAIL_DELETE_BAD_DATA;
+        GloableParams.ADDRESS_GET_SPLIT_LOTNO = uriHead + GloableParams.ADDRESSTAIL_GET_SPLIT_LOTNO;
+        GloableParams.ADDRESS_SPLIT_LOTNO = uriHead + GloableParams.ADDRESSTAIL_SPLIT_LOTNO;
+//        //跳站 getJumpLotno getJumpStep jumpLotno
+//        public static String ADDRESS_GET_JUMP_LOTNO;
+//        public static String ADDRESS_GET_JUMP_STEP;
+//        public static String ADDRESS_JUMP_LOTNO;
+//        //合批 getMergeLotno mergeLotno
+//        public static String ADDRESS_GET_MERGE_LOTNO;
+//        public static String ADDRESS_MERGE_LOTNO;
+        GloableParams.ADDRESS_GET_JUMP_LOTNO = uriHead + GloableParams.ADDRESSTAIL_GET_JUMP_LOTNO;
+        GloableParams.ADDRESS_GET_JUMP_STEP = uriHead + GloableParams.ADDRESSTAIL_GET_JUMP_STEP;
+        GloableParams.ADDRESS_JUMP_LOTNO = uriHead + GloableParams.ADDRESSTAIL_JUMP_LOTNO;
+        GloableParams.ADDRESS_GET_MERGE_LOTNO = uriHead + GloableParams.ADDRESSTAIL_GET_MERGE_LOTNO;
+        GloableParams.ADDRESS_MERGE_LOTNO = uriHead + GloableParams.ADDRESSTAIL_MERGE_LOTNO;
     }
 }

+ 27 - 0
app/src/main/java/com/uas/gdstorage/util/NullUtil.java

@@ -0,0 +1,27 @@
+package com.uas.gdstorage.util;
+
+import java.util.List;
+
+public final class NullUtil {
+
+    public static final boolean isNull(String str) {
+        return str == null || str.length() == 0 || "null".equalsIgnoreCase(str);
+    }
+
+    public static final boolean isNull(String[] str) {
+        return str == null || str.length == 0;
+    }
+
+    public static final boolean isNull(List<?> list) {
+        return list == null || list.size() == 0;
+//        try {
+//            return list == null || list.size() == 0;
+//        } catch (Exception e) {
+//            SysoManager.printlnError(" 判断为空 报异常 ");
+//            return true;
+//        }
+
+    }
+
+
+}

+ 222 - 0
app/src/main/java/com/uas/gdstorage/util/NumberUtil.java

@@ -0,0 +1,222 @@
+package com.uas.gdstorage.util;
+
+import android.annotation.SuppressLint;
+import android.text.TextUtils;
+
+import java.math.RoundingMode;
+import java.text.DecimalFormat;
+import java.text.NumberFormat;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.regex.PatternSyntaxException;
+
+
+
+public final class NumberUtil {
+
+    public static final int parseInt(String str) {
+        return parseInt(str, 0);
+    }
+
+    public static final int parseInt(String str, int defaultValue) {
+        try {
+
+            if (str.contains(" ")) {
+                str = str.replace(" ", "");
+            }
+
+            if(NullUtil.isNull(str)){
+                return 0;
+            }
+            defaultValue = Integer.parseInt(str);
+        } catch (Exception e) {
+//            SysoManager.printStackTrace(e);
+        }
+        return defaultValue;
+
+    }
+
+    public static final int parseIntContainsDouble(String str) {
+        try {
+            if (str.contains(" ")) {
+                str = str.replace(" ", "");
+            }
+            if (str.contains(".")) {
+                return (int) Double.parseDouble(str);
+            } else {
+                return Integer.parseInt(str);
+            }
+        } catch (Exception e) {
+            return 0;
+        }
+    }
+
+    public static final double parseDouble(String str) {
+        try {
+            if (str.contains(" ")) {
+                str = str.replace(" ", "");
+            }
+            return Double.parseDouble(str);
+        } catch (Exception e) {
+            return 0.0;
+        }
+    }
+
+    public static final float parseFloat(String str) {
+        try {
+            if (str.contains(" ")) {
+                str = str.replace(" ", "");
+            }
+            if (TextUtils.isEmpty(str)) {
+                return 0.0F;
+            }
+            return Float.parseFloat(str);
+        } catch (Exception e) {
+            return 0.0F;
+        }
+    }
+
+    public static final long parseLong(String str) {
+        try {
+            if (str.contains(" ")) {
+                str = str.replace(" ", "");
+            }
+            return Long.parseLong(str);
+        } catch (Exception e) {
+
+            return 0;
+        }
+    }
+
+    public static String addTwoLength(String str) {
+        if (str.length() == 1) {
+            str = "0" + str;
+        }
+        return str;
+    }
+
+
+    public static String MulMunber(String a, String b) {
+        return parseDouble(a) * parseDouble(b) + "";
+    }
+
+
+    public static boolean isNumeric(String str) {
+        Pattern pattern = Pattern.compile("^[-\\+]?[\\d]*$");
+
+        return pattern.matcher(parseNumber(str)).matches();
+    }
+
+    public static String parseNumber(String str) {
+
+        try {
+            if (str.contains(" ")) {
+                str = str.replace(" ", "");
+            }
+
+            String[] split = str.split("\\.");
+            str = split[0];
+            return Integer.parseInt(str) + "";
+        } catch (Exception e) {
+            return str;
+        }
+    }
+
+    /**
+     * 大陆手机号码11位数,匹配格式:前三位固定格式+后8位任意数
+     * 此方法中前三位格式有:
+     * 13+任意数
+     * 15+除4的任意数
+     * 18+除1和4的任意数
+     * 17+除9的任意数
+     * 147
+     */
+    public static boolean isChinaPhoneLegal(String str) throws PatternSyntaxException {
+        String regExp = "^((13[0-9])|(15[0-9])|(18[0-9])|(17[0-9])|(147))\\d{8}$";
+        Pattern p = Pattern.compile(regExp);
+        Matcher m = p.matcher(str);
+        return m.matches();
+    }
+
+    /**
+     * 金额格式化
+     *
+     * @param s   金额
+     * @param len 小数位数
+     * @return 格式后的金额
+     */
+    @SuppressLint("NewApi")
+    public static String formatMoney(String s, int len) {
+        String result;
+        try{
+            if (s.equals("") || "null".equals(s) || null == s || s.length() < 1||s.equals("0")) {
+                return "0.00";
+            }
+            NumberFormat formater = null;
+            double num = Double.parseDouble(s);
+            if (len == 0) {
+                formater = new DecimalFormat("###,###");
+            } else {
+                StringBuffer buff = new StringBuffer();
+                buff.append("###,###.");
+                for (int i = 0; i < len; i++) {
+                    buff.append("#");
+                }
+                formater = new DecimalFormat(buff.toString());
+                formater.setRoundingMode(RoundingMode.DOWN);
+            }
+             result = formater.format(num);
+            if(!TextUtils.isEmpty(result)&&!result.contains(".")){//对于整数,默认加上.00
+                result=result+".00";
+            }
+            if(!TextUtils.isEmpty(result)&&result.contains(".")&&(result.length()-1-result.indexOf(".")==1)){
+                result=result+"0";
+            }
+        }catch (Exception e){
+            result= "0.00";
+        }
+
+        return result;
+    }
+
+    /***
+     *银行卡号格式化
+     * @param s
+     * @return
+     */
+    public static String formatBankNum(String s) {
+        StringBuffer buff = new StringBuffer(s);
+        try {
+            if (s.equals("") || "null".equals(s) || null == s || s.length() < 5) {
+                return s;
+            }else if(s.length()>=5){
+                int size=s.length()/4;
+                for(int i=1;i<=size;i++){
+                    buff.insert(5*i-1," ");
+                }
+            }
+        }catch (Exception e){
+            buff = new StringBuffer();
+        }
+
+        return buff.toString().trim();//去除尾部空格
+    }
+    public static String formatPhone(String s) {
+        StringBuffer buff = new StringBuffer(s);
+        try{
+            if (s.equals("") || "null".equals(s) || null == s || s.length() < 4) {
+                return s;
+            }else if(s.length()>=4){
+                for(int i=0;i<s.length();i++){
+                    if(i==3||i==8){
+                        buff.insert(i," ");
+                    }
+                }
+            }
+
+        }catch (Exception e){
+            buff =new StringBuffer();
+        }
+        return buff.toString().trim();//去除尾部空格
+    }
+}

+ 6 - 0
app/src/main/res/drawable/bg_edittext_grey.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--未获得焦点下EditText-->
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="@color/color_dark_grey"/>
+    <corners android:radius="0dip"/>
+</shape>

+ 6 - 0
app/src/main/res/drawable/bg_edittext_unenable.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item android:state_enabled="true" android:drawable="@drawable/bg_edittext_normal"/>
+    <item android:state_enabled="false" android:drawable="@drawable/bg_edittext_grey"/>
+</selector>

+ 4 - 0
app/src/main/res/layout/activity_index.xml

@@ -210,6 +210,10 @@
                     android:id="@+id/grid_menu"
                     style="@style/MenuGridViewStyle"
                     android:numColumns="3" />
+                <View
+                    android:layout_width="match_parent"
+                    android:layout_height="100dp">
+                </View>
 
             </LinearLayout>
 

+ 2 - 1
app/src/main/res/layout/feeding_edit_pup.xml

@@ -1,6 +1,7 @@
 <?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:orientation="vertical"
+    android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:background="@color/background"
     >

+ 131 - 0
app/src/main/res/layout/fragment_caipi.xml

@@ -0,0 +1,131 @@
+<?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:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    >
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="vertical"
+        android:padding="@dimen/padding_normal"
+        android:background="@color/bg_content">
+        <TableLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:stretchColumns="1">
+
+            <TableRow
+                android:id="@+id/material_in_collect_num_tr"
+                android:layout_marginTop="5dp">
+
+                <TextView
+                    style="@style/tl_tv_style"
+                    android:layout_height="wrap_content"
+                    android:gravity="center"
+                    android:padding="10dp"
+                    android:text="生产批号"
+                    android:textColor="@color/red"
+                    android:textSize="14sp" />
+
+                <com.uas.gdstorage.view.ClearableEditText
+                    android:id="@+id/ed_pihao"
+                    style="@style/EditTextStyle"
+                    android:layout_width="0dp"
+                    android:layout_weight="1"
+                    android:focusable="true"
+                    android:focusableInTouchMode="true"
+                    android:hint="请输入生产批号"
+                    android:imeOptions="actionSend"
+                    android:textColor="@color/black"/>
+            </TableRow>
+
+
+            <TableRow
+                android:id="@+id/material_in_collect_lotno_tr"
+                android:layout_marginTop="5dp">
+
+                <TextView
+                    style="@style/tl_tv_style"
+                    android:layout_height="match_parent"
+                    android:gravity="center"
+                    android:padding="10dp"
+                    android:text="原数量"
+                    android:textColor="@color/black"
+                    android:textSize="14sp"/>
+
+                <com.uas.gdstorage.view.ClearableEditText
+                    android:id="@+id/ed_old_num"
+                    style="@style/EditTextStyle"
+                    android:layout_width="0dp"
+                    android:layout_weight="1"
+                    android:enabled="false"
+                    android:focusable="false"
+                    android:focusableInTouchMode="false"
+                    android:hint="请输入原数量"
+                    android:inputType="numberDecimal"
+                    android:textColor="@color/black"/>
+            </TableRow>
+            <TableRow
+                android:layout_marginTop="5dp">
+
+                <TextView
+                    style="@style/tl_tv_style"
+                    android:layout_height="match_parent"
+                    android:gravity="center"
+                    android:padding="10dp"
+                    android:text="拆分数量"
+                    android:textColor="@color/red"
+                    android:textSize="14sp"/>
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:background="@color/white"
+                    android:orientation="horizontal">
+
+                    <com.uas.gdstorage.view.ClearableEditText
+                        android:id="@+id/ed_caifen_num"
+                        style="@style/EditTextStyle"
+                        android:layout_width="0dp"
+                        android:layout_weight="1"
+                        android:hint="请输入拆分数量"
+                        android:textColor="@color/black"/>
+
+                </LinearLayout>
+
+                <TextView
+                    android:id="@+id/tv_no_good_code"
+                    style="@style/tl_tv_style"
+                    android:layout_height="match_parent"
+                    android:gravity="center"
+                    android:padding="10dp"
+                    android:text="不良代码"
+                    android:textColor="@color/text_normal"
+                    android:textSize="16sp"
+                    android:visibility="gone"
+                    />
+
+            </TableRow>
+        </TableLayout>
+        <Button
+            android:id="@+id/btn_confirm"
+            style="@style/ButtonStyle"
+            android:text="@string/confirm"/>
+        <TextView
+            android:id="@+id/tv_result"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="@dimen/spacing_big"
+            android:background="@drawable/shape_msg_block"
+            android:padding="10dp"
+            android:visibility="gone"
+            tools:text="采集成功,条码:786528238;数量:2;料号:209837;名称规格:瓶子"/>
+
+
+    </LinearLayout>
+
+
+</LinearLayout>

+ 173 - 0
app/src/main/res/layout/fragment_hepi.xml

@@ -0,0 +1,173 @@
+<?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:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    >
+     <android.support.v4.widget.NestedScrollView
+         android:layout_width="match_parent"
+         android:layout_height="match_parent">
+         <LinearLayout
+             android:layout_width="match_parent"
+             android:layout_height="match_parent"
+             android:orientation="vertical"
+             android:padding="@dimen/padding_normal"
+             android:background="@color/bg_content">
+             <TableLayout
+                 android:layout_width="match_parent"
+                 android:layout_height="wrap_content"
+                 android:stretchColumns="1">
+
+                 <TableRow
+                     android:id="@+id/material_in_collect_num_tr"
+                     android:layout_marginTop="5dp">
+
+                     <TextView
+                         style="@style/tl_tv_style"
+                         android:layout_height="wrap_content"
+                         android:gravity="center"
+                         android:padding="10dp"
+                         android:text="生产批号"
+                         android:textColor="@color/red"
+                         android:textSize="14sp" />
+                    <RelativeLayout
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:orientation="horizontal">
+                        <com.uas.gdstorage.view.ClearableEditText
+                            android:id="@+id/ed_pihao"
+                            style="@style/EditTextStyle"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:singleLine="true"
+                            android:focusable="true"
+                            android:focusableInTouchMode="true"
+                            android:hint="请输入生产批号"
+                            android:imeOptions="actionSearch"
+                            android:textColor="@color/black"/>
+                        <ImageView
+                            android:id="@+id/iv_close"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:layout_alignParentRight="true"
+                            android:layout_centerVertical="true"
+                            android:padding="10dp"
+                            android:src="@drawable/wrong"
+                            android:visibility="gone"/>
+
+                    </RelativeLayout>
+
+                 </TableRow>
+                 <TableRow
+                     android:layout_marginTop="5dp">
+
+                     <TextView
+                         style="@style/tl_tv_style"
+                         android:layout_height="match_parent"
+                         android:gravity="center"
+                         android:padding="10dp"
+                         android:text="合批批号"
+                         android:textColor="@color/red"
+                         android:textSize="14sp"/>
+
+                     <LinearLayout
+                         android:layout_width="match_parent"
+                         android:layout_height="wrap_content"
+                         android:background="@color/white"
+                         android:orientation="horizontal">
+
+                         <com.uas.gdstorage.view.ClearableEditText
+                             android:id="@+id/ed_hepi"
+                             style="@style/EditTextStyle"
+                             android:layout_width="0dp"
+                             android:singleLine="true"
+                             android:layout_weight="1"
+                             android:hint="请输入合批批号"
+                             android:textColor="@color/black"
+                             android:imeOptions="actionSearch"/>
+
+                     </LinearLayout>
+
+                     <TextView
+                         android:id="@+id/tv_no_good_code"
+                         style="@style/tl_tv_style"
+                         android:layout_height="match_parent"
+                         android:gravity="center"
+                         android:padding="10dp"
+                         android:text="不良代码"
+                         android:textColor="@color/text_normal"
+                         android:textSize="16sp"
+                         android:visibility="gone"
+                         />
+
+                 </TableRow>
+             </TableLayout>
+             <LinearLayout
+                 android:id="@+id/ll_title"
+                 android:layout_width="match_parent"
+                 android:layout_height="wrap_content"
+                 android:gravity="center"
+                 android:visibility="gone">
+                 <LinearLayout
+                     android:layout_width="wrap_content"
+                     android:layout_height="35dp"
+                     android:layout_marginLeft="20dp">
+                     <TextView
+                         android:layout_width="130dp"
+                         android:layout_height="match_parent"
+                         android:gravity="left|center"
+                         android:paddingLeft="20dp"
+                         android:textColor="@color/black"
+                         android:text="合并" />
+                     <TextView
+                         android:id="@+id/tv_total_num"
+                         android:layout_width="wrap_content"
+                         android:layout_height="match_parent"
+                         android:gravity="center_vertical"
+                         android:layout_marginLeft="40dp"
+                         android:text="0" />
+                     <ImageView
+                         android:layout_width="20dp"
+                         android:layout_height="20dp"
+                         android:layout_marginLeft="80dp"
+                         android:layout_gravity="center_vertical"
+                         android:src="@drawable/wrong"
+                         android:visibility="invisible"
+                         />
+                 </LinearLayout>
+
+             </LinearLayout>
+
+             <android.support.v7.widget.RecyclerView
+                 android:id="@+id/rv_content"
+                 android:layout_width="match_parent"
+                 android:layout_height="wrap_content"
+                 android:layout_marginTop="5dp"
+                 android:layout_marginBottom="5dp"
+                 tools:listitem="@layout/item_hepi">
+             </android.support.v7.widget.RecyclerView>
+             <Button
+                 android:id="@+id/btn_confirm"
+                 style="@style/ButtonStyle"
+                 android:text="@string/confirm"/>
+             <TextView
+                 android:id="@+id/tv_result"
+                 android:layout_width="match_parent"
+                 android:layout_height="wrap_content"
+                 android:layout_marginTop="@dimen/spacing_big"
+                 android:background="@drawable/shape_msg_block"
+                 android:padding="10dp"
+                 android:visibility="gone"
+                 tools:text="采集成功,条码:786528238;数量:2;料号:209837;名称规格:瓶子"/>
+
+
+         </LinearLayout>
+
+     </android.support.v4.widget.NestedScrollView>
+
+
+
+</LinearLayout>

+ 139 - 0
app/src/main/res/layout/fragment_jump_site.xml

@@ -0,0 +1,139 @@
+<?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:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    >
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="vertical"
+        android:padding="@dimen/padding_normal"
+        android:background="@color/bg_content">
+        <TableLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:stretchColumns="1">
+
+            <TableRow
+                android:id="@+id/material_in_collect_num_tr"
+                android:layout_marginTop="5dp">
+
+                <TextView
+                    style="@style/tl_tv_style"
+                    android:layout_height="wrap_content"
+                    android:gravity="center"
+                    android:padding="10dp"
+                    android:text="生产批号"
+                    android:textColor="@color/red"
+                    android:textSize="14sp" />
+
+                <com.uas.gdstorage.view.ClearableEditText
+                    android:id="@+id/ed_pihao"
+                    style="@style/EditTextStyle"
+                    android:layout_width="0dp"
+                    android:layout_weight="1"
+                    android:focusable="true"
+                    android:focusableInTouchMode="true"
+                    android:hint="请输入生产批号"
+                    android:imeOptions="actionSend"
+                    android:textColor="@color/black"/>
+            </TableRow>
+
+
+            <TableRow
+                android:id="@+id/material_in_collect_lotno_tr"
+                android:layout_marginTop="5dp">
+
+                <TextView
+                    style="@style/tl_tv_style"
+                    android:layout_height="match_parent"
+                    android:gravity="center"
+                    android:padding="10dp"
+                    android:text="当前工序"
+                    android:textColor="@color/black"
+                    android:textSize="14sp"/>
+                <TextView
+                    android:id="@+id/tv_current_gongxu"
+                    style="@style/tl_tv_style"
+                    android:layout_height="match_parent"
+                    android:gravity="left"
+                    android:padding="10dp"
+                    android:textColor="@color/black"
+                    android:textSize="14sp"
+                    android:visibility="visible"
+                    />
+
+            </TableRow>
+            <TableRow
+                android:layout_marginTop="5dp">
+
+                <TextView
+                    style="@style/tl_tv_style"
+                    android:layout_height="match_parent"
+                    android:gravity="center"
+                    android:padding="10dp"
+                    android:text="跳站工序"
+                    android:textColor="@color/red"
+                    android:textSize="14sp"/>
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:background="@color/white"
+                    android:orientation="horizontal">
+
+                    <com.uas.gdstorage.view.ClearableEditText
+                        android:id="@+id/ed_jump"
+                        style="@style/EditTextStyle"
+                        android:layout_width="0dp"
+                        android:layout_weight="1"
+                        android:hint="请输入不良代码"
+                        android:textColor="@color/black"/>
+
+                    <ImageView
+                        android:id="@+id/iv_search"
+                        android:layout_width="34dp"
+                        android:layout_height="34dp"
+                        android:layout_gravity="center_vertical"
+                        android:layout_marginRight="5dp"
+                        android:background="@drawable/bg_button"
+                        android:src="@drawable/search_48" />
+                </LinearLayout>
+                <TextView
+                    android:id="@+id/tv_select_gongxu"
+                    android:layout_height="match_parent"
+                    android:layout_width="wrap_content"
+                    android:gravity="center"
+                    android:text="不良代码"
+                    android:textColor="@color/text_normal"
+                    android:textSize="12sp"
+                    android:visibility="gone"
+                    />
+
+            </TableRow>
+
+        </TableLayout>
+
+        <Button
+            android:id="@+id/btn_confirm"
+            style="@style/ButtonStyle"
+            android:text="@string/confirm"/>
+
+
+        <TextView
+            android:id="@+id/tv_result"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="@dimen/spacing_big"
+            android:background="@drawable/shape_msg_block"
+            android:padding="10dp"
+            android:visibility="gone"
+            tools:text="采集成功,条码:786528238;数量:2;料号:209837;名称规格:瓶子"/>
+
+    </LinearLayout>
+
+
+</LinearLayout>

+ 36 - 0
app/src/main/res/layout/fragment_no_good_list.xml

@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:orientation="vertical"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:padding="16sp">
+
+    <AutoCompleteTextView
+        android:id="@+id/fl_search_actext"
+        style="@style/Search"
+        android:layout_height="35dp"
+        android:background="@drawable/shape_from_edit"
+        android:hint="@string/title_code_pihao"
+        android:padding="6dp"
+        android:imeOptions="actionSend"
+        android:gravity="left"
+        />
+    <com.scwang.smartrefresh.layout.SmartRefreshLayout
+        android:id="@+id/SmartRefreshLayout_id"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent">
+
+        <com.scwang.smartrefresh.layout.header.ClassicsHeader
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            app:srlAccentColor="@android:color/darker_gray" />
+
+        <android.support.v7.widget.RecyclerView
+            android:id="@+id/feeded_rv"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            />
+    </com.scwang.smartrefresh.layout.SmartRefreshLayout>
+
+</LinearLayout>

+ 162 - 0
app/src/main/res/layout/fragment_not_good_caiji.xml

@@ -0,0 +1,162 @@
+<?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:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    >
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="vertical"
+        android:padding="@dimen/padding_normal"
+        android:background="@color/bg_content">
+        <TableLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:stretchColumns="1">
+
+            <TableRow
+                android:id="@+id/material_in_collect_num_tr"
+                android:layout_marginTop="5dp">
+
+                <TextView
+                    style="@style/tl_tv_style"
+                    android:layout_height="wrap_content"
+                    android:gravity="center"
+                    android:padding="10dp"
+                    android:text="生产批号"
+                    android:textColor="@color/red"
+                    android:textSize="14sp" />
+
+                <com.uas.gdstorage.view.ClearableEditText
+                    android:id="@+id/ed_pihao"
+                    style="@style/EditTextStyle"
+                    android:layout_width="0dp"
+                    android:layout_weight="1"
+                    android:focusable="true"
+                    android:focusableInTouchMode="true"
+                    android:hint="请输入生产批号"
+                    android:imeOptions="actionSend"
+                    android:textColor="@color/black"/>
+            </TableRow>
+
+
+            <TableRow
+                android:id="@+id/material_in_collect_lotno_tr"
+                android:layout_marginTop="5dp">
+
+                <TextView
+                    style="@style/tl_tv_style"
+                    android:layout_height="match_parent"
+                    android:gravity="center"
+                    android:padding="10dp"
+                    android:text="不良数量"
+                    android:textColor="@color/red"
+                    android:textSize="14sp"/>
+
+                <com.uas.gdstorage.view.ClearableEditText
+                    android:id="@+id/ed_num"
+                    style="@style/EditTextStyle"
+                    android:layout_width="0dp"
+                    android:layout_weight="1"
+                    android:hint="请输入数量"
+                    android:inputType="numberDecimal"
+                    android:textColor="@color/black"/>
+            </TableRow>
+            <TableRow
+                android:layout_marginTop="5dp">
+
+                <TextView
+                    style="@style/tl_tv_style"
+                    android:layout_height="match_parent"
+                    android:gravity="center"
+                    android:padding="10dp"
+                    android:text="不良代码"
+                    android:textColor="@color/red"
+                    android:textSize="14sp"/>
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:background="@color/white"
+                    android:orientation="horizontal">
+
+                    <com.uas.gdstorage.view.ClearableEditText
+                        android:id="@+id/ed_code"
+                        style="@style/EditTextStyle"
+                        android:layout_width="0dp"
+                        android:layout_weight="1"
+                        android:hint="请输入不良代码"
+                        android:textColor="@color/black"/>
+
+                    <ImageView
+                        android:id="@+id/iv_search"
+                        android:layout_width="34dp"
+                        android:layout_height="34dp"
+                        android:layout_gravity="center_vertical"
+                        android:layout_marginRight="5dp"
+                        android:background="@drawable/bg_button"
+                        android:src="@drawable/search_48" />
+                </LinearLayout>
+
+
+
+                <TextView
+                    android:id="@+id/tv_no_good_code"
+                    style="@style/tl_tv_style"
+                    android:layout_height="match_parent"
+                    android:gravity="center"
+                    android:padding="10dp"
+                    android:text="不良代码"
+                    android:textColor="@color/text_normal"
+                    android:textSize="16sp"
+                    android:visibility="gone"
+                    />
+
+            </TableRow>
+            <TableRow
+                android:layout_marginTop="5dp">
+
+                <TextView
+                    style="@style/tl_tv_style"
+                    android:layout_height="match_parent"
+                    android:gravity="center"
+                    android:padding="10dp"
+                    android:text="备注"
+                    android:textColor="@color/black"
+                    android:textSize="14sp"/>
+
+                <com.uas.gdstorage.view.ClearableEditText
+                    android:id="@+id/ed_remark"
+                    style="@style/EditTextStyle"
+                    android:layout_width="0dp"
+                    android:layout_weight="1"
+                    android:hint="请输入备注"
+                    android:textColor="@color/black"/>
+
+            </TableRow>
+        </TableLayout>
+
+        <Button
+            android:id="@+id/btn_confirm"
+            style="@style/ButtonStyle"
+            android:text="@string/confirm"/>
+
+
+        <TextView
+            android:id="@+id/tv_result"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="@dimen/spacing_big"
+            android:background="@drawable/shape_msg_block"
+            android:padding="10dp"
+            android:visibility="gone"
+            tools:text="采集成功,条码:786528238;数量:2;料号:209837;名称规格:瓶子"/>
+
+
+    </LinearLayout>
+
+
+</LinearLayout>

+ 6 - 103
app/src/main/res/layout/fragment_report_detail.xml

@@ -4,109 +4,12 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:orientation="vertical">
-
-    <LinearLayout
+    <android.support.v7.widget.RecyclerView
+        android:id="@+id/rv_content"
         android:layout_width="match_parent"
-        android:layout_height="wrap_content"
-        android:orientation="vertical"
-        android:padding="20dp">
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="6dp"
-            android:orientation="horizontal">
-            <TextView
-                android:layout_width="90dp"
-                android:layout_height="match_parent"
-                android:text="生产批次号:"
-                android:textColor="@color/body_text_1"
-                android:textSize="14sp" />
-            <TextView
-                android:id="@+id/tv_pichi"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:layout_weight="1"
-                android:paddingLeft="6dp"
-                android:textColor="@color/body_text_1"
-                android:textSize="14sp"
-                tools:text="YS1506002" />
+        android:layout_height="wrap_content">
+
+    </android.support.v7.widget.RecyclerView>
+
 
-        </LinearLayout>
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="15dp"
-            android:orientation="horizontal">
-            <TextView
-                android:layout_width="80dp"
-                android:layout_height="match_parent"
-                android:text="报工数:"
-                android:textColor="@color/body_text_1"
-                android:textSize="14sp" />
-            <TextView
-                android:id="@+id/tv_report_num"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:layout_weight="1"
-                android:paddingLeft="6dp"
-                android:textColor="@color/body_text_1"
-                android:textSize="14sp"
-                tools:text="YS1506002" />
-            <TextView
-                android:layout_width="75dp"
-                android:layout_height="match_parent"
-                android:text="报废数:"
-                android:textColor="@color/body_text_1"
-                android:textSize="14sp" />
-            <TextView
-                android:id="@+id/tv_destory_num"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:singleLine="true"
-                android:ellipsize="end"
-                android:layout_weight="1"
-                android:paddingLeft="6dp"
-                android:textColor="@color/body_text_1"
-                android:textSize="14sp"
-                tools:text="YS1506002" />
-        </LinearLayout>
-        <LinearLayout
-            android:layout_width="match_parent"
-            android:layout_height="wrap_content"
-            android:layout_marginTop="15dp"
-            android:orientation="horizontal">
-            <TextView
-                android:layout_width="80dp"
-                android:layout_height="match_parent"
-                android:text="报工人:"
-                android:textColor="@color/body_text_1"
-                android:textSize="14sp" />
-            <TextView
-                android:id="@+id/tv_report_man"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:layout_weight="1"
-                android:paddingLeft="6dp"
-                android:textColor="@color/body_text_1"
-                android:textSize="14sp"
-                tools:text="YS1506002" />
-            <TextView
-                android:layout_width="75dp"
-                android:layout_height="match_parent"
-                android:text="报工时间:"
-                android:textColor="@color/body_text_1"
-                android:textSize="14sp" />
-            <TextView
-                android:id="@+id/tv_report_time"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:singleLine="true"
-                android:ellipsize="end"
-                android:layout_weight="1"
-                android:paddingLeft="6dp"
-                android:textColor="@color/body_text_1"
-                android:textSize="14sp"
-                tools:text="YS1506002" />
-        </LinearLayout>
-    </LinearLayout>
 </LinearLayout>

+ 144 - 0
app/src/main/res/layout/item_has_caiji.xml

@@ -0,0 +1,144 @@
+<?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:padding="@dimen/dp_10">
+
+    <LinearLayout
+        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="生产批号:" />
+
+        <TextView
+            android:id="@+id/tv_pihao"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="@dimen/dp_10"
+            android:text="GI01NPUT-eg" />
+    </LinearLayout>
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal">
+        <LinearLayout
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:orientation="horizontal">
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="产品编号:" />
+
+            <TextView
+                android:id="@+id/tv_product_num"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:text="520eg" />
+        </LinearLayout>
+
+    </LinearLayout>
+    <LinearLayout
+        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="产品名称:" />
+        <TextView
+            android:id="@+id/tv_product_name"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="@dimen/dp_10"
+            android:text="520eg" />
+    </LinearLayout>
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="@dimen/space_left_5">
+
+        <LinearLayout
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1">
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="不良代码:" />
+
+            <TextView
+                android:id="@+id/tv_code"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:text="999eg" />
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1">
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="操作人:" />
+
+            <TextView
+                android:id="@+id/tv_man"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:text="520eg" />
+        </LinearLayout>
+    </LinearLayout>
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="@dimen/space_left_5">
+
+        <LinearLayout
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1">
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="工单号:" />
+
+            <TextView
+                android:id="@+id/tv_gongdan"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:text="999eg" />
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1">
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="不良数:" />
+
+            <TextView
+                android:id="@+id/tv_num"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:text="GI01NPUT-eg" />
+        </LinearLayout>
+    </LinearLayout>
+</LinearLayout>

+ 33 - 0
app/src/main/res/layout/item_hepi.xml

@@ -0,0 +1,33 @@
+<?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:gravity="center">
+    <LinearLayout
+        android:layout_width="wrap_content"
+        android:layout_height="35dp"
+        android:layout_marginLeft="20dp">
+        <TextView
+            android:id="@+id/tv_name"
+            android:layout_width="130dp"
+            android:layout_height="match_parent"
+            android:gravity="center_vertical"
+            android:text="2022030001" />
+        <TextView
+            android:id="@+id/tv_num"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:gravity="center_vertical"
+            android:layout_marginLeft="40dp"
+            android:text="30" />
+        <ImageView
+            android:id="@+id/iv_close"
+            android:layout_width="15dp"
+            android:layout_height="15dp"
+            android:layout_marginLeft="80dp"
+            android:layout_gravity="center_vertical"
+            android:src="@drawable/wrong"
+            />
+    </LinearLayout>
+
+</LinearLayout>

+ 113 - 0
app/src/main/res/layout/item_report_detail.xml

@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--主菜单griditem布局-->
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="vertical"
+    android:paddingTop="10dp"
+    android:paddingLeft="15dp"
+    android:paddingRight="10dp"
+    >
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal">
+        <TextView
+            android:layout_width="90dp"
+            android:layout_height="match_parent"
+            android:text="生产批次号:"
+            android:textColor="@color/body_text_1"
+            android:textSize="14sp" />
+        <TextView
+            android:id="@+id/tv_pichi"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:paddingLeft="6dp"
+            android:textColor="@color/body_text_1"
+            android:textSize="14sp"
+            tools:text="YS1506002" />
+
+    </LinearLayout>
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="15dp"
+        android:orientation="horizontal">
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:text="报工数:"
+            android:textColor="@color/body_text_1"
+            android:textSize="14sp" />
+        <TextView
+            android:id="@+id/tv_report_num"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:minWidth="80dp"
+            android:textColor="@color/body_text_1"
+            android:textSize="14sp"
+            tools:text="YS1506002" />
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:text="报废数:"
+            android:textColor="@color/body_text_1"
+            android:textSize="14sp" />
+
+        <TextView
+            android:id="@+id/tv_destory_num"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:ellipsize="end"
+            android:paddingLeft="6dp"
+            android:singleLine="true"
+            android:textColor="@color/body_text_1"
+            android:textSize="14sp"
+            tools:text="YS1506002" />
+    </LinearLayout>
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="15dp"
+        android:orientation="horizontal">
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:text="报工人:"
+            android:textColor="@color/body_text_1"
+            android:textSize="14sp" />
+        <TextView
+            android:id="@+id/tv_report_man"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:minWidth="80dp"
+            android:textColor="@color/body_text_1"
+            android:textSize="14sp"
+            tools:text="YS1506002" />
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:text="报工时间:"
+            android:textColor="@color/body_text_1"
+            android:textSize="14sp" />
+        <TextView
+            android:id="@+id/tv_report_time"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:singleLine="true"
+            android:ellipsize="end"
+            android:textColor="@color/body_text_1"
+            android:textSize="14sp"
+            tools:text="YS1506002" />
+    </LinearLayout>
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="0.5dp"
+        android:layout_marginTop="10dp"
+        android:background="@color/me_menu_item_press"/>
+
+</LinearLayout>
+

+ 2 - 0
app/src/main/res/values/color.xml

@@ -7,6 +7,8 @@
     <color name="text_search">#40ABE1</color>
     <color name="text_blue">#40ABE1</color>
     <color name="background">#F0FFFF</color>
+    <color name="bg_content_second">#F3FAFF</color>
+
     <color name="start">#F0FFFF</color>
     <color name="end">#f0ffff</color>
     <color name="button_normal">#7AB9EE</color>