|
|
@ -8,6 +8,7 @@ import com.inspect.analysis.domain.AnalyseResPoint; |
|
|
import com.inspect.analysis.domain.ResultAnalysis; |
|
|
import com.inspect.analysis.domain.ResultAnalysis; |
|
|
import com.inspect.analysis.mapper.ResultAnalysisMapper; |
|
|
import com.inspect.analysis.mapper.ResultAnalysisMapper; |
|
|
import com.inspect.base.core.constant.AlgConstants; |
|
|
import com.inspect.base.core.constant.AlgConstants; |
|
|
|
|
|
import com.inspect.base.core.enums.TaskType; |
|
|
import com.inspect.base.core.exception.ServiceException; |
|
|
import com.inspect.base.core.exception.ServiceException; |
|
|
import com.inspect.base.core.utils.DateUtils; |
|
|
import com.inspect.base.core.utils.DateUtils; |
|
|
import com.inspect.base.core.utils.StringUtils; |
|
|
import com.inspect.base.core.utils.StringUtils; |
|
|
@ -34,11 +35,6 @@ import com.inspect.task.domain.PatrolTask; |
|
|
import com.inspect.task.mapper.PatrolTaskMapper; |
|
|
import com.inspect.task.mapper.PatrolTaskMapper; |
|
|
import com.inspect.taskstatus.domain.PatrolTaskStatus; |
|
|
import com.inspect.taskstatus.domain.PatrolTaskStatus; |
|
|
import com.inspect.taskstatus.mapper.PatrolTaskStatusMapper; |
|
|
import com.inspect.taskstatus.mapper.PatrolTaskStatusMapper; |
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
|
import java.util.*; |
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
import io.seata.common.util.CollectionUtils; |
|
|
import io.seata.common.util.CollectionUtils; |
|
|
import org.slf4j.Logger; |
|
|
import org.slf4j.Logger; |
|
|
import org.slf4j.LoggerFactory; |
|
|
import org.slf4j.LoggerFactory; |
|
|
@ -48,20 +44,25 @@ import org.springframework.cloud.context.config.annotation.RefreshScope; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
|
import java.util.*; |
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
@Service |
|
|
@Service |
|
|
@RefreshScope |
|
|
@RefreshScope |
|
|
public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
private static final Logger log = LoggerFactory.getLogger(PatrolResultServiceImpl.class); |
|
|
private static final Logger log = LoggerFactory.getLogger(PatrolResultServiceImpl.class); |
|
|
|
|
|
|
|
|
@Value("${inspect.task.report.voltage:±800kv}") |
|
|
|
|
|
private String voltage; |
|
|
|
|
|
|
|
|
|
|
|
@Value("${inspect.task.report.all:0}") |
|
|
|
|
|
private String exportReportFlag; |
|
|
|
|
|
|
|
|
|
|
|
private final PatrolResultMapper patrolResultMapper; |
|
|
|
|
|
|
|
|
private static final Set<String> validAlgTypes = new HashSet<>(Arrays.asList( |
|
|
|
|
|
AlgConstants.METER, |
|
|
|
|
|
AlgConstants.XB, |
|
|
|
|
|
AlgConstants.INFRA_1800, |
|
|
|
|
|
AlgConstants.INFRA_YU3, |
|
|
|
|
|
AlgConstants.INFRA_CAMERA, |
|
|
|
|
|
AlgConstants.INFRA_CAMERA_REVERSE |
|
|
|
|
|
)); |
|
|
final |
|
|
final |
|
|
PatrolResultDefaultValueMapper patrolResultDefaultvalueMapper; |
|
|
PatrolResultDefaultValueMapper patrolResultDefaultvalueMapper; |
|
|
|
|
|
private final PatrolResultMapper patrolResultMapper; |
|
|
private final PatrolTaskResultMainMapper patrolTaskResultMainMapper; |
|
|
private final PatrolTaskResultMainMapper patrolTaskResultMainMapper; |
|
|
private final PatrolTaskStatusMapper patrolTaskStatusMapper; |
|
|
private final PatrolTaskStatusMapper patrolTaskStatusMapper; |
|
|
private final PatrolTaskMapper patrolTaskMapper; |
|
|
private final PatrolTaskMapper patrolTaskMapper; |
|
|
@ -69,20 +70,14 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
private final InspectionReportImgMapper inspectionReportImgMapper; |
|
|
private final InspectionReportImgMapper inspectionReportImgMapper; |
|
|
private final InspectionReportDataMapper inspectionReportDataMapper; |
|
|
private final InspectionReportDataMapper inspectionReportDataMapper; |
|
|
private final ResultAnalysisMapper resultAnalysisMapper; |
|
|
private final ResultAnalysisMapper resultAnalysisMapper; |
|
|
|
|
|
|
|
|
private final FeignBasedataAreaService feignBasedataAreaService; |
|
|
private final FeignBasedataAreaService feignBasedataAreaService; |
|
|
|
|
|
|
|
|
|
|
|
@Value("${inspect.task.report.voltage:±800kv}") |
|
|
|
|
|
private String voltage; |
|
|
|
|
|
@Value("${inspect.task.report.all:0}") |
|
|
|
|
|
private String exportReportFlag; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private MessageUtils messageUtils; |
|
|
private MessageUtils messageUtils; |
|
|
|
|
|
|
|
|
private static final Set<String> validAlgTypes = new HashSet<>(Arrays.asList( |
|
|
|
|
|
AlgConstants.METER, |
|
|
|
|
|
AlgConstants.XB, |
|
|
|
|
|
AlgConstants.INFRA_1800, |
|
|
|
|
|
AlgConstants.INFRA_YU3, |
|
|
|
|
|
AlgConstants.INFRA_CAMERA, |
|
|
|
|
|
AlgConstants.INFRA_CAMERA_REVERSE |
|
|
|
|
|
));; |
|
|
|
|
|
|
|
|
; |
|
|
|
|
|
|
|
|
public PatrolResultServiceImpl(PatrolResultMapper patrolResultMapper, PatrolResultDefaultValueMapper patrolResultDefaultvalueMapper, PatrolTaskResultMainMapper patrolTaskResultMainMapper, PatrolTaskStatusMapper patrolTaskStatusMapper, PatrolTaskMapper patrolTaskMapper, InspectionReportMapper inspectionReportMapper, InspectionReportImgMapper inspectionReportImgMapper, InspectionReportDataMapper inspectionReportDataMapper, ResultAnalysisMapper resultAnalysisMapper, FeignBasedataAreaService feignBasedataAreaService) { |
|
|
public PatrolResultServiceImpl(PatrolResultMapper patrolResultMapper, PatrolResultDefaultValueMapper patrolResultDefaultvalueMapper, PatrolTaskResultMainMapper patrolTaskResultMainMapper, PatrolTaskStatusMapper patrolTaskStatusMapper, PatrolTaskMapper patrolTaskMapper, InspectionReportMapper inspectionReportMapper, InspectionReportImgMapper inspectionReportImgMapper, InspectionReportDataMapper inspectionReportDataMapper, ResultAnalysisMapper resultAnalysisMapper, FeignBasedataAreaService feignBasedataAreaService) { |
|
|
this.patrolResultMapper = patrolResultMapper; |
|
|
this.patrolResultMapper = patrolResultMapper; |
|
|
@ -130,11 +125,21 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
return patrolResultMapper.selectPatrolDataResultByTaskCode(patrolResult); |
|
|
return patrolResultMapper.selectPatrolDataResultByTaskCode(patrolResult); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
public List<PatrolData> selectPatrolDataResultByTaskCodeV2(ResultAnalysis resultAnalysis) { |
|
|
public List<PatrolData> selectPatrolDataResultByTaskCodeV2(ResultAnalysis resultAnalysis) { |
|
|
return this.patrolResultMapper.selectPatrolDataResultByTaskCodeV2(resultAnalysis); |
|
|
|
|
|
|
|
|
PatrolTaskStatus patrolTaskStatus = patrolTaskStatusMapper.selectPatrolTaskStatusByTaskPatrolledId(resultAnalysis.getTaskPatrolId()); |
|
|
|
|
|
if (patrolTaskStatus != null) { |
|
|
|
|
|
if (patrolTaskStatus.getTaskType().equals(TaskType.MAIN.getCode())) { |
|
|
|
|
|
List<String> taskPatrolIds = patrolTaskStatus.getChildren().stream().map(PatrolTaskStatus::getTaskPatrolledId).collect(Collectors.toList()); |
|
|
|
|
|
resultAnalysis.setTaskPatrolIds(taskPatrolIds); |
|
|
|
|
|
} else { |
|
|
|
|
|
resultAnalysis.setTaskPatrolIds(Collections.singletonList(patrolTaskStatus.getTaskPatrolledId())); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
log.info("---------------[TASK] query resultAnalysis {}", resultAnalysis); |
|
|
|
|
|
return this.patrolResultMapper.selectPatrolDataResultByTaskCodeV3(resultAnalysis); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<PatrolData> selectPatrolDataResultByTaskCodeList(PatrolTaskStatus patrolTaskStatus) { |
|
|
public List<PatrolData> selectPatrolDataResultByTaskCodeList(PatrolTaskStatus patrolTaskStatus) { |
|
|
return patrolResultMapper.selectPatrolDataResultByTaskCodeList(patrolTaskStatus); |
|
|
return patrolResultMapper.selectPatrolDataResultByTaskCodeList(patrolTaskStatus); |
|
|
} |
|
|
} |
|
|
@ -366,7 +371,6 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
// return saveReportData(resultList, resultMain, lineIds); |
|
|
// return saveReportData(resultList, resultMain, lineIds); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional |
|
|
@Transactional |
|
|
public List<Long> saveReportLingzhou_v2(PatrolTaskResultMain resultMain, List<Long> lineIds, Long currentLineId, List<PatrolResult> resultList) { |
|
|
public List<Long> saveReportLingzhou_v2(PatrolTaskResultMain resultMain, List<Long> lineIds, Long currentLineId, List<PatrolResult> resultList) { |
|
|
long startTime = System.currentTimeMillis(); |
|
|
long startTime = System.currentTimeMillis(); |
|
|
@ -504,6 +508,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
|
|
|
|
|
|
@Transactional |
|
|
@Transactional |
|
|
public List<Long> saveReportShaoxing(PatrolTaskResultMain resultMain, List<Long> lineIds, List<PatrolResult> resultList) { |
|
|
public List<Long> saveReportShaoxing(PatrolTaskResultMain resultMain, List<Long> lineIds, List<PatrolResult> resultList) { |
|
|
|
|
|
log.info("saveReportShaoxing PatrolTaskResultMain:{},lineIds:{},resultList:{} ", resultMain, lineIds, resultList); |
|
|
long startTime = System.currentTimeMillis(); |
|
|
long startTime = System.currentTimeMillis(); |
|
|
List<Long> reportIds = new ArrayList<>(); |
|
|
List<Long> reportIds = new ArrayList<>(); |
|
|
// 获取站信息 |
|
|
// 获取站信息 |
|
|
@ -536,6 +541,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
List<String> taskNames = resultList.stream().map(PatrolResult::getTaskName).distinct().collect(Collectors.toList()); |
|
|
List<String> taskNames = resultList.stream().map(PatrolResult::getTaskName).distinct().collect(Collectors.toList()); |
|
|
String taskName = StringUtils.join(taskNames, ","); |
|
|
String taskName = StringUtils.join(taskNames, ","); |
|
|
boolean isMultipleTasks = CollectionUtils.isNotEmpty(taskPatrolledIds) && taskPatrolledIds.size() > 1; |
|
|
boolean isMultipleTasks = CollectionUtils.isNotEmpty(taskPatrolledIds) && taskPatrolledIds.size() > 1; |
|
|
|
|
|
// todo 多任务判断有问题 |
|
|
if (isMultipleTasks) { |
|
|
if (isMultipleTasks) { |
|
|
// 说明多个任务合并,任务名称修改为巡视日期-巡视报告 例如:2026年3月23日-巡视报告 |
|
|
// 说明多个任务合并,任务名称修改为巡视日期-巡视报告 例如:2026年3月23日-巡视报告 |
|
|
Date date = CollectionUtils.isNotEmpty(startTimes) ? startTimes.get(0) : new Date(); |
|
|
Date date = CollectionUtils.isNotEmpty(startTimes) ? startTimes.get(0) : new Date(); |
|
|
@ -713,11 +719,13 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
resultMain.setCheckTime(new Date()); |
|
|
resultMain.setCheckTime(new Date()); |
|
|
resultMain.setFileStatus("1"); |
|
|
resultMain.setFileStatus("1"); |
|
|
String mainId = String.valueOf(resultMain.getLineId()); |
|
|
String mainId = String.valueOf(resultMain.getLineId()); |
|
|
|
|
|
|
|
|
// 查询当前的结果信息 |
|
|
// 查询当前的结果信息 |
|
|
PatrolResult patrolResult = resultList.stream().filter(item -> mainId.equals(item.getMainId())).findFirst().orElse(null); |
|
|
PatrolResult patrolResult = resultList.stream().filter(item -> mainId.equals(item.getMainId())).findFirst().orElse(null); |
|
|
assert patrolResult != null; |
|
|
assert patrolResult != null; |
|
|
String taskCode = patrolResult.getTaskCode(); |
|
|
String taskCode = patrolResult.getTaskCode(); |
|
|
String taskPatrolId = patrolResult.getTaskPatrolledId(); |
|
|
|
|
|
|
|
|
PatrolTaskResultMain main = patrolTaskResultMainMapper.selectPatrolTaskResultMainByLineId(lineId); |
|
|
|
|
|
String taskPatrolId = main.getTaskPatrolledId(); |
|
|
if (StringUtils.isEmpty(taskPatrolId)) { |
|
|
if (StringUtils.isEmpty(taskPatrolId)) { |
|
|
throw new ServiceException("LACK PLAN ID: " + mainId); |
|
|
throw new ServiceException("LACK PLAN ID: " + mainId); |
|
|
} else { |
|
|
} else { |
|
|
@ -922,7 +930,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
if ("0".equals(exportReportFlag) && aiQxNum == 0 && csQxNum == 0) { |
|
|
if ("0".equals(exportReportFlag) && aiQxNum == 0 && csQxNum == 0) { |
|
|
continue; |
|
|
continue; |
|
|
} |
|
|
} |
|
|
Map<String,PatrolResultRef> keyPatrolResultRef = new HashMap<>(); |
|
|
|
|
|
|
|
|
Map<String, PatrolResultRef> keyPatrolResultRef = new HashMap<>(); |
|
|
List<PatrolResultRef> patrolResultRefs = patrolResultMapper.selectResultRefByLineIds(lineIds, "0"); |
|
|
List<PatrolResultRef> patrolResultRefs = patrolResultMapper.selectResultRefByLineIds(lineIds, "0"); |
|
|
List<PatrolResultRef> patrolResultRefsFilter = patrolResultMapper.selectResultRefByLineIds(lineIds, "1"); |
|
|
List<PatrolResultRef> patrolResultRefsFilter = patrolResultMapper.selectResultRefByLineIds(lineIds, "1"); |
|
|
for (PatrolResultRef AIRef : patrolResultRefs) { |
|
|
for (PatrolResultRef AIRef : patrolResultRefs) { |
|
|
@ -940,7 +948,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
report.setInspectionStartTime(startTimes.get(0)); |
|
|
report.setInspectionStartTime(startTimes.get(0)); |
|
|
report.setInspectionEndTime(DateUtils.parseDate(endTimes.get(endTimes.size() - 1))); |
|
|
report.setInspectionEndTime(DateUtils.parseDate(endTimes.get(endTimes.size() - 1))); |
|
|
report.setTaskId(String.valueOf(task.getTaskId())); |
|
|
report.setTaskId(String.valueOf(task.getTaskId())); |
|
|
report.setEnvInfo(StringUtils.join(envoList,",")); |
|
|
|
|
|
|
|
|
report.setEnvInfo(StringUtils.join(envoList, ",")); |
|
|
report.setTaskPatrolledId(taskPatrolId); |
|
|
report.setTaskPatrolledId(taskPatrolId); |
|
|
report.setInspectionTaskName(taskName); |
|
|
report.setInspectionTaskName(taskName); |
|
|
report.setDescription(resultMain.getTaskResult()); |
|
|
report.setDescription(resultMain.getTaskResult()); |
|
|
@ -973,18 +981,18 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
String AiNum = statisticsAnalyseNumV2(mainId, "0"); |
|
|
String AiNum = statisticsAnalyseNumV2(mainId, "0"); |
|
|
String[] nums = new String[]{AiNum, filterNum}; |
|
|
String[] nums = new String[]{AiNum, filterNum}; |
|
|
startTime = PrintUtil.useTime("统计分析数据", startTime); |
|
|
startTime = PrintUtil.useTime("统计分析数据", startTime); |
|
|
if(resultList.isEmpty()) { |
|
|
|
|
|
|
|
|
if (resultList.isEmpty()) { |
|
|
throw new ServiceException("缺少巡检结果:" + mainId); |
|
|
throw new ServiceException("缺少巡检结果:" + mainId); |
|
|
} else { |
|
|
} else { |
|
|
PatrolResult patrolResult = resultList.get(0); |
|
|
PatrolResult patrolResult = resultList.get(0); |
|
|
String taskCode = patrolResult.getTaskCode(); |
|
|
String taskCode = patrolResult.getTaskCode(); |
|
|
String taskPatrolId = patrolResult.getTaskPatrolledId(); |
|
|
String taskPatrolId = patrolResult.getTaskPatrolledId(); |
|
|
if(StringUtils.isEmpty(taskPatrolId)) { |
|
|
|
|
|
|
|
|
if (StringUtils.isEmpty(taskPatrolId)) { |
|
|
throw new ServiceException("缺少执行ID:" + mainId); |
|
|
throw new ServiceException("缺少执行ID:" + mainId); |
|
|
} else { |
|
|
} else { |
|
|
List<PatrolTaskStatus> taskStatuses = this.patrolTaskStatusMapper.selectPatrolTaskStatusList(new PatrolTaskStatus(taskPatrolId)); |
|
|
List<PatrolTaskStatus> taskStatuses = this.patrolTaskStatusMapper.selectPatrolTaskStatusList(new PatrolTaskStatus(taskPatrolId)); |
|
|
startTime = PrintUtil.useTime("查询状态数据", startTime); |
|
|
startTime = PrintUtil.useTime("查询状态数据", startTime); |
|
|
if(taskStatuses.isEmpty()) { |
|
|
|
|
|
|
|
|
if (taskStatuses.isEmpty()) { |
|
|
throw new ServiceException("缺少状态数据:" + mainId); |
|
|
throw new ServiceException("缺少状态数据:" + mainId); |
|
|
} else { |
|
|
} else { |
|
|
PatrolTaskStatus taskStatus = taskStatuses.get(0); |
|
|
PatrolTaskStatus taskStatus = taskStatuses.get(0); |
|
|
@ -992,7 +1000,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
patrolTask.setTaskCode(taskCode); |
|
|
patrolTask.setTaskCode(taskCode); |
|
|
List<PatrolTask> list = this.patrolTaskMapper.selectPatrolTaskList(patrolTask); |
|
|
List<PatrolTask> list = this.patrolTaskMapper.selectPatrolTaskList(patrolTask); |
|
|
startTime = PrintUtil.useTime("查询任务计划", startTime); |
|
|
startTime = PrintUtil.useTime("查询任务计划", startTime); |
|
|
if(list.isEmpty()) { |
|
|
|
|
|
|
|
|
if (list.isEmpty()) { |
|
|
throw new ServiceException("任务计划丢失:" + taskCode); |
|
|
throw new ServiceException("任务计划丢失:" + taskCode); |
|
|
} else { |
|
|
} else { |
|
|
PatrolTask task = list.get(0); |
|
|
PatrolTask task = list.get(0); |
|
|
@ -1005,31 +1013,31 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
ResultAnalysis ras = resultAnalysisMapper.selectTaskAbnormalData(resultAnalysis); |
|
|
ResultAnalysis ras = resultAnalysisMapper.selectTaskAbnormalData(resultAnalysis); |
|
|
int ii = 0; |
|
|
int ii = 0; |
|
|
int iii = 0; |
|
|
int iii = 0; |
|
|
if(0 == ras.getCsQxNum()) { |
|
|
|
|
|
|
|
|
if (0 == ras.getCsQxNum()) { |
|
|
ras.setFilter("0"); |
|
|
ras.setFilter("0"); |
|
|
ii = 0; |
|
|
ii = 0; |
|
|
iii = 0; |
|
|
iii = 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if(0 == ras.getAiQxNum()) { |
|
|
|
|
|
|
|
|
if (0 == ras.getAiQxNum()) { |
|
|
ras.setFilter("1"); |
|
|
ras.setFilter("1"); |
|
|
ii = 0; |
|
|
ii = 0; |
|
|
iii = 1; |
|
|
iii = 1; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if(0 != ras.getCsQxNum() && 0 != ras.getAiQxNum()) { |
|
|
|
|
|
|
|
|
if (0 != ras.getCsQxNum() && 0 != ras.getAiQxNum()) { |
|
|
ras.setFilter("2"); |
|
|
ras.setFilter("2"); |
|
|
ii = 2; |
|
|
ii = 2; |
|
|
} |
|
|
} |
|
|
Long[] ids = new Long[ii]; |
|
|
Long[] ids = new Long[ii]; |
|
|
List list1 = new ArrayList<>(); |
|
|
List list1 = new ArrayList<>(); |
|
|
|
|
|
|
|
|
for(int i = 0; i < 2; ++i) { |
|
|
|
|
|
if(0 != ras.getCsQxNum() && 0 != ras.getAiQxNum()) { |
|
|
|
|
|
|
|
|
for (int i = 0; i < 2; ++i) { |
|
|
|
|
|
if (0 != ras.getCsQxNum() && 0 != ras.getAiQxNum()) { |
|
|
iii = i; |
|
|
iii = i; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if(i != Integer.parseInt(ras.getFilter())) { |
|
|
|
|
|
|
|
|
if (i != Integer.parseInt(ras.getFilter())) { |
|
|
InspectionReport report = new InspectionReport(); |
|
|
InspectionReport report = new InspectionReport(); |
|
|
resetReport(report, nums[iii], mainId, task, taskStatus); |
|
|
resetReport(report, nums[iii], mainId, task, taskStatus); |
|
|
report.setFilter(iii + ""); |
|
|
report.setFilter(iii + ""); |
|
|
@ -1056,6 +1064,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void resetReport(InspectionReport report, String analyseNum, String mainId, PatrolTask task, PatrolTaskStatus taskStatus) { |
|
|
private void resetReport(InspectionReport report, String analyseNum, String mainId, PatrolTask task, PatrolTaskStatus taskStatus) { |
|
|
report.setPatrolStatistics(analyseNum); |
|
|
report.setPatrolStatistics(analyseNum); |
|
|
//report.setInspectionDate(task.getCreateTime()); |
|
|
//report.setInspectionDate(task.getCreateTime()); |
|
|
@ -1071,7 +1080,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
// List<PatrolResultRef> patrolResultRefs = patrolResultMapper.selectResultRefByLineId(mainId); |
|
|
// List<PatrolResultRef> patrolResultRefs = patrolResultMapper.selectResultRefByLineId(mainId); |
|
|
// List<PatrolResultRef> patrolResultRefs = patrolResultMapper.selectResultRefByLineIds(mainIds, filter); |
|
|
// List<PatrolResultRef> patrolResultRefs = patrolResultMapper.selectResultRefByLineIds(mainIds, filter); |
|
|
if ("0".equals(exportReportFlag)) { |
|
|
if ("0".equals(exportReportFlag)) { |
|
|
List <PatrolResultRef> resultRefs = new ArrayList<>(); |
|
|
|
|
|
|
|
|
List<PatrolResultRef> resultRefs = new ArrayList<>(); |
|
|
// 只导出缺陷 |
|
|
// 只导出缺陷 |
|
|
patrolResultRefs = patrolResultRefs.stream().filter((item) -> "0".equals(item.getResultType())).collect(Collectors.toList()); |
|
|
patrolResultRefs = patrolResultRefs.stream().filter((item) -> "0".equals(item.getResultType())).collect(Collectors.toList()); |
|
|
// 分组,按点位ID和算法类型进行分组 |
|
|
// 分组,按点位ID和算法类型进行分组 |
|
|
@ -1148,7 +1157,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
} |
|
|
} |
|
|
reportData.setAlgName(patrolResultRef.getAlgName()); |
|
|
reportData.setAlgName(patrolResultRef.getAlgName()); |
|
|
String threshold = patrolResultRef.getThreshold(); |
|
|
String threshold = patrolResultRef.getThreshold(); |
|
|
if(StringUtils.isBlank(threshold)) { |
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(threshold)) { |
|
|
threshold = ""; |
|
|
threshold = ""; |
|
|
} |
|
|
} |
|
|
if ("1".equals(patrolResultRef.getResultType()) && threshold.contains("sub_53")) { |
|
|
if ("1".equals(patrolResultRef.getResultType()) && threshold.contains("sub_53")) { |
|
|
@ -1182,7 +1191,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
// ++okNum; |
|
|
// ++okNum; |
|
|
// } |
|
|
// } |
|
|
log.info("[RESULT] resultType: {}, patrolResultRef: {}", resultType, patrolResultRef); |
|
|
log.info("[RESULT] resultType: {}, patrolResultRef: {}", resultType, patrolResultRef); |
|
|
if(resultType == null) { |
|
|
|
|
|
|
|
|
if (resultType == null) { |
|
|
continue; |
|
|
continue; |
|
|
} else if (resultType.equals("0")) { |
|
|
} else if (resultType.equals("0")) { |
|
|
reportData.setPointStatus(messageUtils.get("缺陷")); |
|
|
reportData.setPointStatus(messageUtils.get("缺陷")); |
|
|
@ -1294,7 +1303,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
} |
|
|
} |
|
|
reportData.setAlgName(patrolResultRef.getAlgName()); |
|
|
reportData.setAlgName(patrolResultRef.getAlgName()); |
|
|
String threshold = patrolResultRef.getThreshold(); |
|
|
String threshold = patrolResultRef.getThreshold(); |
|
|
if(StringUtils.isBlank(threshold)) { |
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(threshold)) { |
|
|
threshold = ""; |
|
|
threshold = ""; |
|
|
} |
|
|
} |
|
|
if ("1".equals(patrolResultRef.getResultType()) && threshold.contains("sub_53")) { |
|
|
if ("1".equals(patrolResultRef.getResultType()) && threshold.contains("sub_53")) { |
|
|
@ -1312,7 +1321,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
String pointStatus = patrolResultRef.getPointStatus(); |
|
|
String pointStatus = patrolResultRef.getPointStatus(); |
|
|
String resultType = patrolResultRef.getResultType(); |
|
|
String resultType = patrolResultRef.getResultType(); |
|
|
log.info("[RESULT] resultType: {}, patrolResultRef: {}", resultType, patrolResultRef); |
|
|
log.info("[RESULT] resultType: {}, patrolResultRef: {}", resultType, patrolResultRef); |
|
|
if(resultType == null) { |
|
|
|
|
|
|
|
|
if (resultType == null) { |
|
|
continue; |
|
|
continue; |
|
|
} else if (resultType.equals("0")) { |
|
|
} else if (resultType.equals("0")) { |
|
|
reportData.setPointStatus(messageUtils.get("缺陷")); |
|
|
reportData.setPointStatus(messageUtils.get("缺陷")); |
|
|
@ -1394,7 +1403,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
public void batchInsertReportData_Lingzhou(String reportId, List<BasePointAreaInfo> basePointAreaInfoList, String filter, List<PatrolResultRef> patrolResultRefs) { |
|
|
public void batchInsertReportData_Lingzhou(String reportId, List<BasePointAreaInfo> basePointAreaInfoList, String filter, List<PatrolResultRef> patrolResultRefs) { |
|
|
long startTime = System.currentTimeMillis(); |
|
|
long startTime = System.currentTimeMillis(); |
|
|
if ("0".equals(exportReportFlag)) { |
|
|
if ("0".equals(exportReportFlag)) { |
|
|
List <PatrolResultRef> resultRefs = new ArrayList<>(); |
|
|
|
|
|
|
|
|
List<PatrolResultRef> resultRefs = new ArrayList<>(); |
|
|
// 只导出缺陷 |
|
|
// 只导出缺陷 |
|
|
patrolResultRefs = patrolResultRefs.stream().filter((item) -> "0".equals(item.getResultType())).collect(Collectors.toList()); |
|
|
patrolResultRefs = patrolResultRefs.stream().filter((item) -> "0".equals(item.getResultType())).collect(Collectors.toList()); |
|
|
// 分组,按点位ID和算法类型进行分组 |
|
|
// 分组,按点位ID和算法类型进行分组 |
|
|
@ -1466,7 +1475,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
} |
|
|
} |
|
|
reportData.setAlgName(patrolResultRef.getAlgName()); |
|
|
reportData.setAlgName(patrolResultRef.getAlgName()); |
|
|
String threshold = patrolResultRef.getThreshold(); |
|
|
String threshold = patrolResultRef.getThreshold(); |
|
|
if(StringUtils.isBlank(threshold)) { |
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(threshold)) { |
|
|
threshold = ""; |
|
|
threshold = ""; |
|
|
} |
|
|
} |
|
|
if ("1".equals(patrolResultRef.getResultType()) && threshold.contains("sub_53")) { |
|
|
if ("1".equals(patrolResultRef.getResultType()) && threshold.contains("sub_53")) { |
|
|
@ -1483,7 +1492,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
|
|
|
|
|
|
String resultType = patrolResultRef.getResultType(); |
|
|
String resultType = patrolResultRef.getResultType(); |
|
|
log.info("[RESULT] resultType: {}, patrolResultRef: {}", resultType, patrolResultRef); |
|
|
log.info("[RESULT] resultType: {}, patrolResultRef: {}", resultType, patrolResultRef); |
|
|
if(resultType == null) { |
|
|
|
|
|
|
|
|
if (resultType == null) { |
|
|
continue; |
|
|
continue; |
|
|
} else if (resultType.equals("0")) { |
|
|
} else if (resultType.equals("0")) { |
|
|
reportData.setPointStatus(messageUtils.get("缺陷")); |
|
|
reportData.setPointStatus(messageUtils.get("缺陷")); |
|
|
@ -1559,7 +1568,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
List<InspectionReportImg> reportImages = new ArrayList<>(); |
|
|
List<InspectionReportImg> reportImages = new ArrayList<>(); |
|
|
|
|
|
|
|
|
int i; |
|
|
int i; |
|
|
for(i = 0; i < patrolResultRefs.size(); ++i) { |
|
|
|
|
|
|
|
|
for (i = 0; i < patrolResultRefs.size(); ++i) { |
|
|
PatrolResultRef ref = patrolResultRefs.get(i); |
|
|
PatrolResultRef ref = patrolResultRefs.get(i); |
|
|
ref.setAlgName(algInfos.stream().filter((alg) -> { |
|
|
ref.setAlgName(algInfos.stream().filter((alg) -> { |
|
|
return alg.getAlgSubtypeCode().equals(ref.getAlgType()); |
|
|
return alg.getAlgSubtypeCode().equals(ref.getAlgType()); |
|
|
@ -1730,7 +1739,6 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
return String.format(messageUtils.get("缺陷总数:%d个"), confirmNum); |
|
|
return String.format(messageUtils.get("缺陷总数:%d个"), confirmNum); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String statisticsAnalyseNumLingZhou(List<Long> lineIds) { |
|
|
public String statisticsAnalyseNumLingZhou(List<Long> lineIds) { |
|
|
int okNum = 0; |
|
|
int okNum = 0; |
|
|
int failNum = 0; |
|
|
int failNum = 0; |
|
|
@ -1777,7 +1785,6 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String statisticsAnalyseNumShaoxing(List<Long> lineIds) { |
|
|
public String statisticsAnalyseNumShaoxing(List<Long> lineIds) { |
|
|
int okNum = 0; |
|
|
int okNum = 0; |
|
|
int failNum = 0; |
|
|
int failNum = 0; |
|
|
@ -1850,7 +1857,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
|
|
|
|
|
|
int totalNum = analyses.size(); |
|
|
int totalNum = analyses.size(); |
|
|
int lastNum = totalNum - failNum - confirmNum; |
|
|
int lastNum = totalNum - failNum - confirmNum; |
|
|
if(lastNum != okNum) { |
|
|
|
|
|
|
|
|
if (lastNum != okNum) { |
|
|
; |
|
|
; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -1928,7 +1935,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
report.setStationType(stationType); |
|
|
report.setStationType(stationType); |
|
|
Map<GroupKey, List<PatrolResultRef>> groupKeyListMap; |
|
|
Map<GroupKey, List<PatrolResultRef>> groupKeyListMap; |
|
|
if ("0".equals(exportReportFlag)) { |
|
|
if ("0".equals(exportReportFlag)) { |
|
|
List <PatrolResultRef> resultRefs = new ArrayList<>(); |
|
|
|
|
|
|
|
|
List<PatrolResultRef> resultRefs = new ArrayList<>(); |
|
|
// 只导出缺陷 |
|
|
// 只导出缺陷 |
|
|
patrolResultRefs = patrolResultRefs.stream().filter((item) -> "0".equals(item.getResultType())).collect(Collectors.toList()); |
|
|
patrolResultRefs = patrolResultRefs.stream().filter((item) -> "0".equals(item.getResultType())).collect(Collectors.toList()); |
|
|
// 分组,按点位ID和算法类型进行分组 |
|
|
// 分组,按点位ID和算法类型进行分组 |
|
|
@ -2093,7 +2100,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
} |
|
|
} |
|
|
reportData.setAlgName(patrolResultRef.getAlgName()); |
|
|
reportData.setAlgName(patrolResultRef.getAlgName()); |
|
|
String threshold = patrolResultRef.getThreshold(); |
|
|
String threshold = patrolResultRef.getThreshold(); |
|
|
if(StringUtils.isBlank(threshold)) { |
|
|
|
|
|
|
|
|
if (StringUtils.isBlank(threshold)) { |
|
|
threshold = ""; |
|
|
threshold = ""; |
|
|
} |
|
|
} |
|
|
if ("1".equals(patrolResultRef.getResultType()) && threshold.contains("sub_53")) { |
|
|
if ("1".equals(patrolResultRef.getResultType()) && threshold.contains("sub_53")) { |
|
|
@ -2110,7 +2117,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
|
|
|
|
|
|
String resultType = patrolResultRef.getResultType(); |
|
|
String resultType = patrolResultRef.getResultType(); |
|
|
// log.info("[RESULT] resultType: {}, patrolResultRef: {}", resultType, patrolResultRef); |
|
|
// log.info("[RESULT] resultType: {}, patrolResultRef: {}", resultType, patrolResultRef); |
|
|
if(resultType == null) { |
|
|
|
|
|
|
|
|
if (resultType == null) { |
|
|
continue; |
|
|
continue; |
|
|
} else if (resultType.equals("0")) { |
|
|
} else if (resultType.equals("0")) { |
|
|
reportData.setPointStatus(messageUtils.get("缺陷")); |
|
|
reportData.setPointStatus(messageUtils.get("缺陷")); |
|
|
|