Ver Fonte

版本合并0420

xy há 1 mês atrás
pai
commit
e1916b96d6

+ 2 - 0
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/controller/admin/boilertaskorder/vo/BoilerOrderItemCostInfoReqVO.java

@@ -34,4 +34,6 @@ public class BoilerOrderItemCostInfoReqVO {
     @Schema(description = "检验性质")
     @NotNull(message = "检验性质不能为空")
     private List<String> inspectionNature;
+
+    private String equipType;
 }

+ 1 - 1
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/controller/admin/equipboilerscheduling/vo/EquipBoilerSchedulingRespVO.java

@@ -87,5 +87,5 @@ public class EquipBoilerSchedulingRespVO {
     private String planOutCheckDate;
     @Schema(description = "排期耐压检验时间")
     private String planPressureCheckDate;
-
+private String type;
 }

+ 2 - 2
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/service/boilertaskorder/BoilerTaskOrderServiceImpl.java

@@ -1033,7 +1033,7 @@ public class BoilerTaskOrderServiceImpl extends ServiceImpl<BoilerTaskOrderMappe
         List<BoilerOrderItemCostInfoRepsVO> list = new ArrayList<>();
         // 获取检验性质和所属设备的模版列表
         List<String> natureIds = inspectionNatureService.inspectionNatureIdList(reqVO.getInspectionNature(),
-                reqVO.getEquipmentCategory());
+                reqVO.getEquipmentCategory(), reqVO.getEquipType());
         if (CollUtil.isEmpty(natureIds)) {
             return list;
         }
@@ -1110,7 +1110,7 @@ public class BoilerTaskOrderServiceImpl extends ServiceImpl<BoilerTaskOrderMappe
         List<BoilerOrderItemCostInfoRepsVO> list = new ArrayList<>();
         // 获取检验性质和所属设备的模版列表
         List<String> natureIds = inspectionNatureService.inspectionNatureIdList(reqVO.getInspectionNature(),
-                reqVO.getEquipmentCategory());
+                reqVO.getEquipmentCategory(),reqVO.getEquipType());
         if (CollUtil.isEmpty(natureIds)) {
             return list;
         }

+ 1 - 1
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/service/inspectionnature/InspectionNatureService.java

@@ -86,6 +86,6 @@ public interface InspectionNatureService  extends IService<InspectionNatureDO> {
      * @param equipmentCategory 所属设备
      * @return 检验性质ID列表
      */
-    List<String> inspectionNatureIdList(List<String> inspectionNatures, String equipmentCategory);
+    List<String> inspectionNatureIdList(List<String> inspectionNatures, String equipmentCategory,String equipType);
 
 }

+ 2 - 1
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/service/inspectionnature/InspectionNatureServiceImpl.java

@@ -260,10 +260,11 @@ public class InspectionNatureServiceImpl extends ServiceImpl<InspectionNatureMap
     }
 
     @Override
-    public List<String> inspectionNatureIdList(List<String> inspectionNatures, String equipmentCategory) {
+    public List<String> inspectionNatureIdList(List<String> inspectionNatures, String equipmentCategory,String equipType) {
         LambdaQueryWrapperX<InspectionNatureDO> lambdaQueryWrapperX = new LambdaQueryWrapperX<>();
         lambdaQueryWrapperX.inIfPresent(InspectionNatureDO::getInspectionNature, inspectionNatures);
         lambdaQueryWrapperX.eqIfPresent(InspectionNatureDO::getEquipmentCategory, equipmentCategory);
+        lambdaQueryWrapperX.eqIfPresent(InspectionNatureDO::getEquipmentType, equipType);
         return inspectionNatureMapper.selectList(lambdaQueryWrapperX).stream().map(InspectionNatureDO::getId).collect(Collectors.toList());
     }
 

+ 2 - 2
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/service/pipetaskorder/PipeTaskOrderServiceImpl.java

@@ -1070,7 +1070,7 @@ public class PipeTaskOrderServiceImpl extends ServiceImpl<PipeTaskOrderMapper, P
         List<BoilerOrderItemCostInfoRepsVO> list = new ArrayList<>();
         // 获取检验性质和所属设备的模版列表
         List<String> natureIds = inspectionNatureService.inspectionNatureIdList(reqVO.getInspectionNature(),
-                reqVO.getEquipmentCategory());
+                reqVO.getEquipmentCategory(), reqVO.getEquipType());
         if (CollUtil.isEmpty(natureIds)) {
             return list;
         }
@@ -1148,7 +1148,7 @@ public class PipeTaskOrderServiceImpl extends ServiceImpl<PipeTaskOrderMapper, P
         List<BoilerOrderItemCostInfoRepsVO> list = new ArrayList<>();
         // 获取检验性质和所属设备的模版列表
         List<String> natureIds = inspectionNatureService.inspectionNatureIdList(reqVO.getInspectionNature(),
-                reqVO.getEquipmentCategory());
+                reqVO.getEquipmentCategory(), reqVO.getEquipType());
         if (CollUtil.isEmpty(natureIds)) {
             return list;
         }

+ 43 - 1
tz-module-pressure2/tz-module-pressure2-biz/src/main/java/cn/start/tz/module/pressure2/util/WordToPdfUtils.java

@@ -123,7 +123,35 @@ public class WordToPdfUtils {
         try {
             long old = System.currentTimeMillis();
             Document doc = new Document(new ByteArrayInputStream(bytes));
-            doc.save(byteArrayOutputStream, SaveFormat.PDF);//全面支持DOC, DOCX, OOXML, RTF HTML, OpenDocument, PDF, EPUB, XPS, SWF 相互转换
+            
+            // 设置字体替换规则,解决中文乱码问题
+            FontSettings fontSettings = new FontSettings();
+            
+            // 从 resources/fonts 目录加载 simsun.ttf 字体
+            InputStream fontInputStream = WordToPdfUtils.class.getClassLoader()
+                    .getResourceAsStream("fonts/simsun.ttf");
+            
+            if (fontInputStream != null) {
+                // 创建内存字体源
+                MemoryFontSource memoryFontSource = new MemoryFontSource(
+                    readAllBytes(fontInputStream), 0);
+                
+                // 配置字体源
+                FontSourceBase[] originalFontSources = fontSettings.getFontsSources();
+                FontSourceBase[] newFontSources = new FontSourceBase[originalFontSources.length + 1];
+                System.arraycopy(originalFontSources, 0, newFontSources, 0, originalFontSources.length);
+                newFontSources[newFontSources.length - 1] = memoryFontSource;
+                fontSettings.setFontsSources(newFontSources);
+            }
+            
+            // 应用字体设置
+            doc.setFontSettings(fontSettings);
+            
+            // 设置PDF保存选项,嵌入完整字体
+            PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
+            pdfSaveOptions.setEmbedFullFonts(true);
+            
+            doc.save(byteArrayOutputStream, pdfSaveOptions);
             long now = System.currentTimeMillis();
             log.info("pdf转换成功,共耗时:{}秒", (now - old) / 1000.0);
         } catch (Exception e) {
@@ -131,5 +159,19 @@ public class WordToPdfUtils {
         }
         return byteArrayOutputStream;
     }
+    
+    /**
+     * 读取输入流的所有字节
+     */
+    private static byte[] readAllBytes(InputStream inputStream) throws IOException {
+        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+        int nRead;
+        byte[] data = new byte[4096];
+        while ((nRead = inputStream.read(data, 0, data.length)) != -1) {
+            buffer.write(data, 0, nRead);
+        }
+        buffer.flush();
+        return buffer.toByteArray();
+    }
 
 }

+ 1 - 1
tz-module-pressure2/tz-module-pressure2-biz/src/main/resources/mapper/equipboilerscheduling/EquipBoilerSchedulingMapper.xml

@@ -12,7 +12,7 @@
     <select id="selectPlanPage">
         select rownum,a.* from (
         select eb.EQUIP_DISTRICT,eb.EQUIP_STREET,eb.UNIT_CODE,eb.UNIT_NAME,eb.UNIT_ADDRESS,eb.EQUIP_CODE,eb.USE_REGISTER_NO,eb.BOILER_MODEL,eb.FACTORY_CODE
-        ,eb.id
+        ,eb.id,eb.type
         ,LISTAGG(CASE WHEN eb.NEXT_IN_CHECK_DATE IS NOT NULL AND eb.HAS_INTERNAL = 0
         <if test="nextDate != null and nextDate.size()>= 2">
             AND eb.NEXT_IN_CHECK_DATE BETWEEN #{nextDate[0]} AND #{nextDate[1]}