init_10.3.go 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. package services
  2. import (
  3. "fmt"
  4. "hongze/hongze_cygx/models"
  5. )
  6. //10.3版本上线需要更新的数据
  7. func init51111() {
  8. var condition string
  9. var pars []interface{}
  10. var err error
  11. fmt.Print()
  12. //处理上周纪要汇总
  13. condition = ` AND visible_range = 1 `
  14. listresearchsummary, err := models.GetReportSelectionListHome(condition, "cygx_minutes_summary", pars, 0, 100000)
  15. if err != nil {
  16. fmt.Println(err)
  17. }
  18. condition = ` AND source = 'minutessummary' `
  19. err = models.DeleteResourceDataList(condition, pars)
  20. if err != nil {
  21. fmt.Println(err)
  22. }
  23. for _, v := range listresearchsummary {
  24. go UpdateResourceData(v.ArticleId, "minutessummary", "add", v.PublishDate)
  25. }
  26. fmt.Println(listresearchsummary)
  27. }
  28. func init2222() {
  29. var condition string
  30. var pars []interface{}
  31. var err error
  32. fmt.Print()
  33. //处理本周纪要汇总
  34. condition = ` AND visible_range = 1 `
  35. listresearchsummary, err := models.GetReportSelectionListHome(condition, "cygx_research_summary", pars, 0, 100000)
  36. if err != nil {
  37. fmt.Println(err)
  38. }
  39. condition = ` AND source = 'researchsummary' `
  40. err = models.DeleteResourceDataList(condition, pars)
  41. if err != nil {
  42. fmt.Println(err)
  43. }
  44. for _, v := range listresearchsummary {
  45. go UpdateResourceData(v.ArticleId, "researchsummary", "add", v.PublishDate)
  46. }
  47. fmt.Println(listresearchsummary)
  48. }
  49. func init333() {
  50. var condition string
  51. var pars []interface{}
  52. var err error
  53. fmt.Print()
  54. //处理晨会精华
  55. listrMeet, err := models.GetCygxMorningMeetingReviewChapterList(condition, pars)
  56. if err != nil {
  57. fmt.Println(err)
  58. }
  59. condition = ` AND source = 'meetingreviewchapt' `
  60. err = models.DeleteResourceDataList(condition, pars)
  61. if err != nil {
  62. fmt.Println(err)
  63. }
  64. for _, v := range listrMeet {
  65. go UpdateResourceData(v.Id, "meetingreviewchapt", "add", v.PublishTime)
  66. }
  67. fmt.Println(listrMeet)
  68. }
  69. func init444() {
  70. listMap, err := models.GetCygxXzsChooseCategoryMapList()
  71. if err != nil {
  72. fmt.Println(err)
  73. }
  74. mapReport := make(map[int]int)
  75. for _, v := range listMap {
  76. mapReport[v.CategoryId] = v.Id
  77. }
  78. list, err := models.GetCygxXzsChooseCategoryWhithIdCygxList()
  79. if err != nil {
  80. fmt.Println(err)
  81. }
  82. for _, v := range list {
  83. fmt.Println(mapReport[v.CategoryId])
  84. err = models.UpdateCygxXzsChooseCategory(mapReport[v.CategoryId], v.Id)
  85. if err != nil {
  86. fmt.Println(err)
  87. }
  88. }
  89. }