|
|
@ -150,6 +150,7 @@ public class AnalyseRequestServiceImpl implements IAnalyseRequestService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//qinyl |
|
|
//qinyl |
|
|
|
|
|
@Override |
|
|
public void sendRequest(AnalyseRequest analyseReq, String[] typeList, boolean isFilter) throws IOException { |
|
|
public void sendRequest(AnalyseRequest analyseReq, String[] typeList, boolean isFilter) throws IOException { |
|
|
final long requestTimeout = 1L; |
|
|
final long requestTimeout = 1L; |
|
|
//String requestId = UUID.randomUUID().toString().trim().replaceAll(StringUtils.DASH, StringUtils.EMPTY); |
|
|
//String requestId = UUID.randomUUID().toString().trim().replaceAll(StringUtils.DASH, StringUtils.EMPTY); |
|
|
@ -211,33 +212,8 @@ public class AnalyseRequestServiceImpl implements IAnalyseRequestService { |
|
|
readDroneImageXmpInfo(analyseReq); |
|
|
readDroneImageXmpInfo(analyseReq); |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
// 不再使用这个redis键值 |
|
|
|
|
|
// analyseReq.getObjectList().forEach((item) -> { |
|
|
|
|
|
// String[] itemTypeList = item.getTypeList(); |
|
|
|
|
|
// for (String type : itemTypeList) { |
|
|
|
|
|
// 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)) { |
|
|
|
|
|
requestUrl = patrolTaskService.selectConfigByKey(AnalyseConstants.ANALYSIS_BIG_URL_METER); |
|
|
|
|
|
log.info("ANALYSIS_BIG_URL_METER requestId: {}, requestUrl: {}", requestId, requestUrl); |
|
|
|
|
|
} |
|
|
|
|
|
// 无人机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); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 获取大模型分析接口地址 |
|
|
|
|
|
requestUrl = getLargeModelAnalysisUrl(typeList, requestId, analyseReq.getDrafter()); |
|
|
|
|
|
|
|
|
final String analyzeBigModelRequestIdRedisKey = AnalyseConstants.ANALYSE_AI_REQUEST.concat(requestId); |
|
|
final String analyzeBigModelRequestIdRedisKey = AnalyseConstants.ANALYSE_AI_REQUEST.concat(requestId); |
|
|
log.info("SEND_REQUEST_BIG_MODEL requestId: {}, analyzeBigModelRequestIdRedisKey: {}, analyseReq: {}", |
|
|
log.info("SEND_REQUEST_BIG_MODEL requestId: {}, analyzeBigModelRequestIdRedisKey: {}, analyseReq: {}", |
|
|
@ -249,6 +225,7 @@ public class AnalyseRequestServiceImpl implements IAnalyseRequestService { |
|
|
|
|
|
|
|
|
if (StringUtil.isEmpty(requestUrl)) { |
|
|
if (StringUtil.isEmpty(requestUrl)) { |
|
|
requestUrl = "http://localhost:8080"; |
|
|
requestUrl = "http://localhost:8080"; |
|
|
|
|
|
log.error("ANALYSIS URL IS EMPTY, isFilter: {}, requestId: {}, typeList: {}", isFilter, requestId, typeList); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
analyseReq.setFilter(isFilter); |
|
|
analyseReq.setFilter(isFilter); |
|
|
@ -294,6 +271,50 @@ public class AnalyseRequestServiceImpl implements IAnalyseRequestService { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 根据厂商或算法获取大模型分析地址 |
|
|
|
|
|
* @param typeList 算法 |
|
|
|
|
|
* @param requestId 请求唯一id标识 |
|
|
|
|
|
* @param drafter 算法厂商 |
|
|
|
|
|
* @return 大模型分析地址 |
|
|
|
|
|
*/ |
|
|
|
|
|
public String getLargeModelAnalysisUrl(String[] typeList, String requestId, String drafter) { |
|
|
|
|
|
String requestUrl = ""; |
|
|
|
|
|
|
|
|
|
|
|
// 根据厂商获取分析路径 |
|
|
|
|
|
if (!StringUtil.isEmpty(drafter)) { |
|
|
|
|
|
String key = "ANALYSIS_BIG_URL_" + drafter; |
|
|
|
|
|
requestUrl = patrolTaskService.selectConfigByKey(key); |
|
|
|
|
|
log.info("{} requestId: {}, requestUrl: {}", key, requestId, requestUrl); |
|
|
|
|
|
if(!StringUtils.isEmpty(requestUrl)) { |
|
|
|
|
|
return requestUrl; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 红外分析路径 |
|
|
|
|
|
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)) { |
|
|
|
|
|
requestUrl = patrolTaskService.selectConfigByKey(AnalyseConstants.ANALYSIS_BIG_URL_METER); |
|
|
|
|
|
log.info("ANALYSIS_BIG_URL_METER requestId: {}, requestUrl: {}", requestId, requestUrl); |
|
|
|
|
|
} |
|
|
|
|
|
// 无人机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); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return requestUrl; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public void readDroneImageXmpInfo(AnalyseRequest analyseReq) { |
|
|
public void readDroneImageXmpInfo(AnalyseRequest analyseReq) { |
|
|
String taskPatrolId = analyseReq.getTaskPatrolId(); |
|
|
String taskPatrolId = analyseReq.getTaskPatrolId(); |
|
|
PatrolTaskStatus taskStatus = patrolTaskStatusService.selectPatrolTaskStatusByTaskPatrolledId(taskPatrolId); |
|
|
PatrolTaskStatus taskStatus = patrolTaskStatusService.selectPatrolTaskStatusByTaskPatrolledId(taskPatrolId); |
|
|
|