| | |
| | | return result; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 安置情况页面数据 |
| | | * @param settlementBO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageInfo<HouseholdVO> listSettleData(SettlementBO settlementBO) { |
| | | PageUtils.startPage(); |
| | | //根据查询条件查询房产数据 |
| | | List<HouseholdVO> householdVOList = settlementMapper.listSettleData(settlementBO); |
| | | if (CollectionUtils.isEmpty(householdVOList)) { |
| | | return new PageInfo<>(); |
| | |
| | | .filter(Objects::nonNull) // 过滤掉 houseStateId 为 null 的情况 |
| | | .distinct() // 去重 |
| | | .collect(Collectors.toList()); |
| | | |
| | | //根据房产id查询所有权利人信息 |
| | | LambdaQueryWrapper<StateHouseholdOwner> householdOwnerLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | householdOwnerLambdaQueryWrapper.in(StateHouseholdOwner::getStateHouseholdId, houseIdList); |
| | | if (!com.zzg.common.utils.StringUtils.isEmpty(settlementBO.getOwnerName())) { |
| | | householdOwnerLambdaQueryWrapper.like(StateHouseholdOwner::getOwnerName, settlementBO.getOwnerName()); |
| | | } |
| | | List<StateHouseholdOwner> stateHouseholdOwners = stateHouseholdOwnerService.list(householdOwnerLambdaQueryWrapper); |
| | | |
| | | //根据房产id 将权利人分组 |
| | | Map<String, List<StateHouseholdOwner>> ownerMap = stateHouseholdOwners.stream().collect(Collectors.groupingBy(StateHouseholdOwner::getStateHouseholdId)); |
| | | if (!com.zzg.common.utils.StringUtils.isEmpty(settlementBO.getOwnerName())) { |
| | | householdVOList = householdVOList.stream().filter(data -> ownerMap.containsKey(data.getId())).collect(Collectors.toList()); |
| | |
| | | stateSettlementLambdaQueryWrapper.in(StateSettlement::getStateHouseholdId, houseIdList); |
| | | stateSettlementLambdaQueryWrapper.eq(StateSettlement::getDelFlag, DeleteFlagEnum.NOT_DELETED.getKey()); |
| | | stateSettlementLambdaQueryWrapper.isNotNull(StateSettlement::getAuditStatus); |
| | | |
| | | //根据条件查询安置情况 |
| | | List<StateSettlement> stateSettlementList = this.list(stateSettlementLambdaQueryWrapper); |
| | | |
| | | Map<String, String> departmentMap = stateSettlementList.stream().collect(Collectors.toMap(StateSettlement::getStateHouseholdId, StateSettlement::getSettleDepartment)); |
| | |
| | | |
| | | //根据入参区分是否安置 |
| | | if (Objects.nonNull(settlementBO.getIsSettled())) { |
| | | //未安置 |
| | | if (Objects.equals(settlementBO.getIsSettled(), SettledProcessEnum.NOT_SETTLE.getValue())) { |
| | | List<String> settledHouseId; |
| | | if (CollectionUtils.isNotEmpty(stateSettlementList)) { |
| | | List<String> settledHouseIdList = stateSettlementList.stream().map(StateSettlement::getStateHouseholdId).collect(Collectors.toList()); |
| | | //过滤未安置的房产id |
| | | settledHouseId = houseIdList.stream().filter(e -> !settledHouseIdList.contains(e)).collect(Collectors.toList()); |
| | | List<String> finalSettledHouseId = settledHouseId; |
| | | voArrayList.addAll(householdVOS.stream().filter(data -> finalSettledHouseId.contains(data.getId())).collect(Collectors.toList())); |
| | | } else { |
| | | voArrayList.addAll(householdVOS); |
| | | } |
| | | |
| | | //已安置 |
| | | } else { |
| | | //已安置房产id列表 |
| | | List<String> settledHouseId = stateSettlementList.stream().map(StateSettlement::getStateHouseholdId).collect(Collectors.toList()); |
| | | //过滤已安置的房产 |
| | | List<HouseholdVO> list = householdVOS.stream().filter(data -> settledHouseId.contains(data.getId())).collect(Collectors.toList()); |
| | | //设置安置时间 安置状态 安置批次 |
| | | Map<String, StateSettlement> settlementMap = stateSettlementList |
| | |
| | | SettlementDetailPageVO pageVO = new SettlementDetailPageVO(); |
| | | |
| | | PageUtils.startPage(); |
| | | //分页查询安置情况 |
| | | List<SettlementDetailVO> settlementDetailVOS = settlementMapper.listSettleDetail(settlementDetailBO); |
| | | if (CollectionUtils.isEmpty(settlementDetailVOS)) { |
| | | pageVO.setPageData(new PageInfo<>()); |
| | |
| | | PageInfo<SettlementDetailVO> settlementDetailVOPageInfo = new PageInfo<>(settlementDetailVOS); |
| | | List<SettlementDetailVO> detailVOS = new ArrayList<>(); |
| | | //拼接名字 |
| | | //根据房产id进行分组 |
| | | Map<String, SettlementDetailVO> householdMap = settlementDetailVOS.stream().filter(Objects::nonNull).collect(Collectors.toMap(StateSettlement::getStateHouseholdId, Function.identity())); |
| | | for (Map.Entry<String, SettlementDetailVO> entry : householdMap.entrySet()) { |
| | | String householdId = entry.getKey(); |
| | |
| | | stateHouseholds.stream().map(StateHousehold::getId).collect(Collectors.toList())); |
| | | stateSettlementLambdaQueryWrapper.isNull(StateSettlement::getAuditStatus); |
| | | stateSettlementLambdaQueryWrapper.orderByDesc(StateSettlement::getCreateTime); |
| | | |
| | | //查询安置情况 |
| | | List<StateSettlement> stateSettlementList = this.list(stateSettlementLambdaQueryWrapper); |
| | | if (CollectionUtils.isNotEmpty(stateSettlementList)) { |
| | | String latestHouseId = stateSettlementList.get(0).getStateHouseholdId(); |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 外层项目实施数据 |
| | | * @param projectId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public SettlementSumVO sumSettleData(String projectId) { |
| | | LambdaQueryWrapper<StateProject> stateProjectQueryWrapper = new LambdaQueryWrapper<>(); |
| | | stateProjectQueryWrapper.eq(StateProject::getId, projectId); |
| | | //查询项目 |
| | | StateProject stateProject = stateProjectMapper.selectOne(stateProjectQueryWrapper); |
| | | if (Objects.isNull(stateProject)) { |
| | | return new SettlementSumVO(); |
| | | } |
| | | |
| | | //查询房产 |
| | | LambdaQueryWrapper<StateHousehold> stateHouseholdQueryWrapper = new LambdaQueryWrapper<>(); |
| | | stateHouseholdQueryWrapper.eq(StateHousehold::getStateProjectId, projectId); |
| | | List<StateHousehold> stateHouseholds = stateHouseholdMapper.selectList(stateHouseholdQueryWrapper); |
| | |
| | | SettlementSumVO settlementSumVO = new SettlementSumVO(); |
| | | //查询房产的协议/安置情况 |
| | | List<String> householdIds = stateHouseholds.stream().map(StateHousehold::getId).distinct().collect(Collectors.toList()); |
| | | |
| | | //查询结算 |
| | | LambdaQueryWrapper<StateSettlement> stateSettlementQueryWrapper = new LambdaQueryWrapper<>(); |
| | | stateSettlementQueryWrapper.in(StateSettlement::getStateHouseholdId, householdIds); |
| | | stateSettlementQueryWrapper.isNotNull(StateSettlement::getAuditStatus); |
| | |
| | | return new PageInfo<>(); |
| | | } |
| | | PageInfo<StateExecutionDetailVO> pageInfo = new PageInfo<>(list); |
| | | |
| | | //返回的结果列表 |
| | | List<StateExecutionDetailVO> result = new ArrayList<>(); |
| | | |
| | | List<StateExecutionDetailVO> executionDetailVOS = list.stream().filter(Objects::nonNull).collect(Collectors.toList()); |
| | |
| | | return new ArrayList<>(); |
| | | } |
| | | List<StateExecutionDetailVO> result = new ArrayList<>(); |
| | | |
| | | //过滤空值 |
| | | List<StateExecutionDetailVO> executionDetailVOS = list.stream().filter(Objects::nonNull).collect(Collectors.toList()); |
| | | |
| | | List<String> houseIdList = executionDetailVOS.stream() |
| | |
| | | if (!com.zzg.common.utils.StringUtils.isEmpty(executionB.getOwnerName())) { |
| | | householdOwnerLambdaQueryWrapper.like(StateHouseholdOwner::getOwnerName, executionB.getOwnerName()); |
| | | } |
| | | //查询权利人 |
| | | List<StateHouseholdOwner> stateHouseholdOwners = stateHouseholdOwnerService.list(householdOwnerLambdaQueryWrapper); |
| | | |
| | | Map<String, List<StateHouseholdOwner>> ownerMap = stateHouseholdOwners.stream().collect(Collectors.groupingBy(StateHouseholdOwner::getStateHouseholdId)); |
| | |
| | | LambdaQueryWrapper<StateAgreement> agreementQueryWrapper = new LambdaQueryWrapper<>(); |
| | | agreementQueryWrapper.in(StateAgreement::getStateHouseholdId, houseIdList); |
| | | agreementQueryWrapper.isNotNull(StateAgreement::getAgreementNumber); |
| | | //查询协议 |
| | | List<StateAgreement> agreementList = stateAgreementMapper.selectList(agreementQueryWrapper); |
| | | if (CollectionUtils.isEmpty(agreementList)) { |
| | | return new ArrayList<>(result); |
| | |
| | | |
| | | if (innerAgreementMap.containsKey(AgreementTypeEnum.STATE_AGREEMENT.getValue())) { |
| | | StateAgreement stateAgreement = innerAgreementMap.get(AgreementTypeEnum.STATE_AGREEMENT.getValue()); |
| | | //正式签字时间 |
| | | data.setOfficialSignedTime(stateAgreement.getSignAt()); |
| | | } |
| | | if (innerAgreementMap.containsKey(AgreementTypeEnum.VIRTUAL_STATE_AGREEMENT.getValue())) { |
| | | StateAgreement virtualAgreement = innerAgreementMap.get(AgreementTypeEnum.VIRTUAL_STATE_AGREEMENT.getValue()); |
| | | //模拟签字时间 |
| | | data.setVirtualSignedTime(virtualAgreement.getSignAt()); |
| | | } |
| | | |
| | |
| | | return new HashMap<>(); |
| | | } |
| | | |
| | | |
| | | //查询房产 |
| | | LambdaQueryWrapper<StateHousehold> householdQueryWrapper = new LambdaQueryWrapper<>(); |
| | | householdQueryWrapper.in(StateHousehold::getStateProjectId, projectIdList); |
| | | if (StringUtils.isNoneBlank(projectStreet)) { |
| | |
| | | Map<String, Map<Integer, ProjectExecutionSumVO>> result = new HashMap<>(); |
| | | |
| | | Map<String, List<StateHousehold>> householdMap = households.stream().collect(Collectors.groupingBy(StateHousehold::getStateProjectId)); |
| | | |
| | | List<String> houseIdList = households.stream().map(StateHousehold::getId).collect(Collectors.toList()); |
| | | //废弃代码 |
| | | //List<String> houseIdList = households.stream().map(StateHousehold::getId).collect(Collectors.toList()); |
| | | List<String> acceptHoustIdList = households.stream().filter(e -> |
| | | Objects.nonNull(e.getAgreementStatus()) |
| | | ).map(StateHousehold::getId).collect(Collectors.toList()); |
| | |
| | | .count(); |
| | | |
| | | long notSignedVirtualPerson = innerHouseList.size() - signedVirtualPerson; |
| | | |
| | | //计算正式签约的比例 |
| | | appendData(searchedPersons, notSearchedPersons, innerHouseId, signedStatePerson, notSignedStatePerson, projectStateExecutionSumVO); |
| | | |
| | | |
| | | //计算模拟签约的比例 |
| | | appendData(searchedPersons, notSearchedPersons, innerHouseId, signedVirtualPerson, notSignedVirtualPerson, projectVirtualExecutionSumVO); |
| | | |
| | | Map<Integer, ProjectExecutionSumVO> projectExecutionSumVOMap = new HashMap<>(); |
| | |
| | | stateHouseholds.stream().map(StateHousehold::getId).collect(Collectors.toList())); |
| | | stateSettlementLambdaQueryWrapper.isNull(StateSettlement::getAuditStatus); |
| | | stateSettlementLambdaQueryWrapper.orderByAsc(StateSettlement::getSettleName); |
| | | //查询安置情况 |
| | | stateSettlementList = this.list(stateSettlementLambdaQueryWrapper); |
| | | if (ObjectUtil.isNotEmpty(stateSettlementList)) { |
| | | StateHousehold stateHousehold = stateHouseholdMap.get(stateSettlementList.get(0).getStateHouseholdId()); |
| | |
| | | return "第" + batchNum + "批次"; |
| | | } |
| | | |
| | | /** |
| | | * 当前项目批次列表 |
| | | * @param projectId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<String> listBatchName(String projectId) { |
| | | if (StringUtils.isEmpty(projectId)) { |
| | |
| | | if (CollectionUtils.isEmpty(stateSettlement)) { |
| | | throw new GlobalException("数据不能为空"); |
| | | } |
| | | |
| | | //新增的 |
| | | List<StateSettlement> newAddList = stateSettlement.stream().filter(e -> Objects.isNull(e.getId())).collect(Collectors.toList()); |
| | | //编辑的 |
| | | List<StateSettlement> oldUpdateList = stateSettlement.stream().filter(e -> Objects.nonNull(e.getId())).collect(Collectors.toList()); |
| | | |
| | | |
| | |
| | | data.setSettlementArea(areaMap.get(data.getStateHouseholdId())); |
| | | } |
| | | }); |
| | | |
| | | //全为编辑 |
| | | if (CollectionUtils.isEmpty(newAddHouseId)) { |
| | | this.saveOrUpdateBatch(oldUpdateList); |
| | | return; |
| | |
| | | LambdaQueryWrapper<StateSettlement> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.in(StateSettlement::getStateHouseholdId, newAddHouseId).ne(StateSettlement::getDelFlag, DeleteFlagEnum.DELETED.getKey()); |
| | | List<StateSettlement> list = this.list(lqw); |
| | | //新增 |
| | | if (CollectionUtils.isEmpty(list)) { |
| | | |
| | | //查询当前批次是否存在已经拒绝的,如果有则代表是 审核失败编辑页面新增的情况,这里需要吧审核状态设置为已拒绝 |
| | | //查询当前批次是否存在已经拒绝的,如果有则代表是 审核失败编辑页面新增的情况,这里需要吧审核状态设置为已拒绝 同一批次,审核状态统一,要么全为接收要么全为退回 |
| | | LambdaQueryWrapper<StateHousehold> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(StateHousehold::getStateProjectId, projectId); |
| | | List<StateHousehold> allHousehold = stateHouseholdMapper.selectList(queryWrapper); |
| | |
| | | saveOrUpdateBatch(stateSettlement); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 计算签约、未签约比例数据 |
| | | * @param searchedPersons |
| | | * @param notSearchedPersons |
| | | * @param innerHouseId |
| | | * @param signedVirtualPerson |
| | | * @param notSignedVirtualPerson |
| | | * @param projectVirtualExecutionSumVO |
| | | */ |
| | | private void appendData(long searchedPersons, long notSearchedPersons, List<String> innerHouseId, long signedVirtualPerson, long notSignedVirtualPerson, ProjectExecutionSumVO projectVirtualExecutionSumVO) { |
| | | projectVirtualExecutionSumVO.setSignedPersons(signedVirtualPerson); |
| | | projectVirtualExecutionSumVO.setNotSignedPersons(notSignedVirtualPerson); |