| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.dto.AddStandardDto; |
| | | import com.yuanchu.limslaboratory.service.StandardService; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | |
| | | * @author 江苏鵷雏网络科技有限公司 |
| | | * @since 2023-07-11 |
| | | */ |
| | | @Api(tags = "标准库-->2、标准") |
| | | @Api(tags = "标准库-->2、规格(标准)") |
| | | @RestController |
| | | @RequestMapping("/standards") |
| | | public class StandardController { |
| | |
| | | @Autowired |
| | | private StandardService standardService; |
| | | |
| | | @ApiOperation("根据ID删除数据") |
| | | @ApiOperation("添加物料") |
| | | @PostMapping("/add") |
| | | public Result<?> addStandardInformation(@Validated @RequestBody AddStandardDto addStandardDto) { |
| | | Integer isMaterialSuccess = standardService.addStandardInformation(addStandardDto); |
| | | if (isMaterialSuccess == 1) { |
| | | return Result.success("添加物料【"+ addStandardDto.getStandardName() +"】成功!"); |
| | | } |
| | | return Result.fail("添加物料【"+ addStandardDto.getStandardName() +"】失败!"); |
| | | } |
| | | |
| | | @ApiOperation("根据ID删规格") |
| | | @DeleteMapping("/delete") |
| | | public Result<?> deleteStandardsInformation(String standardsId) { |
| | | Integer isDeleteSuccess = standardService.deleteStandardsInformation(standardsId); |
| | | if (isDeleteSuccess == 1){ |
| | | public Result<?> deleteStandardsInformation(Integer standardsId) { |
| | | Integer isDeleteMaterialSuccess = standardService.deleteStandardInformation(standardsId); |
| | | if (isDeleteMaterialSuccess == 1) { |
| | | return Result.success("删除成功!"); |
| | | } |
| | | return Result.fail("删除失败!"); |