|
|
@ -436,14 +436,38 @@ public class ResourcesService extends BaseService { |
|
|
|
if (CollectionUtils.isNotEmpty(childrenResource)) { |
|
|
|
if (CollectionUtils.isNotEmpty(childrenResource)) { |
|
|
|
String matcherFullName = Matcher.quoteReplacement(fullName); |
|
|
|
String matcherFullName = Matcher.quoteReplacement(fullName); |
|
|
|
List<Resource> childResourceList = new ArrayList<>(); |
|
|
|
List<Resource> childResourceList = new ArrayList<>(); |
|
|
|
List<Resource> resourceList = resourcesMapper.listResourceByIds(childrenResource.toArray(new Integer[childrenResource.size()])); |
|
|
|
Integer[] childResIdArray = childrenResource.toArray(new Integer[childrenResource.size()]); |
|
|
|
|
|
|
|
List<Resource> resourceList = resourcesMapper.listResourceByIds(childResIdArray); |
|
|
|
childResourceList = resourceList.stream().map(t -> { |
|
|
|
childResourceList = resourceList.stream().map(t -> { |
|
|
|
t.setFullName(t.getFullName().replaceFirst(originFullName, matcherFullName)); |
|
|
|
t.setFullName(t.getFullName().replaceFirst(originFullName, matcherFullName)); |
|
|
|
t.setUpdateTime(now); |
|
|
|
t.setUpdateTime(now); |
|
|
|
return t; |
|
|
|
return t; |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
}).collect(Collectors.toList()); |
|
|
|
resourcesMapper.batchUpdateResource(childResourceList); |
|
|
|
resourcesMapper.batchUpdateResource(childResourceList); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ResourceType.UDF.equals(resource.getType())) { |
|
|
|
|
|
|
|
List<UdfFunc> udfFuncs = udfFunctionMapper.listUdfByResourceId(childResIdArray); |
|
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(udfFuncs)) { |
|
|
|
|
|
|
|
udfFuncs = udfFuncs.stream().map(t -> { |
|
|
|
|
|
|
|
t.setResourceName(t.getResourceName().replaceFirst(originFullName, matcherFullName)); |
|
|
|
|
|
|
|
t.setUpdateTime(now); |
|
|
|
|
|
|
|
return t; |
|
|
|
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
|
|
|
udfFunctionMapper.batchUpdateUdfFunc(udfFuncs); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else if (ResourceType.UDF.equals(resource.getType())) { |
|
|
|
|
|
|
|
List<UdfFunc> udfFuncs = udfFunctionMapper.listUdfByResourceId(new Integer[]{resourceId}); |
|
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(udfFuncs)) { |
|
|
|
|
|
|
|
udfFuncs = udfFuncs.stream().map(t -> { |
|
|
|
|
|
|
|
t.setResourceName(fullName); |
|
|
|
|
|
|
|
t.setUpdateTime(now); |
|
|
|
|
|
|
|
return t; |
|
|
|
|
|
|
|
}).collect(Collectors.toList()); |
|
|
|
|
|
|
|
udfFunctionMapper.batchUpdateUdfFunc(udfFuncs); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
putMsg(result, Status.SUCCESS); |
|
|
|
putMsg(result, Status.SUCCESS); |
|
|
|