| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | |
| | | import com.yuanchu.mom.pojo.dto.ProductDto; |
| | | import com.yuanchu.mom.pojo.dto.TechnologyDto; |
| | | import com.yuanchu.mom.service.ProductService; |
| | | import com.yuanchu.mom.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | |
| | | 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 java.util.List; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @Api(tags = "技术管理-->标准BOM-->技术指标(检验项目)") |
| | | @RestController |
| | |
| | | @Autowired |
| | | private ProductService productService; |
| | | |
| | | @ApiOperation("右上角新增-->技术指标-->选择工序,工艺") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "specificationsId", value = "型号id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/chooseTech") |
| | | public Result<?> chooseTech(Integer specificationsId) { |
| | | return Result.success(productService.chooseTech(specificationsId)); |
| | | } |
| | | |
| | | @ApiOperation("右上角新增-->技术指标-->选择项目父类") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "technologyId", value = "工艺路线id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/chooseFather") |
| | | public Result<?> chooseFather(Integer technologyId) { |
| | | return Result.success(productService.chooseFather(technologyId)); |
| | | } |
| | | |
| | | @ApiOperation("右上角新增-->技术指标") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "technologyId", value = "工艺路线id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/add") |
| | | public Result<?> addProduct(Integer technologyId, @Validated @RequestBody ProductDto productDto) { |
| | | productService.addProduct(technologyId, productDto); |
| | | return Result.success("添加技术指标【" + productDto.getName() + "】成功"); |
| | | } |
| | | |
| | | @ApiOperation("填写标准值与内控值,鼠标移开保存") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "技术指标id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "required", value = "标准值", dataTypeClass = String.class, required = true), |
| | | @ApiImplicitParam(name = "internal", value = "内控值", dataTypeClass = String.class, required = true) |
| | | |
| | | }) |
| | | @PostMapping("/write") |
| | | public Result<?> write(Integer id, String required, String internal) { |
| | | return Result.success(productService.write(id, required, internal)); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "技术指标id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/delTechById") |
| | | public Result delProById(Integer id) { |
| | | productService.delProById(id); |
| | | return Result.success("删除" + id + "成功!"); |
| | | } |
| | | |
| | | @ApiOperation(value = "批量删除") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "ids", value = "技术指标id", dataTypeClass = String.class, required = true) |
| | | }) |
| | | @PostMapping("/delAllPro") |
| | | public Result delAllPro(String ids) { |
| | | productService.delAllPro(ids); |
| | | return Result.success("批量删除成功!"); |
| | | } |
| | | |
| | | } |