| | |
| | | package com.yuanchu.mom.controller; |
| | | |
| | | |
| | | import com.yuanchu.mom.pojo.dto.MbomDto; |
| | | import com.yuanchu.mom.pojo.dto.ProductDto; |
| | | 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.MbomService; |
| | | |
| | |
| | | @Autowired |
| | | private MbomService mbomService; |
| | | |
| | | @ApiOperation("右上角新增-->物料清单-->选择工序,工艺") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "specificationsId", value = "型号id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "version", value = "当前版本", dataTypeClass = Integer.class, required = true) |
| | | }) |
| | | @GetMapping("/chooseTech") |
| | | public Result<?> chooseTech(Integer specificationsId,Integer version) { |
| | | return Result.success(mbomService.chooseTech(specificationsId,version)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("右上角新增-->物料清单") |
| | | @PostMapping("/add") |
| | | public Result<?> addMbom(@Validated @RequestBody MbomDto mbomDto) { |
| | | mbomService.addMbom( mbomDto); |
| | | return Result.success("添加物料清单成功"); |
| | | } |
| | | |
| | | @ApiOperation("填写数量,鼠标移开保存") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "物料清单id", dataTypeClass = Integer.class, required = true), |
| | | @ApiImplicitParam(name = "num", value = "数量", dataTypeClass = Integer.class, required = true) |
| | | |
| | | }) |
| | | @PostMapping("/write") |
| | | public Result<?> write(Integer id, Integer num) { |
| | | Integer write = mbomService.write(id, num); |
| | | if (write >= 1) { |
| | | return Result.success("更新成功"); |
| | | } |
| | | return Result.fail("更新失败"); |
| | | } |
| | | |
| | | @ApiOperation(value = "删除") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "id", value = "物料清单id", dataTypeClass = Integer.class,required = true) |
| | | }) |
| | | @PostMapping("/delMbomById") |
| | | public Result delMbomById(Integer id) { |
| | | mbomService.delMbomById(id); |
| | | return Result.success("删除"+id+"成功!"); |
| | | } |
| | | |
| | | @ApiOperation(value = "批量删除") |
| | | @ApiImplicitParams(value = { |
| | | @ApiImplicitParam(name = "ids", value = "物料清单id", dataTypeClass = String.class,required = true) |
| | | }) |
| | | @PostMapping("/delAllMbom") |
| | | public Result delAllMbom(String ids) { |
| | | mbomService.delAllMbom(ids); |
| | | return Result.success("批量删除成功!"); |
| | | } |
| | | |
| | | } |
| | | |