浏览代码

生成soc卡word的模板

Zimo 1 天之前
父节点
当前提交
26e363b670

+ 6 - 1
yudao-dependencies/pom.xml

@@ -86,7 +86,7 @@
         <oshi.version>6.1.6</oshi.version>
         <pagehelper.boot.version>1.4.6</pagehelper.boot.version>
         <commons.fileupload.version>1.4</commons.fileupload.version>
-        <poi.version>4.1.2</poi.version>
+        <poi.version>5.2.5</poi.version>
         <bitwalker.version>1.21</bitwalker.version>
         <easyexcel-core.version>3.3.1</easyexcel-core.version>
         <kaptcha.version>2.3.3</kaptcha.version>
@@ -732,6 +732,11 @@
             </dependency>
 
             <!-- excel工具 -->
+            <dependency>
+                <groupId>org.apache.poi</groupId>
+                <artifactId>poi</artifactId>
+                <version>5.2.5</version>
+            </dependency>
             <dependency>
                 <groupId>org.apache.poi</groupId>
                 <artifactId>poi-ooxml</artifactId>

+ 14 - 0
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/controller/admin/qhse/ptw/QhsePtwController.java

@@ -10,10 +10,12 @@ import cn.iocoder.yudao.module.pms.controller.admin.qhse.ptw.vo.QhsePtwPageReqVO
 import cn.iocoder.yudao.module.pms.controller.admin.qhse.ptw.vo.QhsePtwRespVO;
 import cn.iocoder.yudao.module.pms.controller.admin.qhse.ptw.vo.QhsePtwSaveReqVO;
 import cn.iocoder.yudao.module.pms.dal.dataobject.qhse.ptw.QhsePtwDO;
+import cn.iocoder.yudao.module.pms.dal.mysql.qhse.cert.IotMeasureCertMapper;
 import cn.iocoder.yudao.module.pms.service.qhse.ptw.QhsePtwService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.Parameter;
 import io.swagger.v3.oas.annotations.tags.Tag;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.*;
@@ -36,6 +38,8 @@ public class QhsePtwController {
 
     @Resource
     private QhsePtwService qhsePtwService;
+    @Autowired
+    private IotMeasureCertMapper iotMeasureCertMapper;
 
     @PostMapping("/create")
     @Operation(summary = "创建QHSE_PTW作业许可")
@@ -91,4 +95,14 @@ public class QhsePtwController {
                         BeanUtils.toBean(list, QhsePtwRespVO.class));
     }
 
+//
+//    @GetMapping("/cert-owner")
+//    @Operation(summary = "获得QHSE证书相关人员")
+//    @PreAuthorize("@ss.hasPermission('rq:qhse-ptw:query')")
+//    public CommonResult<PageResult<QhsePtwRespVO>> getPtwCertOwner() {
+//        Long loginUserDeptId = SecurityFrameworkUtils.getLoginUserDeptId();
+//        List<IotMeasureCertDO> iotMeasureCertDOS = iotMeasureCertMapper.selectList("dept_id", loginUserDeptId);
+//        iotMeasureCertDOS.stream()
+//        return null;
+//    }
 }

+ 25 - 6
yudao-module-pms/yudao-module-pms-biz/src/main/java/cn/iocoder/yudao/module/pms/util/SafetyObservationCardGenerator.java

@@ -73,14 +73,31 @@ public class SafetyObservationCardGenerator {
             setCellStyle(headerRow2.getCell(1), "人员位置□", true, ParagraphAlignment.LEFT, "DCE6F1");
             setCellStyle(headerRow2.getCell(2), "", false, ParagraphAlignment.LEFT, "E6EBF5");
 
+            XWPFTableRow row10 = table.createRow();
+            String cmdText1 = "是否违章指挥?\n□ 指挥信号不正确/不清楚\n□ 多人指挥,信号不统一\n□ 非特殊情况下越权指挥\n□ 明知危险仍强令冒险作业\n□ 特殊作业前没有进行作业申请/风险分析\n□ 其他 _______________";
+            String posText1 = "人员站位是否安全?\n□ 碰撞到物体\n□ 被物体夹住/手扶握物体部位不正确\n□ 跌倒/坠落/陷入物体之中\n□ 被物体砸到\n□ 接触极高/极低温度/电流/电击\n□ 吸入/吸收/吞食有害物质\n□ 姿势不良/用力过度\n□ 其他 _______________";
+            String safeText1 = "-观察到的安全行为或安全状态\n-鼓励安全行为或安全状态所采取的行动";
+            setCellStyle(row10.getCell(0), cmdText1, false, ParagraphAlignment.LEFT, "FFFFFF");
+            setCellStyle(row10.getCell(1), posText1, false, ParagraphAlignment.LEFT, "FFFFFF");
+            setCellStyle(row10.getCell(2), safeText1, true, ParagraphAlignment.LEFT, "E6EBF5");
+
             // 行6:规范指挥明细 | 人员位置明细 | 安全行为描述(后续垂直合并)
             XWPFTableRow row6 = table.createRow();
-            String cmdText = "是否违章指挥?\n□ 指挥信号不正确/不清楚\n□ 多人指挥,信号不统一\n□ 非特殊情况下越权指挥\n□ 明知危险仍强令冒险作业\n□ 特殊作业前没有进行作业申请/风险分析\n□ 其他 _______________";
-            String posText = "人员站位是否安全?\n□ 碰撞到物体\n□ 被物体夹住/手扶握物体部位不正确\n□ 跌倒/坠落/陷入物体之中\n□ 被物体砸到\n□ 接触极高/极低温度/电流/电击\n□ 吸入/吸收/吞食有害物质\n□ 姿势不良/用力过度\n□ 其他 _______________";
-            String safeText = "-观察到的安全行为或安全状态\n-鼓励安全行为或安全状态所采取的行动";
+            String cmdText = "";
+            String posText = "";
+            String safeText = "";
             setCellStyle(row6.getCell(0), cmdText, false, ParagraphAlignment.LEFT, "FFFFFF");
             setCellStyle(row6.getCell(1), posText, false, ParagraphAlignment.LEFT, "FFFFFF");
-            setCellStyle(row6.getCell(2), safeText, true, ParagraphAlignment.LEFT, "E6EBF5");
+            setCellStyle(row6.getCell(2), safeText, false, ParagraphAlignment.LEFT, "FFFFFF");
+
+            // 行6:规范指挥明细 | 人员位置明细 | 安全行为描述(后续垂直合并)
+            XWPFTableRow row7 = table.createRow();
+            String cmdText2 = "";
+            String posText2 = "";
+            String safeText2 = "-观察到的不安全行为或不安全状态\n-即刻的纠正行动\n-预防再发生的行动";
+            setCellStyle(row7.getCell(0), cmdText2, false, ParagraphAlignment.LEFT, "FFFFFF");
+            setCellStyle(row7.getCell(1), posText2, false, ParagraphAlignment.LEFT, "FFFFFF");
+            setCellStyle(row7.getCell(2), safeText2, true, ParagraphAlignment.LEFT, "E6EBF5");
 
             // 行7:作业场所 | 空 | 空(后续垂直合并)
             XWPFTableRow headerRow3 = table.createRow();
@@ -92,7 +109,7 @@ public class SafetyObservationCardGenerator {
             XWPFTableRow row8 = table.createRow();
             mergeCellsHorizontally(row8, 0, 1);
             String houseText = "作业场所、工作环境是否存在不安全状态或其他安全隐患?\n□ 作业场所杂乱                □ 带电装置带电部分裸露\n□ 作业空间狭小                □ 设备无防护/防护装置不当\n□ 堵塞安全通道                □ 未工完料净场地清/垃圾未分类存放\n□ 地面滑(水/雨/雪/油污等)    □ 通风不良/氧气含量未达标\n□ 物体/工具放置位置不当        □ 其他 _______________\n□ 危险场所没有标志/标志不清\n□ 照明光线不良";
-            String unsafeText = "-观察到的不安全行为或不安全状态\n-即刻的纠正行动\n-预防再发生的行动";
+            String unsafeText = "";
             setCellStyle(row8.getCell(0), houseText, false, ParagraphAlignment.LEFT, "FFFFFF");
             setCellStyle(row8.getCell(2), unsafeText, false, ParagraphAlignment.LEFT, "E6EBF5");
 
@@ -105,7 +122,9 @@ public class SafetyObservationCardGenerator {
             // 核心修复:垂直合并第三列的单元格(行3到行8的第三列)
             // 行索引说明:table.getRow(2) = 行3(标题行是0,提示行是1),table.getRow(7) = 行8
             mergeCellsVertically(table, 2, 4, 2);
-
+            mergeCellsVertically(table, 5,7,0);
+            mergeCellsVertically(table, 5,7,1);
+            mergeCellsVertically(table, 7, 8, 2);
             document.write(out);
             System.out.println("生成成功:行为安全观察与沟通卡-数智化.docx");