|
@@ -11,8 +11,10 @@ import com.mooctest.crowd.domain.model.CrowdTestTaskPO;
|
|
|
import com.mooctest.crowd.domain.model.EvaluationAgencyPO;
|
|
|
import com.mooctest.crowd.domain.model.UserPO;
|
|
|
import com.mooctest.crowd.domain.repository.CrowdTestProjectRepo;
|
|
|
+import com.mooctest.crowd.domain.repository.EvaluationAgencyRepo;
|
|
|
import com.mooctest.crowd.domain.repository.UserRepo;
|
|
|
-import com.mooctest.crowd.site.command.*;
|
|
|
+import com.mooctest.crowd.site.command.LoginCommand;
|
|
|
+import com.mooctest.crowd.site.command.RegisterCommand;
|
|
|
import com.mooctest.crowd.site.data.ProjectOperationControl;
|
|
|
import com.mooctest.crowd.site.data.TaskOperationControl;
|
|
|
import com.mooctest.crowd.site.data.dto.*;
|
|
@@ -21,11 +23,11 @@ import com.mooctest.crowd.site.mediator.ViewMediator;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
+
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -44,6 +46,9 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
private UserRepo userRepo;
|
|
|
|
|
|
@Autowired
|
|
|
+ private EvaluationAgencyRepo evaluationAgencyRepo;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private CrowdTestTaskDao taskDao;
|
|
|
|
|
|
@Autowired
|
|
@@ -67,6 +72,9 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
@Autowired
|
|
|
private EnterpriseAuthenticationDao enterpriseAuthenticationDao;
|
|
|
|
|
|
+ @Value("${agency}")
|
|
|
+ private String agencyId;
|
|
|
+
|
|
|
@Override
|
|
|
public UserDTO loginByMobileAndPwd(LoginCommand cmd) {
|
|
|
return null;
|
|
@@ -351,13 +359,14 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
@Override
|
|
|
public List<EvolutionAgencyVO> renderAgencyList() {
|
|
|
List<EvolutionAgencyVO> agencyList = new ArrayList<>();
|
|
|
+ EvaluationAgency agencyTemplate = evaluationAgencyRepo.findAgencyById(Long.parseLong(agencyId));
|
|
|
agencyDao.findAll().forEach(evaluationAgencyPO -> {
|
|
|
EvolutionAgencyVO agencyVO = new EvolutionAgencyVO();
|
|
|
agencyVO.setId(evaluationAgencyPO.getUserId());
|
|
|
agencyVO.setName(evaluationAgencyPO.getEvaluationAgencyName());
|
|
|
agencyList.add(agencyVO);
|
|
|
});
|
|
|
- return agencyList;
|
|
|
+ return agencyList.stream().filter(agency -> !agency.getName().equals(agencyTemplate.getEvaluationAgencyName())).collect(Collectors.toList());
|
|
|
}
|
|
|
|
|
|
@Override
|