소스 검색

日志增加时间输出, 部分逻辑优化

lhm 3 년 전
부모
커밋
4d80811f92
37개의 변경된 파일506개의 추가작업 그리고 260개의 파일을 삭제
  1. 5 4
      app/src/main/AndroidManifest.xml
  2. 3 2
      app/src/main/java/com/emato/ich/MainActivity.java
  3. 4 3
      app/src/main/java/com/emato/ich/api/ICSPClient.java
  4. 0 2
      app/src/main/java/com/emato/ich/api/ICSPResponseCodeEnum.java
  5. 15 8
      app/src/main/java/com/emato/ich/crash/BootBroadcastReceiver.java
  6. 2 2
      app/src/main/java/com/emato/ich/crash/UncaughtExceptionHandlerImpl.java
  7. 8 8
      app/src/main/java/com/emato/ich/device/DeviceControl.java
  8. 11 0
      app/src/main/java/com/emato/ich/entity/Message.java
  9. 34 31
      app/src/main/java/com/emato/ich/fragment/ChooseCabinetFragment.java
  10. 41 36
      app/src/main/java/com/emato/ich/fragment/ExceptionFragment.java
  11. 49 41
      app/src/main/java/com/emato/ich/fragment/InputInfoFragment.java
  12. 1 1
      app/src/main/java/com/emato/ich/fragment/MainFragment.java
  13. 108 5
      app/src/main/java/com/emato/ich/fragment/SendFragment.java
  14. 26 21
      app/src/main/java/com/emato/ich/fragment/SendInfoConfirmFragment.java
  15. 1 1
      app/src/main/java/com/emato/ich/fragment/SendMainFragment.java
  16. 1 1
      app/src/main/java/com/emato/ich/fragment/SendSuccessFragment.java
  17. 32 28
      app/src/main/java/com/emato/ich/fragment/TakeCodeFragment.java
  18. 1 1
      app/src/main/java/com/emato/ich/fragment/TakeFragment.java
  19. 32 27
      app/src/main/java/com/emato/ich/fragment/TakeSuccessFragment.java
  20. 1 1
      app/src/main/java/com/emato/ich/local/LocalStorage.java
  21. 1 1
      app/src/main/java/com/emato/ich/message/ICHPublishClient.java
  22. 1 1
      app/src/main/java/com/emato/ich/message/ICHSubscribeClient.java
  23. 8 8
      app/src/main/java/com/emato/ich/update/APKAutoUpdate.java
  24. 2 2
      app/src/main/java/com/emato/ich/update/APKUpdateDownload.java
  25. 2 1
      app/src/main/java/com/emato/ich/update/CustomUpdateConfigProvider.java
  26. 1 1
      app/src/main/java/com/emato/ich/update/InstallListener.java
  27. 2 2
      app/src/main/java/com/emato/ich/update/InstallResultReceiver.java
  28. 38 7
      app/src/main/java/com/emato/ich/update/PackageManagerCompat.java
  29. 1 1
      app/src/main/java/com/emato/ich/update/UpdateService.java
  30. 1 1
      app/src/main/java/com/emato/ich/utils/BaseUtils.java
  31. 16 0
      app/src/main/java/com/emato/ich/utils/DateUtils.java
  32. 1 1
      app/src/main/java/com/emato/ich/utils/FileUtils.java
  33. 1 1
      app/src/main/java/com/emato/ich/utils/JacksonUtils.java
  34. 46 0
      app/src/main/java/com/emato/ich/utils/Log.java
  35. 1 1
      app/src/main/java/com/emato/ich/utils/ResourceUtils.java
  36. 7 7
      app/src/main/res/layout/fragment_send_info_confirm.xml
  37. 2 2
      app/src/main/res/values/colors.xml

+ 5 - 4
app/src/main/AndroidManifest.xml

@@ -62,12 +62,13 @@
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </receiver>
-        <receiver
-            android:name="com.emato.ich.update.InstallResultReceiver"
-            android:enabled="true"
-            android:exported="true">
+        <receiver android:name="com.emato.ich.update.InstallResultReceiver">
             <intent-filter>
                 <action android:name="android.content.pm.extra.STATUS"/>
+                <action android:name="android.intent.action.PACKAGE_ADDED" />
+                <action android:name="android.intent.action.PACKAGE_REMOVED" />
+                <action android:name="android.intent.action.PACKAGE_REPLACED" />
+                <data android:scheme="package" />
             </intent-filter>
         </receiver>
 <!--        <receiver android:name=".update.InstallResultReceiver">-->

+ 3 - 2
app/src/main/java/com/emato/ich/MainActivity.java

@@ -31,7 +31,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
 import androidx.appcompat.app.AppCompatActivity;
 
 import android.provider.SyncStateContract;
-import android.util.Log;
+import com.emato.ich.utils.Log;
 import android.view.KeyEvent;
 
 import androidx.navigation.NavController;
@@ -160,7 +160,7 @@ public class MainActivity extends AppCompatActivity  {
                         .build()
                         .update();
 
-//                XUpdate.newBuild(this)
+//                XUpdate.newBuild(getApplicationContext())
 //                        .updateUrl(ICSPApi.GET_UPDATE_PATH.getUrl())
 //                        .isAutoMode(true) // 如果需要完全无人干预,自动更新,需要root权限【静默安装需要】
 //                        .update();
@@ -365,6 +365,7 @@ public class MainActivity extends AppCompatActivity  {
         failedMsg.setPort(message.getPort());
         failedMsg.setScene(message.getScene());
         failedMsg.setSection(message.getSection());
+        failedMsg.setMsgId(message.getMsgId());
         mqttMessage.setQos(1);
         mqttMessage.setPayload(objectMapper.writeValueAsBytes(failedMsg));
 

+ 4 - 3
app/src/main/java/com/emato/ich/api/ICSPClient.java

@@ -1,6 +1,6 @@
 package com.emato.ich.api;
 
-import android.util.Log;
+import com.emato.ich.utils.Log;
 
 import com.emato.ich.entity.vo.ConfirmOrderVo;
 import com.emato.ich.entity.vo.PreparedOrderVo;
@@ -12,6 +12,7 @@ import com.emato.ich.utils.LoggingUtils;
 import com.emato.ich.utils.StringUtils;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import com.zhy.http.okhttp.OkHttpUtils;
 
 import java.io.IOException;
 import java.util.Objects;
@@ -249,8 +250,8 @@ public class ICSPClient {
     }
 
     static class ICSPClientInnerClass{
-
-        private static final OkHttpClient CLIENT = new OkHttpClient.Builder().connectTimeout(60, TimeUnit.SECONDS)
+        // 重试 超时时间1min 读取超时1min
+        private static final OkHttpClient CLIENT = new OkHttpClient.Builder().retryOnConnectionFailure(true).connectTimeout(60, TimeUnit.SECONDS)
                 .readTimeout(60, TimeUnit.SECONDS).build();
 
     }

+ 0 - 2
app/src/main/java/com/emato/ich/api/ICSPResponseCodeEnum.java

@@ -1,11 +1,9 @@
 package com.emato.ich.api;
 
 import android.content.Context;
-import android.view.View;
 
 import com.emato.ich.entity.vo.ResponseData;
 import com.emato.ich.utils.ToastUtils;
-import com.google.android.material.snackbar.Snackbar;
 
 import java.util.Arrays;
 

+ 15 - 8
app/src/main/java/com/emato/ich/crash/BootBroadcastReceiver.java

@@ -5,22 +5,29 @@ import android.content.Context;
 import android.content.Intent;
 
 import com.emato.ich.MainActivity;
+import com.emato.ich.utils.Log;
 
 public class BootBroadcastReceiver extends BroadcastReceiver {
     static final String ACTION = "android.intent.action.BOOT_COMPLETED";
+    private static final String TAG = BootBroadcastReceiver.class.getName();
 
     @Override
     public void onReceive(Context context, Intent intent) {
         if (intent.getAction().equals(ACTION)) {
-            // 开机启动的Activity
-            Intent activityIntent = new Intent(context, MainActivity.class);
-            activityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
-            // 启动Activity
-            context.startActivity(activityIntent);
-            //2.如果自启动Activity
-            context.startActivity(activityIntent);
-            //3.如果自启动服务
+            try {
+                // 开机启动的Activity
+                Intent activityIntent = new Intent(context, MainActivity.class);
+                activityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+                // 启动Activity
+                context.startActivity(activityIntent);
+                //2.如果自启动Activity
+                context.startActivity(activityIntent);
+                Log.i(TAG, "=========================>应用断点重启完成! ");
+                //3.如果自启动服务
 //            context.startService(intent);
+            } catch (Exception e) {
+                Log.e(TAG, "=========================>应用断点重启失败! ", e);
+            }
         }
     }
 }

+ 2 - 2
app/src/main/java/com/emato/ich/crash/UncaughtExceptionHandlerImpl.java

@@ -10,7 +10,7 @@ import android.content.pm.PackageManager;
 import android.os.Build;
 import android.os.Environment;
 import android.os.Looper;
-import android.util.Log;
+import com.emato.ich.utils.Log;
 import android.widget.Toast;
 
 import com.emato.ich.MainActivity;
@@ -166,7 +166,7 @@ public class UncaughtExceptionHandlerImpl implements Thread.UncaughtExceptionHan
             try {
                 field.setAccessible(true);
                 this.infos.put(field.getName(), field.get((Object)null).toString());
-                Log.d(TAG, field.getName() + " : " + field.get((Object)null));
+                Log.i(TAG, field.getName() + " : " + field.get((Object)null));
             } catch (Exception var8) {
                 Log.e(TAG, "an error occured when collect crash info", var8);
                 LoggingUtils.sendErrorLog("业务异常: an error occured when collect crash info! ", var8);

+ 8 - 8
app/src/main/java/com/emato/ich/device/DeviceControl.java

@@ -1,6 +1,6 @@
 package com.emato.ich.device;
 
-import android.util.Log;
+import com.emato.ich.utils.Log;
 
 import com.cherry.sdk.controller.InitDevice;
 import com.cherry.sdk.controller.MoternDeviceController;
@@ -53,10 +53,10 @@ public class DeviceControl {
      * 函数用途:查询锁版版本
      */
     public static void queryVersion(int section, CmdCallback cmdCallback) {
-        Log.d(TAG, new Date() + "查询锁版本开始");
+        Log.i(TAG, new Date() + "查询锁版本开始");
         DeviceResult result = new DeviceResult();
         initedInstance.queryVersion(section, cmdCallback);
-        Log.d(TAG, new Date() + "查询锁版本结束");
+        Log.i(TAG, new Date() + "查询锁版本结束");
     }
 
     /**
@@ -293,8 +293,8 @@ public class DeviceControl {
         initedInstance.hotSection(2, 1, new CmdCallback() {
             @Override
             public void onMessage(int i, String... strings) {
-                Log.d(TAG, new Date() + "onMessage: " + i);
-                Log.d(TAG, new Date() + "onMessage: " + Arrays.asList(strings));
+                Log.i(TAG, new Date() + "onMessage: " + i);
+                Log.i(TAG, new Date() + "onMessage: " + Arrays.asList(strings));
             }
         });
         return false;
@@ -311,7 +311,7 @@ public class DeviceControl {
         initedInstance.degasLocker(2, 1, 1, new CmdCallback() {
             @Override
             public void onMessage(int i, String... strings) {
-                Log.d(TAG, "onMessage: " + i);
+                Log.i(TAG, "onMessage: " + i);
             }
         });
         return false;
@@ -343,8 +343,8 @@ public class DeviceControl {
     @Deprecated
     public static String relayOpt(int section, int port, int opt){
         initedInstance.relayOpt(section, port, opt, (i, s) -> {
-            Log.d(TAG, "relayOpt: " + i);
-            Log.d(TAG, "relayOpt: " + Arrays.asList(s));
+            Log.i(TAG, "relayOpt: " + i);
+            Log.i(TAG, "relayOpt: " + Arrays.asList(s));
         });
         return "";
     }

+ 11 - 0
app/src/main/java/com/emato/ich/entity/Message.java

@@ -4,6 +4,8 @@ public class Message {
 
     private int messageId;
 
+    private String msgId;
+
     private String clientId;
 
     private String cmd;
@@ -100,10 +102,19 @@ public class Message {
         this.remark = remark;
     }
 
+    public String getMsgId() {
+        return msgId;
+    }
+
+    public void setMsgId(String msgId) {
+        this.msgId = msgId;
+    }
+
     @Override
     public String toString() {
         return "Message{" +
                 "messageId=" + messageId +
+                ", msgId='" + msgId + '\'' +
                 ", clientId='" + clientId + '\'' +
                 ", cmd='" + cmd + '\'' +
                 ", datetime='" + datetime + '\'' +

+ 34 - 31
app/src/main/java/com/emato/ich/fragment/ChooseCabinetFragment.java

@@ -3,7 +3,7 @@ package com.emato.ich.fragment;
 import android.annotation.SuppressLint;
 import android.os.Bundle;
 import android.os.CountDownTimer;
-import android.util.Log;
+import com.emato.ich.utils.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -149,8 +149,7 @@ public class ChooseCabinetFragment extends Fragment {
                                 LoggingUtils.sendErrorLog("业务异常: 获取柜子剩余信息未知错误! ", e);
                             }
                         } else {
-                            ToastUtils.make(getContext(), "获取柜子剩余信息出错!请重新进入此页面!");
-                            LoggingUtils.sendErrorLog("业务异常: 获取柜子剩余信息出错!请重新进入此页面! ", null);
+                            ToastUtils.make(getContext(), "服务器异常!请稍后重试!");
                         }
                     });
                 }
@@ -244,37 +243,41 @@ public class ChooseCabinetFragment extends Fragment {
                                 ((MainActivity) getActivity()).runOnUiThread(() -> {
                                     try {
                                         String responseStr = ICSPClient.isSuccessfulAndParseResponse(response);
-                                        ObjectMapper objectMapper = JacksonUtils.objectmapper;
-                                        ResponseData<PreparedOrderResponseVo> responseData = objectMapper.readValue(responseStr, new TypeReference<ResponseData<PreparedOrderResponseVo>>() {});
-                                        // 响应信息
-                                        if (responseData.getCode().equals(ICSPResponseCodeEnum.OK.getCode())) {
-                                            PreparedOrderResponseVo data = responseData.getData();
-                                            if (null != data) {
-                                                data.setOrderSn(preparedOrderResponse.getOrderSn());
-                                                data.setCollectorPhone(preparedOrderResponse.getCollectorPhone());
-                                                String mailNo = inputInfoBundle.getString("takeNo");
-                                                bundle.putString("preparedOrderResponse", objectMapper.writeValueAsString(data));
-                                                bundle.putString("takeNo", mailNo);
-                                                bundle.putString("section_type", data.getLockerName());
-
-                                                // 跳转到确认投递
-                                                try {
-                                                    MainActivity activity = (MainActivity) getActivity();
-                                                    activity.getBundleMap().put(InputInfoFragment.class.getName(), bundle);
-                                                    activity.getBundleMap().remove(ExceptionFragment.class.getName());
-                                                    timer.cancel();
-                                                    NavHostFragment.findNavController(ChooseCabinetFragment.this)
-                                                            .navigate(R.id.action_chooseCabinetFragment_to_sendInfoConfirmFragment);
-                                                } catch (RuntimeException e) {
-                                                    Log.e(TAG, "onResponse: InputInfoFragment页面获取SendInfoConfirmFragment传值错误! ", e);
-                                                    LoggingUtils.sendErrorLog("业务异常: InputInfoFragment页面获取SendInfoConfirmFragment传值错误! ", e);
+                                        if (!StringUtils.isNullOrEmpty(responseStr)) {
+                                            ObjectMapper objectMapper = JacksonUtils.objectmapper;
+                                            ResponseData<PreparedOrderResponseVo> responseData = objectMapper.readValue(responseStr, new TypeReference<ResponseData<PreparedOrderResponseVo>>() {});
+                                            // 响应信息
+                                            if (responseData.getCode().equals(ICSPResponseCodeEnum.OK.getCode())) {
+                                                PreparedOrderResponseVo data = responseData.getData();
+                                                if (null != data) {
+                                                    data.setOrderSn(preparedOrderResponse.getOrderSn());
+                                                    data.setCollectorPhone(preparedOrderResponse.getCollectorPhone());
+                                                    String mailNo = inputInfoBundle.getString("takeNo");
+                                                    bundle.putString("preparedOrderResponse", objectMapper.writeValueAsString(data));
+                                                    bundle.putString("takeNo", mailNo);
+                                                    bundle.putString("section_type", data.getLockerName());
+
+                                                    // 跳转到确认投递
+                                                    try {
+                                                        MainActivity activity = (MainActivity) getActivity();
+                                                        activity.getBundleMap().put(InputInfoFragment.class.getName(), bundle);
+                                                        activity.getBundleMap().remove(ExceptionFragment.class.getName());
+                                                        timer.cancel();
+                                                        NavHostFragment.findNavController(ChooseCabinetFragment.this)
+                                                                .navigate(R.id.action_chooseCabinetFragment_to_sendInfoConfirmFragment);
+                                                    } catch (RuntimeException e) {
+                                                        Log.e(TAG, "onResponse: InputInfoFragment页面获取SendInfoConfirmFragment传值错误! ", e);
+                                                        LoggingUtils.sendErrorLog("业务异常: InputInfoFragment页面获取SendInfoConfirmFragment传值错误! ", e);
+                                                    }
                                                 }
+                                            } else {
+                                                ICSPResponseCodeEnum.responseHint(getContext(), responseData);
+                                                RuntimeException exception = new RuntimeException("系统异常");
+                                                Log.e(TAG, "onResponse: ICSP返回码: " + responseData.getCode() + ", 返回信息: " + responseData.getMsg(), exception);
+                                                LoggingUtils.sendErrorLog("业务异常: ICSP返回码: " + responseData.getCode() + ", 返回信息: " + responseData.getMsg(), exception);
                                             }
                                         } else {
-                                            ICSPResponseCodeEnum.responseHint(getContext(), responseData);
-                                            RuntimeException exception = new RuntimeException("系统异常");
-                                            Log.e(TAG, "onResponse: ICSP返回码: " + responseData.getCode() + ", 返回信息: " + responseData.getMsg(), exception);
-                                            LoggingUtils.sendErrorLog("业务异常: ICSP返回码: " + responseData.getCode() + ", 返回信息: " + responseData.getMsg(), exception);
+                                            ToastUtils.make(getContext(), "服务器异常!请稍后重试!");
                                         }
                                     } catch (JsonProcessingException e) {
                                         Log.e(TAG, "onResponse: 预下单转换成JSON出错! ", e);

+ 41 - 36
app/src/main/java/com/emato/ich/fragment/ExceptionFragment.java

@@ -2,7 +2,7 @@ package com.emato.ich.fragment;
 
 import android.os.Bundle;
 import android.os.CountDownTimer;
-import android.util.Log;
+import com.emato.ich.utils.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -27,6 +27,7 @@ import com.emato.ich.utils.BaseUtils;
 import com.emato.ich.utils.ButtonUtils;
 import com.emato.ich.utils.JacksonUtils;
 import com.emato.ich.utils.LoggingUtils;
+import com.emato.ich.utils.StringUtils;
 import com.emato.ich.utils.TimeOutUtils;
 import com.emato.ich.utils.ToastUtils;
 import com.fasterxml.jackson.core.JsonProcessingException;
@@ -232,46 +233,50 @@ public class ExceptionFragment extends Fragment {
                                     ResponseData responseData = null;
                                     try {
                                         String parseResponse = ICSPClient.isSuccessfulAndParseResponse(response);
-                                        try {
-                                            responseData = objectMapper.readValue(parseResponse, ResponseData.class);
-                                            // TODO 处理异常
-                                            if (responseData != null && responseData.getCode().equals(ICSPResponseCodeEnum.OK.getCode())) {
-                                                String code = responseData.getCode();
-                                                Object data = responseData.getData();
-                                                Log.i(TAG, "onResponse: 响应码: " + code + ", 响应消息: " + responseData.getMsg());
-                                                switch (decisionEnum) {
-                                                    case CANCEL_11:
-                                                        // 未投递 取消
-                                                    case CANCEL_12:
-                                                        // 拿出快递 取消
-                                                        // 清空session, 跳转到主页
-                                                        LocalStorage.getInstance().cleanSession(((MainActivity) getActivity()));
-                                                        timer.cancel();
-                                                        NavHostFragment.findNavController(ExceptionFragment.this)
-                                                                .navigate(R.id.action_exceptionFragment_to_sendSuccessFragment);
-                                                        break;
-                                                    case REOPEN_01:
-                                                        // 大小不合适
+                                        if (!StringUtils.isNullOrEmpty(parseResponse)) {
+                                            try {
+                                                responseData = objectMapper.readValue(parseResponse, ResponseData.class);
+                                                // TODO 处理异常
+                                                if (responseData != null && responseData.getCode().equals(ICSPResponseCodeEnum.OK.getCode())) {
+                                                    String code = responseData.getCode();
+                                                    Object data = responseData.getData();
+                                                    Log.i(TAG, "onResponse: 响应码: " + code + ", 响应消息: " + responseData.getMsg());
+                                                    switch (decisionEnum) {
+                                                        case CANCEL_11:
+                                                            // 未投递 取消
+                                                        case CANCEL_12:
+                                                            // 拿出快递 取消
+                                                            // 清空session, 跳转到主页
+                                                            LocalStorage.getInstance().cleanSession(((MainActivity) getActivity()));
+                                                            timer.cancel();
+                                                            NavHostFragment.findNavController(ExceptionFragment.this)
+                                                                    .navigate(R.id.action_exceptionFragment_to_sendSuccessFragment);
+                                                            break;
+                                                        case REOPEN_01:
+                                                            // 大小不合适
 
-                                                        break;
-                                                    case REOPEN_02:
-                                                        // 门没开换柜门
+                                                            break;
+                                                        case REOPEN_02:
+                                                            // 门没开换柜门
 
-                                                        break;
-                                                    case REOPEN_03:
-                                                        // 门没开再开一次
+                                                            break;
+                                                        case REOPEN_03:
+                                                            // 门没开再开一次
 
-                                                        break;
-                                                    default:
-                                                        break;
+                                                            break;
+                                                        default:
+                                                            break;
+                                                    }
+                                                } else {
+                                                    ICSPResponseCodeEnum.responseHint(getContext(), responseData);
+                                                    Log.w(TAG, "onResponse: " + responseData.getMsg());
                                                 }
-                                            } else {
-                                                ICSPResponseCodeEnum.responseHint(getContext(), responseData);
-                                                Log.w(TAG, "onResponse: " + responseData.getMsg());
+                                            } catch (JsonProcessingException e) {
+                                                Log.e(TAG, "onResponse: 处理异常场景: " + decisionEnum.getMsg() + ", 解析响应信息时出错! ", e);
+                                                LoggingUtils.sendErrorLog("业务异常: 处理异常场景: " + decisionEnum.getMsg() + ", 解析响应信息时出错! ", e);
                                             }
-                                        } catch (JsonProcessingException e) {
-                                            Log.e(TAG, "onResponse: 处理异常场景: " + decisionEnum.getMsg() + ", 解析响应信息时出错! ", e);
-                                            LoggingUtils.sendErrorLog("业务异常: 处理异常场景: " + decisionEnum.getMsg() + ", 解析响应信息时出错! ", e);
+                                        } else {
+                                            ToastUtils.make(getContext(), "服务器异常!请稍后重试!");
                                         }
                                     } catch (RuntimeException e) {
                                         Log.e(TAG, "onResponse: 处理\"" + decisionEnum.getMsg() + "\"问题时出错! 返回码: " + responseData.getCode() + ", 错误消息: " + responseData.getMsg(), e);

+ 49 - 41
app/src/main/java/com/emato/ich/fragment/InputInfoFragment.java

@@ -3,7 +3,7 @@ package com.emato.ich.fragment;
 import android.os.Bundle;
 import android.os.CountDownTimer;
 import android.text.Editable;
-import android.util.Log;
+import com.emato.ich.utils.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -128,26 +128,30 @@ public class InputInfoFragment extends Fragment {
 
                             getActivity().runOnUiThread(() -> {
                                 String parseResponse = ICSPClient.isSuccessfulAndParseResponse(response);
-                                try {
-                                    ResponseData<PreparedOrderResponseVo> responseData = new ObjectMapper().readValue(parseResponse, new TypeReference<ResponseData<PreparedOrderResponseVo>>() {
-                                    });
-
-                                    PreparedOrderResponseVo data = responseData.getData();
-                                    if (null != responseData && ICSPResponseCodeEnum.OK.getCode().equals(responseData.getCode())) {
-                                        String collectorPhone = data.getCollectorPhone();
-                                        binding.delivererPhoneConfirm.setText(collectorPhone);
-                                    }
+                                if (!StringUtils.isNullOrEmpty(parseResponse)) {
+                                    try {
+                                        ResponseData<PreparedOrderResponseVo> responseData = new ObjectMapper().readValue(parseResponse, new TypeReference<ResponseData<PreparedOrderResponseVo>>() {
+                                        });
+
+                                        PreparedOrderResponseVo data = responseData.getData();
+                                        if (null != responseData && ICSPResponseCodeEnum.OK.getCode().equals(responseData.getCode())) {
+                                            String collectorPhone = data.getCollectorPhone();
+                                            binding.delivererPhoneConfirm.setText(collectorPhone);
+                                        }
 
-                                    ICSPResponseCodeEnum.responseHint(getContext(), responseData);
+                                        ICSPResponseCodeEnum.responseHint(getContext(), responseData);
 
-                                } catch (JsonProcessingException e) {
-                                    Log.e(TAG, "onResponse: 服务器响应错误! 自动获取用户手机号失败! ", e);
-                                    ToastUtils.make(getContext(), "网络异常! 请手动输入手机号! ");
-                                    LoggingUtils.sendErrorLog("业务异常: 服务器响应错误! 自动获取用户手机号失败! ", e);
-                                } catch (RuntimeException e) {
-                                    Log.e(TAG, "onResponse: 获取用户手机号未知错误! ", e);
-                                    ToastUtils.make(getContext(), "未查询到手机号! 请手动输入! ");
-                                    LoggingUtils.sendErrorLog("业务异常: 获取用户手机号未知错误! ", e);
+                                    } catch (JsonProcessingException e) {
+                                        Log.e(TAG, "onResponse: 服务器响应错误! 自动获取用户手机号失败! ", e);
+                                        ToastUtils.make(getContext(), "网络异常! 请手动输入手机号! ");
+                                        LoggingUtils.sendErrorLog("业务异常: 服务器响应错误! 自动获取用户手机号失败! ", e);
+                                    } catch (RuntimeException e) {
+                                        Log.e(TAG, "onResponse: 获取用户手机号未知错误! ", e);
+                                        ToastUtils.make(getContext(), "未查询到手机号! 请手动输入! ");
+                                        LoggingUtils.sendErrorLog("业务异常: 获取用户手机号未知错误! ", e);
+                                    }
+                                } else {
+                                    ToastUtils.make(getContext(), "服务器异常!请稍后重试!");
                                 }
                                 mailNoLock.set(1);
                             });
@@ -202,31 +206,35 @@ public class InputInfoFragment extends Fragment {
                             ((MainActivity) getActivity()).runOnUiThread(() -> {
                                 try {
                                     String responseStr = ICSPClient.isSuccessfulAndParseResponse(response);
-                                    ObjectMapper objectMapper = JacksonUtils.objectmapper;
-                                    ResponseData<PreparedOrderResponseVo> responseData = objectMapper.readValue(responseStr, new TypeReference<ResponseData<PreparedOrderResponseVo>>() {});
-                                    data = responseData.getData();
-                                    // 响应信息
-                                    if (responseData.getCode().equals(ICSPResponseCodeEnum.OK.getCode())) {
-                                        bundle.putString("preparedOrderResponse", objectMapper.writeValueAsString(data));
-                                        bundle.putString("takeNo", mailNo);
-                                        bundle.putString("sectionType", finalSectionType);
-
-                                        // 跳转到确认投递
-                                        try {
-                                            MainActivity activity = (MainActivity) getActivity();
-                                            activity.getBundleMap().put(InputInfoFragment.class.getName(), bundle);
-                                        } catch (RuntimeException e) {
-                                            Log.e(TAG, "onResponse: InputInfoFragment页面获取SendInfoConfirmFragment传值错误! ", e);
-                                            LoggingUtils.sendErrorLog("业务异常: InputInfoFragment页面获取SendInfoConfirmFragment传值错误! ", e);
+                                    if (!StringUtils.isNullOrEmpty(responseStr)) {
+                                        ObjectMapper objectMapper = JacksonUtils.objectmapper;
+                                        ResponseData<PreparedOrderResponseVo> responseData = objectMapper.readValue(responseStr, new TypeReference<ResponseData<PreparedOrderResponseVo>>() {});
+                                        data = responseData.getData();
+                                        // 响应信息
+                                        if (responseData.getCode().equals(ICSPResponseCodeEnum.OK.getCode())) {
+                                            bundle.putString("preparedOrderResponse", objectMapper.writeValueAsString(data));
+                                            bundle.putString("takeNo", mailNo);
+                                            bundle.putString("sectionType", finalSectionType);
+
+                                            // 跳转到确认投递
+                                            try {
+                                                MainActivity activity = (MainActivity) getActivity();
+                                                activity.getBundleMap().put(InputInfoFragment.class.getName(), bundle);
+                                            } catch (RuntimeException e) {
+                                                Log.e(TAG, "onResponse: InputInfoFragment页面获取SendInfoConfirmFragment传值错误! ", e);
+                                                LoggingUtils.sendErrorLog("业务异常: InputInfoFragment页面获取SendInfoConfirmFragment传值错误! ", e);
+                                            }
+                                            timer.cancel();
+                                            NavHostFragment.findNavController(InputInfoFragment.this).navigate(R.id.action_inputInfoFragment_to_sendInfoConfirmFragment);
+                                        } else {
+                                            RuntimeException exception = new RuntimeException("系统异常");
+                                            Log.e(TAG, "onResponse: ICSP返回码: " + responseData.getCode() + ", 返回信息: " + responseData.getMsg(), exception);
+                                            LoggingUtils.sendErrorLog("业务异常: ICSP返回码: " + responseData.getCode() + ", 返回信息: " + responseData.getMsg(), exception);
                                         }
-                                        timer.cancel();
-                                        NavHostFragment.findNavController(InputInfoFragment.this).navigate(R.id.action_inputInfoFragment_to_sendInfoConfirmFragment);
+                                        ToastUtils.make(getContext(), responseData.getMsg());
                                     } else {
-                                        RuntimeException exception = new RuntimeException("系统异常");
-                                        Log.e(TAG, "onResponse: ICSP返回码: " + responseData.getCode() + ", 返回信息: " + responseData.getMsg(), exception);
-                                        LoggingUtils.sendErrorLog("业务异常: ICSP返回码: " + responseData.getCode() + ", 返回信息: " + responseData.getMsg(), exception);
+                                        ToastUtils.make(getContext(), "服务器异常!请稍后重试!");
                                     }
-                                    ToastUtils.make(getContext(), responseData.getMsg());
                                 } catch (JsonProcessingException e) {
                                     Log.e(TAG, "onResponse: 预下单转换成JSON出错! ", e);
                                     LoggingUtils.sendErrorLog("业务异常: 预下单转换成JSON出错! ", e);

+ 1 - 1
app/src/main/java/com/emato/ich/fragment/MainFragment.java

@@ -2,7 +2,7 @@ package com.emato.ich.fragment;
 
 import android.graphics.drawable.Drawable;
 import android.os.Bundle;
-import android.util.Log;
+import com.emato.ich.utils.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;

+ 108 - 5
app/src/main/java/com/emato/ich/fragment/SendFragment.java

@@ -3,7 +3,7 @@ package com.emato.ich.fragment;
 import android.os.Bundle;
 import android.os.CountDownTimer;
 import android.text.Editable;
-import android.util.Log;
+import com.emato.ich.utils.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -133,8 +133,7 @@ public class SendFragment extends Fragment {
                                 }
                             } else {
                                 // 登录失败
-                                ToastUtils.make(getContext(), "登录失败!手机号或密码错误!");
-                                LoggingUtils.sendErrorLog("业务异常: 登录失败!手机号或密码错误!", null);
+                                ToastUtils.make(getContext(), "服务异常!请稍后重试!");
                             }
                         });
                     }
@@ -164,42 +163,92 @@ public class SendFragment extends Fragment {
             binding.editTextTextPersonName4.setOnFocusChangeListener((view1, hasFocus) -> {
                 if (hasFocus) {
                     binding.inputButton0.setOnClickListener(v -> {
+                        int length = binding.editTextTextPersonName4.getText().length();
+                        if (length >= 11) {
+                            ToastUtils.make(getContext(), "手机号不能超过11位! ");
+                            return;
+                        }
                         int start = binding.editTextTextPersonName4.getSelectionStart();
                         binding.editTextTextPersonName4.getText().insert(start, "0");
                     });
                     binding.inputButton1.setOnClickListener(v -> {
+                        int length = binding.editTextTextPersonName4.getText().length();
+                        if (length >= 11) {
+                            ToastUtils.make(getContext(), "手机号不能超过11位! ");
+                            return;
+                        }
                         int start = binding.editTextTextPersonName4.getSelectionStart();
                         binding.editTextTextPersonName4.getText().insert(start, "1");
                     });
                     binding.inputButton2.setOnClickListener(v -> {
+                        int length = binding.editTextTextPersonName4.getText().length();
+                        if (length >= 11) {
+                            ToastUtils.make(getContext(), "手机号不能超过11位! ");
+                            return;
+                        }
                         int start = binding.editTextTextPersonName4.getSelectionStart();
                         binding.editTextTextPersonName4.getText().insert(start, "2");
                     });
                     binding.inputButton3.setOnClickListener(v -> {
+                        int length = binding.editTextTextPersonName4.getText().length();
+                        if (length >= 11) {
+                            ToastUtils.make(getContext(), "手机号不能超过11位! ");
+                            return;
+                        }
                         int start = binding.editTextTextPersonName4.getSelectionStart();
                         binding.editTextTextPersonName4.getText().insert(start, "3");
                     });
                     binding.inputButton4.setOnClickListener(v -> {
+                        int length = binding.editTextTextPersonName4.getText().length();
+                        if (length >= 11) {
+                            ToastUtils.make(getContext(), "手机号不能超过11位! ");
+                            return;
+                        }
                         int start = binding.editTextTextPersonName4.getSelectionStart();
                         binding.editTextTextPersonName4.getText().insert(start, "4");
                     });
                     binding.inputButton5.setOnClickListener(v -> {
+                        int length = binding.editTextTextPersonName4.getText().length();
+                        if (length >= 11) {
+                            ToastUtils.make(getContext(), "手机号不能超过11位! ");
+                            return;
+                        }
                         int start = binding.editTextTextPersonName4.getSelectionStart();
                         binding.editTextTextPersonName4.getText().insert(start, "5");
                     });
                     binding.inputButton6.setOnClickListener(v -> {
+                        int length = binding.editTextTextPersonName4.getText().length();
+                        if (length >= 11) {
+                            ToastUtils.make(getContext(), "手机号不能超过11位! ");
+                            return;
+                        }
                         int start = binding.editTextTextPersonName4.getSelectionStart();
                         binding.editTextTextPersonName4.getText().insert(start, "6");
                     });
                     binding.inputButton7.setOnClickListener(v -> {
+                        int length = binding.editTextTextPersonName4.getText().length();
+                        if (length >= 11) {
+                            ToastUtils.make(getContext(), "手机号不能超过11位! ");
+                            return;
+                        }
                         int start = binding.editTextTextPersonName4.getSelectionStart();
                         binding.editTextTextPersonName4.getText().insert(start, "7");
                     });
                     binding.inputButton8.setOnClickListener(v -> {
+                        int length = binding.editTextTextPersonName4.getText().length();
+                        if (length >= 11) {
+                            ToastUtils.make(getContext(), "手机号不能超过11位! ");
+                            return;
+                        }
                         int start = binding.editTextTextPersonName4.getSelectionStart();
                         binding.editTextTextPersonName4.getText().insert(start, "8");
                     });
                     binding.inputButton9.setOnClickListener(v -> {
+                        int length = binding.editTextTextPersonName4.getText().length();
+                        if (length >= 11) {
+                            ToastUtils.make(getContext(), "手机号不能超过11位! ");
+                            return;
+                        }
                         int start = binding.editTextTextPersonName4.getSelectionStart();
                         binding.editTextTextPersonName4.getText().insert(start, "9");
                     });
@@ -213,7 +262,7 @@ public class SendFragment extends Fragment {
                     });
                     // 长按删除
                     binding.inputButtonCancel.setOnLongClickListener(v -> {
-                        binding.editTextTextPersonName5.getText().clear();
+                        binding.editTextTextPersonName4.getText().clear();
                         return false;
                     });
                 }
@@ -224,42 +273,92 @@ public class SendFragment extends Fragment {
         binding.editTextTextPersonName5.setOnFocusChangeListener((view1, hasFocus) -> {
             if (hasFocus) {
                 binding.inputButton0.setOnClickListener(v -> {
+                    int length = binding.editTextTextPersonName5.getText().length();
+                    if (length >= 16) {
+                        ToastUtils.make(getContext(), "密码最多不能超过16位! ");
+                        return;
+                    }
                     int start = binding.editTextTextPersonName5.getSelectionStart();
                     binding.editTextTextPersonName5.getText().insert(start, "0");
                 });
                 binding.inputButton1.setOnClickListener(v -> {
+                    int length = binding.editTextTextPersonName5.getText().length();
+                    if (length >= 16) {
+                        ToastUtils.make(getContext(), "密码最多不能超过16位! ");
+                        return;
+                    }
                     int start = binding.editTextTextPersonName5.getSelectionStart();
                     binding.editTextTextPersonName5.getText().insert(start, "1");
                 });
                 binding.inputButton2.setOnClickListener(v -> {
+                    int length = binding.editTextTextPersonName5.getText().length();
+                    if (length >= 16) {
+                        ToastUtils.make(getContext(), "密码最多不能超过16位! ");
+                        return;
+                    }
                     int start = binding.editTextTextPersonName5.getSelectionStart();
                     binding.editTextTextPersonName5.getText().insert(start, "2");
                 });
                 binding.inputButton3.setOnClickListener(v -> {
+                    int length = binding.editTextTextPersonName5.getText().length();
+                    if (length >= 16) {
+                        ToastUtils.make(getContext(), "密码最多不能超过16位! ");
+                        return;
+                    }
                     int start = binding.editTextTextPersonName5.getSelectionStart();
                     binding.editTextTextPersonName5.getText().insert(start, "3");
                 });
                 binding.inputButton4.setOnClickListener(v -> {
+                    int length = binding.editTextTextPersonName5.getText().length();
+                    if (length >= 16) {
+                        ToastUtils.make(getContext(), "密码最多不能超过16位! ");
+                        return;
+                    }
                     int start = binding.editTextTextPersonName5.getSelectionStart();
                     binding.editTextTextPersonName5.getText().insert(start, "4");
                 });
                 binding.inputButton5.setOnClickListener(v -> {
+                    int length = binding.editTextTextPersonName5.getText().length();
+                    if (length >= 16) {
+                        ToastUtils.make(getContext(), "密码最多不能超过16位! ");
+                        return;
+                    }
                     int start = binding.editTextTextPersonName5.getSelectionStart();
                     binding.editTextTextPersonName5.getText().insert(start, "5");
                 });
                 binding.inputButton6.setOnClickListener(v -> {
+                    int length = binding.editTextTextPersonName5.getText().length();
+                    if (length >= 16) {
+                        ToastUtils.make(getContext(), "密码最多不能超过16位! ");
+                        return;
+                    }
                     int start = binding.editTextTextPersonName5.getSelectionStart();
                     binding.editTextTextPersonName5.getText().insert(start, "6");
                 });
                 binding.inputButton7.setOnClickListener(v -> {
+                    int length = binding.editTextTextPersonName5.getText().length();
+                    if (length >= 16) {
+                        ToastUtils.make(getContext(), "密码最多不能超过16位! ");
+                        return;
+                    }
                     int start = binding.editTextTextPersonName5.getSelectionStart();
                     binding.editTextTextPersonName5.getText().insert(start, "7");
                 });
                 binding.inputButton8.setOnClickListener(v -> {
+                    int length = binding.editTextTextPersonName5.getText().length();
+                    if (length >= 16) {
+                        ToastUtils.make(getContext(), "密码最多不能超过16位! ");
+                        return;
+                    }
                     int start = binding.editTextTextPersonName5.getSelectionStart();
                     binding.editTextTextPersonName5.getText().insert(start, "8");
                 });
                 binding.inputButton9.setOnClickListener(v -> {
+                    int length = binding.editTextTextPersonName5.getText().length();
+                    if (length >= 16) {
+                        ToastUtils.make(getContext(), "密码最多不能超过16位! ");
+                        return;
+                    }
                     int start = binding.editTextTextPersonName5.getSelectionStart();
                     binding.editTextTextPersonName5.getText().insert(start, "9");
                 });
@@ -290,7 +389,11 @@ public class SendFragment extends Fragment {
 
 
         // 默认选中密码输入
-        binding.editTextTextPersonName5.requestFocus();
+        if (!StringUtils.isNullOrEmpty(binding.editTextTextPersonName4.getText().toString())) {
+            binding.editTextTextPersonName5.requestFocus();
+        } else {
+            binding.editTextTextPersonName4.requestFocus();
+        }
     }
 
     @Override

+ 26 - 21
app/src/main/java/com/emato/ich/fragment/SendInfoConfirmFragment.java

@@ -3,7 +3,7 @@ package com.emato.ich.fragment;
 import android.app.AlertDialog;
 import android.os.Bundle;
 import android.os.CountDownTimer;
-import android.util.Log;
+import com.emato.ich.utils.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -27,6 +27,7 @@ import com.emato.ich.utils.BaseUtils;
 import com.emato.ich.utils.ButtonUtils;
 import com.emato.ich.utils.JacksonUtils;
 import com.emato.ich.utils.LoggingUtils;
+import com.emato.ich.utils.StringUtils;
 import com.emato.ich.utils.TimeOutUtils;
 import com.emato.ich.utils.ToastUtils;
 import com.fasterxml.jackson.core.JsonProcessingException;
@@ -129,27 +130,31 @@ public class SendInfoConfirmFragment extends Fragment {
                 public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
                     getActivity().runOnUiThread(() -> {
                         String parseResponse = ICSPClient.isSuccessfulAndParseResponse(response);
-                        ObjectMapper objectMapper = JacksonUtils.objectmapper;
-                        try {
-                            ResponseData responseData = objectMapper.readValue(parseResponse, ResponseData.class);
-                            String code = responseData.getCode();
-                            if (code.equals(ICSPResponseCodeEnum.OK.getCode())) {
-                                // TODO 确认投递成功逻辑处理
-                                ToastUtils.make(getContext(), "投递成功!");
-                                timer.cancel();
-                                NavHostFragment.findNavController(SendInfoConfirmFragment.this)
-                                        .navigate(R.id.action_sendInfoConfirmFragment_to_sendSuccessFragment);
-                            } else {
-                                // TODO 确认投递失败逻辑处理
-                                ToastUtils.make(getContext(), responseData.getMsg());
-                                Log.w(TAG, "onResponse: " + responseData.getMsg());
+                        if (!StringUtils.isNullOrEmpty(parseResponse)) {
+                            ObjectMapper objectMapper = JacksonUtils.objectmapper;
+                            try {
+                                ResponseData responseData = objectMapper.readValue(parseResponse, ResponseData.class);
+                                String code = responseData.getCode();
+                                if (code.equals(ICSPResponseCodeEnum.OK.getCode())) {
+                                    // TODO 确认投递成功逻辑处理
+                                    ToastUtils.make(getContext(), "投递成功!");
+                                    timer.cancel();
+                                    NavHostFragment.findNavController(SendInfoConfirmFragment.this)
+                                            .navigate(R.id.action_sendInfoConfirmFragment_to_sendSuccessFragment);
+                                } else {
+                                    // TODO 确认投递失败逻辑处理
+                                    ToastUtils.make(getContext(), responseData.getMsg());
+                                    Log.w(TAG, "onResponse: " + responseData.getMsg());
+                                }
+                            } catch (JsonProcessingException e) {
+                                Log.e(TAG, "onResponse: 确认投递解析响应信息失败!", e);
+                                LoggingUtils.sendErrorLog("业务异常: 确认投递解析响应信息失败! ", e);
+                            } catch (RuntimeException e) {
+                                Log.e(TAG, "onResponse: 投递失败! ", e);
+                                LoggingUtils.sendErrorLog("业务异常: 投递失败! 未知异常! ", e);
                             }
-                        } catch (JsonProcessingException e) {
-                            Log.e(TAG, "onResponse: 确认投递解析响应信息失败!", e);
-                            LoggingUtils.sendErrorLog("业务异常: 确认投递解析响应信息失败! ", e);
-                        } catch (RuntimeException e) {
-                            Log.e(TAG, "onResponse: 投递失败! ", e);
-                            LoggingUtils.sendErrorLog("业务异常: 投递失败! 未知异常! ", e);
+                        } else {
+                            ToastUtils.make(getContext(), "服务器异常! 请稍后重试!");
                         }
                     });
                 }

+ 1 - 1
app/src/main/java/com/emato/ich/fragment/SendMainFragment.java

@@ -2,7 +2,7 @@ package com.emato.ich.fragment;
 
 import android.os.Bundle;
 import android.os.CountDownTimer;
-import android.util.Log;
+import com.emato.ich.utils.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;

+ 1 - 1
app/src/main/java/com/emato/ich/fragment/SendSuccessFragment.java

@@ -2,7 +2,7 @@ package com.emato.ich.fragment;
 
 import android.os.Bundle;
 import android.os.CountDownTimer;
-import android.util.Log;
+import com.emato.ich.utils.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;

+ 32 - 28
app/src/main/java/com/emato/ich/fragment/TakeCodeFragment.java

@@ -4,7 +4,7 @@ import android.graphics.drawable.Drawable;
 import android.os.Bundle;
 import android.os.CountDownTimer;
 import android.text.Editable;
-import android.util.Log;
+import com.emato.ich.utils.Log;
 import android.view.Gravity;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -245,36 +245,40 @@ public class TakeCodeFragment extends Fragment {
                         // TODO 返回锁板和锁id, 开柜门
                         getActivity().runOnUiThread(() -> {
                             String parseResponse = ICSPClient.isSuccessfulAndParseResponse(response);
-                            try {
-                                ObjectMapper objectMapper = JacksonUtils.objectmapper;
-                                ResponseData<PreparedOrderResponseVo> responseData = null;
+                            if (!StringUtils.isNullOrEmpty(parseResponse)) {
                                 try {
-                                    responseData = objectMapper.readValue(parseResponse, new TypeReference<ResponseData<PreparedOrderResponseVo>>() {
-                                    });
-                                    ToastUtils.make(getContext(), responseData.getMsg());
-                                } catch (JsonProcessingException e) {
-                                    Log.e(TAG, "onResponse: 解析取件开门响应信息失败! ", e);
-                                    LoggingUtils.sendErrorLog("业务异常: 解析取件开门响应信息失败! ", e);
+                                    ObjectMapper objectMapper = JacksonUtils.objectmapper;
+                                    ResponseData<PreparedOrderResponseVo> responseData = null;
+                                    try {
+                                        responseData = objectMapper.readValue(parseResponse, new TypeReference<ResponseData<PreparedOrderResponseVo>>() {
+                                        });
+                                        ToastUtils.make(getContext(), responseData.getMsg());
+                                    } catch (JsonProcessingException e) {
+                                        Log.e(TAG, "onResponse: 解析取件开门响应信息失败! ", e);
+                                        LoggingUtils.sendErrorLog("业务异常: 解析取件开门响应信息失败! ", e);
+                                    } catch (RuntimeException e) {
+                                        Log.e(TAG, "onResponse: 未知错误! ", e);
+                                        ToastUtils.make(getContext(), "未知错误!");
+                                        LoggingUtils.sendErrorLog("业务异常: 解析取件开门响应信息失败! 未知错误!  ", e);
+                                    }
+                                    if (null != responseData && responseData.getCode().equals(ICSPResponseCodeEnum.OK.getCode())) {
+                                        // 开门
+                                        Log.i(TAG, "onResponse: 取件成功! ");
+                                        ToastUtils.make(getContext(), "取件成功!");
+                                        Bundle bundle = new Bundle();
+                                        bundle.putString("takeParcelCode", takeParcelCode);
+                                        bundle.putString("takeCabinetNo", responseData.getData().getLockerName());
+                                        ((MainActivity) getActivity()).getBundleMap().put(TakeCodeFragment.class.getName(), bundle);
+                                        timer.cancel();
+                                        NavHostFragment.findNavController(TakeCodeFragment.this).navigate(R.id.action_takeCodeFragment_to_takeSuccessFragment);
+                                    }
                                 } catch (RuntimeException e) {
-                                    Log.e(TAG, "onResponse: 未知错误! ", e);
-                                    ToastUtils.make(getContext(), "未知错误!");
-                                    LoggingUtils.sendErrorLog("业务异常: 解析取件开门响应信息失败! 未知错误!  ", e);
+                                    Log.e(TAG, "onResponse: 取件失败! ", e);
+                                    ToastUtils.make(getContext(), "取件失败!");
+                                    LoggingUtils.sendErrorLog("业务异常: 取件失败! ", e);
                                 }
-                                if (null != responseData && responseData.getCode().equals(ICSPResponseCodeEnum.OK.getCode())) {
-                                    // 开门
-                                    Log.i(TAG, "onResponse: 取件成功! ");
-                                    ToastUtils.make(getContext(), "取件成功!");
-                                    Bundle bundle = new Bundle();
-                                    bundle.putString("takeParcelCode", takeParcelCode);
-                                    bundle.putString("takeCabinetNo", responseData.getData().getLockerName());
-                                    ((MainActivity) getActivity()).getBundleMap().put(TakeCodeFragment.class.getName(), bundle);
-                                    timer.cancel();
-                                    NavHostFragment.findNavController(TakeCodeFragment.this).navigate(R.id.action_takeCodeFragment_to_takeSuccessFragment);
-                                }
-                            } catch (RuntimeException e) {
-                                Log.e(TAG, "onResponse: 取件失败! ", e);
-                                ToastUtils.make(getContext(), "取件失败!");
-                                LoggingUtils.sendErrorLog("业务异常: 取件失败! ", e);
+                            } else {
+                                ToastUtils.make(getContext(), "服务器异常! 请稍后重试!");
                             }
                         });
                     }

+ 1 - 1
app/src/main/java/com/emato/ich/fragment/TakeFragment.java

@@ -3,7 +3,7 @@ package com.emato.ich.fragment;
 import android.graphics.drawable.Drawable;
 import android.os.Bundle;
 import android.os.CountDownTimer;
-import android.util.Log;
+import com.emato.ich.utils.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;

+ 32 - 27
app/src/main/java/com/emato/ich/fragment/TakeSuccessFragment.java

@@ -2,7 +2,7 @@ package com.emato.ich.fragment;
 
 import android.os.Bundle;
 import android.os.CountDownTimer;
-import android.util.Log;
+import com.emato.ich.utils.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -26,6 +26,7 @@ import com.emato.ich.utils.BaseUtils;
 import com.emato.ich.utils.ButtonUtils;
 import com.emato.ich.utils.JacksonUtils;
 import com.emato.ich.utils.LoggingUtils;
+import com.emato.ich.utils.StringUtils;
 import com.emato.ich.utils.TimeOutUtils;
 import com.emato.ich.utils.ToastUtils;
 import com.fasterxml.jackson.core.JsonProcessingException;
@@ -154,35 +155,39 @@ public class TakeSuccessFragment extends Fragment {
                     // TODO 返回锁板和锁id, 开柜门
                     getActivity().runOnUiThread(() -> {
                         String parseResponse = ICSPClient.isSuccessfulAndParseResponse(response);
-                        try {
-                            ObjectMapper objectMapper = JacksonUtils.objectmapper;
-                            ResponseData<PreparedOrderResponseVo> responseData = null;
+                        if (!StringUtils.isNullOrEmpty(parseResponse)) {
                             try {
-                                responseData = objectMapper.readValue(parseResponse, new TypeReference<ResponseData<PreparedOrderResponseVo>>() {
-                                });
-                                ToastUtils.make(getContext(), responseData.getMsg());
-                            } catch (JsonProcessingException e) {
-                                Log.e(TAG, "onResponse: 解析取件开门响应信息失败! ", e);
-                                LoggingUtils.sendErrorLog("业务异常: 解析取件开门响应信息失败! ", e);
+                                ObjectMapper objectMapper = JacksonUtils.objectmapper;
+                                ResponseData<PreparedOrderResponseVo> responseData = null;
+                                try {
+                                    responseData = objectMapper.readValue(parseResponse, new TypeReference<ResponseData<PreparedOrderResponseVo>>() {
+                                    });
+                                    ToastUtils.make(getContext(), responseData.getMsg());
+                                } catch (JsonProcessingException e) {
+                                    Log.e(TAG, "onResponse: 解析取件开门响应信息失败! ", e);
+                                    LoggingUtils.sendErrorLog("业务异常: 解析取件开门响应信息失败! ", e);
+                                } catch (RuntimeException e) {
+                                    Log.e(TAG, "onResponse: 未知错误! ", e);
+                                    ToastUtils.make(getContext(), "未知错误!");
+                                    LoggingUtils.sendErrorLog("业务异常: 解析取件开门响应信息失败! 未知错误! ", e);
+                                }
+                                if (null != responseData && responseData.getCode().equals(ICSPResponseCodeEnum.OK.getCode())) {
+                                    // 开门
+                                    Log.i(TAG, "onResponse: 取件成功! ");
+                                    ToastUtils.make(getContext(), "取件成功!");
+                                    PreparedOrderResponseVo data = responseData.getData();
+                                    binding.openCabinetHintNo.setText(data.getLockerName());
+                                    finalActivity.getBundleMap().remove(TakeCodeFragment.class.getName());
+                                } else {
+                                    ToastUtils.make(getContext(), responseData.getMsg());
+                                }
                             } catch (RuntimeException e) {
-                                Log.e(TAG, "onResponse: 未知错误! ", e);
-                                ToastUtils.make(getContext(), "未知错误!");
-                                LoggingUtils.sendErrorLog("业务异常: 解析取件开门响应信息失败! 未知错误! ", e);
+                                Log.e(TAG, "onResponse: 取件失败! ", e);
+                                ToastUtils.make(getContext(), "取件失败!");
+                                LoggingUtils.sendErrorLog("业务异常: 取件失败! 未知错误! ", e);
                             }
-                            if (null != responseData && responseData.getCode().equals(ICSPResponseCodeEnum.OK.getCode())) {
-                                // 开门
-                                Log.i(TAG, "onResponse: 取件成功! ");
-                                ToastUtils.make(getContext(), "取件成功!");
-                                PreparedOrderResponseVo data = responseData.getData();
-                                binding.openCabinetHintNo.setText(data.getLockerName());
-                                finalActivity.getBundleMap().remove(TakeCodeFragment.class.getName());
-                            } else {
-                                ToastUtils.make(getContext(), responseData.getMsg());
-                            }
-                        } catch (RuntimeException e) {
-                            Log.e(TAG, "onResponse: 取件失败! ", e);
-                            ToastUtils.make(getContext(), "取件失败!");
-                            LoggingUtils.sendErrorLog("业务异常: 取件失败! 未知错误! ", e);
+                        } else {
+                            ToastUtils.make(getContext(), "服务器异常! 请稍后重试!");
                         }
                     });
                 }

+ 1 - 1
app/src/main/java/com/emato/ich/local/LocalStorage.java

@@ -71,7 +71,7 @@ public class LocalStorage {
 
         private long time;
 
-        private int expiryTime = 15;
+        private int expiryTime = 30;
 
         /**
          * 新增字段 只能做一次异常处理, 点击异常处理的 异常事件按钮 后该值为false

+ 1 - 1
app/src/main/java/com/emato/ich/message/ICHPublishClient.java

@@ -1,6 +1,6 @@
 package com.emato.ich.message;
 
-import android.util.Log;
+import com.emato.ich.utils.Log;
 
 import com.emato.ich.contant.ICSPConstant;
 import com.emato.ich.utils.BaseUtils;

+ 1 - 1
app/src/main/java/com/emato/ich/message/ICHSubscribeClient.java

@@ -1,6 +1,6 @@
 package com.emato.ich.message;
 
-import android.util.Log;
+import com.emato.ich.utils.Log;
 
 import com.emato.ich.contant.ICSPConstant;
 import com.emato.ich.utils.BaseUtils;

+ 8 - 8
app/src/main/java/com/emato/ich/update/APKAutoUpdate.java

@@ -6,7 +6,7 @@ import android.content.Intent;
 import android.content.pm.PackageInfo;
 import android.content.pm.PackageInstaller;
 import android.content.pm.PackageManager;
-import android.util.Log;
+import com.emato.ich.utils.Log;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -23,7 +23,7 @@ public class APKAutoUpdate {
      * 全部替换安装
      * @return
      */
-    public static Boolean installApk(Context mContext, String apkFilePath, OnInstallListener listener) {
+    public static Boolean installApk(Context mContext, String apkFilePath, InstallListener listener) {
         File apkFile = new File(apkFilePath);
         if (!apkFile.exists()) {
             return null;
@@ -34,7 +34,7 @@ public class APKAutoUpdate {
             String packageName = packageInfo.packageName;
             int versionCode = packageInfo.versionCode;
             String versionName = packageInfo.versionName;
-            Log.d(TAG, "packageName=" + packageName + ", versionCode=" + versionCode + ", versionName=" + versionName);
+            Log.i(TAG, "packageName=" + packageName + ", versionCode=" + versionCode + ", versionName=" + versionName);
         }
 
         PackageInstaller packageInstaller = mContext.getPackageManager().getPackageInstaller();
@@ -50,10 +50,10 @@ public class APKAutoUpdate {
             e.printStackTrace();
         }
 
-        Log.d(TAG, "sessionId---->" + mSessionId);
+        Log.i(TAG, "sessionId---->" + mSessionId);
         if (mSessionId != -1) {
             boolean copySuccess = onTransformApkFile(mContext, apkFilePath, mSessionId, listener);
-            Log.d(TAG, "copySuccess---->" + copySuccess);
+            Log.i(TAG, "copySuccess---->" + copySuccess);
             if (copySuccess) {
                 execInstallAPP(mContext, mSessionId, listener);
             }
@@ -69,7 +69,7 @@ public class APKAutoUpdate {
      * @param apkFilePath
      * @return
      */
-    private static boolean onTransformApkFile(Context mContext, String apkFilePath, int mSessionId, OnInstallListener listener) {
+    private static boolean onTransformApkFile(Context mContext, String apkFilePath, int mSessionId, InstallListener listener) {
         InputStream in = null;
         OutputStream out = null;
         PackageInstaller.Session session = null;
@@ -86,7 +86,7 @@ public class APKAutoUpdate {
                 out.write(buffer, 0, c);
             }
             session.fsync(out);
-            Log.d(TAG, "streamed " + total + " bytes");
+            Log.i(TAG, "streamed " + total + " bytes");
             success = true;
         } catch (IOException e) {
             e.printStackTrace();
@@ -113,7 +113,7 @@ public class APKAutoUpdate {
      * 执行安装并通知安装结果
      *
      */
-    private static void execInstallAPP(Context mContext, int mSessionId, OnInstallListener listener) {
+    private static void execInstallAPP(Context mContext, int mSessionId, InstallListener listener) {
         PackageInstaller.Session session = null;
         try {
             session = mContext.getPackageManager().getPackageInstaller().openSession(mSessionId);

+ 2 - 2
app/src/main/java/com/emato/ich/update/APKUpdateDownload.java

@@ -3,7 +3,7 @@ package com.emato.ich.update;
 
 import android.app.Activity;
 import android.content.Context;
-import android.util.Log;
+import com.emato.ich.utils.Log;
 
 import com.emato.ich.api.ICSPClient;
 import com.emato.ich.utils.BaseUtils;
@@ -46,7 +46,7 @@ public class APKUpdateDownload {
                 // 文件路径
                 String absolutePath = file.getAbsolutePath();
                 // 需要自动安装并重启
-                APKAutoUpdate.installApk(context, absolutePath, new OnInstallListener() {
+                APKAutoUpdate.installApk(context, absolutePath, new InstallListener() {
                     @Override
                     public void onInstallException(Exception e) {
                         Log.e(TAG, "onInstallException: 安装出现异常! " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()), e);

+ 2 - 1
app/src/main/java/com/emato/ich/update/CustomUpdateConfigProvider.java

@@ -1,7 +1,7 @@
 package com.emato.ich.update;
 
 import android.content.Context;
-import android.util.Log;
+import com.emato.ich.utils.Log;
 
 import androidx.annotation.NonNull;
 
@@ -27,6 +27,7 @@ public class CustomUpdateConfigProvider implements IUpdateConfigProvider {
                 .setIsAutoMode(true)                                                  // 设置自动更新
                 .setParam("versionCode", UpdateUtils.getVersionCode(context))         // 设置默认公共请求参数
                 .setParam("appKey", context.getPackageName())
+                .setOnInstallListener(new PackageManagerCompat())                     // 自定义的下载器
                 .setOnUpdateFailureListener(error -> {
                     Log.i(TAG, "onCreate: =====================>自动更新失败! " + error.getCode() + ", " + error.getDetailMsg());
                 })

+ 1 - 1
app/src/main/java/com/emato/ich/update/OnInstallListener.java → app/src/main/java/com/emato/ich/update/InstallListener.java

@@ -1,6 +1,6 @@
 package com.emato.ich.update;
 
-public interface OnInstallListener {
+public interface InstallListener {
 
     /**
      * 安装异常回调

+ 2 - 2
app/src/main/java/com/emato/ich/update/InstallResultReceiver.java

@@ -7,14 +7,14 @@ import android.content.Context;
 import android.content.Intent;
 import android.content.pm.PackageInstaller;
 import android.os.Build;
-import android.util.Log;
+import com.emato.ich.utils.Log;
 
 public class InstallResultReceiver extends BroadcastReceiver {
 
     private static final String TAG = InstallResultReceiver.class.getName();
     @Override
     public void onReceive(Context context, Intent intent) {
-        Log.d(TAG, "onReceive: "+intent.getIntExtra(PackageInstaller.EXTRA_STATUS,PackageInstaller.STATUS_FAILURE));
+        Log.i(TAG, "onReceive: "+intent.getIntExtra(PackageInstaller.EXTRA_STATUS,PackageInstaller.STATUS_FAILURE));
 
         Intent intent1 = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName());
         PendingIntent restartIntent = PendingIntent.getActivity(context, 0, intent1, PendingIntent.FLAG_ONE_SHOT);

+ 38 - 7
app/src/main/java/com/emato/ich/update/PackageManagerCompat.java

@@ -9,12 +9,18 @@ import android.content.pm.PackageInstaller;
 import android.content.pm.PackageManager;
 import android.net.Uri;
 import android.os.Build;
-import android.util.Log;
+import com.emato.ich.utils.Log;
 
+import androidx.annotation.NonNull;
 import androidx.annotation.RequiresApi;
 
 import com.emato.ich.MainActivity;
 import com.emato.ich.utils.LoggingUtils;
+import com.emato.ich.utils.StringUtils;
+import com.xuexiang.xupdate.entity.DownloadEntity;
+import com.xuexiang.xupdate.listener.OnInstallListener;
+
+import org.jetbrains.annotations.NotNull;
 
 import java.io.BufferedReader;
 import java.io.Closeable;
@@ -28,8 +34,9 @@ import java.io.OutputStream;
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.Date;
+import java.util.concurrent.atomic.AtomicBoolean;
 
-public class PackageManagerCompat {
+public class PackageManagerCompat implements OnInstallListener {
 
     private static final String TAG = PackageManagerCompat.class.getName();
 
@@ -57,7 +64,7 @@ public class PackageManagerCompat {
     }*/
 
     @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
-    public static void install(Context context, String apkFilePath, PackageManager packageManager, OnInstallListener listener) {
+    public static void install(Context context, String apkFilePath, PackageManager packageManager, InstallListener listener) {
         try {
             Log.i(TAG, "install: 应用程序开始安装! " + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
             File apkFile = new File(apkFilePath);
@@ -95,7 +102,7 @@ public class PackageManagerCompat {
 
     @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
     private static boolean copyInstallFile(PackageInstaller packageInstaller,
-                                           int sessionId, String apkFilePath, OnInstallListener listener) {
+                                           int sessionId, String apkFilePath, InstallListener listener) {
         InputStream in = null;
         OutputStream out = null;
         PackageInstaller.Session session = null;
@@ -124,7 +131,7 @@ public class PackageManagerCompat {
     }
 
     @RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
-    private static void execInstallCommand(Context context, PackageInstaller packageInstaller, int sessionId, OnInstallListener listener) {
+    private static void execInstallCommand(Context context, PackageInstaller packageInstaller, int sessionId, InstallListener listener) {
         PackageInstaller.Session session = null;
         try {
             session = packageInstaller.openSession(sessionId);
@@ -138,7 +145,7 @@ public class PackageManagerCompat {
             closeQuietly(session, listener);
         }
     }
-    private static void closeQuietly(Closeable c, OnInstallListener listener) {
+    private static void closeQuietly(Closeable c, InstallListener listener) {
         if (c != null) {
             try {
                 c.close();
@@ -155,7 +162,7 @@ public class PackageManagerCompat {
         Log.i(TAG, "restartApp: 应用程序重启中! 日期=====>" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
         try {
             Intent intent = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName());
-            if (intent.getAction().equals("android.intent.action.PACKAGE_REPLACED")) {
+            if (intent != null && !StringUtils.isNullOrEmpty(intent.getAction()) && intent.getAction().equals("android.intent.action.PACKAGE_REPLACED")) {
                 Intent intent1 = new Intent(context, MainActivity.class);
                 intent1.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                 context.startActivity(intent1);
@@ -177,4 +184,28 @@ public class PackageManagerCompat {
 //        }
         Log.i(TAG, "restartApp: 应用程序重启完成! 日期=====>" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()));
     }
+
+    @Override
+    public boolean onInstallApk(@NonNull @NotNull Context context, @NonNull @NotNull File apkFile, @NonNull @NotNull DownloadEntity downloadEntity) {
+        AtomicBoolean flag = new AtomicBoolean(true);
+        install(context, apkFile.getAbsolutePath(), context.getPackageManager(), new InstallListener(){
+
+            @Override
+            public void onInstallException(Exception e) {
+                Log.e(TAG, "onInstallException: 安装失败! ", e);
+                flag.set(false);
+            }
+
+            @Override
+            public void onInstallSuccess() {
+                restartApp(context);
+            }
+        });
+        return flag.get();
+    }
+
+    @Override
+    public void onInstallApkSuccess() {
+        Log.i(TAG, "onInstallApkSuccess: 安装成功! ");
+    }
 }

+ 1 - 1
app/src/main/java/com/emato/ich/update/UpdateService.java

@@ -1,6 +1,6 @@
 package com.emato.ich.update;
 
-import android.util.Log;
+import com.emato.ich.utils.Log;
 
 import androidx.annotation.NonNull;
 

+ 1 - 1
app/src/main/java/com/emato/ich/utils/BaseUtils.java

@@ -13,7 +13,7 @@ import android.telephony.SubscriptionManager;
 import android.telephony.TelephonyManager;
 import android.text.InputType;
 import android.text.TextUtils;
-import android.util.Log;
+import com.emato.ich.utils.Log;
 import android.view.View;
 import android.view.inputmethod.InputMethodManager;
 import android.widget.EditText;

+ 16 - 0
app/src/main/java/com/emato/ich/utils/DateUtils.java

@@ -0,0 +1,16 @@
+package com.emato.ich.utils;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+public class DateUtils {
+
+    private static final DateFormat df = SimpleDateFormat.getDateTimeInstance();
+
+    public static String formatDate(Date date) {
+
+        return df.format(date);
+    }
+
+}

+ 1 - 1
app/src/main/java/com/emato/ich/utils/FileUtils.java

@@ -2,7 +2,7 @@ package com.emato.ich.utils;
 
 
 import android.content.Context;
-import android.util.Log;
+import com.emato.ich.utils.Log;
 
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;

+ 1 - 1
app/src/main/java/com/emato/ich/utils/JacksonUtils.java

@@ -1,6 +1,6 @@
 package com.emato.ich.utils;
 
-import android.util.Log;
+import com.emato.ich.utils.Log;
 
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;

+ 46 - 0
app/src/main/java/com/emato/ich/utils/Log.java

@@ -0,0 +1,46 @@
+package com.emato.ich.utils;
+
+import java.util.Date;
+
+public class Log {
+
+    public static void i (String tag, String msg) {
+        android.util.Log.i(tag, addDateTime(msg));
+    }
+
+    public static void i (String tag, String msg, Throwable ex) {
+        android.util.Log.i(tag, addDateTime(msg), ex);
+    }
+
+    public static void w (String tag, String msg) {
+        android.util.Log.w(tag, addDateTime(msg));
+    }
+
+    public static void w (String tag, String msg, Throwable ex) {
+        android.util.Log.w(tag, addDateTime(msg), ex);
+    }
+
+    public static void w (String tag, Throwable ex) {
+        android.util.Log.w(tag, ex);
+    }
+
+    public static void e (String tag, String msg, Throwable ex) {
+        android.util.Log.w(tag, addDateTime(msg), ex);
+    }
+
+    public static void d (String tag, String msg) {
+        android.util.Log.d(tag, addDateTime(msg));
+    }
+
+    public static void d (String tag, String msg, Throwable ex) {
+        android.util.Log.d(tag, addDateTime(msg), ex);
+    }
+
+    public static void e (String tag, String msg) {
+        android.util.Log.w(tag, addDateTime(msg));
+    }
+
+    private static String addDateTime(String msg){
+        return DateUtils.formatDate(new Date()) + " ===> " + msg;
+    }
+}

+ 1 - 1
app/src/main/java/com/emato/ich/utils/ResourceUtils.java

@@ -1,7 +1,7 @@
 package com.emato.ich.utils;
 
 import android.content.res.AssetManager;
-import android.util.Log;
+import com.emato.ich.utils.Log;
 
 import java.io.File;
 import java.io.FileInputStream;

+ 7 - 7
app/src/main/res/layout/fragment_send_info_confirm.xml

@@ -38,7 +38,7 @@
         android:layout_y="386dp"
         android:gravity="center"
         android:text="@string/open_cabinet_hint"
-        android:textSize="15dp" />
+        android:textSize="12dp" />
 
     <TextView
         android:id="@+id/take_no_hint"
@@ -48,27 +48,27 @@
         android:layout_y="436dp"
         android:gravity="center"
         android:text="@string/take_no_hint"
-        android:textSize="15dp" />
+        android:textSize="12dp" />
 
     <TextView
         android:id="@+id/take_no"
         android:layout_width="100dp"
         android:layout_height="40dp"
-        android:layout_x="181dp"
+        android:layout_x="161dp"
         android:layout_y="436dp"
         android:gravity="center"
         android:text="@string/take_no"
-        android:textSize="15dp" />
+        android:textSize="10dp" />
 
     <TextView
         android:id="@+id/take_number"
         android:layout_width="100dp"
         android:layout_height="40dp"
-        android:layout_x="181dp"
+        android:layout_x="151dp"
         android:layout_y="476dp"
         android:gravity="center"
         android:text="@string/take_number"
-        android:textSize="15dp" />
+        android:textSize="10dp" />
 
     <TextView
         android:id="@+id/open_cabinet_no"
@@ -109,7 +109,7 @@
         android:layout_y="476dp"
         android:gravity="center"
         android:text="@string/take_number_hint"
-        android:textSize="15dp" />
+        android:textSize="12dp" />
 
     <Button
         android:id="@+id/exception_btn"

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

@@ -10,14 +10,14 @@
     <color name="white">#FFFFFFFF</color>
     <!--  键盘按钮  -->
     <!--    <color name="send_btn">#75FF90</color>-->
-    <color name="send_btn">#9bdf46</color>
+    <color name="send_btn">#446878</color>
     <color name="take_btn">#EBBA3A</color>
     <color name="main_label_bg">#4E4C4D</color>
     <!--  选择柜子类型背景颜色  -->
     <color name="choose_cabinet_view">#9DDA99</color>
     <!--  确认键  -->
 <!--    <color name="input_confirm">#20E45E</color>-->
-    <color name="input_confirm">#e9f679</color>
+    <color name="input_confirm">#13445a</color>
     <!--  主页按钮以及大按钮  -->
     <color name="confirm_btn">#25a55f</color>
     <!--  返回按钮  -->