ソースを参照

fix(督办): 导出数据调整

likai 3 年 前
コミット
064b5c7db7
1 ファイル変更17 行追加1 行削除
  1. 17 1
      opms_parent/app/service/plat/plat_task.go

+ 17 - 1
opms_parent/app/service/plat/plat_task.go

@@ -14,6 +14,7 @@ import (
 	"github.com/gogf/gf/os/gtime"
 	"github.com/gogf/gf/util/gconv"
 	"strconv"
+	"strings"
 )
 
 type taskService struct {
@@ -111,7 +112,7 @@ func (s *taskService) Export(req *model.ExportReq) (content *model.ExportContent
 			return nil, err
 		}
 		for _, item := range users {
-			userMap[item["id"].Int()] = item["user_name"].String()
+			userMap[item["id"].Int()] = item["nick_name"].String()
 		}
 		for _, item := range types {
 			typeMap[item["dict_value"].String()] = item["dict_label"].String()
@@ -154,6 +155,21 @@ func (s *taskService) Export(req *model.ExportReq) (content *model.ExportContent
 				if value == "负责人" {
 					f.SetCellValue("Sheet1", service.Div(index+1)+strconv.Itoa(lineNum+2), userMap[item.MainUserId])
 				}
+				if value == "团队成员" {
+					names := ""
+					if item.OwnerUserId != "" {
+						ids := strings.Split(item.OwnerUserId, ",")
+						for _, id := range ids {
+							if names == "" {
+								names = userMap[gconv.Int(id)]
+							} else {
+								names += "," + userMap[gconv.Int(id)]
+							}
+						}
+					}
+
+					f.SetCellValue("Sheet1", service.Div(index+1)+strconv.Itoa(lineNum+2), names)
+				}
 				if value == "督办人" {
 					f.SetCellValue("Sheet1", service.Div(index+1)+strconv.Itoa(lineNum+2), userMap[item.SupervisorUserId])
 				}