From 75d81c7784c30a10568c7880d51f2584c441e110 Mon Sep 17 00:00:00 2001
From: 李林 <z1292839451@163.com>
Date: 星期三, 13 三月 2024 14:15:50 +0800
Subject: [PATCH] 功能调整

---
 inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardTreeServiceImpl.java |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardTreeServiceImpl.java b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardTreeServiceImpl.java
index a7432b1..fe4ec92 100644
--- a/inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardTreeServiceImpl.java
+++ b/inspect-server/src/main/java/com/yuanchu/mom/service/impl/StandardTreeServiceImpl.java
@@ -45,7 +45,19 @@
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public int addStandardTree(StandardTree standardTree) {
+        if(standardTree.getSample()!=null){
+            List<StandardProductList> list = standardTreeMapper.getStandardProductListBySample(standardTree.getSampleType());
+            for (StandardProductList standardProductList : list) {
+                standardProductList.setFactory(standardTree.getFactory());
+                standardProductList.setLaboratory(standardTree.getLaboratory());
+                standardProductList.setSampleType(standardTree.getSampleType());
+                standardProductList.setSample(standardTree.getSample());
+                standardProductList.setModel(standardTree.getModel());
+                standardProductListMapper.insert(standardProductList);
+            }
+        }
         return standardTreeMapper.insert(standardTree);
     }
 

--
Gitblit v1.9.3