| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.basic.dto.ProductDto; |
| | | import com.ruoyi.basic.dto.ProductModelDto; |
| | | import com.ruoyi.basic.dto.ProductModelExportDto; |
| | | import com.ruoyi.basic.dto.ProductTreeDto; |
| | | import com.ruoyi.basic.pojo.ProductModel; |
| | | import com.ruoyi.basic.service.IProductModelService; |
| | | import com.ruoyi.basic.service.IProductService; |
| | | 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.controller.BaseController; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | |
| | | /** |
| | | * 导入产品 |
| | | */ |
| | | @PostMapping("/import") |
| | | @Log(title = "导入产品",businessType = BusinessType.IMPORT) |
| | | @PostMapping("import") |
| | | public AjaxResult importProduct(MultipartFile file) { |
| | | return AjaxResult.success(productModelService.importProduct(file)); |
| | | public AjaxResult importProductModel(@RequestParam("file") MultipartFile file, Integer productId) { |
| | | return productModelService.importProductModel(file, productId); |
| | | } |
| | | |
| | | /** |
| | | * 产品导入模板 |
| | | */ |
| | | @GetMapping("/export") |
| | | @ApiOperation("产品导入模板") |
| | | @Log(title = "产品导入模板", businessType = BusinessType.EXPORT) |
| | | public void importProduct(HttpServletResponse response) { |
| | | ExcelUtil<ProductModelExportDto> excelUtil = new ExcelUtil<>(ProductModelExportDto.class); |
| | | excelUtil.importTemplateExcel(response, "产品规格导入模板"); |
| | | } |
| | | } |