From 2dbc49184bd74845c8da694c20d6fd03d7ac87e0 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期四, 21 九月 2023 16:16:21 +0800
Subject: [PATCH] 修改   9.21

---
 standard-server/src/main/java/com/yuanchu/mom/controller/TechnologyController.java |   83 ++++++++++++++++++++++++++++++++++++++---
 1 files changed, 76 insertions(+), 7 deletions(-)

diff --git a/standard-server/src/main/java/com/yuanchu/mom/controller/TechnologyController.java b/standard-server/src/main/java/com/yuanchu/mom/controller/TechnologyController.java
index b56b93d..b8824bd 100644
--- a/standard-server/src/main/java/com/yuanchu/mom/controller/TechnologyController.java
+++ b/standard-server/src/main/java/com/yuanchu/mom/controller/TechnologyController.java
@@ -1,6 +1,7 @@
 package com.yuanchu.mom.controller;
 
 
+import com.yuanchu.mom.pojo.dto.TechnologyDto;
 import com.yuanchu.mom.service.TechnologyService;
 import com.yuanchu.mom.vo.Result;
 import io.swagger.annotations.Api;
@@ -8,17 +9,13 @@
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
 
-import org.springframework.web.bind.annotation.RestController;
-
-import java.util.List;
-import java.util.Map;
 
 /**
  * <p>
- *  鍓嶇鎺у埗鍣�
+ * 鍓嶇鎺у埗鍣�
  * </p>
  *
  * @author 姹熻嫃榈烽洀缃戠粶绉戞妧鏈夐檺鍏徃
@@ -32,5 +29,77 @@
     @Autowired
     private TechnologyService technologyService;
 
+    @ApiOperation("鍙充笂瑙掓柊澧�-->宸ヨ壓璺嚎-->閫夋嫨鐢熶骇璁惧缁�")
+    @GetMapping("/chooseDevice")
+    public Result<?> chooseDevice() {
+        return Result.success(technologyService.chooseDevice());
+    }
 
+    @ApiOperation("鍙充笂瑙掓柊澧�-->宸ヨ壓璺嚎-->閫夋嫨宸ュ簭")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "specificationsId", value = "鍨嬪彿id", dataTypeClass = Integer.class, required = true),
+            @ApiImplicitParam(name = "version", value = "鐗堟湰", dataTypeClass = Integer.class, required = true)
+    })
+    @GetMapping("/chooseFather")
+    public Result<?> chooseFather(Integer specificationsId,Integer version) {
+        return Result.success(technologyService.chooseFather(specificationsId,version));
+    }
+
+    @ApiOperation("鍙充笂瑙掓柊澧�-->宸ヨ壓璺嚎")
+    @PostMapping("/add")
+    public Result<?> addTechnology(@Validated @RequestBody TechnologyDto technologyDto) {
+        return Result.success(technologyService.addTechnology(technologyDto));
+    }
+
+    @ApiOperation("濉啓鐢熶骇瀹氶,榧犳爣绉诲紑淇濆瓨")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "id", value = "宸ヨ壓璺嚎id", dataTypeClass = Integer.class, required = true),
+            @ApiImplicitParam(name = "productionQuota", value = "鐢熶骇瀹氶(涓�/澶�)", dataTypeClass = Integer.class, required = true)
+
+    })
+    @PostMapping("/write")
+    public Result<?> write(Integer id, Integer productionQuota) {
+        Integer write = technologyService.write(id, productionQuota);
+        if (write >= 1) {
+            return Result.success("鏇存柊鎴愬姛");
+        }
+        return Result.fail("鏇存柊澶辫触");
+    }
+
+    @ApiOperation("閫夋嫨璁惧缁�,榧犳爣绉诲紑淇濆瓨")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "id", value = "宸ヨ壓璺嚎id", dataTypeClass = Integer.class, required = true),
+            @ApiImplicitParam(name = "deviceGroup", value = "璁惧缁�", dataTypeClass = String.class, required = true)
+
+    })
+    @PostMapping("/writeDevice")
+    public Result<?> writeDevice(Integer id, String deviceGroup) {
+        Integer write = technologyService.writeDevice(id, deviceGroup);
+        if (write >= 1) {
+            return Result.success("鏇存柊鎴愬姛");
+        }
+        return Result.fail("鏇存柊澶辫触");
+    }
+
+
+    @ApiOperation(value = "鍒犻櫎")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "id", value = "宸ヨ壓璺嚎id", dataTypeClass = Integer.class,required = true)
+    })
+    @PostMapping("/delTechById")
+    public Result delTechById(Integer id) {
+        technologyService.delTechById(id);
+        return Result.success("鍒犻櫎"+id+"鎴愬姛!");
+    }
+
+    @ApiOperation(value = "鎵归噺鍒犻櫎")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "ids", value = "宸ヨ壓璺嚎id", dataTypeClass = String.class,required = true)
+    })
+    @PostMapping("/delAllTech")
+    public Result delAllTech(String ids) {
+        technologyService.delAllTech(ids);
+        return Result.success("鎵归噺鍒犻櫎鎴愬姛!");
+    }
 }
+

--
Gitblit v1.9.3