|
@@ -68,6 +68,26 @@ func (tableEventService *TableEventService) HandlerTableAffectedMarkToConflictSt |
|
@@ -68,6 +68,26 @@ func (tableEventService *TableEventService) HandlerTableAffectedMarkToConflictSt |
68
|
}
|
68
|
}
|
69
|
}
|
69
|
}
|
70
|
|
70
|
|
|
|
71
|
+ //tableDependencyService, _ := domainService.NewTableDependencyService(transactionContext.(*pgTransaction.TransactionContext))
|
|
|
72
|
+ //tableDependTree := tableDependencyService.TableDependTree(tables, tableId)
|
|
|
73
|
+ //tree := tableDependTree.Tree
|
|
|
74
|
+ //
|
|
|
75
|
+ //querySetRepository, _, _ := factory.FastPgQuerySet(transactionContext, 0)
|
|
|
76
|
+ //if len(tree) > 0 {
|
|
|
77
|
+ // _, querySets, _ := querySetRepository.Find(map[string]interface{}{
|
|
|
78
|
+ // "types": []string{domain.SchemaTable.ToString(), domain.SubProcessTable.ToString(), domain.CalculateTable.ToString()},
|
|
|
79
|
+ // "bindTableIds": tree,
|
|
|
80
|
+ // })
|
|
|
81
|
+ // for _, querySet := range querySets {
|
|
|
82
|
+ // log.Logger.Debug(fmt.Sprintf("【集合状态更新】 id:%v name:%v 标记冲突", querySet.QuerySetId, querySet.Name))
|
|
|
83
|
+ // querySet.QuerySetInfo.WithConflictStatus()
|
|
|
84
|
+ // _, err = querySetRepository.Save(querySet)
|
|
|
85
|
+ // if err != nil {
|
|
|
86
|
+ // return nil, err
|
|
|
87
|
+ // }
|
|
|
88
|
+ // }
|
|
|
89
|
+ //}
|
|
|
90
|
+
|
71
|
if err := transactionContext.CommitTransaction(); err != nil {
|
91
|
if err := transactionContext.CommitTransaction(); err != nil {
|
72
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
92
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
73
|
}
|
93
|
}
|
|
@@ -90,6 +110,7 @@ func checkStructChange(cmd *command.TableEventCommand) bool { |
|
@@ -90,6 +110,7 @@ func checkStructChange(cmd *command.TableEventCommand) bool { |
90
|
|
110
|
|
91
|
switch t {
|
111
|
switch t {
|
92
|
case domain.SchemaTable.ToString(), domain.SubProcessTable.ToString():
|
112
|
case domain.SchemaTable.ToString(), domain.SubProcessTable.ToString():
|
|
|
113
|
+ // 第一步表有变更
|
93
|
newSetDepTables := newSet.GetDependencyTables(newSet.QueryComponents)
|
114
|
newSetDepTables := newSet.GetDependencyTables(newSet.QueryComponents)
|
94
|
oldSetDepTables := newSet.GetDependencyTables(oldSet.QueryComponents)
|
115
|
oldSetDepTables := newSet.GetDependencyTables(oldSet.QueryComponents)
|
95
|
sort.SliceStable(newSetDepTables, func(i, j int) bool {
|
116
|
sort.SliceStable(newSetDepTables, func(i, j int) bool {
|
|
@@ -103,9 +124,14 @@ func checkStructChange(cmd *command.TableEventCommand) bool { |
|
@@ -103,9 +124,14 @@ func checkStructChange(cmd *command.TableEventCommand) bool { |
103
|
return true
|
124
|
return true
|
104
|
}
|
125
|
}
|
105
|
case domain.CalculateTable.ToString():
|
126
|
case domain.CalculateTable.ToString():
|
|
|
127
|
+
|
|
|
128
|
+ case domain.CalculateItem.ToString(), domain.CalculateSet.ToString():
|
|
|
129
|
+ return false
|
|
|
130
|
+ }
|
106
|
if newTable == nil || oldTable == nil {
|
131
|
if newTable == nil || oldTable == nil {
|
107
|
return false
|
132
|
return false
|
108
|
}
|
133
|
}
|
|
|
134
|
+ // 第二步判断字段是否有变更
|
109
|
newTableFields := tableFields(newTable)
|
135
|
newTableFields := tableFields(newTable)
|
110
|
oldTableFields := tableFields(oldTable)
|
136
|
oldTableFields := tableFields(oldTable)
|
111
|
sort.Strings(newTableFields)
|
137
|
sort.Strings(newTableFields)
|
|
@@ -114,9 +140,6 @@ func checkStructChange(cmd *command.TableEventCommand) bool { |
|
@@ -114,9 +140,6 @@ func checkStructChange(cmd *command.TableEventCommand) bool { |
114
|
log.Logger.Debug(fmt.Sprintf("计算表:%v 结构变更 %v -> %v", t, oldTableFields, newTableFields))
|
140
|
log.Logger.Debug(fmt.Sprintf("计算表:%v 结构变更 %v -> %v", t, oldTableFields, newTableFields))
|
115
|
return true
|
141
|
return true
|
116
|
}
|
142
|
}
|
117
|
- case domain.CalculateItem.ToString(), domain.CalculateSet.ToString():
|
|
|
118
|
- return false
|
|
|
119
|
- }
|
|
|
120
|
return false
|
143
|
return false
|
121
|
}
|
144
|
}
|
122
|
|
145
|
|