From cbf4b74927fe51c19c307d89b326ae999cb6a165 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期二, 12 九月 2023 17:50:25 +0800
Subject: [PATCH] 修改   9.12

---
 standard-server/src/main/java/com/yuanchu/mom/service/impl/TechnologyServiceImpl.java |   33 ++++++++++++++-------------------
 1 files changed, 14 insertions(+), 19 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..c70ee4b 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>
@@ -69,10 +71,9 @@
 
     //鍙充笂瑙掓柊澧�-->宸ヨ壓璺嚎
     @Override
-    public void addTechnology(Integer specificationsId, TechnologyDto technologyDto) {
+    public void addTechnology(TechnologyDto technologyDto) {
         Technology technology = new Technology();
         BeanUtils.copyProperties(technologyDto, technology);
-        technology.setSpecificationsId(specificationsId);
         technologyMapper.insert(technology);
     }
 
@@ -83,21 +84,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();
     }
 
     //鍒犻櫎
@@ -130,4 +116,13 @@
         //鎵归噺鍒犻櫎鐢熶骇宸ヨ壓琛�
         techniqueMapper.delAllByTecId(ids);
     }
+
+    //閫夋嫨璁惧缁�,榧犳爣绉诲紑淇濆瓨
+    @Override
+    public Integer writeDevice(Integer id, String deviceGroup) {
+        Technology technology = new Technology();
+        technology.setId(id);
+        technology.setDeviceGroup(deviceGroup);
+        return technologyMapper.updateById(technology);
+    }
 }

--
Gitblit v1.9.3