@@ -709,6 +709,8 @@ func (this *ChartClassifyController) DeleteChartClassify() {
}
+ // 删除图表中的指标引用
+ _ = data_manage.DeleteEdbRelationByObjectId(req.ChartInfoId, utils.EDB_RELATION_CHART)
//新增操作日志
{
chartLog := new(data_manage.ChartInfoLog)
@@ -637,7 +637,8 @@ func (this *SandboxController) Delete() {
br.Msg = err.Error()
return
-
+ _ = data_manage.DeleteEdbRelationByObjectId(req.SandboxId, utils.EDB_RELATION_SANDBOX)
msg := "删除成功"
br.Ret = 200
br.Success = true
@@ -11,3 +11,11 @@ func GetEdbDataMysteelChemicalMaxOrMinDate(edbCode string) (minDate, maxDate str
err = o.Raw(sql, edbCode).QueryRow(&minDate, &maxDate)
+
+// 更新钢联化工指标的刷新状态
+func UpdateMysteelChemicalRefreshStatus(edbCode string, isStop int) (err error) {
+ o := orm.NewOrmUsingDB("data")
+ sql := ` UPDATE base_from_mysteel_chemical_index SET is_stop = ? WHERE index_code =? and is_stop=1`
+ _, err = o.Raw(sql, isStop, edbCode).Exec()
+ return
+}
@@ -219,6 +219,14 @@ func DeleteEdbRelationByObjectIds(referObjectIds []int, referObjectType int) (er
+// DeleteEdbRelationByObjectId 删除指标引用内容
+func DeleteEdbRelationByObjectId(referObjectId int, referObjectType int) (err error) {
+ o := orm.NewOrm()
+ sql := ` DELETE FROM edb_info_relation WHERE refer_object_id =? AND refer_object_type=?`
+ _, err = o.Raw(sql, referObjectId, referObjectType).Exec()
type BaseRelationEdbInfo struct {
EdbInfoId int
ClassifyId int `description:"指标分类id"`
@@ -1903,6 +1903,12 @@ func EdbInfoAdd(source, subSource, classifyId int, edbCode, edbName, frequency,
//添加es
AddOrEditEdbInfoToEs(int(edbInfoId))
+ // 更新钢联化工状态为启用
+ if edbInfo.Source == utils.DATA_SOURCE_MYSTEEL_CHEMICAL {
+ // 启动钢联的刷新
+ _ = data_manage.UpdateMysteelChemicalRefreshStatus(edbCode, 1)
+ }