|
@@ -41,7 +41,7 @@ public class TeacherImportAnalysis extends DataAnalysis<TeacherImportAnalysis> {
|
|
|
private final List<String> phones = Lists.newArrayList();
|
|
|
private final List<String> idCardNos = Lists.newArrayList();
|
|
|
private final List<String> existPhones = Lists.newArrayList();
|
|
|
- private final List<String> existIdCardNos = Lists.newArrayList();
|
|
|
+// private final List<String> existIdCardNos = Lists.newArrayList();
|
|
|
public TeacherImportAnalysis(AnalysisContext context) {
|
|
|
super(context);
|
|
|
}
|
|
@@ -133,20 +133,23 @@ public class TeacherImportAnalysis extends DataAnalysis<TeacherImportAnalysis> {
|
|
|
ret.append("身份证格式不正确;");
|
|
|
}else {
|
|
|
//校验是否重复
|
|
|
- if(idCardNos.contains(item.getIdCardNo())){
|
|
|
+ /*if(idCardNos.contains(item.getIdCardNo())){
|
|
|
ret.append("身份证号重复;");
|
|
|
}else {
|
|
|
if(existIdCardNos.contains(item.getIdCardNo())){
|
|
|
ret.append("身份证号已存在;");
|
|
|
}
|
|
|
- idCardNos.add(item.getIdCardNo());
|
|
|
- }
|
|
|
+ }*/
|
|
|
+ idCardNos.add(item.getIdCardNo());
|
|
|
}
|
|
|
}
|
|
|
if (StringUtils.isEmpty(item.getSubjectName())) {
|
|
|
ret.append("老师声部不能为空;");
|
|
|
}else {
|
|
|
String[] split = item.getSubjectName().replaceAll(" ", "").replaceAll(",", ",").split(",");
|
|
|
+ if (split.length > 5) {
|
|
|
+ ret.append("声部最多选择5个;");
|
|
|
+ }
|
|
|
String subjectIds = "";
|
|
|
for (String s : split) {
|
|
|
if (!subjectMap.containsKey(s)) {
|
|
@@ -162,10 +165,14 @@ public class TeacherImportAnalysis extends DataAnalysis<TeacherImportAnalysis> {
|
|
|
if (StringUtils.isEmpty(item.getTenantName())) {
|
|
|
ret.append("机构名称不能为空;");
|
|
|
}else {
|
|
|
- if (!tenantMap.containsKey(item.getTenantName())) {
|
|
|
- ret.append("机构无效:").append(item.getTenantName());
|
|
|
+ if("平台".equals(item.getTenantName())){
|
|
|
+ item.setTenantId(-1L);
|
|
|
+ }else {
|
|
|
+ if (!tenantMap.containsKey(item.getTenantName())) {
|
|
|
+ ret.append("机构无效:").append(item.getTenantName());
|
|
|
+ }
|
|
|
+ item.setTenantId(tenantMap.get(item.getTenantName()));
|
|
|
}
|
|
|
- item.setTenantId(tenantMap.get(item.getTenantName()));
|
|
|
}
|
|
|
if (item.getIsTestUser() == null) {
|
|
|
ret.append("是否测试用户不能为空;");
|
|
@@ -210,14 +217,14 @@ public class TeacherImportAnalysis extends DataAnalysis<TeacherImportAnalysis> {
|
|
|
if (CollectionUtils.isNotEmpty(phones)) {
|
|
|
existPhones.addAll(easyExcelService.getPhones(phones, "TEACHER"));
|
|
|
}
|
|
|
- List<String> idCardNos = getTeacherImportWrappers().stream()
|
|
|
- .map(TeacherImportWrapper.TeacherImport::getIdCardNo)
|
|
|
- .filter(StringUtils::isNotBlank)
|
|
|
- .distinct()
|
|
|
- .collect(Collectors.toList());
|
|
|
- if (CollectionUtils.isNotEmpty(idCardNos)) {
|
|
|
- existIdCardNos.addAll(easyExcelService.getIdCardNos(idCardNos, "TEACHER"));
|
|
|
- }
|
|
|
+// List<String> idCardNos = getTeacherImportWrappers().stream()
|
|
|
+// .map(TeacherImportWrapper.TeacherImport::getIdCardNo)
|
|
|
+// .filter(StringUtils::isNotBlank)
|
|
|
+// .distinct()
|
|
|
+// .collect(Collectors.toList());
|
|
|
+// if (CollectionUtils.isNotEmpty(idCardNos)) {
|
|
|
+// existIdCardNos.addAll(easyExcelService.getIdCardNos(idCardNos, "TEACHER"));
|
|
|
+// }
|
|
|
subjectMap.putAll(easyExcelService.getSubjectMap());
|
|
|
tenantMap.putAll(easyExcelService.getTenantMap());
|
|
|
}
|