|
|
|
@ -91,12 +91,15 @@ public class AnalyseRequestServiceImpl implements IAnalyseRequestService { |
|
|
|
// } |
|
|
|
// }); |
|
|
|
|
|
|
|
if(checkInfraredType(typeList)) { |
|
|
|
if (checkInfraredType(typeList)) { |
|
|
|
requestUrl = patrolTaskService.selectConfigByKey(AnalyseConstants.ANALYSIS_BIG_URL_INFRARED); |
|
|
|
log.info("BIG_MODEL_INFRARED requestId: {}, requestUrl: {}", requestId, requestUrl); |
|
|
|
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); |
|
|
|
} else { |
|
|
|
requestUrl = patrolTaskService.selectConfigByKey(AnalyseConstants.ANALYSIS_BIG_URL); |
|
|
|
log.info("BIG_MODEL_OTHER requestId: {}, requestUrl: {}", requestId, requestUrl); |
|
|
|
log.info("DEFAULT ANALYSIS_BIG_URL requestId: {}, requestUrl: {}", requestId, requestUrl); |
|
|
|
} |
|
|
|
|
|
|
|
final String analyzeBigModelRequestIdRedisKey = AnalyseConstants.ANALYSE_AI_REQUEST.concat(requestId); |
|
|
|
@ -107,7 +110,7 @@ public class AnalyseRequestServiceImpl implements IAnalyseRequestService { |
|
|
|
redisService.setCacheObject(analyzeBigModelRequestIdRedisKey, analyseReq.clone(), requestTimeout, TimeUnit.DAYS); |
|
|
|
} |
|
|
|
|
|
|
|
if(StringUtil.isEmpty(requestUrl)) { |
|
|
|
if (StringUtil.isEmpty(requestUrl)) { |
|
|
|
requestUrl = "http://localhost:8080"; |
|
|
|
} |
|
|
|
|
|
|
|
@ -115,13 +118,13 @@ public class AnalyseRequestServiceImpl implements IAnalyseRequestService { |
|
|
|
analyseReq.setRequestUrl(requestUrl.concat(AnalyseConstants.ANALYSE_URI)); |
|
|
|
analyseReq.setRedissonTime(DateUtils.parseDateToStr(DateUtils.yyyyMMddHHmmss, new Date())); |
|
|
|
|
|
|
|
if(testMode) { |
|
|
|
if (testMode) { |
|
|
|
delayQueueService.submitRequest(AnalyseConstants.ANALYSE_REQ_DELAY_QUEUE, analyseReq, (3L), TimeUnit.MINUTES); |
|
|
|
} else { |
|
|
|
delayQueueService.submitRequest(AnalyseConstants.ANALYSE_REQ_DELAY_QUEUE, analyseReq, requestTimeout, TimeUnit.DAYS); |
|
|
|
} |
|
|
|
|
|
|
|
if(!retryDelegate.callRemoteAnalyseService(analyseReq)) { |
|
|
|
if (!retryDelegate.callRemoteAnalyseService(analyseReq)) { |
|
|
|
log.info("FINALLY FAIL CALL REMOTE ANALYSE SERVICE, requestId: {}, taskPatrolId: {}", |
|
|
|
analyseReq.getRequestId(), |
|
|
|
analyseReq.getTaskPatrolId()); |
|
|
|
@ -141,6 +144,10 @@ public class AnalyseRequestServiceImpl implements IAnalyseRequestService { |
|
|
|
AlgConstants.INFRA_CAMERA_REVERSE |
|
|
|
)); |
|
|
|
|
|
|
|
private static final Set<String> METER_TYPES = new HashSet<>(Arrays.asList( |
|
|
|
AlgConstants.METER |
|
|
|
)); |
|
|
|
|
|
|
|
public static boolean checkInfraredType(String[] typeList) { |
|
|
|
if (typeList == null) { |
|
|
|
return false; |
|
|
|
@ -153,6 +160,18 @@ public class AnalyseRequestServiceImpl implements IAnalyseRequestService { |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
public static boolean checkMeterType(String[] typeList) { |
|
|
|
if (typeList == null) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
for (String type : typeList) { |
|
|
|
if (METER_TYPES.contains(type)) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
try { |
|
|
|
ObjectMapper mapper = new ObjectMapper(); |
|
|
|
|