| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.limslaboratory.annotation.AuthHandler; |
| | | import com.yuanchu.limslaboratory.enums.InterfaceType; |
| | | import com.yuanchu.limslaboratory.enums.MenuEnums; |
| | | import com.yuanchu.limslaboratory.pojo.RawMaterial; |
| | | import com.yuanchu.limslaboratory.service.RawMaterialService; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | |
| | | map.put("total", iPage.getTotal()); |
| | | return Result.success(map); |
| | | } |
| | | |
| | | @ApiOperation("原材料报检添加") |
| | | @PostMapping("/add") |
| | | @AuthHandler(type = InterfaceType.ADD,menuId = MenuEnums.reportForInspection,isAdd = true) |
| | | public Result<?> insertRawMaterial(@Validated @RequestBody RawMaterial rawMaterial) { |
| | | Integer integer = rawMaterialService.insertRawMaterial(rawMaterial); |
| | | if (integer >= 1) { |
| | | return Result.success("添加成功"); |
| | | } |
| | | return Result.fail("添加失败"); |
| | | } |
| | | |
| | | @ApiOperation("原材料报检删除") |
| | | @PostMapping("/delete") |
| | | @AuthHandler(type = InterfaceType.DELETE,menuId = MenuEnums.reportForInspection,isAdd = true) |
| | | public Result<?> deleteRawMaterial(String deleteId) { |
| | | Integer integer = rawMaterialService.deleteRawMaterial(deleteId); |
| | | if (integer >= 1) { |
| | | return Result.success("删除成功"); |
| | | } |
| | | return Result.fail("删除失败"); |
| | | } |
| | | } |