|
@@ -3,6 +3,7 @@ package controllers
|
|
|
import (
|
|
|
"encoding/json"
|
|
|
"eta/eta_api/models"
|
|
|
+ "eta/eta_api/models/company"
|
|
|
"eta/eta_api/services"
|
|
|
"eta/eta_api/services/alarm_msg"
|
|
|
"eta/eta_api/utils"
|
|
@@ -263,7 +264,6 @@ func (this *ReportController) PublishReport() {
|
|
|
br.ErrMsg = "参数错误,报告id不可为空"
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
reportArr := strings.Split(reportIds, ",")
|
|
|
tips := ""
|
|
|
for _, v := range reportArr {
|
|
@@ -289,7 +289,6 @@ func (this *ReportController) PublishReport() {
|
|
|
} else {
|
|
|
publishTime = time.Now()
|
|
|
}
|
|
|
-
|
|
|
var tmpErr error
|
|
|
if report.HasChapter == 1 && (report.ChapterType == utils.REPORT_TYPE_DAY || report.ChapterType == utils.REPORT_TYPE_WEEK) {
|
|
|
// 发布晨周报
|
|
@@ -309,6 +308,7 @@ func (this *ReportController) PublishReport() {
|
|
|
br.ErrMsg = "报告发布失败, Err:" + tmpErr.Error() + ", report_id:" + strconv.Itoa(report.Id)
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
go func() {
|
|
|
// 生成音频
|
|
|
if report.VideoUrl == "" {
|
|
@@ -321,6 +321,17 @@ func (this *ReportController) PublishReport() {
|
|
|
// 更新报告Es
|
|
|
_ = services.UpdateReportEs(report.Id, 2)
|
|
|
}()
|
|
|
+ recordItem := &models.ReportStateRecord{
|
|
|
+ ReportId: vint,
|
|
|
+ ReportType: 1,
|
|
|
+ State: 2,
|
|
|
+ AdminId: this.SysUser.AdminId,
|
|
|
+ AdminName: this.SysUser.AdminName,
|
|
|
+ CreateTime: time.Now(),
|
|
|
+ }
|
|
|
+ go func() {
|
|
|
+ _, _ = models.AddReportStateRecord(recordItem)
|
|
|
+ }()
|
|
|
}
|
|
|
}
|
|
|
// 发布晨周报部分章节未发布的提示
|
|
@@ -378,9 +389,33 @@ func (this *ReportController) PublishCancleReport() {
|
|
|
go services.UpdateReportEs(req.ReportIds, 1)
|
|
|
}
|
|
|
|
|
|
+ // 获取审批流设置
|
|
|
+ confKey := "approval_flow"
|
|
|
+ confTmp, e := company.GetConfigDetailByCode(confKey)
|
|
|
+ if e != nil {
|
|
|
+ br.Msg = "获取审批流配置失败"
|
|
|
+ br.ErrMsg = "获取审批流配置失败, Err: " + e.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if confTmp.ConfigValue == "1" || confTmp.ConfigValue == "2" || confTmp.ConfigValue == "3" {
|
|
|
+ br.Msg = "撤销成功"
|
|
|
+ } else {
|
|
|
+ br.Msg = "取消发布成功"
|
|
|
+ }
|
|
|
+
|
|
|
+ recordItem := &models.ReportStateRecord{
|
|
|
+ ReportId: req.ReportIds,
|
|
|
+ ReportType: 1,
|
|
|
+ State: 1,
|
|
|
+ AdminId: this.SysUser.AdminId,
|
|
|
+ AdminName: this.SysUser.AdminName,
|
|
|
+ CreateTime: time.Now(),
|
|
|
+ }
|
|
|
+ go func() {
|
|
|
+ _, _ = models.AddReportStateRecord(recordItem)
|
|
|
+ }()
|
|
|
br.Ret = 200
|
|
|
br.Success = true
|
|
|
- br.Msg = "取消发布成功"
|
|
|
}
|
|
|
|
|
|
// Delete
|
|
@@ -517,6 +552,18 @@ func (this *ReportController) Add() {
|
|
|
}()
|
|
|
}
|
|
|
|
|
|
+ recordItem := &models.ReportStateRecord{
|
|
|
+ ReportId: int(newReportId),
|
|
|
+ ReportType: 1,
|
|
|
+ State: 1,
|
|
|
+ AdminId: this.SysUser.AdminId,
|
|
|
+ AdminName: this.SysUser.AdminName,
|
|
|
+ CreateTime: time.Now(),
|
|
|
+ }
|
|
|
+ go func() {
|
|
|
+ _, _ = models.AddReportStateRecord(recordItem)
|
|
|
+ }()
|
|
|
+
|
|
|
resp := new(models.AddResp)
|
|
|
resp.ReportId = newReportId
|
|
|
resp.ReportCode = reportCode
|
|
@@ -602,6 +649,19 @@ func (this *ReportController) Edit() {
|
|
|
br.ErrMsg = "该报告已发布,不允许编辑"
|
|
|
return
|
|
|
}
|
|
|
+ if req.State != report.State {
|
|
|
+ recordItem := &models.ReportStateRecord{
|
|
|
+ ReportId: int(req.ReportId),
|
|
|
+ ReportType: 1,
|
|
|
+ State: req.State,
|
|
|
+ AdminId: this.SysUser.AdminId,
|
|
|
+ AdminName: this.SysUser.AdminName,
|
|
|
+ CreateTime: time.Now(),
|
|
|
+ }
|
|
|
+ go func() {
|
|
|
+ _, _ = models.AddReportStateRecord(recordItem)
|
|
|
+ }()
|
|
|
+ }
|
|
|
|
|
|
item := new(models.Report)
|
|
|
item.ClassifyIdFirst = req.ClassifyIdFirst
|