| | |
| | | package com.ruoyi.production.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.production.dto.ProductProcessDto; |
| | | import com.ruoyi.production.dto.ProductStructureDto; |
| | | import com.ruoyi.production.pojo.ProductStructure; |
| | | import com.ruoyi.production.service.ProductStructureService; |
| | |
| | | |
| | | @RequestMapping("productStructure") |
| | | @RestController |
| | | @Api(tags = "产品结构") |
| | | @Api(tags = "BOM") |
| | | public class ProductStructureController { |
| | | @Autowired |
| | | private ProductStructureService productStructureService; |
| | | |
| | | |
| | | @ApiOperation("根据productId查询") |
| | | @GetMapping("listByproductModelId") |
| | | public R listByproductModelId( Long productModelId){ |
| | | return R.ok(productStructureService.listByproductModelId( productModelId)); |
| | | } |
| | | |
| | | @ApiOperation("新增产品结构") |
| | | @ApiOperation("新增BOM") |
| | | @PostMapping() |
| | | public R add(@RequestBody ProductStructure productStructure){ |
| | | return R.ok(productStructureService.save(productStructure)); |
| | | public R addOrUpdate(@RequestBody ProductStructureDto productStructureDto){ |
| | | return R.ok(productStructureService.addProductStructureDto(productStructureDto)); |
| | | } |
| | | |
| | | @ApiOperation("修改产品结构") |
| | | @PutMapping() |
| | | public R update(@RequestBody ProductStructure productStructure){ |
| | | return R.ok(productStructureService.updateById(productStructure)); |
| | | } |
| | | |
| | | @ApiOperation("删除产品结构") |
| | | @DeleteMapping("/{ids}") |
| | | public R delete(@PathVariable("ids") Long[] ids){ |
| | | return R.ok(productStructureService.removeBatchByIds(Arrays.asList(ids))); |
| | | @ApiOperation("BOM查看详情") |
| | | @GetMapping("/listBybomId/{bomId}") |
| | | public R listBybomId( @PathVariable("bomId") Long bomId){ |
| | | return R.ok(productStructureService.listBybomId(bomId)); |
| | | } |
| | | } |