Compare commits
45 Commits
9b84cd2da4
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 9dd8e2e9c4 | |||
| 721277a84b | |||
| b6166e2e79 | |||
| 9e729f5366 | |||
| e6eb4d5c03 | |||
| f9967af738 | |||
| 40b7c67b34 | |||
| 22effa754b | |||
| 0691235b69 | |||
| 77d2ec0527 | |||
| c3d0a39eff | |||
| f6cd5acbc3 | |||
| 90618f96b0 | |||
| cfb3e4aa74 | |||
| d33bb1c75c | |||
| 7665e2f3ce | |||
| 548671668f | |||
| 9287511308 | |||
| f3e7f977c2 | |||
| 0141feb67e | |||
| 8da41233f5 | |||
| edfcc031fc | |||
| 29d91a6e05 | |||
| d9d7a1d115 | |||
| 46ec261e7b | |||
| 34a18bf416 | |||
| d76a88bc3e | |||
| b0b24eec0a | |||
| 5bf3fb3911 | |||
| 78680222d6 | |||
| a3b14dfe56 | |||
| a6a6a57385 | |||
| 5dfa6d8432 | |||
| 4e3fb46c62 | |||
| 3c10c22dc3 | |||
| 23d26b75f8 | |||
| 7eb3b10b56 | |||
| 746d39660a | |||
| 743dc638e9 | |||
| 527dc0f6af | |||
| 8a34a355ae | |||
| 1b9373bb0c | |||
| 6f08f9ad76 | |||
| 3d944d5f67 | |||
| d5ac4baa1d |
@@ -18,7 +18,24 @@
|
|||||||
"Bash(chmod +x /tmp/search_all.sh)",
|
"Bash(chmod +x /tmp/search_all.sh)",
|
||||||
"Bash(/tmp/search_all.sh)",
|
"Bash(/tmp/search_all.sh)",
|
||||||
"Bash(chmod +x /tmp/extract_classes.sh)",
|
"Bash(chmod +x /tmp/extract_classes.sh)",
|
||||||
"Bash(/tmp/extract_classes.sh)"
|
"Bash(/tmp/extract_classes.sh)",
|
||||||
|
"Bash(curl -s -m 10 -u elastic:elasticsearch \"http://192.168.0.89:9200/didata_map_poi_2024/_search\" -H \"Content-Type: application/json\" -d '{\"size\":0,\"aggs\":{\"types\":{\"terms\":{\"field\":\"small_type\",\"size\":200}}}}')",
|
||||||
|
"Bash(curl -s -m 15 -u elastic:elasticsearch \"http://192.168.0.89:9200/didata_map_poi_2024/_search\" -H \"Content-Type: application/json\" -d '{\"size\":0,\"aggs\":{\"types\":{\"terms\":{\"field\":\"small_type\",\"size\":300}}}}' -o /tmp/es_types.json)",
|
||||||
|
"Bash(echo \"exit=$?\")",
|
||||||
|
"Bash(curl -s -m 15 -v -u elastic:elasticsearch \"http://192.168.0.89:9200/\")",
|
||||||
|
"Bash(curl -s -m 15 --noproxy '*' -u elastic:elasticsearch \"http://192.168.0.89:9200/didata_map_poi_2024/_search\" -H \"Content-Type: application/json\" -d '{\"size\":0,\"aggs\":{\"types\":{\"terms\":{\"field\":\"small_type\",\"size\":300}}}}' -o /tmp/es_types.json)",
|
||||||
|
"Bash(python -c ' *)",
|
||||||
|
"Bash(curl -s -m 30 --noproxy '*' -u elastic:elasticsearch \"http://192.168.0.89:9200/didata_map_poi_2024/_search\" -H \"Content-Type: application/json\" -d '{\"size\":0,\"aggs\":{\"types\":{\"terms\":{\"field\":\"small_type\",\"size\":3000}}}}' -o /tmp/es_types_all.json)",
|
||||||
|
"Bash(curl -s -m 60 --noproxy '*' -u elastic:elasticsearch \"http://192.168.0.89:9200/didata_map_poi_2024/_search\" -H \"Content-Type: application/json\" -d '{\"size\":0,\"aggs\":{\"types\":{\"terms\":{\"field\":\"small_type\",\"size\":3000}}}}' -o es_types_all.json)",
|
||||||
|
"Bash(curl -s -m 15 --noproxy '*' -u elastic:elasticsearch \"http://192.168.0.89:9200/didata_map_poi_2024/_search?size=1\" -H \"Content-Type: application/json\" -d '{\"query\":{\"term\":{\"small_type\":\"小学\"}}}')",
|
||||||
|
"Bash(curl -s -m 15 --noproxy '*' -u elastic:elasticsearch \"http://192.168.0.89:9200/didata_map_poi_2024/_search?size=1\" -H \"Content-Type: application/json\" -d '{\"query\":{\"term\":{\"small_type\":\"小学\"}}}' -o /tmp/es_doc.json)",
|
||||||
|
"Bash(curl -s -m 15 --noproxy '*' -u elastic:elasticsearch \"http://192.168.0.89:9200/didata_map_poi_2024/_search?size=2\" -o /tmp/es_doc.json)",
|
||||||
|
"Bash(python -X utf8 -c ' *)",
|
||||||
|
"Bash(curl -s -m 15 --noproxy '*' -u elastic:elasticsearch \"http://192.168.0.89:9200/didata_map_poi_2024/_search?size=2\" -o es_doc.json)",
|
||||||
|
"Bash(python -X utf8 -)",
|
||||||
|
"Bash(awk 'NR>=351 && NR<=630' \"projects\\\\fangjia-open\\\\src\\\\main\\\\java\\\\com\\\\fangjia\\\\open\\\\controllers\\\\PropertyController.java\")",
|
||||||
|
"Bash(awk 'NR>=351 && NR<=560 && / };/{print NR\": \"$0; exit}' \"projects\\\\fangjia-open\\\\src\\\\main\\\\java\\\\com\\\\fangjia\\\\open\\\\controllers\\\\PropertyController.java\")",
|
||||||
|
"Bash(mvn compile *)"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+83
-54
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
// 每个项目的完整部署配置字典,新增项目只需在此添加一条记录
|
// 每个项目的完整部署配置字典,新增项目只需在此添加一条记录
|
||||||
// buildDir: Maven 构建目录名(deliverables/<buildDir>),默认与 key 同名,不同时显式指定
|
// buildDir: Maven 构建目录名(deliverables/<buildDir>),默认与 key 同名,不同时显式指定
|
||||||
|
// deployUser: SSH 登录用户(默认为 docker),使用 sshagent 密钥认证
|
||||||
def PROJECT_CONFIG = [
|
def PROJECT_CONFIG = [
|
||||||
'fangjiabkoff' : [
|
'fangjiabkoff' : [
|
||||||
imageName : 'fangjia-bkoff',
|
imageName : 'fangjia-bkoff',
|
||||||
@@ -9,7 +10,7 @@ def PROJECT_CONFIG = [
|
|||||||
serviceName : 'fangjia-bkoff',
|
serviceName : 'fangjia-bkoff',
|
||||||
deployHost : '192.168.0.80',
|
deployHost : '192.168.0.80',
|
||||||
deployBase : '/home/docker',
|
deployBase : '/home/docker',
|
||||||
sshCredId : 'goojia-ssh',
|
deployUser : 'docker',
|
||||||
],
|
],
|
||||||
'chafangtong' : [
|
'chafangtong' : [
|
||||||
imageName : 'chafangtong',
|
imageName : 'chafangtong',
|
||||||
@@ -17,7 +18,7 @@ def PROJECT_CONFIG = [
|
|||||||
serviceName : 'chafangtong',
|
serviceName : 'chafangtong',
|
||||||
deployHost : '192.168.0.80',
|
deployHost : '192.168.0.80',
|
||||||
deployBase : '/home/docker',
|
deployBase : '/home/docker',
|
||||||
sshCredId : 'goojia-ssh',
|
deployUser : 'docker',
|
||||||
],
|
],
|
||||||
'fangjia' : [
|
'fangjia' : [
|
||||||
imageName : 'fangjia-coresite',
|
imageName : 'fangjia-coresite',
|
||||||
@@ -25,7 +26,7 @@ def PROJECT_CONFIG = [
|
|||||||
serviceName : 'fangjia-coresite',
|
serviceName : 'fangjia-coresite',
|
||||||
deployHost : '192.168.0.80',
|
deployHost : '192.168.0.80',
|
||||||
deployBase : '/home/docker',
|
deployBase : '/home/docker',
|
||||||
sshCredId : 'goojia-ssh',
|
deployUser : 'docker',
|
||||||
],
|
],
|
||||||
'fangjiapds' : [
|
'fangjiapds' : [
|
||||||
imageName : 'fangjia-pds',
|
imageName : 'fangjia-pds',
|
||||||
@@ -33,7 +34,7 @@ def PROJECT_CONFIG = [
|
|||||||
serviceName : 'fangjia-pds',
|
serviceName : 'fangjia-pds',
|
||||||
deployHost : '192.168.0.80',
|
deployHost : '192.168.0.80',
|
||||||
deployBase : '/home/docker',
|
deployBase : '/home/docker',
|
||||||
sshCredId : 'goojia-ssh',
|
deployUser : 'docker',
|
||||||
],
|
],
|
||||||
'fangjiastatic' : [
|
'fangjiastatic' : [
|
||||||
imageName : 'fangjia-static',
|
imageName : 'fangjia-static',
|
||||||
@@ -41,7 +42,7 @@ def PROJECT_CONFIG = [
|
|||||||
serviceName : 'fangjia-static',
|
serviceName : 'fangjia-static',
|
||||||
deployHost : '192.168.0.80',
|
deployHost : '192.168.0.80',
|
||||||
deployBase : '/home/docker',
|
deployBase : '/home/docker',
|
||||||
sshCredId : 'goojia-ssh',
|
deployUser : 'docker',
|
||||||
],
|
],
|
||||||
'geluke' : [
|
'geluke' : [
|
||||||
imageName : 'geluke',
|
imageName : 'geluke',
|
||||||
@@ -49,15 +50,15 @@ def PROJECT_CONFIG = [
|
|||||||
serviceName : 'geluke',
|
serviceName : 'geluke',
|
||||||
deployHost : '192.168.0.80',
|
deployHost : '192.168.0.80',
|
||||||
deployBase : '/home/docker',
|
deployBase : '/home/docker',
|
||||||
sshCredId : 'goojia-ssh',
|
deployUser : 'docker',
|
||||||
],
|
],
|
||||||
'fangjiaopen' : [
|
'fangjiaopen' : [
|
||||||
imageName : 'fangjia-open',
|
imageName : 'fangjia-open',
|
||||||
composeDir : 'fangjia-open',
|
composeDir : 'fangjia-open',
|
||||||
serviceName : 'fangjia-open',
|
serviceName : 'fangjia-open',
|
||||||
deployHost : '192.168.0.36',
|
deployHost : ['192.168.0.36', '192.168.0.18'],
|
||||||
deployBase : '/home/docker',
|
deployBase : '/home/docker',
|
||||||
sshCredId : 'goojia-ssh',
|
deployUser : 'docker',
|
||||||
],
|
],
|
||||||
'fangjia-script' : [
|
'fangjia-script' : [
|
||||||
buildDir : 'script', // deliverables/script
|
buildDir : 'script', // deliverables/script
|
||||||
@@ -66,12 +67,16 @@ def PROJECT_CONFIG = [
|
|||||||
serviceName : 'fangjia-script',
|
serviceName : 'fangjia-script',
|
||||||
deployHost : '192.168.0.36',
|
deployHost : '192.168.0.36',
|
||||||
deployBase : '/home/docker',
|
deployBase : '/home/docker',
|
||||||
sshCredId : 'goojia-ssh',
|
deployUser : 'docker',
|
||||||
],
|
],
|
||||||
]
|
]
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
agent { label 'linux' }
|
agent any
|
||||||
|
options {
|
||||||
|
// 自动保留最近 3 次构建记录,或者保留最近 30 天的记录
|
||||||
|
buildDiscarder(logRotator(numToKeepStr: '3', daysToKeepStr: '30'))
|
||||||
|
}
|
||||||
parameters {
|
parameters {
|
||||||
choice(name: 'PROJECT_NAME', choices: ['chafangtong', 'fangjia', 'fangjiapds', 'fangjiastatic', 'geluke', 'fangjiaopen', 'fangjia-script'], description: '请选择发布的项目')
|
choice(name: 'PROJECT_NAME', choices: ['chafangtong', 'fangjia', 'fangjiapds', 'fangjiastatic', 'geluke', 'fangjiaopen', 'fangjia-script'], description: '请选择发布的项目')
|
||||||
}
|
}
|
||||||
@@ -97,13 +102,13 @@ pipeline {
|
|||||||
def buildDir = cfg.buildDir ?: params.PROJECT_NAME
|
def buildDir = cfg.buildDir ?: params.PROJECT_NAME
|
||||||
dir("deliverables/${buildDir}") {
|
dir("deliverables/${buildDir}") {
|
||||||
withMaven(globalMavenSettingsConfig: '426b9a25-aa0d-47d3-a24c-8abdfc4421ff', jdk: "JDK8") {
|
withMaven(globalMavenSettingsConfig: '426b9a25-aa0d-47d3-a24c-8abdfc4421ff', jdk: "JDK8") {
|
||||||
sh 'mvn clean package -Dmaven.test.skip=true'
|
sh 'mvn clean package -Dmaven.test.skip=true -Dasset.version="$BUILD_NUMBER"'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Docker Build & Push') {
|
stage('Docker Build & Push') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
@@ -120,52 +125,76 @@ pipeline {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Docker Compose Deploy') {
|
stage('Docker Compose Deploy') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
def cfg = PROJECT_CONFIG[params.PROJECT_NAME]
|
def cfg = PROJECT_CONFIG[params.PROJECT_NAME]
|
||||||
withCredentials([usernamePassword(credentialsId: cfg.sshCredId, usernameVariable: 'SSH_USER', passwordVariable: 'SSH_PASS')]) {
|
def deployUser = cfg.deployUser ?: 'docker'
|
||||||
if (params.PROJECT_NAME == "fangjia-script") {
|
sshagent(credentials: ['deploy-server-ssh']) {
|
||||||
def buildDir = cfg.buildDir ?: params.PROJECT_NAME
|
if (params.PROJECT_NAME == "fangjia-script") {
|
||||||
sh """
|
def buildDir = cfg.buildDir ?: params.PROJECT_NAME
|
||||||
# 确保目录存在
|
sh """
|
||||||
sshpass -p "\$SSH_PASS" ssh -o StrictHostKeyChecking=no \$SSH_USER@${cfg.deployHost} '
|
# 确保目录存在
|
||||||
mkdir -p /home/docker/fangjia-script/scripts/fangjia
|
ssh -o StrictHostKeyChecking=no \
|
||||||
mkdir -p /home/docker/fangjia-script/logs
|
-o HostKeyAlgorithms=+ssh-rsa \
|
||||||
'
|
-o PubkeyAcceptedKeyTypes=+ssh-rsa \
|
||||||
|
${deployUser}@${cfg.deployHost} \
|
||||||
|
'mkdir -p /home/docker/fangjia-script/scripts/fangjia && mkdir -p /home/docker/fangjia-script/logs'
|
||||||
|
|
||||||
# 上传 fat jar
|
# 上传 fat jar
|
||||||
sshpass -p "\$SSH_PASS" scp -o StrictHostKeyChecking=no \
|
scp -o StrictHostKeyChecking=no \
|
||||||
projects/fangjia-script/target/fangjia-script.jar \
|
-o HostKeyAlgorithms=+ssh-rsa \
|
||||||
\$SSH_USER@${cfg.deployHost}:/home/docker/fangjia-script/fangjia-script.jar
|
-o PubkeyAcceptedKeyTypes=+ssh-rsa \
|
||||||
|
projects/fangjia-script/target/fangjia-script.jar \
|
||||||
|
${deployUser}@${cfg.deployHost}:/home/docker/fangjia-script/fangjia-script.jar
|
||||||
|
|
||||||
# 上传 groovy 脚本目录
|
# 上传 groovy 脚本目录
|
||||||
sshpass -p "\$SSH_PASS" scp -o StrictHostKeyChecking=no -r \
|
scp -o StrictHostKeyChecking=no \
|
||||||
projects/fangjia-script/src/main/groovy/* \
|
-o HostKeyAlgorithms=+ssh-rsa \
|
||||||
\$SSH_USER@${cfg.deployHost}:/home/docker/fangjia-script/scripts/
|
-o PubkeyAcceptedKeyTypes=+ssh-rsa \
|
||||||
|
-r projects/fangjia-script/src/main/groovy/* \
|
||||||
|
${deployUser}@${cfg.deployHost}:/home/docker/fangjia-script/scripts/
|
||||||
|
|
||||||
# 上传 crontab
|
# 上传 crontab
|
||||||
sshpass -p "\$SSH_PASS" scp -o StrictHostKeyChecking=no \
|
scp -o StrictHostKeyChecking=no \
|
||||||
projects/fangjia-script/crontab.txt \
|
-o HostKeyAlgorithms=+ssh-rsa \
|
||||||
\$SSH_USER@${cfg.deployHost}:/home/docker/fangjia-script/crontab.txt
|
-o PubkeyAcceptedKeyTypes=+ssh-rsa \
|
||||||
|
projects/fangjia-script/crontab.txt \
|
||||||
|
${deployUser}@${cfg.deployHost}:/home/docker/fangjia-script/crontab.txt
|
||||||
|
|
||||||
# 热重载
|
# 重启容器
|
||||||
sshpass -p "\$SSH_PASS" ssh -o StrictHostKeyChecking=no \$SSH_USER@${cfg.deployHost} '
|
ssh -o StrictHostKeyChecking=no \
|
||||||
docker kill --signal=SIGHUP ${cfg.serviceName}
|
-o HostKeyAlgorithms=+ssh-rsa \
|
||||||
'
|
-o PubkeyAcceptedKeyTypes=+ssh-rsa \
|
||||||
"""
|
${deployUser}@${cfg.deployHost} \
|
||||||
} else {
|
'cd ${cfg.deployBase}/${cfg.composeDir} && docker compose down && docker compose pull && docker compose up -d'
|
||||||
sh """
|
"""
|
||||||
sshpass -p "\$SSH_PASS" ssh -o StrictHostKeyChecking=no \$SSH_USER@${cfg.deployHost} '
|
} else {
|
||||||
cd ${cfg.deployBase}/${cfg.composeDir}
|
if(cfg.deployHost instanceof String){
|
||||||
docker compose up -d --no-deps --force-recreate ${cfg.serviceName}
|
sh """
|
||||||
'
|
ssh -o StrictHostKeyChecking=no \
|
||||||
"""
|
-o HostKeyAlgorithms=+ssh-rsa \
|
||||||
}
|
-o PubkeyAcceptedKeyTypes=+ssh-rsa \
|
||||||
}
|
${deployUser}@${cfg.deployHost} \
|
||||||
}
|
'cd ${cfg.deployBase}/${cfg.composeDir} && docker compose up -d --no-deps --force-recreate ${cfg.serviceName}'
|
||||||
}
|
"""
|
||||||
}
|
}else{
|
||||||
|
for(def host in cfg.deployHost){
|
||||||
|
sh """
|
||||||
|
ssh -o StrictHostKeyChecking=no \
|
||||||
|
-o HostKeyAlgorithms=+ssh-rsa \
|
||||||
|
-o PubkeyAcceptedKeyTypes=+ssh-rsa \
|
||||||
|
${deployUser}@${host} \
|
||||||
|
'cd ${cfg.deployBase}/${cfg.composeDir} && docker compose up -d --no-deps --force-recreate ${cfg.serviceName}'
|
||||||
|
"""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
post {
|
post {
|
||||||
|
|||||||
+6
@@ -285,6 +285,11 @@ public class ApiUserController {
|
|||||||
bo.setPriceType(apiUserCfg_pt.getCfgValue().toString());
|
bo.setPriceType(apiUserCfg_pt.getCfgValue().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ApiUserCfg apiUserCfg_ai = apiUserCfgService.findByUserId(apiUser.getId(), ApiUserCfg.ApiUserCfgKey.ENTERPRISE_VILLAGE_AI);
|
||||||
|
if (apiUserCfg_ai != null && apiUserCfg_ai.getCfgValue() != null) {
|
||||||
|
bo.setEnterpriseVillageAi(apiUserCfg_ai.getCfgValue().toString());
|
||||||
|
}
|
||||||
|
|
||||||
model.setApiUserBo(bo);
|
model.setApiUserBo(bo);
|
||||||
if (StringUtils.isNotBlank(model.getMsg()) && model.getMsg().equals("success")) {
|
if (StringUtils.isNotBlank(model.getMsg()) && model.getMsg().equals("success")) {
|
||||||
model.setMsg("更新成功!");
|
model.setMsg("更新成功!");
|
||||||
@@ -343,6 +348,7 @@ public class ApiUserController {
|
|||||||
//ApiUserCfg.ApiUserCfgKey.EVALUATE_RATE
|
//ApiUserCfg.ApiUserCfgKey.EVALUATE_RATE
|
||||||
modifyUserCfg(userId, ApiUserCfg.ApiUserCfgKey.EVALUATE_RATE, model.getEvaluateRate());
|
modifyUserCfg(userId, ApiUserCfg.ApiUserCfgKey.EVALUATE_RATE, model.getEvaluateRate());
|
||||||
modifyUserCfg(userId, ApiUserCfg.ApiUserCfgKey.PRICE_TYPE, model.getPriceType());
|
modifyUserCfg(userId, ApiUserCfg.ApiUserCfgKey.PRICE_TYPE, model.getPriceType());
|
||||||
|
modifyUserCfg(userId, ApiUserCfg.ApiUserCfgKey.ENTERPRISE_VILLAGE_AI, model.getEnterpriseVillageAi());
|
||||||
|
|
||||||
model.setViewType("redirect");
|
model.setViewType("redirect");
|
||||||
//model.setViewParam("location", "/apiUser/edit?msg=sucess&userId=" + model.getUserId());
|
//model.setViewParam("location", "/apiUser/edit?msg=sucess&userId=" + model.getUserId());
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ public class ApiUserModel extends BaseModel {
|
|||||||
private String totalCountMap;
|
private String totalCountMap;
|
||||||
private Integer creditLevelStatus;
|
private Integer creditLevelStatus;
|
||||||
private String priceType;
|
private String priceType;
|
||||||
|
private String enterpriseVillageAi;
|
||||||
private Map<String,Double> priceRatingMap;
|
private Map<String,Double> priceRatingMap;
|
||||||
private Integer isMonitor;
|
private Integer isMonitor;
|
||||||
|
|
||||||
@@ -50,6 +51,14 @@ public class ApiUserModel extends BaseModel {
|
|||||||
|
|
||||||
private Integer isWarnExpired;
|
private Integer isWarnExpired;
|
||||||
|
|
||||||
|
public String getEnterpriseVillageAi() {
|
||||||
|
return enterpriseVillageAi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnterpriseVillageAi(String enterpriseVillageAi) {
|
||||||
|
this.enterpriseVillageAi = enterpriseVillageAi;
|
||||||
|
}
|
||||||
|
|
||||||
public String getPriceType() {
|
public String getPriceType() {
|
||||||
return priceType;
|
return priceType;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -155,6 +155,15 @@
|
|||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>对公涉农是否启用AI</td>
|
||||||
|
<td>
|
||||||
|
<select id="slt_enterpriseVillageAi" name="enterpriseVillageAi" style="width: 100px">
|
||||||
|
<option value="0" <#if !(apiUserBo.enterpriseVillageAi??) || apiUserBo.enterpriseVillageAi == "0">selected</#if>>否</option>
|
||||||
|
<option value="1" <#if apiUserBo.enterpriseVillageAi?? && apiUserBo.enterpriseVillageAi == "1">selected</#if>>是</option>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>siteName</td>
|
<td>siteName</td>
|
||||||
<td><input name="siteName" value="${apiUserBo.siteName!}"/></td>
|
<td><input name="siteName" value="${apiUserBo.siteName!}"/></td>
|
||||||
|
|||||||
@@ -33,12 +33,12 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
<version>1.6.1</version>
|
<version>1.7.25</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-log4j12</artifactId>
|
<artifactId>slf4j-log4j12</artifactId>
|
||||||
<version>1.6.1</version>
|
<version>1.7.25</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.testng</groupId>
|
<groupId>org.testng</groupId>
|
||||||
@@ -176,5 +176,10 @@
|
|||||||
<version>1.18.20</version>
|
<version>1.18.20</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.thoughtworks.xstream</groupId>
|
||||||
|
<artifactId>xstream</artifactId>
|
||||||
|
<version>1.4.1</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -8,9 +8,22 @@
|
|||||||
<name>fangjia-coresite</name>
|
<name>fangjia-coresite</name>
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<maven.build.timestamp.format>yyyyMMddHHmmss</maven.build.timestamp.format>
|
||||||
|
<asset.version>${maven.build.timestamp}</asset.version>
|
||||||
</properties>
|
</properties>
|
||||||
<build>
|
<build>
|
||||||
<finalName>fangjia-coresite</finalName>
|
<finalName>fangjia-coresite</finalName>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
<excludes><exclude>asset-version.properties</exclude></excludes>
|
||||||
|
</resource>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
<includes><include>asset-version.properties</include></includes>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
@@ -40,6 +53,12 @@
|
|||||||
<artifactId>sothis-web</artifactId>
|
<artifactId>sothis-web</artifactId>
|
||||||
<version>0.1.0-SNAPSHOT</version>
|
<version>0.1.0-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.sothis</groupId>
|
||||||
|
<artifactId>sothis-core</artifactId>
|
||||||
|
<version>0.1.0-SNAPSHOT</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
<artifactId>spring-web</artifactId>
|
<artifactId>spring-web</artifactId>
|
||||||
@@ -116,62 +135,62 @@
|
|||||||
<artifactId>html2image</artifactId>
|
<artifactId>html2image</artifactId>
|
||||||
<version>0.9</version>
|
<version>0.9</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.xmlgraphics</groupId>
|
<groupId>org.apache.xmlgraphics</groupId>
|
||||||
<artifactId>batik-awt-util</artifactId>
|
<artifactId>batik-awt-util</artifactId>
|
||||||
<version>1.7</version>
|
<version>1.7</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.xmlgraphics</groupId>
|
<groupId>org.apache.xmlgraphics</groupId>
|
||||||
<artifactId>batik-dom</artifactId>
|
<artifactId>batik-dom</artifactId>
|
||||||
<version>1.7</version>
|
<version>1.7</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.xmlgraphics</groupId>
|
<groupId>org.apache.xmlgraphics</groupId>
|
||||||
<artifactId>batik-ext</artifactId>
|
<artifactId>batik-ext</artifactId>
|
||||||
<version>1.7</version>
|
<version>1.7</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.xmlgraphics</groupId>
|
<groupId>org.apache.xmlgraphics</groupId>
|
||||||
<artifactId>batik-svggen</artifactId>
|
<artifactId>batik-svggen</artifactId>
|
||||||
<version>1.7</version>
|
<version>1.7</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.xmlgraphics</groupId>
|
<groupId>org.apache.xmlgraphics</groupId>
|
||||||
<artifactId>batik-util</artifactId>
|
<artifactId>batik-util</artifactId>
|
||||||
<version>1.7</version>
|
<version>1.7</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.xmlgraphics</groupId>
|
<groupId>org.apache.xmlgraphics</groupId>
|
||||||
<artifactId>batik-xml</artifactId>
|
<artifactId>batik-xml</artifactId>
|
||||||
<version>1.7</version>
|
<version>1.7</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.xmlgraphics</groupId>
|
<groupId>org.apache.xmlgraphics</groupId>
|
||||||
<artifactId>batik-transcoder</artifactId>
|
<artifactId>batik-transcoder</artifactId>
|
||||||
<version>1.7</version>
|
<version>1.7</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.xmlgraphics</groupId>
|
<groupId>org.apache.xmlgraphics</groupId>
|
||||||
<artifactId>batik-bridge</artifactId>
|
<artifactId>batik-bridge</artifactId>
|
||||||
<version>1.7</version>
|
<version>1.7</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.xmlgraphics</groupId>
|
<groupId>org.apache.xmlgraphics</groupId>
|
||||||
<artifactId>batik-css</artifactId>
|
<artifactId>batik-css</artifactId>
|
||||||
<version>1.7</version>
|
<version>1.7</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.xmlgraphics</groupId>
|
<groupId>org.apache.xmlgraphics</groupId>
|
||||||
<artifactId>batik-gvt</artifactId>
|
<artifactId>batik-gvt</artifactId>
|
||||||
@@ -182,19 +201,19 @@
|
|||||||
<artifactId>batik-svg-dom</artifactId>
|
<artifactId>batik-svg-dom</artifactId>
|
||||||
<version>1.7</version>
|
<version>1.7</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>xml-apis</groupId>
|
<groupId>xml-apis</groupId>
|
||||||
<artifactId>xml-apis-ext</artifactId>
|
<artifactId>xml-apis-ext</artifactId>
|
||||||
<version>1.3.04</version>
|
<version>1.3.04</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.xmlgraphics</groupId>
|
<groupId>org.apache.xmlgraphics</groupId>
|
||||||
<artifactId>batik-parser</artifactId>
|
<artifactId>batik-parser</artifactId>
|
||||||
<version>1.7</version>
|
<version>1.7</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.xmlgraphics</groupId>
|
<groupId>org.apache.xmlgraphics</groupId>
|
||||||
<artifactId>batik-anim</artifactId>
|
<artifactId>batik-anim</artifactId>
|
||||||
@@ -206,31 +225,31 @@
|
|||||||
<artifactId>batik-script</artifactId>
|
<artifactId>batik-script</artifactId>
|
||||||
<version>1.7</version>
|
<version>1.7</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.xmlgraphics</groupId>
|
<groupId>org.apache.xmlgraphics</groupId>
|
||||||
<artifactId>batik-codec</artifactId>
|
<artifactId>batik-codec</artifactId>
|
||||||
<version>1.7</version>
|
<version>1.7</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.xhtmlrenderer</groupId>
|
<groupId>org.xhtmlrenderer</groupId>
|
||||||
<artifactId>renderer</artifactId>
|
<artifactId>renderer</artifactId>
|
||||||
<version>1.0</version>
|
<version>1.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.jsoup</groupId>
|
<groupId>org.jsoup</groupId>
|
||||||
<artifactId>jsoup</artifactId>
|
<artifactId>jsoup</artifactId>
|
||||||
<version>1.7.2</version>
|
<version>1.7.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.lowagie</groupId>
|
<groupId>com.lowagie</groupId>
|
||||||
<artifactId>text</artifactId>
|
<artifactId>text</artifactId>
|
||||||
<version>2.1.7</version>
|
<version>2.1.7</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bouncycastle</groupId>
|
<groupId>org.bouncycastle</groupId>
|
||||||
<artifactId>bcprov-jdk15on</artifactId>
|
<artifactId>bcprov-jdk15on</artifactId>
|
||||||
@@ -242,5 +261,16 @@
|
|||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
<classifier>jdk18</classifier>
|
<classifier>jdk18</classifier>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- 强制统一 SLF4J 版本,避免 CXF 2.2.3 引入旧版 slf4j-api 与 nacos-client 的 jcl-over-slf4j 1.7.x 冲突 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
<version>1.7.25</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>jcl-over-slf4j</artifactId>
|
||||||
|
<version>1.7.25</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package com.fangjia.coresite.model;
|
package com.fangjia.coresite.model;
|
||||||
|
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.IOException;
|
||||||
import java.net.URLDecoder;
|
import java.net.URLDecoder;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
@@ -9,6 +11,7 @@ import java.util.HashMap;
|
|||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Properties;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.sothis.core.util.Pager;
|
import org.sothis.core.util.Pager;
|
||||||
@@ -37,6 +40,25 @@ public class BaseModel extends ModelAndViewSupport {
|
|||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
private String debugFtl;
|
private String debugFtl;
|
||||||
private final static FangjiaConfig CONFIG = FangjiaConfig.getConfig();
|
private final static FangjiaConfig CONFIG = FangjiaConfig.getConfig();
|
||||||
|
private static final String ASSET_VERSION = loadAssetVersion();
|
||||||
|
|
||||||
|
private static String loadAssetVersion() {
|
||||||
|
InputStream input = BaseModel.class.getResourceAsStream("/asset-version.properties");
|
||||||
|
if (input != null) {
|
||||||
|
try {
|
||||||
|
Properties properties = new Properties();
|
||||||
|
properties.load(input);
|
||||||
|
String version = properties.getProperty("asset.version");
|
||||||
|
if (version != null && version.length() > 0 && !version.startsWith("${")) {
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
} catch (IOException ignored) {
|
||||||
|
} finally {
|
||||||
|
try { input.close(); } catch (IOException ignored) { }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return String.valueOf(System.currentTimeMillis());
|
||||||
|
}
|
||||||
|
|
||||||
private final static String STATIC_URL = "http://" + CONFIG.getStaticDomainName()
|
private final static String STATIC_URL = "http://" + CONFIG.getStaticDomainName()
|
||||||
+ (CONFIG.isDevelopmentEnvironment() ? "/fangjia-static" : "/stc");
|
+ (CONFIG.isDevelopmentEnvironment() ? "/fangjia-static" : "/stc");
|
||||||
@@ -216,7 +238,7 @@ public class BaseModel extends ModelAndViewSupport {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final String getVersion() {
|
public final String getVersion() {
|
||||||
return String.valueOf(System.currentTimeMillis());
|
return ASSET_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final String getHisCityUrl() {
|
public final String getHisCityUrl() {
|
||||||
@@ -638,4 +660,4 @@ public class BaseModel extends ModelAndViewSupport {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
asset.version=${asset.version}
|
||||||
@@ -183,7 +183,7 @@
|
|||||||
<div class="index-box-03 mobile01">
|
<div class="index-box-03 mobile01">
|
||||||
<div class="index-box-left">
|
<div class="index-box-left">
|
||||||
<div class="icon_bg"><div class="icon08"></div><label>服务与合作</label></div>
|
<div class="icon_bg"><div class="icon08"></div><label>服务与合作</label></div>
|
||||||
<div class="text">地址:上海市长宁区金钟路658弄10号201-202室</div>
|
<div class="text">地址:上海市长宁区金钟路658弄10号楼206-027室</div>
|
||||||
<div class="text">邮箱:support@fangjia.com</div>
|
<div class="text">邮箱:support@fangjia.com</div>
|
||||||
<div class="text">邮编:200003</div>
|
<div class="text">邮编:200003</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ public class ApiUserCfg implements MongoEntity {
|
|||||||
|
|
||||||
public enum ApiUserCfgKey{
|
public enum ApiUserCfgKey{
|
||||||
EVALUATE_RATE,
|
EVALUATE_RATE,
|
||||||
PRICE_TYPE;
|
PRICE_TYPE,
|
||||||
|
ENTERPRISE_VILLAGE_AI;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.fangjia.dal.mongo.model;
|
package com.fangjia.dal.mongo.model;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import javax.persistence.Column;
|
import javax.persistence.Column;
|
||||||
@@ -12,7 +13,7 @@ import com.fangjia.dal.MongoEntity;
|
|||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
@Table(name = "fangjia_base.baidu_place_poi")
|
@Table(name = "fangjia_base.baidu_place_poi")
|
||||||
public class BaiduPlacePoi implements MongoEntity {
|
public class BaiduPlacePoi implements MongoEntity, Serializable {
|
||||||
private static final long serialVersionUID = 1840436549012703563L;
|
private static final long serialVersionUID = 1840436549012703563L;
|
||||||
private String id;
|
private String id;
|
||||||
private String city;//城市
|
private String city;//城市
|
||||||
|
|||||||
@@ -170,5 +170,16 @@
|
|||||||
<version>0.1.0-SNAPSHOT</version>
|
<version>0.1.0-SNAPSHOT</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- 强制统一 SLF4J 版本,避免 CXF 2.2.3 引入旧版 slf4j-api 与 nacos-client 的 jcl-over-slf4j 1.7.x 冲突 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
<version>1.7.25</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>jcl-over-slf4j</artifactId>
|
||||||
|
<version>1.7.25</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
+51
@@ -1,6 +1,7 @@
|
|||||||
package com.fangjia.open.controllers;
|
package com.fangjia.open.controllers;
|
||||||
|
|
||||||
import com.fangjia.core.util.HttpRequest;
|
import com.fangjia.core.util.HttpRequest;
|
||||||
|
import com.fangjia.dal.mongo.model.ApiUserCfg;
|
||||||
import com.fangjia.dal.mongo.model.Township;
|
import com.fangjia.dal.mongo.model.Township;
|
||||||
import com.fangjia.dal.mongo.model.VillageIdentify;
|
import com.fangjia.dal.mongo.model.VillageIdentify;
|
||||||
import com.fangjia.dal.seaweed.model.District;
|
import com.fangjia.dal.seaweed.model.District;
|
||||||
@@ -10,6 +11,7 @@ import com.fangjia.open.dto.addressGovernance.DistrictDto;
|
|||||||
import com.fangjia.open.dto.addressGovernance.DistrictIdentifyDto;
|
import com.fangjia.open.dto.addressGovernance.DistrictIdentifyDto;
|
||||||
import com.fangjia.open.dto.addressGovernance.MatchedBuildingDto;
|
import com.fangjia.open.dto.addressGovernance.MatchedBuildingDto;
|
||||||
import com.fangjia.open.dto.addressGovernance.StructureAndCompleteDto;
|
import com.fangjia.open.dto.addressGovernance.StructureAndCompleteDto;
|
||||||
|
import com.fangjia.open.interceptors.AuthenticationBean;
|
||||||
import com.fangjia.open.interceptors.Authority;
|
import com.fangjia.open.interceptors.Authority;
|
||||||
import com.fangjia.open.interceptors.Role;
|
import com.fangjia.open.interceptors.Role;
|
||||||
import com.fangjia.open.model.AddesssMatchModel;
|
import com.fangjia.open.model.AddesssMatchModel;
|
||||||
@@ -22,6 +24,7 @@ import com.fangjia.service.datastore.DistrictService;
|
|||||||
import com.fangjia.service.district.DistrictStatService;
|
import com.fangjia.service.district.DistrictStatService;
|
||||||
import com.fangjia.service.mongo.fangjia.TownshipService;
|
import com.fangjia.service.mongo.fangjia.TownshipService;
|
||||||
import com.fangjia.service.mongo.fangjia.VillageIdentifyService;
|
import com.fangjia.service.mongo.fangjia.VillageIdentifyService;
|
||||||
|
import com.fangjia.service.api.ApiUserCfgService;
|
||||||
import com.fangjia.service.open.DistrictAnalyDataService;
|
import com.fangjia.service.open.DistrictAnalyDataService;
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.JsonArray;
|
import com.google.gson.JsonArray;
|
||||||
@@ -42,8 +45,10 @@ import org.apache.http.impl.conn.DefaultProxyRoutePlanner;
|
|||||||
import org.apache.http.util.EntityUtils;
|
import org.apache.http.util.EntityUtils;
|
||||||
import org.sothis.core.util.CollectionUtils;
|
import org.sothis.core.util.CollectionUtils;
|
||||||
import org.sothis.core.util.Pager;
|
import org.sothis.core.util.Pager;
|
||||||
|
import org.sothis.web.mvc.ActionContext;
|
||||||
import sun.misc.BASE64Encoder;
|
import sun.misc.BASE64Encoder;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.Authenticator;
|
import java.net.Authenticator;
|
||||||
import java.net.PasswordAuthentication;
|
import java.net.PasswordAuthentication;
|
||||||
@@ -64,6 +69,7 @@ public class AddrSvcController {
|
|||||||
private VillageIdentifyService villageIdentifyService;
|
private VillageIdentifyService villageIdentifyService;
|
||||||
private DistrictAnalyDataService districtAnalyDataService;
|
private DistrictAnalyDataService districtAnalyDataService;
|
||||||
private TownshipService townshipService;
|
private TownshipService townshipService;
|
||||||
|
private ApiUserCfgService apiUserCfgService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 地址结构化
|
* 地址结构化
|
||||||
@@ -186,6 +192,13 @@ public class AddrSvcController {
|
|||||||
BasicModel basicModel = new BasicModel(code, msg);
|
BasicModel basicModel = new BasicModel(code, msg);
|
||||||
if (json.containsKey("result")) {
|
if (json.containsKey("result")) {
|
||||||
StructureAndCompleteDto structureAndCompleteDto = CommonDtoUtils.transformV(StructureAndCompleteDto.class, json.get("result"));
|
StructureAndCompleteDto structureAndCompleteDto = CommonDtoUtils.transformV(StructureAndCompleteDto.class, json.get("result"));
|
||||||
|
JSONObject result = json.getJSONObject("result");
|
||||||
|
if(result.containsKey("addressAssessment")){
|
||||||
|
JSONObject addressAssessment = result.getJSONObject("addressAssessment");
|
||||||
|
if(addressAssessment.containsKey("msg")){
|
||||||
|
structureAndCompleteDto.setAddrVerify(addressAssessment.getString("msg"));
|
||||||
|
}
|
||||||
|
}
|
||||||
if("1".equals(model.getShowCode())){
|
if("1".equals(model.getShowCode())){
|
||||||
if(StringUtils.isNotBlank(structureAndCompleteDto.getProvinceCode())){
|
if(StringUtils.isNotBlank(structureAndCompleteDto.getProvinceCode())){
|
||||||
structureAndCompleteDto.setProvinceCode(structureAndCompleteDto.getProvinceCode().substring(0, 6));
|
structureAndCompleteDto.setProvinceCode(structureAndCompleteDto.getProvinceCode().substring(0, 6));
|
||||||
@@ -559,6 +572,23 @@ public class AddrSvcController {
|
|||||||
params.put("address", address);
|
params.put("address", address);
|
||||||
String type = StringUtils.isNotBlank(model.getType()) ? model.getType() : null;
|
String type = StringUtils.isNotBlank(model.getType()) ? model.getType() : null;
|
||||||
params.put("type", type);
|
params.put("type", type);
|
||||||
|
if (model.getAi() != null && model.getAi() == 1) {
|
||||||
|
params.put("ai", "1");
|
||||||
|
} else {
|
||||||
|
HttpServletRequest req = ActionContext.getContext().getRequest();
|
||||||
|
if (req != null && apiUserCfgService != null) {
|
||||||
|
AuthenticationBean authenticationBean = (AuthenticationBean) req.getAttribute(AuthenticationBean.ATTR_AUTHENTICATION_BEAN);
|
||||||
|
if (authenticationBean != null && authenticationBean.apiUser != null) {
|
||||||
|
ApiUserCfg apiUserCfg = apiUserCfgService.findByUserId(authenticationBean.apiUser.getId(), ApiUserCfg.ApiUserCfgKey.ENTERPRISE_VILLAGE_AI);
|
||||||
|
if (apiUserCfg != null && apiUserCfg.getCfgValue() != null) {
|
||||||
|
String aiVal = apiUserCfg.getCfgValue().toString();
|
||||||
|
if ("1".equals(aiVal) || "true".equalsIgnoreCase(aiVal)) {
|
||||||
|
params.put("ai", "1");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/v6/villageIdentify", params, "UTF-8");
|
json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/v6/villageIdentify", params, "UTF-8");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -1114,6 +1144,23 @@ public class AddrSvcController {
|
|||||||
} else {
|
} else {
|
||||||
Integer radius = model.getRadius();
|
Integer radius = model.getRadius();
|
||||||
params.put("radius", (radius != null && radius != 0) ? radius.toString() : null);
|
params.put("radius", (radius != null && radius != 0) ? radius.toString() : null);
|
||||||
|
if(model.getAi() != null && model.getAi() == 1){
|
||||||
|
params.put("ai", "1");
|
||||||
|
}else{
|
||||||
|
HttpServletRequest req = ActionContext.getContext().getRequest();
|
||||||
|
if (req != null && apiUserCfgService != null) {
|
||||||
|
AuthenticationBean authenticationBean = (AuthenticationBean) req.getAttribute(AuthenticationBean.ATTR_AUTHENTICATION_BEAN);
|
||||||
|
if (authenticationBean != null && authenticationBean.apiUser != null) {
|
||||||
|
ApiUserCfg apiUserCfg = apiUserCfgService.findByUserId(authenticationBean.apiUser.getId(), ApiUserCfg.ApiUserCfgKey.ENTERPRISE_VILLAGE_AI);
|
||||||
|
if (apiUserCfg != null && apiUserCfg.getCfgValue() != null) {
|
||||||
|
String aiVal = apiUserCfg.getCfgValue().toString();
|
||||||
|
if ("1".equals(aiVal) || "true".equalsIgnoreCase(aiVal)) {
|
||||||
|
params.put("ai", "1");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/enterpriseVillageIdentify", params, "UTF-8");
|
json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/enterpriseVillageIdentify", params, "UTF-8");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -1738,4 +1785,8 @@ public class AddrSvcController {
|
|||||||
public void setTownshipService(TownshipService townshipService) {
|
public void setTownshipService(TownshipService townshipService) {
|
||||||
this.townshipService = townshipService;
|
this.townshipService = townshipService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setApiUserCfgService(ApiUserCfgService apiUserCfgService) {
|
||||||
|
this.apiUserCfgService = apiUserCfgService;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -3448,7 +3448,7 @@ public class AddressController {
|
|||||||
headers.put("Content-Type", "application/json");
|
headers.put("Content-Type", "application/json");
|
||||||
headers.put("Authorization", "Basic " + authenticationEncoding + "");
|
headers.put("Authorization", "Basic " + authenticationEncoding + "");
|
||||||
try {
|
try {
|
||||||
String response = request.postWithBody("http://192.168.0.45:9200/association/_search", reqBody, headers, "UTF-8");
|
String response = request.postWithBody("http://192.168.0.206:9200/association/_search", reqBody, headers, "UTF-8");
|
||||||
JSONObject json = JSONObject.fromObject(response);
|
JSONObject json = JSONObject.fromObject(response);
|
||||||
if (!json.containsKey("hits") || !json.getJSONObject("hits").containsKey("hits")) {
|
if (!json.containsKey("hits") || !json.getJSONObject("hits").containsKey("hits")) {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
|
|||||||
+29
@@ -1,14 +1,19 @@
|
|||||||
package com.fangjia.open.controllers;
|
package com.fangjia.open.controllers;
|
||||||
|
|
||||||
import com.fangjia.core.util.HttpRequest;
|
import com.fangjia.core.util.HttpRequest;
|
||||||
|
import com.fangjia.dal.mongo.model.ApiUserCfg;
|
||||||
|
import com.fangjia.open.interceptors.AuthenticationBean;
|
||||||
import com.fangjia.open.interceptors.Authority;
|
import com.fangjia.open.interceptors.Authority;
|
||||||
import com.fangjia.open.interceptors.Role;
|
import com.fangjia.open.interceptors.Role;
|
||||||
import com.fangjia.open.model.AddressModel;
|
import com.fangjia.open.model.AddressModel;
|
||||||
import com.fangjia.open.model.BasicModel;
|
import com.fangjia.open.model.BasicModel;
|
||||||
import com.fangjia.open.model.RestfulModelAndView;
|
import com.fangjia.open.model.RestfulModelAndView;
|
||||||
|
import com.fangjia.service.api.ApiUserCfgService;
|
||||||
import net.sf.json.JSONObject;
|
import net.sf.json.JSONObject;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
import org.sothis.web.mvc.ActionContext;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@@ -18,6 +23,8 @@ import java.util.Map;
|
|||||||
@Authority(role = Role.USER)
|
@Authority(role = Role.USER)
|
||||||
public class GdBankController {
|
public class GdBankController {
|
||||||
|
|
||||||
|
private ApiUserCfgService apiUserCfgService;
|
||||||
|
|
||||||
private static final Map<String, String> areaMap = new HashMap<String, String>() {
|
private static final Map<String, String> areaMap = new HashMap<String, String>() {
|
||||||
{
|
{
|
||||||
// 添加键值对到 Map 中
|
// 添加键值对到 Map 中
|
||||||
@@ -88,6 +95,24 @@ public class GdBankController {
|
|||||||
Map<String, String> params = new HashMap<String, String>();
|
Map<String, String> params = new HashMap<String, String>();
|
||||||
params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : null);
|
params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : null);
|
||||||
params.put("address", model.getAddress());
|
params.put("address", model.getAddress());
|
||||||
|
if(model.getAi() != null && model.getAi() == 1){
|
||||||
|
params.put("ai", "1");
|
||||||
|
}else{
|
||||||
|
HttpServletRequest req = ActionContext.getContext().getRequest();
|
||||||
|
if (req != null && apiUserCfgService != null) {
|
||||||
|
AuthenticationBean authenticationBean = (AuthenticationBean) req.getAttribute(AuthenticationBean.ATTR_AUTHENTICATION_BEAN);
|
||||||
|
if (authenticationBean != null && authenticationBean.apiUser != null) {
|
||||||
|
ApiUserCfg apiUserCfg = apiUserCfgService.findByUserId(authenticationBean.apiUser.getId(), ApiUserCfg.ApiUserCfgKey.ENTERPRISE_VILLAGE_AI);
|
||||||
|
if (apiUserCfg != null && apiUserCfg.getCfgValue() != null) {
|
||||||
|
String aiVal = apiUserCfg.getCfgValue().toString();
|
||||||
|
if ("1".equals(aiVal) || "true".equalsIgnoreCase(aiVal)) {
|
||||||
|
params.put("ai", "1");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/cebEnterpriseVillageIdentify", params, "UTF-8");
|
json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/cebEnterpriseVillageIdentify", params, "UTF-8");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
@@ -115,4 +140,8 @@ public class GdBankController {
|
|||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setApiUserCfgService(ApiUserCfgService apiUserCfgService) {
|
||||||
|
this.apiUserCfgService = apiUserCfgService;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-4
@@ -531,8 +531,9 @@ public class OfficeController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
model.setRegion(district.getRegion());
|
model.setRegion(district.getRegion());
|
||||||
|
model.setDistrict(district.getRegion());
|
||||||
model.setDistrictName(district.getName());
|
model.setDistrictName(district.getName());
|
||||||
|
model.setCity(district.getCity());
|
||||||
OfficeEvaluationDto evaluation = officeService.evaluateRent(district, buildEvaluation(model, request));
|
OfficeEvaluationDto evaluation = officeService.evaluateRent(district, buildEvaluation(model, request));
|
||||||
|
|
||||||
if (evaluation.getUnitPrice() != null && evaluation.getUnitPrice() != 0) {
|
if (evaluation.getUnitPrice() != null && evaluation.getUnitPrice() != 0) {
|
||||||
@@ -782,8 +783,9 @@ public class OfficeController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
model.setRegion(district.getRegion());
|
model.setRegion(district.getRegion());
|
||||||
|
model.setDistrict(district.getRegion());
|
||||||
model.setDistrictName(district.getName());
|
model.setDistrictName(district.getName());
|
||||||
|
model.setCity(district.getCity());
|
||||||
OfficeEvaluationDto evaluation = officeService.evaluateRent(district, buildEvaluation(model, request));
|
OfficeEvaluationDto evaluation = officeService.evaluateRent(district, buildEvaluation(model, request));
|
||||||
|
|
||||||
if (evaluation.getUnitPrice() != null && evaluation.getUnitPrice() != 0) {
|
if (evaluation.getUnitPrice() != null && evaluation.getUnitPrice() != 0) {
|
||||||
@@ -862,10 +864,10 @@ public class OfficeController {
|
|||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
model.setRegion(district.getRegion());
|
model.setRegion(district.getRegion());
|
||||||
|
model.setDistrict(district.getRegion());
|
||||||
model.setDistrictName(district.getName());
|
model.setDistrictName(district.getName());
|
||||||
|
model.setCity(district.getCity());
|
||||||
OfficeEvaluationDto evaluation = officeService.evaluateRent(district, buildEvaluation(model, request));
|
OfficeEvaluationDto evaluation = officeService.evaluateRent(district, buildEvaluation(model, request));
|
||||||
Double minPrice = null;
|
Double minPrice = null;
|
||||||
Double maxPrice = null;
|
Double maxPrice = null;
|
||||||
|
|||||||
+6
-2
@@ -312,8 +312,9 @@ public class OfficeSellController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
model.setRegion(district.getRegion());
|
model.setRegion(district.getRegion());
|
||||||
|
model.setDistrict(district.getRegion());
|
||||||
model.setDistrictName(district.getName());
|
model.setDistrictName(district.getName());
|
||||||
|
model.setCity(district.getCity());
|
||||||
OfficeEvaluationDto evaluation = officeService.evaluateSell(district, buildEvaluation(model, request));
|
OfficeEvaluationDto evaluation = officeService.evaluateSell(district, buildEvaluation(model, request));
|
||||||
|
|
||||||
if (evaluation.getUnitPrice() != null && evaluation.getUnitPrice() != 0) {
|
if (evaluation.getUnitPrice() != null && evaluation.getUnitPrice() != 0) {
|
||||||
@@ -507,8 +508,9 @@ public class OfficeSellController {
|
|||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
model.setCity(district.getCity());
|
||||||
model.setRegion(district.getRegion());
|
model.setRegion(district.getRegion());
|
||||||
|
model.setDistrict(district.getRegion());
|
||||||
model.setDistrictName(district.getName());
|
model.setDistrictName(district.getName());
|
||||||
OfficeEvaluationDto evaluation = officeService.evaluateSell(district, buildEvaluation(model, request));
|
OfficeEvaluationDto evaluation = officeService.evaluateSell(district, buildEvaluation(model, request));
|
||||||
if (evaluation.getUnitPrice() != null && evaluation.getUnitPrice() != 0) {
|
if (evaluation.getUnitPrice() != null && evaluation.getUnitPrice() != 0) {
|
||||||
@@ -602,7 +604,9 @@ public class OfficeSellController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
model.setRegion(district.getRegion());
|
model.setRegion(district.getRegion());
|
||||||
|
model.setDistrict(district.getRegion());
|
||||||
model.setDistrictName(district.getName());
|
model.setDistrictName(district.getName());
|
||||||
|
model.setCity(district.getCity());
|
||||||
OfficeEvaluationDto evaluation = officeService.evaluateSell(district, buildEvaluation(model, request));
|
OfficeEvaluationDto evaluation = officeService.evaluateSell(district, buildEvaluation(model, request));
|
||||||
if (evaluation.getUnitPrice() != null && evaluation.getUnitPrice() != 0) {
|
if (evaluation.getUnitPrice() != null && evaluation.getUnitPrice() != 0) {
|
||||||
|
|
||||||
|
|||||||
+240
-27
@@ -13,6 +13,11 @@ import java.nio.charset.Charset;
|
|||||||
import java.text.ParseException;
|
import java.text.ParseException;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
import java.util.concurrent.Callable;
|
||||||
|
import java.util.concurrent.ExecutorService;
|
||||||
|
import java.util.concurrent.Executors;
|
||||||
|
import java.util.concurrent.Future;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
@@ -348,13 +353,166 @@ public class PropertyController {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 不适合做配套展示的POI类型(优先级高于AROUND_KEYWORD_FACTOR_NEW匹配,小类/中类命中任一即排除)
|
||||||
|
*/
|
||||||
|
private static final Set<String> AROUND_EXCLUDE_TYPES = new HashSet<String>() {
|
||||||
|
{
|
||||||
|
// 学校类:高等院校/职校/成人教育/培训机构/学校内部设施
|
||||||
|
add("高等院校");
|
||||||
|
add("职业技术学校");
|
||||||
|
add("成人教育");
|
||||||
|
add("培训机构");
|
||||||
|
add("学校内部设施");
|
||||||
|
// 医疗类:诊所/卫生院/疗养院/口腔医院/整形美容
|
||||||
|
add("诊所");
|
||||||
|
add("卫生院");
|
||||||
|
add("疗养院");
|
||||||
|
add("口腔医院");
|
||||||
|
add("整形美容");
|
||||||
|
// 银行类:ATM及自助银行(仅展示银行网点)
|
||||||
|
add("自动提款机");
|
||||||
|
add("银行相关");
|
||||||
|
// 交通类:机场出发/到达口及直升机场(仅展示飞机场),公交车站(公交数据来自busStationService),货运设施
|
||||||
|
add("机场出发/到达");
|
||||||
|
add("直升机场");
|
||||||
|
add("公交车站相关");
|
||||||
|
add("货运火车站");
|
||||||
|
add("货运港口码头");
|
||||||
|
// 餐饮类:茶艺馆/冷饮店/糕饼店/甜品店/餐饮相关(泛称,POI名多为店名无意义)
|
||||||
|
add("茶艺馆");
|
||||||
|
add("冷饮店");
|
||||||
|
add("糕饼店");
|
||||||
|
add("甜品店");
|
||||||
|
add("餐饮相关场所");
|
||||||
|
add("餐饮相关");
|
||||||
|
// 餐饮类:泛中餐厅/快餐厅/休闲餐饮场所(高德把无法细分的小餐馆全归此类,噪音主力),老字号
|
||||||
|
add("中餐厅");
|
||||||
|
add("快餐厅");
|
||||||
|
add("休闲餐饮场所");
|
||||||
|
add("老字号");
|
||||||
|
// 酒店类:经济型连锁酒店/旅馆招待所/青年旅舍/住宿服务相关(低质POI多)
|
||||||
|
add("经济型连锁酒店");
|
||||||
|
add("旅馆招待所");
|
||||||
|
add("青年旅舍");
|
||||||
|
add("住宿服务相关");
|
||||||
|
// 健身类:游泳馆/运动场所/户外健身场所(仅保留健身中心/综合体育馆)
|
||||||
|
add("游泳馆");
|
||||||
|
add("运动场所");
|
||||||
|
add("户外健身场所");
|
||||||
|
// 购物类:小商品市场及菜市场经济类(农副/蔬菜/果品/水产/花鸟等,超市分类仅展示现代商超)
|
||||||
|
add("小商品市场");
|
||||||
|
add("农副产品市场");
|
||||||
|
add("蔬菜市场");
|
||||||
|
add("果品市场");
|
||||||
|
add("水产海鲜市场");
|
||||||
|
add("花鸟鱼虫市场");
|
||||||
|
add("花卉市场");
|
||||||
|
add("宠物市场");
|
||||||
|
add("旧货市场");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* POI类型 -> 配套分类(英文key)映射。
|
||||||
|
* 通用类型兼容百度POI keyword; 高德POI优先按small_type精确匹配,未命中再按secondary_type中类匹配。
|
||||||
|
*/
|
||||||
private static final Map<String, String> AROUND_KEYWORD_FACTOR_NEW = new HashMap<String, String>() {
|
private static final Map<String, String> AROUND_KEYWORD_FACTOR_NEW = new HashMap<String, String>() {
|
||||||
{
|
{
|
||||||
|
// ===== 高德POI secondary_type(中类) =====
|
||||||
|
// 学校(中小学及幼儿园,高等院校/职业技术学校/成人教育/培训机构等见排除表)
|
||||||
put("学校", "school");
|
put("学校", "school");
|
||||||
put("医院", "hospital");
|
// 医疗(综合医院/三级甲等医院及眼科/骨科等专科,诊所/卫生院/口腔/整形等见排除表)
|
||||||
|
put("综合医院", "hospital");
|
||||||
|
put("专科医院", "hospital");
|
||||||
|
// 银行(仅银行网点中类,ATM/银行相关见排除表)
|
||||||
put("银行", "bank");
|
put("银行", "bank");
|
||||||
put("超市", "supermarket");
|
// 超市/商场
|
||||||
|
put("超级市场", "supermarket");
|
||||||
put("商场", "market");
|
put("商场", "market");
|
||||||
|
put("便民商店/便利店", "supermarket");
|
||||||
|
put("综合市场", "market");
|
||||||
|
// 美容美发
|
||||||
|
put("美容美发店", "beautySalon");
|
||||||
|
// 健身/运动
|
||||||
|
put("运动场馆", "gym");
|
||||||
|
// 公园
|
||||||
|
put("公园广场", "park");
|
||||||
|
// 交通
|
||||||
|
put("机场相关", "airport");
|
||||||
|
put("火车站", "trainStation");
|
||||||
|
put("长途汽车站", "trainStation");
|
||||||
|
put("港口码头", "dock");
|
||||||
|
// 餐饮(仅保留有品类辨识度的:外国餐厅中类/咖啡厅中类;泛称类中餐厅/快餐厅/休闲餐饮场所等见排除表)
|
||||||
|
put("外国餐厅", "restaurant");
|
||||||
|
put("咖啡厅", "restaurant");
|
||||||
|
// 酒店(旅馆招待所/住宿服务相关/经济型连锁酒店等见排除表)
|
||||||
|
put("宾馆酒店", "hotel");
|
||||||
|
|
||||||
|
// ===== 高德POI small_type(小类)精确补充 =====
|
||||||
|
// 学校
|
||||||
|
put("小学", "school");
|
||||||
|
put("中学", "school");
|
||||||
|
put("幼儿园", "school");
|
||||||
|
// 医疗(不含药房/医药保健销售/宠物医疗/口腔/整形)
|
||||||
|
put("三级甲等医院", "hospital");
|
||||||
|
// 超市/商场(超市小类由超级市场中类覆盖,小商品市场等见排除表)
|
||||||
|
put("购物中心", "supermarket");
|
||||||
|
put("普通商场", "market");
|
||||||
|
// 健身/运动(游泳馆/运动场所/户外健身场所等见排除表)
|
||||||
|
put("健身中心", "gym");
|
||||||
|
put("综合体育馆", "gym");
|
||||||
|
// 公园
|
||||||
|
put("公园", "park");
|
||||||
|
put("公园广场", "park");
|
||||||
|
put("城市广场", "park");
|
||||||
|
// 交通(货运火车站/货运港口码头见排除表)
|
||||||
|
put("地铁站", "metro");
|
||||||
|
put("火车站", "trainStation");
|
||||||
|
put("长途汽车站", "trainStation");
|
||||||
|
put("港口码头", "dock");
|
||||||
|
put("客运港", "dock");
|
||||||
|
put("飞机场", "airport");
|
||||||
|
// 餐饮(仅保留有品类辨识度的小类:菜系/火锅/酒楼/料理等)
|
||||||
|
put("综合酒楼", "restaurant");
|
||||||
|
put("火锅店", "restaurant");
|
||||||
|
put("特色/地方风味餐厅", "restaurant");
|
||||||
|
put("四川菜(川菜)", "restaurant");
|
||||||
|
put("湖南菜(湘菜)", "restaurant");
|
||||||
|
put("广东菜(粤菜)", "restaurant");
|
||||||
|
put("东北菜", "restaurant");
|
||||||
|
put("安徽菜(徽菜)", "restaurant");
|
||||||
|
put("福建菜", "restaurant");
|
||||||
|
put("浙江菜", "restaurant");
|
||||||
|
put("江苏菜", "restaurant");
|
||||||
|
put("上海菜", "restaurant");
|
||||||
|
put("北京菜", "restaurant");
|
||||||
|
put("湖北菜(鄂菜)", "restaurant");
|
||||||
|
put("云贵菜", "restaurant");
|
||||||
|
put("西北菜", "restaurant");
|
||||||
|
put("台湾菜", "restaurant");
|
||||||
|
put("潮州菜", "restaurant");
|
||||||
|
put("山东菜(鲁菜)", "restaurant");
|
||||||
|
put("清真菜馆", "restaurant");
|
||||||
|
put("海鲜酒楼", "restaurant");
|
||||||
|
put("中式素菜馆", "restaurant");
|
||||||
|
put("日本料理", "restaurant");
|
||||||
|
put("韩国料理", "restaurant");
|
||||||
|
put("外国餐厅", "restaurant");
|
||||||
|
put("西餐厅(综合风味)", "restaurant");
|
||||||
|
put("茶餐厅", "restaurant");
|
||||||
|
put("咖啡厅", "restaurant");
|
||||||
|
put("星巴克咖啡", "restaurant");
|
||||||
|
put("上岛咖啡", "restaurant");
|
||||||
|
// 酒店(经济型连锁酒店/旅馆招待所/青年旅舍等见排除表)
|
||||||
|
put("宾馆酒店", "hotel");
|
||||||
|
put("三星级宾馆", "hotel");
|
||||||
|
put("四星级宾馆", "hotel");
|
||||||
|
put("五星级宾馆", "hotel");
|
||||||
|
put("奢华酒店", "hotel");
|
||||||
|
|
||||||
|
// ===== 百度POI keyword(兼容旧数据) =====
|
||||||
|
put("医院", "hospital");
|
||||||
put("美容院", "beautySalon");
|
put("美容院", "beautySalon");
|
||||||
put("健身中心", "gym");
|
put("健身中心", "gym");
|
||||||
put("公园/绿地", "park");
|
put("公园/绿地", "park");
|
||||||
@@ -362,12 +520,12 @@ public class PropertyController {
|
|||||||
put("公交", "bus");
|
put("公交", "bus");
|
||||||
put("码头", "dock");
|
put("码头", "dock");
|
||||||
put("机场", "airport");
|
put("机场", "airport");
|
||||||
put("火车站", "trainStation");
|
|
||||||
put("餐馆", "restaurant");
|
put("餐馆", "restaurant");
|
||||||
put("酒店", "hotel");
|
put("酒店", "hotel");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
Map<String, String> listKeyMap = new HashMap<String, String>() {
|
Map<String, String> listKeyMap = new HashMap<String, String>() {
|
||||||
{
|
{
|
||||||
put("school", "schools");
|
put("school", "schools");
|
||||||
@@ -2564,8 +2722,13 @@ public class PropertyController {
|
|||||||
mav.setModel(BasicModel.buildBadRequestModel("参数缺失:city(城市),district(区域),name(小区名)是必须参数"));
|
mav.setModel(BasicModel.buildBadRequestModel("参数缺失:city(城市),district(区域),name(小区名)是必须参数"));
|
||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
District district = districtService.findByNameAndAlias(model.getCity(), model.getDistrict(), model.getName(),
|
District district = null;
|
||||||
"district");
|
if(StringUtils.isNotBlank(model.getId())){
|
||||||
|
district = districtService.findById(model.getId());
|
||||||
|
}
|
||||||
|
if(district == null){
|
||||||
|
district = districtService.findByNameAndAlias(model.getCity(), model.getDistrict(), model.getName(),"district");
|
||||||
|
}
|
||||||
if (null == district) {
|
if (null == district) {
|
||||||
mav.setModel(BasicModel.buildBadRequestModel("该小区不存在"));
|
mav.setModel(BasicModel.buildBadRequestModel("该小区不存在"));
|
||||||
return mav;
|
return mav;
|
||||||
@@ -2619,8 +2782,8 @@ public class PropertyController {
|
|||||||
result.add(item);
|
result.add(item);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
List<DistrictSellStat> monthsData = districtSellStatService.getAllWithMonths(model.getCity(),
|
List<DistrictSellStat> monthsData = districtSellStatService.getAllWithMonths(district.getCity(),
|
||||||
model.getDistrict(), model.getName(), model.getPeriodCount());
|
district.getRegion(), district.getName(), model.getPeriodCount());
|
||||||
if (monthsData != null && monthsData.size() > 0) {
|
if (monthsData != null && monthsData.size() > 0) {
|
||||||
for (DistrictSellStat districtStat : monthsData) {
|
for (DistrictSellStat districtStat : monthsData) {
|
||||||
Map<String, Object> item = new LinkedHashMap<String, Object>();
|
Map<String, Object> item = new LinkedHashMap<String, Object>();
|
||||||
@@ -3397,6 +3560,7 @@ public class PropertyController {
|
|||||||
mav.setModel(BasicModel.buildBadRequestModel("查询半径(radius)非法"));
|
mav.setModel(BasicModel.buildBadRequestModel("查询半径(radius)非法"));
|
||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
|
final double radiusFinal = radius;
|
||||||
Integer maxNum = getNum(jo);
|
Integer maxNum = getNum(jo);
|
||||||
if (maxNum == null) {
|
if (maxNum == null) {
|
||||||
mav.setModel(BasicModel.buildBadRequestModel("最大记录数(num)非法"));
|
mav.setModel(BasicModel.buildBadRequestModel("最大记录数(num)非法"));
|
||||||
@@ -3410,6 +3574,9 @@ public class PropertyController {
|
|||||||
|
|
||||||
JSONArray jsonArray = new JSONArray();// 结果集
|
JSONArray jsonArray = new JSONArray();// 结果集
|
||||||
boolean hasData = false;
|
boolean hasData = false;
|
||||||
|
// 先解析参数并定位小区,再并行查询周边数据(ES查询是主要耗时点)
|
||||||
|
List<District> districts = new ArrayList<District>(ja.size());
|
||||||
|
final List<JSONObject> subJos = new ArrayList<JSONObject>(ja.size());
|
||||||
for (Object o : ja) {
|
for (Object o : ja) {
|
||||||
JSONObject subJo = (JSONObject) o;
|
JSONObject subJo = (JSONObject) o;
|
||||||
String id = subJo.containsKey("id") ? subJo.getString("id") : null;
|
String id = subJo.containsKey("id") ? subJo.getString("id") : null;
|
||||||
@@ -3427,6 +3594,43 @@ public class PropertyController {
|
|||||||
}
|
}
|
||||||
district = districtService.findByNameAndAlias(city, region, name, "district");
|
district = districtService.findByNameAndAlias(city, region, name, "district");
|
||||||
}
|
}
|
||||||
|
subJos.add(subJo);
|
||||||
|
districts.add(district);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 并行查ES周边POI(每个小区一个任务)
|
||||||
|
Map<District, List<BaiduPlacePoi>> poiMap = new HashMap<District, List<BaiduPlacePoi>>(districts.size());
|
||||||
|
ExecutorService executor = Executors.newFixedThreadPool(Math.min(districts.size(), 6));
|
||||||
|
try {
|
||||||
|
List<Future<List<BaiduPlacePoi>>> futures = new ArrayList<Future<List<BaiduPlacePoi>>>(districts.size());
|
||||||
|
for (final District district : districts) {
|
||||||
|
futures.add(executor.submit(new Callable<List<BaiduPlacePoi>>() {
|
||||||
|
@Override
|
||||||
|
public List<BaiduPlacePoi> call() {
|
||||||
|
if (null == district || district.getLat2() == null || district.getLat2() == 0) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return baiduApiService.searchNearbyLocalDatabase(district, radiusFinal);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
for (int i = 0; i < futures.size(); i++) {
|
||||||
|
try {
|
||||||
|
poiMap.put(districts.get(i), futures.get(i).get(60, TimeUnit.SECONDS));
|
||||||
|
} catch (Exception e) {
|
||||||
|
poiMap.put(districts.get(i), null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
executor.shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int idx = 0; idx < districts.size(); idx++) {
|
||||||
|
District district = districts.get(idx);
|
||||||
JSONObject aroundJo = new JSONObject();
|
JSONObject aroundJo = new JSONObject();
|
||||||
if (null == district || district.getLat2() == null || district.getLat2() == 0) {
|
if (null == district || district.getLat2() == null || district.getLat2() == 0) {
|
||||||
jsonArray.add(aroundJo);
|
jsonArray.add(aroundJo);
|
||||||
@@ -3441,32 +3645,41 @@ public class PropertyController {
|
|||||||
double lat = district.getLat2() / 10000000000d;
|
double lat = district.getLat2() / 10000000000d;
|
||||||
double lng = district.getLng2() / 10000000000d;
|
double lng = district.getLng2() / 10000000000d;
|
||||||
|
|
||||||
// 查询小区周边(所有类型)
|
// 查询小区周边(所有类型,已在上面并行预取)
|
||||||
List<BaiduPlacePoi> arrs = baiduApiService.searchNearbyLocalDatabase(district, radius);
|
List<BaiduPlacePoi> arrs = poiMap.get(district);
|
||||||
Map<String, List<AroundDto>> districtAroundMap = Maps.newHashMap();
|
Map<String, List<AroundDto>> districtAroundMap = Maps.newHashMap();
|
||||||
Map<String, Integer> districtAroundCountMap = Maps.newHashMap();
|
Map<String, Integer> districtAroundCountMap = Maps.newHashMap();
|
||||||
|
|
||||||
for (String key : AROUND_KEYWORD_FACTOR_NEW.keySet()) {
|
for (String key : AROUND_KEYWORD_FACTOR_NEW.keySet()) {
|
||||||
districtAroundMap.put(AROUND_KEYWORD_FACTOR_NEW.get(key), new ArrayList<AroundDto>());// 把key的英文put到map并把value设置为一个List<AroundDto>引用
|
districtAroundMap.put(AROUND_KEYWORD_FACTOR_NEW.get(key), new ArrayList<AroundDto>());// 把key的英文put到map并把value设置为一个List<AroundDto>引用
|
||||||
}
|
}
|
||||||
for (int i = 0; i < arrs.size(); i++) {
|
if (arrs != null) {
|
||||||
BaiduPlacePoi poiObj = arrs.get(i);
|
for (int i = 0; i < arrs.size(); i++) {
|
||||||
String _name = poiObj.getName();
|
BaiduPlacePoi poiObj = arrs.get(i);
|
||||||
String keyword = poiObj.getKeyword();
|
String _name = poiObj.getName();
|
||||||
double latjs = poiObj.getLat();
|
String keyword = poiObj.getKeyword();
|
||||||
double lngjs = poiObj.getLng();
|
double latjs = poiObj.getLat();
|
||||||
String key = AROUND_KEYWORD_FACTOR_NEW.get(keyword);
|
double lngjs = poiObj.getLng();
|
||||||
if (StringUtils.isBlank(key)) {
|
// 高德POI: keyword存small_type(小类),streetId存secondary_type(中类)兜底
|
||||||
continue;
|
if (AROUND_EXCLUDE_TYPES.contains(keyword) || AROUND_EXCLUDE_TYPES.contains(poiObj.getStreetId())) {
|
||||||
}
|
continue;
|
||||||
|
}
|
||||||
|
String key = AROUND_KEYWORD_FACTOR_NEW.get(keyword);
|
||||||
|
if (StringUtils.isBlank(key) && StringUtils.isNotBlank(poiObj.getStreetId())) {
|
||||||
|
key = AROUND_KEYWORD_FACTOR_NEW.get(poiObj.getStreetId());
|
||||||
|
}
|
||||||
|
if (StringUtils.isBlank(key)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
AroundDto dto = new AroundDto();
|
AroundDto dto = new AroundDto();
|
||||||
dto.setName(_name);
|
dto.setName(_name);
|
||||||
dto.setLat(latjs);
|
dto.setLat(latjs);
|
||||||
dto.setLng(lngjs);
|
dto.setLng(lngjs);
|
||||||
dto.setDistance((int) GeoUtils.calculateDistance(lng, lat, lngjs, latjs));
|
dto.setDistance((int) GeoUtils.calculateDistance(lng, lat, lngjs, latjs));
|
||||||
if (districtAroundMap.get(key) != null) {
|
if (districtAroundMap.get(key) != null) {
|
||||||
districtAroundMap.get(key).add(dto);// 按key值取出list add 周边名称已经经纬度
|
districtAroundMap.get(key).add(dto);// 按key值取出list add 周边名称已经经纬度
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5143,7 +5356,7 @@ public class PropertyController {
|
|||||||
|
|
||||||
private Map<String, Object> getLastEvaluationPrice(District district, Evaluation evaluation, double dCredit)
|
private Map<String, Object> getLastEvaluationPrice(District district, Evaluation evaluation, double dCredit)
|
||||||
throws NumberFormatException, IllegalAccessException {
|
throws NumberFormatException, IllegalAccessException {
|
||||||
Date startDate = DateUtil.parseDate(DateUtil.addMonth(new Date(), -6), "yyyy-MM-dd");
|
Date startDate = DateUtil.parseDate(DateUtil.addMonth(new Date(), -12), "yyyy-MM-dd");
|
||||||
// 第三方价格
|
// 第三方价格
|
||||||
Map<String, Object> otherPriceRets = averageStatisticsService.findFirstAverageStatictics(district.getCity(),
|
Map<String, Object> otherPriceRets = averageStatisticsService.findFirstAverageStatictics(district.getCity(),
|
||||||
district.getRegion(), district.getName(), district.getCategory(), startDate);
|
district.getRegion(), district.getName(), district.getCategory(), startDate);
|
||||||
|
|||||||
+1
-1
@@ -22,7 +22,7 @@ public class FangjiaOpenExceptionHandler implements ExceptionHandler {
|
|||||||
LOGGER.error("请求地址:{}", context.getRequest().getRequestURL().toString(), e);
|
LOGGER.error("请求地址:{}", context.getRequest().getRequestURL().toString(), e);
|
||||||
}
|
}
|
||||||
String ip = getLocalHostIP();
|
String ip = getLocalHostIP();
|
||||||
String token = "ae14f50045e9375c354940a2afb86f14e453bd1f08f78da0ba6e788d35bccec4";
|
String token = "b11e4456aa0a15f62fe239a61bc15ce4aefcba7be14b3bff504ebbbfc76f5333";
|
||||||
try {
|
try {
|
||||||
DingDingMessageUtil.sendTextMessage(token, "[OpenApi] "+ip+"服务器内部错误,请及时关注!");
|
DingDingMessageUtil.sendTextMessage(token, "[OpenApi] "+ip+"服务器内部错误,请及时关注!");
|
||||||
} catch (Exception e1) {
|
} catch (Exception e1) {
|
||||||
|
|||||||
+1
-1
@@ -109,7 +109,7 @@ public class AuthenticationInterceptor implements Interceptor {
|
|||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
String ip = getLocalHostIP();
|
String ip = getLocalHostIP();
|
||||||
String token = "ae14f50045e9375c354940a2afb86f14e453bd1f08f78da0ba6e788d35bccec4";
|
String token = "b11e4456aa0a15f62fe239a61bc15ce4aefcba7be14b3bff504ebbbfc76f5333";
|
||||||
try {
|
try {
|
||||||
DingDingMessageUtil.sendTextMessage(token, "[OpenApi] "+ip+"Authentication 错误!");
|
DingDingMessageUtil.sendTextMessage(token, "[OpenApi] "+ip+"Authentication 错误!");
|
||||||
} catch (Exception e1) {
|
} catch (Exception e1) {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ public class AddressModel extends FangjiaApiModel {
|
|||||||
|
|
||||||
private String city;
|
private String city;
|
||||||
private String address;
|
private String address;
|
||||||
|
private Integer ai;
|
||||||
private String suggestDistrict;
|
private String suggestDistrict;
|
||||||
private Integer businessMatch;
|
private Integer businessMatch;
|
||||||
private Double area;
|
private Double area;
|
||||||
@@ -334,4 +335,12 @@ public class AddressModel extends FangjiaApiModel {
|
|||||||
public void setPage(Integer page) {
|
public void setPage(Integer page) {
|
||||||
this.page = page;
|
this.page = page;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer getAi() {
|
||||||
|
return ai;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAi(Integer ai) {
|
||||||
|
this.ai = ai;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ public class AvgPriceQueryModel {
|
|||||||
String periodType;
|
String periodType;
|
||||||
Integer houseType;
|
Integer houseType;
|
||||||
String cat;
|
String cat;
|
||||||
|
String id;
|
||||||
|
|
||||||
public String getCat() {
|
public String getCat() {
|
||||||
return cat;
|
return cat;
|
||||||
@@ -68,4 +69,12 @@ public class AvgPriceQueryModel {
|
|||||||
public void setHouseType(Integer houseType) {
|
public void setHouseType(Integer houseType) {
|
||||||
this.houseType = houseType;
|
this.houseType = houseType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getId() {
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(String id) {
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,8 +22,8 @@
|
|||||||
# 江南空白日更新楼盘刷新
|
# 江南空白日更新楼盘刷新
|
||||||
*/10 * * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/jiangnanblank/DayUpdateDistRefreshBatch > /home/goojia/logs/DayUpdateDistRefreshBatch.log 2>&1
|
*/10 * * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/jiangnanblank/DayUpdateDistRefreshBatch > /home/goojia/logs/DayUpdateDistRefreshBatch.log 2>&1
|
||||||
# 楼盘在售统计(福州,月底补跑+工作时段高频)
|
# 楼盘在售统计(福州,月底补跑+工作时段高频)
|
||||||
#10 0 2 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/fuzhou/DistrictSellStatBatch > /home/goojia/logs/DistrictSellStatBatch.log 2>&1
|
40 7 1 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/fuzhou/DistrictSellStatBatch -Dmodel=monthly > /home/goojia/logs/DistrictSellStatBatch.log 2>&1
|
||||||
#*/10 8-23 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/fuzhou/DistrictSellStatBatch > /home/goojia/logs/DistrictSellStatBatch.log 2>&1
|
*/10 8-23 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/fuzhou/DistrictSellStatBatch -Dmodel=daily > /home/goojia/logs/DistrictSellStatBatch.log 2>&1
|
||||||
# 开放API使用量监控
|
# 开放API使用量监控
|
||||||
15 * * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/api/OpenApiUseStatMonitorBatch > /home/goojia/logs/OpenApiUseStatMonitorBatch.log 2>&1
|
15 * * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/api/OpenApiUseStatMonitorBatch > /home/goojia/logs/OpenApiUseStatMonitorBatch.log 2>&1
|
||||||
# 台物网数据批处理
|
# 台物网数据批处理
|
||||||
@@ -197,8 +197,8 @@
|
|||||||
# 同步开发环境数据
|
# 同步开发环境数据
|
||||||
0 6 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/gj/data_handle/SynchDevDataBatch > /home/goojia/logs/SynchDevDataBatch.log 2>&1
|
0 6 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/gj/data_handle/SynchDevDataBatch > /home/goojia/logs/SynchDevDataBatch.log 2>&1
|
||||||
# 厦门村庄数据批处理(月初高频)
|
# 厦门村庄数据批处理(月初高频)
|
||||||
*/10 * 1-9 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/gj/xiamen/XiaMenVillageBatch > /home/goojia/logs/XiaMenVillageBatch.log 2>&1
|
#*/10 * 1-30 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/gj/xiamen/XiaMenVillageBatch > /home/goojia/logs/XiaMenVillageBatch.log 2>&1
|
||||||
# API调用次数统计
|
# API调用次数统计
|
||||||
0 9 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/hubingliang/ApiInvokeStatistics > /home/goojia/logs/ApiInvokeStatistics.log 2>&1
|
0 9 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/hubingliang/ApiInvokeStatistics > /home/goojia/logs/ApiInvokeStatistics.log 2>&1
|
||||||
# Seawater到Seabird数据同步
|
# Seawater到Seabird数据同步
|
||||||
1 2 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/sync/Seawater2SeabirdSyncBatch > /home/goojia/logs/Seawater2SeabirdSyncBatch.log 2>&1
|
1 2 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/sync/Seawater2SeabirdSyncBatch > /home/goojia/logs/Seawater2SeabirdSyncBatch.log 2>&1
|
||||||
@@ -53,6 +53,12 @@
|
|||||||
<goals><goal>shade</goal></goals>
|
<goals><goal>shade</goal></goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<shadedArtifactAttached>false</shadedArtifactAttached>
|
<shadedArtifactAttached>false</shadedArtifactAttached>
|
||||||
|
<artifactSet>
|
||||||
|
<excludes>
|
||||||
|
<!-- The driver is loaded from lib; shading it too triggers its duplicate-version check. -->
|
||||||
|
<exclude>org.elasticsearch.plugin:x-pack-sql-jdbc</exclude>
|
||||||
|
</excludes>
|
||||||
|
</artifactSet>
|
||||||
<filters>
|
<filters>
|
||||||
<filter>
|
<filter>
|
||||||
<artifact>*:*</artifact>
|
<artifact>*:*</artifact>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
CLASSPATH="./:fangjia-script.jar"
|
CLASSPATH="./:./lib/*:fangjia-script.jar"
|
||||||
|
|
||||||
JVM_OPTS=()
|
JVM_OPTS=()
|
||||||
GROOVY_ARGS=()
|
GROOVY_ARGS=()
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ abstract class BaseBatch {
|
|||||||
}
|
}
|
||||||
def phoneNum = getBatchPhones(batch)
|
def phoneNum = getBatchPhones(batch)
|
||||||
if(SystemUtils.IS_OS_LINUX){
|
if(SystemUtils.IS_OS_LINUX){
|
||||||
sendDingDingMsg("ae14f50045e9375c354940a2afb86f14e453bd1f08f78da0ba6e788d35bccec4",msg, phoneNum)
|
sendDingDingMsg("b11e4456aa0a15f62fe239a61bc15ce4aefcba7be14b3bff504ebbbfc76f5333",msg, phoneNum)
|
||||||
|
|
||||||
// try {
|
// try {
|
||||||
// Map<String, String> params = new HashMap<String, String>();
|
// Map<String, String> params = new HashMap<String, String>();
|
||||||
|
|||||||
+6
-11
@@ -1,23 +1,18 @@
|
|||||||
package com.fangjia.script.averager
|
package com.fangjia.script.averager
|
||||||
|
|
||||||
import com.fangjia.core.util.DataUtil
|
import com.fangjia.core.Constants
|
||||||
import com.fangjia.core.util.DateUtil
|
import com.fangjia.core.util.DateUtil
|
||||||
import com.fangjia.datastore.driver.DSCollection
|
|
||||||
import com.fangjia.datastore.driver.DSCursor
|
|
||||||
import com.fangjia.datastore.driver.DataStore
|
|
||||||
import com.fangjia.script.BaseBatch
|
import com.fangjia.script.BaseBatch
|
||||||
import com.fangjia.script.BatchOwner
|
import com.fangjia.script.BatchOwner
|
||||||
import com.fangjia.script.Watcher
|
import com.fangjia.script.Watcher
|
||||||
import com.fangjia.script.cover.EmailTemplate
|
|
||||||
import com.fangjia.script.jms.QueueRedirectConsumer
|
|
||||||
import com.fangjia.script.util.Jms
|
import com.fangjia.script.util.Jms
|
||||||
import com.fangjia.script.util.MongoUtils
|
import com.fangjia.script.util.MongoUtils
|
||||||
import com.fangjia.script.util.ServerAreaMap
|
import com.fangjia.script.util.ServerAreaMap
|
||||||
import com.google.common.collect.MapDifference
|
import com.mongodb.BasicDBObject
|
||||||
import com.google.common.collect.Maps
|
import com.mongodb.DBCollection
|
||||||
import com.mongodb.*
|
import com.mongodb.DBCursor
|
||||||
|
import com.mongodb.DBObject
|
||||||
import org.apache.commons.lang.StringUtils
|
import org.apache.commons.lang.StringUtils
|
||||||
import org.bson.types.ObjectId
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通知计算二手房均价
|
* 通知计算二手房均价
|
||||||
@@ -31,7 +26,7 @@ class InsertMonitorSquareRentCalcCommandBatch extends BaseBatch {
|
|||||||
|
|
||||||
// public static final DSCollection SEAWEED_COLL = new DataStore("seaweed.db.fangjia.com", 27007).getCollection("fangjia.seaweed")
|
// public static final DSCollection SEAWEED_COLL = new DataStore("seaweed.db.fangjia.com", 27007).getCollection("fangjia.seaweed")
|
||||||
public static final DBCollection SEAWEED_COLL = MongoUtils.getCollectionByName("fangjia", "seaweed", "mongo.db.fangjia.com")
|
public static final DBCollection SEAWEED_COLL = MongoUtils.getCollectionByName("fangjia", "seaweed", "mongo.db.fangjia.com")
|
||||||
public final static DBCollection COMMAND_COLL = new MongoClient("log.mongo.db.fangjia.com", 52002).getDB('fangjia_log').getCollection('calc_command')
|
public final static DBCollection COMMAND_COLL = com.fangjia.core.util.MongoUtils.getDbCollection(Constants.SEAWATER_MONGO_URI, 'fangjia_log', 'calc_command')
|
||||||
public final static DBCollection SQMETRE_RENT_COLL = MongoUtils.getCollectionByName("fangjia", "sqmetre_rent", "mongo.db.fangjia.com")
|
public final static DBCollection SQMETRE_RENT_COLL = MongoUtils.getCollectionByName("fangjia", "sqmetre_rent", "mongo.db.fangjia.com")
|
||||||
public final static DBCollection REGION_COLL = MongoUtils.getCollectionByName("fangjia", "region_block", "mongo.db.fangjia.com")
|
public final static DBCollection REGION_COLL = MongoUtils.getCollectionByName("fangjia", "region_block", "mongo.db.fangjia.com")
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -4995,8 +4995,7 @@ class CommonDatautils {
|
|||||||
q.put("city", city)
|
q.put("city", city)
|
||||||
q.put("region", region)
|
q.put("region", region)
|
||||||
q.put("name", name)
|
q.put("name", name)
|
||||||
q.put("s_date", new BasicDBObject('$gte', startDate).append('$lte',endDate))
|
q.put("s_date", new BasicDBObject('$gte', startDate).append('$lte', endDate))
|
||||||
|
|
||||||
def dbcursor = thirdpartColl.find(q).sort(new BasicDBObject("s_date", -1))
|
def dbcursor = thirdpartColl.find(q).sort(new BasicDBObject("s_date", -1))
|
||||||
def map = [:]
|
def map = [:]
|
||||||
for(def db : dbcursor){
|
for(def db : dbcursor){
|
||||||
|
|||||||
+5
-7
@@ -1,5 +1,6 @@
|
|||||||
package com.fangjia.script.fuzhou
|
package com.fangjia.script.fuzhou
|
||||||
|
|
||||||
|
import com.fangjia.core.Constants
|
||||||
import com.fangjia.core.util.DataUtil
|
import com.fangjia.core.util.DataUtil
|
||||||
import com.fangjia.script.BaseBatch
|
import com.fangjia.script.BaseBatch
|
||||||
import com.fangjia.script.BatchOwner
|
import com.fangjia.script.BatchOwner
|
||||||
@@ -28,7 +29,7 @@ class DistrictSellStatBatch extends BaseBatch {
|
|||||||
static DBCollection DISTRICT_SELL_STAT = MongoUtils.getCollectionByName("fangjia_stat", "district_sell_stat", "mongo.db.fangjia.com")
|
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")
|
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 final static DBCollection COMMAND_COLL = com.fangjia.core.util.MongoUtils.getDbCollection(Constants.SEAWATER_MONGO_URI, 'fangjia_log', 'calc_command')
|
||||||
|
|
||||||
public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(20)
|
public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(20)
|
||||||
|
|
||||||
@@ -41,18 +42,15 @@ class DistrictSellStatBatch extends BaseBatch {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
void process(Object args) {
|
void process(Object args) {
|
||||||
// def months = DateUtils.getMonthList(202510)
|
// def months = DateUtils.getMonthList(202606)
|
||||||
// months = months[0..(months.size()-1)]
|
// months = months[0..(months.size()-1)]
|
||||||
// println months
|
// println months
|
||||||
// for(def month : months){
|
// for(def month : months){
|
||||||
// def curDate = DateUtils.parseFromTightByPattern(month.toString()+"01", "yyyyMMdd")
|
// def curDate = DateUtils.parseFromTightByPattern(month.toString()+"01", "yyyyMMdd")
|
||||||
// calcMonthlyPrice(curDate)
|
// calcMonthlyPrice(curDate)
|
||||||
// }
|
// }
|
||||||
|
String model = System.getProperty("model", "daily");
|
||||||
def date = new Date()
|
if(model == "monthly"){
|
||||||
def day = date.getDate()
|
|
||||||
def hours = date.getHours()
|
|
||||||
if(day == 2 && hours<7){
|
|
||||||
calcMonthlyPrice() //正常算一期
|
calcMonthlyPrice() //正常算一期
|
||||||
}else{
|
}else{
|
||||||
//根据calc_type算历史
|
//根据calc_type算历史
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.fangjia.core.util.HttpRequest
|
|||||||
import com.fangjia.script.commData.CommonDatautils
|
import com.fangjia.script.commData.CommonDatautils
|
||||||
import com.fangjia.script.gj.EsUtils
|
import com.fangjia.script.gj.EsUtils
|
||||||
import com.fangjia.script.util.CommonUtils
|
import com.fangjia.script.util.CommonUtils
|
||||||
|
import com.fangjia.script.util.DbUtils
|
||||||
import com.fangjia.script.util.ElasticUtils
|
import com.fangjia.script.util.ElasticUtils
|
||||||
import com.fangjia.script.util.ExcelUtils
|
import com.fangjia.script.util.ExcelUtils
|
||||||
import com.fangjia.script.util.MongoUtils
|
import com.fangjia.script.util.MongoUtils
|
||||||
@@ -14,30 +15,55 @@ import com.mongodb.DBCollection
|
|||||||
import java.util.concurrent.atomic.AtomicInteger
|
import java.util.concurrent.atomic.AtomicInteger
|
||||||
|
|
||||||
class GongShu {
|
class GongShu {
|
||||||
|
static DBCollection DISTRICT_SELL_STAT = MongoUtils.getCollectionByName("fangjia_stat", "district_sell_stat", "mongo.db.fangjia.com")
|
||||||
|
|
||||||
static main(args) {
|
static main(args) {
|
||||||
def task = new GongShu();
|
def task = new GongShu();
|
||||||
task.run();
|
task.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
def run() {
|
def run() {
|
||||||
String path1 = "D:\\数据\\福州\\福州200个小区抽样价格核验202603.xlsx";
|
def data = [["ID","区域","小区名称","供数价格","贝壳成交价","安居客价格(挂牌价*0.9)","麦田价格(挂牌价*0.9)","房天下价格(挂牌价*0.9)","城市房产价格(挂牌价*0.9)","供数价格与贝壳成交价差异"]]
|
||||||
// String path1 = "D:\\数据\\福州\\价格比对_20240915.xlsx";
|
DbUtils.seaweed.find(DbUtils.buildSeaweedQuery("福州"), new BasicDBObject("region", 1).append("name", 1)).each {
|
||||||
String path2 = "E:\\goojia\\file\\excel文件\\福州\\福州202410小区价格.xlsx";
|
data << [it._id.toString(), it.region, it.name]
|
||||||
// String path2 = "E:\\goojia\\file\\excel文件\\福州\\福州202410小区价格.xlsx";
|
}
|
||||||
String path3 = "E:\\goojia\\file\\excel文件\\福州\\福州贝壳小区.xlsx";
|
for(def yearMonth in [202604,202605,202606, 202607]){
|
||||||
// String path2 = "E:\\goojia\\file\\excel文件\\福州\\1.xlsx";
|
// ExcelUtils.write("D:\\数据\\福州\\福州200个小区抽样价格核验${yearMonth}.xlsx", data, "sheet1")
|
||||||
// String path1 = "E:\\goojia\\file\\excel文件\\福州\\福州全部小区.xlsx";
|
// def query = new BasicDBObject()
|
||||||
// findID(path2)
|
// query.append("city", "福州")
|
||||||
// findDelDistrict(path2)
|
// query.append("date", yearMonth)
|
||||||
// findDistrictByAlias(path2)
|
// def stat = [:]
|
||||||
// match19UseMAP(path2)
|
// DISTRICT_SELL_STAT.find(query, new BasicDBObject("region", 1).append("district_name", 1).append("avg_price", 1)).each {
|
||||||
// addFjwPrice(path2)
|
// stat.put("${it.region}_${it.district_name}".toString(), it.avg_price)
|
||||||
|
// }
|
||||||
|
// ExcelUtils.multiThreadingModify("D:\\数据\\福州\\福州200个小区抽样价格核验${yearMonth}.xlsx",{List item->
|
||||||
|
// item["D"] = stat.get("${item['B']}_${item['C']}".toString(), null)
|
||||||
|
// })
|
||||||
|
priceAvg("D:\\数据\\福州\\福州200个小区抽样价格核验${yearMonth}.xlsx")
|
||||||
|
}
|
||||||
|
|
||||||
// match(path2, path1)
|
|
||||||
// match2(path3, path1)
|
|
||||||
// houseCase(path2)
|
|
||||||
thirdPrice(path1)
|
|
||||||
priceAvg(path1)
|
// String path1 = "D:\\福州200个小区抽样价格核验202604.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)
|
// futurePrice(path2)
|
||||||
// rePrice(path2)
|
// rePrice(path2)
|
||||||
}
|
}
|
||||||
@@ -319,7 +345,7 @@ class GongShu {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
//查找三方价格
|
//查找三方价格
|
||||||
def thirdPrice(path1) {
|
def thirdPrice(path1 ,yearMonth) {
|
||||||
def count = 0
|
def count = 0
|
||||||
ExcelUtils.multiThreadingModify( path1, { List d ->
|
ExcelUtils.multiThreadingModify( path1, { List d ->
|
||||||
count++
|
count++
|
||||||
@@ -329,7 +355,7 @@ class GongShu {
|
|||||||
def city = "福州"
|
def city = "福州"
|
||||||
def region = d['B']
|
def region = d['B']
|
||||||
def name = d['C']
|
def name = d['C']
|
||||||
def valusMap = CommonDatautils.findThirdPartyPrice(city, region, name, 202512, 202603)
|
def valusMap = CommonDatautils.findThirdPartyPrice(city, region, name, 202601, yearMonth)
|
||||||
if (valusMap) {
|
if (valusMap) {
|
||||||
def dataMap = valusMap.get(city + "##" + region + "##" + name)
|
def dataMap = valusMap.get(city + "##" + region + "##" + name)
|
||||||
if (dataMap.get("anjuke_esf_price")) {
|
if (dataMap.get("anjuke_esf_price")) {
|
||||||
|
|||||||
@@ -794,7 +794,7 @@ class OpenApiUtils {
|
|||||||
|
|
||||||
static def addrVerifyXiameng(city, address, type){
|
static def addrVerifyXiameng(city, address, type){
|
||||||
address = URLEncoder.encode(address, "utf-8");
|
address = URLEncoder.encode(address, "utf-8");
|
||||||
def url = "http://192.168.0.80:32080/FangJiaAddressService/v7/villageIdentify?address=${address}&type=${type}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"
|
def url = "http://192.168.0.80:32080/FangJiaAddressService/v7/villageIdentify?address=${address}&ai=1&type=${type}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"
|
||||||
// def url = "http://localhost:8080/fangjia-open/addrSvc/njcbVillageIdentify?address=${address}&type=${type}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"
|
// def url = "http://localhost:8080/fangjia-open/addrSvc/njcbVillageIdentify?address=${address}&type=${type}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"
|
||||||
if(city){
|
if(city){
|
||||||
url = url + "&city=${city}"
|
url = url + "&city=${city}"
|
||||||
|
|||||||
+48
-14
@@ -9,6 +9,7 @@ import com.fangjia.script.util.DateUtil
|
|||||||
import com.fangjia.script.util.DateUtils
|
import com.fangjia.script.util.DateUtils
|
||||||
import com.fangjia.script.util.DbUtils
|
import com.fangjia.script.util.DbUtils
|
||||||
import com.fangjia.script.util.ElasticUtils
|
import com.fangjia.script.util.ElasticUtils
|
||||||
|
import com.fangjia.script.util.ExcelRow
|
||||||
import com.fangjia.script.util.ExcelUtils
|
import com.fangjia.script.util.ExcelUtils
|
||||||
import com.fangjia.script.util.MongoUtils
|
import com.fangjia.script.util.MongoUtils
|
||||||
import com.fangjia.script.wenyan.taobao.BidRecordsParseBatch
|
import com.fangjia.script.wenyan.taobao.BidRecordsParseBatch
|
||||||
@@ -26,6 +27,7 @@ class HongXingMonthBatch extends BaseBatch{
|
|||||||
static DBCollection OFFICE_RENT_STAT = MongoUtils.getCollectionByName("fangjia_stat", "office_rent_stat", "mongo.db.fangjia.com")
|
static DBCollection OFFICE_RENT_STAT = MongoUtils.getCollectionByName("fangjia_stat", "office_rent_stat", "mongo.db.fangjia.com")
|
||||||
static DBCollection OFFICE_SELL_STAT = MongoUtils.getCollectionByName("fangjia_stat", "office_sell_stat", "mongo.db.fangjia.com")
|
static DBCollection OFFICE_SELL_STAT = MongoUtils.getCollectionByName("fangjia_stat", "office_sell_stat", "mongo.db.fangjia.com")
|
||||||
static DBCollection DEAL_PRICE_COLL = MongoUtils.getCollectionByName("fangjia", "deal_price", "mongo.db.fangjia.com")
|
static DBCollection DEAL_PRICE_COLL = MongoUtils.getCollectionByName("fangjia", "deal_price", "mongo.db.fangjia.com")
|
||||||
|
static String matchIdLabel = "AM"
|
||||||
static main(args) {
|
static main(args) {
|
||||||
runBatch(new HongXingMonthBatch(), args);
|
runBatch(new HongXingMonthBatch(), args);
|
||||||
}
|
}
|
||||||
@@ -36,10 +38,11 @@ class HongXingMonthBatch extends BaseBatch{
|
|||||||
// createTestFile();
|
// createTestFile();
|
||||||
// mergeFile()
|
// mergeFile()
|
||||||
// mergeMatchId()
|
// mergeMatchId()
|
||||||
def fileName = "C:\\Users\\wenyan\\Desktop\\宏信交付数据\\宏信楼盘5月监测20260520交付.xlsx"
|
def fileName = "C:\\Users\\wenyan\\Desktop\\宏信交付数据\\宏信楼盘9月监测20260920交付.xlsx"
|
||||||
def removeAddrFile = "C:\\Users\\wenyan\\Desktop\\宏信交付数据\\20260520宏信.xlsx"
|
def removeAddrFile = "C:\\Users\\wenyan\\Desktop\\宏信交付数据\\20260920宏信.xlsx"
|
||||||
|
def addAddrData = ExcelUtils.read(removeAddrFile, 2, 1)
|
||||||
def removeAddrs = []
|
def removeAddrs = []
|
||||||
ExcelUtils.read(removeAddrFile, 0).each {List item->
|
ExcelUtils.read(removeAddrFile, 1).each {List item->
|
||||||
removeAddrs << item["C"]
|
removeAddrs << item["C"]
|
||||||
}
|
}
|
||||||
ExcelUtils.modify(fileName,{List item->
|
ExcelUtils.modify(fileName,{List item->
|
||||||
@@ -49,7 +52,7 @@ class HongXingMonthBatch extends BaseBatch{
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
def fixPriceAddrs = [:]
|
def fixPriceAddrs = [:]
|
||||||
ExcelUtils.read(removeAddrFile, 1).each {List item->
|
ExcelUtils.read(removeAddrFile, 0).each {List item->
|
||||||
if(item["A"] && item["B"]){
|
if(item["A"] && item["B"]){
|
||||||
fixPriceAddrs.put(item["A"],item["B"].toString().toDouble().toInteger())
|
fixPriceAddrs.put(item["A"],item["B"].toString().toDouble().toInteger())
|
||||||
}
|
}
|
||||||
@@ -57,7 +60,7 @@ class HongXingMonthBatch extends BaseBatch{
|
|||||||
}
|
}
|
||||||
def stat = [:]
|
def stat = [:]
|
||||||
//获取上个月的交付价格
|
//获取上个月的交付价格
|
||||||
def lastMonthPriceRowId = "P" //上个月均价所在列号
|
def lastMonthPriceRowId = "R" //上个月均价所在列号
|
||||||
ExcelUtils.read(fileName).each{List item->
|
ExcelUtils.read(fileName).each{List item->
|
||||||
if(item[lastMonthPriceRowId]){
|
if(item[lastMonthPriceRowId]){
|
||||||
stat.put(item["C"], item[lastMonthPriceRowId])
|
stat.put(item["C"], item[lastMonthPriceRowId])
|
||||||
@@ -68,6 +71,20 @@ class HongXingMonthBatch extends BaseBatch{
|
|||||||
def count = findCurMonthPrice(lastMonthStr)
|
def count = findCurMonthPrice(lastMonthStr)
|
||||||
if(count > 0){
|
if(count > 0){
|
||||||
def datas = ExcelUtils.read(fileName)
|
def datas = ExcelUtils.read(fileName)
|
||||||
|
for(def item in addAddrData){
|
||||||
|
def buffer = new ExcelRow()
|
||||||
|
buffer['C'] = item["A"]
|
||||||
|
buffer['I'] = item["B"]
|
||||||
|
buffer[matchIdLabel] = item["D"]
|
||||||
|
buffer["F"] = item["E"]
|
||||||
|
buffer["G"] = item["F"]
|
||||||
|
buffer['A'] = item["G"]
|
||||||
|
buffer["B"] = item["H"]
|
||||||
|
datas.add(buffer)
|
||||||
|
if(item["A"] && item["C"]){
|
||||||
|
fixPriceAddrs.put(item["A"],item["C"].toString().toDouble().toInteger())
|
||||||
|
}
|
||||||
|
}
|
||||||
def newDatas = createDatas(datas, lastMonthStr, fixPriceAddrs)
|
def newDatas = createDatas(datas, lastMonthStr, fixPriceAddrs)
|
||||||
def curDateStr = DateUtils.formatDateByPattern(new Date(),"yyyyMMdd")
|
def curDateStr = DateUtils.formatDateByPattern(new Date(),"yyyyMMdd")
|
||||||
ExcelUtils.write(fileName, newDatas,"结果${curDateStr}")
|
ExcelUtils.write(fileName, newDatas,"结果${curDateStr}")
|
||||||
@@ -123,8 +140,8 @@ class HongXingMonthBatch extends BaseBatch{
|
|||||||
|
|
||||||
def createDatas(datas, lastMonthStr, Map fixPriceAddrs){
|
def createDatas(datas, lastMonthStr, Map fixPriceAddrs){
|
||||||
def rows = []
|
def rows = []
|
||||||
rows << ["物业类型","名称","地址","期房/现房","处置状态","省份","城市","城市排名","面积","1月评估单价(元)","1月评估总价(元)","2月评估单价(元)","2月评估总价(元)","3月评估单价", "3月评估总价(元)","4月评估单价", "4月评估总价(元)","5月评估单价", "5月评估总价(元)"
|
rows << ["物业类型","名称","地址","期房/现房","处置状态","省份","城市","城市排名","面积","1月评估单价(元)","1月评估总价(元)","2月评估单价(元)","2月评估总价(元)","3月评估单价", "3月评估总价(元)","4月评估单价", "4月评估总价(元)","5月评估单价","5月评估总价(元)","6月评估单价", "6月评估总价(元)","7月评估单价", "7月评估总价(元)","8月评估单价", "8月评估总价(元)","9月评估单价", "9月评估总价(元)"
|
||||||
,"环比涨跌幅(%)","计算方式","定基涨跌幅(相比首月波动)","5月区域均价","5月区域均价涨跌幅(%)","4月楼盘所在区域价格的排名(仅针对住宅)","5月楼盘所在区域价格的排名(仅针对住宅)","楼盘所在区域排名变化(仅针对住宅)","近3个月内成交量","近6个月成交量","3个月挂牌量","匹配ID-新","备注","情况说明"]
|
,"环比涨跌幅(%)","计算方式","定基涨跌幅(相比首月波动)","9月区域均价","9月区域均价涨跌幅(%)","8月楼盘所在区域价格的排名(仅针对住宅)","9月楼盘所在区域价格的排名(仅针对住宅)","楼盘所在区域排名变化(仅针对住宅)","近3个月内成交量","近6个月成交量","3个月挂牌量","匹配ID-新","备注","情况说明"]
|
||||||
def index = 1
|
def index = 1
|
||||||
for(def d : datas){
|
for(def d : datas){
|
||||||
println d['B']
|
println d['B']
|
||||||
@@ -147,13 +164,21 @@ class HongXingMonthBatch extends BaseBatch{
|
|||||||
row << d['O']
|
row << d['O']
|
||||||
row << d['P']
|
row << d['P']
|
||||||
row << d['Q']
|
row << d['Q']
|
||||||
|
row << d['R']
|
||||||
|
row << d['S']
|
||||||
|
row << d['T']
|
||||||
|
row << d['U']
|
||||||
|
row << d['V']
|
||||||
|
row << d['W']
|
||||||
|
row << d['X']
|
||||||
|
row << d['Y']
|
||||||
if(d['E'] == "已处置"){
|
if(d['E'] == "已处置"){
|
||||||
rows << row
|
rows << row
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
def currMonthUnitPriceLabel = "R"
|
def currMonthUnitPriceLabel = "Z"
|
||||||
def preMonthUnitPriceLabel = "P"
|
def preMonthUnitPriceLabel = "X"
|
||||||
def matchIdLabel = "AE"
|
def matchIdLabel = "AM"
|
||||||
if(!["商铺","办公楼"].contains(d['A'])){
|
if(!["商铺","办公楼"].contains(d['A'])){
|
||||||
def dist = CommonDatautils.findDistrictById(d[matchIdLabel])
|
def dist = CommonDatautils.findDistrictById(d[matchIdLabel])
|
||||||
if(dist){
|
if(dist){
|
||||||
@@ -209,7 +234,6 @@ class HongXingMonthBatch extends BaseBatch{
|
|||||||
row << ""
|
row << ""
|
||||||
row << ""
|
row << ""
|
||||||
row << ""
|
row << ""
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def regionPriceObj = findRegionPrice(dist.city, dist.region, lastMonthStr)
|
def regionPriceObj = findRegionPrice(dist.city, dist.region, lastMonthStr)
|
||||||
@@ -243,7 +267,7 @@ class HongXingMonthBatch extends BaseBatch{
|
|||||||
row << findHouse(dist)
|
row << findHouse(dist)
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
println d[matchIdLabel] +" 未找到该id的楼盘"
|
println d[matchIdLabel] +" 未找到该id的楼盘:${d}"
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
def dist = CommonDatautils.findDistrictById(d[matchIdLabel])
|
def dist = CommonDatautils.findDistrictById(d[matchIdLabel])
|
||||||
@@ -253,6 +277,13 @@ class HongXingMonthBatch extends BaseBatch{
|
|||||||
if(d['A'] == "办公楼"){
|
if(d['A'] == "办公楼"){
|
||||||
cityMarkupObj = findRentOfficeMarkup(dist.city, null, lastMonthStr, "city")
|
cityMarkupObj = findRentOfficeMarkup(dist.city, null, lastMonthStr, "city")
|
||||||
regionMarkupObj = findSellOfficeMarkup(dist.city, dist.region, lastMonthStr, "district")
|
regionMarkupObj = findSellOfficeMarkup(dist.city, dist.region, lastMonthStr, "district")
|
||||||
|
println(dist.city)
|
||||||
|
if(cityMarkupObj.mom == null){
|
||||||
|
def lastMonthPreStr = com.fangjia.core.util.DateUtil.add(com.fangjia.core.util.DateUtil.parseDate(lastMonthStr, "yyyyMM"), Calendar.MONTH, -1).format("yyyyMM")
|
||||||
|
def cityMarkupObjPre = findRentOfficeMarkup(dist.city, null, lastMonthPreStr, "city")
|
||||||
|
cityMarkupObj.mom = DataUtil.getRound(2, (cityMarkupObj.avg_price - cityMarkupObjPre.avg_price)*100/cityMarkupObjPre.avg_price)
|
||||||
|
println(cityMarkupObj)
|
||||||
|
}
|
||||||
if(cityMarkupObj){
|
if(cityMarkupObj){
|
||||||
println cityMarkupObj
|
println cityMarkupObj
|
||||||
cityMarkupObj.mom = cityMarkupObj.mom / 100
|
cityMarkupObj.mom = cityMarkupObj.mom / 100
|
||||||
@@ -267,6 +298,9 @@ class HongXingMonthBatch extends BaseBatch{
|
|||||||
regionMarkupObj = findSellShopMarkup(dist.city, dist.region, lastMonthStr, "district")
|
regionMarkupObj = findSellShopMarkup(dist.city, dist.region, lastMonthStr, "district")
|
||||||
}
|
}
|
||||||
if(cityMarkupObj){
|
if(cityMarkupObj){
|
||||||
|
if(fixPriceAddrs.containsKey(d['C'])){
|
||||||
|
d[currMonthUnitPriceLabel] = fixPriceAddrs[d['c']]
|
||||||
|
}
|
||||||
if(d[currMonthUnitPriceLabel]){
|
if(d[currMonthUnitPriceLabel]){
|
||||||
def newAvgPrice = d[currMonthUnitPriceLabel]
|
def newAvgPrice = d[currMonthUnitPriceLabel]
|
||||||
row << DataUtil.getRound(newAvgPrice)
|
row << DataUtil.getRound(newAvgPrice)
|
||||||
@@ -347,8 +381,8 @@ class HongXingMonthBatch extends BaseBatch{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
row << d[matchIdLabel]
|
row << d[matchIdLabel]
|
||||||
row << d['AF']
|
row << d['AN']
|
||||||
row << d['AG']
|
row << d['AO']
|
||||||
rows << row
|
rows << row
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
-1
@@ -48,7 +48,6 @@ class XiaMenVillageBatch extends BaseBatch{
|
|||||||
rows << row
|
rows << row
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ExcelUtils.write("C:\\Users\\wenyan\\IdeaProjects\\main\\projects\\fangjia-script\\src\\main\\groovy\\com\\fangjia\\script\\gj\\xiamen\\xmbank_2026-05_result.xlsx", rows, "结果")
|
|
||||||
uploadExcel(rows, outFileName)
|
uploadExcel(rows, outFileName)
|
||||||
println "新增文件,上传已完成 "+DateUtil.formatByPattern(new Date(), "yyyy-MM-dd HH:mm:ss")
|
println "新增文件,上传已完成 "+DateUtil.formatByPattern(new Date(), "yyyy-MM-dd HH:mm:ss")
|
||||||
println "*******************************************************************************************"
|
println "*******************************************************************************************"
|
||||||
|
|||||||
+4
-4
@@ -25,10 +25,10 @@ class HouseRemoveBatch extends BaseBatch {
|
|||||||
|
|
||||||
"sell" : 180,
|
"sell" : 180,
|
||||||
"rent" : 30,
|
"rent" : 30,
|
||||||
"shop_sell" : 30,
|
"shop_sell" : 360,
|
||||||
"office_sell": 30,
|
"office_sell": 360,
|
||||||
"shop_rent" : 30,
|
"shop_rent" : 360,
|
||||||
"office_rent": 30
|
"office_rent": 360
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
+22
-52
@@ -1,63 +1,33 @@
|
|||||||
import com.fangjia.datastore.driver.DSObject
|
|
||||||
import com.fangjia.script.commData.CommonDatautils
|
|
||||||
import com.fangjia.script.util.CommonUtils
|
|
||||||
import com.fangjia.script.util.DbUtils
|
|
||||||
import com.fangjia.script.util.ExcelUtils
|
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.util.OpenApiClient
|
||||||
import com.mongodb.BasicDBObject
|
|
||||||
import com.mongodb.DBCollection
|
|
||||||
import com.mongodb.DBCursor
|
|
||||||
import com.mongodb.DBObject
|
|
||||||
import com.mongodb.QueryOperators
|
|
||||||
import net.sf.json.JSONObject
|
import net.sf.json.JSONObject
|
||||||
|
|
||||||
//ExcelUtils.multiThreadingModify("D:\\业务数据\\四川锦程\\四川锦程测试数据.xlsx",{List item->
|
ExcelUtils.multiThreadingModify("C:\\Users\\wenyan\\Desktop\\地址分区域-20260522.xls",{List item->
|
||||||
// if(item["K"] == null){
|
if(item["C"]){
|
||||||
// JSONObject json = OpenApiClient.addressMatch(item["B"], item["G"], "district", false, item["C"] )
|
JSONObject json = OpenApiClient.addressStandard("", item["C"])
|
||||||
// if(json.getDouble("credit") > 0){
|
if(json){
|
||||||
// item["I"] = json.city
|
if(json.province){
|
||||||
// item["J"] = json.district
|
item["D"]=json.province
|
||||||
// item["K"] = json.name
|
|
||||||
// println(item)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//})
|
|
||||||
//ExcelUtils.multiThreadingModify("D:\\业务数据\\四川锦程\\四川锦程测试数据.xlsx",{List item->
|
|
||||||
// if(item["K"] == null){
|
|
||||||
// JSONObject json = OpenApiClient.addressMatch(item["B"], item["G"], "district", false, item["C"] )
|
|
||||||
// if(json.getDouble("credit") > 0){
|
|
||||||
// item["I"] = json.city
|
|
||||||
// item["J"] = json.district
|
|
||||||
// item["K"] = json.name
|
|
||||||
// println(item)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//})
|
|
||||||
ExcelUtils.multiThreadingModify("D:\\业务数据\\四川锦程\\四川锦程测试数据(人工介入).xlsx",{List item->
|
|
||||||
def city = item["I"]
|
|
||||||
def region = item["J"]
|
|
||||||
def name = item["K"]
|
|
||||||
if(name){
|
|
||||||
BasicDBObject seaweed = DbUtils.seaweed.findOne(DbUtils.buildSeaweedQuery(city, region, name))
|
|
||||||
if(seaweed){
|
|
||||||
def propertyType = 0
|
|
||||||
if(seaweed.estate_type2.toString().contains("别墅")){
|
|
||||||
propertyType = 1
|
|
||||||
}
|
}
|
||||||
JSONObject res = OpenApiClient.evaluateDistrictPrice(city, region, name, item["H"], propertyType)
|
if(json.city){
|
||||||
if(res.getDouble("credit") > 0){
|
item["E"] =json.city
|
||||||
item["L"] = res.avgPrice
|
|
||||||
item["M"] = res.totalPrice
|
|
||||||
}else {
|
|
||||||
CommonUtils.recalculationAverage(city, region, name, seaweed.estate_type2, new Date(), false)
|
|
||||||
}
|
}
|
||||||
item["N"] = CommonUtils.getDistrictBuildYear(seaweed)
|
if(json.district){
|
||||||
}else{
|
item["F"]= json.district
|
||||||
println("################" + item)
|
}
|
||||||
|
if(json.provinceCode){
|
||||||
|
item["G"]= json.provinceCode.toString().substring(0, 6)
|
||||||
|
}
|
||||||
|
if(json.cityCode){
|
||||||
|
item["H"] =json.cityCode.toString().substring(0, 6)
|
||||||
|
}
|
||||||
|
if(json.districtCode){
|
||||||
|
item["I"] =json.districtCode.toString().substring(0, 6)
|
||||||
|
}
|
||||||
|
println(json)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
println(item)
|
println(item)
|
||||||
})
|
})
|
||||||
+2
-2
@@ -479,7 +479,7 @@ public class OpenApiClient {
|
|||||||
|
|
||||||
|
|
||||||
public static JSONObject addressStandard(String city, String address) {
|
public static JSONObject addressStandard(String city, String address) {
|
||||||
if (StringUtils.isBlank(city) || StringUtils.isBlank(address)) {
|
if (StringUtils.isBlank(address)) {
|
||||||
throw new IllegalArgumentException();
|
throw new IllegalArgumentException();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -488,7 +488,7 @@ public class OpenApiClient {
|
|||||||
params.put("city", city);
|
params.put("city", city);
|
||||||
params.put("address", address);
|
params.put("address", address);
|
||||||
params.put("token", TOKEN);
|
params.put("token", TOKEN);
|
||||||
String content = new HttpRequest().get("http://open.fangjia.com/address/standard", params, "utf-8")
|
String content = new HttpRequest().get("http://open.fangjia.com/addrSvc/structure", params, "utf-8")
|
||||||
JSONObject result = JSONObject.fromObject(content)
|
JSONObject result = JSONObject.fromObject(content)
|
||||||
if (result.getInt("code") == 200) {
|
if (result.getInt("code") == 200) {
|
||||||
return result.getJSONObject("result");
|
return result.getJSONObject("result");
|
||||||
|
|||||||
@@ -1,43 +1,12 @@
|
|||||||
package com.fangjia.script.wenyan.temp
|
package com.fangjia.script.wenyan.temp
|
||||||
|
|
||||||
import com.fangjia.core.Constants
|
import com.fangjia.script.util.ElasticUtils
|
||||||
import com.fangjia.core.util.DataUtil
|
|
||||||
import com.fangjia.core.util.MongoUtils
|
|
||||||
import com.fangjia.script.util.DbUtils
|
|
||||||
import com.fangjia.script.util.ExcelUtils
|
import com.fangjia.script.util.ExcelUtils
|
||||||
import com.fangjia.script.util.OpenApiClient
|
|
||||||
import com.mongodb.BasicDBObject
|
|
||||||
import net.sf.json.JSONObject
|
|
||||||
|
|
||||||
import java.util.regex.Matcher
|
ExcelUtils.multiThreadingModify("C:\\Users\\wenyan\\Desktop\\估家基础数据统计.xlsx",{List item->
|
||||||
import java.util.regex.Pattern
|
ElasticUtils.executeSqlQuery("select count(*) as cnt FROM didata_map_poi_single_new_45 where city like '${item['B']}%' and small_type='商务写字楼'",{Map doc->
|
||||||
|
item["D"] = doc['cnt']
|
||||||
def school = MongoUtils.getDbCollection(Constants.FANGJIA_CRAWL_MONGO_URI, "fangjia_craw", "school2")
|
item['E'] = Math.max(item["D"], item["C"])
|
||||||
new File("D:\\数据\\学校数据").eachFile {File file->
|
println(doc)
|
||||||
ExcelUtils.read(file.getAbsolutePath(), 0).each {List item->
|
})
|
||||||
BasicDBObject dbo = new BasicDBObject()
|
})
|
||||||
dbo.city = item["A"]
|
|
||||||
dbo.region = item["B"]
|
|
||||||
dbo.name = item["C"]
|
|
||||||
dbo.address = item["E"]
|
|
||||||
dbo.attribute = item["G"]
|
|
||||||
dbo.property = item["H"]
|
|
||||||
dbo.category = "小学"
|
|
||||||
dbo.location = [DataUtil.roundDouble(item["I"], 6), DataUtil.roundDouble(item["J"], 6)]
|
|
||||||
school.insert(dbo)
|
|
||||||
println(dbo)
|
|
||||||
}
|
|
||||||
ExcelUtils.read(file.getAbsolutePath(), 1).each {List item->
|
|
||||||
BasicDBObject dbo = new BasicDBObject()
|
|
||||||
dbo.city = item["A"]
|
|
||||||
dbo.region = item["B"]
|
|
||||||
dbo.name = item["C"]
|
|
||||||
dbo.address = item["E"]
|
|
||||||
dbo.attribute = item["G"]
|
|
||||||
dbo.property = item["H"]
|
|
||||||
dbo.category = "中学"
|
|
||||||
dbo.location = [item["I"], item["J"]]
|
|
||||||
school.save(dbo)
|
|
||||||
println(item)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+147
-6
@@ -1,12 +1,17 @@
|
|||||||
package com.fangjia.service.api;
|
package com.fangjia.service.api;
|
||||||
|
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.Callable;
|
import java.util.concurrent.Callable;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
import java.util.concurrent.Future;
|
import java.util.concurrent.Future;
|
||||||
|
|
||||||
|
import com.fangjia.core.ProvinceData;
|
||||||
|
import com.fangjia.core.RegionData;
|
||||||
import com.fangjia.core.util.*;
|
import com.fangjia.core.util.*;
|
||||||
import com.fangjia.dal.QueryParam;
|
import com.fangjia.dal.QueryParam;
|
||||||
import com.fangjia.dal.mongo.dao.BaiDuSearchCacheDao;
|
import com.fangjia.dal.mongo.dao.BaiDuSearchCacheDao;
|
||||||
@@ -19,6 +24,7 @@ import net.sf.json.JSONArray;
|
|||||||
import net.sf.json.JSONException;
|
import net.sf.json.JSONException;
|
||||||
import net.sf.json.JSONObject;
|
import net.sf.json.JSONObject;
|
||||||
|
|
||||||
|
import org.apache.commons.codec.binary.Base64;
|
||||||
import org.apache.commons.collections.CollectionUtils;
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
|
||||||
@@ -91,14 +97,149 @@ public class BaiduApiServiceImpl extends AbstractHttpApiService implements Baidu
|
|||||||
@Override
|
@Override
|
||||||
public List<BaiduPlacePoi> searchNearbyLocalDatabase(District district,
|
public List<BaiduPlacePoi> searchNearbyLocalDatabase(District district,
|
||||||
double radius) {
|
double radius) {
|
||||||
if(district.getCity() == null ||district.getLat2() == null || district.getLng2() == null){
|
if(district.getCity() == null || district.getLat() == null || district.getLng() == null){
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
double lat = district.getLat2()/10000000000d;
|
return searchNearbyPoi(district.getCity(), district.getLat()/10000000000d, district.getLng()/10000000000d, radius);
|
||||||
double lng = district.getLng2()/10000000000d;
|
|
||||||
return searchNearbyLocalDatabase(district.getCity(), lat,lng,radius);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** ES查询客户端单例,复用连接池 */
|
||||||
|
private static volatile HttpRequest esHttpRequest;
|
||||||
|
|
||||||
|
private static HttpRequest getEsHttpRequest() {
|
||||||
|
if (esHttpRequest == null) {
|
||||||
|
synchronized (BaiduApiServiceImpl.class) {
|
||||||
|
if (esHttpRequest == null) {
|
||||||
|
esHttpRequest = new HttpRequest();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return esHttpRequest;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public List<BaiduPlacePoi> searchNearbyPoi(final String city ,final double lat,final double lng, final double radius) {
|
||||||
|
|
||||||
|
// v2: 坐标保留6位小数后升版,作废旧缓存
|
||||||
|
String cacheKey = "v2_" + city + "_" + lat + "_" + lng + "_" + radius;
|
||||||
|
Object cached = CacheUtils.getValue(this.getClass(), cacheKey);
|
||||||
|
if (cached != null) {
|
||||||
|
return (List<BaiduPlacePoi>) cached;
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String,String> header = new HashMap<String, String>();
|
||||||
|
try {
|
||||||
|
String auth = "Basic " + Base64.encodeBase64String("elastic:elasticsearch".getBytes("UTF-8"));
|
||||||
|
header.put("Authorization", auth);
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
String seawaterUrl = "http://192.168.0.89:9200/didata_map_poi_2024/_search";
|
||||||
|
JSONObject root = new JSONObject();
|
||||||
|
// _source 过滤
|
||||||
|
JSONArray includes = new JSONArray();
|
||||||
|
includes.add("small_type");
|
||||||
|
includes.add("secondary_type");
|
||||||
|
includes.add("address");
|
||||||
|
includes.add("data_id");
|
||||||
|
includes.add("name");
|
||||||
|
includes.add("location");
|
||||||
|
JSONObject sourceFilter = new JSONObject();
|
||||||
|
sourceFilter.put("includes", includes);
|
||||||
|
root.put("_source", sourceFilter);
|
||||||
|
// bool 查询
|
||||||
|
JSONObject bool = new JSONObject();
|
||||||
|
JSONArray mustArray = new JSONArray();
|
||||||
|
// term status
|
||||||
|
JSONObject termStatus = new JSONObject();
|
||||||
|
termStatus.put("status", "0");
|
||||||
|
JSONObject termWrapper = new JSONObject();
|
||||||
|
termWrapper.put("term", termStatus);
|
||||||
|
mustArray.add(termWrapper);
|
||||||
|
// city status
|
||||||
|
JSONObject termCity = new JSONObject();
|
||||||
|
termCity.put("city", city + "市");
|
||||||
|
JSONObject cityTermWrapper = new JSONObject();
|
||||||
|
cityTermWrapper.put("term", termCity);
|
||||||
|
mustArray.add(cityTermWrapper);
|
||||||
|
// 按高德POI中类(secondary_type)过滤,覆盖菜系等细分小类
|
||||||
|
JSONObject termType = new JSONObject();
|
||||||
|
termType.put("secondary_type", Arrays.asList(
|
||||||
|
"学校", "综合医院", "专科医院",// 学校/医疗
|
||||||
|
"银行",// 银行(仅网点,ATM/银行相关不展示)
|
||||||
|
"超级市场", "商场", "便民商店/便利店", "综合市场",// 超市/商场
|
||||||
|
"美容美发店",// 美容美发
|
||||||
|
"运动场馆",// 健身/运动
|
||||||
|
"公园广场",// 公园
|
||||||
|
"机场相关", "火车站", "长途汽车站", "港口码头",// 交通
|
||||||
|
"外国餐厅", "咖啡厅",// 餐饮(仅品类辨识度高的中类,泛中餐厅/快餐厅等小类噪音多由小类精确映射过滤)
|
||||||
|
"宾馆酒店"));// 酒店(仅宾馆酒店中类)
|
||||||
|
JSONObject typeTermWrapper = new JSONObject();
|
||||||
|
typeTermWrapper.put("terms", termType);
|
||||||
|
mustArray.add(typeTermWrapper);
|
||||||
|
bool.put("must", mustArray);
|
||||||
|
// geo_distance 只放在filter(不评分,走filter cache,勿重复放must)
|
||||||
|
JSONObject point = new JSONObject();
|
||||||
|
point.put("lat", lat);
|
||||||
|
point.put("lon", lng);
|
||||||
|
JSONObject geoDistance = new JSONObject();
|
||||||
|
geoDistance.put("distance", radius + "m");
|
||||||
|
geoDistance.put("location", point); // 直接放入对象
|
||||||
|
JSONObject geoWrapper = new JSONObject();
|
||||||
|
geoWrapper.put("geo_distance", geoDistance);
|
||||||
|
JSONArray filterArray = new JSONArray();
|
||||||
|
filterArray.add(geoWrapper);
|
||||||
|
bool.put("filter", filterArray);
|
||||||
|
JSONObject query = new JSONObject();
|
||||||
|
query.put("bool", bool);
|
||||||
|
root.put("query", query);
|
||||||
|
root.put("size", "300");
|
||||||
|
// ---------- 按距离排序 ----------
|
||||||
|
JSONArray sortArray = new JSONArray();
|
||||||
|
JSONObject geoDistanceSort = new JSONObject();
|
||||||
|
// 指定坐标点(对象格式)
|
||||||
|
geoDistanceSort.put("location", point);
|
||||||
|
// 排序参数(与 location 平级)
|
||||||
|
geoDistanceSort.put("order", "asc");
|
||||||
|
geoDistanceSort.put("unit", "m"); // 单位:米
|
||||||
|
JSONObject sortWrapper = new JSONObject();
|
||||||
|
sortWrapper.put("_geo_distance", geoDistanceSort);
|
||||||
|
sortArray.add(sortWrapper);
|
||||||
|
root.put("sort", sortArray);
|
||||||
|
try {
|
||||||
|
String res = getEsHttpRequest().postWithBody(seawaterUrl, root, header, "UTF-8");
|
||||||
|
JSONObject json = JSONObject.fromObject(res);
|
||||||
|
ArrayList<BaiduPlacePoi> lists = new ArrayList<BaiduPlacePoi>();
|
||||||
|
if(json.has("hits") && json.getJSONObject("hits").has("hits")){
|
||||||
|
JSONArray hits = json.getJSONObject("hits").getJSONArray("hits");
|
||||||
|
for(int i = 0; i < hits.size(); i++){
|
||||||
|
JSONObject hit = hits.getJSONObject(i);
|
||||||
|
JSONObject source = hit.getJSONObject("_source");
|
||||||
|
JSONObject location = source.getJSONObject("location");
|
||||||
|
BaiduPlacePoi poi = new BaiduPlacePoi();
|
||||||
|
poi.setId(source.getString("data_id"));
|
||||||
|
poi.setName(source.getString("name"));
|
||||||
|
poi.setAddress(source.optString("address"));
|
||||||
|
poi.setKeyword(source.optString("small_type"));
|
||||||
|
// 中类存入streetId,供上层做类型兜底匹配
|
||||||
|
poi.setStreetId(source.optString("secondary_type"));
|
||||||
|
poi.setCity(city);
|
||||||
|
// 高德坐标(GCJ-02)转百度坐标(BD-09),经纬度保留6位小数
|
||||||
|
Map<String, Double> bdLocation = GeoUtils.gcj02ToBd09(location.getDouble("lat"), location.getDouble("lon"));
|
||||||
|
poi.setLat(DataUtil.roundDouble(bdLocation.get(GeoUtils.LAT), 6));
|
||||||
|
poi.setLng(DataUtil.roundDouble(bdLocation.get(GeoUtils.LNG), 6));
|
||||||
|
poi.setStatus(0);
|
||||||
|
lists.add(poi);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CacheUtils.putValueCompress(CachePolicyEnum.MIDDLE, this.getClass(), cacheKey, lists);
|
||||||
|
return lists;
|
||||||
|
} catch (HttpRequestException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public Map<String, JSONObject> searchNearBy(List<String> keywords, double lat, double lng, double radius, String ak){
|
public Map<String, JSONObject> searchNearBy(List<String> keywords, double lat, double lng, double radius, String ak){
|
||||||
List<QueryParam> paramList = new ArrayList<QueryParam>();
|
List<QueryParam> paramList = new ArrayList<QueryParam>();
|
||||||
paramList.add(new QueryParam("lat",lat));
|
paramList.add(new QueryParam("lat",lat));
|
||||||
|
|||||||
+11
-4
@@ -157,7 +157,7 @@ public class OfficeServiceImpl implements OfficeService {
|
|||||||
Integer startDate = Integer.valueOf(DateUtil.formatByPattern(DateUtil.addMonthToDate(new Date(), -12), "yyyyMMdd"));
|
Integer startDate = Integer.valueOf(DateUtil.formatByPattern(DateUtil.addMonthToDate(new Date(), -12), "yyyyMMdd"));
|
||||||
query.setStartDate(startDate);
|
query.setStartDate(startDate);
|
||||||
query.setEndDate(endDate);
|
query.setEndDate(endDate);
|
||||||
|
query.setCityDisplay(RegionData.formatCity(evaluation.getCity()));
|
||||||
query.setCityDisplay(evaluation.getCity());
|
query.setCityDisplay(evaluation.getCity());
|
||||||
Pager pager = new Pager();
|
Pager pager = new Pager();
|
||||||
pager.setStartRow(0);
|
pager.setStartRow(0);
|
||||||
@@ -255,8 +255,7 @@ public class OfficeServiceImpl implements OfficeService {
|
|||||||
Integer startDate = Integer.valueOf(DateUtil.formatByPattern(DateUtil.addMonthToDate(new Date(), -12), "yyyyMMdd"));
|
Integer startDate = Integer.valueOf(DateUtil.formatByPattern(DateUtil.addMonthToDate(new Date(), -12), "yyyyMMdd"));
|
||||||
query.setStartDate(startDate);
|
query.setStartDate(startDate);
|
||||||
query.setEndDate(endDate);
|
query.setEndDate(endDate);
|
||||||
|
query.setCityDisplay(RegionData.formatCity(evaluation.getCity()));
|
||||||
query.setCityDisplay(evaluation.getCity());
|
|
||||||
Pager pager = new Pager();
|
Pager pager = new Pager();
|
||||||
pager.setStartRow(0);
|
pager.setStartRow(0);
|
||||||
pager.setPageSize(100);
|
pager.setPageSize(100);
|
||||||
@@ -366,8 +365,16 @@ public class OfficeServiceImpl implements OfficeService {
|
|||||||
pager.setPageSize(5);
|
pager.setPageSize(5);
|
||||||
query.setPager(pager);
|
query.setPager(pager);
|
||||||
query.setTable("latest_seawater");
|
query.setTable("latest_seawater");
|
||||||
|
|
||||||
List<Seawater> seawaters = seawaterService.findSeawatersByQuery(query);
|
List<Seawater> seawaters = seawaterService.findSeawatersByQuery(query);
|
||||||
|
if(seawaters.isEmpty()){
|
||||||
|
OfficeEvaluationDto officeEvaluationDto = new OfficeEvaluationDto();
|
||||||
|
officeEvaluationDto.setUnitPrice(avgPrice);
|
||||||
|
officeEvaluationDto.setSeawater(Collections.<SeawaterDto>emptyList());
|
||||||
|
officeEvaluationDto.setCity(evaluation.getCity());
|
||||||
|
officeEvaluationDto.setDistrict(evaluation.getRegion());
|
||||||
|
officeEvaluationDto.setName(evaluation.getDistrictName());
|
||||||
|
return officeEvaluationDto;
|
||||||
|
}
|
||||||
return getOfficeEvaluationDto(seawaters, evaluation, cat);
|
return getOfficeEvaluationDto(seawaters, evaluation, cat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,8 +26,12 @@ public class ApiUserBo implements Serializable {
|
|||||||
private Date deadTime;
|
private Date deadTime;
|
||||||
private String manager;
|
private String manager;
|
||||||
private String priceType;
|
private String priceType;
|
||||||
|
private String enterpriseVillageAi;
|
||||||
private Integer isMonitor;
|
private Integer isMonitor;
|
||||||
|
|
||||||
|
private Date creationDate;
|
||||||
|
|
||||||
|
|
||||||
private String contact; //联系人
|
private String contact; //联系人
|
||||||
|
|
||||||
private String phone; //联系人手机号
|
private String phone; //联系人手机号
|
||||||
@@ -38,6 +42,14 @@ public class ApiUserBo implements Serializable {
|
|||||||
|
|
||||||
private Integer isWarnExpired;
|
private Integer isWarnExpired;
|
||||||
|
|
||||||
|
public String getEnterpriseVillageAi() {
|
||||||
|
return enterpriseVillageAi;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnterpriseVillageAi(String enterpriseVillageAi) {
|
||||||
|
this.enterpriseVillageAi = enterpriseVillageAi;
|
||||||
|
}
|
||||||
|
|
||||||
public String getPriceType() {
|
public String getPriceType() {
|
||||||
return priceType;
|
return priceType;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user