From 461fb02ec8264079f73fd2b6f937ad4f40754cb9 Mon Sep 17 00:00:00 2001
From: value <z1292839451@163.com>
Date: 星期三, 19 六月 2024 23:39:51 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java |   25 +++++++++++++++++++++----
 1 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java
index 878388a..af1539d 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java
@@ -10,6 +10,7 @@
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -20,6 +21,7 @@
 import com.deepoove.poi.data.*;
 import com.deepoove.poi.data.style.*;
 import com.deepoove.poi.util.TableTools;
+import com.deepoove.poi.xwpf.WidthScalePattern;
 import com.yuanchu.mom.common.GetLook;
 import com.yuanchu.mom.common.PrintChina;
 import com.yuanchu.mom.dto.ExcelDto;
@@ -785,7 +787,8 @@
             } catch (Exception e) {
                 throw new ErrorException("鎵句笉鍒版楠屼汉鐨勭鍚�");
             }
-            Custom custom = customMapper.selectById(user.get("company"));
+            //Custom custom = customMapper.selectById(user.get("company"));
+            Custom custom = customMapper.selectById(insOrder.getCompanyId());
             if (!resultCh.get().equals("")) {
                 resultCh.set("渚濇嵁濮旀墭瑕佹眰锛�" + resultCh.get().replaceFirst("銆�", "") + "绛夋墍妫�椤圭洰涓嶇鍚堣姹傦紝鍏朵綑鎵�妫�椤圭洰鍧囩鍚堣姹傘��");
                 resultEn.set("According to commissioned requirements," + resultEn.get().replaceFirst("銆�", "") + " these inspected items do not meet the requirements, all other inspected items meet the requirements.");
@@ -863,7 +866,7 @@
                                     cells.add(cellRenderData);
                                 } else {
                                     //椤圭洰淇℃伅
-                                    textRenderData.setText(insProducts1.get((int) (j - 2)).getInspectionItem() + "\n" + insProducts1.get((int) (j - 2)).getInspectionItemEn()+"鈭�"+(j+101));
+                                    textRenderData.setText(insProducts1.get((int) (j - 2)).getInspectionItem() + "\n" + insProducts1.get((int) (j - 2)).getInspectionItemEn() + "鈭�" + (j + 101));
                                     renderData.add(textRenderData);
                                     paragraphRenderData.setContents(renderData);
                                     paragraphRenderDataList.add(paragraphRenderData);
@@ -892,7 +895,7 @@
                                     //椤圭洰淇℃伅
                                     //鍒ゆ柇鏄惁鏈夐」鐩瓙绫�
                                     if (insProducts1.get((int) (j - 2)).getInspectionItemSubclass().equals("") || insProducts1.get((int) (j - 2)).getInspectionItemSubclass() == null) {
-                                        textRenderData.setText(insProducts1.get((int) (j - 2)).getInspectionItem() + "\n" + insProducts1.get((int) (j - 2)).getInspectionItemEn()+"鈭�"+(j+101));
+                                        textRenderData.setText(insProducts1.get((int) (j - 2)).getInspectionItem() + "\n" + insProducts1.get((int) (j - 2)).getInspectionItemEn() + "鈭�" + (j + 101));
                                     } else {
                                         textRenderData.setText(insProducts1.get((int) (j - 2)).getInspectionItemSubclass() + "\n" + insProducts1.get((int) (j - 2)).getInspectionItemSubclassEn());
                                     }
@@ -968,9 +971,22 @@
                     Map<String, Object> table = new HashMap<>();
                     table.put("table2", tableRenderData);
                     table.put("report", insReport);
-                    table.put("sample_number",sample.getSampleCode() );
+                    table.put("sample_number", sample.getSampleCode());
                     table.put("type", sample.getModel());
                     tables2.add(table);
+                });
+            }
+
+            /*鑾峰彇闄勪欢鍥剧墖绫诲瀷*/
+            List<Map<String, Object>> images = new ArrayList<>();
+            List<InsOrderFile> insOrderFiles = insOrderFileMapper.selectList(Wrappers.<InsOrderFile>lambdaQuery().eq(InsOrderFile::getType, 1).eq(InsOrderFile::getInsOrderId, orderId));
+            if (CollectionUtils.isNotEmpty(insOrderFiles)) {
+                insOrderFiles.forEach(insOrderFile -> {
+                    Map<String, Object> image = new HashMap<>();
+                    PictureRenderData pictureRenderData = Pictures.ofLocal(imgUrl + "/" + insOrderFile.getFileUrl()).sizeInCm(17,20).create();
+                    image.put("url", pictureRenderData);
+                    image.put("report", insReport);
+                    images.add(image);
                 });
             }
 
@@ -995,6 +1011,7 @@
                         put("insTimeEn", monthNames[insOrder.getInsTime().getMonthValue() - 1] + " " + now.getDayOfMonth() + ", " + now.getYear());
                         put("writeUrl", null);
                         put("insUrl", Pictures.ofLocal(imgUrl + "/" + signatureUrl).create());
+                        put("images", images);
                         put("examineUrl", null);
                         put("ratifyUrl", null);
                         put("sampleEn", sampleEn);

--
Gitblit v1.9.3