提交 5f1c5410 authored 作者: inroi's avatar inroi

微调

上级 8253eb81
...@@ -47,17 +47,17 @@ public class SynchronizationController { ...@@ -47,17 +47,17 @@ public class SynchronizationController {
return synchronizationService.initConnectParmCreate(inVo); return synchronizationService.initConnectParmCreate(inVo);
} }
@ApiOperation("手动开启自动同步") @ApiOperation("手动启动同步方法")
@GetMapping("/manual/synchronization") @GetMapping("/manual/synchronization")
public RestResponse manualSynchronization() { public RestResponse manualSynchronization() {
synchronizationService.synchronization(); synchronizationService.manualSynchronization();
return RestResponse.success(); return RestResponse.success();
} }
@ApiOperation("手动重新同步错误同步") @ApiOperation("手动启动失败同步方法")
@GetMapping("/abnormal/synchronization") @GetMapping("/abnormal/synchronization")
public RestResponse abnormalSynchronization() { public RestResponse abnormalSynchronization() {
synchronizationService.abnormalAgainSynchronization(); synchronizationService.abnormalSynchronization();
return RestResponse.success(); return RestResponse.success();
} }
......
...@@ -43,10 +43,21 @@ public interface ISynchronizationService { ...@@ -43,10 +43,21 @@ public interface ISynchronizationService {
*/ */
void synchronization(); void synchronization();
/**
* 手动启动同步方法
*/
void manualSynchronization();
/** /**
* 异常重新同步方法 * 异常重新同步方法
*/ */
void abnormalAgainSynchronization(); void abnormalAgainSynchronization();
/**
* 手动启动失败同步方法
*/
void abnormalSynchronization();
} }
...@@ -130,6 +130,16 @@ public class SynchronizationServiceImpl implements ISynchronizationService { ...@@ -130,6 +130,16 @@ public class SynchronizationServiceImpl implements ISynchronizationService {
} }
@Override @Override
public void manualSynchronization() {
this.synchronization();
}
@Override
public void abnormalSynchronization() {
this.abnormalAgainSynchronization();
}
@Override
public void synchronization() { public void synchronization() {
List<TableRelation> tableRelationList = tableRelationMapper.selectList(new QueryWrapper<>()); List<TableRelation> tableRelationList = tableRelationMapper.selectList(new QueryWrapper<>());
...@@ -168,7 +178,11 @@ public class SynchronizationServiceImpl implements ISynchronizationService { ...@@ -168,7 +178,11 @@ public class SynchronizationServiceImpl implements ISynchronizationService {
} }
private void getTableRelationTree(List<TableRelation> result, String tableHeader, List<TableRelation> tableRelationList) { private void getTableRelationTree(List<TableRelation> result, String tableHeader, List<TableRelation> tableRelationList) {
List<TableRelation> tempList = tableRelationList.stream().filter(m -> tableHeader.equals(m.getSubTableHeader())).collect(Collectors.toList()); List<TableRelation> tempList = tableRelationList.stream()
.filter(m -> tableHeader.equals(m.getSubTableHeader()))
.sorted(Comparator.comparing(TableRelation::getSortOrder))
.collect(Collectors.toList());
for (TableRelation tableRelation : tempList) { for (TableRelation tableRelation : tempList) {
result.add(tableRelation); result.add(tableRelation);
this.getTableRelationTree(result, tableRelation.getTableHeader(), tableRelationList); this.getTableRelationTree(result, tableRelation.getTableHeader(), tableRelationList);
......
...@@ -30,7 +30,7 @@ public class TableRelationServiceImpl implements ITableRelationService { ...@@ -30,7 +30,7 @@ public class TableRelationServiceImpl implements ITableRelationService {
List<TableRelationListOutVoRecords> result = tempList.stream() List<TableRelationListOutVoRecords> result = tempList.stream()
.sorted(Comparator.comparing(TableRelationListOutVoRecords::getCreateTime).reversed()) .sorted(Comparator.comparing(TableRelationListOutVoRecords::getCreateTime).reversed())
.collect(Collectors.toList()) .collect(Collectors.toList())
.subList(inVo.getPageNo() * inVo.getPageSize() - 10, Math.min(inVo.getPageNo() * inVo.getPageSize(), tempList.size())); .subList(inVo.getPageNo() * inVo.getPageSize() - inVo.getPageSize(), Math.min(inVo.getPageNo() * inVo.getPageSize(), tempList.size()));
TableRelationListOutVo outVo = new TableRelationListOutVo(); TableRelationListOutVo outVo = new TableRelationListOutVo();
outVo.setTotal(tempList.size()); outVo.setTotal(tempList.size());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论