|
|
|
@ -322,7 +322,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
|
} |
|
|
|
|
|
|
|
@Transactional |
|
|
|
public List<Long> saveReport(PatrolTaskResultMain resultMain, List<Long> lineIds, Long currentLineId, List<PatrolResult> resultList) { |
|
|
|
public List<Long> saveReport(PatrolTaskResultMain resultMain, List<Long> lineIds, Long currentLineId, List<PatrolResult> resultList, int aiQxNum, int csQxNum) { |
|
|
|
long startTime = System.currentTimeMillis(); |
|
|
|
// String mainId = String.valueOf(resultMain.getLineId()); |
|
|
|
for (Long lineId : lineIds) { |
|
|
|
@ -334,7 +334,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
|
} |
|
|
|
PrintUtil.useTime("AMENDING DATA", startTime); |
|
|
|
resultMain.setLineId(currentLineId); |
|
|
|
return saveReportData(resultList, resultMain, lineIds); |
|
|
|
return saveReportData(resultList, resultMain, lineIds, aiQxNum, csQxNum); |
|
|
|
} |
|
|
|
|
|
|
|
@Transactional |
|
|
|
@ -350,7 +350,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
|
return reportIds; |
|
|
|
} |
|
|
|
|
|
|
|
public List<Long> saveReportData(List<PatrolResult> resultList, PatrolTaskResultMain resultMain, List<Long> lineIds) { |
|
|
|
public List<Long> saveReportData(List<PatrolResult> resultList, PatrolTaskResultMain resultMain, List<Long> lineIds, int aiQxNum, int csQxNum) { |
|
|
|
long startTime = System.currentTimeMillis(); |
|
|
|
String mainId = String.valueOf(resultMain.getLineId()); |
|
|
|
// String analyseNum = statisticsAnalyseNum(lineIds, resultList.size()); |
|
|
|
@ -394,6 +394,16 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
|
String stationType = stationMap.get("station_type"); |
|
|
|
String voltLevel = stationMap.get("volt_level"); |
|
|
|
for (int i = 0; i < nums.length; i++) { |
|
|
|
if ("0".equals(exportReportFlag) && i == 0 && aiQxNum == 0) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
if ("0".equals(exportReportFlag) && i == 1 && csQxNum == 0) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
List<PatrolResultRef> patrolResultRefs = patrolResultMapper.selectResultRefByLineIds(lineIds, String.valueOf(i)); |
|
|
|
if (patrolResultRefs.isEmpty()) { |
|
|
|
continue; |
|
|
|
} |
|
|
|
InspectionReport report = new InspectionReport(); |
|
|
|
resetReport(report, nums[i], mainId, task, taskStatus); |
|
|
|
report.setTaskId(String.valueOf(task.getTaskId())); |
|
|
|
@ -408,7 +418,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
|
report.setStationType(stationType); |
|
|
|
inspectionReportMapper.insertInspectionReport(report); |
|
|
|
PrintUtil.useTime("NEW TASK REPORT", startTime); |
|
|
|
batchInsertReportData(String.valueOf(report.getLineId()), lineIds, String.valueOf(i)); |
|
|
|
batchInsertReportData(String.valueOf(report.getLineId()), lineIds, String.valueOf(i), patrolResultRefs); |
|
|
|
PrintUtil.useTime("BATCH INSERT DETAIL", startTime); |
|
|
|
log.info("[ARCHIVE] reportId: {}", report.getLineId()); |
|
|
|
Long lineId = report.getLineId(); |
|
|
|
@ -521,11 +531,11 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
|
report.setInspectionEndTime(DateUtil.parseDateTime(taskStatus.getEndTime())); |
|
|
|
} |
|
|
|
|
|
|
|
public void batchInsertReportData(String reportId, List<Long> mainIds, String filter) { |
|
|
|
public void batchInsertReportData(String reportId, List<Long> mainIds, String filter, List<PatrolResultRef> patrolResultRefs) { |
|
|
|
log.info("batchInsertReportData reportId:" + reportId + ", mainIds:" + mainIds + ", filter:" + filter); |
|
|
|
long startTime = System.currentTimeMillis(); |
|
|
|
// List<PatrolResultRef> patrolResultRefs = patrolResultMapper.selectResultRefByLineId(mainId); |
|
|
|
List<PatrolResultRef> patrolResultRefs = patrolResultMapper.selectResultRefByLineIds(mainIds, filter); |
|
|
|
// List<PatrolResultRef> patrolResultRefs = patrolResultMapper.selectResultRefByLineIds(mainIds, filter); |
|
|
|
if ("0".equals(exportReportFlag)) { |
|
|
|
// 导出缺陷 |
|
|
|
patrolResultRefs = patrolResultRefs.stream().filter((item) -> "0".equals(item.getResultType())).collect(Collectors.toList()); |
|
|
|
|