|
@@ -8,8 +8,10 @@ import org.apache.poi.ss.util.CellRangeAddress;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
import org.apache.shiro.SecurityUtils;
|
|
|
import org.jeecg.common.system.vo.LoginUser;
|
|
|
+import org.jeecg.modules.base.entity.InterlockBase;
|
|
|
import org.jeecg.modules.base.mapper.InterlockBaseMapper;
|
|
|
import org.jeecg.modules.detail.dto.InterlockDetailQueryDTO;
|
|
|
+import org.jeecg.modules.detail.vo.InterlockDetailQueryVO;
|
|
|
import org.jeecg.modules.history.convert.InterlockSummaryHistoryConvert;
|
|
|
import org.jeecg.modules.history.dto.InterlockHistoryQueryDTO;
|
|
|
import org.jeecg.modules.history.entity.InterlockDetailHistory;
|
|
@@ -19,21 +21,25 @@ import org.jeecg.modules.history.service.IInterlockDetailHistoryService;
|
|
|
import org.jeecg.modules.history.vo.InterlockDetailHistoryQueryVO;
|
|
|
import org.jeecg.modules.history.vo.InterlockHistoryDistinctZZXTVO;
|
|
|
import org.jeecg.modules.history.vo.InterlockSummaryHistoryVO;
|
|
|
+import org.jeecg.modules.summary.vo.InterlockSummaryVO;
|
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.http.HttpHeaders;
|
|
|
+import org.springframework.http.HttpStatus;
|
|
|
+import org.springframework.http.MediaType;
|
|
|
+import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
|
|
-import java.io.FileOutputStream;
|
|
|
-import java.io.IOException;
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.io.*;
|
|
|
+import java.net.URLEncoder;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -62,13 +68,15 @@ public class InterlockDetailHistoryServiceImpl extends ServiceImpl<InterlockDeta
|
|
|
* 联锁历史数据详细信息-分页查询
|
|
|
*/
|
|
|
public IPage<InterlockDetailHistoryQueryVO> getPage2(Page<InterlockDetailHistoryQueryVO> page, InterlockDetailQueryDTO dto){
|
|
|
- return interlockDetailHistoryMapper.getPage2(page, dto);
|
|
|
+ IPage<InterlockDetailHistoryQueryVO> voiPage = interlockDetailHistoryMapper.getPage2(page, dto);
|
|
|
+ return zhDetailHistoryQueryVOIPage(voiPage,dto.getInterlockSystemId());
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 联锁历史数据——各种逻辑状态分页查询
|
|
|
*/
|
|
|
public IPage<InterlockSummaryHistoryVO> getPage(Page<InterlockSummaryHistoryVO> page, InterlockHistoryQueryDTO dto){
|
|
|
+// IPage<InterlockSummaryHistoryVO> voiPage = interlockDetailHistoryMapper.getPage(page, dto);
|
|
|
return interlockDetailHistoryMapper.getPage(page, dto);
|
|
|
}
|
|
|
|
|
@@ -149,27 +157,72 @@ public class InterlockDetailHistoryServiceImpl extends ServiceImpl<InterlockDeta
|
|
|
/**
|
|
|
* 导定时任务导出excel
|
|
|
*/
|
|
|
- public Integer exportXlsToFile(InterlockHistoryQueryDTO dto, Class<InterlockSummaryHistoryVO> clazz, String title, String filePath) throws IOException {
|
|
|
+ public Workbook exportXlsToFile(InterlockHistoryQueryDTO dto, List<InterlockHistoryDistinctZZXTVO> zzxtvoList, Class<InterlockSummaryHistoryVO> clazz, String title) throws IOException {
|
|
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
String formattedBeginTime = dto.getBeginTime() != null ? sdf.format(dto.getBeginTime()) : "";
|
|
|
String formattedEndTime = dto.getEndTime() != null ? sdf.format(dto.getEndTime()) : "";
|
|
|
|
|
|
- List<InterlockHistoryDistinctZZXTVO> zzxtvoList = summaryHistoryMapper.getDistinctZZXTSummaryList(dto);
|
|
|
+ Workbook workbook = new XSSFWorkbook();
|
|
|
|
|
|
- if(zzxtvoList == null || zzxtvoList.size()==0) return 0;
|
|
|
+ // 创建字体对象
|
|
|
+ Font font = workbook.createFont();
|
|
|
+ font.setBold(true); // 设置字体加粗
|
|
|
+
|
|
|
+ // 创建第一行的样式
|
|
|
+ CellStyle firstStyle = workbook.createCellStyle();
|
|
|
+ firstStyle.setAlignment(HorizontalAlignment.CENTER);
|
|
|
+ firstStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
|
|
+ // 设置背景颜色为灰色
|
|
|
+ firstStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
|
|
|
+ firstStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND);
|
|
|
+ // 设置字体
|
|
|
+ firstStyle.setFont(font);
|
|
|
|
|
|
- Workbook workbook = new XSSFWorkbook();
|
|
|
|
|
|
- // 创建居中对齐的样式
|
|
|
+ // 创建居中对齐-加边框-字体加粗的样式
|
|
|
CellStyle centerAlignStyle = workbook.createCellStyle();
|
|
|
centerAlignStyle.setAlignment(HorizontalAlignment.CENTER);
|
|
|
centerAlignStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
|
|
-
|
|
|
- // 创建居右对齐的样式
|
|
|
- CellStyle rightAlignStyle = workbook.createCellStyle();
|
|
|
- rightAlignStyle.setAlignment(HorizontalAlignment.RIGHT);
|
|
|
- rightAlignStyle.setVerticalAlignment(VerticalAlignment.CENTER);
|
|
|
+ // 设置边框
|
|
|
+ centerAlignStyle.setBorderTop(BorderStyle.THIN);
|
|
|
+ centerAlignStyle.setBorderBottom(BorderStyle.THIN);
|
|
|
+ centerAlignStyle.setBorderLeft(BorderStyle.THIN);
|
|
|
+ centerAlignStyle.setBorderRight(BorderStyle.THIN);
|
|
|
+ // 设置边框颜色(使用IndexedColors枚举)
|
|
|
+ centerAlignStyle.setTopBorderColor(IndexedColors.BLACK.getIndex());
|
|
|
+ centerAlignStyle.setBottomBorderColor(IndexedColors.BLACK.getIndex());
|
|
|
+ centerAlignStyle.setLeftBorderColor(IndexedColors.BLACK.getIndex());
|
|
|
+ centerAlignStyle.setRightBorderColor(IndexedColors.BLACK.getIndex());
|
|
|
+ // 设置字体
|
|
|
+ centerAlignStyle.setFont(font);
|
|
|
+
|
|
|
+ // 创建居中对齐-不加边框-字体加粗的样式
|
|
|
+ CellStyle centerAlignStyle1 = workbook.createCellStyle();
|
|
|
+ centerAlignStyle1.setAlignment(HorizontalAlignment.CENTER);
|
|
|
+ centerAlignStyle1.setVerticalAlignment(VerticalAlignment.CENTER);
|
|
|
+ // 设置字体
|
|
|
+ centerAlignStyle1.setFont(font);
|
|
|
+
|
|
|
+ // 创建居中对齐-不加边框-字体不加粗的样式
|
|
|
+ CellStyle centerAlignStyle2 = workbook.createCellStyle();
|
|
|
+ centerAlignStyle2.setAlignment(HorizontalAlignment.CENTER);
|
|
|
+ centerAlignStyle2.setVerticalAlignment(VerticalAlignment.CENTER);
|
|
|
+
|
|
|
+ // 创建居中对齐-加边框-字体不加粗的样式
|
|
|
+ CellStyle centerAlignStyle3 = workbook.createCellStyle();
|
|
|
+ centerAlignStyle3.setAlignment(HorizontalAlignment.CENTER);
|
|
|
+ centerAlignStyle3.setVerticalAlignment(VerticalAlignment.CENTER);
|
|
|
+ // 设置边框
|
|
|
+ centerAlignStyle3.setBorderTop(BorderStyle.THIN);
|
|
|
+ centerAlignStyle3.setBorderBottom(BorderStyle.THIN);
|
|
|
+ centerAlignStyle3.setBorderLeft(BorderStyle.THIN);
|
|
|
+ centerAlignStyle3.setBorderRight(BorderStyle.THIN);
|
|
|
+ // 设置边框颜色(使用IndexedColors枚举)
|
|
|
+ centerAlignStyle3.setTopBorderColor(IndexedColors.BLACK.getIndex());
|
|
|
+ centerAlignStyle3.setBottomBorderColor(IndexedColors.BLACK.getIndex());
|
|
|
+ centerAlignStyle3.setLeftBorderColor(IndexedColors.BLACK.getIndex());
|
|
|
+ centerAlignStyle3.setRightBorderColor(IndexedColors.BLACK.getIndex());
|
|
|
|
|
|
if (zzxtvoList != null) {
|
|
|
for (InterlockHistoryDistinctZZXTVO zzxtvo : zzxtvoList) {
|
|
@@ -183,8 +236,6 @@ public class InterlockDetailHistoryServiceImpl extends ServiceImpl<InterlockDeta
|
|
|
String sheetName = zzxtvo.getInterlockApparatusName() + "-" + zzxtvo.getInterlockSystemName();
|
|
|
Sheet sheet = workbook.createSheet(sheetName);
|
|
|
|
|
|
- // 设置默认行高为 24.6 点
|
|
|
- sheet.setDefaultRowHeightInPoints(24.6f);
|
|
|
// 设置列宽——30或15个字符宽度
|
|
|
int[] columnWidths = {30, 30, 30, 15, 15, 15, 15, 15};
|
|
|
for (int j = 0; j < columnWidths.length; j++) {
|
|
@@ -208,43 +259,72 @@ public class InterlockDetailHistoryServiceImpl extends ServiceImpl<InterlockDeta
|
|
|
int loopHealthLevelC = summaryHistoryMapper.cocuntTYOrHL(dto2);
|
|
|
int loopHealthLevel = loopHealthLevelA * 3 + loopHealthLevelB * 2 + loopHealthLevelC * 1;
|
|
|
|
|
|
- String secondTitle = " 投用率:" + tyl + "%" + " 总回路数:" + loopHealthLevel;
|
|
|
- if (dto.getBeginTime() != null && dto.getEndTime() == null) {
|
|
|
- secondTitle = "起始时间:" + formattedBeginTime + secondTitle;
|
|
|
- } else if (dto.getBeginTime() == null && dto.getEndTime() != null) {
|
|
|
- secondTitle = "结束时间:" + formattedEndTime + secondTitle;
|
|
|
- } else if (dto.getBeginTime() != null && dto.getEndTime() != null) {
|
|
|
- secondTitle = "起始时间:" + formattedBeginTime + " 结束时间:" + formattedEndTime + secondTitle;
|
|
|
- }
|
|
|
|
|
|
- //标题行
|
|
|
+ //第一行:联锁历史数据报表
|
|
|
int rowNum = 0;
|
|
|
Row titleRow = sheet.createRow(rowNum++);
|
|
|
+ titleRow.setHeightInPoints(19.8f);
|
|
|
Cell titleCell = titleRow.createCell(0);
|
|
|
- titleCell.setCellValue(title + "报表");
|
|
|
- titleCell.setCellStyle(centerAlignStyle); // 应用居中对齐的样式
|
|
|
+ titleCell.setCellValue("联锁历史数据报表");
|
|
|
+ titleCell.setCellStyle(firstStyle); // 第一行的样式
|
|
|
+ // 合并第一行的前4列
|
|
|
+ sheet.addMergedRegion(new CellRangeAddress(rowNum-1, rowNum-1, 0, 3));
|
|
|
|
|
|
- //第二行标题行
|
|
|
+ // 第二行:报表生成时间:
|
|
|
Row secondTitleRow = sheet.createRow(rowNum++);
|
|
|
- Cell secondTitleCell = secondTitleRow.createCell(0);
|
|
|
- secondTitleCell.setCellValue(secondTitle);
|
|
|
- secondTitleCell.setCellStyle(rightAlignStyle); // 应用居右对齐的样式
|
|
|
-
|
|
|
- //第三行列名
|
|
|
+ // 设置第2行数据
|
|
|
+ String[] s2 = {"报表生成时间:",sdf.format(new Date()),"","","",""};
|
|
|
+ createCellOfRowWithValueStyle(secondTitleRow,s2,centerAlignStyle2);
|
|
|
+ // 合并第2行的后5列
|
|
|
+ sheet.addMergedRegion(new CellRangeAddress(rowNum-1, rowNum-1, 1, 5));
|
|
|
+
|
|
|
+ // 第3行:装置名称
|
|
|
+ Row thirdTitleRow = sheet.createRow(rowNum++);
|
|
|
+ // 设置第3行数据
|
|
|
+ String[] s3 = {"装置名称:",zzxtvo.getInterlockApparatusName(),"","","",""};
|
|
|
+ CellStyle[] style3 = {centerAlignStyle,centerAlignStyle3,centerAlignStyle3,centerAlignStyle3,centerAlignStyle3,centerAlignStyle3};
|
|
|
+ createCellOfRowWithValueStyleName(thirdTitleRow,s3,style3);
|
|
|
+ // 合并第3行的后5列
|
|
|
+ sheet.addMergedRegion(new CellRangeAddress(rowNum-1, rowNum-1, 1, 5));
|
|
|
+
|
|
|
+ // 第四行:系统名称
|
|
|
+ Row fourthTitleRow = sheet.createRow(rowNum++);
|
|
|
+ // 设置第4行数据
|
|
|
+ String[] s4 = {"系统名称:",zzxtvo.getInterlockSystemName(),"","","",""};
|
|
|
+ CellStyle[] style4 = {centerAlignStyle,centerAlignStyle3,centerAlignStyle3,centerAlignStyle3,centerAlignStyle3,centerAlignStyle3};
|
|
|
+ createCellOfRowWithValueStyleName(fourthTitleRow,s4,style4);
|
|
|
+ // 合并第4行的后5列
|
|
|
+ sheet.addMergedRegion(new CellRangeAddress(rowNum-1, rowNum-1, 1, 5));
|
|
|
+
|
|
|
+ //第五行:起始时间、结束时间
|
|
|
+ Row fifthTitleRow = sheet.createRow(rowNum++);
|
|
|
+ //设置第5行数据
|
|
|
+ String[] s5 = {"起始时间:",formattedBeginTime,"","结束时间:",formattedEndTime,""};
|
|
|
+ CellStyle[] style5 = {centerAlignStyle,centerAlignStyle3,centerAlignStyle3,centerAlignStyle,centerAlignStyle3,centerAlignStyle3};
|
|
|
+ createCellOfRowWithValueStyleName(fifthTitleRow,s5,style5);
|
|
|
+ // 分别合并第2、3列 和 第5、6列
|
|
|
+ sheet.addMergedRegion(new CellRangeAddress(rowNum-1, rowNum-1, 1, 2));
|
|
|
+ sheet.addMergedRegion(new CellRangeAddress(rowNum-1, rowNum-1, 4, 5));
|
|
|
+
|
|
|
+ //第六行:连锁回路数量、未投用联锁数量、投用率统计
|
|
|
+ Row sixTitleRow = sheet.createRow(rowNum++);
|
|
|
+ String[] s6 = {"联锁回路数量:", String.valueOf(loopHealthLevel),"未投用联锁数量:", String.valueOf(wty),"投用率统计:", String.valueOf(tyl)};
|
|
|
+ CellStyle[] style6 = {centerAlignStyle,centerAlignStyle3,centerAlignStyle,centerAlignStyle3,centerAlignStyle,centerAlignStyle3};
|
|
|
+ createCellOfRowWithValueStyleName(sixTitleRow,s6,style6);
|
|
|
+
|
|
|
+ //第七行空白
|
|
|
+ rowNum++;
|
|
|
+
|
|
|
+ //第8行:历史数据
|
|
|
+ Row eightTitleRow = sheet.createRow(rowNum++);
|
|
|
+ //设置第8行数据
|
|
|
+ createCellWithValueStyle(eightTitleRow, 0, "历史数据:", centerAlignStyle1);
|
|
|
+
|
|
|
+ //第9行:列名
|
|
|
Row columnRow= sheet.createRow(rowNum++);
|
|
|
- int column = 0;
|
|
|
- createCellWithValueStyle(columnRow, column++, "采集时间", centerAlignStyle);
|
|
|
- createCellWithValueStyle(columnRow, column++, "联锁名称", centerAlignStyle);
|
|
|
- createCellWithValueStyle(columnRow, column++, "联锁条件点位", centerAlignStyle);
|
|
|
- createCellWithValueStyle(columnRow, column++, "仪表状态", centerAlignStyle);
|
|
|
- createCellWithValueStyle(columnRow, column++, "联锁状态", centerAlignStyle);
|
|
|
- createCellWithValueStyle(columnRow, column++, "旁路状态", centerAlignStyle);
|
|
|
- createCellWithValueStyle(columnRow, column++, "控制系统状态", centerAlignStyle);
|
|
|
- createCellWithValueStyle(columnRow, column++, "回路健康级别", centerAlignStyle);
|
|
|
-
|
|
|
- // 分别合并第一行、第二行的前8列
|
|
|
- sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 7));
|
|
|
- sheet.addMergedRegion(new CellRangeAddress(1, 1, 0, 7));
|
|
|
+ String[] s9 = {"采集时间", "联锁名称", "联锁条件点位", "仪表状态", "控制系统状态", "旁路状态", "联锁状态", "回路健康级别"};
|
|
|
+ createCellOfRowWithValueStyle(columnRow,s9,centerAlignStyle);
|
|
|
+
|
|
|
|
|
|
// 创建单元格、设置格式、填充数据
|
|
|
int startTagTimeRow = 0;
|
|
@@ -257,15 +337,8 @@ public class InterlockDetailHistoryServiceImpl extends ServiceImpl<InterlockDeta
|
|
|
|
|
|
int i = 0;
|
|
|
Row row = sheet.createRow(rowNum);
|
|
|
- createCellWithValueStyle(row, i++, record.getTagTime(), centerAlignStyle);
|
|
|
- createCellWithValueStyle(row, i++, record.getInterlockname(), centerAlignStyle);
|
|
|
- createCellWithValueStyle(row, i++, record.getInterlockConditionTag(), centerAlignStyle);
|
|
|
- createCellWithValueStyle(row, i++, record.getInstrumentStatus(), centerAlignStyle);
|
|
|
- createCellWithValueStyle(row, i++, record.getInterlockStatus(), centerAlignStyle);
|
|
|
- createCellWithValueStyle(row, i++, record.getBypass(), centerAlignStyle);
|
|
|
- createCellWithValueStyle(row, i++, record.getControlSystemStatus(), centerAlignStyle);
|
|
|
- createCellWithValueStyle(row, i++, record.getLoopHealthLevel(), centerAlignStyle);
|
|
|
-
|
|
|
+ String[] s = {record.getTagTime(), record.getInterlockname(), record.getInterlockConditionTag(), record.getInstrumentStatus(), record.getControlSystemStatus(), record.getBypass(), record.getInterlockStatus(), record.getLoopHealthLevel()};
|
|
|
+ createCellOfRowWithValueStyle(row,s,centerAlignStyle3);
|
|
|
|
|
|
// 合并 "采集时间" 列单元格
|
|
|
if (idx == 0 || !record.getTagTime().equals(exportList.get(idx - 1).getTagTime())) {
|
|
@@ -286,7 +359,7 @@ public class InterlockDetailHistoryServiceImpl extends ServiceImpl<InterlockDeta
|
|
|
// 合并 "联锁状态" 列单元格,基于 "采集时间"
|
|
|
if (idx == 0 || !record.getTagTime().equals(exportList.get(idx - 1).getTagTime())) {
|
|
|
if (idx > 0 && (rowNum - startInterlockStatusRow) > 1) {
|
|
|
- sheet.addMergedRegion(new CellRangeAddress(startInterlockStatusRow, rowNum - 1, 4, 4));
|
|
|
+ sheet.addMergedRegion(new CellRangeAddress(startInterlockStatusRow, rowNum - 1, 6, 6));
|
|
|
}
|
|
|
startInterlockStatusRow = rowNum;
|
|
|
}
|
|
@@ -319,26 +392,24 @@ public class InterlockDetailHistoryServiceImpl extends ServiceImpl<InterlockDeta
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- try (FileOutputStream fileOut = new FileOutputStream(filePath)) {
|
|
|
- workbook.write(fileOut);
|
|
|
- } catch (IOException e) {
|
|
|
- // 处理异常
|
|
|
- e.printStackTrace();
|
|
|
- } finally {
|
|
|
- try {
|
|
|
- if (workbook != null) {
|
|
|
- workbook.close();
|
|
|
- }
|
|
|
- } catch (IOException e) {
|
|
|
- // 处理关闭 workbook 时可能发生的异常
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return 1;
|
|
|
+ return workbook;
|
|
|
+ }
|
|
|
|
|
|
+ //创建单元格,每个单元格都有自己的样式
|
|
|
+ private static void createCellOfRowWithValueStyleName(Row row, String[] s1, CellStyle[] style) {
|
|
|
+ int i = 0;
|
|
|
+ for (String s : s1){
|
|
|
+ createCellWithValueStyle(row, i++, s, style[i-1]);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+ // 创建第五行的单元格
|
|
|
+ private static void createCellOfRowWithValueStyle(Row row, String[] s1, CellStyle style) {
|
|
|
+ int i = 0;
|
|
|
+ for (String s : s1){
|
|
|
+ createCellWithValueStyle(row, i++, s, style);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
// 创建单元格
|
|
|
private static void createCellWithValueStyle(Row row, int col, Object value, CellStyle style) {
|
|
@@ -393,4 +464,60 @@ public class InterlockDetailHistoryServiceImpl extends ServiceImpl<InterlockDeta
|
|
|
public List<InterlockDetailHistory> getYbStatusListBySummaryIdAndTagTime(String id, String yesterday) {
|
|
|
return interlockDetailHistoryMapper.getYbStatusListBySummaryIdAndTagTime(id,yesterday);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ private IPage<InterlockSummaryHistoryVO> zhSummaryHistoryVOIPage(IPage<InterlockSummaryHistoryVO> voiPage){
|
|
|
+ List<InterlockSummaryHistoryVO> list = voiPage.getRecords().stream().map(i->{
|
|
|
+ InterlockBase base = interlockBaseMapper.selectById(i.getInterlockSystemId());
|
|
|
+ if(base != null){
|
|
|
+ //控制系统状态转换
|
|
|
+ if(base.getControlSystemStatusNormal().equals(i.getControlSystemStatus())) i.setControlSystemStatusName(base.getControlSystemStatusNormalName());
|
|
|
+ else i.setControlSystemStatusName(base.getControlSystemStatusAbnormalName());
|
|
|
+ //联锁状态转换
|
|
|
+ if(base.getInterlockStatusTy().equals(i.getInterlockStatus())) i.setInterlockStatusName(base.getInterlockStatusTyName());
|
|
|
+ else i.setInterlockStatusName(base.getInterlockStatusWtyName());
|
|
|
+ //旁路状态转换
|
|
|
+ if(base.getBypassYes().equals(i.getBypass())) i.setBypassName(base.getBypassYesName());
|
|
|
+ else i.setBypassName(base.getBypassNoName());
|
|
|
+ //仪表状态转换
|
|
|
+ if(base.getInstrumentStatusNormal().equals(i.getInstrumentStatus())) i.setInstrumentStatusName(base.getInstrumentStatusNormalName());
|
|
|
+ else i.setInstrumentStatusName(base.getInstrumentStatusAbnormalName());
|
|
|
+ }
|
|
|
+ return i;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ voiPage.setRecords(list);
|
|
|
+ return voiPage;
|
|
|
+ }
|
|
|
+
|
|
|
+ private IPage<InterlockDetailHistoryQueryVO> zhDetailHistoryQueryVOIPage(IPage<InterlockDetailHistoryQueryVO> voiPage, String interlockSystemId){
|
|
|
+ InterlockBase base = interlockBaseMapper.selectById(interlockSystemId);
|
|
|
+ if(base != null){
|
|
|
+ List<InterlockDetailHistoryQueryVO> list = voiPage.getRecords().stream().map(i->{
|
|
|
+ //旁路状态转换
|
|
|
+ if(i.getBypass()!=null && base.getBypassYes()!=null){
|
|
|
+ if(i.getBypass().equals(base.getBypassYes())) i.setBypass_dictText(base.getBypassYesName());
|
|
|
+ else i.setBypass_dictText(base.getBypassNoName());
|
|
|
+ }
|
|
|
+ //输入卡件状态转换
|
|
|
+ if(i.getInputStatus()!=null && base.getControlSystemStatusNormal()!=null){
|
|
|
+ if(i.getInputStatus().equals(base.getControlSystemStatusNormal())) i.setInputStatus_dictText(base.getControlSystemStatusNormalName());
|
|
|
+ else i.setInputStatus_dictText(base.getControlSystemStatusAbnormalName());
|
|
|
+ }
|
|
|
+ //输出卡件状态转换
|
|
|
+ if(i.getOutputStatus()!=null && base.getControlSystemStatusNormal()!=null){
|
|
|
+ if(i.getOutputStatus().equals(base.getControlSystemStatusNormal())) i.setOutputStatus_dictText(base.getControlSystemStatusNormalName());
|
|
|
+ else i.setOutputStatus_dictText(base.getControlSystemStatusAbnormalName());
|
|
|
+ }
|
|
|
+ //MP状态转换
|
|
|
+ if(i.getMpStatus()!=null && base.getControlSystemStatusNormal()!=null){
|
|
|
+ if(i.getMpStatus().equals(base.getControlSystemStatusNormal())) i.setMpStatus_dictText(base.getControlSystemStatusNormalName());
|
|
|
+ else i.setMpStatus_dictText(base.getControlSystemStatusAbnormalName());
|
|
|
+ }
|
|
|
+ return i;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ voiPage.setRecords(list);
|
|
|
+ }
|
|
|
+ return voiPage;
|
|
|
+ }
|
|
|
+
|
|
|
}
|