|
@@ -1127,29 +1127,51 @@ func GetPredictCalculateDataListByPredictEdbInfo(edbInfo *data_manage.EdbInfo, s
|
|
|
}
|
|
|
|
|
|
|
|
|
-func ModifyPredictEdbBaseInfoBySourceEdb(sourceEDdbInfo *data_manage.EdbInfo) {
|
|
|
+func ModifyPredictEdbBaseInfoBySourceEdb(sourceEDdbInfo *data_manage.EdbInfo, frequency, unit string) {
|
|
|
list, err := data_manage.GetGroupPredictEdbBySourceEdbInfoId(sourceEDdbInfo.EdbInfoId)
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
for _, v := range list {
|
|
|
- v.Frequency = sourceEDdbInfo.Frequency
|
|
|
- v.Unit = sourceEDdbInfo.Unit
|
|
|
+ v.Frequency = frequency
|
|
|
+ v.Unit = unit
|
|
|
v.Update([]string{"Frequency", "Unit"})
|
|
|
AddOrEditEdbInfoToEs(v.EdbInfoId)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
-func ModifyPredictEdbEnBaseInfoBySourceEdb(sourceEDdbInfo *data_manage.EdbInfo) {
|
|
|
+func ModifyPredictEdbEnBaseInfoBySourceEdb(sourceEDdbInfo *data_manage.EdbInfo, unitEn string) {
|
|
|
list, err := data_manage.GetGroupPredictEdbBySourceEdbInfoId(sourceEDdbInfo.EdbInfoId)
|
|
|
if err != nil {
|
|
|
return
|
|
|
}
|
|
|
for _, v := range list {
|
|
|
- v.Frequency = sourceEDdbInfo.Frequency
|
|
|
- v.UnitEn = sourceEDdbInfo.UnitEn
|
|
|
- v.Update([]string{"Frequency", "UnitEn"})
|
|
|
+ v.UnitEn = unitEn
|
|
|
+ v.Update([]string{"UnitEn"})
|
|
|
AddOrEditEdbInfoToEs(v.EdbInfoId)
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+func ModifyPredictEdbUnitBySourceEdbInfoId(sourceEdbInfoId int, frequency, unit string) (err error) {
|
|
|
+ list, err := data_manage.GetGroupPredictEdbBySourceEdbInfoId(sourceEdbInfoId)
|
|
|
+ if err != nil {
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, v := range list {
|
|
|
+ v.Frequency = frequency
|
|
|
+ v.Unit = unit
|
|
|
+ v.Update([]string{"Frequency", "Unit"})
|
|
|
+ AddOrEditEdbInfoToEs(v.EdbInfoId)
|
|
|
+ }
|
|
|
+ return
|
|
|
+}
|