| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | |
| | | import com.yuanchu.mom.pojo.dto.ProductDto; |
| | | import com.yuanchu.mom.pojo.dto.TechniqueDto; |
| | | import com.yuanchu.mom.vo.Result; |
| | | 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.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.yuanchu.mom.service.TechniqueService; |
| | | |
| | |
| | | @Autowired |
| | | private TechniqueService techniqueService; |
| | | |
| | | @ApiOperation("右上角新增-->生产工艺-->选择工序,工艺") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "specificationsId", value = "型号id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/chooseTech") |
| | | public Result<?> chooseTech(Integer specificationsId) { |
| | | return Result.success(techniqueService.chooseTech(specificationsId)); |
| | | } |
| | | |
| | | @ApiOperation("右上角新增-->生产工艺-->选择设备") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "technologyId", value = "工艺路线id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/chooseDev") |
| | | public Result<?> chooseDev(Integer technologyId) { |
| | | return Result.success(techniqueService.chooseDev(technologyId)); |
| | | } |
| | | |
| | | @ApiOperation("右上角新增-->生产工艺-->选择项目(父子),单位") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "technologyId", value = "工艺路线id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/choosePro") |
| | | public Result<?> choosePro(Integer technologyId) { |
| | | return Result.success(techniqueService.choosePro(technologyId)); |
| | | } |
| | | |
| | | @ApiOperation("右上角新增-->生产工艺") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "technologyId", value = "工艺路线id", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/add") |
| | | public Result<?> addTechnique(Integer technologyId, @Validated @RequestBody TechniqueDto techniqueDto) { |
| | | techniqueService.addTechnique(technologyId, techniqueDto); |
| | | return Result.success("添加生产工艺成功"); |
| | | } |
| | | |
| | | @ApiOperation("添加同一个型号生产工艺的版本") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "specificationsId", value = "型号id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "version", value = "当前版本", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @PostMapping("/addVersion") |
| | | public Result<?> addVersion(Integer specificationsId,Integer version ) { |
| | | Integer version1 = techniqueService.addVersion(specificationsId,version); |
| | | return Result.success("添加型号"+specificationsId+"的生产工艺版本"+version1+"成功"); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "生产工艺id", dataTypeClass = Integer.class,required = true) |
| | | }) |
| | | @PostMapping("/delTeqById") |
| | | public Result delTeqById(Integer id) { |
| | | techniqueService.delTeqById(id); |
| | | return Result.success("删除"+id+"成功!"); |
| | | } |
| | | |
| | | @ApiOperation(value = "批量删除") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "ids", value = "生产工艺id", dataTypeClass = String.class,required = true) |
| | | }) |
| | | @PostMapping("/delAllTeq") |
| | | public Result delAllTeq(String ids) { |
| | | techniqueService.delAllTeq(ids); |
| | | return Result.success("批量删除成功!"); |
| | | } |
| | | |
| | | } |
| | | |