Browse Source

Merge remote-tracking branch 'origin/master'

master
PoffyZhang 1 year ago
parent
commit
aad7448eef
1 changed files with 21 additions and 16 deletions
  1. +21
    -16
      pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java

+ 21
- 16
pmapi/src/main/java/com/ningdatech/pmapi/user/manage/UserInfoManage.java View File

@@ -111,8 +111,8 @@ public class UserInfoManage {
resListVO.setOrgCode(organizationCode);
String regionCode = orgMap.get(organizationCode).getDivisionCode();
resListVO.setRegionCode(regionCode);
if(Objects.nonNull(regionCode)){
resListVO.setRegionName(regionCacheHelper.getDisplayName(regionCode,RegionConst.RL_COUNTY));
if (Objects.nonNull(regionCode)) {
resListVO.setRegionName(regionCacheHelper.getDisplayName(regionCode, RegionConst.RL_COUNTY));
}
}
// TODO 从用户信息中获取
@@ -121,7 +121,12 @@ public class UserInfoManage {
UserInfo userInfo = finalEmployeeCodeAvailableMap.get(r.getEmployeeCode());
// 装配用户状态 及 userId
userStatusAssembler(resListVO, userInfo);
resListVO.setUpdateTime(r.getUpdateOn());

if (Objects.isNull(userInfo)) {
resListVO.setUpdateTime(r.getUpdateOn());
} else {
resListVO.setUpdateTime(userInfo.getUpdateOn());
}
// 从用户信息中获取
resListVO.setEmployeeCode(r.getEmployeeCode());
resListVO.setUserRoleList(getUserRoleVOList(resListVO.getUserId()));
@@ -257,11 +262,20 @@ public class UserInfoManage {
String employeeCode = reqUserDetailEditPO.getEmployeeCode();
Long userId = generateUserId(reqUserDetailEditPO.getEmployeeCode());
UserInfo userInfo = iUserInfoService.getById(userId);
if (Objects.isNull(userInfo)) {
return;

String mobile = userInfo.getMobile();
if (StringUtils.isBlank(mobile)) {
String phoneNo = reqUserDetailEditPO.getPhoneNo();
userInfo.setMobile(phoneNo);
// 更新浙政钉相关数据
if (StringUtils.isNotBlank(phoneNo)) {
iDingEmployeeInfoService
.update(Wrappers.lambdaUpdate(DingEmployeeInfo.class)
.eq(DingEmployeeInfo::getMainJob, "true")
.eq(DingEmployeeInfo::getEmployeeCode, employeeCode)
.set(DingEmployeeInfo::getBindUserMobile, phoneNo));
}
}
String phoneNo = reqUserDetailEditPO.getPhoneNo();
userInfo.setMobile(phoneNo);
userInfo.setAvailable(reqUserDetailEditPO.getStatus());
iUserInfoService.updateById(userInfo);

@@ -276,15 +290,6 @@ public class UserInfoManage {
}).collect(Collectors.toList());
iUserRoleService.saveBatch(userRoleList);
}

// 更新浙政钉相关数据
if (StringUtils.isNotBlank(phoneNo)) {
iDingEmployeeInfoService
.update(Wrappers.lambdaUpdate(DingEmployeeInfo.class)
.eq(DingEmployeeInfo::getMainJob, "true")
.eq(DingEmployeeInfo::getEmployeeCode, employeeCode)
.set(DingEmployeeInfo::getBindUserMobile, phoneNo));
}
}

@Transactional(rollbackFor = Exception.class)


Loading…
Cancel
Save