1、bug fix
This commit is contained in:
@@ -617,13 +617,15 @@ public class DemandServiceImpl extends BaseService implements IDemandService {
|
|||||||
// if (CollectionUtils.isNotEmpty(tag1)) {
|
// if (CollectionUtils.isNotEmpty(tag1)) {
|
||||||
// tag1.get(tag1.size() - 1);
|
// tag1.get(tag1.size() - 1);
|
||||||
// }
|
// }
|
||||||
List<String> tagListProperty;
|
String tagListProperty;
|
||||||
String lastNodeId = "";
|
String lastNodeId = "";
|
||||||
for (int i = 1; i <= 10; i++) {
|
for (int i = 1; i <= 10; i++) {
|
||||||
try {
|
try {
|
||||||
tagListProperty = getTagListProperty(taskNode, "tag" + i);
|
tagListProperty = getTagListProperty(taskNode, "tag" + i);
|
||||||
if (CollectionUtils.isNotEmpty(tagListProperty)) {
|
if (StringUtils.isNotBlank(tagListProperty)) {
|
||||||
lastNodeId = tagListProperty.get(tagListProperty.size() - 1);
|
// lastNodeId = tagListProperty.get(tagListProperty.size() - 1);
|
||||||
|
String[] lastNodeIdArr = tagListProperty.split(",");
|
||||||
|
lastNodeId = lastNodeIdArr[lastNodeIdArr.length - 1];
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
|||||||
@@ -765,11 +765,11 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
|||||||
return (String) field.get(obj);
|
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();
|
Class<?> clazz = obj.getClass();
|
||||||
Field field = clazz.getDeclaredField(propertyName);
|
Field field = clazz.getDeclaredField(propertyName);
|
||||||
field.setAccessible(true);
|
field.setAccessible(true);
|
||||||
return (List<String>) field.get(obj);
|
return (String) field.get(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -1175,7 +1175,7 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
|||||||
addNode.setUuid(RandomUtil.generateString(32));
|
addNode.setUuid(RandomUtil.generateString(32));
|
||||||
addNode.setOwnRootNodeUuid(ObjectUtils.isEmpty(addNode.getPid()) ? addNode.getUuid() : addNode.getPid());
|
addNode.setOwnRootNodeUuid(ObjectUtils.isEmpty(addNode.getPid()) ? addNode.getUuid() : addNode.getPid());
|
||||||
addNode.setCreateTime(curDateStr);
|
addNode.setCreateTime(curDateStr);
|
||||||
addNode.setCreator(jobNumber);
|
// addNode.setCreator(jobNumber);
|
||||||
addNode.setTenantId(tenantId);
|
addNode.setTenantId(tenantId);
|
||||||
// 复制标签信息
|
// 复制标签信息
|
||||||
copyTagInfoFromParentNode(addNode, tagMap.get(nodeType),parentNode, tagMap.get(parentNodeType));
|
copyTagInfoFromParentNode(addNode, tagMap.get(nodeType),parentNode, tagMap.get(parentNodeType));
|
||||||
@@ -1186,7 +1186,7 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
|||||||
for (SpdmNodeExtraReq extra : extras) {
|
for (SpdmNodeExtraReq extra : extras) {
|
||||||
extra.setNodeId(addNode.getUuid());
|
extra.setNodeId(addNode.getUuid());
|
||||||
extra.setCreateTime(curDateStr);
|
extra.setCreateTime(curDateStr);
|
||||||
extra.setCreator(jobNumber);
|
// extra.setCreator(jobNumber);
|
||||||
}
|
}
|
||||||
nodeExtraReqList.addAll(extras);
|
nodeExtraReqList.addAll(extras);
|
||||||
}
|
}
|
||||||
@@ -1221,11 +1221,11 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
|||||||
* @param parentNodeTag 当前新增节点的父节点的标签
|
* @param parentNodeTag 当前新增节点的父节点的标签
|
||||||
*/
|
*/
|
||||||
private void copyTagInfoFromParentNode(SpdmProjectNodeEditReq addNode,String addNodeTag, SimulationNode parentNode,String parentNodeTag) {
|
private void copyTagInfoFromParentNode(SpdmProjectNodeEditReq addNode,String addNodeTag, SimulationNode parentNode,String parentNodeTag) {
|
||||||
List<String> tagListProperty;
|
String tagListProperty;
|
||||||
for (int i = 1; i <= 10; i++) {
|
for (int i = 1; i <= 10; i++) {
|
||||||
try {
|
try {
|
||||||
tagListProperty = getTagListProperty(parentNode, "tag" + i);
|
tagListProperty = getTagListProperty(parentNode, "tag" + i);
|
||||||
if (CollectionUtils.isEmpty(tagListProperty)) {
|
if (StringUtils.isBlank(tagListProperty)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
setTagProperty(addNode, "tag" + i, tagListProperty);
|
setTagProperty(addNode, "tag" + i, tagListProperty);
|
||||||
@@ -1237,7 +1237,8 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
|||||||
// 如果新增节点与父节点的类型相同,需要将当前新增节点的uuid追加到该类型标签中
|
// 如果新增节点与父节点的类型相同,需要将当前新增节点的uuid追加到该类型标签中
|
||||||
try {
|
try {
|
||||||
tagListProperty = getTagListProperty(parentNode, parentNodeTag);
|
tagListProperty = getTagListProperty(parentNode, parentNodeTag);
|
||||||
tagListProperty.add(addNode.getUuid());
|
tagListProperty = tagListProperty + "," + addNode.getUuid();
|
||||||
|
// tagListProperty.add(addNode.getUuid());
|
||||||
setTagProperty(addNode, addNodeTag, tagListProperty);
|
setTagProperty(addNode, addNodeTag, tagListProperty);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
@@ -1327,11 +1328,11 @@ public class NodeServiceImpl extends ServiceImpl<SimulationNodeMapper, Simulatio
|
|||||||
* @param parentNode 当前新增节点的父节点
|
* @param parentNode 当前新增节点的父节点
|
||||||
*/
|
*/
|
||||||
private void copyTaskTagInfoFromParentNode(TaskNode addNode, SimulationNode parentNode) {
|
private void copyTaskTagInfoFromParentNode(TaskNode addNode, SimulationNode parentNode) {
|
||||||
List<String> tagListProperty;
|
String tagListProperty;
|
||||||
for (int i = 1; i <= 10; i++) {
|
for (int i = 1; i <= 10; i++) {
|
||||||
try {
|
try {
|
||||||
tagListProperty = getTagListProperty(parentNode, "tag" + i);
|
tagListProperty = getTagListProperty(parentNode, "tag" + i);
|
||||||
if (CollectionUtils.isEmpty(tagListProperty)) {
|
if (StringUtils.isBlank(tagListProperty)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
setTagProperty(addNode, "tag" + i, tagListProperty);
|
setTagProperty(addNode, "tag" + i, tagListProperty);
|
||||||
|
|||||||
Reference in New Issue
Block a user