Skip to content

Commit

Permalink
fix: fill in work hours for zentao (#5673)
Browse files Browse the repository at this point in the history
  • Loading branch information
mindlesscloud committed Jul 14, 2023
1 parent 91d5e4b commit 2599694
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 39 deletions.
16 changes: 8 additions & 8 deletions backend/plugins/zentao/e2e/snapshot_tables/issues_story.csv
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
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
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,产品经理,,
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,产品经理,,
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,产品经理,,
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,产品经理,,
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,产品经理,,
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,产品经理,,
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,产品经理,,
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,产品经理,,
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,产品经理,,
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,产品经理,,
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,产品经理,,
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,产品经理,,
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,产品经理,,
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,产品经理,,
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,产品经理,,
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,产品经理,,
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,产品经理,,
4 changes: 2 additions & 2 deletions backend/plugins/zentao/e2e/snapshot_tables/issues_task.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
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
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,开发乙,,
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,开发乙,,
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,开发乙,,
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,开发乙,,
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,开发乙,,
29 changes: 15 additions & 14 deletions backend/plugins/zentao/tasks/story_convertor.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,21 @@ func ConvertStory(taskCtx plugin.SubTaskContext) errors.Error {
DomainEntity: domainlayer.DomainEntity{
Id: storyIdGen.Generate(toolEntity.ConnectionId, toolEntity.ID),
},
IssueKey: strconv.FormatInt(toolEntity.ID, 10),
Title: toolEntity.Title,
Type: ticket.REQUIREMENT,
OriginalType: toolEntity.Type + "." + toolEntity.Category,
OriginalStatus: toolEntity.Status,
ResolutionDate: toolEntity.ClosedDate.ToNullableTime(),
CreatedDate: toolEntity.OpenedDate.ToNullableTime(),
UpdatedDate: toolEntity.LastEditedDate.ToNullableTime(),
Priority: getPriority(toolEntity.Pri),
CreatorName: toolEntity.OpenedByName,
AssigneeName: toolEntity.AssignedToName,
Url: toolEntity.Url,
OriginalProject: getOriginalProject(data),
Status: toolEntity.StdStatus,
IssueKey: strconv.FormatInt(toolEntity.ID, 10),
Title: toolEntity.Title,
Type: ticket.REQUIREMENT,
OriginalType: toolEntity.Type + "." + toolEntity.Category,
OriginalStatus: toolEntity.Status,
ResolutionDate: toolEntity.ClosedDate.ToNullableTime(),
CreatedDate: toolEntity.OpenedDate.ToNullableTime(),
UpdatedDate: toolEntity.LastEditedDate.ToNullableTime(),
Priority: getPriority(toolEntity.Pri),
CreatorName: toolEntity.OpenedByName,
AssigneeName: toolEntity.AssignedToName,
Url: toolEntity.Url,
OriginalProject: getOriginalProject(data),
Status: toolEntity.StdStatus,
OriginalEstimateMinutes: int64(toolEntity.Estimate) * 60,
}
if toolEntity.Parent != 0 {
domainEntity.ParentIssueId = storyIdGen.Generate(data.Options.ConnectionId, toolEntity.Parent)
Expand Down
33 changes: 18 additions & 15 deletions backend/plugins/zentao/tasks/task_convertor.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,25 @@ func ConvertTask(taskCtx plugin.SubTaskContext) errors.Error {
DomainEntity: domainlayer.DomainEntity{
Id: taskIdGen.Generate(toolEntity.ConnectionId, toolEntity.ID),
},
IssueKey: strconv.FormatInt(toolEntity.ID, 10),
Title: toolEntity.Name,
Description: toolEntity.Description,
Type: ticket.TASK,
OriginalType: toolEntity.Type + "." + toolEntity.Mode,
OriginalStatus: toolEntity.Status,
ResolutionDate: toolEntity.ClosedDate.ToNullableTime(),
CreatedDate: toolEntity.OpenedDate.ToNullableTime(),
UpdatedDate: toolEntity.LastEditedDate.ToNullableTime(),
Priority: getPriority(toolEntity.Pri),
CreatorName: toolEntity.OpenedByName,
AssigneeName: toolEntity.AssignedToName,
Url: toolEntity.Url,
OriginalProject: getOriginalProject(data),
Status: toolEntity.StdStatus,
IssueKey: strconv.FormatInt(toolEntity.ID, 10),
Title: toolEntity.Name,
Description: toolEntity.Description,
Type: ticket.TASK,
OriginalType: toolEntity.Type + "." + toolEntity.Mode,
OriginalStatus: toolEntity.Status,
ResolutionDate: toolEntity.ClosedDate.ToNullableTime(),
CreatedDate: toolEntity.OpenedDate.ToNullableTime(),
UpdatedDate: toolEntity.LastEditedDate.ToNullableTime(),
Priority: getPriority(toolEntity.Pri),
CreatorName: toolEntity.OpenedByName,
AssigneeName: toolEntity.AssignedToName,
Url: toolEntity.Url,
OriginalProject: getOriginalProject(data),
Status: toolEntity.StdStatus,
OriginalEstimateMinutes: int64(toolEntity.Estimate) * 60,
TimeSpentMinutes: int64(toolEntity.Consumed) * 60,
}
domainEntity.TimeRemainingMinutes = domainEntity.OriginalEstimateMinutes - domainEntity.TimeSpentMinutes
if toolEntity.Parent != 0 {
domainEntity.ParentIssueId = storyIdGen.Generate(data.Options.ConnectionId, toolEntity.Parent)
}
Expand Down

0 comments on commit 2599694

Please sign in to comment.