From 11a6a41abb311d56c916a42943a3e7b60eab9e89 Mon Sep 17 00:00:00 2001 From: majintao Date: Tue, 17 Jun 2025 16:59:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=A5=BC=E7=9B=98=E8=AF=84?= =?UTF-8?q?=E7=BA=A7=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dal/mongo/dao/CommunityRateDao.java | 7 + .../dal/mongo/dao/CommunityRateDaoImpl.java | 7 + .../dal/mongo/model/CommunityRate.java | 960 ++++++++++++++++++ .../open/controllers/AddressController.java | 93 +- .../datastore/CommunityRateService.java | 9 + .../datastore/CommunityRateServiceImpl.java | 32 + 6 files changed, 1068 insertions(+), 40 deletions(-) create mode 100644 projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/dao/CommunityRateDao.java create mode 100644 projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/dao/CommunityRateDaoImpl.java create mode 100644 projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/CommunityRate.java create mode 100644 projects/fangjia-service/src/main/java/com/fangjia/service/datastore/CommunityRateService.java create mode 100644 projects/fangjia-service/src/main/java/com/fangjia/service/datastore/CommunityRateServiceImpl.java diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/dao/CommunityRateDao.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/dao/CommunityRateDao.java new file mode 100644 index 000000000..f30672858 --- /dev/null +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/dao/CommunityRateDao.java @@ -0,0 +1,7 @@ +package com.fangjia.dal.mongo.dao; + +import com.fangjia.dal.MongoDao; +import com.fangjia.dal.mongo.model.CommunityRate; + +public interface CommunityRateDao extends MongoDao { +} diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/dao/CommunityRateDaoImpl.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/dao/CommunityRateDaoImpl.java new file mode 100644 index 000000000..781a12097 --- /dev/null +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/dao/CommunityRateDaoImpl.java @@ -0,0 +1,7 @@ +package com.fangjia.dal.mongo.dao; + +import com.fangjia.dal.MongoDaoImpl; +import com.fangjia.dal.mongo.model.CommunityRate; + +public class CommunityRateDaoImpl extends MongoDaoImpl implements CommunityRateDao{ +} diff --git a/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/CommunityRate.java b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/CommunityRate.java new file mode 100644 index 000000000..ed233d238 --- /dev/null +++ b/projects/fangjia-dal/src/main/java/com/fangjia/dal/mongo/model/CommunityRate.java @@ -0,0 +1,960 @@ +package com.fangjia.dal.mongo.model; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Table; +import com.fangjia.dal.MongoEntity; +import java.util.Date; + +@Entity +@Table(name = "fangjia_stat.community_rate") +public class CommunityRate implements MongoEntity { + + private static final long serialVersionUID = 8312754864385108472L; + private String id; + private String commId; + private String city; + private String region; + private String name; + private String block; + private String blockRating; + private String address; + private Double sqmetreRent; + private Double yoy; + private Double rentRoPriceRatio; + private Integer halfOnYearSellNum; + private Double totalScore; + private Double communityQualityScore; + private Double communityPriceScore; + private Double locationAdvantageScore; + private Double flowabilityScore; + private Double livingFacilitiesScore; + private Double educationScore; + private Double hospitalScore; + private String rating; + private String communityQualityRating; + private String communityPriceRating; + private String locationAdvantageRating; + private String flowabilityRating; + private String livingFacilitiesRating; + private String educationRating; + private String hospitalRating; + private Double supermarketNum; + private Double parkNum; + private Double cateringNum; + private Double mallNum; + private Double kindergartenNum; + private Double keyPrimarySchoolNum; + private Double ordinaryPrimarySchoolNum; + private Double keyMiddleSchoolNum; + private Double ordinaryMiddleSchoolNum; + private Double topThreeHospitalNum; + private Double non3aHospitalNum; + private Double buildYear; + private Double cubagePercent; + private Double virescencePercent; + private Double estateCharge; + private String estateType; + private Integer cityRank; + private Integer cityTotalRank; + private Integer regionRank; + private Integer regionTotalRank; + private Integer blockTotalRank; + private Integer blockRank; + private Integer cityCommunityQualityRank; + private Integer cityCommunityQualityTotalRank; + private Integer regionCommunityQualityRank; + private Integer regionCommunityQualityTotalRank; + private Integer blockCommunityQualityTotalRank; + private Integer blockCommunityQualityRank; + private Integer cityCommunityPriceRank; + private Integer cityCommunityPriceTotalRank; + private Integer regionCommunityPriceRank; + private Integer regionCommunityPriceTotalRank; + private Integer blockCommunityPriceTotalRank; + private Integer blockCommunityPriceRank; + private Integer cityLocationAdvantageRank; + private Integer cityLocationAdvantageTotalRank; + private Integer regionLocationAdvantageRank; + private Integer regionLocationAdvantageTotalRank; + private Integer blockLocationAdvantageTotalRank; + private Integer blockLocationAdvantageRank; + private Integer cityFlowabilityRank; + private Integer cityFlowabilityTotalRank; + private Integer regionFlowabilityRank; + private Integer regionFlowabilityTotalRank; + private Integer blockFlowabilityTotalRank; + private Integer blockFlowabilityRank; + private Integer cityLivingFacilitiesRank; + private Integer cityLivingFacilitiesTotalRank; + private Integer regionLivingFacilitiesRank; + private Integer regionLivingFacilitiesTotalRank; + private Integer blockLivingFacilitiesTotalRank; + private Integer blockLivingFacilitiesRank; + private Integer cityEducationRank; + private Integer cityEducationTotalRank; + private Integer regionEducationRank; + private Integer regionEducationTotalRank; + private Integer blockEducationTotalRank; + private Integer blockEducationRank; + private Integer cityHospitalRank; + private Integer cityHospitalTotalRank; + private Integer regionHospitalRank; + private Integer regionHospitalTotalRank; + private Integer blockHospitalTotalRank; + private Integer blockHospitalRank; + private Date mDate; + private Date cDate; + + // Getter and Setter 方法 + @Id + @GeneratedValue + @Column(name = "_id", unique = true, nullable = false) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + @Column(name = "comm_id") + public String getCommId() { + return commId; + } + + public void setCommId(String commId) { + this.commId = commId; + } + + @Column(name = "city") + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + @Column(name = "region") + public String getRegion() { + return region; + } + + public void setRegion(String region) { + this.region = region; + } + + @Column(name = "name") + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + @Column(name = "block") + public String getBlock() { + return block; + } + + public void setBlock(String block) { + this.block = block; + } + + @Column(name = "block_rating") + public String getBlockRating() { + return blockRating; + } + + public void setBlockRating(String blockRating) { + this.blockRating = blockRating; + } + + @Column(name = "address") + public String getAddress() { + return address; + } + + public void setAddress(String address) { + this.address = address; + } + + @Column(name = "sqmetre_rent") + public Double getSqmetreRent() { + return sqmetreRent; + } + + public void setSqmetreRent(Double sqmetreRent) { + this.sqmetreRent = sqmetreRent; + } + + @Column(name = "yoy") + public Double getYoy() { + return yoy; + } + + public void setYoy(Double yoy) { + this.yoy = yoy; + } + + @Column(name = "rent_ro_price_ratio") + public Double getRentRoPriceRatio() { + return rentRoPriceRatio; + } + + public void setRentRoPriceRatio(Double rentRoPriceRatio) { + this.rentRoPriceRatio = rentRoPriceRatio; + } + + @Column(name = "half_on_year_sell_num") + public Integer getHalfOnYearSellNum() { + return halfOnYearSellNum; + } + + public void setHalfOnYearSellNum(Integer halfOnYearSellNum) { + this.halfOnYearSellNum = halfOnYearSellNum; + } + + @Column(name = "total_score") + public Double getTotalScore() { + return totalScore; + } + + public void setTotalScore(Double totalScore) { + this.totalScore = totalScore; + } + + @Column(name = "community_quality_score") + public Double getCommunityQualityScore() { + return communityQualityScore; + } + + public void setCommunityQualityScore(Double communityQualityScore) { + this.communityQualityScore = communityQualityScore; + } + + @Column(name = "community_price_score") + public Double getCommunityPriceScore() { + return communityPriceScore; + } + + public void setCommunityPriceScore(Double communityPriceScore) { + this.communityPriceScore = communityPriceScore; + } + + @Column(name = "location_advantage_score") + public Double getLocationAdvantageScore() { + return locationAdvantageScore; + } + + public void setLocationAdvantageScore(Double locationAdvantageScore) { + this.locationAdvantageScore = locationAdvantageScore; + } + + @Column(name = "flowability_score") + public Double getFlowabilityScore() { + return flowabilityScore; + } + + public void setFlowabilityScore(Double flowabilityScore) { + this.flowabilityScore = flowabilityScore; + } + + @Column(name = "living_facilities_score") + public Double getLivingFacilitiesScore() { + return livingFacilitiesScore; + } + + public void setLivingFacilitiesScore(Double livingFacilitiesScore) { + this.livingFacilitiesScore = livingFacilitiesScore; + } + + @Column(name = "education_score") + public Double getEducationScore() { + return educationScore; + } + + public void setEducationScore(Double educationScore) { + this.educationScore = educationScore; + } + + @Column(name = "hospital_score") + public Double getHospitalScore() { + return hospitalScore; + } + + public void setHospitalScore(Double hospitalScore) { + this.hospitalScore = hospitalScore; + } + + @Column(name = "rating") + public String getRating() { + return rating; + } + + public void setRating(String rating) { + this.rating = rating; + } + + @Column(name = "community_quality_rating") + public String getCommunityQualityRating() { + return communityQualityRating; + } + + public void setCommunityQualityRating(String communityQualityRating) { + this.communityQualityRating = communityQualityRating; + } + + @Column(name = "community_price_rating") + public String getCommunityPriceRating() { + return communityPriceRating; + } + + public void setCommunityPriceRating(String communityPriceRating) { + this.communityPriceRating = communityPriceRating; + } + + @Column(name = "location_advantage_rating") + public String getLocationAdvantageRating() { + return locationAdvantageRating; + } + + public void setLocationAdvantageRating(String locationAdvantageRating) { + this.locationAdvantageRating = locationAdvantageRating; + } + + @Column(name = "flowability_rating") + public String getFlowabilityRating() { + return flowabilityRating; + } + + public void setFlowabilityRating(String flowabilityRating) { + this.flowabilityRating = flowabilityRating; + } + + @Column(name = "living_facilities_rating") + public String getLivingFacilitiesRating() { + return livingFacilitiesRating; + } + + public void setLivingFacilitiesRating(String livingFacilitiesRating) { + this.livingFacilitiesRating = livingFacilitiesRating; + } + + @Column(name = "education_rating") + public String getEducationRating() { + return educationRating; + } + + public void setEducationRating(String educationRating) { + this.educationRating = educationRating; + } + + @Column(name = "hospital_rating") + public String getHospitalRating() { + return hospitalRating; + } + + public void setHospitalRating(String hospitalRating) { + this.hospitalRating = hospitalRating; + } + + @Column(name = "supermarket_num") + public Double getSupermarketNum() { + return supermarketNum; + } + + public void setSupermarketNum(Double supermarketNum) { + this.supermarketNum = supermarketNum; + } + + @Column(name = "park_num") + public Double getParkNum() { + return parkNum; + } + + public void setParkNum(Double parkNum) { + this.parkNum = parkNum; + } + + @Column(name = "catering_num") + public Double getCateringNum() { + return cateringNum; + } + + public void setCateringNum(Double cateringNum) { + this.cateringNum = cateringNum; + } + + @Column(name = "mall_num") + public Double getMallNum() { + return mallNum; + } + + public void setMallNum(Double mallNum) { + this.mallNum = mallNum; + } + + @Column(name = "kindergarten_num") + public Double getKindergartenNum() { + return kindergartenNum; + } + + public void setKindergartenNum(Double kindergartenNum) { + this.kindergartenNum = kindergartenNum; + } + + @Column(name = "key_primary_school_num") + public Double getKeyPrimarySchoolNum() { + return keyPrimarySchoolNum; + } + + public void setKeyPrimarySchoolNum(Double keyPrimarySchoolNum) { + this.keyPrimarySchoolNum = keyPrimarySchoolNum; + } + + @Column(name = "ordinary_primary_school_num") + public Double getOrdinaryPrimarySchoolNum() { + return ordinaryPrimarySchoolNum; + } + + public void setOrdinaryPrimarySchoolNum(Double ordinaryPrimarySchoolNum) { + this.ordinaryPrimarySchoolNum = ordinaryPrimarySchoolNum; + } + + @Column(name = "key_middle_school_num") + public Double getKeyMiddleSchoolNum() { + return keyMiddleSchoolNum; + } + + public void setKeyMiddleSchoolNum(Double keyMiddleSchoolNum) { + this.keyMiddleSchoolNum = keyMiddleSchoolNum; + } + + @Column(name = "ordinary_middle_school_num") + public Double getOrdinaryMiddleSchoolNum() { + return ordinaryMiddleSchoolNum; + } + + public void setOrdinaryMiddleSchoolNum(Double ordinaryMiddleSchoolNum) { + this.ordinaryMiddleSchoolNum = ordinaryMiddleSchoolNum; + } + + @Column(name = "top_three_hospital_num") + public Double getTopThreeHospitalNum() { + return topThreeHospitalNum; + } + + public void setTopThreeHospitalNum(Double topThreeHospitalNum) { + this.topThreeHospitalNum = topThreeHospitalNum; + } + + @Column(name = "non_3a_hospital_num") + public Double getNon3aHospitalNum() { + return non3aHospitalNum; + } + + public void setNon3aHospitalNum(Double non3aHospitalNum) { + this.non3aHospitalNum = non3aHospitalNum; + } + + @Column(name = "build_year") + public Double getBuildYear() { + return buildYear; + } + + public void setBuildYear(Double buildYear) { + this.buildYear = buildYear; + } + + @Column(name = "cubage_percent") + public Double getCubagePercent() { + return cubagePercent; + } + + public void setCubagePercent(Double cubagePercent) { + this.cubagePercent = cubagePercent; + } + + @Column(name = "virescence_percent") + public Double getVirescencePercent() { + return virescencePercent; + } + + public void setVirescencePercent(Double virescencePercent) { + this.virescencePercent = virescencePercent; + } + + @Column(name = "estate_charge") + public Double getEstateCharge() { + return estateCharge; + } + + public void setEstateCharge(Double estateCharge) { + this.estateCharge = estateCharge; + } + + @Column(name = "estate_type") + public String getEstateType() { + return estateType; + } + + public void setEstateType(String estateType) { + this.estateType = estateType; + } + + @Column(name = "city_rank") + public Integer getCityRank() { + return cityRank; + } + + public void setCityRank(Integer cityRank) { + this.cityRank = cityRank; + } + + @Column(name = "city_total_rank") + public Integer getCityTotalRank() { + return cityTotalRank; + } + + public void setCityTotalRank(Integer cityTotalRank) { + this.cityTotalRank = cityTotalRank; + } + + @Column(name = "region_rank") + public Integer getRegionRank() { + return regionRank; + } + + public void setRegionRank(Integer regionRank) { + this.regionRank = regionRank; + } + + @Column(name = "region_total_rank") + public Integer getRegionTotalRank() { + return regionTotalRank; + } + + public void setRegionTotalRank(Integer regionTotalRank) { + this.regionTotalRank = regionTotalRank; + } + + @Column(name = "block_total_rank") + public Integer getBlockTotalRank() { + return blockTotalRank; + } + + public void setBlockTotalRank(Integer blockTotalRank) { + this.blockTotalRank = blockTotalRank; + } + + @Column(name = "block_rank") + public Integer getBlockRank() { + return blockRank; + } + + public void setBlockRank(Integer blockRank) { + this.blockRank = blockRank; + } + + @Column(name = "city_community_quality_rank") + public Integer getCityCommunityQualityRank() { + return cityCommunityQualityRank; + } + + public void setCityCommunityQualityRank(Integer cityCommunityQualityRank) { + this.cityCommunityQualityRank = cityCommunityQualityRank; + } + + @Column(name = "city_community_quality_total_rank") + public Integer getCityCommunityQualityTotalRank() { + return cityCommunityQualityTotalRank; + } + + public void setCityCommunityQualityTotalRank(Integer cityCommunityQualityTotalRank) { + this.cityCommunityQualityTotalRank = cityCommunityQualityTotalRank; + } + + @Column(name = "region_community_quality_rank") + public Integer getRegionCommunityQualityRank() { + return regionCommunityQualityRank; + } + + public void setRegionCommunityQualityRank(Integer regionCommunityQualityRank) { + this.regionCommunityQualityRank = regionCommunityQualityRank; + } + + @Column(name = "region_community_quality_total_rank") + public Integer getRegionCommunityQualityTotalRank() { + return regionCommunityQualityTotalRank; + } + + public void setRegionCommunityQualityTotalRank(Integer regionCommunityQualityTotalRank) { + this.regionCommunityQualityTotalRank = regionCommunityQualityTotalRank; + } + + @Column(name = "block_community_quality_total_rank") + public Integer getBlockCommunityQualityTotalRank() { + return blockCommunityQualityTotalRank; + } + + public void setBlockCommunityQualityTotalRank(Integer blockCommunityQualityTotalRank) { + this.blockCommunityQualityTotalRank = blockCommunityQualityTotalRank; + } + + @Column(name = "block_community_quality_rank") + public Integer getBlockCommunityQualityRank() { + return blockCommunityQualityRank; + } + + public void setBlockCommunityQualityRank(Integer blockCommunityQualityRank) { + this.blockCommunityQualityRank = blockCommunityQualityRank; + } + + @Column(name = "city_community_price_rank") + public Integer getCityCommunityPriceRank() { + return cityCommunityPriceRank; + } + + public void setCityCommunityPriceRank(Integer cityCommunityPriceRank) { + this.cityCommunityPriceRank = cityCommunityPriceRank; + } + + @Column(name = "city_community_price_total_rank") + public Integer getCityCommunityPriceTotalRank() { + return cityCommunityPriceTotalRank; + } + + public void setCityCommunityPriceTotalRank(Integer cityCommunityPriceTotalRank) { + this.cityCommunityPriceTotalRank = cityCommunityPriceTotalRank; + } + + @Column(name = "region_community_price_rank") + public Integer getRegionCommunityPriceRank() { + return regionCommunityPriceRank; + } + + public void setRegionCommunityPriceRank(Integer regionCommunityPriceRank) { + this.regionCommunityPriceRank = regionCommunityPriceRank; + } + + @Column(name = "region_community_price_total_rank") + public Integer getRegionCommunityPriceTotalRank() { + return regionCommunityPriceTotalRank; + } + + public void setRegionCommunityPriceTotalRank(Integer regionCommunityPriceTotalRank) { + this.regionCommunityPriceTotalRank = regionCommunityPriceTotalRank; + } + + @Column(name = "block_community_price_total_rank") + public Integer getBlockCommunityPriceTotalRank() { + return blockCommunityPriceTotalRank; + } + + public void setBlockCommunityPriceTotalRank(Integer blockCommunityPriceTotalRank) { + this.blockCommunityPriceTotalRank = blockCommunityPriceTotalRank; + } + + @Column(name = "block_community_price_rank") + public Integer getBlockCommunityPriceRank() { + return blockCommunityPriceRank; + } + + public void setBlockCommunityPriceRank(Integer blockCommunityPriceRank) { + this.blockCommunityPriceRank = blockCommunityPriceRank; + } + + @Column(name = "city_location_advantage_rank") + public Integer getCityLocationAdvantageRank() { + return cityLocationAdvantageRank; + } + + public void setCityLocationAdvantageRank(Integer cityLocationAdvantageRank) { + this.cityLocationAdvantageRank = cityLocationAdvantageRank; + } + + @Column(name = "city_location_advantage_total_rank") + public Integer getCityLocationAdvantageTotalRank() { + return cityLocationAdvantageTotalRank; + } + + public void setCityLocationAdvantageTotalRank(Integer cityLocationAdvantageTotalRank) { + this.cityLocationAdvantageTotalRank = cityLocationAdvantageTotalRank; + } + + @Column(name = "region_location_advantage_rank") + public Integer getRegionLocationAdvantageRank() { + return regionLocationAdvantageRank; + } + + public void setRegionLocationAdvantageRank(Integer regionLocationAdvantageRank) { + this.regionLocationAdvantageRank = regionLocationAdvantageRank; + } + + @Column(name = "region_location_advantage_total_rank") + public Integer getRegionLocationAdvantageTotalRank() { + return regionLocationAdvantageTotalRank; + } + + public void setRegionLocationAdvantageTotalRank(Integer regionLocationAdvantageTotalRank) { + this.regionLocationAdvantageTotalRank = regionLocationAdvantageTotalRank; + } + + @Column(name = "block_location_advantage_total_rank") + public Integer getBlockLocationAdvantageTotalRank() { + return blockLocationAdvantageTotalRank; + } + + public void setBlockLocationAdvantageTotalRank(Integer blockLocationAdvantageTotalRank) { + this.blockLocationAdvantageTotalRank = blockLocationAdvantageTotalRank; + } + + @Column(name = "block_location_advantage_rank") + public Integer getBlockLocationAdvantageRank() { + return blockLocationAdvantageRank; + } + + public void setBlockLocationAdvantageRank(Integer blockLocationAdvantageRank) { + this.blockLocationAdvantageRank = blockLocationAdvantageRank; + } + + @Column(name = "city_flowability_rank") + public Integer getCityFlowabilityRank() { + return cityFlowabilityRank; + } + + public void setCityFlowabilityRank(Integer cityFlowabilityRank) { + this.cityFlowabilityRank = cityFlowabilityRank; + } + + @Column(name = "city_flowability_total_rank") + public Integer getCityFlowabilityTotalRank() { + return cityFlowabilityTotalRank; + } + + public void setCityFlowabilityTotalRank(Integer cityFlowabilityTotalRank) { + this.cityFlowabilityTotalRank = cityFlowabilityTotalRank; + } + + @Column(name = "region_flowability_rank") + public Integer getRegionFlowabilityRank() { + return regionFlowabilityRank; + } + + public void setRegionFlowabilityRank(Integer regionFlowabilityRank) { + this.regionFlowabilityRank = regionFlowabilityRank; + } + + @Column(name = "region_flowability_total_rank") + public Integer getRegionFlowabilityTotalRank() { + return regionFlowabilityTotalRank; + } + + public void setRegionFlowabilityTotalRank(Integer regionFlowabilityTotalRank) { + this.regionFlowabilityTotalRank = regionFlowabilityTotalRank; + } + + @Column(name = "block_flowability_total_rank") + public Integer getBlockFlowabilityTotalRank() { + return blockFlowabilityTotalRank; + } + + public void setBlockFlowabilityTotalRank(Integer blockFlowabilityTotalRank) { + this.blockFlowabilityTotalRank = blockFlowabilityTotalRank; + } + + @Column(name = "block_flowability_rank") + public Integer getBlockFlowabilityRank() { + return blockFlowabilityRank; + } + + public void setBlockFlowabilityRank(Integer blockFlowabilityRank) { + this.blockFlowabilityRank = blockFlowabilityRank; + } + + @Column(name = "city_living_facilities_rank") + public Integer getCityLivingFacilitiesRank() { + return cityLivingFacilitiesRank; + } + + public void setCityLivingFacilitiesRank(Integer cityLivingFacilitiesRank) { + this.cityLivingFacilitiesRank = cityLivingFacilitiesRank; + } + + @Column(name = "city_living_facilities_total_rank") + public Integer getCityLivingFacilitiesTotalRank() { + return cityLivingFacilitiesTotalRank; + } + + public void setCityLivingFacilitiesTotalRank(Integer cityLivingFacilitiesTotalRank) { + this.cityLivingFacilitiesTotalRank = cityLivingFacilitiesTotalRank; + } + + @Column(name = "region_living_facilities_rank") + public Integer getRegionLivingFacilitiesRank() { + return regionLivingFacilitiesRank; + } + + public void setRegionLivingFacilitiesRank(Integer regionLivingFacilitiesRank) { + this.regionLivingFacilitiesRank = regionLivingFacilitiesRank; + } + + @Column(name = "region_living_facilities_total_rank") + public Integer getRegionLivingFacilitiesTotalRank() { + return regionLivingFacilitiesTotalRank; + } + + public void setRegionLivingFacilitiesTotalRank(Integer regionLivingFacilitiesTotalRank) { + this.regionLivingFacilitiesTotalRank = regionLivingFacilitiesTotalRank; + } + + @Column(name = "block_living_facilities_total_rank") + public Integer getBlockLivingFacilitiesTotalRank() { + return blockLivingFacilitiesTotalRank; + } + + public void setBlockLivingFacilitiesTotalRank(Integer blockLivingFacilitiesTotalRank) { + this.blockLivingFacilitiesTotalRank = blockLivingFacilitiesTotalRank; + } + + @Column(name = "block_living_facilities_rank") + public Integer getBlockLivingFacilitiesRank() { + return blockLivingFacilitiesRank; + } + + public void setBlockLivingFacilitiesRank(Integer blockLivingFacilitiesRank) { + this.blockLivingFacilitiesRank = blockLivingFacilitiesRank; + } + + @Column(name = "city_education_rank") + public Integer getCityEducationRank() { + return cityEducationRank; + } + + public void setCityEducationRank(Integer cityEducationRank) { + this.cityEducationRank = cityEducationRank; + } + + @Column(name = "city_education_total_rank") + public Integer getCityEducationTotalRank() { + return cityEducationTotalRank; + } + + public void setCityEducationTotalRank(Integer cityEducationTotalRank) { + this.cityEducationTotalRank = cityEducationTotalRank; + } + + @Column(name = "region_education_rank") + public Integer getRegionEducationRank() { + return regionEducationRank; + } + + public void setRegionEducationRank(Integer regionEducationRank) { + this.regionEducationRank = regionEducationRank; + } + + @Column(name = "region_education_total_rank") + public Integer getRegionEducationTotalRank() { + return regionEducationTotalRank; + } + + public void setRegionEducationTotalRank(Integer regionEducationTotalRank) { + this.regionEducationTotalRank = regionEducationTotalRank; + } + + @Column(name = "block_education_total_rank") + public Integer getBlockEducationTotalRank() { + return blockEducationTotalRank; + } + + public void setBlockEducationTotalRank(Integer blockEducationTotalRank) { + this.blockEducationTotalRank = blockEducationTotalRank; + } + + @Column(name = "block_education_rank") + public Integer getBlockEducationRank() { + return blockEducationRank; + } + + public void setBlockEducationRank(Integer blockEducationRank) { + this.blockEducationRank = blockEducationRank; + } + + @Column(name = "city_hospital_rank") + public Integer getCityHospitalRank() { + return cityHospitalRank; + } + + public void setCityHospitalRank(Integer cityHospitalRank) { + this.cityHospitalRank = cityHospitalRank; + } + + @Column(name = "city_hospital_total_rank") + public Integer getCityHospitalTotalRank() { + return cityHospitalTotalRank; + } + + public void setCityHospitalTotalRank(Integer cityHospitalTotalRank) { + this.cityHospitalTotalRank = cityHospitalTotalRank; + } + + @Column(name = "region_hospital_rank") + public Integer getRegionHospitalRank() { + return regionHospitalRank; + } + + public void setRegionHospitalRank(Integer regionHospitalRank) { + this.regionHospitalRank = regionHospitalRank; + } + + @Column(name = "region_hospital_total_rank") + public Integer getRegionHospitalTotalRank() { + return regionHospitalTotalRank; + } + + public void setRegionHospitalTotalRank(Integer regionHospitalTotalRank) { + this.regionHospitalTotalRank = regionHospitalTotalRank; + } + + @Column(name = "block_hospital_total_rank") + public Integer getBlockHospitalTotalRank() { + return blockHospitalTotalRank; + } + + public void setBlockHospitalTotalRank(Integer blockHospitalTotalRank) { + this.blockHospitalTotalRank = blockHospitalTotalRank; + } + + @Column(name = "block_hospital_rank") + public Integer getBlockHospitalRank() { + return blockHospitalRank; + } + + public void setBlockHospitalRank(Integer blockHospitalRank) { + this.blockHospitalRank = blockHospitalRank; + } + + @Column(name = "m_date") + public Date getMDate() { + return mDate; + } + + public void setMDate(Date mDate) { + this.mDate = mDate; + } + + @Column(name = "c_date") + public Date getCDate() { + return cDate; + } + + public void setCDate(Date cDate) { + this.cDate = cDate; + } + +} \ No newline at end of file diff --git a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddressController.java b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddressController.java index 777f96d9a..9476c2382 100644 --- a/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddressController.java +++ b/projects/fangjia-open/src/main/java/com/fangjia/open/controllers/AddressController.java @@ -1,7 +1,11 @@ package com.fangjia.open.controllers; import com.fangjia.core.util.*; +import com.fangjia.dal.mongo.model.*; import com.fangjia.open.model.*; +import com.fangjia.service.address.mode.Address; +import com.fangjia.service.datastore.CommunityRateService; +import com.sun.xml.bind.v2.TODO; import net.sf.json.JSONArray; import net.sf.json.JSONObject; @@ -25,10 +29,6 @@ import com.fangjia.dal.SrQuery; import com.fangjia.dal.common.DistrictKey; import com.fangjia.dal.common.ServerAreaData; import com.fangjia.dal.mongo.fangjia.model.ServerArea; -import com.fangjia.dal.mongo.model.AddressCheck; -import com.fangjia.dal.mongo.model.CommData; -import com.fangjia.dal.mongo.model.Evaluation; -import com.fangjia.dal.mongo.model.RegionBlock; import com.fangjia.dal.mongo.open.model.WaitCrawlKeywords; import com.fangjia.dal.seaweed.model.District; import com.fangjia.open.APIConstant; @@ -96,6 +96,7 @@ public class AddressController { private HouseLoudongService houseLoudongService; private FjtEvaluationService fjtEvaluationService; private AddressMatchProxyService addressMatchProxyService; + private CommunityRateService communityRateService; private final static String AK = OpenConfig.getConfig().getBaiduAk(); private final static Logger LOGGER = LoggerFactory.getLogger(AddressController.class); @@ -2141,48 +2142,55 @@ public class AddressController { * @param model * @return */ - public Object propertyRatingAction(CommunitySummaryRequestDto model) { - + public Object propertyRatingAction(CommunitySummaryRequestDto model){ + // type:all 输出所有字段,否则只输出文档中的字段 RestfulModelAndView mav = new RestfulModelAndView(); - if (StringUtils.isBlank(model.getAddress()) && StringUtils.isBlank(model.getId())) { - mav.setModel(BasicModel.buildBadRequestModel("小区ID或地址不能为空")); - return mav; + BasicModel resultModel = new BasicModel(HttpStatusCodeEnum.OK); + String city = model.getCity(); + String address = model.getAddress(); + String id = model.getId(); + // 借用原有字段 memo :备注 当 memo 为all的时候输出全部字段,默认输出文档中的字段 + String memo = model.getMemo(); + + //TODO 根据城市和地址查询 + if ((StringUtils.isBlank(city) && StringUtils.isBlank(address) || StringUtils.isBlank(id))) { + mav.setModel(BasicModel.buildBadRequestModel("需要小区ID或者城市+地址参数组合")); } - - HttpRequest request = new HttpRequest(); - JSONObject json = null; - try { - Map headers = new HashMap(); - headers.put("Content-Type", "application/json"); - - JSONObject reqBody = new JSONObject(); - reqBody.put("city", model.getCity()); - reqBody.put("address", model.getAddress()); - reqBody.put("id", model.getId()); - String result = request.postWithBody("http://192.168.0.100:32080/FangJiaAddressService/propertyRating", reqBody, headers, "UTF-8"); - if (result != null) { - try { - json = JSONObject.fromObject(result); - } catch (Exception e) { - json = null; + if (StringUtils.isNotBlank(id)) { + CommunityRate communityRate = communityRateService.findBySeeweadId(id); + if (communityRate != null) { + if ("all".equals(memo)) { + // 为all的时候输出全部字段 + resultModel.setResult(communityRate); + }else { + // 默认输出文档中的字段 + CommunityRate communityRateResult = new CommunityRate(); + communityRateResult.setCity(communityRate.getCity()); + communityRateResult.setAddress(communityRate.getAddress()); + communityRateResult.setName(communityRate.getName()); + communityRateResult.setRating(communityRate.getRating()); + communityRateResult.setTotalScore(communityRate.getTotalScore()); + communityRateResult.setCommunityQualityRating(communityRate.getCommunityQualityRating()); + communityRateResult.setCommunityQualityScore(communityRate.getCommunityQualityScore()); + communityRateResult.setCommunityPriceRating(communityRate.getCommunityPriceRating()); + communityRateResult.setCommunityPriceScore(communityRate.getCommunityPriceScore()); + communityRateResult.setLocationAdvantageRating(communityRate.getLocationAdvantageRating()); + communityRateResult.setLocationAdvantageScore(communityRate.getLocationAdvantageScore()); + communityRateResult.setFlowabilityRating(communityRate.getFlowabilityRating()); + communityRateResult.setFlowabilityScore(communityRate.getFlowabilityScore()); + communityRateResult.setLivingFacilitiesRating(communityRate.getLivingFacilitiesRating()); + communityRateResult.setLivingFacilitiesScore(communityRate.getLivingFacilitiesScore()); + communityRateResult.setEducationRating(communityRate.getEducationRating()); + communityRateResult.setEducationScore(communityRate.getEducationScore()); + communityRateResult.setHospitalRating(communityRate.getHospitalRating()); + communityRateResult.setHospitalScore(communityRate.getHospitalScore()); + resultModel.setResult(communityRateResult); } } - } catch (Exception e) { - e.printStackTrace(); - } - - if (json != null) { - int code = json.getInt("status"); - String msg = json.getString("msg"); - BasicModel basicModel = new BasicModel(code, msg); - if (json.containsKey("result")) { - basicModel.setResult(json.get("result")); - } - mav.setModel(basicModel); - } else { - mav.setModel(BasicModel.buildServerErrorModel().setMsg("服务升级中...")); } + mav.setModel(resultModel); return mav; + } /** @@ -3455,6 +3463,7 @@ public class AddressController { return Collections.emptyList(); } + public void setAddressService(AddressService addressService) { this.addressService = addressService; } @@ -3510,4 +3519,8 @@ public class AddressController { public void setAddressMatchProxyService(AddressMatchProxyService addressMatchProxyService) { this.addressMatchProxyService = addressMatchProxyService; } + + public void setCommunityRateService(CommunityRateService communityRateService) { + this.communityRateService = communityRateService; + } } diff --git a/projects/fangjia-service/src/main/java/com/fangjia/service/datastore/CommunityRateService.java b/projects/fangjia-service/src/main/java/com/fangjia/service/datastore/CommunityRateService.java new file mode 100644 index 000000000..ea5f119a7 --- /dev/null +++ b/projects/fangjia-service/src/main/java/com/fangjia/service/datastore/CommunityRateService.java @@ -0,0 +1,9 @@ +package com.fangjia.service.datastore; + +import com.fangjia.dal.mongo.model.CommunityRate; + +public interface CommunityRateService { + CommunityRate findById(String id); + + CommunityRate findBySeeweadId(String id); +} diff --git a/projects/fangjia-service/src/main/java/com/fangjia/service/datastore/CommunityRateServiceImpl.java b/projects/fangjia-service/src/main/java/com/fangjia/service/datastore/CommunityRateServiceImpl.java new file mode 100644 index 000000000..23606f4a8 --- /dev/null +++ b/projects/fangjia-service/src/main/java/com/fangjia/service/datastore/CommunityRateServiceImpl.java @@ -0,0 +1,32 @@ +package com.fangjia.service.datastore; + +import com.fangjia.dal.QueryParam; +import com.fangjia.dal.mongo.dao.CommunityRateDao; +import com.fangjia.dal.mongo.model.CommunityRate; + +import java.util.ArrayList; +import java.util.List; + +public class CommunityRateServiceImpl implements CommunityRateService { + private CommunityRateDao communityRateDao; + + @Override + public CommunityRate findById(String id) { + return communityRateDao.findById(id); + } + + @Override + public CommunityRate findBySeeweadId(String id) { + ArrayList params = new ArrayList(); + params.add(new QueryParam("commId", id)); + List communityRateList = communityRateDao.findAllByParams(params); + if (communityRateList != null && !communityRateList.isEmpty()) { + return communityRateList.get(0); + } + return null; + } + + public void setCommunityRateDao(CommunityRateDao communityRateDao) { + this.communityRateDao = communityRateDao; + } +}