sunqiang 1 år sedan
incheckning
d1d6d97fde
100 ändrade filer med 4631 tillägg och 0 borttagningar
  1. 15 0
      .gitignore
  2. 3 0
      .idea/.gitignore
  3. 1 0
      .idea/.name
  4. 6 0
      .idea/compiler.xml
  5. 23 0
      .idea/gradle.xml
  6. 75 0
      .idea/jarRepositories.xml
  7. 9 0
      .idea/misc.xml
  8. 1 0
      HttpCoreLibrary/.gitignore
  9. 51 0
      HttpCoreLibrary/build.gradle
  10. 0 0
      HttpCoreLibrary/consumer-rules.pro
  11. 21 0
      HttpCoreLibrary/proguard-rules.pro
  12. 5 0
      HttpCoreLibrary/src/main/AndroidManifest.xml
  13. 92 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/HttpClient.kt
  14. 42 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/HttpConfig.kt
  15. 41 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/apk/AdminInfo.kt
  16. 9 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/apk/AppInfo.kt
  17. 12 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/apk/ChemicalExpire.kt
  18. 9 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/apk/LabInfo.kt
  19. 43 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/apk/ProcessedBean.kt
  20. 41 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/apk/SafeInfo.kt
  21. 8 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/apk/WarningNoticeLogVo.kt
  22. 3 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/AdminVoListBean.kt
  23. 10 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/BelongingPersonBean.kt
  24. 17 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/CabinetDoorVo.kt
  25. 26 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ChemicalABean.kt
  26. 21 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ChemicalConfsBean.kt
  27. 13 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ChemicalDataBean.kt
  28. 20 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ChemicalInfoBean.kt
  29. 33 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ChemicalSearchBean.kt
  30. 14 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ChemicalTimeoutListBean.kt
  31. 11 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ChemicalTypeBean.kt
  32. 21 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ChemicalWarnInfoBean.kt
  33. 26 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ChemistryBean.kt
  34. 33 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ConfigBean.kt
  35. 14 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ConfigModel.kt
  36. 14 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/EarlyWarningBean.kt
  37. 10 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/EarlyWarningListBean.kt
  38. 27 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/GiveBackBean.kt
  39. 66 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/HxpStockWaitListBean.kt
  40. 14 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/HxpStockWaitModeBean.kt
  41. 65 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/InventoryBean.kt
  42. 14 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/InventoryListBean.kt
  43. 12 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/LockVoListBean.kt
  44. 14 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/MsdsBean.kt
  45. 21 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/MsdsListBean.kt
  46. 11 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/PageHxpStockBean.kt
  47. 14 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/QueryTwoBean.kt
  48. 63 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/QueryTwoListBean.kt
  49. 81 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ReturnDetailsBean.kt
  50. 6 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ReturnGiveBackBean.kt
  51. 14 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ReturningChemicalsBean.kt
  52. 63 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ReturningList.kt
  53. 29 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/RuleBean.kt
  54. 3 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/SearchBean.kt
  55. 3 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/SearchSpecBean.kt
  56. 9 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/StockDetailsModel.kt
  57. 6 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/StockModeBean.kt
  58. 50 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/StockModel.kt
  59. 3 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/StockModelBean.kt
  60. 28 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/TimeWarBean.kt
  61. 22 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/TopicDataBean.kt
  62. 18 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/UnifiedVerBean.kt
  63. 43 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/UseBean.kt
  64. 15 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/UseLedBean.kt
  65. 68 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/UseLedgerListBean.kt
  66. 16 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/UseNoBean.kt
  67. 24 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/UseNoTwoBean.kt
  68. 6 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/UsePostDataBean.kt
  69. 15 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/UserData.kt
  70. 24 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/UserValidationBean.kt
  71. 15 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/WasteChemicalsBean.kt
  72. 51 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/WasteChemicalsListBean.kt
  73. 500 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/client/ApiRepository.kt
  74. 183 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/client/ChemicalClient.kt
  75. 9 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/client/factory/ClientFactory.kt
  76. 9 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/client/factory/RetrofitFactory.kt
  77. 338 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/client/retrofit/ApiService.java
  78. 867 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/client/retrofit/ChemicalRetrofit.kt
  79. 25 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/config/ConfigCore.kt
  80. 30 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/config/ConfigFactory.kt
  81. 68 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/config/ConfigParam.kt
  82. 30 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/config/OkHttpDNS.kt
  83. 22 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/converter/NullOnEmptyConverterFactory.kt
  84. 9 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/exception/NetException.kt
  85. 43 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/interceptor/HttpLoggingInterceptorLog.kt
  86. 95 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/interceptor/NullToEmptyInterceptor.kt
  87. 62 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/interceptor/TokenHeaderInterceptor.kt
  88. 26 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/interceptor/formatter/GsonFormatter.kt
  89. 37 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/interceptor/formatter/JSONFormatter.kt
  90. 26 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/interceptor/formatter/OrgJsonFormatter.kt
  91. 14 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/net/DownloadListener.kt
  92. 156 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/net/DownloadTask.kt
  93. 140 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/net/ProgressMultipartBody.java
  94. 122 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/net/UploadTask.kt
  95. 5 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/CommonDataResponse.kt
  96. 8 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/CommonListResponse.kt
  97. 18 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/CommonResponse.kt
  98. 50 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/Optional.java
  99. 13 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/request/AlarmRecordReq.java
  100. 0 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/request/AuthFaceReq.java

+ 15 - 0
.gitignore

@@ -0,0 +1,15 @@
+*.iml
+.gradle
+/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

+ 3 - 0
.idea/.gitignore

@@ -0,0 +1,3 @@
+# Default ignored files
+/shelf/
+/workspace.xml

+ 1 - 0
.idea/.name

@@ -0,0 +1 @@
+My Application

+ 6 - 0
.idea/compiler.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CompilerConfiguration">
+    <bytecodeTargetLevel target="1.8" />
+  </component>
+</project>

+ 23 - 0
.idea/gradle.xml

@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="GradleMigrationSettings" migrationVersion="1" />
+  <component name="GradleSettings">
+    <option name="linkedExternalProjectsSettings">
+      <GradleProjectSettings>
+        <option name="testRunner" value="PLATFORM" />
+        <option name="distributionType" value="DEFAULT_WRAPPED" />
+        <option name="externalProjectPath" value="$PROJECT_DIR$" />
+        <option name="modules">
+          <set>
+            <option value="$PROJECT_DIR$" />
+            <option value="$PROJECT_DIR$/HttpCoreLibrary" />
+            <option value="$PROJECT_DIR$/RcCore" />
+            <option value="$PROJECT_DIR$/app" />
+            <option value="$PROJECT_DIR$/serialport" />
+          </set>
+        </option>
+        <option name="resolveModulePerSourceSet" value="false" />
+      </GradleProjectSettings>
+    </option>
+  </component>
+</project>

+ 75 - 0
.idea/jarRepositories.xml

@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="RemoteRepositoriesConfiguration">
+    <remote-repository>
+      <option name="id" value="central" />
+      <option name="name" value="Maven Central repository" />
+      <option name="url" value="https://repo1.maven.org/maven2" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="jboss.community" />
+      <option name="name" value="JBoss Community repository" />
+      <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="MavenRepo" />
+      <option name="name" value="MavenRepo" />
+      <option name="url" value="https://repo.maven.apache.org/maven2/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="maven4" />
+      <option name="name" value="maven4" />
+      <option name="url" value="https://gitee.com/AbnerAndroid/almighty/raw/master" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="BintrayJCenter" />
+      <option name="name" value="BintrayJCenter" />
+      <option name="url" value="https://jcenter.bintray.com/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="maven3" />
+      <option name="name" value="maven3" />
+      <option name="url" value="https://developer.huawei.com/repo/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="maven5" />
+      <option name="name" value="maven5" />
+      <option name="url" value="https://dl.bintray.com/wangjinya/maven" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="Google" />
+      <option name="name" value="Google" />
+      <option name="url" value="https://dl.google.com/dl/android/maven2/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="maven" />
+      <option name="name" value="maven" />
+      <option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="maven2" />
+      <option name="name" value="maven2" />
+      <option name="url" value="https://jitpack.io" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="maven4" />
+      <option name="name" value="maven4" />
+      <option name="url" value="https://maven.aliyun.com/repository/jcenter" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="maven3" />
+      <option name="name" value="maven3" />
+      <option name="url" value="https://maven.aliyun.com/repository/public" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="maven" />
+      <option name="name" value="maven" />
+      <option name="url" value="https://maven.aliyun.com/repository/google" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="maven2" />
+      <option name="name" value="maven2" />
+      <option name="url" value="https://maven.aliyun.com/repository/gradle-plugin" />
+    </remote-repository>
+  </component>
+</project>

+ 9 - 0
.idea/misc.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/build/classes" />
+  </component>
+  <component name="ProjectType">
+    <option name="id" value="Android" />
+  </component>
+</project>

+ 1 - 0
HttpCoreLibrary/.gitignore

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

+ 51 - 0
HttpCoreLibrary/build.gradle

@@ -0,0 +1,51 @@
+plugins {
+    id 'com.android.library'
+    id 'kotlin-android'
+}
+
+android {
+    compileSdkVersion env.compileSdkVersion
+    buildToolsVersion env.buildToolsVersion
+
+    defaultConfig {
+        minSdkVersion env.minSdkVersion
+        targetSdkVersion env.targetSdkVersion
+        versionCode 1
+        versionName "1.0"
+
+        consumerProguardFiles "consumer-rules.pro"
+    }
+
+    buildTypes {
+        release {
+            minifyEnabled false
+            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
+        }
+    }
+    compileOptions {
+        sourceCompatibility env.jdk_version
+        targetCompatibility env.jdk_version
+    }
+    kotlinOptions {
+        jvmTarget = '1.8'
+    }
+}
+
+dependencies {
+
+    implementation fileTree(dir: "libs", include: ["*.jar"])
+    implementation dep.kotlinStdlib
+    implementation dep.androidxCoreKtx
+    implementation dep.androidxLocalbroadcastmanager
+
+    api dep.retrofit
+    implementation dep.converterGson
+    implementation dep.converterScalars
+    implementation dep.rxJavaAdapter
+    implementation dep.okhttp3Logs
+    api dep.rxJava
+    api dep.rxAndroid
+    api dep.gson
+
+//    implementation dep.luban
+}

+ 0 - 0
HttpCoreLibrary/consumer-rules.pro


+ 21 - 0
HttpCoreLibrary/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

+ 5 - 0
HttpCoreLibrary/src/main/AndroidManifest.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="com.rc.httpcore">
+
+</manifest>

+ 92 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/HttpClient.kt

@@ -0,0 +1,92 @@
+package com.rc.httpcore
+
+import android.content.Context
+import com.rc.httpcore.client.factory.ClientFactory
+import com.rc.httpcore.client.factory.RetrofitFactory
+import com.rc.httpcore.config.OkHttpDNS
+import com.rc.httpcore.converter.NullOnEmptyConverterFactory
+import com.rc.httpcore.interceptor.HttpLoggingInterceptorLog
+import com.rc.httpcore.interceptor.NullToEmptyInterceptor
+import com.rc.httpcore.interceptor.TokenHeaderInterceptor
+import okhttp3.OkHttpClient
+import okhttp3.logging.HttpLoggingInterceptor
+import retrofit2.Retrofit
+import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory
+import retrofit2.converter.gson.GsonConverterFactory
+import java.util.concurrent.TimeUnit
+
+
+object HttpClient {
+
+//    const val TIMEOUT_DEFAULT = 3 * 60L
+    const val TIMEOUT_DEFAULT = 10L
+
+    private var mAppContext: Context? = null
+
+    @Volatile
+    var token: String? =null
+
+    var vName: String = "1.0.0"
+
+    fun init(appContext: Context) {
+        this.mAppContext = appContext
+    }
+
+    fun getAppContext() = mAppContext
+
+    fun createClientFactory(): ClientFactory {
+        return when (HttpConfig.HTTP_STRATEGY_Retrofit) {
+            HttpConfig.HTTP_STRATEGY -> RetrofitFactory()
+            else -> RetrofitFactory()
+        }
+    }
+
+    fun <T> createRetrofitApi(
+        apiClass: Class<T>,
+        baseUrl: String = HttpConfig.API_BASE_URL,
+    ): T {
+        return buildRetrofit(baseUrl).create(apiClass)
+    }
+
+    private fun buildRetrofit(
+        baseUrl: String = HttpConfig.API_BASE_URL,
+        okHttpClient: OkHttpClient = buildHttpClient()
+    ): Retrofit {
+        return Retrofit.Builder()
+            .client(okHttpClient)
+            .baseUrl(baseUrl)
+            .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
+            .addConverterFactory(NullOnEmptyConverterFactory())
+            .addConverterFactory(GsonConverterFactory.create())
+            .build()
+    }
+
+    private fun buildHttpClient(): OkHttpClient {
+
+//        val httpLoggingInterceptor = HttpLoggingInterceptor(HttpLoggingInterceptorLog())//创建拦截对象
+//        httpLoggingInterceptor.level = HttpLoggingInterceptor.Level.BODY//这一句一定要记得写,否则没有数据输出
+        return OkHttpClient.Builder()
+            .readTimeout(TIMEOUT_DEFAULT, TimeUnit.SECONDS) // 设置读取超时时间
+            .connectTimeout(TIMEOUT_DEFAULT, TimeUnit.SECONDS) // 设置请求超时时间
+            .writeTimeout(TIMEOUT_DEFAULT, TimeUnit.SECONDS) // 设置写入超时时间
+            .addNetworkInterceptor(TokenHeaderInterceptor())
+            .addInterceptor(HttpLoggingInterceptorLog())//添加请求日志
+//            .addInterceptor(NullToEmptyInterceptor())//添加请求日志
+            .retryOnConnectionFailure(true) // 设置出现错误进行重新连接
+            .dns(OkHttpDNS())
+            .build()
+//        if (!BuildConfig.DEBUG) {//debug模式下打印
+//        }else{
+//            return OkHttpClient.Builder()
+//                .readTimeout(TIMEOUT_DEFAULT, TimeUnit.SECONDS) // 设置读取超时时间
+//                .connectTimeout(TIMEOUT_DEFAULT, TimeUnit.SECONDS) // 设置请求超时时间
+//                .writeTimeout(TIMEOUT_DEFAULT, TimeUnit.SECONDS) // 设置写入超时时间
+//                .addNetworkInterceptor(TokenHeaderInterceptor())
+//                .retryOnConnectionFailure(true) // 设置出现错误进行重新连接
+//                .build()
+//        }
+    }
+
+
+
+}

+ 42 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/HttpConfig.kt

@@ -0,0 +1,42 @@
+package com.rc.httpcore
+
+class HttpConfig {
+
+    companion object {
+        //        var API_BASE_URL = "http://lab.zjznai.com/nwsuaf/api/"  //公网域名
+//        var API_BASE_URL = "http://192.168.1.43/api/"
+//        var API_BASE_URL = "http://192.168.1.8/api/"
+        var API_BASE_URL = "http://172.16.0.65/api/"
+//        var API_BASE_IMG_URL = "http://192.168.1.43/api"  //图片资源
+//        var API_BASE_IMG_URL = "http://192.168.1.8/api"  //图片资源
+        var API_BASE_IMG_URL = "http://172.16.0.65/api/"  //图片资源
+
+        var API_BASE_QC_URL = "http://lab.zjznai.com/labTest"  //二维码地址  用于打印出的二维码路径跳转到小程序
+//        http://lab.zjznai.com/labAppTest?code=1760903781269671937&type=1   MSDS 路径生成
+        //http://192.168.1.43/api?code=1760903781269671937&type=1   MSDS 路径生成
+
+        var BASE_PATH_FACE = BasePathV1.FACE
+        var BASE_PATH_BASE = BasePathV1.BASE
+
+        const val HTTP_STRATEGY_Retrofit = 1
+
+        var HTTP_STRATEGY = HTTP_STRATEGY_Retrofit
+    }
+
+
+    enum class ApiVersion(val code: Int, val desc: String) {
+        V1(0, "V1"),
+        V2(1, "V2")
+    }
+
+    object BasePathV1 {
+        const val FACE = "face"
+        const val BASE = ""
+    }
+
+    object BasePathV2 {
+        const val ALGORITHM = "algorithm"
+        const val BASE = "base/"
+    }
+
+}

+ 41 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/apk/AdminInfo.kt

@@ -0,0 +1,41 @@
+package com.rc.httpcore.apk
+
+data class AdminInfo(
+    val account: Any,
+    val accountType: Any,
+    val avatar: Any,
+    val birthday: Any,
+    val cardNum: Any,
+    val cardNumSimple: Any,
+    val category: Any,
+    val createTime: Any,
+    val deptId: Any,
+    val deptName: Any,
+    val education: Any,
+    val email: Any,
+    val grade: Any,
+    val gradeName: Any,
+    val identity: Any,
+    val isCheck: Any,
+    val major: Any,
+    val majorName: Any,
+    val mobile: String,
+    val nickName: Any,
+    val position: Any,
+    val positionName: Any,
+    val postCode: Any,
+    val roleIds: Any,
+    val sex: Any,
+    val signature: Any,
+    val source: Any,
+    val state: Any,
+    val topicName: Any,
+    val tutorUserId: Any,
+    val tutorUserMobile: Any,
+    val tutorUserName: Any,
+    val updateTime: Any,
+    val userId: String,
+    val userName: String,
+    val userState: Any,
+    val userType: Any
+)

+ 9 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/apk/AppInfo.kt

@@ -0,0 +1,9 @@
+package com.rc.httpcore.apk
+
+import com.rc.httpcore.vo.response.ApkInfoResp
+
+data class AppInfo(
+    val labInfo: LabInfo,
+    val needUpgrade: Boolean,
+    val appInfo: ApkInfoResp?  //版本升级得内容
+)

+ 12 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/apk/ChemicalExpire.kt

@@ -0,0 +1,12 @@
+package com.rc.httpcore.apk
+
+data class ChemicalExpire(
+    val belongName: String,
+    val chemicalName: String,
+    val expireTime: String,
+    val normsNum: String,
+    val position: String,
+    val tagCode: String,
+    val stockDetailId: Long,
+    val surplus: String
+)

+ 9 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/apk/LabInfo.kt

@@ -0,0 +1,9 @@
+package com.rc.httpcore.apk
+
+data class LabInfo(
+    val floorId: String,
+    val floorName: String,
+    val room: String,
+    val subjectId: String,
+    val subjectName: String
+)

+ 43 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/apk/ProcessedBean.kt

@@ -0,0 +1,43 @@
+package com.rc.httpcore.apk
+
+import com.rc.httpcore.bean.ChemicalTimeoutListBean
+import com.rc.httpcore.bean.ChemicalWarnInfoBean
+
+data class ProcessedBean(
+    val adminInfoList: List<AdminInfo>,
+    val buildName: String,
+    val chemicalExpireList: List<ChemicalExpire>, //化学品信息显示
+    val chemicalOverdueStockList: List<ChemicalWarnInfoBean>?, //超期未入库
+    val chemicalTimeoutList: List<ChemicalTimeoutListBean>?, //超期未入库
+    val chemicalWarnType: Int,  //1化学品违规带离。2超时未归还。3化学品过期。4化学品即将过期 5 超期未入库 6业务超时
+    val deptName: String,
+    val floorName: String,
+    val handleNotes: String?,
+    val handlePerson: String?,
+    val handlePersonPhone: Any,
+    val handleTime: String?,
+    val handleType: Int,
+    val isHandlePeople: Boolean,
+    val noticeId: String,
+    val noticeStatus: Int,
+    val roomNum: String,
+    val safeInfoList: List<SafeInfo>,
+    val safeInfoStr: Any,
+    val subName: String,
+    val warnContent: String,
+    val warnTime: String,
+    val belongName: String?,
+    val chemicalName: String?,
+    val rfidCode: String?,
+    val position: String?,
+    val collectUserName: String?,
+    val surplus: String?,
+    val normsNum: String?,
+    val collectTime: String?,
+    val collectTimeAging: Int,  //小时 需要自己添加
+    val warnType: Int,
+    val alarmType: String?,
+    val operationPerson: String?,
+    val snapImg: List<String>?,
+    val warningNoticeLogVoList: List<WarningNoticeLogVo>  //通知记录
+)

+ 41 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/apk/SafeInfo.kt

@@ -0,0 +1,41 @@
+package com.rc.httpcore.apk
+
+data class SafeInfo(
+    val account: Any,
+    val accountType: Any,
+    val avatar: Any,
+    val birthday: Any,
+    val cardNum: Any,
+    val cardNumSimple: Any,
+    val category: Any,
+    val createTime: Any,
+    val deptId: Any,
+    val deptName: Any,
+    val education: Any,
+    val email: Any,
+    val grade: Any,
+    val gradeName: Any,
+    val identity: Any,
+    val isCheck: Any,
+    val major: Any,
+    val majorName: Any,
+    val mobile: String,
+    val nickName: Any,
+    val position: Any,
+    val positionName: Any,
+    val postCode: Any,
+    val roleIds: Any,
+    val sex: Any,
+    val signature: Any,
+    val source: Any,
+    val state: Any,
+    val topicName: Any,
+    val tutorUserId: Any,
+    val tutorUserMobile: Any,
+    val tutorUserName: Any,
+    val updateTime: Any,
+    val userId: String,
+    val userName: String,
+    val userState: Any,
+    val userType: Any
+)

+ 8 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/apk/WarningNoticeLogVo.kt

@@ -0,0 +1,8 @@
+package com.rc.httpcore.apk
+
+data class WarningNoticeLogVo(
+    val noticePreson: String,
+    val noticeTime: String,
+    val noticeType: String,
+    val warningLevel: String
+)

+ 3 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/AdminVoListBean.kt

@@ -0,0 +1,3 @@
+package com.rc.httpcore.bean
+
+data class AdminVoListBean(var userName:String,var doorId:String,var userId:String)

+ 10 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/BelongingPersonBean.kt

@@ -0,0 +1,10 @@
+package com.rc.httpcore.bean
+
+//归属人信息
+data class BelongingPersonBean(
+    val userId: String,
+    val userName: String,
+    val account: String,
+    val mobile: String,
+    val deptName: String
+)

+ 17 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/CabinetDoorVo.kt

@@ -0,0 +1,17 @@
+package com.rc.httpcore.bean
+
+data class CabinetDoorVo(
+    val cabinetAdminVoList: List<AdminVoListBean>? = null,
+    val cabinetId: String,
+    val cabinetLockVoList: List<LockVoListBean>? = null,  //柜锁有几个
+    val doorId: String,
+    val doorLayers: Int,  //当前一共几层
+    val doorName: String,
+    val doorUniqueId: String,
+    val stockNum: Int,
+    val unlockingMethod: Int,
+    val useNum: Any,
+    val isControl: Boolean = false,  //非管控  否则就是管控
+    var verify: Boolean = true, //true 需要进行双人认证
+    var isType: Boolean = false  //不选中 true选中
+)

+ 26 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ChemicalABean.kt

@@ -0,0 +1,26 @@
+package com.rc.httpcore.bean
+
+import java.math.BigDecimal
+
+//新增-点击确定 需要的参数
+class ChemicalABean(
+    val belongId: String? = null,   //归属人id
+    val belongName: String? = null, //归属人名称
+    val casNum: String? = null,
+    val chemicalCategory: String? = null,
+    val chemicalDensity: Double, // 密度
+    val chemicalLevel: Int,   //管控 1     非管控  2
+    val chemicalName: String? = null,
+    val chemicalNumber: Int, //数量
+    val chemicalPurity: String? = null,
+    val factory: String? = null,
+    val isNew: Boolean,
+    val packNum: BigDecimal = BigDecimal("0"),
+    val packUnit: String? = null, //包装单位
+    val specNum: BigDecimal,  //规格
+    val specUnit: String? = null, //规格单位
+    var chemicalId: String? = null,
+    var belongType: Int = 2,  //1课题组 2人员
+    var qrCodePrint: Boolean = true,  //是否打印二维码
+    var status: Int? = 2,   //默认非双人认证
+)

+ 21 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ChemicalConfsBean.kt

@@ -0,0 +1,21 @@
+package com.rc.httpcore.bean
+
+import java.math.BigDecimal
+
+//化学品基础参数配置  是否打印二维码
+data class ChemicalConfsBean(
+    val controlType: Boolean,
+    val createBy: String,
+    val createTime: String,
+    val fluidMax: BigDecimal,
+    val id: String,
+    val inputWeight: Boolean,
+    val metage: Boolean,
+    val outRange: Boolean,
+    val qrCodePrint: Boolean,  //是否打印
+    val remark: String?,
+    val solidMax: BigDecimal,
+    val updateBy: String,
+    val updateTime: String,
+    val verify: Boolean
+)

+ 13 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ChemicalDataBean.kt

@@ -0,0 +1,13 @@
+package com.rc.httpcore.bean
+
+data class ChemicalDataBean (
+    val countId: Any,
+    val current: Int,
+    val maxLimit: Any,
+    val optimizeCountSql: Boolean,
+    val pages: Int,
+    val records: List<ChemicalSearchBean>,
+    val searchCount: Boolean,
+    val size: Int,
+    val total: Int
+    )

+ 20 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ChemicalInfoBean.kt

@@ -0,0 +1,20 @@
+package com.rc.httpcore.bean
+
+data class ChemicalInfoBean(
+    val adminName: String,
+    val adminPhone: String,
+    val buildId: String,
+    val buildName: String,
+    val deptId: String,
+    val deptName: String,
+    val floorId: String,
+    val floorName: String,
+    val infoId: String,
+    val oneSafeName: String,
+    val oneSafePhone: String,
+    val subId: String,
+    val twoSafeName: String,
+    val twoSafePhone: String,
+    val subName:String,
+    val roomNum:String,
+)

+ 33 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ChemicalSearchBean.kt

@@ -0,0 +1,33 @@
+package com.rc.httpcore.bean
+
+import java.math.BigDecimal
+
+
+//化学品搜索信息
+data class ChemicalSearchBean(
+    val anotherName: String,  //化学品别名
+    val anotherNameChar: String,
+    val anotherNamePinyin: String,
+    val casNum: String, //cas号
+    val chemicalCategory: String?,
+    val chemicalDensity: String?,
+    val chemicalId: String,
+    val chemicalLevel: Int, //1是管控,2是非管控
+    val chemicalName: String, //化学品名称
+    val chemicalNameChar: String,
+    val chemicalNamePinyin: String,
+    val chemicalNum: Any,
+    val chemicalPurity: String, //纯度
+    val createBy: Long,
+    val createName: String,
+    val createTime: String,
+    val depositRequire: Int,
+    val depositUnit: String?,
+    val msdsId: Any,
+    val updateBy: Long,
+    val updateName: String,
+    val packNum: BigDecimal?,  //包装值
+    val specNum: BigDecimal?, //规格值
+    val updateTime: String,
+    var chemicalCategoryName: String?
+)

+ 14 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ChemicalTimeoutListBean.kt

@@ -0,0 +1,14 @@
+package com.rc.httpcore.bean
+
+data class ChemicalTimeoutListBean(
+    val belongName: String,
+    val casNum: String,
+    val chemicalCategoryName: String,
+    val chemicalName: String,
+    val chemicalPurity: String,
+    val deptName: String,
+    val normsNum: String,
+    val position: String, //位置
+    val surplus: String,
+    val tagCode: String
+)

+ 11 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ChemicalTypeBean.kt

@@ -0,0 +1,11 @@
+package com.rc.httpcore.bean
+
+data class ChemicalTypeBean(
+    val isDefault: Boolean,
+    val itemId: String,
+    val label: String,
+    val listClass: Any,
+    val remark: Any,
+    val sort: Int,
+    val value: String  //类别编码
+)

+ 21 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ChemicalWarnInfoBean.kt

@@ -0,0 +1,21 @@
+package com.rc.httpcore.bean
+
+import java.math.BigDecimal
+
+//超期未归还
+data class ChemicalWarnInfoBean(
+    val applyNum: BigDecimal,
+    val belongName: String,
+    val casNum: String?,
+    val chemicalCategory: String,
+    val chemicalName: String,
+    val chemicalPurity: String,
+    val createTime: String,
+    val deptName: String,
+    val inStockNum: BigDecimal,
+    val isStock: Boolean,
+    val normsNum: String,
+    val source: String,
+    val subName: String,
+    val waitId: String
+)

+ 26 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ChemistryBean.kt

@@ -0,0 +1,26 @@
+package com.rc.httpcore.bean
+
+import java.math.BigDecimal
+
+//领用时需要传得参数
+data class ChemistryBean(
+    val id: String,
+    val stockId: String, //库存ID
+    val weigh: BigDecimal? = null,   //称重重量  or 零用量
+    var outOneUser: String? = null,  //领用第一验证人id
+    var outOneUserName: String? = null,  //领用第一验证人姓名
+    var outTwoUser: String? = null,  //领用第二验证人id
+    var outTwoUserName: String? = null,  //领用第二验证人
+    var outType: Int = 1,  //领用方式(1是称重,2是录入)
+    var allBottle: Boolean = false,  //是否整瓶领用
+    //=====================临时参数 需要显示====================== 领用时可以不传
+    var chemicalName: String,
+    var code: String,//rfid  or tagCode
+    var spec: String,//规格   specNum specUnit/packUnit
+    var duration: String,//领用时效
+    val stockDetailsId: String, //后端需要得id
+    val surplus: BigDecimal,//当前剩余量
+    val packNum: BigDecimal,//包装值
+    val chemicalDensity: BigDecimal,//密度
+    val specUnit: String?,
+)

+ 33 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ConfigBean.kt

@@ -0,0 +1,33 @@
+package com.rc.httpcore.bean
+
+import java.math.BigDecimal
+
+data class ConfigBean(
+    val createBy: Long,
+    val createTime: String,
+    val id: String,
+    val loginType: String,  //登陆方式
+    val circularLogo: String,
+    val subName: String,
+    val levelName: String?,
+    val levelColor: String,
+    val roomNum: String,
+    val deptName: String,
+    val buildName: String, //楼栋3 buildName+floorName
+    val floorName: String,
+    val operateTimeout: Int,
+    val remark: Any,
+    val subscribe: Boolean,
+    val timeoutHour: Int,
+    val timeoutMinute: Any,
+    val updateBy: Long,
+    val updateTime: String,
+    val useHour: Int,
+    val useMinute: Any,
+    val weighHintPicture: String? = null,
+    var backTime: Int = 40,//自动返回时间
+    var signOutTime: Int = 50,//自动注销时间   注销时间必须大于自动返回时间
+    var offTime: Int = 30,//弹窗关闭时间       //必须小于自动返回时间
+    val verifyType: String, //双人验证方式
+    val vinVex: BigDecimal = BigDecimal(5.00)  //称重入库  容差率
+)

+ 14 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ConfigModel.kt

@@ -0,0 +1,14 @@
+package com.rc.httpcore.bean
+
+data class ConfigModel(
+    val controlType: Boolean,
+    val fluidMax: Int,
+    val id: String,
+    val inputWeight: Boolean,
+    val metage: Boolean,
+    val outRange: Boolean,
+    var qrCodePrint: Boolean,
+    val remark: Any,
+    val solidMax: Int,
+    val verify: Boolean
+)

+ 14 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/EarlyWarningBean.kt

@@ -0,0 +1,14 @@
+package com.rc.httpcore.bean
+
+data class EarlyWarningBean(
+    val countId: Any,
+    val current: Int,
+    val maxLimit: Any,
+    val optimizeCountSql: Boolean,
+    val orders: List<Any>,
+    val pages: Int,
+    val records: List<EarlyWarningListBean>,
+    val searchCount: Boolean,
+    val size: Int,
+    val total: Int
+)

+ 10 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/EarlyWarningListBean.kt

@@ -0,0 +1,10 @@
+package com.rc.httpcore.bean
+
+data class EarlyWarningListBean(
+    val noticeId: String,
+    val warnTime: String,
+    val warnContent: String,
+    val noticeStatus: Int,   //1  已处理     0 待处理(可以手动处理)  2 待处理(不可手动处理  显示详情)
+    val isHandlePeople: Boolean,
+    var solve: Boolean = false
+)

+ 27 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/GiveBackBean.kt

@@ -0,0 +1,27 @@
+package com.rc.httpcore.bean
+
+//归还化学品上传信息
+data class GiveBackBean(
+    var backOneUser: String? = null,
+    var backOneUserName: String? = null,
+    var backTwoUser: String? = null,
+    var backTwoUserName: String? = null,
+    var outOneUser: String? = null,
+    var outOneUserName: String? = null,
+    var outTwoUser: String? = null,
+    var outTwoUserName: String? = null,
+    var outType: Int = 1,  //领用方式(1是称重,2是录入)
+    val cabinetId: String,
+    val cabinetName: String,
+    val doorId: String,
+    val doorName: String,
+    val id: String,
+    val layers: Int,
+    val returnType: Int,  //归还方式(1是称重,2是录入)
+    val stockDetailsId: String,
+    val stockId: String,
+    val useStatus: Int, //0归还  3空瓶出库,4作废出库
+    val remark: String? = null, //repeal
+    val weigh: Double?,
+    val disuseReason: String? = null  //废弃时需要填写的备注信息
+)

+ 66 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/HxpStockWaitListBean.kt

@@ -0,0 +1,66 @@
+package com.rc.httpcore.bean
+
+import java.math.BigDecimal
+
+data class HxpStockWaitListBean(
+    var id:String?,
+    val adminName: String,
+    val adminPhone: String,
+    val anotherName: Any,
+    val applyNum: BigDecimal,
+    val applyReason: String,
+    val applyUnit: String,  //包装
+    val applyUserId: String,
+    val applyUserName: String,
+    val applyUserPhone: String,
+    val buildId: String,
+    val buildName: String,
+    val casNum: String?,
+    val chemicalCategory: String,
+    val chemicalCategoryName: String?,
+    val chemicalDensity: Double,  //密度
+    val chemicalId: String,
+    val chemicalLevel: Int,    //管控 1     非管控  2
+    val chemicalLevelName: Any,
+    val chemicalName: String,
+    val chemicalNum: Any,
+    val chemicalPurity: String?,
+    val deptId: String,
+    val deptName: String,
+    val expireTime: String?=null,
+    val factory: String,
+    val floorId: String,
+    val floorName: String,
+    var layers:Int,//层数
+    val isDel: Boolean,
+    val isOverdue: Any,
+    val mentorId: Any,
+    val mentorName: Any,
+    val mentorPhone: Any,
+    val normsNum: Double, //规格
+    val normsUnit: String,
+    val oneSafeName: String,
+    val oneSafePhone: String,
+    val remarks: Any,
+    val roomNum: String,
+    val shape: Any,
+    val source: Int,
+    val stockPeriod: String,
+    val subId: String,
+    val subName: String,
+    val topicGroup: Boolean,  //是否是 课题组
+    val topicGroupId: String,
+    val topicGroupName: String,
+    val topicUserName: Any,
+    val topicUserPhone: Any,
+    val twoSafeName: String,
+    val twoSafePhone: String,
+    val waitId: String,
+    val cabinetName:String?,
+    val doorName:String?,
+    val surplus:BigDecimal?,
+    val chemicalNumber:Int?,
+    val stockNum:Int?,  //已入库数量
+    var isType: Boolean = false,  //不选中 true选中
+    val specUnit:String?,
+)

+ 14 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/HxpStockWaitModeBean.kt

@@ -0,0 +1,14 @@
+package com.rc.httpcore.bean
+
+data class HxpStockWaitModeBean(
+    val countId: Any,
+    val current: Int,  //当前页
+    val maxLimit: Any,
+    val optimizeCountSql: Boolean,
+    val orders: List<Any>,
+    val pages: Int,   //一共几页
+    val records: List<HxpStockWaitListBean>,
+    val searchCount: Boolean,
+    val size: Int,
+    val total: Int
+)

+ 65 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/InventoryBean.kt

@@ -0,0 +1,65 @@
+package com.rc.httpcore.bean
+
+import java.math.BigDecimal
+
+data class InventoryBean(
+    val adminUser: String,
+    val belongName: String,
+    val buildName: String,
+    val cabinetId: Long,
+    val cabinetName: String,
+    val casNum: String,
+    val chemicalCategory: String,
+    val chemicalCategoryName: Any,
+    val chemicalLevel: Int,
+    val chemicalLevelName: Any,
+    val chemicalName: String,
+    val chemicalNumber: Int,
+    val chemicalShape: Any,
+    val createBy: Long,
+    val createByName: String,
+    val createTime: String,
+    val deptName: String,
+    val disuseReason: Any,
+    val doorId: Long,
+    val doorName: String,
+    val expireStatus: Int,
+    val expireTime: String,
+    val floorName: String,
+    val id: String,
+    val joinTime: String,
+    val joinType: Any,
+    val joinUserId: Long,
+    val joinUserMobile: String,
+    val joinUserName: String,
+    val joinVideo: Any,
+    val layers: String,
+    val oneUserId: Any,
+    val oneUserMobile: Any,
+    val oneUserName: Any,
+    val `operator`: Any,
+    val outTime: String,
+    val outUserId: Any,
+    val outUserMobile: Any,
+    val outUserName: Any,
+    val outVideo: Any,
+    val packNum: BigDecimal,
+    val packUnit: String,
+    val position: Any,
+    val rfidCode: String,
+    val safeUser: String,
+    val specNum: Int,
+    val specUnit: String,
+    val status: Int,
+    val statusStr: String,
+    val stockId: String,
+    val subName: String,
+    val subRoom: String,
+    val surplus: Double,
+    val tagCode: String,
+    val twoUserId: Any,
+    val twoUserMobile: Any,
+    val twoUserName: Any,
+    val usages: Double,
+    val useStatus: Int
+)

+ 14 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/InventoryListBean.kt

@@ -0,0 +1,14 @@
+package com.rc.httpcore.bean
+
+data class InventoryListBean(
+    val countId: Any,
+    val current: Int,
+    val maxLimit: Any,
+    val optimizeCountSql: Boolean,
+    val orders: List<Any>,
+    val pages: Int,
+    val records: List<InventoryBean>,
+    val searchCount: Boolean,
+    val size: Int,
+    val total: Int
+)

+ 12 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/LockVoListBean.kt

@@ -0,0 +1,12 @@
+package com.rc.httpcore.bean
+
+//柜锁数量
+data class LockVoListBean(
+    val doorId: String,
+    val lockId: String,
+    val unlockingMethod: Int,
+    val lockName: String,
+    val lockNum: String,
+    val cabinetLattice: String?,
+    var isOk: Boolean = false
+)

+ 14 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/MsdsBean.kt

@@ -0,0 +1,14 @@
+package com.rc.httpcore.bean
+
+data class MsdsBean(
+    val countId: Any,
+    val current: Int,
+    val maxLimit: Any,
+    val optimizeCountSql: Boolean,
+    val orders: List<Any>,
+    val pages: Int,
+    val records: List<MsdsListBean>,
+    val searchCount: Boolean,
+    val size: Int,
+    val total: Int
+)

+ 21 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/MsdsListBean.kt

@@ -0,0 +1,21 @@
+package com.rc.httpcore.bean
+
+data class MsdsListBean(
+    val alias: Any,
+    val casNum: Any,
+    val code: String,
+    val content: String,
+    val createBy: Long,
+    val createByName: String,
+    val createTime: String,
+    val id: String,
+    val name: String,
+    val pinYin: String,
+    val pinYinChar: String,
+    val qrCodeUrl: Any,
+    val remark: Any,
+    val scanCount: Int,
+    val updateBy: Long,
+    var isType: Boolean = false,  //是否点击
+    val updateTime: String
+)

+ 11 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/PageHxpStockBean.kt

@@ -0,0 +1,11 @@
+package com.rc.httpcore.bean
+
+data class PageHxpStockBean(
+    val current: Int,   //当前页
+    val optimizeCountSql: Boolean,
+    val pages: Int,    //共计多少页
+    val records: List<HxpStockWaitListBean>,
+    val searchCount: Boolean,
+    val size: Int,   //当前页多少条
+    val total: Int  //总数:total
+)

+ 14 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/QueryTwoBean.kt

@@ -0,0 +1,14 @@
+package com.rc.httpcore.bean
+
+data class QueryTwoBean(
+    val countId: Any,
+    val current: Int,
+    val maxLimit: Any,
+    val optimizeCountSql: Boolean,
+    val orders: List<Any>,
+    val pages: Int,
+    val records: List<QueryTwoListBean>,
+    val searchCount: Boolean,
+    val size: Int,
+    val total: Int
+)

+ 63 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/QueryTwoListBean.kt

@@ -0,0 +1,63 @@
+package com.rc.httpcore.bean
+
+import java.math.BigDecimal
+
+data class QueryTwoListBean(
+    val adminUser: String,
+    val belongName: String,
+    val buildName: String,
+    val cabinetId: String,
+    val cabinetName: String,
+    val casNum: String,
+    val chemicalCategory: String,
+    val chemicalCategoryName: String?,
+    val chemicalLevel: Int,
+    val chemicalLevelName: String?,
+    val chemicalName: String,
+    val createBy: String,
+    val createByName: String,
+    val createTime: String,
+    val deptName: String,
+    val disuseReason: String?,
+    val doorId: String,
+    val doorName: String,
+    val expireStatus: Int,
+    val expireTime: String,
+    val floorName: String,
+    val id: String,
+    val joinTime: String,
+    val joinUserId: String,
+    val joinUserMobile: String,
+    val joinUserName: String,
+    val joinVideo: String?,
+    val layers: String,
+    val oneUserId: String?,
+    val oneUserMobile: String?,
+    val oneUserName: String?,
+    val `operator`: String?,
+    val outTime: String?,
+    val outUserId: String?,
+    val outUserMobile: String?,
+    val outUserName: String?,
+    val outVideo: String?,
+    val packNum: BigDecimal?,
+    val packUnit: String,
+    val position: String?,
+    var rfidCode: String?,
+    val safeUser: String,
+    val specNum: BigDecimal,
+    val specUnit: String,
+    val status: Int,
+    val statusStr: String?,
+    val stockId: String,
+    val subName: String,
+    val subRoom: String,
+    val surplus: BigDecimal,
+    val tagCode: String,
+    val twoUserId: String?,
+    val twoUserMobile: String?,
+    val twoUserName: String?,
+    val usages: BigDecimal,
+    var isType: Boolean = false,  //不选中 true选中
+    val useStatus: Int
+)

+ 81 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ReturnDetailsBean.kt

@@ -0,0 +1,81 @@
+package com.rc.httpcore.bean
+
+data class ReturnDetailsBean(
+    val anotherName: Any,
+    val belongId: String,
+    val belongMobile: Any,
+    val belongName: String,
+    val belongType: Int,
+    val buildId: String,
+    val buildName: String,
+    var cabinetId: String,
+    var cabinetName: String,
+    val casNum: String,
+    val chemicalCategory: String,
+    val chemicalCategoryName: String,
+    val chemicalDensity: Double,
+    val chemicalId: String,
+    val chemicalLevel: Int,
+    val chemicalLevelName: String,
+    val chemicalName: String,
+    val chemicalNum: Any,
+    val chemicalNumber: Int,
+    val chemicalPurity: String,
+    val chemicalShape: Int,//管控 1     非管控  2
+    val collectStockNum: Double,
+    val collectTime: String,
+    val createByName: String,
+    val createTime: String,
+    val depositRequire: Any,
+    val depositUnit: Any,
+    val deptId: String,
+    val deptName: String,
+    var doorId: String,
+    var doorName: String,
+    val expireStatus: Int,
+    val expireTime: String?,
+    val factory: String,
+    val floorId: String,
+    val floorName: String,
+    val id: String,
+    val isNew: Boolean,
+    val joinTime: String,
+    val joinType: Int,
+    val joinVideo: String,
+    var layers: String,
+    val oneUserId: Any,
+    val oneUserMobile: Any,
+    val oneUserName: Any,
+    val outTime: Any,
+    val outUserName: Any,
+    val outVideo: Any,
+    val packNum: Double,
+    val packUnit: String,
+    val position: Any,
+    var rfidCode: String?,
+    val safeUser: Any,
+    val specNum: Double,
+    val specUnit: String,
+    val status: Int,
+    val statusStr: Any,
+    val stockDetailsId: String,
+    val subId: String,
+    val subName: String,
+    val subRoom: String,
+    val surplus: Double,
+    val surplusDouble: Any,
+    val surplusTime: String,
+    val tagCode: String,
+    val twoUserId: Any,
+    val twoUserMobile: Any,
+    val twoUserName: Any,
+    val usages: Double,
+    val useStatus: Int,
+    val useStatusName: Any,
+    val userecordId: String,
+    val wxCode: String?="",
+    val stockTypeStr: String = "领用",
+    var isType: Boolean = false,  //不选中 true选中
+    var verify: Boolean = true,  //是否需要双人认证
+    var cabinetLockVoList: List<LockVoListBean>? = null,  //柜锁有几个
+)

+ 6 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ReturnGiveBackBean.kt

@@ -0,0 +1,6 @@
+package com.rc.httpcore.bean
+
+import java.math.BigDecimal
+
+//归还返回得参数    使用量   剩余量
+data class ReturnGiveBackBean(val useAmount:BigDecimal?,val remark:BigDecimal?,val specUnit:String)

+ 14 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ReturningChemicalsBean.kt

@@ -0,0 +1,14 @@
+package com.rc.httpcore.bean
+
+//归还列表信息返回
+data class ReturningChemicalsBean(
+    val countId: Any,
+    val current: Int,
+    val maxLimit: Any,
+    val optimizeCountSql: Boolean,
+    val pages: Int,
+    val records: List<ReturningList>,
+    val searchCount: Boolean,
+    val size: Int,
+    val total: Int
+)

+ 63 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/ReturningList.kt

@@ -0,0 +1,63 @@
+package com.rc.httpcore.bean
+
+import java.math.BigDecimal
+
+data class ReturningList(
+    val adventWarnDay: Any,
+    val allBottle: Any,
+    val backOneUser: Any,
+    val backOneUserName: Any,
+    val backTwoUser: Any,
+    val backTwoUserName: Any,
+    val belongName: String,
+    val cabinetName: String,
+    val casNum: String,
+    val chemicalCategory: String,
+    val chemicalId: Any,
+    val chemicalLevel: Int,
+    val chemicalName: String,
+    val chemicalPurity: String,
+    val chemicalShape: Int,
+    val collectNowNum: BigDecimal,
+    val collectStockNum: BigDecimal,
+    val collectTime: String,
+    val doorName: String,
+    val duration: String,
+    val expireTime: String?, //过期时间
+    val expireStatus: Int,  //过期状态
+    val id: String,
+    val joinType: Int,
+    val layers: String,
+    val lossAmount: Any,
+    val outOneUser: Any,
+    val outOneUserName: Any,
+    val outTwoUser: Any,
+    val outTwoUserName: Any,
+    val outType: Int,
+    val outUserName: Any,
+    val outVideo: Any,
+    val packNum: BigDecimal,
+    val packUnit: String,
+    val remark: Any,
+    val returnStockNum: Any,
+    val returnTime: Any,
+    val returnType: Any,
+    val returnVideo: Any,
+    val rfidCode: String,
+    val safeInfo: Any,
+    val securityPhone: Any,
+    val securityUserName: Any,
+    val specNum: BigDecimal,
+    val specUnit: String,
+    val status: Int,
+    val stockDetailsId: String,
+    val stockId: String,
+    val subId: Long,
+    val subName: String,
+    val subRoom: String,
+    val surplus: BigDecimal,
+    val tagCode: String,
+    val useAmount: Any,
+    val useStatus: Int,
+    val useName: String
+)

+ 29 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/RuleBean.kt

@@ -0,0 +1,29 @@
+package com.rc.httpcore.bean
+
+data class RuleBean(
+    val buildId: String,
+    val buildName: String,
+    val cabinetDoorVoList: List<CabinetDoorVo>,//柜门
+    val cabinetId: String,
+    val doorUniqueId: String,
+    val cabinetName: String,
+    val cameraId: String,
+    val chemicalNum: Any,
+    val collectorId: String,
+    val createBy: String,
+    val createName: String,
+    val createTime: String,
+    val deptId: String,
+    val deptName: String,
+    val doorNum: Int,
+    val floorId: String,
+    val floorName: String,
+    val lockNum: String,  //柜锁编号
+    val safeInfo: Any,
+    val subId: String,
+    val subName: String,
+    val updateBy: String,
+    val updateName: Any,
+    var isType: Boolean = false,  //不选中 true选中
+    val updateTime: String
+)

+ 3 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/SearchBean.kt

@@ -0,0 +1,3 @@
+package com.rc.httpcore.bean
+
+data class SearchBean(val producerName:String)

+ 3 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/SearchSpecBean.kt

@@ -0,0 +1,3 @@
+package com.rc.httpcore.bean
+
+data class SearchSpecBean(val packUnit:String?,val packNum:String?)

+ 9 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/StockDetailsModel.kt

@@ -0,0 +1,9 @@
+package com.rc.httpcore.bean
+
+data class StockDetailsModel(
+    var rfidCode: String? = null,  //扫码获得
+    val stockId: String? = null,
+    val tagCode: String?, //二维码编号
+    var no: Int,
+    var wxCode: String? = null
+)

+ 6 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/StockModeBean.kt

@@ -0,0 +1,6 @@
+package com.rc.httpcore.bean
+
+//新增入库--化学品信息
+data class StockModeBean(
+    var stockModelList: List<StockModel>,
+)

+ 50 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/StockModel.kt

@@ -0,0 +1,50 @@
+package com.rc.httpcore.bean
+
+import java.math.BigDecimal
+
+data class StockModel(
+    val belongId: String? = null,
+    val belongName: String? = null,
+    val belongType: Int,
+    val buildId: String? = null,
+    val buildName: String? = null,
+    var cabinetId: String? = null,
+    var cabinetName: String? = null,
+    val casNum: String? = null,
+    val chemicalCategory: Int,
+    val chemicalId: String? = null,
+    val chemicalLevel: Int,
+    val chemicalName: String? = null,
+    val chemicalNumber: String? = null,
+    val chemicalPurity: String? = null,
+    val deptId: String? = null,
+    val deptName: String? = null,
+    var doorId: String? = null,
+    var doorName: String? = null,
+    val factory: String? = null,
+    val floorId: String? = null,
+    val floorName: String? = null,
+    val isNew: Boolean,
+    val joinType: Int,
+    val joinVideo: Any,
+    var layers: Int,  //一共几层
+    var layersTow: Int,//当前选择得层数
+//    val mLayers: Int,  //每一条 总共几层
+    val packNum: BigDecimal,   //数量
+    val packUnit: String,   //包装单位
+    val specNum: Double,
+    val specUnit: String, //规格单位
+    val stockDetailsModelList: List<StockDetailsModel>?, //每一瓶-的信息
+    val stockType: Int,
+    val subId: String,
+    val subName: String,
+    val subRoom: String?,
+    var waitId: String? = null,  //只有待入库  使用当前id
+    val weigh: Double,   //称重 重量
+    val netContent: Double, //  netContent = modelA.chemicalDensity * modelA.specNum  //密度
+    val expireTime: String?,
+    var oneUserId: String? = null,
+    var oneUserName: String? = null,
+    var twoUserId: String? = null,
+    var twoUserName: String? = null,
+)

+ 3 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/StockModelBean.kt

@@ -0,0 +1,3 @@
+package com.rc.httpcore.bean
+
+data class StockModelBean(var no: Int, var tagCode: String, var rfidCode: String?)

+ 28 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/TimeWarBean.kt

@@ -0,0 +1,28 @@
+package com.rc.httpcore.bean
+
+//业务异常需要传值
+data class TimeWarBean(
+    var belongName: String?=null,
+    var buildId: String?=null,
+    var buildName: String?=null,
+    var cabinetName: String?=null,
+    var casNum: String?=null,
+    var chemicalCategoryName: String?=null,
+    var chemicalName: String?=null,
+    var chemicalPurity: String?=null,
+    var deptId: String?=null,
+    var deptName: String?=null,
+    var doorName: String?=null,
+    var floorId: String?=null,
+    var floorName: String?=null,
+    var layers: String?=null,
+    var packUnit: String?=null,
+    var specNum: String?=null,
+    var specUnit: String?=null,
+    var stockTypeStr: String?=null,
+    var subId: String?=null,
+    var subName: String?=null,
+    var subRoom: String?=null,
+    var surplus: String?=null,
+    var tagCode: String?=null
+)

+ 22 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/TopicDataBean.kt

@@ -0,0 +1,22 @@
+package com.rc.httpcore.bean
+
+data class TopicDataBean(
+    val account: String,
+    val createBy: Long,
+    val createByName: String,
+    val createTime: String,
+    val deptId: String,
+    val deptName: String,
+    val id: String,
+    val isStart: Boolean,
+    val num: Int,
+    val remark: Any,
+    val source: Int,
+    val topicName: String,
+    val topicId: String,
+    val updateBy: Long,
+    val updateTime: String,
+    val userId: String,
+    val userName: String,
+    val userPhone: String
+)

+ 18 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/UnifiedVerBean.kt

@@ -0,0 +1,18 @@
+package com.rc.httpcore.bean
+
+//统一验证
+data class UnifiedVerBean(
+    val controlType: Boolean,  //是否管控
+    val createBy: Long,
+    val createTime: String,
+    val fluidMax: Int,
+    val id: String,
+    val inputWeight: Boolean, //是否允许手动录入
+    val metage: Boolean,    //是否领用称重
+    val outRange: Boolean,  //是否启用量程外
+    var qrCodePrint: Boolean=true,  //是否打印二维码
+    val solidMax: Int,
+    val updateBy: Long,
+    val updateTime: String,
+    val verify: Boolean   //是否双人认证
+)

+ 43 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/UseBean.kt

@@ -0,0 +1,43 @@
+package com.rc.httpcore.bean
+
+import java.math.BigDecimal
+
+data class UseBean(
+    val allBottle: Any,
+    val backOneUser: Any,
+    val backOneUserName: Any,
+    val backTwoUser: Any,
+    val backTwoUserName: Any,
+    val chemicalDensity: BigDecimal, //密度
+    val chemicalId: String,
+    val chemicalLevel: Boolean,
+    val chemicalName: String,
+    val collectNowNum: Any,
+    val collectStockNum: Any,
+    val collectTime: Any,
+    val configModel: ConfigModel,
+    val duration: String,
+    val id: String,
+    val lossAmount: Any,
+    val outOneUser: Any,
+    val outOneUserName: Any,
+    val outTwoUser: Any,
+    val outTwoUserName: Any,
+    val outType: Any,
+    val outVideo: Any,
+    val packNum: BigDecimal, //包装值
+    val packUnit: String,
+    val remark: Any,
+    val returnStockNum: Any,
+    val returnTime: Any,
+    val returnType: Any,
+    val returnVideo: Any,
+    val rfidCode: String,
+    val specNum: BigDecimal,  //规格值
+    val specUnit: String,//  g   ml
+    val stockId: Any,
+    val tagCode: String,
+    val useStatus: Int,
+    val stockDetailsId:String,
+    val surplus:BigDecimal, //库存量  可领用的值
+)

+ 15 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/UseLedBean.kt

@@ -0,0 +1,15 @@
+package com.rc.httpcore.bean
+
+
+data class UseLedBean(
+    val countId: Any,
+    val current: Int,
+    val maxLimit: Any,
+    val optimizeCountSql: Boolean,
+    val orders: List<Any>,
+    val pages: Int,
+    val records: List<UseLedgerListBean>,
+    val searchCount: Boolean,
+    val size: Int,
+    val total: Int   //总条数
+)

+ 68 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/UseLedgerListBean.kt

@@ -0,0 +1,68 @@
+package com.rc.httpcore.bean
+
+import java.math.BigDecimal
+
+//使用台账信息列表
+data class UseLedgerListBean(
+    val adventWarnDay: String,
+    val allBottle: String,
+    val backOneUser: String,
+    val backOneUserName: String,
+    val backTwoUser: String,
+    val backTwoUserName: String,
+    val backUser: String,
+    val backUserId: String,
+    val belongName: String,
+    val cabinetName: String,
+    val casNum: String,
+    val chemicalCategory: String,
+    val chemicalId: String,
+    val chemicalLevel: String,
+    val chemicalName: String,
+    val chemicalPurity: String,
+    val chemicalShape: Int,
+    val collectNowNum: BigDecimal,
+    val collectStockNum: BigDecimal,
+    val collectTime: String,
+    val createByName: String,
+    val doorName: String,
+    val duration: Any,
+    val expireTime: String,
+    val id: String,
+    val joinType: Int,
+    val layers: String,
+    val lossAmount: String,
+    val outOneUser: String,
+    val outOneUserName: String,
+    val outTwoUser: String,
+    val outTwoUserName: String,
+    val outType: Int,
+    val outUserName: String,
+    val outVideo: String,
+    val packNum: BigDecimal,
+    val packUnit: String,
+    val remark: String,
+    val returnStockNum: String,
+    val returnTime: String?,
+    val returnType: Int,
+    val returnVideo: String,
+    val rfidCode: String,
+    val safeInfo: Any,
+    val securityPhone: Any,
+    val securityUserName: Any,
+    val specNum: Int,
+    val specUnit: String,
+    val status: Int,
+    val statusStr: String?,
+    val stockDetailsId: String,
+    val stockId: String,
+    val subId: Long,
+    val subName: String,
+    val subRoom: String,
+    val surplus: BigDecimal,
+    val tagCode: String,
+    val usableNumber: BigDecimal,
+    val useAmount: BigDecimal,
+    val useStatus: Int,
+    val useUserName: String
+)

+ 16 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/UseNoBean.kt

@@ -0,0 +1,16 @@
+package com.rc.httpcore.bean
+
+data class UseNoBean(
+    val casNum: String?,
+    val chemicalCategory: String?,
+    val expireTime: String?,
+    val expireStatus: Int?,
+    val chemicalLevelName: String?,
+    val belongName: String?,
+    val specNum: Int,
+    val specUnit: String,
+    val packUnit: String,
+    val tagCode:String,
+    val surplus:String,
+    val chemicalName:String,
+)

+ 24 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/UseNoTwoBean.kt

@@ -0,0 +1,24 @@
+package com.rc.httpcore.bean
+
+import java.math.BigDecimal
+
+data class UseNoTwoBean(
+    val casNum: String?,
+    val chemicalCategoryName: String,
+    val chemicalName: String?,
+    val specNum: BigDecimal,
+    val specUnit: String,
+    val packUnit: String?,
+    val expireTime: String?,
+    val cabinetName: String?,
+    val doorName: String?,
+    val layers: Int,
+    val useStatus: Int,
+    val collectTime: String,
+    val tagCode: String,
+    val chemicalLevelName: String,
+    val surplus: BigDecimal,
+    val belongName: String,
+    val useName: String,
+    val statusStr: String,
+)

+ 6 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/UsePostDataBean.kt

@@ -0,0 +1,6 @@
+package com.rc.httpcore.bean
+
+//领用时需要上传得数据集
+data class UsePostDataBean(
+    var userecordModelList: List<ChemistryBean>,
+)

+ 15 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/UserData.kt

@@ -0,0 +1,15 @@
+package com.rc.httpcore.bean
+
+data class UserData(
+    val account: String,  //工号or学号
+    val avatar: String,
+    val expiresIn: Int,
+    val isInitPasswd: Any,
+    val license: String,
+    val tenantId: Int,
+    val token: String,
+    val userId: String,
+    val userName: String,
+    val userType: Int,
+    var cardNum:String //卡号
+)

+ 24 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/UserValidationBean.kt

@@ -0,0 +1,24 @@
+package com.rc.httpcore.bean
+
+//身份信息
+data class UserValidationBean(
+    val cabinetAdmin: Boolean? = false,         //柜锁管理员
+    val belongUser: Boolean? = false,           //是否化学品归属人
+    val toipcUser: Boolean? = false,            //是否化学品归属课题组下成员
+    val safeUser: Boolean? = false,             //安全负责人
+    val collegeAdmin: Boolean? = false,         //院级管理员
+    val schoolLevelAdmin: Boolean? = false,     //校级管理员
+    val adminUser: Boolean? = false,            //实验室负责人
+    val userId: String,
+    val userName: String,
+    var faceImg: String?,  //人员图片
+
+    //校级管理员 schoolLevelAdmin
+    //院级管理员  collegeAdmin
+    //实验室负责人 adminUser
+    //安全负责人 safeUser
+    //柜锁管理员 cabinetAdmin
+    //是否化学品归属人 belongUser
+    //是否化学品归属课题组下成员  toipcUser
+
+)

+ 15 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/WasteChemicalsBean.kt

@@ -0,0 +1,15 @@
+package com.rc.httpcore.bean
+
+data class WasteChemicalsBean(
+    val countId: Any,
+    val current: Int,
+    val maxLimit: Any,
+    val optimizeCountSql: Boolean,
+    val orders: List<Any>,
+    val pages: Int,
+//    val records: List<WasteChemicalsListBean>,
+    val records: List<ReturnDetailsBean>,
+    val searchCount: Boolean,
+    val size: Int,
+    val total: Int
+)

+ 51 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/WasteChemicalsListBean.kt

@@ -0,0 +1,51 @@
+package com.rc.httpcore.bean
+
+data class WasteChemicalsListBean(
+    val belongName: String,
+    val cabinetName: String,
+    val chemicalCategory: String,
+    val chemicalCategoryName: Any,
+    val chemicalLevel: Any,
+    val chemicalLevelName: Any,
+    val chemicalName: String,
+    val createBy: Long,
+    val createTime: String,
+    val disuseReason: Any,
+    val doorName: String,
+    val doorId: String,
+    var cabinetId: String,
+    val expireStatus: Int,
+    val expireTime: String?,
+    val id: String,
+    val joinTime: Any,
+    val joinUserId: Any,
+    val joinUserMobile: Any,
+    val joinUserName: Any,
+    val joinVideo: Any,
+    val layers: String,
+    val oneUserId: Any,
+    val oneUserMobile: Any,
+    val oneUserName: Any,
+    val outTime: Any,
+    val outUserId: Any,
+    val outUserMobile: Any,
+    val outUserName: Any,
+    val outVideo: Any,
+    val packNum: Double,
+    val packUnit: String,
+    val position: Any,
+    val rfidCode: String,
+    val safeUser: String,
+    val specNum: Double,
+    val specUnit: String,
+    val status: Int,
+    val stockId: String,
+    val subName: String,
+    val subRoom: String,
+    val surplus: Double,
+    val tagCode: String,
+    val twoUserId: Any,
+    val twoUserMobile: Any,
+    val twoUserName: Any,
+    val usages: Double
+)

+ 500 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/client/ApiRepository.kt

@@ -0,0 +1,500 @@
+package com.rc.httpcore.client
+
+import com.rc.httpcore.HttpClient
+import com.rc.httpcore.bean.ChemicalInfoBean
+import com.rc.httpcore.apk.AppInfo
+import com.rc.httpcore.apk.ProcessedBean
+import com.rc.httpcore.bean.InventoryListBean
+import com.rc.httpcore.bean.RuleBean
+import com.rc.httpcore.bean.*
+import com.rc.httpcore.bean.HxpStockWaitListBean
+import com.rc.httpcore.vo.CommonListResponse
+import com.rc.httpcore.vo.Optional
+import com.rc.httpcore.vo.request.*
+import com.rc.httpcore.vo.response.*
+import io.reactivex.Observable
+import io.reactivex.android.schedulers.AndroidSchedulers
+import io.reactivex.schedulers.Schedulers
+import java.io.File
+
+object ApiRepository {
+
+    private val mClientFactory by lazy { HttpClient.createClientFactory() }
+
+    /**
+     * 查询LOGO配置列表
+     */
+    fun queryLogoConfInfo(): Observable<ConfLogo> {
+        return mClientFactory.createLabClient()
+            .queryLogoConfInfo()
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 查询APK版本
+     *
+     * @param id 设备唯一编码
+     */
+//    fun apkVersion(id: String): Observable<ApkInfoResp> {
+//        return mClientFactory.createLabClient()
+//            .apkVersion(id)
+//            .subscribeOn(Schedulers.io())
+//            .observeOn(AndroidSchedulers.mainThread())
+//    }
+
+//    fun apkVersion(deviceNum: String, type: Int, version: Double): Observable<AppUpDateBean> {
+//        return mClientFactory.createLabClient()
+//            .apkVersion(deviceNum, type, version)
+//            .subscribeOn(Schedulers.io())
+//            .observeOn(AndroidSchedulers.mainThread())
+//    }
+
+    fun getCheck(deviceNum: String, type: String, version: Double): Observable<AppInfo> {
+        return mClientFactory.createLabClient()
+            .getCheck(deviceNum, type, version)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun cardNum(cardNum: String): Observable<UserData> {
+        return mClientFactory.createLabClient()
+            .cardNum(cardNum)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+   fun userCardValidation(userId: String,subId: String): Observable<UserValidationBean> {
+        return mClientFactory.createLabClient()
+            .userCardValidation(userId,subId)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun searchChemica(searchChemica: String,chemicalLevel:String?): Observable<List<ChemicalSearchBean>> {
+        return mClientFactory.createLabClient()
+            .searchChemica(searchChemica,chemicalLevel)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getOptions(typs:String): Observable<List<ChemicalTypeBean>> {
+        return mClientFactory.createLabClient()
+            .getOptions(typs)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun searchProducer(): Observable<List<SearchBean>> {
+        return mClientFactory.createLabClient()
+            .searchProducer()
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun searchSpec(specNum:String): Observable<SearchSpecBean> {
+        return mClientFactory.createLabClient()
+            .searchSpec(specNum)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getSelects(searchValue:String): Observable<List<BelongingPersonBean>> {
+        return mClientFactory.createLabClient()
+            .getSelects(searchValue)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getTopicList(userId:String): Observable<List<TopicDataBean>> {
+        return mClientFactory.createLabClient()
+            .getTopicList(userId)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getCabinetList(subId: String): Observable<List<RuleBean>> {
+        return mClientFactory.createLabClient()
+            .getCabinetList(subId)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getScanCode(macId:String,code:String,subId: String): Observable<UserData> {
+        return mClientFactory.createLabClient()
+            .getScanCode(macId,code,subId)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun certitude(model: ChemicalABean): Observable<ChemicalABean> {
+        return mClientFactory.createLabClient()
+            .certitude(model)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getRelList(subjectId: String): Observable<ChemicalInfoBean> {
+        return mClientFactory.createLabClient()
+            .getRelList(subjectId)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getUserIds(subId: String): Observable<List<String>> {
+        return mClientFactory.createLabClient()
+            .getUserIds(subId)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getCabinetBySubId(subId: String): Observable<List<RuleBean>> {
+        return mClientFactory.createLabClient()
+            .getCabinetBySubId(subId)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun stockWaitAdd(model: StockModeBean): Observable<Boolean> {
+        return mClientFactory.createLabClient()
+            .stockWaitAdd(model)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun addStockCheck(model: StockModel): Observable<Boolean> {
+        return mClientFactory.createLabClient()
+            .addStockCheck(model)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getStockWaitDetails(waitId: String): Observable<UnifiedVerBean> {
+        return mClientFactory.createLabClient()
+            .getStockWaitDetails(waitId)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun waitList(mutableMap: Map<String, Any>): Observable<PageHxpStockBean> {
+        return mClientFactory.createLabClient()
+            .waitList(mutableMap)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getStockList(mutableMap: Map<String, Any>): Observable<HxpStockWaitModeBean> {
+        return mClientFactory.createLabClient()
+            .getStockList(mutableMap)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getByRfid(rfidCode: String): Observable<UseBean> {
+        return mClientFactory.createLabClient()
+            .getByRfid(rfidCode)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun indexDetailbyRfid(rfidCode: String): Observable<UseNoBean> {
+        return mClientFactory.createLabClient()
+            .indexDetailbyRfid(rfidCode)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getStockDetailsByCode(rfidCode: String): Observable<UseNoTwoBean> {
+        return mClientFactory.createLabClient()
+            .getStockDetailsByCode(rfidCode)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun addUseRecord(model: UsePostDataBean): Observable<String> {
+        return mClientFactory.createLabClient()
+            .addUseRecord(model)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun useList(mutableMap: Map<String, String>): Observable<ReturningChemicalsBean> {
+        return mClientFactory.createLabClient()
+            .useList(mutableMap)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    //更换rfid
+    fun updateRfid(ids:String,rfidCode: String): Observable<String> {
+        return mClientFactory.createLabClient()
+            .updateRfid(ids,rfidCode)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun backDetail(rfidCode: String): Observable<ReturnDetailsBean> {
+        return mClientFactory.createLabClient()
+            .backDetail(rfidCode)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun chemicalSearchBean(rfidCode: String,subId: String): Observable<ChemicalSearchBean> {
+        return mClientFactory.createLabClient()
+            .chemicalSearchBean(rfidCode,subId)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+
+    fun discardDetail(rfidCode: String): Observable<ReturnDetailsBean> {
+        return mClientFactory.createLabClient()
+            .discardDetail(rfidCode)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun giveBack(model: GiveBackBean): Observable<Boolean> {
+        return mClientFactory.createLabClient()
+            .giveBack(model)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun returnGiveBack(model: GiveBackBean): Observable<ReturnGiveBackBean> {
+        return mClientFactory.createLabClient()
+            .returnGiveBack(model)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun stockDetailsList(mutableMap: Map<String, String>): Observable<WasteChemicalsBean> {
+        return mClientFactory.createLabClient()
+            .stockDetailsList(mutableMap)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getCabinetLock(doorId: String):Observable<List<LockVoListBean>>{
+        return mClientFactory.createLabClient()
+            .getCabinetLock(doorId)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun indexStockList(mutableMap:Map<String,String>): Observable<HxpStockWaitModeBean> {
+        return mClientFactory.createLabClient()
+            .indexStockList(mutableMap)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun warningNoticeList(mutableMap:Map<String,String>): Observable<EarlyWarningBean> {
+        return mClientFactory.createLabClient()
+            .warningNoticeList(mutableMap)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun warningNoticeDetail(id: String): Observable<ProcessedBean> {
+        return mClientFactory.createLabClient()
+            .warningNoticeDetail(id)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun handleMessage(noticeId: String,handleNotes:String): Observable<ProcessedBean> {
+        return mClientFactory.createLabClient()
+            .handleMessage(noticeId,handleNotes)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun warningNoticeCount(subId: String): Observable<String> {
+        return mClientFactory.createLabClient()
+            .warningNoticeCount(subId)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun indexDetailsList(mutableMap:Map<String,String>): Observable<QueryTwoBean> {
+        return mClientFactory.createLabClient()
+            .indexDetailsList(mutableMap)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun useValidation(cardNum:String,subId:String,doorId:String): Observable<UserValidationBean> {
+        return mClientFactory.createLabClient()
+            .useValidation(cardNum,subId, doorId)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun aioScanLogin(subId: String, doorId: String,code:String): Observable<UserValidationBean> {
+        return mClientFactory.createLabClient()
+            .aioScanLogin(subId, doorId, code)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun lockOperate(map: Map<String, Any>): Observable<Boolean> {
+        return mClientFactory.createLabClient()
+            .lockOperate(map)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun outTimeWarn(map: Map<String, Any>): Observable<Boolean> {
+        return mClientFactory.createLabClient()
+            .outTimeWarn(map)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getLocks(subId: String, lockNum: String): Observable<Boolean> {
+        return mClientFactory.createLabClient()
+            .getLocks(subId,lockNum)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun basicConfig(subId:String): Observable<ConfigBean> {
+        return mClientFactory.createLabClient()
+            .basicConfig(subId)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun useRecords(map: Map<String, Any>): Observable<UseLedBean> {
+        return mClientFactory.createLabClient()
+            .useRecords(map)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun stockLedger(map: Map<String, Any>): Observable<InventoryListBean> {
+        return mClientFactory.createLabClient()
+            .stockLedger(map)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun useReturnList(subId:String): Observable<UseLedBean> {
+        return mClientFactory.createLabClient()
+            .useReturnList(subId)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun tagDetailsList(map: Map<String, Any>): Observable<QueryTwoBean> {
+        return mClientFactory.createLabClient()
+            .tagDetailsList(map)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getDetailsById(id: String): Observable<ReturnDetailsBean> {
+        return mClientFactory.createLabClient()
+            .getDetailsById(id)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getMsdsDetails(searchValue: String?): Observable<MsdsBean> {
+        return mClientFactory.createLabClient()
+            .getMsdsDetails(searchValue)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun controlConfigs(chemicalLevel: Int): Observable<ChemicalConfsBean> {
+        return mClientFactory.createLabClient()
+            .controlConfigs(chemicalLevel)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun checkRfids(rfid: String): Observable<Boolean> {
+        return mClientFactory.createLabClient()
+            .checkRfids(rfid)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+
+    /**
+     * 上传APK更新状态
+     *
+     * @param state 0:升级失败; 1:升级成功; 2:升级中
+     */
+    fun onepcApkUpdate(id: String, state: String): Observable<Boolean> {
+        return mClientFactory.createLabClient()
+            .onepcApkUpdate(id, state)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+
+
+    /**
+     * 退出登录
+     */
+    fun loginOut(): Observable<Boolean> {
+        return mClientFactory.createLabClient()
+            .loginOut()
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 监听每分钟进行调用
+     */
+    fun monitor(deviceNo:String): Observable<Boolean> {
+        return mClientFactory.createLabClient()
+            .monitor(deviceNo)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 人脸登录
+     */
+    fun faceCompare(file: File, param: FaceCompareReq): Observable<UserData> {
+        return mClientFactory.createLabClient()
+            .faceCompare(file, param)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+    /**
+     * 人脸  双人认证
+     */
+    fun checkUserFaceByPic(file: File, param: FaceCompareReq): Observable<UserValidationBean> {
+        return mClientFactory.createLabClient()
+            .checkUserFaceByPic(file, param)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 双人验证 刷卡识别身份权限
+     */
+//    fun userValidation(map: Map<String, String>): Observable<UserValidationBean> {
+//        return mClientFactory.createLabClient()
+//            .userValidation(map)
+//            .subscribeOn(Schedulers.io())
+//            .observeOn(AndroidSchedulers.mainThread())
+//    }
+
+    /**
+     * 双人验证 刷卡识别身份权限
+     */
+    fun useCardVerify(map: Map<String, String>): Observable<UserValidationBean> {
+        return mClientFactory.createLabClient()
+            .useCardVerify(map)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+}

+ 183 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/client/ChemicalClient.kt

@@ -0,0 +1,183 @@
+package com.rc.httpcore.client
+
+import com.rc.httpcore.bean.ChemicalInfoBean
+import com.rc.httpcore.apk.AppInfo
+import com.rc.httpcore.apk.ProcessedBean
+import com.rc.httpcore.bean.InventoryListBean
+import com.rc.httpcore.bean.RuleBean
+import com.rc.httpcore.bean.*
+import com.rc.httpcore.bean.HxpStockWaitListBean
+import com.rc.httpcore.vo.CommonListResponse
+import com.rc.httpcore.vo.Optional
+import com.rc.httpcore.vo.request.*
+import com.rc.httpcore.vo.response.*
+import io.reactivex.Observable
+import java.io.File
+
+interface ChemicalClient {
+
+    /**
+     * 查询LOGO配置列表
+     */
+    fun queryLogoConfInfo(): Observable<ConfLogo>
+
+    /**
+     * 查询APK版本
+     *
+     * @param id 设备唯一编码
+     */
+//    fun apkVersion(id: String): Observable<ApkInfoResp>
+
+//    fun apkVersion(deviceNum: String,type:Int,version:Double): Observable<AppUpDateBean>
+
+    fun getCheck(deviceNum: String, type: String, version: Double): Observable<AppInfo>
+
+    fun cardNum(cardNum: String): Observable<UserData>
+
+    fun userCardValidation(userId: String, subId: String): Observable<UserValidationBean>
+
+//    fun userValidation(map: Map<String, String>): Observable<UserValidationBean>
+
+    fun useCardVerify(map: Map<String, String>): Observable<UserValidationBean>
+
+    fun searchChemica(
+        searchChemica: String,
+        chemicalLevel: String?
+    ): Observable<List<ChemicalSearchBean>>
+
+    fun getOptions(typs: String): Observable<List<ChemicalTypeBean>>
+
+    fun searchProducer(): Observable<List<SearchBean>>
+
+    fun searchSpec(specNum:String): Observable<SearchSpecBean>
+
+    fun getSelects(searchValue: String): Observable<List<BelongingPersonBean>>
+
+    fun getTopicList(userId: String): Observable<List<TopicDataBean>>
+
+    fun getCabinetList(subId: String): Observable<List<RuleBean>>
+
+    fun getScanCode(macId: String, code: String, subId: String): Observable<UserData>
+
+    fun certitude(model: ChemicalABean): Observable<ChemicalABean>
+
+    fun getRelList(model: String): Observable<ChemicalInfoBean>
+
+    fun getUserIds(subId: String): Observable<List<String>>
+
+    fun getCabinetBySubId(subId: String): Observable<List<RuleBean>>
+
+    fun stockWaitAdd(model: StockModeBean): Observable<Boolean>
+
+    fun addStockCheck(model: StockModel): Observable<Boolean>
+
+    fun getStockWaitDetails(waitId: String): Observable<UnifiedVerBean>
+
+    fun waitList(
+        mutableMap: Map<String, Any> ): Observable<PageHxpStockBean>
+
+    fun getStockList(
+        mutableMap: Map<String, Any>): Observable<HxpStockWaitModeBean>
+
+    fun getByRfid(rfidCode: String): Observable<UseBean>
+
+    fun indexDetailbyRfid(rfidCode: String): Observable<UseNoBean>
+
+    fun getStockDetailsByCode(rfidCode: String): Observable<UseNoTwoBean>
+
+    fun addUseRecord(model: UsePostDataBean): Observable<String>
+
+    fun useList(mutableMap: Map<String, String>): Observable<ReturningChemicalsBean>
+
+    fun updateRfid(ids: String, rfidCode: String?): Observable<String>
+
+    fun backDetail(rfidCode: String): Observable<ReturnDetailsBean>
+
+    fun chemicalSearchBean(rfidCode: String,subId:String): Observable<ChemicalSearchBean>
+
+    fun discardDetail(rfidCode: String): Observable<ReturnDetailsBean>
+
+    fun giveBack(model: GiveBackBean): Observable<Boolean>
+
+    fun returnGiveBack(model: GiveBackBean): Observable<ReturnGiveBackBean>
+
+    fun stockDetailsList(
+        mutableMap: Map<String, String>): Observable<WasteChemicalsBean>
+
+    fun getCabinetLock(doorId: String): Observable<List<LockVoListBean>>
+
+    fun indexStockList(map: Map<String, String>): Observable<HxpStockWaitModeBean>
+
+    fun warningNoticeList(map: Map<String, String>): Observable<EarlyWarningBean>
+
+    fun warningNoticeDetail(id: String): Observable<ProcessedBean>
+
+    fun handleMessage(noticeId: String, handleNotes: String): Observable<ProcessedBean>
+
+    fun warningNoticeCount(subId: String): Observable<String>
+
+    fun indexDetailsList(map: Map<String, String>): Observable<QueryTwoBean>
+
+    fun useValidation(
+        cardNum: String,
+        subId: String,
+        doorId: String
+    ): Observable<UserValidationBean>
+
+    fun aioScanLogin(subId: String, doorId: String, code: String): Observable<UserValidationBean>
+
+    fun lockOperate(map: Map<String, Any>): Observable<Boolean>
+
+    fun outTimeWarn(map: Map<String, Any>): Observable<Boolean>
+
+    fun getLocks(subId: String, lockNum: String): Observable<Boolean>
+
+    fun basicConfig(subId: String): Observable<ConfigBean>
+
+    fun useRecords(map: Map<String, Any>): Observable<UseLedBean>
+
+    fun stockLedger(map: Map<String, Any>): Observable<InventoryListBean>
+
+    fun useReturnList(subId: String): Observable<UseLedBean>
+
+    fun tagDetailsList(map: Map<String, Any>): Observable<QueryTwoBean>
+
+    fun getDetailsById(id: String): Observable<ReturnDetailsBean>
+
+    fun getMsdsDetails(searchValue: String?): Observable<MsdsBean>
+
+    fun msdsDetails(id: String): Observable<MsdsListBean>
+
+    fun controlConfigs(chemicalLevel: Int): Observable<ChemicalConfsBean>
+
+    fun checkRfids(rfid: String): Observable<Boolean>
+
+    /**
+     * 上传APK更新状态
+     *
+     * @param state 0:升级失败; 1:升级成功; 2:升级中
+     */
+    fun onepcApkUpdate(id: String, state: String): Observable<Boolean>
+
+    /**
+     * 学习一体机 用户端登录
+     *
+     * @param param 刷学生卡数据 userName
+     */
+    fun learnLogin(param: LearnLoginReq): Observable<LearnLoginVo>
+
+    /**
+     * 退出登录
+     */
+    fun loginOut(): Observable<Boolean>
+
+    fun monitor(deviceNo: String): Observable<Boolean>
+
+    /**
+     * 人脸比对
+     */
+    fun faceCompare(file: File, param: FaceCompareReq): Observable<UserData>
+
+    fun checkUserFaceByPic(file: File, param: FaceCompareReq): Observable<UserValidationBean>
+
+}

+ 9 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/client/factory/ClientFactory.kt

@@ -0,0 +1,9 @@
+package com.rc.httpcore.client.factory
+
+import com.rc.httpcore.client.ChemicalClient
+
+interface ClientFactory {
+
+    fun createLabClient(): ChemicalClient
+
+}

+ 9 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/client/factory/RetrofitFactory.kt

@@ -0,0 +1,9 @@
+package com.rc.httpcore.client.factory
+
+import com.rc.httpcore.client.retrofit.ChemicalRetrofit
+
+class RetrofitFactory : ClientFactory {
+
+    override fun createLabClient() = ChemicalRetrofit()
+
+}

+ 338 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/client/retrofit/ApiService.java

@@ -0,0 +1,338 @@
+package com.rc.httpcore.client.retrofit;
+
+import com.rc.httpcore.apk.ProcessedBean;
+import com.rc.httpcore.bean.ChemicalConfsBean;
+import com.rc.httpcore.bean.ConfigBean;
+import com.rc.httpcore.bean.EarlyWarningBean;
+import com.rc.httpcore.bean.InventoryListBean;
+import com.rc.httpcore.bean.BelongingPersonBean;
+import com.rc.httpcore.bean.ChemicalInfoBean;
+import com.rc.httpcore.apk.AppInfo;
+import com.rc.httpcore.bean.ChemicalSearchBean;
+import com.rc.httpcore.bean.LockVoListBean;
+import com.rc.httpcore.bean.MsdsBean;
+import com.rc.httpcore.bean.MsdsListBean;
+import com.rc.httpcore.bean.PageHxpStockBean;
+import com.rc.httpcore.bean.QueryTwoBean;
+import com.rc.httpcore.bean.ReturnDetailsBean;
+import com.rc.httpcore.bean.ReturnGiveBackBean;
+import com.rc.httpcore.bean.ReturningChemicalsBean;
+import com.rc.httpcore.bean.RuleBean;
+import com.rc.httpcore.bean.ChemicalABean;
+import com.rc.httpcore.bean.ChemicalTypeBean;
+import com.rc.httpcore.bean.SearchBean;
+import com.rc.httpcore.bean.SearchSpecBean;
+import com.rc.httpcore.bean.TopicDataBean;
+import com.rc.httpcore.bean.UnifiedVerBean;
+import com.rc.httpcore.bean.UseBean;
+import com.rc.httpcore.bean.UseLedBean;
+import com.rc.httpcore.bean.UseNoBean;
+import com.rc.httpcore.bean.UseNoTwoBean;
+import com.rc.httpcore.bean.UserData;
+import com.rc.httpcore.bean.UserValidationBean;
+import com.rc.httpcore.bean.WasteChemicalsBean;
+import com.rc.httpcore.bean.HxpStockWaitModeBean;
+import com.rc.httpcore.vo.CommonDataResponse;
+import com.rc.httpcore.vo.CommonListResponse;
+import com.rc.httpcore.vo.CommonResponse;
+import com.rc.httpcore.vo.request.FaceCompareReq;
+import com.rc.httpcore.vo.request.LearnLoginReq;
+import com.rc.httpcore.vo.response.ConfLogo;
+import com.rc.httpcore.vo.response.LearnLoginVo;
+import java.util.Map;
+import io.reactivex.Observable;
+import okhttp3.MultipartBody;
+import okhttp3.RequestBody;
+import retrofit2.http.Body;
+import retrofit2.http.GET;
+import retrofit2.http.Multipart;
+import retrofit2.http.POST;
+import retrofit2.http.PUT;
+import retrofit2.http.Part;
+import retrofit2.http.PartMap;
+import retrofit2.http.Path;
+import retrofit2.http.Query;
+
+public interface ApiService {
+
+    /**
+     * 查询LOGO配置列表
+     */
+    @GET("system/logo/config/getConfInfo")
+    Observable<CommonDataResponse<ConfLogo>> queryLogoConfInfo();
+
+    /**
+     * 查询APK版本
+     */
+//    @GET("laboratory/apkfile/onepcApkDetail/{id}")
+//    Observable<CommonDataResponse<ApkInfoResp>> apkVersion(@Path("id") String id);
+
+//    //更新apk
+//    @GET("system/app/upgrade/check")
+//    Observable<CommonDataResponse<AppUpDateBean>> apkVersion(@Query("deviceNum") String deviceNum, @Query("type") int type, @Query("version") double version);
+
+    //上报信息 获取当前设备基础信息
+    @GET("iot/aio/report")
+    Observable<CommonDataResponse<AppInfo>> getCheck(@Query("deviceNo") String deviceNum, @Query("code") String type, @Query("version") double version);
+
+
+    //刷卡认证  获取token
+    @GET("auth/cardNum")
+    Observable<CommonDataResponse<UserData>> cardNum(@Query("cardNum") String cardNum);
+
+    //刷卡登录 验证当前人员身份 是否属于当前实验室
+    @GET("chemical/aio/verify/userCardValidation")
+    Observable<CommonDataResponse<UserValidationBean>> userCardValidation(@Query("userId") String userId, @Query("subId") String subId);
+
+//    //    @POST("chemical/aio/userValidation")
+//    @POST("chemical/aio/identity/userValidation")
+//    Observable<CommonDataResponse<UserValidationBean>> userValidation(@Body RequestBody requestBody);
+
+    @POST("chemical/aio/verify/useCardVerify")
+    Observable<CommonDataResponse<UserValidationBean>> useCardVerify(@Body RequestBody requestBody);
+
+//    //化学品/cas搜索
+//    @GET("chemical/aio/searchChemica")
+//    Observable<CommonDataResponse<ChemicalDataBean>> searchChemica(@Query("searchValue") String searchValue, @Query("chemicalLevel") String chemicalLevel);
+
+    //化学品/cas搜索
+    @GET("chemical/aio/searchChemica")
+    Observable<CommonListResponse<ChemicalSearchBean>> searchChemica(@Query("searchValue") String searchValue, @Query("chemicalLevel") String chemicalLevel);
+
+    //化学品  品类查询
+    @GET("system/dict/item/option")
+    Observable<CommonListResponse<ChemicalTypeBean>> getOptions(@Query("dictCode") String dictCode);
+
+    //厂家搜索
+    @GET("chemical/aio/searchProducer")
+    Observable<CommonListResponse<SearchBean>> searchProducer();
+
+    //根据规格 查询 包装值
+    @GET("chemical/aio/searchSpec")
+    Observable<CommonDataResponse<SearchSpecBean>> searchSpec(@Query("specNum") String specNum);
+
+    //通过名字or工号 查询课题组 信息 system/user/select
+    @POST("system/user/select")
+    Observable<CommonListResponse<BelongingPersonBean>> getSelects(@Body RequestBody requestBody);
+
+    //查询归属课题信息
+//    @POST("system/topic/topicList")
+    @GET("system/topic/getTopicByUserId")
+    Observable<CommonListResponse<TopicDataBean>> getTopicList(@Query("userId") String userId);
+
+    @GET("chemical/aio/getCabinetList")
+    Observable<CommonListResponse<RuleBean>> getCabinetList(@Query("subId") String subId);
+
+    @GET("auth/scanCode")
+    Observable<CommonDataResponse<UserData>> getScanCode(@Query("macId") String macId, @Query("code") String code, @Query("subjectId") String subId);
+
+    @POST("chemical/aio/certitude")
+    Observable<CommonDataResponse<ChemicalABean>> certitude(@Body ChemicalABean param);
+
+    @POST("laboratory/subRelInfo/getRelList")
+    Observable<CommonListResponse<ChemicalInfoBean>> getRelList(@Body RequestBody requestBody);
+
+    @GET("chemical/aio/verify/getUserIds")
+    Observable<CommonListResponse> getUserIds(@Query("subId") String subId);
+
+    @GET("chemical/aio/getCabinetBySubId")
+    Observable<CommonListResponse<RuleBean>> getCabinetBySubId(@Query("subId") String subId);
+
+    @POST("chemical/aio/addStock")
+    Observable<CommonDataResponse<Boolean>> stockWaitAdd(@Body RequestBody requestBody);
+
+    //校验当前数据是否合法
+    @POST("chemical/aio/addStockCheck")
+    Observable<CommonDataResponse<Boolean>> addStockCheck(@Body RequestBody requestBody);
+
+    @GET("chemical/aio/getStockWaitDetails")
+    Observable<CommonDataResponse<UnifiedVerBean>> getStockWaitDetails(@Query("waitId") String waitId);
+
+    @POST("chemical/aio/waitList")
+    Observable<CommonDataResponse<PageHxpStockBean>> waitList(@Body RequestBody requestBody);
+
+    //领用列表查询
+    @POST("chemical/aio/stockList")
+    Observable<CommonDataResponse<HxpStockWaitModeBean>> getStockList(@Body RequestBody requestBody);
+
+    //通过rfid-tagcode码 查询当前需要领用得信息
+    @GET("chemical/aio/byRfid")
+    Observable<CommonDataResponse<UseBean>> getByRfid(@Query("rfidCode") String rfidCode);
+
+    @GET("chemical/aio/indexDetailbyRfid")
+    Observable<CommonDataResponse<UseNoBean>> indexDetailbyRfid(@Query("rfidCode") String rfidCode);
+
+    @GET("chemical/aio/getStockDetailsByCode")
+    Observable<CommonDataResponse<UseNoTwoBean>> getStockDetailsByCode(@Query("rfidCode") String rfidCode);
+
+    @POST("chemical/aio/addUserecord")
+    Observable<CommonDataResponse<String>> addUseRecord(@Body RequestBody requestBody);
+
+    //归还列表查询
+    @POST("chemical/aio/useList")
+    Observable<CommonDataResponse<ReturningChemicalsBean>> useList(@Body RequestBody requestBody);
+
+    //更换rfid
+    @POST("chemical/aio/updateRfid")
+    Observable<CommonDataResponse<String>> updateRfid(@Body RequestBody requestBody);
+
+    //归还化学品信息详情
+    @GET("chemical/aio/backDetail")
+    Observable<CommonDataResponse<ReturnDetailsBean>> backDetail(@Query("rfidCode") String rfidCode);
+
+    //归还化学品信息详情
+    @GET("chemical/stockWait/scanCodeChemical")
+    Observable<CommonDataResponse<ChemicalSearchBean>> scanCodeChemical(@Query("label") String label,@Query("subId") String subId);
+
+    //废弃化学品信息详情
+    @GET("chemical/aio/discardDetail")
+    Observable<CommonDataResponse<ReturnDetailsBean>> discardDetail(@Query("rfidCode") String rfidCode);
+
+    @POST("chemical/aio/giveBack")
+    Observable<CommonDataResponse> giveBack(@Body RequestBody requestBody);
+
+
+    //归还单独调用
+    @POST("chemical/aio/giveBack")
+    Observable<CommonDataResponse<ReturnGiveBackBean>> returnGiveBack(@Body RequestBody requestBody);
+
+    //废弃列表查询
+    @POST("chemical/aio/stockDetailsList")
+    Observable<CommonDataResponse<WasteChemicalsBean>> stockDetailsList(@Body RequestBody requestBody);
+
+    @GET("chemical/aio/getCabinetLock")
+    Observable<CommonListResponse<LockVoListBean>> getCabinetLock(@Query("doorId") String doorId);
+
+    //查询--查询当前所有化学品库存信息 --
+    @POST("chemical/aio/indexStockList")
+    Observable<CommonDataResponse<HxpStockWaitModeBean>> indexStockList(@Body RequestBody requestBody);
+
+    //查询--查询当前所有化学品库存信息 --
+    @POST("chemical/aio/indexDetailsList")
+    Observable<CommonDataResponse<QueryTwoBean>> indexDetailsList(@Body RequestBody requestBody);
+
+    @POST("system/aioUnify/warningNoticeList")
+    Observable<CommonDataResponse<EarlyWarningBean>> warningNoticeList(@Body RequestBody requestBody);
+
+    @GET("system/aioUnify/warningNoticeDetail")
+    Observable<CommonDataResponse<ProcessedBean>> warningNoticeDetail(@Query("id") String id);
+
+    @POST("system/warningNotice/handleMessage")
+    Observable<CommonDataResponse<ProcessedBean>> handleMessage(@Body RequestBody requestBody);
+
+    @GET("system/aioUnify/warningNoticeCount")
+    Observable<CommonDataResponse<String>> warningNoticeCount(@Query("subId")String subId);
+
+    //领用使用的双人认证
+    @POST("chemical/aio/identity/useValidation")
+    Observable<CommonDataResponse<UserValidationBean>> useValidation(@Body RequestBody requestBody);
+
+    @POST("chemical/aio/verify/aioScanLogin")
+    Observable<CommonDataResponse<UserValidationBean>> aioScanLogin(@Body RequestBody requestBody);
+
+    @POST("chemical/aio/lockOperate")
+    Observable<CommonDataResponse> lockOperate(@Body RequestBody requestBody);
+
+    //业务异常的提醒  开锁后 当页面返回后  调用
+    @POST("chemical/aio/outTimeWarn")
+    Observable<CommonDataResponse> outTimeWarn(@Body RequestBody requestBody);
+
+    //查询开锁状态
+    @GET("chemical/aio/getLockStatus")
+    Observable<CommonDataResponse<Boolean>> getLocks(@Query("subId") String subId, @Query("lockNum") String lockNum);
+
+    //获取基础信息  刷卡 人脸  扫码
+    @GET("chemical/aio/basicConfig")
+    Observable<CommonDataResponse<ConfigBean>> basicConfig(@Query("subId") String subId);
+
+    @POST("chemical/aio/useRecords")
+    Observable<CommonDataResponse<UseLedBean>> useRecords(@Body RequestBody requestBody);
+
+    @POST("chemical/aio/stockLedger")
+    Observable<CommonDataResponse<InventoryListBean>> stockLedger(@Body RequestBody requestBody);
+
+    @POST("chemical/aio/useReturnList")
+    Observable<CommonDataResponse<UseLedBean>> useReturnList(@Body RequestBody requestBody);
+
+    @POST("chemical/aio/tagDetailsList")
+    Observable<CommonDataResponse<QueryTwoBean>> tagDetailsList(@Body RequestBody requestBody);
+
+    @GET("chemical/aio/getDetailsById")
+    Observable<CommonDataResponse<ReturnDetailsBean>> getDetailsById(@Query("id") String id);
+
+    //列表
+    @GET("chemical/aio/msds")
+    Observable<CommonDataResponse<MsdsBean>> getMsdsDetails(@Query("searchValue") String id);
+
+    //列表查询单挑
+    @GET("chemical/aio/msdsDetails")
+    Observable<CommonDataResponse<MsdsListBean>> msdsDetails(@Query("id") String id);
+
+    //化学品基础信息配置  是否打印 是否超重
+    @GET("chemical/aio/controlConfig")
+    Observable<CommonDataResponse<ChemicalConfsBean>> controlConfigs(@Query("chemicalLevel") int id);
+
+    //校验rfid的唯一性
+    @GET("chemical/aio/checkRfid")
+    Observable<CommonDataResponse<Boolean>> checkRfids(@Query("rfid") String rfid);
+
+    //详情
+
+    /**
+     * 退出登录
+     */
+    @GET("auth/logout")
+    Observable<CommonResponse> loginOut();
+
+    @GET("iot/aio/monitor")
+    Observable<CommonResponse> monitor(@Query("deviceNo") String deviceNo);
+
+    /**
+     * 上传APK更新状态
+     *
+     * @param state 0:升级失败; 1:升级成功; 2:升级中
+     */
+    @PUT("laboratory/apkfile/onepcApkUpdate/{id}/{state}")
+    Observable<CommonResponse> onepcApkUpdate(@Path("id") String id, @Path("state") String state);
+
+    /**
+     * 用户端登录
+     */
+    @POST("auth/learn/login")
+    Observable<CommonDataResponse<LearnLoginVo>> learnLogin(@Body LearnLoginReq param);
+
+//    /**
+//     * 退出登录
+//     */
+//    @POST("auth/learn/loginOut")
+//    Observable<CommonResponse> loginOut();
+
+    /**
+     * 人脸比对
+     */
+    @POST("{basePath}/faceApi/compare")
+    Observable<CommonDataResponse<String>> faceCompare(@Path("basePath") String basePath, @Body FaceCompareReq param);
+
+    /**
+     * 人脸比对  登录使用
+     */
+    @Multipart
+//    @POST("{basePath}/faceApi/newCompare")
+    @POST("auth/faceByPic")
+    Observable<CommonDataResponse<UserData>> faceNewCompare(@Part MultipartBody.Part filePart, @PartMap Map<String, RequestBody> files);
+
+    /**
+     * 人脸比对  人脸认证
+     */
+    @Multipart
+//    @POST("chemical/aio/identity/checkUserFaceByPic")
+    @POST("chemical/aio/verify/checkUserFaceByPic")
+    Observable<CommonDataResponse<UserValidationBean>> checkUserFaceByPic(@Part MultipartBody.Part filePart, @PartMap Map<String, RequestBody> files);
+
+//    /**
+//     * 双人验证 刷卡识别身份权限
+//     */
+//    @POST("chemical/api/userValidation")
+//    Observable<CommonDataResponse<UserValidationVo>> userValidation(@Body UserValidationVo param);
+
+}

+ 867 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/client/retrofit/ChemicalRetrofit.kt

@@ -0,0 +1,867 @@
+package com.rc.httpcore.client.retrofit
+
+import android.util.Log
+import com.google.gson.Gson
+import com.rc.httpcore.HttpClient
+import com.rc.httpcore.HttpConfig
+import com.rc.httpcore.bean.ChemicalInfoBean
+import com.rc.httpcore.apk.AppInfo
+import com.rc.httpcore.apk.ProcessedBean
+import com.rc.httpcore.bean.InventoryListBean
+import com.rc.httpcore.bean.RuleBean
+
+import com.rc.httpcore.bean.*
+import com.rc.httpcore.client.ChemicalClient
+import com.rc.httpcore.bean.HxpStockWaitListBean
+import com.rc.httpcore.exception.NetException
+import com.rc.httpcore.vo.CommonListResponse
+import com.rc.httpcore.vo.Optional
+import com.rc.httpcore.vo.request.*
+import com.rc.httpcore.vo.response.*
+import io.reactivex.Observable
+import okhttp3.MediaType
+import okhttp3.MultipartBody
+import okhttp3.RequestBody
+import java.io.File
+
+
+class ChemicalRetrofit : ChemicalClient {
+
+    private val apiService by lazy {
+        HttpClient.createRetrofitApi(ApiService::class.java)
+    }
+
+    /**
+     * 查询LOGO配置列表
+     */
+    override fun queryLogoConfInfo(): Observable<ConfLogo> {
+        return apiService.queryLogoConfInfo()
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+
+                return@map response.data
+            }
+    }
+
+//    override fun apkVersion(
+//        deviceNum: String,
+//        type: Int,
+//        version: Double
+//    ): Observable<AppUpDateBean> {
+//        return apiService.apkVersion(deviceNum, type, version)
+//            .map { response ->
+//                if (!response.isSuccess()) {
+//                    throw NetException(response.code, response.message)
+//                }
+//                return@map response.data
+//            }
+//    }
+
+    override fun getCheck(deviceNum: String, type: String, version: Double): Observable<AppInfo> {
+        return apiService.getCheck(deviceNum, type, version)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun cardNum(cardNum: String): Observable<UserData> {
+        return apiService.cardNum(cardNum)
+            .map { response ->
+                if (!response.isSuccess()) {
+//                    throw NetException(response.code, response.message)
+                    throw NetException(response.code, response.message)
+                }
+
+                HttpClient.token = response.data?.token!!
+                return@map response.data
+            }
+    }
+
+    override fun userCardValidation(userId: String, subId: String): Observable<UserValidationBean> {
+        Log.d("====人脸登录-验证","====人脸登录-验证")
+        return apiService.userCardValidation(userId, subId)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+//    //    override fun userValidation(cardNum: String,subId:String,doorId:String,stockId:String): Observable<String> {
+//    override fun userValidation(map: Map<String, String>): Observable<UserValidationBean> {
+//        val gson = Gson()
+//        val json = gson.toJson(map)
+//        Log.d("=====q==", json)
+//        val requestBody = RequestBody.create(MediaType.parse("application/json"), json)
+//        return apiService.userValidation(requestBody)
+//            .map { response ->
+//                if (!response.isSuccess()) {
+//                    throw NetException(response.code, response.message)
+//                }
+//
+////                HttpClient.token = response.data?.token
+//                return@map response.data
+//            }
+//    }
+
+    override fun useCardVerify(map: Map<String, String>): Observable<UserValidationBean> {
+        val gson = Gson()
+        val json = gson.toJson(map)
+        Log.d("=====q==", json)
+        val requestBody = RequestBody.create(MediaType.parse("application/json"), json)
+        return apiService.useCardVerify(requestBody)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+
+//                HttpClient.token = response.data?.token
+                return@map response.data
+            }
+    }
+
+    override fun searchChemica(
+        searchChemica: String,
+        chemicalLevel: String?
+    ): Observable<List<ChemicalSearchBean>> {
+        return apiService.searchChemica(searchChemica, chemicalLevel)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+
+                return@map response.data
+            }
+    }
+
+    override fun getOptions(typs: String): Observable<List<ChemicalTypeBean>> {
+        return apiService.getOptions(typs)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+
+                return@map response.data
+            }
+    }
+
+    override fun searchProducer(): Observable<List<SearchBean>> {
+        return apiService.searchProducer()
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+
+                return@map response.data
+            }
+    }
+
+    override fun searchSpec(specNum: String): Observable<SearchSpecBean> {
+        return apiService.searchSpec(specNum)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+
+                return@map response.data
+            }
+    }
+
+    override fun getSelects(searchValue: String): Observable<List<BelongingPersonBean>> {
+        val json = "{\"searchValue\":\"$searchValue\"}"
+        val requestBody = RequestBody.create(MediaType.parse("application/json"), json)
+        return apiService.getSelects(requestBody)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+
+                return@map response.data
+            }
+    }
+
+    override fun getTopicList(userId: String): Observable<List<TopicDataBean>> {
+//        val json = "{}"
+//        val requestBody = RequestBody.create(MediaType.parse("application/json"), json)
+        return apiService.getTopicList(userId)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+
+                return@map response.data
+            }
+    }
+
+    override fun getCabinetList(subId: String): Observable<List<RuleBean>> {
+        return apiService.getCabinetList(subId)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data!!
+            }
+    }
+
+    override fun getScanCode(macId: String, code: String, subId: String): Observable<UserData> {
+        return apiService.getScanCode(macId, code, subId)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                HttpClient.token = response.data?.token!!
+                return@map response.data!!
+            }
+    }
+
+    override fun certitude(model: ChemicalABean): Observable<ChemicalABean> {
+        val gson = Gson()
+        val json = gson.toJson(model)
+        Log.d("=========新增确定====", "$json")
+        return apiService.certitude(model)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun getRelList(subjectId: String): Observable<ChemicalInfoBean> {
+        val json = "{\"subId\":$subjectId}"
+        val requestBody = RequestBody.create(MediaType.parse("application/json"), json)
+        return apiService.getRelList(requestBody)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data!![0]
+            }
+    }
+
+    override fun getUserIds(subId: String): Observable<List<String>> {
+        return apiService.getUserIds(subId)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data as List<String>?
+            }
+    }
+
+    override fun getCabinetBySubId(subId: String): Observable<List<RuleBean>> {
+        return apiService.getCabinetBySubId(subId)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun stockWaitAdd(model: StockModeBean): Observable<Boolean> {
+        val gson = Gson()
+        val jsonArray = gson.toJson(model)
+        Log.d("=========新增入库", jsonArray)
+        val requestBody = RequestBody.create(MediaType.parse("application/json"), jsonArray)
+        return apiService.stockWaitAdd(requestBody)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun addStockCheck(model: StockModel): Observable<Boolean> {
+        val gson = Gson()
+        val jsonArray = gson.toJson(model)
+        Log.d("=========校验", jsonArray)
+        val requestBody = RequestBody.create(MediaType.parse("application/json"), jsonArray)
+        return apiService.addStockCheck(requestBody)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map true
+            }
+    }
+
+    override fun getStockWaitDetails(waitId: String): Observable<UnifiedVerBean> {
+        return apiService.getStockWaitDetails(waitId)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun waitList(mutableMap: Map<String, Any>): Observable<PageHxpStockBean> {
+        val gson = Gson()
+        val jsonArray = gson.toJson(mutableMap)
+        Log.d("=领用==", "$jsonArray")
+        val requestBody = RequestBody.create(MediaType.parse("application/json"), jsonArray)
+        return apiService.waitList(requestBody)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun getStockList(
+        mutableMap: Map<String, Any>
+    ): Observable<HxpStockWaitModeBean> {
+
+        val gson = Gson()
+        val jsonArray = gson.toJson(mutableMap)
+        Log.d("=领用==", "$jsonArray")
+        val requestBody = RequestBody.create(MediaType.parse("application/json"), jsonArray)
+        return apiService.getStockList(requestBody)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun getByRfid(rfidCode: String): Observable<UseBean> {
+        return apiService.getByRfid(rfidCode)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun indexDetailbyRfid(rfidCode: String): Observable<UseNoBean> {
+        return apiService.indexDetailbyRfid(rfidCode)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun getStockDetailsByCode(rfidCode: String): Observable<UseNoTwoBean> {
+        Log.d("=rfidCode==", "$rfidCode")
+        return apiService.getStockDetailsByCode(rfidCode)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun addUseRecord(model: UsePostDataBean): Observable<String> {
+        val gson = Gson()
+        val jsonArray = gson.toJson(model)
+        Log.d("=领用==", "$jsonArray")
+        val requestBody = RequestBody.create(MediaType.parse("application/json"), jsonArray)
+        return apiService.addUseRecord(requestBody)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun useList(mutableMap: Map<String, String>): Observable<ReturningChemicalsBean> {
+//        val json =
+//            "{\"subId\":$subId,\"backStatusCollect\":[1,2],\"cabinetId\":$cabinetId,\"doorId\":$doorId,\"layers\":$layers,\"searchValue\":${searchValue},\"page\":${page},\"pageSize\":${pageSize}}"
+//        Log.d("===", "$json")
+        val gson = Gson()
+        val json = gson.toJson(mutableMap)
+        Log.d("=========查询信息======", json)
+        val requestBody = RequestBody.create(MediaType.parse("application/json"), json)
+        return apiService.useList(requestBody)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun updateRfid(
+        ids: String,
+        rfidCode: String?
+    ): Observable<String> {
+        val json =
+            "{\"id\":$ids,\"rfidCode\":\"$rfidCode\"}"
+        Log.d("==更换rfid=", "$json")
+        val requestBody = RequestBody.create(MediaType.parse("application/json"), json)
+        return apiService.updateRfid(requestBody)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun backDetail(rfidCode: String): Observable<ReturnDetailsBean> {
+        return apiService.backDetail(rfidCode)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun chemicalSearchBean(codes: String,subId: String): Observable<ChemicalSearchBean> {
+        return apiService.scanCodeChemical(codes,subId)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun discardDetail(rfidCode: String): Observable<ReturnDetailsBean> {
+        return apiService.discardDetail(rfidCode)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun giveBack(model: GiveBackBean): Observable<Boolean> {
+        val gson = Gson()
+        val jsonArray = gson.toJson(model)
+        Log.d("==归还=", "$jsonArray")
+        val requestBody = RequestBody.create(MediaType.parse("application/json"), jsonArray)
+        return apiService.giveBack(requestBody)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map true
+            }
+    }
+
+    override fun returnGiveBack(model: GiveBackBean): Observable<ReturnGiveBackBean> {
+        val gson = Gson()
+        val jsonArray = gson.toJson(model)
+        Log.d("==归还=", "$jsonArray")
+        val requestBody = RequestBody.create(MediaType.parse("application/json"), jsonArray)
+        return apiService.returnGiveBack(requestBody)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun stockDetailsList(
+        mutableMap: Map<String, String>): Observable<WasteChemicalsBean> {
+        val gson = Gson()
+        val json = gson.toJson(mutableMap)
+        Log.d("=========查询信息======", json)
+        val requestBody = RequestBody.create(MediaType.parse("application/json"), json)
+        return apiService.stockDetailsList(requestBody)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun getCabinetLock(doorId: String): Observable<List<LockVoListBean>> {
+        return apiService.getCabinetLock(doorId)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun indexStockList(mutableMap: Map<String, String>): Observable<HxpStockWaitModeBean> {
+        val gson = Gson()
+        val json = gson.toJson(mutableMap)
+        Log.d("=========查询信息======", json)
+        val requestBody = RequestBody.create(MediaType.parse("application/json"), json)
+        return apiService.indexStockList(requestBody)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun warningNoticeList(map: Map<String, String>): Observable<EarlyWarningBean> {
+        val gson = Gson()
+        val json = gson.toJson(map)
+        Log.d("=========查询信息======", json)
+        val requestBody = RequestBody.create(MediaType.parse("application/json"), json)
+        return apiService.warningNoticeList(requestBody)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun warningNoticeDetail(id: String): Observable<ProcessedBean> {
+        return apiService.warningNoticeDetail(id)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun handleMessage(noticeId: String, handleNotes: String): Observable<ProcessedBean> {
+        val json = "{\"noticeId\":$noticeId,\"handleNotes\":\"$handleNotes\"}"
+        Log.d("===", "$json")
+        val requestBody = RequestBody.create(MediaType.parse("application/json"), json)
+        return apiService.handleMessage(requestBody)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun warningNoticeCount(subId: String): Observable<String> {
+        return apiService.warningNoticeCount(subId)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun indexDetailsList(mutableMap: Map<String, String>): Observable<QueryTwoBean> {
+        val gson = Gson()
+        val json = gson.toJson(mutableMap)
+        Log.d("================", "$json")
+        val requestBody = RequestBody.create(MediaType.parse("application/json"), json)
+        return apiService.indexDetailsList(requestBody)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun useValidation(
+        cardNum: String,
+        subId: String,
+        doorId: String
+    ): Observable<UserValidationBean> {
+        var json = "{\"cardNum\":\"${cardNum}\",\"subId\":$subId,\"doorId\":$doorId}"
+        Log.d("================", "$json")
+        val requestBody = RequestBody.create(MediaType.parse("application/json"), json)
+        return apiService.useValidation(requestBody)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun aioScanLogin(subId: String, doorId: String,code:String): Observable<UserValidationBean> {
+//        var json = "{\"cardNum\":\"${cardNum}\",\"subId\":$subId,\"doorId\":$doorId}"
+        var json = "{\"subId\":$subId,\"doorId\":$doorId,\"code\":\"$code\"}"
+        Log.d("=====扫码参数","$json")
+        val requestBody = RequestBody.create(MediaType.parse("application/json"), json)
+        return apiService.aioScanLogin(requestBody)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun lockOperate(mutableMap: Map<String, Any>): Observable<Boolean> {
+        val gson = Gson()
+        val json = gson.toJson(mutableMap)
+        Log.d("=====开锁参数:","$json")
+        val requestBody = RequestBody.create(MediaType.parse("application/json"), json)
+        return apiService.lockOperate(requestBody)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map true
+            }
+    }
+
+    override fun outTimeWarn(map: Map<String, Any>): Observable<Boolean> {
+        val gson = Gson()
+        val json = gson.toJson(map)
+        Log.d("=====预警上报:","$json")
+        val requestBody = RequestBody.create(MediaType.parse("application/json"), json)
+        return apiService.outTimeWarn(requestBody)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map true
+            }
+    }
+
+    override fun getLocks(subId: String, lockNum: String): Observable<Boolean> {
+        return apiService.getLocks(subId, lockNum)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun basicConfig(subId: String): Observable<ConfigBean> {
+        return apiService.basicConfig(subId)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun useRecords(map: Map<String, Any>): Observable<UseLedBean> {
+        val gson = Gson()
+        val json = gson.toJson(map)
+        Log.d("=======使用台账",json)
+        val requestBody = RequestBody.create(MediaType.parse("application/json"), json)
+        return apiService.useRecords(requestBody)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun stockLedger(map: Map<String, Any>): Observable<InventoryListBean> {
+        val gson = Gson()
+        val json = gson.toJson(map)
+        Log.d("=======库存台账",json)
+        val requestBody = RequestBody.create(MediaType.parse("application/json"), json)
+        return apiService.stockLedger(requestBody)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun useReturnList(subId: String): Observable<UseLedBean> {
+        var json = "{\"subId\":$subId,\"backStatusCollect\":[1,2]}"
+        val requestBody = RequestBody.create(MediaType.parse("application/json"), json)
+        return apiService.useReturnList(requestBody)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun tagDetailsList(map: Map<String, Any>): Observable<QueryTwoBean> {
+        val gson = Gson()
+        val json = gson.toJson(map)
+        Log.d("===标签查询====","$json")
+        val requestBody = RequestBody.create(MediaType.parse("application/json"), json)
+        return apiService.tagDetailsList(requestBody)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun getDetailsById(id: String): Observable<ReturnDetailsBean> {
+        return apiService.getDetailsById(id)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun getMsdsDetails(searchValue: String?): Observable<MsdsBean> {
+        return apiService.getMsdsDetails(searchValue)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun msdsDetails(id: String): Observable<MsdsListBean> {
+        return apiService.msdsDetails(id)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun controlConfigs(chemicalLevel: Int): Observable<ChemicalConfsBean> {
+        return apiService.controlConfigs(chemicalLevel)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun checkRfids(rfid: String): Observable<Boolean> {
+        return apiService.checkRfids(rfid)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+
+    /**
+     * 上传APK更新状态
+     *
+     * @param state 0:升级失败; 1:升级成功; 2:升级中
+     */
+    override fun onepcApkUpdate(id: String, state: String): Observable<Boolean> {
+        return apiService.onepcApkUpdate(id, state)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map true
+            }
+    }
+
+    /**
+     * 用户端登录
+     *
+     * @param param 刷学生卡数据 userName
+     */
+    override fun learnLogin(param: LearnLoginReq): Observable<LearnLoginVo> {
+        Log.d("param:===========", "" + param.machineCode)
+        Log.d("param:===========", "" + param.userName)
+        Log.d("param:===========", "" + param.type)
+        Log.d("param:===========", "" + param.aioType)
+        return apiService.learnLogin(param)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+
+//                HttpClient.token = response.data?.access_token
+                return@map response.data
+            }
+    }
+
+    /**
+     * 退出登录
+     */
+    override fun loginOut(): Observable<Boolean> {
+        return apiService.loginOut()
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+
+                return@map true
+            }
+    }
+
+    override fun monitor(deviceNo: String): Observable<Boolean> {
+        return apiService.monitor(deviceNo)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map true
+            }
+    }
+
+    /**
+     * 人脸比对
+     */
+    override fun faceCompare(file: File, param: FaceCompareReq): Observable<UserData> {
+        val fileBody = RequestBody.create(MediaType.parse("multipart/form-data"), file)
+        val filePart = MultipartBody.Part.createFormData("file", file.name, fileBody)
+        val map = HashMap<String, RequestBody>()
+        Log.d("====人脸登录-比对","人脸登录-比对")
+//        map["userId"] = RequestBody.create(MediaType.parse("text/plain"), param.userId)
+        map["userIds"] = RequestBody.create(MediaType.parse("text/plain"), param.userIds)
+//        return apiService.faceNewCompare(HttpConfig.BASE_PATH_FACE, filePart, map)
+        return apiService.faceNewCompare(filePart, map)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                HttpClient.token = response.data?.token!!
+                return@map response.data
+            }
+    }
+    override fun checkUserFaceByPic(
+        file: File,
+        param: FaceCompareReq
+    ): Observable<UserValidationBean> {
+        val fileBody = RequestBody.create(MediaType.parse("multipart/form-data"), file)
+        val filePart = MultipartBody.Part.createFormData("file", file.name, fileBody)
+        val map = HashMap<String, RequestBody>()
+        Log.d("====人脸登录-登录", "${HttpClient.token}")
+        map["subId"] = RequestBody.create(MediaType.parse("text/plain"), param.subId)
+        if (param.doorId != null) {
+            map["doorId"] = RequestBody.create(MediaType.parse("text/plain"), param.doorId)
+        }
+        if (param.stockId != null) {
+            map["stockId"] = RequestBody.create(MediaType.parse("text/plain"), param.stockId)
+        }
+        if (param.waitId != null) {
+            map["waitId"] = RequestBody.create(MediaType.parse("text/plain"), param.waitId)
+        }
+        return apiService.checkUserFaceByPic(filePart, map)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.message)
+                }
+                return@map response.data
+            }
+    }
+
+
+
+}

+ 25 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/config/ConfigCore.kt

@@ -0,0 +1,25 @@
+package com.rc.httpcore.config
+
+import com.rc.httpcore.HttpConfig
+
+object ConfigCore {
+
+    fun initConfig(config: ConfigParam?, baseUrlSp: String?, apiVersion: Int) {
+        if (null != config) {
+            HttpConfig.API_BASE_URL = if (baseUrlSp.isNullOrEmpty()) config.baseUrl else baseUrlSp
+            HttpConfig.HTTP_STRATEGY = config.httpStrategy
+
+            when (apiVersion) {
+                HttpConfig.ApiVersion.V1.code -> {
+                    HttpConfig.BASE_PATH_FACE = HttpConfig.BasePathV1.FACE
+                    HttpConfig.BASE_PATH_BASE = HttpConfig.BasePathV1.BASE
+                }
+                HttpConfig.ApiVersion.V2.code -> {
+                    HttpConfig.BASE_PATH_FACE = HttpConfig.BasePathV2.ALGORITHM
+                    HttpConfig.BASE_PATH_BASE = HttpConfig.BasePathV2.BASE
+                }
+            }
+        }
+    }
+
+}

+ 30 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/config/ConfigFactory.kt

@@ -0,0 +1,30 @@
+package com.rc.httpcore.config
+
+import com.rc.httpcore.HttpConfig
+
+class ConfigFactory {
+
+    companion object {
+        val buildDebugConfig = ConfigParam.Builder()
+            //.baseUrl("https://lab.sxitdlc.com/appTest/")
+//            .baseUrl("http://192.168.1.43/labSystem/")
+            .baseUrl("http://192.168.1.43/labSystem/")
+//            .fileBrowserBaseUrl("http://180.76.134.43:31007/")
+            .httpStrategy(HttpConfig.HTTP_STRATEGY_Retrofit)
+            //.mqttServerUri("tcp://180.76.134.43:1883")
+            .mqttServerUri("tcp://192.168.1.43:1883")
+            .mqttUName("mqtt")
+            .mqttUPwd("mqtt@zd1883")
+            .build()
+
+        val buildReleaseConfig = ConfigParam.Builder()
+            .baseUrl("https://lab.sxitdlc.com/labSystem/")
+            .fileBrowserBaseUrl("http://180.76.134.43:31007/")
+            .httpStrategy(HttpConfig.HTTP_STRATEGY_Retrofit)
+            .mqttServerUri("tcp://180.76.134.43:1883")
+            .mqttUName("mqtt")
+            .mqttUPwd("mqtt@zd1883")
+            .build()
+    }
+
+}

+ 68 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/config/ConfigParam.kt

@@ -0,0 +1,68 @@
+package com.rc.httpcore.config
+
+import com.rc.httpcore.HttpConfig
+
+class ConfigParam(builder: Builder) {
+
+    val baseUrl: String = builder.baseUrl
+    val fileBrowserBaseUrl: String = builder.fileBrowserBaseUrl
+
+    val httpStrategy: Int = builder.httpStrategy
+
+    val mqttServerUri: String = builder.mqttServerUri
+    val mqttUName: String = builder.mqttUName
+    val mqttUPwd: String = builder.mqttUPwd
+
+    class Builder {
+        internal var baseUrl: String
+        internal var fileBrowserBaseUrl: String
+        internal var httpStrategy: Int
+        internal var mqttServerUri: String
+        internal var mqttUName: String
+        internal var mqttUPwd: String
+
+        init {
+            baseUrl = "http://pc44sory.xiaomy.net:31738/"
+            fileBrowserBaseUrl = "http://180.76.134.43:31007/"
+            httpStrategy = HttpConfig.HTTP_STRATEGY_Retrofit
+            mqttServerUri = "tcp://42.193.12.99:1883"
+            mqttUName = "dlc"
+            mqttUPwd = "123456"
+        }
+
+        fun baseUrl(baseUrl: String): Builder {
+            this.baseUrl = baseUrl
+            return this
+        }
+
+        fun fileBrowserBaseUrl(fileBrowserBaseUrl: String): Builder {
+            this.fileBrowserBaseUrl = fileBrowserBaseUrl
+            return this
+        }
+
+        fun httpStrategy(httpStrategy: Int): Builder {
+            this.httpStrategy = httpStrategy
+            return this
+        }
+
+        fun mqttServerUri(mqttServerUri: String): Builder {
+            this.mqttServerUri = mqttServerUri
+            return this
+        }
+
+        fun mqttUName(mqttUName: String): Builder {
+            this.mqttUName = mqttUName
+            return this
+        }
+
+        fun mqttUPwd(mqttUPwd: String): Builder {
+            this.mqttUPwd = mqttUPwd
+            return this
+        }
+
+        fun build(): ConfigParam {
+            return ConfigParam(this)
+        }
+
+    }
+}

+ 30 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/config/OkHttpDNS.kt

@@ -0,0 +1,30 @@
+package com.rc.httpcore.config
+
+import android.text.TextUtils
+import android.util.Log
+import okhttp3.Dns
+import java.net.InetAddress
+import java.net.UnknownHostException
+
+
+class OkHttpDNS : Dns {
+    private var mIpString: String? = null
+
+    @Throws(UnknownHostException::class)
+    override fun lookup(hostname: String): List<InetAddress> {
+//        Log.d("OkHttpDNS", "hostname----:$hostname")
+        if (TextUtils.isEmpty(hostname) || null == hostname) return Dns.SYSTEM.lookup(hostname)
+
+        //根据域名获取IP
+        val ips = InetAddress.getAllByName(hostname)
+        for (inetAddress in ips) {
+            mIpString = inetAddress.hostAddress
+//            Log.d("OkHttpDNS", "mIpString----:$mIpString")
+        }
+        return if (null != mIpString && !TextUtils.isEmpty(mIpString)) {
+            listOf(*InetAddress.getAllByName(mIpString))
+        } else {
+            Dns.SYSTEM.lookup(hostname)
+        }
+    }
+}

+ 22 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/converter/NullOnEmptyConverterFactory.kt

@@ -0,0 +1,22 @@
+package com.rc.httpcore.converter
+
+import okhttp3.ResponseBody
+import retrofit2.Converter
+import retrofit2.Retrofit
+import java.lang.reflect.Type
+
+class NullOnEmptyConverterFactory : Converter.Factory() {
+
+    override fun responseBodyConverter(
+        type: Type?,
+        annotations: Array<out Annotation>?,
+        retrofit: Retrofit?
+    ): Converter<ResponseBody, *> {
+        val delegate: Converter<ResponseBody, Any>? =
+            retrofit?.nextResponseBodyConverter(this, type, annotations)
+
+        return Converter<ResponseBody, Any>() {
+            if (it.contentLength() == 0L) null else delegate?.convert(it)
+        }
+    }
+}

+ 9 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/exception/NetException.kt

@@ -0,0 +1,9 @@
+package com.rc.httpcore.exception
+
+class NetException(val code: String, message: String?): Exception(message) {
+
+    override fun toString(): String {
+        val message = super.getLocalizedMessage() ?: ""
+        return "$message (${code})"
+    }
+}

+ 43 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/interceptor/HttpLoggingInterceptorLog.kt

@@ -0,0 +1,43 @@
+package com.rc.httpcore.interceptor
+
+import android.util.Log
+import okhttp3.FormBody
+import okhttp3.Interceptor
+import okhttp3.Response
+import okhttp3.ResponseBody
+
+class HttpLoggingInterceptorLog : Interceptor {
+    override fun intercept(chain: Interceptor.Chain): Response {
+        val TAG = "okhttp"
+        val request = chain.request()
+        val startTime = System.currentTimeMillis()
+        val response = chain.proceed(chain.request())
+        val endTime = System.currentTimeMillis()
+        val duration = endTime - startTime
+        val mediaType = response.body()!!.contentType()
+        val content = response.body()!!.string()
+        Log.d(TAG, "\n")
+        Log.d(TAG, "----------Start----------------")
+        Log.d(TAG, "| $request")
+        val method = request.method()
+        if ("POST" == method) {
+            val sb = StringBuilder()
+            if (request.body() is FormBody) {
+                val body = request.body() as FormBody?
+                for (i in 0 until body!!.size()) {
+                    sb.append(body!!.encodedName(i) + "=" + body!!.encodedValue(i) + ",")
+                }
+                sb.delete(sb.length - 1, sb.length)
+                Log.d(TAG, "| RequestParams:{$sb}")
+            }
+        }
+        Log.d(TAG, "| Response:$content")
+        Log.d(TAG, "----------End:" + duration + "毫秒----------")
+        return response.newBuilder()
+            .body(ResponseBody.create(mediaType, content))
+            .build()
+    }
+
+
+
+}

+ 95 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/interceptor/NullToEmptyInterceptor.kt

@@ -0,0 +1,95 @@
+package com.rc.httpcore.interceptor
+
+import android.util.Log
+import okhttp3.*
+import okio.Buffer
+import org.json.JSONObject
+
+class NullToEmptyInterceptor : Interceptor {
+
+    override fun intercept(chain: Interceptor.Chain): Response {
+        val request = chain.request()
+        val modifiedRequest = modifyRequest(request)
+
+        // 打印请求日志
+        printRequestLog(modifiedRequest)
+
+        val response = chain.proceed(modifiedRequest)
+
+        // 打印响应日志
+        printResponseLog(response)
+        return response
+    }
+
+    private fun modifyRequest(request: Request): Request {
+        // 获取原始的请求体
+        val originalBody = request.body() ?: return request
+
+        // 读取原始的 JSON 数据
+        val buffer = Buffer()
+        originalBody.writeTo(buffer)
+        val originalJsonString = buffer.readUtf8()
+        println("<-- End response1$originalJsonString")
+        // 将原始 JSON 数据转换为 JSONObject
+        val jsonObject = JSONObject(originalJsonString)
+        println("<-- End response2$jsonObject")
+        // 遍历 JSON 对象的键,将值为 null 的键替换成空字符串
+        val keys = jsonObject.keys()
+        while (keys.hasNext()) {
+            val key = keys.next()
+            println("<-- End response3$key")
+            if (jsonObject.isNull(key)) {
+                jsonObject.put(key, "")
+            }
+        }
+
+        // 构建修改后的请求体
+        val modifiedJsonString = jsonObject.toString()
+        val mediaType = MediaType.parse("application/json")
+        val modifiedBody = RequestBody.create(mediaType, modifiedJsonString)
+
+        // 构建修改后的请求
+        return request.newBuilder()
+            .method(request.method(), modifiedBody)
+            .build()
+    }
+
+
+    private fun printRequestLog(request: Request) {
+        println("--> Sending request to ${request.url()}")
+        println("Headers: ${request.headers()}")
+        println("Method: ${request.method()}")
+        println("Body: ${bodyToString(request.body())}")
+        println("--> End request")
+    }
+
+    private fun printResponseLog(response: Response) {
+        println("<-- Received response for ${response.request().url()}")
+        println("Code: ${response.code()}")
+        println("Message: ${response.message()}")
+        println("Headers: ${response.headers()}")
+        println("Body: ${bodyToString(response.peekBody(Long.MAX_VALUE).string())}")
+        println("<-- End response")
+    }
+
+    private fun bodyToString(body: RequestBody?): String {
+        return try {
+            val buffer = Buffer()
+            body?.writeTo(buffer)
+            buffer.readUtf8()
+        } catch (e: Exception) {
+            "Error parsing body: ${e.message}"
+        }
+    }
+
+    private fun bodyToString(body: String): String {
+        // Limit the output to a reasonable length
+        val maxLength = 4000
+        return if (body.length > maxLength) {
+            body.substring(0, maxLength) + "...(truncated)"
+        } else {
+            body
+        }
+    }
+
+}

+ 62 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/interceptor/TokenHeaderInterceptor.kt

@@ -0,0 +1,62 @@
+package com.rc.httpcore.interceptor
+
+import android.annotation.SuppressLint
+import android.content.Intent
+import android.util.Log
+import androidx.localbroadcastmanager.content.LocalBroadcastManager
+import com.google.gson.Gson
+import com.rc.httpcore.HttpClient
+import com.rc.httpcore.vo.CommonResponse
+import okhttp3.Interceptor
+import okhttp3.Request
+import okhttp3.Response
+import java.lang.Exception
+import java.nio.charset.StandardCharsets
+
+class TokenHeaderInterceptor : Interceptor {
+
+    @SuppressLint("LongLogTag")
+    override fun intercept(chain: Interceptor.Chain): Response {
+        val originalRequest: Request = chain.request()
+        val requestBuilder: Request.Builder = originalRequest.newBuilder()
+
+        if (!HttpClient.token.isNullOrEmpty()) {
+            requestBuilder.addHeader("authorization", HttpClient.token!!)
+            Log.d("===========",HttpClient.token!!)
+//            requestBuilder.addHeader("authorization", "2cb6ac5a-33e7-404f-a3a7-145fc7420763")
+        }
+
+        requestBuilder
+//            .header("client", "android_app")
+            .header("vName", HttpClient.vName)
+            .header("Accept", "application/json, text/plain,*/*")
+//            .header("Accept", "application/x-www-form-urlencoded")
+            .build()
+
+        val newlyRequest = requestBuilder.build()
+//        if (newlyRequest.url().toString().contains("download")) {
+//            return chain.proceed(newlyRequest);
+//        }
+
+        val response = chain.proceed(newlyRequest)
+        try {
+            response.body()?.let {
+                val source = it.source()
+                source.request(Long.MAX_VALUE)
+                val data = source.buffer.clone().readString(StandardCharsets.UTF_8)
+
+                val commonResponse = Gson().fromJson<CommonResponse>(data, CommonResponse::class.java)
+                if (commonResponse.isTokenExpired()) {
+                    HttpClient.getAppContext()?.apply {
+                        val intent = Intent("com.rc.core.token_expired")
+                        LocalBroadcastManager.getInstance(this).sendBroadcast(intent)
+                    }
+                }
+            }
+        } catch (e: Exception) {
+            e.printStackTrace()
+        }
+
+        return response
+    }
+}

+ 26 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/interceptor/formatter/GsonFormatter.kt

@@ -0,0 +1,26 @@
+package com.rc.httpcore.interceptor.formatter
+
+import com.google.gson.GsonBuilder
+import com.google.gson.JsonParser
+
+class GsonFormatter : JSONFormatter() {
+
+    companion object {
+        fun buildIfSupported(): JSONFormatter? {
+            return try {
+                Class.forName("com.google.gson.Gson")
+                GsonFormatter()
+            } catch (ignore: ClassNotFoundException) {
+                null
+            }
+        }
+    }
+
+    private val GSON = GsonBuilder().setPrettyPrinting().create()
+    private val PARSER = JsonParser()
+
+    override fun format(source: String?): String? {
+        return GSON.toJson(PARSER.parse(source))
+    }
+
+}

+ 37 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/interceptor/formatter/JSONFormatter.kt

@@ -0,0 +1,37 @@
+package com.rc.httpcore.interceptor.formatter
+
+import org.json.JSONException
+
+/**
+ * json格式化
+ */
+open class JSONFormatter {
+
+    companion object {
+
+        private val FORMATTER = findJSONFormatter()
+
+        fun formatJSON(source: String?): String? {
+            return try {
+                FORMATTER.format(source)
+            } catch (e: java.lang.Exception) {
+                ""
+            }
+        }
+
+        private fun findJSONFormatter(): JSONFormatter {
+            val jsonFormatter = OrgJsonFormatter.buildIfSupported()
+            if (jsonFormatter != null) {
+                return jsonFormatter
+            }
+            val gsonFormatter = GsonFormatter.buildIfSupported()
+            return gsonFormatter ?: JSONFormatter()
+        }
+    }
+
+    @Throws(JSONException::class)
+    open fun format(source: String?): String? {
+        return ""
+    }
+
+}

+ 26 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/interceptor/formatter/OrgJsonFormatter.kt

@@ -0,0 +1,26 @@
+package com.rc.httpcore.interceptor.formatter
+
+import org.json.JSONObject
+
+class OrgJsonFormatter : JSONFormatter() {
+
+    companion object {
+
+        private const val INDENT_SPACES = 4
+
+        fun buildIfSupported(): OrgJsonFormatter? {
+            return try {
+                Class.forName("org.json.JSONObject")
+                OrgJsonFormatter()
+            } catch (ignore: ClassNotFoundException) {
+                null
+            }
+        }
+    }
+
+    override fun format(source: String?): String? {
+        return if (source.isNullOrEmpty())
+            "" else JSONObject(source).toString(INDENT_SPACES)
+    }
+
+}

+ 14 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/net/DownloadListener.kt

@@ -0,0 +1,14 @@
+package com.rc.httpcore.net
+
+interface DownloadListener {
+
+    fun onProgress(progress: Int)
+
+    fun onSuccess()
+
+    fun onFailed(errMsg: String?)
+
+    fun onPaused()
+
+    fun onCanceled()
+}

+ 156 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/net/DownloadTask.kt

@@ -0,0 +1,156 @@
+package com.rc.httpcore.net
+
+import android.os.AsyncTask
+import android.os.Environment
+import android.text.TextUtils
+import okhttp3.OkHttpClient
+import okhttp3.Request
+import java.io.File
+import java.io.InputStream
+import java.io.RandomAccessFile
+
+/**
+ * eg: http://www.download.com/projectname/dl/test.apk
+ * 将文件下载到sd卡/Download目录。
+ * 下载到本地的文件件名,如果没指定则为test.apk。
+ *
+ */
+class DownloadTask(
+    private val listener: DownloadListener,
+    private val dlPath: String = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).path,
+    private var fileName: String?,
+    private val headers: Map<String, String>? = null
+) :
+    AsyncTask<String, Int, Int>() {
+
+    companion object {
+        const val TYPE_SUCCESS: Int = 1
+        const val TYPE_FAILED: Int = 2
+        const val TYPE_PAUSED: Int = 3
+        const val TYPE_CANCELED: Int = 4
+    }
+
+    private var isCanceled: Boolean = false
+    private var isPaused: Boolean = false
+
+    private var lastProgress: Int = 0
+
+    override fun doInBackground(vararg params: String?): Int {
+        var file: File? = null
+        var inputStream: InputStream? = null
+        var saveFile: RandomAccessFile? = null
+        try {
+            var downloadedLength = 0L
+            val downloadUrl = params[0]
+            downloadUrl ?: return TYPE_FAILED
+
+            if (TextUtils.isEmpty(fileName)) {
+                fileName = downloadUrl.substring(downloadUrl.lastIndexOf("/"))
+            }
+
+            file = File(dlPath, fileName!!)
+            if (file.exists()) {
+                downloadedLength = file.length()
+            }
+            val contentLength: Long = getContentLength(downloadUrl)
+            if (contentLength == 0L) {
+                return TYPE_FAILED
+            } else if (contentLength == downloadedLength) {
+                // 已经下载的字节数和文件的总字节数相等,说明已经下载完成。
+                return TYPE_SUCCESS
+            }
+            val builder = Request.Builder()
+            headers?.let {
+                for ((key, value) in it)
+                    builder.addHeader(key, value)
+            }
+            val request = builder
+                // 断点下载,指定从那个字节开始下
+                .addHeader("RANGE", "bytes=" + downloadedLength + "-")
+                .url(downloadUrl)
+                .build()
+            val response = OkHttpClient()
+                .newCall(request)
+                .execute()
+
+            inputStream = response.body()!!.byteStream()
+            saveFile = RandomAccessFile(file, "rw")
+            saveFile.seek(downloadedLength) // 跳过已经下载的字节
+            val buff = ByteArray(1024)
+            var total = 0
+            var len = 0;
+            while ({ len = inputStream.read(buff);len }() != -1) {
+                if (isCanceled) {
+                    return TYPE_CANCELED
+                } else if (isPaused) {
+                    return TYPE_PAUSED
+                } else {
+                    total += len
+                    saveFile.write(buff, 0, len)
+                    // 计算已经下载的百分比
+                    val progress: Int = ((total + downloadedLength) * 100 / contentLength).toInt()
+                    publishProgress(progress)
+                }
+            }
+            response.body()!!.close()
+            return TYPE_SUCCESS
+        } catch (e: Exception) {
+            e.printStackTrace()
+        } finally {
+            try {
+                inputStream?.close()
+                saveFile?.close()
+                if (isCanceled) file?.delete()
+            } catch (e: Exception) {
+                e.printStackTrace()
+            }
+        }
+        return TYPE_FAILED
+    }
+
+    override fun onProgressUpdate(vararg values: Int?) {
+        val progress = values[0]
+        progress?.let {
+            if (it > lastProgress) {
+                listener.onProgress(it)
+                lastProgress = it
+            }
+        }
+    }
+
+    override fun onPostExecute(status: Int?) {
+        when (status) {
+            TYPE_SUCCESS -> listener.onSuccess()
+            TYPE_FAILED -> listener.onFailed(null)
+            TYPE_PAUSED -> listener.onPaused()
+            TYPE_CANCELED -> listener.onCanceled()
+            else -> Unit
+        }
+    }
+
+    fun pauseDownload() {
+        this.isPaused = true
+    }
+
+    fun cancelDownload() {
+        this.isCanceled = true
+    }
+
+    private fun getContentLength(downloadUrl: String): Long {
+        val builder = Request.Builder()
+        headers?.let {
+            for ((key, value) in it)
+                builder.addHeader(key, value)
+        }
+        val request = builder.url(downloadUrl).build()
+        val response = OkHttpClient()
+            .newCall(request)
+            .execute()
+        if (response.isSuccessful) {
+            val contentLength = response.body()!!.contentLength()
+            response.close()
+            return contentLength
+        }
+        return 0
+    }
+}

+ 140 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/net/ProgressMultipartBody.java

@@ -0,0 +1,140 @@
+package com.rc.httpcore.net;
+
+import androidx.annotation.Nullable;
+
+import org.jetbrains.annotations.NotNull;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import okhttp3.Headers;
+import okhttp3.MediaType;
+import okhttp3.MultipartBody;
+import okhttp3.RequestBody;
+import okio.Buffer;
+import okio.BufferedSink;
+import okio.ForwardingSink;
+import okio.Okio;
+import okio.Sink;
+
+/**
+ * info
+ *
+ * @author ReiChin_
+ */
+public class ProgressMultipartBody extends RequestBody {
+
+    private final MultipartBody requestBody;
+    private final ProgressListener progressListener;
+    private final long contentLength;
+
+    private BufferedSink bufferedSink;
+
+    private long bytesWritten = 0L;
+
+    private ProgressMultipartBody(MultipartBody requestBody, ProgressListener progressListener) throws IOException {
+        this.requestBody = requestBody;
+        this.progressListener = progressListener;
+        this.contentLength = requestBody.contentLength();
+    }
+
+    @Override
+    public MediaType contentType() {
+        return requestBody.contentType();
+    }
+
+    @Override
+    public long contentLength() throws IOException {
+        return contentLength;
+    }
+
+    @Override
+    public void writeTo(@NotNull BufferedSink sink) throws IOException {
+        if (null == bufferedSink) {
+            bufferedSink = Okio.buffer(new ProgressBufferSink(sink));
+        }
+
+        requestBody.writeTo(bufferedSink);
+        bufferedSink.flush();
+    }
+
+    class ProgressBufferSink extends ForwardingSink {
+
+        public ProgressBufferSink(Sink delegate) {
+            super(delegate);
+        }
+
+        @Override
+        public void write(Buffer source, long byteCount) throws IOException {
+            super.write(source, byteCount);
+            bytesWritten += byteCount;
+            progressListener.onProgress(bytesWritten, contentLength);
+        }
+    }
+
+    public interface ProgressListener {
+        void onProgress(long currentBytes, long contentLength);
+    }
+
+    public static class Builder {
+        private MediaType type = MultipartBody.MIXED;
+        private final List<MultipartBody.Part> parts = new ArrayList<>();
+        private ProgressListener progressListener;
+
+        public ProgressMultipartBody.Builder setType(MediaType type) {
+            if (type == null) {
+                throw new NullPointerException("type == null");
+            }
+            if (!type.type().equals("multipart")) {
+                throw new IllegalArgumentException("multipart != " + type);
+            }
+            this.type = type;
+            return this;
+        }
+
+        public ProgressMultipartBody.Builder addPart(RequestBody body) {
+            return addPart(MultipartBody.Part.create(body));
+        }
+
+        public ProgressMultipartBody.Builder addPart(@Nullable Headers headers, RequestBody body) {
+            return addPart(MultipartBody.Part.create(headers, body));
+        }
+
+        public ProgressMultipartBody.Builder addFormDataPart(String name, String value) {
+            return addPart(MultipartBody.Part.createFormData(name, value));
+        }
+
+        public ProgressMultipartBody.Builder addFormDataPart(String name, @Nullable String filename, RequestBody body) {
+            return addPart(MultipartBody.Part.createFormData(name, filename, body));
+        }
+
+        public ProgressMultipartBody.Builder addPart(MultipartBody.Part part) {
+            if (part == null) throw new NullPointerException("part == null");
+            parts.add(part);
+            return this;
+        }
+
+        public ProgressMultipartBody.Builder addProgressListener(ProgressListener progressListener) {
+            this.progressListener = progressListener;
+            return this;
+        }
+
+        public ProgressMultipartBody build() throws IOException {
+            if (parts.isEmpty()) {
+                throw new IllegalStateException("Multipart body must have at least one part.");
+            }
+            if (null == progressListener) {
+                throw new IllegalStateException("progress listener can't null.");
+            }
+
+            MultipartBody.Builder builder = new MultipartBody.Builder().setType(type);
+            for (MultipartBody.Part part : parts) {
+                builder.addPart(part);
+            }
+
+            return new ProgressMultipartBody(builder.build(), progressListener);
+        }
+    }
+
+}

+ 122 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/net/UploadTask.kt

@@ -0,0 +1,122 @@
+package com.rc.httpcore.net
+
+import android.os.AsyncTask
+import android.util.Log
+import com.google.gson.Gson
+import com.google.gson.reflect.TypeToken
+import com.rc.httpcore.HttpClient
+import com.rc.httpcore.HttpConfig
+import com.rc.httpcore.exception.NetException
+import com.rc.httpcore.interceptor.NullToEmptyInterceptor
+import com.rc.httpcore.interceptor.TokenHeaderInterceptor
+import com.rc.httpcore.vo.CommonDataResponse
+import com.rc.httpcore.vo.response.FileRespBean
+import io.reactivex.functions.Consumer
+import okhttp3.MultipartBody
+import okhttp3.OkHttpClient
+import okhttp3.Request
+import okhttp3.RequestBody
+import java.io.File
+import java.util.concurrent.TimeUnit
+
+/**
+ * info
+ *
+ * @author ReiChin_
+ */
+class UploadTask(
+    private val onProgress: Consumer<Int>? = null,
+    private val onSuccess: Consumer<FileRespBean>,
+    private val onFailed: Consumer<Throwable?>
+) :
+    AsyncTask<String, Int, UploadTask.UploadResult>() {
+
+    companion object {
+        const val TYPE_SUCCESS: Int = 1
+        const val TYPE_FAILED: Int = 2
+    }
+
+    override fun doInBackground(vararg params: String?): UploadResult {
+        if (params.isNullOrEmpty()) return UploadResult(
+            TYPE_FAILED,
+            throwable = IllegalArgumentException("params is null or empty")
+        )
+
+        try {
+            val file = File(params[0]!!)
+            val fileBody =
+                RequestBody.create(okhttp3.MediaType.parse("application/octet-stream"), file)
+            val filePart = MultipartBody.Part.createFormData("file", file.name, fileBody)
+
+            val requestBody = ProgressMultipartBody.Builder()
+                .setType(MultipartBody.FORM)
+                .addPart(filePart)
+                .addProgressListener { currentBytes, contentLength ->
+                    val progress: Int = (currentBytes * 100 / contentLength).toInt()
+                    Log.i(
+                        "RcLog",
+                        "currentBytes:${currentBytes}, contentLength:${contentLength}, progress=${progress}%"
+                    )
+                    publishProgress(if (progress >= 100) 99 else progress)
+                }
+                .build()
+
+            val request = Request.Builder()
+                .addHeader("Transfer-Encoding", "chunked")
+                .url("${HttpConfig.API_BASE_URL}${HttpConfig.BASE_PATH_BASE}file/upload")
+                .post(requestBody)
+                .build()
+
+            val okHttpClient = OkHttpClient.Builder()
+                .readTimeout(HttpClient.TIMEOUT_DEFAULT, TimeUnit.SECONDS) // 设置读取超时时间
+                .connectTimeout(HttpClient.TIMEOUT_DEFAULT, TimeUnit.SECONDS) // 设置请求超时时间
+                .writeTimeout(HttpClient.TIMEOUT_DEFAULT, TimeUnit.SECONDS) // 设置写入超时时间
+                .callTimeout(5, TimeUnit.MINUTES) // 上传超时时间:5分钟
+                .addNetworkInterceptor(TokenHeaderInterceptor())
+//                .retryOnConnectionFailure(false) // 设置出现错误进行重新连接
+                .build()
+
+            val response = okHttpClient.newCall(request).execute()
+            if (response.isSuccessful) {
+
+                val responseData = response.body()?.string()
+
+                val typeOfT = object : TypeToken<CommonDataResponse<FileRespBean>>() {}.type
+                val result =
+                    Gson().fromJson<CommonDataResponse<FileRespBean>>(responseData, typeOfT)
+                return if (result.isSuccess()) {
+                    publishProgress(100)
+                    UploadResult(TYPE_SUCCESS, data = result.data)
+                } else {
+                    UploadResult(TYPE_FAILED, throwable = NetException(result.code, result.msg))
+                }
+            }
+        } catch (e: Exception) {
+            e.printStackTrace()
+            return UploadResult(TYPE_FAILED, throwable = e)
+        }
+        return UploadResult(TYPE_FAILED, throwable = RuntimeException("上传失败"))
+    }
+
+    override fun onProgressUpdate(vararg values: Int?) {
+        val progress = values[0]
+        progress?.let {
+            onProgress?.accept(it)
+        }
+    }
+
+    override fun onPostExecute(result: UploadResult?) {
+        when (result?.status) {
+            TYPE_SUCCESS -> onSuccess.accept(result.data!!)
+            TYPE_FAILED -> onFailed.accept(result.throwable)
+            else -> Unit
+        }
+    }
+
+    data class UploadResult(
+        val status: Int?,
+        val data: FileRespBean? = null,
+        val throwable: Throwable? = null
+    )
+
+}

+ 5 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/CommonDataResponse.kt

@@ -0,0 +1,5 @@
+package com.rc.httpcore.vo
+
+class CommonDataResponse<T> : CommonResponse() {
+    var data: T? = null
+}

+ 8 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/CommonListResponse.kt

@@ -0,0 +1,8 @@
+package com.rc.httpcore.vo
+
+class CommonListResponse<T> : CommonResponse() {
+    var rows: List<T>? = null
+    var records: List<T>? = null
+    var data: List<T>? = null
+    var total: Int = 0
+}

+ 18 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/CommonResponse.kt

@@ -0,0 +1,18 @@
+package com.rc.httpcore.vo
+
+open class CommonResponse {
+
+    var code: String = ""
+    var msg: String = ""
+    var message: String = ""
+
+    companion object {
+        const val CODE_SUCCESS = "200"
+        const val CODE_TOKEN_EXPIRED = "401"
+    }
+
+    fun isSuccess() = CODE_SUCCESS == code
+
+    fun isTokenExpired() = CODE_TOKEN_EXPIRED == code
+
+}

+ 50 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/Optional.java

@@ -0,0 +1,50 @@
+package com.rc.httpcore.vo;
+
+import java.util.NoSuchElementException;
+import java.util.Objects;
+
+/**
+ * 解决RxJava不能返回null的问题
+ *
+ * @author ReiChin_
+ */
+public class Optional<T> {
+
+    private static final Optional<?> EMPTY = new Optional<>();
+
+    private final T value;
+
+    private Optional() {
+        this.value = null;
+    }
+
+    public static <T> Optional<T> empty() {
+        @SuppressWarnings("unchecked")
+        Optional<T> t = (Optional<T>) EMPTY;
+        return t;
+    }
+
+    private Optional(T value) {
+        this.value = Objects.requireNonNull(value);
+    }
+
+    public static <T> Optional<T> of(T value) {
+        return new Optional<>(value);
+    }
+
+    public static <T> Optional<T> ofNullable(T value) {
+        return value == null ? empty() : of(value);
+    }
+
+    public T get() {
+        if (value == null) {
+            throw new NoSuchElementException("No value present");
+        }
+        return value;
+    }
+
+    public boolean isPresent() {
+        return value != null;
+    }
+
+}

+ 13 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/request/AlarmRecordReq.java

@@ -0,0 +1,13 @@
+package com.rc.httpcore.vo.request;
+
+/**
+ * 查询报警记录列表 request
+ *
+ * @author ReiChin_
+ */
+public class AlarmRecordReq {
+
+    public int pageNum;
+    public int pageSize;
+
+}

+ 0 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/request/AuthFaceReq.java


Vissa filer visades inte eftersom för många filer har ändrats