From a92b6f6175b1401071e5fb3bd9fab8a2a3b72011 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期五, 01 九月 2023 14:34:28 +0800
Subject: [PATCH] version
---
inspection-server/src/main/java/com/yuanchu/limslaboratory/controller/InspectionController.java | 81 ++++++++++++++++++++++++++++++++++++++--
1 files changed, 76 insertions(+), 5 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 bd72e5d..61d5a17 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,11 @@
import java.util.*;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+import com.yuanchu.limslaboratory.annotation.AuthHandler;
+import com.yuanchu.limslaboratory.enums.InterfaceType;
+import com.yuanchu.limslaboratory.enums.MenuEnums;
+import com.yuanchu.limslaboratory.mapper.InstrumentMapper;
+import com.yuanchu.limslaboratory.mapper.UserMapper;
import com.yuanchu.limslaboratory.pojo.Inspection;
import com.yuanchu.limslaboratory.pojo.Report;
import com.yuanchu.limslaboratory.pojo.vo.InspectionVo;
@@ -19,6 +24,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;
@@ -45,6 +51,12 @@
@Resource
LinkBasicInformationService linkBasicInformationService;
+ @Resource
+ UserMapper userMapper;
+
+ @Resource
+ private InstrumentMapper instrumentMapper;
+
@ApiOperation(value = "鏌ヨ妫�楠岀敵璇峰崟鍒楄〃")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "pageSize", value = "椤垫暟", dataTypeClass = Integer.class, required = true),
@@ -52,6 +64,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<>();
@@ -66,25 +79,52 @@
@ApiImplicitParam(name = "type", value = "绫诲瀷", dataTypeClass = Integer.class, required = true)
})
@GetMapping("/selectAll")
+ @AuthHandler
public Result selectAll(Integer type) {
switch (type) {
case 0:
//鍘熸潗鏂�
return Result.success(rawMaterialService.selectRawmaAll());
- case 1:
+ case 2:
//濮旀墭鍗�
return Result.success(linkBasicInformationService.selectLinkAll());
- case 2:
+ case 1:
//鎴愬搧妫�楠�
return Result.success("璇疯緭鍏ユ楠屼俊鎭�!");
}
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 {
+ @AuthHandler
+ public Result addInspect(@RequestHeader("X-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));
@@ -95,8 +135,39 @@
@ApiImplicitParam(name = "id", value = "妫�楠屽崟id", dataTypeClass = Integer.class, required = true)
})
@GetMapping("/selectInspectsListById")
+ @AuthHandler
public Result selectInspectsListById(Integer id) {
return Result.success(inspectionService.selectInspectsListById(id));
+ }
+
+ @ApiOperation(value = "閫夋嫨妫�楠岄」鐩殑璐d换浜�")
+ @GetMapping("/selectUser")
+ @AuthHandler
+ public Result selectUser() {
+ return Result.success(userMapper.selectUser());
+ }
+
+ @ApiOperation(value = "閫夋嫨妫�楠岃澶�")
+ @GetMapping("/selectEquipment")
+ @AuthHandler
+ public Result selectEquipment(){return Result.success(instrumentMapper.getInstrument());}
+
+ @ApiOperation(value = "淇濆瓨妫�楠岄」鐩矗浠讳汉")
+ @ApiImplicitParams(value = {
+ @ApiImplicitParam(name = "id", value = "妫�楠屽崟椤圭洰id", dataTypeClass = Integer.class, required = true),
+ @ApiImplicitParam(name = "userProId", value = "璐d换浜篿d", dataTypeClass = Integer.class, required = true)
+ })
+ @GetMapping("/chooseUseProId")
+ @AuthHandler
+ public Result chooseUseProId(Integer id, Integer userProId) {
+ return Result.success(inspectionService.chooseUseProId(id, userProId));
+ }
+
+ @ApiOperation("淇濆瓨璁惧id")
+ @GetMapping("/chooseEquipment")
+ @AuthHandler
+ public Result chooseEquipment(Integer id,Integer equipmentId){
+ return Result.success(inspectionService.chooseEquipment(id, equipmentId));
}
@ApiOperation(value = "浣滃簾妫�楠屽崟")
@@ -104,10 +175,10 @@
@ApiImplicitParam(name = "id", value = "妫�楠屽崟id", dataTypeClass = Integer.class, required = true)
})
@PostMapping("/delInspect")
- public Result delInspect(Integer id) {
+ @AuthHandler
+ public Result delInspect(Integer id) {
return Result.success(inspectionService.delInspect(id));
}
-
}
--
Gitblit v1.9.3