44323
2024-04-30 eba7ff322d676102b70058b26cfcffefdc22b53e
更新线上bug
4个文件已修改
40 ■■■■ 已修改文件
guns-admin/src/main/java/com/stylefeng/guns/modular/api/HouseResourceController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/HouseResourceMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/HouseResourceService.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/HousingDemandServiceImpl.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
guns-admin/src/main/java/com/stylefeng/guns/modular/api/HouseResourceController.java
@@ -262,7 +262,7 @@
    @ApiOperation(value = "获取房源详情", tags = {"详情"})
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "房源id", required = true),
//            @ApiImplicitParam(name = "Authorization", value = "Bearer eyJhbGciOiJIUzUxMiJ....", required = false, paramType = "header")
            @ApiImplicitParam(name = "Authorization", value = "Bearer eyJhbGciOiJIUzUxMiJ....", required = false, paramType = "header")
    })
    public ResultUtil<HouseResourceInfoRes> getHouseResourceInfo(Integer id){
        HouseResourceInfoRes houseResourceInfo = houseResourceService.getHouseResourceInfo(id);
guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/HouseResourceMapper.xml
@@ -140,6 +140,7 @@
        au.user_type as houseResource,
        hr.house_photo as imgUrl,
        hr.title,
        hr.headImg,
        hr.house_area as houseArea,
        hr.house_model as houseModel,
        concat(rp.`name`, rc.`name`) as address,
guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/HouseResourceService.java
@@ -134,24 +134,6 @@
            }
            // 根据用户历史搜索 推荐对应的区域
        }
//        if(StringUtils.hasLength(req.getDistrict())){
//            cityIds = new ArrayList<>();
//            districtIds = new ArrayList<>();
//            JSONArray jsonArray = JSON.parseArray(req.getDistrict());
//            for (int i = 0; i < jsonArray.size(); i++) {
//                JSONObject jsonObject = jsonArray.getJSONObject(i);
//                Integer cityId = jsonObject.getInteger("cityId");
//                Integer districtId = jsonObject.getInteger("districtId");
//                //不限区域
//                if(0 == districtId || null == districtId){
//                    List<Region> regions = regionService.selectList(new EntityWrapper<Region>().eq("parent_id", cityId));
//                    districtIds.addAll(regions.stream().map(Region::getId).collect(Collectors.toList()));
//                }
//                cityIds.add(cityId);
//                districtIds.add(districtId);
//            }
//        }
        //价格范围
        Double saleAmountStart = null;
        Double saleAmountEnd = null;
@@ -185,7 +167,6 @@
        }
        SearchHouseResourceRes searchHouseResource = new SearchHouseResourceRes();
        List<SearchHouseResourceListRes> searchHouseResourceListRes = this.baseMapper.searchHouseResource(req, cityIds, districtIds, saleAmountStart, saleAmountEnd, houseModels, houseTypeIds);
        // 如果有根据用户历史来搜索必看 如果没有搜索出数据 那么查询所有必看
        if (req.getDataType()!=null&&req.getDataType()==1 && (!StringUtils.hasLength(req.getDistrict()))
guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/HousingDemandServiceImpl.java
@@ -422,7 +422,7 @@
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        HousingDemand housingDemand = this.selectById(id);
        HousingDemandInfoRes housingDemandInfoRes = new HousingDemandInfoRes();
//        AppUser appUser = appUserService.getAppUser();
        AppUser appUser = appUserService.getAppUser();
        housingDemandInfoRes.setId(id);
        housingDemandInfoRes.setDataType(housingDemand.getDataType());
        housingDemandInfoRes.setQrCode(housingDemand.getQrCode());
@@ -530,15 +530,15 @@
        int collectionTimes = collectionHousingDemandService.selectCount(new EntityWrapper<CollectionHousingDemand>().eq("housing_demand_id", id));
        housingDemandInfoRes.setCollectionTimes(collectionTimes);
        housingDemandInfoRes.setCollection(0);
//        if(null != appUser){
//            int collection = collectionHousingDemandService
//                    .selectCount(new EntityWrapper<CollectionHousingDemand>()
//                            .eq("housing_demand_id", id)
//                            .eq("app_user_id", appUser.getId()));
//            housingDemandInfoRes.setCollection(0 == collection ? 0 : 1);
//        }
        if(null != appUser){
            int collection = collectionHousingDemandService
                    .selectCount(new EntityWrapper<CollectionHousingDemand>()
                            .eq("housing_demand_id", id)
                            .eq("app_user_id", appUser.getId()));
            housingDemandInfoRes.setCollection(0 == collection ? 0 : 1);
        }
        //添加访问次数记录
//        addViewsNumber(housingDemand);
        addViewsNumber(housingDemand);
        return housingDemandInfoRes;
    }