fix: 修改模块名称报错
This commit is contained in:
parent
9cb5c64925
commit
1566f8c79b
|
@ -213,9 +213,10 @@ public class ApiModuleService extends NodeTreeService<ApiModuleDTO> {
|
|||
public int editNode(DragModuleRequest request) {
|
||||
request.setUpdateTime(System.currentTimeMillis());
|
||||
checkApiModuleExist(request);
|
||||
List<ApiDefinitionResult> apiModule = queryByModuleIds(request.getNodeIds());
|
||||
List<ApiDefinitionResult> apiDefinitionResults = queryByModuleIds(request.getNodeIds());
|
||||
|
||||
apiModule.forEach(apiDefinition -> {
|
||||
apiDefinitionResults.forEach(apiDefinition -> {
|
||||
if (StringUtils.isNotBlank(apiDefinition.getModulePath())) {
|
||||
StringBuilder path = new StringBuilder(apiDefinition.getModulePath());
|
||||
List<String> pathLists = Arrays.asList(path.toString().split("/"));
|
||||
pathLists.set(request.getLevel(), request.getName());
|
||||
|
@ -224,9 +225,10 @@ public class ApiModuleService extends NodeTreeService<ApiModuleDTO> {
|
|||
path = path.append("/").append(pathLists.get(i));
|
||||
}
|
||||
apiDefinition.setModulePath(path.toString());
|
||||
}
|
||||
});
|
||||
|
||||
batchUpdateApiDefinition(apiModule);
|
||||
batchUpdateApiDefinition(apiDefinitionResults);
|
||||
|
||||
return apiModuleMapper.updateByPrimaryKeySelective(request);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue