Bladeren bron

质检、小工具优化

guilin 1 jaar geleden
bovenliggende
commit
6d53df6e86

+ 14 - 0
app/src/main/java/com/fxy/net/Urls.java

@@ -87,6 +87,20 @@ public class Urls {
     public static final String FXY_PUT_IN = "/pda/inbound/scanTracking";
     //关闭托盘
     public static final String FXY_CLOSE_PALLET = "/pda/inbound/closePallet";
+
+
+    //获取质检单号
+    public static final String FXY_QUALITY_TRACKING_NUMBER = "/pda/inbound/qualityTrackingNumber";
+    //质检提交
+    public static final String FXY_QUALITY_SUBMIT = "/pda/inbound/qualitySubmit";
+    //质检数据
+    public static final String FXY_GET_QUALITY_ORDER = "/pda/inbound/getQualityOrder";
+
+    //质检数据
+    public static final String FXY_CHECK_QUALITY_PALLET = "/pda/inbound/checkQualityPallet";
+    //质检完成
+    public static final String FXY_FINISH_QUALITY = "/pda/inbound/finishQuality";
+
     // 获取出库单数据
     public static final String FXY_GET_OUTBOUND = "/pda/outbound/scanOutbound";
     // 删除

+ 10 - 49
app/src/main/java/com/fxy/putIn/TallyMainActivity.java

@@ -113,8 +113,6 @@ public class TallyMainActivity extends  BaseActivity implements StoJNI.ScanCallB
     @BindView(R.id.mt_customer_code)
     MarqueeTextView mtCustomerCode;
 
-    @BindView(R.id.mt_cnt)
-    MarqueeTextView mtCnt;
 
 
     //托盘组件
@@ -127,8 +125,6 @@ public class TallyMainActivity extends  BaseActivity implements StoJNI.ScanCallB
     LinearLayout llCustomerCode;
 
 
-    @BindView(R.id.ll_cnt)
-    LinearLayout llCnt;
 
 
     @BindView(R.id.btn_change_confirm)
@@ -180,7 +176,7 @@ public class TallyMainActivity extends  BaseActivity implements StoJNI.ScanCallB
 
     //是否需要显示客户
     private boolean needCustomer;
-    private boolean needCtn;
+
     //强制更改
     private int isChange=0;
 
@@ -188,8 +184,7 @@ public class TallyMainActivity extends  BaseActivity implements StoJNI.ScanCallB
     private int isOpen=0;
 
     private String customerCode="";
-    //箱数 (整数字)
-    private String ctn = "";
+
 
     //托盘数据
     private List<JSONObject> tallyDataList = new ArrayList<>()   ;
@@ -260,7 +255,7 @@ public class TallyMainActivity extends  BaseActivity implements StoJNI.ScanCallB
     @Override
     protected void initView() {
         unbinder = ButterKnife.bind(this);
-        setTitleName(getString(R.string.tally));
+        setTitleName("快速入库");
 
         initAdapter();
         initData();
@@ -330,10 +325,7 @@ public class TallyMainActivity extends  BaseActivity implements StoJNI.ScanCallB
                     mtCustomerCode.setText(string);
 
                 }
-                if (commonDialog.getTypeCode().equals("need_ctn")){
-                    ctn = string;
-                    mtCnt.setText(string);
-                }
+
                 doPutIn();
                 dialog.dismiss();
             }
@@ -683,10 +675,6 @@ public class TallyMainActivity extends  BaseActivity implements StoJNI.ScanCallB
                 param.put("is_open",isOpen);
             }
 
-            if (needCtn){
-                param.put("ctn",ctn);
-            }
-
 
             if (!checkRepeat(Urls.FXY_PUT_IN+(param.toString()))){return;}
 
@@ -710,6 +698,10 @@ public class TallyMainActivity extends  BaseActivity implements StoJNI.ScanCallB
                                     clearData(false);
                                 }else{
 
+                                    if (result.has("deal_tracking_number")){
+                                        etOrderNo.setText(result.getString("deal_tracking_number"));
+                                    }
+
                                     if (result.has("tag") && result.getString("tag").equals("need_customer")){
 
 //                                        commonDialog.setTitle("客户编号","请输入客户编号")
@@ -758,13 +750,6 @@ public class TallyMainActivity extends  BaseActivity implements StoJNI.ScanCallB
 
                                             }
                                         }).show();
-                                    }else if(result.has("need_ctn") && result.getInt("need_ctn") == 1) {
-                                        needCtn = true;
-                                        commonDialog.setTitle("箱数","请输入箱数")
-                                                .setTypeCode("need_ctn")
-                                                .setContent("")
-                                                .show();
-                                        llCnt.setVisibility(View.VISIBLE);
                                     }else {
                                         showWarningToast(bean.msg);
                                     }
@@ -816,21 +801,6 @@ public class TallyMainActivity extends  BaseActivity implements StoJNI.ScanCallB
             }
         }
 
-        if (needCtn){
-            if(ctn.isEmpty()){
-                commonDialog.setTitle("箱数","请输入箱数")
-                        .setTypeCode("need_ctn")
-                        .setContent("")
-                        .show();
-                showWarningToast("请输入箱数");
-                return false;
-            }
-            if (!isNumeric(ctn)){
-                showWarningToast("请输入正整数");
-                return false;
-            }
-        }
-
         return true;
     }
 
@@ -903,7 +873,7 @@ public class TallyMainActivity extends  BaseActivity implements StoJNI.ScanCallB
 
             mtSendWay.setText(send_way);
             mtPutinQty.setText(putin_qty);
-            ctn = "";
+
             customerCode = "";
 
         }catch (JSONException e) {
@@ -915,12 +885,9 @@ public class TallyMainActivity extends  BaseActivity implements StoJNI.ScanCallB
     private void clearData(boolean isAll) {
         etOrderNo.setText("");
         needCustomer = false;
-        needCtn = false;
         isChange = 0;
         isOpen = 0;
-        ctn = "" ;
         customerCode = "";
-        llCnt.setVisibility(View.GONE);
         llCustomerCode.setVisibility(View.GONE);
         if (isAll){
             llContainer.setVisibility(View.VISIBLE);
@@ -938,7 +905,7 @@ public class TallyMainActivity extends  BaseActivity implements StoJNI.ScanCallB
         photoList.clear();
     }
 
-    @OnClick({R.id.btn_confirm,R.id.btn_change_confirm,R.id.tv_edit_customer,R.id.tv_edit_cnt,R.id.add_tally})
+    @OnClick({R.id.btn_confirm,R.id.btn_change_confirm,R.id.tv_edit_customer,R.id.add_tally})
     public void onViewClicked(View view) {
         Bundle bundle = new Bundle();
         switch (view.getId()) {
@@ -976,12 +943,6 @@ public class TallyMainActivity extends  BaseActivity implements StoJNI.ScanCallB
                         .setContent(mtCustomerCode.getText().toString())
                         .show();
                 break;
-            case R.id.tv_edit_cnt:
-                commonDialog.setTitle("箱数","请输入箱数")
-                        .setTypeCode("need_ctn")
-                        .setContent(mtCnt.getText().toString())
-                        .show();
-                break;
             case R.id.add_tally:
                 doPutIn();
                 break;

+ 98 - 201
app/src/main/java/com/fxy/putOut/QualityInspectionMainActivity.java

@@ -25,6 +25,7 @@ import android.widget.ImageButton;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.RadioButton;
+import android.widget.RadioGroup;
 import android.widget.TextView;
 import android.widget.Toast;
 
@@ -48,6 +49,8 @@ import com.fxy.common.PictureSelectorUpload;
 import com.fxy.constant.BaseConfig;
 import com.fxy.constant.EventCode;
 import com.fxy.constant.SPCache;
+import com.fxy.fms.check.CheckGoodsMainActivity;
+import com.fxy.fms.check.CheckStartMainActivity;
 import com.fxy.net.MyDialogCallback;
 import com.fxy.net.Urls;
 import com.fxy.view.FloatingImageView;
@@ -86,16 +89,6 @@ public class QualityInspectionMainActivity extends  BaseActivity implements StoJ
     EditText etOrderNo;
 
 
-    @BindView(R.id.mt_send_way)
-    MarqueeTextView mtSendWay;
-
-    @BindView(R.id.mt_putin_qty)
-    MarqueeTextView mtPutinQty;
-
-
-    @BindView(R.id.recyclerview)
-    RecyclerView recyclerView;
-
     //浮动按钮
     @BindView(R.id.iv_drag)
     FloatingImageView iv_drag;
@@ -113,26 +106,18 @@ public class QualityInspectionMainActivity extends  BaseActivity implements StoJ
     LinearLayout llDamagedArea;
 
 
-    private View notDataView;   //没有数据显示页
-    private View errorView;     //错误显示页
-    private View emptyView;     //空显示页
+    @BindView(R.id.radioGroup1)
+    RadioGroup radioGroup;
+
 
-    private List<JSONObject> tallyDataList = new ArrayList<>()   ;
-    /**
-     * 列表适配器
-     */
-    private FinishWorkAdapter mAdapter;
 
     //扫码扫码动作
     private ScanBean scanBean;
 
 
-    //托盘返回对象
-    private JSONObject palletObject;
 
     private Unbinder unbinder;
 
-    private  CommonDialog commonDialog;
 
     //图片列表
     private ArrayList photoList =new ArrayList<>();
@@ -144,7 +129,7 @@ public class QualityInspectionMainActivity extends  BaseActivity implements StoJ
     private PictureSelectorUpload damagedUpload;
 
     //质检结果
-    private String categoryName = "";
+    private String categoryName = "完好";
 
     @Override
     public int getContentViewResId() {
@@ -178,6 +163,7 @@ public class QualityInspectionMainActivity extends  BaseActivity implements StoJ
 //        XLog.e(data);
         if (requestCode == 200 && resultCode == 200)//之前提到的两个标志,在这里显示出了作用
         {
+            clearData(true);
         }else if (resultCode==0){
         }
 
@@ -214,12 +200,9 @@ public class QualityInspectionMainActivity extends  BaseActivity implements StoJ
     @Override
     protected void initView() {
         unbinder = ButterKnife.bind(this);
-        setTitleName(getString(R.string.tally));
+        setTitleName("标准质检");
 
-        initAdapter();
-        initData();
         initEdit();
-        initDialog();
         //监听浮动按钮
         iv_drag.setOnClickListener(new View.OnClickListener() {
             @Override
@@ -315,27 +298,6 @@ public class QualityInspectionMainActivity extends  BaseActivity implements StoJ
     }
 
 
-    private void initData(){
-
-    }
-
-
-    private void initDialog(){
-        commonDialog = new CommonDialog(mContext, R.style.dialog, "need_customer", new CommonDialog.OnCloseListener() {
-            @Override
-            public void onClickCancel(Dialog dialog, boolean confirm) {
-                dialog.dismiss();
-            }
-            @Override
-            public void onClickSubmit(Dialog dialog, boolean confirm) {
-                String string = commonDialog.contentTxt.getText().toString().trim();
-
-                dialog.dismiss();
-            }
-        });
-
-
-    }
 
 
 
@@ -349,8 +311,7 @@ public class QualityInspectionMainActivity extends  BaseActivity implements StoJ
             }
             return true;
         }
-        return true;
-        //return super.dispatchKeyEvent(event);
+        return super.dispatchKeyEvent(event);
     }
 
     //监听按键
@@ -463,7 +424,7 @@ public class QualityInspectionMainActivity extends  BaseActivity implements StoJ
     public void callbackEditor(View v){
         switch (v.getId()) {
             case R.id.et_order_no:
-                doPutIn();
+                qualityTrackingNumber();
                 break;
             default:
         }
@@ -498,10 +459,7 @@ public class QualityInspectionMainActivity extends  BaseActivity implements StoJ
 
     //把扫描结果赋值
     private void setScanResult(String scanResult){
-        if (commonDialog!=null && commonDialog.isShowing()){
-            commonDialog.setContent(scanResult);
-            return;
-        }
+
         //获取焦点的view对象
         View view=getWindow().getDecorView().findFocus();
         //如果是EditText
@@ -514,7 +472,57 @@ public class QualityInspectionMainActivity extends  BaseActivity implements StoJ
     }
 
 
+    public void qualityTrackingNumber() {
+        //校验数据
+        if(!checkNull(etOrderNo)){
+            setEditTextFocused(etOrderNo,true);
+            showWarningToast(etOrderNo.getHint().toString());
+            return ;
+        }
+
+        try {
+            final String tracking_number = etOrderNo.getText().toString().trim();
+            JSONObject param = new JSONObject();
+            param.put("tracking_number",tracking_number);
+
+
+
+            if (!checkRepeat(Urls.FXY_QUALITY_TRACKING_NUMBER+(param.toString()))){return;}
+
+            OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_QUALITY_TRACKING_NUMBER)
+                    .upJson(param)
+                    .execute(new MyDialogCallback(this, true, true) {
+                        @Override
+                        public void onSuccess(Response<String> response) {
+                            super.onSuccess(response);
+                            try {
+                                ActionBean bean = JsonUtil.getObject(response.body(), ActionBean.class);
+                                JSONObject result = new JSONObject();
+                                if (bean.data!=null && !bean.data.isEmpty() && !bean.data.equals("[]")){
+                                    result = new JSONObject(bean.data);
+                                    if (result.has("deal_tracking_number")){
+                                        etOrderNo.setText(result.getString("deal_tracking_number"));
+                                    }
+                                }
+
+                                if(bean.code == 1){
+                                    showSuccessToast(bean.msg);
+                                }else{
+                                    showWarningToast(bean.msg);
+                                }
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                                XLog.e("请求入库返回错误",e.getMessage());
+                            }
+                        }
+                    });
+        } catch (JSONException e) {
+            showEmptyView("请求入库失败:"+e.getMessage());
+            e.printStackTrace();
+        }
+
 
+    }
 
     public void doPutIn() {
         //校验数据
@@ -526,6 +534,7 @@ public class QualityInspectionMainActivity extends  BaseActivity implements StoJ
             final String tracking_number = etOrderNo.getText().toString().trim();
             JSONObject param = new JSONObject();
             param.put("tracking_number",tracking_number);
+            param.put("category_name",categoryName);
 
             param.put("img_1",panoramaUpload.getPhotoList().get(0));
             param.put("img_2",labelUpload.getPhotoList().get(0));
@@ -534,12 +543,9 @@ public class QualityInspectionMainActivity extends  BaseActivity implements StoJ
                 param.put("img_3",damagedUpload.getPhotoList().get(0));
             }
 
+            if (!checkRepeat(Urls.FXY_QUALITY_SUBMIT+(param.toString()))){return;}
 
-
-
-            if (!checkRepeat(Urls.FXY_PUT_IN+(param.toString()))){return;}
-
-            OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_PUT_IN)
+            OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_QUALITY_SUBMIT)
                     .upJson(param)
                     .execute(new MyDialogCallback(this, true, true) {
                         @Override
@@ -547,73 +553,18 @@ public class QualityInspectionMainActivity extends  BaseActivity implements StoJ
                             super.onSuccess(response);
                             try {
                                 ActionBean bean = JsonUtil.getObject(response.body(), ActionBean.class);
-                                JSONObject result = new JSONObject();
-                                if (bean.data!=null && !bean.data.isEmpty() && !bean.data.equals("[]")){
-                                    result = new JSONObject(bean.data);
-                                }
 
-                                setPageViewData(result);
+
                                 if(bean.code == 1){
+                                    JSONObject result = new JSONObject(bean.data);
                                     showSuccessToast(bean.msg);
-                                    llDamagedArea.setVisibility(View.GONE);
-                                    clearData(false);
+                                    Bundle bundle = new Bundle();
+                                    bundle.putString("container_type",result.getString("result_txt"));
+                                    bundle.putInt("quality_order_id",result.getInt("quality_order_id"));
+                                    intentPageResult(QualityInspectionMainActivity.this, QualityVolumeMainActivity.class, bundle,200);
                                 }else{
 
-                                    if (result.has("tag") && result.getString("tag").equals("need_customer")){
-
-//                                        commonDialog.setTitle("客户编号","请输入客户编号")
-//                                                .setTypeCode("need_customer")
-//                                                .setContent("")
-//                                                .show();
-//                                        llCustomerCode.setVisibility(View.VISIBLE);
-                                        new AlertDialog.Builder(mContext)
-                                                .setTitle(R.string.dl_hint)
-                                                .setMessage(bean.msg)
-                                                .setNegativeButton(R.string.str_submit, new DialogInterface.OnClickListener() {
-                                                    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
-                                                    @Override
-                                                    public void onClick(DialogInterface dialogInterface, int i) {
-                                                        currentUpload.emptyRemake();
-                                                        photoList.clear();
-                                                        llDamagedArea.setVisibility(View.VISIBLE);
-                                                        currentUpload.authCamera();
-
-                                                    }
-                                                }).setPositiveButton(R.string.str_cancel, new DialogInterface.OnClickListener() {
-                                            @Override
-                                            public void onClick(DialogInterface dialogInterface, int i) {
-                                                //取消不做操作
-
-                                            }
-                                        }).show();
-
-
-                                    }else if (result.has("is_change") && result.getInt("is_change")==1){
-                                        new AlertDialog.Builder(mContext)
-                                                .setTitle(R.string.dl_hint)
-                                                .setMessage(bean.msg)
-                                                .setNegativeButton(R.string.str_submit, new DialogInterface.OnClickListener() {
-                                                    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
-                                                    @Override
-                                                    public void onClick(DialogInterface dialogInterface, int i) {
-                                                        doPutIn();
-                                                    }
-                                                }).setPositiveButton(R.string.str_cancel, new DialogInterface.OnClickListener() {
-                                            @Override
-                                            public void onClick(DialogInterface dialogInterface, int i) {
-                                                //取消不做操作
-
-                                            }
-                                        }).show();
-                                    }else if(result.has("need_ctn") && result.getInt("need_ctn") == 1) {
-                                        commonDialog.setTitle("箱数","请输入箱数")
-                                                .setTypeCode("need_ctn")
-                                                .setContent("")
-                                                .show();
-
-                                    }else {
-                                        showWarningToast(bean.msg);
-                                    }
+                                    showWarningToast(bean.msg);
 
                                 }
                             } catch (Exception e) {
@@ -635,14 +586,12 @@ public class QualityInspectionMainActivity extends  BaseActivity implements StoJ
      */
     private boolean validate(){
 
-
         if(!checkNull(etOrderNo)){
             setEditTextFocused(etOrderNo,true);
             showWarningToast(etOrderNo.getHint().toString());
             return false;
         }
 
-
         if (panoramaUpload.getPhotoList().size()==0){
             showWarningToast("请选择全景图");
             return false;
@@ -653,92 +602,43 @@ public class QualityInspectionMainActivity extends  BaseActivity implements StoJ
             return false;
         }
 
+        if (categoryName.equals("破损") && damagedUpload.getPhotoList().size()==0){
+            showWarningToast("请选择破损图");
+            return false;
+        }
+
 
         return true;
     }
 
-    private class FinishWorkAdapter extends BaseQuickAdapter<JSONObject, BaseViewHolder>{
-        public FinishWorkAdapter(List<JSONObject> data){
-            super(R.layout.item_putin_scan, data);
-        }
-
+    //清除订单信息
+    private void clearData(boolean isAll) {
+        etOrderNo.setText("");
+        etOrderNo.requestFocus();
+        setEditTextNormal(etOrderNo,true);
 
-        public void setNewData(List<JSONObject> tallyDataList) {
+        llDamagedArea.setVisibility(View.GONE);
+        if (currentUpload != null){
+            currentUpload.emptyRemake();//清空图片
         }
 
-        @Override
-        protected void convert(BaseViewHolder helper, JSONObject item) {
-            helper.addOnClickListener(R.id.ib_clear);//定义setOnItemChildClickListener 事件点击
-            try {
-                String number    = item.has("tracking_number")?item.getString("tracking_number"):"";
-                helper.setText(R.id.tv_number,number);
-                helper.getView(R.id.ib_clear).setVisibility(View.GONE);
-            } catch (Exception e) {
-                XLog.e("列表赋值错误",e);
-                e.printStackTrace();
-            }
+        if (panoramaUpload!=null){
+            panoramaUpload.emptyRemake();//清空图片
         }
-    }
-    private void initAdapter(){
-        emptyView = this.getLayoutInflater().inflate(R.layout.pager_empty, (ViewGroup) recyclerView.getParent(), false);
-        errorView = this.getLayoutInflater().inflate(R.layout.pager_error, (ViewGroup) recyclerView.getParent(), false);
-        notDataView = emptyView;
 
-        mAdapter  = new FinishWorkAdapter(tallyDataList);
-        mAdapter.setEmptyView(emptyView);
-        mAdapter.openLoadAnimation(BaseQuickAdapter.SCALEIN);
-        recyclerView.setLayoutManager(new LinearLayoutManager(this));
-        recyclerView.setAdapter(mAdapter);
-
-    }
-
-    /**
-     * 显示
-     * @param str
-     */
-    private void showList(String str){
-
-    }
-
-    private void setPageViewData(JSONObject jsonObject){
-        try {
-            String send_way = "";
-            String putin_qty = "";
-            if (jsonObject.has("list")){
-                String listStr = jsonObject.getString("list");
-                if ( !listStr.isEmpty() && !listStr.equals("[]")){
-                    tallyDataList.clear();
-                    JSONArray jsonArray = new JSONArray(listStr);
-                    for (int i = 0;i < jsonArray.length(); i++){
-                        JSONObject tallyObject = jsonArray.getJSONObject(i);
-                        tallyDataList.add(tallyObject);
-                    }
-                    mAdapter.setNewData(tallyDataList);
-                    mAdapter.notifyDataSetChanged();
-                }
-            }
-            if (jsonObject.has("send_way")){
-                send_way = jsonObject.getString("send_way");
-            }
-            if (jsonObject.has("qty")){
-                putin_qty = String.valueOf(jsonObject.getInt("qty"));
-            }
+        if (labelUpload!=null){
+            labelUpload.emptyRemake();//清空图片
+        }
 
-            mtSendWay.setText(send_way);
-            mtPutinQty.setText(putin_qty);
+        if (damagedUpload!=null){
+            damagedUpload.emptyRemake();//清空图片
+        }
 
+        //设置默认选中
+        categoryName = "完好";
+        RadioButton rb_checked = (RadioButton) radioGroup.findViewById(R.id.rb_intact);
+        rb_checked.setChecked(true);
 
-        }catch (JSONException e) {
-            XLog.e("获取理货缓存数据错误",e);
-            e.printStackTrace();
-        }
-    }
-    //清除订单信息
-    private void clearData(boolean isAll) {
-        etOrderNo.setText("");
-        etOrderNo.requestFocus();
-        setEditTextNormal(etOrderNo,true);
-        currentUpload.emptyRemake();//清空图片
         photoList.clear();
     }
 
@@ -747,10 +647,7 @@ public class QualityInspectionMainActivity extends  BaseActivity implements StoJ
         Bundle bundle = new Bundle();
         switch (view.getId()) {
             case R.id.btn_confirm:
-                bundle.putString("container_type","退货返修");
-                bundle.putString("order_number",etOrderNo.getText().toString().trim());
-                intent2Page(QualityInspectionMainActivity.this, QualityVolumeMainActivity.class, false,bundle);
-                //closePallet();
+                doPutIn();
                 break;
 
 //            case R.id.tv_clear_pictures:

+ 153 - 91
app/src/main/java/com/fxy/putOut/QualityVolumeMainActivity.java

@@ -86,6 +86,30 @@ public class QualityVolumeMainActivity extends  BaseActivity implements StoJNI.S
     EditText etContainerCode;
 
 
+    //单号清除
+    @BindView(R.id.ib_unique_code_clear)
+    ImageButton ibUniqueCodeClear;
+
+    //单号
+    @BindView(R.id.et_unique_code)
+    EditText etUniqueCode;
+
+    //唯一标识区域
+    @BindView(R.id.ll_unique_code)
+    LinearLayout llUniqueCode;
+
+    //重量区域
+    @BindView(R.id.ll_weight)
+    LinearLayout llWeight;
+
+    //测量区域
+    @BindView(R.id.ly_measure_content)
+    LinearLayout llMeasureContent;
+
+
+
+
+
     @BindView(R.id.et_weight)
     EditText etWeight;
 
@@ -107,6 +131,7 @@ public class QualityVolumeMainActivity extends  BaseActivity implements StoJNI.S
     @BindView(R.id.ll_container)
     LinearLayout llContainer;
 
+
     //浮动按钮
     @BindView(R.id.iv_drag)
     FloatingImageView iv_drag;
@@ -117,17 +142,24 @@ public class QualityVolumeMainActivity extends  BaseActivity implements StoJNI.S
     private ScanBean scanBean;
 
 
-    //托盘返回对象
-    private JSONObject palletObject;
-
     private Unbinder unbinder;
 
 
+    private int qualityOrderId = 0;
 
     //托盘对象
-    private JSONObject tallyInfo = null;
-    private String containerType = "";
-    private String orderNumber = "";
+    private JSONObject inboundObject = null;
+
+    //是否显示
+    private boolean isUniqueCode = false;
+
+    //是否材积显示
+    private boolean isVolume = false;
+
+
+
+    //是否允许编辑
+    private boolean isAllowEdit = true;
 
 
     @Override
@@ -147,9 +179,8 @@ public class QualityVolumeMainActivity extends  BaseActivity implements StoJNI.S
 
     @Override
     protected void getBundleExtras(Bundle bundle) {
-        containerType = bundle.getString("container_type","");
-        orderNumber = bundle.getString("order_number","");
-
+        String containerType = bundle.getString("container_type","");
+        qualityOrderId = bundle.getInt("quality_order_id",0);
     }
     //finish的返回监听
     //这里的requestCode参数,就是上面设置的 1 ,当跳转的页面返回的时候,通过这个加以判断
@@ -191,11 +222,10 @@ public class QualityVolumeMainActivity extends  BaseActivity implements StoJNI.S
     @Override
     protected void initView() {
         unbinder = ButterKnife.bind(this);
-        setTitleName("标准质检");
+        setTitleName("完成质检");
 
         initData();
         initEdit();
-        initDialog();
         //监听浮动按钮
         iv_drag.setOnClickListener(new View.OnClickListener() {
             @Override
@@ -208,8 +238,6 @@ public class QualityVolumeMainActivity extends  BaseActivity implements StoJNI.S
         });
 
 
-
-
     }
 
 
@@ -217,17 +245,78 @@ public class QualityVolumeMainActivity extends  BaseActivity implements StoJNI.S
 
 
     private void initData(){
+        try {
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.put("quality_order_id",qualityOrderId);
+            if (!checkRepeat(Urls.FXY_GET_QUALITY_ORDER+(jsonObject.toString()))){
+                Toast.makeText(this, getString(R.string.error_data_processed), Toast.LENGTH_LONG).show();
+                return;
+            }
 
-    }
+            OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_GET_QUALITY_ORDER).upJson(jsonObject)
+                    .execute(new MyDialogCallback(this, true, true) {
+                        @Override
+                        public void onSuccess(Response<String> response) {
+                            super.onSuccess(response);
+                            try {
+                                ActionBean bean = JsonUtil.getObject(response.body(), ActionBean.class);
+
+                                inboundObject = new JSONObject();
+                                if (bean.data!=null && !bean.data.isEmpty() && !bean.data.equals("[]")){
+                                    inboundObject = new JSONObject(bean.data);
+                                }
+
+
+                                if(bean.code == 1){
+
+                                    mtContainerType.setText(inboundObject.getString("quality_result"));
+
+
+                                    isAllowEdit = inboundObject.getInt("fill_data")==0;
+                                    if (!isAllowEdit){
+                                        etLength.setText(inboundObject.getString("inbound_length"));
+                                        etWidth.setText(inboundObject.getString("inbound_width"));
+                                        etHeight.setText(inboundObject.getString("inbound_length"));
+                                        etWeight.setText(inboundObject.getString("inbound_weight"));
+                                    }
 
+                                    etLength.setEnabled(isAllowEdit);
+                                    etWidth.setEnabled(isAllowEdit);
+                                    etHeight.setEnabled(isAllowEdit);
+                                    etWeight.setEnabled(isAllowEdit);
 
-    private void initDialog(){
+                                    isUniqueCode = inboundObject.getInt("hide_unique")==0;
+                                    llUniqueCode.setVisibility(isUniqueCode ? View.VISIBLE : View.GONE);
 
+                                    isVolume = inboundObject.getInt("hide_weightsize")==0;
+                                    llWeight.setVisibility(isVolume ? View.VISIBLE : View.GONE);
+                                    llMeasureContent.setVisibility(isVolume ? View.VISIBLE : View.GONE);
+
+
+                                    etContainerCode.setEnabled(true);
+                                    etContainerCode.requestFocus();
+
+                                }else{
+                                    inboundObject = null;
+                                    showWarningToast(bean.msg);
+                                }
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                                showEmptyView("体积信息解析错误:"+e.getMessage());
+                                XLog.e("获取体积信息解析错误",e.getMessage());
+                            }
+                        }
+                    });
+        }catch (Exception e){
+            inboundObject = new JSONObject();
+            XLog.e("获取体积错误:"+e.getMessage(),e);
+        }
     }
 
 
 
 
+
     @Override
     public boolean dispatchKeyEvent(KeyEvent event) {
         //XLog.e("Action:"+event.getAction()+"---event:"+event.getKeyCode());
@@ -237,8 +326,7 @@ public class QualityVolumeMainActivity extends  BaseActivity implements StoJNI.S
             }
             return true;
         }
-        return true;
-        //return super.dispatchKeyEvent(event);
+        return super.dispatchKeyEvent(event);
     }
 
     //监听按键
@@ -351,8 +439,19 @@ public class QualityVolumeMainActivity extends  BaseActivity implements StoJNI.S
     public void callbackEditor(View v){
         switch (v.getId()) {
             case R.id.et_container_code:
-                checkTray();
+
+                if (isUniqueCode){
+                    checkQualityPallet();
+                }else{
+                    if (isVolume && isAllowEdit){
+                        etWeight.requestFocus();
+                    }else{
+                        doConfirm();
+                    }
+                }
                 break;
+            case R.id.ib_unique_code_clear:
+                doConfirm();
             default:
         }
     }
@@ -364,6 +463,7 @@ public class QualityVolumeMainActivity extends  BaseActivity implements StoJNI.S
     private void initEdit() {
         List<EditText> list = new ArrayList<>();
         list.add(etContainerCode);
+        list.add(etUniqueCode);
         unifyEdit(list);
     }
 
@@ -398,26 +498,17 @@ public class QualityVolumeMainActivity extends  BaseActivity implements StoJNI.S
         }
     }
 
-    /**
-     * 检查托盘信息
-     */
-    private void checkTray(){
-        final String palletCode = etContainerCode.getText().toString().trim();
-        if (palletCode.isEmpty()){
-            setEditTextFocused(etContainerCode,true);
-            showWarningToast(etContainerCode.getHint().toString());
-            return ;
-        }
+    private void checkQualityPallet(){
         try {
             JSONObject jsonObject = new JSONObject();
-            jsonObject.put("pallet_code",palletCode);
-
-            if (!checkRepeat(Urls.FXY_CHECK_PALLET+(jsonObject.toString()))){
+            jsonObject.put("quality_order_id",qualityOrderId);
+            jsonObject.put("pallet_code",etContainerCode.getText().toString().trim());
+            if (!checkRepeat(Urls.FXY_CHECK_QUALITY_PALLET+(jsonObject.toString()))){
                 Toast.makeText(this, getString(R.string.error_data_processed), Toast.LENGTH_LONG).show();
                 return;
             }
 
-            OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_CHECK_PALLET).upJson(jsonObject)
+            OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_CHECK_QUALITY_PALLET).upJson(jsonObject)
                     .execute(new MyDialogCallback(this, true, true) {
                         @Override
                         public void onSuccess(Response<String> response) {
@@ -425,57 +516,31 @@ public class QualityVolumeMainActivity extends  BaseActivity implements StoJNI.S
                             try {
                                 ActionBean bean = JsonUtil.getObject(response.body(), ActionBean.class);
 
-                                JSONObject result = new JSONObject();
+                                inboundObject = new JSONObject();
                                 if (bean.data!=null && !bean.data.isEmpty() && !bean.data.equals("[]")){
-                                     result = new JSONObject(bean.data);
+                                    inboundObject = new JSONObject(bean.data);
                                 }
-
-
                                 if(bean.code == 1){
-                                    palletObject = result;
-
-
-                                }else{
-
-                                    if (result.has("is_open") && result.getInt("is_open") == 1) {
-                                        new AlertDialog.Builder(mContext)
-                                                .setTitle(R.string.dl_hint)
-                                                .setMessage(bean.msg)
-                                                .setNegativeButton(R.string.str_submit, new DialogInterface.OnClickListener() {
-                                                    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
-                                                    @Override
-                                                    public void onClick(DialogInterface dialogInterface, int i) {
-
-                                                        checkTray();
-                                                    }
-                                                }).setPositiveButton(R.string.str_cancel, new DialogInterface.OnClickListener() {
-                                            @Override
-                                            public void onClick(DialogInterface dialogInterface, int i) {
-                                                //取消不做操作
-
-                                            }
-                                        }).show();
+                                    if (isVolume &&  isAllowEdit){
+                                        etWeight.requestFocus();
                                     }else{
-                                        palletObject = null;
-                                        showWarningToast(bean.msg);
-                                        etContainerCode.requestFocus();
-                                        etContainerCode.selectAll();
+                                        etUniqueCode.requestFocus();
                                     }
 
+
+                                }else{
+                                    etContainerCode.selectAll();
                                     showWarningToast(bean.msg);
                                 }
-
-
                             } catch (Exception e) {
                                 e.printStackTrace();
-                                showEmptyView("托盘信息解析错误:"+e.getMessage());
-                                XLog.e("获取托盘信息解析错误",e.getMessage());
+                                showEmptyView("检查托盘解析错误:"+e.getMessage());
+                                XLog.e("检查托盘解析错误",e.getMessage());
                             }
                         }
                     });
         }catch (Exception e){
-            palletObject = null;
-            XLog.e("请求托盘信息错误:"+e.getMessage(),e);
+            XLog.e("检查托盘错误:"+e.getMessage(),e);
         }
     }
 
@@ -489,15 +554,19 @@ public class QualityVolumeMainActivity extends  BaseActivity implements StoJNI.S
         try {
             String pallet_code = etContainerCode.getText().toString().trim();
             JSONObject param = new JSONObject();
+            param.put("quality_order_id",qualityOrderId);
             param.put("pallet_code",pallet_code);
-            param.put("weight",etWeight);
-            param.put("length",etLength);
-            param.put("width",etWidth);
-            param.put("height",etHeight);
+            param.put("inbound_weight",etWeight.getText().toString().trim());
+            param.put("inbound_length",etLength.getText().toString().trim());
+            param.put("inbound_width",etWidth.getText().toString().trim());
+            param.put("inbound_height",etHeight.getText().toString().trim());
+            if (isUniqueCode){
+                param.put("unique_code",etUniqueCode.getText().toString().trim());
+            }
 
-            if (!checkRepeat(Urls.FXY_PUT_IN+(param.toString()))){return;}
+            if (!checkRepeat(Urls.FXY_FINISH_QUALITY+(param.toString()))){return;}
 
-            OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_PUT_IN)
+            OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_FINISH_QUALITY)
                     .upJson(param)
                     .execute(new MyDialogCallback(this, true, true) {
                         @Override
@@ -512,7 +581,9 @@ public class QualityVolumeMainActivity extends  BaseActivity implements StoJNI.S
 
                                 if(bean.code == 1){
                                     showSuccessToast(bean.msg);
-                                    clearData(false);
+                                    Intent intent = new Intent();
+                                    setResult(200, intent);//返回值,200 是改返回的标志,也会返回
+                                    finish();
                                 }else{
                                     showWarningToast(bean.msg);
                                 }
@@ -541,26 +612,28 @@ public class QualityVolumeMainActivity extends  BaseActivity implements StoJNI.S
             return false;
         }
 
+        //是否检查材积
+        boolean isCheckVolume = isVolume && isAllowEdit;
 
-        if (!isNumber(getValStr(etWeight),2)){
+        if (isCheckVolume && !isNumber(getValStr(etWeight),3)){
             setEditTextFocused(etWeight,false);
             showWarningToast(etWeight.getHint().toString());
             return false;
         }
 
-        if (!isNumber(getValStr(etLength),2)){
+        if (isCheckVolume && !isNumber(getValStr(etLength),2)){
             setEditTextFocused(etLength,false);
             showWarningToast(etLength.getHint().toString());
             return false;
         }
 
-        if (!isNumber(getValStr(etWidth),2)){
+        if (isCheckVolume && !isNumber(getValStr(etWidth),2)){
             setEditTextFocused(etWidth,false);
             showWarningToast(etWidth.getHint().toString());
             return false;
         }
 
-        if (!isNumber(getValStr(etHeight),2)){
+        if (isCheckVolume && !isNumber(getValStr(etHeight),2)){
             setEditTextFocused(etHeight,false);
             showWarningToast(etHeight.getHint().toString());
             return false;
@@ -570,17 +643,6 @@ public class QualityVolumeMainActivity extends  BaseActivity implements StoJNI.S
     }
 
 
-    //清除订单信息
-    private void clearData(boolean isAll) {
-
-        if (isAll){
-            etContainerCode.setText("");
-            etContainerCode.requestFocus();
-
-        }
-        setEditTextNormal(etContainerCode,true);
-
-    }
 
     @OnClick({R.id.btn_confirm})
     public void onViewClicked(View view) {

+ 10 - 0
app/src/main/java/com/fxy/tool/OrderToolMainActivity.java

@@ -50,6 +50,7 @@ import com.jaredrummler.materialspinner.MaterialSpinner;
 import com.lzy.okgo.OkGo;
 import com.lzy.okgo.model.Response;
 
+import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
 
@@ -615,12 +616,19 @@ public class OrderToolMainActivity extends  BaseActivity implements StoJNI.ScanC
                 scanStatus = scanResult.isEmpty()? "" : "ok"; //有值 默认是扫码成功;
             }
 
+
+            String ruleStr = "[{\"number_start\":\"%\",\"number_length\":34,\"cut_type\":1,\"start_index\":23,\"cut_length\":12}," +
+                    "{\"number_start\":\"420\",\"number_length\":30,\"cut_type\":1,\"start_index\":9,\"cut_length\":22}]";
+
+            scanResult = StrInterception(scanResult,ruleStr);
+
             //新大陆(MT65,MT90) 需要手动关闭
             if (!scanBean.getActionStop().isEmpty()){
                 Intent stopIntent = new Intent(scanBean.getActionStop());
                 mContext.sendBroadcast(stopIntent);
             }
 
+
             if ("ok".equals(scanStatus)){
                 setScanResult(scanResult);
             }else{
@@ -629,6 +637,8 @@ public class OrderToolMainActivity extends  BaseActivity implements StoJNI.ScanC
         }
     };
 
+
+
     /**
      * 注册广播
      */

+ 0 - 107
app/src/main/res/layout/activity_fxy_quality_inspection.xml

@@ -23,23 +23,7 @@
                 android:layout_height="4dp"
                 android:background="@color/md_grey_100" />
 
-            <LinearLayout
-                android:id="@+id/ll_container"
-                style="@style/FromLinearLayoutItem"
-                android:orientation="horizontal">
-                <EditText
-                    style="@style/EditTextStyle"
-                    android:id="@+id/et_container_code"
-                    android:hint="@string/hint_please_scan_container_code"
-                    android:text=""/>
-
-                <ImageButton
-                    android:id="@+id/ib_container_code_clear"
-                    style="@style/ClearImg"
-                    />
 
-                <include   layout="@layout/item_image_code" />
-            </LinearLayout>
 
             <View
                 android:layout_width="match_parent"
@@ -53,7 +37,6 @@
                     style="@style/EditTextStyle"
                     android:id="@+id/et_order_no"
                     android:hint="@string/hint_please_scan_no"
-                    android:enabled="false"
                     android:text=""/>
                 <ImageButton
                     style="@style/ClearImg"
@@ -212,97 +195,7 @@
                 android:background="@color/md_grey_100" />
 
 
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:layout_marginLeft="@dimen/dp_10"
-                android:layout_marginRight="@dimen/dp_10"
-                android:layout_marginTop="@dimen/dp_10"
-                android:background="@drawable/bg_white_et"
-                android:gravity="center_vertical"
-                android:orientation="vertical"
-                android:paddingLeft="10dp"
-                android:paddingRight="10dp">
-                <LinearLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:paddingBottom="5dp"
-                    android:paddingTop="5dp"
-                    android:orientation="horizontal">
 
-                    <TextView
-                        style="@style/tvLeftStyle"
-                        android:text="@string/str_tray_code" />
-                    <TextView
-                        style="@style/tvLeftStyle"
-                        android:text=":" />
-
-                    <com.fxy.baselibrary.views.MarqueeTextView
-                        style="@style/mtRightStyle"
-                        android:id="@+id/mt_container_code"
-                        />
-                </LinearLayout>
-
-                <LinearLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:paddingBottom="5dp"
-                    android:paddingTop="5dp"
-                    android:orientation="horizontal">
-
-                    <TextView
-                        style="@style/tvLeftStyle"
-                        android:text="货物类型" />
-                    <TextView
-                        style="@style/tvLeftStyle"
-                        android:text=":" />
-
-                    <com.fxy.baselibrary.views.MarqueeTextView
-                        style="@style/mtRightStyle"
-                        android:id="@+id/mt_send_way"
-                        />
-
-                </LinearLayout>
-                <LinearLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:paddingBottom="5dp"
-                    android:paddingTop="5dp"
-                    android:orientation="horizontal">
-
-                    <TextView
-                        style="@style/tvLeftStyle"
-                        android:text="入库数量" />
-                    <TextView
-                        style="@style/tvLeftStyle"
-                        android:text=":" />
-
-                    <com.fxy.baselibrary.views.MarqueeTextView
-                        style="@style/mtRightStyle"
-                        android:id="@+id/mt_putin_qty"
-                        />
-
-                </LinearLayout>
-
-            </LinearLayout>
-
-
-            <View
-                android:layout_width="match_parent"
-                android:layout_height="1dp"
-                android:background="@color/md_grey_100" />
-
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:paddingBottom="5dp"
-                android:paddingTop="5dp"
-                android:orientation="horizontal">
-                <TextView
-                    android:layout_marginLeft="@dimen/dp_10"
-                    style="@style/tvLeftStyle"
-                    android:text="最近扫描:" />
-            </LinearLayout>
 
             <LinearLayout
                 android:layout_width="fill_parent"

+ 48 - 29
app/src/main/res/layout/activity_fxy_quality_volume.xml

@@ -17,7 +17,35 @@
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:orientation="vertical">
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:layout_marginTop="@dimen/dp_10"
+                android:background="@drawable/bg_white_et"
+                android:gravity="center_vertical"
+                android:orientation="vertical"
+                android:paddingLeft="10dp"
+                android:paddingRight="10dp">
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:paddingBottom="5dp"
+                    android:paddingTop="5dp"
+                    android:orientation="horizontal">
 
+                    <TextView
+                        style="@style/tvLeftStyle"
+                        android:text="码托类型:" />
+
+                    <com.fxy.baselibrary.views.MarqueeTextView
+                        style="@style/mtRightStyle"
+                        android:id="@+id/mt_container_type"
+                        />
+                </LinearLayout>
+
+            </LinearLayout>
             <View
                 android:layout_width="match_parent"
                 android:layout_height="4dp"
@@ -46,10 +74,12 @@
                 android:layout_height="1dp"
                 android:background="@color/md_grey_100" />
             <LinearLayout
+                android:id="@+id/ll_weight"
                 style="@style/FromLinearLayoutItem">
                 <EditText
                     android:id="@+id/et_weight"
                     style="@style/EditTextStyle"
+                    android:inputType="numberDecimal|number"
                     android:hint="@string/hint_please_edit_weight" />
                 <TextView
                     android:id="@+id/tv_weight_unit"
@@ -57,7 +87,7 @@
                     android:layout_height="wrap_content"
                     android:textStyle="bold"
                     android:textSize="@dimen/t24"
-                    android:text="LB">
+                    android:text="KG">
                 </TextView>
             </LinearLayout>
             <View
@@ -134,6 +164,23 @@
 
 
 
+            <LinearLayout
+                android:id="@+id/ll_unique_code"
+                style="@style/FromLinearLayoutItem"
+                android:orientation="horizontal">
+                <EditText
+                    style="@style/EditTextStyle"
+                    android:id="@+id/et_unique_code"
+                    android:hint="请输入唯一码"
+                    android:text=""/>
+
+                <ImageButton
+                    android:id="@+id/ib_unique_code_clear"
+                    style="@style/ClearImg"
+                    />
+
+                <include   layout="@layout/item_image_code" />
+            </LinearLayout>
 
 
             <View
@@ -142,35 +189,7 @@
                 android:background="@color/md_grey_100" />
 
 
-            <LinearLayout
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:layout_marginLeft="@dimen/dp_10"
-                android:layout_marginRight="@dimen/dp_10"
-                android:layout_marginTop="@dimen/dp_10"
-                android:background="@drawable/bg_white_et"
-                android:gravity="center_vertical"
-                android:orientation="vertical"
-                android:paddingLeft="10dp"
-                android:paddingRight="10dp">
-                <LinearLayout
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:paddingBottom="5dp"
-                    android:paddingTop="5dp"
-                    android:orientation="horizontal">
 
-                    <TextView
-                        style="@style/tvLeftStyle"
-                        android:text="码托类型:" />
-
-                    <com.fxy.baselibrary.views.MarqueeTextView
-                        style="@style/mtRightStyle"
-                        android:id="@+id/mt_container_type"
-                        />
-                </LinearLayout>
-
-            </LinearLayout>
 
 
             <View

+ 19 - 40
app/src/main/res/layout/activity_fxy_tally.xml

@@ -17,43 +17,52 @@
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:orientation="vertical">
-
-
             <View
                 android:layout_width="match_parent"
                 android:layout_height="4dp"
                 android:background="@color/md_grey_100" />
 
             <LinearLayout
+                android:id="@+id/ll_container"
                 style="@style/FromLinearLayoutItem"
                 android:orientation="horizontal">
                 <EditText
                     style="@style/EditTextStyle"
-                    android:id="@+id/et_order_no"
-                    android:hint="@string/hint_please_scan_no"
-                    android:enabled="false"
+                    android:id="@+id/et_container_code"
+                    android:hint="@string/hint_please_scan_container_code"
                     android:text=""/>
+
                 <ImageButton
+                    android:id="@+id/ib_container_code_clear"
                     style="@style/ClearImg"
-                    android:id="@+id/ib_order_no_clear"
                     />
 
                 <include   layout="@layout/item_image_code" />
             </LinearLayout>
 
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="4dp"
+                android:background="@color/md_grey_100" />
 
             <LinearLayout
                 style="@style/FromLinearLayoutItem"
                 android:orientation="horizontal">
                 <EditText
                     style="@style/EditTextStyle"
-                    android:id="@+id/et_ctn"
-                    android:hint="请输入托数"
-                    android:enabled="true"
+                    android:id="@+id/et_order_no"
+                    android:hint="@string/hint_please_scan_no"
+                    android:enabled="false"
                     android:text=""/>
-                <ImageButton style="@style/ClearImg" android:id="@+id/ib_ctn_clear" />
+                <ImageButton
+                    style="@style/ClearImg"
+                    android:id="@+id/ib_order_no_clear"
+                    />
 
+                <include   layout="@layout/item_image_code" />
             </LinearLayout>
+
+
 <!--            -->
 
             <LinearLayout
@@ -209,37 +218,7 @@
                         android:layout_height="42dp"
                         android:text="修改"
                         android:textColor="@color/actionsheet_blue" />
-
                 </LinearLayout>
-
-                <LinearLayout
-                    android:id="@+id/ll_cnt"
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:paddingBottom="5dp"
-                    android:paddingTop="5dp"
-                    android:visibility="gone"
-                    android:orientation="horizontal">
-
-                    <TextView
-                        style="@style/tvLeftStyle"
-                        android:text="箱数" />
-                    <TextView
-                        style="@style/tvLeftStyle"
-                        android:text=":" />
-
-                    <com.fxy.baselibrary.views.MarqueeTextView
-                        style="@style/mtRightStyle"
-                        android:id="@+id/mt_cnt"
-                        />
-                    <TextView
-                        android:id="@+id/tv_edit_cnt"
-                        style="@style/tvLeftStyle"
-                        android:textColor="@color/actionsheet_blue"
-                        android:text="修改" />
-
-                </LinearLayout>
-
             </LinearLayout>
 
             <View

+ 0 - 48
app/src/main/res/layout/activity_fxy_tray.xml

@@ -58,54 +58,6 @@
             </LinearLayout>
 
 
-            <View
-                android:layout_width="match_parent"
-                android:layout_height="1dp"
-                android:background="@color/md_grey_100" />
-
-
-            <include layout="@layout/fragment_show_img"/>
-
-            <LinearLayout
-                android:id="@+id/ll_volume_content"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:orientation="vertical"
-                >
-            </LinearLayout>
-            <View
-                android:layout_width="match_parent"
-                android:layout_height="1dp"
-                android:background="@color/md_grey_100" />
-            <LinearLayout
-                android:id="@+id/ll_add_volume"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:layout_marginLeft="@dimen/dp_10"
-                android:layout_marginRight="@dimen/dp_10"
-                android:background="@drawable/bg_white_et"
-                android:gravity="center_vertical"
-                android:orientation="vertical"
-                android:paddingTop="5dp"
-                android:paddingBottom="5dp">
-                <TextView
-                    style="@style/fontSize"
-                    android:id="@+id/tv_clear_pictures"
-                    android:layout_width="wrap_content"
-                    android:layout_marginLeft="@dimen/dp_10"
-                    android:background="@drawable/bg_blue_item"
-                    android:gravity="center"
-                    android:layout_weight="1"
-                    android:text="清空重拍"
-                    android:padding="10dp"
-                    android:textColor="@color/white"
-                    android:visibility="visible"
-                    android:layout_height="wrap_content">
-                </TextView>
-
-            </LinearLayout>
-
-
             <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"

+ 42 - 0
baselibrary/src/main/java/com/fxy/baselibrary/base/BaseActivity.java

@@ -53,6 +53,7 @@ import com.fxy.baselibrary.views.MarqueeTextView;
 import org.greenrobot.eventbus.EventBus;
 import org.greenrobot.eventbus.Subscribe;
 import org.greenrobot.eventbus.ThreadMode;
+import org.json.JSONArray;
 import org.json.JSONException;
 import org.json.JSONObject;
 
@@ -976,4 +977,45 @@ public abstract class BaseActivity extends SupportActivity implements Observer {
     protected String getValStr(EditText v){
         return v.getText().toString().trim();
     }
+
+
+    /**
+     * 处理特殊字符串
+     * @param str
+     * @param ruleStr
+     * @return
+     */
+    protected String StrInterception(String str,String ruleStr){
+        try {
+            str = str.replaceAll("\u001D", "");
+            JSONArray rule = new JSONArray(ruleStr);
+            int len = str.length();
+            for (int i=0;i<rule.length();i++){
+                JSONObject jsonObject = rule.getJSONObject(i);
+                String number_start = jsonObject.getString("number_start");
+                int cut_type = jsonObject.getInt("cut_type");
+                int number_length = jsonObject.getInt("number_length");
+                int start_index = jsonObject.getInt("start_index")-1;
+                int cut_length = jsonObject.getInt("cut_length");
+
+                if (len!=number_length){
+                    continue;
+                }
+
+                if (!number_start.equals("%") && !str.startsWith(number_start)){
+                    continue;
+                }
+
+                if (cut_type==1){
+                    str = str.substring(start_index,cut_length+start_index);
+                }
+                //从后往前截取待完善
+            }
+
+        } catch (Exception e) {
+            XLog.e("截取失败"+e.getMessage());
+            e.printStackTrace();
+        }
+        return str;
+    }
 }

+ 1 - 1
config.gradle

@@ -8,7 +8,7 @@ ext {
             minSdkVersion    : 17,
             targetSdkVersion : 23,
             versionCode      : 1,
-            versionName      : "2.2.0",
+            versionName      : "2.3.0",
             versionApi       : "2.1",
     ]