Parcourir la source

增加质检功能

guilin il y a 1 an
Parent
commit
989bf44bcb

+ 11 - 0
app/src/main/AndroidManifest.xml

@@ -269,6 +269,17 @@
             android:windowSoftInputMode="stateHidden|adjustPan"
             android:screenOrientation="portrait"
             tools:ignore="LockedOrientationActivity"/>
+
+        <activity
+            android:name=".putOut.QualityInspectionMainActivity"
+            android:windowSoftInputMode="stateHidden|adjustPan"
+            android:screenOrientation="portrait"
+            tools:ignore="LockedOrientationActivity"/>
+        <activity
+            android:name=".putOut.QualityVolumeMainActivity"
+            android:windowSoftInputMode="stateHidden|adjustPan"
+            android:screenOrientation="portrait"
+            tools:ignore="LockedOrientationActivity"/>
     </application>
 
 

+ 36 - 3
app/src/main/java/com/fxy/common/PictureSelectorUpload.java

@@ -58,6 +58,8 @@ public class PictureSelectorUpload {
     private ProgressDialog progressDialog;
     List<String> errorList =  new ArrayList<String> ();;
 
+    //操作上传
+    protected String actionType = "";
     //等待上传
     private List<LocalMedia> awaitUploadList=new ArrayList<>();
     //已失败
@@ -117,6 +119,22 @@ public class PictureSelectorUpload {
         this.minimumCompressSize = minimumCompressSize;
     }
 
+    /**
+     * 获取操作类型
+     * @param actionType
+     */
+    public void setActionType(String actionType) {
+        this.actionType = actionType;
+    }
+
+    /**
+     * 设置操作类型
+     * @return
+     */
+    public String getActionType() {
+       return actionType;
+    }
+
     public ArrayList getPhotoList(){
         return  adapter.getPhotoList();
     }
@@ -304,7 +322,7 @@ public class PictureSelectorUpload {
                     closeDialog();
                     // 通过接口对象传上传状态
                     if (uploadChangeListener!=null){
-                        uploadChangeListener.uploadResult(true);
+                        uploadChangeListener.uploadResult(true,actionType);
                     }
 
                 }
@@ -313,7 +331,7 @@ public class PictureSelectorUpload {
                 e.printStackTrace();
                 // 通过接口对象传上传状态
                 if (uploadChangeListener!=null){
-                    uploadChangeListener.uploadResult(false);
+                    uploadChangeListener.uploadResult(false,actionType);
                 }
 
             }
@@ -332,13 +350,16 @@ public class PictureSelectorUpload {
     // 状态变化监听
     public interface UploadChangeListener {
         // 回调方法 可以多个
-        void uploadResult(boolean State);
+        void uploadResult(boolean State,String actionType);
+        void uploadActionType(String actionType);
     }
     // 提供注册事件监听的方法
     public void setOnChangeListener(UploadChangeListener uploadChangeListener) {
         this.uploadChangeListener = uploadChangeListener;
     }
 
+
+
     // 调用回调方法
     //uploadChangeListener.uploadResult(false);
 
@@ -456,6 +477,10 @@ public class PictureSelectorUpload {
                             }
                         }
                     });
+            //监听返回当前某个上传类型
+            if (uploadChangeListener!=null){
+                uploadChangeListener.uploadActionType(actionType);
+            }
         }
     };
 
@@ -528,6 +553,7 @@ public class PictureSelectorUpload {
                                 .compress(isCompress) // 压缩
                                 .cropCompressQuality(compressQuality)// 裁剪压缩质量 默认100
                                 .minimumCompressSize(minimumCompressSize) //最新压缩图片
+
                                 .forResult(PictureConfig.CHOOSE_REQUEST);
                         break;
                     case R.id.tv_camera:
@@ -555,6 +581,8 @@ public class PictureSelectorUpload {
         mAlbum.setOnClickListener(clickListener);
         mCamera.setOnClickListener(clickListener);
         mCancel.setOnClickListener(clickListener);
+
+
     }
 
     /**
@@ -572,6 +600,11 @@ public class PictureSelectorUpload {
                 .cropCompressQuality(compressQuality)// 裁剪压缩质量 默认100
                 .minimumCompressSize(minimumCompressSize) //最新压缩图片
                 .forResult(PictureConfig.CHOOSE_REQUEST);
+
+        //监听返回当前某个上传类型
+        if (uploadChangeListener!=null){
+            uploadChangeListener.uploadActionType(actionType);
+        }
     }
 
     public void closePopupWindow() {

+ 1 - 1
app/src/main/java/com/fxy/fms/putIn/TallyPictureMainActivity.java

@@ -447,7 +447,7 @@ public class TallyPictureMainActivity extends  BaseActivity implements StoJNI.Sc
 
 
     //获取输入框值
-    private String getValStr(EditText v){
+    protected String getValStr(EditText v){
         return v.getText().toString().trim();
     }
 

+ 0 - 34
app/src/main/java/com/fxy/fms/putIn/TallyVolumeMainActivity.java

@@ -908,40 +908,6 @@ public class TallyVolumeMainActivity extends  BaseActivity implements StoJNI.Sca
             e.printStackTrace();
         }
     }
-    //金额验证
-    public static boolean isNumber(String str,Integer num){
-        Pattern pattern=Pattern.compile("^(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,"+num+"})?$"); // 判断小数点后2位的数字的正则表达式
-        Matcher match=pattern.matcher(str);
-        if (match.matches()){
-            return Double.parseDouble(str) > 0;
-        }else{
-            return false ;
-        }
-
-    }
-
-    public static boolean isNumber(String str,Integer num,int min){
-        Pattern pattern=Pattern.compile("^(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,"+num+"})?$"); // 判断小数点后2位的数字的正则表达式
-        Matcher match=pattern.matcher(str);
-        if (match.matches()){
-            return Double.parseDouble(str) > min;
-        }else{
-            return false ;
-        }
-
-    }
-
-    public static boolean isNum(String str,Integer num){
-        Pattern pattern=Pattern.compile("^(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,"+num+"})?$"); // 判断小数点后2位的数字的正则表达式
-        Matcher match=pattern.matcher(str);
-        return  match.matches();
-    }
-
-
-    //获取输入框值
-    private String getValStr(EditText v){
-        return v.getText().toString().trim();
-    }
 
     @Override
     protected void onDestroy() {

+ 6 - 2
app/src/main/java/com/fxy/main/fragment/HomePagerFragment.java

@@ -19,6 +19,7 @@ import com.elvishew.xlog.XLog;
 import com.fxy.putIn.TallyMainActivity;
 import com.fxy.putIn.TrayMainActivity;
 import com.fxy.putOut.DeliveryGoodsMainActivity;
+import com.fxy.putOut.QualityInspectionMainActivity;
 import com.google.zxing.Result;
 import com.fxy.baselibrary.base.BaseFragment;
 import com.fxy.baselibrary.interfaces.OnRxScanerListener;
@@ -125,7 +126,7 @@ public class HomePagerFragment extends BaseFragment implements View.OnClickListe
      * 绑定事件
      * @param v
      */
-    @OnClick({R.id.search_view, R.id.ima_or_code,R.id.ivt_tally,R.id.ivt_cargo_storage,R.id.ivt_tray})
+    @OnClick({R.id.search_view, R.id.ima_or_code,R.id.ivt_tally,R.id.ivt_cargo_storage,R.id.ivt_tray,R.id.ivt_quality})
     public void onClick(View v) {
         Bundle bundle = new Bundle();
         switch (v.getId()) {
@@ -141,7 +142,10 @@ public class HomePagerFragment extends BaseFragment implements View.OnClickListe
                 bundle.putString("action","storage");
                 intent2Page(getActivity(), DeliveryGoodsMainActivity.class, false,bundle);;
                 break;
-
+            case R.id.ivt_quality:
+                bundle.putString("action","receive");
+                intent2Page(getActivity(), QualityInspectionMainActivity.class, false,bundle);;
+                break;
             default:
                 showToast("还没有配置点击事件");
                 break;

+ 6 - 1
app/src/main/java/com/fxy/putIn/TallyMainActivity.java

@@ -288,7 +288,7 @@ public class TallyMainActivity extends  BaseActivity implements StoJNI.ScanCallB
         pictureSelectorUpload.setCompress(true,100,500);
         pictureSelectorUpload.setOnChangeListener(new PictureSelectorUpload.UploadChangeListener() {
             @Override
-            public void uploadResult(boolean State) {
+            public void uploadResult(boolean State,String actionType) {
                 if (State) {
                     System.out.println("文件上传回调成功");
                     doPutIn();
@@ -296,6 +296,11 @@ public class TallyMainActivity extends  BaseActivity implements StoJNI.ScanCallB
                     System.out.println("文件上传失败");
                 }
             }
+
+            @Override
+            public void uploadActionType(String actionType) {
+
+            }
         });
     }
 

+ 893 - 0
app/src/main/java/com/fxy/putOut/QualityInspectionMainActivity.java

@@ -0,0 +1,893 @@
+package com.fxy.putOut;
+
+import android.annotation.SuppressLint;
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.os.Build;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.inputmethod.EditorInfo;
+import android.widget.EditText;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.RadioButton;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.annotation.RequiresApi;
+
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
+import com.elvishew.xlog.XLog;
+import com.fxy.R;
+import com.fxy.baselibrary.base.BaseActivity;
+import com.fxy.baselibrary.bean.BaseEventBusBean;
+import com.fxy.baselibrary.interfaces.OnRxScanerListener;
+import com.fxy.baselibrary.qrcode.ActivityScanerCode;
+import com.fxy.baselibrary.util.JsonUtil;
+import com.fxy.baselibrary.util.StringUtils;
+import com.fxy.baselibrary.views.MarqueeTextView;
+import com.fxy.bean.ActionBean;
+import com.fxy.bean.ScanBean;
+import com.fxy.common.CommonDialog;
+import com.fxy.common.PictureSelectorUpload;
+import com.fxy.constant.BaseConfig;
+import com.fxy.constant.EventCode;
+import com.fxy.constant.SPCache;
+import com.fxy.net.MyDialogCallback;
+import com.fxy.net.Urls;
+import com.fxy.view.FloatingImageView;
+import com.google.zxing.Result;
+import com.luck.picture.lib.config.PictureConfig;
+import com.lzy.okgo.OkGo;
+import com.lzy.okgo.model.Response;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.OnClick;
+import butterknife.Unbinder;
+import sto.android.app.StoJNI;
+import sto.android.app.StoPdaKeyEvent;
+import sto.android.app.StoTongJNI;
+
+public class QualityInspectionMainActivity extends  BaseActivity implements StoJNI.ScanCallBack {
+    /**
+     * 列表适配器
+     */
+    Context mContext = this;
+
+    //单号清除
+    @BindView(R.id.ib_order_no_clear)
+    ImageButton ibOrderNoClear;
+
+    //单号
+    @BindView(R.id.et_order_no)
+    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;
+
+
+
+    @BindView(R.id.ll_panorama_area)
+    LinearLayout llPanoramaArea;
+
+    @BindView(R.id.ll_label_area)
+    LinearLayout llLabelArea;
+
+
+    @BindView(R.id.ll_damaged_area)
+    LinearLayout llDamagedArea;
+
+
+    private View notDataView;   //没有数据显示页
+    private View errorView;     //错误显示页
+    private View emptyView;     //空显示页
+
+    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<>();
+
+    private PictureSelectorUpload currentUpload;
+
+    private PictureSelectorUpload panoramaUpload ;
+    private PictureSelectorUpload labelUpload;
+    private PictureSelectorUpload damagedUpload;
+
+    //质检结果
+    private String categoryName = "";
+
+    @Override
+    public int getContentViewResId() {
+        return R.layout.activity_fxy_quality_inspection;
+    }
+
+    @Override
+    public boolean showToolBar() {
+        return true;
+    }
+
+    @Override
+    public boolean openEventBus() {
+        return true;
+    }
+
+    @Override
+    protected void getBundleExtras(Bundle bundle) {
+
+    }
+    //finish的返回监听
+    //这里的requestCode参数,就是上面设置的 1 ,当跳转的页面返回的时候,通过这个加以判断
+    //resultCode ,这个参数是在跳转的页面里面规定的,它也是一个int类型的标志
+    //第三个参数包含了返回的值
+    //如果不需要所跳转的页面返回值,也就不需要这个方法了
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+//        XLog.e("requestCode:"+requestCode);
+//        XLog.e("resultCode:"+resultCode);
+//        XLog.e(data);
+        if (requestCode == 200 && resultCode == 200)//之前提到的两个标志,在这里显示出了作用
+        {
+        }else if (resultCode==0){
+        }
+
+        if (resultCode == RESULT_OK) {
+            if (requestCode == PictureConfig.CHOOSE_REQUEST) {// 图片选择结果回调
+                if (currentUpload!=null){
+                    currentUpload.getSelectImg(data);
+                }
+
+            }
+        }
+    }
+
+
+    /**
+     * EventBus接收信息的方法,开启后才会调用(非粘性事件)
+     *
+     * @param event
+     */
+    @Override
+    protected void EventBean(BaseEventBusBean event) {
+//        XLog.e("----------接收返回--------------");
+//        XLog.e("接收返回:"+event.getEventCode());
+        if (event != null && event.getEventCode() == EventCode.displacement_refresh){
+
+        }
+    }
+
+    @Override
+    public boolean isPlayMusic() {
+        return true;
+    }
+
+    @Override
+    protected void initView() {
+        unbinder = ButterKnife.bind(this);
+        setTitleName(getString(R.string.tally));
+
+        initAdapter();
+        initData();
+        initEdit();
+        initDialog();
+        //监听浮动按钮
+        iv_drag.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if(!iv_drag.isDrag()){
+                    ActivityScanerCode.setScanerListener(mScanerListener);
+                    ActivityScanerCode.intent2Activity(mContext, BaseConfig.COMMON_SCANNER_ONLY);
+                }
+            }
+        });
+
+        initUpload();
+
+
+    }
+
+    /**
+     * 初始化上传文件
+     */
+    private void initUpload(){
+
+        RecyclerView rvPanoramaShowImg = (RecyclerView)llPanoramaArea.findViewById(R.id.rv_show_img);
+        RecyclerView rvLabelShowImg = (RecyclerView)llLabelArea.findViewById(R.id.rv_show_img);
+        RecyclerView rvDamagedShowImg = (RecyclerView)llDamagedArea.findViewById(R.id.rv_show_img);
+
+        panoramaUpload  = setItemPicture("panorama",rvPanoramaShowImg);
+        labelUpload     = setItemPicture("label",rvLabelShowImg);
+        damagedUpload   = setItemPicture("damaged",rvDamagedShowImg);
+    }
+
+
+    /*
+     * 设置radio的点击事件,当点击的时候显示文字
+     */
+    public void onRadioButtonClicked(View view) {
+        RadioButton button = (RadioButton) view;
+        boolean isChecked = button.isChecked();
+
+
+        switch (view.getId()) {
+            case R.id.rb_intact:
+                categoryName = "完好";
+                llDamagedArea.setVisibility(View.GONE);
+                break;
+            case R.id.rb_breakage:
+                categoryName = "破损";
+                llDamagedArea.setVisibility(View.VISIBLE);
+                break;
+
+            default:
+                break;
+        }
+    }
+
+    /**
+     * 设置多个上传文件
+     * @param actionType String
+     * @param showImg RecyclerView
+     */
+    private PictureSelectorUpload setItemPicture(String actionType,RecyclerView showImg){
+        PictureSelectorUpload pictureUpload = new PictureSelectorUpload(QualityInspectionMainActivity.this,showImg,"tally",1);
+        pictureUpload.setActionType(actionType);
+        pictureUpload.setCompress(true,100,500);
+        pictureUpload.setOnChangeListener(new PictureSelectorUpload.UploadChangeListener() {
+            @Override
+            public void uploadResult(boolean State,String actionType) {
+                if (State) {
+                    System.out.println("文件上传回调成功");
+                } else {
+                    System.out.println("文件上传失败");
+                }
+            }
+
+            @Override
+            public void uploadActionType(String actionType) {
+
+                System.out.println("actionType:"+actionType);
+                switch (actionType){
+                    case "panorama":
+                        currentUpload = panoramaUpload;
+                        break;
+                    case "label":
+                        currentUpload = labelUpload;
+                        break;
+                    case "damaged":
+                        currentUpload = damagedUpload;
+                        break;
+                }
+
+            }
+        });
+        return  pictureUpload;
+    }
+
+
+    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();
+            }
+        });
+
+
+    }
+
+
+
+
+    @Override
+    public boolean dispatchKeyEvent(KeyEvent event) {
+        //XLog.e("Action:"+event.getAction()+"---event:"+event.getKeyCode());
+        if ((event.getKeyCode()==KeyEvent.KEYCODE_DPAD_CENTER )  && event.getAction() == KeyEvent.ACTION_DOWN){
+            if(validate()){
+                doPutIn();
+            }
+            return true;
+        }
+        return true;
+        //return super.dispatchKeyEvent(event);
+    }
+
+    //监听按键
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        //XLog.e("监听按键:"+keyCode);XLog.e(event);
+        if (scanBean.getIsBroadcast()==0 && StoTongJNI.getIns(mContext).getEventFuction(keyCode)  == StoPdaKeyEvent.KEYCODE_SCAN
+                && event.getRepeatCount() == 0) {
+
+            if (StoTongJNI.getIns(mContext).GetScannerIsScanning()) {
+//
+            } else {
+                StoTongJNI.getIns(mContext).SetScannerStart();
+            }
+        }
+        return super.onKeyDown(keyCode, event);
+    }
+
+    @SuppressLint("HandlerLeak")
+    Handler scanHandler = new Handler() {
+
+        @Override
+        public void handleMessage(Message msg) {
+            // TODO Auto-generated method stub
+            if (msg.obj != null) {
+
+                String scanResult = msg.obj.toString().trim();
+                if (!scanResult.isEmpty()){
+                    setScanResult(scanResult);
+                }
+            }
+
+        }
+
+    };
+    @Override
+    public void onScanResults(String str) {
+        Message msg = new Message();
+        msg.obj = str;
+        scanHandler.sendMessage(msg);
+
+
+    }
+
+
+    @Override
+    public void onScanResults(String str, int type) {
+
+    }
+    /**
+     * 定义广播接受
+     */
+    BroadcastReceiver mReceiver = new BroadcastReceiver() {
+        @Override
+        public void onReceive(Context context, Intent intent) {
+            String scanResult = intent.getStringExtra(scanBean.getDataName());
+            if (scanResult==null){return; }
+            String scanStatus = "";
+            if (!scanBean.getStatusName().isEmpty()){
+                scanStatus = intent.getStringExtra(scanBean.getStatusName());
+            }else{
+                scanStatus = scanResult.isEmpty()? "" : "ok"; //有值 默认是扫码成功;
+            }
+
+            //新大陆(MT65,MT90) 需要手动关闭
+            if (!scanBean.getActionStop().isEmpty()){
+                Intent stopIntent = new Intent(scanBean.getActionStop());
+                mContext.sendBroadcast(stopIntent);
+            }
+
+            if ("ok".equals(scanStatus)){
+                setScanResult(scanResult);
+            }else{
+                showErrorToast(getString(R.string.scan_failed));
+            }
+        }
+    };
+
+    /**
+     * 注册广播
+     */
+    private void initReceiver(){
+
+        try {
+
+            String scanStr = getScanSetting();
+            scanBean = JsonUtil.getObject(scanStr, ScanBean.class);
+            Integer is_broadcast = scanBean.getIsBroadcast();//是否广播
+
+            if (is_broadcast ==1){
+                IntentFilter mFilter = new IntentFilter(scanBean.getAction());
+                this.registerReceiver(mReceiver, mFilter);
+            }else{
+                //不广播进行处理 jni模式
+                String pdaBrand = StoTongJNI.getmPdaBrand();
+                if (!pdaBrand.isEmpty()){
+                    StoTongJNI.getIns(this).setmScanCB(this);
+                    StoTongJNI.getIns(this).SetScannerOn();
+                }
+            }
+
+
+        }catch (Exception e) {
+            showErrorToast("获取扫码配置失败"+e.getMessage());
+            XLog.e("获取扫码配置失败:" + e.getMessage());
+        }
+    }
+
+
+    //统一按钮回调
+    public void callbackEditor(View v){
+        switch (v.getId()) {
+            case R.id.et_order_no:
+                doPutIn();
+                break;
+            default:
+        }
+    }
+
+
+
+
+
+    private void initEdit() {
+        List<EditText> list = new ArrayList<>();
+        list.add(etOrderNo);
+        unifyEdit(list);
+    }
+
+    private OnRxScanerListener mScanerListener = new OnRxScanerListener() {
+        @Override
+        public void onSuccess(String type, Result result) {
+            String scanResult = result.getText();
+            switch (type){
+                case BaseConfig.COMMON_SCANNER_ONLY:
+                    setScanResult(scanResult);
+
+                    break;
+            }
+        }
+        @Override
+        public void onFail(String type, String message) {
+
+        }
+    };
+
+    //把扫描结果赋值
+    private void setScanResult(String scanResult){
+        if (commonDialog!=null && commonDialog.isShowing()){
+            commonDialog.setContent(scanResult);
+            return;
+        }
+        //获取焦点的view对象
+        View view=getWindow().getDecorView().findFocus();
+        //如果是EditText
+        if(view instanceof EditText)
+        {
+            ((EditText) view).setText(scanResult);
+            //执行回调
+            callbackEditor(view);
+        }
+    }
+
+
+
+
+    public void doPutIn() {
+        //校验数据
+        if (!validate()){
+            return;
+        }
+
+        try {
+            final String tracking_number = etOrderNo.getText().toString().trim();
+            JSONObject param = new JSONObject();
+            param.put("tracking_number",tracking_number);
+
+            param.put("img_1",panoramaUpload.getPhotoList().get(0));
+            param.put("img_2",labelUpload.getPhotoList().get(0));
+
+            if (categoryName.equals("破损")){
+                param.put("img_3",damagedUpload.getPhotoList().get(0));
+            }
+
+
+
+
+            if (!checkRepeat(Urls.FXY_PUT_IN+(param.toString()))){return;}
+
+            OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_PUT_IN)
+                    .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);
+                                }
+
+                                setPageViewData(result);
+                                if(bean.code == 1){
+                                    showSuccessToast(bean.msg);
+                                    llDamagedArea.setVisibility(View.GONE);
+                                    clearData(false);
+                                }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);
+                                    }
+
+                                }
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                                XLog.e("请求入库返回错误",e.getMessage());
+                            }
+                        }
+                    });
+        } catch (JSONException e) {
+            showEmptyView("请求入库失败:"+e.getMessage());
+            e.printStackTrace();
+        }
+
+
+    }
+
+    /*
+     * 校验必录
+     */
+    private boolean validate(){
+
+
+        if(!checkNull(etOrderNo)){
+            setEditTextFocused(etOrderNo,true);
+            showWarningToast(etOrderNo.getHint().toString());
+            return false;
+        }
+
+
+        if (panoramaUpload.getPhotoList().size()==0){
+            showWarningToast("请选择全景图");
+            return false;
+        }
+
+        if (labelUpload.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);
+        }
+
+
+        public void setNewData(List<JSONObject> tallyDataList) {
+        }
+
+        @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();
+            }
+        }
+    }
+    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"));
+            }
+
+            mtSendWay.setText(send_way);
+            mtPutinQty.setText(putin_qty);
+
+
+        }catch (JSONException e) {
+            XLog.e("获取理货缓存数据错误",e);
+            e.printStackTrace();
+        }
+    }
+    //清除订单信息
+    private void clearData(boolean isAll) {
+        etOrderNo.setText("");
+        etOrderNo.requestFocus();
+        setEditTextNormal(etOrderNo,true);
+        currentUpload.emptyRemake();//清空图片
+        photoList.clear();
+    }
+
+    @OnClick({R.id.btn_confirm})
+    public void onViewClicked(View view) {
+        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();
+                break;
+
+//            case R.id.tv_clear_pictures:
+//                currentUpload.emptyRemake();
+//                break;
+            default:
+                break;
+        }
+    }
+
+    /**
+     * 统一设置Edit监听
+     * @param  list
+     */
+    public void unifyEdit(List<EditText> list){
+        for (int i=0;i<list.size();i++){
+            EditText editText = list.get(i);
+
+            LinearLayout linearLayout = (LinearLayout)editText.getParent();
+            ImageButton imageButton = getChildImageButton(linearLayout);
+
+            //监听扫描
+            ImageView imageView = linearLayout.findViewById(R.id.ima_or_code);
+            imageView.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    LinearLayout linearLayout = (LinearLayout)v.getParent();
+                    for( int i = 0; i < linearLayout.getChildCount(); i++ ){
+                        if( linearLayout.getChildAt(i) instanceof EditText ){
+                            ((EditText)linearLayout.getChildAt(i)).requestFocus();
+                            break;
+                        }
+                    }
+                    ActivityScanerCode.setScanerListener(mScanerListener);
+                    ActivityScanerCode.intent2Activity(mContext, BaseConfig.COMMON_SCANNER_ONLY);
+                }
+            });
+
+
+            //监听按确定
+            editText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+                @Override
+                public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+                    //XLog.e("actionId:"+actionId);
+                    if (actionId == EditorInfo.IME_ACTION_SEND || actionId == EditorInfo.IME_ACTION_DONE   ) {
+                        if (v.getText().toString().trim().isEmpty()) {
+                            setEditTextFocused(v,true);
+                            showWarningToast(v.getHint().toString());
+                            return false;
+                        }else{
+                            setEditTextNormal(v,true);
+                        }
+
+                        callbackEditor(v);
+
+                        return false;
+                    }
+                    return false;
+                }
+            });
+            editText.addTextChangedListener(new TextWatcher() {
+                public void onTextChanged(CharSequence s, int start, int before, int count) {
+                    EditText currentEditText = null;
+                    ImageButton currentImage = null;
+                    //获取焦点的view对象
+                    View view=getWindow().getDecorView().findFocus();
+                    //如果是EditText
+                    if(view instanceof EditText){
+                        currentEditText = (EditText) view;
+                        currentImage = getChildImageButton((LinearLayout)currentEditText.getParent());
+                    }
+
+                    if (s.length() > 0  ) {
+
+                        if (currentImage !=null ){
+                            currentImage.setVisibility(View.VISIBLE);
+                        }
+                        if (currentEditText!=null){
+                            setEditTextNormal(currentEditText,true);
+                        }
+
+                    } else {
+                        if (currentImage !=null ){
+                            currentImage.setVisibility(View.INVISIBLE);
+                        }
+                        if (currentEditText!=null){
+                            setEditTextFocused(currentEditText,true);
+                        }
+                    }
+                }
+
+                public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+                }
+
+                public void afterTextChanged(Editable s) {
+
+                }
+            });
+
+            if (imageButton !=null ){
+                unifyClearEdit(imageButton);
+            }
+        }
+    }
+
+
+    @Override
+    protected void onDestroy() {
+        unbinder.unbind();
+        panoramaUpload.removeHandler();
+        labelUpload.removeHandler();
+        damagedUpload.removeHandler();
+
+        super.onDestroy();
+    }
+    @Override
+    protected void onResume() {
+        super.onResume();
+        initReceiver();
+    }
+    @Override
+    protected void onPause() {
+        super.onPause();
+        //销毁在onResume()方法中的广播
+        try {
+            //停止扫描
+            Integer is_broadcast = scanBean.getIsBroadcast();//是否广播
+            if (is_broadcast==0){
+                StoTongJNI.getIns(mContext).SetScannerStop();
+                StoTongJNI.getIns(mContext).SetScannerOff();
+            }else{
+                unregisterReceiver(mReceiver);
+            }
+        }catch (Exception e){
+            XLog.e("销毁广播失败:",e.getMessage());
+        }
+    }
+
+
+}

+ 723 - 0
app/src/main/java/com/fxy/putOut/QualityVolumeMainActivity.java

@@ -0,0 +1,723 @@
+package com.fxy.putOut;
+
+import android.annotation.SuppressLint;
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.os.Build;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.inputmethod.EditorInfo;
+import android.widget.EditText;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.RadioButton;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.annotation.RequiresApi;
+
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
+import com.elvishew.xlog.XLog;
+import com.fxy.R;
+import com.fxy.baselibrary.base.BaseActivity;
+import com.fxy.baselibrary.bean.BaseEventBusBean;
+import com.fxy.baselibrary.interfaces.OnRxScanerListener;
+import com.fxy.baselibrary.qrcode.ActivityScanerCode;
+import com.fxy.baselibrary.util.JsonUtil;
+import com.fxy.baselibrary.util.StringUtils;
+import com.fxy.baselibrary.views.MarqueeTextView;
+import com.fxy.bean.ActionBean;
+import com.fxy.bean.ScanBean;
+import com.fxy.common.CommonDialog;
+import com.fxy.common.PictureSelectorUpload;
+import com.fxy.constant.BaseConfig;
+import com.fxy.constant.EventCode;
+import com.fxy.constant.SPCache;
+import com.fxy.net.MyDialogCallback;
+import com.fxy.net.Urls;
+import com.fxy.view.FloatingImageView;
+import com.google.zxing.Result;
+import com.luck.picture.lib.config.PictureConfig;
+import com.lzy.okgo.OkGo;
+import com.lzy.okgo.model.Response;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.OnClick;
+import butterknife.Unbinder;
+import sto.android.app.StoJNI;
+import sto.android.app.StoPdaKeyEvent;
+import sto.android.app.StoTongJNI;
+
+public class QualityVolumeMainActivity extends  BaseActivity implements StoJNI.ScanCallBack {
+    /**
+     * 列表适配器
+     */
+    Context mContext = this;
+
+    //单号清除
+    @BindView(R.id.ib_container_code_clear)
+    ImageButton ibContainerCodeClear;
+
+    //单号
+    @BindView(R.id.et_container_code)
+    EditText etContainerCode;
+
+
+    @BindView(R.id.et_weight)
+    EditText etWeight;
+
+    @BindView(R.id.et_length)
+    EditText etLength;
+
+    @BindView(R.id.et_width)
+    EditText etWidth;
+
+    @BindView(R.id.et_height)
+    EditText etHeight;
+
+
+
+    @BindView(R.id.mt_container_type)
+    MarqueeTextView mtContainerType;
+
+    //托盘组件
+    @BindView(R.id.ll_container)
+    LinearLayout llContainer;
+
+    //浮动按钮
+    @BindView(R.id.iv_drag)
+    FloatingImageView iv_drag;
+
+
+
+    //扫码扫码动作
+    private ScanBean scanBean;
+
+
+    //托盘返回对象
+    private JSONObject palletObject;
+
+    private Unbinder unbinder;
+
+
+
+    //托盘对象
+    private JSONObject tallyInfo = null;
+    private String containerType = "";
+    private String orderNumber = "";
+
+
+    @Override
+    public int getContentViewResId() {
+        return R.layout.activity_fxy_quality_volume;
+    }
+
+    @Override
+    public boolean showToolBar() {
+        return true;
+    }
+
+    @Override
+    public boolean openEventBus() {
+        return true;
+    }
+
+    @Override
+    protected void getBundleExtras(Bundle bundle) {
+        containerType = bundle.getString("container_type","");
+        orderNumber = bundle.getString("order_number","");
+
+    }
+    //finish的返回监听
+    //这里的requestCode参数,就是上面设置的 1 ,当跳转的页面返回的时候,通过这个加以判断
+    //resultCode ,这个参数是在跳转的页面里面规定的,它也是一个int类型的标志
+    //第三个参数包含了返回的值
+    //如果不需要所跳转的页面返回值,也就不需要这个方法了
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+//        XLog.e("requestCode:"+requestCode);
+//        XLog.e("resultCode:"+resultCode);
+//        XLog.e(data);
+        if (requestCode == 200 && resultCode == 200)//之前提到的两个标志,在这里显示出了作用
+        {
+        }else if (resultCode==0){
+        }
+    }
+
+
+    /**
+     * EventBus接收信息的方法,开启后才会调用(非粘性事件)
+     *
+     * @param event
+     */
+    @Override
+    protected void EventBean(BaseEventBusBean event) {
+//        XLog.e("----------接收返回--------------");
+//        XLog.e("接收返回:"+event.getEventCode());
+        if (event != null && event.getEventCode() == EventCode.displacement_refresh){
+
+        }
+    }
+
+    @Override
+    public boolean isPlayMusic() {
+        return true;
+    }
+
+    @Override
+    protected void initView() {
+        unbinder = ButterKnife.bind(this);
+        setTitleName("标准质检");
+
+        initData();
+        initEdit();
+        initDialog();
+        //监听浮动按钮
+        iv_drag.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if(!iv_drag.isDrag()){
+                    ActivityScanerCode.setScanerListener(mScanerListener);
+                    ActivityScanerCode.intent2Activity(mContext, BaseConfig.COMMON_SCANNER_ONLY);
+                }
+            }
+        });
+
+
+
+
+    }
+
+
+
+
+
+    private void initData(){
+
+    }
+
+
+    private void initDialog(){
+
+    }
+
+
+
+
+    @Override
+    public boolean dispatchKeyEvent(KeyEvent event) {
+        //XLog.e("Action:"+event.getAction()+"---event:"+event.getKeyCode());
+        if ((event.getKeyCode()==KeyEvent.KEYCODE_DPAD_CENTER )  && event.getAction() == KeyEvent.ACTION_DOWN){
+            if(validate()){
+                doConfirm();
+            }
+            return true;
+        }
+        return true;
+        //return super.dispatchKeyEvent(event);
+    }
+
+    //监听按键
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        //XLog.e("监听按键:"+keyCode);XLog.e(event);
+        if (scanBean.getIsBroadcast()==0 && StoTongJNI.getIns(mContext).getEventFuction(keyCode)  == StoPdaKeyEvent.KEYCODE_SCAN
+                && event.getRepeatCount() == 0) {
+
+            if (StoTongJNI.getIns(mContext).GetScannerIsScanning()) {
+//
+            } else {
+                StoTongJNI.getIns(mContext).SetScannerStart();
+            }
+        }
+        return super.onKeyDown(keyCode, event);
+    }
+
+    @SuppressLint("HandlerLeak")
+    Handler scanHandler = new Handler() {
+
+        @Override
+        public void handleMessage(Message msg) {
+            // TODO Auto-generated method stub
+            if (msg.obj != null) {
+
+                String scanResult = msg.obj.toString().trim();
+                if (!scanResult.isEmpty()){
+                    setScanResult(scanResult);
+                }
+            }
+
+        }
+
+    };
+    @Override
+    public void onScanResults(String str) {
+        Message msg = new Message();
+        msg.obj = str;
+        scanHandler.sendMessage(msg);
+
+
+    }
+
+
+    @Override
+    public void onScanResults(String str, int type) {
+
+    }
+    /**
+     * 定义广播接受
+     */
+    BroadcastReceiver mReceiver = new BroadcastReceiver() {
+        @Override
+        public void onReceive(Context context, Intent intent) {
+            String scanResult = intent.getStringExtra(scanBean.getDataName());
+            if (scanResult==null){return; }
+            String scanStatus = "";
+            if (!scanBean.getStatusName().isEmpty()){
+                scanStatus = intent.getStringExtra(scanBean.getStatusName());
+            }else{
+                scanStatus = scanResult.isEmpty()? "" : "ok"; //有值 默认是扫码成功;
+            }
+
+            //新大陆(MT65,MT90) 需要手动关闭
+            if (!scanBean.getActionStop().isEmpty()){
+                Intent stopIntent = new Intent(scanBean.getActionStop());
+                mContext.sendBroadcast(stopIntent);
+            }
+
+            if ("ok".equals(scanStatus)){
+                setScanResult(scanResult);
+            }else{
+                showErrorToast(getString(R.string.scan_failed));
+            }
+        }
+    };
+
+    /**
+     * 注册广播
+     */
+    private void initReceiver(){
+
+        try {
+
+            String scanStr = getScanSetting();
+            scanBean = JsonUtil.getObject(scanStr, ScanBean.class);
+            Integer is_broadcast = scanBean.getIsBroadcast();//是否广播
+
+            if (is_broadcast ==1){
+                IntentFilter mFilter = new IntentFilter(scanBean.getAction());
+                this.registerReceiver(mReceiver, mFilter);
+            }else{
+                //不广播进行处理 jni模式
+                String pdaBrand = StoTongJNI.getmPdaBrand();
+                if (!pdaBrand.isEmpty()){
+                    StoTongJNI.getIns(this).setmScanCB(this);
+                    StoTongJNI.getIns(this).SetScannerOn();
+                }
+            }
+
+
+        }catch (Exception e) {
+            showErrorToast("获取扫码配置失败"+e.getMessage());
+            XLog.e("获取扫码配置失败:" + e.getMessage());
+        }
+    }
+
+
+    //统一按钮回调
+    public void callbackEditor(View v){
+        switch (v.getId()) {
+            case R.id.et_container_code:
+                checkTray();
+                break;
+            default:
+        }
+    }
+
+
+
+
+
+    private void initEdit() {
+        List<EditText> list = new ArrayList<>();
+        list.add(etContainerCode);
+        unifyEdit(list);
+    }
+
+    private OnRxScanerListener mScanerListener = new OnRxScanerListener() {
+        @Override
+        public void onSuccess(String type, Result result) {
+            String scanResult = result.getText();
+            switch (type){
+                case BaseConfig.COMMON_SCANNER_ONLY:
+                    setScanResult(scanResult);
+
+                    break;
+            }
+        }
+        @Override
+        public void onFail(String type, String message) {
+
+        }
+    };
+
+    //把扫描结果赋值
+    private void setScanResult(String scanResult){
+
+        //获取焦点的view对象
+        View view=getWindow().getDecorView().findFocus();
+        //如果是EditText
+        if(view instanceof EditText)
+        {
+            ((EditText) view).setText(scanResult);
+            //执行回调
+            callbackEditor(view);
+        }
+    }
+
+    /**
+     * 检查托盘信息
+     */
+    private void checkTray(){
+        final String palletCode = etContainerCode.getText().toString().trim();
+        if (palletCode.isEmpty()){
+            setEditTextFocused(etContainerCode,true);
+            showWarningToast(etContainerCode.getHint().toString());
+            return ;
+        }
+        try {
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.put("pallet_code",palletCode);
+
+            if (!checkRepeat(Urls.FXY_CHECK_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)
+                    .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(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();
+                                    }else{
+                                        palletObject = null;
+                                        showWarningToast(bean.msg);
+                                        etContainerCode.requestFocus();
+                                        etContainerCode.selectAll();
+                                    }
+
+                                    showWarningToast(bean.msg);
+                                }
+
+
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                                showEmptyView("托盘信息解析错误:"+e.getMessage());
+                                XLog.e("获取托盘信息解析错误",e.getMessage());
+                            }
+                        }
+                    });
+        }catch (Exception e){
+            palletObject = null;
+            XLog.e("请求托盘信息错误:"+e.getMessage(),e);
+        }
+    }
+
+
+    public void doConfirm() {
+        //校验数据
+        if (!validate()){
+            return;
+        }
+
+        try {
+            String pallet_code = etContainerCode.getText().toString().trim();
+            JSONObject param = new JSONObject();
+            param.put("pallet_code",pallet_code);
+            param.put("weight",etWeight);
+            param.put("length",etLength);
+            param.put("width",etWidth);
+            param.put("height",etHeight);
+
+            if (!checkRepeat(Urls.FXY_PUT_IN+(param.toString()))){return;}
+
+            OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_PUT_IN)
+                    .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(bean.code == 1){
+                                    showSuccessToast(bean.msg);
+                                    clearData(false);
+                                }else{
+                                    showWarningToast(bean.msg);
+                                }
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                                XLog.e("请求入库返回错误",e.getMessage());
+                            }
+                        }
+                    });
+        } catch (JSONException e) {
+            showEmptyView("请求入库失败:"+e.getMessage());
+            e.printStackTrace();
+        }
+
+
+    }
+
+    /*
+     * 校验必录
+     */
+    private boolean validate(){
+
+        if(!checkNull(etContainerCode)){
+            setEditTextFocused(etContainerCode,true);
+            showWarningToast(etContainerCode.getHint().toString());
+            return false;
+        }
+
+
+        if (!isNumber(getValStr(etWeight),2)){
+            setEditTextFocused(etWeight,false);
+            showWarningToast(etWeight.getHint().toString());
+            return false;
+        }
+
+        if (!isNumber(getValStr(etLength),2)){
+            setEditTextFocused(etLength,false);
+            showWarningToast(etLength.getHint().toString());
+            return false;
+        }
+
+        if (!isNumber(getValStr(etWidth),2)){
+            setEditTextFocused(etWidth,false);
+            showWarningToast(etWidth.getHint().toString());
+            return false;
+        }
+
+        if (!isNumber(getValStr(etHeight),2)){
+            setEditTextFocused(etHeight,false);
+            showWarningToast(etHeight.getHint().toString());
+            return false;
+        }
+
+        return true;
+    }
+
+
+    //清除订单信息
+    private void clearData(boolean isAll) {
+
+        if (isAll){
+            etContainerCode.setText("");
+            etContainerCode.requestFocus();
+
+        }
+        setEditTextNormal(etContainerCode,true);
+
+    }
+
+    @OnClick({R.id.btn_confirm})
+    public void onViewClicked(View view) {
+        Bundle bundle = new Bundle();
+        switch (view.getId()) {
+            case R.id.btn_confirm:
+                doConfirm();
+                break;
+            default:
+                break;
+        }
+    }
+
+    /**
+     * 统一设置Edit监听
+     * @param  list
+     */
+    public void unifyEdit(List<EditText> list){
+        for (int i=0;i<list.size();i++){
+            EditText editText = list.get(i);
+
+            LinearLayout linearLayout = (LinearLayout)editText.getParent();
+            ImageButton imageButton = getChildImageButton(linearLayout);
+
+            //监听扫描
+            ImageView imageView = linearLayout.findViewById(R.id.ima_or_code);
+            imageView.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    LinearLayout linearLayout = (LinearLayout)v.getParent();
+                    for( int i = 0; i < linearLayout.getChildCount(); i++ ){
+                        if( linearLayout.getChildAt(i) instanceof EditText ){
+                            ((EditText)linearLayout.getChildAt(i)).requestFocus();
+                            break;
+                        }
+                    }
+                    ActivityScanerCode.setScanerListener(mScanerListener);
+                    ActivityScanerCode.intent2Activity(mContext, BaseConfig.COMMON_SCANNER_ONLY);
+                }
+            });
+
+
+            //监听按确定
+            editText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+                @Override
+                public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+                    //XLog.e("actionId:"+actionId);
+                    if (actionId == EditorInfo.IME_ACTION_SEND || actionId == EditorInfo.IME_ACTION_DONE   ) {
+                        if (v.getText().toString().trim().isEmpty()) {
+                            setEditTextFocused(v,true);
+                            showWarningToast(v.getHint().toString());
+                            return false;
+                        }else{
+                            setEditTextNormal(v,true);
+                        }
+
+                        callbackEditor(v);
+
+                        return false;
+                    }
+                    return false;
+                }
+            });
+            editText.addTextChangedListener(new TextWatcher() {
+                public void onTextChanged(CharSequence s, int start, int before, int count) {
+                    EditText currentEditText = null;
+                    ImageButton currentImage = null;
+                    //获取焦点的view对象
+                    View view=getWindow().getDecorView().findFocus();
+                    //如果是EditText
+                    if(view instanceof EditText){
+                        currentEditText = (EditText) view;
+                        currentImage = getChildImageButton((LinearLayout)currentEditText.getParent());
+                    }
+
+                    if (s.length() > 0  ) {
+
+                        if (currentImage !=null ){
+                            currentImage.setVisibility(View.VISIBLE);
+                        }
+                        if (currentEditText!=null){
+                            setEditTextNormal(currentEditText,true);
+                        }
+
+                    } else {
+                        if (currentImage !=null ){
+                            currentImage.setVisibility(View.INVISIBLE);
+                        }
+                        if (currentEditText!=null){
+                            setEditTextFocused(currentEditText,true);
+                        }
+                    }
+                }
+
+                public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+                }
+
+                public void afterTextChanged(Editable s) {
+
+                }
+            });
+
+            if (imageButton !=null ){
+                unifyClearEdit(imageButton);
+            }
+        }
+    }
+
+
+    @Override
+    protected void onDestroy() {
+        unbinder.unbind();
+
+        super.onDestroy();
+    }
+    @Override
+    protected void onResume() {
+        super.onResume();
+        initReceiver();
+    }
+    @Override
+    protected void onPause() {
+        super.onPause();
+        //销毁在onResume()方法中的广播
+        try {
+            //停止扫描
+            Integer is_broadcast = scanBean.getIsBroadcast();//是否广播
+            if (is_broadcast==0){
+                StoTongJNI.getIns(mContext).SetScannerStop();
+                StoTongJNI.getIns(mContext).SetScannerOff();
+            }else{
+                unregisterReceiver(mReceiver);
+            }
+        }catch (Exception e){
+            XLog.e("销毁广播失败:",e.getMessage());
+        }
+    }
+
+
+}

BIN
app/src/main/res/drawable-xxhdpi/ic_quality.png


BIN
app/src/main/res/drawable-xxhdpi/ic_quality2.png


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

@@ -0,0 +1,356 @@
+<?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"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:background="@color/md_grey_100"
+    android:orientation="vertical">
+
+    <ScrollView
+        android:id="@+id/ll_scroll_view"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:scrollbars="none">
+
+        <LinearLayout
+            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_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"
+                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_order_no"
+                    android:hint="@string/hint_please_scan_no"
+                    android:enabled="false"
+                    android:text=""/>
+                <ImageButton
+                    style="@style/ClearImg"
+                    android:id="@+id/ib_order_no_clear"
+                    />
+
+                <include   layout="@layout/item_image_code" />
+            </LinearLayout>
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:background="@null"
+                android:gravity="center_vertical"
+                android:orientation="vertical">
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:background="@null"
+                    android:gravity="center_vertical"
+                    android:orientation="horizontal"
+                    android:padding="5dp">
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="质检结果:"
+                        android:textColor="@color/black"
+                        android:textSize="@dimen/t24" />
+                    <RadioGroup
+                        android:id="@+id/radioGroup1"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+
+                        android:orientation="horizontal" >
+                        <RadioButton
+                            android:id="@+id/rb_intact"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:checked="true"
+                            android:onClick="onRadioButtonClicked"
+                            android:textSize="@dimen/t24"
+                            android:text="完好" />
+
+                        <RadioButton
+                            android:id="@+id/rb_breakage"
+                            android:layout_width="match_parent"
+                            android:layout_height="wrap_content"
+                            android:onClick="onRadioButtonClicked"
+                            android:textSize="@dimen/t24"
+                            android:text="破损" />
+
+                    </RadioGroup>
+                </LinearLayout>
+
+            </LinearLayout>
+
+
+            <!--全景照片-->
+            <LinearLayout
+                android:id="@+id/ll_panorama_area"
+                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:paddingBottom="5dp"
+                    android:paddingTop="5dp"
+                    android:orientation="horizontal">
+                    <TextView
+                        android:layout_marginLeft="@dimen/dp_10"
+                        style="@style/tvLeftStyle"
+                        android:text="全景照片:" />
+
+
+                </LinearLayout>
+                <LinearLayout
+                    android:id="@+id/ll_pictures_panorama"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="vertical">
+                    <include layout="@layout/fragment_show_img"/>
+                    <View
+                        android:layout_width="match_parent"
+                        android:layout_height="1dp"
+                        android:background="@color/md_grey_100" />
+                </LinearLayout>
+            </LinearLayout>
+
+            <!--面单照片-->
+            <LinearLayout
+                android:id="@+id/ll_label_area"
+                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:paddingBottom="5dp"
+                    android:paddingTop="5dp"
+                    android:orientation="horizontal">
+                    <TextView
+                        android:layout_marginLeft="@dimen/dp_10"
+                        style="@style/tvLeftStyle"
+                        android:text="面单照片:" />
+                </LinearLayout>
+                <LinearLayout
+                    android:id="@+id/ll_pictures_label"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="vertical">
+                    <include layout="@layout/fragment_show_img"/>
+                    <View
+                        android:layout_width="match_parent"
+                        android:layout_height="1dp"
+                        android:background="@color/md_grey_100" />
+                </LinearLayout>
+            </LinearLayout>
+
+
+            <!--破损照片-->
+            <LinearLayout
+                android:id="@+id/ll_damaged_area"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:visibility="gone"
+                android:orientation="vertical">
+                <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:id="@+id/ll_pictures_damaged"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="vertical">
+                    <include layout="@layout/fragment_show_img"/>
+                    <View
+                        android:layout_width="match_parent"
+                        android:layout_height="1dp"
+                        android:background="@color/md_grey_100" />
+                </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: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"
+                android:layout_height="wrap_content"
+                android:background="@drawable/bg_white_et"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:gravity="center_vertical"
+                android:orientation="horizontal"
+                android:scrollbars="vertical"
+                android:paddingTop="@dimen/dp_10"
+                android:paddingBottom="@dimen/dp_10"
+                >
+                <android.support.v7.widget.RecyclerView
+                    android:id="@+id/recyclerview"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:background="#fff"
+                    android:overScrollMode="never"/>
+            </LinearLayout>
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginTop="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:layout_marginBottom="@dimen/dp_4"
+                android:background="@drawable/bg_white_et"
+                android:gravity="center_vertical"
+                android:orientation="horizontal"
+                android:padding="10dp">
+                <TextView
+                    style="@style/fontSize"
+                    android:id="@+id/btn_confirm"
+                    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_orange_item"
+                    android:gravity="center"
+                    android:text="提交"
+                    android:padding="10dp"
+                    android:textColor="@color/white"
+                    android:visibility="visible" />
+            </LinearLayout>
+        </LinearLayout>
+    </ScrollView>
+
+
+    <include layout="@layout/item_float_image" />
+</LinearLayout>

+ 209 - 0
app/src/main/res/layout/activity_fxy_quality_volume.xml

@@ -0,0 +1,209 @@
+<?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"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:background="@color/md_grey_100"
+    android:orientation="vertical">
+
+    <ScrollView
+        android:id="@+id/ll_scroll_view"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:scrollbars="none">
+
+        <LinearLayout
+            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_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"
+                android:layout_height="1dp"
+                android:background="@color/md_grey_100" />
+            <LinearLayout
+                style="@style/FromLinearLayoutItem">
+                <EditText
+                    android:id="@+id/et_weight"
+                    style="@style/EditTextStyle"
+                    android:hint="@string/hint_please_edit_weight" />
+                <TextView
+                    android:id="@+id/tv_weight_unit"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:textStyle="bold"
+                    android:textSize="@dimen/t24"
+                    android:text="LB">
+                </TextView>
+            </LinearLayout>
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="1dp"
+                android:background="@color/md_grey_100" />
+            <LinearLayout
+                android:id="@+id/ly_measure_content"
+                android:layout_width="match_parent"
+                android:layout_height="45dp"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:gravity="center_vertical"
+                android:orientation="horizontal"
+                >
+
+                <EditText
+                    android:id="@+id/et_length"
+                    android:layout_width="80dp"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:layout_marginRight="@dimen/dp_10"
+                    android:background="@drawable/bg_white_et"
+                    android:gravity="center"
+                    android:hint="@string/hint_length"
+                    android:inputType="numberDecimal|number"
+                    android:imeOptions="actionDone"
+                    android:padding="5dp"
+                    android:singleLine="true"
+                    android:textSize="@dimen/t24" />
+                <EditText
+                    android:id="@+id/et_width"
+                    android:layout_width="80dp"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:background="@drawable/bg_white_et"
+                    android:layout_marginLeft="@dimen/dp_10"
+                    android:layout_marginRight="@dimen/dp_10"
+                    android:gravity="center"
+                    android:hint="@string/hint_width"
+                    android:inputType="numberDecimal|number"
+                    android:imeOptions="actionDone"
+                    android:padding="5dp"
+                    android:singleLine="true"
+                    android:textSize="@dimen/t24" />
+                <EditText
+                    android:id="@+id/et_height"
+                    android:layout_width="80dp"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:background="@drawable/bg_white_et"
+                    android:layout_marginLeft="@dimen/dp_10"
+                    android:gravity="center"
+                    android:hint="@string/hint_height"
+                    android:inputType="numberDecimal|number"
+                    android:imeOptions="actionDone"
+                    android:padding="5dp"
+                    android:singleLine="true"
+                    android:textSize="@dimen/t24" />
+                <TextView
+                    android:id="@+id/tv_size_unit"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="@dimen/dp_10"
+                    android:text="CM"
+                    android:textColor="@color/black_3d3d3d"
+                    android:textSize="@dimen/t24" />
+
+            </LinearLayout>
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="1dp"
+                android:background="@color/md_grey_100" />
+
+
+
+
+
+            <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: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="1dp"
+                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_marginTop="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:layout_marginBottom="@dimen/dp_4"
+                android:background="@drawable/bg_white_et"
+                android:gravity="center_vertical"
+                android:orientation="horizontal"
+                android:padding="10dp">
+                <TextView
+                    style="@style/fontSize"
+                    android:id="@+id/btn_confirm"
+                    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_orange_item"
+                    android:gravity="center"
+                    android:text="提交"
+                    android:padding="10dp"
+                    android:textColor="@color/white"
+                    android:visibility="visible" />
+            </LinearLayout>
+
+        </LinearLayout>
+    </ScrollView>
+    <include layout="@layout/item_float_image" />
+</LinearLayout>

+ 0 - 22
app/src/main/res/layout/activity_fxy_tally.xml

@@ -18,28 +18,6 @@
             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_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"

+ 42 - 0
app/src/main/res/layout/fragment_homepager.xml

@@ -159,6 +159,48 @@
                 </TableRow>
             </LinearLayout>
 
+            <!--质检-->
+            <LinearLayout
+                android:id="@+id/ll_quality_menu"
+                style="@style/LinearLayoutCornerStyle"
+                android:layout_marginTop="10dp"
+                android:orientation="vertical"
+                android:padding="@dimen/dp_10"
+                android:visibility="visible">
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center"
+                    android:text="质检"
+                    android:textColor="@color/black_3d3d3d"
+                    android:textSize="@dimen/t14"
+                    android:textStyle="bold" />
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center"
+                    android:text="@string/index_put_out"
+                    android:textColor="@color/black_3d3d3d"
+                    android:textSize="@dimen/t14"
+                    android:visibility="gone"
+                    android:textStyle="bold" />
+
+                <TableRow
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="@dimen/t12"
+                    android:weightSum="2">
+
+                    <TextView
+                        style="@style/ImageViewWithTextStyle.FontSize"
+                        android:id="@+id/ivt_quality"
+                        android:drawableTop="@drawable/ic_quality"
+                        android:drawablePadding="5dp"
+                        android:text="标准质检" />
+
+
+                </TableRow>
+            </LinearLayout>
         </LinearLayout>
     </ScrollView>
 </RelativeLayout>

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

@@ -933,5 +933,40 @@ public abstract class BaseActivity extends SupportActivity implements Observer {
         });
     }
 
+    //金额验证
+    public static boolean isNumber(String str,Integer num){
+        Pattern pattern=Pattern.compile("^(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,"+num+"})?$"); // 判断小数点后2位的数字的正则表达式
+        Matcher match=pattern.matcher(str);
+        if (match.matches()){
+            return Double.parseDouble(str) > 0;
+        }else{
+            return false ;
+        }
+
+    }
+
+    public static boolean isNumber(String str,Integer num,int min){
+        Pattern pattern=Pattern.compile("^(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,"+num+"})?$"); // 判断小数点后2位的数字的正则表达式
+        Matcher match=pattern.matcher(str);
+        if (match.matches()){
+            return Double.parseDouble(str) > min;
+        }else{
+            return false ;
+        }
+
+    }
+
+    public static boolean isNum(String str,Integer num){
+        Pattern pattern=Pattern.compile("^(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,"+num+"})?$"); // 判断小数点后2位的数字的正则表达式
+        Matcher match=pattern.matcher(str);
+        return  match.matches();
+    }
 
+
+    protected double getValNum(EditText v){
+        return Double.parseDouble(v.getText().toString().trim());
+    }
+    protected String getValStr(EditText v){
+        return v.getText().toString().trim();
+    }
 }