|
@@ -13,7 +13,6 @@ import (
|
|
|
"errors"
|
|
|
"html"
|
|
|
"strings"
|
|
|
- "time"
|
|
|
)
|
|
|
|
|
|
type SearchComprehensiveItem struct {
|
|
@@ -412,95 +411,6 @@ func GetResourceDataEsList(list []*SearchComprehensiveItem, user *models.WxUserI
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //处理晨会精华
|
|
|
- if len(meetingreviewchaptIds) > 0 {
|
|
|
- //pars = make([]interface{}, 0)
|
|
|
- //condition = ` AND c.id IN (` + utils.GetOrmInReplace(len(meetingreviewchaptIds)) + `)`
|
|
|
- //pars = append(pars, meetingreviewchaptIds)
|
|
|
-
|
|
|
- listrMeet, e := GetCygxMorningMeetingReviewChapterListByIds(meetingreviewchaptIds)
|
|
|
- if e != nil {
|
|
|
- err = errors.New("GetCygxMorningMeetingReviewChapterListByIds, Err: " + e.Error())
|
|
|
- return
|
|
|
- }
|
|
|
- for _, v := range listrMeet {
|
|
|
- v.Content = AnnotationHtml(v.Content)
|
|
|
- v.PublishTime = utils.TimeRemoveHms2(v.PublishTime)
|
|
|
- mapItems[fmt.Sprint("meetingreviewchapt", v.Id)].Meetingreviewchapt = v
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //处理上周纪要汇总
|
|
|
- if len(minutessummaryIds) > 0 {
|
|
|
- pars = make([]interface{}, 0)
|
|
|
- condition = ` AND article_id IN (` + utils.GetOrmInReplace(len(minutessummaryIds)) + `)`
|
|
|
- pars = append(pars, minutessummaryIds)
|
|
|
-
|
|
|
- listresearchsummary, e := models.GetReportSelectionListHome(condition, "cygx_minutes_summary", pars, 0, len(minutessummaryIds))
|
|
|
- if e != nil {
|
|
|
- err = errors.New("GetResourceDataList, Err: " + e.Error())
|
|
|
- return
|
|
|
- }
|
|
|
- for _, v := range listresearchsummary {
|
|
|
- v.PublishDate = utils.TimeRemoveHms2(v.PublishDate)
|
|
|
- mapItems[fmt.Sprint("minutessummary", v.ArticleId)].Minutessummary = v
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //处理本周纪要汇总
|
|
|
- if len(researchsummaryIds) > 0 {
|
|
|
- pars = make([]interface{}, 0)
|
|
|
- condition = ` AND article_id IN (` + utils.GetOrmInReplace(len(researchsummaryIds)) + `)`
|
|
|
- pars = append(pars, researchsummaryIds)
|
|
|
-
|
|
|
- listresearchsummary, e := models.GetReportSelectionListHome(condition, "cygx_research_summary", pars, 0, len(researchsummaryIds))
|
|
|
- if e != nil {
|
|
|
- err = errors.New("GetReportSelectionListHome, Err: " + e.Error())
|
|
|
- return
|
|
|
- }
|
|
|
- for _, v := range listresearchsummary {
|
|
|
- v.PublishDate = utils.TimeRemoveHms2(v.PublishDate)
|
|
|
- mapItems[fmt.Sprint("researchsummary", v.ArticleId)].Researchsummary = v
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //处理产品内测
|
|
|
- if len(productinteriorIds) > 0 {
|
|
|
- pars = make([]interface{}, 0)
|
|
|
- condition = ` AND art.status = 1 AND art.product_interior_id IN (` + utils.GetOrmInReplace(len(productinteriorIds)) + `)`
|
|
|
- pars = append(pars, productinteriorIds)
|
|
|
- listProductInterior, e := models.GetCygxProductInteriorList(condition, pars, 0, len(productinteriorIds))
|
|
|
- if e != nil {
|
|
|
- err = errors.New("GetCygxProductInteriorList, Err: " + e.Error())
|
|
|
- return
|
|
|
- }
|
|
|
- for _, v := range listProductInterior {
|
|
|
- v.Body = ProductInteriorHtml(v.Body)
|
|
|
- v.PublishTime = utils.TimeRemoveHms2(v.PublishTime)
|
|
|
- mapItems[fmt.Sprint("productinterior", v.ProductInteriorId)].ProductInterior = v
|
|
|
- }
|
|
|
- }
|
|
|
- //处理报告精选
|
|
|
- lenreportselectionIds := len(reportselectionIds)
|
|
|
- if lenreportselectionIds > 0 {
|
|
|
- pars = make([]interface{}, 0)
|
|
|
- condition = ` AND article_id IN (` + utils.GetOrmInReplace(lenreportselectionIds) + `)`
|
|
|
- pars = append(pars, reportselectionIds)
|
|
|
- listreportselection, e := models.GetReportSelectionList(condition, pars, 0, lenreportselectionIds)
|
|
|
- if e != nil {
|
|
|
- err = errors.New("GetReportSelectionList, Err: " + e.Error())
|
|
|
- return
|
|
|
- }
|
|
|
- mapPv := GetCygxReportHistoryRecordListMap(reportselectionIds, "bgjx")
|
|
|
- for _, v := range listreportselection {
|
|
|
- v.Title += "(第" + v.Periods + "期)"
|
|
|
- v.MarketStrategy = AnnotationHtml(v.MarketStrategy)
|
|
|
- v.PublishDate = utils.TimeRemoveHms2(v.PublishDate)
|
|
|
- v.Pv = mapPv[v.ArticleId]
|
|
|
- mapItems[fmt.Sprint("reportselection", v.ArticleId)].ReportSelection = v
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
//处理活动
|
|
|
if len(activityIds) > 0 {
|
|
|
for _, vss := range activityIds {
|
|
@@ -547,147 +457,6 @@ func GetResourceDataEsList(list []*SearchComprehensiveItem, user *models.WxUserI
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- //产业资源包
|
|
|
- if len(industrialResourceIdsHz) > 0 {
|
|
|
- pars = make([]interface{}, 0)
|
|
|
-
|
|
|
- var industrialResourceIdstring []string
|
|
|
- for _, v := range industrialResourceIdsHz {
|
|
|
- industrialResourceIdstring = append(industrialResourceIdstring, strconv.Itoa(v))
|
|
|
- }
|
|
|
- industrialId := strings.Join(industrialResourceIdstring, ",")
|
|
|
- condition = ` AND m.industrial_management_id IN (` + industrialId + `) AND a.article_type_id = 0 `
|
|
|
- listIndustrialResourceIds, e := models.GetSearchResourceList(condition)
|
|
|
- if e != nil {
|
|
|
- err = errors.New("GetSearchResourceList, Err: " + e.Error())
|
|
|
- return
|
|
|
- }
|
|
|
- conditionSubject := condition + ` AND m.industrial_management_id IN (` + utils.GetOrmInReplace(len(industrialResourceIdsHz)) + `)`
|
|
|
- pars = append(pars, industrialResourceIdsHz)
|
|
|
- listSubjcet, e := models.GetIndustrialSubjectAllByIndustrialId(pars, conditionSubject)
|
|
|
- //合并产业关联的标的
|
|
|
- if e != nil {
|
|
|
- e = errors.New("GetIndustrialSubjectAllByIndustrialId, Err: " + e.Error())
|
|
|
- return
|
|
|
- }
|
|
|
- mapIndustrial := make(map[string]int)
|
|
|
- for _, v := range listSubjcet {
|
|
|
- for k2, v2 := range listIndustrialResourceIds {
|
|
|
- if v2.IndustrialManagementId == v.IndustrialManagementId && mapIndustrial[fmt.Sprint(v2.IndustrialManagementId, v.SubjectName)] == 0 {
|
|
|
- listIndustrialResourceIds[k2].IndustrialSubjectList = append(listIndustrialResourceIds[k2].IndustrialSubjectList, v)
|
|
|
- mapIndustrial[fmt.Sprint(v2.IndustrialManagementId, v.SubjectName)] = 1
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- //listIndustrialResourceIds, _ = HandleIndustryList(listIndustrialResourceIds, user, "Hz")
|
|
|
- for _, v := range listIndustrialResourceIds {
|
|
|
- v.Source = 1
|
|
|
- v.UpdateTime = v.PublishDate
|
|
|
- mapItems[fmt.Sprint("industrialsourceHz", v.IndustrialManagementId)].IndustrialResource = v
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //产业资源包
|
|
|
- if len(industrialResourceIdsYx) > 0 {
|
|
|
- pars = make([]interface{}, 0)
|
|
|
-
|
|
|
- var industrialResourceIdstring []string
|
|
|
- for _, v := range industrialResourceIdsYx {
|
|
|
- industrialResourceIdstring = append(industrialResourceIdstring, strconv.Itoa(v))
|
|
|
- }
|
|
|
- industrialId := strings.Join(industrialResourceIdstring, ",")
|
|
|
- condition = ` AND m.industrial_management_id IN (` + industrialId + `) AND a.article_type_id > 0 `
|
|
|
- listIndustrialResourceIds, e := models.GetSearchResourceList(condition)
|
|
|
- if e != nil {
|
|
|
- err = errors.New("GetSearchResourceList, Err: " + e.Error())
|
|
|
- return
|
|
|
- }
|
|
|
- fmt.Println(listIndustrialResourceIds)
|
|
|
- conditionSubject := condition + ` AND m.industrial_management_id IN (` + utils.GetOrmInReplace(len(industrialResourceIdsYx)) + `)`
|
|
|
- pars = append(pars, industrialResourceIdsYx)
|
|
|
- listSubjcet, e := models.GetIndustrialSubjectAllByIndustrialId(pars, conditionSubject)
|
|
|
- //合并产业关联的标的
|
|
|
- if e != nil {
|
|
|
- e = errors.New("GetIndustrialSubjectAllByIndustrialId, Err: " + e.Error())
|
|
|
- return
|
|
|
- }
|
|
|
- mapIndustrial := make(map[string]int)
|
|
|
- for _, v := range listSubjcet {
|
|
|
- for k2, v2 := range listIndustrialResourceIds {
|
|
|
- if v2.IndustrialManagementId == v.IndustrialManagementId && mapIndustrial[fmt.Sprint(v2.IndustrialManagementId, v.SubjectName)] == 0 {
|
|
|
- listIndustrialResourceIds[k2].IndustrialSubjectList = append(listIndustrialResourceIds[k2].IndustrialSubjectList, v)
|
|
|
- mapIndustrial[fmt.Sprint(v2.IndustrialManagementId, v.SubjectName)] = 1
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- //listIndustrialResourceIds, _ = HandleIndustryList(listIndustrialResourceIds, user, "Yx")
|
|
|
- for _, v := range listIndustrialResourceIds {
|
|
|
- v.Source = 2
|
|
|
- v.UpdateTime = v.PublishDate
|
|
|
- mapItems[fmt.Sprint("industrialsourceYx", v.IndustrialManagementId)].IndustrialResource = v
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //处理图表
|
|
|
- if len(newchartIds) > 0 {
|
|
|
- pars = make([]interface{}, 0)
|
|
|
- condition = ` AND a.chart_id IN (` + utils.GetOrmInReplace(len(newchartIds)) + `)`
|
|
|
- pars = append(pars, newchartIds)
|
|
|
- chartDateList, e := models.GetChartListCollection(condition, pars, uid, 0, len(newchartIds))
|
|
|
- if e != nil {
|
|
|
- err = errors.New("GetResourceDataList, Err: " + e.Error())
|
|
|
- return
|
|
|
- }
|
|
|
- for _, v := range chartDateList {
|
|
|
- mapItems[fmt.Sprint("newchart", v.ChartId)].Newchart = v
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //处理专项调研
|
|
|
- if len(activityspecialIds) > 0 {
|
|
|
- pars = make([]interface{}, 0)
|
|
|
- condition = ` AND art.activity_id IN (` + utils.GetOrmInReplace(len(activityspecialIds)) + `)`
|
|
|
- pars = append(pars, activityspecialIds)
|
|
|
- activitySpeciallist, e := models.GetCygxActivitySpecialDetailList(condition, pars, user.UserId, 0, len(activityspecialIds))
|
|
|
- if e != nil {
|
|
|
- err = errors.New("GetCygxActivitySpecialDetailList, Err: " + e.Error())
|
|
|
- return
|
|
|
- }
|
|
|
- UserMap, e := GetSpecialTripUserMap(activityspecialIds, user.UserId)
|
|
|
- if e != nil {
|
|
|
- err = errors.New("GetSpecialTripUserMap, Err: " + e.Error())
|
|
|
- return
|
|
|
- }
|
|
|
- for _, v := range activitySpeciallist {
|
|
|
- if mapChart[v.ChartPermissionName] != "" {
|
|
|
- imgUrlResp = mapChart[v.ChartPermissionName]
|
|
|
- }
|
|
|
- if _, ok := UserMap[v.ActivityId]; ok {
|
|
|
- v.IsTrip = 1
|
|
|
- }
|
|
|
- if v.Days == 0 {
|
|
|
- v.TripStatus = 1
|
|
|
- v.TripImgLink = v.TripImgLink
|
|
|
- } else {
|
|
|
- v.TripStatus = 2
|
|
|
- v.TripImgLink = v.TripImgLinkFix
|
|
|
- v.ActivityTimeText = v.ActivityTimeTextByDay
|
|
|
- }
|
|
|
- resultTimeStart := utils.StrTimeToTime(v.ActivityTime) //时间字符串格式转时间格式
|
|
|
- resultTimeEnd := utils.StrTimeToTime(v.ActivityTimeEnd) //时间字符串格式转时间格式
|
|
|
- if resultTimeStart.After(time.Now()) {
|
|
|
- v.ActiveState = "1"
|
|
|
- } else if time.Now().After(resultTimeEnd) {
|
|
|
- v.ActiveState = "3"
|
|
|
- } else {
|
|
|
- v.ActiveState = "2"
|
|
|
- }
|
|
|
- v.ImgUrl = imgUrlResp
|
|
|
- mapItems[fmt.Sprint("activityspecial", v.ActivityId)].Activityspecial = v
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
//处理路演 处理路活动视频 处理路活音频
|
|
|
if len(roadshowIds)+len(activityvideoIds)+len(activityvoiceIds)+len(askserieVideoIds) > 0 {
|
|
|
|
|
@@ -799,6 +568,7 @@ func GetResourceDataEsList(list []*SearchComprehensiveItem, user *models.WxUserI
|
|
|
v.BodyHighlight = append(v.BodyHighlight, v.Annotation)
|
|
|
}
|
|
|
v.Annotation = "" //强制置空,兼容前端优先级
|
|
|
+ v.LabelKeywordImgLink = utils.LABEL_ICO_4
|
|
|
mapItems[fmt.Sprint(utils.CYGX_OBJ_YANXUANSPECIAL, v.Id)].YanxuanSpecial = v
|
|
|
}
|
|
|
}
|