HDao_mile.ice 10.2 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420
/////////////////////////////////////////////////////////////////
// 修订记录 
//
// 版本      作者     日期            改动点
// 1.0       金克龙   2016/05/18      初稿:提供行程的里程统计功能;
// 1.1       金克龙   2017/10/31      为通过IMEI上报gps等信息的车机/后视镜提供通过IMEI查询的接口;
//////////////////////////////////////////////////////////////////
module HDaoMile
{
	/*==========================================================
	 *            Mileage Statistics
	 *==========================================================*/
	/******* common  *********/		
	struct GpsPos
	{
		int    gpsTime;				/* GPS时间戳 */
		int    lng;					/* 经度 */
		int    lat;					/* 纬度 */
		string addr;				/* 地址信息 */
	};

	/*--------------------
	   apType: also named as devType, its value defined as below:
	   2: OBD;
	   4: DDbox(DVD)
	   5: Tracker
	   6: rearMirror
	   7: car recorder
	 ---------------------*/
	 	  
	/*--------------------
	 oprResult: 
	   0: OK
	   1: reserved
	   other: operation failed
	 ---------------------*/
	
	
	/******** Start mileage statistics  *************/
	
	struct MileStatBeginRequest
	{
		long userID;
		int  apType;
		int  beginTime;				/*开始统计里程时间*/
	};
	
	struct MileStatBeginResponse
	{
		int oprResult;
	};
	
	
	/******* End mileage statistics  *********/
	struct MileStatEndRequest
	{
		long userID;
		int  apType;
		int  beginTime;						/*开始时间*/
		int  endTime;						/*结束时间*/
		bool bRetGpsTime; 					/*返回最后GPS记录时间*/
	};

	struct MileStatEndResponse
	{
		int oprResult;
		int mileage;			/* unit: meter */
		GpsPos beginPos;		/* 开始位置信息 */
		GpsPos endPos;			/* 结束位置信息*/
		float  over80Percent;   /* percentage of gpsPoints that are over speed ranging from 80km/h to 120km/h */
		float  over120Percent;  /* percentage of gpsPoints that are over speed above 120km/h */
		int    maxSpeed;        /* unit: km/h */
		int    gpsBgnTime;			/* time of the first gps record of the journey. Maybe filled if bRetGpsTime is true */
		int    gpsEndTime;      /* time of the last gps record of the journey. Maybe filled if bRetGpsTime is true */
	};
	
	/******* mileage statistics  *********/
	struct MileStatRequest
	{
		long userID;
		int  apType;
		int  beginTime;				/* 开始时间 */
		int  endTime;				/* 结束时间 */
	};

	struct MileStatResponse
	{
		int oprResult;
		int mileage;				/* unit: meter */
		GpsPos beginPos;			/* 开始位置信息 */
		GpsPos endPos;				/* 结束位置信息*/
		float  over80Percent;   	/* 超速gps点(80km/h-120km/h) 占行程的百分比 */
		float  over120Percent;  	/* 超速gps点(120km/h以上) 占行程的百分比 */
		int    maxSpeed;        	/* unit: km/h */
	};
	
	/******** journey and overSpeed  *************/
	struct Date
	{
		int year;
		int month;
		int day;
	};
	
	struct GetJourneyRecordsReq
	{
		long userID;
		int  apType;
		bool bReqAddr;				/* 缺省是false, 当为true时,表示响应结果中携带文字地址 */
		Date bgnDate;				/* 开始日期 */
		Date endDate;				/* 结束日期 */
		int  extraMapReq; 			/* 0:原始坐标 1:转换高德和百度坐标 2:转换高德坐标 3:转换百度坐标 */
	};
	
	struct GpsLoc
	{
		int lng;
		int lat;
		int glng; /* 高德坐标 */
		int glat;
		int blng; /* 百度坐标 */
		int blat;
	};
	
	struct JourneyRecord
	{
		int  bgnTime;					/*开始时间*/
		int  endTime;					/*结束时间*/
		int  duration;					/*持续时间*/
		string  bgnAddress;				/*开始位置点地址*/
		GpsLoc  bgnGps;					/*开始位置点*/
		string  endAddress;				/*结束位置点地址*/
		GpsLoc  endGps;					/*结束位置点*/
		int  mileage;					/* 单位: 米 */
	};
	
	sequence<JourneyRecord> JourneyRecords;
	
	struct GetJourneyRecordsRes
	{
		int oprResult;
		long userID;
		JourneyRecords jourRecords;		/* 历史行程记录 */
	};
	
	struct GetDailyMileRecordsReq
	{
		long userID;
		int  apType;
		Date  bgnDate;					/*开始日期*/
		Date  endDate;					/*结束日期*/
	};
	
	struct DailyMileRecord
	{
		int  jourCount;
		int  mileage;					/* 单位: 米 */
		Date jourDate;					/*行程所属日期*/
		long duration;					/*行程时间*/
	};
	
	sequence<DailyMileRecord> DailyMileRecords;	
	
	struct GetDailyMileRecordsRes
	{
		int oprResult;
		long userID;
		DailyMileRecords dailMileRecords;		/* 日里程 */
	};
	
	struct GetOverSpeedRecordsReq
	{
		long userID;
		int  apType;
		Date bgnDate;							/*开始日期*/
		Date endDate;							/*结束日期*/
		int  extraMapReq; 						/* 0:原始坐标 1:转换高德和百度坐标 2:转换高德坐标 3:转换百度坐标 */
	};
	
	struct OverSpeedRecord
	{
		int  bgnTime;							/*开始时间*/
		int  endTime;							/*结束时间*/
		int  duration;							/*持续时间*/
		GpsLoc  bgnGps;							/*开始位置点*/
		GpsLoc  endGps;							/*结束位置点*/
		int  averageSpeed;						/*平均速度*/
	};
	
	sequence<OverSpeedRecord> OverSpeedRecords;
	
	struct GetOverSpeedRecordsRes
	{
		int oprResult;
		long userID;
		OverSpeedRecords overSpdRecords;
	};
	/******** journey and overSpeed  *************/
	
	/******** month mileage  *************/
	struct Month
	{
		int year;
		int mon;
	};
	
	struct GetMonthMileRecordsReq
	{
		long userID;
		int  apType;
		Month  bgnMonth;					/* 开始月份 2019-08 */
		Month  endMonth;					/* 结束月份 2019-10 */
	};
	
	struct MonthMileRecord
	{
		int monthMileage;					/* 月里程 */
		int monthCount;						/* 月开车次数 */
		int monthDuration;					/* 月开车时长 */
		int monthDay;						/* 月开车天数 */
		float averageMileage;				/* 平均里程 */
		float averageCount;					/* 平均次数 */
		float averageDuration;				/* 平均时长 */	
		Month whichMonth;					/* 所属月份 */
	};
	
	sequence<MonthMileRecord> MonthMileRecords;
	
	struct GetMonthMileRecordsRes
	{
		int oprResult;
		long userID;
		MonthMileRecords monMileRecords;
	};
	/******** month mileage  *************/
	
	/******** month reside  *************/
	struct GetMonthResideRecordsReq
	{
		long userID;
		int  apType;
		Month  bgnMonth;					/* 起始月份 */
		Month  endMonth;					/* 结束月份 */
	};
	
	struct MonthResideRecord
	{
		string fstResideLoc;				/* 第一常驻地地址 */
		int fstResideDuration;				/* 第一常驻地停留时长 */	
		int fstResideTimes;					/* 第一常驻地停留次数 */	
		string sndResideLoc;				/* 第二常驻地地址 */
		int sndResideDuration;				/* 第二常驻地停留时长 */
		int sndResideTimes;					/* 第二常驻地停留次数 */
		string trdResideLoc;				/* 第三常驻地地址 */
		int trdResideDuration;				/* 第三常驻地停留时长 */
		int trdResideTimes;					/* 第三常驻地停留次数 */
		Month whichMonth;					/* 所属月份 */
	};
	
	sequence<MonthResideRecord> MonthResideRecords;
	
	struct GetMonthResideRecordsRes
	{
		int oprResult;
		long userID;
		MonthResideRecords monResideRecords;
	};
	
	struct GetResideInfoRecordReq
	{
		long userID;
	};
	
	struct GetResideInfoRecordRes
	{
		int oprResult;
		long userID;
		string homeaddress;    /*预测家庭地址*/
		string homeLng;
		string homeLat;
		string workaddress;      /*预测工作地址*/
	    	string workLng;
	    	string workLat;
	};
	
	
	
	/******** month reside  *************/
	
	/******** stay point  *************/
	struct GetStayPointRecordsReq
	{
		long userID;
		int  apType;
		Date bgnDate;					/* 开始日期 */
		Date endDate;					/* 结束日期 */
		int  periodType; 				/* 0:全天 1:06:00~12:00 2:12:00~21:00 3:21:00~06:00 */
		int  minDuration;				/* 最小持续时长 */
		int  maxDuration;				/* 最大持续时长 */
		int  extraMapReq; 				/* 0:原始坐标 1:转换高德和百度坐标 2:转换高德坐标 3:转换百度坐标 */
	};
	
	struct StayPointRecord
	{
		int  bgnTime;					/* 开始时间 */
		int  endTime;					/* 结束时间 */
		int  duration;					/* 持续时长 */
		GpsLoc  stayGps;				/* 停留位置点信息 */
	};
	
	sequence<StayPointRecord> StayPointRecords;
	
	struct GetStayPointRecordsRes
	{
		int oprResult;
		long userID;
		StayPointRecords stayPoints;		/* 停留点信息 */
	};
	/******** stay point  *************/
	
	/******** total mileage  *************/
	struct GetTotalMileageReq
	{
		long userID;
		int  apType;
		int  bgnDayTime;				/* 开始日期 */
		int  endDayTime;				/* 开始日期 */
		int  bReqDailyRecord;			/* 默认0, 非0:获取日里程记录 */
	};
	
	struct GetTotalandAverageMilageReq
	{
		long userID;
	};
	
	struct GetTotalandAverageMilageRes
	{
		long userID;
		int oprResult;
		long totalMileage;
		long monthAveMiles;
		long yearthAveMiles;
	};
	
	struct GetTotalMileageRes
	{
		int  oprResult;
		long userID;
		long totalMileage;						/* 总里程:米(m) */
		long totalJourCount; 					/* 总行驶次数 */
		long totalDuration;						/* 总时长 */
		DailyMileRecords dailMileRecords;		/* 日里程 */
	};
	
	/******** total mileage  *************/

	struct GetBlackAreaReq
	{
		long userID;
	};
	
	struct GetBlackAreaRes
	{
		long userID;
		int oprResult; 
		bool flag;           /*ture: 在黑区 false:不在黑区*/
		string aggKey;	    /*falg == true 才返回该字段*/ 
	};

	struct GetGahterReq
	{
		long userID;
		
	};

	struct GetGatherRes
	{
		long userID;
		int oprResult;
		string aggKey; 
	};
	
	// service interface
	interface DaoMileService
	{		
		/* Mile Stat related */
		bool beginUserMileStat(MileStatBeginRequest req, out MileStatBeginResponse res);
		bool endUserMileStat(MileStatEndRequest req, out MileStatEndResponse res);
		bool JourneyMileStat(MileStatRequest req, out MileStatResponse res);
		
		/* for ddbox device that reports gps info by IMEI instead of didiID */
		bool endUserMileStatByImei(MileStatEndRequest req, out MileStatEndResponse res);
		
		/* for journey and overSpedd */
		bool getJourneyRecords(GetJourneyRecordsReq req, out GetJourneyRecordsRes res);
		bool getDailyMileageRecords(GetDailyMileRecordsReq req, out GetDailyMileRecordsRes res);
		bool getOverSpeedRecords(GetOverSpeedRecordsReq req, out GetOverSpeedRecordsRes res);
		
		/* for month mileage */
		bool getMonthMileageRecords(GetMonthMileRecordsReq req,out GetMonthMileRecordsRes res);
		
		/* for month reside */
		bool getMonthResideRecords(GetMonthResideRecordsReq req,out GetMonthResideRecordsRes res);
		
		/* for work and family reside */
		bool getWorkandFamilyResideRecords(GetResideInfoRecordReq req, out GetResideInfoRecordRes res);
		
		/* for stay point */
		bool getStayPointRecords(GetStayPointRecordsReq req,out GetStayPointRecordsRes res);
		
		/* for totalMileage */
		bool getToatlMileage(GetTotalMileageReq req, out GetTotalMileageRes res);
		bool getToatlandAverageMilage(GetTotalandAverageMilageReq req, out GetTotalandAverageMilageRes res);
		
		/*Black area and gather*/
		bool getBlackAreaData(GetBlackAreaReq req, out GetBlackAreaRes res);
		bool getGatherData(GetGahterReq req, out GetGatherRes res);
		
	};
};