|
@@ -6,9 +6,7 @@ import com.mooctest.crowd.domain.exception.BaseException;
|
|
import com.mooctest.crowd.domain.exception.EvaluationAgencyNotExistException;
|
|
import com.mooctest.crowd.domain.exception.EvaluationAgencyNotExistException;
|
|
import com.mooctest.crowd.domain.exception.HttpBadRequestException;
|
|
import com.mooctest.crowd.domain.exception.HttpBadRequestException;
|
|
import com.mooctest.crowd.domain.exception.UserNotExistException;
|
|
import com.mooctest.crowd.domain.exception.UserNotExistException;
|
|
-import com.mooctest.crowd.domain.model.EvaluationAgencyPO;
|
|
|
|
-import com.mooctest.crowd.domain.model.RankCountInfo;
|
|
|
|
-import com.mooctest.crowd.domain.model.UserTaskCountPO;
|
|
|
|
|
|
+import com.mooctest.crowd.domain.model.*;
|
|
import com.mooctest.crowd.domain.repository.EvaluationAgencyRepo;
|
|
import com.mooctest.crowd.domain.repository.EvaluationAgencyRepo;
|
|
import com.mooctest.crowd.domain.repository.UserRepo;
|
|
import com.mooctest.crowd.domain.repository.UserRepo;
|
|
import com.mooctest.crowd.site.anticorruption.UserAntiCorruption;
|
|
import com.mooctest.crowd.site.anticorruption.UserAntiCorruption;
|
|
@@ -54,6 +52,8 @@ public class AgencyServiceImpl implements AgencyService {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private ViewMediator mediator;
|
|
private ViewMediator mediator;
|
|
|
|
+ @Autowired
|
|
|
|
+ private TestTypeDao testTypeDao;
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private EvaluationAgencyRepo evaluationAgencyRepo;
|
|
private EvaluationAgencyRepo evaluationAgencyRepo;
|
|
@@ -69,12 +69,27 @@ public class AgencyServiceImpl implements AgencyService {
|
|
/*
|
|
/*
|
|
先根据机构id查询出机构信息,再从task-to-user表里面找到这个机构的接的任务的数量。
|
|
先根据机构id查询出机构信息,再从task-to-user表里面找到这个机构的接的任务的数量。
|
|
*/
|
|
*/
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ List<String> agencyAbilities = new ArrayList<>();//机构能力list
|
|
|
|
+ //根据compentence[]从test——type表利查询对应的能力名称
|
|
|
|
+
|
|
Optional<EvaluationAgencyPO> agencyPO = agencyDao.findById(agencyId);
|
|
Optional<EvaluationAgencyPO> agencyPO = agencyDao.findById(agencyId);
|
|
if (!agencyPO.isPresent()) {
|
|
if (!agencyPO.isPresent()) {
|
|
throw new HttpBadRequestException("机构不存在!");
|
|
throw new HttpBadRequestException("机构不存在!");
|
|
}
|
|
}
|
|
EvaluationAgency evaluationAgency = new EvaluationAgency(agencyPO.get());
|
|
EvaluationAgency evaluationAgency = new EvaluationAgency(agencyPO.get());
|
|
|
|
+ Optional<UserPO> userPO = userDao.findById(evaluationAgency.getUserId());
|
|
|
|
+ String userCompetence = userPO.get().getPersonalCompetence();
|
|
|
|
+ //将 userConpetence按逗号分搁
|
|
|
|
+ String compentence[] = userCompetence.split(",");//JKCS,JRXCE,KKXCS,WDXCS
|
|
|
|
+ for (int i = 0; i < compentence.length; i++) {
|
|
|
|
+ //查询对应code的测试类型的名称比如接口测试,兼用型测试等。
|
|
|
|
+ Optional<TestTypePO> testTypePO = testTypeDao.findByCode(compentence[i]);
|
|
|
|
+ agencyAbilities.add(testTypePO.get().getName());
|
|
|
|
+ }
|
|
EvaluationAgencyVO agencyVO = new EvaluationAgencyVO(evaluationAgency);
|
|
EvaluationAgencyVO agencyVO = new EvaluationAgencyVO(evaluationAgency);
|
|
|
|
+ agencyVO.setAuthStatus(evaluationAgency.getIsAuthentication());
|
|
List<RankCountInfo> rankCountInfoList = taskToUserDao.findTotalCountOfUser();
|
|
List<RankCountInfo> rankCountInfoList = taskToUserDao.findTotalCountOfUser();
|
|
long ids[] = new long[rankCountInfoList.size()];
|
|
long ids[] = new long[rankCountInfoList.size()];
|
|
for (int i = 0; i < ids.length; i++) {
|
|
for (int i = 0; i < ids.length; i++) {
|
|
@@ -83,6 +98,7 @@ public class AgencyServiceImpl implements AgencyService {
|
|
agencyVO.setTaskCount(rankCountInfoList.get(i).getCount());
|
|
agencyVO.setTaskCount(rankCountInfoList.get(i).getCount());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ agencyVO.setAgencyAbilities(agencyAbilities);
|
|
return agencyVO;
|
|
return agencyVO;
|
|
}
|
|
}
|
|
|
|
|