|
@@ -9,7 +9,7 @@ import (
|
|
|
|
|
|
//10.5.1版本上线需要更新的数据
|
|
|
|
|
|
-func init5111() {
|
|
|
+func init1111() {
|
|
|
var condition string
|
|
|
var pars []interface{}
|
|
|
var err error
|
|
@@ -48,7 +48,7 @@ func init5111() {
|
|
|
item.CreateTime = time.Now()
|
|
|
item.ModifyTime = time.Now()
|
|
|
items = append(items, item)
|
|
|
- if len(items)%5 == 0 {
|
|
|
+ if len(items)%5000 == 0 {
|
|
|
err = models.CygxUserLabelMulti(items)
|
|
|
fmt.Println(err)
|
|
|
items = make([]*models.CygxUserLabel, 0)
|
|
@@ -60,7 +60,7 @@ func init5111() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-func init52222() {
|
|
|
+func init123() {
|
|
|
var condition string
|
|
|
var pars []interface{}
|
|
|
var err error
|
|
@@ -86,6 +86,9 @@ func init52222() {
|
|
|
}
|
|
|
var items []*models.CygxUserLabel
|
|
|
for _, user := range list {
|
|
|
+ if user.IdCygx == 0 {
|
|
|
+ continue
|
|
|
+ }
|
|
|
item := new(models.CygxUserLabel)
|
|
|
item.UserId = user.UserId
|
|
|
item.CompanyId = user.CompanyId
|
|
@@ -98,8 +101,9 @@ func init52222() {
|
|
|
item.IsFollow = 1
|
|
|
item.CreateTime = time.Now()
|
|
|
item.ModifyTime = time.Now()
|
|
|
+ fmt.Println(item.SourceId)
|
|
|
items = append(items, item)
|
|
|
- if len(items)%5 == 0 {
|
|
|
+ if len(items)%5000 == 0 {
|
|
|
err = models.CygxUserLabelMulti(items)
|
|
|
fmt.Println(err)
|
|
|
items = make([]*models.CygxUserLabel, 0)
|
|
@@ -176,7 +180,7 @@ func init5333() {
|
|
|
item.CreateTime = utils.StrTimeToTime(v.ActivityTime)
|
|
|
item.ModifyTime = time.Now()
|
|
|
items = append(items, item)
|
|
|
- if len(items)%50 == 0 {
|
|
|
+ if len(items)%5000 == 0 {
|
|
|
_, err = models.AddCygxUserLabelActivityList(items)
|
|
|
fmt.Println(err)
|
|
|
items = make([]*models.CygxUserLabelActivity, 0)
|
|
@@ -246,7 +250,7 @@ func init5444() {
|
|
|
item.CreateTime = utils.StrTimeToTime(user.CreateTime)
|
|
|
item.ModifyTime = time.Now()
|
|
|
items = append(items, item)
|
|
|
- if len(items)%50 == 0 {
|
|
|
+ if len(items)%5000 == 0 {
|
|
|
_, err = models.AddCygxUserLabelActivitySpecialList(items)
|
|
|
fmt.Println(err)
|
|
|
items = make([]*models.CygxUserLabelActivitySpecial, 0)
|
|
@@ -278,7 +282,7 @@ func init5555() {
|
|
|
mapIndustryName[v.IndustrialManagementId] = v.IndustryName
|
|
|
}
|
|
|
//fmt.Println(mapIndustryName)
|
|
|
- condition = ` AND stop_time > 4 AND create_time > '2022-11-25 00:00:00' GROUP BY article_id `
|
|
|
+ condition = ` AND stop_time > 3 AND create_time > '2022-11-25 00:00:00' GROUP BY article_id `
|
|
|
//condition = ` AND stop_time > 4 AND create_time > '2023-04-25 00:00:00' GROUP BY article_id `
|
|
|
listArtGroup, err := models.GetCygxArticleHistoryRecordNewpvList(condition, pars)
|
|
|
if err != nil {
|
|
@@ -289,6 +293,7 @@ func init5555() {
|
|
|
|
|
|
itemsMap := make(map[int][]*models.CygxUserLabel)
|
|
|
for _, v := range listArtGroup {
|
|
|
+
|
|
|
fmt.Println(v.ArticleId)
|
|
|
var items []*models.CygxUserLabel
|
|
|
articleId := v.ArticleId
|
|
@@ -299,7 +304,8 @@ func init5555() {
|
|
|
industrialList, e := models.GetIndustrialArticleGroupManagementList(condition, pars)
|
|
|
if e != nil && e.Error() != utils.ErrNoRow() {
|
|
|
fmt.Println(e)
|
|
|
- return
|
|
|
+ continue
|
|
|
+ //return
|
|
|
}
|
|
|
if len(industrialList) == 0 {
|
|
|
//如果没有行产业归类就按照行业报告处理
|
|
@@ -307,13 +313,15 @@ func init5555() {
|
|
|
detailArticle, e := models.GetArticleDetailById(articleId)
|
|
|
if e != nil {
|
|
|
fmt.Println(e)
|
|
|
- return
|
|
|
+ continue
|
|
|
+ //return
|
|
|
}
|
|
|
|
|
|
labelDetail, e := models.GetdetailByCategoryIdLabel(detailArticle.CategoryId)
|
|
|
if e != nil {
|
|
|
fmt.Println(e)
|
|
|
- return
|
|
|
+ continue
|
|
|
+ //return
|
|
|
}
|
|
|
label := labelDetail.MatchTypeName
|
|
|
industrialManagementId := labelDetail.Id
|
|
@@ -340,12 +348,12 @@ func init5555() {
|
|
|
topCond = ` AND industrial_management_id IN (` + utils.GetOrmInReplace(idsLen) + `)`
|
|
|
topPars = append(topPars, industrialManagementIds)
|
|
|
} else {
|
|
|
- return
|
|
|
+ continue
|
|
|
}
|
|
|
industrNamelist, e := models.GetTopOneMonthArtReadNumIndustryAll(topCond, topPars)
|
|
|
if e != nil {
|
|
|
fmt.Println(e)
|
|
|
- return
|
|
|
+ continue
|
|
|
}
|
|
|
source = 1
|
|
|
for _, v := range industrNamelist {
|
|
@@ -387,7 +395,7 @@ func init5555() {
|
|
|
itemsMap[articleId] = items
|
|
|
}
|
|
|
}
|
|
|
- condition = ` AND stop_time > 4 AND create_time > '2022-11-25 00:00:00' `
|
|
|
+ condition = ` AND stop_time > 3 AND create_time > '2022-11-25 00:00:00' `
|
|
|
//condition = ` AND stop_time > 4 AND create_time > '2023-4-25 00:00:00' `
|
|
|
listArt, err := models.GetCygxArticleHistoryRecordNewpvList(condition, pars)
|
|
|
if err != nil {
|
|
@@ -395,6 +403,8 @@ func init5555() {
|
|
|
}
|
|
|
var items []*models.CygxUserLabelArticle
|
|
|
|
|
|
+ fmt.Println(len(listArt))
|
|
|
+
|
|
|
for _, user := range listArt {
|
|
|
if len(itemsMap[user.ArticleId]) > 0 {
|
|
|
for k2, vlsit := range itemsMap {
|
|
@@ -420,7 +430,7 @@ func init5555() {
|
|
|
item.CreateTime = user.CreateTime
|
|
|
item.ModifyTime = time.Now()
|
|
|
items = append(items, item)
|
|
|
- if len(items)%500 == 0 {
|
|
|
+ if len(items)%5000 == 0 {
|
|
|
_, err = models.AddCygxUserLabelArticleList(items)
|
|
|
fmt.Println(err)
|
|
|
items = make([]*models.CygxUserLabelArticle, 0)
|