|
@@ -379,6 +379,11 @@ func editPredictCalculate(br *models.BaseResponse, req models.EdbInfoCalculateSa
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ // 记录旧的指标信息
|
|
|
+ oldEdbName := edbInfo.EdbName
|
|
|
+ oldFrequency := edbInfo.Frequency
|
|
|
+ oldUnit := edbInfo.Unit
|
|
|
+
|
|
|
// 根据指标名称和指标ID校验库中是否还存在其他同名指标
|
|
|
existEdbName, err := logic.CheckExistByEdbNameAndEdbInfoId(edbInfo.EdbInfoType, edbInfo.EdbInfoId, req.EdbName, lang)
|
|
|
if err != nil {
|
|
@@ -502,6 +507,26 @@ func editPredictCalculate(br *models.BaseResponse, req models.EdbInfoCalculateSa
|
|
|
br.ErrMsg = err.Error()
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+ // 记录基础信息变更日志
|
|
|
+ oldEdbInfo := new(models.EdbInfo)
|
|
|
+ oldEdbInfo.EdbInfoId = req.EdbInfoId
|
|
|
+ oldEdbInfo.EdbName = oldEdbName
|
|
|
+ oldEdbInfo.Frequency = oldFrequency
|
|
|
+ oldEdbInfo.Unit = oldUnit
|
|
|
+ newEdbInfoEditRecord := new(models.EdbInfoEditRecord)
|
|
|
+ newEdbInfoEditRecord.EdbName = req.EdbName
|
|
|
+ newEdbInfoEditRecord.Frequency = req.Frequency
|
|
|
+ newEdbInfoEditRecord.Unit = req.Unit
|
|
|
+ newEdbInfoEditRecord.OperateUserId = req.AdminId
|
|
|
+ newEdbInfoEditRecord.OperateUserRealName = req.AdminName
|
|
|
+ err = services.AddEditEdbInfoRcord(oldEdbInfo, newEdbInfoEditRecord)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "记录基础信息变更日志失败"
|
|
|
+ br.ErrMsg = err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
resp := models.AddEdbInfoResp{
|
|
|
EdbInfoId: edbInfo.EdbInfoId,
|
|
|
UniqueCode: edbInfo.UniqueCode,
|