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 | 51 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 49 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/whyc/controller/TestPlanController.java b/src/main/java/com/whyc/controller/TestPlanController.java index 7864a08..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,10 +37,30 @@ 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 = "鏌ョ湅璇︽儏") public Response getOne(@RequestParam Integer num){ 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); } @@ -53,4 +80,24 @@ return service.startPlan(num); } + @PutMapping("delete") + @ApiOperation(value = "鍒犻櫎浣滃簾") + public Response deletePlan(@RequestParam int num){ + return service.deletePlan(num); + } + @PutMapping("stop") + @ApiOperation(value = "鍋滄璁″垝") + public Response stopPlan(@RequestParam int num){ + return service.stopPlan(num); + } + @PutMapping("verified") + @ApiOperation(value = "瀹℃牳璁″垝") + public Response verifiedPlan(@RequestParam int num,@RequestParam String verifier){ + return service.verifiedPlan(num,verifier); + } + + + + + } -- Gitblit v1.9.1