Commit 03a5083a by 王欣伟

1、ICE工具类提交

2、批量导入权益订单-用户字典数据脚本
3、恒信数据导出增加设备位置信息
1 parent 1440ffae
Showing 55 changed files with 3520 additions and 0 deletions
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
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 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
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
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!