1、bug fix

This commit is contained in:
2025-11-19 18:08:00 +08:00
parent f8dab615ff
commit d94a7778af
2 changed files with 15 additions and 12 deletions

View File

@@ -617,13 +617,15 @@ public class DemandServiceImpl extends BaseService implements IDemandService {
// if (CollectionUtils.isNotEmpty(tag1)) {
// tag1.get(tag1.size() - 1);
// }
List<String> tagListProperty;
String tagListProperty;
String lastNodeId = "";
for (int i = 1; i <= 10; i++) {
try {
tagListProperty = getTagListProperty(taskNode, "tag" + i);
if (CollectionUtils.isNotEmpty(tagListProperty)) {
lastNodeId = tagListProperty.get(tagListProperty.size() - 1);
if (StringUtils.isNotBlank(tagListProperty)) {
// lastNodeId = tagListProperty.get(tagListProperty.size() - 1);
String[] lastNodeIdArr = tagListProperty.split(",");
lastNodeId = lastNodeIdArr[lastNodeIdArr.length - 1];
}
} catch (Exception e) {
throw new RuntimeException(e);

View File

@@ -765,11 +765,11 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
return (String) field.get(obj);
}
public static List<String> getTagListProperty(Object obj, String propertyName) throws Exception {
public static String getTagListProperty(Object obj, String propertyName) throws Exception {
Class<?> clazz = obj.getClass();
Field field = clazz.getDeclaredField(propertyName);
field.setAccessible(true);
return (List<String>) field.get(obj);
return (String) field.get(obj);
}
@Override
@@ -1175,7 +1175,7 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
addNode.setUuid(RandomUtil.generateString(32));
addNode.setOwnRootNodeUuid(ObjectUtils.isEmpty(addNode.getPid()) ? addNode.getUuid() : addNode.getPid());
addNode.setCreateTime(curDateStr);
addNode.setCreator(jobNumber);
// addNode.setCreator(jobNumber);
addNode.setTenantId(tenantId);
// 复制标签信息
copyTagInfoFromParentNode(addNode, tagMap.get(nodeType),parentNode, tagMap.get(parentNodeType));
@@ -1186,7 +1186,7 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
for (SpdmNodeExtraReq extra : extras) {
extra.setNodeId(addNode.getUuid());
extra.setCreateTime(curDateStr);
extra.setCreator(jobNumber);
// extra.setCreator(jobNumber);
}
nodeExtraReqList.addAll(extras);
}
@@ -1221,11 +1221,11 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
* @param parentNodeTag 当前新增节点的父节点的标签
*/
private void copyTagInfoFromParentNode(SpdmProjectNodeEditReq addNode,String addNodeTag, SimulationNode parentNode,String parentNodeTag) {
List<String> tagListProperty;
String tagListProperty;
for (int i = 1; i <= 10; i++) {
try {
tagListProperty = getTagListProperty(parentNode, "tag" + i);
if (CollectionUtils.isEmpty(tagListProperty)) {
if (StringUtils.isBlank(tagListProperty)) {
continue;
}
setTagProperty(addNode, "tag" + i, tagListProperty);
@@ -1237,7 +1237,8 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
// 如果新增节点与父节点的类型相同需要将当前新增节点的uuid追加到该类型标签中
try {
tagListProperty = getTagListProperty(parentNode, parentNodeTag);
tagListProperty.add(addNode.getUuid());
tagListProperty = tagListProperty + "," + addNode.getUuid();
// tagListProperty.add(addNode.getUuid());
setTagProperty(addNode, addNodeTag, tagListProperty);
} catch (Exception e) {
throw new RuntimeException(e);
@@ -1327,11 +1328,11 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
* @param parentNode 当前新增节点的父节点
*/
private void copyTaskTagInfoFromParentNode(TaskNode addNode, SimulationNode parentNode) {
List<String> tagListProperty;
String tagListProperty;
for (int i = 1; i <= 10; i++) {
try {
tagListProperty = getTagListProperty(parentNode, "tag" + i);
if (CollectionUtils.isEmpty(tagListProperty)) {
if (StringUtils.isBlank(tagListProperty)) {
continue;
}
setTagProperty(addNode, "tag" + i, tagListProperty);