|
@@ -457,13 +457,13 @@ func GetFiccRreportToCygxArticle() (err error) {
|
|
|
for _, v := range reportList {
|
|
|
reportIds = append(reportIds, v.Id)
|
|
|
}
|
|
|
- listaFiccReport, e := models.GetCygxCygxArticleListByReportIds(reportIds)
|
|
|
+ listFiccReport, e := models.GetCygxCygxArticleListByReportIds(reportIds)
|
|
|
if e != nil {
|
|
|
err = errors.New("GetCygxCygxArticleListByReportIds, Err: " + e.Error())
|
|
|
return
|
|
|
}
|
|
|
mapFiccReport := make(map[int]int)
|
|
|
- for _, v := range listaFiccReport {
|
|
|
+ for _, v := range listFiccReport {
|
|
|
mapFiccReport[v.ReportId] = v.ArticleId
|
|
|
}
|
|
|
|
|
@@ -533,6 +533,47 @@ func GetFiccRreportToCygxArticle() (err error) {
|
|
|
|
|
|
AddCygxReportMappingCategoryGroupByArticleId(articleIdMax)
|
|
|
}
|
|
|
+
|
|
|
+ //获取已经同步到查研的FICC研报 对比,如果FICC研报已经取消发布,查研也做对应的删除
|
|
|
+ listCygxFiccReport, e := models.GetCygxCygxArticleFiccReportList()
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("GetCygxCygxArticleFiccReportList, Err: " + e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var cygxFiccReportIds []int
|
|
|
+ for _, v := range listCygxFiccReport {
|
|
|
+ cygxFiccReportIds = append(cygxFiccReportIds, v.ReportId)
|
|
|
+ }
|
|
|
+ lenArr := len(cygxFiccReportIds)
|
|
|
+ if lenArr == 0 {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ condition = ` AND id IN (` + utils.GetOrmInReplace(lenArr) + `) `
|
|
|
+ pars = append(pars, cygxFiccReportIds)
|
|
|
+ ficcReportListPush, e := ficc_report.GetFiccRreportToCygxArticle(condition, pars)
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("GetFiccRreportToCygxArticle, Err: " + e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ var removeficcReporIds []int // 需要移除的报告ID
|
|
|
+ ficcReporIdsPush := make(map[int]bool) // Ficc 研报还存在的报告ID
|
|
|
+ for _, v := range ficcReportListPush {
|
|
|
+ ficcReporIdsPush[v.Id] = true
|
|
|
+ }
|
|
|
+
|
|
|
+ for _, v := range listCygxFiccReport {
|
|
|
+ if !ficcReporIdsPush[v.ReportId] {
|
|
|
+ removeficcReporIds = append(removeficcReporIds, v.ReportId)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if len(removeficcReporIds) > 0 {
|
|
|
+ e = models.HideCygxResourceDataFiccReport(removeficcReporIds)
|
|
|
+ if e != nil {
|
|
|
+ err = errors.New("HideCygxResourceDataFiccReport, Err: " + e.Error())
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
fmt.Println("end")
|
|
|
return
|
|
|
}
|