Browse Source

增加查验功能

guilin 1 year ago
parent
commit
d0346bb985

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

@@ -291,6 +291,16 @@
             android:windowSoftInputMode="stateHidden|adjustPan"
             android:screenOrientation="portrait"
             tools:ignore="LockedOrientationActivity"/>
+        <activity
+            android:name=".putIn.CheckGoodsDetailsMainActivity"
+            android:windowSoftInputMode="stateHidden|adjustPan"
+            android:screenOrientation="portrait"
+            tools:ignore="LockedOrientationActivity"/>
+        <activity
+            android:name=".putIn.CheckGoodsMainActivity"
+            android:windowSoftInputMode="stateHidden|adjustPan"
+            android:screenOrientation="portrait"
+            tools:ignore="LockedOrientationActivity"/>
     </application>
 
 

+ 60 - 0
app/src/main/java/com/fxy/adapter/GoodsAdapter.java

@@ -0,0 +1,60 @@
+package com.fxy.adapter;
+
+import android.content.Context;
+import android.support.annotation.Nullable;
+import android.view.View;
+import android.widget.ImageView;
+
+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.fms.logic.ViewLogic;
+
+import org.json.JSONObject;
+
+import java.util.List;
+
+
+
+public  class GoodsAdapter extends BaseQuickAdapter<JSONObject, BaseViewHolder> {
+
+    private Context mContext;
+
+    public GoodsAdapter(Context context, List<JSONObject> data) {
+        super(R.layout.item_fxy_check_goods, data);
+        this.mContext = context;
+    }
+    @Override
+    protected void convert(BaseViewHolder holder, JSONObject jsonObject) {
+        //XLog.e(jsonObject);
+
+        try {
+
+            holder.setText(R.id.mt_order_number, jsonObject.getString("order_number"));
+            holder.setText(R.id.mt_cn_name, jsonObject.getString("cn_name"));
+            holder.setText(R.id.mt_model_number, jsonObject.getString("specification"));
+            holder.setText(R.id.mt_qty, jsonObject.getString("qty"));
+            final String image_url = jsonObject.getString("image_url");
+
+            holder.setGone(R.id.ll_right_icon,true);
+
+            ImageView ivGoodsImg =  (ImageView)holder.getView(R.id.iv_goods_img);
+            new ViewLogic.GlideImageLoder(mContext,ivGoodsImg,image_url);
+            ivGoodsImg.setOnClickListener(new View.OnClickListener(){
+                @Override
+                public void onClick(View v) {
+                    RxDialogZoomImageView rxDialogZoomImageView = new RxDialogZoomImageView(mContext);
+                    rxDialogZoomImageView.setImagePath(image_url);
+                    rxDialogZoomImageView.show();
+                }
+            });
+
+        } catch (Exception e) {
+            XLog.e("查验列表数据渲染失败:"+e.getMessage());
+            e.printStackTrace();
+        }
+
+    }
+}

+ 31 - 0
app/src/main/java/com/fxy/fms/logic/ViewLogic.java

@@ -1,13 +1,20 @@
 package com.fxy.fms.logic;
 
 import android.annotation.SuppressLint;
+import android.content.Context;
+import android.graphics.Bitmap;
 import android.view.View;
+import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.TextView;
 
+import com.bumptech.glide.Glide;
+import com.bumptech.glide.Priority;
+import com.bumptech.glide.request.RequestOptions;
 import com.elvishew.xlog.XLog;
 import com.fxy.baselibrary.views.MarqueeTextView;
 import com.fxy.R;
+import com.lzy.ninegrid.NineGridView;
 
 import org.json.JSONException;
 import org.json.JSONObject;
@@ -212,4 +219,28 @@ public class ViewLogic {
             e.printStackTrace();
         }
     }
+
+    /**
+     * 显示网路图片
+     */
+    public static class GlideImageLoder implements NineGridView.ImageLoader {
+        public GlideImageLoder(Context context, ImageView ivGoodsImg, String url) {
+            this.onDisplayImage(context,ivGoodsImg,url);
+        }
+        @Override
+        public void onDisplayImage(Context context, ImageView imageView, String url) {
+            RequestOptions options = new RequestOptions()
+                    .centerCrop()
+                    .placeholder(R.drawable.ic_default_img)
+                    .error(R.drawable.ic_default_img)
+                    .priority(Priority.HIGH);
+            Glide.with(context).load(url).apply(options).into(imageView);
+        }
+
+        @Override
+        public Bitmap getCacheImage(String url) {
+            return null;
+        }
+    }
+
 }

+ 5 - 1
app/src/main/java/com/fxy/main/fragment/HomePagerFragment.java

@@ -16,6 +16,7 @@ import android.widget.LinearLayout;
 
 import com.fxy.common.VersionUpgrades;
 import com.elvishew.xlog.XLog;
+import com.fxy.putIn.CheckGoodsMainActivity;
 import com.fxy.putIn.SortationMainActivity;
 import com.fxy.putIn.TallyMainActivity;
 import com.fxy.putIn.TrayMainActivity;
@@ -129,7 +130,7 @@ public class HomePagerFragment extends BaseFragment implements View.OnClickListe
      * @param v
      */
     @OnClick({R.id.search_view, R.id.ima_or_code,R.id.ivt_tally,R.id.ivt_cargo_storage,R.id.ivt_tray,
-            R.id.ivt_quality,R.id.ivt_order_tool,R.id.ivt_sortation})
+            R.id.ivt_quality,R.id.ivt_order_tool,R.id.ivt_sortation,R.id.ivt_check})
     public void onClick(View v) {
         Bundle bundle = new Bundle();
         switch (v.getId()) {
@@ -155,6 +156,9 @@ public class HomePagerFragment extends BaseFragment implements View.OnClickListe
             case R.id.ivt_sortation:
                 intent2Page(getActivity(), SortationMainActivity.class, false,bundle);;
                 break;
+            case R.id.ivt_check:
+                intent2Page(getActivity(), CheckGoodsMainActivity.class, false,bundle);;
+                break;
             default:
                 showToast("还没有配置点击事件");
                 break;

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

@@ -112,6 +112,19 @@ public class Urls {
     //扫描跟踪单号
     public static final String FXY_SCAN_PALLET_TRACKING = "/pda/inbound/scanPalletTracking";
 
+
+    //获取查验入库信息
+    public static final String  FXY_OPEN_TRACKING_NUMBER = "/pda/inbound/openTrackingNumber";
+
+    //获取查验入库信息
+    public static final String  FXY_INBOUND_PACKAGE_GOODS = "/pda/inbound/getPackageGoods";
+
+
+    //完成查验
+    public static final String  FXY_FINISH_CHECK = "/pda/inbound/finishCheck";
+
+
+
     //获取批次列表
     public static final String FXY_GET_BATCH_LIST = "/pda/tool/getBatchData";
     //获取批次详情

+ 605 - 0
app/src/main/java/com/fxy/putIn/CheckGoodsDetailsMainActivity.java

@@ -0,0 +1,605 @@
+package com.fxy.putIn;
+
+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.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.view.KeyEvent;
+import android.view.View;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.Switch;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.elvishew.xlog.XLog;
+import com.fxy.R;
+import com.fxy.adapter.GoodsAdapter;
+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.baselibrary.views.dialog.RxDialogZoomImageView;
+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.fms.logic.ViewLogic;
+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.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 CheckGoodsDetailsMainActivity extends  BaseActivity implements StoJNI.ScanCallBack {
+
+    /**
+     * 列表适配器
+     */
+    Context mContext = this;
+
+    //
+    @BindView(R.id.ll_check_goods_list)
+    LinearLayout llCheckGoodsList;
+
+    @BindView(R.id.ll_check_qty)
+    LinearLayout llCheckQty;
+
+    @BindView(R.id.et_check_qty)
+    EditText etCheckQty;
+
+    @BindView(R.id.ll_check_options)
+    LinearLayout llCheckOptions;
+
+
+    @BindView(R.id.s_is_qty_fail)
+    Switch sIsQtyFail;
+    @BindView(R.id.s_is_second_hand)
+    Switch sIsSecondHand;
+
+    @BindView(R.id.ll_take_picture)
+    LinearLayout llTakePicture;
+
+    @BindView(R.id.ll_remark_info)
+    LinearLayout llRemarkInfo;
+
+    @BindView(R.id.btn_confirm)
+    TextView btnConfirm;
+
+    @BindView(R.id.rv_show_img)
+    RecyclerView rvShowImg;
+
+
+    @BindView(R.id.et_remark)
+    EditText etRemark;
+
+    private GoodsAdapter goodsAdapter;
+    //搬运工队列
+    private JSONArray issueList= new JSONArray();
+
+    private Integer selectId= 0;
+
+    private ArrayList photoList =new ArrayList<>();
+
+    private PictureSelectorUpload pictureSelectorUpload;
+
+    //
+    //扫码扫码动作
+    private ScanBean scanBean;
+
+    //订单信息对象
+    private JSONObject inboundObject = new JSONObject();
+
+    private JSONObject  goodsObject =  new JSONObject();
+    private int  idxId = 0;
+
+    private List<JSONObject>  goodsList = new ArrayList<>();
+
+    protected String action;
+
+    private boolean isOk = true;
+
+    private Unbinder unbinder;
+
+    private JSONObject postParam = new JSONObject();
+
+    private ViewLogic viewLogic;
+
+    @Override
+    public int getContentViewResId() {
+        return R.layout.activity_fxy_check_goods_details;
+    }
+
+    @Override
+    public boolean showToolBar() {
+        return true;
+    }
+
+    @Override
+    public boolean openEventBus() {
+        return true;
+    }
+
+    @Override
+    protected void getBundleExtras(Bundle bundle) {
+        try {
+            goodsObject = new JSONObject(bundle.getString("goods_object"));
+        } catch (JSONException e) {
+            XLog.e("接收数据解析:"+e.getMessage());
+            e.printStackTrace();
+        }
+    }
+
+    public void setBaseInfo(JSONObject jsonObject){
+
+        try {
+
+            ((MarqueeTextView)llCheckGoodsList.findViewById(R.id.mt_order_number)).setText(jsonObject.getString("order_number"));
+            ((MarqueeTextView)llCheckGoodsList.findViewById(R.id.mt_cn_name)).setText(jsonObject.getString("cn_name"));
+            ((MarqueeTextView)llCheckGoodsList.findViewById(R.id.mt_model_number)).setText(jsonObject.getString("specification"));
+            ((MarqueeTextView)llCheckGoodsList.findViewById(R.id.mt_qty)).setText(jsonObject.getString("qty"));
+            final String image_url = jsonObject.getString("image_url");
+
+            ImageView ivGoodsImg =  (ImageView)findViewById(R.id.iv_goods_img);
+            new ViewLogic.GlideImageLoder(mContext,ivGoodsImg,image_url);
+            ivGoodsImg.setOnClickListener(new View.OnClickListener(){
+                @Override
+                public void onClick(View v) {
+                    RxDialogZoomImageView rxDialogZoomImageView = new RxDialogZoomImageView(mContext);
+                    rxDialogZoomImageView.setImagePath(image_url);
+                    rxDialogZoomImageView.show();
+                }
+            });
+
+        } catch (Exception e) {
+            XLog.e("查验列表数据渲染失败:"+e.getMessage());
+            e.printStackTrace();
+        }
+
+    }
+
+    //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) {// 图片选择结果回调
+                pictureSelectorUpload.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();
+        pictureSelectorUpload = new PictureSelectorUpload(CheckGoodsDetailsMainActivity.this,rvShowImg,"check");
+    }
+
+
+
+    @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()){
+                finishCheck();
+            }
+        }
+        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(){
+
+        setBaseInfo(goodsObject);
+    }
+
+
+
+    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 finishCheck(){
+        if (!validate()){
+            return;
+        }
+        //数据检查不通过
+
+        if (!isOk){  Toast.makeText(this, getString(R.string.error_data_processed), Toast.LENGTH_LONG).show(); return;}
+        isOk = false;
+        OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_FINISH_CHECK).upJson(postParam)
+                .execute(new MyDialogCallback(this, true, true) {
+                    @Override
+                    public void onSuccess(Response<String> response) {
+                        isOk = true;
+                        super.onSuccess(response);
+                        try {
+                            ActionBean bean = JsonUtil.getObject(response.body(), ActionBean.class);
+                            if(bean.code == 1){
+                                showSuccessToast(bean.msg);
+                                JSONObject data = new JSONObject(bean.data);
+                                if (data.has("next_package") && !data.getString("next_package").isEmpty() &&
+                                        !data.getString("next_package").equals("[]")){
+                                    goodsObject = new JSONObject(data.getString("next_package"));
+                                    iniData();
+                                    restoreData();
+                                }else{
+                                    Intent intent = new Intent();
+                                    intent.putExtra("opt_status", "success");
+                                    setResult(200, intent);//返回值,200 是改返回的标志,也会返回
+                                    finish();
+                                }
+
+                            }else{
+                                showWarningToast(bean.msg);
+                            }
+                        } catch (Exception e) {
+                            e.printStackTrace();
+                            XLog.e("添加理货数据结果返回错误",e.getMessage());
+                        }
+                    }
+                });
+    }
+
+    private void restoreData(){
+
+        postParam.remove("photo");
+        postParam.remove("remark");
+        postParam.remove("check_qty");
+        postParam.remove("idx_id");
+        etRemark.setText("");
+        etCheckQty.setText("");
+        pictureSelectorUpload.emptyRemake();
+
+
+
+        sIsQtyFail.setChecked(false);
+        sIsSecondHand.setChecked(false);
+
+        llCheckQty.setVisibility(View.GONE);
+        llRemarkInfo.setVisibility(View.GONE);
+        btnConfirm.setBackgroundResource(R.drawable.bg_green_item);
+        btnConfirm.setText("查验无异常,下一个");
+    }
+
+    /*
+     * 校验必录
+     */
+    private boolean validate(){
+        photoList = pictureSelectorUpload.getPhotoList();
+        try {
+            postParam.put("idx_id",goodsObject.getString("idx_id"));
+            //检查是否拍照
+            if (photoList.size()==0){
+                showWarningToast("请拍照上传");
+                return false;
+            }
+            Gson gson = new Gson();
+            postParam.put("photo",gson.toJson(photoList));
+
+
+            if (postParam.has("is_qty_fail") && postParam.getString("is_qty_fail").equals("Y")){
+
+
+
+                if (etCheckQty.getText().toString().isEmpty()){
+                    showWarningToast((String) etCheckQty.getHint());
+                    return false;
+                }
+
+                postParam.put("check_qty",etCheckQty.getText().toString());
+
+            }
+
+            if (!postParam.has("is_qty_fail")){
+                postParam.put("is_qty_fail","N");
+            }
+
+
+            if (!postParam.has("is_second_hand")){
+                postParam.put("is_second_hand","N");
+            }
+
+
+            if (postParam.getString("is_qty_fail").equals("N") || postParam.getString("is_second_hand").equals("N")){
+                postParam.put("remark",etRemark.getText().toString());
+            }
+
+
+
+
+        } catch (JSONException e) {
+            showWarningToast("系统异常"+e.getMessage());
+            e.printStackTrace();
+            return false;
+        }
+
+
+
+        return true;
+    }
+
+
+    //清除订单信息
+    private boolean checkAllSwitch() {
+        boolean result = false;
+        if (putSwitch(sIsQtyFail,"is_qty_fail")){result = true;}
+        if (putSwitch(sIsSecondHand,"is_second_hand")){result = true;}
+        return result;
+    }
+
+    private boolean putSwitch(Switch sv,String name){
+        boolean isChecked = sv.isChecked();
+        try {
+            postParam.put(name,isChecked?"Y":"N");
+
+
+
+        } catch (JSONException e) {
+            XLog.e("设置Switch异常");
+            e.printStackTrace();
+        }
+        return isChecked;
+    }
+
+    //sIsGoodinfoMatch,sIsBattery,sIsMagnetic,sIsWood,sIsExtra,sIsOther
+    @OnClick({R.id.s_is_qty_fail,R.id.s_is_second_hand,R.id.btn_confirm})
+    public void onViewClicked(View view) {
+        Bundle bundle = new Bundle();
+        switch (view.getId()) {
+            case R.id.s_is_qty_fail:
+            case R.id.s_is_second_hand:
+                boolean allSwitch =  checkAllSwitch();
+                int visibility = View.GONE;
+                if (putSwitch(sIsQtyFail,"is_qty_fail")){
+                    visibility = View.VISIBLE;
+                }
+                llCheckQty.setVisibility(visibility);
+
+
+                if (allSwitch){
+                    llRemarkInfo.setVisibility(View.VISIBLE);
+                    btnConfirm.setBackgroundResource(R.drawable.bg_orange_item);
+                    btnConfirm.setText("完成查验,下一个");
+                }else {
+                    llRemarkInfo.setVisibility(View.GONE);
+                    btnConfirm.setBackgroundResource(R.drawable.bg_green_item);
+                    btnConfirm.setText("查验无异常,下一个");
+                }
+                break;
+            case R.id.btn_confirm:
+                finishCheck();
+            default:
+                break;
+        }
+    }
+
+    @Override
+    protected void onDestroy() {
+        unbinder.unbind();
+
+        pictureSelectorUpload.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());
+        }
+    }
+
+}

+ 615 - 0
app/src/main/java/com/fxy/putIn/CheckGoodsMainActivity.java

@@ -0,0 +1,615 @@
+package com.fxy.putIn;
+
+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.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.inputmethod.EditorInfo;
+import android.widget.EditText;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+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.adapter.GoodsAdapter;
+import com.fxy.base.StorageApplication;
+import com.fxy.baselibrary.base.BaseActivity;
+import com.fxy.baselibrary.bean.BaseEventBusBean;
+import com.fxy.baselibrary.interfaces.OnRxScanerListener;
+import com.fxy.baselibrary.qrcode.ActivityScanerCode;
+import com.fxy.baselibrary.util.JsonUtil;
+import com.fxy.baselibrary.util.StringUtils;
+import com.fxy.baselibrary.views.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.fms.logic.ViewLogic;
+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.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import butterknife.BindView;
+import butterknife.ButterKnife;
+import butterknife.OnClick;
+import butterknife.Unbinder;
+import sto.android.app.StoJNI;
+import sto.android.app.StoPdaKeyEvent;
+import sto.android.app.StoTongJNI;
+
+public class CheckGoodsMainActivity extends  BaseActivity implements StoJNI.ScanCallBack {
+    /**
+     * 列表适配器
+     */
+    Context mContext = this;
+
+    //单号清除
+    @BindView(R.id.ib_order_no_clear)
+    ImageButton ibOrderNoClear;
+
+    //单号
+    @BindView(R.id.et_order_no)
+    EditText etOrderNo;
+
+
+
+    //扫码扫码动作
+    private ScanBean scanBean;
+
+    private int order_id = 0;
+
+    //订单信息对象
+    private JSONObject inboundObject = new JSONObject();
+
+    private List<JSONObject>  goodsList = new ArrayList<>();
+
+    protected String action;
+
+
+    private Unbinder unbinder;
+
+    //订单号
+    private String orderNumber;
+    private GoodsAdapter goodsAdapter;
+    // 空显示页
+    private View emptyView;
+
+    @BindView(R.id.rc_check_goods)
+    RecyclerView rcCheckGoods;
+
+
+    //浮动按钮
+    @BindView(R.id.iv_drag)
+    FloatingImageView iv_drag;
+
+
+
+
+
+
+    @Override
+    public int getContentViewResId() {
+        return R.layout.activity_fxy_check_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)//之前提到的两个标志,在这里显示出了作用
+        {
+            String  opt_status = data.getStringExtra("opt_status").toString();
+            if (opt_status.equals("success")){
+                etOrderNo.setText("");
+                goodsList.clear();
+                goodsAdapter.notifyDataSetChanged();
+            }
+        }
+    }
+
+
+    /**
+     * 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();
+        initAdapter();
+        iniData();
+
+        //监听浮动按钮
+        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);
+                }
+            }
+        });
+    }
+
+
+
+    @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()){
+                //getInboundInfo();
+            }
+        }
+        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() {
+
+
+        //
+        etOrderNo.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+            @Override
+            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+                if (actionId == EditorInfo.IME_ACTION_DONE) {
+                    String orderNo = etOrderNo.getText().toString().trim();
+                    if (StringUtils.isEmpty(orderNo)) {
+                        setEditTextFocused(v,true);
+                        showWarningToast(v.getHint().toString());
+                        return false;
+                    }
+                    getInboundInfo();//获取订单信息
+                    return false;
+                }
+                return false;
+            }
+        });
+        etOrderNo.addTextChangedListener(new TextWatcher() {
+            public void onTextChanged(CharSequence s, int start, int before, int count) {
+                orderNumber = s.toString().trim();
+                if (s.length() > 0 ) {
+                    if (etOrderNo.isEnabled()){
+                        ibOrderNoClear.setVisibility(View.VISIBLE);
+                    }
+                    setEditTextNormal(etOrderNo,true);
+                } else {
+                    ibOrderNoClear.setVisibility(View.INVISIBLE);
+                    setEditTextFocused(etOrderNo,true);
+                }
+            }
+
+            public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+            }
+
+            public void afterTextChanged(Editable s) {
+
+            }
+        });
+        ibOrderNoClear.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                etOrderNo.requestFocus();
+                etOrderNo.getText().clear();
+            }
+        });
+    }
+
+    private void iniData(){
+
+
+    }
+
+    private void initAdapter() {
+
+        emptyView = this.getLayoutInflater().inflate(R.layout.pager_empty, (ViewGroup) rcCheckGoods.getParent(), false);
+        goodsAdapter = new GoodsAdapter(mContext,goodsList);
+        goodsAdapter.setEmptyView(emptyView);
+        goodsAdapter.openLoadAnimation(BaseQuickAdapter.SCALEIN);
+        rcCheckGoods.setLayoutManager(new LinearLayoutManager(this));
+        rcCheckGoods.setAdapter(goodsAdapter);
+        // 卡片项点击事件
+        goodsAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
+            @Override
+            public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
+                //showLoadDialog("开始调整查验...");
+                try {
+
+                    Bundle bundle = new Bundle();
+                    JSONObject goodsObject = goodsList.get(position);
+
+                    if (goodsObject.has("is_pass")){
+                        showErrorToast("已查验不需要重复操作");
+                        return;
+                    }
+                    bundle.putString("goods_object",goodsObject.toString());
+
+                    intentPageResult(CheckGoodsMainActivity.this, CheckGoodsDetailsMainActivity.class, bundle,200);
+                }catch (Exception e){
+                    XLog.e("选中获取商品信息错误:",e);
+                }
+
+            }
+        });
+    }
+
+
+
+    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()) {
+                case R.id.et_order_no:
+                    getInboundInfo();
+                    break;
+                default:
+            }
+
+
+        }
+    }
+
+    private void   getInboundInfo(){
+        final String orderNo = etOrderNo.getText().toString().trim();
+        if (orderNo.isEmpty()){
+            return;
+        }
+
+        try {
+
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.put("tracking_number",orderNo);
+            if (!checkRepeat(Urls.FXY_OPEN_TRACKING_NUMBER+(jsonObject.toString()))){
+                Toast.makeText(this, getString(R.string.error_data_processed), Toast.LENGTH_LONG).show();
+                return;
+            }
+
+            order_id = 0;
+
+            OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_OPEN_TRACKING_NUMBER).upJson(jsonObject)
+                    .execute(new MyDialogCallback(this, true, true) {
+                        @Override
+                        public void onSuccess(Response<String> response) {
+                            super.onSuccess(response);
+                            try {
+                                ActionBean bean = JsonUtil.getObject(response.body(), ActionBean.class);
+                                goodsList.clear();
+                                goodsAdapter.notifyDataSetChanged();
+
+                                if(bean.code == 1){
+
+                                    if (!bean.data.isEmpty() && !bean.data.equals("[]")){
+                                        JSONObject data = new JSONObject(bean.data);
+
+                                        if (data.has("order_id")){
+                                            order_id =  data.getInt("order_id");
+                                            getPackageGoods();
+                                        }
+
+
+                                        if (data.has("deal_tracking_number")){
+                                            etOrderNo.setText(data.getString("deal_tracking_number"));
+                                        }
+                                    }
+
+
+
+                                }else{
+
+                                    showWarningToast(bean.msg);
+                                }
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                                showEmptyView("扫跟踪号解析错误:"+e.getMessage());
+                                //XLog.e("获取包裹商品信息解析错误",e.getMessage());
+                            }
+                        }
+                    });
+        }catch (Exception e){
+            XLog.e("请求扫跟踪号信息错误:",e);
+        }
+
+    }
+
+    private void getPackageGoods(){
+
+        try {
+
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.put("order_id",order_id);
+            if (!checkRepeat(Urls.FXY_INBOUND_PACKAGE_GOODS+(jsonObject.toString()))){
+                Toast.makeText(this, getString(R.string.error_data_processed), Toast.LENGTH_LONG).show();
+                return;
+            }
+
+            OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_INBOUND_PACKAGE_GOODS).upJson(jsonObject)
+                    .execute(new MyDialogCallback(this, true, true) {
+                        @Override
+                        public void onSuccess(Response<String> response) {
+                            super.onSuccess(response);
+                            try {
+                                ActionBean bean = JsonUtil.getObject(response.body(), ActionBean.class);
+                                goodsList.clear();
+                                goodsAdapter.notifyDataSetChanged();
+
+                                if(bean.code == 1){
+
+                                    if (!bean.data.isEmpty() && !bean.data.equals("[]")){
+                                        JSONObject data = new JSONObject(bean.data);
+                                        if (data.has("data")){
+                                            JSONArray list = data.getJSONArray("data");
+                                            for (int i = 0; i<list.length(); i++){
+                                                goodsList.add(list.getJSONObject(i));
+                                            }
+                                            goodsAdapter.notifyDataSetChanged();
+                                        }
+                                    }
+
+                                }else{
+
+                                    showWarningToast(bean.msg);
+                                }
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                                showEmptyView("扫跟踪号解析错误:"+e.getMessage());
+                                //XLog.e("获取包裹商品信息解析错误",e.getMessage());
+                            }
+                        }
+                    });
+        }catch (Exception e){
+            XLog.e("请求扫跟踪号信息错误:",e);
+        }
+    }
+
+
+    /*
+     * 校验必录
+     */
+    private boolean validate(){
+
+        return true;
+    }
+
+
+    //清除订单信息
+    private void clearData() {
+
+    }
+
+    @OnClick({R.id.ima_or_code})
+    public void onViewClicked(View view) {
+        Bundle bundle = new Bundle();
+        switch (view.getId()) {
+            case R.id.ima_or_code:
+                if(etOrderNo.isEnabled()){
+                    etOrderNo.requestFocus();
+                    ActivityScanerCode.setScanerListener(mScanerListener);
+                    ActivityScanerCode.intent2Activity(mContext, BaseConfig.COMMON_SCANNER_ONLY);
+                }
+                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());
+        }
+    }
+
+
+}

+ 69 - 0
app/src/main/res/layout/activity_fxy_check_goods.xml

@@ -0,0 +1,69 @@
+<?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">
+    <LinearLayout
+        style="@style/FromLinearLayoutItem"
+        android:orientation="horizontal">
+        <EditText
+            style="@style/EditTextStyle"
+            android:id="@+id/et_order_no"
+            android:hint="@string/hint_please_scan_no"
+            android:text=""/>
+        <ImageButton
+            style="@style/ClearImg"
+            android:id="@+id/ib_order_no_clear"/>
+        <include layout="@layout/item_image_code" />
+    </LinearLayout>
+
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="@dimen/dp_10"
+        android:layout_marginRight="@dimen/dp_10"
+        android:background="@null"
+        android:padding="10dp"
+        android:gravity="center_vertical"
+        android:orientation="vertical">
+        <TextView
+            style="@style/fontSize"
+            android:id="@+id/tv_title_num"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:textStyle="bold"
+            android:text="所有商品">
+        </TextView>
+    </LinearLayout>
+    <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_goods_content"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:orientation="vertical"
+                >
+                <android.support.v7.widget.RecyclerView
+                    android:id="@+id/rc_check_goods"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent">
+                </android.support.v7.widget.RecyclerView>
+            </LinearLayout>
+
+        </LinearLayout>
+    </ScrollView>
+    <include layout="@layout/item_float_image" />
+
+</LinearLayout>

+ 265 - 0
app/src/main/res/layout/activity_fxy_check_goods_details.xml

@@ -0,0 +1,265 @@
+<?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">
+            <include layout="@layout/item_fxy_check_goods"/>
+
+            <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/tvLeftStyle"
+                    android:id="@+id/tv_title_num"
+                    android:textStyle="bold"
+                    android:text="查验选项">
+                </TextView>
+            </LinearLayout>
+
+            <LinearLayout
+                android:id="@+id/ll_check_options"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:background="@drawable/bg_white_et"
+                android:gravity="center_vertical"
+                android:orientation="vertical"
+                android:paddingBottom="5dp"
+                android:paddingTop="5dp"
+                android:paddingRight="10dp">
+                <LinearLayout
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:paddingBottom="5dp"
+                    android:paddingTop="5dp"
+                    android:orientation="horizontal">
+                    <LinearLayout
+                        android:layout_weight="0.5"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:orientation="horizontal">
+                        <TextView
+                            style="@style/tvLeftStyle"
+
+                            android:gravity="right"
+                            android:text="查验数量不符" />
+                        <Switch
+                            android:id="@+id/s_is_qty_fail"
+                            android:layout_marginStart="5dp"
+                            android:textColor="@color/black"
+                            android:layout_width="wrap_content"
+                            android:layout_height="match_parent"
+                            android:track="@drawable/switch_selector_green"
+                            android:thumb="@drawable/switch_white_circle_selector"
+                            android:text=""
+                            />
+
+
+                    </LinearLayout>
+
+
+
+
+                </LinearLayout>
+                <LinearLayout
+                    android:id="@+id/ll_check_qty"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginBottom="20dp"
+                    android:visibility="gone"
+                    android:orientation="horizontal">
+                    <EditText
+                        style="@style/EditTextStyle"
+                        android:id="@+id/et_check_qty"
+                        android:hint="请输入输入清点数"
+
+                        android:text=""/>
+                </LinearLayout>
+
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:paddingBottom="5dp"
+                    android:paddingTop="5dp"
+                    android:orientation="horizontal">
+                    <LinearLayout
+                        android:layout_weight="0.5"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:orientation="horizontal">
+                        <TextView
+                            style="@style/tvLeftStyle"
+                            android:layout_width="100dp"
+                            android:gravity="right"
+                            android:text="二手物品" />
+
+
+                        <Switch
+                            android:id="@+id/s_is_second_hand"
+                            android:layout_marginStart="5dp"
+                            android:textColor="@color/black"
+                            android:layout_width="wrap_content"
+                            android:layout_height="match_parent"
+                            android:track="@drawable/switch_selector_green"
+                            android:thumb="@drawable/switch_white_circle_selector"
+                            android:text=""
+                            />
+
+                    </LinearLayout>
+                    <LinearLayout
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="0.5"
+                        android:orientation="horizontal">
+
+
+
+                    </LinearLayout>
+                </LinearLayout>
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:paddingBottom="5dp"
+                    android:paddingTop="5dp"
+                    android:orientation="horizontal">
+
+                </LinearLayout>
+
+
+            </LinearLayout>
+
+
+            <LinearLayout
+                android:id="@+id/ll_take_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_remark_info"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:visibility="gone"
+                android:orientation="vertical">
+                <View
+                    android:layout_width="match_parent"
+                    android:layout_height="4dp"
+                    android:background="@color/md_grey_100" />
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="@dimen/dp_10"
+                    android:layout_marginRight="@dimen/dp_10"
+                    android: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>
+
+
+                <View
+                    android:layout_width="match_parent"
+                    android:layout_height="4dp"
+                    android:background="@color/md_grey_100" />
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="@dimen/dp_10"
+                    android:layout_marginRight="@dimen/dp_10"
+                    android:layout_marginTop="@dimen/dp_4"
+                    android:layout_marginBottom="@dimen/dp_4"
+                    android:gravity="center_vertical"
+                    android:orientation="horizontal"
+                    >
+                    <EditText
+                        style="@style/fontSize"
+                        android:id="@+id/et_remark"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:background="@color/white"
+                        android:gravity="left|top"
+                        android:hint="请输入备注信息"
+                        android:minHeight="150dp"
+                        android:padding="10dp"
+                        android:textColor="@color/font_color_6"
+                         />
+                </LinearLayout>
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginTop="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:layout_marginBottom="@dimen/dp_4"
+                android:background="@drawable/bg_white_et"
+                android:gravity="center_vertical"
+                android:orientation="horizontal"
+                android:padding="10dp">
+                <TextView
+                    style="@style/fontSize"
+                    android:id="@+id/btn_confirm"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="@dimen/dp_10"
+                    android:layout_marginRight="@dimen/dp_10"
+                    android:background="@drawable/bg_green_item"
+                    android:gravity="center"
+                    android:text="查验无异常,下一个"
+                    android:padding="10dp"
+                    android:textColor="@color/white"
+                    android:visibility="visible" />
+            </LinearLayout>
+        </LinearLayout>
+    </ScrollView>
+</LinearLayout>

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

@@ -122,6 +122,12 @@
                         android:drawableTop="@drawable/ic_tray"
                         android:drawablePadding="5dp"
                         android:text="托盘入库" />
+                    <TextView
+                        style="@style/ImageViewWithTextStyle.FontSize"
+                        android:id="@+id/ivt_check"
+                        android:drawableTop="@drawable/ic_kccx"
+                        android:drawablePadding="5dp"
+                        android:text="开箱查验" />
 
                 </TableRow>
 

+ 163 - 0
app/src/main/res/layout/item_fxy_check_goods.xml

@@ -0,0 +1,163 @@
+<?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="wrap_content"
+    android:background="@color/md_grey_100"
+    android:orientation="vertical">
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="10dp"
+        android:background="@color/md_grey_100" />
+    <LinearLayout
+        android:id="@+id/ll_check_goods_list"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="@dimen/dp_10"
+        android:layout_marginRight="@dimen/dp_10"
+        android:background="@drawable/bg_white_et"
+        android:gravity="center_vertical"
+        android:orientation="vertical"
+        android:paddingBottom="5dp"
+        android:paddingTop="5dp"
+        android:paddingLeft="10dp"
+        android:paddingRight="10dp">
+        <LinearLayout
+            android:id="@+id/ll_order_number"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:paddingBottom="5dp"
+            android:paddingTop="5dp"
+            android:orientation="horizontal">
+            <TextView
+                style="@style/tvLeftStyle"
+                android:text="@string/str_order_number" />
+            <TextView
+                style="@style/tvLeftStyle"
+                android:text=":" />
+            <com.fxy.baselibrary.views.MarqueeTextView
+                android:id="@+id/mt_order_number"
+                style="@style/mtRightStyle"
+                />
+            <TextView
+                android:id="@+id/tv_country_name"
+                style="@style/tvLeftStyle"
+                android:text="" />
+
+        </LinearLayout>
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:paddingBottom="5dp"
+            android:paddingTop="5dp"
+            android:orientation="horizontal">
+            <TextView
+                style="@style/tvLeftStyle"
+                android:text="中文名称" />
+            <TextView
+                style="@style/tvLeftStyle"
+                android:text=":" />
+
+            <com.fxy.baselibrary.views.MarqueeTextView
+                android:id="@+id/mt_cn_name"
+                style="@style/mtRightStyle"
+                />
+        </LinearLayout>
+
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical">
+            <RelativeLayout
+                android:id="@+id/rl_container"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content">
+
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:paddingBottom="5dp"
+                    android:paddingTop="5dp"
+                    android:orientation="horizontal">
+                    <TextView
+                        style="@style/tvLeftStyle"
+                        android:text="型号" />
+                    <TextView
+                        style="@style/tvLeftStyle"
+                        android:text=":" />
+
+                    <com.fxy.baselibrary.views.MarqueeTextView
+                        android:id="@+id/mt_model_number"
+                        style="@style/mtRightStyle"
+                        />
+                </LinearLayout>
+
+                <LinearLayout
+                    android:id="@+id/ll_right_icon"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:gravity="right"
+                    android:layout_marginTop="15dp"
+                    android:visibility="gone"
+                    tools:ignore="RtlHardcoded">
+                    <ImageView
+                        android:layout_width="30dp"
+                        android:layout_height="30dp"
+                        android:gravity="center"
+                        android:layout_centerInParent="true"
+                        android:src="@drawable/right_icon" />
+                </LinearLayout>
+            </RelativeLayout>
+        </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_qty"
+                style="@style/tvLeftStyle"
+                android:text="数量" />
+            <TextView
+                style="@style/tvLeftStyle"
+                android:text=":" />
+            <com.fxy.baselibrary.views.MarqueeTextView
+                android:id="@+id/mt_qty"
+                style="@style/mtRightStyle"
+                />
+
+        </LinearLayout>
+        <LinearLayout
+            android:id="@+id/ll_mt_goods_attr_img"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:paddingBottom="5dp"
+            android:paddingTop="5dp"
+
+            android:orientation="horizontal">
+            <TextView
+                style="@style/tvLeftStyle"
+                android:text="产品图片" />
+            <TextView
+                style="@style/tvLeftStyle"
+                android:text=":" />
+
+            <ImageView
+                android:id="@+id/iv_goods_img"
+                style="@style/IvCover"
+                android:layout_marginStart="10dp"
+                />
+
+
+        </LinearLayout>
+    </LinearLayout>
+
+
+</LinearLayout>

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

@@ -168,6 +168,13 @@
         <item name="android:textSize">@dimen/t24</item>
     </style>
 
+    <style name="IvCover">
+        <item name="android:layout_width">100dp</item>
+        <item name="android:layout_height">80dp</item>
+        <!--        <item name="android:background">#929292</item>-->
+        <item name="android:layout_marginTop">4dp</item>
+    </style>
+
     <!--个人中心菜单-->
     <style name="tvPersonalStyle">
         <item name="android:layout_width">0dp</item>