|
@@ -130,17 +130,7 @@ public class DataMigrationController {
|
|
|
e.printStackTrace();
|
|
|
return AdmResponse.failure(MigrationConstant.ERROR +":"+ e.getMessage());
|
|
|
}
|
|
|
-
|
|
|
dataMigrationHandler.handleAndSaveLog(context, migrationInfo);
|
|
|
-
|
|
|
- AdmQueryCriteria admQueryCriteria = new AdmQueryCriteria();
|
|
|
- admQueryCriteria.addFilters("targetId = 'error'");
|
|
|
- admQueryCriteria.addFilters("projectId = '" + context.getProjectId() + "'");
|
|
|
- admQueryCriteria.setOnlyCount(true);
|
|
|
- AdmResponse response = queryMigrateForLog(admQueryCriteria);
|
|
|
- if(response.getMessage().equals(DmpResult.SUCCESS) && response.getCount() > 5){
|
|
|
- return AdmResponse.failure("出现错误次数:"+ response.getCount()+"次,请使用导出检查数据是否迁移成功");
|
|
|
- }
|
|
|
return AdmResponse.success();
|
|
|
}
|
|
|
|
|
@@ -195,18 +185,26 @@ public class DataMigrationController {
|
|
|
/**
|
|
|
* 获取迁移数据日志
|
|
|
*
|
|
|
- * @AdmQueryCriteria
|
|
|
+ * @param request
|
|
|
* {
|
|
|
- * "order": "lastUpdate asc, objId asc",
|
|
|
- * "pageNumber": 1,
|
|
|
- * "pageSize": 15,
|
|
|
- * "filters": "projectId='Pj9909990004';sign=2;type='create';objectType='building'"
|
|
|
+ * "onlyCount": false,
|
|
|
+ * "withoutCount": false,
|
|
|
+ * "criteria": {
|
|
|
+ * "sign": 2,
|
|
|
+ * "type": "create",
|
|
|
+ * "tableName": "dt_relation",
|
|
|
+ * "creationTime":{
|
|
|
+ * "$gte":20220120121146,
|
|
|
+ * "$lte":20220123121146
|
|
|
+ * },
|
|
|
+ * "valid": 1
|
|
|
+ * }
|
|
|
* }
|
|
|
*
|
|
|
* return AdmResponse
|
|
|
*/
|
|
|
@PostMapping("/log")
|
|
|
- public AdmResponse queryMigrateForLog(@RequestBody AdmQueryCriteria request) {
|
|
|
+ public AdmResponse queryMigrateForLog(@RequestBody QueryCriteria request) {
|
|
|
InstanceUrlParam context = AdmContextUtil.toDmpContext();
|
|
|
return logService.queryMigrationLog(context, request);
|
|
|
}
|
|
@@ -215,12 +213,23 @@ public class DataMigrationController {
|
|
|
* 根据条件 删除操作日志 物理删除
|
|
|
* @param request
|
|
|
* {
|
|
|
- * "filters": "projectId='Pj9909990004';sign=2;type='create';tableName='dt_relation';creationTime='20220125121146'"
|
|
|
+ * "onlyCount": false,
|
|
|
+ * "withoutCount": false,
|
|
|
+ * "criteria": {
|
|
|
+ * "sign": 2,
|
|
|
+ * "type": "create",
|
|
|
+ * "tableName": "dt_relation",
|
|
|
+ * "creationTime":{
|
|
|
+ * "$gte":20220120121146,
|
|
|
+ * "$lte":20220123121146
|
|
|
+ * },
|
|
|
+ * "valid": 1
|
|
|
+ * }
|
|
|
* }
|
|
|
* @return
|
|
|
*/
|
|
|
@PostMapping("/deleteLog")
|
|
|
- public AdmResponse deleteMigrateForLog(@RequestBody AdmQueryCriteria request) {
|
|
|
+ public AdmResponse deleteMigrateForLog(@RequestBody QueryCriteria request) {
|
|
|
InstanceUrlParam context = AdmContextUtil.toDmpContext();
|
|
|
return logService.deleteMigrationLog(context, request);
|
|
|
}
|