|
|
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
import com.ningdatech.basic.exception.BizException; |
|
|
|
import com.ningdatech.basic.model.PageVo; |
|
|
|
import com.ningdatech.pmapi.common.helper.UserInfoHelper; |
|
|
|
import com.ningdatech.pmapi.organization.model.entity.DingEmployeeInfo; |
|
|
|
import com.ningdatech.pmapi.organization.service.IDingEmployeeInfoService; |
|
|
|
import com.ningdatech.pmapi.organization.service.IDingOrganizationService; |
|
|
@@ -23,7 +24,9 @@ import com.ningdatech.pmapi.user.model.po.ReqUserInfoListPO; |
|
|
|
import com.ningdatech.pmapi.user.model.vo.ResUserDetailVO; |
|
|
|
import com.ningdatech.pmapi.user.model.vo.ResUserInfoListVO; |
|
|
|
import com.ningdatech.pmapi.user.model.vo.UserRoleVO; |
|
|
|
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO; |
|
|
|
import com.ningdatech.pmapi.user.service.IUserInfoService; |
|
|
|
import com.ningdatech.pmapi.user.util.LoginUserUtil; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
@@ -46,6 +49,7 @@ public class UserInfoManage { |
|
|
|
private final IUserInfoService iUserInfoService; |
|
|
|
private final IUserRoleService iUserRoleService; |
|
|
|
private final IRoleService iRoleService; |
|
|
|
private final UserInfoHelper userInfoHelper; |
|
|
|
|
|
|
|
public PageVo<ResUserInfoListVO> list(ReqUserInfoListPO reqUserInfoListPO) { |
|
|
|
LambdaQueryWrapper<DingEmployeeInfo> wrapper = Wrappers.lambdaQuery(DingEmployeeInfo.class) |
|
|
@@ -63,7 +67,7 @@ public class UserInfoManage { |
|
|
|
Map<String, UserInfo> employeeCodeAvailableMap = new HashMap<>(); |
|
|
|
if (CollUtil.isNotEmpty(employeeCodeList)) { |
|
|
|
employeeCodeAvailableMap = iUserInfoService.list(Wrappers.lambdaQuery(UserInfo.class) |
|
|
|
.in(UserInfo::getEmployeeCode,employeeCodeList)) |
|
|
|
.in(UserInfo::getEmployeeCode, employeeCodeList)) |
|
|
|
.stream().collect(Collectors.toMap(UserInfo::getEmployeeCode, Function.identity())); |
|
|
|
} |
|
|
|
|
|
|
@@ -86,6 +90,8 @@ public class UserInfoManage { |
|
|
|
if (StringUtils.isNotBlank(userInfo.getAvailable()) |
|
|
|
&& UserAvailableEnum.ENABLE.name().equals(userInfo.getAvailable())) { |
|
|
|
resListVO.setStatus(UserAvailableEnum.ENABLE.name()); |
|
|
|
} else { |
|
|
|
resListVO.setStatus(UserAvailableEnum.DISABLE.name()); |
|
|
|
} |
|
|
|
resListVO.setUserId(userInfo.getId()); |
|
|
|
} else { |
|
|
@@ -172,8 +178,10 @@ public class UserInfoManage { |
|
|
|
UserInfo userInfo = iUserInfoService.getOne(Wrappers.lambdaQuery(UserInfo.class) |
|
|
|
.eq(UserInfo::getEmployeeCode, employeeCode)); |
|
|
|
if (Objects.isNull(userInfo)) { |
|
|
|
List<DingEmployeeInfo> dingEmployeeInfoList = iDingEmployeeInfoService.list(Wrappers.lambdaQuery(DingEmployeeInfo.class) |
|
|
|
.eq(DingEmployeeInfo::getMainJob, "true")); |
|
|
|
List<DingEmployeeInfo> dingEmployeeInfoList = iDingEmployeeInfoService |
|
|
|
.list(Wrappers.lambdaQuery(DingEmployeeInfo.class) |
|
|
|
.eq(DingEmployeeInfo::getEmployeeCode, employeeCode) |
|
|
|
.eq(DingEmployeeInfo::getMainJob, "true")); |
|
|
|
if (CollUtil.isEmpty(dingEmployeeInfoList)) { |
|
|
|
throw new BizException("员工账号不存在"); |
|
|
|
} |
|
|
@@ -196,6 +204,8 @@ public class UserInfoManage { |
|
|
|
|
|
|
|
|
|
|
|
public ResUserDetailVO currentUserInfo() { |
|
|
|
Long userId = LoginUserUtil.getUserId(); |
|
|
|
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId); |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |