fix: fill in work hours for zentao (#5673)

diff --git a/backend/plugins/zentao/e2e/snapshot_tables/issues_story.csv b/backend/plugins/zentao/e2e/snapshot_tables/issues_story.csv
index 27ba1ef..addcc6a 100644
--- a/backend/plugins/zentao/e2e/snapshot_tables/issues_story.csv
+++ b/backend/plugins/zentao/e2e/snapshot_tables/issues_story.csv
@@ -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,产品经理,,
diff --git a/backend/plugins/zentao/e2e/snapshot_tables/issues_task.csv b/backend/plugins/zentao/e2e/snapshot_tables/issues_task.csv
index 070797b..fd57b3b 100644
--- a/backend/plugins/zentao/e2e/snapshot_tables/issues_task.csv
+++ b/backend/plugins/zentao/e2e/snapshot_tables/issues_task.csv
@@ -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,开发乙,,
diff --git a/backend/plugins/zentao/tasks/story_convertor.go b/backend/plugins/zentao/tasks/story_convertor.go
index 66b73dd..e94cc44 100644
--- a/backend/plugins/zentao/tasks/story_convertor.go
+++ b/backend/plugins/zentao/tasks/story_convertor.go
@@ -75,20 +75,21 @@
 				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)
diff --git a/backend/plugins/zentao/tasks/task_convertor.go b/backend/plugins/zentao/tasks/task_convertor.go
index 2805247..072fbab 100644
--- a/backend/plugins/zentao/tasks/task_convertor.go
+++ b/backend/plugins/zentao/tasks/task_convertor.go
@@ -73,22 +73,25 @@
 				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)
 			}