集成定位服务

This commit is contained in:
lijia 2024-11-28 08:26:45 +08:00
parent bfbe7e9b5f
commit 7d29c5ec89
13 changed files with 113 additions and 89 deletions

View File

@ -2,8 +2,7 @@ plugins {
id 'com.android.application' id 'com.android.application'
id 'kotlin-android' id 'kotlin-android'
id 'kotlin-kapt' id 'kotlin-kapt'
id 'com.huawei.agconnect' // id 'kotlin-android-extensions'
id 'kotlin-android-extensions'
} }
android { android {
@ -45,10 +44,10 @@ android {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
javaCompileOptions { javaCompileOptions {
annotationProcessorOptions { // annotationProcessorOptions {
includeCompileClasspath = true // includeCompileClasspath = true
arguments = [moduleName: project.getName()] // arguments = [moduleName: project.getName()]
} // }
} }
ndk { ndk {
@ -83,17 +82,17 @@ android {
kotlinOptions { kotlinOptions {
jvmTarget = '1.8' jvmTarget = '1.8'
} }
allprojects { // allprojects {
repositories { // repositories {
maven { url "https://jitpack.io" } // maven { url "https://jitpack.io" }
} // }
} // }
repositories { // repositories {
flatDir { // flatDir {
dirs 'libs' // dirs 'libs'
} // }
} // }
productFlavors { productFlavors {
qa { qa {
@ -189,7 +188,8 @@ dependencies {
implementation 'com.alibaba:fastjson:1.2.61' implementation 'com.alibaba:fastjson:1.2.61'
implementation 'org.bouncycastle:bcprov-jdk15on:1.55' implementation 'org.bouncycastle:bcprov-jdk15on:1.55'
implementation 'org.apache.commons:commons-lang3:3.5' 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.google.code.gson:gson:2.8.6'
implementation 'com.loopj.android:android-async-http:1.4.9' implementation 'com.loopj.android:android-async-http:1.4.9'
@ -216,9 +216,9 @@ dependencies {
//EventBus //EventBus
implementation 'org.greenrobot:eventbus:3.1.1' 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 'pub.devrel:easypermissions:1.3.0'
implementation files('libs/EsignSDK.aar')
implementation "com.squareup.retrofit2:retrofit:2.4.0" implementation "com.squareup.retrofit2:retrofit:2.4.0"
@ -234,7 +234,7 @@ dependencies {
// //
implementation 'com.github.getActivity:XToast:8.2' 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(name: 'mdp-release', ext: 'aar')
implementation project(path: ':mylibrary') implementation project(path: ':mylibrary')

Binary file not shown.

View File

@ -1,20 +1,12 @@
package com.arpa.hndahesudintocctmsdriver.cuspop package com.arpa.hndahesudintocctmsdriver.cuspop
import android.Manifest
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.net.Uri import android.net.Uri
import android.view.View import android.view.View
import android.widget.Toast import android.widget.TextView
import androidx.fragment.app.FragmentActivity
import com.arpa.hndahesudintocctmsdriver.R 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.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 override fun getImplLayoutId() = R.layout.pop_message_center
private lateinit var tvPhone : TextView
override fun onCreate() { override fun onCreate() {
super.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) tvCancel.setOnClickListener(this)
tvOk.setOnClickListener(this) tvOk.setOnClickListener(this)
tvPhone.setOnClickListener(this) tvPhone.setOnClickListener(this)

View File

@ -2,11 +2,9 @@ package com.arpa.hndahesudintocctmsdriver.cuspop
import android.content.Context import android.content.Context
import android.view.View import android.view.View
import android.widget.TextView
import com.arpa.hndahesudintocctmsdriver.R import com.arpa.hndahesudintocctmsdriver.R
import com.arpa.hndahesudintocctmsdriver.ui.auth.CertificatesActivity
import com.lxj.xpopup.core.CenterPopupView 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() { override fun onCreate() {
super.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 tvCancel.text = titleLeft
tvOk.text = titleReft tvOk.text = titleReft
tvCancel.setOnClickListener(this) tvCancel.setOnClickListener(this)

View File

@ -1,11 +1,11 @@
package com.arpa.hndahesudintocctmsdriver.cuspop package com.arpa.hndahesudintocctmsdriver.cuspop
import android.content.Context import android.content.Context
import android.view.View
import android.widget.TextView
import com.arpa.hndahesudintocctmsdriver.R import com.arpa.hndahesudintocctmsdriver.R
import com.lxj.xpopup.core.PositionPopupView import com.lxj.xpopup.core.PositionPopupView
import com.lxj.xpopup.enums.DragOrientation 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弹窗 * Description: 自定义自由定位Position弹窗
@ -30,6 +30,9 @@ class TopMsgPopup(context: Context,title:String, message: String) : PositionPopu
override fun onCreate() { override fun onCreate() {
super.onCreate() super.onCreate()
val tvMessage = findViewById<View>(R.id.tvMessage) as TextView
val tvTitle = findViewById<View>(R.id.tvTitle) as TextView
tvMessage.text = message tvMessage.text = message
tvTitle.text = title tvTitle.text = title
} }

View File

@ -115,5 +115,8 @@ public interface Api {
*/ */
@POST(BASE_URL+"/openapi/getShipmentStatus") @POST(BASE_URL+"/openapi/getShipmentStatus")
Observable<CommonResponseBean> getShipmentStatus(@Body ShipmentStatusBean bean); Observable<CommonResponseBean> getShipmentStatus(@Body ShipmentStatusBean bean);
@POST(BASE_URL+"/openapi/shipments/getPODImageNames")
Observable<CommonResponseBean> getPODImageNames(@Body ShipmentStatusBean bean);
} }

View File

@ -698,6 +698,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
NewLJUtils.getInstance().sign(con, sob.getData().getShippingNoteNumber(), l, new OnGDResultListener() { NewLJUtils.getInstance().sign(con, sob.getData().getShippingNoteNumber(), l, new OnGDResultListener() {
@Override @Override
public void onSuccess() { public void onSuccess() {
NewLJUtils.getInstance().stopLocationService();
up_trafficReceipt(); up_trafficReceipt();
receipt_image(); receipt_image();
Log.e("上报安联", "签收成功"); Log.e("上报安联", "签收成功");
@ -984,6 +985,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
if (sob.getData().getReport() == 1) { if (sob.getData().getReport() == 1) {
JTTProcess.start(con, sob, ""); JTTProcess.start(con, sob, "");
} }
NewLJUtils.getInstance().startLocationService(ShangChuangImgActivity.this);
//装货状态 //装货状态
hyr.loading(lub); hyr.loading(lub);
//装货照片 //装货照片
@ -1050,6 +1052,7 @@ public class ShangChuangImgActivity extends BaseAppCompatActivity {
if (sob.getData().getReport() == 1) { if (sob.getData().getReport() == 1) {
JTTProcess.stop(con, sob, ""); JTTProcess.stop(con, sob, "");
} }
//卸货状态-平台 //卸货状态-平台
hyr.dischargeCargo(lub); hyr.dischargeCargo(lub);
//卸货照片-安联 //卸货照片-安联

View File

@ -16,6 +16,7 @@ import android.widget.Toast;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import com.arpa.hndahesudintocctmsdriver.event.PersonEvent; import com.arpa.hndahesudintocctmsdriver.event.PersonEvent;
import com.arpa.hndahesudintocctmsdriver.event.RefreshCarListEvent; import com.arpa.hndahesudintocctmsdriver.event.RefreshCarListEvent;

View File

@ -8,8 +8,6 @@ import android.util.Log;
import androidx.appcompat.app.AppCompatActivity; 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.GDImage;
import com.arpa.hndahesudintocctmsdriver.bean.GDLocation; import com.arpa.hndahesudintocctmsdriver.bean.GDLocation;
import com.arpa.hndahesudintocctmsdriver.constant.NewLJConstant; 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.BaseObserver;
import com.arpa.hndahesudintocctmsdriver.request.net.DataManager; import com.arpa.hndahesudintocctmsdriver.request.net.DataManager;
import com.arpa.hndahesudintocctmsdriver.request.net.RxHttpCallBack; 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.OnGDDownloadResultListener;
import com.dahe.mylibrary.callback.OnGDResultListener; import com.dahe.mylibrary.callback.OnGDResultListener;
import com.dahe.mylibrary.net.CommonResponseBean; import com.dahe.mylibrary.net.CommonResponseBean;
import com.dahe.mylibrary.utils.TimeUtil;
import com.dahe.mylibrary.utils.ToastUtils; import com.dahe.mylibrary.utils.ToastUtils;
import com.express.mdp.Api;
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers; 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 * @param act
*/ */
// public void startLocationService(AppCompatActivity act){ public void startLocationService(AppCompatActivity act){
// try { try {
// Api.startLocationService(act, NewLJConstant.ENTER_PRISE_CODE, s -> { Api.setBaseUrl("https://kehui56.cn/api","https://api.kehui56.cn/api");
// Log.e("位置上报", s); Api.startLocationService(act, NewLJConstant.ENTER_PRISE_CODE, s -> {
// }); Log.e("位置上报", s);
// } catch (JSONException e) { });
// throw new RuntimeException(e); } catch (Exception e) {
// } throw new RuntimeException(e);
// } }
}
/** /**
* 关闭定位服务 * 关闭定位服务
*/ */
// public void stopLocationService(){ public void stopLocationService(){
// Api.stopLocationService(); Api.stopLocationService();
// } }
} }

View File

@ -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" 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) { task clean(type: Delete) {
delete rootProject.buildDir delete rootProject.buildDir
} }

View File

@ -1,6 +1,7 @@
#Mon Jul 12 10:16:49 CST 2021 #Mon Jul 12 10:16:49 CST 2021
distributionBase=GRADLE_USER_HOME 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 distributionPath=wrapper/dists
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

View File

@ -35,7 +35,7 @@ android {
dependencies { 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.core:core-ktx:1.3.1'
implementation 'androidx.appcompat:appcompat:1.2.0' implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1' implementation 'com.google.android.material:material:1.2.1'

View File

@ -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" rootProject.name = "wangluohuoyun"
include ':app' include ':app'
//include ':AliyunVideoCommon' //include ':AliyunVideoCommon'