refactor: 使用 CollUtils 替代部分 Stream 操作,提高代码的可读性,减少代码行数(缺点:方法写起来不如流式代码舒爽)

This commit is contained in:
2025-07-17 23:05:59 +08:00
parent 08f45b5f4d
commit 33d89431cf
25 changed files with 79 additions and 69 deletions

View File

@@ -33,6 +33,7 @@ import top.continew.admin.system.mapper.NoticeMapper;
import top.continew.admin.system.model.entity.NoticeDO;
import top.continew.admin.system.service.NoticeService;
import top.continew.starter.core.constant.PropertiesConstants;
import top.continew.starter.core.util.CollUtils;
import top.continew.starter.extension.tenant.annotation.TenantIgnore;
import java.time.LocalDateTime;
@@ -109,7 +110,7 @@ public class NoticePublishJob {
// 更新状态
noticeMapper.lambdaUpdate()
.set(NoticeDO::getStatus, NoticeStatusEnum.PUBLISHED)
.in(NoticeDO::getId, list.stream().map(NoticeDO::getId).toList())
.in(NoticeDO::getId, CollUtils.mapToList(list, NoticeDO::getId))
.update();
}
}