|
@@ -1,6 +1,5 @@
|
|
|
package com.qmth.themis.business.util;
|
|
|
|
|
|
-import com.qmth.themis.business.annotation.ExcelNotNull;
|
|
|
import com.qmth.themis.business.annotation.ExcelNote;
|
|
|
import com.qmth.themis.business.constant.SystemConstant;
|
|
|
import com.qmth.themis.common.enums.ExceptionResultEnum;
|
|
@@ -13,6 +12,7 @@ import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.util.LinkedMultiValueMap;
|
|
|
|
|
|
+import javax.validation.constraints.NotNull;
|
|
|
import java.io.IOException;
|
|
|
import java.io.InputStream;
|
|
|
import java.lang.annotation.Annotation;
|
|
@@ -83,7 +83,7 @@ public class ExcelUtil {
|
|
|
if (j < fields.length - 1) {
|
|
|
fields[j].setAccessible(true);
|
|
|
fields[j].set(o, obj);
|
|
|
- Annotation annotation = fields[j].getAnnotation(ExcelNotNull.class);
|
|
|
+ Annotation annotation = fields[j].getAnnotation(NotNull.class);
|
|
|
ExcelNote note = fields[j].getAnnotation(ExcelNote.class);
|
|
|
if (Objects.isNull(obj) && Objects.nonNull(annotation)) {
|
|
|
excelErrorList.add(y, new ExcelError(j + 1, "excel第" + (y + 1) + "个sheet第" + (j + 1) + "行[" + note.value() + "]为空"));
|
|
@@ -106,7 +106,7 @@ public class ExcelUtil {
|
|
|
} else {
|
|
|
fields[j].setAccessible(true);
|
|
|
fields[j].set(o, obj);
|
|
|
- Annotation annotation = fields[j].getAnnotation(ExcelNotNull.class);
|
|
|
+ Annotation annotation = fields[j].getAnnotation(NotNull.class);
|
|
|
ExcelNote note = fields[j].getAnnotation(ExcelNote.class);
|
|
|
if (Objects.isNull(obj) && Objects.nonNull(annotation)) {
|
|
|
excelErrorList.add(y, new ExcelError(i + 1, "excel第" + (y + 1) + "个sheet第" + (i + 1) + "行[" + note.value() + "]为空"));
|
|
@@ -195,7 +195,7 @@ public class ExcelUtil {
|
|
|
for (int i = 0; i < fields.length; i++) {
|
|
|
Field field = fields[i];
|
|
|
field.setAccessible(true);
|
|
|
- Annotation annotation = field.getAnnotation(ExcelNotNull.class);
|
|
|
+ Annotation annotation = field.getAnnotation(NotNull.class);
|
|
|
ExcelNote note = field.getAnnotation(ExcelNote.class);
|
|
|
if (Objects.isNull(field.get(obj)) && Objects.nonNull(annotation)) {
|
|
|
excelErrorList.add(new ExcelError(index + 1, "excel第" + (sheetIndex + 1) + "个sheet第" + (index + 1) + "行[" + note.value() + "]为空"));
|