|
@@ -386,17 +386,20 @@ public class AdminGodownEntryController {
|
|
|
params.setNeedSave( true );
|
|
|
try {
|
|
|
List<AdminRscode> adminRscodeArrayList = new ArrayList<>( );
|
|
|
-
|
|
|
- List<SYMCode> list = ExcelImportUtil.importExcel( file.getInputStream(), SYMCode.class, params );
|
|
|
+ // excel表格中的数据
|
|
|
+ List<SYMCode> excelDatalist = ExcelImportUtil.importExcel( file.getInputStream(), SYMCode.class, params );
|
|
|
+ // 过滤后excel表格中的数据
|
|
|
+ List<SYMCode> list = new ArrayList<>();
|
|
|
List<SYMCode> list3 = new ArrayList<>( );
|
|
|
- if (list.size() == 0) {
|
|
|
+ if (excelDatalist.size() == 0) {
|
|
|
return Result.error( "文件导入失败:查不到了文件数据,或者文件数据格式错误!" );
|
|
|
} else {
|
|
|
//先判断导入文件里面的溯源码有没有重复的
|
|
|
// int listSize = list.size();
|
|
|
// int finalIa = ia;
|
|
|
// boolean b = list.stream().allMatch( list2 -> list2.getRetrospectiveSourceCode().equals( list.get( finalIa ).getRetrospectiveSourceCode() ) );
|
|
|
-
|
|
|
+ // 去除空的对象
|
|
|
+ list = excelDatalist.stream().filter(item -> item != null && !Strings.isNullOrEmpty(item.getRetrospectiveSourceCode()) && !Strings.isNullOrEmpty(item.getName())).collect(Collectors.toList());
|
|
|
// 根据指定属性分组,并统计数量(key:指定属性,value:数量)
|
|
|
Map<String, Long> mapGroup =
|
|
|
list.stream().collect(Collectors.groupingBy(lists -> lists.getRetrospectiveSourceCode(),
|