Forráskód Böngészése

Merge remote-tracking branch 'remotes/origin/master_619'

guilin 9 hónapja
szülő
commit
f1ee5d0a5c
54 módosított fájl, 8153 hozzáadás és 40 törlés
  1. 43 0
      app/src/main/AndroidManifest.xml
  2. 4 1
      app/src/main/java/com/fxy/adapter/GridImageAdapter.java
  3. 230 0
      app/src/main/java/com/fxy/adapter/PictureListAdapter.java
  4. 182 0
      app/src/main/java/com/fxy/adapter/ShowPictureAdapter.java
  5. 116 0
      app/src/main/java/com/fxy/common/ConfirmDialog.java
  6. 19 2
      app/src/main/java/com/fxy/common/PictureSelectorUpload.java
  7. 802 0
      app/src/main/java/com/fxy/detection/DetectionConfirmGoodsMainActivity.java
  8. 671 0
      app/src/main/java/com/fxy/detection/DetectionConfirmPartsMainActivity.java
  9. 510 0
      app/src/main/java/com/fxy/detection/DetectionDealDiffMainActivity.java
  10. 600 0
      app/src/main/java/com/fxy/detection/DetectionDestroyOutboundMainActivity.java
  11. 474 0
      app/src/main/java/com/fxy/detection/DetectionPutInMainActivity.java
  12. 602 0
      app/src/main/java/com/fxy/detection/DetectionPutawayMainActivity.java
  13. 1238 0
      app/src/main/java/com/fxy/detection/DetectionWorkMainActivity.java
  14. 148 0
      app/src/main/java/com/fxy/detection/bean/BaseBean.java
  15. 86 0
      app/src/main/java/com/fxy/detection/bean/BoxInfoBean.java
  16. 116 0
      app/src/main/java/com/fxy/detection/bean/BoxSkuBean.java
  17. 109 0
      app/src/main/java/com/fxy/detection/bean/BtnInfoBean.java
  18. 114 0
      app/src/main/java/com/fxy/detection/bean/ConfirmGoodsBean.java
  19. 82 0
      app/src/main/java/com/fxy/detection/bean/ConfirmPartsBean.java
  20. 100 0
      app/src/main/java/com/fxy/detection/bean/DealDiffBean.java
  21. 57 0
      app/src/main/java/com/fxy/detection/bean/NeedPhotoBean.java
  22. 166 0
      app/src/main/java/com/fxy/detection/bean/OptionsBean.java
  23. 45 0
      app/src/main/java/com/fxy/detection/bean/OrderInfoBean.java
  24. 82 0
      app/src/main/java/com/fxy/detection/bean/PartsBean.java
  25. 59 0
      app/src/main/java/com/fxy/detection/bean/RepairConfirmBean.java
  26. 70 0
      app/src/main/java/com/fxy/detection/bean/SuspendBean.java
  27. 1 1
      app/src/main/java/com/fxy/login/LoginActivity.java
  28. 22 36
      app/src/main/java/com/fxy/main/fragment/HomePagerFragment.java
  29. 25 0
      app/src/main/java/com/fxy/net/Urls.java
  30. 38 0
      app/src/main/java/com/fxy/utils/ToolUtils.java
  31. 7 0
      app/src/main/res/drawable/radio_green_selector.xml
  32. 5 0
      app/src/main/res/drawable/selectable_background.xml
  33. 7 0
      app/src/main/res/drawable/text_border.xml
  34. 5 0
      app/src/main/res/drawable/text_border_select.xml
  35. 115 0
      app/src/main/res/layout/activity_fxy_detection_confirm_goods.xml
  36. 115 0
      app/src/main/res/layout/activity_fxy_detection_confirm_parts.xml
  37. 132 0
      app/src/main/res/layout/activity_fxy_detection_deal_diff.xml
  38. 96 0
      app/src/main/res/layout/activity_fxy_detection_destroy_outbound.xml
  39. 96 0
      app/src/main/res/layout/activity_fxy_detection_putaway.xml
  40. 106 0
      app/src/main/res/layout/activity_fxy_detection_putin.xml
  41. 198 0
      app/src/main/res/layout/activity_fxy_detection_work.xml
  42. 70 0
      app/src/main/res/layout/fragment_homepager.xml
  43. 11 0
      app/src/main/res/layout/item_btn.xml
  44. 9 0
      app/src/main/res/layout/item_card.xml
  45. 41 0
      app/src/main/res/layout/item_card_tab.xml
  46. 139 0
      app/src/main/res/layout/item_card_tab_two.xml
  47. 40 0
      app/src/main/res/layout/item_picture_selector.xml
  48. 54 0
      app/src/main/res/layout/item_preview_image.xml
  49. 45 0
      app/src/main/res/layout/item_repair.xml
  50. 21 0
      app/src/main/res/layout/item_sku_img.xml
  51. 2 0
      app/src/main/res/values/colors.xml
  52. 1 0
      app/src/main/res/values/dimens.xml
  53. 19 0
      app/src/main/res/values/styles.xml
  54. 8 0
      baselibrary/src/main/java/com/fxy/baselibrary/util/JsonUtil.java

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

@@ -200,7 +200,50 @@
             android:screenOrientation="portrait"
             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
+            android:name=".detection.DetectionConfirmGoodsMainActivity"
+            android:windowSoftInputMode="stateHidden|adjustPan"
+            android:screenOrientation="sensor"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            tools:ignore="LockedOrientationActivity"/>
+
+        <activity
+            android:name=".detection.DetectionConfirmPartsMainActivity"
+            android:windowSoftInputMode="stateHidden|adjustPan"
+            android:screenOrientation="sensor"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            tools:ignore="LockedOrientationActivity"/>
+
+        <activity
+            android:name=".detection.DetectionDealDiffMainActivity"
+            android:windowSoftInputMode="stateHidden|adjustPan"
+            android:screenOrientation="sensor"
+            android:configChanges="orientation|keyboardHidden|screenSize"
+            tools:ignore="LockedOrientationActivity"/>
 
 
         <activity

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

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

+ 230 - 0
app/src/main/java/com/fxy/adapter/PictureListAdapter.java

@@ -0,0 +1,230 @@
+package com.fxy.adapter;
+
+import android.app.Activity;
+import android.content.Context;
+import android.support.v7.widget.GridLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.util.DisplayMetrics;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.ImageView;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.engine.DiskCacheStrategy;
+import com.bumptech.glide.request.RequestOptions;
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
+import com.elvishew.xlog.XLog;
+import com.fxy.R;
+import com.fxy.baselibrary.views.dialog.RxDialogZoomImageView;
+import com.fxy.detection.bean.OptionsBean;
+import com.fxy.view.FullyGridLayoutManager;
+import com.luck.picture.lib.config.PictureConfig;
+import com.luck.picture.lib.config.PictureMimeType;
+
+import java.util.List;
+
+public class PictureListAdapter extends BaseQuickAdapter<OptionsBean, BaseViewHolder> {
+    private LayoutInflater mInflater;
+    private Context context;
+    private Activity mActivity;
+    private String PictureType = "";
+    private String tag = "";//各种特殊标识使用
+    private int screenWidth;
+    private int screenHeight;
+    private  float density;
+    private int spanCount;
+
+    private View errorView;     //错误显示页
+    private View emptyView;     //空显示页
+    private RecyclerView recyclerView;
+
+    private  onAddPicClickListener mOnAddPicClickListener;
+
+    public interface onAddPicClickListener {
+        void onAddPicClick(String PictureType);
+    }
+    public void setAddPicClick(onAddPicClickListener listener) {
+        this.mOnAddPicClickListener = listener;
+    }
+
+    //
+//    private OnItemClickListener mItemClickListener;
+//
+//    public interface OnItemClickListener {
+//        void onItemClick(int position, View v,String PictureType);
+//    }
+//
+//    public void setOnItemClickListener(OnItemClickListener listener) {
+//        this.mItemClickListener = listener;
+//    }
+
+    public PictureListAdapter(Context context, Activity activity, RecyclerView view, List<OptionsBean> list, String type){
+        super(R.layout.item_preview_image, list);
+        this.context = context;
+        this.mActivity = activity;
+        mInflater = LayoutInflater.from(context);
+        recyclerView = view;
+        PictureType  = type;
+
+        emptyView = mInflater.inflate(R.layout.pager_empty, (ViewGroup) recyclerView.getParent(), false);
+        errorView = mInflater.inflate(R.layout.pager_error, (ViewGroup) recyclerView.getParent(), false);
+        setEmptyView(emptyView);
+        openLoadAnimation(BaseQuickAdapter.SCALEIN);
+
+        DisplayMetrics displayMetrics = new DisplayMetrics();
+        activity.getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
+        screenHeight = displayMetrics.heightPixels; // 屏幕高度(像素)
+        screenWidth = displayMetrics.widthPixels; // 屏幕高度(像素)
+        density = activity.getResources().getDisplayMetrics().density;
+
+        spanCount = 3;
+        if (Math.max(screenHeight,screenWidth)>1000){
+            spanCount = (int) screenWidth/500;
+        }
+
+
+
+        recyclerView.setLayoutManager(new FullyGridLayoutManager(mContext, spanCount, GridLayoutManager.VERTICAL, false));
+        recyclerView.setAdapter(this);
+
+
+    }
+
+    public void setPictureType(String type){
+        PictureType  = type;
+    }
+    public void setTag(String str){
+        tag  = str;
+    }
+
+
+//    public void setNewData( List<OptionsBean> list){
+//        super(list);
+//    }
+
+
+    @Override
+    protected void convert(BaseViewHolder helper, OptionsBean item) {
+        //定义setOnItemChildClickListener 事件点击
+        helper.addOnClickListener(R.id.cb_select);
+        helper.addOnClickListener(R.id.ivp_img);
+        helper.addOnClickListener(R.id.tv_name);
+
+         ImageView  mImg = helper.getView(R.id.ivp_img);
+         CheckBox cbSelect = helper.getView(R.id.cb_select);
+         TextView tvName = helper.getView(R.id.tv_name);
+        RelativeLayout llImgCenter = helper.getView(R.id.ll_img_center);
+
+
+        // 设置宽度为 200 像素
+        if (Math.max(screenHeight,screenWidth)>1000){
+            RelativeLayout.LayoutParams layoutParams = (RelativeLayout.LayoutParams) llImgCenter.getLayoutParams();
+
+            layoutParams.width = getDpValue(100,density);
+            layoutParams.setMargins(10,10,10,10);
+            llImgCenter.setLayoutParams(layoutParams);
+
+
+            // 获取ImageView的当前LayoutParams(假设它是RelativeLayout的子视图)
+//            RelativeLayout.LayoutParams imgParams = (RelativeLayout.LayoutParams) mImg.getLayoutParams();
+//            // 设置新的宽度,并保持高度不变(WRAP_CONTENT)
+//            imgParams.width = getDpValue(200,density); // 或者你可以使用 layoutParams.width = LinearLayout.LayoutParams.WRAP_CONTENT;
+//            imgParams.height = getDpValue(200,density); // 或者你可以使用 layoutParams.width = LinearLayout.LayoutParams.WRAP_CONTENT;
+//            mImg.setLayoutParams(layoutParams);
+
+
+        }
+
+
+
+        tvName.setVisibility(View.VISIBLE);
+        tvName.setText(item.getTitle());
+
+         if ( !item.getNeedPhoto().isEmpty()){
+             mImg.setVisibility(View.VISIBLE);
+             cbSelect.setVisibility(View.VISIBLE);
+             cbSelect.setChecked((boolean)item.getChecked());
+
+             RequestOptions options = new RequestOptions()
+                     .centerCrop()
+                     .placeholder(R.color.color_f6)
+                     .diskCacheStrategy(DiskCacheStrategy.ALL);
+
+             Glide.with(helper.itemView.getContext())
+                     .load(item.getNeedPhoto())
+                     .apply(options)
+                     .into(mImg);
+
+         }else{
+             mImg.setVisibility(View.GONE);
+             cbSelect.setVisibility(View.VISIBLE);
+         }
+
+
+
+        cbSelect.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+            @Override
+            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+                RelativeLayout parentLinearLayout = (RelativeLayout) buttonView.getParent();
+
+                View overlayView =  parentLinearLayout.findViewById(R.id.overlay_view);
+
+                // 当checkbox1的选中状态改变时执行
+                if (isChecked) {
+                    overlayView.setVisibility(View.VISIBLE);
+                } else {
+                    overlayView.setVisibility(View.GONE);
+                }
+            }
+        });
+
+        mImg.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+
+                XLog.e("--------setOnClickListener------");
+                int position = RecyclerView.NO_POSITION;
+                position = Math.max(position, 0);
+//                List<LocalMedia> mediasList = new ArrayList<>();
+//                for (int i = 0; i < mData.size(); i++) {
+//                    LocalMedia media = new LocalMedia (mData.get(i).getUrl(), 0, PictureConfig.TYPE_IMAGE, "");
+//                    media.setCut(false);
+//                    mediasList.add(media);
+//
+//                }
+//                com.luck.picture.lib.PictureSelector.create(mActivity).externalPicturePreview(position, mediasList);
+
+                RxDialogZoomImageView rxDialogZoomImageView = new RxDialogZoomImageView(mContext);
+//                rxDialogZoomImageView.setImagePath(mData.get(position));
+                rxDialogZoomImageView.show();
+
+            }
+        });
+
+
+    }
+
+    private int getDpValue(int dpValue,float density){
+        return Math.round((float)dpValue * density);
+    }
+
+    public void authCamera() {
+        //拍照
+        com.luck.picture.lib.PictureSelector.create(mActivity)
+                .openCamera(PictureMimeType.ofImage())
+                //只需要拍照
+                //.selectionMode(PictureConfig.SINGLE)
+//                .isCamera(true)
+                //.compressMaxKB()//压缩最大值kb compressGrade()为Luban.CUSTOM_GEAR有效
+                .compress(true) // 压缩
+                .cropCompressQuality(100)// 裁剪压缩质量 默认100
+                .minimumCompressSize(100) //最新压缩图片 默认100
+                .forResult(PictureConfig.REQUEST_CAMERA);
+    }
+}

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

@@ -0,0 +1,182 @@
+package com.fxy.adapter;
+
+import android.app.Activity;
+import android.content.Context;
+import android.support.v7.widget.RecyclerView;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.ImageView;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.engine.DiskCacheStrategy;
+import com.bumptech.glide.request.RequestOptions;
+import com.fxy.R;
+import com.fxy.detection.bean.OptionsBean;
+import com.luck.picture.lib.entity.LocalMedia;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+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) {
+        this.context = context;
+        this.mActivity = activity;
+        mInflater = LayoutInflater.from(context);
+        this.mOnAddPicClickListener = mOnAddPicClickListener;
+    }
+
+    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) {
+        pictureList.clear();
+        this.pictureList = list;
+
+    }
+
+    public void setBeanList( List<OptionsBean> list) {
+
+        pictureList.clear();
+        for (int i = 0; i < list.size(); i++) {
+//            pictureList.add(list.get(i).getUrl());
+        }
+    }
+
+    /**
+     *
+     * 支持当前上传
+     */
+    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);
+        }
+    }
+
+    @Override
+    public int getItemCount() {
+        if (pictureList.size() < selectMax) {
+            return pictureList.size();
+        } else {
+            return pictureList.size();
+        }
+    }
+
+
+    /**
+     * 创建ViewHolder
+     */
+    @Override
+    public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
+        View view = mInflater.inflate(R.layout.item_preview_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);
+                }
+            }
+        });
+
+        if (pictureList.size()>0){
+            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);
+        }
+
+
+        viewHolder.itemView.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                int adapterPosition = viewHolder.getAdapterPosition();
+                //外部定义了
+                if (mItemClickListener != null) {
+                    mItemClickListener.onItemClick(adapterPosition, v);
+                }
+            }
+        });
+    }
+
+    private OnItemClickListener mItemClickListener;
+
+    public interface OnItemClickListener {
+        void onItemClick(int position, View v);
+    }
+
+    public void setOnItemClickListener(OnItemClickListener listener) {
+        this.mItemClickListener = listener;
+    }
+}

+ 116 - 0
app/src/main/java/com/fxy/common/ConfirmDialog.java

@@ -0,0 +1,116 @@
+package com.fxy.common;
+
+import android.content.Context;
+import android.content.DialogInterface;
+
+import com.fxy.R;
+import com.fxy.detection.bean.BtnInfoBean;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public  class ConfirmDialog {
+    private final Context mContext;
+    private List<BtnInfoBean> listBtn = new ArrayList<>();
+    private OnCallbackListener listener;
+    private DialogInterface dialog;
+    private boolean cancelable= false;
+    public ConfirmDialog(Context context, List<BtnInfoBean> list){
+        mContext = context;
+        listBtn = list;
+    }
+
+    public void  setCancelable(boolean flag){
+        cancelable = flag;
+    }
+
+
+    public void showDialog(String center){
+        showDialog(center,"");
+    }
+
+    public void showDialog(String center,String title){
+        // 使用AlertDialog.Builder来创建对话框的构建器
+        android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(mContext);
+        builder.setCancelable(cancelable).setMessage(center);
+
+        if (!title.isEmpty()){
+            builder.setTitle(title);
+        }
+
+        int len = listBtn!=null ? listBtn.size() : 0 ;
+        if (len>0){
+
+            builder.setPositiveButton(listBtn.get(0).getTxt(), new DialogInterface.OnClickListener() {
+                @Override
+                public void onClick(DialogInterface dialogInterface, int i) {
+                    if (listener == null){
+                        dialogInterface.dismiss();
+                    }else{
+                        dialog = dialogInterface;
+                        listener.OnCallback(listBtn.get(0).getValue(),0);
+                    }
+                }
+            });
+
+            if (len>1){
+                builder.setNeutralButton(listBtn.get(1).getTxt(), new DialogInterface.OnClickListener() {
+                    @Override
+                    public void onClick(DialogInterface dialogInterface, int i) {
+                        if (listener == null){
+                            dialogInterface.dismiss();
+                        }else{
+                            dialog = dialogInterface;
+                            listener.OnCallback(listBtn.get(1).getValue(),1);
+                        }
+                    }
+                });
+            }
+
+            if (len>2){
+                builder.setNegativeButton(listBtn.get(2).getTxt(), new DialogInterface.OnClickListener() {
+                    @Override
+                    public void onClick(DialogInterface dialogInterface, int i) {
+                        if (listener == null){
+                            dialogInterface.dismiss();
+                        }else{
+                            dialog = dialogInterface;
+                            listener.OnCallback(listBtn.get(2).getValue(),2);
+                        }
+
+                    }
+                });
+            }
+
+        }else{
+            builder.setPositiveButton(R.string.str_submit, new DialogInterface.OnClickListener() {
+                @Override
+                public void onClick(DialogInterface dialogInterface, int i) {
+                    dialogInterface.dismiss();
+                }
+            });
+        }
+
+        // 创建并显示对话框
+        android.app.AlertDialog dialog = builder.create();
+        dialog.show();
+    }
+
+    public void dismiss(){
+        if (dialog!=null){
+            dialog.dismiss();
+            dialog = null;
+        }
+    }
+
+
+
+    public interface OnCallbackListener{
+        void OnCallback(String value,int position);
+    }
+
+    // 提供注册事件监听的方法
+    public void setOnCallbackListener(OnCallbackListener onCallbackListener) {
+        this.listener = onCallbackListener;
+    }
+}

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

@@ -166,10 +166,24 @@ public class PictureSelectorUpload {
        return actionType;
     }
 
-    public ArrayList getPhotoList(){
+    public ArrayList<String> getPhotoList(){
         return  adapter.getPhotoList();
     }
 
+    public List<LocalMedia> getSelectList(){
+        return  selectList;
+    }
+
+    public void setSelectList(List<LocalMedia> selectList,ArrayList<String> photoPathList){
+        if (selectList != null){
+            ossPhotoList = photoPathList;
+            adapter.setPhotoPath(photoPathList);
+            adapter.setList(selectList);
+            adapter.notifyDataSetChanged();
+        }
+    }
+
+
 
     public void emptyRemake(){
         selectList.clear();
@@ -361,7 +375,10 @@ public class PictureSelectorUpload {
                     showTitle= showTitle+",失败"+failUploadList.size()+"个";
                 }
 
-                progressDialog.setTitle(showTitle);
+                if (progressDialog!=null){
+                    progressDialog.setTitle(showTitle);
+                }
+
                 if (awaitUploadList.size()>0){
                     filedUpload();
                 }else{

+ 802 - 0
app/src/main/java/com/fxy/detection/DetectionConfirmGoodsMainActivity.java

@@ -0,0 +1,802 @@
+package com.fxy.detection;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+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.GridLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.util.DisplayMetrics;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.inputmethod.EditorInfo;
+import android.widget.EditText;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.engine.DiskCacheStrategy;
+import com.bumptech.glide.request.RequestOptions;
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
+import com.elvishew.xlog.XLog;
+import com.fxy.R;
+import com.fxy.baselibrary.base.BaseActivity;
+import com.fxy.baselibrary.bean.BaseEventBusBean;
+import com.fxy.baselibrary.interfaces.OnRxScanerListener;
+import com.fxy.baselibrary.qrcode.ActivityScanerCode;
+import com.fxy.baselibrary.util.JsonUtil;
+import com.fxy.bean.ActionBean;
+import com.fxy.bean.ScanBean;
+import com.fxy.common.ConfirmDialog;
+import com.fxy.constant.BaseConfig;
+import com.fxy.constant.EventCode;
+import com.fxy.detection.bean.BtnInfoBean;
+import com.fxy.detection.bean.BoxInfoBean;
+import com.fxy.detection.bean.BoxSkuBean;
+import com.fxy.detection.bean.ConfirmGoodsBean;
+import com.fxy.net.MyDialogCallback;
+import com.fxy.net.Urls;
+import com.fxy.utils.ToolUtils;
+import com.fxy.view.FloatingImageView;
+import com.fxy.view.FullyGridLayoutManager;
+import com.google.gson.Gson;
+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.HashMap;
+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 DetectionConfirmGoodsMainActivity extends BaseActivity implements StoJNI.ScanCallBack {
+    /**
+     * 列表适配器
+     */
+    Context mContext = this;
+    Activity mActivity = this;
+    //单号
+    @BindView(R.id.et_box_code)
+    EditText etBoxCode;
+
+    //单号
+    @BindView(R.id.et_unit_code)
+    EditText etUnitCode;
+
+
+    @BindView(R.id.recyclerview)
+    RecyclerView recyclerView;
+
+    @BindView(R.id.ll_host_diff)
+    LinearLayout llHostDiff;
+    @BindView(R.id.ll_from)
+    LinearLayout llFrom;
+
+
+    //扫码扫码动作
+    private ScanBean scanBean;
+
+    //浮动按钮
+    @BindView(R.id.iv_drag)
+    FloatingImageView iv_drag;
+
+
+    private View errorView;     //错误显示页
+    private View emptyView;     //空显示页
+    /**
+     * 列表适配器
+     */
+    private FinishWorkAdapter mAdapter;
+
+    private List<BoxSkuBean> boxSkuBeanList;
+
+    private int currentSku = -1;
+
+    private List<BtnInfoBean> listBtn = new ArrayList<>();
+
+    private float density = 0;
+
+    private ConfirmDialog confirmDialog;
+
+    private Unbinder unbinder;
+    
+
+    @Override
+    public int getContentViewResId() {
+        return R.layout.activity_fxy_detection_confirm_goods;
+    }
+
+    @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);
+        if (requestCode == 200 && resultCode == 200)
+        {
+            clearData();
+        }
+    }
+
+
+    /**
+     * 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() {
+        density = ToolUtils.getDensity(this);
+    }
+
+
+    private void initAdapter(){
+
+        int columnCount = 2; // 默认列数
+// 根据屏幕宽度动态调整列数
+        DisplayMetrics displayMetrics = new DisplayMetrics();
+        getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
+        int screenWidth = displayMetrics.widthPixels;
+// 这里可以根据屏幕宽度动态计算列数,例如每列200dp
+        float dpWidth = screenWidth / (displayMetrics.densityDpi / 160f);
+        columnCount = (int) (dpWidth / 200); // 假设每列期望宽度为200dp
+
+        emptyView = this.getLayoutInflater().inflate(R.layout.pager_empty, (ViewGroup) recyclerView.getParent(), false);
+        errorView = this.getLayoutInflater().inflate(R.layout.pager_error, (ViewGroup) recyclerView.getParent(), false);
+
+        mAdapter  = new FinishWorkAdapter(boxSkuBeanList);
+        mAdapter.setEmptyView(emptyView);
+        mAdapter.openLoadAnimation(BaseQuickAdapter.SCALEIN);
+
+        recyclerView.setLayoutManager(new FullyGridLayoutManager(mContext, columnCount, GridLayoutManager.VERTICAL, false));
+        recyclerView.setAdapter(mAdapter);
+
+         mAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
+            @Override
+            public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
+                currentSku = position;
+                confirmGoods();
+            }
+        });
+    }
+
+    public static class FinishWorkAdapter extends BaseQuickAdapter<BoxSkuBean, BaseViewHolder> {
+
+        public FinishWorkAdapter(List<BoxSkuBean> data){
+            super(R.layout.item_sku_img, data);
+        }
+
+
+
+        @Override
+        protected void convert(BaseViewHolder helper, BoxSkuBean item) {
+            //定义setOnItemChildClickListener 事件点击
+            helper.addOnClickListener(R.id.ll_show_img);
+            TextView textView = helper.getView(R.id.tv_name);
+            textView.setText(item.getSku());
+
+
+            ImageView imageView = helper.getView(R.id.iv_show);
+
+            RequestOptions options = new RequestOptions()
+                    .centerCrop()
+                    .placeholder(R.color.color_f6)
+                    .diskCacheStrategy(DiskCacheStrategy.ALL);
+
+            Glide.with(helper.itemView.getContext())
+                    .load(item.getUrl())
+                    .apply(options)
+                    .into(imageView);
+
+        }
+    }
+
+    @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_box_code:
+                checkBox();
+                break;
+            case R.id.et_unit_code:
+
+              
+                break;
+            
+            default:
+        }
+    }
+
+    private void initEdit() {
+
+
+
+        List<EditText> list = new ArrayList<>();
+        list.add(etUnitCode);
+        list.add(etBoxCode);
+        unifyEdit(list);
+        etBoxCode.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 confirmGoods() {
+
+        if (!validate()) {
+            return;
+        }
+
+
+        String postJson = formatParam(2);
+
+        if (!checkRepeat(Urls.FXY_DETECTION_CONFIRM_GOODS + (postJson))) {
+            return;
+        }
+
+        OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_DETECTION_CONFIRM_GOODS).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);
+                                Bundle bundle = new Bundle();
+                                bundle.putString("data",bean.data);
+                                intentPageResult(mActivity, DetectionWorkMainActivity.class, bundle,200);
+                            } else {
+                                etBoxCode.selectAll();
+                                showWarningToast(bean.msg);
+                            }
+
+
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                            XLog.e("请求返回打托信息错误", e.getMessage());
+                        }
+                    }
+                });
+    }
+
+    /**
+     * 检查库位
+     */
+    private void checkBox() {
+        if (!checkNull(etBoxCode)) {
+            setEditTextFocused(etBoxCode, true);
+            showWarningToast(etBoxCode.getHint().toString());
+            return ;
+        }
+
+        String postJson = formatParam(1);
+        if (!checkRepeat(Urls.FXY_DETECTION_BOX_NUMBER + (postJson))) {
+            return;
+        }
+
+        OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_DETECTION_BOX_NUMBER).upJson(postJson)
+                .execute(new MyDialogCallback(this, true, true) {
+                    @Override
+                    public void onSuccess(Response<String> response) {
+                        super.onSuccess(response);
+                        ActionBean bean = JsonUtil.getObject(response.body(), ActionBean.class);
+
+                        try {
+                            if (bean.code == 1) {
+                                showSuccessToast(bean.msg);
+                                etUnitCode.requestFocus();
+                                BoxInfoBean boxInfoBean = JsonUtil.jsonString2Bean(bean.data, BoxInfoBean.class);
+
+                                List<BoxSkuBean> tmpBoxSkuBean = boxInfoBean.getSkuList();
+                                if (boxInfoBean.getPage()==1){
+                                    boxSkuBeanList = tmpBoxSkuBean;
+                                    mAdapter.setNewData(boxSkuBeanList);
+                                }else{
+                                    boxSkuBeanList.containsAll(tmpBoxSkuBean);
+                                    mAdapter.addData(boxSkuBeanList);
+                                }
+                                mAdapter.notifyDataSetChanged();
+                                llHostDiff.setVisibility(View.VISIBLE);
+                            } else {
+                                showWarningToast(bean.msg);
+                            }
+                        } catch (Error e) {
+                            e.printStackTrace();
+                            XLog.e("请求返回箱号检查错误", e.getMessage());
+                        }
+                    }
+                });
+    }
+
+    //检查
+    private void checkHostDiff(HashMap<String, Object> postData){
+
+        if (!validate()) {
+            return;
+        }
+
+        postData.put("box_number", etBoxCode.getText().toString().trim());
+        postData.put("unit_code", etUnitCode.getText().toString().trim());
+        String postJson = (new Gson()).toJson(postData);
+
+        if (!checkRepeat(Urls.FXY_DETECTION_DEAL_DIFF + (postJson))) {
+            return;
+        }
+
+        OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_DETECTION_DEAL_DIFF).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);
+                            JSONObject dataObject = new JSONObject(bean.data);
+                            if (bean.code == 1) {
+                                showSuccessToast(bean.msg);
+
+                                if(dataObject.has("next_step")){
+
+                                    ConfirmGoodsBean  confirmGoodsBean = JsonUtil.jsonString2Bean(bean.data, ConfirmGoodsBean.class);
+                                    confirmGoodsBean.setIsConfirm("1");
+                                    confirmGoodsBean.setUnitCode(etUnitCode.getText().toString().trim());
+                                    Bundle bundle = new Bundle();
+                                    bundle.putString("data",(new Gson()).toJson(confirmGoodsBean));
+                                    bundle.putString("node_code",dataObject.getString("next_step"));
+                                    intentPageResult(mActivity, DetectionWorkMainActivity.class, bundle,200);
+                                }else{
+                                    clearData();
+                                }
+
+
+                            } else {
+
+                                if (dataObject.has("need_confirm") && dataObject.getString("need_confirm").equals("1")){
+                                    listBtn = JsonUtil.jsonString2Beans(dataObject.getString("btns"), BtnInfoBean.class);
+
+                                    confirmDialog = new ConfirmDialog(mContext,listBtn);
+                                    confirmDialog.setOnCallbackListener(new ConfirmDialog.OnCallbackListener() {
+                                        @Override
+                                        public void OnCallback(String value,int position) {
+                                            HashMap<String, Object> postData = new HashMap<>();
+                                            postData.put(listBtn.get(position).getKey(),listBtn.get(position).getValue());
+                                            checkHostDiff(postData);
+                                        }
+                                    });
+                                    confirmDialog.showDialog(bean.msg);
+                                    if (confirmDialog!=null){
+                                        confirmDialog.dismiss();
+                                    }
+                                }else{
+                                    showWarningToast(bean.msg);
+                                }
+
+                            }
+
+
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                            XLog.e("请求返回打托信息错误", e.getMessage());
+                        }
+                    }
+                });
+
+    }
+
+
+    /**
+     * @param type int 1、库位,2、箱号
+     * @return
+     */
+    private String formatParam(int type) {
+        JSONObject jsonObject = new JSONObject();
+        try {
+            jsonObject.put("box_number", etBoxCode.getText().toString().trim());
+            if (type > 1) {
+                jsonObject.put("unit_code", etUnitCode.getText().toString().trim());
+
+                jsonObject.put("goods_id", boxSkuBeanList.get(currentSku).getGoodsId());
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            XLog.e("组装数据失败");
+        }
+        return jsonObject.toString();
+    }
+
+    /*
+     * 校验必录
+     */
+    private boolean validate() {
+
+        if (!checkNull(etUnitCode)) {
+            setEditTextFocused(etUnitCode, true);
+            showWarningToast(etUnitCode.getHint().toString());
+            return false;
+        }
+
+        if (!checkNull(etBoxCode)) {
+            setEditTextFocused(etBoxCode, true);
+            showWarningToast(etBoxCode.getHint().toString());
+            return false;
+        }
+
+        return true;
+    }
+
+
+
+
+    //清除订单信息
+    private void clearData() {
+        etBoxCode.setText("");
+        etUnitCode.setText("");
+
+        setEditTextNormal(etUnitCode, true);
+        setEditTextNormal(etBoxCode, true);
+        llHostDiff.setVisibility(View.GONE);
+        etUnitCode.requestFocus();
+    }
+
+    @OnClick({R.id.btn_host_diff})
+    public void onViewClicked(View view) {
+        Bundle bundle = new Bundle();
+        switch (view.getId()) {
+            case R.id.btn_host_diff:
+                HashMap<String, Object> postData = new HashMap<>();
+                checkHostDiff(postData);
+                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());
+        }
+    }
+
+
+}

+ 671 - 0
app/src/main/java/com/fxy/detection/DetectionConfirmPartsMainActivity.java

@@ -0,0 +1,671 @@
+package com.fxy.detection;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.graphics.Color;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.support.v7.widget.GridLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.util.DisplayMetrics;
+import android.util.TypedValue;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.load.engine.DiskCacheStrategy;
+import com.bumptech.glide.request.RequestOptions;
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
+import com.elvishew.xlog.XLog;
+import com.fxy.R;
+import com.fxy.baselibrary.base.BaseActivity;
+import com.fxy.baselibrary.bean.BaseEventBusBean;
+import com.fxy.baselibrary.interfaces.OnRxScanerListener;
+import com.fxy.baselibrary.util.JsonUtil;
+import com.fxy.baselibrary.views.dialog.RxDialogZoomImageView;
+import com.fxy.bean.ActionBean;
+import com.fxy.bean.ScanBean;
+import com.fxy.constant.BaseConfig;
+import com.fxy.constant.EventCode;
+import com.fxy.detection.bean.BtnInfoBean;
+import com.fxy.detection.bean.ConfirmGoodsBean;
+import com.fxy.detection.bean.ConfirmPartsBean;
+import com.fxy.detection.bean.PartsBean;
+import com.fxy.net.MyDialogCallback;
+import com.fxy.net.Urls;
+import com.fxy.utils.ToolUtils;
+import com.fxy.view.FullyGridLayoutManager;
+import com.google.zxing.Result;
+import com.lzy.okgo.OkGo;
+import com.lzy.okgo.model.Response;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.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 DetectionConfirmPartsMainActivity extends BaseActivity implements StoJNI.ScanCallBack {
+    /**
+     * 列表适配器
+     */
+    Context mContext = this;
+    Activity mActivity = this;
+
+    @BindView(R.id.recyclerview)
+    RecyclerView recyclerView;
+
+
+    @BindView(R.id.ll_btn_center)
+    LinearLayout llBtnCenter;
+
+
+    @BindView(R.id.tv_content)
+    TextView tvContent;
+
+
+    @BindView(R.id.ll_btn_not_center)
+    LinearLayout llBtnNotCenter;
+
+    @BindView(R.id.ll_default)
+    LinearLayout llDefault;
+
+    @BindView(R.id.btn_default)
+    TextView btnDefault;
+
+    //扫码扫码动作
+    private ScanBean scanBean;
+
+    private JSONObject submitData = new JSONObject();
+
+    private ConfirmGoodsBean confirmGoodsBean;
+
+    private ConfirmPartsBean confirmPartsBean;
+
+
+
+    private View errorView;     //错误显示页
+    private View emptyView;     //空显示页
+    /**
+     * 列表适配器
+     */
+    private FinishWorkAdapter mAdapter;
+
+    private List<PartsBean> partsBeanList;
+
+    private boolean isDefault = false;
+
+
+    private float density = 0;
+
+
+    private Unbinder unbinder;
+    
+
+    @Override
+    public int getContentViewResId() {
+        return R.layout.activity_fxy_detection_confirm_parts;
+    }
+
+    @Override
+    public boolean showToolBar() {
+        return true;
+    }
+
+    @Override
+    public boolean openEventBus() {
+        return true;
+    }
+
+    @Override
+    protected void getBundleExtras(Bundle bundle) {
+        confirmGoodsBean = JsonUtil.jsonString2Bean(bundle.getString("data",""),ConfirmGoodsBean.class);
+        confirmPartsBean = JsonUtil.jsonString2Bean(bundle.getString("confirm_parts",""),ConfirmPartsBean.class);
+        partsBeanList = confirmPartsBean.getPartsList();
+    }
+
+    //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("装箱确认");
+        density = ToolUtils.getDensity(this);
+        initAdapter();
+        initData();
+        initEdit();
+    }
+
+
+
+    private void initData() {
+
+        tvContent.setText(confirmPartsBean.getContent());
+        for (int i =0;i<confirmPartsBean.getBtnsQue().size();i++){
+            llBtnCenter.addView(getTextView(confirmPartsBean.getBtnsQue().get(i)));
+        }
+        for (int i =0;i<confirmPartsBean.getBtnsNoQue().size();i++){
+            llBtnNotCenter.addView(getTextView(confirmPartsBean.getBtnsNoQue().get(i)));
+        }
+
+    }
+
+
+    private void setBtnCenter(){
+
+        boolean isSelect = false;
+        for (int i=0;i<partsBeanList.size();i++){
+            if (partsBeanList.get(i).getChecked()){
+                isSelect = true;
+            }
+        }
+
+        if (isDefault){
+
+            llDefault.setVisibility(View.GONE);
+            if (isSelect){
+                llBtnCenter.setVisibility(View.VISIBLE);
+                llBtnNotCenter.setVisibility(View.GONE);
+            }else{
+                llBtnCenter.setVisibility(View.GONE);
+                llBtnNotCenter.setVisibility(View.VISIBLE);
+            }
+
+
+        }else{
+
+
+            llDefault.setVisibility(View.VISIBLE);
+            btnDefault.setText(isSelect?"缺配件":"不缺配件");
+            llBtnCenter.setVisibility(View.GONE);
+            llBtnNotCenter.setVisibility(View.GONE);
+        }
+
+
+    }
+
+    private TextView  getTextView(BtnInfoBean btnInfoBean){
+        TextView textView = new TextView(mContext);
+        textView.setText(btnInfoBean.getTxt());
+        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
+                LinearLayout.LayoutParams.WRAP_CONTENT, // 宽度
+                LinearLayout.LayoutParams.WRAP_CONTENT);// 高度
+
+        int margin = ToolUtils.getDpValue(10,this);
+        layoutParams.setMargins(margin,margin,margin,margin);
+
+
+        textView.setTextSize(TypedValue.COMPLEX_UNIT_SP, 24); // 使用sp单位
+        textView.setLayoutParams(layoutParams);
+        textView.setPadding(margin,margin,margin,margin);
+        textView.setTextColor(getResources().getColor(R.color.white));
+        textView.setBackgroundResource(R.drawable.bg_orange_item);
+        textView.setVisibility(View.VISIBLE);
+        textView.setGravity(View.TEXT_ALIGNMENT_CENTER);
+        textView.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                confirmParts();
+            }
+        });
+        return textView;
+    }
+
+
+    private void initAdapter(){
+
+        int columnCount = 2; // 默认列数
+// 根据屏幕宽度动态调整列数
+        DisplayMetrics displayMetrics = new DisplayMetrics();
+        getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
+        int screenWidth = displayMetrics.widthPixels;
+// 这里可以根据屏幕宽度动态计算列数,例如每列200dp
+        float dpWidth = screenWidth / (displayMetrics.densityDpi / 160f);
+        columnCount = (int) (dpWidth / 200); // 假设每列期望宽度为200dp
+
+        emptyView = this.getLayoutInflater().inflate(R.layout.pager_empty, (ViewGroup) recyclerView.getParent(), false);
+        errorView = this.getLayoutInflater().inflate(R.layout.pager_error, (ViewGroup) recyclerView.getParent(), false);
+
+        mAdapter  = new FinishWorkAdapter(partsBeanList);
+        mAdapter.setEmptyView(emptyView);
+        mAdapter.openLoadAnimation(BaseQuickAdapter.SCALEIN);
+
+        recyclerView.setLayoutManager(new FullyGridLayoutManager(mContext, columnCount, GridLayoutManager.VERTICAL, false));
+        recyclerView.setAdapter(mAdapter);
+
+         mAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
+            @Override
+            public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
+                PartsBean partsBean = partsBeanList.get(position);
+                partsBean.setChecked(!partsBean.getChecked());
+                partsBeanList.set(position,partsBean);
+                adapter.notifyDataSetChanged();
+                isDefault = false;
+                setBtnCenter();
+            }
+        });
+    }
+
+
+    public static class FinishWorkAdapter extends BaseQuickAdapter<PartsBean, BaseViewHolder> {
+
+        public FinishWorkAdapter(List<PartsBean> data){
+            super(R.layout.item_preview_image, data);
+        }
+
+        @Override
+        protected void convert(BaseViewHolder helper, PartsBean item) {
+            //定义setOnItemChildClickListener 事件点击
+
+            helper.addOnClickListener(R.id.cb_select);
+            helper.addOnClickListener(R.id.ivp_img);
+
+
+            ImageView  mImg = helper.getView(R.id.ivp_img);
+            CheckBox cbSelect = helper.getView(R.id.cb_select);
+            TextView tvName = helper.getView(R.id.tv_name);
+
+            tvName.setText(item.getPartsName());
+
+
+            RequestOptions options = new RequestOptions()
+                    .centerCrop()
+                    .placeholder(R.color.color_f6)
+                    .diskCacheStrategy(DiskCacheStrategy.ALL);
+
+            Glide.with(helper.itemView.getContext())
+                    .load(item.getUrl())
+                    .apply(options)
+                    .into(mImg);
+
+            cbSelect.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+                @Override
+                public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+                    RelativeLayout parentLinearLayout = (RelativeLayout) buttonView.getParent();
+
+                    View overlayView =  parentLinearLayout.findViewById(R.id.overlay_view);
+
+                    // 当checkbox1的选中状态改变时执行
+                    if (isChecked) {
+                        overlayView.setVisibility(View.VISIBLE);
+                    } else {
+                        overlayView.setVisibility(View.GONE);
+                    }
+                }
+            });
+
+            mImg.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+
+                    XLog.e("--------setOnClickListener------");
+                    int position = RecyclerView.NO_POSITION;
+                    position = Math.max(position, 0);
+//                List<LocalMedia> mediasList = new ArrayList<>();
+//                for (int i = 0; i < mData.size(); i++) {
+//                    LocalMedia media = new LocalMedia (mData.get(i).getUrl(), 0, PictureConfig.TYPE_IMAGE, "");
+//                    media.setCut(false);
+//                    mediasList.add(media);
+//                }
+//                com.luck.picture.lib.PictureSelector.create(mActivity).externalPicturePreview(position, mediasList);
+
+                    RxDialogZoomImageView rxDialogZoomImageView = new RxDialogZoomImageView(mContext);
+//                rxDialogZoomImageView.setImagePath(mData.get(position));
+                    rxDialogZoomImageView.show();
+
+                }
+            });
+        }
+    }
+
+    @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()) {
+
+            
+            default:
+        }
+    }
+
+    private void initEdit() {
+
+
+ 
+    }
+
+    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 boolean validate() {
+
+        try {
+            submitData.put("box_number",confirmGoodsBean.getBoxNumber());
+            submitData.put("goods_id",confirmGoodsBean.getGoodsId());
+            submitData.put("unit_code",confirmGoodsBean.getUnitCode());
+            submitData.put("node_code",confirmGoodsBean.getNodeCode());
+            submitData.put("tan_kuang",1);
+
+            JSONArray steps = new JSONArray();
+
+            for (int i=0;i<partsBeanList.size();i++){
+                JSONObject item = new JSONObject();
+                item.put("node_code",confirmGoodsBean.getNodeCode());
+                item.put("attr_id",partsBeanList.get(i).getPartsId());
+                steps.put(item);
+            }
+
+            submitData.put("steps",steps);
+
+
+
+
+        } catch (JSONException e) {
+            e.printStackTrace();
+            showErrorToast(e.getMessage());
+            return false;
+        }
+
+
+        return true;
+    }
+
+    /**
+     * 检查打托信息
+     */
+    private void confirmParts() {
+
+        if (!validate()){
+            return;
+        }
+
+
+        String postJson = submitData.toString();;
+        if (!checkRepeat(Urls.FXY_DETECTION_COMPLETED + (postJson))) {
+            return;
+        }
+        OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_DETECTION_COMPLETED).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);
+                                Intent intent = new Intent();
+                                setResult(200, intent);//返回值,200 是改返回的标志,也会返回
+                                finish();
+
+                            } else {
+                                showWarningToast(bean.msg);
+                            }
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                            XLog.e("请求返回打托信息错误", e.getMessage());
+                        }
+                    }
+                });
+
+
+    }
+
+
+    //清除订单信息
+    private void clearData() {
+
+    }
+
+    @OnClick({R.id.btn_default})
+    public void onViewClicked(View view) {
+        Bundle bundle = new Bundle();
+        switch (view.getId()) {
+            case R.id.btn_default:
+                isDefault = true;
+                setBtnCenter();
+                break;
+            default:
+                break;
+        }
+    }
+
+
+
+    @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());
+        }
+    }
+
+
+}

+ 510 - 0
app/src/main/java/com/fxy/detection/DetectionDealDiffMainActivity.java

@@ -0,0 +1,510 @@
+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.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.util.JsonUtil;
+import com.fxy.baselibrary.views.MarqueeTextView;
+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.detection.bean.DealDiffBean;
+import com.fxy.detection.bean.NeedPhotoBean;
+import com.fxy.net.MyDialogCallback;
+import com.fxy.net.Urls;
+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.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+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 DetectionDealDiffMainActivity extends BaseActivity implements StoJNI.ScanCallBack {
+    /**
+     * 列表适配器
+     */
+    Context mContext = this;
+
+
+    @BindView(R.id.mt_box_number)
+    MarqueeTextView mtBoxNumber;
+
+    @BindView(R.id.mt_unit_code)
+    MarqueeTextView mtUnitCode;
+
+    @BindView(R.id.recyclerview)
+    RecyclerView recyclerView;
+
+    @BindView(R.id.ll_recycler_view)
+    LinearLayout llRecyclerView;
+
+
+    private DealDiffBean dealDiffBean = new DealDiffBean();
+    private List<NeedPhotoBean> listNeedPhoto  = new ArrayList<>();
+
+    //节点
+    private String nodeCode = "";
+
+    //定义文件上传
+    private HashMap<Integer,PictureSelectorUpload> mapPictureSelector = new HashMap<>();
+    private int currentPictureInx = -1;
+
+    //提交数据
+    private JSONObject submitData = new JSONObject();
+
+    private Unbinder unbinder;
+
+    private ScanBean scanBean;
+
+    @Override
+    public int getContentViewResId() {
+        return R.layout.activity_fxy_detection_deal_diff;
+    }
+
+    @Override
+    public boolean showToolBar() {
+        return true;
+    }
+
+    @Override
+    public boolean openEventBus() {
+        return true;
+    }
+
+    @Override
+    protected void getBundleExtras(Bundle bundle) {
+
+        dealDiffBean = JsonUtil.jsonString2Bean(bundle.getString("data"),DealDiffBean.class);
+
+    }
+
+    //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 || requestCode == PictureConfig.REQUEST_CAMERA) {
+                PictureSelectorUpload filedUpload = mapPictureSelector.get(currentPictureInx);
+                if (filedUpload != null){
+                    filedUpload.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("主机差异");
+        initData();
+    }
+
+
+
+    private void initData() {
+        nodeCode = dealDiffBean.getNodeCode();
+
+        mtBoxNumber.setText(dealDiffBean.getBoxNumber());
+        mtUnitCode.setText(dealDiffBean.getUnitCode());
+        listNeedPhoto = dealDiffBean.getNeedPhotos();
+
+
+        if (listNeedPhoto!=null){
+            for (int i=0;i<listNeedPhoto.size();i++){
+                addPictureSelectorUpload(i,listNeedPhoto.get(i).getLimit());
+            }
+        }
+
+    }
+
+    /**
+     *
+     * @param position int 遍历添加
+     */
+    private void addPictureSelectorUpload(int position,int limit){
+        String tagKey = "recyclerview"+position;
+        View itemPictureSelector = View.inflate(mContext, R.layout.item_picture_selector, null);
+        TextView tvPicturesTitle =   itemPictureSelector.findViewById(R.id.tv_pictures_title);
+        tvPicturesTitle.setText(listNeedPhoto.get(position).getFieldKey());
+        RecyclerView rvLabelShowImg = (RecyclerView)itemPictureSelector.findViewById(R.id.recyclerview);
+        itemPictureSelector.setTag(tagKey);
+        llRecyclerView.addView(itemPictureSelector);
+        PictureSelectorUpload tmpPictureSelector  = setItemPicture(String.valueOf(position),rvLabelShowImg,limit,PictureConfig.TYPE_IMAGE);
+        mapPictureSelector.put(position,tmpPictureSelector);
+    }
+
+    /**
+     * 设置多个上传文件
+     * @param actionType String
+     * @param showImg RecyclerView
+     */
+    private PictureSelectorUpload setItemPicture(String actionType,RecyclerView showImg,int maxNum,int pictureType){
+        PictureSelectorUpload pictureUpload = new PictureSelectorUpload(DetectionDealDiffMainActivity.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);
+                currentPictureInx = Integer.parseInt(actionType);
+            }
+        });
+        return  pictureUpload;
+    }
+
+    @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()) {
+            default:
+        }
+    }
+
+    private void initEdit() {
+
+    }
+
+    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 doConfirm() {
+        if (!validate()) {
+            return;
+        }
+
+        String postJson = submitData.toString();
+        if (!checkRepeat(Urls.FXY_DETECTION_COMPLETED + (postJson))) {
+            return;
+        }
+        OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_DETECTION_COMPLETED).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);
+                                finish();
+                            } else {
+                                showWarningToast(bean.msg);
+                            }
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                            XLog.e("请求返回信息错误", e.getMessage());
+                        }
+                    }
+                });
+    }
+
+
+    /*
+     * 校验必录
+     */
+    private boolean validate() {
+
+        try {
+            submitData.put("box_number",dealDiffBean.getBoxNumber());
+            submitData.put("goods_id","");
+            submitData.put("unit_code",dealDiffBean.getUnitCode());
+
+            JSONArray steps = new JSONArray();
+            if (listNeedPhoto!=null && listNeedPhoto.size()>0){
+                for (int i=0;i<listNeedPhoto.size();i++){
+                    JSONObject item = new JSONObject();
+                    ArrayList<String> urlList = mapPictureSelector.get(i).getPhotoList();
+                    String fieldKey = listNeedPhoto.get(i).getFieldKey();
+                    if (urlList.size()==0){
+                        showErrorToast(fieldKey+"需要拍照");
+                        return  false;
+                    }
+                    item.put("node_code",nodeCode);
+                    item.put("attr_id","");
+                    item.put("field_key",fieldKey);
+                    item.put("url",(new Gson()).toJson(urlList));
+                    steps.put(i,item);
+                }
+            }
+        } catch (JSONException e) {
+            e.printStackTrace();
+            showErrorToast(e.getMessage());
+            return false;
+        }
+
+
+        return true;
+    }
+
+
+
+    @OnClick({R.id.btn_confirm})
+    public void onViewClicked(View view) {
+        Bundle bundle = new Bundle();
+        switch (view.getId()) {
+            case R.id.btn_confirm:
+                doConfirm();
+                break;
+            default:
+                break;
+        }
+    }
+
+
+    @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());
+        }
+    }
+
+
+}

+ 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_img",gson.toJson(labelPhotoList));
+            postParam.put("weight_img",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());
+        }
+    }
+
+}

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

@@ -0,0 +1,602 @@
+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();
+                etBoxCode.requestFocus();
+                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_number", 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());
+        }
+    }
+
+
+}

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 1238 - 0
app/src/main/java/com/fxy/detection/DetectionWorkMainActivity.java


+ 148 - 0
app/src/main/java/com/fxy/detection/bean/BaseBean.java

@@ -0,0 +1,148 @@
+package com.fxy.detection.bean;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class BaseBean implements Parcelable  {
+
+    private String box_number = ""; //
+    private String goods_id = ""; //
+    private String unit_code = ""; //
+    private String node_code = ""; //
+    private String node_name = ""; //
+    private String options_type = "radio"; //
+    private String result = ""; //
+    private List<OptionsBean> options = new ArrayList<>(); //
+    private List<NeedPhotoBean> need_photos = new ArrayList<>(); //
+    private SuspendBean zhong_duan = new SuspendBean(); //
+
+    public BaseBean(){
+
+    }
+
+
+    protected BaseBean(Parcel in) {
+        box_number = in.readString();
+        goods_id = in.readString();
+        unit_code = in.readString();
+        node_code = in.readString();
+        node_name = in.readString();
+        options_type = in.readString();
+        result = in.readString();
+        options = in.createTypedArrayList(OptionsBean.CREATOR);
+        need_photos = in.createTypedArrayList(NeedPhotoBean.CREATOR);
+    }
+
+    @Override
+    public void writeToParcel(Parcel dest, int flags) {
+        dest.writeString(box_number);
+        dest.writeString(goods_id);
+        dest.writeString(unit_code);
+        dest.writeString(node_code);
+        dest.writeString(node_name);
+        dest.writeString(options_type);
+        dest.writeString(result);
+        dest.writeTypedList(options);
+        dest.writeTypedList(need_photos);
+    }
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    public static final Creator<BaseBean> CREATOR = new Creator<BaseBean>() {
+        @Override
+        public BaseBean createFromParcel(Parcel in) {
+            return new BaseBean(in);
+        }
+
+        @Override
+        public BaseBean[] newArray(int size) {
+            return new BaseBean[size];
+        }
+    };
+
+    public String getBoxNumber() {
+        return box_number;
+    }
+
+    public void setBoxNumber(String box_number) {
+        this.box_number = box_number;
+    }
+
+    public String getGoodsId() {
+        return goods_id;
+    }
+
+    public void setGoodsId(String goods_id) {
+        this.goods_id = goods_id;
+    }
+
+    public String getUnitCode() {
+        return unit_code;
+    }
+
+    public void setUnitCode(String unit_code) {
+        this.unit_code = unit_code;
+    }
+
+    public String getNodeCode() {
+        return node_code;
+    }
+
+    public void setNodeCode(String node_code) {
+        this.node_code = node_code;
+    }
+
+    public String getOptionsType() {
+        return options_type;
+    }
+
+    public void setOptionsType(String options_type) {
+        this.options_type = options_type;
+    }
+
+    public String getResult() {
+        return result;
+    }
+
+    public void setResult(String result) {
+        this.result = result;
+    }
+
+    public List<OptionsBean> getOptions() {
+        return options;
+    }
+
+    public void setOptions(List<OptionsBean> options) {
+        this.options = options;
+    }
+
+    public List<NeedPhotoBean> getNeedPhotos() {
+        return need_photos;
+    }
+
+    public void setNeedPhotos(List<NeedPhotoBean> need_photos) {
+        this.need_photos = need_photos;
+    }
+
+    public SuspendBean getZhongDuan() {
+        return zhong_duan;
+    }
+
+    public void setZhongDuan(SuspendBean zhong_duan) {
+        this.zhong_duan = zhong_duan;
+    }
+
+    public String getNodeName() {
+        return node_name;
+    }
+
+    public void setNodeName(String node_name) {
+        this.node_name = node_name;
+    }
+}

+ 86 - 0
app/src/main/java/com/fxy/detection/bean/BoxInfoBean.java

@@ -0,0 +1,86 @@
+package com.fxy.detection.bean;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class BoxInfoBean implements Parcelable {
+    private String box_number; //
+    private List<BoxSkuBean> sku_list = new ArrayList<>(); //
+    private int page = 1;
+    private int limit = 6;
+
+    public BoxInfoBean() {
+        // 可以在这里进行初始化,但通常对于反序列化来说不需要
+    }
+
+    public String getBoxNumber() {
+        return box_number;
+    }
+
+    public void setBoxNumber(String box_number) {
+        this.box_number = box_number;
+    }
+
+    public List<BoxSkuBean> getSkuList() {
+        return sku_list;
+    }
+
+    public void setSkuList(List<BoxSkuBean> sku_list) {
+        this.sku_list = sku_list;
+    }
+
+    public int getPage() {
+        return page;
+    }
+
+    public void setPage(int page) {
+        this.page = page;
+    }
+
+    public int getLimit() {
+        return limit;
+    }
+
+    public void setLimit(int limit) {
+        this.limit = limit;
+    }
+
+    public static Creator<BoxInfoBean> getCREATOR() {
+        return CREATOR;
+    }
+
+    protected BoxInfoBean(Parcel in) {
+        box_number = in.readString();
+        sku_list = in.createTypedArrayList(BoxSkuBean.CREATOR);
+        page = in.readInt();
+        limit = in.readInt();
+    }
+
+    @Override
+    public void writeToParcel(Parcel dest, int flags) {
+        dest.writeString(box_number);
+        dest.writeTypedList(sku_list);
+        dest.writeInt(page);
+        dest.writeInt(limit);
+    }
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    public static final Creator<BoxInfoBean> CREATOR = new Creator<BoxInfoBean>() {
+        @Override
+        public BoxInfoBean createFromParcel(Parcel in) {
+            return new BoxInfoBean(in);
+        }
+
+        @Override
+        public BoxInfoBean[] newArray(int size) {
+            return new BoxInfoBean[size];
+        }
+    };
+}

+ 116 - 0
app/src/main/java/com/fxy/detection/bean/BoxSkuBean.java

@@ -0,0 +1,116 @@
+package com.fxy.detection.bean;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class BoxSkuBean  implements Parcelable {
+    private String goods_id = ""; //
+    private String sku = ""; //
+    private String file_name = ""; //
+    private String url = ""; //
+    private String remark = ""; //
+    private String need_photo = ""; //
+    private String type = ""; //
+
+    public BoxSkuBean(){
+
+    }
+
+    public String getGoodsId() {
+        return goods_id;
+    }
+
+    public void setGoodsId(String goods_id) {
+        this.goods_id = goods_id;
+    }
+
+    public String getSku() {
+        return sku;
+    }
+
+    public void setSku(String sku) {
+        this.sku = sku;
+    }
+
+    public String getFileName() {
+        return file_name;
+    }
+
+    public void setFileName(String file_name) {
+        this.file_name = file_name;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    public String getNeedPhoto() {
+        return need_photo;
+    }
+
+    public void setNeedPhoto(String need_photo) {
+        this.need_photo = need_photo;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public static Creator<BoxSkuBean> getCREATOR() {
+        return CREATOR;
+    }
+
+    protected BoxSkuBean(Parcel in) {
+        goods_id = in.readString();
+        sku = in.readString();
+        file_name = in.readString();
+        url = in.readString();
+        remark = in.readString();
+        need_photo = in.readString();
+        type = in.readString();
+    }
+
+    public static final Creator<BoxSkuBean> CREATOR = new Creator<BoxSkuBean>() {
+        @Override
+        public BoxSkuBean createFromParcel(Parcel in) {
+            return new BoxSkuBean(in);
+        }
+
+        @Override
+        public BoxSkuBean[] newArray(int size) {
+            return new BoxSkuBean[size];
+        }
+    };
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    @Override
+    public void writeToParcel(Parcel parcel, int i) {
+        parcel.writeString(goods_id);
+        parcel.writeString(sku);
+        parcel.writeString(file_name);
+        parcel.writeString(url);
+        parcel.writeString(remark);
+        parcel.writeString(need_photo);
+        parcel.writeString(type);
+    }
+}

+ 109 - 0
app/src/main/java/com/fxy/detection/bean/BtnInfoBean.java

@@ -0,0 +1,109 @@
+package com.fxy.detection.bean;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class BtnInfoBean implements Parcelable{
+    private String key = "";
+    private String value = "";
+    private String txt = "";
+    private String tip = "";
+    private List<NeedPhotoBean> need_photos = new ArrayList<>();
+    private Boolean checked = false;
+
+    public BtnInfoBean(){
+
+    }
+
+
+    protected BtnInfoBean(Parcel in) {
+        key = in.readString();
+        value = in.readString();
+        txt = in.readString();
+        tip = in.readString();
+        need_photos = in.createTypedArrayList(NeedPhotoBean.CREATOR);
+        byte tmpChecked = in.readByte();
+        checked = tmpChecked == 0 ? null : tmpChecked == 1;
+    }
+
+    @Override
+    public void writeToParcel(Parcel dest, int flags) {
+        dest.writeString(key);
+        dest.writeString(value);
+        dest.writeString(txt);
+        dest.writeString(tip);
+        dest.writeTypedList(need_photos);
+        dest.writeByte((byte) (checked == null ? 0 : checked ? 1 : 2));
+    }
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    public static final Creator<BtnInfoBean> CREATOR = new Creator<BtnInfoBean>() {
+        @Override
+        public BtnInfoBean createFromParcel(Parcel in) {
+            return new BtnInfoBean(in);
+        }
+
+        @Override
+        public BtnInfoBean[] newArray(int size) {
+            return new BtnInfoBean[size];
+        }
+    };
+
+    public String getKey() {
+        return key;
+    }
+
+    public void setKey(String key) {
+        this.key = key;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    public String getTxt() {
+        return txt;
+    }
+
+    public void setTxt(String txt) {
+        this.txt = txt;
+    }
+
+    public String getTip() {
+        return tip;
+    }
+
+    public BtnInfoBean setTip(String tip) {
+        this.tip = tip;
+        return this;
+    }
+
+    public List<NeedPhotoBean> getNeedPhotos() {
+        return need_photos;
+    }
+
+    public BtnInfoBean setNeedPhotos(List<NeedPhotoBean> need_photos) {
+        this.need_photos = need_photos;
+        return this;
+    }
+
+    public Boolean getChecked() {
+        return checked;
+    }
+
+    public BtnInfoBean setChecked(Boolean checked) {
+        this.checked = checked;
+        return this;
+    }
+}

+ 114 - 0
app/src/main/java/com/fxy/detection/bean/ConfirmGoodsBean.java

@@ -0,0 +1,114 @@
+package com.fxy.detection.bean;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class ConfirmGoodsBean implements Parcelable {
+
+    private String box_number = ""; //
+    private String goods_id = ""; //
+    private String unit_code = ""; //
+    private String node_code = ""; //
+    private String node_name = ""; //
+    private String result = ""; //
+    private String is_confirm = "";
+
+    public ConfirmGoodsBean(){
+
+    }
+
+
+    protected ConfirmGoodsBean(Parcel in) {
+        box_number = in.readString();
+        goods_id = in.readString();
+        unit_code = in.readString();
+        node_code = in.readString();
+        node_name = in.readString();
+        result = in.readString();
+        is_confirm = in.readString();
+    }
+
+    @Override
+    public void writeToParcel(Parcel dest, int flags) {
+        dest.writeString(box_number);
+        dest.writeString(goods_id);
+        dest.writeString(unit_code);
+        dest.writeString(node_code);
+        dest.writeString(node_name);
+        dest.writeString(result);
+        dest.writeString(is_confirm);
+    }
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    public static final Creator<ConfirmGoodsBean> CREATOR = new Creator<ConfirmGoodsBean>() {
+        @Override
+        public ConfirmGoodsBean createFromParcel(Parcel in) {
+            return new ConfirmGoodsBean(in);
+        }
+
+        @Override
+        public ConfirmGoodsBean[] newArray(int size) {
+            return new ConfirmGoodsBean[size];
+        }
+    };
+
+    public String getBoxNumber() {
+        return box_number;
+    }
+
+    public void setBoxNumber(String box_number) {
+        this.box_number = box_number;
+    }
+
+    public String getGoodsId() {
+        return goods_id;
+    }
+
+    public void setGoodsId(String goods_id) {
+        this.goods_id = goods_id;
+    }
+
+    public String getUnitCode() {
+        return unit_code;
+    }
+
+    public void setUnitCode(String unit_code) {
+        this.unit_code = unit_code;
+    }
+
+    public String getNodeCode() {
+        return node_code;
+    }
+
+    public void setNodeCode(String node_code) {
+        this.node_code = node_code;
+    }
+
+    public String getResult() {
+        return result;
+    }
+
+    public void setResult(String result) {
+        this.result = result;
+    }
+
+    public String getNodeName() {
+        return node_name;
+    }
+
+    public void setNodeName(String node_name) {
+        this.node_name = node_name;
+    }
+
+    public String getIsConfirm() {
+        return is_confirm;
+    }
+
+    public void setIsConfirm(String is_confirm) {
+        this.is_confirm = is_confirm;
+    }
+}

+ 82 - 0
app/src/main/java/com/fxy/detection/bean/ConfirmPartsBean.java

@@ -0,0 +1,82 @@
+package com.fxy.detection.bean;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ConfirmPartsBean implements Parcelable {
+    private String content="";
+    private List<PartsBean> parts_list = new ArrayList<>();
+    private List<BtnInfoBean> btns_que = new ArrayList<>();
+    private List<BtnInfoBean> btns_no_que = new ArrayList<>();
+
+    public ConfirmPartsBean(){
+
+    }
+
+    protected ConfirmPartsBean(Parcel in) {
+        content = in.readString();
+        parts_list = in.createTypedArrayList(PartsBean.CREATOR);
+        btns_que = in.createTypedArrayList(BtnInfoBean.CREATOR);
+        btns_no_que = in.createTypedArrayList(BtnInfoBean.CREATOR);
+    }
+
+    @Override
+    public void writeToParcel(Parcel dest, int flags) {
+        dest.writeString(content);
+        dest.writeTypedList(parts_list);
+        dest.writeTypedList(btns_que);
+        dest.writeTypedList(btns_no_que);
+    }
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    public static final Creator<ConfirmPartsBean> CREATOR = new Creator<ConfirmPartsBean>() {
+        @Override
+        public ConfirmPartsBean createFromParcel(Parcel in) {
+            return new ConfirmPartsBean(in);
+        }
+
+        @Override
+        public ConfirmPartsBean[] newArray(int size) {
+            return new ConfirmPartsBean[size];
+        }
+    };
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public List<PartsBean> getPartsList() {
+        return parts_list;
+    }
+
+    public void setPartsList(List<PartsBean> parts_list) {
+        this.parts_list = parts_list;
+    }
+
+    public List<BtnInfoBean> getBtnsQue() {
+        return btns_que;
+    }
+
+    public void setBtnsQue(List<BtnInfoBean> btns_que) {
+        this.btns_que = btns_que;
+    }
+
+    public List<BtnInfoBean> getBtnsNoQue() {
+        return btns_no_que;
+    }
+
+    public void setBtnsNoQue(List<BtnInfoBean> btns_no_que) {
+        this.btns_no_que = btns_no_que;
+    }
+}

+ 100 - 0
app/src/main/java/com/fxy/detection/bean/DealDiffBean.java

@@ -0,0 +1,100 @@
+package com.fxy.detection.bean;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 处理主机查验bean
+ */
+public class DealDiffBean implements Parcelable  {
+
+    private String box_number = ""; //
+    private String unit_code = ""; //
+    private String node_code = ""; //
+    private String result = ""; //
+    private List<NeedPhotoBean> need_photos = new ArrayList<>(); //
+    public DealDiffBean(){
+    }
+
+
+    protected DealDiffBean(Parcel in) {
+        box_number = in.readString();
+        unit_code = in.readString();
+        node_code = in.readString();
+        result = in.readString();
+        need_photos = in.createTypedArrayList(NeedPhotoBean.CREATOR);
+    }
+
+    @Override
+    public void writeToParcel(Parcel dest, int flags) {
+        dest.writeString(box_number);
+        dest.writeString(unit_code);
+        dest.writeString(node_code);
+        dest.writeString(result);
+        dest.writeTypedList(need_photos);
+    }
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    public static final Creator<DealDiffBean> CREATOR = new Creator<DealDiffBean>() {
+        @Override
+        public DealDiffBean createFromParcel(Parcel in) {
+            return new DealDiffBean(in);
+        }
+
+        @Override
+        public DealDiffBean[] newArray(int size) {
+            return new DealDiffBean[size];
+        }
+    };
+
+    public String getBoxNumber() {
+        return box_number;
+    }
+
+    public void setBoxNumber(String box_number) {
+        this.box_number = box_number;
+    }
+
+
+    public String getUnitCode() {
+        return unit_code;
+    }
+
+    public void setUnitCode(String unit_code) {
+        this.unit_code = unit_code;
+    }
+
+    public String getNodeCode() {
+        return node_code;
+    }
+
+    public void setNodeCode(String node_code) {
+        this.node_code = node_code;
+    }
+
+
+
+    public String getResult() {
+        return result;
+    }
+
+    public void setResult(String result) {
+        this.result = result;
+    }
+
+
+    public List<NeedPhotoBean> getNeedPhotos() {
+        return need_photos;
+    }
+
+    public void setNeedPhotos(List<NeedPhotoBean> need_photos) {
+        this.need_photos = need_photos;
+    }
+}

+ 57 - 0
app/src/main/java/com/fxy/detection/bean/NeedPhotoBean.java

@@ -0,0 +1,57 @@
+package com.fxy.detection.bean;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class NeedPhotoBean implements Parcelable {
+    private String field_key = "";
+    private int limit = 1;
+
+    public NeedPhotoBean(){
+
+    }
+
+    protected NeedPhotoBean(Parcel in) {
+        field_key = in.readString();
+        limit = in.readInt();
+    }
+
+    @Override
+    public void writeToParcel(Parcel dest, int flags) {
+        dest.writeString(field_key);
+        dest.writeInt(limit);
+    }
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    public static final Creator<NeedPhotoBean> CREATOR = new Creator<NeedPhotoBean>() {
+        @Override
+        public NeedPhotoBean createFromParcel(Parcel in) {
+            return new NeedPhotoBean(in);
+        }
+
+        @Override
+        public NeedPhotoBean[] newArray(int size) {
+            return new NeedPhotoBean[size];
+        }
+    };
+
+    public String getFieldKey() {
+        return field_key;
+    }
+
+    public void setFieldKey(String field_key) {
+        this.field_key = field_key;
+    }
+
+    public int getLimit() {
+        return limit;
+    }
+
+    public void setLimit(int limit) {
+        this.limit = limit;
+    }
+}

+ 166 - 0
app/src/main/java/com/fxy/detection/bean/OptionsBean.java

@@ -0,0 +1,166 @@
+package com.fxy.detection.bean;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class OptionsBean implements Parcelable {
+    private String type = ""; //
+    private String attr_id = ""; //
+    private String title = ""; //
+    private String content = ""; //
+    private String result = ""; //
+    private String tip = ""; //
+    private String name = ""; //
+
+    private List<NeedPhotoBean> need_photo = new ArrayList<>(); //
+    private List<RepairConfirmBean> confirm = new ArrayList<>(); //
+    private List<BtnInfoBean> btns = new ArrayList<>(); //
+
+    private Boolean checked = false;
+
+
+    public OptionsBean() {
+
+    }
+
+
+    protected OptionsBean(Parcel in) {
+        type = in.readString();
+        attr_id = in.readString();
+        title = in.readString();
+        content = in.readString();
+        result = in.readString();
+        tip = in.readString();
+        name = in.readString();
+        need_photo = in.createTypedArrayList(NeedPhotoBean.CREATOR);
+        confirm = in.createTypedArrayList(RepairConfirmBean.CREATOR);
+        btns = in.createTypedArrayList(BtnInfoBean.CREATOR);
+        byte tmpChecked = in.readByte();
+        checked = tmpChecked == 0 ? null : tmpChecked == 1;
+    }
+
+    @Override
+    public void writeToParcel(Parcel dest, int flags) {
+        dest.writeString(type);
+        dest.writeString(attr_id);
+        dest.writeString(title);
+        dest.writeString(content);
+        dest.writeString(result);
+        dest.writeString(tip);
+        dest.writeString(name);
+        dest.writeTypedList(need_photo);
+        dest.writeTypedList(confirm);
+        dest.writeTypedList(btns);
+        dest.writeByte((byte) (checked == null ? 0 : checked ? 1 : 2));
+    }
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    public static final Creator<OptionsBean> CREATOR = new Creator<OptionsBean>() {
+        @Override
+        public OptionsBean createFromParcel(Parcel in) {
+            return new OptionsBean(in);
+        }
+
+        @Override
+        public OptionsBean[] newArray(int size) {
+            return new OptionsBean[size];
+        }
+    };
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getAttrId() {
+        return attr_id;
+    }
+
+    public void setAttrId(String attr_id) {
+        this.attr_id = attr_id;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public String getResult() {
+        return result;
+    }
+
+    public void setResult(String result) {
+        this.result = result;
+    }
+
+    public List<NeedPhotoBean> getNeedPhoto() {
+        return need_photo;
+    }
+
+    public void setNeedPhoto(List<NeedPhotoBean> need_photo) {
+        this.need_photo = need_photo;
+    }
+
+    public List<RepairConfirmBean> getConfirm() {
+        return confirm;
+    }
+
+    public void setConfirm(List<RepairConfirmBean> confirm) {
+        this.confirm = confirm;
+    }
+
+    public List<BtnInfoBean> getBtns() {
+        return btns;
+    }
+
+    public void setBtns(List<BtnInfoBean> btns) {
+        this.btns = btns;
+    }
+
+    public Boolean getChecked() {
+        return checked;
+    }
+
+    public void setChecked(Boolean checked) {
+        this.checked = checked;
+    }
+
+    public String getTip() {
+        return tip;
+    }
+
+    public OptionsBean setTip(String tip) {
+        this.tip = tip;
+        return this;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public OptionsBean setName(String name) {
+        this.name = name;
+        return this;
+    }
+}

+ 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];
+        }
+    };
+
+
+}

+ 82 - 0
app/src/main/java/com/fxy/detection/bean/PartsBean.java

@@ -0,0 +1,82 @@
+package com.fxy.detection.bean;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class PartsBean implements Parcelable {
+    private String parts_id="";
+    private String parts_name="";
+    private String url="";
+    private Boolean checked = false;
+
+
+    public PartsBean(){
+
+    }
+
+
+    protected PartsBean(Parcel in) {
+        parts_id = in.readString();
+        parts_name = in.readString();
+        url = in.readString();
+        byte tmpChecked = in.readByte();
+        checked = tmpChecked == 0 ? null : tmpChecked == 1;
+    }
+
+    @Override
+    public void writeToParcel(Parcel dest, int flags) {
+        dest.writeString(parts_id);
+        dest.writeString(parts_name);
+        dest.writeString(url);
+        dest.writeByte((byte) (checked == null ? 0 : checked ? 1 : 2));
+    }
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    public static final Creator<PartsBean> CREATOR = new Creator<PartsBean>() {
+        @Override
+        public PartsBean createFromParcel(Parcel in) {
+            return new PartsBean(in);
+        }
+
+        @Override
+        public PartsBean[] newArray(int size) {
+            return new PartsBean[size];
+        }
+    };
+
+    public String getPartsId() {
+        return parts_id;
+    }
+
+    public void setPartsId(String parts_id) {
+        this.parts_id = parts_id;
+    }
+
+    public String getPartsName() {
+        return parts_name;
+    }
+
+    public void setPartsName(String parts_name) {
+        this.parts_name = parts_name;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public void setUrl(String url) {
+        this.url = url;
+    }
+
+    public Boolean getChecked() {
+        return checked;
+    }
+
+    public void setChecked(Boolean checked) {
+        this.checked = checked;
+    }
+}

+ 59 - 0
app/src/main/java/com/fxy/detection/bean/RepairConfirmBean.java

@@ -0,0 +1,59 @@
+package com.fxy.detection.bean;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class RepairConfirmBean implements Parcelable {
+
+    private String name = "";
+    private String txt = "";
+
+    public RepairConfirmBean(){
+
+    }
+
+
+    protected RepairConfirmBean(Parcel in) {
+        name = in.readString();
+        txt = in.readString();
+    }
+
+    @Override
+    public void writeToParcel(Parcel dest, int flags) {
+        dest.writeString(name);
+        dest.writeString(txt);
+    }
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    public static final Creator<RepairConfirmBean> CREATOR = new Creator<RepairConfirmBean>() {
+        @Override
+        public RepairConfirmBean createFromParcel(Parcel in) {
+            return new RepairConfirmBean(in);
+        }
+
+        @Override
+        public RepairConfirmBean[] newArray(int size) {
+            return new RepairConfirmBean[size];
+        }
+    };
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getTxt() {
+        return txt;
+    }
+
+    public void setTxt(String txt) {
+        this.txt = txt;
+    }
+}

+ 70 - 0
app/src/main/java/com/fxy/detection/bean/SuspendBean.java

@@ -0,0 +1,70 @@
+package com.fxy.detection.bean;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class SuspendBean implements Parcelable {
+    private String type;
+    private String content;
+    private List<BtnInfoBean> btns = new ArrayList<>(); //
+
+    public SuspendBean(){
+
+    }
+    protected SuspendBean(Parcel in) {
+        type = in.readString();
+        content = in.readString();
+        btns = in.createTypedArrayList(BtnInfoBean.CREATOR);
+    }
+
+    @Override
+    public void writeToParcel(Parcel dest, int flags) {
+        dest.writeString(type);
+        dest.writeString(content);
+        dest.writeTypedList(btns);
+    }
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    public static final Creator<SuspendBean> CREATOR = new Creator<SuspendBean>() {
+        @Override
+        public SuspendBean createFromParcel(Parcel in) {
+            return new SuspendBean(in);
+        }
+
+        @Override
+        public SuspendBean[] newArray(int size) {
+            return new SuspendBean[size];
+        }
+    };
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public List<BtnInfoBean> getBtns() {
+        return btns;
+    }
+
+    public void setBtns(List<BtnInfoBean> btns) {
+        this.btns = btns;
+    }
+}

+ 1 - 1
app/src/main/java/com/fxy/login/LoginActivity.java

@@ -303,7 +303,7 @@ public class LoginActivity extends BaseActivity {
 
                 if (isCanLogin()) {
                     login(mLogEtName.getText().toString().trim(),mLogEtPwd.getText().toString().trim());
-//                    AlertDialog.Builder builder = new AlertDialog.Builder(this);
+//                    ConfirmDialog.Builder builder = new ConfirmDialog.Builder(this);
 //                    builder.setView(captchaView);
 //                    if(capchatDialog != null){
 //                        capchatDialog.show();

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

@@ -7,71 +7,41 @@ import android.os.Bundle;
 import android.support.annotation.Nullable;
 import android.support.v4.app.ActivityCompat;
 import android.support.v4.content.ContextCompat;
-import android.support.v7.widget.LinearLayoutManager;
-import android.view.Gravity;
 import android.view.View;
 import android.view.ViewGroup;
-import android.widget.ImageView;
 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.elvishew.xlog.XLog;
 import com.fxy.constant.SPCache;
+import com.fxy.detection.DetectionConfirmGoodsMainActivity;
+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.hk.HkOutboundMainActivity;
 import com.fxy.hk.HkPickupStartMainActivity;
 import com.fxy.hk.HkPutinMainActivity;
 import com.fxy.hk.HkTrayLocationMainActivity;
 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.PutinPalletMainActivity;
 import com.fxy.putIn.PutinPhotosMainActivity;
-import com.fxy.putIn.SortationMainActivity;
 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.QualityInspectionMainActivity;
-import com.fxy.realm.CutRuleRealm;
-import com.fxy.realm.HkTransRealm;
 import com.fxy.tool.OrderToolMainActivity;
 import com.fxy.workOrder.StartWorkOrderMainActivity;
 import com.fxy.workOrder.WorkOrderOptMainActivity;
-import com.google.zxing.Result;
 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.constant.BaseConfig;
 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.ButterKnife;
 import butterknife.OnClick;
 import butterknife.Unbinder;
-import io.realm.Realm;
-import io.realm.RealmResults;
 
 
 /**
@@ -175,7 +145,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,
             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_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) {
         Bundle bundle = new Bundle();
         switch (v.getId()) {
@@ -207,6 +178,21 @@ public class HomePagerFragment extends BaseFragment implements View.OnClickListe
             case R.id.ivt_putin_pallet:
                 intent2Page(getActivity(), PutinPalletMainActivity.class, false,bundle);
                 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(), DetectionConfirmGoodsMainActivity.class, false,bundle);
+                break;
+
+
             case R.id.ivt_hk_putin:
                 intent2Page(getActivity(), HkPutinMainActivity.class, false,bundle);
                 break;

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

@@ -153,6 +153,31 @@ public class Urls {
     //香港入库
     public static final String FXY_GK_INBOUND_PICTURE = "/pda/HongkongInbound/picture";
 
+    /*开始检修功能*/
+
+    //单箱入库
+    public static final String FXY_DETECTION_PUTIN = "/pda/inbound/QcInbound";
+
+    // 单箱上架 -- 查验库位
+    public static final String FXY_DETECTION_CHECK_LOCATION = "/pda/inbound/QcBindLocation";
+    // 单箱上架
+    public static final String FXY_DETECTION_PUTAWAY = "/pda/inbound/QcBindLocation";
+
+    //检查批次
+
+    public static final String FXY_DETECTION_BOX_NUMBER = "/pda/inbound/QcScanBoxNumber";
+
+    //确认商品
+    public static final String FXY_DETECTION_CONFIRM_GOODS = "/pda/inbound/QcConfirmGoods";
+
+    //点击主机差异
+    public static final String FXY_DETECTION_DEAL_DIFF = "/pda/inbound/QcDealChayi";
+
+    //装修完成
+    public static final String FXY_DETECTION_COMPLETED = "/pda/Inbound/QcFinish";
+
+
+    public static final String FXY_DETECTION_ASSIGN_DATA = "/pda/Inbound/getAssignData";
 
     //打托 - 扫托盘
     public static final String FXY_HK_CHECK_PALLET = "/pda/HongkongInbound/checkPallet";

+ 38 - 0
app/src/main/java/com/fxy/utils/ToolUtils.java

@@ -0,0 +1,38 @@
+package com.fxy.utils;
+
+import android.app.Activity;
+
+/**
+ * 封装常用方法
+ */
+public class ToolUtils {
+
+    /**
+     * 获取dp对应值
+     * @param  dpValue int 需要转换的值
+     * @param density float 比例
+     * @return int
+     */
+    public static int getDpValue(int dpValue,float density){
+        return Math.round((float)dpValue * density);
+    }
+
+    /**
+     *
+     * @param dpValue int 需要转换的值
+     * @param activity Activity 当前活动页
+     * @return
+     */
+    public static int getDpValue(int dpValue,Activity activity){
+        return Math.round((float)dpValue * getDensity(activity));
+    }
+
+    /**
+     * 获取设备密度
+     * @param activity Activity 当前活动页
+     * @return float
+     */
+    public static float getDensity(Activity activity){
+        return activity.getResources().getDisplayMetrics().density;
+    }
+}

+ 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>

+ 5 - 0
app/src/main/res/drawable/selectable_background.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#000000"/> <!-- 80% 黑色透明 -->
+    <!-- 其他属性,如corners、stroke等 -->
+</selector>

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

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android"
+    android:shape="rectangle">
+    <solid android:color="#FFFFFF"/>
+    <stroke android:width="1dp"  android:color="#958D8D"/>
+    <corners android:radius="10dp"/>
+</shape>

+ 5 - 0
app/src/main/res/drawable/text_border_select.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
+    <solid android:color="@color/alertdialog_line" />
+    <corners android:radius="10dp" />
+</shape>

+ 115 - 0
app/src/main/res/layout/activity_fxy_detection_confirm_goods.xml

@@ -0,0 +1,115 @@
+<?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_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="horizontal">
+                <LinearLayout
+                    android:id="@+id/ll_box_code"
+                    style="@style/FromLinearLayoutItem"
+                    android:layout_width="wrap_content"
+                    android:orientation="horizontal">
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:textSize="@dimen/t24"
+                        android:text="箱号:"/>
+                    <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
+                    style="@style/FromLinearLayoutItem"
+                    android:layout_width="wrap_content"
+                    android:orientation="horizontal">
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:textSize="@dimen/t24"
+                        android:text="内件码:"/>
+                    <EditText
+                        style="@style/EditTextStyle"
+                        android:id="@+id/et_unit_code"
+                        android:hint="请输入/扫描内件码"
+                        android:text=""/>
+                    <ImageButton
+                        style="@style/ClearImg"
+                        android:id="@+id/ib_unit_code_clear"
+                        />
+                </LinearLayout>
+
+                <LinearLayout
+                    android:id="@+id/ll_host_diff"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:padding="10dp"
+                    android:visibility="gone"
+                    android:orientation="horizontal">
+
+                    <TextView
+                        style="@style/fontSize"
+                        android:id="@+id/btn_host_diff"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:background="@drawable/bg_orange_item"
+                        android:gravity="center"
+                        android:text="主机差异"
+                        android:padding="10dp"
+                        android:textColor="@color/white"
+                        android:visibility="visible" />
+                </LinearLayout>
+
+            </LinearLayout>
+
+
+            <LinearLayout
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:gravity="center_vertical"
+                android:orientation="horizontal"
+                android:scrollbars="vertical"
+                android:paddingTop="@dimen/dp_10"
+                android:paddingBottom="@dimen/dp_10"
+                >
+                <android.support.v7.widget.RecyclerView
+                    android:id="@+id/recyclerview"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:overScrollMode="never"/>
+            </LinearLayout>
+
+
+
+
+        </LinearLayout>
+    </ScrollView>
+
+
+    <include layout="@layout/item_float_image" />
+</LinearLayout>

+ 115 - 0
app/src/main/res/layout/activity_fxy_detection_confirm_parts.xml

@@ -0,0 +1,115 @@
+<?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:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:background="@color/md_grey_100"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:paddingBottom="5dp"
+                android:paddingTop="5dp"
+                android:orientation="horizontal">
+                <TextView
+                    android:id="@+id/tv_content"
+                    style="@style/tvDetectionStyle"
+                    android:hint="内容" />
+
+            </LinearLayout>
+            <LinearLayout
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:gravity="center_vertical"
+                android:orientation="horizontal"
+                android:scrollbars="vertical"
+                android:paddingTop="@dimen/dp_10"
+                android:paddingBottom="@dimen/dp_10"
+                >
+                <android.support.v7.widget.RecyclerView
+                    android:id="@+id/recyclerview"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:overScrollMode="never"/>
+            </LinearLayout>
+
+            <LinearLayout
+                android:id="@+id/ll_default"
+                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/DetectionFontSize"
+                    android:id="@+id/btn_default"
+                    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
+            android:id="@+id/ll_btn_center"
+            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:visibility="gone"
+            android:padding="10dp">
+        </LinearLayout>
+
+            <LinearLayout
+                android:id="@+id/ll_btn_not_center"
+                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:visibility="gone"
+                android:padding="10dp">
+            </LinearLayout>
+
+        </LinearLayout>
+    </ScrollView>
+
+</LinearLayout>

+ 132 - 0
app/src/main/res/layout/activity_fxy_detection_deal_diff.xml

@@ -0,0 +1,132 @@
+<?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:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:layout_marginTop="@dimen/dp_10"
+                android:background="@drawable/bg_white_et"
+                android:gravity="center_vertical"
+                android:orientation="vertical"
+                android:paddingLeft="10dp"
+                android:paddingRight="10dp">
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:paddingBottom="5dp"
+                    android:paddingTop="5dp"
+                    android:orientation="horizontal">
+
+                    <TextView
+                        style="@style/tvDetectionStyle"
+                        android:text="箱号" />
+                    <TextView
+                        style="@style/tvDetectionStyle"
+                        android:text=":" />
+
+                    <com.fxy.baselibrary.views.MarqueeTextView
+                        style="@style/mtRightStyle"
+                        android:id="@+id/mt_box_number"
+                        />
+
+                </LinearLayout>
+
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:paddingBottom="5dp"
+                    android:paddingTop="5dp"
+                    android:orientation="horizontal">
+
+                    <TextView
+                        style="@style/tvDetectionStyle"
+                        android:text="内件码" />
+                    <TextView
+                        style="@style/tvDetectionStyle"
+                        android:text=":" />
+
+                    <com.fxy.baselibrary.views.MarqueeTextView
+                        style="@style/mtRightStyle"
+                        android:id="@+id/mt_unit_code"
+                        />
+                </LinearLayout>
+
+
+            </LinearLayout>
+
+
+            <!--xians-->
+            <LinearLayout
+                android:id="@+id/ll_pictures_title"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:paddingBottom="10dp"
+                android:paddingTop="10dp"
+                android:gravity="center"
+                android:orientation="horizontal">
+                <TextView
+                    android:id="@+id/btn_confirm"
+                    style="@style/tvLeftStyle"
+                    android:background="@drawable/bg_white_et"
+                    android:paddingStart="20dp"
+                    android:paddingEnd="20dp"
+                    android:textSize="50sp"
+                    android:text="确认货品" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:gravity="center_vertical"
+                android:orientation="horizontal"
+                android:scrollbars="vertical"
+                android:paddingTop="@dimen/dp_10"
+                android:paddingBottom="@dimen/dp_10"
+                >
+                <android.support.v7.widget.RecyclerView
+                    android:id="@+id/recyclerview"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:overScrollMode="never"/>
+            </LinearLayout>
+
+
+            <LinearLayout
+                android:id="@+id/ll_recycler_view"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:orientation="vertical" >
+            </LinearLayout>
+
+        </LinearLayout>
+    </ScrollView>
+
+</LinearLayout>

+ 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>

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

@@ -0,0 +1,198 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout 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">
+
+
+
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical">
+
+
+
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:layout_marginTop="@dimen/dp_10"
+                android:background="@drawable/bg_white_et"
+                android:gravity="center_vertical"
+                android:orientation="horizontal"
+                android:paddingLeft="10dp"
+                android:paddingRight="10dp">
+                <LinearLayout
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:paddingBottom="5dp"
+                    android:paddingTop="5dp"
+                    android:orientation="horizontal">
+
+                    <TextView
+                        style="@style/tvDetectionStyle"
+                        android:text="箱号" />
+                    <TextView
+                        style="@style/tvDetectionStyle"
+                        android:text=":" />
+
+                    <com.fxy.baselibrary.views.MarqueeTextView
+                        style="@style/mtRightStyle"
+                        android:id="@+id/mt_box_number"
+                        />
+
+                </LinearLayout>
+
+
+                <LinearLayout
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:paddingBottom="5dp"
+                    android:paddingTop="5dp"
+                    android:layout_marginLeft="@dimen/dp_40"
+                    android:orientation="horizontal">
+
+                    <TextView
+                        style="@style/tvDetectionStyle"
+                        android:text="内件码" />
+                    <TextView
+                        style="@style/tvDetectionStyle"
+                        android:text=":" />
+
+                    <com.fxy.baselibrary.views.MarqueeTextView
+                        style="@style/mtRightStyle"
+                        android:id="@+id/mt_unit_code"
+                        />
+                </LinearLayout>
+            </LinearLayout>
+
+
+            <LinearLayout
+                android:id="@+id/ll_result"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:background="@drawable/bg_white_et"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:layout_marginTop="20dp"
+                android:layout_marginBottom="20dp"
+                android:paddingBottom="10dp"
+                android:paddingTop="10dp"
+                android:gravity="center"
+                android:orientation="horizontal">
+                <TextView
+                    android:id="@+id/btn_result"
+                    style="@style/tvLeftStyle"
+                    android:paddingStart="20dp"
+                    android:paddingEnd="20dp"
+                    android:textSize="50sp"/>
+            </LinearLayout>
+
+
+            <LinearLayout
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:gravity="center_vertical"
+                android:orientation="horizontal"
+                android:scrollbars="vertical"
+                android:paddingTop="@dimen/dp_10"
+                android:paddingBottom="@dimen/dp_10"
+                >
+                <android.support.v7.widget.RecyclerView
+                    android:id="@+id/recyclerview"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:overScrollMode="never"/>
+            </LinearLayout>
+
+            <LinearLayout
+                android:id="@+id/ll_details"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:orientation="vertical" >
+            </LinearLayout>
+
+
+            <LinearLayout
+                android:id="@+id/ll_recycler_view"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:orientation="vertical" >
+            </LinearLayout>
+
+
+
+
+            <LinearLayout
+                android:id="@+id/ll_step2"
+                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:visibility="gone"
+                android:layout_gravity="bottom"
+                android:padding="10dp">
+
+                <TextView
+                    style="@style/DetectionFontSize"
+                    android:id="@+id/btn_suspend"
+                    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/DetectionFontSize"
+                    android:id="@+id/btn_finish"
+                    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
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:gravity="center_vertical"
+                android:orientation="horizontal"
+                android:scrollbars="vertical"
+                android:paddingTop="@dimen/dp_10"
+                android:paddingBottom="@dimen/dp_10"
+                >
+                <android.support.v7.widget.RecyclerView
+                    android:id="@+id/result_recyclerview"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:overScrollMode="never"/>
+            </LinearLayout>
+
+
+
+
+        </LinearLayout>
+
+
+</RelativeLayout>

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

@@ -236,6 +236,76 @@
                     </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>
 

+ 11 - 0
app/src/main/res/layout/item_btn.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<TextView
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/tv_item_btn"
+    android:textSize="@dimen/tDetection"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:paddingLeft="@dimen/dp_10"
+    android:paddingRight="@dimen/dp_10"
+    android:background="@drawable/text_border"
+    android:text="按钮4545454"/>

+ 9 - 0
app/src/main/res/layout/item_card.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/cl_model"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:background="@color/md_grey_100"
+    android:padding="@dimen/dp_10"
+    android:orientation="vertical">
+</LinearLayout>

+ 41 - 0
app/src/main/res/layout/item_card_tab.xml

@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:background="@drawable/bg_white_et"
+    android:padding="@dimen/dp_4"
+    android:layout_margin="@dimen/dp_10"
+    android:orientation="vertical">
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:paddingBottom="5dp"
+        android:paddingTop="5dp"
+        android:layout_gravity="center_horizontal"
+        android:orientation="horizontal">
+        <TextView
+            android:id="@+id/tv_title"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:textSize="@dimen/t28"
+            android:textColor="@color/black_3d3d3d"
+            android:gravity="center"
+            android:text="标题" />
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:paddingBottom="5dp"
+        android:paddingTop="5dp"
+        android:orientation="horizontal">
+        <TextView
+            android:id="@+id/tv_describe"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:textSize="@dimen/t28"
+            android:textColor="@color/black_3d3d3d"
+            android:text="内容" />
+    </LinearLayout>
+</LinearLayout>

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

@@ -0,0 +1,139 @@
+<?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"
+    android:padding="16dp"
+    android:layout_margin="@dimen/dp_10"
+    android:background="@drawable/bg_white_et"
+    android:id="@+id/ll_item_card">
+
+    <RelativeLayout
+
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+        <LinearLayout
+            android:id="@+id/ll_item_center"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal"
+            >
+
+            <TextView
+                android:id="@+id/tv_content"
+                android:layout_marginBottom="@dimen/dp_10"
+                android:layout_marginTop="@dimen/dp_10"
+                android:textColor="@color/black_3d3d3d"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textSize="@dimen/tDetection"
+                android:text="标题"/>
+            <LinearLayout
+                android:id="@+id/ll_input"
+                style="@style/FromLinearLayoutItem"
+                android:layout_width="wrap_content"
+                android:orientation="horizontal">
+                <EditText
+                    android:id="@+id/et_input"
+                    style="@style/EditTextStyle"
+                    android:hint="请输入"
+                    android:text=""/>
+                <ImageButton
+                    style="@style/ClearImg"
+                    android:id="@+id/ib_unit_code_clear"
+                    />
+            </LinearLayout>
+
+            <LinearLayout
+                android:id="@+id/ll_btn_center"
+                android:layout_marginBottom="@dimen/dp_10"
+                android:layout_marginTop="@dimen/dp_10"
+                android:textColor="@color/black_3d3d3d"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:orientation="horizontal" >
+
+                <TextView
+                    android:visibility="gone"
+                    android:textSize="@dimen/tDetection"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:paddingLeft="@dimen/dp_10"
+                    android:paddingRight="@dimen/dp_10"
+                    android:layout_marginStart="@dimen/dp_10"
+                    android:layout_marginEnd="@dimen/dp_10"
+                    android:background="@drawable/text_border"
+                    android:text=""
+                    />
+                <TextView
+                    android:visibility="gone"
+                    android:textSize="@dimen/tDetection"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:paddingLeft="@dimen/dp_10"
+                    android:paddingRight="@dimen/dp_10"
+                    android:layout_marginStart="@dimen/dp_10"
+                    android:layout_marginEnd="@dimen/dp_10"
+                    android:background="@drawable/text_border"
+                    android:text=""
+                    />
+                <TextView
+                    android:visibility="gone"
+                    android:textSize="@dimen/tDetection"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:paddingLeft="@dimen/dp_10"
+                    android:paddingRight="@dimen/dp_10"
+                    android:layout_marginStart="@dimen/dp_10"
+                    android:layout_marginEnd="@dimen/dp_10"
+                    android:background="@drawable/text_border"
+                    android:text=""
+                    />
+                <TextView
+                    android:visibility="gone"
+                    android:textSize="@dimen/tDetection"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:paddingLeft="@dimen/dp_10"
+                    android:paddingRight="@dimen/dp_10"
+                    android:layout_marginStart="@dimen/dp_10"
+                    android:layout_marginEnd="@dimen/dp_10"
+                    android:background="@drawable/text_border"
+                    android:text=""
+                    />
+
+
+            </LinearLayout>
+
+
+
+        </LinearLayout>
+        <LinearLayout
+            android:id="@+id/ll_tip"
+            android:layout_marginBottom="@dimen/dp_10"
+            android:layout_marginTop="@dimen/dp_10"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentEnd="true"
+            android:orientation="vertical">
+            <TextView
+                android:id="@+id/tv_tip"
+                android:textColor="@color/md_light_green_A700"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textSize="@dimen/tDetection"
+                android:hint=""/>
+        </LinearLayout>
+    </RelativeLayout>
+
+
+
+    <LinearLayout
+        android:id="@+id/ll_upload_view"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="vertical" >
+    </LinearLayout>
+
+
+
+</RelativeLayout>

+ 40 - 0
app/src/main/res/layout/item_picture_selector.xml

@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:orientation="vertical"
+    android:id="@+id/ll_pictures_model"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+    <LinearLayout
+        android:id="@+id/ll_pictures_title"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:paddingBottom="5dp"
+        android:paddingTop="5dp"
+        android:orientation="horizontal">
+        <TextView
+            android:id="@+id/tv_pictures_title"
+            android:layout_marginLeft="@dimen/dp_10"
+            style="@style/tvLeftStyle"
+            android:text="拍照:" />
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="@dimen/dp_10"
+        android:layout_marginRight="@dimen/dp_10"
+        android:gravity="center_vertical"
+        android:orientation="horizontal"
+        android:scrollbars="vertical"
+        android:paddingTop="@dimen/dp_10"
+        android:paddingBottom="@dimen/dp_10"
+        >
+        <android.support.v7.widget.RecyclerView
+            android:id="@+id/recyclerview"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:background="#fff"
+            android:overScrollMode="never"/>
+    </LinearLayout>
+
+</LinearLayout>

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

@@ -0,0 +1,54 @@
+<?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:id="@+id/ll_img_center"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        android:layout_margin="5dp"
+        android:background="@drawable/bg_white_et"
+        android:layout_centerInParent="true">
+
+        <ImageView
+            android:id="@+id/ivp_img"
+            android:layout_width="200dp"
+            android:layout_height="200dp"
+            style="@android:style/Animation"
+            android:src="@mipmap/cat"
+            android:contentDescription="@null"
+            android:scaleType="centerCrop"/>
+        <TextView
+            android:id="@+id/tv_name"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:padding="2dp"
+            android:hint="标题"
+            android:layout_marginBottom="5dp"
+            android:layout_below="@id/ivp_img"  />
+
+
+
+        <CheckBox
+            android:id="@+id/cb_select"
+            style="@style/checkboxStyle"
+            android:layout_alignParentEnd="true"
+            android:gravity="end"
+            android:text="" />
+
+
+        <!-- 遮罩层View -->
+        <View
+            android:id="@+id/overlay_view"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:background="@drawable/selectable_background" />
+
+    </RelativeLayout>
+
+</RelativeLayout>

+ 45 - 0
app/src/main/res/layout/item_repair.xml

@@ -0,0 +1,45 @@
+<?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"
+    android:padding="16dp"
+    android:layout_margin="@dimen/dp_10"
+    android:background="@drawable/bg_white_et"
+    android:id="@+id/ll_item_card">
+
+    <LinearLayout
+
+        android:id="@+id/ll_item_center"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:orientation="vertical"
+        >
+
+        <TextView
+            android:id="@+id/tv_title"
+            android:textColor="@color/black_3d3d3d"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:textSize="@dimen/tDetection"
+            android:text="标题"/>
+
+
+
+
+    </LinearLayout>
+    <LinearLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentEnd="true"
+        android:layout_centerInParent="true"
+        android:orientation="vertical">
+    <TextView
+        android:id="@+id/tv_status"
+        android:textColor="@color/md_light_green_A700"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:textSize="@dimen/tDetection"
+        android:hint=""/>
+    </LinearLayout>
+
+</RelativeLayout>

+ 21 - 0
app/src/main/res/layout/item_sku_img.xml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:gravity="center"
+    android:orientation="vertical"
+    android:id="@+id/ll_show_img"
+    android:layout_height="wrap_content">
+
+    <ImageView
+        android:id="@+id/iv_show"
+        android:layout_width="200dp"
+        android:layout_height="200dp" />
+    <TextView
+        android:id="@+id/tv_name"
+        android:layout_width="200dp"
+        android:layout_height="wrap_content"
+        android:gravity="center"
+        android:padding="2dp"
+        android:textSize="30sp"
+        android:hint="标题 "  />
+</LinearLayout>

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

@@ -7,4 +7,6 @@
     <color name="colorUserName">#656464</color>
 
     <color name="color_f6">#f6f6f6</color>
+
+    <color name="selectBackground">#80000000</color>
 </resources>

+ 1 - 0
app/src/main/res/values/dimens.xml

@@ -12,4 +12,5 @@
     <dimen name="t24">24sp</dimen>
     <dimen name="t26">26sp</dimen>
     <dimen name="t28">28sp</dimen>
+    <dimen name="tDetection">40sp</dimen>
 </resources>

+ 19 - 0
app/src/main/res/values/styles.xml

@@ -217,4 +217,23 @@
 
     </style>
 
+    <!--单选 Widget.AppCompat.CompoundButton.RadioButton-->
+    <style name="checkboxStyle"  parent="@style/Widget.AppCompat.CompoundButton.RadioButton">
+        <item name="android:layout_width">30dp</item>
+        <item name="android:layout_height">30dp</item>
+    </style>
+
+
+    <style name="tvDetectionStyle">
+        <item name="android:layout_width">wrap_content</item>
+        <item name="android:layout_height">wrap_content</item>
+        <item name="android:textColor">@color/black_3d3d3d</item>
+        <item name="android:textSize">30sp</item>
+    </style>
+
+    <!--统一字体-->
+    <style name="DetectionFontSize">
+        <item name="android:textSize">@dimen/t24</item>
+    </style>
+
 </resources>

+ 8 - 0
baselibrary/src/main/java/com/fxy/baselibrary/util/JsonUtil.java

@@ -113,6 +113,14 @@ public class JsonUtil {
 		}
 	}
 
+	public static Map toJsonMap(String str){
+		if(str != null){
+			return JSONObject.parseObject(str, Map.class);
+		}else{
+			throw new RuntimeException("对象不能为空");
+		}
+	}
+
 	public static <T> T jsonString2Bean(String jsonString ,Class<T> beanClazz){
 		if(jsonString == null){
 			return null;