|
@@ -58,6 +58,9 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
private CrowdTestTaskDao taskDao;
|
|
|
|
|
|
@Autowired
|
|
|
+ private UserTaskCountDao userTaskCountDao;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
private UserDao userDao;
|
|
|
|
|
|
@Autowired
|
|
@@ -114,17 +117,27 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
@Override
|
|
|
public List<UserVO> renderMoreUser(Pageable pageable) {
|
|
|
//获取众测人员排名
|
|
|
- String agencyName = agencyDao.findById(Long.parseLong(agencyId)).get().getEvaluationAgencyName();
|
|
|
- List<UserVO> userVOS = taskToUserDao.findTotalCountOfUser().stream().map(rankInfo -> {
|
|
|
- EvaluationAgencyPO agency = agencyDao.findByUserId(rankInfo.getEntityId());
|
|
|
- if (agency != null && agency.getEvaluationAgencyName().equals(agencyName)) {
|
|
|
- User user = userRepo.getByID(agency.getUserId());
|
|
|
- UserVO userVO = new UserVO(user);
|
|
|
- userVO.setTaskCount(rankInfo.getCount());
|
|
|
- return userVO;
|
|
|
- }
|
|
|
- return null;
|
|
|
- }).filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
+// String agencyName = agencyDao.findById(Long.parseLong(agencyId)).get().getEvaluationAgencyName();
|
|
|
+// List<UserVO> userVOS = taskToUserDao.findTotalCountOfUser().stream().map(rankInfo -> {
|
|
|
+// EvaluationAgencyPO agency = agencyDao.findByUserId(rankInfo.getEntityId());
|
|
|
+// if (agency != null && agency.getEvaluationAgencyName().equals(agencyName)) {
|
|
|
+// User user = userRepo.getByID(agency.getUserId());
|
|
|
+// UserVO userVO = new UserVO(user);
|
|
|
+// userVO.setTaskCount(rankInfo.getCount());
|
|
|
+// return userVO;
|
|
|
+// }
|
|
|
+// return null;
|
|
|
+// }).filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
+
|
|
|
+
|
|
|
+ List<UserVO> userVOS = userTaskCountDao.findByType(RoleType.EVALUATION_USER.getId())
|
|
|
+ .stream().sorted(Comparator.comparing(UserTaskCountPO::getCount)).collect(Collectors.toList())
|
|
|
+ .stream().map(userTaskCountPO -> {
|
|
|
+ User user = userRepo.getByIDJustInfo(userTaskCountPO.getUserId());
|
|
|
+ UserVO userVO = new UserVO(user);
|
|
|
+ userVO.setTaskCount(userTaskCountPO.getCount());
|
|
|
+ return userVO;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
return userVOS;
|
|
|
}
|
|
|
|
|
@@ -190,70 +203,9 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public IndexInfoDTO renderIndexInfos() {
|
|
|
+ public IndexInfoDTO renderIndexInfosCache() {
|
|
|
IndexInfoDTO indexInfoDTO = new IndexInfoDTO();
|
|
|
- Pageable pageable = PageRequest.of(0, 3);
|
|
|
int top = 3;
|
|
|
- //获取热门众测
|
|
|
- List<ApplicationTypeVO> applicationTypeRank = projectDao.findTotalCountOfApplicationType(pageable).stream().map(rankInfos -> {
|
|
|
- ApplicationType applicationType = commonRepo.getApplicationTypeByAppCode(rankInfos.getCode());
|
|
|
- ApplicationTypeVO applicationTypeVO = new ApplicationTypeVO(applicationType);
|
|
|
- applicationTypeVO.setCount(rankInfos.getCount());
|
|
|
- return applicationTypeVO;
|
|
|
- }).filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
- List<ApplicationTypeVO> applicationTypeRanks = new ArrayList<>();
|
|
|
- if (applicationTypeRanks.size() > top) {
|
|
|
- for (int i = 0; i < top; i++) {
|
|
|
- applicationTypeRanks.add(applicationTypeRank.get(i));
|
|
|
- }
|
|
|
- } else {
|
|
|
- applicationTypeRanks = applicationTypeRank;
|
|
|
- }
|
|
|
-
|
|
|
- //获取机构排名
|
|
|
- String agencyName = agencyDao.findById(Long.parseLong(agencyId)).get().getEvaluationAgencyName();
|
|
|
- List<EvaluationAgencyVO> agencyRank = taskToUserDao.findTotalCountOfUser().stream().map(rankInfo -> {
|
|
|
- EvaluationAgencyPO agency = agencyDao.findByUserId(rankInfo.getEntityId());
|
|
|
- if (agency != null && !agency.getEvaluationAgencyName().equals(agencyName)) {
|
|
|
- EvaluationAgencyVO agencyVO = new EvaluationAgencyVO();
|
|
|
- agencyVO.setEvaluationAgencyName(agency.getEvaluationAgencyName());
|
|
|
- agencyVO.setAgencyPhoto(agency.getAgencyPhoto());
|
|
|
- agencyVO.setTaskCount(rankInfo.getCount());
|
|
|
- agencyVO.setId(agency.getId());
|
|
|
- agencyVO.setUserId(agency.getUserId());
|
|
|
- return agencyVO;
|
|
|
- }
|
|
|
- return null;
|
|
|
- }).filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
- List<EvaluationAgencyVO> agencyRanks = new ArrayList<>();
|
|
|
- if (agencyRank.size() > top) {
|
|
|
- for (int i = 0; i < top; i++) {
|
|
|
- agencyRanks.add(agencyRank.get(i));
|
|
|
- }
|
|
|
- } else {
|
|
|
- agencyRanks = agencyRank;
|
|
|
- }
|
|
|
-
|
|
|
- //获取众测人员排名
|
|
|
- List<UserVO> userRank = taskToUserDao.findTotalCountOfUser().stream().map(rankInfo -> {
|
|
|
- EvaluationAgencyPO agency = agencyDao.findByUserId(rankInfo.getEntityId());
|
|
|
- if (agency != null && agency.getEvaluationAgencyName().equals(agencyName)) {
|
|
|
- User user = userRepo.getByID(agency.getUserId());
|
|
|
- UserVO userVO = new UserVO(user);
|
|
|
- userVO.setTaskCount(rankInfo.getCount());
|
|
|
- return userVO;
|
|
|
- }
|
|
|
- return null;
|
|
|
- }).filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
- List<UserVO> userRanks = new ArrayList<>();
|
|
|
- if (userRank.size() > top) {
|
|
|
- for (int i = 0; i < top; i++) {
|
|
|
- userRanks.add(userRank.get(i));
|
|
|
- }
|
|
|
- } else {
|
|
|
- userRanks = userRank;
|
|
|
- }
|
|
|
-
|
|
|
// 获取大赛信息
|
|
|
List<Competition> competitionList = commonRepo.getAllCompetition();
|
|
|
List<Competition> competitionLists = new ArrayList<>();
|
|
@@ -278,17 +230,18 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
// 获取应用类型
|
|
|
- List<ApplicationType> allApplicationType = commonRepo.getAllApplicationType();
|
|
|
- List<ApplicationTypeVO> applicationTypeVOS = allApplicationType.stream().map(applicationType -> {
|
|
|
- ApplicationTypeVO applicationTypeVO = new ApplicationTypeVO(applicationType);
|
|
|
- List<TestType> testTypeList = commonRepo.getTestTypeListByAppCode(applicationType.getCode());
|
|
|
- List<TestTypeVO> typeVOS = testTypeList.stream().map(testType -> {
|
|
|
- TestTypeVO testTypeVO = new TestTypeVO(testType);
|
|
|
- return testTypeVO;
|
|
|
- }).collect(Collectors.toList());
|
|
|
- applicationTypeVO.setTestTypeList(typeVOS);
|
|
|
- return applicationTypeVO;
|
|
|
- }).collect(Collectors.toList());
|
|
|
+ List<ApplicationTypeVO> applicationTypeVOS = commonRepo.getAllApplicationType().stream().map(ApplicationTypeVO::new).collect(Collectors.toList());
|
|
|
+// List<ApplicationType> allApplicationType = commonRepo.getAllApplicationType();
|
|
|
+// List<ApplicationTypeVO> applicationTypeVOS = allApplicationType.stream().map(applicationType -> {
|
|
|
+// ApplicationTypeVO applicationTypeVO = new ApplicationTypeVO(applicationType);
|
|
|
+// List<TestType> testTypeList = commonRepo.getTestTypeListByAppCode(applicationType.getCode());
|
|
|
+// List<TestTypeVO> typeVOS = testTypeList.stream().map(testType -> {
|
|
|
+// TestTypeVO testTypeVO = new TestTypeVO(testType);
|
|
|
+// return testTypeVO;
|
|
|
+// }).collect(Collectors.toList());
|
|
|
+// applicationTypeVO.setTestTypeList(typeVOS);
|
|
|
+// return applicationTypeVO;
|
|
|
+// }).collect(Collectors.toList());
|
|
|
|
|
|
// 获取领域划分
|
|
|
List<Field> fieldList = commonRepo.getAllFieldType();
|
|
@@ -297,21 +250,7 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
return fieldVO;
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
- // 获取资源和工具
|
|
|
- List<Resource> resourceList = commonRepo.getAllResource();
|
|
|
- List<ResourceVO> resourceVOS = resourceList.stream().map(resource -> {
|
|
|
- ResourceVO resourceVO = new ResourceVO(resource);
|
|
|
- return resourceVO;
|
|
|
- }).collect(Collectors.toList());
|
|
|
-
|
|
|
// 获取入驻品牌机构
|
|
|
- List<Partner> partnerList = commonRepo.getAllPartner();
|
|
|
- List<PartnerVO> partnerVOS = partnerList.stream().map(partner -> {
|
|
|
- PartnerVO partnerVO = new PartnerVO(partner);
|
|
|
- return partnerVO;
|
|
|
- }).collect(Collectors.toList());
|
|
|
-
|
|
|
- // 获取合作机构
|
|
|
List<ResidentAgency> allResidentAgency = commonRepo.getAllResidentAgency();
|
|
|
List<EvaluationAgencyVO> agencyVOS = allResidentAgency.stream().map(residentAgency -> {
|
|
|
EvaluationAgency agency = evaluationAgencyRepo.findAgencyById(residentAgency.getAgencyId());
|
|
@@ -319,16 +258,123 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
return evalutionAgencyVO;
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
- indexInfoDTO.setApplicationTypeRank(applicationTypeRanks);
|
|
|
- indexInfoDTO.setAgencyRank(agencyRanks);
|
|
|
- indexInfoDTO.setUserRank(userRanks);
|
|
|
+ // 获取合作机构
|
|
|
+// List<Partner> partnerList = commonRepo.getAllPartner();
|
|
|
+// List<PartnerVO> partnerVOS = partnerList.stream().map(partner -> {
|
|
|
+// PartnerVO partnerVO = new PartnerVO(partner);
|
|
|
+// return partnerVO;
|
|
|
+// }).collect(Collectors.toList());
|
|
|
+
|
|
|
indexInfoDTO.setTestTypeList(testTypeVOS);
|
|
|
indexInfoDTO.setApplicationTypeList(applicationTypeVOS);
|
|
|
indexInfoDTO.setFieldList(fieldVOS);
|
|
|
indexInfoDTO.setCompetitionList(competitionVOS);
|
|
|
- indexInfoDTO.setResourceList(resourceVOS);
|
|
|
indexInfoDTO.setResidentAgencyList(agencyVOS);
|
|
|
- indexInfoDTO.setPartnerList(partnerVOS);
|
|
|
+// indexInfoDTO.setPartnerList(partnerVOS);
|
|
|
+ return indexInfoDTO;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public IndexInfoDTO renderIndexInfos() {
|
|
|
+ IndexInfoDTO indexInfoDTO = new IndexInfoDTO();
|
|
|
+ Pageable pageable = PageRequest.of(0, 3);
|
|
|
+ int top = 3;
|
|
|
+ //获取热门众测
|
|
|
+ List<ApplicationTypeVO> applicationTypeRank = projectDao.findTotalCountOfApplicationType(pageable).stream().map(rankInfos -> {
|
|
|
+ ApplicationType applicationType = commonRepo.getApplicationTypeByAppCode(rankInfos.getCode());
|
|
|
+ ApplicationTypeVO applicationTypeVO = new ApplicationTypeVO(applicationType);
|
|
|
+ applicationTypeVO.setCount(rankInfos.getCount());
|
|
|
+ return applicationTypeVO;
|
|
|
+ }).filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
+ List<ApplicationTypeVO> applicationTypeRanks = new ArrayList<>();
|
|
|
+ if (applicationTypeRanks.size() > top) {
|
|
|
+ for (int i = 0; i < top; i++) {
|
|
|
+ applicationTypeRanks.add(applicationTypeRank.get(i));
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ applicationTypeRanks = applicationTypeRank;
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取机构排名
|
|
|
+// String agencyName = agencyDao.findById(Long.parseLong(agencyId)).get().getEvaluationAgencyName();
|
|
|
+// List<EvaluationAgencyVO> agencyRank = taskToUserDao.findTotalCountOfUser().stream().map(rankInfo -> {
|
|
|
+// EvaluationAgencyPO agency = agencyDao.findByUserId(rankInfo.getEntityId());
|
|
|
+// if (agency != null && !agency.getEvaluationAgencyName().equals(agencyName)) {
|
|
|
+// EvaluationAgencyVO agencyVO = new EvaluationAgencyVO();
|
|
|
+// agencyVO.setEvaluationAgencyName(agency.getEvaluationAgencyName());
|
|
|
+// agencyVO.setAgencyPhoto(agency.getAgencyPhoto());
|
|
|
+// agencyVO.setTaskCount(rankInfo.getCount());
|
|
|
+// agencyVO.setId(agency.getId());
|
|
|
+// agencyVO.setUserId(agency.getUserId());
|
|
|
+// return agencyVO;
|
|
|
+// }
|
|
|
+// return null;
|
|
|
+// }).filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
+
|
|
|
+ List<EvaluationAgencyVO> agencyRanks = userTaskCountDao.findByType(RoleType.AGENCY.getId())
|
|
|
+ .stream().sorted(Comparator.comparing(UserTaskCountPO::getCount)).limit(top).collect(Collectors.toList())
|
|
|
+ .stream().map(userTaskCountPO -> {
|
|
|
+ EvaluationAgencyPO agency = agencyDao.findByUserId(userTaskCountPO.getUserId());
|
|
|
+ EvaluationAgencyVO agencyVO = new EvaluationAgencyVO();
|
|
|
+ agencyVO.setAgencyPhoto(agency.getAgencyPhoto());
|
|
|
+ agencyVO.setTaskCount(userTaskCountPO.getCount());
|
|
|
+ agencyVO.setId(agency.getId());
|
|
|
+ agencyVO.setUserId(agency.getUserId());
|
|
|
+ agencyVO.setEvaluationAgencyName(agency.getEvaluationAgencyName());
|
|
|
+ return agencyVO;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+
|
|
|
+// List<EvaluationAgencyVO> agencyRanks = new ArrayList<>();
|
|
|
+// if (agencyRank.size() > top) {
|
|
|
+// for (int i = 0; i < top; i++) {
|
|
|
+// agencyRanks.add(agencyRank.get(i));
|
|
|
+// }
|
|
|
+// } else {
|
|
|
+// agencyRanks = agencyRank;
|
|
|
+// }
|
|
|
+
|
|
|
+ //获取众测人员排名
|
|
|
+// List<UserVO> userRank = taskToUserDao.findTotalCountOfUser().stream().map(rankInfo -> {
|
|
|
+// EvaluationAgencyPO agency = agencyDao.findByUserId(rankInfo.getEntityId());
|
|
|
+// if (agency != null && agency.getEvaluationAgencyName().equals(agencyName)) {
|
|
|
+// User user = userRepo.getByID(agency.getUserId());
|
|
|
+// UserVO userVO = new UserVO(user);
|
|
|
+// userVO.setTaskCount(rankInfo.getCount());
|
|
|
+// return userVO;
|
|
|
+// }
|
|
|
+// return null;
|
|
|
+// }).filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
+
|
|
|
+ List<UserVO> userRanks = userTaskCountDao.findByType(RoleType.EVALUATION_USER.getId())
|
|
|
+ .stream().sorted(Comparator.comparing(UserTaskCountPO::getCount)).limit(top).collect(Collectors.toList())
|
|
|
+ .stream().map(userTaskCountPO -> {
|
|
|
+ User user = userRepo.getByIDJustInfo(userTaskCountPO.getUserId());
|
|
|
+ UserVO userVO = new UserVO(user);
|
|
|
+ userVO.setTaskCount(userTaskCountPO.getCount());
|
|
|
+ return userVO;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+
|
|
|
+// List<UserVO> userRanks = new ArrayList<>();
|
|
|
+// if (userRank.size() > top) {
|
|
|
+// for (int i = 0; i < top; i++) {
|
|
|
+// userRanks.add(userRank.get(i));
|
|
|
+// }
|
|
|
+// } else {
|
|
|
+// userRanks = userRank;
|
|
|
+// }
|
|
|
+
|
|
|
+ // 获取资源和工具
|
|
|
+ List<Resource> resourceList = commonRepo.getAllResource();
|
|
|
+ List<ResourceVO> resourceVOS = resourceList.stream().map(resource -> {
|
|
|
+ ResourceVO resourceVO = new ResourceVO(resource);
|
|
|
+ return resourceVO;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+
|
|
|
+ indexInfoDTO.setApplicationTypeRank(applicationTypeRanks);
|
|
|
+ indexInfoDTO.setAgencyRank(agencyRanks);
|
|
|
+ indexInfoDTO.setUserRank(userRanks);
|
|
|
+ indexInfoDTO.setResourceList(resourceVOS);
|
|
|
+
|
|
|
return indexInfoDTO;
|
|
|
}
|
|
|
|
|
@@ -921,6 +967,13 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
authingList.addAll(projectDao.findAll().stream().map(crowdTestProjectPO -> {
|
|
|
CrowdTestProject crowdTestProject = new CrowdTestProject();
|
|
|
BeanUtils.copyProperties(crowdTestProjectPO, crowdTestProject);
|
|
|
+ // 应用类型值的转换
|
|
|
+ Optional<ApplicationTypePO> applicationTypePO = applicationTypeDao.findByCode(crowdTestProject.getApplicationType());
|
|
|
+ if (applicationTypePO.isPresent()) {
|
|
|
+ crowdTestProject.setApplicationType(applicationTypePO.get().getName());
|
|
|
+ } else {
|
|
|
+ throw new HttpBadRequestException("请选择应用类型");
|
|
|
+ }
|
|
|
return new CrowdTestProjectVO(crowdTestProject);
|
|
|
|
|
|
}).collect(Collectors.toList()));
|
|
@@ -1003,6 +1056,12 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
@Override
|
|
|
public QualificationDTO addQualification(long userId, QualificationVO qualificationVO) {
|
|
|
QualificationPO qualificationPO = new QualificationPO();
|
|
|
+ List<QualificationPO> qualificationPOList=qualificationDao.findByUserIdAndIsDeleted(userId, DeletedStatus.isNotDeleted);
|
|
|
+ for(int i=0;i<qualificationPOList.size();i++){
|
|
|
+ if(qualificationVO.getName().equals(qualificationPOList.get(i).getName())){
|
|
|
+ throw new HttpBadRequestException("资质已存在");
|
|
|
+ }
|
|
|
+ }
|
|
|
qualificationPO.setName(qualificationVO.getName());
|
|
|
qualificationPO.setNumber(qualificationVO.getNumber());
|
|
|
qualificationPO.setLicensingAuthority(qualificationVO.getLicensingAuthority());
|
|
@@ -1041,7 +1100,18 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
BankCardVO bankCardVO = new BankCardVO();
|
|
|
bankCardVO.setId(bankCardPO.getId());
|
|
|
bankCardVO.setUser(bankCardPO.getUser());
|
|
|
- bankCardVO.setNumber(bankCardPO.getNumber());
|
|
|
+ int length=bankCardPO.getNumber().length();
|
|
|
+ int afterLength = 4;
|
|
|
+ String replaceSymbol = "*";
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
+ for (int i = 0; i < length; i++) {
|
|
|
+ if (i >= (length - afterLength)) {
|
|
|
+ sb.append(bankCardPO.getNumber().charAt(i));
|
|
|
+ } else {
|
|
|
+ sb.append(replaceSymbol);
|
|
|
+ }
|
|
|
+ bankCardVO.setNumber(sb.toString());
|
|
|
+ }
|
|
|
Optional<BankLogoPO> bankLogo = bankLogoDao.findByCode(bankCardPO.getCode());
|
|
|
bankCardVO.setLogoUrl(bankLogo.get().getLogoUrl());
|
|
|
bankCardVO.setName(bankLogo.get().getName());
|
|
@@ -1065,6 +1135,16 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
throw new HttpBadRequestException("请输入正确的卡号");
|
|
|
}
|
|
|
String bank = String.valueOf(json.get("bank"));
|
|
|
+ Optional<BankLogoPO> bankLogoPO=bankLogoDao.findByName(bankCardVO.getName());
|
|
|
+ if(!bank.equals(bankLogoPO.get().getName())){
|
|
|
+ throw new HttpBadRequestException("请输入与选定银行一致的账号");
|
|
|
+ }
|
|
|
+ List<BankCardPO> bankCardPOList=bankCardDao.findByUserIdAndIsDeleted(userId, DeletedStatus.isNotDeleted);
|
|
|
+ for(int i=0;i<bankCardPOList.size();i++){
|
|
|
+ if(bankCardVO.getNumber().equals(bankCardPOList.get(i).getNumber())){
|
|
|
+ throw new HttpBadRequestException("银行卡已存在");
|
|
|
+ }
|
|
|
+ }
|
|
|
bankCardPO.setUser(bankCardVO.getUser());
|
|
|
bankCardPO.setNumber(bankCardVO.getNumber());
|
|
|
bankCardPO.setCode(bank);
|
|
@@ -1130,7 +1210,15 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
resourceVO.setUnitWork(resourcePO.get().getUnitWork());
|
|
|
resourceVO.setStandard(resourcePO.get().getStandard());
|
|
|
resourceVO.setUnit(resourcePO.get().getUnit());
|
|
|
- resourceVO.setState(resourcePO.get().getState());
|
|
|
+ if(resourcePO.get().getState()==0){
|
|
|
+ resourceVO.setState(ResourceStatus.R_FREE);
|
|
|
+ }else if(resourcePO.get().getState()==1){
|
|
|
+ resourceVO.setState(ResourceStatus.R_OCCUPY);
|
|
|
+ }else if(resourcePO.get().getState()==2){
|
|
|
+ resourceVO.setState(ResourceStatus.R_USABLE);
|
|
|
+ }else {
|
|
|
+ resourceVO.setState(ResourceStatus.R_FAULT);
|
|
|
+ }
|
|
|
resourceVO.setStartTime(resourcePO.get().getStartTime());
|
|
|
resourceVO.setPersonnel(resourcePO.get().getPersonnel());
|
|
|
resourceVO.setRemarks(resourcePO.get().getRemarks());
|
|
@@ -1163,6 +1251,38 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
return results;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public QualificationDTO getOne(long id) {
|
|
|
+ QualificationDTO qualificationDTO = new QualificationDTO();
|
|
|
+ Optional<QualificationPO> qualificationPO = qualificationDao.findById(id);
|
|
|
+ QualificationVO qualificationVO = new QualificationVO();
|
|
|
+ qualificationVO.setId(qualificationPO.get().getId());
|
|
|
+ qualificationVO.setName(qualificationPO.get().getName());
|
|
|
+ qualificationVO.setNumber(qualificationPO.get().getNumber());
|
|
|
+ qualificationVO.setLicensingAuthority(qualificationPO.get().getLicensingAuthority());
|
|
|
+ qualificationVO.setTime(qualificationPO.get().getTime());
|
|
|
+ qualificationVO.setIsPublic(qualificationPO.get().getIsPublic());
|
|
|
+ qualificationDTO.setQualificationVO(qualificationVO);
|
|
|
+ return qualificationDTO;
|
|
|
+}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public BankCardDTO getBankType() {
|
|
|
+ BankCardDTO bankCardDTO = new BankCardDTO();
|
|
|
+ List<BankLogoVO> bankLogoVOList = new ArrayList<>();
|
|
|
+ bankLogoDao.findAll().forEach(bankLogoPO -> {
|
|
|
+ BankLogoVO bankLogoVO = new BankLogoVO();
|
|
|
+ bankLogoVO.setId(bankLogoPO.getId());
|
|
|
+ bankLogoVO.setName(bankLogoPO.getName());
|
|
|
+ bankLogoVO.setLogoUrl(bankLogoPO.getLogoUrl());
|
|
|
+ bankLogoVO.setCode(bankLogoPO.getCode());
|
|
|
+ bankLogoVOList.add(bankLogoVO);
|
|
|
+ });
|
|
|
+ List<BankLogoVO> results = bankLogoVOList.stream().distinct().collect(Collectors.toList());
|
|
|
+ bankCardDTO.setBankLogoVOList(results);
|
|
|
+ return bankCardDTO;
|
|
|
+ }
|
|
|
+
|
|
|
private ProjectOperationControl initProjectPermission(CrowdTestProject project, User user) {
|
|
|
ProjectOperationControl operationControl = new ProjectOperationControl();
|
|
|
if (user == null)
|