| | |
| | | package com.vincent.rsf.server.manager.controller; |
| | | |
| | | import cn.afterturn.easypoi.excel.ExcelImportUtil; |
| | | import cn.afterturn.easypoi.excel.entity.ImportParams; |
| | | import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult; |
| | | import cn.afterturn.easypoi.excel.imports.ExcelImportService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | |
| | |
| | | ExcelUtil.build(ExcelUtil.create(matnrService.list(), Matnr.class), response); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:matnr:save')") |
| | | @ApiOperation(value = "excel表格导入物料信息") |
| | | @PostMapping("/matnr/import") |
| | | public R listImport(MultipartFile file) { |
| | | try { |
| | | ExcelImportResult<Matnr> objectExcelImportResult = ExcelImportUtil.importExcelMore(file.getInputStream(), Matnr.class, ExcelUtil.getDefaultImportParams()); |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |