| | |
| | | import com.ruoyi.production.pojo.ProcessRoute; |
| | | import com.ruoyi.production.pojo.ProductOrder; |
| | | import com.ruoyi.production.service.ProductOrderService; |
| | | import com.ruoyi.sales.pojo.SalesLedgerProduct; |
| | | import com.ruoyi.sales.service.impl.SalesLedgerProductServiceImpl; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | @Autowired |
| | | private ProductOrderService productOrderService; |
| | | |
| | | @Autowired |
| | | private SalesLedgerProductServiceImpl salesLedgerProductService; |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation("添加生产订单") |
| | | public R add(@RequestBody SalesLedgerProduct salesLedgerProduct) { |
| | | salesLedgerProductService.addProductionData(salesLedgerProduct); |
| | | return R.ok(1); |
| | | } |
| | | |
| | | @ApiOperation("删除生产订单") |
| | | @DeleteMapping("/delete") |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R delete(@RequestBody List<Long> ids) { |
| | | // 批量删除产品子表 |
| | | if (!ids.isEmpty()) { |
| | | salesLedgerProductService.removeByIds(ids); |
| | | } |
| | | salesLedgerProductService.deleteProductionData(ids); |
| | | return R.ok(1); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("分页查询") |
| | | @GetMapping("page") |