edb_delete_log.go 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. package data_stat
  2. import (
  3. "eta/eta_api/models/data_manage"
  4. "eta/eta_api/models/data_stat"
  5. "eta/eta_api/models/system"
  6. "eta/eta_api/utils"
  7. "fmt"
  8. "time"
  9. )
  10. func AddEdbDeleteLog(edbInfo *data_manage.EdbInfo, sysUser *system.Admin) (err error) {
  11. if edbInfo != nil {
  12. log := new(data_stat.EdbInfoDeleteLog)
  13. log.EdbInfoId = edbInfo.EdbInfoId
  14. log.EdbInfoType = edbInfo.EdbInfoType
  15. log.SourceName = edbInfo.SourceName
  16. log.Source = edbInfo.Source
  17. log.EdbCode = edbInfo.EdbCode
  18. log.EdbName = edbInfo.EdbName
  19. log.EdbNameEn = edbInfo.EdbNameEn
  20. log.EdbNameSource = edbInfo.SourceIndexName
  21. log.Frequency = edbInfo.Frequency
  22. log.Unit = edbInfo.Unit
  23. log.UnitEn = edbInfo.UnitEn
  24. log.StartDate = edbInfo.StartDate
  25. log.EndDate = edbInfo.EndDate
  26. log.SysUserId = edbInfo.SysUserId
  27. log.SysUserRealName = edbInfo.SysUserRealName
  28. log.UniqueCode = edbInfo.UniqueCode
  29. log.EdbCreateTime = edbInfo.CreateTime.Format(utils.FormatDateTime)
  30. log.EdbModifyTime = edbInfo.ModifyTime.Format(utils.FormatDateTime)
  31. log.CreateTime = time.Now().Format(utils.FormatDateTime)
  32. log.MinValue = edbInfo.MinValue
  33. log.MaxValue = edbInfo.MaxValue
  34. log.CalculateFormula = edbInfo.CalculateFormula
  35. log.EdbType = edbInfo.EdbType
  36. log.LatestDate = edbInfo.LatestDate
  37. log.LatestValue = edbInfo.LatestValue
  38. log.MoveType = edbInfo.MoveType
  39. log.MoveFrequency = edbInfo.MoveFrequency
  40. log.NoUpdate = edbInfo.NoUpdate
  41. log.ChartImage = edbInfo.ChartImage
  42. log.Calendar = edbInfo.Calendar
  43. log.DataDateType = edbInfo.DataDateType
  44. log.ManualSave = edbInfo.ManualSave
  45. log.TerminalCode = edbInfo.TerminalCode
  46. log.DelSysUserId = sysUser.AdminId
  47. log.DelSysUserRealName = sysUser.RealName
  48. log.DataUpdateTime = edbInfo.DataUpdateTime
  49. log.ErDataUpdateDate = edbInfo.ErDataUpdateDate
  50. _, err = data_stat.AddEdbDeleteLog(log)
  51. if err != nil {
  52. err = fmt.Errorf("新增指标删除日志失败,Err: %s", err)
  53. return
  54. }
  55. }
  56. return
  57. }