calendar.go 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. package roadshow
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type RsCalendarResearcher struct {
  7. RsCalendarResearcherId int `orm:"column(rs_calendar_researcher_id);pk"`
  8. RsCalendarId int `description:"日历活动id"`
  9. ResearcherId int `description:"研究员id"`
  10. ResearcherName string `description:"研究员名称"`
  11. StartDate string `description:"开始日期"`
  12. EndDate string `description:"结束日期"`
  13. StartTime string `description:"开始时间"`
  14. EndTime string `description:"结束时间"`
  15. StartWeek string `description:"开始日期对应周"`
  16. EndWeek string `description:"结束日期对应周"`
  17. CreateTime time.Time
  18. ModifyTime time.Time
  19. Status int `description:"状态:1:待接受,2:已接受,3:已拒绝,4:已删除,5:已撤回,6:已结束"`
  20. RefuseReason string `description:"拒绝理由"`
  21. RefuseTime time.Time `description:"拒绝时间"`
  22. DeleteReason string `description:"删除理由"`
  23. UnionCode string `description:"公开会议联合编码"`
  24. }
  25. func GetRsCalendarResearcher(endDate, endTime string) (list []*RsCalendarResearcher, err error) {
  26. sql := `SELECT * FROM rs_calendar_researcher WHERE status=1 AND status<>6 AND end_date=? AND end_time<=? `
  27. o := orm.NewOrm()
  28. _, err = o.Raw(sql, endDate, endTime).QueryRows(&list)
  29. return
  30. }
  31. func ModifyRsCalendarResearcherStatus(rsCalendarResearcherId int) (err error) {
  32. sql := ` UPDATE rs_calendar_researcher SET status=6,modify_time=NOW() WHERE rs_calendar_researcher_id=? `
  33. o := orm.NewOrm()
  34. _, err = o.Raw(sql, rsCalendarResearcherId).Exec()
  35. return
  36. }
  37. type RsMatters struct {
  38. RsMattersId int `orm:"column(rs_matters_id);pk"`
  39. SysUserId int `description:"添加事项人id"`
  40. SysUserRealName string `description:"创建人姓名"`
  41. StartDate string `description:"开始日期"`
  42. EndDate string `description:"结束日期"`
  43. StartTime string `description:"开始时间"`
  44. EndTime string `description:"结束时间"`
  45. StartWeek string `description:"开始日期周"`
  46. EndWeek string `description:"结束日期周"`
  47. MatterContent string `description:"事项内容"`
  48. Status int8 `description:"状态:1:进行中,6:已结束"`
  49. CreateTime time.Time `description:"创建时间"`
  50. ModifyTime time.Time `description:"修改时间"`
  51. IsSynced int `description:"是否与上海同步 0:未同步 1:已同步"`
  52. }
  53. func GetRsMatters(endDate, endTime string) (list []*RsMatters, err error) {
  54. sql := `SELECT * FROM rs_matters WHERE status<>6 AND end_date=? AND end_time<=? `
  55. o := orm.NewOrm()
  56. _, err = o.Raw(sql, endDate, endTime).QueryRows(&list)
  57. return
  58. }
  59. func ModifyRsMattersStatus(rsMattersId int) (err error) {
  60. sql := ` UPDATE rs_matters SET status=6,modify_time=NOW() WHERE rs_matters_id=? `
  61. o := orm.NewOrm()
  62. _, err = o.Raw(sql, rsMattersId).Exec()
  63. return
  64. }
  65. type RsCalendar struct {
  66. RsCalendarId int `orm:"column(rs_calendar_id);pk"`
  67. SysUserId int `description:"创建人id"`
  68. SysUserRealName string `description:"创建人名称"`
  69. ActivityType string `description:"活动类型"`
  70. RoadshowType string `description:"路演形式"`
  71. RoadshowPlatform string `description:"路演平台"`
  72. CompanyId int `description:"客户id"`
  73. CompanyName string `description:"客户名称"`
  74. Province string `description:"省"`
  75. ProvinceCode string `description:"省编码"`
  76. City string `description:"市"`
  77. CityCode string `description:"市编码"`
  78. Theme string `description:"会议主题"`
  79. CooperationName string `description:"合作方名称"`
  80. Title string `description:"展示在日历的标题"`
  81. Source int8 `description:"来源,0:自系统,1:上海方的"`
  82. CreateTime time.Time
  83. ModifyTime time.Time
  84. ActivityCategory string `description:"活动类别"`
  85. IsSynced int `description:"是否与上海同步 0:未同步 1:已同步"`
  86. UnionCode string `description:"公开会议联合编码"`
  87. }
  88. func GetRsCalendarById(rsCalendarId int) (item *RsCalendar, err error) {
  89. o := orm.NewOrm()
  90. sql := `SELECT * FROM rs_calendar WHERE rs_calendar_id=? `
  91. err = o.Raw(sql, rsCalendarId).QueryRow(&item)
  92. return
  93. }
  94. func GetRsCalendarResearcherById(rsCalendarId int) (item *RsCalendarResearcher, err error) {
  95. sql := `SELECT * FROM rs_calendar_researcher WHERE rs_calendar_researcher_id=? `
  96. o := orm.NewOrm()
  97. err = o.Raw(sql, rsCalendarId).QueryRow(&item)
  98. return
  99. }