|
@@ -315,6 +315,16 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
|
|
|
}
|
|
|
List<Integer> numArr = new ArrayList<>();
|
|
|
List<TSpecReport> ylrqList = tSpecReportMapper.selectExpriedYlrq(new TSpecReport());
|
|
|
+ // 判断超期原因
|
|
|
+ for (TSpecReport t:ylrqList
|
|
|
+ ) {
|
|
|
+ TSpecdevYlrq d = tSpecdevYlrqMapper.selectTSpecdevYlrqById(t.getId());
|
|
|
+ String re = checkApproveStatus(d.getApproveStatus()); //申请中超期
|
|
|
+ if (re != null) {
|
|
|
+ re = checkRemarks(d.getRemarks()+d.getRemarks2());//备注超期
|
|
|
+ }
|
|
|
+ d.setRemarks(re);
|
|
|
+ }
|
|
|
numArr.add(ylrqList.size());
|
|
|
logger.info(JSON.toJSONString(ylrqList));
|
|
|
Row row = sheet.getRow(3);
|
|
@@ -325,6 +335,16 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
|
|
|
cell.setCellValue(getDevTotal(ylrqList));
|
|
|
|
|
|
List<TSpecReport> ylgdList = tSpecReportMapper.selectExpriedYlgd(new TSpecReport());
|
|
|
+ // 判断超期原因
|
|
|
+ for (TSpecReport t:ylgdList
|
|
|
+ ) {
|
|
|
+ TSpecdevYlgd d = tSpecdevYlgdMapper.selectTSpecdevYlgdById(t.getId());
|
|
|
+ String re = checkApproveStatus(d.getApproveStatus()); //申请中超期
|
|
|
+ if (re == null) {
|
|
|
+ re = checkRemarks(d.getRemarks()+d.getRemarks2());//备注超期
|
|
|
+ }
|
|
|
+ t.setRemarks(re);
|
|
|
+ }
|
|
|
numArr.add(ylgdList.size());
|
|
|
logger.info(JSON.toJSONString(ylgdList));
|
|
|
Row row2 = sheet.getRow(3);
|
|
@@ -332,6 +352,16 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
|
|
|
cell2.setCellValue(getDevTotal(ylgdList));
|
|
|
|
|
|
List<TSpecReport> glList = tSpecReportMapper.selectExpriedGl(new TSpecReport());
|
|
|
+ // 判断超期原因
|
|
|
+ for (TSpecReport t:glList
|
|
|
+ ) {
|
|
|
+ TSpecdevGl d = tSpecdevGlMapper.selectTSpecdevGlById(t.getId());
|
|
|
+ String re = checkApproveStatus(d.getApproveStatus()); //申请中超期
|
|
|
+ if (re == null) {
|
|
|
+ re = checkRemarks(d.getRemarks()+d.getRemarks2());//备注超期
|
|
|
+ }
|
|
|
+ t.setRemarks(re);
|
|
|
+ }
|
|
|
numArr.add(glList.size());
|
|
|
logger.info(JSON.toJSONString(glList));
|
|
|
Row row3 = sheet.getRow(3);
|
|
@@ -339,6 +369,17 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
|
|
|
cell3.setCellValue(getDevTotal(glList));
|
|
|
|
|
|
List<TSpecReport> dtList = tSpecReportMapper.selectExpriedDt(new TSpecReport());
|
|
|
+ // 判断超期原因
|
|
|
+ for (TSpecReport t:dtList
|
|
|
+ ) {
|
|
|
+ TSpecdevDt d = tSpecdevDtMapper.selectTSpecdevDtById(t.getId());
|
|
|
+ logger.info(JSON.toJSONString(d));
|
|
|
+ String re = checkApproveStatus(d.getApproveStatus()); //申请中超期
|
|
|
+ if (re == null) {
|
|
|
+ re = checkRemarks(d.getRemarks()+d.getRemarks2());//备注超期
|
|
|
+ }
|
|
|
+ t.setRemarks(re);
|
|
|
+ }
|
|
|
numArr.add(dtList.size());
|
|
|
logger.info(JSON.toJSONString(dtList));
|
|
|
Row row4 = sheet.getRow(3);
|
|
@@ -346,6 +387,16 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
|
|
|
cell4.setCellValue(getDevTotal(dtList));
|
|
|
|
|
|
List<TSpecReport> dzsbList = tSpecReportMapper.selectExpriedDzsb(new TSpecReport());
|
|
|
+ // 判断超期原因
|
|
|
+ for (TSpecReport t:dzsbList
|
|
|
+ ) {
|
|
|
+ TSpecdevDzsb d = tSpecdevDzsbMapper.selectTSpecdevDzsbById(t.getId());
|
|
|
+ String re = checkApproveStatus(d.getApproveStatus()); //申请中超期
|
|
|
+ if (re == null) {
|
|
|
+ re = checkRemarks(d.getRemarks()+d.getRemarks2());//备注超期
|
|
|
+ }
|
|
|
+ t.setRemarks(re);
|
|
|
+ }
|
|
|
numArr.add(dzsbList.size());
|
|
|
logger.info(JSON.toJSONString(dzsbList));
|
|
|
Row row5 = sheet.getRow(3);
|
|
@@ -353,6 +404,16 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
|
|
|
cell5.setCellValue(getDevTotal(dzsbList));
|
|
|
|
|
|
List<TSpecReport> ccList = tSpecReportMapper.selectExpriedCc(new TSpecReport());
|
|
|
+ // 判断超期原因
|
|
|
+ for (TSpecReport t:ccList
|
|
|
+ ) {
|
|
|
+ TSpecdevCc d = tSpecdevCcMapper.selectTSpecdevCcById(t.getId());
|
|
|
+ String re = checkApproveStatus(d.getApproveStatus()); //申请中超期
|
|
|
+ if (re == null) {
|
|
|
+ re = checkRemarks(d.getRemarks()+d.getRemarks2());//备注超期
|
|
|
+ }
|
|
|
+ t.setRemarks(re);
|
|
|
+ }
|
|
|
numArr.add(ccList.size());
|
|
|
logger.info(JSON.toJSONString(ccList));
|
|
|
Row row6 = sheet.getRow(3);
|
|
@@ -382,6 +443,29 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
|
|
|
renderCell(wb,sheet,ccList,5,16);
|
|
|
}
|
|
|
|
|
|
+ private String checkRemarks(String input) {
|
|
|
+ String[] keywords = {"报告未到", "已检等待报告", "等待报告","已检"};
|
|
|
+ for (String keyword : keywords) {
|
|
|
+ if (input.contains(keyword)) {
|
|
|
+ System.out.println("包含 '" + keyword + "'");
|
|
|
+ return "报告未到";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ private String checkApproveStatus(Long approveStatus) {
|
|
|
+ if (approveStatus == 2) {
|
|
|
+ return "停用申请中";
|
|
|
+ }
|
|
|
+ if (approveStatus == 3) {
|
|
|
+ return "报废申请中";
|
|
|
+ }if (approveStatus == -1) {
|
|
|
+ return "注销申请中";
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
// Excel 渲染
|
|
|
private void replaceExcel(SXSSFWorkbook wb) {
|
|
|
Sheet sheet;
|
|
@@ -623,6 +707,7 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
|
|
|
sheet.setColumnWidth(11, 26 * 256);
|
|
|
sheet.setColumnWidth(12, 40 * 256);
|
|
|
sheet.setColumnWidth(13, 40 * 256);
|
|
|
+ sheet.setColumnWidth(14, 40 * 256);
|
|
|
//设置开始行和开始列
|
|
|
|
|
|
Row row0 = sheet.createRow(0);
|
|
@@ -652,7 +737,7 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
|
|
|
row0.createCell(12).setCellValue("下次年度检查日期");
|
|
|
row0.createCell(13).setCellValue("年度检查报告编号");
|
|
|
row0.createCell(14).setCellValue("备注");
|
|
|
-
|
|
|
+ row0.createCell(15).setCellValue("备注2");
|
|
|
//填充数据
|
|
|
int rowIndex = 1;
|
|
|
int columnIndex = 1;
|
|
@@ -682,6 +767,7 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
|
|
|
}
|
|
|
row.createCell(13).setCellValue(t.getYearReportNo());
|
|
|
row.createCell(14).setCellValue(t.getRemarks());
|
|
|
+ row.createCell(15).setCellValue(t.getRemarks2());
|
|
|
rowIndex++;
|
|
|
}
|
|
|
}
|
|
@@ -704,6 +790,7 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
|
|
|
sheet.setColumnWidth(11, 26 * 256);
|
|
|
sheet.setColumnWidth(12, 40 * 256);
|
|
|
sheet.setColumnWidth(13, 40 * 256);
|
|
|
+ sheet.setColumnWidth(14, 40 * 256);
|
|
|
//设置开始行和开始列
|
|
|
|
|
|
Row row0 = sheet.createRow(0);
|
|
@@ -742,6 +829,8 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
|
|
|
row0.getCell(13).setCellStyle(style);
|
|
|
row0.createCell(14).setCellValue("备注");
|
|
|
row0.getCell(14).setCellStyle(style);
|
|
|
+ row0.createCell(15).setCellValue("备注2");
|
|
|
+ row0.getCell(15).setCellStyle(style);
|
|
|
//填充数据
|
|
|
int rowIndex = 1;
|
|
|
int columnIndex = 1;
|
|
@@ -771,6 +860,7 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
|
|
|
}
|
|
|
row.createCell(13).setCellValue(t.getYearReportNo());
|
|
|
row.createCell(14).setCellValue(t.getRemarks());
|
|
|
+ row.createCell(15).setCellValue(t.getRemarks2());
|
|
|
rowIndex++;
|
|
|
}
|
|
|
|
|
@@ -794,6 +884,7 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
|
|
|
sheet.setColumnWidth(11, 26*256);
|
|
|
sheet.setColumnWidth(12, 40*256);
|
|
|
sheet.setColumnWidth(13, 40*256);
|
|
|
+ sheet.setColumnWidth(14, 40*256);
|
|
|
//设置开始行和开始列
|
|
|
|
|
|
Row row0 = sheet.createRow(0);
|
|
@@ -822,6 +913,8 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
|
|
|
row0.createCell(12).setCellValue("外部检验报告编号");row0.getCell(12).setCellStyle(style);
|
|
|
row0.createCell(13).setCellValue("下次外部检验日期");row0.getCell(13).setCellStyle(style);
|
|
|
row0.createCell(14).setCellValue("备注");row0.getCell(14).setCellStyle(style);
|
|
|
+ row0.createCell(15).setCellValue("备注2");row0.getCell(15).setCellStyle(style);
|
|
|
+
|
|
|
//填充数据
|
|
|
int rowIndex = 1;
|
|
|
int columnIndex = 1;
|
|
@@ -852,6 +945,7 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
|
|
|
row.createCell(13).setCellValue(new SimpleDateFormat("yyyy-MM-dd").format(t.getOutNextWarnDate()));
|
|
|
}
|
|
|
row.createCell(14).setCellValue(t.getRemarks());
|
|
|
+ row.createCell(15).setCellValue(t.getRemarks2());
|
|
|
rowIndex++;
|
|
|
}
|
|
|
}
|
|
@@ -870,6 +964,7 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
|
|
|
sheet.setColumnWidth(7, 26 * 256);
|
|
|
sheet.setColumnWidth(8, 40 * 256);
|
|
|
sheet.setColumnWidth(9, 40 * 256);
|
|
|
+ sheet.setColumnWidth(10, 40 * 256);
|
|
|
//设置开始行和开始列
|
|
|
|
|
|
Row row0 = sheet.createRow(0);
|
|
@@ -899,6 +994,8 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
|
|
|
row0.getCell(9).setCellStyle(style);
|
|
|
row0.createCell(10).setCellValue("备注");
|
|
|
row0.getCell(10).setCellStyle(style);
|
|
|
+ row0.createCell(11).setCellValue("备注2");
|
|
|
+ row0.getCell(11).setCellStyle(style);
|
|
|
//填充数据
|
|
|
int rowIndex = 1;
|
|
|
int columnIndex = 1;
|
|
@@ -920,6 +1017,7 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
|
|
|
}
|
|
|
row.createCell(9).setCellValue(t.getPerTestConclusion());
|
|
|
row.createCell(10).setCellValue(t.getRemarks());
|
|
|
+ row.createCell(11).setCellValue(t.getRemarks2());
|
|
|
rowIndex++;
|
|
|
}
|
|
|
}
|
|
@@ -938,6 +1036,7 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
|
|
|
sheet.setColumnWidth(7, 26 * 256);
|
|
|
sheet.setColumnWidth(8, 40 * 256);
|
|
|
sheet.setColumnWidth(9, 40 * 256);
|
|
|
+ sheet.setColumnWidth(10, 40 * 256);
|
|
|
//设置开始行和开始列
|
|
|
|
|
|
Row row0 = sheet.createRow(0);
|
|
@@ -966,6 +1065,8 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
|
|
|
row0.getCell(9).setCellStyle(style);
|
|
|
row0.createCell(10).setCellValue("备注");
|
|
|
row0.getCell(10).setCellStyle(style);
|
|
|
+ row0.createCell(11).setCellValue("备注2");
|
|
|
+ row0.getCell(11).setCellStyle(style);
|
|
|
//填充数据
|
|
|
int rowIndex = 1;
|
|
|
int columnIndex = 1;
|
|
@@ -987,6 +1088,7 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
|
|
|
}
|
|
|
row.createCell(9).setCellValue(t.getPerTestConclusion());
|
|
|
row.createCell(10).setCellValue(t.getRemarks());
|
|
|
+ row.createCell(11).setCellValue(t.getRemarks2());
|
|
|
rowIndex++;
|
|
|
}
|
|
|
}
|
|
@@ -1004,6 +1106,7 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
|
|
|
sheet.setColumnWidth(6, 26 * 256);
|
|
|
sheet.setColumnWidth(7, 26 * 256);
|
|
|
sheet.setColumnWidth(8, 40 * 256);
|
|
|
+ sheet.setColumnWidth(9, 40 * 256);
|
|
|
//设置开始行和开始列
|
|
|
|
|
|
Row row0 = sheet.createRow(0);
|
|
@@ -1019,6 +1122,7 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
|
|
|
row0.createCell(6).setCellValue("报告编号");
|
|
|
row0.createCell(7).setCellValue("定期检验结论");
|
|
|
row0.createCell(8).setCellValue("备注");
|
|
|
+ row0.createCell(9).setCellValue("备注2");
|
|
|
//填充数据
|
|
|
int rowIndex = 1;
|
|
|
int columnIndex = 1;
|
|
@@ -1038,6 +1142,7 @@ public class TSpecReportServiceImpl implements ITSpecReportService {
|
|
|
row.createCell(6).setCellValue(t.getReportNo());
|
|
|
row.createCell(7).setCellValue(t.getPerTestConclusion());
|
|
|
row.createCell(8).setCellValue(t.getRemarks());
|
|
|
+ row.createCell(9).setCellValue(t.getRemarks2());
|
|
|
rowIndex++;
|
|
|
}
|
|
|
}
|