Explorar el Código

- PSSR公用工程导出
- PSSR仪表校验导出
- PSSR临时电源导出
- PSSR电机设备导出
- PSSR静电接地/跨接导出
- PSSR气体检测仪导出
- PSSR在线分析仪导出

wangggziwen hace 7 meses
padre
commit
428fce17f6

+ 81 - 5
master/src/main/java/com/ruoyi/project/pssr/controller/TPssrAnalyzerController.java

@@ -1,16 +1,27 @@
 package com.ruoyi.project.pssr.controller;
 
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.util.*;
 
-import com.ruoyi.project.pssr.domain.TPssrApprove;
-import com.ruoyi.project.pssr.domain.TPssrAnalyzer;
-import com.ruoyi.project.pssr.domain.TPssrSubcontent;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.file.ExcelUtils;
+import com.ruoyi.project.pssr.domain.*;
 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;
 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.xssf.usermodel.XSSFSheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -49,6 +60,10 @@ public class TPssrAnalyzerController extends BaseController
     @Autowired
     private ITPssrSubcontentService tPssrSubcontentService;
 
+    @Autowired
+    private ISysUserService sysUserService;
+
+
     /**
      * 查询在线分析仪列表
      */
@@ -70,8 +85,69 @@ public class TPssrAnalyzerController extends BaseController
     public AjaxResult export(TPssrAnalyzer tPssrAnalyzer)
     {
         List<TPssrAnalyzer> list = tPssrAnalyzerService.selectTPssrAnalyzerList(tPssrAnalyzer);
-        ExcelUtil<TPssrAnalyzer> util = new ExcelUtil<TPssrAnalyzer>(TPssrAnalyzer.class);
-        return util.exportExcel(list, "analyzer");
+        return AjaxResult.success(exportTmpl(list));
+    }
+
+    public String exportTmpl(List<TPssrAnalyzer> list) {
+        OutputStream out = null;
+        String filename = null;
+        try {
+            String tempUrl = "static/word/pssr/zxfxy.xlsx"; // 模板文件
+            InputStream is = null;
+            is = Thread.currentThread().getContextClassLoader().getResourceAsStream(tempUrl);
+            XSSFWorkbook wb = null;
+            wb = new XSSFWorkbook(is);
+            XSSFSheet sheet = wb.getSheetAt(0);
+
+            //填充数据
+            int rowIndex = 3;
+            int num = 1;
+
+            Row originalRow = sheet.getRow(3);
+            Cell originalcell = originalRow.getCell(0);
+            // 获取单元格样式
+            CellStyle originalStyle = originalcell.getCellStyle();
+
+            for (TPssrAnalyzer 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.getDevNo());
+                row.createCell(3).setCellValue(t.getVisualInspection());
+                row.createCell(4).setCellValue(t.getFunctionalCheck());
+                row.createCell(5);
+                row.createCell(6);
+                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(), 5, 1, 1);
+                    ExcelUtils.insertPicture(wb, sheet, confirm2, row.getRowNum(), 6, 1, 1);
+                } catch (NumberFormatException e) {
+                    throw new RuntimeException(e);
+                }
+                row.createCell(7).setCellValue(DateUtils.dateTime(t.getConfirmationDate()));
+                row.createCell(8).setCellValue(t.getRemarks());
+
+
+                //渲染样式
+                for (int i = 0; i < 9; i++) {
+                    row.getCell(i).setCellStyle(originalStyle);
+                }
+                num++;
+                rowIndex++;
+            }
+            filename = ExcelUtil.encodingFilename("Analyzer");
+            out = new FileOutputStream(ExcelUtil.getAbsoluteFile(filename));
+            wb.write(out);
+            wb.close();
+
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return filename;
     }
 
     /**

+ 12 - 9
master/src/main/java/com/ruoyi/project/pssr/controller/TPssrApproveController.java

@@ -185,6 +185,9 @@ public class TPssrApproveController extends BaseController {
     @Autowired
     private ITPssrProgrammeService tPssrProgrammeService;
 
+    @Autowired
+    private ITPssrPowerService tPssrPowerService;
+
     /**
      * 查询pssr审批管理列表
      */
@@ -1605,16 +1608,16 @@ public class TPssrApproveController extends BaseController {
     public void doLsdyApprove(TPssrSubcontent sub) {
         String userId = getUserId().toString();
         //修改状态
-        TPssrMotor tPssrMotor = new TPssrMotor();
-        tPssrMotor.setApproveStatus(0L);
-        tPssrMotor.setSubId(sub.getId());
+        TPssrPower tPssrPower = new TPssrPower();
+        tPssrPower.setApproveStatus(0L);
+        tPssrPower.setSubId(sub.getId());
         Set<String> installer = new HashSet<>();
         Set<String> remover = new HashSet<>();
-        for (TPssrMotor item : tPssrMotorService.selectTPssrMotorList(tPssrMotor)) {
+        for (TPssrPower item : tPssrPowerService.selectTPssrPowerList(tPssrPower)) {
             item.setApproveStatus(1L);
             item.setUpdatedate(new Date());
             item.setUpdaterCode(userId);
-            tPssrMotorService.updateTPssrMotor(item);
+            tPssrPowerService.updateTPssrPower(item);
 
             // 安装人员
             installer.add(item.getConfirm1());
@@ -1643,10 +1646,10 @@ public class TPssrApproveController extends BaseController {
             TPssrApprove approve = tPssrApproves.get(0);
             delProcess(approve.getProcessId(), "pssr2confirm");
 
-            tPssrMotor = new TPssrMotor();
-            tPssrMotor.setApproveStatus(1L);
-            tPssrMotor.setSubId(sub.getId());
-            for (TPssrMotor item : tPssrMotorService.selectTPssrMotorList(tPssrMotor)) {
+            tPssrPower = new TPssrPower();
+            tPssrPower.setApproveStatus(1L);
+            tPssrPower.setSubId(sub.getId());
+            for (TPssrPower item : tPssrPowerService.selectTPssrPowerList(tPssrPower)) {
                 // 安装人员
                 installer.add(item.getConfirm1());
 

+ 79 - 5
master/src/main/java/com/ruoyi/project/pssr/controller/TPssrFranklinismController.java

@@ -1,16 +1,27 @@
 package com.ruoyi.project.pssr.controller;
 
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.util.*;
 
-import com.ruoyi.project.pssr.domain.TPssrApprove;
-import com.ruoyi.project.pssr.domain.TPssrFranklinism;
-import com.ruoyi.project.pssr.domain.TPssrSubcontent;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.file.ExcelUtils;
+import com.ruoyi.project.pssr.domain.*;
 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;
 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.xssf.usermodel.XSSFSheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -49,6 +60,10 @@ public class TPssrFranklinismController extends BaseController
     @Autowired
     private ITPssrSubcontentService tPssrSubcontentService;
 
+    @Autowired
+    private ISysUserService sysUserService;
+
+
     /**
      * 查询静电接地,跨接列表
      */
@@ -70,8 +85,67 @@ public class TPssrFranklinismController extends BaseController
     public AjaxResult export(TPssrFranklinism tPssrFranklinism)
     {
         List<TPssrFranklinism> list = tPssrFranklinismService.selectTPssrFranklinismList(tPssrFranklinism);
-        ExcelUtil<TPssrFranklinism> util = new ExcelUtil<TPssrFranklinism>(TPssrFranklinism.class);
-        return util.exportExcel(list, "franklinism");
+        return AjaxResult.success(exportTmpl(list));
+    }
+
+    public String exportTmpl(List<TPssrFranklinism> list) {
+        OutputStream out = null;
+        String filename = null;
+        try {
+            String tempUrl = "static/word/pssr/jdjdkj.xlsx"; // 模板文件
+            InputStream is = null;
+            is = Thread.currentThread().getContextClassLoader().getResourceAsStream(tempUrl);
+            XSSFWorkbook wb = null;
+            wb = new XSSFWorkbook(is);
+            XSSFSheet sheet = wb.getSheetAt(0);
+
+            //填充数据
+            int rowIndex = 3;
+            int num = 1;
+
+            Row originalRow = sheet.getRow(3);
+            Cell originalcell = originalRow.getCell(0);
+            // 获取单元格样式
+            CellStyle originalStyle = originalcell.getCellStyle();
+
+            for (TPssrFranklinism t : list) {
+                Row row = sheet.createRow(rowIndex);
+                row.setHeight((short) 800);
+                row.createCell(0).setCellValue(num);
+                row.createCell(1).setCellValue(t.getCheckContent());
+                row.createCell(2).setCellValue(t.getCheckResult());
+                row.createCell(3);
+                row.createCell(4);
+                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(), 3, 1, 1);
+                    ExcelUtils.insertPicture(wb, sheet, confirm2, row.getRowNum(), 4, 1, 1);
+                } catch (NumberFormatException e) {
+                    throw new RuntimeException(e);
+                }
+                row.createCell(5).setCellValue(DateUtils.dateTime(t.getConfirmationDate()));
+                row.createCell(6).setCellValue(t.getRemarks());
+
+
+                //渲染样式
+                for (int i = 0; i < 7; i++) {
+                    row.getCell(i).setCellStyle(originalStyle);
+                }
+                num++;
+                rowIndex++;
+            }
+            filename = ExcelUtil.encodingFilename("Franklinism");
+            out = new FileOutputStream(ExcelUtil.getAbsoluteFile(filename));
+            wb.write(out);
+            wb.close();
+
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return filename;
     }
 
     /**

+ 81 - 5
master/src/main/java/com/ruoyi/project/pssr/controller/TPssrGasdetectorController.java

@@ -1,16 +1,27 @@
 package com.ruoyi.project.pssr.controller;
 
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.util.*;
 
-import com.ruoyi.project.pssr.domain.TPssrApprove;
-import com.ruoyi.project.pssr.domain.TPssrGasdetector;
-import com.ruoyi.project.pssr.domain.TPssrSubcontent;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.file.ExcelUtils;
+import com.ruoyi.project.pssr.domain.*;
 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;
 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.xssf.usermodel.XSSFSheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -49,6 +60,10 @@ public class TPssrGasdetectorController extends BaseController
     @Autowired
     private ITPssrSubcontentService tPssrSubcontentService;
 
+    @Autowired
+    private ISysUserService sysUserService;
+
+
     /**
      * 查询气体检测器列表
      */
@@ -70,8 +85,69 @@ public class TPssrGasdetectorController extends BaseController
     public AjaxResult export(TPssrGasdetector tPssrGasdetector)
     {
         List<TPssrGasdetector> list = tPssrGasdetectorService.selectTPssrGasdetectorList(tPssrGasdetector);
-        ExcelUtil<TPssrGasdetector> util = new ExcelUtil<TPssrGasdetector>(TPssrGasdetector.class);
-        return util.exportExcel(list, "gasdetector");
+        return AjaxResult.success(exportTmpl(list));
+    }
+
+    public String exportTmpl(List<TPssrGasdetector> list) {
+        OutputStream out = null;
+        String filename = null;
+        try {
+            String tempUrl = "static/word/pssr/qtjcy.xlsx"; // 模板文件
+            InputStream is = null;
+            is = Thread.currentThread().getContextClassLoader().getResourceAsStream(tempUrl);
+            XSSFWorkbook wb = null;
+            wb = new XSSFWorkbook(is);
+            XSSFSheet sheet = wb.getSheetAt(0);
+
+            //填充数据
+            int rowIndex = 3;
+            int num = 1;
+
+            Row originalRow = sheet.getRow(3);
+            Cell originalcell = originalRow.getCell(0);
+            // 获取单元格样式
+            CellStyle originalStyle = originalcell.getCellStyle();
+
+            for (TPssrGasdetector t : list) {
+                Row row = sheet.createRow(rowIndex);
+                row.setHeight((short) 800);
+                row.createCell(0).setCellValue(num);
+                row.createCell(1).setCellValue(t.getDevNo());
+                row.createCell(2).setCellValue(t.getVisualInspection());
+                row.createCell(3).setCellValue(t.getRaincoverCheck());
+                row.createCell(4).setCellValue(t.getDisplayCheck());
+                row.createCell(5);
+                row.createCell(6);
+                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(), 5, 1, 1);
+                    ExcelUtils.insertPicture(wb, sheet, confirm2, row.getRowNum(), 6, 1, 1);
+                } catch (NumberFormatException e) {
+                    throw new RuntimeException(e);
+                }
+                row.createCell(7).setCellValue(DateUtils.dateTime(t.getConfirmationDate()));
+                row.createCell(8).setCellValue(t.getRemarks());
+
+
+                //渲染样式
+                for (int i = 0; i < 9; i++) {
+                    row.getCell(i).setCellStyle(originalStyle);
+                }
+                num++;
+                rowIndex++;
+            }
+            filename = ExcelUtil.encodingFilename("Gasdetector");
+            out = new FileOutputStream(ExcelUtil.getAbsoluteFile(filename));
+            wb.write(out);
+            wb.close();
+
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return filename;
     }
 
     /**

+ 93 - 16
master/src/main/java/com/ruoyi/project/pssr/controller/TPssrInstrumentCalibrationController.java

@@ -1,16 +1,27 @@
 package com.ruoyi.project.pssr.controller;
 
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.util.*;
 
-import com.ruoyi.project.pssr.domain.TPssrApprove;
-import com.ruoyi.project.pssr.domain.TPssrInstrumentCalibration;
-import com.ruoyi.project.pssr.domain.TPssrSubcontent;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.file.ExcelUtils;
+import com.ruoyi.project.pssr.domain.*;
 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;
 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.xssf.usermodel.XSSFSheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -31,7 +42,7 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
 import com.ruoyi.framework.web.page.TableDataInfo;
 
 /**
- * 仪校验Controller
+ * 仪校验Controller
  *
  * @author ssy
  * @date 2024-09-18
@@ -49,8 +60,12 @@ public class TPssrInstrumentCalibrationController extends BaseController
     @Autowired
     private ITPssrSubcontentService tPssrSubcontentService;
 
+    @Autowired
+    private ISysUserService sysUserService;
+
+
     /**
-     * 查询仪校验列表
+     * 查询仪校验列表
      */
     @PreAuthorize("@ss.hasPermi('pssr:instrumentCalibration:list')")
     @GetMapping("/list")
@@ -62,20 +77,82 @@ public class TPssrInstrumentCalibrationController extends BaseController
     }
 
     /**
-     * 导出仪校验列表
+     * 导出仪校验列表
      */
     @PreAuthorize("@ss.hasPermi('pssr:instrumentCalibration:export')")
-    @Log(title = "仪校验", businessType = BusinessType.EXPORT)
+    @Log(title = "仪校验", businessType = BusinessType.EXPORT)
     @GetMapping("/export")
     public AjaxResult export(TPssrInstrumentCalibration tPssrInstrumentCalibration)
     {
         List<TPssrInstrumentCalibration> list = tPssrInstrumentCalibrationService.selectTPssrInstrumentCalibrationList(tPssrInstrumentCalibration);
-        ExcelUtil<TPssrInstrumentCalibration> util = new ExcelUtil<TPssrInstrumentCalibration>(TPssrInstrumentCalibration.class);
-        return util.exportExcel(list, "instrumentCalibration");
+        return AjaxResult.success(exportTmpl(list));
+    }
+
+    public String exportTmpl(List<TPssrInstrumentCalibration> list) {
+        OutputStream out = null;
+        String filename = null;
+        try {
+            String tempUrl = "static/word/pssr/ybjy.xlsx"; // 模板文件
+            InputStream is = null;
+            is = Thread.currentThread().getContextClassLoader().getResourceAsStream(tempUrl);
+            XSSFWorkbook wb = null;
+            wb = new XSSFWorkbook(is);
+            XSSFSheet sheet = wb.getSheetAt(0);
+
+            //填充数据
+            int rowIndex = 3;
+            int num = 1;
+
+            Row originalRow = sheet.getRow(3);
+            Cell originalcell = originalRow.getCell(0);
+            // 获取单元格样式
+            CellStyle originalStyle = originalcell.getCellStyle();
+
+            for (TPssrInstrumentCalibration 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.getDevNo());
+                row.createCell(3).setCellValue(t.getVisualInspection());
+                row.createCell(4).setCellValue(t.getInstallationInspection());
+                row.createCell(5).setCellValue(t.getFunctionalCheck());
+                row.createCell(6);
+                row.createCell(7);
+                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(), 6, 1, 1);
+                    ExcelUtils.insertPicture(wb, sheet, confirm2, row.getRowNum(), 7, 1, 1);
+                } catch (NumberFormatException e) {
+                    throw new RuntimeException(e);
+                }
+                row.createCell(8).setCellValue(DateUtils.dateTime(t.getConfirmationDate()));
+                row.createCell(9).setCellValue(t.getRemarks());
+
+
+                //渲染样式
+                for (int i = 0; i < 10; i++) {
+                    row.getCell(i).setCellStyle(originalStyle);
+                }
+                num++;
+                rowIndex++;
+            }
+            filename = ExcelUtil.encodingFilename("InstrumentCalibration");
+            out = new FileOutputStream(ExcelUtil.getAbsoluteFile(filename));
+            wb.write(out);
+            wb.close();
+
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return filename;
     }
 
     /**
-     * 获取仪校验详细信息
+     * 获取仪校验详细信息
      */
     @PreAuthorize("@ss.hasPermi('pssr:instrumentCalibration:query')")
     @GetMapping(value = "/{id}")
@@ -85,10 +162,10 @@ public class TPssrInstrumentCalibrationController extends BaseController
     }
 
     /**
-     * 新增仪校验
+     * 新增仪校验
      */
     @PreAuthorize("@ss.hasPermi('pssr:instrumentCalibration:add')")
-    @Log(title = "仪校验", businessType = BusinessType.INSERT)
+    @Log(title = "仪校验", businessType = BusinessType.INSERT)
     @PostMapping
     public AjaxResult add(@RequestBody TPssrInstrumentCalibration tPssrInstrumentCalibration)
     {
@@ -97,10 +174,10 @@ public class TPssrInstrumentCalibrationController extends BaseController
     }
 
     /**
-     * 修改仪校验
+     * 修改仪校验
      */
     @PreAuthorize("@ss.hasPermi('pssr:instrumentCalibration:edit')")
-    @Log(title = "仪校验", businessType = BusinessType.UPDATE)
+    @Log(title = "仪校验", businessType = BusinessType.UPDATE)
     @PutMapping
     public AjaxResult edit(@RequestBody TPssrInstrumentCalibration tPssrInstrumentCalibration)
     {
@@ -108,10 +185,10 @@ public class TPssrInstrumentCalibrationController extends BaseController
     }
 
     /**
-     * 删除仪校验
+     * 删除仪校验
      */
     @PreAuthorize("@ss.hasPermi('pssr:instrumentCalibration:remove')")
-    @Log(title = "仪校验", businessType = BusinessType.DELETE)
+    @Log(title = "仪校验", businessType = BusinessType.DELETE)
 	@DeleteMapping("/{ids}")
     public AjaxResult remove(@PathVariable Long[] ids)
     {

+ 80 - 2
master/src/main/java/com/ruoyi/project/pssr/controller/TPssrMotorController.java

@@ -1,15 +1,28 @@
 package com.ruoyi.project.pssr.controller;
 
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.util.*;
 
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.file.ExcelUtils;
 import com.ruoyi.project.pssr.domain.TPssrApprove;
 import com.ruoyi.project.pssr.domain.TPssrSubcontent;
 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;
 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.xssf.usermodel.XSSFSheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -48,6 +61,10 @@ public class TPssrMotorController extends BaseController
     @Autowired
     private ITPssrSubcontentService tPssrSubcontentService;
 
+    @Autowired
+    private ISysUserService sysUserService;
+
+
     /**
      * 查询电机设备列表
      */
@@ -69,8 +86,69 @@ public class TPssrMotorController extends BaseController
     public AjaxResult export(TPssrMotor tPssrMotor)
     {
         List<TPssrMotor> list = tPssrMotorService.selectTPssrMotorList(tPssrMotor);
-        ExcelUtil<TPssrMotor> util = new ExcelUtil<TPssrMotor>(TPssrMotor.class);
-        return util.exportExcel(list, "motor");
+        return AjaxResult.success(exportTmpl(list));
+    }
+
+    public String exportTmpl(List<TPssrMotor> list) {
+        OutputStream out = null;
+        String filename = null;
+        try {
+            String tempUrl = "static/word/pssr/djsb.xlsx"; // 模板文件
+            InputStream is = null;
+            is = Thread.currentThread().getContextClassLoader().getResourceAsStream(tempUrl);
+            XSSFWorkbook wb = null;
+            wb = new XSSFWorkbook(is);
+            XSSFSheet sheet = wb.getSheetAt(0);
+
+            //填充数据
+            int rowIndex = 3;
+            int num = 1;
+
+            Row originalRow = sheet.getRow(3);
+            Cell originalcell = originalRow.getCell(0);
+            // 获取单元格样式
+            CellStyle originalStyle = originalcell.getCellStyle();
+
+            for (TPssrMotor 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.getDevNo());
+                row.createCell(3).setCellValue(t.getVisualInspection());
+                row.createCell(4).setCellValue(t.getFunctionalCheck());
+                row.createCell(5);
+                row.createCell(6);
+                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(), 5, 1, 1);
+                    ExcelUtils.insertPicture(wb, sheet, confirm2, row.getRowNum(), 6, 1, 1);
+                } catch (NumberFormatException e) {
+                    throw new RuntimeException(e);
+                }
+                row.createCell(7).setCellValue(DateUtils.dateTime(t.getConfirmationDate()));
+                row.createCell(8).setCellValue(t.getRemarks());
+
+
+                //渲染样式
+                for (int i = 0; i < 9; i++) {
+                    row.getCell(i).setCellStyle(originalStyle);
+                }
+                num++;
+                rowIndex++;
+            }
+            filename = ExcelUtil.encodingFilename("rMotor");
+            out = new FileOutputStream(ExcelUtil.getAbsoluteFile(filename));
+            wb.write(out);
+            wb.close();
+
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return filename;
     }
 
     /**

+ 79 - 5
master/src/main/java/com/ruoyi/project/pssr/controller/TPssrPowerController.java

@@ -1,16 +1,27 @@
 package com.ruoyi.project.pssr.controller;
 
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.util.*;
 
-import com.ruoyi.project.pssr.domain.TPssrApprove;
-import com.ruoyi.project.pssr.domain.TPssrPower;
-import com.ruoyi.project.pssr.domain.TPssrSubcontent;
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.file.ExcelUtils;
+import com.ruoyi.project.pssr.domain.*;
 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;
 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.xssf.usermodel.XSSFSheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -49,6 +60,10 @@ public class TPssrPowerController extends BaseController
     @Autowired
     private ITPssrSubcontentService tPssrSubcontentService;
 
+    @Autowired
+    private ISysUserService sysUserService;
+
+
     /**
      * 查询临时电源列表
      */
@@ -70,8 +85,67 @@ public class TPssrPowerController extends BaseController
     public AjaxResult export(TPssrPower tPssrPower)
     {
         List<TPssrPower> list = tPssrPowerService.selectTPssrPowerList(tPssrPower);
-        ExcelUtil<TPssrPower> util = new ExcelUtil<TPssrPower>(TPssrPower.class);
-        return util.exportExcel(list, "power");
+        return AjaxResult.success(exportTmpl(list));
+    }
+
+    public String exportTmpl(List<TPssrPower> list) {
+        OutputStream out = null;
+        String filename = null;
+        try {
+            String tempUrl = "static/word/pssr/lsdy.xlsx"; // 模板文件
+            InputStream is = null;
+            is = Thread.currentThread().getContextClassLoader().getResourceAsStream(tempUrl);
+            XSSFWorkbook wb = null;
+            wb = new XSSFWorkbook(is);
+            XSSFSheet sheet = wb.getSheetAt(0);
+
+            //填充数据
+            int rowIndex = 3;
+            int num = 1;
+
+            Row originalRow = sheet.getRow(3);
+            Cell originalcell = originalRow.getCell(0);
+            // 获取单元格样式
+            CellStyle originalStyle = originalcell.getCellStyle();
+
+            for (TPssrPower t : list) {
+                Row row = sheet.createRow(rowIndex);
+                row.setHeight((short) 800);
+                row.createCell(0).setCellValue(num);
+                row.createCell(1).setCellValue(t.getCheckContent());
+                row.createCell(2).setCellValue(t.getCheckResult());
+                row.createCell(3);
+                row.createCell(4);
+                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(), 3, 1, 1);
+                    ExcelUtils.insertPicture(wb, sheet, confirm2, row.getRowNum(), 4, 1, 1);
+                } catch (NumberFormatException e) {
+                    throw new RuntimeException(e);
+                }
+                row.createCell(5).setCellValue(DateUtils.dateTime(t.getConfirmationDate()));
+                row.createCell(6).setCellValue(t.getRemarks());
+
+
+                //渲染样式
+                for (int i = 0; i < 7; i++) {
+                    row.getCell(i).setCellStyle(originalStyle);
+                }
+                num++;
+                rowIndex++;
+            }
+            filename = ExcelUtil.encodingFilename("Power");
+            out = new FileOutputStream(ExcelUtil.getAbsoluteFile(filename));
+            wb.write(out);
+            wb.close();
+
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return filename;
     }
 
     /**

+ 79 - 3
master/src/main/java/com/ruoyi/project/pssr/controller/TPssrPublicController.java

@@ -1,16 +1,29 @@
 package com.ruoyi.project.pssr.controller;
 
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.util.*;
 
+import com.ruoyi.common.utils.DateUtils;
+import com.ruoyi.common.utils.file.ExcelUtils;
 import com.ruoyi.project.pssr.domain.TPssrApprove;
-import com.ruoyi.project.pssr.domain.TPssrCircuit;
+import com.ruoyi.project.pssr.domain.TPssrPublic;
 import com.ruoyi.project.pssr.domain.TPssrSubcontent;
 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;
 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.xssf.usermodel.XSSFSheet;
+import org.apache.poi.xssf.usermodel.XSSFWorkbook;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -49,6 +62,10 @@ public class TPssrPublicController extends BaseController
     @Autowired
     private ITPssrSubcontentService tPssrSubcontentService;
 
+    @Autowired
+    private ISysUserService sysUserService;
+
+
     /**
      * 查询公用工程列表
      */
@@ -70,8 +87,67 @@ public class TPssrPublicController extends BaseController
     public AjaxResult export(TPssrPublic tPssrPublic)
     {
         List<TPssrPublic> list = tPssrPublicService.selectTPssrPublicList(tPssrPublic);
-        ExcelUtil<TPssrPublic> util = new ExcelUtil<TPssrPublic>(TPssrPublic.class);
-        return util.exportExcel(list, "public");
+        return AjaxResult.success(exportTmpl(list));
+    }
+
+    public String exportTmpl(List<TPssrPublic> list) {
+        OutputStream out = null;
+        String filename = null;
+        try {
+            String tempUrl = "static/word/pssr/gygc.xlsx"; // 模板文件
+            InputStream is = null;
+            is = Thread.currentThread().getContextClassLoader().getResourceAsStream(tempUrl);
+            XSSFWorkbook wb = null;
+            wb = new XSSFWorkbook(is);
+            XSSFSheet sheet = wb.getSheetAt(0);
+
+            //填充数据
+            int rowIndex = 3;
+            int num = 1;
+
+            Row originalRow = sheet.getRow(3);
+            Cell originalcell = originalRow.getCell(0);
+            // 获取单元格样式
+            CellStyle originalStyle = originalcell.getCellStyle();
+
+            for (TPssrPublic t : list) {
+                Row row = sheet.createRow(rowIndex);
+                row.setHeight((short) 800);
+                row.createCell(0).setCellValue(num);
+                row.createCell(1).setCellValue(t.getCheckContent());
+                row.createCell(2).setCellValue(t.getCheckResult());
+                row.createCell(3);
+                row.createCell(4);
+                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(), 3, 1, 1);
+                    ExcelUtils.insertPicture(wb, sheet, confirm2, row.getRowNum(), 4, 1, 1);
+                } catch (NumberFormatException e) {
+                    throw new RuntimeException(e);
+                }
+                row.createCell(5).setCellValue(DateUtils.dateTime(t.getConfirmationDate()));
+                row.createCell(6).setCellValue(t.getRemarks());
+
+
+                //渲染样式
+                for (int i = 0; i < 6; i++) {
+                    row.getCell(i).setCellStyle(originalStyle);
+                }
+                num++;
+                rowIndex++;
+            }
+            filename = ExcelUtil.encodingFilename("Public");
+            out = new FileOutputStream(ExcelUtil.getAbsoluteFile(filename));
+            wb.write(out);
+            wb.close();
+
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+        return filename;
     }
 
     /**

BIN
master/src/main/resources/static/word/pssr/djsb.xlsx


BIN
master/src/main/resources/static/word/pssr/gygc.xlsx


BIN
master/src/main/resources/static/word/pssr/jdjdkj.xlsx


BIN
master/src/main/resources/static/word/pssr/lsdy.xlsx


BIN
master/src/main/resources/static/word/pssr/qtjcy.xlsx


BIN
master/src/main/resources/static/word/pssr/ybjy.xlsx


BIN
master/src/main/resources/static/word/pssr/zxfxy.xlsx