| | |
| | | package com.ruoyi.appendix.controller; |
| | | |
| | | import com.ruoyi.appendix.dto.ProductStructureInstanceDto; |
| | | import com.ruoyi.appendix.service.ProductStructureInstanceService; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import io.swagger.annotations.Api; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <br> |
| | |
| | | @RestController |
| | | @RequestMapping("/productStructureInstance") |
| | | public class ProductStructureInstanceController { |
| | | |
| | | @Resource |
| | | private ProductStructureInstanceService productStructureInstanceService; |
| | | |
| | | @GetMapping("/getBomStructs/{orderId}") |
| | | @ApiOperation("根据生产订单ID获取绑定的BOM子集结构树") |
| | | public AjaxResult getBomStructs(@PathVariable Long orderId) { |
| | | List<ProductStructureInstanceDto> list = productStructureInstanceService.listByOrderId(orderId); |
| | | return AjaxResult.success(list); |
| | | } |
| | | |
| | | @PutMapping("/addOrUpdateBomStructs") |
| | | @ApiOperation("新增/更新BOM子集结构") |
| | | public AjaxResult addOrUpdateBomStructs(@RequestBody ProductStructureInstanceDto instanceDto) { |
| | | productStructureInstanceService.addOrUpdateBomStructs(instanceDto); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | } |