13 Commits 2769ae295d ... 27991cb000

Autor SHA1 Mensaje Fecha
  guilin 27991cb000 功能优化 hace 1 mes
  guilin 97246df91d Merge branch 'master' into master_925 hace 1 mes
  guilin 27a3a6f7be Merge branch 'master' into master_925 hace 1 mes
  guilin b4bd7b26f1 Merge remote-tracking branch 'remotes/origin/master' into master_925 hace 1 mes
  guilin d2f58c36ce Merge branch 'master' into master_925 hace 1 mes
  guilin 843a811354 增加功能 hace 1 mes
  guilin 61a579dfa5 Merge branch 'master' into master_925 hace 1 mes
  guilin d34aa3ed21 功能优化 hace 1 mes
  guilin 6148435608 Merge branch 'master' into master_925 hace 1 mes
  guilin 052b3afe15 Merge branch 'master' into master_925 hace 1 mes
  guilin 1a8b6b9e70 Merge branch 'master' into master_925 hace 1 mes
  guilin 204aaf041a 优化 hace 1 mes
  guilin 10541531ab FX入库PDA优化【taskID=12144】 hace 1 mes

+ 9 - 3
app/src/main/AndroidManifest.xml

@@ -140,6 +140,13 @@
             android:windowSoftInputMode="stateHidden|adjustPan"
             android:screenOrientation="portrait"
             tools:ignore="DuplicateActivity,LockedOrientationActivity"/>
+        <activity
+            android:name=".putIn.TallyPutInMainActivity"
+            android:windowSoftInputMode="stateHidden|adjustPan"
+            android:screenOrientation="portrait"
+            tools:ignore="DuplicateActivity,LockedOrientationActivity"/>
+
+
 
         <activity
             android:name=".tool.OrderToolMainActivity"
@@ -288,15 +295,14 @@
             android:configChanges="orientation|keyboardHidden|screenSize"
             tools:ignore="LockedOrientationActivity"/>
 
+        
         <activity
             android:name=".detection.ScanPhotosMainActivity"
             android:windowSoftInputMode="stateHidden|adjustPan"
-            android:screenOrientation="sensor"
-            android:configChanges="orientation|keyboardHidden|screenSize"
+            android:screenOrientation="portrait"
             tools:ignore="LockedOrientationActivity"/>
 
 
-
         <activity
             android:name=".workOrder.WorkOrderOptMainActivity"
             android:windowSoftInputMode="stateHidden|adjustPan"

+ 21 - 1
app/src/main/java/com/fxy/common/AsyncPictureSelector.java

@@ -3,13 +3,16 @@ package com.fxy.common;
 import android.Manifest;
 import android.annotation.SuppressLint;
 import android.app.Activity;
+import android.app.AlertDialog;
 import android.bluetooth.BluetoothSocket;
 import android.content.Context;
+import android.content.DialogInterface;
 import android.content.Intent;
 import android.graphics.Color;
 import android.graphics.drawable.ColorDrawable;
 import android.net.ConnectivityManager;
 import android.net.NetworkInfo;
+import android.os.Build;
 import android.os.Handler;
 import android.os.Message;
 import android.support.v7.widget.GridLayoutManager;
@@ -21,6 +24,8 @@ import android.widget.PopupWindow;
 import android.widget.TextView;
 import android.widget.Toast;
 
+import androidx.annotation.RequiresApi;
+
 import com.elvishew.xlog.XLog;
 import com.fxy.R;
 import com.fxy.adapter.GridImageAdapter;
@@ -505,7 +510,7 @@ public class AsyncPictureSelector {
             String fileSuffix = urlPath.lastIndexOf(".")>-1 ? urlPath.substring(urlPath.lastIndexOf(".")) : "";
             String fileName = UUID.randomUUID().toString() + fileSuffix;
             takePhotosRealm.setOssUrl(path_prefix+fileName);
-            ossPhotoList.add("/"+path_prefix+fileName);
+
             //
 
             Date date = new Date();
@@ -514,10 +519,25 @@ public class AsyncPictureSelector {
             //提交事务,操作就被执行
             mRealm.commitTransaction();
 
+            ossPhotoList.add("/"+path_prefix+fileName);
         }catch (Exception e) {
             // 如果事务不能提交,则在这里处理错误
             e.printStackTrace();
             // 如果需要的话,可以回滚事务
+            new AlertDialog.Builder(mContext)
+                    .setTitle(R.string.dl_hint)
+                    .setMessage("保存图片失败,需要重新拍照")
+                    .setNegativeButton(R.string.str_submit, new DialogInterface.OnClickListener() {
+                        @RequiresApi(api = Build.VERSION_CODES.KITKAT)
+                        @Override
+                        public void onClick(DialogInterface dialogInterface, int i) {
+
+                        }
+                    }).setPositiveButton(R.string.str_cancel, new DialogInterface.OnClickListener() {
+                @Override
+                public void onClick(DialogInterface dialogInterface, int i) {
+                }
+            }).show();
         }
         return checkDataExists(realmId);
 

+ 5 - 1
app/src/main/java/com/fxy/common/AsyncPictureUpload.java

@@ -464,8 +464,10 @@ public class AsyncPictureUpload {
     }
 
     public void setStartUpload(){
+        if (awaitUploadList==null ||awaitUploadList.size()==0){
+            asyncUpload();
+        }
         allowUpload = true;
-        asyncUpload();
         UploadUtils.delInterfaceRequestTime(mContext);
     }
     public void setIsAllRePush(){
@@ -590,6 +592,8 @@ public class AsyncPictureUpload {
         if (allowUpload){
             //上传完,继续执行
             asyncUpload();
+        }else{
+            awaitUploadList.clear();
         }
 
     }

+ 57 - 39
app/src/main/java/com/fxy/detection/ScanPhotosMainActivity.java

@@ -32,11 +32,13 @@ import com.fxy.baselibrary.util.JsonUtil;
 import com.fxy.baselibrary.util.StringUtils;
 import com.fxy.bean.ActionBean;
 import com.fxy.bean.ScanBean;
+import com.fxy.common.AsyncPictureSelector;
 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.utils.UploadUtils;
 import com.fxy.view.FloatingImageView;
 import com.google.gson.Gson;
 import com.google.zxing.Result;
@@ -48,6 +50,7 @@ import org.json.JSONException;
 import org.json.JSONObject;
 
 import java.util.ArrayList;
+import java.util.List;
 
 import butterknife.BindView;
 import butterknife.ButterKnife;
@@ -68,10 +71,17 @@ public class ScanPhotosMainActivity extends  BaseActivity implements StoJNI.Scan
     @BindView(R.id.ll_take_picture)
     LinearLayout llTakePicture;
 
+    @BindView(R.id.ll_scan_confirm)
+    LinearLayout llScanConfirm;
+    @BindView(R.id.ll_confirm)
+    LinearLayout llConfirm;
 
-    private ArrayList photoList =new ArrayList<>();
+    @BindView(R.id.tv_await_num)
+    TextView tvAwaitNum;
 
-    private PictureSelectorUpload pictureSelectorUpload;
+    private List<String> photoList =new ArrayList<>();
+
+    private AsyncPictureSelector pictureSelectorUpload;
     //
     //扫码扫码动作
     private ScanBean scanBean;
@@ -128,9 +138,19 @@ public class ScanPhotosMainActivity extends  BaseActivity implements StoJNI.Scan
             if (requestCode == PictureConfig.CHOOSE_REQUEST) {// 图片选择结果回调
                 pictureSelectorUpload.getSelectImg(data);
             }
+            pictureSelectorUpload.authCamera();
+            totalAwaitNum();
         }
     }
 
+
+
+    //getAwaitNum
+    private void totalAwaitNum(){
+        int awaitNum = UploadUtils.getAwaitNum(mRealm,getClass().getSimpleName());
+        tvAwaitNum.setText(String.valueOf(awaitNum));
+    }
+
     /**
      * EventBus接收信息的方法,开启后才会调用(非粘性事件)
      *
@@ -138,10 +158,9 @@ public class ScanPhotosMainActivity extends  BaseActivity implements StoJNI.Scan
      */
     @Override
     protected void EventBean(BaseEventBusBean event) {
-//        XLog.e("----------接收返回--------------");
-//        XLog.e("接收返回:"+event.getEventCode());
-        if (event != null && event.getEventCode() == EventCode.displacement_refresh){
-
+        assert event != null;
+        if (event != null && event.getEventCode() == EventCode.file_upload_lister) {
+            totalAwaitNum();
         }
     }
 
@@ -160,7 +179,7 @@ public class ScanPhotosMainActivity extends  BaseActivity implements StoJNI.Scan
         iniData();
 
         RecyclerView rvShowImg = (RecyclerView)llTakePicture.findViewById(R.id.rv_show_img);
-        pictureSelectorUpload  = setItemPicture("detection",rvShowImg,9,PictureConfig.TYPE_IMAGE);
+        pictureSelectorUpload  = setItemPicture("detection",rvShowImg,99);
 
 
         //监听浮动按钮
@@ -177,37 +196,24 @@ public class ScanPhotosMainActivity extends  BaseActivity implements StoJNI.Scan
 
 
 
+
     /**
      * 设置多个上传文件
-     * @param actionType String
+     * @param uploadType String
      * @param showImg RecyclerView
      */
-    private PictureSelectorUpload setItemPicture(String actionType,RecyclerView showImg,int maxNum,int pictureType){
-        PictureSelectorUpload pictureUpload = new PictureSelectorUpload(ScanPhotosMainActivity.this,showImg,"work",maxNum,pictureType);
-        pictureUpload.setActionType(actionType);
-        pictureUpload.setCompress(true,100,500);
-        pictureUpload.setOnlyCamera(true);
-        //showImg.onTouchEvent()
-
-        pictureUpload.setOnChangeListener(new PictureSelectorUpload.UploadChangeListener() {
-            @Override
-            public void uploadResult(boolean State,String actionType) {
-                if (State) {
-                    pictureInbound();
-                }
-            }
-
-            @Override
-            public void uploadActionType(String actionType) {
+    private AsyncPictureSelector setItemPicture(String uploadType,RecyclerView showImg,int num){
 
-                System.out.println("actionType:"+actionType);
+        String notifyUrl = Urls.getServiceAddress(this) + Urls.FXY_DETECTION_PUTIN;
+        AsyncPictureSelector pictureUpload = new AsyncPictureSelector(ScanPhotosMainActivity.this,showImg,"detection",uploadType,notifyUrl,false);
+        pictureUpload.setUploadType(uploadType);
+        pictureUpload.setCompress(true,100,100);
+        pictureUpload.setOnlyCamera(true);
+        pictureUpload.setMaxSelectNum(num);
 
-            }
-        });
         return  pictureUpload;
     }
 
-
     @Override
     public boolean dispatchKeyEvent(KeyEvent event) {
         //XLog.e("event:"+event.getKeyCode());
@@ -356,22 +362,31 @@ public class ScanPhotosMainActivity extends  BaseActivity implements StoJNI.Scan
         showSuccessToast("扫描成功");
         urlCode = scanResult;
         pictureSelectorUpload.authCamera();
+        setActionTake();
     }
 
+    private void setActionScan(){
+        llTakePicture.setVisibility(View.GONE);
+        llConfirm.setVisibility(View.GONE);
+        llScanConfirm.setVisibility(View.VISIBLE);
+    }
+
+    private void setActionTake (){
+        llTakePicture.setVisibility(View.VISIBLE);
+        llConfirm.setVisibility(View.VISIBLE);
+        llScanConfirm.setVisibility(View.GONE);
+    }
 
     private void pictureInbound(){
         if (!validate()){
             return;
         }
 
-
         if (!checkRepeat(Urls.FXY_DETECTION_CODE_PHOTO+(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_CODE_PHOTO).upJson(postParam)
                 .execute(new MyDialogCallback(this, true, true) {
                     @Override
@@ -384,7 +399,7 @@ public class ScanPhotosMainActivity extends  BaseActivity implements StoJNI.Scan
                                 pictureSelectorUpload.emptyRemake();//清空图片
                                 photoList.clear();
                                 urlCode = "";
-
+                                setActionScan();
                             }else{
                                 showWarningToast(bean.msg);
                             }
@@ -401,7 +416,7 @@ public class ScanPhotosMainActivity extends  BaseActivity implements StoJNI.Scan
      * 校验必录
      */
     private boolean validate(){
-        photoList = pictureSelectorUpload.getPhotoList();
+        photoList = pictureSelectorUpload.getOssPhotoList();
 
         if (urlCode.isEmpty()){
             showWarningToast("请选扫码");
@@ -428,13 +443,13 @@ public class ScanPhotosMainActivity extends  BaseActivity implements StoJNI.Scan
     }
 
     //sIsGoodinfoMatch,sIsBattery,sIsMagnetic,sIsWood,sIsExtra,sIsOther
-    @OnClick({R.id.btn_confirm})
+    @OnClick({R.id.btn_scan_confirm,R.id.btn_confirm})
     public void onViewClicked(View view) {
         Bundle bundle = new Bundle();
         switch (view.getId()) {
 
-           case R.id.btn_confirm:
-               if (urlCode.isEmpty() || (pictureSelectorUpload!=null && pictureSelectorUpload.getPhotoList().size()==0) ){
+           case R.id.btn_scan_confirm:
+               if (urlCode.isEmpty() || (pictureSelectorUpload!=null && pictureSelectorUpload.getOssPhotoList().size()==0) ){
                    ActivityScanerCode.setScanerListener(mScanerListener);
                    ActivityScanerCode.intent2Activity(mContext, BaseConfig.COMMON_SCANNER_ONLY);
                }else{
@@ -452,22 +467,25 @@ public class ScanPhotosMainActivity extends  BaseActivity implements StoJNI.Scan
                        @Override
                        public void onClick(DialogInterface dialogInterface, int i) {
                            //取消上传任务
-                           pictureInbound();
+
 
                        }
                    }).show();
                }
 
+                break;
+            case R.id.btn_confirm:
+                pictureInbound();
                 break;
             default:
                 break;
         }
     }
 
+
     @Override
     protected void onDestroy() {
         unbinder.unbind();
-        pictureSelectorUpload.removeHandler();
         super.onDestroy();
     }
     @Override

+ 18 - 8
app/src/main/java/com/fxy/main/fragment/HomePagerFragment.java

@@ -35,6 +35,7 @@ import com.fxy.putIn.PutinPalletMainActivity;
 import com.fxy.putIn.PutinPhotosMainActivity;
 import com.fxy.detection.ScanPhotosMainActivity;
 import com.fxy.putIn.TallyMainActivity;
+import com.fxy.putIn.TallyPutInMainActivity;
 import com.fxy.putOut.DeliveryGoodsMainActivity;
 import com.fxy.tool.OrderToolMainActivity;
 import com.fxy.utils.JobUtils;
@@ -176,19 +177,21 @@ public class HomePagerFragment extends BaseFragment implements View.OnClickListe
      * 绑定事件
      * @param v
      */
-    @OnClick({R.id.search_view, R.id.ivt_tally,R.id.ivt_cargo_storage,R.id.ivt_putin_photos,
+    @OnClick({R.id.search_view, R.id.ivt_tally,R.id.ivt_cargo_storage,
             R.id.ivt_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_detection_putaway,R.id.ivt_detection_destroy_outbound,R.id.ivt_detection_make_box,
             R.id.ivt_detection_work,R.id.ivt_scan_photos,R.id.ivt_detection_box_putin,
-            R.id.ivt_detection_tray_putin,R.id.ivt_detection_tray_make})
+            R.id.ivt_detection_tray_putin,R.id.ivt_detection_tray_make, R.id.ivt_detection_plate})
     public void onClick(View v) {
         Bundle bundle = new Bundle();
         switch (v.getId()) {
+
             case R.id.ivt_tally:
-                bundle.putString("action","receive");
-                intent2Page(getActivity(), TallyMainActivity.class, false,bundle);;
+//                bundle.putString("action","receive");
+//                intent2Page(getActivity(), TallyMainActivity.class, false,bundle);;
+                intent2Page(getActivity(), TallyPutInMainActivity.class, false,bundle);;
                 break;
             case R.id.ivt_cargo_storage:
                 bundle.putString("action","storage");
@@ -208,9 +211,9 @@ public class HomePagerFragment extends BaseFragment implements View.OnClickListe
                 bundle.putString("action","add");
                 intent2Page(getActivity(), WorkOrderOptMainActivity.class, false,bundle);
                 break;
-            case R.id.ivt_putin_photos:
-                intent2Page(getActivity(), PutinPhotosMainActivity.class, false,bundle);
-                break;
+//            case R.id.ivt_putin_photos:
+//                intent2Page(getActivity(), PutinPhotosMainActivity.class, false,bundle);
+//                break;
             case R.id.ivt_putin_pallet:
                 intent2Page(getActivity(), PutinPalletMainActivity.class, false,bundle);
                 break;
@@ -263,6 +266,10 @@ public class HomePagerFragment extends BaseFragment implements View.OnClickListe
             case R.id.ivt_detection_make_box:
                 intent2Page(getActivity(), BoxMakeMainActivity.class, false,bundle);
                 break;
+            case R.id.ivt_detection_plate:
+                bundle.putString("action","receive");
+                intent2Page(getActivity(), TallyMainActivity.class, false,bundle);;
+                break;
             default:
                 showToast("还没有配置点击事件");
                 break;
@@ -277,7 +284,10 @@ public class HomePagerFragment extends BaseFragment implements View.OnClickListe
     public void onDestroy() {
         super.onDestroy();
         bind.unbind();
-        uploadDialog.unregister();
+        if(uploadDialog!=null){
+            uploadDialog.unregister();
+        }
+
     }
 
 

+ 2 - 1
app/src/main/java/com/fxy/net/Urls.java

@@ -136,7 +136,8 @@ public class Urls {
     //托盘入库
     public static final String FXY_BATCH_PICTURE_INBOUND = "/pda/inbound/batchPictureInbound";
 
-
+    //快递入库
+    public static final String FXY_PALLET_INBOUND = "/pda/inbound/palletInbound";
 
     //获取批次列表
     public static final String FXY_GET_BATCH_LIST = "/pda/tool/getBatchData";

+ 297 - 162
app/src/main/java/com/fxy/putIn/PutinPalletMainActivity.java

@@ -1,6 +1,7 @@
 package com.fxy.putIn;
 
 import android.annotation.SuppressLint;
+import android.app.Dialog;
 import android.content.BroadcastReceiver;
 import android.content.Context;
 import android.content.Intent;
@@ -18,34 +19,35 @@ import android.widget.EditText;
 import android.widget.ImageButton;
 import android.widget.LinearLayout;
 import android.widget.TextView;
-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.baselibrary.util.StringUtils;
+import com.fxy.baselibrary.views.MarqueeTextView;
 import com.fxy.bean.ActionBean;
 import com.fxy.bean.ScanBean;
-import com.fxy.common.PictureSelectorUpload;
+import com.fxy.common.AsyncPictureSelector;
+import com.fxy.common.AsyncPictureUpload;
+import com.fxy.common.CommonDialog;
 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.fxy.putIn.bean.TallyPutInBean;
+import com.fxy.utils.UploadUtils;
 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 java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 import butterknife.BindView;
 import butterknife.ButterKnife;
@@ -62,39 +64,53 @@ public class PutinPalletMainActivity extends  BaseActivity implements StoJNI.Sca
      */
     Context mContext = this;
 
-    //单号清除
-    @BindView(R.id.ib_order_no_clear)
-    ImageButton ibOrderNoClear;
+    @BindView(R.id.et_order_number)
+    EditText etOrderNumber;
+
 
-    //单号
-    @BindView(R.id.et_order_no)
-    EditText etOrderNo;
+    @BindView(R.id.tv_await_num)
+    TextView tvAwaitNum;
 
+    @BindView(R.id.mt_customer_code)
+    MarqueeTextView mtCtn;
 
-    @BindView(R.id.ll_take_picture)
-    LinearLayout llTakePicture;
+    @BindView(R.id.ll_label_picture)
+    LinearLayout llLabelPicture;
 
+    @BindView(R.id.ll_order_number)
+    LinearLayout llOrderNumber;
+    @BindView(R.id.ll_extend_info)
+    LinearLayout llExtendInfo;
 
-    private ArrayList photoList =new ArrayList<>();
 
-    private PictureSelectorUpload pictureSelectorUpload;
     //
     //扫码扫码动作
     private ScanBean scanBean;
 
+    private  ArrayList<String> baseImgList = new ArrayList<>();
+    protected String action;
 
-    //浮动按钮
-    @BindView(R.id.iv_drag)
-    FloatingImageView iv_drag;
 
+    private HashMap<String, AsyncPictureSelector> mapPictureSelector = new HashMap<>();
+    
+    private boolean isRequiredShow = false;
 
+    private String currentPictureType= "label_img";
 
-    protected String action;
+    private Unbinder unbinder;
 
+    private AsyncPictureUpload asyncPictureUpload;
 
-    private Unbinder unbinder;
+    private TallyPutInBean tallyPutInBean;
+
+    private CommonDialog commonDialog;
+
+    //是否需要显示客户
+    private boolean needCustomer;
+
+    //客户名称
+    private String ctn="";
 
-    private JSONObject postParam = new JSONObject();
 
 
     @Override
@@ -115,7 +131,6 @@ public class PutinPalletMainActivity extends  BaseActivity implements StoJNI.Sca
     @Override
     protected void getBundleExtras(Bundle bundle) {
         //XLog.e("接收数据解析:",bundle);
-        action = bundle.getString("action","add");
     }
 
 
@@ -128,12 +143,20 @@ public class PutinPalletMainActivity extends  BaseActivity implements StoJNI.Sca
     @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);
+            // 图片选择结果回调
+            if (requestCode == PictureConfig.CHOOSE_REQUEST) {
+                if (mapPictureSelector.containsKey(currentPictureType)){
+                    mapPictureSelector.get(currentPictureType).getSelectImg(data);
+                }
+                totalAwaitNum();
+//                asyncPictureUpload.setStartUpload();
+
             }
         }
+
+
+
     }
 
     /**
@@ -145,9 +168,14 @@ public class PutinPalletMainActivity extends  BaseActivity implements StoJNI.Sca
     protected void EventBean(BaseEventBusBean event) {
 //        XLog.e("----------接收返回--------------");
 //        XLog.e("接收返回:"+event.getEventCode());
-        if (event != null && event.getEventCode() == EventCode.displacement_refresh){
-
+        assert event != null;
+        switch (event.getEventCode()){
+            case EventCode.file_upload_lister:
+                totalAwaitNum();
+                break;
         }
+
+
     }
 
     @Override
@@ -161,70 +189,50 @@ public class PutinPalletMainActivity extends  BaseActivity implements StoJNI.Sca
         unbinder = ButterKnife.bind(this);
         setTitleName("托盘入库");
 
+        asyncPictureUpload = new AsyncPictureUpload(this);
         initEdit();
         iniData();
+        RecyclerView rvLabelShowImg = (RecyclerView)llLabelPicture.findViewById(R.id.rv_show_img);
+        mapPictureSelector.put("label_img",setItemPicture("label_img",rvLabelShowImg,9999));
 
-        RecyclerView rvShowImg = (RecyclerView)llTakePicture.findViewById(R.id.rv_show_img);
-        pictureSelectorUpload  = setItemPicture("photo",rvShowImg,9,PictureConfig.TYPE_IMAGE);
 
+        totalAwaitNum();
 
-        //监听浮动按钮
-        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);
-                }
-            }
-        });
     }
 
 
-
     /**
      * 设置多个上传文件
-     * @param actionType String
+     * @param uploadType String
      * @param showImg RecyclerView
      */
-    private PictureSelectorUpload setItemPicture(String actionType,RecyclerView showImg,int maxNum,int pictureType){
-        PictureSelectorUpload pictureUpload = new PictureSelectorUpload(PutinPalletMainActivity.this,showImg,"work",maxNum,pictureType);
-        pictureUpload.setActionType(actionType);
-        pictureUpload.setCompress(true,100,500);
-        pictureUpload.setOnlyCamera(true);
-        //showImg.onTouchEvent()
-
-        pictureUpload.setOnChangeListener(new PictureSelectorUpload.UploadChangeListener() {
-            @Override
-            public void uploadResult(boolean State,String actionType) {
-                if (State) {
-
-                }
-            }
+    private AsyncPictureSelector setItemPicture(String uploadType,RecyclerView showImg,int num){
 
-            @Override
-            public void uploadActionType(String actionType) {
-
-                System.out.println("actionType:"+actionType);
+        String notifyUrl = Urls.getServiceAddress(this) + Urls.FXY_DETECTION_PUTIN;
+        AsyncPictureSelector pictureUpload = new AsyncPictureSelector(PutinPalletMainActivity.this,showImg,"tally",uploadType,notifyUrl,false);
+        pictureUpload.setUploadType(uploadType);
+        pictureUpload.setCompress(true,100,100);
+        pictureUpload.setOnlyCamera(true);
+        pictureUpload.setMaxSelectNum(num);
 
-            }
-        });
         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()){
-               pictureSelectorUpload.authCamera();
-            }
+            getPallet();
         }
         return super.dispatchKeyEvent(event);
     }
 
+
+
     //监听按键
     public boolean onKeyDown(int keyCode, KeyEvent event) {
         XLog.e("监听按键:"+keyCode);XLog.e(event);
@@ -331,57 +339,142 @@ public class PutinPalletMainActivity extends  BaseActivity implements StoJNI.Sca
     }
 
     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;
-                    }
-                    pictureSelectorUpload.authCamera();
-                    return false;
-                }
-                return false;
-            }
-        });
-        etOrderNo.addTextChangedListener(new TextWatcher() {
-            public void onTextChanged(CharSequence s, int start, int before, int count) {
-                if (s.length() > 0 ) {
-                    if (etOrderNo.isEnabled()){
-                        ibOrderNoClear.setVisibility(View.VISIBLE);
-                    }
-                    setEditTextNormal(etOrderNo,true);
-                } else {
-                    ibOrderNoClear.setVisibility(View.INVISIBLE);
-                    setEditTextFocused(etOrderNo,true);
-                }
-            }
+        List<EditText> list = new ArrayList<>();
+        list.add(etOrderNumber);
+        unifyEdit(list);
+    }
 
-            public void beforeTextChanged(CharSequence s, int start, int count, int after) {
-            }
 
-            public void afterTextChanged(Editable s) {
+    private void iniData(){
+        baseImgList.add("label_img");
+        initDialog();
+    }
 
+    private void initDialog(){
+        commonDialog = new CommonDialog(mContext, R.style.dialog, "need_ctn", new CommonDialog.OnCloseListener() {
+            @Override
+            public void onClickCancel(Dialog dialog, boolean confirm) {
+                ctn = "" ;
+                dialog.dismiss();
             }
-        });
-        ibOrderNoClear.setOnClickListener(new View.OnClickListener() {
             @Override
-            public void onClick(View view) {
-                etOrderNo.requestFocus();
-                etOrderNo.getText().clear();
+            public void onClickSubmit(Dialog dialog, boolean confirm) {
+                String string = commonDialog.contentTxt.getText().toString().trim();
+                if (commonDialog.getTypeCode().equals("need_ctn")){
+                    ctn = string;
+                }
+                mtCtn.setText(ctn);
+                commonDialog.dismiss();
+                llExtendInfo.setVisibility(View.VISIBLE);
+                if (mapPictureSelector.get(currentPictureType).getOssPhotoList().size()==0){
+                    mapPictureSelector.get(currentPictureType).authCamera();
+                }
             }
         });
+        commonDialog.setContentLabel("");
+
+
     }
 
+    //getAwaitNum
+    private void totalAwaitNum(){
+        int awaitNum = UploadUtils.getAwaitNum(mRealm,getClass().getSimpleName());
+        tvAwaitNum.setText(String.valueOf(awaitNum));
+    }
 
-    private void iniData(){
+    //统一按钮回调
+    @SuppressLint("NonConstantResourceId")
+    public void callbackEditor(View v){
+
+        switch (v.getId()) {
+
+            case R.id.et_order_number:
+
+                getPallet();
+
+                break;
+            default:
+        }
 
     }
 
+    /**
+     * 统一设置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 (actionId == EditorInfo.IME_ACTION_SEND || actionId == EditorInfo.IME_ACTION_DONE   ) {
+                        if (v.getText().toString().trim().isEmpty()) {
+                            setEditTextFocused(v,true);
+                            showWarningToast(v.getHint().toString());
+                            return false;
+                        }else{
+                            setEditTextNormal(v,true);
+                        }
+
+                        callbackEditor(v);
+
+                        return false;
+                    }
+                    return false;
+                }
+            });
+            editText.addTextChangedListener(new TextWatcher() {
+                public void onTextChanged(CharSequence s, int start, int before, int count) {
+                    EditText currentEditText = null;
+                    ImageButton currentImage = null;
+                    //获取焦点的view对象
+                    View view=getWindow().getDecorView().findFocus();
+                    //如果是EditText
+                    if(view instanceof EditText){
+                        currentEditText = (EditText) view;
+                        currentImage = getChildImageButton((LinearLayout)currentEditText.getParent());
+                    }
+
+                    if (s.length() > 0  ) {
+
+                        if (currentImage !=null ){
+                            currentImage.setVisibility(View.VISIBLE);
+                        }
+                        if (currentEditText!=null){
+                            setEditTextNormal(currentEditText,true);
+                        }
+
+                    } else {
+                        if (currentImage !=null ){
+                            currentImage.setVisibility(View.INVISIBLE);
+                        }
+                        if (currentEditText!=null && isRequiredShow){
+                            setEditTextFocused(currentEditText,true);
+                        }
+                    }
+                }
+
+                public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+                }
+
+                public void afterTextChanged(Editable s) {
+
+                }
+            });
+
+            if (imageButton !=null ){
+                unifyClearEdit(imageButton);
+            }
+        }
+    }
 
 
     private OnRxScanerListener mScanerListener = new OnRxScanerListener() {
@@ -409,116 +502,158 @@ public class PutinPalletMainActivity extends  BaseActivity implements StoJNI.Sca
         if(view instanceof EditText)
         {
             ((EditText) view).setText(scanResult);
+            showSuccessToast("扫描成功");
+            callbackEditor(view);
+        }
+    }
 
-            switch (view.getId()) {
-                case R.id.et_order_no:
-                    pictureSelectorUpload.authCamera();
-                    break;
-                default:
-            }
 
+    //检查是否存在上传
+    private void checkIsUpload(){
 
-        }
     }
 
 
-    private void pictureInbound(){
-        if (!validate()){
-            return;
-        }
 
 
-        if (!checkRepeat(Urls.FXY_BATCH_PICTURE_INBOUND+(postParam.toString()))){
-            Toast.makeText(this, getString(R.string.error_data_processed), Toast.LENGTH_LONG).show();
+    //获取跟踪单号
+    private void getPallet(){
+
+        checkIsUpload();
+        if (etOrderNumber.getText().toString().isEmpty()){
+            showErrorToast(etOrderNumber.getHint().toString());
             return;
         }
+        Map<String,Object> math = new HashMap<>();
+        math.put("tracking_number",etOrderNumber.getText().toString().trim());
 
-
-
-        OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_BATCH_PICTURE_INBOUND).upJson(postParam)
+        String mathJson = (new Gson()).toJson(math);
+         OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_SCAN_PALLET_TRACKING).upJson(mathJson)
                 .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);
-                                pictureSelectorUpload.emptyRemake();//清空图片
-                                photoList.clear();
-                                etOrderNo.setText("");
+                            if (bean.data!=null && !bean.data.isEmpty() && !bean.data.equals("[]")){
+                                tallyPutInBean =  JsonUtil.jsonString2Bean(bean.data,TallyPutInBean.class);
+                            }else{
+                                tallyPutInBean = new TallyPutInBean();
+                            }
+
+                            String voiceName = tallyPutInBean.getVoiceName();
 
+                            if(bean.code == 1){
+                                showSuccessToast(bean.msg,voiceName);
+                                commonDialog.setTitle("托数","请输入托数").setContent(ctn).show();
                             }else{
-                                showWarningToast(bean.msg);
+                                showWarningToast(bean.msg,voiceName);
                             }
-                        } catch (Exception e) {
+                        }catch (Exception e) {
                             e.printStackTrace();
-                            XLog.e("添加理货数据结果返回错误",e.getMessage());
+                            XLog.e("确认错误",e.getMessage());
                         }
+
                     }
                 });
     }
 
 
-    /*
-     * 校验必录
-     */
-    private boolean validate(){
-        photoList = pictureSelectorUpload.getPhotoList();
-        //数据检查不通过
-        String orderNo = etOrderNo.getText().toString().trim();
-        if (orderNo.isEmpty()){
-            showWarningToast(etOrderNo.getHint().toString());
-            return false;
+    //提交面单信息
+    private void palletInbound(){
+        checkIsUpload();
+        if (etOrderNumber.getText().toString().isEmpty()){
+            showErrorToast(etOrderNumber.getHint().toString());
+            return;
         }
-        try {
 
+        Gson gson = new Gson();
+        Map<String,Object> math = new HashMap<>();
+        math.put("tracking_number",etOrderNumber.getText().toString().trim());
+        math.put("ctn",ctn);
 
+        //面单
+        List<String> stringList = mapPictureSelector.get("label_img").getOssPhotoList();
+        if (stringList.size()==0){
+            showWarningToast("面单照片不能为空");
+            return;
+        }
+        math.put("label_img_tag",mapPictureSelector.get("label_img").getUniqueTag());
+        math.put("label_img",gson.toJson(stringList));
 
 
-            postParam = new JSONObject();
+        OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_PALLET_INBOUND).upJson(gson.toJson(math))
+                .execute(new MyDialogCallback(this, true, true) {
+                    @Override
+                    public void onSuccess(Response<String> response) {
+                        super.onSuccess(response);
+                        try {
 
-            //检查是否拍照  工单处理时拍照拍照非必传
-            if (photoList.size()==0){
-                showWarningToast("请拍照上传");
-                return false;
-            }
-            Gson gson = new Gson();
-            postParam.put("photo",gson.toJson(photoList));
-            postParam.put("tracking_number",orderNo);
-
-        } catch (JSONException e) {
-            showWarningToast("系统异常"+e.getMessage());
-            e.printStackTrace();
-            return false;
-        }
+                            ActionBean bean = JsonUtil.getObject(response.body(), ActionBean.class);
+                            if (bean.data!=null && !bean.data.isEmpty() && !bean.data.equals("[]")){
+                                tallyPutInBean =  JsonUtil.jsonString2Bean(bean.data,TallyPutInBean.class);
+                            }
 
+                            String voiceName = tallyPutInBean.getVoiceName();
+                            if(bean.code == 1){
+                                showSuccessToast(bean.msg,voiceName);
+                                initFinish();
+                            }else{
+                                showWarningToast(bean.msg,voiceName);
+                            }
 
+                        }catch (Exception e) {
+                            e.printStackTrace();
+                            XLog.e("错误",e.getMessage());
+                        }
+                    }
+                });
 
-        return true;
+    }
+
+
+    private void initFinish(){
+        etOrderNumber.setText("");
+        etOrderNumber.setEnabled(true);
+        for (int i=0;i<baseImgList.size();i++){
+            if (mapPictureSelector.containsKey(baseImgList.get(i))){
+                mapPictureSelector.get(baseImgList.get(i)).emptyRemake();
+            }
+        }
+        etOrderNumber.requestFocus();
+        llExtendInfo.setVisibility(View.GONE);
+        ctn = "";
     }
 
     //sIsGoodinfoMatch,sIsBattery,sIsMagnetic,sIsWood,sIsExtra,sIsOther
-    @OnClick({R.id.btn_confirm,R.id.btn_photos})
+    @OnClick({R.id.btn_confirm,R.id.tv_edit_customer})
     public void onViewClicked(View view) {
         Bundle bundle = new Bundle();
         switch (view.getId()) {
-            case R.id.btn_photos:
-                pictureSelectorUpload.authCamera();
+            case R.id.btn_confirm:
+                palletInbound();
                 break;
-           case R.id.btn_confirm:
-                pictureInbound();
+            case R.id.tv_edit_customer:
+                commonDialog.setTitle("托数","请输入托数").setContent(ctn).show();
                 break;
             default:
                 break;
         }
     }
 
+
+
+
+
+
+
     @Override
     protected void onDestroy() {
         unbinder.unbind();
-        pictureSelectorUpload.removeHandler();
         super.onDestroy();
+        asyncPictureUpload.removeHandler();
     }
     @Override
     protected void onResume() {

+ 0 - 2
app/src/main/java/com/fxy/putIn/PutinPhotosMainActivity.java

@@ -775,8 +775,6 @@ public class PutinPhotosMainActivity extends  BaseActivity implements StoJNI.Sca
             e.printStackTrace();
 
         }
-
-
     }
 
 

+ 742 - 0
app/src/main/java/com/fxy/putIn/TallyPutInMainActivity.java

@@ -0,0 +1,742 @@
+package com.fxy.putIn;
+
+import android.annotation.SuppressLint;
+import android.app.AlertDialog;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.os.Build;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.support.v7.widget.RecyclerView;
+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 androidx.annotation.RequiresApi;
+
+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.bean.ActionBean;
+import com.fxy.bean.ScanBean;
+import com.fxy.common.AsyncPictureSelector;
+import com.fxy.common.AsyncPictureUpload;
+import com.fxy.constant.BaseConfig;
+import com.fxy.constant.EventCode;
+import com.fxy.net.MyDialogCallback;
+import com.fxy.net.Urls;
+import com.fxy.putIn.bean.TallyPutInBean;
+import com.fxy.utils.UploadUtils;
+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 java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+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 TallyPutInMainActivity extends  BaseActivity implements StoJNI.ScanCallBack{
+
+    /**
+     * 列表适配器
+     */
+    Context mContext = this;
+
+    @BindView(R.id.et_order_number)
+    EditText etOrderNumber;
+
+    @BindView(R.id.tv_qty)
+    TextView tvQty;
+
+    @BindView(R.id.tv_await_num)
+    TextView tvAwaitNum;
+
+
+    @BindView(R.id.ll_label_picture)
+    LinearLayout llLabelPicture;
+
+    @BindView(R.id.ll_order_number)
+    LinearLayout llOrderNumber;
+
+
+    //
+    //扫码扫码动作
+    private ScanBean scanBean;
+
+    private  ArrayList<String> baseImgList = new ArrayList<>();
+    protected String action;
+
+
+    private HashMap<String, AsyncPictureSelector> mapPictureSelector = new HashMap<>();
+    
+    private boolean isRequiredShow = false;
+
+    private String currentPictureType= "label_img";
+
+    private Unbinder unbinder;
+
+    private AsyncPictureUpload asyncPictureUpload;
+
+    private TallyPutInBean tallyPutInBean;
+
+    //是否重新打开
+    private int isOpen=0;
+    //强制更改
+    private int isChange=0;
+
+    @Override
+    public int getContentViewResId() {
+        return R.layout.activity_fxy_tray_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 (mapPictureSelector.containsKey(currentPictureType)){
+                    mapPictureSelector.get(currentPictureType).getSelectImg(data);
+                }
+                totalAwaitNum();
+//                asyncPictureUpload.setStartUpload();
+                submitLabelImg();
+            }
+        }
+
+
+
+    }
+
+    /**
+     * EventBus接收信息的方法,开启后才会调用(非粘性事件)
+     *
+     * @param event
+     */
+    @Override
+    protected void EventBean(BaseEventBusBean event) {
+//        XLog.e("----------接收返回--------------");
+//        XLog.e("接收返回:"+event.getEventCode());
+        assert event != null;
+        switch (event.getEventCode()){
+            case EventCode.file_upload_lister:
+                totalAwaitNum();
+                break;
+        }
+
+
+    }
+
+    @Override
+    public boolean isPlayMusic() {
+        return true;
+    }
+
+
+    @Override
+    protected void initView() {
+        unbinder = ButterKnife.bind(this);
+        setTitleName("快递打板");
+
+        asyncPictureUpload = new AsyncPictureUpload(this);
+        initEdit();
+        iniData();
+        RecyclerView rvLabelShowImg = (RecyclerView)llLabelPicture.findViewById(R.id.rv_show_img);
+        mapPictureSelector.put("label_img",setItemPicture("label_img",rvLabelShowImg,9999));
+
+
+        totalAwaitNum();
+
+    }
+
+
+    /**
+     * 设置多个上传文件
+     * @param uploadType String
+     * @param showImg RecyclerView
+     */
+    private AsyncPictureSelector setItemPicture(String uploadType,RecyclerView showImg,int num){
+
+        String notifyUrl = Urls.getServiceAddress(this) + Urls.FXY_DETECTION_PUTIN;
+        AsyncPictureSelector pictureUpload = new AsyncPictureSelector(TallyPutInMainActivity.this,showImg,"tally",uploadType,notifyUrl,false);
+        pictureUpload.setUploadType(uploadType);
+        pictureUpload.setCompress(true,100,100);
+        pictureUpload.setOnlyCamera(true);
+        pictureUpload.setMaxSelectNum(num);
+
+        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){
+            //按确定键
+            getPallet();
+        }
+        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() {
+        List<EditText> list = new ArrayList<>();
+        list.add(etOrderNumber);
+        unifyEdit(list);
+    }
+
+
+    private void iniData(){
+        baseImgList.add("label_img");
+    }
+
+    //getAwaitNum
+    private void totalAwaitNum(){
+        int awaitNum = UploadUtils.getAwaitNum(mRealm,getClass().getSimpleName());
+        tvAwaitNum.setText(String.valueOf(awaitNum));
+    }
+
+    //统一按钮回调
+    @SuppressLint("NonConstantResourceId")
+    public void callbackEditor(View v){
+
+        switch (v.getId()) {
+
+            case R.id.et_order_number:
+
+                getPallet();
+
+                break;
+            default:
+        }
+
+    }
+
+    /**
+     * 统一设置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 (actionId == EditorInfo.IME_ACTION_SEND || actionId == EditorInfo.IME_ACTION_DONE   ) {
+                        if (v.getText().toString().trim().isEmpty()) {
+                            setEditTextFocused(v,true);
+                            showWarningToast(v.getHint().toString());
+                            return false;
+                        }else{
+                            setEditTextNormal(v,true);
+                        }
+
+                        callbackEditor(v);
+
+                        return false;
+                    }
+                    return false;
+                }
+            });
+            editText.addTextChangedListener(new TextWatcher() {
+                public void onTextChanged(CharSequence s, int start, int before, int count) {
+                    EditText currentEditText = null;
+                    ImageButton currentImage = null;
+                    //获取焦点的view对象
+                    View view=getWindow().getDecorView().findFocus();
+                    //如果是EditText
+                    if(view instanceof EditText){
+                        currentEditText = (EditText) view;
+                        currentImage = getChildImageButton((LinearLayout)currentEditText.getParent());
+                    }
+
+                    if (s.length() > 0  ) {
+
+                        if (currentImage !=null ){
+                            currentImage.setVisibility(View.VISIBLE);
+                        }
+                        if (currentEditText!=null){
+                            setEditTextNormal(currentEditText,true);
+                        }
+
+                    } else {
+                        if (currentImage !=null ){
+                            currentImage.setVisibility(View.INVISIBLE);
+                        }
+                        if (currentEditText!=null && isRequiredShow){
+                            setEditTextFocused(currentEditText,true);
+                        }
+                    }
+                }
+
+                public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+                }
+
+                public void afterTextChanged(Editable s) {
+
+                }
+            });
+
+            if (imageButton !=null ){
+                unifyClearEdit(imageButton);
+            }
+        }
+    }
+
+
+    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);
+            showSuccessToast("扫描成功");
+            callbackEditor(view);
+        }
+    }
+
+
+    //检查是否存在上传
+    private void checkIsUpload(){
+
+    }
+
+
+
+
+    //获取跟踪单号
+    private void getPallet(){
+
+        checkIsUpload();
+        if (etOrderNumber.getText().toString().isEmpty()){
+            showErrorToast(etOrderNumber.getHint().toString());
+            return;
+        }
+        Map<String,Object> math = new HashMap<>();
+        math.put("pallet_code",etOrderNumber.getText().toString().trim());
+        if (isOpen>0){
+            math.put("is_open",isOpen);
+        }
+
+        String mathJson = (new Gson()).toJson(math);
+         OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_CHECK_PALLET).upJson(mathJson)
+                .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.data!=null && !bean.data.isEmpty() && !bean.data.equals("[]")){
+                                tallyPutInBean =  JsonUtil.jsonString2Bean(bean.data,TallyPutInBean.class);
+                            }else{
+                                tallyPutInBean = new TallyPutInBean();
+                            }
+
+                            String voiceName = tallyPutInBean.getVoiceName();
+
+                            if (tallyPutInBean.getIsOpen() == 1) {
+                                new AlertDialog.Builder(mContext)
+                                        .setTitle(R.string.dl_hint)
+                                        .setMessage(bean.msg)
+                                        .setNegativeButton(R.string.str_submit, new DialogInterface.OnClickListener() {
+                                            @RequiresApi(api = Build.VERSION_CODES.KITKAT)
+                                            @Override
+                                            public void onClick(DialogInterface dialogInterface, int i) {
+                                                isOpen = 1;
+                                                getPallet();
+                                            }
+                                        }).setPositiveButton(R.string.str_cancel, new DialogInterface.OnClickListener() {
+                                    @Override
+                                    public void onClick(DialogInterface dialogInterface, int i) {
+                                        //取消不做操作
+                                        isOpen = 0;
+                                    }
+                                }).show();
+                            }
+
+
+                            tvQty.setText(String.valueOf(tallyPutInBean.getQty()));
+                            if(bean.code == 1){
+                                showSuccessToast(bean.msg,voiceName);
+                                mapPictureSelector.get(currentPictureType).authCamera();
+                            }else{
+                                showWarningToast(bean.msg,voiceName);
+                            }
+                        }catch (Exception e) {
+                            e.printStackTrace();
+                            XLog.e("确认错误",e.getMessage());
+                        }
+
+                    }
+                });
+    }
+
+
+    //提交面单信息
+    private void submitLabelImg(){
+        checkIsUpload();
+        if (etOrderNumber.getText().toString().isEmpty()){
+            showErrorToast(etOrderNumber.getHint().toString());
+            return;
+        }
+
+        Gson gson = new Gson();
+        Map<String,Object> math = new HashMap<>();
+        math.put("pallet_code",tallyPutInBean.getPalletCode().trim());
+
+
+        //面单
+        List<String> stringList = mapPictureSelector.get("label_img").getOssPhotoList();
+        if (stringList.size()==0){
+            showWarningToast("面单照片不能为空");
+            return;
+        }
+        math.put("label_img_tag",mapPictureSelector.get("label_img").getUniqueTag());
+        math.put("label_img",gson.toJson(stringList));
+
+        if (isChange>0){
+            math.put("is_change",isChange);
+        }
+
+        if (isOpen>0){
+            math.put("is_open",isOpen);
+        }
+
+
+        OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_PICTURE_INBOUND).upJson(gson.toJson(math))
+                .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.data!=null && !bean.data.isEmpty() && !bean.data.equals("[]")){
+                                tallyPutInBean =  JsonUtil.jsonString2Bean(bean.data,TallyPutInBean.class);
+                            }
+
+                            tvQty.setText(String.valueOf(tallyPutInBean.getQty()));
+                            String voiceName = tallyPutInBean.getVoiceName();
+                            if(bean.code == 1){
+                                showSuccessToast(bean.msg,voiceName);
+                                for (int i=0;i<baseImgList.size();i++){
+                                    if (mapPictureSelector.containsKey(baseImgList.get(i))){
+                                        mapPictureSelector.get(baseImgList.get(i)).emptyRemake();
+                                    }
+                                }
+                                mapPictureSelector.get(currentPictureType).authCamera();
+                            }else{
+
+                                if (tallyPutInBean.getIsChange() ==1){
+                                    new AlertDialog.Builder(mContext)
+                                            .setTitle(R.string.dl_hint)
+                                            .setMessage(bean.msg)
+                                            .setNegativeButton(R.string.str_submit, new DialogInterface.OnClickListener() {
+                                                @RequiresApi(api = Build.VERSION_CODES.KITKAT)
+                                                @Override
+                                                public void onClick(DialogInterface dialogInterface, int i) {
+                                                    isChange = 1;
+                                                    submitLabelImg();
+                                                }
+                                            }).setPositiveButton(R.string.str_cancel, new DialogInterface.OnClickListener() {
+                                        @Override
+                                        public void onClick(DialogInterface dialogInterface, int i) {
+                                            //取消不做操作
+                                            isChange = 0;
+                                        }
+                                    }).show();
+                                }else{
+                                    showWarningToast(bean.msg,voiceName);
+                                }
+
+                            }
+
+                        }catch (Exception e) {
+                            e.printStackTrace();
+                            XLog.e("错误",e.getMessage());
+                        }
+                    }
+                });
+
+    }
+
+
+
+    private void closePallet(){
+
+        if (etOrderNumber.getText().toString().isEmpty()){
+            showErrorToast(etOrderNumber.getHint().toString());
+            return;
+        }
+        Map<String,Object> math = new HashMap<>();
+        math.put("pallet_code",etOrderNumber.getText().toString().trim());
+
+        String mathJson = (new Gson()).toJson(math);
+        OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_CLOSE_PALLET).upJson(mathJson)
+                .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);
+                                etOrderNumber.setText("");
+                                etOrderNumber.setEnabled(true);
+                                for (int i=0;i<baseImgList.size();i++){
+                                    if (mapPictureSelector.containsKey(baseImgList.get(i))){
+                                        mapPictureSelector.get(baseImgList.get(i)).emptyRemake();
+                                    }
+                                }
+                                etOrderNumber.requestFocus();
+                                tvQty.setText("0");
+                                isOpen = 0;
+                                isChange = 0;
+                            }else{
+                                showWarningToast(bean.msg);
+                            }
+                        }catch (Exception e) {
+                            e.printStackTrace();
+                            XLog.e("关闭托盘错误",e.getMessage());
+                        }
+
+                    }
+                });
+        
+    }
+
+
+
+    //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:
+                closePallet();
+                break;
+            default:
+                break;
+        }
+    }
+
+
+
+
+
+
+
+    @Override
+    protected void onDestroy() {
+        unbinder.unbind();
+        super.onDestroy();
+        asyncPictureUpload.removeHandler();
+    }
+    @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());
+        }
+    }
+
+}

+ 89 - 0
app/src/main/java/com/fxy/putIn/bean/TallyPutInBean.java

@@ -0,0 +1,89 @@
+package com.fxy.putIn.bean;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+public class TallyPutInBean implements Parcelable {
+    private int qty = 0;//
+    public String pallet_code = "";
+    private String voice_name= "";
+    private int is_open = 0;
+    private int is_change = 0;
+    public TallyPutInBean(){
+    }
+
+
+    protected TallyPutInBean(Parcel in) {
+        qty = in.readInt();
+        pallet_code = in.readString();
+        voice_name = in.readString();
+        is_open = in.readInt();
+        is_change = in.readInt();
+    }
+
+    @Override
+    public void writeToParcel(Parcel dest, int flags) {
+        dest.writeInt(qty);
+        dest.writeString(pallet_code);
+        dest.writeString(voice_name);
+        dest.writeInt(is_open);
+        dest.writeInt(is_change);
+    }
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    public static final Creator<TallyPutInBean> CREATOR = new Creator<TallyPutInBean>() {
+        @Override
+        public TallyPutInBean createFromParcel(Parcel in) {
+            return new TallyPutInBean(in);
+        }
+
+        @Override
+        public TallyPutInBean[] newArray(int size) {
+            return new TallyPutInBean[size];
+        }
+    };
+
+    public int getQty() {
+        return qty;
+    }
+
+    public void setQty(int qty) {
+        this.qty = qty;
+    }
+
+    public String getPalletCode() {
+        return pallet_code;
+    }
+
+    public void setPalletCode(String pallet_code) {
+        this.pallet_code = pallet_code;
+    }
+
+    public String getVoiceName() {
+        return voice_name;
+    }
+
+    public void setVoiceName(String voice_name) {
+        this.voice_name = voice_name;
+    }
+
+    public int getIsOpen() {
+        return is_open;
+    }
+
+    public void setIsOpen(int is_open) {
+        this.is_open = is_open;
+    }
+
+    public int getIsChange() {
+        return is_change;
+    }
+
+    public void setIsChange(int is_change) {
+        this.is_change = is_change;
+    }
+}

+ 52 - 44
app/src/main/res/layout/activity_fxy_putin_pallet.xml

@@ -19,24 +19,65 @@
             android:orientation="vertical">
 
             <LinearLayout
+                android:id="@+id/ll_order_number"
                 style="@style/FromLinearLayoutItem"
                 android:orientation="horizontal">
                 <EditText
                     style="@style/EditTextStyle"
-                    android:id="@+id/et_order_no"
-                    android:hint="@string/hint_please_scan_no"
+                    android:id="@+id/et_order_number"
+                    android:hint="扫描或者输FX单号"
                     android:text=""/>
-                <ImageButton
-                    style="@style/ClearImg"
-                    android:id="@+id/ib_order_no_clear"/>
+                <include layout="@layout/item_image_close" />
 
             </LinearLayout>
 
             <LinearLayout
-                android:id="@+id/ll_take_picture"
+                android:id="@+id/ll_extend_info"
+                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:visibility="gone"
+                android:paddingRight="10dp">
+                <LinearLayout
+                    android:id="@+id/ll_customer_code"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:paddingBottom="5dp"
+                    android:paddingTop="5dp"
+
+                    android:orientation="horizontal">
+
+                    <TextView
+                        style="@style/tvLeftStyle"
+                        android:text="托数" />
+                    <TextView
+                        style="@style/tvLeftStyle"
+                        android:text=":" />
+
+                    <com.fxy.baselibrary.views.MarqueeTextView
+                        style="@style/mtRightStyle"
+                        android:id="@+id/mt_customer_code"
+
+                        />
+
+                    <TextView
+                        android:id="@+id/tv_edit_customer"
+                        style="@style/tvLeftStyle"
+                        android:text="修改"
+                        android:textColor="@color/actionsheet_blue" />
+                </LinearLayout>
+            </LinearLayout>
+
+            <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"
@@ -46,7 +87,7 @@
                     android:background="@null"
                     android:padding="@dimen/dp_10"
                     android:gravity="center_vertical"
-                    android:orientation="vertical">
+                    android:orientation="horizontal">
                     <TextView
                         style="@style/fontSize"
                         android:layout_width="wrap_content"
@@ -54,42 +95,10 @@
                         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:visibility="gone"
-                android:padding="10dp">
-                <TextView
-                    style="@style/fontSize"
-                    android:id="@+id/btn_photos"
-                    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
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
@@ -100,7 +109,6 @@
                 android:background="@drawable/bg_white_et"
                 android:gravity="center_vertical"
                 android:orientation="horizontal"
-                android:layout_gravity="bottom"
                 android:padding="10dp">
                 <TextView
                     style="@style/fontSize"
@@ -111,12 +119,12 @@
                     android:layout_marginRight="@dimen/dp_10"
                     android:background="@drawable/bg_orange_item"
                     android:gravity="center"
-                    android:text="确认提交"
+                    android:text="确认入库"
                     android:padding="10dp"
                     android:textColor="@color/white"
                     android:visibility="visible" />
             </LinearLayout>
-            <include layout="@layout/item_float_image" />
+            <include layout="@layout/item_upload_await_number" />
         </LinearLayout>
 
 

+ 35 - 1
app/src/main/res/layout/activity_fxy_scan_photos.xml

@@ -46,6 +46,7 @@
             </LinearLayout>
 
             <LinearLayout
+                android:id="@+id/ll_scan_confirm"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_marginLeft="@dimen/dp_10"
@@ -59,7 +60,7 @@
                 android:padding="10dp">
                 <TextView
                     style="@style/fontSize"
-                    android:id="@+id/btn_confirm"
+                    android:id="@+id/btn_scan_confirm"
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
                     android:layout_marginLeft="@dimen/dp_10"
@@ -71,7 +72,40 @@
                     android:textColor="@color/white"
                     android:visibility="visible" />
             </LinearLayout>
+
+            <LinearLayout
+                android:id="@+id/ll_confirm"
+                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:visibility="gone"
+                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>
+            <include layout="@layout/item_upload_await_number" />
+
             <include layout="@layout/item_float_image" />
+
+
         </LinearLayout>
 
 

+ 114 - 0
app/src/main/res/layout/activity_fxy_tray_putin.xml

@@ -0,0 +1,114 @@
+<?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_order_number"
+                style="@style/FromLinearLayoutItem"
+                android:orientation="horizontal">
+                <EditText
+                    style="@style/EditTextStyle"
+                    android:id="@+id/et_order_number"
+                    android:hint="扫描或者输托盘码"
+                    android:text=""/>
+                <include layout="@layout/item_image_close" />
+
+            </LinearLayout>
+
+
+
+            <LinearLayout
+                android:id="@+id/ll_label_picture"
+                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:background="@null"
+                    android:padding="@dimen/dp_10"
+                    android:gravity="center_vertical"
+                    android:orientation="horizontal">
+                    <TextView
+                        style="@style/fontSize"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:textStyle="bold"
+                        android:text="拍照">
+                    </TextView>
+                    <TextView
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:singleLine="true"
+                        android:gravity="right"
+                        android:textSize="@dimen/t24"
+                        android:textColor="@color/actionsheet_red"
+                        android:text="已拍照数量:"
+                        tools:ignore="RtlHardcoded">
+
+                    </TextView>
+                    <TextView
+                        android:id="@+id/tv_qty"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:textSize="@dimen/t24"
+                        android:layout_marginRight="10dp"
+                        android:textColor="@color/actionsheet_red"
+                        android:text="0">
+
+                    </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: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>
+            <include layout="@layout/item_upload_await_number" />
+        </LinearLayout>
+
+
+    </ScrollView>
+
+
+</LinearLayout>

+ 25 - 25
app/src/main/res/layout/fragment_homepager.xml

@@ -81,7 +81,7 @@
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_gravity="center"
-                        android:text="@string/index_put_in"
+                        android:text="返修"
                         android:textColor="@color/black_3d3d3d"
                         android:textSize="@dimen/t14"
                         android:textStyle="bold" />
@@ -92,13 +92,13 @@
                         android:layout_marginTop="@dimen/t12"
                         android:weightSum="2">
 
+
                         <TextView
-                            android:id="@+id/ivt_putin_photos"
+                            android:id="@+id/ivt_tally"
                             style="@style/ImageViewWithTextStyle.FontSize"
-                            android:drawableTop="@drawable/ic_putin_photos"
+                            android:drawableTop="@drawable/ic_mapan"
                             android:drawablePadding="5dp"
-                            android:text="快递入库" />
-
+                            android:text="快递打板" />
                         <TextView
                             android:id="@+id/ivt_putin_pallet"
                             style="@style/ImageViewWithTextStyle.FontSize"
@@ -114,12 +114,7 @@
                         android:layout_marginTop="@dimen/t12"
                         android:weightSum="2">
 
-                        <TextView
-                            android:id="@+id/ivt_tally"
-                            style="@style/ImageViewWithTextStyle.FontSize"
-                            android:drawableTop="@drawable/ic_mapan"
-                            android:drawablePadding="5dp"
-                            android:text="打板操作" />
+
 
                         <TextView
                             android:id="@+id/ivt_check"
@@ -250,7 +245,7 @@
                         android:layout_width="wrap_content"
                         android:layout_height="wrap_content"
                         android:layout_gravity="center"
-                        android:text="检测"
+                        android:text="售后"
                         android:textColor="@color/black_3d3d3d"
                         android:textSize="@dimen/t14"
                         android:textStyle="bold" />
@@ -278,13 +273,13 @@
                             android:drawableTop="@drawable/ic_mapan"
                             android:drawablePadding="5dp"
                             android:text="单箱入库" />
-
                         <TextView
-                            style="@style/ImageViewWithTextStyle.FontSize"
-                            android:id="@+id/ivt_detection_tray_putin"
-                            android:drawableTop="@drawable/ic_mapan"
-                            android:drawablePadding="5dp"
-                            android:text="托盘入库" />
+                           android:id="@+id/ivt_detection_plate"
+                           style="@style/ImageViewWithTextStyle.FontSize"
+                           android:drawableTop="@drawable/ic_putin_photos"
+                           android:drawablePadding="5dp"
+                           android:text="打板" />
+
 
                     </TableRow>
 
@@ -294,21 +289,21 @@
                         android:layout_marginTop="@dimen/t12"
                         android:weightSum="2">
 
-
-
                         <TextView
                             style="@style/ImageViewWithTextStyle.FontSize"
-                            android:id="@+id/ivt_detection_tray_make"
+                            android:id="@+id/ivt_detection_tray_putin"
                             android:drawableTop="@drawable/ic_mapan"
                             android:drawablePadding="5dp"
-                            android:text="托盘清点" />
+                            android:text="托盘入库" />
 
                         <TextView
                             style="@style/ImageViewWithTextStyle.FontSize"
-                            android:id="@+id/ivt_scan_photos"
+                            android:id="@+id/ivt_detection_tray_make"
                             android:drawableTop="@drawable/ic_mapan"
                             android:drawablePadding="5dp"
-                            android:text="扫码拍照" />
+                            android:text="托盘清点" />
+
+
 
                     </TableRow>
 
@@ -317,7 +312,12 @@
                         android:layout_height="wrap_content"
                         android:layout_marginTop="@dimen/t12"
                         android:weightSum="2">
-
+                        <TextView
+                            style="@style/ImageViewWithTextStyle.FontSize"
+                            android:id="@+id/ivt_scan_photos"
+                            android:drawableTop="@drawable/ic_mapan"
+                            android:drawablePadding="5dp"
+                            android:text="扫码拍照" />
                         <TextView
                             android:id="@+id/ivt_detection_make_box"
                             style="@style/ImageViewWithTextStyle.FontSize"