fix(用例管理): 修改用例脑图空节点报错信息

--bug=1045765 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001045765
This commit is contained in:
guoyuqi 2024-09-06 18:16:53 +08:00 committed by Craftsman
parent 1320bfe264
commit 2fd3ce8c88
1 changed files with 6 additions and 6 deletions

View File

@ -777,12 +777,12 @@ public class FunctionalCaseMinderService {
private MindAdditionalNode updateNode(String userId, MindAdditionalNodeRequest mindAdditionalNodeRequest, MindAdditionalNodeMapper mindAdditionalNodeMapper) { private MindAdditionalNode updateNode(String userId, MindAdditionalNodeRequest mindAdditionalNodeRequest, MindAdditionalNodeMapper mindAdditionalNodeMapper) {
MindAdditionalNode mindAdditionalNode = new MindAdditionalNode(); MindAdditionalNode mindAdditionalNode = new MindAdditionalNode();
mindAdditionalNode.setId(mindAdditionalNodeRequest.getId()); mindAdditionalNode.setId(mindAdditionalNodeRequest.getId());
if (mindAdditionalNodeRequest.getName().length() > 255) {
mindAdditionalNodeRequest.setName(mindAdditionalNodeRequest.getName().substring(0, 249));
}
if (StringUtils.isBlank(mindAdditionalNodeRequest.getName())) { if (StringUtils.isBlank(mindAdditionalNodeRequest.getName())) {
throw new MSException(Translator.get("minder_extra_node.text_node_empty")); throw new MSException(Translator.get("minder_extra_node.text_node_empty"));
} }
if (mindAdditionalNodeRequest.getName().length() > 255) {
mindAdditionalNodeRequest.setName(mindAdditionalNodeRequest.getName().substring(0, 249));
}
mindAdditionalNode.setName(mindAdditionalNodeRequest.getName()); mindAdditionalNode.setName(mindAdditionalNodeRequest.getName());
mindAdditionalNode.setParentId(mindAdditionalNodeRequest.getParentId()); mindAdditionalNode.setParentId(mindAdditionalNodeRequest.getParentId());
mindAdditionalNode.setUpdateTime(System.currentTimeMillis()); mindAdditionalNode.setUpdateTime(System.currentTimeMillis());
@ -795,12 +795,12 @@ public class FunctionalCaseMinderService {
private MindAdditionalNode buildNode(FunctionalCaseMinderEditRequest request, String userId, MindAdditionalNodeRequest mindAdditionalNodeRequest, MindAdditionalNodeMapper additionalNodeMapper) { private MindAdditionalNode buildNode(FunctionalCaseMinderEditRequest request, String userId, MindAdditionalNodeRequest mindAdditionalNodeRequest, MindAdditionalNodeMapper additionalNodeMapper) {
MindAdditionalNode mindAdditionalNode = new MindAdditionalNode(); MindAdditionalNode mindAdditionalNode = new MindAdditionalNode();
mindAdditionalNode.setId(mindAdditionalNodeRequest.getId()); mindAdditionalNode.setId(mindAdditionalNodeRequest.getId());
if (mindAdditionalNodeRequest.getName().length() > 255) {
mindAdditionalNodeRequest.setName(mindAdditionalNodeRequest.getName().substring(0, 249));
}
if (StringUtils.isBlank(mindAdditionalNodeRequest.getName())) { if (StringUtils.isBlank(mindAdditionalNodeRequest.getName())) {
throw new MSException(Translator.get("minder_extra_node.text_node_empty")); throw new MSException(Translator.get("minder_extra_node.text_node_empty"));
} }
if (mindAdditionalNodeRequest.getName().length() > 255) {
mindAdditionalNodeRequest.setName(mindAdditionalNodeRequest.getName().substring(0, 249));
}
mindAdditionalNode.setName(mindAdditionalNodeRequest.getName()); mindAdditionalNode.setName(mindAdditionalNodeRequest.getName());
mindAdditionalNode.setParentId(mindAdditionalNodeRequest.getParentId()); mindAdditionalNode.setParentId(mindAdditionalNodeRequest.getParentId());
mindAdditionalNode.setProjectId(request.getProjectId()); mindAdditionalNode.setProjectId(request.getProjectId());