Commit a81ba901 by zhoupeng

提交导入组织架构openapi接口

parent 624cc144
...@@ -205,17 +205,24 @@ public class SyncEmployeCdpServiceImpl implements SyncEmployeCdpService { ...@@ -205,17 +205,24 @@ public class SyncEmployeCdpServiceImpl implements SyncEmployeCdpService {
}else{ }else{
//批量添加 //批量添加
List<EmpMainDataResDTO> batchAdd=new ArrayList<>(); List<EmpMainDataResDTO> batchAdd=new ArrayList<>();
Map<Long, SyncEmployeeCdpDO> empMainMap = employeeCdpListByUserIds.stream().collect(Collectors.toMap(SyncEmployeeCdpDO::getUserId, Function.identity())); //批量更新
List<EmpMainDataResDTO> batchUpdateAdd=new ArrayList<>();
Map<Long, SyncEmployeeCdpDO> empMainMap= employeeCdpListByUserIds.stream().collect(Collectors.toMap(SyncEmployeeCdpDO::getUserId, Function.identity(), (var1, var2) -> var1));
for (EmpMainDataResDTO empResDTO: empResList) { for (EmpMainDataResDTO empResDTO: empResList) {
Long userId = empResDTO.getUserId(); Long userId = empResDTO.getUserId();
if(!empMainMap.containsKey(userId)){ if(!empMainMap.containsKey(userId)){
batchAdd.add(empResDTO); batchAdd.add(empResDTO);
}else{
batchUpdateAdd.add(empResDTO);
} }
} }
if(!CollectionUtils.isEmpty(batchAdd)){ if(!CollectionUtils.isEmpty(batchAdd)){
syncEmployeeCdpMapper.batchSaveEmpCdp(batchAdd); syncEmployeeCdpMapper.batchSaveEmpCdp(batchAdd);
allEmps.addAll(batchAdd); allEmps.addAll(batchAdd);
} }
if(!CollectionUtils.isEmpty(batchUpdateAdd)){
allEmps.addAll(batchUpdateAdd);
}
} }
} }
...@@ -263,10 +270,16 @@ public class SyncEmployeCdpServiceImpl implements SyncEmployeCdpService { ...@@ -263,10 +270,16 @@ public class SyncEmployeCdpServiceImpl implements SyncEmployeCdpService {
} }
empMainStaffsReqDTO.setAccountId(empMainDataResDTO.getUserId()+""); empMainStaffsReqDTO.setAccountId(empMainDataResDTO.getUserId()+"");
empMainStaffsReqDTO.setAccountName(empMainDataResDTO.getName()); empMainStaffsReqDTO.setAccountName(empMainDataResDTO.getName());
String employeeNumber = empMainDataResDTO.getEmployeeNumber();
//判断数据库中对应的邮箱是否存在 //判断数据库中对应的邮箱是否存在
String companyEmail = empMainDataResDTO.getCompanyEmail(); // String companyEmail = empMainDataResDTO.getCompanyEmail();
if(beidouEmail){ if(beidouEmail){
empMainStaffsReqDTO.setEmail(companyEmail); if(StringUtils.isEmpty(employeeNumber)){
empMainStaffsReqDTO.setEmail(null);
}else{
//工号作为邮箱号
empMainStaffsReqDTO.setEmail(employeeNumber);
}
}else{ }else{
empMainStaffsReqDTO.setEmail(null); empMainStaffsReqDTO.setEmail(null);
} }
......
...@@ -131,7 +131,7 @@ beidou: ...@@ -131,7 +131,7 @@ beidou:
#密钥 #密钥
secret: ajdjhfwjk123 secret: ajdjhfwjk123
#是否同步邮件 #是否同步邮件
email: false email: true
#登录完成后回调业务地址 #登录完成后回调业务地址
consoleUrl: https://beidou.test.laiyifen.com consoleUrl: https://beidou.test.laiyifen.com
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment