|
@@ -422,7 +422,7 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
List<EvaluationAgencyVO> agencyRanks = userTaskCountDao.findByType(RoleType.AGENCY.getId())
|
|
|
.stream().sorted(Comparator.comparing(UserTaskCountPO::getCount).reversed()).limit(top).collect(Collectors.toList())
|
|
|
.stream().map(userTaskCountPO -> {
|
|
|
- EvaluationAgencyPO agency = agencyDao.findByUserId(userTaskCountPO.getUserId());
|
|
|
+ EvaluationAgencyPO agency = agencyDao.findByUserIdAndIsDeleted(userTaskCountPO.getUserId(), DeletedStatus.isNotDeleted);
|
|
|
EvaluationAgencyVO agencyVO = new EvaluationAgencyVO();
|
|
|
agencyVO.setAgencyPhoto(agency.getAgencyPhoto());
|
|
|
agencyVO.setTaskCount(userTaskCountPO.getCount());
|
|
@@ -545,7 +545,7 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
}).filter(Objects::nonNull).collect(Collectors.toList());
|
|
|
//获取机构排名
|
|
|
List<EvaluationAgencyVO> agencyRanks = taskToUserDao.findTotalPriceOfAgency(pageable).stream().map(rankInfo -> {
|
|
|
- EvaluationAgencyPO agency = agencyDao.findByUserId(rankInfo.getEntityId());
|
|
|
+ EvaluationAgencyPO agency = agencyDao.findByUserIdAndIsDeleted(rankInfo.getEntityId(), DeletedStatus.isNotDeleted);
|
|
|
if (agency != null) {
|
|
|
EvaluationAgencyVO agencyVO = new EvaluationAgencyVO();
|
|
|
agencyVO.setEvaluationAgencyName(agency.getEvaluationAgencyName());
|
|
@@ -822,7 +822,7 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
|
|
|
CrowdTaskVO crowdTaskVO = new CrowdTaskVO(crowdTestTask);
|
|
|
if (crowdTestTask.getDistributionType() == 0) {
|
|
|
- EvaluationAgencyPO agencyPO = agencyDao.findByUserId(crowdTestTask.getEvaluationAgencyId());
|
|
|
+ EvaluationAgencyPO agencyPO = agencyDao.findByUserIdAndIsDeleted(crowdTestTask.getEvaluationAgencyId(), DeletedStatus.isNotDeleted);
|
|
|
crowdTaskVO.setInstitution(agencyPO == null ? "该机构已注销" : agencyPO.getEvaluationAgencyName());
|
|
|
}
|
|
|
// 测试类型的转换
|
|
@@ -1068,11 +1068,33 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
|
|
|
@Override
|
|
|
public List<RegionalManagerVO> renderRegionManagerList() {
|
|
|
+// List<RegionalManagerVO> regionalManagerVOList = new ArrayList<>();
|
|
|
+// regionalManagerToRegionalDao.findAll().forEach(regionalManagerPO -> {
|
|
|
+// RegionalManagerVO regionalManagerVO = new RegionalManagerVO();
|
|
|
+// regionalManagerVO.setId(regionalManagerPO.getUserId());
|
|
|
+// regionalManagerVO.setName(agencyDao.findByUserId(regionalManagerPO.getUserId()).getEvaluationAgencyName());
|
|
|
+// regionalManagerVOList.add(regionalManagerVO);
|
|
|
+// });
|
|
|
+// List<RegionalManagerVO> results = regionalManagerVOList.stream().distinct().collect(Collectors.toList());
|
|
|
+
|
|
|
List<RegionalManagerVO> regionalManagerVOList = new ArrayList<>();
|
|
|
- regionalManagerToRegionalDao.findAll().forEach(regionalManagerPO -> {
|
|
|
+ List<UserToRolePO> userToRolePOS = userToRoleDao.findByRoleId(RoleType.REGIONAL_MANAGER.getId());
|
|
|
+ userToRolePOS.forEach(userToRolePO -> {
|
|
|
RegionalManagerVO regionalManagerVO = new RegionalManagerVO();
|
|
|
- regionalManagerVO.setId(regionalManagerPO.getUserId());
|
|
|
- regionalManagerVO.setName(agencyDao.findByUserId(regionalManagerPO.getUserId()).getEvaluationAgencyName());
|
|
|
+ Long userId = userToRolePO.getUserId();
|
|
|
+ regionalManagerVO.setId(userId);
|
|
|
+ String name = null;
|
|
|
+ EvaluationAgencyPO evaluationAgencyPO = agencyDao.findByUserIdAndIsDeleted(userId, DeletedStatus.isNotDeleted);
|
|
|
+ if (evaluationAgencyPO == null){
|
|
|
+ Optional<UserPO> userPOOptional = userDao.findById(userId);
|
|
|
+ if(userPOOptional.isPresent()){
|
|
|
+ name = userPOOptional.get().getName();
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ name = evaluationAgencyPO.getEvaluationAgencyName();
|
|
|
+ }
|
|
|
+
|
|
|
+ regionalManagerVO.setName(name);
|
|
|
regionalManagerVOList.add(regionalManagerVO);
|
|
|
});
|
|
|
List<RegionalManagerVO> results = regionalManagerVOList.stream().distinct().collect(Collectors.toList());
|
|
@@ -1082,7 +1104,7 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
@Override
|
|
|
public List<EvaluationAgencyVO> renderAgencyList() {
|
|
|
List<EvaluationAgencyVO> agencyList = new ArrayList<>();
|
|
|
- agencyDao.findAll().forEach(evaluationAgencyPO -> {
|
|
|
+ agencyDao.findByIsDeleted(DeletedStatus.isNotDeleted).forEach(evaluationAgencyPO -> {
|
|
|
EvaluationAgencyVO agencyVO = new EvaluationAgencyVO();
|
|
|
agencyVO.setId(evaluationAgencyPO.getUserId());
|
|
|
agencyVO.setEvaluationAgencyName(evaluationAgencyPO.getEvaluationAgencyName());
|
|
@@ -1470,10 +1492,12 @@ public class WebMediatorImpl implements ViewMediator {
|
|
|
throw new HttpBadRequestException("银行卡已存在");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
bankCardPO.setUser(bankCardVO.getUser());
|
|
|
bankCardPO.setNumber(bankCardVO.getNumber());
|
|
|
bankCardPO.setCode(bank);
|
|
|
bankCardPO.setUserId(userId);
|
|
|
+ bankCardPO.setSubName(bankCardVO.getSubName());
|
|
|
bankCardDao.save(bankCardPO);
|
|
|
return this.getBankCard(userId);
|
|
|
}
|