Commit 22f66510 authored by neo's avatar neo

[Bugfix] cannot stop timer when updateconfig is error

parent bc10900c
...@@ -549,48 +549,55 @@ ...@@ -549,48 +549,55 @@
vatOperationLogService.addOperationLog(logDto); vatOperationLogService.addOperationLog(logDto);
}; };
var updateTasksStatus = function(job){ var updateTasksStatus = function(job){
if(job.currentStep == 'UpdateConfig'){ var items = $scope.tasks[1].items;
$scope.tasks[0].items[0].status = 'processing'; if(job.jobStatus == 'End'){
$scope.tasks[0].items[0].text= $translate.instant('processing'); items.forEach(function(item,index){
}else{ item.status = 'completed';
$scope.tasks[0].items[0].status = 'completed'; item.task = $translate.instant('completed');
$scope.tasks[0].items[0].text= $translate.instant('completed'); });
var items = $scope.tasks[1].items; $scope.tasks[0].items[0].status = 'completed';
if(job.jobStatus == 'End'){ $scope.tasks[0].items[0].text= $translate.instant('completed');
items.forEach(function(item,index){
item.status = 'completed'; if($scope.timer){
}); $interval.cancel($scope.timer);
if($scope.timer){ vatCommonService.setProjectStatus(vatSessionService.project.id, vatSessionService.month, constant.ProjectStatusEnum.Generated
$interval.cancel($scope.timer); , constant.DictionaryDictKey.WFDataProcess, enums.FinishStatusEnum.Finished);
vatCommonService.setProjectStatus(vatSessionService.project.id, vatSessionService.month, constant.ProjectStatusEnum.Generated }
, constant.DictionaryDictKey.WFDataProcess, enums.FinishStatusEnum.Finished); }else if(job.jobStatus=='Running'|| job.jobStatus=='Error'){
} var tasks = JSON.parse(job.status)
}else if(job.jobStatus=='Running'|| job.jobStatus=='Error'){
var tasks = JSON.parse(job.status)
items.forEach(function(item,index){
tasks.forEach(function(task){
if(task.code==item.code){
if(task.status == 'Error'){
item.status = 'error';
}else if(task.status == 'End'){
item.status = 'completed';
}else if(task.status == 'Begin'){
item.status = 'processing';
}
item.text = $translate.instant(item.status);
}
})
});
if(job.jobStatus == 'Error'){ var updateConfig = tasks[0];
if($scope.timer)$interval.cancel($scope.timer); if(updateConfig.status == 'Error'){
$scope.tasks[0].items[0].status = 'error';
}else if(updateConfig.status == 'End'){
$scope.tasks[0].items[0].status = 'completed';
}else if(updateConfig.status == 'Begin'){
$scope.tasks[0].items[0].status = 'processing';
}
$scope.tasks[0].items[0].text= $translate.instant($scope.tasks[0].items[0].status);
items.forEach(function(item,index){
tasks.forEach(function(task){
if(task.code==item.code){
if(task.status == 'Error'){
item.status = 'error';
}else if(task.status == 'End'){
item.status = 'completed';
}else if(task.status == 'Begin'){
item.status = 'processing';
}
item.text = $translate.instant(item.status);
} }
} })
} });
if(job.jobStatus == 'Error'){
if($scope.timer)$interval.cancel($scope.timer);
}
}
} }
var getInitTaskStatus = function(){ var getInitTaskStatus = function(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment