commit 89164dbd44cc074448a08143e605084899366c11 Author: lijia Date: Wed Aug 24 09:27:23 2022 +0800 初始化 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..aa724b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +*.iml +.gradle +/local.properties +/.idea/caches +/.idea/libraries +/.idea/modules.xml +/.idea/workspace.xml +/.idea/navEditor.xml +/.idea/assetWizardSettings.xml +.DS_Store +/build +/captures +.externalNativeBuild +.cxx +local.properties diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..cecbfeb --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +app-dhhy-cargo \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..61a9130 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..a2d7c21 --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..16b0757 --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..5593996 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle new file mode 100644 index 0000000..3b9ad01 --- /dev/null +++ b/app/build.gradle @@ -0,0 +1,162 @@ +plugins { + id 'com.android.application' +} + +android { + compileSdkVersion 30 + buildToolsVersion "30.0.3" + + signingConfigs { + debug { + storeFile file('dhhy-cargo-keys') + storePassword 'dhhy123456p' + keyAlias 'key0' + keyPassword 'dhhy123456p' + } + config { + keyAlias 'key0' + keyPassword 'dhhy123456p' + storeFile file('dhhy-cargo-keys') + storePassword 'dhhy123456p' + } + release { + keyAlias 'key0' + keyPassword 'dhhy123456p' + storeFile file('dhhy-cargo-keys') + storePassword 'dhhy123456p' + } + } + + defaultConfig { + applicationId "com.oneclouds.cargo" + minSdkVersion 23 + targetSdkVersion 30 + versionCode 27 + versionName "3.0.7" + + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + + ndk { + //设置支持的SO库架构(开发者可以根据需要,选择一个或多个平台的so) + abiFilters "armeabi-v7a", "arm64-v8a" + } +// javaCompileOptions { +// +// annotationProcessorOptions { +// includeCompileClasspath = true +// arguments = [ moduleName : project.getName() ] +// } +// } + + } + + allprojects { + repositories { + maven { url "https://jitpack.io" } + } + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } + + android.applicationVariants.all { variant -> + variant.outputs.all { + def date = new Date().format("MMdd_HH-mm" , TimeZone.getTimeZone("GMT+08")) + if(variant.buildType.name.equals('release')){ + outputFileName = "dhhy-cargo-"+date+"-${versionName}.apk" + } + } + } + +} + +dependencies { + implementation 'androidx.appcompat:appcompat:1.2.0' + implementation 'com.google.android.material:material:1.2.1' + implementation 'androidx.constraintlayout:constraintlayout:2.0.1' + implementation 'org.jetbrains:annotations:15.0' + //implementation files('libs\\AMap2DMap_6.0.0_AMapSearch_7.9.0_20210331.jar') +// implementation files('libs\\AMap_Location_V5.3.1_20210331.jar') + //implementation files('libs\\Android_Lite3DMap_SDK_V1.2.0_20210412.jar') +// implementation files('libs\\AMap2DMap_6.0.0_AMapSearch_7.9.0_20210331.jar') + //implementation files('libs\\android-support-v4.jar') + testImplementation 'junit:junit:4.+' + androidTestImplementation 'androidx.test.ext:junit:1.1.2' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + //图片 + implementation 'com.github.bumptech.glide:glide:4.11.0' + implementation 'top.zibin:Luban:1.1.3' + //okhttp + implementation 'com.squareup.okhttp3:okhttp:3.2.0' + //gson + implementation 'com.google.code.gson:gson:2.8.5' + //角标文字 + implementation 'com.haozhang.libary:android-slanted-textview:1.2' + //加载 + implementation 'com.scwang.smart:refresh-layout-kernel:2.0.1' + implementation 'com.scwang.smart:refresh-header-material:2.0.1' + implementation 'com.scwang.smart:refresh-footer-ball:2.0.1' //球脉冲加载 + implementation 'com.scwang.smart:refresh-footer-classics:2.0.1' //经典加载 + implementation 'com.alibaba:fastjson:1.2.61' + //弹框 + // + implementation 'com.lxj:xpopup:2.2.8' + //更新版本 + implementation 'com.github.jenly1314.AppUpdater:app-updater:1.1.0' + implementation 'com.github.jenly1314.AppUpdater:app-dialog:1.1.0' + //轮播插件 + implementation 'com.github.zhpanvip:BannerViewPager:3.5.4' + //选择器 + //implementation 'com.github.gzu-liyujiang:AndroidPicker:Tag' + implementation 'com.github.gzu-liyujiang.AndroidPicker:WheelPicker:3.1.1' + implementation 'com.github.gzu-liyujiang.AndroidPicker:AddressPicker:3.1.1' + //EventBus + implementation 'org.greenrobot:eventbus:3.1.1' + implementation 'org.bouncycastle:bcprov-jdk15on:1.64' + //工具类 + implementation 'cn.hutool:hutool-all:5.7.11' + //UI库 + implementation 'com.github.tamsiree.RxTool:RxUI:2.6.2' + //相机库 + implementation 'com.github.tamsiree.RxTool:RxCamera:2.6.2' + //功能库(Zxing扫描与生成二维码条形码) + implementation 'com.github.tamsiree.RxTool:RxFeature:2.6.2' + //ArcGis For Android工具库(API:100.1以上版本) + implementation 'com.github.tamsiree.RxTool:RxArcGisKit:2.6.2' + //友盟 + // 下面各SDK根据宿主App是否使用相关业务按需引入。 + // 友盟统计SDK + implementation 'com.umeng.umsdk:common:9.4.2'// 必选 + implementation 'com.umeng.umsdk:asms:1.4.1'// 必选 + implementation 'com.umeng.umsdk:apm:1.4.2' // 错误分析升级为独立SDK,看crash数据请一定集成,可选 + implementation 'com.umeng.umsdk:abtest:1.0.0'//使用U-App中ABTest能力,可选 + //xui + implementation 'com.github.xuexiangjys:XUI:1.1.8' + + implementation "io.reactivex.rxjava3:rxjava:3.1.4" + implementation "io.reactivex.rxjava3:rxandroid:3.0.0" +// implementation "com.squareup.retrofit2:adapter-rxjava3:2.9.0" + + implementation 'com.github.LuckSiege.PictureSelector:picture_library:v2.2.9' + +// implementation 'io.github.lucksiege:pictureselector:v3.0.9' + + implementation 'com.github.getActivity:XToast:8.2' + implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.6' + + implementation 'com.github.tbruyelle:rxpermissions:0.12' + + + implementation 'com.amap.api:3dmap:8.0.0' + implementation 'com.amap.api:location:5.4.0' + implementation 'com.amap.api:search:7.9.0' +} \ No newline at end of file diff --git a/app/dhhy-cargo-keys b/app/dhhy-cargo-keys new file mode 100644 index 0000000..0338585 Binary files /dev/null and b/app/dhhy-cargo-keys differ diff --git a/app/libs/AMap2DMap_6.0.0_AMapSearch_7.9.0_20210331.jar b/app/libs/AMap2DMap_6.0.0_AMapSearch_7.9.0_20210331.jar new file mode 100644 index 0000000..af204bf Binary files /dev/null and b/app/libs/AMap2DMap_6.0.0_AMapSearch_7.9.0_20210331.jar differ diff --git a/app/libs/AMap_Location_V5.3.1_20210331.jar b/app/libs/AMap_Location_V5.3.1_20210331.jar new file mode 100644 index 0000000..129b9cc Binary files /dev/null and b/app/libs/AMap_Location_V5.3.1_20210331.jar differ diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/app/release/dhhy-cargo-0718_16-12-3.0.7.apk b/app/release/dhhy-cargo-0718_16-12-3.0.7.apk new file mode 100644 index 0000000..ac67230 Binary files /dev/null and b/app/release/dhhy-cargo-0718_16-12-3.0.7.apk differ diff --git a/app/release/output-metadata.json b/app/release/output-metadata.json new file mode 100644 index 0000000..f131b02 --- /dev/null +++ b/app/release/output-metadata.json @@ -0,0 +1,18 @@ +{ + "version": 2, + "artifactType": { + "type": "APK", + "kind": "Directory" + }, + "applicationId": "com.oneclouds.cargo", + "variantName": "release", + "elements": [ + { + "type": "SINGLE", + "filters": [], + "versionCode": 27, + "versionName": "3.0.7", + "outputFile": "dhhy-cargo-0718_16-12-3.0.7.apk" + } + ] +} \ No newline at end of file diff --git a/app/src/androidTest/java/com/oneclouds/cargo/ExampleInstrumentedTest.java b/app/src/androidTest/java/com/oneclouds/cargo/ExampleInstrumentedTest.java new file mode 100644 index 0000000..5a6394c --- /dev/null +++ b/app/src/androidTest/java/com/oneclouds/cargo/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package com.oneclouds.cargo; + +import android.content.Context; + +import androidx.test.platform.app.InstrumentationRegistry; +import androidx.test.ext.junit.runners.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 Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("com.oneclouds.cargo", appContext.getPackageName()); + } +} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..46b8022 --- /dev/null +++ b/app/src/main/AndroidManifest.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/assets/province.json b/app/src/main/assets/province.json new file mode 100644 index 0000000..ac83604 --- /dev/null +++ b/app/src/main/assets/province.json @@ -0,0 +1,13630 @@ +[ + { + "code": "110000", + "name": "北京市", + "city": [ + { + "code": "110000", + "name": "北京市", + "area": [ + { + "code": "110101", + "name": "东城区" + }, + { + "code": "110102", + "name": "西城区" + }, + { + "code": "110105", + "name": "朝阳区" + }, + { + "code": "110106", + "name": "丰台区" + }, + { + "code": "110107", + "name": "石景山区" + }, + { + "code": "110108", + "name": "海淀区" + }, + { + "code": "110109", + "name": "门头沟区" + }, + { + "code": "110111", + "name": "房山区" + }, + { + "code": "110112", + "name": "通州区" + }, + { + "code": "110113", + "name": "顺义区" + }, + { + "code": "110114", + "name": "昌平区" + }, + { + "code": "110115", + "name": "大兴区" + }, + { + "code": "110116", + "name": "怀柔区" + }, + { + "code": "110117", + "name": "平谷区" + }, + { + "code": "110118", + "name": "密云区" + }, + { + "code": "110119", + "name": "延庆区" + } + ] + } + ] + }, + { + "code": "120000", + "name": "天津市", + "city": [ + { + "code": "120000", + "name": "天津市", + "area": [ + { + "code": "120101", + "name": "和平区" + }, + { + "code": "120102", + "name": "河东区" + }, + { + "code": "120103", + "name": "河西区" + }, + { + "code": "120104", + "name": "南开区" + }, + { + "code": "120105", + "name": "河北区" + }, + { + "code": "120106", + "name": "红桥区" + }, + { + "code": "120110", + "name": "东丽区" + }, + { + "code": "120111", + "name": "西青区" + }, + { + "code": "120112", + "name": "津南区" + }, + { + "code": "120113", + "name": "北辰区" + }, + { + "code": "120114", + "name": "武清区" + }, + { + "code": "120115", + "name": "宝坻区" + }, + { + "code": "120116", + "name": "滨海新区" + }, + { + "code": "120117", + "name": "宁河区" + }, + { + "code": "120118", + "name": "静海区" + }, + { + "code": "120119", + "name": "蓟州区" + } + ] + } + ] + }, + { + "code": "130000", + "name": "河北省", + "city": [ + { + "code": "130100", + "name": "石家庄市", + "area": [ + { + "code": "130102", + "name": "长安区" + }, + { + "code": "130104", + "name": "桥西区" + }, + { + "code": "130105", + "name": "新华区" + }, + { + "code": "130107", + "name": "井陉矿区" + }, + { + "code": "130108", + "name": "裕华区" + }, + { + "code": "130109", + "name": "藁城区" + }, + { + "code": "130110", + "name": "鹿泉区" + }, + { + "code": "130111", + "name": "栾城区" + }, + { + "code": "130121", + "name": "井陉县" + }, + { + "code": "130123", + "name": "正定县" + }, + { + "code": "130125", + "name": "行唐县" + }, + { + "code": "130126", + "name": "灵寿县" + }, + { + "code": "130127", + "name": "高邑县" + }, + { + "code": "130128", + "name": "深泽县" + }, + { + "code": "130129", + "name": "赞皇县" + }, + { + "code": "130130", + "name": "无极县" + }, + { + "code": "130131", + "name": "平山县" + }, + { + "code": "130132", + "name": "元氏县" + }, + { + "code": "130133", + "name": "赵县" + }, + { + "code": "130181", + "name": "辛集市" + }, + { + "code": "130183", + "name": "晋州市" + }, + { + "code": "130184", + "name": "新乐市" + } + ] + }, + { + "code": "130200", + "name": "唐山市", + "area": [ + { + "code": "130202", + "name": "路南区" + }, + { + "code": "130203", + "name": "路北区" + }, + { + "code": "130204", + "name": "古冶区" + }, + { + "code": "130205", + "name": "开平区" + }, + { + "code": "130207", + "name": "丰南区" + }, + { + "code": "130208", + "name": "丰润区" + }, + { + "code": "130209", + "name": "曹妃甸区" + }, + { + "code": "130224", + "name": "滦南县" + }, + { + "code": "130225", + "name": "乐亭县" + }, + { + "code": "130227", + "name": "迁西县" + }, + { + "code": "130229", + "name": "玉田县" + }, + { + "code": "130281", + "name": "遵化市" + }, + { + "code": "130283", + "name": "迁安市" + }, + { + "code": "130284", + "name": "滦州市" + } + ] + }, + { + "code": "130300", + "name": "秦皇岛市", + "area": [ + { + "code": "130302", + "name": "海港区" + }, + { + "code": "130303", + "name": "山海关区" + }, + { + "code": "130304", + "name": "北戴河区" + }, + { + "code": "130306", + "name": "抚宁区" + }, + { + "code": "130321", + "name": "青龙满族自治县" + }, + { + "code": "130322", + "name": "昌黎县" + }, + { + "code": "130324", + "name": "卢龙县" + } + ] + }, + { + "code": "130400", + "name": "邯郸市", + "area": [ + { + "code": "130402", + "name": "邯山区" + }, + { + "code": "130403", + "name": "丛台区" + }, + { + "code": "130404", + "name": "复兴区" + }, + { + "code": "130406", + "name": "峰峰矿区" + }, + { + "code": "130407", + "name": "肥乡区" + }, + { + "code": "130408", + "name": "永年区" + }, + { + "code": "130423", + "name": "临漳县" + }, + { + "code": "130424", + "name": "成安县" + }, + { + "code": "130425", + "name": "大名县" + }, + { + "code": "130426", + "name": "涉县" + }, + { + "code": "130427", + "name": "磁县" + }, + { + "code": "130430", + "name": "邱县" + }, + { + "code": "130431", + "name": "鸡泽县" + }, + { + "code": "130432", + "name": "广平县" + }, + { + "code": "130433", + "name": "馆陶县" + }, + { + "code": "130434", + "name": "魏县" + }, + { + "code": "130435", + "name": "曲周县" + }, + { + "code": "130481", + "name": "武安市" + } + ] + }, + { + "code": "130500", + "name": "邢台市", + "area": [ + { + "code": "130502", + "name": "襄都区" + }, + { + "code": "130503", + "name": "信都区" + }, + { + "code": "130505", + "name": "任泽区" + }, + { + "code": "130506", + "name": "南和区" + }, + { + "code": "130522", + "name": "临城县" + }, + { + "code": "130523", + "name": "内丘县" + }, + { + "code": "130524", + "name": "柏乡县" + }, + { + "code": "130525", + "name": "隆尧县" + }, + { + "code": "130528", + "name": "宁晋县" + }, + { + "code": "130529", + "name": "巨鹿县" + }, + { + "code": "130530", + "name": "新河县" + }, + { + "code": "130531", + "name": "广宗县" + }, + { + "code": "130532", + "name": "平乡县" + }, + { + "code": "130533", + "name": "威县" + }, + { + "code": "130534", + "name": "清河县" + }, + { + "code": "130535", + "name": "临西县" + }, + { + "code": "130581", + "name": "南宫市" + }, + { + "code": "130582", + "name": "沙河市" + } + ] + }, + { + "code": "130600", + "name": "保定市", + "area": [ + { + "code": "130602", + "name": "竞秀区" + }, + { + "code": "130606", + "name": "莲池区" + }, + { + "code": "130607", + "name": "满城区" + }, + { + "code": "130608", + "name": "清苑区" + }, + { + "code": "130609", + "name": "徐水区" + }, + { + "code": "130623", + "name": "涞水县" + }, + { + "code": "130624", + "name": "阜平县" + }, + { + "code": "130626", + "name": "定兴县" + }, + { + "code": "130627", + "name": "唐县" + }, + { + "code": "130628", + "name": "高阳县" + }, + { + "code": "130629", + "name": "容城县" + }, + { + "code": "130630", + "name": "涞源县" + }, + { + "code": "130631", + "name": "望都县" + }, + { + "code": "130632", + "name": "安新县" + }, + { + "code": "130633", + "name": "易县" + }, + { + "code": "130634", + "name": "曲阳县" + }, + { + "code": "130635", + "name": "蠡县" + }, + { + "code": "130636", + "name": "顺平县" + }, + { + "code": "130637", + "name": "博野县" + }, + { + "code": "130638", + "name": "雄县" + }, + { + "code": "130681", + "name": "涿州市" + }, + { + "code": "130682", + "name": "定州市" + }, + { + "code": "130683", + "name": "安国市" + }, + { + "code": "130684", + "name": "高碑店市" + } + ] + }, + { + "code": "130700", + "name": "张家口市", + "area": [ + { + "code": "130702", + "name": "桥东区" + }, + { + "code": "130703", + "name": "桥西区" + }, + { + "code": "130705", + "name": "宣化区" + }, + { + "code": "130706", + "name": "下花园区" + }, + { + "code": "130708", + "name": "万全区" + }, + { + "code": "130709", + "name": "崇礼区" + }, + { + "code": "130722", + "name": "张北县" + }, + { + "code": "130723", + "name": "康保县" + }, + { + "code": "130724", + "name": "沽源县" + }, + { + "code": "130725", + "name": "尚义县" + }, + { + "code": "130726", + "name": "蔚县" + }, + { + "code": "130727", + "name": "阳原县" + }, + { + "code": "130728", + "name": "怀安县" + }, + { + "code": "130730", + "name": "怀来县" + }, + { + "code": "130731", + "name": "涿鹿县" + }, + { + "code": "130732", + "name": "赤城县" + } + ] + }, + { + "code": "130800", + "name": "承德市", + "area": [ + { + "code": "130802", + "name": "双桥区" + }, + { + "code": "130803", + "name": "双滦区" + }, + { + "code": "130804", + "name": "鹰手营子矿区" + }, + { + "code": "130821", + "name": "承德县" + }, + { + "code": "130822", + "name": "兴隆县" + }, + { + "code": "130824", + "name": "滦平县" + }, + { + "code": "130825", + "name": "隆化县" + }, + { + "code": "130826", + "name": "丰宁满族自治县" + }, + { + "code": "130827", + "name": "宽城满族自治县" + }, + { + "code": "130828", + "name": "围场满族蒙古族自治县" + }, + { + "code": "130881", + "name": "平泉市" + } + ] + }, + { + "code": "130900", + "name": "沧州市", + "area": [ + { + "code": "130902", + "name": "新华区" + }, + { + "code": "130903", + "name": "运河区" + }, + { + "code": "130921", + "name": "沧县" + }, + { + "code": "130922", + "name": "青县" + }, + { + "code": "130923", + "name": "东光县" + }, + { + "code": "130924", + "name": "海兴县" + }, + { + "code": "130925", + "name": "盐山县" + }, + { + "code": "130926", + "name": "肃宁县" + }, + { + "code": "130927", + "name": "南皮县" + }, + { + "code": "130928", + "name": "吴桥县" + }, + { + "code": "130929", + "name": "献县" + }, + { + "code": "130930", + "name": "孟村回族自治县" + }, + { + "code": "130981", + "name": "泊头市" + }, + { + "code": "130982", + "name": "任丘市" + }, + { + "code": "130983", + "name": "黄骅市" + }, + { + "code": "130984", + "name": "河间市" + } + ] + }, + { + "code": "131000", + "name": "廊坊市", + "area": [ + { + "code": "131002", + "name": "安次区" + }, + { + "code": "131003", + "name": "广阳区" + }, + { + "code": "131022", + "name": "固安县" + }, + { + "code": "131023", + "name": "永清县" + }, + { + "code": "131024", + "name": "香河县" + }, + { + "code": "131025", + "name": "大城县" + }, + { + "code": "131026", + "name": "文安县" + }, + { + "code": "131028", + "name": "大厂回族自治县" + }, + { + "code": "131081", + "name": "霸州市" + }, + { + "code": "131082", + "name": "三河市" + } + ] + }, + { + "code": "131100", + "name": "衡水市", + "area": [ + { + "code": "131102", + "name": "桃城区" + }, + { + "code": "131103", + "name": "冀州区" + }, + { + "code": "131121", + "name": "枣强县" + }, + { + "code": "131122", + "name": "武邑县" + }, + { + "code": "131123", + "name": "武强县" + }, + { + "code": "131124", + "name": "饶阳县" + }, + { + "code": "131125", + "name": "安平县" + }, + { + "code": "131126", + "name": "故城县" + }, + { + "code": "131127", + "name": "景县" + }, + { + "code": "131128", + "name": "阜城县" + }, + { + "code": "131182", + "name": "深州市" + } + ] + } + ] + }, + { + "code": "140000", + "name": "山西省", + "city": [ + { + "code": "140100", + "name": "太原市", + "area": [ + { + "code": "140105", + "name": "小店区" + }, + { + "code": "140106", + "name": "迎泽区" + }, + { + "code": "140107", + "name": "杏花岭区" + }, + { + "code": "140108", + "name": "尖草坪区" + }, + { + "code": "140109", + "name": "万柏林区" + }, + { + "code": "140110", + "name": "晋源区" + }, + { + "code": "140121", + "name": "清徐县" + }, + { + "code": "140122", + "name": "阳曲县" + }, + { + "code": "140123", + "name": "娄烦县" + }, + { + "code": "140181", + "name": "古交市" + } + ] + }, + { + "code": "140200", + "name": "大同市", + "area": [ + { + "code": "140212", + "name": "新荣区" + }, + { + "code": "140213", + "name": "平城区" + }, + { + "code": "140214", + "name": "云冈区" + }, + { + "code": "140215", + "name": "云州区" + }, + { + "code": "140221", + "name": "阳高县" + }, + { + "code": "140222", + "name": "天镇县" + }, + { + "code": "140223", + "name": "广灵县" + }, + { + "code": "140224", + "name": "灵丘县" + }, + { + "code": "140225", + "name": "浑源县" + }, + { + "code": "140226", + "name": "左云县" + } + ] + }, + { + "code": "140300", + "name": "阳泉市", + "area": [ + { + "code": "140302", + "name": "城区" + }, + { + "code": "140303", + "name": "矿区" + }, + { + "code": "140311", + "name": "郊区" + }, + { + "code": "140321", + "name": "平定县" + }, + { + "code": "140322", + "name": "盂县" + } + ] + }, + { + "code": "140400", + "name": "长治市", + "area": [ + { + "code": "140403", + "name": "潞州区" + }, + { + "code": "140404", + "name": "上党区" + }, + { + "code": "140405", + "name": "屯留区" + }, + { + "code": "140406", + "name": "潞城区" + }, + { + "code": "140423", + "name": "襄垣县" + }, + { + "code": "140425", + "name": "平顺县" + }, + { + "code": "140426", + "name": "黎城县" + }, + { + "code": "140427", + "name": "壶关县" + }, + { + "code": "140428", + "name": "长子县" + }, + { + "code": "140429", + "name": "武乡县" + }, + { + "code": "140430", + "name": "沁县" + }, + { + "code": "140431", + "name": "沁源县" + } + ] + }, + { + "code": "140500", + "name": "晋城市", + "area": [ + { + "code": "140502", + "name": "城区" + }, + { + "code": "140521", + "name": "沁水县" + }, + { + "code": "140522", + "name": "阳城县" + }, + { + "code": "140524", + "name": "陵川县" + }, + { + "code": "140525", + "name": "泽州县" + }, + { + "code": "140581", + "name": "高平市" + } + ] + }, + { + "code": "140600", + "name": "朔州市", + "area": [ + { + "code": "140602", + "name": "朔城区" + }, + { + "code": "140603", + "name": "平鲁区" + }, + { + "code": "140621", + "name": "山阴县" + }, + { + "code": "140622", + "name": "应县" + }, + { + "code": "140623", + "name": "右玉县" + }, + { + "code": "140681", + "name": "怀仁市" + } + ] + }, + { + "code": "140700", + "name": "晋中市", + "area": [ + { + "code": "140702", + "name": "榆次区" + }, + { + "code": "140703", + "name": "太谷区" + }, + { + "code": "140721", + "name": "榆社县" + }, + { + "code": "140722", + "name": "左权县" + }, + { + "code": "140723", + "name": "和顺县" + }, + { + "code": "140724", + "name": "昔阳县" + }, + { + "code": "140725", + "name": "寿阳县" + }, + { + "code": "140727", + "name": "祁县" + }, + { + "code": "140728", + "name": "平遥县" + }, + { + "code": "140729", + "name": "灵石县" + }, + { + "code": "140781", + "name": "介休市" + } + ] + }, + { + "code": "140800", + "name": "运城市", + "area": [ + { + "code": "140802", + "name": "盐湖区" + }, + { + "code": "140821", + "name": "临猗县" + }, + { + "code": "140822", + "name": "万荣县" + }, + { + "code": "140823", + "name": "闻喜县" + }, + { + "code": "140824", + "name": "稷山县" + }, + { + "code": "140825", + "name": "新绛县" + }, + { + "code": "140826", + "name": "绛县" + }, + { + "code": "140827", + "name": "垣曲县" + }, + { + "code": "140828", + "name": "夏县" + }, + { + "code": "140829", + "name": "平陆县" + }, + { + "code": "140830", + "name": "芮城县" + }, + { + "code": "140881", + "name": "永济市" + }, + { + "code": "140882", + "name": "河津市" + } + ] + }, + { + "code": "140900", + "name": "忻州市", + "area": [ + { + "code": "140902", + "name": "忻府区" + }, + { + "code": "140921", + "name": "定襄县" + }, + { + "code": "140922", + "name": "五台县" + }, + { + "code": "140923", + "name": "代县" + }, + { + "code": "140924", + "name": "繁峙县" + }, + { + "code": "140925", + "name": "宁武县" + }, + { + "code": "140926", + "name": "静乐县" + }, + { + "code": "140927", + "name": "神池县" + }, + { + "code": "140928", + "name": "五寨县" + }, + { + "code": "140929", + "name": "岢岚县" + }, + { + "code": "140930", + "name": "河曲县" + }, + { + "code": "140931", + "name": "保德县" + }, + { + "code": "140932", + "name": "偏关县" + }, + { + "code": "140981", + "name": "原平市" + } + ] + }, + { + "code": "141000", + "name": "临汾市", + "area": [ + { + "code": "141002", + "name": "尧都区" + }, + { + "code": "141021", + "name": "曲沃县" + }, + { + "code": "141022", + "name": "翼城县" + }, + { + "code": "141023", + "name": "襄汾县" + }, + { + "code": "141024", + "name": "洪洞县" + }, + { + "code": "141025", + "name": "古县" + }, + { + "code": "141026", + "name": "安泽县" + }, + { + "code": "141027", + "name": "浮山县" + }, + { + "code": "141028", + "name": "吉县" + }, + { + "code": "141029", + "name": "乡宁县" + }, + { + "code": "141030", + "name": "大宁县" + }, + { + "code": "141031", + "name": "隰县" + }, + { + "code": "141032", + "name": "永和县" + }, + { + "code": "141033", + "name": "蒲县" + }, + { + "code": "141034", + "name": "汾西县" + }, + { + "code": "141081", + "name": "侯马市" + }, + { + "code": "141082", + "name": "霍州市" + } + ] + }, + { + "code": "141100", + "name": "吕梁市", + "area": [ + { + "code": "141102", + "name": "离石区" + }, + { + "code": "141121", + "name": "文水县" + }, + { + "code": "141122", + "name": "交城县" + }, + { + "code": "141123", + "name": "兴县" + }, + { + "code": "141124", + "name": "临县" + }, + { + "code": "141125", + "name": "柳林县" + }, + { + "code": "141126", + "name": "石楼县" + }, + { + "code": "141127", + "name": "岚县" + }, + { + "code": "141128", + "name": "方山县" + }, + { + "code": "141129", + "name": "中阳县" + }, + { + "code": "141130", + "name": "交口县" + }, + { + "code": "141181", + "name": "孝义市" + }, + { + "code": "141182", + "name": "汾阳市" + } + ] + } + ] + }, + { + "code": "150000", + "name": "内蒙古自治区", + "city": [ + { + "code": "150100", + "name": "呼和浩特市", + "area": [ + { + "code": "150102", + "name": "新城区" + }, + { + "code": "150103", + "name": "回民区" + }, + { + "code": "150104", + "name": "玉泉区" + }, + { + "code": "150105", + "name": "赛罕区" + }, + { + "code": "150121", + "name": "土默特左旗" + }, + { + "code": "150122", + "name": "托克托县" + }, + { + "code": "150123", + "name": "和林格尔县" + }, + { + "code": "150124", + "name": "清水河县" + }, + { + "code": "150125", + "name": "武川县" + } + ] + }, + { + "code": "150200", + "name": "包头市", + "area": [ + { + "code": "150202", + "name": "东河区" + }, + { + "code": "150203", + "name": "昆都仑区" + }, + { + "code": "150204", + "name": "青山区" + }, + { + "code": "150205", + "name": "石拐区" + }, + { + "code": "150206", + "name": "白云鄂博矿区" + }, + { + "code": "150207", + "name": "九原区" + }, + { + "code": "150221", + "name": "土默特右旗" + }, + { + "code": "150222", + "name": "固阳县" + }, + { + "code": "150223", + "name": "达尔罕茂明安联合旗" + } + ] + }, + { + "code": "150300", + "name": "乌海市", + "area": [ + { + "code": "150302", + "name": "海勃湾区" + }, + { + "code": "150303", + "name": "海南区" + }, + { + "code": "150304", + "name": "乌达区" + } + ] + }, + { + "code": "150400", + "name": "赤峰市", + "area": [ + { + "code": "150402", + "name": "红山区" + }, + { + "code": "150403", + "name": "元宝山区" + }, + { + "code": "150404", + "name": "松山区" + }, + { + "code": "150421", + "name": "阿鲁科尔沁旗" + }, + { + "code": "150422", + "name": "巴林左旗" + }, + { + "code": "150423", + "name": "巴林右旗" + }, + { + "code": "150424", + "name": "林西县" + }, + { + "code": "150425", + "name": "克什克腾旗" + }, + { + "code": "150426", + "name": "翁牛特旗" + }, + { + "code": "150428", + "name": "喀喇沁旗" + }, + { + "code": "150429", + "name": "宁城县" + }, + { + "code": "150430", + "name": "敖汉旗" + } + ] + }, + { + "code": "150500", + "name": "通辽市", + "area": [ + { + "code": "150502", + "name": "科尔沁区" + }, + { + "code": "150521", + "name": "科尔沁左翼中旗" + }, + { + "code": "150522", + "name": "科尔沁左翼后旗" + }, + { + "code": "150523", + "name": "开鲁县" + }, + { + "code": "150524", + "name": "库伦旗" + }, + { + "code": "150525", + "name": "奈曼旗" + }, + { + "code": "150526", + "name": "扎鲁特旗" + }, + { + "code": "150581", + "name": "霍林郭勒市" + } + ] + }, + { + "code": "150600", + "name": "鄂尔多斯市", + "area": [ + { + "code": "150602", + "name": "东胜区" + }, + { + "code": "150603", + "name": "康巴什区" + }, + { + "code": "150621", + "name": "达拉特旗" + }, + { + "code": "150622", + "name": "准格尔旗" + }, + { + "code": "150623", + "name": "鄂托克前旗" + }, + { + "code": "150624", + "name": "鄂托克旗" + }, + { + "code": "150625", + "name": "杭锦旗" + }, + { + "code": "150626", + "name": "乌审旗" + }, + { + "code": "150627", + "name": "伊金霍洛旗" + } + ] + }, + { + "code": "150700", + "name": "呼伦贝尔市", + "area": [ + { + "code": "150702", + "name": "海拉尔区" + }, + { + "code": "150703", + "name": "扎赉诺尔区" + }, + { + "code": "150721", + "name": "阿荣旗" + }, + { + "code": "150722", + "name": "莫力达瓦达斡尔族自治旗" + }, + { + "code": "150723", + "name": "鄂伦春自治旗" + }, + { + "code": "150724", + "name": "鄂温克族自治旗" + }, + { + "code": "150725", + "name": "陈巴尔虎旗" + }, + { + "code": "150726", + "name": "新巴尔虎左旗" + }, + { + "code": "150727", + "name": "新巴尔虎右旗" + }, + { + "code": "150781", + "name": "满洲里市" + }, + { + "code": "150782", + "name": "牙克石市" + }, + { + "code": "150783", + "name": "扎兰屯市" + }, + { + "code": "150784", + "name": "额尔古纳市" + }, + { + "code": "150785", + "name": "根河市" + } + ] + }, + { + "code": "150800", + "name": "巴彦淖尔市", + "area": [ + { + "code": "150802", + "name": "临河区" + }, + { + "code": "150821", + "name": "五原县" + }, + { + "code": "150822", + "name": "磴口县" + }, + { + "code": "150823", + "name": "乌拉特前旗" + }, + { + "code": "150824", + "name": "乌拉特中旗" + }, + { + "code": "150825", + "name": "乌拉特后旗" + }, + { + "code": "150826", + "name": "杭锦后旗" + } + ] + }, + { + "code": "150900", + "name": "乌兰察布市", + "area": [ + { + "code": "150902", + "name": "集宁区" + }, + { + "code": "150921", + "name": "卓资县" + }, + { + "code": "150922", + "name": "化德县" + }, + { + "code": "150923", + "name": "商都县" + }, + { + "code": "150924", + "name": "兴和县" + }, + { + "code": "150925", + "name": "凉城县" + }, + { + "code": "150926", + "name": "察哈尔右翼前旗" + }, + { + "code": "150927", + "name": "察哈尔右翼中旗" + }, + { + "code": "150928", + "name": "察哈尔右翼后旗" + }, + { + "code": "150929", + "name": "四子王旗" + }, + { + "code": "150981", + "name": "丰镇市" + } + ] + }, + { + "code": "152200", + "name": "兴安盟", + "area": [ + { + "code": "152201", + "name": "乌兰浩特市" + }, + { + "code": "152202", + "name": "阿尔山市" + }, + { + "code": "152221", + "name": "科尔沁右翼前旗" + }, + { + "code": "152222", + "name": "科尔沁右翼中旗" + }, + { + "code": "152223", + "name": "扎赉特旗" + }, + { + "code": "152224", + "name": "突泉县" + } + ] + }, + { + "code": "152500", + "name": "锡林郭勒盟", + "area": [ + { + "code": "152501", + "name": "二连浩特市" + }, + { + "code": "152502", + "name": "锡林浩特市" + }, + { + "code": "152522", + "name": "阿巴嘎旗" + }, + { + "code": "152523", + "name": "苏尼特左旗" + }, + { + "code": "152524", + "name": "苏尼特右旗" + }, + { + "code": "152525", + "name": "东乌珠穆沁旗" + }, + { + "code": "152526", + "name": "西乌珠穆沁旗" + }, + { + "code": "152527", + "name": "太仆寺旗" + }, + { + "code": "152528", + "name": "镶黄旗" + }, + { + "code": "152529", + "name": "正镶白旗" + }, + { + "code": "152530", + "name": "正蓝旗" + }, + { + "code": "152531", + "name": "多伦县" + } + ] + }, + { + "code": "152900", + "name": "阿拉善盟", + "area": [ + { + "code": "152921", + "name": "阿拉善左旗" + }, + { + "code": "152922", + "name": "阿拉善右旗" + }, + { + "code": "152923", + "name": "额济纳旗" + } + ] + } + ] + }, + { + "code": "210000", + "name": "辽宁省", + "city": [ + { + "code": "210100", + "name": "沈阳市", + "area": [ + { + "code": "210102", + "name": "和平区" + }, + { + "code": "210103", + "name": "沈河区" + }, + { + "code": "210104", + "name": "大东区" + }, + { + "code": "210105", + "name": "皇姑区" + }, + { + "code": "210106", + "name": "铁西区" + }, + { + "code": "210111", + "name": "苏家屯区" + }, + { + "code": "210112", + "name": "浑南区" + }, + { + "code": "210113", + "name": "沈北新区" + }, + { + "code": "210114", + "name": "于洪区" + }, + { + "code": "210115", + "name": "辽中区" + }, + { + "code": "210123", + "name": "康平县" + }, + { + "code": "210124", + "name": "法库县" + }, + { + "code": "210181", + "name": "新民市" + } + ] + }, + { + "code": "210200", + "name": "大连市", + "area": [ + { + "code": "210202", + "name": "中山区" + }, + { + "code": "210203", + "name": "西岗区" + }, + { + "code": "210204", + "name": "沙河口区" + }, + { + "code": "210211", + "name": "甘井子区" + }, + { + "code": "210212", + "name": "旅顺口区" + }, + { + "code": "210213", + "name": "金州区" + }, + { + "code": "210214", + "name": "普兰店区" + }, + { + "code": "210224", + "name": "长海县" + }, + { + "code": "210281", + "name": "瓦房店市" + }, + { + "code": "210283", + "name": "庄河市" + } + ] + }, + { + "code": "210300", + "name": "鞍山市", + "area": [ + { + "code": "210302", + "name": "铁东区" + }, + { + "code": "210303", + "name": "铁西区" + }, + { + "code": "210304", + "name": "立山区" + }, + { + "code": "210311", + "name": "千山区" + }, + { + "code": "210321", + "name": "台安县" + }, + { + "code": "210323", + "name": "岫岩满族自治县" + }, + { + "code": "210381", + "name": "海城市" + } + ] + }, + { + "code": "210400", + "name": "抚顺市", + "area": [ + { + "code": "210402", + "name": "新抚区" + }, + { + "code": "210403", + "name": "东洲区" + }, + { + "code": "210404", + "name": "望花区" + }, + { + "code": "210411", + "name": "顺城区" + }, + { + "code": "210421", + "name": "抚顺县" + }, + { + "code": "210422", + "name": "新宾满族自治县" + }, + { + "code": "210423", + "name": "清原满族自治县" + } + ] + }, + { + "code": "210500", + "name": "本溪市", + "area": [ + { + "code": "210502", + "name": "平山区" + }, + { + "code": "210503", + "name": "溪湖区" + }, + { + "code": "210504", + "name": "明山区" + }, + { + "code": "210505", + "name": "南芬区" + }, + { + "code": "210521", + "name": "本溪满族自治县" + }, + { + "code": "210522", + "name": "桓仁满族自治县" + } + ] + }, + { + "code": "210600", + "name": "丹东市", + "area": [ + { + "code": "210602", + "name": "元宝区" + }, + { + "code": "210603", + "name": "振兴区" + }, + { + "code": "210604", + "name": "振安区" + }, + { + "code": "210624", + "name": "宽甸满族自治县" + }, + { + "code": "210681", + "name": "东港市" + }, + { + "code": "210682", + "name": "凤城市" + } + ] + }, + { + "code": "210700", + "name": "锦州市", + "area": [ + { + "code": "210702", + "name": "古塔区" + }, + { + "code": "210703", + "name": "凌河区" + }, + { + "code": "210711", + "name": "太和区" + }, + { + "code": "210726", + "name": "黑山县" + }, + { + "code": "210727", + "name": "义县" + }, + { + "code": "210781", + "name": "凌海市" + }, + { + "code": "210782", + "name": "北镇市" + } + ] + }, + { + "code": "210800", + "name": "营口市", + "area": [ + { + "code": "210802", + "name": "站前区" + }, + { + "code": "210803", + "name": "西市区" + }, + { + "code": "210804", + "name": "鲅鱼圈区" + }, + { + "code": "210811", + "name": "老边区" + }, + { + "code": "210881", + "name": "盖州市" + }, + { + "code": "210882", + "name": "大石桥市" + } + ] + }, + { + "code": "210900", + "name": "阜新市", + "area": [ + { + "code": "210902", + "name": "海州区" + }, + { + "code": "210903", + "name": "新邱区" + }, + { + "code": "210904", + "name": "太平区" + }, + { + "code": "210905", + "name": "清河门区" + }, + { + "code": "210911", + "name": "细河区" + }, + { + "code": "210921", + "name": "阜新蒙古族自治县" + }, + { + "code": "210922", + "name": "彰武县" + } + ] + }, + { + "code": "211000", + "name": "辽阳市", + "area": [ + { + "code": "211002", + "name": "白塔区" + }, + { + "code": "211003", + "name": "文圣区" + }, + { + "code": "211004", + "name": "宏伟区" + }, + { + "code": "211005", + "name": "弓长岭区" + }, + { + "code": "211011", + "name": "太子河区" + }, + { + "code": "211021", + "name": "辽阳县" + }, + { + "code": "211081", + "name": "灯塔市" + } + ] + }, + { + "code": "211100", + "name": "盘锦市", + "area": [ + { + "code": "211102", + "name": "双台子区" + }, + { + "code": "211103", + "name": "兴隆台区" + }, + { + "code": "211104", + "name": "大洼区" + }, + { + "code": "211122", + "name": "盘山县" + } + ] + }, + { + "code": "211200", + "name": "铁岭市", + "area": [ + { + "code": "211202", + "name": "银州区" + }, + { + "code": "211204", + "name": "清河区" + }, + { + "code": "211221", + "name": "铁岭县" + }, + { + "code": "211223", + "name": "西丰县" + }, + { + "code": "211224", + "name": "昌图县" + }, + { + "code": "211281", + "name": "调兵山市" + }, + { + "code": "211282", + "name": "开原市" + } + ] + }, + { + "code": "211300", + "name": "朝阳市", + "area": [ + { + "code": "211302", + "name": "双塔区" + }, + { + "code": "211303", + "name": "龙城区" + }, + { + "code": "211321", + "name": "朝阳县" + }, + { + "code": "211322", + "name": "建平县" + }, + { + "code": "211324", + "name": "喀喇沁左翼蒙古族自治县" + }, + { + "code": "211381", + "name": "北票市" + }, + { + "code": "211382", + "name": "凌源市" + } + ] + }, + { + "code": "211400", + "name": "葫芦岛市", + "area": [ + { + "code": "211402", + "name": "连山区" + }, + { + "code": "211403", + "name": "龙港区" + }, + { + "code": "211404", + "name": "南票区" + }, + { + "code": "211421", + "name": "绥中县" + }, + { + "code": "211422", + "name": "建昌县" + }, + { + "code": "211481", + "name": "兴城市" + } + ] + } + ] + }, + { + "code": "220000", + "name": "吉林省", + "city": [ + { + "code": "220100", + "name": "长春市", + "area": [ + { + "code": "220102", + "name": "南关区" + }, + { + "code": "220103", + "name": "宽城区" + }, + { + "code": "220104", + "name": "朝阳区" + }, + { + "code": "220105", + "name": "二道区" + }, + { + "code": "220106", + "name": "绿园区" + }, + { + "code": "220112", + "name": "双阳区" + }, + { + "code": "220113", + "name": "九台区" + }, + { + "code": "220122", + "name": "农安县" + }, + { + "code": "220182", + "name": "榆树市" + }, + { + "code": "220183", + "name": "德惠市" + }, + { + "code": "220184", + "name": "公主岭市" + } + ] + }, + { + "code": "220200", + "name": "吉林市", + "area": [ + { + "code": "220202", + "name": "昌邑区" + }, + { + "code": "220203", + "name": "龙潭区" + }, + { + "code": "220204", + "name": "船营区" + }, + { + "code": "220211", + "name": "丰满区" + }, + { + "code": "220221", + "name": "永吉县" + }, + { + "code": "220281", + "name": "蛟河市" + }, + { + "code": "220282", + "name": "桦甸市" + }, + { + "code": "220283", + "name": "舒兰市" + }, + { + "code": "220284", + "name": "磐石市" + } + ] + }, + { + "code": "220300", + "name": "四平市", + "area": [ + { + "code": "220302", + "name": "铁西区" + }, + { + "code": "220303", + "name": "铁东区" + }, + { + "code": "220322", + "name": "梨树县" + }, + { + "code": "220323", + "name": "伊通满族自治县" + }, + { + "code": "220382", + "name": "双辽市" + } + ] + }, + { + "code": "220400", + "name": "辽源市", + "area": [ + { + "code": "220402", + "name": "龙山区" + }, + { + "code": "220403", + "name": "西安区" + }, + { + "code": "220421", + "name": "东丰县" + }, + { + "code": "220422", + "name": "东辽县" + } + ] + }, + { + "code": "220500", + "name": "通化市", + "area": [ + { + "code": "220502", + "name": "东昌区" + }, + { + "code": "220503", + "name": "二道江区" + }, + { + "code": "220521", + "name": "通化县" + }, + { + "code": "220523", + "name": "辉南县" + }, + { + "code": "220524", + "name": "柳河县" + }, + { + "code": "220581", + "name": "梅河口市" + }, + { + "code": "220582", + "name": "集安市" + } + ] + }, + { + "code": "220600", + "name": "白山市", + "area": [ + { + "code": "220602", + "name": "浑江区" + }, + { + "code": "220605", + "name": "江源区" + }, + { + "code": "220621", + "name": "抚松县" + }, + { + "code": "220622", + "name": "靖宇县" + }, + { + "code": "220623", + "name": "长白朝鲜族自治县" + }, + { + "code": "220681", + "name": "临江市" + } + ] + }, + { + "code": "220700", + "name": "松原市", + "area": [ + { + "code": "220702", + "name": "宁江区" + }, + { + "code": "220721", + "name": "前郭尔罗斯蒙古族自治县" + }, + { + "code": "220722", + "name": "长岭县" + }, + { + "code": "220723", + "name": "乾安县" + }, + { + "code": "220781", + "name": "扶余市" + } + ] + }, + { + "code": "220800", + "name": "白城市", + "area": [ + { + "code": "220802", + "name": "洮北区" + }, + { + "code": "220821", + "name": "镇赉县" + }, + { + "code": "220822", + "name": "通榆县" + }, + { + "code": "220881", + "name": "洮南市" + }, + { + "code": "220882", + "name": "大安市" + } + ] + }, + { + "code": "222400", + "name": "延边朝鲜族自治州", + "area": [ + { + "code": "222401", + "name": "延吉市" + }, + { + "code": "222402", + "name": "图们市" + }, + { + "code": "222403", + "name": "敦化市" + }, + { + "code": "222404", + "name": "珲春市" + }, + { + "code": "222405", + "name": "龙井市" + }, + { + "code": "222406", + "name": "和龙市" + }, + { + "code": "222424", + "name": "汪清县" + }, + { + "code": "222426", + "name": "安图县" + } + ] + } + ] + }, + { + "code": "230000", + "name": "黑龙江省", + "city": [ + { + "code": "230100", + "name": "哈尔滨市", + "area": [ + { + "code": "230102", + "name": "道里区" + }, + { + "code": "230103", + "name": "南岗区" + }, + { + "code": "230104", + "name": "道外区" + }, + { + "code": "230108", + "name": "平房区" + }, + { + "code": "230109", + "name": "松北区" + }, + { + "code": "230110", + "name": "香坊区" + }, + { + "code": "230111", + "name": "呼兰区" + }, + { + "code": "230112", + "name": "阿城区" + }, + { + "code": "230113", + "name": "双城区" + }, + { + "code": "230123", + "name": "依兰县" + }, + { + "code": "230124", + "name": "方正县" + }, + { + "code": "230125", + "name": "宾县" + }, + { + "code": "230126", + "name": "巴彦县" + }, + { + "code": "230127", + "name": "木兰县" + }, + { + "code": "230128", + "name": "通河县" + }, + { + "code": "230129", + "name": "延寿县" + }, + { + "code": "230183", + "name": "尚志市" + }, + { + "code": "230184", + "name": "五常市" + } + ] + }, + { + "code": "230200", + "name": "齐齐哈尔市", + "area": [ + { + "code": "230202", + "name": "龙沙区" + }, + { + "code": "230203", + "name": "建华区" + }, + { + "code": "230204", + "name": "铁锋区" + }, + { + "code": "230205", + "name": "昂昂溪区" + }, + { + "code": "230206", + "name": "富拉尔基区" + }, + { + "code": "230207", + "name": "碾子山区" + }, + { + "code": "230208", + "name": "梅里斯达斡尔族区" + }, + { + "code": "230221", + "name": "龙江县" + }, + { + "code": "230223", + "name": "依安县" + }, + { + "code": "230224", + "name": "泰来县" + }, + { + "code": "230225", + "name": "甘南县" + }, + { + "code": "230227", + "name": "富裕县" + }, + { + "code": "230229", + "name": "克山县" + }, + { + "code": "230230", + "name": "克东县" + }, + { + "code": "230231", + "name": "拜泉县" + }, + { + "code": "230281", + "name": "讷河市" + } + ] + }, + { + "code": "230300", + "name": "鸡西市", + "area": [ + { + "code": "230302", + "name": "鸡冠区" + }, + { + "code": "230303", + "name": "恒山区" + }, + { + "code": "230304", + "name": "滴道区" + }, + { + "code": "230305", + "name": "梨树区" + }, + { + "code": "230306", + "name": "城子河区" + }, + { + "code": "230307", + "name": "麻山区" + }, + { + "code": "230321", + "name": "鸡东县" + }, + { + "code": "230381", + "name": "虎林市" + }, + { + "code": "230382", + "name": "密山市" + } + ] + }, + { + "code": "230400", + "name": "鹤岗市", + "area": [ + { + "code": "230402", + "name": "向阳区" + }, + { + "code": "230403", + "name": "工农区" + }, + { + "code": "230404", + "name": "南山区" + }, + { + "code": "230405", + "name": "兴安区" + }, + { + "code": "230406", + "name": "东山区" + }, + { + "code": "230407", + "name": "兴山区" + }, + { + "code": "230421", + "name": "萝北县" + }, + { + "code": "230422", + "name": "绥滨县" + } + ] + }, + { + "code": "230500", + "name": "双鸭山市", + "area": [ + { + "code": "230502", + "name": "尖山区" + }, + { + "code": "230503", + "name": "岭东区" + }, + { + "code": "230505", + "name": "四方台区" + }, + { + "code": "230506", + "name": "宝山区" + }, + { + "code": "230521", + "name": "集贤县" + }, + { + "code": "230522", + "name": "友谊县" + }, + { + "code": "230523", + "name": "宝清县" + }, + { + "code": "230524", + "name": "饶河县" + } + ] + }, + { + "code": "230600", + "name": "大庆市", + "area": [ + { + "code": "230602", + "name": "萨尔图区" + }, + { + "code": "230603", + "name": "龙凤区" + }, + { + "code": "230604", + "name": "让胡路区" + }, + { + "code": "230605", + "name": "红岗区" + }, + { + "code": "230606", + "name": "大同区" + }, + { + "code": "230621", + "name": "肇州县" + }, + { + "code": "230622", + "name": "肇源县" + }, + { + "code": "230623", + "name": "林甸县" + }, + { + "code": "230624", + "name": "杜尔伯特蒙古族自治县" + } + ] + }, + { + "code": "230700", + "name": "伊春市", + "area": [ + { + "code": "230717", + "name": "伊美区" + }, + { + "code": "230718", + "name": "乌翠区" + }, + { + "code": "230719", + "name": "友好区" + }, + { + "code": "230722", + "name": "嘉荫县" + }, + { + "code": "230723", + "name": "汤旺县" + }, + { + "code": "230724", + "name": "丰林县" + }, + { + "code": "230725", + "name": "大箐山县" + }, + { + "code": "230726", + "name": "南岔县" + }, + { + "code": "230751", + "name": "金林区" + }, + { + "code": "230781", + "name": "铁力市" + } + ] + }, + { + "code": "230800", + "name": "佳木斯市", + "area": [ + { + "code": "230803", + "name": "向阳区" + }, + { + "code": "230804", + "name": "前进区" + }, + { + "code": "230805", + "name": "东风区" + }, + { + "code": "230811", + "name": "郊区" + }, + { + "code": "230822", + "name": "桦南县" + }, + { + "code": "230826", + "name": "桦川县" + }, + { + "code": "230828", + "name": "汤原县" + }, + { + "code": "230881", + "name": "同江市" + }, + { + "code": "230882", + "name": "富锦市" + }, + { + "code": "230883", + "name": "抚远市" + } + ] + }, + { + "code": "230900", + "name": "七台河市", + "area": [ + { + "code": "230902", + "name": "新兴区" + }, + { + "code": "230903", + "name": "桃山区" + }, + { + "code": "230904", + "name": "茄子河区" + }, + { + "code": "230921", + "name": "勃利县" + } + ] + }, + { + "code": "231000", + "name": "牡丹江市", + "area": [ + { + "code": "231002", + "name": "东安区" + }, + { + "code": "231003", + "name": "阳明区" + }, + { + "code": "231004", + "name": "爱民区" + }, + { + "code": "231005", + "name": "西安区" + }, + { + "code": "231025", + "name": "林口县" + }, + { + "code": "231081", + "name": "绥芬河市" + }, + { + "code": "231083", + "name": "海林市" + }, + { + "code": "231084", + "name": "宁安市" + }, + { + "code": "231085", + "name": "穆棱市" + }, + { + "code": "231086", + "name": "东宁市" + } + ] + }, + { + "code": "231100", + "name": "黑河市", + "area": [ + { + "code": "231102", + "name": "爱辉区" + }, + { + "code": "231123", + "name": "逊克县" + }, + { + "code": "231124", + "name": "孙吴县" + }, + { + "code": "231181", + "name": "北安市" + }, + { + "code": "231182", + "name": "五大连池市" + }, + { + "code": "231183", + "name": "嫩江市" + } + ] + }, + { + "code": "231200", + "name": "绥化市", + "area": [ + { + "code": "231202", + "name": "北林区" + }, + { + "code": "231221", + "name": "望奎县" + }, + { + "code": "231222", + "name": "兰西县" + }, + { + "code": "231223", + "name": "青冈县" + }, + { + "code": "231224", + "name": "庆安县" + }, + { + "code": "231225", + "name": "明水县" + }, + { + "code": "231226", + "name": "绥棱县" + }, + { + "code": "231281", + "name": "安达市" + }, + { + "code": "231282", + "name": "肇东市" + }, + { + "code": "231283", + "name": "海伦市" + } + ] + }, + { + "code": "232700", + "name": "大兴安岭地区", + "area": [ + { + "code": "232701", + "name": "漠河市" + }, + { + "code": "232721", + "name": "呼玛县" + }, + { + "code": "232722", + "name": "塔河县" + } + ] + } + ] + }, + { + "code": "310000", + "name": "上海市", + "city": [ + { + "code": "310000", + "name": "上海市", + "area": [ + { + "code": "310101", + "name": "黄浦区" + }, + { + "code": "310104", + "name": "徐汇区" + }, + { + "code": "310105", + "name": "长宁区" + }, + { + "code": "310106", + "name": "静安区" + }, + { + "code": "310107", + "name": "普陀区" + }, + { + "code": "310109", + "name": "虹口区" + }, + { + "code": "310110", + "name": "杨浦区" + }, + { + "code": "310112", + "name": "闵行区" + }, + { + "code": "310113", + "name": "宝山区" + }, + { + "code": "310114", + "name": "嘉定区" + }, + { + "code": "310115", + "name": "浦东新区" + }, + { + "code": "310116", + "name": "金山区" + }, + { + "code": "310117", + "name": "松江区" + }, + { + "code": "310118", + "name": "青浦区" + }, + { + "code": "310120", + "name": "奉贤区" + }, + { + "code": "310151", + "name": "崇明区" + } + ] + } + ] + }, + { + "code": "320000", + "name": "江苏省", + "city": [ + { + "code": "320100", + "name": "南京市", + "area": [ + { + "code": "320102", + "name": "玄武区" + }, + { + "code": "320104", + "name": "秦淮区" + }, + { + "code": "320105", + "name": "建邺区" + }, + { + "code": "320106", + "name": "鼓楼区" + }, + { + "code": "320111", + "name": "浦口区" + }, + { + "code": "320113", + "name": "栖霞区" + }, + { + "code": "320114", + "name": "雨花台区" + }, + { + "code": "320115", + "name": "江宁区" + }, + { + "code": "320116", + "name": "六合区" + }, + { + "code": "320117", + "name": "溧水区" + }, + { + "code": "320118", + "name": "高淳区" + } + ] + }, + { + "code": "320200", + "name": "无锡市", + "area": [ + { + "code": "320205", + "name": "锡山区" + }, + { + "code": "320206", + "name": "惠山区" + }, + { + "code": "320211", + "name": "滨湖区" + }, + { + "code": "320213", + "name": "梁溪区" + }, + { + "code": "320214", + "name": "新吴区" + }, + { + "code": "320281", + "name": "江阴市" + }, + { + "code": "320282", + "name": "宜兴市" + } + ] + }, + { + "code": "320300", + "name": "徐州市", + "area": [ + { + "code": "320302", + "name": "鼓楼区" + }, + { + "code": "320303", + "name": "云龙区" + }, + { + "code": "320305", + "name": "贾汪区" + }, + { + "code": "320311", + "name": "泉山区" + }, + { + "code": "320312", + "name": "铜山区" + }, + { + "code": "320321", + "name": "丰县" + }, + { + "code": "320322", + "name": "沛县" + }, + { + "code": "320324", + "name": "睢宁县" + }, + { + "code": "320381", + "name": "新沂市" + }, + { + "code": "320382", + "name": "邳州市" + } + ] + }, + { + "code": "320400", + "name": "常州市", + "area": [ + { + "code": "320402", + "name": "天宁区" + }, + { + "code": "320404", + "name": "钟楼区" + }, + { + "code": "320411", + "name": "新北区" + }, + { + "code": "320412", + "name": "武进区" + }, + { + "code": "320413", + "name": "金坛区" + }, + { + "code": "320481", + "name": "溧阳市" + } + ] + }, + { + "code": "320500", + "name": "苏州市", + "area": [ + { + "code": "320505", + "name": "虎丘区" + }, + { + "code": "320506", + "name": "吴中区" + }, + { + "code": "320507", + "name": "相城区" + }, + { + "code": "320508", + "name": "姑苏区" + }, + { + "code": "320509", + "name": "吴江区" + }, + { + "code": "320581", + "name": "常熟市" + }, + { + "code": "320582", + "name": "张家港市" + }, + { + "code": "320583", + "name": "昆山市" + }, + { + "code": "320585", + "name": "太仓市" + } + ] + }, + { + "code": "320600", + "name": "南通市", + "area": [ + { + "code": "320602", + "name": "崇川区" + }, + { + "code": "320611", + "name": "港闸区" + }, + { + "code": "320612", + "name": "通州区" + }, + { + "code": "320623", + "name": "如东县" + }, + { + "code": "320681", + "name": "启东市" + }, + { + "code": "320682", + "name": "如皋市" + }, + { + "code": "320684", + "name": "海门市" + }, + { + "code": "320685", + "name": "海安市" + } + ] + }, + { + "code": "320700", + "name": "连云港市", + "area": [ + { + "code": "320703", + "name": "连云区" + }, + { + "code": "320706", + "name": "海州区" + }, + { + "code": "320707", + "name": "赣榆区" + }, + { + "code": "320722", + "name": "东海县" + }, + { + "code": "320723", + "name": "灌云县" + }, + { + "code": "320724", + "name": "灌南县" + } + ] + }, + { + "code": "320800", + "name": "淮安市", + "area": [ + { + "code": "320803", + "name": "淮安区" + }, + { + "code": "320804", + "name": "淮阴区" + }, + { + "code": "320812", + "name": "清江浦区" + }, + { + "code": "320813", + "name": "洪泽区" + }, + { + "code": "320826", + "name": "涟水县" + }, + { + "code": "320830", + "name": "盱眙县" + }, + { + "code": "320831", + "name": "金湖县" + } + ] + }, + { + "code": "320900", + "name": "盐城市", + "area": [ + { + "code": "320902", + "name": "亭湖区" + }, + { + "code": "320903", + "name": "盐都区" + }, + { + "code": "320904", + "name": "大丰区" + }, + { + "code": "320921", + "name": "响水县" + }, + { + "code": "320922", + "name": "滨海县" + }, + { + "code": "320923", + "name": "阜宁县" + }, + { + "code": "320924", + "name": "射阳县" + }, + { + "code": "320925", + "name": "建湖县" + }, + { + "code": "320981", + "name": "东台市" + } + ] + }, + { + "code": "321000", + "name": "扬州市", + "area": [ + { + "code": "321002", + "name": "广陵区" + }, + { + "code": "321003", + "name": "邗江区" + }, + { + "code": "321012", + "name": "江都区" + }, + { + "code": "321023", + "name": "宝应县" + }, + { + "code": "321081", + "name": "仪征市" + }, + { + "code": "321084", + "name": "高邮市" + } + ] + }, + { + "code": "321100", + "name": "镇江市", + "area": [ + { + "code": "321102", + "name": "京口区" + }, + { + "code": "321111", + "name": "润州区" + }, + { + "code": "321112", + "name": "丹徒区" + }, + { + "code": "321181", + "name": "丹阳市" + }, + { + "code": "321182", + "name": "扬中市" + }, + { + "code": "321183", + "name": "句容市" + } + ] + }, + { + "code": "321200", + "name": "泰州市", + "area": [ + { + "code": "321202", + "name": "海陵区" + }, + { + "code": "321203", + "name": "高港区" + }, + { + "code": "321204", + "name": "姜堰区" + }, + { + "code": "321281", + "name": "兴化市" + }, + { + "code": "321282", + "name": "靖江市" + }, + { + "code": "321283", + "name": "泰兴市" + } + ] + }, + { + "code": "321300", + "name": "宿迁市", + "area": [ + { + "code": "321302", + "name": "宿城区" + }, + { + "code": "321311", + "name": "宿豫区" + }, + { + "code": "321322", + "name": "沭阳县" + }, + { + "code": "321323", + "name": "泗阳县" + }, + { + "code": "321324", + "name": "泗洪县" + } + ] + } + ] + }, + { + "code": "330000", + "name": "浙江省", + "city": [ + { + "code": "330100", + "name": "杭州市", + "area": [ + { + "code": "330102", + "name": "上城区" + }, + { + "code": "330103", + "name": "下城区" + }, + { + "code": "330104", + "name": "江干区" + }, + { + "code": "330105", + "name": "拱墅区" + }, + { + "code": "330106", + "name": "西湖区" + }, + { + "code": "330108", + "name": "滨江区" + }, + { + "code": "330109", + "name": "萧山区" + }, + { + "code": "330110", + "name": "余杭区" + }, + { + "code": "330111", + "name": "富阳区" + }, + { + "code": "330112", + "name": "临安区" + }, + { + "code": "330122", + "name": "桐庐县" + }, + { + "code": "330127", + "name": "淳安县" + }, + { + "code": "330182", + "name": "建德市" + } + ] + }, + { + "code": "330200", + "name": "宁波市", + "area": [ + { + "code": "330203", + "name": "海曙区" + }, + { + "code": "330205", + "name": "江北区" + }, + { + "code": "330206", + "name": "北仑区" + }, + { + "code": "330211", + "name": "镇海区" + }, + { + "code": "330212", + "name": "鄞州区" + }, + { + "code": "330213", + "name": "奉化区" + }, + { + "code": "330225", + "name": "象山县" + }, + { + "code": "330226", + "name": "宁海县" + }, + { + "code": "330281", + "name": "余姚市" + }, + { + "code": "330282", + "name": "慈溪市" + } + ] + }, + { + "code": "330300", + "name": "温州市", + "area": [ + { + "code": "330302", + "name": "鹿城区" + }, + { + "code": "330303", + "name": "龙湾区" + }, + { + "code": "330304", + "name": "瓯海区" + }, + { + "code": "330305", + "name": "洞头区" + }, + { + "code": "330324", + "name": "永嘉县" + }, + { + "code": "330326", + "name": "平阳县" + }, + { + "code": "330327", + "name": "苍南县" + }, + { + "code": "330328", + "name": "文成县" + }, + { + "code": "330329", + "name": "泰顺县" + }, + { + "code": "330381", + "name": "瑞安市" + }, + { + "code": "330382", + "name": "乐清市" + }, + { + "code": "330383", + "name": "龙港市" + } + ] + }, + { + "code": "330400", + "name": "嘉兴市", + "area": [ + { + "code": "330402", + "name": "南湖区" + }, + { + "code": "330411", + "name": "秀洲区" + }, + { + "code": "330421", + "name": "嘉善县" + }, + { + "code": "330424", + "name": "海盐县" + }, + { + "code": "330481", + "name": "海宁市" + }, + { + "code": "330482", + "name": "平湖市" + }, + { + "code": "330483", + "name": "桐乡市" + } + ] + }, + { + "code": "330500", + "name": "湖州市", + "area": [ + { + "code": "330502", + "name": "吴兴区" + }, + { + "code": "330503", + "name": "南浔区" + }, + { + "code": "330521", + "name": "德清县" + }, + { + "code": "330522", + "name": "长兴县" + }, + { + "code": "330523", + "name": "安吉县" + } + ] + }, + { + "code": "330600", + "name": "绍兴市", + "area": [ + { + "code": "330602", + "name": "越城区" + }, + { + "code": "330603", + "name": "柯桥区" + }, + { + "code": "330604", + "name": "上虞区" + }, + { + "code": "330624", + "name": "新昌县" + }, + { + "code": "330681", + "name": "诸暨市" + }, + { + "code": "330683", + "name": "嵊州市" + } + ] + }, + { + "code": "330700", + "name": "金华市", + "area": [ + { + "code": "330702", + "name": "婺城区" + }, + { + "code": "330703", + "name": "金东区" + }, + { + "code": "330723", + "name": "武义县" + }, + { + "code": "330726", + "name": "浦江县" + }, + { + "code": "330727", + "name": "磐安县" + }, + { + "code": "330781", + "name": "兰溪市" + }, + { + "code": "330782", + "name": "义乌市" + }, + { + "code": "330783", + "name": "东阳市" + }, + { + "code": "330784", + "name": "永康市" + } + ] + }, + { + "code": "330800", + "name": "衢州市", + "area": [ + { + "code": "330802", + "name": "柯城区" + }, + { + "code": "330803", + "name": "衢江区" + }, + { + "code": "330822", + "name": "常山县" + }, + { + "code": "330824", + "name": "开化县" + }, + { + "code": "330825", + "name": "龙游县" + }, + { + "code": "330881", + "name": "江山市" + } + ] + }, + { + "code": "330900", + "name": "舟山市", + "area": [ + { + "code": "330902", + "name": "定海区" + }, + { + "code": "330903", + "name": "普陀区" + }, + { + "code": "330921", + "name": "岱山县" + }, + { + "code": "330922", + "name": "嵊泗县" + } + ] + }, + { + "code": "331000", + "name": "台州市", + "area": [ + { + "code": "331002", + "name": "椒江区" + }, + { + "code": "331003", + "name": "黄岩区" + }, + { + "code": "331004", + "name": "路桥区" + }, + { + "code": "331022", + "name": "三门县" + }, + { + "code": "331023", + "name": "天台县" + }, + { + "code": "331024", + "name": "仙居县" + }, + { + "code": "331081", + "name": "温岭市" + }, + { + "code": "331082", + "name": "临海市" + }, + { + "code": "331083", + "name": "玉环市" + } + ] + }, + { + "code": "331100", + "name": "丽水市", + "area": [ + { + "code": "331102", + "name": "莲都区" + }, + { + "code": "331121", + "name": "青田县" + }, + { + "code": "331122", + "name": "缙云县" + }, + { + "code": "331123", + "name": "遂昌县" + }, + { + "code": "331124", + "name": "松阳县" + }, + { + "code": "331125", + "name": "云和县" + }, + { + "code": "331126", + "name": "庆元县" + }, + { + "code": "331127", + "name": "景宁畲族自治县" + }, + { + "code": "331181", + "name": "龙泉市" + } + ] + } + ] + }, + { + "code": "340000", + "name": "安徽省", + "city": [ + { + "code": "340100", + "name": "合肥市", + "area": [ + { + "code": "340102", + "name": "瑶海区" + }, + { + "code": "340103", + "name": "庐阳区" + }, + { + "code": "340104", + "name": "蜀山区" + }, + { + "code": "340111", + "name": "包河区" + }, + { + "code": "340121", + "name": "长丰县" + }, + { + "code": "340122", + "name": "肥东县" + }, + { + "code": "340123", + "name": "肥西县" + }, + { + "code": "340124", + "name": "庐江县" + }, + { + "code": "340181", + "name": "巢湖市" + } + ] + }, + { + "code": "340200", + "name": "芜湖市", + "area": [ + { + "code": "340202", + "name": "镜湖区" + }, + { + "code": "340203", + "name": "弋江区" + }, + { + "code": "340207", + "name": "鸠江区" + }, + { + "code": "340208", + "name": "三山区" + }, + { + "code": "340221", + "name": "芜湖县" + }, + { + "code": "340222", + "name": "繁昌县" + }, + { + "code": "340223", + "name": "南陵县" + }, + { + "code": "340281", + "name": "无为市" + } + ] + }, + { + "code": "340300", + "name": "蚌埠市", + "area": [ + { + "code": "340302", + "name": "龙子湖区" + }, + { + "code": "340303", + "name": "蚌山区" + }, + { + "code": "340304", + "name": "禹会区" + }, + { + "code": "340311", + "name": "淮上区" + }, + { + "code": "340321", + "name": "怀远县" + }, + { + "code": "340322", + "name": "五河县" + }, + { + "code": "340323", + "name": "固镇县" + } + ] + }, + { + "code": "340400", + "name": "淮南市", + "area": [ + { + "code": "340402", + "name": "大通区" + }, + { + "code": "340403", + "name": "田家庵区" + }, + { + "code": "340404", + "name": "谢家集区" + }, + { + "code": "340405", + "name": "八公山区" + }, + { + "code": "340406", + "name": "潘集区" + }, + { + "code": "340421", + "name": "凤台县" + }, + { + "code": "340422", + "name": "寿县" + } + ] + }, + { + "code": "340500", + "name": "马鞍山市", + "area": [ + { + "code": "340503", + "name": "花山区" + }, + { + "code": "340504", + "name": "雨山区" + }, + { + "code": "340506", + "name": "博望区" + }, + { + "code": "340521", + "name": "当涂县" + }, + { + "code": "340522", + "name": "含山县" + }, + { + "code": "340523", + "name": "和县" + } + ] + }, + { + "code": "340600", + "name": "淮北市", + "area": [ + { + "code": "340602", + "name": "杜集区" + }, + { + "code": "340603", + "name": "相山区" + }, + { + "code": "340604", + "name": "烈山区" + }, + { + "code": "340621", + "name": "濉溪县" + } + ] + }, + { + "code": "340700", + "name": "铜陵市", + "area": [ + { + "code": "340705", + "name": "铜官区" + }, + { + "code": "340706", + "name": "义安区" + }, + { + "code": "340711", + "name": "郊区" + }, + { + "code": "340722", + "name": "枞阳县" + } + ] + }, + { + "code": "340800", + "name": "安庆市", + "area": [ + { + "code": "340802", + "name": "迎江区" + }, + { + "code": "340803", + "name": "大观区" + }, + { + "code": "340811", + "name": "宜秀区" + }, + { + "code": "340822", + "name": "怀宁县" + }, + { + "code": "340825", + "name": "太湖县" + }, + { + "code": "340826", + "name": "宿松县" + }, + { + "code": "340827", + "name": "望江县" + }, + { + "code": "340828", + "name": "岳西县" + }, + { + "code": "340881", + "name": "桐城市" + }, + { + "code": "340882", + "name": "潜山市" + } + ] + }, + { + "code": "341000", + "name": "黄山市", + "area": [ + { + "code": "341002", + "name": "屯溪区" + }, + { + "code": "341003", + "name": "黄山区" + }, + { + "code": "341004", + "name": "徽州区" + }, + { + "code": "341021", + "name": "歙县" + }, + { + "code": "341022", + "name": "休宁县" + }, + { + "code": "341023", + "name": "黟县" + }, + { + "code": "341024", + "name": "祁门县" + } + ] + }, + { + "code": "341100", + "name": "滁州市", + "area": [ + { + "code": "341102", + "name": "琅琊区" + }, + { + "code": "341103", + "name": "南谯区" + }, + { + "code": "341122", + "name": "来安县" + }, + { + "code": "341124", + "name": "全椒县" + }, + { + "code": "341125", + "name": "定远县" + }, + { + "code": "341126", + "name": "凤阳县" + }, + { + "code": "341181", + "name": "天长市" + }, + { + "code": "341182", + "name": "明光市" + } + ] + }, + { + "code": "341200", + "name": "阜阳市", + "area": [ + { + "code": "341202", + "name": "颍州区" + }, + { + "code": "341203", + "name": "颍东区" + }, + { + "code": "341204", + "name": "颍泉区" + }, + { + "code": "341221", + "name": "临泉县" + }, + { + "code": "341222", + "name": "太和县" + }, + { + "code": "341225", + "name": "阜南县" + }, + { + "code": "341226", + "name": "颍上县" + }, + { + "code": "341282", + "name": "界首市" + } + ] + }, + { + "code": "341300", + "name": "宿州市", + "area": [ + { + "code": "341302", + "name": "埇桥区" + }, + { + "code": "341321", + "name": "砀山县" + }, + { + "code": "341322", + "name": "萧县" + }, + { + "code": "341323", + "name": "灵璧县" + }, + { + "code": "341324", + "name": "泗县" + } + ] + }, + { + "code": "341500", + "name": "六安市", + "area": [ + { + "code": "341502", + "name": "金安区" + }, + { + "code": "341503", + "name": "裕安区" + }, + { + "code": "341504", + "name": "叶集区" + }, + { + "code": "341522", + "name": "霍邱县" + }, + { + "code": "341523", + "name": "舒城县" + }, + { + "code": "341524", + "name": "金寨县" + }, + { + "code": "341525", + "name": "霍山县" + } + ] + }, + { + "code": "341600", + "name": "亳州市", + "area": [ + { + "code": "341602", + "name": "谯城区" + }, + { + "code": "341621", + "name": "涡阳县" + }, + { + "code": "341622", + "name": "蒙城县" + }, + { + "code": "341623", + "name": "利辛县" + } + ] + }, + { + "code": "341700", + "name": "池州市", + "area": [ + { + "code": "341702", + "name": "贵池区" + }, + { + "code": "341721", + "name": "东至县" + }, + { + "code": "341722", + "name": "石台县" + }, + { + "code": "341723", + "name": "青阳县" + } + ] + }, + { + "code": "341800", + "name": "宣城市", + "area": [ + { + "code": "341802", + "name": "宣州区" + }, + { + "code": "341821", + "name": "郎溪县" + }, + { + "code": "341823", + "name": "泾县" + }, + { + "code": "341824", + "name": "绩溪县" + }, + { + "code": "341825", + "name": "旌德县" + }, + { + "code": "341881", + "name": "宁国市" + }, + { + "code": "341882", + "name": "广德市" + } + ] + } + ] + }, + { + "code": "350000", + "name": "福建省", + "city": [ + { + "code": "350100", + "name": "福州市", + "area": [ + { + "code": "350102", + "name": "鼓楼区" + }, + { + "code": "350103", + "name": "台江区" + }, + { + "code": "350104", + "name": "仓山区" + }, + { + "code": "350105", + "name": "马尾区" + }, + { + "code": "350111", + "name": "晋安区" + }, + { + "code": "350112", + "name": "长乐区" + }, + { + "code": "350121", + "name": "闽侯县" + }, + { + "code": "350122", + "name": "连江县" + }, + { + "code": "350123", + "name": "罗源县" + }, + { + "code": "350124", + "name": "闽清县" + }, + { + "code": "350125", + "name": "永泰县" + }, + { + "code": "350128", + "name": "平潭县" + }, + { + "code": "350181", + "name": "福清市" + } + ] + }, + { + "code": "350200", + "name": "厦门市", + "area": [ + { + "code": "350203", + "name": "思明区" + }, + { + "code": "350205", + "name": "海沧区" + }, + { + "code": "350206", + "name": "湖里区" + }, + { + "code": "350211", + "name": "集美区" + }, + { + "code": "350212", + "name": "同安区" + }, + { + "code": "350213", + "name": "翔安区" + } + ] + }, + { + "code": "350300", + "name": "莆田市", + "area": [ + { + "code": "350302", + "name": "城厢区" + }, + { + "code": "350303", + "name": "涵江区" + }, + { + "code": "350304", + "name": "荔城区" + }, + { + "code": "350305", + "name": "秀屿区" + }, + { + "code": "350322", + "name": "仙游县" + } + ] + }, + { + "code": "350400", + "name": "三明市", + "area": [ + { + "code": "350402", + "name": "梅列区" + }, + { + "code": "350403", + "name": "三元区" + }, + { + "code": "350421", + "name": "明溪县" + }, + { + "code": "350423", + "name": "清流县" + }, + { + "code": "350424", + "name": "宁化县" + }, + { + "code": "350425", + "name": "大田县" + }, + { + "code": "350426", + "name": "尤溪县" + }, + { + "code": "350427", + "name": "沙县" + }, + { + "code": "350428", + "name": "将乐县" + }, + { + "code": "350429", + "name": "泰宁县" + }, + { + "code": "350430", + "name": "建宁县" + }, + { + "code": "350481", + "name": "永安市" + } + ] + }, + { + "code": "350500", + "name": "泉州市", + "area": [ + { + "code": "350502", + "name": "鲤城区" + }, + { + "code": "350503", + "name": "丰泽区" + }, + { + "code": "350504", + "name": "洛江区" + }, + { + "code": "350505", + "name": "泉港区" + }, + { + "code": "350521", + "name": "惠安县" + }, + { + "code": "350524", + "name": "安溪县" + }, + { + "code": "350525", + "name": "永春县" + }, + { + "code": "350526", + "name": "德化县" + }, + { + "code": "350527", + "name": "金门县" + }, + { + "code": "350581", + "name": "石狮市" + }, + { + "code": "350582", + "name": "晋江市" + }, + { + "code": "350583", + "name": "南安市" + } + ] + }, + { + "code": "350600", + "name": "漳州市", + "area": [ + { + "code": "350602", + "name": "芗城区" + }, + { + "code": "350603", + "name": "龙文区" + }, + { + "code": "350622", + "name": "云霄县" + }, + { + "code": "350623", + "name": "漳浦县" + }, + { + "code": "350624", + "name": "诏安县" + }, + { + "code": "350625", + "name": "长泰县" + }, + { + "code": "350626", + "name": "东山县" + }, + { + "code": "350627", + "name": "南靖县" + }, + { + "code": "350628", + "name": "平和县" + }, + { + "code": "350629", + "name": "华安县" + }, + { + "code": "350681", + "name": "龙海市" + } + ] + }, + { + "code": "350700", + "name": "南平市", + "area": [ + { + "code": "350702", + "name": "延平区" + }, + { + "code": "350703", + "name": "建阳区" + }, + { + "code": "350721", + "name": "顺昌县" + }, + { + "code": "350722", + "name": "浦城县" + }, + { + "code": "350723", + "name": "光泽县" + }, + { + "code": "350724", + "name": "松溪县" + }, + { + "code": "350725", + "name": "政和县" + }, + { + "code": "350781", + "name": "邵武市" + }, + { + "code": "350782", + "name": "武夷山市" + }, + { + "code": "350783", + "name": "建瓯市" + } + ] + }, + { + "code": "350800", + "name": "龙岩市", + "area": [ + { + "code": "350802", + "name": "新罗区" + }, + { + "code": "350803", + "name": "永定区" + }, + { + "code": "350821", + "name": "长汀县" + }, + { + "code": "350823", + "name": "上杭县" + }, + { + "code": "350824", + "name": "武平县" + }, + { + "code": "350825", + "name": "连城县" + }, + { + "code": "350881", + "name": "漳平市" + } + ] + }, + { + "code": "350900", + "name": "宁德市", + "area": [ + { + "code": "350902", + "name": "蕉城区" + }, + { + "code": "350921", + "name": "霞浦县" + }, + { + "code": "350922", + "name": "古田县" + }, + { + "code": "350923", + "name": "屏南县" + }, + { + "code": "350924", + "name": "寿宁县" + }, + { + "code": "350925", + "name": "周宁县" + }, + { + "code": "350926", + "name": "柘荣县" + }, + { + "code": "350981", + "name": "福安市" + }, + { + "code": "350982", + "name": "福鼎市" + } + ] + } + ] + }, + { + "code": "360000", + "name": "江西省", + "city": [ + { + "code": "360100", + "name": "南昌市", + "area": [ + { + "code": "360102", + "name": "东湖区" + }, + { + "code": "360103", + "name": "西湖区" + }, + { + "code": "360104", + "name": "青云谱区" + }, + { + "code": "360111", + "name": "青山湖区" + }, + { + "code": "360112", + "name": "新建区" + }, + { + "code": "360113", + "name": "红谷滩区" + }, + { + "code": "360121", + "name": "南昌县" + }, + { + "code": "360123", + "name": "安义县" + }, + { + "code": "360124", + "name": "进贤县" + } + ] + }, + { + "code": "360200", + "name": "景德镇市", + "area": [ + { + "code": "360202", + "name": "昌江区" + }, + { + "code": "360203", + "name": "珠山区" + }, + { + "code": "360222", + "name": "浮梁县" + }, + { + "code": "360281", + "name": "乐平市" + } + ] + }, + { + "code": "360300", + "name": "萍乡市", + "area": [ + { + "code": "360302", + "name": "安源区" + }, + { + "code": "360313", + "name": "湘东区" + }, + { + "code": "360321", + "name": "莲花县" + }, + { + "code": "360322", + "name": "上栗县" + }, + { + "code": "360323", + "name": "芦溪县" + } + ] + }, + { + "code": "360400", + "name": "九江市", + "area": [ + { + "code": "360402", + "name": "濂溪区" + }, + { + "code": "360403", + "name": "浔阳区" + }, + { + "code": "360404", + "name": "柴桑区" + }, + { + "code": "360423", + "name": "武宁县" + }, + { + "code": "360424", + "name": "修水县" + }, + { + "code": "360425", + "name": "永修县" + }, + { + "code": "360426", + "name": "德安县" + }, + { + "code": "360428", + "name": "都昌县" + }, + { + "code": "360429", + "name": "湖口县" + }, + { + "code": "360430", + "name": "彭泽县" + }, + { + "code": "360481", + "name": "瑞昌市" + }, + { + "code": "360482", + "name": "共青城市" + }, + { + "code": "360483", + "name": "庐山市" + } + ] + }, + { + "code": "360500", + "name": "新余市", + "area": [ + { + "code": "360502", + "name": "渝水区" + }, + { + "code": "360521", + "name": "分宜县" + } + ] + }, + { + "code": "360600", + "name": "鹰潭市", + "area": [ + { + "code": "360602", + "name": "月湖区" + }, + { + "code": "360603", + "name": "余江区" + }, + { + "code": "360681", + "name": "贵溪市" + } + ] + }, + { + "code": "360700", + "name": "赣州市", + "area": [ + { + "code": "360702", + "name": "章贡区" + }, + { + "code": "360703", + "name": "南康区" + }, + { + "code": "360704", + "name": "赣县区" + }, + { + "code": "360722", + "name": "信丰县" + }, + { + "code": "360723", + "name": "大余县" + }, + { + "code": "360724", + "name": "上犹县" + }, + { + "code": "360725", + "name": "崇义县" + }, + { + "code": "360726", + "name": "安远县" + }, + { + "code": "360728", + "name": "定南县" + }, + { + "code": "360729", + "name": "全南县" + }, + { + "code": "360730", + "name": "宁都县" + }, + { + "code": "360731", + "name": "于都县" + }, + { + "code": "360732", + "name": "兴国县" + }, + { + "code": "360733", + "name": "会昌县" + }, + { + "code": "360734", + "name": "寻乌县" + }, + { + "code": "360735", + "name": "石城县" + }, + { + "code": "360781", + "name": "瑞金市" + }, + { + "code": "360783", + "name": "龙南市" + } + ] + }, + { + "code": "360800", + "name": "吉安市", + "area": [ + { + "code": "360802", + "name": "吉州区" + }, + { + "code": "360803", + "name": "青原区" + }, + { + "code": "360821", + "name": "吉安县" + }, + { + "code": "360822", + "name": "吉水县" + }, + { + "code": "360823", + "name": "峡江县" + }, + { + "code": "360824", + "name": "新干县" + }, + { + "code": "360825", + "name": "永丰县" + }, + { + "code": "360826", + "name": "泰和县" + }, + { + "code": "360827", + "name": "遂川县" + }, + { + "code": "360828", + "name": "万安县" + }, + { + "code": "360829", + "name": "安福县" + }, + { + "code": "360830", + "name": "永新县" + }, + { + "code": "360881", + "name": "井冈山市" + } + ] + }, + { + "code": "360900", + "name": "宜春市", + "area": [ + { + "code": "360902", + "name": "袁州区" + }, + { + "code": "360921", + "name": "奉新县" + }, + { + "code": "360922", + "name": "万载县" + }, + { + "code": "360923", + "name": "上高县" + }, + { + "code": "360924", + "name": "宜丰县" + }, + { + "code": "360925", + "name": "靖安县" + }, + { + "code": "360926", + "name": "铜鼓县" + }, + { + "code": "360981", + "name": "丰城市" + }, + { + "code": "360982", + "name": "樟树市" + }, + { + "code": "360983", + "name": "高安市" + } + ] + }, + { + "code": "361000", + "name": "抚州市", + "area": [ + { + "code": "361002", + "name": "临川区" + }, + { + "code": "361003", + "name": "东乡区" + }, + { + "code": "361021", + "name": "南城县" + }, + { + "code": "361022", + "name": "黎川县" + }, + { + "code": "361023", + "name": "南丰县" + }, + { + "code": "361024", + "name": "崇仁县" + }, + { + "code": "361025", + "name": "乐安县" + }, + { + "code": "361026", + "name": "宜黄县" + }, + { + "code": "361027", + "name": "金溪县" + }, + { + "code": "361028", + "name": "资溪县" + }, + { + "code": "361030", + "name": "广昌县" + } + ] + }, + { + "code": "361100", + "name": "上饶市", + "area": [ + { + "code": "361102", + "name": "信州区" + }, + { + "code": "361103", + "name": "广丰区" + }, + { + "code": "361104", + "name": "广信区" + }, + { + "code": "361123", + "name": "玉山县" + }, + { + "code": "361124", + "name": "铅山县" + }, + { + "code": "361125", + "name": "横峰县" + }, + { + "code": "361126", + "name": "弋阳县" + }, + { + "code": "361127", + "name": "余干县" + }, + { + "code": "361128", + "name": "鄱阳县" + }, + { + "code": "361129", + "name": "万年县" + }, + { + "code": "361130", + "name": "婺源县" + }, + { + "code": "361181", + "name": "德兴市" + } + ] + } + ] + }, + { + "code": "370000", + "name": "山东省", + "city": [ + { + "code": "370100", + "name": "济南市", + "area": [ + { + "code": "370102", + "name": "历下区" + }, + { + "code": "370103", + "name": "市中区" + }, + { + "code": "370104", + "name": "槐荫区" + }, + { + "code": "370105", + "name": "天桥区" + }, + { + "code": "370112", + "name": "历城区" + }, + { + "code": "370113", + "name": "长清区" + }, + { + "code": "370114", + "name": "章丘区" + }, + { + "code": "370115", + "name": "济阳区" + }, + { + "code": "370116", + "name": "莱芜区" + }, + { + "code": "370117", + "name": "钢城区" + }, + { + "code": "370124", + "name": "平阴县" + }, + { + "code": "370126", + "name": "商河县" + } + ] + }, + { + "code": "370200", + "name": "青岛市", + "area": [ + { + "code": "370202", + "name": "市南区" + }, + { + "code": "370203", + "name": "市北区" + }, + { + "code": "370211", + "name": "黄岛区" + }, + { + "code": "370212", + "name": "崂山区" + }, + { + "code": "370213", + "name": "李沧区" + }, + { + "code": "370214", + "name": "城阳区" + }, + { + "code": "370215", + "name": "即墨区" + }, + { + "code": "370281", + "name": "胶州市" + }, + { + "code": "370283", + "name": "平度市" + }, + { + "code": "370285", + "name": "莱西市" + } + ] + }, + { + "code": "370300", + "name": "淄博市", + "area": [ + { + "code": "370302", + "name": "淄川区" + }, + { + "code": "370303", + "name": "张店区" + }, + { + "code": "370304", + "name": "博山区" + }, + { + "code": "370305", + "name": "临淄区" + }, + { + "code": "370306", + "name": "周村区" + }, + { + "code": "370321", + "name": "桓台县" + }, + { + "code": "370322", + "name": "高青县" + }, + { + "code": "370323", + "name": "沂源县" + } + ] + }, + { + "code": "370400", + "name": "枣庄市", + "area": [ + { + "code": "370402", + "name": "市中区" + }, + { + "code": "370403", + "name": "薛城区" + }, + { + "code": "370404", + "name": "峄城区" + }, + { + "code": "370405", + "name": "台儿庄区" + }, + { + "code": "370406", + "name": "山亭区" + }, + { + "code": "370481", + "name": "滕州市" + } + ] + }, + { + "code": "370500", + "name": "东营市", + "area": [ + { + "code": "370502", + "name": "东营区" + }, + { + "code": "370503", + "name": "河口区" + }, + { + "code": "370505", + "name": "垦利区" + }, + { + "code": "370522", + "name": "利津县" + }, + { + "code": "370523", + "name": "广饶县" + } + ] + }, + { + "code": "370600", + "name": "烟台市", + "area": [ + { + "code": "370602", + "name": "芝罘区" + }, + { + "code": "370611", + "name": "福山区" + }, + { + "code": "370612", + "name": "牟平区" + }, + { + "code": "370613", + "name": "莱山区" + }, + { + "code": "370634", + "name": "长岛县" + }, + { + "code": "370681", + "name": "龙口市" + }, + { + "code": "370682", + "name": "莱阳市" + }, + { + "code": "370683", + "name": "莱州市" + }, + { + "code": "370684", + "name": "蓬莱市" + }, + { + "code": "370685", + "name": "招远市" + }, + { + "code": "370686", + "name": "栖霞市" + }, + { + "code": "370687", + "name": "海阳市" + } + ] + }, + { + "code": "370700", + "name": "潍坊市", + "area": [ + { + "code": "370702", + "name": "潍城区" + }, + { + "code": "370703", + "name": "寒亭区" + }, + { + "code": "370704", + "name": "坊子区" + }, + { + "code": "370705", + "name": "奎文区" + }, + { + "code": "370724", + "name": "临朐县" + }, + { + "code": "370725", + "name": "昌乐县" + }, + { + "code": "370781", + "name": "青州市" + }, + { + "code": "370782", + "name": "诸城市" + }, + { + "code": "370783", + "name": "寿光市" + }, + { + "code": "370784", + "name": "安丘市" + }, + { + "code": "370785", + "name": "高密市" + }, + { + "code": "370786", + "name": "昌邑市" + } + ] + }, + { + "code": "370800", + "name": "济宁市", + "area": [ + { + "code": "370811", + "name": "任城区" + }, + { + "code": "370812", + "name": "兖州区" + }, + { + "code": "370826", + "name": "微山县" + }, + { + "code": "370827", + "name": "鱼台县" + }, + { + "code": "370828", + "name": "金乡县" + }, + { + "code": "370829", + "name": "嘉祥县" + }, + { + "code": "370830", + "name": "汶上县" + }, + { + "code": "370831", + "name": "泗水县" + }, + { + "code": "370832", + "name": "梁山县" + }, + { + "code": "370881", + "name": "曲阜市" + }, + { + "code": "370883", + "name": "邹城市" + } + ] + }, + { + "code": "370900", + "name": "泰安市", + "area": [ + { + "code": "370902", + "name": "泰山区" + }, + { + "code": "370911", + "name": "岱岳区" + }, + { + "code": "370921", + "name": "宁阳县" + }, + { + "code": "370923", + "name": "东平县" + }, + { + "code": "370982", + "name": "新泰市" + }, + { + "code": "370983", + "name": "肥城市" + } + ] + }, + { + "code": "371000", + "name": "威海市", + "area": [ + { + "code": "371002", + "name": "环翠区" + }, + { + "code": "371003", + "name": "文登区" + }, + { + "code": "371082", + "name": "荣成市" + }, + { + "code": "371083", + "name": "乳山市" + } + ] + }, + { + "code": "371100", + "name": "日照市", + "area": [ + { + "code": "371102", + "name": "东港区" + }, + { + "code": "371103", + "name": "岚山区" + }, + { + "code": "371121", + "name": "五莲县" + }, + { + "code": "371122", + "name": "莒县" + } + ] + }, + { + "code": "371300", + "name": "临沂市", + "area": [ + { + "code": "371302", + "name": "兰山区" + }, + { + "code": "371311", + "name": "罗庄区" + }, + { + "code": "371312", + "name": "河东区" + }, + { + "code": "371321", + "name": "沂南县" + }, + { + "code": "371322", + "name": "郯城县" + }, + { + "code": "371323", + "name": "沂水县" + }, + { + "code": "371324", + "name": "兰陵县" + }, + { + "code": "371325", + "name": "费县" + }, + { + "code": "371326", + "name": "平邑县" + }, + { + "code": "371327", + "name": "莒南县" + }, + { + "code": "371328", + "name": "蒙阴县" + }, + { + "code": "371329", + "name": "临沭县" + } + ] + }, + { + "code": "371400", + "name": "德州市", + "area": [ + { + "code": "371402", + "name": "德城区" + }, + { + "code": "371403", + "name": "陵城区" + }, + { + "code": "371422", + "name": "宁津县" + }, + { + "code": "371423", + "name": "庆云县" + }, + { + "code": "371424", + "name": "临邑县" + }, + { + "code": "371425", + "name": "齐河县" + }, + { + "code": "371426", + "name": "平原县" + }, + { + "code": "371427", + "name": "夏津县" + }, + { + "code": "371428", + "name": "武城县" + }, + { + "code": "371481", + "name": "乐陵市" + }, + { + "code": "371482", + "name": "禹城市" + } + ] + }, + { + "code": "371500", + "name": "聊城市", + "area": [ + { + "code": "371502", + "name": "东昌府区" + }, + { + "code": "371503", + "name": "茌平区" + }, + { + "code": "371521", + "name": "阳谷县" + }, + { + "code": "371522", + "name": "莘县" + }, + { + "code": "371524", + "name": "东阿县" + }, + { + "code": "371525", + "name": "冠县" + }, + { + "code": "371526", + "name": "高唐县" + }, + { + "code": "371581", + "name": "临清市" + } + ] + }, + { + "code": "371600", + "name": "滨州市", + "area": [ + { + "code": "371602", + "name": "滨城区" + }, + { + "code": "371603", + "name": "沾化区" + }, + { + "code": "371621", + "name": "惠民县" + }, + { + "code": "371622", + "name": "阳信县" + }, + { + "code": "371623", + "name": "无棣县" + }, + { + "code": "371625", + "name": "博兴县" + }, + { + "code": "371681", + "name": "邹平市" + } + ] + }, + { + "code": "371700", + "name": "菏泽市", + "area": [ + { + "code": "371702", + "name": "牡丹区" + }, + { + "code": "371703", + "name": "定陶区" + }, + { + "code": "371721", + "name": "曹县" + }, + { + "code": "371722", + "name": "单县" + }, + { + "code": "371723", + "name": "成武县" + }, + { + "code": "371724", + "name": "巨野县" + }, + { + "code": "371725", + "name": "郓城县" + }, + { + "code": "371726", + "name": "鄄城县" + }, + { + "code": "371728", + "name": "东明县" + } + ] + } + ] + }, + { + "code": "410000", + "name": "河南省", + "city": [ + { + "code": "410100", + "name": "郑州市", + "area": [ + { + "code": "410102", + "name": "中原区" + }, + { + "code": "410103", + "name": "二七区" + }, + { + "code": "410104", + "name": "管城回族区" + }, + { + "code": "410105", + "name": "金水区" + }, + { + "code": "410106", + "name": "上街区" + }, + { + "code": "410108", + "name": "惠济区" + }, + { + "code": "410122", + "name": "中牟县" + }, + { + "code": "410181", + "name": "巩义市" + }, + { + "code": "410182", + "name": "荥阳市" + }, + { + "code": "410183", + "name": "新密市" + }, + { + "code": "410184", + "name": "新郑市" + }, + { + "code": "410185", + "name": "登封市" + } + ] + }, + { + "code": "410200", + "name": "开封市", + "area": [ + { + "code": "410202", + "name": "龙亭区" + }, + { + "code": "410203", + "name": "顺河回族区" + }, + { + "code": "410204", + "name": "鼓楼区" + }, + { + "code": "410205", + "name": "禹王台区" + }, + { + "code": "410212", + "name": "祥符区" + }, + { + "code": "410221", + "name": "杞县" + }, + { + "code": "410222", + "name": "通许县" + }, + { + "code": "410223", + "name": "尉氏县" + }, + { + "code": "410225", + "name": "兰考县" + } + ] + }, + { + "code": "410300", + "name": "洛阳市", + "area": [ + { + "code": "410302", + "name": "老城区" + }, + { + "code": "410303", + "name": "西工区" + }, + { + "code": "410304", + "name": "瀍河回族区" + }, + { + "code": "410305", + "name": "涧西区" + }, + { + "code": "410306", + "name": "吉利区" + }, + { + "code": "410311", + "name": "洛龙区" + }, + { + "code": "410322", + "name": "孟津县" + }, + { + "code": "410323", + "name": "新安县" + }, + { + "code": "410324", + "name": "栾川县" + }, + { + "code": "410325", + "name": "嵩县" + }, + { + "code": "410326", + "name": "汝阳县" + }, + { + "code": "410327", + "name": "宜阳县" + }, + { + "code": "410328", + "name": "洛宁县" + }, + { + "code": "410329", + "name": "伊川县" + }, + { + "code": "410381", + "name": "偃师市" + } + ] + }, + { + "code": "410400", + "name": "平顶山市", + "area": [ + { + "code": "410402", + "name": "新华区" + }, + { + "code": "410403", + "name": "卫东区" + }, + { + "code": "410404", + "name": "石龙区" + }, + { + "code": "410411", + "name": "湛河区" + }, + { + "code": "410421", + "name": "宝丰县" + }, + { + "code": "410422", + "name": "叶县" + }, + { + "code": "410423", + "name": "鲁山县" + }, + { + "code": "410425", + "name": "郏县" + }, + { + "code": "410481", + "name": "舞钢市" + }, + { + "code": "410482", + "name": "汝州市" + } + ] + }, + { + "code": "410500", + "name": "安阳市", + "area": [ + { + "code": "410502", + "name": "文峰区" + }, + { + "code": "410503", + "name": "北关区" + }, + { + "code": "410505", + "name": "殷都区" + }, + { + "code": "410506", + "name": "龙安区" + }, + { + "code": "410522", + "name": "安阳县" + }, + { + "code": "410523", + "name": "汤阴县" + }, + { + "code": "410526", + "name": "滑县" + }, + { + "code": "410527", + "name": "内黄县" + }, + { + "code": "410581", + "name": "林州市" + } + ] + }, + { + "code": "410600", + "name": "鹤壁市", + "area": [ + { + "code": "410602", + "name": "鹤山区" + }, + { + "code": "410603", + "name": "山城区" + }, + { + "code": "410611", + "name": "淇滨区" + }, + { + "code": "410621", + "name": "浚县" + }, + { + "code": "410622", + "name": "淇县" + } + ] + }, + { + "code": "410700", + "name": "新乡市", + "area": [ + { + "code": "410702", + "name": "红旗区" + }, + { + "code": "410703", + "name": "卫滨区" + }, + { + "code": "410704", + "name": "凤泉区" + }, + { + "code": "410711", + "name": "牧野区" + }, + { + "code": "410721", + "name": "新乡县" + }, + { + "code": "410724", + "name": "获嘉县" + }, + { + "code": "410725", + "name": "原阳县" + }, + { + "code": "410726", + "name": "延津县" + }, + { + "code": "410727", + "name": "封丘县" + }, + { + "code": "410781", + "name": "卫辉市" + }, + { + "code": "410782", + "name": "辉县市" + }, + { + "code": "410783", + "name": "长垣市" + } + ] + }, + { + "code": "410800", + "name": "焦作市", + "area": [ + { + "code": "410802", + "name": "解放区" + }, + { + "code": "410803", + "name": "中站区" + }, + { + "code": "410804", + "name": "马村区" + }, + { + "code": "410811", + "name": "山阳区" + }, + { + "code": "410821", + "name": "修武县" + }, + { + "code": "410822", + "name": "博爱县" + }, + { + "code": "410823", + "name": "武陟县" + }, + { + "code": "410825", + "name": "温县" + }, + { + "code": "410882", + "name": "沁阳市" + }, + { + "code": "410883", + "name": "孟州市" + } + ] + }, + { + "code": "410900", + "name": "濮阳市", + "area": [ + { + "code": "410902", + "name": "华龙区" + }, + { + "code": "410922", + "name": "清丰县" + }, + { + "code": "410923", + "name": "南乐县" + }, + { + "code": "410926", + "name": "范县" + }, + { + "code": "410927", + "name": "台前县" + }, + { + "code": "410928", + "name": "濮阳县" + } + ] + }, + { + "code": "411000", + "name": "许昌市", + "area": [ + { + "code": "411002", + "name": "魏都区" + }, + { + "code": "411003", + "name": "建安区" + }, + { + "code": "411024", + "name": "鄢陵县" + }, + { + "code": "411025", + "name": "襄城县" + }, + { + "code": "411081", + "name": "禹州市" + }, + { + "code": "411082", + "name": "长葛市" + } + ] + }, + { + "code": "411100", + "name": "漯河市", + "area": [ + { + "code": "411102", + "name": "源汇区" + }, + { + "code": "411103", + "name": "郾城区" + }, + { + "code": "411104", + "name": "召陵区" + }, + { + "code": "411121", + "name": "舞阳县" + }, + { + "code": "411122", + "name": "临颍县" + } + ] + }, + { + "code": "411200", + "name": "三门峡市", + "area": [ + { + "code": "411202", + "name": "湖滨区" + }, + { + "code": "411203", + "name": "陕州区" + }, + { + "code": "411221", + "name": "渑池县" + }, + { + "code": "411224", + "name": "卢氏县" + }, + { + "code": "411281", + "name": "义马市" + }, + { + "code": "411282", + "name": "灵宝市" + } + ] + }, + { + "code": "411300", + "name": "南阳市", + "area": [ + { + "code": "411302", + "name": "宛城区" + }, + { + "code": "411303", + "name": "卧龙区" + }, + { + "code": "411321", + "name": "南召县" + }, + { + "code": "411322", + "name": "方城县" + }, + { + "code": "411323", + "name": "西峡县" + }, + { + "code": "411324", + "name": "镇平县" + }, + { + "code": "411325", + "name": "内乡县" + }, + { + "code": "411326", + "name": "淅川县" + }, + { + "code": "411327", + "name": "社旗县" + }, + { + "code": "411328", + "name": "唐河县" + }, + { + "code": "411329", + "name": "新野县" + }, + { + "code": "411330", + "name": "桐柏县" + }, + { + "code": "411381", + "name": "邓州市" + } + ] + }, + { + "code": "411400", + "name": "商丘市", + "area": [ + { + "code": "411402", + "name": "梁园区" + }, + { + "code": "411403", + "name": "睢阳区" + }, + { + "code": "411421", + "name": "民权县" + }, + { + "code": "411422", + "name": "睢县" + }, + { + "code": "411423", + "name": "宁陵县" + }, + { + "code": "411424", + "name": "柘城县" + }, + { + "code": "411425", + "name": "虞城县" + }, + { + "code": "411426", + "name": "夏邑县" + }, + { + "code": "411481", + "name": "永城市" + } + ] + }, + { + "code": "411500", + "name": "信阳市", + "area": [ + { + "code": "411502", + "name": "浉河区" + }, + { + "code": "411503", + "name": "平桥区" + }, + { + "code": "411521", + "name": "罗山县" + }, + { + "code": "411522", + "name": "光山县" + }, + { + "code": "411523", + "name": "新县" + }, + { + "code": "411524", + "name": "商城县" + }, + { + "code": "411525", + "name": "固始县" + }, + { + "code": "411526", + "name": "潢川县" + }, + { + "code": "411527", + "name": "淮滨县" + }, + { + "code": "411528", + "name": "息县" + } + ] + }, + { + "code": "411600", + "name": "周口市", + "area": [ + { + "code": "411602", + "name": "川汇区" + }, + { + "code": "411603", + "name": "淮阳区" + }, + { + "code": "411621", + "name": "扶沟县" + }, + { + "code": "411622", + "name": "西华县" + }, + { + "code": "411623", + "name": "商水县" + }, + { + "code": "411624", + "name": "沈丘县" + }, + { + "code": "411625", + "name": "郸城县" + }, + { + "code": "411627", + "name": "太康县" + }, + { + "code": "411628", + "name": "鹿邑县" + }, + { + "code": "411681", + "name": "项城市" + } + ] + }, + { + "code": "411700", + "name": "驻马店市", + "area": [ + { + "code": "411702", + "name": "驿城区" + }, + { + "code": "411721", + "name": "西平县" + }, + { + "code": "411722", + "name": "上蔡县" + }, + { + "code": "411723", + "name": "平舆县" + }, + { + "code": "411724", + "name": "正阳县" + }, + { + "code": "411725", + "name": "确山县" + }, + { + "code": "411726", + "name": "泌阳县" + }, + { + "code": "411727", + "name": "汝南县" + }, + { + "code": "411728", + "name": "遂平县" + }, + { + "code": "411729", + "name": "新蔡县" + } + ] + }, + { + "code": "419001", + "name": "济源市", + "area": [] + } + ] + }, + { + "code": "420000", + "name": "湖北省", + "city": [ + { + "code": "420100", + "name": "武汉市", + "area": [ + { + "code": "420102", + "name": "江岸区" + }, + { + "code": "420103", + "name": "江汉区" + }, + { + "code": "420104", + "name": "硚口区" + }, + { + "code": "420105", + "name": "汉阳区" + }, + { + "code": "420106", + "name": "武昌区" + }, + { + "code": "420107", + "name": "青山区" + }, + { + "code": "420111", + "name": "洪山区" + }, + { + "code": "420112", + "name": "东西湖区" + }, + { + "code": "420113", + "name": "汉南区" + }, + { + "code": "420114", + "name": "蔡甸区" + }, + { + "code": "420115", + "name": "江夏区" + }, + { + "code": "420116", + "name": "黄陂区" + }, + { + "code": "420117", + "name": "新洲区" + } + ] + }, + { + "code": "420200", + "name": "黄石市", + "area": [ + { + "code": "420202", + "name": "黄石港区" + }, + { + "code": "420203", + "name": "西塞山区" + }, + { + "code": "420204", + "name": "下陆区" + }, + { + "code": "420205", + "name": "铁山区" + }, + { + "code": "420222", + "name": "阳新县" + }, + { + "code": "420281", + "name": "大冶市" + } + ] + }, + { + "code": "420300", + "name": "十堰市", + "area": [ + { + "code": "420302", + "name": "茅箭区" + }, + { + "code": "420303", + "name": "张湾区" + }, + { + "code": "420304", + "name": "郧阳区" + }, + { + "code": "420322", + "name": "郧西县" + }, + { + "code": "420323", + "name": "竹山县" + }, + { + "code": "420324", + "name": "竹溪县" + }, + { + "code": "420325", + "name": "房县" + }, + { + "code": "420381", + "name": "丹江口市" + } + ] + }, + { + "code": "420500", + "name": "宜昌市", + "area": [ + { + "code": "420502", + "name": "西陵区" + }, + { + "code": "420503", + "name": "伍家岗区" + }, + { + "code": "420504", + "name": "点军区" + }, + { + "code": "420505", + "name": "猇亭区" + }, + { + "code": "420506", + "name": "夷陵区" + }, + { + "code": "420525", + "name": "远安县" + }, + { + "code": "420526", + "name": "兴山县" + }, + { + "code": "420527", + "name": "秭归县" + }, + { + "code": "420528", + "name": "长阳土家族自治县" + }, + { + "code": "420529", + "name": "五峰土家族自治县" + }, + { + "code": "420581", + "name": "宜都市" + }, + { + "code": "420582", + "name": "当阳市" + }, + { + "code": "420583", + "name": "枝江市" + } + ] + }, + { + "code": "420600", + "name": "襄阳市", + "area": [ + { + "code": "420602", + "name": "襄城区" + }, + { + "code": "420606", + "name": "樊城区" + }, + { + "code": "420607", + "name": "襄州区" + }, + { + "code": "420624", + "name": "南漳县" + }, + { + "code": "420625", + "name": "谷城县" + }, + { + "code": "420626", + "name": "保康县" + }, + { + "code": "420682", + "name": "老河口市" + }, + { + "code": "420683", + "name": "枣阳市" + }, + { + "code": "420684", + "name": "宜城市" + } + ] + }, + { + "code": "420700", + "name": "鄂州市", + "area": [ + { + "code": "420702", + "name": "梁子湖区" + }, + { + "code": "420703", + "name": "华容区" + }, + { + "code": "420704", + "name": "鄂城区" + } + ] + }, + { + "code": "420800", + "name": "荆门市", + "area": [ + { + "code": "420802", + "name": "东宝区" + }, + { + "code": "420804", + "name": "掇刀区" + }, + { + "code": "420822", + "name": "沙洋县" + }, + { + "code": "420881", + "name": "钟祥市" + }, + { + "code": "420882", + "name": "京山市" + } + ] + }, + { + "code": "420900", + "name": "孝感市", + "area": [ + { + "code": "420902", + "name": "孝南区" + }, + { + "code": "420921", + "name": "孝昌县" + }, + { + "code": "420922", + "name": "大悟县" + }, + { + "code": "420923", + "name": "云梦县" + }, + { + "code": "420981", + "name": "应城市" + }, + { + "code": "420982", + "name": "安陆市" + }, + { + "code": "420984", + "name": "汉川市" + } + ] + }, + { + "code": "421000", + "name": "荆州市", + "area": [ + { + "code": "421002", + "name": "沙市区" + }, + { + "code": "421003", + "name": "荆州区" + }, + { + "code": "421022", + "name": "公安县" + }, + { + "code": "421023", + "name": "监利县" + }, + { + "code": "421024", + "name": "江陵县" + }, + { + "code": "421081", + "name": "石首市" + }, + { + "code": "421083", + "name": "洪湖市" + }, + { + "code": "421087", + "name": "松滋市" + } + ] + }, + { + "code": "421100", + "name": "黄冈市", + "area": [ + { + "code": "421102", + "name": "黄州区" + }, + { + "code": "421121", + "name": "团风县" + }, + { + "code": "421122", + "name": "红安县" + }, + { + "code": "421123", + "name": "罗田县" + }, + { + "code": "421124", + "name": "英山县" + }, + { + "code": "421125", + "name": "浠水县" + }, + { + "code": "421126", + "name": "蕲春县" + }, + { + "code": "421127", + "name": "黄梅县" + }, + { + "code": "421181", + "name": "麻城市" + }, + { + "code": "421182", + "name": "武穴市" + } + ] + }, + { + "code": "421200", + "name": "咸宁市", + "area": [ + { + "code": "421202", + "name": "咸安区" + }, + { + "code": "421221", + "name": "嘉鱼县" + }, + { + "code": "421222", + "name": "通城县" + }, + { + "code": "421223", + "name": "崇阳县" + }, + { + "code": "421224", + "name": "通山县" + }, + { + "code": "421281", + "name": "赤壁市" + } + ] + }, + { + "code": "421300", + "name": "随州市", + "area": [ + { + "code": "421303", + "name": "曾都区" + }, + { + "code": "421321", + "name": "随县" + }, + { + "code": "421381", + "name": "广水市" + } + ] + }, + { + "code": "422800", + "name": "恩施土家族苗族自治州", + "area": [ + { + "code": "422801", + "name": "恩施市" + }, + { + "code": "422802", + "name": "利川市" + }, + { + "code": "422822", + "name": "建始县" + }, + { + "code": "422823", + "name": "巴东县" + }, + { + "code": "422825", + "name": "宣恩县" + }, + { + "code": "422826", + "name": "咸丰县" + }, + { + "code": "422827", + "name": "来凤县" + }, + { + "code": "422828", + "name": "鹤峰县" + } + ] + }, + { + "code": "429004", + "name": "仙桃市", + "area": [] + }, + { + "code": "429005", + "name": "潜江市", + "area": [] + }, + { + "code": "429006", + "name": "天门市", + "area": [] + }, + { + "code": "429021", + "name": "神农架林区", + "area": [] + } + ] + }, + { + "code": "430000", + "name": "湖南省", + "city": [ + { + "code": "430100", + "name": "长沙市", + "area": [ + { + "code": "430102", + "name": "芙蓉区" + }, + { + "code": "430103", + "name": "天心区" + }, + { + "code": "430104", + "name": "岳麓区" + }, + { + "code": "430105", + "name": "开福区" + }, + { + "code": "430111", + "name": "雨花区" + }, + { + "code": "430112", + "name": "望城区" + }, + { + "code": "430121", + "name": "长沙县" + }, + { + "code": "430181", + "name": "浏阳市" + }, + { + "code": "430182", + "name": "宁乡市" + } + ] + }, + { + "code": "430200", + "name": "株洲市", + "area": [ + { + "code": "430202", + "name": "荷塘区" + }, + { + "code": "430203", + "name": "芦淞区" + }, + { + "code": "430204", + "name": "石峰区" + }, + { + "code": "430211", + "name": "天元区" + }, + { + "code": "430212", + "name": "渌口区" + }, + { + "code": "430223", + "name": "攸县" + }, + { + "code": "430224", + "name": "茶陵县" + }, + { + "code": "430225", + "name": "炎陵县" + }, + { + "code": "430281", + "name": "醴陵市" + } + ] + }, + { + "code": "430300", + "name": "湘潭市", + "area": [ + { + "code": "430302", + "name": "雨湖区" + }, + { + "code": "430304", + "name": "岳塘区" + }, + { + "code": "430321", + "name": "湘潭县" + }, + { + "code": "430381", + "name": "湘乡市" + }, + { + "code": "430382", + "name": "韶山市" + } + ] + }, + { + "code": "430400", + "name": "衡阳市", + "area": [ + { + "code": "430405", + "name": "珠晖区" + }, + { + "code": "430406", + "name": "雁峰区" + }, + { + "code": "430407", + "name": "石鼓区" + }, + { + "code": "430408", + "name": "蒸湘区" + }, + { + "code": "430412", + "name": "南岳区" + }, + { + "code": "430421", + "name": "衡阳县" + }, + { + "code": "430422", + "name": "衡南县" + }, + { + "code": "430423", + "name": "衡山县" + }, + { + "code": "430424", + "name": "衡东县" + }, + { + "code": "430426", + "name": "祁东县" + }, + { + "code": "430481", + "name": "耒阳市" + }, + { + "code": "430482", + "name": "常宁市" + } + ] + }, + { + "code": "430500", + "name": "邵阳市", + "area": [ + { + "code": "430502", + "name": "双清区" + }, + { + "code": "430503", + "name": "大祥区" + }, + { + "code": "430511", + "name": "北塔区" + }, + { + "code": "430522", + "name": "新邵县" + }, + { + "code": "430523", + "name": "邵阳县" + }, + { + "code": "430524", + "name": "隆回县" + }, + { + "code": "430525", + "name": "洞口县" + }, + { + "code": "430527", + "name": "绥宁县" + }, + { + "code": "430528", + "name": "新宁县" + }, + { + "code": "430529", + "name": "城步苗族自治县" + }, + { + "code": "430581", + "name": "武冈市" + }, + { + "code": "430582", + "name": "邵东市" + } + ] + }, + { + "code": "430600", + "name": "岳阳市", + "area": [ + { + "code": "430602", + "name": "岳阳楼区" + }, + { + "code": "430603", + "name": "云溪区" + }, + { + "code": "430611", + "name": "君山区" + }, + { + "code": "430621", + "name": "岳阳县" + }, + { + "code": "430623", + "name": "华容县" + }, + { + "code": "430624", + "name": "湘阴县" + }, + { + "code": "430626", + "name": "平江县" + }, + { + "code": "430681", + "name": "汨罗市" + }, + { + "code": "430682", + "name": "临湘市" + } + ] + }, + { + "code": "430700", + "name": "常德市", + "area": [ + { + "code": "430702", + "name": "武陵区" + }, + { + "code": "430703", + "name": "鼎城区" + }, + { + "code": "430721", + "name": "安乡县" + }, + { + "code": "430722", + "name": "汉寿县" + }, + { + "code": "430723", + "name": "澧县" + }, + { + "code": "430724", + "name": "临澧县" + }, + { + "code": "430725", + "name": "桃源县" + }, + { + "code": "430726", + "name": "石门县" + }, + { + "code": "430781", + "name": "津市市" + } + ] + }, + { + "code": "430800", + "name": "张家界市", + "area": [ + { + "code": "430802", + "name": "永定区" + }, + { + "code": "430811", + "name": "武陵源区" + }, + { + "code": "430821", + "name": "慈利县" + }, + { + "code": "430822", + "name": "桑植县" + } + ] + }, + { + "code": "430900", + "name": "益阳市", + "area": [ + { + "code": "430902", + "name": "资阳区" + }, + { + "code": "430903", + "name": "赫山区" + }, + { + "code": "430921", + "name": "南县" + }, + { + "code": "430922", + "name": "桃江县" + }, + { + "code": "430923", + "name": "安化县" + }, + { + "code": "430981", + "name": "沅江市" + } + ] + }, + { + "code": "431000", + "name": "郴州市", + "area": [ + { + "code": "431002", + "name": "北湖区" + }, + { + "code": "431003", + "name": "苏仙区" + }, + { + "code": "431021", + "name": "桂阳县" + }, + { + "code": "431022", + "name": "宜章县" + }, + { + "code": "431023", + "name": "永兴县" + }, + { + "code": "431024", + "name": "嘉禾县" + }, + { + "code": "431025", + "name": "临武县" + }, + { + "code": "431026", + "name": "汝城县" + }, + { + "code": "431027", + "name": "桂东县" + }, + { + "code": "431028", + "name": "安仁县" + }, + { + "code": "431081", + "name": "资兴市" + } + ] + }, + { + "code": "431100", + "name": "永州市", + "area": [ + { + "code": "431102", + "name": "零陵区" + }, + { + "code": "431103", + "name": "冷水滩区" + }, + { + "code": "431121", + "name": "祁阳县" + }, + { + "code": "431122", + "name": "东安县" + }, + { + "code": "431123", + "name": "双牌县" + }, + { + "code": "431124", + "name": "道县" + }, + { + "code": "431125", + "name": "江永县" + }, + { + "code": "431126", + "name": "宁远县" + }, + { + "code": "431127", + "name": "蓝山县" + }, + { + "code": "431128", + "name": "新田县" + }, + { + "code": "431129", + "name": "江华瑶族自治县" + } + ] + }, + { + "code": "431200", + "name": "怀化市", + "area": [ + { + "code": "431202", + "name": "鹤城区" + }, + { + "code": "431221", + "name": "中方县" + }, + { + "code": "431222", + "name": "沅陵县" + }, + { + "code": "431223", + "name": "辰溪县" + }, + { + "code": "431224", + "name": "溆浦县" + }, + { + "code": "431225", + "name": "会同县" + }, + { + "code": "431226", + "name": "麻阳苗族自治县" + }, + { + "code": "431227", + "name": "新晃侗族自治县" + }, + { + "code": "431228", + "name": "芷江侗族自治县" + }, + { + "code": "431229", + "name": "靖州苗族侗族自治县" + }, + { + "code": "431230", + "name": "通道侗族自治县" + }, + { + "code": "431281", + "name": "洪江市" + } + ] + }, + { + "code": "431300", + "name": "娄底市", + "area": [ + { + "code": "431302", + "name": "娄星区" + }, + { + "code": "431321", + "name": "双峰县" + }, + { + "code": "431322", + "name": "新化县" + }, + { + "code": "431381", + "name": "冷水江市" + }, + { + "code": "431382", + "name": "涟源市" + } + ] + }, + { + "code": "433100", + "name": "湘西土家族苗族自治州", + "area": [ + { + "code": "433101", + "name": "吉首市" + }, + { + "code": "433122", + "name": "泸溪县" + }, + { + "code": "433123", + "name": "凤凰县" + }, + { + "code": "433124", + "name": "花垣县" + }, + { + "code": "433125", + "name": "保靖县" + }, + { + "code": "433126", + "name": "古丈县" + }, + { + "code": "433127", + "name": "永顺县" + }, + { + "code": "433130", + "name": "龙山县" + } + ] + } + ] + }, + { + "code": "440000", + "name": "广东省", + "city": [ + { + "code": "440100", + "name": "广州市", + "area": [ + { + "code": "440103", + "name": "荔湾区" + }, + { + "code": "440104", + "name": "越秀区" + }, + { + "code": "440105", + "name": "海珠区" + }, + { + "code": "440106", + "name": "天河区" + }, + { + "code": "440111", + "name": "白云区" + }, + { + "code": "440112", + "name": "黄埔区" + }, + { + "code": "440113", + "name": "番禺区" + }, + { + "code": "440114", + "name": "花都区" + }, + { + "code": "440115", + "name": "南沙区" + }, + { + "code": "440117", + "name": "从化区" + }, + { + "code": "440118", + "name": "增城区" + } + ] + }, + { + "code": "440200", + "name": "韶关市", + "area": [ + { + "code": "440203", + "name": "武江区" + }, + { + "code": "440204", + "name": "浈江区" + }, + { + "code": "440205", + "name": "曲江区" + }, + { + "code": "440222", + "name": "始兴县" + }, + { + "code": "440224", + "name": "仁化县" + }, + { + "code": "440229", + "name": "翁源县" + }, + { + "code": "440232", + "name": "乳源瑶族自治县" + }, + { + "code": "440233", + "name": "新丰县" + }, + { + "code": "440281", + "name": "乐昌市" + }, + { + "code": "440282", + "name": "南雄市" + } + ] + }, + { + "code": "440300", + "name": "深圳市", + "area": [ + { + "code": "440303", + "name": "罗湖区" + }, + { + "code": "440304", + "name": "福田区" + }, + { + "code": "440305", + "name": "南山区" + }, + { + "code": "440306", + "name": "宝安区" + }, + { + "code": "440307", + "name": "龙岗区" + }, + { + "code": "440308", + "name": "盐田区" + }, + { + "code": "440309", + "name": "龙华区" + }, + { + "code": "440310", + "name": "坪山区" + }, + { + "code": "440311", + "name": "光明区" + } + ] + }, + { + "code": "440400", + "name": "珠海市", + "area": [ + { + "code": "440402", + "name": "香洲区" + }, + { + "code": "440403", + "name": "斗门区" + }, + { + "code": "440404", + "name": "金湾区" + } + ] + }, + { + "code": "440500", + "name": "汕头市", + "area": [ + { + "code": "440507", + "name": "龙湖区" + }, + { + "code": "440511", + "name": "金平区" + }, + { + "code": "440512", + "name": "濠江区" + }, + { + "code": "440513", + "name": "潮阳区" + }, + { + "code": "440514", + "name": "潮南区" + }, + { + "code": "440515", + "name": "澄海区" + }, + { + "code": "440523", + "name": "南澳县" + } + ] + }, + { + "code": "440600", + "name": "佛山市", + "area": [ + { + "code": "440604", + "name": "禅城区" + }, + { + "code": "440605", + "name": "南海区" + }, + { + "code": "440606", + "name": "顺德区" + }, + { + "code": "440607", + "name": "三水区" + }, + { + "code": "440608", + "name": "高明区" + } + ] + }, + { + "code": "440700", + "name": "江门市", + "area": [ + { + "code": "440703", + "name": "蓬江区" + }, + { + "code": "440704", + "name": "江海区" + }, + { + "code": "440705", + "name": "新会区" + }, + { + "code": "440781", + "name": "台山市" + }, + { + "code": "440783", + "name": "开平市" + }, + { + "code": "440784", + "name": "鹤山市" + }, + { + "code": "440785", + "name": "恩平市" + } + ] + }, + { + "code": "440800", + "name": "湛江市", + "area": [ + { + "code": "440802", + "name": "赤坎区" + }, + { + "code": "440803", + "name": "霞山区" + }, + { + "code": "440804", + "name": "坡头区" + }, + { + "code": "440811", + "name": "麻章区" + }, + { + "code": "440823", + "name": "遂溪县" + }, + { + "code": "440825", + "name": "徐闻县" + }, + { + "code": "440881", + "name": "廉江市" + }, + { + "code": "440882", + "name": "雷州市" + }, + { + "code": "440883", + "name": "吴川市" + } + ] + }, + { + "code": "440900", + "name": "茂名市", + "area": [ + { + "code": "440902", + "name": "茂南区" + }, + { + "code": "440904", + "name": "电白区" + }, + { + "code": "440981", + "name": "高州市" + }, + { + "code": "440982", + "name": "化州市" + }, + { + "code": "440983", + "name": "信宜市" + } + ] + }, + { + "code": "441200", + "name": "肇庆市", + "area": [ + { + "code": "441202", + "name": "端州区" + }, + { + "code": "441203", + "name": "鼎湖区" + }, + { + "code": "441204", + "name": "高要区" + }, + { + "code": "441223", + "name": "广宁县" + }, + { + "code": "441224", + "name": "怀集县" + }, + { + "code": "441225", + "name": "封开县" + }, + { + "code": "441226", + "name": "德庆县" + }, + { + "code": "441284", + "name": "四会市" + } + ] + }, + { + "code": "441300", + "name": "惠州市", + "area": [ + { + "code": "441302", + "name": "惠城区" + }, + { + "code": "441303", + "name": "惠阳区" + }, + { + "code": "441322", + "name": "博罗县" + }, + { + "code": "441323", + "name": "惠东县" + }, + { + "code": "441324", + "name": "龙门县" + } + ] + }, + { + "code": "441400", + "name": "梅州市", + "area": [ + { + "code": "441402", + "name": "梅江区" + }, + { + "code": "441403", + "name": "梅县区" + }, + { + "code": "441422", + "name": "大埔县" + }, + { + "code": "441423", + "name": "丰顺县" + }, + { + "code": "441424", + "name": "五华县" + }, + { + "code": "441426", + "name": "平远县" + }, + { + "code": "441427", + "name": "蕉岭县" + }, + { + "code": "441481", + "name": "兴宁市" + } + ] + }, + { + "code": "441500", + "name": "汕尾市", + "area": [ + { + "code": "441502", + "name": "城区" + }, + { + "code": "441521", + "name": "海丰县" + }, + { + "code": "441523", + "name": "陆河县" + }, + { + "code": "441581", + "name": "陆丰市" + } + ] + }, + { + "code": "441600", + "name": "河源市", + "area": [ + { + "code": "441602", + "name": "源城区" + }, + { + "code": "441621", + "name": "紫金县" + }, + { + "code": "441622", + "name": "龙川县" + }, + { + "code": "441623", + "name": "连平县" + }, + { + "code": "441624", + "name": "和平县" + }, + { + "code": "441625", + "name": "东源县" + } + ] + }, + { + "code": "441700", + "name": "阳江市", + "area": [ + { + "code": "441702", + "name": "江城区" + }, + { + "code": "441704", + "name": "阳东区" + }, + { + "code": "441721", + "name": "阳西县" + }, + { + "code": "441781", + "name": "阳春市" + } + ] + }, + { + "code": "441800", + "name": "清远市", + "area": [ + { + "code": "441802", + "name": "清城区" + }, + { + "code": "441803", + "name": "清新区" + }, + { + "code": "441821", + "name": "佛冈县" + }, + { + "code": "441823", + "name": "阳山县" + }, + { + "code": "441825", + "name": "连山壮族瑶族自治县" + }, + { + "code": "441826", + "name": "连南瑶族自治县" + }, + { + "code": "441881", + "name": "英德市" + }, + { + "code": "441882", + "name": "连州市" + } + ] + }, + { + "code": "441900", + "name": "东莞市", + "area": [] + }, + { + "code": "442000", + "name": "中山市", + "area": [] + }, + { + "code": "445100", + "name": "潮州市", + "area": [ + { + "code": "445102", + "name": "湘桥区" + }, + { + "code": "445103", + "name": "潮安区" + }, + { + "code": "445122", + "name": "饶平县" + } + ] + }, + { + "code": "445200", + "name": "揭阳市", + "area": [ + { + "code": "445202", + "name": "榕城区" + }, + { + "code": "445203", + "name": "揭东区" + }, + { + "code": "445222", + "name": "揭西县" + }, + { + "code": "445224", + "name": "惠来县" + }, + { + "code": "445281", + "name": "普宁市" + } + ] + }, + { + "code": "445300", + "name": "云浮市", + "area": [ + { + "code": "445302", + "name": "云城区" + }, + { + "code": "445303", + "name": "云安区" + }, + { + "code": "445321", + "name": "新兴县" + }, + { + "code": "445322", + "name": "郁南县" + }, + { + "code": "445381", + "name": "罗定市" + } + ] + } + ] + }, + { + "code": "450000", + "name": "广西壮族自治区", + "city": [ + { + "code": "450100", + "name": "南宁市", + "area": [ + { + "code": "450102", + "name": "兴宁区" + }, + { + "code": "450103", + "name": "青秀区" + }, + { + "code": "450105", + "name": "江南区" + }, + { + "code": "450107", + "name": "西乡塘区" + }, + { + "code": "450108", + "name": "良庆区" + }, + { + "code": "450109", + "name": "邕宁区" + }, + { + "code": "450110", + "name": "武鸣区" + }, + { + "code": "450123", + "name": "隆安县" + }, + { + "code": "450124", + "name": "马山县" + }, + { + "code": "450125", + "name": "上林县" + }, + { + "code": "450126", + "name": "宾阳县" + }, + { + "code": "450127", + "name": "横县" + } + ] + }, + { + "code": "450200", + "name": "柳州市", + "area": [ + { + "code": "450202", + "name": "城中区" + }, + { + "code": "450203", + "name": "鱼峰区" + }, + { + "code": "450204", + "name": "柳南区" + }, + { + "code": "450205", + "name": "柳北区" + }, + { + "code": "450206", + "name": "柳江区" + }, + { + "code": "450222", + "name": "柳城县" + }, + { + "code": "450223", + "name": "鹿寨县" + }, + { + "code": "450224", + "name": "融安县" + }, + { + "code": "450225", + "name": "融水苗族自治县" + }, + { + "code": "450226", + "name": "三江侗族自治县" + } + ] + }, + { + "code": "450300", + "name": "桂林市", + "area": [ + { + "code": "450302", + "name": "秀峰区" + }, + { + "code": "450303", + "name": "叠彩区" + }, + { + "code": "450304", + "name": "象山区" + }, + { + "code": "450305", + "name": "七星区" + }, + { + "code": "450311", + "name": "雁山区" + }, + { + "code": "450312", + "name": "临桂区" + }, + { + "code": "450321", + "name": "阳朔县" + }, + { + "code": "450323", + "name": "灵川县" + }, + { + "code": "450324", + "name": "全州县" + }, + { + "code": "450325", + "name": "兴安县" + }, + { + "code": "450326", + "name": "永福县" + }, + { + "code": "450327", + "name": "灌阳县" + }, + { + "code": "450328", + "name": "龙胜各族自治县" + }, + { + "code": "450329", + "name": "资源县" + }, + { + "code": "450330", + "name": "平乐县" + }, + { + "code": "450381", + "name": "荔浦市" + }, + { + "code": "450332", + "name": "恭城瑶族自治县" + } + ] + }, + { + "code": "450400", + "name": "梧州市", + "area": [ + { + "code": "450403", + "name": "万秀区" + }, + { + "code": "450405", + "name": "长洲区" + }, + { + "code": "450406", + "name": "龙圩区" + }, + { + "code": "450421", + "name": "苍梧县" + }, + { + "code": "450422", + "name": "藤县" + }, + { + "code": "450423", + "name": "蒙山县" + }, + { + "code": "450481", + "name": "岑溪市" + } + ] + }, + { + "code": "450500", + "name": "北海市", + "area": [ + { + "code": "450502", + "name": "海城区" + }, + { + "code": "450503", + "name": "银海区" + }, + { + "code": "450512", + "name": "铁山港区" + }, + { + "code": "450521", + "name": "合浦县" + } + ] + }, + { + "code": "450600", + "name": "防城港市", + "area": [ + { + "code": "450602", + "name": "港口区" + }, + { + "code": "450603", + "name": "防城区" + }, + { + "code": "450621", + "name": "上思县" + }, + { + "code": "450681", + "name": "东兴市" + } + ] + }, + { + "code": "450700", + "name": "钦州市", + "area": [ + { + "code": "450702", + "name": "钦南区" + }, + { + "code": "450703", + "name": "钦北区" + }, + { + "code": "450721", + "name": "灵山县" + }, + { + "code": "450722", + "name": "浦北县" + } + ] + }, + { + "code": "450800", + "name": "贵港市", + "area": [ + { + "code": "450802", + "name": "港北区" + }, + { + "code": "450803", + "name": "港南区" + }, + { + "code": "450804", + "name": "覃塘区" + }, + { + "code": "450821", + "name": "平南县" + }, + { + "code": "450881", + "name": "桂平市" + } + ] + }, + { + "code": "450900", + "name": "玉林市", + "area": [ + { + "code": "450902", + "name": "玉州区" + }, + { + "code": "450903", + "name": "福绵区" + }, + { + "code": "450921", + "name": "容县" + }, + { + "code": "450922", + "name": "陆川县" + }, + { + "code": "450923", + "name": "博白县" + }, + { + "code": "450924", + "name": "兴业县" + }, + { + "code": "450981", + "name": "北流市" + } + ] + }, + { + "code": "451000", + "name": "百色市", + "area": [ + { + "code": "451002", + "name": "右江区" + }, + { + "code": "451003", + "name": "田阳区" + }, + { + "code": "451022", + "name": "田东县" + }, + { + "code": "451024", + "name": "德保县" + }, + { + "code": "451026", + "name": "那坡县" + }, + { + "code": "451027", + "name": "凌云县" + }, + { + "code": "451028", + "name": "乐业县" + }, + { + "code": "451029", + "name": "田林县" + }, + { + "code": "451030", + "name": "西林县" + }, + { + "code": "451031", + "name": "隆林各族自治县" + }, + { + "code": "451081", + "name": "靖西市" + }, + { + "code": "451082", + "name": "平果市" + } + ] + }, + { + "code": "451100", + "name": "贺州市", + "area": [ + { + "code": "451102", + "name": "八步区" + }, + { + "code": "451103", + "name": "平桂区" + }, + { + "code": "451121", + "name": "昭平县" + }, + { + "code": "451122", + "name": "钟山县" + }, + { + "code": "451123", + "name": "富川瑶族自治县" + } + ] + }, + { + "code": "451200", + "name": "河池市", + "area": [ + { + "code": "451202", + "name": "金城江区" + }, + { + "code": "451203", + "name": "宜州区" + }, + { + "code": "451221", + "name": "南丹县" + }, + { + "code": "451222", + "name": "天峨县" + }, + { + "code": "451223", + "name": "凤山县" + }, + { + "code": "451224", + "name": "东兰县" + }, + { + "code": "451225", + "name": "罗城仫佬族自治县" + }, + { + "code": "451226", + "name": "环江毛南族自治县" + }, + { + "code": "451227", + "name": "巴马瑶族自治县" + }, + { + "code": "451228", + "name": "都安瑶族自治县" + }, + { + "code": "451229", + "name": "大化瑶族自治县" + } + ] + }, + { + "code": "451300", + "name": "来宾市", + "area": [ + { + "code": "451302", + "name": "兴宾区" + }, + { + "code": "451321", + "name": "忻城县" + }, + { + "code": "451322", + "name": "象州县" + }, + { + "code": "451323", + "name": "武宣县" + }, + { + "code": "451324", + "name": "金秀瑶族自治县" + }, + { + "code": "451381", + "name": "合山市" + } + ] + }, + { + "code": "451400", + "name": "崇左市", + "area": [ + { + "code": "451402", + "name": "江州区" + }, + { + "code": "451421", + "name": "扶绥县" + }, + { + "code": "451422", + "name": "宁明县" + }, + { + "code": "451423", + "name": "龙州县" + }, + { + "code": "451424", + "name": "大新县" + }, + { + "code": "451425", + "name": "天等县" + }, + { + "code": "451481", + "name": "凭祥市" + } + ] + } + ] + }, + { + "code": "460000", + "name": "海南省", + "city": [ + { + "code": "460100", + "name": "海口市", + "area": [ + { + "code": "460105", + "name": "秀英区" + }, + { + "code": "460106", + "name": "龙华区" + }, + { + "code": "460107", + "name": "琼山区" + }, + { + "code": "460108", + "name": "美兰区" + } + ] + }, + { + "code": "460200", + "name": "三亚市", + "area": [ + { + "code": "460202", + "name": "海棠区" + }, + { + "code": "460203", + "name": "吉阳区" + }, + { + "code": "460204", + "name": "天涯区" + }, + { + "code": "460205", + "name": "崖州区" + } + ] + }, + { + "code": "460300", + "name": "三沙市", + "area": [] + }, + { + "code": "460400", + "name": "儋州市", + "area": [] + }, + { + "code": "469001", + "name": "五指山市", + "area": [] + }, + { + "code": "469002", + "name": "琼海市", + "area": [] + }, + { + "code": "469005", + "name": "文昌市", + "area": [] + }, + { + "code": "469006", + "name": "万宁市", + "area": [] + }, + { + "code": "469007", + "name": "东方市", + "area": [] + }, + { + "code": "469021", + "name": "定安县", + "area": [] + }, + { + "code": "469022", + "name": "屯昌县", + "area": [] + }, + { + "code": "469023", + "name": "澄迈县", + "area": [] + }, + { + "code": "469024", + "name": "临高县", + "area": [] + }, + { + "code": "469025", + "name": "白沙黎族自治县", + "area": [] + }, + { + "code": "469026", + "name": "昌江黎族自治县", + "area": [] + }, + { + "code": "469027", + "name": "乐东黎族自治县", + "area": [] + }, + { + "code": "469028", + "name": "陵水黎族自治县", + "area": [] + }, + { + "code": "469029", + "name": "保亭黎族苗族自治县", + "area": [] + }, + { + "code": "469030", + "name": "琼中黎族苗族自治县", + "area": [] + } + ] + }, + { + "code": "500000", + "name": "重庆市", + "city": [ + { + "code": "500000", + "name": "重庆市", + "area": [ + { + "code": "500101", + "name": "万州区" + }, + { + "code": "500102", + "name": "涪陵区" + }, + { + "code": "500103", + "name": "渝中区" + }, + { + "code": "500104", + "name": "大渡口区" + }, + { + "code": "500105", + "name": "江北区" + }, + { + "code": "500106", + "name": "沙坪坝区" + }, + { + "code": "500107", + "name": "九龙坡区" + }, + { + "code": "500108", + "name": "南岸区" + }, + { + "code": "500109", + "name": "北碚区" + }, + { + "code": "500110", + "name": "綦江区" + }, + { + "code": "500111", + "name": "大足区" + }, + { + "code": "500112", + "name": "渝北区" + }, + { + "code": "500113", + "name": "巴南区" + }, + { + "code": "500114", + "name": "黔江区" + }, + { + "code": "500115", + "name": "长寿区" + }, + { + "code": "500116", + "name": "江津区" + }, + { + "code": "500117", + "name": "合川区" + }, + { + "code": "500118", + "name": "永川区" + }, + { + "code": "500119", + "name": "南川区" + }, + { + "code": "500120", + "name": "璧山区" + }, + { + "code": "500151", + "name": "铜梁区" + }, + { + "code": "500152", + "name": "潼南区" + }, + { + "code": "500153", + "name": "荣昌区" + }, + { + "code": "500154", + "name": "开州区" + }, + { + "code": "500155", + "name": "梁平区" + }, + { + "code": "500156", + "name": "武隆区" + }, + { + "code": "500229", + "name": "城口县" + }, + { + "code": "500230", + "name": "丰都县" + }, + { + "code": "500231", + "name": "垫江县" + }, + { + "code": "500233", + "name": "忠县" + }, + { + "code": "500235", + "name": "云阳县" + }, + { + "code": "500236", + "name": "奉节县" + }, + { + "code": "500237", + "name": "巫山县" + }, + { + "code": "500238", + "name": "巫溪县" + }, + { + "code": "500240", + "name": "石柱土家族自治县" + }, + { + "code": "500241", + "name": "秀山土家族苗族自治县" + }, + { + "code": "500242", + "name": "酉阳土家族苗族自治县" + }, + { + "code": "500243", + "name": "彭水苗族土家族自治县" + } + ] + } + ] + }, + { + "code": "510000", + "name": "四川省", + "city": [ + { + "code": "510100", + "name": "成都市", + "area": [ + { + "code": "510104", + "name": "锦江区" + }, + { + "code": "510105", + "name": "青羊区" + }, + { + "code": "510106", + "name": "金牛区" + }, + { + "code": "510107", + "name": "武侯区" + }, + { + "code": "510108", + "name": "成华区" + }, + { + "code": "510112", + "name": "龙泉驿区" + }, + { + "code": "510113", + "name": "青白江区" + }, + { + "code": "510114", + "name": "新都区" + }, + { + "code": "510115", + "name": "温江区" + }, + { + "code": "510116", + "name": "双流区" + }, + { + "code": "510117", + "name": "郫都区" + }, + { + "code": "510118", + "name": "新津区" + }, + { + "code": "510121", + "name": "金堂县" + }, + { + "code": "510129", + "name": "大邑县" + }, + { + "code": "510131", + "name": "蒲江县" + }, + { + "code": "510181", + "name": "都江堰市" + }, + { + "code": "510182", + "name": "彭州市" + }, + { + "code": "510183", + "name": "邛崃市" + }, + { + "code": "510184", + "name": "崇州市" + }, + { + "code": "510185", + "name": "简阳市" + } + ] + }, + { + "code": "510300", + "name": "自贡市", + "area": [ + { + "code": "510302", + "name": "自流井区" + }, + { + "code": "510303", + "name": "贡井区" + }, + { + "code": "510304", + "name": "大安区" + }, + { + "code": "510311", + "name": "沿滩区" + }, + { + "code": "510321", + "name": "荣县" + }, + { + "code": "510322", + "name": "富顺县" + } + ] + }, + { + "code": "510400", + "name": "攀枝花市", + "area": [ + { + "code": "510402", + "name": "东区" + }, + { + "code": "510403", + "name": "西区" + }, + { + "code": "510411", + "name": "仁和区" + }, + { + "code": "510421", + "name": "米易县" + }, + { + "code": "510422", + "name": "盐边县" + } + ] + }, + { + "code": "510500", + "name": "泸州市", + "area": [ + { + "code": "510502", + "name": "江阳区" + }, + { + "code": "510503", + "name": "纳溪区" + }, + { + "code": "510504", + "name": "龙马潭区" + }, + { + "code": "510521", + "name": "泸县" + }, + { + "code": "510522", + "name": "合江县" + }, + { + "code": "510524", + "name": "叙永县" + }, + { + "code": "510525", + "name": "古蔺县" + } + ] + }, + { + "code": "510600", + "name": "德阳市", + "area": [ + { + "code": "510603", + "name": "旌阳区" + }, + { + "code": "510604", + "name": "罗江区" + }, + { + "code": "510623", + "name": "中江县" + }, + { + "code": "510681", + "name": "广汉市" + }, + { + "code": "510682", + "name": "什邡市" + }, + { + "code": "510683", + "name": "绵竹市" + } + ] + }, + { + "code": "510700", + "name": "绵阳市", + "area": [ + { + "code": "510703", + "name": "涪城区" + }, + { + "code": "510704", + "name": "游仙区" + }, + { + "code": "510705", + "name": "安州区" + }, + { + "code": "510722", + "name": "三台县" + }, + { + "code": "510723", + "name": "盐亭县" + }, + { + "code": "510725", + "name": "梓潼县" + }, + { + "code": "510726", + "name": "北川羌族自治县" + }, + { + "code": "510727", + "name": "平武县" + }, + { + "code": "510781", + "name": "江油市" + } + ] + }, + { + "code": "510800", + "name": "广元市", + "area": [ + { + "code": "510802", + "name": "利州区" + }, + { + "code": "510811", + "name": "昭化区" + }, + { + "code": "510812", + "name": "朝天区" + }, + { + "code": "510821", + "name": "旺苍县" + }, + { + "code": "510822", + "name": "青川县" + }, + { + "code": "510823", + "name": "剑阁县" + }, + { + "code": "510824", + "name": "苍溪县" + } + ] + }, + { + "code": "510900", + "name": "遂宁市", + "area": [ + { + "code": "510903", + "name": "船山区" + }, + { + "code": "510904", + "name": "安居区" + }, + { + "code": "510921", + "name": "蓬溪县" + }, + { + "code": "510923", + "name": "大英县" + }, + { + "code": "510981", + "name": "射洪市" + } + ] + }, + { + "code": "511000", + "name": "内江市", + "area": [ + { + "code": "511002", + "name": "市中区" + }, + { + "code": "511011", + "name": "东兴区" + }, + { + "code": "511024", + "name": "威远县" + }, + { + "code": "511025", + "name": "资中县" + }, + { + "code": "511083", + "name": "隆昌市" + } + ] + }, + { + "code": "511100", + "name": "乐山市", + "area": [ + { + "code": "511102", + "name": "市中区" + }, + { + "code": "511111", + "name": "沙湾区" + }, + { + "code": "511112", + "name": "五通桥区" + }, + { + "code": "511113", + "name": "金口河区" + }, + { + "code": "511123", + "name": "犍为县" + }, + { + "code": "511124", + "name": "井研县" + }, + { + "code": "511126", + "name": "夹江县" + }, + { + "code": "511129", + "name": "沐川县" + }, + { + "code": "511132", + "name": "峨边彝族自治县" + }, + { + "code": "511133", + "name": "马边彝族自治县" + }, + { + "code": "511181", + "name": "峨眉山市" + } + ] + }, + { + "code": "511300", + "name": "南充市", + "area": [ + { + "code": "511302", + "name": "顺庆区" + }, + { + "code": "511303", + "name": "高坪区" + }, + { + "code": "511304", + "name": "嘉陵区" + }, + { + "code": "511321", + "name": "南部县" + }, + { + "code": "511322", + "name": "营山县" + }, + { + "code": "511323", + "name": "蓬安县" + }, + { + "code": "511324", + "name": "仪陇县" + }, + { + "code": "511325", + "name": "西充县" + }, + { + "code": "511381", + "name": "阆中市" + } + ] + }, + { + "code": "511400", + "name": "眉山市", + "area": [ + { + "code": "511402", + "name": "东坡区" + }, + { + "code": "511403", + "name": "彭山区" + }, + { + "code": "511421", + "name": "仁寿县" + }, + { + "code": "511423", + "name": "洪雅县" + }, + { + "code": "511424", + "name": "丹棱县" + }, + { + "code": "511425", + "name": "青神县" + } + ] + }, + { + "code": "511500", + "name": "宜宾市", + "area": [ + { + "code": "511502", + "name": "翠屏区" + }, + { + "code": "511503", + "name": "南溪区" + }, + { + "code": "511504", + "name": "叙州区" + }, + { + "code": "511523", + "name": "江安县" + }, + { + "code": "511524", + "name": "长宁县" + }, + { + "code": "511525", + "name": "高县" + }, + { + "code": "511526", + "name": "珙县" + }, + { + "code": "511527", + "name": "筠连县" + }, + { + "code": "511528", + "name": "兴文县" + }, + { + "code": "511529", + "name": "屏山县" + } + ] + }, + { + "code": "511600", + "name": "广安市", + "area": [ + { + "code": "511602", + "name": "广安区" + }, + { + "code": "511603", + "name": "前锋区" + }, + { + "code": "511621", + "name": "岳池县" + }, + { + "code": "511622", + "name": "武胜县" + }, + { + "code": "511623", + "name": "邻水县" + }, + { + "code": "511681", + "name": "华蓥市" + } + ] + }, + { + "code": "511700", + "name": "达州市", + "area": [ + { + "code": "511702", + "name": "通川区" + }, + { + "code": "511703", + "name": "达川区" + }, + { + "code": "511722", + "name": "宣汉县" + }, + { + "code": "511723", + "name": "开江县" + }, + { + "code": "511724", + "name": "大竹县" + }, + { + "code": "511725", + "name": "渠县" + }, + { + "code": "511781", + "name": "万源市" + } + ] + }, + { + "code": "511800", + "name": "雅安市", + "area": [ + { + "code": "511802", + "name": "雨城区" + }, + { + "code": "511803", + "name": "名山区" + }, + { + "code": "511822", + "name": "荥经县" + }, + { + "code": "511823", + "name": "汉源县" + }, + { + "code": "511824", + "name": "石棉县" + }, + { + "code": "511825", + "name": "天全县" + }, + { + "code": "511826", + "name": "芦山县" + }, + { + "code": "511827", + "name": "宝兴县" + } + ] + }, + { + "code": "511900", + "name": "巴中市", + "area": [ + { + "code": "511902", + "name": "巴州区" + }, + { + "code": "511903", + "name": "恩阳区" + }, + { + "code": "511921", + "name": "通江县" + }, + { + "code": "511922", + "name": "南江县" + }, + { + "code": "511923", + "name": "平昌县" + } + ] + }, + { + "code": "512000", + "name": "资阳市", + "area": [ + { + "code": "512002", + "name": "雁江区" + }, + { + "code": "512021", + "name": "安岳县" + }, + { + "code": "512022", + "name": "乐至县" + } + ] + }, + { + "code": "513200", + "name": "阿坝藏族羌族自治州", + "area": [ + { + "code": "513201", + "name": "马尔康市" + }, + { + "code": "513221", + "name": "汶川县" + }, + { + "code": "513222", + "name": "理县" + }, + { + "code": "513223", + "name": "茂县" + }, + { + "code": "513224", + "name": "松潘县" + }, + { + "code": "513225", + "name": "九寨沟县" + }, + { + "code": "513226", + "name": "金川县" + }, + { + "code": "513227", + "name": "小金县" + }, + { + "code": "513228", + "name": "黑水县" + }, + { + "code": "513230", + "name": "壤塘县" + }, + { + "code": "513231", + "name": "阿坝县" + }, + { + "code": "513232", + "name": "若尔盖县" + }, + { + "code": "513233", + "name": "红原县" + } + ] + }, + { + "code": "513300", + "name": "甘孜藏族自治州", + "area": [ + { + "code": "513301", + "name": "康定市" + }, + { + "code": "513322", + "name": "泸定县" + }, + { + "code": "513323", + "name": "丹巴县" + }, + { + "code": "513324", + "name": "九龙县" + }, + { + "code": "513325", + "name": "雅江县" + }, + { + "code": "513326", + "name": "道孚县" + }, + { + "code": "513327", + "name": "炉霍县" + }, + { + "code": "513328", + "name": "甘孜县" + }, + { + "code": "513329", + "name": "新龙县" + }, + { + "code": "513330", + "name": "德格县" + }, + { + "code": "513331", + "name": "白玉县" + }, + { + "code": "513332", + "name": "石渠县" + }, + { + "code": "513333", + "name": "色达县" + }, + { + "code": "513334", + "name": "理塘县" + }, + { + "code": "513335", + "name": "巴塘县" + }, + { + "code": "513336", + "name": "乡城县" + }, + { + "code": "513337", + "name": "稻城县" + }, + { + "code": "513338", + "name": "得荣县" + } + ] + }, + { + "code": "513400", + "name": "凉山彝族自治州", + "area": [ + { + "code": "513401", + "name": "西昌市" + }, + { + "code": "513422", + "name": "木里藏族自治县" + }, + { + "code": "513423", + "name": "盐源县" + }, + { + "code": "513424", + "name": "德昌县" + }, + { + "code": "513425", + "name": "会理县" + }, + { + "code": "513426", + "name": "会东县" + }, + { + "code": "513427", + "name": "宁南县" + }, + { + "code": "513428", + "name": "普格县" + }, + { + "code": "513429", + "name": "布拖县" + }, + { + "code": "513430", + "name": "金阳县" + }, + { + "code": "513431", + "name": "昭觉县" + }, + { + "code": "513432", + "name": "喜德县" + }, + { + "code": "513433", + "name": "冕宁县" + }, + { + "code": "513434", + "name": "越西县" + }, + { + "code": "513435", + "name": "甘洛县" + }, + { + "code": "513436", + "name": "美姑县" + }, + { + "code": "513437", + "name": "雷波县" + } + ] + } + ] + }, + { + "code": "520000", + "name": "贵州省", + "city": [ + { + "code": "520100", + "name": "贵阳市", + "area": [ + { + "code": "520102", + "name": "南明区" + }, + { + "code": "520103", + "name": "云岩区" + }, + { + "code": "520111", + "name": "花溪区" + }, + { + "code": "520112", + "name": "乌当区" + }, + { + "code": "520113", + "name": "白云区" + }, + { + "code": "520115", + "name": "观山湖区" + }, + { + "code": "520121", + "name": "开阳县" + }, + { + "code": "520122", + "name": "息烽县" + }, + { + "code": "520123", + "name": "修文县" + }, + { + "code": "520181", + "name": "清镇市" + } + ] + }, + { + "code": "520200", + "name": "六盘水市", + "area": [ + { + "code": "520201", + "name": "钟山区" + }, + { + "code": "520203", + "name": "六枝特区" + }, + { + "code": "520221", + "name": "水城县" + }, + { + "code": "520281", + "name": "盘州市" + } + ] + }, + { + "code": "520300", + "name": "遵义市", + "area": [ + { + "code": "520302", + "name": "红花岗区" + }, + { + "code": "520303", + "name": "汇川区" + }, + { + "code": "520304", + "name": "播州区" + }, + { + "code": "520322", + "name": "桐梓县" + }, + { + "code": "520323", + "name": "绥阳县" + }, + { + "code": "520324", + "name": "正安县" + }, + { + "code": "520325", + "name": "道真仡佬族苗族自治县" + }, + { + "code": "520326", + "name": "务川仡佬族苗族自治县" + }, + { + "code": "520327", + "name": "凤冈县" + }, + { + "code": "520328", + "name": "湄潭县" + }, + { + "code": "520329", + "name": "余庆县" + }, + { + "code": "520330", + "name": "习水县" + }, + { + "code": "520381", + "name": "赤水市" + }, + { + "code": "520382", + "name": "仁怀市" + } + ] + }, + { + "code": "520400", + "name": "安顺市", + "area": [ + { + "code": "520402", + "name": "西秀区" + }, + { + "code": "520403", + "name": "平坝区" + }, + { + "code": "520422", + "name": "普定县" + }, + { + "code": "520423", + "name": "镇宁布依族苗族自治县" + }, + { + "code": "520424", + "name": "关岭布依族苗族自治县" + }, + { + "code": "520425", + "name": "紫云苗族布依族自治县" + } + ] + }, + { + "code": "520500", + "name": "毕节市", + "area": [ + { + "code": "520502", + "name": "七星关区" + }, + { + "code": "520521", + "name": "大方县" + }, + { + "code": "520522", + "name": "黔西县" + }, + { + "code": "520523", + "name": "金沙县" + }, + { + "code": "520524", + "name": "织金县" + }, + { + "code": "520525", + "name": "纳雍县" + }, + { + "code": "520526", + "name": "威宁彝族回族苗族自治县" + }, + { + "code": "520527", + "name": "赫章县" + } + ] + }, + { + "code": "520600", + "name": "铜仁市", + "area": [ + { + "code": "520602", + "name": "碧江区" + }, + { + "code": "520603", + "name": "万山区" + }, + { + "code": "520621", + "name": "江口县" + }, + { + "code": "520622", + "name": "玉屏侗族自治县" + }, + { + "code": "520623", + "name": "石阡县" + }, + { + "code": "520624", + "name": "思南县" + }, + { + "code": "520625", + "name": "印江土家族苗族自治县" + }, + { + "code": "520626", + "name": "德江县" + }, + { + "code": "520627", + "name": "沿河土家族自治县" + }, + { + "code": "520628", + "name": "松桃苗族自治县" + } + ] + }, + { + "code": "522300", + "name": "黔西南布依族苗族自治州", + "area": [ + { + "code": "522301", + "name": "兴义市" + }, + { + "code": "522302", + "name": "兴仁市" + }, + { + "code": "522323", + "name": "普安县" + }, + { + "code": "522324", + "name": "晴隆县" + }, + { + "code": "522325", + "name": "贞丰县" + }, + { + "code": "522326", + "name": "望谟县" + }, + { + "code": "522327", + "name": "册亨县" + }, + { + "code": "522328", + "name": "安龙县" + } + ] + }, + { + "code": "522600", + "name": "黔东南苗族侗族自治州", + "area": [ + { + "code": "522601", + "name": "凯里市" + }, + { + "code": "522622", + "name": "黄平县" + }, + { + "code": "522623", + "name": "施秉县" + }, + { + "code": "522624", + "name": "三穗县" + }, + { + "code": "522625", + "name": "镇远县" + }, + { + "code": "522626", + "name": "岑巩县" + }, + { + "code": "522627", + "name": "天柱县" + }, + { + "code": "522628", + "name": "锦屏县" + }, + { + "code": "522629", + "name": "剑河县" + }, + { + "code": "522630", + "name": "台江县" + }, + { + "code": "522631", + "name": "黎平县" + }, + { + "code": "522632", + "name": "榕江县" + }, + { + "code": "522633", + "name": "从江县" + }, + { + "code": "522634", + "name": "雷山县" + }, + { + "code": "522635", + "name": "麻江县" + }, + { + "code": "522636", + "name": "丹寨县" + } + ] + }, + { + "code": "522700", + "name": "黔南布依族苗族自治州", + "area": [ + { + "code": "522701", + "name": "都匀市" + }, + { + "code": "522702", + "name": "福泉市" + }, + { + "code": "522722", + "name": "荔波县" + }, + { + "code": "522723", + "name": "贵定县" + }, + { + "code": "522725", + "name": "瓮安县" + }, + { + "code": "522726", + "name": "独山县" + }, + { + "code": "522727", + "name": "平塘县" + }, + { + "code": "522728", + "name": "罗甸县" + }, + { + "code": "522729", + "name": "长顺县" + }, + { + "code": "522730", + "name": "龙里县" + }, + { + "code": "522731", + "name": "惠水县" + }, + { + "code": "522732", + "name": "三都水族自治县" + } + ] + } + ] + }, + { + "code": "530000", + "name": "云南省", + "city": [ + { + "code": "530100", + "name": "昆明市", + "area": [ + { + "code": "530102", + "name": "五华区" + }, + { + "code": "530103", + "name": "盘龙区" + }, + { + "code": "530111", + "name": "官渡区" + }, + { + "code": "530112", + "name": "西山区" + }, + { + "code": "530113", + "name": "东川区" + }, + { + "code": "530114", + "name": "呈贡区" + }, + { + "code": "530115", + "name": "晋宁区" + }, + { + "code": "530124", + "name": "富民县" + }, + { + "code": "530125", + "name": "宜良县" + }, + { + "code": "530126", + "name": "石林彝族自治县" + }, + { + "code": "530127", + "name": "嵩明县" + }, + { + "code": "530128", + "name": "禄劝彝族苗族自治县" + }, + { + "code": "530129", + "name": "寻甸回族彝族自治县" + }, + { + "code": "530181", + "name": "安宁市" + } + ] + }, + { + "code": "530300", + "name": "曲靖市", + "area": [ + { + "code": "530302", + "name": "麒麟区" + }, + { + "code": "530303", + "name": "沾益区" + }, + { + "code": "530304", + "name": "马龙区" + }, + { + "code": "530322", + "name": "陆良县" + }, + { + "code": "530323", + "name": "师宗县" + }, + { + "code": "530324", + "name": "罗平县" + }, + { + "code": "530325", + "name": "富源县" + }, + { + "code": "530326", + "name": "会泽县" + }, + { + "code": "530381", + "name": "宣威市" + } + ] + }, + { + "code": "530400", + "name": "玉溪市", + "area": [ + { + "code": "530402", + "name": "红塔区" + }, + { + "code": "530403", + "name": "江川区" + }, + { + "code": "530423", + "name": "通海县" + }, + { + "code": "530424", + "name": "华宁县" + }, + { + "code": "530425", + "name": "易门县" + }, + { + "code": "530426", + "name": "峨山彝族自治县" + }, + { + "code": "530427", + "name": "新平彝族傣族自治县" + }, + { + "code": "530428", + "name": "元江哈尼族彝族傣族自治县" + }, + { + "code": "530481", + "name": "澄江市" + } + ] + }, + { + "code": "530500", + "name": "保山市", + "area": [ + { + "code": "530502", + "name": "隆阳区" + }, + { + "code": "530521", + "name": "施甸县" + }, + { + "code": "530523", + "name": "龙陵县" + }, + { + "code": "530524", + "name": "昌宁县" + }, + { + "code": "530581", + "name": "腾冲市" + } + ] + }, + { + "code": "530600", + "name": "昭通市", + "area": [ + { + "code": "530602", + "name": "昭阳区" + }, + { + "code": "530621", + "name": "鲁甸县" + }, + { + "code": "530622", + "name": "巧家县" + }, + { + "code": "530623", + "name": "盐津县" + }, + { + "code": "530624", + "name": "大关县" + }, + { + "code": "530625", + "name": "永善县" + }, + { + "code": "530626", + "name": "绥江县" + }, + { + "code": "530627", + "name": "镇雄县" + }, + { + "code": "530628", + "name": "彝良县" + }, + { + "code": "530629", + "name": "威信县" + }, + { + "code": "530681", + "name": "水富市" + } + ] + }, + { + "code": "530700", + "name": "丽江市", + "area": [ + { + "code": "530702", + "name": "古城区" + }, + { + "code": "530721", + "name": "玉龙纳西族自治县" + }, + { + "code": "530722", + "name": "永胜县" + }, + { + "code": "530723", + "name": "华坪县" + }, + { + "code": "530724", + "name": "宁蒗彝族自治县" + } + ] + }, + { + "code": "530800", + "name": "普洱市", + "area": [ + { + "code": "530802", + "name": "思茅区" + }, + { + "code": "530821", + "name": "宁洱哈尼族彝族自治县" + }, + { + "code": "530822", + "name": "墨江哈尼族自治县" + }, + { + "code": "530823", + "name": "景东彝族自治县" + }, + { + "code": "530824", + "name": "景谷傣族彝族自治县" + }, + { + "code": "530825", + "name": "镇沅彝族哈尼族拉祜族自治县" + }, + { + "code": "530826", + "name": "江城哈尼族彝族自治县" + }, + { + "code": "530827", + "name": "孟连傣族拉祜族佤族自治县" + }, + { + "code": "530828", + "name": "澜沧拉祜族自治县" + }, + { + "code": "530829", + "name": "西盟佤族自治县" + } + ] + }, + { + "code": "530900", + "name": "临沧市", + "area": [ + { + "code": "530902", + "name": "临翔区" + }, + { + "code": "530921", + "name": "凤庆县" + }, + { + "code": "530922", + "name": "云县" + }, + { + "code": "530923", + "name": "永德县" + }, + { + "code": "530924", + "name": "镇康县" + }, + { + "code": "530925", + "name": "双江拉祜族佤族布朗族傣族自治县" + }, + { + "code": "530926", + "name": "耿马傣族佤族自治县" + }, + { + "code": "530927", + "name": "沧源佤族自治县" + } + ] + }, + { + "code": "532300", + "name": "楚雄彝族自治州", + "area": [ + { + "code": "532301", + "name": "楚雄市" + }, + { + "code": "532322", + "name": "双柏县" + }, + { + "code": "532323", + "name": "牟定县" + }, + { + "code": "532324", + "name": "南华县" + }, + { + "code": "532325", + "name": "姚安县" + }, + { + "code": "532326", + "name": "大姚县" + }, + { + "code": "532327", + "name": "永仁县" + }, + { + "code": "532328", + "name": "元谋县" + }, + { + "code": "532329", + "name": "武定县" + }, + { + "code": "532331", + "name": "禄丰县" + } + ] + }, + { + "code": "532500", + "name": "红河哈尼族彝族自治州", + "area": [ + { + "code": "532501", + "name": "个旧市" + }, + { + "code": "532502", + "name": "开远市" + }, + { + "code": "532503", + "name": "蒙自市" + }, + { + "code": "532504", + "name": "弥勒市" + }, + { + "code": "532523", + "name": "屏边苗族自治县" + }, + { + "code": "532524", + "name": "建水县" + }, + { + "code": "532525", + "name": "石屏县" + }, + { + "code": "532527", + "name": "泸西县" + }, + { + "code": "532528", + "name": "元阳县" + }, + { + "code": "532529", + "name": "红河县" + }, + { + "code": "532530", + "name": "金平苗族瑶族傣族自治县" + }, + { + "code": "532531", + "name": "绿春县" + }, + { + "code": "532532", + "name": "河口瑶族自治县" + } + ] + }, + { + "code": "532600", + "name": "文山壮族苗族自治州", + "area": [ + { + "code": "532601", + "name": "文山市" + }, + { + "code": "532622", + "name": "砚山县" + }, + { + "code": "532623", + "name": "西畴县" + }, + { + "code": "532624", + "name": "麻栗坡县" + }, + { + "code": "532625", + "name": "马关县" + }, + { + "code": "532626", + "name": "丘北县" + }, + { + "code": "532627", + "name": "广南县" + }, + { + "code": "532628", + "name": "富宁县" + } + ] + }, + { + "code": "532800", + "name": "西双版纳傣族自治州", + "area": [ + { + "code": "532801", + "name": "景洪市" + }, + { + "code": "532822", + "name": "勐海县" + }, + { + "code": "532823", + "name": "勐腊县" + } + ] + }, + { + "code": "532900", + "name": "大理白族自治州", + "area": [ + { + "code": "532901", + "name": "大理市" + }, + { + "code": "532922", + "name": "漾濞彝族自治县" + }, + { + "code": "532923", + "name": "祥云县" + }, + { + "code": "532924", + "name": "宾川县" + }, + { + "code": "532925", + "name": "弥渡县" + }, + { + "code": "532926", + "name": "南涧彝族自治县" + }, + { + "code": "532927", + "name": "巍山彝族回族自治县" + }, + { + "code": "532928", + "name": "永平县" + }, + { + "code": "532929", + "name": "云龙县" + }, + { + "code": "532930", + "name": "洱源县" + }, + { + "code": "532931", + "name": "剑川县" + }, + { + "code": "532932", + "name": "鹤庆县" + } + ] + }, + { + "code": "533100", + "name": "德宏傣族景颇族自治州", + "area": [ + { + "code": "533102", + "name": "瑞丽市" + }, + { + "code": "533103", + "name": "芒市" + }, + { + "code": "533122", + "name": "梁河县" + }, + { + "code": "533123", + "name": "盈江县" + }, + { + "code": "533124", + "name": "陇川县" + } + ] + }, + { + "code": "533300", + "name": "怒江傈僳族自治州", + "area": [ + { + "code": "533301", + "name": "泸水市" + }, + { + "code": "533323", + "name": "福贡县" + }, + { + "code": "533324", + "name": "贡山独龙族怒族自治县" + }, + { + "code": "533325", + "name": "兰坪白族普米族自治县" + } + ] + }, + { + "code": "533400", + "name": "迪庆藏族自治州", + "area": [ + { + "code": "533401", + "name": "香格里拉市" + }, + { + "code": "533422", + "name": "德钦县" + }, + { + "code": "533423", + "name": "维西傈僳族自治县" + } + ] + } + ] + }, + { + "code": "540000", + "name": "西藏自治区", + "city": [ + { + "code": "540100", + "name": "拉萨市", + "area": [ + { + "code": "540102", + "name": "城关区" + }, + { + "code": "540103", + "name": "堆龙德庆区" + }, + { + "code": "540104", + "name": "达孜区" + }, + { + "code": "540121", + "name": "林周县" + }, + { + "code": "540122", + "name": "当雄县" + }, + { + "code": "540123", + "name": "尼木县" + }, + { + "code": "540124", + "name": "曲水县" + }, + { + "code": "540127", + "name": "墨竹工卡县" + } + ] + }, + { + "code": "540200", + "name": "日喀则市", + "area": [ + { + "code": "540202", + "name": "桑珠孜区" + }, + { + "code": "540221", + "name": "南木林县" + }, + { + "code": "540222", + "name": "江孜县" + }, + { + "code": "540223", + "name": "定日县" + }, + { + "code": "540224", + "name": "萨迦县" + }, + { + "code": "540225", + "name": "拉孜县" + }, + { + "code": "540226", + "name": "昂仁县" + }, + { + "code": "540227", + "name": "谢通门县" + }, + { + "code": "540228", + "name": "白朗县" + }, + { + "code": "540229", + "name": "仁布县" + }, + { + "code": "540230", + "name": "康马县" + }, + { + "code": "540231", + "name": "定结县" + }, + { + "code": "540232", + "name": "仲巴县" + }, + { + "code": "540233", + "name": "亚东县" + }, + { + "code": "540234", + "name": "吉隆县" + }, + { + "code": "540235", + "name": "聂拉木县" + }, + { + "code": "540236", + "name": "萨嘎县" + }, + { + "code": "540237", + "name": "岗巴县" + } + ] + }, + { + "code": "540300", + "name": "昌都市", + "area": [ + { + "code": "540302", + "name": "卡若区" + }, + { + "code": "540321", + "name": "江达县" + }, + { + "code": "540322", + "name": "贡觉县" + }, + { + "code": "540323", + "name": "类乌齐县" + }, + { + "code": "540324", + "name": "丁青县" + }, + { + "code": "540325", + "name": "察雅县" + }, + { + "code": "540326", + "name": "八宿县" + }, + { + "code": "540327", + "name": "左贡县" + }, + { + "code": "540328", + "name": "芒康县" + }, + { + "code": "540329", + "name": "洛隆县" + }, + { + "code": "540330", + "name": "边坝县" + } + ] + }, + { + "code": "540400", + "name": "林芝市", + "area": [ + { + "code": "540402", + "name": "巴宜区" + }, + { + "code": "540421", + "name": "工布江达县" + }, + { + "code": "540422", + "name": "米林县" + }, + { + "code": "540423", + "name": "墨脱县" + }, + { + "code": "540424", + "name": "波密县" + }, + { + "code": "540425", + "name": "察隅县" + }, + { + "code": "540426", + "name": "朗县" + } + ] + }, + { + "code": "540500", + "name": "山南市", + "area": [ + { + "code": "540502", + "name": "乃东区" + }, + { + "code": "540521", + "name": "扎囊县" + }, + { + "code": "540522", + "name": "贡嘎县" + }, + { + "code": "540523", + "name": "桑日县" + }, + { + "code": "540524", + "name": "琼结县" + }, + { + "code": "540525", + "name": "曲松县" + }, + { + "code": "540526", + "name": "措美县" + }, + { + "code": "540527", + "name": "洛扎县" + }, + { + "code": "540528", + "name": "加查县" + }, + { + "code": "540529", + "name": "隆子县" + }, + { + "code": "540530", + "name": "错那县" + }, + { + "code": "540531", + "name": "浪卡子县" + } + ] + }, + { + "code": "540600", + "name": "那曲市", + "area": [ + { + "code": "540602", + "name": "色尼区" + }, + { + "code": "540621", + "name": "嘉黎县" + }, + { + "code": "540622", + "name": "比如县" + }, + { + "code": "540623", + "name": "聂荣县" + }, + { + "code": "540624", + "name": "安多县" + }, + { + "code": "540625", + "name": "申扎县" + }, + { + "code": "540626", + "name": "索县" + }, + { + "code": "540627", + "name": "班戈县" + }, + { + "code": "540628", + "name": "巴青县" + }, + { + "code": "540629", + "name": "尼玛县" + }, + { + "code": "540630", + "name": "双湖县" + } + ] + }, + { + "code": "542500", + "name": "阿里地区", + "area": [ + { + "code": "542521", + "name": "普兰县" + }, + { + "code": "542522", + "name": "札达县" + }, + { + "code": "542523", + "name": "噶尔县" + }, + { + "code": "542524", + "name": "日土县" + }, + { + "code": "542525", + "name": "革吉县" + }, + { + "code": "542526", + "name": "改则县" + }, + { + "code": "542527", + "name": "措勤县" + } + ] + } + ] + }, + { + "code": "610000", + "name": "陕西省", + "city": [ + { + "code": "610100", + "name": "西安市", + "area": [ + { + "code": "610102", + "name": "新城区" + }, + { + "code": "610103", + "name": "碑林区" + }, + { + "code": "610104", + "name": "莲湖区" + }, + { + "code": "610111", + "name": "灞桥区" + }, + { + "code": "610112", + "name": "未央区" + }, + { + "code": "610113", + "name": "雁塔区" + }, + { + "code": "610114", + "name": "阎良区" + }, + { + "code": "610115", + "name": "临潼区" + }, + { + "code": "610116", + "name": "长安区" + }, + { + "code": "610117", + "name": "高陵区" + }, + { + "code": "610118", + "name": "鄠邑区" + }, + { + "code": "610122", + "name": "蓝田县" + }, + { + "code": "610124", + "name": "周至县" + } + ] + }, + { + "code": "610200", + "name": "铜川市", + "area": [ + { + "code": "610202", + "name": "王益区" + }, + { + "code": "610203", + "name": "印台区" + }, + { + "code": "610204", + "name": "耀州区" + }, + { + "code": "610222", + "name": "宜君县" + } + ] + }, + { + "code": "610300", + "name": "宝鸡市", + "area": [ + { + "code": "610302", + "name": "渭滨区" + }, + { + "code": "610303", + "name": "金台区" + }, + { + "code": "610304", + "name": "陈仓区" + }, + { + "code": "610322", + "name": "凤翔县" + }, + { + "code": "610323", + "name": "岐山县" + }, + { + "code": "610324", + "name": "扶风县" + }, + { + "code": "610326", + "name": "眉县" + }, + { + "code": "610327", + "name": "陇县" + }, + { + "code": "610328", + "name": "千阳县" + }, + { + "code": "610329", + "name": "麟游县" + }, + { + "code": "610330", + "name": "凤县" + }, + { + "code": "610331", + "name": "太白县" + } + ] + }, + { + "code": "610400", + "name": "咸阳市", + "area": [ + { + "code": "610402", + "name": "秦都区" + }, + { + "code": "610403", + "name": "杨陵区" + }, + { + "code": "610404", + "name": "渭城区" + }, + { + "code": "610422", + "name": "三原县" + }, + { + "code": "610423", + "name": "泾阳县" + }, + { + "code": "610424", + "name": "乾县" + }, + { + "code": "610425", + "name": "礼泉县" + }, + { + "code": "610426", + "name": "永寿县" + }, + { + "code": "610428", + "name": "长武县" + }, + { + "code": "610429", + "name": "旬邑县" + }, + { + "code": "610430", + "name": "淳化县" + }, + { + "code": "610431", + "name": "武功县" + }, + { + "code": "610481", + "name": "兴平市" + }, + { + "code": "610482", + "name": "彬州市" + } + ] + }, + { + "code": "610500", + "name": "渭南市", + "area": [ + { + "code": "610502", + "name": "临渭区" + }, + { + "code": "610503", + "name": "华州区" + }, + { + "code": "610522", + "name": "潼关县" + }, + { + "code": "610523", + "name": "大荔县" + }, + { + "code": "610524", + "name": "合阳县" + }, + { + "code": "610525", + "name": "澄城县" + }, + { + "code": "610526", + "name": "蒲城县" + }, + { + "code": "610527", + "name": "白水县" + }, + { + "code": "610528", + "name": "富平县" + }, + { + "code": "610581", + "name": "韩城市" + }, + { + "code": "610582", + "name": "华阴市" + } + ] + }, + { + "code": "610600", + "name": "延安市", + "area": [ + { + "code": "610602", + "name": "宝塔区" + }, + { + "code": "610603", + "name": "安塞区" + }, + { + "code": "610621", + "name": "延长县" + }, + { + "code": "610622", + "name": "延川县" + }, + { + "code": "610625", + "name": "志丹县" + }, + { + "code": "610626", + "name": "吴起县" + }, + { + "code": "610627", + "name": "甘泉县" + }, + { + "code": "610628", + "name": "富县" + }, + { + "code": "610629", + "name": "洛川县" + }, + { + "code": "610630", + "name": "宜川县" + }, + { + "code": "610631", + "name": "黄龙县" + }, + { + "code": "610632", + "name": "黄陵县" + }, + { + "code": "610681", + "name": "子长市" + } + ] + }, + { + "code": "610700", + "name": "汉中市", + "area": [ + { + "code": "610702", + "name": "汉台区" + }, + { + "code": "610703", + "name": "南郑区" + }, + { + "code": "610722", + "name": "城固县" + }, + { + "code": "610723", + "name": "洋县" + }, + { + "code": "610724", + "name": "西乡县" + }, + { + "code": "610725", + "name": "勉县" + }, + { + "code": "610726", + "name": "宁强县" + }, + { + "code": "610727", + "name": "略阳县" + }, + { + "code": "610728", + "name": "镇巴县" + }, + { + "code": "610729", + "name": "留坝县" + }, + { + "code": "610730", + "name": "佛坪县" + } + ] + }, + { + "code": "610800", + "name": "榆林市", + "area": [ + { + "code": "610802", + "name": "榆阳区" + }, + { + "code": "610803", + "name": "横山区" + }, + { + "code": "610822", + "name": "府谷县" + }, + { + "code": "610824", + "name": "靖边县" + }, + { + "code": "610825", + "name": "定边县" + }, + { + "code": "610826", + "name": "绥德县" + }, + { + "code": "610827", + "name": "米脂县" + }, + { + "code": "610828", + "name": "佳县" + }, + { + "code": "610829", + "name": "吴堡县" + }, + { + "code": "610830", + "name": "清涧县" + }, + { + "code": "610831", + "name": "子洲县" + }, + { + "code": "610881", + "name": "神木市" + } + ] + }, + { + "code": "610900", + "name": "安康市", + "area": [ + { + "code": "610902", + "name": "汉滨区" + }, + { + "code": "610921", + "name": "汉阴县" + }, + { + "code": "610922", + "name": "石泉县" + }, + { + "code": "610923", + "name": "宁陕县" + }, + { + "code": "610924", + "name": "紫阳县" + }, + { + "code": "610925", + "name": "岚皋县" + }, + { + "code": "610926", + "name": "平利县" + }, + { + "code": "610927", + "name": "镇坪县" + }, + { + "code": "610928", + "name": "旬阳县" + }, + { + "code": "610929", + "name": "白河县" + } + ] + }, + { + "code": "611000", + "name": "商洛市", + "area": [ + { + "code": "611002", + "name": "商州区" + }, + { + "code": "611021", + "name": "洛南县" + }, + { + "code": "611022", + "name": "丹凤县" + }, + { + "code": "611023", + "name": "商南县" + }, + { + "code": "611024", + "name": "山阳县" + }, + { + "code": "611025", + "name": "镇安县" + }, + { + "code": "611026", + "name": "柞水县" + } + ] + } + ] + }, + { + "code": "620000", + "name": "甘肃省", + "city": [ + { + "code": "620100", + "name": "兰州市", + "area": [ + { + "code": "620102", + "name": "城关区" + }, + { + "code": "620103", + "name": "七里河区" + }, + { + "code": "620104", + "name": "西固区" + }, + { + "code": "620105", + "name": "安宁区" + }, + { + "code": "620111", + "name": "红古区" + }, + { + "code": "620121", + "name": "永登县" + }, + { + "code": "620122", + "name": "皋兰县" + }, + { + "code": "620123", + "name": "榆中县" + } + ] + }, + { + "code": "620200", + "name": "嘉峪关市", + "area": [] + }, + { + "code": "620300", + "name": "金昌市", + "area": [ + { + "code": "620302", + "name": "金川区" + }, + { + "code": "620321", + "name": "永昌县" + } + ] + }, + { + "code": "620400", + "name": "白银市", + "area": [ + { + "code": "620402", + "name": "白银区" + }, + { + "code": "620403", + "name": "平川区" + }, + { + "code": "620421", + "name": "靖远县" + }, + { + "code": "620422", + "name": "会宁县" + }, + { + "code": "620423", + "name": "景泰县" + } + ] + }, + { + "code": "620500", + "name": "天水市", + "area": [ + { + "code": "620502", + "name": "秦州区" + }, + { + "code": "620503", + "name": "麦积区" + }, + { + "code": "620521", + "name": "清水县" + }, + { + "code": "620522", + "name": "秦安县" + }, + { + "code": "620523", + "name": "甘谷县" + }, + { + "code": "620524", + "name": "武山县" + }, + { + "code": "620525", + "name": "张家川回族自治县" + } + ] + }, + { + "code": "620600", + "name": "武威市", + "area": [ + { + "code": "620602", + "name": "凉州区" + }, + { + "code": "620621", + "name": "民勤县" + }, + { + "code": "620622", + "name": "古浪县" + }, + { + "code": "620623", + "name": "天祝藏族自治县" + } + ] + }, + { + "code": "620700", + "name": "张掖市", + "area": [ + { + "code": "620702", + "name": "甘州区" + }, + { + "code": "620721", + "name": "肃南裕固族自治县" + }, + { + "code": "620722", + "name": "民乐县" + }, + { + "code": "620723", + "name": "临泽县" + }, + { + "code": "620724", + "name": "高台县" + }, + { + "code": "620725", + "name": "山丹县" + } + ] + }, + { + "code": "620800", + "name": "平凉市", + "area": [ + { + "code": "620802", + "name": "崆峒区" + }, + { + "code": "620821", + "name": "泾川县" + }, + { + "code": "620822", + "name": "灵台县" + }, + { + "code": "620823", + "name": "崇信县" + }, + { + "code": "620825", + "name": "庄浪县" + }, + { + "code": "620826", + "name": "静宁县" + }, + { + "code": "620881", + "name": "华亭市" + } + ] + }, + { + "code": "620900", + "name": "酒泉市", + "area": [ + { + "code": "620902", + "name": "肃州区" + }, + { + "code": "620921", + "name": "金塔县" + }, + { + "code": "620922", + "name": "瓜州县" + }, + { + "code": "620923", + "name": "肃北蒙古族自治县" + }, + { + "code": "620924", + "name": "阿克塞哈萨克族自治县" + }, + { + "code": "620981", + "name": "玉门市" + }, + { + "code": "620982", + "name": "敦煌市" + } + ] + }, + { + "code": "621000", + "name": "庆阳市", + "area": [ + { + "code": "621002", + "name": "西峰区" + }, + { + "code": "621021", + "name": "庆城县" + }, + { + "code": "621022", + "name": "环县" + }, + { + "code": "621023", + "name": "华池县" + }, + { + "code": "621024", + "name": "合水县" + }, + { + "code": "621025", + "name": "正宁县" + }, + { + "code": "621026", + "name": "宁县" + }, + { + "code": "621027", + "name": "镇原县" + } + ] + }, + { + "code": "621100", + "name": "定西市", + "area": [ + { + "code": "621102", + "name": "安定区" + }, + { + "code": "621121", + "name": "通渭县" + }, + { + "code": "621122", + "name": "陇西县" + }, + { + "code": "621123", + "name": "渭源县" + }, + { + "code": "621124", + "name": "临洮县" + }, + { + "code": "621125", + "name": "漳县" + }, + { + "code": "621126", + "name": "岷县" + } + ] + }, + { + "code": "621200", + "name": "陇南市", + "area": [ + { + "code": "621202", + "name": "武都区" + }, + { + "code": "621221", + "name": "成县" + }, + { + "code": "621222", + "name": "文县" + }, + { + "code": "621223", + "name": "宕昌县" + }, + { + "code": "621224", + "name": "康县" + }, + { + "code": "621225", + "name": "西和县" + }, + { + "code": "621226", + "name": "礼县" + }, + { + "code": "621227", + "name": "徽县" + }, + { + "code": "621228", + "name": "两当县" + } + ] + }, + { + "code": "622900", + "name": "临夏回族自治州", + "area": [ + { + "code": "622901", + "name": "临夏市" + }, + { + "code": "622921", + "name": "临夏县" + }, + { + "code": "622922", + "name": "康乐县" + }, + { + "code": "622923", + "name": "永靖县" + }, + { + "code": "622924", + "name": "广河县" + }, + { + "code": "622925", + "name": "和政县" + }, + { + "code": "622926", + "name": "东乡族自治县" + }, + { + "code": "622927", + "name": "积石山保安族东乡族撒拉族自治县" + } + ] + }, + { + "code": "623000", + "name": "甘南藏族自治州", + "area": [ + { + "code": "623001", + "name": "合作市" + }, + { + "code": "623021", + "name": "临潭县" + }, + { + "code": "623022", + "name": "卓尼县" + }, + { + "code": "623023", + "name": "舟曲县" + }, + { + "code": "623024", + "name": "迭部县" + }, + { + "code": "623025", + "name": "玛曲县" + }, + { + "code": "623026", + "name": "碌曲县" + }, + { + "code": "623027", + "name": "夏河县" + } + ] + } + ] + }, + { + "code": "630000", + "name": "青海省", + "city": [ + { + "code": "630100", + "name": "西宁市", + "area": [ + { + "code": "630102", + "name": "城东区" + }, + { + "code": "630103", + "name": "城中区" + }, + { + "code": "630104", + "name": "城西区" + }, + { + "code": "630105", + "name": "城北区" + }, + { + "code": "630106", + "name": "湟中区" + }, + { + "code": "630121", + "name": "大通回族土族自治县" + }, + { + "code": "630123", + "name": "湟源县" + } + ] + }, + { + "code": "630200", + "name": "海东市", + "area": [ + { + "code": "630202", + "name": "乐都区" + }, + { + "code": "630203", + "name": "平安区" + }, + { + "code": "630222", + "name": "民和回族土族自治县" + }, + { + "code": "630223", + "name": "互助土族自治县" + }, + { + "code": "630224", + "name": "化隆回族自治县" + }, + { + "code": "630225", + "name": "循化撒拉族自治县" + } + ] + }, + { + "code": "632200", + "name": "海北藏族自治州", + "area": [ + { + "code": "632221", + "name": "门源回族自治县" + }, + { + "code": "632222", + "name": "祁连县" + }, + { + "code": "632223", + "name": "海晏县" + }, + { + "code": "632224", + "name": "刚察县" + } + ] + }, + { + "code": "632300", + "name": "黄南藏族自治州", + "area": [ + { + "code": "632301", + "name": "同仁市" + }, + { + "code": "632322", + "name": "尖扎县" + }, + { + "code": "632323", + "name": "泽库县" + }, + { + "code": "632324", + "name": "河南蒙古族自治县" + } + ] + }, + { + "code": "632500", + "name": "海南藏族自治州", + "area": [ + { + "code": "632521", + "name": "共和县" + }, + { + "code": "632522", + "name": "同德县" + }, + { + "code": "632523", + "name": "贵德县" + }, + { + "code": "632524", + "name": "兴海县" + }, + { + "code": "632525", + "name": "贵南县" + } + ] + }, + { + "code": "632600", + "name": "果洛藏族自治州", + "area": [ + { + "code": "632621", + "name": "玛沁县" + }, + { + "code": "632622", + "name": "班玛县" + }, + { + "code": "632623", + "name": "甘德县" + }, + { + "code": "632624", + "name": "达日县" + }, + { + "code": "632625", + "name": "久治县" + }, + { + "code": "632626", + "name": "玛多县" + } + ] + }, + { + "code": "632700", + "name": "玉树藏族自治州", + "area": [ + { + "code": "632701", + "name": "玉树市" + }, + { + "code": "632722", + "name": "杂多县" + }, + { + "code": "632723", + "name": "称多县" + }, + { + "code": "632724", + "name": "治多县" + }, + { + "code": "632725", + "name": "囊谦县" + }, + { + "code": "632726", + "name": "曲麻莱县" + } + ] + }, + { + "code": "632800", + "name": "海西蒙古族藏族自治州", + "area": [ + { + "code": "632801", + "name": "格尔木市" + }, + { + "code": "632802", + "name": "德令哈市" + }, + { + "code": "632803", + "name": "茫崖市" + }, + { + "code": "632821", + "name": "乌兰县" + }, + { + "code": "632822", + "name": "都兰县" + }, + { + "code": "632823", + "name": "天峻县" + } + ] + } + ] + }, + { + "code": "640000", + "name": "宁夏回族自治区", + "city": [ + { + "code": "640100", + "name": "银川市", + "area": [ + { + "code": "640104", + "name": "兴庆区" + }, + { + "code": "640105", + "name": "西夏区" + }, + { + "code": "640106", + "name": "金凤区" + }, + { + "code": "640121", + "name": "永宁县" + }, + { + "code": "640122", + "name": "贺兰县" + }, + { + "code": "640181", + "name": "灵武市" + } + ] + }, + { + "code": "640200", + "name": "石嘴山市", + "area": [ + { + "code": "640202", + "name": "大武口区" + }, + { + "code": "640205", + "name": "惠农区" + }, + { + "code": "640221", + "name": "平罗县" + } + ] + }, + { + "code": "640300", + "name": "吴忠市", + "area": [ + { + "code": "640302", + "name": "利通区" + }, + { + "code": "640303", + "name": "红寺堡区" + }, + { + "code": "640323", + "name": "盐池县" + }, + { + "code": "640324", + "name": "同心县" + }, + { + "code": "640381", + "name": "青铜峡市" + } + ] + }, + { + "code": "640400", + "name": "固原市", + "area": [ + { + "code": "640402", + "name": "原州区" + }, + { + "code": "640422", + "name": "西吉县" + }, + { + "code": "640423", + "name": "隆德县" + }, + { + "code": "640424", + "name": "泾源县" + }, + { + "code": "640425", + "name": "彭阳县" + } + ] + }, + { + "code": "640500", + "name": "中卫市", + "area": [ + { + "code": "640502", + "name": "沙坡头区" + }, + { + "code": "640521", + "name": "中宁县" + }, + { + "code": "640522", + "name": "海原县" + } + ] + } + ] + }, + { + "code": "650000", + "name": "新疆维吾尔自治区", + "city": [ + { + "code": "650100", + "name": "乌鲁木齐市", + "area": [ + { + "code": "650102", + "name": "天山区" + }, + { + "code": "650103", + "name": "沙依巴克区" + }, + { + "code": "650104", + "name": "新市区" + }, + { + "code": "650105", + "name": "水磨沟区" + }, + { + "code": "650106", + "name": "头屯河区" + }, + { + "code": "650107", + "name": "达坂城区" + }, + { + "code": "650109", + "name": "米东区" + }, + { + "code": "650121", + "name": "乌鲁木齐县" + } + ] + }, + { + "code": "650200", + "name": "克拉玛依市", + "area": [ + { + "code": "650202", + "name": "独山子区" + }, + { + "code": "650203", + "name": "克拉玛依区" + }, + { + "code": "650204", + "name": "白碱滩区" + }, + { + "code": "650205", + "name": "乌尔禾区" + } + ] + }, + { + "code": "650400", + "name": "吐鲁番市", + "area": [ + { + "code": "650402", + "name": "高昌区" + }, + { + "code": "650421", + "name": "鄯善县" + }, + { + "code": "650422", + "name": "托克逊县" + } + ] + }, + { + "code": "650500", + "name": "哈密市", + "area": [ + { + "code": "650502", + "name": "伊州区" + }, + { + "code": "650521", + "name": "巴里坤哈萨克自治县" + }, + { + "code": "650522", + "name": "伊吾县" + } + ] + }, + { + "code": "652300", + "name": "昌吉回族自治州", + "area": [ + { + "code": "652301", + "name": "昌吉市" + }, + { + "code": "652302", + "name": "阜康市" + }, + { + "code": "652323", + "name": "呼图壁县" + }, + { + "code": "652324", + "name": "玛纳斯县" + }, + { + "code": "652325", + "name": "奇台县" + }, + { + "code": "652327", + "name": "吉木萨尔县" + }, + { + "code": "652328", + "name": "木垒哈萨克自治县" + } + ] + }, + { + "code": "652700", + "name": "博尔塔拉蒙古自治州", + "area": [ + { + "code": "652701", + "name": "博乐市" + }, + { + "code": "652702", + "name": "阿拉山口市" + }, + { + "code": "652722", + "name": "精河县" + }, + { + "code": "652723", + "name": "温泉县" + } + ] + }, + { + "code": "652800", + "name": "巴音郭楞蒙古自治州", + "area": [ + { + "code": "652801", + "name": "库尔勒市" + }, + { + "code": "652822", + "name": "轮台县" + }, + { + "code": "652823", + "name": "尉犁县" + }, + { + "code": "652824", + "name": "若羌县" + }, + { + "code": "652825", + "name": "且末县" + }, + { + "code": "652826", + "name": "焉耆回族自治县" + }, + { + "code": "652827", + "name": "和静县" + }, + { + "code": "652828", + "name": "和硕县" + }, + { + "code": "652829", + "name": "博湖县" + } + ] + }, + { + "code": "652900", + "name": "阿克苏地区", + "area": [ + { + "code": "652901", + "name": "阿克苏市" + }, + { + "code": "652902", + "name": "库车市" + }, + { + "code": "652922", + "name": "温宿县" + }, + { + "code": "652924", + "name": "沙雅县" + }, + { + "code": "652925", + "name": "新和县" + }, + { + "code": "652926", + "name": "拜城县" + }, + { + "code": "652927", + "name": "乌什县" + }, + { + "code": "652928", + "name": "阿瓦提县" + }, + { + "code": "652929", + "name": "柯坪县" + } + ] + }, + { + "code": "653000", + "name": "克孜勒苏柯尔克孜自治州", + "area": [ + { + "code": "653001", + "name": "阿图什市" + }, + { + "code": "653022", + "name": "阿克陶县" + }, + { + "code": "653023", + "name": "阿合奇县" + }, + { + "code": "653024", + "name": "乌恰县" + } + ] + }, + { + "code": "653100", + "name": "喀什地区", + "area": [ + { + "code": "653101", + "name": "喀什市" + }, + { + "code": "653121", + "name": "疏附县" + }, + { + "code": "653122", + "name": "疏勒县" + }, + { + "code": "653123", + "name": "英吉沙县" + }, + { + "code": "653124", + "name": "泽普县" + }, + { + "code": "653125", + "name": "莎车县" + }, + { + "code": "653126", + "name": "叶城县" + }, + { + "code": "653127", + "name": "麦盖提县" + }, + { + "code": "653128", + "name": "岳普湖县" + }, + { + "code": "653129", + "name": "伽师县" + }, + { + "code": "653130", + "name": "巴楚县" + }, + { + "code": "653131", + "name": "塔什库尔干塔吉克自治县" + } + ] + }, + { + "code": "653200", + "name": "和田地区", + "area": [ + { + "code": "653201", + "name": "和田市" + }, + { + "code": "653221", + "name": "和田县" + }, + { + "code": "653222", + "name": "墨玉县" + }, + { + "code": "653223", + "name": "皮山县" + }, + { + "code": "653224", + "name": "洛浦县" + }, + { + "code": "653225", + "name": "策勒县" + }, + { + "code": "653226", + "name": "于田县" + }, + { + "code": "653227", + "name": "民丰县" + } + ] + }, + { + "code": "654000", + "name": "伊犁哈萨克自治州", + "area": [ + { + "code": "654002", + "name": "伊宁市" + }, + { + "code": "654003", + "name": "奎屯市" + }, + { + "code": "654004", + "name": "霍尔果斯市" + }, + { + "code": "654021", + "name": "伊宁县" + }, + { + "code": "654022", + "name": "察布查尔锡伯自治县" + }, + { + "code": "654023", + "name": "霍城县" + }, + { + "code": "654024", + "name": "巩留县" + }, + { + "code": "654025", + "name": "新源县" + }, + { + "code": "654026", + "name": "昭苏县" + }, + { + "code": "654027", + "name": "特克斯县" + }, + { + "code": "654028", + "name": "尼勒克县" + } + ] + }, + { + "code": "654200", + "name": "塔城地区", + "area": [ + { + "code": "654201", + "name": "塔城市" + }, + { + "code": "654202", + "name": "乌苏市" + }, + { + "code": "654221", + "name": "额敏县" + }, + { + "code": "654223", + "name": "沙湾县" + }, + { + "code": "654224", + "name": "托里县" + }, + { + "code": "654225", + "name": "裕民县" + }, + { + "code": "654226", + "name": "和布克赛尔蒙古自治县" + } + ] + }, + { + "code": "654300", + "name": "阿勒泰地区", + "area": [ + { + "code": "654301", + "name": "阿勒泰市" + }, + { + "code": "654321", + "name": "布尔津县" + }, + { + "code": "654322", + "name": "富蕴县" + }, + { + "code": "654323", + "name": "福海县" + }, + { + "code": "654324", + "name": "哈巴河县" + }, + { + "code": "654325", + "name": "青河县" + }, + { + "code": "654326", + "name": "吉木乃县" + } + ] + }, + { + "code": "659001", + "name": "石河子市", + "area": [] + }, + { + "code": "659002", + "name": "阿拉尔市", + "area": [] + }, + { + "code": "659003", + "name": "图木舒克市", + "area": [] + }, + { + "code": "659004", + "name": "五家渠市", + "area": [] + }, + { + "code": "659005", + "name": "北屯市", + "area": [] + }, + { + "code": "659006", + "name": "铁门关市", + "area": [] + }, + { + "code": "659007", + "name": "双河市", + "area": [] + }, + { + "code": "659008", + "name": "可克达拉市", + "area": [] + }, + { + "code": "659009", + "name": "昆玉市", + "area": [] + }, + { + "code": "659010", + "name": "胡杨河市", + "area": [] + } + ] + }, + { + "code": "710000", + "name": "台湾省", + "city": [] + }, + { + "code": "810000", + "name": "香港特别行政区", + "city": [] + }, + { + "code": "820000", + "name": "澳门特别行政区", + "city": [] + } +] \ No newline at end of file diff --git a/app/src/main/java/com/oneclouds/cargo/adapter/CenterSimAdapter.java b/app/src/main/java/com/oneclouds/cargo/adapter/CenterSimAdapter.java new file mode 100644 index 0000000..49a4d62 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/adapter/CenterSimAdapter.java @@ -0,0 +1,43 @@ +package com.oneclouds.cargo.adapter; + +import android.widget.TextView; + +import androidx.annotation.Nullable; + +import com.amap.api.services.help.Tip; +import com.chad.library.adapter.base.BaseQuickAdapter; +import com.chad.library.adapter.base.viewholder.BaseViewHolder; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.StateBean; + +import java.util.List; + +public class CenterSimAdapter extends BaseQuickAdapter { + private Tip selectString=null; + + + public CenterSimAdapter(int layoutResId, @Nullable List data, Tip selectString) { + super(R.layout.item_search_address_pop, data); + this.selectString = selectString; + } + + @Override + protected void convert(BaseViewHolder helper, Tip item) { + helper.setText(R.id.tvName,item.getName()) + .setText(R.id.tvName,item.getDistrict()+item.getAddress());; +// TextView tv = helper.getView(R.id.tvName); +// if (selectString!=null&&item.getDictValue()!=null){ +// if (item.getDictValue().equals(selectString.getDictValue())){ +// tv.setSelected(true); +// }else{ +// tv.setSelected(false); +// } +// } + + + } + + public void setSelect(Tip selectString){ + this.selectString = selectString; + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/adapter/ChoiceAddressAdapter.java b/app/src/main/java/com/oneclouds/cargo/adapter/ChoiceAddressAdapter.java new file mode 100644 index 0000000..6eb161d --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/adapter/ChoiceAddressAdapter.java @@ -0,0 +1,37 @@ +package com.oneclouds.cargo.adapter; + +import androidx.annotation.Nullable; + +import com.amap.api.services.help.Tip; +import com.chad.library.adapter.base.BaseQuickAdapter; +import com.chad.library.adapter.base.viewholder.BaseViewHolder; +import com.oneclouds.cargo.R; + +import java.util.List; + +public class ChoiceAddressAdapter extends BaseQuickAdapter { + + + public ChoiceAddressAdapter(int layoutResId, @Nullable List data) { + super(R.layout.item_search_address_pop, data); + + } + + @Override + protected void convert(BaseViewHolder helper, Tip item) { + helper.setText(R.id.tvName, item.getName()) + .setText(R.id.tvAddress, item.getDistrict() + item.getAddress()); + ; +// TextView tv = helper.getView(R.id.tvName); +// if (selectString!=null&&item.getDictValue()!=null){ +// if (item.getDictValue().equals(selectString.getDictValue())){ +// tv.setSelected(true); +// }else{ +// tv.setSelected(false); +// } +// } + + + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/base/AppConfig.java b/app/src/main/java/com/oneclouds/cargo/base/AppConfig.java new file mode 100644 index 0000000..5355f2f --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/base/AppConfig.java @@ -0,0 +1,17 @@ +package com.oneclouds.cargo.base; + +/** + * @ClassName AppConfig + * @Author 用户 + * @Date 2022/1/14 15:24 + * @Description TODO + */ +public class AppConfig { + + public static final String BEAN= "DA_HE_BEAN"; + public static final String STRING= "DA_HE_STRING"; + public static final String ID= "DA_HE_ID"; + public static final String PWD= "DA_HE_PHONE"; + public static final String CODE= "DA_HE_PHONE"; + public static final String TYPE= "DA_HE_TYPE"; +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/AddressBean.java b/app/src/main/java/com/oneclouds/cargo/bean/AddressBean.java new file mode 100644 index 0000000..05d59e3 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/AddressBean.java @@ -0,0 +1,174 @@ +package com.oneclouds.cargo.bean; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/13 19:42 + * @description: + */ +public class AddressBean{ + + private String addressDetail; + private int addressType; + private int area; + private int city; + private String companyCode; + private String companyName; + private String contactNumber; + private String contactPerson; + private String createTime; + private int id; + private String idCard; + private int idDefault; + private int isDeleted; + private int province; + private String tagContent; + private String updateTime; + private int userId; + private int userType; + + public String getAddressDetail() { + return addressDetail == null ? "" : addressDetail; + } + + public void setAddressDetail(String addressDetail) { + this.addressDetail = addressDetail; + } + + public int getAddressType() { + return addressType; + } + + public void setAddressType(int addressType) { + this.addressType = addressType; + } + + public int getArea() { + return area; + } + + public void setArea(int area) { + this.area = area; + } + + public int getCity() { + return city; + } + + public void setCity(int city) { + this.city = city; + } + + public String getCompanyCode() { + return companyCode == null ? "" : companyCode; + } + + public void setCompanyCode(String companyCode) { + this.companyCode = companyCode; + } + + public String getCompanyName() { + return companyName == null ? "" : companyName; + } + + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + public String getContactNumber() { + return contactNumber == null ? "" : contactNumber; + } + + public void setContactNumber(String contactNumber) { + this.contactNumber = contactNumber; + } + + public String getContactPerson() { + return contactPerson == null ? "" : contactPerson; + } + + public void setContactPerson(String contactPerson) { + this.contactPerson = contactPerson; + } + + public String getCreateTime() { + return createTime == null ? "" : createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getIdCard() { + return idCard == null ? "" : idCard; + } + + public void setIdCard(String idCard) { + this.idCard = idCard; + } + + public int getIdDefault() { + return idDefault; + } + + public void setIdDefault(int idDefault) { + this.idDefault = idDefault; + } + + public int getIsDeleted() { + return isDeleted; + } + + public void setIsDeleted(int isDeleted) { + this.isDeleted = isDeleted; + } + + public int getProvince() { + return province; + } + + public void setProvince(int province) { + this.province = province; + } + + public String getTagContent() { + return tagContent == null ? "" : tagContent; + } + + public void setTagContent(String tagContent) { + this.tagContent = tagContent; + } + + public String getUpdateTime() { + return updateTime == null ? "" : updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public int getUserId() { + return userId; + } + + public void setUserId(int userId) { + this.userId = userId; + } + + public int getUserType() { + return userType; + } + + public void setUserType(int userType) { + this.userType = userType; + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/AddressListBean.java b/app/src/main/java/com/oneclouds/cargo/bean/AddressListBean.java new file mode 100644 index 0000000..a74ec41 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/AddressListBean.java @@ -0,0 +1,351 @@ +package com.oneclouds.cargo.bean; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/13 19:49 + * @description: + */ +public class AddressListBean { + + + private int res; + private int code; + private boolean success; + private String msg; + private DataDTO data; + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public String getMsg() { + return msg == null ? "" : msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public DataDTO getData() { + return data; + } + + public void setData(DataDTO data) { + this.data = data; + } + + public static class DataDTO { + private List records; + private int total; + private int size; + private int current; + private List orders; + private boolean searchCount; + private int pages; + + public List getRecords() { + if (records == null) { + return new ArrayList<>(); + } + return records; + } + + public void setRecords(List records) { + this.records = records; + } + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public int getSize() { + return size; + } + + public void setSize(int size) { + this.size = size; + } + + public int getCurrent() { + return current; + } + + public void setCurrent(int current) { + this.current = current; + } + + public List getOrders() { + if (orders == null) { + return new ArrayList<>(); + } + return orders; + } + + public void setOrders(List orders) { + this.orders = orders; + } + + public boolean isSearchCount() { + return searchCount; + } + + public void setSearchCount(boolean searchCount) { + this.searchCount = searchCount; + } + + public int getPages() { + return pages; + } + + public void setPages(int pages) { + this.pages = pages; + } + + public static class RecordsDTO { + private int id; + private int userId; + private String userName; + private int addressType; + private String contactPerson; + private String businessCode; + private String contactNumber; + private int province; + private String provinceName; + private int city; + private String cityName; + private int area; + private String areaName; + private String pathName; + private String addressDetail; + private Object tagContent; + private int idDefault; + private int isDeleted; + private String createTime; + private String updateTime; + private String companyName; + private String companyCode; + private Object idCard; + private int userType; + + public String getBusinessCode() { + return businessCode; + } + + public void setBusinessCode(String businessCode) { + this.businessCode = businessCode; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getUserId() { + return userId; + } + + public void setUserId(int userId) { + this.userId = userId; + } + + public String getUserName() { + return userName == null ? "" : userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public int getAddressType() { + return addressType; + } + + public void setAddressType(int addressType) { + this.addressType = addressType; + } + + public String getContactPerson() { + return contactPerson == null ? "" : contactPerson; + } + + public void setContactPerson(String contactPerson) { + this.contactPerson = contactPerson; + } + + public String getContactNumber() { + return contactNumber == null ? "" : contactNumber; + } + + public void setContactNumber(String contactNumber) { + this.contactNumber = contactNumber; + } + + public int getProvince() { + return province; + } + + public void setProvince(int province) { + this.province = province; + } + + public String getProvinceName() { + return provinceName == null ? "" : provinceName; + } + + public void setProvinceName(String provinceName) { + this.provinceName = provinceName; + } + + public int getCity() { + return city; + } + + public void setCity(int city) { + this.city = city; + } + + public String getCityName() { + return cityName == null ? "" : cityName; + } + + public void setCityName(String cityName) { + this.cityName = cityName; + } + + public int getArea() { + return area; + } + + public void setArea(int area) { + this.area = area; + } + + public String getAreaName() { + return areaName == null ? "" : areaName; + } + + public void setAreaName(String areaName) { + this.areaName = areaName; + } + + public String getPathName() { + return pathName == null ? "" : pathName; + } + + public void setPathName(String pathName) { + this.pathName = pathName; + } + + public String getAddressDetail() { + return addressDetail == null ? "" : addressDetail; + } + + public void setAddressDetail(String addressDetail) { + this.addressDetail = addressDetail; + } + + public Object getTagContent() { + return tagContent; + } + + public void setTagContent(Object tagContent) { + this.tagContent = tagContent; + } + + public int getIdDefault() { + return idDefault; + } + + public void setIdDefault(int idDefault) { + this.idDefault = idDefault; + } + + public int getIsDeleted() { + return isDeleted; + } + + public void setIsDeleted(int isDeleted) { + this.isDeleted = isDeleted; + } + + public String getCreateTime() { + return createTime == null ? "" : createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getUpdateTime() { + return updateTime == null ? "" : updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public String getCompanyName() { + return companyName; + } + + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + public String getCompanyCode() { + return companyCode == null ? "" : companyCode; + } + + public void setCompanyCode(String companyCode) { + this.companyCode = companyCode; + } + + public Object getIdCard() { + return idCard; + } + + public void setIdCard(Object idCard) { + this.idCard = idCard; + } + + public int getUserType() { + return userType; + } + + public void setUserType(int userType) { + this.userType = userType; + } + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/AlGoodsTypeListBean.java b/app/src/main/java/com/oneclouds/cargo/bean/AlGoodsTypeListBean.java new file mode 100644 index 0000000..84ebd07 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/AlGoodsTypeListBean.java @@ -0,0 +1,83 @@ +package com.oneclouds.cargo.bean; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/15 16:29 + * @description:安联货物类别 + */ +public class AlGoodsTypeListBean { + + private int res; + private int code; + private boolean success; + private String msg; + private List data; + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public String getMsg() { + return msg == null ? "" : msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public List getData() { + if (data == null) { + return new ArrayList<>(); + } + return data; + } + + public void setData(List data) { + this.data = data; + } + + public static class DataDTO { + private int id; + private String name; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/AuthInfoBean.java b/app/src/main/java/com/oneclouds/cargo/bean/AuthInfoBean.java new file mode 100644 index 0000000..5086c14 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/AuthInfoBean.java @@ -0,0 +1,590 @@ +package com.oneclouds.cargo.bean; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/18 10:35 + * @description: + */ +public class AuthInfoBean { + + private int res; + private int code; + private boolean success; + private String msg; + private DataDTO data; + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public DataDTO getData() { + return data; + } + + public void setData(DataDTO data) { + this.data = data; + } + + public static class DataDTO { + private int id; + private int userId; + private String contactName; + private String contactPhone; + private String idcard; + private String idcardValidity; + private int idcardPhoto; + private int idcardPhotoBack; + private Object idcardPhotoHold; + private String corporationName; + private String corporationPhone; + private String corporationIdcard; + private String corporationIdcardValidity; + private Object corporationIdcardPhoto; + private Object corporationIdcardPhotoBack; + private Object corporationIdcardPhotoHold; + private String code; + private Object businessLicense; + private Object warrant; + private int auditStatus; + private String reason; + private String realCompanyName; + private Object province; + private Object city; + private Object area; + private String addressDetail; + private String applyTime; + private String auditTime; + private String companyShorterName; + private int businessLicenseStatus; + private int corporationStatus; + private int idcardStatus; + private int disabled; + private String companyName; + private String rname; + private String registerPhone; + private String loginPhone; + private Object headportrait; + private Object headportraitInfo; + private String headportraitUrl; + private Object updatePhoneTime; + private String registerTime; + private Object idcardPhotoInfo; + private String idcardPhotoUrl; + private Object idcardPhotoBackInfo; + private String idcardPhotoBackUrl; + private Object idcardPhotoHoldInfo; + private String idcardPhotoHoldUrl; + private Object corporationIdcardPhotoInfo; + private String corporationIdcardPhotoUrl; + private Object corporationIdcardPhotoBackInfo; + private String corporationIdcardPhotoBackUrl; + private Object corporationIdcardPhotoHoldInfo; + private String corporationIdcardPhotoHoldUrl; + private Object businessLicenseInfo; + private String businessLicenseUrl; + private Object warrantInfo; + private String warrantUrl; + private Object children; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getUserId() { + return userId; + } + + public void setUserId(int userId) { + this.userId = userId; + } + + public String getContactName() { + return contactName; + } + + public void setContactName(String contactName) { + this.contactName = contactName; + } + + public String getContactPhone() { + return contactPhone; + } + + public void setContactPhone(String contactPhone) { + this.contactPhone = contactPhone; + } + + public String getIdcard() { + return idcard; + } + + public void setIdcard(String idcard) { + this.idcard = idcard; + } + + public String getIdcardValidity() { + return idcardValidity; + } + + public void setIdcardValidity(String idcardValidity) { + this.idcardValidity = idcardValidity; + } + + public int getIdcardPhoto() { + return idcardPhoto; + } + + public void setIdcardPhoto(int idcardPhoto) { + this.idcardPhoto = idcardPhoto; + } + + public int getIdcardPhotoBack() { + return idcardPhotoBack; + } + + public void setIdcardPhotoBack(int idcardPhotoBack) { + this.idcardPhotoBack = idcardPhotoBack; + } + + public Object getIdcardPhotoHold() { + return idcardPhotoHold; + } + + public void setIdcardPhotoHold(Object idcardPhotoHold) { + this.idcardPhotoHold = idcardPhotoHold; + } + + public String getCorporationName() { + return corporationName; + } + + public void setCorporationName(String corporationName) { + this.corporationName = corporationName; + } + + public String getCorporationPhone() { + return corporationPhone; + } + + public void setCorporationPhone(String corporationPhone) { + this.corporationPhone = corporationPhone; + } + + public String getCorporationIdcard() { + return corporationIdcard; + } + + public void setCorporationIdcard(String corporationIdcard) { + this.corporationIdcard = corporationIdcard; + } + + public String getCorporationIdcardValidity() { + return corporationIdcardValidity; + } + + public void setCorporationIdcardValidity(String corporationIdcardValidity) { + this.corporationIdcardValidity = corporationIdcardValidity; + } + + public Object getCorporationIdcardPhoto() { + return corporationIdcardPhoto; + } + + public void setCorporationIdcardPhoto(Object corporationIdcardPhoto) { + this.corporationIdcardPhoto = corporationIdcardPhoto; + } + + public Object getCorporationIdcardPhotoBack() { + return corporationIdcardPhotoBack; + } + + public void setCorporationIdcardPhotoBack(Object corporationIdcardPhotoBack) { + this.corporationIdcardPhotoBack = corporationIdcardPhotoBack; + } + + public Object getCorporationIdcardPhotoHold() { + return corporationIdcardPhotoHold; + } + + public void setCorporationIdcardPhotoHold(Object corporationIdcardPhotoHold) { + this.corporationIdcardPhotoHold = corporationIdcardPhotoHold; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public Object getBusinessLicense() { + return businessLicense; + } + + public void setBusinessLicense(Object businessLicense) { + this.businessLicense = businessLicense; + } + + public Object getWarrant() { + return warrant; + } + + public void setWarrant(Object warrant) { + this.warrant = warrant; + } + + public int getAuditStatus() { + return auditStatus; + } + + public void setAuditStatus(int auditStatus) { + this.auditStatus = auditStatus; + } + + public String getReason() { + return reason; + } + + public void setReason(String reason) { + this.reason = reason; + } + + public String getRealCompanyName() { + return realCompanyName; + } + + public void setRealCompanyName(String realCompanyName) { + this.realCompanyName = realCompanyName; + } + + public Object getProvince() { + return province; + } + + public void setProvince(Object province) { + this.province = province; + } + + public Object getCity() { + return city; + } + + public void setCity(Object city) { + this.city = city; + } + + public Object getArea() { + return area; + } + + public void setArea(Object area) { + this.area = area; + } + + public String getAddressDetail() { + return addressDetail; + } + + public void setAddressDetail(String addressDetail) { + this.addressDetail = addressDetail; + } + + public String getApplyTime() { + return applyTime; + } + + public void setApplyTime(String applyTime) { + this.applyTime = applyTime; + } + + public String getAuditTime() { + return auditTime; + } + + public void setAuditTime(String auditTime) { + this.auditTime = auditTime; + } + + public String getCompanyShorterName() { + return companyShorterName; + } + + public void setCompanyShorterName(String companyShorterName) { + this.companyShorterName = companyShorterName; + } + + public int getBusinessLicenseStatus() { + return businessLicenseStatus; + } + + public void setBusinessLicenseStatus(int businessLicenseStatus) { + this.businessLicenseStatus = businessLicenseStatus; + } + + public int getCorporationStatus() { + return corporationStatus; + } + + public void setCorporationStatus(int corporationStatus) { + this.corporationStatus = corporationStatus; + } + + public int getIdcardStatus() { + return idcardStatus; + } + + public void setIdcardStatus(int idcardStatus) { + this.idcardStatus = idcardStatus; + } + + public int getDisabled() { + return disabled; + } + + public void setDisabled(int disabled) { + this.disabled = disabled; + } + + public String getCompanyName() { + return companyName; + } + + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + public String getRname() { + return rname; + } + + public void setRname(String rname) { + this.rname = rname; + } + + public String getRegisterPhone() { + return registerPhone; + } + + public void setRegisterPhone(String registerPhone) { + this.registerPhone = registerPhone; + } + + public String getLoginPhone() { + return loginPhone; + } + + public void setLoginPhone(String loginPhone) { + this.loginPhone = loginPhone; + } + + public Object getHeadportrait() { + return headportrait; + } + + public void setHeadportrait(Object headportrait) { + this.headportrait = headportrait; + } + + public Object getHeadportraitInfo() { + return headportraitInfo; + } + + public void setHeadportraitInfo(Object headportraitInfo) { + this.headportraitInfo = headportraitInfo; + } + + public String getHeadportraitUrl() { + return headportraitUrl; + } + + public void setHeadportraitUrl(String headportraitUrl) { + this.headportraitUrl = headportraitUrl; + } + + public Object getUpdatePhoneTime() { + return updatePhoneTime; + } + + public void setUpdatePhoneTime(Object updatePhoneTime) { + this.updatePhoneTime = updatePhoneTime; + } + + public String getRegisterTime() { + return registerTime; + } + + public void setRegisterTime(String registerTime) { + this.registerTime = registerTime; + } + + public Object getIdcardPhotoInfo() { + return idcardPhotoInfo; + } + + public void setIdcardPhotoInfo(Object idcardPhotoInfo) { + this.idcardPhotoInfo = idcardPhotoInfo; + } + + public String getIdcardPhotoUrl() { + return idcardPhotoUrl; + } + + public void setIdcardPhotoUrl(String idcardPhotoUrl) { + this.idcardPhotoUrl = idcardPhotoUrl; + } + + public Object getIdcardPhotoBackInfo() { + return idcardPhotoBackInfo; + } + + public void setIdcardPhotoBackInfo(Object idcardPhotoBackInfo) { + this.idcardPhotoBackInfo = idcardPhotoBackInfo; + } + + public String getIdcardPhotoBackUrl() { + return idcardPhotoBackUrl; + } + + public void setIdcardPhotoBackUrl(String idcardPhotoBackUrl) { + this.idcardPhotoBackUrl = idcardPhotoBackUrl; + } + + public Object getIdcardPhotoHoldInfo() { + return idcardPhotoHoldInfo; + } + + public void setIdcardPhotoHoldInfo(Object idcardPhotoHoldInfo) { + this.idcardPhotoHoldInfo = idcardPhotoHoldInfo; + } + + public String getIdcardPhotoHoldUrl() { + return idcardPhotoHoldUrl; + } + + public void setIdcardPhotoHoldUrl(String idcardPhotoHoldUrl) { + this.idcardPhotoHoldUrl = idcardPhotoHoldUrl; + } + + public Object getCorporationIdcardPhotoInfo() { + return corporationIdcardPhotoInfo; + } + + public void setCorporationIdcardPhotoInfo(Object corporationIdcardPhotoInfo) { + this.corporationIdcardPhotoInfo = corporationIdcardPhotoInfo; + } + + public String getCorporationIdcardPhotoUrl() { + return corporationIdcardPhotoUrl; + } + + public void setCorporationIdcardPhotoUrl(String corporationIdcardPhotoUrl) { + this.corporationIdcardPhotoUrl = corporationIdcardPhotoUrl; + } + + public Object getCorporationIdcardPhotoBackInfo() { + return corporationIdcardPhotoBackInfo; + } + + public void setCorporationIdcardPhotoBackInfo(Object corporationIdcardPhotoBackInfo) { + this.corporationIdcardPhotoBackInfo = corporationIdcardPhotoBackInfo; + } + + public String getCorporationIdcardPhotoBackUrl() { + return corporationIdcardPhotoBackUrl; + } + + public void setCorporationIdcardPhotoBackUrl(String corporationIdcardPhotoBackUrl) { + this.corporationIdcardPhotoBackUrl = corporationIdcardPhotoBackUrl; + } + + public Object getCorporationIdcardPhotoHoldInfo() { + return corporationIdcardPhotoHoldInfo; + } + + public void setCorporationIdcardPhotoHoldInfo(Object corporationIdcardPhotoHoldInfo) { + this.corporationIdcardPhotoHoldInfo = corporationIdcardPhotoHoldInfo; + } + + public String getCorporationIdcardPhotoHoldUrl() { + return corporationIdcardPhotoHoldUrl; + } + + public void setCorporationIdcardPhotoHoldUrl(String corporationIdcardPhotoHoldUrl) { + this.corporationIdcardPhotoHoldUrl = corporationIdcardPhotoHoldUrl; + } + + public Object getBusinessLicenseInfo() { + return businessLicenseInfo; + } + + public void setBusinessLicenseInfo(Object businessLicenseInfo) { + this.businessLicenseInfo = businessLicenseInfo; + } + + public String getBusinessLicenseUrl() { + return businessLicenseUrl; + } + + public void setBusinessLicenseUrl(String businessLicenseUrl) { + this.businessLicenseUrl = businessLicenseUrl; + } + + public Object getWarrantInfo() { + return warrantInfo; + } + + public void setWarrantInfo(Object warrantInfo) { + this.warrantInfo = warrantInfo; + } + + public String getWarrantUrl() { + return warrantUrl; + } + + public void setWarrantUrl(String warrantUrl) { + this.warrantUrl = warrantUrl; + } + + public Object getChildren() { + return children; + } + + public void setChildren(Object children) { + this.children = children; + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/BankCardListBean.java b/app/src/main/java/com/oneclouds/cargo/bean/BankCardListBean.java new file mode 100644 index 0000000..e5eebb2 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/BankCardListBean.java @@ -0,0 +1,280 @@ +package com.oneclouds.cargo.bean; + +import java.util.List; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/16 16:11 + * @description: + */ +public class BankCardListBean { + + private int res; + private int code; + private boolean success; + private String msg; + private DataDTO data; + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public DataDTO getData() { + return data; + } + + public void setData(DataDTO data) { + this.data = data; + } + + public static class DataDTO { + private List records; + private int total; + private int size; + private int current; + private List orders; + private boolean searchCount; + private int pages; + + public List getRecords() { + return records; + } + + public void setRecords(List records) { + this.records = records; + } + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public int getSize() { + return size; + } + + public void setSize(int size) { + this.size = size; + } + + public int getCurrent() { + return current; + } + + public void setCurrent(int current) { + this.current = current; + } + + public List getOrders() { + return orders; + } + + public void setOrders(List orders) { + this.orders = orders; + } + + public boolean isSearchCount() { + return searchCount; + } + + public void setSearchCount(boolean searchCount) { + this.searchCount = searchCount; + } + + public int getPages() { + return pages; + } + + public void setPages(int pages) { + this.pages = pages; + } + + public static class RecordsDTO { + private int id; + private Object bankId; + private String bankName; + private String cardNo; + private String bankImgUrl; + private int cardType; + private int auditStatus; + private int createUser; + private String createUserName; + private String createTime; + private Object openBank; + private Object companyName; + private Object companyCode; + private Object address; + private Object phone; + private int cardUserType; + private Object userCompany; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public Object getBankId() { + return bankId; + } + + public void setBankId(Object bankId) { + this.bankId = bankId; + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getCardNo() { + return cardNo; + } + + public void setCardNo(String cardNo) { + this.cardNo = cardNo; + } + + public String getBankImgUrl() { + return bankImgUrl; + } + + public void setBankImgUrl(String bankImgUrl) { + this.bankImgUrl = bankImgUrl; + } + + public int getCardType() { + return cardType; + } + + public void setCardType(int cardType) { + this.cardType = cardType; + } + + public int getAuditStatus() { + return auditStatus; + } + + public void setAuditStatus(int auditStatus) { + this.auditStatus = auditStatus; + } + + public int getCreateUser() { + return createUser; + } + + public void setCreateUser(int createUser) { + this.createUser = createUser; + } + + public String getCreateUserName() { + return createUserName; + } + + public void setCreateUserName(String createUserName) { + this.createUserName = createUserName; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public Object getOpenBank() { + return openBank; + } + + public void setOpenBank(Object openBank) { + this.openBank = openBank; + } + + public Object getCompanyName() { + return companyName; + } + + public void setCompanyName(Object companyName) { + this.companyName = companyName; + } + + public Object getCompanyCode() { + return companyCode; + } + + public void setCompanyCode(Object companyCode) { + this.companyCode = companyCode; + } + + public Object getAddress() { + return address; + } + + public void setAddress(Object address) { + this.address = address; + } + + public Object getPhone() { + return phone; + } + + public void setPhone(Object phone) { + this.phone = phone; + } + + public int getCardUserType() { + return cardUserType; + } + + public void setCardUserType(int cardUserType) { + this.cardUserType = cardUserType; + } + + public Object getUserCompany() { + return userCompany; + } + + public void setUserCompany(Object userCompany) { + this.userCompany = userCompany; + } + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/BaseBean.java b/app/src/main/java/com/oneclouds/cargo/bean/BaseBean.java new file mode 100644 index 0000000..98681cb --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/BaseBean.java @@ -0,0 +1,56 @@ +package com.oneclouds.cargo.bean; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/8/7 14:28 + * @description:基础bean + */ +public class BaseBean { + + private int res; + private int code; + private boolean success; + private String msg; + private Object data; + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public Object getData() { + return data; + } + + public void setData(Object data) { + this.data = data; + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/BusinssTypeBean.java b/app/src/main/java/com/oneclouds/cargo/bean/BusinssTypeBean.java new file mode 100644 index 0000000..ae34d8c --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/BusinssTypeBean.java @@ -0,0 +1,88 @@ +package com.oneclouds.cargo.bean; + +import java.util.List; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/15 15:41 + * @description: + */ +public class BusinssTypeBean { + + private int res; + private int code; + private boolean success; + private String msg; + private List data; + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public static class DataDTO { + private int value; + private String name; + private String type; + + public int getValue() { + return value; + } + + public void setValue(int value) { + this.value = value; + } + + 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; + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/CarBean.java b/app/src/main/java/com/oneclouds/cargo/bean/CarBean.java new file mode 100644 index 0000000..33e5e03 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/CarBean.java @@ -0,0 +1,77 @@ +package com.oneclouds.cargo.bean; + +import java.io.Serializable; + +/** + * @ClassName CarBean + * @Author 用户 + * @Date 2022/5/18 11:46 + * @Description TODO + */ +public class CarBean implements Serializable { + + + private Integer carId; + private String carNum; + private String carStatus; + private String carType; + private Integer driverId; + private String driverName; + private String driverPhone; + + public Integer getCarId() { + return carId; + } + + public void setCarId(Integer carId) { + this.carId = carId; + } + + public String getCarNum() { + return carNum; + } + + public void setCarNum(String carNum) { + this.carNum = carNum; + } + + public String getCarStatus() { + return carStatus; + } + + public void setCarStatus(String carStatus) { + this.carStatus = carStatus; + } + + public String getCarType() { + return carType; + } + + public void setCarType(String carType) { + this.carType = carType; + } + + public Integer getDriverId() { + return driverId; + } + + public void setDriverId(Integer driverId) { + this.driverId = driverId; + } + + public String getDriverName() { + return driverName; + } + + public void setDriverName(String driverName) { + this.driverName = driverName; + } + + public String getDriverPhone() { + return driverPhone; + } + + public void setDriverPhone(String driverPhone) { + this.driverPhone = driverPhone; + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/CarTypeLongBean.java b/app/src/main/java/com/oneclouds/cargo/bean/CarTypeLongBean.java new file mode 100644 index 0000000..d9650a4 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/CarTypeLongBean.java @@ -0,0 +1,139 @@ +package com.oneclouds.cargo.bean; + +import java.util.List; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/15 15:38 + * @description: + */ +public class CarTypeLongBean { + + private int res; + private int code; + private boolean success; + private String msg; + private DataDTO data; + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public DataDTO getData() { + return data; + } + + public void setData(DataDTO data) { + this.data = data; + } + + public static class DataDTO { + private List length; + private List type; + + public List getLength() { + return length; + } + + public void setLength(List length) { + this.length = length; + } + + public List getType() { + return type; + } + + public void setType(List type) { + this.type = type; + } + + public static class LengthDTO { + private int value; + private String name; + private String type; + + public int getValue() { + return value; + } + + public void setValue(int value) { + this.value = value; + } + + 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 static class TypeDTO { + private int value; + private String name; + private String type; + + public int getValue() { + return value; + } + + public void setValue(int value) { + this.value = value; + } + + 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; + } + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/CateAlListBean.java b/app/src/main/java/com/oneclouds/cargo/bean/CateAlListBean.java new file mode 100644 index 0000000..59882ad --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/CateAlListBean.java @@ -0,0 +1,77 @@ +package com.oneclouds.cargo.bean; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/14 18:07 + * @description: + */ +public class CateAlListBean { + + private int code; + private DataDTO data; + private String msg; + private int res; + private boolean success; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataDTO getData() { + return data; + } + + public void setData(DataDTO data) { + this.data = data; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public static class DataDTO { + private int id; + private String name; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/CateListBean.java b/app/src/main/java/com/oneclouds/cargo/bean/CateListBean.java new file mode 100644 index 0000000..09f98fc --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/CateListBean.java @@ -0,0 +1,159 @@ +package com.oneclouds.cargo.bean; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/14 18:04 + * @description: + */ +public class CateListBean { + + private int code; + private DataDTO data; + private String msg; + private int res; + private boolean success; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataDTO getData() { + return data; + } + + public void setData(DataDTO data) { + this.data = data; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public static class DataDTO { + private String cateName; + private String createTime; + private int id; + private int isDeleted; + private int isDisabled; + private int pid; + private String pname; + private String remarks; + private int shipperId; + private String shipperName; + private String updateTime; + + public String getCateName() { + return cateName; + } + + public void setCateName(String cateName) { + this.cateName = cateName; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getIsDeleted() { + return isDeleted; + } + + public void setIsDeleted(int isDeleted) { + this.isDeleted = isDeleted; + } + + public int getIsDisabled() { + return isDisabled; + } + + public void setIsDisabled(int isDisabled) { + this.isDisabled = isDisabled; + } + + public int getPid() { + return pid; + } + + public void setPid(int pid) { + this.pid = pid; + } + + public String getPname() { + return pname; + } + + public void setPname(String pname) { + this.pname = pname; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public int getShipperId() { + return shipperId; + } + + public void setShipperId(int shipperId) { + this.shipperId = shipperId; + } + + public String getShipperName() { + return shipperName; + } + + public void setShipperName(String shipperName) { + this.shipperName = shipperName; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/CompanyInfoBean.java b/app/src/main/java/com/oneclouds/cargo/bean/CompanyInfoBean.java new file mode 100644 index 0000000..f2d4628 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/CompanyInfoBean.java @@ -0,0 +1,320 @@ +package com.oneclouds.cargo.bean; + +import java.io.Serializable; + +/** + * @ClassName CompanyInfoBean + * @Author 用户 + * @Date 2022/7/11 17:26 + * @Description TODO + */ +public class CompanyInfoBean implements Serializable { + + + private String addressDetail; + private String applyTime; + private String area; + private String auditStatus; + private String auditTime; + private String businessLicense; + private String businessLicenseStatus; + private String city; + private String code; + private String companyShorterName; + private String contactName; + private String contactPhone; + private String corporationIdcard; + private String corporationIdcardPhoto; + private String corporationIdcardPhotoBack; + private String corporationIdcardPhotoHold; + private String corporationIdcardValidity; + private String corporationName; + private String corporationPhone; + private String corporationStatus; + private String direction; + private String driverTax; + private String id; + private String idcard; + private String idcardPhoto; + private String idcardPhotoBack; + private String idcardPhotoHold; + private String idcardStatus; + private String idcardValidity; + private String province; + private String realCompanyName; + private String reason; + private String userId; + private String warrant; + + public String getAddressDetail() { + return addressDetail; + } + + public void setAddressDetail(String addressDetail) { + this.addressDetail = addressDetail; + } + + public String getApplyTime() { + return applyTime; + } + + public void setApplyTime(String applyTime) { + this.applyTime = applyTime; + } + + public String getArea() { + return area; + } + + public void setArea(String area) { + this.area = area; + } + + public String getAuditStatus() { + return auditStatus; + } + + public void setAuditStatus(String auditStatus) { + this.auditStatus = auditStatus; + } + + public String getAuditTime() { + return auditTime; + } + + public void setAuditTime(String auditTime) { + this.auditTime = auditTime; + } + + public String getBusinessLicense() { + return businessLicense; + } + + public void setBusinessLicense(String businessLicense) { + this.businessLicense = businessLicense; + } + + public String getBusinessLicenseStatus() { + return businessLicenseStatus; + } + + public void setBusinessLicenseStatus(String businessLicenseStatus) { + this.businessLicenseStatus = businessLicenseStatus; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCompanyShorterName() { + return companyShorterName; + } + + public void setCompanyShorterName(String companyShorterName) { + this.companyShorterName = companyShorterName; + } + + public String getContactName() { + return contactName; + } + + public void setContactName(String contactName) { + this.contactName = contactName; + } + + public String getContactPhone() { + return contactPhone; + } + + public void setContactPhone(String contactPhone) { + this.contactPhone = contactPhone; + } + + public String getCorporationIdcard() { + return corporationIdcard; + } + + public void setCorporationIdcard(String corporationIdcard) { + this.corporationIdcard = corporationIdcard; + } + + public String getCorporationIdcardPhoto() { + return corporationIdcardPhoto; + } + + public void setCorporationIdcardPhoto(String corporationIdcardPhoto) { + this.corporationIdcardPhoto = corporationIdcardPhoto; + } + + public String getCorporationIdcardPhotoBack() { + return corporationIdcardPhotoBack; + } + + public void setCorporationIdcardPhotoBack(String corporationIdcardPhotoBack) { + this.corporationIdcardPhotoBack = corporationIdcardPhotoBack; + } + + public String getCorporationIdcardPhotoHold() { + return corporationIdcardPhotoHold; + } + + public void setCorporationIdcardPhotoHold(String corporationIdcardPhotoHold) { + this.corporationIdcardPhotoHold = corporationIdcardPhotoHold; + } + + public String getCorporationIdcardValidity() { + return corporationIdcardValidity; + } + + public void setCorporationIdcardValidity(String corporationIdcardValidity) { + this.corporationIdcardValidity = corporationIdcardValidity; + } + + public String getCorporationName() { + return corporationName; + } + + public void setCorporationName(String corporationName) { + this.corporationName = corporationName; + } + + public String getCorporationPhone() { + return corporationPhone; + } + + public void setCorporationPhone(String corporationPhone) { + this.corporationPhone = corporationPhone; + } + + public String getCorporationStatus() { + return corporationStatus; + } + + public void setCorporationStatus(String corporationStatus) { + this.corporationStatus = corporationStatus; + } + + public String getDirection() { + return direction; + } + + public void setDirection(String direction) { + this.direction = direction; + } + + public String getDriverTax() { + return driverTax; + } + + public void setDriverTax(String driverTax) { + this.driverTax = driverTax; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getIdcard() { + return idcard; + } + + public void setIdcard(String idcard) { + this.idcard = idcard; + } + + public String getIdcardPhoto() { + return idcardPhoto; + } + + public void setIdcardPhoto(String idcardPhoto) { + this.idcardPhoto = idcardPhoto; + } + + public String getIdcardPhotoBack() { + return idcardPhotoBack; + } + + public void setIdcardPhotoBack(String idcardPhotoBack) { + this.idcardPhotoBack = idcardPhotoBack; + } + + public String getIdcardPhotoHold() { + return idcardPhotoHold; + } + + public void setIdcardPhotoHold(String idcardPhotoHold) { + this.idcardPhotoHold = idcardPhotoHold; + } + + public String getIdcardStatus() { + return idcardStatus; + } + + public void setIdcardStatus(String idcardStatus) { + this.idcardStatus = idcardStatus; + } + + public String getIdcardValidity() { + return idcardValidity; + } + + public void setIdcardValidity(String idcardValidity) { + this.idcardValidity = idcardValidity; + } + + public String getProvince() { + return province; + } + + public void setProvince(String province) { + this.province = province; + } + + public String getRealCompanyName() { + return realCompanyName; + } + + public void setRealCompanyName(String realCompanyName) { + this.realCompanyName = realCompanyName; + } + + public String getReason() { + return reason; + } + + public void setReason(String reason) { + this.reason = reason; + } + + public String getUserId() { + return userId; + } + + public void setUserId(String userId) { + this.userId = userId; + } + + public String getWarrant() { + return warrant; + } + + public void setWarrant(String warrant) { + this.warrant = warrant; + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/ComplaintBean.java b/app/src/main/java/com/oneclouds/cargo/bean/ComplaintBean.java new file mode 100644 index 0000000..6e6139b --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/ComplaintBean.java @@ -0,0 +1,151 @@ +package com.oneclouds.cargo.bean; + +import java.util.List; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/8/30 19:48 + * @description: + */ +public class ComplaintBean { + + private int res; + private int code; + private boolean success; + private String msg; + private List data; + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public static class DataDTO { + private int waybillId; + private String content; + private Object listImgUrl; + private int type; + private int status; + private String handleContent; + private int handleUser; + private String handleTime; + private int appraiserId; + private Object folderId; + + public int getWaybillId() { + return waybillId; + } + + public void setWaybillId(int waybillId) { + this.waybillId = waybillId; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public Object getListImgUrl() { + return listImgUrl; + } + + public void setListImgUrl(Object listImgUrl) { + this.listImgUrl = listImgUrl; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public String getHandleContent() { + return handleContent; + } + + public void setHandleContent(String handleContent) { + this.handleContent = handleContent; + } + + public int getHandleUser() { + return handleUser; + } + + public void setHandleUser(int handleUser) { + this.handleUser = handleUser; + } + + public String getHandleTime() { + return handleTime; + } + + public void setHandleTime(String handleTime) { + this.handleTime = handleTime; + } + + public int getAppraiserId() { + return appraiserId; + } + + public void setAppraiserId(int appraiserId) { + this.appraiserId = appraiserId; + } + + public Object getFolderId() { + return folderId; + } + + public void setFolderId(Object folderId) { + this.folderId = folderId; + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/ConfigBean.java b/app/src/main/java/com/oneclouds/cargo/bean/ConfigBean.java new file mode 100644 index 0000000..a44f514 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/ConfigBean.java @@ -0,0 +1,124 @@ +package com.oneclouds.cargo.bean; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/11 11:53 + * @description: + */ +public class ConfigBean { + + + private int res; + private int code; + private boolean success; + private String msg; + private DataDTO data; + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public DataDTO getData() { + return data; + } + + public void setData(DataDTO data) { + this.data = data; + } + + public static class DataDTO { + + private String serviceMobile; + private String privateUrl; + private String userUrl; + private String contractUrl; + private String startImageUrl; + private String securityUrl; + private String shipperPrivateUrl; + + public String getShipperPrivateUrl() { + return shipperPrivateUrl == null ? "" : shipperPrivateUrl; + } + + public void setShipperPrivateUrl(String shipperPrivateUrl) { + this.shipperPrivateUrl = shipperPrivateUrl; + } + + public String getServiceMobile() { + return serviceMobile; + } + + public void setServiceMobile(String serviceMobile) { + this.serviceMobile = serviceMobile; + } + + public String getPrivateUrl() { + return privateUrl; + } + + public void setPrivateUrl(String privateUrl) { + this.privateUrl = privateUrl; + } + + public String getUserUrl() { + return userUrl; + } + + public void setUserUrl(String userUrl) { + this.userUrl = userUrl; + } + + public String getContractUrl() { + return contractUrl; + } + + public void setContractUrl(String contractUrl) { + this.contractUrl = contractUrl; + } + + public String getStartImageUrl() { + return startImageUrl; + } + + public void setStartImageUrl(String startImageUrl) { + this.startImageUrl = startImageUrl; + } + + public String getSecurityUrl() { + return securityUrl; + } + + public void setSecurityUrl(String securityUrl) { + this.securityUrl = securityUrl; + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/ContractsBean.java b/app/src/main/java/com/oneclouds/cargo/bean/ContractsBean.java new file mode 100644 index 0000000..5e543dc --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/ContractsBean.java @@ -0,0 +1,68 @@ +package com.oneclouds.cargo.bean; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/16 16:41 + * @description: + */ +public class ContractsBean { + + private int code; + private String msg; + private boolean success; + private DataDTO data; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public DataDTO getData() { + return data; + } + + public void setData(DataDTO data) { + this.data = data; + } + + public static class DataDTO { + private String bidsSnglFlgCd; + private String childAcctNo; + + public String getBidsSnglFlgCd() { + return bidsSnglFlgCd; + } + + public void setBidsSnglFlgCd(String bidsSnglFlgCd) { + this.bidsSnglFlgCd = bidsSnglFlgCd; + } + + public String getChildAcctNo() { + return childAcctNo; + } + + public void setChildAcctNo(String childAcctNo) { + this.childAcctNo = childAcctNo; + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/EvaluateBean.java b/app/src/main/java/com/oneclouds/cargo/bean/EvaluateBean.java new file mode 100644 index 0000000..b57d7e8 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/EvaluateBean.java @@ -0,0 +1,143 @@ +package com.oneclouds.cargo.bean; + +import java.util.List; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/22 15:09 + * @description: + */ +public class EvaluateBean { + + + private int code; + private List data; + private String msg; + private int res; + private boolean success; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public static class DataDTO { + private int appraiserId; + private int attitudeScore; + private String content; + private Object folderId; + private List listImgUrl; + private int multipleScore; + private int status; + private int type; + private int waybillId; + + public int getAppraiserId() { + return appraiserId; + } + + public void setAppraiserId(int appraiserId) { + this.appraiserId = appraiserId; + } + + public int getAttitudeScore() { + return attitudeScore; + } + + public void setAttitudeScore(int attitudeScore) { + this.attitudeScore = attitudeScore; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public Object getFolderId() { + return folderId; + } + + public void setFolderId(Object folderId) { + this.folderId = folderId; + } + + public List getListImgUrl() { + return listImgUrl; + } + + public void setListImgUrl(List listImgUrl) { + this.listImgUrl = listImgUrl; + } + + public int getMultipleScore() { + return multipleScore; + } + + public void setMultipleScore(int multipleScore) { + this.multipleScore = multipleScore; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public int getWaybillId() { + return waybillId; + } + + public void setWaybillId(int waybillId) { + this.waybillId = waybillId; + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/InvoiceHeaderBean.java b/app/src/main/java/com/oneclouds/cargo/bean/InvoiceHeaderBean.java new file mode 100644 index 0000000..1d2a597 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/InvoiceHeaderBean.java @@ -0,0 +1,187 @@ +package com.oneclouds.cargo.bean; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/23 11:35 + * @description: + */ +public class InvoiceHeaderBean { + + private int code; + private DataDTO data; + private String msg; + private int res; + private boolean success; + + public int getCode() { + + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataDTO getData() { + return data; + } + + public void setData(DataDTO data) { + this.data = data; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public static class DataDTO { + private String address; + private int area; + private String bankAccount; + private String bankName; + private int city; + private String createTime; + private int groupId; + private int id; + private String phone; + private int province; + private int shipperId; + private String shipperName; + private String taxNo; + private String title; + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public int getArea() { + return area; + } + + public void setArea(int area) { + this.area = area; + } + + public String getBankAccount() { + return bankAccount; + } + + public void setBankAccount(String bankAccount) { + this.bankAccount = bankAccount; + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public int getCity() { + return city; + } + + public void setCity(int city) { + this.city = city; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public int getGroupId() { + return groupId; + } + + public void setGroupId(int groupId) { + this.groupId = groupId; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public int getProvince() { + return province; + } + + public void setProvince(int province) { + this.province = province; + } + + public int getShipperId() { + return shipperId; + } + + public void setShipperId(int shipperId) { + this.shipperId = shipperId; + } + + public String getShipperName() { + return shipperName; + } + + public void setShipperName(String shipperName) { + this.shipperName = shipperName; + } + + public String getTaxNo() { + return taxNo; + } + + public void setTaxNo(String taxNo) { + this.taxNo = taxNo; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/InvoiceListBean.java b/app/src/main/java/com/oneclouds/cargo/bean/InvoiceListBean.java new file mode 100644 index 0000000..c397add --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/InvoiceListBean.java @@ -0,0 +1,607 @@ +package com.oneclouds.cargo.bean; + +import java.util.List; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/26 18:16 + * @description:发票申请记录 + */ +public class InvoiceListBean { + + private int res; + private int code; + private boolean success; + private String msg; + private DataDTO data; + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public DataDTO getData() { + return data; + } + + public void setData(DataDTO data) { + this.data = data; + } + + public static class DataDTO { + private List records; + private int total; + private int size; + private int current; + private List orders; + private boolean searchCount; + private int pages; + + public List getRecords() { + return records; + } + + public void setRecords(List records) { + this.records = records; + } + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public int getSize() { + return size; + } + + public void setSize(int size) { + this.size = size; + } + + public int getCurrent() { + return current; + } + + public void setCurrent(int current) { + this.current = current; + } + + public List getOrders() { + return orders; + } + + public void setOrders(List orders) { + this.orders = orders; + } + + public boolean isSearchCount() { + return searchCount; + } + + public void setSearchCount(boolean searchCount) { + this.searchCount = searchCount; + } + + public int getPages() { + return pages; + } + + public void setPages(int pages) { + this.pages = pages; + } + + public static class RecordsDTO { + private int page; + private int limit; + private int id; + private int nature; + private String title; + private String taxNo; + private Object bankName; + private Object bankAccount; + private Object address; + private Object phone; + private String code; + private String number; + private String receiveName; + private String receiveAddress; + private Object receiveCode; + private String receivePhone; + private Object sellerTitleId; + private Object sellerTitle; + private Object sellerTaxno; + private Object sellerBankName; + private Object sellerBankAccount; + private Object sellerAddress; + private Object sellerPhone; + private Object transportCompany; + private Object transportNum; + private int makeStatus; + private double applyMoney; + private int taxMoney; + private String applyTime; + private Object createTime; + private String remark; + private Object makeRemark; + private List orderList; + + public int getPage() { + return page; + } + + public void setPage(int page) { + this.page = page; + } + + public int getLimit() { + return limit; + } + + public void setLimit(int limit) { + this.limit = limit; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getNature() { + return nature; + } + + public void setNature(int nature) { + this.nature = nature; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getTaxNo() { + return taxNo; + } + + public void setTaxNo(String taxNo) { + this.taxNo = taxNo; + } + + public Object getBankName() { + return bankName; + } + + public void setBankName(Object bankName) { + this.bankName = bankName; + } + + public Object getBankAccount() { + return bankAccount; + } + + public void setBankAccount(Object bankAccount) { + this.bankAccount = bankAccount; + } + + public Object getAddress() { + return address; + } + + public void setAddress(Object address) { + this.address = address; + } + + public Object getPhone() { + return phone; + } + + public void setPhone(Object phone) { + this.phone = phone; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getNumber() { + return number; + } + + public void setNumber(String number) { + this.number = number; + } + + public String getReceiveName() { + return receiveName; + } + + public void setReceiveName(String receiveName) { + this.receiveName = receiveName; + } + + public String getReceiveAddress() { + return receiveAddress; + } + + public void setReceiveAddress(String receiveAddress) { + this.receiveAddress = receiveAddress; + } + + public Object getReceiveCode() { + return receiveCode; + } + + public void setReceiveCode(Object receiveCode) { + this.receiveCode = receiveCode; + } + + public String getReceivePhone() { + return receivePhone; + } + + public void setReceivePhone(String receivePhone) { + this.receivePhone = receivePhone; + } + + public Object getSellerTitleId() { + return sellerTitleId; + } + + public void setSellerTitleId(Object sellerTitleId) { + this.sellerTitleId = sellerTitleId; + } + + public Object getSellerTitle() { + return sellerTitle; + } + + public void setSellerTitle(Object sellerTitle) { + this.sellerTitle = sellerTitle; + } + + public Object getSellerTaxno() { + return sellerTaxno; + } + + public void setSellerTaxno(Object sellerTaxno) { + this.sellerTaxno = sellerTaxno; + } + + public Object getSellerBankName() { + return sellerBankName; + } + + public void setSellerBankName(Object sellerBankName) { + this.sellerBankName = sellerBankName; + } + + public Object getSellerBankAccount() { + return sellerBankAccount; + } + + public void setSellerBankAccount(Object sellerBankAccount) { + this.sellerBankAccount = sellerBankAccount; + } + + public Object getSellerAddress() { + return sellerAddress; + } + + public void setSellerAddress(Object sellerAddress) { + this.sellerAddress = sellerAddress; + } + + public Object getSellerPhone() { + return sellerPhone; + } + + public void setSellerPhone(Object sellerPhone) { + this.sellerPhone = sellerPhone; + } + + public Object getTransportCompany() { + return transportCompany; + } + + public void setTransportCompany(Object transportCompany) { + this.transportCompany = transportCompany; + } + + public Object getTransportNum() { + return transportNum; + } + + public void setTransportNum(Object transportNum) { + this.transportNum = transportNum; + } + + public int getMakeStatus() { + return makeStatus; + } + + public void setMakeStatus(int makeStatus) { + this.makeStatus = makeStatus; + } + + public double getApplyMoney() { + return applyMoney; + } + + public void setApplyMoney(double applyMoney) { + this.applyMoney = applyMoney; + } + + public int getTaxMoney() { + return taxMoney; + } + + public void setTaxMoney(int taxMoney) { + this.taxMoney = taxMoney; + } + + public String getApplyTime() { + return applyTime; + } + + public void setApplyTime(String applyTime) { + this.applyTime = applyTime; + } + + public Object getCreateTime() { + return createTime; + } + + public void setCreateTime(Object createTime) { + this.createTime = createTime; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public Object getMakeRemark() { + return makeRemark; + } + + public void setMakeRemark(Object makeRemark) { + this.makeRemark = makeRemark; + } + + public List getOrderList() { + return orderList; + } + + public void setOrderList(List orderList) { + this.orderList = orderList; + } + + public static class OrderListDTO { + private Object id; + private String orderNum; + private String waybillNum; + private Object status; + private Object auditStatus; + private Object loadingProvince; + private Object loadingCity; + private Object loadingArea; + private Object loadingProvinceCityArea; + private Object loadingDeadline; + private Object receiverProvince; + private Object receiverCity; + private Object receiverArea; + private Object receiverProvinceCityArea; + private Object receiverDeadline; + private String submitTime; + private Object isTrailer; + private Object shipperName; + private double totalGoodsPrice; + private Object totalGoodsNum; + + public Object getId() { + return id; + } + + public void setId(Object id) { + this.id = id; + } + + public String getOrderNum() { + return orderNum; + } + + public void setOrderNum(String orderNum) { + this.orderNum = orderNum; + } + + public String getWaybillNum() { + return waybillNum; + } + + public void setWaybillNum(String waybillNum) { + this.waybillNum = waybillNum; + } + + public Object getStatus() { + return status; + } + + public void setStatus(Object status) { + this.status = status; + } + + public Object getAuditStatus() { + return auditStatus; + } + + public void setAuditStatus(Object auditStatus) { + this.auditStatus = auditStatus; + } + + public Object getLoadingProvince() { + return loadingProvince; + } + + public void setLoadingProvince(Object loadingProvince) { + this.loadingProvince = loadingProvince; + } + + public Object getLoadingCity() { + return loadingCity; + } + + public void setLoadingCity(Object loadingCity) { + this.loadingCity = loadingCity; + } + + public Object getLoadingArea() { + return loadingArea; + } + + public void setLoadingArea(Object loadingArea) { + this.loadingArea = loadingArea; + } + + public Object getLoadingProvinceCityArea() { + return loadingProvinceCityArea; + } + + public void setLoadingProvinceCityArea(Object loadingProvinceCityArea) { + this.loadingProvinceCityArea = loadingProvinceCityArea; + } + + public Object getLoadingDeadline() { + return loadingDeadline; + } + + public void setLoadingDeadline(Object loadingDeadline) { + this.loadingDeadline = loadingDeadline; + } + + public Object getReceiverProvince() { + return receiverProvince; + } + + public void setReceiverProvince(Object receiverProvince) { + this.receiverProvince = receiverProvince; + } + + public Object getReceiverCity() { + return receiverCity; + } + + public void setReceiverCity(Object receiverCity) { + this.receiverCity = receiverCity; + } + + public Object getReceiverArea() { + return receiverArea; + } + + public void setReceiverArea(Object receiverArea) { + this.receiverArea = receiverArea; + } + + public Object getReceiverProvinceCityArea() { + return receiverProvinceCityArea; + } + + public void setReceiverProvinceCityArea(Object receiverProvinceCityArea) { + this.receiverProvinceCityArea = receiverProvinceCityArea; + } + + public Object getReceiverDeadline() { + return receiverDeadline; + } + + public void setReceiverDeadline(Object receiverDeadline) { + this.receiverDeadline = receiverDeadline; + } + + public String getSubmitTime() { + return submitTime; + } + + public void setSubmitTime(String submitTime) { + this.submitTime = submitTime; + } + + public Object getIsTrailer() { + return isTrailer; + } + + public void setIsTrailer(Object isTrailer) { + this.isTrailer = isTrailer; + } + + public Object getShipperName() { + return shipperName; + } + + public void setShipperName(Object shipperName) { + this.shipperName = shipperName; + } + + public double getTotalGoodsPrice() { + return totalGoodsPrice; + } + + public void setTotalGoodsPrice(double totalGoodsPrice) { + this.totalGoodsPrice = totalGoodsPrice; + } + + public Object getTotalGoodsNum() { + return totalGoodsNum; + } + + public void setTotalGoodsNum(Object totalGoodsNum) { + this.totalGoodsNum = totalGoodsNum; + } + } + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/LoginBean.java b/app/src/main/java/com/oneclouds/cargo/bean/LoginBean.java new file mode 100644 index 0000000..392c5dd --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/LoginBean.java @@ -0,0 +1,275 @@ +package com.oneclouds.cargo.bean; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/8/2 10:24 + * @description: + */ +public class LoginBean { + + private int res; + private int code; + private boolean success; + private String msg; + private DataDTO data; + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public DataDTO getData() { + return data; + } + + public void setData(DataDTO data) { + this.data = data; + } + + public static class DataDTO { + private String token; + private int id; + private int roleId; + private String uname; + private String registerPhone; + private String rname; + private Object companyName; + private Object account; + private Object credit; + private Object surplusCredit; + private Object etcBalance; + private Object oliBalance; + private Object invoiceMoney; + private String headportraitUrl; + private String salt; + private String jumpUrl; + private Object auditStatus; + private Object distance; + private Object waybillNum; + private Object idCardValidity; + private Object driverValidity; + private Object qualificationValidity; + private Object isCar; + private Object qrcodeUrl; + + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getRoleId() { + return roleId; + } + + public void setRoleId(int roleId) { + this.roleId = roleId; + } + + public String getUname() { + return uname; + } + + public void setUname(String uname) { + this.uname = uname; + } + + public String getRegisterPhone() { + return registerPhone; + } + + public void setRegisterPhone(String registerPhone) { + this.registerPhone = registerPhone; + } + + public String getRname() { + return rname; + } + + public void setRname(String rname) { + this.rname = rname; + } + + public Object getCompanyName() { + return companyName; + } + + public void setCompanyName(Object companyName) { + this.companyName = companyName; + } + + public Object getAccount() { + return account; + } + + public void setAccount(Object account) { + this.account = account; + } + + public Object getCredit() { + return credit; + } + + public void setCredit(Object credit) { + this.credit = credit; + } + + public Object getSurplusCredit() { + return surplusCredit; + } + + public void setSurplusCredit(Object surplusCredit) { + this.surplusCredit = surplusCredit; + } + + public Object getEtcBalance() { + return etcBalance; + } + + public void setEtcBalance(Object etcBalance) { + this.etcBalance = etcBalance; + } + + public Object getOliBalance() { + return oliBalance; + } + + public void setOliBalance(Object oliBalance) { + this.oliBalance = oliBalance; + } + + public Object getInvoiceMoney() { + return invoiceMoney; + } + + public void setInvoiceMoney(Object invoiceMoney) { + this.invoiceMoney = invoiceMoney; + } + + public String getHeadportraitUrl() { + return headportraitUrl; + } + + public void setHeadportraitUrl(String headportraitUrl) { + this.headportraitUrl = headportraitUrl; + } + + public String getSalt() { + return salt; + } + + public void setSalt(String salt) { + this.salt = salt; + } + + public String getJumpUrl() { + return jumpUrl; + } + + public void setJumpUrl(String jumpUrl) { + this.jumpUrl = jumpUrl; + } + + public Object getAuditStatus() { + return auditStatus; + } + + public void setAuditStatus(Object auditStatus) { + this.auditStatus = auditStatus; + } + + public Object getDistance() { + return distance; + } + + public void setDistance(Object distance) { + this.distance = distance; + } + + public Object getWaybillNum() { + return waybillNum; + } + + public void setWaybillNum(Object waybillNum) { + this.waybillNum = waybillNum; + } + + public Object getIdCardValidity() { + return idCardValidity; + } + + public void setIdCardValidity(Object idCardValidity) { + this.idCardValidity = idCardValidity; + } + + public Object getDriverValidity() { + return driverValidity; + } + + public void setDriverValidity(Object driverValidity) { + this.driverValidity = driverValidity; + } + + public Object getQualificationValidity() { + return qualificationValidity; + } + + public void setQualificationValidity(Object qualificationValidity) { + this.qualificationValidity = qualificationValidity; + } + + public Object getIsCar() { + return isCar; + } + + public void setIsCar(Object isCar) { + this.isCar = isCar; + } + + public Object getQrcodeUrl() { + return qrcodeUrl; + } + + public void setQrcodeUrl(Object qrcodeUrl) { + this.qrcodeUrl = qrcodeUrl; + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/NewsListBean.java b/app/src/main/java/com/oneclouds/cargo/bean/NewsListBean.java new file mode 100644 index 0000000..14eb421 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/NewsListBean.java @@ -0,0 +1,227 @@ +package com.oneclouds.cargo.bean; + +import java.util.List; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/16 15:30 + * @description: + */ +public class NewsListBean { + + private int res; + private int code; + private boolean success; + private String msg; + private DataDTO data; + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public DataDTO getData() { + return data; + } + + public void setData(DataDTO data) { + this.data = data; + } + + public static class DataDTO { + private List records; + private int total; + private int size; + private int current; + private List orders; + private boolean searchCount; + private int pages; + + public List getRecords() { + return records; + } + + public void setRecords(List records) { + this.records = records; + } + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public int getSize() { + return size; + } + + public void setSize(int size) { + this.size = size; + } + + public int getCurrent() { + return current; + } + + public void setCurrent(int current) { + this.current = current; + } + + public List getOrders() { + return orders; + } + + public void setOrders(List orders) { + this.orders = orders; + } + + public boolean isSearchCount() { + return searchCount; + } + + public void setSearchCount(boolean searchCount) { + this.searchCount = searchCount; + } + + public int getPages() { + return pages; + } + + public void setPages(int pages) { + this.pages = pages; + } + + public static class RecordsDTO { + private int id; + private int cate; + private String content; + private int isRead; + private int forwordType; + private int forwordId; + private int receiverId; + private String receiverName; + private int createUser; + private String createUserName; + private String createTime; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getCate() { + return cate; + } + + public void setCate(int cate) { + this.cate = cate; + } + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public int getIsRead() { + return isRead; + } + + public void setIsRead(int isRead) { + this.isRead = isRead; + } + + public int getForwordType() { + return forwordType; + } + + public void setForwordType(int forwordType) { + this.forwordType = forwordType; + } + + public int getForwordId() { + return forwordId; + } + + public void setForwordId(int forwordId) { + this.forwordId = forwordId; + } + + public int getReceiverId() { + return receiverId; + } + + public void setReceiverId(int receiverId) { + this.receiverId = receiverId; + } + + public String getReceiverName() { + return receiverName; + } + + public void setReceiverName(String receiverName) { + this.receiverName = receiverName; + } + + public int getCreateUser() { + return createUser; + } + + public void setCreateUser(int createUser) { + this.createUser = createUser; + } + + public String getCreateUserName() { + return createUserName; + } + + public void setCreateUserName(String createUserName) { + this.createUserName = createUserName; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + } + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/NewsNotBean.java b/app/src/main/java/com/oneclouds/cargo/bean/NewsNotBean.java new file mode 100644 index 0000000..37ce244 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/NewsNotBean.java @@ -0,0 +1,88 @@ +package com.oneclouds.cargo.bean; + +import java.util.List; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/16 14:46 + * @description: + */ +public class NewsNotBean { + + private int res; + private int code; + private boolean success; + private String msg; + private List data; + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public static class DataDTO { + private int count; + private String messageTypeName; + private int vcode; + + public int getCount() { + return count; + } + + public void setCount(int count) { + this.count = count; + } + + public String getMessageTypeName() { + return messageTypeName; + } + + public void setMessageTypeName(String messageTypeName) { + this.messageTypeName = messageTypeName; + } + + public int getVcode() { + return vcode; + } + + public void setVcode(int vcode) { + this.vcode = vcode; + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/NpListBean.java b/app/src/main/java/com/oneclouds/cargo/bean/NpListBean.java new file mode 100644 index 0000000..d6cfeed --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/NpListBean.java @@ -0,0 +1,160 @@ +package com.oneclouds.cargo.bean; + +import java.util.List; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/15 16:26 + * @description:货物大类列表 + */ +public class NpListBean { + + private int res; + private int code; + private boolean success; + private String msg; + private List data; + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public static class DataDTO { + private int id; + private int pid; + private String cateName; + private int shipperId; + private Object shipperName; + private String remarks; + private int isDeleted; + private int isDisabled; + private String createTime; + private String updateTime; + private Object pname; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getPid() { + return pid; + } + + public void setPid(int pid) { + this.pid = pid; + } + + public String getCateName() { + return cateName; + } + + public void setCateName(String cateName) { + this.cateName = cateName; + } + + public int getShipperId() { + return shipperId; + } + + public void setShipperId(int shipperId) { + this.shipperId = shipperId; + } + + public Object getShipperName() { + return shipperName; + } + + public void setShipperName(Object shipperName) { + this.shipperName = shipperName; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + + public int getIsDeleted() { + return isDeleted; + } + + public void setIsDeleted(int isDeleted) { + this.isDeleted = isDeleted; + } + + public int getIsDisabled() { + return isDisabled; + } + + public void setIsDisabled(int isDisabled) { + this.isDisabled = isDisabled; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public Object getPname() { + return pname; + } + + public void setPname(Object pname) { + this.pname = pname; + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/OptionBaseBean.java b/app/src/main/java/com/oneclouds/cargo/bean/OptionBaseBean.java new file mode 100644 index 0000000..a7724a7 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/OptionBaseBean.java @@ -0,0 +1,53 @@ +package com.oneclouds.cargo.bean; + +import androidx.annotation.NonNull; + +import com.github.gzuliyujiang.wheelview.contract.TextProvider; + +import java.io.Serializable; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/15 17:21 + * @description: + */ +public class OptionBaseBean implements Serializable, TextProvider { + private int id; + private String name; + + public OptionBaseBean(int id, String name) { + this.id = id; + this.name = name; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Override + public String provideText() { + return name; + } + + @NonNull + @Override + public String toString() { + return "GoodsCategoryBean{" + + "id=" + id + + ", name='" + name + '\'' + + '}'; + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/OptionBean.java b/app/src/main/java/com/oneclouds/cargo/bean/OptionBean.java new file mode 100644 index 0000000..212e93d --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/OptionBean.java @@ -0,0 +1,58 @@ +package com.oneclouds.cargo.bean; + +import java.util.List; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/15 16:16 + * @description: + */ +public class OptionBean { + + private int res; + private int code; + private boolean success; + private String msg; + private List data; + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/OrderBean.java b/app/src/main/java/com/oneclouds/cargo/bean/OrderBean.java new file mode 100644 index 0000000..a378abd --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/OrderBean.java @@ -0,0 +1,937 @@ +package com.oneclouds.cargo.bean; + +import java.util.List; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/27 15:39 + * @description: + */ +public class OrderBean { + + private int res; + private int code; + private boolean success; + private String msg; + private DataDTO data; + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public DataDTO getData() { + return data; + } + + public void setData(DataDTO data) { + this.data = data; + } + + public static class DataDTO { + private int id; + private Object waybillId; + private String orderNum; + private Object shipperId; + private Object loadingName; + private Object loadingPhone; + private Object loadingProvinceCityArea; + private String loadingAddress; + private String loadingDeadline; + private Object receiverName; + private Object receiverPhone; + private Object receiverProvinceCityArea; + private String receiverAddress; + private String receiverDeadline; + private Object allowSplitting; + private Object goodsValue; + private boolean isInsure; + private Object insureAmount; + private String effectiveTime; + private String distance; + private int vehicleType; + private Object vehicleTypeName; + private int vehicleLength; + private Object vehicleLengthName; + private Object namedDrivers; + private String requirement; + private String totalFreight; + private Object failedReason; + private List sendInfo; + private List putInfo; + private String sendPutString; + private Object report; + private Object contractTemplateUrl; + private int status; + private String statusOver; + private String contactName; + private String contactPhone; + private int goodsBigCate; + private int alctGoodsType; + private int businessType; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public Object getWaybillId() { + return waybillId; + } + + public void setWaybillId(Object waybillId) { + this.waybillId = waybillId; + } + + public String getOrderNum() { + return orderNum; + } + + public void setOrderNum(String orderNum) { + this.orderNum = orderNum; + } + + public Object getShipperId() { + return shipperId; + } + + public void setShipperId(Object shipperId) { + this.shipperId = shipperId; + } + + public Object getLoadingName() { + return loadingName; + } + + public void setLoadingName(Object loadingName) { + this.loadingName = loadingName; + } + + public Object getLoadingPhone() { + return loadingPhone; + } + + public void setLoadingPhone(Object loadingPhone) { + this.loadingPhone = loadingPhone; + } + + public Object getLoadingProvinceCityArea() { + return loadingProvinceCityArea; + } + + public void setLoadingProvinceCityArea(Object loadingProvinceCityArea) { + this.loadingProvinceCityArea = loadingProvinceCityArea; + } + + public String getLoadingAddress() { + return loadingAddress; + } + + public void setLoadingAddress(String loadingAddress) { + this.loadingAddress = loadingAddress; + } + + public String getLoadingDeadline() { + return loadingDeadline; + } + + public void setLoadingDeadline(String loadingDeadline) { + this.loadingDeadline = loadingDeadline; + } + + public Object getReceiverName() { + return receiverName; + } + + public void setReceiverName(Object receiverName) { + this.receiverName = receiverName; + } + + public Object getReceiverPhone() { + return receiverPhone; + } + + public void setReceiverPhone(Object receiverPhone) { + this.receiverPhone = receiverPhone; + } + + public Object getReceiverProvinceCityArea() { + return receiverProvinceCityArea; + } + + public void setReceiverProvinceCityArea(Object receiverProvinceCityArea) { + this.receiverProvinceCityArea = receiverProvinceCityArea; + } + + public String getReceiverAddress() { + return receiverAddress; + } + + public void setReceiverAddress(String receiverAddress) { + this.receiverAddress = receiverAddress; + } + + public String getReceiverDeadline() { + return receiverDeadline; + } + + public void setReceiverDeadline(String receiverDeadline) { + this.receiverDeadline = receiverDeadline; + } + + public Object getAllowSplitting() { + return allowSplitting; + } + + public void setAllowSplitting(Object allowSplitting) { + this.allowSplitting = allowSplitting; + } + + public Object getGoodsValue() { + return goodsValue; + } + + public void setGoodsValue(Object goodsValue) { + this.goodsValue = goodsValue; + } + + public boolean getIsInsure() { + return isInsure; + } + + public void setIsInsure(boolean isInsure) { + this.isInsure = isInsure; + } + + public Object getInsureAmount() { + return insureAmount; + } + + public void setInsureAmount(Object insureAmount) { + this.insureAmount = insureAmount; + } + + public String getEffectiveTime() { + return effectiveTime; + } + + public void setEffectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + } + + public String getDistance() { + return distance; + } + + public void setDistance(String distance) { + this.distance = distance; + } + + public int getVehicleType() { + return vehicleType; + } + + public void setVehicleType(int vehicleType) { + this.vehicleType = vehicleType; + } + + public Object getVehicleTypeName() { + return vehicleTypeName; + } + + public void setVehicleTypeName(Object vehicleTypeName) { + this.vehicleTypeName = vehicleTypeName; + } + + public int getVehicleLength() { + return vehicleLength; + } + + public void setVehicleLength(int vehicleLength) { + this.vehicleLength = vehicleLength; + } + + public Object getVehicleLengthName() { + return vehicleLengthName; + } + + public void setVehicleLengthName(Object vehicleLengthName) { + this.vehicleLengthName = vehicleLengthName; + } + + public Object getNamedDrivers() { + return namedDrivers; + } + + public void setNamedDrivers(Object namedDrivers) { + this.namedDrivers = namedDrivers; + } + + public String getRequirement() { + return requirement; + } + + public void setRequirement(String requirement) { + this.requirement = requirement; + } + + public String getTotalFreight() { + return totalFreight; + } + + public void setTotalFreight(String totalFreight) { + this.totalFreight = totalFreight; + } + + public Object getFailedReason() { + return failedReason; + } + + public void setFailedReason(Object failedReason) { + this.failedReason = failedReason; + } + + public List getSendInfo() { + return sendInfo; + } + + public void setSendInfo(List sendInfo) { + this.sendInfo = sendInfo; + } + + public List getPutInfo() { + return putInfo; + } + + public void setPutInfo(List putInfo) { + this.putInfo = putInfo; + } + + public String getSendPutString() { + return sendPutString; + } + + public void setSendPutString(String sendPutString) { + this.sendPutString = sendPutString; + } + + public Object getReport() { + return report; + } + + public void setReport(Object report) { + this.report = report; + } + + public Object getContractTemplateUrl() { + return contractTemplateUrl; + } + + public void setContractTemplateUrl(Object contractTemplateUrl) { + this.contractTemplateUrl = contractTemplateUrl; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public String getStatusOver() { + return statusOver; + } + + public void setStatusOver(String statusOver) { + this.statusOver = statusOver; + } + + public String getContactName() { + return contactName; + } + + public void setContactName(String contactName) { + this.contactName = contactName; + } + + public String getContactPhone() { + return contactPhone; + } + + public void setContactPhone(String contactPhone) { + this.contactPhone = contactPhone; + } + + public int getGoodsBigCate() { + return goodsBigCate; + } + + public void setGoodsBigCate(int goodsBigCate) { + this.goodsBigCate = goodsBigCate; + } + + public int getAlctGoodsType() { + return alctGoodsType; + } + + public void setAlctGoodsType(int alctGoodsType) { + this.alctGoodsType = alctGoodsType; + } + + public int getBusinessType() { + return businessType; + } + + public void setBusinessType(int businessType) { + this.businessType = businessType; + } + + public static class SendInfoDTO { + private long childNumber; + private int pid; + private String name; + private String phone; + private int province; + private int city; + private int area; + private String provinceCityArea; + private String address; + private String deadline; + private int type; + private int status; + private int displayOrder; + private Object totalAmount; + private String createTime; + private String longitude; + private String latitude; + private String businessName; + private String businessCode; + private List goods; + + public long getChildNumber() { + return childNumber; + } + + public void setChildNumber(long childNumber) { + this.childNumber = childNumber; + } + + public int getPid() { + return pid; + } + + public void setPid(int pid) { + this.pid = pid; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public int getProvince() { + return province; + } + + public void setProvince(int province) { + this.province = province; + } + + public int getCity() { + return city; + } + + public void setCity(int city) { + this.city = city; + } + + public int getArea() { + return area; + } + + public void setArea(int area) { + this.area = area; + } + + public String getProvinceCityArea() { + return provinceCityArea; + } + + public void setProvinceCityArea(String provinceCityArea) { + this.provinceCityArea = provinceCityArea; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getDeadline() { + return deadline; + } + + public void setDeadline(String deadline) { + this.deadline = deadline; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public int getDisplayOrder() { + return displayOrder; + } + + public void setDisplayOrder(int displayOrder) { + this.displayOrder = displayOrder; + } + + public Object getTotalAmount() { + return totalAmount; + } + + public void setTotalAmount(Object totalAmount) { + this.totalAmount = totalAmount; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getLongitude() { + return longitude; + } + + public void setLongitude(String longitude) { + this.longitude = longitude; + } + + public String getLatitude() { + return latitude; + } + + public void setLatitude(String latitude) { + this.latitude = latitude; + } + + public String getBusinessName() { + return businessName; + } + + public void setBusinessName(String businessName) { + this.businessName = businessName; + } + + public String getBusinessCode() { + return businessCode; + } + + public void setBusinessCode(String businessCode) { + this.businessCode = businessCode; + } + + public List getGoods() { + return goods; + } + + public void setGoods(List goods) { + this.goods = goods; + } + + public static class GoodsDTO { + private long id; + private long childrenId; + private String goodName; + private String goodNum; + private String goodUnit; + private String goodPrice; + private String packName; + private Object createTime; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public long getChildrenId() { + return childrenId; + } + + public void setChildrenId(long childrenId) { + this.childrenId = childrenId; + } + + public String getGoodName() { + return goodName; + } + + public void setGoodName(String goodName) { + this.goodName = goodName; + } + + public String getGoodNum() { + return goodNum; + } + + public void setGoodNum(String goodNum) { + this.goodNum = goodNum; + } + + public String getGoodUnit() { + return goodUnit; + } + + public void setGoodUnit(String goodUnit) { + this.goodUnit = goodUnit; + } + + public String getGoodPrice() { + return goodPrice; + } + + public void setGoodPrice(String goodPrice) { + this.goodPrice = goodPrice; + } + + public String getPackName() { + return packName; + } + + public void setPackName(String packName) { + this.packName = packName; + } + + public Object getCreateTime() { + return createTime; + } + + public void setCreateTime(Object createTime) { + this.createTime = createTime; + } + } + } + + public static class PutInfoDTO { + private long childNumber; + private int pid; + private String name; + private String phone; + private int province; + private int city; + private int area; + private String provinceCityArea; + private String address; + private String deadline; + private int type; + private int status; + private int displayOrder; + private Object totalAmount; + private String createTime; + private String longitude; + private String latitude; + private String businessName; + private String businessCode; + private List goods; + + public long getChildNumber() { + return childNumber; + } + + public void setChildNumber(long childNumber) { + this.childNumber = childNumber; + } + + public int getPid() { + return pid; + } + + public void setPid(int pid) { + this.pid = pid; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public int getProvince() { + return province; + } + + public void setProvince(int province) { + this.province = province; + } + + public int getCity() { + return city; + } + + public void setCity(int city) { + this.city = city; + } + + public int getArea() { + return area; + } + + public void setArea(int area) { + this.area = area; + } + + public String getProvinceCityArea() { + return provinceCityArea; + } + + public void setProvinceCityArea(String provinceCityArea) { + this.provinceCityArea = provinceCityArea; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getDeadline() { + return deadline; + } + + public void setDeadline(String deadline) { + this.deadline = deadline; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public int getDisplayOrder() { + return displayOrder; + } + + public void setDisplayOrder(int displayOrder) { + this.displayOrder = displayOrder; + } + + public Object getTotalAmount() { + return totalAmount; + } + + public void setTotalAmount(Object totalAmount) { + this.totalAmount = totalAmount; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getLongitude() { + return longitude; + } + + public void setLongitude(String longitude) { + this.longitude = longitude; + } + + public String getLatitude() { + return latitude; + } + + public void setLatitude(String latitude) { + this.latitude = latitude; + } + + public String getBusinessName() { + return businessName; + } + + public void setBusinessName(String businessName) { + this.businessName = businessName; + } + + public String getBusinessCode() { + return businessCode; + } + + public void setBusinessCode(String businessCode) { + this.businessCode = businessCode; + } + + public List getGoods() { + return goods; + } + + public void setGoods(List goods) { + this.goods = goods; + } + + public static class GoodsDTO { + private long id; + private long childrenId; + private String goodName; + private String goodNum; + private String goodUnit; + private String goodPrice; + private String packName; + private Object createTime; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public long getChildrenId() { + return childrenId; + } + + public void setChildrenId(long childrenId) { + this.childrenId = childrenId; + } + + public String getGoodName() { + return goodName; + } + + public void setGoodName(String goodName) { + this.goodName = goodName; + } + + public String getGoodNum() { + return goodNum; + } + + public void setGoodNum(String goodNum) { + this.goodNum = goodNum; + } + + public String getGoodUnit() { + return goodUnit; + } + + public void setGoodUnit(String goodUnit) { + this.goodUnit = goodUnit; + } + + public String getGoodPrice() { + return goodPrice; + } + + public void setGoodPrice(String goodPrice) { + this.goodPrice = goodPrice; + } + + public String getPackName() { + return packName; + } + + public void setPackName(String packName) { + this.packName = packName; + } + + public Object getCreateTime() { + return createTime; + } + + public void setCreateTime(Object createTime) { + this.createTime = createTime; + } + } + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/OrderDetailsBean.java b/app/src/main/java/com/oneclouds/cargo/bean/OrderDetailsBean.java new file mode 100644 index 0000000..646033a --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/OrderDetailsBean.java @@ -0,0 +1,483 @@ +package com.oneclouds.cargo.bean; + +import java.util.List; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/22 15:05 + * @description: + */ +public class OrderDetailsBean { + + + private int code; + private DataDTO data; + private String msg; + private int res; + private boolean success; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataDTO getData() { + return data; + } + + public void setData(DataDTO data) { + this.data = data; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public static class DataDTO { + private String acceptTime; + private int avgScore; + private String carNumber; + private String carType; + private String contractUrl; + private String distance; + private String driverName; + private String endCountrySubdivisionCode; + private int isEvaluation; + private String nfcId; + private int operation; + private int report; + private int reportAlct; + private String serialNumber; + private String shippingNoteNumber; + private String startCountrySubdivisionCode; + private String totalAmount; + private List wayChildren; + private String waybillStatus; + + public String getAcceptTime() { + return acceptTime; + } + + public void setAcceptTime(String acceptTime) { + this.acceptTime = acceptTime; + } + + public int getAvgScore() { + return avgScore; + } + + public void setAvgScore(int avgScore) { + this.avgScore = avgScore; + } + + public String getCarNumber() { + return carNumber; + } + + public void setCarNumber(String carNumber) { + this.carNumber = carNumber; + } + + public String getCarType() { + return carType; + } + + public void setCarType(String carType) { + this.carType = carType; + } + + public String getContractUrl() { + return contractUrl; + } + + public void setContractUrl(String contractUrl) { + this.contractUrl = contractUrl; + } + + public String getDistance() { + return distance; + } + + public void setDistance(String distance) { + this.distance = distance; + } + + public String getDriverName() { + return driverName; + } + + public void setDriverName(String driverName) { + this.driverName = driverName; + } + + public String getEndCountrySubdivisionCode() { + return endCountrySubdivisionCode; + } + + public void setEndCountrySubdivisionCode(String endCountrySubdivisionCode) { + this.endCountrySubdivisionCode = endCountrySubdivisionCode; + } + + public int getIsEvaluation() { + return isEvaluation; + } + + public void setIsEvaluation(int isEvaluation) { + this.isEvaluation = isEvaluation; + } + + public String getNfcId() { + return nfcId; + } + + public void setNfcId(String nfcId) { + this.nfcId = nfcId; + } + + public int getOperation() { + return operation; + } + + public void setOperation(int operation) { + this.operation = operation; + } + + public int getReport() { + return report; + } + + public void setReport(int report) { + this.report = report; + } + + public int getReportAlct() { + return reportAlct; + } + + public void setReportAlct(int reportAlct) { + this.reportAlct = reportAlct; + } + + public String getSerialNumber() { + return serialNumber; + } + + public void setSerialNumber(String serialNumber) { + this.serialNumber = serialNumber; + } + + public String getShippingNoteNumber() { + return shippingNoteNumber; + } + + public void setShippingNoteNumber(String shippingNoteNumber) { + this.shippingNoteNumber = shippingNoteNumber; + } + + public String getStartCountrySubdivisionCode() { + return startCountrySubdivisionCode; + } + + public void setStartCountrySubdivisionCode(String startCountrySubdivisionCode) { + this.startCountrySubdivisionCode = startCountrySubdivisionCode; + } + + public String getTotalAmount() { + return totalAmount; + } + + public void setTotalAmount(String totalAmount) { + this.totalAmount = totalAmount; + } + + public List getWayChildren() { + return wayChildren; + } + + public void setWayChildren(List wayChildren) { + this.wayChildren = wayChildren; + } + + public String getWaybillStatus() { + return waybillStatus; + } + + public void setWaybillStatus(String waybillStatus) { + this.waybillStatus = waybillStatus; + } + + public static class WayChildrenDTO { + private String address; + private String deadline; + private int delay; + private String displayOrder; + private List goods; + private String id; + private String latitude; + private String longitude; + private String receiptLatitude; + private String receiptLocationAddress; + private String receiptLongitude; + private String receiptTime; + private List receiptUrl; + private int report; + private int reportAlct; + private List sendPutImagesUrl; + private String sendPutLatitude; + private String sendPutLocationAddress; + private String sendPutLongitude; + private int status; + private int type; + private String updateTime; + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getDeadline() { + return deadline; + } + + public void setDeadline(String deadline) { + this.deadline = deadline; + } + + public int getDelay() { + return delay; + } + + public void setDelay(int delay) { + this.delay = delay; + } + + public String getDisplayOrder() { + return displayOrder; + } + + public void setDisplayOrder(String displayOrder) { + this.displayOrder = displayOrder; + } + + public List getGoods() { + return goods; + } + + public void setGoods(List goods) { + this.goods = goods; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + 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 getReceiptLatitude() { + return receiptLatitude; + } + + public void setReceiptLatitude(String receiptLatitude) { + this.receiptLatitude = receiptLatitude; + } + + public String getReceiptLocationAddress() { + return receiptLocationAddress; + } + + public void setReceiptLocationAddress(String receiptLocationAddress) { + this.receiptLocationAddress = receiptLocationAddress; + } + + public String getReceiptLongitude() { + return receiptLongitude; + } + + public void setReceiptLongitude(String receiptLongitude) { + this.receiptLongitude = receiptLongitude; + } + + public String getReceiptTime() { + return receiptTime; + } + + public void setReceiptTime(String receiptTime) { + this.receiptTime = receiptTime; + } + + public List getReceiptUrl() { + return receiptUrl; + } + + public void setReceiptUrl(List receiptUrl) { + this.receiptUrl = receiptUrl; + } + + public int getReport() { + return report; + } + + public void setReport(int report) { + this.report = report; + } + + public int getReportAlct() { + return reportAlct; + } + + public void setReportAlct(int reportAlct) { + this.reportAlct = reportAlct; + } + + public List getSendPutImagesUrl() { + return sendPutImagesUrl; + } + + public void setSendPutImagesUrl(List sendPutImagesUrl) { + this.sendPutImagesUrl = sendPutImagesUrl; + } + + public String getSendPutLatitude() { + return sendPutLatitude; + } + + public void setSendPutLatitude(String sendPutLatitude) { + this.sendPutLatitude = sendPutLatitude; + } + + public String getSendPutLocationAddress() { + return sendPutLocationAddress; + } + + public void setSendPutLocationAddress(String sendPutLocationAddress) { + this.sendPutLocationAddress = sendPutLocationAddress; + } + + public String getSendPutLongitude() { + return sendPutLongitude; + } + + public void setSendPutLongitude(String sendPutLongitude) { + this.sendPutLongitude = sendPutLongitude; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public static class GoodsDTO { + + private String goodName; + private String goodNum; + private String goodPrice; + private String goodUnit; + private String packName; + + public String getGoodName() { + return goodName; + } + + public void setGoodName(String goodName) { + this.goodName = goodName; + } + + public String getGoodNum() { + return goodNum; + } + + public void setGoodNum(String goodNum) { + this.goodNum = goodNum; + } + + public String getGoodPrice() { + return goodPrice; + } + + public void setGoodPrice(String goodPrice) { + this.goodPrice = goodPrice; + } + + public String getGoodUnit() { + return goodUnit; + } + + public void setGoodUnit(String goodUnit) { + this.goodUnit = goodUnit; + } + + public String getPackName() { + return packName; + } + + public void setPackName(String packName) { + this.packName = packName; + } + } + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/OrderList.java b/app/src/main/java/com/oneclouds/cargo/bean/OrderList.java new file mode 100644 index 0000000..e156292 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/OrderList.java @@ -0,0 +1,910 @@ +package com.oneclouds.cargo.bean; + +import java.util.List; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/27 14:47 + * @description: + */ +public class OrderList { + + private int res; + private int code; + private boolean success; + private String msg; + private DataDTO data; + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public DataDTO getData() { + return data; + } + + public void setData(DataDTO data) { + this.data = data; + } + + public static class DataDTO { + private int id; + private Object waybillId; + private String orderNum; + private Object shipperId; + private Object loadingName; + private Object loadingPhone; + private Object loadingProvinceCityArea; + private String loadingAddress; + private String loadingDeadline; + private Object receiverName; + private Object receiverPhone; + private Object receiverProvinceCityArea; + private String receiverAddress; + private String receiverDeadline; + private Object allowSplitting; + private Object goodsValue; + private Object isInsure; + private Object insureAmount; + private String effectiveTime; + private String distance; + private int vehicleType; + private Object vehicleTypeName; + private int vehicleLength; + private Object vehicleLengthName; + private Object namedDrivers; + private String requirement; + private String totalFreight; + private Object failedReason; + private List sendInfo; + private List putInfo; + private String sendPutString; + private Object report; + private Object contractTemplateUrl; + private int status; + private String statusOver; + private String contactName; + private String contactPhone; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public Object getWaybillId() { + return waybillId; + } + + public void setWaybillId(Object waybillId) { + this.waybillId = waybillId; + } + + public String getOrderNum() { + return orderNum; + } + + public void setOrderNum(String orderNum) { + this.orderNum = orderNum; + } + + public Object getShipperId() { + return shipperId; + } + + public void setShipperId(Object shipperId) { + this.shipperId = shipperId; + } + + public Object getLoadingName() { + return loadingName; + } + + public void setLoadingName(Object loadingName) { + this.loadingName = loadingName; + } + + public Object getLoadingPhone() { + return loadingPhone; + } + + public void setLoadingPhone(Object loadingPhone) { + this.loadingPhone = loadingPhone; + } + + public Object getLoadingProvinceCityArea() { + return loadingProvinceCityArea; + } + + public void setLoadingProvinceCityArea(Object loadingProvinceCityArea) { + this.loadingProvinceCityArea = loadingProvinceCityArea; + } + + public String getLoadingAddress() { + return loadingAddress; + } + + public void setLoadingAddress(String loadingAddress) { + this.loadingAddress = loadingAddress; + } + + public String getLoadingDeadline() { + return loadingDeadline; + } + + public void setLoadingDeadline(String loadingDeadline) { + this.loadingDeadline = loadingDeadline; + } + + public Object getReceiverName() { + return receiverName; + } + + public void setReceiverName(Object receiverName) { + this.receiverName = receiverName; + } + + public Object getReceiverPhone() { + return receiverPhone; + } + + public void setReceiverPhone(Object receiverPhone) { + this.receiverPhone = receiverPhone; + } + + public Object getReceiverProvinceCityArea() { + return receiverProvinceCityArea; + } + + public void setReceiverProvinceCityArea(Object receiverProvinceCityArea) { + this.receiverProvinceCityArea = receiverProvinceCityArea; + } + + public String getReceiverAddress() { + return receiverAddress; + } + + public void setReceiverAddress(String receiverAddress) { + this.receiverAddress = receiverAddress; + } + + public String getReceiverDeadline() { + return receiverDeadline; + } + + public void setReceiverDeadline(String receiverDeadline) { + this.receiverDeadline = receiverDeadline; + } + + public Object getAllowSplitting() { + return allowSplitting; + } + + public void setAllowSplitting(Object allowSplitting) { + this.allowSplitting = allowSplitting; + } + + public Object getGoodsValue() { + return goodsValue; + } + + public void setGoodsValue(Object goodsValue) { + this.goodsValue = goodsValue; + } + + public Object getIsInsure() { + return isInsure; + } + + public void setIsInsure(Object isInsure) { + this.isInsure = isInsure; + } + + public Object getInsureAmount() { + return insureAmount; + } + + public void setInsureAmount(Object insureAmount) { + this.insureAmount = insureAmount; + } + + public String getEffectiveTime() { + return effectiveTime; + } + + public void setEffectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + } + + public String getDistance() { + return distance; + } + + public void setDistance(String distance) { + this.distance = distance; + } + + public int getVehicleType() { + return vehicleType; + } + + public void setVehicleType(int vehicleType) { + this.vehicleType = vehicleType; + } + + public Object getVehicleTypeName() { + return vehicleTypeName; + } + + public void setVehicleTypeName(Object vehicleTypeName) { + this.vehicleTypeName = vehicleTypeName; + } + + public int getVehicleLength() { + return vehicleLength; + } + + public void setVehicleLength(int vehicleLength) { + this.vehicleLength = vehicleLength; + } + + public Object getVehicleLengthName() { + return vehicleLengthName; + } + + public void setVehicleLengthName(Object vehicleLengthName) { + this.vehicleLengthName = vehicleLengthName; + } + + public Object getNamedDrivers() { + return namedDrivers; + } + + public void setNamedDrivers(Object namedDrivers) { + this.namedDrivers = namedDrivers; + } + + public String getRequirement() { + return requirement; + } + + public void setRequirement(String requirement) { + this.requirement = requirement; + } + + public String getTotalFreight() { + return totalFreight; + } + + public void setTotalFreight(String totalFreight) { + this.totalFreight = totalFreight; + } + + public Object getFailedReason() { + return failedReason; + } + + public void setFailedReason(Object failedReason) { + this.failedReason = failedReason; + } + + public List getSendInfo() { + return sendInfo; + } + + public void setSendInfo(List sendInfo) { + this.sendInfo = sendInfo; + } + + public List getPutInfo() { + return putInfo; + } + + public void setPutInfo(List putInfo) { + this.putInfo = putInfo; + } + + public String getSendPutString() { + return sendPutString; + } + + public void setSendPutString(String sendPutString) { + this.sendPutString = sendPutString; + } + + public Object getReport() { + return report; + } + + public void setReport(Object report) { + this.report = report; + } + + public Object getContractTemplateUrl() { + return contractTemplateUrl; + } + + public void setContractTemplateUrl(Object contractTemplateUrl) { + this.contractTemplateUrl = contractTemplateUrl; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public String getStatusOver() { + return statusOver; + } + + public void setStatusOver(String statusOver) { + this.statusOver = statusOver; + } + + public String getContactName() { + return contactName; + } + + public void setContactName(String contactName) { + this.contactName = contactName; + } + + public String getContactPhone() { + return contactPhone; + } + + public void setContactPhone(String contactPhone) { + this.contactPhone = contactPhone; + } + + public static class SendInfoDTO { + private long childNumber; + private int pid; + private String name; + private String phone; + private int province; + private int city; + private int area; + private String provinceCityArea; + private String address; + private String deadline; + private int type; + private int status; + private int displayOrder; + private Object totalAmount; + private String createTime; + private String longitude; + private String latitude; + private String businessName; + private String businessCode; + private List goods; + + public long getChildNumber() { + return childNumber; + } + + public void setChildNumber(long childNumber) { + this.childNumber = childNumber; + } + + public int getPid() { + return pid; + } + + public void setPid(int pid) { + this.pid = pid; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public int getProvince() { + return province; + } + + public void setProvince(int province) { + this.province = province; + } + + public int getCity() { + return city; + } + + public void setCity(int city) { + this.city = city; + } + + public int getArea() { + return area; + } + + public void setArea(int area) { + this.area = area; + } + + public String getProvinceCityArea() { + return provinceCityArea; + } + + public void setProvinceCityArea(String provinceCityArea) { + this.provinceCityArea = provinceCityArea; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getDeadline() { + return deadline; + } + + public void setDeadline(String deadline) { + this.deadline = deadline; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public int getDisplayOrder() { + return displayOrder; + } + + public void setDisplayOrder(int displayOrder) { + this.displayOrder = displayOrder; + } + + public Object getTotalAmount() { + return totalAmount; + } + + public void setTotalAmount(Object totalAmount) { + this.totalAmount = totalAmount; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getLongitude() { + return longitude; + } + + public void setLongitude(String longitude) { + this.longitude = longitude; + } + + public String getLatitude() { + return latitude; + } + + public void setLatitude(String latitude) { + this.latitude = latitude; + } + + public String getBusinessName() { + return businessName; + } + + public void setBusinessName(String businessName) { + this.businessName = businessName; + } + + public String getBusinessCode() { + return businessCode; + } + + public void setBusinessCode(String businessCode) { + this.businessCode = businessCode; + } + + public List getGoods() { + return goods; + } + + public void setGoods(List goods) { + this.goods = goods; + } + + public static class GoodsDTO { + private long id; + private long childrenId; + private String goodName; + private String goodNum; + private String goodUnit; + private String goodPrice; + private String packName; + private Object createTime; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public long getChildrenId() { + return childrenId; + } + + public void setChildrenId(long childrenId) { + this.childrenId = childrenId; + } + + public String getGoodName() { + return goodName; + } + + public void setGoodName(String goodName) { + this.goodName = goodName; + } + + public String getGoodNum() { + return goodNum; + } + + public void setGoodNum(String goodNum) { + this.goodNum = goodNum; + } + + public String getGoodUnit() { + return goodUnit; + } + + public void setGoodUnit(String goodUnit) { + this.goodUnit = goodUnit; + } + + public String getGoodPrice() { + return goodPrice; + } + + public void setGoodPrice(String goodPrice) { + this.goodPrice = goodPrice; + } + + public String getPackName() { + return packName; + } + + public void setPackName(String packName) { + this.packName = packName; + } + + public Object getCreateTime() { + return createTime; + } + + public void setCreateTime(Object createTime) { + this.createTime = createTime; + } + } + } + + public static class PutInfoDTO { + private long childNumber; + private int pid; + private String name; + private String phone; + private int province; + private int city; + private int area; + private String provinceCityArea; + private String address; + private String deadline; + private int type; + private int status; + private int displayOrder; + private Object totalAmount; + private String createTime; + private String longitude; + private String latitude; + private String businessName; + private String businessCode; + private List goods; + + public long getChildNumber() { + return childNumber; + } + + public void setChildNumber(long childNumber) { + this.childNumber = childNumber; + } + + public int getPid() { + return pid; + } + + public void setPid(int pid) { + this.pid = pid; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public int getProvince() { + return province; + } + + public void setProvince(int province) { + this.province = province; + } + + public int getCity() { + return city; + } + + public void setCity(int city) { + this.city = city; + } + + public int getArea() { + return area; + } + + public void setArea(int area) { + this.area = area; + } + + public String getProvinceCityArea() { + return provinceCityArea; + } + + public void setProvinceCityArea(String provinceCityArea) { + this.provinceCityArea = provinceCityArea; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getDeadline() { + return deadline; + } + + public void setDeadline(String deadline) { + this.deadline = deadline; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public int getDisplayOrder() { + return displayOrder; + } + + public void setDisplayOrder(int displayOrder) { + this.displayOrder = displayOrder; + } + + public Object getTotalAmount() { + return totalAmount; + } + + public void setTotalAmount(Object totalAmount) { + this.totalAmount = totalAmount; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getLongitude() { + return longitude; + } + + public void setLongitude(String longitude) { + this.longitude = longitude; + } + + public String getLatitude() { + return latitude; + } + + public void setLatitude(String latitude) { + this.latitude = latitude; + } + + public String getBusinessName() { + return businessName; + } + + public void setBusinessName(String businessName) { + this.businessName = businessName; + } + + public String getBusinessCode() { + return businessCode; + } + + public void setBusinessCode(String businessCode) { + this.businessCode = businessCode; + } + + public List getGoods() { + return goods; + } + + public void setGoods(List goods) { + this.goods = goods; + } + + public static class GoodsDTO { + private long id; + private long childrenId; + private String goodName; + private String goodNum; + private String goodUnit; + private String goodPrice; + private String packName; + private Object createTime; + + public long getId() { + return id; + } + + public void setId(long id) { + this.id = id; + } + + public long getChildrenId() { + return childrenId; + } + + public void setChildrenId(long childrenId) { + this.childrenId = childrenId; + } + + public String getGoodName() { + return goodName; + } + + public void setGoodName(String goodName) { + this.goodName = goodName; + } + + public String getGoodNum() { + return goodNum; + } + + public void setGoodNum(String goodNum) { + this.goodNum = goodNum; + } + + public String getGoodUnit() { + return goodUnit; + } + + public void setGoodUnit(String goodUnit) { + this.goodUnit = goodUnit; + } + + public String getGoodPrice() { + return goodPrice; + } + + public void setGoodPrice(String goodPrice) { + this.goodPrice = goodPrice; + } + + public String getPackName() { + return packName; + } + + public void setPackName(String packName) { + this.packName = packName; + } + + public Object getCreateTime() { + return createTime; + } + + public void setCreateTime(Object createTime) { + this.createTime = createTime; + } + } + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/OrderListBean.java b/app/src/main/java/com/oneclouds/cargo/bean/OrderListBean.java new file mode 100644 index 0000000..c2c3c6a --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/OrderListBean.java @@ -0,0 +1,326 @@ +package com.oneclouds.cargo.bean; + +import java.util.List; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/8/6 10:40 + * @description:运单列表实体类 + */ +public class OrderListBean { + + + private int res; + private int code; + private boolean success; + private String msg; + private DataDTO data; + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public DataDTO getData() { + return data; + } + + public void setData(DataDTO data) { + this.data = data; + } + + public static class DataDTO { + private List records; + private int total; + private int size; + private int current; + private List orders; + private boolean searchCount; + private int pages; + + public List getRecords() { + return records; + } + + public void setRecords(List records) { + this.records = records; + } + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + } + + public int getSize() { + return size; + } + + public void setSize(int size) { + this.size = size; + } + + public int getCurrent() { + return current; + } + + public void setCurrent(int current) { + this.current = current; + } + + public List getOrders() { + return orders; + } + + public void setOrders(List orders) { + this.orders = orders; + } + + public boolean isSearchCount() { + return searchCount; + } + + public void setSearchCount(boolean searchCount) { + this.searchCount = searchCount; + } + + public int getPages() { + return pages; + } + + public void setPages(int pages) { + this.pages = pages; + } + + public static class RecordsDTO { + private int id; + private String orderNum; + private int status; + private int auditStatus; + private String loadingProvince; + private String loadingCity; + private String loadingArea; + private String loadingAddress; + private String loadingProvinceCityArea; + private String loadingDeadline; + private String receiverProvince; + private String receiverCity; + private String receiverArea; + private String receiverAddress; + private String receiverProvinceCityArea; + private String receiverDeadline; + private int dispatchType; + private int isTrailer; + private int allowSplitting; + private String showStatusText; + private int waybillCount; + private Object shipperCompanyName; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getOrderNum() { + return orderNum; + } + + public void setOrderNum(String orderNum) { + this.orderNum = orderNum; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public int getAuditStatus() { + return auditStatus; + } + + public void setAuditStatus(int auditStatus) { + this.auditStatus = auditStatus; + } + + public String getLoadingProvince() { + return loadingProvince; + } + + public void setLoadingProvince(String loadingProvince) { + this.loadingProvince = loadingProvince; + } + + public String getLoadingCity() { + return loadingCity; + } + + public void setLoadingCity(String loadingCity) { + this.loadingCity = loadingCity; + } + + public String getLoadingArea() { + return loadingArea; + } + + public void setLoadingArea(String loadingArea) { + this.loadingArea = loadingArea; + } + + public String getLoadingAddress() { + return loadingAddress; + } + + public void setLoadingAddress(String loadingAddress) { + this.loadingAddress = loadingAddress; + } + + public String getLoadingProvinceCityArea() { + return loadingProvinceCityArea; + } + + public void setLoadingProvinceCityArea(String loadingProvinceCityArea) { + this.loadingProvinceCityArea = loadingProvinceCityArea; + } + + public String getLoadingDeadline() { + return loadingDeadline; + } + + public void setLoadingDeadline(String loadingDeadline) { + this.loadingDeadline = loadingDeadline; + } + + public String getReceiverProvince() { + return receiverProvince; + } + + public void setReceiverProvince(String receiverProvince) { + this.receiverProvince = receiverProvince; + } + + public String getReceiverCity() { + return receiverCity; + } + + public void setReceiverCity(String receiverCity) { + this.receiverCity = receiverCity; + } + + public String getReceiverArea() { + return receiverArea; + } + + public void setReceiverArea(String receiverArea) { + this.receiverArea = receiverArea; + } + + public String getReceiverAddress() { + return receiverAddress; + } + + public void setReceiverAddress(String receiverAddress) { + this.receiverAddress = receiverAddress; + } + + public String getReceiverProvinceCityArea() { + return receiverProvinceCityArea; + } + + public void setReceiverProvinceCityArea(String receiverProvinceCityArea) { + this.receiverProvinceCityArea = receiverProvinceCityArea; + } + + public String getReceiverDeadline() { + return receiverDeadline; + } + + public void setReceiverDeadline(String receiverDeadline) { + this.receiverDeadline = receiverDeadline; + } + + public int getDispatchType() { + return dispatchType; + } + + public void setDispatchType(int dispatchType) { + this.dispatchType = dispatchType; + } + + public int getIsTrailer() { + return isTrailer; + } + + public void setIsTrailer(int isTrailer) { + this.isTrailer = isTrailer; + } + + public int getAllowSplitting() { + return allowSplitting; + } + + public void setAllowSplitting(int allowSplitting) { + this.allowSplitting = allowSplitting; + } + + public String getShowStatusText() { + return showStatusText; + } + + public void setShowStatusText(String showStatusText) { + this.showStatusText = showStatusText; + } + + public int getWaybillCount() { + return waybillCount; + } + + public void setWaybillCount(int waybillCount) { + this.waybillCount = waybillCount; + } + + public Object getShipperCompanyName() { + return shipperCompanyName; + } + + public void setShipperCompanyName(Object shipperCompanyName) { + this.shipperCompanyName = shipperCompanyName; + } + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/PackNameBean.java b/app/src/main/java/com/oneclouds/cargo/bean/PackNameBean.java new file mode 100644 index 0000000..0c643ca --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/PackNameBean.java @@ -0,0 +1,58 @@ +package com.oneclouds.cargo.bean; + +import java.util.List; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/16 9:49 + * @description:包装方式 + */ +public class PackNameBean { + + private int res; + private int code; + private boolean success; + private String msg; + private List data; + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/StateBean.java b/app/src/main/java/com/oneclouds/cargo/bean/StateBean.java new file mode 100644 index 0000000..46954fd --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/StateBean.java @@ -0,0 +1,151 @@ +package com.oneclouds.cargo.bean; + +import java.io.Serializable; + +public class StateBean implements Serializable { + + + private String searchValue; + private String createBy; + private String createTime; + private String updateBy; + private String updateTime; + private String remark; + private String dictCode; + private String dictSort; + private String dictLabel; + private String dictValue; + private String dictType; + private String cssClass; + private String listClass; + private String isDefault; + private String status; + + public StateBean(String dictLabel, String dictValue) { + this.dictLabel = dictLabel; + this.dictValue = dictValue; + } + + public String getSearchValue() { + return searchValue; + } + + public void setSearchValue(String searchValue) { + this.searchValue = searchValue; + } + + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public String getUpdateBy() { + return updateBy; + } + + public void setUpdateBy(String updateBy) { + this.updateBy = updateBy; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } + + public String getDictCode() { + return dictCode; + } + + public void setDictCode(String dictCode) { + this.dictCode = dictCode; + } + + public String getDictSort() { + return dictSort; + } + + public void setDictSort(String dictSort) { + this.dictSort = dictSort; + } + + public String getDictLabel() { + return dictLabel; + } + + public void setDictLabel(String dictLabel) { + this.dictLabel = dictLabel; + } + + public String getDictValue() { + return dictValue; + } + + public void setDictValue(String dictValue) { + this.dictValue = dictValue; + } + + public String getDictType() { + return dictType; + } + + public void setDictType(String dictType) { + this.dictType = dictType; + } + + public String getCssClass() { + return cssClass; + } + + public void setCssClass(String cssClass) { + this.cssClass = cssClass; + } + + public String getListClass() { + return listClass; + } + + public void setListClass(String listClass) { + this.listClass = listClass; + } + + public String getIsDefault() { + return isDefault; + } + + public void setIsDefault(String isDefault) { + this.isDefault = isDefault; + } + + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public static class ParamsDTO { + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/UpAppBean.java b/app/src/main/java/com/oneclouds/cargo/bean/UpAppBean.java new file mode 100644 index 0000000..4fc2ebd --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/UpAppBean.java @@ -0,0 +1,122 @@ +package com.oneclouds.cargo.bean; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/23 17:17 + * @description: + */ +public class UpAppBean { + + private int code; + private DataDTO data; + private String msg; + private int res; + private boolean success; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataDTO getData() { + return data; + } + + public void setData(DataDTO data) { + this.data = data; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public static class DataDTO { + private String content; + private String delete; + private String downloadUrl; + private String force; + private String source; + private String type; + private String version; + + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public String getDelete() { + return delete; + } + + public void setDelete(String delete) { + this.delete = delete; + } + + public String getDownloadUrl() { + return downloadUrl; + } + + public void setDownloadUrl(String downloadUrl) { + this.downloadUrl = downloadUrl; + } + + public String getForce() { + return force; + } + + public void setForce(String force) { + this.force = force; + } + + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getVersion() { + return version; + } + + public void setVersion(String version) { + this.version = version; + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/UploadBean.java b/app/src/main/java/com/oneclouds/cargo/bean/UploadBean.java new file mode 100644 index 0000000..d919152 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/UploadBean.java @@ -0,0 +1,167 @@ +package com.oneclouds.cargo.bean; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/8/16 18:06 + * @description: + */ +public class UploadBean { + + private int res; + private int code; + private boolean success; + private String msg; + private DataDTO data; + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public DataDTO getData() { + return data; + } + + public void setData(DataDTO data) { + this.data = data; + } + + public static class DataDTO { + private int id; + private Object uuidName; + private Object realName; + private String sourcePath; + private Object sourceSuffix; + private Object sourceSize; + private Object remark; + private int createUser; + private Object createTime; + private Object folderid; + private String name; + private String url; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public Object getUuidName() { + return uuidName; + } + + public void setUuidName(Object uuidName) { + this.uuidName = uuidName; + } + + public Object getRealName() { + return realName; + } + + public void setRealName(Object realName) { + this.realName = realName; + } + + public String getSourcePath() { + return sourcePath; + } + + public void setSourcePath(String sourcePath) { + this.sourcePath = sourcePath; + } + + public Object getSourceSuffix() { + return sourceSuffix; + } + + public void setSourceSuffix(Object sourceSuffix) { + this.sourceSuffix = sourceSuffix; + } + + public Object getSourceSize() { + return sourceSize; + } + + public void setSourceSize(Object sourceSize) { + this.sourceSize = sourceSize; + } + + public Object getRemark() { + return remark; + } + + public void setRemark(Object remark) { + this.remark = remark; + } + + public int getCreateUser() { + return createUser; + } + + public void setCreateUser(int createUser) { + this.createUser = createUser; + } + + public Object getCreateTime() { + return createTime; + } + + public void setCreateTime(Object createTime) { + this.createTime = createTime; + } + + public Object getFolderid() { + return folderid; + } + + public void setFolderid(Object folderid) { + this.folderid = folderid; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/UserBean.java b/app/src/main/java/com/oneclouds/cargo/bean/UserBean.java new file mode 100644 index 0000000..4e2564c --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/UserBean.java @@ -0,0 +1,338 @@ +package com.oneclouds.cargo.bean; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/16 15:55 + * @description: + */ +public class UserBean { + + private int res; + private int code; + private boolean success; + private String msg; + private DataDTO data; + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public DataDTO getData() { + return data; + } + + public void setData(DataDTO data) { + this.data = data; + } + + public static class DataDTO { + private String token; + private int id; + private int roleId; + private String uname; + private String registerPhone; + private String rname; + private String companyName; + private String account; + private String credit; + private Object surplusCredit; + private String etcBalance; + private String oliBalance; + private Object invoiceMoney; + private String headportraitUrl; + private Object salt; + private Object jumpUrl; + private int auditStatus; + private String distance; + private int waybillNum; + private Object orderNum; + private String idCardValidity; + private String driverValidity; + private String qualificationValidity; + private int isCar; + private String qrcodeUrl; + private int partyMemberStatus; + private String partyMemberTime; + private String partyMemberUrl; + private Object partyMemberReason; + private String goodLuck; + private String freight; + + public String getGoodLuck() { + return goodLuck; + } + + public void setGoodLuck(String goodLuck) { + this.goodLuck = goodLuck; + } + + public String getFreight() { + return freight; + } + + public void setFreight(String freight) { + this.freight = freight; + } + + public String getToken() { + return token; + } + + public void setToken(String token) { + this.token = token; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getRoleId() { + return roleId; + } + + public void setRoleId(int roleId) { + this.roleId = roleId; + } + + public String getUname() { + return uname; + } + + public void setUname(String uname) { + this.uname = uname; + } + + public String getRegisterPhone() { + return registerPhone; + } + + public void setRegisterPhone(String registerPhone) { + this.registerPhone = registerPhone; + } + + public String getRname() { + return rname; + } + + public void setRname(String rname) { + this.rname = rname; + } + + public String getCompanyName() { + return companyName; + } + + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + public String getAccount() { + return account; + } + + public void setAccount(String account) { + this.account = account; + } + + public String getCredit() { + return credit; + } + + public void setCredit(String credit) { + this.credit = credit; + } + + public Object getSurplusCredit() { + return surplusCredit; + } + + public void setSurplusCredit(Object surplusCredit) { + this.surplusCredit = surplusCredit; + } + + public String getEtcBalance() { + return etcBalance; + } + + public void setEtcBalance(String etcBalance) { + this.etcBalance = etcBalance; + } + + public String getOliBalance() { + return oliBalance; + } + + public void setOliBalance(String oliBalance) { + this.oliBalance = oliBalance; + } + + public Object getInvoiceMoney() { + return invoiceMoney; + } + + public void setInvoiceMoney(Object invoiceMoney) { + this.invoiceMoney = invoiceMoney; + } + + public String getHeadportraitUrl() { + return headportraitUrl; + } + + public void setHeadportraitUrl(String headportraitUrl) { + this.headportraitUrl = headportraitUrl; + } + + public Object getSalt() { + return salt; + } + + public void setSalt(Object salt) { + this.salt = salt; + } + + public Object getJumpUrl() { + return jumpUrl; + } + + public void setJumpUrl(Object jumpUrl) { + this.jumpUrl = jumpUrl; + } + + public int getAuditStatus() { + return auditStatus; + } + + public void setAuditStatus(int auditStatus) { + this.auditStatus = auditStatus; + } + + public String getDistance() { + return distance; + } + + public void setDistance(String distance) { + this.distance = distance; + } + + public int getWaybillNum() { + return waybillNum; + } + + public void setWaybillNum(int waybillNum) { + this.waybillNum = waybillNum; + } + + public Object getOrderNum() { + return orderNum; + } + + public void setOrderNum(Object orderNum) { + this.orderNum = orderNum; + } + + public String getIdCardValidity() { + return idCardValidity; + } + + public void setIdCardValidity(String idCardValidity) { + this.idCardValidity = idCardValidity; + } + + public String getDriverValidity() { + return driverValidity; + } + + public void setDriverValidity(String driverValidity) { + this.driverValidity = driverValidity; + } + + public String getQualificationValidity() { + return qualificationValidity; + } + + public void setQualificationValidity(String qualificationValidity) { + this.qualificationValidity = qualificationValidity; + } + + public int getIsCar() { + return isCar; + } + + public void setIsCar(int isCar) { + this.isCar = isCar; + } + + public String getQrcodeUrl() { + return qrcodeUrl; + } + + public void setQrcodeUrl(String qrcodeUrl) { + this.qrcodeUrl = qrcodeUrl; + } + + public int getPartyMemberStatus() { + return partyMemberStatus; + } + + public void setPartyMemberStatus(int partyMemberStatus) { + this.partyMemberStatus = partyMemberStatus; + } + + public String getPartyMemberTime() { + return partyMemberTime; + } + + public void setPartyMemberTime(String partyMemberTime) { + this.partyMemberTime = partyMemberTime; + } + + public String getPartyMemberUrl() { + return partyMemberUrl; + } + + public void setPartyMemberUrl(String partyMemberUrl) { + this.partyMemberUrl = partyMemberUrl; + } + + public Object getPartyMemberReason() { + return partyMemberReason; + } + + public void setPartyMemberReason(Object partyMemberReason) { + this.partyMemberReason = partyMemberReason; + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/WaybillListBean.java b/app/src/main/java/com/oneclouds/cargo/bean/WaybillListBean.java new file mode 100644 index 0000000..d8cc371 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/WaybillListBean.java @@ -0,0 +1,290 @@ +package com.oneclouds.cargo.bean; + +import java.util.List; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/22 9:50 + * @description: + */ + +public class WaybillListBean { + + private int code; + private DataDTO data; + private String msg; + private int res; + private boolean success; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataDTO getData() { + return data; + } + + public void setData(DataDTO data) { + this.data = data; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public static class DataDTO { + private List list; + private int num; + private String totalFreight; + + public List getList() { + return list; + } + + public void setList(List list) { + this.list = list; + } + + public int getNum() { + return num; + } + + public void setNum(int num) { + this.num = num; + } + + public String getTotalFreight() { + return totalFreight; + } + + public void setTotalFreight(String totalFreight) { + this.totalFreight = totalFreight; + } + + public static class ListDTO { + private String carNum; + private int complaint; + private String contactName; + private String contactPhone; + private int dispatchType; + private String distance; + private String effectiveTime; + private String goodsBigCate; + private int isShipperEvaluation; + private String loadingAddress; + private int multipleScore; + private int orderId; + private String orderNum; + private String receiverAddress; + private String sendPutString; + private int status; + private String statusOver; + private String totalFreight; + private String vehicleType; + private int waybillId; + private int makeStatus; + private String createTime; + + public String getCreateTime() { + return createTime == null ? "" : createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public int getMakeStatus() { + return makeStatus; + } + + public void setMakeStatus(int makeStatus) { + this.makeStatus = makeStatus; + } + + public String getCarNum() { + return carNum; + } + + public void setCarNum(String carNum) { + this.carNum = carNum; + } + + public int getComplaint() { + return complaint; + } + + public void setComplaint(int complaint) { + this.complaint = complaint; + } + + public String getContactName() { + return contactName; + } + + public void setContactName(String contactName) { + this.contactName = contactName; + } + + public String getContactPhone() { + return contactPhone; + } + + public void setContactPhone(String contactPhone) { + this.contactPhone = contactPhone; + } + + public int getDispatchType() { + return dispatchType; + } + + public void setDispatchType(int dispatchType) { + this.dispatchType = dispatchType; + } + + public String getDistance() { + return distance; + } + + public void setDistance(String distance) { + this.distance = distance; + } + + public String getEffectiveTime() { + return effectiveTime; + } + + public void setEffectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + } + + public String getGoodsBigCate() { + return goodsBigCate; + } + + public void setGoodsBigCate(String goodsBigCate) { + this.goodsBigCate = goodsBigCate; + } + + public int getIsShipperEvaluation() { + return isShipperEvaluation; + } + + public void setIsShipperEvaluation(int isShipperEvaluation) { + this.isShipperEvaluation = isShipperEvaluation; + } + + public String getLoadingAddress() { + return loadingAddress; + } + + public void setLoadingAddress(String loadingAddress) { + this.loadingAddress = loadingAddress; + } + + public int getMultipleScore() { + return multipleScore; + } + + public void setMultipleScore(int multipleScore) { + this.multipleScore = multipleScore; + } + + public int getOrderId() { + return orderId; + } + + public void setOrderId(int orderId) { + this.orderId = orderId; + } + + public String getOrderNum() { + return orderNum; + } + + public void setOrderNum(String orderNum) { + this.orderNum = orderNum; + } + + public String getReceiverAddress() { + return receiverAddress; + } + + public void setReceiverAddress(String receiverAddress) { + this.receiverAddress = receiverAddress; + } + + public String getSendPutString() { + return sendPutString; + } + + public void setSendPutString(String sendPutString) { + this.sendPutString = sendPutString; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public String getStatusOver() { + return statusOver; + } + + public void setStatusOver(String statusOver) { + this.statusOver = statusOver; + } + + public String getTotalFreight() { + return totalFreight; + } + + public void setTotalFreight(String totalFreight) { + this.totalFreight = totalFreight; + } + + public String getVehicleType() { + return vehicleType; + } + + public void setVehicleType(String vehicleType) { + this.vehicleType = vehicleType; + } + + public int getWaybillId() { + return waybillId; + } + + public void setWaybillId(int waybillId) { + this.waybillId = waybillId; + } + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/ocr/OCRBankBean.java b/app/src/main/java/com/oneclouds/cargo/bean/ocr/OCRBankBean.java new file mode 100644 index 0000000..2fbb5f3 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/ocr/OCRBankBean.java @@ -0,0 +1,112 @@ +package com.oneclouds.cargo.bean.ocr; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/16 16:23 + * @description: + */ +public class OCRBankBean { + private int res; + private int code; + private boolean success; + private String msg; + private DataDTO data; + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public DataDTO getData() { + return data; + } + + public void setData(DataDTO data) { + this.data = data; + } + + public static class DataDTO { + private int id; + private String url; + private String bankCardNumber; + private String validDate; + private String bankCardType; + private String bankName; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getBankCardNumber() { + return bankCardNumber; + } + + public void setBankCardNumber(String bankCardNumber) { + this.bankCardNumber = bankCardNumber; + } + + public String getValidDate() { + return validDate; + } + + public void setValidDate(String validDate) { + this.validDate = validDate; + } + + public String getBankCardType() { + return bankCardType; + } + + public void setBankCardType(String bankCardType) { + this.bankCardType = bankCardType; + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/ocr/OCRCardBackBean.java b/app/src/main/java/com/oneclouds/cargo/bean/ocr/OCRCardBackBean.java new file mode 100644 index 0000000..65b1f9a --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/ocr/OCRCardBackBean.java @@ -0,0 +1,104 @@ +package com.oneclouds.cargo.bean.ocr; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/8/5 10:10 + * @description:身份证背面实体类 + */ +public class OCRCardBackBean { + + private int res; + private int code; + private boolean success; + private String msg; + private DataDTO data; + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public DataDTO getData() { + return data; + } + + public void setData(DataDTO data) { + this.data = data; + } + + public static class DataDTO { + private int id; + private String url; + private String startTime; + private String endTime; + private String organizationName; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getStartTime() { + return startTime; + } + + public void setStartTime(String startTime) { + this.startTime = startTime; + } + + public String getEndTime() { + return endTime; + } + + public void setEndTime(String endTime) { + this.endTime = endTime; + } + + public String getOrganizationName() { + return organizationName; + } + + public void setOrganizationName(String organizationName) { + this.organizationName = organizationName; + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/ocr/OCRCardBean.java b/app/src/main/java/com/oneclouds/cargo/bean/ocr/OCRCardBean.java new file mode 100644 index 0000000..563e36f --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/ocr/OCRCardBean.java @@ -0,0 +1,132 @@ +package com.oneclouds.cargo.bean.ocr; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/8/5 10:05 + * @description:身份证实体类 + */ +public class OCRCardBean { + + + private int res; + private int code; + private boolean success; + private String msg; + private DataDTO data; + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public DataDTO getData() { + return data; + } + + public void setData(DataDTO data) { + this.data = data; + } + + public static class DataDTO { + private int id; + private String url; + private String name; + private String nation; + private String address; + private String cardId; + private String birthday; + private String sex; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNation() { + return nation; + } + + public void setNation(String nation) { + this.nation = nation; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getCardId() { + return cardId; + } + + public void setCardId(String cardId) { + this.cardId = cardId; + } + + public String getBirthday() { + return birthday; + } + + public void setBirthday(String birthday) { + this.birthday = birthday; + } + + public String getSex() { + return sex; + } + + public void setSex(String sex) { + this.sex = sex; + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/bean/ocr/OcrBusinessLicenseBean.java b/app/src/main/java/com/oneclouds/cargo/bean/ocr/OcrBusinessLicenseBean.java new file mode 100644 index 0000000..221ecfc --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/bean/ocr/OcrBusinessLicenseBean.java @@ -0,0 +1,203 @@ +package com.oneclouds.cargo.bean.ocr; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/22 22:31 + * @description: + */ +public class OcrBusinessLicenseBean { + + private int code; + private DataDTO data; + private String msg; + private int res; + private boolean success; + + public int getCode() { + return code; + } + + public void setCode(int code) { + this.code = code; + } + + public DataDTO getData() { + return data; + } + + public void setData(DataDTO data) { + this.data = data; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public int getRes() { + return res; + } + + public void setRes(int res) { + this.res = res; + } + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public static class DataDTO { + private String address; + private String businessScope; + private String companyName; + private String dateOfEstablishment; + private String formation; + private int id; + private String idNumber; + private String legalPerson; + private String paidInCapital; + private String registeredCapital; + private String registrationAuthority; + private String socialCreditCode; + private String taxRegistrationNumber; + private String type; + private String url; + private String validPeriod; + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getBusinessScope() { + return businessScope; + } + + public void setBusinessScope(String businessScope) { + this.businessScope = businessScope; + } + + public String getCompanyName() { + return companyName; + } + + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + public String getDateOfEstablishment() { + return dateOfEstablishment; + } + + public void setDateOfEstablishment(String dateOfEstablishment) { + this.dateOfEstablishment = dateOfEstablishment; + } + + public String getFormation() { + return formation; + } + + public void setFormation(String formation) { + this.formation = formation; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getIdNumber() { + return idNumber; + } + + public void setIdNumber(String idNumber) { + this.idNumber = idNumber; + } + + public String getLegalPerson() { + return legalPerson; + } + + public void setLegalPerson(String legalPerson) { + this.legalPerson = legalPerson; + } + + public String getPaidInCapital() { + return paidInCapital; + } + + public void setPaidInCapital(String paidInCapital) { + this.paidInCapital = paidInCapital; + } + + public String getRegisteredCapital() { + return registeredCapital; + } + + public void setRegisteredCapital(String registeredCapital) { + this.registeredCapital = registeredCapital; + } + + public String getRegistrationAuthority() { + return registrationAuthority; + } + + public void setRegistrationAuthority(String registrationAuthority) { + this.registrationAuthority = registrationAuthority; + } + + public String getSocialCreditCode() { + return socialCreditCode; + } + + public void setSocialCreditCode(String socialCreditCode) { + this.socialCreditCode = socialCreditCode; + } + + public String getTaxRegistrationNumber() { + return taxRegistrationNumber; + } + + public void setTaxRegistrationNumber(String taxRegistrationNumber) { + this.taxRegistrationNumber = taxRegistrationNumber; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getValidPeriod() { + return validPeriod; + } + + public void setValidPeriod(String validPeriod) { + this.validPeriod = validPeriod; + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/constant/SPConstant.java b/app/src/main/java/com/oneclouds/cargo/constant/SPConstant.java new file mode 100644 index 0000000..df4ad41 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/constant/SPConstant.java @@ -0,0 +1,18 @@ +package com.oneclouds.cargo.constant; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/14 17:36 + * @description: + */ +public class SPConstant { + + //数据 + public static final String DATA="data"; + //token + public static final String DATA_TOKEN="data_token"; + //token + public static final String DATA_USER="data_user"; + +} diff --git a/app/src/main/java/com/oneclouds/cargo/event/AddressEvent.java b/app/src/main/java/com/oneclouds/cargo/event/AddressEvent.java new file mode 100644 index 0000000..515c350 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/event/AddressEvent.java @@ -0,0 +1,32 @@ +package com.oneclouds.cargo.event; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/14 15:37 + * @description: + */ +public class AddressEvent{ + + private String message; + private int type; + + public AddressEvent(String message,int type) { + this.message = message; + this.type = type; + } + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/event/BalanceEvent.java b/app/src/main/java/com/oneclouds/cargo/event/BalanceEvent.java new file mode 100644 index 0000000..c5879ef --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/event/BalanceEvent.java @@ -0,0 +1,22 @@ +package com.oneclouds.cargo.event; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/26 9:31 + * @description: + */ +public class BalanceEvent { + + private String message; + + public BalanceEvent(String message) { + this.message = message; + } + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/event/BaseEvent.java b/app/src/main/java/com/oneclouds/cargo/event/BaseEvent.java new file mode 100644 index 0000000..10e755b --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/event/BaseEvent.java @@ -0,0 +1,37 @@ +package com.oneclouds.cargo.event; + +/** + * @ClassName BaseEvent + * @Author 用户 + * @Date 2022/5/18 16:11 + * @Description TODO + */ +public class BaseEvent { + private String msg; + private T data; + public BaseEvent() { + + } + + + public BaseEvent(String msg, T data) { + this.msg = msg; + this.data = data; + } + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public T getData() { + return data; + } + + public void setData(T data) { + this.data = data; + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/event/GoodsEvent.java b/app/src/main/java/com/oneclouds/cargo/event/GoodsEvent.java new file mode 100644 index 0000000..44c8231 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/event/GoodsEvent.java @@ -0,0 +1,21 @@ +package com.oneclouds.cargo.event; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/16 10:08 + * @description: + */ +public class GoodsEvent { + private String message; + + public GoodsEvent(String message) { + this.message = message; + } + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/event/InformationEvent.java b/app/src/main/java/com/oneclouds/cargo/event/InformationEvent.java new file mode 100644 index 0000000..6ba4411 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/event/InformationEvent.java @@ -0,0 +1,23 @@ +package com.oneclouds.cargo.event; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/10/31 18:41 + * @description: + */ +public class InformationEvent { + + private String message; + + public InformationEvent(String message) { + this.message = message; + } + public String getMessage() { + return message; + } + public void setMessage(String message) { + this.message = message; + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/event/InformationEventTwo.java b/app/src/main/java/com/oneclouds/cargo/event/InformationEventTwo.java new file mode 100644 index 0000000..2fcb689 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/event/InformationEventTwo.java @@ -0,0 +1,34 @@ +package com.oneclouds.cargo.event; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/10/31 18:41 + * @description: + */ +public class InformationEventTwo { + + private String os; + private String op; + + public InformationEventTwo(String os, String op) { + this.os = os; + this.op = op; + } + + public String getOs() { + return os; + } + + public void setOs(String os) { + this.os = os; + } + + public String getOp() { + return op; + } + + public void setOp(String op) { + this.op = op; + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/request/AddressRequest.java b/app/src/main/java/com/oneclouds/cargo/request/AddressRequest.java new file mode 100644 index 0000000..79902d7 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/request/AddressRequest.java @@ -0,0 +1,101 @@ +package com.oneclouds.cargo.request; + +import android.content.Context; +import android.os.Handler; +import android.util.Log; + +import com.google.gson.Gson; +import com.oneclouds.cargo.constant.SPConstant; +import com.oneclouds.cargo.request.bean.AddressInputBean; +import com.oneclouds.cargo.request.manager.UrlManager; +import com.oneclouds.cargo.util.MapUtil; +import com.oneclouds.cargo.util.SPUtil; +import com.oneclouds.cargo.util.http.OkDate; +import com.oneclouds.cargo.util.http.OkHttpUtil; +import com.oneclouds.cargo.util.http.RequestTest; + +import java.util.HashMap; +import java.util.Map; + +import okhttp3.Request; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/7 11:37 + * @description:地址请求 + */ +public class AddressRequest { + + private Context con; + private Handler hd; + private String token; + + public AddressRequest(Context con, Handler hd) { + this.con = con; + this.hd = hd; + } + + private Gson gson=new Gson(); + + public String getToken(Context con) { + return SPUtil.getSP(con, SPConstant.DATA,SPConstant.DATA_TOKEN); + } + + //地址信息删除 + public static final String ADDRESS_DELETE="/app/shipper/address/delete"; + //地址信息查询 + public static final String ADDRESS_FIND_BY_ID="/app/shipper/address/findById"; + //地址信息列表 + public static final String ADDRESS_FIND_PAGE="/app/shipper/address/findPage"; + //查询登录用户地址信息列表 + public static final String ADDRESS_FIND_PAGE_MY_SELF="/app/shipper/address/findPageMySelf"; + //地址信息保存 + public static final String ADDRESS_SAVE="/app/shipper/address/save"; + + + public static final String COMPANY_SAVE="/app/shipper/auth/companyInfo"; + + //地址信息删除 + public void addressDelete(int id){ + Log.e("--id--",id+""); + Request re = OkHttpUtil.postFrom(new OkDate(UrlManager.getAddressDelete(), "post", ""),getToken(con),id); + RequestTest.test(1,ADDRESS_DELETE,re,con,hd); + } + //地址信息查询 + public void addressFindById(int id){ + Map map=new HashMap<>(); + map.put("id",id); + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getOrderCarTypeAndCarLong(), "post", MapUtil.mapJson(map)),getToken(con),con); + RequestTest.test(1,ADDRESS_FIND_BY_ID,re,con,hd); + } + //地址信息列表 + public void addressFindPage(int id){ + Map map=new HashMap<>(); + map.put("id",id); + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getOrderCarTypeAndCarLong(), "post", MapUtil.mapJson(map)),getToken(con),con); + RequestTest.test(1,ADDRESS_FIND_PAGE,re,con,hd); + } + //查询登录用户地址信息列表 + public void addressFindPageMySelf(int page,int limit,int addressType){ + Map map=new HashMap<>(); + map.put("page",page); + map.put("limit",limit); + map.put("addressType",addressType); + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getAddressFindPageMySelf(), "post", MapUtil.mapJson(map)),getToken(con),con); + RequestTest.test(1,ADDRESS_FIND_PAGE_MY_SELF,re,con,hd); + } + //地址信息保存 + public void addressSave(AddressInputBean aib){ + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getAddressSave(), "post", gson.toJson(aib)),getToken(con),con); + RequestTest.test(1,ADDRESS_SAVE,re,con,hd); + } + + //地址信息保存 + public void getComInfo(){ + Request re = OkHttpUtil.get(new OkDate(UrlManager.getCompanyInfo(), "get", ""),getToken(con),con); + RequestTest.test(1,COMPANY_SAVE,re,con,hd); + } + + +} diff --git a/app/src/main/java/com/oneclouds/cargo/request/AuthRequest.java b/app/src/main/java/com/oneclouds/cargo/request/AuthRequest.java new file mode 100644 index 0000000..9041d16 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/request/AuthRequest.java @@ -0,0 +1,109 @@ +package com.oneclouds.cargo.request; + +import android.content.Context; +import android.os.Handler; + +import com.google.gson.Gson; +import com.oneclouds.cargo.constant.SPConstant; +import com.oneclouds.cargo.request.bean.AuthCompanyInputBean; +import com.oneclouds.cargo.request.bean.AuthCompanySaveInputBean; +import com.oneclouds.cargo.request.bean.AuthCorporationInputBean; +import com.oneclouds.cargo.request.bean.AuthSaveInputBean; +import com.oneclouds.cargo.request.manager.UrlManager; +import com.oneclouds.cargo.util.MapUtil; +import com.oneclouds.cargo.util.SPUtil; +import com.oneclouds.cargo.util.http.OkDate; +import com.oneclouds.cargo.util.http.OkHttpUtil; +import com.oneclouds.cargo.util.http.RequestTest; + +import java.util.HashMap; +import java.util.Map; + +import okhttp3.Request; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/18 10:30 + * @description: + */ +public class AuthRequest { + + private Context con; + private Handler hd; + private String token; + + public AuthRequest(Context con, Handler hd) { + this.con = con; + this.hd = hd; + } + + private Gson gson=new Gson(); + + public String getToken(Context con) { + return SPUtil.getSP(con, SPConstant.DATA,SPConstant.DATA_TOKEN); + } + + //货主认证信息查看 + public static final String AUTH_INFO="auth_authInfo"; + //货主企业公司信息认证保存 + public static final String AUTH_ENTER_PRISE_AUTH_COMPANY="auth_enterpriseAuthCompany"; + //货主企业法人信息保存 + public static final String AUTH_ENTER_PRISE_AUTH_CORPORATION="auth_nterpriseAuthCorporation"; + //货主企业认证保存 + public static final String AUTH_ENTER_PRISE_AUTH_SAVE="auth_enterpriseAuthSave"; + //货主企业委托授权书信息保存 + public static final String AUTH_ENTER_PRISE_AUTH_WARRANT="auth_enterpriseAuthWarrant"; + //货主信息是否已认证 + public static final String AUTH_IS_AUTH="auth_isAuth"; + //货主个人认证保存 + public static final String AUTH_PERSON_AUTH_SAVE="auth_personAuthSave"; + //货主党员认证 + public static final String AUTH_PARTY_MEMBER="/app/user/partyMember"; + + //货主认证信息查看 + public void auth_info(){ + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getAuthInfo(), "post", ""),getToken(con),con); + RequestTest.test(1,AUTH_INFO,re,con,hd); + } + //货主企业公司信息认证保存 + public void authCompany(AuthCompanyInputBean acib){ + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getAuthEnterPriseAuthCompany(), "post", gson.toJson(acib)),getToken(con),con); + RequestTest.test(1,AUTH_ENTER_PRISE_AUTH_COMPANY,re,con,hd); + } + //货主企业法人信息保存 + public void authCoproration(AuthCorporationInputBean aci){ + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getAuthEnterPriseAuthCorporation(), "post", gson.toJson(aci)),getToken(con),con); + RequestTest.test(1,AUTH_ENTER_PRISE_AUTH_CORPORATION,re,con,hd); + } + //货主企业认证保存 + public void authCompanySave(AuthCompanySaveInputBean acsi){ + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getAuthEnterPriseAuthCompany(), "post", gson.toJson(acsi)),getToken(con),con); + RequestTest.test(1,AUTH_ENTER_PRISE_AUTH_SAVE,re,con,hd); + } + //货主企业委托授权书信息保存 + public void authWarrant(int warrant){ + Map map=new HashMap<>(); + map.put("warrant",warrant); + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getAuthEnterPriseAuthWarrant(), "post", MapUtil.mapJson(map)),getToken(con),con); + RequestTest.test(1,AUTH_ENTER_PRISE_AUTH_WARRANT,re,con,hd); + } + //货主信息是否已认证 + public void isAuth(){ + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getAuthIsAuth(), "post", ""),getToken(con),con); + RequestTest.test(1,AUTH_IS_AUTH,re,con,hd); + } + //货主个人认证保存 + public void authSave(AuthSaveInputBean asib){ + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getAuthPersonAuthSave(), "post",gson.toJson(asib)),getToken(con),con); + RequestTest.test(1,AUTH_PERSON_AUTH_SAVE,re,con,hd); + } + //党员认证 + public void partyMember(String url){ + Map map=new HashMap<>(); + map.put("partyMemberUrl",url); + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getAuthPartyMember(), "post", MapUtil.mapJson(map)),getToken(con),con); + RequestTest.test(1,AUTH_PARTY_MEMBER,re,con,hd); + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/request/CateRequest.java b/app/src/main/java/com/oneclouds/cargo/request/CateRequest.java new file mode 100644 index 0000000..53f2ff8 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/request/CateRequest.java @@ -0,0 +1,118 @@ +package com.oneclouds.cargo.request; + +import android.content.Context; +import android.os.Handler; + +import com.google.gson.Gson; +import com.oneclouds.cargo.constant.SPConstant; +import com.oneclouds.cargo.request.bean.CateInputBean; +import com.oneclouds.cargo.request.manager.UrlManager; +import com.oneclouds.cargo.util.MapUtil; +import com.oneclouds.cargo.util.SPUtil; +import com.oneclouds.cargo.util.http.OkDate; +import com.oneclouds.cargo.util.http.OkHttpUtil; +import com.oneclouds.cargo.util.http.RequestTest; + +import java.util.HashMap; +import java.util.Map; + +import okhttp3.Request; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/7 11:45 + * @description: + */ + +public class CateRequest { + //SPConstant + private Context con; + private Handler hd; + private String token; + + public CateRequest(Context con, Handler hd) { + this.con = con; + this.hd = hd; + } + + private Gson gson=new Gson(); + + public String getToken(Context con) { + return SPUtil.getSP(con, SPConstant.DATA,SPConstant.DATA_TOKEN); + } + + //货物小类添加 + public static final String CATE_ADD="cate_add"; + //货物小类删除 + public static final String CATE_DELETE="cate_delete"; + //货物小类修改 + public static final String CATE_UPDATE="cate_update"; + //货物小类列表 + public static final String CATE_LIST="cate_list"; + //无分页小类列表 + public static final String CATE_NLIST="cate_nlist"; + //无分页大类列表 + public static final String CATE_NPLIST="cate_nplist"; + //安联货物分类 + public static final String CATE_NPLIST_AL="cate_nplistAl"; + public static final String CATE_CAR_LIST="cate_nplist_car_list"; + + //货物小类添加 + public void addCate(CateInputBean cb){ + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getCateAdd(), "post", gson.toJson(cb)),getToken(con),con); + RequestTest.test(1,CATE_ADD,re,con,hd); + } + //货物小类删除 + public void deleteCate(int id){ + Map map=new HashMap<>(); + map.put("id",0); + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getCateDelete(), "post", MapUtil.mapJson(map)),getToken(con),con); + RequestTest.test(1,CATE_DELETE,re,con,hd); + } + //货物小类修改 + public void updateCate(CateInputBean cb){ + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getCateUpdate(), "post", gson.toJson(cb)),getToken(con),con); + RequestTest.test(1,CATE_UPDATE,re,con,hd); + } + //货物小类列表 + public void cateList(){ + Map map=new HashMap<>(); + map.put("cateName",""); + map.put("isDisabled",0); + map.put("limit",0); + map.put("page",0); + map.put("pid",""); + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getCateList(), "post", MapUtil.mapJson(map)),getToken(con),con); + RequestTest.test(1,CATE_LIST,re,con,hd); + } + //无分页小类列表 + public void cateNList(){ + Map map=new HashMap<>(); + map.put("cateName",""); + map.put("pid",""); + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getCateNlist(), "post", MapUtil.mapJson(map)),getToken(con),con); + RequestTest.test(1,CATE_NLIST,re,con,hd); + } + //无分页大类列表 + public void cateNPList(){ + Map map=new HashMap<>(); + map.put("cateName",""); + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getCateNplist(), "post", MapUtil.mapJson(map)),getToken(con),con); + RequestTest.test(1,CATE_NPLIST,re,con,hd); + } + //安联货物分类 + public void cateNPListAl(){ + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getCateNplistAl(), "post", ""),getToken(con),con); + RequestTest.test(1,CATE_NPLIST_AL,re,con,hd); + } + + //获取车辆列表 + public void getCarList(String num){ + Map map=new HashMap<>(); + map.put("carNum",num); + map.put("driverPhone",num); + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getCarList(), "post", MapUtil.mapJson(map)),getToken(con),con); + RequestTest.test(1,CATE_CAR_LIST,re,con,hd); + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/request/GoodsRequest.java b/app/src/main/java/com/oneclouds/cargo/request/GoodsRequest.java new file mode 100644 index 0000000..a78639c --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/request/GoodsRequest.java @@ -0,0 +1,10 @@ +package com.oneclouds.cargo.request; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/7 11:35 + * @description:货物请求 + */ +public class GoodsRequest { +} diff --git a/app/src/main/java/com/oneclouds/cargo/request/InvoiceRequest.java b/app/src/main/java/com/oneclouds/cargo/request/InvoiceRequest.java new file mode 100644 index 0000000..5080d7f --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/request/InvoiceRequest.java @@ -0,0 +1,99 @@ +package com.oneclouds.cargo.request; + +import android.content.Context; +import android.os.Handler; +import android.util.Log; + +import com.google.gson.Gson; +import com.oneclouds.cargo.constant.SPConstant; +import com.oneclouds.cargo.request.bean.InvoiceHaederInputBena; +import com.oneclouds.cargo.request.bean.InvoiceInputBean; +import com.oneclouds.cargo.request.manager.UrlManager; +import com.oneclouds.cargo.util.MapUtil; +import com.oneclouds.cargo.util.SPUtil; +import com.oneclouds.cargo.util.http.OkDate; +import com.oneclouds.cargo.util.http.OkHttpUtil; +import com.oneclouds.cargo.util.http.RequestTest; + +import java.util.HashMap; +import java.util.Map; + +import cn.hutool.json.JSONObject; +import okhttp3.Request; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/7 11:36 + * @description:发票请求 + */ +public class InvoiceRequest { + + private Context con; + private Handler hd; + private String token; + + public InvoiceRequest(Context con, Handler hd) { + this.con = con; + this.hd = hd; + } + + private Gson gson=new Gson(); + + public String getToken(Context con) { + return SPUtil.getSP(con, SPConstant.DATA,SPConstant.DATA_TOKEN); + } + /*--发票管理--*/ + + //可申请发票的订单 + private static final String INVOICE_CAN_APPLY_ORDER="/app/shipper/invoice/canApplyOrder"; + //已申请开票详情 + private static final String INVOICE_DETAILS_BY_ID="/app/shipper/invoice/detailsById"; + //发票申请记录 + public static final String INVOICE_FIND_PAGE="invoice_findPage"; + //申请发票保存 + public static final String INVOICE_SAVE="invoice_save"; + //发票抬头信息删除 + public static final String INVOICE_DELETE="invoice_title_delete"; + //通过id查询发票抬头信息 + private static final String INVOICE_FIND_BY_ID="/app/shipper/invoice/title/findById"; + //查询当前用户最新发票抬头信息 + public static final String INVOICE_FIND_SHIPPER_INVOICE_TITLE="invoice_title_findShipperInvoiceTitle"; + //发票抬头信息保存 + public static final String INVOICE_TITLE_SAVE="invoice_title_save"; + + //查询当前用户最新发票抬头信息 + public void invoiceHeader(){ + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getInvoiceFindShipperInvoiceTitle(), "post",""),getToken(con),con); + RequestTest.test(1,INVOICE_FIND_SHIPPER_INVOICE_TITLE,re,con,hd); + } + //发票抬头信息保存 + public void invoiceHeaderAdd(InvoiceHaederInputBena ihi,int id){ + JSONObject json=new JSONObject(gson.toJson(ihi)); + if(id!=-1){ + json.putOnce("id",id); + } + Log.e("-{json}-",json.toString()); + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getInvoiceTitleSave(), "post", json.toString()),getToken(con),con); + RequestTest.test(1,INVOICE_TITLE_SAVE,re,con,hd); + } + //发票抬头信息删除 + public void invoiceHeaderDel(int id){ + Request re = OkHttpUtil.postFrom(new OkDate(UrlManager.getInvoiceDelete(), "post",""),getToken(con),id); + RequestTest.test(1,INVOICE_DELETE,re,con,hd); + } + //申请发票保存 + public void invoiceSave(InvoiceInputBean iib){ + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getInvoiceSave(), "post",gson.toJson(iib)),getToken(con),con); + RequestTest.test(1,INVOICE_SAVE,re,con,hd); + } + //发票申请记录 + public void invoiceSave(int page,int limit){ + Map map=new HashMap<>(); + map.put("page",page); + map.put("limit",limit); + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getInvoiceFindPage(), "post", MapUtil.mapJson(map)),getToken(con),con); + RequestTest.test(1,INVOICE_FIND_PAGE,re,con,hd); + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/request/OCRRequest.java b/app/src/main/java/com/oneclouds/cargo/request/OCRRequest.java new file mode 100644 index 0000000..cb5c513 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/request/OCRRequest.java @@ -0,0 +1,70 @@ +package com.oneclouds.cargo.request; + +import android.content.Context; +import android.os.Handler; + +import com.google.gson.Gson; +import com.oneclouds.cargo.constant.SPConstant; +import com.oneclouds.cargo.request.manager.UrlManager; +import com.oneclouds.cargo.util.SPUtil; +import com.oneclouds.cargo.util.http.OkDate; +import com.oneclouds.cargo.util.http.OkHttpUtil; +import com.oneclouds.cargo.util.http.RequestTest; + +import java.io.File; + +import okhttp3.Request; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/16 16:27 + * @description:OCR识别请求 + */ +public class OCRRequest { + + private Context con; + private Handler hd; + + public OCRRequest(Context con, Handler hd) { + this.con = con; + this.hd = hd; + } + + private Gson gson=new Gson(); + + public String getToken(Context con) { + return SPUtil.getSP(con, SPConstant.DATA,SPConstant.DATA_TOKEN); + } + /*--OCR识别--*/ + + //银行卡 + public static final String OCR_BANK="ocr_bank"; + //营业执照 + public static final String OCR_BUSINESS_LICENSE="ocr_businessLicense"; + //身份证正面 + public static final String OCR_ID_CARD_FRONT="ocr_idCardFront"; + //身份证识别反面 + public static final String OCR_ID_CARD_BACK="ocr_idCardBack"; + //银行卡 + public void ORCBank(File file){ + Request re = OkHttpUtil.postFile(new OkDate(UrlManager.getOcrBank(),"post", ""),getToken(con),file,con); + RequestTest.test(1, OCR_BANK,re,con,hd); + } + //营业执照 + public void ORCBusiness(File file){ + Request re = OkHttpUtil.postFile(new OkDate(UrlManager.getOcrBusinessLicense(),"post", ""),getToken(con),file,con); + RequestTest.test(1, OCR_BUSINESS_LICENSE,re,con,hd); + } + //身份证正面 + public void ORCIdCard(File file){ + Request re = OkHttpUtil.postFile(new OkDate(UrlManager.getOcrIdCardFront(),"post", ""),getToken(con),file,con); + RequestTest.test(1, OCR_ID_CARD_FRONT,re,con,hd); + } + //身份证识别反面 + public void ORCIdCardBack(File file){ + Request re = OkHttpUtil.postFile(new OkDate(UrlManager.getOcrIdCardBack(),"post", ""),getToken(con),file,con); + RequestTest.test(1, OCR_ID_CARD_BACK,re,con,hd); + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/request/OrderRequest.java b/app/src/main/java/com/oneclouds/cargo/request/OrderRequest.java new file mode 100644 index 0000000..e23ff50 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/request/OrderRequest.java @@ -0,0 +1,124 @@ +package com.oneclouds.cargo.request; + +import android.content.Context; +import android.os.Handler; + +import com.google.gson.Gson; +import com.oneclouds.cargo.constant.SPConstant; +import com.oneclouds.cargo.request.bean.OrderInputBean; +import com.oneclouds.cargo.request.manager.UrlManager; +import com.oneclouds.cargo.util.MapUtil; +import com.oneclouds.cargo.util.SPUtil; +import com.oneclouds.cargo.util.http.OkDate; +import com.oneclouds.cargo.util.http.OkHttpUtil; +import com.oneclouds.cargo.util.http.RequestTest; + +import java.util.HashMap; +import java.util.Map; + +import okhttp3.Request; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/7 11:39 + * @description:货源请求 + */ +public class OrderRequest { + + private Context con; + private Handler hd; + private String token; + + public OrderRequest(Context con, Handler hd) { + this.con = con; + this.hd = hd; + } + + private Gson gson=new Gson(); + + public String getToken(Context con) { + return SPUtil.getSP(con, SPConstant.DATA,SPConstant.DATA_TOKEN); + } + + //车型车长 + public static final String ORDER_CAR_TYPE_AND_CAR_LONG="order_CarTypeAndCarLong"; + //业务类型 + public static final String ORDER_BUSINESS_TYPE_LIST="order_businessTypeList"; + + public static final String ORDER_BUSINESS_TYPE_LIST_JTT="order_businessTypeList_jtt"; + + public static final String ORDER_BUSINESS_TYPE_LIST_AL="order_businessTypeList_al"; + //运单轨迹 + private static final String ORDER_FIND_LOCUS_LIST="order_findLocusList"; + //货源列表 + public static final String ORDER_FIND_ORDER_LIST="order_findOrderList"; + //货源删除 + public static final String ORDER_DEL="order_orderDel"; + //货源撤销 + public static final String ORDER_REVOKE="order_orderRevoke"; + //货源查询状态列表 + private static final String ORDER_STATELIST="order_orderStateList"; + //包装方式 + public static final String ORDER_PACK_NAME_LIST="order_packNameList"; + //货源保存/提交 + public static final String ORDER_PULIST_ORDER="publishOrder"; + + //车型车长 + public void carTypeLongList(){ + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getOrderCarTypeAndCarLong(), "post",""),getToken(con),con); + RequestTest.test(1,ORDER_CAR_TYPE_AND_CAR_LONG,re,con,hd); + } + //业务类型 + public void businssTypeList(){ + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getOrderBusinessTypeList(), "post",""),getToken(con),con); + RequestTest.test(1,ORDER_BUSINESS_TYPE_LIST,re,con,hd); + } + + //业务类型 + public void businssTypeListJtt(){ + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getOrderBusinessTypeListJtt(), "post",""),getToken(con),con); + RequestTest.test(1,ORDER_BUSINESS_TYPE_LIST_JTT,re,con,hd); + } + + //业务类型 + public void businssTypeListAl(){ + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getOrderBusinessTypeListAl(), "post",""),getToken(con),con); + RequestTest.test(1,ORDER_BUSINESS_TYPE_LIST_AL,re,con,hd); + } + + //包装方式 + public void packNameList(){ + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getOrderPackNameList(), "post",""),getToken(con),con); + RequestTest.test(1,ORDER_PACK_NAME_LIST,re,con,hd); + } + //货源保存/提交 + public void pulistOrder(OrderInputBean oib){ + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getOrderPulistOrder(), "post",gson.toJson(oib)),getToken(con),con); + RequestTest.test(1,ORDER_PULIST_ORDER,re,con,hd); + } + //货源列表 + public void orderList(){ + Map map=new HashMap<>(); + map.put("page",1); + map.put("limit",10); + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getOrderFindOrderList(), "post", MapUtil.mapJson(map)),getToken(con),con); + RequestTest.test(1,ORDER_FIND_ORDER_LIST,re,con,hd); + } + //货源删除 + public void orderDelete(int id){ + Map map=new HashMap<>(); + map.put("isPlatDispatch",0); + map.put("order_id",id); + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getOrderDel(), "post", MapUtil.mapJson(map)),getToken(con),con); + RequestTest.test(1,ORDER_DEL,re,con,hd); + } + //货源撤销 + public void orderRevoke(int id){ + Map map=new HashMap<>(); + map.put("isPlatDispatch",0); + map.put("order_id",id); + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getOrderRevoke(), "post", MapUtil.mapJson(map)),getToken(con),con); + RequestTest.test(1,ORDER_REVOKE,re,con,hd); + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/request/PublicRequest.java b/app/src/main/java/com/oneclouds/cargo/request/PublicRequest.java new file mode 100644 index 0000000..4110852 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/request/PublicRequest.java @@ -0,0 +1,240 @@ +package com.oneclouds.cargo.request; + +import android.content.Context; +import android.content.pm.PackageManager; +import android.os.Handler; + +import com.google.gson.Gson; +import com.oneclouds.cargo.constant.SPConstant; +import com.oneclouds.cargo.request.bean.InsBankInputBean; +import com.oneclouds.cargo.request.bean.LoginRegInputBean; +import com.oneclouds.cargo.request.manager.UrlManager; +import com.oneclouds.cargo.util.MapUtil; +import com.oneclouds.cargo.util.SPUtil; +import com.oneclouds.cargo.util.http.OkDate; +import com.oneclouds.cargo.util.http.OkHttpUtil; +import com.oneclouds.cargo.util.http.RequestTest; + +import java.io.File; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import okhttp3.Request; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/9 14:24 + * @description:公共接口请求 + */ +public class PublicRequest { + + private Context con; + private Handler hd; + + public PublicRequest(Context con, Handler hd) { + this.con = con; + this.hd = hd; + } + private Gson gson=new Gson(); + + public String getToken(Context con) { + return SPUtil.getSP(con, SPConstant.DATA,SPConstant.DATA_TOKEN); + } + + //获取验证码 + public static final String SEND_CODE = "sendcode"; + //忘记密码 + public static final String FORGETPWD = "forgetpwd"; + //账户登录 + public static final String LOGIN="login"; + //账户信息 + public static final String USER_DATA="userdate"; + //银行卡列表 + public static final String BANK_CARD_LIST="bank_card_list"; + //绑定银行卡 + public static final String BANK_CARD_ADD="add_bank"; + //删除银行卡 + public static final String BANK_CARD_DELETE="delete_bank"; + //账户提现 + public static final String BANK_CASH_APPLY="take_money"; + //生成电子账户 + public static final String CONTRACTS_ADD="add_contracts"; + //获取电子账户 + public static final String CONTRACTS_GET="get_contracts"; + //获取账户未读消息 + public static final String NOT_NEWS_COUNT="not_news_count"; + //获取账户消息 + public static final String NEW_LIST="new_list"; + //已读消息 + public static final String NEWS_READ="news_read"; + //已读全部消息 + public static final String NEWS_READ_ALL="news_read_all"; + //上传文件 + public static final String UPLOAD="upload"; + //上传头像 + public static final String UPLOAD_HEAD="upload_head"; + //版本更新 + public static String VERSION ="up_app"; + //配置项信息 + public static String CONFIG ="config"; + //大屏URL + public static String URL ="url"; + + //获取验证码 + public void getPhoneCode(String phone){ + Map map=new HashMap(); + map.put("phone",phone); + map.put("sendType",1); + Request re = OkHttpUtil.post(new OkDate(UrlManager.getSendCode(), "post", MapUtil.mapJson(map)),con); + RequestTest.test(1,SEND_CODE,re,con,hd); + } + + //获取验证码 + public void forgetPwd(String phone,String code,String pwd){ + Map map=new HashMap(); + map.put("uname",phone); + map.put("smscode",code); + map.put("upass",pwd); + map.put("reupass",pwd); + map.put("roleId","2"); + Request re = OkHttpUtil.post(new OkDate(UrlManager.forgetPwd(), "post", MapUtil.mapJson(map)),con); + RequestTest.test(1,FORGETPWD,re,con,hd); + } + //账户登录 + public void userLogin(LoginRegInputBean lrib){ + Request re = OkHttpUtil.post(new OkDate(UrlManager.getLOGIN(), "post", gson.toJson(lrib)),con); + RequestTest.test(1,LOGIN,re,con,hd); + }//账户登录 + public void userLogin2(LoginRegInputBean lrib){ + Request re = OkHttpUtil.post(new OkDate(UrlManager.getLOGIN2(), "post", gson.toJson(lrib)),con); + RequestTest.test(1,LOGIN,re,con,hd); + } + //账户信息 + public void getUserInfo(){ + Map map=new HashMap(); + map.put("idcarName",""); + map.put("idcard",""); + map.put("idcardAddress",""); + map.put("idcardPhoto",0); + map.put("idcardPhotoBack",0); + map.put("idcardSex",0); + map.put("idcardValidity",""); + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getUserInfo(), "post", MapUtil.mapJson(map)),getToken(con),con); + RequestTest.test(1,USER_DATA,re,con,hd); + } + //银行卡列表 + public void getBankCardList(){ + Map map=new HashMap(); + map.put("cardType",1); + map.put("createUser",SPUtil.getSP(con,"LoginActivity.USER","LoginActivity.USER_ID")); + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getBankCardList(), "post",MapUtil.mapJson(map)),getToken(con),con); + RequestTest.test(1, BANK_CARD_LIST,re,con,hd); + } + //绑定银行卡 + public void insBankCard(InsBankInputBean ibib){ + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getBankCardAdd(), "post",gson.toJson(ibib)),getToken(con),con); + RequestTest.test(1, BANK_CARD_ADD,re,con,hd); + } + //删除银行卡 + public void deleteBankCard(int id){ + Map map=new HashMap(); + map.put("id",id); + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getBankCardDelete(), "post", MapUtil.mapJson(map)),getToken(con),con); + RequestTest.test(1, BANK_CARD_DELETE,re,con,hd); + } + //账户提现 + public void takeMoney(String bid,String money){ + Map map=new HashMap(); + map.put("bankCardId",bid); + map.put("tradeMoney",money); + map.put("tradeTitle",""); + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getBankCashApply(), "post",MapUtil.mapJson(map)),getToken(con),con); + RequestTest.test(1,BANK_CASH_APPLY,re,con,hd); + } + //生成电子账户 + public void addContracts(){ + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getContractsAdd(), "post",""),getToken(con),con); + RequestTest.test(1,CONTRACTS_ADD,re,con,hd); + } + //获取电子账户 + public void getContracts(){ + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getContractsGet(), "post",""),getToken(con),con); + RequestTest.test(1,CONTRACTS_GET,re,con,hd); + } + //获取账户未读消息 + public void getNotNewsCount(){ + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getMessageFindNotReadCount(), "post",""),getToken(con),con); + RequestTest.test(1,NOT_NEWS_COUNT,re,con,hd); + } + //获取账户消息 + public void getNewsList(int type,int page,int limit){ + Map map=new HashMap(); + map.put("cate",type); + map.put("page",page); + map.put("limit",limit); + map.put("content",""); + map.put("createTimeEnd",""); + map.put("createTimeStart",""); + map.put("createUserName",""); + map.put("messageTypes",""); + map.put("receiverId",""); + map.put("receiverName",""); + map.put("roleId",""); + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getMessageFindPage(), "post",MapUtil.mapJson(map)),getToken(con),con); + RequestTest.test(1,NEW_LIST,re,con,hd); + } + //已读消息 + public void readNews(int id){ + Map map=new HashMap(); + map.put("id",id); + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getMessageSetReadById(), "post",MapUtil.mapJson(map)),getToken(con),con); + RequestTest.test(1,NEWS_READ,re,con,hd); + } + //已读全部消息 + public void delNewsAll(List list){ + Map map=new HashMap(); + map.put("id",0); + map.put("ids",list); + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getMessageSetReadAll(), "post",MapUtil.mapJson(map)),getToken(con),con); + RequestTest.test(1,NEWS_READ_ALL,re,con,hd); + } + //上传文件 + public void uploadFile(File file){ + Request re = OkHttpUtil.postFile(new OkDate(UrlManager.getUPLOAD(), "post", ""),getToken(con),file,con); + RequestTest.test(1, UPLOAD,re,con,hd); + } + //上传头像 + public void upHeadImg(String imgUrl){ + Map map=new HashMap(); + map.put("headportrait",imgUrl); + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getUploadHead(), "post",MapUtil.mapJson(map)),getToken(con),con); + RequestTest.test(1, UPLOAD_HEAD,re,con,hd); + } + //版本更新 + public void upApp(){ + String vs="1.0.0"; + try { + vs = con.getPackageManager().getPackageInfo(con.getPackageName(), 0).versionName; + } catch (PackageManager.NameNotFoundException e) { + e.printStackTrace(); + } + Map map=new HashMap(); + map.put("source",1); + map.put("version",vs); + Request re = OkHttpUtil.post(new OkDate(UrlManager.getVERSION(), "post",MapUtil.mapJson(map)),con); + RequestTest.test(1,VERSION,re,con,hd); + } + // + public void config(){ + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getCONFIG(), "post",""),getToken(con),con); + RequestTest.test(1,CONFIG,re,con,hd); + } + + public void getUrl(){ + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getGetUrl(), "post",""),getToken(con),con); + RequestTest.test(1,URL,re,con,hd); + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/request/UnitRequest.java b/app/src/main/java/com/oneclouds/cargo/request/UnitRequest.java new file mode 100644 index 0000000..36f44ff --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/request/UnitRequest.java @@ -0,0 +1,10 @@ +package com.oneclouds.cargo.request; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/7 11:39 + * @description:单位请求 + */ +public class UnitRequest { +} diff --git a/app/src/main/java/com/oneclouds/cargo/request/UserRequest.java b/app/src/main/java/com/oneclouds/cargo/request/UserRequest.java new file mode 100644 index 0000000..60ca00c --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/request/UserRequest.java @@ -0,0 +1,30 @@ +package com.oneclouds.cargo.request; + +import android.content.Context; +import android.os.Handler; + +import com.google.gson.Gson; +import com.oneclouds.cargo.util.SPUtil; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/7 11:38 + * @description:用户请求 + */ +public class UserRequest { + private Context con; + private Handler hd; + private String token; + + public UserRequest(Context con, Handler hd) { + this.con = con; + this.hd = hd; + } + + private Gson gson=new Gson(); + + public String getToken(Context con) { + return SPUtil.getSP(con,"",""); + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/request/WaybillRequest.java b/app/src/main/java/com/oneclouds/cargo/request/WaybillRequest.java new file mode 100644 index 0000000..536ca07 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/request/WaybillRequest.java @@ -0,0 +1,126 @@ +package com.oneclouds.cargo.request; + +import android.content.Context; +import android.os.Handler; + +import com.google.gson.Gson; +import com.oneclouds.cargo.constant.SPConstant; +import com.oneclouds.cargo.request.manager.UrlManager; +import com.oneclouds.cargo.util.MapUtil; +import com.oneclouds.cargo.util.SPUtil; +import com.oneclouds.cargo.util.http.OkDate; +import com.oneclouds.cargo.util.http.OkHttpUtil; +import com.oneclouds.cargo.util.http.RequestTest; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +import okhttp3.Request; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/7 11:38 + * @description:运单请求 + */ +public class WaybillRequest { + + private Context con; + private Handler hd; + private String token; + + public WaybillRequest(Context con, Handler hd) { + this.con = con; + this.hd = hd; + } + + private Gson gson=new Gson(); + + public String getToken(Context con) { + return SPUtil.getSP(con, SPConstant.DATA,SPConstant.DATA_TOKEN); + } + + //投诉信息保存 + public static final String WAYBILL_COMPLAINT_V3="/app/shipper/waybill/complaintV3"; + //确认装货 + public static final String WAYBILL_CONFIRM_LOADING="/app/shipper/waybill/confirmLoading"; + //确认卸货 + public static final String WAYBILL_CONFIRM_UNLOAD="/app/shipper/waybill/confirmUnload"; + //评价信息保存 + public static final String WAYBILL_EVALUATION_V3="/app/shipper/waybill/evaluationV3"; + //运单详情 + public static final String WAYBILL_GET_EXECUTE_WATBILL="/app/shipper/waybill/getExecuteWaybill"; + //获取双轨迹 + public static final String WAYBILL_GET_LOC="/app/shipper/waybill/getLoc"; + //货源详情 + public static final String WAYBILL_GET_ORDER_DETAIL="waybill_getOrderDetail"; + //获取评价信息 + public static final String WAYBILL_LIST_APPAISES="waybill_listAppraises"; + //获取投诉信息 + public static final String WAYBILL_LIST_COMPLAINT="waybill_listComplaint"; + //货源列表 + public static final String WAYBILL_LIST_V2="waybill_listV2"; + //运单列表数量 + public static final String WAYBILL_LIST_NUM="waybill_listnum"; + + //运单列表 + public void orderList(int page,int limit,int orderStatus){ + Map map=new HashMap<>(); + map.put("page",page); + map.put("limit",limit); + if(orderStatus!=0){ + map.put("orderStatus",orderStatus); + } + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getWaybillListV2(), "post", MapUtil.mapJson(map)),getToken(con),con); + RequestTest.test(1,WAYBILL_LIST_V2,re,con,hd); + } + //运单详情 + public void orderDetail(int waybillId){ + Map map=new HashMap<>(); + map.put("waybillId",waybillId); + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getWaybillGetExecuteWatbill(), "post", MapUtil.mapJson(map)),getToken(con),con); + RequestTest.test(1,WAYBILL_GET_EXECUTE_WATBILL,re,con,hd); + } + //货源详情 + public void orderDetailAll(int id){ + Map map=new HashMap<>(); + map.put("id",id); + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getWaybillGetOrderDetail(), "post", MapUtil.mapJson(map)),getToken(con),con); + RequestTest.test(1,WAYBILL_GET_ORDER_DETAIL,re,con,hd); + } + //获取评价信息 + public void orderEvaluate(int waybillId){ + Map map=new HashMap<>(); + map.put("waybillId",waybillId); + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getWaybillListAppaises(), "post", MapUtil.mapJson(map)),getToken(con),con); + RequestTest.test(1,WAYBILL_LIST_APPAISES,re,con,hd); + } + //保存评价信息 + public void evaluate(int waybillId,String content,int attitudeScore){ + Map map=new HashMap<>(); + map.put("attitudeScore",attitudeScore); + map.put("content",content); + map.put("fileIds",new ArrayList<>()); + map.put("waybillId",waybillId); + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getWaybillEvaluationV3(), "post", MapUtil.mapJson(map)),getToken(con),con); + RequestTest.test(1,WAYBILL_EVALUATION_V3,re,con,hd); + } + //获取投诉信息 + public void orderComplaint(int waybillId){ + Map map=new HashMap<>(); + map.put("waybillId",waybillId); + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getWaybillListComplaint(), "post", MapUtil.mapJson(map)),getToken(con),con); + RequestTest.test(1,WAYBILL_LIST_COMPLAINT,re,con,hd); + } + //保存投诉信息Complaint + public void complaint(int waybillId,String content){ + Map map=new HashMap<>(); + map.put("content",content); + map.put("fileIds",new ArrayList<>()); + map.put("waybillId",waybillId); + Request re = OkHttpUtil.posts(new OkDate(UrlManager.getWaybillComplaintV3(), "post", MapUtil.mapJson(map)),getToken(con),con); + RequestTest.test(1,WAYBILL_COMPLAINT_V3,re,con,hd); + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/request/bean/AddressInputBean.java b/app/src/main/java/com/oneclouds/cargo/request/bean/AddressInputBean.java new file mode 100644 index 0000000..6111bcc --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/request/bean/AddressInputBean.java @@ -0,0 +1,209 @@ +package com.oneclouds.cargo.request.bean; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/17 14:55 + * @description: + */ +public class AddressInputBean{ + + private String addressDetail; + private String businessCode; + private int addressType; + private int area; + private String areaS; + private int city; + private String cityS; + private String companyCode; + private String companyName; + private String contactNumber; + private String contactPerson; + private String createTime; + private int id; + private String idCard; + private int idDefault; + private int isDeleted; + private int province; + private String provinceS; + private String tagContent; + private String updateTime; + private int userId; + private int userType; + + public String getAreaS() { + return areaS; + } + + public void setAreaS(String areaS) { + this.areaS = areaS; + } + + public String getCityS() { + return cityS; + } + + public void setCityS(String cityS) { + this.cityS = cityS; + } + + public String getProvinceS() { + return provinceS; + } + + public void setProvinceS(String provinceS) { + this.provinceS = provinceS; + } + + public String getBusinessCode() { + return businessCode; + } + + public void setBusinessCode(String businessCode) { + this.businessCode = businessCode; + } + + public String getAddressDetail() { + return addressDetail; + } + + public void setAddressDetail(String addressDetail) { + this.addressDetail = addressDetail; + } + + public int getAddressType() { + return addressType; + } + + public void setAddressType(int addressType) { + this.addressType = addressType; + } + + public int getArea() { + return area; + } + + public void setArea(int area) { + this.area = area; + } + + public int getCity() { + return city; + } + + public void setCity(int city) { + this.city = city; + } + + public String getCompanyCode() { + return companyCode; + } + + public void setCompanyCode(String companyCode) { + this.companyCode = companyCode; + } + + public String getCompanyName() { + return companyName; + } + + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + public String getContactNumber() { + return contactNumber; + } + + public void setContactNumber(String contactNumber) { + this.contactNumber = contactNumber; + } + + public String getContactPerson() { + return contactPerson; + } + + public void setContactPerson(String contactPerson) { + this.contactPerson = contactPerson; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getIdCard() { + return idCard; + } + + public void setIdCard(String idCard) { + this.idCard = idCard; + } + + public int getIdDefault() { + return idDefault; + } + + public void setIdDefault(int idDefault) { + this.idDefault = idDefault; + } + + public int getIsDeleted() { + return isDeleted; + } + + public void setIsDeleted(int isDeleted) { + this.isDeleted = isDeleted; + } + + public int getProvince() { + return province; + } + + public void setProvince(int province) { + this.province = province; + } + + public String getTagContent() { + return tagContent; + } + + public void setTagContent(String tagContent) { + this.tagContent = tagContent; + } + + public String getUpdateTime() { + return updateTime; + } + + public void setUpdateTime(String updateTime) { + this.updateTime = updateTime; + } + + public int getUserId() { + return userId; + } + + public void setUserId(int userId) { + this.userId = userId; + } + + public int getUserType() { + return userType; + } + + public void setUserType(int userType) { + this.userType = userType; + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/request/bean/AuthCompanyInputBean.java b/app/src/main/java/com/oneclouds/cargo/request/bean/AuthCompanyInputBean.java new file mode 100644 index 0000000..89791cc --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/request/bean/AuthCompanyInputBean.java @@ -0,0 +1,83 @@ +package com.oneclouds.cargo.request.bean; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/18 10:41 + * @description: + */ +public class AuthCompanyInputBean { + + private String addressDetail; + private int area; + private int businessLicense; + private int city; + private String code; + private String companyShorterName; + private int province; + private String realCompanyName; + + public String getAddressDetail() { + return addressDetail; + } + + public void setAddressDetail(String addressDetail) { + this.addressDetail = addressDetail; + } + + public int getArea() { + return area; + } + + public void setArea(int area) { + this.area = area; + } + + public int getBusinessLicense() { + return businessLicense; + } + + public void setBusinessLicense(int businessLicense) { + this.businessLicense = businessLicense; + } + + public int getCity() { + return city; + } + + public void setCity(int city) { + this.city = city; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getCompanyShorterName() { + return companyShorterName; + } + + public void setCompanyShorterName(String companyShorterName) { + this.companyShorterName = companyShorterName; + } + + public int getProvince() { + return province; + } + + public void setProvince(int province) { + this.province = province; + } + + public String getRealCompanyName() { + return realCompanyName; + } + + public void setRealCompanyName(String realCompanyName) { + this.realCompanyName = realCompanyName; + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/request/bean/AuthCompanySaveInputBean.java b/app/src/main/java/com/oneclouds/cargo/request/bean/AuthCompanySaveInputBean.java new file mode 100644 index 0000000..3a9dd13 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/request/bean/AuthCompanySaveInputBean.java @@ -0,0 +1,209 @@ +package com.oneclouds.cargo.request.bean; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/18 10:46 + * @description: + */ +public class AuthCompanySaveInputBean { + + private String addressDetail; + private int area; + private int businessLicense; + private int city; + private String code; + private String contactName; + private String contactPhone; + private String corporationIdcard; + private int corporationIdcardPhoto; + private int corporationIdcardPhotoBack; + private int corporationIdcardPhotoHold; + private String corporationIdcardValidity; + private String corporationName; + private String corporationPhone; + private String idcard; + private int idcardPhoto; + private int idcardPhotoBack; + private int idcardPhotoHold; + private String idcardValidity; + private int province; + private String realCompanyName; + private int warrant; + + public String getAddressDetail() { + return addressDetail; + } + + public void setAddressDetail(String addressDetail) { + this.addressDetail = addressDetail; + } + + public int getArea() { + return area; + } + + public void setArea(int area) { + this.area = area; + } + + public int getBusinessLicense() { + return businessLicense; + } + + public void setBusinessLicense(int businessLicense) { + this.businessLicense = businessLicense; + } + + public int getCity() { + return city; + } + + public void setCity(int city) { + this.city = city; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getContactName() { + return contactName; + } + + public void setContactName(String contactName) { + this.contactName = contactName; + } + + public String getContactPhone() { + return contactPhone; + } + + public void setContactPhone(String contactPhone) { + this.contactPhone = contactPhone; + } + + public String getCorporationIdcard() { + return corporationIdcard; + } + + public void setCorporationIdcard(String corporationIdcard) { + this.corporationIdcard = corporationIdcard; + } + + public int getCorporationIdcardPhoto() { + return corporationIdcardPhoto; + } + + public void setCorporationIdcardPhoto(int corporationIdcardPhoto) { + this.corporationIdcardPhoto = corporationIdcardPhoto; + } + + public int getCorporationIdcardPhotoBack() { + return corporationIdcardPhotoBack; + } + + public void setCorporationIdcardPhotoBack(int corporationIdcardPhotoBack) { + this.corporationIdcardPhotoBack = corporationIdcardPhotoBack; + } + + public int getCorporationIdcardPhotoHold() { + return corporationIdcardPhotoHold; + } + + public void setCorporationIdcardPhotoHold(int corporationIdcardPhotoHold) { + this.corporationIdcardPhotoHold = corporationIdcardPhotoHold; + } + + public String getCorporationIdcardValidity() { + return corporationIdcardValidity; + } + + public void setCorporationIdcardValidity(String corporationIdcardValidity) { + this.corporationIdcardValidity = corporationIdcardValidity; + } + + public String getCorporationName() { + return corporationName; + } + + public void setCorporationName(String corporationName) { + this.corporationName = corporationName; + } + + public String getCorporationPhone() { + return corporationPhone; + } + + public void setCorporationPhone(String corporationPhone) { + this.corporationPhone = corporationPhone; + } + + public String getIdcard() { + return idcard; + } + + public void setIdcard(String idcard) { + this.idcard = idcard; + } + + public int getIdcardPhoto() { + return idcardPhoto; + } + + public void setIdcardPhoto(int idcardPhoto) { + this.idcardPhoto = idcardPhoto; + } + + public int getIdcardPhotoBack() { + return idcardPhotoBack; + } + + public void setIdcardPhotoBack(int idcardPhotoBack) { + this.idcardPhotoBack = idcardPhotoBack; + } + + public int getIdcardPhotoHold() { + return idcardPhotoHold; + } + + public void setIdcardPhotoHold(int idcardPhotoHold) { + this.idcardPhotoHold = idcardPhotoHold; + } + + public String getIdcardValidity() { + return idcardValidity; + } + + public void setIdcardValidity(String idcardValidity) { + this.idcardValidity = idcardValidity; + } + + public int getProvince() { + return province; + } + + public void setProvince(int province) { + this.province = province; + } + + public String getRealCompanyName() { + return realCompanyName; + } + + public void setRealCompanyName(String realCompanyName) { + this.realCompanyName = realCompanyName; + } + + public int getWarrant() { + return warrant; + } + + public void setWarrant(int warrant) { + this.warrant = warrant; + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/request/bean/AuthCorporationInputBean.java b/app/src/main/java/com/oneclouds/cargo/request/bean/AuthCorporationInputBean.java new file mode 100644 index 0000000..c0c2abd --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/request/bean/AuthCorporationInputBean.java @@ -0,0 +1,57 @@ +package com.oneclouds.cargo.request.bean; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/18 10:44 + * @description: + */ +public class AuthCorporationInputBean { + + + private String corporationIdcard; + private int corporationIdcardPhoto; + private int corporationIdcardPhotoBack; + private String corporationIdcardValidity; + private String corporationName; + + public String getCorporationIdcard() { + return corporationIdcard; + } + + public void setCorporationIdcard(String corporationIdcard) { + this.corporationIdcard = corporationIdcard; + } + + public int getCorporationIdcardPhoto() { + return corporationIdcardPhoto; + } + + public void setCorporationIdcardPhoto(int corporationIdcardPhoto) { + this.corporationIdcardPhoto = corporationIdcardPhoto; + } + + public int getCorporationIdcardPhotoBack() { + return corporationIdcardPhotoBack; + } + + public void setCorporationIdcardPhotoBack(int corporationIdcardPhotoBack) { + this.corporationIdcardPhotoBack = corporationIdcardPhotoBack; + } + + public String getCorporationIdcardValidity() { + return corporationIdcardValidity; + } + + public void setCorporationIdcardValidity(String corporationIdcardValidity) { + this.corporationIdcardValidity = corporationIdcardValidity; + } + + public String getCorporationName() { + return corporationName; + } + + public void setCorporationName(String corporationName) { + this.corporationName = corporationName; + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/request/bean/AuthSaveInputBean.java b/app/src/main/java/com/oneclouds/cargo/request/bean/AuthSaveInputBean.java new file mode 100644 index 0000000..82979e3 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/request/bean/AuthSaveInputBean.java @@ -0,0 +1,65 @@ +package com.oneclouds.cargo.request.bean; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/18 10:51 + * @description: + */ +public class AuthSaveInputBean { + + private String contactName; + private String contactPhone; + private String idcard; + private int idcardPhoto; + private int idcardPhotoBack; + private String idcardValidity; + + public String getContactName() { + return contactName; + } + + public void setContactName(String contactName) { + this.contactName = contactName; + } + + public String getContactPhone() { + return contactPhone; + } + + public void setContactPhone(String contactPhone) { + this.contactPhone = contactPhone; + } + + public String getIdcard() { + return idcard; + } + + public void setIdcard(String idcard) { + this.idcard = idcard; + } + + public int getIdcardPhoto() { + return idcardPhoto; + } + + public void setIdcardPhoto(int idcardPhoto) { + this.idcardPhoto = idcardPhoto; + } + + public int getIdcardPhotoBack() { + return idcardPhotoBack; + } + + public void setIdcardPhotoBack(int idcardPhotoBack) { + this.idcardPhotoBack = idcardPhotoBack; + } + + public String getIdcardValidity() { + return idcardValidity; + } + + public void setIdcardValidity(String idcardValidity) { + this.idcardValidity = idcardValidity; + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/request/bean/CateInputBean.java b/app/src/main/java/com/oneclouds/cargo/request/bean/CateInputBean.java new file mode 100644 index 0000000..57d920d --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/request/bean/CateInputBean.java @@ -0,0 +1,66 @@ +package com.oneclouds.cargo.request.bean; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/14 18:05 + * @description: + */ +public class CateInputBean { + + private String cateName; + private int id; + private int isDisabled; + private int pid; + private String rate; + private String remarks; + + public String getCateName() { + return cateName; + } + + public void setCateName(String cateName) { + this.cateName = cateName; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getIsDisabled() { + return isDisabled; + } + + public void setIsDisabled(int isDisabled) { + this.isDisabled = isDisabled; + } + + public int getPid() { + return pid; + } + + public void setPid(int pid) { + this.pid = pid; + } + + public String getRate() { + return rate; + } + + public void setRate(String rate) { + this.rate = rate; + } + + public String getRemarks() { + return remarks; + } + + public void setRemarks(String remarks) { + this.remarks = remarks; + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/request/bean/InsBankInputBean.java b/app/src/main/java/com/oneclouds/cargo/request/bean/InsBankInputBean.java new file mode 100644 index 0000000..95863a9 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/request/bean/InsBankInputBean.java @@ -0,0 +1,137 @@ +package com.oneclouds.cargo.request.bean; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/8/18 15:57 + * @description: + */ +public class InsBankInputBean { + + private String address; + private int auditStatus; + private int bankId; + private String bankName; + private String cardNo; + private int cardType; + private int cardUserType; + private String companyCode; + private String companyName; + private String createTime; + private int id; + private int isDeleted; + private String openBank; + private String phone; + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public int getAuditStatus() { + return auditStatus; + } + + public void setAuditStatus(int auditStatus) { + this.auditStatus = auditStatus; + } + + public int getBankId() { + return bankId; + } + + public void setBankId(int bankId) { + this.bankId = bankId; + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getCardNo() { + return cardNo; + } + + public void setCardNo(String cardNo) { + this.cardNo = cardNo; + } + + public int getCardType() { + return cardType; + } + + public void setCardType(int cardType) { + this.cardType = cardType; + } + + public int getCardUserType() { + return cardUserType; + } + + public void setCardUserType(int cardUserType) { + this.cardUserType = cardUserType; + } + + public String getCompanyCode() { + return companyCode; + } + + public void setCompanyCode(String companyCode) { + this.companyCode = companyCode; + } + + public String getCompanyName() { + return companyName; + } + + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + public String getCreateTime() { + return createTime; + } + + public void setCreateTime(String createTime) { + this.createTime = createTime; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getIsDeleted() { + return isDeleted; + } + + public void setIsDeleted(int isDeleted) { + this.isDeleted = isDeleted; + } + + public String getOpenBank() { + return openBank; + } + + public void setOpenBank(String openBank) { + this.openBank = openBank; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/request/bean/InvoiceHaederInputBena.java b/app/src/main/java/com/oneclouds/cargo/request/bean/InvoiceHaederInputBena.java new file mode 100644 index 0000000..7372fa2 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/request/bean/InvoiceHaederInputBena.java @@ -0,0 +1,65 @@ +package com.oneclouds.cargo.request.bean; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/23 10:25 + * @description: + */ +public class InvoiceHaederInputBena { + + private String address; + private String bankAccount; + private String bankName; + private String phone; + private String taxNo; + private String title; + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public String getBankAccount() { + return bankAccount; + } + + public void setBankAccount(String bankAccount) { + this.bankAccount = bankAccount; + } + + public String getBankName() { + return bankName; + } + + public void setBankName(String bankName) { + this.bankName = bankName; + } + + public String getPhone() { + return phone; + } + + public void setPhone(String phone) { + this.phone = phone; + } + + public String getTaxNo() { + return taxNo; + } + + public void setTaxNo(String taxNo) { + this.taxNo = taxNo; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/request/bean/InvoiceInputBean.java b/app/src/main/java/com/oneclouds/cargo/request/bean/InvoiceInputBean.java new file mode 100644 index 0000000..c51d85c --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/request/bean/InvoiceInputBean.java @@ -0,0 +1,58 @@ +package com.oneclouds.cargo.request.bean; + +import java.util.List; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/26 10:55 + * @description: + */ +public class InvoiceInputBean { + + private int addressId; + private int invoiceTitleId; + private int nature; + private List orderIds; + private String remark; + + public int getAddressId() { + return addressId; + } + + public void setAddressId(int addressId) { + this.addressId = addressId; + } + + public int getInvoiceTitleId() { + return invoiceTitleId; + } + + public void setInvoiceTitleId(int invoiceTitleId) { + this.invoiceTitleId = invoiceTitleId; + } + + public int getNature() { + return nature; + } + + public void setNature(int nature) { + this.nature = nature; + } + + public List getOrderId() { + return orderIds; + } + + public void setOrderId(List orderIds) { + this.orderIds = orderIds; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/request/bean/LoginRegInputBean.java b/app/src/main/java/com/oneclouds/cargo/request/bean/LoginRegInputBean.java new file mode 100644 index 0000000..2667ff7 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/request/bean/LoginRegInputBean.java @@ -0,0 +1,110 @@ +package com.oneclouds.cargo.request.bean; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/8/2 9:45 + * @description:登录和注册的入参实体 + */ +public class LoginRegInputBean { + + private String captcha; + private String companyName; + private int registerType; + private String reupass; + private String rname; + private int roleId; + private String smscode; + private String password; + private String userName; + private String uname; + private String upass; + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public String getUserName() { + return userName; + } + + public void setUserName(String userName) { + this.userName = userName; + } + + public String getCaptcha() { + return captcha; + } + + public void setCaptcha(String captcha) { + this.captcha = captcha; + } + + public String getCompanyName() { + return companyName; + } + + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + public int getRegisterType() { + return registerType; + } + + public void setRegisterType(int registerType) { + this.registerType = registerType; + } + + public String getReupass() { + return reupass; + } + + public void setReupass(String reupass) { + this.reupass = reupass; + } + + public String getRname() { + return rname; + } + + public void setRname(String rname) { + this.rname = rname; + } + + public int getRoleId() { + return roleId; + } + + public void setRoleId(int roleId) { + this.roleId = roleId; + } + + public String getSmscode() { + return smscode; + } + + public void setSmscode(String smscode) { + this.smscode = smscode; + } + + public String getUname() { + return uname; + } + + public void setUname(String uname) { + this.uname = uname; + } + + public String getUpass() { + return upass; + } + + public void setUpass(String upass) { + this.upass = upass; + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/request/bean/OrderInputBean.java b/app/src/main/java/com/oneclouds/cargo/request/bean/OrderInputBean.java new file mode 100644 index 0000000..f004380 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/request/bean/OrderInputBean.java @@ -0,0 +1,488 @@ +package com.oneclouds.cargo.request.bean; + +import java.util.List; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/13 17:12 + * @description: + */ +public class OrderInputBean { + + + private FormDataDTO formData; + private int isSubmit; + private List putTableData; + private List sendTableData; + + public FormDataDTO getFormData() { + return formData; + } + + public void setFormData(FormDataDTO formData) { + this.formData = formData; + } + + public int getIsSubmit() { + return isSubmit; + } + + public void setIsSubmit(int isSubmit) { + this.isSubmit = isSubmit; + } + + public List getPutTableData() { + return putTableData; + } + + public void setPutTableData(List putTableData) { + this.putTableData = putTableData; + } + + public List getSendTableData() { + return sendTableData; + } + + public void setSendTableData(List sendTableData) { + this.sendTableData = sendTableData; + } + + public static class FormDataDTO { + private int alctGoodsType; + private int allowSplitting; + private int businessType; + private String effectiveTime; + private int goodsBigCate; + private int id; + private int isInsure; + private int isSubmit; + private String namedDrivers; + private String requirement; + private String shipperCarId; + private String shipperDriverId; + private int vehicleLength; + private int vehicleType; + + public String getShipperCarId() { + return shipperCarId; + } + + public void setShipperCarId(String shipperCarId) { + this.shipperCarId = shipperCarId; + } + + public String getShipperDriverId() { + return shipperDriverId; + } + + public void setShipperDriverId(String shipperDriverId) { + this.shipperDriverId = shipperDriverId; + } + + public int getAlctGoodsType() { + return alctGoodsType; + } + + public void setAlctGoodsType(int alctGoodsType) { + this.alctGoodsType = alctGoodsType; + } + + public int getAllowSplitting() { + return allowSplitting; + } + + public void setAllowSplitting(int allowSplitting) { + this.allowSplitting = allowSplitting; + } + + public int getBusinessType() { + return businessType; + } + + public void setBusinessType(int businessType) { + this.businessType = businessType; + } + + public String getEffectiveTime() { + return effectiveTime; + } + + public void setEffectiveTime(String effectiveTime) { + this.effectiveTime = effectiveTime; + } + + public int getGoodsBigCate() { + return goodsBigCate; + } + + public void setGoodsBigCate(int goodsBigCate) { + this.goodsBigCate = goodsBigCate; + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public int getIsInsure() { + return isInsure; + } + + public void setIsInsure(int isInsure) { + this.isInsure = isInsure; + } + + public int getIsSubmit() { + return isSubmit; + } + + public void setIsSubmit(int isSubmit) { + this.isSubmit = isSubmit; + } + + public String getNamedDrivers() { + return namedDrivers; + } + + public void setNamedDrivers(String namedDrivers) { + this.namedDrivers = namedDrivers; + } + + public String getRequirement() { + return requirement; + } + + public void setRequirement(String requirement) { + this.requirement = requirement; + } + + public int getVehicleLength() { + return vehicleLength; + } + + public void setVehicleLength(int vehicleLength) { + this.vehicleLength = vehicleLength; + } + + public int getVehicleType() { + return vehicleType; + } + + public void setVehicleType(int vehicleType) { + this.vehicleType = vehicleType; + } + } + + public static class PutTableDataDTO { + private String businessCode; + private String businessName; + private String detailAddress; + private List goods; + private List loadingAddress; + private String loadingDeadline; + private String loadingName; + private String loadingPhone; + private String companyName; + private String companyCode; + private int sort; + + public String getCompanyName() { + return companyName; + } + + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + public String getCompanyCode() { + return companyCode; + } + + public void setCompanyCode(String companyCode) { + this.companyCode = companyCode; + } + + public String getBusinessCode() { + return businessCode; + } + + public void setBusinessCode(String businessCode) { + this.businessCode = businessCode; + } + + public String getBusinessName() { + return businessName; + } + + public void setBusinessName(String businessName) { + this.businessName = businessName; + } + + public String getDetailAddress() { + return detailAddress; + } + + public void setDetailAddress(String detailAddress) { + this.detailAddress = detailAddress; + } + + public List getGoods() { + return goods; + } + + public void setGoods(List goods) { + this.goods = goods; + } + + public List getLoadingAddress() { + return loadingAddress; + } + + public void setLoadingAddress(List loadingAddress) { + this.loadingAddress = loadingAddress; + } + + public String getLoadingDeadline() { + return loadingDeadline; + } + + public void setLoadingDeadline(String loadingDeadline) { + this.loadingDeadline = loadingDeadline; + } + + public String getLoadingName() { + return loadingName; + } + + public void setLoadingName(String loadingName) { + this.loadingName = loadingName; + } + + public String getLoadingPhone() { + return loadingPhone; + } + + public void setLoadingPhone(String loadingPhone) { + this.loadingPhone = loadingPhone; + } + + public int getSort() { + return sort; + } + + public void setSort(int sort) { + this.sort = sort; + } + + public static class GoodsDTO { + private String name; + private String num; + private String packName; + private int price; + private String unit; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNum() { + return num; + } + + public void setNum(String num) { + this.num = num; + } + + public String getPackName() { + return packName; + } + + public void setPackName(String packName) { + this.packName = packName; + } + + public int getPrice() { + return price; + } + + public void setPrice(int price) { + this.price = price; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + } + } + + public static class SendTableDataDTO { + private String businessCode; + private String businessName; + private String detailAddress; + private List goods; + private List loadingAddress; + private String loadingDeadline; + private String loadingName; + private String loadingPhone; + private String companyName; + private String companyCode; + private int sort; + private double totalPrice; + + public String getCompanyName() { + return companyName; + } + + public void setCompanyName(String companyName) { + this.companyName = companyName; + } + + public String getCompanyCode() { + return companyCode; + } + + public void setCompanyCode(String companyCode) { + this.companyCode = companyCode; + } + + public String getBusinessCode() { + return businessCode; + } + + public void setBusinessCode(String businessCode) { + this.businessCode = businessCode; + } + + public String getBusinessName() { + return businessName; + } + + public void setBusinessName(String businessName) { + this.businessName = businessName; + } + + public String getDetailAddress() { + return detailAddress; + } + + public void setDetailAddress(String detailAddress) { + this.detailAddress = detailAddress; + } + + public List getGoods() { + return goods; + } + + public void setGoods(List goods) { + this.goods = goods; + } + + public List getLoadingAddress() { + return loadingAddress; + } + + public void setLoadingAddress(List loadingAddress) { + this.loadingAddress = loadingAddress; + } + + public String getLoadingDeadline() { + return loadingDeadline; + } + + public void setLoadingDeadline(String loadingDeadline) { + this.loadingDeadline = loadingDeadline; + } + + public String getLoadingName() { + return loadingName; + } + + public void setLoadingName(String loadingName) { + this.loadingName = loadingName; + } + + public String getLoadingPhone() { + return loadingPhone; + } + + public void setLoadingPhone(String loadingPhone) { + this.loadingPhone = loadingPhone; + } + + public int getSort() { + return sort; + } + + public void setSort(int sort) { + this.sort = sort; + } + + public double getTotalPrice() { + return totalPrice; + } + + public void setTotalPrice(double totalPrice) { + this.totalPrice = totalPrice; + } + + public static class GoodsDTO { + private String name; + private String num; + private String packName; + private int price; + private String unit; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getNum() { + return num; + } + + public void setNum(String num) { + this.num = num; + } + + public String getPackName() { + return packName; + } + + public void setPackName(String packName) { + this.packName = packName; + } + + public int getPrice() { + return price; + } + + public void setPrice(int price) { + this.price = price; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/request/manager/UrlManager.java b/app/src/main/java/com/oneclouds/cargo/request/manager/UrlManager.java new file mode 100644 index 0000000..8b41516 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/request/manager/UrlManager.java @@ -0,0 +1,587 @@ +package com.oneclouds.cargo.request.manager; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/7 11:34 + * @description:地址管理器 + */ +public class UrlManager { + + //域名地址 + public static final String BASE_URL ="http://app.dahehuoyun.com/api"; + //http://request.one-clouds.com/api + /*--货物小类管理--*/ + + //货物小类添加 + private static final String CATE_ADD="/app/shipper/cate/add"; + //货物小类删除 + private static final String CATE_DELETE="/app/shipper/cate/delete"; + //货物小类修改 + private static final String CATE_UPDATE="/app/shipper/cate/update"; + //货物小类列表 + private static final String CATE_LIST="/app/shipper/cate/list"; + //无分页小类列表 + private static final String CATE_NLIST="/app/shipper/cate/nlist"; + //无分页大类列表 + private static final String CATE_NPLIST="/app/shipper/cate/nplist"; + //安联货物分类 + private static final String CATE_NPLIST_AL="/app/shipper/cate/nplistAl"; + + //搜索车辆 + private static final String CATE_CAR_LIST="/app/shipperCar/shipperCarList"; + + /*--发票管理--*/ + + //可申请发票的订单 + private static final String INVOICE_CAN_APPLY_ORDER="/app/shipper/invoice/canApplyOrder"; + //已申请开票详情 + private static final String INVOICE_DETAILS_BY_ID="/app/shipper/invoice/detailsById"; + //发票申请记录 + private static final String INVOICE_FIND_PAGE="/app/shipper/invoice/findPage"; + //申请发票保存 + private static final String INVOICE_SAVE="/app/shipper/invoice/save"; + //发票抬头信息删除 + private static final String INVOICE_DELETE="/app/shipper/invoice/title/delete"; + //通过id查询发票抬头信息 + private static final String INVOICE_FIND_BY_ID="/app/shipper/invoice/title/findById"; + //查询当前用户最新发票抬头信息 + private static final String INVOICE_FIND_SHIPPER_INVOICE_TITLE="/app/shipper/invoice/title/findShipperInvoiceTitle"; + //发票抬头信息保存 + private static final String INVOICE_TITLE_SAVE="/app/shipper/invoice/title/save"; + + /*--地址管理--*/ + + //地址信息删除 + private static final String ADDRESS_DELETE="/app/shipper/address/delete"; + //地址信息查询 + private static final String ADDRESS_FIND_BY_ID="/app/shipper/address/findById"; + //地址信息列表 + private static final String ADDRESS_FIND_PAGE="/app/shipper/address/findPage"; + //查询登录用户地址信息列表 + private static final String ADDRESS_FIND_PAGE_MY_SELF="/app/shipper/address/findPageMySelf"; + //地址信息保存 + private static final String ADDRESS_SAVE="/app/shipper/address/save"; + private static final String COMPANY_SAVE="/app/shipper/auth/companyInfo"; + + /*--货主认证--*/ + + //货主认证信息查看 + private static final String AUTH_INFO="/app/shipper/auth/authInfo"; + //货主企业公司信息认证保存 + private static final String AUTH_ENTER_PRISE_AUTH_COMPANY="/app/shipper/auth/enterpriseAuthCompanyNew"; + //货主企业法人信息保存 + private static final String AUTH_ENTER_PRISE_AUTH_CORPORATION="/app/shipper/auth/enterpriseAuthCorporationNew"; + //货主企业认证保存 + private static final String AUTH_ENTER_PRISE_AUTH_SAVE="/app/shipper/auth/enterpriseAuthSave"; + //货主企业委托授权书信息保存 + private static final String AUTH_ENTER_PRISE_AUTH_WARRANT="/app/shipper/auth/enterpriseAuthWarrant"; + //货主信息是否已认证 + private static final String AUTH_IS_AUTH="/app/shipper/auth/isAuth"; + //货主个人认证保存 + private static final String AUTH_PERSON_AUTH_SAVE="/app/shipper/auth/personAuthSave"; + //党员认证保存 + private static final String AUTH_PARTY_MEMBER="/app/user/partyMember"; + + /*--货主运单管理--*/ + + //投诉信息保存 + private static final String WAYBILL_COMPLAINT_V3="/app/shipper/waybill/complaintV3"; + //确认装货 + private static final String WAYBILL_CONFIRM_LOADING="/app/shipper/waybill/confirmLoading"; + //确认卸货 + private static final String WAYBILL_CONFIRM_UNLOAD="/app/shipper/waybill/confirmUnload"; + //评价信息保存 + private static final String WAYBILL_EVALUATION_V3="/app/shipper/waybill/evaluationV3"; + //运单详情 + private static final String WAYBILL_GET_EXECUTE_WATBILL="/app/shipper/waybill/getExecuteWaybill"; + //获取双轨迹 + private static final String WAYBILL_GET_LOC="/app/shipper/waybill/getLoc"; + //货源详情 + private static final String WAYBILL_GET_ORDER_DETAIL="/app/shipper/waybill/getOrderDetail"; + //获取评价信息 + private static final String WAYBILL_LIST_APPAISES="/app/shipper/waybill/listAppraises"; + //获取投诉信息 + private static final String WAYBILL_LIST_COMPLAINT="/app/shipper/waybill/listComplaint"; + //货源列表 + private static final String WAYBILL_LIST_V2="/app/shipper/waybill/listV2"; + //运单列表数量 + private static final String WAYBILL_LIST_NUM="/app/shipper/waybill/listnum"; + + /*--货物管理--*/ + + //货物添加 + private static final String GOODS_ADD="/app/shipper/goods/add"; + //货物删除 + private static final String GOODS_DELETE="/app/shipper/goods/delete"; + //货物列表 + private static final String GOODS_LIST="/app/shipper/goods/list"; + //货物修改 + private static final String GOODS_UPDATE="/app/shipper/goods/update"; + + /*--货物计量单位管理--*/ + + //货物计量单位添加 + private static final String UNIT_ADD="/app/shipper/goods/add"; + //货物计量单位删除 + private static final String UNIT_DELETE="/app/shipper/unit/delete"; + //货物计量单位列表 + private static final String UNIT_LIST="/app/shipper/unit/list"; + //无分页货物单位列表 + private static final String UNIT_NLIST="/app/shipper/unit/nlist"; + //货物计量单位修改 + private static final String UNIT_UPDATE="/app/shipper/unit/update"; + + /*--货源管理--*/ + + //车型车长 + private static final String ORDER_CAR_TYPE_AND_CAR_LONG="/app/shipper/order/CarTypeAndCarLong"; + //业务类型 + private static final String ORDER_BUSINESS_TYPE_LIST="/app/shipper/order/businessTypeList"; + //业务类型交通厅 + private static final String ORDER_BUSINESS_TYPE_LIST_JTT="/app/shipper/order/nplist"; + //业务类型安联 + private static final String ORDER_BUSINESS_TYPE_LIST_AL="/app/shipper/order/nplistAl"; + //运单轨迹 + private static final String ORDER_FIND_LOCUS_LIST="/app/shipper/order/findLocusList"; + //货源列表 + private static final String ORDER_FIND_ORDER_LIST="/app/shipper/order/findOrderList"; + //货源删除 + private static final String ORDER_DEL="/app/shipper/order/orderDel"; + //货源撤销 + private static final String ORDER_REVOKE="/app/shipper/order/orderRevoke"; + //货源查询状态列表 + private static final String ORDER_STATELIST="/app/shipper/order/orderStateList"; + //包装方式 + private static final String ORDER_PACK_NAME_LIST="/app/shipper/order/packNameList"; + //货源保存/提交 + private static final String ORDER_PULIST_ORDER="/app/shipper/order/publishOrder"; + + /*--货主评价管理--*/ + + //评价信息查询 + private static final String SA_FIND_BY_ID="/app/shipperAppraises/findById"; + //查询登录用户评价信息数量 + private static final String SA_FIND_CURRENT_USER_APPRAISES_COUNT="/app/shipperAppraises/findCurrentUserAppraisesCount"; + //评价信息列表 + private static final String SA_FIND_PAGE="/app/shipperAppraises/findPage"; + + /*--司机管理--*/ + + //发布货源-选择司机 + private static final String DRIVER_CHOOSE="/app/shipper/driver/chooseDriver"; + //发布货源-选择司机 + private static final String DRIVER_CHOOSE_V2="/app/shipper/driver/chooseDriverV2"; + + /*--OCR识别--*/ + + //银行卡 + private static final String OCR_BANK="/common/ocr/bank"; + //营业执照 + private static final String OCR_BUSINESS_LICENSE="/common/ocr/businessLicense"; + //身份证正面 + private static final String OCR_ID_CARD_FRONT="/common/ocr/idCardFront"; + //身份证识别反面 + private static final String OCR_ID_CARD_BACK="/common/ocr/idCardBack"; + + /*--公共接口--*/ + + //获取验证码 + private static final String SEND_CODE = "/common/sendcode"; + //忘记密码 + private static final String FORGETPWD = "/common/forgetPwd"; + //账户登录 + private static final String LOGIN="/common/register"; + private static final String LOGIN2="/common/login"; + //账户信息 + private static final String USER_INFO="/app/user/getUserInfo"; + //银行卡列表 + private static final String BANK_CARD_LIST="/app/bankCard/findPage"; + //绑定银行卡 + private static final String BANK_CARD_ADD="/app/bankCard/save"; + //删除银行卡 + private static final String BANK_CARD_DELETE="/app/bankCard/deleteCard"; + //账户提现 + private static final String BANK_CASH_APPLY="/app/account/cashApply/bank"; + //生成电子账户 + private static final String CONTRACTS_ADD="/app/bank/addContracts"; + //获取电子账户 + private static final String CONTRACTS_GET="/app/bank/getContracts"; + //获取账户未读消息 + private static final String MESSAGE_FIND_NOT_READ_COUNT="/app/message/findCurrentUserNotReadCount"; + //获取账户消息 + private static final String MESSAGE_FIND_PAGE="/app/message/findPage"; + //已读消息 + private static final String MESSAGE_SET_READ_BY_ID="/app/message/setReadById"; + //已读全部消息 + private static final String MESSAGE_SET_READ_ALL="/app/message/setReadAll"; + //上传文件 + private static final String UPLOAD="/common/resource/upload"; + //上传头像 + private static final String UPLOAD_HEAD="/app/user/uploadHeadportrait"; + //版本更新 + public static String VERSION ="/app/check/version"; + //配置项信息 + public static String CONFIG ="/common/config/list"; + + //获取大屏的url + public static String GET_URL ="/app/shipper/data/url"; + + public static String getBaseUrl() { + return BASE_URL; + } + + public static String getCateAdd() { + return BASE_URL+CATE_ADD; + } + + public static String getCateDelete() { + return BASE_URL+CATE_DELETE; + } + + public static String getCateUpdate() { + return BASE_URL+CATE_UPDATE; + } + + public static String getCateList() { + return BASE_URL+CATE_LIST; + } + + public static String getCateNlist() { + return BASE_URL+CATE_NLIST; + } + + public static String getCateNplist() { + return BASE_URL+CATE_NPLIST; + } + + public static String getCateNplistAl() { + return BASE_URL+CATE_NPLIST_AL; + } + public static String getCarList() { + return BASE_URL+CATE_CAR_LIST; + } + + + public static String getInvoiceCanApplyOrder() { + return BASE_URL+INVOICE_CAN_APPLY_ORDER; + } + + public static String getInvoiceDetailsById() { + return BASE_URL+INVOICE_DETAILS_BY_ID; + } + + public static String getInvoiceFindPage() { + return BASE_URL+INVOICE_FIND_PAGE; + } + + public static String getInvoiceSave() { + return BASE_URL+INVOICE_SAVE; + } + + public static String getInvoiceDelete() { + return BASE_URL+INVOICE_DELETE; + } + + public static String getInvoiceFindById() { + return BASE_URL+INVOICE_FIND_BY_ID; + } + + public static String getInvoiceFindShipperInvoiceTitle() { + return BASE_URL+INVOICE_FIND_SHIPPER_INVOICE_TITLE; + } + + public static String getInvoiceTitleSave() { + return BASE_URL+INVOICE_TITLE_SAVE; + } + + public static String getAddressDelete() { + return BASE_URL+ADDRESS_DELETE; + } + + public static String getAddressFindById() { + return BASE_URL+ADDRESS_FIND_BY_ID; + } + + public static String getAddressFindPage() { + return BASE_URL+ADDRESS_FIND_PAGE; + } + + public static String getAddressFindPageMySelf() { + return BASE_URL+ADDRESS_FIND_PAGE_MY_SELF; + } + + public static String getAddressSave() { + return BASE_URL+ADDRESS_SAVE; + } + + public static String getCompanyInfo() { + return BASE_URL+COMPANY_SAVE; + } + + public static String getAuthInfo() { + return BASE_URL+AUTH_INFO; + } + + public static String getAuthEnterPriseAuthCompany() { + return BASE_URL+AUTH_ENTER_PRISE_AUTH_COMPANY; + } + + public static String getAuthEnterPriseAuthCorporation() { + return BASE_URL+AUTH_ENTER_PRISE_AUTH_CORPORATION; + } + + public static String getAuthEnterPriseAuthSave() { + return BASE_URL+AUTH_ENTER_PRISE_AUTH_SAVE; + } + + public static String getAuthEnterPriseAuthWarrant() { + return BASE_URL+AUTH_ENTER_PRISE_AUTH_WARRANT; + } + + public static String getAuthIsAuth() { + return BASE_URL+AUTH_IS_AUTH; + } + + public static String getAuthPersonAuthSave() { + return BASE_URL+AUTH_PERSON_AUTH_SAVE; + } + + public static String getWaybillComplaintV3() { + return BASE_URL+WAYBILL_COMPLAINT_V3; + } + + public static String getWaybillConfirmLoading() { + return BASE_URL+WAYBILL_CONFIRM_LOADING; + } + + public static String getWaybillConfirmUnload() { + return BASE_URL+WAYBILL_CONFIRM_UNLOAD; + } + + public static String getWaybillEvaluationV3() { + return BASE_URL+WAYBILL_EVALUATION_V3; + } + + public static String getWaybillGetExecuteWatbill() { + return BASE_URL+WAYBILL_GET_EXECUTE_WATBILL; + } + + public static String getWaybillGetLoc() { + return BASE_URL+WAYBILL_GET_LOC; + } + + public static String getWaybillGetOrderDetail() { + return BASE_URL+WAYBILL_GET_ORDER_DETAIL; + } + + public static String getWaybillListAppaises() { + return BASE_URL+WAYBILL_LIST_APPAISES; + } + + public static String getWaybillListComplaint() { + return BASE_URL+WAYBILL_LIST_COMPLAINT; + } + + public static String getWaybillListV2() { + return BASE_URL+WAYBILL_LIST_V2; + } + + public static String getWaybillListNum() { + return BASE_URL+WAYBILL_LIST_NUM; + } + + public static String getGoodsAdd() { + return BASE_URL+GOODS_ADD; + } + + public static String getGoodsDelete() { + return BASE_URL+GOODS_DELETE; + } + + public static String getGoodsList() { + return BASE_URL+GOODS_LIST; + } + + public static String getGoodsUpdate() { + return BASE_URL+GOODS_UPDATE; + } + + public static String getUnitAdd() { + return BASE_URL+UNIT_ADD; + } + + public static String getUnitDelete() { + return BASE_URL+UNIT_DELETE; + } + + public static String getUnitList() { + return BASE_URL+UNIT_LIST; + } + + public static String getUnitNlist() { + return BASE_URL+UNIT_NLIST; + } + + public static String getUnitUpdate() { + return BASE_URL+UNIT_UPDATE; + } + + public static String getOrderCarTypeAndCarLong() { + return BASE_URL+ORDER_CAR_TYPE_AND_CAR_LONG; + } + + public static String getOrderBusinessTypeList() { + return BASE_URL+ORDER_BUSINESS_TYPE_LIST; + } + + public static String getOrderBusinessTypeListJtt() { + return BASE_URL+ORDER_BUSINESS_TYPE_LIST_JTT; + } + + public static String getOrderBusinessTypeListAl() { + return BASE_URL+ORDER_BUSINESS_TYPE_LIST_AL; + } + + public static String getOrderFindLocusList() { + return BASE_URL+ORDER_FIND_LOCUS_LIST; + } + + public static String getOrderFindOrderList() { + return BASE_URL+ORDER_FIND_ORDER_LIST; + } + + public static String getOrderDel() { + return BASE_URL+ORDER_DEL; + } + + public static String getOrderRevoke() { + return BASE_URL+ORDER_REVOKE; + } + + public static String getOrderStatelist() { + return BASE_URL+ORDER_STATELIST; + } + + public static String getOrderPackNameList() { + return BASE_URL+ORDER_PACK_NAME_LIST; + } + + public static String getOrderPulistOrder() { + return BASE_URL+ORDER_PULIST_ORDER; + } + + public static String getSaFindById() { + return BASE_URL+SA_FIND_BY_ID; + } + + public static String getSaFindCurrentUserAppraisesCount() { + return BASE_URL+SA_FIND_CURRENT_USER_APPRAISES_COUNT; + } + + public static String getSaFindPage() { + return BASE_URL+SA_FIND_PAGE; + } + + public static String getDriverChoose() { + return BASE_URL+DRIVER_CHOOSE; + } + + public static String getDriverChooseV2() { + return BASE_URL+DRIVER_CHOOSE_V2; + } + + public static String getOcrBank() { + return BASE_URL+OCR_BANK; + } + + public static String getOcrBusinessLicense() { + return BASE_URL+OCR_BUSINESS_LICENSE; + } + + public static String getOcrIdCardFront() { + return BASE_URL+OCR_ID_CARD_FRONT; + } + + public static String getOcrIdCardBack() { + return BASE_URL+OCR_ID_CARD_BACK; + } + + public static String getSendCode() { + return BASE_URL+SEND_CODE; + } + + public static String forgetPwd() { + return BASE_URL+FORGETPWD; + } + + public static String getLOGIN() { return BASE_URL+LOGIN; } + public static String getLOGIN2() { return BASE_URL+LOGIN2; } + + public static String getUserInfo() { return BASE_URL+USER_INFO; } + + public static String getBankCardList() { + return BASE_URL+BANK_CARD_LIST; + } + + public static String getBankCardAdd() { + return BASE_URL+BANK_CARD_ADD; + } + + public static String getBankCardDelete() { + return BASE_URL+BANK_CARD_DELETE; + } + + public static String getBankCashApply() { + return BASE_URL+BANK_CASH_APPLY; + } + + public static String getContractsAdd() { + return BASE_URL+CONTRACTS_ADD; + } + + public static String getContractsGet() { + return BASE_URL+CONTRACTS_GET; + } + + public static String getMessageFindNotReadCount() { + return BASE_URL+MESSAGE_FIND_NOT_READ_COUNT; + } + + public static String getMessageFindPage() { + return BASE_URL+MESSAGE_FIND_PAGE; + } + + public static String getMessageSetReadById() { + return BASE_URL+MESSAGE_SET_READ_BY_ID; + } + + public static String getMessageSetReadAll() { + return BASE_URL+MESSAGE_SET_READ_ALL; + } + + public static String getUPLOAD() { + return BASE_URL+UPLOAD; + } + + public static String getUploadHead() { + return BASE_URL+UPLOAD_HEAD; + } + + public static String getVERSION() { + return BASE_URL+VERSION; + } + + public static String getCONFIG() { + return BASE_URL+CONFIG; + } + + public static String getAuthPartyMember() { + return BASE_URL+AUTH_PARTY_MEMBER; + } + + public static String getGetUrl() { + return BASE_URL+GET_URL; + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/AgreementAlert.java b/app/src/main/java/com/oneclouds/cargo/ui/AgreementAlert.java new file mode 100644 index 0000000..197dd96 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/AgreementAlert.java @@ -0,0 +1,117 @@ +package com.oneclouds.cargo.ui; + +import android.content.Context; +import android.content.Intent; +import android.os.Handler; +import android.text.SpannableStringBuilder; +import android.text.TextPaint; +import android.text.method.LinkMovementMethod; +import android.text.style.ClickableSpan; +import android.view.Gravity; +import android.view.View; +import android.widget.Button; +import android.widget.TextView; + +import androidx.annotation.NonNull; + +import com.google.gson.Gson; +import com.lxj.xpopup.core.CenterPopupView; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.util.MsgUtil; +import com.oneclouds.cargo.util.SPUtil; + +import org.greenrobot.eventbus.EventBus; +import org.jetbrains.annotations.NotNull; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/10/13 10:30 + * @description: + */ +public class AgreementAlert extends CenterPopupView { + + private String url; + private String url2; + private Handler hd; + private Context con; + + public AgreementAlert(@NonNull @NotNull Context context,String url,String url2,Handler hd) { + super(context); + this.url=url; + this.url2=url2; + this.hd=hd; + this.con=context; + } + + @Override + protected int getImplLayoutId() { + return R.layout.alert_ok_cancel; + } + // 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑 + @Override + protected void onCreate() { + super.onCreate(); + TextView tv_title=findViewById(R.id.tv_title); + TextView tv_content=findViewById(R.id.tv_content); + Button tv_cancel=findViewById(R.id.tv_cancel); + Button tv_confirm=findViewById(R.id.tv_confirm); + tv_content.setGravity(Gravity.LEFT); + tv_confirm.setText("同意"); + tv_cancel.setText("暂不使用"); + tv_title.setText("用户服务协议和隐私政策"); + String str = "请你务必审慎阅读、充分理解此内容中的“用户服务协议和隐私政策”各条款、包括但不限于:为了向你提供身份认证、接单、运单查询、消息推送等服务我们需要收集你的设备信息、操作日志等个人信息。" + + "\n你可阅读《用户服务协议》和《隐私政策》了解详细信息。如果你同意,请点击“同意”开始接受我们的服务。"; + SpannableStringBuilder ssb = new SpannableStringBuilder(); + ssb.append(str); + //第一个出现的位置 + final int start = str.indexOf("《"); + ssb.setSpan(new ClickableSpan() { + @Override + public void onClick(View widget) { + //用户服务协议点击事件 + Intent in=new Intent(getContext(), WebActivity.class); + in.putExtra("url",url2); + in.putExtra("title","用户服务协议"); + getContext().startActivity(in); + } + @Override + public void updateDrawState(TextPaint ds) { + super.updateDrawState(ds); + //设置文件颜色 + ds.setColor(getResources().getColor(R.color.color_theme,null)); + // 去掉下划线 + ds.setUnderlineText(false); + } + }, start, start + 8, 0); + final int end = str.lastIndexOf("《"); + ssb.setSpan(new ClickableSpan() { + @Override + public void onClick(View widget) { + //用户服务协议点击事件 + Intent in=new Intent(getContext(), WebActivity.class); + in.putExtra("url",url); + in.putExtra("title","隐私政策"); + getContext().startActivity(in); + } + @Override + public void updateDrawState(TextPaint ds) { + super.updateDrawState(ds); + //设置文件颜色 + ds.setColor(getResources().getColor(R.color.color_theme,null)); + // 去掉下划线 + ds.setUnderlineText(false); + } + }, end, end + 6, 0); + tv_content.setMovementMethod(LinkMovementMethod.getInstance()); + tv_content.setText(ssb, TextView.BufferType.SPANNABLE); + tv_cancel.setOnClickListener(v -> { + System.exit(1); + }); + tv_confirm.setOnClickListener(v -> { + SPUtil.insSP(con,"data","firstKey","1"); + dismiss(); + MsgUtil.addHdMsgWat(hd,13); + }); + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/App.java b/app/src/main/java/com/oneclouds/cargo/ui/App.java new file mode 100644 index 0000000..da034ac --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/App.java @@ -0,0 +1,59 @@ +package com.oneclouds.cargo.ui; + +import android.app.Application; +import android.content.Context; +import android.content.pm.ApplicationInfo; + +import com.oneclouds.cargo.util.SPUtil; +import com.umeng.commonsdk.UMConfigure; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/23 0:18 + * @description: + */ +public class App extends Application { + + + private Context con; + @Override + public void onCreate() { + super.onCreate(); + //设置非debug版本开启友盟 + con=getBaseContext(); + String state= SPUtil.getSP(con,"state_data","authorization_state"); + if("1".equals(state)){ + if(!isDebugVersion(getApplicationContext())){ + youmenginit(); + } + } + //youmenginit(); + } + + public void youmenginit(){ + //设置LOG开关,默认为false + UMConfigure.setLogEnabled(true); + //友盟预初始化 + UMConfigure.preInit(getApplicationContext(),"60fbfeabff4d74541c81e01b","Umeng"); + /** + * 打开app首次隐私协议授权,以及sdk初始化,判断逻辑请查看SplashTestActivity + */ + //判断是否同意隐私协议,uminit为1时为已经同意,直接初始化umsdk + // if(SPUtil.getSP(getAppContext(),"umeng","uminit").equals("1")){ + //友盟正式初始化 + UMConfigure.init(getApplicationContext(),UMConfigure.DEVICE_TYPE_PHONE,""); + // } + } + + private static boolean isDebugVersion(Context context) { + try { + ApplicationInfo info = context.getApplicationInfo(); + return (info.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0; + } catch (Exception e) { + e.printStackTrace(); + } + return false; + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/ForgetPwdActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/ForgetPwdActivity.java new file mode 100644 index 0000000..320bf8f --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/ForgetPwdActivity.java @@ -0,0 +1,137 @@ +package com.oneclouds.cargo.ui; + +import android.os.Bundle; +import android.os.Message; +import android.text.TextUtils; +import android.util.Log; +import android.widget.Button; +import android.widget.EditText; +import android.widget.TextView; + +import androidx.annotation.Nullable; + +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.request.PublicRequest; +import com.oneclouds.cargo.request.bean.LoginRegInputBean; +import com.oneclouds.cargo.util.PhoneFormatCheckUtils; +import com.oneclouds.cargo.util.ToastUtil; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.http.RequsetCodeConstants; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseActivity; + +/** + * @ClassName ForgetPwdActivity + * @Author 用户 + * @Date 2022/5/17 10:03 + * @Description TODO + */ +public class ForgetPwdActivity extends BaseActivity { + + private TextView title, tvCode; + private EditText etCode, etPass, etPhone; + private Button btnOk; + + + boolean code_key = true; + private int timer_sum = 60; + private PublicRequest pr; + + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what) { + case 12: + tvCode.setText(timer_sum + "s"); + if (timer_sum <= 0) { + tvCode.setText("获取验证码"); + timer_sum = 60; + code_key = true; + } + break; + case RequsetCodeConstants.SUCCESS: + if (CacheGroup.cacheList.get(PublicRequest.SEND_CODE) != null) { + Log.e("--短信发送res--", "短信发送成功"); + CacheGroup.cacheList.remove(PublicRequest.SEND_CODE); + } + if (CacheGroup.cacheList.get(PublicRequest.FORGETPWD) != null) { + Log.e("--短信发送res--", "短信发送成功"); + ToastUtil.show(con,"修改密码成功,请重新登录"); + finish(); + CacheGroup.cacheList.remove(PublicRequest.FORGETPWD); + } + break; + + } + } + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_forget_pwd); + con = this; + act = this; + initView(null); + findViewById(); + + pr = new PublicRequest(con, hd); + } + + private void findViewById() { + title = findViewById(R.id.title_view); + etPhone = findViewById(R.id.etPhone); + tvCode = findViewById(R.id.tvCode); + etPass = findViewById(R.id.etPass); + etCode = findViewById(R.id.etCode); + btnOk = findViewById(R.id.btnOk); + + title.setText("忘记密码"); + + tvCode.setOnClickListener(v -> { + String phone = etPhone.getText().toString(); + if (TextUtils.isEmpty(phone) || !PhoneFormatCheckUtils.isChinaPhoneLegal(phone)) { + ToastUtil.show(con, "请输入正确手机号码"); + return; + } + getCd(); + pr.getPhoneCode(phone); + }); + btnOk.setOnClickListener(v -> { + String phone = etPhone.getText().toString(); + String code = etCode.getText().toString(); + String pwd = etPass.getText().toString(); + + if (TextUtils.isEmpty(phone)||TextUtils.isEmpty(code)||TextUtils.isEmpty(pwd)){ + ToastUtil.show(con,"请完善信息"); + return; + } + +// LoginRegInputBean lb = new LoginRegInputBean(); +// lb.setRoleId(2); +// lb.setUname(phone); +// lb.setSmscode(code); + pr.forgetPwd(phone,code,pwd); + }); + } + + public void getCd() { + new Thread() { + @Override + public void run() { + while (timer_sum > 0) { + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + timer_sum--; + Message msg = new Message(); + msg.what = 12; + hd.sendMessage(msg); + } + interrupt(); + } + }.start(); + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/LoginActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/LoginActivity.java new file mode 100644 index 0000000..93d8740 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/LoginActivity.java @@ -0,0 +1,267 @@ +package com.oneclouds.cargo.ui; + +import android.content.Intent; +import android.graphics.Color; +import android.os.Bundle; +import android.os.Message; +import android.text.SpannableStringBuilder; +import android.text.TextPaint; +import android.text.method.LinkMovementMethod; +import android.text.style.ClickableSpan; +import android.util.Log; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ImageButton; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.cardview.widget.CardView; + +import com.google.gson.Gson; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.ConfigBean; +import com.oneclouds.cargo.bean.LoginBean; +import com.oneclouds.cargo.constant.SPConstant; +import com.oneclouds.cargo.request.PublicRequest; +import com.oneclouds.cargo.request.bean.LoginRegInputBean; +import com.oneclouds.cargo.ui.parts.ConfigParts; +import com.oneclouds.cargo.util.SPUtil; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.http.RequsetCodeConstants; +import com.oneclouds.cargo.util.titleutil.StatusBarUtil; +import com.oneclouds.cargo.util.view.BaseActivity; + +import java.util.TimerTask; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/13 10:35 + * @description: + */ +public class LoginActivity extends BaseActivity { + public static final String CODE_RESULT = "code_result"; + public static final String LOGIN_RESULT = "login_result"; + public static final String USER = "user"; + public static final String USER_TOKEN = "token"; + public static final String USER_UNAME = "uname"; + public static final String USER_RNAME = "rname"; + public static final String USER_ID = "id"; + + private Button btn_login; + private TextView auto_login; + private EditText input_phone, input_code; + private TextView getCode, tvForget; + private LoginBean loginBean; + private TimerTask tt; + private int timer_sum = 60; + private ImageButton agree_btn; + private CardView no_btn; + + private PublicRequest pr; + + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what) { + case 12: + getCode.setText(timer_sum + "s"); + if (timer_sum <= 0) { + getCode.setText("获取验证码"); + timer_sum = 60; + code_key = true; + } + break; + case RequsetCodeConstants.SUCCESS: + if (CacheGroup.cacheList.get(PublicRequest.SEND_CODE) != null) { + Log.e("--短信发送res--", "短信发送成功"); + } + if (CacheGroup.cacheList.get(PublicRequest.LOGIN) != null) { + //存储登录记录 + loginBean = new Gson().fromJson(CacheGroup.cacheList.get(PublicRequest.LOGIN), LoginBean.class); + Log.e("--登录信息--", new Gson().toJson(loginBean)); + if (loginBean.getCode() == 200) { + SPUtil.insSP(con, SPConstant.DATA, SPConstant.DATA_TOKEN, loginBean.getData().getToken()); + SPUtil.insSP(con, USER, USER_UNAME, loginBean.getData().getUname()); + SPUtil.insSP(con, USER, USER_RNAME, loginBean.getData().getRname()); + SPUtil.insSP(con, USER, USER_ID, loginBean.getData().getId() + ""); + finish(); + } else { + Toast.makeText(con, loginBean.getMsg(), Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(PublicRequest.LOGIN); + } + break; + default: + break; + } + } + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StatusBarUtil.touming(getWindow()); + setContentView(R.layout.activity_login); + con = this; + btn_login = findViewById(R.id.btn_login); + auto_login = findViewById(R.id.auto_login); + input_phone = findViewById(R.id.input_phone); + input_code = findViewById(R.id.input_code); + getCode = findViewById(R.id.getCode); + tvForget = findViewById(R.id.tvForget); + agree_btn = findViewById(R.id.agree_btn); + no_btn = findViewById(R.id.no_btn); + pr = new PublicRequest(con, hd); + initView(null); + } + + boolean key = false; + boolean code_key = true; + private String url1 = ""; + private String url2 = ""; + + @Override + public void initView(Object obj) { + super.initView(obj); + agree_btn.setOnClickListener(v -> { + agree_btn.setVisibility(View.GONE); + no_btn.setVisibility(View.VISIBLE); + key = false; + }); + no_btn.setOnClickListener(v -> { + agree_btn.setVisibility(View.VISIBLE); + no_btn.setVisibility(View.GONE); + key = true; + + }); + ConfigBean cb = ConfigParts.getConfigParts(con); + if (cb != null) { + url1 = cb.getData().getUserUrl(); + url2 = cb.getData().getShipperPrivateUrl(); + } + TextView tv_content = findViewById(R.id.tv_content); + String str = "我已阅读并同意相关服务条款和隐私政策《用户服务协议》和《隐私政策》"; + SpannableStringBuilder ssb = new SpannableStringBuilder(); + ssb.append(str); + //第一个出现的位置 + final int start = str.indexOf("《"); + ssb.setSpan(new ClickableSpan() { + @Override + public void onClick(View widget) { + //用户服务协议点击事件 + Log.e("用户服务协议0", url1); + Intent in = new Intent(con, WebActivity.class); + in.putExtra("title", "用户服务协议"); + in.putExtra("url", url1); + startActivity(in); + } + + @Override + public void updateDrawState(TextPaint ds) { + super.updateDrawState(ds); + //设置文件颜色 + ds.setColor(getResources().getColor(R.color.color_theme, null)); + // 去掉下划线 + ds.setUnderlineText(false); + } + }, start, start + 8, 0); + final int end = str.lastIndexOf("《"); + ssb.setSpan(new ClickableSpan() { + @Override + public void onClick(View widget) { + //隐私协议点击事件 + Intent in = new Intent(con, WebActivity.class); + in.putExtra("title", "隐私政策"); + in.putExtra("url", url2); + startActivity(in); + } + + @Override + public void updateDrawState(TextPaint ds) { + super.updateDrawState(ds); + //设置文件颜色 + ds.setColor(getResources().getColor(R.color.color_theme, null)); + // 去掉下划线 + ds.setUnderlineText(false); + } + + }, end, end + 6, 0); + tv_content.setMovementMethod(LinkMovementMethod.getInstance()); + tv_content.setText(ssb, TextView.BufferType.SPANNABLE); + getCode.setOnClickListener(v -> { + String phone = String.valueOf(input_phone.getText()); + if (phone.equals("") || phone == null) { + Log.e("点击事件", "请先输入手机号"); + Toast.makeText(con, "请先输入手机号", Toast.LENGTH_SHORT).show(); + } else { + if (code_key) { + getCd(); + pr.getPhoneCode(phone); + code_key = false; + } + } + }); + + tvForget.setOnClickListener(v1 -> { + Intent intent = new Intent(this, ForgetPwdActivity.class); + startActivity(intent); + }); + btn_login.setOnClickListener(v -> { + String phone = String.valueOf(input_phone.getText()); + String code = String.valueOf(input_code.getText()); + Log.e("--code--", code); + if (judgeFormat(phone, code)) { + if (key) { + LoginRegInputBean lb = new LoginRegInputBean(); + lb.setRoleId(2); + lb.setUserName(phone); + lb.setPassword(code); + pr.userLogin2(lb); + +// lb.setRoleId(2); +// lb.setUname(phone); +// lb.setSmscode(code); +// lb.setRegisterType(1); +// pr.userLogin(lb); + } else { + Toast.makeText(con, "请先同意用户协议和隐私政策", Toast.LENGTH_SHORT).show(); + } + } + }); + auto_login.setOnClickListener(v -> { + Toast.makeText(con, "暂未开放", Toast.LENGTH_SHORT).show(); + }); + } + + public void getCd() { + new Thread() { + @Override + public void run() { + while (timer_sum > 0) { + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + timer_sum--; + Message msg = new Message(); + msg.what = 12; + hd.sendMessage(msg); + } + interrupt(); + } + }.start(); + } + + //验证用户输入的是否符合格式 + public boolean judgeFormat(String phone, String code) { + if (phone.equals("") || code.equals("")) { + Toast.makeText(con, "手机号和验证码不得为空", Toast.LENGTH_SHORT).show(); + return false; + } else { + return true; + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/MainActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/MainActivity.java new file mode 100644 index 0000000..2f616c2 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/MainActivity.java @@ -0,0 +1,146 @@ +package com.oneclouds.cargo.ui; + +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.view.KeyEvent; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.fragment.app.Fragment; + +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.constant.SPConstant; +import com.oneclouds.cargo.ui.home.HomeFragment; +import com.oneclouds.cargo.ui.my.MyFragment; +import com.oneclouds.cargo.ui.news.NewsFragment; +import com.oneclouds.cargo.ui.wallet.WalletFragment; +import com.oneclouds.cargo.util.SPUtil; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseAppCompatActivity; +import com.oneclouds.cargo.util.view.BottomTabUtil; + +public class MainActivity extends BaseAppCompatActivity { + + private LinearLayout[] rs=new LinearLayout[4]; + private ImageView[] ibs=new ImageView[4]; + private TextView[] title_view=new TextView[4]; + private int[] img0={R.mipmap.tab1, R.mipmap.tab2, R.mipmap.xiaoxi0, R.mipmap.tab3}; + private int[] img1={R.mipmap.tab1_s, R.mipmap.tab2_s, R.mipmap.xiaoxi1, R.mipmap.tab3_s}; + private Fragment[] fs=new Fragment[4]; + private BottomTabUtil bt; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_main); + con=this; + act=this; + fs[0]=new HomeFragment(); + fs[1]=new WalletFragment(); + fs[2]=new NewsFragment(); + fs[3]=new MyFragment(); + initfindId(); + initswitch(); + } + + //注册组件id + public void initfindId(){ + rs[0]=findViewById(R.id.huoyuan_box); + rs[1]=findViewById(R.id.wallet_box); + rs[2]=findViewById(R.id.news_box); + rs[3]=findViewById(R.id.my_box); + ibs[0]=findViewById(R.id.huoyuan); + ibs[1]=findViewById(R.id.wallet); + ibs[2]=findViewById(R.id.news); + ibs[3]=findViewById(R.id.my); + title_view[0]=findViewById(R.id.title1); + title_view[1]=findViewById(R.id.title2); + title_view[2]=findViewById(R.id.title3); + title_view[3]=findViewById(R.id.title4); + } + + public void initswitch(){ + bt =new BottomTabUtil(this, R.id.body, fs); + bt.selectItem(fs[0]); + rs[0].setOnClickListener(v -> { + switch_image(bt.getIndex(),0); + bt.setDefaultFragment(fs[0]); + bt.setIndex(0); + }); + rs[1].setOnClickListener(v -> { + switch_box(1); + }); + rs[2].setOnClickListener(v -> { + switch_box(2); + }); + rs[3].setOnClickListener(v -> { + switch_box(3); + }); + } + + public void switch_image(int old,int news){ + ibs[old].setImageResource(img0[old]); + ibs[news].setImageResource(img1[news]); + title_view[old].setTextColor(getResources().getColor(R.color.tab_select_no,null)); + title_view[news].setTextColor(getResources().getColor(R.color.tab_select,null)); + } + + public void switch_box(int index){ + if (!isLogin(con)){ + jumpLogin(); + }else{ + switch_image(bt.getIndex(),index); + if (!fs[index].isAdded()) { + bt.hide(fs[bt.getIndex()]); + bt.selectItem(fs[index]); + } else { + bt.setDefaultFragment(fs[index]); + } + bt.setIndex(index); + } + } + + public void jumpLogin(){ + Intent in=new Intent(con,LoginActivity.class); + startActivity(in); + } + + //判断是否登录 + public static boolean isLogin(Context con){ + String token= SPUtil.getSP(con, SPConstant.DATA,SPConstant.DATA_TOKEN); + if(token.equals("")){ + return false; + } + return true; + } + + private boolean isExit = false; + + @Override + public boolean onKeyDown(int keyCode, KeyEvent event) { + if (keyCode == KeyEvent.KEYCODE_BACK) { + exit(); + return false; + } else { + return super.onKeyDown(keyCode, event); + } + } + + public void exit() { + if (!isExit) { + isExit = true; + Toast.makeText(con, "再按一次退出程序", Toast.LENGTH_SHORT).show(); + hd.sendEmptyMessageDelayed(0, 2000); + } else { + Intent intent =new Intent(Intent.ACTION_MAIN); + intent.addCategory(Intent.CATEGORY_HOME); + startActivity(intent); + System.exit(1); + } + } + +} \ No newline at end of file diff --git a/app/src/main/java/com/oneclouds/cargo/ui/RequestCallback.java b/app/src/main/java/com/oneclouds/cargo/ui/RequestCallback.java new file mode 100644 index 0000000..a2c4380 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/RequestCallback.java @@ -0,0 +1,18 @@ +package com.oneclouds.cargo.ui; + +import com.oneclouds.cargo.util.cache.CacheGroup; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/16 15:14 + * @description: + */ +public class RequestCallback { + + public void resCallback(String key){ + if(CacheGroup.cacheList.get(key)!=null){ + + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/UiAuxiliary.java b/app/src/main/java/com/oneclouds/cargo/ui/UiAuxiliary.java new file mode 100644 index 0000000..2e5ed2b --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/UiAuxiliary.java @@ -0,0 +1,43 @@ +package com.oneclouds.cargo.ui; + +import android.content.Context; + +import com.oneclouds.cargo.constant.SPConstant; +import com.oneclouds.cargo.util.SPUtil; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/8/18 8:45 + * @description:ui界面的辅助类 + */ +public class UiAuxiliary { + + public static String getState(int stateCode){ + String state=""; + switch (stateCode){ + case 100001: state="待认证";break; + case 100002: state="审核中";break; + case 100003: state="审核通过";break; + case 100004: state="审核不通过";break; + default:state="未认证";break; + } + return state; + } + + public static boolean isLogin(Context con){ + if (SPUtil.getSP(con,SPConstant.DATA,SPConstant.DATA_TOKEN).equals("")){ + return false; + } + return true; + } + + public static void delLogin(Context con){ + SPUtil.insSP(con,SPConstant.DATA,SPConstant.DATA_TOKEN,""); + SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_UNAME,""); + SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_RNAME,""); + SPUtil.insSP(con,LoginActivity.USER,LoginActivity.USER_ID,""); + SPUtil.insSP(con, SPConstant.DATA,SPConstant.DATA_USER,""); + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/WebActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/WebActivity.java new file mode 100644 index 0000000..3bddb2f --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/WebActivity.java @@ -0,0 +1,199 @@ +package com.oneclouds.cargo.ui; + +import android.content.Context; +import android.content.Intent; +import android.content.pm.PackageManager; +import android.net.Uri; +import android.os.Bundle; +import android.util.Log; +import android.webkit.JavascriptInterface; +import android.webkit.WebResourceRequest; +import android.webkit.WebSettings; +import android.webkit.WebView; +import android.webkit.WebViewClient; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; + +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.UserBean; +import com.oneclouds.cargo.ui.parts.UserParts; +import com.oneclouds.cargo.util.PaxWebChromeClient; +import com.oneclouds.cargo.util.StringUtil; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseActivity; + + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/8/6 16:48 + * @description:访问webview的activity + */ +public class WebActivity extends BaseActivity { + + private String url=""; + private String title=""; + private WebView wv; + private TextView title_tv; + private PaxWebChromeClient chromeClient; + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_web); + con=this; + initHardwareAccelerate(); + wv=findViewById(R.id.wv); + title_tv=findViewById(R.id.title_view); + Intent in=getIntent(); + url=in.getExtras().getString("url"); + title=in.getExtras().getString("title"); + chromeClient = new PaxWebChromeClient(this,null,null); + //RxDeviceTool.getScreenHeights(); + if(title.equals("咨询建议")){ + initOpinion(); + }else{ + initView(null); + } + } + + private void initHardwareAccelerate() { + try { + if (Integer.parseInt(android.os.Build.VERSION.SDK) >= 11) { + getWindow() + .setFlags( + android.view.WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED, + android.view.WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); + } + } catch (Exception e) { + } + } + + @Override + public void initView(Object obj) { + super.initView(obj); + WebSettings webSettings = wv.getSettings(); + //设置网页有缓存的时候也继续读取新的地址 + webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE); + webSettings.setJavaScriptEnabled(true); + webSettings.setDomStorageEnabled(true); + webSettings.setDefaultTextEncodingName("utf-8"); + wv.addJavascriptInterface(new JavaScriptObject(con), "webObj"); + //WebView加载web资源 +// wv.loadUrl(url); + //覆盖WebView默认使用第三方或系统默认浏览器打开网页的行为,使网页用WebView打开 + wv.setWebViewClient(new WebViewClient(){ + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + return super.shouldOverrideUrlLoading(view, request); + } + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + //返回值是true的时候控制去WebView打开,为false调用系统浏览器或第三方浏览器 + Log.d("test","webactivity..url:"+url); + if(!url.startsWith("http")) + { + Log.d("test","非http开头..url:"+url); + Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); + boolean isInstall = getPackageManager().queryIntentActivities(intent, PackageManager.MATCH_DEFAULT_ONLY).size()>0; + Log.d("test","是否安装要跳转的app:"+isInstall); + if(isInstall) + { + startActivity(intent); + finish(); + } + return true; + } + wv.loadUrl(url); + return true; + } + }); + + wv.setWebChromeClient(chromeClient); + wv.loadUrl(url); + title_tv.setText(title); + } + + public void initOpinion(){ + if(findViewById(R.id.return_btn)!=null){ + findViewById(R.id.return_btn).setOnClickListener(v -> { + finish(); + }); + } + title_tv.setText(title); + UserBean ub=UserParts.getUser(con); + wv.getSettings().setJavaScriptEnabled(true); + wv.getSettings().setDomStorageEnabled(true); // 这个要加上 + String openid = ub.getData().getUname(); // 用户的openid + String nickname = StringUtil.isNull(ub.getData().getRname(),"游客"); // 用户的nickname + String headimgurl = StringUtil.isNull(ub.getData().getHeadportraitUrl(),""); // 用户的头像url + + /* 获得 webview url,请注意url单词是product而不是products,products是旧版本的参数,用错地址将不能成功提交 */ + String url = "https://support.qq.com/product/335641"; // 把1221数字换成你的产品ID,否则会不成功 + /* 准备post参数 */ + String postData = "nickname=" + nickname + "&avatar="+ headimgurl + "&openid=" + openid; + wv.postUrl(url, postData.getBytes()); + wv.setWebChromeClient(chromeClient); + wv.setWebViewClient(new WebViewClient(){ + @Override + public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { + return super.shouldOverrideUrlLoading(view, request); + } + + @Override + public boolean shouldOverrideUrlLoading(WebView view, String url) { + //返回值是true的时候控制去WebView打开,为false调用系统浏览器或第三方浏览器 + view.loadUrl(url); + return true; + } + }); + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + + chromeClient.onActivityResult(requestCode,resultCode,data); + + super.onActivityResult(requestCode, resultCode, data); + } + + @Override + protected void onDestroy() { + if(wv!=null){ + wv.destroy(); + } + super.onDestroy(); + } + + public class JavaScriptObject { + + Context mContxt; + + public JavaScriptObject(Context mContxt) { + this.mContxt = mContxt; + + } + + @JavascriptInterface + public void getName(){ + Log.e("eeee-","name"); + Toast.makeText(con, "hello", Toast.LENGTH_SHORT).show(); + } + + @JavascriptInterface + public String getUserToken(){ + Log.e("-token-",UserParts.getUser(con).getData().getToken()); + return UserParts.getUser(con).getData().getToken(); + } + + @JavascriptInterface + public void isSuccess(){ + finish(); + } + + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/WelcomeActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/WelcomeActivity.java new file mode 100644 index 0000000..16a0572 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/WelcomeActivity.java @@ -0,0 +1,249 @@ +package com.oneclouds.cargo.ui; + +import android.Manifest; +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.Intent; +import android.content.pm.ApplicationInfo; +import android.os.Bundle; +import android.os.CountDownTimer; +import android.os.Handler; +import android.os.Message; +import android.util.Log; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.cardview.widget.CardView; +import androidx.core.app.ActivityCompat; + +import com.bumptech.glide.Glide; +import com.google.gson.Gson; +import com.lxj.xpopup.XPopup; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.ConfigBean; +import com.oneclouds.cargo.request.PublicRequest; +import com.oneclouds.cargo.request.manager.UrlManager; +import com.oneclouds.cargo.ui.parts.ConfigParts; +import com.oneclouds.cargo.util.MsgUtil; +import com.oneclouds.cargo.util.SPUtil; +import com.oneclouds.cargo.util.titleutil.StatusBarUtil; +import com.oneclouds.cargo.util.view.BaseAppCompatActivity; +import com.umeng.commonsdk.UMConfigure; + +import org.jetbrains.annotations.NotNull; + +import java.io.IOException; + +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.Headers; +import okhttp3.MediaType; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; + +public class WelcomeActivity extends BaseAppCompatActivity { + + private PublicRequest pr; + private int cd=3; + private TextView cd_view; + private ImageView startImageUrl; + private CardView skip; + private Gson gson=new Gson(); + private boolean key=true; + + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what){ + case 11: + cdWelcome((String) m.obj); + break; + case 13: + init(); + initRequest(); +// initRermission(); + break; + default:break; + } + } + + @SuppressLint("RestrictedApi") + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StatusBarUtil.touming(getWindow()); + setContentView(R.layout.activity_weclome); + cd_view=findViewById(R.id.cd); + startImageUrl=findViewById(R.id.startImageUrl); + skip=findViewById(R.id.skip); + con=this; + act=this; + pr=new PublicRequest(con,hd); + //RxTool + //RxAppTool.getAppSignatureSHA1(); + //TCrashTool.setConfig(TCrashProfile); + cd_view.setOnClickListener(v -> { + if(key){ + key=false; + Intent in = new Intent(con, MainActivity.class); + startActivity(in); + finish(); + } + }); + String str= SPUtil.getSP(con,"data","firstKey"); + if("1".equals(str)){ + initRequest(); +// initRermission(); + }else{ + new XPopup.Builder(con) + .dismissOnBackPressed(false) + .dismissOnTouchOutside(false) + .asCustom(new AgreementAlert(con,"https://agreement.dahehuoyun.com/vivo/#/shipper/private", + "http://agreement.dahehuoyun.com/#/user",hd)) + .show(); + } +// {"code":200,"data":{"contractUrl":"http://agreement.dahehuoyun.com/#/transport", +// "privateUrl":"http://agreement.dahehuoyun.com/#/private", +// "securityUrl":"http://agreement.dahehuoyun.com/#/security", +// "serviceMobile":"18638298513","shipperPrivateUrl": +// "http://agreement.dahehuoyun.com/#/shipper/private", +// "startImageUrl":"","userUrl":"http://agreement.dahehuoyun.com/#/user"}, +// "msg":"","res":0,"success":true} + } + + public void initRermission(){ + String[] permissions= new String[]{ + Manifest.permission.READ_EXTERNAL_STORAGE, + Manifest.permission.WRITE_EXTERNAL_STORAGE, + }; + ActivityCompat.requestPermissions(this, permissions, 101); + } + + @Override + public void onRequestPermissionsResult(int requestCode, @NonNull @NotNull String[] permissions, @NonNull @NotNull int[] grantResults) { + switch (requestCode) { + case 101:{ + initRequest(); + return; + } + } + } + + + public void initRequest(){ + MediaType mediaType = MediaType.parse("application/json"); + RequestBody body = RequestBody.create(mediaType,"{}"); + Headers.Builder hb=new Headers.Builder(); + hb.add("Content-Type","application/json"); + hb.add("Cache-Control","no-cache"); + Request request = new Request.Builder() + .url(UrlManager.getCONFIG()) + .post(body) + .headers(hb.build()) + .build(); + OkHttpClient client = new OkHttpClient().newBuilder() + .build(); + client.newCall(request).enqueue(new Callback() { + @Override + public void onFailure(Call call, IOException e) { + Log.e("error","配置项信息加载失败"+e.toString()); + MsgUtil.addHdMsgWatBody(hd,11,""); + } + + @Override + public void onResponse(Call call, Response response) throws IOException { + if(response.code()==200){ + String body=response.body().string(); +// if (body.startsWith("04")) { +// body= SecurityUtil.decrypt(body); +// } + Log.e("-body-",body); + ConfigBean cb=gson.fromJson(body,ConfigBean.class); + if(cb.getCode()==200){ + ConfigParts.setParts(con,cb); + MsgUtil.addHdMsgWatBody(hd,11,cb.getData().getStartImageUrl()); + }else{ + ConfigParts.setParts(con,null); + } + }else{ + MsgUtil.addHdMsgWatBody(hd,11,""); + } + } + }); + } + + public void cdWelcome(String url){ + if(!url.equals("")){ + Glide.with(con).load(url).into(startImageUrl); + }else{ + Log.e("图片加载失败","获取动态启动页图片为空"); + //Toast.makeText(con,"配置项信息加载失败",Toast.LENGTH_SHORT).show(); + } + cd_view.setVisibility(View.VISIBLE); + new CountDownTimer(3000,1000){ + @Override + public void onTick(long millisUntilFinished) { + cd_view.setText("跳过 "+millisUntilFinished / 1000); + } + + @Override + public void onFinish() { + cd_view.setText("正在进入"); + } + }.start(); + + new Handler().postDelayed(() -> { + if(key){ + key=false; + Intent in = new Intent(con, MainActivity.class); + startActivity(in); + finish(); + } + },cd*1000); + } + + public void init(){ + String state=SPUtil.getSP(con,"state_data","authorization_state"); + if(!"1".equals(state)){ + try{ + if(!isDebugVersion(con)){ + youmenginit(); + } + }catch (Exception e){ + Log.e("-error-","初始化失败sss"); + } + } + SPUtil.insSP(con,"state_data","authorization_state","1"); + } + + public void youmenginit(){ + //设置LOG开关,默认为false + UMConfigure.setLogEnabled(true); + //友盟预初始化 + UMConfigure.preInit(getApplicationContext(),"60fbfeabff4d74541c81e01b","Umeng"); + /** + * 打开app首次隐私协议授权,以及sdk初始化,判断逻辑请查看SplashTestActivity + */ + //判断是否同意隐私协议,uminit为1时为已经同意,直接初始化umsdk + // if(SPUtil.getSP(getAppContext(),"umeng","uminit").equals("1")){ + //友盟正式初始化 + UMConfigure.init(getApplicationContext(),UMConfigure.DEVICE_TYPE_PHONE,""); + //} + } + + private static boolean isDebugVersion(Context context) { + try { + ApplicationInfo info = context.getApplicationInfo(); + return (info.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0; + } catch (Exception e) { + e.printStackTrace(); + } + return false; + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/alert/UpAppAlert.java b/app/src/main/java/com/oneclouds/cargo/ui/alert/UpAppAlert.java new file mode 100644 index 0000000..50199fe --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/alert/UpAppAlert.java @@ -0,0 +1,114 @@ +package com.oneclouds.cargo.ui.alert; + +import android.content.Context; +import android.util.Log; +import android.widget.Button; +import android.widget.ImageButton; +import android.widget.LinearLayout; +import android.widget.ProgressBar; +import android.widget.TextView; + +import androidx.annotation.NonNull; + +import com.king.app.updater.AppUpdater; +import com.king.app.updater.callback.AppUpdateCallback; +import com.lxj.xpopup.core.CenterPopupView; +import com.oneclouds.cargo.R; + +import org.jetbrains.annotations.NotNull; + +import java.io.File; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/6 17:23 + * @description: + */ +public class UpAppAlert extends CenterPopupView { + + private TextView content,vs; + private Button tv_cancel,tv_confirm; + private LinearLayout up_div; + private String url=""; + private String body=""; + private Context con; + private ProgressBar progress_view; + private String version; + private String force; + private LinearLayout force_box; + private ImageButton force_btn; + + public UpAppAlert(@NonNull @NotNull Context context, String url, String body,String version,String force) { + super(context); + con=context; + this.url=url; + this.body=body; + this.version=version; + this.force=force; + } + + @Override + protected int getImplLayoutId() { + return R.layout.alert_up_app; + } + public UpAppAlert(@NonNull @NotNull Context context) { + super(context); + + } + + @Override + protected void onCreate() { + super.onCreate(); + content=findViewById(R.id.tv_content); + tv_cancel=findViewById(R.id.tv_cancel); + tv_confirm=findViewById(R.id.tv_confirm); + up_div=findViewById(R.id.up_div); + progress_view=findViewById(R.id.progress); + content=findViewById(R.id.tv_content); + force_box=findViewById(R.id.force_box); + force_btn=findViewById(R.id.force_btn); + if(force.equals("1")){ + force_box.setVisibility(GONE); + } + force_btn.setOnClickListener(v -> { + setVisibility(GONE); + destroy(); + }); + vs=findViewById(R.id.vs); + content.setText(body); + vs.setText(version); + tv_cancel.setOnClickListener(v -> { + System.exit(1); + }); + tv_confirm.setOnClickListener(v -> { + new AppUpdater.Builder() + .setUrl(url) + .build(con) + .setUpdateCallback(new AppUpdateCallback() { + @Override + public void onStart(String url) { + super.onStart(url); + tv_confirm.setVisibility(GONE); + up_div.setVisibility(VISIBLE); + } + @Override + public void onProgress(long progress, long total, boolean isChange) { + float sum=progress; + float max=total; + if(progress>0){ + float b=sum/max; + Log.e("百分比",(100*b)+""); + progress_view.setProgress((int) (100*b)); + } + } + + @Override + public void onFinish(File file) { + + } + }) + .start(); + }); + } +} \ No newline at end of file diff --git a/app/src/main/java/com/oneclouds/cargo/ui/home/ChoiceAddressActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/home/ChoiceAddressActivity.java new file mode 100644 index 0000000..d19e208 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/home/ChoiceAddressActivity.java @@ -0,0 +1,429 @@ +package com.oneclouds.cargo.ui.home; + +import android.content.Intent; +import android.os.Bundle; +import android.os.Message; +import android.text.Editable; +import android.text.TextUtils; +import android.text.TextWatcher; +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 android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.amap.api.services.core.AMapException; +import com.amap.api.services.geocoder.GeocodeResult; +import com.amap.api.services.geocoder.GeocodeSearch; +import com.amap.api.services.geocoder.RegeocodeQuery; +import com.amap.api.services.geocoder.RegeocodeResult; +import com.amap.api.services.help.Inputtips; +import com.amap.api.services.help.InputtipsQuery; +import com.amap.api.services.help.Tip; +import com.chad.library.adapter.base.BaseQuickAdapter; +import com.chad.library.adapter.base.listener.OnItemClickListener; +import com.github.gzuliyujiang.wheelpicker.AddressPicker; +import com.github.gzuliyujiang.wheelpicker.annotation.AddressMode; +import com.github.gzuliyujiang.wheelpicker.contract.OnAddressPickedListener; +import com.github.gzuliyujiang.wheelpicker.contract.OnLinkageSelectedListener; +import com.github.gzuliyujiang.wheelpicker.entity.CityEntity; +import com.github.gzuliyujiang.wheelpicker.entity.CountyEntity; +import com.github.gzuliyujiang.wheelpicker.entity.ProvinceEntity; +import com.github.gzuliyujiang.wheelpicker.utility.AddressJsonParser; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.lxj.xpopup.XPopup; +import com.lxj.xpopup.core.AttachPopupView; +import com.lxj.xpopup.core.BasePopupView; +import com.lxj.xpopup.util.KeyboardUtils; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.adapter.ChoiceAddressAdapter; +import com.oneclouds.cargo.base.AppConfig; +import com.oneclouds.cargo.bean.AddressListBean; +import com.oneclouds.cargo.bean.BaseBean; +import com.oneclouds.cargo.bean.CompanyInfoBean; +import com.oneclouds.cargo.bean.StateBean; +import com.oneclouds.cargo.event.AddressEvent; +import com.oneclouds.cargo.request.AddressRequest; +import com.oneclouds.cargo.request.bean.AddressInputBean; +import com.oneclouds.cargo.request.bean.OrderInputBean; +import com.oneclouds.cargo.ui.parts.UserParts; +import com.oneclouds.cargo.util.ToastUtil; +import com.oneclouds.cargo.util.bean.GetObjectName; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseActivity; +import com.oneclouds.cargo.weight.CenterPopupView; + +import org.greenrobot.eventbus.EventBus; +import org.greenrobot.eventbus.Subscribe; +import org.jetbrains.annotations.NotNull; + +import java.util.ArrayList; +import java.util.List; + +import static java.security.AccessController.getContext; + +/** + * @ClassName ChoiceAddressActivity + * @Author 用户 + * @Date 2022/5/11 11:53 + * @Description TODO + */ +public class ChoiceAddressActivity extends BaseActivity implements View.OnClickListener, TextWatcher, GeocodeSearch.OnGeocodeSearchListener { + + private int type;//300001:装货 typeCode:卸货 + private TextView title, tvRight, tvAddress, etAddressDetail,tvName2Title; + private EditText etName, etPhone, tvNum,etName2; + private Button btnOk; + private ImageView ivAddress; + private RecyclerView recyclerView; + private GeocodeSearch geocodeSearch; + + private AddressRequest ar; + private ArrayList datas; + private ChoiceAddressAdapter adapter; + private AddressInputBean aib = new AddressInputBean(); + private AddressListBean.DataDTO.RecordsDTO adr; + private Gson gson = new Gson(); + private String str = ""; + private boolean key = false; + private boolean isCheck = false; + + + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what) { + case 200: + if (CacheGroup.cacheList.get(AddressRequest.ADDRESS_SAVE) != null) { + BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(AddressRequest.ADDRESS_SAVE), BaseBean.class); + if (bb.getCode() == 200) { + if (key) { + Toast.makeText(con, "修改成功", Toast.LENGTH_SHORT).show(); + } else { + Toast.makeText(con, "添加成功", Toast.LENGTH_SHORT).show(); + } + finish(); + } else { + tvAddress.setText(""); + aib.setProvinceS(""); + aib.setCityS(""); + aib.setAreaS(""); + Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(AddressRequest.ADDRESS_SAVE); + } + + if (CacheGroup.cacheList.get(AddressRequest.COMPANY_SAVE) != null) { + BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(AddressRequest.COMPANY_SAVE), BaseBean.class); + if (bb.getCode() == 200) { + CompanyInfoBean companyInfoBean = gson.fromJson(gson.toJson(bb.getData()), CompanyInfoBean.class); + etName2.setText(!TextUtils.isEmpty(companyInfoBean.getRealCompanyName())?companyInfoBean.getRealCompanyName():companyInfoBean.getContactName()); + tvNum.setText(!TextUtils.isEmpty(companyInfoBean.getCode())?companyInfoBean.getCode():companyInfoBean.getIdcard()); + } else { + + Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(AddressRequest.COMPANY_SAVE); + } + if (CacheGroup.cacheList.get(AddressRequest.ADDRESS_DELETE) != null) { + BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(AddressRequest.ADDRESS_DELETE), BaseBean.class); + if (bb.getCode() == 200) { + Toast.makeText(con, "删除成功", Toast.LENGTH_SHORT).show(); + finish(); + } else { + Toast.makeText(con, bb.getMsg(), Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(AddressRequest.ADDRESS_DELETE); + } + default: + break; + } + } + + @Override + protected void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_choice_address); + con = this; + ar = new AddressRequest(con, hd); + type = getIntent().getIntExtra("typeCode", 0); + str = getIntent().getExtras().getString("addressData"); + findAndInitView(); + initView(null); + EventBus.getDefault().register(this); + + if (!str.equals("")) { + key = true; + adr = gson.fromJson(str, AddressListBean.DataDTO.RecordsDTO.class); + initAddress(); + }else{//新增获取公司信息 + if (type==300001){ + ar.getComInfo(); + etName2.setEnabled(false); + tvNum.setEnabled(false); + }else{ + etName2.setEnabled(true); + tvNum.setEnabled(true); + } + } + title.setText(str.equals("") ? "新增地址" : "编辑地址"); + tvName2Title.setText(type==300001 ? "托运人" : "公司/个人名称"); + tvRight.setVisibility(str.equals("") ? View.GONE : View.VISIBLE); + tvRight.setText("删除"); + etAddressDetail.addTextChangedListener(this); + } + + + @Override + public void initView(Object obj) { + super.initView(obj); + geocodeSearch = new GeocodeSearch(this); + geocodeSearch.setOnGeocodeSearchListener(this); + } + + + @Override + public void onClick(View v) { + switch (v.getId()) { + case R.id.btnOk: + submint(); + break; + case R.id.tvAddress: + onProvinceCityCounty(tvAddress); + break; + case R.id.ivAddress: + Intent intent = new Intent(con, SearchAddressActivity.class); + startActivityForResult(intent, 0); + break; + } + } + + public void initAddress() { + etName2.setEnabled(false); + tvNum.setEnabled(false); + + aib.setProvince(adr.getProvince()); + aib.setCity(adr.getCity()); + aib.setArea(adr.getArea()); + aib.setAddressDetail(adr.getAddressDetail()); + aib.setContactNumber(adr.getContactNumber()); + aib.setContactPerson(adr.getContactPerson()); + aib.setId(adr.getId()); + aib.setCompanyName(adr.getCompanyName()); + + etAddressDetail.setText(adr.getAddressDetail()); + etPhone.setText(adr.getContactNumber()); + etName.setText(adr.getContactPerson()); + tvNum.setText(adr.getCompanyCode()); + tvAddress.setText(adr.getProvinceName() + "-" + adr.getCityName() + "-" + adr.getAreaName()); + etName2.setText(adr.getCompanyName()); + + tvRight.setOnClickListener(v -> { + new XPopup.Builder(con) + .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + .asConfirm("请确认", "是否确定删除这个地址?", + "取消", "确认", + () -> { + ar.addressDelete(adr.getId()); + }, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局 + .show(); + }); + } + + /** + * 初始化控件 + */ + private void findAndInitView() { + title = findViewById(R.id.title_view); + tvRight = findViewById(R.id.tvRight); + etName = findViewById(R.id.etName); + etPhone = findViewById(R.id.etPhone); + tvNum = findViewById(R.id.tvNum); + tvAddress = findViewById(R.id.tvAddress); + ivAddress = findViewById(R.id.ivAddress); + etName2 = findViewById(R.id.etName2); + tvName2Title = findViewById(R.id.tvName2Title); + etAddressDetail = findViewById(R.id.etAddressDetail); + btnOk = findViewById(R.id.btnOk); + recyclerView = findViewById(R.id.recyclerView); + + recyclerView.setLayoutManager(new LinearLayoutManager(con, RecyclerView.VERTICAL, false)); + adapter = new ChoiceAddressAdapter(-1, datas); + recyclerView.setAdapter(adapter); + + adapter.setOnItemClickListener((adapter, view, position) -> { + KeyboardUtils.hideSoftInput(etName); + isCheck = true; + Tip o = (Tip) adapter.getData().get(position); + + RegeocodeQuery query = new RegeocodeQuery(o.getPoint(), 100, + GeocodeSearch.AMAP);// 第一个参数表示一个Latlng,第二参数表示范围多少米,第三个参数表示是火系坐标系还是GPS原生坐标系 + geocodeSearch.getFromLocationAsyn(query);// 设置异步逆地理编码请求 + + + etAddressDetail.setText(o.getAddress() + o.getName()); + adapter.setList(null); + }); + + btnOk.setOnClickListener(this); + tvAddress.setOnClickListener(this); + ivAddress.setOnClickListener(this); + + } + + private void submint() { + String name = etName.getText().toString(); + String phone = etPhone.getText().toString(); + String num = tvNum.getText().toString(); + String address = tvAddress.getText().toString(); + String addressDetail = etAddressDetail.getText().toString(); + String tvNum2 = tvNum.getText().toString(); + String comName2 = etName2.getText().toString(); + + if (TextUtils.isEmpty(name) || TextUtils.isEmpty(phone) || + TextUtils.isEmpty(num) || TextUtils.isEmpty(address) || + TextUtils.isEmpty(addressDetail)||TextUtils.isEmpty(comName2)) { + ToastUtil.show(con, "请完善信息"); + return; + } + + if (type!=300001&&(num.length()!=15&&num.length()!=18&&num.length()!=20)){ + ToastUtil.show(con, "税号/身份证号长度不正确"); + return; + } + + if (phone.startsWith("1") && phone.length() == 11) { + aib.setAddressDetail(addressDetail); + aib.setContactNumber(phone); + aib.setContactPerson(name); + aib.setUserId(UserParts.getUser(con).getData().getId()); + aib.setAddressType(type); + aib.setCompanyCode(tvNum2); + aib.setCompanyName(comName2); + ar.addressSave(aib); + } else { + Toast.makeText(con, "手机号格式不正确", Toast.LENGTH_SHORT).show(); + } + + } + + + /** + * 选择 省 市 县 + * + * @param view + */ + private void onProvinceCityCounty(TextView view) { + AddressPicker picker = new AddressPicker(this); + picker.setAddressMode(AddressMode.PROVINCE_CITY_COUNTY); + picker.setAddressMode("province.json", AddressMode.PROVINCE_CITY_COUNTY, + new AddressJsonParser.Builder() + .provinceCodeField("code") + .provinceNameField("name") + .provinceChildField("city") + .cityCodeField("code") + .cityNameField("name") + .cityChildField("area") + .countyCodeField("code") + .countyNameField("name") + .build()); + picker.setDefaultValue("河南省", "郑州市", "金水区"); + picker.setOnAddressPickedListener(new OnAddressPickedListener() { + @Override + public void onAddressPicked(ProvinceEntity province, CityEntity city, CountyEntity county) { + view.setText(province.getName() + "-" + city.getName() + "-" + county.getName()); + aib.setProvince(Integer.parseInt(province.getCode())); + aib.setCity(Integer.parseInt(city.getCode())); + aib.setArea(Integer.parseInt(county.getCode())); + } + }); + picker.show(); + } + + @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 (isCheck) { + isCheck = false; + return; + } + String newText = s.toString().trim(); + if (!TextUtils.isEmpty(newText)) { + InputtipsQuery inputquery = new InputtipsQuery(newText, ""); + Inputtips inputTips = new Inputtips(this, inputquery); + inputTips.setInputtipsListener(new Inputtips.InputtipsListener() { + @Override + public void onGetInputtips(List list, int i) { + if (i == AMapException.CODE_AMAP_SUCCESS) {// 正确返回 + adapter.setList(list); + } else { + adapter.setList(null); + ToastUtil.show(ChoiceAddressActivity.this, "查询失败"); + } + } + }); + inputTips.requestInputtipsAsyn(); + } else { + adapter.setList(null); + } + } + + @Override + public void afterTextChanged(Editable s) { + + } + + @Override + protected void onDestroy() { + super.onDestroy(); + EventBus.getDefault().unregister(this); + } + + @Subscribe + public void onMyEvent(AddressEvent event) { + } + + @Override + public void onRegeocodeSearched(RegeocodeResult regeocodeResult, int i) { + if (i == AMapException.CODE_AMAP_SUCCESS) { + if (regeocodeResult != null && regeocodeResult.getRegeocodeAddress() != null + && regeocodeResult.getRegeocodeAddress().getFormatAddress() != null) { + String province = regeocodeResult.getRegeocodeAddress().getProvince(); + String city = regeocodeResult.getRegeocodeAddress().getCity(); + String district = regeocodeResult.getRegeocodeAddress().getDistrict(); + String formatAddress = regeocodeResult.getRegeocodeAddress().getFormatAddress(); + String countryCode = regeocodeResult.getRegeocodeAddress().getCountryCode(); + + tvAddress.setText(province + "-" + city + "-" + district); + + aib.setProvinceS(province); + aib.setCityS(city); + aib.setAreaS(district); + + } else { + ToastUtil.show(this, "未查到结果"); + } + } else { + ToastUtil.show(this, "错误"); + } + } + + @Override + public void onGeocodeSearched(GeocodeResult geocodeResult, int i) { + + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/home/DisCarActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/home/DisCarActivity.java new file mode 100644 index 0000000..fd1ccc2 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/home/DisCarActivity.java @@ -0,0 +1,158 @@ +package com.oneclouds.cargo.ui.home; + +import android.os.Bundle; +import android.os.Message; +import android.text.Editable; +import android.text.TextUtils; +import android.text.TextWatcher; +import android.view.View; +import android.widget.EditText; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.annotation.Nullable; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.amap.api.location.AMapLocation; +import com.amap.api.location.AMapLocationListener; +import com.amap.api.maps.AMap; +import com.amap.api.maps.CameraUpdateFactory; +import com.amap.api.maps.model.CameraPosition; +import com.amap.api.maps.model.LatLng; +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; +import com.lxj.xpopup.XPopup; +import com.lxj.xpopup.enums.PopupPosition; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.base.AppConfig; +import com.oneclouds.cargo.bean.BaseBean; +import com.oneclouds.cargo.bean.CarBean; +import com.oneclouds.cargo.event.BaseEvent; +import com.oneclouds.cargo.request.CateRequest; +import com.oneclouds.cargo.util.GDLocationUtil; +import com.oneclouds.cargo.util.adapter.AdapterAll; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseActivity; +import com.oneclouds.cargo.util.view.BaseRecyclerView; +import com.oneclouds.cargo.weight.RecyclerViewDecoration; + +import org.greenrobot.eventbus.EventBus; + +import java.util.ArrayList; +import java.util.List; + +/** + * @ClassName DisCarActivity + * @Author 用户 + * @Date 2022/5/18 15:42 + * @Description TODO + */ +public class DisCarActivity extends BaseActivity { + + private TextView title; + private EditText etInput; + private BaseRecyclerView recyclerView; + private AdapterAll adapterAll; + + private CateRequest cr; + private Gson gson = new Gson(); + private List datas = new ArrayList<>(); + + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what){ + case 200: + if (CacheGroup.cacheList.get(CateRequest.CATE_CAR_LIST) != null) { + BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(CateRequest.CATE_CAR_LIST), BaseBean.class); + if (bb.getCode() == 200) { + String s = gson.toJson(bb.getData()); + if (!TextUtils.isEmpty(s)) { + List o = gson.fromJson(gson.toJson(bb.getData()), new TypeToken>() { + }.getType()); + if (o.size() == 0) { + return; + } + datas.clear(); + datas.addAll(o); + adapterAll.notifyDataSetChanged(); + } + + + } + CacheGroup.cacheList.remove(CateRequest.CATE_CAR_LIST); + } + break; + + } + } + + @Override + protected void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_dis_car); + con = this; + cr = new CateRequest(con, hd); + + findAndInitView(); + initView(null); + } + + + /** + * 初始化控件 + */ + private void findAndInitView() { + title = findViewById(R.id.title_view); + etInput = findViewById(R.id.etInput); + recyclerView = findViewById(R.id.recyclerView); + + String string = getIntent().getExtras().getString(AppConfig.STRING); + title.setText("分配车辆"); + etInput.setText(string); + + recyclerView.addItemDecoration(new RecyclerViewDecoration(con,RecyclerViewDecoration.VERTICAL_LIST)); + adapterAll = recyclerView.createV(con, datas, R.layout.item_dis_car); + adapterAll.setOnItemViewListener((position, o, v) -> { + CarBean o1 = (CarBean) o; + TextView tvContent = v.findViewById(R.id.tvName); + LinearLayout llDisCar = v.findViewById(R.id.invoice_address); + + tvContent.setText(o1.getCarNum()+" "+o1.getDriverPhone()); + llDisCar.setOnClickListener(V->{ + tvContent.setText(""); + BaseEvent event = new BaseEvent<>(); + event.setData(o1); + EventBus.getDefault().post(event); + finish(); + }); + }); + + + + + + etInput.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) { + + } + + @Override + public void afterTextChanged(Editable s) { + String newText = s.toString().trim(); + if (!TextUtils.isEmpty(newText)) { + cr.getCarList(newText); + } + } + }); + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/home/GetUploadImageActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/home/GetUploadImageActivity.java new file mode 100644 index 0000000..73244fa --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/home/GetUploadImageActivity.java @@ -0,0 +1,115 @@ +package com.oneclouds.cargo.ui.home; + +import android.content.Context; +import android.os.Bundle; +import android.util.Log; +import android.widget.ImageView; +import android.widget.TextView; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.request.RequestOptions; +import com.bumptech.glide.request.target.Target; +import com.google.gson.Gson; +import com.lxj.xpopup.XPopup; +import com.lxj.xpopup.interfaces.XPopupImageLoader; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.OrderDetailsBean; +import com.oneclouds.cargo.util.StringUtil; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseActivity; + +import java.io.File; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/22 15:17 + * @description: + */ +public class GetUploadImageActivity extends BaseActivity { + + private TextView name_one,name_two,address,address2,time_one,time_two; + private ImageView img1,img2; + OrderDetailsBean.DataDTO.WayChildrenDTO sdw; + String sdwStr=""; + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_upload_image); + con=this; + initFind(); + sdwStr=getIntent().getExtras().getString("sdwStr"); + Log.e("---sdwStr--",sdwStr); + sdw=new Gson().fromJson(sdwStr,OrderDetailsBean.DataDTO.WayChildrenDTO.class); + initView(null); + } + + public void initFind(){ + name_one=findViewById(R.id.name_one); + name_two=findViewById(R.id.name_two); + address=findViewById(R.id.address); + address2=findViewById(R.id.address2); + img1=findViewById(R.id.img1); + img2=findViewById(R.id.img2); + time_one=findViewById(R.id.time_one); + time_two=findViewById(R.id.time_two); + } + + @Override + public void initView(Object obj) { + super.initView(obj); + if(sdw.getType()==1){ + name_one.setText("装货照片"); + name_two.setText("装货回单"); + }else{ + name_one.setText("卸货照片"); + name_two.setText("卸货回单"); + } + address.setText(StringUtil.isNull(sdw.getSendPutLocationAddress(),"暂未上传")); + address2.setText(StringUtil.isNull(sdw.getReceiptLocationAddress(),"暂未上传")); + time_one.setText(StringUtil.isNull(sdw.getUpdateTime(),"")); + time_two.setText(StringUtil.isNull(sdw.getReceiptTime(),"")); + //coordinate.setText(StringUtil.isNull(sdw.getLongitude(),"")+","+StringUtil.isNull(sdw.getLatitude(),"")); + //coordinate2.setText(StringUtil.isNull(sdw.getReceiptLongitude(),"")+","+StringUtil.isNull(sdw.getReceiptLatitude(),"")); + if(sdw.getSendPutImagesUrl()!=null && sdw.getSendPutImagesUrl().size()>=1){ + Glide.with(con).load(sdw.getSendPutImagesUrl().get(0)).into(img1); + img1.setOnClickListener(v -> { + new XPopup.Builder(con) + .asImageViewer(img1,sdw.getSendPutImagesUrl().get(0), true, -1, -1, 50, false,new ImageLoader()) + .show(); + }); + } + if(sdw.getReceiptUrl()!=null && sdw.getReceiptUrl().size()>=1){ + Glide.with(con).load(sdw.getReceiptUrl().get(0)).into(img2); + img2.setOnClickListener(v -> { + new XPopup.Builder(con) + .asImageViewer(img2,sdw.getReceiptUrl().get(0), true, -1, -1, 50, false,new ImageLoader()) + .show(); + }); + } + //new GlideUrl(sdw.getSendPutImagesUrl().toString(), new LazyHeaders.Builder().addHeader("Cookie", AppCurrentUser.getInstance().getUserCookie()).build()); + } + + public static class ImageLoader implements XPopupImageLoader { + @Override + public void loadImage(int position, @NonNull Object url, @NonNull ImageView imageView) { + //必须指定Target.SIZE_ORIGINAL,否则无法拿到原图,就无法享用天衣无缝的动画 + Glide.with(imageView).load(url).apply(new RequestOptions().placeholder(R.mipmap.ic_launcher_round).override(Target.SIZE_ORIGINAL)).into(imageView); + } + @Override + public File getImageFile(@NonNull Context context, @NonNull Object uri) { + try { + return Glide.with(context).downloadOnly().load(uri).submit().get(); + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/home/GoodsActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/home/GoodsActivity.java new file mode 100644 index 0000000..ca8354c --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/home/GoodsActivity.java @@ -0,0 +1,152 @@ +package com.oneclouds.cargo.ui.home; + +import android.os.Bundle; +import android.text.TextUtils; +import android.util.Log; +import android.widget.Button; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; + +import com.github.gzuliyujiang.wheelpicker.OptionPicker; +import com.google.gson.Gson; +import com.lxj.xpopup.XPopup; +import com.lxj.xpopup.util.KeyboardUtils; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.OptionBaseBean; +import com.oneclouds.cargo.bean.PackNameBean; +import com.oneclouds.cargo.event.GoodsEvent; +import com.oneclouds.cargo.request.bean.OrderInputBean; +import com.oneclouds.cargo.ui.parts.TypeParts; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseActivity; + +import org.greenrobot.eventbus.EventBus; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/13 20:49 + * @description: + */ + +public class GoodsActivity extends BaseActivity { + + private EditText name , num1, num2, price; + private Button submit; + private TextView packName; + private OrderInputBean.SendTableDataDTO.GoodsDTO osg; + + @Override + protected void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_goods_add); + setTitle("货物信息"); + act = this; + con = this; + + name = findViewById(R.id.name); + packName = findViewById(R.id.packName); + num1 = findViewById(R.id.num1); + num2 = findViewById(R.id.num2); + price = findViewById(R.id.price); + submit = findViewById(R.id.submit); + + + Bundle extras = getIntent().getExtras(); + if (extras != null) { + String string = extras.getString("goodData", ""); + osg = new Gson().fromJson(string, OrderInputBean.SendTableDataDTO.GoodsDTO.class); + name.setText(osg.getName()); + packName.setText(osg.getPackName()); + price.setText(osg.getPrice() + ""); + if ("吨".equals(osg.getUnit())) { + num1.setText(osg.getNum()); + } else { + num2.setText(osg.getNum()); + } + } else { + osg = new OrderInputBean.SendTableDataDTO.GoodsDTO(); + } + + initView(null); + } + + int count = 0; + @Override + public void initView(Object obj) { + super.initView(obj); + packName.setOnClickListener(v -> { + Log.i("lj",count+""); + count++; + PackNameBean ptb = TypeParts.getPackName(con); + List data = new ArrayList<>(); + for (int i = 0; i < ptb.getData().size(); i++) { + String obb = ptb.getData().get(i); + Log.e(i + "", "" + ptb.getData().get(i)); + data.add(new OptionBaseBean(i, ptb.getData().get(i))); + } + OptionPicker picker = new OptionPicker(act); + picker.setBodyWidth(140); + picker.setOnOptionPickedListener((position, item) -> { + packName.setText(item + ""); + }); + picker.setData(ptb.getData()); + picker.setDefaultPosition(2); + picker.show(); + }); + submit.setOnClickListener(v -> { + KeyboardUtils.hideSoftInput(name); + if (!TextUtils.isEmpty(osg.getName())) { + setSubmit(); + +// new XPopup.Builder(con) +//// .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 +// .asConfirm("请确认", "修改装货货物,需重新添加卸货地址货物?", +// "取消", "确认", +// () -> { +// setSubmit(); +// }, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局 +// .show(); + } else { + setSubmit(); + } + }); + } + + private void setSubmit() { + String nameStr = name.getText() + ""; + String packNameStr = packName.getText() + ""; + String unitStr = num1.getText() + ""; + String unitStr2 = num2.getText() + ""; + String priceStr = price.getText() + ""; + if (!nameStr.equals("") && !packNameStr.equals("") && !priceStr.equals("")) { + if (!unitStr.equals("") || !unitStr2.equals("")) { + osg.setName(nameStr); + osg.setPackName(packNameStr); + if (!unitStr.equals("")) { + osg.setUnit("吨"); + osg.setNum(unitStr); + } else { + osg.setUnit("方"); + osg.setNum(unitStr2); + } + osg.setPrice((int) Double.parseDouble(priceStr)); + GoodsEvent msg = new GoodsEvent(new Gson().toJson(osg)); + EventBus.getDefault().post(msg); + finish(); + } else { + Toast.makeText(con, "有未填写的信息", Toast.LENGTH_SHORT).show(); + } + } else { + Toast.makeText(con, "有未填写的信息", Toast.LENGTH_SHORT).show(); + } + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/home/GoodsDischargeActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/home/GoodsDischargeActivity.java new file mode 100644 index 0000000..f579ea4 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/home/GoodsDischargeActivity.java @@ -0,0 +1,210 @@ +package com.oneclouds.cargo.ui.home; + +import android.os.Bundle; +import android.text.TextUtils; +import android.util.Log; +import android.widget.Button; +import android.widget.EditText; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; + +import com.github.gzuliyujiang.wheelpicker.OptionPicker; +import com.google.gson.Gson; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.OptionBaseBean; +import com.oneclouds.cargo.event.GoodsEvent; +import com.oneclouds.cargo.request.bean.OrderInputBean; +import com.oneclouds.cargo.util.StringUtil; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseActivity; + +import org.greenrobot.eventbus.EventBus; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/28 18:07 + * @description: + */ +public class GoodsDischargeActivity extends BaseActivity { + + private EditText num1, num2; + private TextView name, packName, price; + private Button submit; + private OrderInputBean.SendTableDataDTO.GoodsDTO osg; + private String goodsData = ""; + private Gson gson = new Gson(); + private OrderInputBean os; + private List list = new ArrayList<>(); + private int index = 0; + private double currNum = 0; + + @Override + protected void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_goods_discharge); + setTitle("货物信息"); + act = this; + con = this; + osg = new OrderInputBean.SendTableDataDTO.GoodsDTO(); + name = findViewById(R.id.name); + packName = findViewById(R.id.packName); + num1 = findViewById(R.id.num1); + num2 = findViewById(R.id.num2); + price = findViewById(R.id.price); + submit = findViewById(R.id.submit); + goodsData = getIntent().getExtras().getString("goodData"); + os = gson.fromJson(goodsData, OrderInputBean.class); + for (OrderInputBean.SendTableDataDTO sendTableDatum : os.getSendTableData()) { + for (OrderInputBean.SendTableDataDTO.GoodsDTO good : sendTableDatum.getGoods()) { + list.add(good); + } + } + + + String string = getIntent().getExtras().getString("choiceData", ""); + if (!TextUtils.isEmpty(string)) { + osg = new Gson().fromJson(string, OrderInputBean.SendTableDataDTO.GoodsDTO.class); + name.setText(osg.getName()); + packName.setText(osg.getPackName()); + price.setText(osg.getPrice() + ""); + if ("吨".equals(osg.getUnit())) { + num1.setText(osg.getNum()); + num2.setEnabled(false); + } else { + num2.setText(osg.getNum()); + num1.setEnabled(false); + key = false; + } + + currNum = Double.parseDouble(StringUtil.isNull(osg.getNum(), "0")); + } else { +// osg = new OrderInputBean.SendTableDataDTO.GoodsDTO(); + osg = list.get(0); + name.setText(osg.getName()); + packName.setText(osg.getPackName()); + price.setText(osg.getPrice() + ""); + if ("吨".equals(osg.getUnit())) { + num1.setText(osg.getNum()); + num2.setEnabled(false); + } else { + num2.setText(osg.getNum()); + num1.setEnabled(false); + key = false; + } + } + + initView(null); + } + + @Override + public void initView(Object obj) { + super.initView(obj); + name.setOnClickListener(v -> { + int id = 0; + List data = new ArrayList<>(); + for (OrderInputBean.SendTableDataDTO.GoodsDTO goodsDTO : list) { + data.add(new OptionBaseBean(id, goodsDTO.getName())); + id++; + } + OptionPicker picker = new OptionPicker(act); + picker.setBodyWidth(140); + picker.setOnOptionPickedListener((position, item) -> { + index = position; + Log.e(position + "_", list.get(position).toString()); + initgoods(list.get(position)); + }); + picker.setData(data); + picker.setDefaultPosition(0); + picker.show(); + }); + submit.setOnClickListener(v -> { + String nameStr = name.getText() + ""; + String packNameStr = packName.getText() + ""; + String unitStr = num1.getText() + ""; + String unitStr2 = num2.getText() + ""; + String priceStr = price.getText() + ""; + if (!nameStr.equals("") && !packNameStr.equals("") && !priceStr.equals("")) { + if (!unitStr.equals("") || !unitStr2.equals("")) { + double sum = 0; + double count = 0; + if (key) { + sum = Double.parseDouble(StringUtil.isNull(unitStr, "0")); + } else { + sum = Double.parseDouble(StringUtil.isNull(unitStr2, "0")); + } + + double currSendGoodNum = getCurrSendGoodNum(); + List goods = os.getPutTableData().get(0).getGoods(); + if (goods.size() > 0) { + for (int i = 0; i < goods.size(); i++) { + if (nameStr.equals(goods.get(i).getName())) { + sum += Double.parseDouble(StringUtil.isNull(goods.get(i).getNum(), "0")); + } + } + } + sum -= currNum; + if (sum > 0) { + if (sum <= currSendGoodNum) { + osg.setName(nameStr); + osg.setPackName(packNameStr); + if (!unitStr.equals("")) { + osg.setUnit("吨"); + osg.setNum(unitStr); + } else { + osg.setUnit("方"); + osg.setNum(unitStr2); + } + osg.setPrice((int) Double.parseDouble(priceStr)); + GoodsEvent msg = new GoodsEvent(new Gson().toJson(osg)); + EventBus.getDefault().post(msg); + finish(); + } else { + Toast.makeText(con, "卸货数量不得大于装货数量", Toast.LENGTH_SHORT).show(); + } + } else { + Toast.makeText(con, "货物数量不得为0", Toast.LENGTH_SHORT).show(); + } + } else { + Toast.makeText(con, "有未填写的信息", Toast.LENGTH_SHORT).show(); + } + } else { + Toast.makeText(con, "有未填写的信息", Toast.LENGTH_SHORT).show(); + } + }); + } + + private boolean key = true; + + public void initgoods(OrderInputBean.SendTableDataDTO.GoodsDTO o) { + name.setText(o.getName()); + packName.setText(o.getPackName()); + price.setText(o.getPrice() + ""); + if (o.getUnit().equals("吨")) { + num1.setText(o.getNum()); + num2.setEnabled(false); + } else { + num2.setText(o.getNum()); + num1.setEnabled(false); + key = false; + } + } + + private double getCurrSendGoodNum() { + String nameStr = name.getText() + ""; + List goods = os.getSendTableData().get(0).getGoods(); + for (int i = 0; i < goods.size(); i++) { + if (nameStr.equals(goods.get(i).getName())) { + return Double.parseDouble(goods.get(i).getNum()); + } + } + + return 0; + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/home/GoodsSourceActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/home/GoodsSourceActivity.java new file mode 100644 index 0000000..32be872 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/home/GoodsSourceActivity.java @@ -0,0 +1,113 @@ +package com.oneclouds.cargo.ui.home; + +import android.os.Bundle; +import android.os.Message; +import android.util.Log; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; + +import com.google.gson.Gson; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.OrderListBean; +import com.oneclouds.cargo.request.OrderRequest; +import com.oneclouds.cargo.util.adapter.ManyBean; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.http.RequsetCodeConstants; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseActivity; +import com.oneclouds.cargo.util.view.BaseRecyclerView; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/22 9:34 + * @description: + */ +public class GoodsSourceActivity extends BaseActivity { + + private OrderListBean olb; + private Gson gson=new Gson(); + private OrderRequest or; + private int index=0; + private int sum=0; + private BaseRecyclerView brv; + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what){ + case RequsetCodeConstants.SUCCESS: + if (CacheGroup.cacheList.get(OrderRequest.ORDER_FIND_ORDER_LIST)!=null && index==0) { + Log.e("结果2",CacheGroup.cacheList.get(OrderRequest.ORDER_FIND_ORDER_LIST)); + olb=gson.fromJson(CacheGroup.cacheList.get(OrderRequest.ORDER_FIND_ORDER_LIST), OrderListBean.class); + if(olb.getCode()==200){ + initView(null); + }else{ + Toast.makeText(con,olb.getMsg(),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(OrderRequest.ORDER_FIND_ORDER_LIST); + } + if (CacheGroup.cacheList.get(OrderRequest.ORDER_FIND_ORDER_LIST)!=null && index!=0) { + olb=gson.fromJson(CacheGroup.cacheList.get(OrderRequest.ORDER_FIND_ORDER_LIST),OrderListBean.class); + if(olb.getCode()==200){ + insInit(); + }else{ + Toast.makeText(con,"加载失败",Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(OrderRequest.ORDER_FIND_ORDER_LIST); + } + break; + default:break; + } + } + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_goods_source); + con=this; + brv=findViewById(R.id.brv); + or=new OrderRequest(con,hd); + or.orderList(); + } + + @Override + public void initView(Object obj) { + super.initView(obj); + List list=new ArrayList<>(); + for(int i=0;i { + switch (layout) { + case R.layout.order_item: + TextView totalFreight = findViewById(R.id.totalFreight); + v.setTop(getResources().getDimensionPixelOffset(R.dimen.dp_10)); + OrderListBean.DataDTO.RecordsDTO idl = (OrderListBean.DataDTO.RecordsDTO) o; + v.setOnClickListener(v1 -> { + Log.e("id", idl.getId() + ""); + }); +// TextView state = v.findViewById(R.id.state); +// TextView orderTime = v.findViewById(R.id.orderTime); + //Timer.formatChange(str,"yyyy-MM-dd HH:mm:ss","dd日HH:mm") + String str = "待审核"; + // orderTime.setText(str); + case R.layout.order_time: + break; + default: + break; + } + }); + } + + public void insInit(){ + + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/home/HomeFragment.java b/app/src/main/java/com/oneclouds/cargo/ui/home/HomeFragment.java new file mode 100644 index 0000000..fedd9a4 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/home/HomeFragment.java @@ -0,0 +1,795 @@ +package com.oneclouds.cargo.ui.home; + +import android.content.Context; +import android.content.Intent; +import android.graphics.drawable.Drawable; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.text.Editable; +import android.text.TextUtils; +import android.text.TextWatcher; +import android.util.Log; +import android.view.Gravity; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.EditText; +import android.widget.ImageButton; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.RelativeLayout; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import com.github.gzuliyujiang.wheelpicker.DatimePicker; +import com.github.gzuliyujiang.wheelpicker.OptionPicker; +import com.github.gzuliyujiang.wheelpicker.annotation.DateMode; +import com.github.gzuliyujiang.wheelpicker.annotation.TimeMode; +import com.github.gzuliyujiang.wheelpicker.entity.DatimeEntity; +import com.github.gzuliyujiang.wheelpicker.widget.DatimeWheelLayout; +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; +import com.hjq.xtoast.XToast; +import com.lxj.xpopup.XPopup; +import com.lxj.xpopup.enums.PopupPosition; +import com.lxj.xpopup.interfaces.OnSelectListener; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.base.AppConfig; +import com.oneclouds.cargo.bean.AddressListBean; +import com.oneclouds.cargo.bean.AlGoodsTypeListBean; +import com.oneclouds.cargo.bean.BaseBean; +import com.oneclouds.cargo.bean.BusinssTypeBean; +import com.oneclouds.cargo.bean.CarBean; +import com.oneclouds.cargo.bean.CarTypeLongBean; +import com.oneclouds.cargo.bean.NpListBean; +import com.oneclouds.cargo.bean.OptionBaseBean; +import com.oneclouds.cargo.bean.UpAppBean; +import com.oneclouds.cargo.bean.UserBean; +import com.oneclouds.cargo.constant.SPConstant; +import com.oneclouds.cargo.event.BalanceEvent; +import com.oneclouds.cargo.event.BaseEvent; +import com.oneclouds.cargo.event.InformationEvent; +import com.oneclouds.cargo.event.InformationEventTwo; +import com.oneclouds.cargo.request.CateRequest; +import com.oneclouds.cargo.request.OrderRequest; +import com.oneclouds.cargo.request.PublicRequest; +import com.oneclouds.cargo.request.bean.OrderInputBean; +import com.oneclouds.cargo.ui.LoginActivity; +import com.oneclouds.cargo.ui.UiAuxiliary; +import com.oneclouds.cargo.ui.WebActivity; +import com.oneclouds.cargo.ui.alert.UpAppAlert; +import com.oneclouds.cargo.ui.news.NewsXActivity; +import com.oneclouds.cargo.ui.parts.TypeParts; +import com.oneclouds.cargo.ui.parts.UserParts; +import com.oneclouds.cargo.util.MapUtil; +import com.oneclouds.cargo.util.SPUtil; +import com.oneclouds.cargo.util.StringUtil; +import com.oneclouds.cargo.util.adapter.ManyBean; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.view.BaseFragment; +import com.oneclouds.cargo.util.view.BaseRecyclerView; + +import org.greenrobot.eventbus.EventBus; +import org.greenrobot.eventbus.Subscribe; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/13 9:59 + * @description:主页-发货页面 + */ +public class HomeFragment extends BaseFragment { + + private BaseRecyclerView brv, brv_loading, brv_discharge; + private OrderInputBean oib = new OrderInputBean(); + private int data_index = -1; + private int data_type = -1; + private PublicRequest pr; + private OrderRequest or; + private CateRequest cr; + private List pathName_z = new ArrayList<>(); + private List pathName_x = new ArrayList<>(); + private LinearLayout home_top; + private Gson gson = new Gson(); + private UserBean ub; + private String money = "0"; + private TextView money_view; + private String url = ""; + private TextView etCar; + + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what) { + case 200: + insData(OrderRequest.ORDER_CAR_TYPE_AND_CAR_LONG); + insData(OrderRequest.ORDER_BUSINESS_TYPE_LIST); + insData(OrderRequest.ORDER_BUSINESS_TYPE_LIST_JTT); + insData(OrderRequest.ORDER_BUSINESS_TYPE_LIST_AL); + insData(OrderRequest.ORDER_PACK_NAME_LIST); + insData(CateRequest.CATE_NPLIST); + insData(CateRequest.CATE_NPLIST_AL); + if (CacheGroup.cacheList.get(PublicRequest.USER_DATA) != null) { + UserBean ubs = gson.fromJson(CacheGroup.cacheList.get(PublicRequest.USER_DATA), UserBean.class); + if (ubs.getCode() == 200) { + SPUtil.insSP(con, SPConstant.DATA, SPConstant.DATA_USER, CacheGroup.cacheList.get(PublicRequest.USER_DATA)); + ub = UserParts.getUser(con); + } else { + Toast.makeText(con, "获取用户信息error:" + ubs.getMsg(), Toast.LENGTH_LONG).show(); + } + CacheGroup.cacheList.remove(PublicRequest.USER_DATA); + } + if (CacheGroup.cacheList.get(OrderRequest.ORDER_PULIST_ORDER) != null) { + BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(OrderRequest.ORDER_PULIST_ORDER), BaseBean.class); + if (bb.getCode() == 200) { + Toast.makeText(con, "创建订单成功", Toast.LENGTH_SHORT).show(); + Map map = new HashMap<>(); + map.put("expenditure", money); + BalanceEvent be = new BalanceEvent(MapUtil.mapJson(map)); + EventBus.getDefault().post(be); + Intent in = new Intent(con, OrderListActivity.class); + startActivity(in); + } else { + Toast.makeText(con, StringUtil.isNull(bb.getMsg(), "账户余额不足"), Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(OrderRequest.ORDER_PULIST_ORDER); + } + if (CacheGroup.cacheList.get(PublicRequest.VERSION) != null) { + //TCrashTool + Log.e("-ss-", CacheGroup.cacheList.get(PublicRequest.VERSION)); + UpAppBean uab = gson.fromJson(CacheGroup.cacheList.get(PublicRequest.VERSION), UpAppBean.class); + if (uab.getCode() == 200) { + if (uab.getData() != null) { + new XPopup.Builder(con) + .dismissOnBackPressed(false) + .dismissOnTouchOutside(false) + .asCustom(new UpAppAlert(con, uab.getData().getDownloadUrl(), uab.getData().getContent(), uab.getData().getVersion(), uab.getData().getForce())) + .show(); + } + } + CacheGroup.cacheList.remove(PublicRequest.VERSION); + } + if (CacheGroup.cacheList.get(PublicRequest.VERSION) != null) { + + } + if (CacheGroup.cacheList.get(PublicRequest.URL) != null) { + BaseBean bb = gson.fromJson(CacheGroup.cacheList.get(PublicRequest.URL), BaseBean.class); + if (bb.getCode() == 200) { + url = StringUtil.isNull((String) bb.getData(), ""); + if (!"".equals(url)) { +// dShow(); + } + } + CacheGroup.cacheList.remove(PublicRequest.URL); + } + + + + break; + } + } + + private ImageView news_btn; + + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) { + root = inflater.inflate(R.layout.fragment_huoyuan, container, false); + con = getContext(); + act = getActivity(); + brv = root.findViewById(R.id.rv); + news_btn = root.findViewById(R.id.news_btn); + home_top = root.findViewById(R.id.home_top); + news_btn.setOnClickListener(v -> { + if (isLogin()) { + Intent in = new Intent(con, NewsXActivity.class); + startActivity(in); + } + }); + EventBus.getDefault().register(this); + oib.setFormData(new OrderInputBean.FormDataDTO()); + oib.setPutTableData(new ArrayList<>()); + oib.setSendTableData(new ArrayList<>()); + for (int i = 0; i < 10; i++) { + pathName_z.add(""); + pathName_x.add(""); + } + initView(null); + xt = new XToast<>(getActivity()); + pr = new PublicRequest(con, hd); + or = new OrderRequest(con, hd); + cr = new CateRequest(con, hd); + getRequest(); + return root; + } + + @Override + public void onResume() { + super.onResume(); + getRequest(); + } + + public void getRequest() { + pr.upApp(); + if (UiAuxiliary.isLogin(con)) { + pr.getUserInfo(); + or.carTypeLongList(); + or.businssTypeList(); + or.packNameList(); + cr.cateNPList(); + cr.cateNPListAl(); + pr.getUrl(); + } + } + + @Override + public void initView(Object obj) { + super.initView(obj); + List list = new ArrayList<>(); + //list.add(new ManyBean(new Model(), R.layout.huoyuan_top)); + list.add(new ManyBean(new Model(), R.layout.huoyuan_content)); + list.add(new ManyBean(new Model(), R.layout.huoyuan_input_car)); + list.add(new ManyBean(new Model(), R.layout.huoyuan_bottom)); + brv.creates(con, list).setOnItemViewListener((position, o, v, layout) -> { + switch (layout) { +// case R.layout.huoyuan_top: +// initTop(v); +// break; + case R.layout.huoyuan_content: + initContent(v); + break; + case R.layout.huoyuan_input_car: + initInputCar(v); + break; + case R.layout.huoyuan_bottom: + initBottom(v); + break; + default: + break; + } + }); + } + + /** + * 分配车辆 + * + * @param v + */ + private void initInputCar(View v) { + etCar = v.findViewById(R.id.etCar); + etCar.setOnClickListener(V->{ + Intent intent = new Intent(con, DisCarActivity.class); + intent.putExtra(AppConfig.STRING,etCar.getText().toString()); + startActivity(intent); + }); + } + + /** + * 初始化huoyuan_top组件的逻辑 + */ + private void initTop(View v) { + LinearLayout orderAll = v.findViewById(R.id.orderAll); + TextView my_goods = v.findViewById(R.id.my_goods); + orderAll.setOnClickListener(v1 -> { + if (isLogin()) { + Intent in = new Intent(con, OrderListActivity.class); + startActivity(in); + } + }); + my_goods.setOnClickListener(v12 -> { + new XPopup.Builder(act) + .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + .asConfirm("请确认", "是否确定清除页面的货源信息?", + "取消", "确认", + () -> { + oib = new OrderInputBean(); + data_index = -1; + data_type = -1; + money = "0"; + pathName_z = new ArrayList<>(); + pathName_x = new ArrayList<>(); + oib.setFormData(new OrderInputBean.FormDataDTO()); + oib.setPutTableData(new ArrayList<>()); + oib.setSendTableData(new ArrayList<>()); + for (int i = 0; i < 10; i++) { + pathName_z.add(""); + pathName_x.add(""); + } + initView(null); + }, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局 + .show(); + }); + } + + /** + * 初始化huoyuan_content组件的逻辑 + */ + private void initContent(View v) { + brv_loading = v.findViewById(R.id.brv_loading); + brv_discharge = v.findViewById(R.id.brv_discharge); + OrderInputBean.PutTableDataDTO op = new OrderInputBean.PutTableDataDTO(); + OrderInputBean.SendTableDataDTO os = new OrderInputBean.SendTableDataDTO(); + oib.getPutTableData().add(op); + oib.getSendTableData().add(os); + brv_loading.createV(con, oib.getSendTableData(), R.layout.huoyuan_centent_loading_info). + setOnItemViewListener((position, o, v1) -> { + OrderInputBean.SendTableDataDTO oss = (OrderInputBean.SendTableDataDTO) o; + oss.setSort(position + 1); + initLoadingInfo(o, v1, 0, position); + }); + brv_discharge.createV(con, oib.getPutTableData(), R.layout.huoyuan_centent_discharge_info). + setOnItemViewListener((position, o, v2) -> { + OrderInputBean.PutTableDataDTO ops = (OrderInputBean.PutTableDataDTO) o; + ops.setSort(position + 1); + initLoadingInfo(o, v2, 1, position); + }); + } + + private boolean isGoodsKey = false; + + /** + * 初始化huoyuan_bottom组件的逻辑 + */ + + private void initBottom(View v) { + //交通厅 + RelativeLayout r1 = v.findViewById(R.id.r1); + TextView goodsBigCate = v.findViewById(R.id.goodsBigCate); + //安联 + RelativeLayout r2 = v.findViewById(R.id.r2); + TextView alctGoodsType = v.findViewById(R.id.alctGoodsType); + //车型车长 + RelativeLayout r3 = v.findViewById(R.id.r3); + RelativeLayout r31 = v.findViewById(R.id.r31); + TextView vehicle_type = v.findViewById(R.id.vehicle_type); + TextView vehicle_length = v.findViewById(R.id.vehicle_length); + //业务类型 + RelativeLayout r4 = v.findViewById(R.id.r4); + TextView businessType = v.findViewById(R.id.businessType); + //订单有效期 + RelativeLayout r5 = v.findViewById(R.id.r5); + TextView effectiveTime = v.findViewById(R.id.effectiveTime); + + //货物大类 交通厅 + RelativeLayout r7 = v.findViewById(R.id.r7); + TextView tvHwdlJt = v.findViewById(R.id.tvHwdlJt); + + //货物大类 安联 + RelativeLayout r8 = v.findViewById(R.id.r8); + TextView tvHwdlAl = v.findViewById(R.id.tvHwdlAl); + //是否购买运费险 + ImageButton isGoods = v.findViewById(R.id.isGoods); + money_view = v.findViewById(R.id.money); + + r7.setOnClickListener(v14 -> { + if (isLogin()) { + NpListBean al = TypeParts.getNpType(con); + List data = new ArrayList<>(); + for (NpListBean.DataDTO datum : al.getData()) { + data.add(new OptionBaseBean(datum.getId(), datum.getCateName())); + } + OptionPicker picker = new OptionPicker(act); + picker.setBodyWidth(140); + picker.setOnOptionPickedListener((position, item) -> { + OptionBaseBean obb = (OptionBaseBean) item; + tvHwdlJt.setText(obb.getName()); + oib.getFormData().setGoodsBigCate(obb.getId()); + }); + picker.setData(data); + picker.setDefaultPosition(2); + picker.show(); + } + }); + + r8.setOnClickListener(v15 -> { + if (isLogin()) { + AlGoodsTypeListBean al = TypeParts.getAlType(con); + List data = new ArrayList<>(); + for (AlGoodsTypeListBean.DataDTO datum : al.getData()) { + data.add(new OptionBaseBean(datum.getId(), datum.getName())); + } + OptionPicker picker = new OptionPicker(act); + picker.setBodyWidth(140); + picker.setOnOptionPickedListener((position, item) -> { + OptionBaseBean obb = (OptionBaseBean) item; + tvHwdlAl.setText(obb.getName()); + oib.getFormData().setAlctGoodsType(obb.getId()); + }); + picker.setData(data); + picker.setDefaultPosition(14); + picker.show(); + } + }); + + // + isGoods.setOnClickListener(v4 -> { + if (isLogin()) { + if (isGoodsKey) { + isGoods.setImageResource(R.mipmap.icon_no); + oib.getFormData().setIsInsure(1); + isGoodsKey = false; + } else { + isGoods.setImageResource(R.mipmap.icon_yes); + oib.getFormData().setIsInsure(0); + isGoodsKey = true; + } + } + }); + Button submit = v.findViewById(R.id.submit); + LinearLayout sub_box = v.findViewById(R.id.sub_box); + if (TypeParts.isEntrust(con)) { + sub_box.setBackgroundResource(R.drawable.bg_btn_grey); + } + r1.setOnClickListener(v1 -> { + if (isLogin()) { + NpListBean al = TypeParts.getNpType(con); + List data = new ArrayList<>(); + for (NpListBean.DataDTO datum : al.getData()) { + data.add(new OptionBaseBean(datum.getId(), datum.getCateName())); + } + OptionPicker picker = new OptionPicker(act); + picker.setBodyWidth(140); + picker.setOnOptionPickedListener((position, item) -> { + OptionBaseBean obb = (OptionBaseBean) item; + goodsBigCate.setText(obb.getName()); + oib.getFormData().setGoodsBigCate(obb.getId()); + }); + picker.setData(data); + picker.setDefaultPosition(2); + picker.show(); + } + }); + r2.setOnClickListener(v1 -> { + if (isLogin()) { + AlGoodsTypeListBean al = TypeParts.getAlType(con); + List data = new ArrayList<>(); + for (AlGoodsTypeListBean.DataDTO datum : al.getData()) { + data.add(new OptionBaseBean(datum.getId(), datum.getName())); + } + OptionPicker picker = new OptionPicker(act); + picker.setBodyWidth(140); + picker.setOnOptionPickedListener((position, item) -> { + OptionBaseBean obb = (OptionBaseBean) item; + alctGoodsType.setText(obb.getName()); + oib.getFormData().setAlctGoodsType(obb.getId()); + }); + picker.setData(data); + picker.setDefaultPosition(2); + picker.show(); + } + }); + r3.setOnClickListener(v1 -> { + if (isLogin()) { + CarTypeLongBean ctb = TypeParts.getCarTypeLong(con); + List data = new ArrayList<>(); + for (CarTypeLongBean.DataDTO.TypeDTO typeDTO : ctb.getData().getType()) { + data.add(new OptionBaseBean(typeDTO.getValue(), typeDTO.getName())); + } + OptionPicker picker = new OptionPicker(act); + picker.setBodyWidth(140); + picker.setOnOptionPickedListener((position, item) -> { + OptionBaseBean obb = (OptionBaseBean) item; + vehicle_type.setText(obb.getName()); + oib.getFormData().setVehicleType(obb.getId()); + }); + picker.setData(data); + picker.setDefaultPosition(2); + picker.show(); + } + }); + //47,208,165 + r31.setOnClickListener(v13 -> { + if (isLogin()) { + CarTypeLongBean ctb = TypeParts.getCarTypeLong(con); + List data = new ArrayList<>(); + for (CarTypeLongBean.DataDTO.LengthDTO lengthDTO : ctb.getData().getLength()) { + data.add(new OptionBaseBean(lengthDTO.getValue(), lengthDTO.getName())); + } + OptionPicker picker = new OptionPicker(act); + picker.setBodyWidth(140); + picker.setOnOptionPickedListener((position, item) -> { + OptionBaseBean obb = (OptionBaseBean) item; + vehicle_length.setText(obb.getName()); + oib.getFormData().setVehicleLength(obb.getId()); + }); + picker.setData(data); + picker.setDefaultPosition(2); + picker.show(); + } + }); + r4.setOnClickListener(v1 -> { + if (isLogin()) { + BusinssTypeBean btb = TypeParts.getBusType(con); + List data = new ArrayList<>(); + for (BusinssTypeBean.DataDTO datum : btb.getData()) { + data.add(new OptionBaseBean(datum.getValue(), datum.getName())); + } + OptionPicker picker = new OptionPicker(act); + picker.setBodyWidth(140); + picker.setOnOptionPickedListener((position, item) -> { + OptionBaseBean obb = (OptionBaseBean) item; + businessType.setText(obb.getName()); + oib.getFormData().setBusinessType(obb.getId()); + }); + picker.setData(data); + picker.setDefaultPosition(2); + picker.show(); + } + }); + r5.setOnClickListener(v1 -> { + if (isLogin()) { + DatimePicker ap = new DatimePicker(act); + final DatimeWheelLayout wheelLayout = ap.getWheelLayout(); + ap.setOnDatimePickedListener((year, month, day, hour, minute, second) -> { + String text = year + "-" + getRead(month) + "-" + getRead(day) + " " + getRead(hour) + ":" + getRead(minute); + effectiveTime.setText(text); + oib.getFormData().setEffectiveTime(text); + }); + wheelLayout.setDateMode(DateMode.YEAR_MONTH_DAY); + wheelLayout.setTimeMode(TimeMode.HOUR_24_NO_SECOND); + wheelLayout.setRange(DatimeEntity.now(), DatimeEntity.yearOnFuture(10)); + wheelLayout.setDateLabel("年", "月", "日"); + wheelLayout.setTimeLabel("时", "分", ""); + ap.show(); + } + }); + submit.setOnClickListener(v12 -> { + if (isLogin()) { + if (!TypeParts.isEntrust(con)) { + for (OrderInputBean.SendTableDataDTO sendTableDatum : oib.getSendTableData()) { + if (ub != null) { + if (StringUtil.isNull(ub.getData().getCompanyName(), "").equals("")) { + sendTableDatum.setBusinessName(StringUtil.isNull(ub.getData().getRname(), "")); + } else { + sendTableDatum.setBusinessName(ub.getData().getCompanyName()); + } + } + } + if (null != oib.getSendTableData().get(0).getGoods() + && null != oib.getPutTableData().get(0).getGoods() + &&0!=oib.getFormData().getVehicleType() + &&0!=oib.getFormData().getVehicleLength() + &&0!=oib.getFormData().getBusinessType() + &&0!=oib.getFormData().getGoodsBigCate() + &&0!=oib.getFormData().getAlctGoodsType() + &&!TextUtils.isEmpty(oib.getFormData().getEffectiveTime()) + ) { + new XPopup.Builder(act) + .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + .asConfirm("请确认", "是否确定提交此订单?", + "取消", "确认", + () -> { + oib.setIsSubmit(1); + oib.getFormData().setIsSubmit(1); +// oib.getFormData().setGoodsBigCate(4);//150 +// oib.getFormData().setAlctGoodsType(150); + //oib.getFormData() + //oib.getSendTableData().get(oib.getSendTableData().size()-1).setTotalPrice(Integer.parseInt(totalPriceStr)); + Log.e("货源信息", new Gson().toJson(oib)); + or.pulistOrder(oib); + }, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局 + .show(); + } else { + Toast.makeText(con, "提交订单信息不完整", Toast.LENGTH_LONG).show(); + } + } else { + Toast.makeText(con, "此账户不能进行发货操作", Toast.LENGTH_LONG).show(); + } + } else { + Toast.makeText(con, "请先登录", Toast.LENGTH_LONG).show(); + } + }); + } + + Drawable getDrawable(Context con, int id) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + return con.getDrawable(id); + } else { + return con.getResources().getDrawable(id); + } + } + + /** + * 初始化huoyuan_centent_loading_info组件的逻辑 + */ + private void initLoadingInfo(Object o, View v, int type, int position) { + TextView goods_info = v.findViewById(R.id.goods_info); + //RelativeLayout show_box=v.findViewById(R.id.show_box); + RelativeLayout bottom_box = v.findViewById(R.id.bottom_box); + TextView totalPrice = v.findViewById(R.id.totalPrice); + ImageButton add_btn = v.findViewById(R.id.add_btn); + TextView detailAddress = v.findViewById(R.id.detailAddress); + if (type == 1) { + OrderInputBean.PutTableDataDTO op = (OrderInputBean.PutTableDataDTO) o; + Log.e("o", gson.toJson(op)); + if (op.getGoods() != null && op.getGoods().size() > 0) { + bottom_box.setVisibility(View.VISIBLE); + OrderInputBean.PutTableDataDTO.GoodsDTO osg2 = op.getGoods().get(0); + goods_info.setText(osg2.getName() + "|" + osg2.getPackName() + "|" + osg2.getNum() + osg2.getUnit() + "|" + "价值" + osg2.getPrice() + "元"); + } + } else { + OrderInputBean.SendTableDataDTO os = (OrderInputBean.SendTableDataDTO) o; + Log.e("o", gson.toJson(os)); + if (os.getGoods() != null && os.getGoods().size() > 0) { + bottom_box.setVisibility(View.VISIBLE); + OrderInputBean.SendTableDataDTO.GoodsDTO osg1 = os.getGoods().get(0); + goods_info.setText(osg1.getName() + "|" + osg1.getPackName() + "|" + osg1.getNum() + osg1.getUnit() + "|" + "价值" + osg1.getPrice() + "元"); + } + } + v.setOnClickListener(v1 -> { + if (isLogin()) { + data_type = type; + data_index = position; + Intent in; +// if (0 == type) { +// in = new Intent(con, InformationActivity.class); +// } else { + in = new Intent(con, NodeInfoActivity.class); +// } + + + in.putExtra("type", type); + in.putExtra("position", position); + in.putExtra("data", gson.toJson(oib)); + startActivity(in); + } + }); + if (position == 0) { + add_btn.setOnClickListener(v4 -> { + addData(type); + }); + } else { + add_btn.setImageResource(R.mipmap.del); + add_btn.setOnClickListener(v4 -> { + new XPopup.Builder(act) + .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + .asConfirm("请确认", "是否删除这个节点,这会导致你输入的数据被清除", + "取消", "确认", + () -> { + removeData(type, position); + }, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局 + .show(); + }); + } + } + + //判断连点性 + public void addData(int type) { + if (type == 0) { + OrderInputBean.SendTableDataDTO os = oib.getSendTableData().get(oib.getSendTableData().size() - 1); + if (os.getGoods() != null && os.getDetailAddress() != null && os.getLoadingDeadline() != null) { + brv_loading.addItemV(new OrderInputBean.SendTableDataDTO()); + } else { + Toast.makeText(con, "请先填写完整的装货节点数据", Toast.LENGTH_LONG).show(); + } + } else { + OrderInputBean.PutTableDataDTO op = oib.getPutTableData().get(oib.getPutTableData().size() - 1); + if (op.getGoods() != null && op.getDetailAddress() != null && op.getLoadingDeadline() != null) { + brv_discharge.addItemV(new OrderInputBean.PutTableDataDTO()); + } else { + Toast.makeText(con, "请先填写完整的卸货节点数据", Toast.LENGTH_LONG).show(); + } + } + } + + public void removeData(int type, int position) { + if (type == 0) { + brv_loading.delItemV(position); + } else { + brv_discharge.delItemV(position); + } + } + + private AddressListBean.DataDTO.RecordsDTO ad; + + + public void getTime(int position, String timer, int type) { + if (type == 0) { + OrderInputBean.SendTableDataDTO os = oib.getSendTableData().get(position); + os.setLoadingDeadline(timer); + brv_loading.updateItemV(position, os); + } else { + OrderInputBean.PutTableDataDTO op = oib.getPutTableData().get(position); + op.setLoadingDeadline(timer); + brv_discharge.updateItemV(position, op); + } + } + + private class Model { + } + + public void insData(String key) { + if (CacheGroup.cacheList.get(key) != null) { + SPUtil.insSP(con, "chacheData", key, CacheGroup.cacheList.get(key)); + Log.e(key, CacheGroup.cacheList.get(key)); + CacheGroup.cacheList.remove(key); + } + } + + public String getRead(int num) { + if (num < 10) { + return "0" + num; + } + return num + ""; + } + + public boolean isLogin() { + if (UiAuxiliary.isLogin(con)) { + return true; + } else { + Intent in = new Intent(con, LoginActivity.class); + startActivity(in); + return false; + } + } + + @Subscribe + public void informationEventResult(InformationEventTwo event) { +// Log.e("返回结果", event.getMessage() + "--"); +// if (data_type == 0) { + OrderInputBean.SendTableDataDTO os = gson.fromJson(event.getOs(), OrderInputBean.SendTableDataDTO.class); + oib.getSendTableData().set(data_index, os); + brv_loading.updateItemV(data_index, os); + money_view.setText("¥" + os.getTotalPrice() + ""); +// } else { + OrderInputBean.PutTableDataDTO op = gson.fromJson(event.getOp(), OrderInputBean.PutTableDataDTO.class); + oib.getPutTableData().set(data_index, op); + brv_discharge.updateItemV(data_index, op); +// } + } + + @Subscribe + public void disCarEvent(BaseEvent baseEvent){ + if (baseEvent.getData() instanceof CarBean){ + CarBean data = (CarBean) baseEvent.getData(); + etCar.setText(data.getCarNum()+" "+data.getDriverPhone()); + oib.getFormData().setShipperCarId(data.getCarId()+""); + oib.getFormData().setShipperDriverId(data.getDriverId()+""); + } + } + + + private XToast xt; + + public void dShow() { + if (isLogin()) { + if (xt != null) { + xt.cancel(); + } + Intent in = new Intent(con, WebActivity.class); +// 传入 Activity 对象表示设置成局部的,不需要有悬浮窗权限 +// 传入 Application 对象表示设置成全局的,但需要有悬浮窗权限 + xt.setContentView(R.layout.view_dp) + // 设置成可拖拽的 + //.setDraggable() + // 设置显示时长 + .setDuration(1000 * 60 * 60 * 12) + .setOnClickListener(R.id.dp, (toast, view) -> { + if (!"".equals(url)) { + in.putExtra("title", "数据大屏"); + in.putExtra("url", url); + toast.startActivity(in); + Log.e("-is-", view.isInTouchMode() + ""); + } else { + Toast.makeText(con, "请求出现了一点小问题,请稍后重试", Toast.LENGTH_LONG).show(); + } + }) + // 设置动画样式 + //.setAnimStyle(android.R.style.Animation_Translucent) + // 设置外层是否能被触摸 + // 设置窗口背景阴影强度 + //.setBackgroundDimAmount(0.5f) + .showAsDropDown(home_top, Gravity.BOTTOM, 1200, 1500); + } + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/home/InformationActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/home/InformationActivity.java new file mode 100644 index 0000000..d8da2ba --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/home/InformationActivity.java @@ -0,0 +1,266 @@ +package com.oneclouds.cargo.ui.home; + +import android.content.Intent; +import android.os.Bundle; +import android.text.Editable; +import android.text.InputFilter; +import android.text.TextWatcher; +import android.util.Log; +import android.view.View; +import android.widget.EditText; +import android.widget.LinearLayout; +import android.widget.RelativeLayout; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; + +import com.github.gzuliyujiang.wheelpicker.DatimePicker; +import com.github.gzuliyujiang.wheelpicker.annotation.DateMode; +import com.github.gzuliyujiang.wheelpicker.annotation.TimeMode; +import com.github.gzuliyujiang.wheelpicker.entity.DatimeEntity; +import com.github.gzuliyujiang.wheelpicker.widget.DatimeWheelLayout; +import com.google.gson.Gson; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.AddressListBean; +import com.oneclouds.cargo.event.AddressEvent; +import com.oneclouds.cargo.event.GoodsEvent; +import com.oneclouds.cargo.event.InformationEvent; +import com.oneclouds.cargo.request.bean.OrderInputBean; +import com.oneclouds.cargo.ui.my.AddressActivity; +import com.oneclouds.cargo.util.CashierInputFilter; +import com.oneclouds.cargo.util.bean.GetObjectName; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseActivity; + +import org.greenrobot.eventbus.EventBus; +import org.greenrobot.eventbus.Subscribe; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/10/31 17:55 + * @description: + */ +public class InformationActivity extends BaseActivity { + + private LinearLayout activity_loading; + private TextView title_view; + private RelativeLayout address_box; + private RelativeLayout goods_box; + private RelativeLayout time_box; + private TextView goods_info; + private EditText totalPrice; + private View v_br; + private int type=0; + private int position=0; + private String data=""; + private boolean addressKey=false; + private boolean goodsKey=false; + private boolean timeKey=false; + private OrderInputBean.SendTableDataDTO os=new OrderInputBean.SendTableDataDTO(); + private OrderInputBean.PutTableDataDTO op=new OrderInputBean.PutTableDataDTO(); + private Gson gson=new Gson(); + + @Override + protected void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_loading); + title_view=findViewById(R.id.title_view); + address_box=findViewById(R.id.address_box); + goods_box=findViewById(R.id.goods_box); + time_box=findViewById(R.id.time_box); + goods_info=findViewById(R.id.goods_info); + totalPrice=findViewById(R.id.totalPrice); + activity_loading=findViewById(R.id.activity_loading); + v_br=findViewById(R.id.v_br); + con=this; + act=this; + EventBus.getDefault().register(this); + type=getIntent().getExtras().getInt("type"); + position=getIntent().getExtras().getInt("position"); + data=getIntent().getExtras().getString("data"); + Log.e("data",data); + initView(null); + } + private OrderInputBean oib; + @Override + public void initView(Object obj) { + super.initView(obj); + InputFilter[] filters = {new CashierInputFilter()}; + totalPrice.setFilters(filters); + totalPrice.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) { + String str=String.valueOf(totalPrice.getText()); + if(str.indexOf(".")==0){ + str=0+str; + totalPrice.setText(str); + } + } + + @Override + public void afterTextChanged(Editable s) { + + } + }); + oib=gson.fromJson(data,OrderInputBean.class); + if(type==1){ + title_view.setText("卸货信息"); + totalPrice.setVisibility(View.GONE); + v_br.setVisibility(View.GONE); + op=oib.getPutTableData().get(position); + if(op.getGoods()!=null && op.getGoods().size()>0){ + goodsKey=true; + addressKey=true; + timeKey=true; + OrderInputBean.PutTableDataDTO.GoodsDTO osg2=op.getGoods().get(0); + goods_info.setText(osg2.getName()+"|"+osg2.getPackName()+"|"+osg2.getNum()+osg2.getUnit()+"|"+"价值"+osg2.getPrice()+"元"); + GetObjectName.ZIModel(activity_loading,op,con); + } + }else{ + title_view.setText("装货信息"); + os=oib.getSendTableData().get(position); + if(os.getGoods()!=null && os.getGoods().size()>0) { + goodsKey=true; + addressKey=true; + timeKey=true; + OrderInputBean.SendTableDataDTO.GoodsDTO osg1 = os.getGoods().get(0); + goods_info.setText(osg1.getName() + "|" + osg1.getPackName() + "|" + osg1.getNum() + osg1.getUnit() + "|" + "价值" + osg1.getPrice() + "元"); + GetObjectName.ZIModel(activity_loading,os,con); + } + } + address_box.setOnClickListener(v1 -> { + Intent in = new Intent(con, AddressActivity.class); + in.putExtra("type", type); + startActivity(in); + }); + //填写货物信息 + goods_box.setOnClickListener(v2 -> { + if(type==1){ + if(oib.getSendTableData().get(position).getGoods()!=null){ + Intent in = new Intent(con, GoodsDischargeActivity.class); + in.putExtra("goodData",gson.toJson(oib)); + startActivity(in); + }else{ + Toast.makeText(con,"请先添加装货信息",Toast.LENGTH_LONG).show(); + } + }else{ + Intent in = new Intent(con, GoodsActivity.class); + startActivity(in); + } + }); + //选择截止时间 + time_box.setOnClickListener(v3 -> { + DatimePicker ap = new DatimePicker(act); + final DatimeWheelLayout wheelLayout = ap.getWheelLayout(); + ap.setOnDatimePickedListener((year, month, day, hour, minute, second) -> { + String text = year + "-" + getRead(month) + "-" + getRead(day) + " " + getRead(hour) + ":" + getRead(minute); + getTime(text, type); + timeKey=true; + }); + wheelLayout.setDateMode(DateMode.YEAR_MONTH_DAY); + wheelLayout.setTimeMode(TimeMode.HOUR_24_NO_SECOND); + wheelLayout.setRange(DatimeEntity.now(), DatimeEntity.yearOnFuture(10)); + wheelLayout.setDateLabel("年", "月", "日"); + wheelLayout.setTimeLabel("时", "分", ""); + ap.show(); + }); + } + + public void submit(View v){ + String money=String.valueOf(totalPrice.getText()); + if(type==1){ + money="0"; + } + if(!"".equals(money) && addressKey && goodsKey && timeKey){ + os.setTotalPrice(Double.parseDouble(money)); + InformationEvent msg; + if (type==0){ + msg=new InformationEvent(new Gson().toJson(os)); + }else{ + msg=new InformationEvent(new Gson().toJson(op)); + } + EventBus.getDefault().post(msg); + finish(); + }else{ + Toast.makeText(con,"请输入完整的"+(type==0?"装":"卸")+"货信息",Toast.LENGTH_LONG).show(); + } + } + + public String getRead(int num){ + if(num<10){ + return "0"+num; + } + return num+""; + } + + public void getTime(String timer,int type){ + if(type==0){ + os.setLoadingDeadline(timer); + GetObjectName.ZIModel(time_box,os,con); + }else{ + op.setLoadingDeadline(timer); + GetObjectName.ZIModel(time_box,op,con); + } + } + + AddressListBean.DataDTO.RecordsDTO ad; + + @Subscribe + public void addressResult(AddressEvent event) { + Log.e("返回结果",event.getMessage()+"--"); + ad=new Gson().fromJson(event.getMessage(), AddressListBean.DataDTO.RecordsDTO.class); + List list=new ArrayList<>(); + list.add(ad.getProvince()); + list.add(ad.getCity()); + list.add(ad.getArea()); + if(type==0){ + os.setDetailAddress(ad.getAddressDetail()); + os.setLoadingName(ad.getContactPerson()); + os.setLoadingPhone(ad.getContactNumber()); + os.setLoadingAddress(list); + GetObjectName.ZIModel(address_box,os,con); + }else{ + op.setDetailAddress(ad.getAddressDetail()); + op.setLoadingName(ad.getContactPerson()); + op.setLoadingPhone(ad.getContactNumber()); + op.setLoadingAddress(list); + GetObjectName.ZIModel(address_box,op,con); + } + addressKey=true; + } + + @Subscribe + public void goodsResult(GoodsEvent event) { + Log.e("返回结果",event.getMessage()+"--"); + if(type==0){ + os.setGoods(new ArrayList<>()); + OrderInputBean.SendTableDataDTO.GoodsDTO osg1=new Gson().fromJson(event.getMessage(),OrderInputBean.SendTableDataDTO.GoodsDTO.class); + os.getGoods().add(osg1); + goods_info.setText(osg1.getName()+"|"+osg1.getPackName()+"|"+osg1.getNum()+osg1.getUnit()+"|"+"价值"+osg1.getPrice()+"元"); + }else{ + op.setGoods(new ArrayList<>()); + OrderInputBean.PutTableDataDTO.GoodsDTO osg2=new Gson().fromJson(event.getMessage(),OrderInputBean.PutTableDataDTO.GoodsDTO.class); + op.getGoods().add(osg2); + goods_info.setText(osg2.getName()+"|"+osg2.getPackName()+"|"+osg2.getNum()+osg2.getUnit()+"|"+"价值"+osg2.getPrice()+"元"); + } + goodsKey=true; + } + + + @Override + protected void onDestroy() { + super.onDestroy(); + EventBus.getDefault().unregister(con); + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/home/NodeInfoActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/home/NodeInfoActivity.java new file mode 100644 index 0000000..bca02f8 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/home/NodeInfoActivity.java @@ -0,0 +1,462 @@ +package com.oneclouds.cargo.ui.home; + +import android.content.Intent; +import android.os.Bundle; +import android.text.Editable; +import android.text.InputFilter; +import android.text.TextUtils; +import android.text.TextWatcher; +import android.util.Log; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; +import android.widget.LinearLayout; +import android.widget.RelativeLayout; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.recyclerview.widget.RecyclerView; + +import com.github.gzuliyujiang.wheelpicker.DatimePicker; +import com.github.gzuliyujiang.wheelpicker.annotation.DateMode; +import com.github.gzuliyujiang.wheelpicker.annotation.TimeMode; +import com.github.gzuliyujiang.wheelpicker.entity.DatimeEntity; +import com.github.gzuliyujiang.wheelpicker.widget.DatimeWheelLayout; +import com.google.gson.Gson; +import com.lxj.xpopup.XPopup; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.base.AppConfig; +import com.oneclouds.cargo.bean.AddressBean; +import com.oneclouds.cargo.bean.AddressListBean; +import com.oneclouds.cargo.bean.AuthInfoBean; +import com.oneclouds.cargo.event.AddressEvent; +import com.oneclouds.cargo.event.GoodsEvent; +import com.oneclouds.cargo.event.InformationEvent; +import com.oneclouds.cargo.event.InformationEventTwo; +import com.oneclouds.cargo.request.bean.OrderInputBean; +import com.oneclouds.cargo.ui.my.AddressActivity; +import com.oneclouds.cargo.util.CashierInputFilter; +import com.oneclouds.cargo.util.ToastUtil; +import com.oneclouds.cargo.util.adapter.AdapterAll; +import com.oneclouds.cargo.util.adapter.AdapterAlls; +import com.oneclouds.cargo.util.adapter.ManyBean; +import com.oneclouds.cargo.util.bean.GetObjectName; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseActivity; +import com.oneclouds.cargo.util.view.BaseRecyclerView; +import com.oneclouds.cargo.weight.RecyclerViewDecoration; +import com.umeng.vt.diff.V; + +import org.greenrobot.eventbus.EventBus; +import org.greenrobot.eventbus.Subscribe; + +import java.util.ArrayList; +import java.util.List; + +/** + * @ClassName NodeInfoActivity + * @Author 用户 + * @Date 2022/4/29 9:08 + * @Description TODO + */ +public class NodeInfoActivity extends BaseActivity { + + private TextView title_view; + private BaseRecyclerView recycleView; + private int type; + + private boolean addressKey = false; + private boolean timeKey = false; + AddressListBean.DataDTO.RecordsDTO ad; + private String data = ""; + private OrderInputBean oib; + private Gson gson = new Gson(); + private OrderInputBean.SendTableDataDTO os = new OrderInputBean.SendTableDataDTO(); + private OrderInputBean.PutTableDataDTO op = new OrderInputBean.PutTableDataDTO(); + private TextView tvName, tvNameDis; + private TextView tvPhone, tvPhoneDis; + private TextView tvAddress, tvAddressDis; + private TextView tvStartTime; + private EditText etMoney; + private TextView tvEndTimeDis; + private Button submit; + private int goodsType = 0; + private BaseRecyclerView ryPretend; + private BaseRecyclerView ryDis; + + private int updatePosGoods = -1; + private int updatePosGoodsDis = -1; + + @Override + protected void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_node_info); + con = this; + act = this; + EventBus.getDefault().register(this); + type = getIntent().getIntExtra("type", 0); + title_view = findViewById(R.id.title_view); + recycleView = findViewById(R.id.rv); + submit = findViewById(R.id.submit); + data = getIntent().getExtras().getString("data"); + submit.setOnClickListener(V -> { + submint(); + }); + + initView(null); + } + + @Override + public void initView(Object obj) { + super.initView(obj); + oib = gson.fromJson(data, OrderInputBean.class); + os = oib.getSendTableData().get(0); + op = oib.getPutTableData().get(0); + + + title_view.setText("发货信息"); + List list = new ArrayList<>(); + list.add(new ManyBean(new AddressBean(), R.layout.item_node_pretend)); + list.add(new ManyBean(new AddressBean(), R.layout.item_node_dis)); + recycleView.creates(con, list).setOnItemViewListener((position, o, v, layout) -> { + switch (layout) { + //装货信息 + case R.layout.item_node_pretend: + initPretend(position, o, v, layout); + break; + //卸货信息 + case R.layout.item_node_dis: + initDis(position, o, v, layout); + break; + } + }); + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + } + + + /** + * 初始化卸货 + * + * @param position + * @param o + * @param v + * @param layout + */ + private void initDis(int position, Object o, View v, int layout) { + RelativeLayout rlTopDis = v.findViewById(R.id.rlTopDis); + tvNameDis = v.findViewById(R.id.tvName); + tvPhoneDis = v.findViewById(R.id.tvPhone); + tvAddressDis = v.findViewById(R.id.tvAddress); + TextView tvAddDis = v.findViewById(R.id.tvAddDis); + tvEndTimeDis = v.findViewById(R.id.tvEndTime); + ryDis = v.findViewById(R.id.ryDis); + + + ryDis.addItemDecoration(new RecyclerViewDecoration(con,RecyclerViewDecoration.VERTICAL_LIST)); + ryDis.createV(con, new ArrayList(), R.layout.item_cargo).setOnItemViewListener((position1, o1, v1) -> { + TextView tvHWName = v1.findViewById(R.id.tvHWName); + TextView tvCount = v1.findViewById(R.id.tvCount); + TextView tvDw = v1.findViewById(R.id.tvDw); + TextView tvBzfs = v1.findViewById(R.id.tvBzfs); + + TextView tvDel = v1.findViewById(R.id.tvDel); + if (op != null && op.getGoods() != null && op.getGoods().size() > 0) { +// OrderInputBean.PutTableDataDTO.GoodsDTO osg1 = (OrderInputBean.PutTableDataDTO.GoodsDTO) o1; + OrderInputBean.PutTableDataDTO.GoodsDTO osg1 = op.getGoods().get(position1); + tvHWName.setText(osg1.getName()); + tvCount.setText(osg1.getNum()); + tvDw.setText(osg1.getUnit()); + tvBzfs.setText(osg1.getPackName()); + + v1.setOnClickListener(v2 -> { + goodsType = 1; + updatePosGoodsDis = position1; + Intent in = new Intent(con, GoodsDischargeActivity.class); + in.putExtra("goodData", gson.toJson(oib)); + in.putExtra("choiceData", gson.toJson(op.getGoods().get(position1))); + startActivity(in); + }); + tvDel.setOnClickListener(v22 -> { + op.getGoods().remove(osg1); + ryDis.delItemV(position1); + }); + } + }); + + if (op != null && op.getGoods() != null && op.getGoods().size() > 0) { +// OrderInputBean.PutTableDataDTO.GoodsDTO osg2 = op.getGoods().get(0); + tvNameDis.setText(op.getLoadingName()); + tvPhoneDis.setText(op.getLoadingPhone()); + tvAddressDis.setText(op.getDetailAddress()); + tvEndTimeDis.setText(op.getLoadingDeadline()); + ryDis.notifyDatas(op.getGoods()); + } else { + op.setGoods(new ArrayList<>()); + } + + rlTopDis.setOnClickListener(v12 -> { + Intent in = new Intent(con, AddressActivity.class); + in.putExtra("type", 1); + startActivity(in); + }); + + tvAddDis.setOnClickListener(V -> { + if (oib.getSendTableData().get(0).getGoods() != null && oib.getSendTableData().get(0).getGoods().size() > 0) { + goodsType = 1; + Intent in = new Intent(con, GoodsDischargeActivity.class); + in.putExtra("goodData", gson.toJson(oib)); + startActivity(in); + } else { + Toast.makeText(con, "请先添加装货信息", Toast.LENGTH_LONG).show(); + } + }); + + tvEndTimeDis.setOnClickListener(V -> { + DatimePicker ap = new DatimePicker(act); + final DatimeWheelLayout wheelLayout = ap.getWheelLayout(); + ap.setOnDatimePickedListener((year, month, day, hour, minute, second) -> { + String text = year + "-" + getRead(month) + "-" + getRead(day) + " " + getRead(hour) + ":" + getRead(minute); + this.op.setLoadingDeadline(text); + tvEndTimeDis.setText(text); + timeKey = true; + }); + wheelLayout.setDateMode(DateMode.YEAR_MONTH_DAY); + wheelLayout.setTimeMode(TimeMode.HOUR_24_NO_SECOND); + wheelLayout.setRange(DatimeEntity.now(), DatimeEntity.yearOnFuture(10)); + wheelLayout.setDateLabel("年", "月", "日"); + wheelLayout.setTimeLabel("时", "分", ""); + ap.show(); + }); + + + } + + /** + * 装货初始化 + * + * @param position + * @param o + * @param v + * @param layout + */ + private void initPretend(int position, Object o, View v, int layout) { + tvName = v.findViewById(R.id.tvName); + tvPhone = v.findViewById(R.id.tvPhone); + tvAddress = v.findViewById(R.id.tvAddress); + etMoney = v.findViewById(R.id.etMoney); + tvStartTime = v.findViewById(R.id.tvStartTime); + TextView tvAddPre = v.findViewById(R.id.tvAddPre); + RelativeLayout rlTop = v.findViewById(R.id.rlTop); + ryPretend = v.findViewById(R.id.ryPretend); + + if (os != null && os.getGoods() != null && os.getGoods().size() > 0) { + tvName.setText(os.getLoadingName()); + tvPhone.setText(os.getLoadingPhone()); + tvAddress.setText(os.getDetailAddress()); + tvStartTime.setText(os.getLoadingDeadline()); + etMoney.setText(os.getTotalPrice() + ""); + } else { + os.setGoods(new ArrayList<>()); + } + + + rlTop.setOnClickListener(v12 -> { + Intent in = new Intent(con, AddressActivity.class); + in.putExtra("type", 0); + startActivity(in); + }); + tvAddPre.setOnClickListener(V -> { + goodsType = 0; + Intent in = new Intent(con, GoodsActivity.class); + startActivity(in); + }); + + tvStartTime.setOnClickListener(V -> { + DatimePicker ap = new DatimePicker(act); + final DatimeWheelLayout wheelLayout = ap.getWheelLayout(); + ap.setOnDatimePickedListener((year, month, day, hour, minute, second) -> { + String text = year + "-" + getRead(month) + "-" + getRead(day) + " " + getRead(hour) + ":" + getRead(minute); + this.os.setLoadingDeadline(text); + tvStartTime.setText(text); + timeKey = true; + }); + wheelLayout.setDateMode(DateMode.YEAR_MONTH_DAY); + wheelLayout.setTimeMode(TimeMode.HOUR_24_NO_SECOND); + wheelLayout.setRange(DatimeEntity.now(), DatimeEntity.yearOnFuture(10)); + wheelLayout.setDateLabel("年", "月", "日"); + wheelLayout.setTimeLabel("时", "分", ""); + ap.show(); + }); + ryPretend.addItemDecoration(new RecyclerViewDecoration(con,RecyclerViewDecoration.VERTICAL_LIST)); + ryPretend.createV(con, os.getGoods(), R.layout.item_cargo).setOnItemViewListener((position1, o1, v1) -> { + TextView tvHWName = v1.findViewById(R.id.tvHWName); + TextView tvCount = v1.findViewById(R.id.tvCount); + TextView tvDw = v1.findViewById(R.id.tvDw); + TextView tvBzfs = v1.findViewById(R.id.tvBzfs); + TextView tvDel = v1.findViewById(R.id.tvDel); + if (os != null && os.getGoods() != null && os.getGoods().size() > 0) { + OrderInputBean.SendTableDataDTO.GoodsDTO osg1 = (OrderInputBean.SendTableDataDTO.GoodsDTO) o1; + tvHWName.setText(osg1.getName()); + tvCount.setText(osg1.getNum()); + tvDw.setText(osg1.getUnit()); + tvBzfs.setText(osg1.getPackName()); + + v1.setOnClickListener(v2 -> { + goodsType = 0; + updatePosGoods = position1; + Intent in = new Intent(con, GoodsActivity.class); + in.putExtra("goodData", gson.toJson(os.getGoods().get(position1))); + startActivity(in); + }); + tvDel.setOnClickListener(v22 -> { + if (op.getGoods().size()>0){ + new XPopup.Builder(con) +// .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + .asConfirm("请确认", "删除装货货物,需重新添加卸货地址货物?", + "取消", "确认", + () -> { + ryPretend.delItemV(position1); + op.getGoods().clear(); + ryDis.delAllDatas(); + }, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局 + .show(); + }else{ + ryPretend.delItemV(position1); + } + + ; + }); + + } + + }); + } + + @Subscribe + public void addressResult(AddressEvent event) { + Log.e("返回结果", event.getMessage() + "--"); + ad = new Gson().fromJson(event.getMessage(), AddressListBean.DataDTO.RecordsDTO.class); + List list = new ArrayList<>(); + list.add(ad.getProvince()); + list.add(ad.getCity()); + list.add(ad.getArea()); + if (event.getType() == 0) { + os.setDetailAddress(ad.getAddressDetail()); + os.setLoadingName(ad.getContactPerson()); + os.setLoadingPhone(ad.getContactNumber()); + os.setCompanyCode(ad.getCompanyCode()); + os.setCompanyName(ad.getCompanyName()); + os.setLoadingAddress(list); + tvName.setText(ad.getContactPerson()); + tvPhone.setText(ad.getContactNumber()); + tvAddress.setText(ad.getAddressDetail()); +// GetObjectName.ZIModel(address_box,os,con); + } else { + op.setDetailAddress(ad.getAddressDetail()); + op.setLoadingName(ad.getContactPerson()); + op.setLoadingPhone(ad.getContactNumber()); + op.setCompanyCode(ad.getCompanyCode()); + op.setCompanyName(ad.getCompanyName()); + op.setLoadingAddress(list); + tvNameDis.setText(ad.getContactPerson()); + tvPhoneDis.setText(ad.getContactNumber()); + tvAddressDis.setText(ad.getAddressDetail()); +// GetObjectName.ZIModel(address_box,op,con); + } + + addressKey = true; + } + + @Subscribe + public void goodsResult(GoodsEvent event) { + Log.e("返回结果", event.getMessage() + "--"); + if (goodsType == 0) { +// os.setGoods(new ArrayList<>()); + OrderInputBean.SendTableDataDTO.GoodsDTO osg1 = new Gson().fromJson(event.getMessage(), OrderInputBean.SendTableDataDTO.GoodsDTO.class); + if (-1 != updatePosGoods) { + os.getGoods().set(updatePosGoods, osg1); + ryPretend.updateItemV(updatePosGoods, osg1); + + //删除卸货货物信息 + op.getGoods().clear(); + ryDis.delAllDatas(); + + updatePosGoods = -1; + } else { +// os.getGoods().add(osg1); + ryPretend.addItemV(osg1); + + //同步卸货货物 + OrderInputBean.PutTableDataDTO.GoodsDTO goodsDTO = new Gson().fromJson(event.getMessage(), OrderInputBean.PutTableDataDTO.GoodsDTO.class); + op.getGoods().add(goodsDTO); + ryDis.addItemV(goodsDTO); +// ryPretend.notifyDatas(os.getGoods()); +// ryPretend.addItemV(osg1); + } + + } else { +// op.setGoods(new ArrayList<>()); + OrderInputBean.PutTableDataDTO.GoodsDTO osg2 = new Gson().fromJson(event.getMessage(), OrderInputBean.PutTableDataDTO.GoodsDTO.class); + if (-1 != updatePosGoodsDis) { + op.getGoods().set(updatePosGoodsDis, osg2); + ryDis.updateItemV(updatePosGoodsDis, osg2); + updatePosGoodsDis = -1; + } else { + op.getGoods().add(osg2); + ryDis.addItemV(osg2); + } + +// goods_info.setText(osg2.getName()+"|"+osg2.getPackName()+"|"+osg2.getNum()+osg2.getUnit()+"|"+"价值"+osg2.getPrice()+"元"); + } +// goodsKey=true; + } + + public String getRead(int num) { + if (num < 10) { + return "0" + num; + } + return num + ""; + } + + private void submint() { + String name = tvName.getText().toString(); + String nameDis = tvNameDis.getText().toString(); + String money = etMoney.getText().toString(); + String startTim = tvStartTime.getText().toString(); + String endTimeDis = tvEndTimeDis.getText().toString(); + if (TextUtils.isEmpty(name) || TextUtils.isEmpty(nameDis) || + TextUtils.isEmpty(money) || TextUtils.isEmpty(startTim) || + TextUtils.isEmpty(endTimeDis)) { + ToastUtil.show(con, "请完善装卸货信息"); + return; + } + + if (os.getGoods().size() < 1) { + ToastUtil.show(con, "请添加装货物信息"); + return; + } + + if (op.getGoods().size() < 1) { + ToastUtil.show(con, "请添加卸货物信息"); + return; + } + + os.setTotalPrice(Double.parseDouble(money)); + InformationEventTwo msg = new InformationEventTwo(new Gson().toJson(os), new Gson().toJson(op)); + EventBus.getDefault().post(msg); + finish(); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + EventBus.getDefault().unregister(con); + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/home/OrderAllActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/home/OrderAllActivity.java new file mode 100644 index 0000000..921232b --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/home/OrderAllActivity.java @@ -0,0 +1,344 @@ +package com.oneclouds.cargo.ui.home; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.Intent; +import android.graphics.drawable.Drawable; +import android.os.Build; +import android.os.Bundle; +import android.os.Message; +import android.util.Log; +import android.view.View; +import android.widget.Button; +import android.widget.ImageButton; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; + +import com.google.gson.Gson; +import com.lxj.xpopup.XPopup; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.BaseBean; +import com.oneclouds.cargo.bean.UserBean; +import com.oneclouds.cargo.bean.WaybillListBean; +import com.oneclouds.cargo.request.OrderRequest; +import com.oneclouds.cargo.request.WaybillRequest; +import com.oneclouds.cargo.ui.my.invoice.InvoiceCreateActivity; +import com.oneclouds.cargo.ui.parts.UserParts; +import com.oneclouds.cargo.util.StringUtil; +import com.oneclouds.cargo.util.ToastUtil; +import com.oneclouds.cargo.util.adapter.ManyBean; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.http.RequsetCodeConstants; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseActivity; +import com.oneclouds.cargo.util.view.BaseRecyclerView; + +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/16 16:09 + * @description: + */ + +public class OrderAllActivity extends BaseActivity { + + private UserBean user; + private WaybillListBean olb; + private WaybillRequest wr; + private OrderRequest or; + private Gson gson=new Gson(); + private LinearLayout select_type; + private Button submit_invoicing; + private List keys=new ArrayList<>(); + private int num=0; + private Map submit_map=new HashMap<>(); + + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what){ + case RequsetCodeConstants.SUCCESS: + //获取数据 + if (CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2)!=null) { + refreshLayout.finishRefresh(); + refreshLayout.finishLoadMore(); + olb=gson.fromJson(CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2),WaybillListBean.class); + if(olb.getCode()==200){ + if(index==0){ + initView(null); + }else{ + insInit(); + } + }else{ + ToastUtil.show(con,"加载失败"); + } + CacheGroup.cacheList.remove(WaybillRequest.WAYBILL_LIST_V2); + } + //撤销 + if (CacheGroup.cacheList.get(OrderRequest.ORDER_REVOKE)!=null) { + BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(OrderRequest.ORDER_REVOKE),BaseBean.class); + if(bb.getCode()==200){ + ToastUtil.show(con,"撤销成功"); + }else{ + ToastUtil.show(con,bb.getMsg()); + } + CacheGroup.cacheList.remove(OrderRequest.ORDER_REVOKE); + } + //删除 + if (CacheGroup.cacheList.get(OrderRequest.ORDER_DEL)!=null) { + BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(OrderRequest.ORDER_DEL),BaseBean.class); + if(bb.getCode()==200){ + ToastUtil.show(con,"删除成功"); + }else{ + ToastUtil.show(con,bb.getMsg()); + } + CacheGroup.cacheList.remove(OrderRequest.ORDER_DEL); + } + break; + case 13: + //处理修改类型 + if(m.obj.equals("1")){ + ToastUtil.show(con,"派单"); + }else{ + ToastUtil.show(con,"抢单"); + } + break; + default:break; + } + } + + private BaseRecyclerView rv; + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_order_all); + con=this; + rv=findViewById(R.id.brv); + select_type=findViewById(R.id.select_type); + submit_invoicing=findViewById(R.id.submit_invoicing); + user=UserParts.getUser(con); + wr=new WaybillRequest(con,hd); + or=new OrderRequest(con,hd); + //String str=getIntent().getExtras().getString("12"); + submit_invoicing.setOnClickListener(v -> { + if(submit_map.size()>0){ + Intent in=new Intent(con, InvoiceCreateActivity.class); + in.putExtra("list",gson.toJson(submit_map)); + startActivity(in); + }else{ + Toast.makeText(con,"请先选择需要开票的订单",Toast.LENGTH_LONG).show(); + } + }); + initRefreshLoad(); + } + public void initRefreshLoad(){ + refreshLayout=findViewById(R.id.refreshLayout); + refreshLayout.setOnRefreshListener(refreshLayout -> { + index=0; + sum=0; + keys=new ArrayList<>(); + //wr.orderList(1,30,getTime()); + }); + refreshLayout.setOnLoadMoreListener(refreshLayout -> { + Log.e("上拉加载", "次数"+index); + Log.e("index_sum", index+"_"+sum+"_"+user.getData().getWaybillNum()); + if(sum list=new ArrayList<>(); + list.add(new ManyBean(user.getData(), R.layout.order_top)); + keys.add(false); + list.add(new ManyBean(new time(getTimes()), R.layout.order_time)); + for(int i=0;i { + switch (layout){ + case R.layout.order_top: + TextView waybillNum=v.findViewById(R.id.waybillNum); + TextView distance=v.findViewById(R.id.distance); + TextView freight=v.findViewById(R.id.freight); + waybillNum.setText("运单量"+user.getData().getWaybillNum()+"单/订单量"+olb.getData().getNum()+"单"); + distance.setText(StringUtil.isNull(user.getData().getDistance(),"0")); + freight.setText(StringUtil.isNull(user.getData().getFreight(),"0")); + break; + case R.layout.order_item: + WaybillListBean.DataDTO.ListDTO ld= (WaybillListBean.DataDTO.ListDTO) o; + Button btn=v.findViewById(R.id.btn); + ImageView state_img=v.findViewById(R.id.state_img); + ImageButton xuan=v.findViewById(R.id.xuan); + v.setOnClickListener(v12 -> { + Intent in=new Intent(con,OrderDetailsAllActivity.class); + in.putExtra("id",ld.getOrderId()); + startActivity(in); + }); + if (ld.getStatus()!=102005) { + xuan.setVisibility(View.GONE); + }else{ + if(ld.getMakeStatus()==107001){ + state_img.setVisibility(View.VISIBLE); + state_img.setImageResource(R.mipmap.invoicing_state); + }else if(ld.getMakeStatus()==107002){ + xuan.setVisibility(View.GONE); + state_img.setVisibility(View.VISIBLE); + state_img.setImageResource(R.mipmap.invoicing); + }else if(ld.getMakeStatus()==107003){ + state_img.setVisibility(View.VISIBLE); + state_img.setImageResource(R.mipmap.invoicing_no); + }else{ + + } + } + xuan.setOnClickListener(v1 -> { + if(ld.getStatus()==102005){ + if (keys.get(position)) { + xuan.setImageResource(R.mipmap.no_xuan); + keys.set(position,false); + num--; + if(num>0){ + submit_invoicing.setText("提交开票申请("+num+")"); + }else{ + submit_invoicing.setText("提交开票申请"); + } + submit_map.remove(position); + }else{ + xuan.setImageResource(R.mipmap.xuan); + keys.set(position,true); + num++; + if(num>0){ + submit_invoicing.setText("提交开票申请("+num+")"); + }else{ + submit_invoicing.setText("提交开票申请"); + } + submit_map.put(position,gson.toJson(o)); + } + }else{ + Toast.makeText(con,"订单尚未完成无法开票",Toast.LENGTH_LONG).show(); + } + }); + v.setTop(getResources().getDimensionPixelOffset(R.dimen.dp_10)); + if (ld.getStatus()>102002) { + btn.setText("查看运单"); + } + if(ld.getStatus()==102001){ + btn.setText("删除"); + } + btn.setOnClickListener(v1 -> { + if(ld.getStatus()>102002){ + Log.e("查看","查看"); + Intent in=new Intent(con,OrderDetailsActivity.class); + in.putExtra("id",ld.getWaybillId()); + startActivity(in); + }else{ + if(ld.getStatus()==102002){ + new XPopup.Builder(this) + .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + .asConfirm("请确认", "是否撤销此订单?", + "取消", "确认", + () -> { + or.orderRevoke(ld.getOrderId()); + }, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局 + .show(); + }else{ + new XPopup.Builder(this) + .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + .asConfirm("请确认", "是否删除此订单?", + "取消", "确认", + () -> { + Log.e("删除","删除"); + or.orderDelete(ld.getOrderId()); + }, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局 + .show(); + } + } + }); + default:break; + } + }); + } + + public void insInit(){ + List listadd=new ArrayList<>(); + listadd.add(new ManyBean(new time(getTimes()), R.layout.order_time)); + for (WaybillListBean.DataDTO.ListDTO listDTO : olb.getData().getList()) { + listadd.add(new ManyBean(listDTO, R.layout.order_item)); + keys.add(false); + sum++; + } + rv.adds(listadd); + } + + Drawable getDrawable(Context con, int id){ + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + return con.getDrawable(id); + } else { + return con.getResources().getDrawable(id); + } + } + + class time{ + private String timer; + + public time(String timer) { + this.timer = timer; + } + + public String getTimer() { + return timer; + } + + public void setTimer(String timer) { + this.timer = timer; + } + } + + //获取时间 + private int index=0; + + private String getTime(){ + Calendar cal = Calendar.getInstance(); + cal.add(Calendar.MONTH,-index); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); + return sdf.format(cal.getTime()); + } + + private String getTimes(){ + Calendar cal = Calendar.getInstance(); + cal.add(Calendar.MONTH,-index); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月"); + return sdf.format(cal.getTime()); + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/home/OrderComplaintActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/home/OrderComplaintActivity.java new file mode 100644 index 0000000..9e54f7c --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/home/OrderComplaintActivity.java @@ -0,0 +1,116 @@ +package com.oneclouds.cargo.ui.home; + +import android.os.Bundle; +import android.os.Message; +import android.view.View; +import android.widget.Button; +import android.widget.LinearLayout; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; + +import com.google.gson.Gson; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.BaseBean; +import com.oneclouds.cargo.bean.ComplaintBean; +import com.oneclouds.cargo.request.WaybillRequest; +import com.oneclouds.cargo.util.StringUtil; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseActivity; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/8/30 10:05 + * @description: + */ +public class OrderComplaintActivity extends BaseActivity { + + public final static String GET_COMPLAINT="get_complaint"; + public final static String COMPLAINT="complaint"; + private Button tijiao; + private TextView text_body; + private ComplaintBean cb; + private WaybillRequest wr; + private LinearLayout reply_box; + private TextView reply_body,ts; + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what){ + case 200: + if(CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_COMPLAINT)!=null){ + cb=new Gson().fromJson(CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_COMPLAINT),ComplaintBean.class); + if(cb.getCode()==200){ + initView(null); + }else{ + Toast.makeText(con,cb.getMsg(),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(WaybillRequest.WAYBILL_LIST_COMPLAINT); + } + if(CacheGroup.cacheList.get(WaybillRequest.WAYBILL_COMPLAINT_V3)!=null){ + BaseBean bb=new Gson().fromJson(CacheGroup.cacheList.get(WaybillRequest.WAYBILL_COMPLAINT_V3), BaseBean.class); + if(bb.getCode()==200){ + Toast.makeText(con,"保存投诉信息成功",Toast.LENGTH_SHORT).show(); + finish(); + }else{ + Toast.makeText(con,bb.getMsg(),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(WaybillRequest.WAYBILL_COMPLAINT_V3); + } + break; + default:break; + } + } + private boolean key=true; + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_complaint); + con=this; + act=this; + int id=getIntent().getExtras().getInt("id"); + tijiao=findViewById(R.id.tijiao); + text_body=findViewById(R.id.text_body); + reply_box=findViewById(R.id.reply_box); + reply_body=findViewById(R.id.reply_body); + ts=findViewById(R.id.ts); + tijiao.setOnClickListener(v -> { + if(key){ + String body=text_body.getText()+""; + if(!body.equals("")){ + wr.complaint(id,body); + }else{ + Toast.makeText(con,"请先输入内容",Toast.LENGTH_SHORT).show(); + } + }else{ + Toast.makeText(con,"您已经提交过投诉了,请勿重复提交",Toast.LENGTH_SHORT).show(); + } + }); + wr=new WaybillRequest(con,hd); + wr.orderComplaint(id); + } + + @Override + public void initView(Object obj) { + super.initView(obj); + if(cb.getData()!=null && cb.getData().size()>0){ + for(int i=0;i list = new ArrayList<>(); + //list.add(new ManyBean(new model(),R.layout.yundan_start_top)); + list.add(new ManyBean(sob.getData(), R.layout.order_details_content)); + list.add(new ManyBean(sob.getData(), R.layout.order_details_bottom)); + brv.creates(con, list).setOnItemViewListener((position, o, v, layout) -> { + switch (layout) { + case R.layout.order_details_top: + ImageButton return_btn = v.findViewById(R.id.return_btn); + return_btn.setOnClickListener(v1 -> finish()); + break; + case R.layout.order_details_content: + ImageView head_img = v.findViewById(R.id.head_img); + if (ub != null && ub.getData() != null && !ub.getData().getHeadportraitUrl().equals("")) { + Glide.with(con).load(ub.getData().getHeadportraitUrl()).into(head_img); + } + break; + case R.layout.order_details_bottom: + initStartBody(v); + break; + default: + break; + } + }); + + //initLoaction(); + } + + + private boolean iskey = false; + + private void initStartBody(View v) { + LinearLayout jiesuan = v.findViewById(R.id.jiesuan); + sv1 = v.findViewById(R.id.score1); + sv2 = v.findViewById(R.id.score2); + sv1.initView(); + sv2.initView(); + sv1.setScore(5); + //设置是否可以修改评分,默认为true + TextView pl_submit = v.findViewById(R.id.pl_submit); + TextView m_pl_value = v.findViewById(R.id.m_pl_value); + TextView pl_value = v.findViewById(R.id.pl_value); + if (wnb.getData() != null) { + for (EvaluateBean.DataDTO datum : wnb.getData()) { + if (datum.getType() == 1) { + sv1.setScore(datum.getAttitudeScore()); + m_pl_value.setText(datum.getContent()); + pl_submit.setVisibility(View.GONE); + sv1.setUpKey(false); + m_pl_value.setEnabled(false); + } + if (datum.getType() == 0) { + Log.e("分数", datum.getAttitudeScore() + "_"); + sv2.setScore(datum.getAttitudeScore()); + pl_value.setText(datum.getContent()); + } + } + } + sv2.setUpKey(false); + pl_submit.setOnClickListener(v13 -> { + String evaluate = m_pl_value.getText() + ""; + if (id != 0) { + if (evaluate.length() >= 5) { + Log.e("星星", "" + sv1.getScore()); + wr.evaluate(id,m_pl_value.getText()+"",sv1.getScore()); + //new HuoYuanRequset().keepEvaluate(con,hd,sv1.getScore(),m_pl_value.getText()+"",id); + } else { + Toast.makeText(con, "写够5个字才是好司机~", Toast.LENGTH_SHORT).show(); + } + } else { + Toast.makeText(con, "运单尚未结束", Toast.LENGTH_SHORT).show(); + } + }); + Button complaint = v.findViewById(R.id.complaint); + complaint.setOnClickListener(v1 -> { + Intent in = new Intent(con, OrderComplaintActivity.class); + in.putExtra("id", id); + startActivity(in); + }); + BaseRecyclerView bv_zhuang = v.findViewById(R.id.bv_zhuang); + BaseRecyclerView bv_xie = v.findViewById(R.id.bv_xie); + //bv_zhuang.set + List list_zhuang = new ArrayList<>(); + List list_xie = new ArrayList<>(); + for (int i = 0; i < sob.getData().getWayChildren().size(); i++) { + OrderDetailsBean.DataDTO.WayChildrenDTO sdw = sob.getData().getWayChildren().get(i); + if (sdw.getType() == 1) { + sdw.setUpdateTime(StringUtil.isNull((String) sdw.getUpdateTime(), "未装货")); + list_zhuang.add(sdw); + } else { + sdw.setUpdateTime(StringUtil.isNull((String) sdw.getUpdateTime(), "未卸货")); + list_xie.add(sdw); + } + } + bv_zhuang.createV(con, list_zhuang, R.layout.order_details_loading).setOnItemViewListener((position, o, v12) -> { + // + boolean upkey = false; + if (position == 0) { + upkey = true; + } + initZX(upkey, v12, position, o, 0); + }); + bv_xie.createV(con, list_xie, R.layout.order_details_loading).setOnItemViewListener(new AdapterAll.onItemViewListenter() { + @Override + public void onItemView(int position, Object o, View v) { + // + boolean upkey = false; + if (position == (list_xie.size() - 1)) { + upkey = true; + } + initZX(upkey, v, position, o, 1); + } + }); + initSearch(); + } + + public void initZX(boolean key, View v, int position, Object o, int type) { + OrderDetailsBean.DataDTO.WayChildrenDTO sdw = (OrderDetailsBean.DataDTO.WayChildrenDTO) o; + TextView index = v.findViewById(R.id.index); + TextView s_zx = v.findViewById(R.id.s_zx); + TextView j_zx = v.findViewById(R.id.j_zx); + if (type == 1) { + s_zx.setText("实际卸货时间:"); + j_zx.setText("计划卸货时间:"); + } + if (position == 0) { + if (type == 0) { + index.setText("装货地"); + } else { + index.setText("卸货地"); + } + } else { + if (type == 0) { + index.setText("第" + (position + 1) + "装货地"); + } else { + index.setText("第" + (position + 1) + "卸货地"); + } + } + TextView goodName = v.findViewById(R.id.goodName); + TextView goodNum = v.findViewById(R.id.goodNum); + TextView goodUnit = v.findViewById(R.id.goodUnit); + goodName.setText(sdw.getGoods().get(0).getGoodName()); + goodNum.setText(sdw.getGoods().get(0).getGoodNum()); + goodUnit.setText(sdw.getGoods().get(0).getGoodUnit()); + TextView huoyuan_state = v.findViewById(R.id.huoyuan_state); + huoyuan_state.setText("查看凭证"); + huoyuan_state.setOnClickListener(v1 -> { + String wid = sdw.getId() + ""; + Intent in = new Intent(con, GetUploadImageActivity.class); + in.putExtra("sdwStr", gson.toJson(sdw)); + startActivity(in); + }); + } + + @Override + protected void onResume() { + super.onResume(); + map.onResume(); + } + + @Override + protected void onPause() { + super.onPause(); + map.onPause(); + } + + @Override + protected void onDestroy() { + super.onDestroy(); + map.onDestroy(); + } + + @Override + protected void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + //在activity执行onSaveInstanceState时执行mMapView.onSaveInstanceState (outState),保存地图当前的状态 + map.onSaveInstanceState(outState); + } + + private MyLocationStyle myLocationStyle;//地图定位样式 + + private boolean isFirstLocation = true;//第一次定位成功 + + public void initLoaction() { + aMap.getUiSettings().setZoomControlsEnabled(false);//是否可以缩放 + aMap.moveCamera(CameraUpdateFactory.zoomTo(15));//缩放比例 + //地图文字的Z轴指数,设置为2可以将地图底图文字设置在添加的覆盖物之上 + //aMap.setMapTextZIndex(2); + UiSettings uiSettings = aMap.getUiSettings();//地图的UI设置控制器 + uiSettings.setCompassEnabled(false);// 设置指南针是否显示 + uiSettings.setZoomControlsEnabled(false);// 设置缩放按钮是否显示 + uiSettings.setScaleControlsEnabled(true);// 设置比例尺是否显示 + //uiSettings.setRotateGesturesEnabled(true);// 设置地图旋转是否可用 + //uiSettings.setTiltGesturesEnabled(true);// 设置地图倾斜是否可用 + uiSettings.setMyLocationButtonEnabled(true);// 设置默认定位按钮是否显示 + myLocationStyle = new MyLocationStyle(); + //设置连续定位模式下的定位间隔,只在连续定位模式下生效,单次定位模式下不会生效。单位为秒。 + myLocationStyle.interval(3000); + //设置连续定位、蓝点不会移动到地图中心点,定位点依照设备方向旋转,并且蓝点会跟随设备移动。 + //具体场景可根据高德API查看 +// myLocationStyle.myLocationType(MyLocationStyle +// .LOCATION_TYPE_LOCATION_ROTATE_NO_CENTER); + + myLocationStyle.showMyLocation(true);//显示定位蓝点 +// //设置图标 +// myLocationStyle.myLocationIcon(BitmapDescriptorFactory. +// fromResource(R.mipmap.navi_map_gps_locked)); + //设置圆圈颜色 + myLocationStyle.radiusFillColor(0x70ffffff); + //设置边框颜色 + myLocationStyle.strokeColor(0xffffffff); + aMap.setMyLocationStyle(myLocationStyle);//关联myLocationStyle + //监听定位信息的回调 + aMap.setOnMyLocationChangeListener(new OnMyLocationChangeListener()); + //开启定位,设置为true表示启动显示定位蓝点,false表示隐藏定位蓝点并不进行定位,默认false。 + aMap.setMyLocationEnabled(true); +// ld=new LocationGDUtil(con,hd); +// ld.onCreate(); + } + + class OnMyLocationChangeListener implements AMap.OnMyLocationChangeListener { + + @Override //定位信息的回调监听 + public void onMyLocationChange(Location location) { + if (location == null) { + return; + } + Bundle bundle = location.getExtras(); + if (bundle != null && (bundle.getInt("errorCode", -1)) == 0) {//定位成功 + //获取定位数据 + //经度 + double lat = location.getLatitude(); + //纬度 + double lng = location.getLongitude(); + Log.e("定位信息1", location.getLatitude() + ""); + Log.e("定位信息2", location.getLongitude() + ""); + //实现第一次定位成功,将地图中心移动到定位点 + if (isFirstLocation) { + isFirstLocation = false; + CameraUpdate cameraUpdate = CameraUpdateFactory.newLatLngZoom(new + LatLng(lat, lng), 17); + aMap.moveCamera(cameraUpdate);//将地图移动到定位坐标点 + } + } else { + //错误信息 + String error = bundle.get("errorInfo").toString(); + Log.e("Map", error); + } + } + } + + private RouteSearch mRouteSearch;//路线查询器 + private List lists = new ArrayList<>(); + + private void initSearch() { + mRouteSearch = new RouteSearch(this); + //设置数据回调监听器 + mRouteSearch.setRouteSearchListener(new OnRouteSearchListener()); + //设置开始位置坐标点(注意经纬度不能写反,会报错1800(只能规划到中国区域里的地图路线)) + LatLonPoint startPoint = new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()), + Double.parseDouble(sob.getData().getWayChildren().get((0)).getLongitude())); + //设置目的地坐标点 + LatLonPoint endPoint = new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLatitude()), + Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLongitude())); + //查询信息对象 + for (int i = 0; i < sob.getData().getWayChildren().size(); i++) { + if (i != 0 && i != (sob.getData().getWayChildren().size() - 1)) { + LatLonPoint sp = new LatLonPoint(Double.parseDouble(sob.getData().getWayChildren().get(i).getLatitude()), + Double.parseDouble(sob.getData().getWayChildren().get((i)).getLongitude())); + lists.add(sp); + } + } + RouteSearch.FromAndTo fromAndTo = new RouteSearch.FromAndTo(startPoint, endPoint); + //设置搜索参数 1.fromAndTo 路径的起点终点 2.路径规划的策略(这里是驾车模式,具体看高德API) 3.途 + //经点,可选 4.避让区域,可选, 5.避让道路 ,可选 + RouteSearch.DriveRouteQuery query = new + RouteSearch.DriveRouteQuery(fromAndTo, RouteSearch.DRIVING_SINGLE_DEFAULT, lists, null, ""); + //开始异步查询 + mRouteSearch.calculateDriveRouteAsyn(query); + } + + class OnRouteSearchListener implements RouteSearch.OnRouteSearchListener { + + @Override + public void onBusRouteSearched(BusRouteResult busRouteResult, int i) { + + } + + @Override + public void onDriveRouteSearched(DriveRouteResult driveRouteResult, int rCode) { + if (rCode == 1000) {//获取规划路线成功,获取到的是了,路线坐标点的集合 + List paths = driveRouteResult.getPaths(); + //创建存储坐标点的集合 + List latLngs = new ArrayList<>(); + //遍历获取规划的所有路线坐标点 + for (DrivePath mDrivePath : paths) { + for (DriveStep mDriveStep : mDrivePath.getSteps()) { + for (LatLonPoint mLatLonPoint : mDriveStep.getPolyline()) { + latLngs.add(new + LatLng(mLatLonPoint.getLatitude(), mLatLonPoint.getLongitude())); + } + } + } + //先清除一下,避免重复显示 + aMap.clear(); + //绘制起始位置和目的地marker + aMap.addMarker(new MarkerOptions() + .icon(BitmapDescriptorFactory.fromResource(R.mipmap.qi)) + .position(new LatLng(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()), + Double.parseDouble(sob.getData().getWayChildren().get(0).getLongitude())))); + for (int i = 0; i < sob.getData().getWayChildren().size(); i++) { + if (i != 0 && i != (sob.getData().getWayChildren().size() - 1)) { + OrderDetailsBean.DataDTO.WayChildrenDTO sdw = sob.getData().getWayChildren().get(i); + int icon = 0; + if (sdw.getType() == 1) { + icon = R.mipmap.z_loc; + } else { + icon = R.mipmap.x_loc; + } + aMap.addMarker(new MarkerOptions() + .icon(BitmapDescriptorFactory.fromResource(icon)) + .position(new LatLng(Double.parseDouble(sdw.getLatitude()), Double.parseDouble(sdw.getLongitude())))); + } + } + aMap.addMarker(new MarkerOptions() + .icon(BitmapDescriptorFactory.fromResource(R.mipmap.zhong)) + .position(new LatLng(Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLatitude()), + Double.parseDouble(sob.getData().getWayChildren().get((sob.getData().getWayChildren().size() - 1)).getLongitude())))); + //绘制规划路径路线 + aMap.addPolyline(new PolylineOptions() + //路线坐标点的集合 + .addAll(latLngs) + //线的宽度 + .width(8) + .color(getResources().getColor(R.color.teal_200))); + //设置画线的颜色 + + //显示完整包含所有marker地图路线 + LatLngBounds.Builder builder = LatLngBounds.builder(); + for (int i = 0; i < latLngs.size(); i++) { + builder.include(latLngs.get(i)); + } + //显示全部marker,第二个参数是四周留空宽度 + aMap.moveCamera(CameraUpdateFactory.newLatLngBounds(builder.build(), 200)); + LatLng latLng = new LatLng(Double.parseDouble(sob.getData().getWayChildren().get(0).getLatitude()), + Double.parseDouble(sob.getData().getWayChildren().get((0)).getLongitude()));//构造一个位置 + aMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 6)); + } + } + + @Override + public void onWalkRouteSearched(WalkRouteResult walkRouteResult, int i) { + + } + + @Override + public void onRideRouteSearched(RideRouteResult rideRouteResult, int i) { + + } + + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/home/OrderDetailsAllActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/home/OrderDetailsAllActivity.java new file mode 100644 index 0000000..41835ee --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/home/OrderDetailsAllActivity.java @@ -0,0 +1,187 @@ +package com.oneclouds.cargo.ui.home; + +import android.os.Bundle; +import android.os.Message; +import android.text.TextUtils; +import android.util.Log; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; + +import com.google.gson.Gson; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.AlGoodsTypeListBean; +import com.oneclouds.cargo.bean.BusinssTypeBean; +import com.oneclouds.cargo.bean.CarTypeLongBean; +import com.oneclouds.cargo.bean.NpListBean; +import com.oneclouds.cargo.bean.OrderBean; +import com.oneclouds.cargo.request.WaybillRequest; +import com.oneclouds.cargo.ui.parts.TypeParts; +import com.oneclouds.cargo.util.StringUtil; +import com.oneclouds.cargo.util.adapter.ManyBean; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.http.RequsetCodeConstants; +import com.oneclouds.cargo.util.time.Timer; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseActivity; +import com.oneclouds.cargo.util.view.BaseRecyclerView; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/27 15:30 + * @description: + */ +public class OrderDetailsAllActivity extends BaseActivity { + + private WaybillRequest wr; + private OrderBean ob; + private Gson gson=new Gson(); + private BaseRecyclerView brv; + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what) { + case RequsetCodeConstants.SUCCESS: + //获取页面数据 + if (CacheGroup.cacheList.get(WaybillRequest.WAYBILL_GET_ORDER_DETAIL)!=null) { + //sob = gson.fromJson(CacheGroup.cacheList.get(WaybillRequest.WAYBILL_GET_EXECUTE_WATBILL), OrderDetailsBean.class); + ob=gson.fromJson(CacheGroup.cacheList.get(WaybillRequest.WAYBILL_GET_ORDER_DETAIL),OrderBean.class); +// ob.getData().setTotalFreight("");//置为空??? + if(ob.getCode()==200){ + initView(null); + }else{ + Toast.makeText(con, StringUtil.isNull(ob.getMsg(),"出现错误"),Toast.LENGTH_LONG).show(); + } + CacheGroup.cacheList.remove(WaybillRequest.WAYBILL_GET_ORDER_DETAIL); + } + break; + default: + break; + } + } + private int id=0; + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_order_details_all); + setTitle("货源详情"); + con=this; + brv=findViewById(R.id.brv); + id=getIntent().getExtras().getInt("id"); + wr=new WaybillRequest(con,hd); + wr.orderDetailAll(id); + } + + @Override + public void initView(Object obj) { + super.initView(obj); + List list=new ArrayList<>(); + for (OrderBean.DataDTO.SendInfoDTO sendInfoDTO : ob.getData().getSendInfo()) { + list.add(new ManyBean(sendInfoDTO,R.layout.order_details_loading_all)); + } + for (OrderBean.DataDTO.PutInfoDTO putInfoDTO : ob.getData().getPutInfo()) { + list.add(new ManyBean(putInfoDTO,R.layout.order_details_loading_all)); + } + list.add(new ManyBean(ob.getData(),R.layout.order_details_all)); + brv.creates(con,list).setOnItemViewListener((position, o, v, layout) -> { + switch (layout){ + case R.layout.order_details_loading_all: + int type=0; + if(position>(ob.getData().getSendInfo().size()-1)){ + type=1; + } + TextView index = v.findViewById(R.id.index); + TextView j_zx = v.findViewById(R.id.j_zx); + if (type == 1) { + j_zx.setText("计划卸货时间:"); + } + if (position == 0 || position==ob.getData().getSendInfo().size()) { + if (type == 0) { + index.setText("装货地"); + } else { + index.setText("卸货地"); + } + } else { + if (type == 0) { + index.setText("第" + (position + 1) + "装货地"); + } else { + index.setText("第" + (position + 1) + "卸货地"); + } + } + TextView goodName = v.findViewById(R.id.goodName); + TextView goodNum = v.findViewById(R.id.goodNum); + TextView goodUnit = v.findViewById(R.id.goodUnit); + TextView deadline= v.findViewById(R.id.deadline); + String deadlineStr=deadline.getText()+""; + deadline.setText(Timer.formatChange(deadlineStr,"yyyy-MM-dd HH:mm:ss","yyyy-MM-dd HH:mm")); + if(type==0){ + OrderBean.DataDTO.SendInfoDTO ods= (OrderBean.DataDTO.SendInfoDTO) o; + goodName.setText(ods.getGoods().get(0).getGoodName()); + goodNum.setText(ods.getGoods().get(0).getGoodNum()); + goodUnit.setText(ods.getGoods().get(0).getGoodUnit()); + }else{ + OrderBean.DataDTO.PutInfoDTO odp= (OrderBean.DataDTO.PutInfoDTO) o; + goodName.setText(odp.getGoods().get(0).getGoodName()); + goodNum.setText(odp.getGoods().get(0).getGoodNum()); + goodUnit.setText(odp.getGoods().get(0).getGoodUnit()); + } + break; + case R.layout.order_details_all: + OrderBean.DataDTO od= (OrderBean.DataDTO) o; + Log.e("-货源-",gson.toJson(o)); + TextView goodsBigCate=v.findViewById(R.id.goodsBigCate); + TextView alctGoodsType=v.findViewById(R.id.alctGoodsType); + TextView vehicle_type=v.findViewById(R.id.vehicle_type); + TextView vehicle_length=v.findViewById(R.id.vehicle_length); + TextView businessType=v.findViewById(R.id.businessType); + TextView effectiveTime=v.findViewById(R.id.effectiveTime); + TextView totalFreight=v.findViewById(R.id.totalFreight); + TextView isGoods=v.findViewById(R.id.isGoods); + NpListBean nb= TypeParts.getNpType(con); + CarTypeLongBean ctb= TypeParts.getCarTypeLong(con); + AlGoodsTypeListBean ab= TypeParts.getAlType(con); + BusinssTypeBean bb= TypeParts.getBusType(con); + if (!TextUtils.isEmpty(od.getEffectiveTime())){ + effectiveTime.setText(Timer.formatChange(od.getEffectiveTime(),"yyyy-MM-dd HH:mm:ss","yyyy-MM-dd HH:mm")); + } + totalFreight.setText(od.getTotalFreight()); + for (NpListBean.DataDTO datum : nb.getData()) { + if(datum.getId()==od.getGoodsBigCate()){ + goodsBigCate.setText(datum.getCateName()); + } + } + for (AlGoodsTypeListBean.DataDTO datum : ab.getData()) { + if(datum.getId()==od.getAlctGoodsType()){ + alctGoodsType.setText(datum.getName()); + } + } + for (BusinssTypeBean.DataDTO datum : bb.getData()) { + if(datum.getValue()==od.getBusinessType()){ + businessType.setText(datum.getName()); + } + } + for (CarTypeLongBean.DataDTO.LengthDTO lengthDTO : ctb.getData().getLength()) { + if(lengthDTO.getValue()==od.getVehicleLength()){ + vehicle_length.setText(lengthDTO.getName()); + } + } + for (CarTypeLongBean.DataDTO.TypeDTO typeDTO : ctb.getData().getType()) { + if(typeDTO.getValue()==od.getVehicleType()){ + vehicle_type.setText(typeDTO.getName()); + } + } + if(od.getIsInsure()){ + isGoods.setText("是"); + } + break; + } + }); + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/home/OrderListActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/home/OrderListActivity.java new file mode 100644 index 0000000..490236c --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/home/OrderListActivity.java @@ -0,0 +1,99 @@ +package com.oneclouds.cargo.ui.home; + +import android.os.Bundle; +import android.widget.RelativeLayout; + +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentPagerAdapter; +import androidx.viewpager.widget.ViewPager; + +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.UserBean; +import com.oneclouds.cargo.ui.home.typelist.OrderList1Fragment; +import com.oneclouds.cargo.ui.home.typelist.OrderList2Fragment; +import com.oneclouds.cargo.ui.home.typelist.OrderList3Fragment; +import com.oneclouds.cargo.ui.home.typelist.OrderList4Fragment; +import com.oneclouds.cargo.ui.home.typelist.OrderList5Fragment; +import com.oneclouds.cargo.ui.home.typelist.OrderList6Fragment; +import com.oneclouds.cargo.ui.parts.UserParts; +import com.oneclouds.cargo.util.bean.GetObjectName; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseAppCompatActivity; +import com.xuexiang.xui.widget.tabbar.TabSegment; +import java.util.ArrayList; +import java.util.List; + + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/11/9 10:08 + * @description: + */ +public class OrderListActivity extends BaseAppCompatActivity { + + private UserBean user; + private TabSegment ts; + private String[] titles={"全部","待调度","已装货","已卸货","已结算","草稿箱"}; + private ViewPager vp; + + @Override + protected void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_order_list); + con=this; + ts=findViewById(R.id.tabSegment); + vp=findViewById(R.id.vp); + setTitle("全部订单"); + user= UserParts.getUser(con); + initView(null); + } + + List list=new ArrayList<>(); + + @Override + public void initView(Object obj) { + super.initView(obj); + RelativeLayout re=findViewById(R.id.order_list_top); + user.getData().setFreight(""); + GetObjectName.ZIModel(re,user.getData(),con); + list.add(new OrderList1Fragment()); + list.add(new OrderList2Fragment()); + list.add(new OrderList3Fragment()); + list.add(new OrderList4Fragment()); + list.add(new OrderList5Fragment()); + list.add(new OrderList6Fragment()); + for (String page : titles) { + ts.addTab(new TabSegment.Tab(page)); + } + vp.setAdapter(new MyAdapter(getSupportFragmentManager())); + ts.setupWithViewPager(vp, false); + ts.setMode(TabSegment.MODE_FIXED); + } + + class MyAdapter extends FragmentPagerAdapter { + + public MyAdapter(FragmentManager fm) { + super(fm); + } + @Override + public Fragment getItem(int position) { + return list.get(position); + } + + @Override + public int getCount() { + return list.size(); + } + + //重写这个方法,将设置每个Tab的标题 + @Override + public CharSequence getPageTitle(int position) { + return titles[position]; + } + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/home/OrderListFragment.java b/app/src/main/java/com/oneclouds/cargo/ui/home/OrderListFragment.java new file mode 100644 index 0000000..c5249f4 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/home/OrderListFragment.java @@ -0,0 +1,309 @@ +package com.oneclouds.cargo.ui.home; + +import android.content.Intent; +import android.os.Bundle; +import android.os.Message; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.ImageButton; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import com.google.gson.Gson; +import com.lxj.xpopup.XPopup; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.BaseBean; +import com.oneclouds.cargo.bean.WaybillListBean; +import com.oneclouds.cargo.request.OrderRequest; +import com.oneclouds.cargo.request.WaybillRequest; +import com.oneclouds.cargo.util.StringUtil; +import com.oneclouds.cargo.util.ToastUtil; +import com.oneclouds.cargo.util.adapter.ManyBean; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.http.RequsetCodeConstants; +import com.oneclouds.cargo.util.time.Timer; +import com.oneclouds.cargo.util.view.BaseFragment; +import com.oneclouds.cargo.util.view.BaseRecyclerView; +import com.scwang.smart.refresh.layout.SmartRefreshLayout; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/11/9 10:21 + * @description: + */ +public class OrderListFragment extends BaseFragment { + + private int type; + private WaybillListBean olb; + private WaybillRequest wr; + private OrderRequest or; + private Gson gson=new Gson(); + private LinearLayout select_type; + private Button submit_invoicing; + private List keys=new ArrayList<>(); + private Map submit_map=new HashMap<>(); + + private BaseRecyclerView order_brv; + private int index=1; + private int num=0; + private boolean dataKey=true; + private String timer=""; + private SmartRefreshLayout sr; + + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what){ + case RequsetCodeConstants.SUCCESS: + sr.finishRefresh(); + sr.finishLoadMore(); + //获取数据 + if (CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2)!=null) { + Log.e("-list-",CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2)); + olb=gson.fromJson(CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2),WaybillListBean.class); + if(olb.getCode()==200){ + if(index==1){ + initView(null); + }else{ + insInit(); + } + }else{ + ToastUtil.show(con,"加载失败"); + } + CacheGroup.cacheList.remove(WaybillRequest.WAYBILL_LIST_V2); + } + //撤销 + if (CacheGroup.cacheList.get(OrderRequest.ORDER_REVOKE)!=null) { + BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(OrderRequest.ORDER_REVOKE),BaseBean.class); + if(bb.getCode()==200){ + ToastUtil.show(con,"撤销成功"); + }else{ + ToastUtil.show(con,bb.getMsg()); + } + CacheGroup.cacheList.remove(OrderRequest.ORDER_REVOKE); + } + //删除 + if (CacheGroup.cacheList.get(OrderRequest.ORDER_DEL)!=null) { + BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(OrderRequest.ORDER_DEL),BaseBean.class); + if(bb.getCode()==200){ + ToastUtil.show(con,"删除成功"); + }else{ + ToastUtil.show(con,bb.getMsg()); + } + CacheGroup.cacheList.remove(OrderRequest.ORDER_DEL); + } + break; + case 13: + //处理修改类型 + if(m.obj.equals("1")){ + ToastUtil.show(con,"派单"); + }else{ + ToastUtil.show(con,"抢单"); + } + break; + default:break; + } + } + + public OrderListFragment(int type){ + this.type=type; + } + + private Button submit; + + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + root=inflater.inflate(R.layout.fragment_order_list,container,false); + con=getContext(); + act=getActivity(); + Log.e("type","-"+type+"-"); + wr=new WaybillRequest(con,hd); + or=new OrderRequest(con,hd); + order_brv=root.findViewById(R.id.order_brv); + submit=root.findViewById(R.id.submit); + if(type==0 || type==102005){ + submit.setVisibility(View.VISIBLE); + } + initRefreshLoad(); + return root; + } + + @Override + public void initView(Object obj) { + super.initView(obj); + List list=new ArrayList<>(); + for(int i=0;i { + switch (layout){ + case R.layout.order_item: + WaybillListBean.DataDTO.ListDTO ld= (WaybillListBean.DataDTO.ListDTO) o; + Button btn=v.findViewById(R.id.btn); + ImageView state_img=v.findViewById(R.id.state_img); + ImageButton xuan=v.findViewById(R.id.xuan); + v.setOnClickListener(v12 -> { + Intent in=new Intent(con,OrderDetailsAllActivity.class); + in.putExtra("id",ld.getOrderId()); + startActivity(in); + }); + if (ld.getStatus()!=102005) { + xuan.setVisibility(View.GONE); + }else{ + if(ld.getMakeStatus()==107001){ + state_img.setVisibility(View.VISIBLE); + state_img.setImageResource(R.mipmap.invoicing_state); + }else if(ld.getMakeStatus()==107002){ + xuan.setVisibility(View.GONE); + state_img.setVisibility(View.VISIBLE); + state_img.setImageResource(R.mipmap.invoicing); + }else if(ld.getMakeStatus()==107003){ + state_img.setVisibility(View.VISIBLE); + state_img.setImageResource(R.mipmap.invoicing_no); + }else{ + + } + } + xuan.setOnClickListener(v1 -> { + if(ld.getStatus()==102005){ + if (keys.get(position)) { + xuan.setImageResource(R.mipmap.no_xuan); + keys.set(position,false); + num--; + if(num>0){ + submit_invoicing.setText("提交开票申请("+num+")"); + }else{ + submit_invoicing.setText("提交开票申请"); + } + submit_map.remove(position); + }else{ + xuan.setImageResource(R.mipmap.xuan); + keys.set(position,true); + num++; + if(num>0){ + submit_invoicing.setText("提交开票申请("+num+")"); + }else{ + submit_invoicing.setText("提交开票申请"); + } + submit_map.put(position,gson.toJson(o)); + } + }else{ + Toast.makeText(con,"订单尚未完成无法开票",Toast.LENGTH_LONG).show(); + } + }); + v.setTop(getResources().getDimensionPixelOffset(R.dimen.dp_10)); + if (ld.getStatus()>102002) { + btn.setText("查看运单"); + } + if(ld.getStatus()==102001){ + btn.setText("删除"); + } + btn.setOnClickListener(v1 -> { + if(ld.getStatus()>102002){ + Log.e("查看","查看"); + Intent in=new Intent(con,OrderDetailsActivity.class); + in.putExtra("id",ld.getWaybillId()); + startActivity(in); + }else{ + if(ld.getStatus()==102002){ + new XPopup.Builder(getActivity()) + .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + .asConfirm("请确认", "是否撤销此订单?", + "取消", "确认", + () -> { + or.orderRevoke(ld.getOrderId()); + }, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局 + .show(); + }else{ + new XPopup.Builder(getActivity()) + .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + .asConfirm("请确认", "是否删除此订单?", + "取消", "确认", + () -> { + Log.e("删除","删除"); + or.orderDelete(ld.getOrderId()); + }, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局 + .show(); + } + } + }); + default:break; + } + }); + } + + public void insInit(){ + List listadd=new ArrayList<>(); + for (WaybillListBean.DataDTO.ListDTO listDTO : olb.getData().getList()) { + String str=listDTO.getCreateTime(); + str=Timer.formatChange(str,"yyyy-MM-dd HH:mm:ss","yyyy-MM"); + if(!str.equals(timer)){ + timer=str; + listadd.add(new ManyBean(new time(timer),R.layout.order_time)); + } + listadd.add(new ManyBean(listDTO,R.layout.order_item)); + } + order_brv.adds(listadd); + } + + //加载和刷新 + public void initRefreshLoad(){ + sr =root.findViewById(R.id.refreshLayout); + sr.setOnRefreshListener(refreshLayout -> { + Log.e("下拉刷新", "pps"); + index=1; + dataKey=true; + timer=""; + wr.orderList(index,10,type); + }); + sr.setOnLoadMoreListener(refreshLayout -> { + Log.e("上拉加载", "次数"+index); + if(dataKey){ + index++; + wr.orderList(index,10,type); + }else{ + Toast.makeText(con,"没有更多了",Toast.LENGTH_SHORT).show(); + refreshLayout.finishLoadMore(); + } + + }); + sr.autoRefresh(); + } + class time{ + + private String timer; + + public time(String timer) { + this.timer = timer; + } + + public String getTimer() { + return timer; + } + + public void setTimer(String timer) { + this.timer = timer; + } + + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/home/SearchAddressActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/home/SearchAddressActivity.java new file mode 100644 index 0000000..29928c7 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/home/SearchAddressActivity.java @@ -0,0 +1,308 @@ +package com.oneclouds.cargo.ui.home; + +import android.graphics.Point; +import android.os.Bundle; +import android.text.Editable; +import android.text.TextUtils; +import android.text.TextWatcher; +import android.util.Log; +import android.view.View; +import android.view.animation.Interpolator; +import android.widget.ArrayAdapter; +import android.widget.Button; +import android.widget.EditText; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.annotation.Nullable; + +import com.amap.api.location.AMapLocation; +import com.amap.api.location.AMapLocationListener; +import com.amap.api.maps.AMap; +import com.amap.api.maps.CameraUpdateFactory; +import com.amap.api.maps.MapView; +import com.amap.api.maps.model.BitmapDescriptorFactory; +import com.amap.api.maps.model.CameraPosition; +import com.amap.api.maps.model.LatLng; +import com.amap.api.maps.model.Marker; +import com.amap.api.maps.model.MarkerOptions; +import com.amap.api.maps.model.animation.Animation; +import com.amap.api.maps.model.animation.TranslateAnimation; +import com.amap.api.services.core.AMapException; +import com.amap.api.services.core.LatLonPoint; +import com.amap.api.services.geocoder.GeocodeResult; +import com.amap.api.services.geocoder.GeocodeSearch; +import com.amap.api.services.geocoder.RegeocodeQuery; +import com.amap.api.services.geocoder.RegeocodeResult; +import com.amap.api.services.help.Inputtips; +import com.amap.api.services.help.InputtipsQuery; +import com.amap.api.services.help.Tip; +import com.oneclouds.cargo.R; + + +import com.oneclouds.cargo.event.AddressEvent; +import com.oneclouds.cargo.util.GDLocationUtil; +import com.oneclouds.cargo.util.ToastUtil; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseActivity; +import com.oneclouds.cargo.util.view.BaseRecyclerView; +import com.oneclouds.cargo.util.view.DensityUtil; + +import org.greenrobot.eventbus.EventBus; + +import java.util.ArrayList; +import java.util.List; + +/** + * @ClassName ChoiceAddressActivity + * @Author 用户 + * @Date 2022/5/11 11:53 + * @Description TODO + */ +public class SearchAddressActivity extends BaseActivity implements TextWatcher, Inputtips.InputtipsListener, GeocodeSearch.OnGeocodeSearchListener { + + private TextView title; + private EditText etInput; + private Button btnOk; + private MapView map; + private BaseRecyclerView ryPretend; + private GeocodeSearch geocodeSearch; + private AMap aMap; + Marker screenMarker = null; + + @Override + protected void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_search_address); + findAndInitView(savedInstanceState); + con = this; + + initView(null); + } + + + @Override + public void initView(Object obj) { + super.initView(obj); + geocodeSearch = new GeocodeSearch(this); + geocodeSearch.setOnGeocodeSearchListener(this); + } + + private void initData(List list){ + ryPretend.createV(con,list, R.layout.item_search_address).setOnItemViewListener((position, o, v) -> { + Tip bean = (Tip) o; + + LinearLayout llContent = v.findViewById(R.id.llContent); + TextView tvName = v.findViewById(R.id.tvName); + TextView tvAddress = v.findViewById(R.id.tvAddress); + TextView tvDis = v.findViewById(R.id.tvDis); + + tvName.setText(bean.getName()); + tvAddress.setText(bean.getDistrict()+bean.getAddress()); + + llContent.setOnClickListener(v1 -> { + RegeocodeQuery query = new RegeocodeQuery(bean.getPoint(), 100, + GeocodeSearch.AMAP);// 第一个参数表示一个Latlng,第二参数表示范围多少米,第三个参数表示是火系坐标系还是GPS原生坐标系 + geocodeSearch.getFromLocationAsyn(query);// 设置异步逆地理编码请求 + }); + }); + } + + + /** + * 方法必须重写 + */ + @Override + protected void onResume() { + super.onResume(); + map.onResume(); + } + + /** + * 方法必须重写 + */ + @Override + protected void onPause() { + super.onPause(); + map.onPause(); + } + + /** + * 方法必须重写 + */ + @Override + protected void onSaveInstanceState(Bundle outState) { + super.onSaveInstanceState(outState); + map.onSaveInstanceState(outState); + } + /** + * 方法必须重写 + */ + @Override + protected void onDestroy() { + super.onDestroy(); + map.onDestroy(); + } + + + + /** + * 初始化控件 + */ + private void findAndInitView(Bundle savedInstanceState) { + title = findViewById(R.id.title_view); + map = findViewById(R.id.map); + etInput = findViewById(R.id.etInput); + ryPretend = findViewById(R.id.ryPretend); + map.onCreate(savedInstanceState); // 此方法必须重写 + etInput.addTextChangedListener(this); + + if (aMap == null) { + aMap = map.getMap(); + } + title.setText("卸货地址"); + + GDLocationUtil.getInstance().getLocation(this, new AMapLocationListener() { + @Override + public void onLocationChanged(AMapLocation aMapLocation) { + aMap.moveCamera(CameraUpdateFactory.newCameraPosition(new CameraPosition( + new LatLng(aMapLocation.getLatitude(),aMapLocation.getLongitude()),14,30,30))); + searchPoi(aMapLocation.getAoiName()); + } + }); + + aMap.setOnMapLoadedListener(new AMap.OnMapLoadedListener() { + @Override + public void onMapLoaded() { + addMarkerInScreenCenter(); + } + }); + + // 设置可视范围变化时的回调的接口方法 + aMap.setOnCameraChangeListener(new AMap.OnCameraChangeListener() { + @Override + public void onCameraChange(CameraPosition position) { + + } + + @Override + public void onCameraChangeFinish(CameraPosition postion) { + //屏幕中心的Marker跳动 + startJumpAnimation(); + } + }); + } + + + @Override + public void beforeTextChanged(CharSequence s, int start, int count, int after) { + + } + + @Override + public void onTextChanged(CharSequence s, int start, int before, int count) { + String newText = s.toString().trim(); + if (!TextUtils.isEmpty(newText)) { + searchPoi(newText); + } + } + + private void searchPoi(String poi){ + InputtipsQuery inputquery = new InputtipsQuery(poi, ""); + Inputtips inputTips = new Inputtips(this, inputquery); + inputTips.setInputtipsListener(this); + inputTips.requestInputtipsAsyn(); + } + + @Override + public void afterTextChanged(Editable s) { + + } + + @Override + public void onGetInputtips(List list, int i) { +// KeyboardUtils.hideSoftInput(etInput); + if (i == AMapException.CODE_AMAP_SUCCESS) {// 正确返回 + initData(list); + } else { + ToastUtil.show(this, "查询失败"); + } + } + + @Override + public void onRegeocodeSearched(RegeocodeResult regeocodeResult, int i) { + if (i == AMapException.CODE_AMAP_SUCCESS) { + if (regeocodeResult != null && regeocodeResult.getRegeocodeAddress() != null + && regeocodeResult.getRegeocodeAddress().getFormatAddress() != null) { + String province = regeocodeResult.getRegeocodeAddress().getProvince(); + String city = regeocodeResult.getRegeocodeAddress().getCity(); + String formatAddress = regeocodeResult.getRegeocodeAddress().getFormatAddress(); + String country = regeocodeResult.getRegeocodeAddress().getCountry(); + + } else { + ToastUtil.show(this, "未查到结果"); + } + } else { + ToastUtil.show(this, "错误"); + } + } + + @Override + public void onGeocodeSearched(GeocodeResult geocodeResult, int i) { + + } + + + /** + * 在屏幕中心添加一个Marker + */ + private void addMarkerInScreenCenter() { + LatLng latLng = aMap.getCameraPosition().target; + Point screenPosition = aMap.getProjection().toScreenLocation(latLng); + screenMarker = aMap.addMarker(new MarkerOptions() + .anchor(0.5f,0.5f) + .icon(BitmapDescriptorFactory.fromResource(R.drawable.purple_pin))); + //设置Marker在屏幕上,不跟随地图移动 + screenMarker.setPositionByPixels(screenPosition.x,screenPosition.y); + + } + + /** + * 屏幕中心marker 跳动 + */ + public void startJumpAnimation() { + + if (screenMarker != null ) { + //根据屏幕距离计算需要移动的目标点 + final LatLng latLng = screenMarker.getPosition(); + Point point = aMap.getProjection().toScreenLocation(latLng); + point.y -= DensityUtil.dip2px(this,80); + LatLng target = aMap.getProjection() + .fromScreenLocation(point); + //使用TranslateAnimation,填写一个需要移动的目标点 + Animation animation = new TranslateAnimation(target); + animation.setInterpolator(new Interpolator() { + @Override + public float getInterpolation(float input) { + // 模拟重加速度的interpolator + if(input <= 0.5) { + return (float) (0.5f - 2 * (0.5 - input) * (0.5 - input)); + } else { + return (float) (0.5f - Math.sqrt((input - 0.5f)*(1.5f - input))); + } + } + }); + //整个移动所需要的时间 + animation.setDuration(600); + //设置动画 + screenMarker.setAnimation(animation); + //开始动画 + screenMarker.startAnimation(); + + } else { + Log.e("amap","screenMarker is null"); + } + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList1Fragment.java b/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList1Fragment.java new file mode 100644 index 0000000..2eda30f --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList1Fragment.java @@ -0,0 +1,341 @@ +package com.oneclouds.cargo.ui.home.typelist; + +import android.content.Intent; +import android.os.Bundle; +import android.os.Message; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.ImageButton; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import com.google.gson.Gson; +import com.lxj.xpopup.XPopup; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.BaseBean; +import com.oneclouds.cargo.bean.WaybillListBean; +import com.oneclouds.cargo.request.OrderRequest; +import com.oneclouds.cargo.request.WaybillRequest; +import com.oneclouds.cargo.ui.home.OrderDetailsActivity; +import com.oneclouds.cargo.ui.home.OrderDetailsAllActivity; +import com.oneclouds.cargo.ui.my.invoice.InvoiceCreateActivity; +import com.oneclouds.cargo.ui.parts.TypeParts; +import com.oneclouds.cargo.util.ToastUtil; +import com.oneclouds.cargo.util.adapter.AdapterAlls; +import com.oneclouds.cargo.util.adapter.ManyBean; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.http.RequsetCodeConstants; +import com.oneclouds.cargo.util.time.Timer; +import com.oneclouds.cargo.util.view.BaseFragment; +import com.oneclouds.cargo.util.view.BaseRecyclerView; +import com.scwang.smart.refresh.layout.SmartRefreshLayout; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/11/9 10:21 + * @description: + */ +public class OrderList1Fragment extends BaseFragment { + + private int type=0; + private WaybillListBean olb; + private WaybillRequest wr; + private OrderRequest or; + private Gson gson=new Gson(); + private LinearLayout select_type; + private List keys=new ArrayList<>(); + private Map submit_map=new HashMap<>(); + + private BaseRecyclerView order_brv; + private int index=1; + private int num=0; + private boolean dataKey=true; + private String timer=""; + private SmartRefreshLayout sr; + + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what){ + case RequsetCodeConstants.SUCCESS: + sr.finishRefresh(); + sr.finishLoadMore(); + //获取数据 + if (CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2)!=null) { + Log.e("-list-",CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2)); + olb=gson.fromJson(CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2),WaybillListBean.class); + if(olb.getCode()==200){ + if(index==1){ + initData(); + }else{ + addData(); + } + }else{ + ToastUtil.show(con,"加载失败"); + } + CacheGroup.cacheList.remove(WaybillRequest.WAYBILL_LIST_V2); + } + //撤销 + if (CacheGroup.cacheList.get(OrderRequest.ORDER_REVOKE)!=null) { + BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(OrderRequest.ORDER_REVOKE),BaseBean.class); + if(bb.getCode()==200){ + ToastUtil.show(con,"撤销成功"); + }else{ + ToastUtil.show(con,bb.getMsg()); + } + CacheGroup.cacheList.remove(OrderRequest.ORDER_REVOKE); + } + //删除 + if (CacheGroup.cacheList.get(OrderRequest.ORDER_DEL)!=null) { + BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(OrderRequest.ORDER_DEL),BaseBean.class); + if(bb.getCode()==200){ + ToastUtil.show(con,"删除成功"); + }else{ + ToastUtil.show(con,bb.getMsg()); + } + CacheGroup.cacheList.remove(OrderRequest.ORDER_DEL); + } + break; + case 13: + //处理修改类型 + if(m.obj.equals("1")){ + ToastUtil.show(con,"派单"); + }else{ + ToastUtil.show(con,"抢单"); + } + break; + default:break; + } + } + + private Button submit; + + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + root=inflater.inflate(R.layout.fragment_order_list,container,false); + con=getContext(); + act=getActivity(); + Log.e("type","-"+type+"-"); + wr=new WaybillRequest(con,hd); + or=new OrderRequest(con,hd); + order_brv=root.findViewById(R.id.order_brv); + submit=root.findViewById(R.id.submit); + submit.setOnClickListener(v -> { + if(submit_map.size()>0){ + Intent in=new Intent(con, InvoiceCreateActivity.class); + in.putExtra("list",gson.toJson(submit_map)); + startActivity(in); + }else{ + Toast.makeText(con,"请先选择需要开票的订单",Toast.LENGTH_LONG).show(); + } + }); + if(type==0 || type==102005){ + submit.setVisibility(View.VISIBLE); + } + initRefreshLoad(); + initView(null); + return root; + } + + private AdapterAlls aas; + private List list=new ArrayList<>(); + + @Override + public void initView(Object obj) { + super.initView(obj); + aas=order_brv.creates(con,list); + aas.setOnItemViewListener((position, o, v, layout) -> { + switch (layout){ + case R.layout.order_item: + WaybillListBean.DataDTO.ListDTO ld= (WaybillListBean.DataDTO.ListDTO) o; + Button btn=v.findViewById(R.id.btn); + ImageView state_img=v.findViewById(R.id.state_img); + ImageButton xuan=v.findViewById(R.id.xuan); + v.setOnClickListener(v12 -> { + Intent in=new Intent(con, OrderDetailsAllActivity.class); + in.putExtra("id",ld.getOrderId()); + startActivity(in); + }); + if (ld.getStatus()!=102005) { + xuan.setVisibility(View.GONE); + }else{ + if(ld.getMakeStatus()==107001){ + xuan.setVisibility(View.GONE); + state_img.setVisibility(View.VISIBLE); + state_img.setImageResource(R.mipmap.invoicing_state); + }else if(ld.getMakeStatus()==107002){ + xuan.setVisibility(View.GONE); + state_img.setVisibility(View.VISIBLE); + state_img.setImageResource(R.mipmap.invoicing); + }else if(ld.getMakeStatus()==107003){ + state_img.setVisibility(View.VISIBLE); + state_img.setImageResource(R.mipmap.invoicing_no); + }else{ + + } + } + xuan.setOnClickListener(v1 -> { + if(ld.getStatus()==102005){ + if (keys.get(position)) { + xuan.setImageResource(R.mipmap.no_xuan); + keys.set(position,false); + num--; + if(num>0){ + submit.setText("提交开票申请("+num+")"); + }else{ + submit.setText("提交开票申请"); + } + submit_map.remove(position); + }else{ + xuan.setImageResource(R.mipmap.xuan); + keys.set(position,true); + num++; + if(num>0){ + submit.setText("提交开票申请("+num+")"); + }else{ + submit.setText("提交开票申请"); + } + submit_map.put(position,gson.toJson(o)); + } + }else{ + Toast.makeText(con,"订单尚未完成无法开票",Toast.LENGTH_LONG).show(); + } + }); + v.setTop(getResources().getDimensionPixelOffset(R.dimen.dp_10)); + if (ld.getStatus()>102002) { + btn.setText("查看运单"); + } + if(ld.getStatus()==102001){ + btn.setText("删除"); + } + btn.setOnClickListener(v1 -> { + if(ld.getStatus()>102002){ + Log.e("查看","查看"); + Intent in=new Intent(con, OrderDetailsActivity.class); + in.putExtra("id",ld.getWaybillId()); + startActivity(in); + }else{ + if(ld.getStatus()==102002){ + new XPopup.Builder(getActivity()) + .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + .asConfirm("请确认", "是否撤销此订单?", + "取消", "确认", + () -> { + or.orderRevoke(ld.getOrderId()); + }, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局 + .show(); + }else{ + new XPopup.Builder(getActivity()) + .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + .asConfirm("请确认", "是否删除此订单?", + "取消", "确认", + () -> { + Log.e("删除","删除"); + or.orderDelete(ld.getOrderId()); + }, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局 + .show(); + } + } + }); + default:break; + } + }); + } + + int sum=0; + public void initData(){ + list.clear(); + List lists=new ArrayList<>(); + for(int i=0;i lists=new ArrayList<>(); + for (WaybillListBean.DataDTO.ListDTO listDTO : olb.getData().getList()) { + String str=listDTO.getCreateTime(); + str=Timer.formatChange(str,"yyyy-MM-dd HH:mm:ss","yyyy-MM"); + if(!str.equals(timer)){ + timer=str; + lists.add(new ManyBean(new time(timer),R.layout.order_time)); + } + lists.add(new ManyBean(listDTO,R.layout.order_item)); + } + list.addAll(lists); + aas.notifyDataSetChanged(); + } + + //加载和刷新 + public void initRefreshLoad(){ + sr =root.findViewById(R.id.refreshLayout); + sr.setOnRefreshListener(refreshLayout -> { + Log.e("下拉刷新", "pps"); + index=1; + dataKey=true; + timer=""; + wr.orderList(index,10,type); + }); + sr.setOnLoadMoreListener(refreshLayout -> { + Log.e("上拉加载", "次数"+index); + if(dataKey){ + index++; + wr.orderList(index,10,type); + }else{ + Toast.makeText(con,"没有更多了",Toast.LENGTH_SHORT).show(); + refreshLayout.finishLoadMore(); + } + + }); + sr.autoRefresh(); + } + class time{ + + private String timer; + + public time(String timer) { + this.timer = timer; + } + + public String getTimer() { + return timer; + } + + public void setTimer(String timer) { + this.timer = timer; + } + + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList2Fragment.java b/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList2Fragment.java new file mode 100644 index 0000000..29928d0 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList2Fragment.java @@ -0,0 +1,343 @@ +package com.oneclouds.cargo.ui.home.typelist; + +import android.content.Intent; +import android.os.Bundle; +import android.os.Message; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.ImageButton; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import com.google.gson.Gson; +import com.lxj.xpopup.XPopup; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.BaseBean; +import com.oneclouds.cargo.bean.WaybillListBean; +import com.oneclouds.cargo.request.OrderRequest; +import com.oneclouds.cargo.request.WaybillRequest; +import com.oneclouds.cargo.ui.home.OrderDetailsActivity; +import com.oneclouds.cargo.ui.home.OrderDetailsAllActivity; +import com.oneclouds.cargo.ui.my.invoice.InvoiceCreateActivity; +import com.oneclouds.cargo.ui.parts.TypeParts; +import com.oneclouds.cargo.util.StringUtil; +import com.oneclouds.cargo.util.ToastUtil; +import com.oneclouds.cargo.util.adapter.AdapterAlls; +import com.oneclouds.cargo.util.adapter.ManyBean; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.http.RequsetCodeConstants; +import com.oneclouds.cargo.util.time.Timer; +import com.oneclouds.cargo.util.view.BaseFragment; +import com.oneclouds.cargo.util.view.BaseRecyclerView; +import com.scwang.smart.refresh.layout.SmartRefreshLayout; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/11/9 10:21 + * @description: + */ +public class OrderList2Fragment extends BaseFragment { + + private int type=200001; + private WaybillListBean olb; + private WaybillRequest wr; + private OrderRequest or; + private Gson gson=new Gson(); + private LinearLayout select_type; + private List keys=new ArrayList<>(); + private Map submit_map=new HashMap<>(); + + private BaseRecyclerView order_brv; + private int index=1; + private int num=0; + private boolean dataKey=true; + private String timer=""; + private SmartRefreshLayout sr; + + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what){ + case RequsetCodeConstants.SUCCESS: + sr.finishRefresh(); + sr.finishLoadMore(); + //获取数据 + if (CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2)!=null) { + Log.e("-list-",CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2)); + olb=gson.fromJson(CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2),WaybillListBean.class); + if(olb.getCode()==200){ + if(index==1){ + initData(); + }else{ + addData(); + } + }else{ + ToastUtil.show(con,"加载失败"); + } + CacheGroup.cacheList.remove(WaybillRequest.WAYBILL_LIST_V2); + } + //撤销 + if (CacheGroup.cacheList.get(OrderRequest.ORDER_REVOKE)!=null) { + BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(OrderRequest.ORDER_REVOKE),BaseBean.class); + if(bb.getCode()==200){ + ToastUtil.show(con,"撤销成功"); + }else{ + ToastUtil.show(con,bb.getMsg()); + } + CacheGroup.cacheList.remove(OrderRequest.ORDER_REVOKE); + } + //删除 + if (CacheGroup.cacheList.get(OrderRequest.ORDER_DEL)!=null) { + BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(OrderRequest.ORDER_DEL),BaseBean.class); + if(bb.getCode()==200){ + ToastUtil.show(con,"删除成功"); + }else{ + ToastUtil.show(con,bb.getMsg()); + } + CacheGroup.cacheList.remove(OrderRequest.ORDER_DEL); + } + break; + case 13: + //处理修改类型 + if(m.obj.equals("1")){ + ToastUtil.show(con,"派单"); + }else{ + ToastUtil.show(con,"抢单"); + } + break; + default:break; + } + } + + private Button submit; + + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + root=inflater.inflate(R.layout.fragment_order_list,container,false); + con=getContext(); + act=getActivity(); + Log.e("type","-"+type+"-"); + wr=new WaybillRequest(con,hd); + or=new OrderRequest(con,hd); + order_brv=root.findViewById(R.id.order_brv); + submit=root.findViewById(R.id.submit); + submit.setOnClickListener(v -> { + if(submit_map.size()>0){ + Intent in=new Intent(con, InvoiceCreateActivity.class); + in.putExtra("list",gson.toJson(submit_map)); + startActivity(in); + }else{ + Toast.makeText(con,"请先选择需要开票的订单",Toast.LENGTH_LONG).show(); + } + }); + if(type==0 || type==102005){ + submit.setVisibility(View.VISIBLE); + } + initRefreshLoad(); + initView(null); + return root; + } + + private AdapterAlls aas; + private List list=new ArrayList<>(); + + @Override + public void initView(Object obj) { + super.initView(obj); + aas=order_brv.creates(con,list); + aas.setOnItemViewListener((position, o, v, layout) -> { + switch (layout){ + case R.layout.order_item: + WaybillListBean.DataDTO.ListDTO ld= (WaybillListBean.DataDTO.ListDTO) o; + Button btn=v.findViewById(R.id.btn); + ImageView state_img=v.findViewById(R.id.state_img); + ImageButton xuan=v.findViewById(R.id.xuan); + v.setOnClickListener(v12 -> { + Intent in=new Intent(con, OrderDetailsAllActivity.class); + in.putExtra("id",ld.getOrderId()); + startActivity(in); + }); + if (ld.getStatus()!=102005) { + xuan.setVisibility(View.GONE); + }else{ + if(ld.getMakeStatus()==107001){ + xuan.setVisibility(View.GONE); + state_img.setVisibility(View.VISIBLE); + state_img.setImageResource(R.mipmap.invoicing_state); + }else if(ld.getMakeStatus()==107002){ + xuan.setVisibility(View.GONE); + state_img.setVisibility(View.VISIBLE); + state_img.setImageResource(R.mipmap.invoicing); + }else if(ld.getMakeStatus()==107003){ + state_img.setVisibility(View.VISIBLE); + state_img.setImageResource(R.mipmap.invoicing_no); + }else{ + + } + } + xuan.setOnClickListener(v1 -> { + if(ld.getStatus()==102005){ + if (keys.get(position)) { + xuan.setImageResource(R.mipmap.no_xuan); + keys.set(position,false); + num--; + if(num>0){ + submit.setText("提交开票申请("+num+")"); + }else{ + submit.setText("提交开票申请"); + } + submit_map.remove(position); + }else{ + xuan.setImageResource(R.mipmap.xuan); + keys.set(position,true); + num++; + if(num>0){ + submit.setText("提交开票申请("+num+")"); + }else{ + submit.setText("提交开票申请"); + } + submit_map.put(position,gson.toJson(o)); + } + }else{ + Toast.makeText(con,"订单尚未完成无法开票",Toast.LENGTH_LONG).show(); + } + }); + v.setTop(getResources().getDimensionPixelOffset(R.dimen.dp_10)); + if (ld.getStatus()>102002) { + btn.setText("查看运单"); + } + if(ld.getStatus()==102001){ + btn.setText("删除"); + } + btn.setOnClickListener(v1 -> { + if(ld.getStatus()>102002){ + Log.e("查看","查看"); + Intent in=new Intent(con, OrderDetailsActivity.class); + in.putExtra("id",ld.getWaybillId()); + startActivity(in); + }else{ + if(ld.getStatus()==102002){ + new XPopup.Builder(getActivity()) + .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + .asConfirm("请确认", "是否撤销此订单?", + "取消", "确认", + () -> { + or.orderRevoke(ld.getOrderId()); + }, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局 + .show(); + }else{ + new XPopup.Builder(getActivity()) + .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + .asConfirm("请确认", "是否删除此订单?", + "取消", "确认", + () -> { + Log.e("删除","删除"); + or.orderDelete(ld.getOrderId()); + }, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局 + .show(); + } + } + }); + default:break; + } + }); + } + + int sum=0; + public void initData(){ + list.clear(); + List lists=new ArrayList<>(); + for(int i=0;i lists=new ArrayList<>(); + for (WaybillListBean.DataDTO.ListDTO listDTO : olb.getData().getList()) { + String str=listDTO.getCreateTime(); + str=Timer.formatChange(str,"yyyy-MM-dd HH:mm:ss","yyyy-MM"); + if(!str.equals(timer)){ + timer=str; + lists.add(new ManyBean(new time(timer),R.layout.order_time)); + } + lists.add(new ManyBean(listDTO,R.layout.order_item)); + } + list.addAll(lists); + aas.notifyDataSetChanged(); + } + + //加载和刷新 + public void initRefreshLoad(){ + sr =root.findViewById(R.id.refreshLayout); + sr.setOnRefreshListener(refreshLayout -> { + Log.e("下拉刷新", "pps"); + index=1; + dataKey=true; + timer=""; + wr.orderList(index,10,type); + }); + sr.setOnLoadMoreListener(refreshLayout -> { + Log.e("上拉加载", "次数"+index); + if(dataKey){ + index++; + wr.orderList(index,10,type); + }else{ + Toast.makeText(con,"没有更多了",Toast.LENGTH_SHORT).show(); + refreshLayout.finishLoadMore(); + } + + }); + sr.autoRefresh(); + } + class time{ + + private String timer; + + public time(String timer) { + this.timer = timer; + } + + public String getTimer() { + return timer; + } + + public void setTimer(String timer) { + this.timer = timer; + } + + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList3Fragment.java b/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList3Fragment.java new file mode 100644 index 0000000..e2bb966 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList3Fragment.java @@ -0,0 +1,343 @@ +package com.oneclouds.cargo.ui.home.typelist; + +import android.content.Intent; +import android.os.Bundle; +import android.os.Message; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.ImageButton; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import com.google.gson.Gson; +import com.lxj.xpopup.XPopup; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.BaseBean; +import com.oneclouds.cargo.bean.WaybillListBean; +import com.oneclouds.cargo.request.OrderRequest; +import com.oneclouds.cargo.request.WaybillRequest; +import com.oneclouds.cargo.ui.home.OrderDetailsActivity; +import com.oneclouds.cargo.ui.home.OrderDetailsAllActivity; +import com.oneclouds.cargo.ui.my.invoice.InvoiceCreateActivity; +import com.oneclouds.cargo.ui.parts.TypeParts; +import com.oneclouds.cargo.util.StringUtil; +import com.oneclouds.cargo.util.ToastUtil; +import com.oneclouds.cargo.util.adapter.AdapterAlls; +import com.oneclouds.cargo.util.adapter.ManyBean; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.http.RequsetCodeConstants; +import com.oneclouds.cargo.util.time.Timer; +import com.oneclouds.cargo.util.view.BaseFragment; +import com.oneclouds.cargo.util.view.BaseRecyclerView; +import com.scwang.smart.refresh.layout.SmartRefreshLayout; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/11/9 10:21 + * @description: + */ +public class OrderList3Fragment extends BaseFragment { + + private int type=200003; + private WaybillListBean olb; + private WaybillRequest wr; + private OrderRequest or; + private Gson gson=new Gson(); + private LinearLayout select_type; + private List keys=new ArrayList<>(); + private Map submit_map=new HashMap<>(); + + private BaseRecyclerView order_brv; + private int index=1; + private int num=0; + private boolean dataKey=true; + private String timer=""; + private SmartRefreshLayout sr; + + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what){ + case RequsetCodeConstants.SUCCESS: + sr.finishRefresh(); + sr.finishLoadMore(); + //获取数据 + if (CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2)!=null) { + Log.e("-list-",CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2)); + olb=gson.fromJson(CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2),WaybillListBean.class); + if(olb.getCode()==200){ + if(index==1){ + initData(); + }else{ + addData(); + } + }else{ + ToastUtil.show(con,"加载失败"); + } + CacheGroup.cacheList.remove(WaybillRequest.WAYBILL_LIST_V2); + } + //撤销 + if (CacheGroup.cacheList.get(OrderRequest.ORDER_REVOKE)!=null) { + BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(OrderRequest.ORDER_REVOKE),BaseBean.class); + if(bb.getCode()==200){ + ToastUtil.show(con,"撤销成功"); + }else{ + ToastUtil.show(con,bb.getMsg()); + } + CacheGroup.cacheList.remove(OrderRequest.ORDER_REVOKE); + } + //删除 + if (CacheGroup.cacheList.get(OrderRequest.ORDER_DEL)!=null) { + BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(OrderRequest.ORDER_DEL),BaseBean.class); + if(bb.getCode()==200){ + ToastUtil.show(con,"删除成功"); + }else{ + ToastUtil.show(con,bb.getMsg()); + } + CacheGroup.cacheList.remove(OrderRequest.ORDER_DEL); + } + break; + case 13: + //处理修改类型 + if(m.obj.equals("1")){ + ToastUtil.show(con,"派单"); + }else{ + ToastUtil.show(con,"抢单"); + } + break; + default:break; + } + } + + private Button submit; + + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + root=inflater.inflate(R.layout.fragment_order_list,container,false); + con=getContext(); + act=getActivity(); + Log.e("type","-"+type+"-"); + wr=new WaybillRequest(con,hd); + or=new OrderRequest(con,hd); + order_brv=root.findViewById(R.id.order_brv); + submit=root.findViewById(R.id.submit); + submit.setOnClickListener(v -> { + if(submit_map.size()>0){ + Intent in=new Intent(con, InvoiceCreateActivity.class); + in.putExtra("list",gson.toJson(submit_map)); + startActivity(in); + }else{ + Toast.makeText(con,"请先选择需要开票的订单",Toast.LENGTH_LONG).show(); + } + }); + if(type==0 || type==102005){ + submit.setVisibility(View.VISIBLE); + } + initRefreshLoad(); + initView(null); + return root; + } + + private AdapterAlls aas; + private List list=new ArrayList<>(); + + @Override + public void initView(Object obj) { + super.initView(obj); + aas=order_brv.creates(con,list); + aas.setOnItemViewListener((position, o, v, layout) -> { + switch (layout){ + case R.layout.order_item: + WaybillListBean.DataDTO.ListDTO ld= (WaybillListBean.DataDTO.ListDTO) o; + Button btn=v.findViewById(R.id.btn); + ImageView state_img=v.findViewById(R.id.state_img); + ImageButton xuan=v.findViewById(R.id.xuan); + v.setOnClickListener(v12 -> { + Intent in=new Intent(con, OrderDetailsAllActivity.class); + in.putExtra("id",ld.getOrderId()); + startActivity(in); + }); + if (ld.getStatus()!=102005) { + xuan.setVisibility(View.GONE); + }else{ + if(ld.getMakeStatus()==107001){ + xuan.setVisibility(View.GONE); + state_img.setVisibility(View.VISIBLE); + state_img.setImageResource(R.mipmap.invoicing_state); + }else if(ld.getMakeStatus()==107002){ + xuan.setVisibility(View.GONE); + state_img.setVisibility(View.VISIBLE); + state_img.setImageResource(R.mipmap.invoicing); + }else if(ld.getMakeStatus()==107003){ + state_img.setVisibility(View.VISIBLE); + state_img.setImageResource(R.mipmap.invoicing_no); + }else{ + + } + } + xuan.setOnClickListener(v1 -> { + if(ld.getStatus()==102005){ + if (keys.get(position)) { + xuan.setImageResource(R.mipmap.no_xuan); + keys.set(position,false); + num--; + if(num>0){ + submit.setText("提交开票申请("+num+")"); + }else{ + submit.setText("提交开票申请"); + } + submit_map.remove(position); + }else{ + xuan.setImageResource(R.mipmap.xuan); + keys.set(position,true); + num++; + if(num>0){ + submit.setText("提交开票申请("+num+")"); + }else{ + submit.setText("提交开票申请"); + } + submit_map.put(position,gson.toJson(o)); + } + }else{ + Toast.makeText(con,"订单尚未完成无法开票",Toast.LENGTH_LONG).show(); + } + }); + v.setTop(getResources().getDimensionPixelOffset(R.dimen.dp_10)); + if (ld.getStatus()>102002) { + btn.setText("查看运单"); + } + if(ld.getStatus()==102001){ + btn.setText("删除"); + } + btn.setOnClickListener(v1 -> { + if(ld.getStatus()>102002){ + Log.e("查看","查看"); + Intent in=new Intent(con, OrderDetailsActivity.class); + in.putExtra("id",ld.getWaybillId()); + startActivity(in); + }else{ + if(ld.getStatus()==102002){ + new XPopup.Builder(getActivity()) + .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + .asConfirm("请确认", "是否撤销此订单?", + "取消", "确认", + () -> { + or.orderRevoke(ld.getOrderId()); + }, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局 + .show(); + }else{ + new XPopup.Builder(getActivity()) + .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + .asConfirm("请确认", "是否删除此订单?", + "取消", "确认", + () -> { + Log.e("删除","删除"); + or.orderDelete(ld.getOrderId()); + }, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局 + .show(); + } + } + }); + default:break; + } + }); + } + + int sum=0; + public void initData(){ + list.clear(); + List lists=new ArrayList<>(); + for(int i=0;i lists=new ArrayList<>(); + for (WaybillListBean.DataDTO.ListDTO listDTO : olb.getData().getList()) { + String str=listDTO.getCreateTime(); + str=Timer.formatChange(str,"yyyy-MM-dd HH:mm:ss","yyyy-MM"); + if(!str.equals(timer)){ + timer=str; + lists.add(new ManyBean(new time(timer),R.layout.order_time)); + } + lists.add(new ManyBean(listDTO,R.layout.order_item)); + } + list.addAll(lists); + aas.notifyDataSetChanged(); + } + + //加载和刷新 + public void initRefreshLoad(){ + sr =root.findViewById(R.id.refreshLayout); + sr.setOnRefreshListener(refreshLayout -> { + Log.e("下拉刷新", "pps"); + index=1; + dataKey=true; + timer=""; + wr.orderList(index,10,type); + }); + sr.setOnLoadMoreListener(refreshLayout -> { + Log.e("上拉加载", "次数"+index); + if(dataKey){ + index++; + wr.orderList(index,10,type); + }else{ + Toast.makeText(con,"没有更多了",Toast.LENGTH_SHORT).show(); + refreshLayout.finishLoadMore(); + } + + }); + sr.autoRefresh(); + } + class time{ + + private String timer; + + public time(String timer) { + this.timer = timer; + } + + public String getTimer() { + return timer; + } + + public void setTimer(String timer) { + this.timer = timer; + } + + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList4Fragment.java b/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList4Fragment.java new file mode 100644 index 0000000..44152cf --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList4Fragment.java @@ -0,0 +1,343 @@ +package com.oneclouds.cargo.ui.home.typelist; + +import android.content.Intent; +import android.os.Bundle; +import android.os.Message; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.ImageButton; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import com.google.gson.Gson; +import com.lxj.xpopup.XPopup; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.BaseBean; +import com.oneclouds.cargo.bean.WaybillListBean; +import com.oneclouds.cargo.request.OrderRequest; +import com.oneclouds.cargo.request.WaybillRequest; +import com.oneclouds.cargo.ui.home.OrderDetailsActivity; +import com.oneclouds.cargo.ui.home.OrderDetailsAllActivity; +import com.oneclouds.cargo.ui.my.invoice.InvoiceCreateActivity; +import com.oneclouds.cargo.ui.parts.TypeParts; +import com.oneclouds.cargo.util.StringUtil; +import com.oneclouds.cargo.util.ToastUtil; +import com.oneclouds.cargo.util.adapter.AdapterAlls; +import com.oneclouds.cargo.util.adapter.ManyBean; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.http.RequsetCodeConstants; +import com.oneclouds.cargo.util.time.Timer; +import com.oneclouds.cargo.util.view.BaseFragment; +import com.oneclouds.cargo.util.view.BaseRecyclerView; +import com.scwang.smart.refresh.layout.SmartRefreshLayout; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/11/9 10:21 + * @description: + */ +public class OrderList4Fragment extends BaseFragment { + + private int type=200004; + private WaybillListBean olb; + private WaybillRequest wr; + private OrderRequest or; + private Gson gson=new Gson(); + private LinearLayout select_type; + private List keys=new ArrayList<>(); + private Map submit_map=new HashMap<>(); + + private BaseRecyclerView order_brv; + private int index=1; + private int num=0; + private boolean dataKey=true; + private String timer=""; + private SmartRefreshLayout sr; + + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what){ + case RequsetCodeConstants.SUCCESS: + sr.finishRefresh(); + sr.finishLoadMore(); + //获取数据 + if (CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2)!=null) { + Log.e("-list-",CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2)); + olb=gson.fromJson(CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2),WaybillListBean.class); + if(olb.getCode()==200){ + if(index==1){ + initData(); + }else{ + addData(); + } + }else{ + ToastUtil.show(con,"加载失败"); + } + CacheGroup.cacheList.remove(WaybillRequest.WAYBILL_LIST_V2); + } + //撤销 + if (CacheGroup.cacheList.get(OrderRequest.ORDER_REVOKE)!=null) { + BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(OrderRequest.ORDER_REVOKE),BaseBean.class); + if(bb.getCode()==200){ + ToastUtil.show(con,"撤销成功"); + }else{ + ToastUtil.show(con,bb.getMsg()); + } + CacheGroup.cacheList.remove(OrderRequest.ORDER_REVOKE); + } + //删除 + if (CacheGroup.cacheList.get(OrderRequest.ORDER_DEL)!=null) { + BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(OrderRequest.ORDER_DEL),BaseBean.class); + if(bb.getCode()==200){ + ToastUtil.show(con,"删除成功"); + }else{ + ToastUtil.show(con,bb.getMsg()); + } + CacheGroup.cacheList.remove(OrderRequest.ORDER_DEL); + } + break; + case 13: + //处理修改类型 + if(m.obj.equals("1")){ + ToastUtil.show(con,"派单"); + }else{ + ToastUtil.show(con,"抢单"); + } + break; + default:break; + } + } + + private Button submit; + + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + root=inflater.inflate(R.layout.fragment_order_list,container,false); + con=getContext(); + act=getActivity(); + Log.e("type","-"+type+"-"); + wr=new WaybillRequest(con,hd); + or=new OrderRequest(con,hd); + order_brv=root.findViewById(R.id.order_brv); + submit=root.findViewById(R.id.submit); + submit.setOnClickListener(v -> { + if(submit_map.size()>0){ + Intent in=new Intent(con, InvoiceCreateActivity.class); + in.putExtra("list",gson.toJson(submit_map)); + startActivity(in); + }else{ + Toast.makeText(con,"请先选择需要开票的订单",Toast.LENGTH_LONG).show(); + } + }); + if(type==0 || type==102005){ + submit.setVisibility(View.VISIBLE); + } + initRefreshLoad(); + initView(null); + return root; + } + + private AdapterAlls aas; + private List list=new ArrayList<>(); + + @Override + public void initView(Object obj) { + super.initView(obj); + aas=order_brv.creates(con,list); + aas.setOnItemViewListener((position, o, v, layout) -> { + switch (layout){ + case R.layout.order_item: + WaybillListBean.DataDTO.ListDTO ld= (WaybillListBean.DataDTO.ListDTO) o; + Button btn=v.findViewById(R.id.btn); + ImageView state_img=v.findViewById(R.id.state_img); + ImageButton xuan=v.findViewById(R.id.xuan); + v.setOnClickListener(v12 -> { + Intent in=new Intent(con, OrderDetailsAllActivity.class); + in.putExtra("id",ld.getOrderId()); + startActivity(in); + }); + if (ld.getStatus()!=102005) { + xuan.setVisibility(View.GONE); + }else{ + if(ld.getMakeStatus()==107001){ + xuan.setVisibility(View.GONE); + state_img.setVisibility(View.VISIBLE); + state_img.setImageResource(R.mipmap.invoicing_state); + }else if(ld.getMakeStatus()==107002){ + xuan.setVisibility(View.GONE); + state_img.setVisibility(View.VISIBLE); + state_img.setImageResource(R.mipmap.invoicing); + }else if(ld.getMakeStatus()==107003){ + state_img.setVisibility(View.VISIBLE); + state_img.setImageResource(R.mipmap.invoicing_no); + }else{ + + } + } + xuan.setOnClickListener(v1 -> { + if(ld.getStatus()==102005){ + if (keys.get(position)) { + xuan.setImageResource(R.mipmap.no_xuan); + keys.set(position,false); + num--; + if(num>0){ + submit.setText("提交开票申请("+num+")"); + }else{ + submit.setText("提交开票申请"); + } + submit_map.remove(position); + }else{ + xuan.setImageResource(R.mipmap.xuan); + keys.set(position,true); + num++; + if(num>0){ + submit.setText("提交开票申请("+num+")"); + }else{ + submit.setText("提交开票申请"); + } + submit_map.put(position,gson.toJson(o)); + } + }else{ + Toast.makeText(con,"订单尚未完成无法开票",Toast.LENGTH_LONG).show(); + } + }); + v.setTop(getResources().getDimensionPixelOffset(R.dimen.dp_10)); + if (ld.getStatus()>102002) { + btn.setText("查看运单"); + } + if(ld.getStatus()==102001){ + btn.setText("删除"); + } + btn.setOnClickListener(v1 -> { + if(ld.getStatus()>102002){ + Log.e("查看","查看"); + Intent in=new Intent(con, OrderDetailsActivity.class); + in.putExtra("id",ld.getWaybillId()); + startActivity(in); + }else{ + if(ld.getStatus()==102002){ + new XPopup.Builder(getActivity()) + .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + .asConfirm("请确认", "是否撤销此订单?", + "取消", "确认", + () -> { + or.orderRevoke(ld.getOrderId()); + }, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局 + .show(); + }else{ + new XPopup.Builder(getActivity()) + .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + .asConfirm("请确认", "是否删除此订单?", + "取消", "确认", + () -> { + Log.e("删除","删除"); + or.orderDelete(ld.getOrderId()); + }, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局 + .show(); + } + } + }); + default:break; + } + }); + } + + int sum=0; + public void initData(){ + list.clear(); + List lists=new ArrayList<>(); + for(int i=0;i lists=new ArrayList<>(); + for (WaybillListBean.DataDTO.ListDTO listDTO : olb.getData().getList()) { + String str=listDTO.getCreateTime(); + str=Timer.formatChange(str,"yyyy-MM-dd HH:mm:ss","yyyy-MM"); + if(!str.equals(timer)){ + timer=str; + lists.add(new ManyBean(new time(timer),R.layout.order_time)); + } + lists.add(new ManyBean(listDTO,R.layout.order_item)); + } + list.addAll(lists); + aas.notifyDataSetChanged(); + } + + //加载和刷新 + public void initRefreshLoad(){ + sr =root.findViewById(R.id.refreshLayout); + sr.setOnRefreshListener(refreshLayout -> { + Log.e("下拉刷新", "pps"); + index=1; + dataKey=true; + timer=""; + wr.orderList(index,10,type); + }); + sr.setOnLoadMoreListener(refreshLayout -> { + Log.e("上拉加载", "次数"+index); + if(dataKey){ + index++; + wr.orderList(index,10,type); + }else{ + Toast.makeText(con,"没有更多了",Toast.LENGTH_SHORT).show(); + refreshLayout.finishLoadMore(); + } + + }); + sr.autoRefresh(); + } + class time{ + + private String timer; + + public time(String timer) { + this.timer = timer; + } + + public String getTimer() { + return timer; + } + + public void setTimer(String timer) { + this.timer = timer; + } + + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList5Fragment.java b/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList5Fragment.java new file mode 100644 index 0000000..1ab67e8 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList5Fragment.java @@ -0,0 +1,341 @@ +package com.oneclouds.cargo.ui.home.typelist; + +import android.content.Intent; +import android.os.Bundle; +import android.os.Message; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.ImageButton; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import com.google.gson.Gson; +import com.lxj.xpopup.XPopup; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.BaseBean; +import com.oneclouds.cargo.bean.WaybillListBean; +import com.oneclouds.cargo.request.OrderRequest; +import com.oneclouds.cargo.request.WaybillRequest; +import com.oneclouds.cargo.ui.home.OrderDetailsActivity; +import com.oneclouds.cargo.ui.home.OrderDetailsAllActivity; +import com.oneclouds.cargo.ui.my.invoice.InvoiceCreateActivity; +import com.oneclouds.cargo.ui.parts.TypeParts; +import com.oneclouds.cargo.util.ToastUtil; +import com.oneclouds.cargo.util.adapter.AdapterAlls; +import com.oneclouds.cargo.util.adapter.ManyBean; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.http.RequsetCodeConstants; +import com.oneclouds.cargo.util.time.Timer; +import com.oneclouds.cargo.util.view.BaseFragment; +import com.oneclouds.cargo.util.view.BaseRecyclerView; +import com.scwang.smart.refresh.layout.SmartRefreshLayout; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/11/9 10:21 + * @description: + */ +public class OrderList5Fragment extends BaseFragment { + + private int type=102005; + private WaybillListBean olb; + private WaybillRequest wr; + private OrderRequest or; + private Gson gson=new Gson(); + private LinearLayout select_type; + private List keys=new ArrayList<>(); + private Map submit_map=new HashMap<>(); + + private BaseRecyclerView order_brv; + private int index=1; + private int num=0; + private boolean dataKey=true; + private String timer=""; + private SmartRefreshLayout sr; + + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what){ + case RequsetCodeConstants.SUCCESS: + sr.finishRefresh(); + sr.finishLoadMore(); + //获取数据 + if (CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2)!=null) { + Log.e("-list-",CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2)); + olb=gson.fromJson(CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2),WaybillListBean.class); + if(olb.getCode()==200){ + if(index==1){ + initData(); + }else{ + addData(); + } + }else{ + ToastUtil.show(con,"加载失败"); + } + CacheGroup.cacheList.remove(WaybillRequest.WAYBILL_LIST_V2); + } + //撤销 + if (CacheGroup.cacheList.get(OrderRequest.ORDER_REVOKE)!=null) { + BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(OrderRequest.ORDER_REVOKE),BaseBean.class); + if(bb.getCode()==200){ + ToastUtil.show(con,"撤销成功"); + }else{ + ToastUtil.show(con,bb.getMsg()); + } + CacheGroup.cacheList.remove(OrderRequest.ORDER_REVOKE); + } + //删除 + if (CacheGroup.cacheList.get(OrderRequest.ORDER_DEL)!=null) { + BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(OrderRequest.ORDER_DEL),BaseBean.class); + if(bb.getCode()==200){ + ToastUtil.show(con,"删除成功"); + }else{ + ToastUtil.show(con,bb.getMsg()); + } + CacheGroup.cacheList.remove(OrderRequest.ORDER_DEL); + } + break; + case 13: + //处理修改类型 + if(m.obj.equals("1")){ + ToastUtil.show(con,"派单"); + }else{ + ToastUtil.show(con,"抢单"); + } + break; + default:break; + } + } + + private Button submit; + + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + root=inflater.inflate(R.layout.fragment_order_list,container,false); + con=getContext(); + act=getActivity(); + Log.e("type","-"+type+"-"); + wr=new WaybillRequest(con,hd); + or=new OrderRequest(con,hd); + order_brv=root.findViewById(R.id.order_brv); + submit=root.findViewById(R.id.submit); + submit.setOnClickListener(v -> { + if(submit_map.size()>0){ + Intent in=new Intent(con, InvoiceCreateActivity.class); + in.putExtra("list",gson.toJson(submit_map)); + startActivity(in); + }else{ + Toast.makeText(con,"请先选择需要开票的订单",Toast.LENGTH_LONG).show(); + } + }); + if(type==0 || type==102005){ + submit.setVisibility(View.VISIBLE); + } + initRefreshLoad(); + initView(null); + return root; + } + + private AdapterAlls aas; + private List list=new ArrayList<>(); + + @Override + public void initView(Object obj) { + super.initView(obj); + aas=order_brv.creates(con,list); + aas.setOnItemViewListener((position, o, v, layout) -> { + switch (layout){ + case R.layout.order_item: + WaybillListBean.DataDTO.ListDTO ld= (WaybillListBean.DataDTO.ListDTO) o; + Button btn=v.findViewById(R.id.btn); + ImageView state_img=v.findViewById(R.id.state_img); + ImageButton xuan=v.findViewById(R.id.xuan); + v.setOnClickListener(v12 -> { + Intent in=new Intent(con, OrderDetailsAllActivity.class); + in.putExtra("id",ld.getOrderId()); + startActivity(in); + }); + if (ld.getStatus()!=102005) { + xuan.setVisibility(View.GONE); + }else{ + if(ld.getMakeStatus()==107001){ + xuan.setVisibility(View.GONE); + state_img.setVisibility(View.VISIBLE); + state_img.setImageResource(R.mipmap.invoicing_state); + }else if(ld.getMakeStatus()==107002){ + xuan.setVisibility(View.GONE); + state_img.setVisibility(View.VISIBLE); + state_img.setImageResource(R.mipmap.invoicing); + }else if(ld.getMakeStatus()==107003){ + state_img.setVisibility(View.VISIBLE); + state_img.setImageResource(R.mipmap.invoicing_no); + }else{ + + } + } + xuan.setOnClickListener(v1 -> { + if(ld.getStatus()==102005){ + if (keys.get(position)) { + xuan.setImageResource(R.mipmap.no_xuan); + keys.set(position,false); + num--; + if(num>0){ + submit.setText("提交开票申请("+num+")"); + }else{ + submit.setText("提交开票申请"); + } + submit_map.remove(position); + }else{ + xuan.setImageResource(R.mipmap.xuan); + keys.set(position,true); + num++; + if(num>0){ + submit.setText("提交开票申请("+num+")"); + }else{ + submit.setText("提交开票申请"); + } + submit_map.put(position,gson.toJson(o)); + } + }else{ + Toast.makeText(con,"订单尚未完成无法开票",Toast.LENGTH_LONG).show(); + } + }); + v.setTop(getResources().getDimensionPixelOffset(R.dimen.dp_10)); + if (ld.getStatus()>102002) { + btn.setText("查看运单"); + } + if(ld.getStatus()==102001){ + btn.setText("删除"); + } + btn.setOnClickListener(v1 -> { + if(ld.getStatus()>102002){ + Log.e("查看","查看"); + Intent in=new Intent(con, OrderDetailsActivity.class); + in.putExtra("id",ld.getWaybillId()); + startActivity(in); + }else{ + if(ld.getStatus()==102002){ + new XPopup.Builder(getActivity()) + .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + .asConfirm("请确认", "是否撤销此订单?", + "取消", "确认", + () -> { + or.orderRevoke(ld.getOrderId()); + }, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局 + .show(); + }else{ + new XPopup.Builder(getActivity()) + .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + .asConfirm("请确认", "是否删除此订单?", + "取消", "确认", + () -> { + Log.e("删除","删除"); + or.orderDelete(ld.getOrderId()); + }, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局 + .show(); + } + } + }); + default:break; + } + }); + } + + int sum=0; + public void initData(){ + list.clear(); + List lists=new ArrayList<>(); + for(int i=0;i lists=new ArrayList<>(); + for (WaybillListBean.DataDTO.ListDTO listDTO : olb.getData().getList()) { + String str=listDTO.getCreateTime(); + str=Timer.formatChange(str,"yyyy-MM-dd HH:mm:ss","yyyy-MM"); + if(!str.equals(timer)){ + timer=str; + lists.add(new ManyBean(new time(timer),R.layout.order_time)); + } + lists.add(new ManyBean(listDTO,R.layout.order_item)); + } + list.addAll(lists); + aas.notifyDataSetChanged(); + } + + //加载和刷新 + public void initRefreshLoad(){ + sr =root.findViewById(R.id.refreshLayout); + sr.setOnRefreshListener(refreshLayout -> { + Log.e("下拉刷新", "pps"); + index=1; + dataKey=true; + timer=""; + wr.orderList(index,10,type); + }); + sr.setOnLoadMoreListener(refreshLayout -> { + Log.e("上拉加载", "次数"+index); + if(dataKey){ + index++; + wr.orderList(index,10,type); + }else{ + Toast.makeText(con,"没有更多了",Toast.LENGTH_SHORT).show(); + refreshLayout.finishLoadMore(); + } + + }); + sr.autoRefresh(); + } + class time{ + + private String timer; + + public time(String timer) { + this.timer = timer; + } + + public String getTimer() { + return timer; + } + + public void setTimer(String timer) { + this.timer = timer; + } + + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList6Fragment.java b/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList6Fragment.java new file mode 100644 index 0000000..bbb5a12 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/home/typelist/OrderList6Fragment.java @@ -0,0 +1,342 @@ +package com.oneclouds.cargo.ui.home.typelist; + +import android.content.Intent; +import android.os.Bundle; +import android.os.Message; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.ImageButton; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import com.google.gson.Gson; +import com.lxj.xpopup.XPopup; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.BaseBean; +import com.oneclouds.cargo.bean.WaybillListBean; +import com.oneclouds.cargo.request.OrderRequest; +import com.oneclouds.cargo.request.WaybillRequest; +import com.oneclouds.cargo.ui.home.OrderDetailsActivity; +import com.oneclouds.cargo.ui.home.OrderDetailsAllActivity; +import com.oneclouds.cargo.ui.my.invoice.InvoiceCreateActivity; +import com.oneclouds.cargo.ui.parts.TypeParts; +import com.oneclouds.cargo.util.StringUtil; +import com.oneclouds.cargo.util.ToastUtil; +import com.oneclouds.cargo.util.adapter.AdapterAlls; +import com.oneclouds.cargo.util.adapter.ManyBean; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.http.RequsetCodeConstants; +import com.oneclouds.cargo.util.time.Timer; +import com.oneclouds.cargo.util.view.BaseFragment; +import com.oneclouds.cargo.util.view.BaseRecyclerView; +import com.scwang.smart.refresh.layout.SmartRefreshLayout; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/11/9 10:21 + * @description: + */ +public class OrderList6Fragment extends BaseFragment { + + private int type=102001; + private WaybillListBean olb; + private WaybillRequest wr; + private OrderRequest or; + private Gson gson=new Gson(); + private LinearLayout select_type; + private List keys=new ArrayList<>(); + private Map submit_map=new HashMap<>(); + + private BaseRecyclerView order_brv; + private int index=1; + private int num=0; + private boolean dataKey=true; + private String timer=""; + private SmartRefreshLayout sr; + + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what){ + case RequsetCodeConstants.SUCCESS: + sr.finishRefresh(); + sr.finishLoadMore(); + //获取数据 + if (CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2)!=null) { + Log.e("-list-",CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2)); + olb=gson.fromJson(CacheGroup.cacheList.get(WaybillRequest.WAYBILL_LIST_V2),WaybillListBean.class); + if(olb.getCode()==200){ + if(index==1){ + initData(); + }else{ + addData(); + } + }else{ + ToastUtil.show(con,"加载失败"); + } + CacheGroup.cacheList.remove(WaybillRequest.WAYBILL_LIST_V2); + } + //撤销 + if (CacheGroup.cacheList.get(OrderRequest.ORDER_REVOKE)!=null) { + BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(OrderRequest.ORDER_REVOKE),BaseBean.class); + if(bb.getCode()==200){ + ToastUtil.show(con,"撤销成功"); + }else{ + ToastUtil.show(con,bb.getMsg()); + } + CacheGroup.cacheList.remove(OrderRequest.ORDER_REVOKE); + } + //删除 + if (CacheGroup.cacheList.get(OrderRequest.ORDER_DEL)!=null) { + BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(OrderRequest.ORDER_DEL),BaseBean.class); + if(bb.getCode()==200){ + ToastUtil.show(con,"删除成功"); + }else{ + ToastUtil.show(con,bb.getMsg()); + } + CacheGroup.cacheList.remove(OrderRequest.ORDER_DEL); + } + break; + case 13: + //处理修改类型 + if(m.obj.equals("1")){ + ToastUtil.show(con,"派单"); + }else{ + ToastUtil.show(con,"抢单"); + } + break; + default:break; + } + } + + private Button submit; + + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + root=inflater.inflate(R.layout.fragment_order_list,container,false); + con=getContext(); + act=getActivity(); + Log.e("type","-"+type+"-"); + wr=new WaybillRequest(con,hd); + or=new OrderRequest(con,hd); + order_brv=root.findViewById(R.id.order_brv); + submit=root.findViewById(R.id.submit); + submit.setOnClickListener(v -> { + if(submit_map.size()>0){ + Intent in=new Intent(con, InvoiceCreateActivity.class); + in.putExtra("list",gson.toJson(submit_map)); + startActivity(in); + }else{ + Toast.makeText(con,"请先选择需要开票的订单",Toast.LENGTH_LONG).show(); + } + }); + if(type==0 || type==102005){ + submit.setVisibility(View.VISIBLE); + } + initRefreshLoad(); + initView(null); + return root; + } + + private AdapterAlls aas; + private List list=new ArrayList<>(); + + @Override + public void initView(Object obj) { + super.initView(obj); + aas=order_brv.creates(con,list); + aas.setOnItemViewListener((position, o, v, layout) -> { + switch (layout){ + case R.layout.order_item: + WaybillListBean.DataDTO.ListDTO ld= (WaybillListBean.DataDTO.ListDTO) o; + Button btn=v.findViewById(R.id.btn); + ImageView state_img=v.findViewById(R.id.state_img); + ImageButton xuan=v.findViewById(R.id.xuan); + v.setOnClickListener(v12 -> { + Intent in=new Intent(con, OrderDetailsAllActivity.class); + in.putExtra("id",ld.getOrderId()); + startActivity(in); + }); + if (ld.getStatus()!=102005) { + xuan.setVisibility(View.GONE); + }else{ + if(ld.getMakeStatus()==107001){ + xuan.setVisibility(View.GONE); + state_img.setVisibility(View.VISIBLE); + state_img.setImageResource(R.mipmap.invoicing_state); + }else if(ld.getMakeStatus()==107002){ + xuan.setVisibility(View.GONE); + state_img.setVisibility(View.VISIBLE); + state_img.setImageResource(R.mipmap.invoicing); + }else if(ld.getMakeStatus()==107003){ + state_img.setVisibility(View.VISIBLE); + state_img.setImageResource(R.mipmap.invoicing_no); + }else{ + + } + } + xuan.setOnClickListener(v1 -> { + if(ld.getStatus()==102005){ + if (keys.get(position)) { + xuan.setImageResource(R.mipmap.no_xuan); + keys.set(position,false); + num--; + if(num>0){ + submit.setText("提交开票申请("+num+")"); + }else{ + submit.setText("提交开票申请"); + } + submit_map.remove(position); + }else{ + xuan.setImageResource(R.mipmap.xuan); + keys.set(position,true); + num++; + if(num>0){ + submit.setText("提交开票申请("+num+")"); + }else{ + submit.setText("提交开票申请"); + } + submit_map.put(position,gson.toJson(o)); + } + }else{ + Toast.makeText(con,"订单尚未完成无法开票",Toast.LENGTH_LONG).show(); + } + }); + v.setTop(getResources().getDimensionPixelOffset(R.dimen.dp_10)); + if (ld.getStatus()>102002) { + btn.setText("查看运单"); + } + if(ld.getStatus()==102001){ + btn.setText("删除"); + } + btn.setOnClickListener(v1 -> { + if(ld.getStatus()>102002){ + Log.e("查看","查看"); + Intent in=new Intent(con, OrderDetailsActivity.class); + in.putExtra("id",ld.getWaybillId()); + startActivity(in); + }else{ + if(ld.getStatus()==102002){ + new XPopup.Builder(getActivity()) + .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + .asConfirm("请确认", "是否撤销此订单?", + "取消", "确认", + () -> { + or.orderRevoke(ld.getOrderId()); + }, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局 + .show(); + }else{ + new XPopup.Builder(getActivity()) + .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + .asConfirm("请确认", "是否删除此订单?", + "取消", "确认", + () -> { + Log.e("删除","删除"); + or.orderDelete(ld.getOrderId()); + }, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局 + .show(); + } + } + }); + default:break; + } + }); + } + + int sum=0; + public void initData(){ + list.clear(); + List lists=new ArrayList<>(); + for(int i=0;i lists=new ArrayList<>(); + for (WaybillListBean.DataDTO.ListDTO listDTO : olb.getData().getList()) { + String str=listDTO.getCreateTime(); + str=Timer.formatChange(str,"yyyy-MM-dd HH:mm:ss","yyyy-MM"); + if(!str.equals(timer)){ + timer=str; + lists.add(new ManyBean(new time(timer),R.layout.order_time)); + } + lists.add(new ManyBean(listDTO,R.layout.order_item)); + } + list.addAll(lists); + aas.notifyDataSetChanged(); + } + + //加载和刷新 + public void initRefreshLoad(){ + sr =root.findViewById(R.id.refreshLayout); + sr.setOnRefreshListener(refreshLayout -> { + Log.e("下拉刷新", "pps"); + index=1; + dataKey=true; + timer=""; + wr.orderList(index,10,type); + }); + sr.setOnLoadMoreListener(refreshLayout -> { + Log.e("上拉加载", "次数"+index); + if(dataKey){ + index++; + wr.orderList(index,10,type); + }else{ + Toast.makeText(con,"没有更多了",Toast.LENGTH_SHORT).show(); + refreshLayout.finishLoadMore(); + } + + }); + sr.autoRefresh(); + } + class time{ + + private String timer; + + public time(String timer) { + this.timer = timer; + } + + public String getTimer() { + return timer; + } + + public void setTimer(String timer) { + this.timer = timer; + } + + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/map/MAWebViewWrapper.java b/app/src/main/java/com/oneclouds/cargo/ui/map/MAWebViewWrapper.java new file mode 100644 index 0000000..f9ab0bd --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/map/MAWebViewWrapper.java @@ -0,0 +1,125 @@ +package com.oneclouds.cargo.ui.map; + +import android.annotation.SuppressLint; +import android.annotation.TargetApi; +import android.os.Build; +import android.view.View; +import android.view.ViewGroup; +import android.webkit.ValueCallback; +import android.webkit.WebResourceRequest; +import android.webkit.WebResourceResponse; +import android.webkit.WebView; +import android.webkit.WebViewClient; + +//import com.amap.api.maps.IAMapJsCallback; +//import com.amap.api.maps.IAMapWebView; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/11/1 18:39 + * @description: + */ +public class MAWebViewWrapper { + + +// private final WebView webView; +// private WebViewClient mapWebViewClient; +// +// public MAWebViewWrapper(final WebView webView) { +// this.webView = webView; +// if (this.webView != null) { +// this.webView.setWebViewClient( +// new WebViewClient() { +// @TargetApi(Build.VERSION_CODES.N) +// @Override +// public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { +// if (mapWebViewClient != null) { +// boolean flag = mapWebViewClient.shouldOverrideUrlLoading(view, request); +// if (flag) { +// return true; +// } +// +// } +// return super.shouldOverrideUrlLoading(view, request); +// } +// +// @TargetApi(Build.VERSION_CODES.LOLLIPOP) +// @Override +// public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) { +// if (mapWebViewClient != null) { +// WebResourceResponse flag = mapWebViewClient.shouldInterceptRequest(view, request); +// if (flag != null) { +// return flag; +// } +// +// } +// return super.shouldInterceptRequest(view, request); +// } +// +// @Override +// public WebResourceResponse shouldInterceptRequest(WebView view, String url) { +// if (mapWebViewClient != null) { +// WebResourceResponse flag = mapWebViewClient.shouldInterceptRequest(view, url); +// if (flag != null) { +// return flag; +// } +// +// } +// return super.shouldInterceptRequest(view, url); +// } +// } +// ); +// } +// } +// +// @Override +// public void evaluateJavascript(String jsCallSig, ValueCallback callback) { +// if (this.webView != null) { +// this.webView.evaluateJavascript(jsCallSig, callback); +// } +// } +// +// @Override +// public void loadUrl(String toString) { +// if (this.webView != null) { +// this.webView.loadUrl(toString); +// } +// } +// +// @SuppressLint("JavascriptInterface") +// @Override +// public void addAMapJavascriptInterface(IAMapJsCallback object, String javascriptInterfaceName) { +// if (this.webView != null) { +// this.webView.addJavascriptInterface(object, javascriptInterfaceName); +// } +// } +// @Override +// public void setWebViewClient(WebViewClient webViewClient) { +// this.mapWebViewClient = webViewClient; +// } +// +// @Override +// public int getWidth() { +// if (this.webView != null) { +// return this.webView.getWidth(); +// } +// return 0; +// } +// +// @Override +// public int getHeight() { +// if (this.webView != null) { +// this.webView.getHeight(); +// } +// return 0; +// } +// +// +// @Override +// public void addView(View v, ViewGroup.LayoutParams params) { +// if (webView != null && v != null) { +// webView.addView(v, params); +// } +// } +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/map/MyWebView.java b/app/src/main/java/com/oneclouds/cargo/ui/map/MyWebView.java new file mode 100644 index 0000000..447bbed --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/map/MyWebView.java @@ -0,0 +1,73 @@ +package com.oneclouds.cargo.ui.map; + +import android.annotation.SuppressLint; +import android.content.Context; +import android.os.Build; +import android.util.AttributeSet; +import android.webkit.WebChromeClient; +import android.webkit.WebSettings; +import android.webkit.WebView; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/11/1 18:39 + * @description: + */ +public class MyWebView extends WebView { + + public MyWebView(Context context) { + this(context, null); + } + + public MyWebView(Context context, AttributeSet attrs) { + super(context, attrs); + initBridgeWebView(context, attrs); + } + + public MyWebView(Context context, AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + initBridgeWebView(context, attrs); + } + + @SuppressLint("SetJavaScriptEnabled") + private void initBridgeWebView(Context context, AttributeSet attrs) { + WebSettings settings = getSettings(); + + //允许使用js + settings.setJavaScriptEnabled(true); + settings.setDomStorageEnabled(true); + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + //设置适应Html5 + settings.setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); + } + + // 设置WebView属性,能够执行Javascript脚本 + settings.setDefaultTextEncodingName("utf-8"); + + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){ + setWebContentsDebuggingEnabled(true); + } + + // android 4.1 + //允许webview对文件的操作 + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { + settings.setAllowUniversalAccessFromFileURLs(true); + } + settings.setAllowFileAccess(true); + // android 4.1 + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { + settings.setAllowFileAccessFromFileURLs(true); + } + settings.setAllowContentAccess(true); + settings.setDatabaseEnabled(true); + // 允许bolb请求过不了 + settings.setAllowFileAccessFromFileURLs(true); + // 允许本地的缓存 + settings.setAllowUniversalAccessFromFileURLs(true); + + setWebChromeClient(new WebChromeClient()); + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/map/WebMapActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/map/WebMapActivity.java new file mode 100644 index 0000000..2f9d3a2 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/map/WebMapActivity.java @@ -0,0 +1,31 @@ +package com.oneclouds.cargo.ui.map; + +import android.os.Bundle; + +import androidx.annotation.Nullable; + +//import com.amap.api.maps.AMap; +//import com.amap.api.maps.AMapWrapper; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.util.view.BaseActivity; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/11/1 18:53 + * @description: + */ +public class WebMapActivity extends BaseActivity { + private MyWebView web_map; + @Override + protected void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.web_map); + web_map=findViewById(R.id.web_map); +// AMapWrapper aMapWrapper = new AMapWrapper(this,new MAWebViewWrapper(web_map)); +// aMapWrapper.onCreate(); +// aMapWrapper.getMapAsyn(map -> { +// //todo +// }); + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/my/AddressActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/my/AddressActivity.java new file mode 100644 index 0000000..fcc6071 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/my/AddressActivity.java @@ -0,0 +1,205 @@ +package com.oneclouds.cargo.ui.my; + +import android.content.Intent; +import android.os.Bundle; +import android.os.Message; +import android.view.View; +import android.widget.Button; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.cardview.widget.CardView; + +import com.google.gson.Gson; +import com.lxj.xpopup.XPopup; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.AddressListBean; +import com.oneclouds.cargo.event.AddressEvent; +import com.oneclouds.cargo.request.AddressRequest; +import com.oneclouds.cargo.ui.home.ChoiceAddressActivity; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseActivity; +import com.oneclouds.cargo.util.view.BaseRecyclerView; +import com.xuexiang.xui.widget.tabbar.TabControlView; + +import org.greenrobot.eventbus.EventBus; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/13 18:46 + * @description: + */ +public class AddressActivity extends BaseActivity{ + + private AddressListBean alb; + private BaseRecyclerView brv; + private ImageView null_img; + private CardView add_address; + private AddressRequest ar; + private Gson gson=new Gson(); + private int type=0; + private int typeCode=300001; + private TextView type_view; + private TabControlView tab; + private TextView title_view; + private boolean key=true; + + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what){ + case 200: + if(CacheGroup.cacheList.get(AddressRequest.ADDRESS_FIND_PAGE_MY_SELF)!=null){ + alb=gson.fromJson(CacheGroup.cacheList.get(AddressRequest.ADDRESS_FIND_PAGE_MY_SELF),AddressListBean.class); + if(alb.getCode()==200){ + initData(); + }else{ + Toast.makeText(con,alb.getMsg(),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(AddressRequest.ADDRESS_FIND_PAGE_MY_SELF); + } + if(CacheGroup.cacheList.get(AddressRequest.ADDRESS_DELETE)!=null){ + alb=gson.fromJson(CacheGroup.cacheList.get(AddressRequest.ADDRESS_DELETE),AddressListBean.class); + if(alb.getCode()==200){ + Toast.makeText(con,"删除成功",Toast.LENGTH_SHORT).show(); + finish(); + }else{ + Toast.makeText(con,alb.getMsg(),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(AddressRequest.ADDRESS_DELETE); + } + break; + } + } + + @Override + protected void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + con=this; + act=this; + setContentView(R.layout.activity_address_switch); + brv=findViewById(R.id.brv); + null_img=findViewById(R.id.null_img); + add_address=findViewById(R.id.add_address); + type_view=findViewById(R.id.type_view); + tab=findViewById(R.id.tcv_select); + title_view=findViewById(R.id.title_view); + ar=new AddressRequest(con,hd); + + type=getIntent().getExtras().getInt("type"); + key=getIntent().getExtras().getBoolean("key"); + if(key && type!=2){ + tab.setVisibility(View.VISIBLE); + try { + tab.setItems(new String[]{"装货地址","卸货地址"},new String[]{"300001","300002"}); + tab.setDefaultSelection(0); + tab.setOnTabSelectionChangedListener((title, value) -> { + typeCode=Integer.parseInt(value); + ar.addressFindPageMySelf(1,1000,typeCode); + title_view.setText(title); + }); + } catch (Exception e) { + e.printStackTrace(); + } + } + switch (type){ + case 0: + setTitle("装货地址"); + type_view.setText("新增装货地址"); + typeCode=300001; + break; + case 1: + setTitle("卸货地址"); + type_view.setText("新增卸货地址"); + typeCode=300002; + break; + case 2: + setTitle("发票邮寄地址"); + type_view.setText("新增发票邮寄地址"); + typeCode=300003; + break; + } + initView(null); + ar.addressFindPageMySelf(1,1000,typeCode); + } + + @Override + public void initView(Object obj) { + super.initView(obj); + } + + public void initData(){ + if(alb.getData().getRecords().size()>0){ + null_img.setVisibility(View.GONE); + } + brv.createV(con,alb.getData().getRecords(), R.layout.item_address).setOnItemViewListener((position, o, v) -> { + initAddress(v); + AddressListBean.DataDTO.RecordsDTO ads= (AddressListBean.DataDTO.RecordsDTO) o; + TextView addressDetail=v.findViewById(R.id.addressDetail); + addressDetail.setText(ads.getProvinceName()+ads.getCityName()+ads.getAreaName()+ads.getAddressDetail()); + v.setOnClickListener(v1 -> { + if(!key){ + AddressEvent msg=new AddressEvent(new Gson().toJson(o),type); + EventBus.getDefault().post(msg); + finish(); + }else{ +// Intent in=new Intent(con,AddressAddActivity.class); +// in.putExtra("typeCode",typeCode); +// in.putExtra("addressData",gson.toJson(ads)); +// startActivity(in); + Intent in=new Intent(con,ChoiceAddressActivity.class); + in.putExtra("typeCode",typeCode); + in.putExtra("addressData",gson.toJson(ads)); + startActivity(in); + } + }); + Button up_address=v.findViewById(R.id.up_address); + up_address.setOnClickListener(v12 -> { + new XPopup.Builder(act) + .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + .asConfirm("请确认", "是否确定删除这个地址?", + "取消", "确认", + () -> { + ar.addressDelete(alb.getData().getRecords().get(position).getId()); + }, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局 + .show(); + }); + LinearLayout up_box=v.findViewById(R.id.up_box); + up_box.setOnClickListener(v1 -> { +// Intent in=new Intent(con,AddressAddActivity.class); + Intent in=new Intent(con,ChoiceAddressActivity.class); + in.putExtra("typeCode",typeCode); + in.putExtra("addressData",gson.toJson(ads)); + startActivity(in); + }); + }); + add_address.setOnClickListener(v -> { +// Intent in=new Intent(con,AddressAddActivity.class); + Intent in=new Intent(con, ChoiceAddressActivity.class); + in.putExtra("typeCode",typeCode); + in.putExtra("addressData",""); + startActivity(in); + }); + } + + public void initAddress(View v){ + Button up_address=v.findViewById(R.id.up_address); + up_address.setOnClickListener(v1 -> { + Intent in=new Intent(con, AddressAddActivity.class); + startActivity(in); + }); + } + + @Override + protected void onResume() { + super.onResume(); + ar.addressFindPageMySelf(1,1000,typeCode); + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/my/AddressAddActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/my/AddressAddActivity.java new file mode 100644 index 0000000..f131072 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/my/AddressAddActivity.java @@ -0,0 +1,212 @@ +package com.oneclouds.cargo.ui.my; + +import android.os.Bundle; +import android.os.Message; +import android.view.View; +import android.widget.Button; +import android.widget.EditText; +import android.widget.LinearLayout; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; + +import com.github.gzuliyujiang.wheelpicker.AddressPicker; +import com.github.gzuliyujiang.wheelpicker.annotation.AddressMode; +import com.github.gzuliyujiang.wheelpicker.utility.AddressJsonParser; +import com.google.gson.Gson; +import com.lxj.xpopup.XPopup; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.AddressListBean; +import com.oneclouds.cargo.bean.BaseBean; +import com.oneclouds.cargo.request.AddressRequest; +import com.oneclouds.cargo.request.bean.AddressInputBean; +import com.oneclouds.cargo.ui.parts.UserParts; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseActivity; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/13 19:45 + * @description: + */ + +public class AddressAddActivity extends BaseActivity { + + private EditText detailAddress,contactNumber,contactPerson; + private TextView province,city,county; + private Button submit; + private LinearLayout loadingAddress_box; + private TextView type,name_title,phone_title; + + private AddressRequest ar; + private AddressInputBean aib=new AddressInputBean(); + private AddressListBean.DataDTO.RecordsDTO adr; + private String str=""; + private Gson gson=new Gson(); + private int typeCode; + private TextView delete; + + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what){ + case 200: + if(CacheGroup.cacheList.get(AddressRequest.ADDRESS_SAVE)!=null){ + BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(AddressRequest.ADDRESS_SAVE),BaseBean.class); + if(bb.getCode()==200){ + if(key){ + Toast.makeText(con,"修改成功",Toast.LENGTH_SHORT).show(); + }else{ + Toast.makeText(con,"添加成功",Toast.LENGTH_SHORT).show(); + } + finish(); + }else{ + Toast.makeText(con,bb.getMsg(),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(AddressRequest.ADDRESS_SAVE); + } + if(CacheGroup.cacheList.get(AddressRequest.ADDRESS_DELETE)!=null){ + BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(AddressRequest.ADDRESS_DELETE),BaseBean.class); + if(bb.getCode()==200){ + Toast.makeText(con,"删除成功",Toast.LENGTH_SHORT).show(); + finish(); + }else{ + Toast.makeText(con,bb.getMsg(),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(AddressRequest.ADDRESS_DELETE); + } + default:break; + } + } + + private boolean key=false; + + @Override + protected void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_address_add); + con=this; + act=this; + loadingAddress_box=findViewById(R.id.loadingAddress_box); + submit=findViewById(R.id.submit); + province=findViewById(R.id.province); + city=findViewById(R.id.city); + county=findViewById(R.id.county); + detailAddress=findViewById(R.id.detailAddress); + contactNumber=findViewById(R.id.contactNumber); + contactPerson=findViewById(R.id.contactPerson); + name_title=findViewById(R.id.name_title); + phone_title=findViewById(R.id.phone_title); + type=findViewById(R.id.type); + delete=findViewById(R.id.delete); + typeCode=getIntent().getExtras().getInt("typeCode"); + ar=new AddressRequest(con,hd); + str=getIntent().getExtras().getString("addressData"); + if(!str.equals("")){ + key=true; + adr=gson.fromJson(str,AddressListBean.DataDTO.RecordsDTO.class); + type.setText("编辑地址"); + initAddress(); + } + if(typeCode==300003){ + name_title.setText("收件人姓名"); + phone_title.setText("收件人手机号"); + } + initView(null); + } + + public void initAddress(){ + aib.setProvince(adr.getProvince()); + aib.setCity(adr.getCity()); + aib.setArea(adr.getArea()); + aib.setAddressDetail(adr.getAddressDetail()); + aib.setContactNumber(adr.getContactNumber()); + aib.setContactPerson(adr.getContactPerson()); + province.setText(adr.getProvinceName()); + city.setText(adr.getCityName()); + county.setText(adr.getAreaName()); + detailAddress.setText(adr.getAddressDetail()); + contactNumber.setText(adr.getContactNumber()); + contactPerson.setText(adr.getContactPerson()); + aib.setId(adr.getId()); + delete.setVisibility(View.VISIBLE); + delete.setOnClickListener(v -> { + new XPopup.Builder(act) + .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + .asConfirm("请确认", "是否确定删除这个地址?", + "取消", "确认", + () -> { + ar.addressDelete(adr.getId()); + }, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局 + .show(); + }); + } + + @Override + public void initView(Object obj) { + super.initView(obj); + loadingAddress_box.setOnClickListener(v -> { + AddressPicker picker = new AddressPicker(this); + picker.setAddressMode("province.json", AddressMode.PROVINCE_CITY_COUNTY, + new AddressJsonParser.Builder() + .provinceCodeField("code") + .provinceNameField("name") + .provinceChildField("city") + .cityCodeField("code") + .cityNameField("name") + .cityChildField("area") + .countyCodeField("code") + .countyNameField("name") + .build()); + //picker.setDefaultValue("河南省", "周口市", "项城市"); + picker.setOnAddressPickedListener((province, city, county) -> { + this.province.setText(province.getName()); + this.city.setText(city.getName()); + this.county.setText(county.getName()); + aib.setProvince(Integer.parseInt(province.getCode())); + aib.setCity(Integer.parseInt(city.getCode())); + aib.setArea(Integer.parseInt(county.getCode())); + + aib.setProvinceS(province.getName()); + aib.setCityS(city.getName()); + aib.setAreaS(county.getName()); + }); + picker.show(); + }); + submit.setOnClickListener(v -> { + String a5=contactNumber.getText()+""; + if(isGetTextNull()){ + if(a5.startsWith("1") && a5.length()==11){ + aib.setAddressType(typeCode); + ar.addressSave(aib); + }else{ + Toast.makeText(con,"手机号格式不正确",Toast.LENGTH_SHORT).show(); + } + }else{ + Toast.makeText(con,"地址信息不得为空",Toast.LENGTH_SHORT).show(); + } + }); + } + + public boolean isGetTextNull(){ + String a1=province.getText()+""; + String a2=city.getText()+""; + String a3=county.getText()+""; + String a4=detailAddress.getText()+""; + String a5=contactNumber.getText()+""; + String a6=contactPerson.getText()+""; + aib.setAddressDetail(a4); + aib.setContactNumber(a5); + aib.setContactPerson(a6); + aib.setUserId(UserParts.getUser(con).getData().getId()); + if(!a1.equals("") && !a2.equals("") && !a3.equals("") && !a4.equals("") && !a5.equals("") && !a6.equals("")){ + return true; + } + return false; + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/my/MyFragment.java b/app/src/main/java/com/oneclouds/cargo/ui/my/MyFragment.java new file mode 100644 index 0000000..b353d32 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/my/MyFragment.java @@ -0,0 +1,223 @@ +package com.oneclouds.cargo.ui.my; + +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.os.Message; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.LinearLayout; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import com.bumptech.glide.Glide; +import com.google.gson.Gson; +import com.lxj.xpopup.XPopup; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.UserBean; +import com.oneclouds.cargo.request.PublicRequest; +import com.oneclouds.cargo.ui.WebActivity; + +import com.oneclouds.cargo.ui.home.OrderListActivity; +import com.oneclouds.cargo.ui.my.auth.MyAuthActivity; +import com.oneclouds.cargo.ui.my.invoice.InvoiceActivity; +import com.oneclouds.cargo.ui.parts.ConfigParts; +import com.oneclouds.cargo.ui.parts.UserParts; +import com.oneclouds.cargo.util.StringUtil; + +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.view.BaseFragment; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/13 9:59 + * @description: + */ +public class MyFragment extends BaseFragment { + + private UserBean ub; + private String url=""; + private PublicRequest pr; + private Gson gson=new Gson(); + + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what){ + case 200: + if(CacheGroup.cacheList.get(PublicRequest.USER_DATA)!=null){ + refreshLayout.finishRefresh(); + UserBean u=gson.fromJson(CacheGroup.cacheList.get(PublicRequest.USER_DATA),UserBean.class); + if (ub.getCode()==200) { + ub=u; + UserParts.setUser(con,ub); + initAuth(); + } + CacheGroup.cacheList.remove(CacheGroup.cacheList.get(PublicRequest.USER_DATA)); + } + break; + } + } + + @Override + public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { + root=inflater.inflate(R.layout.my,container,false); + con=getContext(); + act=getActivity(); + ub=UserParts.getUser(con); + pr=new PublicRequest(con,hd); + initView(null); + initRefreshLoad(); + initId(); + return root; + } + + public void initRefreshLoad(){ + refreshLayout=root.findViewById(R.id.srl); + refreshLayout.setOnRefreshListener(refreshLayout -> { + pr.getUserInfo(); + }); + } + + @Override + public void initView(Object obj) { + super.initView(obj); + initId(); + pr.getUserInfo(); + } + + + private LinearLayout onGetUser,onAllOrder,onAuth,onDriverHome; + private ImageView onContact,onOpinion,onUpdate,onSetUp; + private TextView name,phone; + private ImageView dang_auth,no_auth,name_auth; + private LinearLayout auth_box; + private ImageView img_head; + private LinearLayout ll_type_1,ll_type_2,ll_type_3,ll_type_4; + public void initId(){ + // + name=root.findViewById(R.id.name); + phone=root.findViewById(R.id.phone); + dang_auth=root.findViewById(R.id.dang_auth); + no_auth=root.findViewById(R.id.no_auth); + name_auth=root.findViewById(R.id.name_auth); + auth_box=root.findViewById(R.id.auth_box); + // + onGetUser=root.findViewById(R.id.onGetUser); + onAllOrder=root.findViewById(R.id.onAllOrder); + onAuth=root.findViewById(R.id.onAuth); + onDriverHome=root.findViewById(R.id.onDriverHome); + onContact=root.findViewById(R.id.onContact); + onOpinion=root.findViewById(R.id.onOpinion); + onUpdate=root.findViewById(R.id.onUpdate); + onSetUp=root.findViewById(R.id.onSetUp); + img_head=root.findViewById(R.id.img_head); + // + ll_type_1=root.findViewById(R.id.ll_type_1); + ll_type_2=root.findViewById(R.id.ll_type_2); + ll_type_3=root.findViewById(R.id.ll_type_3); + ll_type_4=root.findViewById(R.id.ll_type_4); + ll_type_1.setOnClickListener(v -> { + Intent in=new Intent(con, OrderListActivity.class); + startActivity(in); + }); + ll_type_2.setOnClickListener(v -> { + Intent in=new Intent(con, OrderListActivity.class); + startActivity(in); + }); + ll_type_3.setOnClickListener(v -> { + Intent in=new Intent(con, OrderListActivity.class); + startActivity(in); + }); + ll_type_4.setOnClickListener(v -> { + Intent in=new Intent(con, OrderListActivity.class); + startActivity(in); + }); + //用户信息 + onGetUser.setOnClickListener(v -> { + Intent in=new Intent(con,MyAuthActivity.class); + in.putExtra("url",url); + startActivity(in); + }); + //常用地址 + onAllOrder.setOnClickListener(v -> { + Intent in=new Intent(con,AddressActivity.class); + in.putExtra("type",0); + in.putExtra("key",true); + startActivity(in); + }); + //认证中心 + onAuth.setOnClickListener(v -> { + Intent in=new Intent(con,MyAuthActivity.class); + in.putExtra("url",url); + startActivity(in); + }); + //发票管理InvoiceActivity + onDriverHome.setOnClickListener(v -> startActivity(new Intent(con, InvoiceActivity.class))); + //联系我们 + onContact.setOnClickListener(v -> { + String serviceMobile=""; + if(ConfigParts.getConfigParts(con)!=null){ + serviceMobile=ConfigParts.getConfigParts(con).getData().getServiceMobile(); + serviceMobile=StringUtil.isNull(serviceMobile,""); + } + String[] title={"平台客服:"+serviceMobile,"银行客服:95528","技术咨询:13460042961"}; + String[] value={serviceMobile,"95528","13460042961"}; + new XPopup.Builder(con) + .isDarkTheme(false) + .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + .asCenterList("请选择",title, + (position1, text) -> { + Intent intent = new Intent(Intent.ACTION_DIAL); + Uri data = Uri.parse("tel:" + value[position1]); + intent.setData(data); + startActivity(intent); + }) + .show(); + }); + //咨询建议 + onOpinion.setOnClickListener(v -> { + Intent in=new Intent(con, WebActivity.class); + in.putExtra("title","咨询建议"); + in.putExtra("url",""); + startActivity(in); + }); + //检查更新 + onUpdate.setOnClickListener(v -> Toast.makeText(con,"当前已经是最新版本",Toast.LENGTH_LONG).show()); + //系统设置 + onSetUp.setOnClickListener(v -> startActivity(new Intent(con, SetupActivity.class))); + no_auth.setOnClickListener(v -> { + Intent in=new Intent(con,MyAuthActivity.class); + in.putExtra("url",url); + startActivity(in); + }); + } + + public void initAuth(){ + if(ub.getData()!=null){ + name.setText(StringUtil.isNull(ub.getData().getUname(),"未实名")); + phone.setText(StringUtil.isNull(ub.getData().getRname(),"")); + if(2==ub.getData().getPartyMemberStatus()){ + + } + if (!"".equals(ub.getData().getHeadportraitUrl())){ + url=ub.getData().getHeadportraitUrl(); + Glide.with(con).load(ub.getData().getHeadportraitUrl()).into(img_head); + } + if(ub!=null && 100003==ub.getData().getAuditStatus()){ + auth_box.setVisibility(View.VISIBLE); + no_auth.setVisibility(View.GONE); + }else{ + auth_box.setVisibility(View.GONE); + no_auth.setVisibility(View.VISIBLE); + } + } + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/my/SetupActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/my/SetupActivity.java new file mode 100644 index 0000000..14c96cb --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/my/SetupActivity.java @@ -0,0 +1,175 @@ +package com.oneclouds.cargo.ui.my; + +import android.content.Intent; +import android.content.pm.PackageManager; +import android.net.Uri; +import android.os.Bundle; +import android.os.Message; +import android.widget.Button; +import android.widget.RelativeLayout; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; + +import com.lxj.xpopup.XPopup; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.ConfigBean; +import com.oneclouds.cargo.ui.MainActivity; +import com.oneclouds.cargo.ui.UiAuxiliary; +import com.oneclouds.cargo.ui.WebActivity; +import com.oneclouds.cargo.ui.parts.ConfigParts; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.http.RequsetCodeConstants; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseActivity; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/16 18:10 + * @description: + */ +public class SetupActivity extends BaseActivity { + //https://smlt.esign.cn/B692PZKLh4Vn + String url1=""; + String url2=""; + String url3=""; + String kefu=""; + private RelativeLayout r1,r2,r3,r4,r5,r6,r7,r8; + + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what){ + case RequsetCodeConstants.SUCCESS: + if(CacheGroup.cacheList.get("up_app")!=null){ +// UpAppBean uab=new Gson().fromJson(CacheGroup.cacheList.get("up_app"),UpAppBean.class); +// if(uab.getCode()==200){ +// if(uab.getData()==null){ +// Toast.makeText(con,"当前已经是最新版本",Toast.LENGTH_SHORT).show(); +// }else{ +// +// } +// } + CacheGroup.cacheList.remove("up_app"); + } + break; + default:break; + } + } + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_setup); + con=this; + act=this; + ConfigBean cb= ConfigParts.getConfigParts(con); + if(cb!=null){ + url1=cb.getData().getUserUrl(); + url2=cb.getData().getShipperPrivateUrl(); + kefu=cb.getData().getServiceMobile(); + url3=cb.getData().getSecurityUrl(); + } + r1=findViewById(R.id.r1); + r2=findViewById(R.id.r2); + r3=findViewById(R.id.r3); + r4=findViewById(R.id.r4); + r5=findViewById(R.id.r5); + r6=findViewById(R.id.r6); + r7=findViewById(R.id.r7); + r8=findViewById(R.id.r8); + url1=cb.getData().getUserUrl(); + url2=cb.getData().getShipperPrivateUrl(); + initView(null); + } + @Override + public void initView(Object obj) { + super.initView(obj); + + r1.setOnClickListener(v12 -> { + + }); + r2.setOnClickListener(v12 -> { + Intent in=new Intent(con, WebActivity.class); + in.putExtra("title","用户协议"); + in.putExtra("url",url1); + startActivity(in); + }); + r7.setOnClickListener(v12 -> { + Intent in=new Intent(con, WebActivity.class); + in.putExtra("title","隐私协议"); + in.putExtra("url",url2); + startActivity(in); + }); + r3.setOnClickListener(v12 -> { + Intent in=new Intent(con,WebActivity.class); + in.putExtra("title","咨询建议"); + in.putExtra("url","https://support.qq.com/product/335641"); + startActivity(in); + }); + r4.setOnClickListener(v12 -> { + //new UserRequset().upApp(con,hd); + }); + r5.setOnClickListener(v12 -> { + Intent in=new Intent(con,WebActivity.class); + in.putExtra("title","关于我们"); + in.putExtra("url",url1); + startActivity(in); + }); + r6.setOnClickListener(v12 -> { + String[] title={"平台客服:"+kefu,"银行客服:02195528","技术咨询:13460042961"}; + String[] value={kefu,"02195528","13460042961"}; + new XPopup.Builder(con) + .isDarkTheme(false) + .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + .asCenterList("请选择",title, + (position1, text) -> { + Intent intent = new Intent(Intent.ACTION_DIAL); + Uri data = Uri.parse("tel:" + value[position1]); + intent.setData(data); + startActivity(intent); + }) + .show(); + }); + r8.setOnClickListener(v -> new XPopup.Builder(con) + .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + .asConfirm("注销账户", " 注销提交后,资料将在7个工作日后永久删除,如需使用需再次提交资料,请谨慎操作~", + "取消操作", "确认注销", + () -> { + Toast.makeText(con,"注销申请提交成功",Toast.LENGTH_LONG).show(); + }, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局 + .show()); + String vs="1.0.0"; + try { + vs = con.getPackageManager().getPackageInfo(con.getPackageName(), 0).versionName; + } catch (PackageManager.NameNotFoundException e) { + e.printStackTrace(); + } + + TextView edition=findViewById(R.id.edition); + edition.setText("V"+vs); + //退出登录 + Button btn_login_out=findViewById(R.id.btn_login_out); + btn_login_out.setOnClickListener(v1 -> { + new XPopup.Builder(act) + .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + .asConfirm("提示", "确定退出登录?", + "取消", "退出", + () -> { + UiAuxiliary.delLogin(con); + Intent intent = new Intent(con, MainActivity.class); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); + con.startActivity(intent); + }, null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局 + .show(); + //finish(); + }); + + } + + class model{} + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/my/auth/BusinesslicenseAuthActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/my/auth/BusinesslicenseAuthActivity.java new file mode 100644 index 0000000..4df7d71 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/my/auth/BusinesslicenseAuthActivity.java @@ -0,0 +1,26 @@ +package com.oneclouds.cargo.ui.my.auth; + +import android.os.Bundle; + +import androidx.annotation.Nullable; + +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseActivity; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/18 11:52 + * @description: + */ +public class BusinesslicenseAuthActivity extends BaseActivity { + + @Override + protected void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_auth_business); + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/my/auth/CertificatesAuthActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/my/auth/CertificatesAuthActivity.java new file mode 100644 index 0000000..fbcaa85 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/my/auth/CertificatesAuthActivity.java @@ -0,0 +1,340 @@ +package com.oneclouds.cargo.ui.my.auth; + +import android.content.Context; +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.os.Message; +import android.util.Log; +import android.view.View; +import android.widget.Button; +import android.widget.ImageView; +import android.widget.RelativeLayout; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import com.bumptech.glide.Glide; +import com.bumptech.glide.request.RequestOptions; +import com.bumptech.glide.request.target.Target; +import com.google.gson.Gson; +import com.lxj.xpopup.XPopup; +import com.lxj.xpopup.interfaces.XPopupImageLoader; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.AuthInfoBean; +import com.oneclouds.cargo.bean.BaseBean; +import com.oneclouds.cargo.bean.ocr.OCRCardBackBean; +import com.oneclouds.cargo.bean.ocr.OCRCardBean; +import com.oneclouds.cargo.request.AuthRequest; +import com.oneclouds.cargo.request.OCRRequest; +import com.oneclouds.cargo.request.bean.AuthCorporationInputBean; +import com.oneclouds.cargo.request.bean.AuthSaveInputBean; +import com.oneclouds.cargo.util.ImageUtil.GetImageAlert; +import com.oneclouds.cargo.util.ImageUtil.ImageUriUtil; +import com.oneclouds.cargo.util.StringUtil; +import com.oneclouds.cargo.util.alert.CustomDialog; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.file.ImageFileCompressUtil; +import com.oneclouds.cargo.util.http.RequsetCodeConstants; +import com.oneclouds.cargo.util.time.Timer; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseActivity; +import com.oneclouds.cargo.util.view.BaseAppCompatActivity; + +import java.io.File; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/18 12:02 + * @description: + */ +public class CertificatesAuthActivity extends BaseAppCompatActivity { + + private OCRRequest or; + private AuthRequest ar; + private TextView zj_name,zjimg_name,zjimg2_name,zjimg3_name,zj_name2,zj_name3; + private TextView name1,name2,name3,name4; + private TextView value1,value2,value3,value4,value5; + private Button submit; + private ImageView img1,img2,img3,type_img; + private TextView u_img,u_img2,u_img3; + private View dy; + private RelativeLayout dy_box; + // + private Gson gson=new Gson(); + // + private String url1=""; + private String url2=""; + private OCRCardBean ocb; + private OCRCardBackBean ocbb; + private int type=0; + //底部弹窗 + GetImageAlert gia=new GetImageAlert(); + private int state=0; + private String str=""; + @Override + public void msgMethod(Message m) { + switch (m.what){ + case RequsetCodeConstants.SUCCESS: + if(CacheGroup.cacheList.get(OCRRequest.OCR_ID_CARD_FRONT)!=null){ + if (customDialog!=null) { + customDialog.dismiss(); + } + ocb=gson.fromJson(CacheGroup.cacheList.get(OCRRequest.OCR_ID_CARD_FRONT),OCRCardBean.class); + if(ocb.getCode()==200){ + url1=ocb.getData().getUrl(); + value1.setText(ocb.getData().getName()); + value2.setText(ocb.getData().getCardId()); + value3.setText(ocb.getData().getAddress()); + Glide.with(con).load(url1).into(img1); + }else{ + Toast.makeText(con,ocb.getMsg(),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(OCRRequest.OCR_ID_CARD_FRONT); + } + if(CacheGroup.cacheList.get(OCRRequest.OCR_ID_CARD_BACK)!=null){ + if (customDialog!=null) { + customDialog.dismiss(); + } + if(ocb.getCode()==200) { + ocbb = gson.fromJson(CacheGroup.cacheList.get(OCRRequest.OCR_ID_CARD_BACK), OCRCardBackBean.class); + url2 = ocbb.getData().getUrl(); + value4.setText(Timer.formatChange(ocbb.getData().getEndTime(),"yyyyMMdd","yyyy-MM-dd")); + Glide.with(con).load(url2).into(img2); + }else{ + Toast.makeText(con,ocbb.getMsg(),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(OCRRequest.OCR_ID_CARD_BACK); + } + if(CacheGroup.cacheList.get(AuthRequest.AUTH_PERSON_AUTH_SAVE)!=null){ + BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(AuthRequest.AUTH_PERSON_AUTH_SAVE),BaseBean.class); + if(bb.getCode()==200){ + Toast.makeText(con,"保存成功",Toast.LENGTH_SHORT).show(); + }else{ + Toast.makeText(con,bb.getMsg(),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(AuthRequest.AUTH_PERSON_AUTH_SAVE); + } + if(CacheGroup.cacheList.get(AuthRequest.AUTH_ENTER_PRISE_AUTH_CORPORATION)!=null){ + BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(AuthRequest.AUTH_ENTER_PRISE_AUTH_CORPORATION),BaseBean.class); + if(bb.getCode()==200){ + Toast.makeText(con,"保存成功",Toast.LENGTH_SHORT).show(); + }else{ + Toast.makeText(con,bb.getMsg(),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(AuthRequest.AUTH_ENTER_PRISE_AUTH_CORPORATION); + } + break; + case ImageFileCompressUtil.COMPRESS_SUCCESS: + path= (String) m.obj; + pathOrc(); + break; + default: + break; + } + } + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_auth_certificates); + con=this; + act=this; + zj_name=findViewById(R.id.zj_name); + zj_name2=findViewById(R.id.zj_name2); + zjimg_name=findViewById(R.id.zjimg_name); + zjimg2_name=findViewById(R.id.zjimg_name2); + type_img=findViewById(R.id.type_img); + u_img=findViewById(R.id.upload_img); + u_img2=findViewById(R.id.upload_img2); + img1=findViewById(R.id.img1); + img2=findViewById(R.id.img2); + name1=findViewById(R.id.name1); + name2=findViewById(R.id.name2); + name3=findViewById(R.id.name3); + name4=findViewById(R.id.name4); + value1=findViewById(R.id.value1); + value2=findViewById(R.id.value2); + value3=findViewById(R.id.value3); + value4=findViewById(R.id.value4); + value5=findViewById(R.id.value5); + submit=findViewById(R.id.submit); + dy=findViewById(R.id.dy); + dy_box=findViewById(R.id.dy_box); + or=new OCRRequest(con,hd); + ar=new AuthRequest(con,hd); + Intent in=getIntent(); + type=in.getExtras().getInt("type"); + str=in.getExtras().getString("str"); + initView(null); + } + private AuthInfoBean aib; + @Override + public void initView(Object obj) { + super.initView(obj); + if(type==1){ + zj_name.setText("法人身份证信息"); + dy.setVisibility(View.GONE); + dy_box.setVisibility(View.GONE); + } + if(!url1.equals("")){ + if(!isAuth){ + Glide.with(con).load(url1).into(img1); + } + } + if(!url2.equals("")){ + if(!isAuth){ + Glide.with(con).load(url2).into(img2); + } + } + //查看第一张照片 + img1.setOnClickListener(v -> { + if(!url1.equals("")){ + new XPopup.Builder(con) + .asImageViewer(img1, url1, true, -1, -1, 50, false,new ImageLoader()) + .show(); + } + }); + //查看第二张照片 + img2.setOnClickListener(v -> { + if(!url2.equals("")){ + new XPopup.Builder(con) + .asImageViewer(img2, url2, true, -1, -1, 50, false,new ImageLoader()) + .show(); + } + }); + + //识别第一张图片 + u_img.setOnClickListener(v -> { + if(!isAuth){ + state=0; + gia.showPopueWindow(this); + } + }); + //识别第二张图片 + u_img2.setOnClickListener(v -> { + if(!isAuth) { + state = 1; + gia.showPopueWindow(this); + } + }); + submit.setOnClickListener(v -> { + if(!isAuth){ + subimt(); + } + }); + if(!str.equals("")){ + aib=gson.fromJson(str,AuthInfoBean.class); + if(aib.getData()!=null){ + if(type==0){ + if(!StringUtil.isNull(aib.getData().getIdcardPhotoUrl(),"").equals("") + && !StringUtil.isNull(aib.getData().getIdcardPhotoBackUrl(),"").equals("")){ + url1=aib.getData().getIdcardPhotoUrl(); + url2=aib.getData().getIdcardPhotoBackUrl(); + value1.setText(aib.getData().getContactName()); + value2.setText(aib.getData().getIdcard()); + //value3.setText(iacb.getData().getIdcardAddress()); + value4.setText(aib.getData().getIdcardValidity()); + value5.setText(aib.getData().getContactPhone()); + Glide.with(con).load(url1).into(img1); + Glide.with(con).load(url2).into(img2); + submit.setBackgroundResource(R.drawable.bg_btn_grey); + u_img.setText("已上传"); + u_img2.setText("已上传"); + isAuth=true; + } + }else{ + if(!StringUtil.isNull(aib.getData().getCorporationIdcardPhotoUrl(),"").equals("") + && !StringUtil.isNull(aib.getData().getCorporationIdcardPhotoBackUrl(),"").equals("")){ + url1=aib.getData().getCorporationIdcardPhotoUrl(); + url2=aib.getData().getCorporationIdcardPhotoBackUrl(); + value1.setText(aib.getData().getCorporationName()); + value2.setText(aib.getData().getCorporationIdcard()); + value4.setText(aib.getData().getCorporationIdcardValidity()); + Glide.with(con).load(url1).into(img1); + Glide.with(con).load(url2).into(img2); + submit.setBackgroundResource(R.drawable.bg_btn_grey); + u_img.setText("已上传"); + u_img2.setText("已上传"); + isAuth=true; + } + } + } + } + } + boolean isAuth=false; + + String path; + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (requestCode == 11 && resultCode == RESULT_OK ) { + Uri selectedImage = data.getData(); + path= ImageUriUtil.uriTurnPath(selectedImage,con); + Log.e("图片地址:",path); + gia.dis(); + ImageFileCompressUtil.imageFileCompress(con,new File(path),hd); + }else if(requestCode == 12 && resultCode == RESULT_OK){ + path=gia.getFile().getPath(); + Log.e("图片地址:",path); + gia.dis(); + ImageFileCompressUtil.imageFileCompress(con,new File(path),hd); + } + } + + + private CustomDialog customDialog; + private void pathOrc(){ + customDialog=new CustomDialog(con, "上传识别中..."); + customDialog.show(); + if(state==0){ + or.ORCIdCard(new File(path)); + }else{ + or.ORCIdCardBack(new File(path)); + } + } + + public void subimt(){ + if (type==0) { + AuthSaveInputBean ab=new AuthSaveInputBean(); + ab.setContactName(ocb.getData().getName()); + ab.setContactPhone(value5.getText()+""); + ab.setIdcard(ocb.getData().getCardId()); + ab.setIdcardPhoto(ocb.getData().getId()); + ab.setIdcardPhotoBack(ocbb.getData().getId()); + ab.setIdcardValidity(Timer.formatChange(ocbb.getData().getEndTime(),"yyyyMMdd","yyyy-MM-dd")); + ar.authSave(ab); + }else{ + AuthCorporationInputBean aci=new AuthCorporationInputBean(); + aci.setCorporationIdcard(ocb.getData().getCardId()); + aci.setCorporationIdcardPhoto(ocb.getData().getId()); + aci.setCorporationIdcardPhotoBack(ocbb.getData().getId()); + aci.setCorporationIdcardValidity(Timer.formatChange(ocbb.getData().getEndTime(),"yyyyMMdd","yyyy-MM-dd")); + aci.setCorporationName(ocb.getData().getName()); + ar.authCoproration(aci); + } + } + + public static class ImageLoader implements XPopupImageLoader { + @Override + public void loadImage(int position, @NonNull Object url, @NonNull ImageView imageView) { + //必须指定Target.SIZE_ORIGINAL,否则无法拿到原图,就无法享用天衣无缝的动画 + Glide.with(imageView).load(url).apply(new RequestOptions().placeholder(R.mipmap.ic_launcher_round).override(Target.SIZE_ORIGINAL)).into(imageView); + } + @Override + public File getImageFile(@NonNull Context context, @NonNull Object uri) { + try { + return Glide.with(context).downloadOnly().load(uri).submit().get(); + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/my/auth/CompanyAuthActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/my/auth/CompanyAuthActivity.java new file mode 100644 index 0000000..ea0167c --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/my/auth/CompanyAuthActivity.java @@ -0,0 +1,200 @@ +package com.oneclouds.cargo.ui.my.auth; + +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.os.Message; +import android.util.Log; +import android.view.View; +import android.widget.Button; +import android.widget.ImageView; +import android.widget.RelativeLayout; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; + +import com.bumptech.glide.Glide; +import com.google.gson.Gson; +import com.lxj.xpopup.XPopup; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.AuthInfoBean; +import com.oneclouds.cargo.bean.BaseBean; +import com.oneclouds.cargo.bean.ocr.OcrBusinessLicenseBean; +import com.oneclouds.cargo.request.AuthRequest; +import com.oneclouds.cargo.request.OCRRequest; +import com.oneclouds.cargo.request.bean.AuthCompanyInputBean; +import com.oneclouds.cargo.util.ImageUtil.GetImageAlert; +import com.oneclouds.cargo.util.ImageUtil.ImageUriUtil; +import com.oneclouds.cargo.util.StringUtil; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.file.ImageFileCompressUtil; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseAppCompatActivity; + +import java.io.File; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/22 22:20 + * @description: + */ +public class CompanyAuthActivity extends BaseAppCompatActivity { + + private TextView upload_img; + private RelativeLayout up_img; + private ImageView img; + private boolean isAuth=false; + private OCRRequest or; + private AuthRequest ar; + private OcrBusinessLicenseBean oblb; + private Gson gson=new Gson(); + private String url=""; + private GetImageAlert gia=new GetImageAlert(); + private String str=""; + private TextView value1,value2,value3,value4; + private Button submit; + private int province=0; + private int city=0; + private int area=0; + private String path; + + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what){ + case 200: + if(CacheGroup.cacheList.get(OCRRequest.OCR_BUSINESS_LICENSE)!=null){ + oblb=gson.fromJson(CacheGroup.cacheList.get(OCRRequest.OCR_BUSINESS_LICENSE),OcrBusinessLicenseBean .class); + if(oblb.getCode()==200){ + value1.setText(oblb.getData().getCompanyName()); + value2.setText(oblb.getData().getAddress()); + value3.setText(oblb.getData().getSocialCreditCode()); + url=oblb.getData().getUrl(); + img.setVisibility(View.VISIBLE); + up_img.setVisibility(View.GONE); + Glide.with(con).load(url).into(img); + }else{ + Toast.makeText(con,oblb.getMsg(),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(OCRRequest.OCR_BUSINESS_LICENSE); + } + //AUTH_ENTER_PRISE_AUTH_COMPANY + if(CacheGroup.cacheList.get(AuthRequest.AUTH_ENTER_PRISE_AUTH_COMPANY)!=null){ + BaseBean bb =gson.fromJson(CacheGroup.cacheList.get(AuthRequest.AUTH_ENTER_PRISE_AUTH_COMPANY),BaseBean.class); + if(bb.getCode()==200){ + Toast.makeText(con,"保存成功",Toast.LENGTH_SHORT).show(); + }else{ + Toast.makeText(con,bb.getMsg(),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(AuthRequest.AUTH_ENTER_PRISE_AUTH_COMPANY); + } + break; + case ImageFileCompressUtil.COMPRESS_SUCCESS: + path= (String) m.obj; + or.ORCBusiness(new File(path)); + break; + default:break; + } + } + + private AuthInfoBean aib; + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_auth_company); + con=this; + act=this; + upload_img=findViewById(R.id.upload_img); + up_img=findViewById(R.id.up_img); + img=findViewById(R.id.img); + value1=findViewById(R.id.value1); + value2=findViewById(R.id.value2); + value3=findViewById(R.id.value3); + value4=findViewById(R.id.value4); + submit=findViewById(R.id.submit); + or=new OCRRequest(con,hd); + ar=new AuthRequest(con,hd); + str=getIntent().getExtras().getString("str"); + initView(null); + } + + @Override + public void initView(Object obj) { + super.initView(obj); + //上传识别图片 + upload_img.setOnClickListener(v -> { + if(!isAuth){ + gia.showPopueWindow(this); + } + }); + //查看图片 + img.setOnClickListener(v -> { + if(!url.equals("")){ + new XPopup.Builder(con) + .asImageViewer(img, url, true, -1, -1, 50, false,new CertificatesAuthActivity.ImageLoader()) + .show(); + } + }); + submit.setOnClickListener(v -> { + if(!isAuth){ + String value1Str=value1.getText()+""; + String value2Str=value2.getText()+""; + String value3Str=value3.getText()+""; + String value4Str=value4.getText()+""; + if(!value1Str.equals("") && !value2Str.equals("") && !value3Str.equals("") && !value4Str.equals("")){ + subimtBtn(); + }else{ + Toast.makeText(con,"请先上传资料",Toast.LENGTH_SHORT).show(); + } + } + }); + if(!str.equals("")){ + aib=gson.fromJson(str,AuthInfoBean.class); + if(aib.getData()!=null){ + if (!StringUtil.isNull(aib.getData().getBusinessLicenseUrl(),"").equals("")){ + url=StringUtil.isNull(aib.getData().getBusinessLicenseUrl(),""); + value1.setText(StringUtil.isNull(aib.getData().getCompanyName(),"")); + value2.setText(StringUtil.isNull(aib.getData().getAddressDetail(),"")); + value3.setText(StringUtil.isNull(aib.getData().getCode(),"")); + value4.setText(StringUtil.isNull(aib.getData().getCompanyShorterName(),"")); + isAuth=true; + submit.setBackgroundResource(R.drawable.bg_btn_grey); + Glide.with(con).load(url).into(img); + img.setVisibility(View.VISIBLE); + up_img.setVisibility(View.GONE); + } + } + } + } + + public void subimtBtn(){ + AuthCompanyInputBean acib=new AuthCompanyInputBean(); + acib.setAddressDetail(oblb.getData().getAddress()); + acib.setBusinessLicense(oblb.getData().getId());//营业执照 + acib.setCode(oblb.getData().getSocialCreditCode()); + acib.setCompanyShorterName(value4.getText()+""); + acib.setRealCompanyName(oblb.getData().getCompanyName()); + ar.authCompany(acib); + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (requestCode == 11 && resultCode == RESULT_OK ) { + Uri selectedImage = data.getData(); + path= ImageUriUtil.uriTurnPath(selectedImage,con); + Log.e("图片地址:",path); + gia.dis(); + ImageFileCompressUtil.imageFileCompress(con,new File(path),hd); + }else if(requestCode == 12 && resultCode == RESULT_OK){ + path=gia.getFile().getPath(); + Log.e("图片地址:",path); + gia.dis(); + ImageFileCompressUtil.imageFileCompress(con,new File(path),hd); + } + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/my/auth/DangAuthActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/my/auth/DangAuthActivity.java new file mode 100644 index 0000000..ba17352 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/my/auth/DangAuthActivity.java @@ -0,0 +1,158 @@ +package com.oneclouds.cargo.ui.my.auth; + +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.os.Message; +import android.util.Log; +import android.view.View; +import android.widget.Button; +import android.widget.ImageView; +import android.widget.RelativeLayout; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; + +import com.bumptech.glide.Glide; +import com.google.gson.Gson; +import com.lxj.xpopup.XPopup; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.BaseBean; +import com.oneclouds.cargo.bean.UploadBean; +import com.oneclouds.cargo.request.AuthRequest; +import com.oneclouds.cargo.request.PublicRequest; +import com.oneclouds.cargo.util.ImageUtil.GetImageAlert; +import com.oneclouds.cargo.util.ImageUtil.ImageUriUtil; +import com.oneclouds.cargo.util.StringUtil; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.file.ImageFileCompressUtil; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseAppCompatActivity; + +import java.io.File; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/28 9:25 + * @description: + */ +public class DangAuthActivity extends BaseAppCompatActivity { + + private PublicRequest pr; + private AuthRequest ar; + private ImageView img; + private RelativeLayout up_img; + private TextView upload_img; + private Button submit; + private GetImageAlert gia=new GetImageAlert(); + private String url=""; + private UploadBean ub; + private Gson gson=new Gson(); + private boolean isAuth=false; + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what){ + case 200: + if(CacheGroup.cacheList.get(PublicRequest.UPLOAD)!=null){ + ub=gson.fromJson(CacheGroup.cacheList.get(PublicRequest.UPLOAD), UploadBean.class); + if (ub.getCode()==200) { + url=ub.getData().getUrl(); + Glide.with(con).load(url).into(img); + up_img.setVisibility(View.GONE); + img.setVisibility(View.VISIBLE); + }else{ + Toast.makeText(con,ub.getMsg(),Toast.LENGTH_LONG).show(); + } + CacheGroup.cacheList.remove(PublicRequest.UPLOAD); + } + if(CacheGroup.cacheList.get(AuthRequest.AUTH_PARTY_MEMBER)!=null){ + BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(AuthRequest.AUTH_PARTY_MEMBER),BaseBean.class); + if (bb.getCode()==200) { + Toast.makeText(con,"党员信息提交成功",Toast.LENGTH_LONG).show(); + finish(); + }else{ + Toast.makeText(con, StringUtil.isNull(bb.getMsg(),"出现错误"),Toast.LENGTH_LONG).show(); + } + CacheGroup.cacheList.remove(AuthRequest.AUTH_PARTY_MEMBER); + } + break; + case ImageFileCompressUtil.COMPRESS_SUCCESS: + path= (String) m.obj; + pr.uploadFile(new File(path)); + break; + default:break; + } + } + + @Override + protected void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_auth_dang); + con=this; + up_img=findViewById(R.id.up_img); + img=findViewById(R.id.img); + submit=findViewById(R.id.submit); + upload_img=findViewById(R.id.upload_img); + pr=new PublicRequest(con,hd); + ar=new AuthRequest(con,hd); + url=getIntent().getExtras().getString("url"); + if(!url.equals("")){ + isAuth=true; + submit.setBackgroundResource(R.drawable.bg_btn_grey); + Glide.with(con).load(url).into(img); + up_img.setVisibility(View.GONE); + img.setVisibility(View.VISIBLE); + upload_img.setText("已上传"); + } + initView(null); + } + + @Override + public void initView(Object obj) { + super.initView(obj); + upload_img.setOnClickListener(v -> { + if (!isAuth){ + gia.showPopueWindow(this); + } + }); + submit.setOnClickListener(v -> { + if(!isAuth){ + if(!url.equals("")){ + ar.partyMember(url); + }else{ + Toast.makeText(con,"请先上传党员证照片",Toast.LENGTH_LONG).show(); + } + } + }); + img.setOnClickListener(v -> { + if(!url.equals("")){ + new XPopup.Builder(con) + .asImageViewer(img, url, true, -1, -1, 50, false,new CertificatesAuthActivity.ImageLoader()) + .show(); + } + }); + } + + private String path=""; + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (requestCode == 11 && resultCode == RESULT_OK ) { + Uri selectedImage = data.getData(); + path= ImageUriUtil.uriTurnPath(selectedImage,con); + Log.e("图片地址:",path); + gia.dis(); + ImageFileCompressUtil.imageFileCompress(con,new File(path),hd); + }else if(requestCode == 12 && resultCode == RESULT_OK){ + path=gia.getFile().getPath(); + Log.e("图片地址:",path); + gia.dis(); + ImageFileCompressUtil.imageFileCompress(con,new File(path),hd); + } + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/my/auth/MyAuthActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/my/auth/MyAuthActivity.java new file mode 100644 index 0000000..ce166f2 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/my/auth/MyAuthActivity.java @@ -0,0 +1,185 @@ +package com.oneclouds.cargo.ui.my.auth; + +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.os.Message; +import android.util.Log; +import android.widget.ImageView; +import android.widget.RelativeLayout; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; + +import com.bumptech.glide.Glide; +import com.google.gson.Gson; +import com.lxj.xpopup.XPopup; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.AuthInfoBean; +import com.oneclouds.cargo.bean.BaseBean; +import com.oneclouds.cargo.bean.UploadBean; +import com.oneclouds.cargo.bean.UserBean; +import com.oneclouds.cargo.request.AuthRequest; +import com.oneclouds.cargo.request.PublicRequest; +import com.oneclouds.cargo.ui.parts.UserParts; +import com.oneclouds.cargo.util.ImageUtil.GetImageAlert; +import com.oneclouds.cargo.util.ImageUtil.ImageUriUtil; +import com.oneclouds.cargo.util.StringUtil; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.file.ImageFileCompressUtil; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseAppCompatActivity; + +import java.io.File; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/17 14:17 + * @description: + */ +public class MyAuthActivity extends BaseAppCompatActivity { + + private RelativeLayout r1,r2,r3,r4; + private AuthRequest ar; + private AuthInfoBean aib; + private UserBean userBean; + private Gson gson=new Gson(); + private String str=""; + private TextView up_img; + private GetImageAlert gia=new GetImageAlert(); + private PublicRequest pr; + private UploadBean ub; + private ImageView up_head; + private String url=""; + + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what){ + case 200: + if(CacheGroup.cacheList.get(AuthRequest.AUTH_INFO)!=null){ + aib=gson.fromJson(CacheGroup.cacheList.get(AuthRequest.AUTH_INFO),AuthInfoBean.class); + if (aib.getCode()==200) { + str=CacheGroup.cacheList.get(AuthRequest.AUTH_INFO); + }else{ + Toast.makeText(con,aib.getMsg(),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(AuthRequest.AUTH_INFO); + } + if(CacheGroup.cacheList.get(PublicRequest.UPLOAD)!=null){ + ub=gson.fromJson(CacheGroup.cacheList.get(PublicRequest.UPLOAD),UploadBean.class); + if (aib.getCode()==200) { + url=ub.getData().getUrl(); + Glide.with(con).load(url).into(up_head); + pr.upHeadImg(ub.getData().getUrl()); + }else{ + Toast.makeText(con,ub.getMsg(),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(PublicRequest.UPLOAD); + } + if(CacheGroup.cacheList.get(PublicRequest.UPLOAD_HEAD)!=null){ + BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(PublicRequest.UPLOAD_HEAD),BaseBean.class); + if (bb.getCode()==200) { + Toast.makeText(con,"头像上传成功",Toast.LENGTH_SHORT).show(); + }else{ + Toast.makeText(con,bb.getMsg(),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(PublicRequest.UPLOAD_HEAD); + } + break; + case ImageFileCompressUtil.COMPRESS_SUCCESS: + path= (String) m.obj; + pr.uploadFile(new File(path)); + break; + } + } + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_my_auth); + con=this; + act=this; + r1=findViewById(R.id.r1); + r2=findViewById(R.id.r2); + r3=findViewById(R.id.r3); + r4=findViewById(R.id.r4); + up_img=findViewById(R.id.up_img); + up_head=findViewById(R.id.up_head); + url=getIntent().getExtras().getString("url"); + initView(null); + userBean= UserParts.getUser(con); + pr=new PublicRequest(con,hd); + ar=new AuthRequest(con,hd); + ar.auth_info(); + } + + @Override + public void initView(Object obj) { + super.initView(obj); + r1.setOnClickListener(v -> { + Intent in=new Intent(con,CertificatesAuthActivity.class); + in.putExtra("type",0); + in.putExtra("str",str); + startActivity(in); + }); + r2.setOnClickListener(v -> { + Intent in=new Intent(con,CompanyAuthActivity.class); + in.putExtra("str",str); + startActivity(in); + }); + r3.setOnClickListener(v -> { + Intent in=new Intent(con,CertificatesAuthActivity.class); + in.putExtra("type",1); + in.putExtra("str",str); + startActivity(in); + }); + r4.setOnClickListener(v -> { + Intent in=new Intent(con,DangAuthActivity.class); + in.putExtra("url", StringUtil.isNull(userBean.getData().getPartyMemberUrl(),"")); + startActivity(in); + }); + up_img.setOnClickListener(v -> { + gia.showPopueWindow(this); + }); + if(!url.equals("")){ + Glide.with(con).load(url).into(up_head); + } + up_head.setOnClickListener(v -> { + if(!url.equals("")){ + new XPopup.Builder(con) + .asImageViewer(up_head, url, true, -1, -1, 50, false,new CertificatesAuthActivity.ImageLoader()) + .show(); + } + }); + } + + private String path=""; + + @Override + protected void onResume() { + super.onResume(); + ar.auth_info(); + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (requestCode == 11 && resultCode == RESULT_OK ) { + Uri selectedImage = data.getData(); + path= ImageUriUtil.uriTurnPath(selectedImage,con); + Log.e("图片地址:",path); + gia.dis(); + ImageFileCompressUtil.imageFileCompress(con,new File(path),hd); + }else if(requestCode == 12 && resultCode == RESULT_OK){ + path=gia.getFile().getPath(); + Log.e("图片地址:",path); + gia.dis(); + ImageFileCompressUtil.imageFileCompress(con,new File(path),hd); + } + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/my/invoice/InvoiceActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/my/invoice/InvoiceActivity.java new file mode 100644 index 0000000..8e2cbb5 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/my/invoice/InvoiceActivity.java @@ -0,0 +1,58 @@ +package com.oneclouds.cargo.ui.my.invoice; + +import android.content.Intent; +import android.os.Bundle; +import android.widget.RelativeLayout; +import android.widget.TextView; + +import androidx.annotation.Nullable; + +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.ui.my.AddressActivity; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseActivity; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/22 19:45 + * @description: + */ +public class InvoiceActivity extends BaseActivity { + + private RelativeLayout r1,r2; + private TextView history; + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_invoice); + con=this; + act=this; + r1=findViewById(R.id.r1); + r2=findViewById(R.id.r2); + history=findViewById(R.id.history); + initView(null); + } + + @Override + public void initView(Object obj) { + super.initView(obj); + r1.setOnClickListener(v -> { + Intent in=new Intent(con, InvoiceHaederAddActivity.class); + startActivity(in); + }); + r2.setOnClickListener(v -> { + Intent in=new Intent(con, AddressActivity.class); + in.putExtra("type",2); + in.putExtra("key",true); + startActivity(in); + }); + history.setOnClickListener(v -> { + Intent in=new Intent(con, InvoiceHistoryActivity.class); + startActivity(in); + }); + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/my/invoice/InvoiceCreateActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/my/invoice/InvoiceCreateActivity.java new file mode 100644 index 0000000..17f97c2 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/my/invoice/InvoiceCreateActivity.java @@ -0,0 +1,197 @@ +package com.oneclouds.cargo.ui.my.invoice; + +import android.content.Intent; +import android.os.Bundle; +import android.os.Message; +import android.util.Log; +import android.view.View; +import android.widget.Button; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; + +import com.google.gson.Gson; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.AddressListBean; +import com.oneclouds.cargo.bean.BaseBean; +import com.oneclouds.cargo.bean.InvoiceHeaderBean; +import com.oneclouds.cargo.bean.WaybillListBean; +import com.oneclouds.cargo.event.AddressEvent; +import com.oneclouds.cargo.request.InvoiceRequest; +import com.oneclouds.cargo.request.bean.InvoiceInputBean; +import com.oneclouds.cargo.ui.my.AddressActivity; +import com.oneclouds.cargo.util.StringUtil; +import com.oneclouds.cargo.util.adapter.ManyBean; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseActivity; +import com.oneclouds.cargo.util.view.BaseRecyclerView; + +import org.greenrobot.eventbus.EventBus; +import org.greenrobot.eventbus.Subscribe; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/24 18:40 + * @description: + */ +public class InvoiceCreateActivity extends BaseActivity { + + private BaseRecyclerView brv; + private InvoiceInputBean iib=new InvoiceInputBean(); + private Button submit; + private InvoiceRequest ir; + private int addressId=0; + private int invoiceTitleId=0; + private TextView company_no,company_name,address_value,addressee,phone; + private InvoiceHeaderBean ihb=new InvoiceHeaderBean(); + private Gson gson=new Gson(); + private Map submit_map=new HashMap<>(); + private String str=""; + private List list_wid=new ArrayList<>(); + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what){ + case 200: + if(CacheGroup.cacheList.get(InvoiceRequest.INVOICE_FIND_SHIPPER_INVOICE_TITLE)!=null){ + ihb=gson.fromJson(CacheGroup.cacheList.get(InvoiceRequest.INVOICE_FIND_SHIPPER_INVOICE_TITLE),InvoiceHeaderBean.class); + if(ihb.getCode()==200){ + updateHeader(); + }else{ + Toast.makeText(con, StringUtil.isNull(ihb.getMsg(),"出现错误"),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(InvoiceRequest.INVOICE_FIND_SHIPPER_INVOICE_TITLE); + } + if(CacheGroup.cacheList.get(InvoiceRequest.INVOICE_SAVE)!=null){ + BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(InvoiceRequest.INVOICE_SAVE),BaseBean.class); + if(ihb.getCode()==200){ + Toast.makeText(con,"发票申请成功",Toast.LENGTH_LONG).show(); + finish(); + Intent in=new Intent(con,InvoiceHistoryActivity.class); + startActivity(in); + }else{ + Toast.makeText(con, StringUtil.isNull(ihb.getMsg(),"出现错误"),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(InvoiceRequest.INVOICE_SAVE); + } + break; + } + } + + @Override + protected void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.invoice_create); + con=this; + EventBus.getDefault().register(this); + brv=findViewById(R.id.brv); + submit=findViewById(R.id.submit); + ir=new InvoiceRequest(con,hd); + ir.invoiceHeader(); + str=getIntent().getExtras().getString("list"); + submit_map=gson.fromJson(str,HashMap.class); + Log.e("-map-",submit_map.toString()); + initView(null); + } + + @Override + public void initView(Object obj) { + super.initView(obj); + submit.setOnClickListener(v -> { + iib.setAddressId(addressId); + iib.setInvoiceTitleId(invoiceTitleId); + iib.setOrderId(list_wid); + iib.setNature(1); + iib.setRemark("货主端申请"); + ir.invoiceSave(iib); + }); + List list=new ArrayList<>(); + list.add(new ManyBean(new Model(),R.layout.invoice_company)); + list.add(new ManyBean(new Model(),R.layout.invoice_address)); + for (Map.Entry entry : submit_map.entrySet()) { + Log.e("me to",gson.toJson(entry.getValue())); + WaybillListBean.DataDTO.ListDTO wdl=gson.fromJson(entry.getValue(),WaybillListBean.DataDTO.ListDTO.class); + list_wid.add(wdl.getOrderId()); + list.add(new ManyBean(wdl,R.layout.item_invoice)); + } + brv.creates(con,list).setOnItemViewListener((position, o, v, layout) -> { + switch (layout){ + case R.layout.invoice_company: + invoice_company(v); + break; + case R.layout.invoice_address: + invoice_address(v); + break; + case R.layout.item_invoice: + item_invoice(); + break; + default:break; + } + }); + } + + public void invoice_company(View v){ + company_name=v.findViewById(R.id.company_name); + company_no=v.findViewById(R.id.company_no); + v.setOnClickListener(v1 -> { + //if(ihb.getData()==null) { + Intent in = new Intent(con, InvoiceHaederAddActivity.class); + startActivity(in); + //} + }); + + } + + public void invoice_address(View v){ + address_value=v.findViewById(R.id.address_value); + addressee=v.findViewById(R.id.addressee); + phone=v.findViewById(R.id.phone); + v.setOnClickListener(v1 -> { + Intent in=new Intent(con, AddressActivity.class); + in.putExtra("type",2); + startActivity(in); + }); + } + + public void item_invoice(){ + + } + + public void updateHeader(){ + if(ihb.getData()!=null){ + company_no.setText(StringUtil.isNull(ihb.getData().getTaxNo(),"")); + company_name.setText(StringUtil.isNull(ihb.getData().getTitle(),"")); + invoiceTitleId=ihb.getData().getId(); + } + } + + + @Subscribe + public void addressResult(AddressEvent event) { + Log.e("返回结果",event.getMessage()+"--"); + AddressListBean.DataDTO.RecordsDTO adr=gson.fromJson(event.getMessage(),AddressListBean.DataDTO.RecordsDTO.class); + address_value.setText(adr.getProvinceName()+adr.getAreaName()+adr.getCityName()+adr.getAddressDetail()); + addressee.setText(adr.getContactPerson()); + phone.setText(adr.getContactNumber()); + addressId=adr.getId(); + } + + class Model{ + + } + + @Override + protected void onResume() { + super.onResume(); + ir.invoiceHeader(); + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/my/invoice/InvoiceDetailsActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/my/invoice/InvoiceDetailsActivity.java new file mode 100644 index 0000000..319821a --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/my/invoice/InvoiceDetailsActivity.java @@ -0,0 +1,47 @@ +package com.oneclouds.cargo.ui.my.invoice; + +import android.os.Bundle; +import android.util.Log; +import android.view.ViewGroup; + +import androidx.annotation.Nullable; + +import com.google.gson.Gson; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.InvoiceListBean; +import com.oneclouds.cargo.util.bean.GetObjectName; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseActivity; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/24 18:28 + * @description: + */ +public class InvoiceDetailsActivity extends BaseActivity { + + private String record; + private InvoiceListBean.DataDTO.RecordsDTO idr; + private Gson gson=new Gson(); + + @Override + protected void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.invoice_details); + con=this; + record=getIntent().getExtras().getString("record"); + idr=gson.fromJson(record,InvoiceListBean.DataDTO.RecordsDTO.class); + initView(null); + } + + @Override + public void initView(Object obj) { + super.initView(obj); + Log.e("idr",new Gson().toJson(idr)); + ViewGroup vg=findViewById(R.id.invoice_details); + GetObjectName.ZIModel(vg,idr,con); + GetObjectName.ZIModel(vg,idr.getOrderList().get(0),con); + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/my/invoice/InvoiceHaederActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/my/invoice/InvoiceHaederActivity.java new file mode 100644 index 0000000..6e5ac77 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/my/invoice/InvoiceHaederActivity.java @@ -0,0 +1,57 @@ +package com.oneclouds.cargo.ui.my.invoice; + +import android.content.Intent; +import android.os.Bundle; +import android.os.Message; + +import androidx.annotation.Nullable; +import androidx.cardview.widget.CardView; + +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.request.InvoiceRequest; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseActivity; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/23 9:57 + * @description: + */ +public class InvoiceHaederActivity extends BaseActivity { + + private CardView add_invoice_header; + private InvoiceRequest ir; + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what){ + case 200: + + break; + default:break; + } + } + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_invoice_history); + con=this; + act=this; + //add_invoice_header=findViewById(R.id.add_invoice_header); + ir=new InvoiceRequest(con,hd); + initView(null); + } + + @Override + public void initView(Object obj) { + super.initView(obj); + add_invoice_header.setOnClickListener(v -> { + Intent in=new Intent(con, InvoiceHaederAddActivity.class); + startActivity(in); + }); + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/my/invoice/InvoiceHaederAddActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/my/invoice/InvoiceHaederAddActivity.java new file mode 100644 index 0000000..4eeb530 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/my/invoice/InvoiceHaederAddActivity.java @@ -0,0 +1,124 @@ +package com.oneclouds.cargo.ui.my.invoice; + +import android.os.Bundle; +import android.os.Message; +import android.widget.Button; +import android.widget.EditText; +import android.widget.Toast; + +import androidx.annotation.Nullable; + +import com.google.gson.Gson; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.BaseBean; +import com.oneclouds.cargo.bean.InvoiceHeaderBean; +import com.oneclouds.cargo.request.InvoiceRequest; +import com.oneclouds.cargo.request.bean.InvoiceHaederInputBena; +import com.oneclouds.cargo.util.StringUtil; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseActivity; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/23 9:59 + * @description: + */ +public class InvoiceHaederAddActivity extends BaseActivity { + + private Button submit; + private EditText title,phone,address,bankAccount,bankName,taxNo; + private InvoiceRequest ir; + private InvoiceHeaderBean ihb; + private Gson gson=new Gson(); + private int id=-1; + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what){ + case 200: + if(CacheGroup.cacheList.get(InvoiceRequest.INVOICE_TITLE_SAVE)!=null){ + BaseBean bb=gson.fromJson(CacheGroup.cacheList.get(InvoiceRequest.INVOICE_TITLE_SAVE),BaseBean.class); + if(bb.getCode()==200){ + Toast.makeText(con,"保存成功",Toast.LENGTH_SHORT).show(); + finish(); + }else{ + Toast.makeText(con, StringUtil.isNull(bb.getMsg(),"出现错误"),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(InvoiceRequest.INVOICE_TITLE_SAVE); + } + if(CacheGroup.cacheList.get(InvoiceRequest.INVOICE_FIND_SHIPPER_INVOICE_TITLE)!=null){ + ihb=gson.fromJson(CacheGroup.cacheList.get(InvoiceRequest.INVOICE_FIND_SHIPPER_INVOICE_TITLE),InvoiceHeaderBean.class); + if(ihb.getCode()==200){ + initData(); + }else{ + Toast.makeText(con, StringUtil.isNull(ihb.getMsg(),"出现错误"),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(InvoiceRequest.INVOICE_FIND_SHIPPER_INVOICE_TITLE); + } + break; + default:break; + } + } + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_invoicing_company); + con=this; + act=this; + submit=findViewById(R.id.submit); + title=findViewById(R.id.title); + phone=findViewById(R.id.phone); + address=findViewById(R.id.address); + bankAccount=findViewById(R.id.bankAccount); + bankName=findViewById(R.id.bankName); + taxNo=findViewById(R.id.taxNo); + ir=new InvoiceRequest(con,hd); + initView(null); + } + + @Override + public void initView(Object obj) { + super.initView(obj); + submit.setOnClickListener(v -> { + submit(); + }); + ir.invoiceHeader(); + } + + public void submit(){ + String titleStr=title.getText()+""; + String phoneStr=phone.getText()+""; + String addressStr=address.getText()+""; + String bankAccountStr=bankAccount.getText()+""; + String bankNameStr=bankName.getText()+""; + String taxNoStr=taxNo.getText()+""; + if (!titleStr.equals("") && !phoneStr.equals("") && !addressStr.equals("") && + !bankAccountStr.equals("") && !bankNameStr.equals("") && !taxNoStr.equals("")) { + InvoiceHaederInputBena ihi=new InvoiceHaederInputBena(); + ihi.setTitle(titleStr); + ihi.setAddress(addressStr); + ihi.setPhone(phoneStr); + ihi.setBankAccount(bankAccountStr); + ihi.setBankName(bankNameStr); + ihi.setTaxNo(taxNoStr); + ir.invoiceHeaderAdd(ihi,id); + } + } + + public void initData(){ + if (ihb.getData()!=null) { + id=ihb.getData().getId(); + title.setText(ihb.getData().getTitle()); + phone.setText(ihb.getData().getPhone()); + address.setText(ihb.getData().getAddress()); + bankAccount.setText(ihb.getData().getBankAccount()); + bankName.setText(ihb.getData().getBankName()); + taxNo.setText(ihb.getData().getTaxNo()); + } + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/my/invoice/InvoiceHistoryActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/my/invoice/InvoiceHistoryActivity.java new file mode 100644 index 0000000..a8497ef --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/my/invoice/InvoiceHistoryActivity.java @@ -0,0 +1,124 @@ +package com.oneclouds.cargo.ui.my.invoice; + +import android.content.Intent; +import android.os.Bundle; +import android.os.Message; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; + +import com.google.gson.Gson; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.InvoiceListBean; +import com.oneclouds.cargo.request.InvoiceRequest; +import com.oneclouds.cargo.util.adapter.AdapterAlls; +import com.oneclouds.cargo.util.adapter.ManyBean; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseActivity; +import com.oneclouds.cargo.util.view.BaseRecyclerView; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/24 17:49 + * @description: + */ +public class InvoiceHistoryActivity extends BaseActivity { + + private BaseRecyclerView brv; + private InvoiceRequest ir; + private InvoiceListBean ilb; + private Gson gson=new Gson(); + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what){ + case 200: + if(CacheGroup.cacheList.get(InvoiceRequest.INVOICE_FIND_PAGE)!=null){ + ilb=gson.fromJson(CacheGroup.cacheList.get(InvoiceRequest.INVOICE_FIND_PAGE), InvoiceListBean.class); + if(ilb.getCode()==200){ + initView(null); + }else{ + Toast.makeText(con,ilb.getMsg(),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(InvoiceRequest.INVOICE_FIND_PAGE); + } + break; + } + } + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_invoice_history); + con=this; + setTitle("开票历史"); + brv=findViewById(R.id.brv); + ir=new InvoiceRequest(con,hd); + ir.invoiceSave(1,10); + + } + + @Override + public void initView(Object obj) { + super.initView(obj); + List list=new ArrayList<>(); + for (InvoiceListBean.DataDTO.RecordsDTO record : ilb.getData().getRecords()) { + //Timer.get + record.setApplyTime(formatChange(record.getApplyTime(),"yyyy-MM-dd HH:mm:ss","yyyy-MM-dd HH:mm")); + list.add(new ManyBean(record,R.layout.item_invoice_history)); + } + if(list.size()==0){ + list.add(new ManyBean(new Model(),R.layout.item_null_list)); + } + brv.creates(con,list).setOnItemViewListener(new AdapterAlls.onItemViewListenter() { + @Override + public void onItemView(int position, Object o, View v, int layout) { + switch (layout){ + case R.layout.item_invoice_history: + TextView orderNum=v.findViewById(R.id.orderNum); + InvoiceListBean.DataDTO.RecordsDTO record= (InvoiceListBean.DataDTO.RecordsDTO) o; + orderNum.setText(record.getOrderList().get(0).getOrderNum()); + ImageView state_img=v.findViewById(R.id.state_img); + if(record.getMakeStatus()==107001){ + state_img.setImageResource(R.mipmap.invoicing_state); + }else if(record.getMakeStatus()==107002){ + state_img.setImageResource(R.mipmap.invoicing); + v.setOnClickListener(v1 -> { + Intent in=new Intent(con,InvoiceDetailsActivity.class); + in.putExtra("record",gson.toJson(o)); + startActivity(in); + }); + }else{ + + } + break; + } + } + }); + } + public static String formatChange(String time,String old,String news){ + SimpleDateFormat sdf = new SimpleDateFormat(old); + SimpleDateFormat sdf1 = new SimpleDateFormat(news); + try { + Date date=sdf.parse(time); + return sdf1.format(date); + } catch (ParseException e) { + e.printStackTrace(); + } + return ""; + } + class Model{ + + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/news/NewsActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/news/NewsActivity.java new file mode 100644 index 0000000..8b35a1d --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/news/NewsActivity.java @@ -0,0 +1,169 @@ +package com.oneclouds.cargo.ui.news; + +import android.content.Intent; +import android.os.Bundle; +import android.os.Message; +import android.view.View; +import android.widget.ImageView; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; + +import com.google.gson.Gson; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.BaseBean; +import com.oneclouds.cargo.bean.NewsListBean; +import com.oneclouds.cargo.request.PublicRequest; +import com.oneclouds.cargo.util.adapter.ManyBean; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.http.RequsetCodeConstants; +import com.oneclouds.cargo.util.time.Timer; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseActivity; +import com.oneclouds.cargo.util.view.BaseRecyclerView; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/16 15:11 + * @description: + */ +public class NewsActivity extends BaseActivity { + + private BaseRecyclerView brv; + private TextView title_view,del_news; + private PublicRequest pr; + private NewsListBean nb; + private int index=1; + private int type; + private String title; + private List list_id=new ArrayList<>(); + private Model xm=new Model(); + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what){ + case RequsetCodeConstants.SUCCESS: + if(CacheGroup.cacheList.get(PublicRequest.NEW_LIST)!=null && index==1){ + nb=new Gson().fromJson(CacheGroup.cacheList.get(PublicRequest.NEW_LIST), NewsListBean.class); + if(nb.getCode()==200){ + initView(null); + }else{ + Toast.makeText(con,nb.getMsg(),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(PublicRequest.NEW_LIST); + } + if(CacheGroup.cacheList.get(PublicRequest.NEW_LIST)!=null && index!=1){ + nb=new Gson().fromJson(CacheGroup.cacheList.get(PublicRequest.NEW_LIST), NewsListBean.class); + if(nb.getCode()==200){ + initAdd(); + }else{ + Toast.makeText(con,nb.getMsg(),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(PublicRequest.NEW_LIST); + } + if(CacheGroup.cacheList.get(PublicRequest.NEWS_READ_ALL)!=null){ + BaseBean bb=new Gson().fromJson(CacheGroup.cacheList.get(PublicRequest.NEWS_READ_ALL),BaseBean.class); + if(bb.getCode()==200){ + Toast.makeText(con,"已经读取了全部消息",Toast.LENGTH_SHORT).show(); + }else{ + Toast.makeText(con,bb.getMsg(),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(PublicRequest.NEWS_READ_ALL); + } + break; + } + } + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_news); + brv=findViewById(R.id.brv); + title_view=findViewById(R.id.title_view); + del_news=findViewById(R.id.del_news); + con=this; + act=this; + Intent in=getIntent(); + type=in.getExtras().getInt("news_type"); + title=in.getExtras().getString("news_title"); + pr=new PublicRequest(con,hd); + del_news.setOnClickListener(v -> { + if(list_id.size()>0){ + xm.setIds(list_id); + pr.delNewsAll(xm.getIds()); + }else{ + Toast.makeText(con,"当前没有可读的消息",Toast.LENGTH_SHORT).show(); + } + }); + pr.getNewsList(type,index,20); + } + + + @Override + public void initView(Object obj) { + super.initView(obj); + title_view.setText(title); + List list=new ArrayList<>(); + for (NewsListBean.DataDTO.RecordsDTO record : nb.getData().getRecords()) { + list.add(new ManyBean(record, R.layout.item_news_del)); + } + if(list.size()<1){ + list.add(new ManyBean(new Model(), R.layout.item_empty)); + } + brv.creates(con,list).setOnItemViewListener((position, o, v, layout) -> { + switch (layout){ + case R.layout.item_news_del: + NewsListBean.DataDTO.RecordsDTO ndr= (NewsListBean.DataDTO.RecordsDTO) o; + TextView createTime=v.findViewById(R.id.createTime); + TextView type_view=v.findViewById(R.id.type); + ImageView read=v.findViewById(R.id.read); + createTime.setText(Timer.formatChange(ndr.getCreateTime(),"yyyy-MM-dd HH:mm:ss","MM/dd HH:mm")); + if(ndr.getIsRead()==0){ + read.setVisibility(View.VISIBLE); + list_id.add(ndr.getId()); + } + + break; + case R.layout.item_empty: + ImageView que=v.findViewById(R.id.que); + TextView que_text=v.findViewById(R.id.que_text); + que.setImageResource(R.mipmap.no_news); + que_text.setText("暂时没有消息~"); + break; + default:break; + } + }); + } + + public void initAdd(){ + + } + + public static class Model{ + + private int id; + private List ids; + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public List getIds() { + return ids; + } + + public void setIds(List ids) { + this.ids = ids; + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/news/NewsFragment.java b/app/src/main/java/com/oneclouds/cargo/ui/news/NewsFragment.java new file mode 100644 index 0000000..0b51935 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/news/NewsFragment.java @@ -0,0 +1,135 @@ +package com.oneclouds.cargo.ui.news; + +import android.content.Intent; +import android.os.Bundle; +import android.os.Message; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import com.google.gson.Gson; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.NewsNotBean; +import com.oneclouds.cargo.request.PublicRequest; +import com.oneclouds.cargo.util.adapter.ManyBean; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.http.RequsetCodeConstants; +import com.oneclouds.cargo.util.view.BaseFragment; +import com.oneclouds.cargo.util.view.BaseRecyclerView; + +import org.jetbrains.annotations.NotNull; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/13 10:00 + * @description: + */ +public class NewsFragment extends BaseFragment { + + private BaseRecyclerView brv; + private PublicRequest pr; + private NewsNotBean nnb; + private Gson gson=new Gson(); + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what){ + case -1: + + break; + case RequsetCodeConstants.SUCCESS: + if(CacheGroup.cacheList.get(PublicRequest.NOT_NEWS_COUNT)!=null){ + nnb=gson.fromJson(CacheGroup.cacheList.get(PublicRequest.NOT_NEWS_COUNT),NewsNotBean.class); + if (nnb.getCode()==200) { + initView(null); + }else{ + Toast.makeText(con,nnb.getMsg(),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(PublicRequest.NOT_NEWS_COUNT); + } + break; + default:break; + } + } + @Nullable + @org.jetbrains.annotations.Nullable + @Override + public View onCreateView(@NonNull @NotNull LayoutInflater inflater, @Nullable @org.jetbrains.annotations.Nullable ViewGroup container, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) { + root=inflater.inflate(R.layout.fragment_news,container,false); + con=getContext(); + act=getActivity(); + brv=root.findViewById(R.id.rv); + pr=new PublicRequest(con,hd); + pr.getNotNewsCount(); + return root; + } + + @Override + public void initView(Object obj) { + super.initView(obj); + List list=new ArrayList<>(); + list.add(new ManyBean(new Model("系统消息", R.mipmap.icon_news_xitong), R.layout.item_news)); + list.add(new ManyBean(new Model("订单消息", R.mipmap.icon_news_pingjia), R.layout.item_news)); + list.add(new ManyBean(new Model("账户消息", R.mipmap.icon_news_account), R.layout.item_news)); + brv.creates(con,list).setOnItemViewListener((position, o, v, layout) -> { + Model m= (Model) o; + ImageView img=v.findViewById(R.id.type_imgs); + TextView body=v.findViewById(R.id.body); + TextView timer=v.findViewById(R.id.timer); + TextView title=v.findViewById(R.id.title); + img.setImageResource(m.getType_img()); + NewsNotBean.DataDTO xd=nnb.getData().get(position); + if(xd.getCount()>0){ + title.setText(xd.getMessageTypeName()); + body.setText("您有"+xd.getCount()+"条最新消息"); + } + v.setOnClickListener(v1 -> { + Intent in=new Intent(con,NewsActivity.class); + in.putExtra("news_type",xd.getVcode()); + in.putExtra("news_title",m.getType()); + startActivity(in); + }); + }); + } + + class Model{ + + private String type; + private int type_img; + + public Model(String type, int type_img) { + this.type = type; + this.type_img = type_img; + } + + public Model() { + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public int getType_img() { + return type_img; + } + + public void setType_img(int type_img) { + this.type_img = type_img; + } + + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/news/NewsXActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/news/NewsXActivity.java new file mode 100644 index 0000000..c9f065e --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/news/NewsXActivity.java @@ -0,0 +1,32 @@ +package com.oneclouds.cargo.ui.news; + +import android.os.Bundle; + +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; + +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseAppCompatActivity; +import com.oneclouds.cargo.util.view.BottomTabUtil; + +/** + * @author hlh + * @version 1.0.0 + * @date 2022/1/6 18:03 + * @description: + */ +public class NewsXActivity extends BaseAppCompatActivity { + + @Override + protected void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_news_x); + Fragment[] fs=new Fragment[1]; + fs[0] =new NewsFragment(); + BottomTabUtil bt =new BottomTabUtil(this,R.id.body, fs); + bt.selectItem(fs[0]); + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/parts/ConfigParts.java b/app/src/main/java/com/oneclouds/cargo/ui/parts/ConfigParts.java new file mode 100644 index 0000000..9b0c194 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/parts/ConfigParts.java @@ -0,0 +1,33 @@ +package com.oneclouds.cargo.ui.parts; + +import android.content.Context; + +import com.google.gson.Gson; +import com.oneclouds.cargo.bean.ConfigBean; +import com.oneclouds.cargo.util.SPUtil; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/14 16:41 + * @description: + */ +public class ConfigParts { + private static Gson gson=new Gson(); + + public static ConfigBean getConfigParts(Context con){ + String configBean= SPUtil.getSP(con,"data","configdata"); + if(configBean.equals("")){ + return null; + }else { + return gson.fromJson(configBean, ConfigBean.class); + } + } + + public static void setParts(Context con, ConfigBean cb){ + if(cb!=null){ + //数据修改 + SPUtil.insSP(con,"data","configdata",gson.toJson(cb)); + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/parts/TypeParts.java b/app/src/main/java/com/oneclouds/cargo/ui/parts/TypeParts.java new file mode 100644 index 0000000..04b2459 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/parts/TypeParts.java @@ -0,0 +1,109 @@ +package com.oneclouds.cargo.ui.parts; + +import android.content.Context; + +import com.google.gson.Gson; +import com.oneclouds.cargo.bean.AlGoodsTypeListBean; +import com.oneclouds.cargo.bean.BusinssTypeBean; +import com.oneclouds.cargo.bean.CarTypeLongBean; +import com.oneclouds.cargo.bean.NpListBean; +import com.oneclouds.cargo.bean.PackNameBean; +import com.oneclouds.cargo.constant.SPConstant; +import com.oneclouds.cargo.request.CateRequest; +import com.oneclouds.cargo.request.OrderRequest; +import com.oneclouds.cargo.util.SPUtil; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/15 17:31 + * @description: + */ +public class TypeParts { + + private static Gson gson=new Gson(); + + //交通厅大类 + public static NpListBean getNpType(Context con){ + String str=SPUtil.getSP(con,"chacheData", CateRequest.CATE_NPLIST); + if(!str.equals("")){ + NpListBean npList=gson.fromJson(str,NpListBean.class); + if(npList.getCode()==200){ + return npList; + }else{ + return null; + } + } + return null; + } + //安联大类 + public static AlGoodsTypeListBean getAlType(Context con){ + String str=SPUtil.getSP(con,"chacheData", CateRequest.CATE_NPLIST_AL); + if(!str.equals("")){ + AlGoodsTypeListBean altype=gson.fromJson(str,AlGoodsTypeListBean.class); + if(altype.getCode()==200){ + return altype; + }else{ + return null; + } + } + return null; + } + //车型车长 + public static CarTypeLongBean getCarTypeLong(Context con){ + String str=SPUtil.getSP(con,"chacheData", OrderRequest.ORDER_CAR_TYPE_AND_CAR_LONG); + if(!str.equals("")){ + CarTypeLongBean ctlb=gson.fromJson(str,CarTypeLongBean.class); + if(ctlb.getCode()==200){ + return ctlb; + }else{ + return null; + } + } + return null; + } + //业务类型 + public static BusinssTypeBean getBusType(Context con){ + String str=SPUtil.getSP(con,"chacheData", OrderRequest.ORDER_BUSINESS_TYPE_LIST); + if(!str.equals("")){ + BusinssTypeBean btb=gson.fromJson(str,BusinssTypeBean.class); + if(btb.getCode()==200){ + return btb; + }else{ + return null; + } + } + return null; + } + //包装方式 + public static PackNameBean getPackName(Context con){ + String str=SPUtil.getSP(con,"chacheData", OrderRequest.ORDER_PACK_NAME_LIST); + if(!str.equals("")){ + PackNameBean pnb=gson.fromJson(str,PackNameBean.class); + if(pnb.getCode()==200){ + return pnb; + }else{ + return null; + } + } + return null; + } + + //账户类型 + public static int getRoleId(Context con){ + String str=SPUtil.getSP(con, SPConstant.DATA_USER,"roleId"); + if("".equals(str)){ + return -1; + } + return Integer.parseInt(str); + } + + //是否委托方账户 + public static boolean isEntrust(Context con){ + if (getRoleId(con)==103){ + return true; + } + return false; + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/parts/UserParts.java b/app/src/main/java/com/oneclouds/cargo/ui/parts/UserParts.java new file mode 100644 index 0000000..05fc1dc --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/parts/UserParts.java @@ -0,0 +1,36 @@ +package com.oneclouds.cargo.ui.parts; + +import android.content.Context; + +import com.google.gson.Gson; +import com.oneclouds.cargo.bean.UserBean; +import com.oneclouds.cargo.constant.SPConstant; +import com.oneclouds.cargo.util.SPUtil; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/6 8:32 + * @description:账户部件 + */ +public class UserParts { + + private static Gson gson=new Gson(); + //获取部件实例 + public static UserBean getUser(Context con){ + String userdata= SPUtil.getSP(con,SPConstant.DATA, SPConstant.DATA_USER); + if(userdata.equals("")){ + return null; + }else { + return gson.fromJson(userdata,UserBean.class); + } + } + public static void setUser(Context con,UserBean user){ + if(user!=null){ + //组件修改 + //WalletFragment.account.setText(user.getData().getAccount()); + //数据修改 + SPUtil.insSP(con,SPConstant.DATA, SPConstant.DATA_USER,gson.toJson(user)); + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/wallet/BannerApdate.java b/app/src/main/java/com/oneclouds/cargo/ui/wallet/BannerApdate.java new file mode 100644 index 0000000..22c0fda --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/wallet/BannerApdate.java @@ -0,0 +1,70 @@ +package com.oneclouds.cargo.ui.wallet; + + +import android.content.Context; +import android.view.View; +import android.view.ViewGroup; + +import com.oneclouds.cargo.util.adapter.ManyBean; +import com.oneclouds.cargo.util.bean.GetObjectName; +import com.zhpan.bannerview.BaseBannerAdapter; +import com.zhpan.bannerview.BaseViewHolder; + +import java.util.List; + + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/8/19 11:03 + * @description: + */ +public class BannerApdate extends BaseBannerAdapter { + + private int layout; + private List object; + private Context con; + // private List> bvs=new ArrayList<>(); + // public void initBvs(int size){ + // for(int i=0;i holder, Object data, int position, int pageSize){ + View v=holder.itemView; + ViewGroup vg=v.findViewById(v.getId()); + GetObjectName.ZIModel(vg,data,con); + listenterView.onItemView(position,object,holder, layout); + } + + + @Override + public int getLayoutId(int viewType) { + return layout; + } + +// public View getItemView(int position){ +// if(bvs.get(position)!=null){ +// return bvs.get(position).itemView; +// } +// return null; +// } +// +// public int getItemSize(){ +// return bvs.size(); +// } +// public List> getBvs() { +// return bvs; +// } + + private onItemViewListenter listenterView; + public void setOnItemViewListener(onItemViewListenter listenterView) { this.listenterView = listenterView; } + public interface onItemViewListenter { void onItemView(int position, Object o, BaseViewHolder v, int layout);} + + } diff --git a/app/src/main/java/com/oneclouds/cargo/ui/wallet/RechargeActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/wallet/RechargeActivity.java new file mode 100644 index 0000000..a3d6dc2 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/wallet/RechargeActivity.java @@ -0,0 +1,24 @@ +package com.oneclouds.cargo.ui.wallet; + +import android.os.Bundle; + +import androidx.annotation.Nullable; + +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.util.view.BaseActivity; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/16 16:00 + * @description: + */ +public class RechargeActivity extends BaseActivity { + + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_recharge); + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/wallet/UpBankActivity.java b/app/src/main/java/com/oneclouds/cargo/ui/wallet/UpBankActivity.java new file mode 100644 index 0000000..f7298c7 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/wallet/UpBankActivity.java @@ -0,0 +1,149 @@ +package com.oneclouds.cargo.ui.wallet; + +import android.content.Intent; +import android.net.Uri; +import android.os.Bundle; +import android.os.Message; +import android.util.Log; +import android.widget.ImageView; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; + +import com.bumptech.glide.Glide; +import com.google.gson.Gson; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.BaseBean; +import com.oneclouds.cargo.bean.ocr.OCRBankBean; +import com.oneclouds.cargo.request.OCRRequest; +import com.oneclouds.cargo.request.PublicRequest; +import com.oneclouds.cargo.request.bean.InsBankInputBean; +import com.oneclouds.cargo.util.ImageUtil.GetImageAlert; +import com.oneclouds.cargo.util.ImageUtil.ImageUriUtil; +import com.oneclouds.cargo.util.alert.CustomDialog; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.file.ImageFileCompressUtil; +import com.oneclouds.cargo.util.http.RequsetCodeConstants; +import com.oneclouds.cargo.util.titleutil.StateStyleUtil; +import com.oneclouds.cargo.util.view.BaseAppCompatActivity; + +import java.io.File; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/16 16:22 + * @description: + */ +public class UpBankActivity extends BaseAppCompatActivity { + + private PublicRequest pr; + private OCRRequest or; + private ImageView up_bank_img; + private TextView bank_name,bank_number,submit; + private ImageView return_btn; + private GetImageAlert gia=new GetImageAlert(); + private String path; + private OCRBankBean ib; + + @Override + public void msgMethod(Message m) { + super.msgMethod(m); + switch (m.what){ + case RequsetCodeConstants.SUCCESS: + if (CacheGroup.cacheList.get(OCRRequest.OCR_BANK)!=null) { + ib=new Gson().fromJson(CacheGroup.cacheList.get(OCRRequest.OCR_BANK),OCRBankBean.class); + if(ib.getCode()==200){ + initView(null); + customDialog.dismiss(); + //WalletFragment.isInsBank=true; + }else{ + Toast.makeText(con,ib.getMsg(),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(OCRRequest.OCR_BANK); + } + if(CacheGroup.cacheList.get(PublicRequest.BANK_CARD_ADD)!=null){ + BaseBean bb=new Gson().fromJson(CacheGroup.cacheList.get(PublicRequest.BANK_CARD_ADD),BaseBean.class); + if(bb.getCode()==200){ + Toast.makeText(con,"绑定成功",Toast.LENGTH_SHORT).show(); + finish(); + }else{ + Toast.makeText(con,bb.getMsg(),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(PublicRequest.BANK_CARD_ADD); + } + break; + case ImageFileCompressUtil.COMPRESS_SUCCESS: + customDialog=new CustomDialog(con, "上传识别中..."); + customDialog.show(); + path = (String) m.obj; + or.ORCBank(new File(path)); + break; + } + } + private CustomDialog customDialog; + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + StateStyleUtil.stateTextColor(this); + setContentView(R.layout.activity_bank_auth); + act=this; + con=this; + up_bank_img=findViewById(R.id.up_bank_img); + bank_name=findViewById(R.id.bank_name); + bank_number=findViewById(R.id.bank_number); + submit=findViewById(R.id.submit); + return_btn=findViewById(R.id.return_btn); + up_bank_img.setOnClickListener(v -> { + gia.showPopueWindow(this); + }); + submit.setOnClickListener(v -> { + if(ib!=null){ + submit(); + }else{ + Toast.makeText(con,"请先上传图片",Toast.LENGTH_SHORT).show(); + } + }); + return_btn.setOnClickListener(v -> { + finish(); + }); + pr=new PublicRequest(con,hd); + or=new OCRRequest(con,hd); + } + + @Override + public void initView(Object obj) { + super.initView(obj); + bank_name.setText(ib.getData().getBankName()); + bank_number.setText(ib.getData().getBankCardNumber()); + Glide.with(con).load(ib.getData().getUrl()).into(up_bank_img); + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (requestCode == 11 && resultCode == RESULT_OK) { + Uri selectedImage = data.getData(); + path= ImageUriUtil.uriTurnPath(selectedImage,con); + Log.e("图片地址:",path); + gia.dis(); + ImageFileCompressUtil.imageFileCompress(con,new File(path),hd); + } else if (requestCode == 12 && resultCode == RESULT_OK) { + path=gia.getFile().getPath(); + Log.e("图片地址:",path); + gia.dis(); + ImageFileCompressUtil.imageFileCompress(con,new File(path),hd); + } + } + + public void submit(){ + InsBankInputBean ibib =new InsBankInputBean(); + ibib.setCardNo(ib.getData().getBankCardNumber()); + ibib.setCardType(Integer.parseInt(ib.getData().getBankCardType())); + ibib.setBankName(ib.getData().getBankName()); + ibib.setCardUserType(1); + Log.e("-res-",new Gson().toJson(ibib)); + pr.insBankCard(ibib); + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/ui/wallet/WalletFragment.java b/app/src/main/java/com/oneclouds/cargo/ui/wallet/WalletFragment.java new file mode 100644 index 0000000..db3084d --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/ui/wallet/WalletFragment.java @@ -0,0 +1,256 @@ +package com.oneclouds.cargo.ui.wallet; + +import android.content.Intent; +import android.os.Bundle; +import android.os.Message; +import android.util.Log; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.RelativeLayout; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import com.google.gson.Gson; +import com.lxj.xpopup.XPopup; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.bean.BankCardListBean; +import com.oneclouds.cargo.bean.BaseBean; +import com.oneclouds.cargo.bean.ContractsBean; +import com.oneclouds.cargo.bean.UserBean; +import com.oneclouds.cargo.request.PublicRequest; +import com.oneclouds.cargo.ui.home.OrderListActivity; +import com.oneclouds.cargo.ui.parts.UserParts; +import com.oneclouds.cargo.util.StringUtil; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.http.RequsetCodeConstants; +import com.oneclouds.cargo.util.view.BaseFragment; +import com.oneclouds.cargo.util.view.BaseRecyclerView; + +import org.jetbrains.annotations.NotNull; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/13 10:00 + * @description: + */ +public class WalletFragment extends BaseFragment { + + private UserBean ub; + private BankCardListBean bcb; + private PublicRequest pr; + private ContractsBean cb; + private TextView account; + private Gson gson=new Gson(); + private boolean iscon=false; + public static UserBean userBean; + + @Override + public void msgMethod(Message m) { + switch (m.what){ + case -1: + refreshLayout.finishRefresh(); + break; + case RequsetCodeConstants.SUCCESS: + refreshLayout.finishRefresh(); + //银行卡信息接收 + if(CacheGroup.cacheList.get(pr.BANK_CARD_LIST)!=null){ + bcb=new Gson().fromJson(CacheGroup.cacheList.get(pr.BANK_CARD_LIST), BankCardListBean.class); + if(bcb.getCode()==200){ + initBack(); + }else{ + Toast.makeText(con,bcb.getMsg(),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(pr.BANK_CARD_LIST); + } + //电子账户信息接收 + if (CacheGroup.cacheList.get(pr.CONTRACTS_GET)!=null) { + cb=new Gson().fromJson(CacheGroup.cacheList.get(pr.CONTRACTS_GET), ContractsBean.class); + if(cb.getCode()==200){ + initContracts(); + }else{ + Toast.makeText(con,cb.getMsg(),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(pr.CONTRACTS_GET); + } + //用户信息接收 + if(CacheGroup.cacheList.get(pr.USER_DATA)!=null){ + userBean=gson.fromJson(CacheGroup.cacheList.get(pr.USER_DATA), UserBean.class); + if(userBean.getCode()==200){ + UserParts.setUser(con,userBean); + initUser(); + }else{ + Toast.makeText(con,userBean.getMsg(),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(pr.USER_DATA); + } + //删除银行卡返回信息接收 + if(CacheGroup.cacheList.get(pr.BANK_CARD_DELETE)!=null){ + BaseBean bb=new Gson().fromJson(CacheGroup.cacheList.get(pr.BANK_CARD_DELETE),BaseBean.class); + if(bb.getCode()==200){ + Toast.makeText(con,"删除银行卡成功",Toast.LENGTH_SHORT).show(); + refreshLayout.autoRefresh(); + }else{ + Toast.makeText(con,StringUtil.isNull(bb.getMsg(),"出现错误"),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(pr.BANK_CARD_DELETE); + } + //开通电子账户返回信息接收 + if(CacheGroup.cacheList.get(pr.CONTRACTS_ADD)!=null){ + BaseBean bb=new Gson().fromJson(CacheGroup.cacheList.get(pr.CONTRACTS_ADD),BaseBean.class); + if(bb.getCode()==200){ + Toast.makeText(con,"电子账户开通成功",Toast.LENGTH_SHORT).show(); + refreshLayout.autoRefresh(); + }else{ + Toast.makeText(con,bb.getMsg(),Toast.LENGTH_SHORT).show(); + } + CacheGroup.cacheList.remove(pr.CONTRACTS_ADD); + } + break; + case 502: + refreshLayout.finishRefresh(); + Toast.makeText(con,"502",Toast.LENGTH_SHORT).show(); + break; + default:break; + } + } + + private BaseRecyclerView rv; + + @Nullable + @org.jetbrains.annotations.Nullable + @Override + public View onCreateView(@NonNull @NotNull LayoutInflater inflater, @Nullable @org.jetbrains.annotations.Nullable ViewGroup container, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) { + root=inflater.inflate(R.layout.fragment_wallet,container,false); + con=root.getContext(); + rv=root.findViewById(R.id.rv); + pr=new PublicRequest(con,hd); + initId(); + initView(null); + initRefreshLoad(); + return root; + } + + //加载和刷新 + public void initRefreshLoad(){ + refreshLayout=root.findViewById(R.id.srl); + refreshLayout.setOnRefreshListener(refreshLayout -> { + Log.e("下拉刷新","pps"); + pr.getBankCardList(); + pr.getContracts(); + pr.getUserInfo(); + }); + refreshLayout.autoRefresh(); + } + + private TextView bank_title_1,bank_title_2,bank_number,bank2_number; + private ImageView bank_add,bank_add2,bank_right,bank2_right,bank_remove,tixian; + private RelativeLayout explain,orderAll; + + //绑定id + public void initId(){ + account=root.findViewById(R.id.account); + bank_title_1=root.findViewById(R.id.bank_title_1); + bank_title_2=root.findViewById(R.id.bank_title_2); + bank_add=root.findViewById(R.id.bank_add); + bank_add2=root.findViewById(R.id.bank_add2); + bank_right=root.findViewById(R.id.bank_right); + bank2_right=root.findViewById(R.id.bank2_right); + bank_number=root.findViewById(R.id.bank_number); + bank2_number=root.findViewById(R.id.bank2_number); + tixian=root.findViewById(R.id.tixian); + explain=root.findViewById(R.id.explain); + orderAll=root.findViewById(R.id.orderAll); + bank_remove=root.findViewById(R.id.bank_remove); + //提现 + tixian.setOnClickListener(v -> { + + }); + //好运值说明 + explain.setOnClickListener(v -> { +// new XPopup.Builder(con) +// .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 +// .asConfirm("线下充值小贴士", "收款方:河南大河速递\n开户行:上海浦东发展银行经开区支行\n银行账号:76290078801700001880\n转账备注:"+number+"\n如果您的充值未及时到账请拨打银行客服电话02195528", +// "取消", "确认", +// () -> Log.e("1","1"), null, false, R.layout.alert_close) //最后一个参数绑定已有布局 +// .show(); + }); + //运单量 + orderAll.setOnClickListener(v -> { + Intent in=new Intent(con, OrderListActivity.class); + startActivity(in); + }); + //添加银行卡 + bank_add.setOnClickListener(v -> { + Intent in=new Intent(con,UpBankActivity.class); + startActivity(in); + }); + //添加电子账户 + bank_add2.setOnClickListener(v -> { + new XPopup.Builder(con) + .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + .asConfirm("请确认", "是否确定开通浦发银行电子账户?", + "取消", "确认", + () ->pr.addContracts(), null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局 + .show(); + }); + //解绑银行卡 + bank_remove.setOnClickListener(v -> new XPopup.Builder(con) + .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + .asConfirm("请确认", "是否确定删除此银行卡?", + "取消", "确认", + () ->pr.deleteBankCard(bcb.getData().getRecords().get(0).getId()) , null, false, R.layout.alert_ok_cancel) //最后一个参数绑定已有布局 + .show()); + + } + + //初始化账户信息 + public void initUser(){ + if(userBean.getData()!=null){ + account.setText(StringUtil.isNull(userBean.getData().getAccount(),"0")); + } + } + + //初始化银行卡信息 + public void initBack(){ + if(bcb.getData() !=null && bcb.getData().getRecords().size()==1){ + bank_title_1.setText(bcb.getData().getRecords().get(0).getBankName()); + bank_number.setText(bcb.getData().getRecords().get(0).getCardNo()); + bank_number.setVisibility(View.VISIBLE); + bank_add.setVisibility(View.GONE); + bank_remove.setVisibility(View.VISIBLE); + } + } + + private String number=""; + //初始化电子账户信息 + public void initContracts(){ + if(cb.getData()!=null && !StringUtil.isNull(cb.getData().getChildAcctNo(),"").equals("")) { + bank_title_2.setText("浦发银行电子账户"); + bank2_number.setText(cb.getData().getChildAcctNo()); + number=cb.getData().getChildAcctNo(); + bank2_number.setVisibility(View.VISIBLE); + bank_add2.setVisibility(View.GONE); + } + } + + public static boolean isInsBank=false; + + @Override + public void onResume() { + super.onResume(); + if (isInsBank) { + isInsBank=false; + refreshLayout.autoRefresh(); + } + } + + class model{ } + + +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/CashierInputFilter.java b/app/src/main/java/com/oneclouds/cargo/util/CashierInputFilter.java new file mode 100644 index 0000000..16696b9 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/CashierInputFilter.java @@ -0,0 +1,97 @@ +package com.oneclouds.cargo.util; + +import android.text.InputFilter; +import android.text.Spanned; +import android.text.TextUtils; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/10/12 20:11 + * @description: + */ +public class CashierInputFilter implements InputFilter { + Pattern mPattern; + + //输入的最大金额 + private static final int MAX_VALUE = Integer.MAX_VALUE; + //小数点后的位数 + private static final int POINTER_LENGTH = 2; + + private static final int LENGTH=9; + private static final String POINTER = "."; + + private static final String ZERO = "0"; + + public CashierInputFilter() { + mPattern = Pattern.compile("([0-9]|\\.)*"); + } + + /** + * @param source 新输入的字符串 + * @param start 新输入的字符串起始下标,一般为0 + * @param end 新输入的字符串终点下标,一般为source长度-1 + * @param dest 输入之前文本框内容 + * @param dstart 原内容起始坐标,一般为0 + * @param dend 原内容终点坐标,一般为dest长度-1 + * @return 输入内容 + */ + @Override + public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { + String sourceText = source.toString(); + String destText = dest.toString(); + + //验证删除等按键 + if (TextUtils.isEmpty(sourceText)) { + return ""; + } + + Matcher matcher = mPattern.matcher(source); + //已经输入小数点的情况下,只能输入数字 + if(destText.contains(POINTER)) { + if (!matcher.matches()) { + return ""; + } else { + if (POINTER.equals(source.toString())) { //只能输入一个小数点 + return ""; + } + } + + //验证小数点精度,保证小数点后只能输入两位 + int index = destText.indexOf(POINTER); + int length = dend - index; + + if (length > POINTER_LENGTH) { + return dest.subSequence(dstart, dend); + } + } else { + /** + * 没有输入小数点的情况下,只能输入小数点和数字 + * 1. 首位不能输入小数点 + * 2. 如果首位输入0,则接下来只能输入小数点了 + */ + if (!matcher.matches()) { + return ""; + } else { + if ((POINTER.equals(source.toString())) && TextUtils.isEmpty(destText)) { //首位不能输入小数点 + return ""; + } else if (!POINTER.equals(source.toString()) && ZERO.equals(destText)) { //如果首位输入0,接下来只能输入小数点 + return ""; + } + } + } + + //验证输入金额的大小 + double sumText = Double.parseDouble(destText + sourceText); + if (sumText > MAX_VALUE) { + return dest.subSequence(dstart, dend); + } + + return dest.subSequence(dstart, dend) + sourceText; + } + + +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/GDLocationUtil.java b/app/src/main/java/com/oneclouds/cargo/util/GDLocationUtil.java new file mode 100644 index 0000000..1974c27 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/GDLocationUtil.java @@ -0,0 +1,84 @@ +package com.oneclouds.cargo.util; + +import android.app.Activity; + +import com.amap.api.location.AMapLocationClient; +import com.amap.api.location.AMapLocationClientOption; +import com.amap.api.location.AMapLocationListener; +import com.oneclouds.cargo.ui.App; + +/** + * @ClassName GDLocationUtil + * @Author 用户 + * @Date 2021/9/23 15:11 + * @Description TODO + */ +public class GDLocationUtil { + private AMapLocationClient mLocationClient; + private AMapLocationClientOption mLocationOption; + + + private GDLocationUtil(){} + + public static final GDLocationUtil getInstance(){ + return SingletonHolder.INSTANCE; + } + + private static class SingletonHolder { + private static final GDLocationUtil INSTANCE = new GDLocationUtil(); + } + + public void getLocation(Activity ctx , AMapLocationListener aMapLocationListener){ +// AMapLocationClient.updatePrivacyShow(App.mApplication,true,true); +// AMapLocationClient.updatePrivacyAgree(App.mApplication,true); + //初始化定位 + try { + mLocationClient = new AMapLocationClient(ctx); + } catch (Exception e) { + e.printStackTrace(); + } + + //设置定位回调监听 + mLocationClient.setLocationListener(aMapLocationListener); + //初始化AMapLocationClientOption对象 + mLocationOption = new AMapLocationClientOption(); + + /** + * 设置定位场景,目前支持三种场景(签到、出行、运动,默认无场景) + */ + mLocationOption.setLocationPurpose(AMapLocationClientOption.AMapLocationPurpose.SignIn); + + + //设置定位模式为AMapLocationMode.Hight_Accuracy,高精度模式。 + mLocationOption.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy); +// mLocationOption?.setLocationMode(AMapLocationClientOption.AMapLocationMode.Battery_Saving) + + //获取一次定位结果: + //该方法默认为false。 + mLocationOption.setOnceLocation(true); + + //获取最近3s内精度最高的一次定位结果: +//设置setOnceLocationLatest(boolean b)接口为true,启动定位时SDK会返回最近3s内精度最高的一次定位结果。如果设置其为true,setOnceLocation(boolean b)接口也会被设置为true,反之不会,默认为false。 + mLocationOption.setOnceLocationLatest(true); + + //设置是否允许模拟位置,默认为true,允许模拟位置 + mLocationOption.setMockEnable(true); + + //给定位客户端对象设置定位参数 + mLocationClient.setLocationOption(mLocationOption); + if(null != mLocationClient){ + mLocationClient.setLocationOption(mLocationOption); + //设置场景模式后最好调用一次stop,再调用start以保证场景模式生效 + mLocationClient.stopLocation(); + mLocationClient.startLocation(); + } + } + + public void stopLocation(){ + if(null != mLocationClient){ + mLocationClient.stopLocation(); + } + } + + +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/HtmlAutoUtil.java b/app/src/main/java/com/oneclouds/cargo/util/HtmlAutoUtil.java new file mode 100644 index 0000000..7ec4609 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/HtmlAutoUtil.java @@ -0,0 +1,11 @@ +package com.oneclouds.cargo.util; + +public class HtmlAutoUtil { + public static String pinjie(String html) { + String head = "" + + " " + + "" + + ""; + return "" + head + "" + html + ""; + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/ImageUtil/GetImageAlert.java b/app/src/main/java/com/oneclouds/cargo/util/ImageUtil/GetImageAlert.java new file mode 100644 index 0000000..63ee550 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/ImageUtil/GetImageAlert.java @@ -0,0 +1,113 @@ +package com.oneclouds.cargo.util.ImageUtil; + +import android.Manifest; +import android.app.Activity; +import android.content.Intent; +import android.view.Gravity; +import android.view.View; +import android.view.WindowManager; +import android.widget.Button; +import android.widget.PopupWindow; +import androidx.appcompat.app.AppCompatActivity; + +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.util.ToastUtil; +import com.tbruyelle.rxpermissions3.RxPermissions; + +import java.io.File; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/8/16 8:43 + * @description: + */ +public class GetImageAlert { + + File file; + PopupWindow popupWindow; + public void showPopueWindow(AppCompatActivity act){ + View popView = View.inflate(act, R.layout.choice_img,null); + Button btn_xiangce =popView.findViewById(R.id.btn_xiangce); + Button btn_paizhao = popView.findViewById(R.id.btn_paizhao); + Button btn_quxiao = popView.findViewById(R.id.btn_quxiao); + //获取屏幕宽高 + int weight =act.getResources().getDisplayMetrics().widthPixels; + int height = act.getResources().getDisplayMetrics().heightPixels*1/3; + popupWindow = new PopupWindow(popView,weight,height); + //popupWindow.setAnimationStyle(R.style.anim_popup_dir); + popupWindow.setFocusable(true); + //点击外部popueWindow消失 + popupWindow.setOutsideTouchable(true); + + btn_xiangce.setOnClickListener(v -> { + + RxPermissions rxPermissions = new RxPermissions(act); + rxPermissions.request(Manifest.permission.READ_EXTERNAL_STORAGE) + .subscribe(aBoolean -> { + if (aBoolean) { + ImageGetUtil.AlbumGetImage(act); + } else { + ToastUtil.show(act,"开启权限失败,请手动开启权限"); + } + }); +// RxPermissions rp=new RxPermissions(act); +// rp.request( +// Manifest.permission.READ_EXTERNAL_STORAGE +// ).subscribe(b -> { +// if (b) { +// ImageGetUtil.AlbumGetImage(act); +// } else { +// ToastUtil.show(act,"开启权限失败,请手动开启权限"); +// } +// } +// ); + }); + btn_paizhao.setOnClickListener(v -> { + RxPermissions rxPermissions = new RxPermissions(act); + rxPermissions.request(Manifest.permission.CAMERA) + .subscribe(aBoolean -> { + if (aBoolean) { + file=ImageGetUtil.createImageFile(act); + ImageGetUtil.cameraAlbumGetImage(act,file); + } else { + ToastUtil.show(act,"开启权限失败,请手动开启权限"); + } + }); + + +// RxPermissions rp=new RxPermissions(act); +// rp.request( +// Manifest.permission.CAMERA +// ).subscribe(b -> { +// if (b) { +// file=ImageGetUtil.createImageFile(act); +// ImageGetUtil.cameraAlbumGetImage(act,file); +// } else { +// ToastUtil.show(act,"开启权限失败,请手动开启权限"); +// } +// } +// ); + }); + btn_quxiao.setOnClickListener(v -> popupWindow.dismiss()); + //popupWindow消失屏幕变为不透明 + popupWindow.setOnDismissListener(() -> { + WindowManager.LayoutParams lp = act.getWindow().getAttributes(); + lp.alpha = 1.0f; + act.getWindow().setAttributes(lp); + }); + //popupWindow出现屏幕变为半透明 + WindowManager.LayoutParams lp = act.getWindow().getAttributes(); + lp.alpha = 0.5f; + act.getWindow().setAttributes(lp); + popupWindow.showAtLocation(popView, Gravity.BOTTOM,0,50); + } + + public File getFile() { + return file; + } + + public void dis(){ + popupWindow.dismiss(); + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/ImageUtil/ImageGetUtil.java b/app/src/main/java/com/oneclouds/cargo/util/ImageUtil/ImageGetUtil.java new file mode 100644 index 0000000..41f8af2 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/ImageUtil/ImageGetUtil.java @@ -0,0 +1,71 @@ +package com.oneclouds.cargo.util.ImageUtil; + +import android.app.Activity; +import android.content.Intent; +import android.net.Uri; +import android.os.Build; +import android.os.Environment; +import android.provider.MediaStore; + +import androidx.core.content.FileProvider; + +import java.io.File; +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/7/30 16:41 + * @description:图片获取工具 + */ +public class ImageGetUtil { + + public static final int ALBUM_CODE=11; + public static final int CAMERA_CODE=12; + + public static void AlbumGetImage(Activity act){ + Intent intent = new Intent( + Intent.ACTION_PICK, + MediaStore.Images.Media.EXTERNAL_CONTENT_URI); + act.startActivityForResult(intent,ALBUM_CODE); + } + + public static void cameraAlbumGetImage(Activity act,File imageFile){ + Uri uri; + Intent takePhotoIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);//打开相机的Intent + if(takePhotoIntent.resolveActivity(act.getPackageManager())!=null){//这句作用是如果没有相机则该应用不会闪退,要是不加这句则当系统没有相机应用的时候该应用会闪退 + if(imageFile!=null){ + if(Build.VERSION.SDK_INT>= Build.VERSION_CODES.N){ + /*7.0以上要通过FileProvider将File转化为Uri*/ + uri = FileProvider.getUriForFile(act.getApplicationContext(),"com.oneclouds.cargo.fileprovider",imageFile); + }else { + /*7.0以下则直接使用Uri的fromFile方法将File转化为Uri*/ + uri = Uri.fromFile(imageFile); + } + takePhotoIntent.putExtra(MediaStore.EXTRA_OUTPUT,uri);//将用于输出的文件Uri传递给相机 + act.startActivityForResult(takePhotoIntent, CAMERA_CODE);//打开相机 + } + } + } + + /** + * 创建用来存储图片的文件,以时间来命名就不会产生命名冲突 + * @return 创建的图片文件 + */ + + public static File createImageFile(Activity act) { + String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()); + String imageFileName = "JPEG_"+timeStamp+"_"; + File storageDir = act.getExternalFilesDir(Environment.DIRECTORY_PICTURES); + File imageFile = null; + try { + imageFile = File.createTempFile(imageFileName,".jpg",storageDir); + } catch (IOException e) { + e.printStackTrace(); + } + return imageFile; + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/ImageUtil/ImageUriUtil.java b/app/src/main/java/com/oneclouds/cargo/util/ImageUtil/ImageUriUtil.java new file mode 100644 index 0000000..680dc4f --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/ImageUtil/ImageUriUtil.java @@ -0,0 +1,27 @@ +package com.oneclouds.cargo.util.ImageUtil; + +import android.content.Context; +import android.database.Cursor; +import android.net.Uri; +import android.provider.MediaStore; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/7/30 17:21 + * @description:uri转化工具 + */ +public class ImageUriUtil { + + public static String uriTurnPath(Uri uri, Context con){ + String path=""; + String[] filePathColumn = {MediaStore.Images.Media.DATA}; + Cursor cursor = con.getContentResolver().query(uri, + filePathColumn, null, null, null); + cursor.moveToFirst(); + int columnIndex = cursor.getColumnIndex(filePathColumn[0]); + path = cursor.getString(columnIndex); + return path; + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/LogUtil.java b/app/src/main/java/com/oneclouds/cargo/util/LogUtil.java new file mode 100644 index 0000000..a95776a --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/LogUtil.java @@ -0,0 +1,20 @@ +package com.oneclouds.cargo.util; + +import android.util.Log; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/10/8 10:12 + * @description: + */ +public class LogUtil { + + private static final boolean KEY=true; + + public static void e(String title,String value){ + if(KEY){ + Log.e(title,value); + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/MapUtil.java b/app/src/main/java/com/oneclouds/cargo/util/MapUtil.java new file mode 100644 index 0000000..94e5fe3 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/MapUtil.java @@ -0,0 +1,19 @@ +package com.oneclouds.cargo.util; + +import org.json.JSONObject; + +import java.util.Map; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/13 14:29 + * @description: + */ +public class MapUtil { + + public static String mapJson(Map map){ + JSONObject json=new JSONObject(map); + return json.toString(); + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/MsgUtil.java b/app/src/main/java/com/oneclouds/cargo/util/MsgUtil.java new file mode 100644 index 0000000..945bd17 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/MsgUtil.java @@ -0,0 +1,25 @@ +package com.oneclouds.cargo.util; + +import android.os.Handler; +import android.os.Message; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/7/30 16:29 + * @description: + */ +public class MsgUtil { + + public static void addHdMsgWat(Handler hd,int what){ + Message msg=new Message(); + msg.what=what; + hd.sendMessage(msg); + } + public static void addHdMsgWatBody(Handler hd,int what,String body){ + Message msg=new Message(); + msg.what=what; + msg.obj=body; + hd.sendMessage(msg); + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/NotifyUtils.java b/app/src/main/java/com/oneclouds/cargo/util/NotifyUtils.java new file mode 100644 index 0000000..8a437a8 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/NotifyUtils.java @@ -0,0 +1,86 @@ +package com.oneclouds.cargo.util; + +import android.app.NotificationManager; +import android.content.Context; +import android.content.Intent; +import android.net.Uri; +import android.os.Build; +import android.provider.Settings; + +import androidx.core.app.NotificationManagerCompat; + +/** + * 通知栏权限工具 + * + * @author xuexiang + * @since 2019-09-04 14:00 + */ +public final class NotifyUtils { + + private NotifyUtils() { + throw new UnsupportedOperationException("u can't instantiate me..."); + } + + /** + * 通知栏权限是否获取 + * + * @param context + * @return + */ + public static boolean isNotifyPermissionOpen(Context context) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + return NotificationManagerCompat.from(context).getImportance() != NotificationManager.IMPORTANCE_NONE; + } + return NotificationManagerCompat.from(context).areNotificationsEnabled(); + } + + /** + * 打开通知栏权限设置页面 + * + * @param context + */ + public static void openNotifyPermissionSetting(Context context) { + try { + Intent intent = new Intent(); + intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + //直接跳转到应用通知设置的代码: + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + intent.setAction(Settings.ACTION_APP_NOTIFICATION_SETTINGS); + intent.putExtra(Settings.EXTRA_APP_PACKAGE, context.getPackageName()); + intent.putExtra(Settings.EXTRA_CHANNEL_ID, context.getApplicationInfo().uid); + context.startActivity(intent); + return; + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + intent.setAction("android.settings.APP_NOTIFICATION_SETTINGS"); + intent.putExtra("app_package", context.getPackageName()); + intent.putExtra("app_uid", context.getApplicationInfo().uid); + context.startActivity(intent); + return; + } + if (Build.VERSION.SDK_INT == Build.VERSION_CODES.KITKAT) { + intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS); + intent.addCategory(Intent.CATEGORY_DEFAULT); + intent.setData(Uri.parse("package:" + context.getPackageName())); + context.startActivity(intent); + return; + } + + //4.4以下没有从app跳转到应用通知设置页面的Action,可考虑跳转到应用详情页面, + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) { + intent.setAction("android.settings.APPLICATION_DETAILS_SETTINGS"); + intent.setData(Uri.fromParts("package", context.getPackageName(), null)); + context.startActivity(intent); + return; + } + + intent.setAction(Intent.ACTION_VIEW); + intent.setClassName("com.android.settings", "com.android.setting.InstalledAppDetails"); + intent.putExtra("com.android.settings.ApplicationPkgName", context.getPackageName()); + context.startActivity(intent); + + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/PaxWebChromeClient.java b/app/src/main/java/com/oneclouds/cargo/util/PaxWebChromeClient.java new file mode 100644 index 0000000..3c6dc04 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/PaxWebChromeClient.java @@ -0,0 +1,137 @@ +package com.oneclouds.cargo.util; + +import android.annotation.TargetApi; +import android.app.Activity; +import android.content.Intent; +import android.net.Uri; +import android.os.Build; +import android.webkit.PermissionRequest; +import android.webkit.ValueCallback; +import android.webkit.WebChromeClient; +import android.webkit.WebView; +import android.widget.ProgressBar; +import android.widget.TextView; + +import androidx.annotation.NonNull; + +/** + * @author hlh + * @version 1.0.0 + * @date 2022/1/20 17:27 + * @description: + */ +public class PaxWebChromeClient extends WebChromeClient { + + private static final int CHOOSE_REQUEST_CODE = 0x9001; + private Activity mActivity; + private ValueCallback uploadFile;//定义接受返回值 + private ValueCallback uploadFiles; + private ProgressBar bar; + private TextView mTitle; + + public PaxWebChromeClient(@NonNull Activity mActivity, ProgressBar bar, TextView title) { + this.mActivity = mActivity; + this.bar=bar; + this.mTitle=title; + } + + @Override + public void onProgressChanged(WebView view, int newProgress) { + if (newProgress == 100) { + //bar.setVisibility(View.INVISIBLE); + } else { +// if (View.INVISIBLE == bar.getVisibility()) { +// bar.setVisibility(View.VISIBLE); +// } +// bar.setProgress(newProgress); + } + super.onProgressChanged(view, newProgress); + } + + @Override + + public void onReceivedTitle(WebView view, String title) { + + super.onReceivedTitle(view, title); + + // mTitle.setText(title); + + } + + @TargetApi(Build.VERSION_CODES.LOLLIPOP) + @Override + public void onPermissionRequest(PermissionRequest request) { + // super.onPermissionRequest(request);//必须要注视掉 + request.grant(request.getResources()); + } + + // For Android 3.0+ + public void openFileChooser(ValueCallback uploadMsg, String acceptType) { + this.uploadFile = uploadFile; + openFileChooseProcess(); + } + + // For Android < 3.0 + public void openFileChooser(ValueCallback uploadMsgs) { + this.uploadFile = uploadFile; + openFileChooseProcess(); + } + + // For Android > 4.1.1 +// @Override + public void openFileChooser(ValueCallback uploadMsg, String acceptType, String capture) { + this.uploadFile = uploadFile; + openFileChooseProcess(); + } + + // For Android >= 5.0 + @Override + public boolean onShowFileChooser(WebView webView, + ValueCallback filePathCallback, + FileChooserParams fileChooserParams) { + this.uploadFiles = filePathCallback; + openFileChooseProcess(); + return true; + } + + private void openFileChooseProcess() { + Intent i = new Intent(Intent.ACTION_GET_CONTENT); + i.addCategory(Intent.CATEGORY_OPENABLE); + i.setType("image/*"); + mActivity.startActivityForResult(Intent.createChooser(i, "Choose"), CHOOSE_REQUEST_CODE); + } + + public void onActivityResult(int requestCode, int resultCode, Intent data) { + //LogCat.d("requestCode===",requestCode+"===="); + if (resultCode == Activity.RESULT_OK) { + switch (requestCode) { + case CHOOSE_REQUEST_CODE: + if (null != uploadFile) { + Uri result = data == null || resultCode != Activity.RESULT_OK ? null + : data.getData(); + uploadFile.onReceiveValue(result); + uploadFile = null; + } + if (null != uploadFiles) { + Uri result = data == null || resultCode != Activity.RESULT_OK ? null + : data.getData(); + uploadFiles.onReceiveValue(new Uri[]{result}); + uploadFiles = null; + } + break; + default: + break; + } + } else if (resultCode == Activity.RESULT_CANCELED) { + if (null != uploadFile) { + uploadFile.onReceiveValue(null); + uploadFile = null; + } + if (null != uploadFiles) { + uploadFiles.onReceiveValue(null); + uploadFiles = null; + } + } + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/PhoneFormatCheckUtils.java b/app/src/main/java/com/oneclouds/cargo/util/PhoneFormatCheckUtils.java new file mode 100644 index 0000000..aa1dbb6 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/PhoneFormatCheckUtils.java @@ -0,0 +1,55 @@ +package com.oneclouds.cargo.util; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.regex.PatternSyntaxException; + +public class PhoneFormatCheckUtils { + + /** + * 大陆号码或香港号码均可 + */ + public static boolean isPhoneLegal(String str) throws PatternSyntaxException { + return isChinaPhoneLegal(str) || isHKPhoneLegal(str); + } + + /** + * 大陆手机号码11位数,匹配格式:前三位固定格式+后8位任意数 + * 此方法中前三位格式有: + * 13+任意数 + * 145,147,149 + * 15+除4的任意数(不要写^4,这样的话字母也会被认为是正确的) + * 166 + * 17+3,5,6,7,8 + * 18+任意数 + * 198,199 + */ + public static boolean isChinaPhoneLegal(String str) throws PatternSyntaxException { + // ^ 匹配输入字符串开始的位置 + // \d 匹配一个或多个数字,其中 \ 要转义,所以是 \\d + // $ 匹配输入字符串结尾的位置 + String regExp = "^((13[0-9])|(14[5,7,9])|(15[0-3,5-9])|(166)|(17[3,5,6,7,8])" + + "|(18[0-9])|(19[8,9]))\\d{8}$"; + Pattern p = Pattern.compile(regExp); + Matcher m = p.matcher(str); + return m.matches(); + } + + /** + * 香港手机号码8位数,5|6|8|9开头+7位任意数 + */ + public static boolean isHKPhoneLegal(String str) throws PatternSyntaxException { + // ^ 匹配输入字符串开始的位置 + // \d 匹配一个或多个数字,其中 \ 要转义,所以是 \\d + // $ 匹配输入字符串结尾的位置 + String regExp = "^(5|6|8|9)\\d{7}$"; + Pattern p = Pattern.compile(regExp); + Matcher m = p.matcher(str); + return m.matches(); + } + + public static String hintPhone(String phone){ + return phone.substring(0, 3) + "****" + phone.substring(7, 11); + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/SPUtil.java b/app/src/main/java/com/oneclouds/cargo/util/SPUtil.java new file mode 100644 index 0000000..f815dc9 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/SPUtil.java @@ -0,0 +1,20 @@ +package com.oneclouds.cargo.util; + +import android.content.Context; +import android.content.SharedPreferences; + +public class SPUtil { + + private static SharedPreferences sp=null; + public static String getSP(Context con, String dataname, String name){ + sp=con.getSharedPreferences(dataname,con.MODE_PRIVATE); + return sp.getString(name,""); + } + + public static void insSP(Context con, String dataname, String name, String body){ + SharedPreferences.Editor editor=con.getSharedPreferences(dataname,con.MODE_PRIVATE).edit(); + editor.putString(name,body); + editor.commit(); + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/StringUtil.java b/app/src/main/java/com/oneclouds/cargo/util/StringUtil.java new file mode 100644 index 0000000..6b60fcc --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/StringUtil.java @@ -0,0 +1,64 @@ +package com.oneclouds.cargo.util; + +import java.util.Scanner; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/8/7 17:54 + * @description:字符串工具类 + */ +public class StringUtil { + + public static String isNull(String in_str,String out_str){ + if(in_str==null || in_str.equals("null") || in_str.equals("")){ + return out_str; + } + return in_str; + } + + public void init(){ + Scanner scanner=new Scanner(System.in); + int[] numbers=new int[3]; + int max = 0; + int min = 0; + for(int i=0;inumbers[i]){ + min=numbers[i]; + } + } + } + } + public void init7(){ + Scanner scanner=new Scanner(System.in); + int[] numbers=new int[3]; + int temp = 0; + //循环获取数字 + for(int i=0;i { + + private Context context; + private List object; + private int layout; + + private onItemViewListenter listenterView; + public AdapterAll(Context context, List object, int layout){ + this.context = context; + this.object=object; + this.layout=layout; + + } + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(context).inflate(layout, parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + View v=holder.itemView; + ViewGroup vg=v.findViewById(v.getId()); + GetObjectName.ZIModel(vg,object.get(position),context); + if(listenterView!=null){ + listenterView.onItemView(position,object.get(position),v); + } + } + + public void updateItem(int position,Object o) { + //更新数据 + notifyItemChanged(position,o); + } + + public void delItemV(int position) { + Object o; + object.remove(position); + notifyItemRemoved(position); + notifyDataSetChanged(); + //android:editable="false" + } + + public void addItemV(Object o) { + //增加数据 + int position = object.size(); + object.add(o); + notifyItemInserted(position); + } + + public void notifyDatas(List o){ + object.addAll(o); + notifyDataSetChanged(); + + } + + public void delAllDatas(){ + object.clear(); + notifyDataSetChanged(); + + } + + public void removeItemV(int index) { + int position = object.size(); + object.remove(index); + notifyItemInserted(position); + } + + @Override + public int getItemCount() { + if(object==null){ + return 0; + } + return object.size(); + } + + public class ViewHolder extends RecyclerView.ViewHolder { + public ViewHolder(View view) { + super(view); + } + } + + //对内容的补充 + public void setOnItemViewListener(onItemViewListenter listenterView) { this.listenterView = listenterView; } + public interface onItemViewListenter { void onItemView(int position,Object o, View v);} + +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/adapter/AdapterAlls.java b/app/src/main/java/com/oneclouds/cargo/util/adapter/AdapterAlls.java new file mode 100644 index 0000000..9322996 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/adapter/AdapterAlls.java @@ -0,0 +1,77 @@ +package com.oneclouds.cargo.util.adapter; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.RecyclerView; + +import com.oneclouds.cargo.util.bean.GetObjectName; + +import java.util.List; + +public class AdapterAlls extends RecyclerView.Adapter { + + private Context context; + private List object; + public AdapterAlls(Context context, List object){ + this.context = context; + this.object=object; + } + + @NonNull + @Override + public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { + View view = LayoutInflater.from(context).inflate(object.get(viewType).getLayout(), parent, false); + return new ViewHolder(view); + } + + @Override + public void onBindViewHolder(@NonNull ViewHolder holder, int position) { + View v=holder.itemView; + ViewGroup vg=v.findViewById(v.getId()); + GetObjectName.ZIModel(vg,object.get(position).getBean(),context); + listenterView.onItemView(position,object.get(position).getBean(),v,object.get(position).getLayout()); + + } + + + @Override + public int getItemViewType(int position) { + return position; + } + + @Override + public int getItemCount() { + if(object==null){ + return 0; + } + return object.size(); + } + + public void add(List addMessageList) { + //增加数据 + int position = object.size(); + object.addAll(position, addMessageList); + notifyItemInserted(position); + } + + public void addItem(ManyBean mb) { + //增加数据 + int position = object.size(); + object.add(mb); + notifyItemInserted(position); + } + + public class ViewHolder extends RecyclerView.ViewHolder { + public ViewHolder(View view) { + super(view); + } + } + //对内容的补充 + private onItemViewListenter listenterView; + public void setOnItemViewListener(onItemViewListenter listenterView) { this.listenterView = listenterView; } + public interface onItemViewListenter { void onItemView(int position, Object o, View v, int layout);} +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/adapter/ManyBean.java b/app/src/main/java/com/oneclouds/cargo/util/adapter/ManyBean.java new file mode 100644 index 0000000..8a6847f --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/adapter/ManyBean.java @@ -0,0 +1,27 @@ +package com.oneclouds.cargo.util.adapter; + +public class ManyBean { + private Object bean; + private int layout; + + public ManyBean(Object bean, int layout) { + this.bean = bean; + this.layout = layout; + } + + public Object getBean() { + return bean; + } + + public void setBean(Object bean) { + this.bean = bean; + } + + public int getLayout() { + return layout; + } + + public void setLayout(int layout) { + this.layout = layout; + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/adapter/TFList.java b/app/src/main/java/com/oneclouds/cargo/util/adapter/TFList.java new file mode 100644 index 0000000..431712e --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/adapter/TFList.java @@ -0,0 +1,17 @@ +package com.oneclouds.cargo.util.adapter; + +import java.util.ArrayList; +import java.util.List; + +public class TFList { + + public static List getList(List lists){ + List list=new ArrayList<>(); + for (Object o : lists) { + list.add(o); + } + return list; + } + + +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/alert/CustomDialog.java b/app/src/main/java/com/oneclouds/cargo/util/alert/CustomDialog.java new file mode 100644 index 0000000..b496507 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/alert/CustomDialog.java @@ -0,0 +1,50 @@ +package com.oneclouds.cargo.util.alert; + +import android.app.Dialog; +import android.content.Context; +import android.view.KeyEvent; +import android.view.WindowManager; +import android.widget.TextView; + +import com.oneclouds.cargo.R; + + +public class CustomDialog extends Dialog { + private String content; + private boolean key=false; + public CustomDialog(Context context, String content) { + super(context, R.style.CustomDialog); + this.content=content; + initView(); + } + public CustomDialog(Context context, String content,boolean key) { + super(context, R.style.CustomDialog); + this.content=content; + this.key=key; + initView(); + + } + @Override + public boolean onKeyDown(int keyCode, KeyEvent event) { + switch (keyCode){ + case KeyEvent.KEYCODE_BACK: + if(CustomDialog.this.isShowing()) + if (!key){ + CustomDialog.this.dismiss(); + } + break; + } + return true; + } + + private void initView(){ + setContentView(R.layout.load); + ((TextView)findViewById(R.id.tvcontent)).setText(content); + setCanceledOnTouchOutside(true); + WindowManager.LayoutParams attributes = getWindow().getAttributes(); + attributes.alpha=0.8f; + getWindow().setAttributes(attributes); + setCancelable(false); + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/bean/GetObjectName.java b/app/src/main/java/com/oneclouds/cargo/util/bean/GetObjectName.java new file mode 100644 index 0000000..b8057b6 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/bean/GetObjectName.java @@ -0,0 +1,132 @@ +package com.oneclouds.cargo.util.bean; + +import android.content.Context; +import android.view.ViewGroup; +import android.widget.ImageView; +import android.widget.TextView; + +import com.bumptech.glide.Glide; +import com.oneclouds.cargo.util.StringUtil; + +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.List; + +public class GetObjectName { + + public static List GetName(Object o) { + List str = new ArrayList<>(); + Field[] fields = o.getClass().getDeclaredFields(); + for (int i = 0; i < fields.length; i++) { + fields[i].setAccessible(true); + str.add(fields[i].getName()); + } + return str; + } + + public static boolean isName(List list,String name){ + for (int i=0;i names = GetName(o); + List list = forData(vg); + for (int i = 0; i < list.size(); i++) { + if (list.get(i) != -1 && Integer.parseInt(String.valueOf(list.get(i))) > 100) { + String name = vg.getResources().getResourceName(list.get(i)); + String idName = name.substring(name.indexOf("/") + 1); + if (isName(names,idName)) { + switch (vg.findViewById(list.get(i)).getClass().getSimpleName()) { + case "TextView": + case "AppCompatTextView": + String str=StringUtil.isNull(getFieldValueByFieldName(idName, o)+"",""); + if (!str.equals("")){ + textView(vg, list.get(i), str); + } + break; + case "ImageView": + case "AppCompatImageView": + imgView(vg, list.get(i), getFieldValueByFieldName(idName, o)+"", con); + break; + } + } + } + } + } + + private static List forData(ViewGroup llRoot) { + List list = new ArrayList<>(); + int childCount = llRoot.getChildCount(); + for (int i = 0; i < childCount; i++) { + if (llRoot.getChildAt(i) instanceof ViewGroup) { + list.add(llRoot.getChildAt(i).getId()); + List list1 = forData((ViewGroup) llRoot.getChildAt(i)); + list.addAll(list1); + } else { + list.add(llRoot.getChildAt(i).getId()); + } + } + return list; + } + + public static void ZIBean(ViewGroup vg, Object o, Context con) { + //System.out.println("引入"+o.toString()); + List names = GetName(o); + for (int i = 0; i < vg.getChildCount(); i++) { + if (vg.getChildAt(i).getId() != -1) { + int id = vg.getChildAt(i).getId(); + String name = vg.getResources().getResourceName(id); + String idName = name.substring(name.indexOf("/") + 1); + for (int j = 0; j < names.size(); j++) { + if (names.get(j).equals(idName)) { + switch (vg.getChildAt(i).getClass().getSimpleName()) { + case "TextView": + case "AppCompatTextView": + String str=StringUtil.isNull(getFieldValueByFieldName(idName,o).toString()+"",""); + if(!str.equals("")){ + textView(vg, id, str); + } + names.remove(j); + break; + case "ImageView": + case "AppCompatImageView": + imgView(vg,id,getFieldValueByFieldName(idName,o).toString()+"",con); + names.remove(j); + break; + } + } + } + } + } + } + + private static void textView(ViewGroup vg, int id, String o) { + TextView t = vg.findViewById(id); + t.setText(o); + } + + + private static void imgView(ViewGroup vg, int id, String o,Context con) { + if(o.indexOf("http")!=-1){ + ImageView bv = vg.findViewById(id); + Glide.with(con).load(o).into(bv); + } + } +} \ No newline at end of file diff --git a/app/src/main/java/com/oneclouds/cargo/util/cache/CacheGroup.java b/app/src/main/java/com/oneclouds/cargo/util/cache/CacheGroup.java new file mode 100644 index 0000000..d9382d7 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/cache/CacheGroup.java @@ -0,0 +1,17 @@ +package com.oneclouds.cargo.util.cache; + +import android.view.View; + +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +public class CacheGroup { + public final static Map cacheList=new HashMap<>(); + public final static Map cacheListA=new HashMap<>(); + public final static Map cacheTimeList=new HashMap<>(); + public final static Map cacheDateList=new HashMap<>(); + public final static Map fragList=new HashMap<>(); + + +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/file/FileUtil.java b/app/src/main/java/com/oneclouds/cargo/util/file/FileUtil.java new file mode 100644 index 0000000..4a089e3 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/file/FileUtil.java @@ -0,0 +1,30 @@ +package com.oneclouds.cargo.util.file; + +import android.graphics.Bitmap; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/7/30 15:56 + * @description: + */ +public class FileUtil { + + public static File bitmapTurnFile(Bitmap bit, String path){ + File file=new File(path); + try { + BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(file)); + bit.compress(Bitmap.CompressFormat.JPEG, 100, bos); + bos.flush(); + bos.close(); + } catch (IOException e) { + e.printStackTrace(); + } + return file; + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/file/ImageFileCompressUtil.java b/app/src/main/java/com/oneclouds/cargo/util/file/ImageFileCompressUtil.java new file mode 100644 index 0000000..70e2dde --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/file/ImageFileCompressUtil.java @@ -0,0 +1,47 @@ +package com.oneclouds.cargo.util.file; + +import android.content.Context; +import android.os.Handler; + +import com.oneclouds.cargo.util.MsgUtil; + +import java.io.File; + +import top.zibin.luban.Luban; +import top.zibin.luban.OnCompressListener; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/7/30 16:19 + * @description:图片文件压缩 + */ +public class ImageFileCompressUtil { + + public final static int COMPRESS_START=32; + public final static int COMPRESS_SUCCESS=33; + public final static int COMPRESS_ONERROR=34; + + public static void imageFileCompress(Context con, File file, Handler hd){ + Luban.with(con) + .load(file) // 传人要压缩的图片列表 + .ignoreBy(100) // 忽略不压缩图片的大小 + .setTargetDir(file.getParent()) // 设置压缩后文件存储位置 + .setCompressListener(new OnCompressListener() { //设置回调 + @Override + public void onStart() { + MsgUtil.addHdMsgWat(hd,COMPRESS_START); + } + + @Override + public void onSuccess(File file) { + MsgUtil.addHdMsgWatBody(hd,COMPRESS_SUCCESS,file.getPath()); + } + + @Override + public void onError(Throwable e) { + MsgUtil.addHdMsgWatBody(hd,COMPRESS_ONERROR,e.toString()); + } + }).launch(); + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/http/AlivcOkHttpClient.java b/app/src/main/java/com/oneclouds/cargo/util/http/AlivcOkHttpClient.java new file mode 100644 index 0000000..f72c598 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/http/AlivcOkHttpClient.java @@ -0,0 +1,190 @@ +package com.oneclouds.cargo.util.http; + +import android.os.Handler; +import android.os.Looper; + +import org.json.JSONException; +import org.json.JSONObject; + +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.FormBody; +import okhttp3.OkHttpClient; +import okhttp3.Request; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/11/1 14:04 + * @description: + */ +public class AlivcOkHttpClient { + + private static AlivcOkHttpClient alivcOkHttpClient; + private OkHttpClient okHttpClient; + private OkHttpClient.Builder okHttpBuilder = new OkHttpClient.Builder().addNetworkInterceptor(new LoggingIntcepetor()); + private Handler handler; + + private AlivcOkHttpClient() { + handler = new Handler(Looper.getMainLooper()); + build(); + } + + public static AlivcOkHttpClient getInstance() { + if (alivcOkHttpClient == null) { + synchronized (AlivcOkHttpClient.class) { + if (alivcOkHttpClient == null) { + alivcOkHttpClient = new AlivcOkHttpClient(); + } + } + } + + return alivcOkHttpClient; + } + + private void build() { + okHttpBuilder.connectTimeout(10, TimeUnit.SECONDS); + okHttpBuilder.writeTimeout(10, TimeUnit.SECONDS); + okHttpBuilder.readTimeout(10, TimeUnit.SECONDS); + okHttpClient = okHttpBuilder.build(); + + } + + class StringCallBack implements Callback { + private HttpCallBack httpCallBack; + private Request request; + + public StringCallBack(Request request, HttpCallBack httpCallBack) { + this.request = request; + this.httpCallBack = httpCallBack; + } + + @Override + public void onFailure(Call call, IOException e) { + final IOException fe = e; + if (httpCallBack != null) { + handler.post(new Runnable() { + @Override + public void run() { + httpCallBack.onError(request, fe); + } + }); + } + } + + @Override + public void onResponse(final Call call, okhttp3.Response response) throws IOException { + final String result = response.body().string(); + + try { + JSONObject jsonObject = new JSONObject(result); + if ("200".equals(jsonObject.getString("code"))) { + if (httpCallBack != null) { + handler.post(new Runnable() { + @Override + public void run() { + httpCallBack.onSuccess(request, result); + } + }); + } else { + handler.post(new Runnable() { + @Override + public void run() { + httpCallBack.onError(request, new IOException("json error")); + } + }); + } + } + } catch (JSONException e) { + e.printStackTrace(); + } + + } + } + + /** + * 构建POS请求的参数体。 + * + * @return 组装参数后的FormBody。 + */ + public FormBody formBody(Map param) { + FormBody.Builder builder = new FormBody.Builder(); + if (param != null) { + Set keys = param.keySet(); + if (!keys.isEmpty()) { + for (String key : keys) { + String value = param.get(key); + if (value != null) { + builder.add(key, value); + } + } + } + } + return builder.build(); + } + + /** + * 当GET请求携带参数的时候,将参数以key=value的形式拼装到GET请求URL的后面,并且中间以?符号隔开。 + * + * @return 携带参数的URL请求地址。 + */ + public String urlWithParam(String url, Map params) { + if (params != null) { + Set keys = params.keySet(); + if (!keys.isEmpty()) { + StringBuilder paramsBuilder = new StringBuilder(); + boolean needAnd = false; + for (String key : keys) { + if (needAnd) { + paramsBuilder.append("&"); + } + paramsBuilder.append(key).append("=").append(params.get(key)); + needAnd = true; + } + return url + "?" + paramsBuilder.toString(); + } + } + return url; + } + + + public void get(String url, HttpCallBack httpCallBack) { + Request request = new Request.Builder().url(url).build(); + okHttpClient.newCall(request).enqueue(new StringCallBack(request, httpCallBack)); + } + + /** + * 带参数带get请求 + */ + public void get(String url, HashMap params, HttpCallBack httpCallBack) { + Request request = new Request.Builder().url(urlWithParam(url, params)).build(); + okHttpClient.newCall(request).enqueue(new StringCallBack(request, httpCallBack)); + } + + /** + * post请求 + */ + public void post(String url, Map params, HttpCallBack httpCallBack) { + Request request = new Request.Builder().url(url).post(formBody(params)).build(); + okHttpClient.newCall(request).enqueue(new StringCallBack(request, httpCallBack)); + } + + public interface HttpCallBack { + /** + * 错误回调 + */ + void onError(Request request, IOException e); + + /** + * 成功回调 + */ + void onSuccess(Request request, String result); + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/http/GetUtil.java b/app/src/main/java/com/oneclouds/cargo/util/http/GetUtil.java new file mode 100644 index 0000000..14c1d34 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/http/GetUtil.java @@ -0,0 +1,42 @@ +package com.oneclouds.cargo.util.http; + +import android.content.Context; +import android.os.Build; +import android.provider.Settings; +import android.webkit.WebSettings; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/14 15:08 + * @description: + */ +public class GetUtil { + + public static String getUserAgent(Context con) { + String userAgent = ""; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) { + try { + userAgent = WebSettings.getDefaultUserAgent(con); + } catch (Exception e) { + userAgent = System.getProperty("http.agent"); + } + } else { + userAgent = System.getProperty("http.agent"); + } + StringBuffer sb = new StringBuffer(); + for (int i = 0, length = userAgent.length(); i < length; i++) { + char c = userAgent.charAt(i); + if (c <= '\u001f' || c >= '\u007f') { + sb.append(String.format("\\u%04x", (int) c)); + } else { + sb.append(c); + } + } + return sb.toString(); + } + + public static String getDeviceId(Context con){ + return Settings.System.getString(con.getContentResolver(), Settings.Secure.ANDROID_ID); + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/http/LoggingIntcepetor.java b/app/src/main/java/com/oneclouds/cargo/util/http/LoggingIntcepetor.java new file mode 100644 index 0000000..55b3c71 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/http/LoggingIntcepetor.java @@ -0,0 +1,32 @@ +package com.oneclouds.cargo.util.http; + +import android.util.Log; + +import java.io.IOException; + +import okhttp3.Interceptor; +import okhttp3.Request; +import okhttp3.Response; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/11/1 14:06 + * @description: + */ +public class LoggingIntcepetor implements Interceptor { + + private final String TAG = getClass().getSimpleName(); + + @Override + public Response intercept(Chain chain) throws IOException { + Request request = chain.request(); + long t1 = System.nanoTime(); + Log.d(TAG, "Sending request: " + request.url() + "\n" + request.headers()); + Response response = chain.proceed(request); + long t2 = System.nanoTime(); + Log.d(TAG, "Received response for " + response.request().url() + " in " + + (t2 - t1) / 1e6 + "ms\n" + response.headers()); + return response; + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/http/OkDate.java b/app/src/main/java/com/oneclouds/cargo/util/http/OkDate.java new file mode 100644 index 0000000..14b9091 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/http/OkDate.java @@ -0,0 +1,43 @@ +package com.oneclouds.cargo.util.http; + + +public class OkDate { + private String url; + private String type; + private String madiaType; + + public OkDate(String url, String type, String madiaType) { + this.url = url; + this.type = type; + this.madiaType = madiaType; + } + + public OkDate() { + } + + public String getUrl() { + return url; + } + + public void setUrl(String url) { + this.url = url; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getMadiaType() { + return madiaType; + } + + public void setMadiaType(String madiaType) { + this.madiaType = madiaType; + } + + +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/http/OkHttpUtil.java b/app/src/main/java/com/oneclouds/cargo/util/http/OkHttpUtil.java new file mode 100644 index 0000000..bd31492 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/http/OkHttpUtil.java @@ -0,0 +1,176 @@ +package com.oneclouds.cargo.util.http; + + + +import android.content.Context; +import android.util.Log; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.oneclouds.cargo.util.MapUtil; +import com.oneclouds.cargo.util.VersionUtil; + +import java.io.File; +import java.util.HashMap; +import java.util.Map; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.crypto.SecureUtil; +import okhttp3.Headers; +import okhttp3.MediaType; +import okhttp3.MultipartBody; +import okhttp3.Request; +import okhttp3.RequestBody; + +public class OkHttpUtil { + + private static String SIGN_PASSWORD="tEzOoHXXPkak*y(BfIH(YMSiV0ZHz1Ki"; + + public static Request post(OkDate od, Context con){ + MediaType mediaType = MediaType.parse("application/json"); + JSONObject jsonObject = JSON.parseObject(od.getMadiaType()); + jsonObject.put("timestamp", DateUtil.current()); + jsonObject.put("deviceId", GetUtil.getDeviceId(con)); + String sign = SecureUtil.signParamsSha1(jsonObject,SIGN_PASSWORD); + Log.e("jsonObject",jsonObject.toString()); + Log.e("sign",sign); + Map map=new HashMap<>(); + map.put("data",SecurityUtil.encrypt(jsonObject.toString())); + Log.e("参数", MapUtil.mapJson(map)); + //MapUtil.mapJson(map) + RequestBody body = RequestBody.create(mediaType,MapUtil.mapJson(map)); + Headers.Builder hb=new Headers.Builder(); + hb.add("Content-Type","application/json"); + hb.add("Cache-Control","no-cache"); + Request request = new Request.Builder() + .url(od.getUrl()) + .post(body) + .headers(hb.build()) + .addHeader("Version", VersionUtil.getVersion(con)) + .addHeader("sign",sign) + .removeHeader("User-Agent") + .addHeader("User-Agent",GetUtil.getUserAgent(con)) + .build(); + return request; + } + public static Request posts(OkDate od, String token, Context con){ + MediaType mediaType = MediaType.parse("application/json"); + if(od.getMadiaType()!=null && od.getMadiaType().equals("")){ + od.setMadiaType("{}"); + } + JSONObject jsonObject = JSON.parseObject(od.getMadiaType()); + jsonObject.put("timestamp", DateUtil.current()); + jsonObject.put("deviceId", GetUtil.getDeviceId(con)); + String sign = SecureUtil.signParamsSha1(jsonObject,SIGN_PASSWORD); + Log.e("jsonObject",jsonObject.toString()); + Log.e("sign",sign); + Map map=new HashMap<>(); + map.put("data",SecurityUtil.encrypt(jsonObject.toString())); + Log.e("参数",MapUtil.mapJson(map)); + //MapUtil.mapJson(map) + RequestBody body = RequestBody.create(mediaType,MapUtil.mapJson(map)); + Request request = new Request.Builder() + .url(od.getUrl()) + .method("POST", body) + .addHeader("Authorization", token) + .addHeader("Content-Type", "application/json") + .addHeader("Version", VersionUtil.getVersion(con)) + .addHeader("sign",sign) + .removeHeader("User-Agent") + .addHeader("User-Agent",GetUtil.getUserAgent(con)) + .build(); + return request; + } + + public static Request get(OkDate od,String token, Context con){ + + MediaType mediaType = MediaType.parse("application/json"); + if(od.getMadiaType()!=null && od.getMadiaType().equals("")){ + od.setMadiaType("{}"); + } + JSONObject jsonObject = JSON.parseObject(od.getMadiaType()); + jsonObject.put("timestamp", DateUtil.current()); + jsonObject.put("deviceId", GetUtil.getDeviceId(con)); + String sign = SecureUtil.signParamsSha1(jsonObject,SIGN_PASSWORD); + Log.e("jsonObject",jsonObject.toString()); + Log.e("sign",sign); + Map map=new HashMap<>(); + map.put("data",SecurityUtil.encrypt(jsonObject.toString())); + Log.e("参数",MapUtil.mapJson(map)); + + + Headers.Builder hb=new Headers.Builder(); + hb.add("Content-Type","application/json"); + hb.add("Cache-Control","no-cache"); + Request request = new Request.Builder() + .url(od.getUrl()) + .addHeader("Authorization", token) + .addHeader("Content-Type", "application/json") + .addHeader("Version", VersionUtil.getVersion(con)) + .addHeader("sign",sign) + .removeHeader("User-Agent") + .addHeader("User-Agent",GetUtil.getUserAgent(con)) + .get() + .build(); + return request; + } + public static Request postWe(OkDate od){ + MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded"); + RequestBody body = RequestBody.create(mediaType,od.getMadiaType()); + Headers.Builder hb=new Headers.Builder(); + hb.add("Content-Type","application/json"); + hb.add("Cache-Control","no-cache"); + Request request = new Request.Builder() + .url(od.getUrl()) + .post(body) + .headers(hb.build()) + .build(); + return request; + } + + public static Request postFile(OkDate od,String token,File file,Context con) { + MediaType mediaType = MediaType.parse("text/plain"); + RequestBody body = new MultipartBody.Builder() + .setType(MultipartBody.FORM) + .addFormDataPart("file",file.getPath(), + RequestBody.create(MediaType.parse("application/octet-stream"), file)) + .build(); + Request request = new Request.Builder() + .url(od.getUrl()) + .method("POST", body) + .addHeader("Authorization", token) + .addHeader("Cookie", "JSESSIONID=NqpqKQstwceQurcNK5hjl4GnTgiF4eSzZSo5a1rz") + .build(); + return request; + } + + public static Request postFiles(OkDate od,File file,String token,String carId, Context con) { + MediaType mediaType = MediaType.parse("text/plain"); + RequestBody body = new MultipartBody.Builder() + .setType(MultipartBody.FORM) + .addFormDataPart("file",file.getPath(),RequestBody.create(MediaType.parse("application/octet-stream"), file)) + .addFormDataPart("carId",carId) + .build(); + Request request = new Request.Builder() + .url(od.getUrl()) + .method("POST", body) + .addHeader("Authorization", token) + .addHeader("Cookie", "JSESSIONID=NqpqKQstwceQurcNK5hjl4GnTgiF4eSzZSo5a1rz") + .build(); + return request; + } + public static Request postFrom(OkDate od,String token,int id){ + MediaType mediaType = MediaType.parse("application/json"); + RequestBody body = new MultipartBody.Builder() + .setType(MultipartBody.FORM) + .addFormDataPart("id",id+"") + .build(); + Request request = new Request.Builder() + .url(od.getUrl()) + .method("POST", body) + .addHeader("Authorization", token) + .addHeader("Content-Type", "application/json") + .build(); + return request; + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/http/RequestTest.java b/app/src/main/java/com/oneclouds/cargo/util/http/RequestTest.java new file mode 100644 index 0000000..2c6b5f1 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/http/RequestTest.java @@ -0,0 +1,212 @@ +package com.oneclouds.cargo.util.http; + +import android.content.Context; +import android.content.Intent; +import android.os.Handler; +import android.os.Message; +import android.util.Log; + +import com.google.gson.Gson; +import com.oneclouds.cargo.bean.BaseBean; +import com.oneclouds.cargo.ui.MainActivity; +import com.oneclouds.cargo.ui.UiAuxiliary; +import com.oneclouds.cargo.util.MapUtil; +import com.oneclouds.cargo.util.cache.CacheGroup; +import com.oneclouds.cargo.util.time.Timer; + +import java.io.IOException; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +import okhttp3.Call; +import okhttp3.Callback; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; + +public class RequestTest { + + public static final int FEEDBACK=-1; + public static final String FEEDBACK_TEXT="请求失败,请检查网络状况"; + private static Gson gson=new Gson(); + private static BaseBean bb; + //1执行重新请求,并更新缓存 + //2自动判断是否有缓存,如果有,不在请求 + //3自动判断是否有缓存,如果有,定时检测缓存,如果两次时间相隔超过规定时间,则也会再次请求 + public static void test(int code, final String name, Request re, Context con, final Handler hd){ + switch (code){ + case 1:a1(name,re,con,hd);break; + case 2:a2(name,re,con,hd);break; + case 11:a11(name,re,con,hd);break; + default:break; + } + } + + public static void test(final String name, Request re, Context con, final Handler hd, int s){ + a3(name,re,con,hd,s); + } + + public static void a1(final String name, Request re, Context con, final Handler hd){ + Log.e("请求开始","........"); + OkHttpClient client = new OkHttpClient().newBuilder() + .build(); + client.newCall(re).enqueue( new Callback() { + @Override + public void onFailure(Call call, IOException e) { + Log.e("请求错误","error:"+e.toString()); + Map map=new HashMap<>(); + map.put("code",-1); + map.put("msg",e.toString()); + Message message=new Message(); + message.what=RequsetCodeConstants.SUCCESS; + CacheGroup.cacheList.put(name,MapUtil.mapJson(map)); + hd.sendMessage(message); + } + @Override + public void onResponse(Call call, Response response) throws IOException { + final String body=response.body().string(); + final int code=response.code(); + Message message=new Message(); + Log.e("-body-",body); + if(code==RequsetCodeConstants.SUCCESS){ + bb=gson.fromJson(body,BaseBean.class); + if(!body.equals("")){ + if(bb.getCode()==401){ + UiAuxiliary.delLogin(con); + Intent intent = new Intent(con, MainActivity.class); + intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK); + con.startActivity(intent); + }else{ + CacheGroup.cacheList.put(name,body); + message.obj=response.code(); + message.what=RequsetCodeConstants.SUCCESS; + } + } + + }else{ + message.obj=response.code(); + message.what=code; + } + Log.e("请求响应",body); + hd.sendMessage(message); + //customDialog.dismiss(); + } + }); + } + + public static void a2(final String name, Request re, Context con, final Handler hd){ + //CustomDialog customDialog= new CustomDialog(con, "正在加载..."); + //customDialog.show();//显示,显示时页面不可点击,只能点击返回 + if(CacheGroup.cacheListA.get(name)==null){ + OkHttpClient client = new OkHttpClient(); + client.newCall(re).enqueue(new Callback() { + @Override + public void onFailure(Call call, IOException e) { + Message message=new Message(); + message.obj=e.toString(); + message.what=-1; + hd.sendMessage(message); + } + @Override + public void onResponse(Call call, Response response) throws IOException { + final String body=response.body().string(); + //System.out.println(body); + CacheGroup.cacheListA.put(name,body); + Message message=new Message(); + message.what=2; + hd.sendMessage(message); + } + }); + }else{ + System.out.println("已有缓存,不需要再次请求"); + Message message=new Message(); + message.what=2; + hd.sendMessage(message); + } + } + public static void a3(final String name, Request re, Context con, final Handler hd, long s){ + if(CacheGroup.cacheDateList.get(name)==null){ + //CustomDialog customDialog= new CustomDialog(con, "正在加载..."); + //customDialog.show();//显示,显示时页面不可点击,只能点击返回 + OkHttpClient client = new OkHttpClient(); + client.newCall(re).enqueue(new Callback() { + @Override + public void onFailure(Call call, IOException e) { + Message message=new Message(); + message.obj=FEEDBACK; + message.what=-1; + hd.sendMessage(message); + } + @Override + public void onResponse(Call call, Response response) throws IOException { + final String body=response.body().string(); + //System.out.println(body); + Date d=new Date(); + CacheGroup.cacheTimeList.put(name, d); + CacheGroup.cacheDateList.put(name, body); + Message message=new Message(); + message.what=3; + hd.sendMessage(message); + //customDialog.dismiss(); + } + }); + }else{ + Date ds=new Date(); + System.out.println("时间差:"+ Timer.TimeD(ds,CacheGroup.cacheTimeList.get(name))); + System.out.println("实时时间:"+s); + if(Timer.TimeD(ds,CacheGroup.cacheTimeList.get(name))>=s){ + //CustomDialog customDialog= new CustomDialog(con, "正在加载..."); + //customDialog.show();//显示,显示时页面不可点击,只能点击返回 + OkHttpClient client = new OkHttpClient(); + client.newCall(re).enqueue(new Callback() { + @Override + public void onFailure(Call call, IOException e) { + Message message=new Message(); + message.obj=FEEDBACK; + message.what=-1; + hd.sendMessage(message); + } + @Override + public void onResponse(Call call, Response response) throws IOException { + final String body=response.body().string(); + //System.out.println(body); + Date d=new Date(); + CacheGroup.cacheTimeList.put(name, d); + CacheGroup.cacheDateList.put(name, body); + Message message=new Message(); + message.what=3; + hd.sendMessage(message); + //customDialog.dismiss(); + } + }); + }else{ + System.out.println("没有超过实时缓存时间,不进行请求"); + Message message=new Message(); + message.what=3; + hd.sendMessage(message); + } + } + } + public static void a11(final String name,Request re,Context con,final Handler hd){ + OkHttpClient client = new OkHttpClient(); + client.newCall(re).enqueue(new Callback() { + @Override + public void onFailure(Call call, IOException e) { + Message message=new Message(); + message.obj=FEEDBACK; + message.what=-1; + hd.sendMessage(message); + } + @Override + public void onResponse(Call call, Response response) throws IOException { + final String body=response.body().string(); + System.out.println("存储空间"+name); + CacheGroup.cacheList.put(name,body); + Message message=new Message(); + message.what=1; + hd.sendMessage(message); + } + }); + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/http/RequsetCodeConstants.java b/app/src/main/java/com/oneclouds/cargo/util/http/RequsetCodeConstants.java new file mode 100644 index 0000000..4a6c147 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/http/RequsetCodeConstants.java @@ -0,0 +1,27 @@ +package com.oneclouds.cargo.util.http; + +public class RequsetCodeConstants { + + public static final int ERROR=-1; + + //响应码 + //登录失效 + public static final int NOT_LOGIN=401; + //返回成功 + public static final int SUCCESS=200; + //请求地址找不到 + public static final int UNKONWN=404; + //网关错误 + public static final int GATEWAY_ERROR=502; + //服务器错误 + public static final int SERVER_ERROR=500; + //请求的实体过大 + public static final int ENTITY_TOO_LARGE=413; + // + public static final String UNKONWN_TEXT="请求地址未找到"; + public static final String GATEWAY_ERROR_TEXT="网关错误"; + public static final String SERVER_ERROR_TEXT="服务器出现异常"; + public static final String ENTITY_TOO_LARGE_TEXT="上传的图片过大"; + public static final String FEEDBACK_TEXT="请求失败,请检查网络状况"; + +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/http/SecurityUtil.java b/app/src/main/java/com/oneclouds/cargo/util/http/SecurityUtil.java new file mode 100644 index 0000000..b34a3f7 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/http/SecurityUtil.java @@ -0,0 +1,46 @@ +package com.oneclouds.cargo.util.http; + +import cn.hutool.crypto.SmUtil; +import cn.hutool.crypto.asymmetric.KeyType; +import cn.hutool.crypto.asymmetric.SM2; + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/9/14 11:01 + * @description: + */ +public class SecurityUtil { + + /** + * 公钥 + */ + private static final String public_key = "04B16143229EF2DF546DE8AEC5E0242E9C7B564A7D6C3D982450DAC0E46606C5851AB710059E2BBCE6D86EE2215B18274EF2642626650F9774AB57F7ADE44DF0A3"; + /** + * 私钥 + */ + private static final String private_key = "4993A5ED6E3F865279481A96453E4907E5943F0086EAB9C3E3B24C8A36D7CBFD"; + + /** + * 加密 + * + * @param data 带加密数据 + * @return 加密后的结果 + */ + public static String encrypt(String data) { + SM2 sm2 = SmUtil.sm2(null, public_key); + String datas = sm2.encryptHex(data,KeyType.PublicKey); + return datas; + } + + /** + * 解密 + * + * @param data 带加密数据 + * @return 解密后的结果 + */ + public static String decrypt(String data) { + + return ""; + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/time/Timer.java b/app/src/main/java/com/oneclouds/cargo/util/time/Timer.java new file mode 100644 index 0000000..6502290 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/time/Timer.java @@ -0,0 +1,56 @@ +package com.oneclouds.cargo.util.time; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; + +import cn.hutool.core.date.DatePattern; +import cn.hutool.core.date.DateUtil; + +public class Timer { + + public static String formatChange(String time,String old,String news){ + SimpleDateFormat sdf = new SimpleDateFormat(old); + SimpleDateFormat sdf1 = new SimpleDateFormat(news); + + try { + Date date=sdf.parse(time); + return sdf1.format(date); + } catch (ParseException e) { + e.printStackTrace(); + } + return ""; + } + public static long TimeD(Date d1, Date d2) { + long diff = d1.getTime() - d2.getTime();//这样得到的差值是微秒级别 + return diff; + } + + public static String getTimer() { + Date date = new Date(); + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + return df.format(date); + } + public static String getTimerT() { + Date date = new Date(); + String format = DateUtil.format(DateUtil.date(), DatePattern.UTC_SIMPLE_PATTERN); + return format; + } + public static String getTimerData() { + Date date = new Date(); + SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd_HHmmss"); + return df.format(date); + } + + public static boolean compareTimer(String time){ + SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date sd1=new Date(); + Date sd2=null; + try { + sd2=df.parse(time); + } catch (ParseException e) { + e.printStackTrace(); + } + return sd1.after(sd2); + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/titleutil/StateStyleUtil.java b/app/src/main/java/com/oneclouds/cargo/util/titleutil/StateStyleUtil.java new file mode 100644 index 0000000..3677324 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/titleutil/StateStyleUtil.java @@ -0,0 +1,19 @@ +package com.oneclouds.cargo.util.titleutil; + +import android.app.Activity; +import android.graphics.Color; +import android.os.Build; +import android.view.View; + + +public class StateStyleUtil { + + public static void stateTextColor(Activity a){ + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + // a.getWindow().setBackgroundDrawableResource(R.color.Blue); + a.getWindow().getDecorView().setSystemUiVisibility( + View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN| View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR); + a.getWindow().setStatusBarColor(Color.TRANSPARENT); + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/titleutil/StatusBarUtil.java b/app/src/main/java/com/oneclouds/cargo/util/titleutil/StatusBarUtil.java new file mode 100644 index 0000000..3ccbb72 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/titleutil/StatusBarUtil.java @@ -0,0 +1,48 @@ +package com.oneclouds.cargo.util.titleutil; + +import android.app.Activity; +import android.app.Dialog; +import android.graphics.Color; +import android.os.Build; +import android.view.View; +import android.view.Window; +import android.view.WindowManager; + +public class StatusBarUtil { + public static void setWindowStatusBarColor(Activity activity, int colorResId) { + try { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + Window window = activity.getWindow(); + window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); + window.setStatusBarColor(activity.getResources().getColor(colorResId)); + } + } catch (Exception e) { + e.printStackTrace(); + } + } + public static void touming(Window w){ + w.requestFeature(Window.FEATURE_NO_TITLE); + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + Window window = w; + window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS + | WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION); + window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN + //这里删除的话 可以解决华为虚拟按键的覆盖 + | View.SYSTEM_UI_FLAG_LAYOUT_STABLE); + window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); + window.setStatusBarColor(Color.TRANSPARENT); + window.setNavigationBarColor(Color.TRANSPARENT);//这里删除的话 + } + } + public static void setWindowStatusBarColor(Dialog dialog, int colorResId) { + try { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + Window window = dialog.getWindow(); + window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); + window.setStatusBarColor(dialog.getContext().getResources().getColor(colorResId)); + } + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/view/BaseActivity.java b/app/src/main/java/com/oneclouds/cargo/util/view/BaseActivity.java new file mode 100644 index 0000000..dd31223 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/view/BaseActivity.java @@ -0,0 +1,111 @@ +package com.oneclouds.cargo.util.view; + +import android.app.Activity; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; +import android.os.Bundle; +import android.os.Handler; +import android.os.Message; +import android.util.Log; +import android.view.View; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; + +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.util.http.RequsetCodeConstants; +import com.scwang.smart.refresh.layout.SmartRefreshLayout; + +public abstract class BaseActivity extends Activity { + + public Context con; + public Activity act; + public static String dataName,dataName2,dataName3=""; + public View root; + private String title_text="空白标题"; + public Handler hd=new Handler(msg -> { + msgMethod(msg); + return false; + }); + + public SmartRefreshLayout refreshLayout; + + public void msgMethod(Message m){ + switch (m.what){ + case RequsetCodeConstants.ERROR: + Toast.makeText(con, RequsetCodeConstants.FEEDBACK_TEXT,Toast.LENGTH_SHORT).show(); + if(refreshLayout!=null){ + //refreshLayout.finishRefresh(); + } + break; + case RequsetCodeConstants.UNKONWN: + Toast.makeText(con,RequsetCodeConstants.UNKONWN_TEXT,Toast.LENGTH_SHORT).show(); + if(refreshLayout!=null){ + // refreshLayout.finishRefresh(); + } + break; + case RequsetCodeConstants.SERVER_ERROR: + Toast.makeText(con,RequsetCodeConstants.SERVER_ERROR_TEXT,Toast.LENGTH_SHORT).show(); + if(refreshLayout!=null){ + // refreshLayout.finishRefresh(); + } + break; + case RequsetCodeConstants.GATEWAY_ERROR: + Toast.makeText(con,RequsetCodeConstants.GATEWAY_ERROR_TEXT,Toast.LENGTH_SHORT).show(); + if(refreshLayout!=null){ + // refreshLayout.finishRefresh(); + } + break; + } + } + + public void initView(Object obj){ + //ViewGroup vg=findViewById(layout); + //vg.findViewById(R) + if(findViewById(R.id.return_btn)!=null){ + findViewById(R.id.return_btn).setOnClickListener(v -> { + finish(); + }); + } +// if(findViewById(R.id.title_view)!=null){ +// TextView title_view=findViewById(R.id.title_view); +// title_view.setText(title_text); +// } + //GetObjectName.ZIModel(vg,obj,con); + } + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + //registerBroadcast(); + } + + MyReceiver receiver; + private void registerBroadcast() { + // 注册广播接收者 + receiver = new MyReceiver(); + IntentFilter filter = new IntentFilter(); + filter.addAction("exit_app"); + if(receiver!=null){ + Log.e("广播概况",receiver.toString()+"_"+this.toString()); + registerReceiver(receiver,filter); + } + } + class MyReceiver extends BroadcastReceiver { + + @Override + public void onReceive(Context context, Intent intent) { + context.unregisterReceiver(this); + if(intent.getAction().equals("exit_app")){ + finish(); + } + } + } + public void setTitle(String title){ + this.title_text=title; + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/view/BaseAppCompatActivity.java b/app/src/main/java/com/oneclouds/cargo/util/view/BaseAppCompatActivity.java new file mode 100644 index 0000000..f4ca945 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/view/BaseAppCompatActivity.java @@ -0,0 +1,110 @@ +package com.oneclouds.cargo.util.view; + +import android.app.Activity; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; +import android.os.Bundle; +import android.os.Handler; +import android.os.Message; +import android.view.View; +import android.widget.TextView; +import android.widget.Toast; + +import androidx.annotation.Nullable; +import androidx.appcompat.app.AppCompatActivity; + +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.util.http.RequsetCodeConstants; +import com.scwang.smart.refresh.layout.SmartRefreshLayout; + +public class BaseAppCompatActivity extends AppCompatActivity { + + public Context con; + public Activity act; + public static String dataName,dataName2,dataName3=""; + public View root; + private String title_text="空白标题"; + + public Handler hd=new Handler(msg -> { + msgMethod(msg); + return false; + }); + + public SmartRefreshLayout refreshLayout; + + public void msgMethod(Message m){ + switch (m.what){ + case RequsetCodeConstants.ERROR: + Toast.makeText(con,RequsetCodeConstants.FEEDBACK_TEXT,Toast.LENGTH_SHORT).show(); + if(refreshLayout!=null){ + //refreshLayout.finishRefresh(); + } + break; + case RequsetCodeConstants.UNKONWN: + Toast.makeText(con,RequsetCodeConstants.UNKONWN_TEXT,Toast.LENGTH_SHORT).show(); + if(refreshLayout!=null){ + // refreshLayout.finishRefresh(); + } + break; + case RequsetCodeConstants.SERVER_ERROR: + Toast.makeText(con,RequsetCodeConstants.SERVER_ERROR_TEXT,Toast.LENGTH_SHORT).show(); + if(refreshLayout!=null){ + // refreshLayout.finishRefresh(); + } + break; + case RequsetCodeConstants.GATEWAY_ERROR: + Toast.makeText(con,RequsetCodeConstants.GATEWAY_ERROR_TEXT,Toast.LENGTH_SHORT).show(); + if(refreshLayout!=null){ + // refreshLayout.finishRefresh(); + } + break; + } + } + + public void initView(Object obj){ + if(findViewById(R.id.return_btn)!=null){ + findViewById(R.id.return_btn).setOnClickListener(v -> { + finish(); + }); + } + if(findViewById(R.id.title_view)!=null){ + TextView title_view=findViewById(R.id.title_view); + title_view.setText(title_text); + } + //ViewGroup vg=root.findViewById(root.getId()); + //GetObjectName.ZIModel(vg,obj,con); + } + + @Override + protected void onCreate(@Nullable Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + //registerBroadcast(); + } + + MyReceiver receiver; + + private void registerBroadcast(){ + // 注册广播接收者 + receiver = new MyReceiver(); + IntentFilter filter = new IntentFilter(); + filter.addAction("exit_app"); + registerReceiver(receiver,filter); + } + + class MyReceiver extends BroadcastReceiver { + + @Override + public void onReceive(Context context, Intent intent) { + context.unregisterReceiver(this); + if(intent.getAction().equals("exit_app")){ + finish(); + } + } + } + + public void setTitle(String title){ + this.title_text=title; + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/view/BaseFragment.java b/app/src/main/java/com/oneclouds/cargo/util/view/BaseFragment.java new file mode 100644 index 0000000..00152ed --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/view/BaseFragment.java @@ -0,0 +1,108 @@ +package com.oneclouds.cargo.util.view; + +import android.app.Activity; +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; +import android.os.Bundle; +import android.os.Handler; +import android.os.Message; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Toast; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.fragment.app.Fragment; + +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.util.http.RequsetCodeConstants; +import com.scwang.smart.refresh.layout.SmartRefreshLayout; + +import org.jetbrains.annotations.NotNull; + +public class BaseFragment extends Fragment { + + public SmartRefreshLayout refreshLayout; + public Context con=getContext(); + public Activity act=getActivity(); + public static String dataName,dataName2,dataName3=""; + public View root; + public Handler hd=new Handler(msg -> { + msgMethod(msg); + return false; + }); + + public void msgMethod(Message m){ + switch (m.what){ + case RequsetCodeConstants.ERROR: + Toast.makeText(con,RequsetCodeConstants.FEEDBACK_TEXT,Toast.LENGTH_SHORT).show(); + if(refreshLayout!=null){ + //refreshLayout.finishRefresh(); + } + break; + case RequsetCodeConstants.UNKONWN: + Toast.makeText(con,RequsetCodeConstants.UNKONWN_TEXT,Toast.LENGTH_SHORT).show(); + if(refreshLayout!=null){ + // refreshLayout.finishRefresh(); + } + break; + case RequsetCodeConstants.SERVER_ERROR: + Toast.makeText(con,RequsetCodeConstants.SERVER_ERROR_TEXT,Toast.LENGTH_SHORT).show(); + if(refreshLayout!=null){ + // refreshLayout.finishRefresh(); + } + break; + case RequsetCodeConstants.GATEWAY_ERROR: + Toast.makeText(con,RequsetCodeConstants.GATEWAY_ERROR_TEXT,Toast.LENGTH_SHORT).show(); + if(refreshLayout!=null){ + // refreshLayout.finishRefresh(); + } + break; + } + } + + public void initView(Object obj){ +// if(root.getId()!=-1){ +// ViewGroup vg=root.findViewById(root.getId()); +// GetObjectName.ZIModel(vg,obj,con); +// } + if(root.findViewById(R.id.return_btn)!=null){ + root.findViewById(R.id.return_btn).setOnClickListener(v -> { + getActivity().finish(); + }); + } + + } + + @Nullable + @org.jetbrains.annotations.Nullable + @Override + public View onCreateView(@NonNull @NotNull LayoutInflater inflater, @Nullable @org.jetbrains.annotations.Nullable ViewGroup container, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) { + //registerBroadcast(); + return super.onCreateView(inflater, container, savedInstanceState); + } + + MyReceiver receiver; + private void registerBroadcast() { + // 注册广播接收者 + receiver = new MyReceiver(); + IntentFilter filter = new IntentFilter(); + filter.addAction("exit_app"); + getActivity().registerReceiver(receiver,filter); + } + class MyReceiver extends BroadcastReceiver { + + @Override + public void onReceive(Context context, Intent intent) { + context.unregisterReceiver(this); + if(intent.getAction().equals("exit_app")){ + getActivity().finish(); + } + } + + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/view/BaseRecyclerView.java b/app/src/main/java/com/oneclouds/cargo/util/view/BaseRecyclerView.java new file mode 100644 index 0000000..72b805f --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/view/BaseRecyclerView.java @@ -0,0 +1,135 @@ +package com.oneclouds.cargo.util.view; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.TouchDelegate; + +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; +import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.oneclouds.cargo.util.adapter.AdapterAll; +import com.oneclouds.cargo.util.adapter.AdapterAlls; +import com.oneclouds.cargo.util.adapter.ManyBean; + +import java.util.ArrayList; +import java.util.List; + +public class BaseRecyclerView extends RecyclerView { + + @Override + public TouchDelegate getTouchDelegate() { + return super.getTouchDelegate(); + } + + public BaseRecyclerView(@NonNull Context context) { + super(context); + } + + public BaseRecyclerView(@NonNull Context context, @Nullable AttributeSet attrs) { + super(context, attrs); + } + + public BaseRecyclerView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + } + + private AdapterAlls ra; + private AdapterAll aa; + public AdapterAll createV(Context con,List list, int layout){ + LinearLayoutManager layoutManager = new LinearLayoutManager(con); + layoutManager.setOrientation(LinearLayoutManager.VERTICAL); + this.setLayoutManager(layoutManager); + aa=new AdapterAll(con,list,layout); + this.setAdapter(aa); + return aa; + } + public AdapterAll createH(Context con, List list,int layout){ + LinearLayoutManager layoutManager = new LinearLayoutManager(con); + layoutManager.setOrientation(LinearLayoutManager.HORIZONTAL); + this.setLayoutManager(layoutManager); + aa=new AdapterAll(con,list,layout); + this.setAdapter(aa); + return aa; + } + public AdapterAll createG(int ral,Context con, List list,int layout){ + this.setLayoutManager(new GridLayoutManager(con, ral)); + aa=new AdapterAll(con,list,layout); + this.setAdapter(aa); + return aa; + } + public AdapterAlls createGs(int ral,Context con, List list){ + this.setLayoutManager(new GridLayoutManager(con,ral)); + AdapterAlls ra=new AdapterAlls(con,list); + this.setAdapter(ra); + return ra; + } + + //多任务布局 + public AdapterAlls creates(Context con, List list){ + LinearLayoutManager layoutManager = new LinearLayoutManager(con); + layoutManager.setOrientation(LinearLayoutManager.VERTICAL); + this.setLayoutManager(layoutManager); + ra=new AdapterAlls(con,list); + this.setAdapter(ra); + return ra; + } + public void updateItemV(int position,Object o){ + aa.updateItem(position,o); + } + + public void notifyDatas(List o){ + aa.notifyDatas(o); + } + + public void delAllDatas(){ + aa.delAllDatas(); + } + + public void addItemV(Object o){ + aa.addItemV(o); + } + public void delItemV(int p){ + aa.delItemV(p); + } + public void removeItemV(int index){ + aa.removeItemV(index); + } + public void addV(List list){ + + } + public void addItem(ManyBean mb){ + ra.addItem(mb); + } + public void adds(List list){ + ra.add(list); + } + public AdapterAlls createsH(Context con, List list){ + LinearLayoutManager layoutManager = new LinearLayoutManager(con); + layoutManager.setOrientation(LinearLayoutManager.HORIZONTAL); + this.setLayoutManager(layoutManager); + AdapterAlls ra=new AdapterAlls(con,list); + this.setAdapter(ra); + return ra; + } + + //下拉刷新 + public void insDropDown(){ + + } + //上拉加载更多 + public void pullUpLoading(){ + + } + //加载中状态 + public void Loading(){ + + } + //加载无数据状态 + public void loadFeedback(){ + + } + +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/view/BaseSlidingDrawer.java b/app/src/main/java/com/oneclouds/cargo/util/view/BaseSlidingDrawer.java new file mode 100644 index 0000000..392515f --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/view/BaseSlidingDrawer.java @@ -0,0 +1,54 @@ +package com.oneclouds.cargo.util.view; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.View; +import android.widget.SlidingDrawer; + +public class BaseSlidingDrawer extends SlidingDrawer { + private boolean mVertical; + private int mTopOffset; + + public BaseSlidingDrawer(Context context, AttributeSet attrs, int defStyle) { + super(context, attrs, defStyle); + int orientation = attrs.getAttributeIntValue("android", "orientation", ORIENTATION_VERTICAL); + mTopOffset = attrs.getAttributeIntValue("android", "topOffset", 0); + mVertical = (orientation == SlidingDrawer.ORIENTATION_VERTICAL); + } + + public BaseSlidingDrawer(Context context, AttributeSet attrs) { + super(context, attrs); + int orientation = attrs.getAttributeIntValue("android", "orientation", ORIENTATION_VERTICAL); + mTopOffset = attrs.getAttributeIntValue("android", "topOffset", 0); + mVertical = (orientation == SlidingDrawer.ORIENTATION_VERTICAL); + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + int widthSpecMode = MeasureSpec.getMode(widthMeasureSpec); + int widthSpecSize = MeasureSpec.getSize(widthMeasureSpec); + int heightSpecMode = MeasureSpec.getMode(heightMeasureSpec); + int heightSpecSize = MeasureSpec.getSize(heightMeasureSpec); + + final View handle = getHandle(); + final View content = getContent(); + measureChild(handle, widthMeasureSpec, heightMeasureSpec); + + if (mVertical) { + int height = heightSpecSize - handle.getMeasuredHeight() - mTopOffset; + content.measure(widthMeasureSpec, MeasureSpec.makeMeasureSpec(height, heightSpecMode)); + heightSpecSize = handle.getMeasuredHeight() + mTopOffset + content.getMeasuredHeight(); + widthSpecSize = content.getMeasuredWidth(); + if (handle.getMeasuredWidth() > widthSpecSize) widthSpecSize = handle.getMeasuredWidth(); + } + else { + int width = widthSpecSize - handle.getMeasuredWidth() - mTopOffset; + getContent().measure(MeasureSpec.makeMeasureSpec(width, widthSpecMode), heightMeasureSpec); + widthSpecSize = handle.getMeasuredWidth() + mTopOffset + content.getMeasuredWidth(); + heightSpecSize = content.getMeasuredHeight(); + if (handle.getMeasuredHeight() > heightSpecSize) heightSpecSize = handle.getMeasuredHeight(); + } + + setMeasuredDimension(widthSpecSize, heightSpecSize); + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/view/BaseTableView.java b/app/src/main/java/com/oneclouds/cargo/util/view/BaseTableView.java new file mode 100644 index 0000000..78ff88d --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/view/BaseTableView.java @@ -0,0 +1,198 @@ +package com.oneclouds.cargo.util.view; + +import android.content.Context; +import android.util.AttributeSet; +import android.view.Gravity; +import android.widget.LinearLayout; +import android.widget.TextView; + +import androidx.annotation.Nullable; + +import java.util.ArrayList; +import java.util.List; + +public class BaseTableView extends LinearLayout { + private List TextViewlist=new ArrayList<>(); + private List hang=new ArrayList<>(); + private int rol=0; + private int height=0; + public List getTextViewlist() { + return TextViewlist; + } + + public void setTextViewlist(List textViewlist) { + TextViewlist = textViewlist; + } + + + public BaseTableView(Context context) { + super(context); + } + + public BaseTableView(Context context, @Nullable AttributeSet attrs) { + super(context, attrs); + } + + public BaseTableView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + public void initView(List> lists){ + rol=lists.size(); +// LinearLayout.LayoutParams vlp = new LinearLayout.LayoutParams( +// LinearLayout.LayoutParams.MATCH_PARENT, +// LinearLayout.LayoutParams.WRAP_CONTENT); + this.setOrientation(LinearLayout.VERTICAL); + //this.setLayoutParams(vlp); + for(int i=0;i list){ + LinearLayout li=new LinearLayout(getContext()); + LayoutParams vlp = new LayoutParams( + LayoutParams.MATCH_PARENT, + LayoutParams.WRAP_CONTENT); + li.setLayoutParams(vlp); + li.setOrientation(LinearLayout.HORIZONTAL); + for(int i=0;i { + Log.e("點擊了","123456"); + new XPopup.Builder(getContext()) + .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个 + //.offsetX(50) //偏移10 + // .offsetY(10) //往下偏移10 +// .popupPosition(PopupPosition.Right) //手动指定位置,有可能被遮盖 + .hasShadowBg(false) // 去掉半透明背景 + .atView(v) + .asCustom(new BaseTextAlertPopup(getContext(),this.getText()+"")) + .show(); + }); + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/view/BottomTabUtil.java b/app/src/main/java/com/oneclouds/cargo/util/view/BottomTabUtil.java new file mode 100644 index 0000000..e40a8eb --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/view/BottomTabUtil.java @@ -0,0 +1,48 @@ +package com.oneclouds.cargo.util.view; + +import androidx.appcompat.app.AppCompatActivity; +import androidx.fragment.app.Fragment; +import androidx.fragment.app.FragmentManager; +import androidx.fragment.app.FragmentTransaction; + +public class BottomTabUtil { + private AppCompatActivity act; + private int layout; + private FragmentManager fm; + private Fragment[] fs; + private int index=0; + + public int getIndex() { + return index; + } + + public void setIndex(int index) { + this.index = index; + } + + public BottomTabUtil(AppCompatActivity act, int layout, Fragment[] fs) { + this.act = act; + this.layout = layout; + this.fs = fs; + } + + public void selectItem(Fragment f){ + fm = act.getSupportFragmentManager(); + FragmentTransaction ft = fm.beginTransaction(); + //ft.replace(R.id.body,f); + ft.add(layout,f,"").commit(); + } + public void setDefaultFragment(Fragment f) { + fm =act.getSupportFragmentManager(); + FragmentTransaction ft = fm.beginTransaction(); + ft.hide(fs[index]); + ft.show(f); + ft.commit(); + } + public void hide(Fragment f) { + fm =act.getSupportFragmentManager(); + FragmentTransaction ft = fm.beginTransaction(); + ft.hide(f); + ft.commit(); + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/view/CircularProgressView.java b/app/src/main/java/com/oneclouds/cargo/util/view/CircularProgressView.java new file mode 100644 index 0000000..7d6c21d --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/view/CircularProgressView.java @@ -0,0 +1,204 @@ +package com.oneclouds.cargo.util.view; + +import android.animation.ValueAnimator; +import android.annotation.SuppressLint; +import android.content.Context; +import android.content.res.TypedArray; +import android.graphics.Canvas; +import android.graphics.Color; +import android.graphics.LinearGradient; +import android.graphics.Paint; +import android.graphics.RectF; +import android.graphics.Shader; +import android.util.AttributeSet; +import android.view.View; +import android.view.animation.OvershootInterpolator; + +import androidx.annotation.ColorRes; +import androidx.annotation.Nullable; +import androidx.core.content.ContextCompat; + +import com.oneclouds.cargo.R; + +public class CircularProgressView extends View { + + private Paint mBackPaint, mProgPaint; // 绘制画笔 + private RectF mRectF; // 绘制区域 + private int[] mColorArray; // 圆环渐变色 + private int mProgress; // 圆环进度(0-100) + + public CircularProgressView(Context context) { + this(context, null); + } + + public CircularProgressView(Context context, @Nullable AttributeSet attrs) { + this(context, attrs, 0); + } + + public CircularProgressView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + @SuppressLint("Recycle") + TypedArray typedArray = context.obtainStyledAttributes(attrs, R.styleable.CircularProgressView); + + // 初始化背景圆环画笔 + mBackPaint = new Paint(); + mBackPaint.setStyle(Paint.Style.STROKE); // 只描边,不填充 + mBackPaint.setStrokeCap(Paint.Cap.ROUND); // 设置圆角 + mBackPaint.setAntiAlias(true); // 设置抗锯齿 + mBackPaint.setDither(true); // 设置抖动 + mBackPaint.setStrokeWidth(typedArray.getDimension(R.styleable.CircularProgressView_backWidth, 5)); + mBackPaint.setColor(typedArray.getColor(R.styleable.CircularProgressView_backColor, Color.LTGRAY)); + + // 初始化进度圆环画笔 + mProgPaint = new Paint(); + mProgPaint.setStyle(Paint.Style.STROKE); // 只描边,不填充 + mProgPaint.setStrokeCap(Paint.Cap.ROUND); // 设置圆角 + mProgPaint.setAntiAlias(true); // 设置抗锯齿 + mProgPaint.setDither(true); // 设置抖动 + mProgPaint.setStrokeWidth(typedArray.getDimension(R.styleable.CircularProgressView_progWidth, 10)); + mProgPaint.setColor(typedArray.getColor(R.styleable.CircularProgressView_progColor, Color.BLUE)); + + // 初始化进度圆环渐变色 + int startColor = typedArray.getColor(R.styleable.CircularProgressView_progStartColor, -1); + int firstColor = typedArray.getColor(R.styleable.CircularProgressView_progFirstColor, -1); + if (startColor != -1 && firstColor != -1) mColorArray = new int[]{startColor, firstColor}; + else mColorArray = null; + + // 初始化进度 + mProgress = typedArray.getInteger(R.styleable.CircularProgressView_progress, 0); + typedArray.recycle(); + } + + @Override + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + super.onMeasure(widthMeasureSpec, heightMeasureSpec); + int viewWide = getMeasuredWidth() - getPaddingLeft() - getPaddingRight(); + int viewHigh = getMeasuredHeight() - getPaddingTop() - getPaddingBottom(); + int mRectLength = (int) ((viewWide > viewHigh ? viewHigh : viewWide) - (mBackPaint.getStrokeWidth() > mProgPaint.getStrokeWidth() ? mBackPaint.getStrokeWidth() : mProgPaint.getStrokeWidth())); + int mRectL = getPaddingLeft() + (viewWide - mRectLength) / 2; + int mRectT = getPaddingTop() + (viewHigh - mRectLength) / 2; + mRectF = new RectF(mRectL, mRectT, mRectL + mRectLength, mRectT + mRectLength); + + // 设置进度圆环渐变色 + if (mColorArray != null && mColorArray.length > 1) + mProgPaint.setShader(new LinearGradient(0, 0, 0, getMeasuredWidth(), mColorArray, null, Shader.TileMode.MIRROR)); + } + + @Override + protected void onDraw(Canvas canvas) { + super.onDraw(canvas); + canvas.drawArc(mRectF, 0, 360, false, mBackPaint); + canvas.drawArc(mRectF, 275, 360 * mProgress / 100, false, mProgPaint); + } + + // --------------------------------------------------------------------------------------------- + + /** + * 获取当前进度 + * + * @return 当前进度(0-100) + */ + public int getProgress() { + return mProgress; + } + + /** + * 设置当前进度 + * + * @param progress 当前进度(0-100) + */ + public void setProgress(int progress) { + this.mProgress = progress; + invalidate(); + } + + /** + * 设置当前进度,并展示进度动画。如果动画时间小于等于0,则不展示动画 + * + * @param progress 当前进度(0-100) + * @param animTime 动画时间(毫秒) + */ + public void setProgress(int progress, long animTime) { + if (animTime <= 0) setProgress(progress); + else { + ValueAnimator animator = ValueAnimator.ofInt(mProgress, progress); + animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() { + @Override + public void onAnimationUpdate(ValueAnimator animation) { + mProgress = (int) animation.getAnimatedValue(); + invalidate(); + } + }); + animator.setInterpolator(new OvershootInterpolator()); + animator.setDuration(animTime); + animator.start(); + } + } + + /** + * 设置背景圆环宽度 + * + * @param width 背景圆环宽度 + */ + public void setBackWidth(int width) { + mBackPaint.setStrokeWidth(width); + invalidate(); + } + + /** + * 设置背景圆环颜色 + * + * @param color 背景圆环颜色 + */ + public void setBackColor(@ColorRes int color) { + mBackPaint.setColor(ContextCompat.getColor(getContext(), color)); + invalidate(); + } + + /** + * 设置进度圆环宽度 + * + * @param width 进度圆环宽度 + */ + public void setProgWidth(int width) { + mProgPaint.setStrokeWidth(width); + invalidate(); + } + + /** + * 设置进度圆环颜色 + * + * @param color 景圆环颜色 + */ + public void setProgColor(@ColorRes int color) { + mProgPaint.setColor(ContextCompat.getColor(getContext(), color)); + mProgPaint.setShader(null); + invalidate(); + } + + /** + * 设置进度圆环颜色(支持渐变色) + * + * @param startColor 进度圆环开始颜色 + * @param firstColor 进度圆环结束颜色 + */ + public void setProgColor(@ColorRes int startColor, @ColorRes int firstColor) { + mColorArray = new int[]{ContextCompat.getColor(getContext(), startColor), ContextCompat.getColor(getContext(), firstColor)}; + mProgPaint.setShader(new LinearGradient(0, 0, 0, getMeasuredWidth(), mColorArray, null, Shader.TileMode.MIRROR)); + invalidate(); + } + + /** + * 设置进度圆环颜色(支持渐变色) + * + * @param colorArray 渐变色集合 + */ + public void setProgColor(@ColorRes int[] colorArray) { + if (colorArray == null || colorArray.length < 2) return; + mColorArray = new int[colorArray.length]; + for (int index = 0; index < colorArray.length; index++) + mColorArray[index] = ContextCompat.getColor(getContext(), colorArray[index]); + mProgPaint.setShader(new LinearGradient(0, 0, 0, getMeasuredWidth(), mColorArray, null, Shader.TileMode.MIRROR)); + invalidate(); + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/view/DensityUtil.java b/app/src/main/java/com/oneclouds/cargo/util/view/DensityUtil.java new file mode 100644 index 0000000..377b219 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/view/DensityUtil.java @@ -0,0 +1,22 @@ +package com.oneclouds.cargo.util.view; + +import android.content.Context; + +public class DensityUtil { + + /** + * 根据手机的分辨率从 dp 的单位 转成为 px(像素) + */ + public static int dip2px(Context context, float dpValue) { + final float scale = context.getResources().getDisplayMetrics().density; + return (int) (dpValue * scale + 0.5f); + } + + /** + * 根据手机的分辨率从 px(像素) 的单位 转成为 dp + */ + public static int px2dip(Context context, float pxValue) { + final float scale = context.getResources().getDisplayMetrics().density; + return (int) (pxValue / scale + 0.5f); + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/view/PX_DP.java b/app/src/main/java/com/oneclouds/cargo/util/view/PX_DP.java new file mode 100644 index 0000000..9cdb9fe --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/view/PX_DP.java @@ -0,0 +1,11 @@ +package com.oneclouds.cargo.util.view; + +import android.content.Context; +import android.util.TypedValue; + +public class PX_DP { + + public static int getDp(int body,Context con){ + return ((int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, body,con.getResources().getDisplayMetrics())); + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/view/ScoreView.java b/app/src/main/java/com/oneclouds/cargo/util/view/ScoreView.java new file mode 100644 index 0000000..2e6de6e --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/view/ScoreView.java @@ -0,0 +1,120 @@ +package com.oneclouds.cargo.util.view; + +import android.content.Context; +import android.util.AttributeSet; +import android.util.Log; +import android.view.View; +import android.widget.ImageButton; +import android.widget.LinearLayout; + +import androidx.annotation.Nullable; + +import com.oneclouds.cargo.R; + + +/** + * @author hlh + * @version 1.0.0 + * @date 2021/8/7 15:46 + * @description:评分view + */ +public class ScoreView extends LinearLayout { + private ImageButton[] xings=new ImageButton[5]; + private int score=0; + private boolean upKey=true; + public ScoreView(Context context) { + super(context); + } + + public ScoreView(Context context, @Nullable AttributeSet attrs) { + super(context, attrs); + } + + public ScoreView(Context context, @Nullable AttributeSet attrs, int defStyleAttr) { + super(context, attrs, defStyleAttr); + } + + public ScoreView(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) { + super(context, attrs, defStyleAttr, defStyleRes); + } + + public void initView(){ + this.setOrientation(LinearLayout.HORIZONTAL); + View v=inflate(getContext(), R.layout.item_view_score,null); + xings[0]=v.findViewById(R.id.xing1); + xings[1]=v.findViewById(R.id.xing2); + xings[2]=v.findViewById(R.id.xing3); + xings[3]=v.findViewById(R.id.xing4); + xings[4]=v.findViewById(R.id.xing5); + xings[0].setOnClickListener(v1 -> { + switchClick(0); + }); + xings[1].setOnClickListener(v1 -> { + switchClick(1); + }); + xings[2].setOnClickListener(v1 -> { + switchClick(2); + }); + xings[3].setOnClickListener(v1 -> { + switchClick(3); + }); + xings[4].setOnClickListener(v1 -> { + switchClick(4); + }); + this.addView(v); + } + + public void switchClick(int i){ + if (upKey) { + for(int j=0;j fs; + private List titles; + public TabUtil(FragmentManager fm, List fs, List titles){ + super(fm); + this.fs=fs; + this.titles=titles; + } + + @NonNull + @Override + public Fragment getItem(int position) { + return fs.get(position); + } + + @Override + public int getCount() { + return fs.size(); + } + + @Override + public CharSequence getPageTitle(int position) { + return titles.get(position); + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/util/view/Table.java b/app/src/main/java/com/oneclouds/cargo/util/view/Table.java new file mode 100644 index 0000000..14a2635 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/util/view/Table.java @@ -0,0 +1,31 @@ +package com.oneclouds.cargo.util.view; + +public class Table { + + private String body; + private int weight; + + public String getBody() { + return body; + } + + public void setBody(String body) { + this.body = body; + } + + public int getWeight() { + return weight; + } + + public void setWeight(int weight) { + this.weight = weight; + } + + public Table(String body, int weight) { + this.body = body; + this.weight = weight; + } + + public Table() { + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/weight/CenterPopupView.java b/app/src/main/java/com/oneclouds/cargo/weight/CenterPopupView.java new file mode 100644 index 0000000..b231230 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/weight/CenterPopupView.java @@ -0,0 +1,95 @@ +package com.oneclouds.cargo.weight; + +import android.app.Activity; +import android.content.Context; +import android.util.Log; +import android.view.View; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.GridLayoutManager; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +import com.amap.api.services.help.Tip; +import com.chad.library.adapter.base.BaseQuickAdapter; +import com.chad.library.adapter.base.listener.OnItemClickListener; +import com.luck.picture.lib.decoration.GridSpacingItemDecoration; +import com.lxj.xpopup.impl.PartShadowPopupView; +import com.oneclouds.cargo.R; +import com.oneclouds.cargo.adapter.CenterSimAdapter; +import com.oneclouds.cargo.bean.StateBean; + +import java.util.List; + +/** + * Description: 自定义局部阴影弹窗 + * Create by dance, at 2018/12/21 + */ +public class CenterPopupView extends PartShadowPopupView { + private Context ctx; + private RecyclerView recyclerView; + private List wordList; + private CenterSimAdapter adapter; + private Tip selectString; + + public CenterPopupView(@NonNull Activity context, List wordList, Tip selectString) { + super(context); + this.wordList= wordList; + this.selectString = selectString; + } + + @Override + protected int getImplLayoutId() { + return R.layout.custom_part_shadow_popup; + } + + + @Override + protected void onCreate() { + super.onCreate(); + recyclerView = findViewById(R.id.recyclerView); + GridLayoutManager gridLayoutManager = new GridLayoutManager(ctx, 4); +// recyclerView.addItemDecoration(new GridSpacingItemDecoration(4, 20, false)); + LinearLayoutManager linearLayoutManager = new LinearLayoutManager(ctx); + linearLayoutManager.setOrientation(RecyclerView.VERTICAL); + recyclerView.setLayoutManager(linearLayoutManager); + + adapter = new CenterSimAdapter(-1, wordList,selectString); + recyclerView.setAdapter(adapter); + + adapter.setOnItemClickListener(new OnItemClickListener() { + @Override + public void onItemClick(@NonNull BaseQuickAdapter adapter, @NonNull View view, int position) { + if (listener!=null){ + listener.selectChange(wordList.get(position),position); + } + ((CenterSimAdapter)adapter).setSelect(wordList.get(position)); + adapter.notifyDataSetChanged(); + dismiss(); + } + }); + + } + + @Override + protected void onShow() { + super.onShow(); + Log.e("tag", "CustomPartShadowPopupView onShow"); + } + + @Override + protected void onDismiss() { + super.onDismiss(); + Log.e("tag", "CustomPartShadowPopupView onDismiss"); + } + + + private OnSelectChangeListener listener; + public CenterPopupView setOnSelectChangeListener(OnSelectChangeListener listener){ + this.listener = listener; + return this; + } + public interface OnSelectChangeListener{ + void selectChange(Tip item ,int postion); + } +} diff --git a/app/src/main/java/com/oneclouds/cargo/weight/RecyclerViewDecoration.java b/app/src/main/java/com/oneclouds/cargo/weight/RecyclerViewDecoration.java new file mode 100644 index 0000000..77da296 --- /dev/null +++ b/app/src/main/java/com/oneclouds/cargo/weight/RecyclerViewDecoration.java @@ -0,0 +1,107 @@ +package com.oneclouds.cargo.weight; + +import android.content.Context; +import android.content.res.TypedArray; +import android.graphics.Canvas; +import android.graphics.Rect; +import android.graphics.drawable.Drawable; +import android.view.View; + +import androidx.annotation.NonNull; +import androidx.recyclerview.widget.LinearLayoutManager; +import androidx.recyclerview.widget.RecyclerView; + +/** + * @ClassName RecyclerViewDecoration + * @Author 用户 + * @Date 2022/5/16 10:56 + * @Description TODO + */ +public class RecyclerViewDecoration extends RecyclerView.ItemDecoration { + + private Context mContext; + private Drawable mDivider; + private int mOrientation; + public static final int HORIZONTAL_LIST = LinearLayoutManager.HORIZONTAL; + public static final int VERTICAL_LIST = LinearLayoutManager.VERTICAL; + + public static final int[] ATRRS = new int[]{ + android.R.attr.listDivider + }; + + public RecyclerViewDecoration(Context context, int orientation) { + mContext = context; + mOrientation = orientation; + TypedArray typedArray = context.obtainStyledAttributes(ATRRS); + mDivider = typedArray.getDrawable(0); + typedArray.recycle(); + setOrientation(orientation); + } + + public void setOrientation(int orientation){ + if (orientation != HORIZONTAL_LIST && orientation != VERTICAL_LIST){ + throw new IllegalArgumentException("invalid orientation"); } + mOrientation = orientation; + } + + + @Override//这里可以实现类似于padding值的边距效果 + public void getItemOffsets(@NonNull Rect outRect, @NonNull View view, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) { + if(mOrientation == HORIZONTAL_LIST){ + //画横线,就是往下偏移一个分割线的高度 + outRect.set(0, 0, 0, mDivider.getIntrinsicHeight()); + }else { + //画竖线,就是往右偏移一个分割线的宽度 + outRect.set(0, 0, mDivider.getIntrinsicWidth(), 0); + } + } + + @Override//画线 + public void onDraw(@NonNull Canvas c, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) { + if (mOrientation == HORIZONTAL_LIST){ + drawVerticalLine(c, parent, state); + }else { + drawHorizontalLine(c, parent, state); + } + } + + @Override + public void onDrawOver(@NonNull Canvas c, @NonNull RecyclerView parent, @NonNull RecyclerView.State state) { + super.onDrawOver(c, parent, state); + } + + //画横线, 这里的parent其实是显示在屏幕显示的这部分 + public void drawHorizontalLine(Canvas c, RecyclerView parent, RecyclerView.State state){ + int left = parent.getPaddingLeft(); + int right = parent.getWidth() - parent.getPaddingRight(); + final int childCount = parent.getChildCount(); + for (int i = 0; i < childCount; i++){ + final View child = parent.getChildAt(i); + + //获得child的布局信息 + final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams)child.getLayoutParams(); + final int top = child.getBottom() + params.bottomMargin; + final int bottom = top + mDivider.getIntrinsicHeight(); + mDivider.setBounds(left, top, right, bottom); + mDivider.draw(c); + //Log.d("wnw", left + " " + top + " "+right+" "+bottom+" "+i); + } + } + + //画竖线 + public void drawVerticalLine(Canvas c, RecyclerView parent, RecyclerView.State state){ + int top = parent.getPaddingTop(); + int bottom = parent.getHeight() - parent.getPaddingBottom(); + final int childCount = parent.getChildCount(); + for (int i = 0; i < childCount; i++){ + final View child = parent.getChildAt(i); + + //获得child的布局信息 + final RecyclerView.LayoutParams params = (RecyclerView.LayoutParams)child.getLayoutParams(); + final int left = child.getRight() + params.rightMargin; + final int right = left + mDivider.getIntrinsicWidth(); + mDivider.setBounds(left, top, right, bottom); + mDivider.draw(c); + } + } +} diff --git a/app/src/main/res/anim/left_enter.xml b/app/src/main/res/anim/left_enter.xml new file mode 100644 index 0000000..529dbda --- /dev/null +++ b/app/src/main/res/anim/left_enter.xml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/anim/left_exit.xml b/app/src/main/res/anim/left_exit.xml new file mode 100644 index 0000000..4223b91 --- /dev/null +++ b/app/src/main/res/anim/left_exit.xml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/anim/rightln_enter.xml b/app/src/main/res/anim/rightln_enter.xml new file mode 100644 index 0000000..edb76d9 --- /dev/null +++ b/app/src/main/res/anim/rightln_enter.xml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/anim/rightln_exit.xml b/app/src/main/res/anim/rightln_exit.xml new file mode 100644 index 0000000..d520495 --- /dev/null +++ b/app/src/main/res/anim/rightln_exit.xml @@ -0,0 +1,9 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable-xxhdpi/message.png b/app/src/main/res/drawable-xxhdpi/message.png new file mode 100644 index 0000000..07bba60 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/message.png differ diff --git a/app/src/main/res/drawable-xxhdpi/pwd.png b/app/src/main/res/drawable-xxhdpi/pwd.png new file mode 100644 index 0000000..c8f76c9 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/pwd.png differ diff --git a/app/src/main/res/drawable-xxhdpi/tab_mine_normal.png b/app/src/main/res/drawable-xxhdpi/tab_mine_normal.png new file mode 100644 index 0000000..5767926 Binary files /dev/null and b/app/src/main/res/drawable-xxhdpi/tab_mine_normal.png differ diff --git a/app/src/main/res/drawable/bg_bai.xml b/app/src/main/res/drawable/bg_bai.xml new file mode 100644 index 0000000..dab80cd --- /dev/null +++ b/app/src/main/res/drawable/bg_bai.xml @@ -0,0 +1,8 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_btn.xml b/app/src/main/res/drawable/bg_btn.xml new file mode 100644 index 0000000..ec8b28f --- /dev/null +++ b/app/src/main/res/drawable/bg_btn.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_btn_blue.xml b/app/src/main/res/drawable/bg_btn_blue.xml new file mode 100644 index 0000000..3d1dfa2 --- /dev/null +++ b/app/src/main/res/drawable/bg_btn_blue.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_btn_grey.xml b/app/src/main/res/drawable/bg_btn_grey.xml new file mode 100644 index 0000000..728da76 --- /dev/null +++ b/app/src/main/res/drawable/bg_btn_grey.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_btn_write.xml b/app/src/main/res/drawable/bg_btn_write.xml new file mode 100644 index 0000000..3a73940 --- /dev/null +++ b/app/src/main/res/drawable/bg_btn_write.xml @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_home_btn.xml b/app/src/main/res/drawable/bg_home_btn.xml new file mode 100644 index 0000000..027e9eb --- /dev/null +++ b/app/src/main/res/drawable/bg_home_btn.xml @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_info_input.xml b/app/src/main/res/drawable/bg_info_input.xml new file mode 100644 index 0000000..beb88a2 --- /dev/null +++ b/app/src/main/res/drawable/bg_info_input.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_my_top.png b/app/src/main/res/drawable/bg_my_top.png new file mode 100644 index 0000000..eeec611 Binary files /dev/null and b/app/src/main/res/drawable/bg_my_top.png differ diff --git a/app/src/main/res/drawable/bg_theme.xml b/app/src/main/res/drawable/bg_theme.xml new file mode 100644 index 0000000..0c7812f --- /dev/null +++ b/app/src/main/res/drawable/bg_theme.xml @@ -0,0 +1,13 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/bottom_xu.xml b/app/src/main/res/drawable/bottom_xu.xml new file mode 100644 index 0000000..9df07d0 --- /dev/null +++ b/app/src/main/res/drawable/bottom_xu.xml @@ -0,0 +1,15 @@ + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/cargo_logo.png b/app/src/main/res/drawable/cargo_logo.png new file mode 100644 index 0000000..e686b73 Binary files /dev/null and b/app/src/main/res/drawable/cargo_logo.png differ diff --git a/app/src/main/res/drawable/chevron2.png b/app/src/main/res/drawable/chevron2.png new file mode 100644 index 0000000..fbf7e4e Binary files /dev/null and b/app/src/main/res/drawable/chevron2.png differ diff --git a/app/src/main/res/drawable/dialog_bg.xml b/app/src/main/res/drawable/dialog_bg.xml new file mode 100644 index 0000000..1e7fcbe --- /dev/null +++ b/app/src/main/res/drawable/dialog_bg.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/dialog_custom_bg.xml b/app/src/main/res/drawable/dialog_custom_bg.xml new file mode 100644 index 0000000..e622317 --- /dev/null +++ b/app/src/main/res/drawable/dialog_custom_bg.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/driver_logo.png b/app/src/main/res/drawable/driver_logo.png new file mode 100644 index 0000000..533dc3f Binary files /dev/null and b/app/src/main/res/drawable/driver_logo.png differ diff --git a/app/src/main/res/drawable/ic_launcher_background.xml b/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/load_logo.png b/app/src/main/res/drawable/load_logo.png new file mode 100644 index 0000000..9a9ae4a Binary files /dev/null and b/app/src/main/res/drawable/load_logo.png differ diff --git a/app/src/main/res/drawable/logo.png b/app/src/main/res/drawable/logo.png new file mode 100644 index 0000000..da02fb1 Binary files /dev/null and b/app/src/main/res/drawable/logo.png differ diff --git a/app/src/main/res/drawable/logo2.png b/app/src/main/res/drawable/logo2.png new file mode 100644 index 0000000..69b5386 Binary files /dev/null and b/app/src/main/res/drawable/logo2.png differ diff --git a/app/src/main/res/drawable/logo_cargo.png b/app/src/main/res/drawable/logo_cargo.png new file mode 100644 index 0000000..94d78c8 Binary files /dev/null and b/app/src/main/res/drawable/logo_cargo.png differ diff --git a/app/src/main/res/drawable/order_list_top_bg.xml b/app/src/main/res/drawable/order_list_top_bg.xml new file mode 100644 index 0000000..31c99a9 --- /dev/null +++ b/app/src/main/res/drawable/order_list_top_bg.xml @@ -0,0 +1,13 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/par_bg.xml b/app/src/main/res/drawable/par_bg.xml new file mode 100644 index 0000000..bdb4a9a --- /dev/null +++ b/app/src/main/res/drawable/par_bg.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/purple_pin.png b/app/src/main/res/drawable/purple_pin.png new file mode 100644 index 0000000..605de36 Binary files /dev/null and b/app/src/main/res/drawable/purple_pin.png differ diff --git a/app/src/main/res/drawable/search_icon_white.png b/app/src/main/res/drawable/search_icon_white.png new file mode 100644 index 0000000..bcebbfc Binary files /dev/null and b/app/src/main/res/drawable/search_icon_white.png differ diff --git a/app/src/main/res/drawable/shape_gray_bg25.xml b/app/src/main/res/drawable/shape_gray_bg25.xml new file mode 100644 index 0000000..571f2b5 --- /dev/null +++ b/app/src/main/res/drawable/shape_gray_bg25.xml @@ -0,0 +1,10 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_gray_bg8.xml b/app/src/main/res/drawable/shape_gray_bg8.xml new file mode 100644 index 0000000..0ff4446 --- /dev/null +++ b/app/src/main/res/drawable/shape_gray_bg8.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_w_bg8.xml b/app/src/main/res/drawable/shape_w_bg8.xml new file mode 100644 index 0000000..0a23e79 --- /dev/null +++ b/app/src/main/res/drawable/shape_w_bg8.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/up_app.png b/app/src/main/res/drawable/up_app.png new file mode 100644 index 0000000..64b5f58 Binary files /dev/null and b/app/src/main/res/drawable/up_app.png differ diff --git a/app/src/main/res/drawable/welcome_bg.png b/app/src/main/res/drawable/welcome_bg.png new file mode 100644 index 0000000..8b6071c Binary files /dev/null and b/app/src/main/res/drawable/welcome_bg.png differ diff --git a/app/src/main/res/drawable/welcome_bg_default.jpg b/app/src/main/res/drawable/welcome_bg_default.jpg new file mode 100644 index 0000000..8d87a27 Binary files /dev/null and b/app/src/main/res/drawable/welcome_bg_default.jpg differ diff --git a/app/src/main/res/drawable/welcome_bg_default_big.jpg b/app/src/main/res/drawable/welcome_bg_default_big.jpg new file mode 100644 index 0000000..7375cb7 Binary files /dev/null and b/app/src/main/res/drawable/welcome_bg_default_big.jpg differ diff --git a/app/src/main/res/drawable/welcome_logo.png b/app/src/main/res/drawable/welcome_logo.png new file mode 100644 index 0000000..836d3ed Binary files /dev/null and b/app/src/main/res/drawable/welcome_logo.png differ diff --git a/app/src/main/res/layout-sw533dp/activity_weclome.xml b/app/src/main/res/layout-sw533dp/activity_weclome.xml new file mode 100644 index 0000000..14afc7c --- /dev/null +++ b/app/src/main/res/layout-sw533dp/activity_weclome.xml @@ -0,0 +1,37 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_address_add.xml b/app/src/main/res/layout/activity_address_add.xml new file mode 100644 index 0000000..f7d53a9 --- /dev/null +++ b/app/src/main/res/layout/activity_address_add.xml @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_complaint.xml b/app/src/main/res/layout/activity_complaint.xml new file mode 100644 index 0000000..babaf64 --- /dev/null +++ b/app/src/main/res/layout/activity_complaint.xml @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_goods_add.xml b/app/src/main/res/layout/activity_goods_add.xml new file mode 100644 index 0000000..eb3d376 --- /dev/null +++ b/app/src/main/res/layout/activity_goods_add.xml @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +