|
|
@@ -1,7 +1,9 @@
|
|
|
package cn.iocoder.yudao.module.employee.service.info;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.util.IdUtil;
|
|
|
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
|
|
|
+import cn.iocoder.yudao.module.employee.api.dto.EmployeeRespDTO;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
@@ -15,6 +17,10 @@ import cn.iocoder.yudao.module.employee.dal.mysql.info.EmployeeInfoMapper;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
+import java.util.Collection;
|
|
|
+import java.util.Collections;
|
|
|
+import java.util.List;
|
|
|
+
|
|
|
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
|
|
import static cn.iocoder.yudao.module.employee.enums.ErrorCodeConstants.EMPLOYEE_INFO_NOT_EXISTS;
|
|
|
|
|
|
@@ -32,6 +38,34 @@ public class EmployeeInfoServiceImpl implements EmployeeInfoService {
|
|
|
@Resource
|
|
|
private EmployeeInfoHistoryService employeeInfoHistoryService;
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<EmployeeInfoDO> getEmployeeListByIds(Collection<Long> ids) {
|
|
|
+ if (CollUtil.isEmpty(ids)) {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
+ return infoMapper.selectBatchIds(ids);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public EmployeeInfoDO getEmployeeByUserId(Long userId) {
|
|
|
+ if (userId == null) {
|
|
|
+ return EmployeeInfoDO.builder().build();
|
|
|
+ }
|
|
|
+ LambdaQueryWrapper<EmployeeInfoDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ lambdaQueryWrapper.eq(EmployeeInfoDO::getUserId, userId);
|
|
|
+ return infoMapper.selectOne(lambdaQueryWrapper);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<EmployeeInfoDO> getInfoListByUserIds(Collection<Long> userIds) {
|
|
|
+ if (CollUtil.isEmpty(userIds)) {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
+ LambdaQueryWrapper<EmployeeInfoDO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ lambdaQueryWrapper.in(EmployeeInfoDO::getUserId, userIds);
|
|
|
+ return infoMapper.selectList(lambdaQueryWrapper);
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
@TenantIgnore
|
|
|
public Long createInfo(EmployeeInfoSaveReqVO createReqVO) {
|