企业端初始化
15
.gitignore
vendored
Normal file
@ -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
.idea/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
6
.idea/compiler.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="11" />
|
||||
</component>
|
||||
</project>
|
21
.idea/gradle.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="PLATFORM" />
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
<option value="$PROJECT_DIR$/mylibrary" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveModulePerSourceSet" value="false" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
60
.idea/jarRepositories.xml
Normal file
@ -0,0 +1,60 @@
|
||||
<?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="BintrayJCenter" />
|
||||
<option name="name" value="BintrayJCenter" />
|
||||
<option name="url" value="https://jcenter.bintray.com/" />
|
||||
</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="maven5" />
|
||||
<option name="name" value="maven5" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="maven3" />
|
||||
<option name="name" value="maven3" />
|
||||
<option name="url" value="http://maven.aliyun.com/nexus/content/repositories/releases/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="maven4" />
|
||||
<option name="name" value="maven4" />
|
||||
<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://developer.huawei.com/repo/" />
|
||||
</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="http://maven.aliyun.com/nexus/content/repositories/jcenter" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
9
.idea/misc.xml
Normal file
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
</project>
|
10
.idea/runConfigurations.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RunConfigurationProducerService">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
6
.idea/vcs.xml
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
15
app/.gitignore
vendored
Normal file
@ -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
|
119
app/build.gradle
Normal file
@ -0,0 +1,119 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'kotlin-android'
|
||||
id 'kotlin-kapt'
|
||||
id 'kotlin-android-extensions'
|
||||
}
|
||||
|
||||
def releaseTime() {
|
||||
return new Date().format("yyyyMMddHHmm", TimeZone.getTimeZone("GMT+08:00"))
|
||||
}
|
||||
|
||||
android {
|
||||
|
||||
signingConfigs {
|
||||
config {
|
||||
keyAlias 'examine'
|
||||
keyPassword '210419'
|
||||
storeFile file('examine.jks')
|
||||
storePassword '210419'
|
||||
v1SigningEnabled true
|
||||
v2SigningEnabled true
|
||||
}
|
||||
}
|
||||
|
||||
compileSdkVersion 30
|
||||
buildToolsVersion "30.0.3"
|
||||
|
||||
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
|
||||
|
||||
defaultConfig {
|
||||
applicationId rootProject.ext.android["applicationId"]
|
||||
minSdkVersion rootProject.ext.android["minSdkVersion"]
|
||||
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
|
||||
versionCode rootProject.ext.android["versionCode"]
|
||||
versionName rootProject.ext.android["versionName"]
|
||||
multiDexEnabled true
|
||||
flavorDimensions "CHANNEL_VALUE"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
signingConfig signingConfigs.config
|
||||
}
|
||||
debug {
|
||||
signingConfig signingConfigs.config
|
||||
}
|
||||
}
|
||||
|
||||
productFlavors {
|
||||
|
||||
text_product {
|
||||
applicationId rootProject.ext.android.applicationId
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "管理端(测试)"]
|
||||
|
||||
// buildConfigField "String", "BASE_URL", "\"http://192.168.2.197:8090/\""
|
||||
buildConfigField "String", "BASE_URL", "\"http://pass.dahehuoyun.com:8090/\""
|
||||
buildConfigField "String", "BASE_HEAD_URL", "\"http://47.104.167.116:8080/guns/gunsApi/kaptcha/\""
|
||||
buildConfigField "boolean", "isTest", "true"
|
||||
//APP名称,可以在androidMainfest中引用
|
||||
// resValue "string", "appName", "审核测试"
|
||||
}
|
||||
sign_product {
|
||||
applicationId rootProject.ext.android.applicationId
|
||||
manifestPlaceholders = [CHANNEL_VALUE: "管理端"]
|
||||
buildConfigField "String", "BASE_URL", "\"http://pass.dahehuoyun.com:8090/\""
|
||||
buildConfigField "String", "BASE_HEAD_URL", "\"http://47.104.167.116:8080/guns/gunsApi/kaptcha/\""
|
||||
buildConfigField "boolean", "isTest", "false"
|
||||
// resValue "string", "appName", "审核"
|
||||
}
|
||||
}
|
||||
productFlavors.all { flavor ->
|
||||
flavor.manifestPlaceholders = [CHANNEL_VALUE: name]
|
||||
}
|
||||
|
||||
android.applicationVariants.all { variant ->
|
||||
variant.outputs.all {
|
||||
// println("======="+variant.productFlavors[0].properties.get("resValues").getAt("appName").properties.get("value"))
|
||||
// println("======="+variant.productFlavors[0].properties.get("buildConfigFields").getAt("isTest").properties.get("value"))
|
||||
// println("+++++"+variant.productFlavors[0].name)
|
||||
//获取渠道名称
|
||||
def isText = variant.productFlavors[0].properties.get("buildConfigFields").getAt("isTest").properties.get("value")
|
||||
def appName = null
|
||||
if (isText=="true") {
|
||||
appName = '管理端测试_'
|
||||
}else{
|
||||
appName = '管理端正式_'
|
||||
}
|
||||
outputFileName =appName+"${variant.buildType.name}_${defaultConfig.versionName}_${releaseTime()}.apk"
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_8
|
||||
targetCompatibility JavaVersion.VERSION_1_8
|
||||
}
|
||||
kotlinOptions {
|
||||
jvmTarget = '1.8'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
implementation 'androidx.core:core-ktx:1.3.1'
|
||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||
implementation 'com.google.android.material:material:1.2.1'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
|
||||
testImplementation 'junit:junit:4.+'
|
||||
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
|
||||
|
||||
|
||||
implementation project(path: ':mylibrary')
|
||||
}
|
BIN
app/examine.jks
Normal file
21
app/proguard-rules.pro
vendored
Normal file
@ -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
|
18
app/sign_product/release/output-metadata.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"version": 2,
|
||||
"artifactType": {
|
||||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.dahe.examine",
|
||||
"variantName": "sign_productRelease",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"versionCode": 4,
|
||||
"versionName": "1.0.4",
|
||||
"outputFile": "管理端正式_release_1.0.4_202201240931.apk"
|
||||
}
|
||||
]
|
||||
}
|
BIN
app/sign_product/release/管理端正式_release_1.0.4_202201240931.apk
Normal file
@ -0,0 +1,24 @@
|
||||
package com.dahe.examine
|
||||
|
||||
import androidx.test.platform.app.InstrumentationRegistry
|
||||
import androidx.test.ext.junit.runners.AndroidJUnit4
|
||||
|
||||
import org.junit.Test
|
||||
import org.junit.runner.RunWith
|
||||
|
||||
import org.junit.Assert.*
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* See [testing documentation](http://d.android.com/tools/testing).
|
||||
*/
|
||||
@RunWith(AndroidJUnit4::class)
|
||||
class ExampleInstrumentedTest {
|
||||
@Test
|
||||
fun useAppContext() {
|
||||
// Context of the app under test.
|
||||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
|
||||
assertEquals("com.dahe.pass", appContext.packageName)
|
||||
}
|
||||
}
|
186
app/src/main/AndroidManifest.xml
Normal file
@ -0,0 +1,186 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.dahe.examine">
|
||||
|
||||
<uses-permission android:name="android.permission.CAMERA" /> <!-- //地图包、搜索包需要的基础权限 -->
|
||||
<!-- 允许程序打开网络套接字 -->
|
||||
<uses-permission android:name="android.permission.INTERNET" /> <!-- 允许程序设置内置sd卡的写权限 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <!-- 允许程序获取网络状态 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <!-- 允许程序访问WiFi网络信息 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <!-- 允许程序读写手机状态和身份 -->
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> <!-- 允许程序访问CellID或WiFi热点来获取粗略的位置 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.CALL_PHONE" />
|
||||
<uses-permission android:name="android.permission.READ_CALL_LOG" />
|
||||
<uses-permission android:name="android.permission.WRITE_CALL_LOG" />
|
||||
<uses-permission android:name="android.permission.ADD_VOICEMAIL" />
|
||||
<uses-permission android:name="com.android.voicemail.permission.ADD_VOICEMAIL" />
|
||||
<uses-permission android:name="android.permission.USE_SIP" />
|
||||
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" /> <!-- 用于访问GPS定位 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <!-- 用于获取运营商信息,用于支持提供运营商信息相关的接口 -->
|
||||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /> <!-- 用于读取手机当前的状态 -->
|
||||
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> <!-- 用于写入缓存数据到扩展存储卡 -->
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <!-- 用于申请调用A-GPS模块 -->
|
||||
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> <!-- 用于申请获取蓝牙信息进行室内定位 -->
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <!-- 这个权限用于允许程序在手机屏幕关闭后后台进程仍然运行 -->
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<!-- 用于ugc事件上报录音 -->
|
||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
|
||||
<!-- 以下为需要的基本权限,需要自行添加至您的AndroidManifest文件中 start-->
|
||||
<uses-permission android:name="android.permission.BROADCAST_PACKAGE_ADDED" />
|
||||
<uses-permission android:name="android.permission.BROADCAST_PACKAGE_CHANGED" />
|
||||
<uses-permission android:name="android.permission.BROADCAST_PACKAGE_INSTALL" />
|
||||
<uses-permission android:name="android.permission.BROADCAST_PACKAGE_REPLACED" />
|
||||
<uses-permission android:name="android.permission.GET_TASKS" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
|
||||
<!-- 以下为需要的基本权限,需要自行添加至您的AndroidManifest文件中 end-->
|
||||
|
||||
<application
|
||||
android:name="com.dahe.examine.base.App"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.Pass"
|
||||
tools:replace="android:label,android:allowBackup">
|
||||
|
||||
<meta-data
|
||||
android:name="CHANNEL"
|
||||
android:value="${CHANNEL_VALUE}" />
|
||||
<!-- 适配全面屏 Android O vivo&oppo -->
|
||||
<meta-data
|
||||
android:name="android.max_aspect"
|
||||
android:value="2.2" /> <!-- 适配刘海屏、水滴屏 Android O 小米 -->
|
||||
<meta-data
|
||||
android:name="notch.config"
|
||||
android:value="portrait|landscape" /> <!-- 适配刘海屏、水滴屏 Android O 华为 -->
|
||||
<meta-data
|
||||
android:name="android.notch_support"
|
||||
android:value="true" />
|
||||
|
||||
<activity android:name="com.dahe.examine.MainActivity">
|
||||
<!-- <intent-filter>-->
|
||||
<!-- <action android:name="android.intent.action.MAIN" />-->
|
||||
|
||||
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
|
||||
<!-- </intent-filter>-->
|
||||
</activity>
|
||||
|
||||
|
||||
<activity
|
||||
android:name="com.dahe.examine.ui.account.LoginActivity"
|
||||
android:configChanges="keyboardHidden|orientation|locale"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden">
|
||||
<!-- <intent-filter>-->
|
||||
<!-- <action android:name="android.intent.action.MAIN" />-->
|
||||
|
||||
<!-- <category android:name="android.intent.category.LAUNCHER" />-->
|
||||
<!-- </intent-filter>-->
|
||||
</activity>
|
||||
<activity
|
||||
android:name="com.dahe.examine.ui.HomeActivity"
|
||||
android:configChanges="keyboardHidden|orientation|locale"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden"></activity>
|
||||
|
||||
<activity
|
||||
android:name="com.dahe.examine.ui.home.activity.ApplyActivity"
|
||||
android:configChanges="keyboardHidden|orientation|locale"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden"></activity>
|
||||
|
||||
<activity
|
||||
android:name="com.dahe.examine.ui.mine.activity.ChangePwdActivity"
|
||||
android:configChanges="keyboardHidden|orientation|locale"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden"></activity>
|
||||
<activity
|
||||
android:name="com.dahe.examine.ui.mine.activity.ChangePhoneActivity"
|
||||
android:configChanges="keyboardHidden|orientation|locale"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden"></activity>
|
||||
|
||||
<activity
|
||||
android:name="com.dahe.examine.ui.account.activity.RegisterActivity"
|
||||
android:configChanges="keyboardHidden|orientation|locale"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden"></activity>
|
||||
|
||||
<activity
|
||||
android:name="com.dahe.examine.ui.gone.activity.AddGoActivity"
|
||||
android:configChanges="keyboardHidden|orientation|locale"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden"></activity>
|
||||
|
||||
<activity
|
||||
android:name="com.dahe.examine.ui.account.activity.BusinessInfoActivity"
|
||||
android:configChanges="keyboardHidden|orientation|locale"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden"></activity>
|
||||
|
||||
<activity
|
||||
android:name="com.dahe.examine.ui.home.activity.ApplyDetailActivity"
|
||||
android:configChanges="keyboardHidden|orientation|locale"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden"></activity>
|
||||
|
||||
<activity
|
||||
android:name="com.dahe.examine.ui.home.activity.ExamineDetailActivity"
|
||||
android:configChanges="keyboardHidden|orientation|locale"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden"></activity>
|
||||
<activity
|
||||
android:name="com.dahe.examine.ui.home.activity.RecordActivity"
|
||||
android:configChanges="keyboardHidden|orientation|locale"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden"></activity>
|
||||
<activity
|
||||
android:name=".ui.gone.activity.NotReportedActivity"
|
||||
android:configChanges="keyboardHidden|orientation|locale"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden"></activity>
|
||||
<activity
|
||||
android:name=".ui.gone.activity.UserDetailActivity"
|
||||
android:configChanges="keyboardHidden|orientation|locale"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden"></activity>
|
||||
|
||||
<activity
|
||||
android:name=".web.WebActivity"
|
||||
android:configChanges="keyboardHidden|orientation|locale"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden"></activity>
|
||||
|
||||
<activity
|
||||
android:name="com.dahe.examine.ui.LauncherActivity"
|
||||
android:theme="@style/Theme.Splash">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
5354
app/src/main/assets/province.json
Normal file
11
app/src/main/java/com/dahe/examine/MainActivity.kt
Normal file
@ -0,0 +1,11 @@
|
||||
package com.dahe.examine
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.os.Bundle
|
||||
|
||||
class MainActivity : AppCompatActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setContentView(R.layout.activity_main)
|
||||
}
|
||||
}
|
26
app/src/main/java/com/dahe/examine/adapter/ApplyAdapter.kt
Normal file
@ -0,0 +1,26 @@
|
||||
package com.dahe.examine.adapter
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.viewholder.BaseViewHolder
|
||||
import com.dahe.examine.R
|
||||
import com.dahe.examine.bean.ApplyBean
|
||||
|
||||
/**
|
||||
* @ClassName ApplyAdapter
|
||||
* @Author 用户
|
||||
* @Date 2022/1/13 15:18
|
||||
* @Description TODO
|
||||
*/
|
||||
class ApplyAdapter(layoutResId: Int) : BaseQuickAdapter<ApplyBean, BaseViewHolder>(R.layout.item_apply) {
|
||||
override fun convert(holder: BaseViewHolder, item: ApplyBean) {
|
||||
holder.setText(R.id.tvTitle,item.enterpriseName)
|
||||
.setText(R.id.tvSqs,item.numberOfPassesRequired)
|
||||
.setText(R.id.tvSps,item.countyName)
|
||||
.setText(R.id.tvTbr,item.enterpriseContact)
|
||||
.setText(R.id.tvDh,item.enterpriseContactPhone)
|
||||
.setText(R.id.tvGj,item.nationalClassA)
|
||||
.setText(R.id.tvCls,item.vehiclesNumber)
|
||||
.setText(R.id.tvType,"""(${item.chargeType})""")
|
||||
.setTextColorRes(R.id.tvType,if (item.chargeType.contains("收费")) R.color.color_down_time else R.color.color_green)
|
||||
}
|
||||
}
|
26
app/src/main/java/com/dahe/examine/adapter/GoneAdapter.kt
Normal file
@ -0,0 +1,26 @@
|
||||
package com.dahe.examine.adapter
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.viewholder.BaseViewHolder
|
||||
import com.dahe.examine.R
|
||||
import com.dahe.examine.bean.ApplyBean
|
||||
import com.dahe.examine.bean.PassBean
|
||||
|
||||
/**
|
||||
* @ClassName ApplyAdapter
|
||||
* @Author 用户
|
||||
* @Date 2022/1/13 15:18
|
||||
* @Description TODO
|
||||
*/
|
||||
class GoneAdapter(layoutResId: Int) : BaseQuickAdapter<ApplyBean, BaseViewHolder>(R.layout.item_gone) {
|
||||
override fun convert(holder: BaseViewHolder, item: ApplyBean) {
|
||||
holder.setText(R.id.tvTitle,item.enterpriseName)
|
||||
.setText(R.id.tvSjName,item.name)
|
||||
.setText(R.id.tvDh,item.phone)
|
||||
.setText(R.id.tvDs,"""${item.passNo}/${item.numberOfPasses}""")
|
||||
.setText(R.id.tvZl,item.notUsed)
|
||||
.setText(R.id.tvType,"""(${item.chargeType})""")
|
||||
.setTextColorRes(R.id.tvType,if (item.chargeType.contains("收费")) R.color.color_down_time else R.color.color_green)
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package com.dahe.examine.adapter;
|
||||
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2018/7/16 0016.
|
||||
*/
|
||||
|
||||
public class MyHomePagerAdapter extends FragmentStatePagerAdapter {
|
||||
private String[] mTitles;
|
||||
private ArrayList<Fragment> mFragments = new ArrayList<>();
|
||||
|
||||
public MyHomePagerAdapter(FragmentManager fm) {
|
||||
super(fm);
|
||||
}
|
||||
|
||||
public MyHomePagerAdapter(FragmentManager fm, String[] mTitles, ArrayList<Fragment> mFragments) {
|
||||
super(fm);
|
||||
this.mTitles = mTitles;
|
||||
this.mFragments = mFragments;
|
||||
}
|
||||
|
||||
// 初始化每个页卡选项
|
||||
// @Override
|
||||
// public Object instantiateItem(ViewGroup arg0, int arg1) {
|
||||
// // TODO Auto-generated method stub
|
||||
// node_return super.instantiateItem(arg0, arg1);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return mFragments.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharSequence getPageTitle(int position) {
|
||||
return mTitles[position];
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
return mFragments.get(position);
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.dahe.examine.adapter
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.viewholder.BaseViewHolder
|
||||
import com.dahe.examine.R
|
||||
import com.dahe.examine.bean.ApplyBean
|
||||
|
||||
/**
|
||||
* @ClassName ApplyAdapter
|
||||
* @Author 用户
|
||||
* @Date 2022/1/13 15:18
|
||||
* @Description TODO
|
||||
*/
|
||||
class NotReportAdapter(layoutResId: Int) : BaseQuickAdapter<ApplyBean, BaseViewHolder>(R.layout.item_not_report) {
|
||||
override fun convert(holder: BaseViewHolder, item: ApplyBean) {
|
||||
holder.setText(R.id.tv1,item.enterprise_name)
|
||||
.setText(R.id.tvSj,"""未报时间:${item.useDate}""")
|
||||
// .setText(R.id.tvSps,item.numberOfPassesRequired)
|
||||
// .setText(R.id.tvTbr,item.enterpriseContact)
|
||||
// .setText(R.id.tvDh,item.enterpriseContactPhone)
|
||||
}
|
||||
}
|
35
app/src/main/java/com/dahe/examine/adapter/RecordAdapter.kt
Normal file
@ -0,0 +1,35 @@
|
||||
package com.dahe.examine.adapter
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.viewholder.BaseViewHolder
|
||||
import com.dahe.examine.R
|
||||
import com.dahe.examine.bean.ApplyBean
|
||||
|
||||
/**
|
||||
* @ClassName ApplyAdapter
|
||||
* @Author 用户
|
||||
* @Date 2022/1/13 15:18
|
||||
* @Description TODO
|
||||
*/
|
||||
class RecordAdapter(layoutResId: Int) : BaseQuickAdapter<ApplyBean, BaseViewHolder>(R.layout.item_record) {
|
||||
override fun convert(holder: BaseViewHolder, item: ApplyBean) {
|
||||
holder.setText(R.id.tvTitle,item.enterpriseName)
|
||||
.setText(R.id.tvSqs,item.numberOfPassesRequired)
|
||||
.setText(R.id.tvSps,item.numberOfPasses)
|
||||
.setText(R.id.tvTbr,item.enterpriseContact)
|
||||
.setText(R.id.tvDh,item.enterpriseContactPhone)
|
||||
.setText(R.id.tvGjj,item.nationalClassA)
|
||||
.setText(R.id.tvCl,item.vehiclesNumber)
|
||||
.setText(R.id.tvSqsj,item.createTime)
|
||||
.setText(R.id.tvSpsj,item.updateTime)
|
||||
.setText(R.id.tvJjyy,item.remarks)
|
||||
.setGone(R.id.llJjyy,if ("1"==item.status) true else false)
|
||||
.setGone(R.id.tvTime,if ("1"==item.status) false else true)
|
||||
.setText(R.id.tvSjTitle,if ("1"==item.status) "审核时间:" else "拒绝时间:")
|
||||
.setText(R.id.tvTime,"""${item.passUsageStartTime}至${item.passUsageEndTime}""")
|
||||
.setGone(R.id.ivType,if ("0"==item.status) true else false)
|
||||
.setBackgroundResource(R.id.ivType,if ("1"==item.status) R.drawable.ok_pass else R.drawable.no_pass)
|
||||
.setText(R.id.tvType,"""(${item.chargeType})""")
|
||||
.setTextColorRes(R.id.tvType,if (item.chargeType.contains("收费")) R.color.color_down_time else R.color.color_green)
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package com.dahe.examine.adapter
|
||||
|
||||
import com.chad.library.adapter.base.BaseQuickAdapter
|
||||
import com.chad.library.adapter.base.viewholder.BaseViewHolder
|
||||
import com.dahe.examine.R
|
||||
import com.dahe.examine.bean.ApplyBean
|
||||
|
||||
/**
|
||||
* @ClassName ApplyAdapter
|
||||
* @Author 用户
|
||||
* @Date 2022/1/13 15:18
|
||||
* @Description TODO
|
||||
*/
|
||||
class UserDetailAdapter(layoutResId: Int) : BaseQuickAdapter<ApplyBean, BaseViewHolder>(R.layout.item_user) {
|
||||
override fun convert(holder: BaseViewHolder, item: ApplyBean) {
|
||||
holder.setText(R.id.tvBh,item.passNo)
|
||||
.setText(R.id.tvCph,item.vehicle)
|
||||
.setText(R.id.tvQd,item.startPoint)
|
||||
.setText(R.id.tvZd,item.endPoint)
|
||||
.setText(R.id.tvDs,item.transportTonnage)
|
||||
.setText(R.id.tvZl,item.itemTypeName)
|
||||
.setText(R.id.tvSjName,item.driverName)
|
||||
.setText(R.id.tvDh,item.driverPhone)
|
||||
.setText(R.id.tvStartSj,item.startTime)
|
||||
.setText(R.id.tvEndTime,item.endTime)
|
||||
.setText(R.id.tvBz,item.remarks)
|
||||
.setText(R.id.tvTime,"""${item.useStartTime}至${item.useEndTime}""")
|
||||
.setText(R.id.tvType,"""(${item.chargeType})""")
|
||||
.setTextColorRes(R.id.tvType,if (item.chargeType.contains("收费")) R.color.color_down_time else R.color.color_green)
|
||||
}
|
||||
}
|
124
app/src/main/java/com/dahe/examine/base/App.java
Normal file
@ -0,0 +1,124 @@
|
||||
package com.dahe.examine.base;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import com.dahe.mylibrary.CommonBaseLibrary;
|
||||
import com.dahe.examine.net.Api;
|
||||
import com.dahe.examine.oss.OssServiceUtil;
|
||||
import com.tencent.bugly.crashreport.CrashReport;
|
||||
|
||||
import java.security.SecureRandom;
|
||||
import java.security.cert.X509Certificate;
|
||||
|
||||
import javax.net.ssl.HostnameVerifier;
|
||||
import javax.net.ssl.HttpsURLConnection;
|
||||
import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.SSLSession;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
|
||||
public class App extends Application {
|
||||
public static final String TAG = "BNSDKSimpleDemo";
|
||||
public static final String APP_FOLDER_NAME = TAG;
|
||||
public static App mApplication = null;
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
mApplication = this;
|
||||
CommonBaseLibrary.getInstance().init(this, Api.BASE_URL);
|
||||
// if (BuildConfig.DEBUG){
|
||||
// CrashHandler.getInstance().init(this);
|
||||
// }
|
||||
CrashReport.initCrashReport(getApplicationContext(), "fc3d9aaf74", false);
|
||||
|
||||
|
||||
//预初始化
|
||||
// initPush();
|
||||
//友盟华为推送通道
|
||||
// HuaWeiRegister.register(this);
|
||||
//在使用SDK各组件之前初始化context信息,传入ApplicationContext
|
||||
// SDKInitializer.initialize(this);
|
||||
//自4.3.0起,百度地图SDK所有接口均支持百度坐标和国测局坐标,用此方法设置您使用的坐标类型.
|
||||
//包括BD09LL和GCJ02两种坐标,默认是BD09LL坐标。
|
||||
// SDKInitializer.setCoordType(CoordType.BD09LL);
|
||||
|
||||
// SophixManager.getInstance().queryAndLoadNewPatch();
|
||||
|
||||
OssServiceUtil.getInstance().init();
|
||||
}
|
||||
|
||||
|
||||
public static App getApp() {
|
||||
return mApplication;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void attachBaseContext(Context base) {
|
||||
super.attachBaseContext(base);
|
||||
|
||||
}
|
||||
|
||||
//忽略https的证书校验
|
||||
public void handleSSLHandshake() {
|
||||
try {
|
||||
TrustManager[] trustAllCerts = new TrustManager[]{new X509TrustManager() {
|
||||
public X509Certificate[] getAcceptedIssuers() {
|
||||
return new X509Certificate[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkClientTrusted(X509Certificate[] certs, String authType) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void checkServerTrusted(X509Certificate[] certs, String authType) {
|
||||
}
|
||||
}};
|
||||
|
||||
SSLContext sc = SSLContext.getInstance("TLS");
|
||||
// trustAllCerts信任所有的证书
|
||||
sc.init(null, trustAllCerts, new SecureRandom());
|
||||
HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
|
||||
HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {
|
||||
@Override
|
||||
public boolean verify(String hostname, SSLSession session) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化推送SDK,在用户隐私政策协议同意后,再做初始化
|
||||
*/
|
||||
// private void initPushSDK() {
|
||||
// /*
|
||||
// * 判断用户是否已同意隐私政策
|
||||
// * 当同意时,直接进行初始化;
|
||||
// * 当未同意时,待用户同意后,通过PushHelper.init(...)方法进行初始化。
|
||||
// */
|
||||
// boolean agreed = SPUtils.hasAgreePrivacyAgreement(this);
|
||||
// if (agreed && PushHelper.isMainProcess(this)) {
|
||||
//// if (true) {
|
||||
// //建议在线程中执行初始化
|
||||
// new Thread(new Runnable() {
|
||||
// @Override
|
||||
// public void run() {
|
||||
// PushHelper.init(getApplicationContext());
|
||||
// }
|
||||
// }).start();
|
||||
// }
|
||||
// }
|
||||
|
||||
/*private void initPush(){
|
||||
//日志开关
|
||||
UMConfigure.setLogEnabled(BuildConfig.DEBUG?true:false);
|
||||
//预初始化
|
||||
PushHelper.preInit(this);
|
||||
//正式初始化
|
||||
initPushSDK();
|
||||
}*/
|
||||
}
|
16
app/src/main/java/com/dahe/examine/base/AppConfig.java
Normal file
@ -0,0 +1,16 @@
|
||||
package com.dahe.examine.base;
|
||||
|
||||
/**
|
||||
* @ClassName AppConfig
|
||||
* @Author 用户
|
||||
* @Date 2022/1/14 15:24
|
||||
* @Description TODO
|
||||
*/
|
||||
public class AppConfig {
|
||||
|
||||
public static final String BEAN= "DA_HE_BEAN";
|
||||
public static final String TIME= "DA_HE_TIME";
|
||||
public static final String ID= "DA_HE_ID";
|
||||
public static final String PWD= "DA_HE_PHONE";
|
||||
public static final String CODE= "DA_HE_PHONE";
|
||||
}
|
233
app/src/main/java/com/dahe/examine/bean/AddresBean.java
Normal file
@ -0,0 +1,233 @@
|
||||
package com.dahe.examine.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName AddresBean
|
||||
* @Author 用户
|
||||
* @Date 2022/1/19 14:23
|
||||
* @Description TODO
|
||||
*/
|
||||
public class AddresBean implements Serializable {
|
||||
|
||||
|
||||
private String searchValue;
|
||||
private String createBy;
|
||||
private String createTime;
|
||||
private String updateBy;
|
||||
private String updateTime;
|
||||
private String remark;
|
||||
private ParamsDTO params;
|
||||
private Integer userId;
|
||||
private String name;
|
||||
private String enterpriseName;
|
||||
private String phone;
|
||||
private String contacts;
|
||||
private String nationalClassA;
|
||||
private String avatarUrl;
|
||||
private String contactsphone;
|
||||
private String businessType;
|
||||
private String placeOfRegistration;
|
||||
private String nationality;
|
||||
private String companyAddress;
|
||||
private String sex;
|
||||
private String birth;
|
||||
private String plantAddress;
|
||||
private String pwd;
|
||||
private String isDel;
|
||||
|
||||
public String getSearchValue() {
|
||||
return searchValue;
|
||||
}
|
||||
|
||||
public void setSearchValue(String searchValue) {
|
||||
this.searchValue = searchValue;
|
||||
}
|
||||
|
||||
public String getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
public void setCreateBy(String createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
public String getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(String createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getUpdateBy() {
|
||||
return updateBy;
|
||||
}
|
||||
|
||||
public void setUpdateBy(String updateBy) {
|
||||
this.updateBy = updateBy;
|
||||
}
|
||||
|
||||
public String getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(String updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public ParamsDTO getParams() {
|
||||
return params;
|
||||
}
|
||||
|
||||
public void setParams(ParamsDTO params) {
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
public Integer getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Integer userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getEnterpriseName() {
|
||||
return enterpriseName;
|
||||
}
|
||||
|
||||
public void setEnterpriseName(String enterpriseName) {
|
||||
this.enterpriseName = enterpriseName;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getContacts() {
|
||||
return contacts;
|
||||
}
|
||||
|
||||
public void setContacts(String contacts) {
|
||||
this.contacts = contacts;
|
||||
}
|
||||
|
||||
public String getNationalClassA() {
|
||||
return nationalClassA;
|
||||
}
|
||||
|
||||
public void setNationalClassA(String nationalClassA) {
|
||||
this.nationalClassA = nationalClassA;
|
||||
}
|
||||
|
||||
public String getAvatarUrl() {
|
||||
return avatarUrl;
|
||||
}
|
||||
|
||||
public void setAvatarUrl(String avatarUrl) {
|
||||
this.avatarUrl = avatarUrl;
|
||||
}
|
||||
|
||||
public String getContactsphone() {
|
||||
return contactsphone;
|
||||
}
|
||||
|
||||
public void setContactsphone(String contactsphone) {
|
||||
this.contactsphone = contactsphone;
|
||||
}
|
||||
|
||||
public String getBusinessType() {
|
||||
return businessType;
|
||||
}
|
||||
|
||||
public void setBusinessType(String businessType) {
|
||||
this.businessType = businessType;
|
||||
}
|
||||
|
||||
public String getPlaceOfRegistration() {
|
||||
return placeOfRegistration;
|
||||
}
|
||||
|
||||
public void setPlaceOfRegistration(String placeOfRegistration) {
|
||||
this.placeOfRegistration = placeOfRegistration;
|
||||
}
|
||||
|
||||
public String getNationality() {
|
||||
return nationality;
|
||||
}
|
||||
|
||||
public void setNationality(String nationality) {
|
||||
this.nationality = nationality;
|
||||
}
|
||||
|
||||
public String getCompanyAddress() {
|
||||
return companyAddress;
|
||||
}
|
||||
|
||||
public void setCompanyAddress(String companyAddress) {
|
||||
this.companyAddress = companyAddress;
|
||||
}
|
||||
|
||||
public String getSex() {
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setSex(String sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
|
||||
public String getBirth() {
|
||||
return birth;
|
||||
}
|
||||
|
||||
public void setBirth(String birth) {
|
||||
this.birth = birth;
|
||||
}
|
||||
|
||||
public String getPlantAddress() {
|
||||
return plantAddress;
|
||||
}
|
||||
|
||||
public void setPlantAddress(String plantAddress) {
|
||||
this.plantAddress = plantAddress;
|
||||
}
|
||||
|
||||
public String getPwd() {
|
||||
return pwd;
|
||||
}
|
||||
|
||||
public void setPwd(String pwd) {
|
||||
this.pwd = pwd;
|
||||
}
|
||||
|
||||
public String getIsDel() {
|
||||
return isDel;
|
||||
}
|
||||
|
||||
public void setIsDel(String isDel) {
|
||||
this.isDel = isDel;
|
||||
}
|
||||
|
||||
public static class ParamsDTO {
|
||||
}
|
||||
}
|
428
app/src/main/java/com/dahe/examine/bean/ApplyBean.java
Normal file
@ -0,0 +1,428 @@
|
||||
package com.dahe.examine.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName ApplyBean
|
||||
* @Author 用户
|
||||
* @Date 2022/1/13 15:18
|
||||
* @Description TODO
|
||||
*/
|
||||
public class ApplyBean implements Serializable {
|
||||
|
||||
private String searchValue;
|
||||
private String createBy;
|
||||
private String createTime;
|
||||
private String updateBy;
|
||||
private String updateTime;
|
||||
private String remark;
|
||||
private String infoId;
|
||||
private String userId;
|
||||
private String typeId;
|
||||
private String enterpriseName;
|
||||
private String enterpriseContact;
|
||||
private String enterpriseContactPhone;
|
||||
private String nationalClassA;
|
||||
private String vehiclesNumber;
|
||||
private String numberOfPassesRequired;
|
||||
private String status;
|
||||
private String numberOfPasses;
|
||||
private String passNo;
|
||||
private String approvedBy;
|
||||
private String remarks;
|
||||
private String passUsageStartTime;
|
||||
private String passUsageEndTime;
|
||||
private String provinceId;
|
||||
private String provinceName;
|
||||
private String cityId;
|
||||
private String cityName;
|
||||
private String countyId;
|
||||
private String countyName;
|
||||
private String sign;
|
||||
private String useStartTime;
|
||||
private String useEndTime;
|
||||
private String phone;
|
||||
private String name;
|
||||
private String notUsed;
|
||||
private String vehicle;
|
||||
private String startPoint;
|
||||
private String endPoint;
|
||||
private String itemTypeName;
|
||||
private String transportTonnage;
|
||||
private String driverName;
|
||||
private String driverPhone;
|
||||
private String startTime;
|
||||
private String endTime;
|
||||
private String useDate;
|
||||
private String enterprise_name;
|
||||
private String chargeType;
|
||||
|
||||
public String getChargeType() {
|
||||
return chargeType;
|
||||
}
|
||||
|
||||
public void setChargeType(String chargeType) {
|
||||
this.chargeType = chargeType;
|
||||
}
|
||||
|
||||
public String getUseDate() {
|
||||
return useDate;
|
||||
}
|
||||
|
||||
public void setUseDate(String useDate) {
|
||||
this.useDate = useDate;
|
||||
}
|
||||
|
||||
public String getEnterprise_name() {
|
||||
return enterprise_name;
|
||||
}
|
||||
|
||||
public void setEnterprise_name(String enterprise_name) {
|
||||
this.enterprise_name = enterprise_name;
|
||||
}
|
||||
|
||||
public String getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(String startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public String getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(String endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public String getDriverName() {
|
||||
return driverName;
|
||||
}
|
||||
|
||||
public void setDriverName(String driverName) {
|
||||
this.driverName = driverName;
|
||||
}
|
||||
|
||||
public String getDriverPhone() {
|
||||
return driverPhone;
|
||||
}
|
||||
|
||||
public void setDriverPhone(String driverPhone) {
|
||||
this.driverPhone = driverPhone;
|
||||
}
|
||||
|
||||
public String getItemTypeName() {
|
||||
return itemTypeName;
|
||||
}
|
||||
|
||||
public void setItemTypeName(String itemTypeName) {
|
||||
this.itemTypeName = itemTypeName;
|
||||
}
|
||||
|
||||
public String getTransportTonnage() {
|
||||
return transportTonnage;
|
||||
}
|
||||
|
||||
public void setTransportTonnage(String transportTonnage) {
|
||||
this.transportTonnage = transportTonnage;
|
||||
}
|
||||
|
||||
public String getStartPoint() {
|
||||
return startPoint;
|
||||
}
|
||||
|
||||
public void setStartPoint(String startPoint) {
|
||||
this.startPoint = startPoint;
|
||||
}
|
||||
|
||||
public String getEndPoint() {
|
||||
return endPoint;
|
||||
}
|
||||
|
||||
public void setEndPoint(String endPoint) {
|
||||
this.endPoint = endPoint;
|
||||
}
|
||||
|
||||
public String getVehicle() {
|
||||
return vehicle;
|
||||
}
|
||||
|
||||
public void setVehicle(String vehicle) {
|
||||
this.vehicle = vehicle;
|
||||
}
|
||||
|
||||
public String getPassNo() {
|
||||
return passNo;
|
||||
}
|
||||
|
||||
public void setPassNo(String passNo) {
|
||||
this.passNo = passNo;
|
||||
}
|
||||
|
||||
public String getNotUsed() {
|
||||
return notUsed;
|
||||
}
|
||||
|
||||
public void setNotUsed(String notUsed) {
|
||||
this.notUsed = notUsed;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getUseStartTime() {
|
||||
return useStartTime;
|
||||
}
|
||||
|
||||
public void setUseStartTime(String useStartTime) {
|
||||
this.useStartTime = useStartTime;
|
||||
}
|
||||
|
||||
public String getUseEndTime() {
|
||||
return useEndTime;
|
||||
}
|
||||
|
||||
public void setUseEndTime(String useEndTime) {
|
||||
this.useEndTime = useEndTime;
|
||||
}
|
||||
|
||||
public String getSearchValue() {
|
||||
return searchValue;
|
||||
}
|
||||
|
||||
public void setSearchValue(String searchValue) {
|
||||
this.searchValue = searchValue;
|
||||
}
|
||||
|
||||
public String getCreateBy() {
|
||||
return createBy;
|
||||
}
|
||||
|
||||
public void setCreateBy(String createBy) {
|
||||
this.createBy = createBy;
|
||||
}
|
||||
|
||||
public String getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(String createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getUpdateBy() {
|
||||
return updateBy;
|
||||
}
|
||||
|
||||
public void setUpdateBy(String updateBy) {
|
||||
this.updateBy = updateBy;
|
||||
}
|
||||
|
||||
public String getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(String updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getInfoId() {
|
||||
return infoId;
|
||||
}
|
||||
|
||||
public void setInfoId(String infoId) {
|
||||
this.infoId = infoId;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getTypeId() {
|
||||
return typeId;
|
||||
}
|
||||
|
||||
public void setTypeId(String typeId) {
|
||||
this.typeId = typeId;
|
||||
}
|
||||
|
||||
public String getEnterpriseName() {
|
||||
return enterpriseName;
|
||||
}
|
||||
|
||||
public void setEnterpriseName(String enterpriseName) {
|
||||
this.enterpriseName = enterpriseName;
|
||||
}
|
||||
|
||||
public String getEnterpriseContact() {
|
||||
return enterpriseContact;
|
||||
}
|
||||
|
||||
public void setEnterpriseContact(String enterpriseContact) {
|
||||
this.enterpriseContact = enterpriseContact;
|
||||
}
|
||||
|
||||
public String getEnterpriseContactPhone() {
|
||||
return enterpriseContactPhone;
|
||||
}
|
||||
|
||||
public void setEnterpriseContactPhone(String enterpriseContactPhone) {
|
||||
this.enterpriseContactPhone = enterpriseContactPhone;
|
||||
}
|
||||
|
||||
public String getNationalClassA() {
|
||||
return nationalClassA;
|
||||
}
|
||||
|
||||
public void setNationalClassA(String nationalClassA) {
|
||||
this.nationalClassA = nationalClassA;
|
||||
}
|
||||
|
||||
public String getVehiclesNumber() {
|
||||
return vehiclesNumber;
|
||||
}
|
||||
|
||||
public void setVehiclesNumber(String vehiclesNumber) {
|
||||
this.vehiclesNumber = vehiclesNumber;
|
||||
}
|
||||
|
||||
public String getNumberOfPassesRequired() {
|
||||
return numberOfPassesRequired;
|
||||
}
|
||||
|
||||
public void setNumberOfPassesRequired(String numberOfPassesRequired) {
|
||||
this.numberOfPassesRequired = numberOfPassesRequired;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getNumberOfPasses() {
|
||||
return numberOfPasses;
|
||||
}
|
||||
|
||||
public void setNumberOfPasses(String numberOfPasses) {
|
||||
this.numberOfPasses = numberOfPasses;
|
||||
}
|
||||
|
||||
public String getApprovedBy() {
|
||||
return approvedBy;
|
||||
}
|
||||
|
||||
public void setApprovedBy(String approvedBy) {
|
||||
this.approvedBy = approvedBy;
|
||||
}
|
||||
|
||||
public String getRemarks() {
|
||||
return remarks;
|
||||
}
|
||||
|
||||
public void setRemarks(String remarks) {
|
||||
this.remarks = remarks;
|
||||
}
|
||||
|
||||
public String getPassUsageStartTime() {
|
||||
return passUsageStartTime;
|
||||
}
|
||||
|
||||
public void setPassUsageStartTime(String passUsageStartTime) {
|
||||
this.passUsageStartTime = passUsageStartTime;
|
||||
}
|
||||
|
||||
public String getPassUsageEndTime() {
|
||||
return passUsageEndTime;
|
||||
}
|
||||
|
||||
public void setPassUsageEndTime(String passUsageEndTime) {
|
||||
this.passUsageEndTime = passUsageEndTime;
|
||||
}
|
||||
|
||||
public String getProvinceId() {
|
||||
return provinceId;
|
||||
}
|
||||
|
||||
public void setProvinceId(String provinceId) {
|
||||
this.provinceId = provinceId;
|
||||
}
|
||||
|
||||
public String getProvinceName() {
|
||||
return provinceName;
|
||||
}
|
||||
|
||||
public void setProvinceName(String provinceName) {
|
||||
this.provinceName = provinceName;
|
||||
}
|
||||
|
||||
public String getCityId() {
|
||||
return cityId;
|
||||
}
|
||||
|
||||
public void setCityId(String cityId) {
|
||||
this.cityId = cityId;
|
||||
}
|
||||
|
||||
public String getCityName() {
|
||||
return cityName;
|
||||
}
|
||||
|
||||
public void setCityName(String cityName) {
|
||||
this.cityName = cityName;
|
||||
}
|
||||
|
||||
public String getCountyId() {
|
||||
return countyId;
|
||||
}
|
||||
|
||||
public void setCountyId(String countyId) {
|
||||
this.countyId = countyId;
|
||||
}
|
||||
|
||||
public String getCountyName() {
|
||||
return countyName;
|
||||
}
|
||||
|
||||
public void setCountyName(String countyName) {
|
||||
this.countyName = countyName;
|
||||
}
|
||||
|
||||
public String getSign() {
|
||||
return sign;
|
||||
}
|
||||
|
||||
public void setSign(String sign) {
|
||||
this.sign = sign;
|
||||
}
|
||||
|
||||
}
|
112
app/src/main/java/com/dahe/examine/bean/ApplySendBean.java
Normal file
@ -0,0 +1,112 @@
|
||||
package com.dahe.examine.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName ApplySendBean
|
||||
* @Author 用户
|
||||
* @Date 2022/1/15 15:55
|
||||
* @Description TODO
|
||||
*/
|
||||
public class ApplySendBean implements Serializable {
|
||||
|
||||
private String typeId;
|
||||
private String enterpriseName;
|
||||
private String enterpriseContact;
|
||||
private String enterpriseContactPhone;
|
||||
private String nationalClassA;
|
||||
private String vehiclesNumber;
|
||||
private String numberOfPassesRequired;
|
||||
private String provinceName;
|
||||
private String cityName;
|
||||
private String countyName;
|
||||
private String sign;
|
||||
|
||||
public String getSign() {
|
||||
return sign;
|
||||
}
|
||||
|
||||
public void setSign(String sign) {
|
||||
this.sign = sign;
|
||||
}
|
||||
|
||||
public String getTypeId() {
|
||||
return typeId;
|
||||
}
|
||||
|
||||
public void setTypeId(String typeId) {
|
||||
this.typeId = typeId;
|
||||
}
|
||||
|
||||
public String getEnterpriseName() {
|
||||
return enterpriseName;
|
||||
}
|
||||
|
||||
public void setEnterpriseName(String enterpriseName) {
|
||||
this.enterpriseName = enterpriseName;
|
||||
}
|
||||
|
||||
public String getEnterpriseContact() {
|
||||
return enterpriseContact;
|
||||
}
|
||||
|
||||
public void setEnterpriseContact(String enterpriseContact) {
|
||||
this.enterpriseContact = enterpriseContact;
|
||||
}
|
||||
|
||||
public String getEnterpriseContactPhone() {
|
||||
return enterpriseContactPhone;
|
||||
}
|
||||
|
||||
public void setEnterpriseContactPhone(String enterpriseContactPhone) {
|
||||
this.enterpriseContactPhone = enterpriseContactPhone;
|
||||
}
|
||||
|
||||
public String getNationalClassA() {
|
||||
return nationalClassA;
|
||||
}
|
||||
|
||||
public void setNationalClassA(String nationalClassA) {
|
||||
this.nationalClassA = nationalClassA;
|
||||
}
|
||||
|
||||
public String getVehiclesNumber() {
|
||||
return vehiclesNumber;
|
||||
}
|
||||
|
||||
public void setVehiclesNumber(String vehiclesNumber) {
|
||||
this.vehiclesNumber = vehiclesNumber;
|
||||
}
|
||||
|
||||
public String getNumberOfPassesRequired() {
|
||||
return numberOfPassesRequired;
|
||||
}
|
||||
|
||||
public void setNumberOfPassesRequired(String numberOfPassesRequired) {
|
||||
this.numberOfPassesRequired = numberOfPassesRequired;
|
||||
}
|
||||
|
||||
public String getProvinceName() {
|
||||
return provinceName;
|
||||
}
|
||||
|
||||
public void setProvinceName(String provinceName) {
|
||||
this.provinceName = provinceName;
|
||||
}
|
||||
|
||||
public String getCityName() {
|
||||
return cityName;
|
||||
}
|
||||
|
||||
public void setCityName(String cityName) {
|
||||
this.cityName = cityName;
|
||||
}
|
||||
|
||||
public String getCountyName() {
|
||||
return countyName;
|
||||
}
|
||||
|
||||
public void setCountyName(String countyName) {
|
||||
this.countyName = countyName;
|
||||
}
|
||||
}
|
143
app/src/main/java/com/dahe/examine/bean/BusInfoBean.java
Normal file
@ -0,0 +1,143 @@
|
||||
package com.dahe.examine.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName BusInfoBean
|
||||
* @Author 用户
|
||||
* @Date 2022/1/14 15:06
|
||||
* @Description TODO
|
||||
*/
|
||||
public class BusInfoBean implements Serializable {
|
||||
|
||||
private String phone;
|
||||
private String code;
|
||||
private String enterpriseName;
|
||||
private String pwd;
|
||||
private String nationalClassA;//国家A级
|
||||
private String businessType;//业务类型
|
||||
private String avatarUrl;
|
||||
private String placeOfRegistration;//注册地址
|
||||
private String companyAddress;//公司地址
|
||||
private String plantAddress;//厂区地址
|
||||
private String contacts;//厂区地址
|
||||
private String contactsPhone;//厂区地址
|
||||
private ParamsDao params;
|
||||
|
||||
|
||||
public String getContacts() {
|
||||
return contacts;
|
||||
}
|
||||
|
||||
public void setContacts(String contacts) {
|
||||
this.contacts = contacts;
|
||||
}
|
||||
|
||||
public String getContactsPhone() {
|
||||
return contactsPhone;
|
||||
}
|
||||
|
||||
public void setContactsPhone(String contactsPhone) {
|
||||
this.contactsPhone = contactsPhone;
|
||||
}
|
||||
|
||||
public ParamsDao getParams() {
|
||||
return params;
|
||||
}
|
||||
|
||||
public void setParams(ParamsDao params) {
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getEnterpriseName() {
|
||||
return enterpriseName;
|
||||
}
|
||||
|
||||
public void setEnterpriseName(String enterpriseName) {
|
||||
this.enterpriseName = enterpriseName;
|
||||
}
|
||||
|
||||
public String getPwd() {
|
||||
return pwd;
|
||||
}
|
||||
|
||||
public void setPwd(String pwd) {
|
||||
this.pwd = pwd;
|
||||
}
|
||||
|
||||
public String getNationalClassA() {
|
||||
return nationalClassA;
|
||||
}
|
||||
|
||||
public void setNationalClassA(String nationalClassA) {
|
||||
this.nationalClassA = nationalClassA;
|
||||
}
|
||||
|
||||
public String getBusinessType() {
|
||||
return businessType;
|
||||
}
|
||||
|
||||
public void setBusinessType(String businessType) {
|
||||
this.businessType = businessType;
|
||||
}
|
||||
|
||||
public String getAvatarUrl() {
|
||||
return avatarUrl;
|
||||
}
|
||||
|
||||
public void setAvatarUrl(String avatarUrl) {
|
||||
this.avatarUrl = avatarUrl;
|
||||
}
|
||||
|
||||
public String getPlaceOfRegistration() {
|
||||
return placeOfRegistration;
|
||||
}
|
||||
|
||||
public void setPlaceOfRegistration(String placeOfRegistration) {
|
||||
this.placeOfRegistration = placeOfRegistration;
|
||||
}
|
||||
|
||||
public String getCompanyAddress() {
|
||||
return companyAddress;
|
||||
}
|
||||
|
||||
public void setCompanyAddress(String companyAddress) {
|
||||
this.companyAddress = companyAddress;
|
||||
}
|
||||
|
||||
public String getPlantAddress() {
|
||||
return plantAddress;
|
||||
}
|
||||
|
||||
public void setPlantAddress(String plantAddress) {
|
||||
this.plantAddress = plantAddress;
|
||||
}
|
||||
|
||||
public static class ParamsDao implements Serializable{
|
||||
private String code;
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
}
|
||||
}
|
32
app/src/main/java/com/dahe/examine/bean/ChangePwdBean.java
Normal file
@ -0,0 +1,32 @@
|
||||
package com.dahe.examine.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName ChangePwdBean
|
||||
* @Author 用户
|
||||
* @Date 2022/1/18 9:43
|
||||
* @Description TODO
|
||||
*/
|
||||
public class ChangePwdBean implements Serializable {
|
||||
|
||||
|
||||
private String password;
|
||||
private String userId;
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
}
|
34
app/src/main/java/com/dahe/examine/bean/CheckCodeBean.java
Normal file
@ -0,0 +1,34 @@
|
||||
package com.dahe.examine.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class CheckCodeBean implements Serializable {
|
||||
|
||||
private String img;
|
||||
private String expireTime;
|
||||
private String uuid;
|
||||
|
||||
public String getImage() {
|
||||
return img;
|
||||
}
|
||||
|
||||
public void setImage(String image) {
|
||||
this.img = image;
|
||||
}
|
||||
|
||||
public String getExpireTime() {
|
||||
return expireTime;
|
||||
}
|
||||
|
||||
public void setExpireTime(String expireTime) {
|
||||
this.expireTime = expireTime;
|
||||
}
|
||||
|
||||
public String getUuid() {
|
||||
return uuid;
|
||||
}
|
||||
|
||||
public void setUuid(String uuid) {
|
||||
this.uuid = uuid;
|
||||
}
|
||||
}
|
96
app/src/main/java/com/dahe/examine/bean/CompanyBean.java
Normal file
@ -0,0 +1,96 @@
|
||||
package com.dahe.examine.bean;
|
||||
|
||||
import com.contrarywind.interfaces.IPickerViewData;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName CompanyBean
|
||||
* @Author 用户
|
||||
* @Date 2022/1/15 9:05
|
||||
* @Description TODO
|
||||
*/
|
||||
public class CompanyBean implements Serializable , IPickerViewData {
|
||||
private String searchValue;
|
||||
private String createTime;
|
||||
private String deptName;
|
||||
private String phone;
|
||||
private String parentId;
|
||||
private String deptId;
|
||||
private String signName;
|
||||
private String sign;
|
||||
|
||||
|
||||
public String getSignName() {
|
||||
return signName;
|
||||
}
|
||||
|
||||
public void setSignName(String signName) {
|
||||
this.signName = signName;
|
||||
}
|
||||
|
||||
public String getSign() {
|
||||
return sign;
|
||||
}
|
||||
|
||||
public void setSign(String sign) {
|
||||
this.sign = sign;
|
||||
}
|
||||
|
||||
public CompanyBean(String signName) {
|
||||
this.signName = signName;
|
||||
}
|
||||
|
||||
public String getSearchValue() {
|
||||
return searchValue;
|
||||
}
|
||||
|
||||
public void setSearchValue(String searchValue) {
|
||||
this.searchValue = searchValue;
|
||||
}
|
||||
|
||||
public String getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(String createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getDeptName() {
|
||||
return deptName;
|
||||
}
|
||||
|
||||
public void setDeptName(String deptName) {
|
||||
this.deptName = deptName;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setParentId(String parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public String getDeptId() {
|
||||
return deptId;
|
||||
}
|
||||
|
||||
public void setDeptId(String deptId) {
|
||||
this.deptId = deptId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPickerViewText() {
|
||||
return signName;
|
||||
}
|
||||
}
|
55
app/src/main/java/com/dahe/examine/bean/CompanyTypeBean.java
Normal file
@ -0,0 +1,55 @@
|
||||
package com.dahe.examine.bean;
|
||||
|
||||
import com.contrarywind.interfaces.IPickerViewData;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName CompanyBean
|
||||
* @Author 用户
|
||||
* @Date 2022/1/15 9:05
|
||||
* @Description TODO
|
||||
*/
|
||||
public class CompanyTypeBean implements Serializable , IPickerViewData {
|
||||
private String enterpriseTypeValue;
|
||||
private String sign;
|
||||
private String typeId;
|
||||
private String enterpriseTypeName;
|
||||
|
||||
public String getEnterpriseTypeValue() {
|
||||
return enterpriseTypeValue;
|
||||
}
|
||||
|
||||
public void setEnterpriseTypeValue(String enterpriseTypeValue) {
|
||||
this.enterpriseTypeValue = enterpriseTypeValue;
|
||||
}
|
||||
|
||||
public String getSign() {
|
||||
return sign;
|
||||
}
|
||||
|
||||
public void setSign(String sign) {
|
||||
this.sign = sign;
|
||||
}
|
||||
|
||||
public String getTypeId() {
|
||||
return typeId;
|
||||
}
|
||||
|
||||
public void setTypeId(String typeId) {
|
||||
this.typeId = typeId;
|
||||
}
|
||||
|
||||
public String getEnterpriseTypeName() {
|
||||
return enterpriseTypeName;
|
||||
}
|
||||
|
||||
public void setEnterpriseTypeName(String enterpriseTypeName) {
|
||||
this.enterpriseTypeName = enterpriseTypeName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPickerViewText() {
|
||||
return enterpriseTypeName;
|
||||
}
|
||||
}
|
159
app/src/main/java/com/dahe/examine/bean/CountBean.java
Normal file
@ -0,0 +1,159 @@
|
||||
package com.dahe.examine.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName CountBean
|
||||
* @Author 用户
|
||||
* @Date 2022/1/17 17:36
|
||||
* @Description TODO
|
||||
*/
|
||||
public class CountBean implements Serializable {
|
||||
private String requiredNum;
|
||||
private String passesNum;
|
||||
private String notUsed;
|
||||
private String notUsedNumber;
|
||||
private String numberOfPasses;
|
||||
private String passNoNumber;
|
||||
|
||||
private String passNoNumberSF;
|
||||
private String passNoNumberMF;
|
||||
private String notUsedNumberMF;
|
||||
private String notUsedNumberSF;
|
||||
private String numberOfPassesMF;
|
||||
private String numberOfPassesSF;
|
||||
|
||||
|
||||
private String requiredNumMF;
|
||||
private String requiredNumSF;
|
||||
private String passesNumMF;
|
||||
private String passesNumSF;
|
||||
|
||||
public String getRequiredNumMF() {
|
||||
return requiredNumMF;
|
||||
}
|
||||
|
||||
public void setRequiredNumMF(String requiredNumMF) {
|
||||
this.requiredNumMF = requiredNumMF;
|
||||
}
|
||||
|
||||
public String getRequiredNumSF() {
|
||||
return requiredNumSF;
|
||||
}
|
||||
|
||||
public void setRequiredNumSF(String requiredNumSF) {
|
||||
this.requiredNumSF = requiredNumSF;
|
||||
}
|
||||
|
||||
public String getPassesNumMF() {
|
||||
return passesNumMF;
|
||||
}
|
||||
|
||||
public void setPassesNumMF(String passesNumMF) {
|
||||
this.passesNumMF = passesNumMF;
|
||||
}
|
||||
|
||||
public String getPassesNumSF() {
|
||||
return passesNumSF;
|
||||
}
|
||||
|
||||
public void setPassesNumSF(String passesNumSF) {
|
||||
this.passesNumSF = passesNumSF;
|
||||
}
|
||||
|
||||
public String getNotUsedNumber() {
|
||||
return notUsedNumber;
|
||||
}
|
||||
|
||||
public void setNotUsedNumber(String notUsedNumber) {
|
||||
this.notUsedNumber = notUsedNumber;
|
||||
}
|
||||
|
||||
public String getPassNoNumberSF() {
|
||||
return passNoNumberSF;
|
||||
}
|
||||
|
||||
public void setPassNoNumberSF(String passNoNumberSF) {
|
||||
this.passNoNumberSF = passNoNumberSF;
|
||||
}
|
||||
|
||||
public String getPassNoNumberMF() {
|
||||
return passNoNumberMF;
|
||||
}
|
||||
|
||||
public void setPassNoNumberMF(String passNoNumberMF) {
|
||||
this.passNoNumberMF = passNoNumberMF;
|
||||
}
|
||||
|
||||
public String getNotUsedNumberMF() {
|
||||
return notUsedNumberMF;
|
||||
}
|
||||
|
||||
public void setNotUsedNumberMF(String notUsedNumberMF) {
|
||||
this.notUsedNumberMF = notUsedNumberMF;
|
||||
}
|
||||
|
||||
public String getNotUsedNumberSF() {
|
||||
return notUsedNumberSF;
|
||||
}
|
||||
|
||||
public void setNotUsedNumberSF(String notUsedNumberSF) {
|
||||
this.notUsedNumberSF = notUsedNumberSF;
|
||||
}
|
||||
|
||||
public String getNumberOfPassesMF() {
|
||||
return numberOfPassesMF;
|
||||
}
|
||||
|
||||
public void setNumberOfPassesMF(String numberOfPassesMF) {
|
||||
this.numberOfPassesMF = numberOfPassesMF;
|
||||
}
|
||||
|
||||
public String getNumberOfPassesSF() {
|
||||
return numberOfPassesSF;
|
||||
}
|
||||
|
||||
public void setNumberOfPassesSF(String numberOfPassesSF) {
|
||||
this.numberOfPassesSF = numberOfPassesSF;
|
||||
}
|
||||
|
||||
public String getPassNoNumber() {
|
||||
return passNoNumber;
|
||||
}
|
||||
|
||||
public void setPassNoNumber(String passNoNumber) {
|
||||
this.passNoNumber = passNoNumber;
|
||||
}
|
||||
|
||||
public String getNumberOfPasses() {
|
||||
return numberOfPasses;
|
||||
}
|
||||
|
||||
public void setNumberOfPasses(String numberOfPasses) {
|
||||
this.numberOfPasses = numberOfPasses;
|
||||
}
|
||||
|
||||
public String getNotUsed() {
|
||||
return notUsed;
|
||||
}
|
||||
|
||||
public void setNotUsed(String notUsed) {
|
||||
this.notUsed = notUsed;
|
||||
}
|
||||
|
||||
public String getRequiredNum() {
|
||||
return requiredNum;
|
||||
}
|
||||
|
||||
public void setRequiredNum(String requiredNum) {
|
||||
this.requiredNum = requiredNum;
|
||||
}
|
||||
|
||||
public String getPassesNum() {
|
||||
return passesNum;
|
||||
}
|
||||
|
||||
public void setPassesNum(String passesNum) {
|
||||
this.passesNum = passesNum;
|
||||
}
|
||||
}
|
76
app/src/main/java/com/dahe/examine/bean/JsonBean.java
Normal file
@ -0,0 +1,76 @@
|
||||
package com.dahe.examine.bean;
|
||||
|
||||
|
||||
import com.contrarywind.interfaces.IPickerViewData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* TODO<json数据源>
|
||||
*
|
||||
* @author: 小嵩
|
||||
* @date: 2017/3/16 15:36
|
||||
*/
|
||||
|
||||
public class JsonBean implements IPickerViewData {
|
||||
|
||||
|
||||
/**
|
||||
* name : 省份
|
||||
* city : [{"name":"北京市","area":["东城区","西城区","崇文区","宣武区","朝阳区"]}]
|
||||
*/
|
||||
|
||||
private String name;
|
||||
private List<CityBean> city;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public List<CityBean> getCityList() {
|
||||
return city;
|
||||
}
|
||||
|
||||
public void setCityList(List<CityBean> city) {
|
||||
this.city = city;
|
||||
}
|
||||
|
||||
// 实现 IPickerViewData 接口,
|
||||
// 这个用来显示在PickerView上面的字符串,
|
||||
// PickerView会通过IPickerViewData获取getPickerViewText方法显示出来。
|
||||
@Override
|
||||
public String getPickerViewText() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
|
||||
public static class CityBean {
|
||||
/**
|
||||
* name : 城市
|
||||
* area : ["东城区","西城区","崇文区","昌平区"]
|
||||
*/
|
||||
|
||||
private String name;
|
||||
private List<String> area;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public List<String> getArea() {
|
||||
return area;
|
||||
}
|
||||
|
||||
public void setArea(List<String> area) {
|
||||
this.area = area;
|
||||
}
|
||||
}
|
||||
}
|
14
app/src/main/java/com/dahe/examine/bean/LogBean.kt
Normal file
@ -0,0 +1,14 @@
|
||||
package com.dahe.examine.bean
|
||||
|
||||
/**
|
||||
* @ClassName LogBean
|
||||
* @Author 用户
|
||||
* @Date 2022/1/17 15:18
|
||||
* @Description TODO
|
||||
*/
|
||||
data class LogBean(
|
||||
var username: String = "",
|
||||
var password: String = "",
|
||||
var code: String = "",
|
||||
var uuid: String = "",
|
||||
)
|
175
app/src/main/java/com/dahe/examine/bean/PassBean.java
Normal file
@ -0,0 +1,175 @@
|
||||
package com.dahe.examine.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @ClassName PassBean
|
||||
* @Author 用户
|
||||
* @Date 2022/1/15 10:01
|
||||
* @Description TODO
|
||||
*/
|
||||
public class PassBean implements Serializable {
|
||||
private String useStartTime;
|
||||
private String useEndTime;
|
||||
private String passNo;
|
||||
private String vehicle;
|
||||
private String transportTonnage;
|
||||
private String itemType;
|
||||
private String itemTypeName;
|
||||
private String driverName;
|
||||
private String driverPhone;
|
||||
private String startPoint;
|
||||
private String endPoint;
|
||||
private String createTime;
|
||||
private String startTime;
|
||||
private String endTime;
|
||||
private String remarks;
|
||||
private int passNoNumber;
|
||||
private int numberOfPasses;
|
||||
private int numberOfPassesRequired;
|
||||
|
||||
|
||||
public int getNumberOfPasses() {
|
||||
return numberOfPasses;
|
||||
}
|
||||
|
||||
public void setNumberOfPasses(int numberOfPasses) {
|
||||
this.numberOfPasses = numberOfPasses;
|
||||
}
|
||||
|
||||
public int getNumberOfPassesRequired() {
|
||||
return numberOfPassesRequired;
|
||||
}
|
||||
|
||||
public void setNumberOfPassesRequired(int numberOfPassesRequired) {
|
||||
this.numberOfPassesRequired = numberOfPassesRequired;
|
||||
}
|
||||
|
||||
public String getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(String startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public String getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(String endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public String getRemarks() {
|
||||
return remarks;
|
||||
}
|
||||
|
||||
public void setRemarks(String remarks) {
|
||||
this.remarks = remarks;
|
||||
}
|
||||
|
||||
public int getPassNoNumber() {
|
||||
return passNoNumber;
|
||||
}
|
||||
|
||||
public void setPassNoNumber(int passNoNumber) {
|
||||
this.passNoNumber = passNoNumber;
|
||||
}
|
||||
|
||||
public String getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(String createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public String getUseStartTime() {
|
||||
return useStartTime;
|
||||
}
|
||||
|
||||
public void setUseStartTime(String useStartTime) {
|
||||
this.useStartTime = useStartTime;
|
||||
}
|
||||
|
||||
public String getUseEndTime() {
|
||||
return useEndTime;
|
||||
}
|
||||
|
||||
public void setUseEndTime(String useEndTime) {
|
||||
this.useEndTime = useEndTime;
|
||||
}
|
||||
|
||||
public String getPassNo() {
|
||||
return passNo;
|
||||
}
|
||||
|
||||
public void setPassNo(String passNo) {
|
||||
this.passNo = passNo;
|
||||
}
|
||||
|
||||
public String getVehicle() {
|
||||
return vehicle;
|
||||
}
|
||||
|
||||
public void setVehicle(String vehicle) {
|
||||
this.vehicle = vehicle;
|
||||
}
|
||||
|
||||
public String getTransportTonnage() {
|
||||
return transportTonnage;
|
||||
}
|
||||
|
||||
public void setTransportTonnage(String transportTonnage) {
|
||||
this.transportTonnage = transportTonnage;
|
||||
}
|
||||
|
||||
public String getItemType() {
|
||||
return itemType;
|
||||
}
|
||||
|
||||
public void setItemType(String itemType) {
|
||||
this.itemType = itemType;
|
||||
}
|
||||
|
||||
public String getItemTypeName() {
|
||||
return itemTypeName;
|
||||
}
|
||||
|
||||
public void setItemTypeName(String itemTypeName) {
|
||||
this.itemTypeName = itemTypeName;
|
||||
}
|
||||
|
||||
public String getDriverName() {
|
||||
return driverName;
|
||||
}
|
||||
|
||||
public void setDriverName(String driverName) {
|
||||
this.driverName = driverName;
|
||||
}
|
||||
|
||||
public String getDriverPhone() {
|
||||
return driverPhone;
|
||||
}
|
||||
|
||||
public void setDriverPhone(String driverPhone) {
|
||||
this.driverPhone = driverPhone;
|
||||
}
|
||||
|
||||
public String getStartPoint() {
|
||||
return startPoint;
|
||||
}
|
||||
|
||||
public void setStartPoint(String startPoint) {
|
||||
this.startPoint = startPoint;
|
||||
}
|
||||
|
||||
public String getEndPoint() {
|
||||
return endPoint;
|
||||
}
|
||||
|
||||
public void setEndPoint(String endPoint) {
|
||||
this.endPoint = endPoint;
|
||||
}
|
||||
}
|
30
app/src/main/java/com/dahe/examine/bean/TabBean.java
Normal file
@ -0,0 +1,30 @@
|
||||
package com.dahe.examine.bean;
|
||||
|
||||
import com.flyco.tablayout.listener.CustomTabEntity;
|
||||
|
||||
public class TabBean implements CustomTabEntity {
|
||||
public String title;
|
||||
public int selectedIcon;
|
||||
public int unSelectedIcon;
|
||||
|
||||
public TabBean(String title, int selectedIcon, int unSelectedIcon) {
|
||||
this.title = title;
|
||||
this.selectedIcon = selectedIcon;
|
||||
this.unSelectedIcon = unSelectedIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTabTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTabSelectedIcon() {
|
||||
return selectedIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTabUnselectedIcon() {
|
||||
return unSelectedIcon;
|
||||
}
|
||||
}
|
159
app/src/main/java/com/dahe/examine/bean/UserBean.java
Normal file
@ -0,0 +1,159 @@
|
||||
package com.dahe.examine.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class UserBean implements Serializable {
|
||||
|
||||
|
||||
/**
|
||||
* userInfo : {"searchValue":null,"createBy":null,"createTime":"2021-03-23 08:49:38","updateBy":null,"updateTime":"2021-04-17 09:34:43","remark":null,"params":{},"driverId":4,"driverName":"高汉生","openid":"123","driverStatus":0,"driverPhone":"15544857669","linkCarNum":6,"cardPicture1":"http://tms.dahehuodongbao.com:8082/profile/upload/2021-04-14/2803ed65-9f33-40bd-b602-c806e968cd9c.jpg","nationality":null,"unionid":null,"cardPicture2":"http://tms.dahehuodongbao.com:8082/profile/upload/2021-04-14/252bf359-b700-4147-8d40-708f1cb7d3fe.jpg","nickName":null,"cardStartDate":null,"sex":null,"cardNo":"411322199004234211","avatarUrl":null,"cardEndDate":"2023-09-25","address":"河南省郑州市","birth":null,"emergencyContact":"李四","pwd":"","emergencyContactPhone":"15864564659","freighterId":9,"drivingLicence":"411322199004234211","driverPicture":"http://tms.dahehuodongbao.com:8082/profile/upload/2021-03-29/a00afac2-1db2-42ee-b8d5-2b67c4606249.jpg","roadNvqPicture":"http://tms.dahehuodongbao.com:8082/profile/upload/2021-03-29/6117fd64-9944-42be-991d-3156fff6db3f.jpg","roadNvqStartDate":null,"roadNvqEndDate":"2021-03-31","drivingStartDate":null,"drivingEndDate":"2030-11-21","liabilityPicture":"http://tms.dahehuodongbao.com:8082/profile/upload/2021-03-29/cc0a4859-c651-45e6-88b8-018edf59bcc8.jpg","roadNvqNo":"467496461646464","drivingLicenceType":"C1","provinceId":3,"provinceName":"安徽","cityId":37,"cityName":"蚌埠","licenceIssuingAuthority":"北京市公安局公安交通管理局","countyId":412,"countyName":"郊区","drivingLicencePicture1":"http://tms.dahehuodongbao.com:8082/profile/upload/2021-04-14/41efd845-ea98-4045-8cbe-fc4904b2480d.jpg","drivingLicencePicture2":"http://tms.dahehuodongbao.com:8082/profile/upload/2021-04-14/cf5f7933-7f85-4d90-9222-27c85d960fd6.jpg","roadLongTerm":1}
|
||||
* token : eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJkcml2ZXJfNCIsImV4cCI6MTYxOTUwNjE0MX0.QSi8cXQiejbC3q0jPwj9ATO4S9qoRONjyMZaeIA9LhM
|
||||
*/
|
||||
|
||||
private UserInfoBean userInfo;
|
||||
private String token;
|
||||
|
||||
|
||||
public UserInfoBean getUserInfo() {
|
||||
return userInfo;
|
||||
}
|
||||
|
||||
public void setUserInfo(UserInfoBean userInfo) {
|
||||
this.userInfo = userInfo;
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public static class UserInfoBean {
|
||||
/**
|
||||
* searchValue : null
|
||||
* createBy : null
|
||||
* createTime : 2021-03-23 08:49:38
|
||||
* updateBy : null
|
||||
* updateTime : 2021-04-17 09:34:43
|
||||
* remark : null
|
||||
* params : {}
|
||||
* driverId : 4
|
||||
* driverName : 高汉生
|
||||
* openid : 123
|
||||
* driverStatus : 0
|
||||
* driverPhone : 15544857669
|
||||
* linkCarNum : 6
|
||||
* cardPicture1 : http://tms.dahehuodongbao.com:8082/profile/upload/2021-04-14/2803ed65-9f33-40bd-b602-c806e968cd9c.jpg
|
||||
* nationality : null
|
||||
* unionid : null
|
||||
* cardPicture2 : http://tms.dahehuodongbao.com:8082/profile/upload/2021-04-14/252bf359-b700-4147-8d40-708f1cb7d3fe.jpg
|
||||
* nickName : null
|
||||
* cardStartDate : null
|
||||
* sex : null
|
||||
* cardNo : 411322199004234211
|
||||
* avatarUrl : null
|
||||
* cardEndDate : 2023-09-25
|
||||
* address : 河南省郑州市
|
||||
* birth : null
|
||||
* emergencyContact : 李四
|
||||
* pwd :
|
||||
* emergencyContactPhone : 15864564659
|
||||
* freighterId : 9
|
||||
* drivingLicence : 411322199004234211
|
||||
* driverPicture : http://tms.dahehuodongbao.com:8082/profile/upload/2021-03-29/a00afac2-1db2-42ee-b8d5-2b67c4606249.jpg
|
||||
* roadNvqPicture : http://tms.dahehuodongbao.com:8082/profile/upload/2021-03-29/6117fd64-9944-42be-991d-3156fff6db3f.jpg
|
||||
* roadNvqStartDate : null
|
||||
* roadNvqEndDate : 2021-03-31
|
||||
* drivingStartDate : null
|
||||
* drivingEndDate : 2030-11-21
|
||||
* liabilityPicture : http://tms.dahehuodongbao.com:8082/profile/upload/2021-03-29/cc0a4859-c651-45e6-88b8-018edf59bcc8.jpg
|
||||
* roadNvqNo : 467496461646464
|
||||
* drivingLicenceType : C1
|
||||
* provinceId : 3
|
||||
* provinceName : 安徽
|
||||
* cityId : 37
|
||||
* cityName : 蚌埠
|
||||
* licenceIssuingAuthority : 北京市公安局公安交通管理局
|
||||
* countyId : 412
|
||||
* countyName : 郊区
|
||||
* drivingLicencePicture1 : http://tms.dahehuodongbao.com:8082/profile/upload/2021-04-14/41efd845-ea98-4045-8cbe-fc4904b2480d.jpg
|
||||
* drivingLicencePicture2 : http://tms.dahehuodongbao.com:8082/profile/upload/2021-04-14/cf5f7933-7f85-4d90-9222-27c85d960fd6.jpg
|
||||
* roadLongTerm : 1
|
||||
*/
|
||||
|
||||
private String enterpriseName;
|
||||
private String name;
|
||||
private String userId;
|
||||
private String phone;
|
||||
private String signName;
|
||||
private String phonenumber;
|
||||
private String userName;
|
||||
private String sign;
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getSignName() {
|
||||
return signName;
|
||||
}
|
||||
|
||||
public void setSignName(String signName) {
|
||||
this.signName = signName;
|
||||
}
|
||||
|
||||
public String getPhonenumber() {
|
||||
return phonenumber;
|
||||
}
|
||||
|
||||
public void setPhonenumber(String phonenumber) {
|
||||
this.phonenumber = phonenumber;
|
||||
}
|
||||
|
||||
public String getSign() {
|
||||
return sign;
|
||||
}
|
||||
|
||||
public void setSign(String sign) {
|
||||
this.sign = sign;
|
||||
}
|
||||
|
||||
public String getEnterpriseName() {
|
||||
return enterpriseName;
|
||||
}
|
||||
|
||||
public void setEnterpriseName(String enterpriseName) {
|
||||
this.enterpriseName = enterpriseName;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
}
|
||||
}
|
42
app/src/main/java/com/dahe/examine/bean/UserBean2.java
Normal file
@ -0,0 +1,42 @@
|
||||
package com.dahe.examine.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @ClassName UserBean2
|
||||
* @Author 用户
|
||||
* @Date 2022/1/18 10:37
|
||||
* @Description TODO
|
||||
*/
|
||||
public class UserBean2 implements Serializable {
|
||||
|
||||
private List<String> permissions;
|
||||
private List<String> roles;
|
||||
private UserBean.UserInfoBean user;
|
||||
|
||||
public List<String> getPermissions() {
|
||||
return permissions;
|
||||
}
|
||||
|
||||
public void setPermissions(List<String> permissions) {
|
||||
this.permissions = permissions;
|
||||
}
|
||||
|
||||
public List<String> getRoles() {
|
||||
return roles;
|
||||
}
|
||||
|
||||
public void setRoles(List<String> roles) {
|
||||
this.roles = roles;
|
||||
}
|
||||
|
||||
public UserBean.UserInfoBean getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(UserBean.UserInfoBean user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
}
|
109
app/src/main/java/com/dahe/examine/cuspop/SelectTimePopup.kt
Normal file
@ -0,0 +1,109 @@
|
||||
package com.dahe.dispatch.cuspop
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.text.TextUtils
|
||||
import android.util.Log
|
||||
import android.widget.TextView
|
||||
import com.bigkoo.pickerview.builder.TimePickerBuilder
|
||||
import com.dahe.mylibrary.utils.TimeUtil
|
||||
import com.dahe.examine.R
|
||||
import com.lxj.xpopup.core.BottomPopupView
|
||||
import com.lxj.xpopup.util.XPopupUtils
|
||||
import kotlinx.android.synthetic.main.pop_sel_time.view.*
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* Description: 仿知乎底部评论弹窗
|
||||
* Create by dance, at 2018/12/25
|
||||
*/
|
||||
class SelectTimePopup(
|
||||
context: Context,
|
||||
) : BottomPopupView(context) {
|
||||
override fun getImplLayoutId() = R.layout.pop_sel_time
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
|
||||
tvOk.setOnClickListener {
|
||||
if (listener != null) {
|
||||
val startTime = tvStartTime.text.toString()
|
||||
val endTime = tvEndTime.text.toString()
|
||||
listener!!.onItemClick(startTime, endTime)
|
||||
|
||||
dismiss()
|
||||
}
|
||||
}
|
||||
|
||||
tvStartTime.setOnClickListener { setBir(0, tvStartTime) }
|
||||
tvEndTime.setOnClickListener { setBir(1, tvEndTime) }
|
||||
tvCancel.setOnClickListener { dismiss() }
|
||||
}
|
||||
|
||||
//完全可见执行
|
||||
override fun onShow() {
|
||||
super.onShow()
|
||||
Log.e("tag", "知乎评论 onShow")
|
||||
}
|
||||
|
||||
//完全消失执行
|
||||
override fun onDismiss() {
|
||||
Log.e("tag", "知乎评论 onDismiss")
|
||||
}
|
||||
|
||||
override fun getMaxHeight(): Int {
|
||||
return (XPopupUtils.getScreenHeight(context) * .6f).toInt()
|
||||
}
|
||||
|
||||
private var listener: OnMyItemClickListener? = null
|
||||
fun setOnMyItemClickListener(listener: OnMyItemClickListener?): SelectTimePopup {
|
||||
this.listener = listener
|
||||
return this
|
||||
}
|
||||
|
||||
interface OnMyItemClickListener {
|
||||
fun onItemClick(startTime: String, endTime: String)
|
||||
}
|
||||
|
||||
|
||||
fun setBir(type: Int, view: TextView) {
|
||||
val startDate = Calendar.getInstance()
|
||||
val endtDate = Calendar.getInstance()
|
||||
val currDate = Calendar.getInstance()
|
||||
startDate[1990, 0] = 1
|
||||
endtDate[2100, 0] = 1
|
||||
|
||||
|
||||
if (!TextUtils.isEmpty(view.getText())) {
|
||||
val date = TimeUtil.string2Date(view.getText().toString(),
|
||||
SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()))
|
||||
if (date != null) currDate.time = date
|
||||
}
|
||||
|
||||
|
||||
val pvTime = TimePickerBuilder(
|
||||
context
|
||||
) { date, v -> //选中事件回调
|
||||
// TimeUtil.date2String(date,SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()))
|
||||
val data =
|
||||
TimeUtil.date2String(date, SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()))
|
||||
view.text = data
|
||||
}.setSubmitColor(Color.parseColor("#F1474B")) //确定按钮文字颜色
|
||||
.setCancelColor(Color.parseColor("#F1474B")) //取消按钮文字颜色
|
||||
.setTitleBgColor(Color.parseColor("#FFFFFF"))
|
||||
.setType(booleanArrayOf(true, true, true, false, false, false))
|
||||
.setTitleText(if (0 == type) {
|
||||
"开始时间"
|
||||
} else {
|
||||
"结束时间"
|
||||
})
|
||||
.setDate(currDate)
|
||||
.setRangDate(startDate, endtDate)
|
||||
.isDialog(true)
|
||||
.setBgColor(Color.parseColor("#F5F5F5"))
|
||||
.build()
|
||||
// pvTime.setDate(Calendar.getInstance());//注:根据需求来决定是否使用该方法(一般是精确到秒的情况),此项可以在弹出选择器的时候重新设置当前时间,避免在初始化之后由于时间已经设定,导致选中时间与当前时间不匹配的问题。
|
||||
pvTime.show()
|
||||
}
|
||||
}
|
150
app/src/main/java/com/dahe/examine/net/Api.java
Normal file
@ -0,0 +1,150 @@
|
||||
package com.dahe.examine.net;
|
||||
|
||||
|
||||
import com.dahe.examine.bean.AddresBean;
|
||||
import com.dahe.examine.bean.ChangePwdBean;
|
||||
import com.dahe.examine.bean.CheckCodeBean;
|
||||
import com.dahe.examine.bean.CountBean;
|
||||
import com.dahe.examine.bean.LogBean;
|
||||
import com.dahe.examine.bean.UserBean2;
|
||||
import com.dahe.mylibrary.net.CommonResponseBean;
|
||||
import com.dahe.mylibrary.net.PagerBean;
|
||||
import com.dahe.examine.BuildConfig;
|
||||
import com.dahe.examine.bean.ApplyBean;
|
||||
import com.dahe.examine.bean.ApplySendBean;
|
||||
import com.dahe.examine.bean.BusInfoBean;
|
||||
import com.dahe.examine.bean.CompanyBean;
|
||||
import com.dahe.examine.bean.CompanyTypeBean;
|
||||
import com.dahe.examine.bean.PassBean;
|
||||
import com.dahe.examine.bean.UserBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.PUT;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2018/8/8 0008.
|
||||
*/
|
||||
|
||||
public interface Api {
|
||||
|
||||
// String BASE_URL = "https://tmstest.dahehuoyun.com/";
|
||||
String BASE_URL = BuildConfig.BASE_URL;
|
||||
|
||||
|
||||
//获取版本
|
||||
String VERSION = BASE_URL + "app/version";
|
||||
|
||||
|
||||
|
||||
@POST(BASE_URL+"user/login")
|
||||
Observable<CommonResponseBean<UserBean>> log(@Query("phone") String phone,@Query("pwd") String pwd);
|
||||
|
||||
@GET(BASE_URL+"app/captchaImage")
|
||||
Observable<CommonResponseBean<CheckCodeBean>> captchaImage();
|
||||
|
||||
|
||||
@POST(BASE_URL+"app/login")
|
||||
Observable<CommonResponseBean<UserBean>> log2(@Body LogBean logBean);
|
||||
|
||||
@GET(BASE_URL+"app/getInfo")
|
||||
Observable<CommonResponseBean<UserBean2>> getInfo();
|
||||
|
||||
|
||||
|
||||
@GET(BASE_URL+"app/apple/list")
|
||||
Observable<CommonResponseBean<PagerBean<ApplyBean>>> appleList(@Query("status") String status);
|
||||
|
||||
|
||||
|
||||
@GET(BASE_URL+"app/apple/count")
|
||||
Observable<CommonResponseBean<CountBean>> count();
|
||||
|
||||
@GET(BASE_URL+"app/apple/history/count")
|
||||
Observable<CommonResponseBean<CountBean>> historyCount();
|
||||
|
||||
@GET(BASE_URL+"app/apple/history/list")
|
||||
Observable<CommonResponseBean<PagerBean<ApplyBean>>> historyList();
|
||||
|
||||
@POST(BASE_URL+"app/apple/edit")
|
||||
Observable<CommonResponseBean> appleEdit(@Body ApplyBean bean);
|
||||
|
||||
@GET(BASE_URL+"app/user")
|
||||
Observable<CommonResponseBean<AddresBean>> appUser(@Query("userId") String userId);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@GET(BASE_URL+"app/pass/use/list")
|
||||
Observable<CommonResponseBean<PagerBean<ApplyBean>>> useList(@Query("useDate") String useDate);
|
||||
|
||||
@GET(BASE_URL+"app/pass/use/detail/list")
|
||||
Observable<CommonResponseBean<PagerBean<ApplyBean>>> detailList(@Query("userId") String userId,@Query("chargeType") String chargeType,@Query("useDate") String useDate);
|
||||
|
||||
|
||||
|
||||
@GET(BASE_URL+"app/pass/use/count")
|
||||
Observable<CommonResponseBean<CountBean>> useCount(@Query("userId") String userId,@Query("useDate") String useDate);
|
||||
|
||||
@GET(BASE_URL+"app/pass/use/not/list")
|
||||
Observable<CommonResponseBean<List<ApplyBean>>> notList();
|
||||
|
||||
|
||||
@PUT(BASE_URL+"app/resetPwd")
|
||||
Observable<CommonResponseBean> changePwd(@Body ChangePwdBean bean);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@POST(BASE_URL+"user/getSmsCode")
|
||||
Observable<CommonResponseBean> getSmsCode(@Query("phone") String phone);
|
||||
|
||||
@POST(BASE_URL+"user/register")
|
||||
Observable<CommonResponseBean> register(@Body BusInfoBean bean);
|
||||
|
||||
@POST(BASE_URL+"apply/list")
|
||||
Observable<CommonResponseBean<PagerBean<ApplyBean>>> applyList(@Query("updateStartTime") String updateStartTime, @Query("updateEndTime") String updateEndTime);
|
||||
|
||||
|
||||
@POST(BASE_URL+"apply/approval/company/list")
|
||||
Observable<CommonResponseBean<List<CompanyBean>>> companyLst();
|
||||
|
||||
@POST(BASE_URL+"apply/enterprise/type/list")
|
||||
Observable<CommonResponseBean<List<CompanyTypeBean>>> typeLst(@Query("sign") String sign);
|
||||
|
||||
@POST(BASE_URL+"use/of/pass/add")
|
||||
Observable<CommonResponseBean> addPass(@Body PassBean passBean);
|
||||
|
||||
|
||||
@POST(BASE_URL+"use/of/pass/list")
|
||||
Observable<CommonResponseBean<PagerBean<PassBean>>> passList();
|
||||
|
||||
|
||||
@POST(BASE_URL+"use/of/pass/count")
|
||||
Observable<CommonResponseBean<PassBean>> passCount();
|
||||
|
||||
@POST(BASE_URL+"apply/count")
|
||||
Observable<CommonResponseBean<PassBean>> applyCount();
|
||||
|
||||
@POST(BASE_URL+"user/phone/edit")
|
||||
Observable<CommonResponseBean> phoneEdit(@Query("phone") String phone,@Query("code") String code);
|
||||
|
||||
@POST(BASE_URL+"user/resetPwd")
|
||||
Observable<CommonResponseBean> resetPwd(@Query("phone") String phone,@Query("pwd") String pwd,@Query("code") String code);
|
||||
|
||||
|
||||
@POST(BASE_URL+"apply/send")
|
||||
Observable<CommonResponseBean> applySend(@Body ApplySendBean passBean);
|
||||
|
||||
}
|
||||
|
60
app/src/main/java/com/dahe/examine/net/BaseObserver.java
Normal file
@ -0,0 +1,60 @@
|
||||
package com.dahe.examine.net;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.dahe.mylibrary.net.CommonResponseBean;
|
||||
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
|
||||
|
||||
/**
|
||||
* 自定义观察者
|
||||
*/
|
||||
|
||||
public class BaseObserver<T> implements Observer<CommonResponseBean<T>> {
|
||||
private Context mContext;
|
||||
private RxHttpCallBack<T> mRxHttpCallBack;
|
||||
private Disposable disposable;
|
||||
|
||||
public BaseObserver(Context mContext, RxHttpCallBack<T> mRxHttpCallBack) {
|
||||
this.mContext = mContext;
|
||||
this.mRxHttpCallBack = mRxHttpCallBack;
|
||||
}
|
||||
|
||||
/**
|
||||
* 订阅成功
|
||||
*
|
||||
* @param d
|
||||
*/
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
this.disposable = d;
|
||||
mRxHttpCallBack.onStart();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onNext(CommonResponseBean<T> tCommonResponseBean) {
|
||||
if (200==tCommonResponseBean.getCode()) {
|
||||
mRxHttpCallBack.onSuccess(tCommonResponseBean);
|
||||
} else {
|
||||
mRxHttpCallBack.onCodeError(mContext, tCommonResponseBean);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
mRxHttpCallBack.onFailure(mContext, e);
|
||||
if (disposable!=null&&disposable.isDisposed()){
|
||||
disposable.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
|
||||
}
|
161
app/src/main/java/com/dahe/examine/net/CreateJsonUtils.java
Normal file
@ -0,0 +1,161 @@
|
||||
package com.dahe.examine.net;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.dahe.mylibrary.net.JsonUtils;
|
||||
import com.dahe.mylibrary.utils.MD5Utils;
|
||||
import com.dahe.mylibrary.utils.StringUtils;
|
||||
import com.dahe.mylibrary.utils.TimeUtil;
|
||||
import com.google.gson.Gson;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2017/4/15 0015.
|
||||
*/
|
||||
|
||||
public class CreateJsonUtils {
|
||||
public static CreateJsonUtils utils = null;
|
||||
private static final String TAG = "GetJsonUtils";
|
||||
|
||||
public static CreateJsonUtils getInstance() {
|
||||
if (null == utils) {
|
||||
synchronized (CreateJsonUtils.class) {
|
||||
if (null == utils) {
|
||||
utils = new CreateJsonUtils();
|
||||
}
|
||||
}
|
||||
}
|
||||
return utils;
|
||||
}
|
||||
|
||||
/**
|
||||
* 得到请求体的json数据
|
||||
*
|
||||
* @param key jsonObject的key
|
||||
* @param value jsonObject的value 如果要请求jsonObject里面嵌套jsonObject的value只需要传map 否就传简单的数据类型
|
||||
* @return
|
||||
*/
|
||||
public String getRequest(String[] key, Object[] value) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
for (int i = 0; i < key.length; i++) {
|
||||
if (value[i] instanceof Map) {
|
||||
Map<Object, Object> sonMap = new HashMap<>();
|
||||
Map<Object, Object> sonDateMap = (Map<Object, Object>) value[i];
|
||||
List<String> keyList = getMapKey(sonDateMap);
|
||||
for (int j = 0; j < keyList.size(); j++) {
|
||||
sonMap.put(keyList.get(j), sonDateMap.get(keyList.get(j)));
|
||||
}
|
||||
map.put(key[i], sonMap);
|
||||
} else if (value[i] instanceof List) {
|
||||
map.put(key[i], value[i]);
|
||||
} else if (value[i] instanceof String) {
|
||||
map.put(key[i], value[i].toString());
|
||||
} else {
|
||||
map.put(key[i], value[i]);
|
||||
}
|
||||
}
|
||||
map.put("api_key", "xccdb-power-bank");
|
||||
map.put("sign", MD5Utils.md5(JsonUtils.getInstance().getGson().toJson(map)));
|
||||
map.put("time", TimeUtil.getNowMills());
|
||||
Log.i(TAG, new Gson().toJson(map));
|
||||
return new Gson().toJson(map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取map里面的所有值
|
||||
*
|
||||
* @param hashmp
|
||||
* @return
|
||||
*/
|
||||
public List<String> getMapKey(Map hashmp) {
|
||||
List<String> list = new ArrayList<>();
|
||||
Set set = hashmp.keySet();
|
||||
Iterator iter = set.iterator();
|
||||
while (iter.hasNext()) {
|
||||
String key = (String) iter.next();
|
||||
list.add(key);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
public Map<String, Integer> getPagerMap(int page, int count) {
|
||||
Map<String, Integer> map = new HashMap<>();
|
||||
map.put("page", page);
|
||||
map.put("count", count);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 无参数的请求
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Map<String, RequestBody> createRequestBody() {
|
||||
return createRequestBody(new String[]{}, new String[]{});
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成请求的body
|
||||
*
|
||||
* @param key
|
||||
* @param value
|
||||
* @return
|
||||
*/
|
||||
public Map<String, RequestBody> createRequestBody(String[] key, Object[] value) {
|
||||
Map<String, RequestBody> requestBodyMap = new HashMap<>();
|
||||
Map<String, Object> requestDataMap = new HashMap<>();
|
||||
String signStr = "";
|
||||
for (int i = 0; i < key.length; i++) {
|
||||
requestDataMap.put(key[i], value[i]);
|
||||
}
|
||||
try {
|
||||
signStr = (sign1(requestDataMap) + "&api_key=xccdb-power-bank").replaceFirst("&", "");
|
||||
Log.i(TAG, "createRequestBody: " + sign1(requestDataMap));
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
Log.i(TAG, "createRequestBody: " + signStr);
|
||||
for (String keySet : requestDataMap.keySet()) {
|
||||
requestBodyMap.put(keySet, RequestBody.create(MediaType.parse("multipart/form-data"), requestDataMap.get(keySet) + ""));
|
||||
}
|
||||
Log.i(TAG, "createRequestBody: " + MD5Utils.md5((signStr)));
|
||||
requestBodyMap.put("sign", RequestBody.create(MediaType.parse("multipart/form-data"),
|
||||
MD5Utils.md5((signStr))));
|
||||
requestBodyMap.put("time", RequestBody.create(MediaType.parse("multipart/form-data"), TimeUtil.getNowMills() / 1000 + ""));
|
||||
return requestBodyMap;
|
||||
}
|
||||
|
||||
public String sign1(Map params) throws JSONException {
|
||||
JSONObject header = new JSONObject(JsonUtils.getInstance().getGson().toJson(params));
|
||||
//获取header元素集合
|
||||
Iterator headerIt = header.keys();
|
||||
List<String> list = new ArrayList<String>();
|
||||
//把header元素集合迭代 出 "param=value"形式字符串放入list集合中
|
||||
while (headerIt.hasNext()) {
|
||||
String param = headerIt.next().toString();
|
||||
String value = StringUtils.encode(header.getString(param));
|
||||
list.add(param + "=" + value);
|
||||
}
|
||||
Collections.sort(list);
|
||||
String paramStr = "";
|
||||
//迭代list拼装签名sign
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
paramStr += "&" + list.get(i);
|
||||
}
|
||||
String signStr = paramStr;
|
||||
return signStr;
|
||||
}
|
||||
}
|
60
app/src/main/java/com/dahe/examine/net/DataManager.java
Normal file
@ -0,0 +1,60 @@
|
||||
package com.dahe.examine.net;
|
||||
|
||||
|
||||
import com.dahe.mylibrary.CommonBaseLibrary;
|
||||
import com.dahe.mylibrary.net.JsonInterceptor;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import io.reactivex.rxjava3.core.ObservableSource;
|
||||
import io.reactivex.rxjava3.core.ObservableTransformer;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
import okhttp3.OkHttpClient;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2018/8/8 0008.
|
||||
*/
|
||||
|
||||
public class DataManager {
|
||||
private volatile static DataManager mInstance;
|
||||
|
||||
public DataManager() {
|
||||
|
||||
}
|
||||
|
||||
public static <T> ObservableTransformer<T, T> setThread() {
|
||||
return new ObservableTransformer<T, T>() {
|
||||
@Override
|
||||
public ObservableSource<T> apply(Observable<T> upstream) {
|
||||
return upstream.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static Api getInstance() {
|
||||
if (null == mInstance) {
|
||||
synchronized (DataManager.class) {
|
||||
if (null == mInstance) {
|
||||
mInstance = new DataManager();
|
||||
}
|
||||
}
|
||||
}
|
||||
return api();
|
||||
}
|
||||
|
||||
public static Api api() {
|
||||
return CommonBaseLibrary.getRetrofit().newBuilder()
|
||||
.client(new OkHttpClient.Builder()
|
||||
.connectTimeout(30, TimeUnit.SECONDS)
|
||||
.readTimeout(30, TimeUnit.SECONDS)
|
||||
.writeTimeout(30, TimeUnit.SECONDS)
|
||||
.addInterceptor(new JsonInterceptor())
|
||||
.addInterceptor(new RequestHeadInterceptor())
|
||||
.build())
|
||||
// .addNetworkInterceptor(new TokenInterceptor())
|
||||
.build().create(Api.class);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.dahe.examine.net;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.dahe.mylibrary.utils.AppUtils;
|
||||
import com.dahe.mylibrary.utils.BaseUtils;
|
||||
import com.dahe.examine.base.App;
|
||||
import com.dahe.examine.utils.SPUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import okhttp3.Interceptor;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
|
||||
/**
|
||||
* 头部Interceptor
|
||||
*/
|
||||
|
||||
public class RequestHeadInterceptor implements Interceptor {
|
||||
private static final String TAG = "RequestHeadInterceptor";
|
||||
|
||||
@Override
|
||||
public Response intercept(Chain chain) throws IOException {
|
||||
Request.Builder builder = chain.request().newBuilder();
|
||||
if (SPUtils.hasUserInfo(App.getApp())&&!TextUtils.isEmpty(SPUtils.getUserInfo(App.getApp()).getToken())) {
|
||||
// builder.addHeader("Authorization", SPUtils.getUserInfo(App.getApp()).getToken());
|
||||
builder.addHeader("Authorization", "Bearer "+SPUtils.getUserInfo(App.getApp()).getToken());
|
||||
}
|
||||
Request request = builder
|
||||
.addHeader("versionCode", AppUtils.getAppVersionCode() + "")
|
||||
.addHeader("versionValue", AppUtils.getAppVersionName() + "")
|
||||
.addHeader("deviceType", "ANDROID")
|
||||
.addHeader("language", BaseUtils.getLanguage(App.getApp())+"")
|
||||
.build();
|
||||
Log.i(TAG, "intercept: " + request.headers());
|
||||
return chain.proceed(request);
|
||||
}
|
||||
}
|
133
app/src/main/java/com/dahe/examine/net/RxHttpCallBack.java
Normal file
@ -0,0 +1,133 @@
|
||||
package com.dahe.examine.net;
|
||||
|
||||
import android.accounts.NetworkErrorException;
|
||||
import android.app.Activity;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.text.TextUtils;
|
||||
import android.view.Window;
|
||||
|
||||
import com.dahe.dispatch.utils.UserUtils;
|
||||
import com.dahe.mylibrary.net.CommonResponseBean;
|
||||
import com.dahe.mylibrary.net.ResultException;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.dahe.examine.ui.account.LoginActivity;
|
||||
|
||||
import java.net.ConnectException;
|
||||
import java.net.SocketTimeoutException;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
import javax.net.ssl.SSLException;
|
||||
|
||||
/**
|
||||
* 统一的网络回调
|
||||
*/
|
||||
|
||||
public abstract class RxHttpCallBack<T> {
|
||||
private ProgressDialog dialog;
|
||||
|
||||
private void initDialog(Activity activity, String dialogMessage) {
|
||||
dialog = new ProgressDialog(activity);
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.setCanceledOnTouchOutside(false);
|
||||
dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
|
||||
dialog.setMessage(dialogMessage);
|
||||
}
|
||||
|
||||
public RxHttpCallBack(Activity activity, String dialogMessage) {
|
||||
initDialog(activity, TextUtils.isEmpty(dialogMessage) ? "网络请求中......" : dialogMessage);
|
||||
}
|
||||
|
||||
public RxHttpCallBack(Activity activity) {
|
||||
initDialog(activity, "网络请求中......");
|
||||
}
|
||||
|
||||
public RxHttpCallBack() {
|
||||
}
|
||||
|
||||
/**
|
||||
* 订阅成功
|
||||
*/
|
||||
public void onStart() {
|
||||
if (dialog != null && !dialog.isShowing()) {
|
||||
dialog.show();
|
||||
}
|
||||
}
|
||||
|
||||
public void onStop(){
|
||||
if (dialog != null && dialog.isShowing()) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回成功
|
||||
*
|
||||
* @param t
|
||||
* @throws Exception
|
||||
*/
|
||||
public void onSuccess(CommonResponseBean<T> t) {
|
||||
if (dialog != null && dialog.isShowing()) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回成功了,但是code错误
|
||||
*
|
||||
* @param t
|
||||
* @throws Exception
|
||||
*/
|
||||
public void onCodeError(Context mContext, CommonResponseBean<T> t) {
|
||||
if (dialog != null && dialog.isShowing()) {
|
||||
dialog.dismiss();
|
||||
|
||||
}
|
||||
if (t.getCode() == 401) {
|
||||
UserUtils.Companion.getInstance().loginOut(mContext);
|
||||
Intent intent = new Intent(mContext, LoginActivity.class);
|
||||
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
mContext.startActivity(intent);
|
||||
ToastUtils.showToast(mContext,"您的账号再异地登录,请重新登录");
|
||||
}else{
|
||||
ToastUtils.showToast(mContext,t.getMsg());
|
||||
}
|
||||
|
||||
// if (t.getMessage().getMsg_code() == 100 && SPUtils.hasUserInfo(mContext)) {
|
||||
// SPUtils.remove(mContext, SPUtils.USER_INFO_KEY);
|
||||
// } else {
|
||||
// ToastUtils.showToast(mContext, t.getMessage().getMsg_desc());
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回失败
|
||||
*
|
||||
* @param e
|
||||
* @throws Exception
|
||||
*/
|
||||
public void onFailure(Context mContext, Throwable e) {
|
||||
if (dialog != null && dialog.isShowing()) {
|
||||
dialog.dismiss();
|
||||
}
|
||||
if (e instanceof ConnectException
|
||||
|| e instanceof TimeoutException
|
||||
|| e instanceof SocketTimeoutException
|
||||
|| e instanceof SSLException
|
||||
|| e instanceof NetworkErrorException
|
||||
|| e instanceof UnknownHostException) {
|
||||
ToastUtils.showToast(mContext, "请检查您的网络~");
|
||||
} else if (e instanceof ResultException) {
|
||||
e.printStackTrace();
|
||||
//自定义的ResultException
|
||||
//由于返回200,300返回格式不统一的问题,自定义GsonResponseBodyConverter凡是300的直接抛异常
|
||||
// System.out.println("---------errorCode------->"+((ResultException) e).getErrCode());
|
||||
}else if (e instanceof SSLException){
|
||||
ToastUtils.showToast(mContext, "网络连接终端,请检查您的网络~");
|
||||
}else{
|
||||
ToastUtils.showToast(mContext, e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
48
app/src/main/java/com/dahe/examine/net/TokenInterceptor.java
Normal file
@ -0,0 +1,48 @@
|
||||
package com.dahe.examine.net;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import okhttp3.Interceptor;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
import okhttp3.ResponseBody;
|
||||
import okio.Buffer;
|
||||
import okio.BufferedSource;
|
||||
|
||||
public class TokenInterceptor implements Interceptor {
|
||||
@Override
|
||||
public Response intercept(Chain chain) throws IOException {
|
||||
Request request = chain.request();
|
||||
Response response = chain.proceed(request);
|
||||
|
||||
ResponseBody responseBody = response.body();
|
||||
if (responseBody != null) {
|
||||
BufferedSource source = responseBody.source();
|
||||
source.request(Long.MAX_VALUE); // Buffer the entire body.
|
||||
Buffer buffer = source.buffer();
|
||||
try {
|
||||
String result = buffer.clone().readString(StandardCharsets.UTF_8);
|
||||
JSONObject jsonObject = new JSONObject(result);
|
||||
int code = jsonObject.getInt("code");
|
||||
if (code == -1) {//判断返回code
|
||||
|
||||
// SPUtils.cleanUserInfo(App.getApp());
|
||||
// Intent intent = new Intent(App.getApp(), LoginActivity.class);
|
||||
// intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
// App.getApp().startActivity(intent);
|
||||
// ToastUtils.showToast(App.getApp(), "您的账号再异地登录,请重新登录");
|
||||
// ToastUtils.showShort("身份过期,请重新登录");
|
||||
//跳转方式
|
||||
//1.使用MyApplication添加跳转
|
||||
//2.使用路由跳转
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return response;
|
||||
}
|
||||
}
|
24
app/src/main/java/com/dahe/examine/oss/OssConfigBean.java
Normal file
@ -0,0 +1,24 @@
|
||||
package com.dahe.examine.oss;
|
||||
|
||||
/**
|
||||
* @ClassName OssConfigBean
|
||||
* @Author 用户
|
||||
* @Date 2021/9/30 9:11
|
||||
* @Description TODO
|
||||
*/
|
||||
public class OssConfigBean {
|
||||
|
||||
public static final String endpoint = "oss-cn-beijing.aliyuncs.com";
|
||||
public static final String region = "oss-cn-beijing";
|
||||
public static final String accessKeyId = "LTAI4G9uk9zAjuc6GZMB34Tt";
|
||||
public static final String accessKeySecret = "f4MTMbxCKC8JbSdxMdL5dVRG7m8bZo";
|
||||
public static final String bucket = "dh-tms";
|
||||
public static final String BUCKET_OBJECT = "tms/user-cert/";
|
||||
public static final String BUCKET_OBJECT_TEXT = "tms/tms-test/user-cert/";
|
||||
public static final String BUCKET_BASE_URL = "https://dh-tms.oss-cn-beijing.aliyuncs.com/";
|
||||
public static final String BUCKET_BASE_URL_UP = "https://dahehuodongbao.com/";
|
||||
public static final String ARN = "acs:ram::1864711654174879:role/aliyunactiontraildefaultrole";
|
||||
//callback 测试地址
|
||||
public static final String OSS_CALLBACK_URL = "http://oss-demo.aliyuncs.com:23450";
|
||||
// public static final String OSS_CALLBACK_URL = "http://tms.api.test.dahehuodongbao.com:8081/sts/getsts";
|
||||
}
|
342
app/src/main/java/com/dahe/examine/oss/OssServiceUtil.java
Normal file
@ -0,0 +1,342 @@
|
||||
package com.dahe.examine.oss;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.ProgressDialog;
|
||||
import android.graphics.Bitmap;
|
||||
import android.util.Log;
|
||||
import android.view.Window;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.ProgressBar;
|
||||
|
||||
import androidx.core.widget.ContentLoadingProgressBar;
|
||||
|
||||
import com.alibaba.sdk.android.oss.ClientConfiguration;
|
||||
import com.alibaba.sdk.android.oss.ClientException;
|
||||
import com.alibaba.sdk.android.oss.OSS;
|
||||
import com.alibaba.sdk.android.oss.OSSClient;
|
||||
import com.alibaba.sdk.android.oss.ServiceException;
|
||||
import com.alibaba.sdk.android.oss.callback.OSSCompletedCallback;
|
||||
import com.alibaba.sdk.android.oss.callback.OSSProgressCallback;
|
||||
import com.alibaba.sdk.android.oss.common.auth.OSSAuthCredentialsProvider;
|
||||
import com.alibaba.sdk.android.oss.common.auth.OSSCredentialProvider;
|
||||
import com.alibaba.sdk.android.oss.internal.OSSAsyncTask;
|
||||
import com.alibaba.sdk.android.oss.model.OSSRequest;
|
||||
import com.alibaba.sdk.android.oss.model.PutObjectRequest;
|
||||
import com.alibaba.sdk.android.oss.model.PutObjectResult;
|
||||
import com.dahe.examine.base.App;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import io.reactivex.rxjava3.functions.Consumer;
|
||||
|
||||
/**
|
||||
* @ClassName OssServiceUtil
|
||||
* @Author 用户
|
||||
* @Date 2021/9/29 17:53
|
||||
* @Description TODO
|
||||
*/
|
||||
public class OssServiceUtil {
|
||||
|
||||
private static OSS oss;
|
||||
private static OSSCredentialProvider credentialProvider;
|
||||
private static ClientConfiguration conf;
|
||||
private String bucket;
|
||||
private picResultCallback callback;//回调接口
|
||||
private String path = "tms/user-cert/";
|
||||
private ProgressDialog dialog;
|
||||
|
||||
private OssServiceUtil() {
|
||||
}
|
||||
|
||||
private static volatile OssServiceUtil ossUtils;
|
||||
|
||||
public static OssServiceUtil getInstance() {
|
||||
if (ossUtils == null) {
|
||||
synchronized (OssServiceUtil.class) {
|
||||
if (ossUtils == null) {
|
||||
ossUtils = new OssServiceUtil();
|
||||
}
|
||||
}
|
||||
}
|
||||
return ossUtils;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void initDialog(Activity activity) {
|
||||
dialog = new ProgressDialog(activity);
|
||||
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
|
||||
dialog.setCanceledOnTouchOutside(false);
|
||||
dialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
|
||||
dialog.setMessage("网络请求中......");
|
||||
}
|
||||
|
||||
//初始化使用参数
|
||||
public void init(){
|
||||
bucket = "dh-tms";
|
||||
|
||||
String stsServer = "http://tms.api.test.dahehuodongbao.com:8081/oss/getToken";
|
||||
|
||||
|
||||
credentialProvider = new OSSAuthCredentialsProvider(stsServer);
|
||||
|
||||
// credentialProvider = new OSSPlainTextAKSKCredentialProvider(OssConfigBean.accessKeyId,OssConfigBean.accessKeySecret);
|
||||
// credentialProvider = new OSSCustomSignerCredentialProvider() {
|
||||
// @Override
|
||||
// public String signContent(String content) {
|
||||
// System.out.println(content);
|
||||
// return content;
|
||||
// }
|
||||
// };
|
||||
conf = new ClientConfiguration();
|
||||
conf.setConnectionTimeout(15 * 1000); // 连接超时,默认15秒
|
||||
conf.setSocketTimeout(15 * 1000); // socket超时,默认15秒
|
||||
conf.setMaxConcurrentRequest(5); // 最大并发请求书,默认5个
|
||||
conf.setMaxErrorRetry(2); // 失败后最大重试次数,默认2次
|
||||
|
||||
oss = new OSSClient(App.mApplication, "oss-cn-beijing.aliyuncs.com", credentialProvider, conf);
|
||||
// initDialog(activity);
|
||||
}
|
||||
|
||||
public void setResultCallBack(picResultCallback callback) {
|
||||
this.callback = callback;
|
||||
}
|
||||
|
||||
/**
|
||||
* 图片以路径的方式上传
|
||||
* <p>
|
||||
* // * @param 图片的上传地址(更后台要)
|
||||
* // * @param 图片本地地址
|
||||
* // * @param 进度条
|
||||
*/
|
||||
public void asyncPutImage(final String localFile, final ContentLoadingProgressBar mProgress) {
|
||||
// if (object.equals("")) {
|
||||
// return;
|
||||
// }
|
||||
|
||||
File file = new File(localFile);
|
||||
if (!file.exists()) {
|
||||
return;
|
||||
}
|
||||
String name = file.getName();
|
||||
// 构造上传请求
|
||||
PutObjectRequest put = new PutObjectRequest(OssConfigBean.bucket, OssConfigBean.BUCKET_OBJECT+name, localFile);
|
||||
|
||||
put.setCRC64(OSSRequest.CRC64Config.YES);
|
||||
String mCallbackAddress = OssConfigBean.OSS_CALLBACK_URL;
|
||||
// if (mCallbackAddress != null) {
|
||||
// // 传入对应的上传回调参数,这里默认使用OSS提供的公共测试回调服务器地址
|
||||
// put.setCallbackParam(new HashMap<String, String>() {
|
||||
// {
|
||||
// put("callbackUrl", mCallbackAddress);
|
||||
// //callbackBody可以自定义传入的信息
|
||||
// put("callbackBody", "filename=${object}");
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
//上传后回调通知
|
||||
// 异步上传时可以设置进度回调
|
||||
put.setProgressCallback(new OSSProgressCallback<PutObjectRequest>() {
|
||||
@Override
|
||||
public void onProgress(PutObjectRequest request, long currentSize, long totalSize) {
|
||||
int progress = (int) (100 * currentSize / totalSize);
|
||||
if (mProgress != null) {
|
||||
mProgress.setProgress(progress);
|
||||
}
|
||||
if (dialog!=null){
|
||||
dialog.show();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
OSSAsyncTask task = oss.asyncPutObject(put, new OSSCompletedCallback<PutObjectRequest, PutObjectResult>() {
|
||||
@Override
|
||||
public void onSuccess(PutObjectRequest request, final PutObjectResult result) {
|
||||
if (dialog!=null){
|
||||
dialog.dismiss();
|
||||
}
|
||||
String serverCallbackReturnBody = result.getServerCallbackReturnBody();
|
||||
callback.getPicData(result, OssConfigBean.BUCKET_BASE_URL+ OssConfigBean.BUCKET_OBJECT+name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(PutObjectRequest request, ClientException clientExcepion, ServiceException serviceException) {
|
||||
if (dialog!=null){
|
||||
dialog.dismiss();
|
||||
}
|
||||
String info = "";
|
||||
// 请求异常
|
||||
if (clientExcepion != null) {
|
||||
// 本地异常如网络异常等
|
||||
clientExcepion.printStackTrace();
|
||||
info = clientExcepion.toString();
|
||||
}
|
||||
if (serviceException != null) {
|
||||
// 服务异常
|
||||
Log.e("ErrorCode", serviceException.getErrorCode());
|
||||
Log.e("RequestId", serviceException.getRequestId());
|
||||
Log.e("HostId", serviceException.getHostId());
|
||||
Log.e("RawMessage", serviceException.getRawMessage());
|
||||
info = serviceException.toString();
|
||||
}
|
||||
// task.cancel();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 上传次数
|
||||
*/
|
||||
int number;
|
||||
/**
|
||||
* 成功上传(本地文件名作为key,阿里云地址为value)
|
||||
*/
|
||||
List<String> success = new ArrayList<>();
|
||||
/**
|
||||
* 失败上传(返回失败文件的本地地址)
|
||||
*/
|
||||
List<String> failure = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* 批量上传图片
|
||||
* @param localFiles
|
||||
*/
|
||||
public void asyncPutImages(final List<String> localFiles,PicsResultCallback callback){
|
||||
//初始化
|
||||
number = 1;
|
||||
success.clear();
|
||||
for (int i = 0; i < localFiles.size(); i++) {
|
||||
File file = new File(localFiles.get(i));
|
||||
if (!file.exists()) {
|
||||
return;
|
||||
}
|
||||
String name = file.getName();
|
||||
// 构造上传请求
|
||||
PutObjectRequest put = new PutObjectRequest(OssConfigBean.bucket, OssConfigBean.BUCKET_OBJECT+name, localFiles.get(i));
|
||||
|
||||
put.setCRC64(OSSRequest.CRC64Config.YES);
|
||||
|
||||
oss.asyncPutObject(put, new OSSCompletedCallback<PutObjectRequest, PutObjectResult>() {
|
||||
@Override
|
||||
public void onSuccess(PutObjectRequest request, final PutObjectResult result) {
|
||||
|
||||
String aliPath = OssConfigBean.BUCKET_BASE_URL+ OssConfigBean.BUCKET_OBJECT+name;
|
||||
success.add(aliPath);
|
||||
if (number == localFiles.size()) {
|
||||
//返回 上传路径,以及失败的路径
|
||||
callback.onOssSuccess(success, failure);
|
||||
}
|
||||
number++;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(PutObjectRequest request, ClientException clientExcepion, ServiceException serviceException) {
|
||||
number++;
|
||||
String aliPath = OssConfigBean.BUCKET_BASE_URL+ OssConfigBean.BUCKET_OBJECT+name;
|
||||
failure.add(aliPath);
|
||||
if (number == localFiles.size()) {
|
||||
callback.onOssSuccess(success, failure);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 图片以bitmap的形式上传
|
||||
*
|
||||
* @param object
|
||||
* @param localFile
|
||||
* @param mProgress
|
||||
* @param img
|
||||
* @param type
|
||||
*/
|
||||
public void asyncPutImage(String object, final Bitmap localFile, final ProgressBar mProgress, final ImageView img, String type) {
|
||||
if (object.equals("")) {
|
||||
Log.w("AsyncPutImage", "ObjectNull");
|
||||
return;
|
||||
}
|
||||
if (localFile == null) {
|
||||
Log.w("AsyncPutImage", "bitmapNull");
|
||||
return;
|
||||
}
|
||||
|
||||
// 构造上传请求
|
||||
PutObjectRequest put = new PutObjectRequest(bucket, object, getBitmapByte(localFile));
|
||||
//上传后回调通知
|
||||
// 客户端在上传Object时可以指定OSS服务端在处理完上传请求后,通知您的业务服务器,在该服务器确认接收了该回调后将回调的结果返回给客户端。
|
||||
put.setCallbackParam(new HashMap<String, String>() {
|
||||
{
|
||||
put("callbackUrl", path);
|
||||
put("callbackBody",
|
||||
//参数跟后台商议
|
||||
"filename=${object}&size=${size}&action=${x:action}}");
|
||||
}
|
||||
});
|
||||
HashMap<String, String> hashMap = new HashMap<>();
|
||||
hashMap.put("x:action", type);
|
||||
put.setCallbackVars(hashMap);
|
||||
OSSAsyncTask task = oss.asyncPutObject(put, new OSSCompletedCallback<PutObjectRequest, PutObjectResult>() {
|
||||
@Override
|
||||
public void onSuccess(PutObjectRequest request, final PutObjectResult result) {
|
||||
|
||||
Observable.just(result).observeOn(AndroidSchedulers.mainThread()).subscribe(new Consumer<PutObjectResult>() {
|
||||
@Override
|
||||
public void accept(PutObjectResult putObjectResult) throws Throwable {
|
||||
callback.getPicData(result, "");
|
||||
}
|
||||
});
|
||||
// Observable.just(result).observeOn(AndroidSchedulers.mainThread()).subscribe(putObjectResult -> callback.getPicData(result, ""));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(PutObjectRequest request, ClientException clientExcepion, ServiceException serviceException) {
|
||||
String info = "";
|
||||
// 请求异常
|
||||
if (clientExcepion != null) {
|
||||
// 本地异常如网络异常等
|
||||
clientExcepion.printStackTrace();
|
||||
info = clientExcepion.toString();
|
||||
}
|
||||
if (serviceException != null) {
|
||||
// 服务异常
|
||||
Log.e("ErrorCode", serviceException.getErrorCode());
|
||||
Log.e("RequestId", serviceException.getRequestId());
|
||||
Log.e("HostId", serviceException.getHostId());
|
||||
Log.e("RawMessage", serviceException.getRawMessage());
|
||||
info = serviceException.toString();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public byte[] getBitmapByte(Bitmap bitmap) {
|
||||
ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, out);
|
||||
try {
|
||||
out.flush();
|
||||
out.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return out.toByteArray();
|
||||
}
|
||||
|
||||
public interface picResultCallback {
|
||||
void getPicData(PutObjectResult data, String oldPath);
|
||||
}
|
||||
|
||||
public interface PicsResultCallback {
|
||||
void onOssSuccess(List<String> success, List<String> failure);
|
||||
}
|
||||
}
|
162
app/src/main/java/com/dahe/examine/ui/HomeActivity.kt
Normal file
@ -0,0 +1,162 @@
|
||||
package com.dahe.examine.ui
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.viewpager.widget.ViewPager
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
import com.dahe.examine.R
|
||||
import com.dahe.examine.adapter.MyHomePagerAdapter
|
||||
import com.dahe.examine.bean.TabBean
|
||||
import com.dahe.examine.net.Api
|
||||
import com.dahe.examine.ui.gone.GoneFragment
|
||||
import com.dahe.examine.ui.home.HomeFragment
|
||||
import com.dahe.examine.ui.mine.MineFragment
|
||||
import com.dahe.mylibrary.utils.VersionUtils
|
||||
import com.flyco.tablayout.listener.CustomTabEntity
|
||||
import com.flyco.tablayout.listener.OnTabSelectListener
|
||||
import kotlinx.android.synthetic.main.activity_home.*
|
||||
|
||||
import java.util.*
|
||||
|
||||
class HomeActivity : BaseActivity(), ViewPager.OnPageChangeListener, OnTabSelectListener {
|
||||
|
||||
val home: String = "待审核"
|
||||
val waybill: String = "已使用"
|
||||
val mine: String = "我的"
|
||||
|
||||
private val mNormalRes = mutableListOf(
|
||||
R.drawable.tab_home_normal,
|
||||
R.drawable.tab_waybill_normal,
|
||||
R.drawable.tab_mine_normal
|
||||
)
|
||||
|
||||
|
||||
private val mSelectRes = mutableListOf(
|
||||
R.drawable.tab_home_press,
|
||||
R.drawable.tab_waybill_press,
|
||||
R.drawable.tab_mine_press
|
||||
)
|
||||
private lateinit var mTitles: Array<String>
|
||||
private var mTabEntities = ArrayList<CustomTabEntity>()
|
||||
private var mFragments = ArrayList<Fragment>()
|
||||
|
||||
|
||||
override fun getLayout() = R.layout.activity_home
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
setStatusBarCancelLightColor()
|
||||
mFragments.add(HomeFragment())
|
||||
mFragments.add(GoneFragment())
|
||||
mFragments.add(MineFragment())
|
||||
mTitles = arrayOf(home, waybill, mine)
|
||||
|
||||
for (i in mTitles.indices) {
|
||||
mTabEntities.add(TabBean(mTitles[i], mSelectRes[i], mNormalRes[i]))
|
||||
}
|
||||
|
||||
|
||||
|
||||
home_tabLayout.setTabData(mTabEntities)
|
||||
val intent = intent
|
||||
// var intExtra = 0
|
||||
// if (intent != null) {
|
||||
// intExtra = intent.getIntExtra(AppConfig.CURR_PAGE, 0)
|
||||
// }
|
||||
|
||||
home_tabLayout.setOnTabSelectListener(this)
|
||||
home_NoScrollViewPager.setAdapter(MyHomePagerAdapter(this.supportFragmentManager,
|
||||
mTitles,
|
||||
mFragments))
|
||||
home_NoScrollViewPager.addOnPageChangeListener(this)
|
||||
home_NoScrollViewPager.setOffscreenPageLimit(3)
|
||||
|
||||
home_NoScrollViewPager.setCurrentItem(0)
|
||||
home_tabLayout.setCurrentTab(0)
|
||||
|
||||
checkVersion()
|
||||
}
|
||||
|
||||
override fun initDate() {
|
||||
// val extras = intent.extras
|
||||
// if (extras?.getBoolean(AppConfig.IS_MESSAGE, false) == true) {
|
||||
// val msgType = extras.getString(AppConfig.MESSAGE_TYPE)
|
||||
// if ("0" != msgType){
|
||||
// ActivityUtils.startActivity(this, WarnDetailActivity::class.java, extras)
|
||||
// }else{
|
||||
// ActivityUtils.startActivity(this, OrderDetailActivity::class.java, extras)
|
||||
// }
|
||||
//
|
||||
// }
|
||||
}
|
||||
|
||||
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {
|
||||
}
|
||||
|
||||
override fun onPageSelected(position: Int) {
|
||||
home_tabLayout.setCurrentTab(position)
|
||||
|
||||
}
|
||||
|
||||
override fun onPageScrollStateChanged(state: Int) {
|
||||
}
|
||||
|
||||
override fun onTabSelect(position: Int) {
|
||||
|
||||
// if (SPUtils.hasUserInfo(App.getApp())) {
|
||||
home_NoScrollViewPager.setCurrentItem(position)
|
||||
}
|
||||
|
||||
override fun onTabReselect(position: Int) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 版本检查
|
||||
*/
|
||||
private fun checkVersion() {
|
||||
VersionUtils.getInstance().checkVersion(this, Api.VERSION, false)
|
||||
}
|
||||
|
||||
|
||||
private var mBackKeyPressed = false
|
||||
var isCheckVer = false
|
||||
|
||||
/**
|
||||
* 第四种方法
|
||||
*/
|
||||
override fun onBackPressed() {
|
||||
if (!mBackKeyPressed) {
|
||||
showToast("再按一次退出程序")
|
||||
mBackKeyPressed = true
|
||||
Timer().schedule(object : TimerTask() {
|
||||
override fun run() {
|
||||
mBackKeyPressed = false
|
||||
}
|
||||
}, 2000)
|
||||
} else {
|
||||
isCheckVer = true
|
||||
canCelToast()
|
||||
moveTaskToBack(true)
|
||||
// finish()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onRestart() {
|
||||
super.onRestart()
|
||||
if (isCheckVer) {
|
||||
checkVersion()
|
||||
isCheckVer = false
|
||||
}
|
||||
}
|
||||
// override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
// super.onActivityResult(requestCode, resultCode, data)
|
||||
// if (resultCode == RESULT_OK){
|
||||
// val stringExtra = data?.getStringExtra(AppConfig.BEANS)
|
||||
// if (null!=stringExtra){
|
||||
// val fromJson =
|
||||
// JsonUtils.getInstance().fromJson(stringExtra, WayBillSearchBean::class.java)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
}
|
88
app/src/main/java/com/dahe/examine/ui/LauncherActivity.kt
Normal file
@ -0,0 +1,88 @@
|
||||
package com.dahe.examine.ui
|
||||
|
||||
import android.os.Bundle
|
||||
import android.text.TextUtils
|
||||
import android.view.WindowManager
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
import com.dahe.mylibrary.utils.ActivityUtils
|
||||
import com.dahe.mylibrary.utils.StringUtils
|
||||
import com.dahe.examine.R
|
||||
import com.dahe.examine.bean.UserBean
|
||||
import com.dahe.examine.ui.account.LoginActivity
|
||||
import com.dahe.examine.utils.SPUtils
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.rxjava3.core.Observable
|
||||
import io.reactivex.rxjava3.disposables.Disposable
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||
import kotlinx.android.synthetic.main.activity_launcher.*
|
||||
import java.util.concurrent.TimeUnit
|
||||
|
||||
class LauncherActivity : BaseActivity() {
|
||||
|
||||
|
||||
override fun getLayout(): Int {
|
||||
return R.layout.activity_launcher
|
||||
}
|
||||
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
setStatusBarCancelLightColor()
|
||||
val extras = intent.extras
|
||||
llCount.setOnClickListener {
|
||||
mDisposable?.dispose()
|
||||
//已登录,直接跳转首页
|
||||
val userInfo = SPUtils.getUserInfo(mContext)
|
||||
|
||||
if (userInfo != null && StringUtils.isNotEmpty(userInfo.token)) {
|
||||
ActivityUtils.startActivity(mContext, HomeActivity::class.java,intent.extras)
|
||||
} else {
|
||||
ActivityUtils.startActivity(this@LauncherActivity, LoginActivity::class.java)
|
||||
}
|
||||
window.setFlags(
|
||||
WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN,
|
||||
WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
|
||||
finish()
|
||||
}
|
||||
val count = 3
|
||||
mDisposable = Observable.interval(0, 1, TimeUnit.SECONDS)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe { aLong: Long ->
|
||||
|
||||
tv_count.setText((count - aLong).toString())
|
||||
if (count - aLong == 0L) {
|
||||
mDisposable?.dispose()
|
||||
//已登录,直接跳转首页
|
||||
//已登录,直接跳转首页
|
||||
val userInfo: UserBean? = SPUtils.getUserInfo(mContext)
|
||||
|
||||
if (userInfo != null && !TextUtils.isEmpty(userInfo.getToken())) {
|
||||
ActivityUtils.startActivity(mContext, HomeActivity::class.java,intent.extras)
|
||||
} else {
|
||||
ActivityUtils.startActivity(
|
||||
this@LauncherActivity,
|
||||
LoginActivity::class.java
|
||||
)
|
||||
|
||||
}
|
||||
// window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
|
||||
window.setFlags(
|
||||
WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN,
|
||||
WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
|
||||
|
||||
finish()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private var mDisposable: Disposable? = null
|
||||
|
||||
override fun initDate() {
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
mDisposable?.dispose()
|
||||
}
|
||||
}
|
236
app/src/main/java/com/dahe/examine/ui/account/LoginActivity.kt
Normal file
@ -0,0 +1,236 @@
|
||||
package com.dahe.examine.ui.account
|
||||
|
||||
import android.Manifest
|
||||
import android.graphics.drawable.BitmapDrawable
|
||||
import android.os.Bundle
|
||||
import android.text.TextUtils
|
||||
import android.text.method.HideReturnsTransformationMethod
|
||||
import android.text.method.PasswordTransformationMethod
|
||||
import android.view.View
|
||||
import com.dahe.examine.R
|
||||
import com.dahe.examine.bean.CheckCodeBean
|
||||
import com.dahe.examine.bean.LogBean
|
||||
import com.dahe.examine.bean.UserBean
|
||||
import com.dahe.examine.bean.UserBean2
|
||||
import com.dahe.examine.net.BaseObserver
|
||||
import com.dahe.examine.net.DataManager
|
||||
import com.dahe.examine.net.RxHttpCallBack
|
||||
import com.dahe.examine.ui.HomeActivity
|
||||
import com.dahe.examine.utils.AppActivityUtils
|
||||
import com.dahe.examine.utils.SPUtils
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
import com.dahe.mylibrary.net.CommonResponseBean
|
||||
import com.dahe.mylibrary.net.JsonUtils
|
||||
import com.dahe.mylibrary.utils.ActivityUtils
|
||||
import com.dahe.mylibrary.utils.Base64Utils
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.rxjava3.core.Observable
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||
import kotlinx.android.synthetic.main.activity_login.*
|
||||
import pub.devrel.easypermissions.AppSettingsDialog
|
||||
import pub.devrel.easypermissions.EasyPermissions
|
||||
import java.util.*
|
||||
|
||||
class LoginActivity : BaseActivity(), EasyPermissions.PermissionCallbacks, View.OnClickListener {
|
||||
|
||||
|
||||
lateinit var codeBean: CheckCodeBean
|
||||
|
||||
var perms = arrayOf(
|
||||
Manifest.permission.CAMERA,
|
||||
Manifest.permission.CALL_PHONE,
|
||||
Manifest.permission.ACCESS_FINE_LOCATION,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE
|
||||
)
|
||||
|
||||
override fun getLayout(): Int = R.layout.activity_login
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
// setStatusBarCancelLightColor()
|
||||
setStatusBarColor(R.color.white)
|
||||
if (!EasyPermissions.hasPermissions(this, *perms)) {
|
||||
EasyPermissions.requestPermissions(this@LoginActivity, "您尚有权限未开放,是否获取权限", 2, *perms)
|
||||
}
|
||||
|
||||
|
||||
btn_log.setOnClickListener(this)
|
||||
tvForget.setOnClickListener(this)
|
||||
tv_yhxy.setOnClickListener(this)
|
||||
tv_yszc.setOnClickListener(this)
|
||||
imgCode.setOnClickListener(this)
|
||||
cb.setOnCheckedChangeListener { buttonView, isChecked ->
|
||||
if (isChecked) {
|
||||
et_pass.setTransformationMethod(PasswordTransformationMethod.getInstance())
|
||||
} else {
|
||||
et_pass.setTransformationMethod(HideReturnsTransformationMethod.getInstance())
|
||||
}
|
||||
et_pass.setSelection(et_pass.getText().toString().length)
|
||||
}
|
||||
}
|
||||
|
||||
override fun initDate() {
|
||||
getCode()
|
||||
}
|
||||
|
||||
override fun onClick(view: View) {
|
||||
when (view.id) {
|
||||
R.id.btn_log -> {
|
||||
if (!EasyPermissions.hasPermissions(this, *perms)) {
|
||||
EasyPermissions.requestPermissions(
|
||||
this@LoginActivity,
|
||||
"您尚有权限未开放,是否获取权限",
|
||||
2,
|
||||
*perms
|
||||
)
|
||||
} else {
|
||||
logByPass()
|
||||
}
|
||||
|
||||
}
|
||||
// R.id.tv_forget -> ActivityUtils.startActivity(mContext, ForgetPwdActivity::class.java)
|
||||
R.id.tv_yhxy -> AppActivityUtils.openWebViewActivity(this,
|
||||
"用户服务协议",
|
||||
"http://tms.down.user.test.dahehuodongbao.com/user-agreement.html");
|
||||
R.id.tv_yszc -> AppActivityUtils.openWebViewActivity(this, "隐私政策",
|
||||
"http://tms.down.user.test.dahehuodongbao.com/user-privacy.html")
|
||||
|
||||
R.id.imgCode -> getCode()
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override fun onRequestPermissionsResult(
|
||||
requestCode: Int,
|
||||
permissions: Array<String?>,
|
||||
grantResults: IntArray,
|
||||
) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
|
||||
|
||||
// EasyPermissions handles the request result.
|
||||
EasyPermissions.onRequestPermissionsResult(requestCode, permissions, grantResults, this)
|
||||
}
|
||||
|
||||
private fun getCode() {
|
||||
DataManager.getInstance().captchaImage()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<CheckCodeBean>() {
|
||||
override fun onSuccess(t: CommonResponseBean<CheckCodeBean>) {
|
||||
super.onSuccess(t)
|
||||
codeBean = t.getData()
|
||||
imgCode.setBackground(BitmapDrawable(Base64Utils.asdf(t.getData()
|
||||
.getImage())))
|
||||
imgCode.setText("")
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 密码登录
|
||||
*/
|
||||
private fun logByPass() {
|
||||
val s: String = et_phone.getText().toString().trim()
|
||||
val s1: String = et_pass.getText().toString().trim()
|
||||
if (TextUtils.isEmpty(s) || TextUtils.isEmpty(s1)) {
|
||||
showToast("请输入账号密码")
|
||||
return
|
||||
}
|
||||
// if (!PatternUtils.isPassword(s1)){
|
||||
// showToast("密码格式错误")
|
||||
// return
|
||||
// }
|
||||
if (etCode.text.toString().isEmpty()) {
|
||||
showToast("请输入验证码")
|
||||
return
|
||||
}
|
||||
// if (!cb_read.isChecked()) {
|
||||
// showToast("请勾选用户协议")
|
||||
// return
|
||||
// }
|
||||
|
||||
if (!::codeBean.isInitialized){
|
||||
showToast("请获取验证码")
|
||||
return
|
||||
}
|
||||
|
||||
val logBean = LogBean()
|
||||
logBean.username = et_phone.getText().toString().trim()
|
||||
logBean.password = et_pass.getText().toString().trim()
|
||||
logBean.code = etCode.getText().toString().trim()
|
||||
logBean.uuid = codeBean.uuid
|
||||
|
||||
DataManager.getInstance().log2(logBean)
|
||||
.takeWhile {
|
||||
if (200!=it.code){
|
||||
runOnUiThread {
|
||||
showToast(it.msg)
|
||||
}
|
||||
false
|
||||
}else{
|
||||
true
|
||||
}
|
||||
}
|
||||
.flatMap {
|
||||
SPUtils.setUserInfo(
|
||||
this@LoginActivity,
|
||||
JsonUtils.getInstance().getGson().toJson(it.getData())
|
||||
)
|
||||
DataManager.getInstance().info
|
||||
}.compose(DataManager.setThread())
|
||||
.subscribe(BaseObserver(mContext,object :RxHttpCallBack<UserBean2>(){
|
||||
override fun onSuccess(t: CommonResponseBean<UserBean2>?) {
|
||||
super.onSuccess(t)
|
||||
val data = t?.data
|
||||
|
||||
val userInfo = SPUtils.getUserInfo(mContext)
|
||||
userInfo.setUserInfo(data?.user)
|
||||
|
||||
SPUtils.setUserInfo(
|
||||
this@LoginActivity,
|
||||
JsonUtils.getInstance().getGson().toJson(userInfo)
|
||||
)
|
||||
ActivityUtils.startActivity(this@LoginActivity,
|
||||
HomeActivity::class.java)
|
||||
finish()
|
||||
}
|
||||
}))
|
||||
|
||||
|
||||
// Observable.zip(DataManager.getInstance()
|
||||
// .log2(logBean), DataManager.getInstance().info, { item1, item2 ->
|
||||
// item2.data.token = item1.data.token
|
||||
// item2
|
||||
//
|
||||
// })
|
||||
// .compose(DataManager.setThread())
|
||||
// .subscribe(BaseObserver(mContext, object : RxHttpCallBack<UserBean>() {
|
||||
// override fun onSuccess(t: CommonResponseBean<UserBean>) {
|
||||
// super.onSuccess(t)
|
||||
// SPUtils.setUserInfo(
|
||||
// this@LoginActivity,
|
||||
// JsonUtils.getInstance().getGson().toJson(t.getData())
|
||||
// )
|
||||
//
|
||||
//// val freighter = SPUtils.getUserInfo(this@LoginActivity).freighter
|
||||
//
|
||||
// ActivityUtils.startActivity(this@LoginActivity,
|
||||
// HomeActivity::class.java)
|
||||
// finish()
|
||||
// }
|
||||
// }))
|
||||
|
||||
}
|
||||
|
||||
|
||||
override fun onPermissionsGranted(requestCode: Int, perms: MutableList<String>) {
|
||||
}
|
||||
|
||||
override fun onPermissionsDenied(requestCode: Int, perms: MutableList<String>) {
|
||||
if (EasyPermissions.somePermissionPermanentlyDenied(this, perms)) {
|
||||
AppSettingsDialog.Builder(this).setTitle("获取权限")
|
||||
.setRationale("如果没有请求的权限,此应用可能无法正常工作。 打开应用程序设置屏幕以修改应用程序权限").build().show()
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,90 @@
|
||||
package com.dahe.examine.ui.account.activity
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
import com.dahe.mylibrary.net.CommonResponseBean
|
||||
import com.dahe.mylibrary.utils.ActivityUtils
|
||||
import com.dahe.examine.R
|
||||
import com.dahe.examine.base.AppConfig
|
||||
import com.dahe.examine.bean.BusInfoBean
|
||||
import com.dahe.examine.net.BaseObserver
|
||||
import com.dahe.examine.net.DataManager
|
||||
import com.dahe.examine.net.RxHttpCallBack
|
||||
import com.dahe.examine.ui.account.LoginActivity
|
||||
import kotlinx.android.synthetic.main.activity_business_info.*
|
||||
|
||||
/**
|
||||
* @ClassName BusinessInfoActivity
|
||||
* @Author 用户
|
||||
* @Date 2022/1/14 14:58
|
||||
* @Description TODO
|
||||
*/
|
||||
class BusinessInfoActivity : BaseActivity(), View.OnClickListener {
|
||||
override fun getLayout() = R.layout.activity_business_info
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
setStatusBarColor(R.color.white)
|
||||
btnGo.setOnClickListener(this)
|
||||
}
|
||||
|
||||
override fun initDate() {
|
||||
}
|
||||
|
||||
override fun onClick(view: View) {
|
||||
super.onClick(view)
|
||||
when(view.id){
|
||||
R.id.btnGo->go()
|
||||
}
|
||||
}
|
||||
|
||||
fun go(){
|
||||
val qymc = etQymc.text.toString()
|
||||
val ywlx = etYwlx.text.toString()
|
||||
val etDz = etDz.text.toString()
|
||||
|
||||
if (qymc.isNullOrEmpty()){
|
||||
showToast("请输入企业名称")
|
||||
return
|
||||
}
|
||||
|
||||
if (ywlx.isNullOrEmpty()){
|
||||
showToast("请输入业务类型")
|
||||
return
|
||||
}
|
||||
|
||||
if (etDz.isNullOrEmpty()){
|
||||
showToast("请输入注册地址")
|
||||
return
|
||||
}
|
||||
|
||||
val extras = intent.extras
|
||||
val bean : BusInfoBean= extras?.getSerializable(AppConfig.BEAN) as BusInfoBean
|
||||
|
||||
val busInfoBean = BusInfoBean()
|
||||
val paramsDao = BusInfoBean.ParamsDao()
|
||||
paramsDao.code = bean.params.code
|
||||
busInfoBean.phone = bean.phone
|
||||
busInfoBean.params = paramsDao
|
||||
busInfoBean.pwd = bean.pwd
|
||||
busInfoBean.enterpriseName = qymc
|
||||
busInfoBean.nationalClassA = etDj.text.toString()
|
||||
busInfoBean.businessType = ywlx
|
||||
busInfoBean.placeOfRegistration = etDz
|
||||
busInfoBean.companyAddress = etGsdz.text.toString()
|
||||
busInfoBean.plantAddress = etCqdz.text.toString()
|
||||
busInfoBean.contacts = etFzr.text.toString()
|
||||
busInfoBean.contactsPhone = etFzrPhone.text.toString()
|
||||
|
||||
|
||||
|
||||
DataManager.getInstance().register(busInfoBean)
|
||||
.compose(DataManager.setThread())
|
||||
.subscribe(BaseObserver(mContext,object : RxHttpCallBack<Any>(){
|
||||
override fun onSuccess(t: CommonResponseBean<Any>?) {
|
||||
super.onSuccess(t)
|
||||
ActivityUtils.finishOtherActivities(LoginActivity::class.java)
|
||||
}
|
||||
}))
|
||||
}
|
||||
}
|
@ -0,0 +1,175 @@
|
||||
package com.dahe.examine.ui.account.activity
|
||||
|
||||
import android.os.Bundle
|
||||
import android.text.TextUtils
|
||||
import android.text.method.HideReturnsTransformationMethod
|
||||
import android.text.method.PasswordTransformationMethod
|
||||
import android.view.View
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
import com.dahe.mylibrary.net.CommonResponseBean
|
||||
import com.dahe.mylibrary.utils.ActivityUtils
|
||||
import com.dahe.mylibrary.utils.CountDownTimerUtils
|
||||
import com.dahe.mylibrary.utils.PhoneFormatCheckUtils
|
||||
import com.dahe.examine.R
|
||||
import com.dahe.examine.base.AppConfig
|
||||
import com.dahe.examine.bean.BusInfoBean
|
||||
import com.dahe.examine.net.BaseObserver
|
||||
import com.dahe.examine.net.DataManager
|
||||
import com.dahe.examine.net.RxHttpCallBack
|
||||
import com.dahe.examine.ui.HomeActivity
|
||||
import com.dahe.examine.utils.AppActivityUtils
|
||||
import kotlinx.android.synthetic.main.activity_login.*
|
||||
import kotlinx.android.synthetic.main.activity_register.*
|
||||
import kotlinx.android.synthetic.main.activity_register.btn_log
|
||||
import kotlinx.android.synthetic.main.activity_register.cb
|
||||
import kotlinx.android.synthetic.main.activity_register.etCode
|
||||
import kotlinx.android.synthetic.main.activity_register.tv_yhxy
|
||||
import kotlinx.android.synthetic.main.activity_register.tv_yszc
|
||||
import java.util.*
|
||||
|
||||
class RegisterActivity : BaseActivity(), View.OnClickListener {
|
||||
|
||||
|
||||
override fun getLayout(): Int = R.layout.activity_register
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
// setStatusBarCancelLightColor()
|
||||
setStatusBarColor(R.color.white)
|
||||
|
||||
|
||||
btn_log.setOnClickListener(this)
|
||||
tv_yhxy.setOnClickListener(this)
|
||||
tv_yszc.setOnClickListener(this)
|
||||
tvCode.setOnClickListener(this)
|
||||
cb.setOnCheckedChangeListener { buttonView, isChecked ->
|
||||
if (isChecked) {
|
||||
et_pass.setTransformationMethod(PasswordTransformationMethod.getInstance())
|
||||
} else {
|
||||
et_pass.setTransformationMethod(HideReturnsTransformationMethod.getInstance())
|
||||
}
|
||||
et_pass.setSelection(et_pass.getText().toString().length)
|
||||
}
|
||||
}
|
||||
|
||||
override fun initDate() {
|
||||
// getCode()
|
||||
}
|
||||
|
||||
override fun onClick(view: View) {
|
||||
when (view.id) {
|
||||
R.id.btn_log -> next()
|
||||
// R.id.tv_forget -> ActivityUtils.startActivity(mContext, ForgetPwdActivity::class.java)
|
||||
R.id.tv_yhxy -> AppActivityUtils.openWebViewActivity(this,
|
||||
"用户服务协议",
|
||||
"https://tms.dahehuoyun.com/profile/upload/static/serviceAgreement.html");
|
||||
R.id.tv_yszc -> AppActivityUtils.openWebViewActivity(this, "隐私政策",
|
||||
"https://tms.dahehuoyun.com/profile/upload/static/privacyPolicy.html")
|
||||
|
||||
|
||||
R.id.tvCode -> getCode()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 密码登录
|
||||
*/
|
||||
private fun logByPass() {
|
||||
val s: String = et_phone.getText().toString().trim()
|
||||
val s1: String = et_pass.getText().toString().trim()
|
||||
if (TextUtils.isEmpty(s) || TextUtils.isEmpty(s1)) {
|
||||
showToast("请输入账号密码")
|
||||
return
|
||||
}
|
||||
// if (!PatternUtils.isPassword(s1)){
|
||||
// showToast("密码格式错误")
|
||||
// return
|
||||
// }
|
||||
// if (et_yzm.text.toString().isEmpty()) {
|
||||
// showToast("请输入验证码")
|
||||
// return
|
||||
// }
|
||||
// if (!cb_read.isChecked()) {
|
||||
// showToast("请勾选用户协议")
|
||||
// return
|
||||
// }
|
||||
|
||||
ActivityUtils.startActivity(this@RegisterActivity,
|
||||
HomeActivity::class.java)
|
||||
finish()
|
||||
|
||||
// DataManager.getInstance().log(et_pass.getText().toString().trim(), et_phone.getText().toString().trim())
|
||||
// .subscribeOn(Schedulers.io())
|
||||
// .observeOn(AndroidSchedulers.mainThread())
|
||||
// .subscribe(
|
||||
// BaseObserver<UserBean>(mContext,
|
||||
// object : RxHttpCallBack<UserBean?>(this@LoginActivity) {
|
||||
// override fun onSuccess(t: CommonResponseBean<UserBean?>) {
|
||||
// super.onSuccess(t)
|
||||
//// val toJson = JsonUtils.getInstance().getGson().toJson(t.getData())
|
||||
// SPUtils.setUserInfo(
|
||||
// this@LoginActivity,
|
||||
// JsonUtils.getInstance().getGson().toJson(t.getData())
|
||||
// )
|
||||
//
|
||||
//// val freighter = SPUtils.getUserInfo(this@LoginActivity).freighter
|
||||
//
|
||||
// ActivityUtils.startActivity(this@LoginActivity,
|
||||
// HomeActivity::class.java)
|
||||
// finish()
|
||||
// }
|
||||
//
|
||||
// override fun onCodeError(mContext: Context?, t: CommonResponseBean<UserBean?>) {
|
||||
// super.onCodeError(mContext, t)
|
||||
//// if (t.getCode() != -1) {
|
||||
//// getCode()
|
||||
//// }
|
||||
// }
|
||||
// })
|
||||
// )
|
||||
}
|
||||
|
||||
|
||||
fun getCode() {
|
||||
|
||||
var phone = etPhone.text.toString()
|
||||
if (PhoneFormatCheckUtils.isPhoneLegal(phone)) {
|
||||
DataManager.getInstance().getSmsCode(phone)
|
||||
.compose(DataManager.setThread())
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
|
||||
override fun onSuccess(t: CommonResponseBean<Any>?) {
|
||||
super.onSuccess(t)
|
||||
val countDownTimerUtils = CountDownTimerUtils(tvCode, 60000, 1000)
|
||||
countDownTimerUtils.start()
|
||||
}
|
||||
}))
|
||||
} else {
|
||||
showToast("请输入正确手机号")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
fun next() {
|
||||
val phone = etPhone.text.toString()
|
||||
val code = etCode.text.toString()
|
||||
val pwd = etPass.text.toString()
|
||||
|
||||
if (phone.isNullOrEmpty() || code.isNullOrEmpty() || pwd.isNullOrEmpty()) {
|
||||
showToast("请完善信息")
|
||||
return
|
||||
}
|
||||
val busInfoBean = BusInfoBean()
|
||||
busInfoBean.phone = phone
|
||||
|
||||
val paramsDao = BusInfoBean.ParamsDao()
|
||||
paramsDao.code = code
|
||||
busInfoBean.params = paramsDao
|
||||
|
||||
busInfoBean.pwd = pwd
|
||||
val bundle = Bundle()
|
||||
bundle.putSerializable(AppConfig.BEAN, busInfoBean)
|
||||
ActivityUtils.startActivity(mContext, BusinessInfoActivity::class.java, bundle)
|
||||
}
|
||||
|
||||
}
|
188
app/src/main/java/com/dahe/examine/ui/gone/GoneFragment.kt
Normal file
@ -0,0 +1,188 @@
|
||||
package com.dahe.examine.ui.gone
|
||||
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.text.TextUtils
|
||||
import android.view.View
|
||||
import android.widget.TextView
|
||||
import androidx.core.widget.addTextChangedListener
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.bigkoo.pickerview.builder.TimePickerBuilder
|
||||
import com.dahe.dispatch.cuspop.SelectTimePopup
|
||||
import com.dahe.examine.R
|
||||
import com.dahe.examine.adapter.GoneAdapter
|
||||
import com.dahe.examine.base.AppConfig
|
||||
import com.dahe.examine.bean.ApplyBean
|
||||
import com.dahe.examine.bean.CountBean
|
||||
import com.dahe.examine.net.BaseObserver
|
||||
import com.dahe.examine.net.DataManager
|
||||
import com.dahe.examine.net.RxHttpCallBack
|
||||
import com.dahe.examine.ui.gone.activity.NotReportedActivity
|
||||
import com.dahe.examine.ui.gone.activity.UserDetailActivity
|
||||
import com.dahe.mylibrary.base.BaseFragment
|
||||
import com.dahe.mylibrary.callback.RefreshCallBack
|
||||
import com.dahe.mylibrary.net.CommonResponseBean
|
||||
import com.dahe.mylibrary.net.PagerBean
|
||||
import com.dahe.mylibrary.utils.ActivityUtils
|
||||
import com.dahe.mylibrary.utils.TimeUtil
|
||||
import com.lxj.xpopup.XPopup
|
||||
import kotlinx.android.synthetic.main.fragment_gone.*
|
||||
import kotlinx.android.synthetic.main.fragment_home.recyclerView
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
|
||||
class GoneFragment : BaseFragment(), RefreshCallBack, View.OnClickListener {
|
||||
|
||||
var date: String = TimeUtil.getNowString(SimpleDateFormat("yyyy-MM-dd",
|
||||
Locale.getDefault()))
|
||||
|
||||
lateinit var applyAdapter: GoneAdapter
|
||||
|
||||
override fun getContentViewLayoutID() = R.layout.fragment_gone
|
||||
|
||||
override fun onFragmentVisibleChange(isVisible: Boolean) {
|
||||
if (isVisible) {
|
||||
initData()
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onFragmentFirstVisible() {
|
||||
setTitleBar("已使用", true,"未报") {
|
||||
ActivityUtils.startActivityForResult(requireActivity(),
|
||||
NotReportedActivity::class.java,
|
||||
1)
|
||||
}
|
||||
|
||||
initRec()
|
||||
initData()
|
||||
tvSearch.setOnClickListener(this)
|
||||
llClear.setOnClickListener(this)
|
||||
|
||||
tvSearch.addTextChangedListener {
|
||||
if (it.toString().length > 0) {
|
||||
llClear.visibility = View.VISIBLE
|
||||
} else {
|
||||
llClear.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.tvSearch -> setBir(tvSearch)
|
||||
R.id.llClear -> {
|
||||
tvSearch.text = ""
|
||||
date = TimeUtil.getNowString(SimpleDateFormat("yyyy-MM-dd",
|
||||
Locale.getDefault()))
|
||||
initData()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getRefreshDate(stat: Int, page: Int, count: Int) {
|
||||
}
|
||||
|
||||
fun initData() {
|
||||
DataManager.getInstance().useList(date)
|
||||
.compose(DataManager.setThread())
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<PagerBean<ApplyBean>>() {
|
||||
override fun onSuccess(t: CommonResponseBean<PagerBean<ApplyBean>>) {
|
||||
super.onSuccess(t)
|
||||
|
||||
applyAdapter.setList(t.data.rows)
|
||||
}
|
||||
}))
|
||||
|
||||
getCount()
|
||||
}
|
||||
|
||||
fun getCount() {
|
||||
DataManager.getInstance().useCount("",date)
|
||||
.compose(DataManager.setThread())
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<CountBean>() {
|
||||
override fun onSuccess(t: CommonResponseBean<CountBean>?) {
|
||||
super.onSuccess(t)
|
||||
tvYf.text = t?.data?.numberOfPasses
|
||||
tvYsy.text = t?.data?.passNoNumber
|
||||
tvYsp.text = t?.data?.notUsedNumber
|
||||
|
||||
tvMf1.text = t?.data?.numberOfPassesMF
|
||||
tvMf2.text = t?.data?.passNoNumberMF
|
||||
tvMf3.text = t?.data?.notUsedNumberMF
|
||||
tvSf1.text = t?.data?.numberOfPassesSF
|
||||
tvSf2.text = t?.data?.passNoNumberSF
|
||||
tvSf3.text = t?.data?.notUsedNumberSF
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
fun search() {
|
||||
XPopup.Builder(mContext)
|
||||
.enableDrag(true)
|
||||
.hasShadowBg(true)
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
||||
.asCustom(SelectTimePopup(mContext).setOnMyItemClickListener(object :
|
||||
SelectTimePopup.OnMyItemClickListener {
|
||||
override fun onItemClick(startTime: String, endTime: String) {
|
||||
}
|
||||
}))
|
||||
.show()
|
||||
}
|
||||
|
||||
fun initRec() {
|
||||
recyclerView.layoutManager = LinearLayoutManager(mContext,
|
||||
LinearLayoutManager.VERTICAL, false)
|
||||
recyclerView.setHasFixedSize(true)
|
||||
applyAdapter = GoneAdapter(-1)
|
||||
recyclerView.adapter = applyAdapter
|
||||
|
||||
applyAdapter.setOnItemClickListener { adapter, view, position ->
|
||||
val bundle = Bundle()
|
||||
bundle.putSerializable(AppConfig.BEAN, applyAdapter.data[position])
|
||||
bundle.putString(AppConfig.TIME,date)
|
||||
ActivityUtils.startActivity(mContext, UserDetailActivity::class.java, bundle)
|
||||
}
|
||||
}
|
||||
|
||||
fun setBir(view: TextView) {
|
||||
val startDate = Calendar.getInstance()
|
||||
val endtDate = Calendar.getInstance()
|
||||
val currDate = Calendar.getInstance()
|
||||
startDate[1990, 0] = 1
|
||||
endtDate[2100, 0] = 1
|
||||
|
||||
|
||||
if (!TextUtils.isEmpty(view.getText())) {
|
||||
val date = TimeUtil.string2Date(view.getText().toString(),
|
||||
SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()))
|
||||
if (date != null) currDate.time = date
|
||||
}
|
||||
|
||||
|
||||
val pvTime = TimePickerBuilder(
|
||||
context
|
||||
) { date, v -> //选中事件回调
|
||||
// TimeUtil.date2String(date,SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()))
|
||||
val data =
|
||||
TimeUtil.date2String(date, SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()))
|
||||
view.text = data
|
||||
GoneFragment@ this.date = data
|
||||
initData()
|
||||
}.setSubmitColor(Color.parseColor("#F1474B")) //确定按钮文字颜色
|
||||
.setCancelColor(Color.parseColor("#F1474B")) //取消按钮文字颜色
|
||||
.setTitleBgColor(Color.parseColor("#FFFFFF"))
|
||||
.setType(booleanArrayOf(true, true, true, false, false, false))
|
||||
.setTitleText("选择时间")
|
||||
.setDate(currDate)
|
||||
.setRangDate(startDate, endtDate)
|
||||
.setBgColor(Color.parseColor("#F5F5F5"))
|
||||
.build()
|
||||
// pvTime.setDate(Calendar.getInstance());//注:根据需求来决定是否使用该方法(一般是精确到秒的情况),此项可以在弹出选择器的时候重新设置当前时间,避免在初始化之后由于时间已经设定,导致选中时间与当前时间不匹配的问题。
|
||||
pvTime.show()
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,249 @@
|
||||
package com.dahe.examine.ui.gone.activity
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.os.Message
|
||||
import android.text.TextUtils
|
||||
import android.view.View
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import com.bigkoo.pickerview.builder.OptionsPickerBuilder
|
||||
import com.bigkoo.pickerview.builder.TimePickerBuilder
|
||||
import com.bigkoo.pickerview.view.OptionsPickerView
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
import com.dahe.mylibrary.net.CommonResponseBean
|
||||
import com.dahe.mylibrary.utils.TimeUtil
|
||||
import com.dahe.examine.R
|
||||
import com.dahe.examine.bean.JsonBean
|
||||
import com.dahe.examine.bean.PassBean
|
||||
import com.dahe.examine.net.BaseObserver
|
||||
import com.dahe.examine.net.DataManager
|
||||
import com.dahe.examine.net.RxHttpCallBack
|
||||
import com.dahe.examine.utils.GetJsonDataUtil
|
||||
import com.google.gson.Gson
|
||||
import kotlinx.android.synthetic.main.activity_add_go.*
|
||||
import org.json.JSONArray
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* @ClassName ApplyActivity
|
||||
* @Author 用户
|
||||
* @Date 2022/1/13 15:42
|
||||
* @Description TODO
|
||||
*/
|
||||
class AddGoActivity : BaseActivity(), View.OnClickListener {
|
||||
override fun getLayout() = R.layout.activity_add_go
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
setStatusBarCancelLightColor()
|
||||
setTitleBar("申请") { finish() }
|
||||
tvSTime.setOnClickListener(this)
|
||||
tvETime.setOnClickListener(this)
|
||||
tvSub.setOnClickListener(this)
|
||||
tvStartTime.setOnClickListener(this)
|
||||
tvEndTime.setOnClickListener(this)
|
||||
}
|
||||
|
||||
override fun initDate() {
|
||||
}
|
||||
|
||||
override fun onClick(view: View) {
|
||||
super.onClick(view)
|
||||
when (view.id) {
|
||||
// R.id.tvSpdw -> spdw()
|
||||
R.id.tvSub -> sub()
|
||||
R.id.tvSTime -> setBir(0,tvSTime)
|
||||
R.id.tvETime -> setBir(1,tvETime)
|
||||
R.id.tvStartTime -> setBir(2,tvStartTime)
|
||||
R.id.tvEndTime -> setBir(3,tvEndTime)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun sub(){
|
||||
val passBean = PassBean()
|
||||
passBean.passNo = tvTxbh.text.toString()
|
||||
passBean.vehicle = etCarNum.text.toString()
|
||||
passBean.driverName = etName.text.toString()
|
||||
passBean.driverPhone = etPhone.text.toString()
|
||||
passBean.itemTypeName = etWpzl.text.toString()
|
||||
passBean.transportTonnage = etDs.text.toString()
|
||||
passBean.startPoint = etQd.text.toString()
|
||||
passBean.endPoint = etZd.text.toString()
|
||||
passBean.useStartTime = tvSTime.text.toString()
|
||||
passBean.useEndTime = tvETime.text.toString()
|
||||
passBean.startTime = tvStartTime.text.toString()
|
||||
passBean.endTime = tvEndTime.text.toString()
|
||||
passBean.remarks = tvBz.text.toString()
|
||||
DataManager.getInstance().addPass(passBean)
|
||||
.compose(DataManager.setThread())
|
||||
.subscribe(BaseObserver(mContext,object : RxHttpCallBack<Any>(){
|
||||
override fun onSuccess(t: CommonResponseBean<Any>?) {
|
||||
super.onSuccess(t)
|
||||
finish()
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
fun setBir(type: Int, view: TextView) {
|
||||
val startDate = Calendar.getInstance()
|
||||
val endtDate = Calendar.getInstance()
|
||||
val currDate = Calendar.getInstance()
|
||||
startDate[1990, 0] = 1
|
||||
endtDate[2100, 0] = 1
|
||||
|
||||
|
||||
if (!TextUtils.isEmpty(view.getText())) {
|
||||
val date = TimeUtil.string2Date(view.getText().toString(),
|
||||
SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()))
|
||||
if (date != null) currDate.time = date
|
||||
}
|
||||
|
||||
|
||||
val pvTime = TimePickerBuilder(
|
||||
mContext
|
||||
) { date, v -> //选中事件回调
|
||||
// TimeUtil.date2String(date,SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()))
|
||||
val data =
|
||||
TimeUtil.date2String(date, SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.getDefault()))
|
||||
view.text = data
|
||||
}.setSubmitColor(Color.parseColor("#F1474B")) //确定按钮文字颜色
|
||||
.setCancelColor(Color.parseColor("#F1474B")) //取消按钮文字颜色
|
||||
.setTitleBgColor(Color.parseColor("#FFFFFF"))
|
||||
.setType(booleanArrayOf(true, true, true, true, true, false))
|
||||
.setTitleText("选择时间")
|
||||
.setDate(currDate)
|
||||
.setRangDate(startDate, endtDate)
|
||||
.setBgColor(Color.parseColor("#F5F5F5"))
|
||||
.build()
|
||||
// pvTime.setDate(Calendar.getInstance());//注:根据需求来决定是否使用该方法(一般是精确到秒的情况),此项可以在弹出选择器的时候重新设置当前时间,避免在初始化之后由于时间已经设定,导致选中时间与当前时间不匹配的问题。
|
||||
pvTime.show()
|
||||
}
|
||||
|
||||
|
||||
private var options1Items = ArrayList<JsonBean>()
|
||||
private val options2Items = ArrayList<ArrayList<String>>()
|
||||
private val options3Items = ArrayList<ArrayList<ArrayList<String>>>()
|
||||
private val MSG_LOAD_DATA = 0x0001
|
||||
private val MSG_LOAD_SUCCESS = 0x0002
|
||||
private val MSG_LOAD_FAILED = 0x0003
|
||||
private var thread: Thread? = null
|
||||
private var isLoaded = false
|
||||
|
||||
|
||||
private fun setProText() {
|
||||
val pvOptions: OptionsPickerView<*> = OptionsPickerBuilder(this@AddGoActivity
|
||||
) { options1, options2, options3, v ->
|
||||
//返回的分别是三个级别的选中位置
|
||||
val opt1tx =
|
||||
if (options1Items.size > 0) options1Items.get(options1).getPickerViewText() else ""
|
||||
val opt2tx = if (options2Items.size > 0
|
||||
&& options2Items.get(options1).size > 0
|
||||
) options2Items.get(options1).get(options2) else ""
|
||||
val opt3tx =
|
||||
if (options2Items.size > 0 && options3Items.get(options1).size > 0 && options3Items.get(
|
||||
options1).get(options2).size > 0
|
||||
) options3Items.get(options1).get(options2).get(options3) else ""
|
||||
val tx = "$opt1tx-$opt2tx-$opt3tx"
|
||||
// tvDz.text = tx
|
||||
}
|
||||
.setSubmitColor(Color.parseColor("#F1474B")) //确定按钮文字颜色
|
||||
.setCancelColor(Color.parseColor("#F1474B")) //取消按钮文字颜色
|
||||
.setTitleBgColor(Color.parseColor("#FFFFFF"))
|
||||
.setBgColor(Color.parseColor("#F5F5F5"))
|
||||
.setContentTextSize(20)
|
||||
.build<Any>()
|
||||
pvOptions.setPicker(options1Items as List<Nothing>?,
|
||||
options2Items as List<Nothing>?, options3Items as List<Nothing>?) //三级选择器
|
||||
pvOptions.show()
|
||||
}
|
||||
|
||||
private fun initJsonData() { //解析数据
|
||||
/**
|
||||
* 注意:assets 目录下的Json文件仅供参考,实际使用可自行替换文件
|
||||
* 关键逻辑在于循环体
|
||||
*
|
||||
*/
|
||||
val JsonData: String =
|
||||
GetJsonDataUtil().getJson(this, "province.json") //获取assets目录下的json文件数据
|
||||
// String JsonData1 = new GetJsonDataUtil().getJson(this, "city.json");//获取assets目录下的json文件数据
|
||||
val jsonBean: ArrayList<JsonBean> = parseData(JsonData) //用Gson 转成实体
|
||||
// ArrayList<Province> data = getData(JsonData1);
|
||||
/**
|
||||
* 添加省份数据
|
||||
*
|
||||
* 注意:如果是添加的JavaBean实体,则实体类需要实现 IPickerViewData 接口,
|
||||
* PickerView会通过getPickerViewText方法获取字符串显示出来。
|
||||
*/
|
||||
options1Items = jsonBean
|
||||
for (i in jsonBean.indices) { //遍历省份
|
||||
val cityList = ArrayList<String>() //该省的城市列表(第二级)
|
||||
val province_AreaList = ArrayList<ArrayList<String>>() //该省的所有地区列表(第三极)
|
||||
for (c in 0 until jsonBean[i].cityList.size) { //遍历该省份的所有城市
|
||||
val cityName = jsonBean[i].cityList[c].name
|
||||
cityList.add(cityName) //添加城市
|
||||
val city_AreaList = ArrayList<String>() //该城市的所有地区列表
|
||||
|
||||
//如果无地区数据,建议添加空字符串,防止数据为null 导致三个选项长度不匹配造成崩溃
|
||||
/*if (jsonBean.get(i).getCityList().get(c).getArea() == null
|
||||
|| jsonBean.get(i).getCityList().get(c).getArea().size() == 0) {
|
||||
city_AreaList.add("");
|
||||
} else {
|
||||
city_AreaList.addAll(jsonBean.get(i).getCityList().get(c).getArea());
|
||||
}*/city_AreaList.addAll(jsonBean[i].cityList[c].area)
|
||||
province_AreaList.add(city_AreaList) //添加该省所有地区数据
|
||||
}
|
||||
/**
|
||||
* 添加城市数据
|
||||
*/
|
||||
options2Items.add(cityList)
|
||||
/**
|
||||
* 添加地区数据
|
||||
*/
|
||||
options3Items.add(province_AreaList)
|
||||
}
|
||||
mHandler.sendEmptyMessage(MSG_LOAD_SUCCESS)
|
||||
}
|
||||
|
||||
fun parseData(result: String): ArrayList<JsonBean> { //Gson 解析
|
||||
val detail = ArrayList<JsonBean>()
|
||||
try {
|
||||
val data = JSONArray(result)
|
||||
val gson = Gson()
|
||||
for (i in 0 until data.length()) {
|
||||
val entity = gson.fromJson(data.optJSONObject(i).toString(), JsonBean::class.java)
|
||||
detail.add(entity)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
mHandler.sendEmptyMessage(MSG_LOAD_FAILED)
|
||||
}
|
||||
return detail
|
||||
}
|
||||
|
||||
@SuppressLint("HandlerLeak")
|
||||
private val mHandler: Handler = object : Handler() {
|
||||
override fun handleMessage(msg: Message) {
|
||||
when (msg.what) {
|
||||
MSG_LOAD_DATA -> if (thread == null) { //如果已创建就不再重新创建子线程了
|
||||
thread = Thread { // 子线程中解析省市区数据
|
||||
initJsonData()
|
||||
}
|
||||
thread?.start()
|
||||
}
|
||||
MSG_LOAD_SUCCESS -> {
|
||||
// Toast.makeText(MyInfoActivity.this, "Parse Succeed", Toast.LENGTH_SHORT).show();
|
||||
setProText()
|
||||
isLoaded = true
|
||||
}
|
||||
MSG_LOAD_FAILED -> Toast.makeText(this@AddGoActivity,
|
||||
"地区解析失败",
|
||||
Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package com.dahe.examine.ui.gone.activity
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.dahe.examine.R
|
||||
import com.dahe.examine.adapter.GoneAdapter
|
||||
import com.dahe.examine.adapter.NotReportAdapter
|
||||
import com.dahe.examine.adapter.UserDetailAdapter
|
||||
import com.dahe.examine.bean.ApplyBean
|
||||
import com.dahe.examine.net.BaseObserver
|
||||
import com.dahe.examine.net.DataManager
|
||||
import com.dahe.examine.net.RxHttpCallBack
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
import com.dahe.mylibrary.net.CommonResponseBean
|
||||
import com.dahe.mylibrary.net.PagerBean
|
||||
import kotlinx.android.synthetic.main.activity_not_report.*
|
||||
import kotlinx.android.synthetic.main.fragment_home.*
|
||||
import kotlinx.android.synthetic.main.fragment_home.recyclerView
|
||||
|
||||
/**
|
||||
* @ClassName UserDetailActivity
|
||||
* @Author 用户
|
||||
* @Date 2022/1/17 10:02
|
||||
* @Description TODO
|
||||
*/
|
||||
class NotReportedActivity : BaseActivity() {
|
||||
lateinit var applyAdapter : NotReportAdapter
|
||||
|
||||
override fun getLayout() = R.layout.activity_not_report
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
setStatusBarCancelLightColor()
|
||||
setTitleBar("未报") { finish() }
|
||||
initRec()
|
||||
}
|
||||
|
||||
override fun initDate() {
|
||||
DataManager.getInstance().notList()
|
||||
.compose(DataManager.setThread())
|
||||
.subscribe(BaseObserver(mContext,object : RxHttpCallBack<List<ApplyBean>>(){
|
||||
override fun onSuccess(t: CommonResponseBean<List<ApplyBean>>?) {
|
||||
super.onSuccess(t)
|
||||
tvYf.text = t?.data?.size.toString()
|
||||
applyAdapter.setList(t?.data)
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
fun initRec() {
|
||||
recyclerView.layoutManager = LinearLayoutManager(mContext,
|
||||
LinearLayoutManager.VERTICAL, false)
|
||||
recyclerView.setHasFixedSize(true)
|
||||
applyAdapter = NotReportAdapter(-1)
|
||||
recyclerView.adapter = applyAdapter
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,96 @@
|
||||
package com.dahe.examine.ui.gone.activity
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.dahe.examine.R
|
||||
import com.dahe.examine.adapter.UserDetailAdapter
|
||||
import com.dahe.examine.base.AppConfig
|
||||
import com.dahe.examine.bean.ApplyBean
|
||||
import com.dahe.examine.bean.CountBean
|
||||
import com.dahe.examine.net.BaseObserver
|
||||
import com.dahe.examine.net.DataManager
|
||||
import com.dahe.examine.net.RxHttpCallBack
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
import com.dahe.mylibrary.net.CommonResponseBean
|
||||
import com.dahe.mylibrary.net.PagerBean
|
||||
import kotlinx.android.synthetic.main.activity_user_detail.*
|
||||
import kotlinx.android.synthetic.main.activity_user_detail.tvMf1
|
||||
import kotlinx.android.synthetic.main.activity_user_detail.tvMf2
|
||||
import kotlinx.android.synthetic.main.activity_user_detail.tvMf3
|
||||
import kotlinx.android.synthetic.main.activity_user_detail.tvSf1
|
||||
import kotlinx.android.synthetic.main.activity_user_detail.tvSf2
|
||||
import kotlinx.android.synthetic.main.activity_user_detail.tvSf3
|
||||
import kotlinx.android.synthetic.main.activity_user_detail.tvYf
|
||||
import kotlinx.android.synthetic.main.activity_user_detail.tvYsp
|
||||
import kotlinx.android.synthetic.main.activity_user_detail.tvYsy
|
||||
import kotlinx.android.synthetic.main.fragment_gone.*
|
||||
import kotlinx.android.synthetic.main.fragment_home.recyclerView
|
||||
import retrofit2.http.Url
|
||||
import java.net.URL
|
||||
import java.net.URLEncoder
|
||||
|
||||
/**
|
||||
* @ClassName UserDetailActivity
|
||||
* @Author 用户
|
||||
* @Date 2022/1/17 10:02
|
||||
* @Description TODO
|
||||
*/
|
||||
class UserDetailActivity : BaseActivity() {
|
||||
lateinit var applyAdapter : UserDetailAdapter
|
||||
|
||||
override fun getLayout() = R.layout.activity_user_detail
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
setStatusBarCancelLightColor()
|
||||
setTitleBar("已使用详情") { finish() }
|
||||
initRec()
|
||||
}
|
||||
|
||||
override fun initDate() {
|
||||
val string = intent.extras?.getString(AppConfig.TIME)
|
||||
var bean = intent.extras?.getSerializable(AppConfig.BEAN) as ApplyBean
|
||||
tvTitle.text = bean.enterpriseName
|
||||
|
||||
|
||||
DataManager.getInstance().detailList(bean.userId,bean.chargeType,string)
|
||||
.compose(DataManager.setThread())
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<PagerBean<ApplyBean>>() {
|
||||
override fun onSuccess(t: CommonResponseBean<PagerBean<ApplyBean>>) {
|
||||
super.onSuccess(t)
|
||||
t.data.rows
|
||||
applyAdapter.setList(t.data.rows)
|
||||
}
|
||||
}))
|
||||
getCount(bean.userId,string)
|
||||
}
|
||||
|
||||
fun getCount(userId: String, string: String?) {
|
||||
DataManager.getInstance().useCount(userId,string)
|
||||
.compose(DataManager.setThread())
|
||||
.subscribe(BaseObserver(mContext,object : RxHttpCallBack<CountBean>(){
|
||||
override fun onSuccess(t: CommonResponseBean<CountBean>?) {
|
||||
super.onSuccess(t)
|
||||
tvYf.text = t?.data?.numberOfPasses
|
||||
tvYsy.text = t?.data?.passNoNumber
|
||||
tvYsp.text = t?.data?.notUsedNumber
|
||||
|
||||
tvMf1.text = t?.data?.numberOfPassesMF
|
||||
tvMf2.text = t?.data?.passNoNumberMF
|
||||
tvMf3.text = t?.data?.notUsedNumberMF
|
||||
tvSf1.text = t?.data?.numberOfPassesSF
|
||||
tvSf2.text = t?.data?.passNoNumberSF
|
||||
tvSf3.text = t?.data?.notUsedNumberSF
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
fun initRec() {
|
||||
recyclerView.layoutManager = LinearLayoutManager(mContext,
|
||||
LinearLayoutManager.VERTICAL, false)
|
||||
recyclerView.setHasFixedSize(true)
|
||||
applyAdapter = UserDetailAdapter(-1)
|
||||
recyclerView.adapter = applyAdapter
|
||||
|
||||
|
||||
}
|
||||
}
|
132
app/src/main/java/com/dahe/examine/ui/home/HomeFragment.kt
Normal file
@ -0,0 +1,132 @@
|
||||
package com.dahe.examine.ui.home
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.dahe.dispatch.cuspop.SelectTimePopup
|
||||
import com.dahe.mylibrary.base.BaseFragment
|
||||
import com.dahe.mylibrary.net.CommonResponseBean
|
||||
import com.dahe.mylibrary.net.PagerBean
|
||||
import com.dahe.mylibrary.utils.ActivityUtils
|
||||
import com.dahe.examine.R
|
||||
import com.dahe.examine.adapter.ApplyAdapter
|
||||
import com.dahe.examine.base.AppConfig
|
||||
import com.dahe.examine.bean.ApplyBean
|
||||
import com.dahe.examine.bean.CountBean
|
||||
import com.dahe.examine.bean.PassBean
|
||||
import com.dahe.examine.net.BaseObserver
|
||||
import com.dahe.examine.net.DataManager
|
||||
import com.dahe.examine.net.RxHttpCallBack
|
||||
import com.dahe.examine.ui.home.activity.ApplyActivity
|
||||
import com.dahe.examine.ui.home.activity.ExamineDetailActivity
|
||||
import com.dahe.examine.ui.home.activity.RecordActivity
|
||||
import com.lxj.xpopup.XPopup
|
||||
import kotlinx.android.synthetic.main.fragment_home.*
|
||||
import java.util.*
|
||||
|
||||
class HomeFragment : BaseFragment(), View.OnClickListener {
|
||||
lateinit var applyAdapter: ApplyAdapter
|
||||
var startTime: String = ""
|
||||
var endTime: String = ""
|
||||
|
||||
|
||||
override fun getContentViewLayoutID() = R.layout.fragment_home
|
||||
|
||||
override fun onFragmentVisibleChange(isVisible: Boolean) {
|
||||
if (isVisible) {
|
||||
initData()
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onFragmentFirstVisible() {
|
||||
setTitleBar("待审核", true,"审核记录") {
|
||||
ActivityUtils.startActivityForResult(requireActivity(), RecordActivity::class.java, 1)
|
||||
}
|
||||
|
||||
|
||||
initRec()
|
||||
initData()
|
||||
}
|
||||
|
||||
fun initData() {
|
||||
DataManager.getInstance().appleList("0")
|
||||
.compose(DataManager.setThread())
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<PagerBean<ApplyBean>>() {
|
||||
override fun onSuccess(t: CommonResponseBean<PagerBean<ApplyBean>>) {
|
||||
super.onSuccess(t)
|
||||
|
||||
applyAdapter.setList(t.data.rows)
|
||||
}
|
||||
}))
|
||||
|
||||
getCount()
|
||||
}
|
||||
|
||||
fun getCount(){
|
||||
DataManager.getInstance().count()
|
||||
.compose(DataManager.setThread())
|
||||
.subscribe(BaseObserver(mContext,object : RxHttpCallBack<CountBean>(){
|
||||
override fun onSuccess(t: CommonResponseBean<CountBean>?) {
|
||||
super.onSuccess(t)
|
||||
tvYsq.text = t?.data?.requiredNum
|
||||
tvMf1.text = t?.data?.requiredNumMF
|
||||
tvSf1.text = t?.data?.requiredNumSF
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
// R.id.tvSearch -> search()
|
||||
}
|
||||
}
|
||||
|
||||
fun search() {
|
||||
XPopup.Builder(mContext)
|
||||
.enableDrag(true)
|
||||
.hasShadowBg(true)
|
||||
.isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
|
||||
.asCustom(SelectTimePopup(mContext).setOnMyItemClickListener(object :
|
||||
SelectTimePopup.OnMyItemClickListener {
|
||||
override fun onItemClick(startTime: String, endTime: String) {
|
||||
this@HomeFragment.startTime = startTime
|
||||
this@HomeFragment.endTime = endTime
|
||||
initData()
|
||||
}
|
||||
}))
|
||||
.show()
|
||||
}
|
||||
|
||||
|
||||
fun initRec() {
|
||||
recyclerView.layoutManager =
|
||||
LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false)
|
||||
recyclerView.setHasFixedSize(true)
|
||||
applyAdapter = ApplyAdapter(-1)
|
||||
recyclerView.adapter = applyAdapter
|
||||
|
||||
applyAdapter.addChildClickViewIds(R.id.tvSh)
|
||||
applyAdapter.setOnItemChildClickListener { adapter, view, position ->
|
||||
val applyBean = applyAdapter.data[position]
|
||||
val bundle = Bundle()
|
||||
bundle.putSerializable(AppConfig.BEAN,applyBean)
|
||||
ActivityUtils.startActivity(mContext, ExamineDetailActivity::class.java,bundle)
|
||||
}
|
||||
|
||||
|
||||
// val mutableListOf = mutableListOf<ApplyBean>()
|
||||
// mutableListOf.add(ApplyBean())
|
||||
// mutableListOf.add(ApplyBean())
|
||||
// mutableListOf.add(ApplyBean())
|
||||
// applyAdapter.setList(mutableListOf)
|
||||
|
||||
// applyAdapter.setOnItemClickListener { adapter, view, position ->
|
||||
// ActivityUtils.startActivity(mContext, ApplyDetailActivity::class.java)
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,399 @@
|
||||
package com.dahe.examine.ui.home.activity
|
||||
|
||||
import android.annotation.SuppressLint
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.os.Message
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import com.bigkoo.pickerview.builder.OptionsPickerBuilder
|
||||
import com.bigkoo.pickerview.view.OptionsPickerView
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
import com.dahe.mylibrary.net.CommonResponseBean
|
||||
import com.dahe.examine.R
|
||||
import com.dahe.examine.bean.*
|
||||
import com.dahe.examine.net.BaseObserver
|
||||
import com.dahe.examine.net.DataManager
|
||||
import com.dahe.examine.net.RxHttpCallBack
|
||||
import com.dahe.examine.utils.GetJsonDataUtil
|
||||
import com.google.gson.Gson
|
||||
import kotlinx.android.synthetic.main.activity_apply.*
|
||||
import org.json.JSONArray
|
||||
import java.util.ArrayList
|
||||
|
||||
/**
|
||||
* @ClassName ApplyActivity
|
||||
* @Author 用户
|
||||
* @Date 2022/1/13 15:42
|
||||
* @Description TODO
|
||||
*/
|
||||
class ApplyActivity : BaseActivity(), View.OnClickListener {
|
||||
|
||||
lateinit var curCompanyBean: CompanyBean
|
||||
lateinit var curCompanyType: CompanyTypeBean
|
||||
lateinit var jb: String
|
||||
lateinit var sheng: String
|
||||
lateinit var shi: String
|
||||
lateinit var xian: String
|
||||
|
||||
|
||||
override fun getLayout() = R.layout.activity_apply
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
setStatusBarCancelLightColor()
|
||||
setTitleBar("申请") { finish() }
|
||||
tvSpdw.setOnClickListener(this)
|
||||
tvDz.setOnClickListener(this)
|
||||
tvSub.setOnClickListener(this)
|
||||
llQylx.setOnClickListener(this)
|
||||
tvJb.setOnClickListener(this)
|
||||
}
|
||||
|
||||
override fun initDate() {
|
||||
}
|
||||
|
||||
override fun onClick(view: View) {
|
||||
super.onClick(view)
|
||||
when (view.id) {
|
||||
R.id.tvSpdw -> spdw()
|
||||
R.id.tvSub -> sub()
|
||||
R.id.tvDz -> {
|
||||
if (isLoaded) {
|
||||
setProText()
|
||||
} else {
|
||||
mHandler.sendEmptyMessage(MSG_LOAD_DATA)
|
||||
}
|
||||
}
|
||||
|
||||
R.id.llQylx -> qymc()
|
||||
R.id.tvJb -> gjjb()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fun gjjb() {
|
||||
val mutableListOf = mutableListOf<CompanyBean>()
|
||||
val build = OptionsPickerBuilder(mContext
|
||||
) { options1, options2, options3, v -> //返回的分别是三个级别的选中位置
|
||||
jb = mutableListOf.get(options1).signName
|
||||
tvJb.text = mutableListOf.get(options1).signName
|
||||
}
|
||||
.setTitleText("国家级别")
|
||||
.setContentTextSize(20) //设置滚轮文字大小
|
||||
.setDividerColor(Color.LTGRAY) //设置分割线的颜色
|
||||
.setSelectOptions(0, 1) //默认选中项
|
||||
.setTitleColor(Color.BLACK)
|
||||
.setSubmitColor(Color.parseColor("#F1474B")) //确定按钮文字颜色
|
||||
.setCancelColor(Color.parseColor("#F1474B")) //取消按钮文字颜色
|
||||
.setTitleBgColor(Color.parseColor("#FFFFFF"))
|
||||
.setBgColor(Color.parseColor("#F5F5F5"))
|
||||
.setTextColorCenter(Color.LTGRAY)
|
||||
.isRestoreItem(true) //切换时是否还原,设置默认选中第一项。
|
||||
.isCenterLabel(false) //是否只显示中间选中项的label文字,false则每项item全部都带有label。
|
||||
.setLabels("", "", "")
|
||||
// .setOutSideColor(0x00000000) //设置外部遮罩颜色
|
||||
.setOptionsSelectChangeListener { options1, options2, options3 ->
|
||||
val str =
|
||||
"options1: $options1\noptions2: $options2\noptions3: $options3"
|
||||
// Toast.makeText(this@MainActivity, str, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
.build<CompanyBean>()
|
||||
mutableListOf.add(CompanyBean("否"))
|
||||
mutableListOf.add(CompanyBean("A"))
|
||||
mutableListOf.add(CompanyBean("AA"))
|
||||
mutableListOf.add(CompanyBean("AAA"))
|
||||
mutableListOf.add(CompanyBean("AAAA"))
|
||||
|
||||
|
||||
|
||||
build.setPicker(mutableListOf)
|
||||
|
||||
build.show()
|
||||
}
|
||||
|
||||
|
||||
fun spdw() {
|
||||
|
||||
DataManager.getInstance().companyLst()
|
||||
.compose(DataManager.setThread())
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<List<CompanyBean>>(this) {
|
||||
override fun onSuccess(t: CommonResponseBean<List<CompanyBean>>) {
|
||||
super.onSuccess(t)
|
||||
val data = t.data
|
||||
|
||||
|
||||
val mutableListOf = mutableListOf<CompanyBean>()
|
||||
val build = OptionsPickerBuilder(mContext
|
||||
) { options1, options2, options3, v -> //返回的分别是三个级别的选中位置
|
||||
curCompanyBean = mutableListOf.get(options1)
|
||||
tvSpdw.text = mutableListOf.get(options1).signName
|
||||
}
|
||||
.setTitleText("审批单位")
|
||||
.setContentTextSize(20) //设置滚轮文字大小
|
||||
.setDividerColor(Color.LTGRAY) //设置分割线的颜色
|
||||
.setSelectOptions(0, 1) //默认选中项
|
||||
.setTitleColor(Color.BLACK)
|
||||
.setSubmitColor(Color.parseColor("#F1474B")) //确定按钮文字颜色
|
||||
.setCancelColor(Color.parseColor("#F1474B")) //取消按钮文字颜色
|
||||
.setTitleBgColor(Color.parseColor("#FFFFFF"))
|
||||
.setBgColor(Color.parseColor("#F5F5F5"))
|
||||
.setTextColorCenter(Color.LTGRAY)
|
||||
.isRestoreItem(true) //切换时是否还原,设置默认选中第一项。
|
||||
.isCenterLabel(false) //是否只显示中间选中项的label文字,false则每项item全部都带有label。
|
||||
.setLabels("", "", "")
|
||||
// .setOutSideColor(0x00000000) //设置外部遮罩颜色
|
||||
.setOptionsSelectChangeListener { options1, options2, options3 ->
|
||||
val str =
|
||||
"options1: $options1\noptions2: $options2\noptions3: $options3"
|
||||
// Toast.makeText(this@MainActivity, str, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
.build<CompanyBean>()
|
||||
|
||||
data.forEach {
|
||||
mutableListOf.add(it)
|
||||
}
|
||||
|
||||
|
||||
|
||||
build.setPicker(mutableListOf)
|
||||
|
||||
build.show()
|
||||
|
||||
}
|
||||
}))
|
||||
|
||||
|
||||
}
|
||||
|
||||
fun qymc() {
|
||||
if (!::curCompanyBean.isInitialized) {
|
||||
showToast("请选择审批单位")
|
||||
return
|
||||
}
|
||||
DataManager.getInstance().typeLst(curCompanyBean.sign)
|
||||
.compose(DataManager.setThread())
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<List<CompanyTypeBean>>(this) {
|
||||
override fun onSuccess(t: CommonResponseBean<List<CompanyTypeBean>>) {
|
||||
super.onSuccess(t)
|
||||
val data = t.data
|
||||
|
||||
|
||||
val mutableListOf = mutableListOf<CompanyTypeBean>()
|
||||
val build = OptionsPickerBuilder(mContext
|
||||
) { options1, options2, options3, v -> //返回的分别是三个级别的选中位置
|
||||
curCompanyType = mutableListOf.get(options1)
|
||||
tvQylx.text = mutableListOf.get(options1).enterpriseTypeName
|
||||
}
|
||||
.setTitleText("审批单位")
|
||||
.setContentTextSize(20) //设置滚轮文字大小
|
||||
.setDividerColor(Color.LTGRAY) //设置分割线的颜色
|
||||
.setSelectOptions(0, 1) //默认选中项
|
||||
.setTitleColor(Color.BLACK)
|
||||
.setSubmitColor(Color.parseColor("#F1474B")) //确定按钮文字颜色
|
||||
.setCancelColor(Color.parseColor("#F1474B")) //取消按钮文字颜色
|
||||
.setTitleBgColor(Color.parseColor("#FFFFFF"))
|
||||
.setBgColor(Color.parseColor("#F5F5F5"))
|
||||
.setTextColorCenter(Color.LTGRAY)
|
||||
.isRestoreItem(true) //切换时是否还原,设置默认选中第一项。
|
||||
.isCenterLabel(false) //是否只显示中间选中项的label文字,false则每项item全部都带有label。
|
||||
.setLabels("", "", "")
|
||||
// .setOutSideColor(0x00000000) //设置外部遮罩颜色
|
||||
.setOptionsSelectChangeListener { options1, options2, options3 ->
|
||||
val str =
|
||||
"options1: $options1\noptions2: $options2\noptions3: $options3"
|
||||
// Toast.makeText(this@MainActivity, str, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
.build<CompanyTypeBean>()
|
||||
|
||||
data.forEach {
|
||||
mutableListOf.add(it)
|
||||
}
|
||||
|
||||
|
||||
|
||||
build.setPicker(mutableListOf)
|
||||
|
||||
build.show()
|
||||
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
fun sub() {
|
||||
|
||||
if (!::curCompanyBean.isInitialized || !::curCompanyType.isInitialized || !::jb.isInitialized ||
|
||||
!::shi.isInitialized || etQymc.text.toString().isNullOrEmpty() ||
|
||||
etLxr.text.toString().isNullOrEmpty() || etPhone.text.toString().isNullOrEmpty() ||
|
||||
etCl.text.toString().isNullOrEmpty() || etTxz.text.toString().isNullOrEmpty()
|
||||
) {
|
||||
showToast("请完善信息")
|
||||
return
|
||||
}
|
||||
|
||||
val applySendBean = ApplySendBean()
|
||||
applySendBean.sign = curCompanyBean.sign
|
||||
applySendBean.enterpriseName = etQymc.text.toString()
|
||||
applySendBean.typeId = curCompanyType.typeId
|
||||
applySendBean.provinceName = sheng
|
||||
applySendBean.cityName = shi
|
||||
applySendBean.countyName = xian
|
||||
applySendBean.nationalClassA = jb
|
||||
applySendBean.enterpriseContact = etLxr.text.toString()
|
||||
applySendBean.enterpriseContactPhone = etPhone.text.toString()
|
||||
applySendBean.vehiclesNumber = etCl.text.toString()
|
||||
applySendBean.numberOfPassesRequired = etTxz.text.toString()
|
||||
|
||||
|
||||
DataManager.getInstance().applySend(applySendBean)
|
||||
.compose(DataManager.setThread())
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
|
||||
override fun onSuccess(t: CommonResponseBean<Any>?) {
|
||||
super.onSuccess(t)
|
||||
finish()
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
private var options1Items = ArrayList<JsonBean>()
|
||||
private val options2Items = ArrayList<ArrayList<String>>()
|
||||
private val options3Items = ArrayList<ArrayList<ArrayList<String>>>()
|
||||
private val MSG_LOAD_DATA = 0x0001
|
||||
private val MSG_LOAD_SUCCESS = 0x0002
|
||||
private val MSG_LOAD_FAILED = 0x0003
|
||||
private var thread: Thread? = null
|
||||
private var isLoaded = false
|
||||
|
||||
|
||||
private fun setProText() {
|
||||
val pvOptions: OptionsPickerView<*> = OptionsPickerBuilder(this@ApplyActivity
|
||||
) { options1, options2, options3, v ->
|
||||
//返回的分别是三个级别的选中位置
|
||||
val opt1tx =
|
||||
if (options1Items.size > 0) options1Items.get(options1).getPickerViewText() else ""
|
||||
val opt2tx = if (options2Items.size > 0
|
||||
&& options2Items.get(options1).size > 0
|
||||
) options2Items.get(options1).get(options2) else ""
|
||||
val opt3tx =
|
||||
if (options2Items.size > 0 && options3Items.get(options1).size > 0 && options3Items.get(
|
||||
options1).get(options2).size > 0
|
||||
) options3Items.get(options1).get(options2).get(options3) else ""
|
||||
sheng = opt1tx
|
||||
shi = opt2tx
|
||||
xian = opt3tx
|
||||
val tx = "$opt1tx-$opt2tx-$opt3tx"
|
||||
tvDz.text = tx
|
||||
// val userBean = UserBean()
|
||||
// userBean.setAddress(tx)
|
||||
// DataManager.getInstance().editObj(userBean)
|
||||
// .subscribeOn(Schedulers.io())
|
||||
// .observeOn(AndroidSchedulers.mainThread())
|
||||
// .subscribe(BaseObserver(mContext, object : RxHttpCallBack() {
|
||||
// fun onSuccess(t: CommonResponseBean?) {
|
||||
// super.onSuccess(t)
|
||||
// userInfo.setAddress(tx)
|
||||
// SPUtils.setUserInfo(this@MyInfoActivity,
|
||||
// JsonUtils.getInstance().getGson().toJson(userInfo))
|
||||
// }
|
||||
// }))
|
||||
|
||||
|
||||
// Toast.makeText(MyInfoActivity.this, tx, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
.setSubmitColor(Color.parseColor("#F1474B")) //确定按钮文字颜色
|
||||
.setCancelColor(Color.parseColor("#F1474B")) //取消按钮文字颜色
|
||||
.setTitleBgColor(Color.parseColor("#FFFFFF"))
|
||||
.setBgColor(Color.parseColor("#F5F5F5"))
|
||||
.setContentTextSize(20)
|
||||
.build<Any>()
|
||||
pvOptions.setPicker(options1Items as List<Nothing>?,
|
||||
options2Items as List<Nothing>?, options3Items as List<Nothing>?) //三级选择器
|
||||
pvOptions.show()
|
||||
}
|
||||
|
||||
private fun initJsonData() { //解析数据
|
||||
/**
|
||||
* 注意:assets 目录下的Json文件仅供参考,实际使用可自行替换文件
|
||||
* 关键逻辑在于循环体
|
||||
*
|
||||
*/
|
||||
val JsonData: String =
|
||||
GetJsonDataUtil().getJson(this, "province.json") //获取assets目录下的json文件数据
|
||||
// String JsonData1 = new GetJsonDataUtil().getJson(this, "city.json");//获取assets目录下的json文件数据
|
||||
val jsonBean: ArrayList<JsonBean> = parseData(JsonData) //用Gson 转成实体
|
||||
// ArrayList<Province> data = getData(JsonData1);
|
||||
/**
|
||||
* 添加省份数据
|
||||
*
|
||||
* 注意:如果是添加的JavaBean实体,则实体类需要实现 IPickerViewData 接口,
|
||||
* PickerView会通过getPickerViewText方法获取字符串显示出来。
|
||||
*/
|
||||
options1Items = jsonBean
|
||||
for (i in jsonBean.indices) { //遍历省份
|
||||
val cityList = ArrayList<String>() //该省的城市列表(第二级)
|
||||
val province_AreaList = ArrayList<ArrayList<String>>() //该省的所有地区列表(第三极)
|
||||
for (c in 0 until jsonBean[i].cityList.size) { //遍历该省份的所有城市
|
||||
val cityName = jsonBean[i].cityList[c].name
|
||||
cityList.add(cityName) //添加城市
|
||||
val city_AreaList = ArrayList<String>() //该城市的所有地区列表
|
||||
|
||||
//如果无地区数据,建议添加空字符串,防止数据为null 导致三个选项长度不匹配造成崩溃
|
||||
/*if (jsonBean.get(i).getCityList().get(c).getArea() == null
|
||||
|| jsonBean.get(i).getCityList().get(c).getArea().size() == 0) {
|
||||
city_AreaList.add("");
|
||||
} else {
|
||||
city_AreaList.addAll(jsonBean.get(i).getCityList().get(c).getArea());
|
||||
}*/city_AreaList.addAll(jsonBean[i].cityList[c].area)
|
||||
province_AreaList.add(city_AreaList) //添加该省所有地区数据
|
||||
}
|
||||
/**
|
||||
* 添加城市数据
|
||||
*/
|
||||
options2Items.add(cityList)
|
||||
/**
|
||||
* 添加地区数据
|
||||
*/
|
||||
options3Items.add(province_AreaList)
|
||||
}
|
||||
mHandler.sendEmptyMessage(MSG_LOAD_SUCCESS)
|
||||
}
|
||||
|
||||
fun parseData(result: String): ArrayList<JsonBean> { //Gson 解析
|
||||
val detail = ArrayList<JsonBean>()
|
||||
try {
|
||||
val data = JSONArray(result)
|
||||
val gson = Gson()
|
||||
for (i in 0 until data.length()) {
|
||||
val entity = gson.fromJson(data.optJSONObject(i).toString(), JsonBean::class.java)
|
||||
detail.add(entity)
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
e.printStackTrace()
|
||||
mHandler.sendEmptyMessage(MSG_LOAD_FAILED)
|
||||
}
|
||||
return detail
|
||||
}
|
||||
|
||||
@SuppressLint("HandlerLeak")
|
||||
private val mHandler: Handler = object : Handler() {
|
||||
override fun handleMessage(msg: Message) {
|
||||
when (msg.what) {
|
||||
MSG_LOAD_DATA -> if (thread == null) { //如果已创建就不再重新创建子线程了
|
||||
thread = Thread { // 子线程中解析省市区数据
|
||||
initJsonData()
|
||||
}
|
||||
thread?.start()
|
||||
}
|
||||
MSG_LOAD_SUCCESS -> {
|
||||
// Toast.makeText(MyInfoActivity.this, "Parse Succeed", Toast.LENGTH_SHORT).show();
|
||||
setProText()
|
||||
isLoaded = true
|
||||
}
|
||||
MSG_LOAD_FAILED -> Toast.makeText(this@ApplyActivity,
|
||||
"地区解析失败",
|
||||
Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.dahe.examine.ui.home.activity
|
||||
|
||||
import android.os.Bundle
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
import com.dahe.examine.R
|
||||
|
||||
/**
|
||||
* @ClassName ApplyDetailActivity
|
||||
* @Author 用户
|
||||
* @Date 2022/1/15 9:51
|
||||
* @Description TODO
|
||||
*/
|
||||
class ApplyDetailActivity : BaseActivity() {
|
||||
override fun getLayout() = R.layout.activity_apply_detail
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
setStatusBarCancelLightColor()
|
||||
setTitleBar("申请详情") { finish() }
|
||||
}
|
||||
|
||||
override fun initDate() {
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,182 @@
|
||||
package com.dahe.examine.ui.home.activity
|
||||
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.text.TextUtils
|
||||
import android.view.View
|
||||
import android.widget.TextView
|
||||
import androidx.core.widget.addTextChangedListener
|
||||
import com.bigkoo.pickerview.builder.TimePickerBuilder
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
import com.dahe.examine.R
|
||||
import com.dahe.examine.base.AppConfig
|
||||
import com.dahe.examine.bean.AddresBean
|
||||
import com.dahe.examine.bean.ApplyBean
|
||||
import com.dahe.examine.net.BaseObserver
|
||||
import com.dahe.examine.net.DataManager
|
||||
import com.dahe.examine.net.RxHttpCallBack
|
||||
import com.dahe.mylibrary.net.CommonResponseBean
|
||||
import com.dahe.mylibrary.utils.TimeUtil
|
||||
import kotlinx.android.synthetic.main.activity_examine_detail.*
|
||||
import kotlinx.android.synthetic.main.pop_sel_time.view.*
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* @ClassName ApplyDetailActivity
|
||||
* @Author 用户
|
||||
* @Date 2022/1/15 9:51
|
||||
* @Description TODO
|
||||
*/
|
||||
class ExamineDetailActivity : BaseActivity(), View.OnClickListener {
|
||||
lateinit var bean : ApplyBean
|
||||
override fun getLayout() = R.layout.activity_examine_detail
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
setStatusBarCancelLightColor()
|
||||
setTitleBar("审核") { finish() }
|
||||
tvStartTime.setOnClickListener(this)
|
||||
tvEndTime.setOnClickListener(this)
|
||||
tvNo.setOnClickListener(this)
|
||||
tvOk.setOnClickListener(this)
|
||||
|
||||
|
||||
}
|
||||
|
||||
override fun initDate() {
|
||||
bean = intent.extras?.getSerializable(AppConfig.BEAN) as ApplyBean
|
||||
if (null!=bean){
|
||||
tvTitle.text = bean.enterpriseName
|
||||
tvDq.text = """地区: ${bean.cityName}"""
|
||||
tvLx.text = """类型: ${bean.itemTypeName.let { it }?:""}"""
|
||||
tvJb.text = """国家A级: ${bean.nationalClassA}"""
|
||||
tvCls.text = bean.vehiclesNumber
|
||||
tvXqs.text = bean.numberOfPassesRequired
|
||||
tvFzr.text = """负责人: ${bean.enterpriseContact}"""
|
||||
tvPhone.text = """电话: ${bean.enterpriseContactPhone}"""
|
||||
|
||||
|
||||
DataManager.getInstance().appUser(bean.userId)
|
||||
.compose(DataManager.setThread())
|
||||
.subscribe(BaseObserver(mContext,object : RxHttpCallBack<AddresBean>(){
|
||||
override fun onSuccess(t: CommonResponseBean<AddresBean>) {
|
||||
super.onSuccess(t)
|
||||
val data = t.data
|
||||
tvZcdz.text = data.placeOfRegistration
|
||||
tvBgdz.text = data.companyAddress
|
||||
tvCqdz.text = data.plantAddress
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
override fun onClick(view: View?) {
|
||||
super.onClick(view)
|
||||
when (view?.id) {
|
||||
R.id.tvStartTime -> setBir(0, tvStartTime)
|
||||
R.id.tvEndTime -> setBir(1, tvEndTime)
|
||||
R.id.tvNo -> no()
|
||||
R.id.tvOk -> ok()
|
||||
}
|
||||
}
|
||||
|
||||
fun no(){
|
||||
|
||||
if (etNo.text.isNullOrEmpty()){
|
||||
showToast("请输入拒绝原因")
|
||||
return
|
||||
}
|
||||
val applyBean = ApplyBean()
|
||||
applyBean.infoId = bean.infoId
|
||||
applyBean.numberOfPasses = "0"
|
||||
// applyBean.passUsageStartTime = tvStartTime.text.toString()
|
||||
// applyBean.passUsageEndTime = tvEndTime.text.toString()
|
||||
applyBean.status = "2"
|
||||
applyBean.remarks = etNo.text.toString()
|
||||
DataManager.getInstance().appleEdit(applyBean)
|
||||
.compose(DataManager.setThread())
|
||||
.subscribe(BaseObserver(mContext,object : RxHttpCallBack<Any>(){
|
||||
override fun onSuccess(t: CommonResponseBean<Any>?) {
|
||||
super.onSuccess(t)
|
||||
showToast("拒绝成功")
|
||||
finish()
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
fun ok(){
|
||||
val i = etCount.text.toString().toIntOrNull()
|
||||
val xqs = tvXqs.text.toString().toInt()
|
||||
if (i != null) {
|
||||
if (i>xqs){
|
||||
showToast("审批数不能大于需求数")
|
||||
return
|
||||
}
|
||||
}else{
|
||||
showToast("请填写审批数")
|
||||
return
|
||||
}
|
||||
|
||||
if (tvStartTime.text.isNullOrEmpty()||tvEndTime.text.isNullOrEmpty()){
|
||||
showToast("请选择时间")
|
||||
return
|
||||
}
|
||||
val applyBean = ApplyBean()
|
||||
applyBean.infoId = bean.infoId
|
||||
applyBean.numberOfPasses = etCount.text.toString()
|
||||
applyBean.passUsageStartTime = tvStartTime.text.toString()
|
||||
applyBean.passUsageEndTime = tvEndTime.text.toString()
|
||||
applyBean.status = "1"
|
||||
DataManager.getInstance().appleEdit(applyBean)
|
||||
.compose(DataManager.setThread())
|
||||
.subscribe(BaseObserver(mContext,object : RxHttpCallBack<Any>(){
|
||||
override fun onSuccess(t: CommonResponseBean<Any>?) {
|
||||
super.onSuccess(t)
|
||||
showToast("审核成功")
|
||||
finish()
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
fun setBir(type: Int, view: TextView) {
|
||||
val startDate = Calendar.getInstance()
|
||||
val endtDate = Calendar.getInstance()
|
||||
val currDate = Calendar.getInstance()
|
||||
startDate[1990, 0] = 1
|
||||
endtDate[2100, 0] = 1
|
||||
|
||||
|
||||
if (!TextUtils.isEmpty(view.getText())) {
|
||||
val date = TimeUtil.string2Date(view.getText().toString(),
|
||||
SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()))
|
||||
if (date != null) currDate.time = date
|
||||
}
|
||||
|
||||
|
||||
val pvTime = TimePickerBuilder(
|
||||
mContext
|
||||
) { date, v -> //选中事件回调
|
||||
// TimeUtil.date2String(date,SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()))
|
||||
val data =
|
||||
TimeUtil.date2String(date, SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()))
|
||||
view.text = data
|
||||
}.setSubmitColor(Color.parseColor("#F1474B")) //确定按钮文字颜色
|
||||
.setCancelColor(Color.parseColor("#F1474B")) //取消按钮文字颜色
|
||||
.setTitleBgColor(Color.parseColor("#FFFFFF"))
|
||||
.setType(booleanArrayOf(true, true, true, false, false, false))
|
||||
.setTitleText(if (0 == type) {
|
||||
"开始时间"
|
||||
} else {
|
||||
"结束时间"
|
||||
})
|
||||
.setDate(currDate)
|
||||
.setRangDate(startDate, endtDate)
|
||||
.isDialog(false)
|
||||
.setBgColor(Color.parseColor("#F5F5F5"))
|
||||
.build()
|
||||
// pvTime.setDate(Calendar.getInstance());//注:根据需求来决定是否使用该方法(一般是精确到秒的情况),此项可以在弹出选择器的时候重新设置当前时间,避免在初始化之后由于时间已经设定,导致选中时间与当前时间不匹配的问题。
|
||||
pvTime.show()
|
||||
}
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package com.dahe.examine.ui.home.activity
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
import com.dahe.examine.R
|
||||
import com.dahe.examine.adapter.ApplyAdapter
|
||||
import com.dahe.examine.adapter.RecordAdapter
|
||||
import com.dahe.examine.bean.ApplyBean
|
||||
import com.dahe.examine.bean.CountBean
|
||||
import com.dahe.examine.net.BaseObserver
|
||||
import com.dahe.examine.net.DataManager
|
||||
import com.dahe.examine.net.RxHttpCallBack
|
||||
import com.dahe.mylibrary.net.CommonResponseBean
|
||||
import com.dahe.mylibrary.net.PagerBean
|
||||
import kotlinx.android.synthetic.main.activity_record.*
|
||||
|
||||
/**
|
||||
* @ClassName ApplyDetailActivity
|
||||
* @Author 用户
|
||||
* @Date 2022/1/15 9:51
|
||||
* @Description TODO
|
||||
*/
|
||||
class RecordActivity : BaseActivity() {
|
||||
|
||||
lateinit var applyAdapter : RecordAdapter
|
||||
override fun getLayout() = R.layout.activity_record
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
setStatusBarCancelLightColor()
|
||||
setTitleBar("审核记录") { finish() }
|
||||
initRec()
|
||||
}
|
||||
|
||||
override fun initDate() {
|
||||
DataManager.getInstance().historyList()
|
||||
.compose(DataManager.setThread())
|
||||
.subscribe(BaseObserver(mContext,object : RxHttpCallBack<PagerBean<ApplyBean>>(){
|
||||
override fun onSuccess(t: CommonResponseBean<PagerBean<ApplyBean>>) {
|
||||
super.onSuccess(t)
|
||||
applyAdapter.setList(t.data.rows)
|
||||
}
|
||||
}))
|
||||
getCount()
|
||||
}
|
||||
|
||||
fun getCount(){
|
||||
DataManager.getInstance().historyCount()
|
||||
.compose(DataManager.setThread())
|
||||
.subscribe(BaseObserver(mContext,object : RxHttpCallBack<CountBean>(){
|
||||
override fun onSuccess(t: CommonResponseBean<CountBean>?) {
|
||||
super.onSuccess(t)
|
||||
tvYsq.text = t?.data?.requiredNum
|
||||
tvYsp.text = t?.data?.passesNum
|
||||
|
||||
tvMf1.text = t?.data?.requiredNumMF
|
||||
tvSf1.text = t?.data?.requiredNumSF
|
||||
tvMf2.text = t?.data?.passesNumMF
|
||||
TvSf2.text = t?.data?.passesNumSF
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
fun initRec() {
|
||||
recyclerView.layoutManager =
|
||||
LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false)
|
||||
recyclerView.setHasFixedSize(true)
|
||||
applyAdapter = RecordAdapter(-1)
|
||||
recyclerView.adapter = applyAdapter
|
||||
|
||||
}
|
||||
}
|
55
app/src/main/java/com/dahe/examine/ui/mine/MineFragment.kt
Normal file
@ -0,0 +1,55 @@
|
||||
package com.dahe.examine.ui.mine
|
||||
|
||||
import android.content.Intent
|
||||
import android.view.View
|
||||
import com.dahe.dispatch.utils.UserUtils
|
||||
import com.dahe.mylibrary.base.BaseFragment
|
||||
import com.dahe.mylibrary.utils.ActivityUtils
|
||||
import com.dahe.examine.R
|
||||
import com.dahe.examine.ui.account.LoginActivity
|
||||
import com.dahe.examine.ui.mine.activity.ChangePhoneActivity
|
||||
import com.dahe.examine.ui.mine.activity.ChangePwdActivity
|
||||
import com.dahe.examine.utils.AppActivityUtils
|
||||
import com.dahe.examine.utils.SPUtils
|
||||
import kotlinx.android.synthetic.main.fragment_mine.*
|
||||
|
||||
class MineFragment : BaseFragment(), View.OnClickListener {
|
||||
override fun getContentViewLayoutID() = R.layout.fragment_mine
|
||||
|
||||
override fun onFragmentVisibleChange(isVisible: Boolean) {
|
||||
if (isVisible) {
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onFragmentFirstVisible() {
|
||||
rlPass.setOnClickListener(this)
|
||||
rlPhone.setOnClickListener(this)
|
||||
btnOut.setOnClickListener(this)
|
||||
|
||||
val userInfo = SPUtils.getUserInfo(mContext).userInfo
|
||||
if (null==userInfo)
|
||||
return
|
||||
tvName.text = userInfo.signName
|
||||
tvPhone.text = userInfo.userName
|
||||
}
|
||||
|
||||
override fun onClick(v: View) {
|
||||
when (v.id) {
|
||||
R.id.rlPass->ActivityUtils.startActivity(mContext,ChangePwdActivity::class.java)
|
||||
R.id.rlPhone-> AppActivityUtils.openWebViewActivity(mContext, "隐私政策",
|
||||
"http://tms.down.user.test.dahehuodongbao.com/user-privacy.html")
|
||||
// R.id.rlPhone->ActivityUtils.startActivity(mContext,ChangePhoneActivity::class.java)
|
||||
R.id.btnOut->logOut()
|
||||
}
|
||||
}
|
||||
|
||||
fun logOut(){
|
||||
UserUtils.instance.loginOut(requireActivity())
|
||||
val intent = Intent(mContext, LoginActivity::class.java)
|
||||
intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
requireActivity().startActivity(intent)
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,94 @@
|
||||
package com.dahe.examine.ui.mine.activity
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import com.dahe.dispatch.utils.UserUtils
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
import com.dahe.mylibrary.net.CommonResponseBean
|
||||
import com.dahe.mylibrary.utils.CountDownTimerUtils
|
||||
import com.dahe.mylibrary.utils.PhoneFormatCheckUtils
|
||||
import com.dahe.examine.R
|
||||
import com.dahe.examine.net.BaseObserver
|
||||
import com.dahe.examine.net.DataManager
|
||||
import com.dahe.examine.net.RxHttpCallBack
|
||||
import com.dahe.examine.ui.account.LoginActivity
|
||||
import com.dahe.examine.utils.SPUtils
|
||||
import kotlinx.android.synthetic.main.activity_change_phone.*
|
||||
|
||||
/**
|
||||
* @ClassName ChangePwdActivity
|
||||
* @Author 用户
|
||||
* @Date 2022/1/13 16:59
|
||||
* @Description TODO
|
||||
*/
|
||||
class ChangePhoneActivity : BaseActivity(), View.OnClickListener {
|
||||
override fun getLayout() = R.layout.activity_change_phone
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
setStatusBarCancelLightColor()
|
||||
setTitleBar("修改手机号") { finish() }
|
||||
val phone = SPUtils.getUserInfo(this).userInfo.phone
|
||||
tvPhone.text = phone
|
||||
|
||||
tvCode.setOnClickListener(this)
|
||||
btn_log.setOnClickListener(this)
|
||||
}
|
||||
|
||||
override fun initDate() {
|
||||
|
||||
}
|
||||
|
||||
override fun onClick(view: View?) {
|
||||
super.onClick(view)
|
||||
when(view?.id){
|
||||
R.id.tvCode->getCode()
|
||||
R.id.btn_log->sub()
|
||||
}
|
||||
}
|
||||
|
||||
fun sub(){
|
||||
|
||||
val phone = etCode.text.toString()
|
||||
val code = etPass.text.toString()
|
||||
|
||||
if (phone.isNullOrEmpty()||code.isNullOrEmpty()){
|
||||
showToast("请完善信息")
|
||||
return
|
||||
}
|
||||
|
||||
DataManager.getInstance().phoneEdit(phone,code)
|
||||
.compose(DataManager.setThread())
|
||||
.subscribe(BaseObserver(mContext,object :RxHttpCallBack<Any>(){
|
||||
override fun onSuccess(t: CommonResponseBean<Any>?) {
|
||||
super.onSuccess(t)
|
||||
// finish()
|
||||
|
||||
UserUtils.instance.loginOut(this@ChangePhoneActivity)
|
||||
val intent = Intent(mContext, LoginActivity::class.java)
|
||||
intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
startActivity(intent)
|
||||
// ActivityUtils.finishToActivity(LoginActivity::class.java,true)
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
fun getCode() {
|
||||
|
||||
var phone = etCode.text.toString()
|
||||
if (PhoneFormatCheckUtils.isPhoneLegal(phone)) {
|
||||
DataManager.getInstance().getSmsCode(phone)
|
||||
.compose(DataManager.setThread())
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
|
||||
override fun onSuccess(t: CommonResponseBean<Any>?) {
|
||||
super.onSuccess(t)
|
||||
val countDownTimerUtils = CountDownTimerUtils(tvCode, 60000, 1000)
|
||||
countDownTimerUtils.start()
|
||||
}
|
||||
}))
|
||||
} else {
|
||||
showToast("请输入正确手机号")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
package com.dahe.examine.ui.mine.activity
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
import com.dahe.mylibrary.net.CommonResponseBean
|
||||
import com.dahe.mylibrary.utils.CountDownTimerUtils
|
||||
import com.dahe.mylibrary.utils.PhoneFormatCheckUtils
|
||||
import com.dahe.examine.R
|
||||
import com.dahe.examine.bean.ChangePwdBean
|
||||
import com.dahe.examine.net.BaseObserver
|
||||
import com.dahe.examine.net.DataManager
|
||||
import com.dahe.examine.net.RxHttpCallBack
|
||||
import com.dahe.examine.utils.SPUtils
|
||||
import kotlinx.android.synthetic.main.activity_change_pwd.*
|
||||
|
||||
/**
|
||||
* @ClassName ChangePwdActivity
|
||||
* @Author 用户
|
||||
* @Date 2022/1/13 16:59
|
||||
* @Description TODO
|
||||
*/
|
||||
class ChangePwdActivity : BaseActivity(), View.OnClickListener {
|
||||
override fun getLayout() = R.layout.activity_change_pwd
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
setStatusBarCancelLightColor()
|
||||
setTitleBar("修改密码") { finish() }
|
||||
|
||||
// val phone = SPUtils.getUserInfo(this).userInfo.phone
|
||||
// tvPhone.text = phone
|
||||
|
||||
tvCode.setOnClickListener(this)
|
||||
btn_log.setOnClickListener(this)
|
||||
}
|
||||
|
||||
override fun initDate() {
|
||||
}
|
||||
|
||||
override fun onClick(view: View?) {
|
||||
super.onClick(view)
|
||||
when(view?.id){
|
||||
R.id.tvCode->getCode()
|
||||
R.id.btn_log->sub()
|
||||
}
|
||||
}
|
||||
|
||||
fun sub(){
|
||||
|
||||
// val phone = tvPhone.text.toString()
|
||||
val code = etPass.text.toString()
|
||||
val pwd = etCode.text.toString()
|
||||
|
||||
if (pwd.isNullOrEmpty()||code.isNullOrEmpty()){
|
||||
showToast("请完善信息")
|
||||
return
|
||||
}
|
||||
if (code!=pwd){
|
||||
showToast("两次输入不一致")
|
||||
return
|
||||
}
|
||||
|
||||
val userId = SPUtils.getUserInfo(mContext).userInfo.userId
|
||||
|
||||
val changePwdBean = ChangePwdBean()
|
||||
changePwdBean.password = code
|
||||
changePwdBean.userId =userId
|
||||
|
||||
DataManager.getInstance().changePwd(changePwdBean)
|
||||
.compose(DataManager.setThread())
|
||||
.subscribe(BaseObserver(mContext,object : RxHttpCallBack<Any>(){
|
||||
override fun onSuccess(t: CommonResponseBean<Any>?) {
|
||||
super.onSuccess(t)
|
||||
finish()
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
fun getCode() {
|
||||
|
||||
var phone = etCode.text.toString()
|
||||
if (PhoneFormatCheckUtils.isPhoneLegal(phone)) {
|
||||
DataManager.getInstance().getSmsCode(phone)
|
||||
.compose(DataManager.setThread())
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
|
||||
override fun onSuccess(t: CommonResponseBean<Any>?) {
|
||||
super.onSuccess(t)
|
||||
val countDownTimerUtils = CountDownTimerUtils(tvCode, 60000, 1000)
|
||||
countDownTimerUtils.start()
|
||||
}
|
||||
}))
|
||||
} else {
|
||||
showToast("请输入正确手机号")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
package com.dahe.examine.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.dahe.mylibrary.utils.ActivityUtils;
|
||||
import com.dahe.examine.web.WebActivity;
|
||||
|
||||
|
||||
public class AppActivityUtils extends ActivityUtils {
|
||||
|
||||
/**
|
||||
* 跳转web页面
|
||||
*
|
||||
* @param context
|
||||
* @param title
|
||||
* @param url
|
||||
*/
|
||||
public static void openWebViewActivity(Context context, String title, String url) {
|
||||
openWebViewActivity(context, title, url, "");
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转web页面
|
||||
*
|
||||
* @param context
|
||||
* @param title
|
||||
* @param url
|
||||
*/
|
||||
public static void openWebViewActivity(Context context, String title, String url, String description) {
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("title", title);
|
||||
bundle.putString("url", url);
|
||||
bundle.putString("description", description);
|
||||
startActivity(context, WebActivity.class, bundle);
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.dahe.examine.utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.AssetManager;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
/**
|
||||
* <读取Json文件的工具类>
|
||||
*
|
||||
* @author: 小嵩
|
||||
* @date: 2017/3/16 16:22
|
||||
|
||||
*/
|
||||
|
||||
public class GetJsonDataUtil {
|
||||
|
||||
|
||||
public String getJson(Context context,String fileName) {
|
||||
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
try {
|
||||
AssetManager assetManager = context.getAssets();
|
||||
BufferedReader bf = new BufferedReader(new InputStreamReader(
|
||||
assetManager.open(fileName)));
|
||||
String line;
|
||||
while ((line = bf.readLine()) != null) {
|
||||
stringBuilder.append(line);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
}
|
||||
|
114
app/src/main/java/com/dahe/examine/utils/SPUtils.java
Normal file
@ -0,0 +1,114 @@
|
||||
package com.dahe.examine.utils;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.dahe.mylibrary.net.JsonUtils;
|
||||
import com.dahe.mylibrary.utils.BaseSPUtils;
|
||||
import com.dahe.examine.bean.UserBean;
|
||||
|
||||
|
||||
public class SPUtils extends BaseSPUtils {
|
||||
|
||||
/**
|
||||
* 存用户信息
|
||||
*
|
||||
* @param context
|
||||
* @param json
|
||||
*/
|
||||
public static void setUserInfo(Context context, String json) {
|
||||
put(context, USER_INFO_KEY, json);
|
||||
}
|
||||
|
||||
/**
|
||||
* 拿用户信息
|
||||
*
|
||||
* @param context
|
||||
*/
|
||||
public static UserBean getUserInfo(Context context) {
|
||||
return JsonUtils.getInstance().fromJson((String) get(context, USER_INFO_KEY, ""), UserBean.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 存服务器类型
|
||||
*
|
||||
* @param context
|
||||
* @param isTestService
|
||||
*/
|
||||
public static void setNetServiceType(Context context, boolean isTestService) {
|
||||
put(context, NET_SERVICE_TEST, isTestService);
|
||||
}
|
||||
|
||||
/**
|
||||
* 拿服务器类型
|
||||
*
|
||||
* @param context
|
||||
*/
|
||||
public static boolean geNetServiceType(Context context) {
|
||||
return (boolean) get(context, NET_SERVICE_TEST, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 存搜索数据
|
||||
*
|
||||
* @param context
|
||||
* @param json
|
||||
*/
|
||||
public static void setSearchCache(Context context, String json) {
|
||||
put(context, SEARRH_CACHE, json);
|
||||
}
|
||||
|
||||
public static String getSearchCache(Context context) {
|
||||
return JsonUtils.getInstance().fromJson((String) get(context, SEARRH_CACHE, ""), String.class);
|
||||
}
|
||||
|
||||
public static void removeSearchCache(Context context) {
|
||||
remove(context, SEARRH_CACHE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导航偏好设置
|
||||
*/
|
||||
public static void setNaviPreferenceCache(Context context, String json) {
|
||||
put(context, NAVI_PH_EDIT_CACHE, json);
|
||||
}
|
||||
|
||||
public static String getNaviPreferenceCache(Context context) {
|
||||
return JsonUtils.getInstance().fromJson((String) get(context, NAVI_PH_EDIT_CACHE, ""), String.class);
|
||||
}
|
||||
|
||||
public static void removeNaviPreference(Context context) {
|
||||
remove(context, NAVI_PH_EDIT_CACHE);
|
||||
}
|
||||
|
||||
//第一次登录
|
||||
public static boolean getIsFirstOpen(Context context){
|
||||
boolean b = (boolean) get(context, FIRST_OPEN, true);
|
||||
return b;
|
||||
|
||||
}
|
||||
|
||||
public static void setIsFirstOpen(Context context, boolean json){
|
||||
put(context, FIRST_OPEN, json);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设置隐私协议是否同意
|
||||
*
|
||||
* @param value 是否同意
|
||||
*/
|
||||
public static void setAgreePrivacyAgreement(Context context, boolean value) {
|
||||
put(context, KEY_PRIVACY_AGREEMENT, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否同意了隐私协议
|
||||
*
|
||||
* @return true 已经同意;false 还没有同意
|
||||
*/
|
||||
public static boolean hasAgreePrivacyAgreement(Context context) {
|
||||
boolean b = (boolean) get(context, KEY_PRIVACY_AGREEMENT, false);
|
||||
return b;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package com.dahe.examine.utils;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.pm.ActivityInfo;
|
||||
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.dahe.mylibrary.R;
|
||||
import com.dahe.mylibrary.adapter.GridImageAdapter;
|
||||
import com.dahe.mylibrary.weight.GlideEngine;
|
||||
import com.luck.picture.lib.PictureSelector;
|
||||
import com.luck.picture.lib.entity.LocalMedia;
|
||||
import com.luck.picture.lib.listener.OnResultCallbackListener;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class SelectPhotoUtils5 {
|
||||
|
||||
|
||||
|
||||
private Activity ctx;
|
||||
private OnResultCallbackListener listener;
|
||||
private GridImageAdapter mAdapter;
|
||||
|
||||
private static class SingletonHolder {
|
||||
private static final SelectPhotoUtils5 INSTANCE = new SelectPhotoUtils5();
|
||||
}
|
||||
|
||||
private SelectPhotoUtils5() {
|
||||
}
|
||||
|
||||
public static final SelectPhotoUtils5 getInstance() {
|
||||
return SingletonHolder.INSTANCE;
|
||||
}
|
||||
|
||||
public void showPic(FragmentActivity activity, String path){
|
||||
ArrayList<LocalMedia> localMedias = new ArrayList<>();
|
||||
LocalMedia localMedia1 = new LocalMedia();
|
||||
localMedia1.setPath(path);
|
||||
localMedias.add(localMedia1);
|
||||
PictureSelector.create(activity)
|
||||
.themeStyle(R.style.picture_default_style) // xml设置主题
|
||||
// .setPictureStyle(mPictureParameterStyle)// 动态自定义相册主题
|
||||
//.setPictureWindowAnimationStyle(animationStyle)// 自定义页面启动动画
|
||||
.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)// 设置相册Activity方向,不设置默认使用系统
|
||||
.isNotPreviewDownload(true)// 预览图片长按是否可以下载
|
||||
//.bindCustomPlayVideoCallback(new MyVideoSelectedPlayCallback(getContext()))// 自定义播放回调控制,用户可以使用自己的视频播放界面
|
||||
.imageEngine(GlideEngine.createGlideEngine())// 外部传入图片加载引擎,必传项
|
||||
.openExternalPreview(0, localMedias);
|
||||
}
|
||||
}
|
324
app/src/main/java/com/dahe/examine/utils/SelectPhotoUtils6.java
Normal file
@ -0,0 +1,324 @@
|
||||
package com.dahe.examine.utils;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.dahe.mylibrary.R;
|
||||
import com.dahe.mylibrary.adapter.GridImageAdapter;
|
||||
import com.dahe.mylibrary.dialog.DialogPhotoSelect;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.dahe.mylibrary.weight.FullyGridLayoutManager;
|
||||
import com.dahe.mylibrary.weight.GlideEngine;
|
||||
import com.luck.picture.lib.PictureSelector;
|
||||
import com.luck.picture.lib.config.PictureConfig;
|
||||
import com.luck.picture.lib.config.PictureMimeType;
|
||||
import com.luck.picture.lib.decoration.GridSpacingItemDecoration;
|
||||
import com.luck.picture.lib.entity.LocalMedia;
|
||||
import com.luck.picture.lib.listener.OnResultCallbackListener;
|
||||
import com.luck.picture.lib.tools.ScreenUtils;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.List;
|
||||
|
||||
public class SelectPhotoUtils6 implements View.OnClickListener {
|
||||
private Activity ctx;
|
||||
private OnResultCallbackListener listener;
|
||||
private GridImageAdapter mAdapter;
|
||||
private Build build;
|
||||
|
||||
private SelectPhotoUtils6(Build build, Activity ctx) {
|
||||
this.build = build;
|
||||
this.ctx = ctx;
|
||||
this.listener = build.listener;
|
||||
if (null == listener) {
|
||||
ToastUtils.showToast(ctx, "请初始化回调listener");
|
||||
return;
|
||||
}
|
||||
if (build.isSingle) {//单选
|
||||
if (null == build.imageView) {
|
||||
ToastUtils.showToast(ctx, "请初始化ImageView");
|
||||
return;
|
||||
}
|
||||
selectSimple(build.imageView);
|
||||
} else {//多选
|
||||
if (null == build.recyclerView || !(build.recyclerView instanceof RecyclerView)) {
|
||||
ToastUtils.showToast(ctx, "请初始化RecycleView");
|
||||
return;
|
||||
}
|
||||
selectMul(build.recyclerView);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class Build {
|
||||
private int maxSelect;
|
||||
private boolean isSingle;
|
||||
private boolean isOnlyShow;
|
||||
private ImageView imageView;
|
||||
private RecyclerView recyclerView;
|
||||
private List<LocalMedia> pics;
|
||||
private OnResultCallbackListener listener;
|
||||
private String orderId;
|
||||
|
||||
public Build maxSelect(int max) {
|
||||
this.maxSelect = max;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Build isSingle(boolean isSingle) {
|
||||
this.isSingle = isSingle;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Build isOnlyShow(boolean isOnlyShow) {
|
||||
this.isOnlyShow = isOnlyShow;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Build imageview(ImageView imageView) {
|
||||
this.imageView = imageView;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Build recycleview(RecyclerView recyclerView) {
|
||||
this.recyclerView = recyclerView;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Build newPics(List<LocalMedia> pics) {
|
||||
this.pics = pics;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Build resultListener(OnResultCallbackListener listener) {
|
||||
this.listener = listener;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Build orderId(String orderId) {
|
||||
this.orderId = orderId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public SelectPhotoUtils6 create(Activity ctx) {
|
||||
return new SelectPhotoUtils6(this, ctx);
|
||||
}
|
||||
}
|
||||
|
||||
public GridImageAdapter getmAdapter() {
|
||||
return mAdapter;
|
||||
}
|
||||
|
||||
|
||||
public void selectSimple(ImageView imageView) {
|
||||
imageView.setOnClickListener(this);
|
||||
}
|
||||
|
||||
|
||||
public void selectMul(RecyclerView recyclerView) {
|
||||
FullyGridLayoutManager manager = new FullyGridLayoutManager(ctx,
|
||||
4, GridLayoutManager.VERTICAL, false);
|
||||
|
||||
recyclerView.addItemDecoration(new GridSpacingItemDecoration(40,
|
||||
ScreenUtils.dip2px(ctx, 8), true
|
||||
));
|
||||
recyclerView.setLayoutManager(manager);
|
||||
mAdapter = new GridImageAdapter(ctx, onAddPicClickListener);
|
||||
mAdapter.setSelectMax(build.maxSelect);
|
||||
mAdapter.setIsOnlyShow(build.isOnlyShow);
|
||||
recyclerView.setAdapter(mAdapter);
|
||||
|
||||
mAdapter.setOnItemClickListener((v, position) -> {
|
||||
List<LocalMedia> selectList = mAdapter.getData();
|
||||
if (selectList.size() > 0) {
|
||||
LocalMedia media = selectList.get(position);
|
||||
String mimeType = media.getMimeType();
|
||||
int mediaType = PictureMimeType.getMimeType(mimeType);
|
||||
switch (mediaType) {
|
||||
case PictureConfig.TYPE_VIDEO:
|
||||
// 预览视频
|
||||
PictureSelector.create(ctx)
|
||||
.themeStyle(R.style.picture_default_style)
|
||||
// .setPictureStyle(mPictureParameterStyle)// 动态自定义相册主题
|
||||
.externalPictureVideo(TextUtils.isEmpty(media.getAndroidQToPath()) ? media.getPath() : media.getAndroidQToPath());
|
||||
break;
|
||||
case PictureConfig.TYPE_AUDIO:
|
||||
// 预览音频
|
||||
PictureSelector.create(ctx)
|
||||
.externalPictureAudio(PictureMimeType.isContent(media.getPath()) ? media.getAndroidQToPath() : media.getPath());
|
||||
break;
|
||||
default:
|
||||
// 预览图片 可自定长按保存路径
|
||||
// PictureWindowAnimationStyle animationStyle = new PictureWindowAnimationStyle();
|
||||
// animationStyle.activityPreviewEnterAnimation = R.anim.picture_anim_up_in;
|
||||
// animationStyle.activityPreviewExitAnimation = R.anim.picture_anim_down_out;
|
||||
PictureSelector.create(ctx)
|
||||
.themeStyle(R.style.picture_default_style) // xml设置主题
|
||||
// .setPictureStyle(mPictureParameterStyle)// 动态自定义相册主题
|
||||
//.setPictureWindowAnimationStyle(animationStyle)// 自定义页面启动动画
|
||||
.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED)// 设置相册Activity方向,不设置默认使用系统
|
||||
.isNotPreviewDownload(true)// 预览图片长按是否可以下载
|
||||
//.bindCustomPlayVideoCallback(new MyVideoSelectedPlayCallback(getContext()))// 自定义播放回调控制,用户可以使用自己的视频播放界面
|
||||
.imageEngine(GlideEngine.createGlideEngine())// 外部传入图片加载引擎,必传项
|
||||
.openExternalPreview(position, selectList);
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private final GridImageAdapter.onAddPicClickListener onAddPicClickListener = new GridImageAdapter.onAddPicClickListener() {
|
||||
@Override
|
||||
public void onAddPicClick() {
|
||||
PictureSelector.create(ctx)
|
||||
.openGallery(PictureMimeType.ofImage())
|
||||
.imageEngine(GlideEngine.createGlideEngine())
|
||||
.selectionMode(build.isSingle ? PictureConfig.SINGLE : PictureConfig.MULTIPLE)// 多选 or 单选 PictureConfig.MULTIPLE or PictureConfig.SINGLE
|
||||
.maxSelectNum(build.maxSelect)
|
||||
.isPreviewImage(true)// 是否可预览图片 true or fals
|
||||
.isGif(false)// 是否显示gif图片 true or false
|
||||
.isCamera(true)// 是否显示拍照按钮 true or false
|
||||
.isEnableCrop(false)// 是否裁剪 true or false
|
||||
.selectionData(mAdapter.getData())// 是否传入已选图片
|
||||
.isCompress(true)// 是否压缩 true or false
|
||||
.circleDimmedLayer(false)// 是否圆形裁剪 true or false
|
||||
.freeStyleCropEnabled(false)// 裁剪框是否可拖拽 true or false
|
||||
.cutOutQuality(30)// 裁剪压缩质量 默认90 int
|
||||
.minimumCompressSize(30)// 小于100kb的图片不压缩
|
||||
.showCropFrame(false)// 是否显示裁剪矩形边框 圆形裁剪时建议设为false true or false
|
||||
.showCropGrid(false)// 是否显示裁剪矩形网格 圆形裁剪时建议设为false true or false
|
||||
// .rotateEnabled(true) // 裁剪是否可旋转图片 true or false
|
||||
.scaleEnabled(false)// 裁剪是否可放大缩小图片 true or false
|
||||
.forResult(new MyResultCallback(mAdapter));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDelPicClick(int postion, LocalMedia localMedia) {
|
||||
// DataManager.getInstance().delBill(build.orderId,localMedia.getId() + "")
|
||||
// .compose(DataManager.setThread())
|
||||
// .subscribe(new BaseObserver(ctx, new RxHttpCallBack(ctx) {
|
||||
// @Override
|
||||
// public void onSuccess(CommonResponseBean t) {
|
||||
// super.onSuccess(t);
|
||||
//// list.remove(index);
|
||||
// mAdapter.getData().remove(postion);
|
||||
// mAdapter.notifyItemRemoved(postion);
|
||||
// mAdapter.notifyItemRangeChanged(postion, mAdapter.getData().size());
|
||||
// }
|
||||
// }));
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 返回结果回调
|
||||
*/
|
||||
private class MyResultCallback implements OnResultCallbackListener<LocalMedia> {
|
||||
private WeakReference<GridImageAdapter> mAdapterWeakReference;
|
||||
|
||||
public MyResultCallback(GridImageAdapter adapter) {
|
||||
super();
|
||||
this.mAdapterWeakReference = new WeakReference<>(adapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResult(List<LocalMedia> result) {
|
||||
// for (LocalMedia media : result) {
|
||||
// Log.i(TAG, "是否压缩:" + media.isCompressed());
|
||||
// Log.i(TAG, "压缩:" + media.getCompressPath());
|
||||
// Log.i(TAG, "原图:" + media.getPath());
|
||||
// Log.i(TAG, "绝对路径:" + media.getRealPath());
|
||||
// Log.i(TAG, "是否裁剪:" + media.isCut());
|
||||
// Log.i(TAG, "裁剪:" + media.getCutPath());
|
||||
// Log.i(TAG, "是否开启原图:" + media.isOriginal());
|
||||
// Log.i(TAG, "原图路径:" + media.getOriginalPath());
|
||||
// Log.i(TAG, "Android Q 特有Path:" + media.getAndroidQToPath());
|
||||
// Log.i(TAG, "宽高: " + media.getWidth() + "x" + media.getHeight());
|
||||
// Log.i(TAG, "Size: " + media.getSize());
|
||||
//
|
||||
// Log.i("MMM", "onResult: " + media.toString());
|
||||
// // TODO 可以通过PictureSelectorExternalUtils.getExifInterface();方法获取一些额外的资源信息,如旋转角度、经纬度等信息
|
||||
// }
|
||||
listener.onResult(result);
|
||||
if (mAdapterWeakReference.get() != null) {
|
||||
mAdapterWeakReference.get().setList(result);
|
||||
mAdapterWeakReference.get().notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
// Log.i(TAG, "PictureSelector Cancel");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 相机拍照
|
||||
*/
|
||||
private void doTakePhoto(Activity ctx) {
|
||||
PictureSelector.create(ctx)
|
||||
.openCamera(PictureMimeType.ofImage())
|
||||
.imageEngine(GlideEngine.createGlideEngine())
|
||||
.isEnableCrop(false)// 是否裁剪 true or false
|
||||
.isCompress(true)// 是否压缩 true or false
|
||||
.isGif(false)// 是否显示gif图片 true or false
|
||||
.circleDimmedLayer(false)// 是否圆形裁剪 true or false
|
||||
.freeStyleCropEnabled(false)// 裁剪框是否可拖拽 true or false
|
||||
.cutOutQuality(30)// 裁剪压缩质量 默认90 int
|
||||
.minimumCompressSize(30)// 小于100kb的图片不压缩
|
||||
.showCropFrame(false)// 是否显示裁剪矩形边框 圆形裁剪时建议设为false true or false
|
||||
.showCropGrid(false)// 是否显示裁剪矩形网格 圆形裁剪时建议设为false true or false
|
||||
.rotateEnabled(false) // 裁剪是否可旋转图片 true or false
|
||||
.scaleEnabled(false)// 裁剪是否可放大缩小图片 true or false
|
||||
.forResult(listener);
|
||||
}
|
||||
|
||||
//从本地相册中选择
|
||||
private void doSelectPhoto(Activity ctx) {
|
||||
PictureSelector.create(ctx)
|
||||
.openGallery(PictureMimeType.ofImage())
|
||||
.imageEngine(GlideEngine.createGlideEngine())
|
||||
.selectionMode(PictureConfig.SINGLE)// 多选 or 单选 PictureConfig.MULTIPLE or PictureConfig.SINGLE
|
||||
.isPreviewImage(true)// 是否可预览图片 true or fals
|
||||
.isGif(false)// 是否显示gif图片 true or false
|
||||
.isCamera(false)// 是否显示拍照按钮 true or false
|
||||
.isEnableCrop(false)// 是否裁剪 true or false
|
||||
.isCompress(true)// 是否压缩 true or false
|
||||
.circleDimmedLayer(false)// 是否圆形裁剪 true or false
|
||||
.freeStyleCropEnabled(false)// 裁剪框是否可拖拽 true or false
|
||||
.cutOutQuality(30)// 裁剪压缩质量 默认90 int
|
||||
.minimumCompressSize(30)// 小于100kb的图片不压缩
|
||||
.showCropFrame(false)// 是否显示裁剪矩形边框 圆形裁剪时建议设为false true or false
|
||||
.showCropGrid(false)// 是否显示裁剪矩形网格 圆形裁剪时建议设为false true or false
|
||||
// .rotateEnabled(true) // 裁剪是否可旋转图片 true or false
|
||||
.scaleEnabled(false)// 裁剪是否可放大缩小图片 true or false
|
||||
.forResult(listener);
|
||||
// .forResult(PictureConfig.CHOOSE_REQUEST);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
DialogPhotoSelect dialogPhotoSelect = new DialogPhotoSelect(ctx);
|
||||
dialogPhotoSelect.show();
|
||||
dialogPhotoSelect.setOnSelectClickListener(new DialogPhotoSelect.onSelectClickListener() {
|
||||
@Override
|
||||
public void onTakePhoto() {
|
||||
doTakePhoto(ctx);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSelectPhoto() {
|
||||
doSelectPhoto(ctx);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
27
app/src/main/java/com/dahe/examine/utils/UserUtils.kt
Normal file
@ -0,0 +1,27 @@
|
||||
package com.dahe.dispatch.utils
|
||||
|
||||
import android.content.Context
|
||||
import com.dahe.examine.utils.SPUtils
|
||||
import com.umeng.message.PushAgent
|
||||
|
||||
class UserUtils private constructor(){
|
||||
|
||||
companion object{
|
||||
val instance = Holder.holder
|
||||
}
|
||||
|
||||
object Holder {
|
||||
val holder = UserUtils()
|
||||
}
|
||||
|
||||
fun loginOut(context : Context){
|
||||
if (null== SPUtils.getUserInfo(context))
|
||||
return
|
||||
PushAgent.getInstance(context).deleteAlias(SPUtils.getUserInfo(context).userInfo.userId,"uid"){ b, s -> }
|
||||
SPUtils.cleanUserInfo(context)
|
||||
// val intent = Intent(context, LauncherActivity::class.java)
|
||||
// intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK
|
||||
// context.startActivity(intent)
|
||||
// ToastUtils.showToast(context, "您的账号再异地登录,请重新登录")
|
||||
}
|
||||
}
|
146
app/src/main/java/com/dahe/examine/web/WebActivity.java
Normal file
@ -0,0 +1,146 @@
|
||||
package com.dahe.examine.web;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.webkit.JavascriptInterface;
|
||||
import android.webkit.WebResourceRequest;
|
||||
import android.webkit.WebView;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.dahe.mylibrary.base.BaseActivity;
|
||||
import com.dahe.examine.R;
|
||||
import com.just.agentweb.AgentWeb;
|
||||
import com.just.agentweb.AgentWebUIControllerImplBase;
|
||||
import com.just.agentweb.WebChromeClient;
|
||||
import com.just.agentweb.WebViewClient;
|
||||
|
||||
/**
|
||||
* 公用的webview
|
||||
*/
|
||||
public class WebActivity extends BaseActivity {
|
||||
TextView mTextRight;
|
||||
FrameLayout mWebViewLayout;
|
||||
private AgentWeb mAgentWeb;
|
||||
private String mTitle = "";
|
||||
private String mUrl = "";
|
||||
private String mDescription = "";
|
||||
private static final String TAG = "WebActivity";
|
||||
|
||||
@Override
|
||||
protected int getLayout() {
|
||||
return R.layout.activity_web;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initView(Bundle savedInstanceState) {
|
||||
mTitle = getIntent().getExtras().getString("title");
|
||||
mUrl = getIntent().getExtras().getString("url");
|
||||
mDescription = getIntent().getExtras().getString("description");
|
||||
mTextRight = (TextView) findViewById(R.id.common_toolBar_text_right);
|
||||
mWebViewLayout = (FrameLayout) findViewById(R.id.WebViewLayout);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initDate() {
|
||||
setStatusBarColor();
|
||||
setTitleBar(mTitle, v -> {
|
||||
if (!mAgentWeb.back()) finish();
|
||||
});
|
||||
mAgentWeb = AgentWeb.with(this)
|
||||
.setAgentWebParent(mWebViewLayout, new FrameLayout.LayoutParams(-1, -1))
|
||||
.useDefaultIndicator()
|
||||
.setWebViewClient(mWebViewClient)
|
||||
.setWebChromeClient(mWebChromeClient)
|
||||
.setSecurityType(AgentWeb.SecurityType.DEFAULT_CHECK)
|
||||
.setAgentWebUIController(new AgentWebUIControllerImplBase())
|
||||
.createAgentWeb()
|
||||
.ready()
|
||||
.go(mUrl);
|
||||
|
||||
|
||||
mAgentWeb.getJsInterfaceHolder().addJavaObject("phone", new AndroidInterfaceWeb());
|
||||
}
|
||||
|
||||
|
||||
private WebChromeClient mWebChromeClient = new WebChromeClient() {
|
||||
@Override
|
||||
public void onProgressChanged(WebView view, int newProgress) {
|
||||
super.onProgressChanged(view, newProgress);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReceivedTitle(WebView view, String title) {
|
||||
super.onReceivedTitle(view, title);
|
||||
setTitleBar(TextUtils.isEmpty(mTitle) ?
|
||||
title : mTitle, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (!mAgentWeb.back()) finish();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
private WebViewClient mWebViewClient = new WebViewClient() {
|
||||
|
||||
|
||||
@Override
|
||||
public void onPageStarted(WebView view, String url, Bitmap favicon) {
|
||||
super.onPageStarted(view, url, favicon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
|
||||
return super.shouldOverrideUrlLoading(view, request);
|
||||
}
|
||||
|
||||
|
||||
// @Override
|
||||
// public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
|
||||
// //该方法在Build.VERSION_CODES.LOLLIPOP以后有效
|
||||
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
// String url = request.getUrl().toString();
|
||||
// Log.i(TAG, "shouldOverrideUrlLoading: " + url);
|
||||
// }
|
||||
// return false;
|
||||
// }
|
||||
};
|
||||
|
||||
// @OnClick({R.id.common_toolBar_text_right, R.id.common_toolBar_image_right})
|
||||
// public void onClick(View view) {
|
||||
// if (view.getId() == R.id.common_toolBar_text_right) {
|
||||
// } else if (view.getId() == R.id.common_toolBar_image_right) {
|
||||
// }
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
mAgentWeb.getWebLifeCycle().onPause();
|
||||
super.onPause();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
mAgentWeb.getWebLifeCycle().onResume();
|
||||
super.onResume();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
mAgentWeb.getWebLifeCycle().onDestroy();
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
class AndroidInterfaceWeb {
|
||||
@JavascriptInterface
|
||||
public void gohome() {
|
||||
// Intent intent = new Intent(mContext, HomeActivity.class);
|
||||
// intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK | Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
// mContext.startActivity(intent);
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
package com.dahe.examine.weight;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.MotionEvent;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2018/7/16 0016.
|
||||
*/
|
||||
public class NoScrollViewPager extends ViewPager {
|
||||
private boolean isCanScroll;
|
||||
|
||||
public NoScrollViewPager(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
public NoScrollViewPager(@NonNull Context context, @Nullable AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
}
|
||||
|
||||
/**
|
||||
* 去掉viewpage滑动动画
|
||||
*
|
||||
* @param item
|
||||
*/
|
||||
@Override
|
||||
public void setCurrentItem(int item) {
|
||||
super.setCurrentItem(item, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 1.dispatchTouchEvent一般情况不做处理
|
||||
* ,如果修改了默认的返回值,子孩子都无法收到事件
|
||||
*/
|
||||
@Override
|
||||
public boolean dispatchTouchEvent(MotionEvent ev) {
|
||||
return super.dispatchTouchEvent(ev); // node_return true;不行
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否拦截
|
||||
* 拦截:会走到自己的onTouchEvent方法里面来
|
||||
* 不拦截:事件传递给子孩子
|
||||
*/
|
||||
@Override
|
||||
public boolean onInterceptTouchEvent(MotionEvent ev) {
|
||||
// node_return false;//可行,不拦截事件,
|
||||
// node_return true;//不行,孩子无法处理事件
|
||||
//node_return super.onInterceptTouchEvent(ev);//不行,会有细微移动
|
||||
if (isCanScroll) {
|
||||
return super.onInterceptTouchEvent(ev);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否消费事件
|
||||
* 消费:事件就结束
|
||||
* 不消费:往父控件传
|
||||
*/
|
||||
@Override
|
||||
public boolean onTouchEvent(MotionEvent ev) {
|
||||
//node_return false;// 可行,不消费,传给父控件
|
||||
//node_return true;// 可行,消费,拦截事件
|
||||
//super.onTouchEvent(ev); //不行,
|
||||
//虽然onInterceptTouchEvent中拦截了,
|
||||
//但是如果viewpage里面子控件不是viewgroup,还是会调用这个方法.
|
||||
if (isCanScroll) {
|
||||
return super.onTouchEvent(ev);
|
||||
} else {
|
||||
return true;// 可行,消费,拦截事件
|
||||
}
|
||||
}
|
||||
|
||||
public void setScroll(boolean isCanScroll) {
|
||||
isCanScroll = isCanScroll;
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.dahe.examine.weight;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.ColorTransitionPagerTitleView;
|
||||
|
||||
/**
|
||||
* 带颜色渐变和缩放的指示器标题
|
||||
* 博客: http://hackware.lucode.net
|
||||
* Created by hackware on 2016/6/26.
|
||||
*/
|
||||
public class ScaleTransitionPagerTitleView extends ColorTransitionPagerTitleView {
|
||||
private float mMinScale = 0.75f;
|
||||
|
||||
public ScaleTransitionPagerTitleView(Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEnter(int index, int totalCount, float enterPercent, boolean leftToRight) {
|
||||
super.onEnter(index, totalCount, enterPercent, leftToRight); // 实现颜色渐变
|
||||
setScaleX(mMinScale + (1.0f - mMinScale) * enterPercent);
|
||||
setScaleY(mMinScale + (1.0f - mMinScale) * enterPercent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLeave(int index, int totalCount, float leavePercent, boolean leftToRight) {
|
||||
super.onLeave(index, totalCount, leavePercent, leftToRight); // 实现颜色渐变
|
||||
setScaleX(1.0f + (mMinScale - 1.0f) * leavePercent);
|
||||
setScaleY(1.0f + (mMinScale - 1.0f) * leavePercent);
|
||||
}
|
||||
|
||||
public float getMinScale() {
|
||||
return mMinScale;
|
||||
}
|
||||
|
||||
public void setMinScale(float minScale) {
|
||||
mMinScale = minScale;
|
||||
}
|
||||
}
|
30
app/src/main/res/drawable-v24/ic_launcher_foreground.xml
Normal file
@ -0,0 +1,30 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:aapt="http://schemas.android.com/aapt"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
|
||||
<aapt:attr name="android:fillColor">
|
||||
<gradient
|
||||
android:endX="85.84757"
|
||||
android:endY="92.4963"
|
||||
android:startX="42.9492"
|
||||
android:startY="49.59793"
|
||||
android:type="linear">
|
||||
<item
|
||||
android:color="#44000000"
|
||||
android:offset="0.0" />
|
||||
<item
|
||||
android:color="#00000000"
|
||||
android:offset="1.0" />
|
||||
</gradient>
|
||||
</aapt:attr>
|
||||
</path>
|
||||
<path
|
||||
android:fillColor="#FFFFFF"
|
||||
android:fillType="nonZero"
|
||||
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
|
||||
android:strokeWidth="1"
|
||||
android:strokeColor="#00000000" />
|
||||
</vector>
|
BIN
app/src/main/res/drawable-xhdpi/head_defaut.png
Normal file
After Width: | Height: | Size: 8.3 KiB |
BIN
app/src/main/res/drawable-xhdpi/pass.png
Normal file
After Width: | Height: | Size: 933 B |
BIN
app/src/main/res/drawable-xhdpi/pass_open.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
app/src/main/res/drawable-xhdpi/splash.jpg
Normal file
After Width: | Height: | Size: 27 KiB |
BIN
app/src/main/res/drawable-xxhdpi/clear_search.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
BIN
app/src/main/res/drawable-xxhdpi/cq.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
app/src/main/res/drawable-xxhdpi/dj.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
app/src/main/res/drawable-xxhdpi/dz.png
Normal file
After Width: | Height: | Size: 734 B |
BIN
app/src/main/res/drawable-xxhdpi/go.png
Normal file
After Width: | Height: | Size: 397 B |
BIN
app/src/main/res/drawable-xxhdpi/icon_bill.png
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
app/src/main/res/drawable-xxhdpi/location.png
Normal file
After Width: | Height: | Size: 2.0 KiB |
BIN
app/src/main/res/drawable-xxhdpi/message.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
app/src/main/res/drawable-xxhdpi/no_pass.png
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
app/src/main/res/drawable-xxhdpi/ok_pass.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
app/src/main/res/drawable-xxhdpi/phone.png
Normal file
After Width: | Height: | Size: 563 B |
BIN
app/src/main/res/drawable-xxhdpi/pwd.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
app/src/main/res/drawable-xxhdpi/qy.png
Normal file
After Width: | Height: | Size: 980 B |
BIN
app/src/main/res/drawable-xxhdpi/qylx.png
Normal file
After Width: | Height: | Size: 1.3 KiB |
BIN
app/src/main/res/drawable-xxhdpi/read_nor.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
BIN
app/src/main/res/drawable-xxhdpi/read_select.png
Normal file
After Width: | Height: | Size: 1.7 KiB |
BIN
app/src/main/res/drawable-xxhdpi/right_black.png
Normal file
After Width: | Height: | Size: 1.1 KiB |
BIN
app/src/main/res/drawable-xxhdpi/right_icon.png
Normal file
After Width: | Height: | Size: 972 B |