Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
tongchenfei
2020-10-21 15:23:39 +08:00
13 changed files with 92 additions and 21 deletions

View File

@@ -23,6 +23,8 @@ public class BnHooker implements InvocationHandler {
private static final String TAG = "BnHooker";
private Object host;
private Method getGLMapEngineMethod;
private GLMapEngine glMapEngineObject;
public BnHooker( AMap map ) throws Exception {
@@ -47,11 +49,17 @@ public class BnHooker implements InvocationHandler {
}
public void clearAllMessages() throws Exception {
Method method = host.getClass().getDeclaredMethod( "getGLMapEngine" );
method.setAccessible( true );
GLMapEngine glMapEngine = ( GLMapEngine ) method.invoke( host );
clearMessageList( "mStateMessageList", glMapEngine );
clearMessageList( "mAnimateStateMessageList", glMapEngine );
if ( glMapEngineObject == null ) {
if ( getGLMapEngineMethod == null ) {
getGLMapEngineMethod = host.getClass().getDeclaredMethod( "getGLMapEngine" );
getGLMapEngineMethod.setAccessible( true );
}
glMapEngineObject = ( GLMapEngine ) getGLMapEngineMethod.invoke( host );
}
if ( glMapEngineObject != null ) {
clearMessageList( "mStateMessageList", glMapEngineObject );
clearMessageList( "mAnimateStateMessageList", glMapEngineObject );
}
}
private void clearMessageList( String filedName, Object obj ) throws Exception {

View File

@@ -58,7 +58,7 @@ class StrategyServiceModel : BaseRepository() {
// }
// }
suspend fun uploadInformation(informationBody: InformationBody): BaseResponse<Any> {
suspend fun uploadInformation(informationBody: InformationBody): BaseResponse<UploadResult> {
return apiCall {
var informationBodyStr = Gson().toJson(informationBody)
Log.d("MainServiceController", "uploadInformation informationBody = " + informationBodyStr)

View File

@@ -0,0 +1,8 @@
package com.zhidao.roadcondition.model
/**
* 上报成功返回
*/
class UploadResult(var id: Long) {
}

View File

@@ -3,6 +3,7 @@ package com.zhidao.roadcondition.net
import com.zhidao.roadcondition.model.BaseResponse
import com.zhidao.roadcondition.model.CommonConfig
import com.zhidao.roadcondition.model.Results
import com.zhidao.roadcondition.model.UploadResult
import okhttp3.MultipartBody
import okhttp3.ResponseBody
import retrofit2.http.*
@@ -19,7 +20,7 @@ interface HttpApi {
//上报情报数据
@FormUrlEncoded
@POST("/deva/car/path/no/addInfomation/v2")
suspend fun uploadInformation(@FieldMap information: Map<String, String>): BaseResponse<Any>
suspend fun uploadInformation(@FieldMap information: Map<String, String>): BaseResponse<UploadResult>
//获取所有配置
@GET("dataService/car/customConfig/no/getAll/v1")

View File

@@ -203,6 +203,7 @@ class CosStatusController : CosStatusCallback {
//开始上传
entity?.isCustom?.let {
mainServiceHttpModel.sendInformationMessage(
fromType = mFromType,
type = type,
url = map,
isCustom = it,
@@ -227,15 +228,14 @@ class CosStatusController : CosStatusCallback {
}
}
} else {
// if (type == INFO_TYPE_VIDEO) {
// TipToast.shortTip("分享失败,请检查网络")
// }
}
}
}
}
override fun onProgress(localPath: String?, progress: Float) {
}

View File

@@ -1,11 +1,9 @@
package com.zhidao.roadcondition.service
import android.content.Intent
import android.util.Log
import com.mogo.commons.AbsMogoApplication
import com.zhidao.roadcondition.event.GetImageSuccessEvent
import com.zhidao.roadcondition.event.LatLngStickyEventBus
import com.zhidao.roadcondition.model.*
import com.zhidao.roadcondition.model.proxy.INFO_TYPE_VIDEO
import com.zhidao.roadcondition.net.request
import com.zhidao.roadcondition.util.*
import com.zhidao.roadcondition.util.StrategyPreferenceUtil.Companion.setStrategyFrequency
@@ -25,6 +23,8 @@ class MainServiceController {
//逆地理编码是否重试
private var geoRetryed = false
private var mFromType: String = ""
private var mPoiType: String = ""
private val strategyeModel by lazy { StrategyServiceModel() }
@@ -224,6 +224,7 @@ class MainServiceController {
//上传情报数据
fun sendInformationMessage(
type: Int,
fromType: String,
url: Map<String, String>,
isCustom: Boolean = false,
trafficInfoType:String = "",
@@ -234,7 +235,10 @@ class MainServiceController {
latitude: Double,
customSend: ((Boolean) -> Unit)? = null
) {
Log.d(TAG, " sendInformationMessage poiType = $poiType")
Log.d(TAG, " sendInformationMessage poiType = $poiType -- fromType = $fromType")
mFromType = fromType
mPoiType = poiType
//删除测试数据
var locationInfo = LocationUtil.getInstance().getLocationInfo()
if (locationInfo.address.isNullOrEmpty()) {
@@ -297,12 +301,16 @@ class MainServiceController {
customSend: ((Boolean) -> Unit)? = null
) {
trackUploadServer(3)
request<BaseResponse<Any>> {
request<BaseResponse<UploadResult>> {
loader {
strategyeModel.uploadInformation(informationBody)
}
onSuccess {
Log.i(TAG, "upload message success ")
if (it.result != null) {
Log.i(TAG, "upload message success id" + it.result.id)
sendUgcStatusReceiver(it.result.id, mPoiType, mFromType)
}
trackUploadServer(1)
// CosStatusController().videoAndThumbMap.clear()
customSend?.invoke(true)
@@ -310,12 +318,23 @@ class MainServiceController {
onError {
Log.i(TAG, "$it upload message ${it.message}")
trackUploadServer(2)
sendUgcStatusReceiver(0, mPoiType, mFromType)
// CosStatusController().videoAndThumbMap.clear()
customSend?.invoke(false)
}
}
}
private fun sendUgcStatusReceiver(id: Long, type: String?, fromType: String?) {
Log.e(TAG, "sendUgcStatusReceiver ----> id = $id ---type = $type --fromType = $fromType ")
var intent = Intent()
intent.action = "com.v2x.ugc.upload.status"
intent.putExtra("id", id)
intent.putExtra("type", type)
intent.putExtra("fromType", fromType)
AbsMogoApplication.getApp().applicationContext.sendBroadcast(intent)
}
//上传服务器
private fun trackUploadServer(type: Int) {
trackNormalEvent(

View File

@@ -157,7 +157,8 @@ public class CustomRatingBar extends LinearLayout {
context.getResources().getDimension(R.dimen.heart_ratingbar_width));
elementHeight = mTypedArray.getDimension(R.styleable.CustomRatingBar_elenmentHeight,
context.getResources().getDimension(R.dimen.heart_ratingbar_height));
elementPadding = mTypedArray.getDimension(R.styleable.CustomRatingBar_elenmentPadding, 10);
elementPadding = mTypedArray.getDimension(R.styleable.CustomRatingBar_elenmentPadding,
context.getResources().getDimension(R.dimen.ratingbar_padding));
elementStep = mTypedArray.getFloat(R.styleable.CustomRatingBar_elenmentStep, 1.0f);
stepSize = StepSize.fromStep(mTypedArray.getInt(R.styleable.CustomRatingBar_stepSize, 1));

View File

@@ -1052,5 +1052,6 @@
<dimen name="v2x_share_btn_height">48px</dimen>
<dimen name="share_item_address">17.5000px</dimen>
<dimen name="panel_list_item_title_size">15.3125px</dimen>
<dimen name="ratingbar_padding">6px</dimen>
</resources>

View File

@@ -559,7 +559,7 @@ public class TanluListWindow extends RelativeLayout implements IMogoMarkerClickL
@Override
public void onQueryRoadInfoSuccess(@NotNull List<? extends MarkerExploreWay> roadInfoList) {
if (roadInfoList == null || (roadInfoList != null && roadInfoList.size() <= 0)) {
speakFailVoice("找到其他车主分享的路况信息");
speakFailVoice("发现" + mKeywords + "附近的特殊路况");
moveToMarcker(currentLat, currentLon);
return;
}

View File

@@ -33,9 +33,8 @@
<item >小智这就去查,您稍等一下</item>
</array>
<array name="search_fail_voice_array">
<item>找不到相关地址</item>
<item>找不到地址,是小智不好</item>
<item>未找到其他车主分享的路况信息</item>
<item>找不到相关地址,试试换个说法</item>
<item>找不到地址,换个地址试试</item>
</array>
</resources>

View File

@@ -16,6 +16,14 @@
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
<!--ugc上报状态反馈广播-->
<receiver android:name=".receiver.UgcUploadStatusReceiver">
<intent-filter>
<action android:name="com.v2x.ugc.upload.status" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
</application>
</manifest>

View File

@@ -0,0 +1,20 @@
package com.mogo.module.v2x.receiver
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.util.Log
/**
* ugc上报反馈
*/
class UgcUploadStatusReceiver : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
if (intent.action == "com.v2x.ugc.upload.status"){
var id = intent.getLongExtra("id", 0)
var type = intent.getStringExtra("type")
var fromType = intent.getStringExtra("fromType")
}
}
}

View File

@@ -71,6 +71,12 @@ public interface IMogoTanluProvider extends IProvider {
*/
String UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO = "5";
/**
* 数据策略:UGC上报
*/
String UPLOAD_FROM_STRATEGY_UGC = "6";
/**
* 策略上报集合
*/