|
|
|
@ -1,10 +1,8 @@ |
|
|
|
package com.inspect.simulator.service.impl; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.alibaba.nacos.common.utils.StringUtils; |
|
|
|
import com.google.gson.Gson; |
|
|
|
import com.inspect.simulator.constant.Color; |
|
|
|
import com.inspect.simulator.domain.Infrared.Coordinate; |
|
|
|
import com.inspect.simulator.domain.Infrared.InfraPictureInfo; |
|
|
|
import com.inspect.simulator.domain.Infrared.InfraredInfo; |
|
|
|
import com.inspect.simulator.domain.algorithm.in.AnalyseReqItem; |
|
|
|
@ -12,12 +10,10 @@ import com.inspect.simulator.domain.algorithm.in.AnalyseRequest; |
|
|
|
import com.inspect.simulator.domain.algorithm.out.AnalyseResItem; |
|
|
|
import com.inspect.simulator.domain.algorithm.out.AnalyseResPoint; |
|
|
|
import com.inspect.simulator.domain.algorithm.out.AnalyseResult; |
|
|
|
import com.inspect.simulator.domain.analysis.vi.AnalysisObject; |
|
|
|
import com.inspect.simulator.domain.basedata.BasedataEqpBookChannel; |
|
|
|
import com.inspect.simulator.domain.result.BasedataPatrolPoint; |
|
|
|
import com.inspect.simulator.domain.result.PatrolPresetPos; |
|
|
|
import com.inspect.simulator.mapper.BasedataPatrolPointMapper; |
|
|
|
import com.inspect.simulator.mapper.PatrolPresetPosMapper; |
|
|
|
import com.inspect.simulator.mapper.ResultAnalysisMapper; |
|
|
|
import com.inspect.simulator.service.AlgorithmService; |
|
|
|
import com.inspect.simulator.service.remote.AnalysisRemoteService; |
|
|
|
import com.inspect.simulator.utils.HttpClientUtils; |
|
|
|
@ -26,16 +22,13 @@ import com.inspect.simulator.utils.redis.RedisService; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.http.ResponseEntity; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import retrofit2.Call; |
|
|
|
import retrofit2.Response; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.List; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
@Service |
|
|
|
public class AlgorithmServiceImpl implements AlgorithmService { |
|
|
|
@ -59,6 +52,9 @@ public class AlgorithmServiceImpl implements AlgorithmService { |
|
|
|
@Resource |
|
|
|
private BasedataPatrolPointMapper basedataPatrolPointMapper; |
|
|
|
|
|
|
|
@Resource |
|
|
|
private ResultAnalysisMapper resultAnalysisMapper; |
|
|
|
|
|
|
|
@Resource |
|
|
|
private HikVisionServiceImpl hikVisionService; |
|
|
|
|
|
|
|
@ -137,7 +133,7 @@ public class AlgorithmServiceImpl implements AlgorithmService { |
|
|
|
analyseResItems.add(analyseResItem); |
|
|
|
analyseResult.setResultList(analyseResItems); |
|
|
|
if (MiscUtils.checkInfraredType(typeList) && !"null".equals(infraredPath)) { |
|
|
|
if(testMode) { |
|
|
|
if (testMode) { |
|
|
|
try { |
|
|
|
log.info(Color.MAGENTA + "BIG_MODEL_INFRA_TEST analyseResult={}" + Color.END, new Gson().toJson(analyseResult)); |
|
|
|
Call<Object> call = analysisRemoteService.picAnalyseRetNotify(analyseResult); |
|
|
|
@ -167,7 +163,7 @@ public class AlgorithmServiceImpl implements AlgorithmService { |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (MiscUtils.checkMeterType(typeList) && !"null".equals(meterPath)) { |
|
|
|
if(testMode) { |
|
|
|
if (testMode) { |
|
|
|
try { |
|
|
|
log.info(Color.MAGENTA + "BIG_MODEL_METER_TEST analyseResult={}" + Color.END, new Gson().toJson(analyseResult)); |
|
|
|
Call<Object> call = analysisRemoteService.picAnalyseRetNotify(analyseResult); |
|
|
|
@ -258,7 +254,7 @@ public class AlgorithmServiceImpl implements AlgorithmService { |
|
|
|
InfraPictureInfo infraPictureInfo = new InfraPictureInfo(); |
|
|
|
infraPictureInfo.setImgType(typeListImg[0]); |
|
|
|
infraPictureInfo.setFilePath(imageUrlList[0]); |
|
|
|
InfraredInfo infraredInfo = hikVisionService.calculatePicture(infraPictureInfo, infraFrameContent,basedataPatrolPoint2); |
|
|
|
InfraredInfo infraredInfo = hikVisionService.calculatePicture(infraPictureInfo, infraFrameContent, basedataPatrolPoint2); |
|
|
|
|
|
|
|
final String feedBackHostIp = analyseRequest.getRequestHostIp(); |
|
|
|
final String feedBackPort = analyseRequest.getRequestHostPort(); |
|
|
|
@ -282,6 +278,15 @@ public class AlgorithmServiceImpl implements AlgorithmService { |
|
|
|
analyseResPoint.setResImageUrl(infraredInfo.getOutPath()); |
|
|
|
analyseResPoint.setType(typeListStr); |
|
|
|
analyseResPoint.setCode("2000"); |
|
|
|
if (StringUtils.isNotBlank(analyseResPoint.getImageNormalUrlPath())) { |
|
|
|
String imageNormalUrlPath = resultAnalysisMapper.selectImg(patrolPointId); |
|
|
|
if (StringUtils.isBlank(imageNormalUrlPath)) { |
|
|
|
log.info(Color.MAGENTA + "[INFRARED] irPicAnalyse: 未获取到imageNormalUrlPath" + Color.END); |
|
|
|
analyseResPoint.setImageNormalUrlPath(analyseResPoint.getResImageUrl()); |
|
|
|
} else { |
|
|
|
analyseResPoint.setImageNormalUrlPath(imageNormalUrlPath); |
|
|
|
} |
|
|
|
} |
|
|
|
// analyseResPoint.setResImageUrl(analyseRequest.getObjectList().get(0).getImageUrlList()[0]); |
|
|
|
List<AnalyseResPoint> analyseResPoints = new ArrayList<>(); |
|
|
|
analyseResPoints.add(analyseResPoint); |
|
|
|
|