| | |
| | | |
| | | /** |
| | | * 自定义分页查询 |
| | | * |
| | | * @param page |
| | | * @param houseRental |
| | | * @return |
| | | */ |
| | | @Override |
| | | public IPage<HouseRentalTenantVO> selectHouseRentalPage(IPage<HouseRentalTenantVO> page, HouseRentalTenantVO houseRental) { |
| | | if (null!=houseRental.getAuditStatus()){ |
| | | if (houseRental.getAuditStatus()==0){ |
| | | if (null != houseRental.getAuditStatus()) { |
| | | if (houseRental.getAuditStatus() == 0) { |
| | | houseRental.setAuditStatus(2); |
| | | } |
| | | } |
| | |
| | | commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getIsAdministrator()); |
| | | for (HouseRentalTenantVO houseRentalTenantVO : houseRentalTenantVOS) { |
| | | if(houseRentalTenantVO.getStatus().equals(1)){ |
| | | if (houseRentalTenantVO.getStatus().equals(1)) { |
| | | houseRentalTenantVO.setStatus(30); |
| | | } |
| | | if(houseRentalTenantVO.getStatus().equals(0) && houseRentalTenantVO.getAuditStatus().equals(0)){ |
| | | if (houseRentalTenantVO.getStatus().equals(0) && houseRentalTenantVO.getAuditStatus().equals(0)) { |
| | | houseRentalTenantVO.setStatus(0); |
| | | } |
| | | if(houseRentalTenantVO.getStatus().equals(0) && houseRentalTenantVO.getAuditStatus().equals(1)){ |
| | | if (houseRentalTenantVO.getStatus().equals(0) && houseRentalTenantVO.getAuditStatus().equals(1)) { |
| | | houseRentalTenantVO.setStatus(1); |
| | | } |
| | | if(houseRentalTenantVO.getStatus().equals(0) && houseRentalTenantVO.getDldType().equals(3)){ |
| | | if (houseRentalTenantVO.getStatus().equals(0) && houseRentalTenantVO.getDldType().equals(3)) { |
| | | houseRentalTenantVO.setStatus(20); |
| | | } |
| | | if(houseRentalTenantVO.getStatus().equals(0) && houseRentalTenantVO.getDldType().equals(2)){ |
| | | if (houseRentalTenantVO.getStatus().equals(0) && houseRentalTenantVO.getDldType().equals(2)) { |
| | | houseRentalTenantVO.setStatus(10); |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * 查询房屋出租情况 |
| | | * |
| | | * @param code |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 自定义房屋出租新增 |
| | | * |
| | | * @param houseRentalVO |
| | | * @return |
| | | */ |
| | |
| | | // 获取请求头中的角色别名 |
| | | String roleName = SpringUtils.getRequestParam("roleName"); |
| | | // 居民 |
| | | if (!Strings.isBlank(roleName) && roleName.equals("inhabitant")){ |
| | | if (!Strings.isBlank(roleName) && roleName.equals("inhabitant")) { |
| | | // 待审核 |
| | | houseRentalVO.setAuditStatus(0); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 保存租户信息 |
| | | * |
| | | * @param houseRentalVO |
| | | * @param flag |
| | | * @return |
| | | */ |
| | | public boolean saveHousehold(HouseRentalVO houseRentalVO, boolean flag) { |
| | | if (flag && houseRentalVO.getHouseholdVOList().size()>0) { |
| | | if (flag && houseRentalVO.getHouseholdVOList().size() > 0) { |
| | | List<String> phoneList = new ArrayList<>(); |
| | | List<HouseholdEntity> householdEntityList = new ArrayList<>(); |
| | | houseRentalVO.getHouseholdVOList().forEach(e -> { |
| | |
| | | } catch (Exception e) { |
| | | log.error("保存用户角色为居民:", e); |
| | | } |
| | | flag = iHouseholdService.saveBatch(householdEntityList); |
| | | flag = iHouseholdService.saveBatch(householdEntityList); |
| | | } |
| | | return flag; |
| | | } |
| | | |
| | | /** |
| | | * 出租屋 自定义删除 |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 出租屋 自定义修改 |
| | | * |
| | | * @param houseRental |
| | | * @return |
| | | */ |
| | |
| | | e.getId()).collect(Collectors.toList()).contains(vo.getId())).collect(Collectors.toList()); |
| | | |
| | | // 批量新增 |
| | | if (addList.size()>0) { |
| | | if (addList.size() > 0) { |
| | | addFlag = iHouseholdService.saveBatch(addList); |
| | | } |
| | | // 批量修改 |
| | |
| | | |
| | | /** |
| | | * 获取统计数据 |
| | | * |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Object getStatistics(HouseRentalTenantVO houseRental) { |
| | | List<String> list = new ArrayList<>(); |
| | | if (null!=houseRental.getRoleName() && !houseRental.getRoleName().equals("")){ |
| | | if (houseRental.getRoleName().equals("网格员")){ |
| | | if (null != houseRental.getRoleName() && !houseRental.getRoleName().equals("")) { |
| | | if (houseRental.getRoleName().equals("网格员")) { |
| | | // 查询对应的房屋地址code |
| | | list = gridService.getAddressCodeListByUserId(AuthUtil.getUserId()); |
| | | } |
| | | } |
| | | // 查询 |
| | | List<HouseRentalStatistics> statistics = baseMapper.getStatistics(houseRental,list); |
| | | List<HouseRentalStatistics> statistics = baseMapper.getStatistics(houseRental, list); |
| | | // 返回 |
| | | return statistics; |
| | | } |
| | | |
| | | /** |
| | | * 出租屋 确认 |
| | | * |
| | | * @param houseRental |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 导出租赁信息 |
| | | * |
| | | * @param houseRentalVO |
| | | * @return |
| | | */ |
| | |
| | | |
| | | @Override |
| | | public Integer getStatisticsCount(HouseRentalTenantVO houseRental) { |
| | | return baseMapper.getStatisticsCount(houseRental.getUserId(), houseRental.getNeiCode()); |
| | | CommonParamSet<Object> commonParamSet = new CommonParamSet<>().invoke(HouseRentalTenantVO.class, houseRental); |
| | | return baseMapper.getStatisticsCount(houseRental, commonParamSet.getGridCodeList(), |
| | | commonParamSet.getRegionChildCodesList(), commonParamSet.getIsAdministrator()); |
| | | } |
| | | } |