| | |
| | | package com.ruoyi.production.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | @GetMapping("/listPage") |
| | | @Log(title = "BOM-分页查询", businessType = BusinessType.OTHER) |
| | | @ApiOperation("BOM-分页查询") |
| | | public AjaxResult listPage(Page page, ProductBomDto productBomDto) { |
| | | public AjaxResult listPage(Page<ProductBom> page, ProductBomDto productBomDto) { |
| | | IPage<ProductBomDto> listPage = productBomService.listPage(page, productBomDto); |
| | | return AjaxResult.success(listPage); |
| | | } |
| | |
| | | return AjaxResult.success(productBoms); |
| | | } |
| | | |
| | | @GetMapping("/getDictCode") |
| | | @Log(title = "BOM-根据选择的产品型号查询存在的bom", businessType = BusinessType.OTHER) |
| | | @ApiOperation("BOM-根据选择的产品型号查询存在的bom") |
| | | public AjaxResult getDictCode(Long dictCode) { |
| | | List<ProductBom> bomList = productBomService.list(new LambdaQueryWrapper<ProductBom>().eq(ProductBom::getDictCode, dictCode)); |
| | | return AjaxResult.success(bomList); |
| | | } |
| | | |
| | | |
| | | @PostMapping("uploadBom") |
| | | @PreAuthorize("@ss.hasPermi('product:bom:import')") |
| | | @Log(title = "根据Excel导入BOM", businessType = BusinessType.IMPORT) |
| | | @ApiOperation("根据Excel导入BOM") |
| | | public AjaxResult uploadBom(@RequestParam("file") MultipartFile file) { |
| | | return productBomService.uploadBom(file); |
| | | public AjaxResult uploadBom(@RequestParam("file") MultipartFile file, @RequestParam("dictCode") Long dictCode) { |
| | | return productBomService.uploadBom(file, dictCode); |
| | | } |
| | | |
| | | @PostMapping("exportBom") |