Merge remote-tracking branch 'origin/main'

This commit is contained in:
2026-02-04 18:29:48 +08:00
3 changed files with 31 additions and 5 deletions

View File

@@ -21,7 +21,7 @@ import java.util.Map;
*/
@Configuration
@PropertySource(
value = "classpath:common-${spring.profiles.active:lyric}.yml",
value = "classpath:common-${spring.profiles.active:}.yml",
factory = CommonConfig.YamlPropertySourceFactory.class
)
public class CommonConfig {

View File

@@ -21,7 +21,7 @@ public class DataSourcePreWarmer {
@Qualifier("secondDataSource") DataSource secondDataSource) {
return args -> {
try (Connection conn = secondDataSource.getConnection()) {
log.info("✅ secondDataSource 预热成功,连接已建立: {}", conn);
log.info("✅ secondDataSource 预热成功,连接已建立: {}", conn.getMetaData().getURL());
} catch (Exception e) {
log.error("❌ secondDataSource 预热失败", e);
throw new RuntimeException(e);
@@ -29,6 +29,20 @@ public class DataSourcePreWarmer {
};
}
@Bean
public ApplicationRunner thirdDataSourcePreWarmer(
@Qualifier("thirdDataSource") DataSource thirdDataSource) {
return args -> {
try (Connection conn = thirdDataSource.getConnection()) {
log.info("✅ thirdDataSource 预热成功,连接已建立: {}", conn.getMetaData().getURL());
} catch (Exception e) {
log.error("❌ thirdDataSource 预热失败", e);
throw new RuntimeException(e);
}
};
}
// @Bean
// public ApplicationRunner mainDataSourcePreWarmer(
// @Qualifier("masterDataSource") DataSource master,

View File

@@ -423,11 +423,23 @@ public class TaskServiceImpl implements ITaskService {
if (CollectionUtils.isEmpty(attentionMemberList)) {
return new ArrayList<>();
}
List<String> myTaskIdList = attentionMemberList.stream()
Set<String> myTaskIdSetFromAttention = attentionMemberList.stream()
.filter(member -> userId.equals(member.getUserId()))
.map(SpdmTaskAttentionMemberVo::getTaskId)
.collect(Collectors.toList());
return taskList.stream().filter(task -> myTaskIdList.contains(task.getUuid())).collect(Collectors.toList());
.collect(Collectors.toSet());
if (CollectionUtils.isNotEmpty(myTaskIdSetFromAttention)) {
taskMemberVoList.stream()
.filter(member -> userId.equals(member.getUserId()) && MemberTypeEnum.ATTENTION.getCode().equals(member.getType()))
.map(SpdmTaskMemberVo::getTaskId)
.forEach(myTaskIdSetFromAttention::add);
}else {
myTaskIdSetFromAttention = taskMemberVoList.stream()
.filter(member -> userId.equals(member.getUserId()) && MemberTypeEnum.ATTENTION.getCode().equals(member.getType()))
.map(SpdmTaskMemberVo::getTaskId)
.collect(Collectors.toSet());
}
Set<String> finalMyTaskIdSetFromAttention = myTaskIdSetFromAttention;
return taskList.stream().filter(task -> finalMyTaskIdSetFromAttention.contains(task.getUuid())).collect(Collectors.toList());
}
return new ArrayList<>();