fix:同步利元亨用户岗位数据

This commit is contained in:
2026-01-28 20:31:05 +08:00
parent 5d7081e7ad
commit 38048f94e0
8 changed files with 114 additions and 8 deletions

View File

@@ -16,6 +16,7 @@ import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Set;
@FeignClient(contextId = "honeycomUserServiceFeign", value = ServiceNameConstants.USER_SERVICE, configuration = FeignConfig.class)
public interface HoneycomUserServiceFeign {
@@ -121,4 +122,6 @@ public interface HoneycomUserServiceFeign {
@PostMapping("/user/tenant/getUserByHrEmpId")
R<SysUserEntity> getUserByHrEmpId(@RequestParam Integer hrEmpId, @RequestHeader(SecurityConstants.FROM) String from);
@GetMapping("/user/getUserListByUserNamesForSpdm")
R<Set<String>> getUserListByUserNamesForSpdm(@RequestParam("userNames") List<String> userNames);
}

View File

@@ -297,6 +297,13 @@ public class SysUserController {
return R.ok(sysUserService.findByUsernameList(userNames));
}
@Inner(false)
@Operation(summary = "通过用户名(工号)集合查询用户信息" , description = "通过用户名(工号)集合查询用户信息" )
@GetMapping("/getUserListByUserNamesForSpdm")
public R<Set<String>> getUserListByUserNamesForSpdm(@RequestParam("userNames") List<String> userNames) {
return R.ok(sysUserService.getUserListByUserNamesForSpdm(userNames));
}
@Inner
@Operation(summary = "通过电话号码集合查询用户信息" , description = "通过电话号码集合查询用户信息" )
@GetMapping("/retrieve/phone-list")

View File

@@ -13,6 +13,7 @@ import com.honeycombis.honeycom.user.vo.SysUserPageQueryVO;
import com.honeycombis.honeycom.user.vo.SysUserVO;
import java.util.List;
import java.util.Set;
/**
* @author luobin@honeycombis.com
@@ -39,6 +40,8 @@ public interface SysUserService extends IService<SysUserEntity> {
List<SysUserVO> findByUsernameList(List<String> usernameList);
Set<String> getUserListByUserNamesForSpdm(List<String> usernameList);
List<SysUserNoSensitiveInfoVO> findByPhoneList(List<String> phoneList);
List<SysUserVO> findByIds(List<Long> ids);

View File

@@ -333,6 +333,23 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUserEntity
return getSysUserVOList(result, queryWrapper);
}
@Override
public Set<String> getUserListByUserNamesForSpdm(List<String> usernameList) {
if (Objects.isNull(usernameList)) {
throw new HoneycomException(ErrorType.PARAM_ERROR.getCode());
} else if (CollectionUtils.isEmpty(usernameList)) {
return new HashSet<>();
}
LambdaQueryWrapper<SysUserEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.select(SysUserEntity::getUsername)
.in(SysUserEntity::getUsername, usernameList);
List<SysUserEntity> existing = this.list(queryWrapper);
return existing.stream()
.map(SysUserEntity::getUsername)
.collect(Collectors.toSet());
}
@Override
public List<SysUserNoSensitiveInfoVO> findByPhoneList(List<String> phoneList) {
if (CollectionUtils.isEmpty(phoneList)) {