|
|
|
@ -25,6 +25,7 @@ |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
package org.springblade.desk.energy.controller; |
|
|
|
package org.springblade.desk.energy.controller; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.exceptions.ExceptionUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
@ -50,6 +51,7 @@ 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; |
|
|
|
|
|
|
|
import org.springblade.desk.energy.pojo.entity.BsSafeInspectionPointEntity; |
|
|
|
import org.springblade.desk.energy.pojo.vo.BsEpciuInspectionPointVO; |
|
|
|
import org.springblade.desk.energy.pojo.vo.BsEpciuInspectionPointVO; |
|
|
|
import org.springblade.desk.energy.service.IBsEpciuInspectionPointService; |
|
|
|
import org.springblade.desk.energy.service.IBsEpciuInspectionPointService; |
|
|
|
import org.springblade.desk.energy.wrapper.BsEpciuInspectionPointWrapper; |
|
|
|
import org.springblade.desk.energy.wrapper.BsEpciuInspectionPointWrapper; |
|
|
|
@ -186,8 +188,16 @@ public class BsEpciuInspectionPointController extends BladeController { |
|
|
|
public R importExcel(@RequestParam("file") MultipartFile file) { |
|
|
|
public R importExcel(@RequestParam("file") MultipartFile file) { |
|
|
|
List<BsEpciuInspectionPointEntity> noticeList = new ArrayList<>(); |
|
|
|
List<BsEpciuInspectionPointEntity> noticeList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<BsEpciuInspectionPointExcel> list; |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
list = ExcelUtil.read(file, BsEpciuInspectionPointExcel.class); |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
// 捕获Excel读取时的类型转换异常
|
|
|
|
|
|
|
|
String errorMsg = ExceptionUtil.getMessage(e); |
|
|
|
|
|
|
|
throw new RuntimeException("Excel数据格式错误:请检查日期、数字等字段格式是否正确"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<BsEpciuInspectionPointExcel> list = ExcelUtil.read(file, BsEpciuInspectionPointExcel.class); |
|
|
|
|
|
|
|
list.forEach(noticeExcel -> { |
|
|
|
list.forEach(noticeExcel -> { |
|
|
|
if (cn.hutool.core.bean.BeanUtil.isEmpty(noticeExcel) || StrUtil.isEmpty(noticeExcel.getInsNum()) |
|
|
|
if (cn.hutool.core.bean.BeanUtil.isEmpty(noticeExcel) || StrUtil.isEmpty(noticeExcel.getInsNum()) |
|
|
|
|| noticeExcel.getInsNum().contains("注")){ |
|
|
|
|| noticeExcel.getInsNum().contains("注")){ |
|
|
|
|