|
@@ -410,9 +410,7 @@ public class TBUserArchivesServiceImpl extends ServiceImpl<TBUserArchivesMapper,
|
|
|
throw ExceptionResultEnum.ERROR.exception("该方法只支持查询实施工程师和助理工程师");
|
|
|
}
|
|
|
List<ArchivesSourceResult> list = new ArrayList<>();
|
|
|
- if (crmNo != null && crmNo.length() > 0) {
|
|
|
- list.addAll(this.baseMapper.findArchivesUsed(roleType, crmNo));
|
|
|
- }
|
|
|
+
|
|
|
list.addAll(this.baseMapper.findArchivesSourceByType(roleType));
|
|
|
|
|
|
Long currentTime = System.currentTimeMillis();
|
|
@@ -420,6 +418,14 @@ public class TBUserArchivesServiceImpl extends ServiceImpl<TBUserArchivesMapper,
|
|
|
.filter(e -> e.getAuthenticationValidTime() >= currentTime && UserArchivesStatusEnum.FREE.equals(e.getArchivesStatus()))
|
|
|
.peek(e -> e.setRemainCount(1))
|
|
|
.collect(Collectors.toList());
|
|
|
+
|
|
|
+ List<Long> idList = list.stream().map(ArchivesSourceResult::getUserId).collect(Collectors.toList());
|
|
|
+
|
|
|
+ if (crmNo != null && crmNo.length() > 0) {
|
|
|
+ List<ArchivesSourceResult> choose = this.baseMapper.findArchivesUsed(roleType, crmNo);
|
|
|
+ choose = choose.stream().filter(e -> !idList.contains(e.getUserId())).collect(Collectors.toList());
|
|
|
+ list.addAll(choose);
|
|
|
+ }
|
|
|
return list;
|
|
|
}
|
|
|
|