同步用户bug修改

This commit is contained in:
liyawei
2022-06-15 10:02:48 +08:00
parent f073f93cf4
commit 9e7a80ef1d
@@ -211,7 +211,7 @@ public class SyncDataServiceImpl implements ISyncDataService{
if (!localUserMap.containsKey(ppEmployee.getId())) {
//删除数据库中与该账户相同的数据
if(StringUtils.isNotBlank(ppEmployee.getId())) {
sysUserService.removeById(ppEmployee.getId());
// sysUserService.removeById(ppEmployee.getId()); // 这个为什么是逻辑删除
log.info("需要新增的用户信息为:" + JSONObject.toJSONString(ppEmployee));
SysUser newUser = sysUserService.addPPUserInfo(ppEmployee);
localUserMap.put(ppEmployee.getId(), newUser);
@@ -260,16 +260,16 @@ public class SyncDataServiceImpl implements ISyncDataService{
}
List<PPEmployee> userEmailInfoList = JSONObject.parseArray(user.get("people_contact_email").toString(), PPEmployee.class);
if (CollectionUtil.isNotEmpty(userEmailInfoList)) {
PPEmployee userEmailInfo = userEmailInfoList.stream().filter(e->"WORK".equals(e.getEmail_type())).collect(Collectors.toList()).get(0);
if (ObjectUtil.isNotEmpty(userEmailInfo)) {
userMainInfo.setEmail_address(userEmailInfo.getEmail_address());
List<PPEmployee> userEmailInfo = userEmailInfoList.stream().filter(e->"WORK".equals(e.getEmail_type())).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(userEmailInfo)) {
userMainInfo.setEmail_address(userEmailInfo.get(0).getEmail_address());
}
}
List<PPEmployee> userPhoneInfoList = JSONObject.parseArray(user.get("people_contact_phone").toString(), PPEmployee.class);
if (CollectionUtil.isNotEmpty(userPhoneInfoList)) {
PPEmployee userPhoneInfo = userPhoneInfoList.stream().filter(e->"WORK".equals(e.getPhone_type()) && "Mobile".equals(e.getPhone_device_type())).collect(Collectors.toList()).get(0);
if (ObjectUtil.isNotEmpty(userPhoneInfo)) {
userMainInfo.setFormatted_phone_number(userPhoneInfo.getFormatted_phone_number());
List<PPEmployee> userPhoneInfo = userPhoneInfoList.stream().filter(e->"WORK".equals(e.getPhone_type()) && "Mobile".equals(e.getPhone_device_type())).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(userPhoneInfo)) {
userMainInfo.setFormatted_phone_number(userPhoneInfo.get(0).getFormatted_phone_number());
}
}