| | |
| | | package com.gkhy.exam.system.service.impl; |
| | | |
| | | import cn.hutool.core.collection.ListUtil; |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gkhy.exam.common.api.CommonPage; |
| | |
| | | return CommonResult.failed(errorBuilder.toString()); |
| | | } |
| | | |
| | | List<List<CompanyIndustryTemplate>> split = ListUtil.split(companyIndustryTemplates, 50); |
| | | for (List<CompanyIndustryTemplate> industryTemplates : split) { |
| | | int affectedRows = companyIndustryTemplateMapper.insertIndustrys(industryTemplates); |
| | | } |
| | | // 8. 批量插入 |
| | | int affectedRows = companyIndustryTemplateMapper.insertIndustrys(companyIndustryTemplates); |
| | | // int affectedRows = companyIndustryTemplateMapper.insertIndustrys(companyIndustryTemplates); |
| | | workbook.close(); |
| | | |
| | | if (affectedRows < 1) { |
| | | throw new ApiException("导入行业模版失败"); |
| | | } |
| | | // if (affectedRows < 1) { |
| | | // throw new ApiException("导入行业模版失败"); |
| | | // } |
| | | return CommonResult.success(); |
| | | } |
| | | // 安全获取单元格值 |