HDao_gps.ice 17.3 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 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766
/////////////////////////////////////////////////////////////////
// 修订记录 
//
// 版本      作者     日期            改动点
// 1.0       金克龙   2016/01/18      初稿:提供各类设备的gps信息、基站、电压信息的查询;
// 1.1       金克龙   2017/10/13      为追踪器提供其workMode的查询;
// 1.2       金克龙   2017/10/31      为通过IMEI上报gps等信息的车机/后视镜提供通过IMEI查询最新Gps点、查询历史gps记录的接口;
// 1.3       金克龙   2019/03/04      为虎哥e盾2.5增加批量监控的查询接口
//////////////////////////////////////////////////////////////////

module HDaoGps
{
	/*==========================================================
	 *            GPS
	 *==========================================================*/
	/******* common  *********/		
	struct GpsRecord
	{
		int gpsTime;		/* GPS时间戳 */
		int lng;			/* 经度 */
		int lat;			/* 纬度 */
		int alt;			/* 海拔 */
		int speed;			/* 速度 */
		int dir;			/* 方向 */
		int gLng;			/* 高德地图经度 */
		int gLat;			/* 高德地图经度 */	
		int bLng;			/* 百度地图经度 */
		int bLat;			/* 百度地图经度 */
		int storeTime;		/* 数据存储时间 */
	};
	
	sequence<GpsRecord> GpsRecords;

	/*--------------------
	   apType: also named as devType, its value defined as below:
	   2: OBD;
	   4: DDbox(DVD)
	   5: Tracker
	   6: rearMirror
	   7: car recorder
	 ---------------------*/
	 
	 /*--------------------
	  apSubType: also named as devSubType. The field is used in Recent Gps/Bs query in order to speed up query process.
	   when apType is 5(tracker), it is defined as below:
	   0: reserved
	   1: with wire power;               
	   2: without wire power;
	  ---------------------*/
	  
	/*--------------------
	 oprResult: 
	   0: OK, records found
	   1: OK, no record found
	   other: operation failed
	 ---------------------*/

	/*--------------------
	 extraMapReq: 
	   0: none
	   1: google&baidu
	   2: google
	   3: baidu
	 ---------------------*/

	/******* Latest Gps record  *********/	
	struct LatestGpsGetRequest
	{
		long userID;
		int  apType;
		int  extraMapReq;
	};
	
	/******* Latest Gps record with bindTime *********/	
	struct LatestGpsGetRequestWithBindTime
	{
		long userID;
		int  apType;
		int  extraMapReq;
		int  bindTime;
	};

	struct LatestGpsGetResponse
	{
		int oprResult;
		GpsRecord record;
	};
	
	struct LatestGpsTimeGetResponse
	{
		int oprResult;
		int gpsTime;
	};
	
	
	/******* Recent Gps records  *********/	
	struct RecentGpsGetRequest
	{
		long userID;
		int  apType;
		int  apSubType;
		int  extraMapReq;
		int  reqCount;
	};

	struct RecentGpsGetResponse
	{
		int oprResult;
		GpsRecords records;
	};
	
	
	/******** history Gps Record *************/
	
	struct GpsGetRequest
	{
		long userID;
		int  apType;
		int  extraMapReq;
		int  startTime;			/*开始时间*/
		int  endTime;			/*结束时间*/
		int  reqCount;			/*请求记录数*/
	};
	
	struct GpsGetResponse
	{
		int oprResult;
		GpsRecords records;
	};
	
	
	/********====================*******/
	/* definition of filterLevel */
	/* 0 - no filter            */
	/* 1 - filter level1: interval of 30 seconds(filter neighboring gps point, if following point who is less than 30 seconds) */
	/* 2 - filter level2: interval of 60 seconds(filter neighboring gps point, if following point who is less than 60 seconds) */
	/* 3 - filter level3: interval of 90 seconds(filter neighboring gps point, if following point who is less than 90 seconds) */
	struct GpsGetExRequest
	{
		long userID;
		int  apType;
		int  extraMapReq;				/*返回地图类型*/
		int  startTime;					/*开始时间*/
		int  endTime;					/*结束时间*/
		int  reqCount;					/*请求记录数*/
		int  filterLevel;				/* definition, please see above */
	};
	
	struct GpsGetExResponse
	{
		int oprResult;
		GpsRecords records;
		bool fullFlag;					/* True if count of records from Hbase/Gpc is same as requested; otherwise, returned from hbase is less than requested */ 
		int  lastGpsTime;				/* sample time of last record from hbase/Gpc */
	};
	
	/******* DevSn to DidiNo mapping ********/
	struct Sn2DdMapGetReq
	{
		long userID;
		int apType;
		int startTime;					/*开始时间*/
		int endTime;					/*结束时间*/
		int  reqCount;					/*请求记录数*/
	}; 
	
	struct SnMapRecord
	{
		int ddNo;
		int devType;
		int beginTime;					/*开始时间*/
		int endTime;					/*结束时间*/
	};
	
	sequence<SnMapRecord> SnMapRecords;
	
	struct Sn2DdMapGetResponse
	{
		int oprResult;	
		SnMapRecord  curMapRecord;				
		SnMapRecords historyMapRecords;
	};
	
	/******* Last Gps record for the request date  *********/
	struct DayLastGpsGetRequest
	{
		long userID;
		int  apType;
		int  extraMapReq;
		int  year;
		int  month;
		int  day;
	};

	struct DayLastGpsGetResponse
	{
		int oprResult;
		GpsRecord record;
	};
	
	/******* Latest Rgps(GPS or rough GPS) record  *********/	
	struct LatestRgpsGetRequest
	{
		long userID;
		int  apType;
		int  extraMapReq;
	};

	struct LatestRgpsGetResponse
	{
		int oprResult;
		GpsRecord record;
	};
	
	
	/******* Batch Gps Device Info request for tiger e-shield ********/
	/*--------------------
	 subDevType: 
	   0: Unknown
	   1: Wire
	   2: Wireless
	   
	 onlineState:
	 	 1: online state;
	 	 2: offline state;
	 	 
	 locType:
	   0: gps
	   1: bs
	 ---------------------*/
	sequence<long> UserIdSeq;
	
	struct GpsDevInfo
	{
		long userID;
		GpsRecord record;
		short subDevType;
		short locType;
		short onlineState;       
	};
	
	sequence<GpsDevInfo> GpsDevInfoSeq;
	
	struct BatchGpsDevInfoRequest
	{
		UserIdSeq userIds;	/* max num is less than 1000 */
		int  extraMapReq;
		int  seqNo;					/* 0: initiated; 
		                     * increase by 1 each time refresshing */ 
	};
	
	/**
	** batchResult:
	** 0:  ok for all users;
	** 1:  ok for part, the succesful part of device info is followed;
	** -1: failed,  the followed gpsDevInfo is meaningless.
	**/
	struct BatchGpsDevInfoResponse
	{
		int batchResult;
		GpsDevInfoSeq gpsDevInfos;
	};
	
	
	/*==========================================================
	 *            BaseStation
	 *==========================================================*/
	/* common part */
	struct BsInfo
	{
		int lac;						/*  位置区号 */
		int cellId;						/*  位置塔号 */
		int signal;						/*  信号强度 */
	};
	
	sequence<BsInfo> BsInfoArray;
	
	struct BsRecord
	{
		int gpsTime;					/*  GPS上报时间 */
		int storeTime;					/*  数据存储时间 */
		int mcc;						/*  国家码 */
		int mnc;						/*  所属运营商 */
		BsInfoArray bsInfos;
	};
	
	sequence<BsRecord> BsRecords;

	/******* Latest BaseStation record  *********/
	struct LatestBsGetRequest
	{
		long userID;
		int  apType;
	};
	
	struct LatestBsGetResponse
	{
		int oprResult;
		BsRecord record;
	};
	
	/****** Recent BaseStation records *******/
	struct RecentBsGetRequest
	{
		long userID;
		int  apType;
		int  apSubType;
		int  reqCount;
	};

	struct RecentBsGetResponse
	{
		int oprResult;
		BsRecords records;
	};
	
	/****** history BaseStation record *******/
	struct BsGetRequest
	{
		long userID;
		int  apType;
		int  startTime;					/* 开始时间 */
		int  endTime;					/* 结束时间 */
		int  reqCount;
	};
	
	struct BsGetResponse
	{
		int oprResult;
		BsRecords records;
	};
	
	/******** Gps&BS Record *************/
	struct GpsBsRecord
	{
		int gpsTime;					/*  GPS上报时间 */
		int storeTime;					/*  数据存储时间 */
		bool gpsValid;					/*  GPS有效位 */
		int lng;						/*  经度 */
		int lat;						/*  纬度 */
		int gLng;						/*  高德地图经度 */
		int gLat;						/*  高德地图纬度 */
		int bLng;						/*  百度地图经度 */
		int bLat;						/*  百度地图纬度 */
		int alt;						/*  海拨 */
		int speed;						/*  速度 */
		int dir;						/*  方向 */
		bool bsValid;					/*  基站有效位 */
		int mcc;						/*  国家码 */
		int mnc;						/*  所属运营商 */	
		BsInfoArray bsInfos;
	};
	
	sequence<GpsBsRecord> GpsBsRecords;
	
	struct GpsBsGetResponse
	{
		int oprResult;
		GpsBsRecords records;
	};
	
	struct LatestGpsBsRecord
	{
			GpsRecord recordgps;
			BsRecord  recordbs;
	};

	struct LatestGpsBsReponse
	{
		bool gpsValid;           /*  GPS有效位 */
		bool bsValid;			/*  基站有效位 */
		int oprGpsResult;
		int oprBsResult;
		LatestGpsBsRecord record;
	};

	/****** SIM card's related record *******/
	struct DataCardGetRequest
	{
		long userID;
		int  apType;
	};
	
	struct DataCardInfo
	{
		int    gpsTime;
		string iccid;
	};
	
	struct DataCardGetResponse
	{
		int oprResult;
		DataCardInfo cardInfo;
	};
	
	
	/******* workmode record: gsensor and workmode field *********/
	
	/*-----GPS related workmode record------*/
	struct GpsWorkModeRecord
	{
		int gpsTime;						/*  GPS上报时间 */
		int lng;							/*  经度 */
		int lat;							/*  纬度 */
		int speed;							/*  速度 */
		int gsensor;						/*  GSENSOR值 */
		int workmode;						/*  工作模式 */
		int storeTime;						/*  数据存储时间 */
	};
	
	sequence<GpsWorkModeRecord> GpsWorkModeRecords;
	
	struct GpsWorkModeGetRequest
	{
		long userID;
		int  apType;
		int  startTime;						/* 开始时间 */
		int  endTime;						/* 结束时间 */
		int  reqCount;						/* 请求记录数 */
	};
	
	struct GpsWorkModeGetResponse
	{
		int oprResult;
		GpsWorkModeRecords records;
	};
	
	/*-----BS related workmode record------*/
	struct BsWorkModeRecord
	{
		int gpsTime;						/* GPS上报时间 */
		int storeTime;						/*  数据存储时间 */
		int mcc;							/*  国家码 */
		int mnc;							/*  所属运营商 */
		BsInfoArray bsInfos;				/*  基站信息 */
		int gsensor;						/*  GSENSOR值 */
		int workmode;						/*  工作模式 */
	};
	
	sequence<BsWorkModeRecord> BsWorkModeRecords;
	
	struct BsWorkModeGetRequest
	{
		long userID;
		int  apType;
		int  startTime;						/* 开始时间 */
		int  endTime;						/* 结束时间 */
		int  reqCount;						/* 请求记录数 */
	};
	
	struct BsWorkModeGetResponse
	{
		int oprResult;
		BsWorkModeRecords records;
	};
	
	/*==========================================================
	 *            Voltage
	 *==========================================================*/
	/******** latest Voltage Record *************/
	struct LatestVoltageGetRequest
	{
		long userID;
		int  apType;
		int  startTime;
	};
	
	struct VoltageRecord
	{
		int gpsTime;
		int voltage;     /* multipled by 100 */
		int storeTime;
	};
	
	struct LatestVoltageGetResponse
	{
		int oprResult;
		VoltageRecord record;
	};
	
	/******** history Voltage Record *************/
	struct VoltageGetRequest
	{
		long userID;
		int  apType;
		int  startTime;						/* 开始时间 */
		int  endTime;						/* 结束时间 */
		int  reqCount;						/* 请求记录数 */
	};
	
	sequence<VoltageRecord> VoltageRecords;
	
	struct VoltageGetResponse
	{
		int oprResult;
		VoltageRecords records;
		bool finishFlag;
		int  lastRecTime;
	};
	
	/*** Voltage max diff  ***/
	struct DiffVoltageGetRequest
	{
		long userID;
		int  apType;
		int  startTime;							/* 开始时间 */
		int  endTime;							/* 结束时间 */
	};
	
	struct DiffVoltageGetResponse
	{
		int oprResult;
		int maxVolDiff;	/* multipled by 100 */
	};
	
	
	/*==========================================================
	 *            Battery
	 *==========================================================*/
	/******** latest Battery Record *************/
	struct LatestBatteryGetRequest
	{
		long userID;
		int  apType;
		int  startTime;							/* 结束时间 */
	};
	
	struct BatteryRecord
	{
		int gpsTime;
		int battery;     /* percentage: such as 50, represent 50% */
		int storeTime;
	};
	
	struct LatestBatteryGetResponse
	{
		int oprResult;
		BatteryRecord record;
	};
	
	/*==========================================================
	 *            ParadeCar
	 *==========================================================*/
	/******** ParadeCar Gps Record *************/
	struct ParadeCarGpsRecord
	{
		int gpsTime;
		int lng;
		int lat;
		int alarmState;
		int speed;
		int dir;
		int status;
		int gLng;
		int gLat;
		int bLng;
		int bLat;
		int storeTime;
	};
	
	sequence<ParadeCarGpsRecord> ParadeCarGpsRecords;
	
	struct GpsParadeCarGetResponse
	{
		int oprResult;
		ParadeCarGpsRecords records;
		bool fullFlag;					/* True if count of records from Hbase/Gpc is same as requested; otherwise, returned from hbase is less than requested */ 
		int  lastGpsTime;				/* sample time of last record from hbase/Gpc */
	};
	
	struct AlarmGetRequest
	{
		long userID;
		int  apType;
		int  startTime;
		int  endTime;
		int  reqCount;
	};
	
	struct AlarmRecord
	{
		int alarmTime;
		int alarmState;
	};
	
	sequence<AlarmRecord> AlarmRecords;
	
	struct AlarmGetResponse
	{
		int oprResult;
		AlarmRecords records;
		bool fullFlag;					/* True if count of records from Hbase/Gpc is same as requested; otherwise, returned from hbase is less than requested */ 
		int  lastAlarmTime;				/* sample time of last record from hbase/Gpc */
	};

	enum ConvType {  WGS2GG, WGS2BD };
	
	struct ConvRequest
	{		
		ConvType type;	
		int lng;	
		int lat;
	};
	
	struct ConvResponse
	{
		int lng;
		int lat;
	};

	struct ConvResponseResult
	{
		int oprResult;
		ConvResponse gps;
	};
	
	struct DevicesTotalCountGetRequest
	{
		long sn;
	};
	
	struct DevicesTotalCountRes
	{
		int oprResult;
		int deviceCount;
		string updataTime;
	};
	
	struct GpsWifiRequest
	{
		long userID;
		int  apType;
	};
	
	struct wifiData
	{
		string mac;        
		int    single;    
	};

	sequence<wifiData> wifiDatas;

	struct GpsWifiGetResponse
	{
		int oprResult;
		int gpsTime;   
		int svcTime;   
		wifiDatas records;	
	};
	
	struct DaoGpsData
 	{
		int gpsTime;
		int storeTime;
        	int lng;           
        	int lat;
		string addr;	   
	}; 

	struct DaoBsDataResp
	{
		int ret;
		DaoGpsData gps;
	};

	struct RegionData
	{
		int leftLng;
		int leftLat;
		int rightLng;
		int rightLat;
	};

	struct DeviceInfo
	{
		long sn;
		int lng;
		int lat;
		int gpsTime;
		string addr;
	};

	sequence<DeviceInfo> DeviceList;
	struct InRegionDevices
	{
		int ret;
		DeviceList devInfo;
	};

	// service interface
	interface DaoGpsService 
	{
		/*bs & gps record*/
		bool getLatestGpsBsRecord(LatestGpsGetRequest req,  out LatestGpsBsReponse res);
		
		/* baseStation related */
		bool getBsRecords(BsGetRequest req, out BsGetResponse res);
		bool getLatestBsRecord(LatestBsGetRequest req, out LatestBsGetResponse res);
		bool getRecentBsRecords(RecentBsGetRequest req, out RecentBsGetResponse res);
		bool getFirstBsRecord(BsGetRequest req, out BsGetResponse res);
		
		/* Gps related */
		bool getFirstGpsRecord(GpsGetRequest req, out GpsGetResponse res);
		bool getLatestGpsRecord(LatestGpsGetRequest req, out LatestGpsGetResponse res);
		bool getLatestGpsTime(LatestGpsGetRequest req, out LatestGpsTimeGetResponse res);
		bool getRecentGpsRecords(RecentGpsGetRequest req, out RecentGpsGetResponse res);
		bool getGpsRecords(GpsGetRequest req, out GpsGetResponse res);
		bool getGpsRecordsEx(GpsGetRequest req, out GpsGetExResponse res);
		
		/* Batch: ONLY for tracker */
		bool getDevicesGpsInfo(BatchGpsDevInfoRequest req, out BatchGpsDevInfoResponse res);
		
		/* support DDbox/rearMirror device who reports gps info by IMEI instead of didiID */
		bool getLatestGpsRecordByImei(LatestGpsGetRequestWithBindTime req, out LatestGpsGetResponse res);
		bool getGpsRecordsByImei(GpsGetRequest req, out GpsGetExResponse res);
		
		/* DDbox device used for FRMS purpose */
		bool getLatestGpsRecordByMapSn(LatestGpsGetRequest req, out LatestGpsGetResponse res);
		bool getGpsRecordsByMapSn(GpsGetExRequest req, out GpsGetExResponse res);
		bool getSnMapRecords(Sn2DdMapGetReq req, out Sn2DdMapGetResponse res);
		
		bool getLatestRgpsRecord(LatestRgpsGetRequest req, out LatestRgpsGetResponse res);
		
		/* Get location by LBS record, NOT recommended, ONLY used when there is NO gps info available */
		bool getLatestLocationByLbsRecord(LatestGpsGetRequest req, out LatestGpsGetResponse res);
		
		bool getDayLastGpsRecord(DayLastGpsGetRequest req, out DayLastGpsGetResponse res);
		bool getGpsBsRecords(GpsGetRequest req, out GpsBsGetResponse res);
		bool getFirstGpsBsRecord(GpsGetRequest req, out GpsBsGetResponse res);
		
		/* Voltage related */
		bool getLatestVolRecord(LatestVoltageGetRequest req, out LatestVoltageGetResponse res);
		bool getMaxVolDiff(DiffVoltageGetRequest req, out DiffVoltageGetResponse res);
		bool getVoltageRecords(VoltageGetRequest req, out VoltageGetResponse res);
		
		/* Battery related */
		bool getLatestBatteryRecord(LatestBatteryGetRequest req, out LatestBatteryGetResponse res);
		
		/* Info of data card installed in the device */
		bool getDataCardInfo(DataCardGetRequest req, out DataCardGetResponse res);
		
		/* workmode related: the interfaces are used for problem resoving */
		bool getGpsWorkModeRecords(GpsWorkModeGetRequest req, out GpsWorkModeGetResponse res);
		bool getBsWorkModeRecords(BsWorkModeGetRequest req, out BsWorkModeGetResponse res);
		
		/* ParadeCar related */
		bool getParadeCarGpsRecords(GpsGetRequest req, out GpsParadeCarGetResponse res);
		bool getParadeCarAlarmRecords(AlarmGetRequest req, out AlarmGetResponse res);
		
		bool convGeoGps(ConvRequest req, out ConvResponseResult rsp);
		
		bool getDevicesTotalCount(DevicesTotalCountGetRequest req, out DevicesTotalCountRes res);
		
		/*gps wifi info*/
		bool getLatestGpsWifiRecords(GpsWifiRequest req, out GpsWifiGetResponse res);
		/*bs list by bsSvrICe*/
		bool getGpsByLatestBsRecord(LatestBsGetRequest req, out DaoBsDataResp res);

		bool getGpsByBsRecordsOfLatesBs(BsGetRequest req, out DaoBsDataResp res);

		bool getDeviceInfoOfRegion(RegionData req, out InRegionDevices res);
		
	};
};