| | |
| | | import com.zy.asrs.entity.MatCode; |
| | | import com.zy.asrs.entity.MatCodePrint; |
| | | import com.zy.asrs.service.MatCodeService; |
| | | import com.zy.asrs.utils.VersionUtils; |
| | | import com.zy.common.CodeRes; |
| | | import com.zy.common.config.AdminInterceptor; |
| | | import com.zy.common.utils.BarcodeUtils; |
| | |
| | | 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; |
| | | |
| | |
| | | List<MatCode> list = matCodeService.selectList(new EntityWrapper<>()); |
| | | List<MatCodeExcel> excels = new ArrayList<>(); |
| | | for (MatCode matCode : list) { |
| | | MatCodeExcel excel = new MatCodeExcel(); |
| | | excel.setMatNo(matCode.getMatNo()); |
| | | excel.setBarcode(matCode.getBarcode()); |
| | | excel.setMatName(matCode.getMatName()); |
| | | excel.setStr1(matCode.getStr1()); |
| | | MatCodeExcel excel = VersionUtils.getExcel(matCode); |
| | | 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(); |