|
@@ -5,6 +5,7 @@ import (
|
|
"errors"
|
|
"errors"
|
|
"fmt"
|
|
"fmt"
|
|
"hongze/hongze_task/models"
|
|
"hongze/hongze_task/models"
|
|
|
|
+ "hongze/hongze_task/models/cygx"
|
|
"hongze/hongze_task/models/roadshow"
|
|
"hongze/hongze_task/models/roadshow"
|
|
"hongze/hongze_task/utils"
|
|
"hongze/hongze_task/utils"
|
|
"strconv"
|
|
"strconv"
|
|
@@ -31,6 +32,15 @@ func AddReportRecord(cont context.Context) (err error) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ listEmail, err := cygx.GetAskEmail() //权益研究员姓名
|
|
|
|
+ if err != nil {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ mapResearcherNameRai := make(map[string]bool)
|
|
|
|
+ for _, v := range listEmail {
|
|
|
|
+ mapResearcherNameRai[v.Name] = true
|
|
|
|
+ }
|
|
|
|
+
|
|
companyList, err := roadshow.RsCompanyList()
|
|
companyList, err := roadshow.RsCompanyList()
|
|
if err != nil {
|
|
if err != nil {
|
|
return
|
|
return
|
|
@@ -157,6 +167,9 @@ func AddReportRecord(cont context.Context) (err error) {
|
|
|
|
|
|
mapRsReportRecordPermission := make(map[string]bool) // 一个公司的一场路演,添加了多个研究员只记录一次
|
|
mapRsReportRecordPermission := make(map[string]bool) // 一个公司的一场路演,添加了多个研究员只记录一次
|
|
for _, v := range list {
|
|
for _, v := range list {
|
|
|
|
+ if mapResearcherNameRai[v.ResearcherName] && v.CompanyName == "" && v.Source == 1 && v.ActivityType == "路演" {
|
|
|
|
+ continue // 如果权益研究员的而且公司名称为空,而且是上海那边同步过来的路演就不做记录
|
|
|
|
+ }
|
|
company := new(roadshow.CompanySearchView)
|
|
company := new(roadshow.CompanySearchView)
|
|
if v.CompanyId > 0 {
|
|
if v.CompanyId > 0 {
|
|
if mapRaiSllerId[v.SysUserId] {
|
|
if mapRaiSllerId[v.SysUserId] {
|
|
@@ -232,6 +245,7 @@ func AddReportRecord(cont context.Context) (err error) {
|
|
reportUpdateParams["rs_calendar_researcher_status"] = v.Status
|
|
reportUpdateParams["rs_calendar_researcher_status"] = v.Status
|
|
reportUpdateParams["activity_type"] = v.ActivityType
|
|
reportUpdateParams["activity_type"] = v.ActivityType
|
|
reportUpdateParams["roadshow_type"] = v.RoadshowType
|
|
reportUpdateParams["roadshow_type"] = v.RoadshowType
|
|
|
|
+ reportUpdateParams["question_status"] = v.QuestionStatus
|
|
reportUpdateParams["modify_time"] = time.Now()
|
|
reportUpdateParams["modify_time"] = time.Now()
|
|
err = roadshow.UpdateRsReportRecord(reportWhereParams, reportUpdateParams)
|
|
err = roadshow.UpdateRsReportRecord(reportWhereParams, reportUpdateParams)
|
|
} else { //新增
|
|
} else { //新增
|
|
@@ -278,6 +292,7 @@ func AddReportRecord(cont context.Context) (err error) {
|
|
item.ModifyTime = time.Now()
|
|
item.ModifyTime = time.Now()
|
|
item.RsCalendarResearcherStatus = v.Status
|
|
item.RsCalendarResearcherStatus = v.Status
|
|
item.RoadshowType = v.RoadshowType
|
|
item.RoadshowType = v.RoadshowType
|
|
|
|
+ item.QuestionStatus = v.QuestionStatus
|
|
item.InteractionNum = mapInteractionNum[v.CompanyId]
|
|
item.InteractionNum = mapInteractionNum[v.CompanyId]
|
|
_, err = roadshow.AddRsReportRecord(item)
|
|
_, err = roadshow.AddRsReportRecord(item)
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -290,6 +305,8 @@ func AddReportRecord(cont context.Context) (err error) {
|
|
if mapRsReportRecordPermission[pKey] {
|
|
if mapRsReportRecordPermission[pKey] {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
|
|
+ vP.CreatedTime = time.Now()
|
|
|
|
+ vP.ModifyTime = time.Now().Format(utils.FormatDateTime)
|
|
vP.RsCalendarId = v.RsCalendarId
|
|
vP.RsCalendarId = v.RsCalendarId
|
|
itemsRs = append(itemsRs, vP)
|
|
itemsRs = append(itemsRs, vP)
|
|
mapRsReportRecordPermission[pKey] = true
|
|
mapRsReportRecordPermission[pKey] = true
|
|
@@ -300,6 +317,8 @@ func AddReportRecord(cont context.Context) (err error) {
|
|
if mapRsReportRecordPermission[pKey] {
|
|
if mapRsReportRecordPermission[pKey] {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
|
|
+ vP.CreatedTime = time.Now()
|
|
|
|
+ vP.ModifyTime = time.Now().Format(utils.FormatDateTime)
|
|
vP.RsCalendarId = v.RsCalendarId
|
|
vP.RsCalendarId = v.RsCalendarId
|
|
itemsRs = append(itemsRs, vP)
|
|
itemsRs = append(itemsRs, vP)
|
|
mapRsReportRecordPermission[pKey] = true
|
|
mapRsReportRecordPermission[pKey] = true
|