|
|
|
@ -1,8 +1,10 @@ |
|
|
|
package com.inspect.partrolresult.controller; |
|
|
|
|
|
|
|
import com.alibaba.druid.support.json.JSONUtils; |
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.inspect.analysis.domain.ResultAnalysis; |
|
|
|
import com.inspect.analysis.domain.resultList; |
|
|
|
import com.inspect.analysis.service.IResultAnalysisService; |
|
|
|
import com.inspect.base.core.constant.Color; |
|
|
|
import com.inspect.base.core.domain.DataMsg; |
|
|
|
@ -567,7 +569,7 @@ public class PatrolResultController extends BaseController { |
|
|
|
sendData.setRequestHostPort(TASK_PORT); |
|
|
|
sendData.setRequestId(uuid); |
|
|
|
algName = JSONObject.toJSONString(sendData); |
|
|
|
System.out.println(algName); |
|
|
|
logger.info(algName); |
|
|
|
|
|
|
|
try { |
|
|
|
InfraredRequestParam infraredRequestParam = JSONObject.parseObject(algName, InfraredRequestParam.class); |
|
|
|
@ -693,6 +695,14 @@ public class PatrolResultController extends BaseController { |
|
|
|
String BIG_ANALYSIS_URL = patrolTaskService.selectConfigByKey("BIG_ANALYSIS_URL"); |
|
|
|
String MAJOR_URL = patrolTaskService.selectConfigByKey("MAJOR_URL"); |
|
|
|
String TASK_PORT = patrolTaskService.selectConfigByKey("TASK_PORT"); |
|
|
|
|
|
|
|
logger.info("ftp: " + ftp); |
|
|
|
logger.info("ANALYSIS_URL: {}", ANALYSIS_URL); |
|
|
|
logger.info("BIG_ANALYSIS_URL: {}", BIG_ANALYSIS_URL); |
|
|
|
logger.info("MAJOR_URL: {}", MAJOR_URL); |
|
|
|
logger.info("TASK_PORT: {}", TASK_PORT); |
|
|
|
logger.info("patrolResultList: " + patrolResultList); |
|
|
|
|
|
|
|
String ids = ""; |
|
|
|
for (PatrolResult patrolResult : patrolResultList) { |
|
|
|
List<AnalyseReqItem> filterList = new ArrayList<>(); |
|
|
|
@ -705,6 +715,8 @@ public class PatrolResultController extends BaseController { |
|
|
|
Map<String, String> map = patrolResultService.selectAlgorithmType(patrolResult.getDeviceId()); |
|
|
|
String[] strings = new String[1]; |
|
|
|
List<String> algIds = new ArrayList<>(); |
|
|
|
|
|
|
|
logger.info("map: " + map.toString()); |
|
|
|
if (map != null) { |
|
|
|
String subIdStr = map.get("alg_subtype_ids"); |
|
|
|
if (subIdStr.contains(StringUtils.COMMA)) { |
|
|
|
@ -728,12 +740,16 @@ public class PatrolResultController extends BaseController { |
|
|
|
if (patrolResultTemp.getAlgId() != null && !patrolResultTemp.getAlgId().isEmpty()) { |
|
|
|
algInfoList = patrolResultService.selectAlgInfo(patrolResultTemp); |
|
|
|
} |
|
|
|
logger.info("algInfoList: " + algInfoList); |
|
|
|
|
|
|
|
reqItem.setImageUrlList(image.split(StringUtils.COMMA)); |
|
|
|
String pictureFrame = patrolTaskService.selectConfigByKey("PICTURE_FRAME"); |
|
|
|
logger.info("pictureFrame: " + pictureFrame); |
|
|
|
|
|
|
|
String type; |
|
|
|
if (!algInfoList.isEmpty()) { |
|
|
|
List<AlgInfo> infraredList = algInfoList.stream().filter((item) -> { |
|
|
|
logger.info("item.getAlgSubtypeCode(): " + item.getAlgSubtypeCode()); |
|
|
|
return "infrared".equals(item.getAlgSubtypeCode()); |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
String[] typeArr; |
|
|
|
@ -778,6 +794,7 @@ public class PatrolResultController extends BaseController { |
|
|
|
} |
|
|
|
|
|
|
|
Map<String, String> judgeMap = resultAnalysisService.selectPointInfoById(patrolResult.getDeviceId()); |
|
|
|
logger.info("judgeMap: " + judgeMap.toString()); |
|
|
|
String filePanpath = ""; |
|
|
|
if (judgeMap != null && StringUtils.isNotEmpty(judgeMap.get("dis_ref_picture_path"))) { |
|
|
|
filePanpath = judgeMap.get("dis_ref_picture_path"); |
|
|
|
@ -826,6 +843,7 @@ public class PatrolResultController extends BaseController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
logger.info("firList.isEmpty():" + firList.isEmpty()); |
|
|
|
if (!firList.isEmpty() && "true".equals(pictureFrame)) { |
|
|
|
String uuid = UUID.randomUUID().toString().trim().replaceAll(StringUtils.DASH, StringUtils.EMPTY); |
|
|
|
redisService.setCacheObject(uuid, patrolResultList.get(0).getTaskPatrolledId(), 1L, TimeUnit.DAYS); |
|
|
|
@ -839,6 +857,7 @@ public class PatrolResultController extends BaseController { |
|
|
|
try { |
|
|
|
InfraredRequestParam infraredRequestParam = JSONObject.parseObject(type, InfraredRequestParam.class); |
|
|
|
InfraredResponse infraredResponse = infraredImageParser.parse(infraredRequestParam); |
|
|
|
logger.info("infraredResponse:" + infraredResponse); |
|
|
|
if (infraredResponse != null) { |
|
|
|
ResultAnalysis resultAnalysis = new ResultAnalysis(); |
|
|
|
if (infraredResponse.getResultList() != null && !infraredResponse.getResultList().isEmpty()) { |
|
|
|
@ -1113,7 +1132,7 @@ public class PatrolResultController extends BaseController { |
|
|
|
logger.info("[RES] items empty!!!"); |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
logger.error("error", e); |
|
|
|
} |
|
|
|
|
|
|
|
} else if (StaEnum.CtlModel.getCode().equals(type)) { |
|
|
|
@ -1330,7 +1349,7 @@ public class PatrolResultController extends BaseController { |
|
|
|
|
|
|
|
Map<String, String> valueMap = patrolResultService.getPatrolResultValue(arr); |
|
|
|
if (null != valueMap && !valueMap.isEmpty()) { |
|
|
|
System.out.println("valueMap::" + valueMap.get("value") + ",value_unit:" + valueMap.get("value_unit")); |
|
|
|
logger.info("valueMap::" + valueMap.get("value") + ",value_unit:" + valueMap.get("value_unit")); |
|
|
|
if (valueMap.containsKey("value") && null != valueMap.get("value")) { |
|
|
|
strfile = valueMap.get("value"); |
|
|
|
arr.setValue(strfile); |
|
|
|
@ -1350,9 +1369,9 @@ public class PatrolResultController extends BaseController { |
|
|
|
} |
|
|
|
|
|
|
|
i = patrolResultService.updatePatrolResult(patrolResult2); |
|
|
|
if (!"2".equals(Jqtype)) { |
|
|
|
// if (!"2".equals(Jqtype)) { |
|
|
|
resultList.add(patrolResult2); |
|
|
|
} |
|
|
|
// } |
|
|
|
} else { |
|
|
|
arr.setMainId(mainID + ""); |
|
|
|
Map<String, String> stringStringMap = patrolResultService.selectThresholdByPointId(arr.getDeviceId()); |
|
|
|
@ -1384,7 +1403,7 @@ public class PatrolResultController extends BaseController { |
|
|
|
|
|
|
|
Map<String, String> valueMap = patrolResultService.getPatrolResultValue(arr); |
|
|
|
if (null != valueMap && !valueMap.isEmpty()) { |
|
|
|
System.out.println("valueMap::" + valueMap.get("value") + ",value_unit:" + valueMap.get("value_unit")); |
|
|
|
logger.info("valueMap::" + valueMap.get("value") + ",value_unit:" + valueMap.get("value_unit")); |
|
|
|
if (valueMap.containsKey("value") && null != valueMap.get("value")) { |
|
|
|
strfile = valueMap.get("value"); |
|
|
|
arr.setValue(strfile); |
|
|
|
@ -1399,13 +1418,14 @@ public class PatrolResultController extends BaseController { |
|
|
|
logger.info("[RES] mainId: {}, deviceId: {}, taskPatrolId: {} !!!!!!!!!!!!!!!!!", arr.getMainId(), arr.getDeviceId(), arr.getTaskPatrolledId()); |
|
|
|
i = patrolResultService.insertPatrolResult(arr); |
|
|
|
resultStatistics.compare(arr); |
|
|
|
if (!"2".equals(Jqtype)) { |
|
|
|
// if (!"2".equals(Jqtype)) { |
|
|
|
resultList.add(arr); |
|
|
|
} |
|
|
|
// } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
logger.info("------------------------Jqtype: " + Jqtype); |
|
|
|
logger.info("------------------------resultList.isEmpty(): " + resultList.isEmpty()); |
|
|
|
if (!resultList.isEmpty()) { |
|
|
|
logger.info(Color.RED + "[RES] ++++++++++++++++++++++++++++callAlgorithm++++++++++++++++++++++++++" + Color.END); |
|
|
|
//callLocalAlgorithm(resultList); |
|
|
|
|