|
@@ -18,22 +18,17 @@ import com.mooctest.crowd.site.data.dto.*;
|
|
|
import com.mooctest.crowd.site.data.enums.RoleType;
|
|
|
import com.mooctest.crowd.site.data.vo.*;
|
|
|
import com.mooctest.crowd.site.mediator.ViewMediator;
|
|
|
-import com.mooctest.crowd.site.util.DataUtils;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
import org.codehaus.jettison.json.JSONException;
|
|
|
import org.codehaus.jettison.json.JSONObject;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
-import org.springframework.cache.annotation.Cacheable;
|
|
|
-import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
-import org.springframework.data.jpa.domain.Specification;
|
|
|
-import org.springframework.data.jpa.domain.Specifications;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.web.client.RestTemplate;
|
|
|
+
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -494,6 +489,12 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
List<CrowdTaskVO> taskVOList = taskDao.findAllByIsDeleted(0).stream().map(crowdTestTaskPO -> {
|
|
|
CrowdTestTask task = CrowdTestProjectFactory.defaultTask();
|
|
|
BeanUtils.copyProperties(crowdTestTaskPO, task);
|
|
|
+ // 测试类型的转换
|
|
|
+ Optional<TestTypePO> testTypePO = testTypeDao.findByCode(task.getType());
|
|
|
+ if (!testTypePO.isPresent()) {
|
|
|
+ throw new HttpBadRequestException("不存在此测试类型");
|
|
|
+ }
|
|
|
+ task.setType(testTypePO.get().getName());
|
|
|
return task;
|
|
|
}).collect(Collectors.toList()).stream().filter(crowdTestTask -> crowdTestTask.getStatus() == CrowdTestTaskStatus.HAS_RELEASED ||
|
|
|
(crowdTestTask.getStatus() == CrowdTestTaskStatus.HAS_RECEIVED && crowdTestTask.getFullStatus() == CrowdTestTaskAcceptStatus.NOT_FULL))
|
|
@@ -528,6 +529,10 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
EvaluationAgencyPO agencyPO = agencyDao.findByUserId(crowdTestTask.getEvaluationAgencyId());
|
|
|
crowdTaskVO.setInstitution(agencyPO == null ? "该机构已注销" : agencyPO.getEvaluationAgencyName());
|
|
|
}
|
|
|
+
|
|
|
+ // 测试类型的转换
|
|
|
+ Optional<TestTypePO> testTypePO = testTypeDao.findByCode(crowdTaskVO.getServiceType());
|
|
|
+ crowdTaskVO.setServiceType(testTypePO.get().getName());
|
|
|
taskVOList.add(crowdTaskVO);
|
|
|
}
|
|
|
|
|
@@ -654,6 +659,13 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
}
|
|
|
|
|
|
CrowdTaskVO taskVO = new CrowdTaskVO(task.get());
|
|
|
+ // 测试类型的转换
|
|
|
+ Optional<TestTypePO> testTypePO = testTypeDao.findByCode(taskVO.getServiceType());
|
|
|
+ if (!testTypePO.isPresent()) {
|
|
|
+ throw new HttpBadRequestException("不存在此测试类型");
|
|
|
+ }
|
|
|
+ taskVO.setServiceType(testTypePO.get().getName());
|
|
|
+
|
|
|
System.out.println("renderTaskDetails userId:" + userId);
|
|
|
if (userId == null) {
|
|
|
taskDetailsDTO.setTaskOperationControl(this.initTaskPermission(project, task.get(), null));
|