sunqiang 1 рік тому
коміт
ec8394e344
100 змінених файлів з 5122 додано та 0 видалено
  1. 15 0
      .gitignore
  2. 3 0
      .idea/.gitignore
  3. 123 0
      .idea/codeStyles/Project.xml
  4. 5 0
      .idea/codeStyles/codeStyleConfig.xml
  5. 6 0
      .idea/compiler.xml
  6. 23 0
      .idea/gradle.xml
  7. 75 0
      .idea/jarRepositories.xml
  8. 4 0
      .idea/misc.xml
  9. 1 0
      HttpCoreLibrary/.gitignore
  10. 60 0
      HttpCoreLibrary/build.gradle
  11. 0 0
      HttpCoreLibrary/consumer-rules.pro
  12. 21 0
      HttpCoreLibrary/proguard-rules.pro
  13. 5 0
      HttpCoreLibrary/src/main/AndroidManifest.xml
  14. 13 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/Children.kt
  15. 17 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/ChildrenX.kt
  16. 17 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/ChildrenXX.kt
  17. 14 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/ChildrenXXX.kt
  18. 13 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/Data.kt
  19. 34 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/DataX.kt
  20. 35 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/DataXX.kt
  21. 3 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/HazardBean.kt
  22. 87 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/HttpClient.kt
  23. 40 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/HttpConfig.kt
  24. 26 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/CheckHazardApplyDto.kt
  25. 27 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/CheckRectifyApply.kt
  26. 11 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/Classify.kt
  27. 32 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/DafactTreatmentBean.kt
  28. 62 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/Data.kt
  29. 11 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/HardwareTypeEnum.kt
  30. 13 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/Hazard.kt
  31. 7 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/HazardType.kt
  32. 3 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/NotifierBean.kt
  33. 3 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/Params.kt
  34. 9 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/Private.kt
  35. 9 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/Public.kt
  36. 10 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/SafeInfo.kt
  37. 7 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/SecurityScanBean.kt
  38. 13 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/SenseType.kt
  39. 7 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/State.kt
  40. 9 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/SubAddrr.kt
  41. 10 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/SubClassVO.kt
  42. 698 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/client/ApiRepository.kt
  43. 286 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/client/ChemicalClient.kt
  44. 9 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/client/factory/ClientFactory.kt
  45. 9 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/client/factory/RetrofitFactory.kt
  46. 519 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/client/retrofit/ApiService.java
  47. 949 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/client/retrofit/ChemicalRetrofit.kt
  48. 25 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/config/ConfigCore.kt
  49. 30 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/config/ConfigFactory.kt
  50. 68 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/config/ConfigParam.kt
  51. 30 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/config/OkHttpDNS.kt
  52. 22 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/converter/NullOnEmptyConverterFactory.kt
  53. 13 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/dddd/Children.kt
  54. 13 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/dddd/ChildrenX.kt
  55. 13 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/dddd/ChildrenXX.kt
  56. 13 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/dddd/Data.kt
  57. 7 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/dddd/aaaaa.kt
  58. 9 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/exception/NetException.kt
  59. 45 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/interceptor/HttpLoggingInterceptorLog.kt
  60. 62 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/interceptor/TokenHeaderInterceptor.kt
  61. 26 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/interceptor/formatter/GsonFormatter.kt
  62. 37 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/interceptor/formatter/JSONFormatter.kt
  63. 26 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/interceptor/formatter/OrgJsonFormatter.kt
  64. 14 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/net/DownloadListener.kt
  65. 156 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/net/DownloadTask.kt
  66. 140 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/net/ProgressMultipartBody.java
  67. 121 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/net/UploadTask.kt
  68. 22 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/AppNoAuthList.kt
  69. 15 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/CabinetBeans.kt
  70. 10 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/CheckHazardBean.kt
  71. 80 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/CheckHazardDto.kt
  72. 45 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/CheckHazardInfoDto.kt
  73. 19 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/CheckOptionBean.kt
  74. 5 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/CommonDataResponse.kt
  75. 8 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/CommonListResponse.kt
  76. 17 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/CommonResponse.kt
  77. 9 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/CountAppBean.kt
  78. 10 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/CourseListBean.kt
  79. 3 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/CourseVoListBean.kt
  80. 30 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/ExaminerInformationBean.kt
  81. 62 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/HandManBean.kt
  82. 3 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/HandManVo.kt
  83. 33 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/HxpTakeStockDetail.kt
  84. 60 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/InventoryList.kt
  85. 31 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/InventorySubmissionVo.kt
  86. 20 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/ItemList.kt
  87. 9 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/MaterialFileBean.kt
  88. 3 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/NumberOfCheckListBean.kt
  89. 50 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/Optional.java
  90. 3 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/Params.kt
  91. 10 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/RandomClapBean.kt
  92. 54 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/Record.kt
  93. 50 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/SchoolBeginsBean.kt
  94. 164 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/SpecialInspectionBean.kt
  95. 35 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/UploadDto.kt
  96. 9 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/UsageRecordBean.kt
  97. 7 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/UserIdentityBean.kt
  98. 10 0
      HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/VoiceRemarkBean.kt
  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

+ 123 - 0
.idea/codeStyles/Project.xml

@@ -0,0 +1,123 @@
+<component name="ProjectCodeStyleConfiguration">
+  <code_scheme name="Project" version="173">
+    <JetCodeStyleSettings>
+      <option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
+    </JetCodeStyleSettings>
+    <codeStyleSettings language="XML">
+      <option name="FORCE_REARRANGE_MODE" value="1" />
+      <indentOptions>
+        <option name="CONTINUATION_INDENT_SIZE" value="4" />
+      </indentOptions>
+      <arrangement>
+        <rules>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>xmlns:android</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>xmlns:.*</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+              <order>BY_NAME</order>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*:id</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*:name</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>name</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>style</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>^$</XML_NAMESPACE>
+                </AND>
+              </match>
+              <order>BY_NAME</order>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
+                </AND>
+              </match>
+              <order>ANDROID_ATTRIBUTE_ORDER</order>
+            </rule>
+          </section>
+          <section>
+            <rule>
+              <match>
+                <AND>
+                  <NAME>.*</NAME>
+                  <XML_ATTRIBUTE />
+                  <XML_NAMESPACE>.*</XML_NAMESPACE>
+                </AND>
+              </match>
+              <order>BY_NAME</order>
+            </rule>
+          </section>
+        </rules>
+      </arrangement>
+    </codeStyleSettings>
+    <codeStyleSettings language="kotlin">
+      <option name="CODE_STYLE_DEFAULTS" value="KOTLIN_OFFICIAL" />
+    </codeStyleSettings>
+  </code_scheme>
+</component>

+ 5 - 0
.idea/codeStyles/codeStyleConfig.xml

@@ -0,0 +1,5 @@
+<component name="ProjectCodeStyleConfiguration">
+  <state>
+    <option name="USE_PER_PROJECT_SETTINGS" value="true" />
+  </state>
+</component>

+ 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="gradleJvm" value="#JAVA_HOME" />
+        <option name="modules">
+          <set>
+            <option value="$PROJECT_DIR$" />
+            <option value="$PROJECT_DIR$/HttpCoreLibrary" />
+            <option value="$PROJECT_DIR$/RcCore" />
+            <option value="$PROJECT_DIR$/app" />
+          </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="maven6" />
+      <option name="name" value="maven6" />
+      <option name="url" value="https://maven.aliyun.com/repository/gradle-plugin" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="maven8" />
+      <option name="name" value="maven8" />
+      <option name="url" value="https://maven.aliyun.com/repository/jcenter" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="maven5" />
+      <option name="name" value="maven5" />
+      <option name="url" value="https://maven.aliyun.com/repository/google" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="maven7" />
+      <option name="name" value="maven7" />
+      <option name="url" value="https://maven.aliyun.com/repository/public" />
+    </remote-repository>
+  </component>
+</project>

+ 4 - 0
.idea/misc.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="11" project-jdk-type="JavaSDK" />
+</project>

+ 1 - 0
HttpCoreLibrary/.gitignore

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

+ 60 - 0
HttpCoreLibrary/build.gradle

@@ -0,0 +1,60 @@
+plugins {
+    id 'com.android.library'
+    id 'kotlin-android'
+    id 'kotlin-android-extensions'
+
+}
+
+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'
+    }
+    androidExtensions {
+        experimental = true
+    }
+
+}
+
+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 'androidx.room:room-runtime:2.2.5'
+    annotationProcessor 'androidx.room:room-compiler:2.2.5'
+
+
+//    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>

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

@@ -0,0 +1,13 @@
+package com.rc.httpcore
+
+data class Children(
+    val children: List<ChildrenX>,
+    val code: String,
+    val hazardReid: Any,
+    val id: String,
+    val level: Int,
+    val mainPoint: String,
+    val name: String,
+    val parentId: String,
+    val type: Int
+)

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

@@ -0,0 +1,17 @@
+package com.rc.httpcore
+
+import android.os.Parcelable
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+data class ChildrenX(
+    val children: List<ChildrenXX>?,
+    val code: String,
+    val hazardReid: Int,
+    val id: String,
+    val level: Int,
+    val mainPoint: String?,
+    val name: String,
+    val parentId: String,
+    val type: Int
+): Parcelable

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

@@ -0,0 +1,17 @@
+package com.rc.httpcore
+
+import android.os.Parcelable
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+data class ChildrenXX(
+    val children: List<ChildrenXXX>,
+    val code: String,
+    val hazardReid: Int,
+    val id: String,
+    val level: Int,
+    val mainPoint: String?,
+    val name: String,
+    val parentId: String,
+    val type: Int
+): Parcelable

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

@@ -0,0 +1,14 @@
+package com.rc.httpcore
+
+import android.os.Parcelable
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+data class ChildrenXXX( val code: String,
+                        val hazardReid: Int,
+                        val id: String,
+                        val level: Int,
+                        val mainPoint: String?,
+                        val name: String,
+                        val parentId: String,
+                        val type: Int): Parcelable

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

@@ -0,0 +1,13 @@
+package com.rc.httpcore
+
+data class Data(
+    val children: List<Children>,
+    val code: String,
+    val hazardReid: Any,
+    val id: String,
+    val level: Int,
+    val mainPoint: String,
+    val name: String,
+    val parentId: String,
+    val type: Int
+)

+ 34 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/DataX.kt

@@ -0,0 +1,34 @@
+package com.rc.httpcore
+
+import com.rc.httpcore.bean.CheckHazardApplyDto
+
+data class DataX(
+    val buildName: String,
+    val checkCategory: Int,
+    val checkDemand: String,
+    val checkHazardApplyDto: CheckHazardApplyDto,
+    val checkPlanId: Long,
+    val checkRange: Int,
+    val checkRectifyApplyList: List<Any>,
+    val checkResult: Int,
+    val checkTime: String,
+    val checkType: Int,
+    val checkUser: String,
+    val collegeName: String,
+    val cycleEndTime: String,
+    val cycleStartTime: String,
+    val dangerNum: Int,
+    val id: String,
+    val isDeleted: Boolean,
+    val isOverdue: Int,
+    val loginUserName: Any,
+    val manageStatus: Int,
+    val rectifyDeadline: Any,
+    val rectifyNotice: Int,
+    val rectifySchedule: String,
+    val roomNumber: String,
+    val subId: Int,
+    val subIds: Any,
+    val subjectName: String,
+    val title: String
+)

+ 35 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/DataXX.kt

@@ -0,0 +1,35 @@
+package com.rc.httpcore
+
+import com.rc.httpcore.bean.CheckHazardApplyDto
+import com.rc.httpcore.bean.CheckRectifyApply
+
+data class DataXX(
+    val buildName: String,
+    val checkCategory: Int,
+    val checkDemand: String,
+    val checkHazardApplyDto: CheckHazardApplyDto,
+    val checkPlanId: Long,
+    val checkRange: Int,
+    val checkRectifyApplyList: List<CheckRectifyApply>,
+    val checkResult: Int,
+    val checkTime: String,
+    val checkType: Int,
+    val checkUser: String,
+    val collegeName: String,
+    val cycleEndTime: String,
+    val cycleStartTime: String,
+    val dangerNum: Int,
+    val id: String,
+    val isDeleted: Boolean,
+    val isOverdue: Int,
+    val loginUserName: Any,
+    val manageStatus: Int,
+    val rectifyDeadline: Any,
+    val rectifyNotice: Int,
+    val rectifySchedule: String,
+    val roomNumber: String,
+    val subId: Int,
+    val subIds: Any,
+    val subjectName: String,
+    val title: String
+)

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

@@ -0,0 +1,3 @@
+package com.rc.httpcore
+
+data class HazardBean(val joinHazardId: Int, val hazardId: Int, val hazardName: String, val code: String, val hazardTypeMode: Int, val hazardTypeModeName: String)

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

@@ -0,0 +1,87 @@
+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.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
+
+    private var mAppContext: Context? = null
+
+    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())//添加请求日志
+            .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()
+//        }
+    }
+
+
+
+}

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

@@ -0,0 +1,40 @@
+package com.rc.httpcore
+
+class HttpConfig {
+
+    companion object {
+
+
+//        var API_BASE_URL = "http://192.168.1.43/labSystem/"
+//        var API_BASE_URL = "https://lab.zjznai.com/appTest/" //1.88
+//        var API_BASE_URL = "http://lab.zjznai.com/labSystem/" //环测
+        var API_BASE_URL = "http://lab.zjznai.com/zhlabSystem/" //演示环境
+//        var API_DETAILS_URL = "http://lab.zjznai.com/labSystem" //环测课程id生成i二维码得地址
+        var API_DETAILS_URL = "http://lab.zjznai.com/zhlabSystem" //演示环境id生成i二维码得地址
+//        var API_DETAILS_URL = "https://lab.zjznai.com/appTest" //1.88
+
+        var FILE_BROWSER_BASE_URL_HTTPS = "https://lab.zjznai.com/appTest//zd-security/checkManage/appFindCheckManage?id=1724269966502780930"
+        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/"
+    }
+
+}

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

@@ -0,0 +1,26 @@
+package com.rc.httpcore.bean
+
+import com.rc.httpcore.vo.UploadDto
+
+data class CheckHazardApplyDto(
+    val applyGentle: Boolean,
+    val checkCategory: Int,
+    val checkFlag: Int,
+    val examineResult: Any,
+    val hazardCheckCount: Int,
+    val hazardCheckPoint: String,
+    val hazardCheckPro: String,
+    val hazardCheckProStr: String,
+    val hazardDescribe: Any,
+    val hazardLevel: Int,
+    val hazardName: String,
+    val hazardNum: Any,
+    val hazardType: Int,
+    val id: String,
+    val rectifyGentle: Boolean,
+    val rectifyName: Any,
+    val rectifyStatus: Int,
+    val rectifyTime: Any,
+    val uploadDtoList: List<UploadDto>,
+    val voiceRemark: Any
+)

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

@@ -0,0 +1,27 @@
+package com.rc.httpcore.bean
+
+
+import android.os.Parcelable
+import com.rc.httpcore.vo.UploadDto
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+data class CheckRectifyApply(
+    val applyFlag: Int,
+    val createBy: Int,
+    val createName: String,
+    val createTime: String,
+    val examineOpinion: String,
+    val examineResult: Int,
+    val id: String,
+    val rectifyMeasure: String,
+    val rectifyResult: Int,  //1  已整改
+    val rectifyType: Int,
+    val reviewedBy: String,
+    val reviewedName: String,
+    val reviewedTime: String,
+    val rectifyStatus:Int,  //默认0
+    val rectifyGentle:Boolean, //默认 false
+    val applyGentle:Boolean, //默认 false
+    val uploadDtoList: List<UploadDto>
+): Parcelable

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

@@ -0,0 +1,11 @@
+package com.rc.httpcore.bean
+
+data class Classify(
+    val classifyName: String,
+    val classifyType: Int,
+    val id: Int,
+    val isSpecial: Int,
+    val privateList: List<Private>,
+    val publicList: List<Public>,
+    val showColour: String
+)

+ 32 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/DafactTreatmentBean.kt

@@ -0,0 +1,32 @@
+package com.rc.httpcore.bean
+
+data class DafactTreatmentBean(
+    val buildName: String,
+    val checkCategory: Int,  //检查类别(1综合检查 2专项检查)
+    val checkDemand: String,
+    val checkHazardApplyDto: CheckHazardApplyDto,
+    val checkPlanId: Long,
+    val checkRange: Int,
+    val checkRectifyApplyList: List<CheckRectifyApply>,
+    val checkResult: Int,
+    val checkTime: String,
+    val checkType: Int,
+    val checkUser: String,
+    val collegeName: String,
+    val cycleEndTime: String,
+    val cycleStartTime: String,
+    val dangerNum: Int,
+    val id: String,
+    val isDeleted: Boolean,
+    val isOverdue: Int,
+    val loginUserName: String,
+    val manageStatus: Int,
+    val rectifyDeadline: String,
+    val rectifyNotice: Int,
+    val rectifySchedule: String,
+    val roomNumber: String,
+    val subId: Int,
+    val subIds: String,
+    val subjectName: String,
+    val title: String
+)

+ 62 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/Data.kt

@@ -0,0 +1,62 @@
+package com.rc.httpcore.bean
+
+data class Data(
+    val address: Any,
+    val admin: Boolean,
+    val adminId: Int,
+    val adminName: String,
+    val adminNameAndPhone: String,
+    val adminPhone: String,
+    val buildId: Int,
+    val cardInfoCount: Int,
+    val checkCount: Int,
+    val checkIn: String,
+    val checkOut: String,
+    val classifyList: List<Classify>,
+    val createBy: String,
+    val createTime: String,
+    val dangerName: Any,
+    val del: Boolean,
+    val deptId: Int,
+    val deptName: String,
+    val details: String,
+    val diyOrder: Int,
+    val fiedColor: String,
+    val floorId: Int,
+    val hKCount: Int,
+    val hardwareType: Int,
+    val hazardCategory: String,
+    val hazardList: List<Hazard>,
+    val id: Int,
+    val ids: Any,
+    val isDel: Boolean,
+    val isSubject: Any,
+    val layoutId: Int,
+    val level: Int,
+    val levelName: String,
+    val moldId: Int,
+    val name: String,
+    val online: Any,
+    val outfire: String,
+    val params: Params,
+    val qrCode: String,
+    val qrCodeUrl: String,
+    val remark: Any,
+    val riskMeasure: String,
+    val room: String,
+    val safeInfo: SafeInfo,
+    val safeSigns: String,
+    val safeUserId: String,
+    val safeUserName: String,
+    val safeUserNameAdminPhone: String,
+    val safeUserPhone: String,
+    val skipped: Int,
+    val subAddrr: SubAddrr,
+    val subClassVO: SubClassVO,
+    val subDept: String,
+    val typeId: Int,
+    val typeName: String,
+    val updateBy: Any,
+    val updateTime: String,
+    val userId: Int
+)

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

@@ -0,0 +1,11 @@
+package com.rc.httpcore.bean
+
+data class HardwareTypeEnum(
+    val code: Int,
+    val dictKey: Int,
+    val enumName: String,
+    val hardwareTypeCode: Int,
+    val hardwareTypeName: String,
+    val img: String,
+    val name: String
+)

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

@@ -0,0 +1,13 @@
+package com.rc.httpcore.bean
+
+data class Hazard(
+    val anotherCode: String,
+    val anotherName: String,
+    val hazardType: HazardType,
+    val id: Int,
+    val label: String,
+    val subjectId: Any,
+    val xPoint: Int,
+    val xyId: Int,
+    val yPoint: Int
+)

+ 7 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/HazardType.kt

@@ -0,0 +1,7 @@
+package com.rc.httpcore.bean
+
+data class HazardType(
+    val code: Int,
+    val dictKey: Int,
+    val name: String
+)

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

@@ -0,0 +1,3 @@
+package com.rc.httpcore.bean
+
+data class NotifierBean(var number:Int)

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

@@ -0,0 +1,3 @@
+package com.rc.httpcore.bean
+
+class Params

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

@@ -0,0 +1,9 @@
+package com.rc.httpcore.bean
+
+data class Private(
+    val id: Int,
+    val infoClassifyId: Int,
+    val infoContent: String,
+    val infoName: String,
+    val infoType: Int
+)

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

@@ -0,0 +1,9 @@
+package com.rc.httpcore.bean
+
+data class Public(
+    val id: Int,
+    val infoClassifyId: Int,
+    val infoContent: String,
+    val infoName: String,
+    val infoType: Int
+)

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

@@ -0,0 +1,10 @@
+package com.rc.httpcore.bean
+
+data class SafeInfo(
+    val checkInData: List<Any>,
+    val checkOutData: List<Any>,
+    val hazardCategory: List<String>,
+    val outfire: List<String>,
+    val riskMeasure: List<String>,
+    val safeSigns: List<String>
+)

+ 7 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/SecurityScanBean.kt

@@ -0,0 +1,7 @@
+package com.rc.httpcore.bean
+
+data class SecurityScanBean(
+    val code: Int,
+    val `data`: Data,
+    val msg: String
+)

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

@@ -0,0 +1,13 @@
+package com.rc.httpcore.bean
+
+data class SenseType(
+    val code: Int,
+    val dictKey: Int,
+    val enumName: String,
+    val hardwareTypeCode: Int,
+    val hardwareTypeName: String,
+    val img: String,
+    val name: String,
+    val showName: String,
+    val unit: String
+)

+ 7 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/bean/State.kt

@@ -0,0 +1,7 @@
+package com.rc.httpcore.bean
+
+data class State(
+    val code: Int,
+    val dictKey: Int,
+    val name: String
+)

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

@@ -0,0 +1,9 @@
+package com.rc.httpcore.bean
+
+data class SubAddrr(
+    val buildName: String,
+    val floorId: Int,
+    val floorName: String,
+    val id: Int,
+    val room: String
+)

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

@@ -0,0 +1,10 @@
+package com.rc.httpcore.bean
+
+data class SubClassVO(
+    val classtypeId: Any,
+    val dangerLevel: Int,
+    val levelColor: Any,
+    val levelName: Any,
+    val subjectId: Any,
+    val typeName: Any
+)

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

@@ -0,0 +1,698 @@
+package com.rc.httpcore.client
+
+import com.rc.httpcore.HttpClient
+import com.rc.httpcore.bean.DafactTreatmentBean
+import com.rc.httpcore.bean.NotifierBean
+import com.rc.httpcore.vo.*
+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 retrofit2.http.Body
+import java.io.File
+
+object ApiRepository {
+
+    private val mClientFactory by lazy { HttpClient.createClientFactory() }
+
+    fun twosTageList(): Observable<List<ChemicalLeftBean>> {
+        return mClientFactory.createLabClient()
+            .twosTageList()
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getListNoPage(deptId: Int): Observable<List<ChemicalRightBean>> {
+        return mClientFactory.createLabClient()
+            .getListNoPage(deptId)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getAppNoAuthList(subId: Int, cabinetName: String?, searchValue:String?): Observable<List<AppNoAuthList>> {
+        return mClientFactory.createLabClient()
+            .getAppNoAuthList(subId, cabinetName,searchValue)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getAppList(
+        map: Map<String, Any>
+    ): Observable<CommonListResponse<InventoryList>> {
+        return mClientFactory.createLabClient()
+            .getAppList(map)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getDetailAppList(takeStockId: Int,searchValue:String?): Observable<CommonListResponse<InventoryList>> {
+        return mClientFactory.createLabClient()
+            .getDetailAppList(takeStockId,searchValue)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+
+
+    fun getTypeChemicalShape(): Observable<List<InventoryList>> {
+        return mClientFactory.createLabClient()
+            .getTypeChemicalShape()
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getChemicalList(map: Map<String, Any>): Observable<CommonListResponse<InventoryList>> {
+        return mClientFactory.createLabClient()
+            .getChemicalList(map)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getAppLabelList(map: Map<String, Any>): Observable<CommonListResponse<InventoryList>> {
+        return mClientFactory.createLabClient()
+            .getAppLabelList(map)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getAppStockList(map: Map<String, String>): Observable<List<InventoryList>> {
+        return mClientFactory.createLabClient()
+            .getAppStockList(map)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+
+    fun getHxpTakeStockCommit(param: InventorySubmissionVo): Observable<CommonResponse> {
+        return mClientFactory.createLabClient()
+            .getHxpTakeStockCommit(param)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun padPwdLogin(map: Map<String, String>): Observable<LearnLoginVo> {
+        return mClientFactory.createLabClient()
+            .padPwdLogin(map)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun swipeCardLogin(map: Map<String, String>): Observable<LearnLoginVo> {
+        return mClientFactory.createLabClient()
+            .swipeCardLogin(map)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getListYmd(
+        pageNum: Int,
+        pageSize: Int,
+        isStart: Int,
+    ): Observable<CommonListResponse<CourseListBean>> {
+        return mClientFactory.createLabClient()
+            .getListYmd(pageNum, pageSize, isStart)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getHxpCabinetApp(subId: Int): Observable<CabinetBeans> {
+        return mClientFactory.createLabClient()
+            .getHxpCabinetApp(subId)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 查询LOGO配置列表
+     */
+    fun queryLogoConfInfo(): Observable<ConfLogo> {
+        return mClientFactory.createLabClient()
+            .queryLogoConfInfo()
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getCourseList(courseId: String): Observable<SchoolBeginsBean> {
+        return mClientFactory.createLabClient()
+            .getCourseList(courseId)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getSinginCount(courseId: String): Observable<NotifierBean> {
+        return mClientFactory.createLabClient()
+            .getSinginCount(courseId)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getSendSendMsg(courseId: String): Observable<CommonResponse> {
+        return mClientFactory.createLabClient()
+            .getSendSendMsg(courseId)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getUseRecordByCode(id: Int): Observable<CommonListResponse<UsageRecordBean>> {
+        return mClientFactory.createLabClient()
+            .getUseRecordByCode(id)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getApplyByCode(id: Int): Observable<CommonListResponse<UsageRecordBean>> {
+        return mClientFactory.createLabClient()
+            .getApplyByCode(id)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+
+    fun getSingList(
+        courseId: String,
+        pageNum: Int,
+        pageSize: Int,
+    ): Observable<CommonListResponse<NumberOfCheckListBean>> {
+        return mClientFactory.createLabClient()
+            .getSingList(courseId, pageNum, pageSize)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getEditPad(map: Map<String, Any>): Observable<CommonResponse> {
+        return mClientFactory.createLabClient()
+            .getEditPad(map)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getCheckClapAppAdd(randomClapBean: RandomClapBean): Observable<Boolean> {
+        return mClientFactory.createLabClient()
+            .getCheckClapAppAdd(randomClapBean)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getCheckClapAppList(rectifyStatus:Int): Observable<HandManVo> {
+        return mClientFactory.createLabClient()
+            .getCheckClapAppList(rectifyStatus)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getCheckClapMylist(rectifyStatus:Int):Observable<HandManVo>{
+        return mClientFactory.createLabClient()
+            .getCheckClapMylist(rectifyStatus)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getAppFindById(id:String,state: Int):Observable<HandManBean>{
+        return mClientFactory.createLabClient()
+            .getAppFindById(id,state)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getCheckClapClapApprove(data: HandManBean):Observable<Boolean>{
+        return mClientFactory.createLabClient()
+            .getCheckClapClapApprove(data)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getAppFindCheckManage(id: String): Observable<SpecialInspectionBean> {
+        return mClientFactory.createLabClient()
+            .getAppFindCheckManage(id)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getCheckManageAppUpdate(bean: SpecialInspectionBean): Observable<CommonResponse> {
+        return mClientFactory.createLabClient()
+            .getCheckManageAppUpdate(bean)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getCountHazardNum(subId: String,hazardCheckPro:String): Observable<String> {
+        return mClientFactory.createLabClient()
+            .getCountHazardNum(subId,hazardCheckPro)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+
+    fun getCheckManageApp(bean: SpecialInspectionBean): Observable<CommonResponse> {
+        return mClientFactory.createLabClient()
+            .getCheckManageApp(bean)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getBuildBySubList(searchValue: String): Observable<List<InventoryList>> {
+        return mClientFactory.createLabClient()
+            .getBuildBySubList(searchValue)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getCheckPlanBySubId(subId: String): Observable<List<Record>> {
+        return mClientFactory.createLabClient()
+            .getCheckPlanBySubId(subId)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getBuildingDate(): Observable<List<InventoryList>> {
+        return mClientFactory.createLabClient()
+            .getBuildingDate()
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+
+    fun getCheckOptionList(searchValue:String?): Observable<List<CheckOptionBean>> {
+        return mClientFactory.createLabClient()
+            .getCheckOptionList(searchValue)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getHazardInfoByJoinIds(joinHazardId:String): Observable<List<CheckHazardInfoDto>> {
+        return mClientFactory.createLabClient()
+            .getHazardInfoByJoinIds(joinHazardId)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getFindByCheckPlanId(id: String): Observable<List<MaterialFileBean>> {
+        return mClientFactory.createLabClient()
+            .getFindByCheckPlanId(id)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getHazardInfoBySubIds(map: Map<String, Any>): Observable<List<CheckHazardDto>> {
+        return mClientFactory.createLabClient()
+            .getHazardInfoBySubIds(map)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getAppCheckHazardList(map: Map<String, Any>):Observable<ExaminerInformationBean>{
+        return mClientFactory.createLabClient()
+            .getAppCheckHazardList(map)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getSubQuerys(subId: String):Observable<ExaminerInformationBean>{
+        return mClientFactory.createLabClient()
+            .getSubQuerys(subId)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getConditionCollegeInfo():Observable<List<InventoryList>>{
+        return mClientFactory.createLabClient()
+            .getConditionCollegeInfo()
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getAppHazardById(id: String):Observable<DafactTreatmentBean>{
+        return mClientFactory.createLabClient()
+            .getAppHazardById(id)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun addOrApprove(checkHazardBean:CheckHazardBean):Observable<Boolean>{
+        return mClientFactory.createLabClient()
+            .addOrApprove(checkHazardBean)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+
+    fun addOrApprove(map: Map<String, Any>):Observable<Boolean>{
+        return mClientFactory.createLabClient()
+            .addOrApprove(map)
+            .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())
+    }
+
+    /**
+     * 上传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 getCheckSetGentles(): Observable<UserIdentityBean> {
+        return mClientFactory.createLabClient()
+            .getCheckSetGentles()
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getCountAppList(flg: Int): Observable<CountAppBean> {
+        return mClientFactory.createLabClient()
+            .getCountAppList(flg)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    //查询待检查者列表
+    fun getSecurityAppList(map: Map<String, Any>): Observable<ExaminerInformationBean> {
+        return mClientFactory.createLabClient()
+            .getSecurityAppList(map)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    fun getDepartmentsList(): Observable<List<AppNoAuthList>> {
+        return mClientFactory.createLabClient()
+            .getDepartmentsList()
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 登录+实验室管理员
+     */
+    fun learnLogin(
+        username: String,
+        androidId: String,
+        realLogin: Boolean = false,
+    ): Observable<LearnLoginVo> {
+        val client = mClientFactory.createLabClient()
+        val param = LearnLoginReq().apply {
+            userName = username
+            machineCode = androidId
+            type = if (realLogin) "2" else "1"
+        }
+        return if (realLogin) {
+            val observable1 = client.learnLogin(param)
+            val observable2 = client.authValidation()
+            Observable.zip(observable1, observable2, { response1, response2 ->
+                response1.isManager = response2
+                response1
+            })
+        } else {
+            client.learnLogin(param)
+        }.subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 退出登录
+     */
+    fun loginOut(): Observable<Boolean> {
+        return mClientFactory.createLabClient()
+            .loginOut()
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 人脸比对
+     */
+    fun faceCompare(file: File): Observable<LearnLoginVo> {
+        return mClientFactory.createLabClient()
+            .faceCompare(file)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 查询实验室机柜列表
+     */
+    fun queryCabinetList(): Observable<List<CabinetBean>> {
+        return mClientFactory.createLabClient()
+            .queryCabinetList()
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 查询化学品
+     *
+     * @param byStock ture: 查询库存化学品
+     */
+    fun queryChemicals(
+        byStock: Boolean,
+        param: ChemicalReq,
+    ): Observable<CommonListResponse<ChemicalBean>> {
+        return if (byStock) queryChemicalByStock(param) else queryChemicalList(param)
+    }
+
+    /**
+     * 查询化学品
+     */
+    fun queryChemicalList(param: ChemicalReq): Observable<CommonListResponse<ChemicalBean>> {
+        return mClientFactory.createLabClient()
+            .queryChemicalList(param)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 查询库存化学品
+     */
+    fun queryChemicalByStock(param: ChemicalReq): Observable<CommonListResponse<ChemicalBean>> {
+        return mClientFactory.createLabClient()
+            .queryChemicalByStock(param)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 双人验证 刷卡识别身份权限
+     */
+    fun userValidation(param: UserValidationVo): Observable<UserValidationVo> {
+        return mClientFactory.createLabClient()
+            .userValidation(param)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 化学品入库
+     */
+    fun addStock(param: ChemicalBean): Observable<ChemicalBean> {
+        return mClientFactory.createLabClient()
+            .addStock(param)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 获取危化品安全技术说明书详细信息
+     */
+    fun hazardBookDetail(id: String): Observable<HazardBook> {
+        return mClientFactory.createLabClient()
+            .hazardBookDetail(id)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 通过识别卡号或者二维码扫码查询已入库化学品
+     */
+    fun queryByTagCode(param: TagCodeReq): Observable<Optional<ChemicalBean>> {
+        return mClientFactory.createLabClient()
+            .queryByTagCode(param)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 领用化学品
+     */
+    fun addUserecord(param: UseReq): Observable<Boolean> {
+        return mClientFactory.createLabClient()
+            .addUserecord(param)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 归还时查询已领用化学品
+     */
+    fun queryByUserecord(param: TagCodeReq): Observable<ChemicalBean> {
+        return mClientFactory.createLabClient()
+            .queryByUserecord(param)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 归还化学品
+     */
+    fun updateUserecord(param: RevertReq): Observable<Boolean> {
+        return mClientFactory.createLabClient()
+            .updateUserecord(param)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 化学品出库
+     */
+    fun outStock(param: OutputStockReq): Observable<Boolean> {
+        return mClientFactory.createLabClient()
+            .outStock(param)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * RFID 标签更换
+     */
+    fun updateStock(param: UpdateRfidReq): Observable<Boolean> {
+        return mClientFactory.createLabClient()
+            .updateStock(param)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 查询使用记录
+     */
+    fun queryRecordList(param: OperRecordReq): Observable<CommonListResponse<AioUserecordVo>> {
+        return mClientFactory.createLabClient()
+            .queryRecordList(param)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 查询报警记录列表
+     */
+    fun queryAlarmRecordList(param: AlarmRecordReq): Observable<CommonListResponse<AioAlarmRecordVo>> {
+        return mClientFactory.createLabClient()
+            .queryAlarmRecordList(param)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 查询报警记录详情
+     */
+    fun queryAlarmRecordDetail(id: String): Observable<AioAlarmRecordVo> {
+        return mClientFactory.createLabClient()
+            .queryAlarmRecordDetail(id)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 检测类型报警记录手动处理
+     */
+    fun updateAlarmRecord(param: UpdateAlarmRecordReq): Observable<Boolean> {
+        return mClientFactory.createLabClient()
+            .updateAlarmRecord(param)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 判断当前登录人是否管理员
+     */
+    fun authValidation(): Observable<Boolean> {
+        return mClientFactory.createLabClient()
+            .authValidation()
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 终端登录查询实验室信息
+     */
+    fun querySubInfo(): Observable<SubInfoVo> {
+        return mClientFactory.createLabClient()
+            .querySubInfo()
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 人脸身份验证
+     */
+    fun faceAuth(param: SubInfoVo): Observable<UserValidationVo> {
+        return mClientFactory.createLabClient()
+            .faceAuth(param)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 查询机柜柜锁列表
+     */
+    fun queryCabinetLockList(param: CabinetLockVo): Observable<List<CabinetLockVo>> {
+        return mClientFactory.createLabClient()
+            .queryCabinetLockList(param)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 柜锁开锁
+     */
+    fun openLock(param: CabinetLockVo): Observable<LockRespBean> {
+        return mClientFactory.createLabClient()
+            .openLock(param)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 柜锁关锁
+     */
+    fun closeLock(param: CabinetLockVo): Observable<LockRespBean> {
+        return mClientFactory.createLabClient()
+            .closeLock(param)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+    /**
+     * 上传文件
+     */
+    fun fileUpload(file: File): Observable<FileRespBean> {
+        return mClientFactory.createLabClient()
+            .fileUpload(file)
+            .subscribeOn(Schedulers.io())
+            .observeOn(AndroidSchedulers.mainThread())
+    }
+
+
+
+
+
+
+
+}

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

@@ -0,0 +1,286 @@
+package com.rc.httpcore.client
+
+import com.rc.httpcore.bean.DafactTreatmentBean
+import com.rc.httpcore.bean.NotifierBean
+import com.rc.httpcore.vo.UsageRecordBean
+import com.rc.httpcore.vo.*
+import com.rc.httpcore.vo.request.*
+import com.rc.httpcore.vo.response.*
+import com.rc.httpcore.vo.response.CabinetBean
+import io.reactivex.Observable
+import java.io.File
+
+interface ChemicalClient {
+
+    fun twosTageList(): Observable<List<ChemicalLeftBean>>
+
+    fun getListNoPage(deptId: Int): Observable<List<ChemicalRightBean>>
+
+    fun getAppNoAuthList(subId: Int, cabinetName: String?, searchValue:String?): Observable<List<AppNoAuthList>>
+
+
+    fun getAppList(map: Map<String, Any>): Observable<CommonListResponse<InventoryList>>
+
+    fun getDetailAppList(takeStockId: Int,searchValue:String?): Observable<CommonListResponse<InventoryList>>
+
+    fun getTypeChemicalShape(): Observable<List<InventoryList>>
+
+    fun getChemicalList(map: Map<String, Any>): Observable<CommonListResponse<InventoryList>>
+
+    fun getAppLabelList(map: Map<String, Any>): Observable<CommonListResponse<InventoryList>>
+
+    fun getHxpCabinetApp(subId: Int): Observable<CabinetBeans>
+
+    fun getAppStockList(map: Map<String, String>): Observable<List<InventoryList>>
+
+    fun getHxpTakeStockCommit(param: InventorySubmissionVo): Observable<CommonResponse>
+
+    fun getSecurityAppList(map: Map<String, Any>): Observable<ExaminerInformationBean>
+
+    fun getCheckClapAppAdd(randomClapBean: RandomClapBean): Observable<Boolean>
+
+    fun getCheckClapAppList(rectifyStatus: Int): Observable<HandManVo>
+
+    fun getCheckClapMylist(rectifyStatus: Int): Observable<HandManVo>
+
+    fun getAppFindById(id: String,state: Int): Observable<HandManBean>
+
+    fun getCheckClapClapApprove(data: HandManBean): Observable<Boolean>
+
+    fun getAppCheckHazardList(map: Map<String, Any>):Observable<ExaminerInformationBean>
+
+    fun getSubQuerys(subId: String):Observable<ExaminerInformationBean>
+
+    fun getConditionCollegeInfo():Observable<List<InventoryList>>
+
+    fun getAppHazardById(ids:String):Observable<DafactTreatmentBean>
+
+    fun addOrApprove(checkHazardBean:CheckHazardBean):Observable<Boolean>
+
+    fun addOrApprove(map:Map<String,Any>):Observable<Boolean>
+
+    fun getDepartmentsList(): Observable<List<AppNoAuthList>>
+
+    fun padPwdLogin(map: Map<String, String>): Observable<LearnLoginVo>
+
+    fun swipeCardLogin(map: Map<String, String>): Observable<LearnLoginVo>
+
+    fun getListYmd(
+        pageNum: Int,
+        pageSize: Int,
+        isStart: Int,
+    ): Observable<CommonListResponse<CourseListBean>>
+
+    fun getCourseList(courseId: String): Observable<SchoolBeginsBean>
+
+    fun getSinginCount(courseId: String): Observable<NotifierBean>
+
+    fun getSendSendMsg(courseId: String): Observable<CommonResponse>
+
+    fun getSingList(
+        courseId: String,
+        pageNum: Int,
+        pageSize: Int,
+    ): Observable<CommonListResponse<NumberOfCheckListBean>>
+
+    fun getEditPad(map: Map<String, Any>): Observable<CommonResponse>
+
+    fun getUseRecordByCode(id: Int): Observable<CommonListResponse<UsageRecordBean>>
+
+    fun getApplyByCode(id: Int): Observable<CommonListResponse<UsageRecordBean>>
+
+    /**
+     * 查询LOGO配置列表
+     */
+    fun queryLogoConfInfo(): Observable<ConfLogo>
+
+    /**
+     * 查询APK版本
+     *
+     * @param id 设备唯一编码
+     */
+    fun apkVersion(id: String): Observable<ApkInfoResp>
+
+    /**
+     * 上传APK更新状态
+     *
+     * @param state 0:升级失败; 1:升级成功; 2:升级中
+     */
+    fun onepcApkUpdate(id: String, state: String): Observable<Boolean>
+
+    /**
+     * 查询身份
+     */
+    fun getCheckSetGentles(): Observable<UserIdentityBean>
+
+    fun getCountAppList(flg: Int): Observable<CountAppBean>
+
+    /**
+     * 学习一体机 用户端登录
+     *
+     * @param param 刷学生卡数据 userName
+     */
+    fun learnLogin(param: LearnLoginReq): Observable<LearnLoginVo>
+
+    /**
+     *  通过id查询巡查管理
+     */
+    fun getAppFindCheckManage(id: String): Observable<SpecialInspectionBean>
+
+    /**
+     * 获取检查项目
+     */
+    fun getCheckOptionList(searchValue:String?): Observable<List<CheckOptionBean>>
+
+    fun getHazardInfoByJoinIds(joinHazardId:String): Observable<List<CheckHazardInfoDto>>
+
+    fun getCountHazardNum(subId: String,hazardCheckPro:String): Observable<String>
+
+    /**
+     * 查询材料文档
+     */
+    fun getFindByCheckPlanId(id: String): Observable<List<MaterialFileBean>>
+
+    fun getHazardInfoBySubIds(map: Map<String, Any>): Observable<List<CheckHazardDto>>
+
+    /**
+     * 修改检查管理
+     */
+    fun getCheckManageAppUpdate(bean: SpecialInspectionBean): Observable<CommonResponse>
+
+    fun getCheckManageApp(bean: SpecialInspectionBean): Observable<CommonResponse>
+
+    fun getBuildBySubList(searchValue: String): Observable<List<InventoryList>>
+
+    fun getCheckPlanBySubId(subId: String): Observable<List<Record>>
+
+    fun getBuildingDate(): Observable<List<InventoryList>>
+
+    /**
+     * 退出登录
+     */
+    fun loginOut(): Observable<Boolean>
+
+
+    /**
+     * 人脸比对
+     */
+    fun faceCompare(file: File): Observable<LearnLoginVo>
+
+    /**
+     * 查询实验室机柜列表
+     */
+    fun queryCabinetList(): Observable<List<CabinetBean>>
+
+    /**
+     * 查询化学品
+     */
+    fun queryChemicalList(param: ChemicalReq): Observable<CommonListResponse<ChemicalBean>>
+
+    /**
+     * 查询库存化学品
+     */
+    fun queryChemicalByStock(param: ChemicalReq): Observable<CommonListResponse<ChemicalBean>>
+
+    /**
+     * 双人验证 刷卡识别身份权限
+     */
+    fun userValidation(param: UserValidationVo): Observable<UserValidationVo>
+
+    /**
+     * 化学品入库
+     */
+    fun addStock(param: ChemicalBean): Observable<ChemicalBean>
+
+    /**
+     * 获取危化品安全技术说明书详细信息
+     */
+    fun hazardBookDetail(id: String): Observable<HazardBook>
+
+    /**
+     * 通过识别卡号或者二维码扫码查询已入库化学品
+     */
+    fun queryByTagCode(param: TagCodeReq): Observable<Optional<ChemicalBean>>
+
+    /**
+     * 领用化学品
+     */
+    fun addUserecord(param: UseReq): Observable<Boolean>
+
+    /**
+     * 归还时查询已领用化学品
+     */
+    fun queryByUserecord(param: TagCodeReq): Observable<ChemicalBean>
+
+    /**
+     * 归还化学品
+     */
+    fun updateUserecord(param: RevertReq): Observable<Boolean>
+
+    /**
+     * 化学品出库
+     */
+    fun outStock(param: OutputStockReq): Observable<Boolean>
+
+    /**
+     * RFID 标签更换
+     */
+    fun updateStock(param: UpdateRfidReq): Observable<Boolean>
+
+    /**
+     * 查询使用记录
+     */
+    fun queryRecordList(param: OperRecordReq): Observable<CommonListResponse<AioUserecordVo>>
+
+    /**
+     * 查询报警记录列表
+     */
+    fun queryAlarmRecordList(param: AlarmRecordReq): Observable<CommonListResponse<AioAlarmRecordVo>>
+
+    /**
+     * 查询报警记录详情
+     */
+    fun queryAlarmRecordDetail(id: String): Observable<AioAlarmRecordVo>
+
+    /**
+     * 检测类型报警记录手动处理
+     */
+    fun updateAlarmRecord(param: UpdateAlarmRecordReq): Observable<Boolean>
+
+    /**
+     * 判断当前登录人是否管理员
+     */
+    fun authValidation(): Observable<Boolean>
+
+    /**
+     * 终端登录查询实验室信息
+     */
+    fun querySubInfo(): Observable<SubInfoVo>
+
+    /**
+     * 人脸身份验证
+     */
+    fun faceAuth(param: SubInfoVo): Observable<UserValidationVo>
+
+    /**
+     * 查询机柜柜锁列表
+     */
+    fun queryCabinetLockList(param: CabinetLockVo): Observable<List<CabinetLockVo>>
+
+    /**
+     * 柜锁开锁
+     */
+    fun openLock(param: CabinetLockVo): Observable<LockRespBean>
+
+    /**
+     * 柜锁关锁
+     */
+    fun closeLock(param: CabinetLockVo): Observable<LockRespBean>
+
+    /**
+     * 上传文件
+     */
+    fun fileUpload(file: File): Observable<FileRespBean>
+
+
+}

+ 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()
+
+}

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

@@ -0,0 +1,519 @@
+package com.rc.httpcore.client.retrofit;
+
+import com.rc.httpcore.bean.DafactTreatmentBean;
+import com.rc.httpcore.bean.NotifierBean;
+import com.rc.httpcore.vo.CheckHazardDto;
+import com.rc.httpcore.vo.CheckHazardInfoDto;
+import com.rc.httpcore.vo.CheckOptionBean;
+import com.rc.httpcore.vo.HandManBean;
+import com.rc.httpcore.vo.HandManVo;
+import com.rc.httpcore.vo.MaterialFileBean;
+import com.rc.httpcore.vo.Record;
+import com.rc.httpcore.vo.SpecialInspectionBean;
+import com.rc.httpcore.vo.UsageRecordBean;
+import com.rc.httpcore.vo.AppNoAuthList;
+import com.rc.httpcore.vo.CabinetBeans;
+import com.rc.httpcore.vo.CommonDataResponse;
+import com.rc.httpcore.vo.CommonListResponse;
+import com.rc.httpcore.vo.CommonResponse;
+import com.rc.httpcore.vo.CountAppBean;
+import com.rc.httpcore.vo.ExaminerInformationBean;
+import com.rc.httpcore.vo.InventoryList;
+import com.rc.httpcore.vo.InventorySubmissionVo;
+import com.rc.httpcore.vo.CourseListBean;
+import com.rc.httpcore.vo.NumberOfCheckListBean;
+import com.rc.httpcore.vo.SchoolBeginsBean;
+import com.rc.httpcore.vo.UserIdentityBean;
+import com.rc.httpcore.vo.request.AlarmRecordReq;
+import com.rc.httpcore.vo.request.ChemicalReq;
+import com.rc.httpcore.vo.request.FaceCompareReq;
+import com.rc.httpcore.vo.request.LearnLoginReq;
+import com.rc.httpcore.vo.request.OperRecordReq;
+import com.rc.httpcore.vo.request.OutputStockReq;
+import com.rc.httpcore.vo.request.RevertReq;
+import com.rc.httpcore.vo.request.TagCodeReq;
+import com.rc.httpcore.vo.request.UpdateAlarmRecordReq;
+import com.rc.httpcore.vo.request.UpdateRfidReq;
+import com.rc.httpcore.vo.request.UseReq;
+import com.rc.httpcore.vo.request.UserValidationVo;
+import com.rc.httpcore.vo.response.AioAlarmRecordVo;
+import com.rc.httpcore.vo.response.AioUserecordVo;
+import com.rc.httpcore.vo.response.ApkInfoResp;
+import com.rc.httpcore.vo.response.CabinetBean;
+import com.rc.httpcore.vo.response.CabinetLockVo;
+import com.rc.httpcore.vo.response.ChemicalBean;
+import com.rc.httpcore.vo.response.ChemicalLeftBean;
+import com.rc.httpcore.vo.response.ChemicalRightBean;
+import com.rc.httpcore.vo.response.ConfLogo;
+import com.rc.httpcore.vo.response.FileRespBean;
+import com.rc.httpcore.vo.response.HazardBook;
+import com.rc.httpcore.vo.response.LearnLoginVo;
+import com.rc.httpcore.vo.response.LockRespBean;
+import com.rc.httpcore.vo.response.SubInfoVo;
+
+import org.w3c.dom.Node;
+
+import java.util.List;
+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.Headers;
+import retrofit2.http.Multipart;
+import retrofit2.http.POST;
+import retrofit2.http.PUT;
+import retrofit2.http.Part;
+import retrofit2.http.Path;
+import retrofit2.http.Query;
+import retrofit2.http.QueryMap;
+
+public interface ApiService {
+
+
+    @GET("system/dept/twostage/list")
+    Observable<CommonDataResponse<List<ChemicalLeftBean>>> twosTageList();
+
+    @GET("laboratory/subject/list/nopage")
+    Observable<CommonDataResponse<List<ChemicalRightBean>>> getListNoPage(@Query("deptId") int deptId);
+
+    @GET("chemical/hxpCabinet/getAppNoauthList")
+    Observable<CommonDataResponse<List<AppNoAuthList>>> getAppNoAuthList(@Query("subId") int subId, @Query("cabinetName") String cabinetName,@Query("searchValue") String searchValue);
+
+    @GET("chemical/hxpTakeStock/appList")
+    Observable<CommonListResponse<InventoryList>> getAppList(@QueryMap Map<String, Object> map);
+
+    @GET("chemical/hxpTakeStockDetail/appList")
+    Observable<CommonListResponse<InventoryList>> getDetailAppList(@Query("takeStockId") int takeStockId,@Query("searchValue") String searchValue,@Query("pageNum") int pageNum, @Query("pageSize") int pageSize);
+
+    @GET("system/dict/data/type/chemical_shape")
+    Observable<CommonListResponse<InventoryList>> getTypeChemicalShape();
+
+    @GET("chemical/hxpStock/appChemicalList")
+    Observable<CommonListResponse<InventoryList>> getChemicalList(@QueryMap Map<String, Object> map);
+
+
+    //硬件设备列表
+    @GET("chemical/hxpStock/appLabelList")
+    Observable<CommonListResponse<InventoryList>> getAppLabelList(@QueryMap Map<String, Object> map);
+
+    //获取化学品柜详情
+    @GET("chemical/hxpCabinet/app/{subId}")
+    Observable<CommonDataResponse<CabinetBeans>> getHxpCabinetApp(@Path("subId") int subId);
+
+    @GET("chemical/hxpStock/appStockList")
+    Observable<CommonDataResponse<List<InventoryList>>> getAppStockList(@QueryMap Map<String, String> map);
+
+
+    @POST("chemical/hxpTakeStock")
+    Observable<CommonResponse> getHxpTakeStockCommit(@Body InventorySubmissionVo body);
+
+    //登录后 查询用户身份 是否是检查着 或 整改着
+    @GET("security/checkSet/getGentle")
+    Observable<CommonDataResponse<UserIdentityBean>> getCheckSetGentles();
+
+    //根据检查者查询 检查信息
+    @GET("zd-security/DataStatistics/countApp")
+    Observable<CommonDataResponse<CountAppBean>> getCountAppList(@Query("flg") int flg);
+
+    //查询待检查信息
+    @POST("security/checkManage/appList")
+    Observable<CommonDataResponse<ExaminerInformationBean>> getSecurityAppList(@Body RequestBody body);
+
+    @POST("security/checkClap/appAdd")
+    Observable<CommonDataResponse> getCheckClapAppAdd(@Body RequestBody body);
+
+    //随手拍--管理
+    @GET("security/checkClap/appList")
+    Observable<CommonDataResponse<HandManVo>> getCheckClapAppList(@Query("rectifyStatus") int rectifyStatus,@Query("pageNum") int pageNum, @Query("pageSize") int pageSize);
+
+    //随手拍-记录
+    @GET("security/checkClap/mylist")
+    Observable<CommonDataResponse<HandManVo>> getCheckClapMylist(@Query("rectifyStatus") int rectifyStatus);
+
+    //随手拍根据id查询详情
+    @GET("security/checkClap/appFindById")
+    Observable<CommonDataResponse<HandManBean>> getAppFindById(@Query("id") String id, @Query("rectifyStatus") int rectifyStatus);
+
+    //随手拍--管理详情-整改提交
+    @POST("security/checkClap/clapApprove")
+    Observable<CommonDataResponse> getCheckClapClapApprove(@Body RequestBody body);
+
+    //校园巡查隐患信息
+    @GET("security/checkHazard/appCheckHazardList")
+    Observable<CommonDataResponse<ExaminerInformationBean>> getAppCheckHazardList(@QueryMap Map<String, Object> map);
+
+    @GET("laboratory/subject/manger/subQuery/{param1}/0")
+    Observable<CommonDataResponse<ExaminerInformationBean>> getSubQuerys(@Path("param1") String subId);
+
+    //学院--隐患信息
+    @GET("laboratory/subject/conditionCollegeInfo")
+    Observable<CommonDataResponse<List<InventoryList>>> getConditionCollegeInfo();
+
+    @GET("security/checkHazard/getAppHazardById")
+    Observable<CommonDataResponse<DafactTreatmentBean>> getAppHazardById(@Query("id") String id);
+
+    //整改提交信息
+    @POST("security/checkRectify/addOrApprove")
+    Observable<CommonDataResponse<Boolean>> addOrApprove(@Body RequestBody body);
+
+
+    //查询学院
+    @GET("system/dept/departments/list")
+    Observable<CommonListResponse<AppNoAuthList>> getDepartmentsList();
+
+
+    /**
+     * 账号密码登录
+     *
+     * @param body
+     * @return
+     */
+    @POST("auth/pda/pwdLogin")
+    Observable<CommonDataResponse<LearnLoginVo>> padPwdLogin(@Body RequestBody body);
+
+    /**
+     * 刷卡登录
+     *
+     * @return
+     */
+    @POST("auth/handset/login")
+    Observable<CommonDataResponse<LearnLoginVo>> swipeCardLogin(@Body RequestBody body);
+
+    /**
+     * 开课列表
+     *
+     * @param pageNum  1 页
+     * @param pageSize 20 条
+     * @param isStart  是否开课(0否 1是)
+     * @return
+     */
+    @GET("exam/securitycourse/listYmd")
+    Observable<CommonListResponse<CourseListBean>> getListYmd(@Query("pageNum") int pageNum, @Query("pageSize") int pageSize, @Query("isStart") int isStart);
+
+    /**
+     * 课程详情
+     *
+     * @param courseId
+     * @return
+     */
+    @GET("exam/securitycourse/app/{courseId}")
+    Observable<CommonDataResponse<SchoolBeginsBean>> getCourseList(@Path("courseId") String courseId);
+
+    @GET("exam/securitycourse/singinCount")
+    Observable<CommonDataResponse<NotifierBean>> getSinginCount(@Query("courseId") String courseId, @Query("isSing") String isSing);
+
+
+    /**
+     * 发送课程通知
+     *
+     * @param courseId
+     * @return
+     */
+    @GET("exam/securitycourse/sendMsg")
+    Observable<CommonResponse> getSendSendMsg(@Query("courseId") String courseId);
+
+    /**
+     * 结课
+     *
+     * @param body
+     * @return
+     */
+    @POST("exam/securitycourse/editPda")
+    Observable<CommonResponse> getEditPad(@Body RequestBody body);
+
+    //根据库存id查询使用记录列表
+    @GET("chemical/hxpStock/useRecordByCode")
+    Observable<CommonListResponse<UsageRecordBean>> getUseRecordByCode(@Query("id") int id);
+
+    //根据库存id查询申领记录列表
+    @GET("chemical/hxpStock/applyByCode")
+    Observable<CommonListResponse<UsageRecordBean>> getApplyByCode(@Query("id") int id);
+
+    /**
+     * 签到列表
+     *
+     * @param courseId
+     * @param pageNum
+     * @param pageSize
+     * @return
+     */
+    @GET("exam/securitycourse/singList")
+    Observable<CommonListResponse<NumberOfCheckListBean>> getSingList(@Query("courseId") String courseId, @Query("isSing") int isSing, @Query("pageNum") int pageNum, @Query("pageSize") int pageSize);
+
+    /**
+     * 查询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更新状态
+     *
+     * @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);
+
+    /**
+     * 通过id查询巡查管理
+     *
+     * @param id
+     * @return
+     */
+    @GET("security/checkManage/appFindCheckManage")
+    Observable<CommonDataResponse<SpecialInspectionBean>> getAppFindCheckManage(@Query("id") String id);
+
+
+    /**
+     * 查询 检查项目目录
+     *
+     * @return
+     */
+    @GET("security/checkOption/list")
+    Observable<CommonListResponse<CheckOptionBean>> getCheckOptionList(@Query("searchValue") String searchValue);
+
+    /**
+     * 查询 检查项目目录
+     *
+     * @return
+     */
+    @GET("security/checkOption/list")
+    Observable<CommonListResponse<CheckOptionBean>> getCheckOptionList();
+
+    @GET("zd-security/checkManage/getHazardInfoByJoinIds")
+    Observable<CommonListResponse<CheckHazardInfoDto>> getHazardInfoByJoinIds(@Query("joinHazardIds") String joinId);
+
+
+    //获取隐患次数
+    @GET("zd-security/checkHazard/countHazardNum")
+    Observable<CommonDataResponse<String>> getCountHazardNum(@Query("subId") String subId,@Query("hazardCheckPro") String hazardCheckPro);
+
+
+    /**
+     * 修改检查管理
+     *
+     * @param specialInspectionBean
+     * @return
+     */
+    @PUT("security/checkManage/appUpdate")
+    Observable<CommonResponse> getCheckManageAppUpdate(@Body SpecialInspectionBean specialInspectionBean);
+
+
+    /**
+     * 新增检查管理
+     *
+     * @param specialInspectionBean
+     * @return
+     */
+    @POST("zd-security/checkManage/add")
+    Observable<CommonResponse> getCheckManageApp(@Body SpecialInspectionBean specialInspectionBean);
+
+
+    /**
+     * https://lab.zjznai.com/labAppTest//laboratory/subject/buildBySub/list?searchValue=1
+     *
+     * @param searchValue
+     * @return
+     */
+    @GET("laboratory/subject/buildBySub/list")
+    Observable<CommonListResponse<InventoryList>> getBuildBySubList(@Query("searchValue") String searchValue);
+
+    //根据实验室ID查询计划标题
+    @GET("security/checkManage/getCheckPlanBySubId")
+    Observable<CommonListResponse<Record>> getCheckPlanBySubId(@Query("subId") String subId);
+
+    @GET("laboratory/buildFloor/getlist")
+    Observable<CommonListResponse<InventoryList>> getBuildingDate(@Query("type") int type);
+
+    //获取材料文档
+    @GET("security/upload/findByCheckPlanId")
+    Observable<CommonListResponse<MaterialFileBean>> getFindByCheckPlanId(@Query("checkPlanId") String id);
+
+    @GET("laboratory/hazard/getHazardInfoBySubId")
+//    @GET("laboratory/hazard/getHazardListBySub")
+    Observable<CommonListResponse<CheckHazardDto>> getHazardInfoBySubIds(@QueryMap Map<String, Object> map);
+
+    /**
+     * 退出登录
+     */
+    @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")
+//    Observable<CommonDataResponse<String>> faceNewCompare(@Path("basePath") String basePath, @Part MultipartBody.Part filePart, @PartMap Map<String, RequestBody> files);
+
+    /**
+     * 人脸比对
+     */
+    @Multipart
+//    @POST("facePda/pdaCompare")
+    @POST("auth/facePda")
+    Observable<CommonDataResponse<LearnLoginVo>> faceNewCompare(@Part MultipartBody.Part filePart);
+
+    /**
+     * 查询实验室机柜列表 ,
+     */
+    @POST("chemical/api/queryCabinetList")
+    Observable<CommonDataResponse<List<CabinetBean>>> queryCabinetList(@Body CabinetBean param);
+
+    /**
+     * 查询化学品
+     */
+    @POST("chemical/api/queryChemicalList")
+    Observable<CommonListResponse<ChemicalBean>> queryChemicalList(@Query("pageNum") int pageNum, @Query("pageSize") int pageSize, @Body ChemicalReq param);
+
+    /**
+     * 查询库存化学品
+     */
+    @POST("chemical/api/queryChemicalByStock")
+    Observable<CommonListResponse<ChemicalBean>> queryChemicalByStock(@Query("pageNum") int pageNum, @Query("pageSize") int pageSize, @Body ChemicalReq param);
+
+    /**
+     * 双人验证 刷卡识别身份权限
+     */
+    @POST("chemical/api/userValidation")
+    Observable<CommonDataResponse<UserValidationVo>> userValidation(@Body UserValidationVo param);
+
+    /**
+     * 化学品入库
+     */
+    @POST("chemical/api/addStock")
+    Observable<CommonDataResponse<ChemicalBean>> addStock(@Body ChemicalBean param);
+
+    /**
+     * 获取危化品安全技术说明书详细信息
+     */
+    @GET("laboratory/hazard_book/{id}")
+    Observable<CommonDataResponse<HazardBook>> hazardBookDetail(@Path("id") String id);
+
+    /**
+     * 通过识别卡号或者二维码扫码查询已入库化学品
+     */
+    @POST("chemical/api/queryByTagCode")
+    Observable<CommonDataResponse<ChemicalBean>> queryByTagCode(@Body TagCodeReq param);
+
+    /**
+     * 领用化学品
+     */
+    @POST("chemical/api/addUserecord")
+    Observable<CommonResponse> addUserecord(@Body UseReq param);
+
+    /**
+     * 归还时查询已领用化学品
+     */
+    @POST("chemical/api/queryByUserecord")
+    Observable<CommonDataResponse<ChemicalBean>> queryByUserecord(@Body TagCodeReq param);
+
+    /**
+     * 归还化学品
+     */
+    @POST("chemical/api/updateUserecord")
+    Observable<CommonResponse> updateUserecord(@Body RevertReq param);
+
+    /**
+     * 化学品出库
+     */
+    @POST("chemical/api/outStock")
+    Observable<CommonResponse> outStock(@Body OutputStockReq param);
+
+    /**
+     * RFID 标签更换
+     */
+    @POST("chemical/api/updateStock")
+    Observable<CommonResponse> updateStock(@Body UpdateRfidReq param);
+
+    /**
+     * 查询使用记录
+     */
+    @POST("chemical/api/queryRecordList")
+    Observable<CommonListResponse<AioUserecordVo>> queryRecordList(@Query("pageNum") int pageNum, @Query("pageSize") int pageSize, @Body OperRecordReq param);
+
+    /**
+     * 查询报警记录列表
+     */
+    @POST("chemical/api/queryAlarmRecordList")
+    Observable<CommonListResponse<AioAlarmRecordVo>> queryAlarmRecordList(@Query("pageNum") int pageNum, @Query("pageSize") int pageSize, @Body AlarmRecordReq param);
+
+    /**
+     * 查询报警记录详情
+     */
+    @GET("chemical/api/queryAlarmRecordDetail")
+    Observable<CommonDataResponse<AioAlarmRecordVo>> queryAlarmRecordDetail(@Query("id") String id);
+
+    /**
+     * 检测类型报警记录手动处理
+     */
+    @POST("chemical/api/updateAlarmRecord")
+    Observable<CommonResponse> updateAlarmRecord(@Body UpdateAlarmRecordReq param);
+
+    /**
+     * 判断当前登录人是否管理员
+     */
+    @POST("chemical/api/authValidation")
+    Observable<CommonDataResponse<Boolean>> authValidation();
+
+    /**
+     * 终端登录查询实验室信息
+     */
+    @POST("chemical/api/querySubInfo")
+    Observable<CommonDataResponse<SubInfoVo>> querySubInfo();
+
+    /**
+     * 人脸身份验证
+     */
+    @POST("chemical/api/faceAuth")
+    Observable<CommonDataResponse<UserValidationVo>> faceAuth(@Body SubInfoVo param);
+
+    /**
+     * 查询机柜柜锁列表
+     */
+    @POST("chemical/api/queryCabinetLockList")
+    Observable<CommonDataResponse<List<CabinetLockVo>>> queryCabinetLockList(@Body CabinetLockVo param);
+
+    /**
+     * 柜锁开锁
+     */
+    @POST("chemical/api/openLock")
+    Observable<CommonDataResponse<LockRespBean>> openLock(@Body CabinetLockVo param);
+
+    /**
+     * 柜锁关锁
+     */
+    @POST("chemical/api/closeLock")
+    Observable<CommonDataResponse<LockRespBean>> closeLock(@Body CabinetLockVo param);
+
+    /**
+     * 上传文件
+     */
+    @Multipart
+//    @POST("{basePath}file/upload")
+    @POST("{basePath}/file/upload")
+    @Headers("Transfer-Encoding: chunked")
+    Observable<CommonDataResponse<FileRespBean>> fileUpload(@Path(value = "basePath", encoded = true) String basePath, @Part MultipartBody.Part filePart);
+
+}

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

@@ -0,0 +1,949 @@
+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.DafactTreatmentBean
+import com.rc.httpcore.bean.NotifierBean
+import com.rc.httpcore.vo.UsageRecordBean
+import com.rc.httpcore.client.ChemicalClient
+import com.rc.httpcore.exception.NetException
+import com.rc.httpcore.vo.*
+import com.rc.httpcore.vo.request.*
+import com.rc.httpcore.vo.response.*
+import com.rc.httpcore.vo.response.CabinetBean
+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)
+    }
+
+    override fun twosTageList(): Observable<List<ChemicalLeftBean>> {
+        return apiService.twosTageList().map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response.data
+        }
+    }
+
+    override fun getListNoPage(deptId: Int): Observable<List<ChemicalRightBean>> {
+        return apiService.getListNoPage(deptId).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response.data
+        }
+    }
+
+    override fun getAppNoAuthList(
+        subId: Int,
+        cabinetName: String?,
+        searchValue:String?,
+    ): Observable<List<AppNoAuthList>> {
+        return apiService.getAppNoAuthList(subId, cabinetName,searchValue).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response.data
+        }
+    }
+
+    override fun getAppList(map: Map<String, Any>): Observable<CommonListResponse<InventoryList>> {
+        return apiService.getAppList(map).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response
+        }
+    }
+
+    override fun getDetailAppList(takeStockId: Int,searchValue:String?): Observable<CommonListResponse<InventoryList>> {
+        return apiService.getDetailAppList(takeStockId,searchValue,1,800).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response
+        }
+    }
+
+    override fun getTypeChemicalShape(): Observable<List<InventoryList>> {
+        return apiService.typeChemicalShape.map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response.data
+        }
+    }
+
+    override fun getChemicalList(map: Map<String, Any>): Observable<CommonListResponse<InventoryList>> {
+        return apiService.getChemicalList(map).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response
+        }
+    }
+
+    override fun getAppLabelList(map: Map<String, Any>): Observable<CommonListResponse<InventoryList>> {
+        return apiService.getAppLabelList(map).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response
+        }
+    }
+
+    override fun getHxpCabinetApp(subId: Int): Observable<CabinetBeans> {
+        return apiService.getHxpCabinetApp(subId).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response.data
+        }
+    }
+
+    override fun getAppStockList(map: Map<String, String>): Observable<List<InventoryList>> {
+        return apiService.getAppStockList(map)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+
+                return@map response.data
+            }
+    }
+
+    override fun getHxpTakeStockCommit(param: InventorySubmissionVo): Observable<CommonResponse> {
+        return apiService.getHxpTakeStockCommit(param)
+            .map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response
+        }
+    }
+
+    override fun getSecurityAppList(map: Map<String, Any>): Observable<ExaminerInformationBean> {
+        val gson = Gson()
+        val toJson = gson.toJson(map)
+        val body = RequestBody.create(MediaType.parse("application/json"), toJson)
+        return apiService.getSecurityAppList(body).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response.data
+        }
+
+    }
+
+    override fun getCheckClapAppAdd(randomClapBean: RandomClapBean): Observable<Boolean> {
+        val gson = Gson()
+        val toJson = gson.toJson(randomClapBean)
+        Log.d("okhttp=================", toJson)
+        val body = RequestBody.create(MediaType.parse("application/json"), toJson)
+        return apiService.getCheckClapAppAdd(body).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map true
+        }
+
+    }
+
+    override fun getCheckClapAppList(rectifyStatus: Int): Observable<HandManVo> {
+        return apiService.getCheckClapAppList(rectifyStatus,1,200).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response.data
+        }
+    }
+
+    override fun getCheckClapMylist(rectifyStatus: Int): Observable<HandManVo> {
+        return apiService.getCheckClapMylist(rectifyStatus).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response.data
+        }
+    }
+
+    override fun getAppFindById(id: String, state: Int): Observable<HandManBean> {
+        return apiService.getAppFindById(id, state).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response.data
+        }
+    }
+
+    override fun getCheckClapClapApprove(data: HandManBean): Observable<Boolean> {
+        val gson = Gson()
+        val toJson = gson.toJson(data)
+        Log.d("okhttp=================", toJson)
+        val body = RequestBody.create(MediaType.parse("application/json"), toJson)
+        return apiService.getCheckClapClapApprove(body).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map true
+        }
+
+    }
+
+    override fun getAppCheckHazardList(map: Map<String, Any>): Observable<ExaminerInformationBean> {
+//        val gson = Gson()
+//        val toJson = gson.toJson(map)
+//        val body = RequestBody.create(MediaType.parse("application/json"), toJson)
+        return apiService.getAppCheckHazardList(map).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response.data
+        }
+    }
+
+    override fun getSubQuerys(subId: String): Observable<ExaminerInformationBean> {
+        return apiService.getSubQuerys(subId).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response.data
+        }
+    }
+
+    override fun getConditionCollegeInfo(): Observable<List<InventoryList>> {
+        return apiService.conditionCollegeInfo.map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response.data
+        }
+    }
+
+    override fun getAppHazardById(ids: String): Observable<DafactTreatmentBean> {
+        return apiService.getAppHazardById(ids)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun addOrApprove(checkHazardBean: CheckHazardBean): Observable<Boolean> {
+        val gson = Gson()
+        val toJson = gson.toJson(checkHazardBean)
+        Log.d("========t======", toJson)
+        val body = RequestBody.create(MediaType.parse("application/json"), toJson)
+        return apiService.addOrApprove(body).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response.data
+        }
+    }
+
+    override fun addOrApprove(map: Map<String, Any>): Observable<Boolean> {
+        val gson = Gson()
+        val toJson = gson.toJson(map)
+        Log.d("========b======", toJson)
+        val body = RequestBody.create(MediaType.parse("application/json"), toJson)
+        return apiService.addOrApprove(body).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response.data
+        }
+    }
+
+    override fun getDepartmentsList(): Observable<List<AppNoAuthList>> {
+        return apiService.departmentsList
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun padPwdLogin(map: Map<String, String>): Observable<LearnLoginVo> {
+        val gson = Gson()
+        val toJson = gson.toJson(map)
+        val body = RequestBody.create(MediaType.parse("application/json"), toJson)
+        return apiService.padPwdLogin(body).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            Log.d("login=============", response.data?.access_token)
+            HttpClient.token = response.data?.access_token
+            return@map response.data
+        }
+    }
+
+    override fun swipeCardLogin(map: Map<String, String>): Observable<LearnLoginVo> {
+        val gson = Gson()
+        val toJson = gson.toJson(map)
+        val body = RequestBody.create(MediaType.parse("application/json"), toJson)
+        return apiService.swipeCardLogin(body).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            HttpClient.token = response.data?.access_token
+            return@map response.data
+        }
+    }
+
+    override fun getListYmd(
+        pageNum: Int,
+        pageSize: Int,
+        isStart: Int,
+    ): Observable<CommonListResponse<CourseListBean>> {
+        return apiService.getListYmd(pageNum, pageSize, isStart).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response
+        }
+    }
+
+    override fun getCourseList(courseId: String): Observable<SchoolBeginsBean> {
+        return apiService.getCourseList(courseId)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+
+                return@map response.data
+            }
+    }
+
+    override fun getSinginCount(courseId: String): Observable<NotifierBean> {
+        return apiService.getSinginCount(courseId,"0")
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+
+                return@map response.data
+            }
+    }
+
+    override fun getSendSendMsg(courseId: String): Observable<CommonResponse> {
+        return apiService.getSendSendMsg(courseId).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response
+        }
+    }
+
+
+    override fun getSingList(
+        courseId: String,
+        pageNum: Int,
+        pageSize: Int,
+    ): Observable<CommonListResponse<NumberOfCheckListBean>> {
+        return apiService.getSingList(courseId, 1, pageNum, pageSize)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+                return@map response
+            }
+    }
+
+    override fun getEditPad(map: Map<String, Any>): Observable<CommonResponse> {
+        val gson = Gson()
+        val toJson = gson.toJson(map)
+        val body = RequestBody.create(MediaType.parse("application/json"), toJson)
+        return apiService.getEditPad(body).map {
+            if (!it.isSuccess()) {
+                throw NetException(it.code, it.msg)
+            }
+            return@map it
+        }
+    }
+
+    override fun getUseRecordByCode(id: Int): Observable<CommonListResponse<UsageRecordBean>> {
+        return apiService.getUseRecordByCode(id).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response
+        }
+    }
+
+
+    override fun getApplyByCode(id: Int): Observable<CommonListResponse<UsageRecordBean>> {
+        return apiService.getApplyByCode(id).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+
+            return@map response
+        }
+    }
+
+
+    /**
+     * 查询LOGO配置列表
+     */
+    override fun queryLogoConfInfo(): Observable<ConfLogo> {
+        return apiService.queryLogoConfInfo()
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+
+                return@map response.data
+            }
+    }
+
+    /**
+     * 查询APK版本
+     *
+     * @param id 设备唯一编码
+     */
+    override fun apkVersion(id: String): Observable<ApkInfoResp> {
+        return apiService.apkVersion(id)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+                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.msg)
+                }
+                return@map true
+            }
+    }
+
+    override fun getCheckSetGentles(): Observable<UserIdentityBean> {
+        return apiService.getCheckSetGentles()
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+                return@map response.data
+            }
+    }
+
+    override fun getCountAppList(flg: Int): Observable<CountAppBean> {
+        return apiService.getCountAppList(flg).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response.data
+        }
+    }
+
+    /**
+     * 用户端登录
+     *
+     * @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.msg)
+                }
+
+                HttpClient.token = response.data?.access_token
+                return@map response.data
+            }
+    }
+
+    override fun getAppFindCheckManage(id: String): Observable<SpecialInspectionBean> {
+        return apiService.getAppFindCheckManage(id).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response.data
+        }
+    }
+
+    override fun getCheckOptionList(searchValue: String?): Observable<List<CheckOptionBean>> {
+        if (searchValue == null) {
+            return apiService.checkOptionList.map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+                return@map response.data
+            }
+        } else {
+            return apiService.getCheckOptionList(searchValue).map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+                return@map response.data
+            }
+        }
+
+    }
+
+    override fun getHazardInfoByJoinIds(joinHazardId: String): Observable<List<CheckHazardInfoDto>> {
+        return apiService.getHazardInfoByJoinIds(joinHazardId).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response.data
+        }
+    }
+
+    override fun getCountHazardNum(subId: String,hazardCheckPro:String): Observable<String> {
+        return apiService.getCountHazardNum(subId,hazardCheckPro).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response.data
+        }
+    }
+
+    override fun getFindByCheckPlanId(id: String): Observable<List<MaterialFileBean>> {
+        return apiService.getFindByCheckPlanId(id).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response.data
+        }
+    }
+
+    override fun getHazardInfoBySubIds(map: Map<String, Any>): Observable<List<CheckHazardDto>> {
+        return apiService.getHazardInfoBySubIds(map).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response.data
+        }
+    }
+
+    override fun getCheckManageAppUpdate(bean: SpecialInspectionBean): Observable<CommonResponse> {
+        return apiService.getCheckManageAppUpdate(bean).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response
+        }
+    }
+
+    override fun getCheckManageApp(bean: SpecialInspectionBean): Observable<CommonResponse> {
+        return apiService.getCheckManageApp(bean).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response
+        }
+    }
+
+    override fun getBuildBySubList(searchValue: String): Observable<List<InventoryList>> {
+        return apiService.getBuildBySubList(searchValue).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response.data
+        }
+    }
+
+    override fun getCheckPlanBySubId(subId: String): Observable<List<Record>> {
+        return apiService.getCheckPlanBySubId(subId).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response.data
+        }
+    }
+
+    override fun getBuildingDate(): Observable<List<InventoryList>> {
+        return apiService.getBuildingDate(2).map { response ->
+            if (!response.isSuccess()) {
+                throw NetException(response.code, response.msg)
+            }
+            return@map response.rows
+        }
+    }
+
+    /**
+     * 退出登录
+     */
+    override fun loginOut(): Observable<Boolean> {
+        return apiService.loginOut()
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+
+                return@map true
+            }
+    }
+
+    /**
+     * 人脸比对
+     */
+    override fun faceCompare(file: File): Observable<LearnLoginVo> {
+        val fileBody = RequestBody.create(MediaType.parse("multipart/form-data"), file)
+        val filePart = MultipartBody.Part.createFormData("file", file.name, fileBody)
+        return apiService.faceNewCompare(filePart)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+                HttpClient.token = response.data?.access_token
+                return@map response.data
+            }
+    }
+
+    /**
+     * 查询实验室机柜列表
+     */
+    override fun queryCabinetList(): Observable<List<CabinetBean>> {
+        return apiService.queryCabinetList(CabinetBean())
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+
+                return@map response.data
+            }
+    }
+
+    /**
+     * 查询化学品
+     */
+    override fun queryChemicalList(param: ChemicalReq): Observable<CommonListResponse<ChemicalBean>> {
+        return apiService.queryChemicalList(param.pageNum, param.pageSize, param)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+
+                return@map response
+            }
+    }
+
+    /**
+     * 查询库存化学品
+     */
+    override fun queryChemicalByStock(param: ChemicalReq): Observable<CommonListResponse<ChemicalBean>> {
+        return apiService.queryChemicalByStock(param.pageNum, param.pageSize, param)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+
+                return@map response
+            }
+    }
+
+    /**
+     * 双人验证 刷卡识别身份权限
+     */
+    override fun userValidation(param: UserValidationVo): Observable<UserValidationVo> {
+        return apiService.userValidation(param)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+
+                return@map response.data
+            }
+    }
+
+    /**
+     *
+     */
+    override fun addStock(param: ChemicalBean): Observable<ChemicalBean> {
+        return apiService.addStock(param)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+
+                return@map response.data
+            }
+    }
+
+    /**
+     * 获取危化品安全技术说明书详细信息
+     */
+    override fun hazardBookDetail(id: String): Observable<HazardBook> {
+        return apiService.hazardBookDetail(id)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+
+                return@map response.data
+            }
+    }
+
+    /**
+     * 通过识别卡号或者二维码扫码查询已入库化学品
+     */
+    override fun queryByTagCode(param: TagCodeReq): Observable<Optional<ChemicalBean>> {
+        return apiService.queryByTagCode(param)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+
+                return@map Optional.ofNullable(response.data)
+            }
+    }
+
+    /**
+     * 领用化学品
+     */
+    override fun addUserecord(param: UseReq): Observable<Boolean> {
+        return apiService.addUserecord(param)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+
+                return@map true
+            }
+    }
+
+    /**
+     * 归还时查询已领用化学品
+     */
+    override fun queryByUserecord(param: TagCodeReq): Observable<ChemicalBean> {
+        return apiService.queryByUserecord(param)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+
+                return@map response.data
+            }
+    }
+
+    /**
+     * 归还化学品
+     */
+    override fun updateUserecord(param: RevertReq): Observable<Boolean> {
+        return apiService.updateUserecord(param)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+
+                return@map true
+            }
+    }
+
+    /**
+     * 化学品出库
+     */
+    override fun outStock(param: OutputStockReq): Observable<Boolean> {
+        return apiService.outStock(param)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+
+                return@map true
+            }
+    }
+
+    /**
+     * RFID 标签更换
+     */
+    override fun updateStock(param: UpdateRfidReq): Observable<Boolean> {
+        return apiService.updateStock(param)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+
+                return@map true
+            }
+    }
+
+    /**
+     * 查询使用记录
+     */
+    override fun queryRecordList(param: OperRecordReq): Observable<CommonListResponse<AioUserecordVo>> {
+        return apiService.queryRecordList(param.pageNum, param.pageSize, param)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+
+                return@map response
+            }
+    }
+
+    /**
+     * 查询报警记录列表
+     */
+    override fun queryAlarmRecordList(param: AlarmRecordReq): Observable<CommonListResponse<AioAlarmRecordVo>> {
+        return apiService.queryAlarmRecordList(param.pageNum, param.pageSize, param)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+
+                return@map response
+            }
+    }
+
+    /**
+     * 查询报警记录详情
+     */
+    override fun queryAlarmRecordDetail(id: String): Observable<AioAlarmRecordVo> {
+        return apiService.queryAlarmRecordDetail(id)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+
+                return@map response.data
+            }
+    }
+
+    /**
+     * 检测类型报警记录手动处理
+     */
+    override fun updateAlarmRecord(param: UpdateAlarmRecordReq): Observable<Boolean> {
+        return apiService.updateAlarmRecord(param)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+
+                return@map true
+            }
+    }
+
+    /**
+     * 判断当前登录人是否管理员
+     */
+    override fun authValidation(): Observable<Boolean> {
+        return apiService.authValidation()
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+
+                return@map response.data
+            }
+    }
+
+    /**
+     * 终端登录查询实验室信息
+     */
+    override fun querySubInfo(): Observable<SubInfoVo> {
+        return apiService.querySubInfo()
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+
+                return@map response.data
+            }
+    }
+
+    /**
+     * 人脸身份验证
+     */
+    override fun faceAuth(param: SubInfoVo): Observable<UserValidationVo> {
+        return apiService.faceAuth(param)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+
+                return@map response.data
+            }
+    }
+
+    /**
+     * 查询机柜柜锁列表
+     */
+    override fun queryCabinetLockList(param: CabinetLockVo): Observable<List<CabinetLockVo>> {
+        return apiService.queryCabinetLockList(param)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+
+                return@map response.data
+            }
+    }
+
+    /**
+     * 柜锁开锁
+     */
+    override fun openLock(param: CabinetLockVo): Observable<LockRespBean> {
+        return apiService.openLock(param)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+
+                return@map response.data
+            }
+    }
+
+    /**
+     * 柜锁关锁
+     */
+    override fun closeLock(param: CabinetLockVo): Observable<LockRespBean> {
+        return apiService.closeLock(param)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+
+                return@map response.data
+            }
+    }
+
+    /**
+     * 上传文件
+     */
+    override fun fileUpload(file: File): Observable<FileRespBean> {
+        val fileBody = RequestBody.create(MediaType.parse("application/octet-stream"), file)
+        val filePart = MultipartBody.Part.createFormData("file", file.name, fileBody)
+
+//        return apiService.fileUpload(HttpConfig.API_BASE_UP_FILE_, filePart)
+//        return apiService.fileUpload(HttpConfig.API_BASE_UP_FILE, filePart)
+        return apiService.fileUpload(HttpConfig.API_BASE_URL+"base/", filePart)
+            .map { response ->
+                if (!response.isSuccess()) {
+                    throw NetException(response.code, response.msg)
+                }
+
+                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.9/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)
+        }
+    }
+}

+ 13 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/dddd/Children.kt

@@ -0,0 +1,13 @@
+package com.rc.httpcore.dddd
+
+data class Children(
+    val children: List<ChildrenX>,
+    val code: String,
+    val hazardReid: Any,
+    val id: String,
+    val level: Int,
+    val mainPoint: String?,
+    val name: String,
+    val parentId: String,
+    val type: Int
+)

+ 13 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/dddd/ChildrenX.kt

@@ -0,0 +1,13 @@
+package com.rc.httpcore.dddd
+
+data class ChildrenX(
+    val children: List<ChildrenXX>,
+    val code: String,
+    val hazardReid: Any,
+    val id: String,
+    val level: Int,
+    val mainPoint: String?,
+    val name: String,
+    val parentId: String,
+    val type: Int
+)

+ 13 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/dddd/ChildrenXX.kt

@@ -0,0 +1,13 @@
+package com.rc.httpcore.dddd
+
+data class ChildrenXX(
+    val children: List<Any>,
+    val code: String,
+    val hazardReid: Any,
+    val id: String,
+    val level: Int,
+    val mainPoint: String?,
+    val name: String,
+    val parentId: String,
+    val type: Int
+)

+ 13 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/dddd/Data.kt

@@ -0,0 +1,13 @@
+package com.rc.httpcore.dddd
+
+data class Data(
+    val children: List<Children>,
+    val code: String,
+    val hazardReid: Any,
+    val id: String,
+    val level: Int,
+    val mainPoint: String?,
+    val name: String,
+    val parentId: String,
+    val type: Int
+)

+ 7 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/dddd/aaaaa.kt

@@ -0,0 +1,7 @@
+package com.rc.httpcore.dddd
+
+data class aaaaa(
+    val code: Int,
+    val `data`: List<Data>,
+    val msg: String
+)

+ 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})"
+    }
+}

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

@@ -0,0 +1,45 @@
+package com.rc.httpcore.interceptor
+
+
+
+import android.util.Log
+import okhttp3.FormBody
+import okhttp3.Interceptor
+import okhttp3.Response
+import okhttp3.ResponseBody
+
+class HttpLoggingInterceptorLog : Interceptor {
+    private val TAG="okhttps"
+    override fun intercept(chain: Interceptor.Chain): Response {
+        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()
+    }
+
+
+
+}

+ 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("TokenHeaderInterceptor",HttpClient.token)
+        }
+
+//        requestBuilder.addHeader("authorization", "2704c88c-dff0-41ac-939b-14e1f4f2d895")
+        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);
+        }
+    }
+
+}

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

@@ -0,0 +1,121 @@
+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.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
+    )
+
+}

+ 22 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/AppNoAuthList.kt

@@ -0,0 +1,22 @@
+package com.rc.httpcore.vo
+
+
+
+data class AppNoAuthList(
+    val cabinetName: String,
+    val cabinetNum: String,
+    val cabinetStatus: Int,
+    val createBy: String,
+    val createTime: String,
+    val deptName: String,
+    val buildName:String,
+    val subName:String,
+    val id: Int,
+    val safeUserName: String,
+    val smartLock: Int,
+    val buildId: Int,
+    val cabinetId: Int,
+    val deptId: Int,
+    val subId: Int,
+    val subNum: Int,
+)

+ 15 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/CabinetBeans.kt

@@ -0,0 +1,15 @@
+package com.rc.httpcore.vo
+
+data class CabinetBeans(
+    val adminName: String,
+    val adminSafeName: String,
+    val buildId: Int,
+    val buildName: String,
+    val cabinetName: String,
+    val chemicalCount: Int,
+    val deptId: Int,
+    val deptName: String,
+    val safeUserName: String,
+    val subId: Int,
+    val subName: String
+)

+ 10 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/CheckHazardBean.kt

@@ -0,0 +1,10 @@
+package com.rc.httpcore.vo
+
+
+data class CheckHazardBean(
+    val checkHazardId: String,
+    val rectifyMeasure: String,
+    val rectifyResult: Int,
+    val rectifyType: Int,
+    val uploadDtoList: List<UploadDto>?
+)

+ 80 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/CheckHazardDto.kt

@@ -0,0 +1,80 @@
+package com.rc.httpcore.vo
+
+import android.os.Parcelable
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+data class  CheckHazardDto(
+        var code: String?,
+        var titleNo: String?, //第一项隐患
+        var checkCategory: Int,
+        var checkFlag: Int,   //0  不符合                                1 合格      检查项是否符合,1是符合,0是不符合
+        var hazardCheckCount: Int?,  //隐患出现的次数
+        //更改后 需要上传的数据
+        var hazardDescribe: String?, //隐患描述
+        var hazardLevel: Int,//隐患等级
+        var hazardLevelName: String?,//隐患等级名称
+        var hazardCheckName: String?,
+        var hazardCheckCode: String?,
+        var hazardCheckPro: String?,
+        var hazardTypeMode: String?,
+        var hazardName: String?,
+        var hazardNameField: String?, //备用字段 用于提交 保存筛选
+        var hazardCheckPoint: String?,//检查要点
+        var hazardId: Int,
+        var hazardTypeModeName: String?,
+        var joinHazardId: String?,
+        var chName: String?,
+        var voiceRemarkList: List<VoiceRemarkBean>?,  //语音只用于展示 提交时进行判断 传字符串给后端
+        var voiceRemark: String?,  //语音数组
+        var uploadDtoList: List<UploadDto>?, //照片上传
+        var title: String?,// 综合检查不符合默认值
+        var checkOptionList: List<CheckOptionBean>?,//检查项目 树节点
+        var isChecked: Boolean = false,//是否选中
+        var isHideType: Boolean = true,//是否隐藏   false 没有隐藏
+        var ceshi: Int,
+        var addTag:String?,//专项检查新增添加项 用于保存已存在的数据 进行二次编辑
+        var indexTypes:Int,
+        var id:String?,
+        var hazardCheckPro1:String?,
+        var hazardCheckPro2:String?,
+        var rectifyStatus:String?,//
+        var hazardCheckProStr:String?,//
+) : Parcelable {
+    constructor(title: String) : this(
+            code = "",
+            titleNo = "",
+            checkCategory = 0,
+            checkFlag = 0,
+            hazardCheckCount = 0,
+            hazardDescribe = null,
+            hazardLevel = 0,
+            hazardCheckName = null,
+            hazardCheckCode = "",
+            hazardCheckPro = "",
+            hazardTypeMode = "",
+            hazardName = "",
+            hazardId = 0,
+            hazardTypeModeName = null,
+            joinHazardId = "",
+            voiceRemark = null,
+            hazardCheckPoint = null,
+            uploadDtoList = null,
+            hazardLevelName = null,
+            title = title,
+            checkOptionList = null,
+            chName = null,
+            ceshi = 0,
+            addTag = null,
+            id = null,
+            hazardCheckPro1 = null,
+            hazardCheckPro2 = null,
+            voiceRemarkList = null,
+            rectifyStatus = null,
+            hazardCheckProStr = null,
+            hazardNameField=null,
+            indexTypes=0,
+    )
+}
+
+

+ 45 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/CheckHazardInfoDto.kt

@@ -0,0 +1,45 @@
+package com.rc.httpcore.vo
+
+import android.os.Parcelable
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+data class CheckHazardInfoDto(
+    val checkCategory: Int?,
+    val checkFlag: Int?,
+    val code: String?,
+    val hazardCheckCode: String?,
+    val hazardCheckCode1: String?,
+    val hazardCheckCode2: String?,
+    val hazardCheckCode3: String?,
+    val hazardCheckCount: Int?,
+    val hazardCheckName: String?,
+    val hazardCheckName1: String?,
+    val hazardCheckName2: String?,
+    val hazardCheckName3: String?,
+    val hazardCheckPoint: String?,
+    val hazardCheckPro: String?,
+    val hazardCheckPro1: String?,
+    val hazardCheckPro2: String?,
+    val hazardCheckPro3: String?,
+    val hazardCheckProStr: String?,
+    val hazardDescribe: String?,
+    val hazardId: Int?,
+    val hazardLevel: Int?, //隐患级别,1重大隐患,2是一般隐患,3管理问题
+    val hazardName: String?,
+    val hazardNameField: String?, //备用字段 用于提交 保存筛选
+    val hazardNum: String?,
+    val hazardTypeMode: Int?,
+    val hazardTypeModeName: String?,
+    val id: String?,
+    val joinHazardId: String?,
+    val rectifyStatus: Int?,
+    var checkHazardDtoList: List<CheckHazardDto>?, //上传数据
+//    var voiceRemark: List<VoiceRemarkBean>?,  //语音数组
+    var voiceRemark: String?,  //语音数组
+    val uploadDtoList: List<UploadDto>?, //照片上传
+    var isHideType:Boolean=true,//是否隐藏   false 没有隐藏
+    val titleNo: String?, //第一项隐患
+    var checkOptionList: List<CheckOptionBean>? = null,//选择信息
+
+): Parcelable

+ 19 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/CheckOptionBean.kt

@@ -0,0 +1,19 @@
+package com.rc.httpcore.vo
+
+import android.os.Parcelable
+import com.rc.httpcore.ChildrenX
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+data class CheckOptionBean(
+    val children: List<ChildrenX>,
+    val code: String,
+    val hazardReid: Int,
+    val id: String,
+    val level: Int,
+    val mainPoint: String?,
+    val name: String,
+    val parentId: String,
+    val type: Int
+): Parcelable
+

+ 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 data : List<T>? = null
+    var records : List<T>? = null
+    var total: Int = 0
+}

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

@@ -0,0 +1,17 @@
+package com.rc.httpcore.vo
+
+open class CommonResponse {
+
+    var code: String = ""
+    var msg: 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
+
+}

+ 9 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/CountAppBean.kt

@@ -0,0 +1,9 @@
+package com.rc.httpcore.vo
+
+data class CountAppBean( val checkTotal: Int,
+                         val hazardTotal: Int,
+                         val passRate: String,
+                         val qualifyRate: String,
+                         val rectificationRate: String,
+                         val rectifyTotal: Int,
+                         val userType: Int)

+ 10 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/CourseListBean.kt

@@ -0,0 +1,10 @@
+package com.rc.httpcore.vo
+
+/**
+ * 开课列表
+ */
+data class CourseListBean(
+    var coStartDate: String,
+    var week: String,
+    var courseVoList: List<CourseVoListBean>,
+)

+ 3 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/CourseVoListBean.kt

@@ -0,0 +1,3 @@
+package com.rc.httpcore.vo
+
+data class CourseVoListBean(var courseName:String,var lecturerName:String,var coStartTime:String,var id:Int)

+ 30 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/ExaminerInformationBean.kt

@@ -0,0 +1,30 @@
+package com.rc.httpcore.vo
+
+import com.rc.httpcore.bean.Classify
+
+/**
+ * 检查者信息列表
+ */
+data class ExaminerInformationBean(
+    val countId: Any,
+    val current: Int,
+    val maxLimit: Any,
+    val optimizeCountSql: Boolean,
+    val orders: List<Any>,
+    val pages: Int,
+    var records: List<Record>,
+    val searchCount: Boolean,
+    val classifyList: List<Classify>?, //隐患科目
+    val levelName: String,
+    val typeName: String,
+    val fiedColor: String,
+    val deptName: String,
+    val room: String,  //deptName-room
+    val adminName: String,  //管理员  实验室负责人-adminPhone
+    val adminPhone: String,  //管理员  实验室负责人-adminPhone
+    val safeUserNameAdminPhone: String,  //熊苗苗@15202992393,韩智伟@15618564039" 安全责任人
+    val size: Int,
+    val id:Int,
+    val userId:Int,
+    val total: Int
+)

+ 62 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/HandManBean.kt

@@ -0,0 +1,62 @@
+package com.rc.httpcore.vo
+
+//随手拍管理信息
+data class HandManBean(
+    val createBy: Int?,
+    val createName: String?,
+    val createTime: String?,
+    val deptId: Int?,
+    val deptName: String?,
+    val hazardDescribe: String?,
+    val id: String?,
+    val rectifyDescribe: String?,
+    val rectifyGentle: Boolean,
+    val rectifyId: String?,
+    val rectifyPeople: String?,
+    val rectifyStatus: Int?,
+    val rectifyTime: String?,
+    val roomNum: String?,
+    val safetyPeople: String?,
+    val subId: Int?,
+    val subName: String?,
+    val timeFlag: String?,
+    val yhDtoList: List<UploadDto>?,
+    val imgDtoList: List<UploadDto>?,
+    val zgDtoList: List<UploadDto>?,
+
+    ) {
+    constructor(
+        id: String,
+        rectifyStatus: Int,
+        rectifyDescribe: String,
+        imgDtoList: List<UploadDto>,
+    ) : this(
+        createBy = null,
+        createName = null,
+        createTime = null,
+        deptId = null,
+        deptName = null,
+        hazardDescribe = null,
+        id = id,
+        rectifyDescribe = rectifyDescribe,
+        rectifyGentle = false,
+        rectifyId = null,
+        rectifyPeople = null,
+        rectifyStatus = rectifyStatus,
+        rectifyTime = null,
+        roomNum = null,
+        safetyPeople = null,
+        subId = null,
+        subName = null,
+        timeFlag = null,
+        yhDtoList = null,
+        imgDtoList = imgDtoList,
+        zgDtoList = null)
+}
+//
+//{
+//    id:'',
+//    rectifyStatus:1,//0待整改 1已整改 2暂无法整改
+//    rectifyDescribe:'',
+//    imgDtoList:[],
+//}

+ 3 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/HandManVo.kt

@@ -0,0 +1,3 @@
+package com.rc.httpcore.vo
+
+data class HandManVo(var records: List<HandManBean>)

+ 33 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/HxpTakeStockDetail.kt

@@ -0,0 +1,33 @@
+package com.rc.httpcore.vo
+
+import androidx.room.Entity
+import androidx.room.ForeignKey
+import androidx.room.PrimaryKey
+
+/**
+ * 盘点内容
+ * 多条信息
+ */
+data class HxpTakeStockDetail(
+        var buildFlag: Int,
+        var cabinetFlag: Int,
+        var chemicalBuildId: Int,
+        var chemicalBuildName: String,
+        var chemicalCabinetId: Int?, //按机柜盘点
+        var chemicalCabinetName: String,
+        var chemicalDpetId: Int,
+        var chemicalDpetName: String,
+        var chemicalId: Int,
+        var chemicalNum: String,
+        var chemicalSubId: Int?, // 按实验室盘点
+        var chemicalSubName: String,
+        var chemicalType: Int,
+        var deptFlag: Int,
+        var remark: String,
+        var stockId: String,
+        var stockNum: Int,
+        var subFlag: Int,
+        var takeResult: String,
+) {
+
+}

+ 60 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/InventoryList.kt

@@ -0,0 +1,60 @@
+package com.rc.httpcore.vo
+
+
+import android.os.Parcelable
+import kotlinx.android.parcel.Parcelize
+
+
+@Parcelize
+class InventoryList(
+    val createBy: String?, //盘点人
+    val createTimeStr: String?,  //盘点时间
+    val errorNum: Int?,   //异常数量
+    val id: String?,   //查询标识
+    val takeTitle: String?, //盘点标题
+    val chemicalName: String?, //化学品名
+    val casNum: String?, //CAS号
+    val tagCode: String?,
+    val rfidCode: String?,
+    val classifyAttribute: String?, //属性
+    val stockNum: Double?, //存量
+    val chemicalType: Int?, //化学品状态,1是正常,0是异常
+    val takeType: Int?,   //1实验室,2化学品机柜
+    val realNum: Int?,   //实际数量
+    val takeNum: Int?,    //盘点数
+    val takeDpetName: String?,    //学院
+    val takeBuildName: String?,  //实验楼or 楼栋
+    val buildId: Int?,
+    val buildName: String?,
+    val cabinetId: Int?,
+    val cabinetName: String?,
+    val chemicalAmount: Double?,
+    val chemicalAmountUnit: String?,
+    val chemicalId: Int?,  //化学品 id
+    val chemicalNum: String?,  //化学品编号
+    val chemicalShape: Int?, //1是固体,2是体液,3是气体,4是其他
+    val deptId: Int?,
+    val deptName: String?,
+    val expirationTime: String?,
+    val outUsages: Double?, //存量
+    val subId: Int?,
+    val subName: String?,
+    val subRoom: String?,
+    val objectName: String?,  //设备名称
+    val specifi: String?, //设备编号
+    val typeNum: Int?, //-1 化学品柜
+    val typeName: String?,
+    val content: String?,
+    val anotherName: String?,
+    val classifyName: String?,  //化学品属性  普通 危险
+    val dictLabel: String?,
+    val dictValue: String?,
+    val hazardLevel: Int?, //1 危险 2普通
+    val name: String?,//实验室名称
+    val subNum: Int?,//实验室名称
+    val chemicalUnit: String?, //单位
+    val qrCodeUrl: String?, //二维码
+    val remark: String?,//备注
+    var collegeName:String?
+) : Parcelable
+

+ 31 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/InventorySubmissionVo.kt

@@ -0,0 +1,31 @@
+package com.rc.httpcore.vo
+
+
+import androidx.room.Entity
+import androidx.room.PrimaryKey
+import androidx.room.TypeConverters
+
+/**
+ * 盘点提交参数
+ * 头部
+ */
+
+
+data class InventorySubmissionVo(
+    var cabinetId: String,
+    var cabinetName: String,
+    var errorNum: Int,
+//    var hxpTakeStockDetailList: List<HxpTakeStockDetail>,
+    var hxpTakeStockDetailList: List<HxpTakeStockDetail>,
+    var subId: Int,
+    var subName: String,
+    var subRoom: String,
+    var takeBuildId: Int,
+    var takeBuildName: String,
+    var takeDpetId: Int,
+    var takeDpetName: String,
+    var takeTitle: String,
+    var takeType: String,
+){
+
+}

+ 20 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/ItemList.kt

@@ -0,0 +1,20 @@
+package com.rc.httpcore.vo
+
+import java.math.BigDecimal
+
+
+data class ItemList(
+    val casNum: String,
+    val chemicalName: String,
+    val createTimeStr: String,
+    val lossAmount: Int,   //损耗量
+    val nickName: String,
+    val returnStockNum: Int, //余量
+    val usageAmount: Int,    //使用量
+    val useStatus: Int, //(1是使用中,0是已归还,2是超时未归还)
+    val applyNum: Int?,
+    val chemicalAmountUnit: String?,
+    val userId: Int?,
+    val chemicalUnit: String?, //单位
+    var outUsages: BigDecimal?,//剩余库存净重
+)

+ 9 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/MaterialFileBean.kt

@@ -0,0 +1,9 @@
+package com.rc.httpcore.vo
+
+data class MaterialFileBean(
+    val fileName: String,
+    val fileType: Int,
+    val fileUrl: String,
+    val id: String,
+    val keyId: Long,
+)

+ 3 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/NumberOfCheckListBean.kt

@@ -0,0 +1,3 @@
+package com.rc.httpcore.vo
+
+data class NumberOfCheckListBean(val userImg:String,val nickName:String,val accountNumber:String,val singTime:String)

+ 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;
+    }
+
+}

+ 3 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/Params.kt

@@ -0,0 +1,3 @@
+package com.rc.httpcore.vo
+
+class Params

+ 10 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/RandomClapBean.kt

@@ -0,0 +1,10 @@
+package com.rc.httpcore.vo
+
+data class RandomClapBean(
+    var deptId: Int,//学院id
+    var deptName: String,//学院名称
+    var subId: Int,  //实验室id
+    var subName: String,  //实验室名称
+    var hazardDescribe: String, //隐患描述
+    var imgDtoList: List<UploadDto>?, //照片上传
+)

+ 54 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/Record.kt

@@ -0,0 +1,54 @@
+package com.rc.httpcore.vo
+
+import android.os.Parcelable
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+data class Record(
+        val buildId: Int,
+        val buildName: String,
+        val checkDemand: String,
+        val checkPlanId: String,
+        val checkRange: Int, //1全校 2学院 3实验室
+        val checkResult: Int,//0不符合    1符合
+        val checkTime: String,
+        var checkType: Int, //1校院巡查 2实验室自查
+        var rectifySchedule:String,
+//    val checkUser: Any,
+//    val checkUserId: Any,
+        val collegeName: String, //学院名称
+        val createBy: Int,
+//    val createName: Any,
+        val createTime: String,
+        val cycleEndTime: String,
+        val cycleStartTime: String, //开始时间
+        val dangerNum: Int,
+        val deptId: Int,
+        val id: String,
+        val isAttachment: Int,
+        val isCheck: Int,
+        val isEndProcess: Int,
+        val isOverdue: Int,// 是否逾期 0否     1是
+        val isSelfData: Int,  //自查权限  1 当前数据的操作权限   0 无法操作
+        val level: Int,
+        val levelName: String,
+        var rectifyId:String,
+        val manageStatus: Int, //管理状态(0待检查,1检查中,2已检查)
+        val rectifyDeadline: String?,
+//    val rectifyNotice: Any,
+//    val rectifySchedule: Any,
+        val roomNumber: String, //subjectName-roomNumber 实验室名称-房间号
+        val subId: Int,
+        val subjectName: String, //subjectName-roomNumber 实验室名称-房间号
+        val title: String, //标题
+        val typeId: Int,
+        val typeName: String,
+//    val updateBy: Any,
+//    val updateName: Any,
+        val updateTime: String,
+        val subRoom: String?,
+        val rectifyStatus:Int,
+        var checkCategory:Int //检查类别(1综合检查 2专项检查)
+): Parcelable{
+
+}

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

@@ -0,0 +1,50 @@
+package com.rc.httpcore.vo
+
+/**
+ * 开课详情
+ */
+data class SchoolBeginsBean(
+    var listImg: Array<String>,
+    val actualCount: Int,
+    val coEndTime: String,
+    val coStartDate: String,
+    val coStartTime: String,
+    val content: String,
+    val courseDate: Any,
+    val courseImg: String,
+//    var courseImg: Array<String>,
+    val courseName: String,
+    val courseSm: String,
+    val courseVoList: Any,
+    val createBy: String,
+    val createTime: String,
+    val deptId: Int,
+    val deptName: Any,
+    val id: Int,
+    val ids: Any,
+    val isDeleted: Int,
+    val isStart: Int,
+    val lecturerId: Int,
+    val lecturerName: String,
+    val notHaveCount: Int,
+    val outPlanCount: Int,
+    val params: Params,
+    val peopleCount: Int,
+    val place: String,
+    val placeId: String,
+    val position: String,
+    val remark: Any,
+    val searchValue: Any,
+    val subId: String,
+    val subName: String,
+    val subRoom: String,
+    val tutorId: String,
+    val tutorName: String,
+    val updateBy: Any,
+    val updateById: Any,
+    val updateTime: Any,
+    val userId: Int,
+    val userIds: Any,
+    val week: String,
+    var code: String,
+)

+ 164 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/SpecialInspectionBean.kt

@@ -0,0 +1,164 @@
+package com.rc.httpcore.vo
+
+import android.os.Parcelable
+import kotlinx.android.parcel.Parcelize
+import java.util.*
+
+
+/**
+ * 专项检查
+ */
+@Parcelize
+data class SpecialInspectionBean(
+    var buildId: String?=null,       //楼栋id
+    var buildName: String?=null, //楼栋名称
+    var checkCategory: Int?=null,  //检查类型(1综合检查 2专项检查)
+    var checkDemand: String?=null,
+//        var checkHazardDtoList: List<CheckHazardDto>? = ArrayList(),// 提交综合--专项检查的数据
+    var checkHazardDtoList: List<CheckHazardDto>?=null,// 提交综合--专项检查的数据
+//    var checkHazardDtoList=mutableListOf<CheckHazardDto>(), // 提交综合--专项检查的数据
+    var checkHazardInfo: String?=null,
+    var checkHazardInfoVoList: List<CheckHazardInfoDto>?=null, //专项检查 查询返回的数据  综合检查不返回
+//    val checkIsStatus: Any?,
+    var checkPlanId: String?=null, //检查计划id
+    var checkRange: Int?=null,
+    var checkResult: String?=null, //检查结果  0不符合    1符合
+    var checkTime: String?=null,
+    var checkType: Int?=null,
+    var collegeName: String?=null,  //学院名称
+    var cycleEndTime: String?=null,     //计划结束时间
+    var cycleStartTime: String?=null,  //计划开始时间
+    var dangerNum: Int?=null,
+    var deptId: Int?=null, //学院id
+    var hazardId: String?=null,
+    var hazardIds: String?=null,
+    var hazardName: String?=null,
+    var id: String?=null,
+    var isAttachment: Int?=null,
+    var isDeleted: Boolean?=null,
+    var isOverdue: Int?=null,
+    var level: Int?=null,
+    var levelName: String?=null,
+//    val loginUserName: Any?,
+    var manageStatus: Int?=null, //保存1  提交2
+//    val pageNum: Int?,
+//    val pageSize: Int?,
+//    val percent: Any?,
+//    val percent2: Any?,
+    var rectifyDeadline: String?=null, //整改期限
+    var rectifyNotice: Int? = 1, //(1整改告知书 2整改通知书)
+//    val rectifySchedule: Any?,
+    var roomNumber: String?=null,
+//    val safeUserNameAdminPhone: Any?,
+//    val searchValue: Any?,
+    var subId: String?=null,
+    var subIds: String?=null,
+    var subjectName: String?=null,
+    var title: String?=null,
+    var typeId: Int?=null,
+    var typeName: String?=null,
+    var checkUser: String?=null,
+    var yearMonth: String?=null,
+    var yyyyMm: String?=null,
+    var joinHazardIds: String?=null,
+) : Parcelable {
+//    constructor() : this(
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null,
+//        null
+//    )
+
+
+//    constructor(
+//            subIds: String?,
+//            subjectName: String?,
+//            deptId: Int,
+//            collegeName: String?,
+//            buildId: String?,
+//            buildName: String?,
+//            manageStatus: Int,
+//            title: String?,
+//            cycleStartTime: String?,
+//            cycleEndTime: String?,
+//    ) : this(
+//            buildId = buildId,
+//            buildName = buildName,
+//            checkCategory = 1,  //检查类型
+//            checkDemand = null,
+//            checkHazardDtoList = ArrayList(),
+//            checkHazardInfo = null,
+//            checkHazardInfoVoList = ArrayList(),
+//            checkPlanId = null,
+//            checkRange = null,
+//            checkResult = "1",
+//            checkTime = null,
+//            checkType = 2, //检查组织
+//            collegeName = collegeName,
+//            cycleEndTime = cycleEndTime,
+//            cycleStartTime = cycleStartTime,
+//            dangerNum = null,
+//            deptId = deptId,
+//            hazardId = null,
+//            hazardIds = null,
+//            hazardName = null,
+//            id = null,
+//            isAttachment = null,
+//            isDeleted = null,
+//            isOverdue = null,
+//            level = null,
+//            levelName = null,
+//            manageStatus = manageStatus,
+//            roomNumber = null,
+//            subId = subIds,
+//            subjectName = subjectName,
+//            title = title,
+//            typeId = null,
+//            typeName = null,
+//            checkUser = null,
+//            rectifyDeadline = null,
+//            yearMonth = null,
+//            yyyyMm = null,
+//            subIds = subIds
+//    )
+
+}
+
+
+

+ 35 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/UploadDto.kt

@@ -0,0 +1,35 @@
+package com.rc.httpcore.vo
+
+import android.os.Parcelable
+import kotlinx.android.parcel.Parcelize
+
+@Parcelize
+data class UploadDto(
+        var fileName: String?,  //name
+        val fileType: Int?,     //  1 文件  2 图片
+        var fileUrl: String?,  //地址
+        val id: String?,
+        val isDeleted: Boolean?,
+        val keyId: String?,
+        val pageNum: Int?,
+        val pageSize: Int?,
+        val searchValue: String?,//暂时用于拍照占位图“#” 特殊字符
+        val source: Int?,
+        val viewFileUrl: String?,
+
+        ): Parcelable {
+    constructor(fileName: String, fileUrl: String) : this(
+        fileName = fileName,
+        fileType = 2,
+        fileUrl = fileUrl,
+        id = null,
+        isDeleted = null,
+        keyId = null,
+        pageNum = null,
+        pageSize = null,
+        searchValue = null,
+        source = null,
+        viewFileUrl = null,)
+
+
+}

+ 9 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/UsageRecordBean.kt

@@ -0,0 +1,9 @@
+package com.rc.httpcore.vo
+
+
+
+data class UsageRecordBean(
+    val `data`: List<ItemList>,
+    val timeStr: String,
+    var userStr: String?,
+)

+ 7 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/UserIdentityBean.kt

@@ -0,0 +1,7 @@
+package com.rc.httpcore.vo
+
+//用户当前身份 adminGentle:false      //管理员身份
+//applyGentle:false       //检查者身份
+//myApplyGentle:false      //自查身份检查者
+//rectifyGentle:false      //整改身份
+data class UserIdentityBean(val adminGentle:Boolean,val applyGentle:Boolean,val myApplyGentle:Boolean,val rectifyGentle:Boolean)

+ 10 - 0
HttpCoreLibrary/src/main/java/com/rc/httpcore/vo/VoiceRemarkBean.kt

@@ -0,0 +1,10 @@
+package com.rc.httpcore.vo
+
+import android.os.Parcelable
+import kotlinx.android.parcel.Parcelize
+
+/**
+ * 语音上传数组类型
+ */
+@Parcelize
+data class VoiceRemarkBean(var times:Int?,var url:String?): Parcelable

+ 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


Деякі файли не було показано, через те що забагато файлів було змінено