Browse Source

归档大模型报告,初筛报告

master
wangguangyuan 6 months ago
parent
commit
f3f967429d
12 changed files with 178 additions and 73 deletions
  1. +2
    -0
      inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/mapper/ResultAnalysisMapper.java
  2. +4
    -3
      inspect-main/inspect-main-task/src/main/java/com/inspect/insreport/controller/InspectionReportController.java
  3. +11
    -1
      inspect-main/inspect-main-task/src/main/java/com/inspect/message/MessageUtils.java
  4. +2
    -0
      inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/domain/PatrolResultRef.java
  5. +1
    -1
      inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/mapper/PatrolResultMapper.java
  6. +1
    -1
      inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/IPatrolResultService.java
  7. +85
    -36
      inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/impl/PatrolResultServiceImpl.java
  8. +38
    -26
      inspect-main/inspect-main-task/src/main/java/com/inspect/resultmain/controller/PatrolTaskResultMainController.java
  9. +5
    -3
      inspect-main/inspect-main-task/src/main/resources/mapper/task/InspectionReportDataMapper.xml
  10. +4
    -0
      inspect-main/inspect-main-task/src/main/resources/mapper/task/InspectionReportMapper.xml
  11. +12
    -2
      inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolResultMapper.xml
  12. +13
    -0
      inspect-main/inspect-main-task/src/main/resources/mapper/task/ResultAnalysisMapper.xml

+ 2
- 0
inspect-main/inspect-main-task/src/main/java/com/inspect/analysis/mapper/ResultAnalysisMapper.java View File

@ -71,4 +71,6 @@ public interface ResultAnalysisMapper {
int selectResultAnalysisByMainIds(@Param("lineIds") List<Long> lineIds);
List<ResultAnalysis> selectResultAnalysisListByMainIds(@Param("lineIds") List<Long> lineIds);
List<ResultAnalysis> selectResultAnalysisListByMainIdsNew(@Param("lineIds") List<Long> lineIds, @Param("filter") String filter);
}

+ 4
- 3
inspect-main/inspect-main-task/src/main/java/com/inspect/insreport/controller/InspectionReportController.java View File

@ -140,8 +140,8 @@ public class InspectionReportController extends BaseController {
return map;
}
@GetMapping({"/{lineId}"})
public AjaxResult getInfo(@PathVariable("lineId") Long lineId) {
@GetMapping({"/{lineId}/{filter}"})
public AjaxResult getInfo(@PathVariable("lineId") Long lineId, @PathVariable(value = "filter",required = false) String filter) {
Map<String, String> map = getImgMap();
InspectionReport inspectionReport = inspectionReportService.selectInspectionReportByLineId(lineId);
if(inspectionReport == null) {
@ -150,7 +150,8 @@ public class InspectionReportController extends BaseController {
String taskPatrolledId = patrolTaskStatus.getTaskPatrolledId();
inspectionReport = new InspectionReport();
inspectionReport.setTaskPatrolledId(taskPatrolledId);
logger.info("进度条报告查看,taskPatrolledId:{}", taskPatrolledId);
inspectionReport.setFilter(filter);
logger.info("进度条报告查看,filter:{},taskPatrolledId:{}", filter, taskPatrolledId);
List<InspectionReport> inspectionReports = inspectionReportService.selectInspectionReportList(inspectionReport);
if (inspectionReports.size() > 0) {
inspectionReport = inspectionReports.get(0);


+ 11
- 1
inspect-main/inspect-main-task/src/main/java/com/inspect/message/MessageUtils.java View File

@ -195,6 +195,8 @@ public class MessageUtils {
return "noDefects";
case "总点位:%d个,已检点位:%d个,未检点位:0个,正常点位:%d个,异常点位:%d个,待人工确认点位:%d个。":
return "Total points: %d, checked points: %d, unchecked points: 0, normal points: %d, abnormal points: %d, manual confirmation points: %d.";
case "缺陷总数:%d个":
return "Total defects: %d";
case "高清视频":
return "video";
case "空值":
@ -223,8 +225,16 @@ public class MessageUtils {
return "patrol abnormal";
case "识别完成":
return "recognition complete";
case "读数失败 ":
case "读数失败":
return "reading failed";
case "初筛":
return "filter";
case "大模型":
return "AI";
case "汇总":
return "summary";
case "缺陷":
return "defect";
default:
return key;
}


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

@ -19,6 +19,8 @@ public class PatrolResultRef {
private String filePath;
private String description;
private String pointStatus;
private String resultType;
private String valueUnit;
private String resultContent;
private String resStatus;


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

@ -106,7 +106,7 @@ public interface PatrolResultMapper {
List<PatrolResult> selectPatrolResultListByMainIds(@Param("mainIds") List<Long> mainIds);
List<PatrolResultRef> selectResultRefByLineIds(@Param("mainIds") List<Long> mainIds);
List<PatrolResultRef> selectResultRefByLineIds(@Param("mainIds") List<Long> mainIds, @Param("filter") String filter);
List<BasePointAreaInfo> selectBaseInfoByMainIds(@Param("mainIds") List<Long> mainIds);


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

@ -79,7 +79,7 @@ public interface IPatrolResultService {
List<ResultValue> select6FsResultValue(PatrolResult patrolResult);
Long saveReport(PatrolTaskResultMain resultMain, List<Long> lineIds, Long currentLineId, List<PatrolResult> resultList);
List<Long> saveReport(PatrolTaskResultMain resultMain, List<Long> lineIds, Long currentLineId, List<PatrolResult> resultList);
List saveReportV2(PatrolTaskResultMain patrolTaskResultMain, List<PatrolResult> patrolResultList);


+ 85
- 36
inspect-main/inspect-main-task/src/main/java/com/inspect/partrolresult/service/impl/PatrolResultServiceImpl.java View File

@ -305,7 +305,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService {
}
@Transactional
public 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) {
long startTime = System.currentTimeMillis();
// String mainId = String.valueOf(resultMain.getLineId());
for (Long lineId : lineIds) {
@ -333,10 +333,13 @@ public class PatrolResultServiceImpl implements IPatrolResultService {
return reportIds;
}
public Long saveReportData(List<PatrolResult> resultList, PatrolTaskResultMain resultMain, List<Long> lineIds) {
public List<Long> saveReportData(List<PatrolResult> resultList, PatrolTaskResultMain resultMain, List<Long> lineIds) {
long startTime = System.currentTimeMillis();
String mainId = String.valueOf(resultMain.getLineId());
String analyseNum = statisticsAnalyseNum(lineIds, resultList.size());
// String analyseNum = statisticsAnalyseNum(lineIds, resultList.size());
String filterNum = statisticsAnalyseNumV3(lineIds, "1");
String AiNum = statisticsAnalyseNumV3(lineIds, "0");
String[] nums = new String[]{AiNum, filterNum};
startTime = PrintUtil.useTime("STATISTICS ANALYZE DATA", startTime);
if (resultList.isEmpty()) {
throw new ServiceException("LACK INSPECT RESULT: " + mainId);
@ -358,21 +361,23 @@ public class PatrolResultServiceImpl implements IPatrolResultService {
if (list.isEmpty()) {
throw new ServiceException("TASK PLAN LOST: " + taskCode);
} else {
List<Long> reportIds = new ArrayList<>();
PatrolTask task = list.get(0);
List<InspectionReport> reports = inspectionReportMapper.selectInspectionReportList(new InspectionReport(mainId));
startTime = PrintUtil.useTime("INQUIRY TASK REPORT", startTime);
InspectionReport report;
if (!reports.isEmpty()) {
report = reports.get(0);
resetReport(report, analyseNum, mainId, task, taskStatus);
inspectionReportMapper.updateInspectionReport(report);
PrintUtil.useTime("MODIFY TASK REPORT", startTime);
} else {
Map<String, String> stationMap = patrolResultMapper.selectBasedataStation();
String stationName = stationMap.get("station_name");
String stationType = stationMap.get("station_type");
report = new InspectionReport();
resetReport(report, analyseNum, mainId, task, taskStatus);
// List<InspectionReport> reports = inspectionReportMapper.selectInspectionReportList(new InspectionReport(mainId));
// startTime = PrintUtil.useTime("INQUIRY TASK REPORT", startTime);
// InspectionReport report;
// if (!reports.isEmpty()) {
// report = reports.get(0);
// resetReport(report, analyseNum, mainId, task, taskStatus);
// inspectionReportMapper.updateInspectionReport(report);
// PrintUtil.useTime("MODIFY TASK REPORT", startTime);
// } else {
Map<String, String> stationMap = patrolResultMapper.selectBasedataStation();
String stationName = stationMap.get("station_name");
String stationType = stationMap.get("station_type");
for (int i = 0; i < nums.length; i++) {
InspectionReport report = new InspectionReport();
resetReport(report, nums[i], mainId, task, taskStatus);
report.setTaskId(String.valueOf(task.getTaskId()));
report.setTaskPatrolledId(taskPatrolId);
report.setInspectionTaskName(task.getTaskName());
@ -381,15 +386,18 @@ public class PatrolResultServiceImpl implements IPatrolResultService {
report.setCheckTime(resultMain.getCheckTime());
report.setStationName(stationName);
report.setVoltLevel(voltage);
report.setFilter(String.valueOf(i));
report.setStationType(stationType);
inspectionReportMapper.insertInspectionReport(report);
PrintUtil.useTime("NEW TASK REPORT", startTime);
batchInsertReportData(String.valueOf(report.getLineId()), lineIds);
batchInsertReportData(String.valueOf(report.getLineId()), lineIds, String.valueOf(i));
PrintUtil.useTime("BATCH INSERT DETAIL", startTime);
log.info("[ARCHIVE] reportId: {}", report.getLineId());
Long lineId = report.getLineId();
reportIds.add(lineId);
}
log.info("[ARCHIVE] reportId: {}", report.getLineId());
return report.getLineId();
// }
return reportIds;
}
}
}
@ -495,11 +503,11 @@ public class PatrolResultServiceImpl implements IPatrolResultService {
report.setInspectionEndTime(DateUtil.parseDateTime(taskStatus.getEndTime()));
}
public void batchInsertReportData(String reportId, List<Long> mainIds) {
log.info("batchInsertReportData reportId:" + reportId + ", mainIds:" + mainIds);
public void batchInsertReportData(String reportId, List<Long> mainIds, String filter) {
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);
List<PatrolResultRef> patrolResultRefs = patrolResultMapper.selectResultRefByLineIds(mainIds, filter);
log.info("batchInsertReportData patrolResultRefs:" + patrolResultRefs);
startTime = PrintUtil.useTime("SELECT RESULT", startTime);
// List<BasePointAreaInfo> basePointAreaInfoList = patrolResultMapper.selectBaseInfoByMainId(mainId);
@ -535,6 +543,7 @@ public class PatrolResultServiceImpl implements IPatrolResultService {
reportData.setDataSources("0".equals(devType) ? messageUtils.get("无人机") : "1".equals(devType) ? messageUtils.get("机器人") : messageUtils.get("高清视频"));
reportData.setAcquisitionTime(DateUtils.parse(DateUtils.yyyyMMddHHmmss2, patrolResultRef.getTime()));
reportData.setInspectionResults(patrolResultRef.getDescription());
reportData.setAlgName(patrolResultRef.getAlgName());
String threshold = patrolResultRef.getThreshold();
if(StringUtils.isBlank(threshold)) {
threshold = "";
@ -552,21 +561,31 @@ public class PatrolResultServiceImpl implements IPatrolResultService {
}
String pointStatus = patrolResultRef.getPointStatus();
log.info("[RESULT] pointStatus: {}, patrolResultRef: {}", pointStatus, patrolResultRef);
if(pointStatus == null) {
String resultType = patrolResultRef.getResultType();
// log.info("[RESULT] pointStatus: {}, patrolResultRef: {}", pointStatus, patrolResultRef);
// if(pointStatus == null) {
// continue;
// } else if (pointStatus.equals("0")) {
// reportData.setPointStatus(messageUtils.get("异常"));
// reportData.setCode(failNum);
// ++failNum;
// } else if (pointStatus.equals("1")) {
// reportData.setPointStatus(messageUtils.get("待人工确认"));
// reportData.setCode(confirmNum);
// ++confirmNum;
// } else {
// reportData.setPointStatus(messageUtils.get("正常"));
// reportData.setCode(okNum);
// ++okNum;
// }
log.info("[RESULT] resultType: {}, patrolResultRef: {}", resultType, patrolResultRef);
if(resultType == null) {
continue;
} else if (pointStatus.equals("0")) {
reportData.setPointStatus(messageUtils.get("异常"));
} else if (resultType.equals("0")) {
reportData.setPointStatus(messageUtils.get("缺陷"));
// 缺陷编号
reportData.setCode(failNum);
++failNum;
} else if (pointStatus.equals("1")) {
reportData.setPointStatus(messageUtils.get("待人工确认"));
reportData.setCode(confirmNum);
++confirmNum;
} else {
reportData.setPointStatus(messageUtils.get("正常"));
reportData.setCode(okNum);
++okNum;
}
final String reportDataId = reportId + "_" + (100000 + index);
@ -772,6 +791,36 @@ public class PatrolResultServiceImpl implements IPatrolResultService {
return String.format(messageUtils.get("总点位:%d个,已检点位:%d个,未检点位:0个,正常点位:%d个,异常点位:%d个,待人工确认点位:%d个。"), totalNum, totalNum, okNum, failNum, confirmNum);
}
public String statisticsAnalyseNumV3(List<Long> lineIds, String filter) {
// int okNum = 0;
// int failNum = 0;
// int confirmNum = 0;
List<ResultAnalysis> analyses = resultAnalysisMapper.selectResultAnalysisListByMainIdsNew(lineIds, filter);
int totalNum = analyses.size();
log.info("lineIds:{},statisticsAnalyseNum analyses:{}", lineIds, analyses);
// for (ResultAnalysis analyse : analyses) {
// String pointStatus = analyse.getPointStatus();
// if (pointStatus.equals("0")) {
// ++failNum;
// } else if (pointStatus.equals("1")) {
// ++okNum;
// } else if (pointStatus.equals("2")) {
// ++confirmNum;
// } else {
// log.error("【归档-统计分析数量】异常分析类型:{}", analyse.getPointStatus());
// }
// }
//
// int lastNum = totalNum - failNum - confirmNum;
// if (lastNum != okNum) {
// okNum = lastNum;
// }
// return String.format("总点位:%d个,已检点位:%d个,未检点位:0个,正常点位:%d个,异常点位:%d个,待人工确认点位:%d个。", totalNum, totalNum, okNum, failNum, confirmNum);
// return String.format(messageUtils.get("总点位:%d个,已检点位:%d个,未检点位:0个,正常点位:%d个,异常点位:%d个,待人工确认点位:%d个。"), totalNum, totalNum, okNum, failNum, confirmNum);
return String.format(messageUtils.get("缺陷总数:%d个"), totalNum);
}
public String statisticsAnalyseNumV2(String mainId, String filter) {
int okNum = 0;
int failNum = 0;


+ 38
- 26
inspect-main/inspect-main-task/src/main/java/com/inspect/resultmain/controller/PatrolTaskResultMainController.java View File

@ -212,17 +212,19 @@ public class PatrolTaskResultMainController extends BaseController {
analyseNum = resultAnalysisService.selectResultAnalysisByMainIds(lineIds);
startTime = PrintUtil.useTime("INQUIRY ANALYZE DATA", startTime);
logger.info("[ARCHIVE] Id: {}, collectNum: {}, analyseNum: {}, modifyNum:{}", mainId, collectNum, analyseNum, modifyNum.get());
if (modifyNum.get() + analyseNum != collectNum) {
final String failMsg = "-------------------------------------[ARCHIVE] FAIL! Analyse number equals not gather number!";
logger.info(failMsg);
}
// if (modifyNum.get() + analyseNum != collectNum) {
// final String failMsg = "-------------------------------------[ARCHIVE] FAIL! Analyse number equals not gather number!";
// logger.info(failMsg);
// }
Long reportId = patrolResultService.saveReport(resultMain, lineIds, lineId, resultList);
List<Long> reportIds = patrolResultService.saveReport(resultMain, lineIds, lineId, resultList);
PrintUtil.useTime("ARCHIVE END", startTime);
(new Thread(() -> {
long beginTime = (new Date()).getTime();
logger.info("[EXPORT REPORTS] StartTime: {}, reportId: {}", DateUtil.now(), reportId);
exportExcelWordAndZip(String.valueOf(reportId));
for (int i = 0; i < reportIds.size(); ++i) {
logger.info("[EXPORT REPORTS] StartTime: {}, reportId: {}", DateUtil.now(), reportIds.get(i));
exportExcelWordAndZip(String.valueOf(reportIds.get(i)));
}
PrintUtil.useTime("EXPORT REPORTS END", beginTime);
})).start();
return toAjax(1);
@ -329,7 +331,8 @@ public class PatrolTaskResultMainController extends BaseController {
// 点位汇总
List<String> statusList = Arrays.asList(MessageUtils.get("异常"), MessageUtils.get("待人工确认"), MessageUtils.get("正常"));
// List<String> statusList = Arrays.asList(MessageUtils.get("异常"), MessageUtils.get("待人工确认"), MessageUtils.get("正常"));
List<String> statusList = Collections.singletonList(MessageUtils.get("缺陷"));
for (String status : statusList) {
addStatusSection(doc, report, status, images);
}
@ -495,7 +498,8 @@ public class PatrolTaskResultMainController extends BaseController {
private void addStatusSection(XWPFDocument doc, InspectionReport report,
String status, Map<String, byte[]> images) {
addSectionHeader(doc, status + MessageUtils.get("点位汇总"));
// addSectionHeader(doc, status + MessageUtils.get("点位汇总"));
addSectionHeader(doc, status + MessageUtils.get("汇总"));
XWPFTable table = doc.createTable(1, 9);
table.setWidth("100%");
@ -503,7 +507,7 @@ public class PatrolTaskResultMainController extends BaseController {
// 创建表头
String[] headers = {MessageUtils.get("编号"), MessageUtils.get("区域"), MessageUtils.get("设备"), MessageUtils.get("点位"), MessageUtils.get("数据来源"),
MessageUtils.get("采集时间"), MessageUtils.get("巡视结果"), MessageUtils.get("点位状态"), MessageUtils.get("巡视图像")};
MessageUtils.get("采集时间"), MessageUtils.get("巡视结果"), MessageUtils.get("算法名称"), MessageUtils.get("巡视图像")};
XWPFTableRow headerRow = table.getRow(0);
for (int i = 0; i < headers.length; i++) {
XWPFTableCell cell = headerRow.getCell(i);
@ -513,9 +517,7 @@ public class PatrolTaskResultMainController extends BaseController {
}
setTableHeaderStyle(table);
// 填充数据
List<InspectionReportData> dataList = report.getReportDatalist().stream()
.filter(d -> status.equals(d.getPointStatus()))
.collect(Collectors.toList());
List<InspectionReportData> dataList = report.getReportDatalist();
for (InspectionReportData data : dataList) {
XWPFTableRow row = table.createRow();
@ -595,7 +597,7 @@ public class PatrolTaskResultMainController extends BaseController {
data.getDataSources(),
formatDateTime(data.getAcquisitionTime()),
data.getInspectionResults(),
data.getPointStatus(),
data.getAlgName(),
"" // 图片占位
};
@ -795,7 +797,13 @@ public class PatrolTaskResultMainController extends BaseController {
Date startTime = inspectionReport.getInspectionStartTime() != null ?
inspectionReport.getInspectionStartTime() : new Date();
String timestamp = DateUtils.format(DateUtils.yyyyMMddHHmmss2, startTime) + "_" + System.currentTimeMillis();
String reportName = inspectionReport.getInspectionTaskName() + "_" + timestamp;
String namePrefix = "";
if ("1".equals(inspectionReport.getFilter())) {
namePrefix = MessageUtils.get("初筛") + "_";
} else if ("0".equals(inspectionReport.getFilter())) {
namePrefix = MessageUtils.get("大模型") + "_";
}
String reportName = namePrefix + inspectionReport.getInspectionTaskName() + "_" + timestamp;
// 上传媒体包
uploadFile(basePath, reportName, ".zip", outputStream -> {
try (ZipOutputStream zipOut = new ZipOutputStream(outputStream)) {
@ -1072,16 +1080,20 @@ public class PatrolTaskResultMainController extends BaseController {
}
}
// InspectionReportData inspectionReportData = new InspectionReportData();
// List<InspectionReportData> list = new ArrayList<>();
// inspectionReportData.setPointStatus(MessageUtils.get("异常"));
// list.add(inspectionReportData);
// InspectionReportData inspection = new InspectionReportData();
// inspection.setPointStatus(MessageUtils.get("待人工确认"));
// list.add(inspection);
// InspectionReportData reportData = new InspectionReportData();
// reportData.setPointStatus(MessageUtils.get("正常"));
// list.add(reportData);
InspectionReportData inspectionReportData = new InspectionReportData();
List<InspectionReportData> list = new ArrayList<>();
inspectionReportData.setPointStatus(MessageUtils.get("异常"));
inspectionReportData.setPointStatus(MessageUtils.get("缺陷"));
list.add(inspectionReportData);
InspectionReportData inspection = new InspectionReportData();
inspection.setPointStatus(MessageUtils.get("待人工确认"));
list.add(inspection);
InspectionReportData reportData = new InspectionReportData();
reportData.setPointStatus(MessageUtils.get("正常"));
list.add(reportData);
int total = 0;
HSSFPatriarch patriarch = hssfSheet.createDrawingPatriarch();
@ -1092,7 +1104,7 @@ public class PatrolTaskResultMainController extends BaseController {
hssfSheet.addMergedRegion(cellRangeAddress);
HSSFRow rowa1 = hssfSheet.createRow(9 + total);
HSSFCell cella1 = rowa1.createCell(0);
cella1.setCellValue(arr.getPointStatus() + MessageUtils.get("点位汇总"));
cella1.setCellValue(arr.getPointStatus() + MessageUtils.get("汇总"));
HSSFCellStyle hssfCellStyle1 = hssfWorkbook.createCellStyle();
hssfCellStyle1.setAlignment(HorizontalAlignment.CENTER);
hssfCellStyle1.setVerticalAlignment(VerticalAlignment.CENTER);
@ -1145,7 +1157,7 @@ public class PatrolTaskResultMainController extends BaseController {
cella1 = rowa1.createCell(10);
cella1.setCellStyle(colStyle);
cella1 = rowa1.createCell(11);
cella1.setCellValue(MessageUtils.get("点位状态"));
cella1.setCellValue(MessageUtils.get("算法类型"));
cella1.setCellStyle(colStyle2);
cella1 = rowa1.createCell(12);
cella1.setCellValue(MessageUtils.get("巡视图像"));
@ -1159,7 +1171,7 @@ public class PatrolTaskResultMainController extends BaseController {
reportData1.setPointStatus(arr.getPointStatus());
List objectArrayList = new ArrayList<>();
if (inspectionReport.getReportDatalist() != null && !inspectionReport.getReportDatalist().isEmpty()) {
objectArrayList = inspectionReport.getReportDatalist().stream().filter((a) -> arr.getPointStatus().equals(a.getPointStatus())).collect(Collectors.toList());
objectArrayList = inspectionReport.getReportDatalist();
logger.info("[HSSF] STATISTICS RECORD Number: {}, Origin Number: {}", objectArrayList.size(), inspectionReport.getReportDatalist().size());
}
@ -1221,7 +1233,7 @@ public class PatrolTaskResultMainController extends BaseController {
cella1 = rowb1.createCell(10);
cella1.setCellStyle(colStyle);
cella1 = rowb1.createCell(11);
cella1.setCellValue(brr.getPointStatus());
cella1.setCellValue(brr.getAlgName());
cella1.setCellStyle(colStyle2);
String str = "";
cella1 = rowb1.createCell(12);


+ 5
- 3
inspect-main/inspect-main-task/src/main/resources/mapper/task/InspectionReportDataMapper.xml View File

@ -18,6 +18,7 @@
<result property="pointStatus" column="point_status"/>
<result property="inspectionImg" column="inspection_img"/>
<result property="reportId" column="report_id"/>
<result property="algName" column="alg_name"/>
</resultMap>
<sql id="selectInspectionReportDataVo">
@ -33,7 +34,8 @@
acquisition_time,
inspection_results,
point_status,
inspection_img
inspection_img,
alg_name
from inspection_report_data
</sql>
@ -151,11 +153,11 @@
</delete>
<insert id="batchInsertInspectionReportData" parameterType="java.util.List">
insert into inspection_report_data
(line_id,code,report_id,area,time_interval,eq_name,parts,point_name,data_sources,acquisition_time,inspection_results,point_status,inspection_img)
(line_id,code,report_id,area,time_interval,eq_name,parts,point_name,data_sources,acquisition_time,inspection_results,point_status,inspection_img,alg_name)
values
<foreach collection="list" item="t" index="index" separator=",">
(#{t.lineId}, #{t.code}, #{t.reportId}, #{t.area}, #{t.timeInterval}, #{t.eqName}, #{t.parts},
#{t.pointName},#{t.dataSources},#{t.acquisitionTime},#{t.inspectionResults},#{t.pointStatus},#{t.inspectionImg})
#{t.pointName},#{t.dataSources},#{t.acquisitionTime},#{t.inspectionResults},#{t.pointStatus},#{t.inspectionImg},#{t.algName})
</foreach>
</insert>
</mapper>

+ 4
- 0
inspect-main/inspect-main-task/src/main/resources/mapper/task/InspectionReportMapper.xml View File

@ -22,6 +22,7 @@
<result property="taskPatrolledId" column="task_patrolled_id"/>
<result property="taskResultId" column="task_result_id"/>
<result property="filePath" column="file_path"/>
<result property="filter" column="filter"/>
</resultMap>
<sql id="selectInspectionReportVo">
@ -71,6 +72,7 @@
<if test="taskPatrolledId != null and taskPatrolledId != ''">and task_patrolled_id = #{taskPatrolledId}
</if>
<if test="filePath != null and filePath != ''">and file_path = #{filePath}</if>
<if test="filter != null and filter != ''">and filter = #{filter}</if>
</where>
ORDER BY line_id desc
</select>
@ -123,6 +125,7 @@
<if test="taskPatrolledId != null">task_patrolled_id,</if>
<if test="taskResultId != null">task_result_id,</if>
<if test="filePath != null">file_path,</if>
<if test="filter != null">filter,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="stationName != null">#{stationName},</if>
@ -141,6 +144,7 @@
<if test="taskPatrolledId != null">#{taskPatrolledId},</if>
<if test="taskResultId != null">#{taskResultId},</if>
<if test="filePath != null">#{filePath},</if>
<if test="filter != null">#{filter},</if>
</trim>
</insert>


+ 12
- 2
inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolResultMapper.xml View File

@ -585,6 +585,9 @@
<result property="pointStatus" column="point_status"/>
<result property="valueUnit" column="value_unit"/>
<result property="resultContent" column="result_content"/>
<result property="resultType" column="result_type"/>
<result property="algType" column="alg_type"/>
<result property="algName" column="alg_name"/>
</resultMap>
<select id="selectResultRefByLineId" parameterType="String" resultMap="PatrolResultRef">
select a.line_id,
@ -616,17 +619,24 @@
a.file_path,
b.description,
b.point_status,
b.result_type,
a.value_unit,
b.result_content
b.result_content,
b.alg_type,
d.alg_subtype_name as alg_name
from patrol_result a
left join result_analysis b on a.line_id = b.business_id
left join basedata_alg_subtype d on b.alg_type = d.alg_subtype_code
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 a.main_id in
where
b.result_type = '0' and
a.main_id in
<foreach collection="mainIds" item="item" index="index" open="(" separator="," close=")">
#{item}
</foreach>
<if test="filter != null ">and b.filter = #{filter}</if>
</select>
<select id="selectBaseInfoByPointId" parameterType="String" resultType="java.util.Map">
select a.patrol_point_name, b.device_name, c.device_name as main_name, d.area_name as jg_name, e.area_name


+ 13
- 0
inspect-main/inspect-main-task/src/main/resources/mapper/task/ResultAnalysisMapper.xml View File

@ -141,6 +141,19 @@
<if test="filter != null ">and b.filter = #{filter}</if>
</select>
<select id="selectResultAnalysisListByMainIdsNew" resultMap="ResultAnalysisResult">
select b.business_id, b.point_status, b.res_status, b.alg_type
from patrol_result a
left join result_analysis b on a.line_id = b.business_id
where a.main_id in
<foreach item="item" index="index" collection="lineIds" open="(" separator="," close=")">
#{item}
</foreach>
and b.business_id is not null
and b.result_type = '0'
<if test="filter != null ">and b.filter = #{filter}</if>
</select>
<select id="selectResultAnalysisListByMainIds" resultMap="ResultAnalysisResult">
select b.business_id, b.point_status
from patrol_result a


Loading…
Cancel
Save