From 7d64716cb0d406f21cde03976fd273bd07fdc06f Mon Sep 17 00:00:00 2001
From: whycxzp <perryhsu@163.com>
Date: 星期二, 28 九月 2021 11:44:28 +0800
Subject: [PATCH] 更新用户-角色-菜单-权限

---
 src/main/java/com/whyc/controller/TestPlanController.java |   33 ++++++++++++++++++++++++++++-----
 1 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/src/main/java/com/whyc/controller/TestPlanController.java b/src/main/java/com/whyc/controller/TestPlanController.java
index cc61f64..6ee0129 100644
--- a/src/main/java/com/whyc/controller/TestPlanController.java
+++ b/src/main/java/com/whyc/controller/TestPlanController.java
@@ -1,9 +1,10 @@
 package com.whyc.controller;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.github.pagehelper.PageInfo;
 import com.whyc.dto.Response;
+import com.whyc.pojo.DeviceInf;
 import com.whyc.pojo.TestPlan;
+import com.whyc.service.DeviceInfService;
 import com.whyc.service.TestPlanService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -11,13 +12,19 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.ArrayList;
+import java.util.List;
+
 @RestController
 @RequestMapping("testPlan")
-@Api(tags = "璇曢獙璁″垝/璇曢獙缁撹")
+@Api(tags = "璇曢獙璁″垝銆佽瘯楠岀粨璁�")
 @Slf4j
 public class TestPlanController {
     @Autowired
     private TestPlanService service;
+    @Autowired
+    private DeviceInfService deviceInfService;
+
 
     @GetMapping("all")
     @ApiOperation(value = "鏌ヨ鎵�鏈�-鍒嗛〉")
@@ -30,9 +37,11 @@
         return service.getPageByCondition(pageNum,pageSize,testPlan);
     }
 
-
-
-
+    @PostMapping("conclusion")
+    @ApiOperation(value = "璇曢獙缁撹鏌ヨ鍒嗛〉-鏍规嵁绛涢�夋潯浠�")
+    public Response<IPage<TestPlan>> getConclusion(@RequestParam int pageNum, @RequestParam int pageSize, @RequestBody TestPlan testPlan){
+        return service.getConclusion(pageNum,pageSize,testPlan);
+    }
 
     @GetMapping
     @ApiOperation(value = "鏌ョ湅璇︽儏")
@@ -40,6 +49,20 @@
         return service.getOne(num);
     }
 
+    @GetMapping("getDeviceInf")
+    @ApiOperation(value = "璁惧淇℃伅")
+    public Response getDeviceInf(@RequestParam Integer num){
+        TestPlan testPlan = service.getOneById(num);
+        String devices = testPlan.getDevices();
+        String[] ids = devices.split(",");
+        List<DeviceInf> list = new ArrayList<>();
+        for (String deviceId:ids) {
+            DeviceInf deviceInf = deviceInfService.getOneByDeviceId(Integer.valueOf(deviceId));
+            list.add(deviceInf);
+        }
+        return new Response().set(1,list);
+    }
+
 
     @PostMapping
     @ApiOperation(value = "鏂板")

--
Gitblit v1.9.1