|
@@ -282,33 +282,45 @@ func ApprovalListExport(this *SealApprovalController, condition, joinCondition s
|
|
|
keySort = append(keySort, approvalRecord.NodeId)
|
|
|
}
|
|
|
}
|
|
|
- for ii, key := range keySort {
|
|
|
- if ii == 0 {
|
|
|
- if node, ok := flowNodeMap[key]; ok {
|
|
|
- for _, vv := range node {
|
|
|
- if vv.NodeType == "check" {
|
|
|
- list[i].FirstLevelApprovers += vv.ApproveUserName + ","
|
|
|
- }
|
|
|
+ approversList := make([][]string, 0)
|
|
|
+ ccList := make([][]string, 0)
|
|
|
+ for _, key := range keySort {
|
|
|
+ approver := make([]string, 0)
|
|
|
+ cc := make([]string, 0)
|
|
|
+ if node, ok := flowNodeMap[key]; ok {
|
|
|
+ for _, vv := range node {
|
|
|
+ if vv.NodeType == "check" {
|
|
|
+ approver = append(approver, vv.ApproveUserName)
|
|
|
+ } else if vv.NodeType == "cc" {
|
|
|
+ cc = append(cc, vv.ApproveUserName)
|
|
|
}
|
|
|
}
|
|
|
- } else {
|
|
|
- if node, ok := flowNodeMap[key]; ok {
|
|
|
- for _, vv := range node {
|
|
|
- if vv.NodeType == "check" {
|
|
|
- list[i].SecondLevelApprovers += vv.ApproveUserName + ","
|
|
|
- } else if vv.NodeType == "cc" && list[i].FirstLevelCC == "" {
|
|
|
- list[i].FirstLevelCC += vv.ApproveUserName + ","
|
|
|
- } else {
|
|
|
- list[i].SecondLevelCC += vv.ApproveUserName + ","
|
|
|
- }
|
|
|
- }
|
|
|
+ if len(approver) > 0 {
|
|
|
+ approversList = append(approversList, approver)
|
|
|
+ }
|
|
|
+ if len(cc) > 0 {
|
|
|
+ ccList = append(ccList, cc)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- list[i].FirstLevelApprovers = strings.TrimRight(list[i].FirstLevelApprovers, ",")
|
|
|
- list[i].FirstLevelCC = strings.TrimRight(list[i].FirstLevelCC, ",")
|
|
|
- list[i].SecondLevelApprovers = strings.TrimRight(list[i].SecondLevelApprovers, ",")
|
|
|
- list[i].SecondLevelCC = strings.TrimRight(list[i].SecondLevelCC, ",")
|
|
|
+ if len(approversList) > 0 {
|
|
|
+ list[i].FirstLevelApprovers = strings.Join(approversList[0], ",")
|
|
|
+ }
|
|
|
+ if len(ccList) > 0 {
|
|
|
+ list[i].FirstLevelCC = strings.Join(ccList[0], ",")
|
|
|
+ }
|
|
|
+ if len(approversList) > 1 {
|
|
|
+ list[i].SecondLevelApprovers = strings.Join(approversList[1], ",")
|
|
|
+ }
|
|
|
+ if len(ccList) > 1 {
|
|
|
+ list[i].SecondLevelCC = strings.Join(ccList[1], ",")
|
|
|
+ }
|
|
|
+ if len(approversList) > 2 {
|
|
|
+ list[i].ThirdLevelApprovers = strings.Join(approversList[2], ",")
|
|
|
+ }
|
|
|
+ if len(ccList) > 2 {
|
|
|
+ list[i].ThirdLevelCC = strings.Join(ccList[2], ",")
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -368,6 +380,10 @@ func ApprovalListExport(this *SealApprovalController, condition, joinCondition s
|
|
|
cellM.Value = "二级审批人"
|
|
|
cellN := rowTitle.AddCell()
|
|
|
cellN.Value = "二级抄送人"
|
|
|
+ cellO := rowTitle.AddCell()
|
|
|
+ cellO.Value = "三级审批人"
|
|
|
+ cellP := rowTitle.AddCell()
|
|
|
+ cellP.Value = "三级抄送人"
|
|
|
|
|
|
for _, v := range list {
|
|
|
row := sheet.AddRow()
|
|
@@ -399,6 +415,10 @@ func ApprovalListExport(this *SealApprovalController, condition, joinCondition s
|
|
|
cellM.Value = v.SecondLevelApprovers
|
|
|
cellN := row.AddCell()
|
|
|
cellN.Value = v.SecondLevelCC
|
|
|
+ cellO := row.AddCell()
|
|
|
+ cellO.Value = v.ThirdLevelApprovers
|
|
|
+ cellP := row.AddCell()
|
|
|
+ cellP.Value = v.ThirdLevelCC
|
|
|
}
|
|
|
|
|
|
err = xlsxFile.Save(downLoadnFilePath)
|