Merge remote-tracking branch 'base-version/test' into dev

This commit is contained in:
chenbowen
2026-01-20 08:58:56 +08:00
5 changed files with 123 additions and 18 deletions

View File

@@ -9,6 +9,7 @@ import org.apache.ibatis.annotations.Mapper;
import java.util.Collection;
import java.util.List;
import java.util.Collections;
@Mapper
public interface PostMapper extends BaseMapperX<PostDO> {
@@ -35,4 +36,12 @@ public interface PostMapper extends BaseMapperX<PostDO> {
return selectOne(PostDO::getCode, code);
}
default List<PostDO> selectByCodes(Collection<String> codes) {
if (codes == null || codes.isEmpty()) {
return Collections.emptyList();
}
return selectList(new LambdaQueryWrapperX<PostDO>()
.in(PostDO::getCode, codes));
}
}

View File

@@ -217,11 +217,14 @@ public class IWorkSyncServiceImpl implements IWorkSyncService {
int pagesLimit = reqVO.getMaxPages() == null ? Integer.MAX_VALUE : reqVO.getMaxPages();
int processedPages = 0;
for (int page = startPage; processedPages < pagesLimit; page++) {
long pageStart = System.currentTimeMillis();
BatchExecution execution = executor.execute(page, pageSize);
long pageMs = System.currentTimeMillis() - pageStart;
if (execution == null || execution.totalPulled == 0) {
break;
}
processedPages++;
log.info("[iWork] 全量同步 {} 页={} pulled={} costMs={}", type, page, execution.totalPulled, pageMs);
IWorkSyncBatchStatVO batchStat = new IWorkSyncBatchStatVO();
batchStat.setEntityType(type);
batchStat.setPageNumber(page);
@@ -403,11 +406,14 @@ public class IWorkSyncServiceImpl implements IWorkSyncService {
int pagesLimit = reqVO.getMaxPages() == null ? Integer.MAX_VALUE : reqVO.getMaxPages();
int processedPages = 0;
for (int page = startPage; processedPages < pagesLimit; page++) {
long pageStart = System.currentTimeMillis();
BatchExecution execution = executor.execute(page, pageSize);
long pageMs = System.currentTimeMillis() - pageStart;
if (execution == null || execution.totalPulled == 0) {
break;
}
processedPages++;
log.info("[iWork] 手动同步 {} 页={} pulled={} costMs={}", type, page, execution.totalPulled, pageMs);
IWorkSyncBatchStatVO batchStat = new IWorkSyncBatchStatVO();
batchStat.setEntityType(type);
batchStat.setPageNumber(page);