| | |
| | | package com.ruoyi.production.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.basic.pojo.Customer; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.production.dto.ProductOrderDto; |
| | | import com.ruoyi.production.pojo.ProcessRoute; |
| | | import com.ruoyi.production.pojo.ProductOrder; |
| | | import com.ruoyi.production.service.ProductOrderService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | @RequestMapping("productOrder") |
| | | @RestController |
| | | @Api(tags = "生产订单") |
| | | public class ProductOrderController { |
| | | |
| | | @Autowired |
| | |
| | | return R.ok(productOrderService.pageProductOrder(page, productOrder)); |
| | | } |
| | | |
| | | @ApiOperation("绑定工艺路线") |
| | | @PostMapping("/bindingRoute") |
| | | public R bindingRoute(@RequestBody ProductOrder productOrder) { |
| | | return R.ok(productOrderService.bindingRoute(productOrder)); |
| | | } |
| | | |
| | | @ApiOperation("查询规格型号对应的工艺路线") |
| | | @GetMapping("/listProcessRoute") |
| | | public R listProcessRoute(Long productModelId) { |
| | | return R.ok(productOrderService.listProcessRoute(productModelId)); |
| | | } |
| | | |
| | | /** |
| | | * 导出生产订单 |
| | | */ |
| | | @Log(title = "生产订单", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, ProductOrderDto productOrderDto) { |
| | | List<ProductOrderDto> list; |
| | | list = productOrderService.pageProductOrder(new Page<>(1, -1), productOrderDto).getRecords(); |
| | | ExcelUtil<ProductOrderDto> util = new ExcelUtil<ProductOrderDto>(ProductOrderDto.class); |
| | | util.exportExcel(response, list, "生产订单数据"); |
| | | } |
| | | |
| | | @ApiOperation("查询生产订单对应的BOM") |
| | | @GetMapping("/listProcessBom") |
| | | public R listProcessBom(Long orderId) { |
| | | return R.ok(productOrderService.listProcessBom(orderId)); |
| | | } |
| | | |
| | | |
| | | } |