|
|
@@ -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])
|
|
|
}
|