Commit 7b82ca1f by 杨林龙

1.7.0 开发区域查车ICE调用接口

1 parent 462025f3
Showing 23 changed files with 1178 additions and 35 deletions
// **********************************************************************
//
// 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 `HDao_gps.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package cn.com.glsx.devicemonitor.iceprotocol.hdao;
public abstract class Callback_DaoGpsService_getDeviceInfoOfRegion extends Ice.TwowayCallback
{
public abstract void response(boolean __ret, InRegionDevices res);
public final void __completed(Ice.AsyncResult __result)
{
DaoGpsServicePrx __proxy = (DaoGpsServicePrx)__result.getProxy();
boolean __ret = false;
InRegionDevicesHolder res = new InRegionDevicesHolder();
try
{
__ret = __proxy.end_getDeviceInfoOfRegion(res, __result);
}
catch(Ice.LocalException __ex)
{
exception(__ex);
return;
}
response(__ret, res.value);
}
}
......@@ -669,4 +669,22 @@ public interface DaoGpsServicePrx extends Ice.ObjectPrx
public Ice.AsyncResult begin_getGpsByBsRecordsOfLatesBs(BsGetRequest req, java.util.Map<String, String> __ctx, Callback_DaoGpsService_getGpsByBsRecordsOfLatesBs __cb);
public boolean end_getGpsByBsRecordsOfLatesBs(DaoBsDataRespHolder res, Ice.AsyncResult __result);
public boolean getDeviceInfoOfRegion(RegionData req, InRegionDevicesHolder res);
public boolean getDeviceInfoOfRegion(RegionData req, InRegionDevicesHolder res, java.util.Map<String, String> __ctx);
public Ice.AsyncResult begin_getDeviceInfoOfRegion(RegionData req);
public Ice.AsyncResult begin_getDeviceInfoOfRegion(RegionData req, java.util.Map<String, String> __ctx);
public Ice.AsyncResult begin_getDeviceInfoOfRegion(RegionData req, Ice.Callback __cb);
public Ice.AsyncResult begin_getDeviceInfoOfRegion(RegionData req, java.util.Map<String, String> __ctx, Ice.Callback __cb);
public Ice.AsyncResult begin_getDeviceInfoOfRegion(RegionData req, Callback_DaoGpsService_getDeviceInfoOfRegion __cb);
public Ice.AsyncResult begin_getDeviceInfoOfRegion(RegionData req, java.util.Map<String, String> __ctx, Callback_DaoGpsService_getDeviceInfoOfRegion __cb);
public boolean end_getDeviceInfoOfRegion(InRegionDevicesHolder res, Ice.AsyncResult __result);
}
......@@ -702,6 +702,142 @@ public final class DaoGpsServicePrxHelper extends Ice.ObjectPrxHelperBase implem
}
}
private static final String __getDeviceInfoOfRegion_name = "getDeviceInfoOfRegion";
public boolean getDeviceInfoOfRegion(RegionData req, InRegionDevicesHolder res)
{
return getDeviceInfoOfRegion(req, res, null, false);
}
public boolean getDeviceInfoOfRegion(RegionData req, InRegionDevicesHolder res, java.util.Map<String, String> __ctx)
{
return getDeviceInfoOfRegion(req, res, __ctx, true);
}
private boolean getDeviceInfoOfRegion(RegionData req, InRegionDevicesHolder res, java.util.Map<String, String> __ctx, boolean __explicitCtx)
{
if(__explicitCtx && __ctx == null)
{
__ctx = _emptyContext;
}
final Ice.Instrumentation.InvocationObserver __observer = IceInternal.ObserverHelper.get(this, "getDeviceInfoOfRegion", __ctx);
int __cnt = 0;
try
{
while(true)
{
Ice._ObjectDel __delBase = null;
try
{
__checkTwowayOnly("getDeviceInfoOfRegion");
__delBase = __getDelegate(false);
_DaoGpsServiceDel __del = (_DaoGpsServiceDel)__delBase;
return __del.getDeviceInfoOfRegion(req, 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_getDeviceInfoOfRegion(RegionData req)
{
return begin_getDeviceInfoOfRegion(req, null, false, null);
}
public Ice.AsyncResult begin_getDeviceInfoOfRegion(RegionData req, java.util.Map<String, String> __ctx)
{
return begin_getDeviceInfoOfRegion(req, __ctx, true, null);
}
public Ice.AsyncResult begin_getDeviceInfoOfRegion(RegionData req, Ice.Callback __cb)
{
return begin_getDeviceInfoOfRegion(req, null, false, __cb);
}
public Ice.AsyncResult begin_getDeviceInfoOfRegion(RegionData req, java.util.Map<String, String> __ctx, Ice.Callback __cb)
{
return begin_getDeviceInfoOfRegion(req, __ctx, true, __cb);
}
public Ice.AsyncResult begin_getDeviceInfoOfRegion(RegionData req, Callback_DaoGpsService_getDeviceInfoOfRegion __cb)
{
return begin_getDeviceInfoOfRegion(req, null, false, __cb);
}
public Ice.AsyncResult begin_getDeviceInfoOfRegion(RegionData req, java.util.Map<String, String> __ctx, Callback_DaoGpsService_getDeviceInfoOfRegion __cb)
{
return begin_getDeviceInfoOfRegion(req, __ctx, true, __cb);
}
private Ice.AsyncResult begin_getDeviceInfoOfRegion(RegionData req, java.util.Map<String, String> __ctx, boolean __explicitCtx, IceInternal.CallbackBase __cb)
{
__checkAsyncTwowayOnly(__getDeviceInfoOfRegion_name);
IceInternal.OutgoingAsync __result = new IceInternal.OutgoingAsync(this, __getDeviceInfoOfRegion_name, __cb);
try
{
__result.__prepare(__getDeviceInfoOfRegion_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_getDeviceInfoOfRegion(InRegionDevicesHolder res, Ice.AsyncResult __result)
{
Ice.AsyncResult.__check(__result, this, __getDeviceInfoOfRegion_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 InRegionDevices();
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;
}
}
private static final String __getDevicesGpsInfo_name = "getDevicesGpsInfo";
public boolean getDevicesGpsInfo(BatchGpsDevInfoRequest req, BatchGpsDevInfoResponseHolder res)
......
// **********************************************************************
//
// 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 `HDao_gps.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package cn.com.glsx.devicemonitor.iceprotocol.hdao;
public class DeviceInfo implements Cloneable, java.io.Serializable
{
public long sn;
public int lng;
public int lat;
public int gpsTime;
public String addr;
public DeviceInfo()
{
}
public DeviceInfo(long sn, int lng, int lat, int gpsTime, String addr)
{
this.sn = sn;
this.lng = lng;
this.lat = lat;
this.gpsTime = gpsTime;
this.addr = addr;
}
public boolean
equals(Object rhs)
{
if(this == rhs)
{
return true;
}
DeviceInfo _r = null;
if(rhs instanceof DeviceInfo)
{
_r = (DeviceInfo)rhs;
}
if(_r != null)
{
if(sn != _r.sn)
{
return false;
}
if(lng != _r.lng)
{
return false;
}
if(lat != _r.lat)
{
return false;
}
if(gpsTime != _r.gpsTime)
{
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, "::HDaoGps::DeviceInfo");
__h = IceInternal.HashUtil.hashAdd(__h, sn);
__h = IceInternal.HashUtil.hashAdd(__h, lng);
__h = IceInternal.HashUtil.hashAdd(__h, lat);
__h = IceInternal.HashUtil.hashAdd(__h, gpsTime);
__h = IceInternal.HashUtil.hashAdd(__h, addr);
return __h;
}
public Object
clone()
{
Object o = null;
try
{
o = super.clone();
}
catch(CloneNotSupportedException ex)
{
assert false; // impossible
}
return o;
}
public void
__write(IceInternal.BasicStream __os)
{
__os.writeLong(sn);
__os.writeInt(lng);
__os.writeInt(lat);
__os.writeInt(gpsTime);
__os.writeString(addr);
}
public void
__read(IceInternal.BasicStream __is)
{
sn = __is.readLong();
lng = __is.readInt();
lat = __is.readInt();
gpsTime = __is.readInt();
addr = __is.readString();
}
public static final long serialVersionUID = -6174067657958401057L;
}
// **********************************************************************
//
// 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 `HDao_gps.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package cn.com.glsx.devicemonitor.iceprotocol.hdao;
public final class DeviceInfoHolder
{
public
DeviceInfoHolder()
{
}
public
DeviceInfoHolder(DeviceInfo value)
{
this.value = value;
}
public DeviceInfo 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 `HDao_gps.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package cn.com.glsx.devicemonitor.iceprotocol.hdao;
public final class DeviceListHelper
{
public static void
write(IceInternal.BasicStream __os, DeviceInfo[] __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 DeviceInfo[]
read(IceInternal.BasicStream __is)
{
DeviceInfo[] __v;
final int __len0 = __is.readAndCheckSeqSize(21);
__v = new DeviceInfo[__len0];
for(int __i0 = 0; __i0 < __len0; __i0++)
{
__v[__i0] = new DeviceInfo();
__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 `HDao_gps.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package cn.com.glsx.devicemonitor.iceprotocol.hdao;
public final class DeviceListHolder
{
public
DeviceListHolder()
{
}
public
DeviceListHolder(DeviceInfo[] value)
{
this.value = value;
}
public DeviceInfo[] 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 `HDao_gps.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package cn.com.glsx.devicemonitor.iceprotocol.hdao;
public class InRegionDevices implements Cloneable, java.io.Serializable
{
public int ret;
public DeviceInfo[] devInfo;
public InRegionDevices()
{
}
public InRegionDevices(int ret, DeviceInfo[] devInfo)
{
this.ret = ret;
this.devInfo = devInfo;
}
public boolean
equals(Object rhs)
{
if(this == rhs)
{
return true;
}
InRegionDevices _r = null;
if(rhs instanceof InRegionDevices)
{
_r = (InRegionDevices)rhs;
}
if(_r != null)
{
if(ret != _r.ret)
{
return false;
}
if(!java.util.Arrays.equals(devInfo, _r.devInfo))
{
return false;
}
return true;
}
return false;
}
public int
hashCode()
{
int __h = 5381;
__h = IceInternal.HashUtil.hashAdd(__h, "::HDaoGps::InRegionDevices");
__h = IceInternal.HashUtil.hashAdd(__h, ret);
__h = IceInternal.HashUtil.hashAdd(__h, devInfo);
return __h;
}
public Object
clone()
{
Object o = null;
try
{
o = super.clone();
}
catch(CloneNotSupportedException ex)
{
assert false; // impossible
}
return o;
}
public void
__write(IceInternal.BasicStream __os)
{
__os.writeInt(ret);
DeviceListHelper.write(__os, devInfo);
}
public void
__read(IceInternal.BasicStream __is)
{
ret = __is.readInt();
devInfo = DeviceListHelper.read(__is);
}
public static final long serialVersionUID = 7218141244529665699L;
}
// **********************************************************************
//
// 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 `HDao_gps.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package cn.com.glsx.devicemonitor.iceprotocol.hdao;
public final class InRegionDevicesHolder
{
public
InRegionDevicesHolder()
{
}
public
InRegionDevicesHolder(InRegionDevices value)
{
this.value = value;
}
public InRegionDevices 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 `HDao_gps.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package cn.com.glsx.devicemonitor.iceprotocol.hdao;
public class RegionData implements Cloneable, java.io.Serializable
{
public int leftLng;
public int leftLat;
public int rightLng;
public int rightLat;
public RegionData()
{
}
public RegionData(int leftLng, int leftLat, int rightLng, int rightLat)
{
this.leftLng = leftLng;
this.leftLat = leftLat;
this.rightLng = rightLng;
this.rightLat = rightLat;
}
public boolean
equals(Object rhs)
{
if(this == rhs)
{
return true;
}
RegionData _r = null;
if(rhs instanceof RegionData)
{
_r = (RegionData)rhs;
}
if(_r != null)
{
if(leftLng != _r.leftLng)
{
return false;
}
if(leftLat != _r.leftLat)
{
return false;
}
if(rightLng != _r.rightLng)
{
return false;
}
if(rightLat != _r.rightLat)
{
return false;
}
return true;
}
return false;
}
public int
hashCode()
{
int __h = 5381;
__h = IceInternal.HashUtil.hashAdd(__h, "::HDaoGps::RegionData");
__h = IceInternal.HashUtil.hashAdd(__h, leftLng);
__h = IceInternal.HashUtil.hashAdd(__h, leftLat);
__h = IceInternal.HashUtil.hashAdd(__h, rightLng);
__h = IceInternal.HashUtil.hashAdd(__h, rightLat);
return __h;
}
public Object
clone()
{
Object o = null;
try
{
o = super.clone();
}
catch(CloneNotSupportedException ex)
{
assert false; // impossible
}
return o;
}
public void
__write(IceInternal.BasicStream __os)
{
__os.writeInt(leftLng);
__os.writeInt(leftLat);
__os.writeInt(rightLng);
__os.writeInt(rightLat);
}
public void
__read(IceInternal.BasicStream __is)
{
leftLng = __is.readInt();
leftLat = __is.readInt();
rightLng = __is.readInt();
rightLat = __is.readInt();
}
public static final long serialVersionUID = -7716826721285397147L;
}
// **********************************************************************
//
// 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 `HDao_gps.ice'
//
// Warning: do not edit this file.
//
// </auto-generated>
//
package cn.com.glsx.devicemonitor.iceprotocol.hdao;
public final class RegionDataHolder
{
public
RegionDataHolder()
{
}
public
RegionDataHolder(RegionData value)
{
this.value = value;
}
public RegionData value;
}
......@@ -129,4 +129,7 @@ public interface _DaoGpsServiceDel extends Ice._ObjectDel
boolean getGpsByBsRecordsOfLatesBs(BsGetRequest req, DaoBsDataRespHolder res, java.util.Map<String, String> __ctx, Ice.Instrumentation.InvocationObserver __obsv)
throws IceInternal.LocalExceptionWrapper;
boolean getDeviceInfoOfRegion(RegionData req, InRegionDevicesHolder res, java.util.Map<String, String> __ctx, Ice.Instrumentation.InvocationObserver __obsv)
throws IceInternal.LocalExceptionWrapper;
}
......@@ -282,6 +282,58 @@ public final class _DaoGpsServiceDelD extends Ice._ObjectDelD implements _DaoGps
return __result.value;
}
public boolean getDeviceInfoOfRegion(final RegionData req, final InRegionDevicesHolder res, java.util.Map<String, String> __ctx, Ice.Instrumentation.InvocationObserver __observer)
throws IceInternal.LocalExceptionWrapper
{
final Ice.Current __current = new Ice.Current();
__initCurrent(__current, "getDeviceInfoOfRegion", 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)
{
DaoGpsService __servant = null;
if(__obj == null || __obj instanceof DaoGpsService)
{
__servant = (DaoGpsService)__obj;
}
else
{
throw new Ice.OperationNotExistException(__current.id, __current.facet, __current.operation);
}
__result.value = __servant.getDeviceInfoOfRegion(req, 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(Throwable __ex)
{
IceInternal.LocalExceptionWrapper.throwWrapper(__ex);
}
return __result.value;
}
public boolean getDevicesGpsInfo(final BatchGpsDevInfoRequest req, final BatchGpsDevInfoResponseHolder res, java.util.Map<String, String> __ctx, Ice.Instrumentation.InvocationObserver __observer)
throws IceInternal.LocalExceptionWrapper
{
......
......@@ -273,6 +273,56 @@ public final class _DaoGpsServiceDelM extends Ice._ObjectDelM implements _DaoGps
}
public boolean
getDeviceInfoOfRegion(RegionData req, InRegionDevicesHolder res, java.util.Map<String, String> __ctx, Ice.Instrumentation.InvocationObserver __observer)
throws IceInternal.LocalExceptionWrapper
{
IceInternal.Outgoing __og = __handler.getOutgoing("getDeviceInfoOfRegion", 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();
res.value = new InRegionDevices();
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);
}
}
public boolean
getDevicesGpsInfo(BatchGpsDevInfoRequest req, BatchGpsDevInfoResponseHolder res, java.util.Map<String, String> __ctx, Ice.Instrumentation.InvocationObserver __observer)
throws IceInternal.LocalExceptionWrapper
{
......
......@@ -95,6 +95,11 @@ public abstract class _DaoGpsServiceDisp extends Ice.ObjectImpl implements DaoGp
return getDayLastGpsRecord(req, res, null);
}
public final boolean getDeviceInfoOfRegion(RegionData req, InRegionDevicesHolder res)
{
return getDeviceInfoOfRegion(req, res, null);
}
public final boolean getDevicesGpsInfo(BatchGpsDevInfoRequest req, BatchGpsDevInfoResponseHolder res)
{
return getDevicesGpsInfo(req, res, null);
......@@ -862,6 +867,23 @@ public abstract class _DaoGpsServiceDisp extends Ice.ObjectImpl implements DaoGp
return Ice.DispatchStatus.DispatchOK;
}
public static Ice.DispatchStatus ___getDeviceInfoOfRegion(DaoGpsService __obj, IceInternal.Incoming __inS, Ice.Current __current)
{
__checkMode(Ice.OperationMode.Normal, __current.mode);
IceInternal.BasicStream __is = __inS.startReadParams();
RegionData req;
req = new RegionData();
req.__read(__is);
__inS.endReadParams();
InRegionDevicesHolder res = new InRegionDevicesHolder();
boolean __ret = __obj.getDeviceInfoOfRegion(req, 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 =
{
"convGeoGps",
......@@ -869,6 +891,7 @@ public abstract class _DaoGpsServiceDisp extends Ice.ObjectImpl implements DaoGp
"getBsWorkModeRecords",
"getDataCardInfo",
"getDayLastGpsRecord",
"getDeviceInfoOfRegion",
"getDevicesGpsInfo",
"getDevicesTotalCount",
"getFirstBsRecord",
......@@ -938,142 +961,146 @@ public abstract class _DaoGpsServiceDisp extends Ice.ObjectImpl implements DaoGp
}
case 5:
{
return ___getDevicesGpsInfo(this, in, __current);
return ___getDeviceInfoOfRegion(this, in, __current);
}
case 6:
{
return ___getDevicesTotalCount(this, in, __current);
return ___getDevicesGpsInfo(this, in, __current);
}
case 7:
{
return ___getFirstBsRecord(this, in, __current);
return ___getDevicesTotalCount(this, in, __current);
}
case 8:
{
return ___getFirstGpsBsRecord(this, in, __current);
return ___getFirstBsRecord(this, in, __current);
}
case 9:
{
return ___getFirstGpsRecord(this, in, __current);
return ___getFirstGpsBsRecord(this, in, __current);
}
case 10:
{
return ___getGpsBsRecords(this, in, __current);
return ___getFirstGpsRecord(this, in, __current);
}
case 11:
{
return ___getGpsByBsRecordsOfLatesBs(this, in, __current);
return ___getGpsBsRecords(this, in, __current);
}
case 12:
{
return ___getGpsByLatestBsRecord(this, in, __current);
return ___getGpsByBsRecordsOfLatesBs(this, in, __current);
}
case 13:
{
return ___getGpsRecords(this, in, __current);
return ___getGpsByLatestBsRecord(this, in, __current);
}
case 14:
{
return ___getGpsRecordsByImei(this, in, __current);
return ___getGpsRecords(this, in, __current);
}
case 15:
{
return ___getGpsRecordsByMapSn(this, in, __current);
return ___getGpsRecordsByImei(this, in, __current);
}
case 16:
{
return ___getGpsRecordsEx(this, in, __current);
return ___getGpsRecordsByMapSn(this, in, __current);
}
case 17:
{
return ___getGpsWorkModeRecords(this, in, __current);
return ___getGpsRecordsEx(this, in, __current);
}
case 18:
{
return ___getLatestBatteryRecord(this, in, __current);
return ___getGpsWorkModeRecords(this, in, __current);
}
case 19:
{
return ___getLatestBsRecord(this, in, __current);
return ___getLatestBatteryRecord(this, in, __current);
}
case 20:
{
return ___getLatestGpsBsRecord(this, in, __current);
return ___getLatestBsRecord(this, in, __current);
}
case 21:
{
return ___getLatestGpsRecord(this, in, __current);
return ___getLatestGpsBsRecord(this, in, __current);
}
case 22:
{
return ___getLatestGpsRecordByImei(this, in, __current);
return ___getLatestGpsRecord(this, in, __current);
}
case 23:
{
return ___getLatestGpsRecordByMapSn(this, in, __current);
return ___getLatestGpsRecordByImei(this, in, __current);
}
case 24:
{
return ___getLatestGpsTime(this, in, __current);
return ___getLatestGpsRecordByMapSn(this, in, __current);
}
case 25:
{
return ___getLatestGpsWifiRecords(this, in, __current);
return ___getLatestGpsTime(this, in, __current);
}
case 26:
{
return ___getLatestLocationByLbsRecord(this, in, __current);
return ___getLatestGpsWifiRecords(this, in, __current);
}
case 27:
{
return ___getLatestRgpsRecord(this, in, __current);
return ___getLatestLocationByLbsRecord(this, in, __current);
}
case 28:
{
return ___getLatestVolRecord(this, in, __current);
return ___getLatestRgpsRecord(this, in, __current);
}
case 29:
{
return ___getMaxVolDiff(this, in, __current);
return ___getLatestVolRecord(this, in, __current);
}
case 30:
{
return ___getParadeCarAlarmRecords(this, in, __current);
return ___getMaxVolDiff(this, in, __current);
}
case 31:
{
return ___getParadeCarGpsRecords(this, in, __current);
return ___getParadeCarAlarmRecords(this, in, __current);
}
case 32:
{
return ___getRecentBsRecords(this, in, __current);
return ___getParadeCarGpsRecords(this, in, __current);
}
case 33:
{
return ___getRecentGpsRecords(this, in, __current);
return ___getRecentBsRecords(this, in, __current);
}
case 34:
{
return ___getSnMapRecords(this, in, __current);
return ___getRecentGpsRecords(this, in, __current);
}
case 35:
{
return ___getVoltageRecords(this, in, __current);
return ___getSnMapRecords(this, in, __current);
}
case 36:
{
return ___ice_id(this, in, __current);
return ___getVoltageRecords(this, in, __current);
}
case 37:
{
return ___ice_ids(this, in, __current);
return ___ice_id(this, in, __current);
}
case 38:
{
return ___ice_isA(this, in, __current);
return ___ice_ids(this, in, __current);
}
case 39:
{
return ___ice_isA(this, in, __current);
}
case 40:
{
return ___ice_ping(this, in, __current);
}
}
......
......@@ -93,4 +93,6 @@ public interface _DaoGpsServiceOperations
boolean getGpsByLatestBsRecord(LatestBsGetRequest req, DaoBsDataRespHolder res, Ice.Current __current);
boolean getGpsByBsRecordsOfLatesBs(BsGetRequest req, DaoBsDataRespHolder res, Ice.Current __current);
boolean getDeviceInfoOfRegion(RegionData req, InRegionDevicesHolder res, Ice.Current __current);
}
......@@ -93,4 +93,6 @@ public interface _DaoGpsServiceOperationsNC
boolean getGpsByLatestBsRecord(LatestBsGetRequest req, DaoBsDataRespHolder res);
boolean getGpsByBsRecordsOfLatesBs(BsGetRequest req, DaoBsDataRespHolder res);
boolean getDeviceInfoOfRegion(RegionData req, InRegionDevicesHolder res);
}
package cn.com.glsx.devicemonitor.modules.api;
import cn.com.glsx.devicemonitor.api.dto.request.RegionalSearchRequest;
import cn.com.glsx.devicemonitor.api.dto.response.RegionalSearchDTO;
import cn.com.glsx.devicemonitor.api.dto.response.StayPointRecordDTO;
import cn.com.glsx.devicemonitor.api.feign.RegionalSearchServiceApi;
import cn.com.glsx.devicemonitor.modules.service.RegionalSearchService;
import cn.hutool.core.date.StopWatch;
import cn.hutool.json.JSONUtil;
import com.glsx.plat.core.web.R;
import io.swagger.annotations.Api;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* @author Yanglinlong
* @date 2023/3/13 14:02
*/
@Slf4j
@Validated
@RestController
@RequestMapping("/api/regional")
@Api(value = "区域查车", tags = "区域查车")
public class FeignRegionalSearchController implements RegionalSearchServiceApi {
@Autowired
private RegionalSearchService regionalSearchService;
@GetMapping("/getDeviceInfoOfRegion")
@Override
public R<List<RegionalSearchDTO>> getDeviceInfoOfRegion(@SpringQueryMap RegionalSearchRequest regionalSearchRequest) {
log.info("regionalSearchRequest ===" + JSONUtil.toJsonStr(regionalSearchRequest));
StopWatch sw = new StopWatch();
sw.start("Controller getDeviceInfoOfRegion");
List<RegionalSearchDTO> list = regionalSearchService.getDeviceInfoOfRegion(regionalSearchRequest.getLeftLngLat(), regionalSearchRequest.getRightLngLat());
sw.stop();
log.info(sw.getLastTaskName() + "总耗时:" + sw.getTotalTimeSeconds() + "s");
return R.ok().data(list);
}
}
......@@ -38,6 +38,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author wangxw
......@@ -1010,4 +1011,52 @@ public class HdaoGpsComponent {
log.info("failed!!");
return null;
}
/**
* 根据左下右上经纬度点查询设备
*
* @param leftLngLat 左经纬度点
* @param rightLngLat 右经纬度点
* @return
*/
public List<DataGpsLocation> getDeviceInfoOfRegion(String leftLngLat, String rightLngLat) {
log.info("开始调用getDeviceInfoOfRegion===左经纬度:" + leftLngLat + ";右经纬度:" + rightLngLat);
int convert = 1000000;
RegionData req = new RegionData();
req.leftLng = (int) (Float.parseFloat(leftLngLat.split(",")[0]) * convert);
req.leftLat = (int) (Float.parseFloat(leftLngLat.split(",")[1]) * convert);
req.rightLng = (int) (Float.parseFloat(rightLngLat.split(",")[0]) * convert);
req.rightLat = (int) (Float.parseFloat(rightLngLat.split(",")[1]) * convert);
log.info("req===" + JSONUtil.toJsonStr(req));
try {
InRegionDevicesHolder res = new InRegionDevicesHolder();
boolean ret = daoGpsServicePrx.getDeviceInfoOfRegion(req, res);
if (ret) {
if (res.value.ret == 0) {
DeviceInfo[] deviceInfos = res.value.devInfo;
return Arrays.stream(deviceInfos).parallel().map(deviceInfo -> {
DataGpsLocation gpsLocation = new DataGpsLocation();
gpsLocation.setSn(String.valueOf(deviceInfo.sn));
gpsLocation.setLat(LocationUtil.latlng(deviceInfo.lat));
gpsLocation.setLng(LocationUtil.latlng(deviceInfo.lng));
gpsLocation.setDateTime(DateFormatUtil.toStringFromTimestamp(deviceInfo.gpsTime, DateFormatUtil.pattern01));
gpsLocation.setAddress(deviceInfo.addr);
return gpsLocation;
}).collect(Collectors.toList());
}
if (res.value.ret == 1) {
log.info("getDeviceInfoOfRegion no recod!!");
return Lists.newArrayList();
}
}
} catch (Exception e) {
log.error("getDeviceInfoOfRegion:Exception!!!!message:" + e.getMessage());
e.printStackTrace();
return Lists.newArrayList();
}
log.info("failed!!");
return Lists.newArrayList();
}
}
package cn.com.glsx.devicemonitor.modules.service;
import cn.com.glsx.devicemonitor.api.dto.response.RegionalSearchDTO;
import java.util.List;
/**
* @author Yanglinlong
* @date 2023/3/13 14:03
*/
public interface RegionalSearchService {
/**
* 根据经纬度点查询设备号
*
* @param leftLngLat 左经纬度点
* @param rightLngLat 右经纬度点
* @return
*/
List<RegionalSearchDTO> getDeviceInfoOfRegion(String leftLngLat, String rightLngLat);
}
package cn.com.glsx.devicemonitor.modules.service.impl;
import cn.com.glsx.devicemonitor.api.dto.response.RegionalSearchDTO;
import cn.com.glsx.devicemonitor.modules.components.HdaoGpsComponent;
import cn.com.glsx.devicemonitor.modules.entity.inner.DataGpsLocation;
import cn.com.glsx.devicemonitor.modules.service.RegionalSearchService;
import cn.hutool.core.date.StopWatch;
import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.stream.Collectors;
/**
* 区域查车
*
* @author Yanglinlong
* @date 2023/3/13 14:03
*/
@Slf4j
@Service
public class RegionalSearchsServiceImpl implements RegionalSearchService {
@Autowired
private HdaoGpsComponent hdaoGpsComponent;
public List<RegionalSearchDTO> getDeviceInfoOfRegion(String leftLngLat, String rightLngLat) {
StopWatch sw = new StopWatch();
sw.start("getDeviceInfoOfRegion");
List<DataGpsLocation> deviceInfoOfRegionList = hdaoGpsComponent.getDeviceInfoOfRegion(leftLngLat, rightLngLat);
log.debug("deviceInfoOfRegionList===" + JSONUtil.toJsonStr(deviceInfoOfRegionList));
log.info("deviceInfoOfRegionList size===" + deviceInfoOfRegionList.size());
sw.stop();
log.info(sw.getLastTaskName() + "耗时:" + sw.getLastTaskTimeMillis() + "ms");
sw.start("mapGeoConvert");
List<RegionalSearchDTO> regionalSearchList = deviceInfoOfRegionList.parallelStream().map(dataGpsLocation -> {
RegionalSearchDTO dto = new RegionalSearchDTO();
dto.setSn(dataGpsLocation.getSn());
dto.setLng(dataGpsLocation.getLng());
dto.setLat(dataGpsLocation.getLat());
dto.setGpsTime(dataGpsLocation.getDateTime());
// 经纬度转为地址
// String address = hdaoGpsComponent.mapGeoConvert(dataGpsLocation.getLat(), dataGpsLocation.getLng());
dto.setAddress(dataGpsLocation.getAddress());
return dto;
}).collect(Collectors.toList());
sw.stop();
log.info(sw.getLastTaskName() + "耗时:" + sw.getLastTaskTimeMillis() + "ms");
log.info("RegionalSearchService 总耗时:" + sw.getTotalTimeSeconds() + "s");
log.debug("regionalSearchList===" + JSONUtil.toJsonStr(regionalSearchList));
return regionalSearchList;
}
}
......@@ -63,7 +63,7 @@ public class GpsBsLocationServiceImplTest {
@Test
public void testGetGpsByBsRecordsOfLatesBs() {
GpsLocation bsRecordsOfLatesBs = gpsBsLocationService.getGpsByBsRecordsOfLatesBs("2192801101", DeviceTypeRelationEnum.GPS, "2022-11-07 10:40:32", "2022-11-07 16:40:32");
GpsLocation bsRecordsOfLatesBs = gpsBsLocationService.getGpsByBsRecordsOfLatesBs("93107720006", DeviceTypeRelationEnum.GPS, "2022-10-24 13:48:35", "2022-11-08 13:48:35");
System.out.println("bsRecordsOfLatesBs = " + JSONUtil.toJsonStr(bsRecordsOfLatesBs));
}
......
package cn.com.glsx.devicemonitor.modules.service.impl;
import cn.com.glsx.Application;
import cn.com.glsx.devicemonitor.api.dto.response.RegionalSearchDTO;
import cn.com.glsx.devicemonitor.iceprotocol.hdao.DeviceInfo;
import cn.com.glsx.devicemonitor.modules.entity.inner.DataGpsLocation;
import cn.com.glsx.devicemonitor.modules.service.RegionalSearchService;
import cn.com.glsx.devicemonitor.modules.utils.DateFormatUtil;
import cn.com.glsx.devicemonitor.modules.utils.LocationUtil;
import cn.hutool.json.JSONUtil;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import static org.junit.Assert.*;
@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class RegionalSearchsServiceImplTest {
@Autowired
private RegionalSearchService regionalSearchService;
@Test
public void getDeviceInfoOfRegion() {
List<RegionalSearchDTO> deviceInfoOfRegion = regionalSearchService.getDeviceInfoOfRegion("113,22.3", "120,45.1");
// List<RegionalSearchDTO> deviceInfoOfRegion = regionalSearchService.getDeviceInfoOfRegion("0,0", "90,180");
System.out.println("deviceInfoOfRegion = " + JSONUtil.toJsonStr(deviceInfoOfRegion.get(0)));
System.out.println("deviceInfoOfRegion = " + deviceInfoOfRegion.size());
}
@Test
public void testParallelMap() {
DeviceInfo[] deviceInfos = new DeviceInfo[5];
List<DataGpsLocation> collect = Arrays.stream(deviceInfos).parallel().map(deviceInfo -> {
DataGpsLocation gpsLocation = new DataGpsLocation();
gpsLocation.setSn(String.valueOf(deviceInfo.sn));
gpsLocation.setLat(LocationUtil.latlng(deviceInfo.lat));
gpsLocation.setLng(LocationUtil.latlng(deviceInfo.lng));
gpsLocation.setDateTime(DateFormatUtil.toStringFromTimestamp(deviceInfo.gpsTime, DateFormatUtil.pattern01));
gpsLocation.setAddress(deviceInfo.addr);
return gpsLocation;
}).collect(Collectors.toList());
System.out.println("collect = " + JSONUtil.toJsonStr(collect));
}
}
\ 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!