|
@@ -77,38 +77,23 @@ func UpdateIndustrialManagementSubjectNnames() (err error) {
|
|
|
}
|
|
|
|
|
|
func ChageIndustrialArticleNum(cont context.Context) (err error) {
|
|
|
- allList, err := models.IndustrialManagementAll()
|
|
|
- if err != nil {
|
|
|
- fmt.Println("GetArticleAll Err:", err.Error())
|
|
|
- return
|
|
|
- }
|
|
|
- for _, v := range allList {
|
|
|
- total, errTop := models.GetIndustrialManagementArtCount(v.IndustrialManagementId)
|
|
|
- if errTop != nil {
|
|
|
- fmt.Println("Top Err:", errTop.Error())
|
|
|
- return
|
|
|
- }
|
|
|
- if total > 0 {
|
|
|
- err = models.UpdateIndustrialManagementArtReadNum(total, v.IndustrialManagementId)
|
|
|
- if err != nil {
|
|
|
- fmt.Println("Update Err:", err.Error())
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- return
|
|
|
-}
|
|
|
-
|
|
|
-func init() {
|
|
|
IndustrialHzArticleNumUpdate()
|
|
|
IndustrialYxArticleNumUpdate()
|
|
|
IndustrialActivityNumUpdate()
|
|
|
+ return
|
|
|
}
|
|
|
|
|
|
+//func init() {
|
|
|
+// IndustrialHzArticleNumUpdate()
|
|
|
+// IndustrialYxArticleNumUpdate()
|
|
|
+// IndustrialActivityNumUpdate()
|
|
|
+//}
|
|
|
+
|
|
|
// 更改弘则对应的报告关联产业近一个月的阅读量
|
|
|
func IndustrialHzArticleNumUpdate() (err error) {
|
|
|
defer func() {
|
|
|
if err != nil {
|
|
|
+ //fmt.Println(err)
|
|
|
go utils.SendAlarmMsg("更改弘则对应的报告关联产业近一个月的阅读量失败"+err.Error(), 2)
|
|
|
go utils.SendEmail(utils.APPNAME+"【"+utils.RunMode+"】"+"更改弘则对应的报告关联产业近一个月的阅读量失败失败提醒", err.Error(), utils.EmailSendToUsers)
|
|
|
}
|
|
@@ -132,7 +117,6 @@ func IndustrialHzArticleNumUpdate() (err error) {
|
|
|
return
|
|
|
}
|
|
|
for _, v := range list {
|
|
|
- fmt.Println(v)
|
|
|
err = models.UpdateIndustrialManagementArtReadNum(v.Count, v.IndustrialManagementId)
|
|
|
if err != nil {
|
|
|
return
|
|
@@ -145,6 +129,7 @@ func IndustrialHzArticleNumUpdate() (err error) {
|
|
|
func IndustrialYxArticleNumUpdate() (err error) {
|
|
|
defer func() {
|
|
|
if err != nil {
|
|
|
+ //fmt.Println(err)
|
|
|
go utils.SendAlarmMsg("更改研选对应的报告关联产业近一个月的阅读量失败"+err.Error(), 2)
|
|
|
go utils.SendEmail(utils.APPNAME+"【"+utils.RunMode+"】"+"更改研选对应的报告关联产业近一个月的阅读量失败提醒", err.Error(), utils.EmailSendToUsers)
|
|
|
}
|
|
@@ -164,7 +149,6 @@ func IndustrialYxArticleNumUpdate() (err error) {
|
|
|
return
|
|
|
}
|
|
|
for _, v := range list {
|
|
|
- fmt.Println(v)
|
|
|
err = models.UpdateIndustrialManagementArtYanXuanReadNum(v.Count, v.IndustrialManagementId)
|
|
|
if err != nil {
|
|
|
return
|
|
@@ -177,6 +161,7 @@ func IndustrialYxArticleNumUpdate() (err error) {
|
|
|
func IndustrialActivityNumUpdate() (err error) {
|
|
|
defer func() {
|
|
|
if err != nil {
|
|
|
+ //fmt.Println(err)
|
|
|
go utils.SendAlarmMsg("更改活动关联产业近一个月的到会量失败"+err.Error(), 2)
|
|
|
go utils.SendEmail(utils.APPNAME+"【"+utils.RunMode+"】"+"更改活动关联产业近一个月的到会量失败", err.Error(), utils.EmailSendToUsers)
|
|
|
}
|
|
@@ -187,7 +172,6 @@ func IndustrialActivityNumUpdate() (err error) {
|
|
|
return
|
|
|
}
|
|
|
for _, v := range list {
|
|
|
- fmt.Println(v)
|
|
|
err = models.UpdateIndustrialManagementActivityNum(v.Count, v.IndustrialManagementId)
|
|
|
if err != nil {
|
|
|
return
|