Merge remote-tracking branch 'origin/dev_MogoAP_eagle-1030_211020_8.0.14' into dev_MogoAP_eagle-1030_211020_8.0.14
This commit is contained in:
@@ -284,7 +284,7 @@ class MoGoHmiFragment : MvpFragment<MoGoWarningContract.View?, WaringPresenter?>
|
||||
var floatView: NoticeFloatView? = null
|
||||
|
||||
/**
|
||||
* 展示普通公告 liyz
|
||||
* 展示普通公告
|
||||
* @param normalData
|
||||
*/
|
||||
override fun showNoticeNormal(normalData: NoticeNormalData) {
|
||||
|
||||
@@ -36,15 +36,20 @@ class NoticeCheckDialog(context: Context) : BaseFloatDialog(context) {
|
||||
}
|
||||
}
|
||||
|
||||
fun showCheckDialog(title: String, content: String) {
|
||||
/**
|
||||
* 展示详情页面
|
||||
*/
|
||||
fun showCheckDialog(title: String, dbId: String) {
|
||||
if (isShowing) {
|
||||
return
|
||||
}
|
||||
if (title.isBlank() || content.isBlank()) {
|
||||
if (title.isBlank() || dbId.isBlank()) {
|
||||
return
|
||||
}
|
||||
pushCheckTitle?.text = title
|
||||
pushCheckContent?.text = content
|
||||
|
||||
//网络请求处理数据
|
||||
|
||||
show()
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ import com.mogo.utils.glide.GlideApp
|
||||
class NoticeFloatView constructor(
|
||||
private val context: Context
|
||||
) {
|
||||
|
||||
companion object {
|
||||
const val TYPE_TOP_VIEW = 1
|
||||
const val TYPE_WINDOW_MANAGER = 2
|
||||
@@ -55,13 +54,13 @@ class NoticeFloatView constructor(
|
||||
pushContent = findViewById(R.id.notice_push_content)
|
||||
titleIconContainer = findViewById(R.id.module_push_app_icon_title)
|
||||
|
||||
//查看结果
|
||||
//查看结果 TODO
|
||||
pushCheck.setOnClickListener {
|
||||
pushData?.let {
|
||||
if (pushCheckDialog == null) {
|
||||
pushCheckDialog = NoticeCheckDialog(ContextHolderUtil.getContext())
|
||||
}
|
||||
pushCheckDialog!!.showCheckDialog(it.title, it.content)
|
||||
pushCheckDialog!!.showCheckDialog(it.title, it.dbId)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -78,34 +77,6 @@ class NoticeFloatView constructor(
|
||||
pushImage.visible()
|
||||
GlideApp.with(this).load(bean.imageUrl).placeholder(R.drawable.notice_banner_default).into(pushImage)
|
||||
|
||||
// image
|
||||
// if (bean.imageUrl.isEmpty()) {
|
||||
// pushImage.gone()
|
||||
// } else if (bean.imageUrl.isNotEmpty()) {
|
||||
// val params = pushImage.layoutParams
|
||||
// params.width = getImgWidth()
|
||||
// params.height = getImgHeight()
|
||||
// pushImage.layoutParams = params
|
||||
// pushImage.visible()
|
||||
// GlideApp.with(this).load(bean.imageUrl).placeholder(R.drawable.notice_banner_default).into(pushImage)
|
||||
// } else if (bean.QRCode.isNotEmpty()) {
|
||||
// val params = pushImage.layoutParams
|
||||
// params.width = getQrImgWidth()
|
||||
// params.height = getQrImgHeight()
|
||||
// pushImage.layoutParams = params
|
||||
// ThreadPoolService.execute {
|
||||
// val bmp = stringConverterBitmap(
|
||||
// bean.QRCode,
|
||||
// getQrImgWidth(),
|
||||
// getQrImgHeight()
|
||||
// )
|
||||
// UiThreadHandler.post {
|
||||
// pushImage.setImageBitmap(bmp)
|
||||
// pushImage.visible()
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// content
|
||||
if (bean.content.isEmpty()) {
|
||||
pushContent.gone()
|
||||
@@ -196,7 +167,6 @@ class NoticeFloatView constructor(
|
||||
|
||||
init {
|
||||
delayClosePush = Runnable {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,14 +64,7 @@ class NoticeSocketManager {
|
||||
return;
|
||||
}
|
||||
|
||||
//TODO 展示弹框
|
||||
CallerHmiManager.INSTANCE.showNormalBanner(obj);
|
||||
|
||||
// NoticePushData data = new NoticePushData();
|
||||
// data.setImageUrl(obj.getImageUrl());
|
||||
// data.setContent(obj.getContent());
|
||||
// data.setInfoId(obj.getDbId());
|
||||
// CallerHmiManager.INSTANCE.showTrafficBanner(data);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
package com.mogo.eagle.core.function.notice.network;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.eagle.core.data.notice.NoticeNormalDetail;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.FieldMap;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
/**
|
||||
* @author Jing
|
||||
@@ -36,4 +39,12 @@ public interface NoticeApiService {
|
||||
@POST("/deva/accidentInfoManage/policeUpdateTroubleStatus")
|
||||
Observable<BaseData> sendAcceptStatus(@FieldMap Map<String, String> accidentParameters);
|
||||
|
||||
/**
|
||||
* 获取普通公告详情
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@GET("/deva/pc/pathAndPoi/getAnnouncementByDbId")
|
||||
Observable<NoticeNormalDetail> getNoticeDetail(@QueryMap Map<String, String> param);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,9 @@ import com.mogo.cloud.network.NetConstants;
|
||||
import com.mogo.cloud.network.RetrofitFactory;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient;
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.eagle.core.data.notice.NoticeNormalDetail;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -20,7 +23,7 @@ import io.reactivex.schedulers.Schedulers;
|
||||
* @since: 10/28/21
|
||||
*/
|
||||
public class NoticeNetWorkManager {
|
||||
private String TAG = "AINotice";
|
||||
private String TAG = "NoticeNetWorkManager";
|
||||
private static volatile NoticeNetWorkManager requestNoticeManager;
|
||||
private final NoticeApiService mNoticeApiService;
|
||||
|
||||
@@ -115,4 +118,45 @@ public class NoticeNetWorkManager {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取普通公告的详情
|
||||
*
|
||||
* @param dbId
|
||||
*/
|
||||
public void getNoticeDetail(String dbId) {
|
||||
String sn = MoGoAiCloudClient.getInstance().getAiCloudClientConfig().getSn();
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("sn", sn);
|
||||
map.put("infoId", dbId);
|
||||
|
||||
mNoticeApiService.getNoticeDetail(map)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<NoticeNormalDetail>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull NoticeNormalDetail noticeNormalDetail) {
|
||||
Logger.d(TAG, "onNext ------ ");
|
||||
// CallerHmiManager.INSTANCE.showNormalBanner(noticeNormalDetail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Logger.e(TAG, " onError e = " + e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Logger.d(TAG, "onComplete ------ ");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
package com.mogo.eagle.core.data.notice
|
||||
|
||||
import androidx.annotation.Keep
|
||||
|
||||
/**
|
||||
*
|
||||
* @description 普通公告详情数据
|
||||
*
|
||||
* @author lixiaopeng
|
||||
* @since 2021/11/1
|
||||
*/
|
||||
@Keep
|
||||
data class NoticeNormalDetail(
|
||||
|
||||
//0-未处理,1-处理完成
|
||||
private var artificialHand: Int? = 0,
|
||||
|
||||
private var ownerHand: Int? = 0,
|
||||
|
||||
private var provinceId: String? = null,
|
||||
|
||||
private var cityId: String? = null,
|
||||
|
||||
private var areaId: String? = null,
|
||||
|
||||
private var dbId: String? = null,
|
||||
|
||||
private var coordinates: Array<Double?>?, //情报采集点坐标 [lng, lat]
|
||||
|
||||
private var uploadTimestamp: Long? = null, //情报采集时间
|
||||
|
||||
private var timeout: Long? = null, // 情报失效时间
|
||||
|
||||
private var uploadAddress: String? = null, //情报采集点地址信息
|
||||
|
||||
private var data: String? = null, //情报内容
|
||||
|
||||
private var poiImgUrl: String? = null,
|
||||
|
||||
private var dataSource: Int? = null, //情报来源
|
||||
|
||||
private var type: Int? = null, //情报类型
|
||||
|
||||
private var roadConditions: String? = null, //路况类型
|
||||
|
||||
private var distance: Int? = null, //距离重点距离
|
||||
|
||||
private var nickName: String? = null, //用户昵称
|
||||
|
||||
private var headImgUrl: String? = null, //用户头像
|
||||
|
||||
private var sn: String? = null,
|
||||
|
||||
private var userId: Long? = null, //用戶id
|
||||
|
||||
private var likeNum: Long? = 0L, //点赞数
|
||||
|
||||
private var systemLikeNum: Long? = 0L, //系统点赞数
|
||||
|
||||
private var infoType: Int? = null,//1-主动上传;0-被动上传
|
||||
|
||||
private var provinceName: String? = null,
|
||||
|
||||
private var cityName: String? = null,
|
||||
|
||||
private var trafficInfoType: String? = null,//交通状况
|
||||
|
||||
private var esID: String? = null,//es唯一标识
|
||||
|
||||
private var poiType: String? = null, //事件类型
|
||||
|
||||
private var direction: Int? = null,
|
||||
|
||||
private var speed: Double? = null,
|
||||
|
||||
private var uploadType: Int? = null, //1-用户,2-主动,3-爬虫
|
||||
|
||||
private var ex_id: String? = null,
|
||||
|
||||
private var infoCheckNode: Int? = null, //智能审核节点,0-未审核1-openCV智能审核2-人工审核
|
||||
|
||||
private var content: String? = null, //内容
|
||||
|
||||
private var warningDistance: Double = 0.0, //预警距离
|
||||
|
||||
private var auditPass: Int? = null,
|
||||
|
||||
private var troubleType: Int? = null,
|
||||
|
||||
private var troubleReason: Int? = null,
|
||||
|
||||
private var fileType: Int? = null,
|
||||
private var videoUrl: String? = null,
|
||||
private var videoImage: String? = null,
|
||||
)
|
||||
@@ -1,21 +0,0 @@
|
||||
package com.mogo.eagle.core.data.notice
|
||||
|
||||
import androidx.annotation.Keep
|
||||
|
||||
/**
|
||||
* @description 普通公告详情
|
||||
*
|
||||
* @author lixiaopeng
|
||||
* @since 2021/10/29 TODO 等待服务端定接口
|
||||
*/
|
||||
@Keep
|
||||
data class NoticeNormalDetailData(
|
||||
var appIcon: String = "", //目标app icon图标地址
|
||||
var title: String = "", //标题
|
||||
var content: String = "", //内容
|
||||
var dbId: String = "", //公告id
|
||||
var imageUrl: String = "", //图片地址
|
||||
var videoUrl: String = "", //视频地址
|
||||
var fileType: Int = 0, // 1图片,2视频
|
||||
val tts: String = "", //语音播报词
|
||||
)
|
||||
Reference in New Issue
Block a user