|
@@ -34,6 +34,12 @@ func ImportAiPredictModelIndexAndData(imports []*aiPredictModel.AiPredictModelIm
|
|
|
updateCols := []string{indexOb.Cols().ClassifyId, indexOb.Cols().ModelFramework, indexOb.Cols().PredictDate, indexOb.Cols().PredictValue, indexOb.Cols().DirectionAccuracy, indexOb.Cols().AbsoluteDeviation, indexOb.Cols().ExtraConfig, indexOb.Cols().SysUserId, indexOb.Cols().SysUserRealName, indexOb.Cols().ModifyTime}
|
|
|
updateIndexes := make([]*aiPredictModel.AiPredictModelImportData, 0)
|
|
|
createIndexes := make([]*aiPredictModel.AiPredictModelImportData, 0)
|
|
|
+
|
|
|
+ maxSort, err := indexOb.GetSortMax()
|
|
|
+ if err != nil {
|
|
|
+ err = fmt.Errorf("获取标的最大排序失败, %v", err)
|
|
|
+ return
|
|
|
+ }
|
|
|
for _, v := range imports {
|
|
|
exist := indexNameItem[v.Index.IndexName]
|
|
|
// 编辑
|
|
@@ -53,7 +59,7 @@ func ImportAiPredictModelIndexAndData(imports []*aiPredictModel.AiPredictModelIm
|
|
|
b, _ := json.Marshal(oldConfig)
|
|
|
v.Index.ExtraConfig = string(b)
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
v.Index.AiPredictModelIndexId = exist.AiPredictModelIndexId
|
|
|
v.Index.IndexCode = exist.IndexCode
|
|
|
updateIndexes = append(updateIndexes, v)
|
|
@@ -68,6 +74,8 @@ func ImportAiPredictModelIndexAndData(imports []*aiPredictModel.AiPredictModelIm
|
|
|
}
|
|
|
v.Index.IndexCode = indexCode
|
|
|
v.Charts = GetAiPredictCharts(v.Index.IndexName, adminId, adminRealName)
|
|
|
+ maxSort = maxSort + 1
|
|
|
+ v.Index.Sort = maxSort
|
|
|
createIndexes = append(createIndexes, v)
|
|
|
}
|
|
|
|