From ec6c3bc0b778178b2518302ffc9099ac8f6cc8a2 Mon Sep 17 00:00:00 2001
From: value <z1292839451@163.com>
Date: 星期二, 30 四月 2024 00:54:34 +0800
Subject: [PATCH] 标准库修复

---
 inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardMethodListServiceImpl.java |   34 ++++++++++++++++++----------------
 1 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardMethodListServiceImpl.java b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardMethodListServiceImpl.java
index 85c5b37..b4efc3c 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardMethodListServiceImpl.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardMethodListServiceImpl.java
@@ -2,14 +2,13 @@
 
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.yuanchu.mom.mapper.StandardMethodListMapper;
 import com.yuanchu.mom.mapper.StandardProductListMapper;
 import com.yuanchu.mom.pojo.StandardMethodList;
 import com.yuanchu.mom.pojo.StandardProductList;
 import com.yuanchu.mom.service.StandardMethodListService;
-import com.yuanchu.mom.mapper.StandardMethodListMapper;
 import lombok.AllArgsConstructor;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -31,7 +30,6 @@
     private StandardProductListMapper standardProductListMapper;
 
     @Override
-    @Transactional(rollbackFor = Exception.class)
     public int addStandardMethodList(Integer standardId, String tree) {
         String[] trees = tree.split(" - ");
         Map<String, String> map = standardMethodListMapper.selectStandardMethodById(standardId);
@@ -77,25 +75,30 @@
     @Override
     public Map<String, List<?>> selectsStandardMethodByFLSSM(String tree) {
         String[] trees = tree.split(" - ");
-        List<StandardMethodList> standardMethodLists = null;
+        Map<String, List<?>> map = new HashMap<>();
+        String str = "";
+        List<StandardMethodList> standardMethodLists = new ArrayList<>();
         switch (trees.length){
             case 5:
-                standardMethodLists = standardMethodListMapper.selectStandardMethodLists(trees[0],trees[1],trees[2],trees[3],trees[4]);
+                str += "\"" + trees[2] + "\",\"" + trees[3] + "\",\"" + trees[4] + "\"";
+                standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists(str));
+                standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists("\"" + trees[2] + "\",\"" + trees[3] + "\""));
+                standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists("\"" + trees[2] + "\""));
                 break;
             case 4:
-                standardMethodLists = standardMethodListMapper.selectStandardMethodLists(trees[0],trees[1],trees[2],trees[3],null);
+                str += "\"" + trees[2] + "\",\"" + trees[3] + "\"";
+                standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists(str));
+                standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists("\"" + trees[2] + "\""));
                 break;
             case 3:
-                standardMethodLists = standardMethodListMapper.selectStandardMethodLists(trees[0],trees[1],trees[2],null,null);
+                str += "\"" + trees[2] + "\"";
+                standardMethodLists.addAll(standardMethodListMapper.selectStandardMethodLists3(str));
                 break;
-            case 2:
-                standardMethodLists = standardMethodListMapper.selectStandardMethodLists(trees[0],trees[1],null,null,null);
-                break;
-            case 1:
-                standardMethodLists = standardMethodListMapper.selectStandardMethodLists(trees[0],null,null,null,null);
-                break;
+            default:
+                map.put("standardMethodList", null);
+                return map;
         }
-        Map<String, List<?>> map = new HashMap<>();
+
         map.put("standardMethodList", standardMethodLists);
         return map;
     }
@@ -127,16 +130,15 @@
     }
 
     @Override
-    @Transactional(rollbackFor = Exception.class)
     public int delStandardMethodByFLSSM(Integer id) {
         standardProductListMapper.delete(Wrappers.<StandardProductList>lambdaUpdate().eq(StandardProductList::getStandardMethodListId, id));
         return standardMethodListMapper.deleteById(id);
     }
-
     @Override
     public List<StandardMethodList> selectStandardMethodEnum() {
         return standardMethodListMapper.selectList(Wrappers.<StandardMethodList>lambdaQuery().select(StandardMethodList::getId,StandardMethodList::getCode,StandardMethodList::getName));
     }
+
 }
 
 

--
Gitblit v1.9.3