|
@@ -6,7 +6,6 @@ import (
|
|
|
"hongze/hz_crm_api/models/cygx"
|
|
|
"hongze/hz_crm_api/services/alarm_msg"
|
|
|
"hongze/hz_crm_api/utils"
|
|
|
- "html"
|
|
|
"strconv"
|
|
|
"time"
|
|
|
)
|
|
@@ -27,7 +26,7 @@ import (
|
|
|
//roadshow
|
|
|
|
|
|
//func init() {
|
|
|
-// UpdateActivityResourceData(2703)
|
|
|
+// UpdateMicroRoadshowResourceData(7)
|
|
|
//}
|
|
|
|
|
|
// 更新活动
|
|
@@ -78,6 +77,31 @@ func UpdateActivityResourceData(sourceId int) {
|
|
|
var resourceDataId int
|
|
|
publishDate := time.Now().Format(utils.FormatDateTime)
|
|
|
item := new(cygx.CygxResourceData)
|
|
|
+
|
|
|
+ var industrialName string
|
|
|
+ var subjectName string
|
|
|
+ //建立首页资源表,与产业的关系
|
|
|
+ industrialList, e := cygx.GetIndustrialActivityGroupManagementList(sourceId, 1)
|
|
|
+ if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
+ err = errors.New("GetIndustrialActivityGroupManagementList, Err: " + e.Error() + "activityId:" + strconv.Itoa(sourceId))
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, v := range industrialList {
|
|
|
+ industrialName += v.IndustryName
|
|
|
+ }
|
|
|
+
|
|
|
+ //建立首页资源表,与标的 的关系
|
|
|
+ subjectList, e := cygx.GetSubjectActivityGroupManagementList(sourceId, 1)
|
|
|
+ if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
+ err = errors.New("GetIndustrialActivityGroupManagementList, Err: " + e.Error() + "activityId:" + strconv.Itoa(sourceId))
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, v := range subjectList {
|
|
|
+ subjectName += v.SubjectName
|
|
|
+ }
|
|
|
+
|
|
|
item.SourceId = sourceId
|
|
|
item.Source = source
|
|
|
//分析师电话会(C类)
|
|
@@ -85,7 +109,7 @@ func UpdateActivityResourceData(sourceId int) {
|
|
|
item.ChartPermissionId = detail.ChartPermissionId
|
|
|
item.PublishDate = publishDate
|
|
|
item.SearchTitle = detail.ActivityName
|
|
|
- item.SearchContent = detail.Label
|
|
|
+ item.SearchContent = detail.Label + industrialName + subjectName
|
|
|
item.SearchOrderTime = detail.ActivityTime
|
|
|
item.CreateTime = time.Now()
|
|
|
if totalData == 0 {
|
|
@@ -109,12 +133,6 @@ func UpdateActivityResourceData(sourceId int) {
|
|
|
resourceDataId = sourceDetail.Id
|
|
|
}
|
|
|
|
|
|
- //建立首页资源表,与产业的关系
|
|
|
- industrialList, e := cygx.GetIndustrialActivityGroupManagementList(sourceId, 1)
|
|
|
- if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
- err = errors.New("GetIndustrialActivityGroupManagementList, Err: " + e.Error() + "activityId:" + strconv.Itoa(sourceId))
|
|
|
- return
|
|
|
- }
|
|
|
var industrialItems []*cygx.CygxResourceDataIndustrialGroupManagement
|
|
|
for _, v := range industrialList {
|
|
|
var industrialItem = new(cygx.CygxResourceDataIndustrialGroupManagement)
|
|
@@ -127,11 +145,6 @@ func UpdateActivityResourceData(sourceId int) {
|
|
|
}
|
|
|
|
|
|
//建立首页资源表,与标的 的关系
|
|
|
- subjectList, e := cygx.GetSubjectActivityGroupManagementList(sourceId, 1)
|
|
|
- if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
- err = errors.New("GetIndustrialActivityGroupManagementList, Err: " + e.Error() + "activityId:" + strconv.Itoa(sourceId))
|
|
|
- return
|
|
|
- }
|
|
|
var subjectItems []*cygx.CygxResourceDataIndustrialGroupSubject
|
|
|
for _, v := range subjectList {
|
|
|
var subjectItem = new(cygx.CygxResourceDataIndustrialGroupSubject)
|
|
@@ -369,7 +382,17 @@ func UpdateArticleResourceData(sourceId int) {
|
|
|
item.PublishDate = publishDate
|
|
|
item.CreateTime = time.Now()
|
|
|
item.SearchTitle = detail.Title
|
|
|
- item.SearchContent = html.UnescapeString(detail.Annotation) + html.UnescapeString(detail.Abstract) + detail.FieldName + detail.Stock + industrialName + subjectName
|
|
|
+ annotation, e := utils.GetHtmlContentText(detail.Annotation)
|
|
|
+ if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
+ err = errors.New("GetHtmlContentText, Err: " + e.Error() + "sourceId:" + strconv.Itoa(sourceId))
|
|
|
+ return
|
|
|
+ }
|
|
|
+ abstract, e := utils.GetHtmlContentText(detail.Abstract)
|
|
|
+ if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
+ err = errors.New("GetHtmlContentText, Err: " + e.Error() + "sourceId:" + strconv.Itoa(sourceId))
|
|
|
+ return
|
|
|
+ }
|
|
|
+ item.SearchContent = annotation + abstract + detail.FieldName + detail.Stock + industrialName + subjectName
|
|
|
item.SearchOrderTime = detail.PublishDate
|
|
|
if totalData == 0 {
|
|
|
newId, e := cygx.AddCygxResourceData(item)
|
|
@@ -475,12 +498,40 @@ func UpdateProductInteriorResourceData(sourceId int) {
|
|
|
var resourceDataId int
|
|
|
publishDate := time.Now().Format(utils.FormatDateTime)
|
|
|
item := new(cygx.CygxResourceData)
|
|
|
+
|
|
|
+ var industrialName string
|
|
|
+ var subjectName string
|
|
|
+ //建立首页资源表,与产业的关系
|
|
|
+ industrialList, e := cygx.GetProductInteriorIndustrialGroupManagementList(sourceId)
|
|
|
+ if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
+ err = errors.New("GetIndustrialArticleGroupManagementList, Err: " + e.Error() + "sourceId:" + strconv.Itoa(sourceId))
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, v := range industrialList {
|
|
|
+ industrialName += v.IndustryName
|
|
|
+ }
|
|
|
+
|
|
|
+ //建立首页资源表,与标的 的关系
|
|
|
+ subjectList, e := cygx.GetProductInteriorIndustrialGroupSubjecttList(sourceId)
|
|
|
+ if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
+ err = errors.New("GetSubjectArticleGroupManagementList, Err: " + e.Error() + "sourceId:" + strconv.Itoa(sourceId))
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, v := range subjectList {
|
|
|
+ subjectName += v.SubjectName
|
|
|
+ }
|
|
|
+
|
|
|
item.SourceId = sourceId
|
|
|
item.Source = source
|
|
|
item.SearchTag = mapMatchTypeName[detail.MatchTypeId]
|
|
|
item.PublishDate = publishDate
|
|
|
item.ChartPermissionId = detail.ChartPermissionId
|
|
|
item.CreateTime = time.Now()
|
|
|
+ item.SearchTitle = detail.Title
|
|
|
+ item.SearchContent = detail.Abstract + industrialName + subjectName
|
|
|
+ item.SearchOrderTime = detail.PublishTime
|
|
|
if totalData == 0 {
|
|
|
newId, e := cygx.AddCygxResourceData(item)
|
|
|
if e != nil {
|
|
@@ -502,12 +553,6 @@ func UpdateProductInteriorResourceData(sourceId int) {
|
|
|
resourceDataId = sourceDetail.Id
|
|
|
}
|
|
|
|
|
|
- //建立首页资源表,与产业的关系
|
|
|
- industrialList, e := cygx.GetProductInteriorIndustrialGroupManagementList(sourceId)
|
|
|
- if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
- err = errors.New("GetIndustrialArticleGroupManagementList, Err: " + e.Error() + "sourceId:" + strconv.Itoa(sourceId))
|
|
|
- return
|
|
|
- }
|
|
|
var industrialItems []*cygx.CygxResourceDataIndustrialGroupManagement
|
|
|
for _, v := range industrialList {
|
|
|
var industrialItem = new(cygx.CygxResourceDataIndustrialGroupManagement)
|
|
@@ -519,12 +564,6 @@ func UpdateProductInteriorResourceData(sourceId int) {
|
|
|
industrialItems = append(industrialItems, industrialItem)
|
|
|
}
|
|
|
|
|
|
- //建立首页资源表,与标的 的关系
|
|
|
- subjectList, e := cygx.GetProductInteriorIndustrialGroupSubjecttList(sourceId)
|
|
|
- if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
- err = errors.New("GetSubjectArticleGroupManagementList, Err: " + e.Error() + "sourceId:" + strconv.Itoa(sourceId))
|
|
|
- return
|
|
|
- }
|
|
|
var subjectItems []*cygx.CygxResourceDataIndustrialGroupSubject
|
|
|
for _, v := range subjectList {
|
|
|
var subjectItem = new(cygx.CygxResourceDataIndustrialGroupSubject)
|
|
@@ -546,7 +585,7 @@ func UpdateProductInteriorResourceData(sourceId int) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-// 更新晨会精华
|
|
|
+// 更新晨会精华 (跟踪点评)
|
|
|
func UpdateMeetingreviewchaptResourceData(sourceId int) {
|
|
|
var err error
|
|
|
defer func() {
|
|
@@ -590,12 +629,54 @@ func UpdateMeetingreviewchaptResourceData(sourceId int) {
|
|
|
var resourceDataId int
|
|
|
publishDate := time.Now().Format(utils.FormatDateTime)
|
|
|
item := new(cygx.CygxResourceData)
|
|
|
+
|
|
|
+ var industrialName string
|
|
|
+ var subjectName string
|
|
|
+ //建立首页资源表,与产业的关系
|
|
|
+ var condition string
|
|
|
+ var pars []interface{}
|
|
|
+ condition = " AND industrial_management_id = ? "
|
|
|
+ pars = append(pars, detail.IndustryId)
|
|
|
+ //建立首页资源表,与产业的关系
|
|
|
+ industrialList, e := cygx.GetTopOneMonthArtReadNumIndustryAll(condition, pars)
|
|
|
+ if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
+ err = errors.New("GetTopOneMonthArtReadNumIndustryAll, Err: " + e.Error() + "sourceId:" + strconv.Itoa(sourceId))
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, v := range industrialList {
|
|
|
+ industrialName += v.IndustryName
|
|
|
+ }
|
|
|
+
|
|
|
+ if detail.IndustrialSubjectIds != "" {
|
|
|
+ condition = ""
|
|
|
+ pars = make([]interface{}, 0)
|
|
|
+ condition = " AND industrial_subject_id IN (" + detail.IndustrialSubjectIds + ") "
|
|
|
+ //建立首页资源表,与标的 的关系
|
|
|
+ subjectList, e := cygx.GetCygxIndustrialSubjectListCondition(condition, pars)
|
|
|
+ if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
+ err = errors.New("GetCygxIndustrialSubjectListCondition, Err: " + e.Error() + "sourceId:" + strconv.Itoa(sourceId))
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for _, v := range subjectList {
|
|
|
+ subjectName += v.SubjectName
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
item.SourceId = sourceId
|
|
|
item.Source = source
|
|
|
item.SearchTag = "晨会精华"
|
|
|
item.PublishDate = publishDate
|
|
|
item.ChartPermissionId = detail.ChartPermissionId
|
|
|
item.CreateTime = time.Now()
|
|
|
+ item.SearchTitle = industrialName + subjectName
|
|
|
+ content, e := utils.GetHtmlContentText(detail.Content)
|
|
|
+ if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
+ err = errors.New("GetHtmlContentText, Err: " + e.Error() + "sourceId:" + strconv.Itoa(sourceId))
|
|
|
+ return
|
|
|
+ }
|
|
|
+ item.SearchContent = content
|
|
|
+ item.SearchOrderTime = detail.MeetingTime.Format(utils.FormatDateTime)
|
|
|
if totalData == 0 {
|
|
|
newId, e := cygx.AddCygxResourceData(item)
|
|
|
if e != nil {
|
|
@@ -616,16 +697,7 @@ func UpdateMeetingreviewchaptResourceData(sourceId int) {
|
|
|
}
|
|
|
resourceDataId = sourceDetail.Id
|
|
|
}
|
|
|
- var condition string
|
|
|
- var pars []interface{}
|
|
|
- condition = " AND industrial_management_id = ? "
|
|
|
- pars = append(pars, detail.IndustryId)
|
|
|
- //建立首页资源表,与产业的关系
|
|
|
- industrialList, e := cygx.GetTopOneMonthArtReadNumIndustryAll(condition, pars)
|
|
|
- if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
- err = errors.New("GetTopOneMonthArtReadNumIndustryAll, Err: " + e.Error() + "sourceId:" + strconv.Itoa(sourceId))
|
|
|
- return
|
|
|
- }
|
|
|
+
|
|
|
var industrialItems []*cygx.CygxResourceDataIndustrialGroupManagement
|
|
|
for _, v := range industrialList {
|
|
|
var industrialItem = new(cygx.CygxResourceDataIndustrialGroupManagement)
|
|
@@ -716,6 +788,9 @@ func UpdateReportSelectionResourceData(sourceId int) {
|
|
|
item.SearchTag = "重点公司"
|
|
|
item.PublishDate = publishDate
|
|
|
item.CreateTime = time.Now()
|
|
|
+ item.SearchTitle = detail.Title
|
|
|
+ item.SearchContent = ""
|
|
|
+ item.SearchOrderTime = detail.PublishDate
|
|
|
if totalData == 0 {
|
|
|
_, e := cygx.AddCygxResourceData(item)
|
|
|
if e != nil {
|
|
@@ -766,6 +841,11 @@ func UpdateResearchSummaryResourceData(sourceId int) {
|
|
|
err = errors.New("GetCygxReportSelectionBySourceAndId, Err: " + e.Error())
|
|
|
return
|
|
|
}
|
|
|
+ detail, e := cygx.GetCygxResearchSummaryInfoById(sourceId)
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("GetCygxResearchSummaryInfoById, Err: " + e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
publishDate := time.Now().Format(utils.FormatDateTime)
|
|
|
item := new(cygx.CygxResourceData)
|
|
|
item.SourceId = sourceId
|
|
@@ -773,6 +853,9 @@ func UpdateResearchSummaryResourceData(sourceId int) {
|
|
|
item.SearchTag = "本周研究汇总"
|
|
|
item.PublishDate = publishDate
|
|
|
item.CreateTime = time.Now()
|
|
|
+ item.SearchTitle = detail.Title
|
|
|
+ item.SearchContent = ""
|
|
|
+ item.SearchOrderTime = detail.PublishDate
|
|
|
if totalData == 0 {
|
|
|
_, e := cygx.AddCygxResourceData(item)
|
|
|
if e != nil {
|
|
@@ -823,6 +906,12 @@ func UpdateMinutesSummaryResourceData(sourceId int) {
|
|
|
err = errors.New("GetCygxReportSelectionBySourceAndId, Err: " + e.Error())
|
|
|
return
|
|
|
}
|
|
|
+ detail, e := cygx.GetCygxMinutesSummaryInfoById(sourceId)
|
|
|
+
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("GetCygxMinutesSummaryInfoById, Err: " + e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
publishDate := time.Now().Format(utils.FormatDateTime)
|
|
|
item := new(cygx.CygxResourceData)
|
|
|
item.SourceId = sourceId
|
|
@@ -830,6 +919,9 @@ func UpdateMinutesSummaryResourceData(sourceId int) {
|
|
|
item.SearchTag = "上周纪要汇总"
|
|
|
item.PublishDate = publishDate
|
|
|
item.CreateTime = time.Now()
|
|
|
+ item.SearchTitle = detail.Title
|
|
|
+ item.SearchContent = ""
|
|
|
+ item.SearchOrderTime = detail.PublishDate
|
|
|
if totalData == 0 {
|
|
|
_, e := cygx.AddCygxResourceData(item)
|
|
|
if e != nil {
|
|
@@ -897,6 +989,31 @@ func UpdateActivityVoiceResourceData(sourceId int) {
|
|
|
}
|
|
|
publishDate := time.Now().Format(utils.FormatDateTime)
|
|
|
item := new(cygx.CygxResourceData)
|
|
|
+
|
|
|
+ var industrialName string
|
|
|
+ var subjectName string
|
|
|
+ //建立首页资源表,与产业的关系
|
|
|
+ industrialList, e := cygx.GetIndustrialActivityGroupManagementList(activityId, 1)
|
|
|
+ if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
+ err = errors.New("GetIndustrialActivityGroupManagementList, Err: " + e.Error() + "activityId:" + strconv.Itoa(activityId))
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, v := range industrialList {
|
|
|
+ industrialName += v.IndustryName
|
|
|
+ }
|
|
|
+
|
|
|
+ //建立首页资源表,与标的 的关系
|
|
|
+ subjectList, e := cygx.GetSubjectActivityGroupManagementList(activityId, 1)
|
|
|
+ if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
+ err = errors.New("GetIndustrialActivityGroupManagementList, Err: " + e.Error() + "activityId:" + strconv.Itoa(activityId))
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, v := range subjectList {
|
|
|
+ subjectName += v.SubjectName
|
|
|
+ }
|
|
|
+
|
|
|
item.SourceId = sourceId
|
|
|
item.Source = source
|
|
|
//易董办会的分析师电话会,为路演回放
|
|
@@ -908,6 +1025,9 @@ func UpdateActivityVoiceResourceData(sourceId int) {
|
|
|
item.PublishDate = publishDate
|
|
|
item.ChartPermissionId = activityInfo.ChartPermissionId
|
|
|
item.CreateTime = utils.StrDateToDate(activityInfo.ActivityTime)
|
|
|
+ item.SearchTitle = voiceDetail.VoiceName
|
|
|
+ item.SearchContent = activityInfo.Label + industrialName + subjectName
|
|
|
+ item.SearchOrderTime = activityInfo.ActivityTime
|
|
|
if totalData == 0 {
|
|
|
_, e := cygx.AddCygxResourceData(item)
|
|
|
if e != nil {
|
|
@@ -973,6 +1093,29 @@ func UpdateActivityVideoResourceData(sourceId int) {
|
|
|
}
|
|
|
publishDate := time.Now().Format(utils.FormatDateTime)
|
|
|
item := new(cygx.CygxResourceData)
|
|
|
+ var industrialName string
|
|
|
+ var subjectName string
|
|
|
+ //建立首页资源表,与产业的关系
|
|
|
+ industrialList, e := cygx.GetIndustrialActivityGroupManagementList(activityId, 1)
|
|
|
+ if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
+ err = errors.New("GetIndustrialActivityGroupManagementList, Err: " + e.Error() + "activityId:" + strconv.Itoa(activityId))
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, v := range industrialList {
|
|
|
+ industrialName += v.IndustryName
|
|
|
+ }
|
|
|
+
|
|
|
+ //建立首页资源表,与标的 的关系
|
|
|
+ subjectList, e := cygx.GetSubjectActivityGroupManagementList(activityId, 1)
|
|
|
+ if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
+ err = errors.New("GetIndustrialActivityGroupManagementList, Err: " + e.Error() + "activityId:" + strconv.Itoa(activityId))
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, v := range subjectList {
|
|
|
+ subjectName += v.SubjectName
|
|
|
+ }
|
|
|
item.SourceId = sourceId
|
|
|
item.Source = source
|
|
|
//易董办会的分析师电话会,为路演回放
|
|
@@ -985,6 +1128,9 @@ func UpdateActivityVideoResourceData(sourceId int) {
|
|
|
item.PublishDate = publishDate
|
|
|
item.ChartPermissionId = activityInfo.ChartPermissionId
|
|
|
item.CreateTime = utils.StrDateToDate(activityInfo.ActivityTime)
|
|
|
+ item.SearchTitle = videoDetail.VideoName
|
|
|
+ item.SearchContent = activityInfo.Label + industrialName + subjectName
|
|
|
+ item.SearchOrderTime = activityInfo.ActivityTime
|
|
|
if totalData == 0 {
|
|
|
_, e := cygx.AddCygxResourceData(item)
|
|
|
if e != nil {
|
|
@@ -1048,6 +1194,9 @@ func UpdateMicroRoadshowResourceData(sourceId int) {
|
|
|
item.PublishDate = publishDate
|
|
|
item.ChartPermissionId = detail.ChartPermissionId
|
|
|
item.CreateTime = time.Now()
|
|
|
+ item.SearchTitle = detail.VideoName
|
|
|
+ item.SearchContent = detail.IndustryName
|
|
|
+ item.SearchOrderTime = detail.PublishDate.Format(utils.FormatDateTime)
|
|
|
if totalData == 0 {
|
|
|
_, e := cygx.AddCygxResourceData(item)
|
|
|
if e != nil {
|
|
@@ -1116,6 +1265,9 @@ func UpdateAskserieVideoResourceData(sourceId int) {
|
|
|
item.PublishDate = publishDate
|
|
|
item.ChartPermissionId = detail.ChartPermissionId
|
|
|
item.CreateTime = time.Now()
|
|
|
+ item.SearchTitle = detail.VideoName
|
|
|
+ item.SearchContent = detail.IndustryName
|
|
|
+ item.SearchOrderTime = detail.PublishDate
|
|
|
if totalData == 0 {
|
|
|
_, e := cygx.AddCygxResourceData(item)
|
|
|
if e != nil {
|