zhongzhao пре 1 година
комит
9568af6c8b
100 измењених фајлова са 6337 додато и 0 уклоњено
  1. 17 0
      .gitignore
  2. 1 0
      app/.gitignore
  3. 129 0
      app/build.gradle
  4. BIN
      app/greatscan.jks
  5. BIN
      app/libs/eventbus-2.4.0.jar
  6. BIN
      app/libs/xUtils-2.6.14.jar
  7. 21 0
      app/proguard-rules.pro
  8. 26 0
      app/src/androidTest/java/com/hw/nativeapp/ExampleInstrumentedTest.java
  9. 129 0
      app/src/main/AndroidManifest.xml
  10. 45 0
      app/src/main/aidl/com/sunmi/extprinterservice/ExtPrinterService.aidl
  11. 8 0
      app/src/main/aidl/com/sunmi/idcardservice/CardCallback.aidl
  12. 3 0
      app/src/main/aidl/com/sunmi/idcardservice/IDCardInfo.aidl
  13. 16 0
      app/src/main/aidl/com/sunmi/idcardservice/IDCardServiceAidl.aidl
  14. 248 0
      app/src/main/aidl/com/sunmi/idcardservice/MiFareCardAidl.aidl
  15. 166 0
      app/src/main/java/com/hw/nativeapp/MApplication.java
  16. 15 0
      app/src/main/java/com/hw/nativeapp/annotation/TreeNodeChecked.java
  17. 15 0
      app/src/main/java/com/hw/nativeapp/annotation/TreeNodeDefault.java
  18. 15 0
      app/src/main/java/com/hw/nativeapp/annotation/TreeNodeDesc.java
  19. 15 0
      app/src/main/java/com/hw/nativeapp/annotation/TreeNodeId.java
  20. 15 0
      app/src/main/java/com/hw/nativeapp/annotation/TreeNodeName.java
  21. 15 0
      app/src/main/java/com/hw/nativeapp/annotation/TreeNodePid.java
  22. 34 0
      app/src/main/java/com/hw/nativeapp/config/Contents.java
  23. 46 0
      app/src/main/java/com/hw/nativeapp/config/enums/AllotStatusEnum.java
  24. 39 0
      app/src/main/java/com/hw/nativeapp/config/enums/LoginEnum.java
  25. 42 0
      app/src/main/java/com/hw/nativeapp/config/enums/LogisPayTypeEnum.java
  26. 43 0
      app/src/main/java/com/hw/nativeapp/config/enums/NoticeCenterEnum.java
  27. 42 0
      app/src/main/java/com/hw/nativeapp/config/enums/PutStatusTypeEnum.java
  28. 42 0
      app/src/main/java/com/hw/nativeapp/config/enums/PutTypeEnum.java
  29. 41 0
      app/src/main/java/com/hw/nativeapp/config/enums/StockOutTypeEnum.java
  30. 46 0
      app/src/main/java/com/hw/nativeapp/config/enums/StockStatusEnum.java
  31. 166 0
      app/src/main/java/com/hw/nativeapp/config/exceptions/CrashHandler.java
  32. 121 0
      app/src/main/java/com/hw/nativeapp/httpnet/ApiService.java
  33. 121 0
      app/src/main/java/com/hw/nativeapp/httpnet/ErrorConsumer.java
  34. 49 0
      app/src/main/java/com/hw/nativeapp/httpnet/FileApiService.java
  35. 152 0
      app/src/main/java/com/hw/nativeapp/httpnet/OkHttpInterceptor.java
  36. 97 0
      app/src/main/java/com/hw/nativeapp/httpnet/ResponseConsumer.java
  37. 130 0
      app/src/main/java/com/hw/nativeapp/httpnet/RetrofitFileManager.java
  38. 132 0
      app/src/main/java/com/hw/nativeapp/httpnet/RetrofitManager.java
  39. 7 0
      app/src/main/java/com/hw/nativeapp/httpnet/entity/BottleCode.java
  40. 4 0
      app/src/main/java/com/hw/nativeapp/httpnet/entity/EmptyBean.java
  41. 90 0
      app/src/main/java/com/hw/nativeapp/httpnet/entity/FileBean.java
  42. 33 0
      app/src/main/java/com/hw/nativeapp/httpnet/entity/GenCodeBean.java
  43. 8 0
      app/src/main/java/com/hw/nativeapp/httpnet/entity/IndexStatisticsBean.java
  44. 28 0
      app/src/main/java/com/hw/nativeapp/httpnet/entity/InventoryBean.java
  45. 86 0
      app/src/main/java/com/hw/nativeapp/httpnet/entity/LoginBean.java
  46. 18 0
      app/src/main/java/com/hw/nativeapp/httpnet/entity/LoginRequestBean.java
  47. 17 0
      app/src/main/java/com/hw/nativeapp/httpnet/entity/MessageBean.java
  48. 26 0
      app/src/main/java/com/hw/nativeapp/httpnet/entity/NodeData.java
  49. 10 0
      app/src/main/java/com/hw/nativeapp/httpnet/entity/PageAsk.java
  50. 28 0
      app/src/main/java/com/hw/nativeapp/httpnet/entity/PurchaseReceiptBean.java
  51. 7 0
      app/src/main/java/com/hw/nativeapp/httpnet/entity/PushRecordBean.java
  52. 8 0
      app/src/main/java/com/hw/nativeapp/httpnet/entity/RelatiInfoBean.java
  53. 151 0
      app/src/main/java/com/hw/nativeapp/httpnet/entity/ResponseData.java
  54. 27 0
      app/src/main/java/com/hw/nativeapp/httpnet/entity/StockDetailBean.java
  55. 14 0
      app/src/main/java/com/hw/nativeapp/httpnet/entity/StockLocaionBean.java
  56. 17 0
      app/src/main/java/com/hw/nativeapp/httpnet/entity/StockOrderDetailBean.java
  57. 60 0
      app/src/main/java/com/hw/nativeapp/httpnet/entity/StockOutBean.java
  58. 12 0
      app/src/main/java/com/hw/nativeapp/httpnet/entity/UpdateVerAskBean.java
  59. 25 0
      app/src/main/java/com/hw/nativeapp/httpnet/entity/UpdateVerReqBean.java
  60. 25 0
      app/src/main/java/com/hw/nativeapp/httpnet/entity/WarehousingDetailsBean.java
  61. 14 0
      app/src/main/java/com/hw/nativeapp/httpnet/entity/allocationBean.java
  62. 23 0
      app/src/main/java/com/hw/nativeapp/httpnet/entity/handleBean.java
  63. 72 0
      app/src/main/java/com/hw/nativeapp/httpnet/okhttp/OKHttpCallBack.java
  64. 163 0
      app/src/main/java/com/hw/nativeapp/httpnet/okhttp/OKHttpManager.java
  65. 196 0
      app/src/main/java/com/hw/nativeapp/httpnet/okhttp/OKHttpUtils.java
  66. 32 0
      app/src/main/java/com/hw/nativeapp/httpnet/okhttp/RequestParam.java
  67. 136 0
      app/src/main/java/com/hw/nativeapp/httpnet/upgrade/UpgradeHandler.java
  68. 50 0
      app/src/main/java/com/hw/nativeapp/ui/activity/BaseActivity.java
  69. 181 0
      app/src/main/java/com/hw/nativeapp/ui/activity/InfoQueryActivity.java
  70. 180 0
      app/src/main/java/com/hw/nativeapp/ui/activity/LoginActivity.java
  71. 68 0
      app/src/main/java/com/hw/nativeapp/ui/activity/MainActivity.java
  72. 323 0
      app/src/main/java/com/hw/nativeapp/ui/activity/PurchaseInfoActivity.java
  73. 66 0
      app/src/main/java/com/hw/nativeapp/ui/activity/ScanQRCodeActivity.java
  74. 76 0
      app/src/main/java/com/hw/nativeapp/ui/activity/SplashActivity.java
  75. 61 0
      app/src/main/java/com/hw/nativeapp/ui/activity/WriteOffFailActivity.java
  76. 49 0
      app/src/main/java/com/hw/nativeapp/ui/activity/WriteOffSuccessActivity.java
  77. 82 0
      app/src/main/java/com/hw/nativeapp/ui/activity/adapters/AftermarketHandleAdapter.java
  78. 80 0
      app/src/main/java/com/hw/nativeapp/ui/activity/adapters/AftermarketOneAdapter.java
  79. 90 0
      app/src/main/java/com/hw/nativeapp/ui/activity/adapters/PurchaseInfoAdapter.java
  80. 79 0
      app/src/main/java/com/hw/nativeapp/ui/activity/adapters/TakeUserInfoAdapter.java
  81. 99 0
      app/src/main/java/com/hw/nativeapp/ui/activity/adapters/TicketCollectionAdapter.java
  82. 85 0
      app/src/main/java/com/hw/nativeapp/ui/activity/adapters/TicketPurchaseAdapter.java
  83. 29 0
      app/src/main/java/com/hw/nativeapp/ui/activity/holders/AftermarketHandleHolder.java
  84. 30 0
      app/src/main/java/com/hw/nativeapp/ui/activity/holders/AftermarketOneHolder.java
  85. 34 0
      app/src/main/java/com/hw/nativeapp/ui/activity/holders/PurchaseInfoHolder.java
  86. 28 0
      app/src/main/java/com/hw/nativeapp/ui/activity/holders/TakeUserInfoHolder.java
  87. 36 0
      app/src/main/java/com/hw/nativeapp/ui/activity/holders/TicketCollectionHolder.java
  88. 25 0
      app/src/main/java/com/hw/nativeapp/ui/activity/holders/TicketPurchaseHolder.java
  89. 102 0
      app/src/main/java/com/hw/nativeapp/ui/dialogs/DialogCommon.java
  90. 146 0
      app/src/main/java/com/hw/nativeapp/ui/dialogs/DialogDropDown.java
  91. 110 0
      app/src/main/java/com/hw/nativeapp/ui/dialogs/DialogInputDevice.java
  92. 122 0
      app/src/main/java/com/hw/nativeapp/ui/dialogs/DialogModifyText.java
  93. 94 0
      app/src/main/java/com/hw/nativeapp/ui/dialogs/Dialog_Update.java
  94. 108 0
      app/src/main/java/com/hw/nativeapp/ui/dialogs/Dialog_UpdateProgress.java
  95. 85 0
      app/src/main/java/com/hw/nativeapp/ui/dialogs/ImageEnlargeDialog.java
  96. 84 0
      app/src/main/java/com/hw/nativeapp/ui/dialogs/ImageSeeDialog.java
  97. 102 0
      app/src/main/java/com/hw/nativeapp/ui/dialogs/LoadingDialog.java
  98. 28 0
      app/src/main/java/com/hw/nativeapp/ui/dialogs/LoadingDialoges.java
  99. 26 0
      app/src/main/java/com/hw/nativeapp/ui/receiver/BootBroadcastReceiver.java
  100. 0 0
      app/src/main/java/com/hw/nativeapp/ui/widgets/CircleImageTransformer.java

+ 17 - 0
.gitignore

@@ -0,0 +1,17 @@
+*.iml
+.gradle
+.idea
+/local.properties
+/.idea/caches
+/.idea/libraries
+/.idea/modules.xml
+/.idea/workspace.xml
+/.idea/navEditor.xml
+/.idea/assetWizardSettings.xml
+.DS_Store
+/build
+/captures
+.externalNativeBuild
+.cxx
+local.properties
+app/build

+ 1 - 0
app/.gitignore

@@ -0,0 +1 @@
+/build

+ 129 - 0
app/build.gradle

@@ -0,0 +1,129 @@
+import java.text.SimpleDateFormat
+
+plugins {
+    id 'com.android.application'
+}
+
+android {
+    compileSdkVersion rootProject.ext.android.compileSdkVersion
+
+    defaultConfig {
+        applicationId rootProject.ext.version.applicationId
+        minSdkVersion rootProject.ext.android.minSdkVersion
+        targetSdkVersion rootProject.ext.android.targetSdkVersion
+        versionCode rootProject.ext.version.versionCode
+        versionName rootProject.ext.version.versionName
+
+        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
+
+    }
+    signingConfigs {
+        release {
+            storeFile file('greatscan.jks')
+            keyAlias 'greatscan'
+            keyPassword 'greatscan123456'
+            storePassword 'greatscan123456'
+        }
+    }
+
+    buildTypes {
+        release {
+            minifyEnabled false
+            zipAlignEnabled false
+            signingConfig signingConfigs.release
+            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+            buildConfigField "String", "API_HOST", rootProject.ext.release.apiHost
+            buildConfigField "String", "API_PATH", rootProject.ext.release.apiName
+            buildConfigField "String", "FILEAPI_HOST", rootProject.ext.release.fileApiHost
+            buildConfigField "String", "FILEAPI_PATH", rootProject.ext.release.fileApiName
+        }
+        debug {
+//            debuggable true // 是否调试
+            minifyEnabled false
+            zipAlignEnabled false
+            signingConfig signingConfigs.release
+            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+            buildConfigField "String", "API_HOST", rootProject.ext.debug.apiHost
+            buildConfigField "String", "API_PATH", rootProject.ext.debug.apiName
+            buildConfigField "String", "FILEAPI_HOST", rootProject.ext.debug.fileApiHost
+            buildConfigField "String", "FILEAPI_PATH", rootProject.ext.debug.fileApiName
+        }
+    }
+
+
+    sourceSets {
+        main {
+            jniLibs.srcDirs = ['libs']
+            aidl.srcDirs = ['src/main/aidl']
+        }
+    }
+    compileOptions {
+        sourceCompatibility JavaVersion.VERSION_1_8
+        targetCompatibility JavaVersion.VERSION_1_8
+    }
+    lint {
+        abortOnError false
+        checkReleaseBuilds false
+    }
+    namespace 'com.hw.nativeapp'
+
+    android.applicationVariants.all {
+        variant ->
+            variant.outputs.all {
+                //在这里修改apk文件名
+                def df = new SimpleDateFormat('yyyyMMdd')
+                outputFileName = "PDA_${variant.name}_${df.format(new Date())}_${variant.versionName}_${variant.versionCode}.apk"
+            }
+    }
+}
+
+dependencies {
+    implementation fileTree(include: ['*.aar','*.jar'], dir: 'libs')
+//    implementation fileTree(dir: 'libs', include: ['*.aar', '*.jar'], exclude: [])
+    implementation 'androidx.appcompat:appcompat:1.2.0'
+    implementation 'androidx.multidex:multidex:2.0.0'
+    implementation 'com.google.android.material:material:1.1.0'
+    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
+    implementation 'androidx.navigation:navigation-fragment:2.2.2'
+    implementation 'androidx.navigation:navigation-ui:2.2.2'
+    implementation 'androidx.viewpager:viewpager:1.0.0'
+    testImplementation 'junit:junit:4.+'
+    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
+    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
+
+    implementation 'com.xw.repo:xedittext:2.1.0@aar'
+
+    api 'com.jakewharton:butterknife:10.2.3'
+    annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3'
+    implementation 'com.squareup.retrofit2:converter-scalars:2.2.0'
+    implementation 'com.squareup.retrofit2:converter-gson:2.2.0'
+    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.2.0'
+    implementation 'de.hdodenhof:circleimageview:2.2.0'
+    implementation 'androidx.cardview:cardview:1.0.0'
+    implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.34'
+    implementation 'com.jakewharton:butterknife:10.2.3'
+    implementation 'com.blankj:utilcode:1.30.5'
+    api 'io.reactivex.rxjava2:rxjava:2.0.6'
+    api 'io.reactivex.rxjava2:rxandroid:2.0.1'
+    implementation 'com.squareup.okhttp3:okhttp:3.8.1'
+
+    implementation 'com.hjq:titlebar:5.0'
+//    implementation 'org.xutils:xutils:3.4.0'
+
+    implementation 'com.alibaba:fastjson:1.2.8'
+    implementation 'com.google.zxing:core:3.4.1'
+    implementation('com.journeyapps:zxing-android-embedded:3.6.0') { transitive = false }
+
+//文件下载--升级
+    implementation 'com.liulishuo.filedownloader:library:1.7.4'
+//    图片加载
+    implementation 'com.squareup.picasso:picasso:2.5.2'
+
+    implementation 'androidx.appcompat:appcompat:1.2.0'
+    implementation 'com.google.android.material:material:1.2.1'
+    implementation 'androidx.recyclerview:recyclerview:1.1.0'
+    implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0'
+    implementation 'com.scwang.smartrefresh:SmartRefreshHeader:1.1.0'
+}
+
+// SH1: 84:DD:2A:D6:4A:63:12:6B:06:9F:24:38:1F:57:32:8F:4D:5F:EE:78

BIN
app/greatscan.jks


BIN
app/libs/eventbus-2.4.0.jar


BIN
app/libs/xUtils-2.6.14.jar


+ 21 - 0
app/proguard-rules.pro

@@ -0,0 +1,21 @@
+# Add project specific ProGuard rules here.
+# You can control the set of applied configuration files using the
+# proguardFiles setting in build.gradle.
+#
+# For more details, see
+#   http://developer.android.com/guide/developing/tools/proguard.html
+
+# If your project uses WebView with JS, uncomment the following
+# and specify the fully qualified class name to the JavaScript interface
+# class:
+#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
+#   public *;
+#}
+
+# Uncomment this to preserve the line number information for
+# debugging stack traces.
+#-keepattributes SourceFile,LineNumberTable
+
+# If you keep the line number information, uncomment this to
+# hide the original source file name.
+#-renamesourcefileattribute SourceFile

+ 26 - 0
app/src/androidTest/java/com/hw/nativeapp/ExampleInstrumentedTest.java

@@ -0,0 +1,26 @@
+package com.hw.nativeapp;
+
+import android.content.Context;
+
+import androidx.test.platform.app.InstrumentationRegistry;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import static org.junit.Assert.*;
+
+/**
+ * Instrumented test, which will execute on an Android device.
+ *
+ * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
+ */
+@RunWith(AndroidJUnit4.class)
+public class ExampleInstrumentedTest {
+    @Test
+    public void useAppContext() {
+        // Context of the app under test.
+        Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
+        assertEquals("com.hw.parkingpda", appContext.getPackageName());
+    }
+}

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

@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools">
+
+    <!-- jpush start -->
+    <permission
+        android:name="${applicationId}.permission.JPUSH_MESSAGE"
+        android:protectionLevel="signature" />
+
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+    <uses-permission android:name="android.permission.DOWNLOAD_WITHOUT_NOTIFICATION" />
+    <!-- Required  一些系统要求的权限,如访问网络等 -->
+    <uses-permission android:name="${applicationId}.permission.JPUSH_MESSAGE" />
+    <!-- jpush end -->
+    <uses-permission android:name="android.permission.RECEIVE_USER_PRESENT" />
+    <uses-permission android:name="android.permission.INTERNET" />
+    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
+    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
+        tools:ignore="ScopedStorage" />
+    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
+    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
+    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
+    <uses-permission android:name="android.permission.CAMERA" />
+    <uses-permission android:name="android.hardware.camera" />
+    <uses-permission android:name="android.hardware.camera.autofocus" />
+    <uses-permission android:name="android.permission.WAKE_LOCK"/>
+    <uses-permission android:name="com.sunmi.idcard.permission.ACCESS_SERVICE" />
+    <uses-permission android:name="android.permission.VIBRATE"/>
+    <uses-permission android:name="android.permission.CALL_PHONE"/>
+    <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
+    <uses-permission android:name="getui.permission.GetuiService.com.hw.parkingpda"/>
+    <permission android:name="getui.permission.GetuiService.${applicationId}" android:protectionLevel="normal"/>
+
+    <!--定位 -->
+    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
+    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
+    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
+
+    <!-- 讯飞语音 -->
+    <uses-permission android:name="android.permission.RECORD_AUDIO"/>
+    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
+    <uses-permission android:name="android.permission.READ_CONTACTS"/>
+    <uses-permission android:name="android.permission.WRITE_SETTINGS"
+        tools:ignore="ProtectedPermissions" />
+    <!-- 开机启动 -->
+    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
+    <uses-permission android:name="android.permission.WAKE_LOCK" />
+    <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
+    <uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />
+
+    <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
+    <uses-permission android:name="action:com.sunmi.scanner.ACTION_BAR_DEVICES_SETTING"/>
+    <uses-permission android:name="android.permission.NFC" />
+
+    <application
+        android:allowBackup="true"
+        android:name="com.hw.nativeapp.MApplication"
+        android:icon="@mipmap/icon_wdzz"
+        android:label="@string/app_name"
+        android:roundIcon="@mipmap/icon_wdzz"
+        android:supportsRtl="true"
+        android:usesCleartextTraffic="true"
+        android:theme="@style/Theme.airport"
+        android:requestLegacyExternalStorage="true"
+        tools:targetApi="m">
+
+        <activity
+            android:name="com.hw.nativeapp.ui.activity.SplashActivity"
+            android:theme="@style/ThemeNoTitleBar">
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.nfc.action.NDEF_DISCOVERED" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+
+        <activity android:name="com.hw.nativeapp.ui.activity.LoginActivity"
+            android:configChanges="orientation|screenSize"
+            android:theme="@style/ThemeNoTitleBar"/>
+
+        <!--  首页  -->
+        <activity android:name="com.hw.nativeapp.ui.activity.MainActivity"
+            android:configChanges="orientation|screenSize"
+            android:theme="@style/ThemeNoTitleBar" />
+
+        <!--  票务查询页面  -->
+        <activity android:name="com.hw.nativeapp.ui.activity.InfoQueryActivity"
+            android:configChanges="orientation|screenSize"
+            android:theme="@style/ThemeNoTitleBar" />
+
+        <!--  查询结果页面  -->
+        <activity android:name="com.hw.nativeapp.ui.activity.PurchaseInfoActivity"
+            android:configChanges="orientation|screenSize"
+            android:theme="@style/ThemeNoTitleBar" />
+
+        <!--  核销成功页面  -->
+        <activity android:name="com.hw.nativeapp.ui.activity.WriteOffSuccessActivity"
+            android:configChanges="orientation|screenSize"
+            android:theme="@style/ThemeNoTitleBar" />
+
+        <!--  核销失败页面  -->
+        <activity android:name="com.hw.nativeapp.ui.activity.WriteOffFailActivity"
+            android:configChanges="orientation|screenSize"
+            android:theme="@style/ThemeNoTitleBar" />
+
+        <activity android:name="com.hw.nativeapp.ui.activity.ScanQRCodeActivity"
+            android:configChanges="orientation|screenSize"
+            android:theme="@style/ThemeNoTitleBar" />
+
+        <provider
+            android:name="androidx.core.content.FileProvider"
+            android:authorities="com.hw.airportwine.provider"
+            android:exported="false"
+            android:grantUriPermissions="true"
+            tools:replace="android:authorities,android:exported">
+            <meta-data
+                android:name="android.support.FILE_PROVIDER_PATHS"
+                android:resource="@xml/file_paths" />
+        </provider>
+
+        <activity android:name=".ui.activity.ScanQRCodeActivity"
+            android:screenOrientation="fullSensor"
+            tools:replace="screenOrientation"/>
+
+    </application>
+
+</manifest>

+ 45 - 0
app/src/main/aidl/com/sunmi/extprinterservice/ExtPrinterService.aidl

@@ -0,0 +1,45 @@
+// IPrinterService.aidl
+package com.sunmi.extprinterservice;
+
+// Declare any non-default types here with import statements
+
+interface ExtPrinterService {
+
+    int sendRawData(in byte[] cmd);
+
+	int printerInit();
+
+    int getPrinterStatus();
+
+	int lineWrap(in int n);
+
+	int pixelWrap(in int n);
+
+	int flush();
+
+    int tab();
+
+    int printText(in String text);
+
+    int printBarCode(in String code, in int type, in int width, in int height, in int hriPos);
+
+    int printQrCode(in String code, in int modeSize, in int errorlevel);
+
+    int printBitmap(in Bitmap bitmap, in int mode);
+
+    int setHorizontalTab(in int[] k);
+
+    int setAlignMode(in int type);
+
+    int cutPaper(in int m, in int n);
+
+    int setFontZoom(in int hori, in int veri);
+
+    int printColumnsText(in String[] colsTextArr, in int[] colsWidthArr, in int[] colsAlign);
+
+    void openDrawer();
+
+    void startTransBuffer();
+
+    boolean endTransBuffer();
+}

+ 8 - 0
app/src/main/aidl/com/sunmi/idcardservice/CardCallback.aidl

@@ -0,0 +1,8 @@
+package com.sunmi.idcardservice;
+
+import com.sunmi.idcardservice.IDCardInfo;
+
+interface CardCallback {
+
+    void getCardData(inout IDCardInfo info,int code);
+}

+ 3 - 0
app/src/main/aidl/com/sunmi/idcardservice/IDCardInfo.aidl

@@ -0,0 +1,3 @@
+package com.sunmi.idcardservice;
+
+parcelable IDCardInfo;

+ 16 - 0
app/src/main/aidl/com/sunmi/idcardservice/IDCardServiceAidl.aidl

@@ -0,0 +1,16 @@
+package com.sunmi.idcardservice;
+
+import com.sunmi.idcardservice.CardCallback;
+import com.sunmi.idcardservice.IDCardInfo;
+import com.sunmi.idcardservice.MiFareCardAidl;
+
+interface IDCardServiceAidl {
+
+     IDCardInfo readCard();
+
+     void readCardAuto(in CardCallback callback);
+
+     void cancelAutoReading();
+
+     MiFareCardAidl getMiFareCardService();
+}

+ 248 - 0
app/src/main/aidl/com/sunmi/idcardservice/MiFareCardAidl.aidl

@@ -0,0 +1,248 @@
+package com.sunmi.idcardservice;
+
+interface MiFareCardAidl {
+
+    /**
+     * 非接触 CPU 卡函数 --- 激活非接触式卡
+     *
+     * 函数功能:读写器在传递的时间内查寻卡是否进入感应区,并激活进入感应区的卡片。
+     *
+     * @param     cardtype 卡类型		0AH  A类卡; 0BH  B类卡; 00H 未获取到
+     * @param     snrlen 	字节   卡UID长度
+     * @param     snr 	4字节   卡UID
+     * @param     atrlen  1字节   ATR长度
+     * @param     atr  ATR应答数据
+     * @return    <>0 错误
+     *             =0 正确
+     * 举例:
+     * 		byte []cardtype=new byte[8];
+     * 		byte []snrlen = new byte[8];
+     * 		byte []snr =new byte[10];
+     * 		byte []cardinfo=new byte[200];
+     * 		byte []infolen =new byte[10];
+     * 		openCupCard(cardtype,snrlen,snr,infolen,cardinfo);
+     *
+     * 	注: 由于调用该函数时,不一定有卡在感应区,很有可能需要较长的时间才能等到卡进感应区,故设定较长的时间给读写器,
+     * 	完全由读写器在这段时间等待对卡激活,如果超时了便返回“激活失败”。此命令的delaytime参数就是为了传递上述时间参数给读写器。
+     * 	如果delaytime参数为0,在无卡进感应区时读写器不用等待直接返回“激活失败”;如果delaytime参数为0xffff时,一直寻卡,
+     * 	直到卡进入感应区;如果delaytime参数为其它值时,读写器可在delaytime时间内一直寻卡,直到超时了读	写器才返回“激活失败”,
+     * 	此时主机端也是采用delaytime作为超时退出时间。如果有卡在感应区但激活失败,	那么读写器不用继续寻卡就直接返回“激活失败”。
+     */
+    int openCupCard(out byte[] cardtype,out byte[] snrlen,out byte[] snr,out byte[] atrlen,out byte[] atr);
+    /**
+     * 非接触式卡片命令交互。
+     * @param      cmdlen      发送数据的字节长度
+     * @param      cmd         要发送的数据
+     * @param   resplen     返回的数据长度
+     * @param    resp         nRespLen,返回的指令应答信息
+     * @return    <>0 错误
+     *             =0 正确
+     * 举例:       int st;
+     * 		byte []send_hex={0x01,0x02,0x03,0x04};
+     * 		byte []resp_hex=new byte[512];
+     * 		int []resplen =new int[10];
+     * 		st=MainActivity.ExchangePro(send_hex,4,resp_hex,resplen);
+     */
+     int exchangePro(in byte[] cmd,in int cmdlen,out byte[] resp,out int[] resplen);
+    /**
+     * 设置非接触式卡片为halt状态mt8rfhalt
+     *
+     * 函数功能:设置非接触式卡片为halt状态。
+     *
+     * @param delaytime 等待卡进入感应区时间(单位:毫秒),高位字节在前
+     * 			0:无需等待,无卡直接返回
+     * 			0xffff:一直等待
+     * @return    <>0 错误
+     *             =0 正确
+     * 举例:
+     *  int delaytime = 0;
+     *  st = rfhalt();
+     *
+     * 注: 完成对卡的Halt操作或者Deselect操作后,要求用户将卡离开射频操作区域,否则将一直循环判断。如果delaytime参数为0时,
+     * 则不用等待,将直接返回halt操作结果;若delayTime为0xffff时,将无限等待, 直至卡离开感应区;若为其它值时,将在规定时间
+     * 判断卡是否还在感应区直至定时时间到或者卡离开感应区。
+     */
+    int rfhalt();
+    /**
+     * 获取非接触式CPU卡卡片状态(仅身份证非接模块支持,串口设备不支持)
+     *
+     * 函数功能: 获取非接触式CPU卡卡片状态
+     *
+     * @param cardState 非接触式CPU卡状态
+     *                  cardState[0] = 0 无卡
+     *                  cardState[0] = 1 一张卡
+     *                  cardState[0] = 2 多张卡
+     * @return    <>0 错误
+     *             =0 正确
+     *
+     * 举例:
+     *  byte Status[] = new byte[5];
+     * 	st = getCPUCardState(Status);
+     */
+    int getCPUCardState(out byte[] cardState);
+    /**
+     * 激活非接触式存储卡
+     *
+     * 函数功能:读写器在传递的时间内查寻卡是否进入感应区,并激活进入感应区的非接触式存储卡。
+     *
+     * @param cardtype [0]: 0AH  Type A 卡;  0BH  TypeB卡
+     * @param cardID		4字节	卡片UID
+     * @return   <>0 错误
+     *            =0 正确
+     *
+     * 举例:
+     *  byte[] snr=new byte[20];
+     * 	byte[] cardtype = new byte[8];
+     * 	st = rfCard(cardtype,snr);
+     *
+     * 注: 由于调用该函数时,不一定有卡在感应区,很有可能需要较长的时间才能等到卡进感应区,故设定较长的时间给读写器,
+     * 完全由读写器在这段时间等待对卡激活,如果超时了便返回“激活失败”。此函数的delaytime参数就是为了传递上述时间参数给
+     * 读写器。如果delaytime参数为0,在无卡进感应区时读写器不用等待直接返回“激活失败”;如果delaytime参数为0xffff时,
+     * 一直寻卡,直到卡进入感应区;如果delaytime参数为其它值时,读写器可在delaytime时间内一直寻卡,直到超时了读	写器
+     * 才返回“激活失败”,此时主机端也是采用delaytime作为超时退出时间。如果有卡在感应区但激活失败,	那么读写器不用继续寻
+     * 卡就直接返回“激活失败”。
+     */
+    int rfCard(out byte[] cardtype,out byte[] cardID);
+
+    /**
+     * 非接触式存储卡认证扇区
+     *
+     * 函数功能:对非接触式存储卡的某一个扇区进行认证。
+     *
+     * @param mode   认证模式 0 KEYA 模式 1 KEYB 模式
+     * @param nsecno 地址 (addr = 扇区号 * 4 + 块地址;)
+     * @param key    要传入的密码,6 字节。
+     * @return  <>0 错误
+     *           =0 正确
+     * 举例:
+     *  byte[] key = new byte[10];
+     * 	key[0] = (byte)0xFF;
+     * 	key[1] = (byte)0xFF;
+     * 	key[2] = (byte)0xFF;
+     * 	key[3] = (byte)0xFF;
+     * 	key[4] = (byte)0xFF;
+     * 	key[5] = (byte)0xFF;
+     *  st = rfAuthEntication(0,4,key);
+     */
+    int rfAuthEntication(in int mode,in int nsecno,in byte[] key);
+    /**
+     * 非接触式存储卡读数据
+     * 函数功能:获取非接触存储卡指定块地址的数据
+     *
+     * @param nblock 地址(addr = 扇区号 * 4 + 块地址;)
+     * @param readdata 读出数据
+     * @return  <>0 错误
+     *           =0 正确
+     * 举例:
+     * byte[] rdata=new byte[32];
+     * st = rfRead(4,rdata);
+     */
+    int rfRead(in int nblock,out byte[] readdata);
+    /**
+     * 获取非接触存储卡指定块地址的数据
+     *
+     * @param nblock 地址(addr = 扇区号 * 4 + 块地址;)
+     * @param writedata 写进的数据
+     * @return   <>0 错误
+     *            =0 正确
+     * 举例:
+     *  byte[] key = new byte[16];
+     *  Key[0] = 0x00 .........
+     *  st = rfWrite(4,wdata);
+     */
+    int rfWrite(in int nblock,in byte[] writedata);
+    /**
+     * 获取非接触存储卡指定块地址的数值
+     *
+     * @param nblock		地址(addr = 扇区号 * 4 + 块地址;)
+     * @param readvalue 	读出的值
+     * @return   <>0 错误
+     *            =0 正确
+     * 举例:
+     * int []Ivalue=new int[50];
+     * st = rfReadVal(4,Ivalue);
+     */
+    int rfReadVal(in int nblock,out int[] readvalue);
+    /**
+     * 非接触式存储卡写值块
+     *
+     * 函数功能:设置非接触存储卡指定块地址的数值
+     *
+     * @param nblock 地址(addr = 扇区号 * 4 + 块地址;)
+     * @param writevalue 传入的值
+     * @return    <>0 错误
+     *             =0 正确
+     *  举例:
+     *  st = rfInitVal(4,100);
+     */
+    int rfInitVal(in int nblock,in int writevalue);
+    /**
+     * 非接触式存储卡加值
+     * 函数功能:对非接触存储卡指定块地址的数据进行加值操作
+     *
+     * @param nblock 地址(addr = 扇区号 * 4 + 块地址;)
+     * @param incvalue 传入的值
+     * @return   <>0 错误
+     *            =0 正确
+     * 举例:
+     * 	st = rfIncrement(4,20);
+     */
+    int rfIncrement(in int nblock,in int incvalue);
+    /**
+     * 非接触式存储卡减值mt8rfdecrement
+     * 函数功能:对非接触存储卡指定块地址的数据进行减值操作
+     *
+     * @param nblock 地址(addr = 扇区号 * 4 + 块地址;)
+     * @param decvalue 传入的值
+     * @return   <>0 错误
+     *            =0 正确
+     * 举例:
+     *  st = rfDecrement(4,20);
+     */
+    int rfDecrement(in int nblock,in int decvalue);
+    /**
+     * 读取金融IC卡卡号跟姓名 readNAN
+     * 函数功能:读取金融IC卡卡号及姓名。
+     *
+     * @param nCardType	卡片类型  	0表示接触式CPU卡、0x01表示非接触式CPU卡,其他的不认可。(目前仅支持非接IC卡)
+     * @param Cardno	金融IC卡卡号
+     * @param CardName	金融IC卡姓名
+     * @param lpErrMsg	错误信息
+     * @return    	<> 0 错误
+     *            	== 0 正确
+     * 举例:
+     * byte []szCardNo=new byte[512];
+     * byte []szName=new byte[512];
+     * byte []szErrinfo=new byte[1024];
+     * int nCardType = 0x01;
+     * st = MT3Y.readNAN(nCardType, szCardNo, szName, szErrinfo);
+     */
+     int readNAN(in int nCardType,out byte[] Cardno,out byte[] CardName,out byte[] lpErrMsg);
+    /**
+     * 读社保卡信息(身份证非接模块不支持,仅串口设备支持)
+     * @param info 社保 卡信息,输出格式如:卡号|身份证号|姓名|性别|民族|出生日期
+     * @param Err  出错信息
+     * @return    <0 错误
+     *            =0 正确
+     *
+     */
+    int readSBInfo(out byte[] info,out byte[] err);
+    /**
+     * 读EMID卡号(身份证非接模块不支持,仅串口设备支持)
+     *
+     * @param datalen  EMID卡号长度
+     * @param data EMID卡号
+     * @return	<0 错误
+     *          =0 正确
+     */
+     int getEMID(out byte[] datalen,out byte[] data);
+
+    /**
+      * 函数功能:控制读写器蜂鸣器
+      * 入口参数:
+      * delaytime,鸣叫持续时间(单位:100ms)
+      * 返回值:    <>0 错误
+      * =0 正确
+      */
+     int beep(in int delaytime);
+}

+ 166 - 0
app/src/main/java/com/hw/nativeapp/MApplication.java

@@ -0,0 +1,166 @@
+package com.hw.nativeapp;
+
+import android.app.Application;
+import android.content.Context;
+import android.content.res.Configuration;
+import android.os.StrictMode;
+
+import com.blankj.utilcode.util.SPUtils;
+import com.blankj.utilcode.util.Utils;
+import com.hw.nativeapp.config.Contents;
+import com.hw.nativeapp.config.exceptions.CrashHandler;
+import com.hw.nativeapp.httpnet.ApiService;
+import com.hw.nativeapp.httpnet.ErrorConsumer;
+import com.hw.nativeapp.httpnet.FileApiService;
+import com.hw.nativeapp.httpnet.ResponseConsumer;
+import com.hw.nativeapp.httpnet.RetrofitFileManager;
+import com.hw.nativeapp.httpnet.RetrofitManager;
+import com.hw.nativeapp.ui.activity.LoginActivity;
+import com.hw.nativeapp.ui.dialogs.DialogCommon;
+import com.hw.nativeapp.utils.ActivityUtils;
+import com.hw.nativeapp.utils.LogUtils;
+import com.hw.nativeapp.utils.RxUtil;
+import com.hw.nativeapp.utils.ToastUtils;
+import com.liulishuo.filedownloader.FileDownloader;
+
+
+/**
+ * Class Describe:APP 应用
+ * Create Time:2016/10/13 11:30
+ * Update Person:
+ * Update Time:
+ * Update Remark:
+ */
+public class MApplication extends Application {
+    private static MApplication instance;
+//    private static String defaultDeviceId;
+    private static volatile ApiService mApiService;
+    private static volatile FileApiService mFileApiService;
+
+    /**
+     * 线程池
+     */
+
+    public MApplication() {
+        super();
+        instance = this;
+
+    }
+
+    public static synchronized MApplication context() {
+        return (MApplication) getAppContext().getApplicationContext();
+    }
+
+
+    public static MApplication getInstance() {
+        if (instance == null)
+            throw new IllegalStateException();
+        return instance;
+    }
+
+    public static Context getAppContext() {
+        if (instance == null)
+            throw new IllegalStateException();
+        return instance.getApplicationContext();
+    }
+
+
+    @Override
+    public void onCreate() {
+        super.onCreate();
+
+//        Log.i(Constants.TAG, "MApplication Start");
+        //讯飞语音初始化
+//        SpeechUtility.createUtility(this, SpeechConstant.APPID +"=d6905360");
+        RetrofitManager.init(this);
+        RetrofitManager.setBaseUrl(BuildConfig.API_HOST);
+        RetrofitFileManager.init(this);
+        LogUtils.init(this, true,false, 'd', "aleyds");
+
+        Utils.init(this);
+        FileDownloader.init(this);
+
+//        startService();
+//        startAlarm();
+
+        CrashHandler crashHandler = CrashHandler.getInstance();
+        crashHandler.init(this);
+
+
+        StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
+        StrictMode.setVmPolicy(builder.build());
+        builder.detectFileUriExposure();
+    }
+
+
+    /**
+     * 获取api接口实例
+     *
+     * @return ApiService
+     */
+    public static ApiService getApiService() {
+        if (mApiService == null) {
+            synchronized (MApplication.class) {
+                if (mApiService == null) {
+                    mApiService = RetrofitManager.create(ApiService.class);
+                }
+            }
+        }
+        return mApiService;
+    }
+
+
+    @Override
+    protected void attachBaseContext(Context base) {
+        super.attachBaseContext(base);
+    }
+
+
+
+    /**
+     * 在模拟环境中程序终止时会被调用
+     */
+    @Override
+    public void onTerminate() {
+        super.onTerminate();
+    }
+
+    @Override
+    public void onLowMemory() {
+        super.onLowMemory();
+    }
+
+    @Override
+    public void onTrimMemory(int level) {
+        super.onTrimMemory(level);
+    }
+
+    @Override
+    public void onConfigurationChanged(Configuration newConfig) {
+        super.onConfigurationChanged(newConfig);
+    }
+
+    /**
+     * 获取api接口实例
+     *
+     * @return ApiService
+     */
+    public static FileApiService getFileApiService() {
+        if (mFileApiService == null) {
+            synchronized (MApplication.class) {
+                if (mFileApiService == null) {
+                    mFileApiService = RetrofitFileManager.create(FileApiService.class);
+                }
+            }
+        }
+        return mFileApiService;
+    }
+
+    public static void loginout(boolean showdig, String msg, Context context ) {
+        SPUtils.getInstance().remove(Contents.SPU_TOKEN_KEY);
+//            SPUtils.getInstance().remove(Contents.SPU_USERLOGININFO_KEY);
+        ToastUtils.showLongToast(MApplication.getAppContext(), "退出登录");
+        ActivityUtils.launchRoot(MApplication.getAppContext(), LoginActivity.class);
+        ToastUtils.showLongToast(getAppContext(), msg);
+    }
+}

+ 15 - 0
app/src/main/java/com/hw/nativeapp/annotation/TreeNodeChecked.java

@@ -0,0 +1,15 @@
+package com.hw.nativeapp.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 自定义注解,node的父节点id
+ */
+
+@Target(ElementType.FIELD)              //定义该注解的目标对象,此处为类的字段
+@Retention(RetentionPolicy.RUNTIME)     //定义该注解的有效范围,此处为运行时
+public @interface TreeNodeChecked {
+}

+ 15 - 0
app/src/main/java/com/hw/nativeapp/annotation/TreeNodeDefault.java

@@ -0,0 +1,15 @@
+package com.hw.nativeapp.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 自定义注解,node的父节点id
+ */
+
+@Target(ElementType.FIELD)              //定义该注解的目标对象,此处为类的字段
+@Retention(RetentionPolicy.RUNTIME)     //定义该注解的有效范围,此处为运行时
+public @interface TreeNodeDefault {
+}

+ 15 - 0
app/src/main/java/com/hw/nativeapp/annotation/TreeNodeDesc.java

@@ -0,0 +1,15 @@
+package com.hw.nativeapp.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 自定义注解,node的摘要
+ */
+
+@Target(ElementType.FIELD)              //定义该注解的目标对象,此处为类的字段
+@Retention(RetentionPolicy.RUNTIME)     //定义该注解的有效范围,此处为运行时
+public @interface TreeNodeDesc {
+}

+ 15 - 0
app/src/main/java/com/hw/nativeapp/annotation/TreeNodeId.java

@@ -0,0 +1,15 @@
+package com.hw.nativeapp.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 自定义注解,node的id
+ */
+
+@Target(ElementType.FIELD)              //定义该注解的目标对象,此处为类的字段
+@Retention(RetentionPolicy.RUNTIME)     //定义该注解的有效范围,此处为运行时
+public @interface TreeNodeId {
+}

+ 15 - 0
app/src/main/java/com/hw/nativeapp/annotation/TreeNodeName.java

@@ -0,0 +1,15 @@
+package com.hw.nativeapp.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 自定义注解,node的name
+ */
+
+@Target(ElementType.FIELD)              //定义该注解的目标对象,此处为类的字段
+@Retention(RetentionPolicy.RUNTIME)     //定义该注解的有效范围,此处为运行时
+public @interface TreeNodeName {
+}

+ 15 - 0
app/src/main/java/com/hw/nativeapp/annotation/TreeNodePid.java

@@ -0,0 +1,15 @@
+package com.hw.nativeapp.annotation;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * 自定义注解,node的父节点id
+ */
+
+@Target(ElementType.FIELD)              //定义该注解的目标对象,此处为类的字段
+@Retention(RetentionPolicy.RUNTIME)     //定义该注解的有效范围,此处为运行时
+public @interface TreeNodePid {
+}

+ 34 - 0
app/src/main/java/com/hw/nativeapp/config/Contents.java

@@ -0,0 +1,34 @@
+package com.hw.nativeapp.config;
+
+public class Contents {
+    //AES加密KEY
+    public static final String AES_KEY = "1234199999ABCDEF";
+
+    public static final String TOKEN_HEAD = "Authorization";
+
+    //APPID  - 升级使用
+    public static final String APPID = "AIR_PORT_ID";
+
+    //临时存储key
+    //登录验证码uuid
+    public static final String SPU_GENCODE_KEY = "spu.gencode.key";
+    //登录token缓存KEY
+    public static final String SPU_TOKEN_KEY = "spu.login.token.key";
+    //登录用户名密码信息缓存
+    public static final String SPU_USERLOGININFO_KEY = "spu.login.userinfo.key";
+    //用户信息缓存KEY
+    public static final String SPU_USERINFO_KEY = "spu.userinfo.key";
+    //用户默认操作仓库缓存KEY
+    public static final String SPU_DEFAULT_STOCK_KEY = "spu.default.operation.stock.key";
+    //瓶码缓存KEY
+    public static final String SPU_BOTTOM_CODE_KEY = "spu.bottom.code.key";
+    //审核流程KEY
+    public static final String SPU_PROCESS_KEY = "spu.process.key";
+
+    //广播
+    public static final String BROADCAST_CODE = "com.fn.barcode";
+//    public static final String BROADCAST_CODE = "com.android.serial.BARCODEPORT_RECEIVEDDATA_ACTION";
+
+    //广播标识
+    public static final String BROADCAST_CODE_TYPE = "bar.code.type";
+}

+ 46 - 0
app/src/main/java/com/hw/nativeapp/config/enums/AllotStatusEnum.java

@@ -0,0 +1,46 @@
+package com.hw.nativeapp.config.enums;
+
+public enum AllotStatusEnum {
+
+    //调拨状态  0-审核中 1-未通过 2-未发货 3-在途 4-部分到货 5-完成
+    TYPE_EXAMINE(0, "审核中"),
+    TYPE_FAILED(1, "未通过"),
+    TYPE_UNSHIPPED(2, "未发货"),
+    TYPE_INTRANSIT(3, "在途"),
+    TYPE_PART(4, "部分到货"),
+    TYPE_COMPLETE(5, "完成"),
+    TYPE_UNKNOW(6, "未知");
+
+    AllotStatusEnum(Integer type, String name){
+        this.type = type;
+        this.name = name;
+    }
+
+    public static String getNameByType(Integer type){
+        for (AllotStatusEnum item : AllotStatusEnum.values()){
+            if (item.type.equals(type)){
+                return item.getName();
+            }
+        }
+        return AllotStatusEnum.TYPE_UNKNOW.getName();
+    }
+
+    private Integer type;
+    private String name;
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

+ 39 - 0
app/src/main/java/com/hw/nativeapp/config/enums/LoginEnum.java

@@ -0,0 +1,39 @@
+package com.hw.nativeapp.config.enums;
+
+public enum LoginEnum {
+    FIRST_LOGIN(1041 , "首次登录"),
+    LONGTIME_MODIFY(1042, "长时间未修改密码");
+
+    LoginEnum(Integer code, String msg){
+        this.code = code;
+        this.msg = msg;
+    }
+
+    public static boolean codeExist(Integer code){
+        for (LoginEnum item : LoginEnum.values()){
+            if (code.equals(item.code)){
+                return true;
+            }
+        }
+        return false;
+    }
+
+    private Integer code;
+    private String msg;
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public void setCode(Integer code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+}

+ 42 - 0
app/src/main/java/com/hw/nativeapp/config/enums/LogisPayTypeEnum.java

@@ -0,0 +1,42 @@
+package com.hw.nativeapp.config.enums;
+
+public enum  LogisPayTypeEnum {
+
+    //物流支付方 1 公司 2 客户
+    TYPE_COMPANY(1, "公司"),
+    TYPE_CUSTOMER(2, "客户"),
+    TYPE_UNKNOW(99, "未知");
+
+    LogisPayTypeEnum(Integer type, String name){
+        this.type = type;
+        this.name = name;
+    }
+
+    public static String getNameByType(Integer type){
+        for (LogisPayTypeEnum item : LogisPayTypeEnum.values()){
+            if (item.type.equals(type)){
+                return item.getName();
+            }
+        }
+        return LogisPayTypeEnum.TYPE_UNKNOW.getName();
+    }
+
+    private Integer type;
+    private String name;
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

+ 43 - 0
app/src/main/java/com/hw/nativeapp/config/enums/NoticeCenterEnum.java

@@ -0,0 +1,43 @@
+package com.hw.nativeapp.config.enums;
+
+public enum NoticeCenterEnum {
+    TYPE_0(0 , "销售出库"),
+    TYPE_1(1, "采购入库"),
+    TYPE_2(2 , "调拨出库"),
+    TYPE_3(3, "售后"),
+    TYPE_4(4 , "盘点"),
+    TYPE_5(5, "调拨入库");
+
+    NoticeCenterEnum(Integer code, String type){
+        this.code = code;
+        this.type = type;
+    }
+
+    public static String getTitleByType(Integer code){
+        for (NoticeCenterEnum item : NoticeCenterEnum.values()){
+            if (item.code.equals(code)){
+                return item.getType();
+            }
+        }
+        return "未知类型";
+    }
+
+    private Integer code;
+    private String type;
+
+    public Integer getCode() {
+        return code;
+    }
+
+    public void setCode(Integer code) {
+        this.code = code;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+}

+ 42 - 0
app/src/main/java/com/hw/nativeapp/config/enums/PutStatusTypeEnum.java

@@ -0,0 +1,42 @@
+package com.hw.nativeapp.config.enums;
+
+public enum PutStatusTypeEnum {
+
+    TYPE_COMPANY(0, "未提交"),
+    TYPE_CUSTOMER(1, "流程中"),
+    TYPE_UNKNOW(2, "已入库"),
+    TYPE_CLOSE(3, "已关闭");
+
+    PutStatusTypeEnum(Integer type, String name){
+        this.type = type;
+        this.name = name;
+    }
+
+    public static String getNameByType(Integer type){
+        for (PutStatusTypeEnum item : PutStatusTypeEnum.values()){
+            if (item.type.equals(type)){
+                return item.getName();
+            }
+        }
+        return PutStatusTypeEnum.TYPE_UNKNOW.getName();
+    }
+
+    private Integer type;
+    private String name;
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

+ 42 - 0
app/src/main/java/com/hw/nativeapp/config/enums/PutTypeEnum.java

@@ -0,0 +1,42 @@
+package com.hw.nativeapp.config.enums;
+
+public enum PutTypeEnum {
+
+    //物流支付方 1 公司 2 客户
+    TYPE_COMPANY(0, "采购入库"),
+    TYPE_CUSTOMER(1, "退货入库"),
+    TYPE_UNKNOW(2, "瑕疵入库");
+
+    PutTypeEnum(Integer type, String name){
+        this.type = type;
+        this.name = name;
+    }
+
+    public static String getNameByType(Integer type){
+        for (PutTypeEnum item : PutTypeEnum.values()){
+            if (item.type.equals(type)){
+                return item.getName();
+            }
+        }
+        return PutTypeEnum.TYPE_UNKNOW.getName();
+    }
+
+    private Integer type;
+    private String name;
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

+ 41 - 0
app/src/main/java/com/hw/nativeapp/config/enums/StockOutTypeEnum.java

@@ -0,0 +1,41 @@
+package com.hw.nativeapp.config.enums;
+
+public enum StockOutTypeEnum {
+    TYPE_EXPRESS(0, "快递"),
+    TYPE_MENTION(1, "自提"),
+    TYPE_SF(2, "顺丰直发"),
+    TYPE_UNKNOW(99, "未知");
+
+    StockOutTypeEnum(Integer type, String name){
+        this.type = type;
+        this.name = name;
+    }
+
+    public static String getNameByType(Integer type){
+        for (StockOutTypeEnum item : StockOutTypeEnum.values()){
+            if (item.type.equals(type)){
+                return item.getName();
+            }
+        }
+        return TYPE_UNKNOW.getName();
+    }
+
+    private Integer type;
+    private String name;
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

+ 46 - 0
app/src/main/java/com/hw/nativeapp/config/enums/StockStatusEnum.java

@@ -0,0 +1,46 @@
+package com.hw.nativeapp.config.enums;
+
+/**
+ * 出库单状态
+ */
+public enum StockStatusEnum {
+    //状态  0:待审核  1:审核未通过   2:待入库/待出库   3:已入库/已出库
+    STATUS_WAITAUDI(0, "待审核"),
+    STATUS_AUDIFAIL(1, "审核未通过"),
+    STATUS_WAITOUT(2, "待出库"),
+    STATUS_OUTSUCCESS(3, "已出库"),
+    STATUS_UNKNOW(99, "未知状态");
+
+    StockStatusEnum(Integer type, String name){
+        this.type = type;
+        this.name = name;
+    }
+
+    public static String getNameByType(Integer type){
+        for (StockStatusEnum item : StockStatusEnum.values()){
+            if (item.type.equals(type)){
+                return item.getName();
+            }
+        }
+        return STATUS_UNKNOW.getName();
+    }
+
+    private Integer type;
+    private String name;
+
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

+ 166 - 0
app/src/main/java/com/hw/nativeapp/config/exceptions/CrashHandler.java

@@ -0,0 +1,166 @@
+package com.hw.nativeapp.config.exceptions;
+
+import android.content.Context;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
+import android.os.Build;
+import android.os.Environment;
+import android.os.Process;
+import android.util.Log;
+
+import com.hw.nativeapp.utils.DateUtils;
+import com.hw.nativeapp.utils.LogUtils;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.Date;
+
+public class CrashHandler implements Thread.UncaughtExceptionHandler{
+    private static final String TAG = CrashHandler.class.getSimpleName();
+    private static final boolean DEBUG = true;
+
+    public static final String PATH = Environment.getExternalStorageDirectory().getPath() + "/CrashTest/log/";
+    public static final String FILE_NAME = "crash";
+    public static final String FILE_NAME_SUFFIX = ".trace";
+
+    private static CrashHandler sInstance = new CrashHandler();
+    private Thread.UncaughtExceptionHandler mDefaultCrashHandler;
+    private Context mContext;
+
+    private CrashHandler() {
+
+    }
+
+    public static CrashHandler getInstance() {
+        return sInstance;
+    }
+
+    public void init(Context context) {
+        // 获取系统默认的UncaughtExceptionHandler
+        mDefaultCrashHandler = Thread.getDefaultUncaughtExceptionHandler();
+        Thread.setDefaultUncaughtExceptionHandler(this);
+        mContext = context.getApplicationContext();
+    }
+
+    /**
+     * 这是最关键的函数,当程序中有未被捕获的异常,系统将会自动调用该方法
+     * @param thread 出现为捕获异常的线程
+     * @param ex 未捕获的异常
+     */
+    @Override
+    public void uncaughtException(Thread thread, Throwable ex) {
+        try {
+
+            // 这里可以上传异常信息到服务器,便于开发人员分析日志
+            uploadExceptionToServer(ex);
+            // 导出异常信息到SD卡中
+            dumpExceptionToSDCard(ex);
+
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+        ex.printStackTrace();
+        // 如果系统提供了默认的异常处理器,则交给系统去结束程序,否则就由自己结束自己
+        if (mDefaultCrashHandler != null) {
+            mDefaultCrashHandler.uncaughtException(thread, ex);
+        } else {
+            try {
+                Thread.sleep(1000);
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+            }
+            Process.killProcess(Process.myPid());
+        }
+    }
+
+    private void dumpExceptionToSDCard(Throwable ex) throws IOException {
+        if(!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
+            if (DEBUG) {
+                Log.w(TAG, "Sdcard unmounted, skip dump exception");
+            }
+            return;
+        }
+        String savePath = mContext.getExternalFilesDir(null).getPath() + "/CrashTest/log/";
+        File dir = new File(savePath);
+        if (!dir.exists()) {
+            dir.mkdirs();
+        }
+        long current = System.currentTimeMillis();
+        String time = DateUtils.getDateString(new Date(current), "yyyy-MM-dd HH:mm:ss");
+
+        File file = new File(savePath + FILE_NAME + time + FILE_NAME_SUFFIX);
+        try {
+            PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(file)));
+            pw.println(time);
+            dumpPhoneInfo(pw);
+            pw.println();
+            ex.printStackTrace(pw);
+            pw.close();
+        } catch (Exception e) {
+            Log.e(TAG, "Dump crash info failed", e);
+        }
+    }
+
+    private void dumpPhoneInfo(PrintWriter pw) throws PackageManager.NameNotFoundException {
+        PackageManager pm = mContext.getPackageManager();
+        PackageInfo pi = pm.getPackageInfo(mContext.getPackageName(), PackageManager.GET_ACTIVITIES);
+        pw.print("APP Version: ");
+        pw.println(pi.versionName);
+        // Android版本号
+        pw.print("OS Version: ");
+        pw.print(Build.VERSION.RELEASE);
+        pw.print("_");
+        pw.println(Build.VERSION.SDK_INT);
+        // 手机制造商
+        pw.print("Vendor: ");
+        pw.println(Build.MANUFACTURER);
+        // 手机型号
+        pw.print("Model: ");
+        pw.println(Build.MODEL);
+
+        // CPU架构
+        pw.print("CPU ABI: ");
+        pw.println(Build.CPU_ABI);
+    }
+
+    private void uploadExceptionToServer(Throwable ex) {
+        // TODO Upload Exception Message To Your Web Server
+        StringBuffer sb = new StringBuffer();
+        sb.append("<!DOCTYPE html>").append("<html>")
+                .append("<body>");
+        StackTraceElement[] elements = ex.getStackTrace();
+        if (elements.length > 0){
+            for (StackTraceElement item : elements){
+                sb.append("<div>").append(item.toString()).append("</div>");
+            }
+        }
+        sb.append("</body>").append("</html>");
+
+        LogUtils.d("aleyds->" + sb.toString());
+//        OKHttpUtils.newBuilder().url("http://172.16.90.39:5003/email/send")
+//                .postJson()
+//                .addParam("subject", "APP异常:" + DateUtils.getDateString(new Date(), "yyyy-MM-dd HH:mm:ss"))
+//                .addParam("contnet", sb.toString())
+//                .addParam("to", "237836617@qq.com")
+//                .build()
+//                .enqueue(new OKHttpCallBack<JSONObject>() {
+//                    @Override
+//                    public void onSuccess(JSONObject res) {
+//                    }
+//
+//                    @Override
+//                    public void onError(int code) {
+//                        LogUtils.d("aleyds->错误:" + code );
+//                    }
+//
+//                    @Override
+//                    public void onFailure(Call call, IOException e) {
+//                        LogUtils.d("aleyds->错误222:" );
+//                    }
+//                });
+    }
+}

+ 121 - 0
app/src/main/java/com/hw/nativeapp/httpnet/ApiService.java

@@ -0,0 +1,121 @@
+package com.hw.nativeapp.httpnet;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.hw.nativeapp.BuildConfig;
+import com.hw.nativeapp.httpnet.entity.LoginBean;
+import com.hw.nativeapp.httpnet.entity.LoginRequestBean;
+import com.hw.nativeapp.httpnet.entity.ResponseData;
+import com.hw.nativeapp.httpnet.entity.UpdateVerAskBean;
+import com.hw.nativeapp.httpnet.entity.UpdateVerReqBean;
+
+import java.util.Map;
+
+import io.reactivex.Observable;
+import retrofit2.http.Body;
+import retrofit2.http.GET;
+import retrofit2.http.POST;
+import retrofit2.http.Query;
+import retrofit2.http.QueryMap;
+
+/**
+ * @create by ywq
+ * @date 2020/5/12
+ * @description :
+ */
+public interface ApiService {
+    String COMMON= BuildConfig.API_PATH;
+
+    //登录
+    @POST(COMMON + "/system/deviceInfo/pdaLogin")
+    Observable<ResponseData<LoginBean>> login(
+            @Body LoginRequestBean bean,
+            @Query("t") Long currtime
+            );
+
+    //登录
+    @POST(COMMON + "/member/auth/pdaLogin")
+    Observable<ResponseData<LoginBean>> pdaLogin(
+            @Body LoginRequestBean bean,
+            @Query("t") Long currtime
+    );
+
+    //版本升级
+    @POST(COMMON + "/system/appversion/upgrade-by-appid")
+    Observable<ResponseData<UpdateVerAskBean>> version(
+            @Body UpdateVerReqBean bean,
+            @Query("t") Long currtime
+    );
+
+    //用户信息
+    @GET(COMMON + "/system/client/selfIndex")
+    Observable<ResponseData<JSONObject>> selfIndex(
+            @Query("t") Long currtime
+    );
+
+    //查询票列表
+    @GET(COMMON + "/order/orderInfo/getValidList")
+    Observable<ResponseData<JSONObject>> getValidList(@QueryMap Map< String,String> options,
+                                                     @Query("t") Long currtime);
+
+    //出票
+    @POST(COMMON + "/order/orderInfo/ticketout")
+    Observable<ResponseData<JSONObject>> ticketout(
+            @Body JSONObject bean,
+            @Query("t") Long currtime
+    );
+
+    //获取节目列表
+    @GET(COMMON + "/goods/performInfo/selectAll")
+    Observable<ResponseData<JSONObject>> selectAll(@QueryMap Map< String,String> options,
+                                                      @Query("t") Long currtime);
+    //节目ID获取演艺厅信息
+    @GET(COMMON + "/goods/performInfo/performSell")
+    Observable<ResponseData<JSONObject>> performSell(@QueryMap Map< String,String> options,
+                                                    @Query("t") Long currtime);
+
+    //获取节目演出日期
+    @GET(COMMON + "/merchant/merchantTheatreAuditorium/selectDate")
+    Observable<ResponseData<JSONObject>> selectDate(@QueryMap Map< String,String> options,
+                                                   @Query("t") Long currtime);
+
+    //获取节目演出时段
+    @GET(COMMON + "/merchant/merchantTheatreAuditorium/selectTimes")
+    Observable<ResponseData<JSONObject>> selectTimes(@QueryMap Map< String,String> options,
+                                                    @Query("t") Long currtime);
+    // 选择区域
+    @POST(COMMON + "/merchant/merchantTheatreAuditorium/selectRegion")
+    Observable<ResponseData<JSONObject>> selectRegion(
+            @Body JSONObject bean,
+            @Query("t") Long currtime
+    );
+
+    // 二要数认证
+    @POST(COMMON + "/thirdapi/identity/factorAuth")
+    Observable<ResponseData<JSONObject>> factorAuth(
+            @Body JSONObject bean,
+            @Query("t") Long currtime
+    );
+
+    // 核销票据
+    @POST(COMMON + "/order/orderInfo/pdaWiped")
+    Observable<ResponseData<JSONObject>> orderSubmit(
+            @Body JSONObject bean,
+            @Query("t") Long currtime
+    );
+
+    // 订单支付
+    @POST(COMMON + "/order/orderInfo/gotoNativePay")
+    Observable<ResponseData<JSONObject>> gotoNativePay(
+            @Body JSONObject bean,
+            @Query("t") Long currtime
+    );
+
+    // 支付查询
+    @POST(COMMON + "/order/orderInfo/payQuery")
+    Observable<ResponseData<JSONObject>> payQuery(
+            @Body JSONObject bean,
+            @Query("t") Long currtime
+    );
+
+}

+ 121 - 0
app/src/main/java/com/hw/nativeapp/httpnet/ErrorConsumer.java

@@ -0,0 +1,121 @@
+package com.hw.nativeapp.httpnet;
+
+import android.text.TextUtils;
+import android.util.Log;
+
+import androidx.annotation.StringRes;
+
+import com.alibaba.fastjson.JSONObject;
+import com.blankj.utilcode.util.LogUtils;
+import com.blankj.utilcode.util.ToastUtils;
+import com.hw.nativeapp.MApplication;
+import com.hw.nativeapp.R;
+import com.hw.nativeapp.httpnet.entity.ResponseData;
+import com.hw.nativeapp.ui.dialogs.LoadingDialog;
+
+import io.reactivex.functions.Consumer;
+import okhttp3.ResponseBody;
+import retrofit2.HttpException;
+
+/**
+ * 默认错误的处理
+ */
+public class ErrorConsumer implements Consumer<Throwable> {
+
+    private int stringRes;
+
+    public ErrorConsumer() {
+    }
+
+    public ErrorConsumer(@StringRes int stringRes) {
+        this.stringRes = stringRes;
+    }
+
+    @Override
+    public void accept(Throwable throwable) throws Exception {
+//        LoadingDialogUtils.cancelLoadingDialog();
+        LoadingDialog.getInstance(MApplication.getAppContext()).hide();
+        LogUtils.e("error : " + throwable);
+
+        if (throwable instanceof HttpException) {
+            HttpException exception = (HttpException) throwable;
+            ResponseBody errorBody = exception.response().errorBody();
+            String content = errorBody.string();
+
+            if (!TextUtils.isEmpty(content) && content.startsWith("{")) {
+                ResponseData responseData = JSONObject.parseObject(content, ResponseData.class);
+                if (responseData != null) {
+                    String msg = responseData.getMsg();
+                    toast(msg);
+                }
+
+            } else {
+                    String msg = getMsg(exception);
+                    if (!TextUtils.isEmpty(msg)) {
+                        toast(msg);
+                    } else if (stringRes != 0) {
+                        ToastUtils.showShort(MApplication.getInstance().getText(stringRes));
+                    }
+
+            }
+
+        } else {
+            if (stringRes <= 0) {
+                String msg = throwable.getMessage();
+                if (!TextUtils.isEmpty(msg)) {
+                    if (msg.contains("connect")) {
+                        msg = MApplication.getInstance().getString(R.string.network_error);
+                    }
+                    if(msg.indexOf("No address associated with hostname") > -1){
+                        toast("网络错误,请检查网络!");
+                    } else if (msg.indexOf(".setVisibility(int)") > -1){
+
+                    } else if (msg.indexOf("to post notification on channel") > -1){
+
+                    }else if (msg.indexOf("on a null object reference") > -1){
+
+                    } else if (msg.indexOf("Index: 0, Size: 0") > -1){
+
+                    } else {
+                        toast(msg);
+                    }
+                } else {
+                    if(msg.indexOf("No address associated with hostname") > -1){
+                        toast("网络错误,请检查网络!");
+                    } else if (msg.indexOf(".setVisibility(int)") > -1){
+
+                    } else if (msg.indexOf("to post notification on channel") > -1){
+
+                    }else if (msg.indexOf("on a null object reference") > -1){
+
+                    }else {
+                        toast(msg);
+                    }
+                }
+            } else {
+                ToastUtils.showShort(MApplication.getInstance().getText(stringRes));
+            }
+        }
+
+    }
+
+    private void toast(String msg2) {
+        ResponseConsumer.showErrorMsg(msg2);
+    }
+
+//    protected void needLogin() {
+//        App.logout(App.getInstance());
+//    }
+
+    private String getMsg(HttpException exception) {
+        String msg = exception.message();
+        if (TextUtils.isEmpty(msg)) {
+            msg = exception.getMessage();
+        }
+        if (msg != null && msg.contains("time out")) {
+            msg = MApplication.getInstance().getString(R.string.network_time_out);
+        }
+        return msg;
+    }
+
+}

+ 49 - 0
app/src/main/java/com/hw/nativeapp/httpnet/FileApiService.java

@@ -0,0 +1,49 @@
+package com.hw.nativeapp.httpnet;
+
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.hw.nativeapp.BuildConfig;
+import com.hw.nativeapp.httpnet.entity.IndexStatisticsBean;
+import com.hw.nativeapp.httpnet.entity.LoginBean;
+import com.hw.nativeapp.httpnet.entity.LoginRequestBean;
+import com.hw.nativeapp.httpnet.entity.RelatiInfoBean;
+import com.hw.nativeapp.httpnet.entity.ResponseData;
+import com.hw.nativeapp.httpnet.entity.UpdateVerAskBean;
+import com.hw.nativeapp.httpnet.entity.UpdateVerReqBean;
+
+import java.util.List;
+import java.util.Map;
+
+import io.reactivex.Observable;
+import okhttp3.MultipartBody;
+import retrofit2.http.Body;
+import retrofit2.http.DELETE;
+import retrofit2.http.GET;
+import retrofit2.http.Multipart;
+import retrofit2.http.POST;
+import retrofit2.http.PUT;
+import retrofit2.http.Part;
+import retrofit2.http.Query;
+import retrofit2.http.QueryMap;
+
+/**
+ * @create by ywq
+ * @date 2020/5/12
+ * @description :
+ */
+public interface FileApiService {
+
+    String COMMON = BuildConfig.FILEAPI_PATH;
+
+
+//    //腾讯文件上传
+    @Multipart
+    @POST(COMMON + "/upload/single/minio")
+    Observable<ResponseData<JSONObject>> uploadFile(
+            @Query("bucket")String bucket,
+            @Part MultipartBody.Part file);
+
+
+
+}

+ 152 - 0
app/src/main/java/com/hw/nativeapp/httpnet/OkHttpInterceptor.java

@@ -0,0 +1,152 @@
+package com.hw.nativeapp.httpnet;
+
+import android.text.TextUtils;
+import android.util.Log;
+
+import com.blankj.utilcode.util.NetworkUtils;
+import com.blankj.utilcode.util.SPUtils;
+import com.hw.nativeapp.MApplication;
+import com.hw.nativeapp.config.Contents;
+import com.hw.nativeapp.utils.LogUtils;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+
+import okhttp3.CacheControl;
+import okhttp3.Headers;
+import okhttp3.Interceptor;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+import okhttp3.Response;
+import okhttp3.ResponseBody;
+import okio.Buffer;
+
+/**
+ * Created by kaka on 2018/3/15.
+ * email:375120706@qq.com
+ */
+
+public class OkHttpInterceptor implements Interceptor {
+//
+//    public static final String Authorization = "Authorization";
+
+    private static final String TAG = OkHttpInterceptor.class.getSimpleName();
+    //设缓存有效期为1天
+    private static final long CACHE_CONTROL_CACHE = 60 * 60 * 24 * 1L;
+
+    public OkHttpInterceptor() {
+    }
+
+    @Override
+    public Response intercept(Chain chain) throws IOException {
+        //从chain对象中可以获取到request和response,想要的数据都可以从这里获取
+        Request request = chain.request();
+        if (!NetworkUtils.isConnected()) {//如果不能上网,那么启用缓存
+            request.newBuilder().cacheControl(CacheControl.FORCE_CACHE).build();
+        }
+
+        //增加头部信息
+        request = addHeaders(request);
+        //打印request日志
+        logForRequest(request);
+        //获取response对象
+        Response response = chain.proceed(request);
+//        getToken(response);
+
+        //打印response日志
+        logForResponse(response);
+
+        if (response.code() == 401){
+//            App.logout(App.getInstance());
+//            ResponseConsumer.showErrorMsg("登录过期");
+//            MApplication.loginout(false, "登录过期", null);
+        }
+        if (NetworkUtils.isConnected()) {
+            //有网的时候读接口上的@Headers里的配置,可以在这里进行统一的设置
+            String cacheControl = request.cacheControl().toString();
+            return response.newBuilder()
+                    .header("Cache-Control", cacheControl)
+                    .removeHeader("Pragma")
+                    .build();
+        } else {
+            return response.newBuilder()
+                    .header("Cache-Control", "public, only-if-cached, max-stale=" + CACHE_CONTROL_CACHE)
+                    .removeHeader("Pragma")
+                    .build();
+        }
+
+    }
+
+    private Request addHeaders(Request request) {
+        Map<String, String> params = new HashMap<>();
+
+        String accessToken = SPUtils.getInstance().getString(Contents.SPU_TOKEN_KEY);
+        if (!TextUtils.isEmpty(accessToken)) {
+            params.put(Contents.TOKEN_HEAD, accessToken);
+        }
+        Headers headers = Headers.of(params);
+        return request.newBuilder().headers(headers).build();
+    }
+
+    private String getLanguage() {
+        int language = SPUtils.getInstance().getInt("language", 100);
+        if (language == 100) {
+            if (Locale.getDefault().equals(Locale.ENGLISH)) {
+                language = 0;
+            }  else {
+                language = 1;
+            }
+        }
+        switch (language){
+            case 0:
+                return "en";
+            case 1:
+                return "zh";
+        }
+        return "zh";
+    }
+
+    private void logForResponse(Response response) {
+//        LogUtils.d("code: " + response.code());
+//        LogUtils.d("protocol: " + response.protocol());
+        Headers headers = response.headers();
+//        if (headers != null && headers.size() != 0) {
+//            LogUtils.i(headers.toString());
+//        }
+        try {
+            //这里不能直接用response.body().string(),因为调用改方法后流就关闭,程序就可能会发生异常
+            //我们需要创建出一个新的ResponseBody给应用层调用
+            ResponseBody body = response.peekBody(1024 * 1024);
+            if (body != null) {
+                String result = body.string();
+                LogUtils.d("result : " + result);
+            }
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    private void logForRequest(Request request) {
+        LogUtils.d("url: " + request.url());
+
+        Headers headers = request.headers();
+        if (headers != null && headers.size() != 0) {
+//            LogUtils.i("headers: " + headers.toString());
+        }
+
+        RequestBody body = request.body();
+        if (body != null) {
+            Buffer buffer = new Buffer();
+            try {
+                body.writeTo(buffer);
+                LogUtils.d("body params : " + buffer.snapshot().utf8());
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+
+}

+ 97 - 0
app/src/main/java/com/hw/nativeapp/httpnet/ResponseConsumer.java

@@ -0,0 +1,97 @@
+package com.hw.nativeapp.httpnet;
+
+import android.os.RemoteException;
+import android.text.TextUtils;
+import android.util.Log;
+
+import com.blankj.utilcode.util.LogUtils;
+import com.blankj.utilcode.util.ToastUtils;
+import com.hw.nativeapp.MApplication;
+import com.hw.nativeapp.R;
+import com.hw.nativeapp.httpnet.entity.ResponseData;
+import com.hw.nativeapp.ui.dialogs.LoadingDialog;
+
+import java.text.ParseException;
+import java.util.List;
+
+import io.reactivex.functions.Consumer;
+
+/**
+ * 通用返回处理
+ *
+ * @param <E>
+ */
+public abstract class ResponseConsumer<E> implements Consumer<ResponseData<E>> {
+
+    protected ResponseData<E> responseData;
+
+    @Override
+    public void accept(ResponseData<E> responseData) throws Exception {
+        this.responseData = responseData;
+        if (responseData != null) {
+            int code = responseData.getCode();
+            String msg = responseData.getMsg();
+            if (code != 0 && code != 200) {
+                LogUtils.e("code : " + code + ", Error : " + msg);
+//                LoadingDialogUtils.cancelLoadingDialog();
+                LoadingDialog.getInstance(MApplication.getAppContext()).hide();
+                ToastUtils.showShort(msg);
+//                if (code == 1)
+//                    ToastUtils.showShort(msg);
+//                if ("该证件已经被其他手机号绑定".equals(msg)){
+//                    hasBandPhone();
+//                }
+            }
+            if (code == 0 || code == 200) {
+                LoadingDialog.getInstance(MApplication.getAppContext()).hide();
+                if (responseData.getData() != null)
+                    onSuccess(responseData.getData());
+                else if (responseData.getList() != null)
+                    onListSuccess(responseData.getList());
+                else
+
+                    onSuccess(responseData.getData());
+            } else if (code == 401) {
+                /**
+                 * token 过期
+                 */
+                MApplication.loginout(false, "登录过期", null);
+//                LoadingDialogUtils.cancelLoadingDialog();
+                LoadingDialog.getInstance(MApplication.getAppContext()).hide();
+
+            } else {
+                onFailed(code, msg);
+            }
+        } else {
+            ToastUtils.showShort(MApplication.getInstance().getResources().getString(R.string.request_failure));
+//            LoadingDialogUtils.cancelLoadingDialog();
+            LoadingDialog.getInstance(MApplication.getAppContext()).hide();
+        }
+    }
+
+    public abstract void onSuccess(E data) throws ParseException, RemoteException;
+
+    public void onListSuccess(List<E> list) {
+
+    }
+
+    protected void hasBandPhone() {
+
+    }
+
+
+    public void onFailed(int code, String msg) {
+//        LoadingDialogUtils.cancelLoadingDialog();
+        LoadingDialog.getInstance(MApplication.getAppContext()).hide();
+        showErrorMsg(msg);
+    }
+
+    public static void showErrorMsg(String msg) {
+        if (TextUtils.isEmpty(msg)) {
+            ToastUtils.showShort("请求错误");
+            return;
+        }
+        ToastUtils.showShort(msg);
+    }
+
+}

+ 130 - 0
app/src/main/java/com/hw/nativeapp/httpnet/RetrofitFileManager.java

@@ -0,0 +1,130 @@
+package com.hw.nativeapp.httpnet;
+
+import android.content.Context;
+
+import androidx.annotation.NonNull;
+
+import com.hw.nativeapp.BuildConfig;
+
+import java.lang.reflect.Field;
+import java.security.SecureRandom;
+import java.util.Collections;
+import java.util.concurrent.TimeUnit;
+
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSession;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+
+import okhttp3.Cache;
+import okhttp3.OkHttpClient;
+import okhttp3.Protocol;
+import retrofit2.Retrofit;
+import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
+import retrofit2.converter.gson.GsonConverterFactory;
+
+/**
+ * Created by kaka on 2018/3/14.
+ * email:375120706@qq.com
+ */
+
+public class RetrofitFileManager {
+
+
+    private static volatile OkHttpClient mOkHttpClient;
+
+    private static Cache cache;
+
+    public static void init(@NonNull Context context) {
+        cache = new Cache(context.getApplicationContext().getCacheDir(), 1024 * 1024 * 10);//缓存10mib
+    }
+
+
+    private static OkHttpClient getOkHttpClient() {
+        if (mOkHttpClient == null) {
+            synchronized (RetrofitFileManager.class) {
+                if (mOkHttpClient == null) {
+                    mOkHttpClient = new OkHttpClient.Builder()
+                            .addInterceptor(new OkHttpInterceptor())
+                            .connectTimeout(30, TimeUnit.SECONDS)//连接超时时间
+                            .readTimeout(15, TimeUnit.SECONDS)//读取超时时间
+                            .writeTimeout(15, TimeUnit.SECONDS)//写入超时时间
+                            .cache(cache)
+                            .protocols(Collections.singletonList(Protocol.HTTP_1_1))
+                            .build();
+                }
+            }
+        }
+        return mOkHttpClient;
+    }
+
+    public static <T> T create(Class<T> clazz) {
+        ignoreSSLCheck();
+        Retrofit retrofit = new Retrofit.Builder()
+                .client(getOkHttpClient())
+                .baseUrl(BuildConfig.FILEAPI_HOST)
+                .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
+                .addConverterFactory(GsonConverterFactory.create())
+                .build();
+        return retrofit.create(clazz);
+    }
+
+    public static <T> T createNoBase(Class<T> clazz, String baseUrl) {
+        Retrofit retrofit = new Retrofit.Builder()
+                .client(getOkHttpClient())
+                .baseUrl(baseUrl)
+                .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
+                .addConverterFactory(GsonConverterFactory.create())
+                .build();
+        return retrofit.create(clazz);
+    }
+
+    private static void ignoreSSLCheck() {
+//        Log.e(TAG, "ignoreSSLCheck()");
+        SSLContext sc = null;
+        try {
+            sc = SSLContext.getInstance("SSL");
+            sc.init(null, new TrustManager[]{new X509TrustManager() {
+                @Override
+                public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws java.security.cert.CertificateException {
+
+                }
+
+                @Override
+                public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws java.security.cert.CertificateException {
+
+                }
+
+                @Override
+                public java.security.cert.X509Certificate[] getAcceptedIssuers() {
+                    return null;
+                }
+            }}, new SecureRandom());
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        HostnameVerifier hv1 = new HostnameVerifier() {
+            @Override
+            public boolean verify(String hostname, SSLSession session) {
+                return true;
+            }
+        };
+
+        String workerClassName = "okhttp3.OkHttpClient";
+        try {
+            Class workerClass = Class.forName(workerClassName);
+            Field hostnameVerifier = workerClass.getDeclaredField("hostnameVerifier");
+            hostnameVerifier.setAccessible(true);
+            hostnameVerifier.set(getOkHttpClient(), hv1);
+
+            Field sslSocketFactory = workerClass.getDeclaredField("sslSocketFactory");
+            sslSocketFactory.setAccessible(true);
+            sslSocketFactory.set(getOkHttpClient(), sc.getSocketFactory());
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+}

+ 132 - 0
app/src/main/java/com/hw/nativeapp/httpnet/RetrofitManager.java

@@ -0,0 +1,132 @@
+package com.hw.nativeapp.httpnet;
+
+import android.content.Context;
+
+import androidx.annotation.NonNull;
+
+import java.lang.reflect.Field;
+import java.security.SecureRandom;
+import java.util.Collections;
+import java.util.concurrent.TimeUnit;
+
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSession;
+import javax.net.ssl.TrustManager;
+import javax.net.ssl.X509TrustManager;
+
+import okhttp3.Cache;
+import okhttp3.OkHttpClient;
+import okhttp3.Protocol;
+import retrofit2.Retrofit;
+import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
+import retrofit2.converter.gson.GsonConverterFactory;
+
+/**
+ * Created by kaka on 2018/3/14.
+ * email:375120706@qq.com
+ */
+
+public class RetrofitManager {
+
+    private static String mBaseUrl;
+
+    private static volatile OkHttpClient mOkHttpClient;
+
+    private static Cache cache;
+
+    public static void init(@NonNull Context context) {
+        cache = new Cache(context.getApplicationContext().getCacheDir(), 1024 * 1024 * 10);//缓存10mib
+    }
+
+    public static void setBaseUrl(String baseUrl) {
+        mBaseUrl = baseUrl;
+    }
+
+    private static OkHttpClient getOkHttpClient() {
+        if (mOkHttpClient == null) {
+            synchronized (RetrofitManager.class) {
+                if (mOkHttpClient == null) {
+                    mOkHttpClient = new OkHttpClient.Builder()
+                            .addInterceptor(new OkHttpInterceptor())
+                            .connectTimeout(30, TimeUnit.SECONDS)//连接超时时间
+                            .readTimeout(15, TimeUnit.SECONDS)//读取超时时间
+                            .writeTimeout(15, TimeUnit.SECONDS)//写入超时时间
+                            .cache(cache)
+                            .protocols(Collections.singletonList(Protocol.HTTP_1_1))
+                            .build();
+                }
+            }
+        }
+        return mOkHttpClient;
+    }
+
+    public static <T> T create(Class<T> clazz) {
+        ignoreSSLCheck();
+        Retrofit retrofit = new Retrofit.Builder()
+                .client(getOkHttpClient())
+                .baseUrl(mBaseUrl)
+                .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
+                .addConverterFactory(GsonConverterFactory.create())
+                .build();
+        return retrofit.create(clazz);
+    }
+
+    public static <T> T createNoBase(Class<T> clazz, String baseUrl) {
+        Retrofit retrofit = new Retrofit.Builder()
+                .client(getOkHttpClient())
+                .baseUrl(baseUrl)
+                .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
+                .addConverterFactory(GsonConverterFactory.create())
+                .build();
+        return retrofit.create(clazz);
+    }
+
+    private static void ignoreSSLCheck() {
+//        Log.e(TAG, "ignoreSSLCheck()");
+        SSLContext sc = null;
+        try {
+            sc = SSLContext.getInstance("SSL");
+            sc.init(null, new TrustManager[]{new X509TrustManager() {
+                @Override
+                public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws java.security.cert.CertificateException {
+
+                }
+
+                @Override
+                public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws java.security.cert.CertificateException {
+
+                }
+
+                @Override
+                public java.security.cert.X509Certificate[] getAcceptedIssuers() {
+                    return null;
+                }
+            }}, new SecureRandom());
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        HostnameVerifier hv1 = new HostnameVerifier() {
+            @Override
+            public boolean verify(String hostname, SSLSession session) {
+                return true;
+            }
+        };
+
+        String workerClassName = "okhttp3.OkHttpClient";
+        try {
+            Class workerClass = Class.forName(workerClassName);
+            Field hostnameVerifier = workerClass.getDeclaredField("hostnameVerifier");
+            hostnameVerifier.setAccessible(true);
+            hostnameVerifier.set(getOkHttpClient(), hv1);
+
+            Field sslSocketFactory = workerClass.getDeclaredField("sslSocketFactory");
+            sslSocketFactory.setAccessible(true);
+            sslSocketFactory.set(getOkHttpClient(), sc.getSocketFactory());
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+}

+ 7 - 0
app/src/main/java/com/hw/nativeapp/httpnet/entity/BottleCode.java

@@ -0,0 +1,7 @@
+package com.hw.nativeapp.httpnet.entity;
+
+public class BottleCode {
+
+    public String id;
+    public String bottleCode;
+}

+ 4 - 0
app/src/main/java/com/hw/nativeapp/httpnet/entity/EmptyBean.java

@@ -0,0 +1,4 @@
+package com.hw.nativeapp.httpnet.entity;
+
+public class EmptyBean {
+}

+ 90 - 0
app/src/main/java/com/hw/nativeapp/httpnet/entity/FileBean.java

@@ -0,0 +1,90 @@
+package com.hw.nativeapp.httpnet.entity;
+
+
+import com.hw.nativeapp.annotation.TreeNodeChecked;
+import com.hw.nativeapp.annotation.TreeNodeDefault;
+import com.hw.nativeapp.annotation.TreeNodeDesc;
+import com.hw.nativeapp.annotation.TreeNodeId;
+import com.hw.nativeapp.annotation.TreeNodeName;
+import com.hw.nativeapp.annotation.TreeNodePid;
+
+/**
+ * 利用注解来标记bean字段
+ * 使之在解析bean对象时,可以通过注解来获取对应的字段值,而不用知道具体的字段名
+ */
+public class FileBean {
+    @TreeNodeId
+    private long id;
+
+    @TreeNodePid
+    private long pid;
+
+    @TreeNodeName
+    private String name;
+
+    @TreeNodeDesc
+    private String desc;
+
+    @TreeNodeChecked
+    private int checked;
+
+    @TreeNodeDefault
+    private int isdefault;
+
+    public FileBean(long id, long pid, String name, String desc, int checked, int isdefault) {
+        this.id = id;
+        this.pid = pid;
+        this.name = name;
+        this.desc = desc;
+        this.checked = checked;
+        this.isdefault = isdefault;
+    }
+
+    public long getId() {
+        return id;
+    }
+
+    public void setId(long id) {
+        this.id = id;
+    }
+
+    public long getPid() {
+        return pid;
+    }
+
+    public void setPid(long pid) {
+        this.pid = pid;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getDesc() {
+        return desc;
+    }
+
+    public void setDesc(String desc) {
+        this.desc = desc;
+    }
+
+    public int getChecked() {
+        return checked;
+    }
+
+    public void setChecked(int checked) {
+        this.checked = checked;
+    }
+
+    public int getIsdefault() {
+        return isdefault;
+    }
+
+    public void setIsdefault(int isdefault) {
+        this.isdefault = isdefault;
+    }
+}

+ 33 - 0
app/src/main/java/com/hw/nativeapp/httpnet/entity/GenCodeBean.java

@@ -0,0 +1,33 @@
+package com.hw.nativeapp.httpnet.entity;
+
+import java.io.Serializable;
+
+public class GenCodeBean implements Serializable {
+    private String captchaImage;
+    private String aesKey;
+    private String uuid;
+
+    public String getCaptchaImage() {
+        return captchaImage;
+    }
+
+    public void setCaptchaImage(String captchaImage) {
+        this.captchaImage = captchaImage;
+    }
+
+    public String getAesKey() {
+        return aesKey;
+    }
+
+    public void setAesKey(String aesKey) {
+        this.aesKey = aesKey;
+    }
+
+    public String getUuid() {
+        return uuid;
+    }
+
+    public void setUuid(String uuid) {
+        this.uuid = uuid;
+    }
+}

+ 8 - 0
app/src/main/java/com/hw/nativeapp/httpnet/entity/IndexStatisticsBean.java

@@ -0,0 +1,8 @@
+package com.hw.nativeapp.httpnet.entity;
+
+public class IndexStatisticsBean {
+    public Integer outNum;  //今日发货
+    public Integer noOutNum; //未发货
+    public Integer putOrderNum; //今日入库单数量
+    public Integer outOrderNum; //今日出库单数量
+}

+ 28 - 0
app/src/main/java/com/hw/nativeapp/httpnet/entity/InventoryBean.java

@@ -0,0 +1,28 @@
+package com.hw.nativeapp.httpnet.entity;
+
+import com.alibaba.fastjson.JSONArray;
+
+import java.util.List;
+
+public class InventoryBean {
+    public String id;
+    public String orderNum;
+    public String createTime;
+    public String checkTime;
+    public String houseId;
+    public String houseName;
+    public Integer checkResult;
+    public Integer approvalProgress;
+    public Integer isGenOrderGoods;
+
+    public String matName;
+    public String materialCode;
+    public String checkDesc;
+    public String saleUserName;
+    public String createBy;
+    public Integer handMethod;
+    public Integer checkAmount;
+    public Integer sysAmount;
+    public Integer checkMethod;
+    public JSONArray checkOrderGoodsList;
+}

+ 86 - 0
app/src/main/java/com/hw/nativeapp/httpnet/entity/LoginBean.java

@@ -0,0 +1,86 @@
+package com.hw.nativeapp.httpnet.entity;
+
+public class LoginBean {
+
+    private Integer pwdStatus;
+    private String pwdStatusMsg;
+    private Long userId;
+    private String userName;
+    private String jobNum;
+    private String userCode;
+    private String userPhone;
+    private String avatar;
+    private String accessToken;
+
+    public Long getUserId() {
+        return userId;
+    }
+
+    public void setUserId(Long userId) {
+        this.userId = userId;
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public String getJobNum() {
+        return jobNum;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public void setJobNum(String jobNum) {
+        this.userName = jobNum;
+    }
+
+    public String getUserCode() {
+        return userCode;
+    }
+
+    public void setUserCode(String userCode) {
+        this.userCode = userCode;
+    }
+
+    public String getUserPhone() {
+        return userPhone;
+    }
+
+    public void setUserPhone(String userPhone) {
+        this.userPhone = userPhone;
+    }
+
+    public String getAvatar() {
+        return avatar;
+    }
+
+    public void setAvatar(String avatar) {
+        this.avatar = avatar;
+    }
+
+    public String getAccessToken() {
+        return accessToken;
+    }
+
+    public void setAccessToken(String access_token) {
+        this.accessToken = accessToken;
+    }
+
+    public Integer getPwdStatus() {
+        return pwdStatus;
+    }
+
+    public void setPwdStatus(Integer pwdStatus) {
+        this.pwdStatus = pwdStatus;
+    }
+
+    public String getPwdStatusMsg() {
+        return pwdStatusMsg;
+    }
+
+    public void setPwdStatusMsg(String pwdStatusMsg) {
+        this.pwdStatusMsg = pwdStatusMsg;
+    }
+}

+ 18 - 0
app/src/main/java/com/hw/nativeapp/httpnet/entity/LoginRequestBean.java

@@ -0,0 +1,18 @@
+package com.hw.nativeapp.httpnet.entity;
+
+import java.io.Serializable;
+
+public class LoginRequestBean implements Serializable {
+
+    /**
+     * name : 9000
+     * password : 000000
+     * deviceNo : 12341234
+     */
+
+    public String deviceNo;
+    public String deviceAddress;
+
+    public String jobNum;
+    public String password;
+}

+ 17 - 0
app/src/main/java/com/hw/nativeapp/httpnet/entity/MessageBean.java

@@ -0,0 +1,17 @@
+package com.hw.nativeapp.httpnet.entity;
+
+public class MessageBean {
+    public String id;
+    public int isRead;
+    public String title;
+    public String content;
+    public String time;
+    public int titleType;
+    public String detailUri;
+    public String remark;
+    public String releasTime;
+    public String status;
+
+    public String regionId;
+    public String buyerName;
+}

+ 26 - 0
app/src/main/java/com/hw/nativeapp/httpnet/entity/NodeData.java

@@ -0,0 +1,26 @@
+package com.hw.nativeapp.httpnet.entity;
+
+/**
+ * 每个节点的具体数据
+ * Created by xiaoyehai on 2018/7/11 0011.
+ */
+
+public class NodeData {
+
+    private String name;
+
+    public NodeData() {
+    }
+
+    public NodeData(String name) {
+        this.name = name;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+}

+ 10 - 0
app/src/main/java/com/hw/nativeapp/httpnet/entity/PageAsk.java

@@ -0,0 +1,10 @@
+package com.hw.nativeapp.httpnet.entity;
+
+public class PageAsk {
+    public int pageNum = 1;
+    public int pageSize = 20;
+
+    public int pageCount;
+    public int total;
+
+}

+ 28 - 0
app/src/main/java/com/hw/nativeapp/httpnet/entity/PurchaseReceiptBean.java

@@ -0,0 +1,28 @@
+package com.hw.nativeapp.httpnet.entity;
+
+public class PurchaseReceiptBean {
+
+    public String  id;
+    public String  orderNum;    //采购入库单号
+    public String  tabId;       //采购单id
+    public String  purchaseOrderNum; //采购单号
+    public String  supName;     //供货商
+    public String  contactPhone;// 供货商联系电话
+    public String  buyerName;   // 采购员
+    public String  buyerPhone;  // 采购员电话
+    public String  regionId;    // 区域id
+    public String  houseId;     // 仓库id
+    public String  houseName;   // 仓库名称
+    public String  putType;     // 类型 0-采购入库 1-退货入库 2-瑕疵入库
+    public String  outType;     // 出库单类型 0-销售出库 1-回寄出库 2-换货出库 3-理赔出库 4-调拨出库 5-品鉴酒出库 6-无实际支付但有成本出库 7-借酒/退回出库
+    public String  putTime;     // 入库时间
+    public String  waybillNum;  // 运单号
+    public String  putList;  // 入库清单文本
+    public String  plateNum;    // 车牌号
+    public String  status;      // 状态 0-未提交 1-流程中 2-已入库 3-已关闭
+    public String  createTime;  // 创建时间
+
+    public String createBy;     // 创建人
+    public String createPhone;     // 创建人电话
+    public String orderNumber;  // 出库单号
+}

+ 7 - 0
app/src/main/java/com/hw/nativeapp/httpnet/entity/PushRecordBean.java

@@ -0,0 +1,7 @@
+package com.hw.nativeapp.httpnet.entity;
+
+public class PushRecordBean {
+
+    public String createTime;
+    public String uploadResult;
+}

+ 8 - 0
app/src/main/java/com/hw/nativeapp/httpnet/entity/RelatiInfoBean.java

@@ -0,0 +1,8 @@
+package com.hw.nativeapp.httpnet.entity;
+
+public class RelatiInfoBean {
+    public String relatiName;
+    public String  relatiId;
+    public Integer  relatiValue;
+    public boolean checked = false;
+}

+ 151 - 0
app/src/main/java/com/hw/nativeapp/httpnet/entity/ResponseData.java

@@ -0,0 +1,151 @@
+package com.hw.nativeapp.httpnet.entity;
+
+import java.util.List;
+
+/**
+ * Created by kaka on 2018/3/19.
+ * email:375120706@qq.com
+ */
+
+public class ResponseData<E> {
+
+    private int code;
+
+    private String msg;
+
+    private E data;
+
+    private List<E> list;
+
+    private PageData page;
+
+    public int getCode() {
+        return code;
+    }
+
+    public void setCode(int code) {
+        this.code = code;
+    }
+
+    public String getMsg() {
+        return msg;
+    }
+
+    public void setMsg(String msg) {
+        this.msg = msg;
+    }
+
+    public E getData() {
+        return data;
+    }
+
+    public void setData(E data) {
+        this.data = data;
+    }
+
+    public PageData getPage() {
+        return page;
+    }
+
+    public void setPage(PageData page) {
+        this.page = page;
+    }
+
+    public static class  PageData{
+
+        /**
+         * totalRows : 2
+         * curPage : 1
+         * pageSize : 15
+         * startIndex : 0
+         * endIndex : 15
+         * totalPages : 1
+         */
+
+        private int totalRows;
+        private int curPage;
+        private int pageSize;
+        private int startIndex;
+        private int endIndex;
+        private int totalPages;
+
+        public int getTotalRows() {
+            return totalRows;
+        }
+
+        public void setTotalRows(int totalRows) {
+            this.totalRows = totalRows;
+        }
+
+        public int getCurPage() {
+            return curPage;
+        }
+
+        public void setCurPage(int curPage) {
+            this.curPage = curPage;
+        }
+
+        public int getPageSize() {
+            return pageSize;
+        }
+
+        public void setPageSize(int pageSize) {
+            this.pageSize = pageSize;
+        }
+
+        public int getStartIndex() {
+            return startIndex;
+        }
+
+        public void setStartIndex(int startIndex) {
+            this.startIndex = startIndex;
+        }
+
+        public int getEndIndex() {
+            return endIndex;
+        }
+
+        public void setEndIndex(int endIndex) {
+            this.endIndex = endIndex;
+        }
+
+        public int getTotalPages() {
+            return totalPages;
+        }
+
+        public void setTotalPages(int totalPages) {
+            this.totalPages = totalPages;
+        }
+
+        @Override
+        public String toString() {
+            return "PageData{" +
+                    "totalRows=" + totalRows +
+                    ", curPage=" + curPage +
+                    ", pageSize=" + pageSize +
+                    ", startIndex=" + startIndex +
+                    ", endIndex=" + endIndex +
+                    ", totalPages=" + totalPages +
+                    '}';
+        }
+    }
+
+    public List<E> getList() {
+        return list;
+    }
+
+    public void setList(List<E> list) {
+        this.list = list;
+    }
+
+    @Override
+    public String toString() {
+        return "ResponseData{" +
+                "code=" + code +
+                ", msg='" + msg + '\'' +
+                ", data=" + data +
+                ", page=" + page +
+                '}';
+    }
+
+}

+ 27 - 0
app/src/main/java/com/hw/nativeapp/httpnet/entity/StockDetailBean.java

@@ -0,0 +1,27 @@
+package com.hw.nativeapp.httpnet.entity;
+
+import java.math.BigDecimal;
+
+public class StockDetailBean {
+
+    public String id;
+    public String  goodsName;
+    public String  goodsBatch;
+    public String  goodsDate;
+    public Integer  goodsQuan;
+    public BigDecimal goodsPrice;
+    public Integer warnValue;
+    public String matCode;
+    public String matName;
+    public String unName;
+    public String tabId;
+    public String postId;
+    public String paramValue;
+    public String typeName;
+    public String year;
+    public String type;
+    public String materialCode;
+
+    public String matId;
+    public String unitId;
+}

+ 14 - 0
app/src/main/java/com/hw/nativeapp/httpnet/entity/StockLocaionBean.java

@@ -0,0 +1,14 @@
+package com.hw.nativeapp.httpnet.entity;
+
+public class StockLocaionBean {
+
+    public String id;
+    public String  houseId; //仓库ID
+    public String  postId; //库位ID
+    public String  postName; //库位名称
+    public String  matName; //物料名称
+    public String goodAmount; // 商品库存数量
+
+    public Integer isScan; // 是否必须扫码 0-必须 1-不必须
+    public Integer materType; // 是否管控 0-不管控 1-管控
+}

+ 17 - 0
app/src/main/java/com/hw/nativeapp/httpnet/entity/StockOrderDetailBean.java

@@ -0,0 +1,17 @@
+package com.hw.nativeapp.httpnet.entity;
+
+import java.math.BigDecimal;
+
+public class StockOrderDetailBean {
+
+    public String id;
+    public String  poductName; //产品名称
+    public String  materialCode; //物料编码
+    public Integer  amount; //待出库数量
+    public Integer  outAmount; //已出库数量
+    public BigDecimal salePrice; //售价
+    public Integer stockCont; //库存管控 字段 1-否 2-是
+    public Integer putAmount;
+    public Integer isScan; //0-必须 1-不必须
+    public String outType; //出库单类型 0-销售出库 1-回寄出库 2-换货出库 3-理赔出库 4-调拨出库 5-品鉴酒出库 6-无实际支付但有成本出库 7-借酒/退回出库
+}

+ 60 - 0
app/src/main/java/com/hw/nativeapp/httpnet/entity/StockOutBean.java

@@ -0,0 +1,60 @@
+package com.hw.nativeapp.httpnet.entity;
+
+public class StockOutBean {
+
+    public String id;
+    public String  orderNumber; //出库单号
+    public String  orderId; //销售单号
+    public String  customerName; //客户
+    public String  busierName; //业务员
+    public String houseName; // 仓库
+    public Integer receiveWay; //出库方式 0-快递 1-自提
+    public Integer status; //状态  0:待审核  1:审核未通过   2:待入库/待出库   3:已入库/已出库
+    public String houseId; //仓库id
+    public String logisticsNo; //快递单号
+    public String logisticsCompany; //快递公司
+    public String createTime; //订单时间
+    public Integer expressType;  //0-企得宝 1-顺丰直发 2-null
+    public String name;
+
+    public String orderNum; //采购入库单号
+    public String purchaseOrderNum; //	采购单号
+    public String supName; // 供货商
+    public String contactPhone; // 供货商联系电话
+    public String buyerName; // 采购员姓名
+    public String waybillNum; // 运单号
+    public String plateNum; //车牌号
+
+    public String tabId; // 售后单id
+    public Integer putType; // 类型 0-采购入库 1-退货入库 2-瑕疵入库
+
+    public String outOrPutorderNumber; // 出库或入库单号
+    public String putHousePosiName; // 	入库仓库库位名称
+    public String outHousePosiName; // 出库仓库库位名称
+    public Integer amount; // 	总数量
+
+    public Integer outType; // 出库方式
+
+    public String checkTime; //盘点时间
+    public Integer checkResult; //盘点结果 0-待盘点 1-有差异 2-无差异
+    public Integer approvalProgress; //审批进度 0-待提交 1-审核中 2-审核通过 3-审核未通过
+
+    public Integer total;
+    public Integer rejectNumber;
+    public Integer signNum;
+    public String afterReasonName;
+    public String createBy;
+
+    public String agreeUrl;
+    public String disagreeUrl;
+    public String tableName;
+
+    public Integer orderType;
+    public Integer isGenOrderGoods;
+    public Integer isCheck;
+
+    public String createPhone;
+    public String regionId;
+
+    public Integer isScrap;
+}

+ 12 - 0
app/src/main/java/com/hw/nativeapp/httpnet/entity/UpdateVerAskBean.java

@@ -0,0 +1,12 @@
+package com.hw.nativeapp.httpnet.entity;
+
+public class UpdateVerAskBean {
+
+    public Boolean isUpload;
+    public String  versionCode;
+    public String  versionName;
+    public String  note;
+    public String  pkgUrl;
+
+
+}

+ 25 - 0
app/src/main/java/com/hw/nativeapp/httpnet/entity/UpdateVerReqBean.java

@@ -0,0 +1,25 @@
+package com.hw.nativeapp.httpnet.entity;
+
+public class UpdateVerReqBean {
+
+    /**
+     * APPID
+     */
+    public String appId;
+
+    /**
+     * 应用名称
+     */
+    public String name;
+
+
+    /**
+     * 版本名称
+     */
+    public String versionName;
+
+    /**
+     * 版本编号
+     */
+    public int versionCode;
+}

+ 25 - 0
app/src/main/java/com/hw/nativeapp/httpnet/entity/WarehousingDetailsBean.java

@@ -0,0 +1,25 @@
+package com.hw.nativeapp.httpnet.entity;
+
+import org.json.JSONArray;
+
+public class WarehousingDetailsBean {
+    public String  id;
+    public String  putOrderId; //采购入库单id
+    public String  matName;    //物料名称
+    public String  materialCode;//物料编码
+    public String  unitName;   //单位
+    public Integer  amount;     //总入库数量
+    public Integer  putAmount;  //已录入库数量
+    public String  matId;      //物料id
+
+    public String  scanBarcode;    //物流箱码
+    public String  scanBoxCode;    //物流瓶码
+    public String  codeAmount;     //数量(理换值)
+    public String  goodsBatch;
+    public String  type;
+    public Integer  scanType;
+
+    public Integer  sysAmount;
+    public Integer  checkAmount;
+    public Integer  goodsQuan;
+}

+ 14 - 0
app/src/main/java/com/hw/nativeapp/httpnet/entity/allocationBean.java

@@ -0,0 +1,14 @@
+package com.hw.nativeapp.httpnet.entity;
+
+public class allocationBean {
+    public String id;
+    public String orderNum;
+    public String putHousePosiName;
+    public String outHousePosiName;
+    public int orderType;
+    public String createTime;
+    public String allotOrderId;
+
+    public String outOrPutorderNumber;
+    public String amount;
+}

+ 23 - 0
app/src/main/java/com/hw/nativeapp/httpnet/entity/handleBean.java

@@ -0,0 +1,23 @@
+package com.hw.nativeapp.httpnet.entity;
+
+public class handleBean {
+    public String id;
+    public String showImg;
+    public String createBy;
+    public String createTime;
+    public String orderId;
+    public String idcard;
+    public String name;
+    public String goodsName;
+    public String performName;
+    public String performDate;
+    public String performStart;
+    public String performEnd;
+
+    public String seatName;
+    public String seatTypeId;
+    public String seatTypeName;
+
+    public boolean checkedStatus;
+
+}

+ 72 - 0
app/src/main/java/com/hw/nativeapp/httpnet/okhttp/OKHttpCallBack.java

@@ -0,0 +1,72 @@
+package com.hw.nativeapp.httpnet.okhttp;
+
+import com.google.gson.internal.$Gson$Types;
+
+import java.io.IOException;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+
+import okhttp3.Call;
+
+/**
+ * Created by 孟鹏 on 2016-11-1-0001.
+ * 作用:自定义的OKHttp的callback-----OKHttpCallBack
+ */
+
+public abstract class OKHttpCallBack<T> {
+    /**
+     * 静态代码块,获取T的泛型
+     *
+     * @param subclass 泛型
+     * @return T的泛型
+     */
+    static Type getSuperclassTypeParameter(Class<?> subclass) {
+
+        Type superclass = subclass.getGenericSuperclass();
+
+        if (superclass instanceof Class) {
+
+            return null;
+        }
+        ParameterizedType parameterizedType = (ParameterizedType) superclass;
+
+        return $Gson$Types.canonicalize(parameterizedType.getActualTypeArguments()[0]);
+
+    }
+
+    public Type mType;
+
+    /**
+     * okhttp的callback
+     */
+    public OKHttpCallBack() {
+        mType = getSuperclassTypeParameter(this.getClass());
+    }
+
+    /**
+     * 获取数据成功,配合Gson解析成javabean
+     * 前提是必须要先用gson解析成javabean,然后把javabean的泛型代替T,
+     * 例如:OKHttpCallBack<User>,User就是解析出来的,可以直接拿来用
+     *
+     * @param t 解析后得到的数据
+     */
+    public void onSuccess(T t) {
+    }
+
+    /**
+     * 获取数据时链接服务器失败
+     *
+     * @param code 链接服务器失败的状态码
+     */
+    public void onError(int code) {
+    }
+
+    /**
+     * 获取数据失败
+     *
+     * @param call 失败时的call
+     * @param e    抛出的异常
+     */
+    public void onFailure(Call call, IOException e) {
+    }
+}

+ 163 - 0
app/src/main/java/com/hw/nativeapp/httpnet/okhttp/OKHttpManager.java

@@ -0,0 +1,163 @@
+package com.hw.nativeapp.httpnet.okhttp;
+
+import android.os.Handler;
+
+import com.google.gson.Gson;
+
+import java.io.IOException;
+import java.util.concurrent.TimeUnit;
+
+import okhttp3.Call;
+import okhttp3.Callback;
+import okhttp3.OkHttpClient;
+import okhttp3.Response;
+
+/**
+ * Created by 孟鹏 on 2016-11-2-0002.
+ * 作用:处理网络访问,下载数据
+ */
+
+public class OKHttpManager {
+    //实例化OKHttpManager
+    private static OKHttpManager mInstance;
+
+    private OkHttpClient okHttpClient;
+
+    private Handler mHandler;
+
+    private Gson gson;
+
+    /**
+     * 初始化OKHttp , handler , gson
+     */
+    private OKHttpManager() {
+        initOKHttp();
+        mHandler = new Handler();
+        gson = new Gson();
+    }
+
+    /**
+     * 单例
+     *
+     * @return
+     */
+    public static synchronized OKHttpManager getmInstance() {
+        if (mInstance == null) {
+            mInstance = new OKHttpManager();
+        }
+        return mInstance;
+    }
+
+    /**
+     * 初始化OKHttp
+     */
+    private void initOKHttp() {
+
+        okHttpClient = new OkHttpClient().newBuilder()
+                .readTimeout(30000, TimeUnit.SECONDS)//读数据,以秒为单位
+                .connectTimeout(30000, TimeUnit.SECONDS)//连接超时时间,以秒为单位
+//                .cache()
+                .build();
+    }
+
+    /**
+     * 处理okhttp网络请求
+     *
+     * @param okHttpUtils    自己封装的OKHttpUtils
+     * @param okHttpCallBack 自己封装的OKHttpCallBack
+     */
+    public void request(OKHttpUtils okHttpUtils, final OKHttpCallBack okHttpCallBack) {
+        //如果为空抛出空指针异常
+        if (okHttpCallBack == null) {
+            throw new NullPointerException("okHttpCallBack is null !");
+        }
+        //okhttp访问网络及返回方法
+        okHttpClient.newCall(okHttpUtils.buildRequest()).enqueue(new Callback() {
+            /**
+             * 获取失败
+             * @param call
+             * @param e
+             */
+            @Override
+            public void onFailure(Call call, IOException e) {
+                //返回失败时的回调
+                sendonFailureMessage(okHttpCallBack, call, e);
+            }
+
+            /**
+             * 获取成功
+             * @param call
+             * @param response
+             * @throws IOException
+             */
+            @Override
+            public void onResponse(Call call, Response response) throws IOException {
+                if (response.isSuccessful()) {
+                    String result = response.body().string();
+                    if (okHttpCallBack.mType == null || okHttpCallBack.mType == String.class) {
+                        sendonSuccessMessage(okHttpCallBack, result);
+                    } else {
+                        try {
+                            sendonSuccessMessage(okHttpCallBack, gson.fromJson(result, okHttpCallBack.mType));
+                        } catch (Exception e) {
+                            //此处的0占位
+                            sendonErrorMessage(okHttpCallBack, 0);
+                        }
+                    }
+
+                    if (response.body() != null) {
+                        response.body().close();
+                    }
+                } else {
+                    sendonErrorMessage(okHttpCallBack, response.code());
+                }
+            }
+        });
+    }
+
+    /**
+     * 获取信息失败时的回调信息
+     *
+     * @param okHttpCallBack
+     * @param call
+     * @param e
+     */
+    private void sendonFailureMessage(final OKHttpCallBack okHttpCallBack, final Call call, final IOException e) {
+        mHandler.post(new Runnable() {
+            @Override
+            public void run() {
+                okHttpCallBack.onFailure(call, e);
+            }
+        });
+    }
+
+    /**
+     * 连接服务器出错时的回调信息
+     *
+     * @param okHttpCallBack 回调的callback
+     * @param code           错误码
+     */
+    private void sendonErrorMessage(final OKHttpCallBack okHttpCallBack, final int code) {
+        mHandler.post(new Runnable() {
+            @Override
+            public void run() {
+                okHttpCallBack.onError(code);
+            }
+        });
+    }
+
+    /**
+     * 成功获取数据时的回调
+     *
+     * @param okHttpCallBack 回调的callback
+     * @param object         获取的数据
+     */
+    private void sendonSuccessMessage(final OKHttpCallBack okHttpCallBack, final Object object) {
+        mHandler.post(new Runnable() {
+            @Override
+            public void run() {
+                okHttpCallBack.onSuccess(object);
+            }
+        });
+    }
+}

+ 196 - 0
app/src/main/java/com/hw/nativeapp/httpnet/okhttp/OKHttpUtils.java

@@ -0,0 +1,196 @@
+package com.hw.nativeapp.httpnet.okhttp;
+
+import android.net.Uri;
+
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import okhttp3.FormBody;
+import okhttp3.MediaType;
+import okhttp3.Request;
+import okhttp3.RequestBody;
+
+/**
+ * Created by 孟鹏 on 2016-11-1-0001.
+ * 作用:
+ */
+
+public class OKHttpUtils {
+
+    public OKHttpUtils() {
+    }
+
+    /**
+     * 网络请求队列
+     *
+     * @param callBack 处理事件的callBack
+     */
+    public void enqueue(OKHttpCallBack callBack) {
+        OKHttpManager.getmInstance().request(this, callBack);
+    }
+
+    private Builder mBuilder;
+
+    /**
+     * 为了下文获取url
+     *
+     * @param mBuilder
+     */
+    public OKHttpUtils(Builder mBuilder) {
+        this.mBuilder = mBuilder;
+    }
+
+    /**
+     * 创建Request请求对象
+     *
+     * @return Request
+     */
+    public Request buildRequest() {
+
+        Request.Builder builder = new Request.Builder();
+        //get请求
+        if (mBuilder.method == "GET") {
+
+            builder.url(buildGetRequestParam());
+            builder.get();
+
+        }
+        //post请求
+        else if (mBuilder.method == "POST") {
+
+            builder.url(mBuilder.url);
+
+            try {
+                builder.post(buildRequestBody());
+            } catch (JSONException e) {
+                e.printStackTrace();
+            }
+        }
+
+        return builder.build();
+    }
+
+    /**
+     * 构建get请求时传的参数拼接成url
+     *
+     * @return 拼接的url字符串
+     */
+    private String buildGetRequestParam() {
+
+        if (mBuilder.params.size() <= 0) {
+            return this.mBuilder.url;
+        }
+
+        Uri.Builder builder = Uri.parse(mBuilder.url).buildUpon();
+
+        for (RequestParam p : mBuilder.params) {
+            builder.appendQueryParameter(p.getKey(), p.getValue() == null ? "" : p.getValue().toString());
+        }
+
+        String url = builder.build().toString();
+
+        return url;
+    }
+
+    /**
+     * okhttp中post请求需要RequestBody,所以这个方法就是为了
+     * 构建RequestBody.
+     *
+     * @return RequestBody 用于post请求的RequestBody
+     */
+    private RequestBody buildRequestBody() throws JSONException {
+
+        if (mBuilder.isJsonParams) {
+
+            JSONObject jsonObject = new JSONObject();
+            //遍历params的list
+            for (RequestParam p : mBuilder.params) {
+                jsonObject.put(p.getKey(), p.getValue());
+            }
+            //转化成String
+            String json = jsonObject.toString();
+            //创建json字符串
+            return RequestBody.create(MediaType.parse("application/json; charset=utf-8"), json);
+        }
+
+        FormBody.Builder builder = new FormBody.Builder();
+
+        for (RequestParam p : mBuilder.params) {
+
+            builder.add(p.getKey(), p.getValue() == null ? "" : p.getValue().toString());
+        }
+
+        return builder.build();
+    }
+
+    /**
+     * 初始化[创建]一个Builder
+     *
+     * @return
+     */
+    public static Builder newBuilder() {
+        return new Builder();
+    }
+
+    public static class Builder {
+
+        private String url;
+        private String method;
+        private List<RequestParam> params;
+        private boolean isJsonParams;
+
+        private Builder() {
+            //默认是get方法
+            method = "GET";
+            params = new ArrayList<>();
+        }
+
+        public Builder url(String url) {
+            this.url = url;
+            return this;
+        }
+
+        public OKHttpUtils build() {
+            return new OKHttpUtils(this);
+        }
+
+        /**
+         * get请求
+         */
+        public Builder get() {
+            method = "GET";
+            return this;
+        }
+
+        /**
+         * post请求
+         */
+        public Builder post() {
+            method = "POST";
+            return this;
+        }
+
+        /**
+         * post中的Json请求
+         */
+        public Builder postJson() {
+            isJsonParams = true;
+            return post();
+        }
+
+        /**
+         * 构建传参用的键值对
+         *
+         * @param key   传参key值
+         * @param value 传参value值
+         * @return 构建的参数的list
+         */
+        public Builder addParam(String key, Object value) {
+            params.add(new RequestParam(key, value));
+            return this;
+        }
+    }
+}

+ 32 - 0
app/src/main/java/com/hw/nativeapp/httpnet/okhttp/RequestParam.java

@@ -0,0 +1,32 @@
+package com.hw.nativeapp.httpnet.okhttp;
+
+/**
+ * Created by 孟鹏 on 2016-11-1-0001.
+ * 作用:接收参数param
+ */
+
+public class RequestParam {
+    public String key ;
+    public Object value ;
+
+    public RequestParam(String key, Object value) {
+        this.key = key;
+        this.value = value;
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+    public void setKey(String key) {
+        this.key = key;
+    }
+
+    public Object getValue() {
+        return value;
+    }
+
+    public void setValue(Object value) {
+        this.value = value;
+    }
+}

+ 136 - 0
app/src/main/java/com/hw/nativeapp/httpnet/upgrade/UpgradeHandler.java

@@ -0,0 +1,136 @@
+package com.hw.nativeapp.httpnet.upgrade;
+
+import android.content.Context;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Build;
+import android.util.Log;
+
+import androidx.core.content.FileProvider;
+
+import com.hw.nativeapp.MApplication;
+import com.hw.nativeapp.utils.FileUtils;
+import com.hw.nativeapp.utils.LogUtils;
+import com.hw.nativeapp.utils.StringUtils;
+import com.hw.nativeapp.utils.ToastUtils;
+import com.liulishuo.filedownloader.BaseDownloadTask;
+import com.liulishuo.filedownloader.FileDownloadListener;
+import com.liulishuo.filedownloader.FileDownloader;
+import com.liulishuo.filedownloader.util.FileDownloadUtils;
+
+import java.io.File;
+
+public class UpgradeHandler {
+
+    public static final String TAG = UpgradeHandler.class.getName();
+
+    private String downloadUrl;
+    private String downloadLocalPath;
+    private Context context;
+    private UpgradeHandler.OnDownloadListener onDownloadListener;
+
+    public UpgradeHandler(Context context , String downloadUrl){
+        this.downloadUrl = downloadUrl;
+        this.context = context;
+    }
+
+    public interface OnDownloadListener {
+        void complate();
+        void progress(int soFarBytes, int totalBytes);
+    }
+
+    public void setOnListener(UpgradeHandler.OnDownloadListener listener) {
+        this.onDownloadListener = listener;
+    }
+
+
+    public void start(){
+        if (StringUtils.isEmpty(this.downloadUrl)){
+            ToastUtils.showLongToast(MApplication.getAppContext(), "下载地址为空");
+        }
+        this.downloadLocalPath = FileDownloadUtils.getDefaultSaveRootPath() + File.separator + "tmpdir1" + File.separator +
+                "download.apk";
+//        this.downloadLocalPath = this.context.getExternalFilesDir(null).getPath() + File.separator + "tmpdir1" + File.separator +
+//                "download.apk";
+//        this.downloadLocalPath = Environment.getExternalStorageDirectory().getPath() + File.separator + "tmpdir1" + File.separator +
+//                "download.apk";
+        if (FileUtils.isFileExists(this.downloadLocalPath)){
+            FileUtils.deleteFile(this.downloadLocalPath);
+        }
+        LogUtils.d("download", "下载地址 ---->" + this.downloadUrl );
+        LogUtils.d("download", "存储路径 ---->" + this.downloadLocalPath );
+        FileDownloader.getImpl().create(this.downloadUrl)
+                .setPath(this.downloadLocalPath)
+                .setListener(new FileDownloadListener() {
+                    @Override
+                    protected void pending(BaseDownloadTask task, int soFarBytes, int totalBytes) {
+                        LogUtils.d("download", "pending ---->");
+                    }
+
+                    @Override
+                    protected void connected(BaseDownloadTask task, String etag, boolean isContinue, int soFarBytes, int totalBytes) {
+                        LogUtils.d("download", "connected ---->");
+                    }
+
+                    @Override
+                    protected void progress(BaseDownloadTask task, int soFarBytes, int totalBytes) {
+                        LogUtils.d("download", "progress ---->" + soFarBytes + ":" + totalBytes);
+                        onDownloadListener.progress(soFarBytes, totalBytes);
+                    }
+
+                    @Override
+                    protected void blockComplete(BaseDownloadTask task) {
+                        LogUtils.d("download", "blockComplete ---->");
+                    }
+
+                    @Override
+                    protected void retry(final BaseDownloadTask task, final Throwable ex, final int retryingTimes, final int soFarBytes) {
+                        LogUtils.d("download", "retry ---->");
+                    }
+
+                    @Override
+                    protected void completed(BaseDownloadTask task) {
+                        LogUtils.d("download", "completed ---->");
+                        onDownloadListener.complate();
+                        installApk();
+                    }
+
+                    @Override
+                    protected void paused(BaseDownloadTask task, int soFarBytes, int totalBytes) {
+                        LogUtils.d("download", "paused ---->");
+                    }
+
+                    @Override
+                    protected void error(BaseDownloadTask task, Throwable e) {
+                        LogUtils.d("download", "error ---->");
+                    }
+
+                    @Override
+                    protected void warn(BaseDownloadTask task) {
+                        LogUtils.d("download", "warn ---->");
+                    }
+                }).start();
+    }
+
+    private void installApk(){
+
+        File apkFile = new File(this.downloadLocalPath);
+        Intent intent = new Intent(Intent.ACTION_VIEW);
+        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
+            Log.w(TAG, "版本大于 N ,开始使用 fileProvider 进行安装");
+//            intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
+            Uri contentUri = FileProvider.getUriForFile(
+                    this.context
+                    , this.context.getApplicationContext().getPackageName() + ".provider"
+                    , apkFile);
+            intent.addCategory("android.intent.category.DEFAULT");
+            intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
+            intent.setDataAndType(contentUri, "application/vnd.android.package-archive");
+        } else {
+            Log.w(TAG, "正常进行安装");
+            intent.setDataAndType(Uri.fromFile(apkFile), "application/vnd.android.package-archive");
+        }
+        this.context.startActivity(intent);
+    }
+}

+ 50 - 0
app/src/main/java/com/hw/nativeapp/ui/activity/BaseActivity.java

@@ -0,0 +1,50 @@
+package com.hw.nativeapp.ui.activity;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.text.TextUtils;
+
+import androidx.annotation.Nullable;
+
+import butterknife.ButterKnife;
+import butterknife.Unbinder;
+
+/**
+ * 应用界面基类
+ */
+public abstract class BaseActivity extends Activity {
+
+    protected String TAG;
+
+    private Unbinder unbinder;
+
+    abstract void  initView();
+
+
+    @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        if (TextUtils.isEmpty(TAG)) {
+            TAG = getClass().getSimpleName();
+        }
+        super.onCreate(savedInstanceState);
+    }
+
+    @Override
+    public void setContentView(int layoutResID) {
+        super.setContentView(layoutResID);
+        unbinder = ButterKnife.bind(this);
+        initView();
+    }
+
+
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+        if (unbinder != null) {
+            unbinder.unbind();
+        }
+    }
+
+
+}

+ 181 - 0
app/src/main/java/com/hw/nativeapp/ui/activity/InfoQueryActivity.java

@@ -0,0 +1,181 @@
+package com.hw.nativeapp.ui.activity;
+import android.app.ProgressDialog;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.Handler;
+import android.view.View;
+import android.widget.EditText;
+import android.widget.Toast;
+
+import com.alibaba.fastjson.JSONObject;
+import com.blankj.utilcode.util.ToastUtils;
+import com.google.zxing.integration.android.IntentIntegrator;
+import com.google.zxing.integration.android.IntentResult;
+import com.hjq.bar.OnTitleBarListener;
+import com.hjq.bar.TitleBar;
+import com.hw.nativeapp.MApplication;
+import com.hw.nativeapp.R;
+import com.hw.nativeapp.httpnet.ErrorConsumer;
+import com.hw.nativeapp.httpnet.ResponseConsumer;
+import com.hw.nativeapp.utils.ActivityUtils;
+import com.hw.nativeapp.utils.MaskUtil;
+import com.hw.nativeapp.utils.RxUtil;
+
+import butterknife.BindView;
+import butterknife.OnClick;
+
+
+public class InfoQueryActivity extends BaseActivity  {
+
+    private TitleBar titleBar;
+    private ProgressDialog progressDialog;
+
+    @BindView(R.id.et_name)
+    EditText et_name;
+    @BindView(R.id.et_idcard)
+    EditText et_idcard;
+    @BindView(R.id.et_code)
+    EditText et_code;
+
+    private String idcard = "";
+    private String scanCode = "";
+    @Override
+    void initView() {
+        titleBar = findViewById(R.id.tb_main_bar);
+        titleBar.setOnTitleBarListener(new OnTitleBarListener() {
+            @Override
+            public void onLeftClick(View v) {
+                ActivityUtils.activityFinish(InfoQueryActivity.this, true );
+            }
+
+            @Override
+            public void onTitleClick(View v) {
+
+            }
+
+            @Override
+            public void onRightClick(View v) {
+
+            }
+        });
+    }
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_info_query);
+    }
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+    }
+
+    @OnClick({R.id.input_idcard_btn, R.id.input_code_btn, R.id.tv_scan})
+    public void onClick(View v){
+        switch (v.getId()){
+            case R.id.input_idcard_btn:
+                factorAuth();
+                break;
+            case R.id.input_code_btn:
+                codeVerify();
+                break;
+            case R.id.tv_scan:
+                startScanCode();
+                break;
+        }
+    }
+
+    // 二要数认证
+    private void factorAuth(){
+        if(et_name.getText().toString().isEmpty() || et_idcard.getText().toString().isEmpty()){
+            Toast msg = Toast.makeText(this, "请输入姓名和身份证号!", Toast.LENGTH_SHORT);
+//            msg.setGravity(Gravity.CENTER, 0, 0);
+            msg.show();
+            return;
+        }
+        if(et_name.getText().toString().length() < 2 || et_idcard.getText().toString().length() < 18){
+            Toast msg = Toast.makeText(this, "姓名和身份证号格式错误!", Toast.LENGTH_SHORT);
+//            msg.setGravity(Gravity.CENTER, 0, 0);
+            msg.show();
+            return;
+        }
+        JSONObject options = new  JSONObject();
+        options.put("name", et_name.getText().toString());
+        options.put("idcard", et_idcard.getText().toString());
+        progressDialog = MaskUtil.showProgressDialog( "正在验证...", InfoQueryActivity.this);
+        new Handler().postDelayed(() -> {
+            if(progressDialog != null){
+                progressDialog.dismiss();
+            }
+        }, 30000);
+        MApplication.getApiService().factorAuth( options, System.currentTimeMillis() / 1000)
+                .compose(RxUtil.applyObservableAsync())
+                .subscribe(new ResponseConsumer<JSONObject>() {
+                    @Override
+                    public void onSuccess(JSONObject data) {
+                        if(data.getIntValue("status") == 1) {
+                            if(progressDialog != null){
+                                progressDialog.dismiss();
+                            }
+                            Bundle bundle = new Bundle();
+                            bundle.putString("idcard", et_idcard.getText().toString());
+                            ActivityUtils.launchActivity(InfoQueryActivity.this,PurchaseInfoActivity.class, bundle);
+                        } else {
+                            if(progressDialog != null){
+                                progressDialog.dismiss();
+                            }
+                            ToastUtils.showShort(data.getString("errReason"));
+                        }
+                    }
+
+                    @Override
+                    public void onFailed(int code, String msg) {
+                        if(progressDialog != null){
+                            progressDialog.dismiss();
+                        }
+                    }
+                }, new ErrorConsumer());
+    }
+
+    // 核销码
+    private void codeVerify(){
+        if(et_code.getText().toString().isEmpty() || et_code.getText().toString().isEmpty()){
+            Toast msg = Toast.makeText(this, "请输入核销码!", Toast.LENGTH_SHORT);
+//            msg.setGravity(Gravity.CENTER, 0, 0);
+            msg.show();
+            return;
+        }
+        Bundle bundle = new Bundle();
+        bundle.putString("qrcodeNo", et_code.getText().toString());
+        ActivityUtils.launchActivity(InfoQueryActivity.this,PurchaseInfoActivity.class, bundle);
+    }
+
+    private void startScanCode(){
+        new IntentIntegrator(this)
+                .setDesiredBarcodeFormats(IntentIntegrator.ALL_CODE_TYPES)// 扫码的类型,可选:一维码,二维码,一/二维码
+                .setPrompt("")// 设置提示语
+                .setCaptureActivity(ScanQRCodeActivity.class)
+                .addExtra("scanTimes", "请扫码")
+                .setCameraId(0)// 选择摄像头,可使用前置或者后置
+                .setBeepEnabled(true)// 是否开启声音,扫完码之后会"哔"的一声
+                .setBarcodeImageEnabled(false)// 扫完码之后生成二维码的图片
+                .initiateScan();// 初始化扫码
+    }
+
+    @Override
+    protected void onActivityResult(int requestCode, int resultCode, Intent data){
+        IntentResult result = IntentIntegrator.parseActivityResult(requestCode, resultCode, data);
+        if(resultCode != 0){
+            scanCode = result.getContents();
+            if(scanCode != null && scanCode.isEmpty() ){
+                Toast msg = Toast.makeText(this, "扫描核销码不能为空!", Toast.LENGTH_SHORT);
+//                msg.setGravity(Gravity.CENTER, 0, 0);
+                msg.show();
+                return;
+            }
+            Bundle bundle = new Bundle();
+            bundle.putString("qrcodeNo", scanCode);
+            ActivityUtils.launchActivity(InfoQueryActivity.this,PurchaseInfoActivity.class, bundle);
+        }
+    }
+}

+ 180 - 0
app/src/main/java/com/hw/nativeapp/ui/activity/LoginActivity.java

@@ -0,0 +1,180 @@
+package com.hw.nativeapp.ui.activity;
+
+import android.app.ProgressDialog;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
+import android.os.Bundle;
+import android.os.Handler;
+import android.view.KeyEvent;
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.annotation.Nullable;
+
+import com.alibaba.fastjson.JSONObject;
+import com.blankj.utilcode.util.SPUtils;
+import com.hw.nativeapp.MApplication;
+import com.hw.nativeapp.R;
+import com.hw.nativeapp.config.Contents;
+import com.hw.nativeapp.config.enums.LoginEnum;
+import com.hw.nativeapp.httpnet.ErrorConsumer;
+import com.hw.nativeapp.httpnet.ResponseConsumer;
+import com.hw.nativeapp.httpnet.entity.GenCodeBean;
+import com.hw.nativeapp.httpnet.entity.LoginBean;
+import com.hw.nativeapp.httpnet.entity.LoginRequestBean;
+import com.hw.nativeapp.ui.dialogs.DialogCommon;
+import com.hw.nativeapp.utils.ActivityUtils;
+import com.hw.nativeapp.utils.EncryptUtils;
+import com.hw.nativeapp.utils.ImageUtils;
+import com.hw.nativeapp.utils.MaskUtil;
+import com.hw.nativeapp.utils.RxUtil;
+import com.hw.nativeapp.utils.StringUtils;
+import com.hw.nativeapp.utils.ToastUtils;
+import com.hw.nativeapp.utils.UpgradeUtils;
+import com.xw.repo.XEditText;
+
+import butterknife.BindView;
+import butterknife.OnClick;
+
+
+public class LoginActivity extends BaseActivity implements View.OnClickListener {
+
+
+    private Long exitTemptime = 0L;
+    @BindView(R.id.et_username)
+    XEditText etUsername;
+    @BindView(R.id.et_password)
+    XEditText etPassword;
+    private Toast mToast;
+    private ProgressDialog progressDialog;
+    @Override
+    void initView() {
+//        if (!isLogin()){
+//            UpgradeUtils.upgrade(this);
+//            String cacheStr = SPUtils.getInstance().getString(Contents.SPU_USERLOGININFO_KEY);
+//            if (!StringUtils.isEmpty(cacheStr)){
+//                JSONObject cacheJson  = JSONObject.parseObject(cacheStr);
+//                etUsername.setText(cacheJson.getString("jobNum"));
+//                etPassword.setText(cacheJson.getString("password"));
+//            }
+//        }
+    }
+
+    @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_login);
+    }
+
+    @OnClick({R.id.btn_login})
+    public void onClick(View v){
+        switch (v.getId()){
+            case R.id.btn_login:
+                loginIn();
+                break;
+        }
+    }
+
+
+    private void loginIn(){
+        String jobNum = etUsername.getText().toString();
+        String password = etPassword.getText().toString();
+        if (StringUtils.isEmpty(jobNum)){
+            Toast.makeText(this, "登录用户不能为空", Toast.LENGTH_LONG).show();
+            return;
+        }
+        if (StringUtils.isEmpty(password)){
+            Toast.makeText(this, "登录密码不能为空", Toast.LENGTH_LONG).show();
+            return;
+        }
+        LoginRequestBean requestBean = new LoginRequestBean();
+        try {
+//            requestBean.password  = EncryptUtils.encryptAES2HexString(password.getBytes("utf-8"),
+//                    Contents.AES_KEY.getBytes("utf-8"));
+            requestBean.password  = password;
+            requestBean.jobNum = jobNum;
+        } catch (Exception e) {
+            Toast.makeText(this, "密码加密错误", Toast.LENGTH_LONG).show();
+        }
+        progressDialog = MaskUtil.showProgressDialog( "登录中...", LoginActivity.this);
+        new Handler().postDelayed(() -> {
+            if(progressDialog != null){
+                progressDialog.dismiss();
+            }
+        }, 30000);
+        MApplication.getApiService().pdaLogin( requestBean, System.currentTimeMillis() / 1000)
+                .compose(RxUtil.applyObservableAsync())
+                .subscribe(new ResponseConsumer<LoginBean>() {
+                    @Override
+                    public void onSuccess(LoginBean data) {
+                        if(progressDialog != null){
+                            progressDialog.dismiss();
+                        }
+                        //缓存用户信息
+                        userLoginResult(data, password, jobNum);
+                    }
+
+                    @Override
+                    public void onFailed(int code, String msg) {
+                        if(progressDialog != null){
+                            progressDialog.dismiss();
+                        }
+                    }
+                }, new ErrorConsumer());
+    }
+
+    private void userLoginResult(LoginBean loginBean,  String password, String jobNum){
+        if (loginBean == null){
+            ToastUtils.showLongToast(this, "登录失败,返回数据空");
+            return;
+        }
+        saveUserInfo(loginBean.getJobNum(), password, jobNum);
+        loginSuccess(loginBean);
+    }
+
+    private void loginSuccess(LoginBean data){
+        Toast.makeText(this, "登录成功", Toast.LENGTH_LONG).show();
+        //缓存token登录信息
+        SPUtils.getInstance().put(Contents.SPU_TOKEN_KEY, "Bearer " + data.getAccessToken());
+        ActivityUtils.launchActivity(this, MainActivity.class);
+        ActivityUtils.activityFinish(this, true);
+    }
+
+    private boolean isLogin(){
+        String tokenCache = SPUtils.getInstance().getString(Contents.SPU_TOKEN_KEY);
+        if (StringUtils.isEmpty(tokenCache)){
+            return false;
+        }
+        //TODO: 接口判断用户登录
+        ActivityUtils.launchActivity(this, MainActivity.class);
+        ActivityUtils.activityFinish(this, true);
+        return true;
+    }
+
+    private void saveUserInfo(String jobNum1, String password, String jobNum){
+        JSONObject userinfo = new JSONObject();
+        userinfo.put("jobNum", jobNum);
+        userinfo.put("password", password);
+        SPUtils.getInstance().put(Contents.SPU_USERLOGININFO_KEY, userinfo.toJSONString());
+    }
+
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        if (keyCode == KeyEvent.KEYCODE_BACK &&event.getAction() == KeyEvent.ACTION_DOWN){
+            if(System.currentTimeMillis() - exitTemptime > 2000) {
+                Toast.makeText(this, "请在按一次返回退出", Toast.LENGTH_LONG).show();
+                exitTemptime = System.currentTimeMillis();
+            } else {
+                finish();
+                System.exit(0);
+            }
+            return true;
+        }else if (keyCode == KeyEvent.KEYCODE_HOME){
+            return true;
+        }
+        return super.onKeyDown(keyCode, event);
+    }
+
+}

+ 68 - 0
app/src/main/java/com/hw/nativeapp/ui/activity/MainActivity.java

@@ -0,0 +1,68 @@
+package com.hw.nativeapp.ui.activity;
+import android.os.Bundle;
+import android.os.CountDownTimer;
+import android.view.KeyEvent;
+import android.view.View;
+import android.widget.Toast;
+
+import com.hw.nativeapp.R;
+import com.hw.nativeapp.utils.ActivityUtils;
+
+import butterknife.OnClick;
+
+
+public class MainActivity extends BaseActivity  {
+    public static final Integer COUNTDOWN_TIME = 15000;
+    private CountDownTimer timer;
+
+    private Long exitTemptime = 0L;
+
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_main);
+    }
+    @Override
+    void initView() {
+
+    }
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        if (keyCode == KeyEvent.KEYCODE_BACK &&event.getAction() == KeyEvent.ACTION_DOWN){
+            if(System.currentTimeMillis() - exitTemptime > 2000) {
+                Toast.makeText(this, "请在按一次返回退出", Toast.LENGTH_LONG).show();
+                exitTemptime = System.currentTimeMillis();
+            } else {
+                finish();
+                System.exit(0);
+            }
+            return true;
+        }else if (keyCode == KeyEvent.KEYCODE_HOME){
+            return true;
+        }
+        return super.onKeyDown(keyCode, event);
+    }
+    @Override
+    protected void onStop() {
+        super.onStop();
+    }
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+    }
+
+    @OnClick({R.id.write_off_btn, R.id.history_btn})
+    public void onClick(View v){
+        switch (v.getId()){
+            case R.id.write_off_btn:
+                ActivityUtils.launchActivity(this,InfoQueryActivity.class);
+                break;
+            case R.id.history_btn:
+                Toast msg = Toast.makeText(MainActivity.this, "该功能正在开发中!", Toast.LENGTH_SHORT);
+//                msg.setGravity(Gravity.CENTER, 0, 0);
+                msg.show();
+                break;
+        }
+    }
+}

+ 323 - 0
app/src/main/java/com/hw/nativeapp/ui/activity/PurchaseInfoActivity.java

@@ -0,0 +1,323 @@
+package com.hw.nativeapp.ui.activity;
+
+import android.app.ProgressDialog;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.Handler;
+import android.util.Log;
+import android.view.View;
+import android.widget.CheckBox;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import androidx.annotation.Nullable;
+import androidx.recyclerview.widget.LinearLayoutManager;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.hjq.bar.OnTitleBarListener;
+import com.hjq.bar.TitleBar;
+import com.hw.nativeapp.MApplication;
+import com.hw.nativeapp.R;
+import com.hw.nativeapp.httpnet.ErrorConsumer;
+import com.hw.nativeapp.httpnet.ResponseConsumer;
+import com.hw.nativeapp.httpnet.entity.PageAsk;
+import com.hw.nativeapp.httpnet.entity.handleBean;
+import com.hw.nativeapp.ui.activity.adapters.PurchaseInfoAdapter;
+import com.hw.nativeapp.utils.ActivityUtils;
+import com.hw.nativeapp.utils.MaskUtil;
+import com.hw.nativeapp.utils.RxUtil;
+import com.hw.nativeapp.utils.ToastUtils;
+import com.scwang.smartrefresh.layout.SmartRefreshLayout;
+import com.scwang.smartrefresh.layout.footer.ClassicsFooter;
+import com.scwang.smartrefresh.layout.header.ClassicsHeader;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import butterknife.BindView;
+import butterknife.OnClick;
+
+
+public class PurchaseInfoActivity extends BaseActivity  {
+
+    @BindView(R.id.list_stock)
+    RecyclerView listStock;
+    @BindView(R.id.refreshLayout)
+    SmartRefreshLayout refreshLayout;
+    @BindView(R.id.tx_noDataShow)
+    TextView tx_noDataShow;
+    @BindView(R.id.immediately_btn)
+    TextView immediately_btn;
+
+    @BindView(R.id.all_btn)
+    CheckBox all_btn;
+    @BindView(R.id.txt_btn)
+    TextView txt_btn;
+
+    private TitleBar titleBar;
+
+    private PageAsk pageAsk = new PageAsk();
+    private handleBean operLocation;
+    private PurchaseInfoAdapter adapter;
+
+    private ProgressDialog progressDialog;
+
+    private String qrcodeNo = "";
+    private String idcard = "";
+    private JSONArray viewerList = new JSONArray();
+
+    private JSONArray dataList = new JSONArray();
+    @Override
+    void initView() {
+        titleBar = findViewById(R.id.tb_main_bar);
+        titleBar.setOnTitleBarListener(new OnTitleBarListener() {
+
+            @Override
+            public void onLeftClick(View v) {
+                ActivityUtils.activityFinish(PurchaseInfoActivity.this, true );
+            }
+
+            @Override
+            public void onTitleClick(View v) {
+
+            }
+
+            @Override
+            public void onRightClick(View v) {
+
+            }
+        });
+        getPageTransmitParams();
+        initListView();
+        initLoadData();
+    }
+
+
+    @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_purchase_info);
+    }
+
+    @Override
+    protected void onStart() {
+        super.onStart();
+    }
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+    }
+
+    @OnClick({R.id.immediately_btn, R.id.all_btn, R.id.txt_btn})
+    public void onClick(View v){
+        switch (v.getId()){
+            case R.id.immediately_btn:
+                if(dataList.size() > 0){
+                    orderSubmit();
+                }
+                break;
+            case R.id.all_btn:
+                for (int i = 0; i < dataList.size(); i++) {
+                    dataList.getJSONObject(i).put("checkedStatus", all_btn.isChecked());
+                }
+                setDataList(true);
+                break;
+            case R.id.txt_btn:
+                boolean isChecked = !all_btn.isChecked();
+                for (int i = 0; i < dataList.size(); i++) {
+                    dataList.getJSONObject(i).put("checkedStatus", isChecked);
+                }
+                all_btn.setChecked(isChecked);
+                setDataList(true);
+                break;
+        }
+    }
+    private void setDataList(boolean cleaned){
+        if (dataList != null && !dataList.isEmpty()){
+            List<handleBean> rowbeans = JSONArray.parseArray(JSON.toJSONString(dataList), handleBean.class);
+            reflashLoadData(rowbeans, cleaned);
+            emptyShow(false);
+        }else {
+            emptyShow(true);
+        }
+        reflashFinish();
+    }
+    //获取页面传递参数
+    private void getPageTransmitParams(){
+        Intent transmitIntent = getIntent();
+        qrcodeNo = transmitIntent.getStringExtra("qrcodeNo");
+        idcard = transmitIntent.getStringExtra("idcard");
+    }
+
+    private void reflashFinish(){
+        if (refreshLayout != null){
+            refreshLayout.finishRefresh();
+            refreshLayout.finishLoadMore();
+        }
+    }
+    private void initListView(){
+        //线性布局
+        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(this);
+        linearLayoutManager.setOrientation(LinearLayoutManager.VERTICAL);
+        listStock.setLayoutManager(linearLayoutManager);
+
+        adapter = new PurchaseInfoAdapter(this);
+        adapter.setOnOutBtnClickListerer((bean, position) -> {
+            boolean allStatus = true;
+            for (int i = 0; i < dataList.size(); i++) {
+                if(bean.id.equals(dataList.getJSONObject(i).getString("id"))){
+                    dataList.getJSONObject(i).put("checkedStatus", bean.checkedStatus);
+                }
+                if(!dataList.getJSONObject(i).getBoolean("checkedStatus")) {
+                    allStatus = false;
+                }
+            }
+            all_btn.setChecked(allStatus);
+        });
+
+        listStock.setAdapter(adapter);
+
+        //下拉刷新
+        refreshLayout.setRefreshHeader(new ClassicsHeader(this));
+        //上拉加载
+        refreshLayout.setRefreshFooter(new ClassicsFooter(this));
+        //为下来刷新添加事件
+        refreshLayout.setOnRefreshListener(refreshlayout -> initLoadData());
+        //为上拉下载添加事件
+        refreshLayout.setOnLoadMoreListener(refreshlayout -> {
+            if (pageAsk.pageNum > pageAsk.pageCount){
+                ToastUtils.showLongToast(PurchaseInfoActivity.this, "没有太多数据了");
+                refreshlayout.finishLoadMore();
+            }else{
+                getDataList(false);
+            }
+        });
+    }
+
+    private void initLoadData(){
+        pageAsk.pageNum = 1;
+        pageAsk.pageSize = 20;
+        getDataList(true);
+    }
+
+    private void getDataList(boolean cleaned){
+        Map< String,String> options = new HashMap<>();
+        if(qrcodeNo != null && !qrcodeNo.isEmpty()){
+            options.put("qrcodeNo", qrcodeNo);
+        }
+        if(idcard != null && !idcard.isEmpty()){
+            options.put("idcard", idcard);
+        }
+        MApplication.getApiService().getValidList( options, System.currentTimeMillis() / 1000)
+                .compose(RxUtil.applyObservableAsync())
+                .subscribe(new ResponseConsumer<JSONObject>() {
+                    @Override
+                    public void onSuccess(JSONObject data) {
+                        JSONArray rows = data.getJSONArray("list");
+                        for (int i = 0; i < rows.size(); i++) {
+                            rows.getJSONObject(i).put("checkedStatus", false);
+                        }
+                        dataList = rows;
+                        if(dataList.size() > 0){
+                            immediately_btn.setBackgroundColor(getResources().getColor(R.color.login_bk));
+                        } else {
+                            immediately_btn.setBackgroundColor(getResources().getColor(R.color.gray));
+                        }
+                        if (rows != null && !rows.isEmpty()){
+                            List<handleBean> rowbeans = JSONArray.parseArray(JSON.toJSONString(rows), handleBean.class);
+                            reflashLoadData(rowbeans, cleaned);
+                            emptyShow(false);
+                        }else {
+                            emptyShow(true);
+                        }
+                        reflashFinish();
+                    }
+
+                    @Override
+                    public void onFailed(int code, String msg) {
+                        reflashFinish();
+                    }
+                }, new ErrorConsumer());
+    }
+
+    private void emptyShow(boolean empty){
+        if (empty){
+            tx_noDataShow.setVisibility(View.VISIBLE);
+            refreshLayout.setVisibility(View.GONE);
+        }else{
+            refreshLayout.setVisibility(View.VISIBLE);
+            tx_noDataShow.setVisibility(View.GONE);
+        }
+
+    }
+
+    private void reflashLoadData(List<handleBean> rows, boolean cleared){
+        if (adapter == null){
+            return;
+        }
+        if (cleared){
+            adapter.clearDatas();
+        }
+        adapter.addDatas(rows);
+    }
+
+    // 核销提交
+    private void orderSubmit(){
+        JSONObject options = new  JSONObject();
+        JSONArray listObj = new JSONArray();
+        for (int i = 0; i < dataList.size(); i++) {
+            if(dataList.getJSONObject(i).getBooleanValue("checkedStatus")){
+                listObj.add(dataList.getJSONObject(i));
+            }
+        }
+        if(listObj == null || listObj.size() == 0) {
+            Toast msg = Toast.makeText(this, "请勾选需要核销的数据!", Toast.LENGTH_SHORT);
+//            msg.setGravity(Gravity.CENTER, 0, 0);
+            msg.show();
+            return;
+        }
+        String [] list = new String[listObj.size()];
+        for (int i = 0; i < listObj.size(); i++) {
+            if(listObj.getJSONObject(i).getBooleanValue("checkedStatus")){
+                list[i] = listObj.getJSONObject(i).getString("id");
+            }
+        }
+        options.put("viewerIds", list);
+        progressDialog = MaskUtil.showProgressDialog( "正在提交...", PurchaseInfoActivity.this);
+        new Handler().postDelayed(() -> {
+            if(progressDialog != null){
+                progressDialog.dismiss();
+            }
+        }, 30000);
+        MApplication.getApiService().orderSubmit( options, System.currentTimeMillis() / 1000)
+                .compose(RxUtil.applyObservableAsync())
+                .subscribe(new ResponseConsumer<JSONObject>() {
+                    @Override
+                    public void onSuccess(JSONObject data) {
+                        if(progressDialog != null){
+                            progressDialog.dismiss();
+                        }
+                        if(data.get("wipeStatus") != null && data.getInteger("wipeStatus") == 0) {
+                            ActivityUtils.launchActivity(PurchaseInfoActivity.this,WriteOffSuccessActivity.class);
+                        } else {
+                            Bundle bundle = new Bundle();
+                            bundle.putString("errReason", data.getString("errReason"));
+                            ActivityUtils.launchActivity(PurchaseInfoActivity.this,WriteOffFailActivity.class, bundle);
+                        }
+                    }
+
+                    @Override
+                    public void onFailed(int code, String msg) {
+                        if(progressDialog != null){
+                            progressDialog.dismiss();
+                        }
+                    }
+                }, new ErrorConsumer());
+    }
+
+}

+ 66 - 0
app/src/main/java/com/hw/nativeapp/ui/activity/ScanQRCodeActivity.java

@@ -0,0 +1,66 @@
+package com.hw.nativeapp.ui.activity;
+
+import android.app.Activity;
+import android.os.Bundle;
+import android.util.Log;
+import android.view.KeyEvent;
+
+import androidx.annotation.NonNull;
+
+import com.hw.nativeapp.R;
+import com.journeyapps.barcodescanner.CaptureManager;
+import com.journeyapps.barcodescanner.DecoratedBarcodeView;
+
+
+public class ScanQRCodeActivity extends Activity {
+    private CaptureManager capture;
+    private DecoratedBarcodeView bv_barcode;
+
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_scan_qrcode);
+
+        bv_barcode = (DecoratedBarcodeView) findViewById(R.id.bv_barcode);
+
+        capture = new CaptureManager(this, bv_barcode);
+        capture.initializeFromIntent(getIntent(), savedInstanceState);
+        capture.decode();
+
+    }
+
+    @Override
+    protected void onResume() {
+        super.onResume();
+        capture.onResume();
+    }
+
+    @Override
+    protected void onPause() {
+        super.onPause();
+        capture.onPause();
+    }
+
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+        capture.onDestroy();
+    }
+
+    @Override
+    protected void onSaveInstanceState(Bundle outState) {
+        super.onSaveInstanceState(outState);
+        capture.onSaveInstanceState(outState);
+    }
+
+    @Override
+    public void onRequestPermissionsResult(int requestCode, @NonNull String permissions[], @NonNull int[] grantResults) {
+        capture.onRequestPermissionsResult(requestCode, permissions, grantResults);
+    }
+
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        return bv_barcode.onKeyDown(keyCode, event) || super.onKeyDown(keyCode, event);
+    }
+}

+ 76 - 0
app/src/main/java/com/hw/nativeapp/ui/activity/SplashActivity.java

@@ -0,0 +1,76 @@
+package com.hw.nativeapp.ui.activity;
+
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.os.CountDownTimer;
+import android.view.View;
+import android.widget.TextView;
+
+import androidx.annotation.Nullable;
+
+import com.hw.nativeapp.R;
+
+public class SplashActivity extends Activity implements View.OnClickListener {
+
+
+    public static final Integer COUNTDOWN_TIME = 2000;
+
+    private TextView txJump;
+    private TextView txContentdown;
+    private CountDownTimer timer;
+
+    @Override
+    protected void onCreate(@Nullable Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_splash);
+
+        txJump = findViewById(R.id.tx_jump);
+        txContentdown = findViewById(R.id.tx_contentdown);
+        txJump.setOnClickListener(this);
+
+        startCountDownTimer();
+        jumpToLogin();
+    }
+
+    @SuppressLint("NonConstantResourceId")
+    @Override
+    public void onClick(View v) {
+        int id = v.getId();
+        if (id == R.id.tx_jump) {
+            jumpToLogin();
+        }
+    }
+
+    private void jumpToLogin(){
+        stopCountDownTimer();
+
+        Intent intent = new Intent();
+        intent.setClass(this, LoginActivity.class);
+        startActivity(intent);
+        finish();
+    }
+
+    private void stopCountDownTimer(){
+        if (timer != null){
+            timer.cancel();
+        }
+    }
+
+    private void startCountDownTimer(){
+        timer = new CountDownTimer(COUNTDOWN_TIME, 1000) {
+            @SuppressLint("SetTextI18n")
+            @Override
+            public void onTick(long millisUntilFinished) {
+                txContentdown.setText("倒计时" + millisUntilFinished / 1000 + "s");
+            }
+
+            @Override
+            public void onFinish() {
+                jumpToLogin();
+            }
+        };
+        timer.start();
+    }
+}

+ 61 - 0
app/src/main/java/com/hw/nativeapp/ui/activity/WriteOffFailActivity.java

@@ -0,0 +1,61 @@
+package com.hw.nativeapp.ui.activity;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.TextView;
+
+import com.hjq.bar.TitleBar;
+import com.hw.nativeapp.R;
+
+import butterknife.BindView;
+import butterknife.OnClick;
+
+
+public class WriteOffFailActivity extends BaseActivity  {
+    private TitleBar titleBar;
+
+    private String errReason = "";
+    @BindView(R.id.tx_fail)
+    TextView tx_fail;
+
+    @Override
+    void initView() {
+        titleBar = findViewById(R.id.tb_main_bar);
+        getPageTransmitParams();
+    }
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_write_off_fail);
+    }
+    @Override
+    protected void onStart() {
+        super.onStart();
+    }
+    @Override
+    protected void onStop() {
+        super.onStop();
+    }
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+    }
+    @OnClick({R.id.btn_complete})
+    public void onClick(View v){
+        switch (v.getId()){
+            case R.id.btn_complete:
+                Intent intent = new Intent();
+                intent.setClass(this, MainActivity.class);
+                intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+                startActivity(intent);
+                break;
+        }
+    }
+    //获取页面传递参数
+    private void getPageTransmitParams(){
+        Intent transmitIntent = getIntent();
+        errReason = transmitIntent.getStringExtra("errReason");
+        tx_fail.setText(errReason);
+    }
+}

+ 49 - 0
app/src/main/java/com/hw/nativeapp/ui/activity/WriteOffSuccessActivity.java

@@ -0,0 +1,49 @@
+package com.hw.nativeapp.ui.activity;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+
+import com.hjq.bar.TitleBar;
+import com.hw.nativeapp.R;
+import butterknife.OnClick;
+
+
+public class WriteOffSuccessActivity extends BaseActivity  {
+    private TitleBar titleBar;
+
+    private String errReason = "";
+
+    @Override
+    void initView() {
+        titleBar = findViewById(R.id.tb_main_bar);
+    }
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_write_off_success);
+    }
+    @Override
+    protected void onStart() {
+        super.onStart();
+    }
+    @Override
+    protected void onStop() {
+        super.onStop();
+    }
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+    }
+    @OnClick({R.id.btn_complete})
+    public void onClick(View v){
+        switch (v.getId()){
+            case R.id.btn_complete:
+                Intent intent = new Intent();
+                intent.setClass(this, MainActivity.class);
+                intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+                startActivity(intent);
+                break;
+        }
+    }
+}

+ 82 - 0
app/src/main/java/com/hw/nativeapp/ui/activity/adapters/AftermarketHandleAdapter.java

@@ -0,0 +1,82 @@
+package com.hw.nativeapp.ui.activity.adapters;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.hw.nativeapp.R;
+import com.hw.nativeapp.httpnet.entity.StockOutBean;
+import com.hw.nativeapp.ui.activity.holders.AftermarketHandleHolder;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class AftermarketHandleAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>{
+
+
+    private Context mContext;
+    private List<StockOutBean> mDatas ;
+    private OnBtnClickListerer mOnReplenishBtnClickListerer;
+    private OnBtnClickListerer mOnOutBtnClickListerer;
+
+
+    public AftermarketHandleAdapter(Context context) {
+        mContext = context;
+        mDatas = new ArrayList<>();
+    }
+
+    public void addDatas(List<StockOutBean> datas){
+        if (mDatas == null){
+            mDatas = new ArrayList<>();
+        }
+        mDatas.addAll(datas);
+        notifyDataSetChanged();
+    }
+
+    public void clearDatas(){
+        if (mDatas != null){
+            mDatas.clear();
+        }
+    }
+
+    @NonNull
+    @Override
+    public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+        View itemView = LayoutInflater.from(mContext).inflate(R.layout.item_aftermarket_1, parent, false);
+        return new AftermarketHandleHolder(itemView);
+    }
+
+    @Override
+    public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
+        AftermarketHandleHolder normalHolder = (AftermarketHandleHolder) holder;
+        StockOutBean detailBean = mDatas.get(position);
+        if (detailBean == null){
+            return;
+        }
+        normalHolder.tx_outOrderNum.setText(detailBean.orderNumber);
+
+
+        normalHolder.btn_outStock.setOnClickListener(v -> {
+            if (mOnOutBtnClickListerer != null){
+                mOnOutBtnClickListerer.onClick(detailBean, position);
+            }
+        });
+    }
+
+    @Override
+    public int getItemCount() {
+        return mDatas.size();
+    }
+
+    public void setOnReplenishBtnClickListerer(OnBtnClickListerer onBtnClickListerer) {
+        this.mOnReplenishBtnClickListerer = onBtnClickListerer;
+    }
+
+    public interface OnBtnClickListerer{
+        void onClick(StockOutBean bean, int position);
+    }
+}

+ 80 - 0
app/src/main/java/com/hw/nativeapp/ui/activity/adapters/AftermarketOneAdapter.java

@@ -0,0 +1,80 @@
+package com.hw.nativeapp.ui.activity.adapters;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.hw.nativeapp.R;
+import com.hw.nativeapp.httpnet.entity.WarehousingDetailsBean;
+import com.hw.nativeapp.httpnet.entity.handleBean;
+import com.hw.nativeapp.ui.activity.holders.AftermarketOneHolder;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class AftermarketOneAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>{
+
+
+    private Context mContext;
+    private List<handleBean> mDatas ;
+    private OnBtnClickListerer mOnReplenishBtnClickListerer;
+    private OnBtnClickListerer mOnOutBtnClickListerer;
+
+
+    public AftermarketOneAdapter(Context context) {
+        mContext = context;
+        mDatas = new ArrayList<>();
+    }
+
+    public void addDatas(List<handleBean> datas){
+        if (mDatas == null){
+            mDatas = new ArrayList<>();
+        }
+        mDatas.addAll(datas);
+        notifyDataSetChanged();
+    }
+
+    public void clearDatas(){
+        if (mDatas != null){
+            mDatas.clear();
+        }
+    }
+
+    @NonNull
+    @Override
+    public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+        View itemView = LayoutInflater.from(mContext).inflate(R.layout.item_aftermarket_1, parent, false);
+        return new AftermarketOneHolder(itemView);
+    }
+
+    @Override
+    public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
+        AftermarketOneHolder normalHolder = (AftermarketOneHolder) holder;
+        handleBean detailBean = mDatas.get(position);
+        if (detailBean == null){
+            return;
+        }
+
+
+        normalHolder.btn_handle.setOnClickListener(v -> {
+            mOnOutBtnClickListerer.onClick(detailBean, position);
+        });
+    }
+
+    @Override
+    public int getItemCount() {
+        return mDatas.size();
+    }
+
+    public void setOnOutBtnClickListerer(OnBtnClickListerer onBtnClickListerer) {
+        this.mOnOutBtnClickListerer = onBtnClickListerer;
+    }
+
+    public interface OnBtnClickListerer{
+        void onClick(handleBean bean, int position);
+    }
+}

+ 90 - 0
app/src/main/java/com/hw/nativeapp/ui/activity/adapters/PurchaseInfoAdapter.java

@@ -0,0 +1,90 @@
+package com.hw.nativeapp.ui.activity.adapters;
+
+import android.content.Context;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.hw.nativeapp.R;
+import com.hw.nativeapp.httpnet.entity.handleBean;
+import com.hw.nativeapp.ui.activity.holders.PurchaseInfoHolder;
+import com.hw.nativeapp.ui.activity.holders.TicketPurchaseHolder;
+import com.hw.nativeapp.utils.StringUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class PurchaseInfoAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>{
+
+
+    private Context mContext;
+    private List<handleBean> mDatas ;
+    private OnBtnClickListerer mOnReplenishBtnClickListerer;
+    private OnBtnClickListerer mOnOutBtnClickListerer;
+
+
+    public PurchaseInfoAdapter(Context context) {
+        mContext = context;
+        mDatas = new ArrayList<>();
+    }
+
+    public void addDatas(List<handleBean> datas){
+        if (mDatas == null){
+            mDatas = new ArrayList<>();
+        }
+        mDatas.addAll(datas);
+        notifyDataSetChanged();
+    }
+
+    public void clearDatas(){
+        if (mDatas != null){
+            mDatas.clear();
+        }
+    }
+
+    @NonNull
+    @Override
+    public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+        View itemView = LayoutInflater.from(mContext).inflate(R.layout.item_purchase_info, parent, false);
+        return new PurchaseInfoHolder(itemView);
+    }
+
+    @Override
+    public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
+        PurchaseInfoHolder normalHolder = (PurchaseInfoHolder) holder;
+        handleBean detailBean = mDatas.get(position);
+        if (detailBean == null){
+            return;
+        }
+        normalHolder.tx_name.setText(detailBean.name);
+        normalHolder.tx_status.setText("待核销");
+        normalHolder.tx_date.setText(detailBean.performDate);
+        String startTime = detailBean.performStart.indexOf(" ") > -1 ? detailBean.performStart.split(" ")[1] : "";
+        String endTime = detailBean.performEnd.indexOf(" ") > -1 ? detailBean.performEnd.split(" ")[1] : "";
+        normalHolder.tx_time.setText(startTime +  "--" + endTime);
+        normalHolder.tx_seat_name.setText(detailBean.seatName);
+        normalHolder.tx_seat_type.setText(detailBean.seatTypeName);
+        normalHolder.cb_check.setChecked(detailBean.checkedStatus);
+        normalHolder.cb_check.setOnClickListener(v -> {
+            detailBean.checkedStatus =  normalHolder.cb_check.isChecked();
+            mOnOutBtnClickListerer.onClick(detailBean, position);
+        });
+    }
+
+    @Override
+    public int getItemCount() {
+        return mDatas.size();
+    }
+
+    public void setOnOutBtnClickListerer(OnBtnClickListerer onBtnClickListerer) {
+        this.mOnOutBtnClickListerer = onBtnClickListerer;
+    }
+
+    public interface OnBtnClickListerer{
+        void onClick(handleBean bean, int position);
+    }
+}

+ 79 - 0
app/src/main/java/com/hw/nativeapp/ui/activity/adapters/TakeUserInfoAdapter.java

@@ -0,0 +1,79 @@
+package com.hw.nativeapp.ui.activity.adapters;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.hw.nativeapp.R;
+import com.hw.nativeapp.httpnet.entity.handleBean;
+import com.hw.nativeapp.ui.activity.holders.PurchaseInfoHolder;
+import com.hw.nativeapp.ui.activity.holders.TakeUserInfoHolder;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class TakeUserInfoAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>{
+
+
+    private Context mContext;
+    private List<handleBean> mDatas ;
+    private OnBtnClickListerer mOnReplenishBtnClickListerer;
+    private OnBtnClickListerer mOnOutBtnClickListerer;
+
+
+    public TakeUserInfoAdapter(Context context) {
+        mContext = context;
+        mDatas = new ArrayList<>();
+    }
+
+    public void addDatas(List<handleBean> datas){
+        if (mDatas == null){
+            mDatas = new ArrayList<>();
+        }
+        mDatas.addAll(datas);
+        notifyDataSetChanged();
+    }
+
+    public void clearDatas(){
+        if (mDatas != null){
+            mDatas.clear();
+        }
+    }
+
+    @NonNull
+    @Override
+    public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+        View itemView = LayoutInflater.from(mContext).inflate(R.layout.item_take_user_info, parent, false);
+        return new TakeUserInfoHolder(itemView);
+    }
+
+    @Override
+    public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
+        TakeUserInfoHolder normalHolder = (TakeUserInfoHolder) holder;
+        handleBean detailBean = mDatas.get(position);
+        if (detailBean == null){
+            return;
+        }
+
+//        normalHolder.purchase_btn.setOnClickListener(v -> {
+//            mOnOutBtnClickListerer.onClick(detailBean, position);
+//        });
+    }
+
+    @Override
+    public int getItemCount() {
+        return mDatas.size();
+    }
+
+    public void setOnOutBtnClickListerer(OnBtnClickListerer onBtnClickListerer) {
+        this.mOnOutBtnClickListerer = onBtnClickListerer;
+    }
+
+    public interface OnBtnClickListerer{
+        void onClick(handleBean bean, int position);
+    }
+}

+ 99 - 0
app/src/main/java/com/hw/nativeapp/ui/activity/adapters/TicketCollectionAdapter.java

@@ -0,0 +1,99 @@
+package com.hw.nativeapp.ui.activity.adapters;
+
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.provider.MediaStore;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.ImageView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.hw.nativeapp.R;
+import com.hw.nativeapp.httpnet.entity.handleBean;
+import com.hw.nativeapp.ui.activity.holders.AftermarketOneHolder;
+import com.hw.nativeapp.ui.activity.holders.TicketCollectionHolder;
+import com.hw.nativeapp.utils.ImageUtils;
+import com.squareup.picasso.Picasso;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.time.Instant;
+import java.util.ArrayList;
+import java.util.List;
+
+public class TicketCollectionAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>{
+
+
+    private Context mContext;
+    private List<handleBean> mDatas ;
+    private OnBtnClickListerer mOnReplenishBtnClickListerer;
+    private OnBtnClickListerer mOnOutBtnClickListerer;
+    private Instant Glide;
+
+
+    public TicketCollectionAdapter(Context context) {
+        mContext = context;
+        mDatas = new ArrayList<>();
+    }
+
+    public void addDatas(List<handleBean> datas){
+        if (mDatas == null){
+            mDatas = new ArrayList<>();
+        }
+        mDatas.addAll(datas);
+        notifyDataSetChanged();
+    }
+
+    public void clearDatas(){
+        if (mDatas != null){
+            mDatas.clear();
+        }
+    }
+
+    @NonNull
+    @Override
+    public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+        View itemView = LayoutInflater.from(mContext).inflate(R.layout.item_ticket_collection, parent, false);
+        return new TicketCollectionHolder(itemView);
+    }
+
+    @Override
+    public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
+        TicketCollectionHolder normalHolder = (TicketCollectionHolder) holder;
+        handleBean detailBean = mDatas.get(position);
+        if (detailBean == null){
+            return;
+        }
+
+        normalHolder.iv_performName.setText(detailBean.performName);
+        normalHolder.iv_performDate.setText(detailBean.performDate + " " + detailBean.performStart.substring(11, 16) + "-" + detailBean.performEnd.substring(11, 16));
+        normalHolder.cb_check.setChecked(detailBean.checkedStatus);
+        normalHolder.iv_goodsName.setText(detailBean.goodsName);
+//        normalHolder.iv_performStart_performEnd.setText("场次 " + detailBean.performStart.substring(11, 16) + "-" + detailBean.performEnd.substring(11, 16));
+        normalHolder.iv_seat.setText(detailBean.seatName + "(" +  detailBean.seatTypeName  +")");
+        Picasso.with(mContext).load(detailBean.showImg).into(normalHolder.iv_showImg);
+        normalHolder.iv_name.setText(detailBean.name + " " +  detailBean.idcard);
+        normalHolder.cb_check.setOnClickListener(v -> {
+            detailBean.checkedStatus =  normalHolder.cb_check.isChecked();
+            mOnOutBtnClickListerer.onClick(detailBean, position);
+        });
+    }
+
+    @Override
+    public int getItemCount() {
+        return mDatas.size();
+    }
+
+    public void setOnOutBtnClickListerer(OnBtnClickListerer onBtnClickListerer) {
+        this.mOnOutBtnClickListerer = onBtnClickListerer;
+    }
+
+    public interface OnBtnClickListerer{
+        void onClick(handleBean bean, int position);
+    }
+}

+ 85 - 0
app/src/main/java/com/hw/nativeapp/ui/activity/adapters/TicketPurchaseAdapter.java

@@ -0,0 +1,85 @@
+package com.hw.nativeapp.ui.activity.adapters;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.hw.nativeapp.R;
+import com.hw.nativeapp.httpnet.entity.handleBean;
+import com.hw.nativeapp.ui.activity.holders.TicketCollectionHolder;
+import com.hw.nativeapp.ui.activity.holders.TicketPurchaseHolder;
+import com.squareup.picasso.Picasso;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class TicketPurchaseAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder>{
+
+
+    private Context mContext;
+    private List<handleBean> mDatas ;
+    private OnBtnClickListerer mOnReplenishBtnClickListerer;
+    private OnBtnClickListerer mOnOutBtnClickListerer;
+
+
+    public TicketPurchaseAdapter(Context context) {
+        mContext = context;
+        mDatas = new ArrayList<>();
+    }
+
+    public void addDatas(List<handleBean> datas){
+        if (mDatas == null){
+            mDatas = new ArrayList<>();
+        }
+        mDatas.addAll(datas);
+        notifyDataSetChanged();
+    }
+
+    public void clearDatas(){
+        if (mDatas != null){
+            mDatas.clear();
+        }
+    }
+
+    @NonNull
+    @Override
+    public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+        View itemView = LayoutInflater.from(mContext).inflate(R.layout.item_ticket_purchase, parent, false);
+        return new TicketPurchaseHolder(itemView);
+    }
+
+    @Override
+    public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
+        TicketPurchaseHolder normalHolder = (TicketPurchaseHolder) holder;
+        handleBean detailBean = mDatas.get(position);
+        if (detailBean == null){
+            return;
+        }
+        normalHolder.ip_name.setText(detailBean.name);
+        Picasso.with(mContext).load(detailBean.showImg).into(normalHolder.ip_showImg);
+        normalHolder.purchase_btn.setOnClickListener(v -> {
+            mOnOutBtnClickListerer.onClick(detailBean, position);
+        });
+
+        normalHolder.purchase_btn.setOnClickListener(v -> {
+            mOnOutBtnClickListerer.onClick(detailBean, position);
+        });
+    }
+
+    @Override
+    public int getItemCount() {
+        return mDatas.size();
+    }
+
+    public void setOnOutBtnClickListerer(OnBtnClickListerer onBtnClickListerer) {
+        this.mOnOutBtnClickListerer = onBtnClickListerer;
+    }
+
+    public interface OnBtnClickListerer{
+        void onClick(handleBean bean, int position);
+    }
+}

+ 29 - 0
app/src/main/java/com/hw/nativeapp/ui/activity/holders/AftermarketHandleHolder.java

@@ -0,0 +1,29 @@
+package com.hw.nativeapp.ui.activity.holders;
+
+import android.view.View;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.hw.nativeapp.R;
+
+public class AftermarketHandleHolder extends RecyclerView.ViewHolder{
+
+    public TextView tx_outOrderNum;
+    public TextView btn_replenish;
+    public TextView tx_saleOrderNum;
+    public TextView tx_customerName;
+    public TextView tx_stockName;
+    public TextView tx_stockOutType;
+    public TextView tx_orderTime;
+    public TextView tx_salesman;
+    public TextView btn_outStock;
+//    public TextView tx_stockOutPattern;
+
+    public AftermarketHandleHolder(@NonNull View itemView) {
+        super(itemView);
+
+//        tx_stockOutPattern = (TextView) itemView.findViewById(R.id.tx_stockOutPattern);
+    }
+}

+ 30 - 0
app/src/main/java/com/hw/nativeapp/ui/activity/holders/AftermarketOneHolder.java

@@ -0,0 +1,30 @@
+package com.hw.nativeapp.ui.activity.holders;
+
+import android.view.View;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.hw.nativeapp.R;
+
+public class AftermarketOneHolder extends RecyclerView.ViewHolder{
+
+    public TextView tx_orderId;
+    public TextView tx_signNum;
+    public TextView tx_afterReasonName;
+    public TextView tx_createBy;
+    public TextView tx_orderTime;
+    public TextView btn_handle;
+
+    public AftermarketOneHolder(@NonNull View itemView) {
+        super(itemView);
+
+        tx_orderId = (TextView) itemView.findViewById(R.id.tx_orderId);
+        tx_signNum = (TextView) itemView.findViewById(R.id.tx_signNum);
+        tx_afterReasonName = (TextView) itemView.findViewById(R.id.tx_afterReasonName);
+        tx_createBy = (TextView) itemView.findViewById(R.id.tx_createBy);
+        tx_orderTime = (TextView) itemView.findViewById(R.id.tx_orderTime);
+        btn_handle = (TextView) itemView.findViewById(R.id.btn_handle);
+    }
+}

+ 34 - 0
app/src/main/java/com/hw/nativeapp/ui/activity/holders/PurchaseInfoHolder.java

@@ -0,0 +1,34 @@
+package com.hw.nativeapp.ui.activity.holders;
+
+import android.view.View;
+import android.widget.CheckBox;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.hw.nativeapp.R;
+
+public class PurchaseInfoHolder extends RecyclerView.ViewHolder{
+
+    public TextView tx_name;
+    public TextView tx_status;
+    public TextView tx_date;
+    public TextView tx_time;
+    public TextView tx_seat_name;
+    public TextView tx_seat_type;
+    public CheckBox cb_check;
+
+    public PurchaseInfoHolder(@NonNull View itemView) {
+        super(itemView);
+
+        tx_name = (TextView) itemView.findViewById(R.id.tx_name);
+        tx_status = (TextView) itemView.findViewById(R.id.tx_status);
+        tx_date = (TextView) itemView.findViewById(R.id.tx_date);
+        tx_time = (TextView) itemView.findViewById(R.id.tx_time);
+        tx_seat_name = (TextView) itemView.findViewById(R.id.tx_seat_name);
+        tx_seat_type = (TextView) itemView.findViewById(R.id.tx_seat_type);
+
+        cb_check = (CheckBox) itemView.findViewById(R.id.cb_check);
+    }
+}

+ 28 - 0
app/src/main/java/com/hw/nativeapp/ui/activity/holders/TakeUserInfoHolder.java

@@ -0,0 +1,28 @@
+package com.hw.nativeapp.ui.activity.holders;
+
+import android.view.View;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+public class TakeUserInfoHolder extends RecyclerView.ViewHolder{
+
+    public TextView tx_orderId;
+    public TextView tx_signNum;
+    public TextView tx_afterReasonName;
+    public TextView tx_createBy;
+    public TextView tx_orderTime;
+    public TextView purchase_btn;
+
+    public TakeUserInfoHolder(@NonNull View itemView) {
+        super(itemView);
+
+//        tx_orderId = (TextView) itemView.findViewById(R.id.tx_orderId);
+//        tx_signNum = (TextView) itemView.findViewById(R.id.tx_signNum);
+//        tx_afterReasonName = (TextView) itemView.findViewById(R.id.tx_afterReasonName);
+//        tx_createBy = (TextView) itemView.findViewById(R.id.tx_createBy);
+//        tx_orderTime = (TextView) itemView.findViewById(R.id.tx_orderTime);
+//        purchase_btn = (TextView) itemView.findViewById(R.id.purchase_btn);
+    }
+}

+ 36 - 0
app/src/main/java/com/hw/nativeapp/ui/activity/holders/TicketCollectionHolder.java

@@ -0,0 +1,36 @@
+package com.hw.nativeapp.ui.activity.holders;
+
+import android.view.View;
+import android.widget.CheckBox;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.hw.nativeapp.R;
+
+public class TicketCollectionHolder extends RecyclerView.ViewHolder{
+
+    public TextView iv_performName;
+    public TextView iv_performDate;
+//    public TextView iv_performStart_performEnd;
+    public TextView iv_seat;
+    public TextView iv_name;
+    public ImageView iv_showImg;
+    public CheckBox cb_check;
+    public TextView iv_goodsName;
+
+    public TicketCollectionHolder(@NonNull View itemView) {
+        super(itemView);
+
+        iv_performName = (TextView) itemView.findViewById(R.id.iv_performName);
+        iv_performDate = (TextView) itemView.findViewById(R.id.iv_performDate);
+//        iv_performStart_performEnd = (TextView) itemView.findViewById(R.id.iv_performStart_performEnd);
+        iv_seat = (TextView) itemView.findViewById(R.id.iv_seat);
+        iv_name = (TextView) itemView.findViewById(R.id.iv_name);
+        cb_check = (CheckBox) itemView.findViewById(R.id.cb_check);
+        iv_showImg = (ImageView) itemView.findViewById(R.id.iv_showImg);
+        iv_goodsName = (TextView) itemView.findViewById(R.id.iv_goodsName);
+    }
+}

+ 25 - 0
app/src/main/java/com/hw/nativeapp/ui/activity/holders/TicketPurchaseHolder.java

@@ -0,0 +1,25 @@
+package com.hw.nativeapp.ui.activity.holders;
+
+import android.view.View;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.hw.nativeapp.R;
+
+public class TicketPurchaseHolder extends RecyclerView.ViewHolder{
+
+    public ImageView ip_showImg;
+    public TextView ip_name;
+    public TextView purchase_btn;
+
+    public TicketPurchaseHolder(@NonNull View itemView) {
+        super(itemView);
+
+        ip_showImg = (ImageView) itemView.findViewById(R.id.ip_showImg);
+        ip_name = (TextView) itemView.findViewById(R.id.ip_name);
+        purchase_btn = (TextView) itemView.findViewById(R.id.purchase_btn);
+    }
+}

+ 102 - 0
app/src/main/java/com/hw/nativeapp/ui/dialogs/DialogCommon.java

@@ -0,0 +1,102 @@
+package com.hw.nativeapp.ui.dialogs;
+
+import android.app.Dialog;
+import android.content.Context;
+import android.graphics.Color;
+import android.graphics.drawable.ColorDrawable;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.Window;
+import android.widget.EditText;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.hw.nativeapp.R;
+
+
+public class DialogCommon extends Dialog {
+
+    public DialogCommon(Context mcontext) {
+        super(mcontext);
+    }
+
+    public DialogCommon(Context context, int themeResId){
+        super(context, themeResId);
+    }
+
+    public static class Builder {
+        private Context context;
+        private String message;//提示消息
+        private String negative_text;//消极的
+        private String positive_text;//积极的
+        private boolean negativeShow = false;
+        private boolean positiveShow = false;
+        private OnClickListener negativeListener;//消极的监听
+        private OnClickListener positiveListener;//积极的监听
+
+        public Builder(Context context) {
+            this.context = context;
+        }
+
+
+        public Builder setMessage(String message) {
+            if (message == null) {
+                this.message = "您没有填写提示信息哦";
+            }
+            this.message = message;
+            return this;
+        }
+
+        public Builder setNegativeButton(String negative_text, OnClickListener negativeListener) {
+            if (negative_text == null) {
+                this.negative_text = "取消";
+            }
+            this.negative_text = negative_text;
+            this.negativeListener = negativeListener;
+            this.negativeShow = true;
+            return this;
+        }
+
+        public Builder setPositionButton(String positive_text, OnClickListener positiveListener) {
+            if (positive_text == null) {
+                this.positive_text = "确定";
+            }
+            this.positive_text = positive_text;
+            this.positiveListener = positiveListener;
+            this.positiveShow = true;
+            return this;
+        }
+
+
+        private TextView txContent;
+        private TextView btnupEnter;
+        private TextView btnupCancel;
+
+
+        public DialogCommon create() {
+            final DialogCommon dialog = new DialogCommon(context);
+            View view = LayoutInflater.from(context).inflate(R.layout.dialog_common, null);
+            dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);//加上这一句,取消原来的标题栏,没加这句之前,发现在三星的手机上会有一条蓝色的线
+            dialog.setContentView(view, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
+            dialog.setCancelable(false);
+            txContent = (TextView) view.findViewById(R.id.tx_content);
+            btnupEnter = (TextView) view.findViewById(R.id.btnup_enter);
+            btnupCancel = (TextView) view.findViewById(R.id.btnup_cancel);
+
+            txContent.setText(message);
+            btnupCancel.setText(negative_text);
+            btnupEnter.setText(positive_text);
+            dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
+            btnupCancel.setOnClickListener(v -> negativeListener.onClick(dialog, Dialog.BUTTON_NEGATIVE));
+            btnupEnter.setOnClickListener(v -> positiveListener.onClick(dialog, Dialog.BUTTON_POSITIVE));
+            if (negativeShow){
+                btnupCancel.setVisibility(View.VISIBLE);
+            }
+            if (positiveShow){
+                btnupEnter.setVisibility(View.VISIBLE);
+            }
+            return dialog;
+        }
+    }
+}

+ 146 - 0
app/src/main/java/com/hw/nativeapp/ui/dialogs/DialogDropDown.java

@@ -0,0 +1,146 @@
+package com.hw.nativeapp.ui.dialogs;
+
+import android.app.Dialog;
+import android.content.Context;
+import android.graphics.Color;
+import android.graphics.drawable.ColorDrawable;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.Window;
+import android.widget.AdapterView;
+import android.widget.ArrayAdapter;
+import android.widget.LinearLayout;
+import android.widget.Spinner;
+import android.widget.TextView;
+
+import com.hw.nativeapp.R;
+import com.hw.nativeapp.httpnet.entity.RelatiInfoBean;
+
+import java.util.List;
+
+
+public class DialogDropDown extends Dialog {
+
+    public DialogDropDown(Context mcontext) {
+        super(mcontext);
+    }
+
+    public static class Builder {
+        private Context context;
+        private String negative_text;//消极的
+        private String positive_text;//积极的
+        private boolean negativeShow = false;
+        private boolean positiveShow = false;
+        private OnClickListener negativeListener;//消极的监听
+        private OnClickListener positiveListener;//积极的监听
+
+        private List<RelatiInfoBean> dataList;
+        private String relatiId;//物料理化关系id
+        private Integer relatiValue;//物料理化关系值
+
+        public Builder(Context context) {
+            this.context = context;
+        }
+
+        public Builder setData(List<RelatiInfoBean> data) {
+            dataList = data;
+            return this;
+        }
+
+        public String getRelatiId(){
+            if (relatiId != null){
+                return relatiId;
+            }
+            return "";
+        }
+        public Integer getRelatiValue(){
+            if (relatiValue != null){
+                return relatiValue;
+            }
+            return 0;
+        }
+
+        public DialogDropDown.Builder setNegativeButton(String negative_text, OnClickListener negativeListener) {
+            if (negative_text == null) {
+                this.negative_text = "取消";
+            }
+            this.negative_text = negative_text;
+            this.negativeListener = negativeListener;
+            this.negativeShow = true;
+            return this;
+        }
+
+        public DialogDropDown.Builder setPositionButton(String positive_text, OnClickListener positiveListener) {
+            if (positive_text == null) {
+                this.positive_text = "确定";
+            }
+            this.positive_text = positive_text;
+            this.positiveListener = positiveListener;
+            this.positiveShow = true;
+            return this;
+        }
+
+        private Spinner m_spiModel;
+        private TextView btnupEnter;
+        private TextView btnupCancel;
+
+
+        public DialogDropDown create() {
+            final DialogDropDown dialog = new DialogDropDown(context);
+            View view = LayoutInflater.from(context).inflate(R.layout.dialog_drop_down, null);
+            dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);//加上这一句,取消原来的标题栏,没加这句之前,发现在三星的手机上会有一条蓝色的线
+            dialog.setContentView(view, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
+            m_spiModel = (Spinner) view.findViewById(R.id.patrol_relati);
+
+            btnupEnter = (TextView) view.findViewById(R.id.btn_quantity_enter);
+            btnupCancel = (TextView) view.findViewById(R.id.btn_quantity_cancel);
+
+
+            String strModel_init="";
+            for(int i=0;i<dataList.size();i++) {
+                if(i < dataList.size()) {
+                    strModel_init += dataList.get(i).relatiName + ",";
+                } else {
+                    strModel_init += dataList.get(i).relatiName;
+                }
+            }
+            String[] arrModel =strModel_init.split(",");//转换 数组
+            ArrayAdapter<String> adapter;//数组 配置器 下拉菜单赋值用
+            //将可选内容与ArrayAdapter连接起来
+            adapter = new ArrayAdapter<String>(this.context,android.R.layout.simple_spinner_item,arrModel);
+            //设置下拉列表的风格
+            adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+            m_spiModel.setAdapter(adapter);//将adapter 添加到spinner中
+            m_spiModel.setVisibility(View.VISIBLE);//设置默认值
+            m_spiModel.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {//选择item的选择点击监听事件
+                public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
+                    for(int i=0;i<dataList.size();i++) {
+                        if(i == position){
+                            relatiId = dataList.get(i).relatiId;
+                            relatiValue = dataList.get(i).relatiValue;
+                        }
+                    }
+                }
+
+                @Override
+                public void onNothingSelected(AdapterView<?> parent) {
+
+                }
+            });
+
+            btnupCancel.setText(negative_text);
+            btnupEnter.setText(positive_text);
+            dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
+            btnupCancel.setOnClickListener(v -> negativeListener.onClick(dialog, Dialog.BUTTON_NEGATIVE));
+            btnupEnter.setOnClickListener(v -> positiveListener.onClick(dialog, Dialog.BUTTON_POSITIVE));
+            if (negativeShow){
+                btnupCancel.setVisibility(View.VISIBLE);
+            }
+            if (positiveShow){
+                btnupEnter.setVisibility(View.VISIBLE);
+            }
+            return dialog;
+        }
+    }
+}

+ 110 - 0
app/src/main/java/com/hw/nativeapp/ui/dialogs/DialogInputDevice.java

@@ -0,0 +1,110 @@
+package com.hw.nativeapp.ui.dialogs;
+
+import android.app.Dialog;
+import android.content.Context;
+import android.graphics.Color;
+import android.graphics.drawable.ColorDrawable;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.Window;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.hw.nativeapp.R;
+import com.hw.nativeapp.utils.StringUtils;
+
+
+public class DialogInputDevice extends Dialog {
+
+    public DialogInputDevice(Context mcontext) {
+        super(mcontext);
+    }
+
+    public DialogInputDevice(Context context, int themeResId){
+        super(context, themeResId);
+    }
+
+    public static class Builder {
+        private Context context;
+        private String title;//抬头信息
+        private String negative_text;//消极的
+        private String positive_text;//积极的
+        private boolean negativeShow = false;
+        private boolean positiveShow = false;
+        private OnClickListener negativeListener;//消极的监听
+        private OnClickListener positiveListener;//积极的监听
+
+        public Builder(Context context) {
+            this.context = context;
+        }
+
+
+        public Builder setTitle(String title) {
+            if (StringUtils.isEmpty(title)) {
+                this.title = "温馨提示";
+            }
+            this.title = title;
+            return this;
+        }
+
+        public String getNewContent(){
+            if (txContent != null){
+                return txContent.getText().toString();
+            }
+            return "";
+        }
+
+        public Builder setNegativeButton(String negative_text, OnClickListener negativeListener) {
+            if (negative_text == null) {
+                this.negative_text = "取消";
+            }
+            this.negative_text = negative_text;
+            this.negativeListener = negativeListener;
+            this.negativeShow = true;
+            return this;
+        }
+
+        public Builder setPositionButton(String positive_text, OnClickListener positiveListener) {
+            if (positive_text == null) {
+                this.positive_text = "确定";
+            }
+            this.positive_text = positive_text;
+            this.positiveListener = positiveListener;
+            this.positiveShow = true;
+            return this;
+        }
+
+
+        private TextView txContent;
+        private TextView btnupEnter;
+        private TextView btnupCancel;
+        private TextView txTitle;
+
+
+        public DialogInputDevice create() {
+            final DialogInputDevice dialog = new DialogInputDevice(context);
+            View view = LayoutInflater.from(context).inflate(R.layout.dialog_input_device, null);
+            dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);//加上这一句,取消原来的标题栏,没加这句之前,发现在三星的手机上会有一条蓝色的线
+            dialog.setContentView(view, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
+            txContent = (TextView) view.findViewById(R.id.et_modifycontent);
+            btnupEnter = (TextView) view.findViewById(R.id.btnup_enter);
+            btnupCancel = (TextView) view.findViewById(R.id.btnup_cancel);
+            txTitle = (TextView) view.findViewById(R.id.tx_title);
+
+            txTitle.setText(title);
+            btnupCancel.setText(negative_text);
+            btnupEnter.setText(positive_text);
+            dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
+            btnupCancel.setOnClickListener(v -> negativeListener.onClick(dialog, Dialog.BUTTON_NEGATIVE));
+            btnupEnter.setOnClickListener(v -> positiveListener.onClick(dialog, Dialog.BUTTON_POSITIVE));
+            if (negativeShow){
+                btnupCancel.setVisibility(View.VISIBLE);
+            }
+            if (positiveShow){
+                btnupEnter.setVisibility(View.VISIBLE);
+            }
+            return dialog;
+        }
+    }
+}

+ 122 - 0
app/src/main/java/com/hw/nativeapp/ui/dialogs/DialogModifyText.java

@@ -0,0 +1,122 @@
+package com.hw.nativeapp.ui.dialogs;
+
+import android.app.Dialog;
+import android.content.Context;
+import android.graphics.Color;
+import android.graphics.drawable.ColorDrawable;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.Window;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.hw.nativeapp.R;
+import com.hw.nativeapp.utils.StringUtils;
+
+
+public class DialogModifyText extends Dialog {
+
+    public DialogModifyText(Context mcontext) {
+        super(mcontext);
+    }
+
+    public DialogModifyText(Context context, int themeResId){
+        super(context, themeResId);
+    }
+
+    public static class Builder {
+        private Context context;
+        private String title;//抬头信息
+        private String oldcontent;//修改前旧数据
+        private String negative_text;//消极的
+        private String positive_text;//积极的
+        private boolean negativeShow = false;
+        private boolean positiveShow = false;
+        private OnClickListener negativeListener;//消极的监听
+        private OnClickListener positiveListener;//积极的监听
+
+        public Builder(Context context) {
+            this.context = context;
+        }
+
+
+        public Builder setTitle(String title) {
+            if (StringUtils.isEmpty(title)) {
+                this.title = "温馨提示";
+            }
+            this.title = title;
+            return this;
+        }
+
+        public Builder setOldText(String oldtxt) {
+            if (StringUtils.isEmpty(oldtxt)) {
+                this.oldcontent = "";
+            }
+            this.oldcontent = oldtxt;
+            return this;
+        }
+
+        public String getNewContent(){
+            if (txContent != null){
+                return txContent.getText().toString();
+            }
+            return "";
+        }
+
+        public Builder setNegativeButton(String negative_text, OnClickListener negativeListener) {
+            if (negative_text == null) {
+                this.negative_text = "取消";
+            }
+            this.negative_text = negative_text;
+            this.negativeListener = negativeListener;
+            this.negativeShow = true;
+            return this;
+        }
+
+        public Builder setPositionButton(String positive_text, OnClickListener positiveListener) {
+            if (positive_text == null) {
+                this.positive_text = "确定";
+            }
+            this.positive_text = positive_text;
+            this.positiveListener = positiveListener;
+            this.positiveShow = true;
+            return this;
+        }
+
+
+        private TextView txContent;
+        private TextView btnupEnter;
+        private TextView btnupCancel;
+        private TextView txTitle;
+        private TextView txOldtext;
+
+
+        public DialogModifyText create() {
+            final DialogModifyText dialog = new DialogModifyText(context);
+            View view = LayoutInflater.from(context).inflate(R.layout.dialog_txtupdate, null);
+            dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);//加上这一句,取消原来的标题栏,没加这句之前,发现在三星的手机上会有一条蓝色的线
+            dialog.setContentView(view, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
+            txContent = (TextView) view.findViewById(R.id.et_modifycontent);
+            btnupEnter = (TextView) view.findViewById(R.id.btnup_enter);
+            btnupCancel = (TextView) view.findViewById(R.id.btnup_cancel);
+            txTitle = (TextView) view.findViewById(R.id.tx_title);
+            txOldtext = (TextView) view.findViewById(R.id.tx_oldtext);
+
+            txTitle.setText(title);
+            txOldtext.setText(oldcontent);
+            btnupCancel.setText(negative_text);
+            btnupEnter.setText(positive_text);
+            dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
+            btnupCancel.setOnClickListener(v -> negativeListener.onClick(dialog, Dialog.BUTTON_NEGATIVE));
+            btnupEnter.setOnClickListener(v -> positiveListener.onClick(dialog, Dialog.BUTTON_POSITIVE));
+            if (negativeShow){
+                btnupCancel.setVisibility(View.VISIBLE);
+            }
+            if (positiveShow){
+                btnupEnter.setVisibility(View.VISIBLE);
+            }
+            return dialog;
+        }
+    }
+}

+ 94 - 0
app/src/main/java/com/hw/nativeapp/ui/dialogs/Dialog_Update.java

@@ -0,0 +1,94 @@
+package com.hw.nativeapp.ui.dialogs;
+
+import android.app.Dialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.graphics.Color;
+import android.graphics.drawable.ColorDrawable;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.Window;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.hw.nativeapp.R;
+
+
+public class Dialog_Update extends Dialog {
+
+    public Dialog_Update(Context mcontext) {
+        super(mcontext);
+    }
+
+    public Dialog_Update(Context context, int themeResId){
+        super(context, themeResId);
+    }
+
+    public static class Builder {
+        private Context context;
+        private String message;//提示消息
+        private String negative_text;//消极的
+        private String positive_text;//积极的
+        private DialogInterface.OnClickListener negativeListener;//消极的监听
+        private DialogInterface.OnClickListener positiveListener;//积极的监听
+
+        public Builder(Context context) {
+            this.context = context;
+        }
+
+
+        public Builder setMessage(String message) {
+            if (message == null) {
+                this.message = "您没有填写提示信息哦";
+            }
+            this.message = message;
+            return this;
+        }
+
+        public Builder setNegativeButton(String negative_text, DialogInterface.OnClickListener negativeListener) {
+            if (negative_text == null) {
+                this.negative_text = "取消";
+            }
+            this.negative_text = negative_text;
+            this.negativeListener = negativeListener;
+
+            return this;
+        }
+
+        public Builder setPositionButton(String positive_text, DialogInterface.OnClickListener positiveListener) {
+            if (positive_text == null) {
+                this.positive_text = "确定";
+            }
+            this.positive_text = positive_text;
+            this.positiveListener = positiveListener;
+
+            return this;
+        }
+
+
+        private TextView etContent;
+        private TextView btnupEnter;
+        private TextView btnupCancel;
+
+
+        public Dialog_Update create() {
+            final Dialog_Update dialog = new Dialog_Update(context);
+            View view = LayoutInflater.from(context).inflate(R.layout.dialog_update, null);
+            dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);//加上这一句,取消原来的标题栏,没加这句之前,发现在三星的手机上会有一条蓝色的线
+//            dialog.addContentView(view, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
+            dialog.setContentView(view, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
+            etContent = (TextView) view.findViewById(R.id.et_content);
+            btnupEnter = (TextView) view.findViewById(R.id.btnup_enter);
+            btnupCancel = (TextView) view.findViewById(R.id.btnup_cancel);
+
+            etContent.setText(message);
+            btnupCancel.setText(negative_text);
+            btnupEnter.setText(positive_text);
+            dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
+            btnupCancel.setOnClickListener(v -> negativeListener.onClick(dialog, Dialog.BUTTON_NEGATIVE));
+            btnupEnter.setOnClickListener(v -> positiveListener.onClick(dialog, Dialog.BUTTON_POSITIVE));
+            return dialog;
+        }
+    }
+}

+ 108 - 0
app/src/main/java/com/hw/nativeapp/ui/dialogs/Dialog_UpdateProgress.java

@@ -0,0 +1,108 @@
+package com.hw.nativeapp.ui.dialogs;
+
+import android.app.Dialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.graphics.Color;
+import android.graphics.drawable.ColorDrawable;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.Window;
+import android.widget.LinearLayout;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+
+
+import com.hw.nativeapp.R;
+
+import java.math.BigDecimal;
+
+
+public class Dialog_UpdateProgress extends Dialog {
+
+    public Dialog_UpdateProgress(Context mcontext) {
+        super(mcontext);
+    }
+
+    public Dialog_UpdateProgress(Context context, int themeResId){
+        super(context, themeResId);
+    }
+
+    public static class Builder {
+        private Context context;
+
+        public Builder(Context context) {
+            this.context = context;
+        }
+
+
+
+        public void setProgressBar(int soFarBytes, int totalBytes){
+            if (progressBar != null && totalBytes > 0){
+                BigDecimal proDecimal = BigDecimal.valueOf(soFarBytes);
+                BigDecimal totalDecimal = BigDecimal.valueOf(totalBytes);
+                int progress = proDecimal.divide(totalDecimal,2,BigDecimal.ROUND_HALF_UP).multiply(BigDecimal.valueOf(100)).intValue();
+                progressBar.setProgress(progress);
+                txProgresspercentage.setText(progress + "%");
+            }else {
+                progressBar.setProgress(0);
+                txProgresspercentage.setText("0%");
+            }
+        }
+
+        public void setTxProgress(int soFarBytes, int totalBytes ){
+            if (txProgress != null){
+                if (totalBytes < soFarBytes){
+                    txProgress.setText(byteToMB(soFarBytes) + "/" + byteToMB(soFarBytes));
+                }else {
+                    txProgress.setText(byteToMB(soFarBytes) + "/" + byteToMB(totalBytes));
+                }
+            }
+        }
+
+
+        ProgressBar progressBar;
+        TextView txProgress;
+        TextView txProgresspercentage;
+
+
+        public Dialog_UpdateProgress create() {
+            final Dialog_UpdateProgress dialog = new Dialog_UpdateProgress(context);
+            View view = LayoutInflater.from(context).inflate(R.layout.dialog_updateprogress, null);
+            dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);//加上这一句,取消原来的标题栏,没加这句之前,发现在三星的手机上会有一条蓝色的线
+//            dialog.addContentView(view, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
+            dialog.setContentView(view, new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
+            progressBar = (ProgressBar) view.findViewById(R.id.progressBar);
+            txProgress = (TextView) view.findViewById(R.id.tx_progress);
+            txProgresspercentage = (TextView) view.findViewById(R.id.tx_progresspercentage);
+
+//            etContent.setText(message);
+//            btnupCancel.setText(negative_text);
+//            btnupEnter.setText(positive_text);
+            dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
+//            btnupCancel.setOnClickListener(v -> negativeListener.onClick(dialog, Dialog.BUTTON_NEGATIVE));
+//            btnupEnter.setOnClickListener(v -> positiveListener.onClick(dialog, Dialog.BUTTON_POSITIVE));
+            return dialog;
+        }
+
+        private String byteToMB(long size){
+            long kb = 1024;
+            long mb = kb*1024;
+            long gb = mb*1024;
+            if (size >= gb){
+                return String.format("%.1f GB",(float)size/gb);
+            }else if (size >= mb){
+                float f = (float) size/mb;
+                return String.format(f > 100 ?"%.0f MB":"%.1f MB",f);
+            }else if (size > kb){
+                float f = (float) size / kb;
+                return String.format(f>100?"%.0f KB":"%.1f KB",f);
+            }else {
+                return String.format("%d B",size);
+            }
+        }
+    }
+
+
+}

+ 85 - 0
app/src/main/java/com/hw/nativeapp/ui/dialogs/ImageEnlargeDialog.java

@@ -0,0 +1,85 @@
+package com.hw.nativeapp.ui.dialogs;
+
+import android.app.Dialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.graphics.Bitmap;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.Window;
+import android.view.WindowManager;
+import android.widget.ImageView;
+
+import com.hw.nativeapp.R;
+import com.hw.nativeapp.utils.StringUtils;
+import com.squareup.picasso.Picasso;
+
+public class ImageEnlargeDialog extends Dialog {
+    private Window window = null;
+    private ImageView iv;
+    private Bitmap bms;
+    private String imageSrcUrl;
+    public ImageEnlargeDialog(Context context, boolean cancelable,
+                         DialogInterface.OnCancelListener cancelListener) {
+        super(context, cancelable, cancelListener);
+    }
+    public ImageEnlargeDialog(Context context, int x,int y,Bitmap bm) {
+        super(context);
+        windowDeploy(x, y);
+        bms = bm;
+
+    }
+
+    public ImageEnlargeDialog(Context context, int x,int y,String imgUrl) {
+        super(context);
+        windowDeploy(x, y);
+        imageSrcUrl = imgUrl;
+
+    }
+    public ImageEnlargeDialog(Context context) {
+        super(context);
+    }
+
+    protected void onCreate(Bundle savedInstanceState) {
+        //初始化布局
+        View loadingview= LayoutInflater.from(getContext()).inflate(R.layout.dialog_image_enlarge,null);
+        iv=(ImageView) loadingview.findViewById(R.id.imageview_head_big);
+        if (!StringUtils.isEmpty(imageSrcUrl)){
+            Picasso.with(getContext())
+                    .load(imageSrcUrl)
+                    .into(iv);
+        }else {
+            iv.setImageBitmap(bms);
+        }
+
+        //设置dialog的布局
+        setContentView(loadingview);
+        //如果需要放大或者缩小时的动画,可以直接在此出对loadingview或iv操作,在下面SHOW或者dismiss中操作
+        super.onCreate(savedInstanceState);
+    }
+
+    //设置窗口显示
+    public void windowDeploy(int x, int y){
+        window = getWindow(); //得到对话框
+//        window.setWindowAnimations(R.style.dialogWindowAnim); //设置窗口弹出动画
+        window.setBackgroundDrawableResource(R.color.transparent); //设置对话框背景为透明
+        WindowManager.LayoutParams wl = window.getAttributes();
+        //根据x,y坐标设置窗口需要显示的位置
+        wl.x = x; //x小于0左移,大于0右移
+        wl.y = y; //y小于0上移,大于0下移
+//            wl.alpha = 0.6f; //设置透明度
+//            wl.gravity = Gravity.BOTTOM; //设置重力
+        window.setAttributes(wl);
+    }
+
+    public void show() {
+        //设置触摸对话框意外的地方取消对话框
+        setCanceledOnTouchOutside(true);
+        super.show();
+    }
+    public void dismiss() {
+        super.dismiss();
+    }
+
+}

+ 84 - 0
app/src/main/java/com/hw/nativeapp/ui/dialogs/ImageSeeDialog.java

@@ -0,0 +1,84 @@
+package com.hw.nativeapp.ui.dialogs;
+
+import android.app.Dialog;
+import android.content.Context;
+import android.graphics.Bitmap;
+import android.os.Bundle;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.Window;
+import android.view.WindowManager;
+import android.widget.ImageView;
+
+import com.hw.nativeapp.R;
+import com.hw.nativeapp.utils.StringUtils;
+import com.squareup.picasso.Picasso;
+
+public class ImageSeeDialog extends Dialog {
+    private Window window = null;
+    private ImageView iv;
+    private Bitmap bms;
+    private String imageSrcUrl;
+    public ImageSeeDialog(Context context, boolean cancelable,
+                          OnCancelListener cancelListener) {
+        super(context, cancelable, cancelListener);
+    }
+    public ImageSeeDialog(Context context, int x, int y, Bitmap bm) {
+        super(context);
+        windowDeploy(x, y);
+        bms = bm;
+
+    }
+
+    public ImageSeeDialog(Context context, int x, int y, String imgUrl) {
+        super(context);
+        windowDeploy(x, y);
+        imageSrcUrl = imgUrl;
+
+    }
+    public ImageSeeDialog(Context context) {
+        super(context);
+    }
+
+    protected void onCreate(Bundle savedInstanceState) {
+        //初始化布局
+        View loadingview= LayoutInflater.from(getContext()).inflate(R.layout.dialog_image_see,null);
+        iv=(ImageView) loadingview.findViewById(R.id.imageview_head_big);
+        if (!StringUtils.isEmpty(imageSrcUrl)){
+            Picasso.with(getContext())
+                    .load(imageSrcUrl)
+                    .into(iv);
+        }else {
+            iv.setImageBitmap(bms);
+        }
+
+        //设置dialog的布局
+        setContentView(loadingview);
+        //如果需要放大或者缩小时的动画,可以直接在此出对loadingview或iv操作,在下面SHOW或者dismiss中操作
+        super.onCreate(savedInstanceState);
+    }
+
+    //设置窗口显示
+    public void windowDeploy(int x, int y){
+        window = getWindow(); //得到对话框
+//        window.setWindowAnimations(R.style.dialogWindowAnim); //设置窗口弹出动画
+        window.setBackgroundDrawableResource(R.color.transparent); //设置对话框背景为透明
+        WindowManager.LayoutParams wl = window.getAttributes();
+        //根据x,y坐标设置窗口需要显示的位置
+        wl.x = x; //x小于0左移,大于0右移
+        wl.y = y; //y小于0上移,大于0下移
+//            wl.alpha = 0.6f; //设置透明度
+//            wl.gravity = Gravity.BOTTOM; //设置重力
+        window.setAttributes(wl);
+    }
+
+    public void show() {
+        //设置触摸对话框意外的地方取消对话框
+        setCanceledOnTouchOutside(true);
+        super.show();
+    }
+    public void dismiss() {
+        super.dismiss();
+    }
+
+}

+ 102 - 0
app/src/main/java/com/hw/nativeapp/ui/dialogs/LoadingDialog.java

@@ -0,0 +1,102 @@
+package com.hw.nativeapp.ui.dialogs;
+
+import android.app.Dialog;
+import android.content.Context;
+import android.graphics.Color;
+import android.graphics.drawable.ColorDrawable;
+import android.os.Bundle;
+import android.view.Window;
+import android.view.WindowManager;
+import android.view.animation.AnimationSet;
+import android.view.animation.LinearInterpolator;
+import android.view.animation.RotateAnimation;
+import android.widget.ImageView;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.annotation.StyleRes;
+
+import com.hw.nativeapp.R;
+
+public class LoadingDialog extends Dialog {
+
+    private ImageView iv_ing;
+    private AnimationSet animationSet;
+
+    private static LoadingDialog instance;
+
+    public static LoadingDialog getInstance(Context context) {
+        if(instance == null) {
+            instance = new LoadingDialog(context);
+        }
+        return instance;
+    }
+
+    public static void setInstance(LoadingDialog instance) {
+        LoadingDialog.instance = instance;
+    }
+
+    private LoadingDialog(@NonNull Context context) {
+        super(context);
+    }
+
+    private LoadingDialog(@NonNull Context context, @StyleRes int themeResId) {
+        super(context, themeResId);
+    }
+
+    private LoadingDialog(@NonNull Context context, boolean cancelable, @Nullable OnCancelListener cancelListener) {
+        super(context, cancelable, cancelListener);
+    }
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+
+        //背景透明处理
+        getWindow().requestFeature(Window.FEATURE_NO_TITLE);
+        getWindow().setFlags(WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN,
+                WindowManager.LayoutParams.FLAG_LAYOUT_IN_SCREEN);
+        getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
+        getWindow().setDimAmount(0f);
+
+        this.setContentView(R.layout.dialog_loading);
+
+        //设置dialog属性
+        setCancelable(true);
+        setCanceledOnTouchOutside(false);
+
+        iv_ing = findViewById(R.id.iv_ing);
+
+        //加载动画
+        loadIng();
+    }
+
+    @Override
+    protected void onStart() {
+        super.onStart();
+        iv_ing.startAnimation(animationSet);//开始播放
+    }
+
+    @Override
+    protected void onStop() {
+        super.onStop();
+    }
+
+    //加载动画
+    private void loadIng() {
+        animationSet = new AnimationSet(true);
+        RotateAnimation animation_rotate = new RotateAnimation(0, +359,
+                RotateAnimation.RELATIVE_TO_SELF, 0.5f,
+                RotateAnimation.RELATIVE_TO_SELF, 0.5f);
+        //第一个参数fromDegrees为动画起始时的旋转角度 //第二个参数toDegrees为动画旋转到的角度
+        //第三个参数pivotXType为动画在X轴相对于物件位置类型 //第四个参数pivotXValue为动画相对于物件的X坐标的开始位置
+        //第五个参数pivotXType为动画在Y轴相对于物件位置类型 //第六个参数pivotYValue为动画相对于物件的Y坐标的开始位置
+        animation_rotate.setRepeatCount(-1);
+        animation_rotate.setStartOffset(0);
+        animation_rotate.setDuration(1000);
+        LinearInterpolator lir = new LinearInterpolator();
+        animationSet.setInterpolator(lir);
+        animationSet.addAnimation(animation_rotate);
+    }
+
+}

+ 28 - 0
app/src/main/java/com/hw/nativeapp/ui/dialogs/LoadingDialoges.java

@@ -0,0 +1,28 @@
+package com.hw.nativeapp.ui.dialogs;
+
+import android.app.Dialog;
+import android.content.Context;
+import android.os.Bundle;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import com.hw.nativeapp.R;
+
+public class LoadingDialoges extends Dialog {
+    private TextView tv;
+
+
+    public LoadingDialoges(Context context) {
+        super(context, R.style.loadingDialogStyle);
+    }
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.dialog_loading_01);
+        tv = (TextView) this.findViewById(R.id.tv);
+        tv.setText("上传中...");
+        LinearLayout linearLayout = (LinearLayout) this
+                .findViewById(R.id.LinearLayout);
+        linearLayout.getBackground().setAlpha(210);
+    }
+}

+ 26 - 0
app/src/main/java/com/hw/nativeapp/ui/receiver/BootBroadcastReceiver.java

@@ -0,0 +1,26 @@
+package com.hw.nativeapp.ui.receiver;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.util.Log;
+import android.widget.Toast;
+
+import com.hw.nativeapp.ui.activity.SplashActivity;
+
+public class BootBroadcastReceiver extends BroadcastReceiver {
+    static final String ACTION = "android.intent.action.BOOT_COMPLETED";
+
+    @Override
+    public void onReceive(Context context, Intent intent) {
+        Log.d("BootBroadcastReceiver", "onReceive");
+        Toast.makeText(context, "广播1111!" + intent.getAction(), Toast.LENGTH_SHORT).show();
+        // 判断是否是开机广播
+        if (intent.getAction().equals(ACTION)) {
+            Intent bootMainIntent = new Intent(context, SplashActivity.class);
+            // 这里必须为FLAG_ACTIVITY_NEW_TASK
+            bootMainIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+            context.startActivity(bootMainIntent);
+        }
+    }
+}

+ 0 - 0
app/src/main/java/com/hw/nativeapp/ui/widgets/CircleImageTransformer.java


Неке датотеке нису приказане због велике количине промена