|
@@ -400,6 +400,7 @@ func (this *YanxuanSpecialController) Save() {
|
|
|
item.Status = 2
|
|
|
br.Msg = "已提交审核"
|
|
|
}
|
|
|
+ var authorUserId int
|
|
|
// 如果是审批人员操作的那么就是修改内容,加审批通过
|
|
|
if isApprovalPersonnel {
|
|
|
item.Status = 3
|
|
@@ -417,6 +418,7 @@ func (this *YanxuanSpecialController) Save() {
|
|
|
return
|
|
|
}
|
|
|
item.UserId = specialItem.UserId // 专栏userid还是原有userId
|
|
|
+ authorUserId = specialItem.UserId
|
|
|
br.Msg = "保存成功"
|
|
|
}
|
|
|
|
|
@@ -440,10 +442,11 @@ func (this *YanxuanSpecialController) Save() {
|
|
|
}
|
|
|
|
|
|
if isApprovalPersonnel {
|
|
|
- go services.UpdateYanxuanSpecialResourceData(specialId) // 写入首页最新 cygx_resource_data 表
|
|
|
- go services.EsAddYanxuanSpecial(specialId) // 写入es 综合搜索
|
|
|
- go services.SendWxMsgSpecialFollow(req.Id) //研选专栏有新内容审核通过时,给关注此专栏的客户发送模板消息
|
|
|
- go services.SendWxMsgSpecialAuthor(req.Id, 2) //研选专栏审核完成时,给提交人发送模板消息
|
|
|
+ go services.UpdateYanxuanSpecialResourceData(specialId) // 写入首页最新 cygx_resource_data 表
|
|
|
+ go services.EsAddYanxuanSpecial(specialId) // 写入es 综合搜索
|
|
|
+ go services.SendWxMsgSpecialFollow(req.Id) //研选专栏有新内容审核通过时,给关注此专栏的客户发送模板消息
|
|
|
+ go services.SendWxMsgSpecialAuthor(req.Id, 2) //研选专栏审核完成时,给提交人发送模板消息
|
|
|
+ go services.UdpateYanxuanSpecialauthorArticleNum(authorUserId) // 更新作者发布文章的数量
|
|
|
} else {
|
|
|
if req.DoType == 2 {
|
|
|
go services.SendReviewTemplateMsgAdmin(specialId)
|
|
@@ -530,6 +533,12 @@ func (this *YanxuanSpecialController) Enable() {
|
|
|
} else {
|
|
|
status = 4
|
|
|
}
|
|
|
+ detail, err := models.GetYanxuanSpecialItemById(req.Id)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "审批失败"
|
|
|
+ br.ErrMsg = "审批失败, Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
if tmpErr := models.EnableYanxuanSpecial(req.Id, status, req.Reason, user.RealName); tmpErr != nil {
|
|
|
br.Msg = "审批失败"
|
|
|
br.ErrMsg = "审批失败, Err:" + tmpErr.Error()
|
|
@@ -542,6 +551,7 @@ func (this *YanxuanSpecialController) Enable() {
|
|
|
go services.UpdateYanxuanSpecialResourceData(req.Id) // 写入首页最新 cygx_resource_data 表
|
|
|
go services.EsAddYanxuanSpecial(req.Id) // 写入es 综合搜索
|
|
|
go services.AddAddCygxYanxuanSpecialApprovalLog(user, req.Id, req.Status, req.Reason) // 写入es 综合搜索
|
|
|
+ go services.UdpateYanxuanSpecialauthorArticleNum(detail.UserId) // 更新作者发布文章的数量
|
|
|
br.Msg = "审批成功"
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|
|
@@ -911,13 +921,21 @@ func (this *YanxuanSpecialController) Cancel() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ specialItem, err := models.GetYanxuanSpecialItemById(req.Id)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "专栏取消发布失败"
|
|
|
+ br.ErrMsg = "专栏取消发布失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
if tmpErr := models.CancelPublishYanxuanSpecial(req.Id); tmpErr != nil {
|
|
|
br.Msg = "取消发布失败"
|
|
|
br.ErrMsg = "取消发布失败, Err:" + tmpErr.Error()
|
|
|
return
|
|
|
}
|
|
|
- go services.UpdateYanxuanSpecialResourceData(req.Id) // 写入首页最新 cygx_resource_data 表
|
|
|
- go services.EsAddYanxuanSpecial(req.Id) // 写入es 综合搜索
|
|
|
+ go services.UpdateYanxuanSpecialResourceData(req.Id) // 写入首页最新 cygx_resource_data 表
|
|
|
+ go services.EsAddYanxuanSpecial(req.Id) // 写入es 综合搜索
|
|
|
+ go services.UdpateYanxuanSpecialauthorArticleNum(specialItem.UserId) // 更新作者发布文章的数量
|
|
|
br.Msg = "取消发布成功"
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|