|
@@ -5,7 +5,6 @@ import (
|
|
|
"eta/eta_api/controllers"
|
|
|
"eta/eta_api/models"
|
|
|
"eta/eta_api/models/report_approve"
|
|
|
- "eta/eta_api/models/smart_report"
|
|
|
"eta/eta_api/services"
|
|
|
"eta/eta_api/utils"
|
|
|
"fmt"
|
|
@@ -318,11 +317,11 @@ func (this *ReportApproveController) List() {
|
|
|
ormList = list
|
|
|
}
|
|
|
|
|
|
- // 审批通过的报告显示下载按钮(临时版本)
|
|
|
+ // 审批通过的报告显示下载按钮
|
|
|
reportImg := make(map[string]string)
|
|
|
reportPdf := make(map[string]string)
|
|
|
{
|
|
|
- var reportIds, enReportIds, smartReportIds []int
|
|
|
+ var reportIds, enReportIds []int
|
|
|
for _, v := range ormList {
|
|
|
if v.State != report_approve.ReportApproveStatePass {
|
|
|
continue
|
|
@@ -333,9 +332,6 @@ func (this *ReportApproveController) List() {
|
|
|
if v.ReportType == report_approve.FlowReportTypeEnglish {
|
|
|
enReportIds = append(enReportIds, v.ReportId)
|
|
|
}
|
|
|
- if v.ReportType == report_approve.FlowReportTypeSmart {
|
|
|
- smartReportIds = append(smartReportIds, v.ReportId)
|
|
|
- }
|
|
|
}
|
|
|
if len(reportIds) > 0 {
|
|
|
reports, e := models.GetReportFieldsByIds(reportIds, []string{"id", "detail_img_url", "detail_pdf_url"})
|
|
@@ -363,19 +359,6 @@ func (this *ReportApproveController) List() {
|
|
|
reportPdf[k] = r.DetailPdfUrl
|
|
|
}
|
|
|
}
|
|
|
- if len(smartReportIds) > 0 {
|
|
|
- smartReports, e := smart_report.GetSmartReportFieldsByIds(smartReportIds, []string{"smart_report_id", "detail_img_url", "detail_pdf_url"})
|
|
|
- if e != nil {
|
|
|
- br.Msg = "获取失败"
|
|
|
- br.ErrMsg = fmt.Sprintf("GetSmartReportFieldsByIds, %v", e)
|
|
|
- return
|
|
|
- }
|
|
|
- for _, r := range smartReports {
|
|
|
- k := fmt.Sprintf("%d-%d", report_approve.FlowReportTypeSmart, r.SmartReportId)
|
|
|
- reportImg[k] = r.DetailImgUrl
|
|
|
- reportPdf[k] = r.DetailPdfUrl
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
// 格式化列表
|