|
@@ -337,10 +337,10 @@ public class MigrationAbstractServiceImpl<T> implements MigrationAbstractService
|
|
if(CollUtil.isEmpty(difference)){
|
|
if(CollUtil.isEmpty(difference)){
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
- difference.forEach(set1 -> System.out.println(set1));
|
|
|
|
|
|
+ /*difference.forEach(set1 -> System.out.println(set1));
|
|
System.out.println("-------------------------------------------------------------------------");
|
|
System.out.println("-------------------------------------------------------------------------");
|
|
Sets.SetView<String> difference2 = Sets.difference(toSets, formSets);
|
|
Sets.SetView<String> difference2 = Sets.difference(toSets, formSets);
|
|
- difference2.forEach(set2 -> System.out.println(set2));
|
|
|
|
|
|
+ difference2.forEach(set2 -> System.out.println(set2));*/
|
|
|
|
|
|
Set<String> diff = difference.stream().map(entity -> StrUtil.subBefore(entity, MigrationConstant.SPLITER_UNION, true)).collect(Collectors.toSet());
|
|
Set<String> diff = difference.stream().map(entity -> StrUtil.subBefore(entity, MigrationConstant.SPLITER_UNION, true)).collect(Collectors.toSet());
|
|
Map<String, Object> results = getValueForMapByKeys(diff, from);
|
|
Map<String, Object> results = getValueForMapByKeys(diff, from);
|
|
@@ -406,18 +406,27 @@ public class MigrationAbstractServiceImpl<T> implements MigrationAbstractService
|
|
log.error(ResponseCode.C0001.toString());
|
|
log.error(ResponseCode.C0001.toString());
|
|
return DataMigrationResponse.error(ResponseCode.C0001.toString());
|
|
return DataMigrationResponse.error(ResponseCode.C0001.toString());
|
|
}
|
|
}
|
|
- String response = commitDataByHttp(url, body);
|
|
|
|
- CommonResult<List> commonResult = JSONUtil.toBean(response, CommonResult.class);
|
|
|
|
- if(commonResult.getResult().equals(DmpResult.SUCCESS)){
|
|
|
|
- ArrayNode arrayNode = JsonNodeUtils.toArrayNode(commonResult.getData(), null, null);
|
|
|
|
- if(arrayNode == null){
|
|
|
|
- return DataMigrationResponse.success();
|
|
|
|
|
|
+ try{
|
|
|
|
+ String response = commitDataByHttp(url, body);
|
|
|
|
+ if(response.equals("Bad Gateway")){
|
|
|
|
+ return DataMigrationResponse.error("Bad Gateway");
|
|
}
|
|
}
|
|
- return DataMigrationResponse.success(JsonNodeUtils.toEntity(arrayNode, clazz, null));
|
|
|
|
- }else {
|
|
|
|
- log.error(commonResult.getMessage());
|
|
|
|
- return DataMigrationResponse.error(commonResult.getMessage());
|
|
|
|
|
|
+ CommonResult<List> commonResult = JSONUtil.toBean(response, CommonResult.class);
|
|
|
|
+ if(commonResult.getResult().equals(DmpResult.SUCCESS)){
|
|
|
|
+ ArrayNode arrayNode = JsonNodeUtils.toArrayNode(commonResult.getData(), null, null);
|
|
|
|
+ if(arrayNode == null){
|
|
|
|
+ return DataMigrationResponse.success();
|
|
|
|
+ }
|
|
|
|
+ return DataMigrationResponse.success(JsonNodeUtils.toEntity(arrayNode, clazz, null));
|
|
|
|
+ }else {
|
|
|
|
+ log.error(commonResult.getMessage());
|
|
|
|
+ return DataMigrationResponse.error(commonResult.getMessage());
|
|
|
|
+ }
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ log.error(e.getMessage());
|
|
|
|
+ return DataMigrationResponse.error(e.getMessage());
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|