Merge branch 'hotfix/20240515' into 'master'
Hotfix/20240515 See merge request universal/infrastructure/backend/nanopart!36
This commit is contained in:
commit
d8891bb72a
@ -4,6 +4,7 @@ import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -20,21 +21,21 @@ public class JoinedWorkspaceOuJob {
|
||||
/**
|
||||
* 加入的项目部及在该项目部下担任的所有岗位
|
||||
*/
|
||||
private Map<Long, List<String>> workspaceJobMap;
|
||||
private Map<Long, List<String>> workspaceJobMap = Collections.emptyMap();
|
||||
|
||||
/**
|
||||
* 加入的单位及在该单位下担任的所有岗位
|
||||
*/
|
||||
private Map<Long, List<String>> ouJobMap;
|
||||
private Map<Long, List<String>> ouJobMap = Collections.emptyMap();
|
||||
|
||||
/**
|
||||
* 加入的单位及在该单位加入的项目部
|
||||
*/
|
||||
private Map<Long, List<Long>> ouWorkspaceMap;
|
||||
private Map<Long, List<Long>> ouWorkspaceMap = Collections.emptyMap();
|
||||
|
||||
/**
|
||||
* 加入的项目部及在该项目部加入的单位
|
||||
*/
|
||||
private Map<Long, List<Long>> workspaceOuMap;
|
||||
private Map<Long, List<Long>> workspaceOuMap = Collections.emptyMap();
|
||||
|
||||
}
|
||||
@ -67,6 +67,10 @@ public enum MaterialTargetUserTypeEnum {
|
||||
|
||||
// 若配置了具体项目部
|
||||
if (Objects.isNull(loginOuid) || loginOuid == 0L) {
|
||||
// 未加入任何项目部
|
||||
if (CollectionUtils.isEmpty(workspaceJobMap)){
|
||||
return false;
|
||||
}
|
||||
// 加入的全部项目部与配置的项目部有交集
|
||||
if (workspaceIds.stream().anyMatch(workspaceJobMap::containsKey)) {
|
||||
if (CollectionUtils.isEmpty(jobCodes)) {
|
||||
@ -107,6 +111,9 @@ public enum MaterialTargetUserTypeEnum {
|
||||
JSONUtil.toJsonStr(ouJobMap));
|
||||
// 判断配置的单位和岗位是否为空
|
||||
if (CollectionUtils.isEmpty(ouIds)) {
|
||||
if (CollectionUtils.isEmpty(ouJobMap)){
|
||||
return false;
|
||||
}
|
||||
// 若配置的单位为空(即配置了全部单位)
|
||||
if (CollectionUtils.isEmpty(jobCodes)) {
|
||||
// 若配置的岗位也为空(即配置了所有岗位),则不限制投放
|
||||
@ -128,6 +135,9 @@ public enum MaterialTargetUserTypeEnum {
|
||||
|
||||
// 若配置了具体单位
|
||||
if (Objects.isNull(loginOuid) || loginOuid == 0L) {
|
||||
if (CollectionUtils.isEmpty(ouJobMap)){
|
||||
return false;
|
||||
}
|
||||
// 若登录单位为空(工人APP登录),检查用户加入的单位是否与配置单位有交集
|
||||
if (ouIds.stream().anyMatch(ouJobMap::containsKey)) {
|
||||
if (CollectionUtils.isEmpty(jobCodes)) {
|
||||
|
||||
@ -386,13 +386,13 @@ public class MaterialServiceImpl extends ServiceImpl<MaterialDao, Material> impl
|
||||
*/
|
||||
private JoinedWorkspaceOuJob getPersonJoinedWorkspaceOuJob(Long personId) {
|
||||
if (Objects.isNull(personId)) {
|
||||
return null;
|
||||
return new JoinedWorkspaceOuJob();
|
||||
}
|
||||
|
||||
// 获取用户参与的组织架构
|
||||
List<OrganizationalNodeUserVO> nodeUserList = organizationalNodeUserGateway.list(OrganizationalNodeUserSearchReq.builder().personId(personId).build());
|
||||
if (CollectionUtils.isEmpty(nodeUserList)) {
|
||||
return null;
|
||||
return new JoinedWorkspaceOuJob();
|
||||
}
|
||||
|
||||
// Map<topNodeId, List<jobId>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user