From 0e1722e96e5483d560eda8f1cf96282955d4f224 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期四, 27 七月 2023 15:04:40 +0800
Subject: [PATCH] 检验模块

---
 inspection-server/src/main/java/com/yuanchu/limslaboratory/controller/PlanController.java |   58 +++++++++++++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 47 insertions(+), 11 deletions(-)

diff --git a/inspection-server/src/main/java/com/yuanchu/limslaboratory/controller/PlanController.java b/inspection-server/src/main/java/com/yuanchu/limslaboratory/controller/PlanController.java
index 4067891..3d2fb9e 100644
--- a/inspection-server/src/main/java/com/yuanchu/limslaboratory/controller/PlanController.java
+++ b/inspection-server/src/main/java/com/yuanchu/limslaboratory/controller/PlanController.java
@@ -1,8 +1,12 @@
 package com.yuanchu.limslaboratory.controller;
 
 
-import com.yuanchu.limslaboratory.pojo.Plan;
+import com.yuanchu.limslaboratory.pojo.InspectionProductList;
+import com.yuanchu.limslaboratory.pojo.Instrument;
+import com.yuanchu.limslaboratory.pojo.Product;
+import com.yuanchu.limslaboratory.pojo.dto.InspectionProductListDto;
 import com.yuanchu.limslaboratory.service.PlanService;
+import com.yuanchu.limslaboratory.service.ProductService;
 import com.yuanchu.limslaboratory.vo.Result;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
@@ -20,7 +24,7 @@
  * @author 姹熻嫃榈烽洀缃戠粶绉戞妧鏈夐檺鍏徃
  * @since 2023-07-17
  */
-@Api(tags = "妫�楠屾ā鍧�")
+@Api(tags = "妫�楠屾ā鍧�-->妫�楠岃鍒�")
 @RestController
 @RequestMapping("/plan")
 public class PlanController {
@@ -28,7 +32,10 @@
     @Resource
     private PlanService planService;
 
-    @ApiOperation("鏌ヨ鎵�鏈夋楠岃鍒掕〃")
+    @Resource
+    ProductService productService;
+
+    @ApiOperation("鏌ヨ鎵�鏈夋楠岃鍒掑垎閰�")
     @ApiImplicitParams(value = {
             @ApiImplicitParam(name = "pageSize", value = "椤垫暟", dataTypeClass = Integer.class, required = true),
             @ApiImplicitParam(name = "countSize", value = "鏉℃暟/椤�", dataTypeClass = Integer.class, required = true),
@@ -39,21 +46,50 @@
         return Result.success(planService.selectAllPlan(pageSize, countSize, state));
     }
 
-    @ApiOperation("鏌ヨ妫�楠岃鍒掗噷闈㈢殑鍒嗛厤淇℃伅")
+    @ApiOperation("鏍规嵁椤圭洰鍚嶆煡璇㈡墍鏈夎瘯楠屾柟娉�")
+    @GetMapping("/selectInstrumentByProname")
+    public Result selectInstrumentByProname(String name) {
+        return Result.success(productService.selectInstrumentByProname(name));
+    }
+
+    @ApiOperation("閫夋嫨璇曢獙鏂规硶")
     @ApiImplicitParams(value = {
-            @ApiImplicitParam(name = "id", value = "鏍峰搧缂栧彿", dataTypeClass = Integer.class, required = true)
+            @ApiImplicitParam(name = "id", value = "椤圭洰id", dataTypeClass = Integer.class, required = true),
     })
-    @PutMapping("/selectPlanById/{id}")
-    public Result selectPlanById(@PathVariable Integer id) {
-        return Result.success(planService.selectById(id));
+    @PostMapping("/selectProMethodById")
+    public Result selectProMethodById(Integer id) {
+        Product product = productService.getById(id);
+        return Result.success(product.getMethod());
+    }
+
+    @ApiOperation("鍒嗛厤妫�楠岃鍒掍腑鍒嗛厤椤圭洰")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "id", value = "妫�楠屾牱鍝両D", dataTypeClass = Integer.class, required = true),
+    })
+    @PutMapping("/upPlan/{id}")
+    public Result upPlan(@PathVariable Integer id ,@RequestBody InspectionProductListDto inspectionProductListDto) {
+        planService.upPlan(id,inspectionProductListDto);
+        return Result.success();
     }
 
     @ApiOperation("浣滃簾妫�楠岃鍒�")
     @ApiImplicitParams(value = {
             @ApiImplicitParam(name = "id", value = "妫�楠岃鍒扞D", dataTypeClass = Integer.class, required = true),
     })
-    @PostMapping("/delPlan")
-    public Result delPlan(Integer id) {
-        return Result.success(planService.delPlan(id));
+    @PutMapping("/delPlan/{id}")
+    public Result delPlan(@PathVariable Integer id) {
+        planService.delPlan(id);
+        return Result.success();
+    }
+
+    @ApiOperation("鏌ヨ鎴愬搧妫�楠�")
+    @ApiImplicitParams(value = {
+            @ApiImplicitParam(name = "pageSize", value = "椤垫暟", dataTypeClass = Integer.class, required = true),
+            @ApiImplicitParam(name = "countSize", value = "鏉℃暟/椤�", dataTypeClass = Integer.class, required = true),
+            @ApiImplicitParam(name = "state", value = "鐘舵��(涓虹┖=鍏ㄩ儴)", dataTypeClass = Integer.class)
+    })
+    @GetMapping("/selectInspection")
+    public Result selectInspection(int pageSize, int countSize, Integer state) {
+        return Result.success(planService.selectInspection(pageSize,countSize,state));
     }
 }

--
Gitblit v1.9.3