ly 3 年之前
父节点
当前提交
15c5adb273

+ 8 - 13
master/src/main/java/com/ruoyi/project/sems/controller/TSpecdevCcController.java

@@ -416,19 +416,14 @@ public class TSpecdevCcController extends BaseController
 //        headerFont.setColor(IndexedColors.BLACK.getIndex());
 //        style.setFont(headerFont);
         Cell cell0 = row0.createCell(0);
-        row0.createCell(0).setCellValue("No.\n" + "序号");
-        row0.createCell(1).setCellValue("Plant\n" + "装置");
-        row0.createCell(2).setCellValue("Plate No.\n" + "车牌号");
-        row0.createCell(3).setCellValue("Archive\n" +
-                "档案号");
-        row0.createCell(4).setCellValue("Inspection\n" +
-                "检验日期");row0.getCell(4).setCellStyle(style);
-        row0.createCell(5).setCellValue("Next Inspection\n" +
-                "下次检验日期");row0.getCell(5).setCellStyle(style);
-        row0.createCell(6).setCellValue("Report number\n" +
-                "报告编号");row0.getCell(6).setCellStyle(style);
-        row0.createCell(7).setCellValue("Inspection Conclusion\n" +
-                "定期检验结论");row0.getCell(7).setCellStyle(style);
+        row0.createCell(0).setCellValue("序号");
+        row0.createCell(1).setCellValue("装置");
+        row0.createCell(2).setCellValue("车牌号");
+        row0.createCell(3).setCellValue("档案号");
+        row0.createCell(4).setCellValue("检验日期");row0.getCell(4).setCellStyle(style);
+        row0.createCell(5).setCellValue("下次检验日期");row0.getCell(5).setCellStyle(style);
+        row0.createCell(6).setCellValue("报告编号");row0.getCell(6).setCellStyle(style);
+        row0.createCell(7).setCellValue("定期检验结论");row0.getCell(7).setCellStyle(style);
         //填充数据
         int rowIndex = 1;
         int columnIndex = 1;

+ 17 - 20
master/src/main/java/com/ruoyi/project/sems/controller/TSpecdevDtController.java

@@ -383,6 +383,7 @@ public class TSpecdevDtController extends BaseController
         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);
@@ -396,24 +397,16 @@ public class TSpecdevDtController extends BaseController
 //        headerFont.setColor(IndexedColors.BLACK.getIndex());
 //        style.setFont(headerFont);
         Cell cell0 = row0.createCell(0);
-        row0.createCell(0).setCellValue("No.\n" + "序号");
-        row0.createCell(1).setCellValue("Plant\n" + "装置");
-        row0.createCell(2).setCellValue("Doc. No.\n" +
-                "档案号");
-        row0.createCell(3).setCellValue("Model\n" +
-                "型号");
-        row0.createCell(4).setCellValue("Location\n" +
-                "使用地点");
-        row0.createCell(5).setCellValue("Inspection Date\n" +
-                "检验日期");row0.getCell(5).setCellStyle(style);
-        row0.createCell(6).setCellValue("Inspected By\n" +
-                "检验单位");row0.getCell(6).setCellStyle(style);
-        row0.createCell(7).setCellValue("Report No.\n" +
-                "报告编号");row0.getCell(7).setCellStyle(style);
-        row0.createCell(8).setCellValue("Next start check date\n" +
-                "下次年检日期");row0.getCell(8).setCellStyle(style);
-        row0.createCell(9).setCellValue("Inspection Conclusion\n" +
-                "定期检验结论");row0.getCell(9).setCellStyle(style);
+        row0.createCell(0).setCellValue("序号");
+        row0.createCell(1).setCellValue("装置");
+        row0.createCell(2).setCellValue("档案号");
+        row0.createCell(3).setCellValue("型号");
+        row0.createCell(4).setCellValue("使用地点");
+        row0.createCell(5).setCellValue("检验日期");row0.getCell(5).setCellStyle(style);
+        row0.createCell(6).setCellValue("检验单位");row0.getCell(6).setCellStyle(style);
+        row0.createCell(7).setCellValue("报告编号");row0.getCell(7).setCellStyle(style);
+        row0.createCell(8).setCellValue("下次检验日期");row0.getCell(8).setCellStyle(style);
+        row0.createCell(9).setCellValue("定期检验结论");row0.getCell(9).setCellStyle(style);
         //填充数据
         int rowIndex = 1;
         int columnIndex = 1;
@@ -425,10 +418,14 @@ public class TSpecdevDtController extends BaseController
             row.createCell(2).setCellValue(t.getDocno());
             row.createCell(3).setCellValue(t.getModel());
             row.createCell(4).setCellValue(t.getLocation());
-            row.createCell(5).setCellValue(new SimpleDateFormat("yyyy-mm-dd").format(t.getWarnDate()));
+            if (t.getWarnDate()!= null){
+                row.createCell(5).setCellValue(new SimpleDateFormat("yyyy-mm-dd").format(t.getWarnDate()));
+            }
             row.createCell(6).setCellValue(t.getCheckUnit());
             row.createCell(7).setCellValue(t.getReportNo());
-            row.createCell(8).setCellValue(new SimpleDateFormat("yyyy-mm-dd").format(t.getNextWarnDate()));
+            if (t.getNextWarnDate()!= null){
+                row.createCell(8).setCellValue(new SimpleDateFormat("yyyy-mm-dd").format(t.getNextWarnDate()));
+            }
             row.createCell(9).setCellValue(t.getPerTestConclusion());
             rowIndex++;
         }

+ 85 - 0
master/src/main/java/com/ruoyi/project/sems/controller/TSpecdevDzsbController.java

@@ -1,6 +1,8 @@
 package com.ruoyi.project.sems.controller;
 
+import java.io.FileOutputStream;
 import java.io.IOException;
+import java.io.OutputStream;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
@@ -18,6 +20,7 @@ import com.ruoyi.project.system.domain.SysDictData;
 import com.ruoyi.project.system.service.ISysDeptService;
 import com.ruoyi.project.system.service.ISysDictTypeService;
 import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.xssf.streaming.SXSSFWorkbook;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -358,4 +361,86 @@ public class TSpecdevDzsbController extends BaseController
         logger.info("failRow:" +String.valueOf(failRow));
         return AjaxResult.success(String.valueOf(successNumber),failRow);
     }
+
+    @GetMapping("/exportDevList")
+    public AjaxResult exportbmy(ParamData params) throws IOException {
+        logger.info(JSON.toJSONString(params));
+        String id = params.getIds();
+        String[] ids = id.split(",");
+        List<TSpecdevDzsb> list = new ArrayList<>();
+        for (String i : ids
+        ) {
+            TSpecdevDzsb t = tSpecdevDzsbService.getById(i);
+            list.add(t);
+        }
+        SXSSFWorkbook wb = new SXSSFWorkbook(1000);
+        CellStyle wrapStyle = wb.createCellStyle();
+        wrapStyle.setWrapText(true);    //设置自动换行
+        //创建sheet页
+        Sheet sheet = wb.createSheet("sheet1");
+        //设置列的宽度,第一个参数为列的序号,从0开始,第二参数为列宽,单位1/256个字节
+        sheet.setColumnWidth(0, 12*256);
+        sheet.setColumnWidth(1, 26*256);
+        sheet.setColumnWidth(2, 26*256);
+        sheet.setColumnWidth(3, 26*256);
+        sheet.setColumnWidth(4, 26*256);
+        sheet.setColumnWidth(5, 26*256);
+        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);
+        CellStyle style = wb.createCellStyle();
+        style.setFillForegroundColor(IndexedColors.YELLOW.getIndex());
+        style.setFillPattern(FillPatternType.SOLID_FOREGROUND);
+//        Font headerFont = wb.createFont();
+//        headerFont.setFontName("Arial");
+//        headerFont.setFontHeightInPoints((short) 12);
+//        headerFont.setBold(false);
+//        headerFont.setColor(IndexedColors.BLACK.getIndex());
+//        style.setFont(headerFont);
+        Cell cell0 = row0.createCell(0);
+        row0.createCell(0).setCellValue("序号");
+        row0.createCell(1).setCellValue("装置");
+        row0.createCell(2).setCellValue("设备位号");
+        row0.createCell(3).setCellValue("档案号");
+        row0.createCell(4).setCellValue("设备名称");
+        row0.createCell(5).setCellValue("检验单位");row0.getCell(5).setCellStyle(style);
+        row0.createCell(6).setCellValue("检验日期");row0.getCell(6).setCellStyle(style);
+        row0.createCell(7).setCellValue("报告编号");row0.getCell(7).setCellStyle(style);
+        row0.createCell(8).setCellValue("下次检验日期");row0.getCell(8).setCellStyle(style);
+        row0.createCell(9).setCellValue("定期检验结论");row0.getCell(9).setCellStyle(style);
+        //填充数据
+        int rowIndex = 1;
+        int columnIndex = 1;
+        for (TSpecdevDzsb t: list
+        ) {
+            Row row = sheet.createRow(rowIndex);
+            row.createCell(0).setCellValue(t.getId());
+            row.createCell(1).setCellValue(t.getPlantCode());
+            row.createCell(2).setCellValue(t.getDevno());
+            row.createCell(3).setCellValue(t.getDocno());
+            row.createCell(4).setCellValue(t.getDevname());
+            row.createCell(5).setCellValue(t.getCheckUnit());
+            if (t.getWarnDate()!= null){
+                row.createCell(6).setCellValue(new SimpleDateFormat("yyyy-MM-dd").format(t.getWarnDate()));
+            }
+
+            row.createCell(7).setCellValue(t.getReportNo());
+            if (t.getNextWarnDate()!= null){
+                row.createCell(8).setCellValue(new SimpleDateFormat("yyyy-MM-dd").format(t.getNextWarnDate()));
+            }
+            row.createCell(9).setCellValue(t.getPerTestConclusion());
+            rowIndex++;
+        }
+        OutputStream out = null;
+        String filename = ExcelUtil.encodingFilename("起重机械批量更新");
+        out = new FileOutputStream(ExcelUtil.getAbsoluteFile(filename));
+        wb.write(out);
+        wb.close();
+        out.close();
+        return AjaxResult.success(filename);
+    }
 }

+ 9 - 0
ui/src/api/sems/specDzsb.js

@@ -70,3 +70,12 @@ export function exportSpecDzsb(query) {
     params: query
   })
 }
+
+// 导出特种设备吊装设备台账
+export function exportSpecList(query) {
+  return request({
+    url: '/sems/specDzsb/exportDevList',
+    method: 'get',
+    params: query
+  })
+}

+ 8 - 0
ui/src/api/sems/specGl.js

@@ -70,3 +70,11 @@ export function exportSpecGl(query) {
     params: query
   })
 }
+// 导出特种设备锅炉台账
+export function exportSpecList(query) {
+  return request({
+    url: '/sems/specGl/exportDevList',
+    method: 'get',
+    params: query
+  })
+}

+ 9 - 0
ui/src/api/sems/specYlgd.js

@@ -71,4 +71,13 @@ export function exportSpecYlgd(query) {
   })
 }
 
+// 导出特种设备压力管道台账
+export function exportSpecList(query) {
+  return request({
+    url: '/sems/specYlgd/exportDevList',
+    method: 'get',
+    params: query
+  })
+}
+
 

+ 5 - 2
ui/src/api/sems/specYlrq.js

@@ -71,11 +71,14 @@ export function exportSpecYlrq(query) {
   })
 }
 
-// 导出特种设备叉车台账
+// 导出特种设备压力容器台账
 export function exportSpecList(query) {
   return request({
-    url: '/common/download/exportDevList',
+    url: '/sems/specYlrq/exportDevList',
     method: 'get',
     params: query
   })
 }
+
+
+

+ 17 - 11
ui/src/views/sems/specDzsb/index.vue

@@ -548,7 +548,7 @@
 <script>
   import {
     addSpecDzsb,
-    delSpecDzsb,
+    exportSpecList,
     exportSpecDzsb,
     getSpecDzsb,
     listSpecDzsb,
@@ -565,8 +565,6 @@
   import {addModify} from "@/api/sems/his/modify";
   import {listPostUser} from "@/api/system/user";
   import HisReform from "./specDzsb-hisReform";
-  import {listSpecGl} from "@/api/sems/specGl";
-
 
   export default {
   name: "SpecDzsb",
@@ -995,15 +993,23 @@
       var rows = this.dataListSelections.map(item => {
         return item.id
       })
-      this.ids = rows
-      if (type == 1){
-        this.downloadType = 1
-      }else if (type == 2){
-        this.downloadType = 2
-      }
-      this.$nextTick(() => {
-        this.$refs['downloadDevForm'].submit()
+      const queryParams = {ids: null};
+      queryParams.ids = rows.join()
+      exportSpecList(queryParams).then(response => {
+        this.download(response.msg);
       })
+      // var rows = this.dataListSelections.map(item => {
+      //   return item.id
+      // })
+      // this.ids = rows
+      // if (type == 1){
+      //   this.downloadType = 1
+      // }else if (type == 2){
+      //   this.downloadType = 2
+      // }
+      // this.$nextTick(() => {
+      //   this.$refs['downloadDevForm'].submit()
+      // })
     },
     uploadUrl (uploadType) {
       return process.env.VUE_APP_BASE_API + "/sems/specDzsb/updateData"

+ 3 - 0
ui/src/views/sems/specfile/index.vue

@@ -321,6 +321,9 @@ export default {
     this.getList();
     this.getTreeselect();
     this.getDicts("spec_file_type").then(response => {
+      for (let i = 0; i < response.data.length; i++) {
+        response.data[i].dictLabel = this.$t(response.data[i].dictLabel)
+      }
       this.fileTypeOptions = response.data;
     });
     this.getDicts("spec_dev_type").then(response => {