|
@@ -1,6 +1,7 @@
|
|
|
package com.ruoyi.project.pssr.controller;
|
|
|
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
+import com.ruoyi.common.utils.file.ExcelUtils;
|
|
|
import com.ruoyi.common.utils.poi.ExcelUtil;
|
|
|
import com.ruoyi.framework.aspectj.lang.annotation.Log;
|
|
|
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
|
|
@@ -13,6 +14,8 @@ import com.ruoyi.project.pssr.domain.TPssrSubcontent;
|
|
|
import com.ruoyi.project.pssr.service.ITPssrAirtightService;
|
|
|
import com.ruoyi.project.pssr.service.ITPssrApproveService;
|
|
|
import com.ruoyi.project.pssr.service.ITPssrSubcontentService;
|
|
|
+import com.ruoyi.project.system.domain.SysUser;
|
|
|
+import com.ruoyi.project.system.service.ISysUserService;
|
|
|
import org.activiti.engine.ProcessEngine;
|
|
|
import org.activiti.engine.ProcessEngines;
|
|
|
import org.activiti.engine.TaskService;
|
|
@@ -20,8 +23,7 @@ import org.activiti.engine.task.Task;
|
|
|
import org.apache.poi.ss.usermodel.Cell;
|
|
|
import org.apache.poi.ss.usermodel.CellStyle;
|
|
|
import org.apache.poi.ss.usermodel.Row;
|
|
|
-import org.apache.poi.ss.usermodel.Sheet;
|
|
|
-import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
|
|
+import org.apache.poi.xssf.usermodel.XSSFSheet;
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
@@ -52,6 +54,9 @@ public class TPssrAirtightController extends BaseController {
|
|
|
@Autowired
|
|
|
private ITPssrSubcontentService tPssrSubcontentService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ISysUserService sysUserService;
|
|
|
+
|
|
|
/**
|
|
|
* 查询气密列表
|
|
|
*/
|
|
@@ -283,22 +288,14 @@ public class TPssrAirtightController extends BaseController {
|
|
|
|
|
|
public String exportTmpl(List<TPssrAirtight> list) {
|
|
|
OutputStream out = null;
|
|
|
- String filename =null;
|
|
|
+ String filename = null;
|
|
|
try {
|
|
|
String tempUrl = "static/word/pssr/qm.xlsx"; // 模板文件
|
|
|
InputStream is = null;
|
|
|
is = Thread.currentThread().getContextClassLoader().getResourceAsStream(tempUrl);
|
|
|
- XSSFWorkbook wb1 = null;
|
|
|
- wb1 = new XSSFWorkbook(is);
|
|
|
- SXSSFWorkbook wb = new SXSSFWorkbook(wb1, 1000);
|
|
|
-
|
|
|
- Sheet sheet;
|
|
|
- if (wb instanceof SXSSFWorkbook) {
|
|
|
- SXSSFWorkbook sxssfWorkbook = (SXSSFWorkbook) wb;
|
|
|
- sheet = sxssfWorkbook.getXSSFWorkbook().getSheetAt(0);
|
|
|
- } else {
|
|
|
- sheet = wb.getSheetAt(0);
|
|
|
- }
|
|
|
+ XSSFWorkbook wb = null;
|
|
|
+ wb = new XSSFWorkbook(is);
|
|
|
+ XSSFSheet sheet = wb.getSheetAt(0);
|
|
|
|
|
|
//填充数据
|
|
|
int rowIndex = 3;
|
|
@@ -309,8 +306,9 @@ public class TPssrAirtightController extends BaseController {
|
|
|
// 获取单元格样式
|
|
|
CellStyle originalStyle = originalcell.getCellStyle();
|
|
|
|
|
|
- for (TPssrAirtight t : list ) {
|
|
|
+ for (TPssrAirtight t : list) {
|
|
|
Row row = sheet.createRow(rowIndex);
|
|
|
+ row.setHeight((short) 800);
|
|
|
row.createCell(0).setCellValue(num);
|
|
|
row.createCell(1).setCellValue(t.getUnit());
|
|
|
row.createCell(2).setCellValue(t.getSystemName());
|
|
@@ -320,8 +318,18 @@ public class TPssrAirtightController extends BaseController {
|
|
|
row.createCell(6).setCellValue(t.getFinalPressure());
|
|
|
row.createCell(7).setCellValue(t.getStandard());
|
|
|
row.createCell(8).setCellValue(t.getUptoStandard());
|
|
|
- row.createCell(9).setCellValue(t.getConfirm1Name());
|
|
|
- row.createCell(10).setCellValue(t.getConfirm2Name());
|
|
|
+ row.createCell(9);
|
|
|
+ row.createCell(10);
|
|
|
+ try {
|
|
|
+ SysUser sysUser = sysUserService.selectUserById(Long.valueOf(t.getConfirm1()));
|
|
|
+ SysUser sysUser2 = sysUserService.selectUserById(Long.valueOf(t.getConfirm2()));
|
|
|
+ String confirm1 = sysUser.getSignUrl();
|
|
|
+ String confirm2= sysUser2.getSignUrl();
|
|
|
+ ExcelUtils.insertPicture(wb, sheet, confirm1, row.getRowNum(), 9, 1, 1);
|
|
|
+ ExcelUtils.insertPicture(wb, sheet, confirm2, row.getRowNum(), 10, 1, 1);
|
|
|
+ } catch (NumberFormatException e) {
|
|
|
+ throw new RuntimeException(e);
|
|
|
+ }
|
|
|
row.createCell(11).setCellValue(DateUtils.dateTime(t.getConfirmationDate()));
|
|
|
row.createCell(12).setCellValue(t.getRemarks());
|
|
|
|