Skip to content

Commit 2599694

Browse files
fix: fill in work hours for zentao (#5673)
1 parent 91d5e4b commit 2599694

4 files changed

Lines changed: 43 additions & 39 deletions

File tree

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
id,url,icon_url,issue_key,title,description,epic_key,type,original_type,status,original_status,story_point,resolution_date,created_date,updated_date,lead_time_minutes,parent_issue_id,priority,original_estimate_minutes,time_spent_minutes,time_remaining_minutes,creator_id,creator_name,assignee_id,assignee_name,severity,component
2-
zentao:ZentaoStory:1:1,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,1,首页设计和开发,,,REQUIREMENT,story.feature,,active,0,,2012-06-05T02:09:49.000+00:00,2012-06-05T02:25:19.000+00:00,0,,1,0,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
3-
zentao:ZentaoStory:1:2,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,2,新闻中心的设计和开发。,,,REQUIREMENT,story.feature,,active,0,,2012-06-05T02:16:37.000+00:00,2012-06-05T02:25:33.000+00:00,0,,1,0,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
2+
zentao:ZentaoStory:1:1,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,1,首页设计和开发,,,REQUIREMENT,story.feature,,active,0,,2012-06-05T02:09:49.000+00:00,2012-06-05T02:25:19.000+00:00,0,,1,60,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
3+
zentao:ZentaoStory:1:2,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,2,新闻中心的设计和开发。,,,REQUIREMENT,story.feature,,active,0,,2012-06-05T02:16:37.000+00:00,2012-06-05T02:25:33.000+00:00,0,,1,60,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
44
zentao:ZentaoStory:1:3,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,3,成果展示的设计和开发,,,REQUIREMENT,story.feature,,active,0,,2012-06-05T02:18:10.000+00:00,2012-06-05T02:25:38.000+00:00,0,,1,0,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
5-
zentao:ZentaoStory:1:4,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,4,售后服务的设计和开发,,,REQUIREMENT,story.feature,,active,0,,2012-06-05T02:20:16.000+00:00,2012-06-05T02:25:42.000+00:00,0,,1,0,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
6-
zentao:ZentaoStory:1:5,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,5,诚聘英才的设计和开发,,,REQUIREMENT,story.feature,,reviewing,0,,2012-06-05T02:21:39.000+00:00,,0,,1,0,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
7-
zentao:ZentaoStory:1:6,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,6,合作洽谈的设计和开发,,,REQUIREMENT,story.feature,,reviewing,0,,2012-06-05T02:23:11.000+00:00,,0,,1,0,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
8-
zentao:ZentaoStory:1:7,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,7,关于我们的设计和开发,,,REQUIREMENT,story.feature,,reviewing,0,,2012-06-05T02:24:19.000+00:00,,0,,1,0,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
9-
zentao:ZentaoStory:1:8,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,8,新闻中心的设计和开发。,,,REQUIREMENT,story.feature,,active,0,,2012-06-05T02:16:37.000+00:00,2012-06-05T02:25:33.000+00:00,0,,1,0,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
10-
zentao:ZentaoStory:1:9,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,9,首页设计和开发,,,REQUIREMENT,story.feature,,active,0,,2012-06-05T02:09:49.000+00:00,2012-06-05T02:25:19.000+00:00,0,,1,0,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
5+
zentao:ZentaoStory:1:4,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,4,售后服务的设计和开发,,,REQUIREMENT,story.feature,,active,0,,2012-06-05T02:20:16.000+00:00,2012-06-05T02:25:42.000+00:00,0,,1,60,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
6+
zentao:ZentaoStory:1:5,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,5,诚聘英才的设计和开发,,,REQUIREMENT,story.feature,,reviewing,0,,2012-06-05T02:21:39.000+00:00,,0,,1,60,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
7+
zentao:ZentaoStory:1:6,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,6,合作洽谈的设计和开发,,,REQUIREMENT,story.feature,,reviewing,0,,2012-06-05T02:23:11.000+00:00,,0,,1,60,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
8+
zentao:ZentaoStory:1:7,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,7,关于我们的设计和开发,,,REQUIREMENT,story.feature,,reviewing,0,,2012-06-05T02:24:19.000+00:00,,0,,1,60,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
9+
zentao:ZentaoStory:1:8,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,8,新闻中心的设计和开发。,,,REQUIREMENT,story.feature,,active,0,,2012-06-05T02:16:37.000+00:00,2012-06-05T02:25:33.000+00:00,0,,1,60,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
10+
zentao:ZentaoStory:1:9,http://iwater.red:8000/api.php/v1/products/1/stories?limit=100&page=1,,9,首页设计和开发,,,REQUIREMENT,story.feature,,active,0,,2012-06-05T02:09:49.000+00:00,2012-06-05T02:25:19.000+00:00,0,,1,60,0,0,zentao:ZentaoAccount:1:2,产品经理,zentao:ZentaoAccount:1:2,产品经理,,
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
id,url,icon_url,issue_key,title,description,epic_key,type,original_type,status,original_status,story_point,resolution_date,created_date,updated_date,lead_time_minutes,parent_issue_id,priority,original_estimate_minutes,time_spent_minutes,time_remaining_minutes,creator_id,creator_name,assignee_id,assignee_name,severity,component
22
zentao:ZentaoTask:1:1,http://iwater.red:8000/api.php/v1/executions/9/tasks?limit=100&page=1,,1,任务名称,任务描述<span> </span><br /><div><br /></div>,,TASK,devel.,IN_PROGRESS,wait,0,,2022-09-19T01:50:37.000+00:00,,0,,3,0,0,0,zentao:ZentaoAccount:1:1,devlake,zentao:ZentaoAccount:1:5,开发乙,,
3-
zentao:ZentaoTask:1:2,http://iwater.red:8000/api.php/v1/executions/4/tasks?limit=100&page=1,,2,任务名称,任务描述<span> </span><br /><div><br /></div>,,TASK,devel.,IN_PROGRESS,wait,0,,2022-09-19T01:50:37.000+00:00,,0,,3,0,0,0,zentao:ZentaoAccount:1:1,devlake,zentao:ZentaoAccount:1:5,开发乙,,
4-
zentao:ZentaoTask:1:3,http://iwater.red:8000/api.php/v1/executions/3/tasks?limit=100&page=1,,3,任务名称,任务描述<span> </span><br /><div><br /></div>,,TASK,devel.,IN_PROGRESS,wait,0,,2022-09-19T01:50:37.000+00:00,,0,zentao:ZentaoStory:1:-1,3,0,0,0,zentao:ZentaoAccount:1:1,devlake,zentao:ZentaoAccount:1:5,开发乙,,
3+
zentao:ZentaoTask:1:2,http://iwater.red:8000/api.php/v1/executions/4/tasks?limit=100&page=1,,2,任务名称,任务描述<span> </span><br /><div><br /></div>,,TASK,devel.,IN_PROGRESS,wait,0,,2022-09-19T01:50:37.000+00:00,,0,,3,720,120,600,zentao:ZentaoAccount:1:1,devlake,zentao:ZentaoAccount:1:5,开发乙,,
4+
zentao:ZentaoTask:1:3,http://iwater.red:8000/api.php/v1/executions/3/tasks?limit=100&page=1,,3,任务名称,任务描述<span> </span><br /><div><br /></div>,,TASK,devel.,IN_PROGRESS,wait,0,,2022-09-19T01:50:37.000+00:00,,0,zentao:ZentaoStory:1:-1,3,660,0,660,zentao:ZentaoAccount:1:1,devlake,zentao:ZentaoAccount:1:5,开发乙,,

backend/plugins/zentao/tasks/story_convertor.go

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -75,20 +75,21 @@ func ConvertStory(taskCtx plugin.SubTaskContext) errors.Error {
7575
DomainEntity: domainlayer.DomainEntity{
7676
Id: storyIdGen.Generate(toolEntity.ConnectionId, toolEntity.ID),
7777
},
78-
IssueKey: strconv.FormatInt(toolEntity.ID, 10),
79-
Title: toolEntity.Title,
80-
Type: ticket.REQUIREMENT,
81-
OriginalType: toolEntity.Type + "." + toolEntity.Category,
82-
OriginalStatus: toolEntity.Status,
83-
ResolutionDate: toolEntity.ClosedDate.ToNullableTime(),
84-
CreatedDate: toolEntity.OpenedDate.ToNullableTime(),
85-
UpdatedDate: toolEntity.LastEditedDate.ToNullableTime(),
86-
Priority: getPriority(toolEntity.Pri),
87-
CreatorName: toolEntity.OpenedByName,
88-
AssigneeName: toolEntity.AssignedToName,
89-
Url: toolEntity.Url,
90-
OriginalProject: getOriginalProject(data),
91-
Status: toolEntity.StdStatus,
78+
IssueKey: strconv.FormatInt(toolEntity.ID, 10),
79+
Title: toolEntity.Title,
80+
Type: ticket.REQUIREMENT,
81+
OriginalType: toolEntity.Type + "." + toolEntity.Category,
82+
OriginalStatus: toolEntity.Status,
83+
ResolutionDate: toolEntity.ClosedDate.ToNullableTime(),
84+
CreatedDate: toolEntity.OpenedDate.ToNullableTime(),
85+
UpdatedDate: toolEntity.LastEditedDate.ToNullableTime(),
86+
Priority: getPriority(toolEntity.Pri),
87+
CreatorName: toolEntity.OpenedByName,
88+
AssigneeName: toolEntity.AssignedToName,
89+
Url: toolEntity.Url,
90+
OriginalProject: getOriginalProject(data),
91+
Status: toolEntity.StdStatus,
92+
OriginalEstimateMinutes: int64(toolEntity.Estimate) * 60,
9293
}
9394
if toolEntity.Parent != 0 {
9495
domainEntity.ParentIssueId = storyIdGen.Generate(data.Options.ConnectionId, toolEntity.Parent)

backend/plugins/zentao/tasks/task_convertor.go

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -73,22 +73,25 @@ func ConvertTask(taskCtx plugin.SubTaskContext) errors.Error {
7373
DomainEntity: domainlayer.DomainEntity{
7474
Id: taskIdGen.Generate(toolEntity.ConnectionId, toolEntity.ID),
7575
},
76-
IssueKey: strconv.FormatInt(toolEntity.ID, 10),
77-
Title: toolEntity.Name,
78-
Description: toolEntity.Description,
79-
Type: ticket.TASK,
80-
OriginalType: toolEntity.Type + "." + toolEntity.Mode,
81-
OriginalStatus: toolEntity.Status,
82-
ResolutionDate: toolEntity.ClosedDate.ToNullableTime(),
83-
CreatedDate: toolEntity.OpenedDate.ToNullableTime(),
84-
UpdatedDate: toolEntity.LastEditedDate.ToNullableTime(),
85-
Priority: getPriority(toolEntity.Pri),
86-
CreatorName: toolEntity.OpenedByName,
87-
AssigneeName: toolEntity.AssignedToName,
88-
Url: toolEntity.Url,
89-
OriginalProject: getOriginalProject(data),
90-
Status: toolEntity.StdStatus,
76+
IssueKey: strconv.FormatInt(toolEntity.ID, 10),
77+
Title: toolEntity.Name,
78+
Description: toolEntity.Description,
79+
Type: ticket.TASK,
80+
OriginalType: toolEntity.Type + "." + toolEntity.Mode,
81+
OriginalStatus: toolEntity.Status,
82+
ResolutionDate: toolEntity.ClosedDate.ToNullableTime(),
83+
CreatedDate: toolEntity.OpenedDate.ToNullableTime(),
84+
UpdatedDate: toolEntity.LastEditedDate.ToNullableTime(),
85+
Priority: getPriority(toolEntity.Pri),
86+
CreatorName: toolEntity.OpenedByName,
87+
AssigneeName: toolEntity.AssignedToName,
88+
Url: toolEntity.Url,
89+
OriginalProject: getOriginalProject(data),
90+
Status: toolEntity.StdStatus,
91+
OriginalEstimateMinutes: int64(toolEntity.Estimate) * 60,
92+
TimeSpentMinutes: int64(toolEntity.Consumed) * 60,
9193
}
94+
domainEntity.TimeRemainingMinutes = domainEntity.OriginalEstimateMinutes - domainEntity.TimeSpentMinutes
9295
if toolEntity.Parent != 0 {
9396
domainEntity.ParentIssueId = storyIdGen.Generate(data.Options.ConnectionId, toolEntity.Parent)
9497
}

0 commit comments

Comments
 (0)