From cda20cfc03352a1ce534fecef438806de2cc61a5 Mon Sep 17 00:00:00 2001
From: Crunchy <3114200645@qq.com>
Date: 星期五, 09 八月 2024 18:44:43 +0800
Subject: [PATCH] 模板适配onoloffice

---
 inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java |   23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 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 217085a..02be8fc 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
@@ -539,7 +539,7 @@
                         insProductResultMapper.deleteById(insProductResultss.get(i));
                     }
                 }
-                InsProductResult insProductResult = insProductResultMapper.selectOne(Wrappers.<InsProductResult>lambdaQuery().eq(InsProductResult::getInsProductId, Integer.parseInt(k)));
+                //InsProductResult insProductResult = insProductResultMapper.selectOne(Wrappers.<InsProductResult>lambdaQuery().eq(InsProductResult::getInsProductId, Integer.parseInt(k)));
                 //妫�楠屽��
                 if (jo.get("insValue") != null) {
                     JSONArray jsonArray = JSON.parseArray(JSON.toJSONString(jo.get("insValue")));
@@ -769,7 +769,7 @@
                                 auxiliaryOutputWorkingHours.setCheck(userId);//妫�娴嬩汉
                             }
                             try {
-                                if (ObjectUtils.isEmpty(insProductResult) && !result.getInsValue().equals("[]") || (ObjectUtils.isNotEmpty(insProductResult) && !insProductResult.getInsValue().equals(result.getInsValue()) && !insProductResult.getInsValue().equals("[]"))) {
+                                if (CollectionUtils.isEmpty(insProductResultss) && !result.getInsValue().equals("[]") || (CollectionUtils.isNotEmpty(insProductResultss) && !insProductResultss.get(0).getInsValue().equals(result.getInsValue()) && !insProductResultss.get(0).getInsValue().equals("[]"))) {
                                     auxiliaryOutputWorkingHoursMapper.insert(auxiliaryOutputWorkingHours);
                                 }
                             }catch (Exception e){
@@ -786,9 +786,9 @@
                 Long l1 = insProductMapper.selectCount(Wrappers.<InsProduct>lambdaQuery()
                         .eq(InsProduct::getInsSampleId, insSample.getId())
                         .and(wrapper -> wrapper
-                                .isNull(InsProduct::getInsResult)
+                                .isNotNull(InsProduct::getInsResult)
                                 .or()
-                                .eq(InsProduct::getInsResult, 2)
+                                .ne(InsProduct::getInsResult, 2)
                         ));
                 if (l == l1) {
                     insSample.setInsState(2);
@@ -1139,8 +1139,19 @@
                                         textRenderData.setText("鉁�");
                                         break;
                                     case 0:
-                                        resultCh.set(resultCh.get() + "銆�" + p.getInspectionItem() + (p.getInspectionItemSubclass().equals("") ? "" : " " + p.getInspectionItemSubclass()));
-                                        resultEn.set(resultEn.get() + "銆�" + p.getInspectionItemEn() + ((Objects.equals(p.getInspectionItemSubclassEn(), "") || Objects.equals(p.getInspectionItemSubclassEn(), null)) ? "" : " " + p.getInspectionItemSubclassEn()));
+                                        Set<String> uniqueItems1 = new HashSet<>();
+                                        Set<String> uniqueItems2 = new HashSet<>();
+
+                                        String item1 = p.getInspectionItem() + (p.getInspectionItemSubclass().equals("") ? "" : " " + p.getInspectionItemSubclass());
+                                        if (uniqueItems1.add(item1)) {
+                                            resultCh.set(resultCh.get() + "銆�" + item1);
+                                        }
+                                        //resultCh.set(resultCh.get() + "銆�" + p.getInspectionItem() + (p.getInspectionItemSubclass().equals("") ? "" : " " + p.getInspectionItemSubclass()));
+                                        String item2 = p.getInspectionItemEn() + ((Objects.equals(p.getInspectionItemSubclassEn(), "") || Objects.equals(p.getInspectionItemSubclassEn(), null)) ? "" : " " + p.getInspectionItemSubclassEn());
+                                        if (uniqueItems2.add(item2)) {
+                                            resultEn.set(resultEn.get() + "銆�" + item2);
+                                        }
+                                        //resultEn.set(resultEn.get() + "銆�" + );
                                         textRenderData.setText("鉁�");
                                         break;
                                     default:

--
Gitblit v1.9.3