|
@@ -49,6 +49,8 @@ import org.springframework.validation.BindingResult;
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
|
|
+import java.util.function.Function;
|
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 训练营(KxsCamp)表服务实现类
|
|
* 训练营(KxsCamp)表服务实现类
|
|
@@ -110,6 +112,16 @@ public class KxsCampServiceImpl extends ServiceImpl<KxsCampMapper, KxsCamp> impl
|
|
|
if (campUserExcelVOList.isEmpty()) {
|
|
if (campUserExcelVOList.isEmpty()) {
|
|
|
return R.failed(SysErrorTypeEnum.IMPORT_EMPTY.getDescription());
|
|
return R.failed(SysErrorTypeEnum.IMPORT_EMPTY.getDescription());
|
|
|
}
|
|
}
|
|
|
|
|
+ //判断是否有重复创客
|
|
|
|
|
+ boolean hasDuplicates = campUserExcelVOList.stream()
|
|
|
|
|
+ .map(CampUserExcelVO::getUserCode)
|
|
|
|
|
+ .collect(Collectors.groupingBy(Function.identity(), Collectors.counting()))
|
|
|
|
|
+ .entrySet()
|
|
|
|
|
+ .stream()
|
|
|
|
|
+ .anyMatch(e -> e.getValue() > 1);
|
|
|
|
|
+ if(hasDuplicates){
|
|
|
|
|
+ return R.failed("导入数据中存在重复的创客编码,请检查后重新导入");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// 通用校验获取失败的数据
|
|
// 通用校验获取失败的数据
|
|
|
List<ErrorMessage> errorMessageList = (List<ErrorMessage>) bindingResult.getTarget();
|
|
List<ErrorMessage> errorMessageList = (List<ErrorMessage>) bindingResult.getTarget();
|