Browse Source

添加任务时项目状态检验修改

xuexiaobo 6 years ago
parent
commit
a81ad9ef43

+ 1 - 1
core/src/main/java/com/mooctest/crowd/domain/domainobject/CrowdTestProject.java

@@ -252,7 +252,7 @@ public class CrowdTestProject {
     }
 
     public void addTask(CrowdTestTask task){
-        if (this.getStatus() != CrowdTestProjectStatus.HAS_RECEIVED)
+        if (!(this.getStatus() >= CrowdTestProjectStatus.HAS_RECEIVED || this.getStatus()<=CrowdTestTaskStatus.HAS_COMMITED))
             throw new BaseException("当前阶段不允许创建新任务");
         this.getCrowdTestTaskList().add(task);
     }

+ 0 - 1
site/src/main/java/com/mooctest/crowd/site/service/impl/AgencyServiceImpl.java

@@ -3,7 +3,6 @@ package com.mooctest.crowd.site.service.impl;
 import com.mooctest.crowd.domain.domainobject.*;
 import com.mooctest.crowd.domain.exception.BaseException;
 import com.mooctest.crowd.domain.exception.EvaluationAgencyNotExistException;
-import com.mooctest.crowd.domain.exception.UnauthorizedException;
 import com.mooctest.crowd.domain.exception.UserNotExistException;
 import com.mooctest.crowd.domain.repository.EvaluationAgencyRepo;
 import com.mooctest.crowd.domain.repository.UserRepo;