| | |
| | | @Resource |
| | | private StateApplyRecordService stateApplyRecordService; |
| | | |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param stateApplyRecordPageBO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageInfo<StateApplyRecordVO> pageInfo(StateApplyRecordPageBO stateApplyRecordPageBO) { |
| | | PageUtils.startPage(); |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 保存请账 |
| | | * @param recordAndItemBO |
| | | * @return |
| | | */ |
| | | @Override |
| | | @Transactional |
| | | public boolean saveStateApplyRecordAndItem(SaveRecordAndItemBO recordAndItemBO) { |
| | |
| | | variable.put("projectId", stateApplyRecord.getProjectId()); |
| | | variable.put("applyType", stateApplyRecord.getApplyType()); |
| | | processStartBO.setVariable(variable); |
| | | //开启工作流程 |
| | | stateProcessTemplateService.start(processStartBO); |
| | | |
| | | //保存请款子表 |
| | |
| | | return stateApplyRecordItemService.saveOrUpdateBatch(newRecordItem); |
| | | } |
| | | |
| | | /** |
| | | * 通过项目id查询权利人 |
| | | * @param getApplyHouseholdOwnerBO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ApplyHouseholdOwnerVO getApplyHouseholdOwner(GetApplyHouseholdOwnerBO getApplyHouseholdOwnerBO) { |
| | | String projectId = getApplyHouseholdOwnerBO.getProjectId(); |
| | |
| | | |
| | | LambdaQueryWrapper<StateProject> lqwStateProject = new LambdaQueryWrapper<>(); |
| | | lqwStateProject.eq(StateProject::getId, projectId); |
| | | //查询项目 |
| | | StateProject one = stateProjectService.getOne(lqwStateProject); |
| | | if (Objects.isNull(one)) { |
| | | return new ApplyHouseholdOwnerVO(); |
| | |
| | | if (org.apache.commons.lang3.StringUtils.isNotBlank(street)) { |
| | | lqwHousehold.like(StateHousehold::getStreet, street); |
| | | } |
| | | //查询房产 |
| | | List<StateHousehold> householdList = stateHouseholdService.list(lqwHousehold); |
| | | if (CollectionUtils.isEmpty(householdList)) { |
| | | return new ApplyHouseholdOwnerVO(); |
| | |
| | | if (org.apache.commons.lang3.StringUtils.isNotBlank(ownerName)) { |
| | | lqwHouseholdOwner.like(StateHouseholdOwner::getOwnerName, ownerName); |
| | | } |
| | | //查询权利人 |
| | | List<StateHouseholdOwner> ownerList = stateHouseholdOwnerService.list(lqwHouseholdOwner); |
| | | |
| | | if (CollectionUtils.isEmpty(ownerList)) { |
| | | return new ApplyHouseholdOwnerVO(); |
| | | } |
| | | |
| | | //查询项目关联的补偿标准 |
| | | StateProjectCompensation compensation = stateProjectCompensationService.getById(one.getId()); |
| | | |
| | | Map<String, StateHousehold> stateHouseholdMap = householdList.stream().collect(Collectors.toMap(StateHousehold::getId, Function.identity())); |
| | |
| | | lqwCompensateStandard.eq(StateProjectCompensateStandard::getStandardName, compensation.getPolicySubsidy()) |
| | | .eq(StateProjectCompensateStandard::getCategory, status) |
| | | .eq(StateProjectCompensateStandard::getCompensateType, CompensateTypeEnum.POLICY_SUBSIDY_FEE.getCode()); |
| | | //查询项目补偿标准 |
| | | List<StateProjectCompensateStandard> list = stateProjectCompensateStandardService.list(lqwCompensateStandard); |
| | | if (!CollectionUtils.isEmpty(list)) { |
| | | StateProjectCompensateStandard stateProjectCompensateStandard = list.stream().findFirst().get(); |
| | |
| | | return applyHouseholdOwnerVO; |
| | | } |
| | | |
| | | @Override |
| | | public Object apply(StateApplyRecordPageBO stateApplyRecordPageBO) { |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 分页查询一级台账 |
| | | * @param stateApplyRecordPageBO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public StateApplyRecordPageInfoLevelVO pageInfoLevel(StateApplyRecordPageInfoLevelBO stateApplyRecordPageBO) { |
| | | List<StateApplyRecordVO> allStateApplyRecordVOList = this.getBaseMapper().selectApplyRecordWithProject(stateApplyRecordPageBO); |
| | |
| | | )); |
| | | } |
| | | |
| | | /** |
| | | * 住宅临时安置补助费户详情或者 或者 停产停业补助费详情 |
| | | * @param getApplyHouseholdOwnerBO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageInfo<ApplyOwnerBO> getApplyHouseholdOwnerInfo(GetApplyHouseholdOwnerBO getApplyHouseholdOwnerBO) { |
| | | PageUtils.startPage(); |
| | | //TODO 查询请款记录 由于之前产品设计的问题是以权利人作为维度的即一个请款对应是 一个权利人, 后期又修改成了 以房产为 维度 即一个请款对应一个房产 导致之前数据库设计有问题 |
| | | List<ApplyOwnerBO> applyHouseholdOwnerVOS = this.getBaseMapper().selectApplyRecordWithOwnerDistinctPage(getApplyHouseholdOwnerBO); |
| | | |
| | | if (CollectionUtils.isEmpty(applyHouseholdOwnerVOS)) { |
| | |
| | | } |
| | | getApplyHouseholdOwnerBO.setStateHouseIdList(applyHouseholdOwnerVOS.stream().map(ApplyOwnerBO::getStateHouseholdId).collect(Collectors.toList())); |
| | | PageInfo<ApplyOwnerBO> applyOwnerBOPageInfo = new PageInfo<>(applyHouseholdOwnerVOS); |
| | | |
| | | //TODO |
| | | List<ApplyOwnerBO> applyOwnerBOS = this.getBaseMapper().selectApplyRecordWithOwnerPage(getApplyHouseholdOwnerBO); |
| | | applyOwnerBOPageInfo.setList(applyOwnerBOS); |
| | | List<String> projectIdList = applyOwnerBOPageInfo.getList().stream().map(ApplyOwnerBO::getProjectId).collect(Collectors.toList()); |
| | |
| | | return applyOwnerBOPageInfo; |
| | | } |
| | | |
| | | /** |
| | | * 任务中心-请帐详情 |
| | | * @param getApplyHouseholdOwnerBO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ApplyBO stateApplyRecordDetail(GetApplyHouseholdOwnerBO getApplyHouseholdOwnerBO) { |
| | | StateApplyRecord stateApplyRecord = this.getById(getApplyHouseholdOwnerBO.getApplyId()); |
| | |
| | | return applyBO; |
| | | } |
| | | |
| | | /** |
| | | * 导入权利人 |
| | | * @param importApplyRecordBO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<ApplyOwnerBO> importOwnerByFile(ImportApplyRecordBO importApplyRecordBO) { |
| | | List<ApplyOwnerVO> dataList; |
| | |
| | | if (Objects.isNull(one)) { |
| | | throw new GlobalException("未查询到相应项目"); |
| | | } |
| | | |
| | | //查询项目下的所有房产 |
| | | LambdaQueryWrapper<StateHousehold> lqwHousehold = new LambdaQueryWrapper<>(); |
| | | lqwHousehold.eq(StateHousehold::getStateProjectId, one.getId()); |
| | | |
| | |
| | | throw new GlobalException("未查询到相应房产权利人"); |
| | | } |
| | | |
| | | |
| | | //TODO 废弃代码开始 |
| | | StateApplyRecord stateApplyRecord; |
| | | if (org.apache.commons.lang3.StringUtils.isBlank(importApplyRecordBO.getApplyId())) { |
| | | stateApplyRecord = new StateApplyRecord(); |
| | |
| | | stateApplyRecord = new StateApplyRecord(); |
| | | stateApplyRecord.setId(importApplyRecordBO.getApplyId()); |
| | | } |
| | | //废弃代码结束 |
| | | List<ApplyOwnerBO> itemList = new ArrayList<>(); |
| | | ApplyOwnerBO applyOwnerBO; |
| | | StateApplyRecordItem item; |
| | | List<StateHousehold> stateHouseholds = householdList.stream().filter(e -> dataList.stream().map(ApplyOwnerVO::getRealEstateCertificateNumber).collect(Collectors.toList()).contains(e.getRealEstateCertificateNumber())).collect(Collectors.toList()); |
| | | //根据导入数据的不动产权证号筛选出同项目下的房产数据 |
| | | List<StateHousehold> stateHouseholds = householdList.stream().filter(e -> dataList.stream().map(ApplyOwnerVO::getRealEstateCertificateNumber) |
| | | .collect(Collectors.toList()).contains(e.getRealEstateCertificateNumber())).collect(Collectors.toList()); |
| | | ownerList.sort(Comparator.comparing(BaseEntity::getCreateTime)); |
| | | //权利人根据房产id分组 |
| | | Map<String, List<StateHouseholdOwner>> ownerMap = ownerList.stream().collect(Collectors.groupingBy(StateHouseholdOwner::getStateHouseholdId)); |
| | | |
| | | //导入数据根据不同不动产权证号分组 |
| | | Map<String, List<ApplyOwnerVO>> importMap = dataList.stream().collect(Collectors.groupingBy(ApplyOwnerVO::getRealEstateCertificateNumber)); |
| | | DecimalFormat decimalFormat = new DecimalFormat("##0.####"); |
| | | for (StateHousehold stateHousehold : stateHouseholds) { |
| | | List<StateHouseholdOwner> owners = ownerMap.get(stateHousehold.getId()); |
| | | if (!CollectionUtils.isEmpty(owners)) { |
| | | applyOwnerBO = StateProjectConvert.INSTANCE.toApplyOwnerBO(owners.get(0)); |
| | | applyOwnerBO.setOwnerName(owners.stream().map(StateHouseholdOwner::getOwnerName).collect(Collectors.joining("|"))); |
| | | applyOwnerBO.setStateHouseholdOwnerId(owners.stream().map(StateHouseholdOwner::getId).collect(Collectors.joining("|"))); |
| | | applyOwnerBO = StateProjectConvert.INSTANCE.toApplyOwnerBO(owners.get(0));//TODO 对象拷贝时new 了对象的 |
| | | applyOwnerBO.setOwnerName(owners.stream().map(StateHouseholdOwner::getOwnerName).collect(Collectors.joining("|"))); // 多个权利人用|分割 |
| | | applyOwnerBO.setStateHouseholdOwnerId(owners.stream().map(StateHouseholdOwner::getId).collect(Collectors.joining("|"))); //多个权利人id以|分割 |
| | | |
| | | applyOwnerBO.setStreet(stateHousehold.getStreet()); |
| | | applyOwnerBO.setRealEstateCertificateNumber(stateHousehold.getRealEstateCertificateNumber()); |