Merge remote-tracking branch 'origin/master'

# Conflicts:
#	projects/fangjia-open/src/main/java/com/fangjia/open/controllers/HouseController.java
This commit is contained in:
2026-01-13 16:29:24 +08:00
151 changed files with 5602 additions and 432 deletions
+22 -16
View File
@@ -1,5 +1,5 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.fangjia</groupId>
<artifactId>fangjia-core</artifactId>
@@ -17,8 +17,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<source>8</source>
<target>8</target>
<encoding>GBK</encoding>
</configuration>
</plugin>
@@ -105,15 +105,15 @@
<version>3.5.0</version>
</dependency>
<dependency>
<groupId>net.sourceforge.pinyin4j</groupId>
<artifactId>pinyin4j</artifactId>
<version>2.5.0</version>
<groupId>net.sourceforge.pinyin4j</groupId>
<artifactId>pinyin4j</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j</artifactId>
<version>3.4.4</version>
</dependency>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j</artifactId>
<version>3.4.4</version>
</dependency>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
@@ -124,7 +124,7 @@
<artifactId>commons-beanutils</artifactId>
<version>1.8.3</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
@@ -155,11 +155,11 @@
<artifactId>hanlp</artifactId>
<version>portable-1.6.6</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>com.alibaba.nacos</groupId>
<artifactId>nacos-client</artifactId>
@@ -170,5 +170,11 @@
<artifactId>json</artifactId>
<version>RELEASE</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.20</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
@@ -0,0 +1,82 @@
package com.fangjia.core.util;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
@Data
public class PriceData {
private String yearmonth;
private Double price;
private Double volume; // ÐÂÔö³É½»Á¿×Ö¶Î
public PriceData() {}
public PriceData(String yearmonth, Double price) {
this.yearmonth = yearmonth;
this.price = price;
}
public PriceData(String yearmonth, Double price, Double volume) {
this.yearmonth = yearmonth;
this.price = price;
this.volume = volume;
}
public static List<PriceData> getSampleData() {
List<PriceData> data = new ArrayList<>();
double basePrice = 22000;
double minPrice = basePrice * (1 - 0.04);
double maxPrice = basePrice * (1 + 0.04);
Random random = new Random();
for (int i = 0; i < 2; i++) {
int year = 2024;
int month = i + 4;
if (month > 12) {
year++;
month -= 12;
}
String date = String.format("%d-%02d", year, month);
double price = minPrice + random.nextDouble() * (maxPrice - minPrice);
double volume = 100 + random.nextInt(100);
data.add(new PriceData(date, price, volume));
System.out.println(data.get(i));
}
return data;
}
public static List<PriceData> getSampleData(double basePrice) {
List<PriceData> data = new ArrayList<>();
double minPrice = basePrice * (1 - 0.02);
double maxPrice = basePrice * (1 + 0.02);
Random random = new Random();
for (int i = 0; i < 12; i++) {
int year = 2025;
int month = i + 1;
if (month > 12) {
year++;
month -= 12;
}
String date = String.format("%d-%02d", year, month);
double price = minPrice + random.nextDouble() * (maxPrice - minPrice);
double volume = 100 + random.nextInt(200);
data.add(new PriceData(date, price, volume));
System.out.println(data.get(i));
}
return data;
}
public static List<PriceData> getSampleData2() {
List<PriceData> data = new ArrayList<>();
data.add(new PriceData("2025-01", 11110.0, 90.0));
data.add(new PriceData("2025-02", 11115.0, 110.0));
data.add(new PriceData("2025-03", 11112.0, 95.0));
data.add(new PriceData("2025-04", 11120.0, 150.0));
data.add(new PriceData("2025-05", 11118.0, 140.0));
return data;
}
}
@@ -0,0 +1,49 @@
package com.fangjia.core.util;
import lombok.Builder;
import lombok.Data;
import java.util.List;
/**
* @author shenjian
* @since 2024/12/17
*/
@Data
public class PriceDto {
private Integer id;
private Integer avgPrice;//本周均价
private PriceTrend priceTrend; //均价走势
private List<RentPrice> rentPrices;//本月租金
private PriceTrend rentTrend;//租金走势
@Data
@Builder
public static class RentPrice {
private String name;
private Integer price;
}
@Data
public static class PriceTrend {
private List<String> categories;
private List<Series> series;
private List<DoubleSeries> doubleSeries;
}
@Data
public static class Series {
private String name;
private List<Integer> data;
}
@Data
public static class DoubleSeries {
private String name;
private List<Double> data;
}
}
@@ -0,0 +1,316 @@
package com.fangjia.core.util;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
/**
* SVG工具类,用于生成价格趋势的SVG图表
*/
public class SvgUtils {
// SVG画布尺寸
private static final int WIDTH = 800;
private static final int HEIGHT = 500;
private static final int PADDING = 60;
// 生成SVG折线图(支持多条线),新增decimalPlaces参数控制Y轴小数位
public static String generatePriceTrendSvg(List<List<PriceData>> dataSets, List<String> labels, String title, String subtitle, int decimalPlaces) {
if (dataSets.isEmpty() || dataSets.get(0).isEmpty()) {
return "<svg xmlns='http://www.w3.org/2000/svg' width='" + WIDTH + "' height='" + HEIGHT + "'></svg>";
}
// 过滤为空的数据
dataSets = dataSets.stream()
.map(innerList -> innerList.stream()
.filter(priceData -> priceData != null && priceData.getPrice() != null)
.collect(Collectors.toList()))
.collect(Collectors.toList());
// 计算价格和时间的范围
double minPrice = dataSets.stream()
.flatMap(List::stream)
.filter((p) -> p != null && p.getPrice() != null)
.mapToDouble(PriceData::getPrice)
.min()
.orElse(0) * 0.8;
double maxPrice = dataSets.stream()
.flatMap(List::stream)
.filter((p) -> p != null && p.getPrice() != null)
.mapToDouble(PriceData::getPrice)
.max()
.orElse(1) * 1.2;
double buffer = 0.1;
minPrice = minPrice * (1 - buffer);
maxPrice = maxPrice * (1 + buffer);
// 如果decimalPlaces为0,调整minPrice和maxPrice为整数等差
// if (decimalPlaces == 0) {
// long step = calculateStep((long) Math.ceil(maxPrice) - (long) Math.floor(minPrice));
// minPrice = Math.floor(minPrice / step) * step;
// maxPrice = Math.ceil(maxPrice / step) * step;
// }
// 解析最小和最大日期
String minYearMonth = dataSets.stream()
.flatMap(List::stream)
.map(PriceData::getYearmonth)
.min(String::compareTo)
.orElse("2024-08");
String maxYearMonth = dataSets.stream()
.flatMap(List::stream)
.map(PriceData::getYearmonth)
.max(String::compareTo)
.orElse("2025-01");
// 构建SVG内容
StringBuilder svg = new StringBuilder();
svg.append(String.format("<svg xmlns='http://www.w3.org/2000/svg' width='%d' height='%d'>", WIDTH, HEIGHT));
svg.append(String.format("<rect width='%d' height='%d' fill='#ffffff'/>", WIDTH, HEIGHT));
// 添加标题和副标题
svg.append(String.format("<text x='%d' y='%d' font-size='20' font-family='Arial' fill='#333333' font-weight='bold' text-anchor='middle'>%s</text>",
WIDTH / 2, 30, title));
svg.append(String.format("<text x='%d' y='%d' font-size='14' font-family='Arial' fill='#666666' text-anchor='middle'>%s</text>",
WIDTH / 2, 50, subtitle));
// 画虚线网格线和坐标轴
svg.append(drawGrid(minYearMonth, maxYearMonth, minPrice, maxPrice, decimalPlaces));
svg.append(drawAxis(minYearMonth, maxYearMonth, minPrice, maxPrice, decimalPlaces));
// 画多条折线和图例
String[] colors = {"#66B3FF", "#FF6666", "#FFA500", "#8A2BE2"};
for (int i = 0; i < dataSets.size(); i++) {
svg.append(drawSmoothLine(dataSets.get(i), minYearMonth, maxYearMonth, minPrice, maxPrice, colors[i % colors.length], decimalPlaces));
svg.append(String.format("<rect x='%d' y='%d' width='10' height='10' fill='%s'/>", 650, 60 + i * 20, colors[i % colors.length]));
svg.append(String.format("<text x='%d' y='%d' font-size='12' fill='#333333'>%s</text>", 670, 70 + i * 20, labels.get(i)));
}
svg.append("</svg>");
return svg.toString();
}
// 绘制平滑折线
private static String drawSmoothLine(List<PriceData> data, String minYearMonth, String maxYearMonth, double minPrice, double maxPrice, String color, int decimalPlaces) {
// if (data.size() < 2) return "";
StringBuilder path = new StringBuilder("<path d='M");
StringBuilder pointsAndLabels = new StringBuilder();
int totalMonths = getMonthIndex(maxYearMonth) - getMonthIndex(minYearMonth) + 1;
if (data.size() == 1) {
// 处理只有一个数据点的情况
PriceData point = data.get(0);
int monthIndex = Math.max(0, Math.min(totalMonths - 1, getMonthIndex(point.getYearmonth()) - getMonthIndex(minYearMonth)));
int x = WIDTH / 2;
int y = HEIGHT - PADDING - (HEIGHT - 2 * PADDING) / 2;
// int y = HEIGHT - PADDING - (int) ((point.getPrice() - minPrice) * (HEIGHT - 2 * PADDING) / (maxPrice - minPrice));
pointsAndLabels.append(String.format("<circle cx='%d' cy='%d' r='3' fill='%s'/>", x, y, color));
pointsAndLabels.append(String.format("<text x='%d' y='%d' font-size='10' fill='%s'>%." + decimalPlaces + "f</text>",
x + 5, y - 5, color, point.getPrice()));
path.append("M").append(x).append(",").append(y);
} else if (data.size() > 1) {
for (int i = 0; i < data.size() - 1; i++) {
PriceData point1 = data.get(i);
PriceData point2 = data.get(i + 1);
int monthIndex1 = Math.max(0, Math.min(totalMonths - 1, getMonthIndex(point1.getYearmonth()) - getMonthIndex(minYearMonth)));
int monthIndex2 = Math.max(0, Math.min(totalMonths - 1, getMonthIndex(point2.getYearmonth()) - getMonthIndex(minYearMonth)));
int x1 = PADDING + (monthIndex1 * (WIDTH - 2 * PADDING) / (totalMonths - 1));
int y1 = HEIGHT - PADDING - (int) ((point1.getPrice() - minPrice) * (HEIGHT - 2 * PADDING) / (maxPrice - minPrice));
int x2 = PADDING + (monthIndex2 * (WIDTH - 2 * PADDING) / (totalMonths - 1));
int y2 = HEIGHT - PADDING - (int) ((point2.getPrice() - minPrice) * (HEIGHT - 2 * PADDING) / (maxPrice - minPrice));
int controlX1 = x1 + (x2 - x1) / 3;
int controlY1 = y1;
int controlX2 = x2 - (x2 - x1) / 3;
int controlY2 = y2;
if (i == 0) path.append(x1).append(",").append(y1);
path.append(" C").append(controlX1).append(",").append(controlY1).append(" ").append(controlX2).append(",").append(controlY2).append(" ").append(x2).append(",").append(y2);
pointsAndLabels.append(String.format("<circle cx='%d' cy='%d' r='3' fill='%s'/>", x1, y1, color));
pointsAndLabels.append(String.format("<text x='%d' y='%d' font-size='10' fill='%s'>%." + decimalPlaces + "f</text>",
x1 + 5, y1 - 5, color, point1.getPrice()));
}
PriceData lastPoint = data.get(data.size() - 1);
int lastMonthIndex = Math.max(0, Math.min(totalMonths - 1, getMonthIndex(lastPoint.getYearmonth()) - getMonthIndex(minYearMonth)));
int lastX = PADDING + (lastMonthIndex * (WIDTH - 2 * PADDING) / (totalMonths - 1));
int lastY = HEIGHT - PADDING - (int) ((lastPoint.getPrice() - minPrice) * (HEIGHT - 2 * PADDING) / (maxPrice - minPrice));
pointsAndLabels.append(String.format("<circle cx='%d' cy='%d' r='3' fill='%s'/>", lastX, lastY, color));
pointsAndLabels.append(String.format("<text x='%d' y='%d' font-size='10' fill='%s'>%." + decimalPlaces + "f</text>",
lastX + 5, lastY - 5, color, lastPoint.getPrice()));
}
path.append("' fill='none' stroke='").append(color).append("' stroke-width='2'/>");
path.append(pointsAndLabels);
return path.toString();
}
// 绘制网格线
private static String drawGrid(String minYearMonth, String maxYearMonth, double minPrice, double maxPrice, int decimalPlaces) {
StringBuilder grid = new StringBuilder();
double step = calculateYStep(minPrice, maxPrice, decimalPlaces);
int numSteps = (int) ((maxPrice - minPrice) / step) + 1;
for (int i = 0; i < numSteps; i++) {
double price = minPrice + i * step;
if (price > maxPrice) break;
int y = HEIGHT - PADDING - (int) ((price - minPrice) * (HEIGHT - 2 * PADDING) / (maxPrice - minPrice));
grid.append(String.format("<line x1='%d' y1='%d' x2='%d' y2='%d' stroke='#e0e0e0' stroke-dasharray='5,5'/>",
PADDING, y, WIDTH - PADDING, y));
}
return grid.toString();
}
// 绘制坐标轴
private static String drawAxis(String minYearMonth, String maxYearMonth, double minPrice, double maxPrice, int decimalPlaces) {
StringBuilder axis = new StringBuilder();
// X轴
axis.append(String.format("<line x1='%d' y1='%d' x2='%d' y2='%d' stroke='#333333' stroke-width='2'/>",
PADDING, HEIGHT - PADDING, WIDTH - PADDING, HEIGHT - PADDING));
axis.append(String.format("<line x1='%d' y1='%d' x2='%d' y2='%d' stroke='#333333' stroke-width='2'/>",
PADDING, PADDING, PADDING, HEIGHT - PADDING));
// X轴刻度
int totalMonths = getMonthIndex(maxYearMonth) - getMonthIndex(minYearMonth) + 1;
for (int i = 0; i < totalMonths; i++) {
int x;
if (totalMonths == 1) {
// 当只有一个月时,将刻度放在中间位置
x = PADDING + (WIDTH - 2 * PADDING) / 2;
} else {
x = PADDING + i * (WIDTH - 2 * PADDING) / (totalMonths - 1);
}
String monthLabel = getMonthLabel(minYearMonth, i);
axis.append(String.format("<line x1='%d' y1='%d' x2='%d' y2='%d' stroke='#333333' stroke-width='1'/>",
x, HEIGHT - PADDING + 5, x, HEIGHT - PADDING));
axis.append(String.format("<text x='%d' y='%d' font-size='12' fill='#333333' text-anchor='middle'>%s</text>",
x, HEIGHT - PADDING + 20, monthLabel));
}
// Y轴刻度
double step = calculateYStep(minPrice, maxPrice, decimalPlaces);
int numSteps = (int) ((maxPrice - minPrice) / step) + 1;
for (int i = 0; i < numSteps; i++) {
double price = minPrice + i * step;
int y = HEIGHT - PADDING - (int) ((price - minPrice) * (HEIGHT - 2 * PADDING) / (maxPrice - minPrice));
axis.append(String.format("<line x1='%d' y1='%d' x2='%d' y2='%d' stroke='#333333' stroke-width='1'/>",
PADDING - 5, y, PADDING, y));
axis.append(String.format("<text x='%d' y='%d' font-size='12' fill='#333333' text-anchor='end'>%." + decimalPlaces + "f</text>",
PADDING - 10, y + 5, price));
}
return axis.toString();
}
// 计算Y轴步长
private static double calculateYStep(double minPrice, double maxPrice, int decimalPlaces) {
double range = maxPrice - minPrice;
if (decimalPlaces == 0) {
return calculateStep((long) range);
}
double step = range / 10.0; // 默认10个间隔
double scale = Math.pow(10, decimalPlaces);
return Math.round(step * scale) / scale;
}
// 计算整数步长
private static long calculateStep(long range) {
long step = (long) Math.pow(10, Math.floor(Math.log10(range)));
if (range / step < 4) step /= 2;
else if (range / step > 8) step *= 2;
return step;
}
// 获取月份标签和索引(保持不变)
private static String getMonthLabel(String minYearMonth, int offset) {
int totalMonths = getMonthIndex(minYearMonth);
int targetMonthIndex = totalMonths + offset;
int year = 2024 + targetMonthIndex / 12;
int month = targetMonthIndex % 12 + 1;
return String.format("%d-%02d", year, month);
}
private static int getMonthIndex(String yearMonth) {
int year = Integer.parseInt(yearMonth.substring(0, 4));
int month = Integer.parseInt(yearMonth.substring(5));
return (year - 2024) * 12 + (month - 1);
}
public static void generateSvg(String svgContent, String outputPath) {
try (FileWriter writer = new FileWriter(outputPath)) {
writer.write(svgContent);
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* 对齐已有系列数据与新的时间轴
*/
public static void alignSeriesData(List<String> newCategories, List<PriceDto.DoubleSeries> series, PriceDto.PriceTrend rentTrend) {
for (PriceDto.DoubleSeries s : series) {
List<Double> originalData = s.getData();
List<String> originalCategories = new ArrayList<>(rentTrend.getCategories()); // 假设原始时间轴可从别处获取
List<Double> alignedData = new ArrayList<>();
// 根据新的时间轴对齐数据
for (String date : newCategories) {
int index = originalCategories.indexOf(date);
if (index >= 0 && index < originalData.size()) {
alignedData.add(originalData.get(index));
} else {
alignedData.add(null); // 日期不存在时补 null
}
}
s.setData(alignedData);
}
}
// 测试方法
public static void main(String[] args) {
List<PriceData> data1 = PriceData.getSampleData(5200);
List<List<PriceData>> dataSets = new ArrayList<>();
dataSets.add(data1);
String name = "新世纪大厦";
List<String> labels = Arrays.asList(name);
String title = "价格走势图";
String subtitle = "2024-12 至 2025-11";
// // 测试小数位为2
// String svgWithoutDecimals = generatePriceTrendSvg(dataSets, labels, title, subtitle, 2);
// System.out.println("With 2 decimal places:");
// System.out.println(svgWithoutDecimals);
// 测试小数位为0(整数等差)
String svgWithoutDecimals = generatePriceTrendSvg(dataSets, labels, title, subtitle, 0);
System.out.println("With 0 decimal places (integer steps):");
System.out.println(svgWithoutDecimals);
try {
generateSvg(svgWithoutDecimals, name + ".svg");
System.out.println("PNG image generated successfully at: price_trend.png");
} catch (Exception e) {
e.printStackTrace();
}
// String locationStr = "114.407048,30.481859";
// String[] location = locationStr.split(",");
// Double lng = Double.parseDouble(location[0]);
// Double lat = Double.parseDouble(location[1]);
// String mapUrl = "https://restapi.amap.com/v3/staticmap?location=" + lng + "," + lat
// + "&zoom=14&size=780*300&markers=mid,,A:" + lng + "," + lat
// + "&key=ee95e52bf08006f63fd29bcfbcf21df0";
// System.out.println(mapUrl);
}
}
@@ -573,9 +573,6 @@ public class SaleLeadsController {
System.out.println(mobile + " 验证码 【"+ code+"】");
//测试先去掉发短信
smsService.send(model.getMobile(), "【房价网】你的验证码是" + code + ",验证码5分钟内有效,请立即验证。");
if(FangjiaConfig.getConfig().isTestEnvironment()){
DingDingMessageUtil.sendTextMessage("【房价网】你的验证码是" + code + ",验证码5分钟内有效,请立即验证。");
}
resultModel.setResult(Message.RESULT_SUCCESS);
CacheUtils.putValue(CacheUtils.CachePolicyEnum.TINY, FangJiaUserService.class, mobile + "_" + type, code);
CacheUtils.putValue(CacheUtils.CachePolicyEnum.TINY, FangJiaUserService.class, mobile, new Date().getTime());
@@ -168,9 +168,6 @@ public class UserController {
String code = fangJiaUserService.randomCode();
try {
smsService.send(model.getMobile(), "【房价网】你的验证码是" + code + ",验证码5分钟内有效,请立即验证。");
if(FangjiaConfig.getConfig().isTestEnvironment()){
DingDingMessageUtil.sendTextMessage("【房价网】你的验证码是" + code + ",验证码5分钟内有效,请立即验证。");
}
smsSendLog = new SmsSendLog();
smsSendLog.setContent("【房价网】你的验证码是" + code + ",验证码5分钟内有效,请立即验证。");
smsSendLog.setMobile(model.getMobile());
@@ -520,9 +517,6 @@ public class UserController {
CacheUtils.putValue(CachePolicyEnum.TODAY, FangJiaUserService.class, ip, ipVisitCount+1);
smsService.send(model.getMobile(), "【房价网】你的验证码是" + code + ",验证码5分钟内有效,请立即验证。");
if(FangjiaConfig.getConfig().isTestEnvironment()){
DingDingMessageUtil.sendTextMessage("【房价网】你的验证码是" + code + ",验证码5分钟内有效,请立即验证。");
}
resultModel.setResult(Message.RESULT_SUCCESS);
CacheUtils.putValue(CachePolicyEnum.TINY, FangJiaUserService.class, mobile + "_" + type, code);
CacheUtils.putValue(CachePolicyEnum.TINY, FangJiaUserService.class, mobile, new Date().getTime());
@@ -28,12 +28,12 @@
<div class="right_content">
<div class="companyName">
<div>上海估家网络科技有限公司</div>
<div>咨询热线: <a>4001883787</a><br><span>(周一至周五 09:00-18:00)</span></div>
<div>咨询热线: <a>021-62393138</a><br><span>(周一至周五 09:00-18:00)</span></div>
</div>
<div class="companyInfo">
<div class="con1">
<p>上海总部</p>
<b>电&nbsp;&nbsp;话</b>: 4001883787(周一至周五 09:00-18:00)<br>
<b>电&nbsp;&nbsp;话</b>: 021-62393138(周一至周五 09:00-18:00)<br>
<b>邮&nbsp;&nbsp;箱</b>: <a href="mailto:gujia@fangjia.com">gujia@fangjia.com</a><br>
<b>地&nbsp;&nbsp;址</b>: 上海市长宁区协和路1033号文洋大厦B座10楼<br>
<b>邮&nbsp;&nbsp;编</b>: 200335<br><br>
@@ -63,7 +63,7 @@
</div>
<div class="content_right">
<span class="text1">免费体验请联系:</span>
<span class="text2">4001883787</span>
<span class="text2">021-62393138</span>
</div>
</div>
</div>
@@ -44,7 +44,7 @@
</form>
<button class="submit_btn" id="addressButton" type="button" style="margin-top:10px;">提交</button>
<p style="text-align:center;">您也可以直接联系商务,商务热线:4001883787</p>
<p style="text-align:center;">您也可以直接联系商务,商务热线:021-62393138</p>
</div>
</div>
@@ -61,7 +61,7 @@
<input type="button" id="filebutton" value="浏览">
</div>
<div class="group"><a class="download_btn">下载模板</a><a class="guideLink" href="<#if actionName=='fjindex'>fkdemo<#else>yxdemo</#if>"><img></a></div>
<span>单次免费批量分析100条上海地址数据,如需分析超过100条数据或测试其他城市请联系商务:4001883787</span>
<span>单次免费批量分析100条上海地址数据,如需分析超过100条数据或测试其他城市请联系商务:021-62393138</span>
<button class="submit_btn" type="button" onclick="fileChange($('#browsefile'));">提交</button>
</div>
</form>
@@ -72,7 +72,7 @@
<a ref="nofollow"><img src="${staticUrl}/images/wj110.png?v=${version}" height="47" border="0" /></a>
</p>
<p class="footer_text">
客服热线:4001883787 电子邮箱:gujia@fangjia.com
客服热线:021-62393138 电子邮箱:gujia@fangjia.com
<br />
©2006-${now?string("yyyy")} 估家网络 版权所有 <a href="http://www.shcaeg.gov.cn/main.action" target="_blank">沪B2-20130098</a>
<br/>
@@ -121,7 +121,7 @@
<div class="login_spread_title">信息提示<i class="close"></i></div>
<span></span>
<div class="login_spread_content">
您已免费测试/购买过接口,如需更多测试请联系商务:4001883787。
您已免费测试/购买过接口,如需更多测试请联系商务:021-62393138。
</div>
<span style="display: none" id="successMgs"></span>
</div>
@@ -86,7 +86,7 @@
<div class="login_spread_title">信息提示<i class="close"></i></div>
<span></span>
<div class="login_spread_content">
您已免费测试/购买过接口,如需更多测试请联系商务:4001883787。
您已免费测试/购买过接口,如需更多测试请联系商务:021-62393138。
</div>
<span style="display: none" id="successMgs"></span>
</div>
@@ -86,7 +86,7 @@
<div class="login_spread_title">信息提示<i class="close"></i></div>
<span></span>
<div class="login_spread_content">
您已免费测试/购买过接口,如需更多测试请联系商务:4001883787。
您已免费测试/购买过接口,如需更多测试请联系商务:021-62393138。
</div>
<span style="display: none" id="successMgs"></span>
</div>
@@ -84,7 +84,7 @@
<div class="login_spread_title">信息提示<i class="close"></i></div>
<span></span>
<div class="login_spread_content">
您已免费测试/购买过接口,如需更多测试请联系商务:4001883787。
您已免费测试/购买过接口,如需更多测试请联系商务:021-62393138。
</div>
<span style="display: none" id="successMgs"></span>
</div>
@@ -287,8 +287,8 @@
<a ref="nofollow" href="http://www.sgs.gov.cn/lz/licenseLink.do?method=licenceView&entyId=20120426105658696">
<div class="infoLeft"></div></a>
<div class="infoRight">
<span>前台总机:021-62393138</span><br>
<span>客服热线:4001883787</span><br>
<span>客服热线:021-62393138</span><br>
<#-- <span>客服热线:4001883787</span><br>-->
<a href="${cityUrl}/ershoufang">上海找房子</a><span>,</span><a href="${cityUrl}/gujia">估房价</a><span>,百度&nbsp;</span><a href="https://www.baidu.com">房价网</a><br>
<span>电子邮箱:gujia@fangjia.com</span>
</div>
@@ -86,7 +86,7 @@
<div class="login_spread_title">信息提示<i class="close"></i></div>
<span></span>
<div class="login_spread_content">
您已免费测试/购买过接口,如需更多测试请联系商务:4001883787。
您已免费测试/购买过接口,如需更多测试请联系商务:021-62393138。
</div>
<span style="display: none" id="successMgs"></span>
</div>
@@ -258,7 +258,7 @@
<a href="javascript:;" class="icon tel" title="客服电话"></a>
<div class="fixedNav01">
<i></i>
<p>400-188-3787</p>
<p>021-62393138</p>
<small>周一至周五 09:00-18:00</small>
<font></font>
</div>
@@ -40,7 +40,7 @@
1.<p>请立即登陆会员中心或注册新会员,否则将无法得到房豆及相应奖励</p><br/>
2.感谢您的参与,请耐心等待人工审核<br/>
3.在房价网会员中心的“用户中心”可查看任务审核进度、房豆数量<br/>
4.如有疑问,欢迎拨打客服热线4001883787
4.如有疑问,欢迎拨打客服热线021-62393138
</div>
</div>
</div>
@@ -140,7 +140,7 @@
<div class="index-box-small">
<div class="icon_bg"><div class="icon02"></div><label>业务咨询</label></div>
<div class="text">提供产品咨询与服务</div>
<div class="icon"><div class="icon03"></div><label>400 188 3787</label></div>
<div class="icon"><div class="icon03"></div><label>021-62393138</label></div>
<div class="text">(周一至周五 09:00-18:00)</div>
</div>
<div class="index-box-small">
@@ -159,7 +159,7 @@
<div class="index-box-small">
<div class="icon_bg"><div class="icon02"></div><label>业务咨询</label></div>
<div class="text">提供产品咨询与服务</div>
<div class="icon"><div class="icon03" style="width: 34px;height: 30px;"></div><label>400 188 3787</label></div>
<div class="icon"><div class="icon03" style="width: 34px;height: 30px;"></div><label>021-62393138</label></div>
<div class="text">(周一至周五 09:00-18:00)</div>
<div class="icon06" style="width: 100px;height: 100px;margin: 0 auto;"></div><label class="text_small">关注房价网公众微信号</label>
</div>
@@ -175,7 +175,7 @@
<div class="index-box-03 mobile01">
<div class="index-box-left">
<div class="icon_bg"><div class="icon08"></div><label>服务与合作</label></div>
<div class="text">地址:上海市静安区江宁路212号凯迪克大厦1709室</div>
<div class="text">地址:上海市长宁区金钟路658弄10号201-202室</div>
<div class="text">邮箱:gujia@fangjia.com</div>
<div class="text">邮编:200003</div>
</div>
@@ -37,7 +37,7 @@
<span>手&emsp;&emsp;机:</span>
<input type="text" name="failMobile" id="failMobile" />
</div>
<div class="line3">或直接拨打客服热线:4001883787</div>
<div class="line3">或直接拨打客服热线:021-62393138</div>
<div class="line4">(服务时间:周一至周五9:00-18:00)</div>
<div class="line5">
<a class="prev" id="__prev">上一步</a><a class="next" id="__next">提&emsp;交</a>
@@ -125,7 +125,7 @@
<a id="_sqSubmit">提&emsp;交</a>
</div>
<div class="line3">
申请提交后该机构客户经理会在24小时内主动联系您,请耐心等待。<br/>如有疑问请拨打客服热线:4001883787
申请提交后该机构客户经理会在24小时内主动联系您,请耐心等待。<br/>如有疑问请拨打客服热线:021-62393138
</div>
</div>
</div>
@@ -195,7 +195,7 @@ $(document).ready(function(){
function(data){
data = eval("(" + data + ")");
if(data.msg == 'OK') {
showAlert("感谢您的申请,该机构客户经理会尽快联系您,谢谢!<br/>客服热线:4001883787");
showAlert("感谢您的申请,该机构客户经理会尽快联系您,谢谢!<br/>客服热线:021-62393138");
$("#_sqForm").hide();
}else{
showAlert(data.msg);
@@ -85,7 +85,7 @@
</p>
<div class="footer_in por">
客服热线:4001883787 电子邮箱:gujia@fangjia.com
客服热线:021-62393138 电子邮箱:gujia@fangjia.com
<br />
©2006-${now?string("yyyy")} 房价网 版权所有 沪ICP备10203734号-1
</div>
@@ -65,7 +65,7 @@
<a class="user_btn" id="smslogin">登录</a>
<div class="line"><span>或</span></div>
<p class="link">新用户<a href="${wwwUrl}/user/register">注册</a></p>
<p class="note">如果您不是通过手机注册的用户,请直接致电客服找回密码<br>客服热线:4001883787</p>
<p class="note">如果您不是通过手机注册的用户,请直接致电客服找回密码<br>客服热线:021-62393138</p>
</div>
</div>
</div>
@@ -60,7 +60,7 @@
<img src="${staticUrl}/images/success01.png">
<p>您的申请已提交</p>
<p>稍后会有工作人员和您联系,请耐心等待!</p>
<p class="link">或是您可拨贷款咨询热线 <a>400-188-3787</a></p>
<p class="link">或是您可拨贷款咨询热线 <a>021-62393138</a></p>
<a class="user_btn confirm_btn" id="loan_sub">确认</a>
</div>
</div>
@@ -280,7 +280,7 @@
<div class="errBox01_content">
<div class="user">
<div class="content">
<p>如有商务合作需求,请填写您的信息,我们的客服人员会尽快与您取得联系。您也可以拨打<em>400-188-3787</em>(周一至周五9:00-18:00)与我们联系。</p>
<p>如有商务合作需求,请填写您的信息,我们的客服人员会尽快与您取得联系。您也可以拨打<em>021-62393138</em>(周一至周五9:00-18:00)与我们联系。</p>
<a class="user_btn login_btn" onclick="goApplyPage()" target="_blank">前往填写</a>
</div>
</div>
@@ -70,7 +70,7 @@
<a ref="nofollow"><img src="${staticUrl}/images/wj110.png?v=${version}" height="47" border="0" /></a>
</p>
<p class="footer_text">
客服热线:4001883787 电子邮箱:gujia@fangjia.com
客服热线:021-62393138 电子邮箱:gujia@fangjia.com
<br />
©2006-${now?string("yyyy")} 估家网络 版权所有 <a href="http://www.miitbeian.gov.cn/" target="_blank">沪ICP备10203734号-1</a>
<br/>
@@ -63,7 +63,7 @@
<p class="footer_text">
图片来源于网络,版权属于作者,请勿用于商业用途。<br/>
客服热线:4001883787 电子邮箱:gujia@fangjia.com
客服热线:021-62393138 电子邮箱:gujia@fangjia.com
<br />
©2006-${now?string("yyyy")} 估家网络 版权所有 <a href="http://www.shcaeg.gov.cn/main.action" target="_blank">沪B2-20130098</a>
<br/>
@@ -18,8 +18,8 @@
<a ref="nofollow" href="http://www.sgs.gov.cn/lz/licenseLink.do?method=licenceView&entyId=20120426105658696">
<div class="infoLeft"></div></a>
<div class="infoRight">
<span>前台总机:021-62393138</span><br>
<span>客服热线:4001883787</span><br>
<span>客服热线:021-62393138</span><br>
<#-- <span>客服热线:4001883787</span><br>-->
<a href="${_currentCityUrl}/ershoufang/">上海找房子</a><span>,</span><a href="${_currentCityUrl}/gujia/">估房价</a><span>,百度&nbsp;</span><a href="http://www.baidu.com/s?wd=%B7%BF%BC%DB%CD%F8">房价网</a><br>
<span>电子邮箱:gujia@fangjia.com</span>
</div>
@@ -18,8 +18,8 @@
<a ref="nofollow" href="http://www.sgs.gov.cn/lz/licenseLink.do?method=licenceView&entyId=20120426105658696">
<div class="infoLeft"></div></a>
<div class="infoRight">
<span>前台总机:021-62393138</span><br>
<span>客服热线:4001883787</span><br>
<#-- <span>前台总机:021-62393138</span><br>-->
<span>客服热线:021-62393138</span><br>
<a href="${_currentCityUrl}/ershoufang/">上海找房子</a><span>,</span><a href="${_currentCityUrl}/gujia/">估房价</a><span>,百度&nbsp;</span><a href="http://www.baidu.com/s?wd=%B7%BF%BC%DB%CD%F8">房价网</a><br>
<span>电子邮箱:gujia@fangjia.com</span>
</div>
@@ -193,7 +193,7 @@
<div class="d3">
请您填入准确信息,以便估价师能及时联络到您。<br/>
点击发送后,估价师将在24小时内主动联络您,请耐心等待,谢谢!<br/><br/>
客服热线:4001883787 (工作日9:00-18:00)
客服热线:021-62393138 (工作日9:00-18:00)
</div>
</div>
</div>
@@ -51,7 +51,7 @@
<li><a href="${_currentCityUrl}/about/" <#if controllerName == 'about'||(controllerName=='advisoryMore'&&resPage??&&resPage==2)>class="current"</#if>>关于我们</a></li>
</ul>
<ul class="hotline">
<li><a>咨询热线:<label>400-188-3787</label></a></li>
<li><a>咨询热线:<label>021-62393138</label></a></li>
</ul>
</div>
</div>
@@ -70,7 +70,7 @@
<a href="javascript:;" class="icon tel"></a>
<div class="fixedNav01">
<i></i>
<p>400-188-3787</p>
<p>021-62393138</p>
<small>周一至周五 09:00-18:00</small>
<font></font>
</div>
@@ -198,7 +198,7 @@
<a ref="nofollow" href="#"><img src="${staticUrl}/images/wlzx.png?v=${version}" height="47" border="0" /></a>
<a ref="nofollow" href="#"><img src="${staticUrl}/images/wj110.png?v=${version}" height="47" border="0" /></a>
</p>
<p class="copyrights">客服热线:4001883787 电子邮箱:gujia@fangjia.com<br />
<p class="copyrights">客服热线:021-62393138 电子邮箱:gujia@fangjia.com<br />
&copy;2006-${now?string("yyyy")} 房价网 版权所有 沪ICP备10203734号-1<br/>
<a class="grey9c" target="_blank" href="<@d_url schema="${citySchema}" uri="/sellHouseSearch/list" />"><#if (!serverAreaMap?exists && actionName == 'index')>${cityName}</#if>找房子</a>,<a class="grey9c" target="_blank" href="<@d_url uri="/evaluation/report" schema="${cityDomain}" />">估房价</a>,百度 <a class="grey9c" target="_blank" href="http://www.baidu.com/s?wd=%B7%BF%BC%DB%CD%F8">房价网</a>
</p>
@@ -46,7 +46,7 @@
</ul>
</div>
<div class="footer_right">
<p><b>400-188-3787</b></p>
<p><b>021-62393138</b></p>
<div>
<a class="wx" title="微信"><img src="${imgUrl}/images/fangjia/v5/footer_icon01.png" class="footer_icon01"><img src="${imgUrl}/images/fangjia/v5/wx.png" class="wxImg"></a>
<a href="http://weibo.com/fangjiawang" title="微博" target="_blank" rel="nofollow"><img src="${imgUrl}/images/fangjia/v5/footer_icon02.png" class="footer_icon02"></a>
@@ -66,7 +66,7 @@
<div class="footerM dn">
<div>
<div class="footer_top">
<p><b>400-188-3787</b></p>
<p><b>021-62393138</b></p>
</div>
<div class="footer_center01">
<div>
@@ -108,7 +108,7 @@
</a>
</div>
<div class="newfooter-li">
<a href="tel:4001883787" class="fu-btn" id="app-mobile-click">
<a href="tel:02162393138" class="fu-btn" id="app-mobile-click">
电话咨询
</a>
</div>
@@ -43,7 +43,7 @@
</ul>
</div>
<div class="footer_right">
<p><b>400-188-3787</b></p>
<p><b>021-62393138</b></p>
<div>
<a class="wx" title="微信"><img src="${imgUrl}/images/fangjia/v5/footer_icon01.png" class="footer_icon01"><img src="${imgUrl}/images/fangjia/v5/wx.png" class="wxImg"></a>
<a href="http://weibo.com/fangjiawang" title="微博" target="_blank" rel="nofollow"><img src="${imgUrl}/images/fangjia/v5/footer_icon02.png" class="footer_icon02"></a>
@@ -63,7 +63,7 @@
<div class="footerM dn">
<div>
<div class="footer_top">
<p><b>400-188-3787</b></p>
<p><b>021-62393138</b></p>
</div>
<div class="footer_center01">
<div>
@@ -10,7 +10,7 @@
<a href="javascript:;" class="icon tel" title="客服电话"></a>
<div class="fixedNav01">
<i></i>
<p>400-188-3787</p>
<p>021-62393138</p>
<small>周一至周五 09:00-18:00</small>
<font></font>
</div>
@@ -1443,7 +1443,7 @@
</ul>
</div>
<div class="footer_right">
<p><b>400-188-3787</b></p>
<p><b>021-62393138</b></p>
<div>
<a class="wx" title="微信"><i class="footer_icon01"></i><img src="images/wx.png"></a>
<a href="http://weibo.com/fangjiawang" title="微博" target="_blank" rel="nofollow"><i class="footer_icon02"></i></a>
@@ -1464,13 +1464,13 @@
<a href="javascript:scroll(0,0)" class="icon top" title="返回顶部"></a>
</li>
<li>
<a href="http://wpa.qq.com/msgrd?V=1&Uin=4001883787" class="icon qq" title="QQ联系"></a>
<a href="http://wpa.qq.com/msgrd?V=1&Uin=02162393138" class="icon qq" title="QQ联系"></a>
</li>
<li>
<a href="javascript:;" class="icon tel" title="客服电话"></a>
<div class="fixedNav01">
<i></i>
<p>400-188-3787</p>
<p>021-62393138</p>
<small>周一至周五 09:00-18:00</small>
<font></font>
</div>
@@ -43,7 +43,7 @@
</ul>
</div>
<div class="footer_right">
<p><b>400-188-3787</b></p>
<p><b>021-62393138</b></p>
<div>
<a class="wx" title="微信"><img src="${imgUrl}/images/fangjia/v5/footer_icon01.png" class="footer_icon01"><img src="${imgUrl}/images/fangjia/v5/wx.png" class="wxImg"></a>
<a href="http://weibo.com/fangjiawang" title="微博" target="_blank" rel="nofollow"><img src="${imgUrl}/images/fangjia/v5/footer_icon02.png" class="footer_icon02"></a>
@@ -63,7 +63,7 @@
<div class="footerM dn">
<div>
<div class="footer_top">
<p><b>400-188-3787</b></p>
<p><b>021-62393138</b></p>
</div>
<div class="footer_center01">
<div>
@@ -43,7 +43,7 @@
</ul>
</div>
<div class="footer_right">
<p><b>400-188-3787</b></p>
<p><b>021-62393138</b></p>
<div>
<a class="wx" title="微信"><img src="${imgUrl}/images/fangjia/v5/footer_icon01.png" class="footer_icon01"><img src="${imgUrl}/images/fangjia/v5/wx.png" class="wxImg"></a>
<a href="http://weibo.com/fangjiawang" title="微博" target="_blank" rel="nofollow"><img src="${imgUrl}/images/fangjia/v5/footer_icon02.png" class="footer_icon02"></a>
@@ -20,7 +20,7 @@
<i class="footer_icon1"></i>
<div style="margin-top: -50px;">
<span>服务咨询热线</span>
<span style="color: #41AAAA;font-size: 24px;">400-188-3787</span>
<span style="color: #41AAAA;font-size: 24px;">021-62393138</span>
</div>
</div>
</div>
@@ -237,7 +237,7 @@
<li class="wx-footer">
<center>
<p class="p1">服务咨询热线</p>
<p class="p2">400-188-3787</p>
<p class="p2">021-62393138</p>
<img src="${imgUrl}/images/fangjia/v6/mb/wx.jpg" width="100px">
<p class="p3">
<i class="icon1"></i><span class="sp1">友情链接</span><i class="icon2"></i><i class="icon3"></i>
@@ -8,7 +8,7 @@
<a href="javascript:;" class="icon tel" title="客服电话"></a>
<div class="fixedNav01">
<i></i>
<p>400-188-3787</p>
<p>021-62393138</p>
<small>周一至周五 09:00-18:00</small>
<font></font>
</div>
@@ -32,7 +32,7 @@
<div class="fl">
<div class="mb20">
<strong>广告后台及网站操作事宜,请联系:</strong>
<p class="mt10">客服热线:4001883787<br>周一至周五(法定假日除外)<br>09:00-12:00<br>13:00-18:00</p>
<p class="mt10">客服热线:021-62393138<br>周一至周五(法定假日除外)<br>09:00-12:00<br>13:00-18:00</p>
</div>
<div class="mb20">
<strong>网站合作事宜,请联系:</strong>
@@ -65,7 +65,7 @@
请把您的姓名、网站名称、网址、链接方式、链接地址等信息发给我们,我们会尽快与您联系。<br />
Email:<a href="mailto:link@fangjia.com">link@fangjia.com</a><br/>
友情链接合作请联系QQ:1967419612(上海站) 1909341170(北京站) 2358839349(深圳站) 1838892913(广州站) <br/>
Tel:4001883787<br/>
Tel:021-62393138<br/>
</div><!--rig_foot结束-->
</div>
</div><!--rig结束-->
@@ -117,7 +117,7 @@
</div>
<div class="adBox adBox01" style="padding-top: 60px;">
<p><small>如想了解详情,请致电 <b style="font-size: 18px;color: yellow;">400-188-3787</b> 联系我们,或者留下您的联系方式和需求,我们会第一时间联系您。</small></p>
<p><small>如想了解详情,请致电 <b style="font-size: 18px;color: yellow;">021-62393138</b> 联系我们,或者留下您的联系方式和需求,我们会第一时间联系您。</small></p>
<a class="link_btn link01_btn" data_id="1006" cat="solution">立即咨询</a>
</div>
@@ -151,7 +151,7 @@
</div>
<div class="adBox adBox01" style="padding-top: 60px;">
<p><small>如想了解详情,请致电 <b style="font-size: 18px;color: yellow;">400-188-3787</b> 联系我们,或者留下您的联系方式和需求,我们会第一时间联系您。</small></p>
<p><small>如想了解详情,请致电 <b style="font-size: 18px;color: yellow;">021-62393138</b> 联系我们,或者留下您的联系方式和需求,我们会第一时间联系您。</small></p>
<a class="link_btn link01_btn" data_id="1033" cat="solution">立即咨询</a>
</div>
@@ -131,7 +131,7 @@
</div>
<div class="adBox adBox01" style="padding-top: 60px;">
<p><small>如想了解详情,请致电 <b style="font-size: 18px;color: yellow;">400-188-3787</b> 联系我们,或者留下您的联系方式和需求,我们会第一时间联系您。</small></p>
<p><small>如想了解详情,请致电 <b style="font-size: 18px;color: yellow;">021-62393138</b> 联系我们,或者留下您的联系方式和需求,我们会第一时间联系您。</small></p>
<a class="link_btn link01_btn" data_id="1029" cat="solution">立即咨询</a>
</div>
@@ -33,7 +33,7 @@
<div class="content">
<p class="success"><i></i>您的贷款申请已提交成功</p>
<p class="link" style="color:#333;">我们的贷款专员将会尽快与您取得联系,感谢您的申请!</p>
<p class="note">若您有任何问题,欢迎拨打客服电话:<a>400-188-3787</a></p>
<p class="note">若您有任何问题,欢迎拨打客服电话:<a>021-62393138</a></p>
</div>
</div>
</div>
@@ -52,7 +52,7 @@
<div class="content">
<p class="success"><i></i>您的信息已提交成功</p>
<p class="link" style="color:#333;">我们的专业数据顾问将会尽快与您取得联系,感谢您的咨询!</p>
<p class="note">若您有任何问题,欢迎拨打客服电话:<a>400-188-3787</a></p>
<p class="note">若您有任何问题,欢迎拨打客服电话:<a>021-62393138</a></p>
</div>
</div>
</div>
@@ -99,8 +99,8 @@
<a ref="nofollow" href="http://www.sgs.gov.cn/lz/licenseLink.do?method=licenceView&entyId=20120426105658696">
<div class="infoLeft"></div></a>
<div class="infoRight">
<span>前台总机:021-62393138</span><br>
<span>客服热线:4001883787</span><br>
<#-- <span>前台总机:021-62393138</span><br>-->
<span>客服热线:021-62393138</span><br>
<a href="${cityUrl}/ershoufang">上海找房子</a><span>,</span><a href="${cityUrl}/gujia">估房价</a><span>,百度&nbsp;</span><a href="https://www.baidu.com">房价网</a><br>
<span>电子邮箱:gujia@fangjia.com</span>
</div>
@@ -94,8 +94,8 @@
<a ref="nofollow" href="http://www.sgs.gov.cn/lz/licenseLink.do?method=licenceView&entyId=20120426105658696">
<div class="infoLeft"></div></a>
<div class="infoRight">
<span>前台总机:021-62393138</span><br>
<span>客服热线:4001883787</span><br>
<#-- <span>前台总机:021-62393138</span><br>-->
<span>客服热线:021-62393138</span><br>
<a href="${cityUrl}/ershoufang">上海找房子</a><span>,</span><a href="${cityUrl}/gujia">估房价</a><span>,百度&nbsp;</span><a href="https://www.baidu.com">房价网</a><br>
<span>电子邮箱:gujia@fangjia.com</span>
</div>
@@ -108,8 +108,8 @@
<a ref="nofollow" href="http://www.sgs.gov.cn/lz/licenseLink.do?method=licenceView&entyId=20120426105658696">
<div class="infoLeft"></div></a>
<div class="infoRight">
<span>前台总机:021-62393138</span><br>
<span>客服热线:4001883787</span><br>
<#-- <span>前台总机:021-62393138</span><br>-->
<span>客服热线:021-62393138</span><br>
<a href="${cityUrl}/ershoufang">上海找房子</a><span>,</span><a href="${cityUrl}/gujia">估房价</a><span>,百度&nbsp;</span><a href="https://www.baidu.com">房价网</a><br>
<span>电子邮箱:gujia@fangjia.com</span>
</div>
@@ -114,8 +114,8 @@
<a ref="nofollow" href="http://www.sgs.gov.cn/lz/licenseLink.do?method=licenceView&entyId=20120426105658696">
<div class="infoLeft"></div></a>
<div class="infoRight">
<span>前台总机:021-62393138</span><br>
<span>客服热线:4001883787</span><br>
<#-- <span>前台总机:021-62393138</span><br>-->
<span>客服热线:021-62393138</span><br>
<a href="${cityUrl}/ershoufang">上海找房子</a><span>,</span><a href="${cityUrl}/gujia">估房价</a><span>,百度&nbsp;</span><a href="https://www.baidu.com">房价网</a><br>
<span>电子邮箱:gujia@fangjia.com</span>
</div>
@@ -352,7 +352,7 @@
});
var yeTab = "<div id='__balance_banks' class='payWay_spread dn'><div class='inputInfo'><div class='inputInfoa'><label style='font-size:20px;'>当前余额:<em style='font-size:26px;vertical-align:-2px;'>${amount!'0.00'}</em>&nbsp;元</label>" +
"</div><div class='inputInfoa'><label><i></i>支付密码:</label><input class='input_name' type='password' id='pay_pwd' autocomplete='off' placeholder='请输入支付密码'><div class='error'></div></div>" +
"<div class='inputInfoa'><label><i></i>手机号码:</label><input class='input_company' type='text' id='pay_phone' autocomplete='off' placeholder='请输入手机号码'><div class='error'></div><button class='sendCode' id='sendCode'>发送验证码</button></div><div class='inputInfoa'><label><i></i><a class='ls3_01'>验证</a><a class='ls3_02'>码</a>:</label><input class='input_code' type='text' id='pay_auth_code' autocomplete='off' placeholder='请输入验证码'><a class='waiting dn'>48&nbsp;s</a><div class='error' id='auth-error'></div></div><a class='confirm_btn' id='btn_buy_confirm' href=''>确认支付</a><span style='margin-left:43px;'>忘记密码/修改密码,请致电客服:4001883787</span></div></div>";
"<div class='inputInfoa'><label><i></i>手机号码:</label><input class='input_company' type='text' id='pay_phone' autocomplete='off' placeholder='请输入手机号码'><div class='error'></div><button class='sendCode' id='sendCode'>发送验证码</button></div><div class='inputInfoa'><label><i></i><a class='ls3_01'>验证</a><a class='ls3_02'>码</a>:</label><input class='input_code' type='text' id='pay_auth_code' autocomplete='off' placeholder='请输入验证码'><a class='waiting dn'>48&nbsp;s</a><div class='error' id='auth-error'></div></div><a class='confirm_btn' id='btn_buy_confirm' href=''>确认支付</a><span style='margin-left:43px;'>忘记密码/修改密码,请致电客服:021-62393138</span></div></div>";
var yebzTab = "<div id='__balance_banks' class='payWay01_spread dn'><p>需支付<span id='totalCost'>0</span>元,当前账户余额不足,请先充值或选择其他付款方式</p><a class='confirm_btn' id='btn_comfirm_ye'>确定</a></div>";
$("#btn_buy_submit").bind("click", function(){
@@ -98,8 +98,8 @@
<a ref="nofollow" href="http://www.sgs.gov.cn/lz/licenseLink.do?method=licenceView&entyId=20120426105658696">
<div class="infoLeft"></div></a>
<div class="infoRight">
<span>前台总机:021-62393138</span><br>
<span>客服热线:4001883787</span><br>
<#-- <span>前台总机:021-62393138</span><br>-->
<span>客服热线:021-62393138</span><br>
<a href="${cityUrl}/ershoufang">上海找房子</a><span>,</span><a href="${cityUrl}/gujia">估房价</a><span>,百度&nbsp;</span><a href="https://www.baidu.com">房价网</a><br>
<span>电子邮箱:gujia@fangjia.com</span>
</div>
@@ -80,8 +80,8 @@
<a ref="nofollow" href="http://www.sgs.gov.cn/lz/licenseLink.do?method=licenceView&entyId=20120426105658696">
<div class="infoLeft"></div></a>
<div class="infoRight">
<span>前台总机:021-62393138</span><br>
<span>客服热线:4001883787</span><br>
<span>客服热线:021-62393138</span><br>
<#-- <span>客服热线:4001883787</span><br>-->
<a href="${cityUrl}/ershoufang">上海找房子</a><span>,</span><a href="${cityUrl}/gujia">估房价</a><span>,百度&nbsp;</span><a href="https://www.baidu.com">房价网</a><br>
<span>电子邮箱:gujia@fangjia.com</span>
</div>
@@ -81,8 +81,8 @@
<a ref="nofollow" href="http://www.sgs.gov.cn/lz/licenseLink.do?method=licenceView&entyId=20120426105658696">
<div class="infoLeft"></div></a>
<div class="infoRight">
<span>前台总机:021-62393138</span><br>
<span>客服热线:4001883787</span><br>
<#-- <span>前台总机:021-62393138</span><br>-->
<span>客服热线:021-62393138</span><br>
<a href="${cityUrl}/ershoufang">上海找房子</a><span>,</span><a href="${cityUrl}/gujia">估房价</a><span>,百度&nbsp;</span><a href="https://www.baidu.com">房价网</a><br>
<span>电子邮箱:gujia@fangjia.com</span>
</div>
@@ -426,7 +426,7 @@
<div class="adBox adBox01" style="padding-top: 60px;">
<p><small>如想了解详情,请致电 <b style="font-size: 18px;color: yellow;">400-188-3787</b> 联系我们,或者留下您的联系方式和需求,我们会第一时间联系您。</small></p>
<p><small>如想了解详情,请致电 <b style="font-size: 18px;color: yellow;">021-62393138</b> 联系我们,或者留下您的联系方式和需求,我们会第一时间联系您。</small></p>
<a class="link_btn link01_btn" data_id="1028" cat="solution">立即咨询</a>
</div>
@@ -93,7 +93,7 @@
<div style="text-align:left; margin-left: 3rem">&radic; 详尽的产品功能及服务介绍</div>
<div style="text-align:left; margin-left: 3rem">&radic; 针对您所处的行业与业务场景,提供专业的服务方案<br/></div>
<div style="text-align:left; margin-left: 3rem">&radic; 根据您的业务规模和需求,提供优惠的价格方案<br/></div>
<div style="text-align:left; margin-left: 3rem">紧急咨询可拨打<strong>400-188-3787</strong><br/></div>
<div style="text-align:left; margin-left: 3rem">紧急咨询可拨打<strong>021-62393138</strong><br/></div>
<div style="text-align:left; margin-left: 3rem">预约申请请留下您的联系方式,我们会尽快与您联系<br/></div>
</div>
<div class="content content03">
@@ -52,7 +52,7 @@
<div class="content">
<p class="success"><i></i>您的信息已提交成功</p>
<p class="link" style="color:#333;">我们的专业数据顾问将会尽快与您取得联系,感谢您的咨询!</p>
<p class="note">若您有任何问题,欢迎拨打客服电话:<a>400-188-3787</a></p>
<p class="note">若您有任何问题,欢迎拨打客服电话:<a>021-62393138</a></p>
</div>
</div>
</div>
@@ -52,7 +52,7 @@
<div class="content">
<p class="success"><i></i>您的信息已提交成功</p>
<p class="link" style="color:#333;">我们的专业数据顾问将会尽快与您取得联系,感谢您的咨询!</p>
<p class="note">若您有任何问题,欢迎拨打客服电话:<a>400-188-3787</a></p>
<p class="note">若您有任何问题,欢迎拨打客服电话:<a>021-62393138</a></p>
</div>
</div>
</div>
@@ -78,7 +78,7 @@
<div class="adBox adBox01" style="padding-top: 60px;">
<p><small>如想了解详情,请致电 <b style="font-size: 18px;color: yellow;">400-188-3787</b> 联系我们,或者留下您的联系方式和需求,我们会第一时间联系您。</small></p>
<p><small>如想了解详情,请致电 <b style="font-size: 18px;color: yellow;">021-62393138</b> 联系我们,或者留下您的联系方式和需求,我们会第一时间联系您。</small></p>
<a class="link_btn link01_btn" data_id="1031" cat="solution">立即咨询</a>
</div>
@@ -154,12 +154,12 @@
</div>
<div class="adBox adBox01 mobile01" style="padding-top: 60px;">
<p><small>如想了解详情,请致电 <b style="font-size: 18px;color: yellow;">400-188-3787</b> 联系我们,或者留下您的联系方式和需求,我们会第一时间联系您。</small></p>
<p><small>如想了解详情,请致电 <b style="font-size: 18px;color: yellow;">021-62393138</b> 联系我们,或者留下您的联系方式和需求,我们会第一时间联系您。</small></p>
<a class="link_btn link01_btn" data_id="1006" cat="solution">立即咨询</a>
</div>
<div class="adBox adBox01 mobile02" style="padding-top: 60px;">
<p><small>如想了解详情,请致电 <b style="font-size: 18px;color: yellow;">400-188-3787</b> 联系我们,或者留下您的联系方式和需求,我们会第一时间联系您。</small></p>
<p><small>如想了解详情,请致电 <b style="font-size: 18px;color: yellow;">021-62393138</b> 联系我们,或者留下您的联系方式和需求,我们会第一时间联系您。</small></p>
<a class="link_btn link01_btn" data_id="1006" cat="solution">立即咨询</a>
</div>
@@ -77,7 +77,7 @@
<div class="adBox adBox01" style="padding-top: 60px;">
<p><small>如想了解详情,请致电 <b style="font-size: 18px;color: yellow;">400-188-3787</b> 联系我们,或者留下您的联系方式和需求,我们会第一时间联系您。</small></p>
<p><small>如想了解详情,请致电 <b style="font-size: 18px;color: yellow;">021-62393138</b> 联系我们,或者留下您的联系方式和需求,我们会第一时间联系您。</small></p>
<a class="link_btn link01_btn" data_id="1032" cat="solution">立即咨询</a>
</div>
@@ -157,12 +157,12 @@
<div class="adBox adBox01 mobile01">
<p style="margin-top: -10px"><label>法拍房数据解决方案</label></p>
<p><small>如想获取您所关注城市的法拍房市场分析报告,或者查询任一楼盘的法拍成交折扣率,请致电&nbsp;&nbsp;<b style="font-size: 18px;color: yellow;">400-188-3787</b>&nbsp;&nbsp;联系我们,或者留下您的联系方式和需求,我们会第一时间联系您。</small></p>
<p><small>如想获取您所关注城市的法拍房市场分析报告,或者查询任一楼盘的法拍成交折扣率,请致电&nbsp;&nbsp;<b style="font-size: 18px;color: yellow;">021-62393138</b>&nbsp;&nbsp;联系我们,或者留下您的联系方式和需求,我们会第一时间联系您。</small></p>
<a class="link_btn link01_btn" data_id="1023" cat="solution" >立即体验</a>
</div>
<div class="adBox adBox01 mobile02">
<p><label>法拍房数据解决方案</label></p>
<p><small>如想获取您所关注城市的法拍房市场分析报告,或者查询任一楼盘的法拍成交折扣率,请致电<label>400-188-3787</label>联系我们,或者留下您的联系方式和需求,我们会第一时间联系您。</small></p>
<p><small>如想获取您所关注城市的法拍房市场分析报告,或者查询任一楼盘的法拍成交折扣率,请致电<label>021-62393138</label>联系我们,或者留下您的联系方式和需求,我们会第一时间联系您。</small></p>
<a class="link_btn link01_btn" data_id="1023" cat="solution">立即体验</a>
</div>
@@ -152,7 +152,7 @@
<a class="login_user_btn" id="smslogin">登录</a>
<div class="line" style="width: 586px;"><span>或</span></div>
<p class="link">新用户<a href="${wwwUrl}/user/register">注册</a></p>
<p class="note">如果您不是通过手机注册的用户,请直接致电客服找回密码<br>客服热线:4001883787</p>
<p class="note">如果您不是通过手机注册的用户,请直接致电客服找回密码<br>客服热线:021-62393138</p>
</div>
</div>
</div>
@@ -66,7 +66,7 @@
<a class="user_btn" id="smslogin">登录</a>
<div class="line"><span>或</span></div>
<p class="link">新用户<a href="${wwwUrl}/user/register">注册</a></p>
<p class="note">如果您不是通过手机注册的用户,请直接致电客服找回密码<br>客服热线:4001883787</p>
<p class="note">如果您不是通过手机注册的用户,请直接致电客服找回密码<br>客服热线:021-62393138</p>
</div>
</div>
</div>
@@ -127,7 +127,7 @@
<a class="login_user_btn confirm_btn" >完成</a>
<div class="line"><span>或</span></div>
<p class="link">想起密码请直接<a href="${wwwUrl}/user/login">登录</a></p>
<p class="note">如果您为非手机注册用户、海外用户或当前手机不用/丢失,<br>请致电客服:4001883787</p>
<p class="note">如果您为非手机注册用户、海外用户或当前手机不用/丢失,<br>请致电客服:021-62393138</p>
</div>
</div>
</div>
@@ -51,7 +51,7 @@
<div class="content">
<p class="success"><i></i>感谢您的注册</p>
<p class="link" style="color:#333;">希望房价网能为您带来最佳使用体验</p>
<p class="note">若您有任何问题,欢迎拨打客服电话:<a>400-188-3787</a></p>
<p class="note">若您有任何问题,欢迎拨打客服电话:<a>021-62393138</a></p>
</div>
</div>
</div>
@@ -146,7 +146,7 @@
<a class="login_user_btn confirm_btn">注册</a>
<div class="line" style="width: 586px;"><span>或</span></div>
<p class="link">已有账户?请直接<a href="${wwwUrl}/user/login">登录</a></p>
<p class="note">若有任何问题,请致电客服:400-188-3787</p>
<p class="note">若有任何问题,请致电客服:021-62393138</p>
</div>
</div>
</div>
@@ -121,7 +121,7 @@
<!-- <button class="login_btn_before bind_btn_before" type="button">确认</button>-->
<button class="login_btn bind_btn" type="button">确认</button>
<span style="margin-top:14px;display:block;color:#666;font-size:12px;">手机绑定成功后,您可通过手机号码与原账号密码登录</span>
<span style="display:block;color:#666;font-size:12px;">海外用户请致电客服:4001883787</span>
<span style="display:block;color:#666;font-size:12px;">海外用户请致电客服:021-62393138</span>
</div>
@@ -157,7 +157,7 @@
<button class="login_btn smslogin_btn" type="button" id="smslogin">登录</button>
<a class="return" onclick="history.go(-1)" style="left:50px;bottom:60px;">返回</a>
<a class="newUser" href="${cityUrl}/user/reqUserRegPage" style="font-size:16px;color:#007fc5;line-height:32px;margin-left:14px;*margin-left:10px;">新用户注册</a>
<span style="margin-top:60px;display:block;color:#666;font-size:12px;">如果您不是通过手机注册的用户,请直接致电客服找回密码<br>客服热线:4001883787</span>
<span style="margin-top:60px;display:block;color:#666;font-size:12px;">如果您不是通过手机注册的用户,请直接致电客服找回密码<br>客服热线:021-62393138</span>
</div>
</div>
<div class="footer_vip">
@@ -176,8 +176,8 @@
<a ref="nofollow" href="http://www.sgs.gov.cn/lz/licenseLink.do?method=licenceView&entyId=20120426105658696">
<div class="infoLeft"></div></a>
<div class="infoRight">
<span>前台总机:021-62393138</span><br>
<span>客服热线:4001883787</span><br>
<#-- <span>前台总机:021-62393138</span><br>-->
<span>客服热线:021-62393138</span><br>
<a href="${cityUrl}/ershoufang">上海找房子</a><span>,</span><a href="${cityUrl}/gujia">估房价</a><span>,百度&nbsp;</span><a href="https://www.baidu.com">房价网</a><br>
<span>电子邮箱:gujia@fangjia.com</span>
</div>
@@ -83,7 +83,7 @@
<!-- <button class="register_btn_before " type="button">注册</button>-->
<button class="register_btn" type="button" id="registerButton">注册</button>
<span style="margin-top:6px;margin-left:80px;text-align:center;display:block;">已有账户?请直接<a style="color:#007fc5;" href="${cityUrl}/user/reqUserLoginPage">登录</a></span>
<span style="margin-left:80px;text-align:center;display:block;color:#666;font-size:12px;">海外用户请致电客服:4001883787</span>
<span style="margin-left:80px;text-align:center;display:block;color:#666;font-size:12px;">海外用户请致电客服:021-62393138</span>
</div>
</div>
@@ -103,8 +103,8 @@
<a ref="nofollow" href="//www.sgs.gov.cn/lz/licenseLink.do?method=licenceView&entyId=20120426105658696">
<div class="infoLeft"></div></a>
<div class="infoRight">
<span>前台总机:021-62393138</span><br>
<span>客服热线:4001883787</span><br>
<#-- <span>前台总机:021-62393138</span><br>-->
<span>客服热线:021-62393138</span><br>
<a href="${cityUrl}/ershoufang">上海找房子</a><span>,</span><a href="${cityUrl}/gujia">估房价</a><span>,百度&nbsp;</span><a href="https://www.baidu.com">房价网</a><br>
<span>电子邮箱:gujia@fangjia.com</span>
</div>
@@ -52,7 +52,7 @@
</div>
<button class="register_btn" type="button">完成</button>
<span style="margin-top:14px;margin-left:80px;display:block;color:#333;text-align:center;">想起密码请直接<a href="${cityUrl}/user/reqUserLoginPage" style="color:#007fc5;">登录</a></span>
<span style="margin-top:4px;margin-left:90px;display:block;color:#666;font-size:12px;">如果您为非手机注册用户、海外用户或当前手机不用/丢失,请致电客服:4001883787</span>
<span style="margin-top:4px;margin-left:90px;display:block;color:#666;font-size:12px;">如果您为非手机注册用户、海外用户或当前手机不用/丢失,请致电客服:021-62393138</span>
</div>
</div>
@@ -73,7 +73,7 @@
<div class="infoLeft"></div></a>
<div class="infoRight">
<span>前台总机:021-62393138</span><br>
<span>客服热线:4001883787</span><br>
<#-- <span>客服热线:4001883787</span><br>-->
<a href="${cityUrl}/ershoufang">上海找房子</a><span>,</span><a href="${cityUrl}/gujia">估房价</a><span>,百度&nbsp;</span><a href="https://www.baidu.com">房价网</a><br>
<span>电子邮箱:gujia@fangjia.com</span>
</div>
@@ -123,7 +123,7 @@
<a href="http://support.fangjia.com/pinpai">热门品牌</a>
</p>
<div class="footer_in por">
客服热线:4001883787 电子邮箱:gujia@fangjia.com
客服热线:021-62393138 电子邮箱:gujia@fangjia.com
<br>
&copy;2006-2013 <strong class="yhua">房价</strong>网 版权所有 沪ICP备10203734号-1
<b class="bg_common"></b>
@@ -66,7 +66,7 @@ public class Seawater implements SeawaterEntity {
private String url;
private String root;
private Integer avgPrice;
private Integer unitPrice;
private Number unitPrice;
private String purpose;
private String estateType;
private String buildType;
@@ -458,11 +458,11 @@ public class Seawater implements SeawaterEntity {
this.maxFloor = maxFloor;
}
public Integer getUnitPrice() {
public Number getUnitPrice() {
return unitPrice;
}
public void setUnitPrice(Integer unitPrice) {
public void setUnitPrice(Number unitPrice) {
this.unitPrice = unitPrice;
}
@@ -576,13 +576,21 @@ public class AddrSvcController {
if (json.containsKey("result")) {
//我们的结果
JSONObject result = json.getJSONObject("result");
//我们省级及以上有开发区,直接用我们的结果
if (result.containsKey("devDistrictName")) {
basicModel.setResult(result);
if (result.containsKey("devDistrictName") && StringUtils.isNotBlank(result.get("devDistrictName").toString())) {
// basicModel.setResult(result);
if(result.containsKey("countyGov") && StringUtils.isNotBlank(result.get("countyGov").toString())){
result.put("countyGov","");
}
}
basicModel.setResult(result);
//我们省级及以上有开发区,直接用我们的结果
/*if (result.containsKey("devDistrictName")) {
basicModel.setResult(result);
} else if (!"2".equals(type)) { // 对私的不用齐梁
basicModel.setResult(result);
} else {
}else {
try {
//如果是江苏省或者浙江省 调用齐梁的结果
if (result.containsKey("province") && ("中国".equals(result.getString("province")))) {
@@ -632,7 +640,7 @@ public class AddrSvcController {
basicModel.setResult(result);
}
}
}*/
}
mav.setModel(basicModel);
@@ -856,9 +864,9 @@ public class AddrSvcController {
if (result.containsKey("town")) {
map.put("town", result.getString("town"));
}
if (result.containsKey("committee")) {
map.put("committee", result.getString("committee"));
}
// if (result.containsKey("committee")) {
// map.put("committee", result.getString("committee"));
// }
if (result.containsKey("provinceCode")) {
map.put("provinceCode", result.getString("provinceCode"));
}
@@ -871,15 +879,15 @@ public class AddrSvcController {
if (result.containsKey("townCode")) {
map.put("townCode", result.getString("townCode"));
}
if (result.containsKey("committeeCode")) {
map.put("committeeCode", result.getString("committeeCode"));
}
if (result.containsKey("typeCode")) {
map.put("typeCode", result.getString("typeCode"));
}
if (result.containsKey("typeName")) {
map.put("typeName", result.getString("typeName"));
}
// if (result.containsKey("committeeCode")) {
// map.put("committeeCode", result.getString("committeeCode"));
// }
// if (result.containsKey("typeCode")) {
// map.put("typeCode", result.getString("typeCode"));
// }
// if (result.containsKey("typeName")) {
// map.put("typeName", result.getString("typeName"));
// }
if (result.containsKey("verifyFlag")) {
map.put("verifyFlag", result.getString("verifyFlag"));
} else {
@@ -913,6 +921,9 @@ public class AddrSvcController {
if (result.containsKey("countyGovTown")) {
map.put("countyGovTown", result.getString("countyGovTown"));
}
if (result.containsKey("remark")) {
map.put("remark", result.getString("remark"));
}
basicModel.setResult(map);
mav.setModel(basicModel);
} else {
@@ -80,6 +80,11 @@ public class CommercialController {
}
/**
* 商铺出租
* @param model
* @return
*/
public Object shopRentEvaluateAction(CommercialModel model) {
RestfulModelAndView mav = new RestfulModelAndView();
@@ -93,7 +98,7 @@ public class CommercialController {
if (json != null) {
if (json.containsKey("msg") && "成功".equals(json.getString("msg"))) {
HashMap<String, Object> resultMap = new HashMap<String, Object>();
resultMap.put("avgPrice", Long.valueOf(json.getString("unitPrice")));
resultMap.put("avgPrice", Double.valueOf(json.getString("unitPrice")));
resultMap.put("totalPrice", Long.valueOf(json.getString("totalPrice")));
if (model.getShowSample()!=null && model.getShowSample()==1 && json.containsKey("case")) {
@@ -198,6 +203,9 @@ public class CommercialController {
HttpRequest request = new HttpRequest();
JSONObject json = null;
Map<String, String> params = new HashMap<String, String>();
if(StringUtils.isNotBlank(model.getCityName())){
params.put("city", model.getCityName());
}
if(StringUtils.isNotBlank(model.getAddress())){
params.put("address", model.getAddress());
}
@@ -57,6 +57,7 @@ import com.fangjia.service.sql.ApiUserService;
import com.fangjia.service.sql.UserService;
import com.fangjia.service.web.MenuService;
import net.sf.json.JSONObject;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils;
import org.bson.types.ObjectId;
import org.sothis.core.util.Closure;
@@ -975,6 +976,22 @@ public class HouseController {
mav.setModel(BasicModel.buildBadRequestModel("非中国经纬度"));
return mav;
}
List<Seawater> houses = new ArrayList<Seawater>();
List<Seawater> houseSelf = new ArrayList<Seawater>();
List<Seawater> houseAround = new ArrayList<Seawater>();
List<Seawater> houseList = new ArrayList<Seawater>();
String[] categories = {"rent", "shop_rent", "office_rent"};
// if (cat.contains("_")) {
// 商铺,写字楼有经纬度,直接查
SeawaterQuery query = new SeawaterQuery();
// 先用名字查自身的样本
query.setCityDisplay(city);
query.setRegion(region);
query.setDistrictName(districtName);
query.setStartDate(model.getStartTime());
query.setEndDate(model.getEndTime());
String category = "district";
if ("1".equals(model.getPropertyType())) {
category = "office";
@@ -991,6 +1008,11 @@ public class HouseController {
} else {
cat = "rent";
}
if (model.getPrice() != null) {
query.setStartPrice((int) (model.getPrice() * 0.5 * 30));
query.setEndPrice((int) (model.getPrice() * 1.5 * 30));
}
} else {
if ("1".equals(model.getPropertyType())) {
cat = "office_sell";
@@ -998,21 +1020,13 @@ public class HouseController {
if ("2".equals(model.getPropertyType())) {
cat = "shop_sell";
}
if (model.getPrice() != null) {
query.setStartPrice((int) (model.getPrice() * 0.5));
query.setEndPrice((int) (model.getPrice() * 1.5));
}
}
List<Seawater> houses = new ArrayList<Seawater>();
List<Seawater> houseSelf = new ArrayList<Seawater>();
List<Seawater> houseAround = new ArrayList<Seawater>();
List<Seawater> houseList = new ArrayList<Seawater>();
// if (cat.contains("_")) {
// 商铺,写字楼有经纬度,直接查
SeawaterQuery query = new SeawaterQuery();
// 先用名字查自身的样本
query.setCityDisplay(city);
query.setRegion(region);
query.setDistrictName(districtName);
query.setCat(cat);
query.setStartDate(model.getStartTime());
query.setEndDate(model.getEndTime());
if (model.getSize() != null && model.getSize() != 0) {
query.setStartArea(model.getSize() * 0.9);
@@ -1025,36 +1039,15 @@ public class HouseController {
} else {
pager.setPageSize(5);
}
if ("1".equals(model.getHouseType())) {
if ("1".equals(model.getPropertyType())) {
cat = "office_rent";
} else if ("2".equals(model.getPropertyType())) {
cat = "shop_rent";
} else {
cat = "rent";
}
if (model.getPrice() != null) {
query.setStartPrice((int) (model.getPrice() * 0.5 * 30));
query.setEndPrice((int) (model.getPrice() * 1.5 * 30));
}
} else {
if ("1".equals(model.getPropertyType())) {
cat = "office_sell";
}
if ("2".equals(model.getPropertyType())) {
cat = "shop_sell";
}
if (model.getPrice() != null) {
query.setStartPrice((int) (model.getPrice() * 0.5));
query.setEndPrice((int) (model.getPrice() * 1.5));
}
}
query.setPager(pager);
query.setSortField("p_date");
query.setOrder(false);
query.setTable("latest_seawater");
if (StringUtils.isNotBlank(city) && StringUtils.isNotBlank(region) && StringUtils.isNotBlank(districtName)) {
houseSelf = seawaterDao.findSeawatersByQuery(query);
for(Seawater house : houseSelf){
house.setDistance(0);
}
houses.addAll(houseSelf);
}
// 如果自身样本数不够,再查周边
@@ -1100,12 +1093,23 @@ public class HouseController {
}
}
seawater.setSize(house.getArea() == null || house.getArea() == 0 ? null : house.getArea());
seawater.setUnitPrice(house.getAvgPrice() == null || house.getAvgPrice() == 0 ? null : house.getAvgPrice());
if(ArrayUtils.contains(categories, cat)){
if(house.getAvgPrice() != null){
double dayRentPrice = (double)(house.getAvgPrice()/30.0);
seawater.setUnitPrice(DataUtil.getDoubleRound(2,dayRentPrice));
}
}else{
seawater.setUnitPrice(house.getAvgPrice() == null || house.getAvgPrice() == 0 ? null : house.getAvgPrice());
}
seawater.setTotalPrice(house.getTotalPrice() == null || house.getTotalPrice() == 0 ? null : house.getTotalPrice());
seawater.setDirection(house.getDirection());
seawater.setFloor(house.getFloor() == null || house.getFloor() == 0 ? null : house.getFloor());
seawater.setMaxFloor(house.getHeight() == null || house.getHeight() == 0 ? null : house.getHeight());
seawater.setDayUnitPrice(house.getDayUnitPrice() == null || house.getDayUnitPrice() == 0 ? null : house.getDayUnitPrice());
// seawater.setRoom(house.getRoom() == null || house.getRoom() == 0 ? null : house.getRoom());
// seawater.setHall(house.getHall() == null || house.getHall() == 0 ? null : house.getHall());
// seawater.setToilet(house.getToilet() == null || house.getToilet() == 0 ? null : house.getToilet());
// seawater.setDayUnitPrice(house.getDayUnitPrice() == null || house.getDayUnitPrice() == 0 ? null : house.getDayUnitPrice());
seawater.setRentType(house.getRentType());
seawater.setPayType(house.getPayType());
seawater.setBusinessStatus(house.getBusinessStatus());
@@ -222,32 +222,50 @@ public class OfficeSellController {
public Object evaluateSellAction(PropertyEvaluationModel model, HttpServletRequest request) {
RestfulModelAndView mav = new RestfulModelAndView();
mav.setViewType("rest");
if (StringUtils.isBlank(model.getCity()) || StringUtils.isBlank(model.getName())
|| StringUtils.isBlank(model.getDistrict()) || model.getSize() <= 0 || model.getCity().contains("全国")
|| model.getDistrict().contains("全国")) {
mav.setModel(BasicModel.buildBadRequestModel("参数非法:城市,区域,写字楼名,面积(size)为必填项"));
if (StringUtils.isBlank(model.getCity()) || model.getSize()<=0) {
mav.setModel(BasicModel.buildBadRequestModel("参数非法:城市,面积为必填项"));
return mav;
}
if (model.getCity().endsWith("市")) {
model.setCity(model.getCity().replaceAll("市$", ""));
if (StringUtils.isBlank(model.getName()) && StringUtils.isBlank(model.getAddress()) ) {
mav.setModel(BasicModel.buildBadRequestModel("参数非法:名称或地址至少填一个"));
return mav;
}
/* 先到CPDB库中查找写字楼 */
District district = districtService.findByNameAndAlias(model.getCity(), model.getDistrict(), model.getName(), "office");
District district = null;
if(StringUtils.isNotBlank(model.getDistrict()) && StringUtils.isNotBlank(model.getName())) {
district = districtService.findByNameAndAlias(model.getCity(), model.getDistrict(), model.getName(), "office");
}
if (district == null) {
if (model.getDistrict().contains("市辖区") || model.getDistrict().contains(model.getCity())) {
if (StringUtils.isNotBlank(model.getDistrict()) && (model.getDistrict().contains("市辖区") || model.getDistrict().contains(model.getCity()))) {
district = districtService.findByNameAndAlias(model.getCity(), null, model.getName(), "office");
}
if (district == null) {
mav.setModel(BasicModel.buildBadRequestModel("该写字楼不存在"));
return mav;
}
if (district == null && (StringUtils.isNotBlank(model.getName()) || StringUtils.isNotBlank(model.getAddress()))) {
JSONObject resultObject = null;
if(StringUtils.isNotBlank(model.getAddress())){
resultObject = addressMatchProxyService.newMatch(model.getCity(), model.getAddress(), "office", false);
}else if(StringUtils.isNotBlank(model.getName())){
resultObject = addressMatchProxyService.newMatch(model.getCity(), model.getName(), "office", false);
}
if(resultObject != null){
String id = (String) resultObject.get("id");
district = districtService.findById(id);
}
}
if (district == null) {
mav.setModel(BasicModel.buildBadRequestModel("该写字楼不存在"));
return mav;
}
model.setName(district.getName());
if (model.getCarportPrice() != null && (model.getCarportPrice() < 0 || model.getCarportPrice() > 1000000)) {
mav.setModel(BasicModel.buildBadRequestModel("carportPrice(车位)取值不合法"));
return mav;
}
if (model.getMaxFloor() != null && (model.getMaxFloor() <= 0 || model.getMaxFloor() > 59)) {
mav.setModel(BasicModel.buildBadRequestModel("maxFloor取值非法,正确范围[1,60)"));
return mav;
@@ -287,16 +305,19 @@ public class OfficeSellController {
districtPriceMap.put("district", district.getRegion());
districtPriceMap.put("name", district.getName());
districtPriceMap.put("unitPrice", evaluation.getUnitPrice());
districtPriceMap.put("samples", evaluation.getSeawater());
mav.setModel(BasicModel.buildOKModel().setResult(districtPriceMap));
try {
if (StringUtils.isNotBlank(evaluation.getFromUserId()) && !evaluation.getFromUserId().equals("1007497")) {
openApiLogService.saveLog(CommonUtils.convertToMap(model), districtPriceMap, evaluation, "/officeSell/evaluateSell");
}
} catch (Exception e) {
e.printStackTrace();
Long totalPrice = (long) (evaluation.getUnitPrice() * model.getSize());
districtPriceMap.put("totalPrice", totalPrice);
if(model.getShow()!=null && model.getShow()==1){
districtPriceMap.put("samples", evaluation.getSeawater());
}
mav.setModel(BasicModel.buildOKModel().setResult(districtPriceMap));
// try {
// if (StringUtils.isNotBlank(evaluation.getFromUserId()) && !evaluation.getFromUserId().equals("1007497")) {
// openApiLogService.saveLog(CommonUtils.convertToMap(model), districtPriceMap, evaluation, "/officeSell/evaluateSell");
// }
// } catch (Exception e) {
// e.printStackTrace();
// }
return mav;
} else {
@@ -473,7 +494,10 @@ public class OfficeSellController {
if (StringUtils.isNotBlank(model.getOtherFactor())) {
evaluation.setOtherFactor(model.getOtherFactor());
}
evaluation.setRegion(model.getDistrict());
if(StringUtils.isNotBlank(model.getDistrict())){
evaluation.setRegion(model.getDistrict());
}
if (null != model.getRoom()) {
evaluation.setRoom(model.getRoom());
}
@@ -287,7 +287,7 @@ public class PoiController {
double lng = Double.parseDouble(lngStr);
double lat = Double.parseDouble(latStr);
Map<String, List<String>> result = new HashMap<String, List<String>>();
List<String> bankSmallType = Arrays.asList("银行", "中国人民银行", "国家开发银行", "中国进出口银行",
List<String> bankSmallType = Arrays.asList("中国人民银行", "国家开发银行", "中国进出口银行",
"中国银行", "中国工商银行", "中国建设银行", "中国农业银行", "交通银行", "招商银行", "华夏银行",
"中信银行", "中国民生银行", "中国光大银行", "上海银行", "上海浦东发展银行", "平安银行", "兴业银行",
"北京银行", "广发银行", "农村商业银行", "香港恒生银行", "东亚银行", "花旗银行", "渣打银行", "汇丰银行",
@@ -372,7 +372,7 @@ public class PoiController {
for (Map<String, Object> hit : hits) {
Map<String, Object> source = (Map<String, Object>) hit.get("_source");
if (source.containsKey("name")) {
if (source.containsKey("name") && !source.get("name").toString().contains("公司")) {
poiNames.add(source.get("name").toString());
}
}
@@ -51,6 +51,7 @@ import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.Query;
import org.apache.lucene.search.TermQuery;
import org.apache.solr.client.solrj.util.ClientUtils;
import org.bson.types.ObjectId;
import org.slf4j.Logger;
import org.sothis.core.util.CollectionUtils;
@@ -759,12 +760,14 @@ public class PropertyController {
districtInfoDto.setAddress(district.getAddress());
//int avgPrice = districtStatService.findLatestDistrictAvgPrice(new DistrictKey(district), null);
// 返回2B价格,小程序用,其他也改为2B
int avgPrice = districtStatService.findLatestDistrictAvgPrice2B(new DistrictKey(district), null);
if (avgPrice == 0) {
avgPrice = districtStatService.findLatestDistrictAvgPrice2B(new DistrictKey(district), DateUtil.add(new Date(), -7));
}
if (avgPrice != 0) {
districtInfoDto.setAvgPrice(avgPrice);
// int avgPrice = districtStatService.findLatestDistrictAvgPrice2B(new DistrictKey(district), null);
// if (avgPrice == 0) {
// avgPrice = districtStatService.findLatestDistrictAvgPrice2B(new DistrictKey(district), DateUtil.add(new Date(), -7));
// }
DistrictSellStat sellStat = districtSellStatService.findFirstByParams(district.getCity(), district.getRegion(), district.getName());
if (sellStat != null) {
districtInfoDto.setAvgPrice(sellStat.getAvgPrice());
}
districtInfoDto.setPropertyType(district.getEstateType2());
if (district.getLat2() != null && district.getLat2() != 0 && district.getLng2() != null
@@ -1196,9 +1199,18 @@ public class PropertyController {
int orgAvgPrice = 0;
if (districtStatBo != null) {
if (StringUtils.isNotBlank(district.getEstateType2()) && district.getEstateType2().contains("别墅") && districtStatBo.getVillaDistrictStat() != null) {
orgAvgPrice = districtStatBo.getVillaDistrictStat().getAvgPrice();
if(districtStatBo.getVillaDistrictStat().getAvg_price_2b() != null && districtStatBo.getVillaDistrictStat().getAvg_price_2b() > 0){
orgAvgPrice = districtStatBo.getVillaDistrictStat().getAvg_price_2b();
}else{
orgAvgPrice = districtStatBo.getVillaDistrictStat().getAvgPrice();
}
} else if (districtStatBo.getDistrictStat() != null) {
orgAvgPrice = districtStatBo.getDistrictStat().getAvgPrice();
if(districtStatBo.getDistrictStat().getAvg_price_2b() != null && districtStatBo.getDistrictStat().getAvg_price_2b() > 0){
orgAvgPrice = districtStatBo.getDistrictStat().getAvg_price_2b();
}else{
orgAvgPrice = districtStatBo.getDistrictStat().getAvgPrice();
}
}
}
if (evaluation != null && evaluation.getAvgPrice() != null && evaluation.getAvgPrice() > 0) {
@@ -1651,7 +1663,16 @@ public class PropertyController {
}
}
}
if (district == null) {
//使用新匹配再配一遍,不加类型,有结果,类型为district则走小区估值,其它类型也走经纬度估值
JSONObject resultObject = addressMatchProxyService.newMatch(model.getCity(), model.getAddress(), null, false);
if (resultObject != null && resultObject.containsKey("category") && resultObject.get("category")!=null) {
if(resultObject.containsKey("id") && resultObject.get("category").equals("district")){
String id = (String) resultObject.get("id");
district = districtService.findById(id);
}
}
}
if (district == null) {
//加上高德获取经纬度 和 根据经纬度估值
@@ -2484,9 +2505,19 @@ public class PropertyController {
item.put("name", districtStat.getDistrictName());
item.put("avgPrice", districtStat.getAvgPrice());
item.put("date", districtStat.getDate() / 100 + "-" + String.format("%02d", districtStat.getDate() % 100));
item.put("changePercent", BigDecimal.valueOf(districtStat.getMom() * 100)
.setScale(2, RoundingMode.HALF_UP)
.doubleValue());
if(null == districtStat.getMom()){
if(result.size()>0){
Integer avgPrice = (Integer) result.get(result.size() - 1).get("avgPrice");
double mom = (districtStat.getAvgPrice() - avgPrice)*100.0/avgPrice;
item.put("changePercent", DataUtil.getRound(2, mom));
}else{
item.put("changePercent", 0);
}
}else{
item.put("changePercent", BigDecimal.valueOf(districtStat.getMom() * 100)
.setScale(2, RoundingMode.HALF_UP)
.doubleValue());
}
result.add(item);
}
}
@@ -2608,7 +2639,7 @@ public class PropertyController {
item.put("city", sqmetreRent.getCity());
item.put("district", sqmetreRent.getRegion());
item.put("name", sqmetreRent.getDistrictName());
item.put("rent", sqmetreRent.getAvgPrice().intValue());
item.put("rent", DataUtil.roundDouble(sqmetreRent.getAvgPrice().doubleValue()/30.0, 2));
item.put("date", DateUtil.formatByPattern(sqmetreRent.getWeekend(), "yyyy-MM"));
result.add(item);
}
@@ -6004,6 +6035,512 @@ public class PropertyController {
return mav;
}
public Object sellCaseAction(PropertyEvaluationModel model, HttpServletRequest request){
RestfulModelAndView mav = new RestfulModelAndView();
mav.setViewType("rest");
if (StringUtils.isBlank(model.getCity())) {
mav.setModel(BasicModel.buildBadRequestModel("参数非法:城市为必填项"));
return mav;
}
if (StringUtils.isBlank(model.getName()) && StringUtils.isBlank(model.getAddress()) ) {
mav.setModel(BasicModel.buildBadRequestModel("参数非法:名称或地址至少填一个"));
return mav;
}
String estateType = null;
if(StringUtils.isNotBlank(model.getPropertyType())){
if(model.getPropertyType().equals("0")){
estateType = "普通住宅";
}else if(model.getPropertyType().equals("1")){
estateType = "别墅";
}else if(model.getPropertyType().equals("2")){
estateType = "商住";
}
}
District district = null;
if(StringUtils.isNotBlank(model.getDistrict()) && StringUtils.isNotBlank(model.getName())){
if(StringUtils.isNotBlank(model.getEstateType()) && model.getEstateType().equals("别墅") && !model.getName().contains("别墅")){
district = districtService.findByNameAndAlias(model.getCity(), model.getDistrict(), model.getName()+"别墅","district");
}else{
district = districtService.findByNameAndAlias(model.getCity(), model.getDistrict(), model.getName(),"district");
}
}
if (district == null && (StringUtils.isNotBlank(model.getName()) || StringUtils.isNotBlank(model.getAddress()))) {
JSONObject resultObject = null;
if(StringUtils.isNotBlank(model.getAddress())){
resultObject = addressMatchProxyService.newMatch(model.getCity(), model.getAddress(), "property", false);
}else if(StringUtils.isNotBlank(model.getName())){
if(estateType !=null && estateType.equals("别墅") && !model.getName().contains("别墅")){
resultObject = addressMatchProxyService.newMatch(model.getCity(), model.getName()+"别墅", "property", false);
}else{
resultObject = addressMatchProxyService.newMatch(model.getCity(), model.getName(), "property", false);
}
}
if(resultObject != null){
String id = (String) resultObject.get("id");
district = districtService.findById(id);
}
}
if(district == null && StringUtils.isBlank(model.getLocation())){
mav.setModel(BasicModel.buildOKModel().setResult(null));
return mav;
}
String startDate = DateUtil.formatByPattern(DateUtil.addMonthToDate(new Date(), -3),"yyyyMMdd");
String endDate = DateUtil.formatByPattern(new Date(), "yyyyMMdd");
List<HouseCaseDto> caseDtos = new ArrayList<HouseCaseDto>();
Pager pager = new Pager();
pager.setStartRow(0);
if (model.getPageSize() != null) {
pager.setPageSize(model.getPageSize());
// if(model.getPageSize() <=50){
// pager.setPageSize(model.getPageSize());
// }else{
// pager.setPageSize(50);
// }
} else {
pager.setPageSize(5);
}
// 默认1公里内
if (model.getRadius() == null) {
model.setRadius(1000);
}
if(district != null){
if(model.getMinPrice() == null){
DistrictSellStat districtSellStat = districtSellStatService.findFirstByParams(district.getCity(), district.getRegion(), district.getName());
if(districtSellStat != null) {
int minPrice = (int) (districtSellStat.getAvgPrice() - districtSellStat.getAvgPrice() * 0.1);
model.setMinPrice(minPrice);
int maxPrice = (int) (districtSellStat.getAvgPrice() + districtSellStat.getAvgPrice() * 0.1);
model.setMaxPrice(maxPrice);
}
}else{
if(model.getMinPrice() != null && model.getMinPrice()>0){
model.setMinPrice(model.getMinPrice());
}
if(model.getMaxPrice() != null && model.getMaxPrice()>0){
model.setMaxPrice(model.getMaxPrice());
}
}
//先查成交案例
Date startTime = DateUtil.parseDate(startDate,"yyyyMMdd");
Date endTime = DateUtil.parseDate(endDate,"yyyyMMdd");
List<DealPrice> dealPrices = dealPriceService.findDealPrices(district.getId(), pager.getPageSize(), model.getMinPrice(), model.getMaxPrice(), startTime, endTime);
if(dealPrices!=null && dealPrices.size()>0){
caseDtos = createDealHouseCase(caseDtos, dealPrices, 0, model.getShowSource());
if(caseDtos.size() == pager.getPageSize()){
caseDtos = caseDtos.subList(0, caseDtos.size()-1);
mav.setModel(BasicModel.buildOKModel().setResult(caseDtos));
return mav;
}
}
if(caseDtos.size() < pager.getPageSize()){
//查自身样本
List<Seawater> houseSelf = houseService.findSelfHouseByParams(district, "sell", Integer.parseInt(startDate), Integer.parseInt(endDate), model.getMinPrice(), model.getMaxPrice(), estateType, pager);
if(houseSelf!=null && houseSelf.size()>0){
caseDtos = createHouseCase(caseDtos, houseSelf, model.getShowSource());
if(caseDtos.size() == pager.getPageSize()){
caseDtos = caseDtos.subList(0, caseDtos.size()-1);
mav.setModel(BasicModel.buildOKModel().setResult(caseDtos));
return mav;
}
}
if(caseDtos.size() < pager.getPageSize() && StringUtils.isNotBlank(estateType) && district.getName().contains("别墅")){
District newDist = new District();
newDist.setCity(district.getCity());
newDist.setRegion(district.getRegion());
newDist.setName(district.getName().replace("别墅",""));
newDist.setEstateType2(estateType);
houseSelf = houseService.findSelfHouseByParams(newDist, "sell", Integer.parseInt(startDate), Integer.parseInt(endDate), model.getMinPrice(), model.getMaxPrice(), estateType, pager);
if(houseSelf!=null && houseSelf.size()>0){
caseDtos = createHouseCase(caseDtos, houseSelf, model.getShowSource());
if(caseDtos.size() == pager.getPageSize()){
caseDtos = caseDtos.subList(0, caseDtos.size()-1);
mav.setModel(BasicModel.buildOKModel().setResult(caseDtos));
return mav;
}
}
}
//有物业类型且自身样本数据不足,忽略物业类型查
if(caseDtos.size() ==0 && StringUtils.isNotBlank(estateType)){
District newDist = new District();
newDist.setCity(district.getCity());
newDist.setRegion(district.getRegion());
newDist.setName(district.getName().replace("别墅",""));
newDist.setEstateType2(estateType);
houseSelf = houseService.findSelfHouseByParams(newDist, "sell", Integer.parseInt(startDate), Integer.parseInt(endDate), model.getMinPrice(), model.getMaxPrice(), null, pager);
if(houseSelf!=null && houseSelf.size()>0){
caseDtos = createHouseCase(caseDtos, houseSelf, model.getShowSource());
if(caseDtos.size() == pager.getPageSize()){
caseDtos = caseDtos.subList(0, caseDtos.size()-1);
mav.setModel(BasicModel.buildOKModel().setResult(caseDtos));
return mav;
}
}
}
//自身样本不足,查周边成交
List<District> districts = districtService.findNearestDistrict(district, 1000, 20);
if(districts!=null && districts.size()>0){
for(District d : districts){
if(!district.getId().equals(d.getId())){
dealPrices = dealPriceService.findDealPrices(d.getId(), pager.getPageSize(), model.getMinPrice(), model.getMaxPrice(), DateUtil.parseDate(startDate,"yyyyMMdd"), DateUtil.parseDate(endDate,"yyyyMMdd"));
if(dealPrices!=null && dealPrices.size()>0 && d.getLng()!=null && d.getLng()>0){
double distance = GeoUtils.calculateDistance(district.getLng()/10000000000.0, district.getLat()/10000000000.0, d.getLng()/10000000000.0, d.getLat()/10000000000.0);
caseDtos = createDealHouseCase(caseDtos, dealPrices, (int)distance, model.getShowSource());
if(caseDtos.size()>pager.getPageSize()){
caseDtos = caseDtos.subList(0, caseDtos.size()-1);
break;
}
}
}
}
if(caseDtos.size() == pager.getPageSize()){
mav.setModel(BasicModel.buildOKModel().setResult(caseDtos));
return mav;
}
}
}
}
//自身成交,自身样本,周边成交不足,查周边挂牌
List<Seawater> houseAround = null;
if (caseDtos.size() < pager.getPageSize() ) {
Double lng = null;
Double lat = null;
if(district!=null && district.getLat()!=null && district.getLat()>0){
lng = district.getLng()/10000000000.0;
lat = district.getLat()/10000000000.0;
if(estateType == null ){
estateType = district.getEstateType2();
}
}else if(StringUtils.isNotBlank(model.getLocation())){
String[] locationStr = model.getLocation().split(",");
String numberPattern = "-?\\d+(\\.\\d+)?"; // 匹配整数或浮点数
for (String loc : locationStr) {
if (!loc.trim().matches(numberPattern)) {
mav.setModel(BasicModel.buildBadRequestModel("location(经纬度)格式错误"));
return mav;
}
}
lng = Double.valueOf(locationStr[0]);
lat = Double.valueOf(locationStr[1]);
if (lng < 70 || lng > 140 || lat < 0 || lat > 55) {
mav.setModel(BasicModel.buildBadRequestModel("非中国经纬度"));
return mav;
}
}
if(lat !=null && lat>0){
houseAround = houseService.findArroundHouseByParams("sell", lng, lat, Integer.parseInt(startDate), Integer.parseInt(endDate), model.getMinPrice(), model.getMaxPrice(), estateType, pager, model.getRadius());
}
if(houseAround != null && houseAround.size()>0){
caseDtos = createHouseCase(caseDtos, houseAround, model.getShowSource());
}
}
if(caseDtos.size()>pager.getPageSize()){
caseDtos = caseDtos.subList(0, caseDtos.size()-1);
}
mav.setModel(BasicModel.buildOKModel().setResult(caseDtos));
return mav;
}
public Object rentCaseAction(PropertyEvaluationModel model, HttpServletRequest request){
RestfulModelAndView mav = new RestfulModelAndView();
mav.setViewType("rest");
if (StringUtils.isBlank(model.getCity())) {
mav.setModel(BasicModel.buildBadRequestModel("参数非法:城市为必填项"));
return mav;
}
if (StringUtils.isBlank(model.getName()) && StringUtils.isBlank(model.getAddress()) ) {
mav.setModel(BasicModel.buildBadRequestModel("参数非法:名称或地址至少填一个"));
return mav;
}
District district = null;
String estateType = null;
if(StringUtils.isNotBlank(model.getPropertyType())){
if(model.getPropertyType().equals("0")){
estateType = "普通住宅";
}else if(model.getPropertyType().equals("1")){
estateType = "别墅";
}else if(model.getPropertyType().equals("2")){
estateType = "商住";
}
}
if(StringUtils.isNotBlank(model.getDistrict()) && StringUtils.isNotBlank(model.getName())){
district = districtService.findByNameAndAlias(model.getCity(), model.getDistrict(), model.getName(),"district");
}
if (district == null && (StringUtils.isNotBlank(model.getName()) || StringUtils.isNotBlank(model.getAddress()))) {
JSONObject resultObject = null;
if(StringUtils.isNotBlank(model.getAddress())){
resultObject = addressMatchProxyService.newMatch(model.getCity(), model.getAddress(), "property", false);
}else if(StringUtils.isNotBlank(model.getName())){
if(estateType !=null && estateType.equals("别墅") && !model.getName().contains("别墅")){
resultObject = addressMatchProxyService.newMatch(model.getCity(), model.getName()+"别墅", "property", false);
}else{
resultObject = addressMatchProxyService.newMatch(model.getCity(), model.getName(), "property", false);
}
}
if(resultObject != null){
String id = (String) resultObject.get("id");
district = districtService.findById(id);
}
}
if(district == null && StringUtils.isBlank(model.getLocation())){
mav.setModel(BasicModel.buildOKModel().setResult(null));
return mav;
}
String startDate = DateUtil.formatByPattern(DateUtil.addMonthToDate(new Date(), -6),"yyyyMMdd");
String endDate = DateUtil.formatByPattern(new Date(), "yyyyMMdd");
List<HouseCaseDto> caseDtos = new ArrayList<HouseCaseDto>();
Pager pager = new Pager();
pager.setStartRow(0);
if (model.getPageSize() != null) {
// pager.setPageSize(model.getPageSize());
if(model.getPageSize() <=50){
pager.setPageSize(model.getPageSize());
}else{
pager.setPageSize(50);
}
} else {
pager.setPageSize(5);
}
// 默认1公里内
if (model.getRadius() == null) {
model.setRadius(1000);
}
if(district != null){
if(model.getMinPrice() == null){
SqmetreRent rent = sqmetreRentService.findNearestSqmetreRent(district.getCity(), district.getRegion(), district.getName(), "district");
if(rent != null) {
int minPrice = (int) (rent.getAvgPrice().intValue() - rent.getAvgPrice().intValue() * 0.1);
model.setMinPrice(minPrice);
int maxPrice = (int) (rent.getAvgPrice().intValue() + rent.getAvgPrice().intValue() * 0.1);
model.setMaxPrice(maxPrice);
}
}else{
if(model.getMinPrice() != null && model.getMinPrice()>0){
model.setMinPrice(model.getMinPrice());
}
if(model.getMaxPrice() != null && model.getMaxPrice()>0){
model.setMaxPrice(model.getMaxPrice());
}
}
if(caseDtos.size() < pager.getPageSize()){
//查自身样本
List<Seawater> houseSelf = houseService.findSelfHouseByParams(district, "rent", Integer.parseInt(startDate), Integer.parseInt(endDate), model.getMinPrice(), model.getMaxPrice(), estateType, pager);
if(houseSelf!=null && houseSelf.size()>0){
caseDtos = createHouseCase(caseDtos, houseSelf, model.getShowSource());
if(caseDtos.size() == pager.getPageSize()){
caseDtos = caseDtos.subList(0, caseDtos.size()-1);
mav.setModel(BasicModel.buildOKModel().setResult(caseDtos));
return mav;
}
}
if(caseDtos.size() < pager.getPageSize() && StringUtils.isNotBlank(estateType) && district.getName().contains("别墅")){
District newDist = new District();
newDist.setCity(district.getCity());
newDist.setRegion(district.getRegion());
newDist.setName(district.getName().replace("别墅",""));
newDist.setEstateType2(estateType);
houseSelf = houseService.findSelfHouseByParams(newDist, "sell", Integer.parseInt(startDate), Integer.parseInt(endDate), model.getMinPrice(), model.getMaxPrice(), estateType, pager);
if(houseSelf!=null && houseSelf.size()>0){
caseDtos = createHouseCase(caseDtos, houseSelf, model.getShowSource());
if(caseDtos.size() == pager.getPageSize()){
caseDtos = caseDtos.subList(0, caseDtos.size()-1);
mav.setModel(BasicModel.buildOKModel().setResult(caseDtos));
return mav;
}
}
}
//有物业类型且自身样本数据不足,忽略物业类型查
if(caseDtos.size() ==0 && StringUtils.isNotBlank(estateType)){
District newDist = new District();
newDist.setCity(district.getCity());
newDist.setRegion(district.getRegion());
newDist.setName(district.getName().replace("别墅",""));
newDist.setEstateType2(estateType);
houseSelf = houseService.findSelfHouseByParams(newDist, "sell", Integer.parseInt(startDate), Integer.parseInt(endDate), model.getMinPrice(), model.getMaxPrice(), null, pager);
if(houseSelf!=null && houseSelf.size()>0){
caseDtos = createHouseCase(caseDtos, houseSelf, model.getShowSource());
if(caseDtos.size() == pager.getPageSize()){
caseDtos = caseDtos.subList(0, caseDtos.size()-1);
mav.setModel(BasicModel.buildOKModel().setResult(caseDtos));
return mav;
}
}
}
}
}
//自身样本不足,查周边挂牌
List<Seawater> houseAround = null;
if (caseDtos.size() < pager.getPageSize() ) {
Double lng = null;
Double lat = null;
if(district!=null && district.getLat()!=null && district.getLat()>0){
lng = district.getLng()/10000000000.0;
lat = district.getLat()/10000000000.0;
if(estateType == null ){
estateType = district.getEstateType2();
}
}else if(StringUtils.isNotBlank(model.getLocation())){
String[] locationStr = model.getLocation().split(",");
String numberPattern = "-?\\d+(\\.\\d+)?"; // 匹配整数或浮点数
for (String loc : locationStr) {
if (!loc.trim().matches(numberPattern)) {
mav.setModel(BasicModel.buildBadRequestModel("location(经纬度)格式错误"));
return mav;
}
}
lng = Double.valueOf(locationStr[0]);
lat = Double.valueOf(locationStr[1]);
if (lng < 70 || lng > 140 || lat < 0 || lat > 55) {
mav.setModel(BasicModel.buildBadRequestModel("非中国经纬度"));
return mav;
}
}
if(lat !=null && lat>0){
houseAround = houseService.findArroundHouseByParams("rent", lng, lat, Integer.parseInt(startDate), Integer.parseInt(endDate), model.getMinPrice(), model.getMaxPrice(), estateType, pager, model.getRadius());
}
if(houseAround != null && houseAround.size()>0){
caseDtos = createHouseCase(caseDtos, houseAround, model.getShowSource());
}
}
if(caseDtos.size()>pager.getPageSize()){
caseDtos = caseDtos.subList(0, caseDtos.size()-1);
}
mav.setModel(BasicModel.buildOKModel().setResult(caseDtos));
return mav;
}
private List<HouseCaseDto> createDealHouseCase(List<HouseCaseDto> caseDtos, List<DealPrice> dealPrices,int distance, Integer showSource){
if(dealPrices!=null && dealPrices.size()>0){
List<String> ids = new ArrayList<String>();
for(HouseCaseDto dto : caseDtos){
ids.add(dto.getId());
}
for(DealPrice dp : dealPrices){
if(!ids.contains(dp.getId())){
HouseCaseDto dto = new HouseCaseDto();
dto.setId(dp.getId());
dto.setCity(dp.getCity());
dto.setDistrict(dp.getRegion());
dto.setName(dp.getDistrictName());
dto.setSize(dp.getArea());
dto.setDistance(distance);
dto.setUnitPrice(dp.getAvgPrice());
dto.setTotalPrice(dp.getTotalPrice());
dto.setDecoration(dp.getFitment());
dto.setDirection(dp.getDirection());
dto.setFloor(dp.getFloor());
dto.setMaxFloor(dp.getHeight());
dto.setRoom(String.valueOf(dp.getRoom()));
dto.setHall(String.valueOf(dp.getHall()));
dto.setCaseDate(DateUtil.formatByPattern(dp.getTradeDate(), "yyyy-MM-dd"));
if(showSource!=null && showSource==1){
dto.setSource("成交");
}
caseDtos.add(dto);
}
}
return caseDtos;
}
return null;
}
private List<HouseCaseDto> createHouseCase(List<HouseCaseDto> caseDtos, List<Seawater> houses, Integer showSource){
if (houses != null && !houses.isEmpty()) {
Set<String> seenIds = new HashSet<String>();
Iterator<Seawater> iterator = houses.iterator();
while (iterator.hasNext()) {
Seawater s = iterator.next();
if (!seenIds.add(s.getId())) {
// 如果已经存在,则从列表中移除
iterator.remove();
}
}
List<String> ids = new ArrayList<String>();
for(HouseCaseDto dto : caseDtos){
ids.add(dto.getId());
}
for (Seawater house : houses) {
if(!ids.contains(house.getId())){
HouseCaseDto caseDto = new HouseCaseDto();
caseDto.setId(house.getId());
caseDto.setCity(house.getCity());
caseDto.setDistrict(house.getRegion());
caseDto.setName(house.getDistrictName());
caseDto.setSize(house.getArea() == null || house.getArea() == 0 ? null : house.getArea());
caseDto.setUnitPrice(house.getAvgPrice() == null || house.getAvgPrice() == 0 ? null : house.getAvgPrice());
caseDto.setTotalPrice(house.getTotalPrice() == null || house.getTotalPrice() == 0 ? null : house.getTotalPrice());
caseDto.setDirection(house.getDirection());
caseDto.setDecoration(house.getFitment());
caseDto.setFloor(house.getFloor() == null || house.getFloor() == 0 ? null : house.getFloor());
caseDto.setMaxFloor(house.getHeight() == null || house.getHeight() == 0 ? null : house.getHeight());
caseDto.setRoom(house.getRoom() == null || house.getRoom() == 0 ? null : house.getRoom().toString());
caseDto.setHall(house.getHall() == null || house.getHall() == 0 ? null : house.getHall().toString());
if (house.getpDate() != null && house.getpDate() > 10000000) {
String numberStr = String.valueOf(house.getpDate());
// 拆分字符串并格式化
String year = numberStr.substring(0, 4); // 前四位是年份
String month = numberStr.substring(4, 6); // 中间两位是月份
String day = numberStr.substring(6, 8); // 最后两位是日期
String formattedDate = year + "-" + month + "-" + day;
caseDto.setCaseDate(formattedDate);
}
caseDto.setDistance(house.getDistance());
if(showSource!=null && showSource==1){
caseDto.setSource("挂牌");
}
caseDtos.add(caseDto);
}
}
}
return caseDtos;
}
public void setHouseLoudongService(HouseLoudongService houseLoudongService) {
this.houseLoudongService = houseLoudongService;
@@ -1,6 +1,7 @@
package com.fangjia.open.controllers;
import com.fangjia.core.RegionData;
import com.fangjia.core.util.DataUtil;
import com.fangjia.core.util.DateUtil;
import com.fangjia.dal.mongo.model.SqmetreRent;
import com.fangjia.dal.seaweed.model.District;
@@ -92,7 +93,7 @@ public class SqmetreRentController {
// 设置返回结果,防止 subList 越界
if (result.size() > 1) {
mav.setModel(BasicModel.buildOKModel().setResult(result.subList(1, result.size())));
mav.setModel(BasicModel.buildOKModel().setResult(result));
} else {
mav.setModel(BasicModel.buildOKModel().setResult(null));
}
@@ -166,7 +167,7 @@ public class SqmetreRentController {
// 设置返回结果,防止 subList 越界
if (result.size() > 1) {
mav.setModel(BasicModel.buildOKModel().setResult(result.subList(1, result.size())));
mav.setModel(BasicModel.buildOKModel().setResult(result));
} else {
mav.setModel(BasicModel.buildOKModel().setResult(null));
}
@@ -232,7 +233,8 @@ public class SqmetreRentController {
item.put("district", sqmetreRent.getRegion());
item.put("name", sqmetreRent.getDistrictName());
Integer currentRent = (sqmetreRent.getAvgPrice() != null) ? sqmetreRent.getAvgPrice().intValue() : 0;
item.put("rent", currentRent);
Double dayRentPrice = currentRent/30.0;
item.put("rent", DataUtil.getRound(2, dayRentPrice));
item.put("date", sqmetreRent.getWeekend() != null ? DateUtil.formatByPattern(sqmetreRent.getWeekend(), "yyyy-MM") : "未知日期");
// 计算月涨幅
@@ -249,7 +251,7 @@ public class SqmetreRentController {
}
// 设置返回结果,防止 subList 越界
if (result.size() > 1) {
if (result.size() > 0) {
mav.setModel(BasicModel.buildOKModel().setResult(result.subList(1, result.size())));
} else {
mav.setModel(BasicModel.buildOKModel().setResult(null));
@@ -0,0 +1,150 @@
package com.fangjia.open.dto;
public class HouseCaseDto {
private String id;//房源id
private String city;//城市
private String district;//区域
private String name;//楼盘名称
private Integer distance;//距离(单位:米)
private Double size;//面积(单位:平米)
private Integer unitPrice;//单价(单位:元/平米)
private Integer totalPrice;//总价(单位:元)
private String decoration;//装修(如:精装)
private String direction;//朝向(如:南)
private Integer floor;//所在楼层
private Integer maxFloor;//总楼层
private String room;//室
private String hall;//厅
private String caseDate;//案例时间(如: 2013-07-12)
private String source;//来源
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getDistrict() {
return district;
}
public void setDistrict(String district) {
this.district = district;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getDistance() {
return distance;
}
public void setDistance(Integer distance) {
this.distance = distance;
}
public Double getSize() {
return size;
}
public void setSize(Double size) {
this.size = size;
}
public Integer getUnitPrice() {
return unitPrice;
}
public void setUnitPrice(Integer unitPrice) {
this.unitPrice = unitPrice;
}
public Integer getTotalPrice() {
return totalPrice;
}
public void setTotalPrice(Integer totalPrice) {
this.totalPrice = totalPrice;
}
public String getDecoration() {
return decoration;
}
public void setDecoration(String decoration) {
this.decoration = decoration;
}
public String getDirection() {
return direction;
}
public void setDirection(String direction) {
this.direction = direction;
}
public Integer getFloor() {
return floor;
}
public void setFloor(Integer floor) {
this.floor = floor;
}
public Integer getMaxFloor() {
return maxFloor;
}
public void setMaxFloor(Integer maxFloor) {
this.maxFloor = maxFloor;
}
public String getRoom() {
return room;
}
public void setRoom(String room) {
this.room = room;
}
public String getHall() {
return hall;
}
public void setHall(String hall) {
this.hall = hall;
}
public String getCaseDate() {
return caseDate;
}
public void setCaseDate(String caseDate) {
this.caseDate = caseDate;
}
public String getSource() {
return source;
}
public void setSource(String source) {
this.source = source;
}
}
@@ -1,6 +1,7 @@
package com.fangjia.open.interceptors;
import com.fangjia.core.util.AnalyticsUtil;
import com.fangjia.core.util.JsonUtils;
import com.fangjia.dal.mongo.open.model.OpenResource;
import com.fangjia.dal.mongo.tool.model.OpenUriLog;
import com.fangjia.dal.sql.model.ApiUser;
@@ -12,6 +13,8 @@ import com.fangjia.open.model.BasicModel;
import com.fangjia.open.model.RestfulModelAndView;
import com.fangjia.service.open.OpenResourceService;
import com.fangjia.service.open.OpenUriLogService;
import com.fasterxml.jackson.databind.ObjectMapper;
import net.sf.json.JSONNull;
import net.sf.json.JSONObject;
import net.sf.json.JsonConfig;
import net.sf.json.processors.JsonValueProcessor;
@@ -22,17 +25,13 @@ import org.sothis.web.mvc.ActionContext;
import org.sothis.web.mvc.ActionInvocation;
import org.sothis.web.mvc.ActionInvocationException;
import org.sothis.web.mvc.Interceptor;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Collection;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.*;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;
/**
* APIÉó¼ÆÈÕÖ¾¼à¿ØÆ÷
*
@@ -116,7 +115,6 @@ public class AuditInterceptor implements Interceptor {
}
return params;
}
/**
* @param request
* @param apiUser
@@ -163,7 +161,7 @@ public class AuditInterceptor implements Interceptor {
if(isSaveResult(request)){
JSONObject json = JSONObject.fromObject(result, DEFAULT_JSON_CONFIG);
json.remove("tid");
openUriLog.setResMap(json);
openUriLog.setResMap((Map<String, Object>)JsonUtils.convertJsonToJavaObj(json, Map.class));
}
} catch (Exception e) {
LOGGER.error("", e);
@@ -14,7 +14,7 @@ public class CommercialModel extends FangjiaApiModel{
private Integer maxFloor;//总楼层
private Integer passengerFlow;//客流量---0:高 1:中 2:低
private Integer LeaseStability;//租约稳定性---0:持续稳定出租 1:阶段性出租 2:偶尔出租 3:未出租
private Integer leaseStability;//租约稳定性---0:持续稳定出租 1:阶段性出租 2:偶尔出租 3:未出租
private Integer sellType;//出售/转让---0:出售 1:转让
private Integer decorationCost;//装修成本(单位:万元)
private Integer decorationYear;//装修年限(单位:年)
@@ -72,11 +72,11 @@ public class CommercialModel extends FangjiaApiModel{
}
public Integer getLeaseStability() {
return LeaseStability;
return leaseStability;
}
public void setLeaseStability(Integer leaseStability) {
LeaseStability = leaseStability;
leaseStability = leaseStability;
}
public Integer getSellType() {
@@ -296,6 +296,39 @@ public class PropertyEvaluationModel extends FangjiaApiModel {
private String sampleIds;
private Integer max;
private Date startDate;
private Date endDate;
private Integer pageSize;
/**
* 显示来源
*/
private Integer showSource;
/**
* 显示房源 1:显示 0:默认 不显示
*/
private Integer show;
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
public Integer getShowSource() {
return showSource;
}
public void setShowSource(Integer showSource) {
this.showSource = showSource;
}
public void setDecorationAge(int decorationAge) {
this.decorationAge = decorationAge;
}
@@ -962,4 +995,36 @@ public class PropertyEvaluationModel extends FangjiaApiModel {
public String getSampleIds() {
return sampleIds;
}
public Integer getMax() {
return max;
}
public void setMax(Integer max) {
this.max = max;
}
public Date getStartDate() {
return startDate;
}
public void setStartDate(Date startDate) {
this.startDate = startDate;
}
public Date getEndDate() {
return endDate;
}
public void setEndDate(Date endDate) {
this.endDate = endDate;
}
public Integer getShow() {
return show;
}
public void setShow(Integer show) {
this.show = show;
}
}
@@ -49,5 +49,11 @@
</ladders>
</rule>
<rule controller="officeSell" action="evaluateSell" channel="office">
<ladders>
<ladder>/evaluateSell</ladder>
</ladders>
</rule>
</rules>
</urlrewrite>
+5
View File
@@ -597,6 +597,11 @@
<!-- <version>1.2.83</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>mysql</groupId>-->
<!-- <artifactId>mysql-connector-java</artifactId>-->
<!-- <version>8.0.33</version>-->
<!-- </dependency>-->
</dependencies>
</project>
@@ -153,7 +153,7 @@ class InsertMonitorSquareRentCalcCommandBatch extends BaseBatch {
query.append("cat", "block")
blockCount = SQMETRE_RENT_COLL.count(query)
def msg = "本月(${weekend.format("yyyyMM")})小区平米租金计算量:".toString() + districtCount + ";本月城市平米租金计算量:" + cityCount + ";本月区域平米租金计算量:" + regionCount + ";本月版块平米租金计算量:" + blockCount + ";运行时间:" + secondToTime(time) + "."
sendDingDingMsg(TOKEN, msg)
sendDingDingMsg(TOKEN, msg, "13916076378")
}
/**
* 均价是否计算完成
@@ -1,6 +1,6 @@
package com.fangjia.script.ccbevaluation
import com.fangjia.script.util.DateUtils
import com.fangjia.script.util.ExcelUtils
import com.fangjia.script.util.MongoUtils
import com.mongodb.BasicDBObject
@@ -9,7 +9,7 @@ import com.mongodb.DBCollection
* 深圳公众号成交数据录入
*/
def datas = ExcelUtils.read("D:\\数据\\建行\\房产估值\\成交\\深圳6月份成交数据.xlsx", 0, 1)
def datas = ExcelUtils.read("D:\\数据\\建行\\房产估值\\成交\\深圳10月份成交数据11.20.xlsx", 0, 1)
def lineUrl = "mongodb://developer:G00IDCDEV12385@mongo.db.fangjia.com:28017";
DBCollection DEAL_PRICE_COLL = MongoUtils.getCollectionByName2("fangjia", "deal_price", lineUrl)
@@ -77,14 +77,14 @@ for(def d : datas){
map.total_price = (int)(d['G'].toString().toDouble().toInteger()*10000)
map.avg_price = (int)(d['H'].toString().toDouble())
if(d['I']){
map.sell_price = (int)(d['I'].toString().toDouble()*10000)
map.sell_price = (int)(d['I'].toString().replace("万","").toDouble()*10000)
}
// map.trade_date = d['J']
def trade_date = d['J']
if(trade_date){
map.trade_date = DateUtils.parseFromTightByPattern(trade_date,'yyyy/MM/dd')
}
map.trade_date = d['J']
// def trade_date = d['J']
// if(trade_date){
// map.trade_date = DateUtils.parseFromTightByPattern(trade_date,'yyyy/MM/dd')
// }
// else{
// def trade_date1 = DateUtils.getRandomDate("2024-03-01", "2024-03-31")
// map.trade_date = DateUtils.parseFromTightByPattern(trade_date1, "yyyy-MM-dd")
@@ -52,6 +52,9 @@ class CcbCommonUtils {
public static def pgsqlInstance = null //Sql.newInstance("jdbc:postgresql://192.168.0.236:5432/warehouse","postgres", "postgres", "org.postgresql.Driver")
//235为房价网内部计算均价的库
public static def pgsqlInstance235 = Sql.newInstance("jdbc:postgresql://192.168.0.235:5433/fangjia?stringtype=unspecified",
"postgres", "Goojia123456", "org.postgresql.Driver")
public static def getRunningCitys(def args){
def citys = []
@@ -443,7 +446,7 @@ class CcbCommonUtils {
}
// q.put("c_date", new BasicDBObject('$lt', DateUtils.parseFromTightYYYYMMDD("2023-05-01")))//因5月1日新增过多,所以暂且先去掉 此批数据改为name_cat=13
// q.put("name","ÁúÔ´ĐÇłÇ")
// q.put("name","登高西路安置小区C区")
// q.put("name_cat", 0);
// q.put("name", new BasicDBObject('$in', ["中信泰富又一城一期","中信泰富又一城"]))
@@ -728,6 +731,26 @@ class CcbCommonUtils {
return map
}
public static def findNewFjwAvgPrice(def commid, def cityid, def sdate){
def sql = "SELECT gujia_bds_clc_avprc,gujia_bds_clmtd,gujiabds_clc_yrmo_val,gujia_bds_cfdc_dgr from price_stat.avm_community_base_price where urbn_id='${cityid}' and gujia_bds_id='${commid}' and gujiabds_clc_yrmo_val=${sdate}"
def map = [:]
pgsqlInstance235.eachRow(sql, { r ->
map.avg_price = r.gujia_bds_clc_avprc
map.type = r.gujia_bds_clmtd
map.month = r.gujiabds_clc_yrmo_val
map.credit_value = r.gujia_bds_cfdc_dgr
if(r.gujia_bds_clmtd == 1){
map.calc_type = "人工估值"
}else if(r.gujia_bds_clmtd == 2){
map.calc_type = "样本计算"
}else if(r.gujia_bds_clmtd == 3){
map.calc_type = "神经网络"
}
})
return map
}
public static def updateTrades(startDate, endDate, cDate){
def q = new BasicDBObject()
q.put("trade_date", new BasicDBObject('$gte', startDate).append('$lt',endDate))
@@ -107,6 +107,9 @@ class CommonDatautils {
public static final DBCollection bk_business_coll = MongoUtils.getCollectionByName("fangjia_base", "bk_business", "mongo.db.fangjia.com")
public static final DBCollection BAIDU_POI_COLL = MongoUtils.getCollectionByName("crawl", "poi_wap_spider", "192.168.0.206",27020)
static DBCollection DISTRICT_SELL_STAT = MongoUtils.getCollectionByName("fangjia_stat", "district_sell_stat", "mongo.db.fangjia.com")
public static DSCollection getHouseDataStoreConnection(){
if(house_dataStoreConnection != null) {
@@ -813,8 +816,9 @@ class CommonDatautils {
// q.put("status",new BasicDBObject('$ne', 0))
q.put("cat", cat);
q.put("city", city)
// q.put("loop_line_info",new BasicDBObject('$exists',false))
// q.put("name","经纬天地园二期")
// q.put("name","扬州北街8号")
DBObject keys = new BasicDBObject();
if(fields){
@@ -825,10 +829,58 @@ class CommonDatautils {
def dbsour = SEAWEED_COLL.find(q, keys).batchSize(5000)
def rets = []
for(def d : dbsour){
if(!d.township){
rets << d
rets << d
}
return rets;
}
public static def findNewUpdateDistricts(def city, def cat, def fields){
def startDate = DateUtils.formatDateByPattern(new Date(), "yyyy-MM-dd")
DBObject q = new BasicDBObject();
q.put("status",0)
// q.put("status",new BasicDBObject('$ne', 0))
q.put("cat", cat);
q.put("city", city)
q.put("m_date", new BasicDBObject('$gte', DateUtils.parseFromTightYYYYMMDD(startDate)))
// q.put("loop_line_info",new BasicDBObject('$exists',false))
// q.put("name","扬州北街8号")
DBObject keys = new BasicDBObject();
if(fields){
for(def field : fields){
keys.put(field, 1);
}
}
def dbsour = SEAWEED_COLL.find(q, keys).batchSize(5000)
def rets = []
for(def d : dbsour){
rets << d
}
return rets;
}
public static def findAllRegionDistricts(def city, def region, def cat, def fields){
DBObject q = new BasicDBObject();
q.put("status",0)
q.put("cat", cat);
q.put("city", city)
q.put("region", region)
DBObject keys = new BasicDBObject();
if(fields){
for(def field : fields){
keys.put(field, 1);
}
}
def dbsour = SEAWEED_COLL.find(q, keys).batchSize(5000)
def rets = []
for(def d : dbsour){
rets << d
}
return rets;
}
@@ -1919,6 +1971,10 @@ class CommonDatautils {
dbo.cal_type = "ÖܱßÂ¥ÅÌ"
}else if(dbo.value_type == 6){
dbo.cal_type = "ÍÆµ¼"
}else if(dbo.value_type == 7){
dbo.cal_type = "周边推算"
}else if(dbo.value_type == 8){
dbo.cal_type = "新模型"
}else if(dbo.value_type == 9){
dbo.cal_type = "Éñ¾­ÍøÂç"
}else if(dbo.value_type == 10){
@@ -2029,6 +2085,23 @@ class CommonDatautils {
}
public static def queryFirstDistrictSellStat(city, region, name){
DBObject queryCondition = new BasicDBObject()
queryCondition.put("city", city);
queryCondition.put("region", region);
queryCondition.put("district_name", name);
DBCursor cur = DISTRICT_SELL_STAT.find(queryCondition).sort(new BasicDBObject().append("date", -1)).limit(1)
cur.setOptions(Bytes.QUERYOPTION_NOTIMEOUT)
DBObject dbo = null
while(cur.hasNext()) {
dbo = cur.next()
}
return dbo;
}
public static def queryHouseCalutePrice(city, region, name, startWeekendDate){
DBObject queryCondition = new BasicDBObject()
queryCondition.put("city", city);
@@ -4056,6 +4129,9 @@ class CommonDatautils {
rowMap.c_date = DateUtils.getConverDate(seawater.m_date)
rowMap.m_date = DateUtils.getConverDate(seawater.m_date)
// rowMap.location = seawater.location
rowMap.title = seawater.name
rets << rowMap
}
}
@@ -4844,6 +4920,7 @@ class CommonDatautils {
query.append("cat", "district")
query.append("city", city)
query.append("visible", 0)
query.append("name", "长城大厦")
DBObject sdq = new BasicDBObject();
sdq.put("sd.point", lat + "," + lng);
sdq.put("sd.sfield", "lat_lng");
@@ -4905,6 +4982,10 @@ class CommonDatautils {
if(!dataMap.containsKey("tuboshi_esf_price") && db.tuboshi_esf_price && db.tuboshi_esf_price>3000){
dataMap.put("tuboshi_esf_price", db.tuboshi_esf_price)
}
if (!dataMap.containsKey("soufang_esf_price") && db.soufang_esf_price && db.soufang_esf_price > 3000) {
dataMap.put("soufang_esf_price", db.soufang_esf_price)
}
if(!dataMap.containsKey("zhongyuan_esf_price") && db.zhongyuan_esf_price && db.zhongyuan_esf_price>3000){
dataMap.put("zhongyuan_esf_price", db.zhongyuan_esf_price)
}
@@ -5788,4 +5869,68 @@ class CommonDatautils {
}
return address;
}
static def findSeawater(city, lng, lat, distance, p_date, cat){
def header = [:]
header["Authorization"] = "Basic ${Base64.getEncoder().encodeToString("elastic:goojia123456".getBytes("UTF-8"))}".toString()
String seawaterUrl = "http://192.168.0.206:9200/seawater-*/_search"
def body = """
{
"query": {
"bool": {
"must": [
{
"geo_distance": {
"distance": "${distance}",
"location": {
"lat": ${lat},
"lon": ${lng}
}
}
},
{
"term": {
"city": "${city}"
}
},
{
"term": {
"cat": "${cat}"
}
},
{
"range": {
"publish_date": {
"gte": "${p_date}",
"format": "yyyy-MM-dd"
}
}
}
]
}
},
"sort": [
{
"publish_date": {
"order": "desc"
}
}
],
"size":30
}
"""
HttpRequest request = new HttpRequest()
String res = request.postWithBody(seawaterUrl, JSONObject.fromObject(body.toString()), header, "UTF-8")
def response = new JsonSlurper().parseText(res)
def esObj = null
if(response && response.hits){
esObj = response.hits.hits
}
return esObj
}
}
@@ -211,6 +211,7 @@ class DistrictInfoExportBatch extends BaseBatch{
def getFzDistricts(def city, def mdate, def endMDate){
def q = new BasicDBObject()
q.put("city", city)
if(mdate){
q.put("m_date", new BasicDBObject('$gte', mdate).append('$lt', endMDate))
}
@@ -28,7 +28,7 @@ class DistrictPriceExportBatch extends BaseBatch{
static DBCollection DISTRICT_SELL_STAT = MongoUtils.getCollectionByName("fangjia_stat", "district_sell_stat", "mongo.db.fangjia.com")
def specialDistsPriceMap = ["津泰新村9-13号、15-18号":37500,"津泰新村14号":51000,"津泰新村1-6号、8号":23500,"津泰新村7号":38000,"津泰新村19号":36000]
def specialDistsPriceMap = ["津泰新村9-13号、15-18号":37500,"津泰新村14号":51000,"津泰新村1-6号、8号":23500,"津泰新村7号":38000,"津泰新村19号":36000, "金泉公寓15、16、17栋":24000,"金泉小区(1-12栋)":14000]
static main(args) {
runBatch(new DistrictPriceExportBatch(), args)
}
@@ -99,6 +99,7 @@ class DistrictPriceExportBatch extends BaseBatch{
def getFzDistricts(def city, def mdate, def endMDate){
def q = new BasicDBObject()
q.put("city", city)
if(mdate){
q.put("m_date", new BasicDBObject('$gte', mdate).append('$lt', endMDate))
}
@@ -4,11 +4,13 @@ import com.fangjia.core.util.DataUtil
import com.fangjia.script.BaseBatch
import com.fangjia.script.BatchOwner
import com.fangjia.script.Watcher
import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.util.CommonUtils
import com.fangjia.script.util.DateUtils
import com.fangjia.script.util.MongoUtils
import com.mongodb.BasicDBObject
import com.mongodb.DBCollection
import com.mongodb.MongoClient
import java.text.DecimalFormat
import java.util.concurrent.CopyOnWriteArrayList
@@ -26,6 +28,8 @@ class DistrictSellStatBatch extends BaseBatch {
static DBCollection DISTRICT_SELL_STAT = MongoUtils.getCollectionByName("fangjia_stat", "district_sell_stat", "mongo.db.fangjia.com")
static final DBCollection FZ_DIST_COLL = MongoUtils.getCollectionByName("business", "fz_district", "mongo.db.fangjia.com")
public static final DBCollection COMMAND_COLL = MongoUtils.getCollectionByName("fangjia_log", "calc_command", "log.mongo.db.fangjia.com",52002)
public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(20)
public static final DBCollection SEAWEED_MONGO_COLL = MongoUtils.getCollectionByName("fangjia", "seaweed", "mongo.db.fangjia.com")
@@ -37,14 +41,48 @@ class DistrictSellStatBatch extends BaseBatch {
@Override
void process(Object args) {
// def months = DateUtils.getMonthList(202206)
// months = months[0..(months.size()-2)]
// def months = DateUtils.getMonthList(202510)
// months = months[0..(months.size()-1)]
// println months
// for(def month : months){
// def curDate = DateUtils.parseFromTightByPattern(month.toString()+"01", "yyyyMMdd")
// calcMonthlyPrice(curDate)
// }
calcMonthlyPrice()
def date = new Date()
def day = date.getDate()
def hours = date.getHours()
if(day == 2 && hours<7){
calcMonthlyPrice() //正常算一期
}else{
//根据calc_type算历史
def q = new BasicDBObject("category" ,"sell_month")
def commands = COMMAND_COLL.find(q)
println "共 【"+commands.size()+"】 个小区重算 "+new Date()
for(def command : commands){
def calc_type = command.calc_type
def id = command._id
if(calc_type==1){
//找出第一次均价计算的时间
def obj = CommonDatautils.queryFirstOrLastDistrictPrice(command.city, command.region, command.name, 1)
if(obj){
def weekend = obj.weekend
def startMonth = DateUtils.formatDateByPattern(weekend, "yyyyMM").toInteger()
def months = DateUtils.getMonthList(startMonth)
if(months.size()>1){
months = months[1..(months.size()-1)]
println months
for(def month : months){
def curDate = DateUtils.parseFromTightByPattern(month.toString()+"01", "yyyyMMdd")
calcMonthlyPriceByName(curDate, command.city, command.region, command.name)
}
//删除命令
COMMAND_COLL.remove(new BasicDBObject("_id", id))
}
}
}
}
}
}
@@ -70,6 +108,8 @@ class DistrictSellStatBatch extends BaseBatch {
curDate = new Date()
}
def citys = CommonUtils.findAllCity()
// citys.remove("上海")
// citys.remove("福州")
def keys = new BasicDBObject("city", 1).append("name", 1).append("region", 1).append("estate_type2", 1).append("status", 1)
def lastMonthWeekend = DateUtils.truncateDay(DateUtils.getLastSundayInWeekOfLastMonth(curDate))
@@ -87,22 +127,23 @@ class DistrictSellStatBatch extends BaseBatch {
for(def city : citys){
index++
def districts = []
if(city == "¸£ÖÝ"){
if(day == 2){
// if(day == 15){
districts = FZ_DIST_COLL.find(new BasicDBObject("city", city), keys).toList()
}else{
districts = FZ_DIST_COLL.find(new BasicDBObject("city", city).append("m_date", new BasicDBObject('$gte',startMDate).append('$lt', endMDate)), keys).toList()
}
// }else{
// districts = FZ_DIST_COLL.find(new BasicDBObject("city", city).append("m_date", new BasicDBObject('$gte',startMDate).append('$lt', endMDate)), keys).toList()
// }
}else{
def q = new BasicDBObject("city", city).append("cat", "district").append("status", 0)
// q.put("name", "翠园楼")
if(day == 2){
// q.put("name", "越华路小区")
// if(day == 2){
districts = SEAWEED_MONGO_COLL.find(q, keys).batchSize(2000).toList()
}else{
q.put("m_date", new BasicDBObject('$gte',startMDate).append('$lt', endMDate))
districts = SEAWEED_MONGO_COLL.find(q, keys).batchSize(2000)
}
// }else{
// q.put("m_date", new BasicDBObject('$gte',startMDate).append('$lt', endMDate))
// districts = SEAWEED_MONGO_COLL.find(q, keys).batchSize(2000)
// }
}
println index+" "+city +" "+districts.size()+" "+ curDate.toString()
@@ -110,10 +151,10 @@ class DistrictSellStatBatch extends BaseBatch {
def startDate = DateUtils.getFirstDayOfMonth(curDate, -1);
def endDate = DateUtils.getLastDayOfMonth(curDate, -1);
if(districts.size()>0){
def weekendPriceMap = findPriceMap(city, startDate, endDate)//上个月小区均价
def curMonthlyPriceMap = findMonthlyPrice(city, curMonth)//当月小区月均价
def lastMonthlyPriceMap = findMonthlyPrice(city, monDate)//上个月小区月均价
def lastYearPriceMap = findMonthlyPrice(city, yoyDate)//去年小区月均价
def weekendPriceMap = findPriceMap(city, startDate, endDate, null, null)//上个月小区均价
def curMonthlyPriceMap = findMonthlyPrice(city, curMonth, null, null)//当月小区月均价
def lastMonthlyPriceMap = findMonthlyPrice(city, monDate, null, null)//上个月小区月均价
def lastYearPriceMap = findMonthlyPrice(city, yoyDate, null, null)//去年小区月均价
if(weekendPriceMap){
running(curMonth, districts, weekendPriceMap, curMonthlyPriceMap, lastMonthlyPriceMap, lastYearPriceMap)
}
@@ -121,6 +162,44 @@ class DistrictSellStatBatch extends BaseBatch {
}
}
def calcMonthlyPriceByName(curDate, city, region, name) {
//只有福州使用tob价格,改为所有城市都使用2B价格,除人工指导价除外
if (!curDate) {
curDate = new Date()
}
def keys = new BasicDBObject("city", 1).append("name", 1).append("region", 1).append("estate_type2", 1).append("status", 1)
def curMonth = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(curDate, "yyyyMM"), -1, "yyyyMM"));
def monDate = getMomDate(curMonth)
def yoyDate = getYoyDate(curMonth)
def q = new BasicDBObject("city", city).append("cat", "district").append("status", 0).append("region", region).append("name", name)
def districts = SEAWEED_MONGO_COLL.find(q, keys).toList()
def startDate = DateUtils.getFirstDayOfMonth(curDate, -1);
def endDate = DateUtils.getLastDayOfMonth(curDate, -1);
if (districts.size() > 0) {
def weekendPriceMap = findPriceMap(city, startDate, endDate, region, name)//上个月小区均价
def curMonthlyPriceMap = findMonthlyPrice(city, curMonth, region, name)//当月小区月均价
def lastMonthlyPriceMap = findMonthlyPrice(city, monDate, region, name)//上个月小区月均价
def lastYearPriceMap = findMonthlyPrice(city, yoyDate, region, name)//去年小区月均价
if (weekendPriceMap) {
running(curMonth, districts, weekendPriceMap, curMonthlyPriceMap, lastMonthlyPriceMap, lastYearPriceMap)
}
}
}
def running(districts){
def totalCount = new AtomicLong()
final CountDownLatch latch = new CountDownLatch(districts.size())
@@ -155,7 +234,7 @@ class DistrictSellStatBatch extends BaseBatch {
def key = dist.region +"##" + dist.name
def weekendPriceObj = weekendPriceMap.get(key)
if(weekendPriceObj){
if(weekendPriceObj && weekendPriceObj.avg_price){
def curPriceObj = curMonthlyPriceMap.get(key)
def lastMonthPriceObj = lastMonthlyPriceMap.get(key)
def lastYearPriceObj = lastYearPriceMap.get(key)
@@ -216,8 +295,19 @@ class DistrictSellStatBatch extends BaseBatch {
data.put("credit", weekendPriceObj.credit)
def q = new BasicDBObject()
q.put("date", curMonth)
q.put("commid", dist._id.toString())
if(curPriceObj.commid){
q.put("date", curMonth)
q.put("commid", dist._id.toString())
}else{
q.put("date", curMonth)
q.put("city", dist.city)
q.put("region", dist.region)
q.put("district_name", dist.name)
data.put("commid", dist._id.toString())
}
DISTRICT_SELL_STAT.update(q , new BasicDBObject('$set', data),true,false)
// DISTRICT_SELL_STAT.update(new BasicDBObject("_id", curPriceObj._id) , new BasicDBObject('$set', data),true,false)
println curMonth+" [update]"+totalCount.get()+" "+ dist.city+" "+dist.name
@@ -239,6 +329,8 @@ class DistrictSellStatBatch extends BaseBatch {
DISTRICT_SELL_STAT.save(data)
println curMonth+" [save]"+totalCount.get()+" "+ dist.city+" "+dist.name
}
}
} catch (Exception e) {
@@ -268,10 +360,13 @@ class DistrictSellStatBatch extends BaseBatch {
}
def findPriceMap(city, startDate, endDate){
def findPriceMap(city, startDate, endDate, region, name){
def q = new BasicDBObject()
q.put("city", city)
// q.put("district_name","长春铺")
if(name){
q.put("region", region)
q.put("district_name", name)
}
q.put("weekend", new BasicDBObject('$lte', endDate).append('$gte', startDate))
def dbcursor = DISTRICT_STAT.find(q).sort(new BasicDBObject().append("weekend", -1))
def priceMap = [:]
@@ -281,6 +376,10 @@ class DistrictSellStatBatch extends BaseBatch {
if(d.avg_price_2b && d.value_type!=1){
d.avg_price = d.avg_price_2b
}
}else{
if(d.avg_price_2b){
d.avg_price = d.avg_price_2b
}
}
priceMap.put(d.region +"##"+d.district_name, d)
}
@@ -288,10 +387,14 @@ class DistrictSellStatBatch extends BaseBatch {
return priceMap
}
def findMonthlyPrice(city, monDate){
def findMonthlyPrice(city, monDate, region, name){
def q = new BasicDBObject()
q.put("city", city)
q.put("date", monDate)
if(name){
q.put("region", region)
q.put("district_name", name)
}
def dbcursor = DISTRICT_SELL_STAT.find(q)
def priceMap = [:]
for(def d : dbcursor){
@@ -1,19 +1,12 @@
package com.fangjia.script.fuzhou
import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.util.DateUtils
import com.fangjia.script.util.ExcelUtils
import com.fangjia.script.util.MongoUtils
import com.mongodb.BasicDBObject
import com.mongodb.Bytes
import com.mongodb.DBCollection
import com.mongodb.DBCursor
import com.mongodb.DBObject
import com.rabbitmq.client.AMQP
import com.rabbitmq.client.impl.AMQImpl
import com.mongodb.*
import org.apache.commons.io.FileUtils
import org.bson.types.ObjectId
/**
* ¸£ÖÝÊý¾Ý½á¹ûͳ¼Æ
*/
@@ -34,6 +27,20 @@ class FzDataResultStat {
//// task.margeExcel()
// task.saveCsvData()
// task.testNewPrice()
// task.statHouse()
}
def statHouse(){
ExcelUtils.multiThreadingModify("C:\\Users\\gaojuan\\Downloads\\福州待调查小区.xlsx",{d->
def o = CommonDatautils.findDistrictById(d['A'])
if(o){
def count = CommonDatautils.findHouseCountByDate(o.city, o.region, o.name, o.alias, "sell", 20220818)
d['K'] = count
println o.name +" "+count
}
})
}
def margeExcel(){
@@ -89,7 +96,7 @@ class FzDataResultStat {
map2.put(key, obj)
}
def rows = []
rows << ["城市","区域","名称","${curMonth}价格","${lastMonth}价格", "涨跌幅","计算方式", "是否有效", "涨跌绝对值"]
rows << ["ID","城市","区域","名称","${curMonth}价格","${lastMonth}价格", "涨跌幅","计算方式", "是否有效", "涨跌绝对值"]
def index = 0
map1.each {k,obj1->
def keys = k.split("##")
@@ -114,7 +121,7 @@ class FzDataResultStat {
if(markup){
markup_abs = Math.abs(markup)
}
def row = [obj1.city, obj1.region, obj1.name, obj1?obj1.avg_price:'', lastPrice?lastPrice.avg_price:'', markup,obj1?obj1.value_type:'', flag, markup_abs]
def row = [obj1._id.toString(), obj1.city, obj1.region, obj1.name, obj1?obj1.avg_price:'', lastPrice?lastPrice.avg_price:'', markup,obj1?obj1.value_type:'', flag, markup_abs]
rows << row
index++
println row
@@ -0,0 +1,500 @@
package com.fangjia.script.majintao.FuZhou
import com.fangjia.core.util.DateUtil
import com.fangjia.core.util.HttpRequest
import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.gj.EsUtils
import com.fangjia.script.util.CommonUtils
import com.fangjia.script.util.ElasticUtils
import com.fangjia.script.util.ExcelUtils
import com.fangjia.script.util.MongoUtils
import com.mongodb.BasicDBObject
import com.mongodb.DBCollection
import java.util.concurrent.atomic.AtomicInteger
class GongShu {
static main(args) {
def task = new GongShu();
task.run();
}
def run() {
String path1 = "D:\\数据\\福州\\福州200个小区抽样价格核验202512.xlsx";
// String path1 = "D:\\数据\\福州\\价格比对_20240915.xlsx";
String path2 = "E:\\goojia\\file\\excel文件\\福州\\福州202410小区价格.xlsx";
// String path2 = "E:\\goojia\\file\\excel文件\\福州\\福州202410小区价格.xlsx";
String path3 = "E:\\goojia\\file\\excel文件\\福州\\福州贝壳小区.xlsx";
// String path2 = "E:\\goojia\\file\\excel文件\\福州\\1.xlsx";
// String path1 = "E:\\goojia\\file\\excel文件\\福州\\福州全部小区.xlsx";
// findID(path2)
// findDelDistrict(path2)
// findDistrictByAlias(path2)
// match19UseMAP(path2)
// addFjwPrice(path2)
// match(path2, path1)
// match2(path3, path1)
// houseCase(path2)
thirdPrice(path1)
priceAvg(path1)
// futurePrice(path2)
// rePrice(path2)
}
def findID(path2) {
def count = new AtomicInteger(0)
ExcelUtils.defineByInputThreadingModify(10, path2, { List d ->
count.incrementAndGet()
if (count % 10 == 0) {
println("已处理:" + count)
}
def city = d['C']
def region = d['D']
def name = d['E']
def district = CommonDatautils.findDistrict(city, region, name, "district")
if (district) {
d['B'] = district._id.toString()
}
})
}
def findDelDistrict(path2) {
def count = new AtomicInteger(0)
ExcelUtils.defineByInputThreadingModify(10, path2, { List d ->
count.incrementAndGet()
if (count % 10 == 0) {
println("已处理:" + count)
}
def city = d['C']
def region = d['D']
def name = d['E']
def district = CommonDatautils.findDistrictAll(city, region, name, "district")
if ("1" == district.status.toString()) {
// d['B'] = district._id.toString()
d['G'] = "已删除"
}
})
}
def findDistrictByAlias(path2) {
def count = new AtomicInteger(0)
ExcelUtils.defineByInputThreadingModify(10, path2, { List d ->
count.incrementAndGet()
if (count % 10 == 0) {
println("已处理:" + count)
}
if (d['G']) {
def city = d['C']
def region = d['D']
def name = d['E']
def district = CommonDatautils.findSeaweedByAlias(city, region, name, "district")
if (district) {
d['H'] = district.get(0)._id.toString()
}
}
})
}
def match19UseMAP(path1) {
def count = new AtomicInteger(0)
ExcelUtils.defineByInputThreadingModify(10, path1, { List d ->
count.incrementAndGet()
if (count % 10 == 0) {
println("已处理:" + count)
}
def address = d['B'] + d['D'] + d['C']
def city = d['B']
def name = d['C']
def region = d['D']
//19匹配
String url = "http://192.168.0.19:31080/FangJiaNlpService/match";
def map = [:]
map.put("address", address)
map.put("city", city)
map.put("useMap", "true")
map.put("category", "property")
HttpRequest httpRequest = new HttpRequest();
def content = httpRequest.getJsonContent(url, map, "UTF-8")
def result = content
if (result != null && "name" in result) {
if ("city" in result) {
d['G'] = result.get("city").toString().replaceAll("null", "")
}
if ("district" in result) {
d['H'] = result.get("district").toString().replaceAll("null", "")
}
if ("name" in result) {
d['I'] = result.get("name").toString().replaceAll("null", "")
}
} else {
address = d['B'] + d['D'] + d['A']
map.put("address", address)
def content2 = httpRequest.getJsonContent(url, map, "UTF-8")
def result2 = content2
if (result2 != null && "name" in result2) {
if ("city" in result2) {
d['G'] = result2.get("city").toString().replaceAll("null", "")
}
if ("district" in result2) {
d['H'] = result2.get("district").toString().replaceAll("null", "")
}
if ("name" in result2) {
d['I'] = result2.get("name").toString().replaceAll("null", "")
}
}
}
})
}
def addFjwPrice(path1) {
ExcelUtils.defineByInputThreadingModify(5, path1, { d ->
if (d['B']) {
def dist = CommonDatautils.findDistrictById(d['B'])
if (dist) {
def price = CommonDatautils.queryThisMonthDistrictAvgPrice(dist, "2024-11-01")
if (price) {
d['F'] = price.avg_price
d['G'] = price.avg_price_2b
def dbo = price
// 计算方式
if (dbo.value_type == 1) {
dbo.cal_type = "指导价"
} else if (dbo.value_type == 2) {
dbo.cal_type = "自身样本"
} else if (dbo.value_type == 3) {
dbo.cal_type = "第三方"
} else if (dbo.value_type == 4) {
dbo.cal_type = "交易数据"
} else if (dbo.value_type == 5) {
dbo.cal_type = "周边楼盘"
} else if (dbo.value_type == 6) {
dbo.cal_type = "推导"
} else if (dbo.value_type == 9) {
dbo.cal_type = "神经网络"
} else if (dbo.value_type == 10) {
dbo.cal_type = "无方式"
} else {
dbo.cal_type = ""
}
d['I'] = dbo.cal_type
}
}
}
})
}
def match2(path2, path1) {
def count = new AtomicInteger(0)
def map = [:]
ExcelUtils.removeEmptyRow(path1)
ExcelUtils.removeEmptyRow(path2)
ExcelUtils.defineByInputThreadingModify(1, path2, { List d ->
count.incrementAndGet()
if (count % 10 == 0) {
println("已处理:" + count)
}
def key = d['G'] + d['H'] + d['I']
map.put(key, d)
})
print(map)
ExcelUtils.defineByInputThreadingModify(1, path1, { List d ->
def key = "福州" + d['C'] + d['D']
if (map.containsKey(key)) {
def value = map.get(key)
d['J'] = value['B']
d['K'] = value['D']
d['L'] = value['C']
}
})
}
def match(path2, path1) {
def count = new AtomicInteger(0)
def map = [:]
ExcelUtils.removeEmptyRow(path1)
ExcelUtils.removeEmptyRow(path2)
ExcelUtils.defineByInputThreadingModify(1, path2, { List d ->
count.incrementAndGet()
if (count % 10 == 0) {
println("已处理:" + count)
}
def key = d['C'] + d['D'] + d['E']
map.put(key, d)
})
print(map)
ExcelUtils.defineByInputThreadingModify(1, path1, { List d ->
def key = "福州" + d['C'] + d['D']
if (map.containsKey(key)) {
def value = map.get(key)
if (!d['J']) {
d['J'] = value['J']
d['K'] = value['K']
d['L'] = value['L']
if (value['J']) {
d['M'] = "pp"
}
}
}
})
}
// 房源及数量
def houseCase(path2) {
def count = new AtomicInteger()
ExcelUtils.defineByInputThreadingModify(10, path2, { List d ->
count.incrementAndGet()
if (count % 10 == 0) {
println("已处理:" + count)
}
def price = []
def city
def region
def name
if (d['J'] && d['K'] && d['L']) {
city = d['J']
region = d['K']
name = d['L']
def must = []
def term1 = ["terms": ["root": ["ke.com"]]] // 修正terms查询的格式
must << term1
def term2 = ["terms": ["cat": ["sell"]]]
must << term2
def term3 = ["terms": ["city": [city]]]
must << term3
def term4 = ["terms": ["region": [region]]]
must << term4
def term5 = ["terms": ["district_name": [name]]]
must << term5
def params = ["query": ["bool": ["must": must]]]
// 添加 p_date 大于 20240101 的条件
def term6 = ["range": ["p_date": ["gt": "20240401"]]]
must << term6
def s = EsUtils.httpSaveData(params, "http://192.168.0.206:9200/seawater-20*/_search");
def total = 0
if (s) {
def doc = new groovy.json.JsonSlurper().parseText(s)
def hits = doc.hits
if (hits) {
total = hits.total.value
if (hits.hits.size() > 0) {
hits.hits.each { hit ->
if (hit._source && hit._source.avg_price) {
price.add(hit._source.avg_price)
}
}
}
}
}
if (price.size() > 0) {
println(price)
// 计算中位数
def medianPrice = calculateMedian(price)
// 找到与中位数最接近的有效价格
def nearestPrice = findNearestPrice(medianPrice, price)
print(nearestPrice)
d['O'] = nearestPrice
d['P'] = total
}
}
})
}
//查找三方价格
def thirdPrice(path1) {
def count = 0
ExcelUtils.multiThreadingModify( path1, { List d ->
count++
if (count % 10 == 0) {
println("已处理:" + count)
}
def city = "福州"
def region = d['B']
def name = d['C']
def valusMap = CommonDatautils.findThirdPartyPrice(city, region, name, 202509, 202511)
if (valusMap) {
def dataMap = valusMap.get(city + "##" + region + "##" + name)
if (dataMap.get("anjuke_esf_price")) {
d['F'] = (int)(dataMap.get("anjuke_esf_price") * 0.9)
}
if (dataMap.get("maitian_esf_price")) {
d['G'] = (int)(dataMap.get("maitian_esf_price") * 0.9)
}
if (dataMap.get("soufang_esf_price")) {
d['H'] = (int)(dataMap.get("soufang_esf_price") * 0.9)
}
if (dataMap.get("cityhouse_esf_price")) {
d['I'] = (int)(dataMap.get("cityhouse_esf_price") * 0.9)
}
}
})
}
def priceAvg(path1) {
def count = 0
ExcelUtils.multiThreadingModify(path1, { List d ->
count++
if (count % 10 == 0) {
println("已处理:" + count)
}
if (d['B']) {
def city
def region
def name
if (d['B'] && d['C']) {
city ="福州"
region = d['B']
name = d['C']
String sql = "select * from community where city = '${city}' and region = '${region}' and name.keyword = '${name}' " +
"and source = '贝壳找房' ";
ElasticUtils.executeSqlQuery(sql, { result ->
if (result.size() > 0) {
println(name +" "+result.avg_price)
if ("avg_price" in result) {
d['N'] = result.avg_price
}
if ("half_year_deal_avg_price" in result) {
d['E'] = result.half_year_deal_avg_price
}
}
})
}
}
})
}
def futurePrice(path1) {
DBCollection DISTRICT_STAT = MongoUtils.getCollectionByName("fangjia_stat", "district_stat", "192.168.0.43", 28017)
def count = 0
ExcelUtils.removeEmptyRow(path1)
ExcelUtils.defineByInputThreadingModify(1, path1, { List d ->
count++
if (count % 10 == 0) {
println("已处理:" + count)
}
if (d['C'] && d['D'] && d['E']) {
String city = d['C']
String region = d['D']
String name = d['E']
def q = new BasicDBObject()
q.put("city", city)
q.put("region", region)
q.put("district_name", name)
def dbcursor = DISTRICT_STAT.find(q).sort(new BasicDBObject("weekend", -1)).limit(1)
def futurePrice
for (def db : dbcursor) {
if (db.future_value) {
futurePrice = db.future_value
d['H'] = futurePrice
break;
}
}
}
})
}
//重算小区价格
def rePrice(path2) {
ExcelUtils.removeEmptyRow(path2)
ExcelUtils.defineByInputThreadingModify(10, path2, { List d ->
if (d['A'] && d['B'] && d['C']) {
String city = d['A']
String region = d['B']
String name = d['C']
// CommonUtils.recalculationAverage(city, region, name, "小区", DateUtil.parseDate("20240721", "yyyyMMdd"))
CommonUtils.recalculationAverage(city, region, name, "小区", DateUtil.parseDate("20240915", "yyyyMMdd"))
CommonUtils.recalculationAverage(city, region, name, "小区", DateUtil.parseDate("20240922", "yyyyMMdd"))
CommonUtils.recalculationAverage(city, region, name, "小区", DateUtil.parseDate("20240929", "yyyyMMdd"))
CommonUtils.recalculationAverage(city, region, name, "小区", DateUtil.parseDate("20241006", "yyyyMMdd"))
CommonUtils.recalculationAverage(city, region, name, "小区", DateUtil.parseDate("20241013", "yyyyMMdd"))
}
})
}
// 计算中位数
def calculateMedian(prices) {
def sortedPrices = prices.sort()
def size = sortedPrices.size()
if (size % 2 == 0) {
// 如果列表长度为偶数,则取中间两个数的平均值作为中位数
def midIndex = (size / 2).toInteger()
return (sortedPrices[midIndex - 1] + sortedPrices[midIndex]) / 2.0
} else {
// 如果列表长度为奇数,则取中间的数作为中位数
return sortedPrices[((size - 1) / 2).toInteger()]
}
}
def findNearestPrice(targetPrice, validPrices) {
def nearestPrice = validPrices.first() // 假设第一个有效价格是最接近的价格
def minDiff = Math.abs(targetPrice - nearestPrice)
validPrices.each { price ->
def diff = Math.abs(targetPrice - price)
if (diff < minDiff) {
minDiff = diff
nearestPrice = price
}
}
return nearestPrice
}
def match235(path2) {
DBCollection DATA_PROCESS = MongoUtils.getCollectionByName("fangjia_craw", "data_process", "192.168.0.235", 27018);
def count = 0
ExcelUtils.defineByInputThreadingModify(1, path2, { List d ->
count++
if (count % 10 == 0) {
println("已处理:" + count)
}
def matchCity = d['B']
def matchRegion = d['C']
def matchName = d['D']
def q = new BasicDBObject();
q.put("match_city", matchCity)
q.put("match_region", matchRegion)
q.put("match_name", matchName)
q.put("source", "链家")
q.put("s_date", 202404)
def data = DATA_PROCESS.find(q)
for (da in data) {
if (da) {
def city = da.city
def region = da.region
def name = da.name
d['G'] = city
d['H'] = region
d['I'] = name
}
}
})
}
}
@@ -14,7 +14,7 @@ import com.mongodb.DBCollection
//福州第三方均价统计,发送钉钉消息
//def datas = ExcelUtils.read("d:\\数据\\福州\\福州4月2.xlsx",0,1)
//def datas = CsvUtils.read("d:\\数据\\福州\\FJW_THIRD_PARTY_AVG_PRICE_202105.csv");
def datas = readTxt("d:\\数据\\福州\\FJW_THIRD_PARTY_AVG_PRICE_202506.csv")
def datas = readTxt("d:\\数据\\福州\\FJW_THIRD_PARTY_AVG_PRICE_202511.csv")
def count0 = 0
def count1 = 0
def count2 = 0
@@ -35,10 +35,10 @@ class AddAvgpriceBatch {
// task.run1();
// task.test()
// task.sendPriceCommand()
// task.sendNewDistPrice()
task.sendNewDistPrice()
// task.delNoExistsDistPrice()
task.checkToBprice()
// task.checkToBprice()
}
def checkToBprice(){
@@ -144,10 +144,11 @@ class AddAvgpriceBatch {
DBObject q = new BasicDBObject();
q.put("status",0)
q.put("cat", "district");
q.put("c_date", new BasicDBObject('$gte', DateUtils.parseFromTightByPattern("2023-11-14","yyyy-MM-dd")))
q.put("c_date", new BasicDBObject('$gte', DateUtils.parseFromTightByPattern("2025-11-27","yyyy-MM-dd")))
def dbsour = DbUtils.seaweed.find(q)
println dbsour.count()
for(def d : dbsour){
addPrice(d.city,d.region,d.name, d.estate_type2, DateUtils.parseFromTightByPattern('2023-07-01','yyyy-MM-dd'),DateUtils.parseFromTightByPattern('2023-11-19','yyyy-MM-dd'))
addPrice(d.city,d.region,d.name, d.estate_type2, DateUtils.parseFromTightByPattern('2025-11-01','yyyy-MM-dd'),DateUtils.parseFromTightByPattern('2025-11-27','yyyy-MM-dd'))
}
}
@@ -635,8 +635,25 @@ class OpenApiUtils {
}
static def similarRank(proCode, cityCode, regionCode, name, area, floor, height){
def url = "http://localhost:8080/fangjia-open/house/similar?aboveFloorAmount=${height}&buildingName=${name}&city=${cityCode}&district=${regionCode}&" +
"propertyTypeCode=01&province=${proCode}&floorNumber=${floor}&strctureArea=${area}"
def url = "http://open.fangjia.com/house/similar?aboveFloorAmount=${height}&buildingName=${name}&city=${cityCode}&district=${regionCode}&" +
"propertyTypeCode=01&province=${proCode}&floorNumber=${floor}&strctureArea=${area}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"
println url
String content = new HttpRequest().get(url, "utf-8");
def dto = []
if(content){
def doc = new JsonSlurper().parseText(content)
if(doc && doc.code ==200 && doc.result){
def dtos = doc.result
return dtos
}
}
return null;
}
static def shopSimilarRank(proCode, cityCode, regionCode, name, area, floor, height){
def url = "http://open.fangjia.com/house/shopSimilar?aboveFloorAmount=${height}&buildingName=${name}&city=${cityCode}&district=${regionCode}&" +
"province=${proCode}&floorNumber=${floor}&strctureArea=${area}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"
println url
String content = new HttpRequest().get(url, "utf-8");
def dto = []
@@ -713,7 +730,7 @@ class OpenApiUtils {
static def financialRating(city, address){
def url = "http://open.fangjia.com/address/financialRating?city=${city}&address=${address}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"
String content = new HttpRequest().get(url, "utf-8");
print(url)
println(url)
if(content){
def doc = new JsonSlurper().parseText(content)
if(doc && doc.code ==0 && doc.result){
@@ -725,6 +742,21 @@ class OpenApiUtils {
}
static def propertyRating(id){
def url = "http://open.fangjia.com/address/propertyRating?id=${id}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"
String content = new HttpRequest().get(url, "utf-8");
// print(url)
if(content){
def doc = new JsonSlurper().parseText(content)
if(doc && doc.code ==200 && doc.result){
def dtos = doc.result
return dtos
}
}
return null;
}
//源地址的完整性进行验证
static def addrVerify(city, address){
def url = "http://open.fangjia.com/addrSvc/addrVerify?city=${city}&address=${address}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"
@@ -778,6 +810,63 @@ class OpenApiUtils {
return null;
}
static def addrVerifyShBank(city, address){
address = URLEncoder.encode(address, "utf-8");
def url = "http://192.168.0.100:32080/FangJiaAddressService/boscEnterpriseVillageIdentify?address=${address}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"
// def url = "http://localhost:8080/fangjia-open/addrSvc/njcbVillageIdentify?address=${address}&type=${type}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"
if(city){
url = url + "&city=${city}"
}
String content = new HttpRequest().get(url, "utf-8");
if(content){
def doc = new JsonSlurper().parseText(content)
if(doc && doc.msgCode ==200 && doc.result){
def dtos = doc.result
return dtos
}
}
return null;
}
static def addrVerifyGuangda(city, address){
address = URLEncoder.encode(address, "utf-8");
def url = "http://192.168.0.100:32080/FangJiaAddressService/cebEnterpriseVillageIdentify?address=${address}"
// def url = "http://localhost:8080/FangJiaAddressService/cebEnterpriseVillageIdentify?address=${address}"
if(city){
url = url + "&city=${city}"
}
String content = new HttpRequest().get(url, "utf-8");
if(content){
def doc = new JsonSlurper().parseText(content)
if(doc && doc.msgCode ==200 && doc.result){
def dtos = doc.result
return dtos
}
}
return null;
}
static def addrVerifyBase(city, address){
address = URLEncoder.encode(address, "utf-8");
def url = "http://192.168.0.100:32080/FangJiaAddressService/enterpriseVillageIdentify?address=${address}"
// def url = "http://localhost:8080/fangjia-open/addrSvc/njcbVillageIdentify?address=${address}&type=${type}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"
if(city){
url = url + "&city=${city}"
}
String content = new HttpRequest().get(url, "utf-8");
if(content){
def doc = new JsonSlurper().parseText(content)
if(doc && doc.msgCode ==200 && doc.result){
def dtos = doc.result
return dtos
}
}
return null;
}
// 省、市、区、街道、社区居委、POI补全
static def complete(city, address){
def url = "http://open.fangjia.com/addrSvc/complete?city=${city}&address=${address}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"
@@ -839,4 +928,17 @@ class OpenApiUtils {
return null;
}
static def lactionEvaluation(area, lng, lat){
def url = "http://192.168.0.100:30020/avmWeb/avmAnn?area=${area}&location=lng"+","+lat
String content = new HttpRequest().get(url, "utf-8");
if(content){
def doc = new JsonSlurper().parseText(content)
if(doc && doc.msgCode ==200 && doc.result){
def dtos = doc.result
return dtos
}
}
return null;
}
}
@@ -1,16 +1,21 @@
package com.fangjia.script.gj.abc
import com.fangjia.core.RegionData
import com.fangjia.core.util.GeoUtils
import com.fangjia.script.ccbevaluation.CcbCommonUtils
import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.gj.OpenApiUtils
import com.fangjia.script.gj.district.FangjiaClientUtils
import com.fangjia.script.util.DateUtils
import com.fangjia.script.util.DbUtils
import com.fangjia.script.util.ElasticUtils
import com.fangjia.script.util.ExcelUtils
import com.fangjia.script.util.GeoHelper
import com.fangjia.script.util.MongoUtils
import com.fangjia.script.util.OpenApiClient
import com.fangjia.script.yinjihaun.amap.GaoDeApiUtils
import com.mongodb.BasicDBObject
import com.mongodb.DBCollection
import com.mongodb.DBObject
import java.util.concurrent.CopyOnWriteArrayList
@@ -24,30 +29,208 @@ class SuzouPocTest {
public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(10)
public static DBCollection COMMUNITY_RATE_COLL = MongoUtils.getCollectionByName("fangjia_stat", "community_rate", "mongo.db.fangjia.com")
static main(args) {
def task = new SuzouPocTest()
// task.run()
// task.newRun()
task.test()
// task.test()//有楼层
task.testEval()//无楼层
// task.level()//楼盘评级
// task.house()
}
def test(){
ExcelUtils.modify("D:\\数据\\上海联合产权交易所\\第1批拟处置房产清单(长城大厦、台山碧桂园).xlsx", { d ->
if(d['O']){
ExcelUtils.modify("D:\\数据\\慧合\\(中企华正诚评估回复)房产价值查询20251209-结果.xlsx", { d ->
if(!d['S'] && d['A']){
def floorAdds = d['I'].split("/")
def ret1 = OpenApiClient.addressEvaluation(d['O'], null, d['D'], d['D'], d['K'], floorAdds[0], floorAdds[1])
def ret1 = OpenApiClient.addressEvaluation(d['C'], null, d['D'], d['D'], d['K'], floorAdds[0], floorAdds[1])
if (ret1) {
d['N'] = ret1.totalPrice
d['M'] = ret1.avgPrice
d['P'] = ret1.district
d['Q'] = ret1.name
d['S'] = ret1.totalPrice
d['T'] = ret1.avgPrice
d['U'] = ret1.district
d['V'] = ret1.name
}
}
});
}
def level(){
ExcelUtils.modify("D:\\数据\\其它\\附件1:POC测试样本(匹配).xlsx", { d ->
if(d['O']){
// def obj = CommonDatautils.findDistrict(d['K'], d['L'], d['M'], "district")
// if(obj){
// d['N'] = obj._id.toString()
// def ret = OpenApiUtils.propertyRating(obj._id.toString())
// def ret = OpenApiUtils.financialRating(d['K'], d['K']+d['L']+d['M'])
def ret = findCommunityRate(d['O'])
if(ret){
d['X'] = ret.community_price_rating
// d['W'] = ret.total_score
}
// def summary = findCommunitySummary(obj._id.toString())
// if(summary){
// d['O'] = summary.building_rating
// }
// }
}
})
}
def findCommunityRate(id){
def q = new BasicDBObject()
q.put("date", 202509)
q.put("comm_id", id)
return COMMUNITY_RATE_COLL.findOne(q)
}
def findCommunitySummary(id){
def obj = null
def sql = "select * from community_summary where id='${id}'"
ElasticUtils.executeSqlQuery(sql, {
obj = it
})
return obj
}
def testEval(){
ExcelUtils.multiThreadingModify("D:\\数据\\海南\\地址清单.xlsx", { d ->
if(!d['L'] && d['B']){
// def city = d['C']
// if(city == "市辖区"){
// city = d['B']
// }
// def obj = CommonDatautils.findDistrictById(d['O'])
// if(obj){
// d['R'] = obj.city
// d['S'] = obj.region
// d['T'] = obj.name
def ret1 = OpenApiClient.addressEvaluation(d['G'], null, d['C'], d['B'], d['D'], null, null)
if (ret1) {
d['M'] = ret1.avgPrice
d['L'] = ret1.totalPrice
d['N'] = ret1.city
d['O'] = ret1.district
d['P'] = ret1.name
}
// else{
// def dbo = CommonDatautils.queryFirstDistrictPrice(obj.city, obj.region, obj.name)
// if(dbo) {
// d['P'] = (int)(dbo.avg_price_2b*d['F'].toString().toDouble())
// d['Q'] = dbo.avg_price_2b
//
// }
//
// }
// }
}
});
}
def house(){
def cases = []
cases << ["城市", "区域","板块", "名称", "面积", "单价","总价","装修", "朝向", "距离","所在楼层","总楼层","室","厅","卫","发布时间","标题", "序号"]
ExcelUtils.modify("D:\\数据\\湖北银行\\房产价格评估测试数据_1210-匹配-V2.xlsx", { d ->
if(d['Q']){
println d["P"]
def obj = CommonDatautils.findDistrict(d['N'], d['O'], d['P'], "district")
if(obj){
def lng = obj.lng/10000000000.0
def lat = obj.lat/10000000000.0
def location = String.valueOf(lng)+","+ String.valueOf(lat)
def price = d['Q']
def startPrice = null
def endPrice = 0
if(price && price>0){
startPrice = price - price*0.2
endPrice = price + price*0.2
}
def result = OpenApiClient.houseAroundBylocationAction(location, d['I'], 0, 0, 50)
def houseList = []
if(result){
for(def h : result){
if(startPrice && h.unitPrice>=startPrice && h.unitPrice<=endPrice){
def startDate = DateUtils.parseFromTightByPattern("2025-01-01", "yyyy-MM-dd")
def pDate = DateUtils.parseFromTightByPattern(h.publishDate, "yyyy-MM-dd")
if(pDate.getTime()>=startDate.getTime()){
houseList << [h.city, h.district, h.block, h.name, h.size, h.unitPrice, h.totalPrice, h.decoration, h.direction, h.distance, h.floor,h.maxFloor, h.room, h.hall, h.toilet, h.publishDate, h.title, d["A"],"挂牌"]
}
}else{
println "价格过滤 "+startPrice +" "+endPrice +" "+ h.unitPrice
}
}
}
def address = d['N']+d['O']+d['P']
def dealRets = OpenApiClient.dealHouse(d['N'], d['O'], d['P'], address, d['I'])
def dealList = []
if(dealRets){
for(def h : dealRets){
def dist = CommonDatautils.findDistrict(h.city, h.district, h.name, "district")
def distance = ""
if(dist){
distance = GeoUtils.calculateDistance(lng, lat, dist.lng/10000000000.0, dist.lat/10000000000.0)
}
def startDate = DateUtils.parseFromTightByPattern("2025-01-01", "yyyy-MM-dd")
def pDate = DateUtils.parseFromTightByPattern(h.tradeDate, "yyyy-MM-dd")
if(pDate.getTime()>=startDate.getTime()){
if(startPrice && h.avgPrice>=startPrice && h.avgPrice<=endPrice) {
dealList << [h.city, h.district, "", h.name, h.size, h.avgPrice, h.totalPrice, h.decoration, h.direction, distance, h.floor, h.maxFloor, h.room, h.hall, h.toilet, h.tradeDate, "", d["A"], "成交"]
}
}
}
}
if(dealList.size()<5){
List<DBObject> list = DbUtils.findAroundDistrict(obj);
if(list){
for(def dist : list){
dealRets = OpenApiClient.dealHouse(dist.city, dist.region, dist.name, dist.address, d['I'])
if(dealRets){
for(def h : dealRets){
def distance = ""
if(dist){
distance = GeoUtils.calculateDistance(lng, lat, dist.lng/10000000000.0, dist.lat/10000000000.0)
}
def startDate = DateUtils.parseFromTightByPattern("2025-01-01", "yyyy-MM-dd")
def pDate = DateUtils.parseFromTightByPattern(h.tradeDate, "yyyy-MM-dd")
if(pDate.getTime()>=startDate.getTime()){
if(startPrice && h.avgPrice>=startPrice && h.avgPrice<=endPrice) {
dealList << [h.city, h.district, "", h.name, h.size, h.avgPrice, h.totalPrice, h.decoration, h.direction, distance, h.floor, h.maxFloor, h.room, h.hall, h.toilet, h.tradeDate, "", d["A"], "成交"]
}
}
}
}
if(dealList.size()>20){
break;
}
}
}
}
if(houseList){
cases.addAll(houseList)
}
if(dealList){
cases.addAll(dealList)
}
}
}
})
println cases.size()
ExcelUtils.write("D:\\数据\\湖北银行\\房产价格评估测试数据_1216-样本.xlsx", cases, "样本")
}
def newRun(){
println("start:"+new Date().toString())
@@ -12,6 +12,7 @@ import com.mongodb.BasicDBObject
import com.mongodb.DBCollection
import net.sf.json.JSONObject
import com.fangjia.script.gj.*
import org.bson.types.ObjectId
import java.util.regex.Matcher
import java.util.regex.Pattern
@@ -30,7 +31,18 @@ class DataMatch {
// println task.findAddress("昌州街道棠香路")
// task.run2MatchV2( "D:\\数据\\重庆农商行\\估值1-V2.xlsx")
task.fzWeiyuanshuMatch("D:\\数据\\福州\\连江楼盘.xlsx")
// task.fzWeiyuanshuMatch("D:\\数据\\福州\\连江楼盘.xlsx")
task.delRegionCode("D:\\数据\\需删除区域编码.xlsx")
}
def delRegionCode(path){
ExcelUtils.modify(path,{d->
def q = new BasicDBObject("_id", new ObjectId(d['A']))
def obj = FANGJIA_OFFICIAL_AREA_MAP.findOne(q)
if(obj){
FANGJIA_OFFICIAL_AREA_MAP.remove(q)
}
})
}
def fzWeiyuanshuMatch(fileName){
@@ -189,7 +189,7 @@ class AddDevShapeData {
def run(){
def directoryPath = 'D:\\数据\\数据建设\\开发区外包\\0812'
def directoryPath = 'D:\\数据\\数据建设\\开发区外包\\1020'
def dir = new File(directoryPath)
if (dir.isDirectory()) {
dir.eachFileRecurse(FileType.FILES) { file ->

Some files were not shown because too many files have changed in this diff Show More