From 2c6f87e7a430f52f709c4686dbecc767ca377e2c Mon Sep 17 00:00:00 2001
From: zhuo <2089219845@qq.com>
Date: 星期二, 25 二月 2025 11:12:53 +0800
Subject: [PATCH] 报告生成查询字典值

---
 inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java |   31 +++++++++++++++++--------------
 1 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java
index b1d6747..ca01fca 100644
--- a/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java
+++ b/inspect-server/src/main/java/com/ruoyi/inspect/service/impl/InsOrderPlanServiceImpl.java
@@ -30,6 +30,7 @@
 import com.ruoyi.basic.pojo.IfsInventoryQuantity;
 import com.ruoyi.basic.pojo.StandardTemplate;
 import com.ruoyi.basic.service.StandardTemplateService;
+import com.ruoyi.common.constant.DictDataConstants;
 import com.ruoyi.common.constant.InsOrderTypeConstants;
 import com.ruoyi.common.core.domain.entity.Custom;
 import com.ruoyi.common.core.domain.entity.InformationNotification;
@@ -743,9 +744,6 @@
             }
             return null;
         });
-        // todo: 鍒犻櫎鏁伴噰閲囬泦娆℃暟
-//        String key = "frequency" + ":" + entrustCode + ":*";
-//        RedisUtil.delsLike(key);
 
         // 鎻愪氦鐢熸垚鎶ュ憡
         this.generateReport(orderId);
@@ -789,8 +787,7 @@
             }
         }
 
-
-        // todo: 鎴愬搧鎶芥牱娣诲姞鍚堟牸鐘舵��
+        // 鎴愬搧鎶芥牱娣诲姞鍚堟牸鐘舵��
         // 鍒ゆ柇鏄惁鏈夋娊鏍蜂俊鎭�
         if (order.getQuarterItemId() != null) {
             // 鍒ゆ柇鏄惁鏈変笉鍚堟牸
@@ -1518,9 +1515,9 @@
             standardMethod2.append("銆�").append(s);
         }
         standardMethod2.replace(0, 1, "");
-        // todo: 鏌ヨ瀛楀吀妫�娴嬬被鍨�
-//        List<SysDictData> sysDictData = iSysDictTypeService.selectDictDataByName("");
-        String orderType = null;
+
+        // 鏍峰搧绫诲瀷
+        String orderType = iSysDictTypeService.selectLabelByDict(DictDataConstants.CHECK_TYPE, insOrder.getOrderType());
 
         List<RowRenderData> rows = new ArrayList<>();
         List<TextRenderData> text = new ArrayList<>();
@@ -2279,18 +2276,23 @@
         String modelStr = CollUtil.join(models, "\n");
         String finalModelStr = modelStr;
 
-        // todo: 鏌ヨ瀛楀吀
-        //        List<SysDictData> sysDictData = iSysDictTypeService.selectDictDataByName("");
+        // 妫�娴嬬被鍨�
         String orderType = null;
-        String formType = null;
+        orderType = iSysDictTypeService.selectLabelByDict(DictDataConstants.CHECK_TYPE, insOrder.getOrderType());
+        // 鍒ゆ柇绗竴涓瓧鍏告槸鍚︿负绌�
+        if (StringUtils.isBlank(orderType)) {
+            orderType = iSysDictTypeService.selectLabelByDict(DictDataConstants.CHECK_TYPE1, insOrder.getOrderType());
+        }
+
+        // 鏉ユ牱鏂瑰紡
+        String formType = iSysDictTypeService.selectLabelByDict(DictDataConstants.FORM_TYPE, insOrder.getFormType());
 
         // 鏍峰搧鐘舵��
-        String sampleStatus = null;
+        String sampleStatus = iSysDictTypeService.selectLabelByDict(DictDataConstants.SAMPLE_STATUS_LIST, insOrder.getSampleStatus());;
 
         ConfigureBuilder builder = Configure.builder();
         builder.useSpringEL(true);
         List<Map<String, String>> finalDeviceList = deviceList;
-        Integer userId = insSampleUserMapper.selectOne(Wrappers.<InsSampleUser>lambdaQuery().eq(InsSampleUser::getInsSampleId, orderId).last("limit 1")).getUserId();
         Custom custom = customMapper.selectById(insOrder.getCompanyId());
 
         // 鏌ヨ鍒ゆ柇鏄惁鏈変笉鍒ゅ畾椤圭洰,鍜屽叏閮芥槸鍒ゅ畾椤�
@@ -2383,6 +2385,7 @@
 
         String finalResultCh = resultCh;
         String finalResultEn = resultEn;
+        String finalOrderType = orderType;
         InputStream inputStream = this.getClass().getResourceAsStream("/static/report-template.docx");
         XWPFTemplate template = XWPFTemplate.compile(inputStream, builder.build()).render(
                 new HashMap<String, Object>() {{
@@ -2407,7 +2410,7 @@
                     put("images", images);
                     put("examineUrl", null);
                     put("ratifyUrl", null);
-                    put("orderType", orderType);
+                    put("orderType", finalOrderType);
                     put("getTime", finalSendTime.format(DateTimeFormatter.ofPattern("yyyy骞碝M鏈坉d鏃�")));
                     put("getTimeEn", monthNames[finalSendTime.getMonthValue() - 1] + " " + finalSendTime.format(DateTimeFormatter.ofPattern("dd, yyyy")));
                     put("seal1", null);

--
Gitblit v1.9.3