|
|
|
@ -46,6 +46,9 @@ public class AnalyseRequestServiceImpl implements IAnalyseRequestService { |
|
|
|
private static final Set<String> METER_TYPES = new HashSet<>(Arrays.asList( |
|
|
|
AlgConstants.METER |
|
|
|
)); |
|
|
|
private static final Set<String> GIS_METER_TYPES = new HashSet<>(Arrays.asList( |
|
|
|
AlgConstants.GIS_METER_2 |
|
|
|
)); |
|
|
|
@Resource |
|
|
|
private RedisService redisService; |
|
|
|
@Value("${task.test-mode:false}") |
|
|
|
@ -115,6 +118,18 @@ public class AnalyseRequestServiceImpl implements IAnalyseRequestService { |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
public static boolean checkGisMeter2Type(String[] typeList) { |
|
|
|
if (typeList == null) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
for (String type : typeList) { |
|
|
|
if (GIS_METER_TYPES.contains(type)) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
try { |
|
|
|
ObjectMapper mapper = new ObjectMapper(); |
|
|
|
@ -142,7 +157,7 @@ public class AnalyseRequestServiceImpl implements IAnalyseRequestService { |
|
|
|
analyseReq.getRequestId() : UUID.randomUUID().toString().trim().replaceAll(StringUtils.DASH, StringUtils.EMPTY); |
|
|
|
String taskPatrolId = analyseReq.getTaskPatrolId(); |
|
|
|
redisService.setCacheObject(RedisConst.REQUEST_UUID + requestId, taskPatrolId, requestTimeout, TimeUnit.DAYS); |
|
|
|
//log.info("CALL_REMOTE_ANALYZE isFilter: {}, requestId: {}, taskPatrolId: {}", isFilter, requestId, taskPatrolId); |
|
|
|
log.info("CALL_REMOTE_ANALYZE isFilter: {}, requestId: {}, typeList: {}", isFilter, requestId, typeList); |
|
|
|
|
|
|
|
analyseReq.setRequestId(requestId); |
|
|
|
String taskSetKey = AnalyseConstants.ANALYSE_TASK_REQUEST + taskPatrolId; |
|
|
|
@ -191,6 +206,10 @@ public class AnalyseRequestServiceImpl implements IAnalyseRequestService { |
|
|
|
log.info("ANALYSE_FILTER_URL requestId: {}, requestUrl: {}", requestId, requestUrl); |
|
|
|
} |
|
|
|
|
|
|
|
// 初筛读取无机人图片XMP位姿信息 |
|
|
|
if (droneXmpEnabled) { |
|
|
|
readDroneImageXmpInfo(analyseReq); |
|
|
|
} |
|
|
|
} else { |
|
|
|
// 不再使用这个redis键值 |
|
|
|
// analyseReq.getObjectList().forEach((item) -> { |
|
|
|
@ -199,14 +218,23 @@ public class AnalyseRequestServiceImpl implements IAnalyseRequestService { |
|
|
|
// redisService.redisTemplate.opsForSet().add(requestSetKey, item.toResultValue(type)); |
|
|
|
// } |
|
|
|
// }); |
|
|
|
|
|
|
|
// 红外分析路径 |
|
|
|
if (checkInfraredType(typeList)) { |
|
|
|
requestUrl = patrolTaskService.selectConfigByKey(AnalyseConstants.ANALYSIS_BIG_URL_INFRARED); |
|
|
|
log.info("ANALYSIS_BIG_URL_INFRARED requestId: {}, requestUrl: {}", requestId, requestUrl); |
|
|
|
} else if (checkMeterType(typeList)) { |
|
|
|
} |
|
|
|
// 表计读数分析路径 |
|
|
|
else if (checkMeterType(typeList)) { |
|
|
|
requestUrl = patrolTaskService.selectConfigByKey(AnalyseConstants.ANALYSIS_BIG_URL_METER); |
|
|
|
log.info("ANALYSIS_BIG_URL_METER requestId: {}, requestUrl: {}", requestId, requestUrl); |
|
|
|
} else { |
|
|
|
} |
|
|
|
// 无人机gis_meter2读数分析路径 |
|
|
|
else if (checkGisMeter2Type(typeList)) { |
|
|
|
requestUrl = patrolTaskService.selectConfigByKey(AnalyseConstants.ANALYSIS_BIG_URL_GIS_METER_2); |
|
|
|
log.info("ANALYSIS_BIG_URL_GIS_METER_2 requestId: {}, requestUrl: {}", requestId, requestUrl); |
|
|
|
} |
|
|
|
// 默认大模型分析路径 |
|
|
|
else { |
|
|
|
requestUrl = patrolTaskService.selectConfigByKey(AnalyseConstants.ANALYSIS_BIG_URL); |
|
|
|
log.info("DEFAULT ANALYSIS_BIG_URL requestId: {}, requestUrl: {}", requestId, requestUrl); |
|
|
|
} |
|
|
|
@ -233,11 +261,6 @@ public class AnalyseRequestServiceImpl implements IAnalyseRequestService { |
|
|
|
delayQueueService.submitRequest(AnalyseConstants.ALGORITHM_REQUEST_DELAY_QUEUE, analyseReq.getRequestId(), requestTimeout, TimeUnit.DAYS); |
|
|
|
} |
|
|
|
|
|
|
|
// 读取无机人图片XMP位姿信息 |
|
|
|
if (droneXmpEnabled) { |
|
|
|
readDroneImageXmpInfo(analyseReq); |
|
|
|
} |
|
|
|
|
|
|
|
if (retryDelegate.callRemoteAnalyseService(analyseReq)) { |
|
|
|
log.info("CALL_REMOTE_ANALYSE SUCCESS, taskPatrolId: {}, requestId: {}", |
|
|
|
analyseReq.getTaskPatrolId(), |
|
|
|
|