|
|
|
@ -117,7 +117,6 @@ public class DataProcessServiceImpl implements IDataProcessService {
|
|
|
|
|
*/
|
|
|
|
|
key = TdEngineConstants.TDENGINE_KEY_TRANSFER_MAP.get(key) == null ? key
|
|
|
|
|
: TdEngineConstants.TDENGINE_KEY_TRANSFER_MAP.get(key);
|
|
|
|
|
System.out.println(key + "---" + value);
|
|
|
|
|
|
|
|
|
|
if (value instanceof String) {
|
|
|
|
|
String valueStr = (String) value;
|
|
|
|
@ -157,13 +156,10 @@ public class DataProcessServiceImpl implements IDataProcessService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
System.out.println(databaseName + "---" + tableName);
|
|
|
|
|
tdTableVo.setDatabaseName(databaseName);
|
|
|
|
|
tdTableVo.setTableName(tableName);
|
|
|
|
|
tdTableVo.setSchemaFields(schemaFields);
|
|
|
|
|
|
|
|
|
|
System.out.println("longtitude:" + longitude + "latit:" + latitude);
|
|
|
|
|
|
|
|
|
|
final R<?> insertResult = this.remoteTdEngineService.insertTable(tdTableVo);
|
|
|
|
|
if (insertResult.getCode() == ResultEnums.SUCCESS.getCode()) {
|
|
|
|
|
logger.info("Insert data result: {}", insertResult.getMsg());
|
|
|
|
@ -189,20 +185,16 @@ public class DataProcessServiceImpl implements IDataProcessService {
|
|
|
|
|
* @date 2023-09-04 14:04
|
|
|
|
|
*/
|
|
|
|
|
private void checkElectronicFence(Long deviceId, Long tenantId, Long monitorUnitId, Long sceneId, Object longitude, Object latitude, Long ts) {
|
|
|
|
|
List<HwElectronicFence> hwElectronicFences = hwElectronicFenceMapper.selectElectronicFencesByDeviceId(deviceId);
|
|
|
|
|
if (StringUtils.isEmpty(hwElectronicFences)) {
|
|
|
|
|
System.out.println("---------");
|
|
|
|
|
hwElectronicFences = hwElectronicFenceMapper.selectElectronicFencesByMonitorUnitId(monitorUnitId);
|
|
|
|
|
}
|
|
|
|
|
if (StringUtils.isEmpty(hwElectronicFences)) {
|
|
|
|
|
hwElectronicFences = hwElectronicFenceMapper.selectElectronicFencesBySceneId(sceneId);
|
|
|
|
|
System.out.println("---------33333");
|
|
|
|
|
}
|
|
|
|
|
//根据设备ID、监控单元ID和场景ID获取所有的电子围栏配置。(目前先只支持场景)
|
|
|
|
|
// List<HwElectronicFence> hwElectronicFences = hwElectronicFenceMapper.selectElectronicFencesByDeviceId(deviceId);
|
|
|
|
|
// hwElectronicFences = hwElectronicFenceMapper.selectElectronicFencesByMonitorUnitId(monitorUnitId);
|
|
|
|
|
List<HwElectronicFence> hwElectronicFences = hwElectronicFenceMapper.selectElectronicFencesBySceneId(sceneId);
|
|
|
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(hwElectronicFences)) {
|
|
|
|
|
for (HwElectronicFence hwElectronicFence : hwElectronicFences) {
|
|
|
|
|
HwFenceArea queryFenceArea = new HwFenceArea();
|
|
|
|
|
queryFenceArea.setElectronicFenceId(hwElectronicFence.getElectronicFenceId());
|
|
|
|
|
//获取电子围栏下配置的区域列表
|
|
|
|
|
List<HwFenceArea> fenceAreas = hwFenceAreaMapper.selectHwFenceAreaList(queryFenceArea);
|
|
|
|
|
String effectiveTimeFlag = hwElectronicFence.getEffectiveTimeFlag();
|
|
|
|
|
String triggerStatus = hwElectronicFence.getTriggerStatus();
|
|
|
|
@ -212,6 +204,7 @@ public class DataProcessServiceImpl implements IDataProcessService {
|
|
|
|
|
if (effectiveTimeFlag.equals(HwDictConstants.EFFECTIVE_TIME_FLAG_LONG)) {
|
|
|
|
|
String areaShapeFlag = fenceArea.getAreaShapeFlag();
|
|
|
|
|
String areaRange = fenceArea.getAreaRange();
|
|
|
|
|
//多边形处理
|
|
|
|
|
if (areaShapeFlag.equals(HwDictConstants.AREA_SHAPE_FLAG_POLYGN)) {
|
|
|
|
|
LocationVo polygonVo = new LocationVo();
|
|
|
|
|
polygonVo.setMarkerType(LocationVo.MARKER_TYPE_POLYGON);
|
|
|
|
@ -237,9 +230,8 @@ public class DataProcessServiceImpl implements IDataProcessService {
|
|
|
|
|
} else if (triggerStatus.equals(HwDictConstants.ELECTRONIC_FENCE_TRIGGER_STATUS_ENTRY) && isWithin) {//如果电子围栏配置是入界,而此设备入界则报警
|
|
|
|
|
isAlarmed = true;
|
|
|
|
|
}
|
|
|
|
|
System.out.println("iswithin" + isWithin);
|
|
|
|
|
|
|
|
|
|
} else if (areaShapeFlag.equals(HwDictConstants.AREA_SHAPE_FLAG_CIRCULA)) {
|
|
|
|
|
} else if (areaShapeFlag.equals(HwDictConstants.AREA_SHAPE_FLAG_CIRCULA)) {//圆形处理
|
|
|
|
|
String[] areaRangeArr = areaRange.split(",");
|
|
|
|
|
String longitudeStr = areaRangeArr[0];
|
|
|
|
|
String latitudeStr = areaRangeArr[1];
|
|
|
|
@ -276,10 +268,7 @@ public class DataProcessServiceImpl implements IDataProcessService {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|