Browse Source

返修易功能完成

guilin 2 years ago
parent
commit
e9d0a73429
43 changed files with 2981 additions and 336 deletions
  1. 6 6
      app/build.gradle
  2. 13 0
      app/src/main/AndroidManifest.xml
  3. 15 14
      app/src/main/java/com/fxy/base/CrashHandler.java
  4. 1 1
      app/src/main/java/com/fxy/base/ServiceSettingActivity.java
  5. 10 2
      app/src/main/java/com/fxy/constant/SPCache.java
  6. 15 107
      app/src/main/java/com/fxy/login/LoginActivity.java
  7. 7 118
      app/src/main/java/com/fxy/main/fragment/HomePagerFragment.java
  8. 0 2
      app/src/main/java/com/fxy/main/fragment/MineFragment.java
  9. 23 2
      app/src/main/java/com/fxy/net/Urls.java
  10. 921 0
      app/src/main/java/com/fxy/putIn/TallyMainActivity.java
  11. 51 0
      app/src/main/java/com/fxy/putIn/bean/OrderInfoBean.java
  12. 79 0
      app/src/main/java/com/fxy/putIn/bean/ResultDataBean.java
  13. 930 0
      app/src/main/java/com/fxy/putOut/DeliveryGoodsMainActivity.java
  14. 56 0
      app/src/main/java/com/fxy/view/MyPopupWindow.java
  15. 246 0
      app/src/main/java/com/fxy/view/PopupWindowManager.java
  16. 222 0
      app/src/main/res/layout/activity_fxy_delivery_goods.xml
  17. 272 0
      app/src/main/res/layout/activity_fxy_tally.xml
  18. 0 28
      app/src/main/res/layout/activity_login.xml
  19. 18 52
      app/src/main/res/layout/fragment_homepager.xml
  20. 55 0
      app/src/main/res/layout/item_putin_scan.xml
  21. BIN
      app/src/main/res/mipmap-hdpi/ic_launcher.png
  22. BIN
      app/src/main/res/mipmap-hdpi/ic_launcher_round.png
  23. BIN
      app/src/main/res/mipmap-hdpi/ic_zj_launcher.png
  24. BIN
      app/src/main/res/mipmap-hdpi/ic_zj_launcher_round.png
  25. BIN
      app/src/main/res/mipmap-mdpi/ic_launcher.png
  26. BIN
      app/src/main/res/mipmap-mdpi/ic_launcher_round.png
  27. BIN
      app/src/main/res/mipmap-mdpi/ic_zj_launcher.png
  28. BIN
      app/src/main/res/mipmap-mdpi/ic_zj_launcher_round.png
  29. BIN
      app/src/main/res/mipmap-xhdpi/ic_launcher.png
  30. BIN
      app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
  31. BIN
      app/src/main/res/mipmap-xhdpi/ic_zj_launcher.png
  32. BIN
      app/src/main/res/mipmap-xhdpi/ic_zj_launcher_round.png
  33. BIN
      app/src/main/res/mipmap-xxhdpi/ic_launcher.png
  34. BIN
      app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
  35. BIN
      app/src/main/res/mipmap-xxhdpi/ic_zj_launcher.png
  36. BIN
      app/src/main/res/mipmap-xxhdpi/ic_zj_launcher_round.png
  37. BIN
      app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
  38. BIN
      app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
  39. BIN
      app/src/main/res/mipmap-xxxhdpi/ic_zj_launcher.png
  40. BIN
      app/src/main/res/mipmap-xxxhdpi/ic_zj_launcher_round.png
  41. 2 2
      app/src/main/res/values/styles.xml
  42. 37 0
      baselibrary/src/main/java/com/fxy/baselibrary/base/BaseActivity.java
  43. 2 2
      version.properties

+ 6 - 6
app/build.gradle

@@ -68,7 +68,7 @@ android {
             buildConfigField("String", "VERSION_API", "\"" + rootProject.ext.android.versionApi +  "\"")
             buildConfigField("String", "VERSION_NUM", "\""+rootProject.ext.android.versionName+"\"")
             manifestPlaceholders = [
-                    app_name:"FXY",
+                    app_name:"返修易",
                     icon:"@mipmap/ic_launcher",
                     round_icon:"@mipmap/ic_launcher_round"
             ]
@@ -81,17 +81,17 @@ android {
             shrinkResources false
             minifyEnabled false
             versionNameSuffix "_debug"
-            applicationIdSuffix '.eac.dahuo.debug'
+            applicationIdSuffix '.eac.fxy.debug'
             signingConfig signingConfigs.debug
             manifestPlaceholders = [
-                    app_name:"UAT-EAC",
+                    app_name:"UAT-返修易",
                     icon:"@mipmap/ic_launcher",
                     round_icon:"@mipmap/ic_launcher_round"
             ]
             buildConfigField("String", "OSS_HOST", "\"https://fhdr.oss-cn-shenzhen.aliyuncs.com\"")
             buildConfigField("String", "RESOURCE_TYPE", "\"aliyun\"")
-            buildConfigField("String", "RESOURCE_PREFIX", "\"uat/dahuo/fxy\"")//只是默认值
-            buildConfigField("String", "WELCOME_TITLE", "\"UAT-FXY\"")
+            buildConfigField("String", "RESOURCE_PREFIX", "\"uat/fxy\"")//只是默认值
+            buildConfigField("String", "WELCOME_TITLE", "\"UAT-返修易\"")
             buildConfigField("String", "VERSION_API", "\"" + rootProject.ext.android.versionApi +  "\"")
             buildConfigField("String", "VERSION_NUM", "\""+rootProject.ext.android.versionName+"\"")
             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
@@ -102,7 +102,7 @@ android {
 
     android.applicationVariants.all { variant ->
         variant.outputs.all {
-            outputFileName = "dahuo-pda-${variant.buildType.name}_v${defaultConfig.versionName}_${releaseTime()}.apk"
+            outputFileName = "fxy-pda-${variant.buildType.name}_v${defaultConfig.versionName}_${releaseTime()}.apk"
         }
     }
 /*    // 输出文件配置

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

@@ -252,6 +252,19 @@
             android:screenOrientation="portrait"
             tools:ignore="LockedOrientationActivity"/>
 
+
+        <activity
+            android:name=".putIn.TallyMainActivity"
+            android:windowSoftInputMode="stateHidden|adjustPan"
+            android:screenOrientation="portrait"
+            tools:ignore="DuplicateActivity,LockedOrientationActivity"/>
+
+        <activity
+            android:name=".putOut.DeliveryGoodsMainActivity"
+            android:windowSoftInputMode="stateHidden|adjustPan"
+            android:screenOrientation="portrait"
+            tools:ignore="LockedOrientationActivity"/>
+
     </application>
 
 

+ 15 - 14
app/src/main/java/com/fxy/base/CrashHandler.java

@@ -1,4 +1,5 @@
 package com.fxy.base;
+
 import android.content.Context;
 import android.content.SharedPreferences;
 import android.content.pm.PackageInfo;
@@ -6,32 +7,32 @@ import android.content.pm.PackageManager;
 import android.os.Build;
 
 import com.alibaba.fastjson.JSONException;
-
-import org.json.JSONObject;
-
-import com.fxy.constant.SPCache;
-import com.lzy.okgo.OkGo;
-import com.lzy.okgo.model.Response;
-import com.fxy.baselibrary.util.RxTimeTool;
 import com.fxy.BuildConfig;
+import com.fxy.baselibrary.util.RxTimeTool;
+import com.fxy.constant.SPCache;
 import com.fxy.net.MyDialogCallback;
 import com.fxy.net.Urls;
+import com.lzy.okgo.OkGo;
+import com.lzy.okgo.model.Response;
+
+import org.json.JSONObject;
 
 import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.io.Writer;
 import java.lang.Thread.UncaughtExceptionHandler;
+import java.util.Arrays;
 
 public class CrashHandler implements UncaughtExceptionHandler {
     //系统默认的异常处理器
-    private Thread.UncaughtExceptionHandler defaultCrashHandler;
-    private static CrashHandler crashHandler = new CrashHandler();
+    private UncaughtExceptionHandler defaultCrashHandler;
+    private static com.fxy.base.CrashHandler crashHandler = new com.fxy.base.CrashHandler();
     private Context mContext;
     //私有化构造函数
     private CrashHandler() {
     }
     //获取实例
-    public static CrashHandler getInstance() {
+    public static com.fxy.base.CrashHandler getInstance() {
         return crashHandler;
     }
     public void init(Context context) {
@@ -43,7 +44,7 @@ public class CrashHandler implements UncaughtExceptionHandler {
     @Override
     public void uncaughtException(Thread thread, Throwable throwable) {
         //把错误信息保存在sp中,然后在下次进入页面的时候再上传错误信息
-        saveErrorInfo(throwable);
+        saveErrorInfo(throwable,thread);
         if (defaultCrashHandler != null) {
             //如果在自定义异常处理器之前,系统有自己的默认异常处理器的话,调用它来处理异常信息
             defaultCrashHandler.uncaughtException(thread, throwable);
@@ -82,20 +83,20 @@ public class CrashHandler implements UncaughtExceptionHandler {
         }
     }
 
-    private void saveErrorInfo(Throwable throwable) {
+    private void saveErrorInfo(Throwable throwable,Thread thread) {
         try {
             SharedPreferences sp = mContext.getSharedPreferences("errorInfo", Context.MODE_PRIVATE);
             SPCache spCache = SPCache.getInstance(mContext);
             String accountInfo   = spCache.getUserName()+"("+spCache.getAccountName()+")";
             String stringBuffer = getAppInfo(mContext) +
-                    "崩溃版:" + BuildConfig.BUILD_TYPE + "\n\n" +
+                    "崩溃版:" + BuildConfig.BUILD_TYPE + "\n\n" +
                     "崩溃时间:" + RxTimeTool.getCurTimeString() + "\n\n" +
                     "设备系统:" + Build.VERSION.RELEASE + "\n\n" +
                     "设备厂商:" + Build.MANUFACTURER + "\n\n" +
                     "设备型号:" + Build.MODEL + "\n\n" +
                     "账号信息:" + accountInfo + "\n\n" +
                     "崩溃原因:" + throwable.getMessage() + "\n\n" +
-                    "详细信息:" + collectExceptionInfo(throwable);
+                    "详细信息:" + Arrays.toString(throwable.getStackTrace());
             sp.edit().putString("data", stringBuffer).apply();
         } catch (Exception e) {
             e.printStackTrace();

+ 1 - 1
app/src/main/java/com/fxy/base/ServiceSettingActivity.java

@@ -144,7 +144,7 @@ public class ServiceSettingActivity extends BaseActivity {
      */
     private void loadClientData(){
         try {
-            String clientStr = "[{\"name\":\"FXY\",\"code\":\"fxy\"}]";
+            String clientStr = "[{\"name\":\"返修易\",\"code\":\"fxy\"}]";
 
 
             JSONArray jsonArray = new JSONArray(clientStr);

+ 10 - 2
app/src/main/java/com/fxy/constant/SPCache.java

@@ -175,6 +175,14 @@ public class SPCache {
         editor.putString("current_blues_scale", current_blues_scale).commit();
     }
 
+    //托盘入库托盘
+    public String getPalletNo() {
+        return sp.getString("put_in_pallet_no", "");
+    }
+    public void setPalletNo(String version_info){
+        editor.putString("put_in_pallet_no", version_info).commit();
+    }
+
     //保存理货信息
     public String getTallyInfo() {
         return sp.getString("tally_info", "");
@@ -201,7 +209,7 @@ public class SPCache {
 
     // 仓储资源 域名
     public String getResourceHost() {
-        return sp.getString("resource_host", "https://hcjfiles.oss-cn-hongkong.aliyuncs.com");
+        return sp.getString("resource_host", "https://ossfiles.szeac.com");
     }
     public void setResourceHost(String version_info){
         editor.putString("resource_host", version_info).commit();
@@ -217,7 +225,7 @@ public class SPCache {
 
     // 仓储资源 类型
     public String getResourcePrefix() {
-        return sp.getString("resource_prefix", "dahuo");
+        return sp.getString("resource_prefix", "");
     }
     public void setResourcePrefix(String version_info){
         editor.putString("resource_prefix", version_info).commit();

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

@@ -70,9 +70,6 @@ public class LoginActivity extends BaseActivity {
     @BindView(R.id.log_et_pwd)
     EditText mLogEtPwd;
 
-    //类型
-    @BindView(R.id.ms_log_type)
-    MaterialSpinner msLogTypeSpinner;
 
     /**
      * 服务设置/语言等容器
@@ -80,8 +77,6 @@ public class LoginActivity extends BaseActivity {
     @BindView(R.id.ll_app_setting)
     LinearLayout ll_app_setting;
 
-    //仓库id
-    private Integer warehouseId= 0;
     //默认选中
     private Integer selectIndex= 0;
     // 定义仓库列表
@@ -117,7 +112,7 @@ public class LoginActivity extends BaseActivity {
         super.onActivityResult(requestCode, resultCode, data);
         if (requestCode == 200 && resultCode == 200)//之前提到的两个标志,在这里显示出了作用
         {
-            getWarehouse();
+
         }
     }
 
@@ -162,33 +157,26 @@ public class LoginActivity extends BaseActivity {
     }
 
     private void iniData(){
-
-        //初始化仓库
-        getWarehouse();
-
         // 记住用户名
         String userAccountStr = SPCache.getInstance(LoginActivity.this).getAccountName();
         if (StringUtils.isNotEmpty(userAccountStr)) {
             mLogEtName.setText(userAccountStr);
         }
+        initService();
     }
 
-    private void getWarehouse(){
-        warehouseMapList = new ArrayList<>();
-        warehouseNameList = new ArrayList<String>();
-        CommSharedUtil commSharedUtil = CommSharedUtil.getInstance(LoginActivity.this);
-        final String jsonStr = commSharedUtil.getString(BaseConfig.WAREHOUSE_LIST);
-
-        service_type  = commSharedUtil.getString(BaseConfig.SERVICE_TYPE,"PROD");
-        final String areaCode = commSharedUtil.getString(BaseConfig.AREA_CODE);
-        client_code = commSharedUtil.getString(BaseConfig.CLIENT_CODE,"fxy");
-        //修改默认连接是oss
-        SPCache spCache = SPCache.getInstance(mContext);
-        spCache.setResourceHost(BuildConfig.OSS_HOST);
-        spCache.setResourceType(BuildConfig.RESOURCE_TYPE);
-        spCache.setResourcePrefix(BuildConfig.RESOURCE_PREFIX);
-
-        if (jsonStr==null){
+    /**
+     * 初始化服务端
+     */
+    private void initService(){
+        String serviceAddress = Urls.getServiceAddress(mContext);
+        if (serviceAddress==null || serviceAddress.isEmpty()){
+            //修改默认连接是oss
+            SPCache spCache = SPCache.getInstance(mContext);
+            spCache.setResourceHost(BuildConfig.OSS_HOST);
+            spCache.setResourceType(BuildConfig.RESOURCE_TYPE);
+            spCache.setResourcePrefix(BuildConfig.RESOURCE_PREFIX);
+
             new AlertDialog.Builder(this)
                     .setTitle(R.string.dl_hint)
                     .setMessage("请先服务设置")
@@ -201,86 +189,11 @@ public class LoginActivity extends BaseActivity {
                             intentPageResult(LoginActivity.this,ServiceSettingActivity.class, bundle,200);
                         }
                     }).show();
-
-            return;
         }
-        OkGo.<String>post(Urls.getServiceAddress(this)+ Urls.FMS_GET_WAREHOUSE )
-                .execute(new MyDialogCallback(this, false, true) {
-                    @Override
-                    public void onSuccess(Response<String> response) {
-                        //super.onSuccess(response);
-                        try {
-                            ActionBean bean = JsonUtil.getObject(response.body(), ActionBean.class);
-                            if (bean.code == 1) {
-                                CommSharedUtil commSharedUtil = CommSharedUtil.getInstance(LoginActivity.this);
-                                JSONObject data = new JSONObject(bean.data);
-                                String warehouseStr = data.getString("warehouse");
-                                commSharedUtil.putString(BaseConfig.WAREHOUSE_LIST, warehouseStr);
-                                initWarehouse(warehouseStr);
-                            }
 
-                        } catch (Exception e) {
-                            e.printStackTrace();
-                            XLog.e("获取服务配置错误:",e);
-                        }
-                    }
-                });
-
-
-        initWarehouse(jsonStr);
-    }
-    //初始化仓库选择
-    private void initWarehouse(String jsonStr){
-        //写死数据
-        try {
-            warehouseNameList.clear();
-            warehouseMapList.clear();
-            JSONArray jsonArray = new JSONArray(jsonStr);
-            for (int i = 0;i < jsonArray.length(); i++){
-                Map<String,String> warehouseMap = new HashMap<>();
-                JSONObject jsonObject = jsonArray.getJSONObject(i);
-                warehouseMap.put("name",jsonObject.getString("name"));
-                warehouseMap.put("id",jsonObject.getString("id"));
-                warehouseMapList.add(warehouseMap);
-                warehouseNameList.add(jsonObject.getString("name"));
-            }
-            msLogTypeSpinner.setItems(warehouseMapList);
-        } catch (JSONException e) {
-            e.printStackTrace();
-        }
-
-
-        if (warehouseNameList.size()>0){
-            //初始化仓库
-            msLogTypeSpinner.setItems(warehouseNameList);
-            msLogTypeSpinner.setSelectedIndex(selectIndex);
-            getWarehouseId();
-        }
-
-        //监控选择仓库
-        msLogTypeSpinner.setOnItemSelectedListener(new MaterialSpinner.OnItemSelectedListener<String>() {
-            @Override public void onItemSelected(MaterialSpinner view, int position, long id, String item) {
-                XLog.e(item); XLog.e(position);
-                if (warehouseMapList.size()>0){
-                    selectIndex = position;
-                    warehouseId = Integer.parseInt(warehouseMapList.get(selectIndex).get("id"));
-                    getWarehouseId();
 
-                }
-            }
-        });
     }
 
-    //获取仓库id
-    private void getWarehouseId(){
-        try {
-            warehouseId = Integer.parseInt(warehouseMapList.get(selectIndex).get("id"));
-        } catch (NumberFormatException e) {
-            showErrorToast(getString(R.string.error_service_host_url)); //R.string.hello_world
-            XLog.e("获取仓库id");
-            e.printStackTrace();
-        }
-    }
 
 
     /**
@@ -308,7 +221,6 @@ public class LoginActivity extends BaseActivity {
         HashMap<String, Object> params = new HashMap<>();
         params.put("username", username);
         params.put("password", password);
-        params.put("warehouse_id", warehouseId);
         JSONObject jsonObject = new JSONObject(params);
         OkGo.<String>post(Urls.getServiceAddress(this)+ Urls.LOGIN ).upJson(jsonObject)
                 .execute(new MyDialogCallback(this, false, true) {
@@ -330,7 +242,6 @@ public class LoginActivity extends BaseActivity {
                                     spCache.setResourceBucket(mUserBean.resource_bucket);
 
 
-                                    spCache.setWareHouseId(warehouseId+"");
                                     spCache.setToken(mUserBean.user_token);
                                     spCache.setWeightUnit(mUserBean.weight_unit);
                                     //spCache.setAvatarUrl(Urls.HEAD_IMAGE);
@@ -389,10 +300,7 @@ public class LoginActivity extends BaseActivity {
                 intentPageResult(this,ServiceSettingActivity.class, bundle,200);
                 break;
             case R.id.log_btn_login:
-                if (warehouseId==0){
-                    showErrorToast("请选择仓库");
-                    return;
-                }
+
                 if (isCanLogin()) {
                     login(mLogEtName.getText().toString().trim(),mLogEtPwd.getText().toString().trim());
 //                    AlertDialog.Builder builder = new AlertDialog.Builder(this);

+ 7 - 118
app/src/main/java/com/fxy/main/fragment/HomePagerFragment.java

@@ -16,6 +16,8 @@ import android.widget.LinearLayout;
 
 import com.fxy.common.VersionUpgrades;
 import com.elvishew.xlog.XLog;
+import com.fxy.putIn.TallyMainActivity;
+import com.fxy.putOut.DeliveryGoodsMainActivity;
 import com.google.zxing.Result;
 import com.fxy.baselibrary.base.BaseFragment;
 import com.fxy.baselibrary.interfaces.OnRxScanerListener;
@@ -57,22 +59,7 @@ public class HomePagerFragment extends BaseFragment implements View.OnClickListe
     @BindView(R.id.ima_or_code)
     ImageView imaORCOde;
 
-    //ll_put_in_menu_tc
-    @BindView(R.id.ll_put_in_menu_tc)
-    LinearLayout llPutInMenuTc;
-
-    //
-    //ll_put_out_menu
-    @BindView(R.id.ll_put_out_menu_tc)
-    LinearLayout llPutOutMenuTc;
-
-    @BindView(R.id.ll_check_menu_tc)
-    LinearLayout llCheckMenuTc;
-
     Unbinder bind;
-
-    private TListDialog tListDialog;
-    private ArrayList<String> datas = new ArrayList<>();
     public static final String TYPE = "type";
 
     @Nullable
@@ -99,10 +86,6 @@ public class HomePagerFragment extends BaseFragment implements View.OnClickListe
 
         //从缓存读取客户端
 
-        CommSharedUtil commSharedUtil = CommSharedUtil.getInstance(getActivity());
-        String clientCode = commSharedUtil.getString(BaseConfig.CLIENT_CODE,"dhwms");
-
-
         try {
             //检查文件读写 权限
             if (ContextCompat.checkSelfPermission(getActivity(), Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED){
@@ -115,12 +98,8 @@ public class HomePagerFragment extends BaseFragment implements View.OnClickListe
 
         //初始化扫码设置
         new ScanHelper(getActivity());
-
         //记录一下设备信息
         XLog.e("记录设备信息:\n厂商:"+ Build.MANUFACTURER+"\n型号:"+Build.MODEL+"\nandroid:"+Build.VERSION.RELEASE+"");
-
-
-
         new Thread() {
             @Override
             public void run() {
@@ -130,17 +109,6 @@ public class HomePagerFragment extends BaseFragment implements View.OnClickListe
 
     }
 
-
-
-    private void initAdapter() {
-
-    }
-
-
-
-
-
-
     @Override
     protected void getBundleExtras(Bundle bundle) {
 
@@ -156,39 +124,17 @@ public class HomePagerFragment extends BaseFragment implements View.OnClickListe
      * 绑定事件
      * @param v
      */
-    @OnClick({R.id.search_view, R.id.ima_or_code,R.id.ivt_tally_tc,
-            R.id.ivt_putaway_tc,R.id.ivt_check_list_tc,R.id.ivt_check_tc,R.id.ivt_cargo_storage_tc,R.id.ivt_cancel_storage_tc})
+    @OnClick({R.id.search_view, R.id.ima_or_code,R.id.ivt_tally,R.id.ivt_cargo_storage})
     public void onClick(View v) {
         Bundle bundle = new Bundle();
         switch (v.getId()) {
-            case R.id.search_view:
-                break;
-            case R.id.ima_or_code:
-                showListDialog();
-                break;
-            case R.id.ivt_tally_tc:
+            case R.id.ivt_tally:
                 bundle.putString("action","receive");
-                intent2Page(getActivity(), TallyStartMainActivity.class, false,bundle);;
-                break;
-            case R.id.ivt_putaway_tc:
-                bundle.putString("action","putaway");
-                intent2Page(getActivity(), com.fxy.fms.putIn.PutAwayMainActivity.class, false,bundle);;
-                break;
-            case R.id.ivt_check_list_tc:
-                bundle.putString("action","waitcheck");
-                intent2Page(getActivity(), com.fxy.fms.check.WaitCheckMainActivity.class, false,bundle);;
-                break;
-            case R.id.ivt_check_tc:
-                bundle.putString("action","waitcheck");
-                intent2Page(getActivity(), com.fxy.fms.check.CheckStartMainActivity.class, false,bundle);;
-                break;
-            case R.id.ivt_cargo_storage_tc:
-                bundle.putString("action","storage");
-                intent2Page(getActivity(), com.fxy.fms.putOut.StorageStartMainActivity.class, false,bundle);;
+                intent2Page(getActivity(), TallyMainActivity.class, false,bundle);;
                 break;
-            case R.id.ivt_cancel_storage_tc:
+            case R.id.ivt_cargo_storage:
                 bundle.putString("action","storage");
-                intent2Page(getActivity(), com.fxy.fms.putOut.StorageCancelMainActivity.class, false,bundle);;
+                intent2Page(getActivity(), DeliveryGoodsMainActivity.class, false,bundle);;
                 break;
                 //
             default:
@@ -199,64 +145,7 @@ public class HomePagerFragment extends BaseFragment implements View.OnClickListe
         }
     }
 
-    private void showListDialog() {
-        if (tListDialog == null) {
-            datas.add("扫一扫收货");
-            datas.add("扫一扫上架");
-            datas.add("扫一扫查库存");
-            datas.add("扫描商家单证号");
-            XLog.d(datas.toArray());
-            tListDialog = (TListDialog) new TListDialog.Builder(getActivity().getSupportFragmentManager())
-//                    .setScreenHeightAspect(getActivity(), 0.5f)
-                    .setListLayoutRes(R.layout.dialog_recyclerview, LinearLayoutManager.VERTICAL)
-                    .setDimAmount(0.6f)     //设置弹窗背景透明度(0-1f)
-                    .setCancelOutside(true)//弹窗在界面外是否可以点击取消
-//                    .setHeight(600)
-                    .setScreenWidthAspect(getActivity(), 0.8f)
-                    .setGravity(Gravity.CENTER)
-                    .setAdapter(new TBaseAdapter<String>(R.layout.item_dialog_list_one, datas) {
 
-                        @Override
-                        protected void onBind(BindViewHolder holder, int position, String s) {
-                            holder.setText(R.id.tv_dialog_list, s);
-                        }
-                    })
-                    .setOnAdapterItemClickListener(new TBaseAdapter.OnAdapterItemClickListener<String>() {
-                        @Override
-                        public void onItemClick(BindViewHolder holder, int position, String s, TDialog tDialog) {
-                            ActivityScanerCode.setScanerListener(mScanerListener);
-                            ActivityScanerCode.intent2Activity(getActivity(), s);
-                            tDialog.dismiss();
-                        }
-                    })
-                    .create()
-                    .show();
-        } else {
-            if (!tListDialog.isVisible()) {
-                tListDialog.show();
-            }
-        }
-    }
-
-    private OnRxScanerListener mScanerListener = new OnRxScanerListener() {
-        @Override
-        public void onSuccess(String type, Result result) {
-            if ("扫一扫收货".equals(type)) {
-                showToast("扫一扫收货" + result.getText());
-            } else if ("扫一扫上架".equals(type)) {
-                showToast("扫一扫上架" + result.getText());
-            } else if ("扫一扫查库存".equals(type)) {
-                showToast("扫一扫查库存" + result.getText());
-            } else if ("扫描商家单证号".equals(type)) {
-                showToast("扫描商家单证号" + result.getText());
-            }
-        }
-
-        @Override
-        public void onFail(String type, String message) {
-
-        }
-    };
 
     @Override
     public void onDestroy() {

+ 0 - 2
app/src/main/java/com/fxy/main/fragment/MineFragment.java

@@ -177,7 +177,6 @@ public class MineFragment extends BaseFragment {
                                 SPCache spCache = SPCache.getInstance(getActivity());
                                 spCache.setUserName(user_name);
                                 spCache.setAccountName(user_account);
-                                spCache.setWareHouseName(data.getString("warehouse_name"));
                                 spCache.setUserPhone(data.getString("mobile"));
                                 spCache.setCompanyName(company_name);
                                 String strName = company_name;
@@ -190,7 +189,6 @@ public class MineFragment extends BaseFragment {
                                     spCache.setResourceBucket(data.getString("resource_bucket"));
                                 }
 
-
                                 tvName.setText(user_name+"("+user_account+")\n" + strName);
                             }else{
                                 XLog.e("获取用户信息失败:" + bean.msg);

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

@@ -23,7 +23,11 @@ public class Urls {
 
     public static final String getOssHostPath(Context context){
         SPCache spCache = SPCache.getInstance(context);
-        return spCache.getResourceHost()+"/"+spCache.getResourcePrefix();
+        String resource_prefix = spCache.getResourcePrefix();
+        if (resource_prefix.isEmpty()){
+            resource_prefix =  BuildConfig.DEBUG ? "uat/fxy":"prod/fxy";
+        }
+        return spCache.getResourceHost()+"/"+resource_prefix;
     }
 
     //获取头程
@@ -56,7 +60,7 @@ public class Urls {
      * @return
      */
     public static String getScanSetting(Context context){
-        return getOssHostPath(context)+"/pda/apk/"+getEnv()+"/setScan.json" ;
+        return getOssHostPath(context)+"/pda/scan/setScan.json" ;
     }
 
 
@@ -78,6 +82,23 @@ public class Urls {
     //获取蓝牙配置
     public static final String GET_BLUES = "/pda/Basics/getBlues";
 
+    /*返修易 -- start*/
+    public static final String FXY_CHECK_PALLET = "/pda/inbound/scanPallet";
+    public static final String FXY_PUT_IN = "/pda/inbound/scanTracking";
+    //关闭托盘
+    public static final String FXY_CLOSE_PALLET = "/pda/inbound/closePallet";
+    // 获取出库单数据
+    public static final String FXY_GET_OUTBOUND = "/pda/outbound/scanOutbound";
+    // 删除
+    public static final String FXY_ADD_OUTBOUND = "/pda/outbound/scanDoPallet";
+    // 删除
+    public static final String FXY_DEL_OUTBOUND = "/pda/outbound/scanDoPallet";
+    //完成装柜
+    public static final String FMS_FINISH_LOAD = "/pda/Outbound/finishLoad";
+    /*返修易 -- end*/
+
+
+
     /*
     以下是头程
      */

+ 921 - 0
app/src/main/java/com/fxy/putIn/TallyMainActivity.java

@@ -0,0 +1,921 @@
+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.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.Editable;
+import android.text.TextWatcher;
+import android.view.KeyEvent;
+import android.view.LayoutInflater;
+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 androidx.annotation.RequiresApi;
+
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
+import com.elvishew.xlog.XLog;
+import com.fxy.R;
+import com.fxy.baselibrary.base.BaseActivity;
+import com.fxy.baselibrary.bean.BaseEventBusBean;
+import com.fxy.baselibrary.interfaces.OnRxScanerListener;
+import com.fxy.baselibrary.qrcode.ActivityScanerCode;
+import com.fxy.baselibrary.util.JsonUtil;
+import com.fxy.baselibrary.util.StringUtils;
+import com.fxy.baselibrary.views.MarqueeTextView;
+import com.fxy.bean.ActionBean;
+import com.fxy.bean.ScanBean;
+import com.fxy.constant.BaseConfig;
+import com.fxy.constant.EventCode;
+import com.fxy.constant.SPCache;
+import com.fxy.fms.putIn.TallyPictureMainActivity;
+import com.fxy.fms.putIn.TallyVolumeMainActivity;
+import com.fxy.fms.putIn.bean.InboundBean;
+import com.fxy.net.MyDialogCallback;
+import com.fxy.net.Urls;
+import com.fxy.view.FloatingImageView;
+import com.fxy.view.PopupWindowManager;
+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 TallyMainActivity extends  BaseActivity implements StoJNI.ScanCallBack {
+    /**
+     * 列表适配器
+     */
+    Context mContext = this;
+
+    //单号清除
+    @BindView(R.id.ib_order_no_clear)
+    ImageButton ibOrderNoClear;
+
+    //单号
+    @BindView(R.id.et_order_no)
+    EditText etOrderNo;
+
+
+    //单号清除
+    @BindView(R.id.ib_container_code_clear)
+    ImageButton ibContainerCodeClear;
+
+    //单号
+    @BindView(R.id.et_container_code)
+    EditText etContainerCode;
+
+    //单号
+    @BindView(R.id.et_customer_code)
+    EditText etCustomerCode;
+
+    @BindView(R.id.mt_container_code)
+    MarqueeTextView mtContainerCode;
+
+    @BindView(R.id.mt_send_way)
+    MarqueeTextView mtSendWay;
+
+    @BindView(R.id.mt_putin_qty)
+    MarqueeTextView mtPutinQty;
+
+    //托盘组件
+    @BindView(R.id.ll_container)
+    LinearLayout llContainer;
+
+    //客户组件 llCustomer
+    @BindView(R.id.ll_customer)
+    LinearLayout llCustomer;
+
+
+    @BindView(R.id.btn_change_confirm)
+    TextView btnChangeConfirm;
+
+
+    @BindView(R.id.recyclerview)
+    RecyclerView recyclerView;
+
+    //浮动按钮
+    @BindView(R.id.iv_drag)
+    FloatingImageView iv_drag;
+
+    private View notDataView;   //没有数据显示页
+    private View errorView;     //错误显示页
+    private View emptyView;     //空显示页
+    /**
+     * 列表适配器
+     */
+    private FinishWorkAdapter mAdapter;
+
+    //扫码扫码动作
+    private ScanBean scanBean;
+
+
+    //托盘返回对象
+    private JSONObject palletObject;
+
+    private Unbinder unbinder;
+    //是否需要显示客户
+    private boolean needCustomer;
+    //强制更改
+    private int isChange=0;
+
+    //托盘数据
+    private List<JSONObject> tallyDataList = new ArrayList<>()   ;
+    //托盘对象
+    private JSONObject tallyInfo = null;
+
+    @Override
+    public int getContentViewResId() {
+        return R.layout.activity_fxy_tally;
+    }
+
+    @Override
+    public boolean showToolBar() {
+        return true;
+    }
+
+    @Override
+    public boolean openEventBus() {
+        return true;
+    }
+
+    @Override
+    protected void getBundleExtras(Bundle bundle) {
+
+    }
+    //finish的返回监听
+    //这里的requestCode参数,就是上面设置的 1 ,当跳转的页面返回的时候,通过这个加以判断
+    //resultCode ,这个参数是在跳转的页面里面规定的,它也是一个int类型的标志
+    //第三个参数包含了返回的值
+    //如果不需要所跳转的页面返回值,也就不需要这个方法了
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+//        XLog.e("requestCode:"+requestCode);
+//        XLog.e("resultCode:"+resultCode);
+        if (requestCode == 200 && resultCode == 200)//之前提到的两个标志,在这里显示出了作用
+        {
+        }else if (resultCode==0){
+        }
+    }
+
+
+    /**
+     * EventBus接收信息的方法,开启后才会调用(非粘性事件)
+     *
+     * @param event
+     */
+    @Override
+    protected void EventBean(BaseEventBusBean event) {
+//        XLog.e("----------接收返回--------------");
+//        XLog.e("接收返回:"+event.getEventCode());
+        if (event != null && event.getEventCode() == EventCode.displacement_refresh){
+
+        }
+    }
+
+    @Override
+    public boolean isPlayMusic() {
+        return true;
+    }
+
+    @Override
+    protected void initView() {
+        unbinder = ButterKnife.bind(this);
+        setTitleName(getString(R.string.tally));
+
+        initAdapter();
+        initData();
+        initEdit();
+        //监听浮动按钮
+        iv_drag.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if(!iv_drag.isDrag()){
+                    ActivityScanerCode.setScanerListener(mScanerListener);
+                    ActivityScanerCode.intent2Activity(mContext, BaseConfig.COMMON_SCANNER_ONLY);
+                }
+            }
+        });
+    }
+
+
+    private void initData(){
+        String palletNo = SPCache.getInstance(mContext).getPalletNo();
+        if (StringUtils.isNotEmpty(palletNo)) {
+            etContainerCode.setText(palletNo);
+            //mt_container_code
+            mtContainerCode.setText(palletNo);
+            getPalletInfo();
+        }
+    }
+
+
+
+
+
+
+
+    @Override
+    public boolean dispatchKeyEvent(KeyEvent event) {
+        //XLog.e("event:"+event.getKeyCode());
+        if ((event.getKeyCode()==KeyEvent.KEYCODE_DPAD_CENTER )  && event.getAction() == KeyEvent.ACTION_DOWN){
+            //按确定键
+            if(this.validate()){
+                //doPutIn();
+            }
+        }
+        return super.dispatchKeyEvent(event);
+    }
+
+    //监听按键
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        //XLog.e("监听按键:"+keyCode);XLog.e(event);
+        if (scanBean.getIsBroadcast()==0 && StoTongJNI.getIns(mContext).getEventFuction(keyCode)  == StoPdaKeyEvent.KEYCODE_SCAN
+                && event.getRepeatCount() == 0) {
+
+            if (StoTongJNI.getIns(mContext).GetScannerIsScanning()) {
+//
+            } else {
+                StoTongJNI.getIns(mContext).SetScannerStart();
+            }
+        }
+        return super.onKeyDown(keyCode, event);
+    }
+
+    @SuppressLint("HandlerLeak")
+    Handler scanHandler = new Handler() {
+
+        @Override
+        public void handleMessage(Message msg) {
+            // TODO Auto-generated method stub
+            if (msg.obj != null) {
+
+                String scanResult = msg.obj.toString().trim();
+                if (!scanResult.isEmpty()){
+                    setScanResult(scanResult);
+                }
+            }
+
+        }
+
+    };
+    @Override
+    public void onScanResults(String str) {
+        Message msg = new Message();
+        msg.obj = str;
+        scanHandler.sendMessage(msg);
+
+
+    }
+
+
+    @Override
+    public void onScanResults(String str, int type) {
+
+    }
+    /**
+     * 定义广播接受
+     */
+    BroadcastReceiver mReceiver = new BroadcastReceiver() {
+        @Override
+        public void onReceive(Context context, Intent intent) {
+            String scanResult = intent.getStringExtra(scanBean.getDataName());
+            if (scanResult==null){return; }
+            String scanStatus = "";
+            if (!scanBean.getStatusName().isEmpty()){
+                scanStatus = intent.getStringExtra(scanBean.getStatusName());
+            }else{
+                scanStatus = scanResult.isEmpty()? "" : "ok"; //有值 默认是扫码成功;
+            }
+
+            //新大陆(MT65,MT90) 需要手动关闭
+            if (!scanBean.getActionStop().isEmpty()){
+                Intent stopIntent = new Intent(scanBean.getActionStop());
+                mContext.sendBroadcast(stopIntent);
+            }
+
+            if ("ok".equals(scanStatus)){
+                setScanResult(scanResult);
+            }else{
+                showErrorToast(getString(R.string.scan_failed));
+            }
+        }
+    };
+
+    /**
+     * 注册广播
+     */
+    private void initReceiver(){
+
+        try {
+
+            String scanStr = getScanSetting();
+            scanBean = JsonUtil.getObject(scanStr, ScanBean.class);
+            Integer is_broadcast = scanBean.getIsBroadcast();//是否广播
+
+            if (is_broadcast ==1){
+                IntentFilter mFilter = new IntentFilter(scanBean.getAction());
+                this.registerReceiver(mReceiver, mFilter);
+            }else{
+                //不广播进行处理 jni模式
+                String pdaBrand = StoTongJNI.getmPdaBrand();
+                if (!pdaBrand.isEmpty()){
+                    StoTongJNI.getIns(this).setmScanCB(this);
+                    StoTongJNI.getIns(this).SetScannerOn();
+                }
+            }
+
+
+        }catch (Exception e) {
+            showErrorToast("获取扫码配置失败"+e.getMessage());
+            XLog.e("获取扫码配置失败:" + e.getMessage());
+        }
+    }
+
+
+    //统一按钮回调
+    public void callbackEditor(View v){
+        switch (v.getId()) {
+            case R.id.et_container_code:
+                getPalletInfo();
+                break;
+            case R.id.et_order_no:
+            case R.id.et_customer_code:
+                doPutIn();
+                break;
+            default:
+        }
+    }
+
+
+
+
+
+    private void initEdit() {
+        List<EditText> list = new ArrayList<>();
+        list.add(etOrderNo);
+        list.add(etContainerCode);
+        list.add(etCustomerCode);
+        unifyEdit(list);
+    }
+
+    private OnRxScanerListener mScanerListener = new OnRxScanerListener() {
+        @Override
+        public void onSuccess(String type, Result result) {
+            String scanResult = result.getText();
+            switch (type){
+                case BaseConfig.COMMON_SCANNER_ONLY:
+                    setScanResult(scanResult);
+
+                    break;
+            }
+        }
+        @Override
+        public void onFail(String type, String message) {
+
+        }
+    };
+
+    //把扫描结果赋值
+    private void setScanResult(String scanResult){
+        //获取焦点的view对象
+        View view=getWindow().getDecorView().findFocus();
+        //如果是EditText
+        if(view instanceof EditText)
+        {
+            ((EditText) view).setText(scanResult);
+            //执行回调
+            callbackEditor(view);
+        }
+    }
+
+    /**
+     * 获取打托信息
+     */
+    private void getPalletInfo(){
+        final String palletCode = etContainerCode.getText().toString().trim();
+        if (palletCode.isEmpty()){
+            setEditTextFocused(etContainerCode,true);
+            showWarningToast(etContainerCode.getHint().toString());
+            return ;
+        }
+        try {
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.put("pallet_code",palletCode);
+            if (!checkRepeat(Urls.FXY_CHECK_PALLET+(jsonObject.toString()))){
+                Toast.makeText(this, getString(R.string.error_data_processed), Toast.LENGTH_LONG).show();
+                return;
+            }
+
+            OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_CHECK_PALLET).upJson(jsonObject)
+                    .execute(new MyDialogCallback(this, true, true) {
+                        @Override
+                        public void onSuccess(Response<String> response) {
+                            super.onSuccess(response);
+                            try {
+                                ActionBean bean = JsonUtil.getObject(response.body(), ActionBean.class);
+
+                                JSONObject result = new JSONObject();
+                                if (bean.data!=null && !bean.data.isEmpty() && !bean.data.equals("[]")){
+                                     result = new JSONObject(bean.data);
+
+                                }
+                                setPageViewData(result);
+
+
+                                if(bean.code == 1){
+                                    palletObject = result;
+                                    llContainer.setVisibility(View.GONE);
+                                    SPCache.getInstance(mContext).setPalletNo(palletCode);
+                                    etOrderNo.setEnabled(true);
+                                    etOrderNo.requestFocus();
+                                    mtContainerCode.setText(palletCode);
+
+                                }else{
+                                    palletObject = null;
+                                    showWarningToast(bean.msg);
+                                    etContainerCode.requestFocus();
+                                    etContainerCode.selectAll();
+                                }
+
+
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                                showEmptyView("托盘信息解析错误:"+e.getMessage());
+                                XLog.e("获取托盘信息解析错误",e.getMessage());
+                            }
+                        }
+                    });
+        }catch (Exception e){
+            palletObject = null;
+            XLog.e("请求托盘信息错误:"+e.getMessage(),e);
+        }
+    }
+
+    /**
+     * 关闭托盘
+     */
+    private void closePallet(){
+        final String palletCode = etContainerCode.getText().toString().trim();
+        if (palletCode.isEmpty()){
+            return;
+        }
+        try {
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.put("pallet_code",palletCode);
+            if (!checkRepeat(Urls.FXY_CLOSE_PALLET+(jsonObject.toString()))){
+                Toast.makeText(this, getString(R.string.error_data_processed), Toast.LENGTH_LONG).show();
+                return;
+            }
+
+            OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_CLOSE_PALLET).upJson(jsonObject)
+                    .execute(new MyDialogCallback(this, true, true) {
+                        @Override
+                        public void onSuccess(Response<String> response) {
+                            super.onSuccess(response);
+                            try {
+                                ActionBean bean = JsonUtil.getObject(response.body(), ActionBean.class);
+
+                                etOrderNo.setEnabled(false);
+
+                                clearData(true);
+                                palletObject = null;
+                                tallyDataList.clear();
+                                mAdapter.setNewData(tallyDataList);
+                                mAdapter.notifyDataSetChanged();
+                                if(bean.code == 1){
+                                   showSuccessToast(bean.msg);
+                                }else{
+                                    showWarningToast(bean.msg);
+                                }
+                                SPCache.getInstance(mContext).setPalletNo("");
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                                showEmptyView("关闭托盘信息解析错误:"+e.getMessage());
+                                XLog.e("关闭托盘信息解析错误",e.getMessage());
+                            }
+                        }
+                    });
+        }catch (Exception e){
+            palletObject = null;
+            XLog.e("关闭托盘信息错误:"+e.getMessage(),e);
+        }
+    }
+
+    private void doPutIn() {
+        //校验数据
+        if (!validate()){
+            return;
+        }
+
+        try {
+            String pallet_code = etContainerCode.getText().toString().trim();
+            final String tracking_number = etOrderNo.getText().toString().trim();
+            JSONObject param = new JSONObject();
+            param.put("pallet_code",pallet_code);
+            param.put("tracking_number",tracking_number);
+
+            if (needCustomer){
+                param.put("customer_code",etCustomerCode.getText().toString().trim());
+            }
+            if (isChange>0){
+                param.put("is_change",isChange);
+            }
+
+            if (!checkRepeat(Urls.FMS_ADD_RECEIVE+(param.toString()))){return;}
+
+            OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_PUT_IN)
+                    .upJson(param)
+                    .execute(new MyDialogCallback(this, true, true) {
+                        @Override
+                        public void onSuccess(Response<String> response) {
+                            super.onSuccess(response);
+                            try {
+                                ActionBean bean = JsonUtil.getObject(response.body(), ActionBean.class);
+                                JSONObject result = new JSONObject();
+                                if (bean.data!=null && !bean.data.isEmpty() && !bean.data.equals("[]")){
+                                    result = new JSONObject(bean.data);
+                                }
+
+                                setPageViewData(result);
+                                if(bean.code == 1){
+                                    showSuccessToast(bean.msg);
+                                    clearData(false);
+                                }else{
+
+                                    if (result.has("tag") && result.getString("tag").equals("need_customer")){
+                                        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) {
+                                                        needCustomer = true;
+                                                        llCustomer.setVisibility(View.VISIBLE);
+                                                        etCustomerCode.requestFocus();
+                                                    }
+                                                }).setPositiveButton(R.string.str_cancel, new DialogInterface.OnClickListener() {
+                                            @Override
+                                            public void onClick(DialogInterface dialogInterface, int i) {
+                                                //取消不做操作
+
+                                            }
+                                        }).show();
+                                    }else if (result.has("is_change") && result.getInt("is_change")==1){
+                                        new AlertDialog.Builder(mContext)
+                                                .setTitle(R.string.dl_hint)
+                                                .setMessage(bean.msg)
+                                                .setNegativeButton(R.string.str_submit, new DialogInterface.OnClickListener() {
+                                                    @RequiresApi(api = Build.VERSION_CODES.KITKAT)
+                                                    @Override
+                                                    public void onClick(DialogInterface dialogInterface, int i) {
+                                                        isChange = 1;
+                                                        doPutIn();
+                                                    }
+                                                }).setPositiveButton(R.string.str_cancel, new DialogInterface.OnClickListener() {
+                                            @Override
+                                            public void onClick(DialogInterface dialogInterface, int i) {
+                                                //取消不做操作
+
+                                            }
+                                        }).show();
+                                    }else {
+                                        showWarningToast(bean.msg);
+                                    }
+
+                                }
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                                XLog.e("请求入库返回错误",e.getMessage());
+                            }
+                        }
+                    });
+        } catch (JSONException e) {
+            showEmptyView("请求入库失败:"+e.getMessage());
+            e.printStackTrace();
+        }
+
+
+    }
+
+    /*
+     * 校验必录
+     */
+    private boolean validate(){
+
+        if(!checkNull(etContainerCode)){
+            setEditTextFocused(etContainerCode,true);
+            showWarningToast(etContainerCode.getHint().toString());
+            return false;
+        }
+        if(!checkNull(etOrderNo)){
+            setEditTextFocused(etOrderNo,true);
+            showWarningToast(etOrderNo.getHint().toString());
+            return false;
+        }
+        if (needCustomer){
+            if(!checkNull(etCustomerCode)){
+                setEditTextFocused(etCustomerCode,true);
+                showWarningToast(etCustomerCode.getHint().toString());
+                return false;
+            }
+        }
+
+
+        return true;
+    }
+
+    private class FinishWorkAdapter extends BaseQuickAdapter<JSONObject, BaseViewHolder>{
+        public FinishWorkAdapter(List<JSONObject> data){
+            super(R.layout.item_putin_scan, data);
+        }
+
+
+        public void setNewData(List<JSONObject> tallyDataList) {
+        }
+
+        @Override
+        protected void convert(BaseViewHolder helper, JSONObject item) {
+            helper.addOnClickListener(R.id.ib_clear);//定义setOnItemChildClickListener 事件点击
+            try {
+                String number    = item.has("tracking_number")?item.getString("tracking_number"):"";
+                helper.setText(R.id.tv_number,number);
+                helper.getView(R.id.ib_clear).setVisibility(View.GONE);
+            } catch (Exception e) {
+                XLog.e("列表赋值错误",e);
+                e.printStackTrace();
+            }
+        }
+    }
+    private void initAdapter(){
+        emptyView = this.getLayoutInflater().inflate(R.layout.pager_empty, (ViewGroup) recyclerView.getParent(), false);
+        errorView = this.getLayoutInflater().inflate(R.layout.pager_error, (ViewGroup) recyclerView.getParent(), false);
+        notDataView = emptyView;
+
+        mAdapter  = new FinishWorkAdapter(tallyDataList);
+        mAdapter.setEmptyView(emptyView);
+        mAdapter.openLoadAnimation(BaseQuickAdapter.SCALEIN);
+        recyclerView.setLayoutManager(new LinearLayoutManager(this));
+        recyclerView.setAdapter(mAdapter);
+
+    }
+
+    /**
+     * 显示
+     * @param str
+     */
+    private void showList(String str){
+
+    }
+
+    private void setPageViewData(JSONObject jsonObject){
+        try {
+            String send_way = "";
+            String putin_qty = "";
+            if (jsonObject.has("list")){
+                String listStr = jsonObject.getString("list");
+                if ( !listStr.isEmpty() && !listStr.equals("[]")){
+                    tallyDataList.clear();
+                    JSONArray jsonArray = new JSONArray(listStr);
+                    for (int i = 0;i < jsonArray.length(); i++){
+                        JSONObject tallyObject = jsonArray.getJSONObject(i);
+                        tallyDataList.add(tallyObject);
+                    }
+                    mAdapter.setNewData(tallyDataList);
+                    mAdapter.notifyDataSetChanged();
+                }
+            }
+            if (jsonObject.has("send_way")){
+                send_way = jsonObject.getString("send_way");
+            }
+            if (jsonObject.has("qty")){
+                putin_qty = String.valueOf(jsonObject.getInt("qty"));
+            }
+
+            mtSendWay.setText(send_way);
+            mtPutinQty.setText(putin_qty);
+
+
+        }catch (JSONException e) {
+            XLog.e("获取理货缓存数据错误",e);
+            e.printStackTrace();
+        }
+    }
+    //清除订单信息
+    private void clearData(boolean isAll) {
+        etOrderNo.setText("");
+        etCustomerCode.setText("");
+        needCustomer = false;
+        isChange = 0;
+        llCustomer.setVisibility(View.GONE);
+        if (isAll){
+            llContainer.setVisibility(View.VISIBLE);
+            mtContainerCode.setText("");
+            mtSendWay.setText("");
+            mtPutinQty.setText("");
+            etContainerCode.setText("");
+            etContainerCode.requestFocus();
+        }else{
+            etOrderNo.requestFocus();
+        }
+        setEditTextNormal(etContainerCode,true);
+        setEditTextNormal(etOrderNo,true);
+        setEditTextNormal(etCustomerCode,true);
+    }
+
+    @OnClick({R.id.btn_confirm,R.id.btn_change_confirm})
+    public void onViewClicked(View view) {
+        Bundle bundle = new Bundle();
+        switch (view.getId()) {
+            case R.id.btn_confirm:
+                closePallet();
+                break;
+                case R.id.btn_change_confirm:
+
+                    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) {
+                                    etOrderNo.setEnabled(false);
+                                    clearData(true);
+                                    palletObject = null;
+                                    tallyDataList.clear();
+                                    mAdapter.setNewData(tallyDataList);
+                                    mAdapter.notifyDataSetChanged();
+                                }
+                            }).setPositiveButton(R.string.str_cancel, new DialogInterface.OnClickListener() {
+                        @Override
+                        public void onClick(DialogInterface dialogInterface, int i) {
+                            //取消不做操作
+
+                        }
+                    }).show();
+
+                break;
+            default:
+                break;
+        }
+    }
+
+    /**
+     * 统一设置Edit监听
+     * @param  list
+     */
+    public void unifyEdit(List<EditText> list){
+        for (int i=0;i<list.size();i++){
+            EditText editText = list.get(i);
+
+            LinearLayout linearLayout = (LinearLayout)editText.getParent();
+            ImageButton imageButton = getChildImageButton(linearLayout);
+
+            //监听扫描
+            ImageView imageView = linearLayout.findViewById(R.id.ima_or_code);
+            imageView.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    LinearLayout linearLayout = (LinearLayout)v.getParent();
+                    for( int i = 0; i < linearLayout.getChildCount(); i++ ){
+                        if( linearLayout.getChildAt(i) instanceof EditText ){
+                            ((EditText)linearLayout.getChildAt(i)).requestFocus();
+                            break;
+                        }
+                    }
+                    ActivityScanerCode.setScanerListener(mScanerListener);
+                    ActivityScanerCode.intent2Activity(mContext, BaseConfig.COMMON_SCANNER_ONLY);
+                }
+            });
+
+
+            //监听按确定
+            editText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+                @Override
+                public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+                    //XLog.e("actionId:"+actionId);
+                    if (actionId == EditorInfo.IME_ACTION_SEND || actionId == EditorInfo.IME_ACTION_DONE  ) {
+                        if (v.getText().toString().trim().isEmpty()) {
+                            setEditTextFocused(v,true);
+                            showWarningToast(v.getHint().toString());
+                            return false;
+                        }else{
+                            setEditTextNormal(v,true);
+                        }
+
+                        callbackEditor(v);
+
+                        return false;
+                    }
+                    return false;
+                }
+            });
+            editText.addTextChangedListener(new TextWatcher() {
+                public void onTextChanged(CharSequence s, int start, int before, int count) {
+                    EditText currentEditText = null;
+                    ImageButton currentImage = null;
+                    //获取焦点的view对象
+                    View view=getWindow().getDecorView().findFocus();
+                    //如果是EditText
+                    if(view instanceof EditText){
+                        currentEditText = (EditText) view;
+                        currentImage = getChildImageButton((LinearLayout)currentEditText.getParent());
+                    }
+
+                    if (s.length() > 0  ) {
+
+                        if (currentImage !=null ){
+                            currentImage.setVisibility(View.VISIBLE);
+                        }
+                        if (currentEditText!=null){
+                            setEditTextNormal(currentEditText,true);
+                        }
+
+                    } else {
+                        if (currentImage !=null ){
+                            currentImage.setVisibility(View.INVISIBLE);
+                        }
+                        if (currentEditText!=null){
+                            setEditTextFocused(currentEditText,true);
+                        }
+                    }
+                }
+
+                public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+                }
+
+                public void afterTextChanged(Editable s) {
+
+                }
+            });
+
+            if (imageButton !=null ){
+                unifyClearEdit(imageButton);
+            }
+        }
+    }
+
+
+    @Override
+    protected void onDestroy() {
+        unbinder.unbind();
+
+
+        super.onDestroy();
+    }
+    @Override
+    protected void onResume() {
+        super.onResume();
+        initReceiver();
+    }
+    @Override
+    protected void onPause() {
+        super.onPause();
+        //销毁在onResume()方法中的广播
+        try {
+            //停止扫描
+            Integer is_broadcast = scanBean.getIsBroadcast();//是否广播
+            if (is_broadcast==0){
+                StoTongJNI.getIns(mContext).SetScannerStop();
+                StoTongJNI.getIns(mContext).SetScannerOff();
+            }else{
+                unregisterReceiver(mReceiver);
+            }
+        }catch (Exception e){
+            XLog.e("销毁广播失败:",e.getMessage());
+        }
+    }
+
+
+}

+ 51 - 0
app/src/main/java/com/fxy/putIn/bean/OrderInfoBean.java

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

+ 79 - 0
app/src/main/java/com/fxy/putIn/bean/ResultDataBean.java

@@ -0,0 +1,79 @@
+package com.fxy.putIn.bean;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ResultDataBean implements Parcelable {
+
+    private String tag = ""; //
+    private int is_change = 0; //
+    private int is_confirm  = 0; //
+    private int total_pallet_qty = 0; //
+    private int has_scan_qty = 0; //
+    private int no_scan_qty = 0; //
+
+    /** list **/
+    private String list ;
+
+
+    protected ResultDataBean(Parcel in) {
+        tag = in.readString();
+        is_change = in.readInt();
+        is_confirm = in.readInt();
+        total_pallet_qty = in.readInt();
+        has_scan_qty = in.readInt();
+        no_scan_qty = in.readInt();
+
+        list = in.readString();
+
+    }
+
+    @Override
+    public void writeToParcel(Parcel dest, int flags) {
+        dest.writeString(tag);
+        dest.writeInt(is_change);
+        dest.writeInt(is_confirm);
+        dest.writeInt(total_pallet_qty);
+        dest.writeInt(has_scan_qty);
+        dest.writeInt(no_scan_qty);
+        /** list 写入 **/
+        dest.writeString(list);
+
+    }
+
+    public ResultDataBean() {
+
+    }
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    public static final Creator<ResultDataBean> CREATOR = new Creator<ResultDataBean>() {
+        @Override
+        public ResultDataBean createFromParcel(Parcel in) {
+            return new ResultDataBean(in);
+        }
+
+        @Override
+        public ResultDataBean[] newArray(int size) {
+            return new ResultDataBean[size];
+        }
+    };
+
+    public String getTag() {return tag; }
+    public int getIsChange() {return is_change; }
+    public int getIsConfirm() {return is_confirm; }
+
+    public int getTotalPalletQty() {return total_pallet_qty; }
+    public int getHasScanQty() {return has_scan_qty; }
+    public int getNoScanQty() {return no_scan_qty; }
+    public String getList() {return list; }
+
+}

+ 930 - 0
app/src/main/java/com/fxy/putOut/DeliveryGoodsMainActivity.java

@@ -0,0 +1,930 @@
+package com.fxy.putOut;
+
+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.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 androidx.annotation.RequiresApi;
+
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
+import com.elvishew.xlog.XLog;
+import com.fxy.R;
+import com.fxy.baselibrary.base.BaseActivity;
+import com.fxy.baselibrary.bean.BaseEventBusBean;
+import com.fxy.baselibrary.interfaces.OnRxScanerListener;
+import com.fxy.baselibrary.qrcode.ActivityScanerCode;
+import com.fxy.baselibrary.util.JsonUtil;
+import com.fxy.baselibrary.util.StringUtils;
+import com.fxy.baselibrary.views.MarqueeTextView;
+import com.fxy.bean.ActionBean;
+import com.fxy.bean.ScanBean;
+import com.fxy.constant.BaseConfig;
+import com.fxy.constant.EventCode;
+import com.fxy.constant.SPCache;
+import com.fxy.net.MyDialogCallback;
+import com.fxy.net.Urls;
+import com.fxy.view.FloatingImageView;
+import com.google.zxing.Result;
+import com.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 DeliveryGoodsMainActivity extends  BaseActivity implements StoJNI.ScanCallBack {
+    /**
+     * 列表适配器
+     */
+    Context mContext = this;
+    //单号
+    @BindView(R.id.et_order_no)
+    EditText etOrderNo;
+
+    //单号
+    @BindView(R.id.et_container_code)
+    EditText etContainerCode;
+
+    @BindView(R.id.tv_total_qty)
+    TextView tvTotalQty;
+    @BindView(R.id.tv_wait_scan_qty)
+    TextView tvWaitScanQty;
+    @BindView(R.id.tv_scan_qty)
+    TextView tvScanQty;
+
+
+    //托盘组件
+    @BindView(R.id.ll_container)
+    LinearLayout llContainer;
+
+
+
+    @BindView(R.id.recyclerview)
+    RecyclerView recyclerView;
+
+    //浮动按钮
+    @BindView(R.id.iv_drag)
+    FloatingImageView iv_drag;
+
+    private View notDataView;   //没有数据显示页
+    private View errorView;     //错误显示页
+    private View emptyView;     //空显示页
+    /**
+     * 列表适配器
+     */
+    private FinishWorkAdapter mAdapter;
+
+    //扫码扫码动作
+    private ScanBean scanBean;
+
+
+
+
+    private Unbinder unbinder;
+
+    //是否弹窗确认
+    private int is_confirm = 0;
+
+    //托盘数据
+    private List<JSONObject> deliveryDataList = new ArrayList<>()   ;
+
+    private JSONObject outboundObject;
+
+    //托盘对象
+    private JSONObject outboundInfo = null;
+
+    @Override
+    public int getContentViewResId() {
+        return R.layout.activity_fxy_delivery_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);
+//        XLog.e("requestCode:"+requestCode);
+//        XLog.e("resultCode:"+resultCode);
+        if (requestCode == 200 && resultCode == 200)//之前提到的两个标志,在这里显示出了作用
+        {
+        }else if (resultCode==0){
+        }
+    }
+
+
+    /**
+     * EventBus接收信息的方法,开启后才会调用(非粘性事件)
+     *
+     * @param event
+     */
+    @Override
+    protected void EventBean(BaseEventBusBean event) {
+//        XLog.e("----------接收返回--------------");
+//        XLog.e("接收返回:"+event.getEventCode());
+        if (event != null && event.getEventCode() == EventCode.displacement_refresh){
+
+        }
+    }
+
+    @Override
+    public boolean isPlayMusic() {
+        return true;
+    }
+
+    @Override
+    protected void initView() {
+        unbinder = ButterKnife.bind(this);
+        setTitleName(getString(R.string.str_cargo_storage));
+
+        initAdapter();
+        initData();
+        initEdit();
+        //监听浮动按钮
+        iv_drag.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if(!iv_drag.isDrag()){
+                    ActivityScanerCode.setScanerListener(mScanerListener);
+                    ActivityScanerCode.intent2Activity(mContext, BaseConfig.COMMON_SCANNER_ONLY);
+                }
+            }
+        });
+    }
+
+
+    private void initData(){
+
+    }
+
+
+
+
+
+
+
+    @Override
+    public boolean dispatchKeyEvent(KeyEvent event) {
+        //XLog.e("event:"+event.getKeyCode());
+        if ((event.getKeyCode()==KeyEvent.KEYCODE_DPAD_CENTER )  && event.getAction() == KeyEvent.ACTION_DOWN){
+            //按确定键
+            if(this.validate()){
+                //doPutIn();
+            }
+        }
+        return super.dispatchKeyEvent(event);
+    }
+
+    //监听按键
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        //XLog.e("监听按键:"+keyCode);XLog.e(event);
+        if (scanBean.getIsBroadcast()==0 && StoTongJNI.getIns(mContext).getEventFuction(keyCode)  == StoPdaKeyEvent.KEYCODE_SCAN
+                && event.getRepeatCount() == 0) {
+
+            if (StoTongJNI.getIns(mContext).GetScannerIsScanning()) {
+//
+            } else {
+                StoTongJNI.getIns(mContext).SetScannerStart();
+            }
+        }
+        return super.onKeyDown(keyCode, event);
+    }
+
+    @SuppressLint("HandlerLeak")
+    Handler scanHandler = new Handler() {
+
+        @Override
+        public void handleMessage(Message msg) {
+            // TODO Auto-generated method stub
+            if (msg.obj != null) {
+
+                String scanResult = msg.obj.toString().trim();
+                if (!scanResult.isEmpty()){
+                    setScanResult(scanResult);
+                }
+            }
+
+        }
+
+    };
+    @Override
+    public void onScanResults(String str) {
+        Message msg = new Message();
+        msg.obj = str;
+        scanHandler.sendMessage(msg);
+
+
+    }
+
+
+    @Override
+    public void onScanResults(String str, int type) {
+
+    }
+    /**
+     * 定义广播接受
+     */
+    BroadcastReceiver mReceiver = new BroadcastReceiver() {
+        @Override
+        public void onReceive(Context context, Intent intent) {
+            String scanResult = intent.getStringExtra(scanBean.getDataName());
+            if (scanResult==null){return; }
+            String scanStatus = "";
+            if (!scanBean.getStatusName().isEmpty()){
+                scanStatus = intent.getStringExtra(scanBean.getStatusName());
+            }else{
+                scanStatus = scanResult.isEmpty()? "" : "ok"; //有值 默认是扫码成功;
+            }
+
+            //新大陆(MT65,MT90) 需要手动关闭
+            if (!scanBean.getActionStop().isEmpty()){
+                Intent stopIntent = new Intent(scanBean.getActionStop());
+                mContext.sendBroadcast(stopIntent);
+            }
+
+            if ("ok".equals(scanStatus)){
+                setScanResult(scanResult);
+            }else{
+                showErrorToast(getString(R.string.scan_failed));
+            }
+        }
+    };
+
+    /**
+     * 注册广播
+     */
+    private void initReceiver(){
+
+        try {
+
+            String scanStr = getScanSetting();
+            scanBean = JsonUtil.getObject(scanStr, ScanBean.class);
+            Integer is_broadcast = scanBean.getIsBroadcast();//是否广播
+
+            if (is_broadcast ==1){
+                IntentFilter mFilter = new IntentFilter(scanBean.getAction());
+                this.registerReceiver(mReceiver, mFilter);
+            }else{
+                //不广播进行处理 jni模式
+                String pdaBrand = StoTongJNI.getmPdaBrand();
+                if (!pdaBrand.isEmpty()){
+                    StoTongJNI.getIns(this).setmScanCB(this);
+                    StoTongJNI.getIns(this).SetScannerOn();
+                }
+            }
+
+
+        }catch (Exception e) {
+            showErrorToast("获取扫码配置失败"+e.getMessage());
+            XLog.e("获取扫码配置失败:" + e.getMessage());
+        }
+    }
+
+
+    //统一按钮回调
+    public void callbackEditor(View v){
+        switch (v.getId()) {
+            case R.id.et_order_no:
+                getOutboundInfo();
+                break;
+            case R.id.et_container_code:
+                addOutbound();
+                break;
+            default:
+        }
+    }
+
+
+
+
+
+    private void initEdit() {
+        List<EditText> list = new ArrayList<>();
+        list.add(etOrderNo);
+        list.add(etContainerCode);
+        unifyEdit(list);
+    }
+
+    private OnRxScanerListener mScanerListener = new OnRxScanerListener() {
+        @Override
+        public void onSuccess(String type, Result result) {
+            String scanResult = result.getText();
+            switch (type){
+                case BaseConfig.COMMON_SCANNER_ONLY:
+                    setScanResult(scanResult);
+
+                    break;
+            }
+        }
+        @Override
+        public void onFail(String type, String message) {
+
+        }
+    };
+
+    //把扫描结果赋值
+    private void setScanResult(String scanResult){
+        //获取焦点的view对象
+        View view=getWindow().getDecorView().findFocus();
+        //如果是EditText
+        if(view instanceof EditText)
+        {
+            ((EditText) view).setText(scanResult);
+            //执行回调
+            callbackEditor(view);
+        }
+    }
+
+    /**
+     * 获取打托信息
+     */
+    private void getOutboundInfo(){
+        final String outbound_number = etOrderNo.getText().toString().trim();
+        if (outbound_number.isEmpty()){
+            setEditTextFocused(etOrderNo,true);
+            showWarningToast(etOrderNo.getHint().toString());
+            return ;
+        }
+        try {
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.put("outbound_number",outbound_number);
+            if (!checkRepeat(Urls.FXY_GET_OUTBOUND+(jsonObject.toString()))){
+                Toast.makeText(this, getString(R.string.error_data_processed), Toast.LENGTH_LONG).show();
+                return;
+            }
+
+            OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_GET_OUTBOUND).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);
+
+                                outboundObject = new JSONObject();
+                                if (bean.data!=null && !bean.data.isEmpty() && !bean.data.equals("[]")){
+                                    outboundObject = new JSONObject(bean.data);
+                                }
+
+
+                                if(bean.code == 1){
+                                    setPageViewData(outboundObject);
+                                    etContainerCode.setEnabled(true);
+                                    etContainerCode.requestFocus();
+
+                                }else{
+                                    outboundObject = null;
+                                    showWarningToast(bean.msg);
+                                    etOrderNo.requestFocus();
+                                    etOrderNo.selectAll();
+                                }
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                                showEmptyView("托盘信息解析错误:"+e.getMessage());
+                                XLog.e("获取托盘信息解析错误",e.getMessage());
+                            }
+                        }
+                    });
+        }catch (Exception e){
+            outboundInfo = null;
+            XLog.e("请求托盘信息错误:"+e.getMessage(),e);
+        }
+    }
+
+    /**
+     * 关闭托盘
+     */
+    private void finishLoad(){
+        final String outbound_number = etOrderNo.getText().toString().trim();
+        if (outbound_number.isEmpty()){
+            setEditTextFocused(etOrderNo,true);
+            showWarningToast(etOrderNo.getHint().toString());
+            return;
+        }
+        try {
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.put("outbound_number",outbound_number);
+
+            if (is_confirm>0){
+                jsonObject.put("is_confirm",is_confirm);
+            }
+
+            if (!checkRepeat(Urls.FMS_FINISH_LOAD+(jsonObject.toString()))){
+                Toast.makeText(this, getString(R.string.error_data_processed), Toast.LENGTH_LONG).show();
+                return;
+            }
+
+            OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FMS_FINISH_LOAD).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);
+                                etContainerCode.setEnabled(false);
+                                clearData();
+
+
+                                if(bean.code == 1){
+                                    tvScanQty.setText("0");
+                                    tvTotalQty.setText("0");
+                                    tvWaitScanQty.setText("0");
+                                    deliveryDataList.clear();
+                                    mAdapter.setNewData(deliveryDataList);
+                                    mAdapter.notifyDataSetChanged();
+                                    etOrderNo.setText("");
+                                    etOrderNo.requestFocus();
+
+                                   showSuccessToast(bean.msg);
+                                }else{
+
+                                    JSONObject result = new JSONObject();
+                                    if (bean.data!=null && !bean.data.isEmpty() && !bean.data.equals("[]")){
+                                        result = new JSONObject(bean.data);
+                                    }
+
+                                    if (result.has("is_confirm") && result.getInt("is_confirm")>0){
+                                        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) {
+                                                        is_confirm  = 1;
+                                                        finishLoad();
+                                                    }
+                                                }).setPositiveButton(R.string.str_cancel, new DialogInterface.OnClickListener() {
+                                            @Override
+                                            public void onClick(DialogInterface dialogInterface, int i) {
+                                                //取消不做操作
+
+                                            }
+                                        }).show();
+                                    }else {
+                                        showWarningToast(bean.msg);
+                                    }
+
+                                }
+
+
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                                showEmptyView("关闭完成装柜解析错误:"+e.getMessage());
+                                XLog.e("关完成装柜解析错误",e.getMessage());
+                            }
+                        }
+                    });
+        }catch (Exception e){
+            outboundInfo = null;
+            XLog.e("完成装柜错误:"+e.getMessage(),e);
+        }
+    }
+
+    private void addOutbound() {
+        //校验数据
+        if (!validate()){
+            return;
+        }
+
+        try {
+            String pallet_code = etContainerCode.getText().toString().trim();
+            final String outbound_number = etOrderNo.getText().toString().trim();
+            JSONObject param = new JSONObject();
+            param.put("pallet_code",pallet_code);
+            param.put("outbound_number",outbound_number);
+
+
+
+
+            if (!checkRepeat(Urls.FXY_ADD_OUTBOUND+(param.toString()))){return;}
+
+            OkGo.<String>post(Urls.getServiceAddress(this) + Urls.FXY_ADD_OUTBOUND)
+                    .upJson(param)
+                    .execute(new MyDialogCallback(this, true, true) {
+                        @Override
+                        public void onSuccess(Response<String> response) {
+                            super.onSuccess(response);
+                            try {
+                                ActionBean bean = JsonUtil.getObject(response.body(), ActionBean.class);
+
+                                JSONObject result = new JSONObject();
+                                if (bean.data!=null && !bean.data.isEmpty() && !bean.data.equals("[]")){
+                                    result = new JSONObject(bean.data);
+                                }
+
+                                if(bean.code == 1){
+                                    showSuccessToast(bean.msg);
+                                    clearData();
+                                    setPageViewData(result);
+
+                                }else{
+
+                                    if (result.has("is_confirm") && result.getInt("is_confirm")>0){
+                                        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) {
+                                                        is_confirm  = 1;
+                                                    }
+                                                }).setPositiveButton(R.string.str_cancel, new DialogInterface.OnClickListener() {
+                                            @Override
+                                            public void onClick(DialogInterface dialogInterface, int i) {
+                                                //取消不做操作
+
+                                            }
+                                        }).show();
+                                    }else {
+                                        showWarningToast(bean.msg);
+                                    }
+
+                                }
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                                XLog.e("请求出库返回错误",e.getMessage());
+                            }
+                        }
+                    });
+        } catch (JSONException e) {
+            showEmptyView("请求出库失败:"+e.getMessage());
+            e.printStackTrace();
+        }
+
+
+    }
+
+    /*
+     * 校验必录
+     */
+    private boolean validate(){
+        if(!checkNull(etOrderNo)){
+            setEditTextFocused(etOrderNo,true);
+            showWarningToast(etOrderNo.getHint().toString());
+            return false;
+        }
+        if(!checkNull(etContainerCode)){
+            setEditTextFocused(etContainerCode,true);
+            showWarningToast(etContainerCode.getHint().toString());
+            return false;
+        }
+        return true;
+    }
+
+    private class FinishWorkAdapter extends BaseQuickAdapter<JSONObject, BaseViewHolder>{
+        public FinishWorkAdapter(List<JSONObject> data){
+            super(R.layout.item_putin_scan, data);
+        }
+
+
+        @Override
+        protected void convert(BaseViewHolder helper, JSONObject item) {
+            helper.addOnClickListener(R.id.ib_clear);//定义setOnItemChildClickListener 事件点击
+            try {
+                String number    = item.has("pallet_code")?item.getString("pallet_code"):"";
+                helper.setText(R.id.tv_number,number);
+            } catch (Exception e) {
+                XLog.e("列表赋值错误",e);
+                e.printStackTrace();
+            }
+        }
+    }
+    private void initAdapter(){
+        emptyView = this.getLayoutInflater().inflate(R.layout.pager_empty, (ViewGroup) recyclerView.getParent(), false);
+        errorView = this.getLayoutInflater().inflate(R.layout.pager_error, (ViewGroup) recyclerView.getParent(), false);
+        notDataView = emptyView;
+
+        mAdapter  = new FinishWorkAdapter(deliveryDataList);
+        mAdapter.setEmptyView(emptyView);
+        mAdapter.openLoadAnimation(BaseQuickAdapter.SCALEIN);
+        recyclerView.setLayoutManager(new LinearLayoutManager(this));
+        recyclerView.setAdapter(mAdapter);
+
+        mAdapter.setOnItemChildClickListener(new BaseQuickAdapter.OnItemChildClickListener() {
+            @Override
+            public void onItemChildClick(BaseQuickAdapter adapter, View view, int position) {
+                final int finalPosition = position;
+                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) {
+                                delOutbound(finalPosition);
+                            }
+                        }).setPositiveButton(R.string.str_cancel, new DialogInterface.OnClickListener() {
+                    @Override
+                    public void onClick(DialogInterface dialogInterface, int i) {
+                        //取消不做操作
+
+                    }
+                }).show();
+
+
+            }
+        });
+
+    }
+
+    private void delOutbound(int position){
+        try {
+            if (deliveryDataList==null || deliveryDataList.size()==0){
+                showWarningToast("已删除");
+                return;
+            }
+            JSONObject itemObject = deliveryDataList.get(position);
+            JSONObject jsonObject = new JSONObject();
+            jsonObject.put("outbound_number",itemObject.getString("outbound_number"));
+            jsonObject.put("pallet_code",itemObject.getString("pallet_code"));
+            jsonObject.put("is_move_out",1);
+            if (!checkRepeat(Urls.FXY_DEL_OUTBOUND+(jsonObject.toString()))){
+                Toast.makeText(mContext, getString(R.string.error_data_processed), Toast.LENGTH_LONG).show();
+                return;
+            }
+
+            OkGo.<String>post(Urls.getServiceAddress(mContext) + Urls.FXY_DEL_OUTBOUND).upJson(jsonObject)
+                    .execute(new MyDialogCallback(mContext, true, true) {
+                        @Override
+                        public void onSuccess(Response<String> response) {
+                            super.onSuccess(response);
+                            try {
+                                ActionBean bean = JsonUtil.getObject(response.body(), ActionBean.class);
+
+                                JSONObject result = new JSONObject();
+                                if (bean.data!=null && !bean.data.isEmpty() && !bean.data.equals("[]")){
+                                    result = new JSONObject(bean.data);
+                                }
+
+                                if(bean.code == 1){
+                                    setPageViewData(result);
+                                }else{
+                                    showWarningToast(bean.msg);
+                                }
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                                showEmptyView("托盘信息解析错误:"+e.getMessage());
+                                XLog.e("删除出库解析错误",e.getMessage());
+                            }
+                        }
+                    });
+        }catch (Exception e){
+            outboundInfo = null;
+            XLog.e("删除出库错误:"+e.getMessage(),e);
+        }
+    }
+
+    /**
+     * 设置页面数据
+     * @param jsonObject
+     */
+
+    private void setPageViewData(JSONObject jsonObject){
+        try {
+            int no_scan_qty = 0;
+            int total_pallet_qty = 0;
+            int has_scan_qty = 0;
+            deliveryDataList.clear();
+            if (jsonObject.has("no_scan_qty")){
+                no_scan_qty = jsonObject.getInt("no_scan_qty");
+            }
+            if (jsonObject.has("total_pallet_qty")){
+                total_pallet_qty = jsonObject.getInt("total_pallet_qty");
+            }
+
+            if (jsonObject.has("has_scan_qty")){
+                has_scan_qty = jsonObject.getInt("has_scan_qty");
+            }
+
+
+            tvWaitScanQty.setText(String.valueOf(no_scan_qty));
+            tvTotalQty.setText(String.valueOf(total_pallet_qty));
+            tvScanQty.setText(String.valueOf(has_scan_qty));
+
+            if (jsonObject.has("list")){
+                String listStr = jsonObject.getString("list");
+                if ( !listStr.isEmpty()){
+                    JSONArray jsonArray = new JSONArray(listStr);
+                    for (int i = 0;i < jsonArray.length(); i++){
+                        JSONObject tallyObject = jsonArray.getJSONObject(i);
+                        deliveryDataList.add(tallyObject);
+                    }
+                    mAdapter.setNewData(deliveryDataList);
+                    mAdapter.notifyDataSetChanged();
+                }else{
+                    mAdapter.setNewData(deliveryDataList);
+                    mAdapter.notifyDataSetChanged();
+                }
+            }
+        }catch (JSONException e) {
+            XLog.e("获取出库缓存数据错误",e);
+            e.printStackTrace();
+        }
+
+    }
+
+
+    private void setShow(){
+
+    }
+    //清除订单信息
+    private void clearData() {
+        etContainerCode.setText("");
+        is_confirm  = 0;
+        etContainerCode.requestFocus();
+        setEditTextNormal(etContainerCode,true);
+        setEditTextNormal(etOrderNo,true);
+    }
+
+    @OnClick({R.id.btn_confirm})
+    public void onViewClicked(View view) {
+        Bundle bundle = new Bundle();
+        switch (view.getId()) {
+            case R.id.btn_confirm:
+                finishLoad();
+                break;
+            default:
+                break;
+        }
+    }
+
+    /**
+     * 统一设置Edit监听
+     * @param  list
+     */
+    public void unifyEdit(List<EditText> list){
+        for (int i=0;i<list.size();i++){
+            EditText editText = list.get(i);
+
+            LinearLayout linearLayout = (LinearLayout)editText.getParent();
+            ImageButton imageButton = getChildImageButton(linearLayout);
+
+            //监听扫描
+            ImageView imageView = linearLayout.findViewById(R.id.ima_or_code);
+            imageView.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    LinearLayout linearLayout = (LinearLayout)v.getParent();
+                    for( int i = 0; i < linearLayout.getChildCount(); i++ ){
+                        if( linearLayout.getChildAt(i) instanceof EditText ){
+                            ((EditText)linearLayout.getChildAt(i)).requestFocus();
+                            break;
+                        }
+                    }
+                    ActivityScanerCode.setScanerListener(mScanerListener);
+                    ActivityScanerCode.intent2Activity(mContext, BaseConfig.COMMON_SCANNER_ONLY);
+                }
+            });
+
+
+            //监听按确定
+            editText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+                @Override
+                public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+                    //XLog.e("actionId:"+actionId);
+                    if (actionId == EditorInfo.IME_ACTION_SEND || actionId == EditorInfo.IME_ACTION_DONE  ) {
+                        if (v.getText().toString().trim().isEmpty()) {
+                            setEditTextFocused(v,true);
+                            showWarningToast(v.getHint().toString());
+                            return false;
+                        }else{
+                            setEditTextNormal(v,true);
+                        }
+
+                        callbackEditor(v);
+
+                        return false;
+                    }
+                    return false;
+                }
+            });
+            editText.addTextChangedListener(new TextWatcher() {
+                public void onTextChanged(CharSequence s, int start, int before, int count) {
+                    EditText currentEditText = null;
+                    ImageButton currentImage = null;
+                    //获取焦点的view对象
+                    View view=getWindow().getDecorView().findFocus();
+                    //如果是EditText
+                    if(view instanceof EditText){
+                        currentEditText = (EditText) view;
+                        currentImage = getChildImageButton((LinearLayout)currentEditText.getParent());
+                    }
+
+                    if (s.length() > 0  ) {
+
+                        if (currentImage !=null ){
+                            currentImage.setVisibility(View.VISIBLE);
+                        }
+                        if (currentEditText!=null){
+                            setEditTextNormal(currentEditText,true);
+                        }
+
+                    } else {
+                        if (currentImage !=null ){
+                            currentImage.setVisibility(View.INVISIBLE);
+                        }
+                        if (currentEditText!=null){
+                            setEditTextFocused(currentEditText,true);
+                        }
+                    }
+                }
+
+                public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+                }
+
+                public void afterTextChanged(Editable s) {
+
+                }
+            });
+
+            if (imageButton !=null ){
+                unifyClearEdit(imageButton);
+            }
+        }
+    }
+
+
+    @Override
+    protected void onDestroy() {
+        unbinder.unbind();
+
+
+        super.onDestroy();
+    }
+    @Override
+    protected void onResume() {
+        super.onResume();
+        initReceiver();
+    }
+    @Override
+    protected void onPause() {
+        super.onPause();
+        //销毁在onResume()方法中的广播
+        try {
+            //停止扫描
+            Integer is_broadcast = scanBean.getIsBroadcast();//是否广播
+            if (is_broadcast==0){
+                StoTongJNI.getIns(mContext).SetScannerStop();
+                StoTongJNI.getIns(mContext).SetScannerOff();
+            }else{
+                unregisterReceiver(mReceiver);
+            }
+        }catch (Exception e){
+            XLog.e("销毁广播失败:",e.getMessage());
+        }
+    }
+
+
+}

+ 56 - 0
app/src/main/java/com/fxy/view/MyPopupWindow.java

@@ -0,0 +1,56 @@
+package com.fxy.view;
+
+import android.content.Context;
+import android.graphics.Rect;
+import android.os.Build;
+import android.view.View;
+import android.widget.PopupWindow;
+
+public class MyPopupWindow extends PopupWindow {
+    @Override
+    public void showAsDropDown(View anchor) {
+        handlerHeight(anchor);
+        super.showAsDropDown(anchor);
+    }
+
+    @Override
+    public void showAsDropDown(View anchor, int xoff, int yoff) {
+        handlerHeight(anchor);
+        super.showAsDropDown(anchor, xoff, yoff);
+    }
+
+    @Override
+    public void showAsDropDown(View anchor, int xoff, int yoff, int gravity) {
+        handlerHeight(anchor);
+        super.showAsDropDown(anchor, xoff, yoff, gravity);
+    }
+
+    /**
+     * 解决高度无法自适应的问题
+     */
+    private void handlerHeight(View anchor) {
+        if (Build.VERSION.SDK_INT >= 24) {
+            Rect rect = new Rect();
+            anchor.getGlobalVisibleRect(rect);
+            int heightPixels = anchor.getResources().getDisplayMetrics().heightPixels;
+            int h = heightPixels - rect.bottom + getStatusHeight(anchor.getContext());
+            setHeight(h);
+        }
+    }
+
+    /**
+     * 获取状态栏的高度
+     */
+    private int getStatusHeight(Context context) {
+        int statusHeight = -1;
+        try {
+            Class<?> clazz = Class.forName("com.android.internal.R$dimen");
+            Object object = clazz.newInstance();
+            int height = Integer.parseInt(clazz.getField("status_bar_height").get(object).toString());
+            statusHeight = context.getResources().getDimensionPixelSize(height);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return statusHeight;
+    }
+}

+ 246 - 0
app/src/main/java/com/fxy/view/PopupWindowManager.java

@@ -0,0 +1,246 @@
+package com.fxy.view;
+
+import android.graphics.Color;
+import android.graphics.drawable.ColorDrawable;
+import android.os.Build;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.PopupWindow;
+
+import androidx.annotation.RequiresApi;
+
+import com.fxy.R;
+
+public class PopupWindowManager {
+    // 设置默认的宽高
+    private int mPopupWindowWidth = ViewGroup.LayoutParams.MATCH_PARENT;
+    private int mPopupWindowHeight = ViewGroup.LayoutParams.WRAP_CONTENT;
+
+    private MyPopupWindow mPopupWindow;
+    private static volatile PopupWindowManager mInstance;
+
+    /**
+     * 通过懒汉式来构建PopupWindowManager
+     *
+     * @return PopupWindowManager实例对象
+     */
+    public static PopupWindowManager getInstance() {
+        if (mInstance == null) {
+            synchronized (PopupWindowManager.class) {
+                if (mInstance == null) {
+                    mInstance = new PopupWindowManager();
+                }
+            }
+        }
+        return mInstance;
+    }
+
+    /**
+     * 设置私有的构造函数
+     */
+    private PopupWindowManager() {
+        mPopupWindow = new MyPopupWindow();
+    }
+
+    /**
+     * 获取PopupWindow的实例
+     *
+     * @return PopupWindow
+     */
+    private PopupWindow getMyPopupWindow() {
+        return mPopupWindow;
+    }
+
+    /**
+     * 初始化设置(默认宽高)
+     *
+     * @return PopupWindowManager实例对象
+     */
+    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
+    public PopupWindowManager init(View contentView) {
+        return init(contentView, mPopupWindowWidth, mPopupWindowHeight);
+    }
+
+    /**
+     * @param contentView 加载的View
+     * @param width       设置的宽度
+     * @param height      设置的高度
+     * @return PopupWindowManager实例对象
+     * 默认情况下:(1)popupWindow点击外部区域可以关闭
+     * (2)popupWindow可以聚焦
+     * // 设置PopupWindow可以聚焦
+     * // 如果不设置,在PopupWindow弹出的时候,点击返回键将直接退出Activity
+     * // 设置之后,在PopupWindow弹出的时候,点击返回键不会直接退出Activity而是关闭当前弹出的PopupWindow
+     * (3)popupWindow弹出的动画高度为0
+     * (4)popupWindow内容区域可以触摸
+     */
+    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
+    public PopupWindowManager init(View contentView, int width, int height) {
+        this.mPopupWindowWidth = width;
+        this.mPopupWindowHeight = height;
+        mPopupWindow.setContentView(contentView);
+        mPopupWindow.setOutsideTouchable(true);
+        mPopupWindow.setFocusable(true);
+        mPopupWindow.setElevation(0);
+        mPopupWindow.setTouchable(true);
+        setBackgroundDrawable();
+        mPopupWindow.setWidth(mPopupWindowWidth);
+        mPopupWindow.setHeight(mPopupWindowHeight);
+        //mPopupWindow.setAnimationStyle(R.style.popup_window_anim_style);
+        return this;
+    }
+
+    /**
+     * 设置popupWindow的背景
+     *
+     * @return PopupWindowManager实例对象
+     */
+    private PopupWindowManager setBackgroundDrawable() {
+        ColorDrawable dw = new ColorDrawable(Color.parseColor("#50000000"));
+        mPopupWindow.setBackgroundDrawable(dw);
+        return this;
+    }
+
+    /**
+     * 设置popupWindow的背景
+     *
+     * @param color 设置的背景颜色
+     * @return PopupWindowManager实例对象
+     */
+    public PopupWindowManager setBackgroundDrawable(int color) {
+        ColorDrawable dw = new ColorDrawable(color);
+        mPopupWindow.setBackgroundDrawable(dw);
+        return this;
+    }
+
+    /**
+     * 设置popupWindow的动画效果
+     * @param animationStyle 动画样式
+     * @return PopupWindowManager实例对象
+     */
+    public PopupWindowManager setAnimationStyle(int animationStyle){
+        mPopupWindow.setAnimationStyle(animationStyle);
+        return this;
+    }
+
+    /**
+     * 设置popupWindow点击外部区域是否可以关闭
+     *
+     * @param isOutsideTouchable true代表可以关闭 false代表不可以关闭
+     * @return PopupWindowManager实例对象
+     */
+    public PopupWindowManager setOutsideTouchable(boolean isOutsideTouchable) {
+        mPopupWindow.setOutsideTouchable(isOutsideTouchable);
+        return this;
+    }
+
+    /**
+     * popupWindow是否可以聚焦
+     *
+     * @param isFocusable true代表可以聚焦 false代表不可以聚焦
+     * @return PopupWindowManager实例对象
+     */
+    public PopupWindowManager setFocusable(boolean isFocusable) {
+        mPopupWindow.setFocusable(isFocusable);
+        return this;
+    }
+
+    /**
+     * 设置popupWindow弹出的动画高度
+     *
+     * @param elevation 高度
+     * @return PopupWindowManager实例对象
+     */
+    @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
+    public PopupWindowManager setElevation(float elevation) {
+        mPopupWindow.setElevation(elevation);
+        return this;
+    }
+
+    /**
+     * 设置popupWindow内容区域是否可以触摸
+     *
+     * @param touchable true代表可以触摸 false代表不可以触摸
+     * @return PopupWindowManager实例对象
+     */
+    public PopupWindowManager setTouchable(boolean touchable) {
+        mPopupWindow.setTouchable(touchable);
+        return this;
+    }
+
+    /**
+     * 设置关闭PopupWindow的监听
+     *
+     * @param onDismissListener 设置的监听实例
+     * @return PopupWindowManager实例对象
+     */
+    public PopupWindowManager setOnDismissListener(PopupWindow.OnDismissListener onDismissListener) {
+        mPopupWindow.setOnDismissListener(onDismissListener);
+        return this;
+    }
+
+    /**
+     * 在PopupWindow弹出之后点击任意区域关闭
+     *
+     * @param listener 设置的监听实例
+     * @return PopupWindowManager实例对象
+     */
+    public PopupWindowManager setTouchInterceptor(View.OnTouchListener listener) {
+        mPopupWindow.setTouchInterceptor(listener);
+        return this;
+    }
+
+    /**
+     * 在指定视图的下方展示
+     *
+     * @param anchor 目标View
+     *               一般情况下展示的视图以目标View的左下方的位置作为锚点
+     */
+    public void showAsDropDown(View anchor) {
+        mPopupWindow.showAsDropDown(anchor);
+    }
+
+    /**
+     * 在指定视图的下方展示
+     *
+     * @param anchor 目标View
+     * @param xoff   x轴的偏移量
+     * @param yoff   y轴的偏移量
+     */
+    public void showAsDropDown(View anchor, int xoff, int yoff) {
+        mPopupWindow.showAsDropDown(anchor, xoff, yoff);
+    }
+
+    /**
+     * 在指定视图的下方展示
+     *
+     * @param anchor  目标View
+     * @param xoff    x轴的偏移量
+     * @param yoff    y轴的偏移量
+     * @param gravity 相对于View的定位,系统默认是Gravity.TOP | Gravity.START;
+     */
+    public void showAsDropDown(View anchor, int xoff, int yoff, int gravity) {
+        mPopupWindow.showAsDropDown(anchor, xoff, yoff, gravity);
+    }
+
+    /**
+     * 以绝对值(x,y)来进行显示
+     *
+     * @param parent  View parent代表的是要能获取到window唯一标示的(也就是只要能获取到window 标示,view是什么控件都可以)
+     * @param gravity int gravity代表的是位置,即屏幕的上下左右,注意系统默认都是在屏幕中间
+     * @param x       x轴的偏移量
+     * @param y       y轴的偏移量
+     */
+    public void showAtLocation(View parent, int gravity, int x, int y) {
+        mPopupWindow.showAtLocation(parent, gravity, x, y);
+    }
+
+    /**
+     * 关闭PopupWindow
+     */
+    public void close() {
+        if (mPopupWindow != null && mPopupWindow.isShowing()) {
+            mPopupWindow.dismiss();
+        }
+    }
+}

+ 222 - 0
app/src/main/res/layout/activity_fxy_delivery_goods.xml

@@ -0,0 +1,222 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:background="@color/md_grey_100"
+    android:orientation="vertical">
+
+    <ScrollView
+        android:id="@+id/ll_scroll_view"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:scrollbars="none">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical">
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="4dp"
+                android:background="@color/md_grey_100" />
+
+            <LinearLayout
+                style="@style/FromLinearLayoutItem"
+                android:orientation="horizontal">
+                <EditText
+                    style="@style/EditTextStyle"
+                    android:id="@+id/et_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>
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="4dp"
+                android:background="@color/md_grey_100" />
+
+            <LinearLayout
+                android:id="@+id/ll_container"
+                style="@style/FromLinearLayoutItem"
+                android:orientation="horizontal">
+                <EditText
+                    style="@style/EditTextStyle"
+                    android:enabled="false"
+                    android:id="@+id/et_container_code"
+                    android:hint="@string/hint_please_scan_container_code"
+                    android:text=""/>
+
+                <ImageButton
+                    android:id="@+id/ib_container_code_clear"
+                    style="@style/ClearImg" />
+
+                <include   layout="@layout/item_image_code" />
+            </LinearLayout>
+
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="1dp"
+                android:background="@color/md_grey_100" />
+
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:layout_marginTop="@dimen/dp_10"
+                android:background="@drawable/bg_white_et"
+                android:gravity="center_vertical"
+                android:orientation="vertical"
+
+                android:paddingLeft="10dp"
+                android:paddingRight="10dp">
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:paddingBottom="5dp"
+                    android:paddingTop="5dp"
+                    android:orientation="horizontal">
+
+                    <TextView
+                        style="@style/tvLeftStyle"
+                        android:text="总托盘数" />
+                    <TextView
+                        style="@style/tvLeftStyle"
+                        android:text=":" />
+                    <TextView
+                        android:id="@+id/tv_total_qty"
+                        style="@style/tvLeftStyle"
+                        android:textColor="@color/md_deep_orange_700"
+                        android:text="0" />
+                    <TextView
+                        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=":" />
+
+                    <TextView
+                        android:id="@+id/tv_wait_scan_qty"
+                        style="@style/tvLeftStyle"
+                        android:layout_width="wrap_content"
+                        android:text="0"
+                        android:textColor="@color/md_deep_orange_700" />
+                    <TextView
+                        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=":" />
+                    <TextView
+                        style="@style/tvLeftStyle"
+                        android:id="@+id/tv_scan_qty"
+                        android:textColor="@color/md_deep_orange_700"
+                        android:text="0" />
+                    <TextView
+                        style="@style/tvLeftStyle"
+                        android:text="个" />
+                </LinearLayout>
+
+            </LinearLayout>
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="1dp"
+                android:background="@color/md_grey_100" />
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:paddingBottom="5dp"
+                android:paddingTop="5dp"
+                android:orientation="horizontal">
+                <TextView
+                    android:layout_marginLeft="@dimen/dp_10"
+                    style="@style/tvLeftStyle"
+                    android:text="最近扫描:" />
+
+
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:background="@drawable/bg_white_et"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:gravity="center_vertical"
+                android:orientation="horizontal"
+                android:scrollbars="vertical"
+                android:paddingTop="@dimen/dp_10"
+                android:paddingBottom="@dimen/dp_10"
+                >
+                <android.support.v7.widget.RecyclerView
+                    android:id="@+id/recyclerview"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:background="#fff"
+                    android:overScrollMode="never"/>
+            </LinearLayout>
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginTop="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:layout_marginBottom="@dimen/dp_4"
+                android:background="@drawable/bg_white_et"
+                android:gravity="center_vertical"
+                android:orientation="horizontal"
+                android:padding="10dp">
+                <TextView
+                    style="@style/fontSize"
+                    android:id="@+id/btn_confirm"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="@dimen/dp_10"
+                    android:layout_marginRight="@dimen/dp_10"
+                    android:background="@drawable/bg_orange_item"
+                    android:gravity="center"
+                    android:text="完成装柜"
+                    android:padding="10dp"
+                    android:textColor="@color/white"
+                    android:visibility="visible" />
+            </LinearLayout>
+        </LinearLayout>
+    </ScrollView>
+
+
+    <include layout="@layout/item_float_image" />
+</LinearLayout>

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

@@ -0,0 +1,272 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:background="@color/md_grey_100"
+    android:orientation="vertical">
+
+    <ScrollView
+        android:id="@+id/ll_scroll_view"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:scrollbars="none">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical">
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="4dp"
+                android:background="@color/md_grey_100" />
+
+            <LinearLayout
+                android:id="@+id/ll_container"
+                style="@style/FromLinearLayoutItem"
+                android:orientation="horizontal">
+                <EditText
+                    style="@style/EditTextStyle"
+                    android:id="@+id/et_container_code"
+                    android:hint="@string/hint_please_scan_container_code"
+                    android:text=""/>
+
+                <ImageButton
+                    android:id="@+id/ib_container_code_clear"
+                    style="@style/ClearImg"
+                     />
+
+                <include   layout="@layout/item_image_code" />
+            </LinearLayout>
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="4dp"
+                android:background="@color/md_grey_100" />
+
+            <LinearLayout
+                style="@style/FromLinearLayoutItem"
+                android:orientation="horizontal">
+                <EditText
+                    style="@style/EditTextStyle"
+                    android:id="@+id/et_order_no"
+                    android:hint="@string/hint_please_scan_no"
+                    android:enabled="false"
+                    android:text=""/>
+                <ImageButton
+                    style="@style/ClearImg"
+                    android:id="@+id/ib_order_no_clear"
+                    />
+
+                <include   layout="@layout/item_image_code" />
+            </LinearLayout>
+
+
+            <LinearLayout
+                android:id="@+id/ll_customer"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:gravity="center_vertical"
+                android:visibility="gone"
+                android:orientation="horizontal">
+                <TextView
+                    style="@style/tvLeftStyle"
+                    android:text="FX" />
+
+                <LinearLayout
+                    style="@style/FromLinearLayoutItem"
+                    android:layout_width="match_parent"
+                    android:orientation="horizontal">
+
+                    <EditText
+                        android:id="@+id/et_customer_code"
+                        style="@style/EditTextStyle"
+                        android:hint="请输入客户编号"
+                        android:text=""  />
+
+                    <ImageButton style="@style/ClearImg" />
+
+                    <include layout="@layout/item_image_code" />
+                </LinearLayout>
+
+            </LinearLayout>
+
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="1dp"
+                android:background="@color/md_grey_100" />
+
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:layout_marginTop="@dimen/dp_10"
+                android:background="@drawable/bg_white_et"
+                android:gravity="center_vertical"
+                android:orientation="vertical"
+                android:paddingLeft="10dp"
+                android:paddingRight="10dp">
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:paddingBottom="5dp"
+                    android:paddingTop="5dp"
+                    android:orientation="horizontal">
+
+                    <TextView
+                        style="@style/tvLeftStyle"
+                        android:text="@string/str_tray_code" />
+                    <TextView
+                        style="@style/tvLeftStyle"
+                        android:text=":" />
+
+                    <com.fxy.baselibrary.views.MarqueeTextView
+                        style="@style/mtRightStyle"
+                        android:id="@+id/mt_container_code"
+                        />
+
+                </LinearLayout>
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:paddingBottom="5dp"
+                    android:paddingTop="5dp"
+                    android:orientation="horizontal">
+
+                    <TextView
+                        style="@style/tvLeftStyle"
+                        android:text="货物类型" />
+                    <TextView
+                        style="@style/tvLeftStyle"
+                        android:text=":" />
+
+                    <com.fxy.baselibrary.views.MarqueeTextView
+                        style="@style/mtRightStyle"
+                        android:id="@+id/mt_send_way"
+                        />
+
+                </LinearLayout>
+                <LinearLayout
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:paddingBottom="5dp"
+                    android:paddingTop="5dp"
+                    android:orientation="horizontal">
+
+                    <TextView
+                        style="@style/tvLeftStyle"
+                        android:text="入库数量" />
+                    <TextView
+                        style="@style/tvLeftStyle"
+                        android:text=":" />
+
+                    <com.fxy.baselibrary.views.MarqueeTextView
+                        style="@style/mtRightStyle"
+                        android:id="@+id/mt_putin_qty"
+                        />
+
+                </LinearLayout>
+
+
+            </LinearLayout>
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="1dp"
+                android:background="@color/md_grey_100" />
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:paddingBottom="5dp"
+                android:paddingTop="5dp"
+                android:orientation="horizontal">
+                <TextView
+                    android:layout_marginLeft="@dimen/dp_10"
+                    style="@style/tvLeftStyle"
+                    android:text="最近扫描:" />
+
+
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:background="@drawable/bg_white_et"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:gravity="center_vertical"
+                android:orientation="horizontal"
+                android:scrollbars="vertical"
+                android:paddingTop="@dimen/dp_10"
+                android:paddingBottom="@dimen/dp_10"
+                >
+                <android.support.v7.widget.RecyclerView
+                    android:id="@+id/recyclerview"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:background="#fff"
+                    android:overScrollMode="never"/>
+            </LinearLayout>
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/dp_10"
+                android:layout_marginTop="@dimen/dp_10"
+                android:layout_marginRight="@dimen/dp_10"
+                android:layout_marginBottom="@dimen/dp_4"
+                android:background="@drawable/bg_white_et"
+                android:gravity="center_vertical"
+                android:orientation="horizontal"
+                android:padding="10dp">
+                <TextView
+                    style="@style/fontSize"
+                    android:id="@+id/btn_confirm"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="@dimen/dp_10"
+                    android:layout_marginRight="@dimen/dp_10"
+                    android:background="@drawable/bg_orange_item"
+                    android:gravity="center"
+                    android:text="关闭托盘"
+                    android:padding="10dp"
+                    android:textColor="@color/white"
+                    android:visibility="visible" />
+            </LinearLayout>
+            <LinearLayout
+                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_change_confirm"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="@dimen/dp_10"
+                    android:layout_marginRight="@dimen/dp_10"
+                    android:background="@drawable/bg_orange_item"
+                    android:gravity="center"
+                    android:text="切换托盘"
+                    android:padding="10dp"
+                    android:textColor="@color/white"
+                    android:visibility="visible" />
+            </LinearLayout>
+        </LinearLayout>
+    </ScrollView>
+
+
+    <include layout="@layout/item_float_image" />
+</LinearLayout>

+ 0 - 28
app/src/main/res/layout/activity_login.xml

@@ -23,34 +23,6 @@
                 android:layout_height="50px"
                 android:background="@drawable/sto_logo"/>
         </LinearLayout>
-        <LinearLayout
-            style="@style/LinearLayoutLoginStyle"
-            android:layout_marginTop="-50dp"
-            android:orientation="horizontal">
-            <TextView
-                android:layout_width="wrap_content"
-                android:layout_height="wrap_content"
-                android:text="@string/login_warehouse"
-                android:textColor="@color/colorAccent"
-                android:textSize="@dimen/t18"
-                />
-
-            <com.jaredrummler.materialspinner.MaterialSpinner
-                android:id="@+id/ms_log_type"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
-                android:layout_marginLeft="10dp"
-                android:layout_marginRight="10dp"
-                android:background="@drawable/bg_blue_item"
-                android:ellipsize="marquee"
-                android:focusable="true"
-                app:ms_padding_top="5dp"
-                app:ms_padding_bottom="5dp"
-                app:ms_padding_left="5dp"
-                app:ms_popup_padding_left="10dp"
-                android:gravity="center"
-                android:textSize="@dimen/t18"/>
-        </LinearLayout>
         <LinearLayout
             style="@style/LinearLayoutLoginStyle"
             android:orientation="horizontal">

+ 18 - 52
app/src/main/res/layout/fragment_homepager.xml

@@ -83,7 +83,14 @@
                     android:textSize="@dimen/t14"
                     android:visibility="gone"
                     android:textStyle="bold" />
-
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center"
+                    android:text="入库"
+                    android:textColor="@color/black_3d3d3d"
+                    android:textSize="@dimen/t14"
+                    android:textStyle="bold" />
                 <TableRow
                     android:layout_width="match_parent"
                     android:layout_height="wrap_content"
@@ -93,68 +100,32 @@
 
                     <TextView
                         style="@style/ImageViewWithTextStyle.FontSize"
-                        android:id="@+id/ivt_tally_tc"
+                        android:id="@+id/ivt_tally"
                         android:drawableTop="@drawable/ic_mapan"
                         android:drawablePadding="5dp"
-                        android:text="@string/tally" />
+                        android:text="快速入库" />
+
 
-                    <TextView
-                        style="@style/ImageViewWithTextStyle.FontSize"
-                        android:id="@+id/ivt_putaway_tc"
-                        android:drawableTop="@drawable/ic_shelves"
-                        android:drawablePadding="5dp"
-                        android:text="@string/str_putaway" />
                 </TableRow>
             </LinearLayout>
 
 
+
             <LinearLayout
-                android:id="@+id/ll_check_menu_tc"
+                android:id="@+id/ll_put_out_menu_tc"
                 style="@style/LinearLayoutCornerStyle"
                 android:layout_marginTop="10dp"
                 android:orientation="vertical"
-                android:padding="@dimen/dp_10">
-
+                android:padding="@dimen/dp_10"
+                android:visibility="visible">
                 <TextView
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_gravity="center"
-                    android:text="@string/str_check"
+                    android:text="出库"
                     android:textColor="@color/black_3d3d3d"
                     android:textSize="@dimen/t14"
-                    android:visibility="gone"
                     android:textStyle="bold" />
-
-                <TableRow
-                    android:layout_width="match_parent"
-                    android:layout_height="wrap_content"
-                    android:layout_marginTop="@dimen/t12"
-                    android:weightSum="2">
-
-                    <TextView
-                        style="@style/ImageViewWithTextStyle.FontSize"
-                        android:id="@+id/ivt_check_list_tc"
-                        android:layout_height="match_parent"
-                        android:drawableTop="@drawable/ic_kccx"
-                        android:drawablePadding="5dp"
-                        android:text="@string/str_checklist" />
-
-                    <TextView
-                        style="@style/ImageViewWithTextStyle.FontSize"
-                        android:id="@+id/ivt_check_tc"
-                        android:drawableTop="@drawable/ic_kccx"
-                        android:drawablePadding="5dp"
-                        android:text="@string/str_single_check" />
-                </TableRow>
-            </LinearLayout>
-            <LinearLayout
-                android:id="@+id/ll_put_out_menu_tc"
-                style="@style/LinearLayoutCornerStyle"
-                android:layout_marginTop="10dp"
-                android:orientation="vertical"
-                android:padding="@dimen/dp_10"
-                android:visibility="visible">
-
                 <TextView
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
@@ -173,16 +144,11 @@
 
                     <TextView
                         style="@style/ImageViewWithTextStyle.FontSize"
-                        android:id="@+id/ivt_cargo_storage_tc"
+                        android:id="@+id/ivt_cargo_storage"
                         android:drawableTop="@drawable/ic_shift"
                         android:drawablePadding="5dp"
                         android:text="@string/str_cargo_storage" />
-                    <TextView
-                        style="@style/ImageViewWithTextStyle.FontSize"
-                        android:id="@+id/ivt_cancel_storage_tc"
-                        android:drawableTop="@drawable/ic_shift"
-                        android:drawablePadding="5dp"
-                        android:text="@string/str_revocation_container" />
+
 
                 </TableRow>
             </LinearLayout>

+ 55 - 0
app/src/main/res/layout/item_putin_scan.xml

@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+             xmlns:app="http://schemas.android.com/apk/res-auto"
+             xmlns:tools="http://schemas.android.com/tools"
+             android:layout_width="match_parent"
+             android:layout_height="wrap_content">
+
+    <android.support.v7.widget.CardView
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_marginBottom="1dp"
+        android:layout_marginLeft="5dp"
+        android:layout_marginRight="5dp"
+        android:layout_marginTop="1dp"
+        app:cardUseCompatPadding="true"
+        app:cardCornerRadius="5dp"
+        app:cardElevation="5dp">
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_margin="5dp"
+            android:orientation="vertical"
+            android:paddingLeft="0dp"
+            android:paddingRight="0dp">
+            <LinearLayout
+                android:id="@+id/ll_item_card_first"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="1dp"
+                android:orientation="horizontal">
+
+                <TextView
+                    android:id="@+id/tv_number"
+                    android:layout_width="0dp"
+                    android:layout_height="match_parent"
+                    android:layout_weight="1"
+                    android:gravity="center"
+                    android:textColor="@color/black_636363"
+                    android:textSize="@dimen/t20"
+                    android:textStyle="bold"
+                    tools:text="12345" />
+
+                <ImageView
+                    android:id="@+id/ib_clear"
+                    android:layout_width="wrap_content"
+                    android:layout_height="match_parent"
+                    android:background="@android:color/transparent"
+                    android:focusable="false"
+                    android:padding="5dp"
+                    android:src="@drawable/ic_clear" />
+            </LinearLayout>
+        </LinearLayout>
+    </android.support.v7.widget.CardView>
+</FrameLayout>

BIN
app/src/main/res/mipmap-hdpi/ic_launcher.png


BIN
app/src/main/res/mipmap-hdpi/ic_launcher_round.png


BIN
app/src/main/res/mipmap-hdpi/ic_zj_launcher.png


BIN
app/src/main/res/mipmap-hdpi/ic_zj_launcher_round.png


BIN
app/src/main/res/mipmap-mdpi/ic_launcher.png


BIN
app/src/main/res/mipmap-mdpi/ic_launcher_round.png


BIN
app/src/main/res/mipmap-mdpi/ic_zj_launcher.png


BIN
app/src/main/res/mipmap-mdpi/ic_zj_launcher_round.png


BIN
app/src/main/res/mipmap-xhdpi/ic_launcher.png


BIN
app/src/main/res/mipmap-xhdpi/ic_launcher_round.png


BIN
app/src/main/res/mipmap-xhdpi/ic_zj_launcher.png


BIN
app/src/main/res/mipmap-xhdpi/ic_zj_launcher_round.png


BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher.png


BIN
app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png


BIN
app/src/main/res/mipmap-xxhdpi/ic_zj_launcher.png


BIN
app/src/main/res/mipmap-xxhdpi/ic_zj_launcher_round.png


BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher.png


BIN
app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png


BIN
app/src/main/res/mipmap-xxxhdpi/ic_zj_launcher.png


BIN
app/src/main/res/mipmap-xxxhdpi/ic_zj_launcher_round.png


+ 2 - 2
app/src/main/res/values/styles.xml

@@ -122,11 +122,11 @@
     <!--清空数据按钮统一样式-->
     <style name="ClearImg">
         <item name="android:layout_width">wrap_content</item>
-        <item name="android:layout_height">wrap_content</item>
+        <item name="android:layout_height">match_parent</item>
         <item name="android:layout_marginEnd">3dp</item>
         <item name="android:background">@android:color/transparent</item>
         <item name="android:padding">6dp</item>
-        <item name="android:src">@drawable/ic_clear</item>
+        <item name="android:src">@drawable/ic_clear2</item>
         <item name="android:visibility">invisible</item>
     </style>
 

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

@@ -27,6 +27,7 @@ import android.view.ViewStub;
 import android.view.inputmethod.InputMethodManager;
 import android.widget.EditText;
 import android.widget.FrameLayout;
+import android.widget.ImageButton;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.RelativeLayout;
@@ -101,6 +102,8 @@ public abstract class BaseActivity extends SupportActivity implements Observer {
     protected Realm mRealm;
     protected static final int REQUESTCODE_CAMERA = 5001 ;
     protected static final int GET_IMAGE_BY_CAMERA = 5002 ;
+
+
     //记录
 
     MyPageManager pageStateManager;
@@ -897,4 +900,38 @@ public abstract class BaseActivity extends SupportActivity implements Observer {
         return false;
     }
 
+    /**
+     * 获取子元素ImageButton
+     * @param linearLayout
+     * @return
+     */
+    public ImageButton getChildImageButton(LinearLayout  linearLayout){
+        for( int i = 0; i < linearLayout.getChildCount(); i++ ){
+            if( linearLayout.getChildAt(i) instanceof ImageButton ){
+                return (ImageButton)linearLayout.getChildAt(i);
+            }
+        }
+        return null;
+    }
+    /**
+     * 统一设置清除数据
+     * @param imageButton
+     */
+    public void unifyClearEdit(ImageButton imageButton){
+        imageButton.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                LinearLayout  linearLayout = (LinearLayout)view.getParent();
+                for( int i = 0; i < linearLayout.getChildCount(); i++ ){
+                    if( linearLayout.getChildAt(i) instanceof EditText ){
+                        ((EditText) linearLayout.getChildAt(i)).getText().clear();
+                        linearLayout.getChildAt(i).requestFocus();
+                        break;
+                    }
+                }
+            }
+        });
+    }
+
+
 }

+ 2 - 2
version.properties

@@ -1,2 +1,2 @@
-#Thu Oct 27 14:30:01 CST 2022
-versionCode=7
+#Wed Nov 02 11:57:23 CST 2022
+versionCode=57