|
@@ -529,12 +529,6 @@ public class TBUserArchivesAllocationServiceImpl
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public List<UserArchivesDto> findCanChooseArchives(Long crmDetailId, SopRoleTypeEnum sopRoleTypeEnum) {
|
|
public List<UserArchivesDto> findCanChooseArchives(Long crmDetailId, SopRoleTypeEnum sopRoleTypeEnum) {
|
|
- List<TBUserArchivesAllocation> allocatedList = this.list(new QueryWrapper<TBUserArchivesAllocation>().lambda()
|
|
|
|
- .eq(TBUserArchivesAllocation::getCrmDetailId, crmDetailId)
|
|
|
|
- .eq(TBUserArchivesAllocation::getSopRoleType, sopRoleTypeEnum));
|
|
|
|
- List<Long> allocatedIdList = allocatedList.stream().map(TBUserArchivesAllocation::getArchivesId).distinct()
|
|
|
|
- .collect(Collectors.toList());
|
|
|
|
-
|
|
|
|
List<Long> datasource = new ArrayList<>();
|
|
List<Long> datasource = new ArrayList<>();
|
|
switch (sopRoleTypeEnum) {
|
|
switch (sopRoleTypeEnum) {
|
|
case ENGINEER:
|
|
case ENGINEER:
|
|
@@ -545,9 +539,7 @@ public class TBUserArchivesAllocationServiceImpl
|
|
datasource = tbUserArchivesService.findArchivesSourceByType(RoleTypeEnum.REGION_COORDINATOR).stream().map(ArchivesSourceResult::getArchivesId).distinct().collect(Collectors.toList());
|
|
datasource = tbUserArchivesService.findArchivesSourceByType(RoleTypeEnum.REGION_COORDINATOR).stream().map(ArchivesSourceResult::getArchivesId).distinct().collect(Collectors.toList());
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
-
|
|
|
|
- List<Long> effectArchivesIdList = datasource.stream().filter(e -> !allocatedIdList.contains(e)).distinct().collect(Collectors.toList());
|
|
|
|
-
|
|
|
|
|
|
+ List<Long> effectArchivesIdList = datasource.stream().distinct().collect(Collectors.toList());
|
|
List<UserArchivesDto> result = new ArrayList<>();
|
|
List<UserArchivesDto> result = new ArrayList<>();
|
|
for (Long effectArchivesId : effectArchivesIdList) {
|
|
for (Long effectArchivesId : effectArchivesIdList) {
|
|
UserArchivesResult tbUserArchivesResult = tbUserArchivesService.findUserArchivesByArchivesIdORUserId(
|
|
UserArchivesResult tbUserArchivesResult = tbUserArchivesService.findUserArchivesByArchivesIdORUserId(
|