Compare commits
No commits in common. "dev-2" and "master" have entirely different histories.
@ -1 +0,0 @@
|
||||
YjRealTimeLocation
|
4
.idea/codeStyles/Project.xml
Normal file → Executable file
4
.idea/codeStyles/Project.xml
Normal file → Executable file
@ -1,10 +1,6 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<codeStyleSettings language="XML">
|
||||
<option name="FORCE_REARRANGE_MODE" value="1" />
|
||||
<indentOptions>
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
</indentOptions>
|
||||
<arrangement>
|
||||
<rules>
|
||||
<section>
|
||||
|
@ -1,5 +0,0 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<state>
|
||||
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Default" />
|
||||
</state>
|
||||
</component>
|
8
.idea/gradle.xml
Normal file → Executable file
8
.idea/gradle.xml
Normal file → Executable file
@ -4,20 +4,20 @@
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="GRADLE" />
|
||||
<option name="delegatedBuild" value="false" />
|
||||
<option name="testRunner" value="PLATFORM" />
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="1.8" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
<option value="$PROJECT_DIR$/baselib" />
|
||||
<option value="$PROJECT_DIR$/camera" />
|
||||
<option value="$PROJECT_DIR$/cm_utils" />
|
||||
<option value="$PROJECT_DIR$/modulemap" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveModulePerSourceSet" value="false" />
|
||||
<option name="useQualifiedModuleNames" value="true" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
|
7
.idea/inspectionProfiles/Project_Default.xml
Normal file
7
.idea/inspectionProfiles/Project_Default.xml
Normal file
@ -0,0 +1,7 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="AndroidLintLockedOrientationActivity" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
<inspection_tool class="AndroidLintSourceLockedOrientationActivity" enabled="false" level="ERROR" enabled_by_default="false" />
|
||||
</profile>
|
||||
</component>
|
@ -1,45 +0,0 @@
|
||||
<?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="BintrayJCenter" />
|
||||
<option name="name" value="BintrayJCenter" />
|
||||
<option name="url" value="https://jcenter.bintray.com/" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="maven" />
|
||||
<option name="name" value="maven" />
|
||||
<option name="url" value="https://jitpack.io" />
|
||||
</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="$USER_HOME$/Library/Android/sdk/extras/android/m2repository" />
|
||||
<option name="name" value="$USER_HOME$/Library/Android/sdk/extras/android/m2repository" />
|
||||
<option name="url" value="file:$USER_HOME$/Library/Android/sdk/extras/android/m2repository" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="$USER_HOME$/Library/Android/sdk/extras/m2repository" />
|
||||
<option name="name" value="$USER_HOME$/Library/Android/sdk/extras/m2repository" />
|
||||
<option name="url" value="file:$USER_HOME$/Library/Android/sdk/extras/m2repository" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="$USER_HOME$/Library/Android/sdk/extras/google/m2repository" />
|
||||
<option name="name" value="$USER_HOME$/Library/Android/sdk/extras/google/m2repository" />
|
||||
<option name="url" value="file:$USER_HOME$/Library/Android/sdk/extras/google/m2repository" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
17
.idea/misc.xml
Normal file → Executable file
17
.idea/misc.xml
Normal file → Executable file
@ -1,13 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="DesignSurface">
|
||||
<option name="filePathToZoomLevelMap">
|
||||
<map>
|
||||
<entry key="../YjRealTimeLocation/app/src/main/res/layout/activity_company_detail.xml" value="0.2504528985507246" />
|
||||
</map>
|
||||
</option>
|
||||
<component name="CMakeSettings">
|
||||
<configurations>
|
||||
<configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
|
||||
</configurations>
|
||||
</component>
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="corretto-1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
</project>
|
13
.idea/runConfigurations.xml
Executable file
13
.idea/runConfigurations.xml
Executable file
@ -0,0 +1,13 @@
|
||||
<?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" />
|
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
|
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
|
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
@ -1,64 +0,0 @@
|
||||
Index: .idea/misc.xml
|
||||
IDEA additional info:
|
||||
Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
|
||||
<+><?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"CMakeSettings\">\n <configurations>\n <configuration PROFILE_NAME=\"Debug\" CONFIG_NAME=\"Debug\" />\n </configurations>\n </component>\n <component name=\"ProjectRootManager\" version=\"2\" languageLevel=\"JDK_1_8\" default=\"true\" project-jdk-name=\"1.8\" project-jdk-type=\"JavaSDK\">\n <output url=\"file://$PROJECT_DIR$/build/classes\" />\n </component>\n <component name=\"ProjectType\">\n <option name=\"id\" value=\"Android\" />\n </component>\n</project>
|
||||
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
|
||||
<+>UTF-8
|
||||
===================================================================
|
||||
diff --git a/.idea/misc.xml b/.idea/misc.xml
|
||||
--- a/.idea/misc.xml (revision 105bbba858966e8c85343d60736e237e77e99ea5)
|
||||
+++ b/.idea/misc.xml (date 1691374725285)
|
||||
@@ -1,4 +1,3 @@
|
||||
-<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CMakeSettings">
|
||||
<configurations>
|
||||
Index: .idea/runConfigurations.xml
|
||||
===================================================================
|
||||
diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml
|
||||
deleted file mode 100644
|
||||
--- a/.idea/runConfigurations.xml (revision 105bbba858966e8c85343d60736e237e77e99ea5)
|
||||
+++ /dev/null (revision 105bbba858966e8c85343d60736e237e77e99ea5)
|
||||
@@ -1,13 +0,0 @@
|
||||
-<?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" />
|
||||
- <option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
|
||||
- <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
|
||||
- <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
|
||||
- </set>
|
||||
- </option>
|
||||
- </component>
|
||||
-</project>
|
||||
\ No newline at end of file
|
||||
Index: .idea/gradle.xml
|
||||
IDEA additional info:
|
||||
Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
|
||||
<+><?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n <component name=\"GradleMigrationSettings\" migrationVersion=\"1\" />\n <component name=\"GradleSettings\">\n <option name=\"linkedExternalProjectsSettings\">\n <GradleProjectSettings>\n <option name=\"delegatedBuild\" value=\"false\" />\n <option name=\"testRunner\" value=\"PLATFORM\" />\n <option name=\"distributionType\" value=\"DEFAULT_WRAPPED\" />\n <option name=\"externalProjectPath\" value=\"$PROJECT_DIR$\" />\n <option name=\"modules\">\n <set>\n <option value=\"$PROJECT_DIR$\" />\n <option value=\"$PROJECT_DIR$/app\" />\n <option value=\"$PROJECT_DIR$/camera\" />\n <option value=\"$PROJECT_DIR$/cm_utils\" />\n </set>\n </option>\n <option name=\"resolveModulePerSourceSet\" value=\"false\" />\n <option name=\"useQualifiedModuleNames\" value=\"true\" />\n </GradleProjectSettings>\n </option>\n </component>\n</project>
|
||||
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
|
||||
<+>UTF-8
|
||||
===================================================================
|
||||
diff --git a/.idea/gradle.xml b/.idea/gradle.xml
|
||||
--- a/.idea/gradle.xml (revision 105bbba858966e8c85343d60736e237e77e99ea5)
|
||||
+++ b/.idea/gradle.xml (date 1691374834436)
|
||||
@@ -5,7 +5,7 @@
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="delegatedBuild" value="false" />
|
||||
- <option name="testRunner" value="PLATFORM" />
|
||||
+ <option name="testRunner" value="GRADLE" />
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="modules">
|
||||
@@ -16,8 +16,6 @@
|
||||
<option value="$PROJECT_DIR$/cm_utils" />
|
||||
</set>
|
||||
</option>
|
||||
- <option name="resolveModulePerSourceSet" value="false" />
|
||||
- <option name="useQualifiedModuleNames" value="true" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
@ -1,4 +0,0 @@
|
||||
<changelist name="Uncommitted_changes_before_Checkout_at_2023_8_7,_10_21_[Changes]" date="1691374872785" recycled="true" deleted="true">
|
||||
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Checkout_at_2023_8_7,_10_21_[Changes]/shelved.patch" />
|
||||
<option name="DESCRIPTION" value="Uncommitted changes before Checkout at 2023/8/7, 10:21 [Changes]" />
|
||||
</changelist>
|
2
.idea/vcs.xml
Normal file → Executable file
2
.idea/vcs.xml
Normal file → Executable file
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
13
README.md
13
README.md
@ -1,14 +1,3 @@
|
||||
# yjrealtimelocation
|
||||
##包头应急管理局网格化项目
|
||||
- 2020-03-20 初始化项目
|
||||
|
||||
|
||||
## 2022年07月11日
|
||||
|
||||
- 企业检查流程升级
|
||||
- 版本升级 服务器端口8083 ---> 8084
|
||||
|
||||
## 2022年11月24日
|
||||
|
||||
- 企业详情页面添加水印
|
||||
- 添加定位上传
|
||||
- 2020-03-20 初始化项目
|
@ -15,11 +15,6 @@ android {
|
||||
JPUSH_APPKEY : "1146f53725a159e078f27a1c", //JPush 上注册的包名对应的 Appkey.
|
||||
JPUSH_CHANNEL: "developer-default", //暂时填写默认值即可.
|
||||
]
|
||||
javaCompileOptions {
|
||||
annotationProcessorOptions {
|
||||
arguments = [AROUTER_MODULE_NAME: project.getName()]
|
||||
}
|
||||
}
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
@ -45,7 +40,7 @@ android {
|
||||
}
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation 'com.android.support:appcompat-v7:28.0.0'
|
||||
implementation "com.android.support:appcompat-v7:25.3.0"
|
||||
implementation "com.android.support:design:28.0.0"
|
||||
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
@ -55,9 +50,8 @@ dependencies {
|
||||
implementation "com.android.support:recyclerview-v7:${rootProject.ext.gAppcompatVersion_v7_28}"
|
||||
implementation project(':cm_utils')
|
||||
implementation project(':camera')
|
||||
implementation project(":modulemap")
|
||||
//百度地图
|
||||
// implementation files('libs/BaiduLBS_Android.jar')
|
||||
implementation files('libs/BaiduLBS_Android.jar')
|
||||
// implementation files('libs/IndoorscapeAlbumPlugin.jar')
|
||||
//极光推送
|
||||
// implementation files('libs/jcore-android-2.0.1.jar')
|
||||
@ -97,7 +91,4 @@ dependencies {
|
||||
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.2'
|
||||
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.1'
|
||||
testImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.1'
|
||||
//Arouter
|
||||
annotationProcessor "com.alibaba:arouter-compiler:$rootProject.ext.gRouterCompileVersion"
|
||||
api "com.alibaba:arouter-api:$rootProject.ext.gRouterApiVersion"
|
||||
}
|
||||
|
BIN
app/libs/BaiduLBS_Android.jar
Normal file
BIN
app/libs/BaiduLBS_Android.jar
Normal file
Binary file not shown.
BIN
app/libs/arm64-v8a/libBaiduMapSDK_base_v6_2_0.so
Normal file
BIN
app/libs/arm64-v8a/libBaiduMapSDK_base_v6_2_0.so
Normal file
Binary file not shown.
BIN
app/libs/arm64-v8a/libBaiduMapSDK_map_v6_2_0.so
Normal file
BIN
app/libs/arm64-v8a/libBaiduMapSDK_map_v6_2_0.so
Normal file
Binary file not shown.
BIN
app/libs/armeabi-v7a/libBaiduMapSDK_base_v6_2_0.so
Normal file
BIN
app/libs/armeabi-v7a/libBaiduMapSDK_base_v6_2_0.so
Normal file
Binary file not shown.
BIN
app/libs/armeabi-v7a/libBaiduMapSDK_map_v6_2_0.so
Normal file
BIN
app/libs/armeabi-v7a/libBaiduMapSDK_map_v6_2_0.so
Normal file
Binary file not shown.
BIN
app/libs/armeabi/libBaiduMapSDK_base_v6_2_0.so
Normal file
BIN
app/libs/armeabi/libBaiduMapSDK_base_v6_2_0.so
Normal file
Binary file not shown.
BIN
app/libs/armeabi/libBaiduMapSDK_map_v6_2_0.so
Normal file
BIN
app/libs/armeabi/libBaiduMapSDK_map_v6_2_0.so
Normal file
Binary file not shown.
BIN
app/libs/x86/libBaiduMapSDK_base_v6_2_0.so
Normal file
BIN
app/libs/x86/libBaiduMapSDK_base_v6_2_0.so
Normal file
Binary file not shown.
BIN
app/libs/x86/libBaiduMapSDK_map_v6_2_0.so
Normal file
BIN
app/libs/x86/libBaiduMapSDK_map_v6_2_0.so
Normal file
Binary file not shown.
BIN
app/libs/x86_64/libBaiduMapSDK_base_v6_2_0.so
Normal file
BIN
app/libs/x86_64/libBaiduMapSDK_base_v6_2_0.so
Normal file
Binary file not shown.
BIN
app/libs/x86_64/libBaiduMapSDK_map_v6_2_0.so
Normal file
BIN
app/libs/x86_64/libBaiduMapSDK_map_v6_2_0.so
Normal file
Binary file not shown.
@ -1 +1 @@
|
||||
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":22,"versionName":"1.2.1","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release","dirName":""},"path":"app-release.apk","properties":{}}]
|
||||
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":20,"versionName":"1.1.9","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -47,56 +47,6 @@
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme"
|
||||
tools:ignore="GoogleAppIndexingWarning">
|
||||
<activity
|
||||
android:name=".MsgDetailActivity"
|
||||
android:exported="false">
|
||||
<meta-data
|
||||
android:name="android.app.lib_name"
|
||||
android:value="" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".MsgListActivity"
|
||||
android:exported="false">
|
||||
<meta-data
|
||||
android:name="android.app.lib_name"
|
||||
android:value="" />
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".activitys.trouble.MineMissionHistoryDetailActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activitys.trouble.MineMissionCompleteActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activitys.trouble.CheckEnterpriseActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activitys.trouble.MineMissionUnCompleteActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activitys.trouble.RandomMissionActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activitys.trouble.CaseLogActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activitys.trouble.CaseCheckOptionsDetailActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activitys.trouble.CaseCheckOptionsActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activitys.trouble.TdTaskActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activitys.mine.StatisticsActivity"
|
||||
android:launchMode="singleTop"
|
||||
@ -282,12 +232,6 @@
|
||||
<activity
|
||||
android:name=".activitys.mine.UserInfoActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activitys.mine.MsgListActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activitys.mine.MsgDetailActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activitys.mine.ChangePwdActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
@ -299,10 +243,9 @@
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activitys.mine.UserActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity
|
||||
android:name=".activitys.locus.LocusMapActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
android:screenOrientation="portrait" /> <!-- <activity -->
|
||||
<!-- android:name=".activitys.locus.LocusMapActivity" -->
|
||||
<!-- android:screenOrientation="portrait" /> -->
|
||||
<activity
|
||||
android:name=".activitys.issue.IssueRecordActivity"
|
||||
android:screenOrientation="portrait"
|
||||
@ -382,6 +325,9 @@
|
||||
<!-- <category android:name="${applicationId}" /> -->
|
||||
<!-- </intent-filter> -->
|
||||
<!-- </activity> -->
|
||||
<meta-data
|
||||
android:name="com.baidu.lbsapi.API_KEY"
|
||||
android:value="pYx5soXOQToimEzEL1QbI6wz9G4B9dkb" />
|
||||
<meta-data
|
||||
android:name="BUGLY_APPID"
|
||||
android:value="ff95776367" />
|
||||
@ -402,12 +348,11 @@
|
||||
<meta-data
|
||||
android:name="JPUSH_APPKEY"
|
||||
android:value="${JPUSH_APPKEY}" /> <!-- 配置APP版本号 -->
|
||||
<!-- 配置APP渠道号 -->
|
||||
<provider
|
||||
android:name="com.sucstepsoft.cm_utils.core.GlobalProvider"
|
||||
android:name=".services.GlobalProvider"
|
||||
android:authorities="com.sucstepsoft.txrealtimelocation"
|
||||
android:enabled="true"
|
||||
android:exported="true" />
|
||||
android:exported="true" /> <!-- 配置APP渠道号 -->
|
||||
<provider
|
||||
android:name="android.support.v4.content.FileProvider"
|
||||
android:authorities="${applicationId}.provider"
|
||||
@ -491,6 +436,39 @@
|
||||
<intent-filter>
|
||||
<action android:name="com.sucstepsoft.txrealtimelocation.services.LocationHelperService" />
|
||||
</intent-filter>
|
||||
</service> <!-- since 3.3.0 Required SDK核心功能 -->
|
||||
<service
|
||||
android:name="com.baidu.location.f"
|
||||
android:enabled="true"
|
||||
android:process=":remote" /> <!-- since 3.3.0 Required SDK 核心功能 -->
|
||||
<!-- 可配置android:process参数将PushService放在其他进程中 -->
|
||||
<!-- User defined. For test only 继承自cn.jpush.android.service.JCommonService -->
|
||||
<!-- <service -->
|
||||
<!-- android:name="cn.jpush.android.service.PushService" -->
|
||||
<!-- android:exported="false" -->
|
||||
<!-- android:process=":pushcore"> -->
|
||||
<!-- <intent-filter> -->
|
||||
<!-- <action android:name="cn.jpush.android.intent.REGISTER" /> -->
|
||||
<!-- <action android:name="cn.jpush.android.intent.REPORT" /> -->
|
||||
<!-- <action android:name="cn.jpush.android.intent.PushService" /> -->
|
||||
<!-- <action android:name="cn.jpush.android.intent.PUSH_TIME" /> -->
|
||||
<!-- </intent-filter> -->
|
||||
<!-- </service> <!– Required . Enable it you can get statistics data with channel –> -->
|
||||
<!-- <service -->
|
||||
<!-- android:name="cn.jpush.android.service.DaemonService" -->
|
||||
<!-- android:enabled="true" -->
|
||||
<!-- android:exported="true"> -->
|
||||
<!-- <intent-filter> -->
|
||||
<!-- <action android:name="cn.jpush.android.intent.DaemonService" /> -->
|
||||
<!-- <category android:name="${applicationId}" /> -->
|
||||
<!-- </intent-filter> -->
|
||||
<!-- </service> -->
|
||||
<service
|
||||
android:name=".services.jpush.PushService"
|
||||
android:process=":pushcore">
|
||||
<intent-filter>
|
||||
<action android:name="cn.jiguang.user.service.action" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
</application>
|
||||
|
||||
|
@ -82,7 +82,7 @@ public class AddressListActivity extends BaseActivity {
|
||||
getPDepartMentList();
|
||||
}
|
||||
} else {
|
||||
ToastUtils.showErrorShort("数据有误,请重试");
|
||||
ToastUtils.showShort("数据有误,请重试");
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ public class AddressListDetailActivity extends BaseActivity {
|
||||
mTvBaseTitle.setText(title);
|
||||
}
|
||||
if (TextUtils.isEmpty(pId)) {
|
||||
ToastUtils.showErrorShort("数据有误");
|
||||
ToastUtils.showShort("数据有误");
|
||||
finish();
|
||||
} else {
|
||||
refreshView(STATE_LOAD_LOADING);
|
||||
@ -111,7 +111,7 @@ public class AddressListDetailActivity extends BaseActivity {
|
||||
mobileIntent.setData(mobileData);
|
||||
startActivity(mobileIntent);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("该人员暂未录入联系电话");
|
||||
ToastUtils.showShort("该人员暂未录入联系电话");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ public class PersonListActivity extends BaseActivity {
|
||||
String title = getIntent().getStringExtra("title");
|
||||
mTvBaseTitle.setText(title);
|
||||
if (TextUtils.isEmpty(id)) {
|
||||
ToastUtils.showErrorShort("数据有误,请稍后重试.");
|
||||
ToastUtils.showShort("数据有误,请稍后重试.");
|
||||
} else {
|
||||
mPersonAdapter = new PersonAdapter(mActivity, mPersonBeans);
|
||||
mRlvPersons.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||
@ -82,7 +82,7 @@ public class PersonListActivity extends BaseActivity {
|
||||
mobileIntent.setData(mobileData);
|
||||
startActivity(mobileIntent);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("该人员暂未录入联系电话");
|
||||
ToastUtils.showShort("该人员暂未录入联系电话");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -145,11 +145,15 @@ public class CatalogActivity extends BaseActivity {
|
||||
mBind = ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("企业检查");
|
||||
String type = getIntent().getStringExtra("type");
|
||||
int industryId = UserLgUtils.getIndustryId();
|
||||
if (industryId == 1) {
|
||||
String industryId = UserLgUtils.getIndustryId();
|
||||
if (!TextUtils.isEmpty(industryId)) {
|
||||
mTvPublish.setVisibility(View.VISIBLE);
|
||||
mTvPublish.setText("保存");
|
||||
mTvPublish.setOnClickListener(v -> buildConfirmData(mLeftAdapter.getData()));
|
||||
mTvPublish.setOnClickListener(v -> {
|
||||
//TODO 构建提交数据
|
||||
buildConfirmData(mLeftAdapter.getData());
|
||||
// doSubmibt(mRightAdapter.getData());
|
||||
});
|
||||
if (!TextUtils.isEmpty(type)) {
|
||||
mIbBack.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(mActivity, CompanyInfoEditActivity.class);
|
||||
@ -169,13 +173,30 @@ public class CatalogActivity extends BaseActivity {
|
||||
}
|
||||
String name = getIntent().getStringExtra("name");
|
||||
mTvName.setText(name);
|
||||
getCheckOptions();
|
||||
getCheckOptions(industryId);
|
||||
// if (!TextUtils.isEmpty(mTaskCheckId)) {
|
||||
// //我的任务
|
||||
// getCompanyDetail(mCompanyId, nId);
|
||||
// } else {
|
||||
// //自己检查
|
||||
// getCheckOptions(nId);
|
||||
//
|
||||
//// String id = getIntent().getStringExtra("id");
|
||||
//// if (TextUtils.isEmpty(nId)) {
|
||||
//// getDicList(PathConfig.DIC_COMPANY_TYPE, 1);
|
||||
//// } else {
|
||||
//// mRlvCatalog.setVisibility(View.VISIBLE);
|
||||
//// if (TextUtils.isEmpty(id)) {
|
||||
//// id = "";
|
||||
//// }
|
||||
//// }
|
||||
// }
|
||||
getCompanyDetail(mCompanyId);
|
||||
mBtnUnClaim.setVisibility(View.GONE);
|
||||
initListView();
|
||||
startListenerLocation();
|
||||
} else {
|
||||
ToastUtils.showErrorShort("你不是网格员,请联系管理员");
|
||||
ToastUtils.showShort("你不是网格员,无法检查企业");
|
||||
refreshView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
@ -283,7 +304,7 @@ public class CatalogActivity extends BaseActivity {
|
||||
if (mMProgressDialog != null && mMProgressDialog.isShowing()) {
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showErrorShort("检查项中存在未检查的项目");
|
||||
ToastUtils.showShort("检查项中存在未检查的项目");
|
||||
}
|
||||
}
|
||||
|
||||
@ -357,7 +378,7 @@ public class CatalogActivity extends BaseActivity {
|
||||
if (TextUtils.isEmpty(industry)) {
|
||||
getDicList(PathConfig.DIC_COMPANY_TYPE, 2);
|
||||
} else {
|
||||
getCheckOptions();
|
||||
getCheckOptions(nid);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -406,7 +427,7 @@ public class CatalogActivity extends BaseActivity {
|
||||
alertDialog.show();
|
||||
mBtnConfirm.setOnClickListener(v -> {
|
||||
if (TextUtils.isEmpty(mSelNatureId)) {
|
||||
ToastUtils.showErrorShort("请选项企业分类");
|
||||
ToastUtils.showShort("请选项企业分类");
|
||||
} else {
|
||||
//TODO 保存id
|
||||
alertDialog.dismiss();
|
||||
@ -455,7 +476,7 @@ public class CatalogActivity extends BaseActivity {
|
||||
public void onNext(SuccessBean successBean) {
|
||||
dialog.dismiss();
|
||||
if (type == 1) {
|
||||
getCheckOptions();
|
||||
getCheckOptions(mSelNatureId);
|
||||
} else {
|
||||
getCompanyDetail(mCompanyId, mSelNatureId);
|
||||
}
|
||||
@ -675,7 +696,7 @@ public class CatalogActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showErrorShort("获取数据失败,请稍后重试");
|
||||
ToastUtils.showShort("获取数据失败,请稍后重试");
|
||||
progressDialog.dismiss();
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
}
|
||||
@ -758,12 +779,14 @@ public class CatalogActivity extends BaseActivity {
|
||||
|
||||
/**
|
||||
* 获取检查项
|
||||
*
|
||||
* @param nId
|
||||
*/
|
||||
private void getCheckOptions() {
|
||||
private void getCheckOptions(String nId) {
|
||||
refreshView(STATE_LOAD_LOADING);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getCheckOptionsList(UserLgUtils.getToken())
|
||||
.getCheckOptionsList(nId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<List<CheckOptionsbean>>() {
|
||||
@ -778,7 +801,7 @@ public class CatalogActivity extends BaseActivity {
|
||||
// buildCheckDataSingleOptions(checkOptionsbeans);
|
||||
buildCheckOptions(checkOptionsbeans);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("该企业未配置检查表,请联系管理员进行配置.");
|
||||
ToastUtils.showShort("该企业未配置检查表,请联系管理员进行配置.");
|
||||
refreshView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
@ -803,11 +826,11 @@ public class CatalogActivity extends BaseActivity {
|
||||
List<AddPhotoBean> mPhotos = new ArrayList<>();
|
||||
mPhotos.add(new AddPhotoBean());
|
||||
List<NewOptions.ChildBean> beans = new ArrayList<>();
|
||||
o.setType(checkOptionsbeans.get(i).getIsMustCheck());
|
||||
o.setType(checkOptionsbeans.get(i).getType());
|
||||
o.setId(checkOptionsbeans.get(i).getCheckItemId());
|
||||
o.setTitle(checkOptionsbeans.get(i).getNameJoinByCheckItemId());
|
||||
o.setPhotos(mPhotos);
|
||||
o.setIsMust(checkOptionsbeans.get(i).getIsMustCheck());
|
||||
o.setIsMust(checkOptionsbeans.get(i).getType());
|
||||
//构建选项
|
||||
for (int j = 0; j < checkOptionsbeans.get(i).getCheckItemOptions().size(); j++) {
|
||||
NewOptions.ChildBean oBean = new NewOptions.ChildBean();
|
||||
@ -870,11 +893,11 @@ public class CatalogActivity extends BaseActivity {
|
||||
mPhotos.add(new AddPhotoBean());
|
||||
NewOptions o = new NewOptions();
|
||||
List<NewOptions.ChildBean> beans = new ArrayList<>();
|
||||
o.setType(checkOptionsbeans.get(k).getIsMustCheck());
|
||||
o.setType(checkOptionsbeans.get(k).getType());
|
||||
o.setId(checkOptionsbeans.get(k).getCheckItemId());
|
||||
o.setTitle(checkOptionsbeans.get(k).getNameJoinByCheckItemId());
|
||||
o.setPhotos(mPhotos);
|
||||
o.setIsMust(checkOptionsbeans.get(k).getIsMustCheck());
|
||||
o.setIsMust(checkOptionsbeans.get(k).getType());
|
||||
//构建选项
|
||||
for (int j = 0; j < checkOptionsbeans.get(k).getCheckItemOptions().size(); j++) {
|
||||
NewOptions.ChildBean oBean = new NewOptions.ChildBean();
|
||||
@ -900,11 +923,11 @@ public class CatalogActivity extends BaseActivity {
|
||||
mPhotos.add(new AddPhotoBean());
|
||||
NewOptions o = new NewOptions();
|
||||
List<NewOptions.ChildBean> beans = new ArrayList<>();
|
||||
o.setType(checkOptionsbeans.get(k).getIsMustCheck());
|
||||
o.setType(checkOptionsbeans.get(k).getType());
|
||||
o.setId(checkOptionsbeans.get(k).getCheckItemId());
|
||||
o.setTitle(checkOptionsbeans.get(k).getNameJoinByCheckItemId());
|
||||
o.setPhotos(mPhotos);
|
||||
o.setIsMust(checkOptionsbeans.get(k).getIsMustCheck());
|
||||
o.setIsMust(checkOptionsbeans.get(k).getType());
|
||||
//构建选项
|
||||
for (int j = 0; j < checkOptionsbeans.get(k).getCheckItemOptions().size(); j++) {
|
||||
NewOptions.ChildBean oBean = new NewOptions.ChildBean();
|
||||
@ -1077,7 +1100,7 @@ public class CatalogActivity extends BaseActivity {
|
||||
if (mMProgressDialog != null && mMProgressDialog.isShowing()) {
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showErrorShort("检查项中存在未检查的项目");
|
||||
ToastUtils.showShort("检查项中存在未检查的项目");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1110,7 +1133,7 @@ public class CatalogActivity extends BaseActivity {
|
||||
if (mMProgressDialog != null && mMProgressDialog.isShowing()) {
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showSuccessShort("检查成功");
|
||||
ToastUtils.showShort("检查成功");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
@ -1123,12 +1146,12 @@ public class CatalogActivity extends BaseActivity {
|
||||
String string = responseBody.string();
|
||||
Gson gson1 = new Gson();
|
||||
ErrorBean errorBean = gson1.fromJson(string, ErrorBean.class);
|
||||
ToastUtils.showErrorShort(errorBean.getMsg());
|
||||
ToastUtils.showShort(errorBean.getMsg());
|
||||
} catch (Exception e1) {
|
||||
ToastUtils.showErrorShort("提交失败,请稍后重试.");
|
||||
ToastUtils.showShort("提交失败,请稍后重试.");
|
||||
}
|
||||
} else {
|
||||
ToastUtils.showErrorShort("提交失败,请稍后重试.");
|
||||
ToastUtils.showShort("提交失败,请稍后重试.");
|
||||
}
|
||||
if (mMProgressDialog != null && mMProgressDialog.isShowing()) {
|
||||
mMProgressDialog.dismiss();
|
||||
@ -1261,7 +1284,7 @@ public class CatalogActivity extends BaseActivity {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showSuccessShort("上传成功");
|
||||
ToastUtils.showShort("上传成功");
|
||||
if (mSelPhotosType == 1) {
|
||||
mCurrentBean.setId(baseUserBean.getData());
|
||||
mCurrentBean.setPath(picPath);
|
||||
@ -1287,7 +1310,7 @@ public class CatalogActivity extends BaseActivity {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showErrorShort("上传失败,请稍后重试.");
|
||||
ToastUtils.showShort("上传失败,请稍后重试.");
|
||||
if (file.exists()) {
|
||||
file.delete();
|
||||
}
|
||||
@ -1305,7 +1328,7 @@ public class CatalogActivity extends BaseActivity {
|
||||
if (progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showErrorShort("图片上传失败,请稍后重试");
|
||||
ToastUtils.showShort("图片上传失败,请稍后重试");
|
||||
}
|
||||
})
|
||||
.launch();
|
||||
|
@ -13,22 +13,21 @@ import android.view.View;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.Button;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.google.gson.Gson;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
import com.sucstepsoft.cm_utils.constant.PermissionConstants;
|
||||
import com.sucstepsoft.cm_utils.core.GlobalProvider;
|
||||
import com.sucstepsoft.cm_utils.core.network.update.CheckUpdateUtils;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.BaseUrlApi;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.utils.AppUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.EncryptUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.FileIOUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.LogUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.PermissionUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.ToastUtils;
|
||||
@ -38,10 +37,13 @@ import com.sucstepsoft.txrealtimelocation.beans.AppTokenUser;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.BaseUserBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.LoginUser;
|
||||
import com.sucstepsoft.txrealtimelocation.net.LocationApiService;
|
||||
import com.sucstepsoft.txrealtimelocation.services.GlobalProvider;
|
||||
import com.sucstepsoft.txrealtimelocation.utils.AesUtil;
|
||||
import com.sucstepsoft.txrealtimelocation.utils.ExceptionHandler;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
@ -55,7 +57,6 @@ import okhttp3.RequestBody;
|
||||
/**
|
||||
* 登录页面
|
||||
*/
|
||||
@Route(path = PathConfig.PATH_MODULE_MAIN_LOGIN)
|
||||
public class LoginActivity extends BaseActivity {
|
||||
@BindView(R.id.et_user_phone)
|
||||
EditText mEtUserPhone;
|
||||
@ -163,7 +164,7 @@ public class LoginActivity extends BaseActivity {
|
||||
private void doLoginApp(String name, String pwd) {
|
||||
hideSoftKeyboard();
|
||||
refreshLoginState(11);
|
||||
String deviceId = AppUtils.getDeviceId(mActivity);
|
||||
String deviceId = getDeviceId();
|
||||
String md5Pwd = EncryptUtils.encryptMD5ToStringTimes(pwd, 3);
|
||||
LoginUser info = new LoginUser();
|
||||
info.setAppVersion(AppUtils.getAppVersionCode());
|
||||
@ -175,80 +176,95 @@ public class LoginActivity extends BaseActivity {
|
||||
String obj = gson.toJson(info);
|
||||
RequestBody body = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), obj);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.doLogin(body)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseUserBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
mDisposable = d;
|
||||
}
|
||||
.create(LocationApiService.class)
|
||||
.doLogin(body)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseUserBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
mDisposable = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(BaseUserBean baseUserBean) {
|
||||
refreshLoginState(12);
|
||||
if (!TextUtils.isEmpty(baseUserBean.getData())) {
|
||||
byte[] decode = Base64.decode(baseUserBean.getData(), Base64.DEFAULT);
|
||||
try {
|
||||
String loginUserInfo = AesUtil.aesCommonDecoder(PathConfig.SECRET, new String(decode, "UTF-8"));
|
||||
LogUtils.e(loginUserInfo);
|
||||
if (!TextUtils.isEmpty(loginUserInfo)) {
|
||||
AppTokenUser appTokenUser = gson.fromJson(loginUserInfo, AppTokenUser.class);
|
||||
UserLgUtils.setLoginInfo(loginUserInfo);
|
||||
UserLgUtils.setAvatar(appTokenUser.getAvatar());
|
||||
UserLgUtils.setEmail(appTokenUser.getEmail());
|
||||
UserLgUtils.setId(appTokenUser.getId());
|
||||
UserLgUtils.setName(appTokenUser.getName());
|
||||
UserLgUtils.setUserName(appTokenUser.getUsername());
|
||||
UserLgUtils.setPhone(appTokenUser.getPhone());
|
||||
UserLgUtils.setToken(baseUserBean.getData());
|
||||
GlobalProvider.save(mActivity, "token", baseUserBean.getData());
|
||||
UserLgUtils.setPassword(pwd);
|
||||
ARouter.getInstance()
|
||||
.build(PathConfig.PATH_MODULE_MAIN_HOME)
|
||||
.withString("page", getIntent().getStringExtra("page"))
|
||||
.withString("id", getIntent().getStringExtra("id"))
|
||||
.navigation();
|
||||
finish();
|
||||
} else {
|
||||
ToastUtils.showErrorShort("登录失败,请稍后重试.");
|
||||
@Override
|
||||
public void onNext(BaseUserBean baseUserBean) {
|
||||
refreshLoginState(12);
|
||||
if (!TextUtils.isEmpty(baseUserBean.getData())) {
|
||||
byte[] decode = Base64.decode(baseUserBean.getData(), Base64.DEFAULT);
|
||||
try {
|
||||
String loginUserInfo = AesUtil.aesCommonDecoder(PathConfig.SECRET, new String(decode, "UTF-8"));
|
||||
LogUtils.e(loginUserInfo);
|
||||
if (!TextUtils.isEmpty(loginUserInfo)) {
|
||||
AppTokenUser appTokenUser = gson.fromJson(loginUserInfo, AppTokenUser.class);
|
||||
UserLgUtils.setLoginInfo(loginUserInfo);
|
||||
UserLgUtils.setAvatar(appTokenUser.getAvatar());
|
||||
UserLgUtils.setEmail(appTokenUser.getEmail());
|
||||
UserLgUtils.setId(appTokenUser.getId());
|
||||
UserLgUtils.setName(appTokenUser.getName());
|
||||
UserLgUtils.setUserName(appTokenUser.getUsername());
|
||||
UserLgUtils.setPhone(appTokenUser.getPhone());
|
||||
UserLgUtils.setToken(baseUserBean.getData());
|
||||
GlobalProvider.save(mActivity, "token", baseUserBean.getData());
|
||||
if (isRememberPwd) {
|
||||
UserLgUtils.setPassword(pwd);
|
||||
}
|
||||
startActivity(new Intent(LoginActivity.this, MainActivity.class));
|
||||
finish();
|
||||
} else {
|
||||
ToastUtils.showShort("登录失败,请稍后重试.");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
ToastUtils.showShort("登录失败,请稍后重试.");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
ToastUtils.showErrorShort("登录失败,请稍后重试.");
|
||||
} else {
|
||||
ToastUtils.showShort("登录失败,请稍后重试.");
|
||||
}
|
||||
} else {
|
||||
ToastUtils.showErrorShort("登录失败,请稍后重试.");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
e.printStackTrace();
|
||||
refreshLoginState(12);
|
||||
int i = ExceptionHandler.handleExceptionWithLogin(e);
|
||||
if (i == 40502) {
|
||||
checkPermission();
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
e.printStackTrace();
|
||||
refreshLoginState(12);
|
||||
int i = ExceptionHandler.handleExceptionWithLogin(e);
|
||||
if (i == 40502) {
|
||||
checkPermission();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private String getDeviceId() {
|
||||
String filePath = PathConfig.IDENTITY_FILE;
|
||||
File file = new File(filePath);
|
||||
String uuid = "";
|
||||
if (!file.exists()) {
|
||||
try {
|
||||
boolean newFile = file.createNewFile();
|
||||
uuid = UUID.randomUUID().toString();
|
||||
FileIOUtils.writeFileFromString(file, uuid);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
uuid = FileIOUtils.readFile2String(file);
|
||||
}
|
||||
return uuid;
|
||||
}
|
||||
|
||||
private void checkPermission() {
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
||||
boolean isInstall = getPackageManager().canRequestPackageInstalls();
|
||||
if (isInstall) {
|
||||
CheckUpdateUtils.checkUpdate(LoginActivity.this,
|
||||
0,
|
||||
BaseUrlApi.APP_DOWNLOAD_URL,
|
||||
"1", "发现新版本");
|
||||
0,
|
||||
BaseUrlApi.APP_DOWNLOAD_URL,
|
||||
"1", "发现新版本");
|
||||
} else {
|
||||
ToastUtils.showLong("软件升级需要使用安装未知来源的权限,请授权.");
|
||||
Intent intent = new Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES);
|
||||
@ -256,9 +272,9 @@ public class LoginActivity extends BaseActivity {
|
||||
}
|
||||
} else {
|
||||
CheckUpdateUtils.checkUpdate(LoginActivity.this,
|
||||
0,
|
||||
BaseUrlApi.APP_DOWNLOAD_URL,
|
||||
"1", "发现新版本");
|
||||
0,
|
||||
BaseUrlApi.APP_DOWNLOAD_URL,
|
||||
"1", "发现新版本");
|
||||
}
|
||||
}
|
||||
|
||||
@ -279,38 +295,36 @@ public class LoginActivity extends BaseActivity {
|
||||
*/
|
||||
private void requestPermission() {
|
||||
PermissionUtils.permission(
|
||||
PermissionConstants.SMS,
|
||||
PermissionConstants.CAMERA,
|
||||
PermissionConstants.STORAGE,
|
||||
PermissionConstants.MICROPHONE,
|
||||
PermissionConstants.PHONE)
|
||||
.callback(new PermissionUtils.SimpleCallback() {
|
||||
@Override
|
||||
public void onGranted() {
|
||||
File file = new File(PathConfig.CATCH_PATH);
|
||||
if (!file.exists()) {
|
||||
file.mkdirs();
|
||||
}
|
||||
File videoFile = new File(PathConfig.VIDEO_PATH);
|
||||
if (!videoFile.exists()) {
|
||||
videoFile.mkdirs();
|
||||
}
|
||||
String loginName = UserLgUtils.getUserName();
|
||||
String pwd = UserLgUtils.getPassword();
|
||||
if (!TextUtils.isEmpty(loginName) && !TextUtils.isEmpty(pwd)) {
|
||||
mEtUserPhone.setText(loginName);
|
||||
if (isRememberPwd) {
|
||||
PermissionConstants.SMS,
|
||||
PermissionConstants.CAMERA,
|
||||
PermissionConstants.STORAGE,
|
||||
PermissionConstants.MICROPHONE,
|
||||
PermissionConstants.PHONE)
|
||||
.callback(new PermissionUtils.SimpleCallback() {
|
||||
@Override
|
||||
public void onGranted() {
|
||||
File file = new File(PathConfig.CATCH_PATH);
|
||||
if (!file.exists()) {
|
||||
file.mkdirs();
|
||||
}
|
||||
File videoFile = new File(PathConfig.VIDEO_PATH);
|
||||
if (!videoFile.exists()) {
|
||||
videoFile.mkdirs();
|
||||
}
|
||||
String loginName = UserLgUtils.getUserName();
|
||||
String pwd = UserLgUtils.getPassword();
|
||||
if (!TextUtils.isEmpty(loginName) && !TextUtils.isEmpty(pwd)) {
|
||||
mEtUserPhone.setText(loginName);
|
||||
mEtUserPwd.setText(pwd);
|
||||
login();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDenied() {
|
||||
ToastUtils.showErrorShort("未授权会导致程序无法正常运行.请前往设置进行程序的授权.");
|
||||
}
|
||||
}).request();
|
||||
@Override
|
||||
public void onDenied() {
|
||||
ToastUtils.showShort("未授权会导致程序无法正常运行.请前往设置进行程序的授权.");
|
||||
}
|
||||
}).request();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -323,11 +337,11 @@ public class LoginActivity extends BaseActivity {
|
||||
String pwd = mEtUserPwd.getText().toString().trim();
|
||||
// || !RegexUtils.isMobileExact(userName)
|
||||
if (TextUtils.isEmpty(userName)) {
|
||||
ToastUtils.showErrorShort("账号有误,请重新输入.");
|
||||
ToastUtils.showShort("账号有误,请重新输入.");
|
||||
return false;
|
||||
}
|
||||
if (TextUtils.isEmpty(pwd)) {
|
||||
ToastUtils.showErrorShort("密码不能为空.");
|
||||
ToastUtils.showShort("密码不能为空.");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -1,10 +1,9 @@
|
||||
package com.sucstepsoft.txrealtimelocation.activitys.base;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.graphics.Color;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.provider.Settings;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.support.v7.widget.GridLayoutManager;
|
||||
@ -16,7 +15,6 @@ import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
@ -30,8 +28,6 @@ import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
import com.sucstepsoft.cm_utils.core.update.Constants;
|
||||
import com.sucstepsoft.cm_utils.core.update.DownloadService;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.NotificationUtils;
|
||||
import com.sucstepsoft.cm_utils.keeplive.KeepLiveManage;
|
||||
import com.sucstepsoft.cm_utils.utils.LogUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.PermissionUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.ToastUtils;
|
||||
@ -45,16 +41,14 @@ import com.sucstepsoft.txrealtimelocation.activitys.issue.IssueCheckActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.issue.MapActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.issue.PublicAreaActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.lawlib.LawLibActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.locus.LocusMapActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.mine.MineMissionActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.mine.UserActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.notice.NoticeActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.plan.PlanActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.plan.PlanHistoryActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.trouble.CaseCheckOptionsActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.trouble.CaseCheckOptionsDetailActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.trouble.RandomMissionActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.plan.PlanListActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.trouble.SelCompanyActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.trouble.TdTaskActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.FunctionAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.FunctionNumAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.AppTokenUser;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.BaseUserBean;
|
||||
@ -63,29 +57,21 @@ import com.sucstepsoft.txrealtimelocation.beans.SuccCountBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.VersionBean;
|
||||
import com.sucstepsoft.txrealtimelocation.net.LocationApiService;
|
||||
import com.sucstepsoft.txrealtimelocation.utils.GpsUtils;
|
||||
import com.sucstepsoft.txrealtimelocation.utils.IntentWrapper;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.OnClick;
|
||||
import butterknife.Unbinder;
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
@Route(path = PathConfig.PATH_MODULE_MAIN_HOME)
|
||||
|
||||
public class MainActivity extends BaseActivity {
|
||||
@BindView(R.id.rlv_funcs)
|
||||
RecyclerView mRlvBtns;
|
||||
@ -126,23 +112,16 @@ public class MainActivity extends BaseActivity {
|
||||
private static final int GPS_REQUEST_CODE = 1234;
|
||||
private Unbinder mBind;
|
||||
private List<FuncBean> mFuncs = new ArrayList<>();
|
||||
private String[] mBtnStrs = new String[]{"我的企业\n(新增企业)", "企业检查", "隐患复查", "待办任务", "固定任务",
|
||||
"随机任务", "公共区域", "法律法规", "企业地图", "工作轨迹", "钉钉"};
|
||||
private String[] mBtnStrs = new String[]{"我的企业\n(新增企业)", "企业检查", "隐患复查", "我的任务", "公共区域", "法律法规", "企业地图", "钉钉"};
|
||||
// private String[] mBtnStrs = new String[]{"企业信息", "隐患上报", "隐患复查", "我的任务", "历史任务", "法律法规"};
|
||||
private int[] mBtnIds = new int[]{R.drawable.ic_main_c_info, R.drawable.ic_main_report,
|
||||
R.drawable.ic_main_risk,
|
||||
R.drawable.ic_law,
|
||||
private int[] mBtnIds = new int[]{R.drawable.ic_main_c_info, R.drawable.ic_main_report, R.drawable.ic_main_risk,
|
||||
R.drawable.ic_main_mine,
|
||||
R.drawable.ic_main_history,
|
||||
R.drawable.ic_main_history,
|
||||
R.drawable.ic_main_law,
|
||||
R.drawable.ic_main_risk,
|
||||
R.drawable.ic_main_risk,
|
||||
R.drawable.ic_main_report};
|
||||
private Gson mGson = null;
|
||||
private AlertDialog mGpsWeakDialog;
|
||||
private MessageReceiver mReceiver;
|
||||
private FunctionNumAdapter mFunctionNumAdapter;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
@ -172,19 +151,6 @@ public class MainActivity extends BaseActivity {
|
||||
openGpsSetting();
|
||||
}
|
||||
getUserIsGrid();
|
||||
startLocation();
|
||||
registerMessageCount();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 注册socket广播
|
||||
*/
|
||||
private void registerMessageCount() {
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addAction(PathConfig.ACTION_PUSH_UPCOMING_BY_SYS);
|
||||
mReceiver = new MessageReceiver();
|
||||
registerReceiver(mReceiver, filter);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -205,54 +171,19 @@ public class MainActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onNext(GirdPBean girdPBean) {
|
||||
if ("grid".equals(girdPBean.getPersonType())) {
|
||||
int isGridOperator = girdPBean.getIsGridOperator();
|
||||
UserLgUtils.setIndustryId(isGridOperator);
|
||||
|
||||
if (!TextUtils.isEmpty(girdPBean.getGridType())) {
|
||||
UserLgUtils.setIndustryId(girdPBean.getGridType());
|
||||
} else {
|
||||
UserLgUtils.setIndustryId("");
|
||||
}
|
||||
} else {
|
||||
UserLgUtils.setIndustryId(-1);
|
||||
Iterator<FuncBean> iterator = mFuncs.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
FuncBean bean = iterator.next();
|
||||
if ("隐患复查".equals(bean.getText())) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
mFunctionNumAdapter.setData(mFuncs);
|
||||
}
|
||||
UserLgUtils.setPersonType(girdPBean.getPersonType());
|
||||
String page = getIntent().getStringExtra("page");
|
||||
String serviceId = getIntent().getStringExtra("id");
|
||||
|
||||
if (!TextUtils.isEmpty(page)) {
|
||||
switch (page) {
|
||||
case "GO_CHECK2_INFO"://历史案件页面
|
||||
startActivity(new Intent(mActivity, HistoryListActivity.class));
|
||||
break;
|
||||
case "GO_CHECK2_COMPLETE"://待办任务完成
|
||||
if (!TextUtils.isEmpty(serviceId)) {
|
||||
String[] split = serviceId.split(":");
|
||||
Intent intent = new Intent(mActivity,
|
||||
CaseCheckOptionsDetailActivity.class);
|
||||
intent.putExtra("checkId", split[1]);
|
||||
startActivity(intent);
|
||||
}
|
||||
break;
|
||||
case "GO_CHECK2_HANDLE"://待办案件未完成
|
||||
if (!TextUtils.isEmpty(serviceId)) {
|
||||
String[] split = serviceId.split(":");
|
||||
Intent intent = new Intent(mActivity,
|
||||
CaseCheckOptionsActivity.class);
|
||||
intent.putExtra("checkId", split[1]);
|
||||
startActivity(intent);
|
||||
}
|
||||
break;
|
||||
}
|
||||
UserLgUtils.setIndustryId("");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
UserLgUtils.setIndustryId(-1);
|
||||
UserLgUtils.setIndustryId("");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -262,39 +193,6 @@ public class MainActivity extends BaseActivity {
|
||||
});
|
||||
}
|
||||
|
||||
private void startLocation() {
|
||||
//注册待办信息
|
||||
//引导用户加入白名单
|
||||
boolean isSetting = UserLgUtils.getIsSetting();
|
||||
if (!isSetting) {
|
||||
IntentWrapper.whiteListMatters(mActivity, "应急管理局");
|
||||
}
|
||||
|
||||
KeepLiveManage.doKeepLive(getApplication());
|
||||
boolean notifyEnabled = NotificationUtils.isNotifyEnabled(getApplicationContext());
|
||||
if (!notifyEnabled) {
|
||||
showNotifySettingPage();
|
||||
}
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(PathConfig.ACTION_PUSH_RESTART_SOCKET);
|
||||
sendBroadcast(intent);
|
||||
}
|
||||
|
||||
/**
|
||||
* 提示通知未开启
|
||||
*/
|
||||
private void showNotifySettingPage() {
|
||||
new android.app.AlertDialog.Builder(MainActivity.this)
|
||||
.setIcon(android.R.drawable.ic_dialog_info)
|
||||
.setTitle("提示")
|
||||
.setMessage("为了您能正常接收到系统消息通知,请前往设置页面,将App通知权限开启.")
|
||||
.setNegativeButton("取消", null)
|
||||
.setPositiveButton("立即前往", (dialogInterface, i) -> {
|
||||
NotificationUtils.toSettingPage(getApplicationContext());
|
||||
})
|
||||
.show();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化首页按钮
|
||||
@ -307,10 +205,10 @@ public class MainActivity extends BaseActivity {
|
||||
bean.setHintNum(0);
|
||||
mFuncs.add(bean);
|
||||
}
|
||||
mFunctionNumAdapter = new FunctionNumAdapter(mActivity, mFuncs);
|
||||
FunctionNumAdapter adapter = new FunctionNumAdapter(mActivity, mFuncs);
|
||||
mRlvBtns.setLayoutManager(new GridLayoutManager(mActivity, 2));
|
||||
mRlvBtns.setAdapter(mFunctionNumAdapter);
|
||||
mFunctionNumAdapter.addOnItemClickListener(this::chosePage);
|
||||
mRlvBtns.setAdapter(adapter);
|
||||
adapter.addOnItemClickListener(this::chosePage);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -332,13 +230,10 @@ public class MainActivity extends BaseActivity {
|
||||
case "隐患复查":
|
||||
intent = new Intent(this, CounterCheckMainActivity.class);
|
||||
break;
|
||||
case "待办任务"://各类待办任务
|
||||
intent = new Intent(this, TdTaskActivity.class);
|
||||
break;
|
||||
case "法律法规":
|
||||
intent = new Intent(this, LawLibActivity.class);
|
||||
break;
|
||||
case "固定任务":
|
||||
case "我的任务":
|
||||
intent = new Intent(this, MineMissionActivity.class);
|
||||
break;
|
||||
case "历史任务":
|
||||
@ -353,17 +248,11 @@ public class MainActivity extends BaseActivity {
|
||||
case "钉钉":
|
||||
intent = getPackageManager().getLaunchIntentForPackage("com.alibaba.android.rimet");
|
||||
break;
|
||||
case "随机任务":
|
||||
intent = new Intent(this, RandomMissionActivity.class);
|
||||
break;
|
||||
case "工作轨迹":
|
||||
intent = new Intent(this, LocusMapActivity.class);
|
||||
break;
|
||||
}
|
||||
if (intent != null) {
|
||||
startActivity(intent);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("未安装钉钉");
|
||||
ToastUtils.showShort("未安装钉钉");
|
||||
}
|
||||
}
|
||||
|
||||
@ -575,7 +464,7 @@ public class MainActivity extends BaseActivity {
|
||||
if (isInstall) {
|
||||
checkAppVersion();
|
||||
} else {
|
||||
ToastUtils.showErrorLong("软件升级需要使用安装未知来源的权限,请授权.");
|
||||
ToastUtils.showLong("软件升级需要使用安装未知来源的权限,请授权.");
|
||||
Intent intent = new Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES);
|
||||
startActivityForResult(intent, 10086);
|
||||
}
|
||||
@ -600,7 +489,7 @@ public class MainActivity extends BaseActivity {
|
||||
* 开始下载Apk
|
||||
*/
|
||||
private void startDownloadApk() {
|
||||
ToastUtils.showSuccessShort("检测到新版本,开始下载,请在通知栏查看下载进度");
|
||||
ToastUtils.showShort("检测到新版本,开始下载,请在通知栏查看下载进度");
|
||||
Intent intent = new Intent(mActivity, DownloadService.class);
|
||||
intent.putExtra(Constants.APK_DOWNLOAD_URL, BaseUrlApi.APP_DOWNLOAD_URL);
|
||||
startService(intent);
|
||||
@ -624,8 +513,7 @@ public class MainActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onNext(VersionBean successBean) {
|
||||
if (successBean != null && successBean.getData() > 0) {
|
||||
if (CheckUpdateUtils.checkcode(MainActivity.this,
|
||||
successBean.getData() + "")) {
|
||||
if (CheckUpdateUtils.checkcode(MainActivity.this, successBean.getData() + "")) {
|
||||
startDownloadApk();
|
||||
}
|
||||
}
|
||||
@ -734,90 +622,9 @@ public class MainActivity extends BaseActivity {
|
||||
if (mBind != null) {
|
||||
mBind.unbind();
|
||||
}
|
||||
if (mReceiver != null) {
|
||||
unregisterReceiver(mReceiver);
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
private class MessageReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
String action = intent.getAction();
|
||||
if (!"grid".equals(UserLgUtils.getPersonType())) {
|
||||
if (PathConfig.ACTION_PUSH_UPCOMING_BY_SYS.equals(action)) {
|
||||
buildMenuCount(intent.getStringExtra(PathConfig.KEY_UPCOMING_SYS_DATA));
|
||||
}
|
||||
} else {
|
||||
if (PathConfig.ACTION_PUSH_UPCOMING_BY_SYS.equals(action)) {
|
||||
buildGridMenuCount(intent.getStringExtra(PathConfig.KEY_UPCOMING_SYS_DATA));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建网格人员随机任务数量
|
||||
*/
|
||||
private void buildGridMenuCount(String data) {
|
||||
try {
|
||||
JSONObject obj = new JSONObject(data);
|
||||
String body = obj.getString("body");
|
||||
JSONArray array = new JSONArray(body);
|
||||
if (array != null && array.length() > 0) {
|
||||
for (int i = 0; i < array.length(); i++) {
|
||||
JSONObject objItem = array.getJSONObject(i);
|
||||
if (!TextUtils.isEmpty(objItem.getString("module"))) {
|
||||
switch (objItem.getString("module")) {
|
||||
case "task_v2":
|
||||
for (int j = 0; j < mFuncs.size(); j++) {
|
||||
if ("随机任务".equals(mFuncs.get(j).getText())) {
|
||||
mFuncs.get(j).setHintNum(objItem.getInt("count"));
|
||||
}
|
||||
}
|
||||
mFunctionNumAdapter.setData(mFuncs);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建非网格员待办任务消息数量
|
||||
*/
|
||||
private void buildMenuCount(String data) {
|
||||
try {
|
||||
JSONObject obj = new JSONObject(data);
|
||||
String body = obj.getString("body");
|
||||
JSONArray array = new JSONArray(body);
|
||||
if (array != null && array.length() > 0) {
|
||||
for (int i = 0; i < array.length(); i++) {
|
||||
JSONObject objItem = array.getJSONObject(i);
|
||||
if (!TextUtils.isEmpty(objItem.getString("module"))) {
|
||||
switch (objItem.getString("module")) {
|
||||
case "module_check2_district":
|
||||
case "module_check2_district_department":
|
||||
case "module_check2_city":
|
||||
case "module_check2_street":
|
||||
for (int j = 0; j < mFuncs.size(); j++) {
|
||||
if ("待办任务".equals(mFuncs.get(j).getText())) {
|
||||
mFuncs.get(j).setHintNum(objItem.getInt("count"));
|
||||
}
|
||||
}
|
||||
mFunctionNumAdapter.setData(mFuncs);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBackPressed() {
|
||||
|
@ -63,12 +63,10 @@ public class PhotoActivity extends BaseActivity {
|
||||
|
||||
mImgUrls = getIntent().getStringArrayListExtra(TAG_IMGURL);
|
||||
if (mImgUrls == null) {
|
||||
ToastUtils.showErrorShort("请检查图片地址");
|
||||
ToastUtils.showShort(R.string.check_imgurl);
|
||||
finish();
|
||||
} else {
|
||||
ImageAdapter adapter = new ImageAdapter(this, mImgUrls);
|
||||
adapter.addOnImgClick(this::finish);
|
||||
mVpImages.setAdapter(adapter);
|
||||
mVpImages.setAdapter(new ImageAdapter(this, mImgUrls));
|
||||
mTvCount.setText(String.format(getResources().getString(R.string.img_position), 1, mImgUrls.size()));
|
||||
mVpImages.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
@Override
|
||||
@ -87,7 +85,6 @@ public class PhotoActivity extends BaseActivity {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@SuppressLint("CheckResult")
|
||||
@ -100,47 +97,47 @@ public class PhotoActivity extends BaseActivity {
|
||||
Observable.create((ObservableOnSubscribe<File>) e -> {
|
||||
//通过gilde下载得到file文件,这里需要注意android.permission.INTERNET权限
|
||||
e.onNext(Glide.with(mActivity)
|
||||
.load(s)
|
||||
.downloadOnly(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL)
|
||||
.get());
|
||||
.load(s)
|
||||
.downloadOnly(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL)
|
||||
.get());
|
||||
e.onComplete();
|
||||
}).subscribeOn(Schedulers.io())
|
||||
.observeOn(Schedulers.newThread())
|
||||
.subscribe(new Observer<File>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
.observeOn(Schedulers.newThread())
|
||||
.subscribe(new Observer<File>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(File file) {
|
||||
dialog.dismiss();
|
||||
File appDir = new File(PathConfig.CATCH_PATH);
|
||||
if (!appDir.exists()) {
|
||||
appDir.mkdirs();
|
||||
}
|
||||
String fileName = System.currentTimeMillis() + ".jpg";
|
||||
File destFile = new File(appDir, fileName);
|
||||
//把gilde下载得到图片复制到定义好的目录中去
|
||||
copy(file, destFile);
|
||||
// 最后通知图库更新
|
||||
sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE,
|
||||
Uri.fromFile(new File(destFile.getPath()))));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.showErrorShort("保存失败,稍后重试.");
|
||||
}
|
||||
@Override
|
||||
public void onNext(File file) {
|
||||
dialog.dismiss();
|
||||
File appDir = new File(PathConfig.CATCH_PATH);
|
||||
if (!appDir.exists()) {
|
||||
appDir.mkdirs();
|
||||
}
|
||||
String fileName = System.currentTimeMillis() + ".jpg";
|
||||
File destFile = new File(appDir, fileName);
|
||||
//把gilde下载得到图片复制到定义好的目录中去
|
||||
copy(file, destFile);
|
||||
// 最后通知图库更新
|
||||
sendBroadcast(new Intent(Intent.ACTION_MEDIA_SCANNER_SCAN_FILE,
|
||||
Uri.fromFile(new File(destFile.getPath()))));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.showShort("保存失败,稍后重试.");
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
} else {
|
||||
ToastUtils.showErrorShort("图片地址有误,请稍后重试.");
|
||||
ToastUtils.showShort("图片地址有误,请稍后重试.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -163,7 +160,7 @@ public class PhotoActivity extends BaseActivity {
|
||||
ToastUtils.showLong("保存成功,前往SD卡下" + PathConfig.PROJECT_NAME + "文件夹下查看");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
ToastUtils.showErrorShort("保存失败,请稍后重试");
|
||||
ToastUtils.showShort("保存失败,请稍后重试");
|
||||
} finally {
|
||||
try {
|
||||
fileInputStream.close();
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.sucstepsoft.txrealtimelocation.activitys.companylib;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.widget.GridLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.text.TextUtils;
|
||||
@ -17,7 +18,6 @@ import com.sucstepsoft.txrealtimelocation.R;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.common.PhotoActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CompanyDetailBean;
|
||||
import com.sucstepsoft.txrealtimelocation.net.LocationApiService;
|
||||
import com.sucstepsoft.txrealtimelocation.widget.WaterMark;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -108,7 +108,6 @@ public class CompanyDetailActivity extends BaseActivity {
|
||||
startActivity(intent);
|
||||
});
|
||||
mId = getIntent().getStringExtra("id");
|
||||
WaterMark.getInstance().show(this, UserLgUtils.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -119,30 +118,35 @@ public class CompanyDetailActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
private void getCompanyDetailById(String mId) {
|
||||
RetrofitManager.getInstance().create(LocationApiService.class).getCompanyDetail(mId, UserLgUtils.getToken()).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer<CompanyDetailBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
mDetailDis = d;
|
||||
}
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getCompanyDetail(mId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<CompanyDetailBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
mDetailDis = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(CompanyDetailBean companyDetailBean) {
|
||||
if (companyDetailBean != null) {
|
||||
mDetailBean = companyDetailBean;
|
||||
setDataToView();
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void onNext(CompanyDetailBean companyDetailBean) {
|
||||
if (companyDetailBean != null) {
|
||||
mDetailBean = companyDetailBean;
|
||||
setDataToView();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
}
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void setDataToView() {
|
||||
|
@ -372,7 +372,7 @@ public class CompanyInfoEditActivity extends BaseActivity {
|
||||
if (mSoltList == null) {
|
||||
getDicList(PathConfig.DIC_COMPANY_TYPE, 11);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("暂无数据");
|
||||
ToastUtils.showShort("暂无数据");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -395,7 +395,7 @@ public class CompanyInfoEditActivity extends BaseActivity {
|
||||
if (mNatureList == null) {
|
||||
getDicList(PathConfig.DIC_PLACE_ID, 10);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("暂无数据");
|
||||
ToastUtils.showShort("暂无数据");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -440,7 +440,7 @@ public class CompanyInfoEditActivity extends BaseActivity {
|
||||
if (mTradeList1 == null) {
|
||||
getDicList(PathConfig.DIC_TRADE_ID, 9);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("暂无数据");
|
||||
ToastUtils.showShort("暂无数据");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -583,7 +583,7 @@ public class CompanyInfoEditActivity extends BaseActivity {
|
||||
if (mTraitList == null) {
|
||||
getDicList(PathConfig.DIC_RISK_ID, 8);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("暂无数据");
|
||||
ToastUtils.showShort("暂无数据");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -624,7 +624,7 @@ public class CompanyInfoEditActivity extends BaseActivity {
|
||||
if (mArea1List == null) {
|
||||
getDicList(PathConfig.DIC_AREA_ID, 2);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("暂无数据");
|
||||
ToastUtils.showShort("暂无数据");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -652,7 +652,7 @@ public class CompanyInfoEditActivity extends BaseActivity {
|
||||
if (mTypeList == null) {
|
||||
getDicList(PathConfig.DIC_COMPANY_TYPE_ID, 1);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("暂无数据");
|
||||
ToastUtils.showShort("暂无数据");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -677,7 +677,7 @@ public class CompanyInfoEditActivity extends BaseActivity {
|
||||
submitBean.setArea1(mSelArea1Id);
|
||||
submitBean.setArea2(mSelArea2Id);
|
||||
submitBean.setArea3(mSelArea3Id);
|
||||
// submitBean.setClassify(mSelClassifyID);
|
||||
submitBean.setClassify(mSelClassifyID);
|
||||
|
||||
submitBean.setNature(mSelNatureId);
|
||||
|
||||
@ -716,7 +716,7 @@ public class CompanyInfoEditActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
progressDialog.dismiss();
|
||||
ToastUtils.showSuccessShort("修改成功");
|
||||
ToastUtils.showShort("修改成功");
|
||||
if (!TextUtils.isEmpty(mType)) {
|
||||
Intent intent = new Intent(mActivity, CatalogActivity.class);
|
||||
intent.putExtra("phone", submitBean.getPhone());
|
||||
@ -733,7 +733,7 @@ public class CompanyInfoEditActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
progressDialog.dismiss();
|
||||
ToastUtils.showErrorShort("修改失败,请重试");
|
||||
ToastUtils.showShort("修改失败,请重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -747,7 +747,7 @@ public class CompanyInfoEditActivity extends BaseActivity {
|
||||
private boolean checkParams() {
|
||||
companyName = mEtCompanyName.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(companyName)) {
|
||||
ToastUtils.showErrorShort("请输入企业名称");
|
||||
ToastUtils.showShort("请输入企业名称");
|
||||
return false;
|
||||
}
|
||||
// code = mEtCompanyCode.getText().toString().trim();
|
||||
@ -762,21 +762,21 @@ public class CompanyInfoEditActivity extends BaseActivity {
|
||||
// }
|
||||
companP = mEtCompanyP.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(companP)) {
|
||||
ToastUtils.showErrorShort("请输入企业法人");
|
||||
ToastUtils.showShort("请输入企业法人");
|
||||
return false;
|
||||
}
|
||||
detailAddress = mEtDetailAddress.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(detailAddress)) {
|
||||
ToastUtils.showErrorShort("请输入企业详细地址");
|
||||
ToastUtils.showShort("请输入企业详细地址");
|
||||
return false;
|
||||
}
|
||||
if (TextUtils.isEmpty(mSelClassifyID)) {
|
||||
ToastUtils.showShort("请选择企业分类");
|
||||
return false;
|
||||
}
|
||||
// if (TextUtils.isEmpty(mSelClassifyID)) {
|
||||
// ToastUtils.showErrorShort("请选择企业分类");
|
||||
// return false;
|
||||
// }
|
||||
praceNum = mEtPeoCount.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(praceNum)) {
|
||||
ToastUtils.showErrorShort("请输入从业人员数量");
|
||||
ToastUtils.showShort("请输入从业人员数量");
|
||||
return false;
|
||||
}
|
||||
// people = mEtPre.getText().toString().trim();
|
||||
@ -786,11 +786,11 @@ public class CompanyInfoEditActivity extends BaseActivity {
|
||||
// }
|
||||
phone = mEtPhone.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(phone) || !RegexUtils.isMobileSimple(phone)) {
|
||||
ToastUtils.showErrorShort("请输入合法的联系电话");
|
||||
ToastUtils.showShort("请输入合法的联系电话");
|
||||
return false;
|
||||
}
|
||||
if (TextUtils.isEmpty(mSelTypeId)) {
|
||||
ToastUtils.showErrorShort("请选择企业类型");
|
||||
ToastUtils.showShort("请选择企业类型");
|
||||
return false;
|
||||
}
|
||||
// if (TextUtils.isEmpty(mSelTrade1)) {
|
||||
@ -802,19 +802,19 @@ public class CompanyInfoEditActivity extends BaseActivity {
|
||||
// return false;
|
||||
// }
|
||||
if (TextUtils.isEmpty(mSelArea1Id)) {
|
||||
ToastUtils.showErrorShort("请选择企业所属省、自治区");
|
||||
ToastUtils.showShort("请选择企业所属省、自治区");
|
||||
return false;
|
||||
}
|
||||
if (TextUtils.isEmpty(mSelArea2Id)) {
|
||||
ToastUtils.showErrorShort("请选择企业所属市");
|
||||
ToastUtils.showShort("请选择企业所属市");
|
||||
return false;
|
||||
}
|
||||
if (TextUtils.isEmpty(mSelArea3Id)) {
|
||||
ToastUtils.showErrorShort("请选择企业所属旗县、区");
|
||||
ToastUtils.showShort("请选择企业所属旗县、区");
|
||||
return false;
|
||||
}
|
||||
if (TextUtils.isEmpty(mDoorPhotoIds)) {
|
||||
ToastUtils.showErrorShort("请上传生产单位经营外貌照片");
|
||||
ToastUtils.showShort("请上传生产单位经营外貌照片");
|
||||
return false;
|
||||
}
|
||||
// if (TextUtils.isEmpty(mPlacePhotoIds)) {
|
||||
@ -822,7 +822,7 @@ public class CompanyInfoEditActivity extends BaseActivity {
|
||||
// return false;
|
||||
// }
|
||||
if (TextUtils.isEmpty(mSelNatureId)) {
|
||||
ToastUtils.showErrorShort("请选择场所性质");
|
||||
ToastUtils.showShort("请选择场所性质");
|
||||
return false;
|
||||
}
|
||||
// if (TextUtils.isEmpty(mSelSoltId)) {
|
||||
@ -902,7 +902,7 @@ public class CompanyInfoEditActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showErrorShort("获取数据失败,请稍后重试");
|
||||
ToastUtils.showShort("获取数据失败,请稍后重试");
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
|
||||
@ -945,18 +945,18 @@ public class CompanyInfoEditActivity extends BaseActivity {
|
||||
if (mArea2List == null) {
|
||||
getDicList(mSelArea1Id, 3);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("暂无数据");
|
||||
ToastUtils.showShort("暂无数据");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ToastUtils.showErrorShort("请先选择省、自治区");
|
||||
ToastUtils.showShort("请先选择省、自治区");
|
||||
}
|
||||
}
|
||||
|
||||
private void onShowArea3Picker() {
|
||||
hideSoftKeyboard();
|
||||
if (TextUtils.isEmpty(mSelArea2Id)) {
|
||||
ToastUtils.showErrorShort("请先选择市");
|
||||
ToastUtils.showShort("请先选择市");
|
||||
} else {
|
||||
if (mArea3List != null && mArea3List.size() > 0) {
|
||||
mMArea3Picker = new OptionsPickerBuilder(mActivity, (options1, options2, options3, v) -> {
|
||||
@ -984,7 +984,7 @@ public class CompanyInfoEditActivity extends BaseActivity {
|
||||
if (mArea3List == null) {
|
||||
getDicList(mSelArea2Id, 4);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("暂无数据");
|
||||
ToastUtils.showShort("暂无数据");
|
||||
}
|
||||
|
||||
}
|
||||
@ -995,7 +995,7 @@ public class CompanyInfoEditActivity extends BaseActivity {
|
||||
private void onShowArea4Picker() {
|
||||
hideSoftKeyboard();
|
||||
if (TextUtils.isEmpty(mSelArea3Id)) {
|
||||
ToastUtils.showErrorShort("请先选择旗县区");
|
||||
ToastUtils.showShort("请先选择旗县区");
|
||||
} else {
|
||||
if (mArea4List != null && mArea4List.size() > 0) {
|
||||
mMArea4Picker = new OptionsPickerBuilder(mActivity, (options1, options2, options3, v) -> {
|
||||
@ -1020,7 +1020,7 @@ public class CompanyInfoEditActivity extends BaseActivity {
|
||||
if (mArea4List == null) {
|
||||
getDicList(mSelArea3Id, 5);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("暂无数据");
|
||||
ToastUtils.showShort("暂无数据");
|
||||
}
|
||||
|
||||
}
|
||||
@ -1030,7 +1030,7 @@ public class CompanyInfoEditActivity extends BaseActivity {
|
||||
private void onShowArea5Picker() {
|
||||
hideSoftKeyboard();
|
||||
if (TextUtils.isEmpty(mSelArea4Id)) {
|
||||
ToastUtils.showErrorShort("请先选择街道");
|
||||
ToastUtils.showShort("请先选择街道");
|
||||
} else {
|
||||
if (mArea5List != null && mArea5List.size() > 0) {
|
||||
mMArea5Picker = new OptionsPickerBuilder(mActivity, (options1, options2, options3, v) -> {
|
||||
@ -1048,7 +1048,7 @@ public class CompanyInfoEditActivity extends BaseActivity {
|
||||
if (mArea5List == null) {
|
||||
getDicList(mSelArea4Id, 6);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("暂无数据");
|
||||
ToastUtils.showShort("暂无数据");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1124,7 +1124,7 @@ public class CompanyInfoEditActivity extends BaseActivity {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showSuccessShort("上传成功");
|
||||
ToastUtils.showShort("上传成功");
|
||||
mCurrentBean.setId(baseUserBean.getData());
|
||||
mCurrentBean.setPath(picPath);
|
||||
if (mCurrentPhotoType == 1) {
|
||||
@ -1148,7 +1148,7 @@ public class CompanyInfoEditActivity extends BaseActivity {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showErrorShort("上传失败,请稍后重试.");
|
||||
ToastUtils.showShort("上传失败,请稍后重试.");
|
||||
if (file.exists()) {
|
||||
file.delete();
|
||||
}
|
||||
@ -1166,7 +1166,7 @@ public class CompanyInfoEditActivity extends BaseActivity {
|
||||
if (progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showErrorShort("图片上传失败,请稍后重试");
|
||||
ToastUtils.showShort("图片上传失败,请稍后重试");
|
||||
}
|
||||
})
|
||||
.launch();
|
||||
@ -1201,8 +1201,8 @@ public class CompanyInfoEditActivity extends BaseActivity {
|
||||
|
||||
mSelArea2Id = mDetailBean.getArea2();
|
||||
mTvArea2.setText(mDetailBean.getArea2DictionaryName() + mDetailBean.getArea3DictionaryName() + mDetailBean.getArea4DictionaryName());
|
||||
// mSelClassifyID = mDetailBean.getClassify();
|
||||
// mTvClassify.setText(mDetailBean.getClassifyDictionaryName());
|
||||
mSelClassifyID = mDetailBean.getClassify();
|
||||
mTvClassify.setText(mDetailBean.getClassifyDictionaryName());
|
||||
mSelArea3Id = mDetailBean.getArea3();
|
||||
// mTvArea3.setText(mDetailBean.getArea3DictionaryName());
|
||||
|
||||
|
@ -179,7 +179,7 @@ public class CompanyLibActivity extends BaseActivity {
|
||||
if (mTypeList == null) {
|
||||
getDicList(PathConfig.DIC_COMPANY_TYPE_ID, 1);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("暂无数据");
|
||||
ToastUtils.showShort("暂无数据");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -214,7 +214,7 @@ public class CompanyLibActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showErrorShort("获取数据失败,请稍后重试");
|
||||
ToastUtils.showShort("获取数据失败,请稍后重试");
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
|
||||
@ -232,7 +232,7 @@ public class CompanyLibActivity extends BaseActivity {
|
||||
mSearchCompanyName = mEtCompanyName.getText().toString().trim();
|
||||
//判断搜索那个有值
|
||||
if (TextUtils.isEmpty(mSearchCompanyName) && TextUtils.isEmpty(mCompanyType)) {
|
||||
ToastUtils.showErrorShort("请输入企业名称或选择企业类型");
|
||||
ToastUtils.showShort("请输入企业名称或选择企业类型");
|
||||
} else {
|
||||
mCurrentPage = 1;
|
||||
if (!TextUtils.isEmpty(mSearchCompanyName) && !TextUtils.isEmpty(mCompanyType)) {
|
||||
@ -308,7 +308,7 @@ public class CompanyLibActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showErrorShort("数据加载失,请稍后重试");
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -375,7 +375,7 @@ public class CompanyLibActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showErrorShort("数据加载失,请稍后重试");
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -442,7 +442,7 @@ public class CompanyLibActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showErrorShort("数据加载失,请稍后重试");
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -477,7 +477,7 @@ public class CompanyLibActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showSuccessShort("解绑成功");
|
||||
ToastUtils.showShort("解绑成功");
|
||||
LogUtils.e(index);
|
||||
mAdapter.getData().get(index).setUserCount(0);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
@ -485,7 +485,7 @@ public class CompanyLibActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showErrorShort("解绑失败,请重试");
|
||||
ToastUtils.showShort("解绑失败,请重试");
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
|
||||
@ -527,7 +527,7 @@ public class CompanyLibActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showSuccessShort("绑定成功");
|
||||
ToastUtils.showShort("绑定成功");
|
||||
LogUtils.e(index);
|
||||
mAdapter.getData().get(index).setUserCount(2);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
@ -535,7 +535,7 @@ public class CompanyLibActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showErrorShort("绑定失败,请重试");
|
||||
ToastUtils.showShort("绑定失败,请重试");
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
|
||||
@ -655,7 +655,7 @@ public class CompanyLibActivity extends BaseActivity {
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
stateView(STATE_LOAD_ERROR);
|
||||
ToastUtils.showErrorShort("数据加载失,请稍后重试");
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -176,7 +176,7 @@ public class MineCompanyLibActivity extends BaseActivity {
|
||||
if (mTypeList == null) {
|
||||
getDicList(PathConfig.DIC_COMPANY_TYPE_ID, 1);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("暂无数据");
|
||||
ToastUtils.showShort("暂无数据");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -211,7 +211,7 @@ public class MineCompanyLibActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showErrorShort("获取数据失败,请稍后重试");
|
||||
ToastUtils.showShort("获取数据失败,请稍后重试");
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
|
||||
@ -229,7 +229,7 @@ public class MineCompanyLibActivity extends BaseActivity {
|
||||
mSearchCompanyName = mEtCompanyName.getText().toString().trim();
|
||||
//判断搜索那个有值
|
||||
if (TextUtils.isEmpty(mSearchCompanyName) && TextUtils.isEmpty(mCompanyType)) {
|
||||
ToastUtils.showErrorShort("请输入企业名称或选择企业类型");
|
||||
ToastUtils.showShort("请输入企业名称或选择企业类型");
|
||||
} else {
|
||||
mCurrentPage = 1;
|
||||
if (!TextUtils.isEmpty(mSearchCompanyName) && !TextUtils.isEmpty(mCompanyType)) {
|
||||
@ -305,7 +305,7 @@ public class MineCompanyLibActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showErrorShort("数据加载失,请稍后重试");
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -372,7 +372,7 @@ public class MineCompanyLibActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showErrorShort("数据加载失,请稍后重试");
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -439,7 +439,7 @@ public class MineCompanyLibActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showErrorShort("数据加载失,请稍后重试");
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -474,7 +474,7 @@ public class MineCompanyLibActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showSuccessShort("解绑成功");
|
||||
ToastUtils.showShort("解绑成功");
|
||||
LogUtils.e(index);
|
||||
mAdapter.getData().remove(index);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
@ -482,7 +482,7 @@ public class MineCompanyLibActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showErrorShort("解绑失败,请重试");
|
||||
ToastUtils.showShort("解绑失败,请重试");
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
|
||||
@ -524,7 +524,7 @@ public class MineCompanyLibActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showSuccessShort("绑定成功");
|
||||
ToastUtils.showShort("绑定成功");
|
||||
LogUtils.e(index);
|
||||
mAdapter.getData().get(index).setUserId(UserLgUtils.getUserId());
|
||||
mAdapter.notifyDataSetChanged();
|
||||
@ -532,7 +532,7 @@ public class MineCompanyLibActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showErrorShort("绑定失败,请重试");
|
||||
ToastUtils.showShort("绑定失败,请重试");
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
|
||||
@ -652,7 +652,7 @@ public class MineCompanyLibActivity extends BaseActivity {
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
stateView(STATE_ERROR);
|
||||
ToastUtils.showErrorShort("数据加载失,请稍后重试");
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -168,7 +168,7 @@ public class CounterCheckMainActivity extends BaseActivity {
|
||||
if (mTypeList == null) {
|
||||
getDicList(PathConfig.DIC_COMPANY_TYPE_ID, 1);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("暂无数据");
|
||||
ToastUtils.showShort("暂无数据");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -203,7 +203,7 @@ public class CounterCheckMainActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showErrorShort("获取数据失败,请稍后重试");
|
||||
ToastUtils.showShort("获取数据失败,请稍后重试");
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
|
||||
@ -221,7 +221,7 @@ public class CounterCheckMainActivity extends BaseActivity {
|
||||
mSearchCompanyName = mEtCompanyName.getText().toString().trim();
|
||||
//判断搜索那个有值
|
||||
if (TextUtils.isEmpty(mSearchCompanyName) && TextUtils.isEmpty(mCompanyType)) {
|
||||
ToastUtils.showErrorShort("请输入企业名称或选择企业类型");
|
||||
ToastUtils.showShort("请输入企业名称或选择企业类型");
|
||||
} else {
|
||||
mCurrentPage = 1;
|
||||
if (!TextUtils.isEmpty(mSearchCompanyName) && !TextUtils.isEmpty(mCompanyType)) {
|
||||
@ -297,7 +297,7 @@ public class CounterCheckMainActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showErrorShort("数据加载失,请稍后重试");
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -364,7 +364,7 @@ public class CounterCheckMainActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showErrorShort("数据加载失,请稍后重试");
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -431,7 +431,7 @@ public class CounterCheckMainActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showErrorShort("数据加载失,请稍后重试");
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -481,8 +481,8 @@ public class CounterCheckMainActivity extends BaseActivity {
|
||||
private void showDetail(CounterCheckListBean.RowsBean bean) {
|
||||
Intent intent = new Intent(mActivity, NewCounterCheckOptionsActivity.class);
|
||||
intent.putExtra("checkId", bean.getCheckId());
|
||||
intent.putExtra("name", bean.getEnterpriseName());
|
||||
intent.putExtra("peo", bean.getEnterpriseMaster());
|
||||
intent.putExtra("name", bean.getNameJoinByEnterpriseId());
|
||||
intent.putExtra("peo", bean.getMasterJoinByEnterpriseId());
|
||||
intent.putExtra("enId", bean.getEnterpriseId());
|
||||
startActivityForResult(intent, 123);
|
||||
}
|
||||
@ -563,7 +563,7 @@ public class CounterCheckMainActivity extends BaseActivity {
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
stateView(STATE_LOAD_ERROR);
|
||||
ToastUtils.showErrorShort("数据加载失,请稍后重试");
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -293,14 +293,14 @@ public class CounterCheckOptionsActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.showErrorShort("上报成功");
|
||||
ToastUtils.showShort("上报成功");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showErrorShort("提交失败,请稍后重试.");
|
||||
ToastUtils.showShort("提交失败,请稍后重试.");
|
||||
dialog.dismiss();
|
||||
}
|
||||
|
||||
@ -427,7 +427,7 @@ public class CounterCheckOptionsActivity extends BaseActivity {
|
||||
doSubmit(submitBean);
|
||||
} else {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showErrorShort("检查项中存在未检查的项目");
|
||||
ToastUtils.showShort("检查项中存在未检查的项目");
|
||||
}
|
||||
}
|
||||
|
||||
@ -470,14 +470,14 @@ public class CounterCheckOptionsActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showSuccessShort("复查成功");
|
||||
ToastUtils.showShort("复查成功");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showErrorShort("复查失败,请稍后重试");
|
||||
ToastUtils.showShort("复查失败,请稍后重试");
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
|
||||
@ -616,7 +616,7 @@ public class CounterCheckOptionsActivity extends BaseActivity {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showSuccessShort("上传成功");
|
||||
ToastUtils.showShort("上传成功");
|
||||
if (mSelPhotosType == 1) {
|
||||
mCurrentBean.setId(baseUserBean.getData());
|
||||
mCurrentBean.setPath(picPath);
|
||||
@ -650,7 +650,7 @@ public class CounterCheckOptionsActivity extends BaseActivity {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showErrorShort("上传失败,请稍后重试.");
|
||||
ToastUtils.showShort("上传失败,请稍后重试.");
|
||||
if (file.exists()) {
|
||||
file.delete();
|
||||
}
|
||||
@ -668,7 +668,7 @@ public class CounterCheckOptionsActivity extends BaseActivity {
|
||||
if (progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showErrorShort("图片上传失败,请稍后重试");
|
||||
ToastUtils.showShort("图片上传失败,请稍后重试");
|
||||
}
|
||||
})
|
||||
.launch();
|
||||
|
@ -53,7 +53,6 @@ import com.sucstepsoft.txrealtimelocation.beans.CounterCheckOptionsBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.OptionsSubmitBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.SuccessBean;
|
||||
import com.sucstepsoft.txrealtimelocation.net.LocationApiService;
|
||||
import com.sucstepsoft.txrealtimelocation.utils.ExceptionHandler;
|
||||
import com.sucstepsoft.txrealtimelocation.widget.EmStateCheck;
|
||||
|
||||
import java.io.File;
|
||||
@ -290,7 +289,7 @@ public class NewCounterCheckOptionsActivity extends BaseActivity {
|
||||
if (mMProgressDialog != null && mMProgressDialog.isShowing()) {
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showErrorShort("检查项中存在未检查的项目");
|
||||
ToastUtils.showShort("检查项中存在未检查的项目");
|
||||
}
|
||||
}
|
||||
|
||||
@ -439,7 +438,7 @@ public class NewCounterCheckOptionsActivity extends BaseActivity {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showSuccessShort("上传成功");
|
||||
ToastUtils.showShort("上传成功");
|
||||
if (mSelPhotosType == 1) {
|
||||
mCurrentBean.setId(baseUserBean.getData());
|
||||
mCurrentBean.setPath(picPath);
|
||||
@ -465,7 +464,7 @@ public class NewCounterCheckOptionsActivity extends BaseActivity {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showErrorShort("上传失败,请稍后重试.");
|
||||
ToastUtils.showShort("上传失败,请稍后重试.");
|
||||
if (file.exists()) {
|
||||
file.delete();
|
||||
}
|
||||
@ -483,7 +482,7 @@ public class NewCounterCheckOptionsActivity extends BaseActivity {
|
||||
if (progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showErrorShort("图片上传失败,请稍后重试");
|
||||
ToastUtils.showShort("图片上传失败,请稍后重试");
|
||||
}
|
||||
})
|
||||
.launch();
|
||||
@ -495,7 +494,7 @@ public class NewCounterCheckOptionsActivity extends BaseActivity {
|
||||
private void buildConfirmData(List<CounterCatalogBean> cBean) {
|
||||
String desc = mEtDesc.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(desc)) {
|
||||
ToastUtils.showErrorShort("请输入整改描述");
|
||||
ToastUtils.showShort("请输入整改描述");
|
||||
return;
|
||||
}
|
||||
if (checkConfirmParams(cBean)) {
|
||||
@ -610,7 +609,7 @@ public class NewCounterCheckOptionsActivity extends BaseActivity {
|
||||
if (mMProgressDialog != null && mMProgressDialog.isShowing()) {
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showErrorShort("检查项中存在未检查的项目");
|
||||
ToastUtils.showShort("检查项中存在未检查的项目");
|
||||
}
|
||||
}
|
||||
|
||||
@ -920,14 +919,14 @@ public class NewCounterCheckOptionsActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showSuccessShort("复查成功");
|
||||
ToastUtils.showShort("复查成功");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ExceptionHandler.handleException(e);
|
||||
ToastUtils.showShort("复查失败,请稍后重试");
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
|
||||
@ -1142,14 +1141,14 @@ public class NewCounterCheckOptionsActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.showSuccessShort("上报成功");
|
||||
ToastUtils.showShort("上报成功");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showErrorShort("提交失败,请稍后重试.");
|
||||
ToastUtils.showShort("提交失败,请稍后重试.");
|
||||
dialog.dismiss();
|
||||
}
|
||||
|
||||
|
@ -170,14 +170,14 @@ public class CheckOptionsActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.showSuccessShort("检查成功");
|
||||
ToastUtils.showShort("检查成功");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showErrorShort("提交失败,请稍后重试.");
|
||||
ToastUtils.showShort("提交失败,请稍后重试.");
|
||||
dialog.dismiss();
|
||||
}
|
||||
|
||||
@ -209,7 +209,7 @@ public class CheckOptionsActivity extends BaseActivity {
|
||||
if (o.getIsMust() == 1) {
|
||||
if (o.getState() == EmStateCheck.NORMAL) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showErrorShort("检查项中存在未检查的必查项目");
|
||||
ToastUtils.showShort("检查项中存在未检查的必查项目");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -287,14 +287,14 @@ public class CheckOptionsActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showSuccessShort("检查成功");
|
||||
ToastUtils.showShort("检查成功");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showErrorShort("提交失败,请稍后重试.");
|
||||
ToastUtils.showShort("提交失败,请稍后重试.");
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
|
||||
@ -309,7 +309,7 @@ public class CheckOptionsActivity extends BaseActivity {
|
||||
refreshView(STATE_LOAD_LOADING);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getCheckOptionsList( UserLgUtils.getToken())
|
||||
.getCheckOptionsList(nId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<List<CheckOptionsbean>>() {
|
||||
@ -348,7 +348,7 @@ public class CheckOptionsActivity extends BaseActivity {
|
||||
o.setId(checkOptionsbeans.get(i).getCheckItemId());
|
||||
o.setTitle(checkOptionsbeans.get(i).getNameJoinByCheckItemId());
|
||||
o.setPhotos(mPhotos);
|
||||
o.setIsMust(checkOptionsbeans.get(i).getIsMustCheck());
|
||||
o.setIsMust(checkOptionsbeans.get(i).getType());
|
||||
mOptions.add(o);
|
||||
}
|
||||
mAdapter.setData(mOptions);
|
||||
@ -483,7 +483,7 @@ public class CheckOptionsActivity extends BaseActivity {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showSuccessShort("上传成功");
|
||||
ToastUtils.showShort("上传成功");
|
||||
mCurrentBean.setId(baseUserBean.getData());
|
||||
mCurrentBean.setPath(picPath);
|
||||
if (mCurrentOptions.getPhotos().size() < 4) {
|
||||
@ -498,7 +498,7 @@ public class CheckOptionsActivity extends BaseActivity {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showErrorShort("上传失败,请稍后重试.");
|
||||
ToastUtils.showShort("上传失败,请稍后重试.");
|
||||
if (file.exists()) {
|
||||
file.delete();
|
||||
}
|
||||
@ -516,7 +516,7 @@ public class CheckOptionsActivity extends BaseActivity {
|
||||
if (progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showErrorShort("图片上传失败,请稍后重试");
|
||||
ToastUtils.showShort("图片上传失败,请稍后重试");
|
||||
}
|
||||
})
|
||||
.launch();
|
||||
|
@ -1,6 +1,5 @@
|
||||
package com.sucstepsoft.txrealtimelocation.activitys.issue;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.text.TextUtils;
|
||||
@ -16,7 +15,6 @@ import com.sucstepsoft.cm_utils.utils.LogUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.ToastUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
|
||||
import com.sucstepsoft.txrealtimelocation.R;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.trouble.CaseLogActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.HistoryItemDetailAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.HistoryLeftCatalogAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CompanyDetailBean;
|
||||
@ -74,13 +72,6 @@ public class HistoryDetialActivity extends BaseActivity {
|
||||
String enterpriseId = getIntent().getStringExtra("enterpriseId");
|
||||
//让整改描述可以滑动
|
||||
mTvContent.setMaxLineCount(3);
|
||||
mTvPublish.setVisibility(View.VISIBLE);
|
||||
mTvPublish.setText("日志");
|
||||
mTvPublish.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(mActivity, CaseLogActivity.class);
|
||||
intent.putExtra("cId", cId);
|
||||
startActivity(intent);
|
||||
});
|
||||
getDetail(cId);
|
||||
mCatalogBeans = new ArrayList<>();
|
||||
getCompanyDetail(enterpriseId);
|
||||
@ -122,7 +113,6 @@ public class HistoryDetialActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onNext(CompanyDetailBean companyDetailBean) {
|
||||
if (companyDetailBean != null) {
|
||||
mTvName.setText(companyDetailBean.getName());
|
||||
if (TextUtils.isEmpty(companyDetailBean.getLegalPerson())) {
|
||||
if (TextUtils.isEmpty(companyDetailBean.getMaster())) {
|
||||
mTvP.setText("未录入");
|
||||
@ -163,6 +153,7 @@ public class HistoryDetialActivity extends BaseActivity {
|
||||
public void onNext(HistoryDetialBean beans) {
|
||||
if (beans != null) {
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
mTvName.setText(beans.getNameJoinByEnterpriseId());
|
||||
if (!TextUtils.isEmpty(beans.getSummary())) {
|
||||
mRlDesc.setVisibility(View.VISIBLE);
|
||||
mTvContent.setContent(beans.getSummary());
|
||||
@ -198,7 +189,7 @@ public class HistoryDetialActivity extends BaseActivity {
|
||||
// buildDetailListDataSingle(beans.getCheckItems());
|
||||
buildDetailListData(beans.getCheckItems());
|
||||
} else {
|
||||
ToastUtils.showErrorShort("本次检查不存在合格项");
|
||||
ToastUtils.showShort("本次检查不存在合格项");
|
||||
mRlvCataLog.setVisibility(View.GONE);
|
||||
}
|
||||
} else {
|
||||
|
@ -195,20 +195,20 @@ public class HistoryListActivity extends BaseActivity {
|
||||
}
|
||||
|
||||
private void showDetail(CounterCheckListBean.RowsBean rowsBean) {
|
||||
// if (rowsBean.getIsCoordination() == 0) {
|
||||
// //不配合
|
||||
// ToastUtils.showShort("该企业不配合检查,已由上级单位处理");
|
||||
// } else {
|
||||
//
|
||||
// }
|
||||
Intent intent = new Intent(mActivity, HistoryDetialActivity.class);
|
||||
intent.putExtra("id", rowsBean.getEnterpriseIndustry());
|
||||
intent.putExtra("enterpriseId", rowsBean.getEnterpriseId());
|
||||
intent.putExtra("cId", rowsBean.getCheckId());
|
||||
intent.putExtra("name", rowsBean.getEnterpriseName());
|
||||
intent.putExtra("peo", rowsBean.getEnterpriseMaster());
|
||||
intent.putExtra("phone", rowsBean.getEnterprisePhone());
|
||||
startActivity(intent);
|
||||
if (rowsBean.getIsCoordination() == 0) {
|
||||
//不配合
|
||||
ToastUtils.showShort("该企业不配合检查,已由上级单位处理");
|
||||
} else {
|
||||
Intent intent = new Intent(mActivity, HistoryDetialActivity.class);
|
||||
intent.putExtra("id", rowsBean.getIndustryJoinByEnterpriseId());
|
||||
intent.putExtra("enterpriseId", rowsBean.getEnterpriseId());
|
||||
intent.putExtra("cId", rowsBean.getCheckId());
|
||||
intent.putExtra("name", rowsBean.getNameJoinByEnterpriseId());
|
||||
intent.putExtra("peo", rowsBean.getMasterJoinByEnterpriseId());
|
||||
intent.putExtra("phone", rowsBean.getPhoneJoinByEnterpriseId());
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -276,7 +276,7 @@ public class HistoryListActivity extends BaseActivity {
|
||||
if (mTypeList == null) {
|
||||
getDicList(PathConfig.DIC_COMPANY_TYPE_ID, 1);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("暂无数据");
|
||||
ToastUtils.showShort("暂无数据");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -311,7 +311,7 @@ public class HistoryListActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showErrorShort("获取数据失败,请稍后重试");
|
||||
ToastUtils.showShort("获取数据失败,请稍后重试");
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
|
||||
@ -330,7 +330,7 @@ public class HistoryListActivity extends BaseActivity {
|
||||
mSearchCompanyName = mEtCompanyName.getText().toString().trim();
|
||||
//判断搜索那个有值
|
||||
if (TextUtils.isEmpty(mSearchCompanyName) && TextUtils.isEmpty(mCompanyType)) {
|
||||
ToastUtils.showErrorShort("请输入企业名称或选择企业类型");
|
||||
ToastUtils.showShort("请输入企业名称或选择企业类型");
|
||||
} else {
|
||||
mCurrentPage = 1;
|
||||
if (!TextUtils.isEmpty(mSearchCompanyName) && !TextUtils.isEmpty(mCompanyType)) {
|
||||
@ -406,7 +406,7 @@ public class HistoryListActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showErrorShort("数据加载失,请稍后重试");
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -473,7 +473,7 @@ public class HistoryListActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showErrorShort("数据加载失,请稍后重试");
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -540,7 +540,7 @@ public class HistoryListActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showErrorShort("数据加载失,请稍后重试");
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -616,7 +616,7 @@ public class HistoryListActivity extends BaseActivity {
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
reStateView(STATE_LOAD_ERROR);
|
||||
ToastUtils.showErrorShort("数据加载失,请稍后重试");
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -634,7 +634,7 @@ public class HistoryListActivity extends BaseActivity {
|
||||
mSearchCompanyName = mEtCompanyName.getText().toString().trim();
|
||||
//判断搜索那个有值
|
||||
if (TextUtils.isEmpty(mSearchCompanyName) && TextUtils.isEmpty(mCompanyType)) {
|
||||
ToastUtils.showErrorShort("请输入企业名称或选择企业类型");
|
||||
ToastUtils.showShort("请输入企业名称或选择企业类型");
|
||||
} else {
|
||||
mCurrentPage = 1;
|
||||
if (!TextUtils.isEmpty(mSearchCompanyName) && !TextUtils.isEmpty(mCompanyType)) {
|
||||
@ -710,7 +710,7 @@ public class HistoryListActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showErrorShort("数据加载失,请稍后重试");
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -777,7 +777,7 @@ public class HistoryListActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showErrorShort("数据加载失,请稍后重试");
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -844,7 +844,7 @@ public class HistoryListActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showErrorShort("数据加载失,请稍后重试");
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -920,7 +920,7 @@ public class HistoryListActivity extends BaseActivity {
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
reStateView(STATE_LOAD_ERROR);
|
||||
ToastUtils.showErrorShort("数据加载失,请稍后重试");
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -132,7 +132,7 @@ public class IssueCheckActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showErrorShort("数据加载失败,请稍后重试.");
|
||||
ToastUtils.showShort("数据加载失败,请稍后重试.");
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
}
|
||||
|
||||
|
@ -140,7 +140,7 @@ public class IssueMineDisActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showErrorShort("数据加载失败,请稍后重试");
|
||||
ToastUtils.showShort("数据加载失败,请稍后重试");
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,7 @@ public class IssueStepActivity extends BaseActivity {
|
||||
refreshView(STATE_LOAD_LOADING);
|
||||
String caseId = getIntent().getStringExtra("caseId");
|
||||
if (TextUtils.isEmpty(caseId)) {
|
||||
ToastUtils.showErrorShort("数据有误");
|
||||
ToastUtils.showShort("数据有误");
|
||||
finish();
|
||||
} else {
|
||||
mStepAdapter = new IssueStepAdapter(mActivity, mDatas);
|
||||
|
@ -124,7 +124,7 @@ public class MapActivity extends BaseActivity {
|
||||
if (mineCompanies != null && mineCompanies.size() > 0) {
|
||||
buildMarkData(mineCompanies);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("您暂无认领企业");
|
||||
ToastUtils.showShort("您暂无认领企业");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -127,7 +127,6 @@ public class NewCheckOptionsActivity extends BaseActivity {
|
||||
mTvBaseTitle.setText("企业检查");
|
||||
mTvPublish.setVisibility(View.VISIBLE);
|
||||
mTvPublish.setText("确定");
|
||||
LogUtils.e("企业检查");
|
||||
mTvPublish.setOnClickListener(v -> {
|
||||
// Gson gson= new Gson();
|
||||
// String s = gson.toJson(mAdapter.getData());
|
||||
@ -315,14 +314,14 @@ public class NewCheckOptionsActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.showErrorShort("检查成功");
|
||||
ToastUtils.showShort("检查成功");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showErrorShort("提交失败,请稍后重试.");
|
||||
ToastUtils.showShort("提交失败,请稍后重试.");
|
||||
dialog.dismiss();
|
||||
}
|
||||
|
||||
@ -416,7 +415,7 @@ public class NewCheckOptionsActivity extends BaseActivity {
|
||||
doSubmit(submitBean);
|
||||
} else {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showErrorShort("检查项中存在未检查的项目");
|
||||
ToastUtils.showShort("检查项中存在未检查的项目");
|
||||
}
|
||||
}
|
||||
|
||||
@ -459,14 +458,14 @@ public class NewCheckOptionsActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showErrorShort("检查成功");
|
||||
ToastUtils.showShort("检查成功");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showErrorShort("提交失败,请稍后重试.");
|
||||
ToastUtils.showShort("提交失败,请稍后重试.");
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
|
||||
@ -481,7 +480,7 @@ public class NewCheckOptionsActivity extends BaseActivity {
|
||||
refreshView(STATE_LOAD_LOADING);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getCheckOptionsList(UserLgUtils.getToken())
|
||||
.getCheckOptionsList(nId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<List<CheckOptionsbean>>() {
|
||||
@ -533,12 +532,12 @@ public class NewCheckOptionsActivity extends BaseActivity {
|
||||
bean.setCheck(false);
|
||||
beans.add(bean);
|
||||
}
|
||||
o.setType(checkOptionsbeans.get(i).getIsMustCheck());
|
||||
o.setType(checkOptionsbeans.get(i).getType());
|
||||
o.setChild(beans);
|
||||
o.setId(checkOptionsbeans.get(i).getCheckItemId());
|
||||
o.setTitle(checkOptionsbeans.get(i).getNameJoinByCheckItemId());
|
||||
o.setPhotos(mPhotos);
|
||||
o.setIsMust(checkOptionsbeans.get(i).getIsMustCheck());
|
||||
o.setIsMust(checkOptionsbeans.get(i).getType());
|
||||
mOptions.add(o);
|
||||
}
|
||||
mAdapter.setData(mOptions);
|
||||
@ -605,7 +604,6 @@ public class NewCheckOptionsActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
LogUtils.e(requestCode + "===" + resultCode);
|
||||
if (resultCode == RESULT_OK) {
|
||||
switch (requestCode) {
|
||||
case BaseUrlApi.CAMERA_REQUEST://相机
|
||||
@ -674,7 +672,7 @@ public class NewCheckOptionsActivity extends BaseActivity {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showSuccessShort("上传成功");
|
||||
ToastUtils.showShort("上传成功");
|
||||
if (mSelPhotosType == 1) {
|
||||
mCurrentBean.setId(baseUserBean.getData());
|
||||
mCurrentBean.setPath(picPath);
|
||||
@ -700,7 +698,7 @@ public class NewCheckOptionsActivity extends BaseActivity {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showErrorShort("上传失败,请稍后重试.");
|
||||
ToastUtils.showShort("上传失败,请稍后重试.");
|
||||
if (file.exists()) {
|
||||
file.delete();
|
||||
}
|
||||
@ -718,7 +716,7 @@ public class NewCheckOptionsActivity extends BaseActivity {
|
||||
if (progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showErrorShort("图片上传失败,请稍后重试");
|
||||
ToastUtils.showShort("图片上传失败,请稍后重试");
|
||||
}
|
||||
})
|
||||
.launch();
|
||||
|
@ -210,7 +210,7 @@ public class PublicAreaActivity extends BaseActivity {
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
stateView(STATE_LOAD_ERROR);
|
||||
ToastUtils.showErrorShort("数据加载失,请稍后重试");
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -227,7 +227,7 @@ public class PublicAreaActivity extends BaseActivity {
|
||||
mCurrentType = 2;
|
||||
getListByName(1);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("请输入搜索内容");
|
||||
ToastUtils.showShort("请输入搜索内容");
|
||||
}
|
||||
}
|
||||
|
||||
@ -285,7 +285,7 @@ public class PublicAreaActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showErrorShort("数据加载失,请稍后重试");
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -114,7 +114,7 @@ public class PublicCallBackActivity extends BaseActivity {
|
||||
refreshView(STATE_LOAD_LOADING);
|
||||
mId = getIntent().getStringExtra("id");
|
||||
if (TextUtils.isEmpty(mId)) {
|
||||
ToastUtils.showErrorShort("数据有误");
|
||||
ToastUtils.showShort("数据有误");
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
mTvPublish.setVisibility(View.GONE);
|
||||
} else {
|
||||
@ -340,7 +340,7 @@ public class PublicCallBackActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.showSuccessShort("复查成功");
|
||||
ToastUtils.showShort("复查成功");
|
||||
setResult(233);
|
||||
finish();
|
||||
}
|
||||
@ -348,7 +348,7 @@ public class PublicCallBackActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.showErrorShort("复查失败,请稍后重试");
|
||||
ToastUtils.showShort("复查失败,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -362,12 +362,12 @@ public class PublicCallBackActivity extends BaseActivity {
|
||||
private boolean checkParams() {
|
||||
String date = mTvReDate.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(date)) {
|
||||
ToastUtils.showErrorShort("请选择巡查时间");
|
||||
ToastUtils.showShort("请选择巡查时间");
|
||||
return false;
|
||||
}
|
||||
String content = mEtReContent.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(content)) {
|
||||
ToastUtils.showErrorShort("请输入隐患描述");
|
||||
ToastUtils.showShort("请输入隐患描述");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -444,7 +444,7 @@ public class PublicCallBackActivity extends BaseActivity {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showSuccessShort("上传成功");
|
||||
ToastUtils.showShort("上传成功");
|
||||
mCurrentBean.setId(baseUserBean.getData());
|
||||
mPhotoIds += baseUserBean.getData() + ",";
|
||||
mCurrentBean.setPath(picPath);
|
||||
@ -460,7 +460,7 @@ public class PublicCallBackActivity extends BaseActivity {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showErrorShort("上传失败,请稍后重试.");
|
||||
ToastUtils.showShort("上传失败,请稍后重试.");
|
||||
if (file.exists()) {
|
||||
file.delete();
|
||||
}
|
||||
@ -478,7 +478,7 @@ public class PublicCallBackActivity extends BaseActivity {
|
||||
if (progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showErrorShort("图片上传失败,请稍后重试");
|
||||
ToastUtils.showShort("图片上传失败,请稍后重试");
|
||||
}
|
||||
})
|
||||
.launch();
|
||||
|
@ -67,7 +67,7 @@ public class PublicDetailActivity extends BaseActivity {
|
||||
if (!TextUtils.isEmpty(id)) {
|
||||
getDetailData(id);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("详情ID为空");
|
||||
ToastUtils.showShort("详情ID为空");
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
}
|
||||
}
|
||||
|
@ -192,15 +192,17 @@ public class PublicReportActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
public void onNext(GirdPBean uBean) {
|
||||
if (UserLgUtils.getIndustryId() == 1) {
|
||||
if (!"grid".equals(uBean.getGridType()) || TextUtils.isEmpty(UserLgUtils.getIndustryId())) {
|
||||
//不是网格员
|
||||
ToastUtils.showShort("您不是网格员,无法上报.");
|
||||
refreshView(STATE_LOAD_EMPTY);
|
||||
} else {
|
||||
//网格员
|
||||
mTvArea2.setEnabled(false);
|
||||
// mTvArea3.setEnabled(false);
|
||||
// mTvArea4.setEnabled(false);
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
getDefaultArea1(uBean);
|
||||
} else {
|
||||
//不是网格员
|
||||
ToastUtils.showErrorShort("您不是网格员,无法上报.");
|
||||
refreshView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
@ -248,14 +250,14 @@ public class PublicReportActivity extends BaseActivity {
|
||||
}
|
||||
} else {
|
||||
progressDialog.dismiss();
|
||||
ToastUtils.showErrorShort("暂无地区数据");
|
||||
ToastUtils.showShort("暂无地区数据");
|
||||
refreshView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showErrorShort("获取数据失败,请稍后重试");
|
||||
ToastUtils.showShort("获取数据失败,请稍后重试");
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
@ -295,14 +297,14 @@ public class PublicReportActivity extends BaseActivity {
|
||||
}
|
||||
} else {
|
||||
progressDialog.dismiss();
|
||||
ToastUtils.showErrorShort("暂无地区数据");
|
||||
ToastUtils.showShort("暂无地区数据");
|
||||
refreshView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showErrorShort("获取数据失败,请稍后重试");
|
||||
ToastUtils.showShort("获取数据失败,请稍后重试");
|
||||
progressDialog.dismiss();
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
}
|
||||
@ -344,14 +346,14 @@ public class PublicReportActivity extends BaseActivity {
|
||||
}
|
||||
} else {
|
||||
progressDialog.dismiss();
|
||||
ToastUtils.showErrorShort("暂无地区数据");
|
||||
ToastUtils.showShort("暂无地区数据");
|
||||
refreshView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showErrorShort("获取数据失败,请稍后重试");
|
||||
ToastUtils.showShort("获取数据失败,请稍后重试");
|
||||
progressDialog.dismiss();
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
}
|
||||
@ -394,14 +396,14 @@ public class PublicReportActivity extends BaseActivity {
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
} else {
|
||||
progressDialog.dismiss();
|
||||
ToastUtils.showErrorShort("暂无地区数据");
|
||||
ToastUtils.showShort("暂无地区数据");
|
||||
refreshView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showErrorShort("获取数据失败,请稍后重试");
|
||||
ToastUtils.showShort("获取数据失败,请稍后重试");
|
||||
progressDialog.dismiss();
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
}
|
||||
@ -502,7 +504,7 @@ public class PublicReportActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.showSuccessShort("上报成功");
|
||||
ToastUtils.showShort("上报成功");
|
||||
setResult(233);
|
||||
finish();
|
||||
}
|
||||
@ -510,7 +512,7 @@ public class PublicReportActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.showErrorShort("上报失败,请稍后重试");
|
||||
ToastUtils.showShort("上报失败,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -524,17 +526,17 @@ public class PublicReportActivity extends BaseActivity {
|
||||
private boolean checkParams() {
|
||||
String location = mEtLocation.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(location)) {
|
||||
ToastUtils.showErrorShort("请输入巡查地点");
|
||||
ToastUtils.showShort("请输入巡查地点");
|
||||
return false;
|
||||
}
|
||||
String date = mTvSelDate.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(date)) {
|
||||
ToastUtils.showErrorShort("请选择巡查时间");
|
||||
ToastUtils.showShort("请选择巡查时间");
|
||||
return false;
|
||||
}
|
||||
String content = mEtPeoCount.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(content)) {
|
||||
ToastUtils.showErrorShort("请输入隐患描述");
|
||||
ToastUtils.showShort("请输入隐患描述");
|
||||
return false;
|
||||
}
|
||||
// if (TextUtils.isEmpty(mSelArea2Id)) {
|
||||
@ -618,7 +620,7 @@ public class PublicReportActivity extends BaseActivity {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showSuccessShort("上传成功");
|
||||
ToastUtils.showShort("上传成功");
|
||||
mCurrentBean.setId(baseUserBean.getData());
|
||||
mPhotoIds += baseUserBean.getData() + ",";
|
||||
mCurrentBean.setPath(picPath);
|
||||
@ -634,7 +636,7 @@ public class PublicReportActivity extends BaseActivity {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showErrorShort("上传失败,请稍后重试.");
|
||||
ToastUtils.showShort("上传失败,请稍后重试.");
|
||||
if (file.exists()) {
|
||||
file.delete();
|
||||
}
|
||||
@ -652,7 +654,7 @@ public class PublicReportActivity extends BaseActivity {
|
||||
if (progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showErrorShort("图片上传失败,请稍后重试");
|
||||
ToastUtils.showShort("图片上传失败,请稍后重试");
|
||||
}
|
||||
})
|
||||
.launch();
|
||||
@ -733,7 +735,7 @@ public class PublicReportActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showErrorShort("获取数据失败,请稍后重试");
|
||||
ToastUtils.showShort("获取数据失败,请稍后重试");
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
|
||||
@ -777,7 +779,7 @@ public class PublicReportActivity extends BaseActivity {
|
||||
if (mArea1List == null) {
|
||||
getDicList(PathConfig.DIC_AREA_ID, 1);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("暂无数据");
|
||||
ToastUtils.showShort("暂无数据");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -812,18 +814,18 @@ public class PublicReportActivity extends BaseActivity {
|
||||
if (mArea2List == null) {
|
||||
getDicList(mSelArea1Id, 2);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("暂无数据");
|
||||
ToastUtils.showShort("暂无数据");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ToastUtils.showErrorShort("请先选择省、自治区");
|
||||
ToastUtils.showShort("请先选择省、自治区");
|
||||
}
|
||||
}
|
||||
|
||||
private void onShowArea3Picker() {
|
||||
hideSoftKeyboard();
|
||||
if (TextUtils.isEmpty(mSelArea2Id)) {
|
||||
ToastUtils.showErrorShort("请先选择市");
|
||||
ToastUtils.showShort("请先选择市");
|
||||
} else {
|
||||
if (mArea3List != null && mArea3List.size() > 0) {
|
||||
mMArea3Picker = new OptionsPickerBuilder(PublicReportActivity.this, (options1, options2, options3, v) -> {
|
||||
@ -848,7 +850,7 @@ public class PublicReportActivity extends BaseActivity {
|
||||
if (mArea3List == null) {
|
||||
getDicList(mSelArea2Id, 3);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("暂无数据");
|
||||
ToastUtils.showShort("暂无数据");
|
||||
}
|
||||
|
||||
}
|
||||
@ -859,7 +861,7 @@ public class PublicReportActivity extends BaseActivity {
|
||||
private void onShowArea4Picker() {
|
||||
hideSoftKeyboard();
|
||||
if (TextUtils.isEmpty(mSelArea3Id)) {
|
||||
ToastUtils.showErrorShort("请先选择旗县区");
|
||||
ToastUtils.showShort("请先选择旗县区");
|
||||
} else {
|
||||
if (mArea4List != null && mArea4List.size() > 0) {
|
||||
mMArea4Picker = new OptionsPickerBuilder(PublicReportActivity.this, (options1, options2, options3, v) -> {
|
||||
@ -883,7 +885,7 @@ public class PublicReportActivity extends BaseActivity {
|
||||
if (mArea4List == null) {
|
||||
getDicList(mSelArea3Id, 4);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("暂无数据");
|
||||
ToastUtils.showShort("暂无数据");
|
||||
}
|
||||
|
||||
}
|
||||
@ -893,7 +895,7 @@ public class PublicReportActivity extends BaseActivity {
|
||||
private void onShowArea5Picker() {
|
||||
hideSoftKeyboard();
|
||||
if (TextUtils.isEmpty(mSelArea4Id)) {
|
||||
ToastUtils.showErrorShort("请先选择街道");
|
||||
ToastUtils.showShort("请先选择街道");
|
||||
} else {
|
||||
if (mArea5List != null && mArea5List.size() > 0) {
|
||||
mMArea5Picker = new OptionsPickerBuilder(PublicReportActivity.this, (options1, options2, options3, v) -> {
|
||||
@ -911,7 +913,7 @@ public class PublicReportActivity extends BaseActivity {
|
||||
if (mArea5List == null) {
|
||||
getDicList(mSelArea4Id, 5);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("暂无数据");
|
||||
ToastUtils.showShort("暂无数据");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,15 +21,6 @@ public class NewOptions {
|
||||
private int rectify = 4;//立即整改-4,限期整改-5 不配合-6
|
||||
private int isMust = 1;//1 必查 2选查
|
||||
private String inputContent;
|
||||
private String summary;
|
||||
|
||||
public String getSummary() {
|
||||
return summary;
|
||||
}
|
||||
|
||||
public void setSummary(String summary) {
|
||||
this.summary = summary;
|
||||
}
|
||||
|
||||
//整改期限
|
||||
// 当场整改
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -10,7 +10,6 @@ import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.sucstepsoft.cm_utils.core.GlobalProvider;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.utils.EncryptUtils;
|
||||
@ -21,6 +20,7 @@ import com.sucstepsoft.txrealtimelocation.R;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.ChangePwdBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.SuccessBean;
|
||||
import com.sucstepsoft.txrealtimelocation.net.LocationApiService;
|
||||
import com.sucstepsoft.txrealtimelocation.services.GlobalProvider;
|
||||
import com.sucstepsoft.txrealtimelocation.utils.ExceptionHandler;
|
||||
|
||||
import butterknife.BindView;
|
||||
@ -172,7 +172,7 @@ public class ChangePwdActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
ToastUtils.showSuccessShort("密码修改成功,请重新登录");
|
||||
ToastUtils.showShort("密码修改成功,请重新登录");
|
||||
UserLgUtils.setPassword("");
|
||||
GlobalProvider.save(mActivity, "isUpload", "12");
|
||||
GlobalProvider.save(mActivity, "token", "");
|
||||
@ -195,19 +195,19 @@ public class ChangePwdActivity extends BaseActivity {
|
||||
|
||||
private boolean checkInfo(String orgPwd, String newPwd, String cNewPwd) {
|
||||
if (TextUtils.isEmpty(orgPwd)) {
|
||||
ToastUtils.showErrorShort("原密码不能为空.");
|
||||
ToastUtils.showShort("原密码不能为空.");
|
||||
return false;
|
||||
}
|
||||
if (TextUtils.isEmpty(newPwd)) {
|
||||
ToastUtils.showErrorShort("新密码不能为空.");
|
||||
ToastUtils.showShort("新密码不能为空.");
|
||||
return false;
|
||||
}
|
||||
if (TextUtils.isEmpty(cNewPwd)) {
|
||||
ToastUtils.showErrorShort("新密码不能为空.");
|
||||
ToastUtils.showShort("新密码不能为空.");
|
||||
return false;
|
||||
}
|
||||
if (!cNewPwd.equals(newPwd)) {
|
||||
ToastUtils.showErrorShort("新密码不一致");
|
||||
ToastUtils.showShort("新密码不一致");
|
||||
return false;
|
||||
}
|
||||
// if (!RegexUtils.isMatch(RegexConstants.REGEX_ZH, newPwd)) {
|
||||
|
@ -137,7 +137,7 @@ public class LeaveActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onNext(SuccessBean s) {
|
||||
progressDialog.dismiss();
|
||||
ToastUtils.showSuccessShort("请假成功");
|
||||
ToastUtils.showShort("请假成功");
|
||||
finish();
|
||||
}
|
||||
|
||||
@ -160,20 +160,20 @@ public class LeaveActivity extends BaseActivity {
|
||||
|
||||
private boolean checkParams() {
|
||||
if (TextUtils.isEmpty(mType)) {
|
||||
ToastUtils.showErrorShort("请选择请假类型");
|
||||
ToastUtils.showShort("请选择请假类型");
|
||||
return false;
|
||||
}
|
||||
if (TextUtils.isEmpty(mStartTime)) {
|
||||
ToastUtils.showErrorShort("请选择开始时间");
|
||||
ToastUtils.showShort("请选择开始时间");
|
||||
return false;
|
||||
}
|
||||
if (TextUtils.isEmpty(mEndTime)) {
|
||||
ToastUtils.showErrorShort("请选择结束时间");
|
||||
ToastUtils.showShort("请选择结束时间");
|
||||
return false;
|
||||
}
|
||||
String trim = mEtLeCause.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(trim)) {
|
||||
ToastUtils.showErrorShort("请输入请假事由");
|
||||
ToastUtils.showShort("请输入请假事由");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -195,7 +195,7 @@ public class LeaveActivity extends BaseActivity {
|
||||
|
||||
private void showEndPicker() {
|
||||
if (TextUtils.isEmpty(mStartTime)) {
|
||||
ToastUtils.showErrorShort("请选择开始时间");
|
||||
ToastUtils.showShort("请选择开始时间");
|
||||
} else {
|
||||
List<String> yearDate = TimeUtils.getYearDate();
|
||||
List<List<String>> ampm = new ArrayList<>();
|
||||
@ -233,12 +233,12 @@ public class LeaveActivity extends BaseActivity {
|
||||
}
|
||||
} else if (timeSpan == 3) {
|
||||
if (startTimeAmOrPm == 123) {
|
||||
ToastUtils.showErrorShort("请假时长不能超过3天");
|
||||
ToastUtils.showShort("请假时长不能超过3天");
|
||||
} else {
|
||||
mEndTime = yearDate.get(options1);
|
||||
String am = ampm.get(options1).get(options2);
|
||||
if (am.equals("下午")) {
|
||||
ToastUtils.showErrorShort("请假时长不能超过3天");
|
||||
ToastUtils.showShort("请假时长不能超过3天");
|
||||
} else {
|
||||
switch (am) {
|
||||
case "上午":
|
||||
@ -261,10 +261,10 @@ public class LeaveActivity extends BaseActivity {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ToastUtils.showErrorShort("请假时长不能超过3天");
|
||||
ToastUtils.showShort("请假时长不能超过3天");
|
||||
}
|
||||
} else if (timeSpan < 0) {
|
||||
ToastUtils.showErrorShort("结束时间应该大于开始时间");
|
||||
ToastUtils.showShort("结束时间应该大于开始时间");
|
||||
} else {
|
||||
mEndTime = yearDate.get(options1);
|
||||
//同一天
|
||||
@ -279,7 +279,7 @@ public class LeaveActivity extends BaseActivity {
|
||||
break;
|
||||
}
|
||||
if (endTime < startTimeAmOrPm) {
|
||||
ToastUtils.showErrorShort("结束时间不能小于开始时间");
|
||||
ToastUtils.showShort("结束时间不能小于开始时间");
|
||||
} else if (endTime == startTimeAmOrPm) {
|
||||
//选择的相同的
|
||||
mTvLeEndContent.setText(mEndTime + am);
|
||||
@ -299,7 +299,7 @@ public class LeaveActivity extends BaseActivity {
|
||||
mTypePicker.setPicker(yearDate, ampm);
|
||||
mTypePicker.show();
|
||||
} else {
|
||||
ToastUtils.showErrorShort("数据有误,请重试.");
|
||||
ToastUtils.showShort("数据有误,请重试.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -343,7 +343,7 @@ public class LeaveActivity extends BaseActivity {
|
||||
mTypePicker.setPicker(yearDate, ampm);
|
||||
mTypePicker.show();
|
||||
} else {
|
||||
ToastUtils.showErrorShort("数据有误,请重试.");
|
||||
ToastUtils.showShort("数据有误,请重试.");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ public class LeaveCheckListActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showErrorShort("数据加载失,请稍后重试");
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
}
|
||||
|
||||
|
@ -95,14 +95,14 @@ public class LeaveDetailActivity extends BaseActivity {
|
||||
refreshView(STATE_LOAD_LOADING);
|
||||
mType = getIntent().getStringExtra("type");
|
||||
if (TextUtils.isEmpty(mType)) {
|
||||
ToastUtils.showErrorShort("数据有误");
|
||||
ToastUtils.showShort("数据有误");
|
||||
finish();
|
||||
} else {
|
||||
LeaveListBean.RowsBean bean = (LeaveListBean.RowsBean) getIntent().getSerializableExtra("data");
|
||||
if (bean != null) {
|
||||
getDetailData(bean);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("数据有误");
|
||||
ToastUtils.showShort("数据有误");
|
||||
finish();
|
||||
}
|
||||
}
|
||||
@ -114,7 +114,7 @@ public class LeaveDetailActivity extends BaseActivity {
|
||||
private boolean checkParams() {
|
||||
String trim = mEtCase.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(trim)) {
|
||||
ToastUtils.showErrorShort("请输入审批内容");
|
||||
ToastUtils.showShort("请输入审批内容");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@ -145,7 +145,7 @@ public class LeaveDetailActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onNext(SuccessBean s) {
|
||||
progressDialog.dismiss();
|
||||
ToastUtils.showSuccessShort("审批成功");
|
||||
ToastUtils.showShort("审批成功");
|
||||
finish();
|
||||
}
|
||||
|
||||
|
@ -133,7 +133,7 @@ public class LeaveHistoryActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showErrorShort("数据加载失败,请稍后重试");
|
||||
ToastUtils.showShort("数据加载失败,请稍后重试");
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
}
|
||||
|
||||
|
@ -207,7 +207,7 @@ public class MineMissionActivity extends BaseActivity {
|
||||
if (mTypeList == null) {
|
||||
getDicList(PathConfig.DIC_COMPANY_TYPE_ID, 1);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("暂无数据");
|
||||
ToastUtils.showShort("暂无数据");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -242,7 +242,7 @@ public class MineMissionActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ToastUtils.showErrorShort("获取数据失败,请稍后重试");
|
||||
ToastUtils.showShort("获取数据失败,请稍后重试");
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
|
||||
@ -260,7 +260,7 @@ public class MineMissionActivity extends BaseActivity {
|
||||
mSearchCompanyName = mEtCompanyName.getText().toString().trim();
|
||||
//判断搜索那个有值
|
||||
if (TextUtils.isEmpty(mSearchCompanyName) && TextUtils.isEmpty(mCompanyType)) {
|
||||
ToastUtils.showErrorShort("请输入企业名称或选择企业类型");
|
||||
ToastUtils.showShort("请输入企业名称或选择企业类型");
|
||||
} else {
|
||||
mCurrentPage = 1;
|
||||
if (!TextUtils.isEmpty(mSearchCompanyName) && !TextUtils.isEmpty(mCompanyType)) {
|
||||
@ -335,7 +335,7 @@ public class MineMissionActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
mMProgressDialog.dismiss();
|
||||
ToastUtils.showErrorShort("数据加载失,请稍后重试");
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -412,7 +412,7 @@ public class MineMissionActivity extends BaseActivity {
|
||||
mMProgressDialog.dismiss();
|
||||
}
|
||||
reStateView(STATE_LOAD_ERROR);
|
||||
ToastUtils.showErrorShort("数据加载失,请稍后重试");
|
||||
ToastUtils.showShort("数据加载失,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,70 +0,0 @@
|
||||
package com.sucstepsoft.txrealtimelocation.activitys.mine;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.sucstepsoft.cm_utils.core.beans.MessageBean;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.utils.TimeUtils;
|
||||
import com.sucstepsoft.txrealtimelocation.R;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.trouble.RandomMissionActivity;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
|
||||
/**
|
||||
* 消息详情
|
||||
*/
|
||||
public class MsgDetailActivity extends BaseActivity {
|
||||
@BindView(R.id.tv_title)
|
||||
TextView mTvTitle;
|
||||
@BindView(R.id.tv_time)
|
||||
TextView mTvTime;
|
||||
@BindView(R.id.tv_gator)
|
||||
TextView mTvGator;
|
||||
@BindView(R.id.tv_content)
|
||||
TextView mTvContent;
|
||||
|
||||
private Unbinder mBind;
|
||||
private MessageBean mBean;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_msg_detail;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
mBind = ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("消息详情");
|
||||
mBean = (MessageBean) getIntent().getSerializableExtra("bean");
|
||||
if (mBean != null) {
|
||||
setDataToView();
|
||||
}
|
||||
}
|
||||
|
||||
private void setDataToView() {
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
String time = TimeUtils.millis2Str(mBean.getTimestamp());
|
||||
mTvTime.setText(time);
|
||||
mTvGator.setText("系统消息");
|
||||
String body = mBean.getBody();
|
||||
JSONObject obj = null;
|
||||
try {
|
||||
obj = new JSONObject(body);
|
||||
String msg = obj.getString("msg");
|
||||
String title = obj.getString("title");
|
||||
mTvContent.setText(msg);
|
||||
mTvTitle.setText(title);
|
||||
mTvContent.setOnClickListener(v -> startActivity(new Intent(MsgDetailActivity.this,
|
||||
RandomMissionActivity.class)));
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,64 +0,0 @@
|
||||
package com.sucstepsoft.txrealtimelocation.activitys.mine;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.sucstepsoft.cm_utils.core.GlobalProvider;
|
||||
import com.sucstepsoft.cm_utils.core.beans.MessageBean;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.R;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.MsgListAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
|
||||
/**
|
||||
* 消息列表
|
||||
*/
|
||||
public class MsgListActivity extends BaseActivity {
|
||||
|
||||
@BindView(R.id.rlv_msg)
|
||||
RecyclerView mRlvMsg;
|
||||
private Unbinder mBind;
|
||||
private List<MessageBean> mData = new ArrayList<>();
|
||||
private MsgListAdapter mAdapter;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_msg_list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
mBind = ButterKnife.bind(this);
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
mTvBaseTitle.setText("通知消息");
|
||||
mAdapter = new MsgListAdapter(this, mData);
|
||||
mRlvMsg.setLayoutManager(new LinearLayoutManager(this));
|
||||
mRlvMsg.setAdapter(mAdapter);
|
||||
String socketMsg = GlobalProvider.getString(this, "socketMsg");
|
||||
if (TextUtils.isEmpty(socketMsg)) {
|
||||
refreshView(STATE_LOAD_EMPTY);
|
||||
} else {
|
||||
Gson gson = new Gson();
|
||||
List<MessageBean> beans = gson.fromJson(socketMsg, new TypeToken<List<MessageBean>>() {
|
||||
}.getType());
|
||||
mData = beans;
|
||||
mAdapter.setData(mData);
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
}
|
||||
mAdapter.addOnItemClickListener(messageBean -> {
|
||||
Intent intent = new Intent(MsgListActivity.this, MsgDetailActivity.class);
|
||||
intent.putExtra("bean", messageBean);
|
||||
startActivity(intent);
|
||||
});
|
||||
}
|
||||
}
|
@ -1,11 +1,9 @@
|
||||
package com.sucstepsoft.txrealtimelocation.activitys.mine;
|
||||
|
||||
import android.widget.Button;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.utils.AppUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
|
||||
import com.sucstepsoft.txrealtimelocation.R;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.MineCountBean;
|
||||
@ -48,7 +46,6 @@ public class StatisticsActivity extends BaseActivity {
|
||||
getCount();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取数据统计
|
||||
*/
|
||||
|
@ -1,7 +1,10 @@
|
||||
package com.sucstepsoft.txrealtimelocation.activitys.mine;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
@ -9,8 +12,10 @@ import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.provider.MediaStore;
|
||||
import android.provider.Settings;
|
||||
import android.support.v4.app.ActivityCompat;
|
||||
import android.support.v4.content.FileProvider;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Base64;
|
||||
import android.view.Gravity;
|
||||
@ -27,7 +32,6 @@ import com.bumptech.glide.load.resource.bitmap.CircleCrop;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.google.gson.Gson;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
import com.sucstepsoft.cm_utils.core.GlobalProvider;
|
||||
import com.sucstepsoft.cm_utils.core.network.update.CheckUpdateUtils;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.BaseUrlApi;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
@ -35,6 +39,7 @@ import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.core.widget.views.ButtomDialogView;
|
||||
import com.sucstepsoft.cm_utils.utils.AppUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.EncryptUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.FileIOUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.FileUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.LogUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.ProiderUtil;
|
||||
@ -49,10 +54,13 @@ import com.sucstepsoft.txrealtimelocation.beans.LoginUser;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.SuccessBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.VersionBean;
|
||||
import com.sucstepsoft.txrealtimelocation.net.LocationApiService;
|
||||
import com.sucstepsoft.txrealtimelocation.services.GlobalProvider;
|
||||
import com.sucstepsoft.txrealtimelocation.utils.AesUtil;
|
||||
import com.sucstepsoft.txrealtimelocation.utils.ExceptionHandler;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.UUID;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
@ -100,8 +108,6 @@ public class UserActivity extends BaseActivity {
|
||||
RelativeLayout mRlLeaveCheck;
|
||||
@BindView(R.id.rl_data_center)
|
||||
RelativeLayout mRlDataCenter;
|
||||
@BindView(R.id.rl_msg)
|
||||
RelativeLayout mRlMsg;
|
||||
private String mPicPath;
|
||||
private Unbinder mBind;
|
||||
|
||||
@ -125,7 +131,6 @@ public class UserActivity extends BaseActivity {
|
||||
mRlLeave.setOnClickListener(v -> choosePage(3));
|
||||
mRlLeaveCheck.setOnClickListener(v -> choosePage(4));
|
||||
mRlDataCenter.setOnClickListener(v -> choosePage(5));
|
||||
mRlMsg.setOnClickListener(v -> choosePage(6));
|
||||
String dirSize = FileUtils.getDirSize(PathConfig.PROJECT_CATCH_PATH);
|
||||
mTvCacheNum.setText(dirSize);
|
||||
mTvVersionNum.setText("v " + AppUtils.getAppVersionName());
|
||||
@ -279,8 +284,7 @@ public class UserActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onSuccess(File file) {
|
||||
RequestBody requestFile = RequestBody.create(MediaType.parse("multipart/form-data"), file);
|
||||
MultipartBody.Part body = MultipartBody.Part.createFormData("image", file.getName(),
|
||||
requestFile);
|
||||
MultipartBody.Part body = MultipartBody.Part.createFormData("image", file.getName(), requestFile);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.uploadImage(body, UserLgUtils.getToken())
|
||||
@ -302,7 +306,7 @@ public class UserActivity extends BaseActivity {
|
||||
if (progressDialog != null && progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showErrorShort("头像修改失败,请稍后重试.");
|
||||
ToastUtils.showShort("头像修改失败,请稍后重试.");
|
||||
if (file.exists()) {
|
||||
file.delete();
|
||||
}
|
||||
@ -320,7 +324,7 @@ public class UserActivity extends BaseActivity {
|
||||
if (progressDialog.isShowing()) {
|
||||
progressDialog.dismiss();
|
||||
}
|
||||
ToastUtils.showErrorShort("头像修改失败,请稍后重试");
|
||||
ToastUtils.showShort("头像修改失败,请稍后重试");
|
||||
}
|
||||
})
|
||||
.launch();
|
||||
@ -371,12 +375,30 @@ public class UserActivity extends BaseActivity {
|
||||
});
|
||||
}
|
||||
|
||||
private String getDeviceId() {
|
||||
String filePath = PathConfig.IDENTITY_FILE;
|
||||
File file = new File(filePath);
|
||||
String uuid = "";
|
||||
if (!file.exists()) {
|
||||
try {
|
||||
boolean newFile = file.createNewFile();
|
||||
uuid = UUID.randomUUID().toString();
|
||||
FileIOUtils.writeFileFromString(file, uuid);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
uuid = FileIOUtils.readFile2String(file);
|
||||
}
|
||||
return uuid;
|
||||
}
|
||||
|
||||
/**
|
||||
* 登录
|
||||
*/
|
||||
private void doLoginApp(String name, String pwd, ProgressDialog dialog) {
|
||||
String md5Pwd = EncryptUtils.encryptMD5ToStringTimes(pwd, 3);
|
||||
String deviceId = AppUtils.getDeviceId(mActivity);
|
||||
String deviceId = getDeviceId();
|
||||
LoginUser info = new LoginUser();
|
||||
info.setAppVersion(AppUtils.getAppVersionCode());
|
||||
info.setAppId(PathConfig.APP_VERSION_ID);
|
||||
@ -403,8 +425,7 @@ public class UserActivity extends BaseActivity {
|
||||
if (!TextUtils.isEmpty(baseUserBean.getData())) {
|
||||
byte[] decode = Base64.decode(baseUserBean.getData(), Base64.DEFAULT);
|
||||
try {
|
||||
String loginUserInfo = AesUtil.aesCommonDecoder(PathConfig.SECRET, new String(decode,
|
||||
"UTF-8"));
|
||||
String loginUserInfo = AesUtil.aesCommonDecoder(PathConfig.SECRET, new String(decode, "UTF-8"));
|
||||
LogUtils.e(loginUserInfo);
|
||||
if (!TextUtils.isEmpty(loginUserInfo)) {
|
||||
AppTokenUser appTokenUser = gson.fromJson(loginUserInfo, AppTokenUser.class);
|
||||
@ -424,16 +445,16 @@ public class UserActivity extends BaseActivity {
|
||||
.error(R.drawable.ic_user_default)
|
||||
.placeholder(R.drawable.ic_user_default))
|
||||
.into(mIvUserIcon);
|
||||
ToastUtils.showSuccessShort("头像修改成功.");
|
||||
ToastUtils.showShort("头像修改成功.");
|
||||
} else {
|
||||
ToastUtils.showErrorShort("头像修改失败,请稍后重试.");
|
||||
ToastUtils.showShort("头像修改失败,请稍后重试.");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
ToastUtils.showErrorShort("头像修改失败,请稍后重试.");
|
||||
ToastUtils.showShort("头像修改失败,请稍后重试.");
|
||||
}
|
||||
} else {
|
||||
ToastUtils.showErrorShort("头像修改失败,请稍后重试.");
|
||||
ToastUtils.showShort("头像修改失败,请稍后重试.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -462,7 +483,7 @@ public class UserActivity extends BaseActivity {
|
||||
dialog.dismiss();
|
||||
boolean b = FileUtils.deleteFilesInDir(PathConfig.CATCH_PATH);
|
||||
if (b) {
|
||||
ToastUtils.showSuccessShort("清除成功");
|
||||
ToastUtils.showShort("清除成功");
|
||||
mTvCacheNum.setText("0.00MB");
|
||||
}
|
||||
})
|
||||
@ -512,10 +533,10 @@ public class UserActivity extends BaseActivity {
|
||||
BaseUrlApi.APP_DOWNLOAD_URL,
|
||||
"2", "发现新版本.");
|
||||
} else {
|
||||
ToastUtils.showSuccessShort("已经是最新版本.");
|
||||
ToastUtils.showShort("已经是最新版本.");
|
||||
}
|
||||
} else {
|
||||
ToastUtils.showSuccessShort("已经是最新版本.");
|
||||
ToastUtils.showShort("已经是最新版本.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -539,9 +560,6 @@ public class UserActivity extends BaseActivity {
|
||||
// Intent intent = new Intent();
|
||||
// intent.setAction(PathConfig.ACTION_STOP_LOCATION);
|
||||
// sendBroadcast(intent);
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(PathConfig.ACTION_PUSH_STOP_SOCKET);
|
||||
sendBroadcast(intent);
|
||||
UserLgUtils.setPassword("");
|
||||
UserLgUtils.setCheckRemember(false);
|
||||
reStartApp();
|
||||
@ -570,9 +588,6 @@ public class UserActivity extends BaseActivity {
|
||||
case 5:
|
||||
startActivity(new Intent(UserActivity.this, StatisticsActivity.class));
|
||||
break;
|
||||
case 6:
|
||||
startActivity(new Intent(UserActivity.this, MsgListActivity.class));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -175,7 +175,7 @@ public class UserInfoActivity extends BaseActivity {
|
||||
getUserInfo(dialog, baseSuccessBean.getData());
|
||||
} else {
|
||||
dialog.dismiss();
|
||||
ToastUtils.showErrorShort("更新失败,请稍后重试");
|
||||
ToastUtils.showShort("更新失败,请稍后重试");
|
||||
}
|
||||
}
|
||||
|
||||
@ -225,14 +225,14 @@ public class UserInfoActivity extends BaseActivity {
|
||||
setResult(20);
|
||||
finish();
|
||||
} else {
|
||||
ToastUtils.showErrorShort("更新失败,请稍后重试");
|
||||
ToastUtils.showShort("更新失败,请稍后重试");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.showErrorShort("更新失败,请稍后重试");
|
||||
ToastUtils.showShort("更新失败,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -456,8 +456,6 @@ public class UserInfoActivity extends BaseActivity {
|
||||
}
|
||||
if (mAllDictionary.size() == tempList.size()) {
|
||||
buildViews(userInfoFieldBeans);
|
||||
} else {
|
||||
refreshView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@ -959,10 +957,10 @@ public class UserInfoActivity extends BaseActivity {
|
||||
mTextViewPicker.setPicker(list1);
|
||||
mTextViewPicker.show();
|
||||
} else {
|
||||
ToastUtils.showErrorShort("暂无数据");
|
||||
ToastUtils.showShort("暂无数据");
|
||||
}
|
||||
} else {
|
||||
ToastUtils.showErrorShort("暂无数据");
|
||||
ToastUtils.showShort("暂无数据");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -154,7 +154,7 @@ public class NoticeActivity extends BaseActivity {
|
||||
mRlvNotices.loadMoreComplete();
|
||||
}
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
ToastUtils.showErrorShort("数据加载失败,请稍后重试");
|
||||
ToastUtils.showShort("数据加载失败,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -66,7 +66,7 @@ public class NoticeDetailActivity extends BaseActivity {
|
||||
if (!TextUtils.isEmpty(id)) {
|
||||
setDataToView(id);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("数据有误");
|
||||
ToastUtils.showShort("数据有误");
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ public class PlanActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
pDialog.dismiss();
|
||||
ToastUtils.showSuccessShort("上报成功");
|
||||
ToastUtils.showShort("上报成功");
|
||||
setResult(233);
|
||||
finish();
|
||||
}
|
||||
@ -108,7 +108,7 @@ public class PlanActivity extends BaseActivity {
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
pDialog.dismiss();
|
||||
ToastUtils.showErrorShort("上报失败,请稍后重试");
|
||||
ToastUtils.showShort("上报失败,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -126,11 +126,11 @@ public class PlanActivity extends BaseActivity {
|
||||
private boolean checkParams() {
|
||||
String count = mEtCount.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(count)) {
|
||||
ToastUtils.showErrorShort("请输入计划数量");
|
||||
ToastUtils.showShort("请输入计划数量");
|
||||
return false;
|
||||
}
|
||||
if (TextUtils.isEmpty(mSelMonth)) {
|
||||
ToastUtils.showErrorShort("请选择计划月份");
|
||||
ToastUtils.showShort("请选择计划月份");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
@ -207,7 +207,7 @@ public class PlanHistoryActivity extends BaseActivity {
|
||||
//无数据
|
||||
mRlvItems.refreshComplete();
|
||||
mRlvItems.setNoMore(true);
|
||||
ToastUtils.showErrorShort("暂无数据");
|
||||
ToastUtils.showShort("暂无数据");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -219,7 +219,7 @@ public class PlanHistoryActivity extends BaseActivity {
|
||||
mRlvItems.refreshComplete();
|
||||
mRlvItems.loadMoreComplete();
|
||||
}
|
||||
ToastUtils.showErrorShort("数据加载失败,请稍后重试");
|
||||
ToastUtils.showShort("数据加载失败,请稍后重试");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1,856 +0,0 @@
|
||||
package com.sucstepsoft.txrealtimelocation.activitys.trouble;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.text.TextUtils;
|
||||
import android.view.TextureView;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.core.widget.views.ButtomInputView;
|
||||
import com.sucstepsoft.cm_utils.core.widget.views.CenterInputSelView;
|
||||
import com.sucstepsoft.cm_utils.utils.LogUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.ToastUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.UIUtil;
|
||||
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
|
||||
import com.sucstepsoft.txrealtimelocation.R;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.HistoryItemDetailAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.HistoryLeftCatalogAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CaseCompleteBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CaseDetailBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CompanyDetailBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.HistoryCatalogBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.HistoryDetialBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.SuccessBean;
|
||||
import com.sucstepsoft.txrealtimelocation.net.LocationApiService;
|
||||
import com.sucstepsoft.txrealtimelocation.utils.ExceptionHandler;
|
||||
import com.sucstepsoft.txrealtimelocation.widget.StretchyTextView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
public class CaseCheckOptionsActivity extends BaseActivity {
|
||||
public static final String GRID_GRID = "grid";//网格员
|
||||
public static final String GRID_STREET = "street";//乡镇街道管理员
|
||||
public static final String GRID_DISTRICT = "district";//旗县区管理员
|
||||
public static final String GRID_DISTRICT_DEPARTMENT = "districtDepartment";//旗县区委办局管理员
|
||||
public static final String GRID_CITY = "city";//市管理员
|
||||
|
||||
|
||||
@BindView(R.id.rlv_detail)
|
||||
RecyclerView mRlvDetail;
|
||||
@BindView(R.id.rlv_catalog)
|
||||
RecyclerView mRlvCataLog;
|
||||
@BindView(R.id.tv_name)
|
||||
TextView mTvName;
|
||||
@BindView(R.id.tv_peo)
|
||||
TextView mTvP;
|
||||
@BindView(R.id.tv_phone)
|
||||
TextView mTvPhone;
|
||||
@BindView(R.id.tv_content)
|
||||
StretchyTextView mTvContent;
|
||||
@BindView(R.id.rl_desc)
|
||||
RelativeLayout mRlDesc;
|
||||
@BindView(R.id.btn_superior)
|
||||
Button mBtnSuperior;
|
||||
@BindView(R.id.btn_complete)
|
||||
Button mBtnComplete;
|
||||
@BindView(R.id.btn_go_back)
|
||||
Button mBtnGoBack;
|
||||
private Unbinder mBind;
|
||||
private List<HistoryCatalogBean.ItemBean> mRightDatas = new ArrayList<>();
|
||||
private Disposable mDis;
|
||||
private List<HistoryCatalogBean> mCatalogBeans;
|
||||
private HistoryLeftCatalogAdapter mLeftCatalogAdapter;
|
||||
private HistoryItemDetailAdapter mRightAdapter;
|
||||
private String mCId;
|
||||
private String mPersonType;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_case_check_options;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
mBind = ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("详情");
|
||||
refreshView(STATE_LOAD_LOADING);
|
||||
mCId = getIntent().getStringExtra("checkId");
|
||||
String enterpriseId = getIntent().getStringExtra("enId");
|
||||
mTvPublish.setVisibility(View.VISIBLE);
|
||||
mTvPublish.setText("日志");
|
||||
mTvPublish.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(mActivity, CaseLogActivity.class);
|
||||
intent.putExtra("cId", mCId);
|
||||
startActivity(intent);
|
||||
});
|
||||
//让整改描述可以滑动
|
||||
mTvContent.setMaxLineCount(3);
|
||||
getDetail(mCId);
|
||||
mCatalogBeans = new ArrayList<>();
|
||||
if (!TextUtils.isEmpty(enterpriseId)) {
|
||||
getCompanyDetail(enterpriseId);
|
||||
}
|
||||
LinearLayoutManager leftManager = new LinearLayoutManager(mActivity, LinearLayoutManager.VERTICAL, false);
|
||||
LinearLayoutManager rightManager = new LinearLayoutManager(mActivity, LinearLayoutManager.VERTICAL, false);
|
||||
|
||||
|
||||
mLeftCatalogAdapter = new HistoryLeftCatalogAdapter(mActivity, mCatalogBeans);
|
||||
mRightAdapter = new HistoryItemDetailAdapter(mActivity, mRightDatas);
|
||||
|
||||
mRlvDetail.setLayoutManager(rightManager);
|
||||
mRlvCataLog.setLayoutManager(leftManager);
|
||||
|
||||
|
||||
mRlvDetail.setAdapter(mRightAdapter);
|
||||
mRlvCataLog.setAdapter(mLeftCatalogAdapter);
|
||||
mLeftCatalogAdapter.addNotifyChildChangeListener(child -> {
|
||||
if (child != null && child.size() > 0) {
|
||||
mRightDatas = child;
|
||||
mRightAdapter.setData(mRightDatas);
|
||||
} else {
|
||||
LogUtils.e("暂无数据");
|
||||
}
|
||||
});
|
||||
mPersonType = UserLgUtils.getPersonType();
|
||||
switch (mPersonType) {
|
||||
case GRID_STREET://街道
|
||||
mBtnComplete.setVisibility(View.VISIBLE);
|
||||
mBtnSuperior.setVisibility(View.VISIBLE);
|
||||
mBtnGoBack.setVisibility(View.GONE);
|
||||
break;
|
||||
case GRID_DISTRICT://旗县区
|
||||
mBtnComplete.setVisibility(View.VISIBLE);
|
||||
mBtnSuperior.setVisibility(View.VISIBLE);
|
||||
mBtnGoBack.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
case GRID_DISTRICT_DEPARTMENT://旗县区委办局
|
||||
case GRID_CITY://市
|
||||
mBtnComplete.setVisibility(View.VISIBLE);
|
||||
mBtnSuperior.setVisibility(View.GONE);
|
||||
mBtnGoBack.setVisibility(View.VISIBLE);
|
||||
break;
|
||||
}
|
||||
//完成
|
||||
mBtnComplete.setOnClickListener(v -> showInputDialog("处理完成", 2));
|
||||
//上级
|
||||
mBtnSuperior.setOnClickListener(v -> {
|
||||
switch (mPersonType) {
|
||||
case GRID_STREET://街道
|
||||
showSelDialog();
|
||||
break;
|
||||
case GRID_DISTRICT://旗县区
|
||||
showInputDialog("上报领导", 3);
|
||||
break;
|
||||
}
|
||||
});
|
||||
//回退
|
||||
mBtnGoBack.setOnClickListener(v -> showInputDialog("任务回退", 1));
|
||||
}
|
||||
|
||||
private void getCompanyDetail(String companyId) {
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getCompanyDetail(companyId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<CompanyDetailBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(CompanyDetailBean companyDetailBean) {
|
||||
if (companyDetailBean != null) {
|
||||
if (TextUtils.isEmpty(companyDetailBean.getPhone())) {
|
||||
mTvPhone.setText("未录入");
|
||||
} else {
|
||||
mTvPhone.setText(companyDetailBean.getPhone());
|
||||
}
|
||||
mTvName.setText(companyDetailBean.getName());
|
||||
if (TextUtils.isEmpty(companyDetailBean.getLegalPerson())) {
|
||||
if (TextUtils.isEmpty(companyDetailBean.getMaster())) {
|
||||
mTvP.setText("未录入");
|
||||
} else {
|
||||
mTvP.setText(companyDetailBean.getMaster());
|
||||
}
|
||||
} else {
|
||||
mTvP.setText(companyDetailBean.getLegalPerson());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void getDetail(String cid) {
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getMineCaseDetailById(cid, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<CaseDetailBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
mDis = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(CaseDetailBean beans) {
|
||||
if (beans != null) {
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
getCompanyDetail(beans.getEnterpriseId());
|
||||
if (!TextUtils.isEmpty(beans.getSummary())) {
|
||||
mRlDesc.setVisibility(View.VISIBLE);
|
||||
mTvContent.setContent(beans.getSummary());
|
||||
} else {
|
||||
mRlDesc.setVisibility(View.GONE);
|
||||
}
|
||||
if (beans.getCheckItems() != null && beans.getCheckItems().size() > 0) {
|
||||
mRlvCataLog.setVisibility(View.VISIBLE);
|
||||
buildDetailListData(beans.getCheckItems());
|
||||
} else {
|
||||
ToastUtils.showErrorShort("本次检查不存在合格项");
|
||||
mRlvCataLog.setVisibility(View.GONE);
|
||||
}
|
||||
} else {
|
||||
refreshView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 带目录
|
||||
*
|
||||
* @param checkItems
|
||||
*/
|
||||
private void buildDetailListData(List<CaseDetailBean.CheckItemsBean> checkItems) {
|
||||
//遍历判断是否是目录
|
||||
for (int i = 0; i < checkItems.size(); i++) {
|
||||
if (checkItems.get(i).getCheckItemParentId().equals("0")) {
|
||||
HistoryCatalogBean bean = new HistoryCatalogBean();
|
||||
bean.setTitle(checkItems.get(i).getName());
|
||||
bean.setItemId(checkItems.get(i).getCheckItemId());
|
||||
bean.setpId(checkItems.get(i).getCheckItemParentId());
|
||||
bean.setIcon(checkItems.get(i).getIcon());
|
||||
bean.setSelIcon(checkItems.get(i).getIconPress());
|
||||
bean.setTypeByCheckItemId(checkItems.get(i).getType());
|
||||
mCatalogBeans.add(bean);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < mCatalogBeans.size(); i++) {
|
||||
HistoryCatalogBean cBean = mCatalogBeans.get(i);
|
||||
List<HistoryCatalogBean.ItemBean> items = new ArrayList<>();
|
||||
boolean isCheck = false;
|
||||
for (int j = 0; j < checkItems.size(); j++) {
|
||||
if (cBean.getItemId().equals(checkItems.get(j).getCheckItemParentId())) {
|
||||
HistoryCatalogBean.ItemBean itemBean = new HistoryCatalogBean.ItemBean();
|
||||
itemBean.setName(checkItems.get(j).getName());
|
||||
itemBean.setCheckItemId(checkItems.get(j).getCheckItemId());
|
||||
itemBean.setScenePhotos(checkItems.get(j).getScenePhotos());
|
||||
List<HistoryCatalogBean.ItemBeanChild> childs = new ArrayList<>();
|
||||
for (int k = 0; k < checkItems.get(j).getHiddenDangerReports().size(); k++) {
|
||||
HistoryCatalogBean.ItemBeanChild child = new HistoryCatalogBean.ItemBeanChild();
|
||||
CaseDetailBean.CheckItemsBean.HiddenDangerReportsBean hiddenDangerReportsBean = checkItems.get(j).getHiddenDangerReports().get(k);
|
||||
child.setScenePhotos(hiddenDangerReportsBean.getScenePhotos());
|
||||
child.setCheckResult(hiddenDangerReportsBean.getCheckResult());
|
||||
child.setUnitJoinByCheckItemId(hiddenDangerReportsBean.getUnitJoinByCheckItemId());
|
||||
child.setNameJoinByCheckItemId(hiddenDangerReportsBean.getNameJoinByCheckItemId());
|
||||
child.setCheckItemType(hiddenDangerReportsBean.getCheckItemType());
|
||||
child.setIsWrongJoinByCheckItemId(hiddenDangerReportsBean.getIsWrongJoinByCheckItemId());
|
||||
childs.add(child);
|
||||
}
|
||||
itemBean.setChild(childs);
|
||||
items.add(itemBean);
|
||||
} else if (cBean.getpId().equals("0") && cBean.getTypeByCheckItemId() == 2 && cBean.getItemId().equals(checkItems.get(j).getCheckItemId())) {
|
||||
HistoryCatalogBean.ItemBean itemBean = new HistoryCatalogBean.ItemBean();
|
||||
itemBean.setName(checkItems.get(j).getName());
|
||||
itemBean.setCheckItemId(checkItems.get(j).getCheckItemId());
|
||||
itemBean.setScenePhotos(checkItems.get(j).getScenePhotos());
|
||||
List<HistoryCatalogBean.ItemBeanChild> childs = new ArrayList<>();
|
||||
for (int k = 0; k < checkItems.get(j).getHiddenDangerReports().size(); k++) {
|
||||
HistoryCatalogBean.ItemBeanChild child = new HistoryCatalogBean.ItemBeanChild();
|
||||
CaseDetailBean.CheckItemsBean.HiddenDangerReportsBean hiddenDangerReportsBean = checkItems.get(j).getHiddenDangerReports().get(k);
|
||||
child.setScenePhotos(hiddenDangerReportsBean.getScenePhotos());
|
||||
child.setCheckResult(hiddenDangerReportsBean.getCheckResult());
|
||||
child.setUnitJoinByCheckItemId(hiddenDangerReportsBean.getUnitJoinByCheckItemId());
|
||||
child.setNameJoinByCheckItemId(hiddenDangerReportsBean.getNameJoinByCheckItemId());
|
||||
child.setIsWrongJoinByCheckItemId(hiddenDangerReportsBean.getIsWrongJoinByCheckItemId());
|
||||
child.setCheckItemType(hiddenDangerReportsBean.getCheckItemType());
|
||||
childs.add(child);
|
||||
}
|
||||
itemBean.setChild(childs);
|
||||
items.add(itemBean);
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
for (int j = 0; j < items.size(); j++) {
|
||||
HistoryCatalogBean.ItemBean itemBean = items.get(j);
|
||||
for (int k = 0; k < itemBean.getChild().size(); k++) {
|
||||
HistoryCatalogBean.ItemBeanChild child = itemBean.getChild().get(k);
|
||||
if (child.getIsWrongJoinByCheckItemId() == 1) {
|
||||
isCheck = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
cBean.setCheck(isCheck);
|
||||
cBean.setOptions(items);
|
||||
}
|
||||
mRightDatas = mCatalogBeans.get(0).getOptions();
|
||||
mRightAdapter.setData(mRightDatas);
|
||||
mLeftCatalogAdapter.setData(mCatalogBeans);
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示输入框dialog
|
||||
* 1 回退
|
||||
* 2 完成
|
||||
* 3 领导
|
||||
*/
|
||||
private void showInputDialog(String title, int type) {
|
||||
ButtomInputView inputView = new ButtomInputView.DialogBuilder(mActivity).build();
|
||||
inputView.addOnChoseListener(() -> {
|
||||
String desc = inputView.mEtText.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(desc)) {
|
||||
ToastUtils.showErrorShort("请输入描述");
|
||||
} else {
|
||||
inputView.dismiss();
|
||||
switch (mPersonType) {
|
||||
case GRID_STREET://街道
|
||||
doComplete(desc);
|
||||
break;
|
||||
case GRID_DISTRICT://旗县区
|
||||
if (type == 1) {
|
||||
doBackDistrict(desc);
|
||||
} else if (type == 2) {
|
||||
doCompleteDistrict(desc);
|
||||
} else if (type == 3) {
|
||||
doDistrictLeader(desc);
|
||||
}
|
||||
break;
|
||||
case GRID_DISTRICT_DEPARTMENT://旗县区委办局
|
||||
if (type == 1) {
|
||||
doBackDistrictDepartment(desc);
|
||||
} else if (type == 2) {
|
||||
doCompleteDistrictDepartment(desc);
|
||||
}
|
||||
break;
|
||||
case GRID_CITY://市
|
||||
if (type == 1) {
|
||||
doBackCity(desc);
|
||||
} else if (type == 2) {
|
||||
doCompleteCity(desc);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
inputView.show();
|
||||
inputView.setTitle(title);
|
||||
}
|
||||
|
||||
/**
|
||||
* 旗县区上报领导
|
||||
*/
|
||||
private void doDistrictLeader(String desc) {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "提交中...");
|
||||
dialog.show();
|
||||
CaseCompleteBean bea = new CaseCompleteBean();
|
||||
bea.setSummary(desc);
|
||||
Gson gson = new Gson();
|
||||
String obj = gson.toJson(bea);
|
||||
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.doDistrictCaseToLeader(body, mCId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
//发送已办
|
||||
sendSocketMsg();
|
||||
dialog.dismiss();
|
||||
ToastUtils.showSuccessShort("处理完成");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 旗县区完成
|
||||
*/
|
||||
private void doCompleteDistrict(String desc) {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "提交中...");
|
||||
dialog.show();
|
||||
CaseCompleteBean bea = new CaseCompleteBean();
|
||||
bea.setSummary(desc);
|
||||
Gson gson = new Gson();
|
||||
String obj = gson.toJson(bea);
|
||||
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.doDistrictCaseComplete(body, mCId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
//发送已办
|
||||
sendSocketMsg();
|
||||
dialog.dismiss();
|
||||
ToastUtils.showSuccessShort("处理完成");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 旗县区回退
|
||||
*/
|
||||
private void doBackDistrict(String desc) {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "提交中...");
|
||||
dialog.show();
|
||||
CaseCompleteBean bea = new CaseCompleteBean();
|
||||
bea.setSummary(desc);
|
||||
Gson gson = new Gson();
|
||||
String obj = gson.toJson(bea);
|
||||
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.doDistrictCaseBack(body, mCId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
//发送已办
|
||||
sendSocketMsg();
|
||||
dialog.dismiss();
|
||||
ToastUtils.showSuccessShort("处理完成");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示上级处理dialog
|
||||
*/
|
||||
private void showSelDialog() {
|
||||
CenterInputSelView selView = new CenterInputSelView.DialogBuilder(mActivity).build();
|
||||
|
||||
selView.addOnChoseListener(() -> {
|
||||
if (TextUtils.isEmpty(selView.mSelType)) {
|
||||
ToastUtils.showErrorShort("请选择处理领导");
|
||||
return;
|
||||
}
|
||||
//判断是否是旗县区领导
|
||||
if ("district".equals(selView.mSelType) && TextUtils.isEmpty(selView.mSelPersonId)) {
|
||||
ToastUtils.showErrorShort("请选择处理人员");
|
||||
return;
|
||||
}
|
||||
String desc = selView.mEtText.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(desc)) {
|
||||
ToastUtils.showErrorShort("请输入描述信息");
|
||||
return;
|
||||
}
|
||||
selView.dismiss();
|
||||
doSuperiorDispose(selView.mSelType, selView.mSelPersonId, desc);
|
||||
});
|
||||
selView.show();
|
||||
selView.setTitle("上级处理");
|
||||
}
|
||||
|
||||
/**
|
||||
* 街道上级处理
|
||||
*/
|
||||
private void doSuperiorDispose(String type, String pId, String desc) {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "提交中...");
|
||||
dialog.show();
|
||||
CaseCompleteBean bea = new CaseCompleteBean();
|
||||
bea.setSummary(desc);
|
||||
bea.setLeaderType(type);
|
||||
if ("district".equals(type)) {
|
||||
bea.setLeaderId(pId);
|
||||
}
|
||||
Gson gson = new Gson();
|
||||
String obj = gson.toJson(bea);
|
||||
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.doSuperiorCaseStreet(body, mCId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
//发送已办
|
||||
sendSocketMsg();
|
||||
dialog.dismiss();
|
||||
ToastUtils.showSuccessShort("处理完成");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 旗县区委办局回退
|
||||
*/
|
||||
private void doBackDistrictDepartment(String desc) {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "提交中...");
|
||||
dialog.show();
|
||||
CaseCompleteBean bea = new CaseCompleteBean();
|
||||
bea.setSummary(desc);
|
||||
Gson gson = new Gson();
|
||||
String obj = gson.toJson(bea);
|
||||
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.doDistrictDepartmentCaseBack(body, mCId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
//发送已办
|
||||
sendSocketMsg();
|
||||
dialog.dismiss();
|
||||
ToastUtils.showSuccessShort("处理完成");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 市回退
|
||||
*/
|
||||
private void doBackCity(String desc) {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "提交中...");
|
||||
dialog.show();
|
||||
CaseCompleteBean bea = new CaseCompleteBean();
|
||||
bea.setSummary(desc);
|
||||
Gson gson = new Gson();
|
||||
String obj = gson.toJson(bea);
|
||||
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.doCityCaseBack(body, mCId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
//发送已办
|
||||
sendSocketMsg();
|
||||
dialog.dismiss();
|
||||
ToastUtils.showSuccessShort("处理完成");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 市完成
|
||||
*/
|
||||
private void doCompleteCity(String desc) {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "提交中...");
|
||||
dialog.show();
|
||||
CaseCompleteBean bea = new CaseCompleteBean();
|
||||
bea.setSummary(desc);
|
||||
Gson gson = new Gson();
|
||||
String obj = gson.toJson(bea);
|
||||
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.doCityCaseComplete(body, mCId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
//发送已办
|
||||
sendSocketMsg();
|
||||
dialog.dismiss();
|
||||
ToastUtils.showSuccessShort("处理完成");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 旗县区委办局
|
||||
*/
|
||||
private void doCompleteDistrictDepartment(String desc) {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "提交中...");
|
||||
dialog.show();
|
||||
CaseCompleteBean bea = new CaseCompleteBean();
|
||||
bea.setSummary(desc);
|
||||
Gson gson = new Gson();
|
||||
String obj = gson.toJson(bea);
|
||||
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.doDistrictDepartmentCaseComplete(body, mCId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
//发送已办
|
||||
sendSocketMsg();
|
||||
dialog.dismiss();
|
||||
ToastUtils.showSuccessShort("处理完成");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 街道提交处理完成
|
||||
*
|
||||
* @param desc
|
||||
*/
|
||||
private void doComplete(String desc) {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "提交中...");
|
||||
dialog.show();
|
||||
CaseCompleteBean bea = new CaseCompleteBean();
|
||||
bea.setSummary(desc);
|
||||
Gson gson = new Gson();
|
||||
String obj = gson.toJson(bea);
|
||||
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.doCompleteCaseStreet(body, mCId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
sendSocketMsg();
|
||||
dialog.dismiss();
|
||||
ToastUtils.showSuccessShort("处理完成");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void sendSocketMsg() {
|
||||
//发送已办
|
||||
if (PathConfig.IS_OPEN_NOTICE) {
|
||||
Intent msgIntent = new Intent();
|
||||
msgIntent.setAction(PathConfig.ACTION_MSG_UPCOMING_BY_USER);
|
||||
msgIntent.putExtra("system", "inspection");
|
||||
msgIntent.putExtra("serviceId", "checkId:" + mCId);
|
||||
sendBroadcast(msgIntent);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (mDis != null && !mDis.isDisposed()) {
|
||||
mDis.dispose();
|
||||
}
|
||||
mBind.unbind();
|
||||
}
|
||||
}
|
@ -1,814 +0,0 @@
|
||||
package com.sucstepsoft.txrealtimelocation.activitys.trouble;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.core.widget.views.ButtomInputView;
|
||||
import com.sucstepsoft.cm_utils.core.widget.views.CenterInputSelView;
|
||||
import com.sucstepsoft.cm_utils.utils.LogUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.ToastUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.UIUtil;
|
||||
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
|
||||
import com.sucstepsoft.txrealtimelocation.R;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.HistoryItemDetailAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.HistoryLeftCatalogAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CaseCompleteBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CaseDetailBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CompanyDetailBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.HistoryCatalogBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.SuccessBean;
|
||||
import com.sucstepsoft.txrealtimelocation.net.LocationApiService;
|
||||
import com.sucstepsoft.txrealtimelocation.utils.ExceptionHandler;
|
||||
import com.sucstepsoft.txrealtimelocation.widget.StretchyTextView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import okhttp3.MediaType;
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
public class CaseCheckOptionsDetailActivity extends BaseActivity {
|
||||
public static final String GRID_GRID = "grid";//网格员
|
||||
public static final String GRID_STREET = "street";//乡镇街道管理员
|
||||
public static final String GRID_DISTRICT = "district";//旗县区管理员
|
||||
public static final String GRID_DISTRICT_DEPARTMENT = "districtDepartment";//旗县区委办局管理员
|
||||
public static final String GRID_CITY = "city";//市管理员
|
||||
|
||||
|
||||
@BindView(R.id.rlv_detail)
|
||||
RecyclerView mRlvDetail;
|
||||
@BindView(R.id.rlv_catalog)
|
||||
RecyclerView mRlvCataLog;
|
||||
@BindView(R.id.tv_name)
|
||||
TextView mTvName;
|
||||
@BindView(R.id.tv_peo)
|
||||
TextView mTvP;
|
||||
@BindView(R.id.tv_phone)
|
||||
TextView mTvPhone;
|
||||
private Unbinder mBind;
|
||||
private List<HistoryCatalogBean.ItemBean> mRightDatas = new ArrayList<>();
|
||||
private Disposable mDis;
|
||||
private List<HistoryCatalogBean> mCatalogBeans;
|
||||
private HistoryLeftCatalogAdapter mLeftCatalogAdapter;
|
||||
private HistoryItemDetailAdapter mRightAdapter;
|
||||
private String mCId;
|
||||
private String mPersonType;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_case_check_options_detail;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
mBind = ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("详情");
|
||||
refreshView(STATE_LOAD_LOADING);
|
||||
mCId = getIntent().getStringExtra("checkId");
|
||||
String enterpriseId = getIntent().getStringExtra("enId");
|
||||
mTvPublish.setVisibility(View.VISIBLE);
|
||||
mTvPublish.setText("日志");
|
||||
mTvPublish.setOnClickListener(v -> {
|
||||
Intent intent = new Intent(mActivity, CaseLogActivity.class);
|
||||
intent.putExtra("cId", mCId);
|
||||
startActivity(intent);
|
||||
});
|
||||
//让整改描述可以滑动
|
||||
// mTvContent.setMaxLineCount(3);
|
||||
getDetail(mCId);
|
||||
mCatalogBeans = new ArrayList<>();
|
||||
if (!TextUtils.isEmpty(enterpriseId)) {
|
||||
getCompanyDetail(enterpriseId);
|
||||
}
|
||||
LinearLayoutManager leftManager = new LinearLayoutManager(mActivity, LinearLayoutManager.VERTICAL, false);
|
||||
LinearLayoutManager rightManager = new LinearLayoutManager(mActivity, LinearLayoutManager.VERTICAL, false);
|
||||
|
||||
|
||||
mLeftCatalogAdapter = new HistoryLeftCatalogAdapter(mActivity, mCatalogBeans);
|
||||
mRightAdapter = new HistoryItemDetailAdapter(mActivity, mRightDatas);
|
||||
|
||||
mRlvDetail.setLayoutManager(rightManager);
|
||||
mRlvCataLog.setLayoutManager(leftManager);
|
||||
|
||||
|
||||
mRlvDetail.setAdapter(mRightAdapter);
|
||||
mRlvCataLog.setAdapter(mLeftCatalogAdapter);
|
||||
mLeftCatalogAdapter.addNotifyChildChangeListener(child -> {
|
||||
if (child != null && child.size() > 0) {
|
||||
mRightDatas = child;
|
||||
mRightAdapter.setData(mRightDatas);
|
||||
} else {
|
||||
LogUtils.e("暂无数据");
|
||||
}
|
||||
});
|
||||
mPersonType = UserLgUtils.getPersonType();
|
||||
// switch (mPersonType) {
|
||||
// case GRID_STREET://街道
|
||||
// mBtnComplete.setVisibility(View.VISIBLE);
|
||||
// mBtnSuperior.setVisibility(View.VISIBLE);
|
||||
// mBtnGoBack.setVisibility(View.GONE);
|
||||
// break;
|
||||
// case GRID_DISTRICT://旗县区
|
||||
// mBtnComplete.setVisibility(View.VISIBLE);
|
||||
// mBtnSuperior.setVisibility(View.VISIBLE);
|
||||
// mBtnGoBack.setVisibility(View.VISIBLE);
|
||||
// break;
|
||||
// case GRID_DISTRICT_DEPARTMENT://旗县区委办局
|
||||
// case GRID_CITY://市
|
||||
// mBtnComplete.setVisibility(View.VISIBLE);
|
||||
// mBtnSuperior.setVisibility(View.GONE);
|
||||
// mBtnGoBack.setVisibility(View.VISIBLE);
|
||||
// break;
|
||||
// }
|
||||
// //完成
|
||||
// mBtnComplete.setOnClickListener(v -> showInputDialog("处理完成", 2));
|
||||
// //上级
|
||||
// mBtnSuperior.setOnClickListener(v -> {
|
||||
// switch (mPersonType) {
|
||||
// case GRID_STREET://街道
|
||||
// showSelDialog();
|
||||
// break;
|
||||
// case GRID_DISTRICT://旗县区
|
||||
// showInputDialog("上报领导", 3);
|
||||
// break;
|
||||
// }
|
||||
// });
|
||||
// //回退
|
||||
// mBtnGoBack.setOnClickListener(v -> showInputDialog("任务回退", 1));
|
||||
}
|
||||
|
||||
private void getCompanyDetail(String companyId) {
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getCompanyDetail(companyId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<CompanyDetailBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(CompanyDetailBean companyDetailBean) {
|
||||
if (companyDetailBean != null) {
|
||||
if (TextUtils.isEmpty(companyDetailBean.getPhone())) {
|
||||
mTvPhone.setText("未录入");
|
||||
} else {
|
||||
mTvPhone.setText(companyDetailBean.getPhone());
|
||||
}
|
||||
mTvName.setText(companyDetailBean.getName());
|
||||
if (TextUtils.isEmpty(companyDetailBean.getLegalPerson())) {
|
||||
if (TextUtils.isEmpty(companyDetailBean.getMaster())) {
|
||||
mTvP.setText("未录入");
|
||||
} else {
|
||||
mTvP.setText(companyDetailBean.getMaster());
|
||||
}
|
||||
} else {
|
||||
mTvP.setText(companyDetailBean.getLegalPerson());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void getDetail(String cid) {
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getMineCaseDetailById(cid, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<CaseDetailBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
mDis = d;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(CaseDetailBean beans) {
|
||||
if (beans != null) {
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
getCompanyDetail(beans.getEnterpriseId());
|
||||
// if (!TextUtils.isEmpty(beans.getSummary())) {
|
||||
// mRlDesc.setVisibility(View.VISIBLE);
|
||||
//// mTvContent.setContent(beans.getSummary());
|
||||
// } else {
|
||||
// mRlDesc.setVisibility(View.GONE);
|
||||
// }
|
||||
if (beans.getCheckItems() != null && beans.getCheckItems().size() > 0) {
|
||||
mRlvCataLog.setVisibility(View.VISIBLE);
|
||||
buildDetailListData(beans.getCheckItems());
|
||||
} else {
|
||||
ToastUtils.showErrorShort("本次检查不存在合格项");
|
||||
mRlvCataLog.setVisibility(View.GONE);
|
||||
}
|
||||
} else {
|
||||
refreshView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 带目录
|
||||
*
|
||||
* @param checkItems
|
||||
*/
|
||||
private void buildDetailListData(List<CaseDetailBean.CheckItemsBean> checkItems) {
|
||||
//遍历判断是否是目录
|
||||
for (int i = 0; i < checkItems.size(); i++) {
|
||||
if (checkItems.get(i).getCheckItemParentId().equals("0")) {
|
||||
HistoryCatalogBean bean = new HistoryCatalogBean();
|
||||
bean.setTitle(checkItems.get(i).getName());
|
||||
bean.setItemId(checkItems.get(i).getCheckItemId());
|
||||
bean.setpId(checkItems.get(i).getCheckItemParentId());
|
||||
bean.setIcon(checkItems.get(i).getIcon());
|
||||
bean.setSelIcon(checkItems.get(i).getIconPress());
|
||||
bean.setTypeByCheckItemId(checkItems.get(i).getType());
|
||||
mCatalogBeans.add(bean);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < mCatalogBeans.size(); i++) {
|
||||
HistoryCatalogBean cBean = mCatalogBeans.get(i);
|
||||
List<HistoryCatalogBean.ItemBean> items = new ArrayList<>();
|
||||
boolean isCheck = false;
|
||||
for (int j = 0; j < checkItems.size(); j++) {
|
||||
if (cBean.getItemId().equals(checkItems.get(j).getCheckItemParentId())) {
|
||||
HistoryCatalogBean.ItemBean itemBean = new HistoryCatalogBean.ItemBean();
|
||||
itemBean.setName(checkItems.get(j).getName());
|
||||
itemBean.setCheckItemId(checkItems.get(j).getCheckItemId());
|
||||
itemBean.setScenePhotos(checkItems.get(j).getScenePhotos());
|
||||
List<HistoryCatalogBean.ItemBeanChild> childs = new ArrayList<>();
|
||||
for (int k = 0; k < checkItems.get(j).getHiddenDangerReports().size(); k++) {
|
||||
HistoryCatalogBean.ItemBeanChild child = new HistoryCatalogBean.ItemBeanChild();
|
||||
CaseDetailBean.CheckItemsBean.HiddenDangerReportsBean hiddenDangerReportsBean = checkItems.get(j).getHiddenDangerReports().get(k);
|
||||
child.setScenePhotos(hiddenDangerReportsBean.getScenePhotos());
|
||||
child.setCheckResult(hiddenDangerReportsBean.getCheckResult());
|
||||
child.setUnitJoinByCheckItemId(hiddenDangerReportsBean.getUnitJoinByCheckItemId());
|
||||
child.setNameJoinByCheckItemId(hiddenDangerReportsBean.getNameJoinByCheckItemId());
|
||||
child.setCheckItemType(hiddenDangerReportsBean.getCheckItemType());
|
||||
child.setIsWrongJoinByCheckItemId(hiddenDangerReportsBean.getIsWrongJoinByCheckItemId());
|
||||
childs.add(child);
|
||||
}
|
||||
itemBean.setChild(childs);
|
||||
items.add(itemBean);
|
||||
} else if (cBean.getpId().equals("0") && cBean.getTypeByCheckItemId() == 2 && cBean.getItemId().equals(checkItems.get(j).getCheckItemId())) {
|
||||
HistoryCatalogBean.ItemBean itemBean = new HistoryCatalogBean.ItemBean();
|
||||
itemBean.setName(checkItems.get(j).getName());
|
||||
itemBean.setCheckItemId(checkItems.get(j).getCheckItemId());
|
||||
itemBean.setScenePhotos(checkItems.get(j).getScenePhotos());
|
||||
List<HistoryCatalogBean.ItemBeanChild> childs = new ArrayList<>();
|
||||
for (int k = 0; k < checkItems.get(j).getHiddenDangerReports().size(); k++) {
|
||||
HistoryCatalogBean.ItemBeanChild child = new HistoryCatalogBean.ItemBeanChild();
|
||||
CaseDetailBean.CheckItemsBean.HiddenDangerReportsBean hiddenDangerReportsBean = checkItems.get(j).getHiddenDangerReports().get(k);
|
||||
child.setScenePhotos(hiddenDangerReportsBean.getScenePhotos());
|
||||
child.setCheckResult(hiddenDangerReportsBean.getCheckResult());
|
||||
child.setUnitJoinByCheckItemId(hiddenDangerReportsBean.getUnitJoinByCheckItemId());
|
||||
child.setNameJoinByCheckItemId(hiddenDangerReportsBean.getNameJoinByCheckItemId());
|
||||
child.setIsWrongJoinByCheckItemId(hiddenDangerReportsBean.getIsWrongJoinByCheckItemId());
|
||||
child.setCheckItemType(hiddenDangerReportsBean.getCheckItemType());
|
||||
childs.add(child);
|
||||
}
|
||||
itemBean.setChild(childs);
|
||||
items.add(itemBean);
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
for (int j = 0; j < items.size(); j++) {
|
||||
HistoryCatalogBean.ItemBean itemBean = items.get(j);
|
||||
for (int k = 0; k < itemBean.getChild().size(); k++) {
|
||||
HistoryCatalogBean.ItemBeanChild child = itemBean.getChild().get(k);
|
||||
if (child.getIsWrongJoinByCheckItemId() == 1) {
|
||||
isCheck = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
cBean.setCheck(isCheck);
|
||||
cBean.setOptions(items);
|
||||
}
|
||||
mRightDatas = mCatalogBeans.get(0).getOptions();
|
||||
mRightAdapter.setData(mRightDatas);
|
||||
mLeftCatalogAdapter.setData(mCatalogBeans);
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示输入框dialog
|
||||
* 1 回退
|
||||
* 2 完成
|
||||
* 3 领导
|
||||
*/
|
||||
private void showInputDialog(String title, int type) {
|
||||
ButtomInputView inputView = new ButtomInputView.DialogBuilder(mActivity).build();
|
||||
inputView.addOnChoseListener(() -> {
|
||||
String desc = inputView.mEtText.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(desc)) {
|
||||
ToastUtils.showErrorShort("请输入描述");
|
||||
} else {
|
||||
inputView.dismiss();
|
||||
switch (mPersonType) {
|
||||
case GRID_STREET://街道
|
||||
doComplete(desc);
|
||||
break;
|
||||
case GRID_DISTRICT://旗县区
|
||||
if (type == 1) {
|
||||
doBackDistrict(desc);
|
||||
} else if (type == 2) {
|
||||
doCompleteDistrict(desc);
|
||||
} else if (type == 3) {
|
||||
doDistrictLeader(desc);
|
||||
}
|
||||
break;
|
||||
case GRID_DISTRICT_DEPARTMENT://旗县区委办局
|
||||
if (type == 1) {
|
||||
doBackDistrictDepartment(desc);
|
||||
} else if (type == 2) {
|
||||
doCompleteDistrictDepartment(desc);
|
||||
}
|
||||
break;
|
||||
case GRID_CITY://市
|
||||
if (type == 1) {
|
||||
doBackCity(desc);
|
||||
} else if (type == 2) {
|
||||
doCompleteCity(desc);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
inputView.show();
|
||||
inputView.setTitle(title);
|
||||
}
|
||||
|
||||
/**
|
||||
* 旗县区上报领导
|
||||
*/
|
||||
private void doDistrictLeader(String desc) {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "提交中...");
|
||||
dialog.show();
|
||||
CaseCompleteBean bea = new CaseCompleteBean();
|
||||
bea.setSummary(desc);
|
||||
Gson gson = new Gson();
|
||||
String obj = gson.toJson(bea);
|
||||
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.doDistrictCaseToLeader(body, mCId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.showSuccessShort("处理完成");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 旗县区完成
|
||||
*/
|
||||
private void doCompleteDistrict(String desc) {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "提交中...");
|
||||
dialog.show();
|
||||
CaseCompleteBean bea = new CaseCompleteBean();
|
||||
bea.setSummary(desc);
|
||||
Gson gson = new Gson();
|
||||
String obj = gson.toJson(bea);
|
||||
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.doDistrictCaseComplete(body, mCId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.showSuccessShort("处理完成");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 旗县区回退
|
||||
*/
|
||||
private void doBackDistrict(String desc) {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "提交中...");
|
||||
dialog.show();
|
||||
CaseCompleteBean bea = new CaseCompleteBean();
|
||||
bea.setSummary(desc);
|
||||
Gson gson = new Gson();
|
||||
String obj = gson.toJson(bea);
|
||||
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.doDistrictCaseBack(body, mCId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.showSuccessShort("处理完成");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示上级处理dialog
|
||||
*/
|
||||
private void showSelDialog() {
|
||||
CenterInputSelView selView = new CenterInputSelView.DialogBuilder(mActivity).build();
|
||||
|
||||
selView.addOnChoseListener(() -> {
|
||||
if (TextUtils.isEmpty(selView.mSelType)) {
|
||||
ToastUtils.showErrorShort("请选择处理领导");
|
||||
return;
|
||||
}
|
||||
//判断是否是旗县区领导
|
||||
if ("district".equals(selView.mSelType) && TextUtils.isEmpty(selView.mSelPersonId)) {
|
||||
ToastUtils.showErrorShort("请选择处理人员");
|
||||
return;
|
||||
}
|
||||
String desc = selView.mEtText.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(desc)) {
|
||||
ToastUtils.showErrorShort("请输入描述信息");
|
||||
return;
|
||||
}
|
||||
selView.dismiss();
|
||||
doSuperiorDispose(selView.mSelType, selView.mSelPersonId, desc);
|
||||
});
|
||||
selView.show();
|
||||
selView.setTitle("上级处理");
|
||||
}
|
||||
|
||||
/**
|
||||
* 街道上级处理
|
||||
*/
|
||||
private void doSuperiorDispose(String type, String pId, String desc) {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "提交中...");
|
||||
dialog.show();
|
||||
CaseCompleteBean bea = new CaseCompleteBean();
|
||||
bea.setSummary(desc);
|
||||
bea.setLeaderType(type);
|
||||
if ("district".equals(type)) {
|
||||
bea.setLeaderId(pId);
|
||||
}
|
||||
Gson gson = new Gson();
|
||||
String obj = gson.toJson(bea);
|
||||
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.doSuperiorCaseStreet(body, mCId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.showSuccessShort("处理完成");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 旗县区委办局回退
|
||||
*/
|
||||
private void doBackDistrictDepartment(String desc) {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "提交中...");
|
||||
dialog.show();
|
||||
CaseCompleteBean bea = new CaseCompleteBean();
|
||||
bea.setSummary(desc);
|
||||
Gson gson = new Gson();
|
||||
String obj = gson.toJson(bea);
|
||||
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.doDistrictDepartmentCaseBack(body, mCId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.showSuccessShort("处理完成");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 市回退
|
||||
*/
|
||||
private void doBackCity(String desc) {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "提交中...");
|
||||
dialog.show();
|
||||
CaseCompleteBean bea = new CaseCompleteBean();
|
||||
bea.setSummary(desc);
|
||||
Gson gson = new Gson();
|
||||
String obj = gson.toJson(bea);
|
||||
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.doCityCaseBack(body, mCId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.showSuccessShort("处理完成");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 市完成
|
||||
*/
|
||||
private void doCompleteCity(String desc) {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "提交中...");
|
||||
dialog.show();
|
||||
CaseCompleteBean bea = new CaseCompleteBean();
|
||||
bea.setSummary(desc);
|
||||
Gson gson = new Gson();
|
||||
String obj = gson.toJson(bea);
|
||||
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.doCityCaseComplete(body, mCId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.showSuccessShort("处理完成");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 旗县区委办局
|
||||
*/
|
||||
private void doCompleteDistrictDepartment(String desc) {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "提交中...");
|
||||
dialog.show();
|
||||
CaseCompleteBean bea = new CaseCompleteBean();
|
||||
bea.setSummary(desc);
|
||||
Gson gson = new Gson();
|
||||
String obj = gson.toJson(bea);
|
||||
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.doDistrictDepartmentCaseComplete(body, mCId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.showSuccessShort("处理完成");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 街道提交处理完成
|
||||
*
|
||||
* @param desc
|
||||
*/
|
||||
private void doComplete(String desc) {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "提交中...");
|
||||
dialog.show();
|
||||
CaseCompleteBean bea = new CaseCompleteBean();
|
||||
bea.setSummary(desc);
|
||||
Gson gson = new Gson();
|
||||
String obj = gson.toJson(bea);
|
||||
RequestBody body = RequestBody.create(MediaType.parse("application/json; charset=utf-8"), obj);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.doCompleteCaseStreet(body, mCId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(SuccessBean successBean) {
|
||||
dialog.dismiss();
|
||||
ToastUtils.showSuccessShort("处理完成");
|
||||
setResult(223);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
if (mDis != null && !mDis.isDisposed()) {
|
||||
mDis.dispose();
|
||||
}
|
||||
mBind.unbind();
|
||||
}
|
||||
}
|
@ -1,92 +0,0 @@
|
||||
package com.sucstepsoft.txrealtimelocation.activitys.trouble;
|
||||
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
|
||||
import com.sucstepsoft.txrealtimelocation.R;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.CaseLogAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.LogListBean;
|
||||
import com.sucstepsoft.txrealtimelocation.net.LocationApiService;
|
||||
import com.sucstepsoft.txrealtimelocation.utils.ExceptionHandler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
//日志
|
||||
public class CaseLogActivity extends BaseActivity {
|
||||
|
||||
@BindView(R.id.rlv_content)
|
||||
RecyclerView mRlvLog;
|
||||
private Unbinder mBind;
|
||||
private String mCId;
|
||||
private CaseLogAdapter mAdapter;
|
||||
private List<LogListBean> mDatas = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_case_log;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
mBind = ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("日志");
|
||||
mCId = getIntent().getStringExtra("cId");
|
||||
mAdapter = new CaseLogAdapter(mActivity, mDatas);
|
||||
mRlvLog.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||
mRlvLog.setAdapter(mAdapter);
|
||||
getLogList(mCId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 日志
|
||||
*
|
||||
* @param cId
|
||||
*/
|
||||
private void getLogList(String cId) {
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getCaseLogList(cId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<List<LogListBean>>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(List<LogListBean> logListBeans) {
|
||||
if (logListBeans != null && logListBeans.size() > 0) {
|
||||
mDatas = logListBeans;
|
||||
mAdapter.setData(mDatas);
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
} else {
|
||||
refreshView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
ExceptionHandler.handleException(e);
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -1,508 +0,0 @@
|
||||
package com.sucstepsoft.txrealtimelocation.activitys.trouble;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.app.FragmentStatePagerAdapter;
|
||||
import android.support.v4.view.ViewPager;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.baidu.location.BDAbstractLocationListener;
|
||||
import com.baidu.location.BDLocation;
|
||||
import com.baidu.location.LocationClient;
|
||||
import com.baidu.location.LocationClientOption;
|
||||
import com.google.gson.Gson;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.LazyFragment;
|
||||
import com.sucstepsoft.cm_utils.core.widget.xtablayout.XTabLayout;
|
||||
import com.sucstepsoft.cm_utils.utils.LogUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.ToastUtils;
|
||||
import com.sucstepsoft.cm_utils.utils.UIUtil;
|
||||
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
|
||||
import com.sucstepsoft.txrealtimelocation.R;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.base.CatalogActivity;
|
||||
import com.sucstepsoft.txrealtimelocation.activitys.issue.demo.NewOptions;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CatalogBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CompanyDetailBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.SaveCheckBean;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.SuccessBean;
|
||||
import com.sucstepsoft.txrealtimelocation.fragments.issue.EnterpriseCheckOptionsFragment;
|
||||
import com.sucstepsoft.txrealtimelocation.net.LocationApiService;
|
||||
import com.sucstepsoft.txrealtimelocation.utils.ExceptionHandler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
import okhttp3.RequestBody;
|
||||
|
||||
/**
|
||||
* 检查企业 - 检查项
|
||||
*/
|
||||
public class CheckEnterpriseActivity extends BaseActivity {
|
||||
|
||||
@BindView(R.id.tv_name)
|
||||
TextView mTvName;
|
||||
@BindView(R.id.btn_unclaim)
|
||||
Button mBtnUnclaim;
|
||||
@BindView(R.id.tv_peo)
|
||||
TextView mTvPeo;
|
||||
@BindView(R.id.tv_phone)
|
||||
TextView mTvPhone;
|
||||
@BindView(R.id.ll_company_info)
|
||||
LinearLayout mLlCompanyInfo;
|
||||
@BindView(R.id.xtl_tabs)
|
||||
XTabLayout mXtlTabs;
|
||||
@BindView(R.id.vp_content)
|
||||
ViewPager mVpContent;
|
||||
@BindView(R.id.rl_content)
|
||||
RelativeLayout mRlContent;
|
||||
private Unbinder mBind;
|
||||
private String[] mTitles = new String[]{"行业检查项", "企业检查项"};
|
||||
private List<EnterpriseCheckOptionsFragment> mFragments = new ArrayList<>();
|
||||
private String mTaskCheckType;
|
||||
private String mTaskId;
|
||||
private String mTaskEnterpriseId;
|
||||
|
||||
private IssueLocationReceiver mLo;
|
||||
private String mLat;
|
||||
private String mLng;
|
||||
private boolean mIsInCircle = false;
|
||||
private LocationClient mLocationClient;
|
||||
private CompanyDetailBean mCompanyDetailBean;
|
||||
private String mCId;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_check_enterprise;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
mBind = ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("企业检查");
|
||||
mTvPublish.setText("提交");
|
||||
mTvPublish.setVisibility(View.VISIBLE);
|
||||
mTvPublish.setOnClickListener(v -> doSubmit());
|
||||
refreshView(STATE_LOAD_LOADING);
|
||||
//企业ID
|
||||
mCId = getIntent().getStringExtra("cId");
|
||||
//任务ID
|
||||
mTaskId = getIntent().getStringExtra("taskId");
|
||||
// 检查项列表类型 1:默认项(行业+企业),2:行业检查项,3:企业检查项
|
||||
mTaskCheckType = getIntent().getStringExtra("taskCheckType");
|
||||
//任务企业ID
|
||||
mTaskEnterpriseId = getIntent().getStringExtra("taskEnterpriseId");
|
||||
// setLocationHintText(1, "定位中");
|
||||
// registerMessageReceiver();
|
||||
startListenerLocation();
|
||||
getCompanyDetail(mCId);
|
||||
}
|
||||
|
||||
|
||||
private void getCompanyDetail(String companyId) {
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getCompanyDetail(companyId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<CompanyDetailBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(CompanyDetailBean companyDetailBean) {
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
if (companyDetailBean != null) {
|
||||
// if (TextUtils.isEmpty(companyDetailBean.getEnterpriseLat()) || TextUtils.isEmpty(companyDetailBean.getEnterpriseLng())) {
|
||||
// ToastUtils.showShort("当前企业未录入经纬度,请联系管理员进行录入");
|
||||
// }
|
||||
mTvName.setText(companyDetailBean.getName());
|
||||
if (TextUtils.isEmpty(companyDetailBean.getLegalPerson())) {
|
||||
if (TextUtils.isEmpty(companyDetailBean.getMaster())) {
|
||||
mTvPeo.setText("未录入");
|
||||
} else {
|
||||
mTvPeo.setText(companyDetailBean.getMaster());
|
||||
}
|
||||
} else {
|
||||
mTvPeo.setText(companyDetailBean.getLegalPerson());
|
||||
}
|
||||
if (TextUtils.isEmpty(companyDetailBean.getPhone())) {
|
||||
mTvPhone.setText("未录入");
|
||||
} else {
|
||||
mTvPhone.setText(companyDetailBean.getPhone());
|
||||
}
|
||||
}
|
||||
VpRecordAdapter adapter;
|
||||
|
||||
if (!TextUtils.isEmpty(mTaskCheckType)) {
|
||||
if ("1".equals(mTaskCheckType)) {
|
||||
//行业和企业检查项都有
|
||||
mXtlTabs.setVisibility(View.VISIBLE);
|
||||
for (int i = 0; i < mTitles.length; i++) {
|
||||
EnterpriseCheckOptionsFragment fragment = new EnterpriseCheckOptionsFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putBoolean(LazyFragment.INTENT_BOOLEAN_LAZYLOAD, false);
|
||||
bundle.putString("taskId", mTaskId);
|
||||
bundle.putString("taskEnterpriseId", mTaskEnterpriseId);
|
||||
bundle.putString("taskCheckItemType", mTaskCheckType);
|
||||
bundle.putString("type", i + "");
|
||||
fragment.setArguments(bundle);
|
||||
mFragments.add(fragment);
|
||||
}
|
||||
adapter = new VpRecordAdapter(getSupportFragmentManager());
|
||||
mVpContent.setAdapter(adapter);
|
||||
mXtlTabs.setxTabDisplayNum(2);
|
||||
mXtlTabs.setupWithViewPager(mVpContent);
|
||||
} else {
|
||||
//只有行业检查项
|
||||
mXtlTabs.setVisibility(View.GONE);
|
||||
EnterpriseCheckOptionsFragment fragment = new EnterpriseCheckOptionsFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putBoolean(LazyFragment.INTENT_BOOLEAN_LAZYLOAD, false);
|
||||
bundle.putString("taskId", mTaskId);
|
||||
bundle.putString("taskEnterpriseId", mTaskEnterpriseId);
|
||||
bundle.putString("taskCheckItemType", mTaskCheckType);
|
||||
fragment.setArguments(bundle);
|
||||
mFragments.add(fragment);
|
||||
adapter = new VpRecordAdapter(getSupportFragmentManager());
|
||||
mVpContent.setAdapter(adapter);
|
||||
}
|
||||
} else {
|
||||
refreshView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交数据
|
||||
*/
|
||||
private void doSubmit() {
|
||||
if ("1".equals(mTaskCheckType)) {
|
||||
boolean b = mFragments.get(0).checkParams();//默认检查项
|
||||
boolean b1 = mFragments.get(1).checkParams();//自定义检查项
|
||||
if (b && b1) {
|
||||
List<CatalogBean> confirmList = mFragments.get(0).getConfirmList();
|
||||
List<CatalogBean> confirmList2 = mFragments.get(1).getConfirmList();
|
||||
SaveCheckBean saveCheckBean = buildConfirmData(confirmList, confirmList2);
|
||||
submit(saveCheckBean);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("检查项中存在未检查的项目");
|
||||
}
|
||||
} else {
|
||||
boolean b = mFragments.get(0).checkParams();//默认检查项
|
||||
if (b) {
|
||||
List<CatalogBean> confirmList = mFragments.get(0).getConfirmList();
|
||||
SaveCheckBean saveCheckBean = buildConfirmData(confirmList, null);
|
||||
submit(saveCheckBean);
|
||||
} else {
|
||||
ToastUtils.showErrorShort("检查项中存在未检查的项目");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void submit(SaveCheckBean bean) {
|
||||
ProgressDialog dialog = UIUtil.initDialog(mActivity, "上报中...");
|
||||
dialog.show();
|
||||
Gson gson = new Gson();
|
||||
String s = gson.toJson(bean);
|
||||
LogUtils.e(s);
|
||||
RequestBody body = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), s);
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.doSaveReport(body, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<SuccessBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(SuccessBean bean) {
|
||||
sendTrans();
|
||||
dialog.dismiss();
|
||||
ToastUtils.showSuccessShort("上报成功.");
|
||||
setResult(22);
|
||||
finish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
dialog.dismiss();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void sendTrans() {
|
||||
if (PathConfig.IS_OPEN_NOTICE) {
|
||||
Intent msgIntent = new Intent();
|
||||
msgIntent.setAction(PathConfig.ACTION_MSG_UPCOMING_BY_USER);
|
||||
msgIntent.putExtra("system", "inspection");
|
||||
msgIntent.putExtra("serviceId", mTaskId + ":" + mCId);
|
||||
sendBroadcast(msgIntent);
|
||||
}
|
||||
}
|
||||
|
||||
private SaveCheckBean buildConfirmData(List<CatalogBean> cBean, List<CatalogBean> cBean2) {
|
||||
SaveCheckBean submitBean = new SaveCheckBean();
|
||||
submitBean.setCheckLat(mLat);
|
||||
submitBean.setCheckLng(mLng);
|
||||
submitBean.setTaskEnterpriseId(mTaskEnterpriseId);
|
||||
submitBean.setTaskId(mTaskId);
|
||||
List<SaveCheckBean.IndustryReportItemsBean> items = new ArrayList<>();
|
||||
List<SaveCheckBean.EnterpriseReportItemsBean> enterpriseItems = new ArrayList<>();
|
||||
//构建行业检查项
|
||||
if (cBean != null) {
|
||||
for (int l = 0; l < cBean.size(); l++) {
|
||||
if (cBean.get(l).isCheck()) {
|
||||
List<NewOptions> data = cBean.get(l).getOptions();
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
NewOptions o = data.get(i);
|
||||
String phIds = "";
|
||||
for (int j = 0; j < o.getPhotos().size(); j++) {
|
||||
if (!TextUtils.isEmpty(o.getPhotos().get(j).getId())) {
|
||||
phIds += o.getPhotos().get(j).getId() + ",";
|
||||
}
|
||||
}
|
||||
LogUtils.e(phIds);
|
||||
List<NewOptions.ChildBean> child = data.get(i).getChild();
|
||||
for (int j = 0; j < child.size(); j++) {
|
||||
if (child.get(j).getType() == 1) {
|
||||
//选择
|
||||
if (child.get(j).isCheck()) {
|
||||
SaveCheckBean.IndustryReportItemsBean bean = new SaveCheckBean.IndustryReportItemsBean();
|
||||
bean.setCheckItemId(o.getId());
|
||||
bean.setCheckItemOptionId(child.get(j).getItemId());
|
||||
bean.setCheckResult(child.get(j).getItemId());
|
||||
bean.setCheckItemOptionType(child.get(j).getType() + "");
|
||||
if (phIds.length() > 10) {
|
||||
bean.setScenePhotos(phIds);
|
||||
}
|
||||
items.add(bean);
|
||||
}
|
||||
} else {
|
||||
//输入
|
||||
SaveCheckBean.IndustryReportItemsBean bean = new SaveCheckBean.IndustryReportItemsBean();
|
||||
bean.setCheckItemId(o.getId());
|
||||
bean.setCheckItemOptionId(child.get(j).getItemId());
|
||||
bean.setCheckItemOptionType(child.get(j).getType() + "");
|
||||
if (TextUtils.isEmpty(child.get(j).getInputText())) {
|
||||
bean.setCheckResult("");
|
||||
} else {
|
||||
bean.setCheckResult(child.get(j).getInputText());
|
||||
}
|
||||
if (phIds.length() > 10) {
|
||||
bean.setScenePhotos(phIds);
|
||||
}
|
||||
items.add(bean);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//构建企业检查项
|
||||
if (cBean2 != null) {
|
||||
for (int l = 0; l < cBean2.size(); l++) {
|
||||
if (cBean2.get(l).isCheck()) {
|
||||
List<NewOptions> data = cBean2.get(l).getOptions();
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
NewOptions o = data.get(i);
|
||||
String phIds = "";
|
||||
for (int j = 0; j < o.getPhotos().size(); j++) {
|
||||
if (!TextUtils.isEmpty(o.getPhotos().get(j).getId())) {
|
||||
phIds += o.getPhotos().get(j).getId() + ",";
|
||||
}
|
||||
}
|
||||
List<NewOptions.ChildBean> child = data.get(i).getChild();
|
||||
for (int j = 0; j < child.size(); j++) {
|
||||
if (child.get(j).getType() == 1) {
|
||||
//选择
|
||||
if (child.get(j).isCheck()) {
|
||||
SaveCheckBean.EnterpriseReportItemsBean bean = new SaveCheckBean.EnterpriseReportItemsBean();
|
||||
bean.setCheckItemId(o.getId());
|
||||
bean.setCheckItemOptionId(child.get(j).getItemId());
|
||||
bean.setCheckResult(child.get(j).getItemId());
|
||||
bean.setCheckItemOptionType(child.get(j).getType() + "");
|
||||
if (phIds.length() > 10) {
|
||||
bean.setScenePhotos(phIds);
|
||||
}
|
||||
enterpriseItems.add(bean);
|
||||
}
|
||||
} else {
|
||||
//输入
|
||||
SaveCheckBean.EnterpriseReportItemsBean bean = new SaveCheckBean.EnterpriseReportItemsBean();
|
||||
bean.setCheckItemId(o.getId());
|
||||
bean.setCheckItemOptionId(child.get(j).getItemId());
|
||||
bean.setCheckItemOptionType(child.get(j).getType() + "");
|
||||
if (TextUtils.isEmpty(child.get(j).getInputText())) {
|
||||
bean.setCheckResult("");
|
||||
} else {
|
||||
bean.setCheckResult(child.get(j).getInputText());
|
||||
}
|
||||
if (phIds.length() > 10) {
|
||||
bean.setScenePhotos(phIds);
|
||||
}
|
||||
enterpriseItems.add(bean);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
submitBean.setEnterpriseReportItems(enterpriseItems);
|
||||
submitBean.setIndustryReportItems(items);
|
||||
return submitBean;
|
||||
}
|
||||
|
||||
|
||||
public void registerMessageReceiver() {
|
||||
mLo = new IssueLocationReceiver();
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.setPriority(IntentFilter.SYSTEM_HIGH_PRIORITY);
|
||||
filter.addAction(PathConfig.ACTION_LOCATION_MESSAGE);
|
||||
registerReceiver(mLo, filter);
|
||||
}
|
||||
|
||||
//TODO 需要判断是否在企业范围内
|
||||
public class IssueLocationReceiver extends BroadcastReceiver {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
if (PathConfig.ACTION_LOCATION_MESSAGE.equals(intent.getAction())) {
|
||||
BDLocation location = intent.getParcelableExtra("data");
|
||||
LogUtils.e(location.getCity() + "==" + location.getLatitude() + "==" + location.getLongitude());
|
||||
if (location != null && location.getLatitude() != Double.MIN_VALUE && location.getLongitude() != Double.MIN_VALUE) {
|
||||
if (location.getRadius() <= 100) {
|
||||
mIsInCircle = true;
|
||||
// setLocationHintText(2, location.getAddrStr());
|
||||
mLat = location.getLatitude() + "";
|
||||
mLng = location.getLongitude() + "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化定位参数配置
|
||||
*/
|
||||
|
||||
private void startListenerLocation() {
|
||||
mLocationClient = new LocationClient(getApplicationContext());
|
||||
LocationClientOption locationOption = new LocationClientOption();
|
||||
MyLocationListener myLocationListener = new MyLocationListener();
|
||||
mLocationClient.registerLocationListener(myLocationListener);
|
||||
locationOption.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);
|
||||
locationOption.setCoorType("bd09ll");
|
||||
locationOption.setScanSpan(1000);
|
||||
locationOption.setIsNeedAddress(true);
|
||||
locationOption.setIsNeedLocationDescribe(true);
|
||||
locationOption.setNeedDeviceDirect(false);
|
||||
locationOption.setLocationNotify(true);
|
||||
locationOption.setIgnoreKillProcess(true);
|
||||
locationOption.setIsNeedLocationDescribe(true);
|
||||
locationOption.setIsNeedLocationPoiList(true);
|
||||
locationOption.SetIgnoreCacheException(false);
|
||||
locationOption.setOpenGps(true);
|
||||
locationOption.setIsNeedAltitude(false);
|
||||
locationOption.setOpenAutoNotifyMode();
|
||||
locationOption.setLocationPurpose(LocationClientOption.BDLocationPurpose.SignIn);
|
||||
locationOption.setOpenAutoNotifyMode(3000, 1, LocationClientOption.LOC_SENSITIVITY_HIGHT);
|
||||
mLocationClient.setLocOption(locationOption);
|
||||
mLocationClient.start();
|
||||
}
|
||||
|
||||
/**
|
||||
* 实现定位回调
|
||||
*/
|
||||
public class MyLocationListener extends BDAbstractLocationListener {
|
||||
@Override
|
||||
public void onReceiveLocation(BDLocation location) {
|
||||
double latitude = location.getLatitude();
|
||||
double longitude = location.getLongitude();
|
||||
float radius = location.getRadius();
|
||||
if (latitude != Double.MIN_VALUE && longitude != Double.MIN_VALUE && radius <= 300) {
|
||||
mLat = latitude + "";
|
||||
mLng = longitude + "";
|
||||
mLocationClient.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private class VpRecordAdapter extends FragmentStatePagerAdapter {
|
||||
|
||||
public VpRecordAdapter(FragmentManager fm) {
|
||||
super(fm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getItem(int i) {
|
||||
return mFragments.get(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
if (mFragments != null) {
|
||||
return mFragments.size();
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public CharSequence getPageTitle(int position) {
|
||||
return mTitles[position];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
if (mBind != null) {
|
||||
mBind.unbind();
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
}
|
@ -1,175 +0,0 @@
|
||||
package com.sucstepsoft.txrealtimelocation.activitys.trouble;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
|
||||
import com.alibaba.android.arouter.launcher.ARouter;
|
||||
import com.jcodecraeer.xrecyclerview.ProgressStyle;
|
||||
import com.jcodecraeer.xrecyclerview.XRecyclerView;
|
||||
import com.sucstepsoft.cm_utils.constant.PathConfig;
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
|
||||
import com.sucstepsoft.txrealtimelocation.R;
|
||||
import com.sucstepsoft.txrealtimelocation.adapters.CheckEnterpriseListAdapter;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CheckEnterpriseListBean;
|
||||
import com.sucstepsoft.txrealtimelocation.net.LocationApiService;
|
||||
import com.sucstepsoft.txrealtimelocation.utils.ExceptionHandler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* 随机任务 企业列表- 已完成
|
||||
*/
|
||||
public class MineMissionCompleteActivity extends BaseActivity {
|
||||
@BindView(R.id.rlv_items)
|
||||
XRecyclerView mRlvItems;
|
||||
private Unbinder mBind;
|
||||
private int mTotalSize = 0;
|
||||
private int mCurPage = 1;
|
||||
private List<CheckEnterpriseListBean.RowsBean> mDatas = new ArrayList<>();
|
||||
private CheckEnterpriseListAdapter mAdapter;
|
||||
private String mTaskId;
|
||||
private String mTaskCheckType;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_mine_mission_complete;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
mBind = ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("任务企业");
|
||||
refreshView(STATE_LOAD_LOADING);
|
||||
mAdapter = new CheckEnterpriseListAdapter(mActivity, mDatas);
|
||||
LinearLayoutManager layoutManager = new LinearLayoutManager(mActivity);
|
||||
layoutManager.setOrientation(LinearLayoutManager.VERTICAL);
|
||||
mRlvItems.setLayoutManager(layoutManager);
|
||||
mRlvItems.setAdapter(mAdapter);
|
||||
mAdapter.addOnItemClickListener(this::showDetail);
|
||||
mRlvItems.setNoMore(true);
|
||||
mRlvItems.setRefreshProgressStyle(ProgressStyle.BallGridBeat);
|
||||
mRlvItems.setLoadingMoreProgressStyle(ProgressStyle.Pacman);
|
||||
mRlvItems.setLoadingListener(new XRecyclerView.LoadingListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
refresh();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMore() {
|
||||
loadMore();
|
||||
}
|
||||
});
|
||||
mTaskId = getIntent().getStringExtra("taskId");
|
||||
//检查项列表类型 1:默认项(关联+自定义),2:关联项,3:自定义项
|
||||
mTaskCheckType = getIntent().getStringExtra("taskCheckType");
|
||||
getCheckEnterpriseList(mCurPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看详情
|
||||
*/
|
||||
private void showDetail(CheckEnterpriseListBean.RowsBean bean) {
|
||||
Intent intent = new Intent(mActivity, MineMissionHistoryDetailActivity.class);
|
||||
intent.putExtra("cId", bean.getEnterpriseId());//企业ID
|
||||
intent.putExtra("taskEnterpriseId", bean.getTaskEnterpriseId());//任务企业ID
|
||||
intent.putExtra("taskId", mTaskId);//任务ID
|
||||
intent.putExtra("taskCheckType", mTaskCheckType);//检查类型
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
private void loadMore() {
|
||||
mDatas.clear();
|
||||
mAdapter.setData(mDatas);
|
||||
getCheckEnterpriseList(1);
|
||||
}
|
||||
|
||||
private void refresh() {
|
||||
getCheckEnterpriseList(mCurPage);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取任务企业列表
|
||||
*/
|
||||
private void getCheckEnterpriseList(int page) {
|
||||
mCurPage = page;
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getMissionEnterpriseList(mTaskId, "1", mCurPage + "", UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<CheckEnterpriseListBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(CheckEnterpriseListBean issueSubBean) {
|
||||
if (issueSubBean != null && issueSubBean.getRows() != null && issueSubBean.getRows().size() > 0) {
|
||||
++mCurPage;
|
||||
if (page == 1) {
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
mDatas.clear();
|
||||
mDatas.addAll(issueSubBean.getRows());
|
||||
} else {
|
||||
|
||||
mDatas.addAll(issueSubBean.getRows());
|
||||
}
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mRlvItems.refreshComplete();
|
||||
if (mDatas.size() >= issueSubBean.getTotal()) {
|
||||
mRlvItems.loadMoreComplete();
|
||||
mRlvItems.setNoMore(true);
|
||||
} else {
|
||||
mRlvItems.loadMoreComplete();
|
||||
mRlvItems.setNoMore(false);
|
||||
}
|
||||
} else {
|
||||
if (page > 1) {
|
||||
mRlvItems.loadMoreComplete();
|
||||
mRlvItems.setNoMore(true);
|
||||
} else {
|
||||
refreshView(STATE_LOAD_EMPTY);
|
||||
//无数据
|
||||
mRlvItems.refreshComplete();
|
||||
mRlvItems.setNoMore(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
if (page == 1) {
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
}
|
||||
mRlvItems.refreshComplete();
|
||||
mRlvItems.loadMoreComplete();
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
if (mBind != null) {
|
||||
mBind.unbind();
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
}
|
@ -1,204 +0,0 @@
|
||||
package com.sucstepsoft.txrealtimelocation.activitys.trouble;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.support.v4.app.FragmentManager;
|
||||
import android.support.v4.app.FragmentStatePagerAdapter;
|
||||
import android.support.v4.view.ViewPager;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.sucstepsoft.cm_utils.core.retrofit_net.RetrofitManager;
|
||||
import com.sucstepsoft.cm_utils.core.widget.base.BaseActivity;
|
||||
import com.sucstepsoft.cm_utils.core.widget.xtablayout.XTabLayout;
|
||||
import com.sucstepsoft.cm_utils.utils.UserLgUtils;
|
||||
import com.sucstepsoft.txrealtimelocation.R;
|
||||
import com.sucstepsoft.txrealtimelocation.beans.CompanyDetailBean;
|
||||
import com.sucstepsoft.txrealtimelocation.fragments.issue.EnterpriseCheckHistoryFragment;
|
||||
import com.sucstepsoft.txrealtimelocation.net.LocationApiService;
|
||||
import com.sucstepsoft.txrealtimelocation.utils.ExceptionHandler;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import butterknife.Unbinder;
|
||||
import io.reactivex.Observer;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.disposables.Disposable;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* 我的任务检查-历史详情
|
||||
*/
|
||||
public class MineMissionHistoryDetailActivity extends BaseActivity {
|
||||
@BindView(R.id.tv_name)
|
||||
TextView mTvName;
|
||||
@BindView(R.id.tv_peo)
|
||||
TextView mTvPeo;
|
||||
@BindView(R.id.tv_phone)
|
||||
TextView mTvPhone;
|
||||
@BindView(R.id.ll_company_info)
|
||||
LinearLayout mLlCompanyInfo;
|
||||
@BindView(R.id.xtl_tabs)
|
||||
XTabLayout mXtlTabs;
|
||||
@BindView(R.id.vp_content)
|
||||
ViewPager mVpContent;
|
||||
@BindView(R.id.rl_content)
|
||||
RelativeLayout mRlContent;
|
||||
|
||||
private Unbinder mBind;
|
||||
private String[] mTitles = new String[]{"行业检查项", "企业检查项"};
|
||||
private List<EnterpriseCheckHistoryFragment> mFragments = new ArrayList<>();
|
||||
private String mTaskCheckType;
|
||||
private String mTaskId;
|
||||
private String mTaskEnterpriseId;
|
||||
|
||||
|
||||
private CompanyDetailBean mCompanyDetailBean;
|
||||
|
||||
@Override
|
||||
protected int setLayoutId() {
|
||||
return R.layout.activity_mine_mission_history_detail;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initData() {
|
||||
mBind = ButterKnife.bind(this);
|
||||
mTvBaseTitle.setText("检查详情");
|
||||
refreshView(STATE_LOAD_LOADING);
|
||||
//企业ID
|
||||
String cId = getIntent().getStringExtra("cId");
|
||||
//任务ID
|
||||
mTaskId = getIntent().getStringExtra("taskId");
|
||||
// 检查项列表类型 1:默认项(行业+企业),2:行业检查项,3:企业检查项
|
||||
mTaskCheckType = getIntent().getStringExtra("taskCheckType");
|
||||
//任务企业ID
|
||||
mTaskEnterpriseId = getIntent().getStringExtra("taskEnterpriseId");
|
||||
getCompanyDetail(cId);
|
||||
}
|
||||
|
||||
private void getCompanyDetail(String companyId) {
|
||||
RetrofitManager.getInstance()
|
||||
.create(LocationApiService.class)
|
||||
.getCompanyDetail(companyId, UserLgUtils.getToken())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<CompanyDetailBean>() {
|
||||
@Override
|
||||
public void onSubscribe(Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(CompanyDetailBean companyDetailBean) {
|
||||
refreshView(STATE_LOAD_SUCCESS);
|
||||
if (companyDetailBean != null) {
|
||||
|
||||
mTvName.setText(companyDetailBean.getName());
|
||||
if (TextUtils.isEmpty(companyDetailBean.getLegalPerson())) {
|
||||
if (TextUtils.isEmpty(companyDetailBean.getMaster())) {
|
||||
mTvPeo.setText("未录入");
|
||||
} else {
|
||||
mTvPeo.setText(companyDetailBean.getMaster());
|
||||
}
|
||||
} else {
|
||||
mTvPeo.setText(companyDetailBean.getLegalPerson());
|
||||
}
|
||||
if (TextUtils.isEmpty(companyDetailBean.getPhone())) {
|
||||
mTvPhone.setText("未录入");
|
||||
} else {
|
||||
mTvPhone.setText(companyDetailBean.getPhone());
|
||||
}
|
||||
}
|
||||
VpRecordAdapter adapter;
|
||||
|
||||
if (!TextUtils.isEmpty(mTaskCheckType)) {
|
||||
if ("1".equals(mTaskCheckType)) {
|
||||
//行业和企业检查项都有
|
||||
mXtlTabs.setVisibility(View.VISIBLE);
|
||||
for (int i = 0; i < mTitles.length; i++) {
|
||||
EnterpriseCheckHistoryFragment fragment = new EnterpriseCheckHistoryFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("taskId", mTaskId);
|
||||
bundle.putString("taskEnterpriseId", mTaskEnterpriseId);
|
||||
bundle.putString("taskCheckItemType", mTaskCheckType);
|
||||
bundle.putString("type", i + "");
|
||||
fragment.setArguments(bundle);
|
||||
mFragments.add(fragment);
|
||||
}
|
||||
adapter = new VpRecordAdapter(getSupportFragmentManager());
|
||||
mVpContent.setAdapter(adapter);
|
||||
mXtlTabs.setxTabDisplayNum(1);
|
||||
mXtlTabs.setupWithViewPager(mVpContent);
|
||||
} else {
|
||||
//只有行业检查项
|
||||
mXtlTabs.setVisibility(View.GONE);
|
||||
EnterpriseCheckHistoryFragment fragment = new EnterpriseCheckHistoryFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("taskId", mTaskId);
|
||||
bundle.putString("taskEnterpriseId", mTaskEnterpriseId);
|
||||
bundle.putString("taskCheckItemType", mTaskCheckType);
|
||||
fragment.setArguments(bundle);
|
||||
mFragments.add(fragment);
|
||||
adapter = new VpRecordAdapter(getSupportFragmentManager());
|
||||
mVpContent.setAdapter(adapter);
|
||||
}
|
||||
} else {
|
||||
refreshView(STATE_LOAD_EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
refreshView(STATE_LOAD_ERROR);
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private class VpRecordAdapter extends FragmentStatePagerAdapter {
|
||||
|
||||
public VpRecordAdapter(FragmentManager fm) {
|
||||
super(fm);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getItem(int i) {
|
||||
return mFragments.get(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
if (mFragments != null) {
|
||||
return mFragments.size();
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public CharSequence getPageTitle(int position) {
|
||||
return mTitles[position];
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
if (mBind != null) {
|
||||
mBind.unbind();
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user