From c86fdc9cad7ad8beaa71f2601cf160021a6ea3e0 Mon Sep 17 00:00:00 2001
From: value <z1292839451@163.com>
Date: 星期一, 28 八月 2023 10:51:04 +0800
Subject: [PATCH] 增加一个vo字段
---
inspection-server/src/main/java/com/yuanchu/limslaboratory/controller/InspectionController.java | 37 +++++++++++++++++++++++++++++++++----
1 files changed, 33 insertions(+), 4 deletions(-)
diff --git a/inspection-server/src/main/java/com/yuanchu/limslaboratory/controller/InspectionController.java b/inspection-server/src/main/java/com/yuanchu/limslaboratory/controller/InspectionController.java
index 321f720..7d0ee78 100644
--- a/inspection-server/src/main/java/com/yuanchu/limslaboratory/controller/InspectionController.java
+++ b/inspection-server/src/main/java/com/yuanchu/limslaboratory/controller/InspectionController.java
@@ -6,6 +6,7 @@
import java.util.*;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.yuanchu.limslaboratory.annotation.AuthHandler;
import com.yuanchu.limslaboratory.mapper.UserMapper;
import com.yuanchu.limslaboratory.pojo.Inspection;
import com.yuanchu.limslaboratory.pojo.Report;
@@ -20,6 +21,7 @@
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.limslaboratory.service.InspectionService;
@@ -56,6 +58,7 @@
@ApiImplicitParam(name = "message", value = "鐢宠鍗曞彿/鍘熸潗鏂欏悕绉�", dataTypeClass = String.class)
})
@GetMapping("/selectInspectsList")
+ @AuthHandler
public Result selectInspectsList(int pageSize, int countSize, String message) {
IPage<Map<String, Object>> inspectionPage = inspectionService.selectInspectsList(new Page<Object>(pageSize, countSize), message);
Map<String, Object> map = new HashMap<>();
@@ -70,6 +73,7 @@
@ApiImplicitParam(name = "type", value = "绫诲瀷", dataTypeClass = Integer.class, required = true)
})
@GetMapping("/selectAll")
+ @AuthHandler
public Result selectAll(Integer type) {
switch (type) {
case 0:
@@ -85,10 +89,35 @@
return Result.fail("绫诲瀷閿欒!");
}
+ @ApiOperation(value = "鏂板妫�楠屽崟-->閫夋嫨妫�楠岄」鐩増鏈�")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "name", value = "浜у搧鍚嶇О", dataTypeClass = String.class, required = true),
+ @ApiImplicitParam(name = "mcode", value = "浜у搧缂栧彿", dataTypeClass = String.class, required = true),
+ @ApiImplicitParam(name = "specifications", value = "瑙勬牸鍨嬪彿", dataTypeClass = String.class, required = true)
+ })
+ @GetMapping("/chooseVer")
+ @AuthHandler
+ public Result chooseVer(String name, String mcode, String specifications) {
+ return Result.success(inspectionService.chooseVer(name, mcode, specifications));
+ }
+ @ApiOperation(value = "鏂板妫�楠屽崟-->閫夋嫨妫�楠岄」鐩増鏈�-->鏌ョ湅璇ョ増鏈笅鎴戜滑瑕佸仛鐨勯」鐩姹�")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "name", value = "浜у搧鍚嶇О", dataTypeClass = String.class, required = true),
+ @ApiImplicitParam(name = "mcode", value = "浜у搧缂栧彿", dataTypeClass = String.class, required = true),
+ @ApiImplicitParam(name = "specifications", value = "瑙勬牸鍨嬪彿", dataTypeClass = String.class, required = true),
+ @ApiImplicitParam(name = "version", value = "鐗堟湰(榛樿鏈�鏂扮増鏈�)", dataTypeClass = Integer.class,required = true ),
+ @ApiImplicitParam(name = "experiment", value = "璇曢獙椤圭洰(濮旀墭涓撳睘)", dataTypeClass = String.class )
+ })
+ @GetMapping("/lookProByVer")
+ @AuthHandler
+ public Result lookProByVer(String name, String mcode, String specifications,Integer version,String experiment) {
+ return Result.success(inspectionService.lookProByVer(name, mcode, specifications,version,experiment));
+ }
+
@ApiOperation(value = "鏂板妫�楠屽崟")
@PostMapping("/addInspect")
- public Result addInspect(@RequestHeader("token") String token, @RequestBody InspectionVo inspectionVo) throws Exception {
+ public Result addInspect(@RequestHeader("token") String token, @Validated @RequestBody InspectionVo inspectionVo) throws Exception {
Object object = RedisUtil.get(token);
Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class);
return Result.success(inspectionService.addInspect((Integer) unmarshal.get("id"), inspectionVo));
@@ -115,8 +144,8 @@
@ApiImplicitParam(name = "userProId", value = "璐d换浜篿d", dataTypeClass = Integer.class, required = true)
})
@GetMapping("/chooseUseProId")
- public Result chooseUseProId(Integer id,Integer userProId) {
- return Result.success(inspectionService.chooseUseProId(id,userProId));
+ public Result chooseUseProId(Integer id, Integer userProId) {
+ return Result.success(inspectionService.chooseUseProId(id, userProId));
}
@ApiOperation(value = "浣滃簾妫�楠屽崟")
@@ -124,7 +153,7 @@
@ApiImplicitParam(name = "id", value = "妫�楠屽崟id", dataTypeClass = Integer.class, required = true)
})
@PostMapping("/delInspect")
- public Result delInspect(Integer id) {
+ public Result delInspect(Integer id) {
return Result.success(inspectionService.delInspect(id));
}
--
Gitblit v1.9.3