|
@@ -317,26 +317,6 @@ func (this *ReportApproveController) List() {
|
|
|
ormList = list
|
|
|
}
|
|
|
|
|
|
- cnReportIdList := make([]int, 0)
|
|
|
- for _, v := range ormList {
|
|
|
- if v.ReportType == report_approve.FlowReportTypeChinese {
|
|
|
- cnReportIdList = append(cnReportIdList, v.ReportId)
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- reportLayoutMap := make(map[int]int8)
|
|
|
- if len(cnReportIdList) > 0 {
|
|
|
- layoutList, e := models.GetReportLayoutByReportIdList(cnReportIdList)
|
|
|
- if e != nil {
|
|
|
- br.Msg = "获取失败"
|
|
|
- br.ErrMsg = "GetReportLayoutByReportIdList err: " + e.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- for _, v := range layoutList {
|
|
|
- reportLayoutMap[v.Id] = v.ReportLayout
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
// 格式化列表
|
|
|
for _, v := range ormList {
|
|
|
t := report_approve.FormatReportApproveOrm2Item(v)
|
|
@@ -354,16 +334,6 @@ func (this *ReportApproveController) List() {
|
|
|
t.ReportClassify = reportClassify
|
|
|
}
|
|
|
|
|
|
- // 布局方式
|
|
|
- {
|
|
|
- t.ReportLayout = 1
|
|
|
- if v.ReportType == report_approve.FlowReportTypeChinese {
|
|
|
- if layout, ok := reportLayoutMap[v.ReportId]; ok {
|
|
|
- t.ReportLayout = layout
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
respList = append(respList, t)
|
|
|
}
|
|
|
|
|
@@ -547,9 +517,18 @@ func (this *ReportApproveController) Detail() {
|
|
|
detail.Report.ReportType = approveItem.ReportType
|
|
|
detail.Report.ReportId = approveItem.ReportId
|
|
|
detail.Report.ReportTitle = approveItem.ReportTitle
|
|
|
+ detail.Report.ReportLayout = 1
|
|
|
|
|
|
// 报告分类路由
|
|
|
if approveItem.ReportType == report_approve.FlowReportTypeChinese {
|
|
|
+ reportInfo, e := models.GetReportLayoutByReportId(approveItem.ReportId)
|
|
|
+ if e != nil {
|
|
|
+ br.Msg = "获取失败"
|
|
|
+ br.ErrMsg = "获取报告失败, Err: " + e.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ detail.Report.ReportLayout = reportInfo.ReportLayout
|
|
|
+
|
|
|
detail.Report.ReportCode = utils.MD5(strconv.Itoa(approveItem.ReportId))
|
|
|
detail.Report.ReportClassify = fmt.Sprintf("%s/%s/%s", report_approve.FlowReportTypeMap[approveItem.ReportType], cnClassifyIdName[approveItem.ClassifyFirstId], cnClassifyIdName[approveItem.ClassifySecondId])
|
|
|
}
|
|
@@ -558,6 +537,7 @@ func (this *ReportApproveController) Detail() {
|
|
|
detail.Report.ReportClassify = fmt.Sprintf("%s/%s/%s/%s", report_approve.FlowReportTypeMap[approveItem.ReportType], enClassifyIdName[enRootIdMap[approveItem.ClassifySecondId]], enClassifyIdName[approveItem.ClassifyFirstId], enClassifyIdName[approveItem.ClassifySecondId])
|
|
|
}
|
|
|
if approveItem.ReportType == report_approve.FlowReportTypeSmart {
|
|
|
+ detail.Report.ReportLayout = 2
|
|
|
detail.Report.ReportCode = utils.MD5(fmt.Sprint("smart_", approveItem.ReportId))
|
|
|
detail.Report.ReportClassify = fmt.Sprintf("%s/%s/%s", report_approve.FlowReportTypeMap[approveItem.ReportType], cnClassifyIdName[approveItem.ClassifyFirstId], cnClassifyIdName[approveItem.ClassifySecondId])
|
|
|
}
|