From 21c22f67b526c446b9f12c2365ec9c0fcab8cec8 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期二, 22 八月 2023 17:51:09 +0800
Subject: [PATCH] 改动7.0
---
inspection-server/src/main/java/com/yuanchu/limslaboratory/controller/InspectionController.java | 66 +++++++++++++++------------------
1 files changed, 30 insertions(+), 36 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 dd191cd..29ed397 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,7 +6,9 @@
import java.util.*;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
+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;
import com.yuanchu.limslaboratory.service.LinkBasicInformationService;
import com.yuanchu.limslaboratory.service.RawMaterialService;
@@ -21,6 +23,7 @@
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.limslaboratory.service.InspectionService;
+
import javax.annotation.Resource;
/**
@@ -42,6 +45,9 @@
@Resource
LinkBasicInformationService linkBasicInformationService;
+
+ @Resource
+ UserMapper userMapper;
@ApiOperation(value = "鏌ヨ妫�楠岀敵璇峰崟鍒楄〃")
@ApiImplicitParams(value = {
@@ -66,40 +72,17 @@
@GetMapping("/selectAll")
public Result selectAll(Integer type) {
switch (type) {
- case 0 :
+ 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 = "id", value = "鍘熸潗鏂欐姤妫�鍗昳d", dataTypeClass = Integer.class, required = true),
- @ApiImplicitParam(name = "startTime", value = "妫�楠屽紑濮嬫棩鏈�", dataTypeClass = String.class, required = true),
- @ApiImplicitParam(name = "endTime", value = "妫�楠岀粨鏉熸棩鏈�", dataTypeClass = String.class, required = true)
- })
- @GetMapping("/selectRawmaById")
- public Result selectRawmaById(Integer id, String startTime, String endTime) throws ParseException {
- return Result.success(rawMaterialService.selectRawmaById(id,startTime,endTime));
- }
-
-
- @ApiOperation(value = "閫夋嫨濮旀墭鎶ユ鍜屾牱鍝�")
- @ApiImplicitParams(value = {
- @ApiImplicitParam(name = "bid", value = "濮旀墭鎶ユ鍗昳d", dataTypeClass = Integer.class, required = true),
- @ApiImplicitParam(name = "did", value = "濮旀墭鎶ユ鏍峰搧id", dataTypeClass = Integer.class, required = true)
- })
- @GetMapping("/selectLinkByid")
- public Result selectLinkByid(Integer bid, Integer did) {
- return Result.success(linkBasicInformationService.selectLinkByid(bid, did));
}
@@ -111,7 +94,7 @@
return Result.success(inspectionService.addInspect((Integer) unmarshal.get("id"), inspectionVo));
}
- @ApiOperation(value = "鏍规嵁妫�楠屽崟id鏌ヨ鍘熸潗鏂欐楠屽崟璇︽儏")
+ @ApiOperation(value = "鏍规嵁妫�楠屽崟id鏌ヨ妫�楠屽崟璇︽儏")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "id", value = "妫�楠屽崟id", dataTypeClass = Integer.class, required = true)
})
@@ -120,18 +103,29 @@
return Result.success(inspectionService.selectInspectsListById(id));
}
- @ApiOperation(value = "涓婃姤(鏇存柊妫�楠岀姸鎬�)")
+ @ApiOperation(value = "閫夋嫨妫�楠岄」鐩殑璐d换浜�")
+ @GetMapping("/selectUser")
+ public Result selectUser() {
+ return Result.success(userMapper.selectUser());
+ }
+
+ @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")
+ public Result chooseUseProId(Integer id,Integer userProId) {
+ return Result.success(inspectionService.chooseUseProId(id,userProId));
+ }
+
+ @ApiOperation(value = "浣滃簾妫�楠屽崟")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "id", value = "妫�楠屽崟id", dataTypeClass = Integer.class, required = true)
})
- @PostMapping("/updateInspectsById")
- public Result updateInspectsById(Integer id) {
- //濡傛灉宸茬粡涓婃姤浜嗕笉鑳藉啀涓�娆′笂鎶�
- Inspection inspection = inspectionService.getById(id);
- if (ObjectUtils.isNotEmpty(inspection.getInspectionStatus())) {
- return Result.fail("宸茬粡涓婃姤杩囦簡,涓嶈兘鍐嶆涓婃姤!");
- }
- return Result.success(inspectionService.updateInspectsById(id));
+ @PostMapping("/delInspect")
+ public Result delInspect(Integer id) {
+ return Result.success(inspectionService.delInspect(id));
}
--
Gitblit v1.9.3