Initial commit
This commit is contained in:
13
.gitignore
vendored
Normal file
13
.gitignore
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
*.iml
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/caches
|
||||
/.idea/libraries
|
||||
/.idea/modules.xml
|
||||
/.idea/workspace.xml
|
||||
/.idea/navEditor.xml
|
||||
/.idea/assetWizardSettings.xml
|
||||
.DS_Store
|
||||
/build
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
116
.idea/codeStyles/Project.xml
generated
Normal file
116
.idea/codeStyles/Project.xml
generated
Normal file
@ -0,0 +1,116 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<codeStyleSettings language="XML">
|
||||
<indentOptions>
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
</indentOptions>
|
||||
<arrangement>
|
||||
<rules>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:android</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:id</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:name</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>name</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>style</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>ANDROID_ATTRIBUTE_ORDER</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>.*</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
</rules>
|
||||
</arrangement>
|
||||
</codeStyleSettings>
|
||||
</code_scheme>
|
||||
</component>
|
||||
6
.idea/compiler.xml
generated
Normal file
6
.idea/compiler.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="1.8" />
|
||||
</component>
|
||||
</project>
|
||||
4
.idea/encodings.xml
generated
Normal file
4
.idea/encodings.xml
generated
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding" addBOMForNewFiles="with NO BOM" />
|
||||
</project>
|
||||
22
.idea/gradle.xml
generated
Normal file
22
.idea/gradle.xml
generated
Normal file
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleMigrationSettings" migrationVersion="1" />
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="testRunner" value="GRADLE" />
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="#JAVA_HOME" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
<option value="$PROJECT_DIR$/superlibrary" />
|
||||
<option value="$PROJECT_DIR$/swipemenulib" />
|
||||
</set>
|
||||
</option>
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
6
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="AndroidLintProtectedPermissions" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
</profile>
|
||||
</component>
|
||||
55
.idea/jarRepositories.xml
generated
Normal file
55
.idea/jarRepositories.xml
generated
Normal file
@ -0,0 +1,55 @@
|
||||
<?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="maven" />
|
||||
<option name="name" value="maven" />
|
||||
<option name="url" value="https://maven.google.com" />
|
||||
</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="maven2" />
|
||||
<option name="name" value="maven2" />
|
||||
<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="maven6" />
|
||||
<option name="name" value="maven6" />
|
||||
<option name="url" value="https://maven.aliyun.com/repository/gradle-plugin" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="maven2" />
|
||||
<option name="name" value="maven2" />
|
||||
<option name="url" value="https://maven.aliyun.com/repository/public" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="maven4" />
|
||||
<option name="name" value="maven4" />
|
||||
<option name="url" value="https://maven.aliyun.com/repository/google" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="maven3" />
|
||||
<option name="name" value="maven3" />
|
||||
<option name="url" value="https://maven.aliyun.com/repository/central" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
||||
6
.idea/misc.xml
generated
Normal file
6
.idea/misc.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<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>
|
||||
</project>
|
||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="" />
|
||||
</component>
|
||||
</project>
|
||||
1
app/.gitignore
vendored
Normal file
1
app/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/build
|
||||
115
app/build.gradle
Normal file
115
app/build.gradle
Normal file
@ -0,0 +1,115 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 29
|
||||
useLibrary 'org.apache.http.legacy'
|
||||
defaultConfig {
|
||||
applicationId "com.sipai.js"
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 29
|
||||
multiDexEnabled true
|
||||
versionCode 136
|
||||
versionName "1.36"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
ndk {
|
||||
abiFilters "armeabi"
|
||||
}
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility 1.8
|
||||
targetCompatibility 1.8
|
||||
}
|
||||
|
||||
configurations.all {
|
||||
resolutionStrategy {
|
||||
//force 'androidx.core:core-ktx:1.6.0'
|
||||
force 'androidx.core:core:1.6.0'
|
||||
}
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
jniLibs.srcDirs = ['libs']
|
||||
res.srcDirs = [
|
||||
'src/main/res',
|
||||
'src/main/res/layout/main',
|
||||
'src/main/res/layout/alarm',
|
||||
'src/main/res/layout/fragment_fifth',
|
||||
'src/main/res/layout/fragment_main',
|
||||
'src/main/res/layout/monitor_screen',
|
||||
'src/main/res/layout/setting',
|
||||
'src/main/res/layout/statement',
|
||||
'src/main/res/layout/login',
|
||||
'src/main/res/layout/fault',
|
||||
'src/main/res/layout/patrol',
|
||||
'src/main/res/layout/ui',
|
||||
'src/main/res/layout/nfc',
|
||||
'src/main/res/layout/webv',
|
||||
'src/main/res/layout/equ',
|
||||
'src/main/res/layout/message',
|
||||
'src/main/res/layout/layout_production_monitoring'
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
||||
implementation project(':swipemenulib')
|
||||
implementation project(':superlibrary')
|
||||
implementation 'com.github.f0ris.sweetalert:library:1.5.1'
|
||||
// implementation 'org.litepal.guolindev:core:3.2.3'
|
||||
implementation 'com.github.pinguo-zhouwei:CustomPopwindow:2.1.1'
|
||||
implementation 'androidx.appcompat:appcompat:1.1.0'
|
||||
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
|
||||
implementation 'com.kyleduo.switchbutton:library:2.0.0'
|
||||
implementation 'q.rorbin:badgeview:1.1.3'
|
||||
implementation 'com.google.code.gson:gson:2.8.6'
|
||||
implementation 'com.squareup.okhttp3:okhttp:3.4.1'
|
||||
implementation 'com.github.devlight.navigationtabstrip:navigationtabstrip:1.0.4'
|
||||
implementation 'androidx.recyclerview:recyclerview:1.0.0'
|
||||
implementation 'androidx.cardview:cardview:1.0.0'
|
||||
implementation 'com.github.bumptech.glide:glide:3.7.0'
|
||||
implementation 'com.github.devlight.shadowlayout:library:1.0.2'
|
||||
implementation 'de.hdodenhof:circleimageview:2.1.0'
|
||||
implementation 'org.xutils:xutils:3.3.36'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'androidx.test:runner:1.2.0'
|
||||
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
|
||||
// implementation project(path: ':xAlertDialogLibrary')
|
||||
implementation files('libs\\NativeImgCompress.jar')
|
||||
implementation 'com.github.yuzhiqiang1993:zxing:2.2.5'
|
||||
implementation 'com.android.support:multidex:1.0.3'
|
||||
implementation 'com.github.Hitomis:transferee:1.6.1'
|
||||
implementation 'com.haozhang.libary:android-slanted-textview:1.2'
|
||||
|
||||
// 单独添加核心 module Transferee, 之后至少还需要添加以下三种图片加载器中的一种
|
||||
implementation 'com.github.Hitomis.transferee:Transferee:1.6.1'
|
||||
|
||||
// 添加 Glide 图片加载器
|
||||
implementation 'com.github.Hitomis.transferee:GlideImageLoader:1.6.1'
|
||||
|
||||
// 添加 Picasso 图片加载器
|
||||
implementation 'com.github.Hitomis.transferee:PicassoImageLoader:1.6.1'
|
||||
|
||||
// 添加 Universal 图片加载器
|
||||
implementation 'com.github.Hitomis.transferee:UniversalImageLoader:1.6.1'
|
||||
|
||||
//mqtt
|
||||
implementation 'com.github.hannesa2:paho.mqtt.android:3.5.0'
|
||||
|
||||
//echart
|
||||
implementation 'com.github.abel533:ECharts:3.0.0.2'
|
||||
implementation 'com.contrarywind:Android-PickerView:4.1.9'
|
||||
|
||||
implementation 'io.github.scwang90:refresh-layout-kernel:2.0.6' //核心必须依赖
|
||||
implementation 'io.github.scwang90:refresh-header-classics:2.0.6'
|
||||
implementation 'io.github.scwang90:refresh-footer-classics:2.0.6'
|
||||
}
|
||||
BIN
app/libs/BaiduLBS_Android.jar
Normal file
BIN
app/libs/BaiduLBS_Android.jar
Normal file
Binary file not shown.
BIN
app/libs/MPAndroidChart-v3.0.2.jar
Normal file
BIN
app/libs/MPAndroidChart-v3.0.2.jar
Normal file
Binary file not shown.
BIN
app/libs/NativeImgCompress.jar
Normal file
BIN
app/libs/NativeImgCompress.jar
Normal file
Binary file not shown.
BIN
app/libs/android-async-http-1.4.4.jar
Normal file
BIN
app/libs/android-async-http-1.4.4.jar
Normal file
Binary file not shown.
BIN
app/libs/armeabi/libBaiduMapSDK_base_v6_3_0.so
Normal file
BIN
app/libs/armeabi/libBaiduMapSDK_base_v6_3_0.so
Normal file
Binary file not shown.
BIN
app/libs/armeabi/libBaiduMapSDK_map_v6_3_0.so
Normal file
BIN
app/libs/armeabi/libBaiduMapSDK_map_v6_3_0.so
Normal file
Binary file not shown.
BIN
app/libs/armeabi/libbitherjni.so
Normal file
BIN
app/libs/armeabi/libbitherjni.so
Normal file
Binary file not shown.
BIN
app/libs/armeabi/libindoor.so
Normal file
BIN
app/libs/armeabi/libindoor.so
Normal file
Binary file not shown.
BIN
app/libs/armeabi/libjpegbither.so
Normal file
BIN
app/libs/armeabi/libjpegbither.so
Normal file
Binary file not shown.
BIN
app/libs/armeabi/liblocSDK8a.so
Normal file
BIN
app/libs/armeabi/liblocSDK8a.so
Normal file
Binary file not shown.
0
app/libs/armeabi/libtbs.so
Normal file
0
app/libs/armeabi/libtbs.so
Normal file
BIN
app/libs/litepal-2.0.0.jar
Normal file
BIN
app/libs/litepal-2.0.0.jar
Normal file
Binary file not shown.
Binary file not shown.
21
app/proguard-rules.pro
vendored
Normal file
21
app/proguard-rules.pro
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
@ -0,0 +1,27 @@
|
||||
package com.sipai.jspatrol;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.test.InstrumentationRegistry;
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getTargetContext();
|
||||
|
||||
assertEquals("com.sipai.jspatrol", appContext.getPackageName());
|
||||
}
|
||||
}
|
||||
134
app/src/main/AndroidManifest.xml
Normal file
134
app/src/main/AndroidManifest.xml
Normal file
@ -0,0 +1,134 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
package="com.sipai.jspatrol">
|
||||
|
||||
<application
|
||||
android:name="com.sipai.jspatrol.Application.App"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/moudle_ipatrol_logo"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/moudle_ipatrol_logo"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/FullscreenTheme"
|
||||
android:usesCleartextTraffic="true"
|
||||
tools:replace="android:icon">
|
||||
<activity android:name="com.sipai.jspatrol.MonitorScreen.MonitorScreenListActivity"></activity>
|
||||
<activity android:name="com.sipai.jspatrol.Statement.StatementListActivity" />
|
||||
<activity android:name="com.sipai.jspatrol.Statement.StatementTypeActivity" />
|
||||
<activity
|
||||
android:name="com.sipai.jspatrol.ShowNotification.LockScreenDialogActivity"
|
||||
android:excludeFromRecents="true"
|
||||
android:launchMode="singleInstance"
|
||||
android:taskAffinity=""
|
||||
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
|
||||
<activity android:name="com.sipai.jspatrol.Fault.FaultFlowChartActivity" />
|
||||
<activity android:name="com.sipai.jspatrol.Equ.EquCardActivity" />
|
||||
<activity android:name="com.sipai.jspatrol.Alarm.AlarmListActivity" />
|
||||
<activity android:name="com.sipai.jspatrol.Equ.EquDetailActivity" />
|
||||
<activity android:name="com.sipai.jspatrol.Message.MessageActivity" />
|
||||
<activity android:name="com.sipai.jspatrol.Equ.EquSearchActivity" />
|
||||
<activity android:name="com.sipai.jspatrol.Fault.DoneFaultActivity" />
|
||||
<activity android:name="com.sipai.jspatrol.Fault.SingleChoiceActivity" />
|
||||
<activity android:name="com.sipai.jspatrol.Flutter.FlutterTestActivity" />
|
||||
<activity
|
||||
android:name=".PointAnalysis.PointAnalysisActivity" />
|
||||
<activity
|
||||
android:name=".PointAnalysis.SolutionListActivity" />
|
||||
<activity
|
||||
android:name=".PointAnalysis.SelPointListActivity" />
|
||||
<activity android:name=".Webv.GuideMenuLandscapeActivity"
|
||||
android:screenOrientation="landscape"/>
|
||||
<activity android:name="com.sipai.jspatrol.Webv.MonitorScreenActivity"
|
||||
android:launchMode="singleTask"
|
||||
android:screenOrientation="landscape"
|
||||
tools:ignore="LockedOrientationActivity"/>
|
||||
<activity
|
||||
android:name="com.sipai.jspatrol.Loading.LoadingActivity"
|
||||
android:screenOrientation="portrait"
|
||||
tools:ignore="LockedOrientationActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name="com.sipai.jspatrol.Main.MainActivity" />
|
||||
<activity android:name="com.sipai.jspatrol.Patrol.patrolList.PatrolListActivity" /> <!-- <activity android:name=".Loading.LoginActivity"/> -->
|
||||
<activity android:name="com.sipai.jspatrol.Patrol.ProPatrolTaskListActivity" />
|
||||
<activity android:name="com.sipai.jspatrol.Patrol.PatrolDetailActivity" />
|
||||
<activity android:name="com.sipai.jspatrol.Patrol.PatrolPointDetailActivity" />
|
||||
<activity android:name="com.sipai.jspatrol.Patrol.PatrolEquDetailActivity" />
|
||||
<activity android:name="com.sipai.jspatrol.Webv.WebStatementActivity" />
|
||||
<activity
|
||||
android:name="com.sipai.jspatrol.Login.LoginActivity"
|
||||
android:launchMode="singleInstance" />
|
||||
<activity android:name="com.sipai.jspatrol.setting.SettingActivity" />
|
||||
<activity android:name="com.sipai.jspatrol.Fault.NewFaultActivity" />
|
||||
<activity android:name="com.sipai.jspatrol.NFC.NFCGuideActivity" />
|
||||
<activity android:name="com.sipai.jspatrol.NFC.ReadTag" />
|
||||
<activity android:name="com.sipai.jspatrol.NFC.WriteTag" />
|
||||
<activity android:name="com.sipai.jspatrol.NFC.PatrolPointActivity" />
|
||||
<activity android:name="com.sipai.jspatrol.NFC.NFCEquListActivity" />
|
||||
<activity android:name="com.sipai.jspatrol.Fault.NewFaultDetailActivity" />
|
||||
<activity android:name="com.sipai.jspatrol.Fault.PersonSelectorActivity" />
|
||||
<activity android:name="com.sipai.jspatrol.Fault.DoingFaultDetailActivity" />
|
||||
<activity android:name="com.sipai.jspatrol.ProMonitoring.PointHistoryActivity" />
|
||||
<activity android:name="com.sipai.jspatrol.Webv.GuideMenuActivity" />
|
||||
<activity android:name="com.sipai.jspatrol.Equ.EquInsertActivity" />
|
||||
<activity android:name="com.sipai.jspatrol.Equ.PertainToEquSelActivity" />
|
||||
<activity android:name="com.sipai.jspatrol.Equ.SelActivity" />
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="com.sipai.js.fileProvider"
|
||||
android:exported="false"
|
||||
android:grantUriPermissions="true">
|
||||
<meta-data
|
||||
android:name="android.support.FILE_PROVIDER_PATHS"
|
||||
android:resource="@xml/provider_paths" />
|
||||
</provider>
|
||||
|
||||
<meta-data
|
||||
android:name="com.baidu.lbsapi.API_KEY"
|
||||
android:value="jiedcrEXzFAhPRZr3AC7A98nyU0xsgSi" />
|
||||
|
||||
<service android:name="com.baidu.location.f" android:enabled="true" android:process=":remote"> </service>
|
||||
|
||||
<service
|
||||
android:name="com.sipai.jspatrol.Service.IPatrolService"
|
||||
android:enabled="true"
|
||||
android:exported="true" />
|
||||
<service android:name="com.sipai.jspatrol.background.locationservice.LocationService" />
|
||||
|
||||
<uses-library
|
||||
android:name="org.apache.http.legacy"
|
||||
android:required="false" />
|
||||
</application>
|
||||
<uses-feature android:name="android.hardware.camera" />
|
||||
|
||||
<uses-feature android:name="android.hardware.camera.autofocus" />
|
||||
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
|
||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.CAMERA" /> <!-- <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/> -->
|
||||
<uses-permission android:name="android.permission.NFC" />
|
||||
<uses-permission android:name="android.permission.FLASHLIGHT" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||
|
||||
<!-- 这个权限用于进行网络定位-->
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>
|
||||
<!-- 这个权限用于访问GPS定位-->
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
|
||||
<!-- 用于访问wifi网络信息,wifi信息会用于进行网络定位-->
|
||||
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"></uses-permission>
|
||||
<!-- 这个权限用于获取wifi的获取权限,wifi信息会用来进行网络定位-->
|
||||
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"></uses-permission>
|
||||
|
||||
</manifest>
|
||||
30
app/src/main/assets/echart.html
Normal file
30
app/src/main/assets/echart.html
Normal file
@ -0,0 +1,30 @@
|
||||
<!DOCTYPE html>
|
||||
<html style="height: 100%">
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta charset="utf-8">
|
||||
</head>
|
||||
<body style="height: 94%; margin: 5px; padding: 2px;width:94%">
|
||||
<div id="container" style="height: 100%"></div>
|
||||
<script type="text/javascript" src="./echarts.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
var app ={};
|
||||
function loadEcharts(echartJson){
|
||||
var dom =document.getElementById("container");
|
||||
var myChart =echarts.init(dom);
|
||||
var option = JSON.parse(echartJson);
|
||||
option.legend.type = "scroll";
|
||||
option.legend.orient = "horizontal";
|
||||
option.legend.left = "0%";
|
||||
option.legend.right = "0%";
|
||||
option.legend.top = "5%";
|
||||
option.legend.itemWidth = 12;
|
||||
option.legend.itemHeight = 12;
|
||||
option.legend.itemGap = 15;
|
||||
if (option &&typeof option ==="object") {
|
||||
myChart.setOption(option,true);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
1
app/src/main/assets/echarts.min.js
vendored
Normal file
1
app/src/main/assets/echarts.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
17
app/src/main/assets/litepal.xml
Normal file
17
app/src/main/assets/litepal.xml
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<litepal>
|
||||
<dbname value="OffLinePatrol"/>
|
||||
|
||||
<version value = "11"></version>
|
||||
|
||||
<list>
|
||||
<mapping class="com.sipai.jspatrol.Bean.Patrol"/>
|
||||
<mapping class="com.sipai.jspatrol.Bean.PatrolModel"/>
|
||||
<mapping class="com.sipai.jspatrol.Bean.ProPatrolPoint"/>
|
||||
<mapping class="com.sipai.jspatrol.Bean.PatrolPointContent"/>
|
||||
<mapping class="com.sipai.jspatrol.Bean.InputPoint"/>
|
||||
<mapping class="com.sipai.jspatrol.Patrol.patrolInfoAdapter.PatrolEqu"/>
|
||||
<mapping class="com.sipai.jspatrol.Bean.PatrolLocation"/>
|
||||
</list>
|
||||
|
||||
</litepal>
|
||||
86
app/src/main/java/com/sipai/jspatrol/Alarm/AlarmAdapter.java
Normal file
86
app/src/main/java/com/sipai/jspatrol/Alarm/AlarmAdapter.java
Normal file
@ -0,0 +1,86 @@
|
||||
package com.sipai.jspatrol.Alarm;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.sipai.jspatrol.Bean.Alarm;
|
||||
import com.sipai.jspatrol.Fault.NewFaultActivity;
|
||||
import com.sipai.jspatrol.R;
|
||||
import com.sipai.jspatrol.utils.Global.GlobalVal;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2020/11/9
|
||||
*/
|
||||
public class AlarmAdapter extends RecyclerView.Adapter<AlarmAdapter.ViewHolder> {
|
||||
private List<Alarm> list;
|
||||
private Context context;
|
||||
|
||||
public AlarmAdapter(Context context,List<Alarm> list) {
|
||||
this.context = context;
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AlarmAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_alarm,parent,false);
|
||||
final AlarmAdapter.ViewHolder viewHolder = new AlarmAdapter.ViewHolder(view);
|
||||
viewHolder.msg.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
int position = viewHolder.getAdapterPosition();
|
||||
NewFaultActivity.alarmStart(context,list.get(position).getDescribe());
|
||||
}
|
||||
});
|
||||
return viewHolder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(AlarmAdapter.ViewHolder holder, int position) {
|
||||
Alarm item = list.get(position);
|
||||
holder.time.setText(item.getAlarmtime());
|
||||
holder.content.setText(item.getDescribe());
|
||||
holder.tv_type.setText(item.getAlarmTypeName());
|
||||
holder.tv_lvl.setText(item.getPointName());
|
||||
if (item.getStatus().equals(GlobalVal.Status_N)){
|
||||
holder.tv_status.setText("未处理");
|
||||
holder.tv_status.setTextColor(context.getResources().getColor(R.color.error_red));
|
||||
}else if (item.getStatus().equals(GlobalVal.Status_C)){
|
||||
holder.tv_status.setText("已确认");
|
||||
holder.tv_status.setTextColor(context.getResources().getColor(R.color.error_yellow));
|
||||
}else if (item.getStatus().equals(GlobalVal.Status_Y)){
|
||||
holder.tv_status.setText("已恢复");
|
||||
holder.tv_status.setTextColor(context.getResources().getColor(R.color.little_blue));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemViewType(int position) {
|
||||
return position;
|
||||
}
|
||||
|
||||
static class ViewHolder extends RecyclerView.ViewHolder{
|
||||
View msg;
|
||||
TextView time,content,tv_type,tv_lvl,tv_status;
|
||||
public ViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
msg = itemView;
|
||||
time = itemView.findViewById(R.id.moudle_item_alarm_tv_time);
|
||||
content = itemView.findViewById(R.id.moudle_item_alarm_tv_content);
|
||||
tv_type = itemView.findViewById(R.id.moudle_item_alarm_tv_alarmtype);
|
||||
tv_lvl = itemView.findViewById(R.id.moudle_item_alarm_tv_alarmlvl);
|
||||
tv_status = itemView.findViewById(R.id.moudle_item_alarm_tv_status);;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,339 @@
|
||||
package com.sipai.jspatrol.Alarm;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import android.app.DatePickerDialog;
|
||||
import android.app.TimePickerDialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.widget.DatePicker;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.TimePicker;
|
||||
|
||||
import com.sipai.jspatrol.Bean.Alarm;
|
||||
import com.sipai.jspatrol.R;
|
||||
import com.sipai.jspatrol.URL.MethodURL;
|
||||
import com.sipai.jspatrol.utils.DateFormatUtils;
|
||||
import com.sipai.jspatrol.utils.OKHttpUtils;
|
||||
import com.sipai.jspatrol.utils.SharedPreferencesData;
|
||||
import com.sipai.ui.EmptyLayout;
|
||||
import com.superrecycleview.superlibrary.recycleview.SuperRecyclerView;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Callback;
|
||||
import okhttp3.Response;
|
||||
|
||||
public class AlarmListActivity extends AppCompatActivity implements View.OnClickListener {
|
||||
private SharedPreferencesData sharedpre;
|
||||
private HashMap<String, String> map_base = new HashMap<>();
|
||||
private String mServer;
|
||||
private String mBizid;
|
||||
private EditText tvstartdate,tvenddate;
|
||||
private int year,month,day,hour,minute,lastday,lastmonth;
|
||||
private int page = 1;
|
||||
private LinearLayoutManager manager;
|
||||
private SuperRecyclerView rc_view;
|
||||
private SwipeRefreshLayout refresh;
|
||||
private EmptyLayout emptyLayout;
|
||||
private ImageView iv_back;
|
||||
private EditText edt_name;
|
||||
private TextView tv_search;
|
||||
private String name = "";
|
||||
private List<Alarm> alarms = new ArrayList<>();
|
||||
private AlarmAdapter adapter;
|
||||
|
||||
public static void actionStart(Context context){
|
||||
Intent intent = new Intent(context,AlarmListActivity.class);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_alarm_list);
|
||||
init();
|
||||
initView();
|
||||
getAlarmMsgs();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
iv_back = findViewById(R.id.moudle_alarm_list_iv_back);
|
||||
iv_back.setOnClickListener(this);
|
||||
edt_name = findViewById(R.id.moudle_alarm_list_edt_equname);
|
||||
tv_search = findViewById(R.id.moudle_alarm_list_tv_search);
|
||||
tv_search.setOnClickListener(this);
|
||||
tvstartdate=(EditText)findViewById(R.id.moudle_alarm_list_edt_sd);
|
||||
tvstartdate.setCursorVisible(false);
|
||||
tvstartdate.setOnTouchListener(new View.OnTouchListener() {
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
//创建DatePickerDialog对象
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
MyDatePickerDialog dpd = new MyDatePickerDialog(AlarmListActivity.this, Datelistener, year, month, day);
|
||||
dpd.show();//显示DatePickerDialog组件
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
tvenddate=(EditText)findViewById(R.id.moudle_alarm_list_edt_ed);
|
||||
tvenddate.setCursorVisible(false);
|
||||
tvenddate.setOnTouchListener(new View.OnTouchListener() {
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
//创建DatePickerDialog对象
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
MyDatePickerDialog dpd = new MyDatePickerDialog(AlarmListActivity.this, Datelistener, year, month, day);
|
||||
dpd.show();//显示DatePickerDialog组件
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (day<8){
|
||||
if (month!=0) {
|
||||
Calendar calendar = Calendar.getInstance(Locale.CHINA);
|
||||
calendar.set(Calendar.MONTH, month - 1);
|
||||
int tday = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
|
||||
tvstartdate.setText(DateFormatUtils.DateFormatMinString(year + "-" + month + "-" + lastday + " " + hour + ":" + minute));
|
||||
}else{
|
||||
Calendar calendar = Calendar.getInstance(Locale.CHINA);
|
||||
calendar.set(Calendar.MONTH, 11);
|
||||
int tday = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
|
||||
tvstartdate.setText(DateFormatUtils.DateFormatMinString((year-1) + "-" + 12 + "-" + lastday + " " + hour + ":" + minute));
|
||||
}
|
||||
}else {
|
||||
tvstartdate.setText(DateFormatUtils.DateFormatMinString(year + "-" + (month + 1) + "-" + lastday + " " + hour + ":" + minute));
|
||||
}
|
||||
tvenddate.setText(DateFormatUtils.DateFormatMinString(year+"-"+(month+1)+"-"+day+" "+hour+":"+minute));
|
||||
rc_view = findViewById(R.id.moudle_alarm_list_rc);
|
||||
emptyLayout = findViewById(R.id.moudle_alarm_list_ui_empty);
|
||||
refresh = findViewById(R.id.moudle_alarm_list_refresh);
|
||||
refresh.setColorSchemeResources(R.color.blue);
|
||||
refresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
page = 1;
|
||||
getAlarmMsgs();
|
||||
}
|
||||
});
|
||||
manager = new LinearLayoutManager(this);
|
||||
rc_view.setLayoutManager(manager);
|
||||
rc_view.setRefreshEnabled(false);
|
||||
rc_view.setLoadMoreEnabled(true);
|
||||
rc_view.setLoadingListener(new SuperRecyclerView.LoadingListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMore() {
|
||||
page = page+1;
|
||||
getAlarmMsgs();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void init() {
|
||||
sharedpre = new SharedPreferencesData(this);
|
||||
map_base = sharedpre.getAll();
|
||||
mServer = map_base.get("mServer");
|
||||
SharedPreferences sharedPreferences = getSharedPreferences("config",MODE_PRIVATE);
|
||||
mBizid = sharedPreferences.getString("bizid","");
|
||||
//初始化Calendar日历对象
|
||||
Calendar mycalendar=Calendar.getInstance(Locale.CHINA);
|
||||
Date mydate=new Date(); //获取当前日期Date对象
|
||||
mycalendar.setTime(mydate);////为Calendar对象设置时间为当前日期
|
||||
year=mycalendar.get(Calendar.YEAR); //获取Calendar对象中的年
|
||||
month=mycalendar.get(Calendar.MONTH);//获取Calendar对象中的月
|
||||
day=mycalendar.get(Calendar.DAY_OF_MONTH);//获取这个月的第几天
|
||||
lastday=getBeforeDay(mycalendar).get(Calendar.DAY_OF_MONTH);
|
||||
lastmonth=getBeforeDay(mycalendar).get(Calendar.MONTH);
|
||||
hour=mycalendar.get(Calendar.HOUR_OF_DAY);//获取这个月的第几天
|
||||
minute=mycalendar.get(Calendar.MINUTE);//获取这个月的第几天
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()){
|
||||
case R.id.moudle_alarm_list_iv_back:
|
||||
finish();
|
||||
break;
|
||||
case R.id.moudle_alarm_list_tv_search:
|
||||
startSearch();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void startSearch() {
|
||||
if (edt_name.getText()!=null&&!edt_name.getText().toString().isEmpty()){
|
||||
name = edt_name.getText().toString();
|
||||
}
|
||||
getAlarmMsgs();
|
||||
}
|
||||
|
||||
public class MyDatePickerDialog extends DatePickerDialog {
|
||||
|
||||
public MyDatePickerDialog(Context context, OnDateSetListener callBack,
|
||||
int year, int month, int day) {
|
||||
super(context, callBack, year, month, day);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
@Override
|
||||
protected void onStop() {
|
||||
//super.onStop();//防止onDateSet执行两次
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private DatePickerDialog.OnDateSetListener Datelistener=new DatePickerDialog.OnDateSetListener() {
|
||||
@Override
|
||||
public void onDateSet(DatePicker view, int myyear, int monthOfYear, int dayOfMonth) {
|
||||
//修改year、month、day的变量值,以便以后单击按钮时,DatePickerDialog上显示上一次修改后的值
|
||||
year=myyear;
|
||||
month=monthOfYear;
|
||||
day=dayOfMonth;
|
||||
//更新日期
|
||||
updateDate();
|
||||
}
|
||||
//当DatePickerDialog关闭时,更新日期显示
|
||||
private void updateDate()
|
||||
{
|
||||
//在TextView上显示日期
|
||||
TimePickerDialog dpd=new TimePickerDialog(AlarmListActivity.this,Timelistener,hour,minute,true);
|
||||
dpd.show();//显示DatePickerDialog组件
|
||||
}
|
||||
};
|
||||
|
||||
private TimePickerDialog.OnTimeSetListener Timelistener=new TimePickerDialog.OnTimeSetListener() {
|
||||
@Override
|
||||
public void onTimeSet(TimePicker view, int hours, int minutes) {
|
||||
//修改year、month、day的变量值,以便以后单击按钮时,DatePickerDialog上显示上一次修改后的值
|
||||
hour=hours;
|
||||
minute=minutes;
|
||||
//更新日期
|
||||
updateDate();
|
||||
}
|
||||
//当DatePickerDialog关闭时,更新日期显示
|
||||
private void updateDate()
|
||||
{
|
||||
//在TextView上显示日期
|
||||
if(tvstartdate.isFocused()){
|
||||
tvstartdate.setText(DateFormatUtils.DateFormatMinString(year+"-"+(month+1)+"-"+day+" "+hour+":"+minute));
|
||||
}else if(tvenddate.isFocused()){
|
||||
tvenddate.setText(DateFormatUtils.DateFormatMinString(year+"-"+(month+1)+"-"+day+" "+hour+":"+minute));
|
||||
}
|
||||
getAlarmMsgs();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取当前时间的前一周
|
||||
* @param cl
|
||||
* @return
|
||||
*/
|
||||
private static Calendar getBeforeDay(Calendar cl){
|
||||
//使用roll方法进行向前回滚
|
||||
//cl.roll(Calendar.DATE, -1);
|
||||
//使用set方法直接进行设置
|
||||
int day = cl.get(Calendar.DATE);
|
||||
cl.set(Calendar.DATE, day-7);
|
||||
return cl;
|
||||
}
|
||||
|
||||
private void getAlarmMsgs() {
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("companyId",mBizid);
|
||||
map.put("search_name",name);
|
||||
map.put("alarmlevel","");
|
||||
map.put("status","");
|
||||
map.put("page",String.valueOf(page));
|
||||
map.put("sdt",tvstartdate.getText().toString());
|
||||
map.put("edt",tvenddate.getText().toString());
|
||||
map.put("rows","50");
|
||||
OKHttpUtils.getClient().newCall(OKHttpUtils.OKHttpRequest(map, mServer, MethodURL.GetAlarmList_Method)).enqueue(new Callback() {
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e) {
|
||||
String a = e.toString();
|
||||
// showError(a);
|
||||
updateList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException {
|
||||
String res = response.body().string();
|
||||
if (res.contains("describe")&&res.contains("id")){
|
||||
alarms = parseAlarmList(res);
|
||||
}else {
|
||||
alarms = new ArrayList<>();
|
||||
}
|
||||
updateList();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void updateList() {
|
||||
if (!AlarmListActivity.this.isFinishing()){
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
refresh.setRefreshing(false);
|
||||
if (alarms.size()>0){
|
||||
emptyLayout.setVisibility(View.GONE);
|
||||
rc_view.setVisibility(View.VISIBLE);
|
||||
adapter = new AlarmAdapter(AlarmListActivity.this,alarms);
|
||||
rc_view.setAdapter(adapter);
|
||||
}else {
|
||||
rc_view.setVisibility(View.GONE);
|
||||
emptyLayout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private List<Alarm> parseAlarmList(String res) {
|
||||
List<Alarm> list = new ArrayList<>();
|
||||
try {
|
||||
JSONArray array = new JSONArray(res);
|
||||
for (int i=0;i<array.length();i++){
|
||||
Alarm item = new Alarm();
|
||||
item.setId(array.getJSONObject(i).optString("id"));
|
||||
if (array.getJSONObject(i).optString("alarmTime").length()>16){
|
||||
item.setAlarmtime(array.getJSONObject(i).optString("alarmTime").substring(0,16));
|
||||
}else {
|
||||
item.setAlarmtime(array.getJSONObject(i).optString("alarmTime"));
|
||||
}
|
||||
item.setPointCode(array.getJSONObject(i).optString("pointCode"));
|
||||
item.setPointName(array.getJSONObject(i).optString("pointName"));
|
||||
item.setAlarmTypeName(array.getJSONObject(i).optString("alarmTypeName"));
|
||||
item.setStatus(array.getJSONObject(i).optString("status"));
|
||||
item.setAlarmtype(array.getJSONObject(i).optString("alarmType"));
|
||||
item.setDescribe(array.getJSONObject(i).optString("describe"));
|
||||
list.add(item);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
57
app/src/main/java/com/sipai/jspatrol/Application/App.java
Normal file
57
app/src/main/java/com/sipai/jspatrol/Application/App.java
Normal file
@ -0,0 +1,57 @@
|
||||
package com.sipai.jspatrol.Application;
|
||||
|
||||
import android.app.Application;
|
||||
|
||||
import androidx.multidex.MultiDex;
|
||||
|
||||
import com.sipai.jspatrol.utils.CrashHandler;
|
||||
|
||||
import org.litepal.LitePal;
|
||||
import org.litepal.LitePalApplication;
|
||||
import org.xutils.x;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2020/3/23
|
||||
*/
|
||||
public class App extends LitePalApplication {
|
||||
|
||||
private double latitude;
|
||||
private double longitude;
|
||||
|
||||
public double getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
|
||||
public void setLatitude(double latitude) {
|
||||
this.latitude = latitude;
|
||||
}
|
||||
|
||||
public double getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
public void setLongitude(double longitude) {
|
||||
this.longitude = longitude;
|
||||
}
|
||||
private static App instance;
|
||||
|
||||
public static App getInstance(){
|
||||
if (instance == null){
|
||||
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
instance = this;
|
||||
//全局捕捉异常
|
||||
CrashHandler crashHandler = CrashHandler.getInstance();
|
||||
crashHandler.init(getApplicationContext());
|
||||
x.Ext.init(this);
|
||||
x.Ext.setDebug(false);
|
||||
MultiDex.install(this);
|
||||
// LitePal.initialize(this);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
package com.sipai.jspatrol.Base;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2020/3/23
|
||||
*/
|
||||
public class ActivityCollector {
|
||||
public static List<Activity> activities = new ArrayList<>();
|
||||
|
||||
public static void addActivity(Activity activity){
|
||||
activities.add(activity);
|
||||
}
|
||||
|
||||
public static void removeActivity(Activity activity){
|
||||
activities.remove(activity);
|
||||
}
|
||||
|
||||
public static void finishAll(){
|
||||
for (Activity activity:activities){
|
||||
if (!activity.isFinishing()){
|
||||
activity.finish();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package com.sipai.jspatrol.Base;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2020/3/23
|
||||
*/
|
||||
public abstract class BaseFragmentModel<P extends BaseFragmentPresenter,CONTRACT> {
|
||||
|
||||
protected P p;
|
||||
|
||||
public BaseFragmentModel(P p) {
|
||||
this.p = p;
|
||||
}
|
||||
|
||||
public abstract CONTRACT getContract();
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package com.sipai.jspatrol.Base;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2020/3/23
|
||||
*/
|
||||
public abstract class BaseFragmentPresenter<V extends BaseFragmentView,M extends BaseFragmentModel,CONTRACT> {
|
||||
protected M m;
|
||||
|
||||
//绑定View层弱引用
|
||||
private WeakReference<V> vWeakReference;
|
||||
|
||||
public BaseFragmentPresenter() {
|
||||
m = getModel();
|
||||
}
|
||||
|
||||
public void bindView(V v) {
|
||||
vWeakReference = new WeakReference<>(v);
|
||||
}
|
||||
|
||||
public void unBindView(){
|
||||
if (vWeakReference!=null){
|
||||
vWeakReference.clear();
|
||||
vWeakReference = null;
|
||||
System.gc();
|
||||
}
|
||||
}
|
||||
|
||||
public V getView(){
|
||||
if (vWeakReference!=null){
|
||||
return vWeakReference.get();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public abstract CONTRACT getContract();
|
||||
|
||||
public abstract M getModel();
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
package com.sipai.jspatrol.Base;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2020/3/23
|
||||
*/
|
||||
public abstract class BaseFragmentView<P extends BaseFragmentPresenter,CONTRACT> extends Fragment {
|
||||
protected P p;
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
p = getPresenter();
|
||||
p.bindView(this);
|
||||
}
|
||||
|
||||
public abstract CONTRACT getContract();
|
||||
|
||||
public abstract P getPresenter();
|
||||
|
||||
public void error(Exception e){}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
p.unBindView();
|
||||
}
|
||||
}
|
||||
14
app/src/main/java/com/sipai/jspatrol/Base/BaseModel.java
Normal file
14
app/src/main/java/com/sipai/jspatrol/Base/BaseModel.java
Normal file
@ -0,0 +1,14 @@
|
||||
package com.sipai.jspatrol.Base;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2020/3/23
|
||||
*/
|
||||
public abstract class BaseModel<P extends BasePresenter,CONTRACT> {
|
||||
protected P p;
|
||||
|
||||
public BaseModel(P p) {
|
||||
this.p = p;
|
||||
}
|
||||
|
||||
public abstract CONTRACT getContract();
|
||||
}
|
||||
41
app/src/main/java/com/sipai/jspatrol/Base/BasePresenter.java
Normal file
41
app/src/main/java/com/sipai/jspatrol/Base/BasePresenter.java
Normal file
@ -0,0 +1,41 @@
|
||||
package com.sipai.jspatrol.Base;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2020/3/23
|
||||
*/
|
||||
public abstract class BasePresenter<V extends BaseView,M extends BaseModel,CONTRACT> {
|
||||
protected M m;
|
||||
//绑定View层弱引用
|
||||
private WeakReference<V> vWeakReference;
|
||||
|
||||
public BasePresenter() {
|
||||
m = getModel();
|
||||
}
|
||||
|
||||
public void bindView(V v){
|
||||
vWeakReference = new WeakReference<>(v);
|
||||
}
|
||||
|
||||
public void unBindView(){
|
||||
if (vWeakReference!=null){
|
||||
vWeakReference.clear();
|
||||
vWeakReference = null;
|
||||
System.gc();
|
||||
}
|
||||
}
|
||||
|
||||
//获取View,P — V
|
||||
public V getView(){
|
||||
if(vWeakReference!=null){
|
||||
return vWeakReference.get();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
//获取子类具体契约(Model层和View层协商的共同业务)
|
||||
public abstract CONTRACT getContract();
|
||||
|
||||
public abstract M getModel();
|
||||
}
|
||||
40
app/src/main/java/com/sipai/jspatrol/Base/BaseView.java
Normal file
40
app/src/main/java/com/sipai/jspatrol/Base/BaseView.java
Normal file
@ -0,0 +1,40 @@
|
||||
package com.sipai.jspatrol.Base;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2020/3/23
|
||||
*/
|
||||
public abstract class BaseView<P extends BasePresenter,CONTRACT> extends AppCompatActivity {
|
||||
protected P p;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
//弱引用
|
||||
p = getPresenter();
|
||||
//绑定
|
||||
p.bindView(this);
|
||||
|
||||
}
|
||||
//从子类获取具体契约
|
||||
protected abstract P getPresenter();
|
||||
|
||||
//让P层做什么需求
|
||||
public abstract CONTRACT getContract();
|
||||
|
||||
//如果Presenter层出现了异常,需要告知View层
|
||||
public void error(Exception e){
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
//解除绑定
|
||||
p.unBindView();
|
||||
}
|
||||
}
|
||||
135
app/src/main/java/com/sipai/jspatrol/Bean/Alarm.java
Normal file
135
app/src/main/java/com/sipai/jspatrol/Bean/Alarm.java
Normal file
@ -0,0 +1,135 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2020/11/9
|
||||
*/
|
||||
public class Alarm implements Serializable {
|
||||
private String id;
|
||||
private String alarmlvl;
|
||||
private String alarmtime;
|
||||
private String alarmtype;
|
||||
private String alarmvalue;
|
||||
private String describe;
|
||||
private String status;
|
||||
private String recovertime;
|
||||
private String workOrderId;
|
||||
private String company;
|
||||
private String processSection;
|
||||
private String pointCode;
|
||||
private String pointName;
|
||||
private String alarmTypeName;
|
||||
|
||||
public String getPointCode() {
|
||||
return pointCode;
|
||||
}
|
||||
|
||||
public void setPointCode(String pointCode) {
|
||||
this.pointCode = pointCode;
|
||||
}
|
||||
|
||||
public String getPointName() {
|
||||
return pointName;
|
||||
}
|
||||
|
||||
public void setPointName(String pointName) {
|
||||
this.pointName = pointName;
|
||||
}
|
||||
|
||||
public String getAlarmTypeName() {
|
||||
return alarmTypeName;
|
||||
}
|
||||
|
||||
public void setAlarmTypeName(String alarmTypeName) {
|
||||
this.alarmTypeName = alarmTypeName;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getAlarmlvl() {
|
||||
return alarmlvl;
|
||||
}
|
||||
|
||||
public void setAlarmlvl(String alarmlvl) {
|
||||
this.alarmlvl = alarmlvl;
|
||||
}
|
||||
|
||||
public String getAlarmtime() {
|
||||
return alarmtime;
|
||||
}
|
||||
|
||||
public void setAlarmtime(String alarmtime) {
|
||||
this.alarmtime = alarmtime;
|
||||
}
|
||||
|
||||
public String getAlarmtype() {
|
||||
return alarmtype;
|
||||
}
|
||||
|
||||
public void setAlarmtype(String alarmtype) {
|
||||
this.alarmtype = alarmtype;
|
||||
}
|
||||
|
||||
public String getAlarmvalue() {
|
||||
return alarmvalue;
|
||||
}
|
||||
|
||||
public void setAlarmvalue(String alarmvalue) {
|
||||
this.alarmvalue = alarmvalue;
|
||||
}
|
||||
|
||||
public String getDescribe() {
|
||||
return describe;
|
||||
}
|
||||
|
||||
public void setDescribe(String describe) {
|
||||
this.describe = describe;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getRecovertime() {
|
||||
return recovertime;
|
||||
}
|
||||
|
||||
public void setRecovertime(String recovertime) {
|
||||
this.recovertime = recovertime;
|
||||
}
|
||||
|
||||
public String getWorkOrderId() {
|
||||
return workOrderId;
|
||||
}
|
||||
|
||||
public void setWorkOrderId(String workOrderId) {
|
||||
this.workOrderId = workOrderId;
|
||||
}
|
||||
|
||||
public String getCompany() {
|
||||
return company;
|
||||
}
|
||||
|
||||
public void setCompany(String company) {
|
||||
this.company = company;
|
||||
}
|
||||
|
||||
public String getProcessSection() {
|
||||
return processSection;
|
||||
}
|
||||
|
||||
public void setProcessSection(String processSection) {
|
||||
this.processSection = processSection;
|
||||
}
|
||||
}
|
||||
89
app/src/main/java/com/sipai/jspatrol/Bean/Area.java
Normal file
89
app/src/main/java/com/sipai/jspatrol/Bean/Area.java
Normal file
@ -0,0 +1,89 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
/**
|
||||
* Created by lvliming on 2017/10/23.
|
||||
*/
|
||||
|
||||
public class Area {
|
||||
private String _bizname,bizid,code,id,insdt,insuser,name,pid,remark,status;
|
||||
|
||||
public String get_bizname() {
|
||||
return _bizname;
|
||||
}
|
||||
|
||||
public void set_bizname(String _bizname) {
|
||||
this._bizname = _bizname;
|
||||
}
|
||||
|
||||
public String getBizid() {
|
||||
return bizid;
|
||||
}
|
||||
|
||||
public void setBizid(String bizid) {
|
||||
this.bizid = bizid;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getInsdt() {
|
||||
return insdt;
|
||||
}
|
||||
|
||||
public void setInsdt(String insdt) {
|
||||
this.insdt = insdt;
|
||||
}
|
||||
|
||||
public String getInsuser() {
|
||||
return insuser;
|
||||
}
|
||||
|
||||
public void setInsuser(String insuser) {
|
||||
this.insuser = insuser;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPid() {
|
||||
return pid;
|
||||
}
|
||||
|
||||
public void setPid(String pid) {
|
||||
this.pid = pid;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2020/3/23
|
||||
*/
|
||||
public class BaseEntity {
|
||||
private int code;
|
||||
private String result;
|
||||
}
|
||||
142
app/src/main/java/com/sipai/jspatrol/Bean/Biz.java
Normal file
142
app/src/main/java/com/sipai/jspatrol/Bean/Biz.java
Normal file
@ -0,0 +1,142 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class Biz extends BaseEntity implements Serializable{
|
||||
private String id;
|
||||
private String name;
|
||||
private String logopic;
|
||||
private String _typename;
|
||||
private String address;
|
||||
private String power;
|
||||
private String technics;
|
||||
private String location;
|
||||
private String leader;
|
||||
private String tel;
|
||||
private String frehint;
|
||||
private String mainpic;
|
||||
private String defaultprddbname;
|
||||
private String bizid;
|
||||
private String pid;
|
||||
|
||||
public String getPid() {
|
||||
return pid;
|
||||
}
|
||||
|
||||
public void setPid(String pid) {
|
||||
this.pid = pid;
|
||||
}
|
||||
|
||||
public String getBizid() {
|
||||
return bizid;
|
||||
}
|
||||
|
||||
public void setBizid(String bizid) {
|
||||
this.bizid = bizid;
|
||||
}
|
||||
|
||||
public String getFrehint() {
|
||||
return frehint;
|
||||
}
|
||||
|
||||
public void setFrehint(String frehint) {
|
||||
this.frehint = frehint;
|
||||
}
|
||||
|
||||
public String get_typename() {
|
||||
return _typename;
|
||||
}
|
||||
|
||||
public void set_typename(String _typename) {
|
||||
this._typename = _typename;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getLogopic() {
|
||||
return logopic;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setLogopic(String logopic) {
|
||||
this.logopic = logopic;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getPower() {
|
||||
return power;
|
||||
}
|
||||
|
||||
public void setPower(String power) {
|
||||
this.power = power;
|
||||
}
|
||||
|
||||
public String getTechnics() {
|
||||
return technics;
|
||||
}
|
||||
|
||||
public void setTechnics(String technics) {
|
||||
this.technics = technics;
|
||||
}
|
||||
|
||||
public String getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(String location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public String getLeader() {
|
||||
return leader;
|
||||
}
|
||||
|
||||
public void setLeader(String leader) {
|
||||
this.leader = leader;
|
||||
}
|
||||
|
||||
public String getTel() {
|
||||
return tel;
|
||||
}
|
||||
|
||||
public void setTel(String tel) {
|
||||
this.tel = tel;
|
||||
}
|
||||
|
||||
public String getMainpic() {
|
||||
return mainpic;
|
||||
}
|
||||
|
||||
public void setMainpic(String mainpic) {
|
||||
this.mainpic = mainpic;
|
||||
}
|
||||
|
||||
public String getDefaultprddbname() {
|
||||
return defaultprddbname;
|
||||
}
|
||||
|
||||
public void setDefaultprddbname(String defaultprddbname) {
|
||||
this.defaultprddbname = defaultprddbname;
|
||||
}
|
||||
|
||||
}
|
||||
51
app/src/main/java/com/sipai/jspatrol/Bean/ChartData.java
Normal file
51
app/src/main/java/com/sipai/jspatrol/Bean/ChartData.java
Normal file
@ -0,0 +1,51 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class ChartData implements Serializable {
|
||||
private String name;
|
||||
private String name1;
|
||||
private Object[] x;
|
||||
private Object[] y;
|
||||
private Object[] y2;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName1() {
|
||||
return name1;
|
||||
}
|
||||
|
||||
public void setName1(String name1) {
|
||||
this.name1 = name1;
|
||||
}
|
||||
|
||||
public Object[] getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public void setX(Object[] x) {
|
||||
this.x = x;
|
||||
}
|
||||
|
||||
public Object[] getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public void setY(Object[] y) {
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public Object[] getY2() {
|
||||
return y2;
|
||||
}
|
||||
|
||||
public void setY2(Object[] y2) {
|
||||
this.y2 = y2;
|
||||
}
|
||||
}
|
||||
75
app/src/main/java/com/sipai/jspatrol/Bean/Detail.java
Normal file
75
app/src/main/java/com/sipai/jspatrol/Bean/Detail.java
Normal file
@ -0,0 +1,75 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Created by lvliming on 2019/3/26.
|
||||
*/
|
||||
|
||||
public class Detail implements Serializable {
|
||||
private String id,problem,handledetail,detailsupplement,handledt,processsectionid,equipmentids,faultlibraryid;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getProblem() {
|
||||
return problem;
|
||||
}
|
||||
|
||||
public void setProblem(String problem) {
|
||||
this.problem = problem;
|
||||
}
|
||||
|
||||
public String getHandledetail() {
|
||||
return handledetail;
|
||||
}
|
||||
|
||||
public void setHandledetail(String handledetail) {
|
||||
this.handledetail = handledetail;
|
||||
}
|
||||
|
||||
public String getDetailsupplement() {
|
||||
return detailsupplement;
|
||||
}
|
||||
|
||||
public void setDetailsupplement(String detailsupplement) {
|
||||
this.detailsupplement = detailsupplement;
|
||||
}
|
||||
|
||||
public String getHandledt() {
|
||||
return handledt;
|
||||
}
|
||||
|
||||
public void setHandledt(String handledt) {
|
||||
this.handledt = handledt;
|
||||
}
|
||||
|
||||
public String getProcesssectionid() {
|
||||
return processsectionid;
|
||||
}
|
||||
|
||||
public void setProcesssectionid(String processsectionid) {
|
||||
this.processsectionid = processsectionid;
|
||||
}
|
||||
|
||||
public String getEquipmentids() {
|
||||
return equipmentids;
|
||||
}
|
||||
|
||||
public void setEquipmentids(String equipmentids) {
|
||||
this.equipmentids = equipmentids;
|
||||
}
|
||||
|
||||
public String getFaultlibraryid() {
|
||||
return faultlibraryid;
|
||||
}
|
||||
|
||||
public void setFaultlibraryid(String faultlibraryid) {
|
||||
this.faultlibraryid = faultlibraryid;
|
||||
}
|
||||
}
|
||||
449
app/src/main/java/com/sipai/jspatrol/Bean/EquList.java
Normal file
449
app/src/main/java/com/sipai/jspatrol/Bean/EquList.java
Normal file
@ -0,0 +1,449 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
public class EquList implements Serializable {
|
||||
private String areaid;
|
||||
private String assetClass;
|
||||
private String assetclassid;
|
||||
private String assetnumber;
|
||||
private String bizid;
|
||||
private String company;
|
||||
private String currentmanageflag;
|
||||
private String equipmentClass;
|
||||
private String equipmentLevel;
|
||||
private String equipmentPid;
|
||||
private String equipmentSpecification;
|
||||
private String equipmentTypeNumber;
|
||||
private String equipmentcardid;
|
||||
private String equipmentclassid;
|
||||
private String equipmentlevelid;
|
||||
private String equipmentmanufacturer;
|
||||
private String equipmentmodel;
|
||||
private String equipmentname;
|
||||
private String equipmentstatus;
|
||||
private String equipmentvalue;
|
||||
private String geographyarea;
|
||||
private String id;
|
||||
private String insdt;
|
||||
private String insuser;
|
||||
private String leavefactorynumber;
|
||||
private String maintenancecondition;
|
||||
private String majorparameter;
|
||||
private String nowtotaldepreciation;
|
||||
private String pid;
|
||||
private String processSection;
|
||||
private String processsectionid;
|
||||
private String productiondate;
|
||||
private String purchasedate;
|
||||
private String ratedcurrent;
|
||||
private String ratedpower;
|
||||
private String ratedvoltage;
|
||||
private String remark;
|
||||
private String residualvalue;
|
||||
private String responsibledepartment;
|
||||
private String servicephone;
|
||||
private String specification;
|
||||
private String sql;
|
||||
private String supplierid;
|
||||
private String totaltime;
|
||||
private String useage;
|
||||
private String usedate;
|
||||
private String where;
|
||||
private String equipmentStatusManagement;
|
||||
private List<Measuringpoint> measuringpoints;
|
||||
|
||||
public String getEquipmentStatusManagement() {
|
||||
return equipmentStatusManagement;
|
||||
}
|
||||
|
||||
public void setEquipmentStatusManagement(String equipmentStatusManagement) {
|
||||
this.equipmentStatusManagement = equipmentStatusManagement;
|
||||
}
|
||||
|
||||
public String getAreaid() {
|
||||
return areaid;
|
||||
}
|
||||
|
||||
public void setAreaid(String areaid) {
|
||||
this.areaid = areaid;
|
||||
}
|
||||
|
||||
public String getAssetClass() {
|
||||
return assetClass;
|
||||
}
|
||||
|
||||
public void setAssetClass(String assetClass) {
|
||||
this.assetClass = assetClass;
|
||||
}
|
||||
|
||||
public String getAssetclassid() {
|
||||
return assetclassid;
|
||||
}
|
||||
|
||||
public void setAssetclassid(String assetclassid) {
|
||||
this.assetclassid = assetclassid;
|
||||
}
|
||||
|
||||
public String getAssetnumber() {
|
||||
return assetnumber;
|
||||
}
|
||||
|
||||
public void setAssetnumber(String assetnumber) {
|
||||
this.assetnumber = assetnumber;
|
||||
}
|
||||
|
||||
public String getBizid() {
|
||||
return bizid;
|
||||
}
|
||||
|
||||
public void setBizid(String bizid) {
|
||||
this.bizid = bizid;
|
||||
}
|
||||
|
||||
public String getCompany() {
|
||||
return company;
|
||||
}
|
||||
|
||||
public void setCompany(String company) {
|
||||
this.company = company;
|
||||
}
|
||||
|
||||
public String getCurrentmanageflag() {
|
||||
return currentmanageflag;
|
||||
}
|
||||
|
||||
public void setCurrentmanageflag(String currentmanageflag) {
|
||||
this.currentmanageflag = currentmanageflag;
|
||||
}
|
||||
|
||||
public String getEquipmentClass() {
|
||||
return equipmentClass;
|
||||
}
|
||||
|
||||
public void setEquipmentClass(String equipmentClass) {
|
||||
this.equipmentClass = equipmentClass;
|
||||
}
|
||||
|
||||
public String getEquipmentLevel() {
|
||||
return equipmentLevel;
|
||||
}
|
||||
|
||||
public void setEquipmentLevel(String equipmentLevel) {
|
||||
this.equipmentLevel = equipmentLevel;
|
||||
}
|
||||
|
||||
public String getEquipmentPid() {
|
||||
return equipmentPid;
|
||||
}
|
||||
|
||||
public void setEquipmentPid(String equipmentPid) {
|
||||
this.equipmentPid = equipmentPid;
|
||||
}
|
||||
|
||||
public String getEquipmentSpecification() {
|
||||
return equipmentSpecification;
|
||||
}
|
||||
|
||||
public void setEquipmentSpecification(String equipmentSpecification) {
|
||||
this.equipmentSpecification = equipmentSpecification;
|
||||
}
|
||||
|
||||
public String getEquipmentTypeNumber() {
|
||||
return equipmentTypeNumber;
|
||||
}
|
||||
|
||||
public void setEquipmentTypeNumber(String equipmentTypeNumber) {
|
||||
this.equipmentTypeNumber = equipmentTypeNumber;
|
||||
}
|
||||
|
||||
public String getEquipmentcardid() {
|
||||
return equipmentcardid;
|
||||
}
|
||||
|
||||
public void setEquipmentcardid(String equipmentcardid) {
|
||||
this.equipmentcardid = equipmentcardid;
|
||||
}
|
||||
|
||||
public String getEquipmentclassid() {
|
||||
return equipmentclassid;
|
||||
}
|
||||
|
||||
public void setEquipmentclassid(String equipmentclassid) {
|
||||
this.equipmentclassid = equipmentclassid;
|
||||
}
|
||||
|
||||
public String getEquipmentlevelid() {
|
||||
return equipmentlevelid;
|
||||
}
|
||||
|
||||
public void setEquipmentlevelid(String equipmentlevelid) {
|
||||
this.equipmentlevelid = equipmentlevelid;
|
||||
}
|
||||
|
||||
public String getEquipmentmanufacturer() {
|
||||
return equipmentmanufacturer;
|
||||
}
|
||||
|
||||
public void setEquipmentmanufacturer(String equipmentmanufacturer) {
|
||||
this.equipmentmanufacturer = equipmentmanufacturer;
|
||||
}
|
||||
|
||||
public String getEquipmentmodel() {
|
||||
return equipmentmodel;
|
||||
}
|
||||
|
||||
public void setEquipmentmodel(String equipmentmodel) {
|
||||
this.equipmentmodel = equipmentmodel;
|
||||
}
|
||||
|
||||
public String getEquipmentname() {
|
||||
return equipmentname;
|
||||
}
|
||||
|
||||
public void setEquipmentname(String equipmentname) {
|
||||
this.equipmentname = equipmentname;
|
||||
}
|
||||
|
||||
public String getEquipmentstatus() {
|
||||
return equipmentstatus;
|
||||
}
|
||||
|
||||
public void setEquipmentstatus(String equipmentstatus) {
|
||||
this.equipmentstatus = equipmentstatus;
|
||||
}
|
||||
|
||||
public String getEquipmentvalue() {
|
||||
return equipmentvalue;
|
||||
}
|
||||
|
||||
public void setEquipmentvalue(String equipmentvalue) {
|
||||
this.equipmentvalue = equipmentvalue;
|
||||
}
|
||||
|
||||
public String getGeographyarea() {
|
||||
return geographyarea;
|
||||
}
|
||||
|
||||
public void setGeographyarea(String geographyarea) {
|
||||
this.geographyarea = geographyarea;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getInsdt() {
|
||||
return insdt;
|
||||
}
|
||||
|
||||
public void setInsdt(String insdt) {
|
||||
this.insdt = insdt;
|
||||
}
|
||||
|
||||
public String getInsuser() {
|
||||
return insuser;
|
||||
}
|
||||
|
||||
public void setInsuser(String insuser) {
|
||||
this.insuser = insuser;
|
||||
}
|
||||
|
||||
public String getLeavefactorynumber() {
|
||||
return leavefactorynumber;
|
||||
}
|
||||
|
||||
public void setLeavefactorynumber(String leavefactorynumber) {
|
||||
this.leavefactorynumber = leavefactorynumber;
|
||||
}
|
||||
|
||||
public String getMaintenancecondition() {
|
||||
return maintenancecondition;
|
||||
}
|
||||
|
||||
public void setMaintenancecondition(String maintenancecondition) {
|
||||
this.maintenancecondition = maintenancecondition;
|
||||
}
|
||||
|
||||
public String getMajorparameter() {
|
||||
return majorparameter;
|
||||
}
|
||||
|
||||
public void setMajorparameter(String majorparameter) {
|
||||
this.majorparameter = majorparameter;
|
||||
}
|
||||
|
||||
public String getNowtotaldepreciation() {
|
||||
return nowtotaldepreciation;
|
||||
}
|
||||
|
||||
public void setNowtotaldepreciation(String nowtotaldepreciation) {
|
||||
this.nowtotaldepreciation = nowtotaldepreciation;
|
||||
}
|
||||
|
||||
public String getPid() {
|
||||
return pid;
|
||||
}
|
||||
|
||||
public void setPid(String pid) {
|
||||
this.pid = pid;
|
||||
}
|
||||
|
||||
public String getProcessSection() {
|
||||
return processSection;
|
||||
}
|
||||
|
||||
public void setProcessSection(String processSection) {
|
||||
this.processSection = processSection;
|
||||
}
|
||||
|
||||
public String getProcesssectionid() {
|
||||
return processsectionid;
|
||||
}
|
||||
|
||||
public void setProcesssectionid(String processsectionid) {
|
||||
this.processsectionid = processsectionid;
|
||||
}
|
||||
|
||||
public String getProductiondate() {
|
||||
return productiondate;
|
||||
}
|
||||
|
||||
public void setProductiondate(String productiondate) {
|
||||
this.productiondate = productiondate;
|
||||
}
|
||||
|
||||
public String getPurchasedate() {
|
||||
return purchasedate;
|
||||
}
|
||||
|
||||
public void setPurchasedate(String purchasedate) {
|
||||
this.purchasedate = purchasedate;
|
||||
}
|
||||
|
||||
public String getRatedcurrent() {
|
||||
return ratedcurrent;
|
||||
}
|
||||
|
||||
public void setRatedcurrent(String ratedcurrent) {
|
||||
this.ratedcurrent = ratedcurrent;
|
||||
}
|
||||
|
||||
public String getRatedpower() {
|
||||
return ratedpower;
|
||||
}
|
||||
|
||||
public void setRatedpower(String ratedpower) {
|
||||
this.ratedpower = ratedpower;
|
||||
}
|
||||
|
||||
public String getRatedvoltage() {
|
||||
return ratedvoltage;
|
||||
}
|
||||
|
||||
public void setRatedvoltage(String ratedvoltage) {
|
||||
this.ratedvoltage = ratedvoltage;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getResidualvalue() {
|
||||
return residualvalue;
|
||||
}
|
||||
|
||||
public void setResidualvalue(String residualvalue) {
|
||||
this.residualvalue = residualvalue;
|
||||
}
|
||||
|
||||
public String getResponsibledepartment() {
|
||||
return responsibledepartment;
|
||||
}
|
||||
|
||||
public void setResponsibledepartment(String responsibledepartment) {
|
||||
this.responsibledepartment = responsibledepartment;
|
||||
}
|
||||
|
||||
public String getServicephone() {
|
||||
return servicephone;
|
||||
}
|
||||
|
||||
public void setServicephone(String servicephone) {
|
||||
this.servicephone = servicephone;
|
||||
}
|
||||
|
||||
public String getSpecification() {
|
||||
return specification;
|
||||
}
|
||||
|
||||
public void setSpecification(String specification) {
|
||||
this.specification = specification;
|
||||
}
|
||||
|
||||
public String getSql() {
|
||||
return sql;
|
||||
}
|
||||
|
||||
public void setSql(String sql) {
|
||||
this.sql = sql;
|
||||
}
|
||||
|
||||
public String getSupplierid() {
|
||||
return supplierid;
|
||||
}
|
||||
|
||||
public void setSupplierid(String supplierid) {
|
||||
this.supplierid = supplierid;
|
||||
}
|
||||
|
||||
public String getTotaltime() {
|
||||
return totaltime;
|
||||
}
|
||||
|
||||
public void setTotaltime(String totaltime) {
|
||||
this.totaltime = totaltime;
|
||||
}
|
||||
|
||||
public String getUseage() {
|
||||
return useage;
|
||||
}
|
||||
|
||||
public void setUseage(String useage) {
|
||||
this.useage = useage;
|
||||
}
|
||||
|
||||
public String getUsedate() {
|
||||
return usedate;
|
||||
}
|
||||
|
||||
public void setUsedate(String usedate) {
|
||||
this.usedate = usedate;
|
||||
}
|
||||
|
||||
public String getWhere() {
|
||||
return where;
|
||||
}
|
||||
|
||||
public void setWhere(String where) {
|
||||
this.where = where;
|
||||
}
|
||||
|
||||
public List<Measuringpoint> getMeasuringpoints() {
|
||||
return measuringpoints;
|
||||
}
|
||||
|
||||
public void setMeasuringpoints(List<Measuringpoint> measuringpoints) {
|
||||
this.measuringpoints = measuringpoints;
|
||||
}
|
||||
}
|
||||
505
app/src/main/java/com/sipai/jspatrol/Bean/Fault.java
Normal file
505
app/src/main/java/com/sipai/jspatrol/Bean/Fault.java
Normal file
@ -0,0 +1,505 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Created by lvliming on 2019/2/26.
|
||||
*/
|
||||
|
||||
public class Fault implements Serializable{
|
||||
private String abnormityDescription;
|
||||
private String bizId;
|
||||
private Biz biz;
|
||||
private String equipmentIds;
|
||||
private String equipmentNames;
|
||||
private String remark;
|
||||
private String sumitMan;
|
||||
private String actualFinishDate;
|
||||
private int actualMoney;
|
||||
private String assistantedid;
|
||||
private String changeParts;
|
||||
private String company;
|
||||
private String companyid;
|
||||
private String contactids;
|
||||
private String defectLevel;
|
||||
private String delayReason;
|
||||
private String detailNumber;
|
||||
private EquList equipmentCard;
|
||||
private String equipmentId;
|
||||
private String id;
|
||||
private String insdt;
|
||||
private String insuser;
|
||||
private int judgemaintainerstaff;
|
||||
private int judgeresult;
|
||||
private String maintainerid;
|
||||
private String maintainplanid;
|
||||
private String maintenance;
|
||||
private String maintenanceMan;
|
||||
private String maintenanceWay;
|
||||
private String maintenanceid;
|
||||
private int planConsumeTime;
|
||||
private String planMoney;
|
||||
private String plannedenddt;
|
||||
private String problemcontent;
|
||||
private String problemresult;
|
||||
private String problemtypeid;
|
||||
private String problemTypeNames;
|
||||
private ProcessSection processSection;
|
||||
private String processSectionId;
|
||||
private String processdefid;
|
||||
private String processid;
|
||||
private String solver;
|
||||
private String solvetime;
|
||||
private String sql;
|
||||
private String startDate;
|
||||
private String status;
|
||||
private String submittime;
|
||||
private String type;
|
||||
private String where;
|
||||
private String todoTask;
|
||||
private String taskId;
|
||||
private String equipmentOpinion;
|
||||
private String processInstanceId;
|
||||
private String materialOpinion;
|
||||
private String qualityOpinion;
|
||||
|
||||
public String getProcessInstanceId() {
|
||||
return processInstanceId;
|
||||
}
|
||||
|
||||
public void setProcessInstanceId(String processInstanceId) {
|
||||
this.processInstanceId = processInstanceId;
|
||||
}
|
||||
|
||||
public String getTaskId() {
|
||||
return taskId;
|
||||
}
|
||||
|
||||
public void setTaskId(String taskId) {
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
||||
public String getTodoTask() {
|
||||
return todoTask;
|
||||
}
|
||||
|
||||
public void setTodoTask(String todoTask) {
|
||||
this.todoTask = todoTask;
|
||||
}
|
||||
|
||||
public String getProblemTypeNames() {
|
||||
return problemTypeNames;
|
||||
}
|
||||
|
||||
public void setProblemTypeNames(String problemTypeNames) {
|
||||
this.problemTypeNames = problemTypeNames;
|
||||
}
|
||||
|
||||
public String getAbnormityDescription() {
|
||||
return abnormityDescription;
|
||||
}
|
||||
|
||||
public void setAbnormityDescription(String abnormityDescription) {
|
||||
this.abnormityDescription = abnormityDescription;
|
||||
}
|
||||
|
||||
public String getBizId() {
|
||||
return bizId;
|
||||
}
|
||||
|
||||
public void setBizId(String bizId) {
|
||||
this.bizId = bizId;
|
||||
}
|
||||
|
||||
public Biz getBiz() {
|
||||
return biz;
|
||||
}
|
||||
|
||||
public void setBiz(Biz biz) {
|
||||
this.biz = biz;
|
||||
}
|
||||
|
||||
public String getEquipmentIds() {
|
||||
return equipmentIds;
|
||||
}
|
||||
|
||||
public void setEquipmentIds(String equipmentIds) {
|
||||
this.equipmentIds = equipmentIds;
|
||||
}
|
||||
|
||||
public String getEquipmentNames() {
|
||||
return equipmentNames;
|
||||
}
|
||||
|
||||
public void setEquipmentNames(String equipmentNames) {
|
||||
this.equipmentNames = equipmentNames;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getSumitMan() {
|
||||
return sumitMan;
|
||||
}
|
||||
|
||||
public void setSumitMan(String sumitMan) {
|
||||
this.sumitMan = sumitMan;
|
||||
}
|
||||
|
||||
public String getActualFinishDate() {
|
||||
return actualFinishDate;
|
||||
}
|
||||
|
||||
public void setActualFinishDate(String actualFinishDate) {
|
||||
this.actualFinishDate = actualFinishDate;
|
||||
}
|
||||
|
||||
public int getActualMoney() {
|
||||
return actualMoney;
|
||||
}
|
||||
|
||||
public void setActualMoney(int actualMoney) {
|
||||
this.actualMoney = actualMoney;
|
||||
}
|
||||
|
||||
public String getAssistantedid() {
|
||||
return assistantedid;
|
||||
}
|
||||
|
||||
public void setAssistantedid(String assistantedid) {
|
||||
this.assistantedid = assistantedid;
|
||||
}
|
||||
|
||||
public String getChangeParts() {
|
||||
return changeParts;
|
||||
}
|
||||
|
||||
public void setChangeParts(String changeParts) {
|
||||
this.changeParts = changeParts;
|
||||
}
|
||||
|
||||
public String getCompany() {
|
||||
return company;
|
||||
}
|
||||
|
||||
public void setCompany(String company) {
|
||||
this.company = company;
|
||||
}
|
||||
|
||||
public String getCompanyid() {
|
||||
return companyid;
|
||||
}
|
||||
|
||||
public void setCompanyid(String companyid) {
|
||||
this.companyid = companyid;
|
||||
}
|
||||
|
||||
public String getContactids() {
|
||||
return contactids;
|
||||
}
|
||||
|
||||
public void setContactids(String contactids) {
|
||||
this.contactids = contactids;
|
||||
}
|
||||
|
||||
public String getDefectLevel() {
|
||||
return defectLevel;
|
||||
}
|
||||
|
||||
public void setDefectLevel(String defectLevel) {
|
||||
this.defectLevel = defectLevel;
|
||||
}
|
||||
|
||||
public String getDelayReason() {
|
||||
return delayReason;
|
||||
}
|
||||
|
||||
public void setDelayReason(String delayReason) {
|
||||
this.delayReason = delayReason;
|
||||
}
|
||||
|
||||
public String getDetailNumber() {
|
||||
return detailNumber;
|
||||
}
|
||||
|
||||
public void setDetailNumber(String detailNumber) {
|
||||
this.detailNumber = detailNumber;
|
||||
}
|
||||
|
||||
public EquList getEquipmentCard() {
|
||||
return equipmentCard;
|
||||
}
|
||||
|
||||
public void setEquipmentCard(EquList equipmentCard) {
|
||||
this.equipmentCard = equipmentCard;
|
||||
}
|
||||
|
||||
public String getEquipmentId() {
|
||||
return equipmentId;
|
||||
}
|
||||
|
||||
public void setEquipmentId(String equipmentId) {
|
||||
this.equipmentId = equipmentId;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getInsdt() {
|
||||
return insdt;
|
||||
}
|
||||
|
||||
public void setInsdt(String insdt) {
|
||||
this.insdt = insdt;
|
||||
}
|
||||
|
||||
public String getInsuser() {
|
||||
return insuser;
|
||||
}
|
||||
|
||||
public void setInsuser(String insuser) {
|
||||
this.insuser = insuser;
|
||||
}
|
||||
|
||||
public int getJudgemaintainerstaff() {
|
||||
return judgemaintainerstaff;
|
||||
}
|
||||
|
||||
public void setJudgemaintainerstaff(int judgemaintainerstaff) {
|
||||
this.judgemaintainerstaff = judgemaintainerstaff;
|
||||
}
|
||||
|
||||
public int getJudgeresult() {
|
||||
return judgeresult;
|
||||
}
|
||||
|
||||
public void setJudgeresult(int judgeresult) {
|
||||
this.judgeresult = judgeresult;
|
||||
}
|
||||
|
||||
public String getMaintainerid() {
|
||||
return maintainerid;
|
||||
}
|
||||
|
||||
public void setMaintainerid(String maintainerid) {
|
||||
this.maintainerid = maintainerid;
|
||||
}
|
||||
|
||||
public String getMaintainplanid() {
|
||||
return maintainplanid;
|
||||
}
|
||||
|
||||
public void setMaintainplanid(String maintainplanid) {
|
||||
this.maintainplanid = maintainplanid;
|
||||
}
|
||||
|
||||
public String getMaintenance() {
|
||||
return maintenance;
|
||||
}
|
||||
|
||||
public void setMaintenance(String maintenance) {
|
||||
this.maintenance = maintenance;
|
||||
}
|
||||
|
||||
public String getMaintenanceMan() {
|
||||
return maintenanceMan;
|
||||
}
|
||||
|
||||
public void setMaintenanceMan(String maintenanceMan) {
|
||||
this.maintenanceMan = maintenanceMan;
|
||||
}
|
||||
|
||||
public String getMaintenanceWay() {
|
||||
return maintenanceWay;
|
||||
}
|
||||
|
||||
public void setMaintenanceWay(String maintenanceWay) {
|
||||
this.maintenanceWay = maintenanceWay;
|
||||
}
|
||||
|
||||
public String getMaintenanceid() {
|
||||
return maintenanceid;
|
||||
}
|
||||
|
||||
public void setMaintenanceid(String maintenanceid) {
|
||||
this.maintenanceid = maintenanceid;
|
||||
}
|
||||
|
||||
public int getPlanConsumeTime() {
|
||||
return planConsumeTime;
|
||||
}
|
||||
|
||||
public void setPlanConsumeTime(int planConsumeTime) {
|
||||
this.planConsumeTime = planConsumeTime;
|
||||
}
|
||||
|
||||
public String getPlanMoney() {
|
||||
return planMoney;
|
||||
}
|
||||
|
||||
public void setPlanMoney(String planMoney) {
|
||||
this.planMoney = planMoney;
|
||||
}
|
||||
|
||||
public String getPlannedenddt() {
|
||||
return plannedenddt;
|
||||
}
|
||||
|
||||
public void setPlannedenddt(String plannedenddt) {
|
||||
this.plannedenddt = plannedenddt;
|
||||
}
|
||||
|
||||
public String getProblemcontent() {
|
||||
return problemcontent;
|
||||
}
|
||||
|
||||
public void setProblemcontent(String problemcontent) {
|
||||
this.problemcontent = problemcontent;
|
||||
}
|
||||
|
||||
public String getProblemresult() {
|
||||
return problemresult;
|
||||
}
|
||||
|
||||
public void setProblemresult(String problemresult) {
|
||||
this.problemresult = problemresult;
|
||||
}
|
||||
|
||||
public String getProblemtypeid() {
|
||||
return problemtypeid;
|
||||
}
|
||||
|
||||
public void setProblemtypeid(String problemtypeid) {
|
||||
this.problemtypeid = problemtypeid;
|
||||
}
|
||||
|
||||
public ProcessSection getProcessSection() {
|
||||
return processSection;
|
||||
}
|
||||
|
||||
public void setProcessSection(ProcessSection processSection) {
|
||||
this.processSection = processSection;
|
||||
}
|
||||
|
||||
public String getProcessSectionId() {
|
||||
return processSectionId;
|
||||
}
|
||||
|
||||
public void setProcessSectionId(String processSectionId) {
|
||||
this.processSectionId = processSectionId;
|
||||
}
|
||||
|
||||
public String getProcessdefid() {
|
||||
return processdefid;
|
||||
}
|
||||
|
||||
public void setProcessdefid(String processdefid) {
|
||||
this.processdefid = processdefid;
|
||||
}
|
||||
|
||||
public String getProcessid() {
|
||||
return processid;
|
||||
}
|
||||
|
||||
public void setProcessid(String processid) {
|
||||
this.processid = processid;
|
||||
}
|
||||
|
||||
public String getSolver() {
|
||||
return solver;
|
||||
}
|
||||
|
||||
public void setSolver(String solver) {
|
||||
this.solver = solver;
|
||||
}
|
||||
|
||||
public String getSolvetime() {
|
||||
return solvetime;
|
||||
}
|
||||
|
||||
public void setSolvetime(String solvetime) {
|
||||
this.solvetime = solvetime;
|
||||
}
|
||||
|
||||
public String getSql() {
|
||||
return sql;
|
||||
}
|
||||
|
||||
public void setSql(String sql) {
|
||||
this.sql = sql;
|
||||
}
|
||||
|
||||
public String getStartDate() {
|
||||
return startDate;
|
||||
}
|
||||
|
||||
public void setStartDate(String startDate) {
|
||||
this.startDate = startDate;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getSubmittime() {
|
||||
return submittime;
|
||||
}
|
||||
|
||||
public void setSubmittime(String submittime) {
|
||||
this.submittime = submittime;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getWhere() {
|
||||
return where;
|
||||
}
|
||||
|
||||
public void setWhere(String where) {
|
||||
this.where = where;
|
||||
}
|
||||
|
||||
public String getMaterialOpinion() {
|
||||
return materialOpinion;
|
||||
}
|
||||
|
||||
public void setMaterialOpinion(String materialOpinion) {
|
||||
this.materialOpinion = materialOpinion;
|
||||
}
|
||||
|
||||
public String getQualityOpinion() {
|
||||
return qualityOpinion;
|
||||
}
|
||||
|
||||
public void setQualityOpinion(String qualityOpinion) {
|
||||
this.qualityOpinion = qualityOpinion;
|
||||
}
|
||||
|
||||
public String getEquipmentOpinion() {
|
||||
return equipmentOpinion;
|
||||
}
|
||||
|
||||
public void setEquipmentOpinion(String equipmentOpinion) {
|
||||
this.equipmentOpinion = equipmentOpinion;
|
||||
}
|
||||
}
|
||||
70
app/src/main/java/com/sipai/jspatrol/Bean/FaultFlow.java
Normal file
70
app/src/main/java/com/sipai/jspatrol/Bean/FaultFlow.java
Normal file
@ -0,0 +1,70 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2020/12/14
|
||||
*/
|
||||
public class FaultFlow {
|
||||
private String id;
|
||||
private String files;
|
||||
private String processid;
|
||||
private String record;
|
||||
private String taskName;
|
||||
private String insdt;
|
||||
private User user;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getFiles() {
|
||||
return files;
|
||||
}
|
||||
|
||||
public void setFiles(String files) {
|
||||
this.files = files;
|
||||
}
|
||||
|
||||
public String getProcessid() {
|
||||
return processid;
|
||||
}
|
||||
|
||||
public void setProcessid(String processid) {
|
||||
this.processid = processid;
|
||||
}
|
||||
|
||||
public String getRecord() {
|
||||
return record;
|
||||
}
|
||||
|
||||
public void setRecord(String record) {
|
||||
this.record = record;
|
||||
}
|
||||
|
||||
public String getTaskName() {
|
||||
return taskName;
|
||||
}
|
||||
|
||||
public void setTaskName(String taskName) {
|
||||
this.taskName = taskName;
|
||||
}
|
||||
|
||||
public User getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public String getInsdt() {
|
||||
return insdt;
|
||||
}
|
||||
|
||||
public void setInsdt(String insdt) {
|
||||
this.insdt = insdt;
|
||||
}
|
||||
}
|
||||
27
app/src/main/java/com/sipai/jspatrol/Bean/FileForDL.java
Normal file
27
app/src/main/java/com/sipai/jspatrol/Bean/FileForDL.java
Normal file
@ -0,0 +1,27 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2019/12/28
|
||||
*/
|
||||
public class FileForDL implements Serializable {
|
||||
private String id;
|
||||
private String name;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
26
app/src/main/java/com/sipai/jspatrol/Bean/InfoSel.java
Normal file
26
app/src/main/java/com/sipai/jspatrol/Bean/InfoSel.java
Normal file
@ -0,0 +1,26 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2019/7/10
|
||||
*/
|
||||
public class InfoSel implements Serializable {
|
||||
private String id,text;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
public void setText(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
}
|
||||
211
app/src/main/java/com/sipai/jspatrol/Bean/InputPoint.java
Normal file
211
app/src/main/java/com/sipai/jspatrol/Bean/InputPoint.java
Normal file
@ -0,0 +1,211 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
import com.sipai.jspatrol.Patrol.patrolInfoAdapter.PatrolEqu;
|
||||
|
||||
import org.litepal.crud.LitePalSupport;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2019/8/12
|
||||
*/
|
||||
public class InputPoint extends LitePalSupport implements Serializable {
|
||||
private String alarmmax;
|
||||
private String alarmmin;
|
||||
private String biztype;
|
||||
private String sid;
|
||||
private String measuredt;
|
||||
private String mpointcode;
|
||||
private String parmname;
|
||||
private String parmvalue;
|
||||
private int sel;
|
||||
private String signalType;
|
||||
private String sql;
|
||||
private String unit;
|
||||
private String valuemeaning;
|
||||
private String where;
|
||||
private String pid;
|
||||
private String type;
|
||||
private String patrolPointId;
|
||||
private String patrolRecordId;
|
||||
private String equipmentId;
|
||||
private String finishDt;
|
||||
private ProPatrolPoint proPatrolPoint;
|
||||
private PatrolEqu patrolEqu;
|
||||
|
||||
public String getPid() {
|
||||
return pid;
|
||||
}
|
||||
|
||||
public void setPid(String pid) {
|
||||
this.pid = pid;
|
||||
}
|
||||
|
||||
public int getSel() {
|
||||
return sel;
|
||||
}
|
||||
|
||||
public void setSel(int sel) {
|
||||
this.sel = sel;
|
||||
}
|
||||
|
||||
public String getValuemeaning() {
|
||||
return valuemeaning;
|
||||
}
|
||||
|
||||
public void setValuemeaning(String valuemeaning) {
|
||||
this.valuemeaning = valuemeaning;
|
||||
}
|
||||
|
||||
public String getBiztype() {
|
||||
return biztype;
|
||||
}
|
||||
|
||||
public void setBiztype(String biztype) {
|
||||
this.biztype = biztype;
|
||||
}
|
||||
|
||||
public String getMpointcode() {
|
||||
return mpointcode;
|
||||
}
|
||||
|
||||
public void setMpointcode(String mpointcode) {
|
||||
this.mpointcode = mpointcode;
|
||||
}
|
||||
|
||||
public String getAlarmmax() {
|
||||
return alarmmax;
|
||||
}
|
||||
|
||||
public void setAlarmmax(String alarmmax) {
|
||||
this.alarmmax = alarmmax;
|
||||
}
|
||||
|
||||
public String getAlarmmin() {
|
||||
return alarmmin;
|
||||
}
|
||||
|
||||
public void setAlarmmin(String alarmmin) {
|
||||
this.alarmmin = alarmmin;
|
||||
}
|
||||
|
||||
public String getSid() {
|
||||
return sid;
|
||||
}
|
||||
|
||||
public void setSid(String sid) {
|
||||
this.sid = sid;
|
||||
}
|
||||
|
||||
public String getMeasuredt() {
|
||||
return measuredt;
|
||||
}
|
||||
|
||||
public void setMeasuredt(String measuredt) {
|
||||
this.measuredt = measuredt;
|
||||
}
|
||||
|
||||
public String getParmname() {
|
||||
return parmname;
|
||||
}
|
||||
|
||||
public void setParmname(String parmname) {
|
||||
this.parmname = parmname;
|
||||
}
|
||||
|
||||
public String getParmvalue() {
|
||||
return parmvalue;
|
||||
}
|
||||
|
||||
public void setParmvalue(String parmvalue) {
|
||||
this.parmvalue = parmvalue;
|
||||
}
|
||||
|
||||
public String getSignalType() {
|
||||
return signalType;
|
||||
}
|
||||
|
||||
public void setSignalType(String signalType) {
|
||||
this.signalType = signalType;
|
||||
}
|
||||
|
||||
public String getSql() {
|
||||
return sql;
|
||||
}
|
||||
|
||||
public void setSql(String sql) {
|
||||
this.sql = sql;
|
||||
}
|
||||
|
||||
public String getUnit() {
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setUnit(String unit) {
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getPatrolPointId() {
|
||||
return patrolPointId;
|
||||
}
|
||||
|
||||
public void setPatrolPointId(String patrolPointId) {
|
||||
this.patrolPointId = patrolPointId;
|
||||
}
|
||||
|
||||
public String getPatrolRecordId() {
|
||||
return patrolRecordId;
|
||||
}
|
||||
|
||||
public void setPatrolRecordId(String patrolRecordId) {
|
||||
this.patrolRecordId = patrolRecordId;
|
||||
}
|
||||
|
||||
public String getEquipmentId() {
|
||||
return equipmentId;
|
||||
}
|
||||
|
||||
public void setEquipmentId(String equipmentId) {
|
||||
this.equipmentId = equipmentId;
|
||||
}
|
||||
|
||||
public String getFinishDt() {
|
||||
return finishDt;
|
||||
}
|
||||
|
||||
public void setFinishDt(String finishDt) {
|
||||
this.finishDt = finishDt;
|
||||
}
|
||||
|
||||
public String getWhere() {
|
||||
return where;
|
||||
}
|
||||
|
||||
public void setWhere(String where) {
|
||||
this.where = where;
|
||||
}
|
||||
|
||||
public ProPatrolPoint getProPatrolPoint() {
|
||||
return proPatrolPoint;
|
||||
}
|
||||
|
||||
public void setProPatrolPoint(ProPatrolPoint proPatrolPoint) {
|
||||
this.proPatrolPoint = proPatrolPoint;
|
||||
}
|
||||
|
||||
public PatrolEqu getPatrolEqu() {
|
||||
return patrolEqu;
|
||||
}
|
||||
|
||||
public void setPatrolEqu(PatrolEqu patrolEqu) {
|
||||
this.patrolEqu = patrolEqu;
|
||||
}
|
||||
}
|
||||
43
app/src/main/java/com/sipai/jspatrol/Bean/LoginInfo.java
Normal file
43
app/src/main/java/com/sipai/jspatrol/Bean/LoginInfo.java
Normal file
@ -0,0 +1,43 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2020/3/23
|
||||
*/
|
||||
public class LoginInfo extends BaseEntity {
|
||||
private User user;
|
||||
private String reason;
|
||||
private boolean status;
|
||||
|
||||
public LoginInfo() {
|
||||
}
|
||||
|
||||
public LoginInfo(User user, String reason, boolean status) {
|
||||
this.user = user;
|
||||
this.reason = reason;
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public User getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public String getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
public void setReason(String reason) {
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
public boolean isStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(boolean status) {
|
||||
this.status = status;
|
||||
}
|
||||
}
|
||||
34
app/src/main/java/com/sipai/jspatrol/Bean/MainTab.java
Normal file
34
app/src/main/java/com/sipai/jspatrol/Bean/MainTab.java
Normal file
@ -0,0 +1,34 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2020/11/3
|
||||
*/
|
||||
public class MainTab {
|
||||
private String id;
|
||||
private String name;
|
||||
private String sname;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getSname() {
|
||||
return sname;
|
||||
}
|
||||
|
||||
public void setSname(String sname) {
|
||||
this.sname = sname;
|
||||
}
|
||||
}
|
||||
181
app/src/main/java/com/sipai/jspatrol/Bean/Maintenance.java
Normal file
181
app/src/main/java/com/sipai/jspatrol/Bean/Maintenance.java
Normal file
@ -0,0 +1,181 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Created by lvliming on 2019/3/28.
|
||||
*/
|
||||
|
||||
public class Maintenance implements Serializable {
|
||||
private String detailsupplement;
|
||||
private String equipmentNames;
|
||||
private String equipmentids;
|
||||
private String faultLibraryName;
|
||||
private String faultlibraryid;
|
||||
private String handledetail;
|
||||
private String handledt;
|
||||
private String id;
|
||||
private String insdt;
|
||||
private String insuser;
|
||||
private String insuserName;
|
||||
private MaintenanceDetail maintenanceDetail;
|
||||
private String maintenancedetailid;
|
||||
private String problem;
|
||||
private String processSectionName;
|
||||
private String processsectionid;
|
||||
private String sql;
|
||||
private String taskdefinitionkey;
|
||||
private String where;
|
||||
|
||||
public String getDetailsupplement() {
|
||||
return detailsupplement;
|
||||
}
|
||||
|
||||
public void setDetailsupplement(String detailsupplement) {
|
||||
this.detailsupplement = detailsupplement;
|
||||
}
|
||||
|
||||
public String getEquipmentNames() {
|
||||
return equipmentNames;
|
||||
}
|
||||
|
||||
public void setEquipmentNames(String equipmentNames) {
|
||||
this.equipmentNames = equipmentNames;
|
||||
}
|
||||
|
||||
public String getEquipmentids() {
|
||||
return equipmentids;
|
||||
}
|
||||
|
||||
public void setEquipmentids(String equipmentids) {
|
||||
this.equipmentids = equipmentids;
|
||||
}
|
||||
|
||||
public String getFaultLibraryName() {
|
||||
return faultLibraryName;
|
||||
}
|
||||
|
||||
public void setFaultLibraryName(String faultLibraryName) {
|
||||
this.faultLibraryName = faultLibraryName;
|
||||
}
|
||||
|
||||
public String getFaultlibraryid() {
|
||||
return faultlibraryid;
|
||||
}
|
||||
|
||||
public void setFaultlibraryid(String faultlibraryid) {
|
||||
this.faultlibraryid = faultlibraryid;
|
||||
}
|
||||
|
||||
public String getHandledetail() {
|
||||
return handledetail;
|
||||
}
|
||||
|
||||
public void setHandledetail(String handledetail) {
|
||||
this.handledetail = handledetail;
|
||||
}
|
||||
|
||||
public String getHandledt() {
|
||||
return handledt;
|
||||
}
|
||||
|
||||
public void setHandledt(String handledt) {
|
||||
this.handledt = handledt;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getInsdt() {
|
||||
return insdt;
|
||||
}
|
||||
|
||||
public void setInsdt(String insdt) {
|
||||
this.insdt = insdt;
|
||||
}
|
||||
|
||||
public String getInsuser() {
|
||||
return insuser;
|
||||
}
|
||||
|
||||
public void setInsuser(String insuser) {
|
||||
this.insuser = insuser;
|
||||
}
|
||||
|
||||
public String getInsuserName() {
|
||||
return insuserName;
|
||||
}
|
||||
|
||||
public void setInsuserName(String insuserName) {
|
||||
this.insuserName = insuserName;
|
||||
}
|
||||
|
||||
public MaintenanceDetail getMaintenanceDetail() {
|
||||
return maintenanceDetail;
|
||||
}
|
||||
|
||||
public void setMaintenanceDetail(MaintenanceDetail maintenanceDetail) {
|
||||
this.maintenanceDetail = maintenanceDetail;
|
||||
}
|
||||
|
||||
public String getMaintenancedetailid() {
|
||||
return maintenancedetailid;
|
||||
}
|
||||
|
||||
public void setMaintenancedetailid(String maintenancedetailid) {
|
||||
this.maintenancedetailid = maintenancedetailid;
|
||||
}
|
||||
|
||||
public String getProblem() {
|
||||
return problem;
|
||||
}
|
||||
|
||||
public void setProblem(String problem) {
|
||||
this.problem = problem;
|
||||
}
|
||||
|
||||
public String getProcessSectionName() {
|
||||
return processSectionName;
|
||||
}
|
||||
|
||||
public void setProcessSectionName(String processSectionName) {
|
||||
this.processSectionName = processSectionName;
|
||||
}
|
||||
|
||||
public String getProcesssectionid() {
|
||||
return processsectionid;
|
||||
}
|
||||
|
||||
public void setProcesssectionid(String processsectionid) {
|
||||
this.processsectionid = processsectionid;
|
||||
}
|
||||
|
||||
public String getSql() {
|
||||
return sql;
|
||||
}
|
||||
|
||||
public void setSql(String sql) {
|
||||
this.sql = sql;
|
||||
}
|
||||
|
||||
public String getTaskdefinitionkey() {
|
||||
return taskdefinitionkey;
|
||||
}
|
||||
|
||||
public void setTaskdefinitionkey(String taskdefinitionkey) {
|
||||
this.taskdefinitionkey = taskdefinitionkey;
|
||||
}
|
||||
|
||||
public String getWhere() {
|
||||
return where;
|
||||
}
|
||||
|
||||
public void setWhere(String where) {
|
||||
this.where = where;
|
||||
}
|
||||
}
|
||||
397
app/src/main/java/com/sipai/jspatrol/Bean/MaintenanceDetail.java
Normal file
397
app/src/main/java/com/sipai/jspatrol/Bean/MaintenanceDetail.java
Normal file
@ -0,0 +1,397 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Created by lvliming on 2019/3/28.
|
||||
*/
|
||||
|
||||
public class MaintenanceDetail implements Serializable {
|
||||
private String actualFinishDate;
|
||||
private int actualMoney;
|
||||
private String assistantedid;
|
||||
private String changeParts;
|
||||
private Biz company;
|
||||
private String companyid;
|
||||
private String contactids;
|
||||
private String defectLevel;
|
||||
private String delayReason;
|
||||
private String detailNumber;
|
||||
private String equipmentCard;
|
||||
private String equipmentId;
|
||||
private String id;
|
||||
private String insdt;
|
||||
private String insertUser;
|
||||
private String insuser;
|
||||
private int judgemaintainerstaff;
|
||||
private int judgeresult;
|
||||
private String maintainerid;
|
||||
private String maintainplanid;
|
||||
private String maintenance;
|
||||
private String maintenanceMan;
|
||||
private String maintenanceWay;
|
||||
private String maintenanceid;
|
||||
private int planConsumeTime;
|
||||
private int planMoney;
|
||||
private String plannedenddt;
|
||||
private String problemTypeNames;
|
||||
private String problemcontent;
|
||||
private String problemresult;
|
||||
private String problemtypeid;
|
||||
private String processSection;
|
||||
private String processSectionId;
|
||||
private String processdefid;
|
||||
private String processid;
|
||||
private String solver;
|
||||
private String solvetime;
|
||||
private String sql;
|
||||
private String startDate;
|
||||
private String status;
|
||||
private String submittime;
|
||||
private String type;
|
||||
private String where;
|
||||
|
||||
public String getActualFinishDate() {
|
||||
return actualFinishDate;
|
||||
}
|
||||
|
||||
public void setActualFinishDate(String actualFinishDate) {
|
||||
this.actualFinishDate = actualFinishDate;
|
||||
}
|
||||
|
||||
public int getActualMoney() {
|
||||
return actualMoney;
|
||||
}
|
||||
|
||||
public void setActualMoney(int actualMoney) {
|
||||
this.actualMoney = actualMoney;
|
||||
}
|
||||
|
||||
public String getAssistantedid() {
|
||||
return assistantedid;
|
||||
}
|
||||
|
||||
public void setAssistantedid(String assistantedid) {
|
||||
this.assistantedid = assistantedid;
|
||||
}
|
||||
|
||||
public String getChangeParts() {
|
||||
return changeParts;
|
||||
}
|
||||
|
||||
public void setChangeParts(String changeParts) {
|
||||
this.changeParts = changeParts;
|
||||
}
|
||||
|
||||
public Biz getCompany() {
|
||||
return company;
|
||||
}
|
||||
|
||||
public void setCompany(Biz company) {
|
||||
this.company = company;
|
||||
}
|
||||
|
||||
public String getCompanyid() {
|
||||
return companyid;
|
||||
}
|
||||
|
||||
public void setCompanyid(String companyid) {
|
||||
this.companyid = companyid;
|
||||
}
|
||||
|
||||
public String getContactids() {
|
||||
return contactids;
|
||||
}
|
||||
|
||||
public void setContactids(String contactids) {
|
||||
this.contactids = contactids;
|
||||
}
|
||||
|
||||
public String getDefectLevel() {
|
||||
return defectLevel;
|
||||
}
|
||||
|
||||
public void setDefectLevel(String defectLevel) {
|
||||
this.defectLevel = defectLevel;
|
||||
}
|
||||
|
||||
public String getDelayReason() {
|
||||
return delayReason;
|
||||
}
|
||||
|
||||
public void setDelayReason(String delayReason) {
|
||||
this.delayReason = delayReason;
|
||||
}
|
||||
|
||||
public String getDetailNumber() {
|
||||
return detailNumber;
|
||||
}
|
||||
|
||||
public void setDetailNumber(String detailNumber) {
|
||||
this.detailNumber = detailNumber;
|
||||
}
|
||||
|
||||
public String getEquipmentCard() {
|
||||
return equipmentCard;
|
||||
}
|
||||
|
||||
public void setEquipmentCard(String equipmentCard) {
|
||||
this.equipmentCard = equipmentCard;
|
||||
}
|
||||
|
||||
public String getEquipmentId() {
|
||||
return equipmentId;
|
||||
}
|
||||
|
||||
public void setEquipmentId(String equipmentId) {
|
||||
this.equipmentId = equipmentId;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getInsdt() {
|
||||
return insdt;
|
||||
}
|
||||
|
||||
public void setInsdt(String insdt) {
|
||||
this.insdt = insdt;
|
||||
}
|
||||
|
||||
public String getInsertUser() {
|
||||
return insertUser;
|
||||
}
|
||||
|
||||
public void setInsertUser(String insertUser) {
|
||||
this.insertUser = insertUser;
|
||||
}
|
||||
|
||||
public String getInsuser() {
|
||||
return insuser;
|
||||
}
|
||||
|
||||
public void setInsuser(String insuser) {
|
||||
this.insuser = insuser;
|
||||
}
|
||||
|
||||
public int getJudgemaintainerstaff() {
|
||||
return judgemaintainerstaff;
|
||||
}
|
||||
|
||||
public void setJudgemaintainerstaff(int judgemaintainerstaff) {
|
||||
this.judgemaintainerstaff = judgemaintainerstaff;
|
||||
}
|
||||
|
||||
public int getJudgeresult() {
|
||||
return judgeresult;
|
||||
}
|
||||
|
||||
public void setJudgeresult(int judgeresult) {
|
||||
this.judgeresult = judgeresult;
|
||||
}
|
||||
|
||||
public String getMaintainerid() {
|
||||
return maintainerid;
|
||||
}
|
||||
|
||||
public void setMaintainerid(String maintainerid) {
|
||||
this.maintainerid = maintainerid;
|
||||
}
|
||||
|
||||
public String getMaintainplanid() {
|
||||
return maintainplanid;
|
||||
}
|
||||
|
||||
public void setMaintainplanid(String maintainplanid) {
|
||||
this.maintainplanid = maintainplanid;
|
||||
}
|
||||
|
||||
public String getMaintenance() {
|
||||
return maintenance;
|
||||
}
|
||||
|
||||
public void setMaintenance(String maintenance) {
|
||||
this.maintenance = maintenance;
|
||||
}
|
||||
|
||||
public String getMaintenanceMan() {
|
||||
return maintenanceMan;
|
||||
}
|
||||
|
||||
public void setMaintenanceMan(String maintenanceMan) {
|
||||
this.maintenanceMan = maintenanceMan;
|
||||
}
|
||||
|
||||
public String getMaintenanceWay() {
|
||||
return maintenanceWay;
|
||||
}
|
||||
|
||||
public void setMaintenanceWay(String maintenanceWay) {
|
||||
this.maintenanceWay = maintenanceWay;
|
||||
}
|
||||
|
||||
public String getMaintenanceid() {
|
||||
return maintenanceid;
|
||||
}
|
||||
|
||||
public void setMaintenanceid(String maintenanceid) {
|
||||
this.maintenanceid = maintenanceid;
|
||||
}
|
||||
|
||||
public int getPlanConsumeTime() {
|
||||
return planConsumeTime;
|
||||
}
|
||||
|
||||
public void setPlanConsumeTime(int planConsumeTime) {
|
||||
this.planConsumeTime = planConsumeTime;
|
||||
}
|
||||
|
||||
public int getPlanMoney() {
|
||||
return planMoney;
|
||||
}
|
||||
|
||||
public void setPlanMoney(int planMoney) {
|
||||
this.planMoney = planMoney;
|
||||
}
|
||||
|
||||
public String getPlannedenddt() {
|
||||
return plannedenddt;
|
||||
}
|
||||
|
||||
public void setPlannedenddt(String plannedenddt) {
|
||||
this.plannedenddt = plannedenddt;
|
||||
}
|
||||
|
||||
public String getProblemTypeNames() {
|
||||
return problemTypeNames;
|
||||
}
|
||||
|
||||
public void setProblemTypeNames(String problemTypeNames) {
|
||||
this.problemTypeNames = problemTypeNames;
|
||||
}
|
||||
|
||||
public String getProblemcontent() {
|
||||
return problemcontent;
|
||||
}
|
||||
|
||||
public void setProblemcontent(String problemcontent) {
|
||||
this.problemcontent = problemcontent;
|
||||
}
|
||||
|
||||
public String getProblemresult() {
|
||||
return problemresult;
|
||||
}
|
||||
|
||||
public void setProblemresult(String problemresult) {
|
||||
this.problemresult = problemresult;
|
||||
}
|
||||
|
||||
public String getProblemtypeid() {
|
||||
return problemtypeid;
|
||||
}
|
||||
|
||||
public void setProblemtypeid(String problemtypeid) {
|
||||
this.problemtypeid = problemtypeid;
|
||||
}
|
||||
|
||||
public String getProcessSection() {
|
||||
return processSection;
|
||||
}
|
||||
|
||||
public void setProcessSection(String processSection) {
|
||||
this.processSection = processSection;
|
||||
}
|
||||
|
||||
public String getProcessSectionId() {
|
||||
return processSectionId;
|
||||
}
|
||||
|
||||
public void setProcessSectionId(String processSectionId) {
|
||||
this.processSectionId = processSectionId;
|
||||
}
|
||||
|
||||
public String getProcessdefid() {
|
||||
return processdefid;
|
||||
}
|
||||
|
||||
public void setProcessdefid(String processdefid) {
|
||||
this.processdefid = processdefid;
|
||||
}
|
||||
|
||||
public String getProcessid() {
|
||||
return processid;
|
||||
}
|
||||
|
||||
public void setProcessid(String processid) {
|
||||
this.processid = processid;
|
||||
}
|
||||
|
||||
public String getSolver() {
|
||||
return solver;
|
||||
}
|
||||
|
||||
public void setSolver(String solver) {
|
||||
this.solver = solver;
|
||||
}
|
||||
|
||||
public String getSolvetime() {
|
||||
return solvetime;
|
||||
}
|
||||
|
||||
public void setSolvetime(String solvetime) {
|
||||
this.solvetime = solvetime;
|
||||
}
|
||||
|
||||
public String getSql() {
|
||||
return sql;
|
||||
}
|
||||
|
||||
public void setSql(String sql) {
|
||||
this.sql = sql;
|
||||
}
|
||||
|
||||
public String getStartDate() {
|
||||
return startDate;
|
||||
}
|
||||
|
||||
public void setStartDate(String startDate) {
|
||||
this.startDate = startDate;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getSubmittime() {
|
||||
return submittime;
|
||||
}
|
||||
|
||||
public void setSubmittime(String submittime) {
|
||||
this.submittime = submittime;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getWhere() {
|
||||
return where;
|
||||
}
|
||||
|
||||
public void setWhere(String where) {
|
||||
this.where = where;
|
||||
}
|
||||
}
|
||||
186
app/src/main/java/com/sipai/jspatrol/Bean/Measuringpoint.java
Normal file
186
app/src/main/java/com/sipai/jspatrol/Bean/Measuringpoint.java
Normal file
@ -0,0 +1,186 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
import com.sipai.jspatrol.Patrol.patrolInfoAdapter.PatrolEqu;
|
||||
|
||||
import org.litepal.crud.LitePalSupport;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Created by lvliming on 2017/10/24.
|
||||
*/
|
||||
|
||||
public class Measuringpoint extends LitePalSupport implements Serializable {
|
||||
private String sid;
|
||||
private String name;
|
||||
private String unit;
|
||||
private String value;
|
||||
private String _icon;
|
||||
private String cvalue;
|
||||
private String scadacode;
|
||||
private String date;
|
||||
private String month;
|
||||
private String day;
|
||||
private String time;
|
||||
private String alarmmax;
|
||||
private String alarmmin;
|
||||
private String valuemeaning;
|
||||
private String userid;
|
||||
private String unitId;
|
||||
private ProPatrolPoint proPatrolPoint;
|
||||
private PatrolEqu patrolEqu;
|
||||
|
||||
public String getUnitId() {
|
||||
return unitId;
|
||||
}
|
||||
|
||||
public void setUnitId(String unitId) {
|
||||
this.unitId = unitId;
|
||||
}
|
||||
|
||||
public String getUserid() {
|
||||
return userid;
|
||||
}
|
||||
|
||||
public void setUserid(String userid) {
|
||||
this.userid = userid;
|
||||
}
|
||||
|
||||
public String getAlarmmax() {
|
||||
return alarmmax;
|
||||
}
|
||||
|
||||
public void setAlarmmax(String alarmmax) {
|
||||
this.alarmmax = alarmmax;
|
||||
}
|
||||
|
||||
public String getAlarmmin() {
|
||||
return alarmmin;
|
||||
}
|
||||
|
||||
public void setAlarmmin(String alarmmin) {
|
||||
this.alarmmin = alarmmin;
|
||||
}
|
||||
|
||||
public String getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(String time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public String getMonth() {
|
||||
return month;
|
||||
}
|
||||
|
||||
public void setMonth(String month) {
|
||||
this.month = month;
|
||||
}
|
||||
|
||||
public String getDay() {
|
||||
return day;
|
||||
}
|
||||
|
||||
public void setDay(String day) {
|
||||
this.day = day;
|
||||
}
|
||||
|
||||
public String getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
public void setDate(String date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
public String getScadacode() {
|
||||
return scadacode;
|
||||
}
|
||||
|
||||
public void setScadacode(String scadacode) {
|
||||
this.scadacode = scadacode;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
private String type;
|
||||
|
||||
public String get_icon() {
|
||||
return _icon;
|
||||
}
|
||||
|
||||
public void set_icon(String _icon) {
|
||||
this._icon = _icon;
|
||||
}
|
||||
|
||||
public String getCvalue() {
|
||||
return cvalue;
|
||||
}
|
||||
|
||||
public void setCvalue(String cvalue) {
|
||||
this.cvalue = cvalue;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getSid() {
|
||||
return sid;
|
||||
}
|
||||
|
||||
public void setSid(String sid) {
|
||||
this.sid = sid;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getUnit() {
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setUnit(String unit) {
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public String getValuemeaning() {
|
||||
return valuemeaning;
|
||||
}
|
||||
|
||||
public void setValuemeaning(String valuemeaning) {
|
||||
this.valuemeaning = valuemeaning;
|
||||
}
|
||||
|
||||
public ProPatrolPoint getProPatrolPoint() {
|
||||
return proPatrolPoint;
|
||||
}
|
||||
|
||||
public void setProPatrolPoint(ProPatrolPoint proPatrolPoint) {
|
||||
this.proPatrolPoint = proPatrolPoint;
|
||||
}
|
||||
|
||||
public PatrolEqu getPatrolEqu() {
|
||||
return patrolEqu;
|
||||
}
|
||||
|
||||
public void setPatrolEqu(PatrolEqu patrolEqu) {
|
||||
this.patrolEqu = patrolEqu;
|
||||
}
|
||||
}
|
||||
42
app/src/main/java/com/sipai/jspatrol/Bean/Message.java
Normal file
42
app/src/main/java/com/sipai/jspatrol/Bean/Message.java
Normal file
@ -0,0 +1,42 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2020/8/15
|
||||
*/
|
||||
public class Message implements Serializable {
|
||||
private String id,content,redflag,sdt;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getRedflag() {
|
||||
return redflag;
|
||||
}
|
||||
|
||||
public void setRedflag(String redflag) {
|
||||
this.redflag = redflag;
|
||||
}
|
||||
|
||||
public String getSdt() {
|
||||
return sdt;
|
||||
}
|
||||
|
||||
public void setSdt(String sdt) {
|
||||
this.sdt = sdt;
|
||||
}
|
||||
}
|
||||
64
app/src/main/java/com/sipai/jspatrol/Bean/Nodes.java
Normal file
64
app/src/main/java/com/sipai/jspatrol/Bean/Nodes.java
Normal file
@ -0,0 +1,64 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2020/12/20
|
||||
*/
|
||||
public class Nodes implements Serializable {
|
||||
private List<Nodes> nodes;
|
||||
private String id;
|
||||
private String text;
|
||||
private String type;
|
||||
private String sel;
|
||||
private String mpid;
|
||||
|
||||
public String getMpid() {
|
||||
return mpid;
|
||||
}
|
||||
|
||||
public void setMpid(String mpid) {
|
||||
this.mpid = mpid;
|
||||
}
|
||||
|
||||
public List<Nodes> getNodes() {
|
||||
return nodes;
|
||||
}
|
||||
|
||||
public void setNodes(List<Nodes> nodes) {
|
||||
this.nodes = nodes;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
public void setText(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getSel() {
|
||||
return sel;
|
||||
}
|
||||
|
||||
public void setSel(String sel) {
|
||||
this.sel = sel;
|
||||
}
|
||||
}
|
||||
196
app/src/main/java/com/sipai/jspatrol/Bean/Patrol.java
Normal file
196
app/src/main/java/com/sipai/jspatrol/Bean/Patrol.java
Normal file
@ -0,0 +1,196 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
import org.litepal.LitePal;
|
||||
import org.litepal.crud.LitePalSupport;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by lvliming on 2018/12/17.
|
||||
*/
|
||||
|
||||
public class Patrol extends LitePalSupport implements Serializable{
|
||||
private String bizid,company,content,endTime,sid,insdt,insuser,name,patrolArea,patrolAreaId,patrolModelId,patrolPlanId,
|
||||
startTime,status,type,workResult,worker,workerId;
|
||||
private String actFinishTime;
|
||||
private PatrolModel patrolModel;
|
||||
private String patrolType;
|
||||
private List<ProPatrolPoint> patrolRecordPatrolRoutes;
|
||||
|
||||
public String getBizid() {
|
||||
return bizid;
|
||||
}
|
||||
|
||||
public void setBizid(String bizid) {
|
||||
this.bizid = bizid;
|
||||
}
|
||||
|
||||
public String getCompany() {
|
||||
return company;
|
||||
}
|
||||
|
||||
public void setCompany(String company) {
|
||||
this.company = company;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(String endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public String getSid() {
|
||||
return sid;
|
||||
}
|
||||
|
||||
public void setSid(String sid) {
|
||||
this.sid = sid;
|
||||
}
|
||||
|
||||
public String getInsdt() {
|
||||
return insdt;
|
||||
}
|
||||
|
||||
public void setInsdt(String insdt) {
|
||||
this.insdt = insdt;
|
||||
}
|
||||
|
||||
public String getInsuser() {
|
||||
return insuser;
|
||||
}
|
||||
|
||||
public void setInsuser(String insuser) {
|
||||
this.insuser = insuser;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPatrolArea() {
|
||||
return patrolArea;
|
||||
}
|
||||
|
||||
public void setPatrolArea(String patrolArea) {
|
||||
this.patrolArea = patrolArea;
|
||||
}
|
||||
|
||||
public String getPatrolAreaId() {
|
||||
return patrolAreaId;
|
||||
}
|
||||
|
||||
public void setPatrolAreaId(String patrolAreaId) {
|
||||
this.patrolAreaId = patrolAreaId;
|
||||
}
|
||||
|
||||
public String getPatrolModelId() {
|
||||
return patrolModelId;
|
||||
}
|
||||
|
||||
public void setPatrolModelId(String patrolModelId) {
|
||||
this.patrolModelId = patrolModelId;
|
||||
}
|
||||
|
||||
public String getPatrolPlanId() {
|
||||
return patrolPlanId;
|
||||
}
|
||||
|
||||
public void setPatrolPlanId(String patrolPlanId) {
|
||||
this.patrolPlanId = patrolPlanId;
|
||||
}
|
||||
|
||||
public String getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(String startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getWorkResult() {
|
||||
return workResult;
|
||||
}
|
||||
|
||||
public void setWorkResult(String workResult) {
|
||||
this.workResult = workResult;
|
||||
}
|
||||
|
||||
public String getWorker() {
|
||||
return worker;
|
||||
}
|
||||
|
||||
public void setWorker(String worker) {
|
||||
this.worker = worker;
|
||||
}
|
||||
|
||||
public String getWorkerId() {
|
||||
return workerId;
|
||||
}
|
||||
|
||||
public void setWorkerId(String workerId) {
|
||||
this.workerId = workerId;
|
||||
}
|
||||
|
||||
public PatrolModel getPatrolModel() {
|
||||
return patrolModel;
|
||||
}
|
||||
|
||||
public void setPatrolModel(PatrolModel patrolModel) {
|
||||
this.patrolModel = patrolModel;
|
||||
}
|
||||
|
||||
public String getPatrolType() {
|
||||
return patrolType;
|
||||
}
|
||||
|
||||
public void setPatrolType(String patrolType) {
|
||||
this.patrolType = patrolType;
|
||||
}
|
||||
|
||||
public String getActFinishTime() {
|
||||
return actFinishTime;
|
||||
}
|
||||
|
||||
public void setActFinishTime(String actFinishTime) {
|
||||
this.actFinishTime = actFinishTime;
|
||||
}
|
||||
|
||||
public List<ProPatrolPoint> getPatrolRecordPatrolRoutes() {
|
||||
return LitePal.where("patrolRecordId = ?",sid).find(ProPatrolPoint.class);
|
||||
}
|
||||
|
||||
public void setPatrolRecordPatrolRoutes(List<ProPatrolPoint> patrolRecordPatrolRoutes) {
|
||||
this.patrolRecordPatrolRoutes = patrolRecordPatrolRoutes;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,49 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
import org.litepal.crud.LitePalSupport;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Created by lvliming on 2019/4/19.
|
||||
*/
|
||||
|
||||
public class PatrolLocation extends LitePalSupport implements Serializable {
|
||||
|
||||
private String latitude;
|
||||
private String longitude;
|
||||
private String insdt;
|
||||
private String userid;
|
||||
|
||||
public String getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
|
||||
public void setLatitude(String latitude) {
|
||||
this.latitude = latitude;
|
||||
}
|
||||
|
||||
public String getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
public void setLongitude(String longitude) {
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
public String getInsdt() {
|
||||
return insdt;
|
||||
}
|
||||
|
||||
public void setInsdt(String insdt) {
|
||||
this.insdt = insdt;
|
||||
}
|
||||
|
||||
public String getUserid() {
|
||||
return userid;
|
||||
}
|
||||
|
||||
public void setUserid(String userid) {
|
||||
this.userid = userid;
|
||||
}
|
||||
}
|
||||
69
app/src/main/java/com/sipai/jspatrol/Bean/PatrolModel.java
Normal file
69
app/src/main/java/com/sipai/jspatrol/Bean/PatrolModel.java
Normal file
@ -0,0 +1,69 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
import org.litepal.crud.LitePalSupport;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Created by lvliming on 2019/2/19.
|
||||
*/
|
||||
|
||||
public class PatrolModel extends LitePalSupport implements Serializable {
|
||||
private String sid,active,bizId,defaultFlag,name,type,where;
|
||||
|
||||
public String getSid() {
|
||||
return sid;
|
||||
}
|
||||
|
||||
public void setSid(String sid) {
|
||||
this.sid = sid;
|
||||
}
|
||||
|
||||
public String getActive() {
|
||||
return active;
|
||||
}
|
||||
|
||||
public void setActive(String active) {
|
||||
this.active = active;
|
||||
}
|
||||
|
||||
public String getBizId() {
|
||||
return bizId;
|
||||
}
|
||||
|
||||
public void setBizId(String bizId) {
|
||||
this.bizId = bizId;
|
||||
}
|
||||
|
||||
public String getDefaultFlag() {
|
||||
return defaultFlag;
|
||||
}
|
||||
|
||||
public void setDefaultFlag(String defaultFlag) {
|
||||
this.defaultFlag = defaultFlag;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getWhere() {
|
||||
return where;
|
||||
}
|
||||
|
||||
public void setWhere(String where) {
|
||||
this.where = where;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,136 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
import com.sipai.jspatrol.Patrol.patrolInfoAdapter.PatrolEqu;
|
||||
|
||||
import org.litepal.crud.LitePalSupport;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2019/8/27
|
||||
*/
|
||||
public class PatrolPointContent extends LitePalSupport implements Serializable {
|
||||
private ProPatrolPoint proPatrolPoint;
|
||||
private PatrolEqu patrolEqu;
|
||||
private String sid,contents,contentsDetail,status;
|
||||
private String pid;
|
||||
private String type;
|
||||
private String patrolPointId;
|
||||
private String patrolRecordId;
|
||||
private String equipmentId;
|
||||
private String insdt;
|
||||
private String insuser;
|
||||
private String finishDt;
|
||||
|
||||
public String getSid() {
|
||||
return sid;
|
||||
}
|
||||
|
||||
public void setSid(String sid) {
|
||||
this.sid = sid;
|
||||
}
|
||||
|
||||
public String getContents() {
|
||||
return contents;
|
||||
}
|
||||
|
||||
public void setContents(String contents) {
|
||||
this.contents = contents;
|
||||
}
|
||||
|
||||
public String getContentsDetail() {
|
||||
return contentsDetail;
|
||||
}
|
||||
|
||||
public void setContentsDetail(String contentsDetail) {
|
||||
this.contentsDetail = contentsDetail;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public ProPatrolPoint getProPatrolPoint() {
|
||||
return proPatrolPoint;
|
||||
}
|
||||
|
||||
public void setProPatrolPoint(ProPatrolPoint proPatrolPoint) {
|
||||
this.proPatrolPoint = proPatrolPoint;
|
||||
}
|
||||
|
||||
public PatrolEqu getPatrolEqu() {
|
||||
return patrolEqu;
|
||||
}
|
||||
|
||||
public void setPatrolEqu(PatrolEqu patrolEqu) {
|
||||
this.patrolEqu = patrolEqu;
|
||||
}
|
||||
|
||||
public String getPid() {
|
||||
return pid;
|
||||
}
|
||||
|
||||
public void setPid(String pid) {
|
||||
this.pid = pid;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getPatrolPointId() {
|
||||
return patrolPointId;
|
||||
}
|
||||
|
||||
public void setPatrolPointId(String patrolPointId) {
|
||||
this.patrolPointId = patrolPointId;
|
||||
}
|
||||
|
||||
public String getPatrolRecordId() {
|
||||
return patrolRecordId;
|
||||
}
|
||||
|
||||
public void setPatrolRecordId(String patrolRecordId) {
|
||||
this.patrolRecordId = patrolRecordId;
|
||||
}
|
||||
|
||||
public String getEquipmentId() {
|
||||
return equipmentId;
|
||||
}
|
||||
|
||||
public void setEquipmentId(String equipmentId) {
|
||||
this.equipmentId = equipmentId;
|
||||
}
|
||||
|
||||
public String getInsdt() {
|
||||
return insdt;
|
||||
}
|
||||
|
||||
public void setInsdt(String insdt) {
|
||||
this.insdt = insdt;
|
||||
}
|
||||
|
||||
public String getInsuser() {
|
||||
return insuser;
|
||||
}
|
||||
|
||||
public void setInsuser(String insuser) {
|
||||
this.insuser = insuser;
|
||||
}
|
||||
|
||||
public String getFinishDt() {
|
||||
return finishDt;
|
||||
}
|
||||
|
||||
public void setFinishDt(String finishDt) {
|
||||
this.finishDt = finishDt;
|
||||
}
|
||||
}
|
||||
28
app/src/main/java/com/sipai/jspatrol/Bean/Picture.java
Normal file
28
app/src/main/java/com/sipai/jspatrol/Bean/Picture.java
Normal file
@ -0,0 +1,28 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Created by lvliming on 2019/3/25.
|
||||
*/
|
||||
|
||||
public class Picture implements Serializable {
|
||||
private String abspath;
|
||||
private String id;
|
||||
|
||||
public String getAbspath() {
|
||||
return abspath;
|
||||
}
|
||||
|
||||
public void setAbspath(String abspath) {
|
||||
this.abspath = abspath;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
public class PointLongValue {
|
||||
private Long date;
|
||||
private String name;
|
||||
private String unit;
|
||||
private String value;
|
||||
|
||||
public Long getDate() {
|
||||
return date;
|
||||
}
|
||||
|
||||
public void setDate(Long date) {
|
||||
this.date = date;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getUnit() {
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setUnit(String unit) {
|
||||
this.unit = unit;
|
||||
}
|
||||
}
|
||||
349
app/src/main/java/com/sipai/jspatrol/Bean/ProPatrolPoint.java
Normal file
349
app/src/main/java/com/sipai/jspatrol/Bean/ProPatrolPoint.java
Normal file
@ -0,0 +1,349 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
import com.sipai.jspatrol.Patrol.patrolInfoAdapter.PatrolEqu;
|
||||
|
||||
import org.litepal.LitePal;
|
||||
import org.litepal.crud.LitePalSupport;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by lvliming on 2019/2/20.
|
||||
*/
|
||||
|
||||
public class ProPatrolPoint extends LitePalSupport implements Serializable {
|
||||
private String patrolRecordPatrolRouteId;
|
||||
private String active;
|
||||
private String bizId;
|
||||
private String sid;
|
||||
private String resultId;
|
||||
private String insdt;
|
||||
private String insuser;
|
||||
private String latitude;
|
||||
private String longitude;
|
||||
private String modbusFig;
|
||||
private String modbusFigId;
|
||||
private String morder;
|
||||
private String name;
|
||||
private String patrolContent;
|
||||
private ProcessSection processSection;
|
||||
private String processSectionId;
|
||||
private String processSectionName;
|
||||
private String readOrWrite;
|
||||
private String register;
|
||||
private String remark;
|
||||
private String sql;
|
||||
private String type;
|
||||
private String unit;
|
||||
private String where;
|
||||
private String status;
|
||||
private String taskId;
|
||||
private String taskType;
|
||||
private String pointType;
|
||||
private String workerId;
|
||||
private String workerName;
|
||||
private String finishDt;
|
||||
private String patrolPointId;
|
||||
private String patrolRecordId;
|
||||
private List<PatrolPointContent> patrolContentsRecords;
|
||||
private List<InputPoint> patrolMeasurePointRecords;
|
||||
private List<PatrolEqu> patrolRecordPatrolEquipments;
|
||||
private Patrol patrol;
|
||||
|
||||
public String getPatrolRecordPatrolRouteId() {
|
||||
return patrolRecordPatrolRouteId;
|
||||
}
|
||||
|
||||
public void setPatrolRecordPatrolRouteId(String patrolRecordPatrolRouteId) {
|
||||
this.patrolRecordPatrolRouteId = patrolRecordPatrolRouteId;
|
||||
}
|
||||
|
||||
public String getPatrolPointId() {
|
||||
return patrolPointId;
|
||||
}
|
||||
|
||||
public void setPatrolPointId(String patrolPointId) {
|
||||
this.patrolPointId = patrolPointId;
|
||||
}
|
||||
|
||||
public String getPatrolRecordId() {
|
||||
return patrolRecordId;
|
||||
}
|
||||
|
||||
public void setPatrolRecordId(String patrolRecordId) {
|
||||
this.patrolRecordId = patrolRecordId;
|
||||
}
|
||||
|
||||
public String getResultId() {
|
||||
return resultId;
|
||||
}
|
||||
|
||||
public void setResultId(String resultId) {
|
||||
this.resultId = resultId;
|
||||
}
|
||||
|
||||
public String getTaskId() {
|
||||
return taskId;
|
||||
}
|
||||
|
||||
public void setTaskId(String taskId) {
|
||||
this.taskId = taskId;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getActive() {
|
||||
return active;
|
||||
}
|
||||
|
||||
public void setActive(String active) {
|
||||
this.active = active;
|
||||
}
|
||||
|
||||
public String getBizId() {
|
||||
return bizId;
|
||||
}
|
||||
|
||||
public void setBizId(String bizId) {
|
||||
this.bizId = bizId;
|
||||
}
|
||||
|
||||
public String getSid() {
|
||||
return sid;
|
||||
}
|
||||
|
||||
public void setSid(String sid) {
|
||||
this.sid = sid;
|
||||
}
|
||||
|
||||
public String getInsdt() {
|
||||
return insdt;
|
||||
}
|
||||
|
||||
public void setInsdt(String insdt) {
|
||||
this.insdt = insdt;
|
||||
}
|
||||
|
||||
public String getInsuser() {
|
||||
return insuser;
|
||||
}
|
||||
|
||||
public void setInsuser(String insuser) {
|
||||
this.insuser = insuser;
|
||||
}
|
||||
|
||||
public String getLatitude() {
|
||||
return latitude;
|
||||
}
|
||||
|
||||
public void setLatitude(String latitude) {
|
||||
this.latitude = latitude;
|
||||
}
|
||||
|
||||
public String getLongitude() {
|
||||
return longitude;
|
||||
}
|
||||
|
||||
public void setLongitude(String longitude) {
|
||||
this.longitude = longitude;
|
||||
}
|
||||
|
||||
public String getModbusFig() {
|
||||
return modbusFig;
|
||||
}
|
||||
|
||||
public void setModbusFig(String modbusFig) {
|
||||
this.modbusFig = modbusFig;
|
||||
}
|
||||
|
||||
public String getModbusFigId() {
|
||||
return modbusFigId;
|
||||
}
|
||||
|
||||
public void setModbusFigId(String modbusFigId) {
|
||||
this.modbusFigId = modbusFigId;
|
||||
}
|
||||
|
||||
public String getMorder() {
|
||||
return morder;
|
||||
}
|
||||
|
||||
public void setMorder(String morder) {
|
||||
this.morder = morder;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPatrolContent() {
|
||||
return patrolContent;
|
||||
}
|
||||
|
||||
public void setPatrolContent(String patrolContent) {
|
||||
this.patrolContent = patrolContent;
|
||||
}
|
||||
|
||||
public ProcessSection getProcessSection() {
|
||||
return processSection;
|
||||
}
|
||||
|
||||
public void setProcessSection(ProcessSection processSection) {
|
||||
this.processSection = processSection;
|
||||
}
|
||||
|
||||
public String getProcessSectionId() {
|
||||
return processSectionId;
|
||||
}
|
||||
|
||||
public void setProcessSectionId(String processSectionId) {
|
||||
this.processSectionId = processSectionId;
|
||||
}
|
||||
|
||||
public String getReadOrWrite() {
|
||||
return readOrWrite;
|
||||
}
|
||||
|
||||
public void setReadOrWrite(String readOrWrite) {
|
||||
this.readOrWrite = readOrWrite;
|
||||
}
|
||||
|
||||
public String getRegister() {
|
||||
return register;
|
||||
}
|
||||
|
||||
public void setRegister(String register) {
|
||||
this.register = register;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getSql() {
|
||||
return sql;
|
||||
}
|
||||
|
||||
public void setSql(String sql) {
|
||||
this.sql = sql;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getUnit() {
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setUnit(String unit) {
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public String getWhere() {
|
||||
return where;
|
||||
}
|
||||
|
||||
public void setWhere(String where) {
|
||||
this.where = where;
|
||||
}
|
||||
|
||||
public String getProcessSectionName() {
|
||||
return processSectionName;
|
||||
}
|
||||
|
||||
public void setProcessSectionName(String processSectionName) {
|
||||
this.processSectionName = processSectionName;
|
||||
}
|
||||
|
||||
public String getTaskType() {
|
||||
return taskType;
|
||||
}
|
||||
|
||||
public void setTaskType(String taskType) {
|
||||
this.taskType = taskType;
|
||||
}
|
||||
|
||||
public String getPointType() {
|
||||
return pointType;
|
||||
}
|
||||
|
||||
public void setPointType(String pointType) {
|
||||
this.pointType = pointType;
|
||||
}
|
||||
|
||||
public String getWorkerId() {
|
||||
return workerId;
|
||||
}
|
||||
|
||||
public void setWorkerId(String workerId) {
|
||||
this.workerId = workerId;
|
||||
}
|
||||
|
||||
public String getFinishDt() {
|
||||
return finishDt;
|
||||
}
|
||||
|
||||
public void setFinishDt(String finishDt) {
|
||||
this.finishDt = finishDt;
|
||||
}
|
||||
|
||||
public List<PatrolPointContent> getPatrolContentsRecords() {
|
||||
return LitePal.where("patrolPointId = ? and patrolRecordId = ? and equipmentId = ?",sid,taskId,"").find(PatrolPointContent.class);
|
||||
}
|
||||
|
||||
public void setPatrolContentsRecords(List<PatrolPointContent> patrolContentsRecords) {
|
||||
this.patrolContentsRecords = patrolContentsRecords;
|
||||
}
|
||||
|
||||
public List<InputPoint> getPatrolMeasurePointRecords() {
|
||||
return LitePal.where("patrolPointId = ? and patrolRecordId = ? and equipmentId = ?",sid,taskId,"").find(InputPoint.class);
|
||||
}
|
||||
|
||||
public void setPatrolMeasurePointRecords(List<InputPoint> patrolMeasurePointRecords) {
|
||||
this.patrolMeasurePointRecords = patrolMeasurePointRecords;
|
||||
}
|
||||
|
||||
public List<PatrolEqu> getPatrolRecordPatrolEquipments() {
|
||||
return LitePal.where("patrolPointId = ? and patrolRecordId = ?",sid,taskId).find(PatrolEqu.class);
|
||||
}
|
||||
|
||||
public void setPatrolRecordPatrolEquipments(List<PatrolEqu> patrolRecordPatrolEquipments) {
|
||||
this.patrolRecordPatrolEquipments = patrolRecordPatrolEquipments;
|
||||
}
|
||||
|
||||
public Patrol getPatrol() {
|
||||
return patrol;
|
||||
}
|
||||
|
||||
public void setPatrol(Patrol patrol) {
|
||||
this.patrol = patrol;
|
||||
}
|
||||
|
||||
public String getWorkerName() {
|
||||
return workerName;
|
||||
}
|
||||
|
||||
public void setWorkerName(String workerName) {
|
||||
this.workerName = workerName;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,93 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
import org.litepal.crud.LitePalSupport;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* Created by lvliming on 2019/2/20.
|
||||
*/
|
||||
|
||||
public class ProcessSection extends LitePalSupport implements Serializable {
|
||||
private String code;
|
||||
private String sid;
|
||||
private String insdt;
|
||||
private String insuser;
|
||||
private String name;
|
||||
private String pid;
|
||||
private String sname;
|
||||
private String sql;
|
||||
private String where;
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getSid() {
|
||||
return sid;
|
||||
}
|
||||
|
||||
public void setSid(String sid) {
|
||||
this.sid = sid;
|
||||
}
|
||||
|
||||
public String getInsdt() {
|
||||
return insdt;
|
||||
}
|
||||
|
||||
public void setInsdt(String insdt) {
|
||||
this.insdt = insdt;
|
||||
}
|
||||
|
||||
public String getInsuser() {
|
||||
return insuser;
|
||||
}
|
||||
|
||||
public void setInsuser(String insuser) {
|
||||
this.insuser = insuser;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPid() {
|
||||
return pid;
|
||||
}
|
||||
|
||||
public void setPid(String pid) {
|
||||
this.pid = pid;
|
||||
}
|
||||
|
||||
public String getSname() {
|
||||
return sname;
|
||||
}
|
||||
|
||||
public void setSname(String sname) {
|
||||
this.sname = sname;
|
||||
}
|
||||
|
||||
public String getSql() {
|
||||
return sql;
|
||||
}
|
||||
|
||||
public void setSql(String sql) {
|
||||
this.sql = sql;
|
||||
}
|
||||
|
||||
public String getWhere() {
|
||||
return where;
|
||||
}
|
||||
|
||||
public void setWhere(String where) {
|
||||
this.where = where;
|
||||
}
|
||||
}
|
||||
54
app/src/main/java/com/sipai/jspatrol/Bean/Roles.java
Normal file
54
app/src/main/java/com/sipai/jspatrol/Bean/Roles.java
Normal file
@ -0,0 +1,54 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2020/3/23
|
||||
*/
|
||||
public class Roles {
|
||||
private String id;
|
||||
private String description;
|
||||
private String name;
|
||||
private String bizid;
|
||||
private String serial;
|
||||
private int morder;
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setBizid(String bizid) {
|
||||
this.bizid = bizid;
|
||||
}
|
||||
public String getBizid() {
|
||||
return bizid;
|
||||
}
|
||||
|
||||
public void setSerial(String serial) {
|
||||
this.serial = serial;
|
||||
}
|
||||
public String getSerial() {
|
||||
return serial;
|
||||
}
|
||||
|
||||
public void setMorder(int morder) {
|
||||
this.morder = morder;
|
||||
}
|
||||
public int getMorder() {
|
||||
return morder;
|
||||
}
|
||||
}
|
||||
88
app/src/main/java/com/sipai/jspatrol/Bean/Statement.java
Normal file
88
app/src/main/java/com/sipai/jspatrol/Bean/Statement.java
Normal file
@ -0,0 +1,88 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2021/3/18
|
||||
*/
|
||||
public class Statement {
|
||||
private String id;
|
||||
private String inputusername;
|
||||
private String insdt;
|
||||
private String rptdt;
|
||||
private String rptname;
|
||||
private String rptsetId;
|
||||
private String unitId;
|
||||
private String upsdt;
|
||||
private String meno;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getInputusername() {
|
||||
return inputusername;
|
||||
}
|
||||
|
||||
public void setInputusername(String inputusername) {
|
||||
this.inputusername = inputusername;
|
||||
}
|
||||
|
||||
public String getInsdt() {
|
||||
return insdt;
|
||||
}
|
||||
|
||||
public void setInsdt(String insdt) {
|
||||
this.insdt = insdt;
|
||||
}
|
||||
|
||||
public String getRptdt() {
|
||||
return rptdt;
|
||||
}
|
||||
|
||||
public void setRptdt(String rptdt) {
|
||||
this.rptdt = rptdt;
|
||||
}
|
||||
|
||||
public String getRptname() {
|
||||
return rptname;
|
||||
}
|
||||
|
||||
public void setRptname(String rptname) {
|
||||
this.rptname = rptname;
|
||||
}
|
||||
|
||||
public String getRptsetId() {
|
||||
return rptsetId;
|
||||
}
|
||||
|
||||
public void setRptsetId(String rptsetId) {
|
||||
this.rptsetId = rptsetId;
|
||||
}
|
||||
|
||||
public String getUnitId() {
|
||||
return unitId;
|
||||
}
|
||||
|
||||
public void setUnitId(String unitId) {
|
||||
this.unitId = unitId;
|
||||
}
|
||||
|
||||
public String getUpsdt() {
|
||||
return upsdt;
|
||||
}
|
||||
|
||||
public void setUpsdt(String upsdt) {
|
||||
this.upsdt = upsdt;
|
||||
}
|
||||
|
||||
public String getMeno() {
|
||||
return meno;
|
||||
}
|
||||
|
||||
public void setMeno(String meno) {
|
||||
this.meno = meno;
|
||||
}
|
||||
}
|
||||
240
app/src/main/java/com/sipai/jspatrol/Bean/User.java
Normal file
240
app/src/main/java/com/sipai/jspatrol/Bean/User.java
Normal file
@ -0,0 +1,240 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2020/3/23
|
||||
* 人员
|
||||
*/
|
||||
public class User extends BaseEntity implements Serializable {
|
||||
private UserDetail userDetail;
|
||||
private String sex;
|
||||
private String currentip;
|
||||
private String pid;
|
||||
private String caption;
|
||||
private String syncflag;
|
||||
private String password;
|
||||
private String insuser;
|
||||
private int morder;
|
||||
private String cardid;
|
||||
private String officeroom;
|
||||
private String id;
|
||||
private int pri;
|
||||
private String lastlogintime;
|
||||
private String officephone;
|
||||
private String useremail;
|
||||
private String roles;
|
||||
private String name;
|
||||
private String pname;
|
||||
private String active;
|
||||
private double totaltime;
|
||||
private String themeclass;
|
||||
private String serial;
|
||||
private int lgnum;
|
||||
private String token;
|
||||
private String patrolTypeId;
|
||||
private String nfc;
|
||||
private String subTask;
|
||||
|
||||
public String getSubTask() {
|
||||
return subTask;
|
||||
}
|
||||
|
||||
public void setSubTask(String subTask) {
|
||||
this.subTask = subTask;
|
||||
}
|
||||
|
||||
public String getPatrolTypeId() {
|
||||
return patrolTypeId;
|
||||
}
|
||||
|
||||
public void setPatrolTypeId(String patrolTypeId) {
|
||||
this.patrolTypeId = patrolTypeId;
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public void setUserDetail(UserDetail userDetail) {
|
||||
this.userDetail = userDetail;
|
||||
}
|
||||
public UserDetail getUserDetail() {
|
||||
return userDetail;
|
||||
}
|
||||
|
||||
public void setSex(String sex) {
|
||||
this.sex = sex;
|
||||
}
|
||||
public String getSex() {
|
||||
return sex;
|
||||
}
|
||||
|
||||
public void setCurrentip(String currentip) {
|
||||
this.currentip = currentip;
|
||||
}
|
||||
public String getCurrentip() {
|
||||
return currentip;
|
||||
}
|
||||
|
||||
public void setPid(String pid) {
|
||||
this.pid = pid;
|
||||
}
|
||||
public String getPid() {
|
||||
return pid;
|
||||
}
|
||||
|
||||
public void setCaption(String caption) {
|
||||
this.caption = caption;
|
||||
}
|
||||
public String getCaption() {
|
||||
return caption;
|
||||
}
|
||||
|
||||
public void setSyncflag(String syncflag) {
|
||||
this.syncflag = syncflag;
|
||||
}
|
||||
public String getSyncflag() {
|
||||
return syncflag;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setInsuser(String insuser) {
|
||||
this.insuser = insuser;
|
||||
}
|
||||
public String getInsuser() {
|
||||
return insuser;
|
||||
}
|
||||
|
||||
public void setMorder(int morder) {
|
||||
this.morder = morder;
|
||||
}
|
||||
public int getMorder() {
|
||||
return morder;
|
||||
}
|
||||
|
||||
public void setCardid(String cardid) {
|
||||
this.cardid = cardid;
|
||||
}
|
||||
public String getCardid() {
|
||||
return cardid;
|
||||
}
|
||||
|
||||
public void setOfficeroom(String officeroom) {
|
||||
this.officeroom = officeroom;
|
||||
}
|
||||
public String getOfficeroom() {
|
||||
return officeroom;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setPri(int pri) {
|
||||
this.pri = pri;
|
||||
}
|
||||
public int getPri() {
|
||||
return pri;
|
||||
}
|
||||
|
||||
public void setLastlogintime(String lastlogintime) {
|
||||
this.lastlogintime = lastlogintime;
|
||||
}
|
||||
public String getLastlogintime() {
|
||||
return lastlogintime;
|
||||
}
|
||||
|
||||
public void setOfficephone(String officephone) {
|
||||
this.officephone = officephone;
|
||||
}
|
||||
public String getOfficephone() {
|
||||
return officephone;
|
||||
}
|
||||
|
||||
public void setUseremail(String useremail) {
|
||||
this.useremail = useremail;
|
||||
}
|
||||
public String getUseremail() {
|
||||
return useremail;
|
||||
}
|
||||
|
||||
public String getRoles() {
|
||||
return roles;
|
||||
}
|
||||
|
||||
public void setRoles(String roles) {
|
||||
this.roles = roles;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setPname(String pname) {
|
||||
this.pname = pname;
|
||||
}
|
||||
public String getPname() {
|
||||
return pname;
|
||||
}
|
||||
|
||||
public void setActive(String active) {
|
||||
this.active = active;
|
||||
}
|
||||
public String getActive() {
|
||||
return active;
|
||||
}
|
||||
|
||||
public void setTotaltime(double totaltime) {
|
||||
this.totaltime = totaltime;
|
||||
}
|
||||
public double getTotaltime() {
|
||||
return totaltime;
|
||||
}
|
||||
|
||||
public void setThemeclass(String themeclass) {
|
||||
this.themeclass = themeclass;
|
||||
}
|
||||
public String getThemeclass() {
|
||||
return themeclass;
|
||||
}
|
||||
|
||||
public void setSerial(String serial) {
|
||||
this.serial = serial;
|
||||
}
|
||||
public String getSerial() {
|
||||
return serial;
|
||||
}
|
||||
|
||||
public void setLgnum(int lgnum) {
|
||||
this.lgnum = lgnum;
|
||||
}
|
||||
public int getLgnum() {
|
||||
return lgnum;
|
||||
}
|
||||
|
||||
public String getNfc() {
|
||||
return nfc;
|
||||
}
|
||||
|
||||
public void setNfc(String nfc) {
|
||||
this.nfc = nfc;
|
||||
}
|
||||
}
|
||||
47
app/src/main/java/com/sipai/jspatrol/Bean/UserDetail.java
Normal file
47
app/src/main/java/com/sipai/jspatrol/Bean/UserDetail.java
Normal file
@ -0,0 +1,47 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2020/3/23
|
||||
*/
|
||||
public class UserDetail {
|
||||
private String id;
|
||||
private String icon;
|
||||
private String userid;
|
||||
private String insdt;
|
||||
private String insuser;
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setIcon(String icon) {
|
||||
this.icon = icon;
|
||||
}
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setUserid(String userid) {
|
||||
this.userid = userid;
|
||||
}
|
||||
public String getUserid() {
|
||||
return userid;
|
||||
}
|
||||
|
||||
public void setInsdt(String insdt) {
|
||||
this.insdt = insdt;
|
||||
}
|
||||
public String getInsdt() {
|
||||
return insdt;
|
||||
}
|
||||
|
||||
public void setInsuser(String insuser) {
|
||||
this.insuser = insuser;
|
||||
}
|
||||
public String getInsuser() {
|
||||
return insuser;
|
||||
}
|
||||
|
||||
}
|
||||
275
app/src/main/java/com/sipai/jspatrol/Bean/WaterQualityList.java
Normal file
275
app/src/main/java/com/sipai/jspatrol/Bean/WaterQualityList.java
Normal file
@ -0,0 +1,275 @@
|
||||
package com.sipai.jspatrol.Bean;
|
||||
|
||||
public class WaterQualityList {
|
||||
private String id;
|
||||
private String scadacode;
|
||||
private String name;
|
||||
private String picid;
|
||||
private String posx;
|
||||
private String posy;
|
||||
private String mpid;
|
||||
private String insuser;
|
||||
private String cvalue;
|
||||
private String insdt;
|
||||
private String unit;
|
||||
private String cvaluetime;
|
||||
private String opccode;
|
||||
private String opcserverid;
|
||||
private String dataserverid;
|
||||
private String _icon;
|
||||
private String ownerid;
|
||||
private String txt;
|
||||
private String fsize;
|
||||
private int accuracy;
|
||||
private double _cleposx;
|
||||
private double _cleposy;
|
||||
private String type;
|
||||
private String ipsever;
|
||||
private String port;
|
||||
private String slaveid;
|
||||
private String order32;
|
||||
private String register;
|
||||
private String value;
|
||||
private String info;
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getIpsever() {
|
||||
return ipsever;
|
||||
}
|
||||
|
||||
public void setIpsever(String ipsever) {
|
||||
this.ipsever = ipsever;
|
||||
}
|
||||
|
||||
public String getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
public void setPort(String port) {
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
public String getSlaveid() {
|
||||
return slaveid;
|
||||
}
|
||||
|
||||
public void setSlaveid(String slaveid) {
|
||||
this.slaveid = slaveid;
|
||||
}
|
||||
|
||||
public String getOrder32() {
|
||||
return order32;
|
||||
}
|
||||
|
||||
public void setOrder32(String order32) {
|
||||
this.order32 = order32;
|
||||
}
|
||||
|
||||
public String getRegister() {
|
||||
return register;
|
||||
}
|
||||
|
||||
public void setRegister(String register) {
|
||||
this.register = register;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getInfo() {
|
||||
return info;
|
||||
}
|
||||
|
||||
public void setInfo(String info) {
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public String getCvaluetime() {
|
||||
return cvaluetime;
|
||||
}
|
||||
|
||||
public void setCvaluetime(String cvaluetime) {
|
||||
this.cvaluetime = cvaluetime;
|
||||
}
|
||||
|
||||
public String getOpccode() {
|
||||
return opccode;
|
||||
}
|
||||
|
||||
public void setOpccode(String opccode) {
|
||||
this.opccode = opccode;
|
||||
}
|
||||
|
||||
public String getInsdt() {
|
||||
return insdt;
|
||||
}
|
||||
|
||||
public void setInsdt(String insdt) {
|
||||
this.insdt = insdt;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPicid() {
|
||||
return picid;
|
||||
}
|
||||
|
||||
public void setPicid(String picid) {
|
||||
this.picid = picid;
|
||||
}
|
||||
|
||||
public String getPosx() {
|
||||
return posx;
|
||||
}
|
||||
|
||||
public void setPosx(String posx) {
|
||||
this.posx = posx;
|
||||
}
|
||||
|
||||
public String getPosy() {
|
||||
return posy;
|
||||
}
|
||||
|
||||
public void setPosy(String posy) {
|
||||
this.posy = posy;
|
||||
}
|
||||
|
||||
public String getMpid() {
|
||||
return mpid;
|
||||
}
|
||||
|
||||
public void setMpid(String mpid) {
|
||||
this.mpid = mpid;
|
||||
}
|
||||
|
||||
public String getInsuser() {
|
||||
return insuser;
|
||||
}
|
||||
|
||||
public void setInsuser(String insuser) {
|
||||
this.insuser = insuser;
|
||||
}
|
||||
|
||||
public String getCvalue() {
|
||||
return cvalue;
|
||||
}
|
||||
|
||||
public void setCvalue(String cvalue) {
|
||||
this.cvalue = cvalue;
|
||||
}
|
||||
|
||||
public String getUnit() {
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setUnit(String unit) {
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public String getScadacode() {
|
||||
return scadacode;
|
||||
}
|
||||
|
||||
public void setScadacode(String scadacode) {
|
||||
this.scadacode = scadacode;
|
||||
}
|
||||
|
||||
public String getOpcserverid() {
|
||||
return opcserverid;
|
||||
}
|
||||
|
||||
public void setOpcserverid(String opcserverid) {
|
||||
this.opcserverid = opcserverid;
|
||||
}
|
||||
|
||||
public String getDataserverid() {
|
||||
return dataserverid;
|
||||
}
|
||||
|
||||
public void setDataserverid(String dataserverid) {
|
||||
this.dataserverid = dataserverid;
|
||||
}
|
||||
|
||||
public String get_icon() {
|
||||
return _icon;
|
||||
}
|
||||
|
||||
public void set_icon(String _icon) {
|
||||
this._icon = _icon;
|
||||
}
|
||||
|
||||
public String getOwnerid() {
|
||||
return ownerid;
|
||||
}
|
||||
|
||||
public void setOwnerid(String ownerid) {
|
||||
this.ownerid = ownerid;
|
||||
}
|
||||
|
||||
public String getTxt() {
|
||||
return txt;
|
||||
}
|
||||
|
||||
public void setTxt(String txt) {
|
||||
this.txt = txt;
|
||||
}
|
||||
|
||||
public String getFsize() {
|
||||
return fsize;
|
||||
}
|
||||
|
||||
public void setFsize(String fsize) {
|
||||
this.fsize = fsize;
|
||||
}
|
||||
|
||||
public int getAccuracy() {
|
||||
return accuracy;
|
||||
}
|
||||
|
||||
public void setAccuracy(int accuracy) {
|
||||
this.accuracy = accuracy;
|
||||
}
|
||||
|
||||
public double get_cleposx() {
|
||||
return _cleposx;
|
||||
}
|
||||
|
||||
public void set_cleposx(double _cleposx) {
|
||||
this._cleposx = _cleposx;
|
||||
}
|
||||
|
||||
public double get_cleposy() {
|
||||
return _cleposy;
|
||||
}
|
||||
|
||||
public void set_cleposy(double _cleposy) {
|
||||
this._cleposy = _cleposy;
|
||||
}
|
||||
}
|
||||
|
||||
120
app/src/main/java/com/sipai/jspatrol/Equ/EquCardActivity.java
Normal file
120
app/src/main/java/com/sipai/jspatrol/Equ/EquCardActivity.java
Normal file
@ -0,0 +1,120 @@
|
||||
package com.sipai.jspatrol.Equ;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentStatePagerAdapter;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.gigamole.navigationtabstrip.NavigationTabStrip;
|
||||
import com.sipai.jspatrol.Bean.EquList;
|
||||
import com.sipai.jspatrol.Equ.Equfrgment.EquDetailFragment;
|
||||
import com.sipai.jspatrol.Equ.Equfrgment.EquDocumentFragment;
|
||||
import com.sipai.jspatrol.Equ.Equfrgment.EquFaultListFragment;
|
||||
import com.sipai.jspatrol.Equ.Equfrgment.EquMaintainFragment;
|
||||
import com.sipai.jspatrol.R;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class EquCardActivity extends AppCompatActivity {
|
||||
private NavigationTabStrip tab;
|
||||
private String[] tab_title = {"设备详情","维修记录","保养记录","测量点"};
|
||||
private ViewPager vp;
|
||||
private EquList equ;
|
||||
|
||||
public static void actionStart(Context context, EquList equList){
|
||||
Intent intent = new Intent(context, EquCardActivity.class);
|
||||
intent.putExtra("equ",equList);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_equ_card);
|
||||
init();
|
||||
initView();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
if (getIntent().getSerializableExtra("equ")!=null){
|
||||
equ = (EquList) getIntent().getSerializableExtra("equ");
|
||||
}
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
TextView tv_title = findViewById(R.id.moudle_back_title_tv_title);
|
||||
tv_title.setText("设备详情");
|
||||
ImageView btn_back = findViewById(R.id.moudle_back_title_iv_back);
|
||||
btn_back.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
tab = findViewById(R.id.moudle_equ_detail_tab);
|
||||
tab.setTitles(tab_title);
|
||||
tab.setTabIndex(0);
|
||||
tab.setOnTabStripSelectedIndexListener(new NavigationTabStrip.OnTabStripSelectedIndexListener() {
|
||||
@Override
|
||||
public void onStartTabSelected(String title, int index) {
|
||||
vp.setCurrentItem(index);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEndTabSelected(String title, int index) {
|
||||
|
||||
}
|
||||
});
|
||||
vp = findViewById(R.id.moudle_equ_detail_vp);
|
||||
final List<Fragment> list = new ArrayList<>();
|
||||
list.add(new EquDetailFragment());
|
||||
list.add(new EquFaultListFragment());
|
||||
list.add(new EquMaintainFragment());
|
||||
list.add(new EquDocumentFragment());
|
||||
vp.setAdapter(new FragmentStatePagerAdapter(getSupportFragmentManager()) {
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public Fragment getItem(int position) {
|
||||
return list.get(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
vp.setOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
tab.setTabIndex(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public EquList getEquList(){
|
||||
return equ;
|
||||
}
|
||||
|
||||
}
|
||||
153
app/src/main/java/com/sipai/jspatrol/Equ/EquDetailActivity.java
Normal file
153
app/src/main/java/com/sipai/jspatrol/Equ/EquDetailActivity.java
Normal file
@ -0,0 +1,153 @@
|
||||
package com.sipai.jspatrol.Equ;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.sipai.jspatrol.Bean.EquList;
|
||||
import com.sipai.jspatrol.Bean.Measuringpoint;
|
||||
import com.sipai.jspatrol.ProMonitoring.MeasurePointsAdapter;
|
||||
import com.sipai.jspatrol.R;
|
||||
import com.sipai.jspatrol.URL.MethodURL;
|
||||
import com.sipai.jspatrol.utils.OKHttpUtils;
|
||||
import com.sipai.jspatrol.utils.SharedPreferencesData;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Callback;
|
||||
import okhttp3.Response;
|
||||
|
||||
public class EquDetailActivity extends AppCompatActivity {
|
||||
private SharedPreferencesData sharedpre;
|
||||
private HashMap<String, String> map_base = new HashMap<>();
|
||||
private String mServer;
|
||||
private TextView tv_name,tv_areaid,tv_equcardid,tv_equtype,tv_ps,tv_equmf,tv_company;
|
||||
private EquList equ;
|
||||
private RecyclerView rc_view;
|
||||
private LinearLayoutManager manager;
|
||||
private MeasurePointsAdapter pointsAdapter;
|
||||
private List<Measuringpoint> measuringpoints = new ArrayList<>();
|
||||
|
||||
public static void actionStart(Context context, EquList equList){
|
||||
Intent intent = new Intent(context, EquDetailActivity.class);
|
||||
intent.putExtra("equ",equList);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_equ_detail);
|
||||
init();
|
||||
initView();
|
||||
getEquPoints();
|
||||
}
|
||||
|
||||
private void getEquPoints() {
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("equipmentId",equ.getId());
|
||||
OKHttpUtils.getClient().newCall(OKHttpUtils.OKHttpRequest(map, mServer, MethodURL.GETEquPoints_Method)).enqueue(new Callback() {
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e) {
|
||||
String a = e.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException {
|
||||
String res = response.body().string();
|
||||
measuringpoints = parseMeasuringPoints(res);
|
||||
if (measuringpoints.size()>0){
|
||||
updatePoints();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void updatePoints() {
|
||||
if (!EquDetailActivity.this.isFinishing()){
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
pointsAdapter = new MeasurePointsAdapter(EquDetailActivity.this,measuringpoints);
|
||||
rc_view.setAdapter(pointsAdapter);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private List<Measuringpoint> parseMeasuringPoints(String res) {
|
||||
List<Measuringpoint> points = new ArrayList<>();
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(res);
|
||||
JSONArray arrayPoint = jsonObject.getJSONArray("mPoint4APP");
|
||||
for (int a=0;a<arrayPoint.length();a++){
|
||||
Measuringpoint point = new Measuringpoint();
|
||||
point.setSid(arrayPoint.getJSONObject(a).opt("id").toString());
|
||||
point.setName(arrayPoint.getJSONObject(a).opt("parmname").toString());
|
||||
point.setUnit(arrayPoint.getJSONObject(a).opt("unit").toString());
|
||||
point.setCvalue(arrayPoint.getJSONObject(a).opt("parmvalue").toString());
|
||||
point.setType(arrayPoint.getJSONObject(a).opt("signalType").toString());
|
||||
point.setScadacode(arrayPoint.getJSONObject(a).opt("id").toString());
|
||||
point.setAlarmmax(arrayPoint.getJSONObject(a).opt("alarmmax").toString());
|
||||
point.setAlarmmin(arrayPoint.getJSONObject(a).opt("alarmmin").toString());
|
||||
points.add(point);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return points;
|
||||
}
|
||||
|
||||
private void init() {
|
||||
if (getIntent().getSerializableExtra("equ")!=null){
|
||||
equ = (EquList) getIntent().getSerializableExtra("equ");
|
||||
}
|
||||
sharedpre = new SharedPreferencesData(EquDetailActivity.this);
|
||||
map_base = sharedpre.getAll();
|
||||
mServer = map_base.get("mServer");
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
TextView tv_title = findViewById(R.id.moudle_back_title_tv_title);
|
||||
tv_title.setText("设备详情");
|
||||
ImageView btn_back = findViewById(R.id.moudle_back_title_iv_back);
|
||||
btn_back.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
tv_name = findViewById(R.id.moudle_equ_detail_tv_equipmentname);
|
||||
tv_name.setText(equ.getEquipmentname());
|
||||
tv_areaid = findViewById(R.id.moudle_equ_detail_tv_areaid);
|
||||
tv_areaid.setText(equ.getAreaid());
|
||||
tv_equcardid = findViewById(R.id.moudle_equ_detail_tv_equipmentcardid);
|
||||
tv_equcardid.setText(equ.getEquipmentcardid());
|
||||
tv_equtype = findViewById(R.id.moudle_equ_detail_tv_equtype);
|
||||
tv_equtype.setText(equ.getEquipmentTypeNumber());
|
||||
tv_ps = findViewById(R.id.moudle_equ_detail_tv_ps);
|
||||
tv_ps.setText(equ.getProcessSection());
|
||||
tv_equmf = findViewById(R.id.moudle_equ_detail_tv_equmf);
|
||||
tv_equmf.setText(equ.getEquipmentmanufacturer());
|
||||
tv_company = findViewById(R.id.moudle_equ_detail_tv_company);
|
||||
tv_company.setText(equ.getCompany());
|
||||
rc_view = findViewById(R.id.moudle_equ_detail_rc_point);
|
||||
manager = new LinearLayoutManager(EquDetailActivity.this);
|
||||
rc_view.setLayoutManager(manager);
|
||||
}
|
||||
}
|
||||
552
app/src/main/java/com/sipai/jspatrol/Equ/EquInsertActivity.java
Normal file
552
app/src/main/java/com/sipai/jspatrol/Equ/EquInsertActivity.java
Normal file
@ -0,0 +1,552 @@
|
||||
package com.sipai.jspatrol.Equ;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.example.zhouwei.library.CustomPopWindow;
|
||||
import com.loopj.android.http.AsyncHttpClient;
|
||||
import com.loopj.android.http.AsyncHttpResponseHandler;
|
||||
import com.loopj.android.http.PersistentCookieStore;
|
||||
import com.loopj.android.http.RequestParams;
|
||||
import com.sipai.jspatrol.Bean.EquList;
|
||||
import com.sipai.jspatrol.Bean.InfoSel;
|
||||
import com.sipai.jspatrol.Bean.ProcessSection;
|
||||
import com.sipai.jspatrol.Fault.SingleChoiceActivity;
|
||||
import com.sipai.jspatrol.R;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import cn.pedant.SweetAlert.SweetAlertDialog;
|
||||
|
||||
public class EquInsertActivity extends AppCompatActivity implements View.OnClickListener {
|
||||
private TextView tv_company,tv_processSection;//厂区,工艺段
|
||||
private String pSectionId = "";
|
||||
private CustomPopWindow mCustomPopWindow;
|
||||
private EditText edt_equno,edt_equname;//设备编号,设备名称
|
||||
private TextView tv_asset,tv_equtypenum,tv_equclass,tv_equspecification,tv_equlevel,tv_pertain_to_equ;//资产类型,设备型号,设备类型,设备规格,设备级别,所属设备
|
||||
private String st_asset,st_equtypenum,st_equclass,st_equspecification,st_equlevel,st_status,st_pertain_to_equ;
|
||||
private EditText edt_assetnumber,edt_assetvalue,edt_ratedpower;//资产编号,资产原值/元,额定功率/KW
|
||||
private EditText edt_cost_of_labor,edt_residual_rate,edt_installation_date,edt_pro_charge;//人工费/元,残值率,安装日期,采购费/元
|
||||
private Button btn_save;//保存
|
||||
private Spinner sp_status;
|
||||
private List<EditText> edts;
|
||||
private EquList sel_equ;
|
||||
private ProcessSection sel_ps;
|
||||
private static final int ASSETCLASS = 101;
|
||||
private static final int EQUTYPENUM = 102;
|
||||
private static final int EQUCLASS = 103;
|
||||
private static final int EQUSPECIFICATION = 104;
|
||||
private static final int EQULEVEL = 105;
|
||||
private static final int PERTAINTOEQU = 106;
|
||||
private static final int SELPS = 8;//选择工艺段
|
||||
|
||||
public static void actionStart(Context context){
|
||||
Intent intent = new Intent(context, EquInsertActivity.class);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_equ_insert);
|
||||
init();
|
||||
initView();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
TextView tv_title = findViewById(R.id.moudle_back_title_tv_title);
|
||||
tv_title.setText("新增设备");
|
||||
ImageView btn_back = findViewById(R.id.moudle_back_title_iv_back);
|
||||
btn_back.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
edts = new ArrayList<>();
|
||||
tv_company = findViewById(R.id.moudle_equ_insert_tv_company);
|
||||
tv_company.setText(mBizName);
|
||||
tv_processSection = findViewById(R.id.moudle_equ_insert_tv_processsection);
|
||||
tv_processSection.setOnClickListener(this);
|
||||
edt_equno = findViewById(R.id.moudle_equ_insert_edt_equno);
|
||||
edt_equname = findViewById(R.id.moudle_equ_insert_edt_equname);
|
||||
tv_asset = findViewById(R.id.moudle_equ_insert_tv_asset);
|
||||
tv_asset.setOnClickListener(this);
|
||||
tv_equtypenum = findViewById(R.id.moudle_equ_insert_tv_equtypenum);
|
||||
tv_equtypenum.setOnClickListener(this);
|
||||
tv_equclass = findViewById(R.id.moudle_equ_insert_tv_equclass);
|
||||
tv_equclass.setOnClickListener(this);
|
||||
tv_equspecification = findViewById(R.id.moudle_equ_insert_tv_equspecification);
|
||||
tv_equspecification.setOnClickListener(this);
|
||||
tv_equlevel = findViewById(R.id.moudle_equ_insert_tv_equlevel);
|
||||
tv_equlevel.setOnClickListener(this);
|
||||
tv_pertain_to_equ = findViewById(R.id.moudle_equ_insert_tv_pertain_to_equ);
|
||||
tv_pertain_to_equ.setOnClickListener(this);
|
||||
edt_assetnumber = findViewById(R.id.moudle_equ_insert_edt_assetnumber);
|
||||
edt_assetvalue = findViewById(R.id.moudle_equ_insert_edt_assetvalue);
|
||||
edt_ratedpower = findViewById(R.id.moudle_equ_insert_edt_ratedpower);
|
||||
edt_pro_charge = findViewById(R.id.moudle_equ_insert_edt_pro_charge);
|
||||
edt_cost_of_labor = findViewById(R.id.moudle_equ_insert_edt_cost_of_labor);
|
||||
edt_residual_rate = findViewById(R.id.moudle_equ_insert_edt_residual_rate);
|
||||
edt_installation_date = findViewById(R.id.moudle_equ_insert_edt_installation_date);
|
||||
btn_save = findViewById(R.id.moudle_equ_insert_btn_save);
|
||||
btn_save.setOnClickListener(this);
|
||||
sp_status = findViewById(R.id.moudle_equ_insert_sp_status);
|
||||
edts.add(edt_equno);
|
||||
edts.add(edt_equname);
|
||||
final String[] status = getResources().getStringArray(R.array.equ_status);
|
||||
ArrayAdapter arrayAdapter = new ArrayAdapter(this, R.layout.item_normal_little_spin, R.id.moudle_normal_little_spin_tv_title,status);
|
||||
sp_status.setAdapter(arrayAdapter);
|
||||
sp_status.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
st_status = String.valueOf(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
switch (requestCode){
|
||||
case ASSETCLASS:
|
||||
if (resultCode==RESULT_OK){
|
||||
InfoSel item = (InfoSel) data.getSerializableExtra("sel");
|
||||
st_asset = item.getId();
|
||||
UpdateTv(tv_asset,item.getText());
|
||||
}
|
||||
break;
|
||||
case EQUTYPENUM:
|
||||
if (resultCode==RESULT_OK){
|
||||
InfoSel item = (InfoSel) data.getSerializableExtra("sel");
|
||||
st_equtypenum = item.getId();
|
||||
UpdateTv(tv_equtypenum,item.getText());
|
||||
}
|
||||
break;
|
||||
case EQUCLASS:
|
||||
if (resultCode==RESULT_OK){
|
||||
InfoSel item = (InfoSel) data.getSerializableExtra("sel");
|
||||
st_equclass = item.getId();
|
||||
UpdateTv(tv_equclass,item.getText());
|
||||
}
|
||||
break;
|
||||
case EQUSPECIFICATION:
|
||||
if (resultCode==RESULT_OK){
|
||||
InfoSel item = (InfoSel) data.getSerializableExtra("sel");
|
||||
st_equspecification = item.getId();
|
||||
UpdateTv(tv_equspecification,item.getText());
|
||||
}
|
||||
break;
|
||||
case EQULEVEL:
|
||||
if (resultCode==RESULT_OK){
|
||||
InfoSel item = (InfoSel) data.getSerializableExtra("sel");
|
||||
st_equlevel = item.getId();
|
||||
UpdateTv(tv_equlevel,item.getText());
|
||||
}
|
||||
break;
|
||||
case PERTAINTOEQU:
|
||||
if (resultCode==RESULT_OK){
|
||||
EquList sel_equ = (EquList) data.getSerializableExtra("sel");
|
||||
st_pertain_to_equ = sel_equ.getId();
|
||||
UpdateTv(tv_pertain_to_equ,sel_equ.getEquipmentname());
|
||||
}
|
||||
break;
|
||||
case SELPS:
|
||||
if (resultCode == RESULT_OK) {
|
||||
sel_ps = (ProcessSection) data.getSerializableExtra("ps");
|
||||
UpdateTv(tv_processSection, sel_ps.getName());
|
||||
pSectionId = sel_ps.getSid();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateTv(final TextView tv, final String text) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
tv.setText(text);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()){
|
||||
case R.id.moudle_equ_insert_tv_asset:
|
||||
Intent intent = new Intent(EquInsertActivity.this, SelActivity.class);
|
||||
intent.putExtra("type","assetclass");
|
||||
startActivityForResult(intent,ASSETCLASS);
|
||||
break;
|
||||
case R.id.moudle_equ_insert_tv_equtypenum:
|
||||
Intent intent_equtypenum = new Intent(EquInsertActivity.this, SelActivity.class);
|
||||
intent_equtypenum.putExtra("type","equtypenum");
|
||||
startActivityForResult(intent_equtypenum,EQUTYPENUM);
|
||||
break;
|
||||
case R.id.moudle_equ_insert_tv_equclass:
|
||||
Intent intent_equclass = new Intent(EquInsertActivity.this, SelActivity.class);
|
||||
intent_equclass.putExtra("type","equclass");
|
||||
startActivityForResult(intent_equclass,EQUCLASS);
|
||||
break;
|
||||
case R.id.moudle_equ_insert_tv_equspecification:
|
||||
Intent intent_equspecification = new Intent(EquInsertActivity.this, SelActivity.class);
|
||||
intent_equspecification.putExtra("type","equspecification");
|
||||
startActivityForResult(intent_equspecification,EQUSPECIFICATION);
|
||||
break;
|
||||
case R.id.moudle_equ_insert_tv_equlevel:
|
||||
Intent intent_equlevel = new Intent(EquInsertActivity.this, SelActivity.class);
|
||||
intent_equlevel.putExtra("type","equlevel");
|
||||
startActivityForResult(intent_equlevel,EQULEVEL);
|
||||
break;
|
||||
case R.id.moudle_equ_insert_tv_pertain_to_equ:
|
||||
Intent intent_pertain = new Intent(EquInsertActivity.this, PertainToEquSelActivity.class);
|
||||
intent_pertain.putExtra("psectionId",pSectionId);
|
||||
startActivityForResult(intent_pertain,PERTAINTOEQU);
|
||||
break;
|
||||
case R.id.moudle_equ_insert_tv_processsection:
|
||||
Intent intent_sel_ps = new Intent(EquInsertActivity.this, SingleChoiceActivity.class);
|
||||
intent_sel_ps.putExtra("mark","ps");
|
||||
startActivityForResult(intent_sel_ps,SELPS);
|
||||
break;
|
||||
case R.id.moudle_equ_insert_btn_save:
|
||||
if (!isEdtEmpty()) {
|
||||
isRepeated();
|
||||
// subEquInfo();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void isRepeated() {
|
||||
PersistentCookieStore myCookieStore = new PersistentCookieStore(this);
|
||||
RequestParams params = new RequestParams();
|
||||
params.put("equipmentcardid",edt_equno.getText().toString());
|
||||
AsyncHttpClient client = new AsyncHttpClient();
|
||||
client.setCookieStore(myCookieStore);
|
||||
client.post(mServer + "equipment/checkExist.do?", params, new AsyncHttpResponseHandler() {
|
||||
@Override
|
||||
public void onSuccess(String response) {
|
||||
super.onSuccess(response);
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(response);
|
||||
if (jsonObject.optBoolean("valid")){
|
||||
subEquInfo();
|
||||
}else {
|
||||
idRepeated();
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable error) {
|
||||
super.onFailure(error);
|
||||
String a = error.toString();
|
||||
if(!EquInsertActivity.this.isFinishing()) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
new SweetAlertDialog(EquInsertActivity.this, SweetAlertDialog.WARNING_TYPE)
|
||||
.setTitleText("提示")
|
||||
.setContentText("连接失败请重试!")
|
||||
.setConfirmText("确认")
|
||||
.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
|
||||
@Override
|
||||
public void onClick(SweetAlertDialog sweetAlertDialog) {
|
||||
sweetAlertDialog.dismissWithAnimation();
|
||||
isRepeated();
|
||||
}
|
||||
}).setCancelText("取消")
|
||||
.setCancelClickListener(new SweetAlertDialog.OnSweetClickListener() {
|
||||
@Override
|
||||
public void onClick(SweetAlertDialog sweetAlertDialog) {
|
||||
sweetAlertDialog.dismissWithAnimation();
|
||||
finish();
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
super.onFinish();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void idRepeated() {
|
||||
if (!EquInsertActivity.this.isFinishing()){
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
new SweetAlertDialog(EquInsertActivity.this, SweetAlertDialog.WARNING_TYPE)
|
||||
.setTitleText("提示")
|
||||
.setContentText("设备编号重复,请修改后提交")
|
||||
.setConfirmText("确定")
|
||||
.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
|
||||
@Override
|
||||
public void onClick(SweetAlertDialog sweetAlertDialog) {
|
||||
sweetAlertDialog.dismissWithAnimation();
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isEdtEmpty() {
|
||||
for (int i=0;i<edts.size();i++){
|
||||
if (edts.get(i).getText()==null||edts.get(i).getText().toString().isEmpty()){
|
||||
final int finalI = i;
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
edts.get(finalI).setError("不能为空");
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void subEquInfo() {
|
||||
String st_assetnumber = "";
|
||||
if (edt_assetnumber.getText()!=null&&!edt_assetnumber.getText().toString().isEmpty()){
|
||||
st_assetnumber = edt_assetnumber.getText().toString();
|
||||
}
|
||||
String st_assetvalue = "";
|
||||
if (edt_assetvalue.getText()!=null&&!edt_assetvalue.getText().toString().isEmpty()){
|
||||
st_assetvalue = edt_assetvalue.getText().toString();
|
||||
}
|
||||
String st_ratedpower = "";
|
||||
if (edt_ratedpower.getText()!=null&&!edt_ratedpower.getText().toString().isEmpty()){
|
||||
st_ratedpower = edt_ratedpower.getText().toString();
|
||||
}
|
||||
PersistentCookieStore myCookieStore = new PersistentCookieStore(this);
|
||||
RequestParams params = new RequestParams();
|
||||
params.put("bizid",mBizid);
|
||||
params.put("processsectionid",pSectionId);//工艺段id
|
||||
params.put("equipmentcardid",edt_equno.getText().toString());//设备编号
|
||||
params.put("assetclassid",st_asset);//资产类型id
|
||||
params.put("equipmentname",edt_equname.getText().toString());//设备名称 (必填
|
||||
params.put("equipmentmodel",st_equtypenum);//设备型号id
|
||||
params.put("equipmentclassid",st_equclass);//设备类型id
|
||||
params.put("specification",st_equspecification);//设备规格id
|
||||
params.put("equipmentlevelid",st_equlevel);//设备级别id
|
||||
params.put("equipmentstatus",st_status);//设备状态
|
||||
params.put("assetnumber",st_assetnumber);//资产编号
|
||||
params.put("pid",mBizid);// 所属设备id
|
||||
params.put("equipmentvalue",st_assetvalue);//资产原值
|
||||
params.put("ratedpower",st_ratedpower);//额定功率
|
||||
AsyncHttpClient client = new AsyncHttpClient();
|
||||
client.setCookieStore(myCookieStore);
|
||||
client.post(mServer + "equipment/dosave.do?", params, new AsyncHttpResponseHandler() {
|
||||
@Override
|
||||
public void onSuccess(String response) {
|
||||
super.onSuccess(response);
|
||||
String res = response;
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(response);
|
||||
if (jsonObject.get("id")!=null){
|
||||
String id = jsonObject.opt("id").toString();
|
||||
subEquInfoProp(id);
|
||||
}else {
|
||||
ErrorDialog();
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable error) {
|
||||
super.onFailure(error);
|
||||
String a = error.toString();
|
||||
ErrorDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
super.onFinish();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加附属表信息
|
||||
*/
|
||||
private void subEquInfoProp(final String id) {
|
||||
String st_pro_charge = "";
|
||||
if (edt_pro_charge.getText()!=null&&!edt_pro_charge.getText().toString().isEmpty()){
|
||||
st_pro_charge = edt_pro_charge.getText().toString();
|
||||
}
|
||||
String st_cost_of_labor = "";
|
||||
if (edt_cost_of_labor.getText()!=null&&!edt_cost_of_labor.getText().toString().isEmpty()){
|
||||
st_cost_of_labor = edt_cost_of_labor.getText().toString();
|
||||
}
|
||||
String st_residual_rate = "";
|
||||
if (edt_residual_rate.getText()!=null&&!edt_residual_rate.getText().toString().isEmpty()){
|
||||
st_residual_rate = edt_residual_rate.getText().toString();
|
||||
}
|
||||
String st_installation_date = "";
|
||||
if (edt_installation_date.getText()!=null&&!edt_installation_date.getText().toString().isEmpty()){
|
||||
st_installation_date = edt_installation_date.getText().toString();
|
||||
}
|
||||
PersistentCookieStore myCookieStore = new PersistentCookieStore(this);
|
||||
RequestParams params = new RequestParams();
|
||||
params.put("equipmentId",id);//采购费
|
||||
params.put("purchaseMoney",st_pro_charge);//采购费
|
||||
params.put("laborMoney ",st_cost_of_labor);//人工费
|
||||
params.put("residualValueRate",st_residual_rate);//残值率
|
||||
params.put("installDate",edt_installation_date.getText().toString());//安装日期
|
||||
AsyncHttpClient client = new AsyncHttpClient();
|
||||
client.setCookieStore(myCookieStore);
|
||||
client.post(mServer + "equipment/dosaveEquipmentProp.do?", params, new AsyncHttpResponseHandler() {
|
||||
@Override
|
||||
public void onSuccess(String response) {
|
||||
super.onSuccess(response);
|
||||
String res = response;
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(response);
|
||||
if (jsonObject.get("id")!=null){
|
||||
String id = jsonObject.opt("id").toString();
|
||||
ShowSuccessDialog();
|
||||
}else {
|
||||
ErrorDialog();
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable error) {
|
||||
super.onFailure(error);
|
||||
String a = error.toString();
|
||||
ErrorDialog();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
super.onFinish();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void ErrorDialog() {
|
||||
if (!EquInsertActivity.this.isFinishing()){
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
new SweetAlertDialog(EquInsertActivity.this, SweetAlertDialog.ERROR_TYPE)
|
||||
.setTitleText("失败")
|
||||
.setContentText("设备录入失败,请重试")
|
||||
.setConfirmText("确定")
|
||||
.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
|
||||
@Override
|
||||
public void onClick(SweetAlertDialog sweetAlertDialog) {
|
||||
sweetAlertDialog.dismissWithAnimation();
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowSuccessDialog() {
|
||||
if (!EquInsertActivity.this.isFinishing()){
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
new SweetAlertDialog(EquInsertActivity.this, SweetAlertDialog.SUCCESS_TYPE)
|
||||
.setTitleText("成功")
|
||||
.setContentText("设备录入成功")
|
||||
.setConfirmText("确定")
|
||||
.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
|
||||
@Override
|
||||
public void onClick(SweetAlertDialog sweetAlertDialog) {
|
||||
sweetAlertDialog.dismissWithAnimation();
|
||||
finish();
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
*/
|
||||
private String mServer;
|
||||
private String mUsername;
|
||||
private String mPassword;
|
||||
private String mUserid;
|
||||
private String mCaption;
|
||||
private String mBizid;
|
||||
private String mBizName;
|
||||
|
||||
public void init(){
|
||||
SharedPreferences sharedPre=getSharedPreferences("config", MODE_PRIVATE);
|
||||
mServer=sharedPre.getString("server", "");
|
||||
mUsername=sharedPre.getString("username", "");
|
||||
mPassword=sharedPre.getString("password", "");
|
||||
mUserid=sharedPre.getString("userid", "");
|
||||
mCaption=sharedPre.getString("caption", "");
|
||||
mBizid=sharedPre.getString("bizid", "");
|
||||
mBizName=sharedPre.getString("bizname", "");
|
||||
}
|
||||
|
||||
private void showText(final String st, final TextView tv) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
tv.setText(st);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
448
app/src/main/java/com/sipai/jspatrol/Equ/EquSearchActivity.java
Normal file
448
app/src/main/java/com/sipai/jspatrol/Equ/EquSearchActivity.java
Normal file
@ -0,0 +1,448 @@
|
||||
package com.sipai.jspatrol.Equ;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.SharedPreferences;
|
||||
import android.nfc.NdefMessage;
|
||||
import android.nfc.NdefRecord;
|
||||
import android.nfc.NfcAdapter;
|
||||
import android.nfc.tech.MifareClassic;
|
||||
import android.nfc.tech.NfcA;
|
||||
import android.os.Bundle;
|
||||
import android.os.Parcelable;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import com.sipai.jspatrol.Bean.EquList;
|
||||
import com.sipai.jspatrol.Bean.Measuringpoint;
|
||||
import com.sipai.jspatrol.Fault.EquSingleChoiceAdapter;
|
||||
import com.sipai.jspatrol.R;
|
||||
import com.sipai.jspatrol.URL.MethodURL;
|
||||
import com.sipai.jspatrol.utils.OKHttpUtils;
|
||||
import com.yzq.zxinglibrary.android.CaptureActivity;
|
||||
import com.yzq.zxinglibrary.bean.ZxingConfig;
|
||||
import com.yzq.zxinglibrary.common.Constant;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Callback;
|
||||
import okhttp3.Response;
|
||||
|
||||
public class EquSearchActivity extends AppCompatActivity implements View.OnClickListener {
|
||||
private ImageView iv_back;
|
||||
private EditText edt_name;
|
||||
private TextView tv_search;
|
||||
private String mServer;
|
||||
private String mUsername;
|
||||
private String mPassword;
|
||||
private String mUserid;
|
||||
private String mCaption;
|
||||
private String mBizid, mBizName;
|
||||
private String name = "";
|
||||
private String sel_ps_id = "";
|
||||
private RecyclerView rc_list;
|
||||
private SwipeRefreshLayout refreshLayout;
|
||||
private List<EquList> equLists = new ArrayList<>();
|
||||
private EquSingleChoiceAdapter equAdapter;
|
||||
private LinearLayoutManager manager;
|
||||
private ImageView civ;
|
||||
private ImageView iv_add;
|
||||
private NfcAdapter nfcAdapter;
|
||||
// 是否支持NFC功能的标签
|
||||
private boolean isNFC_support = false;
|
||||
private PendingIntent pendingIntent;
|
||||
private IntentFilter[] mFilters;
|
||||
private String[][] mTechLists;
|
||||
private static final int REQUEST_CODE_SCAN = 23;
|
||||
|
||||
public static void actionStart(Context context){
|
||||
Intent intent = new Intent(context, EquSearchActivity.class);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_equ_search);
|
||||
init();
|
||||
initView();
|
||||
checkNFC();
|
||||
startSearch();
|
||||
}
|
||||
|
||||
private void checkNFC() {
|
||||
// 获取nfc适配器,判断设备是否支持NFC功能
|
||||
nfcAdapter = NfcAdapter.getDefaultAdapter(this);
|
||||
if (nfcAdapter == null) {
|
||||
Toast.makeText(this, getResources().getString(R.string.no_nfc),
|
||||
Toast.LENGTH_SHORT).show();
|
||||
} else if (!nfcAdapter.isEnabled()) {
|
||||
Toast.makeText(this, getResources().getString(R.string.open_nfc),
|
||||
Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
pendingIntent = PendingIntent.getActivity(this, 0, new Intent(this,
|
||||
getClass()).addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP), 0);
|
||||
IntentFilter ndef = new IntentFilter(NfcAdapter.ACTION_TECH_DISCOVERED);
|
||||
ndef.addCategory("*/*");
|
||||
mFilters = new IntentFilter[]{ndef};// 过滤器
|
||||
mTechLists = new String[][]{
|
||||
new String[]{MifareClassic.class.getName()},
|
||||
new String[]{NfcA.class.getName()}};// 允许扫描的标签类型
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
nfcAdapter = NfcAdapter.getDefaultAdapter(this);
|
||||
isNFC_support = !(nfcAdapter == null || !nfcAdapter.isEnabled());
|
||||
if (isNFC_support) {
|
||||
nfcAdapter.enableForegroundDispatch(this, pendingIntent, mFilters,
|
||||
mTechLists);
|
||||
if (NfcAdapter.ACTION_TECH_DISCOVERED.equals(getIntent().getAction())) {
|
||||
// 注意这个if中的代码几乎不会进来,因为刚刚在上一行代码开启了监听NFC连接,下一行代码马上就收到了NFC连接的intent,这种几率很小
|
||||
// 处理该intent
|
||||
String result = processIntent(getIntent());
|
||||
searchSingleEqu(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
civ = findViewById(R.id.moudle_equ_search_civ);
|
||||
civ.setOnClickListener(this);
|
||||
iv_back = findViewById(R.id.moudle_equ_search_iv_back);
|
||||
iv_back.setOnClickListener(this);
|
||||
edt_name = findViewById(R.id.moudle_equ_search_edt_equname);
|
||||
tv_search = findViewById(R.id.moudle_equ_search_tv_search);
|
||||
tv_search.setOnClickListener(this);
|
||||
rc_list = findViewById(R.id.moudle_equ_search_rc);
|
||||
refreshLayout = findViewById(R.id.moudle_equ_search_refresh);
|
||||
refreshLayout.setColorSchemeResources(R.color.blue);
|
||||
refreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
startSearch();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void init() {
|
||||
SharedPreferences sharedPre = this.getSharedPreferences("config", 0);
|
||||
mServer = sharedPre.getString("server", "");
|
||||
mUsername = sharedPre.getString("username", "");
|
||||
mPassword = sharedPre.getString("password", "");
|
||||
mUserid = sharedPre.getString("userid", "");
|
||||
mCaption = sharedPre.getString("caption", "");
|
||||
mBizid = sharedPre.getString("bizid", "");
|
||||
mBizName = sharedPre.getString("bizname", "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()){
|
||||
case R.id.moudle_equ_search_iv_back:
|
||||
finish();
|
||||
break;
|
||||
case R.id.moudle_equ_search_tv_search:
|
||||
startSearch();
|
||||
break;
|
||||
case R.id.moudle_equ_search_civ:
|
||||
Intent intent = new Intent(EquSearchActivity.this, CaptureActivity.class);
|
||||
/*ZxingConfig是配置类
|
||||
*可以设置是否显示底部布局,闪光灯,相册,
|
||||
* 是否播放提示音 震动
|
||||
* 设置扫描框颜色等
|
||||
* 也可以不传这个参数
|
||||
* */
|
||||
ZxingConfig config = new ZxingConfig();
|
||||
config.setPlayBeep(true);//是否播放扫描声音 默认为true
|
||||
config.setShake(true);//是否震动 默认为true
|
||||
config.setDecodeBarCode(true);//是否扫描条形码 默认为true
|
||||
config.setFullScreenScan(false);//是否全屏扫描 默认为true 设为false则只会在扫描框中扫描
|
||||
intent.putExtra(Constant.INTENT_ZXING_CONFIG, config);
|
||||
startActivityForResult(intent, REQUEST_CODE_SCAN);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
// 扫描二维码/条码回传
|
||||
if (requestCode == REQUEST_CODE_SCAN && resultCode == RESULT_OK) {
|
||||
if (data != null) {
|
||||
String content = data.getStringExtra(Constant.CODED_CONTENT);
|
||||
searchSingleEqu(content);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取tab标签中的内容
|
||||
*
|
||||
* @param intent
|
||||
* @return
|
||||
*/
|
||||
@SuppressLint("NewApi")
|
||||
private String processIntent(Intent intent) {
|
||||
Parcelable[] rawmsgs = intent
|
||||
.getParcelableArrayExtra(NfcAdapter.EXTRA_NDEF_MESSAGES);
|
||||
if (rawmsgs != null) {
|
||||
NdefMessage msg = (NdefMessage) rawmsgs[0];
|
||||
NdefRecord[] records = msg.getRecords();
|
||||
String resultStr = new String(records[0].getPayload());
|
||||
return resultStr;
|
||||
} else {
|
||||
return "error";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
if (nfcAdapter != null && nfcAdapter.isEnabled()) {
|
||||
// 当前Activity如果不在手机的最前端,就停止NFC设备连接的监听
|
||||
stopNFC_Listener();
|
||||
}
|
||||
}
|
||||
|
||||
private void stopNFC_Listener() {
|
||||
// 停止监听NFC设备是否连接
|
||||
nfcAdapter.disableForegroundDispatch(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onNewIntent(Intent intent) {
|
||||
// TODO Auto-generated method stub
|
||||
// 当前app正在前端界面运行,这个时候有intent发送过来,那么系统就会调用onNewIntent回调方法,将intent传送过来
|
||||
// 我们只需要在这里检验这个intent是否是NFC相关的intent,如果是,就调用处理方法
|
||||
super.onNewIntent(intent);
|
||||
if (NfcAdapter.ACTION_TECH_DISCOVERED.equals(intent.getAction())) {
|
||||
String result = processIntent(intent);
|
||||
searchSingleEqu(result);
|
||||
}
|
||||
}
|
||||
|
||||
private void startSearch() {
|
||||
if (edt_name.getText()!=null&&!edt_name.getText().toString().isEmpty()){
|
||||
name = edt_name.getText().toString();
|
||||
}
|
||||
judgeRefresh();
|
||||
searchEqu(name);
|
||||
}
|
||||
|
||||
private void judgeRefresh() {
|
||||
if (!EquSearchActivity.this.isFinishing()){
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!refreshLayout.isRefreshing()){
|
||||
refreshLayout.setRefreshing(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索设备
|
||||
* @param name
|
||||
*/
|
||||
private void searchEqu(String name) {
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("companyId",mBizid);
|
||||
map.put("search_name",name);
|
||||
map.put("processSectionId",sel_ps_id);
|
||||
map.put("rows","50");
|
||||
map.put("page","1");
|
||||
OKHttpUtils.getClient().newCall(OKHttpUtils.OKHttpRequest(map, mServer, MethodURL.GETEQULISt_Method)).enqueue(new Callback() {
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e) {
|
||||
if (!EquSearchActivity.this.isFinishing()){
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
refreshLayout.setRefreshing(false);
|
||||
Toast.makeText(EquSearchActivity.this, "失败:" + e.toString(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException {
|
||||
String res = response.body().string();
|
||||
if (res.contains("total")&&res.contains("rows")) {
|
||||
equLists = parseEqu(res);
|
||||
}
|
||||
updateEquList();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 搜索单个设备
|
||||
* @param id
|
||||
*/
|
||||
private void searchSingleEqu(String id) {
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("id",id);
|
||||
OKHttpUtils.getClient().newCall(OKHttpUtils.OKHttpRequest(map, mServer, MethodURL.GETSINGLEEQU_Method)).enqueue(new Callback() {
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e) {
|
||||
if (!EquSearchActivity.this.isFinishing()){
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
refreshLayout.setRefreshing(false);
|
||||
Toast.makeText(EquSearchActivity.this, "失败:" + e.toString(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException {
|
||||
String res = response.body().string();
|
||||
if (res.contains("total")&&res.contains("rows")) {
|
||||
equLists = parseEqu(res);
|
||||
if (equLists.size()>0){
|
||||
EquCardActivity.actionStart(EquSearchActivity.this,equLists.get(0));
|
||||
// EquDetailActivity.actionStart(EquSearchActivity.this,equLists.get(0));
|
||||
}else {
|
||||
showToast("未搜到该设备!");
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void showToast(String s) {
|
||||
if (!EquSearchActivity.this.isFinishing()){
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Toast.makeText(EquSearchActivity.this, s, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void updateEquList() {
|
||||
if (!EquSearchActivity.this.isFinishing()){
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
refreshLayout.setRefreshing(false);
|
||||
equAdapter = new EquSingleChoiceAdapter(EquSearchActivity.this, equLists, new EquSingleChoiceAdapter.onRecyclerViewItemClick() {
|
||||
@Override
|
||||
public void onItemClick(View v, int position) {
|
||||
EquCardActivity.actionStart(EquSearchActivity.this,equLists.get(position));
|
||||
// EquDetailActivity.actionStart(EquSearchActivity.this,equLists.get(position));
|
||||
}
|
||||
});
|
||||
rc_list.setAdapter(equAdapter);
|
||||
manager = new LinearLayoutManager(EquSearchActivity.this);
|
||||
rc_list.setLayoutManager(manager);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private List<EquList> parseEqu(String res) {
|
||||
List<EquList> list = new ArrayList<>();
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(res);
|
||||
JSONArray array = jsonObject.getJSONArray("rows");
|
||||
for (int i=0;i<array.length();i++){
|
||||
EquList item = new EquList();
|
||||
item.setId(array.getJSONObject(i).optString("id"));
|
||||
item.setEquipmentmanufacturer(array.getJSONObject(i).optString("equipmentmanufacturer"));
|
||||
item.setEquipmentname(array.getJSONObject(i).optString("equipmentname"));
|
||||
item.setEquipmentcardid(array.getJSONObject(i).optString("equipmentcardid"));
|
||||
item.setEquipmentmodel(array.getJSONObject(i).optString("equipmentmodelname"));
|
||||
item.setAssetnumber(array.getJSONObject(i).optString("assetnumber"));
|
||||
if (!array.getJSONObject(i).optString("processSection").equals("null")&&!array.getJSONObject(i).optString("processSection").isEmpty()){
|
||||
JSONObject js = new JSONObject(array.getJSONObject(i).optString("processSection"));
|
||||
item.setProcessSection(js.optString("name"));
|
||||
item.setProcesssectionid(js.optString("id"));
|
||||
}else {
|
||||
item.setProcessSection("暂未配置");
|
||||
}
|
||||
if (!array.getJSONObject(i).optString("equipmentStatusManagement").equals("null")&&!array.getJSONObject(i).optString("equipmentStatusManagement").isEmpty()){
|
||||
JSONObject js = new JSONObject(array.getJSONObject(i).optString("equipmentStatusManagement"));
|
||||
item.setEquipmentStatusManagement(js.optString("name"));
|
||||
}else {
|
||||
item.setEquipmentStatusManagement("未知");
|
||||
}
|
||||
if (!array.getJSONObject(i).optString("equipmentLevel").equals("null")&&!array.getJSONObject(i).optString("equipmentLevel").isEmpty()){
|
||||
JSONObject js = new JSONObject(array.getJSONObject(i).optString("equipmentLevel"));
|
||||
item.setEquipmentLevel(js.optString("levelname")+"类");
|
||||
}else {
|
||||
item.setEquipmentLevel("未知");
|
||||
}
|
||||
item.setAreaid(array.getJSONObject(i).optString("areaid"));
|
||||
if (!array.getJSONObject(i).optString("company").equals("null")&&!array.getJSONObject(i).optString("company").isEmpty()){
|
||||
JSONObject js = new JSONObject(array.getJSONObject(i).optString("company"));
|
||||
item.setCompany(js.optString("name"));
|
||||
}else {
|
||||
item.setCompany("暂未配置");
|
||||
}
|
||||
if (!array.getJSONObject(i).optString("equipmentTypeNumber").equals("null")&&!array.getJSONObject(i).optString("equipmentTypeNumber").isEmpty()){
|
||||
JSONObject js = new JSONObject(array.getJSONObject(i).optString("equipmentTypeNumber"));
|
||||
item.setEquipmentTypeNumber(js.optString("name"));
|
||||
}else {
|
||||
item.setEquipmentTypeNumber("暂未配置");
|
||||
}
|
||||
if (!array.getJSONObject(i).optString("equipmentClass").equals("null")&&!array.getJSONObject(i).optString("equipmentClass").isEmpty()){
|
||||
JSONObject js = new JSONObject(array.getJSONObject(i).optString("equipmentClass"));
|
||||
item.setEquipmentClass(js.optString("name"));
|
||||
}else {
|
||||
item.setEquipmentClass("暂未配置");
|
||||
}
|
||||
if (!array.getJSONObject(i).optString("mPoint4APP").equals("null")&&!array.getJSONObject(i).optString("mPoint4APP").isEmpty()){
|
||||
JSONArray arrayPoint = array.getJSONObject(i).getJSONArray("mPoint4APP");
|
||||
List<Measuringpoint> points = new ArrayList<>();
|
||||
for (int a=0;a<arrayPoint.length();a++){
|
||||
Measuringpoint point = new Measuringpoint();
|
||||
point.setSid(arrayPoint.getJSONObject(a).opt("id").toString());
|
||||
point.setName(arrayPoint.getJSONObject(a).opt("parmname").toString());
|
||||
point.setUnit(arrayPoint.getJSONObject(a).opt("unit").toString());
|
||||
point.setCvalue(arrayPoint.getJSONObject(a).opt("parmvalue").toString());
|
||||
point.setType(arrayPoint.getJSONObject(a).opt("signalType").toString());
|
||||
point.setScadacode(arrayPoint.getJSONObject(a).opt("id").toString());
|
||||
point.setAlarmmax(arrayPoint.getJSONObject(a).opt("alarmmax").toString());
|
||||
point.setAlarmmin(arrayPoint.getJSONObject(a).opt("alarmmin").toString());
|
||||
points.add(point);
|
||||
}
|
||||
item.setMeasuringpoints(points);
|
||||
}
|
||||
list.add(item);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,161 @@
|
||||
package com.sipai.jspatrol.Equ.Equfrgment;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.sipai.jspatrol.Bean.EquList;
|
||||
import com.sipai.jspatrol.Bean.Measuringpoint;
|
||||
import com.sipai.jspatrol.Equ.EquCardActivity;
|
||||
import com.sipai.jspatrol.ProMonitoring.MeasurePointsAdapter;
|
||||
import com.sipai.jspatrol.R;
|
||||
import com.sipai.jspatrol.URL.MethodURL;
|
||||
import com.sipai.jspatrol.utils.OKHttpUtils;
|
||||
import com.sipai.jspatrol.utils.SharedPreferencesData;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Callback;
|
||||
import okhttp3.Response;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2020/10/22
|
||||
*/
|
||||
public class EquDetailFragment extends Fragment {
|
||||
private SharedPreferencesData sharedpre;
|
||||
private HashMap<String, String> map_base = new HashMap<>();
|
||||
private String mServer;
|
||||
private TextView tv_name,tv_areaid,tv_equcardid,tv_equtype,tv_ps,tv_equmf,tv_company,tv_abc,tv_type,tv_assetnumber,tv_equstatus;
|
||||
private EquList equ;
|
||||
private RecyclerView rc_view;
|
||||
private LinearLayoutManager manager;
|
||||
private MeasurePointsAdapter pointsAdapter;
|
||||
private List<Measuringpoint> measuringpoints = new ArrayList<>();
|
||||
private String mBizid;
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_equ_detail,container,false);
|
||||
init();
|
||||
initView(view);
|
||||
// getEquPoints();
|
||||
return view;
|
||||
}
|
||||
|
||||
private void init() {
|
||||
EquCardActivity equcard = (EquCardActivity) getActivity();
|
||||
equ = equcard.getEquList();
|
||||
sharedpre = new SharedPreferencesData(getActivity());
|
||||
map_base = sharedpre.getAll();
|
||||
mServer = map_base.get("mServer");
|
||||
SharedPreferences sharedPre = getActivity().getSharedPreferences("config", 0);
|
||||
mBizid = sharedPre.getString("bizid", "");
|
||||
}
|
||||
|
||||
private void initView(View view) {
|
||||
tv_name = view.findViewById(R.id.moudle_equ_detail_tv_equipmentname);
|
||||
tv_name.setText(equ.getEquipmentname());
|
||||
tv_equstatus = view.findViewById(R.id.moudle_equ_detail_tv_equstatus);
|
||||
tv_equstatus.setText(equ.getEquipmentStatusManagement());
|
||||
tv_areaid = view.findViewById(R.id.moudle_equ_detail_tv_areaid);
|
||||
tv_areaid.setText(equ.getAreaid());
|
||||
tv_abc = view.findViewById(R.id.moudle_equ_detail_tv_abc);
|
||||
tv_abc.setText(equ.getEquipmentLevel());
|
||||
tv_assetnumber = view.findViewById(R.id.moudle_equ_detail_tv_assetnumber);
|
||||
tv_assetnumber.setText(equ.getAssetnumber());
|
||||
tv_equcardid = view.findViewById(R.id.moudle_equ_detail_tv_equipmentcardid);
|
||||
tv_equcardid.setText(equ.getEquipmentcardid());
|
||||
tv_equtype = view.findViewById(R.id.moudle_equ_detail_tv_equtype);
|
||||
tv_equtype.setText(equ.getEquipmentTypeNumber());
|
||||
tv_ps = view.findViewById(R.id.moudle_equ_detail_tv_ps);
|
||||
tv_ps.setText(equ.getProcessSection());
|
||||
tv_equmf = view.findViewById(R.id.moudle_equ_detail_tv_equmf);
|
||||
tv_equmf.setText(equ.getEquipmentmanufacturer());
|
||||
tv_company = view.findViewById(R.id.moudle_equ_detail_tv_company);
|
||||
tv_company.setText(equ.getCompany());
|
||||
tv_type = view.findViewById(R.id.moudle_equ_detail_tv_type);
|
||||
tv_type.setText(equ.getEquipmentClass());
|
||||
rc_view = view.findViewById(R.id.moudle_equ_detail_rc_point);
|
||||
manager = new LinearLayoutManager(getActivity());
|
||||
rc_view.setLayoutManager(manager);
|
||||
}
|
||||
|
||||
private void getEquPoints() {
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("equipmentId",equ.getId());
|
||||
OKHttpUtils.getClient().newCall(OKHttpUtils.OKHttpRequest(map, mServer, MethodURL.GETEquPoints_Method)).enqueue(new Callback() {
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e) {
|
||||
String a = e.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException {
|
||||
String res = response.body().string();
|
||||
measuringpoints = parseMeasuringPoints(res);
|
||||
if (measuringpoints.size()>0){
|
||||
updatePoints();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void updatePoints() {
|
||||
if (!getActivity().isFinishing()){
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
pointsAdapter = new MeasurePointsAdapter(getActivity(),measuringpoints);
|
||||
rc_view.setAdapter(pointsAdapter);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private List<Measuringpoint> parseMeasuringPoints(String res) {
|
||||
List<Measuringpoint> points = new ArrayList<>();
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(res);
|
||||
JSONArray arrayPoint = jsonObject.getJSONArray("mPoint4APP");
|
||||
for (int a=0;a<arrayPoint.length();a++){
|
||||
Measuringpoint point = new Measuringpoint();
|
||||
point.setSid(arrayPoint.getJSONObject(a).opt("id").toString());
|
||||
point.setName(arrayPoint.getJSONObject(a).opt("parmname").toString());
|
||||
point.setUnit(arrayPoint.getJSONObject(a).opt("unit").toString());
|
||||
point.setCvalue(arrayPoint.getJSONObject(a).opt("parmvalue").toString());
|
||||
point.setType(arrayPoint.getJSONObject(a).opt("signalType").toString());
|
||||
point.setScadacode(arrayPoint.getJSONObject(a).opt("id").toString());
|
||||
point.setAlarmmax(arrayPoint.getJSONObject(a).opt("alarmmax").toString());
|
||||
point.setAlarmmin(arrayPoint.getJSONObject(a).opt("alarmmin").toString());
|
||||
points.add(point);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return points;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,181 @@
|
||||
package com.sipai.jspatrol.Equ.Equfrgment;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import com.sipai.jspatrol.Bean.EquList;
|
||||
import com.sipai.jspatrol.Bean.Measuringpoint;
|
||||
import com.sipai.jspatrol.Equ.EquCardActivity;
|
||||
import com.sipai.jspatrol.ProMonitoring.MeasurePointsAdapter;
|
||||
import com.sipai.jspatrol.R;
|
||||
import com.sipai.jspatrol.URL.MethodURL;
|
||||
import com.sipai.jspatrol.utils.OKHttpUtils;
|
||||
import com.sipai.jspatrol.utils.SharedPreferencesData;
|
||||
import com.sipai.ui.EmptyLayout;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Callback;
|
||||
import okhttp3.Response;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2020/10/22
|
||||
*/
|
||||
public class EquDocumentFragment extends Fragment {
|
||||
private SharedPreferencesData sharedpre;
|
||||
private HashMap<String, String> map_base = new HashMap<>();
|
||||
private String mServer;
|
||||
private EquList equ;
|
||||
private String mBizid;
|
||||
private int page = 1;
|
||||
private EmptyLayout emptyLayout;
|
||||
private SwipeRefreshLayout refresh;
|
||||
private RecyclerView rc_view;
|
||||
private LinearLayoutManager manager;
|
||||
private MeasurePointsAdapter pointsAdapter;
|
||||
private List<Measuringpoint> measuringpoints = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_equ_document,container,false);
|
||||
init();
|
||||
initView(view);
|
||||
// getDocuments();
|
||||
return view;
|
||||
}
|
||||
|
||||
private void init() {
|
||||
EquCardActivity equcard = (EquCardActivity) getActivity();
|
||||
equ = equcard.getEquList();
|
||||
sharedpre = new SharedPreferencesData(getActivity());
|
||||
map_base = sharedpre.getAll();
|
||||
mServer = map_base.get("mServer");
|
||||
SharedPreferences sharedPre = getActivity().getSharedPreferences("config", 0);
|
||||
mBizid = sharedPre.getString("bizid", "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
getEquPoints();
|
||||
// getDocuments();
|
||||
}
|
||||
|
||||
private void initView(View view) {
|
||||
emptyLayout = view.findViewById(R.id.moudle_equ_doc_ui_empty);
|
||||
rc_view = view.findViewById(R.id.moudle_equ_doc_rc_point);
|
||||
manager = new LinearLayoutManager(getActivity());
|
||||
rc_view.setLayoutManager(manager);
|
||||
refresh = view.findViewById(R.id.moudle_equ_doc_refresh);
|
||||
refresh.setColorSchemeResources(R.color.blue);
|
||||
refresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
getEquPoints();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
private void getEquPoints() {
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("equipmentId",equ.getId());
|
||||
OKHttpUtils.getClient().newCall(OKHttpUtils.OKHttpRequest(map, mServer, MethodURL.GETEquPoints_Method)).enqueue(new Callback() {
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e) {
|
||||
String a = e.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException {
|
||||
String res = response.body().string();
|
||||
measuringpoints = parseMeasuringPoints(res);
|
||||
if (measuringpoints.size()>0){
|
||||
updatePoints();
|
||||
}else {
|
||||
showEmpty();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void showEmpty() {
|
||||
if (isAdded()) {
|
||||
if (!getActivity().isFinishing()) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
refresh.setRefreshing(false);
|
||||
rc_view.setVisibility(View.GONE);
|
||||
emptyLayout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void updatePoints() {
|
||||
if (isAdded()) {
|
||||
if (!getActivity().isFinishing()) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
refresh.setRefreshing(false);
|
||||
rc_view.setVisibility(View.VISIBLE);
|
||||
emptyLayout.setVisibility(View.GONE);
|
||||
pointsAdapter = new MeasurePointsAdapter(getActivity(), measuringpoints);
|
||||
rc_view.setAdapter(pointsAdapter);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<Measuringpoint> parseMeasuringPoints(String res) {
|
||||
List<Measuringpoint> points = new ArrayList<>();
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(res);
|
||||
JSONArray arrayPoint = jsonObject.getJSONArray("mPoint4APP");
|
||||
for (int a=0;a<arrayPoint.length();a++){
|
||||
Measuringpoint point = new Measuringpoint();
|
||||
point.setSid(arrayPoint.getJSONObject(a).opt("id").toString());
|
||||
point.setName(arrayPoint.getJSONObject(a).opt("parmname").toString());
|
||||
point.setUnit(arrayPoint.getJSONObject(a).opt("unit").toString());
|
||||
point.setCvalue(arrayPoint.getJSONObject(a).opt("parmvalue").toString());
|
||||
point.setType(arrayPoint.getJSONObject(a).opt("signalType").toString());
|
||||
point.setScadacode(arrayPoint.getJSONObject(a).opt("id").toString());
|
||||
point.setAlarmmax(arrayPoint.getJSONObject(a).opt("alarmmax").toString());
|
||||
point.setAlarmmin(arrayPoint.getJSONObject(a).opt("alarmmin").toString());
|
||||
points.add(point);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return points;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,431 @@
|
||||
package com.sipai.jspatrol.Equ.Equfrgment;
|
||||
|
||||
import android.app.DatePickerDialog;
|
||||
import android.app.TimePickerDialog;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.DatePicker;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TimePicker;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import com.sipai.jspatrol.Bean.EquList;
|
||||
import com.sipai.jspatrol.Bean.Fault;
|
||||
import com.sipai.jspatrol.Bean.ProcessSection;
|
||||
import com.sipai.jspatrol.Equ.EquCardActivity;
|
||||
import com.sipai.jspatrol.Fault.adapter.DoneFaultAdapter;
|
||||
import com.sipai.jspatrol.R;
|
||||
import com.sipai.jspatrol.URL.MethodURL;
|
||||
import com.sipai.jspatrol.utils.DateFormatUtils;
|
||||
import com.sipai.jspatrol.utils.Global.GlobalVal;
|
||||
import com.sipai.jspatrol.utils.OKHttpUtils;
|
||||
import com.sipai.jspatrol.utils.SharedPreferencesData;
|
||||
import com.sipai.ui.EmptyLayout;
|
||||
import com.superrecycleview.superlibrary.recycleview.SuperRecyclerView;
|
||||
//import com.superrecycleview.superlibrary.utils.SuperDivider;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Callback;
|
||||
import okhttp3.Response;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2020/10/22
|
||||
*/
|
||||
public class EquFaultListFragment extends Fragment {
|
||||
private SharedPreferencesData sharedpre;
|
||||
private HashMap<String, String> map_base = new HashMap<>();
|
||||
private String mServer;
|
||||
private String mBizid;
|
||||
private EquList equ;
|
||||
private EditText tvstartdate,tvenddate;
|
||||
private int year,month,day,hour,minute,lastday,lastmonth;
|
||||
private int page = 1;
|
||||
private List<Fault> faults = new ArrayList<>();
|
||||
private DoneFaultAdapter doneFaultAdapter;
|
||||
private LinearLayoutManager manager;
|
||||
private SuperRecyclerView rc_view;
|
||||
private SwipeRefreshLayout refresh;
|
||||
private EmptyLayout emptyLayout;
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
init();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_equ_fault_list,container,false);
|
||||
initView(view);
|
||||
getFaultList();
|
||||
return view;
|
||||
}
|
||||
|
||||
private void initView(View view) {
|
||||
tvstartdate=(EditText)view.findViewById(R.id.moudle_equ_fault_list_edt_sd);
|
||||
tvstartdate.setCursorVisible(false);
|
||||
tvstartdate.setOnTouchListener(new View.OnTouchListener() {
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
//创建DatePickerDialog对象
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
MyDatePickerDialog dpd = new MyDatePickerDialog(getActivity(), Datelistener, year, month, day);
|
||||
dpd.show();//显示DatePickerDialog组件
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
tvenddate=(EditText)view.findViewById(R.id.moudle_equ_fault_list_edt_ed);
|
||||
tvenddate.setCursorVisible(false);
|
||||
tvenddate.setOnTouchListener(new View.OnTouchListener() {
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
//创建DatePickerDialog对象
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
MyDatePickerDialog dpd = new MyDatePickerDialog(getActivity(), Datelistener, year, month, day);
|
||||
dpd.show();//显示DatePickerDialog组件
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (day==1){
|
||||
if (month!=0) {
|
||||
Calendar calendar = Calendar.getInstance(Locale.CHINA);
|
||||
calendar.set(Calendar.MONTH, month - 1);
|
||||
int tday = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
|
||||
tvstartdate.setText(DateFormatUtils.DateFormatMinString(year + "-" + (month) + "-" + lastday + " " + hour + ":" + minute));
|
||||
}else{
|
||||
Calendar calendar = Calendar.getInstance(Locale.CHINA);
|
||||
calendar.set(Calendar.MONTH, 11);
|
||||
int tday = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
|
||||
tvstartdate.setText(DateFormatUtils.DateFormatMinString((year-1) + "-" + 12 + "-" + lastday + " " + hour + ":" + minute));
|
||||
}
|
||||
}else {
|
||||
tvstartdate.setText(DateFormatUtils.DateFormatMinString(year + "-" + (lastmonth + 1) + "-" + lastday + " " + hour + ":" + minute));
|
||||
}
|
||||
tvenddate.setText(DateFormatUtils.DateFormatMinString(year+"-"+(month+1)+"-"+day+" "+hour+":"+minute));
|
||||
rc_view = view.findViewById(R.id.moudle_equ_fault_list_rc);
|
||||
emptyLayout = view.findViewById(R.id.moudle_equ_fault_list_ui_empty);
|
||||
refresh = view.findViewById(R.id.moudle_equ_fault_list_refresh);
|
||||
refresh.setColorSchemeResources(R.color.blue);
|
||||
refresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
page = 1;
|
||||
getFaultList();
|
||||
}
|
||||
});
|
||||
manager = new LinearLayoutManager(getActivity());
|
||||
rc_view.setLayoutManager(manager);
|
||||
rc_view.setRefreshEnabled(false);
|
||||
rc_view.setLoadMoreEnabled(true);
|
||||
rc_view.setLoadingListener(new SuperRecyclerView.LoadingListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMore() {
|
||||
page = page+1;
|
||||
getFaultList();
|
||||
}
|
||||
});
|
||||
// rc_view.addItemDecoration(SuperDivider.newBitmapDivider());
|
||||
}
|
||||
|
||||
|
||||
private void init() {
|
||||
EquCardActivity equcard = (EquCardActivity) getActivity();
|
||||
equ = equcard.getEquList();
|
||||
sharedpre = new SharedPreferencesData(getActivity());
|
||||
map_base = sharedpre.getAll();
|
||||
mServer = map_base.get("mServer");
|
||||
SharedPreferences sharedPre = getActivity().getSharedPreferences("config", 0);
|
||||
mBizid = sharedPre.getString("bizid", "");
|
||||
//初始化Calendar日历对象
|
||||
Calendar mycalendar=Calendar.getInstance(Locale.CHINA);
|
||||
Date mydate=new Date(); //获取当前日期Date对象
|
||||
mycalendar.setTime(mydate);////为Calendar对象设置时间为当前日期
|
||||
year=mycalendar.get(Calendar.YEAR); //获取Calendar对象中的年
|
||||
month=mycalendar.get(Calendar.MONTH);//获取Calendar对象中的月
|
||||
day=mycalendar.get(Calendar.DAY_OF_MONTH);//获取这个月的第几天
|
||||
lastday=getBeforeDay(mycalendar).get(Calendar.DAY_OF_MONTH);
|
||||
lastmonth=getBeforeDay(mycalendar).get(Calendar.MONTH);
|
||||
hour=mycalendar.get(Calendar.HOUR_OF_DAY);//获取这个月的第几天
|
||||
minute=mycalendar.get(Calendar.MINUTE);//获取这个月的第几天
|
||||
}
|
||||
|
||||
private void getFaultList() {
|
||||
isShowRefresh();
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("type", GlobalVal.Fault_Type);
|
||||
map.put("rows","20");
|
||||
map.put("page",String.valueOf(page));
|
||||
map.put("search_code",mBizid);
|
||||
map.put("processSectionId",equ.getProcesssectionid());
|
||||
map.put("equipmentId",equ.getId());
|
||||
map.put("status", GlobalVal.Fault_Status_Finish);
|
||||
map.put("beginTimeStore",tvstartdate.getText().toString());
|
||||
map.put("endTimeStore",tvenddate.getText().toString());
|
||||
OKHttpUtils.getClient().newCall(OKHttpUtils.OKHttpRequest(map, mServer, MethodURL.GETEquFaults_Method)).enqueue(new Callback() {
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e) {
|
||||
String a = e.toString();
|
||||
showError(a);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException {
|
||||
String res = response.body().string();
|
||||
if (page==1) {
|
||||
faults = parseFault(res);
|
||||
ifShowTheEmpty();
|
||||
setAdapter();
|
||||
}else {
|
||||
List<Fault> list = parseFault(res);
|
||||
if (list.size()>0) {
|
||||
faults.addAll(list);
|
||||
updateLoadMore();
|
||||
}else {
|
||||
noMore();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void isShowRefresh() {
|
||||
if (!getActivity().isFinishing()){
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (page==1) {
|
||||
if (!refresh.isRefreshing()) {
|
||||
refresh.setRefreshing(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void showError(String a) {
|
||||
if (!getActivity().isFinishing()){
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
refresh.setRefreshing(false);
|
||||
Toast.makeText(getActivity(), ""+a, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
是否显示暂无数据布局
|
||||
*/
|
||||
private void ifShowTheEmpty() {
|
||||
if (!getActivity().isFinishing()) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (faults.size() == 0) {
|
||||
emptyLayout.setVisibility(View.VISIBLE);
|
||||
rc_view.setVisibility(View.GONE);
|
||||
} else {
|
||||
emptyLayout.setVisibility(View.GONE);
|
||||
rc_view.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void updateLoadMore() {
|
||||
if (!getActivity().isFinishing()){
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
rc_view.completeLoadMore();
|
||||
doneFaultAdapter.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void noMore() {
|
||||
if (!getActivity().isFinishing()){
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Toast.makeText(getActivity(), "这次是真没有了~", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private List<Fault> parseFault(String response) {
|
||||
List<Fault> list = new ArrayList<>();
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(response);
|
||||
JSONArray dones = new JSONArray(jsonObject.getString("content1"));
|
||||
for (int i=0;i<dones.length();i++){
|
||||
Fault done_fault = new Fault();
|
||||
done_fault.setId(dones.getJSONObject(i).opt("id").toString());
|
||||
if (dones.getJSONObject(i).opt("processSection")!=null&&!dones.getJSONObject(i).opt("processSection").toString().equals("null")&&dones.getJSONObject(i).opt("processSection").toString().length()>0) {
|
||||
JSONObject area = new JSONObject(dones.getJSONObject(i).opt("processSection").toString());
|
||||
ProcessSection proc = new ProcessSection();
|
||||
proc.setSid(area.optString("id"));
|
||||
proc.setName(area.optString("name"));
|
||||
done_fault.setProcessSection(proc);
|
||||
}else {
|
||||
ProcessSection proc = new ProcessSection();
|
||||
proc.setSid("");
|
||||
proc.setName("");
|
||||
done_fault.setProcessSection(proc);
|
||||
}
|
||||
done_fault.setProblemTypeNames(dones.getJSONObject(i).opt("problemTypeNames").toString());
|
||||
done_fault.setProblemcontent(dones.getJSONObject(i).opt("problemcontent").toString());
|
||||
done_fault.setPlanMoney(dones.getJSONObject(i).opt("planMoney").toString());
|
||||
if (dones.getJSONObject(i).opt("equipmentCard")!=null&&dones.getJSONObject(i).opt("equipmentCard").toString().length()>0&&!dones.getJSONObject(i).opt("equipmentCard").toString().equals("null")) {
|
||||
EquList card = new EquList();
|
||||
JSONObject equ = new JSONObject(dones.getJSONObject(i).opt("equipmentCard").toString());
|
||||
card.setEquipmentname(equ.opt("equipmentname").toString());
|
||||
card.setEquipmentcardid(equ.opt("equipmentcardid").toString());
|
||||
done_fault.setEquipmentCard(card);
|
||||
}else {
|
||||
EquList card = new EquList();
|
||||
card.setEquipmentname("");
|
||||
card.setEquipmentcardid("");
|
||||
done_fault.setEquipmentCard(card);
|
||||
}
|
||||
if (dones.getJSONObject(i).opt("insertUser")!=null&&!dones.getJSONObject(i).optString("insertUser").equals("null")&&dones.getJSONObject(i).optString("insertUser").length()>0) {
|
||||
JSONObject capt = new JSONObject(dones.getJSONObject(i).optString("insertUser"));
|
||||
done_fault.setInsuser(capt.optString("caption"));
|
||||
}else {
|
||||
done_fault.setInsuser("");
|
||||
}
|
||||
done_fault.setTodoTask("任务完成");
|
||||
done_fault.setInsdt(dones.getJSONObject(i).optString("insdt"));
|
||||
done_fault.setEquipmentOpinion(dones.getJSONObject(i).optString("equipmentOpinion"));
|
||||
done_fault.setPlanMoney(dones.getJSONObject(i).optString("planMoney"));
|
||||
done_fault.setPlannedenddt(dones.getJSONObject(i).optString("plannedenddt"));
|
||||
done_fault.setMaterialOpinion(dones.getJSONObject(i).optString("materialOpinion"));
|
||||
done_fault.setQualityOpinion(dones.getJSONObject(i).optString("qualityOpinion"));
|
||||
list.add(done_fault);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private void setAdapter() {
|
||||
if (!getActivity().isFinishing()){
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
refresh.setRefreshing(false);
|
||||
doneFaultAdapter = new DoneFaultAdapter(getActivity(),faults);
|
||||
rc_view.setAdapter(doneFaultAdapter);
|
||||
manager = new LinearLayoutManager(getActivity());
|
||||
rc_view.setLayoutManager(manager);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public class MyDatePickerDialog extends DatePickerDialog {
|
||||
|
||||
public MyDatePickerDialog(Context context, OnDateSetListener callBack,
|
||||
int year, int month, int day) {
|
||||
super(context, callBack, year, month, day);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
@Override
|
||||
protected void onStop() {
|
||||
//super.onStop();//防止onDateSet执行两次
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private DatePickerDialog.OnDateSetListener Datelistener=new DatePickerDialog.OnDateSetListener() {
|
||||
@Override
|
||||
public void onDateSet(DatePicker view, int myyear, int monthOfYear, int dayOfMonth) {
|
||||
//修改year、month、day的变量值,以便以后单击按钮时,DatePickerDialog上显示上一次修改后的值
|
||||
year=myyear;
|
||||
month=monthOfYear;
|
||||
day=dayOfMonth;
|
||||
//更新日期
|
||||
updateDate();
|
||||
}
|
||||
//当DatePickerDialog关闭时,更新日期显示
|
||||
private void updateDate()
|
||||
{
|
||||
//在TextView上显示日期
|
||||
TimePickerDialog dpd=new TimePickerDialog(getActivity(),Timelistener,hour,minute,true);
|
||||
dpd.show();//显示DatePickerDialog组件
|
||||
}
|
||||
};
|
||||
|
||||
private TimePickerDialog.OnTimeSetListener Timelistener=new TimePickerDialog.OnTimeSetListener() {
|
||||
@Override
|
||||
public void onTimeSet(TimePicker view, int hours, int minutes) {
|
||||
//修改year、month、day的变量值,以便以后单击按钮时,DatePickerDialog上显示上一次修改后的值
|
||||
hour=hours;
|
||||
minute=minutes;
|
||||
//更新日期
|
||||
updateDate();
|
||||
}
|
||||
//当DatePickerDialog关闭时,更新日期显示
|
||||
private void updateDate()
|
||||
{
|
||||
//在TextView上显示日期
|
||||
if(tvstartdate.isFocused()){
|
||||
tvstartdate.setText(DateFormatUtils.DateFormatMinString(year+"-"+(month+1)+"-"+day+" "+hour+":"+minute));
|
||||
}else if(tvenddate.isFocused()){
|
||||
tvenddate.setText(DateFormatUtils.DateFormatMinString(year+"-"+(month+1)+"-"+day+" "+hour+":"+minute));
|
||||
}
|
||||
getFaultList();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取当前时间的前一周
|
||||
* @param cl
|
||||
* @return
|
||||
*/
|
||||
private static Calendar getBeforeDay(Calendar cl){
|
||||
//使用roll方法进行向前回滚
|
||||
//cl.roll(Calendar.DATE, -1);
|
||||
//使用set方法直接进行设置
|
||||
int day = cl.get(Calendar.DATE);
|
||||
cl.set(Calendar.DATE, day-7);
|
||||
return cl;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,431 @@
|
||||
package com.sipai.jspatrol.Equ.Equfrgment;
|
||||
|
||||
import android.app.DatePickerDialog;
|
||||
import android.app.TimePickerDialog;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.DatePicker;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TimePicker;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import com.sipai.jspatrol.Bean.EquList;
|
||||
import com.sipai.jspatrol.Bean.Fault;
|
||||
import com.sipai.jspatrol.Bean.ProcessSection;
|
||||
import com.sipai.jspatrol.Equ.EquCardActivity;
|
||||
import com.sipai.jspatrol.Fault.adapter.DoneFaultAdapter;
|
||||
import com.sipai.jspatrol.R;
|
||||
import com.sipai.jspatrol.URL.MethodURL;
|
||||
import com.sipai.jspatrol.utils.DateFormatUtils;
|
||||
import com.sipai.jspatrol.utils.Global.GlobalVal;
|
||||
import com.sipai.jspatrol.utils.OKHttpUtils;
|
||||
import com.sipai.jspatrol.utils.SharedPreferencesData;
|
||||
import com.sipai.ui.EmptyLayout;
|
||||
import com.superrecycleview.superlibrary.recycleview.SuperRecyclerView;
|
||||
import com.superrecycleview.superlibrary.utils.SuperDivider;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Callback;
|
||||
import okhttp3.Response;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2020/10/22
|
||||
*/
|
||||
public class EquMaintainFragment extends Fragment {
|
||||
private SharedPreferencesData sharedpre;
|
||||
private HashMap<String, String> map_base = new HashMap<>();
|
||||
private String mServer;
|
||||
private EquList equ;
|
||||
private String mBizid;
|
||||
private EditText tvstartdate,tvenddate;
|
||||
private int year,month,day,hour,minute,lastday,lastmonth;
|
||||
private int page = 1;
|
||||
private List<Fault> faults = new ArrayList<>();
|
||||
private DoneFaultAdapter doneFaultAdapter;
|
||||
private LinearLayoutManager manager;
|
||||
private SuperRecyclerView rc_view;
|
||||
private SwipeRefreshLayout refresh;
|
||||
private EmptyLayout emptyLayout;
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
init();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
View view = inflater.inflate(R.layout.fragment_equ_maintain,container,false);
|
||||
initView(view);
|
||||
getMaintainList();
|
||||
return view;
|
||||
}
|
||||
|
||||
private void initView(View view) {
|
||||
tvstartdate=(EditText)view.findViewById(R.id.moudle_equ_maintains_edt_sd);
|
||||
tvstartdate.setCursorVisible(false);
|
||||
tvstartdate.setOnTouchListener(new View.OnTouchListener() {
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
//创建DatePickerDialog对象
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
MyDatePickerDialog dpd = new MyDatePickerDialog(getActivity(), Datelistener, year, month, day);
|
||||
dpd.show();//显示DatePickerDialog组件
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
tvenddate=(EditText)view.findViewById(R.id.moudle_equ_maintains_edt_ed);
|
||||
tvenddate.setCursorVisible(false);
|
||||
tvenddate.setOnTouchListener(new View.OnTouchListener() {
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
//创建DatePickerDialog对象
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
MyDatePickerDialog dpd = new MyDatePickerDialog(getActivity(), Datelistener, year, month, day);
|
||||
dpd.show();//显示DatePickerDialog组件
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (day==1){
|
||||
if (month!=0) {
|
||||
Calendar calendar = Calendar.getInstance(Locale.CHINA);
|
||||
calendar.set(Calendar.MONTH, month - 1);
|
||||
int tday = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
|
||||
tvstartdate.setText(DateFormatUtils.DateFormatMinString(year + "-" + (month) + "-" + lastday + " " + hour + ":" + minute));
|
||||
}else{
|
||||
Calendar calendar = Calendar.getInstance(Locale.CHINA);
|
||||
calendar.set(Calendar.MONTH, 11);
|
||||
int tday = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);
|
||||
tvstartdate.setText(DateFormatUtils.DateFormatMinString((year-1) + "-" + 12 + "-" + lastday + " " + hour + ":" + minute));
|
||||
}
|
||||
}else {
|
||||
tvstartdate.setText(DateFormatUtils.DateFormatMinString(year + "-" + (lastmonth + 1) + "-" + lastday + " " + hour + ":" + minute));
|
||||
}
|
||||
tvenddate.setText(DateFormatUtils.DateFormatMinString(year+"-"+(month+1)+"-"+day+" "+hour+":"+minute));
|
||||
rc_view = view.findViewById(R.id.moudle_equ_maintains_rc);
|
||||
emptyLayout = view.findViewById(R.id.moudle_equ_maintains_ui_empty);
|
||||
refresh = view.findViewById(R.id.moudle_equ_maintains_refresh);
|
||||
refresh.setColorSchemeResources(R.color.blue);
|
||||
refresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
page = 1;
|
||||
getMaintainList();
|
||||
}
|
||||
});
|
||||
manager = new LinearLayoutManager(getActivity());
|
||||
rc_view.setLayoutManager(manager);
|
||||
rc_view.setRefreshEnabled(false);
|
||||
rc_view.setLoadMoreEnabled(true);
|
||||
rc_view.setLoadingListener(new SuperRecyclerView.LoadingListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMore() {
|
||||
page = page+1;
|
||||
getMaintainList();
|
||||
}
|
||||
});
|
||||
rc_view.addItemDecoration(SuperDivider.newBitmapDivider());
|
||||
}
|
||||
|
||||
|
||||
private void init() {
|
||||
EquCardActivity equcard = (EquCardActivity) getActivity();
|
||||
equ = equcard.getEquList();
|
||||
sharedpre = new SharedPreferencesData(getActivity());
|
||||
map_base = sharedpre.getAll();
|
||||
mServer = map_base.get("mServer");
|
||||
SharedPreferences sharedPre = getActivity().getSharedPreferences("config", 0);
|
||||
mBizid = sharedPre.getString("bizid", "");
|
||||
//初始化Calendar日历对象
|
||||
Calendar mycalendar=Calendar.getInstance(Locale.CHINA);
|
||||
Date mydate=new Date(); //获取当前日期Date对象
|
||||
mycalendar.setTime(mydate);////为Calendar对象设置时间为当前日期
|
||||
year=mycalendar.get(Calendar.YEAR); //获取Calendar对象中的年
|
||||
month=mycalendar.get(Calendar.MONTH);//获取Calendar对象中的月
|
||||
day=mycalendar.get(Calendar.DAY_OF_MONTH);//获取这个月的第几天
|
||||
lastday=getBeforeDay(mycalendar).get(Calendar.DAY_OF_MONTH);
|
||||
lastmonth=getBeforeDay(mycalendar).get(Calendar.MONTH);
|
||||
hour=mycalendar.get(Calendar.HOUR_OF_DAY);//获取这个月的第几天
|
||||
minute=mycalendar.get(Calendar.MINUTE);//获取这个月的第几天
|
||||
}
|
||||
|
||||
private void getMaintainList() {
|
||||
isShowRefresh();
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("type", GlobalVal.Maintain_Type);
|
||||
map.put("rows","20");
|
||||
map.put("page",String.valueOf(page));
|
||||
map.put("search_code",mBizid);
|
||||
map.put("processSectionId",equ.getProcesssectionid());
|
||||
map.put("equipmentId",equ.getId());
|
||||
map.put("status", GlobalVal.Fault_Status_Finish);
|
||||
map.put("beginTimeStore",tvstartdate.getText().toString());
|
||||
map.put("endTimeStore",tvenddate.getText().toString());
|
||||
OKHttpUtils.getClient().newCall(OKHttpUtils.OKHttpRequest(map, mServer, MethodURL.GETEquMaintains_Method)).enqueue(new Callback() {
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e) {
|
||||
String a = e.toString();
|
||||
showError(a);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException {
|
||||
String res = response.body().string();
|
||||
if (page==1) {
|
||||
faults = parseFault(res);
|
||||
ifShowTheEmpty();
|
||||
setAdapter();
|
||||
}else {
|
||||
List<Fault> list = parseFault(res);
|
||||
if (list.size()>0) {
|
||||
faults.addAll(list);
|
||||
updateLoadMore();
|
||||
}else {
|
||||
noMore();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void isShowRefresh() {
|
||||
if (!getActivity().isFinishing()){
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (page==1) {
|
||||
if (!refresh.isRefreshing()) {
|
||||
refresh.setRefreshing(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void showError(String a) {
|
||||
if (!getActivity().isFinishing()){
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
refresh.setRefreshing(false);
|
||||
Toast.makeText(getActivity(), ""+a, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
是否显示暂无数据布局
|
||||
*/
|
||||
private void ifShowTheEmpty() {
|
||||
if (!getActivity().isFinishing()) {
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (faults.size() == 0) {
|
||||
emptyLayout.setVisibility(View.VISIBLE);
|
||||
rc_view.setVisibility(View.GONE);
|
||||
} else {
|
||||
emptyLayout.setVisibility(View.GONE);
|
||||
rc_view.setVisibility(View.VISIBLE);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void updateLoadMore() {
|
||||
if (!getActivity().isFinishing()){
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
rc_view.completeLoadMore();
|
||||
doneFaultAdapter.notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void noMore() {
|
||||
if (!getActivity().isFinishing()){
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Toast.makeText(getActivity(), "这次是真没有了~", Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private List<Fault> parseFault(String response) {
|
||||
List<Fault> list = new ArrayList<>();
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(response);
|
||||
JSONArray dones = new JSONArray(jsonObject.getString("content1"));
|
||||
for (int i=0;i<dones.length();i++){
|
||||
Fault done_fault = new Fault();
|
||||
done_fault.setId(dones.getJSONObject(i).opt("id").toString());
|
||||
if (dones.getJSONObject(i).opt("processSection")!=null&&!dones.getJSONObject(i).opt("processSection").toString().equals("null")&&dones.getJSONObject(i).opt("processSection").toString().length()>0) {
|
||||
JSONObject area = new JSONObject(dones.getJSONObject(i).opt("processSection").toString());
|
||||
ProcessSection proc = new ProcessSection();
|
||||
proc.setSid(area.optString("id"));
|
||||
proc.setName(area.optString("name"));
|
||||
done_fault.setProcessSection(proc);
|
||||
}else {
|
||||
ProcessSection proc = new ProcessSection();
|
||||
proc.setSid("");
|
||||
proc.setName("");
|
||||
done_fault.setProcessSection(proc);
|
||||
}
|
||||
done_fault.setProblemTypeNames(dones.getJSONObject(i).opt("problemTypeNames").toString());
|
||||
done_fault.setProblemcontent(dones.getJSONObject(i).opt("problemcontent").toString());
|
||||
done_fault.setPlanMoney(dones.getJSONObject(i).opt("planMoney").toString());
|
||||
if (dones.getJSONObject(i).opt("equipmentCard")!=null&&dones.getJSONObject(i).opt("equipmentCard").toString().length()>0&&!dones.getJSONObject(i).opt("equipmentCard").toString().equals("null")) {
|
||||
EquList card = new EquList();
|
||||
JSONObject equ = new JSONObject(dones.getJSONObject(i).opt("equipmentCard").toString());
|
||||
card.setEquipmentname(equ.opt("equipmentname").toString());
|
||||
card.setEquipmentcardid(equ.opt("equipmentcardid").toString());
|
||||
done_fault.setEquipmentCard(card);
|
||||
}else {
|
||||
EquList card = new EquList();
|
||||
card.setEquipmentname("");
|
||||
card.setEquipmentcardid("");
|
||||
done_fault.setEquipmentCard(card);
|
||||
}
|
||||
if (dones.getJSONObject(i).opt("insertUser")!=null&&!dones.getJSONObject(i).optString("insertUser").equals("null")&&dones.getJSONObject(i).optString("insertUser").length()>0) {
|
||||
JSONObject capt = new JSONObject(dones.getJSONObject(i).optString("insertUser"));
|
||||
done_fault.setInsuser(capt.optString("caption"));
|
||||
}else {
|
||||
done_fault.setInsuser("");
|
||||
}
|
||||
done_fault.setTodoTask("任务完成");
|
||||
done_fault.setInsdt(dones.getJSONObject(i).optString("insdt"));
|
||||
done_fault.setEquipmentOpinion(dones.getJSONObject(i).optString("equipmentOpinion"));
|
||||
done_fault.setPlanMoney(dones.getJSONObject(i).optString("planMoney"));
|
||||
done_fault.setPlannedenddt(dones.getJSONObject(i).optString("plannedenddt"));
|
||||
done_fault.setMaterialOpinion(dones.getJSONObject(i).optString("materialOpinion"));
|
||||
done_fault.setQualityOpinion(dones.getJSONObject(i).optString("qualityOpinion"));
|
||||
list.add(done_fault);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private void setAdapter() {
|
||||
if (!getActivity().isFinishing()){
|
||||
getActivity().runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
refresh.setRefreshing(false);
|
||||
doneFaultAdapter = new DoneFaultAdapter(getActivity(),faults);
|
||||
rc_view.setAdapter(doneFaultAdapter);
|
||||
manager = new LinearLayoutManager(getActivity());
|
||||
rc_view.setLayoutManager(manager);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public class MyDatePickerDialog extends DatePickerDialog {
|
||||
|
||||
public MyDatePickerDialog(Context context, OnDateSetListener callBack,
|
||||
int year, int month, int day) {
|
||||
super(context, callBack, year, month, day);
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
@Override
|
||||
protected void onStop() {
|
||||
//super.onStop();//防止onDateSet执行两次
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private DatePickerDialog.OnDateSetListener Datelistener=new DatePickerDialog.OnDateSetListener() {
|
||||
@Override
|
||||
public void onDateSet(DatePicker view, int myyear, int monthOfYear, int dayOfMonth) {
|
||||
//修改year、month、day的变量值,以便以后单击按钮时,DatePickerDialog上显示上一次修改后的值
|
||||
year=myyear;
|
||||
month=monthOfYear;
|
||||
day=dayOfMonth;
|
||||
//更新日期
|
||||
updateDate();
|
||||
}
|
||||
//当DatePickerDialog关闭时,更新日期显示
|
||||
private void updateDate()
|
||||
{
|
||||
//在TextView上显示日期
|
||||
TimePickerDialog dpd=new TimePickerDialog(getActivity(),Timelistener,hour,minute,true);
|
||||
dpd.show();//显示DatePickerDialog组件
|
||||
}
|
||||
};
|
||||
|
||||
private TimePickerDialog.OnTimeSetListener Timelistener=new TimePickerDialog.OnTimeSetListener() {
|
||||
@Override
|
||||
public void onTimeSet(TimePicker view, int hours, int minutes) {
|
||||
//修改year、month、day的变量值,以便以后单击按钮时,DatePickerDialog上显示上一次修改后的值
|
||||
hour=hours;
|
||||
minute=minutes;
|
||||
//更新日期
|
||||
updateDate();
|
||||
}
|
||||
//当DatePickerDialog关闭时,更新日期显示
|
||||
private void updateDate()
|
||||
{
|
||||
//在TextView上显示日期
|
||||
if(tvstartdate.isFocused()){
|
||||
tvstartdate.setText(DateFormatUtils.DateFormatMinString(year+"-"+(month+1)+"-"+day+" "+hour+":"+minute));
|
||||
}else if(tvenddate.isFocused()){
|
||||
tvenddate.setText(DateFormatUtils.DateFormatMinString(year+"-"+(month+1)+"-"+day+" "+hour+":"+minute));
|
||||
}
|
||||
getMaintainList();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 获取当前时间的前一周
|
||||
* @param cl
|
||||
* @return
|
||||
*/
|
||||
private static Calendar getBeforeDay(Calendar cl){
|
||||
//使用roll方法进行向前回滚
|
||||
//cl.roll(Calendar.DATE, -1);
|
||||
//使用set方法直接进行设置
|
||||
int day = cl.get(Calendar.DATE);
|
||||
cl.set(Calendar.DATE, day-7);
|
||||
return cl;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,290 @@
|
||||
package com.sipai.jspatrol.Equ;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.Button;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import com.loopj.android.http.AsyncHttpClient;
|
||||
import com.loopj.android.http.AsyncHttpResponseHandler;
|
||||
import com.loopj.android.http.PersistentCookieStore;
|
||||
import com.loopj.android.http.RequestParams;
|
||||
import com.sipai.jspatrol.Bean.EquList;
|
||||
import com.sipai.jspatrol.R;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import cn.pedant.SweetAlert.SweetAlertDialog;
|
||||
|
||||
public class PertainToEquSelActivity extends AppCompatActivity {
|
||||
private EditText edt_equname;
|
||||
private Button btn_search;
|
||||
private RecyclerView rc_view;
|
||||
private SwipeRefreshLayout refresh;
|
||||
private LinearLayoutManager manager;
|
||||
private PertainToEquSelAdapter equAdapter;
|
||||
private List<EquList> equs = new ArrayList<>();
|
||||
private EquList sel_item;
|
||||
private String st_pSectionId = "";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_pertain_to_equ_sel);
|
||||
init();
|
||||
initView();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
TextView tv_title = (TextView) findViewById(R.id.moudle_back_title_tv_title);
|
||||
tv_title.setText("所属设备选择");
|
||||
ImageView btn_back = (ImageView) findViewById(R.id.moudle_back_title_iv_back);
|
||||
btn_back.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
edt_equname = findViewById(R.id.moudle_pertain_to_equ_sel_edt_equname);
|
||||
btn_search = findViewById(R.id.moudle_pertain_to_equ_sel_btn_search);
|
||||
rc_view = findViewById(R.id.moudle_pertain_to_equ_sel_rc);
|
||||
manager = new LinearLayoutManager(PertainToEquSelActivity.this);
|
||||
rc_view.setLayoutManager(manager);
|
||||
equAdapter = new PertainToEquSelAdapter(equs, PertainToEquSelActivity.this, new PertainToEquSelAdapter.onRecyclerViewItemClick() {
|
||||
@Override
|
||||
public void onItemClick(View v, int position) {
|
||||
sel_item = equs.get(position);
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("sel",sel_item);
|
||||
setResult(RESULT_OK,intent);
|
||||
finish();
|
||||
}
|
||||
});
|
||||
rc_view.setAdapter(equAdapter);
|
||||
refresh = findViewById(R.id.moudle_pertain_to_equ_sel_refresh);
|
||||
refresh.setColorSchemeResources(R.color.blue);
|
||||
refresh.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
getEquList();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void getEquList() {
|
||||
showRefresh();
|
||||
String getsearch = "";
|
||||
if (edt_equname.getText()!=null&&!edt_equname.getText().toString().isEmpty()){
|
||||
getsearch = edt_equname.getText().toString();
|
||||
}
|
||||
PersistentCookieStore myCookieStore = new PersistentCookieStore(this);
|
||||
RequestParams params = new RequestParams();
|
||||
params.put("page", "1");
|
||||
params.put("rows", "100");
|
||||
params.put("companyId",mBizid);
|
||||
params.put("pSectionId",st_pSectionId);
|
||||
params.put("search_name", getsearch);
|
||||
AsyncHttpClient client = new AsyncHttpClient();
|
||||
client.setCookieStore(myCookieStore);
|
||||
client.post(mServer + "equipment/getList4APP.do?", params, new AsyncHttpResponseHandler() {
|
||||
@Override
|
||||
public void onSuccess(String response) {
|
||||
super.onSuccess(response);
|
||||
String res = response;
|
||||
equs=getData(response);
|
||||
UpDateUI();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable error) {
|
||||
super.onFailure(error);
|
||||
String a = error.toString();
|
||||
if(!PertainToEquSelActivity.this.isFinishing()) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (refresh.isRefreshing()){
|
||||
refresh.setRefreshing(false);
|
||||
}
|
||||
new SweetAlertDialog(PertainToEquSelActivity.this, SweetAlertDialog.WARNING_TYPE)
|
||||
.setTitleText("提示")
|
||||
.setContentText("设备列表获取失败请重试!")
|
||||
.setConfirmText("确认")
|
||||
.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
|
||||
@Override
|
||||
public void onClick(SweetAlertDialog sweetAlertDialog) {
|
||||
sweetAlertDialog.dismissWithAnimation();
|
||||
getEquList();
|
||||
}
|
||||
}).setCancelText("取消")
|
||||
.setCancelClickListener(new SweetAlertDialog.OnSweetClickListener() {
|
||||
@Override
|
||||
public void onClick(SweetAlertDialog sweetAlertDialog) {
|
||||
sweetAlertDialog.dismissWithAnimation();
|
||||
finish();
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
super.onFinish();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void showRefresh() {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!refresh.isRefreshing()){
|
||||
refresh.setRefreshing(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void UpDateUI() {
|
||||
if (!PertainToEquSelActivity.this.isFinishing()){
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (refresh.isRefreshing()){
|
||||
refresh.setRefreshing(false);
|
||||
}
|
||||
if(equs!=null){
|
||||
manager = new LinearLayoutManager(PertainToEquSelActivity.this);
|
||||
rc_view.setLayoutManager(manager);
|
||||
equAdapter = new PertainToEquSelAdapter(equs, PertainToEquSelActivity.this, new PertainToEquSelAdapter.onRecyclerViewItemClick() {
|
||||
@Override
|
||||
public void onItemClick(View v, int position) {
|
||||
sel_item = equs.get(position);
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("sel",sel_item);
|
||||
setResult(RESULT_OK,intent);
|
||||
finish();
|
||||
}
|
||||
});
|
||||
rc_view.setAdapter(equAdapter);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private List<EquList> getData(String response) {
|
||||
List<EquList> list = new ArrayList<EquList>();
|
||||
try{
|
||||
JSONObject jsonObject = new JSONObject(response);
|
||||
JSONArray array = new JSONArray(jsonObject.optString("rows"));
|
||||
for (int i=0;i<array.length();i++){
|
||||
EquList item = new EquList();
|
||||
item.setAreaid(array.getJSONObject(i).optString("areaid"));
|
||||
item.setAssetclassid(array.getJSONObject(i).optString(""));
|
||||
item.setBizid(array.getJSONObject(i).optString(""));
|
||||
if (array.getJSONObject(i).get("company")!=null&&!array.getJSONObject(i).get("company").toString().equals("null")) {
|
||||
JSONObject company = new JSONObject(array.getJSONObject(i).optString("company"));
|
||||
item.setCompany(company.optString("name"));
|
||||
}else {
|
||||
item.setCompany("");
|
||||
}
|
||||
if (array.getJSONObject(i).get("equipmentClass")!=null&&!array.getJSONObject(i).get("equipmentClass").toString().equals("null")) {
|
||||
JSONObject equClass = new JSONObject(array.getJSONObject(i).optString("equipmentClass"));
|
||||
item.setEquipmentClass(equClass.optString("name"));
|
||||
}else {
|
||||
item.setEquipmentClass("");
|
||||
}
|
||||
if (array.getJSONObject(i).get("equipmentLevel")!=null&&!array.getJSONObject(i).get("equipmentLevel").toString().equals("null")) {
|
||||
JSONObject equLevel = new JSONObject(array.getJSONObject(i).optString("equipmentLevel"));
|
||||
item.setEquipmentLevel(equLevel.optString("levelname"));
|
||||
}else {
|
||||
item.setEquipmentLevel("");
|
||||
}
|
||||
if (array.getJSONObject(i).get("equipmentSpecification")!=null&&!array.getJSONObject(i).get("equipmentSpecification").toString().equals("null")) {
|
||||
JSONObject equipmentSpecification = new JSONObject(array.getJSONObject(i).optString("equipmentSpecification"));
|
||||
item.setEquipmentSpecification(equipmentSpecification.optString("name"));
|
||||
}else {
|
||||
item.setEquipmentSpecification("");
|
||||
|
||||
}
|
||||
if (array.getJSONObject(i).get("equipmentTypeNumber")!=null&&!array.getJSONObject(i).get("equipmentTypeNumber").toString().equals("null")) {
|
||||
JSONObject equipmentTypeNumber = new JSONObject(array.getJSONObject(i).optString("equipmentTypeNumber"));
|
||||
item.setEquipmentTypeNumber(equipmentTypeNumber.optString("name"));
|
||||
}else {
|
||||
item.setEquipmentTypeNumber("");
|
||||
|
||||
}
|
||||
item.setEquipmentcardid(array.getJSONObject(i).optString("equipmentcardid"));
|
||||
item.setEquipmentclassid(array.getJSONObject(i).optString("equipmentclassid"));
|
||||
item.setEquipmentlevelid(array.getJSONObject(i).optString("equipmentlevelid"));
|
||||
item.setEquipmentmanufacturer(array.getJSONObject(i).optString("equipmentmanufacturer"));
|
||||
item.setEquipmentname(array.getJSONObject(i).optString("equipmentname"));
|
||||
item.setEquipmentstatus(array.getJSONObject(i).optString("equipmentstatus"));
|
||||
item.setId(array.getJSONObject(i).optString("id"));
|
||||
item.setLeavefactorynumber(array.getJSONObject(i).optString("leavefactorynumber"));
|
||||
item.setMajorparameter(array.getJSONObject(i).optString("majorparameter"));
|
||||
item.setProductiondate(array.getJSONObject(i).optString("productiondate"));
|
||||
item.setTotaltime(array.getJSONObject(i).opt("totaltime").toString());
|
||||
if (array.getJSONObject(i).optString("equipmentstatus").equals("0")) {
|
||||
item.setEquipmentstatus("禁用");
|
||||
}else if (array.getJSONObject(i).optString("equipmentstatus").equals("1")){
|
||||
item.setEquipmentstatus("启用");
|
||||
}
|
||||
list.add(item);
|
||||
}
|
||||
}catch(JSONException ex){
|
||||
Log.e("JSON Error: ", ex.toString());
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
*/
|
||||
private String mServer;
|
||||
private String mUsername;
|
||||
private String mPassword;
|
||||
private String mUserid;
|
||||
private String mCaption;
|
||||
private String mBizid;
|
||||
private String mBizName;
|
||||
|
||||
public void init(){
|
||||
SharedPreferences sharedPre=getSharedPreferences("config", MODE_PRIVATE);
|
||||
mServer=sharedPre.getString("server", "");
|
||||
mUsername=sharedPre.getString("username", "");
|
||||
mPassword=sharedPre.getString("password", "");
|
||||
mUserid=sharedPre.getString("userid", "");
|
||||
mCaption=sharedPre.getString("caption", "");
|
||||
mBizid=sharedPre.getString("bizid", "");
|
||||
mBizName=sharedPre.getString("bizname", "");
|
||||
st_pSectionId = getIntent().getStringExtra("psectionId");
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,76 @@
|
||||
package com.sipai.jspatrol.Equ;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.sipai.jspatrol.Bean.EquList;
|
||||
import com.sipai.jspatrol.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2019/7/11
|
||||
*/
|
||||
public class PertainToEquSelAdapter extends RecyclerView.Adapter<PertainToEquSelAdapter.ViewHolder> {
|
||||
private List<EquList> list;
|
||||
private Context context;
|
||||
private onRecyclerViewItemClick mOnRvItemClick;
|
||||
|
||||
public PertainToEquSelAdapter(List<EquList> list, Context context, onRecyclerViewItemClick mOnRvItemClick) {
|
||||
this.list = list;
|
||||
this.context = context;
|
||||
this.mOnRvItemClick = mOnRvItemClick;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item ,parent,false);
|
||||
final ViewHolder holder = new ViewHolder(view);
|
||||
return holder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
EquList item = list.get(position);
|
||||
holder.tv_name.setText(item.getEquipmentname());
|
||||
holder.tv_cardId.setText(item.getEquipmentcardid());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
||||
TextView tv_name,tv_cardId;
|
||||
View root;
|
||||
public ViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
root = itemView;
|
||||
tv_name = itemView.findViewById(R.id.name);
|
||||
tv_cardId = itemView.findViewById(R.id.info);
|
||||
root.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mOnRvItemClick != null)
|
||||
mOnRvItemClick.onItemClick(v, getAdapterPosition());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* item点击接口
|
||||
*/
|
||||
public interface onRecyclerViewItemClick {
|
||||
void onItemClick(View v, int position);
|
||||
}
|
||||
}
|
||||
434
app/src/main/java/com/sipai/jspatrol/Equ/SelActivity.java
Normal file
434
app/src/main/java/com/sipai/jspatrol/Equ/SelActivity.java
Normal file
@ -0,0 +1,434 @@
|
||||
package com.sipai.jspatrol.Equ;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.loopj.android.http.AsyncHttpClient;
|
||||
import com.loopj.android.http.AsyncHttpResponseHandler;
|
||||
import com.loopj.android.http.PersistentCookieStore;
|
||||
import com.loopj.android.http.RequestParams;
|
||||
import com.sipai.jspatrol.Bean.InfoSel;
|
||||
import com.sipai.jspatrol.R;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import cn.pedant.SweetAlert.SweetAlertDialog;
|
||||
|
||||
public class SelActivity extends AppCompatActivity {
|
||||
private String type = "";
|
||||
private List<InfoSel> list = new ArrayList<>();
|
||||
private InfoSel sel_item;
|
||||
private RecyclerView rc_view;
|
||||
private SelAdapter adapter;
|
||||
private LinearLayoutManager manager;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_sel);
|
||||
init();
|
||||
initView();
|
||||
intentVisit();
|
||||
}
|
||||
|
||||
private void intentVisit() {
|
||||
if (type.equals("assetclass")){
|
||||
getAssetClass();
|
||||
}else if (type.equals("equtypenum")){
|
||||
getEquTypeNum();
|
||||
}else if (type.equals("equclass")){
|
||||
getEquClass();
|
||||
}else if (type.equals("equspecification")){
|
||||
getEquSpecification();
|
||||
}else if (type.equals("equlevel")){
|
||||
getEquLevel();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备级别
|
||||
*/
|
||||
private void getEquLevel() {
|
||||
PersistentCookieStore myCookieStore = new PersistentCookieStore(this);
|
||||
RequestParams params = new RequestParams();
|
||||
AsyncHttpClient client = new AsyncHttpClient();
|
||||
client.setCookieStore(myCookieStore);
|
||||
client.post(mServer + "equipment/equipmentLevel/getEquipmentLevelForSelect.do?", params, new AsyncHttpResponseHandler() {
|
||||
@Override
|
||||
public void onSuccess(String response) {
|
||||
super.onSuccess(response);
|
||||
list = parseData(response);
|
||||
UpdateUI();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable error) {
|
||||
super.onFailure(error);
|
||||
String a = error.toString();
|
||||
if(!SelActivity.this.isFinishing()) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
new SweetAlertDialog(SelActivity.this, SweetAlertDialog.WARNING_TYPE)
|
||||
.setTitleText("提示")
|
||||
.setContentText("资产类型列表获取失败请重试!")
|
||||
.setConfirmText("确认")
|
||||
.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
|
||||
@Override
|
||||
public void onClick(SweetAlertDialog sweetAlertDialog) {
|
||||
sweetAlertDialog.dismissWithAnimation();
|
||||
getEquLevel();
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
super.onFinish();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备规格
|
||||
*/
|
||||
private void getEquSpecification() {
|
||||
PersistentCookieStore myCookieStore = new PersistentCookieStore(this);
|
||||
RequestParams params = new RequestParams();
|
||||
AsyncHttpClient client = new AsyncHttpClient();
|
||||
client.setCookieStore(myCookieStore);
|
||||
client.post(mServer + "equipment/equipmentSpecification/getEquipmentSpecificationForSelect.do?", params, new AsyncHttpResponseHandler() {
|
||||
@Override
|
||||
public void onSuccess(String response) {
|
||||
super.onSuccess(response);
|
||||
list = parseData(response);
|
||||
UpdateUI();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable error) {
|
||||
super.onFailure(error);
|
||||
String a = error.toString();
|
||||
if(!SelActivity.this.isFinishing()) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
new SweetAlertDialog(SelActivity.this, SweetAlertDialog.WARNING_TYPE)
|
||||
.setTitleText("提示")
|
||||
.setContentText("资产类型列表获取失败请重试!")
|
||||
.setConfirmText("确认")
|
||||
.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
|
||||
@Override
|
||||
public void onClick(SweetAlertDialog sweetAlertDialog) {
|
||||
sweetAlertDialog.dismissWithAnimation();
|
||||
getEquSpecification();
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
super.onFinish();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备类型
|
||||
*/
|
||||
private void getEquClass() {
|
||||
PersistentCookieStore myCookieStore = new PersistentCookieStore(this);
|
||||
RequestParams params = new RequestParams();
|
||||
AsyncHttpClient client = new AsyncHttpClient();
|
||||
client.setCookieStore(myCookieStore);
|
||||
client.post(mServer + "equipment/equipmentClass/getEquipmentClassForSelect.do?", params, new AsyncHttpResponseHandler() {
|
||||
@Override
|
||||
public void onSuccess(String response) {
|
||||
super.onSuccess(response);
|
||||
Log.i("assetClass", "onSuccess: "+response);
|
||||
list = parseData(response);
|
||||
UpdateUI();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable error) {
|
||||
super.onFailure(error);
|
||||
String a = error.toString();
|
||||
if(!SelActivity.this.isFinishing()) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
new SweetAlertDialog(SelActivity.this, SweetAlertDialog.WARNING_TYPE)
|
||||
.setTitleText("提示")
|
||||
.setContentText("资产类型列表获取失败请重试!")
|
||||
.setConfirmText("确认")
|
||||
.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
|
||||
@Override
|
||||
public void onClick(SweetAlertDialog sweetAlertDialog) {
|
||||
sweetAlertDialog.dismissWithAnimation();
|
||||
getEquClass();
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
super.onFinish();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备型号
|
||||
*/
|
||||
private void getEquTypeNum() {
|
||||
PersistentCookieStore myCookieStore = new PersistentCookieStore(this);
|
||||
RequestParams params = new RequestParams();
|
||||
AsyncHttpClient client = new AsyncHttpClient();
|
||||
client.setCookieStore(myCookieStore);
|
||||
client.post(mServer + "equipment/equipmentTypeNumber/getEquipmentTypeNumberForSelect.do?", params, new AsyncHttpResponseHandler() {
|
||||
@Override
|
||||
public void onSuccess(String response) {
|
||||
super.onSuccess(response);
|
||||
Log.i("assetClass", "onSuccess: "+response);
|
||||
list = parseData(response);
|
||||
UpdateUI();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable error) {
|
||||
super.onFailure(error);
|
||||
String a = error.toString();
|
||||
if(!SelActivity.this.isFinishing()) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
new SweetAlertDialog(SelActivity.this, SweetAlertDialog.WARNING_TYPE)
|
||||
.setTitleText("提示")
|
||||
.setContentText("资产类型列表获取失败请重试!")
|
||||
.setConfirmText("确认")
|
||||
.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
|
||||
@Override
|
||||
public void onClick(SweetAlertDialog sweetAlertDialog) {
|
||||
sweetAlertDialog.dismissWithAnimation();
|
||||
getEquTypeNum();
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
super.onFinish();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 资产类型
|
||||
*/
|
||||
private void getAssetClass() {
|
||||
PersistentCookieStore myCookieStore = new PersistentCookieStore(this);
|
||||
RequestParams params = new RequestParams();
|
||||
// params.put("search_code", mBizid);
|
||||
// params.put("rows", "100");
|
||||
// params.put("page", "1");
|
||||
AsyncHttpClient client = new AsyncHttpClient();
|
||||
client.setCookieStore(myCookieStore);
|
||||
client.post(mServer + "equipment/assetClass/getAssetClassForSelect.do?", params, new AsyncHttpResponseHandler() {
|
||||
@Override
|
||||
public void onSuccess(String response) {
|
||||
super.onSuccess(response);
|
||||
Log.i("assetClass", "onSuccess: "+response);
|
||||
list = parseData(response);
|
||||
UpdateUI();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable error) {
|
||||
super.onFailure(error);
|
||||
String a = error.toString();
|
||||
if(!SelActivity.this.isFinishing()) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
new SweetAlertDialog(SelActivity.this, SweetAlertDialog.WARNING_TYPE)
|
||||
.setTitleText("提示")
|
||||
.setContentText("资产类型列表获取失败请重试!")
|
||||
.setConfirmText("确认")
|
||||
.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
|
||||
@Override
|
||||
public void onClick(SweetAlertDialog sweetAlertDialog) {
|
||||
sweetAlertDialog.dismissWithAnimation();
|
||||
getAssetClass();
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
super.onFinish();
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
private void UpdateUI() {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
manager = new LinearLayoutManager(SelActivity.this);
|
||||
rc_view.setLayoutManager(manager);
|
||||
adapter = new SelAdapter(SelActivity.this, list, new SelAdapter.onRecyclerViewItemClick() {
|
||||
@Override
|
||||
public void onItemClick(View v, int position) {
|
||||
sel_item = list.get(position);
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("sel",sel_item);
|
||||
setResult(RESULT_OK,intent);
|
||||
finish();
|
||||
}
|
||||
});
|
||||
rc_view.setAdapter(adapter);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private List<InfoSel> parseData(String response) {
|
||||
List<InfoSel> list = new ArrayList<>();
|
||||
try {
|
||||
JSONArray array = new JSONArray(response);
|
||||
for (int i=0;i<array.length();i++){
|
||||
InfoSel item = new InfoSel();
|
||||
item.setId(array.getJSONObject(i).opt("id").toString());
|
||||
item.setText(array.getJSONObject(i).opt("text").toString());
|
||||
list.add(item);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
TextView tv_title = (TextView) findViewById(R.id.moudle_back_title_tv_title);
|
||||
if (type.equals("assetclass")) {
|
||||
tv_title.setText("资产类型");
|
||||
}else if (type.equals("equtypenum")){
|
||||
tv_title.setText("设备型号");
|
||||
}else if (type.equals("equclass")){
|
||||
tv_title.setText("设备类型");
|
||||
}else if (type.equals("equspecification")){
|
||||
tv_title.setText("设备规格");
|
||||
}else if (type.equals("equlevel")){
|
||||
tv_title.setText("设备级别");
|
||||
}
|
||||
ImageView btn_back = (ImageView) findViewById(R.id.moudle_back_title_iv_back);
|
||||
btn_back.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
TextView tv_save = (TextView) findViewById(R.id.moudle_back_title_tv_save);
|
||||
tv_save.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("sel", (Serializable) sel_item);
|
||||
setResult(RESULT_OK,intent);
|
||||
finish();
|
||||
}
|
||||
});
|
||||
rc_view = findViewById(R.id.moudle_asset_class_sel_rc);
|
||||
manager = new LinearLayoutManager(SelActivity.this);
|
||||
rc_view.setLayoutManager(manager);
|
||||
adapter = new SelAdapter(SelActivity.this, list, new SelAdapter.onRecyclerViewItemClick() {
|
||||
@Override
|
||||
public void onItemClick(View v, int position) {
|
||||
sel_item = list.get(position);
|
||||
}
|
||||
});
|
||||
rc_view.setAdapter(adapter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
*/
|
||||
private String mServer;
|
||||
private String mUsername;
|
||||
private String mPassword;
|
||||
private String mUserid;
|
||||
private String mCaption;
|
||||
private String mBizid;
|
||||
private String mBizName;
|
||||
|
||||
public void init(){
|
||||
SharedPreferences sharedPre=getSharedPreferences("config", MODE_PRIVATE);
|
||||
mServer=sharedPre.getString("server", "");
|
||||
mUsername=sharedPre.getString("username", "");
|
||||
mPassword=sharedPre.getString("password", "");
|
||||
mUserid=sharedPre.getString("userid", "");
|
||||
mCaption=sharedPre.getString("caption", "");
|
||||
mBizid=sharedPre.getString("bizid", "");
|
||||
mBizName=sharedPre.getString("bizname", "");
|
||||
type = getIntent().getStringExtra("type");
|
||||
}
|
||||
}
|
||||
72
app/src/main/java/com/sipai/jspatrol/Equ/SelAdapter.java
Normal file
72
app/src/main/java/com/sipai/jspatrol/Equ/SelAdapter.java
Normal file
@ -0,0 +1,72 @@
|
||||
package com.sipai.jspatrol.Equ;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.sipai.jspatrol.Bean.InfoSel;
|
||||
import com.sipai.jspatrol.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2019/7/10
|
||||
*/
|
||||
public class SelAdapter extends RecyclerView.Adapter<SelAdapter.ViewHolder> {
|
||||
private Context mContext;
|
||||
private List<InfoSel> list;
|
||||
private onRecyclerViewItemClick mOnRvItemClick;
|
||||
|
||||
public SelAdapter(Context mContext, List<InfoSel> list, onRecyclerViewItemClick mOnRvItemClick) {
|
||||
this.mContext = mContext;
|
||||
this.list = list;
|
||||
this.mOnRvItemClick = mOnRvItemClick;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.moudle_item_sel,parent,false);
|
||||
ViewHolder holder = new ViewHolder(view);
|
||||
return holder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||
InfoSel item = list.get(position);
|
||||
holder.tv_name.setText(item.getText());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener{
|
||||
View tview;
|
||||
TextView tv_name;
|
||||
public ViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
tview = itemView;
|
||||
tv_name = itemView.findViewById(R.id.moudle_item_sel_tv_name);
|
||||
tview.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mOnRvItemClick != null)
|
||||
mOnRvItemClick.onItemClick(v, getAdapterPosition());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* item点击接口
|
||||
*/
|
||||
public interface onRecyclerViewItemClick {
|
||||
void onItemClick(View v, int position);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,62 @@
|
||||
package com.sipai.jspatrol.Fault;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.sipai.jspatrol.Bean.Fault;
|
||||
import com.sipai.jspatrol.R;
|
||||
|
||||
public class DoneFaultActivity extends AppCompatActivity {
|
||||
private Fault mFault;
|
||||
private TextView tv_area,tv_equ,tv_fault_content,tv_date,tv_sub_man,tv_dispose_content,tv_content_added;
|
||||
|
||||
public static void actionStart(Context context, Fault fault){
|
||||
Intent intent = new Intent(context, DoneFaultActivity.class);
|
||||
intent.putExtra("fault",fault);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_done_fault);
|
||||
init();
|
||||
initView();
|
||||
}
|
||||
|
||||
private void init() {
|
||||
if (getIntent().getSerializableExtra("fault")!=null){
|
||||
mFault = (Fault) getIntent().getSerializableExtra("fault");
|
||||
}
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
TextView tv_title = findViewById(R.id.moudle_back_title_tv_title);
|
||||
tv_title.setText("缺陷详情");
|
||||
ImageView btn_back = findViewById(R.id.moudle_back_title_iv_back);
|
||||
btn_back.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
tv_area = findViewById(R.id.moudle_done_fault_tv_area);
|
||||
tv_area.setText(mFault.getProcessSection().getName());
|
||||
tv_equ = findViewById(R.id.moudle_done_fault_tv_equ_name);
|
||||
tv_equ.setText(mFault.getEquipmentCard().getEquipmentname());
|
||||
tv_fault_content = findViewById(R.id.moudle_done_fault_tv_fault_content);
|
||||
tv_fault_content.setText(mFault.getProblemcontent());
|
||||
tv_date = findViewById(R.id.moudle_done_fault_tv_date);
|
||||
tv_date.setText(mFault.getInsdt().substring(0,16));
|
||||
tv_sub_man = findViewById(R.id.moudle_done_fault_tv_man);
|
||||
tv_sub_man.setText(mFault.getInsuser());
|
||||
tv_dispose_content = findViewById(R.id.moudle_done_fault_tv_show_dispose_content);
|
||||
// tv_dispose_content.setText(mFault.);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,97 @@
|
||||
package com.sipai.jspatrol.Fault;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.sipai.jspatrol.Bean.EquList;
|
||||
import com.sipai.jspatrol.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by lvliming on 2018/7/22.
|
||||
*/
|
||||
|
||||
public class EquSingleChoiceAdapter extends RecyclerView.Adapter<EquSingleChoiceAdapter.ViewHolder> {
|
||||
private Context mContext;
|
||||
private List<EquList> list;
|
||||
private onRecyclerViewItemClick mOnRvItemClick;
|
||||
|
||||
public EquSingleChoiceAdapter(Context mContext, List<EquList> list, onRecyclerViewItemClick mOnRvItemClick) {
|
||||
this.mContext = mContext;
|
||||
this.list = list;
|
||||
this.mOnRvItemClick = mOnRvItemClick;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_equ_single_choice,parent,false);
|
||||
ViewHolder holder = new ViewHolder(view);
|
||||
return holder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(ViewHolder holder, int position) {
|
||||
EquList equ = list.get(position);
|
||||
if (equ.getEquipmentmanufacturer()!=null&&!equ.getEquipmentmanufacturer().isEmpty()) {
|
||||
holder.tv_manufacturer.setText(equ.getEquipmentmanufacturer());
|
||||
}else {
|
||||
holder.tv_manufacturer.setText("厂商暂未录入");
|
||||
}
|
||||
holder.tv_equipmentStatusManagement.setText(equ.getEquipmentStatusManagement());
|
||||
if (equ.getEquipmentStatusManagement().equals("在用")){
|
||||
holder.tv_equipmentStatusManagement.setBackground(mContext.getResources().getDrawable(R.drawable.bg_layout_shape_green));
|
||||
holder.tv_equipmentStatusManagement.setTextColor(mContext.getResources().getColor(R.color.green06));
|
||||
}else {
|
||||
holder.tv_equipmentStatusManagement.setBackground(mContext.getResources().getDrawable(R.drawable.bg_layout_shape_gray));
|
||||
holder.tv_equipmentStatusManagement.setTextColor(mContext.getResources().getColor(R.color.gray));
|
||||
}
|
||||
holder.tv_equipmentClass.setText(equ.getEquipmentClass());
|
||||
holder.tv_model.setText(equ.getEquipmentmodel());
|
||||
holder.tv_equipmentLevel.setText(equ.getEquipmentLevel());
|
||||
holder.tv_name.setText(equ.getEquipmentname());
|
||||
holder.tv_cardid.setText(equ.getEquipmentcardid());
|
||||
holder.tv_ps.setText(equ.getProcessSection());
|
||||
holder.tv_model.setText(equ.getEquipmentTypeNumber());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener{
|
||||
View tview;
|
||||
TextView tv_manufacturer,tv_name,tv_cardid,tv_ps,tv_equipmentStatusManagement,tv_equipmentLevel,tv_equipmentClass,tv_model;
|
||||
public ViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
tview = itemView;
|
||||
tv_manufacturer = (TextView) itemView.findViewById(R.id.moudle_item_equ_single_choice_tv_equipmentmanufacturer);
|
||||
tv_name = (TextView) itemView.findViewById(R.id.moudle_item_equ_single_choice_tv_name);
|
||||
tv_cardid = (TextView) itemView.findViewById(R.id.moudle_item_equ_single_choice_tv_cardid);
|
||||
tv_ps = itemView.findViewById(R.id.moudle_item_equ_single_choice_tv_ps);
|
||||
tv_equipmentStatusManagement = itemView.findViewById(R.id.moudle_item_equ_single_choice_tv_equipmentStatusManagement);
|
||||
tv_equipmentLevel = itemView.findViewById(R.id.moudle_item_equ_single_choice_tv_equipmentLevel);
|
||||
tv_equipmentClass = itemView.findViewById(R.id.moudle_item_equ_single_choice_tv_equipmentclass);
|
||||
tv_model = itemView.findViewById(R.id.moudle_item_equ_single_choice_tv_equipmentmodel);
|
||||
tview.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mOnRvItemClick != null)
|
||||
mOnRvItemClick.onItemClick(v, getAdapterPosition());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* item点击接口
|
||||
*/
|
||||
public interface onRecyclerViewItemClick {
|
||||
void onItemClick(View v, int position);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,207 @@
|
||||
package com.sipai.jspatrol.Fault;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import com.sipai.jspatrol.Bean.Fault;
|
||||
import com.sipai.jspatrol.Bean.FaultFlow;
|
||||
import com.sipai.jspatrol.Bean.User;
|
||||
import com.sipai.jspatrol.Fault.adapter.FaultFlowAdapter;
|
||||
import com.sipai.jspatrol.R;
|
||||
import com.sipai.jspatrol.URL.MethodURL;
|
||||
import com.sipai.jspatrol.utils.DateFormatUtils;
|
||||
import com.sipai.jspatrol.utils.OKHttpUtils;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import cn.pedant.SweetAlert.SweetAlertDialog;
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Callback;
|
||||
import okhttp3.Response;
|
||||
|
||||
public class FaultFlowChartActivity extends AppCompatActivity {
|
||||
private Fault mFault;
|
||||
private List<FaultFlow> flows = new ArrayList<>();
|
||||
private SwipeRefreshLayout refreshLayout;
|
||||
private RecyclerView rc;
|
||||
private LinearLayoutManager manager;
|
||||
private FaultFlowAdapter adapter;
|
||||
|
||||
public static void actionStart(Context context, Fault fault){
|
||||
Intent intent = new Intent(context, FaultFlowChartActivity.class);
|
||||
intent.putExtra("fault",fault);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_fault_flow_chart);
|
||||
init();
|
||||
initView();
|
||||
getFlow();
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
*/
|
||||
private String mServer;
|
||||
private String mUsername;
|
||||
private String mPassword;
|
||||
private String mUserid;
|
||||
private String mCaption;
|
||||
private String mBizid;
|
||||
private String mGroup;
|
||||
public void init(){
|
||||
SharedPreferences sharedPre=getSharedPreferences("config", MODE_PRIVATE);
|
||||
mServer=sharedPre.getString("server", "");
|
||||
mUsername=sharedPre.getString("username", "");
|
||||
mPassword=sharedPre.getString("password", "");
|
||||
mUserid=sharedPre.getString("userid", "");
|
||||
mCaption=sharedPre.getString("caption", "");
|
||||
mBizid=sharedPre.getString("bizid", "");
|
||||
mGroup=sharedPre.getString("group", "");
|
||||
if (getIntent().getSerializableExtra("fault")!=null){
|
||||
mFault = (Fault) getIntent().getSerializableExtra("fault");
|
||||
}
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
TextView tv_title = findViewById(R.id.moudle_back_title_tv_title);
|
||||
tv_title.setText("处理流程");
|
||||
ImageView btn_back = findViewById(R.id.moudle_back_title_iv_back);
|
||||
btn_back.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
refreshLayout = findViewById(R.id.moudle_fault_flow_chart_refresh);
|
||||
refreshLayout.setColorSchemeResources(R.color.blue);
|
||||
refreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
getFlow();
|
||||
}
|
||||
});
|
||||
rc = findViewById(R.id.moudle_fault_flow_chart_rc);
|
||||
manager = new LinearLayoutManager(this);
|
||||
rc.setLayoutManager(manager);
|
||||
}
|
||||
|
||||
private void getFlow() {
|
||||
if (!refreshLayout.isRefreshing()) {
|
||||
showRefresh();
|
||||
}
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("id",mFault.getId());
|
||||
OKHttpUtils.getClient().newCall(OKHttpUtils.OKHttpRequest(map, mServer, MethodURL.GetMaintenanceFlowChart_Method)).enqueue(new Callback() {
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e) {
|
||||
String a = e.toString();
|
||||
hideRefresh();
|
||||
if (!FaultFlowChartActivity.this.isFinishing()){
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
new SweetAlertDialog(FaultFlowChartActivity.this, SweetAlertDialog.WARNING_TYPE)
|
||||
.setTitleText("提示")
|
||||
.setContentText("流程图获取失败,请重试!")
|
||||
.setConfirmText("重试")
|
||||
.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
|
||||
@Override
|
||||
public void onClick(SweetAlertDialog sweetAlertDialog) {
|
||||
sweetAlertDialog.dismissWithAnimation();
|
||||
getFlow();
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException {
|
||||
String res = response.body().string();
|
||||
hideRefresh();
|
||||
flows = parseFlow(res);
|
||||
updateFlow();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void showRefresh() {
|
||||
if (!FaultFlowChartActivity.this.isFinishing()){
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
refreshLayout.setRefreshing(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void hideRefresh() {
|
||||
if (!FaultFlowChartActivity.this.isFinishing()){
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
refreshLayout.setRefreshing(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void updateFlow() {
|
||||
if (!FaultFlowChartActivity.this.isFinishing()){
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
adapter = new FaultFlowAdapter(FaultFlowChartActivity.this,flows);
|
||||
rc.setAdapter(adapter);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private List<FaultFlow> parseFlow(String res) {
|
||||
List<FaultFlow> list = new ArrayList<>();
|
||||
try {
|
||||
JSONArray array = new JSONArray(res);
|
||||
for (int i=0;i<array.length();i++){
|
||||
FaultFlow item = new FaultFlow();
|
||||
item.setId(array.getJSONObject(i).optString("id"));
|
||||
item.setProcessid(array.getJSONObject(i).optString("processid"));
|
||||
item.setRecord(array.getJSONObject(i).optString("record"));
|
||||
item.setTaskName(array.getJSONObject(i).optString("taskName"));
|
||||
item.setInsdt(DateFormatUtils.DateFormatMinString(array.getJSONObject(i).optString("insdt")));
|
||||
User user = new User();
|
||||
JSONObject jsonObject = array.getJSONObject(i).getJSONObject("user");
|
||||
user.setId(jsonObject.optString("id"));
|
||||
user.setCaption(jsonObject.optString("caption"));
|
||||
item.setUser(user);
|
||||
list.add(item);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,167 @@
|
||||
package com.sipai.jspatrol.Fault;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.BaseAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.Priority;
|
||||
import com.sipai.jspatrol.R;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
//import com.lzy.ninegrid.preview.ImagePreviewActivity;
|
||||
|
||||
/**
|
||||
* com.bm.falvzixun.adapter.GridViewAddImgAdpter
|
||||
*
|
||||
* @author yuandl on 2015/12/24.
|
||||
* 添加上传图片适配器
|
||||
*/
|
||||
public class GridViewAddImgesAdpter extends BaseAdapter {
|
||||
private List<Map<String, Object>> datas;
|
||||
private Context context;
|
||||
private LayoutInflater inflater;
|
||||
/**
|
||||
* 可以动态设置最多上传几张,之后就不显示+号了,用户也无法上传了
|
||||
* 默认9张
|
||||
*/
|
||||
private int maxImages = 4;
|
||||
|
||||
public GridViewAddImgesAdpter(List<Map<String, Object>> datas, Context context) {
|
||||
this.datas = datas;
|
||||
this.context = context;
|
||||
inflater = LayoutInflater.from(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取最大上传张数
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public int getMaxImages() {
|
||||
return maxImages;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置最大上传张数
|
||||
*
|
||||
* @param maxImages
|
||||
*/
|
||||
public void setMaxImages(int maxImages) {
|
||||
this.maxImages = maxImages;
|
||||
}
|
||||
|
||||
/**
|
||||
* 让GridView中的数据数目加1最后一个显示+号
|
||||
*
|
||||
* @return 返回GridView中的数量
|
||||
*/
|
||||
@Override
|
||||
public int getCount() {
|
||||
int count = datas == null ? 1 : datas.size() + 1;
|
||||
if (count >= maxImages) {
|
||||
return datas.size();
|
||||
} else {
|
||||
return count;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getItem(int position) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getItemId(int position) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void notifyDataSetChanged(List<Map<String, Object>> datas) {
|
||||
this.datas = datas;
|
||||
this.notifyDataSetChanged();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public View getView(final int position, View convertView, ViewGroup parent) {
|
||||
|
||||
|
||||
ViewHolder viewHolder = null;
|
||||
if (convertView == null) {
|
||||
convertView = inflater.inflate(R.layout.item_published_grida, parent, false);
|
||||
viewHolder = new ViewHolder(convertView);
|
||||
convertView.setTag(viewHolder);
|
||||
} else {
|
||||
viewHolder = (ViewHolder) convertView.getTag();
|
||||
}
|
||||
if (datas != null && position < datas.size()) {
|
||||
final File file = new File(datas.get(position).get("path").toString());
|
||||
Glide.with(context)
|
||||
.load(file)
|
||||
.priority(Priority.HIGH)
|
||||
.into(viewHolder.ivimage);
|
||||
// viewHolder.ivimage.setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
// Intent intent = new Intent(v.getContext(),PreviewActivity.class);
|
||||
// intent.putExtra("url",datas.get(position).get("path").toString());
|
||||
// v.getContext().startActivity(intent);
|
||||
// }
|
||||
// });
|
||||
viewHolder.btdel.setVisibility(View.VISIBLE);
|
||||
viewHolder.btdel.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (file.exists()) {
|
||||
file.delete();
|
||||
}
|
||||
datas.remove(position);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
// viewHolder.btadd.setVisibility(View.VISIBLE);
|
||||
// viewHolder.btadd.setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View v) {
|
||||
// Intent intent = new Intent(v.getContext(),PreviewActivity.class);
|
||||
// intent.putExtra("url",datas.get(position).get("path").toString());
|
||||
// v.getContext().startActivity(intent);
|
||||
// }
|
||||
// });
|
||||
} else {
|
||||
|
||||
Glide.with(context)
|
||||
.load(R.mipmap.image_add1)
|
||||
.priority(Priority.HIGH)
|
||||
.centerCrop()
|
||||
.into(viewHolder.ivimage);
|
||||
viewHolder.ivimage.setScaleType(ImageView.ScaleType.FIT_XY);
|
||||
viewHolder.btdel.setVisibility(View.GONE);
|
||||
// viewHolder.btadd.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
return convertView;
|
||||
|
||||
}
|
||||
|
||||
public class ViewHolder {
|
||||
public final ImageView ivimage;
|
||||
// public final Button btadd;
|
||||
public final Button btdel;
|
||||
public final View root;
|
||||
|
||||
public ViewHolder(View root) {
|
||||
ivimage = (ImageView) root.findViewById(R.id.iv_image);
|
||||
btdel = (Button) root.findViewById(R.id.bt_del);
|
||||
// btadd = (Button) root.findViewById(R.id.bt_add);
|
||||
this.root = root;
|
||||
}
|
||||
}
|
||||
}
|
||||
1203
app/src/main/java/com/sipai/jspatrol/Fault/NewFaultActivity.java
Normal file
1203
app/src/main/java/com/sipai/jspatrol/Fault/NewFaultActivity.java
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,638 @@
|
||||
package com.sipai.jspatrol.Fault;
|
||||
|
||||
import android.app.DatePickerDialog;
|
||||
import android.app.TimePickerDialog;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.widget.AdapterView;
|
||||
import android.widget.ArrayAdapter;
|
||||
import android.widget.Button;
|
||||
import android.widget.DatePicker;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.Spinner;
|
||||
import android.widget.TextView;
|
||||
import android.widget.TimePicker;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.hitomi.tilibrary.transfer.TransferConfig;
|
||||
import com.hitomi.tilibrary.transfer.Transferee;
|
||||
import com.sipai.jspatrol.Bean.Fault;
|
||||
import com.sipai.jspatrol.Bean.Picture;
|
||||
import com.sipai.jspatrol.Bean.User;
|
||||
import com.sipai.jspatrol.Fault.adapter.PicAdapter;
|
||||
import com.sipai.jspatrol.R;
|
||||
import com.sipai.jspatrol.URL.MethodURL;
|
||||
import com.sipai.jspatrol.utils.OKHttpUtils;
|
||||
import com.vansz.glideimageloader.GlideImageLoader;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import cn.pedant.SweetAlert.SweetAlertDialog;
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Callback;
|
||||
import okhttp3.Response;
|
||||
|
||||
public class NewFaultDetailActivity extends AppCompatActivity implements View.OnClickListener{
|
||||
private TextView tv_company,tv_processsection,tv_abnormitydescription,tv_remark,tv_equs,tv_sub_man,tv_sub_time;
|
||||
private LinearLayout ll_equ;
|
||||
private LinearLayout ll_todo;//生成缺陷
|
||||
private TextView tv_receiver,tv_fault_type;
|
||||
private Spinner sp_dispose_type;
|
||||
private String st_dispose_type;
|
||||
private String is_make_todo = "";
|
||||
private String st_sel_receiver_id = "";
|
||||
private EditText edt_complete_date;
|
||||
private Fault mfault;
|
||||
private List<User> receivers = new ArrayList<>();
|
||||
private List<User> sel_receivers = new ArrayList<>();
|
||||
private static final int SEND_RECEIVERS = 131;
|
||||
private Calendar cal;
|
||||
private int year,month,day,hour,minute;
|
||||
private String mseriverip;
|
||||
private RecyclerView rc_pic;
|
||||
private List<Picture> pics = new ArrayList<>();
|
||||
private PicAdapter picAdapter;
|
||||
private LinearLayoutManager stmanager;
|
||||
private Button btn_sub;
|
||||
private SweetAlertDialog pDialog;
|
||||
private ImageView iv;
|
||||
private Transferee transferee;
|
||||
private EditText edt_planMoney;
|
||||
private String planMoney = "";
|
||||
|
||||
|
||||
public static void actionStart(Context context, Fault fault, String todo){
|
||||
Intent intent = new Intent(context, NewFaultDetailActivity.class);
|
||||
intent.putExtra("fault",fault);
|
||||
intent.putExtra("todo",todo);
|
||||
context.startActivity(intent);
|
||||
}
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_new_fault_detail);
|
||||
init();
|
||||
getNowData();
|
||||
initView();
|
||||
initData();
|
||||
getPic();
|
||||
if (is_make_todo.equals("yes")){
|
||||
ll_todo.setVisibility(View.VISIBLE);
|
||||
getReceiver();
|
||||
}else {
|
||||
ll_todo.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
private void getPic() {
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("masterId",mfault.getId());
|
||||
map.put("tbName","tb_maintenance_problem_fille");
|
||||
OKHttpUtils.getClient().newCall(OKHttpUtils.OKHttpRequest(map, mServer, MethodURL.GetFaultPics_Method)).enqueue(new Callback() {
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e) {
|
||||
loadPicFail(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException {
|
||||
String res = response.body().string();
|
||||
pics = getPicData(res);
|
||||
updatePic();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void loadPicFail(IOException e) {
|
||||
if (!NewFaultDetailActivity.this.isFinishing()) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Toast.makeText(NewFaultDetailActivity.this, "图片获取失败:" + e.toString(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void updatePic() {
|
||||
if (!NewFaultDetailActivity.this.isFinishing()){
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (pics.size()>0) {
|
||||
List<String> ivUrls = new ArrayList<>();
|
||||
for (int i=0;i<pics.size();i++){
|
||||
ivUrls.add(pics.get(i).getAbspath());
|
||||
}
|
||||
TransferConfig config = TransferConfig.build()
|
||||
.setSourceUrlList(ivUrls)
|
||||
.setDuration(350)
|
||||
.setImageLoader(GlideImageLoader.with(getApplicationContext()))
|
||||
.bindRecyclerView(rc_pic, R.id.moudle_new_fault_detail_rc_pic);
|
||||
rc_pic.setVisibility(View.VISIBLE);
|
||||
picAdapter = new PicAdapter(pics, NewFaultDetailActivity.this, new PicAdapter.PicAdapterOnClickListener() {
|
||||
@Override
|
||||
public void onItemClick(View v, int position) {
|
||||
config.setNowThumbnailIndex(position);
|
||||
transferee.apply(config).show();
|
||||
}
|
||||
});
|
||||
rc_pic.setAdapter(picAdapter);
|
||||
stmanager = new LinearLayoutManager(NewFaultDetailActivity.this);
|
||||
stmanager.setOrientation(LinearLayoutManager.HORIZONTAL);
|
||||
rc_pic.setLayoutManager(stmanager);
|
||||
}else {
|
||||
rc_pic.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private List<Picture> getPicData(String response) {
|
||||
List<Picture> list = new ArrayList<>();
|
||||
try {
|
||||
JSONArray aNews = new JSONArray(response);
|
||||
for (int i=0;i<aNews.length();i++){
|
||||
Picture item = new Picture();
|
||||
item.setId(aNews.getJSONObject(i).get("id").toString());
|
||||
String abs = aNews.getJSONObject(i).get("abspath").toString();
|
||||
String url = "http://"+mseriverip.substring(0,mseriverip.length())+"////UploadFile////MaintenanceProblem////"+abs.substring(abs.lastIndexOf("\\")+1,abs.length());
|
||||
item.setAbspath(url);
|
||||
list.add(item);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private void getNowData() {
|
||||
cal=Calendar.getInstance();
|
||||
year=cal.get(Calendar.YEAR); //获取年月日时分秒
|
||||
month=cal.get(Calendar.MONTH); //获取到的月份是从0开始计数
|
||||
day=cal.get(Calendar.DAY_OF_MONTH);
|
||||
hour = cal.get(Calendar.HOUR_OF_DAY);
|
||||
minute = cal.get(Calendar.MONTH);
|
||||
}
|
||||
|
||||
private void getReceiver() {
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("search_pid",mBizid);
|
||||
OKHttpUtils.getClient().newCall(OKHttpUtils.OKHttpRequest(map, mServer, MethodURL.GETUSERLISt_Method)).enqueue(new Callback() {
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e) {
|
||||
String a = e.toString();
|
||||
if (!NewFaultDetailActivity.this.isFinishing()){
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
new SweetAlertDialog(NewFaultDetailActivity.this, SweetAlertDialog.WARNING_TYPE)
|
||||
.setTitleText("提示")
|
||||
.setContentText("人员列表获取失败,请重试!")
|
||||
.setConfirmText("重试")
|
||||
.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
|
||||
@Override
|
||||
public void onClick(SweetAlertDialog sweetAlertDialog) {
|
||||
sweetAlertDialog.dismissWithAnimation();
|
||||
getReceiver();
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException {
|
||||
String res = response.body().string();
|
||||
receivers = parseReceiver(res);
|
||||
}
|
||||
});
|
||||
// PersistentCookieStore myCookieStore = new PersistentCookieStore(this);
|
||||
// RequestParams params = new RequestParams();
|
||||
// params.put("search_pid",mBizid);
|
||||
// params.put("rows","1000");
|
||||
// AsyncHttpClient client = new AsyncHttpClient();
|
||||
// client.setCookieStore(myCookieStore);
|
||||
// client.post(mServer+"user/getUsers.do?", params, new AsyncHttpResponseHandler() {
|
||||
// @Override
|
||||
// public void onSuccess(String response) {
|
||||
// receivers = parseReceiver(response);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onStart() {
|
||||
// super.onStart();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFinish() {
|
||||
// super.onFinish();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void onFailure(final Throwable error) {
|
||||
// super.onFailure(error);
|
||||
//
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
private List<User> parseReceiver(String response) {
|
||||
List<User> list = new ArrayList<>();
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(response);
|
||||
JSONArray aNews = new JSONArray(jsonObject.getString("rows"));
|
||||
for (int i=0;i<aNews.length();i++){
|
||||
User item = new User();
|
||||
item.setId(aNews.getJSONObject(i).get("id").toString());
|
||||
item.setCaption(aNews.getJSONObject(i).get("caption").toString());
|
||||
item.setName(aNews.getJSONObject(i).get("name").toString());
|
||||
list.add(item);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
|
||||
if (mfault.getBiz()!=null&&mfault.getBiz().getName().length()>0){
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
tv_company.setText(mfault.getBiz().getName());
|
||||
tv_processsection.setText(mfault.getProcessSection().getName());
|
||||
tv_abnormitydescription.setText(mfault.getAbnormityDescription());
|
||||
tv_remark.setText(mfault.getRemark());
|
||||
tv_equs.setText(mfault.getEquipmentNames());
|
||||
tv_sub_man.setText(mfault.getInsuser());
|
||||
tv_sub_time.setText(mfault.getInsdt().substring(5, 16));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void initView(){
|
||||
TextView tv_title = findViewById(R.id.moudle_back_title_tv_title);
|
||||
tv_title.setText("异常详情");
|
||||
ImageView btn_back = findViewById(R.id.moudle_back_title_iv_back);
|
||||
btn_back.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
pDialog = new SweetAlertDialog(this, SweetAlertDialog.PROGRESS_TYPE);
|
||||
pDialog.getProgressHelper().setBarColor(Color.parseColor("#419DE4"));
|
||||
pDialog.setTitleText("数据上传中...");
|
||||
pDialog.setCancelable(true);
|
||||
pDialog.setCanceledOnTouchOutside(true);
|
||||
tv_company = findViewById(R.id.moudle_new_fault_detail_tv_company);
|
||||
tv_processsection = findViewById(R.id.moudle_new_fault_detail_tv_processsection);
|
||||
tv_abnormitydescription = findViewById(R.id.moudle_new_fault_detail_tv_abnormitydescription);
|
||||
tv_remark = findViewById(R.id.moudle_new_fault_detail_tv_remark);
|
||||
ll_equ = findViewById(R.id.moudle_new_fault_detail_ll_equ);
|
||||
tv_equs = findViewById(R.id.moudle_new_fault_detail_tv_equs);
|
||||
tv_sub_man = findViewById(R.id.moudle_new_fault_detail_tv_sub_man);
|
||||
tv_sub_time = findViewById(R.id.moudle_new_fault_detail_tv_sub_time);
|
||||
ll_todo = findViewById(R.id.moudle_new_fault_detail_ll_todo);
|
||||
sp_dispose_type = findViewById(R.id.moudle_new_fault_detail_sp);
|
||||
final String[] repairtypes = getResources().getStringArray(R.array.dispose_type);
|
||||
ArrayAdapter repairtypeAdapter = new ArrayAdapter(this, R.layout.item_normal_little_spin, R.id.moudle_normal_little_spin_tv_title, repairtypes);
|
||||
sp_dispose_type.setAdapter(repairtypeAdapter);
|
||||
sp_dispose_type.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
|
||||
@Override
|
||||
public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
|
||||
st_dispose_type = String.valueOf(position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNothingSelected(AdapterView<?> parent) {
|
||||
st_dispose_type = "0";
|
||||
}
|
||||
});
|
||||
edt_complete_date = findViewById(R.id.moudle_new_fault_detail_edt_complete_date);
|
||||
edt_complete_date.setOnClickListener(this);
|
||||
//在TextView上显示日期
|
||||
String smonth = "";
|
||||
String sday = "";
|
||||
String shour = "";
|
||||
String smin = "00";
|
||||
//在TextView上显示日期
|
||||
if (month<9){
|
||||
smonth = "0"+String.valueOf(month+1);
|
||||
}else {
|
||||
smonth = String.valueOf(month+1);
|
||||
}
|
||||
if (day<10){
|
||||
sday = "0"+String.valueOf(day);
|
||||
}else {
|
||||
sday = String.valueOf(day);
|
||||
}
|
||||
if (hour<10){
|
||||
shour = "0"+String.valueOf(hour);
|
||||
}else {
|
||||
shour = String.valueOf(hour);
|
||||
}
|
||||
transferee = Transferee.getDefault(this);
|
||||
edt_complete_date.setText(year+"-"+smonth+"-"+sday+" "+shour+":"+"00:00");
|
||||
edt_complete_date.setOnTouchListener(new View.OnTouchListener() {
|
||||
@Override
|
||||
public boolean onTouch(View v, MotionEvent event) {
|
||||
//创建DatePickerDialog对象
|
||||
if (event.getAction() == MotionEvent.ACTION_DOWN) {
|
||||
DatePickerDialog dpd = new DatePickerDialog(NewFaultDetailActivity.this, Datelistener, year, month, day);
|
||||
dpd.show();//显示DatePickerDialog组件
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
edt_planMoney = findViewById(R.id.moudle_new_fault_detail_edt_planMoney);
|
||||
tv_receiver = findViewById(R.id.moudle_new_fault_detail_tv_receiver);
|
||||
tv_receiver.setOnClickListener(this);
|
||||
tv_fault_type = findViewById(R.id.moudle_new_fault_detail_tv_fault_type);
|
||||
tv_fault_type.setOnClickListener(this);
|
||||
btn_sub = findViewById(R.id.moudle_new_fault_detail_btn_sub);
|
||||
btn_sub.setOnClickListener(this);
|
||||
rc_pic = findViewById(R.id.moudle_new_fault_detail_rc_pic);
|
||||
// picAdapter = new PicAdapter(pics,NewFaultDetailActivity.this);
|
||||
// rc_pic.setAdapter(picAdapter);
|
||||
stmanager = new LinearLayoutManager(NewFaultDetailActivity.this);
|
||||
stmanager.setOrientation(LinearLayoutManager.HORIZONTAL);
|
||||
rc_pic.setLayoutManager(stmanager);
|
||||
}
|
||||
|
||||
private DatePickerDialog.OnDateSetListener Datelistener=new DatePickerDialog.OnDateSetListener()
|
||||
{
|
||||
@Override
|
||||
public void onDateSet(DatePicker view, int myyear, int monthOfYear, int dayOfMonth) {
|
||||
//修改year、month、day的变量值,以便以后单击按钮时,DatePickerDialog上显示上一次修改后的值
|
||||
year=myyear;
|
||||
month=monthOfYear;
|
||||
day=dayOfMonth;
|
||||
//更新日期
|
||||
updateDate();
|
||||
}
|
||||
//当DatePickerDialog关闭时,更新日期显示
|
||||
private void updateDate()
|
||||
{
|
||||
//在TextView上显示日期
|
||||
TimePickerDialog dpd=new TimePickerDialog(NewFaultDetailActivity.this,Timelistener,hour,minute,true);
|
||||
dpd.show();//显示DatePickerDialog组件
|
||||
}
|
||||
};
|
||||
private TimePickerDialog.OnTimeSetListener Timelistener=new TimePickerDialog.OnTimeSetListener()
|
||||
{
|
||||
@Override
|
||||
public void onTimeSet(TimePicker view, int hours, int minutes) {
|
||||
//修改year、month、day的变量值,以便以后单击按钮时,DatePickerDialog上显示上一次修改后的值
|
||||
hour=hours;
|
||||
minute=minutes;
|
||||
//更新日期
|
||||
updateDate();
|
||||
}
|
||||
//当DatePickerDialog关闭时,更新日期显示
|
||||
private void updateDate()
|
||||
{
|
||||
//在TextView上显示日期
|
||||
String smonth = "";
|
||||
String sday = "";
|
||||
String shour = "";
|
||||
String smin = "00";
|
||||
//在TextView上显示日期
|
||||
if (month<9){
|
||||
smonth = "0"+String.valueOf(month+1);
|
||||
}else {
|
||||
smonth = String.valueOf(month+1);
|
||||
}
|
||||
if (day<10){
|
||||
sday = "0"+String.valueOf(day);
|
||||
}else {
|
||||
sday = String.valueOf(day);
|
||||
}
|
||||
if (hour<10){
|
||||
shour = "0"+String.valueOf(hour);
|
||||
}else {
|
||||
shour = String.valueOf(hour);
|
||||
}
|
||||
//在TextView上显示日期
|
||||
if(edt_complete_date.isFocused()){
|
||||
edt_complete_date.setText(year+"-"+smonth+"-"+sday+" "+shour+":"+"00:00");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
*/
|
||||
private String mServer;
|
||||
private String mUsername;
|
||||
private String mPassword;
|
||||
private String mUserid;
|
||||
private String mCaption;
|
||||
private String mBizid;
|
||||
private String mGroup;
|
||||
private String role;
|
||||
public void init(){
|
||||
SharedPreferences sharedPre=getSharedPreferences("config", MODE_PRIVATE);
|
||||
role = sharedPre.getString("role","");
|
||||
mServer=sharedPre.getString("server", "");
|
||||
mseriverip=sharedPre.getString("serverip", "");
|
||||
mUsername=sharedPre.getString("username", "");
|
||||
mPassword=sharedPre.getString("password", "");
|
||||
mUserid=sharedPre.getString("userid", "");
|
||||
mCaption=sharedPre.getString("caption", "");
|
||||
mBizid=sharedPre.getString("bizid", "");
|
||||
mGroup=sharedPre.getString("group", "");
|
||||
mfault = (Fault) getIntent().getSerializableExtra("fault");
|
||||
is_make_todo = getIntent().getStringExtra("todo");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
switch (view.getId()){
|
||||
case R.id.moudle_new_fault_detail_edt_complete_date:
|
||||
break;
|
||||
case R.id.moudle_new_fault_detail_tv_receiver:
|
||||
if (receivers.size()>0) {
|
||||
Intent intent = new Intent(NewFaultDetailActivity.this, PersonSelectorActivity.class);
|
||||
intent.putExtra("users", (Serializable) receivers);
|
||||
startActivityForResult(intent,SEND_RECEIVERS);
|
||||
}else {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
new SweetAlertDialog(NewFaultDetailActivity.this, SweetAlertDialog.WARNING_TYPE)
|
||||
.setTitleText("提示")
|
||||
.setContentText("暂未配置接收人")
|
||||
.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
break;
|
||||
case R.id.moudle_new_fault_detail_tv_fault_type:
|
||||
break;
|
||||
case R.id.moudle_new_fault_detail_btn_sub:
|
||||
sub();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void pDialogHide() {
|
||||
if (!NewFaultDetailActivity.this.isFinishing()) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
pDialog.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void pDialogshow() {
|
||||
if (!NewFaultDetailActivity.this.isFinishing()) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
pDialog.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
生成缺陷
|
||||
*/
|
||||
private void sub() {
|
||||
pDialogshow();
|
||||
if (edt_planMoney.getText()!=null&&!edt_planMoney.getText().toString().isEmpty()){
|
||||
planMoney = edt_planMoney.getText().toString();
|
||||
}
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("maintenanceWay",st_dispose_type);
|
||||
map.put("plannedenddt",edt_complete_date.getText().toString());
|
||||
map.put("solver",st_sel_receiver_id);
|
||||
map.put("planMoney",planMoney);
|
||||
map.put("problemtypeid","");
|
||||
map.put("ids",mfault.getId());
|
||||
OKHttpUtils.getClient().newCall(OKHttpUtils.OKHttpRequest(map, mServer, MethodURL.IssuedFault_Method)).enqueue(new Callback() {
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e) {
|
||||
String a = e.toString();
|
||||
pDialogHide();
|
||||
if (!NewFaultDetailActivity.this.isFinishing()) {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
Toast.makeText(NewFaultDetailActivity.this, "生成缺陷失败:" + e.toString(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException {
|
||||
String res = response.body().string();
|
||||
pDialogHide();
|
||||
if (res.equals("1")||res.equals("2")){
|
||||
SubSuccess();
|
||||
}else {
|
||||
SubFail();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void SubFail() {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
new SweetAlertDialog(NewFaultDetailActivity.this, SweetAlertDialog.ERROR_TYPE)
|
||||
.setTitleText("上传失败,请重试")
|
||||
.setConfirmText("确认")
|
||||
.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
|
||||
@Override
|
||||
public void onClick(SweetAlertDialog sweetAlertDialog) {
|
||||
sweetAlertDialog.dismissWithAnimation();
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void SubSuccess() {
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
new SweetAlertDialog(NewFaultDetailActivity.this, SweetAlertDialog.SUCCESS_TYPE)
|
||||
.setTitleText("上传成功")
|
||||
.setConfirmText("确认")
|
||||
.setConfirmClickListener(new SweetAlertDialog.OnSweetClickListener() {
|
||||
@Override
|
||||
public void onClick(SweetAlertDialog sweetAlertDialog) {
|
||||
sweetAlertDialog.dismissWithAnimation();
|
||||
finish();
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
switch (requestCode) {
|
||||
case SEND_RECEIVERS:
|
||||
if (resultCode == RESULT_OK) {
|
||||
sel_receivers = (List<User>) data.getSerializableExtra("sel");
|
||||
String suser = "";
|
||||
st_sel_receiver_id = "";
|
||||
if (sel_receivers.size() > 0) {
|
||||
for (int i = 0; i < sel_receivers.size(); i++) {
|
||||
if (i == 0) {
|
||||
suser = sel_receivers.get(i).getCaption();
|
||||
st_sel_receiver_id = sel_receivers.get(i).getId();
|
||||
} else if (0<i &&i < sel_receivers.size()) {
|
||||
suser = suser + "," + sel_receivers.get(i).getCaption();
|
||||
st_sel_receiver_id = st_sel_receiver_id + "," + sel_receivers.get(i).getId();
|
||||
}
|
||||
}
|
||||
}
|
||||
final String st = suser;
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (sel_receivers.size() > 0) {
|
||||
tv_receiver.setText(st);
|
||||
}
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,71 @@
|
||||
package com.sipai.jspatrol.Fault;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.sipai.jspatrol.Bean.ProcessSection;
|
||||
import com.sipai.jspatrol.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by lvliming on 2018/7/22.
|
||||
*/
|
||||
|
||||
public class PSSingleChoiceAdapter extends RecyclerView.Adapter<PSSingleChoiceAdapter.ViewHolder> {
|
||||
private Context mContext;
|
||||
private List<ProcessSection> list;
|
||||
private onRecyclerViewItemClick mOnRvItemClick;
|
||||
|
||||
public PSSingleChoiceAdapter(Context mContext, List<ProcessSection> list, onRecyclerViewItemClick mOnRvItemClick) {
|
||||
this.mContext = mContext;
|
||||
this.list = list;
|
||||
this.mOnRvItemClick = mOnRvItemClick;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_ps_single_choice,parent,false);
|
||||
ViewHolder holder = new ViewHolder(view);
|
||||
return holder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(ViewHolder holder, int position) {
|
||||
ProcessSection item = list.get(position);
|
||||
holder.tv_name.setText(item.getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener{
|
||||
View tview;
|
||||
TextView tv_name;
|
||||
public ViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
tview = itemView;
|
||||
tv_name = itemView.findViewById(R.id.moudle_item_ps_single_choice_tv_name);
|
||||
tview.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mOnRvItemClick != null)
|
||||
mOnRvItemClick.onItemClick(v, getAdapterPosition());
|
||||
}
|
||||
}
|
||||
/**
|
||||
* item点击接口
|
||||
*/
|
||||
public interface onRecyclerViewItemClick {
|
||||
void onItemClick(View v, int position);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,152 @@
|
||||
package com.sipai.jspatrol.Fault;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.sipai.jspatrol.Bean.User;
|
||||
import com.sipai.jspatrol.Fault.adapter.PersonSelectorAdapter;
|
||||
import com.sipai.jspatrol.R;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class PersonSelectorActivity extends AppCompatActivity {
|
||||
private List<User> users = new ArrayList<>();
|
||||
private List<User> search_users = new ArrayList<>();
|
||||
private List<User> sel_users = new ArrayList<>();
|
||||
private RecyclerView rc_view;
|
||||
private PersonSelectorAdapter adapter;
|
||||
private LinearLayoutManager manager;
|
||||
private ImageView iv_search;
|
||||
private EditText edt_name;
|
||||
private String sel_mark;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_person_selector);
|
||||
init();
|
||||
initView();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
ImageView btn_back = (ImageView) findViewById(R.id.moudle_ps_iv_back);
|
||||
btn_back.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
finish();
|
||||
}
|
||||
});
|
||||
TextView tv_save = (TextView) findViewById(R.id.moudle_ps_tv_save);
|
||||
tv_save.setText("保存");
|
||||
tv_save.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
sel_users.clear();
|
||||
Map<Integer, Boolean> map1 = adapter.getMap();
|
||||
for (int i = map1.size()-1; 0<=i; i--) {
|
||||
if (map1.get(i)) {
|
||||
Log.d("TAG", "你选了第:" + i + "项");
|
||||
if (sel_mark.equals("all")) {
|
||||
sel_users.add(users.get(i));
|
||||
}else {
|
||||
sel_users.add(search_users.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("sel", (Serializable) sel_users);
|
||||
setResult(RESULT_OK,intent);
|
||||
finish();
|
||||
}
|
||||
});
|
||||
iv_search = findViewById(R.id.moudle_ps_iv_search);
|
||||
edt_name = findViewById(R.id.moudle_ps_edt_name);
|
||||
edt_name.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
if (!s.toString().isEmpty()) {
|
||||
checkUsers(String.valueOf(s));
|
||||
}else {
|
||||
showAll();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterTextChanged(Editable s) {
|
||||
|
||||
}
|
||||
});
|
||||
rc_view = findViewById(R.id.moudle_person_selector_rc);
|
||||
adapter = new PersonSelectorAdapter(users,PersonSelectorActivity.this);
|
||||
rc_view.setAdapter(adapter);
|
||||
manager = new LinearLayoutManager(this);
|
||||
rc_view.setLayoutManager(manager);
|
||||
sel_mark = "all";
|
||||
}
|
||||
|
||||
private void showAll() {
|
||||
if (!PersonSelectorActivity.this.isFinishing()){
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
sel_mark = "all";
|
||||
adapter = new PersonSelectorAdapter(users,PersonSelectorActivity.this);
|
||||
rc_view.setAdapter(adapter);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void checkUsers(String s) {
|
||||
search_users = new ArrayList<>();
|
||||
for (int i=0;i<users.size();i++){
|
||||
if (users.get(i).getCaption().contains(s)){
|
||||
search_users.add(users.get(i));
|
||||
}
|
||||
}
|
||||
sel_mark = "sel";
|
||||
adapter = new PersonSelectorAdapter(search_users,PersonSelectorActivity.this);
|
||||
rc_view.setAdapter(adapter);
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化
|
||||
*/
|
||||
private String mServer;
|
||||
private String mUsername;
|
||||
private String mPassword;
|
||||
private String mUserid;
|
||||
private String mCaption;
|
||||
private String mBizid;
|
||||
private String mGroup;
|
||||
private String role;
|
||||
public void init(){
|
||||
SharedPreferences sharedPre=getSharedPreferences("config", MODE_PRIVATE);
|
||||
role = sharedPre.getString("role","");
|
||||
mServer=sharedPre.getString("server", "");
|
||||
mUsername=sharedPre.getString("username", "");
|
||||
mPassword=sharedPre.getString("password", "");
|
||||
mUserid=sharedPre.getString("userid", "");
|
||||
mCaption=sharedPre.getString("caption", "");
|
||||
mBizid=sharedPre.getString("bizid", "");
|
||||
mGroup=sharedPre.getString("group", "");
|
||||
users = (List<User>) getIntent().getSerializableExtra("users");
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,355 @@
|
||||
package com.sipai.jspatrol.Fault;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
|
||||
|
||||
import com.sipai.jspatrol.Bean.EquList;
|
||||
import com.sipai.jspatrol.Bean.Measuringpoint;
|
||||
import com.sipai.jspatrol.Bean.ProcessSection;
|
||||
import com.sipai.jspatrol.R;
|
||||
import com.sipai.jspatrol.URL.MethodURL;
|
||||
import com.sipai.jspatrol.utils.OKHttpUtils;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import okhttp3.Call;
|
||||
import okhttp3.Callback;
|
||||
import okhttp3.Response;
|
||||
|
||||
public class SingleChoiceActivity extends AppCompatActivity implements View.OnClickListener {
|
||||
private ImageView iv_back;
|
||||
private EditText edt_name;
|
||||
private TextView tv_search;
|
||||
private String mark = "";
|
||||
private String mServer;
|
||||
private String mUsername;
|
||||
private String mPassword;
|
||||
private String mUserid;
|
||||
private String mCaption;
|
||||
private String mBizid, mBizName;
|
||||
private String name = "";
|
||||
private String sel_ps_id = "";
|
||||
private RecyclerView rc_list;
|
||||
private SwipeRefreshLayout refreshLayout;
|
||||
private List<EquList> equLists = new ArrayList<>();
|
||||
private PSSingleChoiceAdapter psAdapter;
|
||||
private EquSingleChoiceAdapter equAdapter;
|
||||
private LinearLayoutManager manager;
|
||||
private List<ProcessSection> processSections = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_single_choice);
|
||||
init();
|
||||
initView();
|
||||
startSearch();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
iv_back = findViewById(R.id.moudle_single_choice_iv_back);
|
||||
iv_back.setOnClickListener(this);
|
||||
edt_name = findViewById(R.id.moudle_single_choice_edt_equname);
|
||||
tv_search = findViewById(R.id.moudle_single_choice_tv_search);
|
||||
tv_search.setOnClickListener(this);
|
||||
rc_list = findViewById(R.id.moudle_single_choice_rc);
|
||||
refreshLayout = findViewById(R.id.moudle_single_choice_refresh);
|
||||
refreshLayout.setColorSchemeResources(R.color.blue);
|
||||
refreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
startSearch();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void init() {
|
||||
SharedPreferences sharedPre = this.getSharedPreferences("config", 0);
|
||||
mServer = sharedPre.getString("server", "");
|
||||
mUsername = sharedPre.getString("username", "");
|
||||
mPassword = sharedPre.getString("password", "");
|
||||
mUserid = sharedPre.getString("userid", "");
|
||||
mCaption = sharedPre.getString("caption", "");
|
||||
mBizid = sharedPre.getString("bizid", "");
|
||||
mBizName = sharedPre.getString("bizname", "");
|
||||
if (getIntent().getStringExtra("mark")!=null&&!getIntent().getStringExtra("mark").isEmpty()){
|
||||
mark = getIntent().getStringExtra("mark");
|
||||
}
|
||||
if (getIntent().getStringExtra("psId")!=null&&!getIntent().getStringExtra("psId").isEmpty()){
|
||||
sel_ps_id = getIntent().getStringExtra("psId");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
switch (v.getId()){
|
||||
case R.id.moudle_single_choice_iv_back:
|
||||
finish();
|
||||
break;
|
||||
case R.id.moudle_single_choice_tv_search:
|
||||
startSearch();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void startSearch() {
|
||||
if (edt_name.getText()!=null&&!edt_name.getText().toString().isEmpty()){
|
||||
name = edt_name.getText().toString();
|
||||
}
|
||||
judgeRefresh();
|
||||
if (mark.equals("equ")) {
|
||||
searchEqu(name);
|
||||
}else if(mark.equals("ps")){
|
||||
searchPS(name);
|
||||
}
|
||||
}
|
||||
|
||||
private void judgeRefresh() {
|
||||
if (!SingleChoiceActivity.this.isFinishing()){
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (!refreshLayout.isRefreshing()){
|
||||
refreshLayout.setRefreshing(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索工艺段
|
||||
* @param name
|
||||
*/
|
||||
private void searchPS(String name) {
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("search_code",mBizid);
|
||||
map.put("search_name",name);
|
||||
map.put("rows","300");
|
||||
map.put("page","1");
|
||||
OKHttpUtils.getClient().newCall(OKHttpUtils.OKHttpRequest(map, mServer, MethodURL.GETPSLISt_Method)).enqueue(new Callback() {
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e) {
|
||||
if (!SingleChoiceActivity.this.isFinishing()){
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
refreshLayout.setRefreshing(false);
|
||||
Toast.makeText(SingleChoiceActivity.this, "失败:" + e.toString(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException {
|
||||
String res = response.body().string();
|
||||
if (res.contains("total")&&res.contains("rows")) {
|
||||
processSections = parsePS(res);
|
||||
}
|
||||
updatePSList();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void updatePSList() {
|
||||
if (!SingleChoiceActivity.this.isFinishing()){
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
refreshLayout.setRefreshing(false);
|
||||
psAdapter = new PSSingleChoiceAdapter(SingleChoiceActivity.this, processSections, new PSSingleChoiceAdapter.onRecyclerViewItemClick() {
|
||||
@Override
|
||||
public void onItemClick(View v, int position) {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("ps",processSections.get(position));
|
||||
setResult(RESULT_OK,intent);
|
||||
finish();
|
||||
}
|
||||
});
|
||||
rc_list.setAdapter(psAdapter);
|
||||
manager = new LinearLayoutManager(SingleChoiceActivity.this);
|
||||
rc_list.setLayoutManager(manager);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private List<ProcessSection> parsePS(String res) {
|
||||
List<ProcessSection> list = new ArrayList<>();
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(res);
|
||||
JSONArray array = jsonObject.getJSONArray("rows");
|
||||
for (int i=0;i<array.length();i++){
|
||||
ProcessSection item = new ProcessSection();
|
||||
item.setSid(array.getJSONObject(i).optString("id"));
|
||||
item.setSname(array.getJSONObject(i).optString("sname"));
|
||||
item.setName(array.getJSONObject(i).optString("name"));
|
||||
list.add(item);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索设备
|
||||
* @param name
|
||||
*/
|
||||
private void searchEqu(String name) {
|
||||
HashMap<String,String> map = new HashMap<>();
|
||||
map.put("companyId",mBizid);
|
||||
map.put("equipmentName",name);
|
||||
map.put("processSectionId",sel_ps_id);
|
||||
map.put("rows","30");
|
||||
map.put("page","1");
|
||||
OKHttpUtils.getClient().newCall(OKHttpUtils.OKHttpRequest(map, mServer, MethodURL.GETEQULISt_Method)).enqueue(new Callback() {
|
||||
@Override
|
||||
public void onFailure(Call call, IOException e) {
|
||||
if (!SingleChoiceActivity.this.isFinishing()){
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
refreshLayout.setRefreshing(false);
|
||||
Toast.makeText(SingleChoiceActivity.this, "失败:" + e.toString(), Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResponse(Call call, Response response) throws IOException {
|
||||
String res = response.body().string();
|
||||
if (res.contains("total")&&res.contains("rows")) {
|
||||
equLists = parseEqu(res);
|
||||
}
|
||||
updateEquList();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void updateEquList() {
|
||||
if (!SingleChoiceActivity.this.isFinishing()){
|
||||
runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
refreshLayout.setRefreshing(false);
|
||||
equAdapter = new EquSingleChoiceAdapter(SingleChoiceActivity.this, equLists, new EquSingleChoiceAdapter.onRecyclerViewItemClick() {
|
||||
@Override
|
||||
public void onItemClick(View v, int position) {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("ppid",equLists.get(position).getId());
|
||||
intent.putExtra("class","equ");
|
||||
intent.putExtra("equ",equLists.get(position));
|
||||
setResult(RESULT_OK,intent);
|
||||
finish();
|
||||
}
|
||||
});
|
||||
rc_list.setAdapter(equAdapter);
|
||||
manager = new LinearLayoutManager(SingleChoiceActivity.this);
|
||||
rc_list.setLayoutManager(manager);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private List<EquList> parseEqu(String res) {
|
||||
List<EquList> list = new ArrayList<>();
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(res);
|
||||
JSONArray array = jsonObject.getJSONArray("rows");
|
||||
for (int i=0;i<array.length();i++){
|
||||
EquList item = new EquList();
|
||||
item.setId(array.getJSONObject(i).optString("id"));
|
||||
item.setEquipmentmanufacturer(array.getJSONObject(i).optString("equipmentmanufacturer"));
|
||||
item.setEquipmentname(array.getJSONObject(i).optString("equipmentname"));
|
||||
item.setEquipmentcardid(array.getJSONObject(i).optString("equipmentcardid"));
|
||||
item.setEquipmentmodel(array.getJSONObject(i).optString("equipmentmodelname"));
|
||||
if (!array.getJSONObject(i).optString("processSection").equals("null")&&!array.getJSONObject(i).optString("processSection").isEmpty()){
|
||||
JSONObject js = new JSONObject(array.getJSONObject(i).optString("processSection"));
|
||||
item.setProcessSection(js.optString("name"));
|
||||
item.setProcesssectionid(js.optString("id"));
|
||||
}else {
|
||||
item.setProcessSection("暂未配置");
|
||||
}
|
||||
if (!array.getJSONObject(i).optString("equipmentStatusManagement").equals("null")&&!array.getJSONObject(i).optString("equipmentStatusManagement").isEmpty()){
|
||||
JSONObject js = new JSONObject(array.getJSONObject(i).optString("equipmentStatusManagement"));
|
||||
item.setEquipmentStatusManagement(js.optString("name"));
|
||||
}else {
|
||||
item.setEquipmentStatusManagement("未知");
|
||||
}
|
||||
if (!array.getJSONObject(i).optString("equipmentLevel").equals("null")&&!array.getJSONObject(i).optString("equipmentLevel").isEmpty()){
|
||||
JSONObject js = new JSONObject(array.getJSONObject(i).optString("equipmentLevel"));
|
||||
item.setEquipmentLevel(js.optString("levelname")+"类");
|
||||
}else {
|
||||
item.setEquipmentLevel("未知");
|
||||
}
|
||||
item.setAreaid(array.getJSONObject(i).optString("areaid"));
|
||||
if (!array.getJSONObject(i).optString("company").equals("null")&&!array.getJSONObject(i).optString("company").isEmpty()){
|
||||
JSONObject js = new JSONObject(array.getJSONObject(i).optString("company"));
|
||||
item.setCompany(js.optString("name"));
|
||||
}else {
|
||||
item.setCompany("暂未配置");
|
||||
}
|
||||
if (!array.getJSONObject(i).optString("equipmentTypeNumber").equals("null")&&!array.getJSONObject(i).optString("equipmentTypeNumber").isEmpty()){
|
||||
JSONObject js = new JSONObject(array.getJSONObject(i).optString("equipmentTypeNumber"));
|
||||
item.setEquipmentTypeNumber(js.optString("name"));
|
||||
}else {
|
||||
item.setEquipmentTypeNumber("暂未配置");
|
||||
}
|
||||
if (!array.getJSONObject(i).optString("equipmentClass").equals("null")&&!array.getJSONObject(i).optString("equipmentClass").isEmpty()){
|
||||
JSONObject js = new JSONObject(array.getJSONObject(i).optString("equipmentClass"));
|
||||
item.setEquipmentClass(js.optString("name"));
|
||||
}else {
|
||||
item.setEquipmentClass("暂未配置");
|
||||
}
|
||||
if (!array.getJSONObject(i).optString("equipmentClass").equals("null")&&!array.getJSONObject(i).optString("equipmentClass").isEmpty()){
|
||||
JSONObject js = new JSONObject(array.getJSONObject(i).optString("equipmentClass"));
|
||||
item.setEquipmentClass(js.optString("name"));
|
||||
}else {
|
||||
item.setEquipmentClass("暂未配置");
|
||||
}
|
||||
if (!array.getJSONObject(i).optString("mPoint4APP").equals("null")&&!array.getJSONObject(i).optString("mPoint4APP").isEmpty()){
|
||||
JSONArray arrayPoint = array.getJSONObject(i).getJSONArray("mPoint4APP");
|
||||
List<Measuringpoint> points = new ArrayList<>();
|
||||
for (int a=0;a<arrayPoint.length();a++){
|
||||
Measuringpoint point = new Measuringpoint();
|
||||
point.setSid(arrayPoint.getJSONObject(a).opt("id").toString());
|
||||
point.setName(arrayPoint.getJSONObject(a).opt("parmname").toString());
|
||||
point.setUnit(arrayPoint.getJSONObject(a).opt("unit").toString());
|
||||
point.setCvalue(arrayPoint.getJSONObject(a).opt("parmvalue").toString());
|
||||
point.setType(arrayPoint.getJSONObject(a).opt("signalType").toString());
|
||||
point.setScadacode(arrayPoint.getJSONObject(a).opt("id").toString());
|
||||
point.setAlarmmax(arrayPoint.getJSONObject(a).opt("alarmmax").toString());
|
||||
point.setAlarmmin(arrayPoint.getJSONObject(a).opt("alarmmin").toString());
|
||||
points.add(point);
|
||||
}
|
||||
item.setMeasuringpoints(points);
|
||||
}
|
||||
list.add(item);
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return list;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,136 @@
|
||||
package com.sipai.jspatrol.Fault.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
|
||||
import com.mcxtzhang.swipemenulib.SwipeMenuLayout;
|
||||
import com.sipai.jspatrol.Bean.Fault;
|
||||
import com.sipai.jspatrol.Fault.DoingFaultDetailActivity;
|
||||
import com.sipai.jspatrol.Fault.FaultFlowChartActivity;
|
||||
import com.sipai.jspatrol.R;
|
||||
import com.superrecycleview.superlibrary.adapter.BaseViewHolder;
|
||||
import com.superrecycleview.superlibrary.adapter.SuperBaseAdapter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by lvliming on 2019/3/19.
|
||||
*/
|
||||
|
||||
public class DoingFaultAdapter extends SuperBaseAdapter<Fault> {
|
||||
private List<Fault> data;
|
||||
private Context context;
|
||||
private onSwipeListener mOnSwipeListener;
|
||||
|
||||
public DoingFaultAdapter(Context context, List<Fault> data) {
|
||||
super(context, data);
|
||||
this.data = data;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(final BaseViewHolder holder, Fault item, final int position) {
|
||||
item = data.get(position);
|
||||
((SwipeMenuLayout)holder.itemView).setIos(false).setLeftSwipe(true);
|
||||
final Fault finalItem = item;
|
||||
holder.setOnClickListener(R.id.moudle_item_doing_fault_ll_all, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (finalItem.getTodoTask()!=null) {
|
||||
if (finalItem.getTodoTask().contains("维修确认")) {
|
||||
// Toast.makeText(context, "工单验收完善中,敬请期待...", Toast.LENGTH_SHORT).show();
|
||||
FaultFlowChartActivity.actionStart(context, finalItem);
|
||||
} else {
|
||||
// if (finalItem.getTodoTask().contains("维修确认")||finalItem.getTodoTask().contains("班长")){
|
||||
//// Toast.makeText(context, "工单审核中...", Toast.LENGTH_SHORT).show();
|
||||
// FaultFlowChartActivity.actionStart(context, finalItem);
|
||||
// }else {
|
||||
DoingFaultDetailActivity.actionStart(context, finalItem);
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
if (item.getProcessSection().getName()!=null&&!item.getProcessSection().getName().equals("")){
|
||||
holder.setVisible(R.id.moudle_item_doing_fault_tv_area,true);
|
||||
holder.setText(R.id.moudle_item_doing_fault_tv_area,item.getProcessSection().getName());
|
||||
}else {
|
||||
holder.setVisible(R.id.moudle_item_doing_fault_tv_area,false);
|
||||
}
|
||||
if (item.getProblemcontent()!=null&&!item.getProblemcontent().isEmpty()) {
|
||||
holder.setText(R.id.moudle_item_doing_fault_tv_content, item.getProblemcontent());
|
||||
}else {
|
||||
holder.setText(R.id.moudle_item_doing_fault_tv_content, "");
|
||||
}
|
||||
if (item.getProblemTypeNames()!=null&&item.getProblemTypeNames().length()>0) {
|
||||
holder.setText(R.id.moudle_item_doing_fault_tv_remark,item.getProblemTypeNames());
|
||||
}else {
|
||||
holder.setVisible(R.id.moudle_item_doing_fault_tv_remark,false);
|
||||
}
|
||||
if (item.getEquipmentCard()!=null&&!item.getEquipmentCard().getEquipmentname().equals("")){
|
||||
holder.setVisible(R.id.moudle_item_doing_fault_tv_equ,true);
|
||||
holder.setText(R.id.moudle_item_doing_fault_tv_equ,item.getEquipmentCard().getEquipmentname());
|
||||
}else {
|
||||
holder.setVisible(R.id.moudle_item_doing_fault_tv_equ,false);
|
||||
}
|
||||
if (item.getInsdt()!=null&&item.getInsdt().length()>16) {
|
||||
holder.setText(R.id.moudle_item_doing_fault_tv_date,item.getInsdt().substring(5, 16));
|
||||
}else {
|
||||
holder.setText(R.id.moudle_item_doing_fault_tv_date,"");
|
||||
}
|
||||
if (item.getInsuser()!=null&&!item.getInsuser().isEmpty()) {
|
||||
holder.setText(R.id.moudle_item_doing_fault_tv_man, item.getInsuser());
|
||||
}else {
|
||||
holder.setText(R.id.moudle_item_doing_fault_tv_man, "");
|
||||
}
|
||||
if (item.getTodoTask()!=null) {
|
||||
if (item.getTodoTask().equals("待签收")) {
|
||||
holder.setText(R.id.moudle_item_doing_fault_tv_todotask, item.getTodoTask());
|
||||
holder.setTextColor(R.id.moudle_item_doing_fault_tv_todotask, context.getResources().getColor(R.color.error_red));
|
||||
// holder.setVisible(R.id.moudle_item_doing_fault_btn_make_fault, false);
|
||||
} else {
|
||||
holder.setText(R.id.moudle_item_doing_fault_tv_todotask, item.getTodoTask());
|
||||
}
|
||||
}
|
||||
// holder.setOnClickListener(R.id.moudle_item_doing_fault_btn_make_fault, new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View view) {
|
||||
// if (null!=mOnSwipeListener){
|
||||
// mOnSwipeListener.onFault(position);
|
||||
// ((SwipeMenuLayout) holder.itemView).smoothClose();
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// holder.setOnClickListener(R.id.moudle_item_doing_fault_btn_delete, new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View view) {
|
||||
// if (null!=mOnSwipeListener){
|
||||
// mOnSwipeListener.onDel(position);
|
||||
// ((SwipeMenuLayout) holder.itemView).smoothClose();
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getItemViewLayoutId(int position, Fault item) {
|
||||
return R.layout.item_doing_fault;
|
||||
}
|
||||
|
||||
/**
|
||||
* 和Activity通信的接口
|
||||
*/
|
||||
public interface onSwipeListener {
|
||||
void onFault(int pos);
|
||||
|
||||
void onDel(int pos);
|
||||
}
|
||||
|
||||
public onSwipeListener getOnDelListener() {
|
||||
return mOnSwipeListener;
|
||||
}
|
||||
|
||||
public void setOnDelListener(onSwipeListener mOnDelListener) {
|
||||
this.mOnSwipeListener = mOnDelListener;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
package com.sipai.jspatrol.Fault.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
|
||||
import com.sipai.jspatrol.Bean.Fault;
|
||||
import com.sipai.jspatrol.Fault.FaultFlowChartActivity;
|
||||
import com.sipai.jspatrol.R;
|
||||
import com.superrecycleview.superlibrary.adapter.BaseViewHolder;
|
||||
import com.superrecycleview.superlibrary.adapter.SuperBaseAdapter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by lvliming on 2019/3/19.
|
||||
*/
|
||||
|
||||
public class DoneFaultAdapter extends SuperBaseAdapter<Fault> {
|
||||
private List<Fault> data;
|
||||
private Context context;
|
||||
|
||||
public DoneFaultAdapter(Context context, List<Fault> data) {
|
||||
super(context, data);
|
||||
this.data = data;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder holder, Fault item, final int position) {
|
||||
item = data.get(position);
|
||||
final Fault finalItem = item;
|
||||
holder.setOnClickListener(R.id.moudle_item_done_fault_ll_all, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
// DoneFaultActivity.actionStart(context,finalItem);
|
||||
// Toast.makeText(context, "工单详情完善中,敬请期待...", Toast.LENGTH_SHORT).show();
|
||||
FaultFlowChartActivity.actionStart(context, finalItem);
|
||||
}
|
||||
});
|
||||
if (item.getProcessSection().getName()!=null&&!item.getProcessSection().getName().equals("")){
|
||||
holder.setVisible(R.id.moudle_item_done_fault_tv_area,true);
|
||||
holder.setVisible(R.id.moudle_item_done_fault_ll_area,true);
|
||||
holder.setText(R.id.moudle_item_done_fault_tv_area,item.getProcessSection().getName());
|
||||
}else {
|
||||
holder.setVisible(R.id.moudle_item_done_fault_ll_area,false);
|
||||
holder.setVisible(R.id.moudle_item_done_fault_tv_area,false);
|
||||
}
|
||||
holder.setText(R.id.moudle_item_done_fault_tv_content,item.getProblemcontent());
|
||||
if (item.getProblemTypeNames()!=null&&item.getProblemTypeNames().length()>0) {
|
||||
holder.setText(R.id.moudle_item_done_fault_tv_remark,item.getProblemTypeNames());
|
||||
}else {
|
||||
holder.setVisible(R.id.moudle_item_done_fault_tv_remark,false);
|
||||
}
|
||||
if (item.getEquipmentCard()!=null&&!item.getEquipmentCard().getEquipmentname().equals("")){
|
||||
holder.setVisible(R.id.moudle_item_done_fault_tv_equ,true);
|
||||
holder.setText(R.id.moudle_item_done_fault_tv_equ,item.getEquipmentCard().getEquipmentname());
|
||||
}else {
|
||||
holder.setVisible(R.id.moudle_item_done_fault_tv_equ,false);
|
||||
}
|
||||
if (item.getInsdt().length()>16) {
|
||||
holder.setText(R.id.moudle_item_done_fault_tv_date,item.getInsdt().substring(5, 16));
|
||||
}else {
|
||||
holder.setText(R.id.moudle_item_done_fault_tv_date,"");
|
||||
}
|
||||
holder.setText(R.id.moudle_item_done_fault_tv_man,item.getInsuser());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getItemViewLayoutId(int position, Fault item) {
|
||||
return R.layout.item_done_fault;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,39 @@
|
||||
package com.sipai.jspatrol.Fault.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.sipai.jspatrol.Bean.FaultFlow;
|
||||
import com.sipai.jspatrol.R;
|
||||
import com.superrecycleview.superlibrary.adapter.BaseViewHolder;
|
||||
import com.superrecycleview.superlibrary.adapter.SuperBaseAdapter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* created by lvliming on 2020/12/14
|
||||
*/
|
||||
public class FaultFlowAdapter extends SuperBaseAdapter<FaultFlow> {
|
||||
private Context context;
|
||||
private List<FaultFlow> list;
|
||||
|
||||
public FaultFlowAdapter(Context context, List<FaultFlow> data) {
|
||||
super(context, data);
|
||||
this.context = context;
|
||||
this.list = data;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(BaseViewHolder holder, FaultFlow item, int position) {
|
||||
item = list.get(position);
|
||||
holder.setText(R.id.moudle_item_fault_flow_tv_num,String.valueOf(position+1));
|
||||
holder.setText(R.id.moudle_item_fault_flow_tv_title,item.getTaskName());
|
||||
holder.setText(R.id.moudle_item_fault_flow_tv_content,item.getRecord());
|
||||
holder.setText(R.id.moudle_item_fault_flow_tv_time,item.getInsdt());
|
||||
// holder.setText(R.id.moudle_item_fault_flow_tv_num,String.valueOf(position+1));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getItemViewLayoutId(int position, FaultFlow item) {
|
||||
return R.layout.item_fault_flow;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,98 @@
|
||||
package com.sipai.jspatrol.Fault.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
|
||||
import com.mcxtzhang.swipemenulib.SwipeMenuLayout;
|
||||
import com.sipai.jspatrol.Bean.Fault;
|
||||
import com.sipai.jspatrol.Fault.NewFaultDetailActivity;
|
||||
import com.sipai.jspatrol.R;
|
||||
import com.superrecycleview.superlibrary.adapter.BaseViewHolder;
|
||||
import com.superrecycleview.superlibrary.adapter.SuperBaseAdapter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by lvliming on 2019/2/27.
|
||||
*/
|
||||
|
||||
public class NewFaultAdapter extends SuperBaseAdapter<Fault> {
|
||||
private List<Fault> data;
|
||||
private Context context;
|
||||
private onSwipeListener mOnSwipeListener;
|
||||
|
||||
public NewFaultAdapter(Context context, List<Fault> data) {
|
||||
super(context, data);
|
||||
this.data = data;
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void convert(final BaseViewHolder holder, Fault item, final int position) {
|
||||
item = data.get(position);
|
||||
((SwipeMenuLayout)holder.itemView).setIos(false).setLeftSwipe(true);
|
||||
final Fault finalItem = item;
|
||||
holder.setOnClickListener(R.id.moudle_item_new_fault_ll_all, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
NewFaultDetailActivity.actionStart(context,finalItem,"no");
|
||||
}
|
||||
});
|
||||
holder.setText(R.id.moudle_item_new_fault_tv_area,item.getProcessSection().getName());
|
||||
holder.setText(R.id.moudle_item_new_fault_tv_content,item.getAbnormityDescription());
|
||||
if (item.getRemark()!=null&&item.getRemark().length()>0) {
|
||||
holder.setText(R.id.moudle_item_new_fault_tv_remark,item.getRemark());
|
||||
}else {
|
||||
holder.setVisible(R.id.moudle_item_new_fault_tv_remark,false);
|
||||
}
|
||||
if (item.getEquipmentNames()!=null){
|
||||
holder.setText(R.id.moudle_item_new_fault_tv_equ,item.getEquipmentNames());
|
||||
}
|
||||
if (item.getInsdt().length()>16) {
|
||||
holder.setText(R.id.moudle_item_new_fault_tv_date,item.getInsdt().substring(5, 16));
|
||||
}else {
|
||||
holder.setText(R.id.moudle_item_new_fault_tv_date,"");
|
||||
}
|
||||
holder.setText(R.id.moudle_item_new_fault_tv_man,item.getInsuser());
|
||||
holder.setOnClickListener(R.id.moudle_item_new_fault_btn_make_fault, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (null!=mOnSwipeListener){
|
||||
mOnSwipeListener.onFault(position);
|
||||
((SwipeMenuLayout) holder.itemView).smoothClose();
|
||||
}
|
||||
}
|
||||
});
|
||||
holder.setOnClickListener(R.id.moudle_item_new_fault_btn_delete, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (null!=mOnSwipeListener){
|
||||
mOnSwipeListener.onDel(position);
|
||||
((SwipeMenuLayout) holder.itemView).smoothClose();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 和Activity通信的接口
|
||||
*/
|
||||
public interface onSwipeListener {
|
||||
void onFault(int pos);
|
||||
|
||||
void onDel(int pos);
|
||||
}
|
||||
|
||||
public onSwipeListener getOnDelListener() {
|
||||
return mOnSwipeListener;
|
||||
}
|
||||
|
||||
public void setOnDelListener(onSwipeListener mOnDelListener) {
|
||||
this.mOnSwipeListener = mOnDelListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getItemViewLayoutId(int position, Fault item) {
|
||||
return R.layout.item_new_fault;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,147 @@
|
||||
package com.sipai.jspatrol.Fault.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.widget.CheckBox;
|
||||
import android.widget.CompoundButton;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.sipai.jspatrol.Bean.User;
|
||||
import com.sipai.jspatrol.R;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Created by lvliming on 2019/3/24.
|
||||
*/
|
||||
|
||||
public class PersonSelectorAdapter extends RecyclerView.Adapter<PersonSelectorAdapter.ViewHolder> implements View.OnClickListener{
|
||||
//数据源
|
||||
private List<User> list;
|
||||
private Context context;
|
||||
//是否显示单选框
|
||||
private boolean isshowBox = true;
|
||||
//存储勾选框状态的map集合
|
||||
private Map<Integer,Boolean> map = new HashMap<>();
|
||||
//接口实例
|
||||
private RecyclerViewOnItemClickListener onItemClickListener;
|
||||
|
||||
public PersonSelectorAdapter(List<User> list, Context context) {
|
||||
this.list = list;
|
||||
this.context = context;
|
||||
initMap();
|
||||
}
|
||||
//初始化map集合,默认不选中
|
||||
private void initMap() {
|
||||
for (int i=0;i<list.size();i++){
|
||||
map.put(i,false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View root = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_selector_person, parent, false);
|
||||
ViewHolder vh = new ViewHolder(root);
|
||||
//为Item设置点击事件
|
||||
root.setOnClickListener(this);
|
||||
return vh;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(final ViewHolder holder, final int position) {
|
||||
User item = list.get(position);
|
||||
holder.tv_name.setText(item.getCaption());
|
||||
Animation animation = AnimationUtils.loadAnimation(context, R.anim.list_anim);
|
||||
//设置Tag
|
||||
holder.root.setTag(position);
|
||||
//设置checkBox改变监听
|
||||
holder.checkBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||
//用map集合保存
|
||||
map.put(position, isChecked);
|
||||
if (holder.checkBox.isChecked()){
|
||||
holder.ll_card.setBackgroundColor(context.getResources().getColor(R.color.little_blue));
|
||||
}else {
|
||||
holder.ll_card.setBackgroundColor(context.getResources().getColor(R.color.green));
|
||||
}
|
||||
}
|
||||
});
|
||||
// 设置CheckBox的状态
|
||||
if (map.get(position) == null) {
|
||||
map.put(position, false);
|
||||
}
|
||||
holder.checkBox.setChecked(map.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (onItemClickListener != null) {
|
||||
//注意这里使用getTag方法获取数据
|
||||
onItemClickListener.onItemClickListener(v, (Integer) v.getTag());
|
||||
}
|
||||
}
|
||||
|
||||
//视图管理
|
||||
public class ViewHolder extends RecyclerView.ViewHolder{
|
||||
private TextView tv_name;
|
||||
private CheckBox checkBox;
|
||||
private LinearLayout ll_card;
|
||||
private View root;
|
||||
public ViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
this.root = itemView;
|
||||
tv_name = root.findViewById(R.id.item_selector_person_tv_name);
|
||||
checkBox = (CheckBox) root.findViewById(R.id.item_selector_person_cb);
|
||||
ll_card = root.findViewById(R.id.item_selector_person_ll_card);
|
||||
}
|
||||
}
|
||||
|
||||
//设置点击事件
|
||||
public void setRecyclerViewOnItemClickListener(RecyclerViewOnItemClickListener onItemClickListener) {
|
||||
this.onItemClickListener = onItemClickListener;
|
||||
}
|
||||
|
||||
//设置是否显示CheckBox
|
||||
public void setShowBox() {
|
||||
//取反
|
||||
isshowBox = !isshowBox;
|
||||
}
|
||||
|
||||
//点击item选中CheckBox
|
||||
public void setSelectItem(int position) {
|
||||
//对当前状态取反
|
||||
if (map.get(position)) {
|
||||
map.put(position, false);
|
||||
} else {
|
||||
map.put(position, true);
|
||||
}
|
||||
notifyItemChanged(position);
|
||||
}
|
||||
//返回集合给MainActivity
|
||||
public Map<Integer, Boolean> getMap() {
|
||||
return map;
|
||||
}
|
||||
|
||||
//接口回调设置点击事件
|
||||
public interface RecyclerViewOnItemClickListener {
|
||||
//点击事件
|
||||
void onItemClickListener(View view, int position);
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,80 @@
|
||||
package com.sipai.jspatrol.Fault.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.sipai.jspatrol.Bean.Picture;
|
||||
import com.sipai.jspatrol.R;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Created by lvliming on 2019/3/25.
|
||||
*/
|
||||
|
||||
public class PicAdapter extends RecyclerView.Adapter<PicAdapter.ViewHolder> {
|
||||
private List<Picture> list;
|
||||
private Context context;
|
||||
private PicAdapterOnClickListener mlistener;
|
||||
|
||||
public PicAdapter(List<Picture> list, Context context, PicAdapterOnClickListener listener) {
|
||||
this.list = list;
|
||||
this.context = context;
|
||||
this.mlistener = listener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_show_pic,parent,false);
|
||||
final ViewHolder viewHolder = new ViewHolder(view);
|
||||
// viewHolder.pic.setOnClickListener(new View.OnClickListener() {
|
||||
// @Override
|
||||
// public void onClick(View view) {
|
||||
// int position = viewHolder.getAdapterPosition();
|
||||
// Intent intent = new Intent(context,PictureDetailActivity.class);
|
||||
// intent.putExtra("url",list.get(position).getAbspath());
|
||||
// context.startActivity(intent);
|
||||
// }
|
||||
// });
|
||||
return viewHolder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(ViewHolder holder, int position) {
|
||||
Picture item = list.get(position);
|
||||
Glide.with(context).load(item.getAbspath()).into(holder.iv);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return list.size();
|
||||
}
|
||||
|
||||
class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
|
||||
ImageView iv;
|
||||
View pic;
|
||||
public ViewHolder(View itemView) {
|
||||
super(itemView);
|
||||
pic = itemView;
|
||||
iv = itemView.findViewById(R.id.moudle_item_show_pic_iv);
|
||||
iv.setOnClickListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mlistener!=null){
|
||||
mlistener.onItemClick(v,getAdapterPosition());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public interface PicAdapterOnClickListener{
|
||||
void onItemClick(View v,int position);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user