|
|
|
@ -41,8 +41,11 @@ import org.springblade.core.mp.support.Query; |
|
|
|
import org.springblade.core.secure.BladeUser; |
|
|
|
import org.springblade.core.secure.BladeUser; |
|
|
|
import org.springblade.core.secure.annotation.IsAdmin; |
|
|
|
import org.springblade.core.secure.annotation.IsAdmin; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
|
|
|
import org.springblade.core.tool.utils.BeanUtil; |
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
|
|
|
|
import org.springblade.desk.basic.excel.CoatingThicknessExcel; |
|
|
|
|
|
|
|
import org.springblade.desk.basic.pojo.entity.CoatingThickness; |
|
|
|
import org.springblade.desk.basic.util.ExcelExtUtil; |
|
|
|
import org.springblade.desk.basic.util.ExcelExtUtil; |
|
|
|
import org.springblade.desk.energy.excel.BsEpciuInspectionPointExcel; |
|
|
|
import org.springblade.desk.energy.excel.BsEpciuInspectionPointExcel; |
|
|
|
import org.springblade.desk.energy.pojo.entity.BsEpciuInspectionPointEntity; |
|
|
|
import org.springblade.desk.energy.pojo.entity.BsEpciuInspectionPointEntity; |
|
|
|
@ -54,6 +57,7 @@ import org.springframework.http.ResponseEntity; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
@ -179,14 +183,24 @@ public class BsEpciuInspectionPointController extends BladeController { |
|
|
|
@ApiOperationSupport(order = 11) |
|
|
|
@ApiOperationSupport(order = 11) |
|
|
|
@Operation(summary = "导入Excel", description = "MultipartFile") |
|
|
|
@Operation(summary = "导入Excel", description = "MultipartFile") |
|
|
|
public R importExcel(@RequestParam("file") MultipartFile file) { |
|
|
|
public R importExcel(@RequestParam("file") MultipartFile file) { |
|
|
|
R checkR = ExcelExtUtil.importExcelCheck(file); |
|
|
|
List<BsEpciuInspectionPointEntity> noticeList = new ArrayList<>(); |
|
|
|
if (checkR != null) { |
|
|
|
|
|
|
|
return checkR; |
|
|
|
|
|
|
|
} |
|
|
|
List<BsEpciuInspectionPointExcel> list = ExcelUtil.read(file, BsEpciuInspectionPointExcel.class); |
|
|
|
List<BsEpciuInspectionPointEntity> importList = ExcelUtil.read( |
|
|
|
list.forEach(noticeExcel -> { |
|
|
|
file, 0, 1, BsEpciuInspectionPointEntity.class |
|
|
|
BsEpciuInspectionPointEntity notice = BeanUtil.copy(noticeExcel, BsEpciuInspectionPointEntity.class); |
|
|
|
); |
|
|
|
noticeList.add(notice); |
|
|
|
return R.status(bsEpciuInspectionPointService.saveBatch(importList)); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// R checkR = ExcelExtUtil.importExcelCheck(file);
|
|
|
|
|
|
|
|
// if (checkR != null) {
|
|
|
|
|
|
|
|
// return checkR;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// List<BsEpciuInspectionPointEntity> importList = ExcelUtil.read(
|
|
|
|
|
|
|
|
// file, 0, 1, BsEpciuInspectionPointEntity.class
|
|
|
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
return R.status(bsEpciuInspectionPointService.saveBatch(noticeList)); |
|
|
|
} |
|
|
|
} |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 环保巡检点配置表 批量新增 |
|
|
|
* 环保巡检点配置表 批量新增 |
|
|
|
|