集成定位服务
This commit is contained in:
parent
bfbe7e9b5f
commit
7d29c5ec89
@ -2,8 +2,7 @@ plugins {
|
||||
id 'com.android.application'
|
||||
id 'kotlin-android'
|
||||
id 'kotlin-kapt'
|
||||
id 'com.huawei.agconnect'
|
||||
id 'kotlin-android-extensions'
|
||||
// id 'kotlin-android-extensions'
|
||||
}
|
||||
|
||||
android {
|
||||
@ -45,10 +44,10 @@ android {
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
javaCompileOptions {
|
||||
|
||||
annotationProcessorOptions {
|
||||
includeCompileClasspath = true
|
||||
arguments = [moduleName: project.getName()]
|
||||
}
|
||||
// annotationProcessorOptions {
|
||||
// includeCompileClasspath = true
|
||||
// arguments = [moduleName: project.getName()]
|
||||
// }
|
||||
}
|
||||
|
||||
ndk {
|
||||
@ -83,17 +82,17 @@ android {
|
||||
kotlinOptions {
|
||||
jvmTarget = '1.8'
|
||||
}
|
||||
allprojects {
|
||||
repositories {
|
||||
maven { url "https://jitpack.io" }
|
||||
}
|
||||
}
|
||||
// allprojects {
|
||||
// repositories {
|
||||
// maven { url "https://jitpack.io" }
|
||||
// }
|
||||
// }
|
||||
|
||||
repositories {
|
||||
flatDir {
|
||||
dirs 'libs'
|
||||
}
|
||||
}
|
||||
// repositories {
|
||||
// flatDir {
|
||||
// dirs 'libs'
|
||||
// }
|
||||
// }
|
||||
|
||||
productFlavors {
|
||||
qa {
|
||||
@ -189,7 +188,8 @@ dependencies {
|
||||
implementation 'com.alibaba:fastjson:1.2.61'
|
||||
implementation 'org.bouncycastle:bcprov-jdk15on:1.55'
|
||||
implementation 'org.apache.commons:commons-lang3:3.5'
|
||||
implementation(name: 'locationgd-androidx_2.1.0', ext: 'aar')//交通厅
|
||||
// implementation(name: 'locationgd-androidx_2.1.0', ext: 'aar')//交通厅
|
||||
implementation files('libs/locationgd-androidx_2.1.0.aar')
|
||||
//安联
|
||||
// implementation 'com.google.code.gson:gson:2.8.6'
|
||||
implementation 'com.loopj.android:android-async-http:1.4.9'
|
||||
@ -216,9 +216,9 @@ dependencies {
|
||||
//EventBus
|
||||
implementation 'org.greenrobot:eventbus:3.1.1'
|
||||
//易签宝
|
||||
implementation(name: 'EsignSDK', ext: 'aar')
|
||||
// implementation(name: 'EsignSDK', ext: 'aar')
|
||||
implementation 'pub.devrel:easypermissions:1.3.0'
|
||||
|
||||
implementation files('libs/EsignSDK.aar')
|
||||
|
||||
|
||||
implementation "com.squareup.retrofit2:retrofit:2.4.0"
|
||||
@ -234,7 +234,7 @@ dependencies {
|
||||
//
|
||||
implementation 'com.github.getActivity:XToast:8.2'
|
||||
|
||||
// implementation files('libs/mdp-release.aar')
|
||||
implementation files('libs/mdp-release.aar')
|
||||
// implementation(name: 'mdp-release', ext: 'aar')
|
||||
implementation project(path: ':mylibrary')
|
||||
|
||||
|
Binary file not shown.
@ -1,20 +1,12 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.cuspop
|
||||
|
||||
import android.Manifest
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.net.Uri
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
import android.widget.TextView
|
||||
import com.arpa.hndahesudintocctmsdriver.R
|
||||
import com.arpa.hndahesudintocctmsdriver.util.alert.ToastUtil
|
||||
import com.dahe.mylibrary.utils.ToastUtils
|
||||
import com.lxj.xpopup.core.CenterPopupView
|
||||
import com.lxj.xpopup.util.XPermission
|
||||
import com.permissionx.guolindev.PermissionX
|
||||
import kotlinx.android.synthetic.main.load.view.*
|
||||
import kotlinx.android.synthetic.main.pop_message_center.view.*
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@ -38,9 +30,14 @@ class MessagePop(context: Context) : CenterPopupView(context), View.OnClickListe
|
||||
}
|
||||
|
||||
override fun getImplLayoutId() = R.layout.pop_message_center
|
||||
|
||||
private lateinit var tvPhone : TextView
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
val tvCancel = findViewById<View>(R.id.tvCancel) as TextView
|
||||
val tvOk = findViewById<View>(R.id.tvOk) as TextView
|
||||
tvPhone = findViewById<View>(R.id.tvPhone) as TextView
|
||||
val tvContent = findViewById<View>(R.id.tvContent) as TextView
|
||||
val tvMessage2 = findViewById<View>(R.id.tvMessage2) as TextView
|
||||
tvCancel.setOnClickListener(this)
|
||||
tvOk.setOnClickListener(this)
|
||||
tvPhone.setOnClickListener(this)
|
||||
|
@ -2,11 +2,9 @@ package com.arpa.hndahesudintocctmsdriver.cuspop
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import android.widget.TextView
|
||||
import com.arpa.hndahesudintocctmsdriver.R
|
||||
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity
|
||||
import com.lxj.xpopup.core.CenterPopupView
|
||||
import kotlinx.android.synthetic.main.pop_sim_center.view.*
|
||||
import org.bouncycastle.jcajce.provider.symmetric.Rijndael
|
||||
|
||||
|
||||
/**
|
||||
@ -33,6 +31,10 @@ class SimCenterPop(context: Context) : CenterPopupView(context), View.OnClickLis
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
val tvCancel = findViewById<View>(R.id.tvCancel) as TextView
|
||||
val tvOk = findViewById<View>(R.id.tvOk) as TextView
|
||||
val tvContent = findViewById<View>(R.id.tvContent) as TextView
|
||||
|
||||
tvCancel.text = titleLeft
|
||||
tvOk.text = titleReft
|
||||
tvCancel.setOnClickListener(this)
|
||||
|
@ -1,11 +1,11 @@
|
||||
package com.arpa.hndahesudintocctmsdriver.cuspop
|
||||
|
||||
import android.content.Context
|
||||
import android.view.View
|
||||
import android.widget.TextView
|
||||
import com.arpa.hndahesudintocctmsdriver.R
|
||||
import com.lxj.xpopup.core.PositionPopupView
|
||||
import com.lxj.xpopup.enums.DragOrientation
|
||||
import kotlinx.android.synthetic.main.popup_qq_msg.view.tvMessage
|
||||
import kotlinx.android.synthetic.main.popup_qq_msg.view.tvTitle
|
||||
|
||||
/**
|
||||
* Description: 自定义自由定位Position弹窗
|
||||
@ -30,6 +30,9 @@ class TopMsgPopup(context: Context,title:String, message: String) : PositionPopu
|
||||
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
val tvMessage = findViewById<View>(R.id.tvMessage) as TextView
|
||||
val tvTitle = findViewById<View>(R.id.tvTitle) as TextView
|
||||
|
||||
tvMessage.text = message
|
||||
tvTitle.text = title
|
||||
}
|
||||
|
@ -115,5 +115,8 @@ public interface Api {
|
||||
*/
|
||||
@POST(BASE_URL+"/openapi/getShipmentStatus")
|
||||
Observable<CommonResponseBean> getShipmentStatus(@Body ShipmentStatusBean bean);
|
||||
|
||||
@POST(BASE_URL+"/openapi/shipments/getPODImageNames")
|
||||
Observable<CommonResponseBean> getPODImageNames(@Body ShipmentStatusBean bean);
|
||||
}
|
||||
|
||||
|
@ -698,6 +698,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
NewLJUtils.getInstance().sign(con, sob.getData().getShippingNoteNumber(), l, new OnGDResultListener() {
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
NewLJUtils.getInstance().stopLocationService();
|
||||
up_trafficReceipt();
|
||||
receipt_image();
|
||||
Log.e("上报安联", "签收成功");
|
||||
@ -984,6 +985,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
if (sob.getData().getReport() == 1) {
|
||||
JTTProcess.start(con, sob, "");
|
||||
}
|
||||
NewLJUtils.getInstance().startLocationService(ShangChuangImgActivity.this);
|
||||
//装货状态
|
||||
hyr.loading(lub);
|
||||
//装货照片
|
||||
@ -1050,6 +1052,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
|
||||
if (sob.getData().getReport() == 1) {
|
||||
JTTProcess.stop(con, sob, "");
|
||||
}
|
||||
|
||||
//卸货状态-平台
|
||||
hyr.dischargeCargo(lub);
|
||||
//卸货照片-安联
|
||||
|
@ -16,6 +16,7 @@ import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.arpa.hndahesudintocctmsdriver.event.PersonEvent;
|
||||
import com.arpa.hndahesudintocctmsdriver.event.RefreshCarListEvent;
|
||||
|
@ -8,8 +8,6 @@ import android.util.Log;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.alct.mdp.model.Image;
|
||||
import com.alct.mdp.model.Location;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.GDImage;
|
||||
import com.arpa.hndahesudintocctmsdriver.bean.GDLocation;
|
||||
import com.arpa.hndahesudintocctmsdriver.constant.NewLJConstant;
|
||||
@ -21,12 +19,11 @@ import com.arpa.hndahesudintocctmsdriver.request.bean.newlj.UpimgBean;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.net.BaseObserver;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.net.DataManager;
|
||||
import com.arpa.hndahesudintocctmsdriver.request.net.RxHttpCallBack;
|
||||
import com.arpa.hndahesudintocctmsdriver.util.time.Timer;
|
||||
import com.dahe.mylibrary.callback.OnGDDownloadResultListener;
|
||||
import com.dahe.mylibrary.callback.OnGDResultListener;
|
||||
import com.dahe.mylibrary.net.CommonResponseBean;
|
||||
import com.dahe.mylibrary.utils.TimeUtil;
|
||||
import com.dahe.mylibrary.utils.ToastUtils;
|
||||
import com.express.mdp.Api;
|
||||
|
||||
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
@ -447,25 +444,48 @@ public class NewLJUtils {
|
||||
}));
|
||||
}
|
||||
|
||||
public void getPODImageNames(Context ctx, String shipmentCode){
|
||||
ShipmentStatusBean shipmentStatusBean = new ShipmentStatusBean();
|
||||
shipmentStatusBean.setShipmentCode(shipmentCode);
|
||||
shipmentStatusBean.setEnterpriseCode(NewLJConstant.ENTER_PRISE_CODE);
|
||||
DataManager.getInstance().getPODImageNames(shipmentStatusBean)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new BaseObserver(ctx, new RxHttpCallBack<CommonResponseBean>() {
|
||||
@Override
|
||||
public void onSuccess(CommonResponseBean t) {
|
||||
super.onSuccess(t);
|
||||
System.out.println("sadf");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCodeError(Context mContext, CommonResponseBean<CommonResponseBean> t) {
|
||||
super.onCodeError(mContext, t);
|
||||
System.out.println("sadf");
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启位置上传
|
||||
* @param act
|
||||
*/
|
||||
// public void startLocationService(AppCompatActivity act){
|
||||
// try {
|
||||
// Api.startLocationService(act, NewLJConstant.ENTER_PRISE_CODE, s -> {
|
||||
// Log.e("位置上报", s);
|
||||
// });
|
||||
// } catch (JSONException e) {
|
||||
// throw new RuntimeException(e);
|
||||
// }
|
||||
// }
|
||||
public void startLocationService(AppCompatActivity act){
|
||||
try {
|
||||
Api.setBaseUrl("https://kehui56.cn/api","https://api.kehui56.cn/api");
|
||||
Api.startLocationService(act, NewLJConstant.ENTER_PRISE_CODE, s -> {
|
||||
Log.e("位置上报", s);
|
||||
});
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 关闭定位服务
|
||||
*/
|
||||
// public void stopLocationService(){
|
||||
// Api.stopLocationService();
|
||||
// }
|
||||
public void stopLocationService(){
|
||||
Api.stopLocationService();
|
||||
}
|
||||
|
||||
}
|
||||
|
40
build.gradle
40
build.gradle
@ -1,39 +1,9 @@
|
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
plugins {
|
||||
id 'com.android.application' version '7.2.2' apply false
|
||||
id 'com.android.library' version '7.2.2' apply false
|
||||
id 'org.jetbrains.kotlin.android' version '1.9.22' apply false
|
||||
}
|
||||
apply from: "compile.gradle"
|
||||
buildscript {
|
||||
// ext.kotlin_version = "1.5.0"
|
||||
ext.kotlin_version = "1.6.10"
|
||||
repositories {
|
||||
google()
|
||||
jcenter() // 这个
|
||||
mavenCentral()
|
||||
maven { url 'http://developer.huawei.com/repo/'}
|
||||
maven { url 'https://repo1.maven.org/maven2/' }
|
||||
maven {
|
||||
url 'https://maven.aliyun.com/repository/releases'
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:4.2.2'
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
classpath 'com.huawei.agconnect:agcp:1.4.1.300'
|
||||
}
|
||||
}
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
google()
|
||||
jcenter() // Warning: this repository is going to shut down soon
|
||||
mavenCentral()
|
||||
maven {url 'http://developer.huawei.com/repo/'}
|
||||
maven { url 'https://www.jitpack.io' }
|
||||
maven { url 'https://repo1.maven.org/maven2/' }
|
||||
maven {
|
||||
url 'https://maven.aliyun.com/repository/releases'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task clean(type: Delete) {
|
||||
delete rootProject.buildDir
|
||||
}
|
3
gradle/wrapper/gradle-wrapper.properties
vendored
3
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,6 +1,7 @@
|
||||
#Mon Jul 12 10:16:49 CST 2021
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-6.7.1-bin.zip
|
||||
#distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-6.7.1-bin.zip
|
||||
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-7.3.3-bin.zip
|
||||
distributionPath=wrapper/dists
|
||||
zipStorePath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
@ -35,7 +35,7 @@ android {
|
||||
|
||||
dependencies {
|
||||
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
// implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
implementation 'androidx.core:core-ktx:1.3.1'
|
||||
implementation 'androidx.appcompat:appcompat:1.2.0'
|
||||
implementation 'com.google.android.material:material:1.2.1'
|
||||
|
@ -1,3 +1,27 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
|
||||
maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter' }
|
||||
maven { url "https://jitpack.io" }
|
||||
gradlePluginPortal()
|
||||
google()
|
||||
mavenCentral()
|
||||
|
||||
}
|
||||
}
|
||||
dependencyResolutionManagement {
|
||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||
repositories {
|
||||
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
|
||||
maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter' }
|
||||
maven { url "https://jitpack.io" }
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
rootProject.name = "wangluohuoyun"
|
||||
include ':app'
|
||||
//include ':AliyunVideoCommon'
|
||||
|
Loading…
Reference in New Issue
Block a user