Explorar el Código

LY 特种设备 报告

ly hace 1 año
padre
commit
36bb21a35d

+ 63 - 63
master/src/main/java/com/ruoyi/config/ActivitiConfig.java

@@ -89,73 +89,73 @@ public class ActivitiConfig {
      */
     @PostConstruct
     public void initProcess() throws IOException {
-        DeploymentBuilder deploymentBuilder = repositoryService().createDeployment();
-        Resource common = resourceLoader.getResource("classpath:/processes/common.bpmn"); //加载流程图资源文件
-        deploymentBuilder.enableDuplicateFiltering().addInputStream(common.getFilename(), common.getInputStream()).name("普通隐患审批流程").deploy(); //按流程id部署
-
-        DeploymentBuilder deploymentBuilder1 = repositoryService().createDeployment();
-        Resource major= resourceLoader.getResource("classpath:/processes/major.bpmn");
-        deploymentBuilder1.enableDuplicateFiltering().addInputStream(major.getFilename(), major.getInputStream()).name("重大隐患审批流程").deploy();
-
-        DeploymentBuilder deploymentBuilder2 = repositoryService().createDeployment();
-        Resource accident = resourceLoader.getResource("classpath:/processes/accident.bpmn"); //加载流程图资源文件
-        deploymentBuilder2.enableDuplicateFiltering().addInputStream(accident.getFilename(), accident.getInputStream()).name("事件审批流程").deploy();//按流程id部署
-
-        DeploymentBuilder deploymentBuilder3 = repositoryService().createDeployment();
-        Resource spec = resourceLoader.getResource("classpath:/processes/MyProcess.bpmn"); //加载流程图资源文件
-        deploymentBuilder3.enableDuplicateFiltering().addInputStream(spec.getFilename(), spec.getInputStream()).name("特种设备审批流程").deploy();//按流程id部署
-
-        DeploymentBuilder deploymentBuilder4 = repositoryService().createDeployment();
-        Resource spec2 = resourceLoader.getResource("classpath:/processes/his/semsAddDelProcess.bpmn"); //加载流程图资源文件
-        deploymentBuilder4.enableDuplicateFiltering().addInputStream(spec2.getFilename(), spec2.getInputStream()).name("特种设备新增修改流程").deploy();//按流程id部署
-
-        DeploymentBuilder deploymentBuilder5 = repositoryService().createDeployment();
-        Resource spec3 = resourceLoader.getResource("classpath:/processes/sems/yearProcess.bpmn"); //加载流程图资源文件
-        deploymentBuilder5.enableDuplicateFiltering().addInputStream(spec3.getFilename(), spec3.getInputStream()).name("特种设备年检报告流程").deploy();//按流程id部署
-
+//        DeploymentBuilder deploymentBuilder = repositoryService().createDeployment();
+//        Resource common = resourceLoader.getResource("classpath:/processes/common.bpmn"); //加载流程图资源文件
+//        deploymentBuilder.enableDuplicateFiltering().addInputStream(common.getFilename(), common.getInputStream()).name("普通隐患审批流程").deploy(); //按流程id部署
+//
+//        DeploymentBuilder deploymentBuilder1 = repositoryService().createDeployment();
+//        Resource major= resourceLoader.getResource("classpath:/processes/major.bpmn");
+//        deploymentBuilder1.enableDuplicateFiltering().addInputStream(major.getFilename(), major.getInputStream()).name("重大隐患审批流程").deploy();
+//
+//        DeploymentBuilder deploymentBuilder2 = repositoryService().createDeployment();
+//        Resource accident = resourceLoader.getResource("classpath:/processes/accident.bpmn"); //加载流程图资源文件
+//        deploymentBuilder2.enableDuplicateFiltering().addInputStream(accident.getFilename(), accident.getInputStream()).name("事件审批流程").deploy();//按流程id部署
+//
+//        DeploymentBuilder deploymentBuilder3 = repositoryService().createDeployment();
+//        Resource spec = resourceLoader.getResource("classpath:/processes/MyProcess.bpmn"); //加载流程图资源文件
+//        deploymentBuilder3.enableDuplicateFiltering().addInputStream(spec.getFilename(), spec.getInputStream()).name("特种设备审批流程").deploy();//按流程id部署
+//
+//        DeploymentBuilder deploymentBuilder4 = repositoryService().createDeployment();
+//        Resource spec2 = resourceLoader.getResource("classpath:/processes/his/semsAddDelProcess.bpmn"); //加载流程图资源文件
+//        deploymentBuilder4.enableDuplicateFiltering().addInputStream(spec2.getFilename(), spec2.getInputStream()).name("特种设备新增修改流程").deploy();//按流程id部署
+//
+//        DeploymentBuilder deploymentBuilder5 = repositoryService().createDeployment();
+//        Resource spec3 = resourceLoader.getResource("classpath:/processes/sems/yearProcess.bpmn"); //加载流程图资源文件
+//        deploymentBuilder5.enableDuplicateFiltering().addInputStream(spec3.getFilename(), spec3.getInputStream()).name("特种设备年检报告流程").deploy();//按流程id部署
+//
         DeploymentBuilder deploymentBuilder6 = repositoryService().createDeployment();
         Resource spec4 = resourceLoader.getResource("classpath:/processes/sems/monthProcess.bpmn"); //加载流程图资源文件
         deploymentBuilder6.enableDuplicateFiltering().addInputStream(spec4.getFilename(), spec4.getInputStream()).name("特种设备月度检验流程").deploy();//按流程id部署
 
-        DeploymentBuilder deploymentBuilder7 = repositoryService().createDeployment();
-        Resource spec7 = resourceLoader.getResource("classpath:/processes/specTraining/specTrainingPlanProcess.bpmn"); //加载流程图资源文件
-        deploymentBuilder7.enableDuplicateFiltering().addInputStream(spec7.getFilename(), spec7.getInputStream()).name("专项培训计划审核").deploy();//按流程id部署
-
-        DeploymentBuilder deploymentBuilder8 = repositoryService().createDeployment();
-        Resource spec8 = resourceLoader.getResource("classpath:/processes/maintenance.bpmn"); //加载流程图资源文件
-        deploymentBuilder8.enableDuplicateFiltering().addInputStream(spec8.getFilename(), spec8.getInputStream()).name("设备维修审核").deploy();//按流程id部署
-
-        DeploymentBuilder deploymentBuilder9 = repositoryService().createDeployment();
-        Resource spec9 = resourceLoader.getResource("classpath:/processes/intact/intactChangeApplicationProcess.bpmn"); //加载流程图资源文件
-        deploymentBuilder9.enableDuplicateFiltering().addInputStream(spec9.getFilename(), spec9.getInputStream()).name("设备变更申请流程").deploy();//按流程id部署
-
-        DeploymentBuilder deploymentBuilder10 = repositoryService().createDeployment();
-        Resource spec10 = resourceLoader.getResource("classpath:/processes/kekao/reliability.bpmn"); //加载流程图资源文件
-        deploymentBuilder10.enableDuplicateFiltering().addInputStream(spec10.getFilename(), spec10.getInputStream()).name("可靠性管理申请流程").deploy();//按流程id部署
-
-        DeploymentBuilder deploymentBuilder11 = repositoryService().createDeployment();
-        Resource spec11 = resourceLoader.getResource("classpath:/processes/reserveInvoice.bpmn"); //加载流程图资源文件
-        deploymentBuilder11.enableDuplicateFiltering().addInputStream(spec11.getFilename(), spec11.getInputStream()).name("预约开票审批流程").deploy();//按流程id部署
-
-        DeploymentBuilder deploymentBuilder12 = repositoryService().createDeployment();
-        Resource spec12 = resourceLoader.getResource("classpath:/processes/apply/offlinevalve.bpmn"); //加载流程图资源文件
-        deploymentBuilder12.enableDuplicateFiltering().addInputStream(spec12.getFilename(), spec12.getInputStream()).name("安全阀离线/切出申请流程").deploy();//按流程id部署
-
-        DeploymentBuilder deploymentBuilder13 = repositoryService().createDeployment();
-        Resource spec13 = resourceLoader.getResource("classpath:/processes/apply/safetychange.bpmn"); //加载流程图资源文件
-        deploymentBuilder13.enableDuplicateFiltering().addInputStream(spec13.getFilename(), spec13.getInputStream()).name("组织保护措施状态变更申请流程").deploy();//按流程id部署
-
-        DeploymentBuilder deploymentBuilder14 = repositoryService().createDeployment();
-        Resource spec14 = resourceLoader.getResource("classpath:/processes/sai/saiApply.bpmn"); //加载流程图资源文件
-        deploymentBuilder14.enableDuplicateFiltering().addInputStream(spec14.getFilename(), spec14.getInputStream()).name("SAI开项申请流程").deploy();//按流程id部署
-
-        DeploymentBuilder deploymentBuilder15 = repositoryService().createDeployment();
-        Resource spec15 = resourceLoader.getResource("classpath:/processes/sems/semsWeekcheck.bpmn"); //加载流程图资源文件
-        deploymentBuilder15.enableDuplicateFiltering().addInputStream(spec15.getFilename(), spec15.getInputStream()).name("每周安全排查报告").deploy();//按流程id部署
-
-        DeploymentBuilder deploymentBuilder16 = repositoryService().createDeployment();
-        Resource spec16 = resourceLoader.getResource("classpath:/processes/bccnew/dsdtTraining.bpmn"); //加载流程图资源文件
-        deploymentBuilder16.enableDuplicateFiltering().addInputStream(spec16.getFilename(), spec16.getInputStream()).name("导师带徒经理签字").deploy();//按流程id部署
+//        DeploymentBuilder deploymentBuilder7 = repositoryService().createDeployment();
+//        Resource spec7 = resourceLoader.getResource("classpath:/processes/specTraining/specTrainingPlanProcess.bpmn"); //加载流程图资源文件
+//        deploymentBuilder7.enableDuplicateFiltering().addInputStream(spec7.getFilename(), spec7.getInputStream()).name("专项培训计划审核").deploy();//按流程id部署
+//
+//        DeploymentBuilder deploymentBuilder8 = repositoryService().createDeployment();
+//        Resource spec8 = resourceLoader.getResource("classpath:/processes/maintenance.bpmn"); //加载流程图资源文件
+//        deploymentBuilder8.enableDuplicateFiltering().addInputStream(spec8.getFilename(), spec8.getInputStream()).name("设备维修审核").deploy();//按流程id部署
+//
+//        DeploymentBuilder deploymentBuilder9 = repositoryService().createDeployment();
+//        Resource spec9 = resourceLoader.getResource("classpath:/processes/intact/intactChangeApplicationProcess.bpmn"); //加载流程图资源文件
+//        deploymentBuilder9.enableDuplicateFiltering().addInputStream(spec9.getFilename(), spec9.getInputStream()).name("设备变更申请流程").deploy();//按流程id部署
+//
+//        DeploymentBuilder deploymentBuilder10 = repositoryService().createDeployment();
+//        Resource spec10 = resourceLoader.getResource("classpath:/processes/kekao/reliability.bpmn"); //加载流程图资源文件
+//        deploymentBuilder10.enableDuplicateFiltering().addInputStream(spec10.getFilename(), spec10.getInputStream()).name("可靠性管理申请流程").deploy();//按流程id部署
+//
+//        DeploymentBuilder deploymentBuilder11 = repositoryService().createDeployment();
+//        Resource spec11 = resourceLoader.getResource("classpath:/processes/reserveInvoice.bpmn"); //加载流程图资源文件
+//        deploymentBuilder11.enableDuplicateFiltering().addInputStream(spec11.getFilename(), spec11.getInputStream()).name("预约开票审批流程").deploy();//按流程id部署
+//
+//        DeploymentBuilder deploymentBuilder12 = repositoryService().createDeployment();
+//        Resource spec12 = resourceLoader.getResource("classpath:/processes/apply/offlinevalve.bpmn"); //加载流程图资源文件
+//        deploymentBuilder12.enableDuplicateFiltering().addInputStream(spec12.getFilename(), spec12.getInputStream()).name("安全阀离线/切出申请流程").deploy();//按流程id部署
+//
+//        DeploymentBuilder deploymentBuilder13 = repositoryService().createDeployment();
+//        Resource spec13 = resourceLoader.getResource("classpath:/processes/apply/safetychange.bpmn"); //加载流程图资源文件
+//        deploymentBuilder13.enableDuplicateFiltering().addInputStream(spec13.getFilename(), spec13.getInputStream()).name("组织保护措施状态变更申请流程").deploy();//按流程id部署
+//
+//        DeploymentBuilder deploymentBuilder14 = repositoryService().createDeployment();
+//        Resource spec14 = resourceLoader.getResource("classpath:/processes/sai/saiApply.bpmn"); //加载流程图资源文件
+//        deploymentBuilder14.enableDuplicateFiltering().addInputStream(spec14.getFilename(), spec14.getInputStream()).name("SAI开项申请流程").deploy();//按流程id部署
+//
+//        DeploymentBuilder deploymentBuilder15 = repositoryService().createDeployment();
+//        Resource spec15 = resourceLoader.getResource("classpath:/processes/sems/semsWeekcheck.bpmn"); //加载流程图资源文件
+//        deploymentBuilder15.enableDuplicateFiltering().addInputStream(spec15.getFilename(), spec15.getInputStream()).name("每周安全排查报告").deploy();//按流程id部署
+//
+//        DeploymentBuilder deploymentBuilder16 = repositoryService().createDeployment();
+//        Resource spec16 = resourceLoader.getResource("classpath:/processes/bccnew/dsdtTraining.bpmn"); //加载流程图资源文件
+//        deploymentBuilder16.enableDuplicateFiltering().addInputStream(spec16.getFilename(), spec16.getInputStream()).name("导师带徒经理签字").deploy();//按流程id部署
 
     }
 }

+ 20 - 0
master/src/main/java/com/ruoyi/project/sems/domain/TSpecReport.java

@@ -65,6 +65,10 @@ public class TSpecReport extends BaseEntity
     @Excel(name = "备注")
     private String remarks;
 
+    private String plantCode;
+
+    private Integer devNum;
+
     public void setId(Long id)
     {
         this.id = id;
@@ -174,6 +178,22 @@ public class TSpecReport extends BaseEntity
         return remarks;
     }
 
+    public String getPlantCode() {
+        return plantCode;
+    }
+
+    public void setPlantCode(String plantCode) {
+        this.plantCode = plantCode;
+    }
+
+    public Integer getDevNum() {
+        return devNum;
+    }
+
+    public void setDevNum(Integer devNum) {
+        this.devNum = devNum;
+    }
+
     @Override
     public String toString() {
         return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

+ 10 - 2
master/src/main/java/com/ruoyi/project/sems/mapper/TSpecReportMapper.java

@@ -1,7 +1,7 @@
 package com.ruoyi.project.sems.mapper;
 
 import java.util.List;
-import com.ruoyi.framework.aspectj.lang.annotation.DataScope;
+
 import com.ruoyi.project.sems.domain.TSpecReport;
 
 /**
@@ -26,9 +26,14 @@ public interface TSpecReportMapper
      * @param tSpecReport 特种设备报告
      * @return 特种设备报告集合
      */
-    @DataScope(deptAlias = "d")
     public List<TSpecReport> selectTSpecReportList(TSpecReport tSpecReport);
 
+    public List<TSpecReport> selectExpriedYlrq(TSpecReport tSpecReport);
+    public List<TSpecReport> selectExpriedYlgd(TSpecReport tSpecReport);
+    public List<TSpecReport> selectExpriedGl(TSpecReport tSpecReport);
+    public List<TSpecReport> selectExpriedDt(TSpecReport tSpecReport);
+    public List<TSpecReport> selectExpriedDzsb(TSpecReport tSpecReport);
+    public List<TSpecReport> selectExpriedCc(TSpecReport tSpecReport);
     /**
      * 新增特种设备报告
      *
@@ -60,4 +65,7 @@ public interface TSpecReportMapper
      * @return 结果
      */
     public int deleteTSpecReportByIds(Long[] ids);
+
+
+
 }

+ 205 - 15
master/src/main/java/com/ruoyi/project/sems/service/impl/TSpecReportServiceImpl.java

@@ -1,18 +1,37 @@
 package com.ruoyi.project.sems.service.impl;
 
+import java.io.File;
+import java.io.FileOutputStream;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.URLEncoder;
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.Iterator;
 import java.util.List;
 
+import com.alibaba.fastjson.JSON;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.ruoyi.framework.config.RuoYiConfig;
+import com.ruoyi.framework.web.controller.BaseController;
+import com.ruoyi.project.plant.domain.TStaffmgr;
+import com.ruoyi.project.sems.domain.*;
+import com.ruoyi.project.sems.service.*;
+import com.ruoyi.project.system.domain.SysDictData;
+import com.ruoyi.project.training.domain.TTraining;
+import org.apache.poi.ss.usermodel.*;
+import org.apache.poi.ss.util.CellRangeAddress;
 import org.apache.poi.xssf.streaming.SXSSFWorkbook;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.ruoyi.project.sems.mapper.TSpecReportMapper;
-import com.ruoyi.project.sems.domain.TSpecReport;
-import com.ruoyi.project.sems.service.ITSpecReportService;
+import org.springframework.transaction.annotation.Transactional;
 
+import javax.annotation.Resource;
 import javax.servlet.http.HttpServletResponse;
 
 /**
@@ -24,9 +43,22 @@ import javax.servlet.http.HttpServletResponse;
 @Service
 public class TSpecReportServiceImpl implements ITSpecReportService
 {
-    @Autowired
+    @Resource
     private TSpecReportMapper tSpecReportMapper;
+    @Autowired
+    private ITSpecdevDtService tSpecdevDtService;
+    @Autowired
+    private ITSpecdevDzsbService tSpecdevDzsbService;
+    @Autowired
+    private ITSpecdevGlService tSpecdevGlService;
+    @Autowired
+    private ITSpecdevYlgdService tSpecdevYlgdService;
+    @Autowired
+    private ITSpecdevYlrqService tSpecdevYlrqService;
+    @Autowired
+    private ITSpecdevCcService tSpecdevCcService;
 
+    protected final Logger logger = LoggerFactory.getLogger(BaseController.class);
     /**
      * 查询特种设备报告
      *
@@ -58,35 +90,193 @@ public class TSpecReportServiceImpl implements ITSpecReportService
      * @return 结果
      */
     @Override
+    @Transactional
     public int insertTSpecReport(TSpecReport tSpecReport, HttpServletResponse response)
     {
+        tSpecReportMapper.insertTSpecReport(tSpecReport);
         try {
             String tempUrl = "static/word/sems/report/sems-report.xlsx"; // 模板文件
+            // 生成的路径
+            String fileDir = RuoYiConfig.getProfile() + "/" + "sems/spec-sems";
             InputStream is = null;
             is = Thread.currentThread().getContextClassLoader().getResourceAsStream(tempUrl);
             XSSFWorkbook wb1 = new XSSFWorkbook(is);
 
             SXSSFWorkbook wb = new SXSSFWorkbook(wb1, 1000);
             // 替换excel模板数据
-//            replaceExcelCbps(wb, trainingId);
-            response.setContentType("application/octet-stream");// 下载,默认就是下载
-            response.setCharacterEncoding("UTF-8");
-            response.setHeader("Content-Disposition",
-                    "attachment;fileName=" + URLEncoder.encode(tSpecReport.getReportName() + ".xlsx", "UTF-8"));
-            // 刷新缓冲
-            response.flushBuffer();
-            OutputStream ouputStream = response.getOutputStream();
-            wb.write(ouputStream);
-            ouputStream.flush();
-            ouputStream.close();
+            replaceExcel(wb);
+            replaceExcelExpire(wb);
+            // Save the generated file
+            File dir = new File(fileDir);
+            if (!dir.exists()) {
+                logger.info("目录不存在,创建文件夹{}!", fileDir);
+                dir.mkdirs();
+            }
+            FileOutputStream fos = null;
+            String filePath = fileDir + "/" + tSpecReport.getId() + "semsReport.xlsx";
+            fos = new FileOutputStream(filePath);
+            wb.write(fos);
+
         } catch (Exception e) {
             e.printStackTrace();
         }
+        return 1;
+    }
+
+    //过期渲染
+    private void replaceExcelExpire(SXSSFWorkbook wb) {
+        Sheet sheet;
+        if (wb instanceof SXSSFWorkbook) {
+            SXSSFWorkbook sxssfWorkbook = (SXSSFWorkbook) wb;
+            sheet = sxssfWorkbook.getXSSFWorkbook().getSheetAt(0);
+        } else {
+            sheet = wb.getSheetAt(0);
+        }
+        List<TSpecReport> ylrqList =  tSpecReportMapper.selectExpriedYlrq(new TSpecReport());
+        logger.info(JSON.toJSONString(ylrqList));
+        Row row = sheet.getRow(3);
+        Cell cell = row.getCell(1);
+        // 获取单元格样式
+        CellStyle originalStyle = cell.getCellStyle();
+        cell.setCellStyle(originalStyle);
+        cell.setCellValue(getDevTotal(ylrqList));
+
+        List<TSpecReport> ylgdList =  tSpecReportMapper.selectExpriedYlgd(new TSpecReport());
+        logger.info(JSON.toJSONString(ylgdList));
+        Row row2 = sheet.getRow(3);
+        Cell cell2 = row2.getCell(4);
+        cell2.setCellValue(getDevTotal(ylgdList));
 
+        List<TSpecReport> glList =  tSpecReportMapper.selectExpriedGl(new TSpecReport());
+        logger.info(JSON.toJSONString(glList));
+        Row row3 = sheet.getRow(3);
+        Cell cell3 = row3.getCell(7);
+        cell3.setCellValue(getDevTotal(glList));
 
-        return tSpecReportMapper.insertTSpecReport(tSpecReport);
+        List<TSpecReport> dtList =  tSpecReportMapper.selectExpriedDt(new TSpecReport());
+        logger.info(JSON.toJSONString(dtList));
+        Row row4 = sheet.getRow(3);
+        Cell cell4 = row4.getCell(10);
+        cell4.setCellValue(getDevTotal(dtList));
+
+        List<TSpecReport> dzsbList =  tSpecReportMapper.selectExpriedDzsb(new TSpecReport());
+        logger.info(JSON.toJSONString(dzsbList));
+        Row row5 = sheet.getRow(3);
+        Cell cell5 = row5.getCell(13);
+        cell5.setCellValue(getDevTotal(dzsbList));
+
+        List<TSpecReport> ccList =  tSpecReportMapper.selectExpriedCc(new TSpecReport());
+        logger.info(JSON.toJSONString(ccList));
+        Row row6 = sheet.getRow(3);
+        Cell cell6 = row6.getCell(16);
+        cell6.setCellValue(getDevTotal(ccList));
+
+        sheet.shiftRows(6, sheet.getLastRowNum(), 1);
+        cpoyRow(6 ,sheet );
+        sheet.shiftRows(6, sheet.getLastRowNum(), 1);
+        cpoyRow(6 ,sheet );
+        sheet.shiftRows(6, sheet.getLastRowNum(), 1);
+        cpoyRow(6 ,sheet );
+        sheet.shiftRows(6, sheet.getLastRowNum(), 1);
+        cpoyRow(6 ,sheet );
+        sheet.shiftRows(6, sheet.getLastRowNum(), 1);
+        cpoyRow(6 ,sheet );
+        // 合并区域从第0行第0列到第0行第3列
+        CellRangeAddress mergedRegion = new CellRangeAddress(
+                3, // 起始行
+                12, // 结束行
+                0, // 起始列
+                0  // 结束列
+        );
+        sheet.addMergedRegion(mergedRegion);
     }
+    // Excel 渲染
+    private void replaceExcel(SXSSFWorkbook wb) {
+        Sheet sheet;
+        if (wb instanceof SXSSFWorkbook) {
+            SXSSFWorkbook sxssfWorkbook = (SXSSFWorkbook) wb;
+            sheet = sxssfWorkbook.getXSSFWorkbook().getSheetAt(0);
+        } else {
+            sheet = wb.getSheetAt(0);
+        }
+        //压力容器
+        int ylrqAll = tSpecdevYlrqService.count(new QueryWrapper<TSpecdevYlrq>()
+                .eq("STATUS" , 1)
+                .eq("del_flag" , 0)
+        );
+        Row row = sheet.getRow(2);
+        Cell cell = row.getCell(1);
+        // 获取单元格样式
+        CellStyle originalStyle = cell.getCellStyle();
+        cell.setCellStyle(originalStyle);
+        cell.setCellValue(ylrqAll + "(台)");
+
+        //压力管道
+        int ylgdAll = tSpecdevYlgdService.count(new QueryWrapper<TSpecdevYlgd>()
+                        .eq("STATUS" , 1)
+                        .eq("del_flag" , 0)
+        );
+        Row row2 = sheet.getRow(2);
+        Cell cell2 = row2.getCell(4);
+        // 获取单元格样式
+        cell2.setCellValue(ylgdAll + "(条)");
+        //锅炉
+        int glAll = tSpecdevGlService.count(new QueryWrapper<TSpecdevGl>()
+                        .eq("STATUS" , 1)
+                        .eq("del_flag" , 0)
+        );
+        Row row3 = sheet.getRow(2);
+        Cell cell3 = row3.getCell(7);
+        // 获取单元格样式
+        cell3.setCellValue(glAll + "(套)");
+        //电梯
+        int dtAll = tSpecdevDtService.count(new QueryWrapper<TSpecdevDt>()
+                        .eq("STATUS" , 1)
+                        .eq("del_flag" , 0)
+        );
+        Row row4 = sheet.getRow(2);
+        Cell cell4 = row4.getCell(10);
+        // 获取单元格样式
+        cell4.setCellValue(dtAll + "(台)");
+        //吊装设备
+        int dzsbAll = tSpecdevDzsbService.count(new QueryWrapper<TSpecdevDzsb>()
+                        .eq("STATUS" , 1)
+                        .eq("del_flag" , 0)
+        );
+        Row row5 = sheet.getRow(2);
+        Cell cell5 = row5.getCell(13);
+        // 获取单元格样式
+        cell5.setCellValue(dzsbAll + "(条)");
+        //叉车
+        int ccAll = tSpecdevCcService.count(new QueryWrapper<TSpecdevCc>()
+                        .eq("STATUS" , 1)
+                        .eq("del_flag" , 0)
+        );
+        Row row6 = sheet.getRow(2);
+        Cell cell6 = row6.getCell(16);
+        // 获取单元格样式
+        cell6.setCellValue(ccAll + "(辆)");
 
+    }
+
+    private int getDevTotal (List<TSpecReport> list){
+        int num = 0;
+        for (TSpecReport t : list
+             ) {
+            num = num + t.getDevNum();
+        }
+        return num;
+    }
+    void cpoyRow (int rowNum ,Sheet sheet ){
+        Row newRow = sheet.createRow(rowNum);
+        Row oldRow = sheet.getRow(rowNum+1);
+        for (int i = 0; i < 22; i++) {
+            Cell newCell = newRow.createCell(i);
+            Cell oldCell = oldRow.getCell(i);
+            CellStyle originalStyle = oldCell.getCellStyle();
+            newCell.setCellStyle(originalStyle);
+        }
+    }
     /**
      * 修改特种设备报告
      *

+ 38 - 0
master/src/main/resources/mybatis/sems/TSpecReportMapper.xml

@@ -44,6 +44,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         ${params.dataScope}
     </select>
 
+    <select id="selectExpriedYlrq" parameterType="TSpecReport" resultMap="TSpecReportResult">
+        SELECT plant_code as plantCode, COUNT(*) as devNum
+        FROM T_SPECDEV_YLRQ
+        WHERE SYSDATE  >  NEXT_WARN_DATE and DEL_FLAG = 0 and STATUS = 1
+        GROUP BY plant_code
+    </select>
+    <select id="selectExpriedYlgd" parameterType="TSpecReport" resultMap="TSpecReportResult">
+        SELECT plant_code as plantCode, COUNT(*) as devNum
+        FROM T_SPECDEV_YLGD
+        WHERE SYSDATE  >  NEXT_WARN_DATE and DEL_FLAG = 0 and STATUS = 1
+        GROUP BY plant_code
+    </select>
+    <select id="selectExpriedGl" parameterType="TSpecReport" resultMap="TSpecReportResult">
+        SELECT plant_code as plantCode, COUNT(*) as devNum
+        FROM T_SPECDEV_GL
+        WHERE SYSDATE  >  NEXT_WARN_DATE and DEL_FLAG = 0 and STATUS = 1
+        GROUP BY plant_code
+    </select>
+    <select id="selectExpriedDt" parameterType="TSpecReport" resultMap="TSpecReportResult">
+        SELECT plant_code as plantCode, COUNT(*) as devNum
+        FROM T_SPECDEV_DT
+        WHERE SYSDATE  >  NEXT_WARN_DATE and DEL_FLAG = 0 and STATUS = 1
+        GROUP BY plant_code
+    </select>
+    <select id="selectExpriedDzsb" parameterType="TSpecReport" resultMap="TSpecReportResult">
+        SELECT plant_code as plantCode, COUNT(*) as devNum
+        FROM T_SPECDEV_DZSB
+        WHERE SYSDATE  >  NEXT_WARN_DATE and DEL_FLAG = 0 and STATUS = 1
+        GROUP BY plant_code
+    </select>
+    <select id="selectExpriedCc" parameterType="TSpecReport" resultMap="TSpecReportResult">
+        SELECT plant_code as plantCode, COUNT(*) as devNum
+        FROM T_SPECDEV_CC
+        WHERE SYSDATE  >  NEXT_WARN_DATE and DEL_FLAG = 0 and STATUS = 1
+        GROUP BY plant_code
+    </select>
+
+
     <select id="selectTSpecReportById" parameterType="Long" resultMap="TSpecReportResult">
         <include refid="selectTSpecReportVo"/>
         where id = #{id}

BIN
master/src/main/resources/static/word/sems/report/sems-report.xlsx


+ 131 - 0
ui/package.json.bak

@@ -0,0 +1,131 @@
+{
+  "name": "ruoyi",
+  "version": "3.2.0",
+  "description": "若依管理系统",
+  "author": "若依",
+  "license": "MIT",
+  "scripts": {
+    "dev": "vue-cli-service serve",
+    "build:prod": "vue-cli-service build",
+    "build:stage": "vue-cli-service build --mode staging",
+    "preview": "node build/index.js --preview",
+    "lint": "eslint --ext .js,.vue src",
+    "test:unit": "jest --clearCache && vue-cli-service test:unit",
+    "test:ci": "npm run lint && npm run test:unit",
+    "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml",
+    "new": "plop"
+  },
+  "husky": {
+    "hooks": {
+      "pre-commit": "lint-staged"
+    }
+  },
+  "lint-staged": {
+    "src/**/*.{js,vue}": [
+      "eslint --fix",
+      "git add"
+    ]
+  },
+  "keywords": [
+    "vue",
+    "admin",
+    "dashboard",
+    "element-ui",
+    "boilerplate",
+    "admin-template",
+    "management-system"
+  ],
+  "repository": {
+    "type": "git",
+    "url": "https://gitee.com/y_project/RuoYi-Vue.git"
+  },
+  "dependencies": {
+    "@fullcalendar/bootstrap": "^5.0.0",
+    "@fullcalendar/core": "^5.0.0",
+    "@fullcalendar/daygrid": "^5.0.0",
+    "@fullcalendar/interaction": "^5.0.0",
+    "@fullcalendar/list": "^5.1.0",
+    "@fullcalendar/moment": "^5.0.0",
+    "@fullcalendar/resource-daygrid": "^5.1.0",
+    "@fullcalendar/resource-timegrid": "^5.1.0",
+    "@fullcalendar/timegrid": "^5.0.0",
+    "@fullcalendar/timeline": "^5.1.0",
+    "@fullcalendar/vue": "^5.0.0",
+    "@jiaminghi/data-view": "^2.10.0",
+    "@popperjs/core": "^2.11.5",
+    "@riophae/vue-treeselect": "0.4.0",
+    "bootstrap": "^4.5.0",
+    "axios": "^0.21.1",
+    "clipboard": "2.0.4",
+    "core-js": "3.6.5",
+    "dayjs": "^1.10.6",
+    "echarts": "4.2.1",
+    "echarts-liquidfill": "^3.1.0",
+    "element-ui": "^2.15.5",
+    "file-saver": "2.0.1",
+    "fuse.js": "3.4.4",
+    "js-beautify": "1.10.2",
+    "js-cookie": "2.2.0",
+    "jsencrypt": "3.0.0-rc.1",
+    "less": "^4.1.3",
+    "less-loader": "^11.1.0",
+    "moment": "^2.30.1",
+    "normalize.css": "7.0.0",
+    "nprogress": "0.2.0",
+    "path-to-regexp": "2.4.0",
+    "quill": "1.3.7",
+    "screenfull": "4.2.0",
+    "sortablejs": "1.8.4",
+    "umy-ui": "^1.1.6",
+    "vue": "2.6.10",
+    "vue-awesome": "^4.0.2",
+    "vue-awesome-swiper": "^4.1.1",
+    "vue-count-to": "1.0.13",
+    "vue-cropper": "0.4.9",
+    "vue-draggable-resizable": "^2.3.0",
+    "vue-i18n": "7.3.2",
+    "vue-router": "3.0.2",
+    "vue-splitpane": "1.0.4",
+    "vuedraggable": "2.20.0",
+    "vuex": "3.6.0"
+  },
+  "devDependencies": {
+    "@vue/cli-plugin-babel": "4.4.6",
+    "@vue/cli-plugin-eslint": "4.4.6",
+    "@vue/cli-plugin-unit-jest": "4.4.6",
+    "@vue/cli-service": "4.5.19",
+    "@vue/test-utils": "1.0.0-beta.29",
+    "autoprefixer": "9.5.1",
+    "babel-eslint": "10.1.0",
+    "babel-jest": "23.6.0",
+    "babel-plugin-component": "^1.1.1",
+    "babel-plugin-dynamic-import-node": "2.3.3",
+    "chalk": "2.4.2",
+    "chokidar": "2.1.5",
+    "compression-webpack-plugin": "^1.1.12",
+    "connect": "3.6.6",
+    "eslint": "6.7.2",
+    "eslint-plugin-vue": "6.2.2",
+    "html-webpack-plugin": "5.6.0",
+    "husky": "1.3.1",
+    "lint-staged": "15.2.7",
+    "mockjs": "1.0.1-beta3",
+    "node-sass": "4.14.1",
+    "plop": "^2.7.4",
+    "sass-loader": "8.0.2",
+    "script-ext-html-webpack-plugin": "2.1.3",
+    "script-loader": "0.7.2",
+    "serve-static": "1.13.2",
+    "svg-sprite-loader": "6.0.11",
+    "swiper": "^4.5.1",
+    "vue-template-compiler": "2.6.10"
+  },
+  "engines": {
+    "node": ">=8.9",
+    "npm": ">= 3.0.0"
+  },
+  "browserslist": [
+    "> 1%",
+    "last 2 versions"
+  ]
+}