| | |
| | | import com.ruoyi.production.bean.vo.ProductionOrderVo; |
| | | import com.ruoyi.production.pojo.ProductionOrder; |
| | | import com.ruoyi.production.service.ProductionOrderService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | |
| | | @RestController |
| | | @RequestMapping("/productionOrder") |
| | | @Api(tags = "生产订单") |
| | | @Tag(name = "生产订单") |
| | | @RequiredArgsConstructor |
| | | public class ProductionOrderController { |
| | | |
| | | private final ProductionOrderService productionOrderService; |
| | | |
| | | @GetMapping("/page") |
| | | @ApiOperation("分页查询") |
| | | @Operation(summary = "分页查询") |
| | | public R page(ProductionOrderDto dto, Page<ProductionOrderDto> page) { |
| | | return R.ok(productionOrderService.pageProductionOrder(page, dto)); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation("生产订单列表") |
| | | @Operation(summary = "生产订单列表") |
| | | public R<List<ProductionOrderVo>> list(ProductionOrderDto dto) { |
| | | return R.ok(productionOrderService.listProductionOrder(dto)); |
| | | } |
| | | |
| | | @GetMapping("/{id}") |
| | | @ApiOperation("生产订单详情") |
| | | @Operation(summary = "生产订单详情") |
| | | public R<ProductionOrderVo> getInfo(@PathVariable("id") Long id) { |
| | | return R.ok(productionOrderService.getProductionOrderInfo(id)); |
| | | } |
| | | |
| | | @PostMapping |
| | | @ApiOperation("新增生产订单") |
| | | @Operation(summary = "新增生产订单") |
| | | public R<Boolean> add(@RequestBody ProductionOrder productionOrder) { |
| | | return R.ok(productionOrderService.saveProductionOrder(productionOrder)); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation("修改生产订单") |
| | | @Operation(summary = "修改生产订单") |
| | | public R<Boolean> edit(@RequestBody ProductionOrder productionOrder) { |
| | | return R.ok(productionOrderService.saveProductionOrder(productionOrder)); |
| | | } |
| | | |
| | | @PostMapping("/syncSnapshot/{id}") |
| | | @ApiOperation("同步生产订单工艺/BOM快照") |
| | | @Operation(summary = "同步生产订单工艺/BOM快照") |
| | | public R<Integer> syncSnapshot(@PathVariable("id") Long id) { |
| | | return R.ok(productionOrderService.syncProductionOrderSnapshot(id)); |
| | | } |
| | | |
| | | @DeleteMapping("/delete") |
| | | @ApiOperation("删除生产订单") |
| | | @Operation(summary = "删除生产订单") |
| | | public R<Boolean> remove(@RequestBody List<Long> ids) { |
| | | return R.ok(productionOrderService.removeProductionOrder(ids)); |
| | | } |