|
@@ -41,6 +41,7 @@ import java.time.LocalDateTime;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
|
|
+import java.util.HashSet;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
import java.util.Set;
|
|
import java.util.Set;
|
|
@@ -221,14 +222,9 @@ public class WhitelistManagementServiceImpl extends MPJBaseServiceImpl<Whitelist
|
|
|
|
|
|
Set<Long> whitelistUsers = this.baseMapper.selectList(new QueryWrapper<>()).stream().map(WhitelistManagement::getUserId).collect(Collectors.toSet());
|
|
Set<Long> whitelistUsers = this.baseMapper.selectList(new QueryWrapper<>()).stream().map(WhitelistManagement::getUserId).collect(Collectors.toSet());
|
|
|
|
|
|
- List<User> updateList = new ArrayList<>();
|
|
|
|
- List<BaseUserStudent> userStudentList = new ArrayList<>();
|
|
|
|
- List<User> parentInsList = new ArrayList<>();
|
|
|
|
- List<User> parentUpdList = new ArrayList<>();
|
|
|
|
- List<UserRoleRelation> roleRelationList = new ArrayList<>();
|
|
|
|
- List<WhitelistManagement> whitelist = new ArrayList();
|
|
|
|
- LocalDateTime now = LocalDateTime.now();
|
|
|
|
- Date createDate = new Date();
|
|
|
|
|
|
+
|
|
|
|
+ // 1、先把文件中的所有家长信息去重并提取出来
|
|
|
|
+ List<Map<Integer, Object>> dataList = new ArrayList<>();
|
|
for (Map<Integer, Object> vo : savedDataList) {
|
|
for (Map<Integer, Object> vo : savedDataList) {
|
|
List<String> errorLogs = new ArrayList<>();
|
|
List<String> errorLogs = new ArrayList<>();
|
|
|
|
|
|
@@ -253,8 +249,23 @@ public class WhitelistManagementServiceImpl extends MPJBaseServiceImpl<Whitelist
|
|
}
|
|
}
|
|
if(!errorLogs.isEmpty()){
|
|
if(!errorLogs.isEmpty()){
|
|
vo.put(5, errorLogs.toString().replace("[", "").replace("]", ""));
|
|
vo.put(5, errorLogs.toString().replace("[", "").replace("]", ""));
|
|
|
|
+ errorList.add(vo);
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
+ dataList.add(vo);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ List<User> updateList = new ArrayList<>();
|
|
|
|
+ List<BaseUserStudent> userStudentList = new ArrayList<>();
|
|
|
|
+ List<User> parentInsList = new ArrayList<>();
|
|
|
|
+ List<User> parentUpdList = new ArrayList<>();
|
|
|
|
+ List<UserRoleRelation> roleRelationList = new ArrayList<>();
|
|
|
|
+ List<WhitelistManagement> whitelist = new ArrayList();
|
|
|
|
+ LocalDateTime now = LocalDateTime.now();
|
|
|
|
+ Date createDate = new Date();
|
|
|
|
+
|
|
|
|
+ for (Map<Integer, Object> vo : dataList) {
|
|
|
|
+ String studentKey = vo.get(0).toString() + vo.get(1).toString();
|
|
long parentId = IdUtil.getSnowflakeNextId();
|
|
long parentId = IdUtil.getSnowflakeNextId();
|
|
if(parentsMap.get(vo.get(4).toString()) != null){
|
|
if(parentsMap.get(vo.get(4).toString()) != null){
|
|
User parent = parentsMap.get(vo.get(4).toString());
|
|
User parent = parentsMap.get(vo.get(4).toString());
|
|
@@ -314,7 +325,7 @@ public class WhitelistManagementServiceImpl extends MPJBaseServiceImpl<Whitelist
|
|
userService.updateBatchById(updateList);
|
|
userService.updateBatchById(updateList);
|
|
}
|
|
}
|
|
if(!userStudentList.isEmpty()){
|
|
if(!userStudentList.isEmpty()){
|
|
- userStudentService.updateBatchById(userStudentList);
|
|
|
|
|
|
+ userStudentService.saveBatch(userStudentList);
|
|
}
|
|
}
|
|
if(!parentInsList.isEmpty()){
|
|
if(!parentInsList.isEmpty()){
|
|
userService.saveBatch(parentInsList);
|
|
userService.saveBatch(parentInsList);
|