Browse Source

解决更新后的逻辑冲突

pull/3/MERGE
Zhou Zheng 4 years ago
parent
commit
ae9eb160c1
  1. 9
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataAnalysisServiceImpl.java
  2. 2
      dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapperTest.java
  3. 1
      dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java

9
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/DataAnalysisServiceImpl.java

@ -122,12 +122,17 @@ public class DataAnalysisServiceImpl extends BaseService implements DataAnalysis
* @return process instance state count data * @return process instance state count data
*/ */
public Map<String, Object> countProcessInstanceStateByProject(User loginUser, int projectId, String startDate, String endDate) { public Map<String, Object> countProcessInstanceStateByProject(User loginUser, int projectId, String startDate, String endDate) {
return this.countStateByProject( Map<String, Object> tmpResult = this.countStateByProject(
loginUser, loginUser,
projectId, projectId,
startDate, startDate,
endDate, endDate,
(start, end, projectIds) -> this.processInstanceMapper.countInstanceStateByUser(start, end, projectIds)); (start, end, projectIds) -> this.processInstanceMapper.countInstanceStateByUser(start, end, projectIds));
// process state count needs to remove state of forced success
if (tmpResult.get(Constants.STATUS).equals(Status.SUCCESS)) {
((TaskCountDto)tmpResult.get(Constants.DATA_LIST)).removeStateFromCountList(ExecutionStatus.FORCED_SUCCESS);
}
return tmpResult;
} }
private Map<String, Object> countStateByProject(User loginUser, int projectId, String startDate, String endDate private Map<String, Object> countStateByProject(User loginUser, int projectId, String startDate, String endDate
@ -154,8 +159,6 @@ public class DataAnalysisServiceImpl extends BaseService implements DataAnalysis
if (processInstanceStateCounts != null) { if (processInstanceStateCounts != null) {
TaskCountDto taskCountResult = new TaskCountDto(processInstanceStateCounts); TaskCountDto taskCountResult = new TaskCountDto(processInstanceStateCounts);
// process state count needs to remove state of forced success
taskCountResult.removeStateFromCountList(ExecutionStatus.FORCED_SUCCESS);
result.put(Constants.DATA_LIST, taskCountResult); result.put(Constants.DATA_LIST, taskCountResult);
putMsg(result, Status.SUCCESS); putMsg(result, Status.SUCCESS);
} }

2
dolphinscheduler-dao/src/test/java/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapperTest.java

@ -64,7 +64,7 @@ public class TaskInstanceMapperTest {
*/ */
private TaskInstance insertOne(){ private TaskInstance insertOne(){
//insertOne //insertOne
return insertOne("us task", 1, ExecutionStatus.RUNNING_EXEUTION, TaskType.SHELL.toString()); return insertOne("us task", 1, ExecutionStatus.RUNNING_EXECUTION, TaskType.SHELL.toString());
} }
/** /**

1
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java

@ -36,6 +36,7 @@ import org.apache.dolphinscheduler.common.enums.FailureStrategy;
import org.apache.dolphinscheduler.common.enums.Flag; import org.apache.dolphinscheduler.common.enums.Flag;
import org.apache.dolphinscheduler.common.enums.ResourceType; import org.apache.dolphinscheduler.common.enums.ResourceType;
import org.apache.dolphinscheduler.common.enums.TaskDependType; import org.apache.dolphinscheduler.common.enums.TaskDependType;
import org.apache.dolphinscheduler.common.enums.TaskType;
import org.apache.dolphinscheduler.common.enums.WarningType; import org.apache.dolphinscheduler.common.enums.WarningType;
import org.apache.dolphinscheduler.common.model.DateInterval; import org.apache.dolphinscheduler.common.model.DateInterval;
import org.apache.dolphinscheduler.common.model.TaskNode; import org.apache.dolphinscheduler.common.model.TaskNode;

Loading…
Cancel
Save