| | |
| | | |
| | | import cn.hutool.core.lang.UUID; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | * 作废文件销魂记录 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author 芯导软件(江苏)有限公司 |
| | | * @author |
| | | * @since 2024-11-13 01:27:22 |
| | | */ |
| | | @Service |
| | |
| | | OutputStream outputStream = new FileOutputStream(file); |
| | | IOUtils.copy(inputStream, outputStream); |
| | | url = file.getAbsolutePath(); |
| | | inputStream.close(); |
| | | outputStream.close(); |
| | | } catch (FileNotFoundException e) { |
| | | throw new ErrorException("找不到模板文件"); |
| | | } catch (IOException e) { |
| | |
| | | for (int i = 1; i < rows.size(); i++) { // 从第二行开始,跳过表头 |
| | | XWPFTableRow row = rows.get(i); |
| | | if (row.getTableCells().size() != 10) { |
| | | System.out.println("行 " + (i + 1) + " 的列数不匹配,跳过该行"); |
| | | continue; |
| | | } |
| | | if (ObjectUtils.isNotEmpty(row.getCell(1).getText())) { |
| | |
| | | } |
| | | } |
| | | } |
| | | if(CollectionUtils.isEmpty(manageRecordCancelList)){ |
| | | throw new RuntimeException("导入模板有误"); |
| | | } |
| | | saveOrUpdateBatch(manageRecordCancelList); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |