| | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void fixSettle() { |
| | | //修改安置状态为0 |
| | | LambdaUpdateWrapper<Placement> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.set(Placement::getStatus, 0); |
| | | placementService.update(updateWrapper); |
| | | |
| | | LambdaQueryWrapper<PlacementBatch> queryWrapper = new LambdaQueryWrapper<>(); |
| | | queryWrapper.eq(PlacementBatch::getStatus, 1); |
| | | List<PlacementBatch> list = this.baseMapper.selectList(queryWrapper); |
| | | List<Long> batchIds = list.stream().map(PlacementBatch::getId).collect(Collectors.toList()); |
| | | //查询房产表 |
| | | LambdaQueryWrapper<PlacementBatchHousehold> householdWrapper = new LambdaQueryWrapper<>(); |
| | | householdWrapper.in(PlacementBatchHousehold::getPlacementBatchId, batchIds); |
| | | List<PlacementBatchHousehold> households = this.placementBatchHouseholdService.list(householdWrapper); |
| | | |
| | | if (ObjectUtil.isEmpty(households)) { |
| | | return; |
| | | } |
| | | //修改户主安置状态 |
| | | List<String> houseHead = households.stream().map(PlacementBatchHousehold::getHouseholdHead).collect(Collectors.toList()); |
| | | if (ObjUtil.isNotEmpty(houseHead)) { |
| | | LambdaUpdateWrapper<Placement> placementHouseHeadUpdateWrapper = new LambdaUpdateWrapper<>(); |
| | | placementHouseHeadUpdateWrapper.set(Placement::getStatus, 1); |
| | | placementHouseHeadUpdateWrapper.and(query -> query.in(Placement::getHouseholdHead, houseHead)); |
| | | placementService.update(placementHouseHeadUpdateWrapper); |
| | | } |
| | | //修改家庭成员安置状态 |
| | | for (PlacementBatchHousehold household : households) { |
| | | if (ObjUtil.isEmpty(household.getWaitFamilyNames())) { |
| | | continue; |
| | | } |
| | | //购房表家庭成员姓名 |
| | | List<String> names = Arrays.asList(household.getWaitFamilyNames().split("、")); |
| | | //购房表户主身份证 |
| | | String headIdCard = household.getIdCard(); |
| | | LambdaUpdateWrapper<Placement> placementLambdaUpdateWrapper = new LambdaUpdateWrapper<>(); |
| | | placementLambdaUpdateWrapper.set(Placement::getStatus, 1); |
| | | placementLambdaUpdateWrapper.eq(Placement::getIdCard, headIdCard); |
| | | placementLambdaUpdateWrapper.and(query -> query.in(Placement::getFamilyName, names)); |
| | | placementService.update(placementLambdaUpdateWrapper); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取最近批次号 |
| | | * |