From f554d066dcb8d0f0127977aa9328e107a276fae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=8F=E5=AE=87?= Date: Tue, 7 Jul 2020 16:03:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86V2X=E4=B8=AD=E7=94=A8=E5=88=B0?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE=E7=B1=BB=E4=B8=8B=E6=B2=89=E5=88=B0?= =?UTF-8?q?=E4=BA=86=E5=85=AC=E7=94=A8=E6=A8=A1=E5=9D=97=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gradle.properties | 56 ++-- .../common/entity/V2XEventShowEntity.java | 88 ++++++ .../common/entity/V2XLiveCarInfoEntity.java | 66 ++++ .../common/entity/V2XMessageEntity.java | 125 ++++++++ .../module/common/entity/V2XPoiTypeEnum.java | 31 ++ .../common/entity/V2XPushMessageEntity.java | 264 ++++++++++++++++ .../common/entity/V2XRoadEventEntity.java | 298 ++++++++++++++++++ .../common/entity/V2XWindowTypeEnum.java | 27 ++ 8 files changed, 927 insertions(+), 28 deletions(-) create mode 100644 modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XEventShowEntity.java create mode 100644 modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XLiveCarInfoEntity.java create mode 100644 modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XMessageEntity.java create mode 100644 modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XPoiTypeEnum.java create mode 100644 modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XPushMessageEntity.java create mode 100644 modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XRoadEventEntity.java create mode 100644 modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XWindowTypeEnum.java diff --git a/gradle.properties b/gradle.properties index 17bee8a4c3..66358b8c47 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,37 +24,37 @@ SNAPSHOT_REPOSITORY_URL=http://nexus.zhidaoauto.com/repository/maven-snapshots/ USERNAME=xintai PASSWORD=xintai2018 # 编译模式: false - 依赖本地版本, true - 依赖 maven 版本 -RELEASE=false +RELEASE=true # 模块版本 ## 工程内模块 -MOGO_COMMONS_VERSION=1.2.1.12 -MOGO_UTILS_VERSION=1.2.1.12 -MAP_AMAP_VERSION=1.2.1.12 -MAP_AUTONAVI_VERSION=1.2.1.12 -MOGO_MAP_VERSION=1.2.1.12 -MOGO_MAP_API_VERSION=1.2.1.12 -MOGO_SERVICE_VERSION=1.2.1.12 -MOGO_SERVICE_API_VERSION=1.2.1.12 -MOGO_CONNECTION_VERSION=1.2.1.12 -MOGO_MODULE_APPS_VERSION=1.2.1.12 -MOGO_MODULE_NAVI_VERSION=1.2.1.12 -MOGO_MODULE_SHARE_VERSION=1.2.1.12 -MOGO_MODULE_COMMON_VERSION=1.2.1.13 -MOGO_MODULE_MAIN_VERSION=1.2.1.12 -MOGO_MODULE_MAP_VERSION=1.2.1.12 -MOGO_MODULE_SERVICE_VERSION=1.2.1.12 -MOGO_MODULE_EXTENSIONS_VERSION=1.2.1.12 -MOGO_MODULE_SEARCH_VERSION=1.2.1.12 -MOGO_MODULE_BACK_VERSION=1.2.1.12 -MOGO_MODULE_GPS_SIMULATOR_VERSION=1.2.1.12 -MOGO_MODULE_GPS_SIMULATOR_DEBUG_VERSION=1.2.1.12 -MOGO_MODULE_GPS_SIMULATOR_NOOP_VERSION=1.2.1.12 -MOGO_MODULE_AUTHORIZE_VERSION=1.2.1.12 -MOGO_MODULE_GUIDE_VERSION=1.2.1.12 -MOGO_MODULE_MEDIA_VERSION=1.2.1.12 +MOGO_COMMONS_VERSION=1.2.1.13 +MOGO_UTILS_VERSION=1.2.1.13 +MAP_AMAP_VERSION=1.2.1.13 +MAP_AUTONAVI_VERSION=1.2.1.13 +MOGO_MAP_VERSION=1.2.1.13 +MOGO_MAP_API_VERSION=1.2.1.13 +MOGO_SERVICE_VERSION=1.2.1.13 +MOGO_SERVICE_API_VERSION=1.2.1.13 +MOGO_CONNECTION_VERSION=1.2.1.13 +MOGO_MODULE_APPS_VERSION=1.2.1.13 +MOGO_MODULE_NAVI_VERSION=1.2.1.13 +MOGO_MODULE_SHARE_VERSION=1.2.1.13 +MOGO_MODULE_COMMON_VERSION=1.2.1.14 +MOGO_MODULE_MAIN_VERSION=1.2.1.13 +MOGO_MODULE_MAP_VERSION=1.2.1.13 +MOGO_MODULE_SERVICE_VERSION=1.2.1.13 +MOGO_MODULE_EXTENSIONS_VERSION=1.2.1.13 +MOGO_MODULE_SEARCH_VERSION=1.2.1.13 +MOGO_MODULE_BACK_VERSION=1.2.1.13 +MOGO_MODULE_GPS_SIMULATOR_VERSION=1.2.1.13 +MOGO_MODULE_GPS_SIMULATOR_DEBUG_VERSION=1.2.1.13 +MOGO_MODULE_GPS_SIMULATOR_NOOP_VERSION=1.2.1.13 +MOGO_MODULE_AUTHORIZE_VERSION=1.2.1.13 +MOGO_MODULE_GUIDE_VERSION=1.2.1.13 +MOGO_MODULE_MEDIA_VERSION=1.2.1.13 -MOGO_MODULE_MAIN_LAUNCHER_VERSION = 1.2.1.12 -MOGO_MODULE_MAIN_INDEPENDENT_VERSION = 1.2.1.12 +MOGO_MODULE_MAIN_LAUNCHER_VERSION = 1.2.1.13 +MOGO_MODULE_MAIN_INDEPENDENT_VERSION = 1.2.1.13 MOGO_MODULE_OBU_VERSION = 1.2.1.10-SNAPSHOT diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XEventShowEntity.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XEventShowEntity.java new file mode 100644 index 0000000000..a099e4db17 --- /dev/null +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XEventShowEntity.java @@ -0,0 +1,88 @@ +package com.mogo.module.common.entity; + + +import java.io.Serializable; +import java.util.List; +import java.util.Objects; + +/** + * author : donghongyu + * e-mail : 1358506549@qq.com + * date : 2020/3/11 4:25 PM + * desc : V2X事件列表展示 + * version: 1.0 + */ +public class V2XEventShowEntity implements Serializable { + + // 0---默认展示详情,1--直播,4--道路事件详情 + private int viewType; + + // 道路事件详情 + private V2XRoadEventEntity v2XRoadEventEntity; + // 直播车机 @see viewType = 1 + private V2XLiveCarInfoEntity v2XLiveCarInfoRes; + // 直播车机列表 + private List v2XLiveCarList; + + public int getViewType() { + return viewType; + } + + public void setViewType(int viewType) { + this.viewType = viewType; + } + + public V2XRoadEventEntity getV2XRoadEventEntity() { + return v2XRoadEventEntity; + } + + public void setV2XRoadEventEntity(V2XRoadEventEntity v2XRoadEventEntity) { + this.v2XRoadEventEntity = v2XRoadEventEntity; + } + + public V2XLiveCarInfoEntity getV2XLiveCarInfoRes() { + return v2XLiveCarInfoRes; + } + + public void setV2XLiveCarInfoRes(V2XLiveCarInfoEntity v2XLiveCarInfoRes) { + this.v2XLiveCarInfoRes = v2XLiveCarInfoRes; + } + + public List getV2XLiveCarList() { + return v2XLiveCarList; + } + + public void setV2XLiveCarList(List v2XLiveCarList) { + this.v2XLiveCarList = v2XLiveCarList; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V2XEventShowEntity that = (V2XEventShowEntity) o; + return viewType == that.viewType && + Objects.equals(v2XRoadEventEntity, that.v2XRoadEventEntity) && + Objects.equals(v2XLiveCarInfoRes, that.v2XLiveCarInfoRes) && + Objects.equals(v2XLiveCarList, that.v2XLiveCarList); + } + + @Override + public int hashCode() { + return Objects.hash(viewType, v2XRoadEventEntity, v2XLiveCarInfoRes, v2XLiveCarList); + } + + @Override + public String toString() { + return "V2XEventShowEntity{" + + "viewType=" + viewType + + ", v2XRoadEventEntity=" + v2XRoadEventEntity + + ", v2XLiveCarInfoRes=" + v2XLiveCarInfoRes + + ", v2XLiveCarList=" + v2XLiveCarList + + '}'; + } +} diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XLiveCarInfoEntity.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XLiveCarInfoEntity.java new file mode 100644 index 0000000000..94af904dc0 --- /dev/null +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XLiveCarInfoEntity.java @@ -0,0 +1,66 @@ +package com.mogo.module.common.entity; + +import java.util.Objects; + +/** + * 可直播车机基本信息,再通过 appDataService/integratedServices/app/push/no/livePush/v1 + * 获取直播信息 + * @author donghongyu + */ +public class V2XLiveCarInfoEntity { + private String sn; + private double lon; + private double lat; + + public String getSn() { + return sn; + } + + public void setSn(String sn) { + this.sn = sn; + } + + public double getLon() { + return lon; + } + + public void setLon(double lon) { + this.lon = lon; + } + + public double getLat() { + return lat; + } + + public void setLat(double lat) { + this.lat = lat; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + V2XLiveCarInfoEntity that = (V2XLiveCarInfoEntity) o; + return Double.compare(that.lon, lon) == 0 && + Double.compare(that.lat, lat) == 0 && + Objects.equals(sn, that.sn); + } + + @Override + public int hashCode() { + return Objects.hash(sn, lon, lat); + } + + @Override + public String toString() { + return "V2XLiveCarEntity{" + + "sn='" + sn + '\'' + + ", lon=" + lon + + ", lat=" + lat + + '}'; + } +} \ No newline at end of file diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XMessageEntity.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XMessageEntity.java new file mode 100644 index 0000000000..3e52d000f7 --- /dev/null +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XMessageEntity.java @@ -0,0 +1,125 @@ +package com.mogo.module.common.entity; + +import androidx.annotation.IntDef; + +import java.io.Serializable; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; +import java.util.Objects; + +/** + * e-mail : 1358506549@qq.com + * date : 2020/5/15 4:35 PM + * desc : V2X 场景消息聚合 + * version: 1.0 + * + * @author donghongyu + */ +public class V2XMessageEntity implements Serializable { + + /** + * 场景类型 + * + * @see V2XTypeEnum + */ + @MessageType + int type; + + /** + * 是否展示对话框 + * true-展示,false-不展示 + */ + boolean showState; + + /** + * 场景具体的数据内容 + */ + T content; + + public int getType() { + return type; + } + + public void setType(@MessageType int type) { + this.type = type; + } + + public boolean isShowState() { + return showState; + } + + public void setShowState(boolean showState) { + this.showState = showState; + } + + public T getContent() { + return content; + } + + public void setContent(T content) { + this.content = content; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + V2XMessageEntity that = (V2XMessageEntity) o; + return type == that.type && + content.equals(that.content); + } + + @Override + public int hashCode() { + return Objects.hash(type, content); + } + + /** + * V2X 场景类型 + */ + public interface V2XTypeEnum { + // 道路事件预警 + int ALERT_ROAD_WARNING = 1_000; + // 他车求助预警 + int ALERT_SEEK_WARNING = 1_001; + // 疲劳驾驶预警 + int ALERT_FATIGUE_DRIVING = 1_002; + // 后台推送展示 Window + int ALERT_PUSH_WINDOW_WARNING = 1_003; + // 后台推送展示 Toast + int ALERT_PUSH_TOAST_WARNING = 1_004; + // 后台推送展示 展示的直播 + int ALERT_PUSH_LIVE_CAR_WARNING = 1_005; + // V2X场景动画展示 + int ALERT_ANIMATION_WARNING = 1_006; + // 道路事件直播预警 + int ALERT_ROAD_LIVE_CAR_WARNING = 1_007; + // 道路事件违章停车 + int ALERT_ILLEGAL_PARK_WARNING = 1_008; + // 自车求助 + int ALERT_CAR_FOR_HELP = 8_000; + } + + @IntDef(value = { + V2XTypeEnum.ALERT_ROAD_WARNING, + V2XTypeEnum.ALERT_SEEK_WARNING, + V2XTypeEnum.ALERT_FATIGUE_DRIVING, + V2XTypeEnum.ALERT_PUSH_WINDOW_WARNING, + V2XTypeEnum.ALERT_PUSH_TOAST_WARNING, + V2XTypeEnum.ALERT_PUSH_LIVE_CAR_WARNING, + V2XTypeEnum.ALERT_ANIMATION_WARNING, + V2XTypeEnum.ALERT_ROAD_LIVE_CAR_WARNING, + V2XTypeEnum.ALERT_ILLEGAL_PARK_WARNING, + V2XTypeEnum.ALERT_CAR_FOR_HELP, + }) + @Target({ + ElementType.PARAMETER, + ElementType.FIELD, + ElementType.METHOD, + }) //表示注解作用范围,参数注解,成员注解,方法注解 + @Retention(RetentionPolicy.SOURCE) //表示注解所存活的时间,在运行时,而不会存在 .class 文件中 + public @interface MessageType { //接口,定义新的注解类型 + } +} diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XPoiTypeEnum.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XPoiTypeEnum.java new file mode 100644 index 0000000000..6624758b81 --- /dev/null +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XPoiTypeEnum.java @@ -0,0 +1,31 @@ +package com.mogo.module.common.entity; + +/** + * author : donghongyu + * e-mail : 1358506549@qq.com + * date : 2020/3/31 4:53 PM + * desc : V2X 道路事件类型 + * version: 1.0 + */ +public interface V2XPoiTypeEnum extends MarkerPoiTypeEnum { + // 前方静止or慢速车辆报警 + String ALERT_FRONT_CAR = "99999"; + // 限行管理 + String ALERT_TRAFFIC_CONTROL = "99998"; + // 红绿灯事件、是建议以多少速度驶过 + String ALERT_TRAFFIC_LIGHT_SUGGEST = "99997"; + // 红绿灯事件、一种是绿灯不足3秒 + String ALERT_TRAFFIC_LIGHT_WARNING = "99996"; + // 故障车辆 + int ALERT_CAR_TROUBLE_WARNING = 20007; + + // TODO 这里目前是演示DEMO会用到,想着是打算商用,先这么处理的 + // 取快递 + String ALERT_TRAFFIC_EXPRESS = "99995"; + // 顺风车 + String ALERT_TRAFFIC_TAXI = "99994"; + // 疲劳驾驶 + String ALERT_FATIGUE_DRIVING = "99993"; + // 违章停车 + String ALERT_ILLEGAL_PARK = "99992"; +} diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XPushMessageEntity.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XPushMessageEntity.java new file mode 100644 index 0000000000..4c4d1af587 --- /dev/null +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XPushMessageEntity.java @@ -0,0 +1,264 @@ +package com.mogo.module.common.entity; + +import android.text.TextUtils; + +import java.io.Serializable; +import java.util.Objects; + +/** + * author : donghongyu + * e-mail : 1358506549@qq.com + * date : 2020-02-0315:49 + * desc : V2X警报数据 + * version: 1.0 + */ +public class V2XPushMessageEntity implements Serializable { + // 0---默认展示详情,1--直播,2--停车场,3--加油站,4--道路事件详情 + private int viewType; + private String sceneId; + private String sceneName; + private short sceneCategory; + private short sceneLevel; + private String sceneDescription; + private boolean zoom; + private int zoomScale; + private String alarmContent; + private String tts; + private String videoUrl; + private String videoSn; + private String videoChannel; + private int expireTime; + private double lat; + private double lon; + private String sn; + private String headImgUrl; + private String msgImgUrl; + private String address; + private double distance; + private boolean isShowWindow; + + public int getViewType() { + return viewType; + } + + public void setViewType(int viewType) { + this.viewType = viewType; + } + + public String getSceneId() { + return sceneId; + } + + public void setSceneId(String sceneId) { + this.sceneId = sceneId; + } + + public String getSceneName() { + return sceneName; + } + + public void setSceneName(String sceneName) { + this.sceneName = sceneName; + } + + public short getSceneCategory() { + return sceneCategory; + } + + public void setSceneCategory(short sceneCategory) { + this.sceneCategory = sceneCategory; + } + + public short getSceneLevel() { + return sceneLevel; + } + + public void setSceneLevel(short sceneLevel) { + this.sceneLevel = sceneLevel; + } + + public String getSceneDescription() { + return sceneDescription; + } + + public void setSceneDescription(String sceneDescription) { + this.sceneDescription = sceneDescription; + } + + public boolean isZoom() { + return zoom; + } + + public void setZoom(boolean zoom) { + this.zoom = zoom; + } + + public String getAlarmContent() { + if (TextUtils.isEmpty(alarmContent)) { + return ""; + } + return alarmContent; + } + + public void setAlarmContent(String alarmContent) { + this.alarmContent = alarmContent; + } + + public String getTts() { + if (TextUtils.isEmpty(tts)) { + return ""; + } + return tts; + } + + public void setTts(String tts) { + this.tts = tts; + } + + public String getVideoUrl() { + return videoUrl; + } + + public void setVideoUrl(String videoUrl) { + this.videoUrl = videoUrl; + } + + public String getVideoSn() { + return videoSn; + } + + public void setVideoSn(String videoSn) { + this.videoSn = videoSn; + } + + public String getVideoChannel() { + return videoChannel; + } + + public void setVideoChannel(String videoChannel) { + this.videoChannel = videoChannel; + } + + public int getExpireTime() { + return expireTime; + } + + public void setExpireTime(int expireTime) { + this.expireTime = expireTime; + } + + public int getZoomScale() { + return zoomScale; + } + + public void setZoomScale(int zoomScale) { + this.zoomScale = zoomScale; + } + + + public double getLat() { + return lat; + } + + public void setLat(double lat) { + this.lat = lat; + } + + public double getLon() { + return lon; + } + + public void setLon(double lon) { + this.lon = lon; + } + + public String getSn() { + return sn; + } + + public void setSn(String sn) { + this.sn = sn; + } + + public String getHeadImgUrl() { + return headImgUrl; + } + + public void setHeadImgUrl(String headImgUrl) { + this.headImgUrl = headImgUrl; + } + + public String getMsgImgUrl() { + return msgImgUrl; + } + + public void setMsgImgUrl(String msgImgUrl) { + this.msgImgUrl = msgImgUrl; + } + + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + public double getDistance() { + return distance; + } + + public void setDistance(double distance) { + this.distance = distance; + } + + public boolean isShowWindow() { + return isShowWindow; + } + + public void setShowWindow(boolean showWindow) { + isShowWindow = showWindow; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + V2XPushMessageEntity that = (V2XPushMessageEntity) o; + return Objects.equals(sceneId, that.sceneId) && + Objects.equals(tts, that.tts); + } + + @Override + public int hashCode() { + return Objects.hash(sceneId, tts); + } + + @Override + public String toString() { + return "V2XPushMessageEntity{" + + "viewType=" + viewType + + ", sceneId='" + sceneId + '\'' + + ", sceneName='" + sceneName + '\'' + + ", sceneCategory=" + sceneCategory + + ", sceneLevel=" + sceneLevel + + ", sceneDescription='" + sceneDescription + '\'' + + ", zoom=" + zoom + + ", zoomScale=" + zoomScale + + ", alarmContent='" + alarmContent + '\'' + + ", tts='" + tts + '\'' + + ", videoUrl='" + videoUrl + '\'' + + ", videoSn='" + videoSn + '\'' + + ", videoChannel='" + videoChannel + '\'' + + ", expireTime=" + expireTime + + ", lat=" + lat + + ", lon=" + lon + + ", sn='" + sn + '\'' + + ", headImgUrl='" + headImgUrl + '\'' + + ", msgImgUrl='" + msgImgUrl + '\'' + + ", address='" + address + '\'' + + ", distance=" + distance + + ", isShowWindow=" + isShowWindow + + '}'; + } +} diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XRoadEventEntity.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XRoadEventEntity.java new file mode 100644 index 0000000000..2546f5bebf --- /dev/null +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XRoadEventEntity.java @@ -0,0 +1,298 @@ +package com.mogo.module.common.entity; + +import android.text.TextUtils; + +import java.io.Serializable; +import java.util.Objects; + +/** + * author : donghongyu + * e-mail : 1358506549@qq.com + * date : 2020/4/13 11:17 AM + * desc : 道路事件的聚合,位置、详情,用于V2X情况下展示 + * version: 1.0 + */ +public class V2XRoadEventEntity implements Serializable { + /** + * @see MarkerPoiTypeEnum + */ + // 事件类型 + private String poiType; + // 事件位置 + private MarkerLocation location; + // 具体的信息 + private MarkerExploreWay noveltyInfo; + // tts 提示 + private String tts; + // ADAS 展示文案 + private String alarmContent; + // 距离当前车辆的距离 + private double distance; + // 默认展示时间 + private int expireTime; + // 展示Button + private boolean isShowEventButton; + // 绑定 MarkerView 的数据, 业务需要啥数据就传入啥数据 + private Object bindObj; + + public MarkerLocation getLocation() { + return location; + } + + public void setLocation(MarkerLocation location) { + this.location = location; + } + + public String getPoiType() { + if (TextUtils.isEmpty(poiType)) { + return ""; + } + return poiType; + } + + public void setPoiType(String poiType) { + this.poiType = poiType; + } + + public String getTts(boolean haveLiveCar) { + tts = "前方#" + (int) getDistance() + "米#"; + switch (getPoiType()) { + // 停车场 + case V2XPoiTypeEnum.FOURS_PARKING: + tts += "停车场"; + break; + // 加油站 + case V2XPoiTypeEnum.GAS_STATION: + tts += "加油站"; + break; + // 交通检查 + case V2XPoiTypeEnum.TRAFFIC_CHECK: + tts += "交通检查"; + break; + // 封路 + case V2XPoiTypeEnum.ROAD_CLOSED: + tts += "道路封路"; + break; + // 施工 + case V2XPoiTypeEnum.FOURS_ROAD_WORK: + tts += "道路施工"; + break; + // 拥堵 + case V2XPoiTypeEnum.FOURS_BLOCK_UP: + tts += "道路拥堵"; + break; + // 积水 + case V2XPoiTypeEnum.FOURS_PONDING: + tts += "道路积水"; + break; + // 浓雾 + case V2XPoiTypeEnum.FOURS_FOG: + tts += "出现浓雾"; + break; + // 结冰 + case V2XPoiTypeEnum.FOURS_ICE: + tts += "路面结冰"; + break; + // 事故 + case V2XPoiTypeEnum.FOURS_ACCIDENT: + tts += "交通事故"; + break; + default: + tts += "道路事件"; + break; + } + if (haveLiveCar) { + tts += ",查看实况请说确定。"; + setShowEventButton(true); + } else { + tts += ",请注意躲避。"; + setShowEventButton(false); + } + return tts; + } + + /** + * 检测到附近#道路施工#,确认该信息是否正确?您可以说“正确”或“错误”帮助其他车友。 + */ + public String getTtsWithFeedback() { + tts = "检测到附近"; + switch (getPoiType()) { + // 停车场 + case V2XPoiTypeEnum.FOURS_PARKING: + tts += "有停车场"; + break; + // 加油站 + case V2XPoiTypeEnum.GAS_STATION: + tts += "有加油站"; + break; + // 交通检查 + case V2XPoiTypeEnum.TRAFFIC_CHECK: + tts += "交通检查"; + break; + // 封路 + case V2XPoiTypeEnum.ROAD_CLOSED: + tts += "封路"; + break; + // 施工 + case V2XPoiTypeEnum.FOURS_ROAD_WORK: + tts += "施工"; + break; + // 拥堵 + case V2XPoiTypeEnum.FOURS_BLOCK_UP: + tts += "道路拥堵"; + break; + // 积水 + case V2XPoiTypeEnum.FOURS_PONDING: + tts += "道路积水"; + break; + // 浓雾 + case V2XPoiTypeEnum.FOURS_FOG: + tts += "出现浓雾"; + break; + // 结冰 + case V2XPoiTypeEnum.FOURS_ICE: + tts += "路面结冰"; + break; + // 事故 + case V2XPoiTypeEnum.FOURS_ACCIDENT: + tts += "交通事故"; + break; + default: + tts += "道路事件"; + break; + } + tts += ",确认该信息是否正确?您可以说“正确”或“错误”帮助其他车友。"; + return tts; + } + + public String getTts() { + return tts; + } + + public void setTts(String tts) { + this.tts = tts; + } + + public boolean isShowEventButton() { + return isShowEventButton; + } + + public void setShowEventButton(boolean showEventButton) { + isShowEventButton = showEventButton; + } + + public String getAlarmContent() { + switch (getPoiType()) { + // 停车场 + case V2XPoiTypeEnum.FOURS_PARKING: + alarmContent = "停车场附近"; + break; + // 加油站 + case V2XPoiTypeEnum.GAS_STATION: + alarmContent = "加油站附近"; + break; + // 交通检查 + case V2XPoiTypeEnum.TRAFFIC_CHECK: + alarmContent = "前方交通检查"; + break; + // 封路 + case V2XPoiTypeEnum.ROAD_CLOSED: + alarmContent = "前方封路"; + break; + // 施工 + case V2XPoiTypeEnum.FOURS_ROAD_WORK: + alarmContent = "前方施工"; + break; + // 拥堵 + case V2XPoiTypeEnum.FOURS_BLOCK_UP: + alarmContent = "前方道路拥堵"; + break; + // 积水 + case V2XPoiTypeEnum.FOURS_PONDING: + alarmContent = "前方道路积水"; + break; + // 浓雾 + case V2XPoiTypeEnum.FOURS_FOG: + alarmContent = "前方出现浓雾"; + break; + // 结冰 + case V2XPoiTypeEnum.FOURS_ICE: + alarmContent = "前方路面结冰"; + break; + // 事故 + case V2XPoiTypeEnum.FOURS_ACCIDENT: + alarmContent = "前方交通事故"; + break; + default: + tts += "道路事件"; + break; + } + return alarmContent; + } + + public void setAlarmContent(String alarmContent) { + this.alarmContent = alarmContent; + } + + public double getDistance() { + return distance; + } + + public void setDistance(double distance) { + this.distance = distance; + } + + public int getExpireTime() { + return expireTime; + } + + public void setExpireTime(int expireTime) { + this.expireTime = expireTime; + } + + public MarkerExploreWay getNoveltyInfo() { + return noveltyInfo; + } + + public void setNoveltyInfo(MarkerExploreWay noveltyInfo) { + this.noveltyInfo = noveltyInfo; + } + + public Object getBindObj() { + return bindObj; + } + + public void setBindObj(Object bindObj) { + this.bindObj = bindObj; + } + + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + V2XRoadEventEntity that = (V2XRoadEventEntity) o; + return Objects.equals(noveltyInfo.getInfoId(), that.noveltyInfo.getInfoId()) && + Objects.equals(poiType, that.poiType); + } + + @Override + public int hashCode() { + return Objects.hash(poiType, noveltyInfo.getInfoId()); + } + + @Override + public String toString() { + return "V2XRoadEventEntity{" + + "poiType='" + poiType + '\'' + + ", location=" + location + + ", noveltyInfo=" + noveltyInfo + + ", tts='" + tts + '\'' + + ", alarmContent='" + alarmContent + '\'' + + ", distance=" + distance + + ", expireTime=" + expireTime + + ", isShowEventButton=" + isShowEventButton + + ", bindObj=" + bindObj + + '}'; + } +} diff --git a/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XWindowTypeEnum.java b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XWindowTypeEnum.java new file mode 100644 index 0000000000..f8ed519770 --- /dev/null +++ b/modules/mogo-module-common/src/main/java/com/mogo/module/common/entity/V2XWindowTypeEnum.java @@ -0,0 +1,27 @@ +package com.mogo.module.common.entity; + +/** + * author : donghongyu + * e-mail : 1358506549@qq.com + * date : 2020/3/31 4:53 PM + * desc : V2X 道路提醒类型 + * version: 1.0 + */ +public interface V2XWindowTypeEnum { + // 默认展示详情 + int DEFAULT_WINDOW = 0; + // 直播 + int LIVE_CAR_WINDOW = 1; + // 道路事件详情 + int ROAD_EVENT_WINDOW = 2; + // 推送事件详情 + int PUSH_EVENT_WINDOW = 3; + // 演示动画场景 + int ANIMATION_WINDOW = 4; + // 疲劳驾驶 + int FATIGUE_DRIVING_WINDOW = 5; + // 他人故障求助 + int SEEK_HELP_WINDOW = 6; + // 违章停车 + int ILLEGAL_PARK_WINDOW = 7; +}