feat(userRoleJob): 支持分页参数
This commit is contained in:
parent
c2f861502e
commit
08c42f04da
@ -125,7 +125,7 @@ public class UserRoleRelationCleanJob extends IJobHandler {
|
||||
condition.setWorkspaceId(cleanParam.getWorkspaceId());
|
||||
condition.setNaturalPersonId(cleanParam.getPersonId());
|
||||
|
||||
Page<SaasRoleUserRelation> countInfo = roleUserRelationDao.batListCleanRelation(condition, new Page<>(1, 20));
|
||||
Page<SaasRoleUserRelation> countInfo = roleUserRelationDao.batListCleanRelation(condition, new Page<>(1, 10));
|
||||
if (!NumberUtil.isPositiveNumber(countInfo.getTotal())) {
|
||||
XxlJobLogger.log("no data found to check");
|
||||
return;
|
||||
@ -135,7 +135,7 @@ public class UserRoleRelationCleanJob extends IJobHandler {
|
||||
int page = 1;
|
||||
while (true) {
|
||||
XxlJobLogger.log(" load data page:{} ", page);
|
||||
Page<SaasRoleUserRelation> pageResult = roleUserRelationDao.batListCleanRelation(condition, new Page<>(page++, 20));
|
||||
Page<SaasRoleUserRelation> pageResult = roleUserRelationDao.batListCleanRelation(condition, new Page<>(page++, cleanParam.getPageSize()));
|
||||
List<SaasRoleUserRelation> records = pageResult.getRecords();
|
||||
if (CollectionUtil.isEmpty(records)) {
|
||||
break;
|
||||
@ -180,7 +180,11 @@ public class UserRoleRelationCleanJob extends IJobHandler {
|
||||
if (StrUtil.isBlank(param)) {
|
||||
return new CleanTarget();
|
||||
}
|
||||
return JSON.parseObject(param, CleanTarget.class);
|
||||
CleanTarget jobParam = JSON.parseObject(param, CleanTarget.class);
|
||||
if (!NumberUtil.isPositiveNumber(jobParam.getPageSize())) {
|
||||
jobParam.setPageSize(100);
|
||||
}
|
||||
return jobParam;
|
||||
}
|
||||
|
||||
@Data
|
||||
@ -198,5 +202,7 @@ public class UserRoleRelationCleanJob extends IJobHandler {
|
||||
private Long identityId;
|
||||
|
||||
private Integer identityType;
|
||||
|
||||
private Integer pageSize = 20;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user