|
@@ -105,6 +105,12 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
private ApplicationTypeDao applicationTypeDao;
|
|
|
|
|
|
@Autowired
|
|
|
+ private ResourceDao resourceDao;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private ResourceTypeDao resourceTypeDao;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private FieldDao fieldDao;
|
|
|
|
|
|
@Value("${agency}")
|
|
@@ -217,8 +223,8 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
EvaluationAgencyPO agency = agencyDao.findByUserId(rankInfo.getEntityId());
|
|
|
if (agency != null && !agency.getEvaluationAgencyName().equals(agencyName)) {
|
|
|
EvolutionAgencyVO agencyVO = new EvolutionAgencyVO();
|
|
|
- agencyVO.setName(agency.getEvaluationAgencyName());
|
|
|
- agencyVO.setLogo(agency.getAgencyPhoto());
|
|
|
+ agencyVO.setEvaluationAgencyName(agency.getEvaluationAgencyName());
|
|
|
+ agencyVO.setAgencyPhoto(agency.getAgencyPhoto());
|
|
|
agencyVO.setTaskCount(rankInfo.getCount());
|
|
|
agencyVO.setId(agency.getId());
|
|
|
agencyVO.setUserId(agency.getUserId());
|
|
@@ -354,8 +360,8 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
EvaluationAgencyPO agency = agencyDao.findByUserId(rankInfo.getEntityId());
|
|
|
if (agency != null) {
|
|
|
EvolutionAgencyVO agencyVO = new EvolutionAgencyVO();
|
|
|
- agencyVO.setName(agency.getEvaluationAgencyName());
|
|
|
- agencyVO.setLogo(agency.getAgencyPhoto());
|
|
|
+ agencyVO.setEvaluationAgencyName(agency.getEvaluationAgencyName());
|
|
|
+ agencyVO.setAgencyPhoto(agency.getAgencyPhoto());
|
|
|
agencyVO.setAllTaskPrice(rankInfo.getTotalPrice());
|
|
|
return agencyVO;
|
|
|
}
|
|
@@ -745,10 +751,10 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
agencyDao.findAll().forEach(evaluationAgencyPO -> {
|
|
|
EvolutionAgencyVO agencyVO = new EvolutionAgencyVO();
|
|
|
agencyVO.setId(evaluationAgencyPO.getUserId());
|
|
|
- agencyVO.setName(evaluationAgencyPO.getEvaluationAgencyName());
|
|
|
+ agencyVO.setEvaluationAgencyName(evaluationAgencyPO.getEvaluationAgencyName());
|
|
|
agencyList.add(agencyVO);
|
|
|
});
|
|
|
- return agencyList.stream().filter(agency -> !agency.getName().equals(agencyTemplate.getEvaluationAgencyName())).collect(Collectors.toList());
|
|
|
+ return agencyList.stream().filter(agency -> !agency.getEvaluationAgencyName().equals(agencyTemplate.getEvaluationAgencyName())).collect(Collectors.toList());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -996,6 +1002,80 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
return technicalArticlesDTO;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<ResourceVO> getResource() {
|
|
|
+ List<ResourceVO> resourceVOList = new ArrayList<>();
|
|
|
+ resourceDao.findAll().forEach(resourcePO -> {
|
|
|
+ ResourceVO resourceVO = new ResourceVO();
|
|
|
+ resourceVO.setCode(resourcePO.getCode());
|
|
|
+ resourceVO.setName(resourcePO.getName());
|
|
|
+ Optional<ResourceTypePO> type = resourceTypeDao.findByCode(resourcePO.getType());
|
|
|
+ resourceVO.setType(type.get().getName());
|
|
|
+ resourceVO.setQuantity(resourcePO.getQuantity());
|
|
|
+ resourceVO.setPhotoUrl(resourcePO.getPhotoUrl());
|
|
|
+ resourceVO.setDescription(resourcePO.getDescription());
|
|
|
+ resourceVO.setScene(resourcePO.getScene());
|
|
|
+ resourceVO.setUnitWork(resourcePO.getUnitWork());
|
|
|
+ resourceVO.setStandard(resourcePO.getStandard());
|
|
|
+ resourceVO.setUnit(resourcePO.getUnit());
|
|
|
+ resourceVO.setState(resourcePO.getState());
|
|
|
+ resourceVO.setStartTime(resourcePO.getStartTime());
|
|
|
+ resourceVO.setPersonnel(resourcePO.getPersonnel());
|
|
|
+ resourceVO.setRemarks(resourcePO.getRemarks());
|
|
|
+ resourceVOList.add(resourceVO);
|
|
|
+ });
|
|
|
+ List<ResourceVO> results=resourceVOList.stream().sorted(Comparator.comparing(ResourceVO::getStartTime).reversed()).collect(Collectors.toList());
|
|
|
+ return results;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public ResourceVO getResourceDetailed(String code) {
|
|
|
+ Optional<ResourcePO> resourcePO=resourceDao.findByCode(code);
|
|
|
+ ResourceVO resourceVO = new ResourceVO();
|
|
|
+ resourceVO.setCode(resourcePO.get().getCode());
|
|
|
+ resourceVO.setName(resourcePO.get().getName());
|
|
|
+ Optional<ResourceTypePO> type = resourceTypeDao.findByCode(resourcePO.get().getType());
|
|
|
+ resourceVO.setType(type.get().getName());
|
|
|
+ resourceVO.setQuantity(resourcePO.get().getQuantity());
|
|
|
+ resourceVO.setPhotoUrl(resourcePO.get().getPhotoUrl());
|
|
|
+ resourceVO.setDescription(resourcePO.get().getDescription());
|
|
|
+ resourceVO.setScene(resourcePO.get().getScene());
|
|
|
+ resourceVO.setUnitWork(resourcePO.get().getUnitWork());
|
|
|
+ resourceVO.setStandard(resourcePO.get().getStandard());
|
|
|
+ resourceVO.setUnit(resourcePO.get().getUnit());
|
|
|
+ resourceVO.setState(resourcePO.get().getState());
|
|
|
+ resourceVO.setStartTime(resourcePO.get().getStartTime());
|
|
|
+ resourceVO.setPersonnel(resourcePO.get().getPersonnel());
|
|
|
+ resourceVO.setRemarks(resourcePO.get().getRemarks());
|
|
|
+ return resourceVO;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<ResourceVO> getSearchResource(String name) {
|
|
|
+ List<ResourceVO> resourceVOList = new ArrayList<>();
|
|
|
+ resourceDao.findByNameLike("%" + name + "%").forEach(resourcePO -> {
|
|
|
+ ResourceVO resourceVO = new ResourceVO();
|
|
|
+ resourceVO.setCode(resourcePO.getCode());
|
|
|
+ resourceVO.setName(resourcePO.getName());
|
|
|
+ Optional<ResourceTypePO> type = resourceTypeDao.findByCode(resourcePO.getType());
|
|
|
+ resourceVO.setType(type.get().getName());
|
|
|
+ resourceVO.setQuantity(resourcePO.getQuantity());
|
|
|
+ resourceVO.setPhotoUrl(resourcePO.getPhotoUrl());
|
|
|
+ resourceVO.setDescription(resourcePO.getDescription());
|
|
|
+ resourceVO.setScene(resourcePO.getScene());
|
|
|
+ resourceVO.setUnitWork(resourcePO.getUnitWork());
|
|
|
+ resourceVO.setStandard(resourcePO.getStandard());
|
|
|
+ resourceVO.setUnit(resourcePO.getUnit());
|
|
|
+ resourceVO.setState(resourcePO.getState());
|
|
|
+ resourceVO.setStartTime(resourcePO.getStartTime());
|
|
|
+ resourceVO.setPersonnel(resourcePO.getPersonnel());
|
|
|
+ resourceVO.setRemarks(resourcePO.getRemarks());
|
|
|
+ resourceVOList.add(resourceVO);
|
|
|
+ });
|
|
|
+ List<ResourceVO> results=resourceVOList.stream().sorted(Comparator.comparing(ResourceVO::getStartTime).reversed()).collect(Collectors.toList());
|
|
|
+ return results;
|
|
|
+ }
|
|
|
+
|
|
|
private ProjectOperationControl initProjectPermission(CrowdTestProject project, User user) {
|
|
|
ProjectOperationControl operationControl = new ProjectOperationControl();
|
|
|
if (user == null)
|