|
|
|
@ -113,6 +113,10 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
|
return patrolResultMapper.selectPatroByAllDev(patrolResult); |
|
|
|
} |
|
|
|
|
|
|
|
public List<PatrolResult> selectPatroByAllDevByMainIds(PatrolResult patrolResult) { |
|
|
|
return patrolResultMapper.selectPatroByAllDevByMainIds(patrolResult); |
|
|
|
} |
|
|
|
|
|
|
|
public List<AlgInfo> selectAlgInfo(PatrolResult patrolResult) { |
|
|
|
return patrolResultMapper.selectAlgInfo(patrolResult); |
|
|
|
} |
|
|
|
@ -288,21 +292,25 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
|
} |
|
|
|
|
|
|
|
@Transactional |
|
|
|
public Long saveReport(PatrolTaskResultMain resultMain, List<PatrolResult> resultList) { |
|
|
|
public Long saveReport(PatrolTaskResultMain resultMain, List<Long> lineIds, Long currentLineId, List<PatrolResult> resultList) { |
|
|
|
long startTime = System.currentTimeMillis(); |
|
|
|
String mainId = String.valueOf(resultMain.getLineId()); |
|
|
|
resultMain.setCheckTime(new Date()); |
|
|
|
resultMain.setFileStatus("1"); |
|
|
|
this.patrolTaskResultMainMapper.updatePatrolTaskResultMain(resultMain); |
|
|
|
this.patrolResultMapper.updatePatrolResultByMainId(mainId); |
|
|
|
// String mainId = String.valueOf(resultMain.getLineId()); |
|
|
|
for (Long lineId : lineIds) { |
|
|
|
resultMain.setLineId(lineId); |
|
|
|
resultMain.setCheckTime(new Date()); |
|
|
|
resultMain.setFileStatus("1"); |
|
|
|
this.patrolTaskResultMainMapper.updatePatrolTaskResultMain(resultMain); |
|
|
|
this.patrolResultMapper.updatePatrolResultByMainId(String.valueOf(lineId)); |
|
|
|
} |
|
|
|
PrintUtil.useTime("AMENDING DATA", startTime); |
|
|
|
return saveReportData(resultList, resultMain); |
|
|
|
resultMain.setLineId(currentLineId); |
|
|
|
return saveReportData(resultList, resultMain, lineIds); |
|
|
|
} |
|
|
|
|
|
|
|
public Long saveReportData(List<PatrolResult> resultList, PatrolTaskResultMain resultMain) { |
|
|
|
public Long saveReportData(List<PatrolResult> resultList, PatrolTaskResultMain resultMain, List<Long> lineIds) { |
|
|
|
long startTime = System.currentTimeMillis(); |
|
|
|
String mainId = String.valueOf(resultMain.getLineId()); |
|
|
|
String analyseNum = statisticsAnalyseNum(mainId, resultList.size()); |
|
|
|
String analyseNum = statisticsAnalyseNum(lineIds, resultList.size()); |
|
|
|
startTime = PrintUtil.useTime("STATISTICS ANALYZE DATA", startTime); |
|
|
|
if (resultList.isEmpty()) { |
|
|
|
throw new ServiceException("LACK INSPECT RESULT: " + mainId); |
|
|
|
@ -350,7 +358,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
|
report.setStationType(stationType); |
|
|
|
inspectionReportMapper.insertInspectionReport(report); |
|
|
|
PrintUtil.useTime("NEW TASK REPORT", startTime); |
|
|
|
batchInsertReportData(String.valueOf(report.getLineId()), mainId); |
|
|
|
batchInsertReportData(String.valueOf(report.getLineId()), lineIds); |
|
|
|
PrintUtil.useTime("BATCH INSERT DETAIL", startTime); |
|
|
|
} |
|
|
|
|
|
|
|
@ -371,13 +379,15 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
|
report.setInspectionEndTime(DateUtil.parseDateTime(taskStatus.getEndTime())); |
|
|
|
} |
|
|
|
|
|
|
|
public void batchInsertReportData(String reportId, String mainId) { |
|
|
|
log.info("batchInsertReportData reportId:" + reportId + ", mainId:" + mainId); |
|
|
|
public void batchInsertReportData(String reportId, List<Long> mainIds) { |
|
|
|
log.info("batchInsertReportData reportId:" + reportId + ", mainIds:" + mainIds); |
|
|
|
long startTime = System.currentTimeMillis(); |
|
|
|
List<PatrolResultRef> patrolResultRefs = patrolResultMapper.selectResultRefByLineId(mainId); |
|
|
|
// List<PatrolResultRef> patrolResultRefs = patrolResultMapper.selectResultRefByLineId(mainId); |
|
|
|
List<PatrolResultRef> patrolResultRefs = patrolResultMapper.selectResultRefByLineIds(mainIds); |
|
|
|
log.info("batchInsertReportData patrolResultRefs:" + patrolResultRefs); |
|
|
|
startTime = PrintUtil.useTime("SELECT RESULT", startTime); |
|
|
|
List<BasePointAreaInfo> basePointAreaInfoList = patrolResultMapper.selectBaseInfoByMainId(mainId); |
|
|
|
// List<BasePointAreaInfo> basePointAreaInfoList = patrolResultMapper.selectBaseInfoByMainId(mainId); |
|
|
|
List<BasePointAreaInfo> basePointAreaInfoList = patrolResultMapper.selectBaseInfoByMainIds(mainIds); |
|
|
|
log.info("batchInsertReportData basePointAreaInfoList:" + basePointAreaInfoList); |
|
|
|
PrintUtil.useTime("AREA INQUERY", startTime); |
|
|
|
log.info("REPORTS SIZE: {}", patrolResultRefs.size()); |
|
|
|
@ -480,11 +490,13 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public String statisticsAnalyseNum(String mainId, int totalNum) { |
|
|
|
public String statisticsAnalyseNum(List<Long> lineIds, int totalNum) { |
|
|
|
int okNum = 0; |
|
|
|
int failNum = 0; |
|
|
|
int confirmNum = 0; |
|
|
|
List<ResultAnalysis> analyses = resultAnalysisMapper.selectResultAnalysisListByMainId(new ResultAnalysis(mainId)); |
|
|
|
// List<ResultAnalysis> analyses = resultAnalysisMapper.selectResultAnalysisListByMainId(new ResultAnalysis(mainId)); |
|
|
|
List<ResultAnalysis> analyses = resultAnalysisMapper.selectResultAnalysisListByMainIds(lineIds); |
|
|
|
log.info("lineIds:{},statisticsAnalyseNum analyses:{}", lineIds, analyses); |
|
|
|
for (ResultAnalysis analyse : analyses) { |
|
|
|
String var9 = analyse.getPointStatus(); |
|
|
|
byte var10 = -1; |
|
|
|
@ -546,6 +558,11 @@ public class PatrolResultServiceImpl implements IPatrolResultService { |
|
|
|
return patrolResultMapper.selectChannelName(channelCode); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<PatrolResult> selectPatrolResultListByMainIds(List<Long> mainIds) { |
|
|
|
return patrolResultMapper.selectPatrolResultListByMainIds(mainIds); |
|
|
|
} |
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
List<String> students = new ArrayList<>(); |
|
|
|
students.add("s1"); |
|
|
|
|