From cdaff9ab0d1b676e3b429171d6de0887c98f488c Mon Sep 17 00:00:00 2001
From: XiaoRuby <3114200645@qq.com>
Date: 星期三, 26 七月 2023 09:15:31 +0800
Subject: [PATCH] LIMS管理系统框架-开发7-26标准库修改前
---
standard-server/src/main/java/com/yuanchu/limslaboratory/controller/SpecificationsController.java | 73 ------------------------------------
1 files changed, 1 insertions(+), 72 deletions(-)
diff --git a/standard-server/src/main/java/com/yuanchu/limslaboratory/controller/SpecificationsController.java b/standard-server/src/main/java/com/yuanchu/limslaboratory/controller/SpecificationsController.java
index 6b7ff99..bfc1627 100644
--- a/standard-server/src/main/java/com/yuanchu/limslaboratory/controller/SpecificationsController.java
+++ b/standard-server/src/main/java/com/yuanchu/limslaboratory/controller/SpecificationsController.java
@@ -1,26 +1,14 @@
package com.yuanchu.limslaboratory.controller;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.yuanchu.limslaboratory.pojo.Specifications;
import com.yuanchu.limslaboratory.service.SpecificationsService;
-import com.yuanchu.limslaboratory.utils.JackSonUtil;
-import com.yuanchu.limslaboratory.utils.RedisUtil;
import com.yuanchu.limslaboratory.vo.Result;
-import com.yuanchu.limslaboratory.pojo.dto.UpdateSpeStateSpecificationsDto;
-import com.yuanchu.limslaboratory.pojo.dto.UpdateSpecificationsInformationDto;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Objects;
/**
* <p>
@@ -30,62 +18,13 @@
* @author 姹熻嫃榈烽洀缃戠粶绉戞妧鏈夐檺鍏徃
* @since 2023-07-11
*/
-@Api(tags = "鏍囧噯搴�-->3銆佸瀷鍙�-->浜у搧瑙勬牸")
+@Api(tags = "鏍囧噯搴�-->3銆佷骇鍝佽鏍�")
@RestController
@RequestMapping("/specifications")
public class SpecificationsController {
@Autowired
private SpecificationsService specificationsService;
-
- @ApiOperation("娣诲姞浜у搧瑙勬牸")
- @PostMapping("/add")
- public Result<?> addSpecificationsInformation(@RequestHeader("X-Token") String token,@RequestBody Specifications specifications) throws Exception {
- Object object = RedisUtil.get(token);
- Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class);
- specifications.setUserId((Integer) unmarshal.get("id"));
- Integer isStandardsSuccess = specificationsService.addSpecificationsInformation(specifications);
- if (isStandardsSuccess == 1) {
- return Result.success("娣诲姞銆�"+ specifications.getName() +"銆戞垚鍔燂紒");
- }
- return Result.fail("娣诲姞銆�"+ specifications.getName() +"銆戝け璐ワ紒");
- }
-
- @ApiOperation("鏍规嵁鍨嬪彿鏌ヨ浜у搧瑙勬牸")
- @ApiImplicitParams(value = {
- @ApiImplicitParam(name = "pageNo", value = "璧峰椤�", dataTypeClass = Integer.class, required = true),
- @ApiImplicitParam(name = "pageSize", value = "姣忎竴椤垫暟閲�", dataTypeClass = Integer.class, required = true),
- @ApiImplicitParam(name = "specificationsName", value = "瑙勬牸鍚嶇О", dataTypeClass = String.class),
- @ApiImplicitParam(name = "serialNumberId", value = "鍨嬪彿ID", dataTypeClass = String.class,required = true)
- })
- @GetMapping("/list")
- public Result<?> listSpecificationsInformation(Integer pageNo,
- Integer pageSize,
- String specificationsName,
- String serialNumberId){
- IPage<Map<String, Objects>> pageList= specificationsService.listSpecificationsInformation(specificationsName,serialNumberId,new Page<Objects>(pageNo, pageSize));
- Map<String, Object> map = new HashMap<>();
- map.put("row", pageList.getRecords());
- map.put("total", pageList.getTotal());
- return Result.success(map);
- }
-
- @ApiOperation("缂栬緫浜у搧瑙勬牸")
- @PutMapping("/update")
- public Result<?> updateSpecificationsInformation(@RequestHeader("X-Token") String token, @RequestBody UpdateSpecificationsInformationDto updateSpecificationsInformationDto) throws Exception {
- Object object = RedisUtil.get(token);
- if (ObjectUtils.isEmpty(object)){
- return Result.fail("瀵逛笉璧凤紝璇锋惡甯oken!");
- }
- Map<String, Object> unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(object), Map.class);
- updateSpecificationsInformationDto.setUserId((Integer) unmarshal.get("id"));
- Specifications specifications = JackSonUtil.unmarshal(JackSonUtil.marshal(updateSpecificationsInformationDto), Specifications.class);
- Integer isStandardsSuccess = specificationsService.updateSpecificationsInformation(specifications);
- if (isStandardsSuccess == 1) {
- return Result.success("鏇存柊銆�"+ specifications.getName() +"銆戞垚鍔燂紒");
- }
- return Result.fail("鏇存柊銆�"+ specifications.getName() +"銆戝け璐ワ紒");
- }
@ApiOperation("鍒犻櫎浜у搧瑙勬牸")
@ApiImplicitParams(value = {
@@ -98,15 +37,5 @@
return Result.success("鍒犻櫎鎴愬姛锛�");
}
return Result.fail("鍒犻櫎澶辫触锛�");
- }
-
- @ApiOperation("鏇存柊瑙勬牸鐘舵��")
- @PutMapping("/update_spe_state")
- public Result<?> updateSpeStateSpecifications(@RequestBody UpdateSpeStateSpecificationsDto updateSpeStateSpecificationsDto) {
- Integer isStandardsSuccess = specificationsService.updateSpeStateSpecifications(updateSpeStateSpecificationsDto);
- if (isStandardsSuccess == 1) {
- return Result.success("鎿嶄綔鎴愬姛锛�");
- }
- return Result.fail("鎿嶄綔澶辫触锛�");
}
}
--
Gitblit v1.9.3