Browse Source

Merge remote-tracking branch 'origin/master'

master
wangguangyuan 8 months ago
parent
commit
d95505bc91
10 changed files with 400 additions and 168 deletions
  1. +139
    -89
      inspect-job/src/main/java/com/inspect/job/task/JobMainTask.java
  2. +97
    -0
      inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/controller/ResultAnalysisController.java
  3. +35
    -0
      inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/domain/ModifyDocModel.java
  4. +1
    -0
      inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/service/impl/AnalysisServiceImpl.java
  5. +3
    -1
      inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/service/impl/IspAlgorithmRequestService.java
  6. +75
    -75
      inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/controller/PatrolResultController.java
  7. +6
    -2
      inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/domain/PatrolResultRef.java
  8. +3
    -0
      inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/mapper/PatrolResultMapper.java
  9. +4
    -1
      inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/AnalyseRemoteService.java
  10. +37
    -0
      inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolResultMapper.xml

+ 139
- 89
inspect-job/src/main/java/com/inspect/job/task/JobMainTask.java View File

@ -385,7 +385,6 @@ public class JobMainTask {
PatrolPresetPos presetPos = !presetPosList.isEmpty() ? presetPosList.get(0) : PatrolPresetPos.builder().presetPosId("0").build();
String taskPatrolId = taskExecRecord.getTaskPatrolId();
log.info("taskPatrolId: {}", taskPatrolId);
/*摄像头转到预置位*/
boolean noError = setCameraToPreset(presetPos);
@ -397,101 +396,138 @@ public class JobMainTask {
myDelay(2000);
}
StringBuffer fileTypes = new StringBuffer();
StringBuffer filePaths = new StringBuffer();
PatrolPresetAction patrolPresetAction = PatrolPresetAction.builder().isEnable("1").presetPosId(presetPos.getPresetPosId()).build();
List<PatrolPresetAction> patrolPresetActionList = taskExecClient.selectPatrolPresetActionList(patrolPresetAction);
PatrolPresetAction presetAction = patrolPresetActionList.isEmpty() ?
PatrolPresetAction.builder().presetPosId(presetPos.getPresetPosId()).actionType("1").photoCount(1L).photoGap(1).build()
: patrolPresetActionList.get(0);
String basePath = (StringUtils.isEmpty(taskExecRecord.getStationCode()) ? stationCode : taskExecRecord.getStationCode())
+ "/" + DateUtils.getYearEven()
+ "/" + DateUtils.getMonthEven()
+ "/" + DateUtils.getDayEven()
+ "/" + taskExecRecord.getTaskCode()
+ "/";
log.info("basePath: {}", basePath);
if (PresetAction.PHOTO.getCode().equals(presetAction.getActionType())) {
String chanType = presetPos.getChannelType();
fileTypes.append("ir".equals(chanType) ? "1" : "vl".equals(chanType) ? "2" : "").append(",");
int delayMilliSeconds = presetAction.getPhotoGap() * 1000;
final long photoCount = presetAction.getPhotoCount();
boolean bOk = false;
try {
log.info("PHOTO PresetType chanType: {}, videoNvrCode: {}, channelCode: {}", chanType, presetPos.getVideoNvrCode(), presetPos.getChannelCode());
if ("vl".equals(chanType)) {
String paramUrl = liveIVS_URL + "/api/v1/device/channelsnap?serial=" + presetPos.getVideoNvrCode() + "&realtime=true&code=" + presetPos.getChannelCode();
String paramFileName = taskPatrolId.split(StringUtils.UNDERLINE)[1] + StringUtils.UNDERLINE
+ taskPatrolId.split(StringUtils.UNDERLINE)[2] + StringUtils.UNDERLINE
+ presetPos.getPatrolPointId() + StringUtils.UNDERLINE
+ taskExecRecord.getDevNo() + ".jpg";
String paramFileDir = basePath + "CCD";
log.info("paramUrl: {}, paramFileName: {}, paramFileDir: {}", paramUrl, paramFileName, paramFileDir);
FtpResult ftpResult = saveFile(paramUrl, paramFileName, paramFileDir);
if (ftpResult != null && StringUtils.isNotEmpty(ftpResult.getFilepath())) {
log.info("filePath: {}", ftpResult.getFilepath());
bOk = ftpResult.isOk();
filePaths.append("/" + ftpResult.getFilepath());
boolean taskHalted = false;
String taskPatrolledId = taskPatrolId.split(StringUtils.UNDERLINE)[1] + "_" + taskPatrolId.split(StringUtils.UNDERLINE)[2];
PatrolTaskStatus patrolTaskStatus = new PatrolTaskStatus();
patrolTaskStatus.setTaskPatrolledId(taskPatrolledId);
List<PatrolTaskStatus> list = taskExecClient.selectPatrolTaskStatusList(patrolTaskStatus);
if(list.size() > 0) {
if("3".equals(list.get(0).getTaskState())) {//暂停
while(true) {
log.info("-----------------------task pause: {}", taskPatrolledId);
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
}
} else if ("ir".equals(chanType)) {
InfraredModel infraredModel = new InfraredModel();
infraredModel.setChannelSerial(presetPos.getChannelCode());
infraredModel.setPresetId(Integer.parseInt(presetPos.getPresetPosCode()));
EqpBook eqpbook = new EqpBook();
eqpbook.setPatrolDeviceCode(presetPos.getPatrolDeviceCode());
List<EqpBook> eqpBookListList = taskExecClient.selectBasedataEqpBookList(eqpbook);
if (!eqpBookListList.isEmpty()) {
Response ir_gen = remoteInvokeService.invoke("IR_GEN", presetPos.getPatrolDeviceCode().split("#")[0], new HashMap<>());
log.info("ir_gen: {}", JSONObject.toJSONString(ir_gen));
Object data = ir_gen.getData();
String path = JSONObject.parseObject(JSONObject.toJSONString(data)).getString("filePath");
path = path.split("33333")[1];
filePaths.append(path).append(",");
log.info("INFRA:{}", taskExecRecord.getTaskName() + " path : " + path);
list = taskExecClient.selectPatrolTaskStatusList(patrolTaskStatus);
if(list.size() > 0) {
log.info("-----------------------TaskState: {}", list.get(0).getTaskState());
if("4".equals(list.get(0).getTaskState())) {//终止
log.info("-----------------------task terminate: {}", taskPatrolledId);
taskHalted = true;
break;
} else if("2".equals(list.get(0).getTaskState())) {//正在执行
log.info("-----------------------task resume: {}", taskPatrolledId);
break;
}
} else {
log.info("-----------------------selectPatrolTaskStatusList is empty");
}
}
} catch (Exception e) {
log.error("error", e);
} else if("4".equals(list.get(0).getTaskState())) {//终止
log.info("-----------------------task terminate: {}", taskPatrolledId);
taskHalted = true;
}
}
recordPersist(bOk, taskExecRecord, infoListSize, patrolTaskInfo, presetPos, fileTypes, filePaths);
} else if (PresetAction.VIDEO.getCode().equals(presetAction.getActionType())) {
log.info("VIDEO PresetType videoNvrCode: {}, channelCode: {}", presetPos.getVideoNvrCode(), presetPos.getChannelCode());
fileTypes.append(4).append(",");
String jsonStr = HttpClientUtil.getHttpResultJson(liveIVS_URL + "/api/v1/stream/start?serial=" + presetPos.getVideoNvrCode() + "&code=" + presetPos.getChannelCode());
log.info("先调用直播开始,获取流对象:/api/v1/stream/start?serial= :{} ", presetPos.getVideoNvrCode() + "&code=" + presetPos.getChannelCode());
log.info("/api/v1/stream/start 返回 json 字符串{} ", jsonStr);
JSONObject UserInfoReturn = JSON.parseObject(jsonStr);
Stream stream = JSON.toJavaObject(UserInfoReturn, Stream.class);
try {
String rel = HttpClientUtils.get(liveIVS_URL + "/api/v1/record/start", "streamid=" + stream.getStreamID() + "&code=" + presetPos.getChannelCode());
log.info("视频录像开始:/api/v1/record/start streamid={} ", stream.getStreamID() + ",code=" + presetPos.getChannelCode() + ", 调用 /api/v1/record/start 返回值=" + rel);
if (rel.isEmpty()) {
rel = HttpClientUtils.get(liveIVS_URL + "/api/v1/record/start", "streamid=" + stream.getStreamID() + "&code=" + presetPos.getChannelCode());
log.info("一次调用失败,第二次调用 视频录像开始:/api/v1/record/start streamid={} ", stream.getStreamID() + ",code=" + presetPos.getChannelCode() + ", 调用 /api/v1/record/start 返回值=" + rel);
if(!taskHalted) {
StringBuffer fileTypes = new StringBuffer();
StringBuffer filePaths = new StringBuffer();
PatrolPresetAction patrolPresetAction = PatrolPresetAction.builder().isEnable("1").presetPosId(presetPos.getPresetPosId()).build();
List<PatrolPresetAction> patrolPresetActionList = taskExecClient.selectPatrolPresetActionList(patrolPresetAction);
PatrolPresetAction presetAction = patrolPresetActionList.isEmpty() ?
PatrolPresetAction.builder().presetPosId(presetPos.getPresetPosId()).actionType("1").photoCount(1L).photoGap(1).build()
: patrolPresetActionList.get(0);
String basePath = (StringUtils.isEmpty(taskExecRecord.getStationCode()) ? stationCode : taskExecRecord.getStationCode())
+ "/" + DateUtils.getYearEven()
+ "/" + DateUtils.getMonthEven()
+ "/" + DateUtils.getDayEven()
+ "/" + taskExecRecord.getTaskCode()
+ "/";
log.info("basePath: {}", basePath);
if (PresetAction.PHOTO.getCode().equals(presetAction.getActionType())) {
String chanType = presetPos.getChannelType();
fileTypes.append("ir".equals(chanType) ? "1" : "vl".equals(chanType) ? "2" : "").append(",");
int delayMilliSeconds = presetAction.getPhotoGap() * 1000;
final long photoCount = presetAction.getPhotoCount();
boolean bOk = false;
try {
log.info("PHOTO PresetType chanType: {}, videoNvrCode: {}, channelCode: {}", chanType, presetPos.getVideoNvrCode(), presetPos.getChannelCode());
if ("vl".equals(chanType)) {
String paramUrl = liveIVS_URL + "/api/v1/device/channelsnap?serial=" + presetPos.getVideoNvrCode() + "&realtime=true&code=" + presetPos.getChannelCode();
String paramFileName = taskPatrolId.split(StringUtils.UNDERLINE)[1] + StringUtils.UNDERLINE
+ taskPatrolId.split(StringUtils.UNDERLINE)[2] + StringUtils.UNDERLINE
+ presetPos.getPatrolPointId() + StringUtils.UNDERLINE
+ taskExecRecord.getDevNo() + ".jpg";
String paramFileDir = basePath + "CCD";
log.info("paramUrl: {}, paramFileName: {}, paramFileDir: {}", paramUrl, paramFileName, paramFileDir);
FtpResult ftpResult = saveFile(paramUrl, paramFileName, paramFileDir);
if (ftpResult != null && StringUtils.isNotEmpty(ftpResult.getFilepath())) {
log.info("filePath: {}", ftpResult.getFilepath());
bOk = ftpResult.isOk();
filePaths.append("/" + ftpResult.getFilepath());
}
} else if ("ir".equals(chanType)) {
InfraredModel infraredModel = new InfraredModel();
infraredModel.setChannelSerial(presetPos.getChannelCode());
infraredModel.setPresetId(Integer.parseInt(presetPos.getPresetPosCode()));
EqpBook eqpbook = new EqpBook();
eqpbook.setPatrolDeviceCode(presetPos.getPatrolDeviceCode());
List<EqpBook> eqpBookListList = taskExecClient.selectBasedataEqpBookList(eqpbook);
if (!eqpBookListList.isEmpty()) {
Response ir_gen = remoteInvokeService.invoke("IR_GEN", presetPos.getPatrolDeviceCode().split("#")[0], new HashMap<>());
log.info("ir_gen: {}", JSONObject.toJSONString(ir_gen));
Object data = ir_gen.getData();
String path = JSONObject.parseObject(JSONObject.toJSONString(data)).getString("filePath");
path = path.split("33333")[1];
filePaths.append(path).append(",");
log.info("INFRA:{}", taskExecRecord.getTaskName() + " path : " + path);
}
}
} catch (Exception e) {
log.error("error", e);
}
} catch (Exception e) {
log.error("error", e);
}
final int videoTime = presetAction.getVideoTime();
Timer mTimer = new Timer();
mTimer.schedule(new TimerTask() {
int mCount = 0;
@Override
public void run() {
mCount++;
PatrolTaskExecRecord tempRecord = taskExecClient.selectPatrolTaskExecRecordByTaskPatrolId(taskPatrolId);
if (mCount >= videoTime + 2 || !isRunningState(tempRecord.getTaskPatrolId())) {
log.info("视频录像结束:查询当前巡检任务执行状态,当状态为暂停或者终止时,退出当前执行方法:TaskPatrolledId :{}", taskPatrolId);
videotapeRecordStop(filePaths, stream, presetPos.getChannelCode(), basePath, presetPos.getPatrolPointId(), presetPos.getVideoNvrCode());
mTimer.cancel();
recordPersist(bOk, taskExecRecord, infoListSize, patrolTaskInfo, presetPos, fileTypes, filePaths);
} else if (PresetAction.VIDEO.getCode().equals(presetAction.getActionType())) {
log.info("VIDEO PresetType videoNvrCode: {}, channelCode: {}", presetPos.getVideoNvrCode(), presetPos.getChannelCode());
fileTypes.append(4).append(",");
String jsonStr = HttpClientUtil.getHttpResultJson(liveIVS_URL + "/api/v1/stream/start?serial=" + presetPos.getVideoNvrCode() + "&code=" + presetPos.getChannelCode());
log.info("先调用直播开始,获取流对象:/api/v1/stream/start?serial= :{} ", presetPos.getVideoNvrCode() + "&code=" + presetPos.getChannelCode());
log.info("/api/v1/stream/start 返回 json 字符串{} ", jsonStr);
JSONObject UserInfoReturn = JSON.parseObject(jsonStr);
Stream stream = JSON.toJavaObject(UserInfoReturn, Stream.class);
try {
String rel = HttpClientUtils.get(liveIVS_URL + "/api/v1/record/start", "streamid=" + stream.getStreamID() + "&code=" + presetPos.getChannelCode());
log.info("视频录像开始:/api/v1/record/start streamid={} ", stream.getStreamID() + ",code=" + presetPos.getChannelCode() + ", 调用 /api/v1/record/start 返回值=" + rel);
if (rel.isEmpty()) {
rel = HttpClientUtils.get(liveIVS_URL + "/api/v1/record/start", "streamid=" + stream.getStreamID() + "&code=" + presetPos.getChannelCode());
log.info("一次调用失败,第二次调用 视频录像开始:/api/v1/record/start streamid={} ", stream.getStreamID() + ",code=" + presetPos.getChannelCode() + ", 调用 /api/v1/record/start 返回值=" + rel);
}
} catch (Exception e) {
log.error("error", e);
}
}, 0, 1000L);
final int videoTime = presetAction.getVideoTime();
Timer mTimer = new Timer();
mTimer.schedule(new TimerTask() {
int mCount = 0;
@Override
public void run() {
mCount++;
PatrolTaskExecRecord tempRecord = taskExecClient.selectPatrolTaskExecRecordByTaskPatrolId(taskPatrolId);
if (mCount >= videoTime + 2 || !isRunningState(tempRecord.getTaskPatrolId())) {
log.info("视频录像结束:查询当前巡检任务执行状态,当状态为暂停或者终止时,退出当前执行方法:TaskPatrolledId :{}", taskPatrolId);
videotapeRecordStop(filePaths, stream, presetPos.getChannelCode(), basePath, presetPos.getPatrolPointId(), presetPos.getVideoNvrCode());
mTimer.cancel();
}
}
}, 0, 1000L);
}
}
return taskExecRecord;
@ -519,7 +555,7 @@ public class JobMainTask {
String rectangle = getRectangle(presetPos.getPresetPosId());
String taskPatrolId = getTaskPatrolledId(taskInfo.getDevNo(), taskExecRecord.getTaskPatrolId());
final String deviceId = taskInfo.getDeviceId();
log.info("pointExecRecord crud add taskPatrolId: {}, deviceId: {}", taskPatrolId, deviceId);
log.info("pointExecRecord crud add taskPatrolId: {}, patrolPointId: {}", taskPatrolId, deviceId);
PatrolTaskPointExecRecord pointExecRecord = PatrolTaskPointExecRecord
.builder()
@ -974,8 +1010,22 @@ public class JobMainTask {
//patrolTaskInfoList size: 12 devNo: camera, taskId: 10032
log.info("EXEC patrolTaskInfoList size: {} devNo: {}, taskId: {}", patrolTaskInfoList.size(), patrolTaskExecRecord.getDevNo(), patrolTaskExecRecord.getTaskId());
for (final PatrolTaskInfo taskInfo : patrolTaskInfoList) {
log.info("EXEC Immediate taskPatrolId: {}, deviceId: {}, lineId: {}", patrolTaskExecRecord.getTaskPatrolId(), taskInfo.getDeviceId(), taskInfo.getLineId());
log.info("EXEC Immediate taskPatrolId: {}, patrolPointId: {}, lineId: {}", patrolTaskExecRecord.getTaskPatrolId(), taskInfo.getDeviceId(), taskInfo.getLineId());
prePointExec(patrolTaskExecRecord, taskInfo, patrolTaskInfoList.size());
String taskPatrolledId = patrolTaskExecRecord.getTaskPatrolId().split(StringUtils.UNDERLINE)[1] + "_" + patrolTaskExecRecord.getTaskPatrolId().split(StringUtils.UNDERLINE)[2];
PatrolTaskStatus patrolTaskStatus = new PatrolTaskStatus();
patrolTaskStatus.setTaskPatrolledId(taskPatrolledId);
List<PatrolTaskStatus> list = taskExecClient.selectPatrolTaskStatusList(patrolTaskStatus);
if(list.size() > 0) {
log.info("-----------------------2 TaskState: {}", list.get(0).getTaskState());
if("4".equals(list.get(0).getTaskState())) {//终止
log.info("-----------------------2 task terminate: {}", taskPatrolledId);
return;
}
} else {
log.info("-----------------------2 selectPatrolTaskStatusList is empty");
}
}
}


+ 97
- 0
inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/controller/ResultAnalysisController.java View File

@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.inspect.analysis.domain.*;
import com.inspect.analysis.service.IResultAnalysisService;
import com.inspect.base.core.constant.Color;
import com.inspect.base.core.domain.Response;
import com.inspect.base.core.utils.StringUtils;
import com.inspect.base.core.utils.poi.ExcelUtil;
import com.inspect.base.core.web.controller.BaseController;
@ -14,6 +15,8 @@ import com.inspect.common.log.annotation.Log;
import com.inspect.common.log.enums.BizType;
import com.inspect.partrolresult.domain.AlgInfo;
import com.inspect.partrolresult.domain.PatrolResult;
import com.inspect.partrolresult.domain.PatrolResultRef;
import com.inspect.partrolresult.mapper.PatrolResultMapper;
import com.inspect.partrolresult.service.IPatrolResultService;
import com.inspect.task.domain.PatrolData;
import com.inspect.task.service.IPatrolTaskService;
@ -23,6 +26,7 @@ import com.inspect.taskinfo.service.IPatrolTaskInfoService;
import java.util.*;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import com.inspect.taskstatus.domain.PatrolTaskStatus;
@ -41,6 +45,9 @@ public class ResultAnalysisController extends BaseController {
private final IPatrolTaskInfoService iPatrolTaskInfoService;
private final IPatrolResultService patrolResultService;
@Resource
private PatrolResultMapper patrolResultMapper;
public ResultAnalysisController(IResultAnalysisService resultAnalysisService, IPatrolTaskService patrolTaskService, IPatrolTaskInfoService iPatrolTaskInfoService, IPatrolResultService patrolResultService) {
this.resultAnalysisService = resultAnalysisService;
this.patrolTaskService = patrolTaskService;
@ -583,6 +590,96 @@ public class ResultAnalysisController extends BaseController {
}
}
@GetMapping({"/list_v3"})
public TableDataInfo listV3(PatrolTaskStatus patrolTaskStatus) {
ResultAnalysis resultAnalysis = new ResultAnalysis();
resultAnalysis.setTaskPatrolId(patrolTaskStatus.getTaskPatrolledId());
resultAnalysis.setResult("0");
List<PatrolData> filterList = patrolResultService.selectPatrolDataResultByTaskCodeV2(resultAnalysis);
startPage();
resultAnalysis.setFilter(patrolTaskStatus.getFilter());
resultAnalysis.setResult("");
List<PatrolData> list = patrolResultService.selectPatrolDataResultByTaskCodeV2(resultAnalysis);
List<AlgInfo> algInfos = patrolResultService.selectAlgInfo(new PatrolResult());
list.forEach((item) -> {
item.setAlgName((algInfos.stream().filter((alg) -> {
return alg.getAlgSubtypeCode().equals(item.getAlgType());
}).findFirst().get()).getAlgSubtypeName());
if("0".equals(item.getFilter())) {
List<PatrolData> filterDatas = filterList.stream().filter((data) -> {
return data.getObjectId().equals(item.getObjectId()) && data.getAlgType().equals(data.getAlgType());
}).collect(Collectors.toList());
if(!filterDatas.isEmpty()) {
item.setImg((filterDatas.get(0)).getImgAnalyse());
item.setImageNormalUrlPath((filterDatas.get(0)).getImageNormalUrlPath());
} else {
item.setImg("");
}
}
});
Collections.sort(list);
return this.getDataTable(list);
}
@GetMapping({"/list_exception"})
public TableDataInfo listException(PatrolTaskStatus patrolTaskStatus) {
ResultAnalysis resultAnalysis = new ResultAnalysis();
resultAnalysis.setTaskPatrolId(patrolTaskStatus.getTaskPatrolledId());
startPage();
resultAnalysis.setFilter(patrolTaskStatus.getFilter());
resultAnalysis.setResCode("2000");
resultAnalysis.setPosType(patrolTaskStatus.getPosType());
List<PatrolData> list = patrolResultService.selectPatrolDataResultByTaskCodeV2(resultAnalysis);
List<AlgInfo> algInfos = patrolResultService.selectAlgInfo(new PatrolResult());
list.forEach((item) -> {
try {
item.setAlgName((algInfos.stream().filter((alg) -> {
return alg.getAlgSubtypeCode().equals(item.getAlgType());
}).findFirst().get()).getAlgSubtypeName());
} catch (Exception e) {
logger.error("list_exception: algType: {}, exception: {}", item.getAlgType(), e.getMessage());
}
});
Collections.sort(list);
return getDataTable(list);
}
@GetMapping({"/doc"})
public TableDataInfo listDoc(PatrolResult patrolResult) {
List<AlgInfo> algInfos = patrolResultMapper.selectAlgInfo(new PatrolResult());
startPage();
List<PatrolResultRef> patrolResultRefs = patrolResultMapper.selectResultDoc(patrolResult);
for (PatrolResultRef ref : patrolResultRefs) {
ref.setAlgName((algInfos.stream().filter((alg) -> {
return alg.getAlgSubtypeCode().equals(ref.getAlgType());
}).findFirst().get()).getAlgSubtypeName());
}
return getDataTable(patrolResultRefs);
}
@GetMapping({"/doc/detail"})
public Response<PatrolResult> docDetail(PatrolResult patrolResult) {
List<AlgInfo> algInfos = patrolResultMapper.selectAlgInfo(new PatrolResult());
PatrolResultRef result = patrolResultMapper.selectResultDoc(patrolResult).get(0);
result.setAlgName((algInfos.stream().filter((alg) -> {
return alg.getAlgSubtypeCode().equals(result.getAlgType());
}).findFirst().get()).getAlgSubtypeName());
return Response.ok(patrolResult);
}
@PostMapping({"doc"})
public AjaxResult modifyDoc(@RequestBody ModifyDocModel model) {
ResultAnalysis resultAnalysis = resultAnalysisService.selectResultAnalysisByLineId(model.getLineId());
resultAnalysis.setOriginalValue(resultAnalysis.getResValue());
resultAnalysis.setResValue(model.getValue());
resultAnalysisService.updateResultAnalysis(resultAnalysis);
return AjaxResult.success();
}
@GetMapping({"summary/points"})
public TableDataInfo summaryPoints(AnalyseSummaryAlarmModel model) {
this.startPage();


+ 35
- 0
inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/domain/ModifyDocModel.java View File

@ -0,0 +1,35 @@
package com.inspect.analysis.domain;
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
import java.util.Objects;
@Getter
@Setter
public class ModifyDocModel implements Serializable {
private Long lineId;
private String value;
@Override
public boolean equals(Object object) {
if (this == object) return true;
if (object == null || getClass() != object.getClass()) return false;
ModifyDocModel that = (ModifyDocModel) object;
return Objects.equals(lineId, that.lineId) && Objects.equals(value, that.value);
}
@Override
public int hashCode() {
return Objects.hash(lineId, value);
}
@Override
public String toString() {
return "ModifyDocModel{" +
"lineId=" + lineId +
", value='" + value + '\'' +
'}';
}
}

+ 1
- 0
inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/service/impl/AnalysisServiceImpl.java View File

@ -85,6 +85,7 @@ public class AnalysisServiceImpl implements IAnalysisService {
if (redisService.hasKey(keyFilterRequest)) { // 初筛结果
analyseResult.setFilter("1"); // 设置初筛标志
analyseRequest = (AnalyseRequest) redisService.redisTemplate.opsForValue().getAndDelete(keyFilterRequest);
log.info("picAnalyseRetNotify analyseRequest IN REDIS: {}", analyseRequest);
AnalyseResPoint analyseResPoint = analyseResult.getResultList().get(0).getResults().get(0);
boolean bDefect = analyseResPoint.isDefect(); // code=2000代表初筛结果返回正常value=1代表有缺陷
log.info("picAnalyseRetNotify FILTER bDefect={}, algorithmType={}", bDefect, analyseResPoint.getType());


+ 3
- 1
inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/service/impl/IspAlgorithmRequestService.java View File

@ -47,7 +47,9 @@ public class IspAlgorithmRequestService {
String filter = "0";
String requestUrl;
if ("1".equals(analyseFilter) && isFilter) {
redisService.setCacheObject(AnalyseConstants.ANALYSE_FILTER_REQUEST.concat(requestId), analyseReq.clone(), 1L, TimeUnit.HOURS);
final String analyzeFilterRequestIdRedisKey = AnalyseConstants.ANALYSE_FILTER_REQUEST.concat(requestId);
log.info("[ALG] sendRequest analyseFilterRequestIdRedisKey: {}, analyseReq: {}", analyzeFilterRequestIdRedisKey, analyseReq);
redisService.setCacheObject(analyzeFilterRequestIdRedisKey, analyseReq.clone(), 1L, TimeUnit.HOURS);
AnalyseReqItem analyseReqItem = analyseReq.getObjectList().get(0);
analyseReqItem.setTypeList(new String[]{"tx_pb"});
analyseReq.setObjectList(Collections.singletonList(analyseReqItem));


+ 75
- 75
inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/controller/PatrolResultController.java View File

@ -714,8 +714,8 @@ public class PatrolResultController extends BaseController {
List<AnalyseReqItem> firList = new ArrayList<>();
String image = patrolResult.getFilePath().replace(ftp.getFtpPath() + "/", StringUtils.EMPTY);
String imageType = patrolResult.getFileType();
AnalyseReqItem reqItem = new AnalyseReqItem();
reqItem.setObjectId(patrolResult.getDeviceId());
AnalyseReqItem analyseReqItem = new AnalyseReqItem();
analyseReqItem.setObjectId(patrolResult.getDeviceId());
Map<String, String> map = patrolResultService.selectAlgorithmType(patrolResult.getDeviceId());
String[] strings = new String[1];
List<String> algIds = new ArrayList<>();
@ -746,7 +746,7 @@ public class PatrolResultController extends BaseController {
}
logger.info("callRemoteAlgorithm algInfoList start: {}", algInfoList);
reqItem.setImageUrlList(image.split(StringUtils.COMMA));
analyseReqItem.setImageUrlList(image.split(StringUtils.COMMA));
String pictureFrame = patrolTaskService.selectConfigByKey("PICTURE_FRAME");
logger.info("callRemoteAlgorithm pictureFrame: {}", pictureFrame);
@ -776,9 +776,9 @@ public class PatrolResultController extends BaseController {
}
ids = patrolResult.getLineId() + "";
reqItem.setImageUrlList(typeArr);
reqItem.setTypeList(strings);
firList.add(reqItem.clone());
analyseReqItem.setImageUrlList(typeArr);
analyseReqItem.setTypeList(strings);
firList.add(analyseReqItem.clone());
}
algInfoList.removeAll(infraredList);
@ -804,22 +804,22 @@ public class PatrolResultController extends BaseController {
filePanpath = judgeMap.get("dis_ref_picture_path");
}
reqItem.setImageNormalUrlPath(filePanpath);
analyseReqItem.setImageNormalUrlPath(filePanpath);
List<AlgInfo> judgeList = algInfoList.stream().filter((item) -> {
return item.getAlgName().contains("判别");
}).collect(Collectors.toList());
if (!judgeList.isEmpty()) {
reqItem.setTypeList(judgeList.stream().map(AlgInfo::getAlgSubtypeCode).toArray(String[]::new));
analyseReqItem.setTypeList(judgeList.stream().map(AlgInfo::getAlgSubtypeCode).toArray(String[]::new));
String[] images;
if (image.contains(StringUtils.COMMA)) {
images = image.split(StringUtils.COMMA);
reqItem.setImageUrlList(images);
analyseReqItem.setImageUrlList(images);
} else {
images = new String[]{image};
reqItem.setImageUrlList(images);
analyseReqItem.setImageUrlList(images);
}
bigList.add(reqItem.clone());
bigList.add(analyseReqItem.clone());
}
algInfoList.removeAll(judgeList);
@ -827,8 +827,8 @@ public class PatrolResultController extends BaseController {
return "meter".equals(item.getAlgSubtypeCode());
}).collect(Collectors.toList());
if (!meterList.isEmpty()) {
reqItem.setTypeList(meterList.stream().map(AlgInfo::getAlgSubtypeCode).toArray(String[]::new));
filterList.add(reqItem.clone());
analyseReqItem.setTypeList(meterList.stream().map(AlgInfo::getAlgSubtypeCode).toArray(String[]::new));
filterList.add(analyseReqItem.clone());
}
algInfoList.removeAll(meterList);
@ -836,14 +836,14 @@ public class PatrolResultController extends BaseController {
return "缺陷识别".equals(item.getAlgName());
}).collect(Collectors.toList());
if (!defectList.isEmpty()) {
reqItem.setTypeList(defectList.stream().map(AlgInfo::getAlgSubtypeCode).toArray(String[]::new));
bigList.add(reqItem.clone());
analyseReqItem.setTypeList(defectList.stream().map(AlgInfo::getAlgSubtypeCode).toArray(String[]::new));
bigList.add(analyseReqItem.clone());
}
algInfoList.removeAll(defectList);
if (!algInfoList.isEmpty()) {
reqItem.setTypeList(algInfoList.stream().map(AlgInfo::getAlgSubtypeCode).toArray(String[]::new));
bigList.add(reqItem.clone());
analyseReqItem.setTypeList(algInfoList.stream().map(AlgInfo::getAlgSubtypeCode).toArray(String[]::new));
bigList.add(analyseReqItem.clone());
}
}
@ -1049,7 +1049,7 @@ public class PatrolResultController extends BaseController {
@GetMapping({"/sendMessage"})
public AjaxResult getInfo(String type, String messageBody) {
logger.info("type:" + type + ", messageBody:" + messageBody);
logger.info("[RESULT] type: {}, messageBody: {}", type, messageBody);
PatrolTaskFtp patrolTaskFtp = patrolTaskFtpService.selectPatrolTaskFtpByLineId(2L);
int i = 1;
List<String> patrolDeviceCodeList = new ArrayList<>();
@ -1191,12 +1191,12 @@ public class PatrolResultController extends BaseController {
jsonArray = parseObject.get("Items");
}
List<PatrolResult> eqList = JSONArray.parseArray(jsonArray.toString(), PatrolResult.class);
List<PatrolResult> patrolResultList = JSONArray.parseArray(jsonArray.toString(), PatrolResult.class);
String code;
if (!eqList.isEmpty()) {
if (!patrolResultList.isEmpty()) {
code = "";
for (PatrolResult arr : eqList) {
for (PatrolResult arr : patrolResultList) {
Map<String, String> map = resultAnalysisService.selectPointInfoById(arr.getDeviceId());
if (map == null) {
Map<String, Object> maps = resultAnalysisService.selectPointInfoByCode(arr.getDeviceId());
@ -1215,7 +1215,7 @@ public class PatrolResultController extends BaseController {
if (!tasks.isEmpty()) {
PatrolTaskResultMain taskResultMain = new PatrolTaskResultMain();
taskResultMain.setTaskId(String.valueOf(tasks.get(0).getTaskId()));
taskResultMain.setTaskPatrolledId(eqList.get(0).getTaskPatrolledId());
taskResultMain.setTaskPatrolledId(patrolResultList.get(0).getTaskPatrolledId());
logger.info("taskResultMain: {}", taskResultMain);
listEqpBook = iPatrolTaskResultMainService.selectPatrolTaskResultMainList(taskResultMain);
if (!listEqpBook.isEmpty()) {
@ -1231,8 +1231,8 @@ public class PatrolResultController extends BaseController {
}
patrolTaskResultMain.setFileStatus("0");
patrolTaskResultMain.setTaskPatrolledId(eqList.get(0).getTaskPatrolledId());
int devCount = tasks.get(0).getDevNo().split(",").length;
patrolTaskResultMain.setTaskPatrolledId(patrolResultList.get(0).getTaskPatrolledId());
int devCount = tasks.get(0).getDevNo().split(StringUtils.COMMA).length;
if(devCount > 1) {
PatrolTaskResultMain resultMainQuery = new PatrolTaskResultMain();
resultMainQuery.setTaskId(String.valueOf(tasks.get(0).getTaskId()));
@ -1270,12 +1270,12 @@ public class PatrolResultController extends BaseController {
}
List<PatrolResult> resultList = new ArrayList<>();
for (PatrolResult arr : eqList) {
logger.info(Color.GREEN + "PatrolResult: {}" + Color.END, arr);
for (PatrolResult patrolResult : patrolResultList) {
logger.info(Color.GREEN + "PatrolResult: {}" + Color.END, patrolResult);
datetype = "";
String str;
if (StringUtils.isNotEmpty(arr.getPatrolDeviceCode())) {
Map<String, Object> eqbookMap = resultAnalysisService.selectEqInfoByCode(arr.getPatrolDeviceCode());
if (StringUtils.isNotEmpty(patrolResult.getPatrolDeviceCode())) {
Map<String, Object> eqbookMap = resultAnalysisService.selectEqInfoByCode(patrolResult.getPatrolDeviceCode());
if (eqbookMap != null && eqbookMap.get("type") != null) {
str = eqbookMap.get("type") + "";
if (str.equals("13")) {
@ -1290,26 +1290,26 @@ public class PatrolResultController extends BaseController {
}
PatrolResult patrolResultParam = new PatrolResult();
patrolResultParam.setTaskPatrolledId(arr.getTaskPatrolledId());
patrolResultParam.setTaskPatrolledId(patrolResult.getTaskPatrolledId());
str = parseObject.getString("SendCode");
String strfile;
if ("2".equals(datetype)) {
logger.info("feedback from robot");
Long patrolPointId = baseDataClient.queryPatrolPointId(str + "_" + arr.getDeviceId());
Long patrolPointId = baseDataClient.queryPatrolPointId(str + "_" + patrolResult.getDeviceId());
if (patrolPointId != null) {
arr.setDeviceId(patrolPointId.toString());
patrolResult.setDeviceId(patrolPointId.toString());
}
InputStream is = doGetRequestForInputStream(intranetFtpAddress + arr.getFilePath());
InputStream is = doGetRequestForInputStream(intranetFtpAddress + patrolResult.getFilePath());
logger.info("feedback from robot image size: {}", (is != null));
if (is != null) {
try {
is = ImageUtil.overlaying(is, arr.getRectangle(), arr.getValue());
strfile = arr.getFilePath();
is = ImageUtil.overlaying(is, patrolResult.getRectangle(), patrolResult.getValue());
strfile = patrolResult.getFilePath();
strfile = strfile.substring(0, strfile.lastIndexOf("/"));
String fileName = "modify_" + strfile.substring(strfile.lastIndexOf("/") + 1);
String file = saveFile(is, fileName, strfile);
arr.setFilePath(file);
patrolResult.setFilePath(file);
logger.info("robot image path: {}", file);
} catch (Exception e) {
e.printStackTrace();
@ -1317,61 +1317,61 @@ public class PatrolResultController extends BaseController {
}
}
patrolResultParam.setDeviceId(arr.getDeviceId());
patrolResultParam.setDeviceId(patrolResult.getDeviceId());
patrolResultParam.setDataType(datetype);
List<PatrolResult> results = patrolResultService.selectPatrolResultList(patrolResultParam);
if (!results.isEmpty()) {
PatrolResult patrolResult2 = results.get(0);
if (StringUtils.isNotEmpty(arr.getFilePath())) {
patrolResult2.setFilePath(arr.getFilePath());
if (StringUtils.isNotEmpty(patrolResult.getFilePath())) {
patrolResult2.setFilePath(patrolResult.getFilePath());
}
if (StringUtils.isNotEmpty(arr.getFileType())) {
patrolResult2.setFileType(arr.getFileType());
if (StringUtils.isNotEmpty(patrolResult.getFileType())) {
patrolResult2.setFileType(patrolResult.getFileType());
}
if (StringUtils.isNotEmpty(arr.getTime())) {
patrolResult2.setTime(arr.getTime());
if (StringUtils.isNotEmpty(patrolResult.getTime())) {
patrolResult2.setTime(patrolResult.getTime());
}
if ("2".equals(datetype)) {
if (StringUtils.isNotEmpty(arr.getUnit())) {
patrolResult2.setUnit(arr.getUnit());
if (StringUtils.isNotEmpty(patrolResult.getUnit())) {
patrolResult2.setUnit(patrolResult.getUnit());
}
if (StringUtils.isNotEmpty(arr.getValid())) {
patrolResult2.setValid(arr.getValid());
if (StringUtils.isNotEmpty(patrolResult.getValid())) {
patrolResult2.setValid(patrolResult.getValid());
}
if (StringUtils.isNotEmpty(arr.getValue())) {
patrolResult2.setValue(arr.getValue());
if (StringUtils.isNotEmpty(patrolResult.getValue())) {
patrolResult2.setValue(patrolResult.getValue());
}
if (StringUtils.isNotEmpty(arr.getValueType())) {
patrolResult2.setValueType(arr.getValueType());
if (StringUtils.isNotEmpty(patrolResult.getValueType())) {
patrolResult2.setValueType(patrolResult.getValueType());
}
if (StringUtils.isNotEmpty(arr.getValueUnit())) {
patrolResult2.setValueUnit(arr.getValueUnit());
if (StringUtils.isNotEmpty(patrolResult.getValueUnit())) {
patrolResult2.setValueUnit(patrolResult.getValueUnit());
}
}
Map<String, String> valueMap = patrolResultService.getPatrolResultValue(arr);
Map<String, String> valueMap = patrolResultService.getPatrolResultValue(patrolResult);
if (null != valueMap && !valueMap.isEmpty()) {
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);
patrolResult.setValue(strfile);
}
if (valueMap.containsKey("value_unit") && null != valueMap.get("value_unit")) {
strfile = valueMap.get("value_unit");
arr.setValueUnit(strfile);
patrolResult.setValueUnit(strfile);
}
}
if (StringUtils.isNotEmpty(arr.getFilePath()) && arr.getFilePath().contains(patrolTaskFtp.getFtpPath())) {
strfile = arr.getFilePath().replaceAll(patrolTaskFtp.getFtpPath().concat(StringUtils.SLASH), StringUtils.EMPTY);
if (StringUtils.isNotEmpty(patrolResult.getFilePath()) && patrolResult.getFilePath().contains(patrolTaskFtp.getFtpPath())) {
strfile = patrolResult.getFilePath().replaceAll(patrolTaskFtp.getFtpPath().concat(StringUtils.SLASH), StringUtils.EMPTY);
if (StringUtils.isNotEmpty(strfile)) {
patrolResult2.setFilePath(strfile);
}
@ -1382,52 +1382,52 @@ public class PatrolResultController extends BaseController {
resultList.add(patrolResult2);
// }
} else {
arr.setMainId(mainID + "");
Map<String, String> stringStringMap = patrolResultService.selectThresholdByPointId(arr.getDeviceId());
patrolResult.setMainId(mainID + "");
Map<String, String> stringStringMap = patrolResultService.selectThresholdByPointId(patrolResult.getDeviceId());
if (stringStringMap != null && StringUtils.isNotEmpty(stringStringMap.get("alarm_threshold"))) {
arr.setThreshold(stringStringMap.get("alarm_threshold"));
patrolResult.setThreshold(stringStringMap.get("alarm_threshold"));
}
arr.setPatrolStatus("0");
if (StringUtils.isNotEmpty(arr.getPatrolDeviceCode())) {
Map<String, Object> valueMap = resultAnalysisService.selectEqInfoByCode(arr.getPatrolDeviceCode());
patrolResult.setPatrolStatus("0");
if (StringUtils.isNotEmpty(patrolResult.getPatrolDeviceCode())) {
Map<String, Object> valueMap = resultAnalysisService.selectEqInfoByCode(patrolResult.getPatrolDeviceCode());
if (valueMap != null && valueMap.get("type") != null) {
strfile = valueMap.get("type") + "";
if (strfile.equals("13")) {
arr.setDataType("3");
patrolResult.setDataType("3");
} else if (!strfile.equals("1") && !strfile.equals("2") && !strfile.equals("3")) {
arr.setDataType(strfile.equals("14") ? "4" : "1");
patrolResult.setDataType(strfile.equals("14") ? "4" : "1");
} else {
arr.setDataType("2");
patrolResult.setDataType("2");
}
}
}
if (StringUtils.isNotEmpty(arr.getFilePath()) && arr.getFilePath().contains(patrolTaskFtp.getFtpPath())) {
strfile = arr.getFilePath().replaceAll(patrolTaskFtp.getFtpPath() + "/", StringUtils.EMPTY);
if (StringUtils.isNotEmpty(patrolResult.getFilePath()) && patrolResult.getFilePath().contains(patrolTaskFtp.getFtpPath())) {
strfile = patrolResult.getFilePath().replaceAll(patrolTaskFtp.getFtpPath() + "/", StringUtils.EMPTY);
if (StringUtils.isNotEmpty(strfile)) {
arr.setFilePath(strfile);
patrolResult.setFilePath(strfile);
}
}
Map<String, String> valueMap = patrolResultService.getPatrolResultValue(arr);
Map<String, String> valueMap = patrolResultService.getPatrolResultValue(patrolResult);
if (null != valueMap && !valueMap.isEmpty()) {
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);
patrolResult.setValue(strfile);
}
if (valueMap.containsKey("value_unit") && null != valueMap.get("value_unit")) {
strfile = valueMap.get("value_unit");
arr.setValueUnit(strfile);
patrolResult.setValueUnit(strfile);
}
}
i = patrolResultService.insertPatrolResult(arr);//
resultStatistics.compare(arr);
i = patrolResultService.insertPatrolResult(patrolResult);//
resultStatistics.compare(patrolResult);
// if (!"2".equals(Jqtype)) {
resultList.add(arr);
resultList.add(patrolResult);
// }
}
}


+ 6
- 2
inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/domain/PatrolResultRef.java View File

@ -13,6 +13,8 @@ public class PatrolResultRef {
private String devType;
private String time;
private String value;
private String algType;
private String algName;
private String threshold;
private String filePath;
private String description;
@ -25,12 +27,12 @@ public class PatrolResultRef {
if (this == object) return true;
if (object == null || getClass() != object.getClass()) return false;
PatrolResultRef that = (PatrolResultRef) object;
return Objects.equals(lineId, that.lineId) && Objects.equals(deviceId, that.deviceId) && Objects.equals(devType, that.devType) && Objects.equals(time, that.time) && Objects.equals(value, that.value) && Objects.equals(threshold, that.threshold) && Objects.equals(filePath, that.filePath) && Objects.equals(description, that.description) && Objects.equals(pointStatus, that.pointStatus) && Objects.equals(valueUnit, that.valueUnit) && Objects.equals(resultContent, that.resultContent);
return Objects.equals(lineId, that.lineId) && Objects.equals(deviceId, that.deviceId) && Objects.equals(devType, that.devType) && Objects.equals(time, that.time) && Objects.equals(value, that.value) && Objects.equals(algType, that.algType) && Objects.equals(algName, that.algName) && Objects.equals(threshold, that.threshold) && Objects.equals(filePath, that.filePath) && Objects.equals(description, that.description) && Objects.equals(pointStatus, that.pointStatus) && Objects.equals(valueUnit, that.valueUnit) && Objects.equals(resultContent, that.resultContent);
}
@Override
public int hashCode() {
return Objects.hash(lineId, deviceId, devType, time, value, threshold, filePath, description, pointStatus, valueUnit, resultContent);
return Objects.hash(lineId, deviceId, devType, time, value, algType, algName, threshold, filePath, description, pointStatus, valueUnit, resultContent);
}
@Override
@ -41,6 +43,8 @@ public class PatrolResultRef {
", devType='" + devType + '\'' +
", time='" + time + '\'' +
", value='" + value + '\'' +
", algType='" + algType + '\'' +
", algName='" + algName + '\'' +
", threshold='" + threshold + '\'' +
", filePath='" + filePath + '\'' +
", description='" + description + '\'' +


+ 3
- 0
inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/mapper/PatrolResultMapper.java View File

@ -107,4 +107,7 @@ public interface PatrolResultMapper {
List<PatrolResultRef> selectResultRefByLineIds(@Param("mainIds") List<Long> mainIds);
List<BasePointAreaInfo> selectBaseInfoByMainIds(@Param("mainIds") List<Long> mainIds);
List<PatrolResultRef> selectResultDoc(PatrolResult patrolResult);
}

+ 4
- 1
inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/AnalyseRemoteService.java View File

@ -2,6 +2,7 @@ package com.inspect.partrolresult.service;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.util.StringUtil;
import com.inspect.analysis.constant.AnalyseConstants;
import com.inspect.analysis.domain.AnalyseLog;
import java.util.Collections;
@ -49,7 +50,9 @@ public class AnalyseRemoteService {
String analyseFilter = patrolTaskService.selectConfigByKey("ANALYSE_IS_FILTER");
String requestUrl;
if ("1".equals(analyseFilter) && isFilter) {
this.redisService.setCacheObject("ANALYSE_FILTER_REQUEST:" + requestId, analyseReq.clone(), 1L, TimeUnit.HOURS);
final String analyzeFilterRequestIdRedisKey = AnalyseConstants.ANALYSE_FILTER_REQUEST.concat(requestId);
log.info("[ALG] sendRequest analyseFilterRequestIdRedisKey: {}, analyseReq: {}", analyzeFilterRequestIdRedisKey, analyseReq);
this.redisService.setCacheObject(analyzeFilterRequestIdRedisKey, analyseReq.clone(), 1L, TimeUnit.HOURS);
AnalyseReqItem analyseReqItem = analyseReq.getObjectList().get(0);
analyseReqItem.setTypeList(typeList);
analyseReq.setObjectList(Collections.singletonList(analyseReqItem));


+ 37
- 0
inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolResultMapper.xml View File

@ -1030,4 +1030,41 @@
</foreach>
ORDER BY main_id,create_time
</select>
<select id="selectResultDoc" parameterType="PatrolResult" resultMap="PatrolResultRef">
select
b.line_id,
a.device_id,
c.dev_type,
a.time,
a.value,
a.threshold,
a.file_path,
b.description,
b.point_status,
b.res_status,
a.value_unit,
b.result_content,
b.res_img_url,
b.res_value,
b.res_desc,
b.alg_type,
a.device_name,
a.patrol_device_name,
a.task_name,
a.data_type,
a.patrol_device_code,
a.task_code,
a.task_patrolled_id,
b.original_value
from patrol_result a
left join result_analysis b on a.line_id = b.business_id
left join patrol_task_info c on a.task_code = c.task_major_id
and a.device_id = c.device_id
and a.patrol_device_code = c.dev_no
where b.result = '1' and b.point_status != '1'
<if test="mainId != null and mainId != ''"> and a.main_id = #{mainId}</if>
<if test="lineId != null and lineId != ''"> and b.line_id = #{lineId}</if>
</select>
</mapper>

Loading…
Cancel
Save