|  |  |  | 
|---|
|  |  |  | import com.zy.common.utils.excel.matcode.MatCodeExcelListener; | 
|---|
|  |  |  | import com.zy.common.web.BaseController; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.transaction.annotation.Transactional; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.*; | 
|---|
|  |  |  | import org.springframework.web.multipart.MultipartFile; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | EntityWrapper<MatCode> wrapper = new EntityWrapper<>(); | 
|---|
|  |  |  | convert(param, wrapper); | 
|---|
|  |  |  | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} | 
|---|
|  |  |  | else { | 
|---|
|  |  |  | wrapper.orderBy("modi_time", false); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return R.ok(matCodeService.selectPage(new Page<>(curr, limit), wrapper)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | excel.setBarcode(matCode.getBarcode()); | 
|---|
|  |  |  | excel.setMatName(matCode.getMatName()); | 
|---|
|  |  |  | excel.setStr1(matCode.getStr1()); | 
|---|
|  |  |  | excel.setStr2(matCode.getStr2()); | 
|---|
|  |  |  | excels.add(excel); | 
|---|
|  |  |  | if (rowCount != null && excels.size() >= rowCount){ | 
|---|
|  |  |  | break; | 
|---|
|  |  |  | 
|---|
|  |  |  | // 导入 | 
|---|
|  |  |  | @RequestMapping(value = "/matCode/import/auth") | 
|---|
|  |  |  | @ManagerAuth(memo = "物料编码数据导入") | 
|---|
|  |  |  | @Transactional | 
|---|
|  |  |  | public R matCodeImport(MultipartFile file) throws IOException, InterruptedException { | 
|---|
|  |  |  | MatCodeExcelListener listener = new MatCodeExcelListener(getUserId()); | 
|---|
|  |  |  | EasyExcel.read(file.getInputStream(), MatCodeExcel.class, listener).sheet().doRead(); | 
|---|