|
@@ -360,6 +360,7 @@ func (this *YanxuanSpecialController) Save() {
|
|
|
} else {
|
|
|
item.Status = 2
|
|
|
}
|
|
|
+ var authorUserId int
|
|
|
// 如果是审批人员操作的那么就是修改内容,加审批通过
|
|
|
if isApprovalPersonnel {
|
|
|
item.Status = 3
|
|
@@ -377,6 +378,8 @@ func (this *YanxuanSpecialController) Save() {
|
|
|
return
|
|
|
}
|
|
|
item.UserId = specialItem.UserId // 专栏userid还是原有userId
|
|
|
+
|
|
|
+ authorUserId = specialItem.UserId
|
|
|
}
|
|
|
|
|
|
specialId := 0
|
|
@@ -400,10 +403,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)
|
|
@@ -493,6 +497,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()
|
|
@@ -505,6 +515,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) // 添加审核记录日志
|
|
|
+ go services.UdpateYanxuanSpecialauthorArticleNum(detail.UserId) // 更新作者发布文章的数量
|
|
|
br.Msg = "审批成功"
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|
|
@@ -875,16 +886,25 @@ 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
|
|
|
+
|
|
|
}
|
|
|
|
|
|
// @Title 作者列表
|