瀏覽代碼

增加查验

guilin 8 月之前
父節點
當前提交
c3d23a71ea

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

@@ -200,7 +200,30 @@
             android:screenOrientation="portrait"
             android:screenOrientation="portrait"
             tools:ignore="LockedOrientationActivity"/>
             tools:ignore="LockedOrientationActivity"/>
 
 
+        <activity
+            android:name=".detection.DetectionPutInMainActivity"
+            android:windowSoftInputMode="stateHidden|adjustPan"
+            android:screenOrientation="portrait"
+            tools:ignore="LockedOrientationActivity"/>
+
+        <activity
+            android:name=".detection.DetectionPutawayMainActivity"
+            android:windowSoftInputMode="stateHidden|adjustPan"
+            android:screenOrientation="portrait"
+            tools:ignore="LockedOrientationActivity"/>
 
 
+        <activity
+            android:name=".detection.DetectionDestroyOutboundMainActivity"
+            android:windowSoftInputMode="stateHidden|adjustPan"
+            android:screenOrientation="portrait"
+            tools:ignore="LockedOrientationActivity"/>
+
+        <activity
+            android:name=".detection.DetectionWorkMainActivity"
+            android:windowSoftInputMode="stateHidden|adjustPan"
+            android:screenOrientation="sensor"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            tools:ignore="LockedOrientationActivity"/>
 
 
 
 
         <activity
         <activity

+ 1 - 1
app/src/main/java/com/fxy/adapter/GridImageAdapter.java

@@ -256,7 +256,7 @@ public class GridImageAdapter extends RecyclerView.Adapter<GridImageAdapter.View
     public void setPhotoPath(String photoPath) {
     public void setPhotoPath(String photoPath) {
         ossPhotoList.add(photoPath);
         ossPhotoList.add(photoPath);
     }
     }
-    public ArrayList getPhotoList(){
+    public ArrayList<String> getPhotoList(){
         return ossPhotoList;
         return ossPhotoList;
     }
     }
 
 

+ 193 - 0
app/src/main/java/com/fxy/adapter/ShowPictureAdapter.java

@@ -0,0 +1,193 @@
+package com.fxy.adapter;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.graphics.drawable.Drawable;
+import android.os.Environment;
+import android.support.v4.app.ActivityCompat;
+import android.support.v4.content.ContextCompat;
+import android.support.v7.widget.RecyclerView;
+import android.util.Log;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.ProgressBar;
+import android.widget.RadioButton;
+import android.widget.RadioGroup;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.engine.DiskCacheStrategy;
+import com.bumptech.glide.request.RequestOptions;
+import com.elvishew.xlog.XLog;
+import com.fxy.R;
+import com.fxy.common.AudioRecoderDialog;
+import com.fxy.utils.AudioRecoderUtils;
+import com.luck.picture.lib.config.PictureConfig;
+import com.luck.picture.lib.config.PictureMimeType;
+import com.luck.picture.lib.entity.LocalMedia;
+import com.luck.picture.lib.tools.DateUtils;
+import com.luck.picture.lib.tools.StringUtils;
+
+import java.io.File;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+import es.dmoral.toasty.Toasty;
+
+
+public class ShowPictureAdapter extends RecyclerView.Adapter<ShowPictureAdapter.ViewHolder> {
+
+    private LayoutInflater mInflater;
+    //已上传
+    private List<String> pictureList =new ArrayList<>();
+    private int selectMax = 9;
+    private  Context context;
+    private  Activity mActivity;
+
+
+    /**
+     * 点击添加图片跳转
+     */
+    private final onAddPicClickListener mOnAddPicClickListener;
+
+    public interface onAddPicClickListener {
+        void onAddPicClick();
+    }
+
+
+    public ShowPictureAdapter(Context context, Activity activity, onAddPicClickListener mOnAddPicClickListener, List<String> list) {
+        this.context = context;
+        this.mActivity = activity;
+        mInflater = LayoutInflater.from(context);
+        this.mOnAddPicClickListener = mOnAddPicClickListener;
+        pictureList= list;
+    }
+
+    public void setList( List<String> list) {
+        this.pictureList = list;
+    }
+
+    /**
+     *
+     * 支持当前上传
+     */
+    public void setLocalMediaList(List<LocalMedia> list) {
+        pictureList.clear();
+        for (int i = 0; i < list.size(); i++) {
+            String path;
+            LocalMedia media= list.get(i);
+            if (media.isCut() && !media.isCompressed()) {
+                // 裁剪过
+                path = media.getCutPath();
+            } else if (media.isCompressed() || (media.isCut() && media.isCompressed())) {
+                // 压缩过,或者裁剪同时压缩过,以最终压缩过图片为准
+                path = media.getCompressPath();
+            } else {
+                // 原图
+                path = media.getPath();
+            }
+            pictureList.add(path);
+        }
+    }
+
+    public static class ViewHolder extends RecyclerView.ViewHolder {
+
+        ImageView mImg;
+        CheckBox cbSelect;
+        View selectedOverlay;
+
+        ViewHolder(View view) {
+            super(view);
+            mImg = view.findViewById(R.id.ivp_img);
+            cbSelect = view.findViewById(R.id.cb_select);
+            selectedOverlay = view.findViewById(R.id.selected_overlay);
+        }
+    }
+
+    @Override
+    public int getItemCount() {
+        if (pictureList.size() < selectMax) {
+            return pictureList.size() + 1;
+        } else {
+            return pictureList.size();
+        }
+    }
+
+
+    /**
+     * 创建ViewHolder
+     */
+    @Override
+    public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
+        View view = mInflater.inflate(R.layout.item_filter_image, viewGroup, false);
+        return new ViewHolder(view);
+    }
+    /**
+     * 设置值
+     */
+    @Override
+    public void onBindViewHolder(final ViewHolder viewHolder, final int position) {
+        //少于8张,显示继续添加的图标
+        viewHolder.cbSelect.setVisibility(View.VISIBLE);
+        viewHolder.cbSelect.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+            @Override
+            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+                // 当checkbox1的选中状态改变时执行
+                if (isChecked) {
+                    // checkbox1被选中了
+                    viewHolder.selectedOverlay.setVisibility(View.VISIBLE);
+                } else {
+                    // checkbox1被取消了
+                    viewHolder.selectedOverlay.setVisibility(View.GONE);
+                }
+            }
+        });
+
+
+
+        String path = pictureList.get(position);
+        RequestOptions options = new RequestOptions()
+                .centerCrop()
+                .placeholder(R.color.color_f6)
+                .diskCacheStrategy(DiskCacheStrategy.ALL);
+        Glide.with(viewHolder.itemView.getContext())
+                .load(path)
+                .apply(options)
+                .into(viewHolder.mImg);
+
+        //itemView 的点击事件
+        if (mItemClickListener != null) {
+            viewHolder.itemView.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    int adapterPosition = viewHolder.getAdapterPosition();
+                    mItemClickListener.onItemClick(adapterPosition, v);
+                }
+            });
+        }
+
+    }
+
+    private OnItemClickListener mItemClickListener;
+
+    public interface OnItemClickListener {
+        void onItemClick(int position, View v);
+    }
+
+    public void setOnItemClickListener(OnItemClickListener listener) {
+        this.mItemClickListener = listener;
+    }
+}

+ 5 - 2
app/src/main/java/com/fxy/common/PictureSelectorUpload.java

@@ -166,7 +166,7 @@ public class PictureSelectorUpload {
        return actionType;
        return actionType;
     }
     }
 
 
-    public ArrayList getPhotoList(){
+    public ArrayList<String> getPhotoList(){
         return  adapter.getPhotoList();
         return  adapter.getPhotoList();
     }
     }
 
 
@@ -361,7 +361,10 @@ public class PictureSelectorUpload {
                     showTitle= showTitle+",失败"+failUploadList.size()+"个";
                     showTitle= showTitle+",失败"+failUploadList.size()+"个";
                 }
                 }
 
 
-                progressDialog.setTitle(showTitle);
+                if (progressDialog!=null){
+                    progressDialog.setTitle(showTitle);
+                }
+
                 if (awaitUploadList.size()>0){
                 if (awaitUploadList.size()>0){
                     filedUpload();
                     filedUpload();
                 }else{
                 }else{

+ 600 - 0
app/src/main/java/com/fxy/detection/DetectionDestroyOutboundMainActivity.java

@@ -0,0 +1,600 @@
+package com.fxy.detection;
+
+import android.annotation.SuppressLint;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.inputmethod.EditorInfo;
+import android.widget.EditText;
+import android.widget.ImageButton;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+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.bean.ActionBean;
+import com.fxy.bean.ScanBean;
+import com.fxy.constant.BaseConfig;
+import com.fxy.constant.EventCode;
+import com.fxy.net.MyDialogCallback;
+import com.fxy.net.Urls;
+import com.fxy.view.FloatingImageView;
+import com.google.zxing.Result;
+import com.lzy.okgo.OkGo;
+import com.lzy.okgo.model.Response;
+
+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 DetectionDestroyOutboundMainActivity extends BaseActivity implements StoJNI.ScanCallBack {
+    /**
+     * 列表适配器
+     */
+    Context mContext = this;
+
+    //单号
+    @BindView(R.id.et_internals_code)
+    EditText etInternalsCode;
+
+    //单号
+    @BindView(R.id.et_destroy_batch_number)
+    EditText etDestroyBatchNumber;
+
+    //扫码扫码动作
+    private ScanBean scanBean;
+
+    //浮动按钮
+    @BindView(R.id.iv_drag)
+    FloatingImageView iv_drag;
+    
+
+    private Unbinder unbinder;
+    
+
+    @Override
+    public int getContentViewResId() {
+        return R.layout.activity_fxy_detection_destroy_outbound;
+    }
+
+    @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);
+
+    }
+
+
+    /**
+     * 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("单箱上架");
+
+        initAdapter();
+        initData();
+        initEdit();
+        //监听浮动按钮
+        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 initAdapter() {
+
+
+    }
+
+
+    @Override
+    public boolean dispatchKeyEvent(KeyEvent event) {
+        //XLog.e("event:"+event.getKeyCode());
+//        if ((event.getKeyCode()==KeyEvent.KEYCODE_DPAD_CENTER )  && event.getAction() == KeyEvent.ACTION_DOWN){
+//            //按确定键
+//            if(validate()){
+//                doPutIn();
+//            }
+//            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_destroy_batch_number:
+                checkBatchNumber();
+                break;
+            case R.id.et_internals_code:
+                deliveryCompleted();
+                break;
+            default:
+        }
+    }
+
+    private void initEdit() {
+        List<EditText> list = new ArrayList<>();
+        list.add(etDestroyBatchNumber);
+        list.add(etInternalsCode);
+        unifyEdit(list);
+        etDestroyBatchNumber.requestFocus();
+    }
+
+    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 deliveryCompleted() {
+
+        if (!validate()) {
+            return;
+        }
+
+
+        String postJson = formatParam(2);
+        if (!checkRepeat(Urls.FXY_DETECTION_PUTAWAY + (postJson))) {
+            return;
+        }
+
+        OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_DETECTION_PUTAWAY).upJson(postJson)
+                .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);
+                            if (bean.code == 1) {
+                                showSuccessToast(bean.msg);
+                                clearData();
+                            } else {
+                                etInternalsCode.selectAll();
+                                showWarningToast(bean.msg);
+                            }
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                            XLog.e("请求返回打托信息错误", e.getMessage());
+                        }
+                    }
+                });
+    }
+
+    /**
+     * 检查库位
+     */
+    private void checkBatchNumber() {
+        if (!checkNull(etDestroyBatchNumber)) {
+            setEditTextFocused(etDestroyBatchNumber, true);
+            showWarningToast(etDestroyBatchNumber.getHint().toString());
+            return ;
+        }
+
+        String postJson = formatParam(1);
+        if (!checkRepeat(Urls.FXY_DETECTION_CHECK_LOCATION + (postJson))) {
+            return;
+        }
+
+        OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_DETECTION_CHECK_LOCATION).upJson(postJson)
+                .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);
+                            if (bean.code == 1) {
+                                showSuccessToast(bean.msg);
+                                etInternalsCode.requestFocus();
+                            } else {
+                                showWarningToast(bean.msg);
+                            }
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                            XLog.e("请求返回箱号检查错误", e.getMessage());
+                        }
+                    }
+                });
+    }
+
+    /**
+     * 完成
+     */
+    private void finished() {
+        clearData();
+    }
+
+    /**
+     * @param type int 1、库位,2、箱号
+     * @return
+     */
+    private String formatParam(int type) {
+        JSONObject jsonObject = new JSONObject();
+        try {
+            jsonObject.put("location_number", etDestroyBatchNumber.getText().toString().trim());
+            if (type > 1) {
+                jsonObject.put("box_code", etInternalsCode.getText().toString().trim());
+            }
+
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            XLog.e("组装数据失败");
+        }
+        return jsonObject.toString();
+    }
+
+    /*
+     * 校验必录
+     */
+    private boolean validate() {
+
+        if (!checkNull(etDestroyBatchNumber)) {
+            setEditTextFocused(etDestroyBatchNumber, true);
+            showWarningToast(etDestroyBatchNumber.getHint().toString());
+            return false;
+        }
+
+        if (!checkNull(etInternalsCode)) {
+            setEditTextFocused(etInternalsCode, true);
+            showWarningToast(etInternalsCode.getHint().toString());
+            return false;
+        }
+
+        return true;
+    }
+
+
+
+
+    //清除订单信息
+    private void clearData() {
+        etInternalsCode.setText("");
+        etDestroyBatchNumber.setText("");
+
+        setEditTextNormal(etDestroyBatchNumber, true);
+        setEditTextNormal(etInternalsCode, true);
+        etDestroyBatchNumber.requestFocus();
+    }
+
+    @OnClick({R.id.btn_confirm})
+    public void onViewClicked(View view) {
+        Bundle bundle = new Bundle();
+        switch (view.getId()) {
+            case R.id.btn_confirm:
+                finished();
+                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);
+
+
+            //监听按确定
+            editText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+                @Override
+                public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+                    XLog.e("actionId:" + actionId);
+                    if (event != null) {
+                        XLog.e("KeyCode:" + event.getKeyCode() + "--ActionCode:" + event.getAction());
+                    }
+
+                    //|| (actionId == KeyEvent.ACTION_DOWN && event.getKeyCode()==KeyEvent.KEYCODE_ENTER )
+                    if (actionId == EditorInfo.IME_ACTION_SEND || actionId == EditorInfo.IME_ACTION_DONE ||
+                            (actionId == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
+                        if (v.getText().toString().trim().isEmpty()) {
+                            setEditTextFocused(v, true);
+                            showWarningToast(v.getHint().toString());
+                            return true;
+                        } else {
+                            setEditTextNormal(v, true);
+                        }
+                        callbackEditor(v);
+                        return false;
+                    }
+                    return false;
+
+                    //返回true,保留软键盘。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());
+        }
+    }
+
+
+}

+ 474 - 0
app/src/main/java/com/fxy/detection/DetectionPutInMainActivity.java

@@ -0,0 +1,474 @@
+package com.fxy.detection;
+
+import android.annotation.SuppressLint;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.support.v7.widget.RecyclerView;
+import android.view.KeyEvent;
+import android.view.View;
+import android.widget.EditText;
+import android.widget.LinearLayout;
+import android.widget.Toast;
+
+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.bean.ActionBean;
+import com.fxy.bean.ScanBean;
+import com.fxy.common.PictureSelectorUpload;
+import com.fxy.constant.BaseConfig;
+import com.fxy.constant.EventCode;
+import com.fxy.net.MyDialogCallback;
+import com.fxy.net.Urls;
+import com.fxy.view.FloatingImageView;
+import com.google.gson.Gson;
+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.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+
+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 DetectionPutInMainActivity extends  BaseActivity implements StoJNI.ScanCallBack{
+
+    /**
+     * 列表适配器
+     */
+    Context mContext = this;
+
+    @BindView(R.id.ll_label_picture)
+    LinearLayout llLabelPicture;
+
+
+    @BindView(R.id.ll_weigh_picture)
+    LinearLayout llWeighPicture;
+
+
+
+    private PictureSelectorUpload labelPictureSelectorUpload;
+    private PictureSelectorUpload weighPictureSelectorUpload;
+    private String currentPictureType= "";
+    //
+    //扫码扫码动作
+    private ScanBean scanBean;
+
+
+
+
+
+    protected String action;
+
+
+    private Unbinder unbinder;
+
+    private JSONObject postParam = new JSONObject();
+
+
+    @Override
+    public int getContentViewResId() {
+        return R.layout.activity_fxy_detection_putin;
+    }
+
+    @Override
+    public boolean showToolBar() {
+        return true;
+    }
+
+    @Override
+    public boolean openEventBus() {
+        return true;
+    }
+
+    @Override
+    protected void getBundleExtras(Bundle bundle) {
+        //XLog.e("接收数据解析:",bundle);
+    }
+
+
+
+    //finish的返回监听
+    //这里的requestCode参数,就是上面设置的 1 ,当跳转的页面返回的时候,通过这个加以判断
+    //resultCode ,这个参数是在跳转的页面里面规定的,它也是一个int类型的标志
+    //第三个参数包含了返回的值
+    //如果不需要所跳转的页面返回值,也就不需要这个方法了
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+
+        if (resultCode == RESULT_OK) {
+            // 图片选择结果回调
+            if (requestCode == PictureConfig.CHOOSE_REQUEST) {
+                if (currentPictureType.equals("weigh_picture")){
+                    weighPictureSelectorUpload.getSelectImg(data);
+                }else {
+                    labelPictureSelectorUpload.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("单箱入库");
+
+        initEdit();
+        iniData();
+        RecyclerView rvLabelShowImg = (RecyclerView)llLabelPicture.findViewById(R.id.rv_show_img);
+        RecyclerView rvWeighShowImg = (RecyclerView)llWeighPicture.findViewById(R.id.rv_show_img);
+        labelPictureSelectorUpload  = setItemPicture("label_picture",rvLabelShowImg,9,PictureConfig.TYPE_IMAGE);
+        weighPictureSelectorUpload  = setItemPicture("weigh_picture",rvWeighShowImg,9,PictureConfig.TYPE_IMAGE);
+    }
+
+
+
+    /**
+     * 设置多个上传文件
+     * @param actionType String
+     * @param showImg RecyclerView
+     */
+    private PictureSelectorUpload setItemPicture(String actionType,RecyclerView showImg,int maxNum,int pictureType){
+        PictureSelectorUpload pictureUpload = new PictureSelectorUpload(DetectionPutInMainActivity.this,showImg,"detection",maxNum,pictureType);
+        pictureUpload.setActionType(actionType);
+        pictureUpload.setCompress(true,100,500);
+        pictureUpload.setOnlyCamera(true);
+        pictureUpload.setProgressType(2);
+        //showImg.onTouchEvent()
+
+        pictureUpload.setOnChangeListener(new PictureSelectorUpload.UploadChangeListener() {
+            @Override
+            public void uploadResult(boolean State,String actionType) {
+                if (State) {
+
+                }
+            }
+
+            @Override
+            public void uploadActionType(String actionType) {
+                System.out.println("actionType:"+actionType);
+                currentPictureType = actionType;
+
+            }
+        });
+        return  pictureUpload;
+    }
+
+
+    @Override
+    public boolean dispatchKeyEvent(KeyEvent event) {
+        //XLog.e("event:"+event.getKeyCode());
+        if ((event.getKeyCode()==KeyEvent.KEYCODE_DPAD_CENTER || event.getKeyCode()==KeyEvent.KEYCODE_ENTER )  && event.getAction() == KeyEvent.ACTION_DOWN){
+            //按确定键
+            if(this.validate()){
+
+            }
+        }
+        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());
+        }
+    }
+
+    private void initEdit() {
+
+    }
+
+
+    private void iniData(){
+
+    }
+
+
+
+    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);
+
+            switch (view.getId()) {
+
+                default:
+            }
+
+
+        }
+    }
+
+
+    private void pictureInbound(){
+        if (!validate()){
+            return;
+        }
+
+
+        if (!checkRepeat(Urls.FXY_DETECTION_PUTIN+(postParam.toString()))){
+            Toast.makeText(this, getString(R.string.error_data_processed), Toast.LENGTH_LONG).show();
+            return;
+        }
+
+
+
+        OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_DETECTION_PUTIN).upJson(postParam)
+                .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);
+                            if(bean.code == 1){
+                                showSuccessToast(bean.msg);
+                                labelPictureSelectorUpload.emptyRemake();//清空图片
+                                weighPictureSelectorUpload.emptyRemake();
+                            }else{
+                                showWarningToast(bean.msg);
+                            }
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                            XLog.e("添加开箱拆柜数据结果返回错误",e.getMessage());
+                        }
+                    }
+                });
+    }
+
+
+    /*
+     * 校验必录
+     */
+    private boolean validate(){
+
+        try {
+            postParam = new JSONObject();
+
+            ArrayList<String> labelPhotoList = labelPictureSelectorUpload.getPhotoList();
+            ArrayList<String> weighPhotoList = weighPictureSelectorUpload.getPhotoList();
+
+            //检查是否拍照  工单处理时拍照拍照非必传
+            if (labelPhotoList.size()==0){
+                showWarningToast("面单照片不能为空");
+                return false;
+            }
+            if (weighPhotoList.size()==0){
+                showWarningToast("称重照片不能为空");
+                return false;
+            }
+            Gson gson = new Gson();
+            postParam.put("label_photo",gson.toJson(labelPhotoList));
+            postParam.put("weigh_photo",gson.toJson(weighPhotoList));
+
+        } catch (JSONException e) {
+            showWarningToast("系统异常"+e.getMessage());
+            e.printStackTrace();
+            return false;
+        }
+        return true;
+    }
+
+    //sIsGoodinfoMatch,sIsBattery,sIsMagnetic,sIsWood,sIsExtra,sIsOther
+    @OnClick({R.id.btn_confirm})
+    public void onViewClicked(View view) {
+        Bundle bundle = new Bundle();
+        switch (view.getId()) {
+            case R.id.btn_confirm:
+                pictureInbound();
+                break;
+            default:
+                break;
+        }
+    }
+
+    @Override
+    protected void onDestroy() {
+        unbinder.unbind();
+        labelPictureSelectorUpload.removeHandler();
+        weighPictureSelectorUpload.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());
+        }
+    }
+
+}

+ 601 - 0
app/src/main/java/com/fxy/detection/DetectionPutawayMainActivity.java

@@ -0,0 +1,601 @@
+package com.fxy.detection;
+
+import android.annotation.SuppressLint;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.inputmethod.EditorInfo;
+import android.widget.EditText;
+import android.widget.ImageButton;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+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.bean.ActionBean;
+import com.fxy.bean.ScanBean;
+import com.fxy.constant.BaseConfig;
+import com.fxy.constant.EventCode;
+import com.fxy.net.MyDialogCallback;
+import com.fxy.net.Urls;
+import com.fxy.view.FloatingImageView;
+import com.google.zxing.Result;
+import com.lzy.okgo.OkGo;
+import com.lzy.okgo.model.Response;
+
+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 DetectionPutawayMainActivity extends BaseActivity implements StoJNI.ScanCallBack {
+    /**
+     * 列表适配器
+     */
+    Context mContext = this;
+
+    //单号
+    @BindView(R.id.et_box_code)
+    EditText etBoxCode;
+
+    //单号
+    @BindView(R.id.et_location_code)
+    EditText etLocationCode;
+
+    //扫码扫码动作
+    private ScanBean scanBean;
+
+    //浮动按钮
+    @BindView(R.id.iv_drag)
+    FloatingImageView iv_drag;
+    
+
+    private Unbinder unbinder;
+    
+
+    @Override
+    public int getContentViewResId() {
+        return R.layout.activity_fxy_detection_putaway;
+    }
+
+    @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);
+
+    }
+
+
+    /**
+     * 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("单箱上架");
+
+        initAdapter();
+        initData();
+        initEdit();
+        //监听浮动按钮
+        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 initAdapter() {
+
+
+    }
+
+
+    @Override
+    public boolean dispatchKeyEvent(KeyEvent event) {
+        //XLog.e("event:"+event.getKeyCode());
+//        if ((event.getKeyCode()==KeyEvent.KEYCODE_DPAD_CENTER )  && event.getAction() == KeyEvent.ACTION_DOWN){
+//            //按确定键
+//            if(validate()){
+//                doPutIn();
+//            }
+//            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_location_code:
+                checkLocation();
+                break;
+            case R.id.et_box_code:
+                bindLocation();
+                break;
+            default:
+        }
+    }
+
+    private void initEdit() {
+        List<EditText> list = new ArrayList<>();
+        list.add(etLocationCode);
+        list.add(etBoxCode);
+        unifyEdit(list);
+        etLocationCode.requestFocus();
+    }
+
+    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 bindLocation() {
+
+        if (!validate()) {
+            return;
+        }
+
+
+        String postJson = formatParam(2);
+        if (!checkRepeat(Urls.FXY_DETECTION_PUTAWAY + (postJson))) {
+            return;
+        }
+
+        OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_DETECTION_PUTAWAY).upJson(postJson)
+                .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);
+                            if (bean.code == 1) {
+                                showSuccessToast(bean.msg);
+                                clearData();
+                            } else {
+                                etBoxCode.selectAll();
+                                showWarningToast(bean.msg);
+                            }
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                            XLog.e("请求返回打托信息错误", e.getMessage());
+                        }
+                    }
+                });
+    }
+
+    /**
+     * 检查库位
+     */
+    private void checkLocation() {
+        if (!checkNull(etLocationCode)) {
+            setEditTextFocused(etLocationCode, true);
+            showWarningToast(etLocationCode.getHint().toString());
+            return ;
+        }
+
+        String postJson = formatParam(1);
+        if (!checkRepeat(Urls.FXY_DETECTION_CHECK_LOCATION + (postJson))) {
+            return;
+        }
+
+        OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_DETECTION_CHECK_LOCATION).upJson(postJson)
+                .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);
+                            if (bean.code == 1) {
+                                showSuccessToast(bean.msg);
+                                etBoxCode.requestFocus();
+                            } else {
+                                showWarningToast(bean.msg);
+                            }
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                            XLog.e("请求返回箱号检查错误", e.getMessage());
+                        }
+                    }
+                });
+    }
+
+    /**
+     * 完成
+     */
+    private void finished() {
+        clearData();
+    }
+
+    /**
+     * @param type int 1、库位,2、箱号
+     * @return
+     */
+    private String formatParam(int type) {
+        JSONObject jsonObject = new JSONObject();
+        try {
+            jsonObject.put("location_number", etLocationCode.getText().toString().trim());
+            if (type > 1) {
+                jsonObject.put("box_code", etBoxCode.getText().toString().trim());
+            }
+
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            XLog.e("组装数据失败");
+        }
+        return jsonObject.toString();
+    }
+
+    /*
+     * 校验必录
+     */
+    private boolean validate() {
+
+        if (!checkNull(etLocationCode)) {
+            setEditTextFocused(etLocationCode, true);
+            showWarningToast(etLocationCode.getHint().toString());
+            return false;
+        }
+
+        if (!checkNull(etBoxCode)) {
+            setEditTextFocused(etBoxCode, true);
+            showWarningToast(etBoxCode.getHint().toString());
+            return false;
+        }
+
+        return true;
+    }
+
+
+
+
+    //清除订单信息
+    private void clearData() {
+        etBoxCode.setText("");
+        etLocationCode.setText("");
+
+        setEditTextNormal(etLocationCode, true);
+        setEditTextNormal(etBoxCode, true);
+        etLocationCode.requestFocus();
+    }
+
+    @OnClick({R.id.btn_confirm})
+    public void onViewClicked(View view) {
+        Bundle bundle = new Bundle();
+        switch (view.getId()) {
+            case R.id.btn_confirm:
+                finished();
+                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);
+
+
+            //监听按确定
+            editText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+                @Override
+                public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+                    XLog.e("actionId:" + actionId);
+                    if (event != null) {
+                        XLog.e("KeyCode:" + event.getKeyCode() + "--ActionCode:" + event.getAction());
+                    }
+
+                    //|| (actionId == KeyEvent.ACTION_DOWN && event.getKeyCode()==KeyEvent.KEYCODE_ENTER )
+                    if (actionId == EditorInfo.IME_ACTION_SEND || actionId == EditorInfo.IME_ACTION_DONE ||
+                            (actionId == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
+                        if (v.getText().toString().trim().isEmpty()) {
+                            setEditTextFocused(v, true);
+                            showWarningToast(v.getHint().toString());
+                            return true;
+                        } else {
+                            setEditTextNormal(v, true);
+                        }
+                        callbackEditor(v);
+                        return false;
+                    }
+                    return false;
+
+                    //返回true,保留软键盘。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());
+        }
+    }
+
+
+}

+ 609 - 0
app/src/main/java/com/fxy/detection/DetectionWorkMainActivity.java

@@ -0,0 +1,609 @@
+package com.fxy.detection;
+
+import android.annotation.SuppressLint;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.inputmethod.EditorInfo;
+import android.widget.EditText;
+import android.widget.GridLayout;
+import android.widget.ImageButton;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.elvishew.xlog.XLog;
+import com.fxy.R;
+import com.fxy.adapter.GridImageAdapter;
+import com.fxy.adapter.ShowPictureAdapter;
+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.bean.ActionBean;
+import com.fxy.bean.ScanBean;
+import com.fxy.constant.BaseConfig;
+import com.fxy.constant.EventCode;
+import com.fxy.net.MyDialogCallback;
+import com.fxy.net.Urls;
+import com.fxy.view.FloatingImageView;
+import com.google.zxing.Result;
+import com.lzy.okgo.OkGo;
+import com.lzy.okgo.model.Response;
+
+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 DetectionWorkMainActivity extends BaseActivity implements StoJNI.ScanCallBack {
+    /**
+     * 列表适配器
+     */
+    Context mContext = this;
+
+    //单号
+    @BindView(R.id.et_box_code)
+    EditText etBoxCode;
+
+    //单号
+    @BindView(R.id.et_location_code)
+    EditText etLocationCode;
+
+    @BindView(R.id.gl_img)
+    GridLayout glImg;
+
+    //扫码扫码动作
+    private ScanBean scanBean;
+
+    //浮动按钮
+    @BindView(R.id.iv_drag)
+    FloatingImageView iv_drag;
+
+    private ShowPictureAdapter pictureAdapter;
+    
+
+    private Unbinder unbinder;
+    
+
+    @Override
+    public int getContentViewResId() {
+        return R.layout.activity_fxy_detection_work;
+    }
+
+    @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);
+
+    }
+
+
+    /**
+     * 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("单箱上架");
+
+        initAdapter();
+        initData();
+        initEdit();
+        //监听浮动按钮
+        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 initAdapter() {
+
+
+    }
+
+
+    @Override
+    public boolean dispatchKeyEvent(KeyEvent event) {
+        //XLog.e("event:"+event.getKeyCode());
+//        if ((event.getKeyCode()==KeyEvent.KEYCODE_DPAD_CENTER )  && event.getAction() == KeyEvent.ACTION_DOWN){
+//            //按确定键
+//            if(validate()){
+//                doPutIn();
+//            }
+//            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_location_code:
+                checkLocation();
+                break;
+            case R.id.et_box_code:
+                bindLocation();
+                break;
+            default:
+        }
+    }
+
+    private void initEdit() {
+        List<EditText> list = new ArrayList<>();
+        list.add(etLocationCode);
+        list.add(etBoxCode);
+        unifyEdit(list);
+        etLocationCode.requestFocus();
+    }
+
+    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 bindLocation() {
+
+        if (!validate()) {
+            return;
+        }
+
+
+        String postJson = formatParam(2);
+        if (!checkRepeat(Urls.FXY_DETECTION_PUTAWAY + (postJson))) {
+            return;
+        }
+
+        OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_DETECTION_PUTAWAY).upJson(postJson)
+                .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);
+                            if (bean.code == 1) {
+                                showSuccessToast(bean.msg);
+                                clearData();
+                            } else {
+                                etBoxCode.selectAll();
+                                showWarningToast(bean.msg);
+                            }
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                            XLog.e("请求返回打托信息错误", e.getMessage());
+                        }
+                    }
+                });
+    }
+
+    /**
+     * 检查库位
+     */
+    private void checkLocation() {
+        if (!checkNull(etLocationCode)) {
+            setEditTextFocused(etLocationCode, true);
+            showWarningToast(etLocationCode.getHint().toString());
+            return ;
+        }
+
+        String postJson = formatParam(1);
+        if (!checkRepeat(Urls.FXY_DETECTION_CHECK_LOCATION + (postJson))) {
+            return;
+        }
+
+        OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_DETECTION_CHECK_LOCATION).upJson(postJson)
+                .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);
+                            if (bean.code == 1) {
+                                showSuccessToast(bean.msg);
+                                etBoxCode.requestFocus();
+                            } else {
+                                showWarningToast(bean.msg);
+                            }
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                            XLog.e("请求返回箱号检查错误", e.getMessage());
+                        }
+                    }
+                });
+    }
+
+    /**
+     * 完成
+     */
+    private void finished() {
+        clearData();
+    }
+
+    /**
+     * @param type int 1、库位,2、箱号
+     * @return
+     */
+    private String formatParam(int type) {
+        JSONObject jsonObject = new JSONObject();
+        try {
+            jsonObject.put("location_number", etLocationCode.getText().toString().trim());
+            if (type > 1) {
+                jsonObject.put("box_code", etBoxCode.getText().toString().trim());
+            }
+
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            XLog.e("组装数据失败");
+        }
+        return jsonObject.toString();
+    }
+
+    /*
+     * 校验必录
+     */
+    private boolean validate() {
+
+        if (!checkNull(etLocationCode)) {
+            setEditTextFocused(etLocationCode, true);
+            showWarningToast(etLocationCode.getHint().toString());
+            return false;
+        }
+
+        if (!checkNull(etBoxCode)) {
+            setEditTextFocused(etBoxCode, true);
+            showWarningToast(etBoxCode.getHint().toString());
+            return false;
+        }
+
+        return true;
+    }
+
+
+
+
+    //清除订单信息
+    private void clearData() {
+        etBoxCode.setText("");
+        etLocationCode.setText("");
+
+        setEditTextNormal(etLocationCode, true);
+        setEditTextNormal(etBoxCode, true);
+        etLocationCode.requestFocus();
+    }
+
+    @OnClick({R.id.btn_confirm})
+    public void onViewClicked(View view) {
+        Bundle bundle = new Bundle();
+        switch (view.getId()) {
+            case R.id.btn_confirm:
+                finished();
+                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);
+
+
+            //监听按确定
+            editText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+                @Override
+                public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+                    XLog.e("actionId:" + actionId);
+                    if (event != null) {
+                        XLog.e("KeyCode:" + event.getKeyCode() + "--ActionCode:" + event.getAction());
+                    }
+
+                    //|| (actionId == KeyEvent.ACTION_DOWN && event.getKeyCode()==KeyEvent.KEYCODE_ENTER )
+                    if (actionId == EditorInfo.IME_ACTION_SEND || actionId == EditorInfo.IME_ACTION_DONE ||
+                            (actionId == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
+                        if (v.getText().toString().trim().isEmpty()) {
+                            setEditTextFocused(v, true);
+                            showWarningToast(v.getHint().toString());
+                            return true;
+                        } else {
+                            setEditTextNormal(v, true);
+                        }
+                        callbackEditor(v);
+                        return false;
+                    }
+                    return false;
+
+                    //返回true,保留软键盘。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());
+        }
+    }
+
+
+}

+ 45 - 0
app/src/main/java/com/fxy/detection/bean/OrderInfoBean.java

@@ -0,0 +1,45 @@
+package com.fxy.detection.bean;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class OrderInfoBean implements Parcelable {
+
+    private String outbound_number = ""; //
+    private String pallet_code = ""; //
+
+
+    protected OrderInfoBean(Parcel in) {
+        outbound_number = in.readString();
+        pallet_code = in.readString();
+
+    }
+
+    @Override
+    public void writeToParcel(Parcel dest, int flags) {
+        dest.writeString(outbound_number);
+        dest.writeString(pallet_code);
+    }
+
+    public OrderInfoBean() {
+
+    }
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    public static final Creator<OrderInfoBean> CREATOR = new Creator<OrderInfoBean>() {
+        @Override
+        public OrderInfoBean createFromParcel(Parcel in) {
+            return new OrderInfoBean(in);
+        }
+
+        @Override
+        public OrderInfoBean[] newArray(int size) {
+            return new OrderInfoBean[size];
+        }
+    };
+
+
+}

+ 21 - 36
app/src/main/java/com/fxy/main/fragment/HomePagerFragment.java

@@ -7,71 +7,40 @@ import android.os.Bundle;
 import android.support.annotation.Nullable;
 import android.support.annotation.Nullable;
 import android.support.v4.app.ActivityCompat;
 import android.support.v4.app.ActivityCompat;
 import android.support.v4.content.ContextCompat;
 import android.support.v4.content.ContextCompat;
-import android.support.v7.widget.LinearLayoutManager;
-import android.view.Gravity;
 import android.view.View;
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.ViewGroup;
-import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.LinearLayout;
 
 
-import com.fxy.baselibrary.util.JsonUtil;
-import com.fxy.baselibrary.util.StringUtils;
-import com.fxy.bean.ActionBean;
 import com.fxy.common.VersionUpgrades;
 import com.fxy.common.VersionUpgrades;
 import com.elvishew.xlog.XLog;
 import com.elvishew.xlog.XLog;
 import com.fxy.constant.SPCache;
 import com.fxy.constant.SPCache;
+import com.fxy.detection.DetectionDestroyOutboundMainActivity;
+import com.fxy.detection.DetectionPutInMainActivity;
+import com.fxy.detection.DetectionPutawayMainActivity;
+import com.fxy.detection.DetectionWorkMainActivity;
 import com.fxy.helper.HkDataHelper;
 import com.fxy.helper.HkDataHelper;
 import com.fxy.hk.HkOutboundMainActivity;
 import com.fxy.hk.HkOutboundMainActivity;
 import com.fxy.hk.HkPickupStartMainActivity;
 import com.fxy.hk.HkPickupStartMainActivity;
 import com.fxy.hk.HkPutinMainActivity;
 import com.fxy.hk.HkPutinMainActivity;
 import com.fxy.hk.HkTrayLocationMainActivity;
 import com.fxy.hk.HkTrayLocationMainActivity;
 import com.fxy.hk.HkTrayMainActivity;
 import com.fxy.hk.HkTrayMainActivity;
-import com.fxy.login.LoginActivity;
-import com.fxy.net.MyDialogCallback;
-import com.fxy.net.Urls;
-import com.fxy.putIn.CheckGoodsMainActivity;
 import com.fxy.putIn.CheckUnpackingMainActivity;
 import com.fxy.putIn.CheckUnpackingMainActivity;
 import com.fxy.putIn.PutinPalletMainActivity;
 import com.fxy.putIn.PutinPalletMainActivity;
 import com.fxy.putIn.PutinPhotosMainActivity;
 import com.fxy.putIn.PutinPhotosMainActivity;
-import com.fxy.putIn.SortationMainActivity;
 import com.fxy.putIn.TallyMainActivity;
 import com.fxy.putIn.TallyMainActivity;
-import com.fxy.putIn.TrayMainActivity;
-import com.fxy.putIn.bean.realm.TakePhotosRealm;
 import com.fxy.putOut.DeliveryGoodsMainActivity;
 import com.fxy.putOut.DeliveryGoodsMainActivity;
-import com.fxy.putOut.QualityInspectionMainActivity;
-import com.fxy.realm.CutRuleRealm;
-import com.fxy.realm.HkTransRealm;
 import com.fxy.tool.OrderToolMainActivity;
 import com.fxy.tool.OrderToolMainActivity;
 import com.fxy.workOrder.StartWorkOrderMainActivity;
 import com.fxy.workOrder.StartWorkOrderMainActivity;
 import com.fxy.workOrder.WorkOrderOptMainActivity;
 import com.fxy.workOrder.WorkOrderOptMainActivity;
-import com.google.zxing.Result;
 import com.fxy.baselibrary.base.BaseFragment;
 import com.fxy.baselibrary.base.BaseFragment;
-import com.fxy.baselibrary.interfaces.OnRxScanerListener;
-import com.fxy.baselibrary.language.other.CommSharedUtil;
-import com.fxy.baselibrary.qrcode.ActivityScanerCode;
-import com.fxy.baselibrary.tddialog.TDialog;
-import com.fxy.baselibrary.tddialog.base.BindViewHolder;
-import com.fxy.baselibrary.tddialog.base.TBaseAdapter;
-import com.fxy.baselibrary.tddialog.list.TListDialog;
 import com.fxy.R;
 import com.fxy.R;
-import com.fxy.constant.BaseConfig;
 import com.fxy.helper.ScanHelper;
 import com.fxy.helper.ScanHelper;
-import com.lzy.okgo.OkGo;
 
 
 
 
-import org.json.JSONObject;
-
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-
 import butterknife.BindView;
 import butterknife.BindView;
 import butterknife.ButterKnife;
 import butterknife.ButterKnife;
 import butterknife.OnClick;
 import butterknife.OnClick;
 import butterknife.Unbinder;
 import butterknife.Unbinder;
-import io.realm.Realm;
-import io.realm.RealmResults;
 
 
 
 
 /**
 /**
@@ -175,7 +144,8 @@ public class HomePagerFragment extends BaseFragment implements View.OnClickListe
     @OnClick({R.id.search_view, R.id.ivt_tally,R.id.ivt_cargo_storage,R.id.ivt_putin_photos,
     @OnClick({R.id.search_view, R.id.ivt_tally,R.id.ivt_cargo_storage,R.id.ivt_putin_photos,
             R.id.ivt_order_tool,R.id.ivt_check,R.id.ivt_putin_pallet,R.id.ivt_hk_putin,
             R.id.ivt_order_tool,R.id.ivt_check,R.id.ivt_putin_pallet,R.id.ivt_hk_putin,
             R.id.ivt_handle_work_order,R.id.ivt_add_work_order,R.id.ivt_hk_tally,R.id.ivt_hk_outbound,
             R.id.ivt_handle_work_order,R.id.ivt_add_work_order,R.id.ivt_hk_tally,R.id.ivt_hk_outbound,
-            R.id.ivt_hk_pallet_location,R.id.ivt_hk_pickup})
+            R.id.ivt_hk_pallet_location,R.id.ivt_hk_pickup,
+            R.id.ivt_detection_putin,R.id.ivt_detection_putaway,R.id.ivt_detection_destroy_outbound,R.id.ivt_detection_work})
     public void onClick(View v) {
     public void onClick(View v) {
         Bundle bundle = new Bundle();
         Bundle bundle = new Bundle();
         switch (v.getId()) {
         switch (v.getId()) {
@@ -207,6 +177,21 @@ public class HomePagerFragment extends BaseFragment implements View.OnClickListe
             case R.id.ivt_putin_pallet:
             case R.id.ivt_putin_pallet:
                 intent2Page(getActivity(), PutinPalletMainActivity.class, false,bundle);
                 intent2Page(getActivity(), PutinPalletMainActivity.class, false,bundle);
                 break;
                 break;
+            case R.id.ivt_detection_putin:
+                intent2Page(getActivity(), DetectionPutInMainActivity.class, false,bundle);
+                break;
+            case R.id.ivt_detection_putaway:
+                intent2Page(getActivity(), DetectionPutawayMainActivity.class, false,bundle);
+                break;
+            case R.id.ivt_detection_destroy_outbound:
+                intent2Page(getActivity(), DetectionDestroyOutboundMainActivity.class, false,bundle);
+                break;
+
+            case R.id.ivt_detection_work:
+                intent2Page(getActivity(), DetectionWorkMainActivity.class, false,bundle);
+                break;
+
+
             case R.id.ivt_hk_putin:
             case R.id.ivt_hk_putin:
                 intent2Page(getActivity(), HkPutinMainActivity.class, false,bundle);
                 intent2Page(getActivity(), HkPutinMainActivity.class, false,bundle);
                 break;
                 break;

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

@@ -153,6 +153,16 @@ public class Urls {
     //香港入库
     //香港入库
     public static final String FXY_GK_INBOUND_PICTURE = "/pda/HongkongInbound/picture";
     public static final String FXY_GK_INBOUND_PICTURE = "/pda/HongkongInbound/picture";
 
 
+    /*开始检修功能*/
+
+    //单箱入库
+    public static final String FXY_DETECTION_PUTIN = "/pda/inbound/pictureCheck";
+
+    // 单箱上架 -- 查验库位
+    public static final String FXY_DETECTION_CHECK_LOCATION = "/pda/inbound/putaway";
+    // 单箱上架
+    public static final String FXY_DETECTION_PUTAWAY = "/pda/inbound/putaway";
+
 
 
     //打托 - 扫托盘
     //打托 - 扫托盘
     public static final String FXY_HK_CHECK_PALLET = "/pda/HongkongInbound/checkPallet";
     public static final String FXY_HK_CHECK_PALLET = "/pda/HongkongInbound/checkPallet";

+ 7 - 0
app/src/main/res/drawable/radio_green_selector.xml

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

+ 96 - 0
app/src/main/res/layout/activity_fxy_detection_destroy_outbound.xml

@@ -0,0 +1,96 @@
+<?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
+                style="@style/FromLinearLayoutItem"
+                android:orientation="horizontal">
+                <EditText
+                    style="@style/EditTextStyle"
+                    android:id="@+id/et_destroy_batch_number"
+
+                    android:hint="请输入/扫描销毁批次号"
+                    android:text=""/>
+                <ImageButton
+                    style="@style/ClearImg"
+                    android:id="@+id/ib_location_code_clear"
+                    />
+
+            </LinearLayout>
+
+
+            <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
+                    android:id="@+id/et_internals_code"
+                    style="@style/EditTextStyle"
+                    android:hint="请输入/扫描箱号"
+                    android:text="" />
+
+                <ImageButton
+                    android:id="@+id/ib_box_code_clear"
+                    style="@style/ClearImg" />
+
+            </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:layout_gravity="bottom"
+                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>

+ 96 - 0
app/src/main/res/layout/activity_fxy_detection_putaway.xml

@@ -0,0 +1,96 @@
+<?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
+                style="@style/FromLinearLayoutItem"
+                android:orientation="horizontal">
+                <EditText
+                    style="@style/EditTextStyle"
+                    android:id="@+id/et_location_code"
+
+                    android:hint="请输入/扫描库位"
+                    android:text=""/>
+                <ImageButton
+                    style="@style/ClearImg"
+                    android:id="@+id/ib_location_code_clear"
+                    />
+
+            </LinearLayout>
+
+
+            <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
+                    android:id="@+id/et_box_code"
+                    style="@style/EditTextStyle"
+                    android:hint="请输入/扫描箱号"
+                    android:text="" />
+
+                <ImageButton
+                    android:id="@+id/ib_box_code_clear"
+                    style="@style/ClearImg" />
+
+            </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:layout_gravity="bottom"
+                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>

+ 106 - 0
app/src/main/res/layout/activity_fxy_detection_putin.xml

@@ -0,0 +1,106 @@
+<?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="match_parent"
+        android:fitsSystemWindows="true"
+        android:scrollbars="none">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical">
+
+            <LinearLayout
+                android:id="@+id/ll_label_picture"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:visibility="visible"
+                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:background="@null"
+                    android:padding="@dimen/dp_10"
+                    android:gravity="center_vertical"
+                    android:orientation="vertical">
+                    <TextView
+                        style="@style/fontSize"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:textStyle="bold"
+                        android:text="面单拍照">
+                    </TextView>
+                </LinearLayout>
+                <include layout="@layout/fragment_show_img"/>
+            </LinearLayout>
+
+            <LinearLayout
+                android:id="@+id/ll_weigh_picture"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:visibility="visible"
+                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:background="@null"
+                    android:padding="@dimen/dp_10"
+                    android:gravity="center_vertical"
+                    android:orientation="vertical">
+                    <TextView
+                        style="@style/fontSize"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:textStyle="bold"
+                        android:text="称重拍照">
+                    </TextView>
+                </LinearLayout>
+                <include layout="@layout/fragment_show_img"/>
+            </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:layout_gravity="bottom"
+                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>
+
+
+</LinearLayout>

+ 130 - 0
app/src/main/res/layout/activity_fxy_detection_work.xml

@@ -0,0 +1,130 @@
+<?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">
+
+
+
+            <LinearLayout
+                android:id="@+id/ll_from"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:orientation="horizontal">
+                <LinearLayout
+                    style="@style/FromLinearLayoutItem"
+                    android:orientation="horizontal">
+                    <EditText
+                        style="@style/EditTextStyle"
+                        android:id="@+id/et_location_code"
+                        android:hint="请输入/扫描库位"
+                        android:text=""/>
+                    <ImageButton
+                        style="@style/ClearImg"
+                        android:id="@+id/ib_location_code_clear"
+                        />
+
+                </LinearLayout>
+                <LinearLayout
+                    android:id="@+id/ll_container"
+                    style="@style/FromLinearLayoutItem"
+                    android:orientation="horizontal">
+                    <EditText
+                        android:id="@+id/et_box_code"
+                        style="@style/EditTextStyle"
+                        android:hint="请输入/扫描箱号"
+                        android:text="" />
+                    <ImageButton
+                        android:id="@+id/ib_box_code_clear"
+                        style="@style/ClearImg" />
+                </LinearLayout>
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content">
+
+                <GridLayout
+                    android:id="@+id/gl_img"
+                    android:layout_width="match_parent"
+                    android:padding="10dp"
+                    android:layout_margin="10dp"
+                    android:background="@color/white"
+                    android:layout_height="wrap_content">
+
+                </GridLayout>
+
+            </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:orientation="horizontal"
+                android:gravity="center_horizontal"
+                android:layout_gravity="bottom"
+                android:padding="10dp">
+
+                <TextView
+                    style="@style/fontSize"
+                    android:id="@+id/btn_last_step"
+                    android:layout_width="wrap_content"
+                    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" />
+                <TextView
+                    style="@style/fontSize"
+                    android:id="@+id/btn_confirm"
+                    android:layout_width="wrap_content"
+                    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>

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

@@ -236,6 +236,76 @@
                     </TableRow>
                     </TableRow>
 
 
 
 
+                </LinearLayout>
+
+                <LinearLayout
+                    android:id="@+id/ll_detection"
+                    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_detection_putin"
+                            android:drawableTop="@drawable/ic_mapan"
+                            android:drawablePadding="5dp"
+                            android:text="单箱入库" />
+                        <TextView
+                            style="@style/ImageViewWithTextStyle.FontSize"
+                            android:id="@+id/ivt_detection_putaway"
+                            android:drawableTop="@drawable/ic_mapan"
+                            android:drawablePadding="5dp"
+                            android:text="单箱上架" />
+
+                    </TableRow>
+
+                    <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_detection_destroy_outbound"
+                            android:drawableTop="@drawable/ic_mapan"
+                            android:drawablePadding="5dp"
+                            android:text="销毁出库" />
+                        <TextView
+                            style="@style/ImageViewWithTextStyle.FontSize"
+                            android:id="@+id/ivt_detection_work"
+                            android:drawableTop="@drawable/ic_mapan"
+                            android:drawablePadding="5dp"
+                            android:text="检测作业" />
+
+                    </TableRow>
+
+
                 </LinearLayout>
                 </LinearLayout>
             </LinearLayout>
             </LinearLayout>
 
 

+ 62 - 0
app/src/main/res/layout/item_preview_image.xml

@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content">
+
+    <RelativeLayout
+        android:layout_width="110dp"
+        android:layout_height="110dp"
+        android:layout_centerInParent="true">
+
+        <ImageView
+            android:id="@+id/ivp_img"
+            android:layout_width="110dp"
+            android:layout_height="110dp"
+            android:layout_marginTop="10dp"
+            android:contentDescription="@null"
+            android:scaleType="centerCrop"
+            android:src="@drawable/sto_logo"/>
+        <View
+            android:id="@+id/selected_overlay"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:visibility="gone"
+            android:background="#80000000" />
+
+
+        <CheckBox
+            android:id="@+id/cb_select"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentEnd="true"
+            android:checked="true"
+            android:gravity="end"
+            android:text="" />
+
+
+
+        <LinearLayout
+            android:id="@+id/ll_del"
+            android:layout_width="30dp"
+            android:layout_height="30dp"
+            android:layout_alignParentEnd="true"
+            android:layout_alignParentRight="true"
+            android:gravity="end"
+            android:visibility="gone"
+            android:orientation="vertical">
+
+            <ImageView
+                android:id="@+id/iv_del"
+                android:layout_width="25dp"
+                android:layout_height="25dp"
+                android:contentDescription="@null"
+                android:scaleType="fitXY"
+                android:src="@drawable/delete"/>
+
+        </LinearLayout>
+
+
+
+    </RelativeLayout>
+
+</RelativeLayout>