[清扫车]运营任务相关接口和实体类添加
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
package com.mogo.och.sweeper.bean;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
|
||||
public class BaseResponse<T> extends BaseData {
|
||||
private T data;
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
}
|
||||
|
||||
public void setMsg(String msg) {
|
||||
this.msg = msg;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(T data) {
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.mogo.och.sweeper.bean
|
||||
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
|
||||
data class SubStartRequest(
|
||||
var carSn:String=MoGoAiCloudClientConfig.getInstance().sn,
|
||||
var taskId:Int,
|
||||
var startTime:Long
|
||||
)
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.mogo.och.sweeper.bean
|
||||
|
||||
/**
|
||||
*
|
||||
* 清扫车任务信息
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
data class SweeperMainTaskBean(
|
||||
var mainTaskId:Int = 0,
|
||||
var mainTaskName: String? = null,
|
||||
var subTaskTotal:Int = 0,
|
||||
var mainTaskStartTime: Long = 0
|
||||
)
|
||||
@@ -1,69 +0,0 @@
|
||||
package com.mogo.och.sweeper.bean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 网约车小巴路线接口返回接口数据封装
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class SweeperRoutesResult {
|
||||
private List<SweeperTaskBean> sites;
|
||||
private int lineId;
|
||||
private String name;
|
||||
private int lineType; //线路类型,0:环形
|
||||
private String description;
|
||||
private int status;
|
||||
|
||||
//线路轨迹相关字段
|
||||
public String csvFileUrl = ""; //轨迹文件下载的cos url,默认“”
|
||||
public String csvFileMd5 = ""; //轨迹文件md5,默认“”
|
||||
public String txtFileUrl = ""; //打点文件下载的cos url,默认“”
|
||||
public String txtFileMd5 = ""; //轨迹文件md5,默认“”
|
||||
public long contrailSaveTime; //上传轨迹完成时间戳ms:用于MEC本地手动导入轨迹验证时不会被云端轨迹覆盖
|
||||
public String carModel = ""; //[optional] 车型号(如红旗H9),默认“”,暂不加入校验逻辑、用于人工排查问题
|
||||
public String csvFileUrlDPQP = ""; //轨迹文件下载的cos url,默认“”
|
||||
public String csvFileMd5DPQP = ""; //轨迹文件md5,默认“”
|
||||
public String txtFileUrlDPQP = ""; //打点文件下载的cos url,默认“”
|
||||
public String txtFileMd5DPQP = ""; //轨迹文件md5,默认“”
|
||||
public long contrailSaveTimeDPQP; //上传轨迹完成时间戳ms:用于MEC本地手动导入轨迹验证时不会被云端轨迹覆盖
|
||||
|
||||
public int getLineId() {
|
||||
return lineId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public List<SweeperTaskBean> getSites() {
|
||||
return sites;
|
||||
}
|
||||
|
||||
public void setSite(List<SweeperTaskBean> site) {
|
||||
this.sites = sites;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BusRoutesResult{" +
|
||||
"sites=" + sites +
|
||||
", lineId=" + lineId +
|
||||
", name='" + name + '\'' +
|
||||
", lineType=" + lineType +
|
||||
", description='" + description + '\'' +
|
||||
", status=" + status +
|
||||
", csvFileUrl='" + csvFileUrl + '\'' +
|
||||
", csvFileMd5='" + csvFileMd5 + '\'' +
|
||||
", txtFileUrl='" + txtFileUrl + '\'' +
|
||||
", txtFileMd5='" + txtFileMd5 + '\'' +
|
||||
", contrailSaveTime=" + contrailSaveTime +
|
||||
", carModel='" + carModel + '\'' +
|
||||
", csvFileUrlDPQP='" + csvFileUrlDPQP + '\'' +
|
||||
", csvFileMd5DPQP='" + csvFileMd5DPQP + '\'' +
|
||||
", txtFileUrlDPQP='" + txtFileUrlDPQP + '\'' +
|
||||
", txtFileMd5DPQP='" + txtFileMd5DPQP + '\'' +
|
||||
", contrailSaveTimeDPQP=" + contrailSaveTimeDPQP +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.mogo.och.sweeper.bean
|
||||
|
||||
/**
|
||||
* 子任务信息
|
||||
*/
|
||||
data class SweeperSubTaskBean(var taskId:Int?,
|
||||
var taskName:String?,
|
||||
var taskStartTime:Long?,
|
||||
var subList:MutableList<SubInfo>?)
|
||||
data class SubInfo(
|
||||
var taskId: Int = 0,
|
||||
var taskName: String?,
|
||||
var mileage: Int = 0,
|
||||
var taskStatus: Int,// 状态1未执行 2执行中 3结束 4跳过
|
||||
var taskType: Int,//1自动驾驶 2人工驾驶
|
||||
var timeSpent: Long = 0,
|
||||
var sort: Int = 0,
|
||||
)
|
||||
@@ -0,0 +1,301 @@
|
||||
package com.mogo.och.sweeper.bean;
|
||||
|
||||
public class SweeperSubTaskDetailBean {
|
||||
private int id; //子任务id
|
||||
private int lineId; //线路id
|
||||
private String lineName;//线路名称
|
||||
private int sort;
|
||||
private int status;
|
||||
private String startSiteId; //子任务起点id
|
||||
private String startSiteName; //子任务起点名称
|
||||
private double startSiteLon; //子任务起点高德经度
|
||||
private double startSiteLat; //子任务起点高德纬度
|
||||
private double startSiteWgs64Lon;//子任务起点高精经度
|
||||
private double startSiteWgs64Lat;//子任务起点高精纬度
|
||||
private String endSiteId;//子任务终点id
|
||||
private String endSiteName;//子任务终点名称
|
||||
private double endSiteLon; //子任务终点高德经度
|
||||
private double endSiteLat;//子任务终点高德纬度
|
||||
private double endSiteWgs64Lon;//子任务终点高精经度
|
||||
private double endSiteWgs64Lat;//子任务终点高精纬度
|
||||
private String brand; //品牌
|
||||
private String carModel; //车辆型号
|
||||
private String csvFileUrl = ""; //轨迹文件csv文件url地址
|
||||
private String csvFileMd5 = ""; //轨迹文件csv md5
|
||||
private String csvFileName = "";//轨迹文件cvs名称
|
||||
private String txtFileUrl = ""; //轨迹文件txt url地址
|
||||
private String txtFileMd5 = ""; //轨迹文件txt md5
|
||||
private String txtFileName; //轨迹文件txt名称
|
||||
private long contrailSaveTime;
|
||||
private String contrailFileType; //轨迹文件类型
|
||||
private String publishStatus;//发布状态 1发布 2未发布 3 发布中
|
||||
private String csvFileUrlDPQP = ""; //轨迹文件下载的cos url,默认“”
|
||||
private String csvFileMd5DPQP = ""; //轨迹文件md5,默认“”
|
||||
private String txtFileUrlDPQP = ""; //打点文件下载的cos url,默认“”
|
||||
private String txtFileMd5DPQP = ""; //轨迹文件md5,默认“”
|
||||
private long contrailSaveTimeDPQP; //上传轨迹完成时间戳ms:用于MEC本地手动导入轨迹验证时不会被云端轨迹覆盖
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public int getLineId() {
|
||||
return lineId;
|
||||
}
|
||||
|
||||
public void setLineId(int lineId) {
|
||||
this.lineId = lineId;
|
||||
}
|
||||
|
||||
public String getLineName() {
|
||||
return lineName;
|
||||
}
|
||||
|
||||
public void setLineName(String lineName) {
|
||||
this.lineName = lineName;
|
||||
}
|
||||
|
||||
public int getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public void setSort(int sort) {
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStartSiteId() {
|
||||
return startSiteId;
|
||||
}
|
||||
|
||||
public void setStartSiteId(String startSiteId) {
|
||||
this.startSiteId = startSiteId;
|
||||
}
|
||||
|
||||
public String getStartSiteName() {
|
||||
return startSiteName;
|
||||
}
|
||||
|
||||
public void setStartSiteName(String startSiteName) {
|
||||
this.startSiteName = startSiteName;
|
||||
}
|
||||
|
||||
public double getStartSiteLon() {
|
||||
return startSiteLon;
|
||||
}
|
||||
|
||||
public void setStartSiteLon(double startSiteLon) {
|
||||
this.startSiteLon = startSiteLon;
|
||||
}
|
||||
|
||||
public double getStartSiteLat() {
|
||||
return startSiteLat;
|
||||
}
|
||||
|
||||
public void setStartSiteLat(double startSiteLat) {
|
||||
this.startSiteLat = startSiteLat;
|
||||
}
|
||||
|
||||
public double getStartSiteWgs64Lon() {
|
||||
return startSiteWgs64Lon;
|
||||
}
|
||||
|
||||
public void setStartSiteWgs64Lon(double startSiteWgs64Lon) {
|
||||
this.startSiteWgs64Lon = startSiteWgs64Lon;
|
||||
}
|
||||
|
||||
public double getStartSiteWgs64Lat() {
|
||||
return startSiteWgs64Lat;
|
||||
}
|
||||
|
||||
public void setStartSiteWgs64Lat(double startSiteWgs64Lat) {
|
||||
this.startSiteWgs64Lat = startSiteWgs64Lat;
|
||||
}
|
||||
|
||||
public String getEndSiteId() {
|
||||
return endSiteId;
|
||||
}
|
||||
|
||||
public void setEndSiteId(String endSiteId) {
|
||||
this.endSiteId = endSiteId;
|
||||
}
|
||||
|
||||
public String getEndSiteName() {
|
||||
return endSiteName;
|
||||
}
|
||||
|
||||
public void setEndSiteName(String endSiteName) {
|
||||
this.endSiteName = endSiteName;
|
||||
}
|
||||
|
||||
public double getEndSiteLon() {
|
||||
return endSiteLon;
|
||||
}
|
||||
|
||||
public void setEndSiteLon(double endSiteLon) {
|
||||
this.endSiteLon = endSiteLon;
|
||||
}
|
||||
|
||||
public double getEndSiteLat() {
|
||||
return endSiteLat;
|
||||
}
|
||||
|
||||
public void setEndSiteLat(double endSiteLat) {
|
||||
this.endSiteLat = endSiteLat;
|
||||
}
|
||||
|
||||
public double getEndSiteWgs64Lon() {
|
||||
return endSiteWgs64Lon;
|
||||
}
|
||||
|
||||
public void setEndSiteWgs64Lon(double endSiteWgs64Lon) {
|
||||
this.endSiteWgs64Lon = endSiteWgs64Lon;
|
||||
}
|
||||
|
||||
public double getEndSiteWgs64Lat() {
|
||||
return endSiteWgs64Lat;
|
||||
}
|
||||
|
||||
public void setEndSiteWgs64Lat(double endSiteWgs64Lat) {
|
||||
this.endSiteWgs64Lat = endSiteWgs64Lat;
|
||||
}
|
||||
|
||||
public String getBrand() {
|
||||
return brand;
|
||||
}
|
||||
|
||||
public void setBrand(String brand) {
|
||||
this.brand = brand;
|
||||
}
|
||||
|
||||
public String getCarModel() {
|
||||
return carModel;
|
||||
}
|
||||
|
||||
public void setCarModel(String carModel) {
|
||||
this.carModel = carModel;
|
||||
}
|
||||
|
||||
public String getCsvFileUrl() {
|
||||
return csvFileUrl;
|
||||
}
|
||||
|
||||
public void setCsvFileUrl(String csvFileUrl) {
|
||||
this.csvFileUrl = csvFileUrl;
|
||||
}
|
||||
|
||||
public String getCsvFileMd5() {
|
||||
return csvFileMd5;
|
||||
}
|
||||
|
||||
public void setCsvFileMd5(String csvFileMd5) {
|
||||
this.csvFileMd5 = csvFileMd5;
|
||||
}
|
||||
|
||||
public String getCsvFileName() {
|
||||
return csvFileName;
|
||||
}
|
||||
|
||||
public void setCsvFileName(String csvFileName) {
|
||||
this.csvFileName = csvFileName;
|
||||
}
|
||||
|
||||
public String getTxtFileUrl() {
|
||||
return txtFileUrl;
|
||||
}
|
||||
|
||||
public void setTxtFileUrl(String txtFileUrl) {
|
||||
this.txtFileUrl = txtFileUrl;
|
||||
}
|
||||
|
||||
public String getTxtFileMd5() {
|
||||
return txtFileMd5;
|
||||
}
|
||||
|
||||
public void setTxtFileMd5(String txtFileMd5) {
|
||||
this.txtFileMd5 = txtFileMd5;
|
||||
}
|
||||
|
||||
public String getTxtFileName() {
|
||||
return txtFileName;
|
||||
}
|
||||
|
||||
public void setTxtFileName(String txtFileName) {
|
||||
this.txtFileName = txtFileName;
|
||||
}
|
||||
|
||||
public String getContrailFileType() {
|
||||
return contrailFileType;
|
||||
}
|
||||
|
||||
public void setContrailFileType(String contrailFileType) {
|
||||
this.contrailFileType = contrailFileType;
|
||||
}
|
||||
|
||||
public String getPublishStatus() {
|
||||
return publishStatus;
|
||||
}
|
||||
|
||||
public void setPublishStatus(String publishStatus) {
|
||||
this.publishStatus = publishStatus;
|
||||
}
|
||||
|
||||
public long getContrailSaveTime() {
|
||||
return contrailSaveTime;
|
||||
}
|
||||
|
||||
public void setContrailSaveTime(long contrailSaveTime) {
|
||||
this.contrailSaveTime = contrailSaveTime;
|
||||
}
|
||||
|
||||
public String getCsvFileUrlDPQP() {
|
||||
return csvFileUrlDPQP;
|
||||
}
|
||||
|
||||
public void setCsvFileUrlDPQP(String csvFileUrlDPQP) {
|
||||
this.csvFileUrlDPQP = csvFileUrlDPQP;
|
||||
}
|
||||
|
||||
public String getCsvFileMd5DPQP() {
|
||||
return csvFileMd5DPQP;
|
||||
}
|
||||
|
||||
public void setCsvFileMd5DPQP(String csvFileMd5DPQP) {
|
||||
this.csvFileMd5DPQP = csvFileMd5DPQP;
|
||||
}
|
||||
|
||||
public String getTxtFileUrlDPQP() {
|
||||
return txtFileUrlDPQP;
|
||||
}
|
||||
|
||||
public void setTxtFileUrlDPQP(String txtFileUrlDPQP) {
|
||||
this.txtFileUrlDPQP = txtFileUrlDPQP;
|
||||
}
|
||||
|
||||
public String getTxtFileMd5DPQP() {
|
||||
return txtFileMd5DPQP;
|
||||
}
|
||||
|
||||
public void setTxtFileMd5DPQP(String txtFileMd5DPQP) {
|
||||
this.txtFileMd5DPQP = txtFileMd5DPQP;
|
||||
}
|
||||
|
||||
public long getContrailSaveTimeDPQP() {
|
||||
return contrailSaveTimeDPQP;
|
||||
}
|
||||
|
||||
public void setContrailSaveTimeDPQP(long contrailSaveTimeDPQP) {
|
||||
this.contrailSaveTimeDPQP = contrailSaveTimeDPQP;
|
||||
}
|
||||
}
|
||||
@@ -1,162 +0,0 @@
|
||||
package com.mogo.och.sweeper.bean;
|
||||
|
||||
/**
|
||||
* 单个网约车小巴车站信息
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class SweeperTaskBean {
|
||||
// private int lineId;
|
||||
// private int siteId;
|
||||
// private String siteName;
|
||||
// private String cityCode;
|
||||
// private String areaCode;
|
||||
// private String areaName;
|
||||
// private double lat;
|
||||
// private double lon;
|
||||
// private String siteDesc;
|
||||
// private int siteState;
|
||||
// private int isCurrentSite;// @see OchBusConst 是否是当前站 1:是 2:下一站 0:普通站
|
||||
// private int siteColor;
|
||||
// private String peoples;
|
||||
// private int ifStop; // 是否需要停靠、1需要、0不需要
|
||||
|
||||
|
||||
private String name;
|
||||
private String description;
|
||||
private String cityCode;
|
||||
private double lon; //高精坐标
|
||||
private double lat; //高精坐标
|
||||
private int businessType; //站点类型,9:taxi,10:bus
|
||||
private double gcjLon; //高德
|
||||
private double gcjLat; //高德
|
||||
private int status;
|
||||
private int siteId;
|
||||
private int seq;
|
||||
private int drivingStatus;//行驶信息,0初始值;1已经过;2当前站;3未到站
|
||||
private int ifStop = 1; // 是否需要停靠、1需要、0不需要 // TODO: 2021/10/19 原来站点里有设计是否需要停靠字段,现设计暂无,默认都需要停靠
|
||||
private boolean leaving;
|
||||
|
||||
public double getGcjLon() {
|
||||
return gcjLon;
|
||||
}
|
||||
|
||||
public double getGcjLat() {
|
||||
return gcjLat;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public void setCityCode(String cityCode) {
|
||||
this.cityCode = cityCode;
|
||||
}
|
||||
|
||||
public void setLon(double lon) {
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
public void setLat(double lat) {
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public void setBusinessType(int businessType) {
|
||||
this.businessType = businessType;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public void setSiteId(int siteId) {
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public void setSeq(int seq) {
|
||||
this.seq = seq;
|
||||
}
|
||||
|
||||
public void setDrivingStatus(int drivingStatus) {
|
||||
this.drivingStatus = drivingStatus;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public String getCityCode() {
|
||||
return cityCode;
|
||||
}
|
||||
|
||||
|
||||
public int getBusinessType() {
|
||||
return businessType;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public int getSiteId() {
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public int getSeq() {
|
||||
return seq;
|
||||
}
|
||||
|
||||
public int getDrivingStatus() {
|
||||
return drivingStatus;
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public double getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public void setIfStop(int ifStop) {
|
||||
this.ifStop = ifStop;
|
||||
}
|
||||
|
||||
public int getIfStop() {
|
||||
return ifStop;
|
||||
}
|
||||
|
||||
public void setLeaving(boolean leaving) {
|
||||
this.leaving = leaving;
|
||||
}
|
||||
|
||||
public boolean isLeaving() {
|
||||
return leaving;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "BusStationBean{" +
|
||||
"name='" + name + '\'' +
|
||||
", description='" + description + '\'' +
|
||||
", cityCode='" + cityCode + '\'' +
|
||||
", lon=" + lon +
|
||||
", lat=" + lat +
|
||||
", businessType=" + businessType +
|
||||
", status=" + status +
|
||||
", siteId=" + siteId +
|
||||
", seq=" + seq +
|
||||
", drivingStatus=" + drivingStatus +
|
||||
", ifStop=" + ifStop +
|
||||
", leaving=" + leaving +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
package com.mogo.och.sweeper.bean
|
||||
|
||||
data class TaskInfoBean(var taskId: Int, var taskName: String, var taskType: Int)
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.mogo.och.sweeper.callback;
|
||||
|
||||
import com.mogo.och.sweeper.bean.SweeperTaskBean;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/10/22
|
||||
*/
|
||||
public interface IRefreshSweeperTaskCallback {
|
||||
|
||||
void updateSweeperTaskStatus(String lineName, List<SweeperTaskBean> taskList, int currentTask,boolean isFinishedSubTask);
|
||||
/**
|
||||
* 结束清理一遍、选择任务后清理一遍
|
||||
*/
|
||||
void clearSweeperTasksMarkers();
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.mogo.och.sweeper.callback
|
||||
|
||||
import com.mogo.och.sweeper.bean.SweeperMainTaskBean
|
||||
import com.mogo.och.sweeper.bean.SweeperSubTaskBean
|
||||
import com.mogo.och.sweeper.constant.TaskStatusEnum
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/10/22
|
||||
*/
|
||||
interface ISweeperTaskCallback {
|
||||
/**
|
||||
* 获取主任务列表
|
||||
*/
|
||||
fun setMainTaskList(mainTaskBeanList: MutableList<SweeperMainTaskBean>?)
|
||||
|
||||
/**
|
||||
* 获取子任务列表
|
||||
*/
|
||||
fun setSubTaskBean(subTaskBean: SweeperSubTaskBean?)
|
||||
|
||||
/**
|
||||
* 更新子任务状态
|
||||
*/
|
||||
fun updateSubTaskStatus(typeEnum: TaskStatusEnum, isLastSubTask: Boolean)
|
||||
|
||||
/**
|
||||
* 主任务重置
|
||||
*/
|
||||
fun setMainTaskReset(isSuccess: Boolean)
|
||||
|
||||
/**
|
||||
* 空数据展示
|
||||
* @param type
|
||||
*/
|
||||
fun emptyDataUI(type: Int)
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.mogo.och.sweeper.constant
|
||||
|
||||
/**
|
||||
* 任务类型
|
||||
*/
|
||||
enum class SubTaskTypeEnum(val code: Int) {
|
||||
AUTOPILOT_SUBTYPE(1),//自动驾驶子任务
|
||||
MANUAL_DRIVING_SUBTYPE(2),//人工驾驶
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package com.mogo.och.sweeper.constant
|
||||
|
||||
/**
|
||||
* 当前任务操作菜单
|
||||
*/
|
||||
enum class TaskMenuTypeEnum(val code: Int) {
|
||||
JUMP_OVER_TASK( 1),//跳过任务
|
||||
END_TASK( 2),//结束任务
|
||||
CANCEL_TASK( 3);//取消
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.mogo.och.sweeper.constant
|
||||
|
||||
/**
|
||||
* 当前任务操作菜单
|
||||
*/
|
||||
enum class TaskStatusEnum(val code: Int) {
|
||||
JUMP_OVER_SUBTASK( 1),//跳过子任务
|
||||
END_TASK( 2),//结束主任务
|
||||
CANCEL_TASK( 3),//取消
|
||||
START_SUBTASK(4),//开始子任务
|
||||
END_SUBTASK(4),//结束子任务
|
||||
}
|
||||
@@ -1,19 +1,105 @@
|
||||
package com.mogo.och.sweeper.net;
|
||||
import com.mogo.och.sweeper.bean.BaseResponse;
|
||||
import com.mogo.och.sweeper.bean.SubInfo;
|
||||
import com.mogo.och.sweeper.bean.SubStartRequest;
|
||||
import com.mogo.och.sweeper.bean.SweeperSubTaskBean;
|
||||
import com.mogo.och.sweeper.bean.SweeperMainTaskBean;
|
||||
import com.mogo.och.sweeper.bean.SweeperSubTaskDetailBean;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.och.sweeper.bean.SweeperRoutePlanningUpdateReqBean;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.Body;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.Header;
|
||||
import retrofit2.http.Headers;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
/**
|
||||
* 清扫车相关接口
|
||||
*/
|
||||
public interface ISweeperApiService {
|
||||
/**
|
||||
* 获取当前正在执行的任务
|
||||
* @param appId
|
||||
* @param ticket
|
||||
* @param carSn
|
||||
* @return
|
||||
*/
|
||||
@GET("/och-sweep/api/task/v1/currentTask")
|
||||
Observable<BaseResponse<SweeperSubTaskBean>> getCurrentTask(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("carSn") String carSn);
|
||||
/**
|
||||
* 清扫车任务列表
|
||||
* @param appId
|
||||
* @param ticket
|
||||
* @param carSn
|
||||
* @return
|
||||
*/
|
||||
@GET("/och-sweep/api/task/v1/mainTaskList")
|
||||
Observable<BaseResponse<List<SweeperMainTaskBean>>> getMainTaskList(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("carSn") String carSn);
|
||||
|
||||
/**
|
||||
* 清扫车子任务列表
|
||||
* @param appId
|
||||
* @param ticket
|
||||
* @param sn
|
||||
* @param taskId
|
||||
* @return
|
||||
*/
|
||||
@GET("/och-sweep/api/task/v1/subTaskList")
|
||||
Observable<BaseResponse<List<SubInfo>>> getSubTaskList(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("carSn") String sn, @Query("taskId") int taskId);
|
||||
|
||||
/**
|
||||
* 子任务详情 包括子任务轨迹信息
|
||||
* @param appId
|
||||
* @param ticket
|
||||
* @param carSn
|
||||
* @return
|
||||
*/
|
||||
@GET("/och-sweep/api/task/v1/subTaskInfo")
|
||||
Observable<BaseResponse<SweeperSubTaskDetailBean>> getSubTaskDetail(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("carSn") String carSn ,@Query("taskId") int taskId);
|
||||
|
||||
/**
|
||||
* 子任务开始
|
||||
* @param appId
|
||||
* @param ticket
|
||||
* @param subStartRequest
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-type:application/json;charset=UTF-8"})
|
||||
@POST("/och-sweep/api/task/v1/subTaskStart")
|
||||
Observable<BaseResponse<Boolean>> subTaskStart(@Header ("appId") String appId, @Header("ticket") String ticket, @Body SubStartRequest subStartRequest);
|
||||
|
||||
/**
|
||||
* 子任务结束
|
||||
* @param appId
|
||||
* @param ticket
|
||||
* @param subStartRequest
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-type:application/json;charset=UTF-8"})
|
||||
@POST("/och-sweep/api/task/v1/sutTaskEnd")
|
||||
Observable<BaseResponse<Boolean>> subTaskEnd(@Header ("appId") String appId, @Header("ticket") String ticket, @Body SubStartRequest subStartRequest);
|
||||
/**
|
||||
* 子任务跳过
|
||||
* @param appId
|
||||
* @param ticket
|
||||
* @param subStartRequest
|
||||
* @return
|
||||
*/
|
||||
@Headers({"Content-type:application/json;charset=UTF-8"})
|
||||
@POST("/och-sweep/api/task/v1/subTaskSkip")
|
||||
Observable<BaseResponse<Boolean>> subTaskSkip(@Header ("appId") String appId, @Header("ticket") String ticket, @Body SubStartRequest subStartRequest);
|
||||
|
||||
/**
|
||||
* 主任务重置
|
||||
* @param appId
|
||||
* @param ticket
|
||||
* @param taskId
|
||||
* @return
|
||||
*/
|
||||
@GET("/och-sweep/api/task/v1/mainTaskReset")
|
||||
Observable<BaseResponse<Boolean>> mainTaskReset(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("taskId") int taskId);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.mogo.och.sweeper.net;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/10/20
|
||||
*/
|
||||
public interface ISweeperServiceCallback< T >{
|
||||
void onSuccess(T o);
|
||||
|
||||
void onFail(String failMsg);
|
||||
|
||||
default void onError() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
package com.mogo.och.sweeper.net;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory;
|
||||
import com.mogo.eagle.core.network.RequestOptions;
|
||||
import com.mogo.eagle.core.network.SubscribeImpl;
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
|
||||
import com.mogo.och.sweeper.constant.SweeperConst;
|
||||
|
||||
import static com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.M_BUS;
|
||||
|
||||
/**
|
||||
* @author: wangmingjun
|
||||
* @date: 2021/10/20
|
||||
*/
|
||||
public class SweeperServiceManager {
|
||||
|
||||
private static final String TAG = SweeperServiceManager.class.getSimpleName();
|
||||
|
||||
private final ISweeperApiService mService;
|
||||
|
||||
private static final class SingletonHolder {
|
||||
private static final SweeperServiceManager INSTANCE = new SweeperServiceManager();
|
||||
}
|
||||
|
||||
public static SweeperServiceManager getInstance(){
|
||||
return SingletonHolder.INSTANCE;
|
||||
}
|
||||
|
||||
private SweeperServiceManager(){
|
||||
mService = MoGoRetrofitFactory.getInstance(SweeperConst.getBaseUrl()).create(ISweeperApiService.class);
|
||||
}
|
||||
private <T extends BaseData> SubscribeImpl getSubscribeImpl(Context context, ISweeperServiceCallback<T> callback, String apiName){
|
||||
return new SubscribeImpl<T>(RequestOptions.create(context)){
|
||||
@Override
|
||||
public void onSuccess(T o) {
|
||||
super.onSuccess(o);
|
||||
CallerLogger.INSTANCE.e(M_BUS + TAG,apiName + ": onSuccess() " + o.msg);
|
||||
if (callback != null) {
|
||||
callback.onSuccess(o);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String message, int code) {
|
||||
super.onError(message, code);
|
||||
CallerLogger.INSTANCE.e(M_BUS + TAG,apiName + ": onError() " +"msg="+ message+" code="+code);
|
||||
if (callback != null) {
|
||||
callback.onFail("msg="+ message+" code="+code);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(Throwable e) {
|
||||
super.onError(e);
|
||||
CallerLogger.INSTANCE.e(M_BUS + TAG,apiName + ": onError() " +" e="+e.getMessage());
|
||||
if (callback != null) {
|
||||
callback.onFail(e.getMessage());
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,133 @@
|
||||
package com.mogo.och.sweeper.net
|
||||
|
||||
import android.content.Context
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
|
||||
import com.mogo.eagle.core.network.MoGoRetrofitFactory
|
||||
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
|
||||
import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl
|
||||
import com.mogo.och.common.module.biz.network.interceptor.transformTry
|
||||
import com.mogo.och.sweeper.bean.*
|
||||
import com.mogo.och.sweeper.constant.SweeperConst.Companion.getBaseUrl
|
||||
|
||||
object SweeperServiceManager {
|
||||
private val mService: ISweeperApiService = MoGoRetrofitFactory.getInstance(getBaseUrl()).create(
|
||||
ISweeperApiService::class.java
|
||||
)
|
||||
|
||||
/**
|
||||
* 获取当前正在执行的任务
|
||||
*/
|
||||
@JvmStatic
|
||||
fun getCurrentTask(context: Context, callback: OchCommonServiceCallback<BaseResponse<SweeperSubTaskBean>>?) {
|
||||
mService.getCurrentTask(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
MoGoAiCloudClientConfig.getInstance().sn
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "getCurrentTask"))
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取主任务列表
|
||||
*/
|
||||
@JvmStatic
|
||||
fun getMainTaskList(context: Context, callback: OchCommonServiceCallback<BaseResponse<MutableList<SweeperMainTaskBean>>>?) {
|
||||
mService.getMainTaskList(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
MoGoAiCloudClientConfig.getInstance().sn
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "getMainTaskList"))
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取子任务列表
|
||||
*/
|
||||
@JvmStatic
|
||||
fun getSubTaskList(taskId: Int, context: Context, callback: OchCommonServiceCallback<BaseResponse<MutableList<SubInfo>>>?) {
|
||||
mService.getSubTaskList(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
MoGoAiCloudClientConfig.getInstance().sn,
|
||||
taskId
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "getSubTaskList"))
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取子任务详情包括轨迹文件信息
|
||||
*/
|
||||
@JvmStatic
|
||||
fun getSubTaskDetail(subTaskId: Int, context: Context, callback: OchCommonServiceCallback<BaseResponse<SweeperSubTaskDetailBean>>?) {
|
||||
mService.getSubTaskDetail(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
MoGoAiCloudClientConfig.getInstance().sn,
|
||||
subTaskId
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "getSubTaskList"))
|
||||
}
|
||||
|
||||
/**
|
||||
* 子任务开始上报
|
||||
*/
|
||||
@JvmStatic
|
||||
fun subTaskStart(subTaskId: Int,context: Context, callback: OchCommonServiceCallback<BaseResponse<Boolean>>?) {
|
||||
val subStartRequest = SubStartRequest(MoGoAiCloudClientConfig.getInstance().sn, subTaskId, System.currentTimeMillis())
|
||||
mService.subTaskStart(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
subStartRequest
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "subTaskStart"))
|
||||
}
|
||||
|
||||
/**
|
||||
* 子任务结束上报
|
||||
*/
|
||||
@JvmStatic
|
||||
fun subTaskEnd(subTaskId: Int,context: Context, callback: OchCommonServiceCallback<BaseResponse<Boolean>>?) {
|
||||
val subStartRequest = SubStartRequest(MoGoAiCloudClientConfig.getInstance().sn, subTaskId, System.currentTimeMillis())
|
||||
mService.subTaskEnd(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
subStartRequest
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "subTaskEnd"))
|
||||
}
|
||||
|
||||
/**
|
||||
* 子任务跳过上报
|
||||
*/
|
||||
@JvmStatic
|
||||
fun subTaskSkip(subTaskId: Int,context: Context, callback: OchCommonServiceCallback<BaseResponse<Boolean>>?) {
|
||||
val subStartRequest = SubStartRequest(MoGoAiCloudClientConfig.getInstance().sn, subTaskId, System.currentTimeMillis())
|
||||
mService.subTaskSkip(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
subStartRequest
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "subTaskSkip"))
|
||||
}
|
||||
|
||||
/**
|
||||
* 主任务重置
|
||||
*/
|
||||
@JvmStatic
|
||||
fun mainTaskReset(taskId: Int,context: Context, callback: OchCommonServiceCallback<BaseResponse<Boolean>>?) {
|
||||
mService.mainTaskReset(
|
||||
MoGoAiCloudClientConfig.getInstance().serviceAppId,
|
||||
MoGoAiCloudClientConfig.getInstance().token,
|
||||
taskId
|
||||
)
|
||||
.transformTry()
|
||||
.subscribe(OchCommonSubscribeImpl(context, callback, "mainTaskReset"))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user