|
|
@@ -196,6 +196,10 @@ public class ExcelServiceImpl implements ExcelService{
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
+ //如果为数字类型且为空默认赋值0
|
|
|
+ if ("number".equals(set.getType()) && StringUtils.isEmpty(value)) {
|
|
|
+ value = "0";
|
|
|
+ }
|
|
|
//插入主表数据
|
|
|
if (null != mainData) {
|
|
|
mainData.put(set.getField(), value);
|
|
|
@@ -230,6 +234,10 @@ public class ExcelServiceImpl implements ExcelService{
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
+ //如果为数字类型且为空默认赋值0
|
|
|
+ if ("number".equals(set.getType()) && StringUtils.isEmpty(value)) {
|
|
|
+ value = "0";
|
|
|
+ }
|
|
|
//拼从表数据
|
|
|
detailData.put(set.getField(), value);
|
|
|
}
|
|
|
@@ -239,7 +247,10 @@ public class ExcelServiceImpl implements ExcelService{
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- dataImportDetailMapper.insertSelective(dd);
|
|
|
+ //排除编号未填写但是其他字段填写的情况
|
|
|
+ if (StringUtils.hasText(codeValue)) {
|
|
|
+ dataImportDetailMapper.insertSelective(dd);
|
|
|
+ }
|
|
|
}
|
|
|
//重复编号检测
|
|
|
List<String> samecode = getDuplicateElements(validateCode);
|