From 9fe4b53620f1ea0a4278240a7acee7bc4ef739c6 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期四, 07 九月 2023 15:29:53 +0800
Subject: [PATCH] 修改bug9.7

---
 standard-server/src/main/java/com/yuanchu/mom/service/impl/TechnologyServiceImpl.java |   31 ++++++++++++++-----------------
 1 files changed, 14 insertions(+), 17 deletions(-)

diff --git a/standard-server/src/main/java/com/yuanchu/mom/service/impl/TechnologyServiceImpl.java b/standard-server/src/main/java/com/yuanchu/mom/service/impl/TechnologyServiceImpl.java
index f713884..43b8597 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/service/impl/TechnologyServiceImpl.java
+++ b/standard-server/src/main/java/com/yuanchu/mom/service/impl/TechnologyServiceImpl.java
@@ -4,17 +4,19 @@
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.yuanchu.mom.mapper.*;
-import com.yuanchu.mom.pojo.Technology;
+import com.yuanchu.mom.pojo.*;
 import com.yuanchu.mom.pojo.dto.TechnologyDto;
-import com.yuanchu.mom.service.TechnologyService;
+import com.yuanchu.mom.service.*;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.beans.BeanUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 /**
  * <p>
@@ -40,7 +42,16 @@
     MbomMapper mbomMapper;
 
     @Resource
+    MbomService mbomService;
+
+    @Resource
     TechniqueMapper techniqueMapper;
+
+    @Resource
+    ProductService productService;
+
+    @Resource
+    TechniqueService techniqueService;
 
 
     //鏍规嵁鍨嬪彿id鏌ヨ鐗堟湰
@@ -69,6 +80,7 @@
 
     //鍙充笂瑙掓柊澧�-->宸ヨ壓璺嚎
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public void addTechnology(Integer specificationsId, TechnologyDto technologyDto) {
         Technology technology = new Technology();
         BeanUtils.copyProperties(technologyDto, technology);
@@ -83,21 +95,6 @@
         technology.setId(id);
         technology.setProductionQuota(productionQuota);
         return technologyMapper.updateById(technology);
-    }
-
-    //娣诲姞鍚屼竴涓瀷鍙峰伐鑹鸿矾绾跨殑鐗堟湰
-    @Override
-    public Integer addVersion(Integer specificationsId, Integer version) {
-        List<Technology> technologyList = technologyMapper.selectList(Wrappers.<Technology>query()
-                .eq("specifications_id", specificationsId)
-                .eq("version", version));
-        for (Technology technology : technologyList) {
-            technology.setId(null);
-            //鏈�鏂扮増鏈�+!
-            technology.setVersion(technologyMapper.selectVerByTec(specificationsId).get(0) + 1);
-        }
-        saveBatch(technologyList);
-        return technologyList.get(0).getVersion();
     }
 
     //鍒犻櫎

--
Gitblit v1.9.3