Explorar el Código

fix:审批研报详情分类拼接

zqbao hace 5 meses
padre
commit
12598caf42
Se han modificado 1 ficheros con 13 adiciones y 1 borrados
  1. 13 1
      controllers/report_approve/report_approve.go

+ 13 - 1
controllers/report_approve/report_approve.go

@@ -615,7 +615,19 @@ func (this *ReportApproveController) Detail() {
 		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])
+		var reportClassify []string
+		reportClassify = append(reportClassify, report_approve.FlowReportTypeMap[approveItem.ReportType])
+		if v, ok := cnClassifyIdName[approveItem.ClassifyFirstId]; ok {
+			reportClassify = append(reportClassify, v)
+		}
+		if v, ok := cnClassifyIdName[approveItem.ClassifySecondId]; ok {
+			reportClassify = append(reportClassify, v)
+		}
+		if v, ok := cnClassifyIdName[approveItem.ClassifyThirdId]; ok {
+			reportClassify = append(reportClassify, v)
+		}
+		detail.Report.ReportClassify = strings.Join(reportClassify, "/")
+		// detail.Report.ReportClassify = fmt.Sprintf("%s/%s/%s/%s", report_approve.FlowReportTypeMap[approveItem.ReportType], cnClassifyIdName[approveItem.ClassifyFirstId], cnClassifyIdName[approveItem.ClassifySecondId], cnClassifyIdName[approveItem.ClassifyThirdId])
 	}
 	if approveItem.ReportType == report_approve.FlowReportTypeEnglish {
 		detail.Report.ReportCode = utils.MD5(strconv.Itoa(approveItem.ReportId))