Commit 03a5083a by 王欣伟

1、ICE工具类提交

2、批量导入权益订单-用户字典数据脚本
3、恒信数据导出增加设备位置信息
1 parent 1440ffae
Showing 55 changed files with 11645 additions and 0 deletions
/////////////////////////////////////////////////////////////////
// 修订记录
//
// 版本 作者 日期 改动点
// 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);
};
};
/////////////////////////////////////////////////////////////////
// 修订记录
//
// 版本 作者 日期 改动点
// 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);
};
};
module HDaoMile
{
/*==========================================================
* Mileage Statistics
*==========================================================*/
/******* common *********/
struct GpsPos
{
int gpsTime;
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;
};
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 */
};
// 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);
};
};
\ No newline at end of file \ No newline at end of file
module BaseStationData
{
struct BsData
{
int mnc; /*运营商编码*/
int lac; /*区号*/
int cellid; /*塔号*/
};
sequence<BsData> BsListReq;
struct BsDataListReq
{
BsListReq bsList;
};
struct BsDataReq
{
BsData bs;
};
struct GpsData
{
int lng; /*经度*/
int lat; /*纬度*/
string addr; /*地址*/
};
struct BsDataResp
{
int ret;
GpsData gps;
};
struct BsPoint
{
float lng;
float lat;
};
struct PoiInfo
{
float distance;
string type;
float lng;
float lat;
string addr;
};
sequence<PoiInfo> poiDatas;
struct DaoPoiInfoResp
{
int size;
poiDatas records;
};
interface BaseStationService
{
bool GetGpsByBs(BsDataReq req, out BsDataResp resp);
bool GetGpsByBsList(BsDataListReq req, out BsDataResp resp);
/*get gaode poiType*/
bool getPoiTypeFromGeo(BsPoint pt, out DaoPoiInfoResp res);
};
};
module DISTRICT {
interface IDistrictFinder{
bool get_distinfo_by_pos(float lng,float lat,out int distCode,out string strDistName);
bool get_distdetail_by_code(int distCode,out string strProvName,out string strCityName,out string strCountyName);
bool get_distdetail_by_pos(float lng, float lat, out string strProvName, out string strCityName, out string strCountyName);
};
};
module POI {
struct poi_info_t
{
int id; //poi id
float lng;
float lat;
int citycode;
int type;
string name;
string addr;
string tel;
int weight;
int distance;
};
sequence<poi_info_t> poi_info_seq_t;
sequence<int> poi_type_seq_t;
enum POI_INDEX_TYPE_CONSTANTS
{
emIndexName,
emIndexAddr,
emIndexCustom,
index_type_count,
};
struct geopoint
{
float lng;
float lat;
};
struct geocoding_result
{
int level;
int confidence;
geopoint pt;
};
/*
* POI search
*/
interface IPOISearchFTR
{
/*
input:
emIndexType
key
citycode
limit
output:
a list of poi
*/
int poi_search_by_key(POI_INDEX_TYPE_CONSTANTS emIndexType, string key, int citycode, int limit, out poi_info_seq_t arrPoiInfo);
/*
input:
emIndexType
key
citycode
limit
a list of type
output:
a list of poi
*/
int poi_search_by_key_and_type(POI_INDEX_TYPE_CONSTANTS emIndexType, string key, int citycode, poi_type_seq_t arrType, int limit,
out poi_info_seq_t arrPoiInfo);
/*
input:
emIndexType
key
citycode
limit
a list of type
lng lat :pos
maxDis:distance
output:
a list of poi
*/
int poi_search_by_key_type_near(POI_INDEX_TYPE_CONSTANTS emIndexType, string key, poi_type_seq_t arrType, geopoint pt, int maxDis, int limit,
out poi_info_seq_t arrPoiInfo);
/*
input:
key
region city
limit
output:
a list of poi
*/
int poi_search_by_key_cityname(string key, string cityname, int limit, out poi_info_seq_t arrPoiInfo);
/*
input:
key
citycode
limit
省内查询
output:
a list of poi
*/
int poi_search_by_key_citycode(string key, int citycode, int limit, out poi_info_seq_t arrPoiInfo);
/*
地址解析
input:
string strGeopointDescription
output:
geocoding_result rst
*/
int Geocoding(string strAddress, out geocoding_result rst);
}; // interface IPOISearchFTR
interface IPOISearchNear
{
/*
input:
ptLL
ptRR
a list of type
numLimit
output:
a list of poi
*/
int poi_search_by_rect(geopoint ptLL,geopoint ptRR,poi_type_seq_t arrType,int numLimit,out poi_info_seq_t arrPoiInfo);
/*
input:
pt
maxDis
a list of type
numLimit
output:
a list of poi
*/
int poi_search_by_circle(geopoint pt,int maxDis,poi_type_seq_t arrType,int numLimit,out poi_info_seq_t arrPoiInfo);
/*
input:
citycode
limit
a list of type
output:
a list of poi
*/
int poi_search_by_city(int citycode,poi_type_seq_t arrType,int limit,out poi_info_seq_t arrPoiInfo);
/*
逆地址解析
input:
geopoint pt
output:
string strGeopointDescription
*/
int ReverseGeocoding(geopoint pt,out string strGeopointDescription);
// 逆地址解析, 格式:广东省广州市天河区国际康体贸易中心附近
int ReverseGeocoding2(geopoint pt, out string strGeopointDescription);
}; // interface IPOISearchFTR
}; // module
\ No newline at end of file \ No newline at end of file
import logging
import pandas as pd
import sys,traceback,Ice
Ice.loadSlice("--all -I.. ice/bsd.ice")
Ice.loadSlice("--all -I.. ice/Hdao_gps.ice")
Ice.loadSlice("--all -I.. --underscore ice/district.ice")
Ice.loadSlice("--all -I.. --underscore ice/ipoi.ice")
Ice.loadSlice("--all -I.. --underscore ice/HDao_mile.ice")
import datetime
import BaseStationData
import HDaoGps,HDaoMile
import DISTRICT
import pymysql
import POI
print("sys config " + __name__)
log_name = './log/iceinvoker/iceclientutl.log'
log_format = '[%(asctime)s-%(filename)s-%(levelname)s:%(message)s]'
log_level = logging.DEBUG
log_mode = 'a'
logging.basicConfig(filename=log_name, format=log_format, level=log_level, filemode=log_mode)
class IceClientUtil:
# env_host = "192.168.3.101"
# env_host = "192.168.5.31"
env_host = "192.168.5.26"
daoGpsServicePrx = None
def __init__(self, handle_month):
logging.info("init construct bean")
self.handleDescription = "dj renewal match iccid and device location"
self.handleMonth = handle_month
self.hmonth = handle_month.replace('-', '')[2:6]
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(f'HDaoGpsSvc:default -h {self.env_host} -p 23469')
obj.ice_ping()
self.daoGpsServicePrx = HDaoGps.DaoGpsServicePrx.checkedCast(obj)
def getLatestGpsRecord(self, sn,type = 5):
try:
if not self.daoGpsServicePrx:
raise RuntimeError("Invalid proxy")
req = HDaoGps.LatestGpsGetRequest()
req.userID = int(sn)
req.apType = type
req.extraMapReq = 0
rsp = self.daoGpsServicePrx.getLatestGpsRecord(req)
# print(rsp[1].gps.gpsTime)
print(rsp)
return rsp
except:
traceback.print_exc()
return None
if __name__ == "__main__":
iceClientUtil = IceClientUtil()
sn = '561063062817521'
gpsRecord = iceClientUtil.getLatestGpsRecord(sn)
print(gpsRecord)
\ No newline at end of file \ No newline at end of file
#!/usr/bin/python
# -*- coding:utf-8 -*-
import pandas as pd
import sys,traceback,Ice
Ice.loadSlice("--all -I.. ice/bsd.ice")
Ice.loadSlice("--all -I.. ice/Hdao_gps.ice")
Ice.loadSlice("--all -I.. --underscore ice/district.ice")
Ice.loadSlice("--all -I.. --underscore ice/ipoi.ice")
Ice.loadSlice("--all -I.. --underscore ice/HDao_mile.ice")
import datetime
import BaseStationData
import HDaoGps,HDaoMile
import DISTRICT
import pymysql
import POI
fmrsDBConn = pymysql.Connect(host='192.168.5.24', port=3306, user='biz_neshield_tmp',passwd='TmM6IJAr', db='neshield', charset='utf8')
# env_host = "192.168.3.101"
# env_host = "192.168.5.31"
env_host = "192.168.5.26"
def get_distdetail_by_pos(lng,lat):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(f'DistrictFinder:default -h {env_host} -p 10008')
obj.ice_ping()
printer = DISTRICT.IDistrictFinderPrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
rsp = printer.get_distdetail_by_pos(lng,lat)
print(rsp)
return rsp
except:
traceback.print_exc()
return None
def getGpsByBs(mnc,lac,cellid):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(f'BsdObjectId:default -h {env_host} -p 10945')
obj.ice_ping()
printer = BaseStationData.BaseStationServicePrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = BaseStationData.BsDataReq()
# bsData = BaseStationData.BsData()
req.bs.mnc = int(mnc)
req.bs.lac = int(lac)
req.bs.cellid = int(cellid)
rsp = printer.GetGpsByBs(req)
print(rsp)
# print(rsp[1].gps.addr)
return rsp[1].gps.addr
except:
traceback.print_exc()
def getGpsByBsList():
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(f'BsdObjectId:default -h {env_host} -p 10945')
obj.ice_ping()
printer = BaseStationData.BaseStationServicePrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = BaseStationData.BsDataListReq()
bsList = []
# BsData = BaseStationData.BsData()
# BsData.mnc = 0
# BsData.lac = 1
# BsData.cellid = 6
# bsList.append(BsData)
for i in range(6):
BsData = BaseStationData.BsData()
BsData.mnc = 0
BsData.lac = 9278
BsData.cellid = 2
bsList.append(BsData)
req.bsList = bsList
rsp = BaseStationData.BsDataResp()
rsp = printer.GetGpsByBsList(req)
print(rsp)
except:
traceback.print_exc()
def getGpsRecords(sn,starttime,endtime):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(f'HDaoGpsSvc:default -h {env_host} -p 23470')
obj.ice_ping()
printer = HDaoGps.DaoGpsServicePrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = HDaoGps.GpsGetRequest()
req.userID = sn
req.apType = 5
req.extraMapReq = 0
req.startTime = int(datetime.datetime.strptime(starttime,"%Y-%m-%d %H:%M:%S").timestamp())
req.endTime = int(datetime.datetime.strptime(endtime,"%Y-%m-%d %H:%M:%S").timestamp())
req.reqCount = 2000
rsp = printer.getGpsRecords(req)
print(rsp)
except:
traceback.print_exc()
def getGpsByLatestBsRecord(sn,type):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(f'HDaoGpsSvc:default -h {env_host} -p 23469')
obj.ice_ping()
printer = HDaoGps.DaoGpsServicePrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = HDaoGps.LatestBsGetRequest()
req.userID = int(sn)
req.apType = type
rsp = printer.getGpsByLatestBsRecord(req)
print(rsp[1].gps.gpsTime)
print(rsp)
except:
traceback.print_exc()
def getLatestBsRecord(sn,type = 5):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(f'HDaoGpsSvc:default -h {env_host} -p 23469')
obj.ice_ping()
printer = HDaoGps.DaoGpsServicePrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = HDaoGps.LatestBsGetRequest()
req.userID = int(sn)
req.apType = type
req.extraMapReq = 0
rsp = printer.getLatestBsRecord(req)
# print(rsp[1].gps.gpsTime)
print(rsp)
except:
traceback.print_exc()
def getLatestGpsRecord(sn,type = 5):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(f'HDaoGpsSvc:default -h {env_host} -p 23469')
obj.ice_ping()
printer = HDaoGps.DaoGpsServicePrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = HDaoGps.LatestGpsGetRequest()
req.userID = int(sn)
req.apType = type
req.extraMapReq = 0
rsp = printer.getLatestGpsRecord(req)
# print(rsp[1].gps.gpsTime)
print(rsp)
except:
traceback.print_exc()
def getGpsByBsRecordsOfLatesBs(sn,type,startTime,endTime):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(f'HDaoGpsSvc:default -h {env_host} -p 23469')
obj.ice_ping()
printer = HDaoGps.DaoGpsServicePrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = HDaoGps.BsGetRequest()
req.userID = int(sn)
req.apType = type
req.startTime = int(datetime.datetime.strptime(startTime,"%Y-%m-%d %H:%M:%S").timestamp())
req.endTime = int(datetime.datetime.strptime(endTime, "%Y-%m-%d %H:%M:%S").timestamp())
req.reqCount = -1
rsp = printer.getGpsByBsRecordsOfLatesBs(req)
print(f"{datetime.datetime.fromtimestamp(rsp[1].gps.gpsTime).strftime('%Y-%m-%d %H:%M:%S')}")
print(f"{datetime.datetime.fromtimestamp(rsp[1].gps.storeTime).strftime('%Y-%m-%d %H:%M:%S')}")
print(rsp)
except:
traceback.print_exc()
def getGeoPoiType(lng,lat):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(f'BsdObjectId:default -h {env_host} -p 10945')
obj.ice_ping()
printer = BaseStationData.BaseStationServicePrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = BaseStationData.BsPoint()
req.lng = lng
req.lat = lat
rsp = BaseStationData.DaoPoiInfoResp()
rsp = printer.getPoiTypeFromGeo(req)
print(rsp)
except:
traceback.print_exc()
def getDeviceInfoOfRegion(lLng,lLat,rLng,rLat):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(f'HDaoGpsSvc:default -h {env_host} -p 23479')
obj.ice_ping()
printer = HDaoGps.DaoGpsServicePrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = HDaoGps.RegionData()
req.leftLng = lLng
req.leftLat = lLat
req.rightLng = rLng
req.rightLat = rLat
rsp = printer.getDeviceInfoOfRegion(req)
print(rsp)
except:
traceback.print_exc()
def getDevicesGpsInfo(snList):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(f'HDaoGpsSvc:default -h {env_host} -p 23470')
print(env_host,23479)
obj.ice_ping()
printer = HDaoGps.DaoGpsServicePrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = HDaoGps.BatchGpsDevInfoRequest()
req.extraMapReq = 1
req.seqNo = 0 # seqNo%6 6个中保留1个
req.userIds = snList
rsp = printer.getDevicesGpsInfo(req)
print(rsp)
except:
traceback.print_exc()
def ReverseGeocoding2(lng,lat):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(f'PoiSearchNear:default -h 192.168.5.31 -p 10081')
obj.ice_ping()
printer = POI.IPOISearchNearPrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = POI.geopoint()
req.lng = lng
req.lat = lat
rsp = printer.ReverseGeocoding2(req)
print(rsp)
except:
traceback.print_exc()
def endUserMileStat(sn):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(f'RtMileStatSvc:default -h {env_host} -p 23472')
obj.ice_ping()
printer = HDaoMile.DaoMileServicePrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = HDaoMile.MileStatEndRequest()
req.userID = sn
req.apType = 5
req.beginTime = int(datetime.datetime.strptime("2023-09-20 10:48:53","%Y-%m-%d %H:%M:%S").timestamp())
req.endTime = int(datetime.datetime.strptime("2023-09-20 11:08:19","%Y-%m-%d %H:%M:%S").timestamp())
req.bRetGpsTime = True
rsp = printer.endUserMileStat(req)
print(rsp)
except:
traceback.print_exc()
def getJourneyRecords(sn,bgnDate,endDate):
try:
with Ice.initialize(sys.argv) as communicator:
obj = communicator.stringToProxy(f'RtMileStatSvc:default -h {env_host} -p 23472')
obj.ice_ping()
printer = HDaoMile.DaoMileServicePrx.checkedCast(obj)
if not printer:
raise RuntimeError("Invalid proxy")
req = HDaoMile.GetJourneyRecordsReq()
req.userID = sn
req.apType = 5
req.bReqAddr = False
req.bgnDate.year = bgnDate[0]
req.bgnDate.month = bgnDate[1]
req.bgnDate.day = bgnDate[2]
req.endDate.year = endDate[0]
req.endDate.month = endDate[1]
req.endDate.day = endDate[2]
req.extraMapReq = 0
rsp = printer.getJourneyRecords(req)
print(rsp)
except:
traceback.print_exc()
class DeviceInfo:
def __init__(self,sn,count,validCount):
self.sn = sn
self.count = count
self.validCount = validCount
def add_count(self):
self.count += 1
def add_validCount(self):
self.validCount += 1
if __name__ == "__main__":
# snlist = [1510824193, 1510824194, 1510922309, 1510922324, 1510922327, 1510922330, 1510922334, 1510922335, 1510922336, 1510922337, 1510922338, 1510922339, 1510922340, 1510922341, 1510922342, 1510922345, 1510922346, 1510922347, 1510922350, 1510922352, 1510922354, 1510922369, 1510922371, 1510922372, 1510922375, 1510922376, 1510922390, 1510922391, 1510922418, 1510922425, 1510922428, 1510922430, 1510922431, 1510922433, 1510922448, 1510922449, 1510922456, 1510922458, 1510922460, 1510922464, 1510922468, 1510922472, 1510922480, 1510922492, 1510922497, 1510922514, 1510922521, 1510922522, 1510922523, 1510922524, 1510922525, 1510922526, 1510922529, 1510922533, 1510922539, 1510922542, 1510922547, 1510922549, 1510922550, 1510922555, 1510922562, 1510922564, 1510922567, 1510922569, 1510922570, 1510922571, 1510922572, 1510922577, 1510922582, 1510922583, 1510922586, 1510922590, 1510922592, 1510922595, 1510922597, 1510922608, 1510922616, 1510922620, 1510922623, 1510922624, 1510922635, 1510922637, 1510922638, 1510922639, 1510922641, 1510922642, 1510922643, 1510922645, 1510922646, 1510922650, 1510922651, 1510922652, 1510922659, 1510922661, 1510922663, 1510922664, 1510922667, 1510922668, 1510922669]
# snlist = [1190910192,1190614211,1190706000,1190910175,1190614987,1190614359,1190909435,1181127963,1190909126,1190910195,1190112152,1190909426,1190909377,1190429928,1190614984,1190112128,1190909439,1190522172,1190909633,1190624163,1190910026,1190404102,1190429919,1190112136,1190706009,1181127934,1190112131,1190112365,1190910127,1190522602,1190910158,1190706151,1190522604,1190614464,1190110673,1190522007,1190909007,1190706245,1181223028,1190706285,1190107499,1190111898,1190909006,1190404071,1190705407,1190909630,1190706291,1190909084,1180720969,1190706181,1190909635,1190706210,1181031326,1190706174,1181031332,1190705199,1190522526,1180720985,1190706307,1190909274,1190909606,1190705198,1190706170,1190909061,1190614215,1190909197,1190112135,1180720975,1190112150,1190910239,1180720989,1190403860,1190429949,1190706281,1181127927,1190429971,1190624467,1190624191,1190909645,1190706247,1190706225,1190624365,1181127908,1190429940,1190909673,1181127985,1190910321,1190706294,1190706267,1190404895,1190522947,1181127954,1190910185,1190910306,1190706289,1190522997,1190111086,1190706011,1190429030,1190403850,1190909607,1190429976,1180720963,1190112137,1190110665,1181031328,1190706458,1190615144,1181127928,1181127948,1181127901,1190909770,1190429287,1190111939,1190614777,1190910243,1190429290,1190909096,1190909611,1190910346,1190705400,1190706261,1190910297,1190910094,1190910320,1190429925,1190429934,1190112100,1190110664,1190429112,1190111431,1190910393,1190909973,1190112120,1190909617,1190112115,1181127960,1181127953,1190404370,1190112122,1181127989,1190910380,1190615411,1190522030,1190522035,1190909057,1190909726,1190909058,1190429960,1190522278,1181127996,1190910374,1190706265,1190909307,1190404955,1190429959,1190404477,1190112569,1190522577,1190429293,1190705182,1190910426,1190910359,1181127097,1190403662,1190614738,1190112347,1190706226,1190909556,1190909749,1190429936,1190909743,1190910227,1190909745,1190522356,1190910298,1190910230,1190614271,1190910394,1190909904,1180823373,1190522952,1181127994,1190522336,1190522337,1190910343,1190909767,1190522576,1190429234,1190429274,1190910488,1190615397,1190910285,1190614210,1190705936,1190910410,1181127952,1190706172,1190429311,1190910287]
# print(len(snlist))
# getDevicesGpsInfo(snList=snlist)
# startTime = datetime.datetime.now().timestamp()
# print(f"startTime = {startTime}")
# getDeviceInfoOfRegion(113989108,22585025,113994542,22589522)
# endTime = datetime.datetime.now().timestamp()
# print(f"endTime = {endTime}")
# print(f"useTime = {endTime - startTime}")
# endUserMileStat(87207270103)
#获取最后gps位置数据,
#param: sn,设备类型
getLatestGpsRecord('1570731232',5)
#获取gps信息
# getGpsRecords(15212050744,"2024-01-17 00:00:00","2024-01-18 00:00:00")
#获取里程列表
# getJourneyRecords( 15209030720,[2024,1,1],[2024,1,4])
# getLatestBsRecord('352538107542444',11)
# getLatestBsRecord('45212100445',5)
# getGpsByBs(0,18267,57061)
# getGpsByBs(0,18334,46178417)
# sir_map = {}
# deviceInfo = DeviceInfo("15212170590", 0, 0)
# sir_map["15212170590"] = deviceInfo
# with open("deviceinfo_st.txt", 'w') as f:
# for dev in sir_map.values():
# f.write(f"{dev.sn},{dev.count},{dev.validCount}")
# ghc跑的数据-在跑基站转经纬度
# df = pd.read_excel(os.getcwd() + "\\excel\\lastGPSandBs.xlsx")
# for i in df.index:
# addr = getGpsByBs(df.loc[i,'mmc'],df.loc[i,'lac'], df.loc[i,'ci'])
# df.loc[i, '基站地址'] = addr
# df.to_excel(f"\\excel\\lastGPSandBs_re.xlsx",index=False)
# 直接调用bsIcesvr
# getGpsByBsList()
#通过hdaod调用bsIceSvr获取gps
# getGpsByLatestBsRecord('1610523358',5)
#获取高德poi类型
# getGeoPoiType(113.991416,22.587527)
#原始经纬度转地址
# ReverseGeocoding2(117.634416, 38.709333)
#取一段时间内的最后一个基站转gps
# getGpsByBsRecordsOfLatesBs('1621226935',5,'2023-03-01 00:00:00','2023-03-01 17:00:00')
#通过经纬度,获取所在省市区
# for file in ["第一设备.xlsx","第二设备.xlsx"]:
# fileName = file[0:file.find('.')]
# fileEx = file[file.find('.')+1:]
# df = pd.read_excel(f"{file}")
# startTime = datetime.datetime.now().timestamp()
# for i in df.index:
# lat = df.loc[i,"activeLat"]
# lng = df.loc[i,"activeLng"]
# # lng = 118.479347
# # lat = 24.659208
# # for i in range(1000):
# # lng += random.randint(-1,1)/10.0
# # lat += random.randint(-1,1)/10.0
# # print(lng,lat)
# data = get_distdetail_by_pos(lng, lat)
# df.loc[i,'province'] = data[1]
# df.loc[i, 'city'] = data[2]
# df.loc[i, 'area'] = data[3]
# endTime = datetime.datetime.now().timestamp()
# df.to_excel(f"{fileName}_re.{fileEx}", index=False)
# print(f"useTime = {endTime - startTime}")
#获取仲利设备,判断最后位置点是否在行政区内
# startTime = datetime.datetime.now().timestamp()
# cursor = fmrsDBConn.cursor()
# sql = f"select tvd.sn from t_vehicle_device tvd left join t_vehicle tv on tv.id = tvd.vehicle_id left join t_user tu on tu.id = tv.created_by " \
# f"left join t_device td on td.sn = tvd.sn where tu.tenant_id = 44 and tv.del_flag = 0 and tvd.bind_status = 1" \
# f" and tvd.del_flag = 0 and tv.del_flag = 0 and tu.del_flag = 0"
# cursor.execute(sql)
# result = cursor.fetchall()
# print(len(result))
# for i in result:
# sn = i[0]
# getLatestGpsRecord(sn)
# endTime = datetime.datetime.now().timestamp()
# print(f"useTime = {endTime - startTime}")
\ No newline at end of file \ No newline at end of file
110101
110102
110103
110104
110105
110106
110107
110108
110109
110110
110111
110122
110221
110222
110223
110224
110226
110228
110229
113711
114107
114108
114502
115002
120101
120102
120103
120104
120105
120106
120107
120108
120109
120110
120111
120112
120113
120114
120221
120222
120223
120224
120225
121000
123412
123456
124100
124101
124107
130100
130102
130103
130104
130105
130106
130107
130108
130121
130122
130123
130124
130125
130126
130127
130128
130129
130130
130131
130132
130133
130181
130182
130183
130184
130185
130202
130203
130204
130205
130206
130211
130221
130222
130223
130224
130225
130226
130227
130228
130229
130230
130281
130282
130283
130302
130303
130304
130321
130322
130323
130324
130402
130403
130404
130406
130421
130422
130423
130424
130425
130426
130427
130428
130429
130430
130431
130432
130433
130434
130435
130481
130502
130503
130521
130522
130523
130524
130525
130526
130527
130528
130529
130530
130531
130532
130533
130534
130535
130581
130582
130602
130603
130604
130621
130622
130623
130624
130625
130626
130627
130628
130629
130630
130631
130632
130633
130634
130635
130636
130637
130638
130681
130682
130683
130684
130700
130702
130703
130704
130705
130706
130707
130720
130721
130722
130723
130724
130725
130726
130727
130728
130729
130730
130731
130732
130733
130802
130803
130804
130821
130822
130823
130824
130825
130826
130827
130828
130902
130903
130904
130921
130922
130923
130924
130925
130926
130927
130928
130929
130930
130952
130981
130982
130983
130984
131002
131022
131023
131024
131025
131026
131081
131082
131102
131121
131122
131123
131124
131125
131126
131127
131128
131131
131181
131182
132121
132122
132123
132124
132126
132127
132128
132129
132130
132132
132133
132135
132201
132202
132222
132223
132224
132225
132226
132227
132228
132229
132231
132232
132233
132235
132301
132302
132321
132322
132323
132324
132325
132326
132329
132330
132331
132332
132333
132335
132336
132337
132401
132402
132404
132421
132423
132424
132425
132426
132427
132428
132429
132430
132432
132433
132434
132435
132436
132437
132438
132439
132440
132441
132521
132522
132523
132524
132525
132526
132527
132528
132529
132530
132532
132533
132622
132623
132624
132626
132627
132628
132629
132801
132821
132823
132825
132826
132827
132828
132829
132902
132903
132922
132923
132924
132926
132927
132928
132929
132930
132931
132932
132934
133001
133022
133023
133024
133025
133026
133027
133028
133029
133030
133031
140102
140103
140104
140105
140106
140107
140108
140109
140113
140121
140122
140123
140181
140202
140203
140211
140212
140221
140222
140223
140224
140225
140226
140227
140302
140303
140311
140321
140322
140402
140411
140421
140426
140428
140429
140430
140431
140481
140502
140511
140521
140522
140523
140524
140525
140581
140602
140603
140621
140622
140623
140624
140722
140724
140727
140729
140821
140823
140824
140825
140826
140827
140829
140881
140924
140928
140981
141029
141034
141082
141121
141122
141124
141125
141127
141182
142126
142131
142201
142202
142222
142223
142225
142226
142227
142228
142229
142230
142231
142232
142233
142234
142301
142302
142303
142322
142325
142326
142327
142328
142329
142330
142332
142333
142401
142402
142422
142423
142424
142427
142429
142430
142431
142433
142601
142602
142603
142622
142623
142625
142628
142629
142631
142632
142634
142635
142701
142702
142703
142723
142724
142725
142726
142727
142729
142730
142731
142732
142733
149001
150102
150103
150104
150105
150121
150122
150123
150124
150125
150202
150203
150204
150205
150206
150207
150221
150222
150223
150302
150303
150304
150402
150403
150404
150421
150422
150423
150424
150425
150426
150428
150429
150430
150502
150521
150522
150523
150524
150526
150621
150625
150627
150722
150723
150821
150823
150824
150826
150921
150922
150923
150924
150925
150926
150927
150928
150929
150981
152031
152101
152102
152103
152104
152105
152106
152122
152123
152125
152126
152127
152128
152129
152130
152131
152201
152202
152221
152222
152223
152224
152301
152302
152321
152322
152323
152324
152325
152326
152327
152501
152502
152522
152523
152524
152525
152526
152527
152528
152529
152530
152531
152601
152621
152622
152623
152624
152625
152626
152627
152628
152629
152630
152631
152632
152633
152634
152701
152722
152723
152724
152725
152726
152727
152728
152801
152822
152823
152824
152825
152826
152827
152921
152923
154238
190984
201904
201978
210102
210103
210104
210105
210106
210111
210112
210113
210114
210121
210122
210123
210124
210181
210202
210203
210204
210211
210212
210213
210219
210221
210222
210224
210225
210281
210282
210283
210302
210303
210304
210311
210319
210321
210323
210381
210402
210403
210404
210411
210421
210422
210423
210502
210503
210504
210505
210521
210522
210602
210603
210604
210621
210622
210623
210624
210682
210702
210703
210705
210711
210719
210723
210724
210725
210726
210727
210781
210782
210802
210803
210804
210811
210821
210824
210881
210882
210902
210903
210904
210905
210911
210921
210922
211002
211003
211004
211005
211011
211021
211022
211081
211102
211103
211121
211122
211202
211203
211204
211221
211222
211223
211224
211225
211226
211281
211282
211302
211303
211319
211321
211322
211323
211324
211325
211381
211382
211402
211403
211404
211421
211422
211481
214324
219007
220022
220102
220103
220104
220105
220106
220111
220112
220121
220122
220123
220124
220125
220181
220182
220183
220202
220203
220204
220211
220221
220222
220223
220224
220225
220281
220282
220283
220284
220302
220303
220319
220322
220323
220324
220381
220382
220402
220403
220421
220422
220501
220502
220503
220519
220521
220523
220524
220581
220582
220602
220603
220621
220622
220623
220625
220681
220702
220721
220722
220723
220724
220802
220821
220822
220881
220882
222301
222302
222303
222304
222323
222324
222325
222326
222327
222328
222401
222402
222403
222404
222405
222406
222421
222423
222424
222425
222426
223344
229001
229002
229005
230102
230103
230104
230105
230106
230107
230108
230119
230121
230122
230123
230124
230125
230126
230127
230128
230129
230181
230182
230183
230184
230202
230203
230204
230206
230207
230208
230221
230222
230223
230224
230225
230226
230227
230229
230230
230231
230281
230301
230302
230303
230304
230305
230306
230307
230321
230381
230402
230403
230404
230405
230406
230421
230422
230502
230503
230504
230505
230506
230521
230522
230523
230524
230602
230603
230604
230605
230606
230621
230622
230623
230624
230702
230703
230704
230705
230706
230707
230708
230709
230711
230712
230713
230714
230715
230722
230802
230803
230804
230805
230811
230819
230822
230823
230826
230827
230828
230829
230830
230831
230832
230833
230834
230881
230882
230902
230903
230904
230921
231002
231003
231004
231005
231011
231022
231023
231024
231025
231026
231027
231081
231083
231084
231085
231102
231121
231123
231124
231181
231182
231202
231221
231222
231223
231226
231281
231282
231283
232101
232102
232103
232125
232126
232127
232128
232130
232131
232301
232302
232303
232321
232323
232324
232325
232326
232329
232330
232331
232332
232602
232622
232623
232625
232626
232700
232721
232722
232724
236457
239004
239005
307079
310101
310102
310103
310104
310105
310106
310107
310108
310109
310110
310111
310112
310113
310114
310115
310116
310221
310222
310223
310224
310225
310226
310227
310228
310229
310230
310979
311300
311322
314500
320102
320103
320104
320106
320107
320111
320112
320113
320121
320123
320124
320125
320202
320203
320211
320219
320222
320223
320281
320282
320283
320301
320302
320303
320304
320305
320311
320321
320322
320323
320324
320325
320326
320328
320381
320382
320401
320402
320404
320405
320411
320421
320422
320423
320481
320482
320483
320501
320502
320503
320504
320520
320521
320523
320524
320525
320581
320582
320583
320586
320602
320611
320621
320622
320623
320624
320625
320626
320681
320682
320683
320684
320703
320704
320705
320706
320721
320722
320723
320724
320802
320804
320811
320819
320821
320822
320823
320825
320826
320827
320828
320829
320830
320831
320881
320882
320902
320911
320919
320921
320922
320923
320924
320925
320926
320928
320981
320982
321001
321002
321003
321011
321020
321022
321023
321024
321025
321026
321027
321028
321081
321082
321083
321084
321085
321086
321087
321088
321101
321102
321119
321121
321122
321123
321124
321181
321182
321183
321201
321202
321281
321282
321283
321284
321302
321321
321322
321323
321324
329012
329677
330102
330104
330106
330121
330123
330124
330127
330183
330184
330203
330204
330205
330206
330211
330219
330222
330224
330225
330226
330227
330281
330282
330283
330302
330303
330304
330321
330322
330323
330324
330325
330326
330327
330328
330329
330381
330382
330411
330419
330421
330424
330425
330481
330482
330501
330502
330521
330522
330523
330621
330622
330623
330624
330625
330681
330682
330683
330702
330703
330719
330721
330722
330723
330724
330725
330726
330727
330781
330782
330802
330821
330823
330824
330825
330881
330902
330903
330921
330922
331002
331003
331004
331021
331022
331023
331081
331082
332501
332502
332522
332524
332525
332526
332527
332528
332529
332601
332602
332603
332621
332623
332624
332625
332626
332627
334703
336003
339005
339011
340102
340103
340104
340111
340121
340122
340123
340202
340204
340211
340221
340222
340223
340302
340303
340304
340311
340321
340322
340323
340403
340404
340406
340421
340503
340521
340602
340603
340604
340621
340702
340711
340721
340802
340803
340811
340821
340822
340823
340824
340825
340826
340827
340828
340881
341002
341003
341004
341021
341022
341023
341024
341102
341103
341122
341124
341125
341126
341127
341181
341182
341202
341203
341204
341221
341222
341223
341224
341225
341226
341227
341281
341282
341302
341321
341322
341324
341521
341522
341602
341621
341622
341623
342101
342122
342123
342124
342125
342126
342127
342128
342129
342130
342201
342221
342222
342224
342225
342321
342326
342327
342401
342421
342422
342423
342425
342426
342427
342501
342502
342522
342523
342524
342529
342530
342531
342601
342622
342623
342625
342626
342701
342723
342821
342822
342823
342824
342825
342826
342829
342830
342901
342921
342922
342923
350102
350103
350104
350111
350121
350122
350123
350124
350125
350126
350127
350128
350181
350182
350203
350204
350205
350206
350211
350212
350221
350301
350302
350303
350321
350322
350402
350403
350420
350421
350423
350424
350425
350426
350427
350428
350430
350481
350500
350502
350505
350521
350522
350524
350525
350526
350581
350582
350583
350600
350621
350622
350623
350624
350625
350627
350628
350629
350681
350702
350721
350722
350723
350724
350725
350781
350782
350783
350784
350802
350821
350822
350823
350824
350825
350881
350921
350922
350924
352101
352102
352121
352122
352124
352127
352129
352201
352202
352203
352224
352225
352226
352227
352228
352229
352230
352231
352601
352602
352622
352623
352624
352625
352627
359001
359002
360101
360102
360103
360104
360105
360111
360121
360122
360123
360124
360202
360203
360211
360212
360222
360281
360301
360302
360311
360312
360313
360321
360401
360402
360403
360421
360422
360423
360424
360425
360426
360427
360428
360429
360430
360481
360502
360521
360602
360621
360622
360681
360702
360721
360722
360723
360724
360725
360726
360727
360728
360729
360730
360731
360732
360733
360734
360735
360781
360782
360823
360825
360827
360828
360881
360902
360981
360982
361027
361127
361129
362101
362102
362103
362121
362122
362123
362124
362125
362126
362127
362128
362129
362130
362131
362132
362133
362134
362135
362136
362137
362201
362202
362203
362204
362221
362222
362223
362226
362227
362228
362229
362232
362233
362301
362302
362321
362322
362323
362324
362325
362326
362329
362330
362331
362333
362334
362401
362402
362421
362422
362423
362424
362425
362426
362427
362428
362429
362430
362431
362432
362501
362502
362522
362523
362524
362525
362526
362527
362528
362529
362531
362532
370000
370102
370103
370104
370105
370111
370112
370121
370122
370123
370124
370125
370126
370162
370181
370202
370203
370205
370211
370212
370213
370214
370221
370222
370223
370224
370226
370281
370282
370283
370284
370285
370302
370303
370304
370305
370306
370321
370322
370323
370364
370382
370402
370403
370404
370405
370406
370421
370426
370481
370502
370503
370521
370522
370523
370602
370611
370612
370620
370622
370623
370624
370625
370627
370628
370629
370630
370631
370632
370633
370634
370653
370681
370682
370683
370684
370685
370686
370687
370702
370703
370704
370705
370721
370722
370723
370724
370725
370726
370727
370728
370729
370781
370782
370783
370784
370785
370786
370802
370811
370822
370823
370825
370826
370827
370828
370829
370830
370831
370832
370881
370882
370883
370902
370911
370919
370920
370921
370922
370923
370981
370982
370983
371002
371007
371021
371081
371082
371083
371100
371102
371103
371121
371122
371202
371203
371227
371231
371302
371311
371312
371320
371321
371322
371323
371324
371325
371326
371327
371328
371329
371330
371358
371401
371402
371421
371422
371423
371424
371425
371426
371427
371428
371481
371482
371502
371521
371522
371523
371524
371525
371526
371581
371837
372022
372301
372321
372323
372324
372325
372328
372330
372351
372401
372402
372421
372422
372423
372424
372425
372426
372427
372428
372429
372430
372431
372432
372501
372502
372522
372523
372524
372525
372526
372527
372730
372801
372802
372822
372823
372824
372826
372827
372829
372830
372831
372832
372833
372901
372922
372923
372924
372925
372926
372927
372928
372929
372930
373934
379005
379008
379009
379012
379013
410000
410101
410102
410103
410104
410105
410106
410107
410108
410111
410112
410121
410122
410123
410124
410125
410126
410181
410182
410183
410184
410185
410202
410203
410204
410205
410211
410221
410222
410223
410224
410225
410235
410302
410303
410304
410305
410306
410311
410321
410322
410323
410324
410325
410326
410327
410328
410329
410381
410402
410403
410404
410405
410411
410421
410422
410423
410425
410426
410432
410481
410482
410502
410503
410504
410506
410511
410521
410522
410523
410526
410527
410581
410602
410603
410611
410621
410622
410700
410702
410703
410704
410711
410718
410721
410722
410723
410724
410725
410726
410727
410728
410729
410781
410782
410791
410802
410803
410804
410811
410821
410822
410823
410824
410825
410826
410827
410881
410882
410883
410901
410902
410922
410923
410926
410927
410928
411002
411022
411023
411024
411025
411081
411082
411102
411103
411121
411122
411123
411202
411221
411222
411223
411224
411227
411234
411281
411282
411302
411303
411321
411322
411323
411324
411325
411326
411327
411328
411329
411330
411381
411402
411403
411421
411422
411423
411424
411425
411426
411481
411502
411503
411521
411522
411523
411524
411526
411527
411528
411602
411621
411622
411623
411625
411627
411628
411721
411723
411724
411726
411729
412301
412321
412322
412323
412324
412325
412326
412327
412328
412701
412702
412721
412722
412723
412724
412725
412726
412727
412728
412729
412801
412821
412822
412823
412824
412825
412826
412827
412828
412829
412901
412902
412921
412922
412923
412924
412925
412926
412927
412928
412929
412930
412931
412932
413001
413021
413022
413023
413024
413025
413026
413027
413028
413029
413926
414072
419003
419004
419006
420101
420102
420103
420104
420105
420106
420107
420111
420112
420113
420114
420115
420116
420117
420121
420122
420123
420124
420202
420203
420204
420221
420222
420281
420300
420302
420303
420321
420322
420323
420324
420325
420381
420400
420500
420502
420503
420504
420506
420521
420525
420526
420527
420528
420529
420581
420582
420583
420601
420602
420603
420606
420607
420619
420620
420621
420622
420623
420624
420625
420626
420682
420683
420684
420700
420702
420703
420704
420800
420801
420802
420803
420804
420821
420822
420881
420901
420902
420921
420922
420923
420924
420982
420983
420984
421000
421002
421003
421004
421022
421023
421024
421081
421083
421087
421102
421121
421122
421123
421124
421125
421126
421127
421181
421182
421202
421221
421222
421223
421224
421281
421302
421381
422101
422103
422121
422123
422124
422125
422126
422127
422128
422129
422130
422201
422202
422204
422223
422224
422225
422226
422228
422301
422302
422322
422323
422324
422325
422326
422327
422403
422406
422421
422422
422423
422424
422425
422426
422427
422428
422429
422431
422432
422601
422622
422623
422624
422625
422626
422701
422702
422721
422722
422723
422724
422725
422729
422801
422802
422822
422823
422825
422826
422827
422828
422921
429001
429003
429004
429005
429006
429021
430102
430103
430104
430105
430111
430121
430122
430123
430124
430132
430181
430202
430203
430204
430211
430219
430221
430223
430224
430225
430281
430302
430303
430304
430305
430311
430312
430321
430322
430381
430382
430402
430403
430404
430405
430406
430407
430408
430411
430412
430419
430421
430422
430423
430424
430425
430426
430481
430482
430502
430503
430511
430521
430522
430523
430524
430525
430526
430527
430528
430529
430581
430602
430603
430611
430621
430622
430623
430624
430625
430626
430681
430682
430702
430703
430715
430721
430722
430723
430724
430725
430726
430781
430802
430811
430821
430822
430902
430903
430921
430922
430923
430981
431002
431003
431021
431022
431023
431024
431025
431026
431027
431028
431081
431102
431103
431121
431122
431123
431124
431125
431126
431127
431128
431129
431202
431221
431222
431223
431224
431225
431226
431227
431228
431229
431230
431281
431321
431322
431381
431382
432013
432301
432302
432321
432322
432325
432326
432401
432402
432421
432422
432423
432424
432425
432426
432427
432501
432502
432503
432522
432524
432621
432622
432623
432624
432625
432626
432627
432801
432802
432821
432822
432823
432824
432826
432827
432828
432829
432831
432901
432902
432922
432923
432924
432925
432926
432927
432928
432929
432930
433001
433002
433021
433022
433023
433024
433025
433026
433027
433029
433030
433031
433101
433102
433122
433123
433124
433125
433126
433127
433130
439004
440102
440103
440104
440105
440106
440107
440111
440112
440121
440122
440124
440125
440126
440127
440181
440182
440183
440184
440202
440203
440204
440221
440222
440223
440224
440225
440226
440227
440228
440229
440232
440233
440281
440282
440301
440304
440306
440307
440321
440400
440401
440402
440421
440500
440501
440502
440504
440505
440506
440507
440508
440509
440510
440511
440513
440520
440521
440522
440523
440524
440525
440526
440527
440528
440582
440583
440601
440602
440603
440605
440608
440620
440621
440622
440623
440624
440681
440682
440683
440684
440701
440702
440711
440721
440722
440723
440724
440725
440726
440727
440781
440782
440783
440784
440785
440801
440802
440803
440804
440811
440821
440822
440823
440824
440825
440881
440882
440883
440902
440903
440921
440922
440923
440924
440981
440982
440983
441072
441202
441203
441221
441222
441223
441224
441225
441226
441227
441228
441229
441230
441281
441282
441283
441284
441301
441302
441303
441321
441322
441323
441324
441381
441402
441421
441422
441423
441424
441425
441426
441427
441481
441501
441502
441521
441522
441523
441581
441602
441611
441621
441622
441623
441624
441625
441701
441702
441703
441721
441722
441723
441781
441801
441802
441811
441821
441822
441823
441824
441825
441826
441827
441881
441882
441900
442000
442501
442521
442522
442524
442525
442526
442527
442528
442529
442530
442531
442801
442821
442822
442823
442824
442825
442826
442827
442829
442830
444000
445102
445121
445122
445201
445202
445221
445222
445223
445224
445281
445302
445321
445322
445323
445381
450000
450102
450103
450104
450105
450106
450108
450109
450111
450121
450122
450123
450124
450126
450127
450202
450203
450204
450205
450211
450221
450222
450223
450225
450302
450303
450304
450305
450311
450321
450322
450323
450324
450325
450326
450327
450328
450329
450330
450331
450332
450402
450403
450404
450405
450411
450421
450422
450423
450481
450501
450502
450503
450511
450512
450521
450525
450602
450603
450621
450681
450702
450703
450721
450722
450802
450803
450804
450821
450881
450902
450903
450921
450922
450923
450924
450981
451022
451024
451029
451031
451221
451223
451224
451227
451228
451229
451281
451302
451322
451402
451423
451425
451481
452101
452122
452123
452124
452126
452127
452128
452129
452130
452131
452132
452133
452201
452223
452224
452225
452226
452227
452228
452229
452230
452231
452322
452323
452324
452325
452327
452328
452329
452330
452331
452332
452402
452421
452423
452424
452425
452426
452427
452428
452501
452502
452503
452507
452522
452523
452524
452525
452526
452527
452528
452601
452622
452623
452624
452625
452626
452627
452628
452629
452630
452631
452632
452701
452702
452722
452723
452724
452725
452726
452727
452728
452729
452730
452731
452802
452821
452822
452824
452826
460002
460003
460004
460006
460007
460021
460022
460024
460025
460026
460027
460028
460029
460030
460031
460032
460033
460034
460035
460036
460100
460102
460103
460104
460200
460203
494164
500101
500102
500103
500104
500105
500106
500107
500108
500109
500110
500111
500112
500113
500115
500221
500222
500223
500224
500225
500226
500227
500228
500229
500230
500231
500232
500233
500234
500235
500236
500237
500238
500239
500240
500241
500242
500243
500381
500382
500383
500384
502109
510102
510103
510104
510105
510106
510107
510108
510111
510112
510113
510115
510121
510122
510123
510124
510125
510126
510127
510128
510129
510130
510131
510132
510181
510182
510183
510184
510202
510203
510211
510212
510213
510214
510215
510216
510217
510218
510219
510221
510222
510223
510224
510225
510226
510227
510228
510229
510230
510231
510232
510281
510282
510283
510302
510303
510304
510311
510321
510322
510402
510403
510411
510421
510422
510502
510503
510504
510521
510522
510523
510524
510525
510602
510603
510622
510623
510624
510625
510626
510681
510682
510702
510703
510704
510721
510722
510723
510724
510725
510726
510727
510781
510802
510811
510812
510821
510822
510823
510824
510902
510903
510904
510921
510922
510923
510925
511002
511011
511021
511022
511023
511024
511025
511026
511027
511028
511081
511102
511111
511112
511113
511121
511122
511123
511124
511126
511127
511128
511129
511130
511131
511132
511133
511181
511202
511203
511204
511221
511222
511223
511224
511225
511226
511227
511228
511300
511302
511303
511304
511321
511322
511323
511324
511325
511381
511421
511502
511521
511522
511523
511524
511525
511526
511527
511528
511529
511602
511621
511622
511623
511681
511702
511902
511922
511923
512002
512021
512201
512221
512222
512223
512224
512225
512226
512227
512228
512229
512301
512322
512323
512324
512326
512328
512329
512501
512527
512528
512529
512530
512531
512532
512533
512534
512535
512901
512902
512903
512921
512922
512923
512924
512925
512926
512927
512928
512929
512930
513001
513002
513021
513022
513023
513024
513025
513026
513027
513028
513029
513030
513031
513032
513101
513122
513123
513124
513125
513126
513127
513128
513221
513223
513224
513225
513226
513227
513228
513229
513230
513231
513232
513321
513322
513323
513324
513325
513326
513329
513330
513331
513332
513333
513334
513335
513336
513337
513338
513401
513422
513423
513424
513425
513426
513427
513428
513429
513430
513431
513432
513433
513434
513435
513436
513437
513521
513522
513523
513524
513525
513601
513621
513622
513623
513624
513700
513701
513713
513721
513722
513723
513821
513822
513823
513824
513825
513826
513901
513902
513922
514100
517321
519001
519002
519003
519004
520102
520103
520111
520112
520113
520114
520121
520122
520123
520181
520201
520202
520203
520221
520222
520322
520323
520324
520326
520330
520382
520402
520421
520422
520423
520424
520425
521301
522101
522121
522122
522123
522124
522125
522126
522127
522128
522129
522130
522131
522132
522201
522221
522222
522223
522224
522225
522226
522227
522228
522229
522230
522301
522321
522322
522323
522324
522325
522326
522327
522328
522401
522421
522422
522423
522424
522425
522426
522427
522428
522501
522502
522521
522522
522523
522524
522525
522526
522527
522528
522529
522530
522601
522622
522623
522624
522625
522626
522627
522628
522629
522630
522631
522632
522633
522634
522635
522636
522701
522702
522722
522723
522724
522725
522726
522727
522728
522729
522730
522731
522732
523205
524100
524101
524113
525101
525106
526101
530102
530103
530111
530112
530113
530121
530122
530123
530124
530125
530126
530127
530128
530129
530181
530200
530302
530321
530322
530323
530324
530325
530326
530328
530381
530402
530421
530422
530423
530424
530425
530426
530427
530428
530502
530524
530602
530621
530622
530623
530624
530625
530627
530628
530629
530802
530821
530824
530826
530902
530922
530923
530926
532101
532122
532123
532124
532125
532126
532127
532128
532129
532130
532131
532201
532223
532224
532225
532226
532227
532228
532231
532233
532301
532322
532323
532324
532325
532326
532327
532328
532329
532331
532401
532422
532423
532424
532425
532426
532427
532428
532429
532501
532502
532522
532523
532524
532525
532526
532527
532528
532529
532530
532531
532532
532621
532622
532623
532624
532625
532626
532627
532628
532701
532721
532722
532723
532724
532725
532726
532727
532728
532729
532730
532801
532822
532823
532901
532922
532923
532924
532925
532926
532927
532928
532929
532930
532931
532932
533001
533022
533023
533024
533025
533102
533103
533121
533122
533123
533124
533125
533221
533222
533223
533224
533321
533323
533324
533325
533421
533422
533423
533521
533522
533523
533524
533525
533526
533527
533528
540102
540121
540122
540123
540124
540125
540127
542121
542126
542129
542133
542221
542222
542223
542224
542301
542321
542322
542323
542325
542326
542328
542329
542334
542421
542422
542423
542425
542427
542430
542523
542623
542626
551891
554153
5555
566184
590996
610102
610103
610104
610111
610112
610113
610114
610115
610116
610121
610122
610123
610124
610125
610126
610131
610202
610203
610221
610222
610302
610303
610306
610321
610322
610323
610324
610326
610327
610328
610329
610330
610402
610403
610404
610421
610422
610423
610424
610425
610426
610427
610428
610429
610430
610431
610481
610502
610521
610522
610523
610524
610525
610526
610527
610528
610581
610582
610602
610621
610622
610623
610624
610625
610626
610627
610628
610629
610630
610631
610632
610921
610925
610926
612101
612102
612124
612125
612126
612127
612128
612129
612130
612132
612133
612222
612301
612321
612322
612323
612324
612325
612326
612327
612328
612329
612330
612401
612421
612422
612423
612424
612425
612426
612427
612428
612429
612430
612501
612522
612523
612524
612525
612526
612527
612601
612621
612622
612623
612624
612625
612626
612627
612628
612629
612630
612632
612701
612722
612723
612724
612725
612726
612727
612728
612729
612730
612731
612732
620102
620103
620104
620105
620111
620121
620122
620123
620201
620202
620302
620321
620401
620402
620403
620421
620422
620423
620502
620503
620521
620522
620523
620524
620525
620802
620825
621002
621022
621027
621121
621122
621123
621125
621126
621223
621225
622101
622102
622103
622123
622124
622125
622126
622201
622222
622223
622224
622225
622226
622301
622322
622323
622326
622421
622424
622425
622426
622427
622428
622429
622621
622623
622624
622625
622626
622627
622628
622629
622630
622701
622722
622723
622724
622725
622726
622727
622801
622821
622822
622823
622824
622825
622826
622827
622901
622921
622922
622923
622924
622925
622926
622927
623001
623021
623022
623023
623024
623025
623026
623027
630102
630103
630104
630105
630121
630122
630123
630203
630225
632121
632122
632123
632124
632125
632126
632127
632128
632221
632222
632223
632224
632321
632322
632323
632421
632520
632521
632522
632523
632524
632525
632621
632622
632623
632624
632625
632626
632721
632722
632723
632724
632725
632726
632801
632802
632821
632822
632823
632824
632825
632826
640102
640103
640104
640105
640106
640111
640121
640122
640181
640202
640203
640204
640205
640211
640221
640222
640223
640300
640302
640321
640322
640323
640324
640381
640382
640402
640422
640423
640424
640502
640521
640522
642101
642102
642103
642122
642123
642124
642125
642126
642127
642221
642222
642223
642224
642225
642226
650101
650102
650103
650104
650105
650106
650107
650108
650109
650121
650202
650203
650204
650205
650300
652101
652122
652123
652201
652222
652223
652226
652301
652302
652322
652323
652324
652325
652326
652327
652328
652401
652402
652421
652422
652423
652425
652427
652428
652501
652522
652523
652524
652526
652527
652601
652623
652624
652625
652626
652701
652721
652722
652723
652800
652801
652822
652823
652824
652825
652826
652827
652828
652829
652842
652901
652922
652923
652924
652925
652926
652927
652928
652929
653001
653021
653022
653023
653024
653101
653121
653122
653123
653124
653125
653126
653127
653128
653129
653130
653131
653201
653221
653222
653223
653224
653225
653226
654001
654002
654021
654022
654023
654024
654025
654026
654027
654101
654121
654122
654123
654124
654125
654126
654127
654128
654201
654202
654221
654222
654223
654224
654225
654226
654301
654321
654322
654323
654324
654325
654326
656565
659001
659004
670537
677136
741528
765159
824453
911100
911101
911200
911201
911202
911300
911301
911302
911303
911304
911305
911306
911307
911308
911309
911310
911311
911403
911409
911501
911502
911503
911504
911506
911508
911509
911529
912021
912101
912102
912103
912106
912107
912108
912111
912112
912201
912202
913010
913100
913101
913102
913201
913203
913204
913205
913206
913209
913210
913211
913212
913301
913302
913303
913401
913407
913411
913415
913501
913502
913505
913601
913602
913603
913604
913606
913607
913608
913609
913610
913611
913700
913701
913702
913703
913704
913707
913710
913711
913713
913714
913716
914010
914100
914101
914102
914103
914104
914105
914106
914107
914108
914109
914110
914111
914112
914113
914116
914117
914168
914201
914203
914205
914211
914213
914225
914228
914301
914302
914303
914304
914305
914306
914307
914309
914310
914311
914312
914313
914331
914400
914401
914403
914404
914405
914406
914407
914412
914413
914417
914418
914419
914420
914452
914500
914501
914502
914503
914504
914505
914506
914507
914508
914509
914510
914511
914512
914513
914514
914690
915000
915001
915002
915100
915101
915104
915105
915106
915107
915108
915109
915110
915111
915113
915114
915115
915116
915117
915118
915119
915120
915134
915201
915202
915203
915205
915209
915226
915227
915300
915301
915303
915304
915305
915306
915307
915308
915323
915325
915326
915329
915331
915333
915334
915400
915402
916100
916101
916103
916104
916105
916106
916107
916108
916109
916110
916111
916200
916201
916202
916204
916206
916207
916209
916210
916211
916229
916300
916301
916321
916322
916323
916325
916328
916329
916331
916400
916401
916402
916403
916404
916405
916411
916412
916500
916501
916502
916522
916523
916528
916529
916531
916540
916590
916650
921301
921304
921305
921306
921309
921311
922308
923201
923205
923210
923212
923302
923501
923502
923505
924101
924201
924206
924302
924305
924311
924312
924401
924402
924403
924404
924406
924407
924409
924412
924413
924414
924415
924416
924418
924419
924452
924453
925001
925002
925101
925107
925111
925113
925201
925301
925305
925306
925307
926201
926501
926590
931301
934501
935101
935303
935309
935333
936101
965010
\ No newline at end of file \ No newline at end of file
import logging
import pandas as pdas
import random
import string
from djcardrenewal.common.dbase.MysqlHelper import MysqlHelper
from djcardrenewal.common.dbase import DbConect
from djcardrenewal.common.sqlcontent import DjSql
from djcardrenewal.common.sqlcontent import CurMonthYzl
from djcardrenewal.common.string.StringBuilder import StringBuilder
print("sys config " + __name__)
log_name = './log/djcardrenewal/imageequity/dealHandelUserDic.log'
log_format = '[%(asctime)s-%(filename)s-%(levelname)s:%(message)s]'
log_level = logging.DEBUG
log_mode = 'a'
logging.basicConfig(filename=log_name, format=log_format, level=log_level, filemode=log_mode)
class HandelUserDic:
handleDescription = ''
handleMonth = ''
hmonth = ''
area_number_list = []
mobileList = []
engineeList = []
idCardList = []
testEquityDb = None
releaseGpsDb = None
def __init__(self, handle_month):
logging.info("init construct bean")
self.handleDescription = "sync user dic from gps db"
self.handleMonth = handle_month
self.hmonth = handle_month.replace('-', '')[2:6]
self.testEquityDb = MysqlHelper(DbConect.test_equity_db)
self.releaseGpsDb = MysqlHelper(DbConect.release_gps_db)
def getRandomEnginee(self):
# ======纯数字生成方案
randomEnginee = ''.join(random.choices('0123456789', k=6))
# ======数字加字母生成方案
# 定义包含数字和大写字母的字符集
# characters = string.ascii_uppercase + string.digits
# 生成随机字符串
# randomEnginee = ''.join(random.choice(characters) for _ in range(6))
return randomEnginee
def getRandomUserCard(self):
# 创建行政区域代码列表
area_number = random.choice(self.area_number_list)
# 创建随机出生年月日
year = random.randint(1980, 2004)
month = random.randint(1, 12)
day = random.randint(1, 28) # 此处简化每月天数,忽略29,30,31日
born_day = f"{year:04d}{month:02d}{day:02d}"
# 创建随机出生顺序码
born_num = random.randint(0, 999)
born_num_final = f"{born_num:03d}"
# 创建校验码
id_card_17 = f"{area_number}{born_day}{born_num_final}"
id_card_everyone = [int(a) for a in id_card_17]
id_card_verify_list = [2, 4, 8, 5, 10, 9, 7, 3, 6, 1, 2, 4, 8, 5, 10, 9, 7]
id_card_verify_1 = (sum(a * b for a, b in zip(id_card_everyone, id_card_verify_list))) % 11
id_card_verify_2 = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2'][id_card_verify_1]
# 合并身份证
id_card = f"{area_number}{born_day}{born_num_final}{id_card_verify_2}"
# 打印身份证
return id_card
def getRandomMobile(self):
# 第二位数字
second = [3, 4, 5, 7, 8][random.randint(0, 4)]
# 第三位数字
third = {
3: random.randint(0, 9),
4: [5, 7, 9][random.randint(0, 2)],
5: [i for i in range(10) if i != 4][random.randint(0, 8)],
7: [i for i in range(10) if i not in [4, 9]][random.randint(0, 7)],
8: random.randint(0, 9),
}[second]
# 最后八位数字
suffix = random.randint(9999999,100000000)
# 拼接手机号
return "1{}{}{}".format(second, third, suffix)
def getRandomEngineeValid(self):
currentEnginee = self.getRandomEnginee()
while currentEnginee in self.engineeList:
currentEnginee = self.getRandomEnginee()
self.engineeList.append(currentEnginee)
return currentEnginee
def getRandomUserCardValid(self):
currentUserCard = self.getRandomUserCard()
while currentUserCard in self.idCardList:
currentUserCard = self.getRandomUserCard()
self.idCardList.append(currentUserCard)
return currentUserCard
def getRandomMobileValid(self):
currentMobile = self.getRandomMobile()
while currentMobile in self.mobileList:
currentMobile = self.getRandomMobile()
self.mobileList.append(currentMobile)
return currentMobile
def dealMainLuoji(self):
selectUserDicSql = f'''select dv.standno,dvi.engineNumber,dvi.plateNumber,dv.name,'身份证' as user_card_type,dvi.IDCard,dv.userTel,dvi.address
from d_vehicle dv
left join d_vehicle_insurance dvi on dv.vehicleId=dvi.vehicleId
where dv.createtime<'2018-01-01 00:00:00' and dvi.engineNumber is null and dvi.IDCard is null and dvi.mobile is null
and length(dv.standno)>7
group by dv.standno ;'''
#查询出GPS的用户数据
gpsDb = self.releaseGpsDb.execute_select(selectUserDicSql)
sqlSb = StringBuilder()
index = 1
sqlSb.append(f'insert into d_vehicle_insurance_2018_02(standno,enginee_number,user_name,user_card_type,user_card_number,mobile) values ')
for item in gpsDb:
standno = item[0]
enginee_number = self.getRandomEnginee()
user_name = item[3]
user_card_type = item[4]
user_card_number = self.getRandomUserCardValid()
mobile = self.getRandomMobileValid()
currentLine = f'''('{standno}','{enginee_number}','{user_name}','{user_card_type}','{user_card_number}','{mobile}'),'''
sqlSb.append(currentLine)
if index%10000==0:
self.executeInsertEndDate(sqlSb, index)
sqlSb = StringBuilder()
sqlSb.append(f'insert into d_vehicle_insurance_2018_02(standno,enginee_number,user_name,user_card_type,user_card_number,mobile) values ')
index = index + 1
# 最后执行一次,保证所有数据都入库
self.executeInsertEndDate(sqlSb, index)
return True
# 插入 到期设备的数据
def executeInsertEndDate(self, sqlSb, index):
if sqlSb is None :
logging.info("db device enddate is none")
return
elif sqlSb is False:
logging.info("db device enddate is exception")
return
sqlSb.append(';')
insertSql = str(sqlSb)[0:-2]+';'
logging.info('insert sql index print:%s', index)
self.testEquityDb.execute_modify(insertSql)
return True
def dealTheMonthData(self):
# 插入设备到期数据
dedRes = handleMain.dealMainLuoji()
logging.info(f'===dealMainLuoji is:{dedRes}')
if __name__ == "__main__":
handle_month = '2024-03'
dedRes = False
diRes = False
urRes = False
# ======================= 处理用户字典数据 =============================
#启动初始化
handleMain = HandelUserDic(handle_month)
logging.info("start handle" + handleMain.handleDescription + ' the month:' + handleMain.handleMonth)
# 读取文件内容
with open('djcardrenewal/imageequity/areadata', 'r', encoding='utf-8') as file:
for line in file:
# 去除行尾换行符,并添加到列表中
handleMain.area_number_list.append(line.strip())
# 将数据存储到 d_vehicle_insurance_2018_02
handleMain.dealTheMonthData()
#print(handleMain.getRandomUserCard())
#print(handleMain.getRandomEnginee())
#print(handleMain.getRandomMobileValid())
#print(handleMain.getRandomMobileValid())
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public interface BaseStationService extends Ice.Object,
_BaseStationServiceOperations, _BaseStationServiceOperationsNC
{
public static final long serialVersionUID = -4927076960967750416L;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class BaseStationServiceHolder extends Ice.ObjectHolderBase<BaseStationService>
{
public
BaseStationServiceHolder()
{
}
public
BaseStationServiceHolder(BaseStationService value)
{
this.value = value;
}
public void
patch(Ice.Object v)
{
if(v == null || v instanceof BaseStationService)
{
value = (BaseStationService)v;
}
else
{
IceInternal.Ex.throwUOE(type(), v);
}
}
public String
type()
{
return _BaseStationServiceDisp.ice_staticId();
}
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public interface BaseStationServicePrx extends Ice.ObjectPrx
{
public boolean GetGpsByBs(BsDataReq req, BsDataRespHolder resp);
public boolean GetGpsByBs(BsDataReq req, BsDataRespHolder resp, java.util.Map<String, String> __ctx);
public Ice.AsyncResult begin_GetGpsByBs(BsDataReq req);
public Ice.AsyncResult begin_GetGpsByBs(BsDataReq req, java.util.Map<String, String> __ctx);
public Ice.AsyncResult begin_GetGpsByBs(BsDataReq req, Ice.Callback __cb);
public Ice.AsyncResult begin_GetGpsByBs(BsDataReq req, java.util.Map<String, String> __ctx, Ice.Callback __cb);
public Ice.AsyncResult begin_GetGpsByBs(BsDataReq req, Callback_BaseStationService_GetGpsByBs __cb);
public Ice.AsyncResult begin_GetGpsByBs(BsDataReq req, java.util.Map<String, String> __ctx, Callback_BaseStationService_GetGpsByBs __cb);
public boolean end_GetGpsByBs(BsDataRespHolder resp, Ice.AsyncResult __result);
public boolean GetGpsByBsList(BsDataListReq req, BsDataRespHolder resp);
public boolean GetGpsByBsList(BsDataListReq req, BsDataRespHolder resp, java.util.Map<String, String> __ctx);
public Ice.AsyncResult begin_GetGpsByBsList(BsDataListReq req);
public Ice.AsyncResult begin_GetGpsByBsList(BsDataListReq req, java.util.Map<String, String> __ctx);
public Ice.AsyncResult begin_GetGpsByBsList(BsDataListReq req, Ice.Callback __cb);
public Ice.AsyncResult begin_GetGpsByBsList(BsDataListReq req, java.util.Map<String, String> __ctx, Ice.Callback __cb);
public Ice.AsyncResult begin_GetGpsByBsList(BsDataListReq req, Callback_BaseStationService_GetGpsByBsList __cb);
public Ice.AsyncResult begin_GetGpsByBsList(BsDataListReq req, java.util.Map<String, String> __ctx, Callback_BaseStationService_GetGpsByBsList __cb);
public boolean end_GetGpsByBsList(BsDataRespHolder resp, Ice.AsyncResult __result);
public boolean getPoiTypeFromGeo(BsPoint pt, DaoPoiInfoRespHolder res);
public boolean getPoiTypeFromGeo(BsPoint pt, DaoPoiInfoRespHolder res, java.util.Map<String, String> __ctx);
public Ice.AsyncResult begin_getPoiTypeFromGeo(BsPoint pt);
public Ice.AsyncResult begin_getPoiTypeFromGeo(BsPoint pt, java.util.Map<String, String> __ctx);
public Ice.AsyncResult begin_getPoiTypeFromGeo(BsPoint pt, Ice.Callback __cb);
public Ice.AsyncResult begin_getPoiTypeFromGeo(BsPoint pt, java.util.Map<String, String> __ctx, Ice.Callback __cb);
public Ice.AsyncResult begin_getPoiTypeFromGeo(BsPoint pt, Callback_BaseStationService_getPoiTypeFromGeo __cb);
public Ice.AsyncResult begin_getPoiTypeFromGeo(BsPoint pt, java.util.Map<String, String> __ctx, Callback_BaseStationService_getPoiTypeFromGeo __cb);
public boolean end_getPoiTypeFromGeo(DaoPoiInfoRespHolder res, Ice.AsyncResult __result);
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class BaseStationServicePrxHelper extends Ice.ObjectPrxHelperBase implements BaseStationServicePrx
{
private static final String __GetGpsByBs_name = "GetGpsByBs";
public boolean GetGpsByBs(BsDataReq req, BsDataRespHolder resp)
{
return GetGpsByBs(req, resp, null, false);
}
public boolean GetGpsByBs(BsDataReq req, BsDataRespHolder resp, java.util.Map<String, String> __ctx)
{
return GetGpsByBs(req, resp, __ctx, true);
}
private boolean GetGpsByBs(BsDataReq req, BsDataRespHolder resp, java.util.Map<String, String> __ctx, boolean __explicitCtx)
{
if(__explicitCtx && __ctx == null)
{
__ctx = _emptyContext;
}
final Ice.Instrumentation.InvocationObserver __observer = IceInternal.ObserverHelper.get(this, "GetGpsByBs", __ctx);
int __cnt = 0;
try
{
while(true)
{
Ice._ObjectDel __delBase = null;
try
{
__checkTwowayOnly("GetGpsByBs");
__delBase = __getDelegate(false);
_BaseStationServiceDel __del = (_BaseStationServiceDel)__delBase;
return __del.GetGpsByBs(req, resp, __ctx, __observer);
}
catch(IceInternal.LocalExceptionWrapper __ex)
{
__handleExceptionWrapper(__delBase, __ex, __observer);
}
catch(Ice.LocalException __ex)
{
__cnt = __handleException(__delBase, __ex, null, __cnt, __observer);
}
}
}
finally
{
if(__observer != null)
{
__observer.detach();
}
}
}
public Ice.AsyncResult begin_GetGpsByBs(BsDataReq req)
{
return begin_GetGpsByBs(req, null, false, null);
}
public Ice.AsyncResult begin_GetGpsByBs(BsDataReq req, java.util.Map<String, String> __ctx)
{
return begin_GetGpsByBs(req, __ctx, true, null);
}
public Ice.AsyncResult begin_GetGpsByBs(BsDataReq req, Ice.Callback __cb)
{
return begin_GetGpsByBs(req, null, false, __cb);
}
public Ice.AsyncResult begin_GetGpsByBs(BsDataReq req, java.util.Map<String, String> __ctx, Ice.Callback __cb)
{
return begin_GetGpsByBs(req, __ctx, true, __cb);
}
public Ice.AsyncResult begin_GetGpsByBs(BsDataReq req, Callback_BaseStationService_GetGpsByBs __cb)
{
return begin_GetGpsByBs(req, null, false, __cb);
}
public Ice.AsyncResult begin_GetGpsByBs(BsDataReq req, java.util.Map<String, String> __ctx, Callback_BaseStationService_GetGpsByBs __cb)
{
return begin_GetGpsByBs(req, __ctx, true, __cb);
}
private Ice.AsyncResult begin_GetGpsByBs(BsDataReq req, java.util.Map<String, String> __ctx, boolean __explicitCtx, IceInternal.CallbackBase __cb)
{
__checkAsyncTwowayOnly(__GetGpsByBs_name);
IceInternal.OutgoingAsync __result = new IceInternal.OutgoingAsync(this, __GetGpsByBs_name, __cb);
try
{
__result.__prepare(__GetGpsByBs_name, Ice.OperationMode.Normal, __ctx, __explicitCtx);
IceInternal.BasicStream __os = __result.__startWriteParams(Ice.FormatType.DefaultFormat);
req.__write(__os);
__result.__endWriteParams();
__result.__send(true);
}
catch(Ice.LocalException __ex)
{
__result.__exceptionAsync(__ex);
}
return __result;
}
public boolean end_GetGpsByBs(BsDataRespHolder resp, Ice.AsyncResult __result)
{
Ice.AsyncResult.__check(__result, this, __GetGpsByBs_name);
boolean __ok = __result.__wait();
try
{
if(!__ok)
{
try
{
__result.__throwUserException();
}
catch(Ice.UserException __ex)
{
throw new Ice.UnknownUserException(__ex.ice_name(), __ex);
}
}
IceInternal.BasicStream __is = __result.__startReadParams();
resp.value = new BsDataResp();
resp.value.__read(__is);
boolean __ret;
__ret = __is.readBool();
__result.__endReadParams();
return __ret;
}
catch(Ice.LocalException ex)
{
Ice.Instrumentation.InvocationObserver __obsv = __result.__getObserver();
if(__obsv != null)
{
__obsv.failed(ex.ice_name());
}
throw ex;
}
}
private static final String __GetGpsByBsList_name = "GetGpsByBsList";
public boolean GetGpsByBsList(BsDataListReq req, BsDataRespHolder resp)
{
return GetGpsByBsList(req, resp, null, false);
}
public boolean GetGpsByBsList(BsDataListReq req, BsDataRespHolder resp, java.util.Map<String, String> __ctx)
{
return GetGpsByBsList(req, resp, __ctx, true);
}
private boolean GetGpsByBsList(BsDataListReq req, BsDataRespHolder resp, java.util.Map<String, String> __ctx, boolean __explicitCtx)
{
if(__explicitCtx && __ctx == null)
{
__ctx = _emptyContext;
}
final Ice.Instrumentation.InvocationObserver __observer = IceInternal.ObserverHelper.get(this, "GetGpsByBsList", __ctx);
int __cnt = 0;
try
{
while(true)
{
Ice._ObjectDel __delBase = null;
try
{
__checkTwowayOnly("GetGpsByBsList");
__delBase = __getDelegate(false);
_BaseStationServiceDel __del = (_BaseStationServiceDel)__delBase;
return __del.GetGpsByBsList(req, resp, __ctx, __observer);
}
catch(IceInternal.LocalExceptionWrapper __ex)
{
__handleExceptionWrapper(__delBase, __ex, __observer);
}
catch(Ice.LocalException __ex)
{
__cnt = __handleException(__delBase, __ex, null, __cnt, __observer);
}
}
}
finally
{
if(__observer != null)
{
__observer.detach();
}
}
}
public Ice.AsyncResult begin_GetGpsByBsList(BsDataListReq req)
{
return begin_GetGpsByBsList(req, null, false, null);
}
public Ice.AsyncResult begin_GetGpsByBsList(BsDataListReq req, java.util.Map<String, String> __ctx)
{
return begin_GetGpsByBsList(req, __ctx, true, null);
}
public Ice.AsyncResult begin_GetGpsByBsList(BsDataListReq req, Ice.Callback __cb)
{
return begin_GetGpsByBsList(req, null, false, __cb);
}
public Ice.AsyncResult begin_GetGpsByBsList(BsDataListReq req, java.util.Map<String, String> __ctx, Ice.Callback __cb)
{
return begin_GetGpsByBsList(req, __ctx, true, __cb);
}
public Ice.AsyncResult begin_GetGpsByBsList(BsDataListReq req, Callback_BaseStationService_GetGpsByBsList __cb)
{
return begin_GetGpsByBsList(req, null, false, __cb);
}
public Ice.AsyncResult begin_GetGpsByBsList(BsDataListReq req, java.util.Map<String, String> __ctx, Callback_BaseStationService_GetGpsByBsList __cb)
{
return begin_GetGpsByBsList(req, __ctx, true, __cb);
}
private Ice.AsyncResult begin_GetGpsByBsList(BsDataListReq req, java.util.Map<String, String> __ctx, boolean __explicitCtx, IceInternal.CallbackBase __cb)
{
__checkAsyncTwowayOnly(__GetGpsByBsList_name);
IceInternal.OutgoingAsync __result = new IceInternal.OutgoingAsync(this, __GetGpsByBsList_name, __cb);
try
{
__result.__prepare(__GetGpsByBsList_name, Ice.OperationMode.Normal, __ctx, __explicitCtx);
IceInternal.BasicStream __os = __result.__startWriteParams(Ice.FormatType.DefaultFormat);
req.__write(__os);
__result.__endWriteParams();
__result.__send(true);
}
catch(Ice.LocalException __ex)
{
__result.__exceptionAsync(__ex);
}
return __result;
}
public boolean end_GetGpsByBsList(BsDataRespHolder resp, Ice.AsyncResult __result)
{
Ice.AsyncResult.__check(__result, this, __GetGpsByBsList_name);
boolean __ok = __result.__wait();
try
{
if(!__ok)
{
try
{
__result.__throwUserException();
}
catch(Ice.UserException __ex)
{
throw new Ice.UnknownUserException(__ex.ice_name(), __ex);
}
}
IceInternal.BasicStream __is = __result.__startReadParams();
resp.value = new BsDataResp();
resp.value.__read(__is);
boolean __ret;
__ret = __is.readBool();
__result.__endReadParams();
return __ret;
}
catch(Ice.LocalException ex)
{
Ice.Instrumentation.InvocationObserver __obsv = __result.__getObserver();
if(__obsv != null)
{
__obsv.failed(ex.ice_name());
}
throw ex;
}
}
private static final String __getPoiTypeFromGeo_name = "getPoiTypeFromGeo";
public boolean getPoiTypeFromGeo(BsPoint pt, DaoPoiInfoRespHolder res)
{
return getPoiTypeFromGeo(pt, res, null, false);
}
public boolean getPoiTypeFromGeo(BsPoint pt, DaoPoiInfoRespHolder res, java.util.Map<String, String> __ctx)
{
return getPoiTypeFromGeo(pt, res, __ctx, true);
}
private boolean getPoiTypeFromGeo(BsPoint pt, DaoPoiInfoRespHolder res, java.util.Map<String, String> __ctx, boolean __explicitCtx)
{
if(__explicitCtx && __ctx == null)
{
__ctx = _emptyContext;
}
final Ice.Instrumentation.InvocationObserver __observer = IceInternal.ObserverHelper.get(this, "getPoiTypeFromGeo", __ctx);
int __cnt = 0;
try
{
while(true)
{
Ice._ObjectDel __delBase = null;
try
{
__checkTwowayOnly("getPoiTypeFromGeo");
__delBase = __getDelegate(false);
_BaseStationServiceDel __del = (_BaseStationServiceDel)__delBase;
return __del.getPoiTypeFromGeo(pt, res, __ctx, __observer);
}
catch(IceInternal.LocalExceptionWrapper __ex)
{
__handleExceptionWrapper(__delBase, __ex, __observer);
}
catch(Ice.LocalException __ex)
{
__cnt = __handleException(__delBase, __ex, null, __cnt, __observer);
}
}
}
finally
{
if(__observer != null)
{
__observer.detach();
}
}
}
public Ice.AsyncResult begin_getPoiTypeFromGeo(BsPoint pt)
{
return begin_getPoiTypeFromGeo(pt, null, false, null);
}
public Ice.AsyncResult begin_getPoiTypeFromGeo(BsPoint pt, java.util.Map<String, String> __ctx)
{
return begin_getPoiTypeFromGeo(pt, __ctx, true, null);
}
public Ice.AsyncResult begin_getPoiTypeFromGeo(BsPoint pt, Ice.Callback __cb)
{
return begin_getPoiTypeFromGeo(pt, null, false, __cb);
}
public Ice.AsyncResult begin_getPoiTypeFromGeo(BsPoint pt, java.util.Map<String, String> __ctx, Ice.Callback __cb)
{
return begin_getPoiTypeFromGeo(pt, __ctx, true, __cb);
}
public Ice.AsyncResult begin_getPoiTypeFromGeo(BsPoint pt, Callback_BaseStationService_getPoiTypeFromGeo __cb)
{
return begin_getPoiTypeFromGeo(pt, null, false, __cb);
}
public Ice.AsyncResult begin_getPoiTypeFromGeo(BsPoint pt, java.util.Map<String, String> __ctx, Callback_BaseStationService_getPoiTypeFromGeo __cb)
{
return begin_getPoiTypeFromGeo(pt, __ctx, true, __cb);
}
private Ice.AsyncResult begin_getPoiTypeFromGeo(BsPoint pt, java.util.Map<String, String> __ctx, boolean __explicitCtx, IceInternal.CallbackBase __cb)
{
__checkAsyncTwowayOnly(__getPoiTypeFromGeo_name);
IceInternal.OutgoingAsync __result = new IceInternal.OutgoingAsync(this, __getPoiTypeFromGeo_name, __cb);
try
{
__result.__prepare(__getPoiTypeFromGeo_name, Ice.OperationMode.Normal, __ctx, __explicitCtx);
IceInternal.BasicStream __os = __result.__startWriteParams(Ice.FormatType.DefaultFormat);
pt.__write(__os);
__result.__endWriteParams();
__result.__send(true);
}
catch(Ice.LocalException __ex)
{
__result.__exceptionAsync(__ex);
}
return __result;
}
public boolean end_getPoiTypeFromGeo(DaoPoiInfoRespHolder res, Ice.AsyncResult __result)
{
Ice.AsyncResult.__check(__result, this, __getPoiTypeFromGeo_name);
boolean __ok = __result.__wait();
try
{
if(!__ok)
{
try
{
__result.__throwUserException();
}
catch(Ice.UserException __ex)
{
throw new Ice.UnknownUserException(__ex.ice_name(), __ex);
}
}
IceInternal.BasicStream __is = __result.__startReadParams();
res.value = new DaoPoiInfoResp();
res.value.__read(__is);
boolean __ret;
__ret = __is.readBool();
__result.__endReadParams();
return __ret;
}
catch(Ice.LocalException ex)
{
Ice.Instrumentation.InvocationObserver __obsv = __result.__getObserver();
if(__obsv != null)
{
__obsv.failed(ex.ice_name());
}
throw ex;
}
}
public static BaseStationServicePrx checkedCast(Ice.ObjectPrx __obj)
{
BaseStationServicePrx __d = null;
if(__obj != null)
{
if(__obj instanceof BaseStationServicePrx)
{
__d = (BaseStationServicePrx)__obj;
}
else
{
if(__obj.ice_isA(ice_staticId()))
{
BaseStationServicePrxHelper __h = new BaseStationServicePrxHelper();
__h.__copyFrom(__obj);
__d = __h;
}
}
}
return __d;
}
public static BaseStationServicePrx checkedCast(Ice.ObjectPrx __obj, java.util.Map<String, String> __ctx)
{
BaseStationServicePrx __d = null;
if(__obj != null)
{
if(__obj instanceof BaseStationServicePrx)
{
__d = (BaseStationServicePrx)__obj;
}
else
{
if(__obj.ice_isA(ice_staticId(), __ctx))
{
BaseStationServicePrxHelper __h = new BaseStationServicePrxHelper();
__h.__copyFrom(__obj);
__d = __h;
}
}
}
return __d;
}
public static BaseStationServicePrx checkedCast(Ice.ObjectPrx __obj, String __facet)
{
BaseStationServicePrx __d = null;
if(__obj != null)
{
Ice.ObjectPrx __bb = __obj.ice_facet(__facet);
try
{
if(__bb.ice_isA(ice_staticId()))
{
BaseStationServicePrxHelper __h = new BaseStationServicePrxHelper();
__h.__copyFrom(__bb);
__d = __h;
}
}
catch(Ice.FacetNotExistException ex)
{
}
}
return __d;
}
public static BaseStationServicePrx checkedCast(Ice.ObjectPrx __obj, String __facet, java.util.Map<String, String> __ctx)
{
BaseStationServicePrx __d = null;
if(__obj != null)
{
Ice.ObjectPrx __bb = __obj.ice_facet(__facet);
try
{
if(__bb.ice_isA(ice_staticId(), __ctx))
{
BaseStationServicePrxHelper __h = new BaseStationServicePrxHelper();
__h.__copyFrom(__bb);
__d = __h;
}
}
catch(Ice.FacetNotExistException ex)
{
}
}
return __d;
}
public static BaseStationServicePrx uncheckedCast(Ice.ObjectPrx __obj)
{
BaseStationServicePrx __d = null;
if(__obj != null)
{
if(__obj instanceof BaseStationServicePrx)
{
__d = (BaseStationServicePrx)__obj;
}
else
{
BaseStationServicePrxHelper __h = new BaseStationServicePrxHelper();
__h.__copyFrom(__obj);
__d = __h;
}
}
return __d;
}
public static BaseStationServicePrx uncheckedCast(Ice.ObjectPrx __obj, String __facet)
{
BaseStationServicePrx __d = null;
if(__obj != null)
{
Ice.ObjectPrx __bb = __obj.ice_facet(__facet);
BaseStationServicePrxHelper __h = new BaseStationServicePrxHelper();
__h.__copyFrom(__bb);
__d = __h;
}
return __d;
}
public static final String[] __ids =
{
"::BaseStationData::BaseStationService",
"::Ice::Object"
};
public static String ice_staticId()
{
return __ids[0];
}
protected Ice._ObjectDelM __createDelegateM()
{
return new _BaseStationServiceDelM();
}
protected Ice._ObjectDelD __createDelegateD()
{
return new _BaseStationServiceDelD();
}
public static void __write(IceInternal.BasicStream __os, BaseStationServicePrx v)
{
__os.writeProxy(v);
}
public static BaseStationServicePrx __read(IceInternal.BasicStream __is)
{
Ice.ObjectPrx proxy = __is.readProxy();
if(proxy != null)
{
BaseStationServicePrxHelper result = new BaseStationServicePrxHelper();
result.__copyFrom(proxy);
return result;
}
return null;
}
public static final long serialVersionUID = 0L;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class BaseStationServicePrxHolder
{
public
BaseStationServicePrxHolder()
{
}
public
BaseStationServicePrxHolder(BaseStationServicePrx value)
{
this.value = value;
}
public BaseStationServicePrx value;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public class BsData implements java.lang.Cloneable, java.io.Serializable
{
public int mnc;
public int lac;
public int cellid;
public BsData()
{
}
public BsData(int mnc, int lac, int cellid)
{
this.mnc = mnc;
this.lac = lac;
this.cellid = cellid;
}
public boolean
equals(java.lang.Object rhs)
{
if(this == rhs)
{
return true;
}
BsData _r = null;
if(rhs instanceof BsData)
{
_r = (BsData)rhs;
}
if(_r != null)
{
if(mnc != _r.mnc)
{
return false;
}
if(lac != _r.lac)
{
return false;
}
if(cellid != _r.cellid)
{
return false;
}
return true;
}
return false;
}
public int
hashCode()
{
int __h = 5381;
__h = IceInternal.HashUtil.hashAdd(__h, "::BaseStationData::BsData");
__h = IceInternal.HashUtil.hashAdd(__h, mnc);
__h = IceInternal.HashUtil.hashAdd(__h, lac);
__h = IceInternal.HashUtil.hashAdd(__h, cellid);
return __h;
}
public java.lang.Object
clone()
{
java.lang.Object o = null;
try
{
o = super.clone();
}
catch(CloneNotSupportedException ex)
{
assert false; // impossible
}
return o;
}
public void
__write(IceInternal.BasicStream __os)
{
__os.writeInt(mnc);
__os.writeInt(lac);
__os.writeInt(cellid);
}
public void
__read(IceInternal.BasicStream __is)
{
mnc = __is.readInt();
lac = __is.readInt();
cellid = __is.readInt();
}
public static final long serialVersionUID = -1180175726157969065L;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class BsDataHolder
{
public
BsDataHolder()
{
}
public
BsDataHolder(BsData value)
{
this.value = value;
}
public BsData value;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public class BsDataListReq implements java.lang.Cloneable, java.io.Serializable
{
public BsData[] bsList;
public BsDataListReq()
{
}
public BsDataListReq(BsData[] bsList)
{
this.bsList = bsList;
}
public boolean
equals(java.lang.Object rhs)
{
if(this == rhs)
{
return true;
}
BsDataListReq _r = null;
if(rhs instanceof BsDataListReq)
{
_r = (BsDataListReq)rhs;
}
if(_r != null)
{
if(!java.util.Arrays.equals(bsList, _r.bsList))
{
return false;
}
return true;
}
return false;
}
public int
hashCode()
{
int __h = 5381;
__h = IceInternal.HashUtil.hashAdd(__h, "::BaseStationData::BsDataListReq");
__h = IceInternal.HashUtil.hashAdd(__h, bsList);
return __h;
}
public java.lang.Object
clone()
{
java.lang.Object o = null;
try
{
o = super.clone();
}
catch(CloneNotSupportedException ex)
{
assert false; // impossible
}
return o;
}
public void
__write(IceInternal.BasicStream __os)
{
BsListReqHelper.write(__os, bsList);
}
public void
__read(IceInternal.BasicStream __is)
{
bsList = BsListReqHelper.read(__is);
}
public static final long serialVersionUID = 3819908727059142693L;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class BsDataListReqHolder
{
public
BsDataListReqHolder()
{
}
public
BsDataListReqHolder(BsDataListReq value)
{
this.value = value;
}
public BsDataListReq value;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public class BsDataReq implements java.lang.Cloneable, java.io.Serializable
{
public BsData bs;
public BsDataReq()
{
}
public BsDataReq(BsData bs)
{
this.bs = bs;
}
public boolean
equals(java.lang.Object rhs)
{
if(this == rhs)
{
return true;
}
BsDataReq _r = null;
if(rhs instanceof BsDataReq)
{
_r = (BsDataReq)rhs;
}
if(_r != null)
{
if(bs != _r.bs)
{
if(bs == null || _r.bs == null || !bs.equals(_r.bs))
{
return false;
}
}
return true;
}
return false;
}
public int
hashCode()
{
int __h = 5381;
__h = IceInternal.HashUtil.hashAdd(__h, "::BaseStationData::BsDataReq");
__h = IceInternal.HashUtil.hashAdd(__h, bs);
return __h;
}
public java.lang.Object
clone()
{
java.lang.Object o = null;
try
{
o = super.clone();
}
catch(CloneNotSupportedException ex)
{
assert false; // impossible
}
return o;
}
public void
__write(IceInternal.BasicStream __os)
{
bs.__write(__os);
}
public void
__read(IceInternal.BasicStream __is)
{
bs = new BsData();
bs.__read(__is);
}
public static final long serialVersionUID = -7067405279854981467L;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class BsDataReqHolder
{
public
BsDataReqHolder()
{
}
public
BsDataReqHolder(BsDataReq value)
{
this.value = value;
}
public BsDataReq value;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public class BsDataResp implements java.lang.Cloneable, java.io.Serializable
{
public int ret;
public GpsData gps;
public BsDataResp()
{
}
public BsDataResp(int ret, GpsData gps)
{
this.ret = ret;
this.gps = gps;
}
public boolean
equals(java.lang.Object rhs)
{
if(this == rhs)
{
return true;
}
BsDataResp _r = null;
if(rhs instanceof BsDataResp)
{
_r = (BsDataResp)rhs;
}
if(_r != null)
{
if(ret != _r.ret)
{
return false;
}
if(gps != _r.gps)
{
if(gps == null || _r.gps == null || !gps.equals(_r.gps))
{
return false;
}
}
return true;
}
return false;
}
public int
hashCode()
{
int __h = 5381;
__h = IceInternal.HashUtil.hashAdd(__h, "::BaseStationData::BsDataResp");
__h = IceInternal.HashUtil.hashAdd(__h, ret);
__h = IceInternal.HashUtil.hashAdd(__h, gps);
return __h;
}
public java.lang.Object
clone()
{
java.lang.Object o = null;
try
{
o = super.clone();
}
catch(CloneNotSupportedException ex)
{
assert false; // impossible
}
return o;
}
public void
__write(IceInternal.BasicStream __os)
{
__os.writeInt(ret);
gps.__write(__os);
}
public void
__read(IceInternal.BasicStream __is)
{
ret = __is.readInt();
gps = new GpsData();
gps.__read(__is);
}
public static final long serialVersionUID = 2440970033832249670L;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class BsDataRespHolder
{
public
BsDataRespHolder()
{
}
public
BsDataRespHolder(BsDataResp value)
{
this.value = value;
}
public BsDataResp value;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class BsListReqHelper
{
public static void
write(IceInternal.BasicStream __os, BsData[] __v)
{
if(__v == null)
{
__os.writeSize(0);
}
else
{
__os.writeSize(__v.length);
for(int __i0 = 0; __i0 < __v.length; __i0++)
{
__v[__i0].__write(__os);
}
}
}
public static BsData[]
read(IceInternal.BasicStream __is)
{
BsData[] __v;
final int __len0 = __is.readAndCheckSeqSize(12);
__v = new BsData[__len0];
for(int __i0 = 0; __i0 < __len0; __i0++)
{
__v[__i0] = new BsData();
__v[__i0].__read(__is);
}
return __v;
}
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class BsListReqHolder
{
public
BsListReqHolder()
{
}
public
BsListReqHolder(BsData[] value)
{
this.value = value;
}
public BsData[] value;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public class BsPoint implements java.lang.Cloneable, java.io.Serializable
{
public float lng;
public float lat;
public BsPoint()
{
}
public BsPoint(float lng, float lat)
{
this.lng = lng;
this.lat = lat;
}
public boolean
equals(java.lang.Object rhs)
{
if(this == rhs)
{
return true;
}
BsPoint _r = null;
if(rhs instanceof BsPoint)
{
_r = (BsPoint)rhs;
}
if(_r != null)
{
if(lng != _r.lng)
{
return false;
}
if(lat != _r.lat)
{
return false;
}
return true;
}
return false;
}
public int
hashCode()
{
int __h = 5381;
__h = IceInternal.HashUtil.hashAdd(__h, "::BaseStationData::BsPoint");
__h = IceInternal.HashUtil.hashAdd(__h, lng);
__h = IceInternal.HashUtil.hashAdd(__h, lat);
return __h;
}
public java.lang.Object
clone()
{
java.lang.Object o = null;
try
{
o = super.clone();
}
catch(CloneNotSupportedException ex)
{
assert false; // impossible
}
return o;
}
public void
__write(IceInternal.BasicStream __os)
{
__os.writeFloat(lng);
__os.writeFloat(lat);
}
public void
__read(IceInternal.BasicStream __is)
{
lng = __is.readFloat();
lat = __is.readFloat();
}
public static final long serialVersionUID = -2591565704925713803L;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class BsPointHolder
{
public
BsPointHolder()
{
}
public
BsPointHolder(BsPoint value)
{
this.value = value;
}
public BsPoint value;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public abstract class Callback_BaseStationService_GetGpsByBs extends Ice.TwowayCallback
{
public abstract void response(boolean __ret, BsDataResp resp);
public final void __completed(Ice.AsyncResult __result)
{
BaseStationServicePrx __proxy = (BaseStationServicePrx)__result.getProxy();
boolean __ret = false;
BsDataRespHolder resp = new BsDataRespHolder();
try
{
__ret = __proxy.end_GetGpsByBs(resp, __result);
}
catch(Ice.LocalException __ex)
{
exception(__ex);
return;
}
response(__ret, resp.value);
}
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public abstract class Callback_BaseStationService_GetGpsByBsList extends Ice.TwowayCallback
{
public abstract void response(boolean __ret, BsDataResp resp);
public final void __completed(Ice.AsyncResult __result)
{
BaseStationServicePrx __proxy = (BaseStationServicePrx)__result.getProxy();
boolean __ret = false;
BsDataRespHolder resp = new BsDataRespHolder();
try
{
__ret = __proxy.end_GetGpsByBsList(resp, __result);
}
catch(Ice.LocalException __ex)
{
exception(__ex);
return;
}
response(__ret, resp.value);
}
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public abstract class Callback_BaseStationService_getPoiTypeFromGeo extends Ice.TwowayCallback
{
public abstract void response(boolean __ret, DaoPoiInfoResp res);
public final void __completed(Ice.AsyncResult __result)
{
BaseStationServicePrx __proxy = (BaseStationServicePrx)__result.getProxy();
boolean __ret = false;
DaoPoiInfoRespHolder res = new DaoPoiInfoRespHolder();
try
{
__ret = __proxy.end_getPoiTypeFromGeo(res, __result);
}
catch(Ice.LocalException __ex)
{
exception(__ex);
return;
}
response(__ret, res.value);
}
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public class DaoPoiInfoResp implements java.lang.Cloneable, java.io.Serializable
{
public int size;
public PoiInfo[] records;
public DaoPoiInfoResp()
{
}
public DaoPoiInfoResp(int size, PoiInfo[] records)
{
this.size = size;
this.records = records;
}
public boolean
equals(java.lang.Object rhs)
{
if(this == rhs)
{
return true;
}
DaoPoiInfoResp _r = null;
if(rhs instanceof DaoPoiInfoResp)
{
_r = (DaoPoiInfoResp)rhs;
}
if(_r != null)
{
if(size != _r.size)
{
return false;
}
if(!java.util.Arrays.equals(records, _r.records))
{
return false;
}
return true;
}
return false;
}
public int
hashCode()
{
int __h = 5381;
__h = IceInternal.HashUtil.hashAdd(__h, "::BaseStationData::DaoPoiInfoResp");
__h = IceInternal.HashUtil.hashAdd(__h, size);
__h = IceInternal.HashUtil.hashAdd(__h, records);
return __h;
}
public java.lang.Object
clone()
{
java.lang.Object o = null;
try
{
o = super.clone();
}
catch(CloneNotSupportedException ex)
{
assert false; // impossible
}
return o;
}
public void
__write(IceInternal.BasicStream __os)
{
__os.writeInt(size);
poiDatasHelper.write(__os, records);
}
public void
__read(IceInternal.BasicStream __is)
{
size = __is.readInt();
records = poiDatasHelper.read(__is);
}
public static final long serialVersionUID = 6922468175968905097L;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class DaoPoiInfoRespHolder
{
public
DaoPoiInfoRespHolder()
{
}
public
DaoPoiInfoRespHolder(DaoPoiInfoResp value)
{
this.value = value;
}
public DaoPoiInfoResp value;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public class GpsData implements java.lang.Cloneable, java.io.Serializable
{
public int lng;
public int lat;
public String addr;
public GpsData()
{
}
public GpsData(int lng, int lat, String addr)
{
this.lng = lng;
this.lat = lat;
this.addr = addr;
}
public boolean
equals(java.lang.Object rhs)
{
if(this == rhs)
{
return true;
}
GpsData _r = null;
if(rhs instanceof GpsData)
{
_r = (GpsData)rhs;
}
if(_r != null)
{
if(lng != _r.lng)
{
return false;
}
if(lat != _r.lat)
{
return false;
}
if(addr != _r.addr)
{
if(addr == null || _r.addr == null || !addr.equals(_r.addr))
{
return false;
}
}
return true;
}
return false;
}
public int
hashCode()
{
int __h = 5381;
__h = IceInternal.HashUtil.hashAdd(__h, "::BaseStationData::GpsData");
__h = IceInternal.HashUtil.hashAdd(__h, lng);
__h = IceInternal.HashUtil.hashAdd(__h, lat);
__h = IceInternal.HashUtil.hashAdd(__h, addr);
return __h;
}
public java.lang.Object
clone()
{
java.lang.Object o = null;
try
{
o = super.clone();
}
catch(CloneNotSupportedException ex)
{
assert false; // impossible
}
return o;
}
public void
__write(IceInternal.BasicStream __os)
{
__os.writeInt(lng);
__os.writeInt(lat);
__os.writeString(addr);
}
public void
__read(IceInternal.BasicStream __is)
{
lng = __is.readInt();
lat = __is.readInt();
addr = __is.readString();
}
public static final long serialVersionUID = -2420777293799941752L;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class GpsDataHolder
{
public
GpsDataHolder()
{
}
public
GpsDataHolder(GpsData value)
{
this.value = value;
}
public GpsData value;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public class PoiInfo implements java.lang.Cloneable, java.io.Serializable
{
public float distance;
public String type;
public PoiInfo()
{
}
public PoiInfo(float distance, String type)
{
this.distance = distance;
this.type = type;
}
public boolean
equals(java.lang.Object rhs)
{
if(this == rhs)
{
return true;
}
PoiInfo _r = null;
if(rhs instanceof PoiInfo)
{
_r = (PoiInfo)rhs;
}
if(_r != null)
{
if(distance != _r.distance)
{
return false;
}
if(type != _r.type)
{
if(type == null || _r.type == null || !type.equals(_r.type))
{
return false;
}
}
return true;
}
return false;
}
public int
hashCode()
{
int __h = 5381;
__h = IceInternal.HashUtil.hashAdd(__h, "::BaseStationData::PoiInfo");
__h = IceInternal.HashUtil.hashAdd(__h, distance);
__h = IceInternal.HashUtil.hashAdd(__h, type);
return __h;
}
public java.lang.Object
clone()
{
java.lang.Object o = null;
try
{
o = super.clone();
}
catch(CloneNotSupportedException ex)
{
assert false; // impossible
}
return o;
}
public void
__write(IceInternal.BasicStream __os)
{
__os.writeFloat(distance);
__os.writeString(type);
}
public void
__read(IceInternal.BasicStream __is)
{
distance = __is.readFloat();
type = __is.readString();
}
public static final long serialVersionUID = 129041973163109527L;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class PoiInfoHolder
{
public
PoiInfoHolder()
{
}
public
PoiInfoHolder(PoiInfo value)
{
this.value = value;
}
public PoiInfo value;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public interface _BaseStationServiceDel extends Ice._ObjectDel
{
boolean GetGpsByBs(BsDataReq req, BsDataRespHolder resp, java.util.Map<String, String> __ctx, Ice.Instrumentation.InvocationObserver __obsv)
throws IceInternal.LocalExceptionWrapper;
boolean GetGpsByBsList(BsDataListReq req, BsDataRespHolder resp, java.util.Map<String, String> __ctx, Ice.Instrumentation.InvocationObserver __obsv)
throws IceInternal.LocalExceptionWrapper;
boolean getPoiTypeFromGeo(BsPoint pt, DaoPoiInfoRespHolder res, java.util.Map<String, String> __ctx, Ice.Instrumentation.InvocationObserver __obsv)
throws IceInternal.LocalExceptionWrapper;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class _BaseStationServiceDelD extends Ice._ObjectDelD implements _BaseStationServiceDel
{
public boolean GetGpsByBs(final BsDataReq req, final BsDataRespHolder resp, java.util.Map<String, String> __ctx, Ice.Instrumentation.InvocationObserver __observer)
throws IceInternal.LocalExceptionWrapper
{
final Ice.Current __current = new Ice.Current();
__initCurrent(__current, "GetGpsByBs", Ice.OperationMode.Normal, __ctx);
final Ice.BooleanHolder __result = new Ice.BooleanHolder();
IceInternal.Direct __direct = null;
try
{
__direct = new IceInternal.Direct(__current)
{
public Ice.DispatchStatus run(Ice.Object __obj)
{
BaseStationService __servant = null;
if(__obj == null || __obj instanceof BaseStationService)
{
__servant = (BaseStationService)__obj;
}
else
{
throw new Ice.OperationNotExistException(__current.id, __current.facet, __current.operation);
}
__result.value = __servant.GetGpsByBs(req, resp, __current);
return Ice.DispatchStatus.DispatchOK;
}
};
try
{
Ice.DispatchStatus __status = __direct.getServant().__collocDispatch(__direct);
if(__status == Ice.DispatchStatus.DispatchUserException)
{
__direct.throwUserException();
}
assert __status == Ice.DispatchStatus.DispatchOK;
return __result.value;
}
finally
{
__direct.destroy();
}
}
catch(Ice.SystemException __ex)
{
throw __ex;
}
catch(java.lang.Throwable __ex)
{
IceInternal.LocalExceptionWrapper.throwWrapper(__ex);
}
return __result.value;
}
public boolean GetGpsByBsList(final BsDataListReq req, final BsDataRespHolder resp, java.util.Map<String, String> __ctx, Ice.Instrumentation.InvocationObserver __observer)
throws IceInternal.LocalExceptionWrapper
{
final Ice.Current __current = new Ice.Current();
__initCurrent(__current, "GetGpsByBsList", Ice.OperationMode.Normal, __ctx);
final Ice.BooleanHolder __result = new Ice.BooleanHolder();
IceInternal.Direct __direct = null;
try
{
__direct = new IceInternal.Direct(__current)
{
public Ice.DispatchStatus run(Ice.Object __obj)
{
BaseStationService __servant = null;
if(__obj == null || __obj instanceof BaseStationService)
{
__servant = (BaseStationService)__obj;
}
else
{
throw new Ice.OperationNotExistException(__current.id, __current.facet, __current.operation);
}
__result.value = __servant.GetGpsByBsList(req, resp, __current);
return Ice.DispatchStatus.DispatchOK;
}
};
try
{
Ice.DispatchStatus __status = __direct.getServant().__collocDispatch(__direct);
if(__status == Ice.DispatchStatus.DispatchUserException)
{
__direct.throwUserException();
}
assert __status == Ice.DispatchStatus.DispatchOK;
return __result.value;
}
finally
{
__direct.destroy();
}
}
catch(Ice.SystemException __ex)
{
throw __ex;
}
catch(java.lang.Throwable __ex)
{
IceInternal.LocalExceptionWrapper.throwWrapper(__ex);
}
return __result.value;
}
public boolean getPoiTypeFromGeo(final BsPoint pt, final DaoPoiInfoRespHolder res, java.util.Map<String, String> __ctx, Ice.Instrumentation.InvocationObserver __observer)
throws IceInternal.LocalExceptionWrapper
{
final Ice.Current __current = new Ice.Current();
__initCurrent(__current, "getPoiTypeFromGeo", Ice.OperationMode.Normal, __ctx);
final Ice.BooleanHolder __result = new Ice.BooleanHolder();
IceInternal.Direct __direct = null;
try
{
__direct = new IceInternal.Direct(__current)
{
public Ice.DispatchStatus run(Ice.Object __obj)
{
BaseStationService __servant = null;
if(__obj == null || __obj instanceof BaseStationService)
{
__servant = (BaseStationService)__obj;
}
else
{
throw new Ice.OperationNotExistException(__current.id, __current.facet, __current.operation);
}
__result.value = __servant.getPoiTypeFromGeo(pt, res, __current);
return Ice.DispatchStatus.DispatchOK;
}
};
try
{
Ice.DispatchStatus __status = __direct.getServant().__collocDispatch(__direct);
if(__status == Ice.DispatchStatus.DispatchUserException)
{
__direct.throwUserException();
}
assert __status == Ice.DispatchStatus.DispatchOK;
return __result.value;
}
finally
{
__direct.destroy();
}
}
catch(Ice.SystemException __ex)
{
throw __ex;
}
catch(java.lang.Throwable __ex)
{
IceInternal.LocalExceptionWrapper.throwWrapper(__ex);
}
return __result.value;
}
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class _BaseStationServiceDelM extends Ice._ObjectDelM implements _BaseStationServiceDel
{
public boolean
GetGpsByBs(BsDataReq req, BsDataRespHolder resp, java.util.Map<String, String> __ctx, Ice.Instrumentation.InvocationObserver __observer)
throws IceInternal.LocalExceptionWrapper
{
IceInternal.Outgoing __og = __handler.getOutgoing("GetGpsByBs", Ice.OperationMode.Normal, __ctx, __observer);
try
{
try
{
IceInternal.BasicStream __os = __og.startWriteParams(Ice.FormatType.DefaultFormat);
req.__write(__os);
__og.endWriteParams();
}
catch(Ice.LocalException __ex)
{
__og.abort(__ex);
}
boolean __ok = __og.invoke();
try
{
if(!__ok)
{
try
{
__og.throwUserException();
}
catch(Ice.UserException __ex)
{
throw new Ice.UnknownUserException(__ex.ice_name(), __ex);
}
}
IceInternal.BasicStream __is = __og.startReadParams();
resp.value = new BsDataResp();
resp.value.__read(__is);
boolean __ret;
__ret = __is.readBool();
__og.endReadParams();
return __ret;
}
catch(Ice.LocalException __ex)
{
throw new IceInternal.LocalExceptionWrapper(__ex, false);
}
}
finally
{
__handler.reclaimOutgoing(__og);
}
}
public boolean
GetGpsByBsList(BsDataListReq req, BsDataRespHolder resp, java.util.Map<String, String> __ctx, Ice.Instrumentation.InvocationObserver __observer)
throws IceInternal.LocalExceptionWrapper
{
IceInternal.Outgoing __og = __handler.getOutgoing("GetGpsByBsList", Ice.OperationMode.Normal, __ctx, __observer);
try
{
try
{
IceInternal.BasicStream __os = __og.startWriteParams(Ice.FormatType.DefaultFormat);
req.__write(__os);
__og.endWriteParams();
}
catch(Ice.LocalException __ex)
{
__og.abort(__ex);
}
boolean __ok = __og.invoke();
try
{
if(!__ok)
{
try
{
__og.throwUserException();
}
catch(Ice.UserException __ex)
{
throw new Ice.UnknownUserException(__ex.ice_name(), __ex);
}
}
IceInternal.BasicStream __is = __og.startReadParams();
resp.value = new BsDataResp();
resp.value.__read(__is);
boolean __ret;
__ret = __is.readBool();
__og.endReadParams();
return __ret;
}
catch(Ice.LocalException __ex)
{
throw new IceInternal.LocalExceptionWrapper(__ex, false);
}
}
finally
{
__handler.reclaimOutgoing(__og);
}
}
public boolean
getPoiTypeFromGeo(BsPoint pt, DaoPoiInfoRespHolder res, java.util.Map<String, String> __ctx, Ice.Instrumentation.InvocationObserver __observer)
throws IceInternal.LocalExceptionWrapper
{
IceInternal.Outgoing __og = __handler.getOutgoing("getPoiTypeFromGeo", Ice.OperationMode.Normal, __ctx, __observer);
try
{
try
{
IceInternal.BasicStream __os = __og.startWriteParams(Ice.FormatType.DefaultFormat);
pt.__write(__os);
__og.endWriteParams();
}
catch(Ice.LocalException __ex)
{
__og.abort(__ex);
}
boolean __ok = __og.invoke();
try
{
if(!__ok)
{
try
{
__og.throwUserException();
}
catch(Ice.UserException __ex)
{
throw new Ice.UnknownUserException(__ex.ice_name(), __ex);
}
}
IceInternal.BasicStream __is = __og.startReadParams();
res.value = new DaoPoiInfoResp();
res.value.__read(__is);
boolean __ret;
__ret = __is.readBool();
__og.endReadParams();
return __ret;
}
catch(Ice.LocalException __ex)
{
throw new IceInternal.LocalExceptionWrapper(__ex, false);
}
}
finally
{
__handler.reclaimOutgoing(__og);
}
}
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public abstract class _BaseStationServiceDisp extends Ice.ObjectImpl implements BaseStationService
{
protected void
ice_copyStateFrom(Ice.Object __obj)
throws java.lang.CloneNotSupportedException
{
throw new java.lang.CloneNotSupportedException();
}
public static final String[] __ids =
{
"::BaseStationData::BaseStationService",
"::Ice::Object"
};
public boolean ice_isA(String s)
{
return java.util.Arrays.binarySearch(__ids, s) >= 0;
}
public boolean ice_isA(String s, Ice.Current __current)
{
return java.util.Arrays.binarySearch(__ids, s) >= 0;
}
public String[] ice_ids()
{
return __ids;
}
public String[] ice_ids(Ice.Current __current)
{
return __ids;
}
public String ice_id()
{
return __ids[0];
}
public String ice_id(Ice.Current __current)
{
return __ids[0];
}
public static String ice_staticId()
{
return __ids[0];
}
public final boolean GetGpsByBs(BsDataReq req, BsDataRespHolder resp)
{
return GetGpsByBs(req, resp, null);
}
public final boolean GetGpsByBsList(BsDataListReq req, BsDataRespHolder resp)
{
return GetGpsByBsList(req, resp, null);
}
public final boolean getPoiTypeFromGeo(BsPoint pt, DaoPoiInfoRespHolder res)
{
return getPoiTypeFromGeo(pt, res, null);
}
public static Ice.DispatchStatus ___GetGpsByBs(BaseStationService __obj, IceInternal.Incoming __inS, Ice.Current __current)
{
__checkMode(Ice.OperationMode.Normal, __current.mode);
IceInternal.BasicStream __is = __inS.startReadParams();
BsDataReq req;
req = new BsDataReq();
req.__read(__is);
__inS.endReadParams();
BsDataRespHolder resp = new BsDataRespHolder();
boolean __ret = __obj.GetGpsByBs(req, resp, __current);
IceInternal.BasicStream __os = __inS.__startWriteParams(Ice.FormatType.DefaultFormat);
resp.value.__write(__os);
__os.writeBool(__ret);
__inS.__endWriteParams(true);
return Ice.DispatchStatus.DispatchOK;
}
public static Ice.DispatchStatus ___GetGpsByBsList(BaseStationService __obj, IceInternal.Incoming __inS, Ice.Current __current)
{
__checkMode(Ice.OperationMode.Normal, __current.mode);
IceInternal.BasicStream __is = __inS.startReadParams();
BsDataListReq req;
req = new BsDataListReq();
req.__read(__is);
__inS.endReadParams();
BsDataRespHolder resp = new BsDataRespHolder();
boolean __ret = __obj.GetGpsByBsList(req, resp, __current);
IceInternal.BasicStream __os = __inS.__startWriteParams(Ice.FormatType.DefaultFormat);
resp.value.__write(__os);
__os.writeBool(__ret);
__inS.__endWriteParams(true);
return Ice.DispatchStatus.DispatchOK;
}
public static Ice.DispatchStatus ___getPoiTypeFromGeo(BaseStationService __obj, IceInternal.Incoming __inS, Ice.Current __current)
{
__checkMode(Ice.OperationMode.Normal, __current.mode);
IceInternal.BasicStream __is = __inS.startReadParams();
BsPoint pt;
pt = new BsPoint();
pt.__read(__is);
__inS.endReadParams();
DaoPoiInfoRespHolder res = new DaoPoiInfoRespHolder();
boolean __ret = __obj.getPoiTypeFromGeo(pt, res, __current);
IceInternal.BasicStream __os = __inS.__startWriteParams(Ice.FormatType.DefaultFormat);
res.value.__write(__os);
__os.writeBool(__ret);
__inS.__endWriteParams(true);
return Ice.DispatchStatus.DispatchOK;
}
private final static String[] __all =
{
"GetGpsByBs",
"GetGpsByBsList",
"getPoiTypeFromGeo",
"ice_id",
"ice_ids",
"ice_isA",
"ice_ping"
};
public Ice.DispatchStatus __dispatch(IceInternal.Incoming in, Ice.Current __current)
{
int pos = java.util.Arrays.binarySearch(__all, __current.operation);
if(pos < 0)
{
throw new Ice.OperationNotExistException(__current.id, __current.facet, __current.operation);
}
switch(pos)
{
case 0:
{
return ___GetGpsByBs(this, in, __current);
}
case 1:
{
return ___GetGpsByBsList(this, in, __current);
}
case 2:
{
return ___getPoiTypeFromGeo(this, in, __current);
}
case 3:
{
return ___ice_id(this, in, __current);
}
case 4:
{
return ___ice_ids(this, in, __current);
}
case 5:
{
return ___ice_isA(this, in, __current);
}
case 6:
{
return ___ice_ping(this, in, __current);
}
}
assert(false);
throw new Ice.OperationNotExistException(__current.id, __current.facet, __current.operation);
}
protected void __writeImpl(IceInternal.BasicStream __os)
{
__os.startWriteSlice(ice_staticId(), -1, true);
__os.endWriteSlice();
}
protected void __readImpl(IceInternal.BasicStream __is)
{
__is.startReadSlice();
__is.endReadSlice();
}
public static final long serialVersionUID = 0L;
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public interface _BaseStationServiceOperations
{
boolean GetGpsByBs(BsDataReq req, BsDataRespHolder resp, Ice.Current __current);
boolean GetGpsByBsList(BsDataListReq req, BsDataRespHolder resp, Ice.Current __current);
boolean getPoiTypeFromGeo(BsPoint pt, DaoPoiInfoRespHolder res, Ice.Current __current);
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public interface _BaseStationServiceOperationsNC
{
boolean GetGpsByBs(BsDataReq req, BsDataRespHolder resp);
boolean GetGpsByBsList(BsDataListReq req, BsDataRespHolder resp);
boolean getPoiTypeFromGeo(BsPoint pt, DaoPoiInfoRespHolder res);
}
# Generated by slice2py - DO NOT EDIT!
#
import Ice
Ice.updateModule("BaseStationData")
# Modules:
import bsd_ice
# Submodules:
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class poiDatasHelper
{
public static void
write(IceInternal.BasicStream __os, PoiInfo[] __v)
{
if(__v == null)
{
__os.writeSize(0);
}
else
{
__os.writeSize(__v.length);
for(int __i0 = 0; __i0 < __v.length; __i0++)
{
__v[__i0].__write(__os);
}
}
}
public static PoiInfo[]
read(IceInternal.BasicStream __is)
{
PoiInfo[] __v;
final int __len0 = __is.readAndCheckSeqSize(5);
__v = new PoiInfo[__len0];
for(int __i0 = 0; __i0 < __len0; __i0++)
{
__v[__i0] = new PoiInfo();
__v[__i0].__read(__is);
}
return __v;
}
}
// **********************************************************************
//
// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************
//
// Ice version 3.5.1
//
// <auto-generated>
//
// Generated from file `bsd.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package BaseStationData;
public final class poiDatasHolder
{
public
poiDatasHolder()
{
}
public
poiDatasHolder(PoiInfo[] value)
{
this.value = value;
}
public PoiInfo[] value;
}
import logging
import pandas as pdas
import os
import chardet
import datetime
import re
import openpyxl
from openpyxl import Workbook
from djcardrenewal.common.dbase.MysqlHelper import MysqlHelper
from djcardrenewal.common.dbase import DbConect
from djcardrenewal.common.sqlcontent import DjSql
from djcardrenewal.common.sqlcontent import CurMonthYzl
from djcardrenewal.common.string.StringBuilder import StringBuilder
print("sys config " + __name__)
log_name = './log/supplychain/dealSendSomeList.log'
log_format = '[%(asctime)s-%(filename)s-%(levelname)s:%(message)s]'
log_level = logging.DEBUG
log_mode = 'a'
logging.basicConfig(filename=log_name, format=log_format, level=log_level, filemode=log_mode)
class DealBelongCusMain:
handleDescription = ''
handleMonth = ''
hmonth = ''
module_file_path = ''
defaultExportReleasePath = ''
db = None
def __init__(self, handle_month):
logging.info("init construct bean")
self.handleDescription = "供应链批量打印发货单需求脚本执行..."
self.handleMonth = handle_month
self.hmonth = handle_month.replace('-', '')[2:6]
#self.db = MysqlHelper(DbConect.current_month_DB)
def initCurrentMonthTable(self):
logging.info("初始化:暂无操作")
# 判断文件编码
def detect_file_encoding(self, filename):
with open(filename, 'rb') as f:
content = f.read()
result = chardet.detect(content)
return result['encoding']
def dealDeviceEndDateList(self):
return True
# 定义修改函数
def modify_data(self, x):
# 进行批量修改的逻辑
if x is None:
return x
return x.replace("M{", "").replace("}", "")
# 定义修改函数
def modify_float_data(self, x):
# 进行批量修改的逻辑
if x is None:
return 0
current = str(x).replace("`", "").replace(' ', '')
if current == '':
return 0
return current
# 定义修改函数
def dealSendDate(self, sendDate):
# 去除字符串中的汉字
sendDate = re.sub(r'[\u4e00-\u9fa5]', '', sendDate)
# 进行批量修改的逻辑
if ',' in sendDate:
return sendDate.split(',')[0]
if len(sendDate)<19:
sendDate = sendDate + ' 00:00:00'
return sendDate
# 定义修改函数
def dealReadSendMapper(self, dataframes_source):
sendMapper = {}
currentKey = {}
splitSize = 0
for drow in dataframes_source.itertuples():
# print(f'[DEBUG] {drow}')
# 需求: 根据发货清单明细:(同一 下单客户,同一 发货时间,同一 出库仓库,同一 收货 联系人,收货 联系地址,同一 审核人,同一 结算主体),可打印在一张送货单
sendDate = pdas.to_datetime(self.dealSendDate(drow.发货时间))
# print(sendDate.strftime("%Y-%m-%d"))
# sendDate = datetime.datetime.strptime(self.dealSendDate(drow.发货时间), "%Y-%m-%d %H:%M:%S")
mapkey = "cus:%s,date:%s,stor:%s,peo:%s,add:%s,check:%s,main:%s" % (drow.下单客户, sendDate.strftime("%Y-%m-%d"), drow.出库仓库, drow.联系人, drow.联系地址, drow.审核人, drow.结算主体)
curMapkey = currentKey.get(mapkey)
if curMapkey is None:
currentKey[mapkey] = mapkey
curMapkey = mapkey
# print(f'[DEBUG] curMapkey:{curMapkey}')
dataList = sendMapper.get(curMapkey)
# 每个key包含6条数据,超过6条后用新的key存储
if dataList is not None and len(dataList)==5:
curMapkey = "%s_%s" % (mapkey, splitSize)
currentKey[mapkey] = curMapkey
if dataList is None:
dataList = []
dataList.append(drow)
sendMapper[curMapkey] = dataList
else:
dataList.append(drow)
splitSize+=1
return sendMapper
# 定义修改函数
def dealStorePeopleMapper(self):
storePeopleMapper = {}
storePeople_dataframes = pdas.read_excel('D:/work_doc/003 - 商务脚本/仓别-发研发.xlsx', skiprows=1)
for drow in storePeople_dataframes.itertuples():
# print(f'[DEBUG] {drow}')
key1 = drow._2 + '2021制单人'
key2 = drow._2 + '2021发货人'
key3 = drow._2 + '2022制单人'
key4 = drow._2 + '2022发货人'
key5 = drow._2 + '2023制单人'
key6 = drow._2 + '2023发货人'
storePeopleMapper[key1] = drow.制单人
storePeopleMapper[key2] = drow.发货人
storePeopleMapper[key3] = drow._5
storePeopleMapper[key4] = drow._6
storePeopleMapper[key5] = drow._7
storePeopleMapper[key6] = drow._8
return storePeopleMapper
def dealDataToExcel(self, sourceFile, exportPath, module_file_path, dealContentPath):
# 读取 Excel 文件
dataframes_source = pdas.read_excel(sourceFile)
dataframes_source.columns = dataframes_source.columns.str.strip()
# 读取原始数据:
# 每个mapper value代表一个发货单(每个发货单最大6条发货信息),
# mapper key按照商务需求+数值的方式确保唯一用来表示一张发货单(业务操作中不会用到 mapper key,只是用来将原始数据分割成一个一个的 mapper value)
sendMapper = self.dealReadSendMapper(dataframes_source)
print('文件任务总数:%s' % len(sendMapper))
# 不再使用pandas读取模板数据,换成后面的openpyxl default_dataframes = pdas.read_excel(module_file_path, sheet_name='发货签收单模板')
mainMapper = {'广联数科': '深圳广联数科科技有限公司','广联赛讯': '深圳广联赛讯股份有限公司','嘀加智慧云': '深圳市嘀加智慧云服务有限公司'}
storePeopleMapper = self.dealStorePeopleMapper()
dealindex = 0
orderNumMapper = {}
expSizeMapper = {}
dataframes_source['自动生成单号'] = '-'
# 打开模板文件
curWorkBook = openpyxl.load_workbook(module_file_path)
for sendKey,sendList in sendMapper.items():
oneRow = sendList[0]
# 供货方
mainName = mainMapper.get(oneRow.结算主体)
# 发货日期
sendDate = pdas.to_datetime(self.dealSendDate(oneRow.发货时间))
# 发货单号
sendDateStr = sendDate.strftime("%Y-%m-%d")
orYear = sendDate.strftime("%Y")
# 每天的订单进行序号递增,并使用mapper存储
orkey = sendDate.strftime("%Y%m%d")
orderNum = orderNumMapper.get(orkey)
if orderNum is None:
orderNum = (int(orkey) * 10000)
orderNum+=1
orderNumMapper[orkey] = orderNum
sendOrderCode = orderNum
# 收货方
reciverCustomer = oneRow.下单客户
# 收货地址
reciverAdd = oneRow.联系地址
# 收货人
reciverPeople = oneRow.联系人
# 收货人电话
reciverPeopleMobile = str(oneRow.联系电话)
# 发货仓
sendStore = oneRow.出库仓库
curSheet = curWorkBook.active
# ---清空内存中的表格 start---
curSheet['C3'] = ''
curSheet['H3'] = ''
curSheet['J3'] = ''
curSheet['C4'] = ''
curSheet['I4'] = ''
curSheet['C5'] = ''
curSheet['I5'] = ''
curSheet['J5'] = ''
loopList = [7,8,9,10,11,12]
for loopItem in loopList:
curSheet[f'C{loopItem}'] = ''
curSheet[f'D{loopItem}'] = ''
curSheet[f'E{loopItem}'] = ''
curSheet[f'G{loopItem}'] = ''
curSheet[f'H{loopItem}'] = ''
curSheet[f'I{loopItem}'] = ''
curSheet[f'I{loopItem}'] = ''
curSheet['C14'] = ''
curSheet['F14'] = ''
# ---清空内存中的表格 END---
curSheet['C3'] = mainName
curSheet['H3'] = sendDateStr
curSheet['J3'] = str(sendOrderCode)
curSheet['C4'] = reciverCustomer
curSheet['I4'] = sendStore
curSheet['C5'] = reciverAdd
curSheet['I5'] = reciverPeople
curSheet['J5'] = reciverPeopleMobile
loopIndex = 7
for sendRow in sendList:
# 物料编码
marterCode = sendRow.实发物料编码
# 销售编码
saleMarterCode = sendRow.订单物料编码
# 产品名称
productName = sendRow.实发物料名称
# 子订单号
childOrderCode = sendRow.子订单号
# 数量
orderCount = sendRow.已发数量
# 备注
lineRemark = sendRow.发货单号
# 制单人
mlpKey = f'{sendRow.出库仓库}{orYear}制单人'
markListPeople = storePeopleMapper.get(mlpKey)
# 发货人
slpKey = f'{sendRow.出库仓库}{orYear}发货人'
sendListPeople = storePeopleMapper.get(slpKey)
curSheet[f'C{loopIndex}'] = marterCode
curSheet[f'D{loopIndex}'] = saleMarterCode
curSheet[f'E{loopIndex}'] = productName
curSheet[f'G{loopIndex}'] = childOrderCode
curSheet[f'H{loopIndex}'] = orderCount
curSheet[f'I{loopIndex}'] = lineRemark
curSheet[f'I{loopIndex}'] = lineRemark
curSheet['C14'] = markListPeople
curSheet['F14'] = sendListPeople
loopIndex+=1
# 在源文件中增加列:自动生成单号
dataframes_source.loc[dataframes_source['发货单号'] == sendRow.发货单号, '自动生成单号'] = sendOrderCode
# 同订单号计数
expSize = expSizeMapper.get(sendOrderCode)
if expSize is None:
expSize = 0
expSize+=1
expSizeMapper[sendOrderCode] = expSize
orderNumValue = "%s_%s" % (sendOrderCode, expSize)
exPath = "%s%s_%s.xlsx" % (exportPath, orderNumValue, reciverCustomer)
# write_dataframes.to_excel(exPath, index=False)
curWorkBook.save(exPath)
dealindex+=1
print('[%s] 生成文件索引:%s' % (datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"), dealindex))
# 关闭openpyxl的IO流操作
curWorkBook.close()
# 将源文件写出到新文件
sourceExportFilePath = f'{exportPath}exportsource_{dealContentPath}.xlsx'
dataframes_source.to_excel(sourceExportFilePath, index=False)
# 定义修改函数
def dealContentFile(self, contentPath):
# 获取目录中的所有文件
files = os.listdir(contentPath)
for file in files:
sourceFile = f'{contentPath}{file}'
dealContentPath = file.split('-')[1].replace('.xlsx', '')
# print("=1=文件名称:", sourceFile)
# print("=2=DefaultExport:", self.defaultExportReleasePath)
print('=3=dealContent:', dealContentPath)
exportPath = self.defaultExportReleasePath + '' + dealContentPath + '/'
if not os.path.exists(exportPath):
# 创建目录
os.makedirs(exportPath)
print(f"Directory '{exportPath}' created.")
else:
print(f"Directory '{exportPath}' already exists.")
# 处理核心逻辑
dealMain.dealDataToExcel(sourceFile, exportPath, self.module_file_path, dealContentPath)
if __name__ == "__main__":
handle_month = '2021-2023'
dedRes = False
diRes = False
urRes = False
print('==========================跑数据根据SN获取发货信息及状态==========================')
#启动初始化
dealMain = DealBelongCusMain(handle_month)
logging.info("start handle" + dealMain.handleDescription + ' the month:' + dealMain.handleMonth)
dealMain.module_file_path = 'D:/work_doc/003 - 商务脚本/发货签收单-模板-rel.xlsx'
dealMain.defaultExportReleasePath = 'D:/work_doc/003 - 商务脚本/export_relaese/'
contentPath = 'D:/work_doc/003 - 商务脚本/2021年-2023年发货清单明细/2023年11月/'
dealMain.dealContentFile(contentPath)
import logging
import pandas as pdas
import os
import chardet
from datetime import datetime, timezone
import re
import json
import openpyxl
from openpyxl import Workbook
from djcardrenewal.common.dbase.MysqlHelper import MysqlHelper
from djcardrenewal.common.dbase import DbConect
from djcardrenewal.common.sqlcontent import DjSql
from djcardrenewal.common.sqlcontent import CurMonthYzl
from djcardrenewal.common.string.StringBuilder import StringBuilder
import sys,traceback,Ice
Ice.loadSlice("--all -I.. djcardrenewal/supplychain/ice/bsd.ice")
Ice.loadSlice("--all -I.. djcardrenewal/supplychain/ice/Hdao_gps.ice")
Ice.loadSlice("--all -I.. --underscore djcardrenewal/supplychain/ice/district.ice")
Ice.loadSlice("--all -I.. --underscore djcardrenewal/supplychain/ice/ipoi.ice")
Ice.loadSlice("--all -I.. --underscore djcardrenewal/supplychain/ice/HDao_mile.ice")
import BaseStationData
import HDaoGps
print("sys config " + __name__)
log_name = './log/supplychain/dealDeviceLocationMain.log'
log_format = '[%(asctime)s-%(filename)s-%(levelname)s:%(message)s]'
log_level = logging.DEBUG
log_mode = 'a'
logging.basicConfig(filename=log_name, format=log_format, level=log_level, filemode=log_mode)
class DealDeviceLocationMain:
handleDescription = ''
handleMonth = ''
hmonth = ''
module_file_path = ''
defaultExportReleasePath = ''
env_host = "192.168.5.26"
def __init__(self, handle_month):
logging.info("init construct bean")
self.handleDescription = "---业务导出恒信数据---脚本执行..."
self.handleMonth = handle_month
self.hmonth = handle_month.replace('-', '')[2:6]
def initCurrentMonthTable(self):
logging.info("初始化:暂无操作")
# 判断文件编码
def detect_file_encoding(self, filename):
with open(filename, 'rb') as f:
content = f.read()
result = chardet.detect(content)
return result['encoding']
def dealDeviceEndDateList(self):
return True
# 定义修改函数
def modify_data(self, x):
# 进行批量修改的逻辑
if x is None:
return x
return x.replace("M{", "").replace("}", "")
# 定义修改函数
def modify_float_data(self, x):
# 进行批量修改的逻辑
if x is None:
return 0
current = str(x).replace("`", "").replace(' ', '')
if current == '':
return 0
return current
# 定义修改函数
def dealSendDate(self, sendDate):
# 去除字符串中的汉字
sendDate = re.sub(r'[\u4e00-\u9fa5]', '', sendDate)
# 进行批量修改的逻辑
if ',' in sendDate:
return sendDate.split(',')[0]
if len(sendDate)<19:
sendDate = sendDate + ' 00:00:00'
return sendDate
def getIceHdaoService(self):
communicator = Ice.initialize(sys.argv)
obj = communicator.stringToProxy(f'HDaoGpsSvc:default -h {self.env_host} -p 23470')
obj.ice_ping()
iceService = HDaoGps.DaoGpsServicePrx.checkedCast(obj)
return iceService
def getLatestGpsRecord(self, iceService, sn, type = 5):
try:
if not iceService:
raise RuntimeError("Invalid proxy")
req = HDaoGps.LatestGpsGetRequest()
req.userID = int(sn)
req.apType = type
req.extraMapReq = 0
rsp = iceService.getLatestGpsRecord(req)
# print(rsp[1].record.gpsTime)
# print(rsp)
return rsp
except:
traceback.print_exc()
return None
# 定义修改函数
def dealContentFile(self):
# 1、读取文件内容
deviceSourceFrame = pdas.read_excel(self.module_file_path)
if deviceSourceFrame is None :
logging.info("file is exception,please check")
return
# 2、loop 设备号,获取位置信息
iceService = self.getIceHdaoService()
for index,drow in deviceSourceFrame.iterrows():
sn = drow.设备号
# 组装位置信息
gpsLocation = self.getLatestGpsRecord(iceService, sn, 5)
if gpsLocation is not None and gpsLocation[1] is not None and gpsLocation[1].record.gpsTime>0:
gpsTime = gpsLocation[1].record.gpsTime
dt_object = datetime.fromtimestamp(gpsTime)
# 格式化为字符串
formatted_str = dt_object.strftime('%Y-%m-%d %H:%M:%S')
logging.info('get gps time is:%s %s %s', sn, gpsTime, formatted_str)
lngResult = gpsLocation[1].record.lng/1000000
formatLng = "{:.6f}".format(lngResult)
latResult = gpsLocation[1].record.lat/1000000
formatLat = "{:.6f}".format(latResult)
deviceSpeed = gpsLocation[1].record.speed
deviceAlt = gpsLocation[1].record.alt
deviceDir = gpsLocation[1].record.dir
deviceSourceFrame.at[index, '经度'] = formatLat
deviceSourceFrame.at[index, '纬度'] = formatLng
deviceSourceFrame.at[index, '速度'] = deviceSpeed
deviceSourceFrame.at[index, '海拔'] = deviceAlt
deviceSourceFrame.at[index, 'gps时间'] = formatted_str
deviceSourceFrame.at[index, '方向'] = deviceDir
print('输出excel数据')
# 输出数据到excel
deviceSourceFrame.to_excel(f'{self.defaultExportReleasePath}', index=False)
if __name__ == "__main__":
handle_month = '2021-2024'
dedRes = False
diRes = False
urRes = False
print('==========================根据设备SN获取设备位置信息==========================')
#启动初始化
dealMain = DealDeviceLocationMain(handle_month)
logging.info("start handle" + dealMain.handleDescription + ' the month:' + dealMain.handleMonth)
# 测试获取位置信息
# dealMain.getLatestGpsRecord('561063062795826', 11)
dealMain.module_file_path = 'D:/work_doc/dataexport/gpslocation/gpslocation20240410.xlsx'
dealMain.defaultExportReleasePath = 'D:/work_doc/dataexport/gpslocation/gpslocation20240410-result.xlsx'
dealMain.dealContentFile()
print('导出完成。')
\ No newline at end of file \ No newline at end of file
/////////////////////////////////////////////////////////////////
// 修订记录
//
// 版本 作者 日期 改动点
// 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);
};
};
/////////////////////////////////////////////////////////////////
// 修订记录
//
// 版本 作者 日期 改动点
// 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);
};
};
module HDaoMile
{
/*==========================================================
* Mileage Statistics
*==========================================================*/
/******* common *********/
struct GpsPos
{
int gpsTime;
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;
};
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 */
};
// 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);
};
};
\ No newline at end of file \ No newline at end of file
module BaseStationData
{
struct BsData
{
int mnc; /*运营商编码*/
int lac; /*区号*/
int cellid; /*塔号*/
};
sequence<BsData> BsListReq;
struct BsDataListReq
{
BsListReq bsList;
};
struct BsDataReq
{
BsData bs;
};
struct GpsData
{
int lng; /*经度*/
int lat; /*纬度*/
string addr; /*地址*/
};
struct BsDataResp
{
int ret;
GpsData gps;
};
struct BsPoint
{
float lng;
float lat;
};
struct PoiInfo
{
float distance;
string type;
float lng;
float lat;
string addr;
};
sequence<PoiInfo> poiDatas;
struct DaoPoiInfoResp
{
int size;
poiDatas records;
};
interface BaseStationService
{
bool GetGpsByBs(BsDataReq req, out BsDataResp resp);
bool GetGpsByBsList(BsDataListReq req, out BsDataResp resp);
/*get gaode poiType*/
bool getPoiTypeFromGeo(BsPoint pt, out DaoPoiInfoResp res);
};
};
module DISTRICT {
interface IDistrictFinder{
bool get_distinfo_by_pos(float lng,float lat,out int distCode,out string strDistName);
bool get_distdetail_by_code(int distCode,out string strProvName,out string strCityName,out string strCountyName);
bool get_distdetail_by_pos(float lng, float lat, out string strProvName, out string strCityName, out string strCountyName);
};
};
module POI {
struct poi_info_t
{
int id; //poi id
float lng;
float lat;
int citycode;
int type;
string name;
string addr;
string tel;
int weight;
int distance;
};
sequence<poi_info_t> poi_info_seq_t;
sequence<int> poi_type_seq_t;
enum POI_INDEX_TYPE_CONSTANTS
{
emIndexName,
emIndexAddr,
emIndexCustom,
index_type_count,
};
struct geopoint
{
float lng;
float lat;
};
struct geocoding_result
{
int level;
int confidence;
geopoint pt;
};
/*
* POI search
*/
interface IPOISearchFTR
{
/*
input:
emIndexType
key
citycode
limit
output:
a list of poi
*/
int poi_search_by_key(POI_INDEX_TYPE_CONSTANTS emIndexType, string key, int citycode, int limit, out poi_info_seq_t arrPoiInfo);
/*
input:
emIndexType
key
citycode
limit
a list of type
output:
a list of poi
*/
int poi_search_by_key_and_type(POI_INDEX_TYPE_CONSTANTS emIndexType, string key, int citycode, poi_type_seq_t arrType, int limit,
out poi_info_seq_t arrPoiInfo);
/*
input:
emIndexType
key
citycode
limit
a list of type
lng lat :pos
maxDis:distance
output:
a list of poi
*/
int poi_search_by_key_type_near(POI_INDEX_TYPE_CONSTANTS emIndexType, string key, poi_type_seq_t arrType, geopoint pt, int maxDis, int limit,
out poi_info_seq_t arrPoiInfo);
/*
input:
key
region city
limit
output:
a list of poi
*/
int poi_search_by_key_cityname(string key, string cityname, int limit, out poi_info_seq_t arrPoiInfo);
/*
input:
key
citycode
limit
省内查询
output:
a list of poi
*/
int poi_search_by_key_citycode(string key, int citycode, int limit, out poi_info_seq_t arrPoiInfo);
/*
地址解析
input:
string strGeopointDescription
output:
geocoding_result rst
*/
int Geocoding(string strAddress, out geocoding_result rst);
}; // interface IPOISearchFTR
interface IPOISearchNear
{
/*
input:
ptLL
ptRR
a list of type
numLimit
output:
a list of poi
*/
int poi_search_by_rect(geopoint ptLL,geopoint ptRR,poi_type_seq_t arrType,int numLimit,out poi_info_seq_t arrPoiInfo);
/*
input:
pt
maxDis
a list of type
numLimit
output:
a list of poi
*/
int poi_search_by_circle(geopoint pt,int maxDis,poi_type_seq_t arrType,int numLimit,out poi_info_seq_t arrPoiInfo);
/*
input:
citycode
limit
a list of type
output:
a list of poi
*/
int poi_search_by_city(int citycode,poi_type_seq_t arrType,int limit,out poi_info_seq_t arrPoiInfo);
/*
逆地址解析
input:
geopoint pt
output:
string strGeopointDescription
*/
int ReverseGeocoding(geopoint pt,out string strGeopointDescription);
// 逆地址解析, 格式:广东省广州市天河区国际康体贸易中心附近
int ReverseGeocoding2(geopoint pt, out string strGeopointDescription);
}; // interface IPOISearchFTR
}; // module
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!