fix 批量修改资源实例未展示模型关系
parent
89efe085c9
commit
a06384ca96
|
@ -776,6 +776,15 @@ public class InstanceServiceImpl implements InstanceService {
|
||||||
OperationalAudit audit = operationalAuditService.buildLog(OperationalAuditType.BATCH_MODIFY, "实例",
|
OperationalAudit audit = operationalAuditService.buildLog(OperationalAuditType.BATCH_MODIFY, "实例",
|
||||||
nameValue.getPropertyValue(), moduleCode, instance.getId(), userId, beforeMap, afterMap);
|
nameValue.getPropertyValue(), moduleCode, instance.getId(), userId, beforeMap, afterMap);
|
||||||
audits.add(audit);
|
audits.add(audit);
|
||||||
|
// 修改资源实例重新创建模型实例关联关系
|
||||||
|
List<ModuleRelation> relations = moduleRelationRepository.queryByModuleId(instance.getModuleId());
|
||||||
|
for (ModuleRelation relation : relations) {
|
||||||
|
String relationTable =
|
||||||
|
CmdbUtils.CMDB_INSTANCE_RELATION + relation.getRelationCategoryCode().toLowerCase();
|
||||||
|
instanceRelationRepository.removeByInstanceId(instance.getId(), instance.getModuleId(), relationTable, userId);
|
||||||
|
}
|
||||||
|
// 触发与已有实例之间绑定关系的任务
|
||||||
|
instanceAutoRelationService.instanceAutoRelation(instance, userId);
|
||||||
}
|
}
|
||||||
if (CollectionUtils.isNotEmpty(audits)) {
|
if (CollectionUtils.isNotEmpty(audits)) {
|
||||||
operationalAuditRepository.batchSave(audits, 100);
|
operationalAuditRepository.batchSave(audits, 100);
|
||||||
|
|
Loading…
Reference in New Issue