Compare commits

...

77 Commits

Author SHA1 Message Date
王文艳 9dd8e2e9c4 Use numeric build number for asset version 2026-10-27 21:07:13 +08:00
王文艳 721277a84b Use build version for static assets 2026-10-27 21:00:13 +08:00
王文艳 b6166e2e79 Fix duplicate Elasticsearch JDBC driver 2026-10-27 18:26:53 +08:00
王文艳 9e729f5366 fix(deploy): use projects/fangjia-script/target/fangjia-script.jar for scp 2026-09-30 21:19:31 +08:00
王文艳 e6eb4d5c03 fix(deploy): fix docker compose directory and jar package path in Jenkinsfile for fangjia-script 2026-09-30 21:14:47 +08:00
王文艳 f9967af738 修复厦门数据跑批脚本 2026-09-30 21:05:56 +08:00
王文艳 40b7c67b34 修复厦门数据跑批脚本 2026-09-30 20:58:04 +08:00
王文艳 22effa754b 修复厦门数据跑批脚本 2026-09-30 20:50:33 +08:00
王文艳 0691235b69 修复厦门数据跑批脚本 2026-09-30 20:48:53 +08:00
王文艳 77d2ec0527 添加AI支持 2026-09-20 13:56:27 +08:00
王文艳 c3d0a39eff 添加AI支持 2026-09-11 09:10:55 +08:00
王文艳 f6cd5acbc3 修改月度均价定时任务 2026-09-07 18:09:19 +08:00
王文艳 90618f96b0 feat: 对公涉农接口支持AI配置与透传,API后台支持配置对公涉农启用AI 2026-09-04 10:37:51 +08:00
王文艳 cfb3e4aa74 地址不全接口添加地址有效性判定 2026-09-03 11:26:25 +08:00
王文艳 d33bb1c75c POI缓存key升版v2,作废坐标未截断的旧缓存
Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-16 21:08:35 +08:00
王文艳 7665e2f3ce 小区周边配套(facilities)切换高德POI数据源并优化性能
- searchNearbyPoi改查ES高德POI(didata_map_poi_2024),按secondary_type中类过滤
- POI类型映射兼容高德分类:small_type精确匹配+secondary_type中类兜底
- 新增排除集合AROUND_EXCLUDE_TYPES:过滤ATM/培训机构/诊所/泛中餐厅/快餐厅等噪音类型
- 高德GCJ-02坐标转百度BD-09输出,经纬度保留6位小数
- 性能优化:批量12小区ES查询并行化、ES结果加缓存(MIDDLE)、ES客户端连接池单例复用、geo_distance只放filter
- BaiduPlacePoi实现Serializable支持缓存序列化

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-16 20:51:11 +08:00
王文艳 548671668f 优化 Jenkinsfile SSH 部署方式
- 统一使用 sshagent + 密钥认证替代 sshpass + 密码认证
- 所有项目使用统一的 SSH 凭证 deploy-server-ssh
- 修复 SSH 命令引号闭合问题,改用单行命令格式
- 移除 PROJECT_CONFIG 中的 sshCredId 字段,新增 deployUser 字段

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-14 16:33:30 +08:00
王文艳 9287511308 统一管理 - 所有项目使用同一个 SSH 密钥凭证 deploy-server-ssh 2026-08-14 16:29:22 +08:00
王文艳 f3e7f977c2 优化第三方均价 2026-08-14 15:24:10 +08:00
王文艳 0141feb67e 修改写字楼估值逻辑-无样本也估值 2026-08-07 16:14:47 +08:00
王文艳 8da41233f5 修复fangjia-coresite依赖配置和SLF4J版本冲突
- 为sothis-core依赖添加compile scope,确保运行时可用
- 强制统一SLF4J版本为1.7.25,解决版本冲突
- 解决CXF 2.2.3引入旧版slf4j-api与nacos-client的jcl-over-slf4j 1.7.x冲突
- 确保应用启动时不再出现SLF4J版本不兼容错误

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-07 10:47:14 +08:00
王文艳 edfcc031fc 修复sothis-core依赖配置,解决运行时类找不到问题
- 将sothis-core版本从0.2.0改为0.1.0-SNAPSHOT,与sothis-web保持版本一致
- 移除provided scope,确保sothis-core被包含在WAR包中
- 解决运行时Closure.class等类找不到的FileNotFoundException
- 确保与正常工作的fangjia-open项目使用相同的依赖版本

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-07 10:22:28 +08:00
王文艳 29d91a6e05 修复sothis-core依赖版本冲突
- 将sothis-core版本从0.1.0-SNAPSHOT升级到0.2.0
- 添加provided scope,避免与fangjia-service传递依赖冲突
- 解决SLF4J版本不兼容问题
- 修复应用启动时的依赖冲突错误

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-07 10:13:10 +08:00
王文艳 d9d7a1d115 优化Jenkins流水线配置
- 修改agent配置为any,提高流水线灵活性
- 添加构建历史清理策略,保留最近3次或30天内的构建记录
- 优化磁盘空间使用,避免构建记录无限增长

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-07 10:00:23 +08:00
王文艳 46ec261e7b 修复Jenkins部署流水线SSH连接问题
- 在所有SSH/SCP命令中添加HostKeyAlgorithms和PubkeyAcceptedAlgorithms参数
- 解决"Unable to negotiate with server: no matching host key type found"错误
- 支持连接仅支持ssh-rsa算法的旧版SSH服务器
- 确保Jenkins自动化部署流程正常工作

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-07 09:39:29 +08:00
王文艳 34a18bf416 修复fangjia-coresite编译错误,添加sothis-core依赖
- 在fangjia-coresite的pom.xml中添加sothis-core依赖
- 解决编译时org.sothis.core.util包找不到的问题
- 该依赖包含Closure、CollectionUtils、Pager等工具类

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-07 09:28:24 +08:00
王文艳 d76a88bc3e 修改平米租金计算任务 2026-08-05 15:56:38 +08:00
王文艳 b0b24eec0a 添加月度均价定时任务 2026-08-05 08:22:31 +08:00
王文艳 5bf3fb3911 添加月度均价定时任务 2026-07-01 17:38:01 +08:00
王文艳 78680222d6 添加月度均价定时任务 2026-07-01 09:17:05 +08:00
王文艳 a3b14dfe56 添加月度均价定时任务 2026-06-29 18:03:05 +08:00
王文艳 a6a6a57385 添加月度均价定时任务 2026-06-23 15:10:30 +08:00
王文艳 5dfa6d8432 添加月度均价定时任务 2026-06-18 19:56:36 +08:00
王文艳 4e3fb46c62 添加月度均价定时任务 2026-06-18 19:55:47 +08:00
王文艳 3c10c22dc3 添加月度均价定时任务 2026-06-18 15:30:19 +08:00
王文艳 23d26b75f8 添加月度均价定时任务 2026-06-18 15:28:10 +08:00
王文艳 7eb3b10b56 添加月度均价定时任务 2026-06-18 08:59:00 +08:00
王文艳 746d39660a 修改接口bug 2026-06-12 21:05:06 +08:00
王文艳 743dc638e9 修改接口bug 2026-06-12 20:51:27 +08:00
王文艳 527dc0f6af 优化写字楼接口 2026-06-02 19:13:22 +08:00
王文艳 8a34a355ae 优化写字楼接口 2026-06-02 11:41:28 +08:00
王文艳 1b9373bb0c 优化写字楼接口 2026-06-02 10:40:07 +08:00
王文艳 6f08f9ad76 移除厦门银行定时任务 2026-06-01 15:36:22 +08:00
王文艳 3d944d5f67 fix bug 2026-06-01 15:16:18 +08:00
王文艳 d5ac4baa1d 修改字符编码 2026-06-01 14:47:42 +08:00
王文艳 9b84cd2da4 修改字符编码 2026-06-01 14:35:23 +08:00
王文艳 03aa02f02e 修改字符编码 2026-06-01 14:34:17 +08:00
王文艳 bb1abadb11 修改字符编码 2026-05-24 10:36:14 +08:00
王文艳 f17775995d 更新jenkinsfile 2026-05-24 09:35:17 +08:00
王文艳 7c7f38ef7c 更新jenkinsfile 2026-05-24 09:13:41 +08:00
王文艳 5f3d10043b 更新jenkinsfile 2026-05-24 09:02:02 +08:00
王文艳 cb3e20c057 更新jenkinsfile 2026-05-24 08:55:43 +08:00
王文艳 eee5f00c3f 更新jenkinsfile 2026-05-24 07:20:42 +08:00
王文艳 5a5ffe8aac 优化代码 2026-05-23 23:04:36 +08:00
王文艳 70a8c8a843 优化代码 2026-05-23 22:56:17 +08:00
王文艳 e96a763731 优化脚本 2026-05-23 22:45:30 +08:00
王文艳 c2ecde7d4c 优化Jenkins 2026-05-23 22:34:05 +08:00
王文艳 2d79b6cb98 优化Script 2026-05-23 22:31:51 +08:00
王文艳 8c947dbd51 修改定时任务 2026-05-23 22:07:44 +08:00
王文艳 5f6011a29a 修改Dockerfile 2026-05-23 21:54:38 +08:00
王文艳 749125d3b7 更新Dockerfile 2026-05-23 20:51:29 +08:00
王文艳 f9a6ddef0d 更新jenkinsfile 2026-05-23 20:39:44 +08:00
王文艳 156b22c73b 更新jenkinsfile 2026-05-23 20:30:13 +08:00
王文艳 9f6e471127 更新jenkinsfile 2026-05-23 20:14:20 +08:00
王文艳 df1f1db03f 优化jenkins 2026-05-20 10:50:36 +08:00
王文艳 225e4e808d 优化jenkins 2026-05-20 10:42:29 +08:00
王文艳 fbd9ddf3a4 添加FangJiaScript 2026-05-20 10:09:30 +08:00
王文艳 66a9819b8c 更新公司图片 2026-05-20 08:16:04 +08:00
王文艳 5f26f3df88 更新jenkins 2026-05-19 22:00:42 +08:00
王文艳 e7a3010727 更新jenkins 2026-05-19 21:52:57 +08:00
王文艳 5059543d31 更新ssh 2026-05-19 21:31:58 +08:00
王文艳 82ff6006af 优化房价构建文件 2026-05-19 21:18:02 +08:00
王文艳 ab3a49639a 更新jenkinsfile 2026-05-19 20:50:58 +08:00
王文艳 34ceea53f9 更新jenkinsfuke 2026-05-19 20:45:55 +08:00
王文艳 81503d0c62 修改配置文件 2026-05-19 18:43:08 +08:00
王文艳 68c445b002 修改配置文件 2026-05-19 17:06:29 +08:00
王文艳 a6d58b7745 更新服务地址 2026-05-18 16:54:30 +08:00
125 changed files with 1717 additions and 560 deletions
+29 -1
View File
@@ -7,7 +7,35 @@
"Bash(npm install:*)", "Bash(npm install:*)",
"Bash(node generate_doc.js:*)", "Bash(node generate_doc.js:*)",
"Bash(xargs grep:*)", "Bash(xargs grep:*)",
"Bash(node:*)" "Bash(node:*)",
"Bash(find \"C:\\\\Users\\\\wenyan\\\\IdeaProjects\\\\main\\\\projects\\\\fangjia-script\\\\src\\\\main\\\\groovy\\\\com\\\\fangjia\\\\script\" -type f -name \"*.groovy\")",
"Read(//tmp/**)",
"Bash(cat)",
"Bash(chmod +x /tmp/search_scripts.sh)",
"Bash(/tmp/search_scripts.sh)",
"Bash(chmod +x /tmp/search_by_content.sh)",
"Bash(/tmp/search_by_content.sh)",
"Bash(chmod +x /tmp/search_all.sh)",
"Bash(/tmp/search_all.sh)",
"Bash(chmod +x /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
+167 -34
View File
@@ -1,70 +1,195 @@
#!/usr/bin/env groovy #!/usr/bin/env groovy
// 每个项目的完整部署配置字典,新增项目只需在此添加一条记录
// buildDir: Maven 构建目录名(deliverables/<buildDir>),默认与 key 同名,不同时显式指定
// deployUser: SSH 登录用户(默认为 docker),使用 sshagent 密钥认证
def PROJECT_CONFIG = [
'fangjiabkoff' : [
imageName : 'fangjia-bkoff',
composeDir : 'fangjia-bkoff',
serviceName : 'fangjia-bkoff',
deployHost : '192.168.0.80',
deployBase : '/home/docker',
deployUser : 'docker',
],
'chafangtong' : [
imageName : 'chafangtong',
composeDir : 'chafangtong',
serviceName : 'chafangtong',
deployHost : '192.168.0.80',
deployBase : '/home/docker',
deployUser : 'docker',
],
'fangjia' : [
imageName : 'fangjia-coresite',
composeDir : 'fangjia-coresite',
serviceName : 'fangjia-coresite',
deployHost : '192.168.0.80',
deployBase : '/home/docker',
deployUser : 'docker',
],
'fangjiapds' : [
imageName : 'fangjia-pds',
composeDir : 'fangjia-pds',
serviceName : 'fangjia-pds',
deployHost : '192.168.0.80',
deployBase : '/home/docker',
deployUser : 'docker',
],
'fangjiastatic' : [
imageName : 'fangjia-static',
composeDir : 'fangjia-coresite',
serviceName : 'fangjia-static',
deployHost : '192.168.0.80',
deployBase : '/home/docker',
deployUser : 'docker',
],
'geluke' : [
imageName : 'geluke',
composeDir : 'geluke',
serviceName : 'geluke',
deployHost : '192.168.0.80',
deployBase : '/home/docker',
deployUser : 'docker',
],
'fangjiaopen' : [
imageName : 'fangjia-open',
composeDir : 'fangjia-open',
serviceName : 'fangjia-open',
deployHost : ['192.168.0.36', '192.168.0.18'],
deployBase : '/home/docker',
deployUser : 'docker',
],
'fangjia-script' : [
buildDir : 'script', // deliverables/script
imageName : 'fangjia-script',
composeDir : 'fangjia-script',
serviceName : 'fangjia-script',
deployHost : '192.168.0.36',
deployBase : '/home/docker',
deployUser : 'docker',
],
]
pipeline { pipeline {
agent any agent any
options {
// 自动保留最近 3 次构建记录,或者保留最近 30 天的记录
buildDiscarder(logRotator(numToKeepStr: '3', daysToKeepStr: '30'))
}
parameters { parameters {
choice(name: 'PROJECT_NAME', choices: ['chafangtong', 'fangjia', 'fangjiapds', 'fangjiastatic', 'geluke', 'fangjiaopen'], description: '请选择发布的项目') choice(name: 'PROJECT_NAME', choices: ['chafangtong', 'fangjia', 'fangjiapds', 'fangjiastatic', 'geluke', 'fangjiaopen', 'fangjia-script'], description: '请选择发布的项目')
} }
tools { tools {
jdk 'JDK8' jdk 'JDK8'
} }
environment {
REGISTRY = "192.168.0.19:9011"
}
stages { stages {
stage("Git Checkout") { stage("Git Checkout") {
steps { steps {
git changelog: false, credentialsId: 'gitlabsecret', poll: false, url: 'http://gitlab.fangjia.com/dev0/main.git' git changelog: false, credentialsId: 'Gitea_Admin_Token', poll: false, url: 'https://gitea.fangjia.com/dev0/main.git'
} }
} }
stage('Maven Build') { stage('Maven Build') {
steps { steps {
script { script {
def projects = ['fangjiabkoff', 'chafangtong', 'fangjia', 'fangjiapds', 'fangjiastatic', 'geluke', 'fangjiaopen'] def cfg = PROJECT_CONFIG[params.PROJECT_NAME]
for (def project : projects) { def buildDir = cfg.buildDir ?: params.PROJECT_NAME
if (params.PROJECT_NAME == project) { dir("deliverables/${buildDir}") {
dir("deliverables/${project}") { withMaven(globalMavenSettingsConfig: '426b9a25-aa0d-47d3-a24c-8abdfc4421ff', jdk: "JDK8") {
withMaven(globalMavenSettingsConfig: '426b9a25-aa0d-47d3-a24c-8abdfc4421ff') { sh 'mvn clean package -Dmaven.test.skip=true -Dasset.version="$BUILD_NUMBER"'
sh 'mvn clean package -Dmaven.test.skip=true'
}
}
} }
} }
} }
} }
} }
stage('Docker Build') {
stage('Docker Build & Push') {
steps { steps {
script { script {
def projects = ['fangjiabkoff', 'chafangtong', 'fangjia', 'fangjiapds', 'fangjiastatic', 'geluke', 'fangjiaopen'] def cfg = PROJECT_CONFIG[params.PROJECT_NAME]
def imagesName = ['fangjiabkoff': 'fangjia-bkoff', 'chafangtong': 'chafangtong', 'fangjia': 'fangjia-coresite', 'fangjiapds': 'fangjia-pds', 'fangjiastatic': 'fangjia-static', 'geluke':"geluke", 'fangjiaopen': 'fangjia-open'] def imageTag = env.BUILD_TAG.toLowerCase()
for (def project : projects) { dir("projects/${cfg.imageName}") {
if (params.PROJECT_NAME == project) { withDockerRegistry(credentialsId: 'DockerNexus', url: "http://${REGISTRY}") {
dir("projects/${imagesName[project]}") { sh "docker build -t ${REGISTRY}/${cfg.imageName}:${imageTag} ."
withDockerRegistry(credentialsId: 'DockerNexus', url: 'http://192.168.0.19:9012') { sh "docker tag ${REGISTRY}/${cfg.imageName}:${imageTag} ${REGISTRY}/${cfg.imageName}:latest"
sh "docker build -t 192.168.0.19:9011/${imagesName[project]}:${env.BUILD_TAG.toLowerCase()} ." sh "docker push ${REGISTRY}/${cfg.imageName}:latest"
withDockerRegistry(credentialsId: 'DockerNexus', url: 'http://192.168.0.19:9011') {
sh "docker push 192.168.0.19:9011/${imagesName[project]}:${env.BUILD_TAG.toLowerCase()}"
}
}
}
} }
} }
} }
} }
} }
stage('K8S Deploy') {
stage('Docker Compose Deploy') {
steps { steps {
script { script {
def projects = ['fangjiabkoff', 'chafangtong', 'fangjia', 'fangjiapds', 'fangjiastatic', 'geluke', 'fangjiaopen'] def cfg = PROJECT_CONFIG[params.PROJECT_NAME]
def k8s_config_map = ['fangjiabkoff': 'fangjia-bkoff', 'chafangtong': 'chafangtong', 'fangjia': 'fangjia-coresite', 'fangjiapds': 'fangjia-pds', 'fangjiastatic': 'fangjia-static', 'geluke':"geluke", 'fangjiaopen': 'fangjia-open'] def deployUser = cfg.deployUser ?: 'docker'
for (def project : projects) { sshagent(credentials: ['deploy-server-ssh']) {
if (params.PROJECT_NAME == project) { if (params.PROJECT_NAME == "fangjia-script") {
dir("deliverables/k8s") { def buildDir = cfg.buildDir ?: params.PROJECT_NAME
withKubeConfig([credentialsId: 'K8SSecret', serverUrl: 'https://k8s.fangjia.com:6443']) { sh """
def orgVersion = "${k8s_config_map[project]}:latest" # 确保目录存在
def nowVersion = "${k8s_config_map[project]}:${env.BUILD_TAG.toLowerCase()}" ssh -o StrictHostKeyChecking=no \
sh "sed -i 's/${orgVersion}/${nowVersion}/g' ${k8s_config_map[project]}.yaml" -o HostKeyAlgorithms=+ssh-rsa \
sh "kubectl apply -f ${k8s_config_map[project]}.yaml" -o PubkeyAcceptedKeyTypes=+ssh-rsa \
${deployUser}@${cfg.deployHost} \
'mkdir -p /home/docker/fangjia-script/scripts/fangjia && mkdir -p /home/docker/fangjia-script/logs'
# 上传 fat jar
scp -o StrictHostKeyChecking=no \
-o HostKeyAlgorithms=+ssh-rsa \
-o PubkeyAcceptedKeyTypes=+ssh-rsa \
projects/fangjia-script/target/fangjia-script.jar \
${deployUser}@${cfg.deployHost}:/home/docker/fangjia-script/fangjia-script.jar
# 上传 groovy 脚本目录
scp -o StrictHostKeyChecking=no \
-o HostKeyAlgorithms=+ssh-rsa \
-o PubkeyAcceptedKeyTypes=+ssh-rsa \
-r projects/fangjia-script/src/main/groovy/* \
${deployUser}@${cfg.deployHost}:/home/docker/fangjia-script/scripts/
# 上传 crontab
scp -o StrictHostKeyChecking=no \
-o HostKeyAlgorithms=+ssh-rsa \
-o PubkeyAcceptedKeyTypes=+ssh-rsa \
projects/fangjia-script/crontab.txt \
${deployUser}@${cfg.deployHost}:/home/docker/fangjia-script/crontab.txt
# 重启容器
ssh -o StrictHostKeyChecking=no \
-o HostKeyAlgorithms=+ssh-rsa \
-o PubkeyAcceptedKeyTypes=+ssh-rsa \
${deployUser}@${cfg.deployHost} \
'cd ${cfg.deployBase}/${cfg.composeDir} && docker compose down && docker compose pull && docker compose up -d'
"""
} else {
if(cfg.deployHost instanceof String){
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}'
"""
} }
} }
} }
} }
} }
@@ -72,4 +197,12 @@ pipeline {
} }
} }
post {
success {
echo "✅ ${params.PROJECT_NAME} 部署成功,镜像版本:${env.BUILD_TAG.toLowerCase()}"
}
failure {
echo "❌ ${params.PROJECT_NAME} 部署失败,请检查日志"
}
}
} }
-2
View File
@@ -25,7 +25,5 @@
<module>../../projects/fangjia-service</module> <module>../../projects/fangjia-service</module>
<module>../../projects/fangjia-coresite</module> <module>../../projects/fangjia-coresite</module>
<module>../../projects/chafangtong-dal</module> <module>../../projects/chafangtong-dal</module>
<module>../../projects/fangjia-static</module>
<module>../../projects/fangjia-script</module>
</modules> </modules>
</project> </project>
@@ -0,0 +1,27 @@
services:
fangjia-bkoff:
image: 192.168.0.19:9012/fangjia-bkoff:latest
container_name: fangjia-bkoff
pull_policy: always
ports:
- "8081:8080"
environment:
JAVA_OPTS: >-
-Dfangjia.overridePropertiesLocation=/home/goojia/goojiaconfig/fangjia-bkoff.properties
-Dfs.mongo.port=27000
-Denable.safeLog=true
-Dlog4j.configuration=file:/home/goojia/webapps/ROOT/WEB-INF/classes/log4j_linux.xml
extra_hosts:
- "seaweed.db.fangjia.com:192.168.0.38"
volumes:
- /etc/localtime:/etc/localtime:ro
- ./goojiaconfig/hosts:/etc/hosts
- ./goojiaconfig:/home/goojia/goojiaconfig
- ./logs/fangjia-bkoff:/home/goojia/logs
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/k8s/readiness"]
interval: 10s
timeout: 5s
retries: 3
start_period: 15s
restart: unless-stopped
@@ -0,0 +1,66 @@
services:
fangjia-coresite:
image: 192.168.0.19:9012/fangjia-coresite:jenkins-fangjiamain-master-360
container_name: fangjia-coresite
pull_policy: always
ports:
- "8082:8080"
environment:
JAVA_OPTS: >-
-Xmx4096m -Xms4096m -XX:MaxPermSize=256m
-Dlog4j.configuration=file:/home/goojia/webapps/ROOT/WEB-INF/classes/log4j_linux.xml
-Dfangjia.overridePropertiesLocation=/home/goojia/goojiaconfig/fangjia-coresite.properties
-DMONGO.POOLSIZE=200
-Dfangjia.disableKnowBaseCache=false
deploy:
resources:
limits:
memory: 5g
reservations:
memory: 4g
volumes:
- /etc/localtime:/etc/localtime:ro
- ./goojiaconfig/hosts:/etc/hosts
- ./goojiaconfig:/home/goojia/goojiaconfig
healthcheck:
test: ["CMD-SHELL", "nc -z localhost 8080 || exit 1"]
interval: 10s
timeout: 5s
retries: 3
start_period: 15s
restart: unless-stopped
fangjia-static:
image: 192.168.0.19:9012/fangjia-static:jenkins-fangjiamain-new_fjw-7
container_name: fangjia-static
pull_policy: always
ports:
- "8083:8080"
environment:
JAVA_OPTS: >-
-Xmx2048m -XX:MaxPermSize=256m
-Dfangjia.wartermarkimage=/home/goojia/goojiaconfig/warter-marker.png
-Dfangjia.downloadTimeout=30000
-Dfangjia.downloadPoolSize=4
-Dlog4j.configuration=file:/home/goojia/webapps/ROOT/WEB-INF/classes/log4j_linux.xml
-Dfs.mongo.port=27000
-Dcapped.mongo.port=27000
-Dfangjia.blackList=soufunimg.com,soufun.com,koofang.com,baixing.net
-Dfangjia.important.category=district,shop,office,avatar,flash,user_house,upload
deploy:
resources:
limits:
memory: 2g
reservations:
memory: 1g
volumes:
- /etc/localtime:/etc/localtime:ro
- ./goojiaconfig/hosts:/etc/hosts
- ./goojiaconfig:/home/goojia/goojiaconfig
healthcheck:
test: ["CMD-SHELL", "nc -z localhost 8080 || exit 1"]
interval: 10s
timeout: 5s
retries: 3
start_period: 15s
restart: unless-stopped
@@ -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>
+7 -2
View File
@@ -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>
@@ -11,7 +11,7 @@ public interface Constants {
String SEABIRD_MONGO_URI = "mongodb://192.168.0.74:57007"; String SEABIRD_MONGO_URI = "mongodb://192.168.0.74:57007";
/** 线下归档数据库*/ /** 线下归档数据库*/
String SEAWATER_MONGO_URI = "mongodb://root:Goojia%40206!!#@192.168.0.206:27020"; String SEAWATER_MONGO_URI = "mongodb://root:Goojia%40206!!#@192.168.0.206:27020";
String MSVC_FANG_JIA_DATA_SERVICE_BASE_PATH ="http://192.168.0.100:38080/FangJiaDataService"; String MSVC_FANG_JIA_DATA_SERVICE_BASE_PATH ="http://192.168.0.80:38080/FangJiaDataService";
/** OpenApi测试账户生成的超级Token*/ /** OpenApi测试账户生成的超级Token*/
String SUPER_USER_TOKEN = "F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"; String SUPER_USER_TOKEN = "F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB";
@@ -27,7 +27,7 @@ import org.apache.http.util.EntityUtils;
public class AddressLatlng { public class AddressLatlng {
static List<String> PROXY_HOSTS = Arrays.asList("192.168.0.98", "192.168.0.102", "192.168.0.96", "192.168.0.101", static List<String> PROXY_HOSTS = Arrays.asList("192.168.0.98", "192.168.0.102", "192.168.0.96", "192.168.0.101",
"192.168.0.103", "192.168.0.90", "192.168.0.93", "192.168.0.99", "192.168.0.94", "192.168.0.100"); "192.168.0.103", "192.168.0.90", "192.168.0.93", "192.168.0.99", "192.168.0.94", "192.168.0.80");
// static int PROXY_USE_COUNT=0; // static int PROXY_USE_COUNT=0;
static AtomicInteger PROXY_USE_COUNT = new AtomicInteger(); static AtomicInteger PROXY_USE_COUNT = new AtomicInteger();
static String AK = "FwGZrRTgZCqsKugHIRNgMwGF"; static String AK = "FwGZrRTgZCqsKugHIRNgMwGF";
+30
View File
@@ -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>
@@ -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>
@@ -0,0 +1,14 @@
package com.fangjia.coresite.controllers;
import com.fangjia.coresite.model.JsonModel;
import java.util.Collections;
public class HealthController {
public Object checkAction() {
JsonModel ret = new JsonModel();
ret.setJsonModel(Collections.singletonMap("status", "ok"));
return ret;
}
}
@@ -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() {
@@ -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;//城市
+11
View File
@@ -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>
@@ -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;
/** /**
* 地址结构化 * 地址结构化
@@ -86,7 +92,7 @@ public class AddrSvcController {
params.put("address", model.getAddress()); params.put("address", model.getAddress());
params.put("addressAssessment", "true"); params.put("addressAssessment", "true");
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/formatNinelevel", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/formatNinelevel", params, "UTF-8");
if (json != null) { if (json != null) {
int code = json.getInt("status"); int code = json.getInt("status");
String msg = json.getString("msg"); String msg = json.getString("msg");
@@ -127,7 +133,7 @@ public class AddrSvcController {
params.put("city", model.getCity()); params.put("city", model.getCity());
params.put("address", model.getAddress()); params.put("address", model.getAddress());
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/villageIdentify", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/villageIdentify", params, "UTF-8");
if (json != null) { if (json != null) {
int code = json.getInt("status"); int code = json.getInt("status");
String msg = json.getString("msg"); String msg = json.getString("msg");
@@ -179,13 +185,20 @@ public class AddrSvcController {
params.put("city", model.getCity()); params.put("city", model.getCity());
params.put("address", model.getAddress()); params.put("address", model.getAddress());
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structureAndComplete", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/structureAndComplete", params, "UTF-8");
if (json != null) { if (json != null) {
int code = json.getInt("status") == 0 ? 200 : 0; int code = json.getInt("status") == 0 ? 200 : 0;
String msg = json.getString("msg"); String msg = json.getString("msg");
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));
@@ -235,7 +248,7 @@ public class AddrSvcController {
params.put("city", model.getCity()); params.put("city", model.getCity());
params.put("address", model.getAddress()); params.put("address", model.getAddress());
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/addrVerify", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/addrVerify", params, "UTF-8");
if (json != null) { if (json != null) {
int code = json.getInt("status"); int code = json.getInt("status");
String msg = json.getString("msg"); String msg = json.getString("msg");
@@ -274,7 +287,7 @@ public class AddrSvcController {
params.put("district", model.getSuggestDistrict()); params.put("district", model.getSuggestDistrict());
try { try {
//新匹配接口 //新匹配接口
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaNlpService/match", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaNlpService/match", params, "UTF-8");
BasicModel basicModel = new BasicModel(200, "ok"); BasicModel basicModel = new BasicModel(200, "ok");
if (json != null && json.size() > 0) { if (json != null && json.size() > 0) {
// 非超级用户不返回置信度 // 非超级用户不返回置信度
@@ -318,7 +331,7 @@ public class AddrSvcController {
params.put("page", "0"); params.put("page", "0");
params.put("offset", String.valueOf(model.getMax() == 0 ? 10 : (model.getMax() > 100 ? 100 : model.getMax()))); params.put("offset", String.valueOf(model.getMax() == 0 ? 10 : (model.getMax() > 100 ? 100 : model.getMax())));
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/v2/addressAssociation", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/v2/addressAssociation", params, "UTF-8");
if (json != null) { if (json != null) {
int code = json.getInt("msgCode"); int code = json.getInt("msgCode");
String msg = json.getString("msg"); String msg = json.getString("msg");
@@ -358,7 +371,7 @@ public class AddrSvcController {
params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : ""); params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : "");
params.put("max", model.getMax() != 0 ? String.valueOf(model.getMax()) : ""); params.put("max", model.getMax() != 0 ? String.valueOf(model.getMax()) : "");
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/tips", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/tips", params, "UTF-8");
if (json != null) { if (json != null) {
int code = json.getInt("msgCode"); int code = json.getInt("msgCode");
String msg = json.getString("msg"); String msg = json.getString("msg");
@@ -397,7 +410,7 @@ public class AddrSvcController {
// params.put("district", model.getSuggestDistrict());//接口没有此参数 // params.put("district", model.getSuggestDistrict());//接口没有此参数
try { try {
//新匹配接口 //新匹配接口
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaNlpService/match", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaNlpService/match", params, "UTF-8");
BasicModel basicModel = new BasicModel(200, "ok"); BasicModel basicModel = new BasicModel(200, "ok");
if (json != null && json.size() > 0) { if (json != null && json.size() > 0) {
MatchedBuildingDto dto = new MatchedBuildingDto(); MatchedBuildingDto dto = new MatchedBuildingDto();
@@ -458,10 +471,10 @@ public class AddrSvcController {
params.put("complete", "true"); params.put("complete", "true");
params.put("addressAssessment", "true"); params.put("addressAssessment", "true");
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/v3/structure", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/v3/structure", params, "UTF-8");
} catch (Exception e) { } catch (Exception e) {
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/v3/structure", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/v3/structure", params, "UTF-8");
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
@@ -500,10 +513,10 @@ public class AddrSvcController {
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());
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaDataService/valueRate", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaDataService/valueRate", params, "UTF-8");
} catch (Exception e) { } catch (Exception e) {
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaDataService/valueRate", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaDataService/valueRate", params, "UTF-8");
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
@@ -559,11 +572,28 @@ 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.100: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) {
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/v6/villageIdentify", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/v6/villageIdentify", params, "UTF-8");
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
@@ -711,10 +741,10 @@ public class AddrSvcController {
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);
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/shzxVillageIdentify", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/shzxVillageIdentify", params, "UTF-8");
} catch (Exception e) { } catch (Exception e) {
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/shzxVillageIdentify", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/shzxVillageIdentify", params, "UTF-8");
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
@@ -813,10 +843,10 @@ public class AddrSvcController {
String address = model.getAddress(); String address = model.getAddress();
params.put("address", address); params.put("address", address);
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/boscEnterpriseVillageIdentify", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/boscEnterpriseVillageIdentify", params, "UTF-8");
} catch (Exception e) { } catch (Exception e) {
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/boscEnterpriseVillageIdentify", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/boscEnterpriseVillageIdentify", params, "UTF-8");
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
@@ -992,10 +1022,10 @@ public class AddrSvcController {
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);
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/residentialVillageIdentify", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/residentialVillageIdentify", params, "UTF-8");
} catch (Exception e) { } catch (Exception e) {
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/residentialVillageIdentify", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/residentialVillageIdentify", params, "UTF-8");
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
@@ -1114,11 +1144,28 @@ 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.100: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) {
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/enterpriseVillageIdentify", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/enterpriseVillageIdentify", params, "UTF-8");
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
@@ -1204,10 +1251,10 @@ public class AddrSvcController {
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);
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/villageIdentify", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/villageIdentify", params, "UTF-8");
} catch (Exception e) { } catch (Exception e) {
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/villageIdentify", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/villageIdentify", params, "UTF-8");
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
@@ -1364,10 +1411,10 @@ public class AddrSvcController {
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);
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/villageIdentify", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/villageIdentify", params, "UTF-8");
} catch (Exception e) { } catch (Exception e) {
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/villageIdentify", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/villageIdentify", params, "UTF-8");
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
@@ -1416,10 +1463,10 @@ public class AddrSvcController {
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);
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/v2/addressAssociation", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/v2/addressAssociation", params, "UTF-8");
} catch (Exception e) { } catch (Exception e) {
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/v2/addressAssociation", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/v2/addressAssociation", params, "UTF-8");
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
@@ -1452,10 +1499,10 @@ public class AddrSvcController {
Map<String, String> params = new HashMap<String, String>(); Map<String, String> params = new HashMap<String, String>();
params.put("province", StringUtils.isNotBlank(model.getProvince()) ? model.getProvince() : null); params.put("province", StringUtils.isNotBlank(model.getProvince()) ? model.getProvince() : null);
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/listCity", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/listCity", params, "UTF-8");
} catch (Exception e) { } catch (Exception e) {
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/listCity", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/listCity", params, "UTF-8");
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
@@ -1510,10 +1557,10 @@ public class AddrSvcController {
HttpRequest request = new HttpRequest(); HttpRequest request = new HttpRequest();
JSONObject json = null; JSONObject json = null;
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/listProvince", null, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/listProvince", null, "UTF-8");
} catch (Exception e) { } catch (Exception e) {
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/listProvince", null, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/listProvince", null, "UTF-8");
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
@@ -1565,10 +1612,10 @@ public class AddrSvcController {
params.put("province", StringUtils.isNotBlank(model.getProvince()) ? model.getProvince() : null); params.put("province", StringUtils.isNotBlank(model.getProvince()) ? model.getProvince() : null);
params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : null); params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : null);
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/listDistrict", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/listDistrict", params, "UTF-8");
} catch (Exception e) { } catch (Exception e) {
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/listDistrict", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/listDistrict", params, "UTF-8");
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
@@ -1627,10 +1674,10 @@ public class AddrSvcController {
params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : null); params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : null);
params.put("district", StringUtils.isNotBlank(model.getDistrict()) ? model.getDistrict() : null); params.put("district", StringUtils.isNotBlank(model.getDistrict()) ? model.getDistrict() : null);
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/listTownship", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/listTownship", params, "UTF-8");
} catch (Exception e) { } catch (Exception e) {
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/listTownship", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/listTownship", params, "UTF-8");
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
@@ -1695,10 +1742,10 @@ public class AddrSvcController {
params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : null); params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : null);
params.put("address", StringUtils.isNotBlank(model.getAddress()) ? model.getAddress() : null); params.put("address", StringUtils.isNotBlank(model.getAddress()) ? model.getAddress() : null);
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/addrLevel", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/addrLevel", params, "UTF-8");
} catch (Exception e) { } catch (Exception e) {
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/addrLevel", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/addrLevel", params, "UTF-8");
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
@@ -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;
}
} }
@@ -1840,10 +1840,10 @@ public class AddressController {
params.put("address", model.getAddress()); params.put("address", model.getAddress());
params.put("showCode", model.getShowCode()); params.put("showCode", model.getShowCode());
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structure", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/structure", params, "UTF-8");
} catch (Exception e) { } catch (Exception e) {
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structure", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/structure", params, "UTF-8");
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
@@ -1878,10 +1878,10 @@ public class AddressController {
params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : CONFIG.getDefaultCity()); params.put("city", StringUtils.isNotBlank(model.getCity()) ? model.getCity() : CONFIG.getDefaultCity());
params.put("address", model.getAddress()); params.put("address", model.getAddress());
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/cmbTest", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/cmbTest", params, "UTF-8");
} catch (Exception e) { } catch (Exception e) {
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/cmbTest", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/cmbTest", params, "UTF-8");
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
@@ -1923,10 +1923,10 @@ public class AddressController {
// 地址验证无效也输出标准化结果 // 地址验证无效也输出标准化结果
params.put("flag", "true"); params.put("flag", "true");
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/fiveDivisionStructure", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/fiveDivisionStructure", params, "UTF-8");
} catch (Exception e) { } catch (Exception e) {
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/fiveDivisionStructure", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/fiveDivisionStructure", params, "UTF-8");
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
@@ -1968,10 +1968,10 @@ public class AddressController {
// 地址验证无效也输出标准化结果 // 地址验证无效也输出标准化结果
params.put("flag", "true"); params.put("flag", "true");
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/fiveDivisionStructure/v2", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/fiveDivisionStructure/v2", params, "UTF-8");
} catch (Exception e) { } catch (Exception e) {
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/fiveDivisionStructure/v2", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/fiveDivisionStructure/v2", params, "UTF-8");
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
@@ -2014,10 +2014,10 @@ public class AddressController {
// 地址验证无效也输出标准化结果 // 地址验证无效也输出标准化结果
params.put("flag", "true"); params.put("flag", "true");
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/divisionStructure", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/divisionStructure", params, "UTF-8");
} catch (Exception e) { } catch (Exception e) {
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/divisionStructure", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/divisionStructure", params, "UTF-8");
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
@@ -2059,10 +2059,10 @@ public class AddressController {
// 地址验证无效也输出标准化结果 // 地址验证无效也输出标准化结果
params.put("flag", "true"); params.put("flag", "true");
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structureAndComplete", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/structureAndComplete", params, "UTF-8");
} catch (Exception e) { } catch (Exception e) {
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structureAndComplete", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/structureAndComplete", params, "UTF-8");
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
@@ -2111,7 +2111,7 @@ public class AddressController {
reqBody.put("memo", model.getMemo()); reqBody.put("memo", model.getMemo());
reqBody.put("seaweedId", model.getId()); reqBody.put("seaweedId", model.getId());
String result = request.postWithBody("http://192.168.0.100:32080/FangJiaAddressService/communitySummary", reqBody, headers, "UTF-8"); String result = request.postWithBody("http://192.168.0.80:32080/FangJiaAddressService/communitySummary", reqBody, headers, "UTF-8");
if (result != null) { if (result != null) {
try { try {
json = JSONObject.fromObject(result); json = JSONObject.fromObject(result);
@@ -2224,7 +2224,7 @@ public class AddressController {
reqBody.put("maxFloor", model.getMaxFloor()); reqBody.put("maxFloor", model.getMaxFloor());
reqBody.put("housePurpose", model.getHousePurpose()); reqBody.put("housePurpose", model.getHousePurpose());
reqBody.put("memo", model.getMemo()); reqBody.put("memo", model.getMemo());
String result = request.postWithBody("http://192.168.0.100:32080/FangJiaAddressService/buildingRating", reqBody, headers, "UTF-8"); String result = request.postWithBody("http://192.168.0.80:32080/FangJiaAddressService/buildingRating", reqBody, headers, "UTF-8");
if (result != null) { if (result != null) {
try { try {
json = JSONObject.fromObject(result); json = JSONObject.fromObject(result);
@@ -2279,7 +2279,7 @@ public class AddressController {
reqBody.put("housePurpose", model.getHousePurpose()); reqBody.put("housePurpose", model.getHousePurpose());
reqBody.put("memo", model.getMemo()); reqBody.put("memo", model.getMemo());
reqBody.put("showOther", false); reqBody.put("showOther", false);
String result = request.postWithBody("http://192.168.0.100:32080/FangJiaAddressService/financialRating", reqBody, headers, "UTF-8"); String result = request.postWithBody("http://192.168.0.80:32080/FangJiaAddressService/financialRating", reqBody, headers, "UTF-8");
if (result != null) { if (result != null) {
try { try {
json = JSONObject.fromObject(result); json = JSONObject.fromObject(result);
@@ -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();
@@ -244,10 +244,10 @@ public class AuctionController {
params.put("city", city); params.put("city", city);
params.put("address", address); params.put("address", address);
try{ try{
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structure", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/structure", params, "UTF-8");
} catch(Exception e){ } catch(Exception e){
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/structure", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/structure", params, "UTF-8");
} catch(Exception ex){ } catch(Exception ex){
ex.printStackTrace(); ex.printStackTrace();
} }
@@ -544,10 +544,10 @@ public class CommercialController {
} }
try { try {
json = request.getJsonContent("http://192.168.0.100:30020"+ uri, params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:30020"+ uri, params, "UTF-8");
} catch (Exception e) { } catch (Exception e) {
try { try {
json = request.getJsonContent("http://192.168.0.100:30020"+ uri, params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:30020"+ uri, params, "UTF-8");
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
@@ -283,7 +283,7 @@ public class ComprehensiveQueryController {
// param.put("location", location); // param.put("location", location);
// param.put("area", String.valueOf(model.getSize())); // param.put("area", String.valueOf(model.getSize()));
// try { // try {
// jsonResult = httpRequest.getJsonContent("http://192.168.0.100:30020/avmWeb/avmAnn", param, "UTF-8"); // jsonResult = httpRequest.getJsonContent("http://192.168.0.80:30020/avmWeb/avmAnn", param, "UTF-8");
// if (jsonResult.containsKey("msg") && "成功".equals(jsonResult.getString("msg"))) { // if (jsonResult.containsKey("msg") && "成功".equals(jsonResult.getString("msg"))) {
// HashMap<String, Object> resultMap = new HashMap<String, Object>(); // HashMap<String, Object> resultMap = new HashMap<String, Object>();
// resultMap.put("avgPrice", jsonResult.getString("unitPrice")); // resultMap.put("avgPrice", jsonResult.getString("unitPrice"));
@@ -1316,7 +1316,7 @@ public class DistrictController {
params.put("address", address); params.put("address", address);
params.put("category", "property"); params.put("category", "property");
//新匹配接口 //新匹配接口
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaNlpService/match", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaNlpService/match", params, "UTF-8");
District property = null; District property = null;
if (json != null && json.size() > 0) { if (json != null && json.size() > 0) {
MatchedBuildingDto dto = CommonDtoUtils.transformV(MatchedBuildingDto.class, json); MatchedBuildingDto dto = CommonDtoUtils.transformV(MatchedBuildingDto.class, json);
@@ -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,11 +95,29 @@ 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.100: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) {
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/cebEnterpriseVillageIdentify", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/cebEnterpriseVillageIdentify", params, "UTF-8");
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
@@ -115,4 +140,8 @@ public class GdBankController {
return mav; return mav;
} }
public void setApiUserCfgService(ApiUserCfgService apiUserCfgService) {
this.apiUserCfgService = apiUserCfgService;
}
} }
@@ -0,0 +1,13 @@
package com.fangjia.open.controllers;
import com.fangjia.open.model.BasicModel;
import com.fangjia.open.model.RestfulModelAndView;
public class HealthController {
public Object checkAction() {
RestfulModelAndView mav = new RestfulModelAndView();
mav.setModel(BasicModel.buildOKModel().setResult("ok"));
return mav;
}
}
@@ -369,7 +369,7 @@ public class HouseController {
params.put("address", address); params.put("address", address);
params.put("category", "property"); params.put("category", "property");
//新匹配接口 //新匹配接口
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaNlpService/match", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaNlpService/match", params, "UTF-8");
if (json != null && json.size() > 0) { if (json != null && json.size() > 0) {
MatchedBuildingDto dto = CommonDtoUtils.transformV(MatchedBuildingDto.class, json); MatchedBuildingDto dto = CommonDtoUtils.transformV(MatchedBuildingDto.class, json);
District property = districtService.findByNameAndAlias(dto.getCity(), dto.getDistrict(), dto.getName(), cat); District property = districtService.findByNameAndAlias(dto.getCity(), dto.getDistrict(), dto.getName(), cat);
@@ -35,10 +35,10 @@ public class MeishubaoController {
params.put("city", model.getCity()); params.put("city", model.getCity());
params.put("address", model.getAddress()); params.put("address", model.getAddress());
try{ try{
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/meishubao/financialRating", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/meishubao/financialRating", params, "UTF-8");
} catch(Exception e){ } catch(Exception e){
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/meishubao/financialRating", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/meishubao/financialRating", params, "UTF-8");
} catch(Exception ex){ } catch(Exception ex){
ex.printStackTrace(); ex.printStackTrace();
} }
@@ -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;
@@ -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) {
@@ -251,10 +251,10 @@ public class PoiController {
params.put("page", page.toString()); params.put("page", page.toString());
} }
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/poi/search", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/poi/search", params, "UTF-8");
} catch (Exception e) { } catch (Exception e) {
try { try {
json = request.getJsonContent("http://192.168.0.100:32080/FangJiaAddressService/poi/search", params, "UTF-8"); json = request.getJsonContent("http://192.168.0.80:32080/FangJiaAddressService/poi/search", params, "UTF-8");
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
@@ -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");
@@ -1776,7 +1934,7 @@ public class PropertyController {
param.put("location", location); param.put("location", location);
param.put("area", String.valueOf(model.getSize())); param.put("area", String.valueOf(model.getSize()));
try { try {
json = httpRequest.getJsonContent("http://192.168.0.100:30020/avmWeb/avmAnn", param, "UTF-8"); json = httpRequest.getJsonContent("http://192.168.0.80:30020/avmWeb/avmAnn", param, "UTF-8");
if (json.containsKey("msg") && "成功".equals(json.getString("msg"))) { if (json.containsKey("msg") && "成功".equals(json.getString("msg"))) {
HashMap<String, Long> resultMap = new HashMap<String, Long>(); HashMap<String, Long> resultMap = new HashMap<String, Long>();
Long totalPrice = getRatioPrice(request, Long.valueOf(json.getString("totalPrice"))); Long totalPrice = getRatioPrice(request, Long.valueOf(json.getString("totalPrice")));
@@ -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);
@@ -6819,11 +7032,10 @@ public class PropertyController {
if(district != null){ if(district != null){
if(model.getMinPrice() == null){ if(model.getMinPrice() == null){
DistrictStatBo statBo = districtStatService.findCurrentDistrictStat(new DistrictKey(district.getCity(), district.getRegion(), district.getName())); DistrictStatBo statBo = districtStatService.findCurrentDistrictStat(new DistrictKey(district.getCity(), district.getRegion(), district.getName()));
if(statBo != null) { if(statBo != null && (("别墅".equals(district.getEstateType2()) && statBo.getVillaDistrictStat() !=null) || statBo.getDistrictStat() != null)) {
if("别墅".equals(district.getEstateType2())){
if(StringUtils.isNotBlank(district.getEstateType2()) && district.getEstateType2().equals("别墅")){
avgPrice = Double.valueOf(statBo.getVillaDistrictStat().getAvg_price_2b()); avgPrice = Double.valueOf(statBo.getVillaDistrictStat().getAvg_price_2b());
}else{ }else if(statBo.getDistrictStat() !=null){
avgPrice = Double.valueOf(statBo.getDistrictStat().getAvg_price_2b()); avgPrice = Double.valueOf(statBo.getDistrictStat().getAvg_price_2b());
} }
if(ratio != null){ if(ratio != null){
@@ -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) {
@@ -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;
}
} }
@@ -43,9 +43,9 @@ fangjia.fs.mongo.port=27017
fangjia.fs.mongodb.mongoUri=mongodb://${fangjia.fs.mongo.host}:${fangjia.fs.mongo.port}/ fangjia.fs.mongodb.mongoUri=mongodb://${fangjia.fs.mongo.host}:${fangjia.fs.mongo.port}/
fangjia.seabird.mongodb.mongoUri=mongodb://developer:G00IDCDEV12385@${fangjia.mongo.host}:${fangjia.mongo.port},${fangjia.secondary.mongo.host}:${fangjia.secondary.mongo.port}/ fangjia.seabird.mongodb.mongoUri=mongodb://developer:G00IDCDEV12385@${fangjia.mongo.host}:${fangjia.mongo.port},${fangjia.secondary.mongo.host}:${fangjia.secondary.mongo.port}/
fangjia.log.mongo.host=log.mongo.db.fangjia.com fangjia.log.mongo.host=seawater.mongo.db.fangjia.com
fangjia.log.mongo.port=52002 fangjia.log.mongo.port=27020
fangjia.log.mongodb.mongoUri=mongodb://${fangjia.log.mongo.host}:${fangjia.log.mongo.port}/ fangjia.log.mongodb.mongoUri=mongodb://root:Goojia%40206!!#@${fangjia.log.mongo.host}:${fangjia.log.mongo.port}
fangjia.base.mongo.host=mongo.db.fangjia.com fangjia.base.mongo.host=mongo.db.fangjia.com
+19
View File
@@ -0,0 +1,19 @@
FROM 192.168.0.19:9010/eclipse-temurin:8-jre
ENV TZ=Asia/Shanghai
# supercronic 本地 COPY,不依赖外网
COPY supercronic /usr/local/bin/supercronic
RUN chmod +x /usr/local/bin/supercronic
WORKDIR /home/goojia/webapps/fangjia-script
COPY target/classes/ .
COPY run.sh .
RUN chmod +x run.sh
RUN mkdir -p /home/goojia/logs
COPY crontab.txt /app/crontab
CMD ["supercronic", "/app/crontab"]
+204
View File
@@ -0,0 +1,204 @@
# 楼盘索引重建
0 6 1 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/gj/level/DistrictIndexBatch > /home/goojia/logs/DistrictIndexBatch.log 2>&1
# API超时分析
*/5 * * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/gj/apiLog/ApiTimeOutAnalyBatch > /home/goojia/logs/ApiTimeOutAnalyBatch.log 2>&1
# API用户访问量统计
1 10 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/gj/apiLog/ApiUserCountAnalyBatch > /home/goojia/logs/ApiUserCountAnalyBatch.log 2>&1
# 楼盘价格数据导出(福州)
#5 5 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/fuzhou/DistrictPriceExportBatch > /home/goojia/logs/DistrictPriceExportBatch.log 2>&1
# 搜索自动补全索引更新
1 1 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/index/AutocompleteDataUpdaterBatch > /home/goojia/logs/AutocompleteDataUpdaterBatch.log 2>&1
# 楼盘评级(招商银行)
#30 1 * * 1 cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/zsbank/DistrictLevelBatch > /home/goojia/logs/DistrictLevelBatch.log 2>&1
# 成交数据导出(福州)
#20 16 1 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/fuzhou/TradeExportBatch > /home/goojia/logs/TradeExportBatch.log 2>&1
# 第三方价格数据导出(福州)
#20 7 1 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/fuzhou/ThirdPriceExportBatch > /home/goojia/logs/ThirdPriceExportBatch.log 2>&1
# 房源数据导出(福州,每月10/15日)
#10 4 10 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/fuzhou/HouseExportBatch > /home/goojia/logs/HouseExportBatch.log 2>&1
#10 4 15 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/fuzhou/HouseExportBatch > /home/goojia/logs/HouseExportBatch.log 2>&1
# 楼盘基本信息导出(福州)
#30 3 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/fuzhou/DistrictInfoExportBatch > /home/goojia/logs/DistrictInfoExportBatch.log 2>&1
# 江南空白日更新楼盘刷新
*/10 * * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/jiangnanblank/DayUpdateDistRefreshBatch > /home/goojia/logs/DayUpdateDistRefreshBatch.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 -Dmodel=daily > /home/goojia/logs/DistrictSellStatBatch.log 2>&1
# 开放API使用量监控
15 * * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/api/OpenApiUseStatMonitorBatch > /home/goojia/logs/OpenApiUseStatMonitorBatch.log 2>&1
# 台物网数据批处理
#30 21 1 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/dealPrice/TaiWuWebBatch > /home/goojia/logs/TaiWuWebBatch.log 2>&1
# 均价监控告警
#0 9 * * 0 cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/xh/MonitorAvgPrice > /home/goojia/logs/MonitorAvgPrice.log 2>&1
# 插入住宅估价计算指令
10 23 * * 6 cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/averager/InsertMonitorCalcCommandBatch > /home/goojia/logs/InsertMonitorCalcCommandBatch.log 2>&1
# 插入商铺/写字楼租金估价计算指令
37 0 1 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/averager/InsertMonitorSquareRentCalcCommandBatch > /home/goojia/logs/InsertMonitorSquareRentCalcCommandBatch.log 2>&1
# ES房价统计
10 2 2 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/gj/EsHousePriceStat > /home/goojia/logs/EsHousePriceStat.log 2>&1
# 楼盘房源面积统计
0 2 1 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/district/DistrictHouseAreaStatBatch > /home/goojia/logs/DistrictHouseAreaStatBatch.log 2>&1
# 成交价格月度统计
0 1 1 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/dealPrice/DealPriceStatBatch > /home/goojia/logs/DealPriceStatBatch.log 2>&1
# 楼盘成交房源统计
30 0 * * 6 cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/dealPrice/DistrictTradeHouseStatBatch > /home/goojia/logs/DistrictTradeHouseStatBatch.log 2>&1
# API用户失活监控
0 9 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/api/ApiUserDeadTimeMonitorBatch > /home/goojia/logs/ApiUserDeadTimeMonitorBatch.log 2>&1
# 江南空白基础信息数据同步
0 2 * * 1 cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/jiangnanblank/JiangNanBlankBaseInfoDataBatch > /home/goojia/logs/JiangNanBlankBaseInfoDataBatch.log 2>&1
# 高德地图API数据处理
#0 2 1 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/yinjihaun/GaoDeMapApiDataProcess > /home/goojia/logs/GaoDeMapApiDataProcess.log 2>&1
# 开放API产品字段使用统计
0 10 * * 0 cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/yinjihaun/batch/ApiProductFieldStatBatch > /home/goojia/logs/ApiProductFieldStatBatch.log 2>&1
# 数据库状态监控
0 1 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/ana/DatabaseStatWatcherBatch > /home/goojia/logs/DatabaseStatWatcherBatch.log 2>&1
# Seaweed数据增量更新
1 19 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/district/SeaweedUpdateTask > /home/goojia/logs/SeaweedUpdateTask.log 2>&1
# 楼盘周边数据分析
23 20 * * 6 cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/ana/DistrictAroundDataAnaly > /home/goojia/logs/DistrictAroundDataAnaly.log 2>&1
# 样本质量周报
40 5 * * 1 cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/averager/SampleQualityReportBatch > /home/goojia/logs/SampleQualityReportBatch.log 2>&1
# 快照数据监控
05 10 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/temp/shenjian/SnapshotMonitor > /home/goojia/logs/SnapshotMonitor.log 2>&1
# 房价通评估结果自动转抵押基础信息
#0 1 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/hubingliang/FJTevaluationAutoToMortgageInfoBase > /home/goojia/logs/FJTevaluationAutoToMortgageInfoBase.log 2>&1
# 房价通钉钉统计播报
#0 8 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/hubingliang/business/FjtStatisticDDBatch > /home/goojia/logs/FjtStatisticDDBatch.log 2>&1
# 均价质量周报
10 5 * * 1 cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/averager/AveragerQualityReportBatch > /home/goojia/logs/AveragerQualityReportBatch.log 2>&1
# 清理Seawater过期数据
1 1 10 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/fangrui/DeleteSeawater > /home/goojia/logs/DeleteSeawater.log 2>&1
# 开放URI日志分析同步
13 4 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/sync/AnalysisOpenUriLogSyncBatch > /home/goojia/logs/AnalysisOpenUriLogSyncBatch.log 2>&1
# API访问日志处理
0 4 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/fangrui/ApiLog > /home/goojia/logs/ApiLog.log 2>&1
# 清理ES 8.6旧索引
0 1 28 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/temp/shenjian/batch/RemoveOldIndexOfEs86Batch > /home/goojia/logs/RemoveOldIndexOfEs86Batch.log 2>&1
# 楼盘最新价格同步(FSH)
#0 3 * * 6 cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/fsh/DistrictNewPriceSyncBatch > /home/goojia/logs/DistrictNewPriceSyncBatch.log 2>&1
# 下架房源清理
0 3 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/index/HouseRemoveBatch > /home/goojia/logs/HouseRemoveBatch.log 2>&1
# 楼盘在售房源月度统计
10 0 1 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/house/DistrictSellHouseStatBatch > /home/goojia/logs/DistrictSellHouseStatBatch.log 2>&1
# 城市和区域信息分析
10 1 * * 1 cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/dataAna/CityInfoAnaBatch > /home/goojia/logs/CityInfoAnaBatch.log 2>&1 && cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/dataAna/RegionInfoAnaBatch > /home/goojia/logs/RegionInfoAnaBatch.log 2>&1
# 楼盘成交/在售/租赁排名及均价城市排名
10 0 * * 1 cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/district/DistrictDealSellRentRankBatch > /home/goojia/logs/DistrictDealSellRentRankBatch.log 2>&1 && cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/ana/DistrictStatRankBatch > /home/goojia/logs/DistrictStatRankBatch.log 2>&1 && cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/ana/DistrictAvgPriceCityRankBatch > /home/goojia/logs/DistrictAvgPriceCityRankBatch.log 2>&1
# 房源覆盖率统计
0 22 3 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/statistic/HouseCoverageRateStatisticBatch > /home/goojia/logs/HouseCoverageRateStatisticBatch.log 2>&1
# CZ全量数据批处理(周日)
20 3 * * 0 cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/jiangnanblank/CZDataBatch all > /home/goojia/logs/CZDataBatch.log 2>&1
# CZ当日增量数据批处理
*/20 * * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/jiangnanblank/CZDataBatch > /home/goojia/logs/CZDataBatch_day.log 2>&1
# 写字楼均价统计
10 8 2 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/avgprice/WebOfficeAvgPriceStatistics > /home/goojia/logs/WebOfficeAvgPriceStatistics.log 2>&1
# 链家数据分析
#30 1 * * 2 cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/dataAna/LianjiaAnalyBatch > /home/goojia/logs/LianjiaAnalyBatch.log 2>&1
# 个性化评估与登记时间统计
0 1 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/hubingliang/IndividuateEvaAndRegisterTimeStatistical > /home/goojia/logs/IndividuateEvaAndRegisterTimeStatistical.log 2>&1
# 楼盘房源批量更新
0 18 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/district/DistrictHouseBatch > /home/goojia/logs/DistrictHouseBatch.log 2>&1
# Seawater数据监控
0 10 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/temp/shenjian/SeawaterMonitor > /home/goojia/logs/SeawaterMonitor.log 2>&1
# Marsoft数据导出
0 1 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/marsoftdata/MarsoftExporter out.dir=/home/goojia/marsoft > /home/goojia/logs/MarsoftExporter.log 2>&1
# Seaweed地理坐标系转换
22 1 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/district/SeaweedGeoSysConvertBatch > /home/goojia/logs/SeaweedGeoSysConvertBatch.log 2>&1
# 楼盘租赁FPK数据批处理
0 8 1 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/rent/DistrictRentFPKBatch > /home/goojia/logs/DistrictRentFPKBatch.log 2>&1
# 城市房源数量统计(FSH)
0 3 1 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/fsh/CityHouseCountStatBatch > /home/goojia/logs/CityHouseCountStatBatch.log 2>&1
# 贷款线索同步CRM
*/10 * * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/loanLeadToCRM/LoanLeadSync > /home/goojia/logs/LoanLeadSync.log 2>&1
# 用户UA分析
56 14 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/ana/UserAgentAnalysisBatch > /home/goojia/logs/UserAgentAnalysisBatch.log 2>&1
# 开放API日志分析
0 8 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/openApi/OpenApiLogAnalyBatch > /home/goojia/logs/OpenApiLogAnalyBatch.log 2>&1
# 楼盘出租房源统计
2 0 * * 0 cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/house/DistrictRentHouseStatBatch > /home/goojia/logs/DistrictRentHouseStatBatch.log 2>&1
# 查找在建楼盘
1 1 * * 5 cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/ana/FindStageDistrictBatch > /home/goojia/logs/FindStageDistrictBatch.log 2>&1
# 读取后台退场日志
0 5 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/log/ReadBackoffLogBatch > /home/goojia/logs/ReadBackoffLogBatch.log 2>&1
# 读取动态访问日志
15 2 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/log/ReadAnalyDynamicLog > /home/goojia/logs/ReadAnalyDynamicLog.log 2>&1
# 楼盘在售房源统计(周日补跑)
0 10 * * 0 cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/house/DistrictSellHouseStatBatch > /home/goojia/logs/DistrictSellHouseStatBatch.log 2>&1
# 中原成交价格爬虫
1 7 15 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/dealPrice/CentanetDealPriceCrawler > /home/goojia/logs/CentanetDealPriceCrawler.log 2>&1
# 更新楼盘行政区划编码
0 3 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/yinjihaun/batch/UpdateDistrictCodeBatch > /home/goojia/logs/UpdateDistrictCodeBatch.log 2>&1
# 房价通用户点击日志分析
0 3 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/fangjiatong/FjtUserClickLogAnalyBatch > /home/goojia/logs/FjtUserClickLogAnalyBatch.log 2>&1
# 第三方数据汇总
0 3 15 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/thirdPriceCrawl/ThirdDataToGatherBatch > /home/goojia/logs/ThirdDataToGatherBatch.log 2>&1
# 成交价格单位统一
1 7 * * 6 cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/dealPrice/parse/DealPriceUnitUniteBatch > /home/goojia/logs/DealPriceUnitUniteBatch.log 2>&1
# 导入索引统计数据
0 1 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/trade/ImportIndexStats > /home/goojia/logs/ImportIndexStats.log 2>&1
# Seaweed索引重建
25 1 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/index/SeaweedReIndexBatch > /home/goojia/logs/SeaweedReIndexBatch.log 2>&1
# 楼盘信息分析(FPK)
0 2 4 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/fpk/DistrictInfoAnaly > /home/goojia/logs/DistrictInfoAnaly.log 2>&1
# 每日房源统计
0 2 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/fsh/DayHouseStatBatch > /home/goojia/logs/DayHouseStatBatch.log 2>&1
# 楼盘关注日志计算
25 21 5 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/log/DistrictAttentionLogCaculateBatch > /home/goojia/logs/DistrictAttentionLogCaculateBatch.log 2>&1
# 自动发现新楼盘
#4 3 * * 6 cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/auto/DistrictAutoFindBatch > /home/goojia/logs/DistrictAutoFindBatch.log 2>&1
# 第三方价格数据标准化
0 2 13 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/thirdPriceCrawl/DataStandardBatch > /home/goojia/logs/DataStandardBatch.log 2>&1
# 生成爬虫抓取指令
0 1 * * 5 cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/crawl/CrawlCommandGeneratorBatch > /home/goojia/logs/CrawlCommandGeneratorBatch.log 2>&1
# 外部房地产网站数据同步
0 10 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/zongzhimin/WSFangDiChan > /home/goojia/logs/WSFangDiChan.log 2>&1
# 楼盘经纪人报告
30 21 12 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/report/DistrictAgentBatch > /home/goojia/logs/DistrictAgentBatch.log 2>&1
# 勤智月度消费评级统计
30 1 1 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/grade/ConsumptionRatingBatch > /home/goojia/logs/QinZhiMonthStatisticBatch.log 2>&1
# 城市价格指数
0 4 * * 1 cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/fsh/CityPriceIndexBatch > /home/goojia/logs/CityPriceIndexBatch.log 2>&1
# 住宅成交价格爬虫(中原)
43 14 * * 2 cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/dealPrice/ResDealPriceCrawlerBatch > /home/goojia/logs/ResDealPriceCrawlerBatch.log 2>&1
# 复制开放URI日志
30 3 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/sync/CopyOpenUriLog > /home/goojia/logs/CopyOpenUriLog.log 2>&1
# 楼盘价格对比
35 4 * * 1 cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/price/DistrictPriceCompareBatch > /home/goojia/logs/DistrictPriceCompareBatch.log 2>&1
# 成交价格覆盖率统计
0 23 3 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/statistic/DealPriceCoverageRateStatisticBatch > /home/goojia/logs/DealPriceCoverageRateStatisticBatch.log 2>&1
# 第三方价格页面分析
0 1 5 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/thirdPriceCrawl/AnalysisPageBatch > /home/goojia/logs/AnalysisPageBatch.log 2>&1
# 成交价格数据导入
25 23 14 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/dealPrice/TransactionPriceImportBatch > /home/goojia/logs/TransactionPriceImportBatch.log 2>&1
# 成交楼盘统计
10 22 1 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/trade/TradeDistrictStatBatch > /home/goojia/logs/TradeDistrictStatBatch.log 2>&1
# 同步楼盘价格至第三方
0 17 11 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/thirdPriceCrawl/SynchDistrictPrice > /home/goojia/logs/SynchDistrictPrice.log 2>&1
# 楼盘字段补录
0 1 21 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/gj/district/DistrictFieldAddBatch > /home/goojia/logs/DistrictFieldAddBatch.log 2>&1
# 法拍网大数据-社区基础数据
0 14 18 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/gj/fjwPriceBaseData/FjwBigdataCommunityBatch > /home/goojia/logs/FjwBigdataCommunityBatch.log 2>&1
# 法拍网大数据-楼栋类型数据
0 16 18 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/gj/fjwPriceBaseData/FjwBigdataCommbuildtypeBatch > /home/goojia/logs/FjwBigdataCommbuildtypeBatch.log 2>&1
# 法拍网大数据-在售数据
0 12 20 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/gj/fjwPriceBaseData/FjwBigdataForsaleBatch > /home/goojia/logs/FjwBigdataForsaleBatch.log 2>&1
# 法拍网-第三方参考价
3 5 19 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/gj/fjwPriceBaseData/FjwThirdPartyPriceBatch > /home/goojia/logs/FjwThirdPartyPriceBatch.log 2>&1
# 法拍网大数据-成交数据
3 22 20 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/gj/fjwPriceBaseData/FjwBigdataDealBatch > /home/goojia/logs/FjwBigdataDealBatch.log 2>&1
# 法拍网-规定价格
0 16 20 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/gj/fjwPriceBaseData/FjwGuiDingPriceBatch > /home/goojia/logs/FjwGuiDingPriceBatch.log 2>&1
# 第三方数据分析处理
0 3 20 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/gj/data_handle/ThardParthAnalyBatch > /home/goojia/logs/ThardParthAnalyBatch.log 2>&1
# 台湾相关楼盘数据关联
30 12 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/gj/xiamen/RelatedTaiWanBatch > /home/goojia/logs/RelatedTaiWanBatch.log 2>&1
# 成交价格同步到ES
30 23 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/dealPrice/SynchDealPriceToEs > /home/goojia/logs/SynchDealPriceToEs.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-30 * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/gj/xiamen/XiaMenVillageBatch > /home/goojia/logs/XiaMenVillageBatch.log 2>&1
# API调用次数统计
0 9 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/hubingliang/ApiInvokeStatistics > /home/goojia/logs/ApiInvokeStatistics.log 2>&1
# Seawater到Seabird数据同步
1 2 * * * cd /home/goojia/webapps/fangjia-script && ./run.sh com/fangjia/script/sync/Seawater2SeabirdSyncBatch > /home/goojia/logs/Seawater2SeabirdSyncBatch.log 2>&1
@@ -0,0 +1,8 @@
services:
fangjia-script:
image: 192.168.0.19:9011/fangjia-script:latest
restart: unless-stopped
volumes:
- /home/goojia/logs:/home/goojia/logs
environment:
- TZ=Asia/Shanghai
+45 -22
View File
@@ -22,6 +22,8 @@
<encoding>UTF-8</encoding> <encoding>UTF-8</encoding>
</configuration> </configuration>
</plugin> </plugin>
<!-- 保留:把依赖 jar 复制到 classes/lib -->
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId> <artifactId>maven-dependency-plugin</artifactId>
@@ -29,9 +31,7 @@
<execution> <execution>
<id>copy-dependencies</id> <id>copy-dependencies</id>
<phase>prepare-package</phase> <phase>prepare-package</phase>
<goals> <goals><goal>copy-dependencies</goal></goals>
<goal>copy-dependencies</goal>
</goals>
<configuration> <configuration>
<outputDirectory>${project.build.directory}/classes/lib</outputDirectory> <outputDirectory>${project.build.directory}/classes/lib</outputDirectory>
<overWriteReleases>false</overWriteReleases> <overWriteReleases>false</overWriteReleases>
@@ -41,8 +41,43 @@
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<!-- 新增:打 fat jar,classes + lib + groovy 全部打入 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.1</version>
<executions>
<execution>
<phase>package</phase>
<goals><goal>shade</goal></goals>
<configuration>
<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>
<filter>
<artifact>*:*</artifact>
<excludes>
<!-- 排除签名文件,避免 jar 校验失败 -->
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins> </plugins>
<resources> <resources>
<!-- 保留:Groovy 源文件和脚本打入 classes -->
<resource> <resource>
<filtering>false</filtering> <filtering>false</filtering>
<directory>${basedir}/src/main/groovy</directory> <directory>${basedir}/src/main/groovy</directory>
@@ -60,10 +95,10 @@
</includes> </includes>
</resource> </resource>
</resources> </resources>
<!-- 保留:m2e Eclipse 配置 -->
<pluginManagement> <pluginManagement>
<plugins> <plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin> <plugin>
<groupId>org.eclipse.m2e</groupId> <groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId> <artifactId>lifecycle-mapping</artifactId>
@@ -73,24 +108,12 @@
<pluginExecutions> <pluginExecutions>
<pluginExecution> <pluginExecution>
<pluginExecutionFilter> <pluginExecutionFilter>
<groupId> <groupId>org.apache.maven.plugins</groupId>
org.apache.maven.plugins <artifactId>maven-dependency-plugin</artifactId>
</groupId> <versionRange>[2.1,)</versionRange>
<artifactId> <goals><goal>copy-dependencies</goal></goals>
maven-dependency-plugin
</artifactId>
<versionRange>
[2.1,)
</versionRange>
<goals>
<goal>
copy-dependencies
</goal>
</goals>
</pluginExecutionFilter> </pluginExecutionFilter>
<action> <action><ignore></ignore></action>
<ignore></ignore>
</action>
</pluginExecution> </pluginExecution>
</pluginExecutions> </pluginExecutions>
</lifecycleMappingMetadata> </lifecycleMappingMetadata>
+13
View File
@@ -0,0 +1,13 @@
#!/bin/bash
CLASSPATH="./:./lib/*:fangjia-script.jar"
JVM_OPTS=()
GROOVY_ARGS=()
for arg in "$@"; do
case "$arg" in
-D*) JVM_OPTS+=("$arg") ;;
*) GROOVY_ARGS+=("$arg") ;;
esac
done
exec java "${JVM_OPTS[@]}" -cp "$CLASSPATH" groovy.ui.GroovyMain "${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>();
@@ -33,7 +33,7 @@ class InvokeHttpRequest {
// "192.168.0.90", // "192.168.0.90",
// "192.168.0.93", // "192.168.0.93",
// "192.168.0.94", // "192.168.0.94",
// "192.168.0.100" // "192.168.0.80"
] ]
private final static DBCollection HTTP_DB_CONN = MongoUtils.getCollectionByName("artemis", "http_adsl", MongoUtils.MongoDB_Domain_artemis, 27017); private final static DBCollection HTTP_DB_CONN = MongoUtils.getCollectionByName("artemis", "http_adsl", MongoUtils.MongoDB_Domain_artemis, 27017);
@@ -4,7 +4,6 @@ import com.fangjia.core.Constants
import com.fangjia.core.util.DateUtil import com.fangjia.core.util.DateUtil
import com.fangjia.core.util.DingDingMessageUtil import com.fangjia.core.util.DingDingMessageUtil
import com.fangjia.core.util.MongoUtils import com.fangjia.core.util.MongoUtils
import com.fangjia.datastore.driver.DSCursor
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
@@ -14,7 +13,7 @@ import com.fangjia.script.util.ServerAreaMap
import com.google.common.collect.MapDifference import com.google.common.collect.MapDifference
import com.google.common.collect.Maps import com.google.common.collect.Maps
import com.mongodb.* import com.mongodb.*
import org.bson.types.ObjectId
/** /**
* 通知计算二手房均价 * 通知计算二手房均价
* @author duxiaoyu * @author duxiaoyu
@@ -25,7 +24,7 @@ class InsertMonitorCalcCommandBatch extends BaseBatch {
public static final DBCollection SEAWEED_COLL = MongoUtils.getDbCollection(Constants.FANGJIA_MONGO_URI, 'fangjia', 'seaweed') public static final DBCollection SEAWEED_COLL = MongoUtils.getDbCollection(Constants.FANGJIA_MONGO_URI, 'fangjia', 'seaweed')
public final static DBCollection COMMAND_COLL = MongoUtils.getDbCollection(Constants.LOG_MONGO_URI, 'fangjia_log', 'calc_command') public final static DBCollection COMMAND_COLL = MongoUtils.getDbCollection(Constants.SEAWATER_MONGO_URI, 'fangjia_log', 'calc_command')
public final static DBCollection REGION_STAT_COLL = MongoUtils.getDbCollection(Constants.FANGJIA_MONGO_URI, 'fangjia', 'region_stat') public final static DBCollection REGION_STAT_COLL = MongoUtils.getDbCollection(Constants.FANGJIA_MONGO_URI, 'fangjia', 'region_stat')
public final static DBCollection DISTRICT_STAT_COLL = MongoUtils.getDbCollection(Constants.FANGJIA_MONGO_URI, 'fangjia_stat', 'district_stat') public final static DBCollection DISTRICT_STAT_COLL = MongoUtils.getDbCollection(Constants.FANGJIA_MONGO_URI, 'fangjia_stat', 'district_stat')
public final static DBCollection REGION_COLL = MongoUtils.getDbCollection(Constants.FANGJIA_MONGO_URI, 'fangjia', 'region_block') public final static DBCollection REGION_COLL = MongoUtils.getDbCollection(Constants.FANGJIA_MONGO_URI, 'fangjia', 'region_block')
@@ -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")
@@ -427,7 +427,7 @@ class CcbCommonUtils {
rows << map rows << map
}); });
}catch(Exception e){ }catch(Exception e){
sqlInstance = Sql.newInstance("jdbc:oracle:thin:@192.168.0.100:31521:orcl", sqlInstance = Sql.newInstance("jdbc:oracle:thin:@192.168.0.80:31521:orcl",
"GOOJIA", "GOOJIA", "oracle.jdbc.driver.OracleDriver") "GOOJIA", "GOOJIA", "oracle.jdbc.driver.OracleDriver")
findAllDistrictsByOracle(cityid) findAllDistrictsByOracle(cityid)
println "错误:"+e.getMessage() println "错误:"+e.getMessage()
@@ -29,7 +29,7 @@ import java.util.concurrent.atomic.AtomicLong
import java.util.regex.*; import java.util.regex.*;
//def sqlInstance = Sql.newInstance("jdbc:oracle:thin:@192.168.0.100:31521:orcl", //def sqlInstance = Sql.newInstance("jdbc:oracle:thin:@192.168.0.80:31521:orcl",
// "GOOJIA", "GOOJIA", "oracle.jdbc.driver.OracleDriver") // "GOOJIA", "GOOJIA", "oracle.jdbc.driver.OracleDriver")
def sqlInstance236 = Sql.newInstance("jdbc:oracle:thin:@192.168.0.236:1521:orcl", def sqlInstance236 = Sql.newInstance("jdbc:oracle:thin:@192.168.0.236:1521:orcl",
@@ -15,10 +15,10 @@ class TestRepeat {
ExecutorService fixedThreadPool = Executors.newFixedThreadPool(80) ExecutorService fixedThreadPool = Executors.newFixedThreadPool(80)
// def sqlInstance = Sql.newInstance("jdbc:oracle:thin:@192.168.0.100:31521:orcl", // def sqlInstance = Sql.newInstance("jdbc:oracle:thin:@192.168.0.80:31521:orcl",
// "GOOJIA", "GOOJIA", "oracle.jdbc.driver.OracleDriver") // "GOOJIA", "GOOJIA", "oracle.jdbc.driver.OracleDriver")
private DSCollection seabird = new DataStore("192.168.0.100", 37017).getCollection("fangjia.seabird") private DSCollection seabird = new DataStore("192.168.0.80", 37017).getCollection("fangjia.seabird")
static main(args) { static main(args) {
def task = new TestRepeat() def task = new TestRepeat()
@@ -27,7 +27,7 @@ def sqlInstance = Sql.newInstance("jdbc:oracle:thin:@192.168.0.236:1521:orcl",
"GOOJIA", "GOOJIA", "oracle.jdbc.driver.OracleDriver") "GOOJIA", "GOOJIA", "oracle.jdbc.driver.OracleDriver")
def ZS_MONGODB_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; def ZS_MONGODB_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009";
DBCollection COMMUNITY_CONN = MongoUtils.getCollectionByName2("fangjia", "community", ZS_MONGODB_URL) DBCollection COMMUNITY_CONN = MongoUtils.getCollectionByName2("fangjia", "community", ZS_MONGODB_URL)
@@ -25,7 +25,7 @@ class MatchMapData {
def thirdPartyColl = com.fangjia.script.thirdPriceCrawl.CrawalDBUtil.getThirdPartyCol(); def thirdPartyColl = com.fangjia.script.thirdPriceCrawl.CrawalDBUtil.getThirdPartyCol();
public static final def ZS_MONGODB_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; public static final def ZS_MONGODB_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009";
public static final DBCollection ZS_LEVEL_CONN = MongoUtils.getCollectionByName2("fangjia", "district_analy", ZS_MONGODB_URL) public static final DBCollection ZS_LEVEL_CONN = MongoUtils.getCollectionByName2("fangjia", "district_analy", ZS_MONGODB_URL)
static main(args) { static main(args) {
@@ -86,7 +86,7 @@ class CommonDatautils {
public static final DBCollection TOWN_POLYLINECOLL = MongoUtils.getCollectionByAuth20190102("fangjia_crawl", "town_polyline") public static final DBCollection TOWN_POLYLINECOLL = MongoUtils.getCollectionByAuth20190102("fangjia_crawl", "town_polyline")
public static final def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; public static final def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009";
public static final DBCollection SEAWEED_CONN = MongoUtils.getCollectionByName2("fangjia", "seaweed", MONGO100_URL) public static final DBCollection SEAWEED_CONN = MongoUtils.getCollectionByName2("fangjia", "seaweed", MONGO100_URL)
public static final DBCollection administrative_division_100_CONN = MongoUtils.getCollectionByName2("fangjia", "administrative_division", MONGO100_URL) public static final DBCollection administrative_division_100_CONN = MongoUtils.getCollectionByName2("fangjia", "administrative_division", MONGO100_URL)
@@ -101,7 +101,7 @@ class CommonDatautils {
FITMENTS_TYPES_MAPS.put("豪装", ["豪华装修", "高档", "豪华", "豪装", "高级装修", "高装", "奢侈"]) FITMENTS_TYPES_MAPS.put("豪装", ["豪华装修", "高档", "豪华", "豪装", "高级装修", "高装", "奢侈"])
} }
public static final DBCollection COMMUNITY_CONN = MongoUtils.getCollectionByName2("fangjia", "community", "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009") public static final DBCollection COMMUNITY_CONN = MongoUtils.getCollectionByName2("fangjia", "community", "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009")
public static final DBCollection ADMINISTRATIVE_MAPPING_COLL = MongoUtils.getCollectionByName("business", "administrative_mapping", "mongo.db.fangjia.com", 28017) public static final DBCollection ADMINISTRATIVE_MAPPING_COLL = MongoUtils.getCollectionByName("business", "administrative_mapping", "mongo.db.fangjia.com", 28017)
public static final DBCollection OPERATION_LOG_COLL = MongoUtils.getCollectionByName("fangjia", "operation_log", "mongo.db.fangjia.com") public static final DBCollection OPERATION_LOG_COLL = MongoUtils.getCollectionByName("fangjia", "operation_log", "mongo.db.fangjia.com")
@@ -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){
@@ -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个小区抽样价格核验202602.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, 202511, 202601) 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.100: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}"
@@ -812,7 +812,7 @@ class OpenApiUtils {
static def addrVerifyShBank(city, address){ static def addrVerifyShBank(city, address){
address = URLEncoder.encode(address, "utf-8"); address = URLEncoder.encode(address, "utf-8");
def url = "http://192.168.0.100:32080/FangJiaAddressService/boscEnterpriseVillageIdentify?address=${address}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB" def url = "http://192.168.0.80:32080/FangJiaAddressService/boscEnterpriseVillageIdentify?address=${address}&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}"
@@ -830,7 +830,7 @@ class OpenApiUtils {
static def addrVerifyGuangda(city, address){ static def addrVerifyGuangda(city, address){
address = URLEncoder.encode(address, "utf-8"); address = URLEncoder.encode(address, "utf-8");
def url = "http://192.168.0.100:32080/FangJiaAddressService/cebEnterpriseVillageIdentify?address=${address}" def url = "http://192.168.0.80:32080/FangJiaAddressService/cebEnterpriseVillageIdentify?address=${address}"
// def url = "http://localhost:8080/FangJiaAddressService/cebEnterpriseVillageIdentify?address=${address}" // def url = "http://localhost:8080/FangJiaAddressService/cebEnterpriseVillageIdentify?address=${address}"
if(city){ if(city){
url = url + "&city=${city}" url = url + "&city=${city}"
@@ -851,7 +851,7 @@ class OpenApiUtils {
static def addrVerifyBase(city, address){ static def addrVerifyBase(city, address){
address = URLEncoder.encode(address, "utf-8"); address = URLEncoder.encode(address, "utf-8");
def url = "http://192.168.0.100:32080/FangJiaAddressService/enterpriseVillageIdentify?address=${address}" def url = "http://192.168.0.80:32080/FangJiaAddressService/enterpriseVillageIdentify?address=${address}"
// 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}"
@@ -930,7 +930,7 @@ class OpenApiUtils {
static def lactionEvaluation(area, lng, lat){ static def lactionEvaluation(area, lng, lat){
def url = "http://192.168.0.100:30020/avmWeb/avmAnn?area=${area}&location=lng"+","+lat def url = "http://192.168.0.80:30020/avmWeb/avmAnn?area=${area}&location=lng"+","+lat
String content = new HttpRequest().get(url, "utf-8"); String content = new HttpRequest().get(url, "utf-8");
if(content){ if(content){
def doc = new JsonSlurper().parseText(content) def doc = new JsonSlurper().parseText(content)
@@ -27,7 +27,7 @@ import java.util.concurrent.atomic.AtomicLong
// } // }
//}) //})
def URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; def URL = "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009";
DBCollection seaweed_coll = MongoUtils.getCollectionByName2("fangjia", "seaweed", URL) DBCollection seaweed_coll = MongoUtils.getCollectionByName2("fangjia", "seaweed", URL)
def q = new BasicDBObject() def q = new BasicDBObject()
q.put("city", "上海市") q.put("city", "上海市")
@@ -30,7 +30,7 @@ class AnjukeDetailCrawl {
def url = "https://chongqing.anjuke.com/" def url = "https://chongqing.anjuke.com/"
WebDriver driver = new ChromeDriver() WebDriver driver = new ChromeDriver()
// DesiredCapabilities capabilities = DesiredCapabilities.chrome(); // DesiredCapabilities capabilities = DesiredCapabilities.chrome();
// URL urlInstance = new URL("http://192.168.0.100:30025"); //指定URL // URL urlInstance = new URL("http://192.168.0.80:30025"); //指定URL
// WebDriver driver = new RemoteWebDriver(urlInstance, capabilities); // WebDriver driver = new RemoteWebDriver(urlInstance, capabilities);
driver.manage().deleteAllCookies() driver.manage().deleteAllCookies()
@@ -24,7 +24,7 @@ class AddDevShapeData {
DBCollection DEVELOPMENT_ZONE_43_COLL = MongoUtils.getCollectionByName("fangjia_base", "development_zone", "mongo.db.fangjia.com") DBCollection DEVELOPMENT_ZONE_43_COLL = MongoUtils.getCollectionByName("fangjia_base", "development_zone", "mongo.db.fangjia.com")
public static final def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; public static final def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009";
DBCollection dev_mapping_CONN = MongoUtils.getCollectionByName2("fangjia", "dev_mapping", MONGO100_URL) DBCollection dev_mapping_CONN = MongoUtils.getCollectionByName2("fangjia", "dev_mapping", MONGO100_URL)
public static final DBCollection administrative_mapping_coll = MongoUtils.getCollectionByName("business", "administrative_mapping", "mongo.db.fangjia.com") public static final DBCollection administrative_mapping_coll = MongoUtils.getCollectionByName("business", "administrative_mapping", "mongo.db.fangjia.com")
@@ -32,7 +32,7 @@ class AddDistrictAddress extends BaseBatch{
// //
// public static final DBCollection administrative_mapping_coll = MongoUtils.getCollectionByName("business", "administrative_mapping", "mongo.db.fangjia.com") // public static final DBCollection administrative_mapping_coll = MongoUtils.getCollectionByName("business", "administrative_mapping", "mongo.db.fangjia.com")
// //
// def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; // def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009";
// DBCollection seaweed_fence100_CONN = MongoUtils.getCollectionByName2("fangjia", "seaweed_fence", MONGO100_URL) // DBCollection seaweed_fence100_CONN = MongoUtils.getCollectionByName2("fangjia", "seaweed_fence", MONGO100_URL)
// //
// public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(10) // public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(10)
@@ -33,7 +33,7 @@ class AddDistrictShapeBatch extends BaseBatch{
public static final DBCollection administrative_mapping_coll = MongoUtils.getCollectionByName("business", "administrative_mapping", "mongo.db.fangjia.com") public static final DBCollection administrative_mapping_coll = MongoUtils.getCollectionByName("business", "administrative_mapping", "mongo.db.fangjia.com")
def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009";
DBCollection seaweed_fence100_CONN = MongoUtils.getCollectionByName2("fangjia", "seaweed_fence", MONGO100_URL) DBCollection seaweed_fence100_CONN = MongoUtils.getCollectionByName2("fangjia", "seaweed_fence", MONGO100_URL)
public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(10) public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(10)
@@ -6,7 +6,7 @@ import com.mongodb.DBCollection
class CommunityShapeProcess { class CommunityShapeProcess {
def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009";
DBCollection community_CONN = MongoUtils.getCollectionByName2("fangjia", "community", MONGO100_URL) DBCollection community_CONN = MongoUtils.getCollectionByName2("fangjia", "community", MONGO100_URL)
static main(args) { static main(args) {
@@ -20,7 +20,7 @@ import java.util.regex.Pattern
class DevProcess { class DevProcess {
def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009";
DBCollection development_zone_CONN = MongoUtils.getCollectionByName2("fangjia", "development_zone", MONGO100_URL) DBCollection development_zone_CONN = MongoUtils.getCollectionByName2("fangjia", "development_zone", MONGO100_URL)
@@ -17,7 +17,7 @@ import org.elasticsearch.common.xcontent.XContentType
class DevUpdateTestBatch { class DevUpdateTestBatch {
def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009";
DBCollection development_zone_43_CONN = MongoUtils.getCollectionByName("fangjia_base", "development_zone", "mongo.db.fangjia.com") DBCollection development_zone_43_CONN = MongoUtils.getCollectionByName("fangjia_base", "development_zone", "mongo.db.fangjia.com")
@@ -13,7 +13,7 @@ import java.util.regex.Pattern
class MinglujiData { class MinglujiData {
DBCollection mlj_COLL = MongoUtils.getCollectionByName("crawl", "kfq_mingluji_com", "192.168.0.206",27020) DBCollection mlj_COLL = MongoUtils.getCollectionByName("crawl", "kfq_mingluji_com", "192.168.0.206",27020)
def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009";
DBCollection development_zone_CONN = MongoUtils.getCollectionByName("fangjia_base", "development_zone", "mongo.db.fangjia.com") DBCollection development_zone_CONN = MongoUtils.getCollectionByName("fangjia_base", "development_zone", "mongo.db.fangjia.com")
@@ -25,7 +25,7 @@ import java.util.regex.Pattern
class PoiLocation { class PoiLocation {
def MAP_POI_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; def MAP_POI_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009";
DBCollection MAPPOI_CONN = MongoUtils.getCollectionByName2("fangjia", "map_poi", MAP_POI_URL) DBCollection MAPPOI_CONN = MongoUtils.getCollectionByName2("fangjia", "map_poi", MAP_POI_URL)
public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(10) public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(10)
@@ -14,7 +14,7 @@ import org.elasticsearch.index.query.QueryBuilders
import java.util.concurrent.CopyOnWriteArrayList import java.util.concurrent.CopyOnWriteArrayList
class SynchAdministrativeMappingDataBatch extends BaseBatch{ class SynchAdministrativeMappingDataBatch extends BaseBatch{
def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009";
DBCollection ADMINISTRATIVE_MAPPING_COLL_100 = MongoUtils.getCollectionByName2("fangjia", "administrative_mapping", MONGO100_URL) DBCollection ADMINISTRATIVE_MAPPING_COLL_100 = MongoUtils.getCollectionByName2("fangjia", "administrative_mapping", MONGO100_URL)
DBCollection ADMINISTRATIVE_MAPPING_COLL = MongoUtils.getCollectionByName("business", "administrative_mapping", "mongo.db.fangjia.com") DBCollection ADMINISTRATIVE_MAPPING_COLL = MongoUtils.getCollectionByName("business", "administrative_mapping", "mongo.db.fangjia.com")
@@ -17,7 +17,7 @@ import java.util.concurrent.CopyOnWriteArrayList
*/ */
class SynchDevDataBatch extends BaseBatch{ class SynchDevDataBatch extends BaseBatch{
def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009";
DBCollection development_zone_CONN = MongoUtils.getCollectionByName2("fangjia", "development_zone", MONGO100_URL) DBCollection development_zone_CONN = MongoUtils.getCollectionByName2("fangjia", "development_zone", MONGO100_URL)
DBCollection DEVELOPMENT_ZONE_43_COLL = MongoUtils.getCollectionByName("fangjia_base", "development_zone", "mongo.db.fangjia.com") DBCollection DEVELOPMENT_ZONE_43_COLL = MongoUtils.getCollectionByName("fangjia_base", "development_zone", "mongo.db.fangjia.com")
@@ -26,7 +26,7 @@ import java.util.regex.Pattern
class TownMiddleProcess { class TownMiddleProcess {
def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009";
DBCollection COMMUNITY_CONN = MongoUtils.getCollectionByName2("fangjia", "community", MONGO100_URL) DBCollection COMMUNITY_CONN = MongoUtils.getCollectionByName2("fangjia", "community", MONGO100_URL)
DBCollection ADMINISTRATIVE_DIVISION_CONN = MongoUtils.getCollectionByName2("fangjia", "administrative_division_2023", MONGO100_URL) DBCollection ADMINISTRATIVE_DIVISION_CONN = MongoUtils.getCollectionByName2("fangjia", "administrative_division_2023", MONGO100_URL)
DBCollection ADMINISTRATIVE_MAPPING_COLL_100 = MongoUtils.getCollectionByName2("fangjia", "administrative_mapping_0526", MONGO100_URL) DBCollection ADMINISTRATIVE_MAPPING_COLL_100 = MongoUtils.getCollectionByName2("fangjia", "administrative_mapping_0526", MONGO100_URL)
@@ -10,7 +10,7 @@ import java.util.regex.Pattern
class TownshipPrcoess { class TownshipPrcoess {
def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009";
DBCollection community_CONN = MongoUtils.getCollectionByName2("fangjia", "community", MONGO100_URL) DBCollection community_CONN = MongoUtils.getCollectionByName2("fangjia", "community", MONGO100_URL)
static main(args) { static main(args) {
@@ -35,7 +35,7 @@ class TownshipStrandUpdate {
def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009";
DBCollection dev_MAPPING_COLL_100 = MongoUtils.getCollectionByName2("fangjia", "dev_mapping", MONGO100_URL) DBCollection dev_MAPPING_COLL_100 = MongoUtils.getCollectionByName2("fangjia", "dev_mapping", MONGO100_URL)
static main(args) { static main(args) {
@@ -43,7 +43,7 @@ class FangjiaClientUtils {
} }
public static def sendDistrictPriceCalculate(def city, def region, def name, def count){ public static def sendDistrictPriceCalculate(def city, def region, def name, def count){
// def url = "http://192.168.0.100:38080/FangJiaDataService/districtPriceCalculate?category=sell&city="+city+"&count="+count+"&name="+name+"&region="+region+"&retainHistory=true" // def url = "http://192.168.0.80:38080/FangJiaDataService/districtPriceCalculate?category=sell&city="+city+"&count="+count+"&name="+name+"&region="+region+"&retainHistory=true"
def url = "http://192.168.10.216:8080/FangJiaDataService/districtPriceCalculate?category=sell&city="+city+"&count="+count+"&name="+name+"&region="+region+"&retainHistory=true" def url = "http://192.168.10.216:8080/FangJiaDataService/districtPriceCalculate?category=sell&city="+city+"&count="+count+"&name="+name+"&region="+region+"&retainHistory=true"
def content = null; def content = null;
try{ try{
@@ -99,7 +99,7 @@ class FangjiaClientUtils {
try { try {
if(address){ if(address){
address = address.replace("{","") address = address.replace("{","")
def url = "http://192.168.0.100:32080/FangJiaAddressService/structure/v2?address="+URLEncoder.encode(address,"UTF-8") def url = "http://192.168.0.80:32080/FangJiaAddressService/structure/v2?address="+URLEncoder.encode(address,"UTF-8")
if(city){ if(city){
url = url +"&city="+URLEncoder.encode(city,"UTF-8") url = url +"&city="+URLEncoder.encode(city,"UTF-8")
} }
@@ -160,7 +160,7 @@ class FangjiaClientUtils {
try { try {
address = address.replace("{","") address = address.replace("{","")
// def url = "http://192.168.0.19:39080/FangJiaNlpService/ner?address="+URLEncoder.encode(address,"UTF-8") // def url = "http://192.168.0.19:39080/FangJiaNlpService/ner?address="+URLEncoder.encode(address,"UTF-8")
def url = "http://192.168.0.100:38080/FangJiaDataService/evaluate?address="+URLEncoder.encode(address,"UTF-8")+"&city="+URLEncoder.encode(city,"UTF-8")+"&maxNum=10&radius=1000&size=100" def url = "http://192.168.0.80:38080/FangJiaDataService/evaluate?address="+URLEncoder.encode(address,"UTF-8")+"&city="+URLEncoder.encode(city,"UTF-8")+"&maxNum=10&radius=1000&size=100"
// def url = "http://192.168.0.19:39080/FangJiaAddressService/structure?address="+URLEncoder.encode(address,"UTF-8") // def url = "http://192.168.0.19:39080/FangJiaAddressService/structure?address="+URLEncoder.encode(address,"UTF-8")
content = new HttpRequest().newGet(url, null, "utf-8") content = new HttpRequest().newGet(url, null, "utf-8")
jsonObj = JSONObject.fromObject(content) jsonObj = JSONObject.fromObject(content)
@@ -173,13 +173,13 @@ class FangjiaClientUtils {
public static def saveToEsDistrict(def data){ public static def saveToEsDistrict(def data){
String jsonStr = com.alibaba.fastjson.JSONObject.toJSONString(data) String jsonStr = com.alibaba.fastjson.JSONObject.toJSONString(data)
HttpUtils.postForJson("http://192.168.0.100:38080/FangJiaDataService/community", jsonStr) HttpUtils.postForJson("http://192.168.0.80:38080/FangJiaDataService/community", jsonStr)
} }
public static def saveToEsPaimai(def data){ public static def saveToEsPaimai(def data){
String jsonStr = com.alibaba.fastjson.JSONObject.toJSONString(data) String jsonStr = com.alibaba.fastjson.JSONObject.toJSONString(data)
HttpUtils.postForJson("http://192.168.0.100:38080/FangJiaDataService/paiMai", jsonStr) HttpUtils.postForJson("http://192.168.0.80:38080/FangJiaDataService/paiMai", jsonStr)
// HttpUtils.postForJson("http://localhost:8084/FangJiaDataService/paiMai", jsonStr) // HttpUtils.postForJson("http://localhost:8084/FangJiaDataService/paiMai", jsonStr)
} }
@@ -201,10 +201,10 @@ class FangjiaClientUtils {
public static def saveOrUpdateDistrict(data) { public static def saveOrUpdateDistrict(data) {
String jsonStr = com.alibaba.fastjson.JSONObject.toJSONString(data) String jsonStr = com.alibaba.fastjson.JSONObject.toJSONString(data)
// def json = HttpUtils.postForJson("http://192.168.0.100:38080/FangJiaDataService/saveData", jsonStr) // def json = HttpUtils.postForJson("http://192.168.0.80:38080/FangJiaDataService/saveData", jsonStr)
// def json = HttpUtils.postForJson("http://localhost:8080/FangJiaDataService/saveData", jsonStr) // def json = HttpUtils.postForJson("http://localhost:8080/FangJiaDataService/saveData", jsonStr)
com.alibaba.fastjson.JSONObject json = HttpUtils.doPost2("http://192.168.0.100:38080/FangJiaDataService/saveData", jsonStr) com.alibaba.fastjson.JSONObject json = HttpUtils.doPost2("http://192.168.0.80:38080/FangJiaDataService/saveData", jsonStr)
if (json.status == 0) { if (json.status == 0) {
return "成功" return "成功"
}else if(json.status == 1){ }else if(json.status == 1){
@@ -247,7 +247,7 @@ class FangjiaClientUtils {
def url = null; def url = null;
try { try {
// address = address.replace("{","").replace("\\","") // address = address.replace("{","").replace("\\","")
url = "http://192.168.0.100:32080/FangJiaNlpService/match?address="+URLEncoder.encode(address,"UTF-8")+"&useMap=${useMap}" url = "http://192.168.0.80:32080/FangJiaNlpService/match?address="+URLEncoder.encode(address,"UTF-8")+"&useMap=${useMap}"
// url = "http://192.168.20.242:5001/match?address="+URLEncoder.encode(address,"UTF-8")+"&useMap=${useMap}" // url = "http://192.168.20.242:5001/match?address="+URLEncoder.encode(address,"UTF-8")+"&useMap=${useMap}"
// url = "http://192.168.0.19:31080/FangJiaNlpService/match?address="+URLEncoder.encode(address,"UTF-8")+"&useMap=${useMap}" // url = "http://192.168.0.19:31080/FangJiaNlpService/match?address="+URLEncoder.encode(address,"UTF-8")+"&useMap=${useMap}"
if(city){ if(city){
@@ -297,7 +297,7 @@ class FangjiaClientUtils {
def content = null def content = null
try { try {
address = address.replace("{","").replace("\\","") address = address.replace("{","").replace("\\","")
def url = "http://192.168.0.100:32080/FangJiaAddressService/v2/structure?address="+URLEncoder.encode(address,"UTF-8") def url = "http://192.168.0.80:32080/FangJiaAddressService/v2/structure?address="+URLEncoder.encode(address,"UTF-8")
if(city){ if(city){
url = url + "&city="+URLEncoder.encode(city,"UTF-8") url = url + "&city="+URLEncoder.encode(city,"UTF-8")
@@ -355,7 +355,7 @@ class FangjiaClientUtils {
address = address.toString().replace("{","") address = address.toString().replace("{","")
int retryCount = 0 int retryCount = 0
while (retryCount < 3) { while (retryCount < 3) {
url = "http://192.168.0.100:32080/FangJiaNlpService/formatNinelevel?address="+URLEncoder.encode(address,"UTF-8")+"&complete=false&useMap=false&addressAssessment=true&fields=dev_confi" url = "http://192.168.0.80:32080/FangJiaNlpService/formatNinelevel?address="+URLEncoder.encode(address,"UTF-8")+"&complete=false&useMap=false&addressAssessment=true&fields=dev_confi"
if(city){ if(city){
url = url +"&city="+URLEncoder.encode(city,"UTF-8") url = url +"&city="+URLEncoder.encode(city,"UTF-8")
} }
@@ -402,7 +402,7 @@ class FangjiaClientUtils {
def content = null def content = null
try { try {
def url = "http://192.168.0.100:30020/avmWeb/shopSell?location="+location+"&area="+area+"&estateType="+estateType def url = "http://192.168.0.80:30020/avmWeb/shopSell?location="+location+"&area="+area+"&estateType="+estateType
content = new HttpRequest().newGet(url, null, "utf-8") content = new HttpRequest().newGet(url, null, "utf-8")
jsonObj = JSONObject.fromObject(content) jsonObj = JSONObject.fromObject(content)
println jsonObj println jsonObj
@@ -9,8 +9,10 @@ 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.mongodb.BasicDBObject import com.mongodb.BasicDBObject
import com.mongodb.DBCollection import com.mongodb.DBCollection
@@ -25,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);
} }
@@ -35,55 +38,88 @@ class HongXingMonthBatch extends BaseBatch{
// createTestFile(); // createTestFile();
// mergeFile() // mergeFile()
// mergeMatchId() // mergeMatchId()
// def stat = [:] def fileName = "C:\\Users\\wenyan\\Desktop\\宏信交付数据\\宏信楼盘9月监测20260920交付.xlsx"
// ExcelUtils.read("C:\\Users\\wenyan\\Desktop\\宏信2月价格监测核实(价格有偏差核查).xlsx").each{List item-> def removeAddrFile = "C:\\Users\\wenyan\\Desktop\\宏信交付数据\\20260920宏信.xlsx"
// if(item["U"]){ def addAddrData = ExcelUtils.read(removeAddrFile, 2, 1)
// stat.put(item["C"], item["U"]) def removeAddrs = []
// } ExcelUtils.read(removeAddrFile, 1).each {List item->
// } removeAddrs << item["C"]
// ExcelUtils.modify("C:\\Users\\wenyan\\Desktop\\宏信楼盘3月监测20260320交付跑数.xlsx",{List item-> }
// if(stat.containsKey(item["C"])){ ExcelUtils.modify(fileName,{List item->
// item["O"] = stat[item["C"]].toString().toDouble().toInteger() if(item["E"] == null && removeAddrs.contains(item["C"])){
// } item["E"] = "已处置"
// }) println("新增已处置房产:{item['C']}")
// def lastMonthStr = DateUtils.formatDateByPattern(DateUtils.parseFromTightYYYYMMDD(DateUtils.addMonth(new Date(), -1)),"yyyyMM");
// def count = findCurMonthPrice(lastMonthStr)
// if(count > 0){
// def datas = ExcelUtils.read("C:\\Users\\wenyan\\Desktop\\宏信楼盘3月监测20260320交付跑数.xlsx")
// def newDatas = createDatas(datas, lastMonthStr)
//
// def curDateStr = DateUtils.formatDateByPattern(new Date(),"yyyyMMdd")
// ExcelUtils.write("C:\\Users\\wenyan\\Desktop\\宏信楼盘3月监测20260320交付跑数1.xlsx", newDatas,"结果")
// }
ExcelUtils.multiThreadingModify("C:\\Users\\wenyan\\Desktop\\宏信楼盘3月监测20260320交付跑数V3(mu).xlsx",{ List d->
if (!["商铺","办公楼"].contains(d['A'])){
def tihuanMap = [:]
def preTihuanMap = [:]
def dist = CommonDatautils.findDistrictById(d['AA'])
if(dist){
tihuanMap.put(dist.city+"##"+dist.region+"##"+dist.name, d["N"])
preTihuanMap.put(dist.city+"##"+dist.region+"##"+dist.name, d["L"])
def resMap = getDistSortNumber(dist.city, dist.region, "202602", tihuanMap)
def preResMap = getDistSortNumber(dist.city, dist.region, "202601", preTihuanMap)
if(resMap){
d["V"] = resMap.num+"/"+resMap.total
}else{
d["V"] = null
}
if(preResMap){
d["U"] = preResMap.num+"/"+preResMap.total
}else{
d["U"] = null
}
if(resMap && preResMap){
d["W"] = resMap.num - preResMap.num
}else{
d["W"] = null
}
}
} }
}, 1,"V3") })
def fixPriceAddrs = [:]
ExcelUtils.read(removeAddrFile, 0).each {List item->
if(item["A"] && item["B"]){
fixPriceAddrs.put(item["A"],item["B"].toString().toDouble().toInteger())
}
removeAddrs << item["C"]
}
def stat = [:]
//获取上个月的交付价格
def lastMonthPriceRowId = "R" //上个月均价所在列号
ExcelUtils.read(fileName).each{List item->
if(item[lastMonthPriceRowId]){
stat.put(item["C"], item[lastMonthPriceRowId])
}
}
def lastMonthStr = DateUtils.formatDateByPattern(DateUtils.parseFromTightYYYYMMDD(DateUtils.addMonth(new Date(), -1)),"yyyyMM");
def count = findCurMonthPrice(lastMonthStr)
if(count > 0){
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 curDateStr = DateUtils.formatDateByPattern(new Date(),"yyyyMMdd")
ExcelUtils.write(fileName, newDatas,"结果${curDateStr}")
}
// ExcelUtils.multiThreadingModify("C:\\Users\\wenyan\\Desktop\\宏信楼盘3月监测20260320交付跑数V3(mu).xlsx",{ List d->
// if (!["商铺","办公楼"].contains(d['A'])){
// def tihuanMap = [:]
// def preTihuanMap = [:]
// def dist = CommonDatautils.findDistrictById(d['AA'])
// if(dist){
// tihuanMap.put(dist.city+"##"+dist.region+"##"+dist.name, d["N"])
// preTihuanMap.put(dist.city+"##"+dist.region+"##"+dist.name, d["L"])
// def resMap = getDistSortNumber(dist.city, dist.region, "202602", tihuanMap)
// def preResMap = getDistSortNumber(dist.city, dist.region, "202601", preTihuanMap)
// if(resMap){
// d["V"] = resMap.num+"/"+resMap.total
// }else{
// d["V"] = null
// }
// if(preResMap){
// d["U"] = preResMap.num+"/"+preResMap.total
// }else{
// d["U"] = null
// }
// if(resMap && preResMap){
// d["W"] = resMap.num - preResMap.num
// }else{
// d["W"] = null
// }
// }
//
// }
// }, 1,"V3")
// ExcelUtils.modify("C:\\Users\\wenyan\\Desktop\\宏信楼盘3月监测20260320交付跑数V3(mu).xlsx",{List item-> // ExcelUtils.modify("C:\\Users\\wenyan\\Desktop\\宏信楼盘3月监测20260320交付跑数V3(mu).xlsx",{List item->
//// if(item["O"]){ //// if(item["O"]){
//// item["N"] = item["O"].toString().toDouble().toInteger() //// item["N"] = item["O"].toString().toDouble().toInteger()
@@ -102,19 +138,14 @@ class HongXingMonthBatch extends BaseBatch{
} }
def createDatas(datas, lastMonthStr, Map fixPriceAddrs){
def createDatas(datas, lastMonthStr){
def rows = [] def rows = []
rows << ["物业类型","名称","地址","期房/现房","处置状态","省份","城市","城市排名","面积","1月供数单价(元)","1月供数总价(元)","2月供数单价(元)","2月供数总价(元)","3月评估单价", "3月评估总价(元)" rows << ["物业类型","名称","地址","期房/现房","处置状态","省份","城市","城市排名","面积","1月评估单价(元)","1月评估总价(元)","2月评估单价(元)","2月评估总价(元)","3月评估单价", "3月评估总价(元)","4月评估单价", "4月评估总价(元)","5月评估单价","5月评估总价(元)","6月评估单价", "6月评估总价(元)","7月评估单价", "7月评估总价(元)","8月评估单价", "8月评估总价(元)","9月评估单价", "9月评估总价(元)"
,"环比涨跌幅(%)","计算方式","定基涨跌幅(相比首月波动)","3月区域均价","3月区域均价涨跌幅(%)","2月楼盘所在区域价格的排名(仅针对住宅)","3月楼盘所在区域价格的排名(仅针对住宅)","楼盘所在区域排名变化(仅针对住宅)","近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']
index++ index++
if(d['E'] == "已处置"){
continue
}
def row = [] def row = []
row << d['A'] row << d['A']
row << d['B'] row << d['B']
@@ -129,41 +160,73 @@ class HongXingMonthBatch extends BaseBatch{
row << d['K'] row << d['K']
row << d['L'] row << d['L']
row << d['M'] row << d['M']
row << d['N']
row << d['O']
row << d['P']
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'] == "已处置"){
rows << row
continue
}
def currMonthUnitPriceLabel = "Z"
def preMonthUnitPriceLabel = "X"
def matchIdLabel = "AM"
if(!["商铺","办公楼"].contains(d['A'])){ if(!["商铺","办公楼"].contains(d['A'])){
def dist = CommonDatautils.findDistrictById(d['Z']) def dist = CommonDatautils.findDistrictById(d[matchIdLabel])
if(dist){ if(dist){
def priceObj = findDistrictMonthPrice(dist.city, dist.region, dist.name, lastMonthStr) def priceObj = findDistrictMonthPrice(dist.city, dist.region, dist.name, lastMonthStr)
def tihuanMap = [:] def tihuanMap = [:]
def preTihuanMap = [:] def preTihuanMap = [:]
if(priceObj){ if(priceObj){
if(d["N"]){ if(fixPriceAddrs.containsKey(d['C'])){
def newAvgPrice = d["N"] d[currMonthUnitPriceLabel] = fixPriceAddrs[d['c']]
}
if(d[currMonthUnitPriceLabel]){
def newAvgPrice = d[currMonthUnitPriceLabel]
row << DataUtil.getRound(newAvgPrice) row << DataUtil.getRound(newAvgPrice)
def totalPrice = newAvgPrice * d['I'] def totalPrice = newAvgPrice * d['I']
row << DataUtil.getRound(totalPrice) row << DataUtil.getRound(totalPrice)
row << new BigDecimal(DataUtil.getRound(2,(newAvgPrice - d['L']) * 100/ d['L']).toString()) if(d[preMonthUnitPriceLabel]){
row << new BigDecimal(DataUtil.getRound(2,(newAvgPrice - d[preMonthUnitPriceLabel]) * 100/ d[preMonthUnitPriceLabel]).toString())
preTihuanMap.put(dist.city+"##"+dist.region+"##"+dist.name, d[preMonthUnitPriceLabel])
}else{
row << ""
}
row << "" row << ""
def djMarkup = (newAvgPrice - d['J'])*100/ d['J'] if(d['J']){
djMarkup = DataUtil.getRound(2, djMarkup) def djMarkup = (newAvgPrice - d['J'])*100/ d['J']
row << djMarkup.toString() djMarkup = DataUtil.getRound(2, djMarkup)
row << djMarkup.toString()
}else{
row << ""
}
tihuanMap.put(dist.city+"##"+dist.region+"##"+dist.name, newAvgPrice) tihuanMap.put(dist.city+"##"+dist.region+"##"+dist.name, newAvgPrice)
preTihuanMap.put(dist.city+"##"+dist.region+"##"+dist.name, d["L"])
}else{ }else{
def markup = priceObj.mom def markup = priceObj.mom
def curPrice = d['L'] def curPrice = d[preMonthUnitPriceLabel]
def newAvgPrice = curPrice * markup + curPrice def newAvgPrice = curPrice * markup + curPrice
row << DataUtil.getRound(newAvgPrice) row << DataUtil.getRound(newAvgPrice)
def totalPrice = newAvgPrice * d['I'] def totalPrice = newAvgPrice * d['I']
row << DataUtil.getRound(totalPrice) row << DataUtil.getRound(totalPrice)
row << markup*100 row << markup*100
row << getPriceWay(priceObj.value_type) row << getPriceWay(priceObj.value_type)
println(row) if(d['J']){
def djMarkup = (newAvgPrice - d['J'])*100/ d['J'] def djMarkup = (newAvgPrice - d['J'])*100/ d['J']
djMarkup = DataUtil.getRound(2, djMarkup) djMarkup = DataUtil.getRound(2, djMarkup)
row << djMarkup.toString() row << djMarkup.toString()
}else{
row << ""
}
tihuanMap.put(dist.city+"##"+dist.region+"##"+dist.name, newAvgPrice) tihuanMap.put(dist.city+"##"+dist.region+"##"+dist.name, newAvgPrice)
preTihuanMap.put(dist.city+"##"+dist.region+"##"+dist.name, d["L"]) preTihuanMap.put(dist.city+"##"+dist.region+"##"+dist.name, d[preMonthUnitPriceLabel])
} }
}else{ }else{
row << "" row << ""
@@ -171,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)
@@ -184,35 +246,44 @@ class HongXingMonthBatch extends BaseBatch{
} }
def resMap = getDistSortNumber(dist.city, dist.region, lastMonthStr, tihuanMap) def resMap = getDistSortNumber(dist.city, dist.region, lastMonthStr, tihuanMap)
def preResMap = getDistSortNumber(dist.city, dist.region, "202601", preTihuanMap) def preResMap = getDistSortNumber(dist.city, dist.region, "202602", preTihuanMap)
if(resMap){
row << resMap.num+"/"+resMap.total
}else{
row << ""
}
if(preResMap){ if(preResMap){
row << preResMap.num+"/"+preResMap.total row << preResMap.num+"/"+preResMap.total
}else{ }else{
row << "" row << ""
} }
if(resMap){
row << resMap.num+"/"+resMap.total
}else{
row << ""
}
if(resMap && preResMap){ if(resMap && preResMap){
row << resMap.num - preResMap.num row << resMap.num - preResMap.num
}else{
row << ""
} }
row << findTrades(dist, 3) row << findTrades(dist, 3)
row << findTrades(dist, 6) row << findTrades(dist, 6)
row << findHouse(dist) row << findHouse(dist)
}else{ }else{
println d['AD'] +" 未找到该id的楼盘" println d[matchIdLabel] +" 未找到该id的楼盘:${d}"
} }
}else{ }else{
def dist = CommonDatautils.findDistrictById(d['Z']) def dist = CommonDatautils.findDistrictById(d[matchIdLabel])
def cityMarkupObj = null def cityMarkupObj = null
def regionMarkupObj = null def regionMarkupObj = null
if(dist){ if(dist){
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
@@ -227,26 +298,42 @@ 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(d["N"]){ if(fixPriceAddrs.containsKey(d['C'])){
def newAvgPrice = d["N"] d[currMonthUnitPriceLabel] = fixPriceAddrs[d['c']]
}
if(d[currMonthUnitPriceLabel]){
def newAvgPrice = d[currMonthUnitPriceLabel]
row << DataUtil.getRound(newAvgPrice) row << DataUtil.getRound(newAvgPrice)
def totalPrice = newAvgPrice * d['I'] def totalPrice = newAvgPrice * d['I']
row << DataUtil.getRound(totalPrice) row << DataUtil.getRound(totalPrice)
row << new BigDecimal(DataUtil.getRound(2, (newAvgPrice - d['L']) * 100/ d['L']).toString()) if(d[preMonthUnitPriceLabel]){
row << new BigDecimal(DataUtil.getRound(2, (newAvgPrice - d[preMonthUnitPriceLabel]) * 100/ d[preMonthUnitPriceLabel]).toString())
}else{
row << ""
}
row << "" row << ""
def djMarkup = (newAvgPrice - d['J'])*100/ d['J'] if(d['J']){
djMarkup = DataUtil.getRound(2, djMarkup) def djMarkup = (newAvgPrice - d['J'])*100/ d['J']
row << djMarkup.toString() djMarkup = DataUtil.getRound(2, djMarkup)
row << djMarkup.toString()
}else{
row << ""
}
}else{ }else{
def newAvgPrice = d['L'] * cityMarkupObj.mom + d['L'] def newAvgPrice = d[preMonthUnitPriceLabel] * cityMarkupObj.mom + d[preMonthUnitPriceLabel]
row << DataUtil.getRound(newAvgPrice) row << DataUtil.getRound(newAvgPrice)
def totalPrice = newAvgPrice * d['I'] def totalPrice = newAvgPrice * d['I']
row << DataUtil.getRound(totalPrice) row << DataUtil.getRound(totalPrice)
row << cityMarkupObj.mom * 100 row << cityMarkupObj.mom * 100
row << "" row << ""
def djMarkup = (newAvgPrice - d['L'])*100/ d['L'] if(d[preMonthUnitPriceLabel]){
djMarkup = DataUtil.getRound(2, djMarkup) def djMarkup = (newAvgPrice - d[preMonthUnitPriceLabel])*100/ d[preMonthUnitPriceLabel]
row << djMarkup.toString() djMarkup = DataUtil.getRound(2, djMarkup)
row << djMarkup.toString()
}else{
row << ""
}
} }
}else{ }else{
row << "" row << ""
@@ -269,8 +356,15 @@ class HongXingMonthBatch extends BaseBatch{
} }
}else{ }else{
if(regionMarkupObj){ if(regionMarkupObj){
row << (int)regionMarkupObj.avg_price if(Math.abs(regionMarkupObj.mom) * 100 > 10){
row << regionMarkupObj.mom*100 def preAvgPrice = regionMarkupObj.avg_price * (1 - regionMarkupObj.mom)
def newAvgPrice = ((preAvgPrice + regionMarkupObj.avg_price)/2).toInteger()
row << newAvgPrice
row << new BigDecimal(DataUtil.getRound(2, (newAvgPrice - preAvgPrice) * 100/ preAvgPrice).toString())
}else{
row << (int)regionMarkupObj.avg_price
row << regionMarkupObj.mom*100
}
}else{ }else{
row << "" row << ""
row << "" row << ""
@@ -283,13 +377,12 @@ class HongXingMonthBatch extends BaseBatch{
row << "" row << ""
row << "" row << ""
}else{ }else{
println d['AD'] +" 未找到该id的楼盘" println d[matchIdLabel] +" 未找到该id的楼盘"
} }
} }
row << d['Z'] row << d[matchIdLabel]
row << d['AA'] row << d['AN']
row << d['AB'] row << d['AO']
row << d['AC']
rows << row rows << row
} }
@@ -346,7 +439,7 @@ class HongXingMonthBatch extends BaseBatch{
def tihuanMap2 = [:] def tihuanMap2 = [:]
tihuanMap2.put(dist.city+"##"+dist.region+"##"+dist.name, d['J']) tihuanMap2.put(dist.city+"##"+dist.region+"##"+dist.name, d['J'])
def resMap2 = getDistSortNumber(dist.city, dist.region, "202601", tihuanMap) def resMap2 = getDistSortNumber(dist.city, dist.region, "202602", tihuanMap)
if(resMap2){ if(resMap2){
def str = resMap2.num+"/"+resMap2.total def str = resMap2.num+"/"+resMap2.total
d['Q'] = str d['Q'] = str
@@ -456,11 +549,6 @@ class HongXingMonthBatch extends BaseBatch{
ret << d['U'] ret << d['U']
ret << ""//2月供数单价 ret << ""//2月供数单价
ret << ""//人工核实价格 ret << ""//人工核实价格
if(d["O"]=="1882266062917259264"){
ret << "金水"
}else{
ret << "曹"
}
ret << d['Q'] ret << d['Q']
ret << d['R'] ret << d['R']
ret << d['S'] ret << d['S']
@@ -24,7 +24,7 @@ import java.util.regex.Pattern
DBCollection coll = MongoUtils.getCollectionByName("seeds_db", "city_seeds", "192.168.0.235", 27018) DBCollection coll = MongoUtils.getCollectionByName("seeds_db", "city_seeds", "192.168.0.235", 27018)
def ZS_MONGODB_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; def ZS_MONGODB_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009";
DBCollection TOWNSHIP_CONN = MongoUtils.getCollectionByName2("fangjia", "township", ZS_MONGODB_URL) DBCollection TOWNSHIP_CONN = MongoUtils.getCollectionByName2("fangjia", "township", ZS_MONGODB_URL)
@@ -17,7 +17,7 @@ class StreetProcess {
final DBCollection TOWNSHIP = MongoUtils.getCollectionByName("fangjia", "township", "mongo.db.fangjia.com") final DBCollection TOWNSHIP = MongoUtils.getCollectionByName("fangjia", "township", "mongo.db.fangjia.com")
public static final def MONGODB_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; public static final def MONGODB_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009";
public static final DBCollection TOWNSHIP100 = MongoUtils.getCollectionByName2("fangjia", "township", MONGODB_URL) public static final DBCollection TOWNSHIP100 = MongoUtils.getCollectionByName2("fangjia", "township", MONGODB_URL)
@@ -12,7 +12,7 @@ import org.apache.commons.lang.StringUtils
import java.util.regex.Pattern import java.util.regex.Pattern
def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009";
DBCollection development_zone_CONN = MongoUtils.getCollectionByName2("fangjia", "development_zone", MONGO100_URL) DBCollection development_zone_CONN = MongoUtils.getCollectionByName2("fangjia", "development_zone", MONGO100_URL)
DBCollection community_CONN = MongoUtils.getCollectionByName2("fangjia", "community", MONGO100_URL) DBCollection community_CONN = MongoUtils.getCollectionByName2("fangjia", "community", MONGO100_URL)
@@ -11,7 +11,7 @@ class NanjiangVillage {
} }
def run(){ def run(){
ExcelUtils.multiThreadingModify("D:\\数据\\南京\\是否农村.xlsx",{d-> ExcelUtils.multiThreadingModify("C:\\Users\\wenyan\\Desktop\\南京银行是否农村0409.xlsx",{d->
if(d['A'] && !d['F']){ if(d['A'] && !d['F']){
def dto = OpenApiUtils.addrVerifyNanjing(null, d['A'], 2) def dto = OpenApiUtils.addrVerifyNanjing(null, d['A'], 2)
@@ -12,7 +12,7 @@ import com.mongodb.DBCollection
DBCollection TOWN_POLYLINECOLL = MongoUtils.getCollectionByAuth20190102("fangjia_crawl", "town_polyline") DBCollection TOWN_POLYLINECOLL = MongoUtils.getCollectionByAuth20190102("fangjia_crawl", "town_polyline")
def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009";
DBCollection COMMUNITY_CONN = MongoUtils.getCollectionByName2("fangjia", "community", MONGO100_URL) DBCollection COMMUNITY_CONN = MongoUtils.getCollectionByName2("fangjia", "community", MONGO100_URL)
@@ -7,7 +7,7 @@ import com.mongodb.DBCollection
import com.rabbitmq.client.impl.AMQImpl import com.rabbitmq.client.impl.AMQImpl
import org.bson.types.ObjectId import org.bson.types.ObjectId
def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009";
DBCollection COMMUNITY_CONN = MongoUtils.getCollectionByName2("fangjia", "community_new_2023", MONGO100_URL) DBCollection COMMUNITY_CONN = MongoUtils.getCollectionByName2("fangjia", "community_new_2023", MONGO100_URL)
filePath = "D:\\数据\\涉农\\18万最终-id.xlsx" filePath = "D:\\数据\\涉农\\18万最终-id.xlsx"
@@ -60,7 +60,7 @@ class GaoDePoiDataProcess extends BaseBatch{
public final static DBCollection COMPANY_206_COLL = MongoUtils.getCollectionByName("business", "company_huzhou", "192.168.0.206",27020) public final static DBCollection COMPANY_206_COLL = MongoUtils.getCollectionByName("business", "company_huzhou", "192.168.0.206",27020)
def MAP_POI_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; def MAP_POI_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009";
DBCollection MAPPOI_CONN = MongoUtils.getCollectionByName2("fangjia", "map_poi", MAP_POI_URL) DBCollection MAPPOI_CONN = MongoUtils.getCollectionByName2("fangjia", "map_poi", MAP_POI_URL)
DBCollection MAPPOI_CONN_TEST = MongoUtils.getCollectionByName2("fangjia", "map_poi_all_8", MAP_POI_URL) DBCollection MAPPOI_CONN_TEST = MongoUtils.getCollectionByName2("fangjia", "map_poi_all_8", MAP_POI_URL)
@@ -21,7 +21,7 @@ import java.util.concurrent.atomic.AtomicLong
class NetworkDistanceBatch extends BaseBatch{ class NetworkDistanceBatch extends BaseBatch{
def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009";
DBCollection SEAWEED_CONN = MongoUtils.getCollectionByName2("fangjia", "seaweed", MONGO100_URL) DBCollection SEAWEED_CONN = MongoUtils.getCollectionByName2("fangjia", "seaweed", MONGO100_URL)
public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(20) public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(20)
@@ -22,7 +22,7 @@ import java.util.concurrent.atomic.AtomicLong
class PoiWash { class PoiWash {
def MAP_POI_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; def MAP_POI_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009";
DBCollection MAPPOI_CONN = MongoUtils.getCollectionByName2("fangjia", "map_poi", MAP_POI_URL) DBCollection MAPPOI_CONN = MongoUtils.getCollectionByName2("fangjia", "map_poi", MAP_POI_URL)
// DBCollection MAPPOI_CONN2 = MongoUtils.getCollectionByName2("fangjia", "map_poi_all", MAP_POI_URL) // DBCollection MAPPOI_CONN2 = MongoUtils.getCollectionByName2("fangjia", "map_poi_all", MAP_POI_URL)
@@ -12,7 +12,7 @@ class PostCodeSynchBatch extends BaseBatch{
public static final DBCollection post_code_coll = MongoUtils.getCollectionByName("crawl", "post_code", "192.168.0.206", 27020) public static final DBCollection post_code_coll = MongoUtils.getCollectionByName("crawl", "post_code", "192.168.0.206", 27020)
def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009";
DBCollection POST_CODE_CONN = MongoUtils.getCollectionByName2("fangjia", "postcode", MONGO100_URL) DBCollection POST_CODE_CONN = MongoUtils.getCollectionByName2("fangjia", "postcode", MONGO100_URL)
def fullCityMap = null def fullCityMap = null
@@ -46,7 +46,7 @@ class SeaweedDataSynch extends BaseBatch{
static def targetUrl = "http://192.168.0.89:9200/seaweed/" static def targetUrl = "http://192.168.0.89:9200/seaweed/"
public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(20) public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(20)
def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009";
DBCollection SEAWEED_CONN = MongoUtils.getCollectionByName2("fangjia", "seaweed_dishu", MONGO100_URL) DBCollection SEAWEED_CONN = MongoUtils.getCollectionByName2("fangjia", "seaweed_dishu", MONGO100_URL)
DBCollection administrative_division_100_CONN = MongoUtils.getCollectionByName2("fangjia", "administrative_division_2023", MONGO100_URL) DBCollection administrative_division_100_CONN = MongoUtils.getCollectionByName2("fangjia", "administrative_division_2023", MONGO100_URL)
DBCollection administrative_division_2022_CONN = MongoUtils.getCollectionByName2("fangjia", "administrative_division", MONGO100_URL) DBCollection administrative_division_2022_CONN = MongoUtils.getCollectionByName2("fangjia", "administrative_division", MONGO100_URL)
@@ -23,7 +23,7 @@ class SuggestionDataSynch extends BaseBatch{
static def targetUrl = "http://192.168.0.12:9200/seaweed/" static def targetUrl = "http://192.168.0.12:9200/seaweed/"
public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(100) public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(100)
def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; def MONGO100_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009";
DBCollection SEAWEED_CONN = MongoUtils.getCollectionByName2("fangjia", "seaweed", MONGO100_URL) DBCollection SEAWEED_CONN = MongoUtils.getCollectionByName2("fangjia", "seaweed", MONGO100_URL)
DBCollection administrative_division_100_CONN = MongoUtils.getCollectionByName2("fangjia", "administrative_division", MONGO100_URL) DBCollection administrative_division_100_CONN = MongoUtils.getCollectionByName2("fangjia", "administrative_division", MONGO100_URL)
DBCollection SUGGESTION_CONN = MongoUtils.getCollectionByName2("fangjia", "suggestion_new", MONGO100_URL) DBCollection SUGGESTION_CONN = MongoUtils.getCollectionByName2("fangjia", "suggestion_new", MONGO100_URL)
@@ -69,7 +69,6 @@ class XiaMenVillageBatch extends BaseBatch{
println "数据为空,无法生成Excel" println "数据为空,无法生成Excel"
return false return false
} }
try { try {
// 1. 生成Excel内容 // 1. 生成Excel内容
byte[] excelBytes = ExcelUtils.createExcelBytes(data, sheetName) byte[] excelBytes = ExcelUtils.createExcelBytes(data, sheetName)
@@ -89,7 +88,8 @@ class XiaMenVillageBatch extends BaseBatch{
def existsFlag = false def existsFlag = false
if(files){ if(files){
for(def file : files){ for(def file : files){
if(file.filename == fileName){ // 0 字节视为无效(上次上传失败的残留),需要重新上传
if(file.filename == fileName && file.attrs.size > 0){
existsFlag = true existsFlag = true
break break
} }
@@ -95,29 +95,26 @@ class XmBankVillageFtpUtils {
* @return 上传是否成功 * @return 上传是否成功
*/ */
private static boolean uploadExcelBytes(byte[] excelBytes, String fileName) { private static boolean uploadExcelBytes(byte[] excelBytes, String fileName) {
sftpChannel = reConnect()
try { try {
// 构建完整的远程路径 println "开始上传Excel文件到: ${ftpPath}/${fileName}"
String remoteFilePath = "${ftpPath}/${fileName}"
println "开始上传Excel文件到: ${remoteFilePath}"
println "文件大小: ${excelBytes.length} 字节" println "文件大小: ${excelBytes.length} 字节"
// 确保远程目录存在 // 重建连接,避免长时间处理后连接超时
sftp.createDir(ftpPath, sftpChannel) ChannelSftp channel = sftp.connect(ftpServer, ftpPort, ftpUser, ftpPassword)
// 将字节数组转换为输入流 // 确保目录存在
sftp.createDir(ftpPath, channel)
// 删除服务端可能存在的 0 字节残留(避免服务端对 TRUNC 操作返回 Failure)
try { channel.rm("${ftpPath}/${fileName}") } catch (ignored) {}
// cd 进目标目录,使用文件名(相对路径)上传
channel.cd(ftpPath)
InputStream inputStream = new ByteArrayInputStream(excelBytes) InputStream inputStream = new ByteArrayInputStream(excelBytes)
channel.put(inputStream, fileName)
// 上传文件
sftpChannel.put(inputStream, remoteFilePath)
// 关闭流
inputStream.close() inputStream.close()
println "Excel文件上传成功: ${remoteFilePath}" println "Excel文件上传成功: ${ftpPath}/${fileName}"
return true return true
} catch (Exception e) { } catch (Exception e) {
@@ -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
] ]
@@ -1,5 +1,6 @@
package com.fangjia.script.jms package com.fangjia.script.jms
import com.fangjia.core.Constants
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
@@ -24,10 +25,8 @@ public class EmailConsumer extends BaseBatch {
static def lastSendTime = 0; static def lastSendTime = 0;
static def email_pattern = ~/^[-\w\.]+@(?:\w+[\.-]?)*\w+$/; static def email_pattern = ~/^[-\w\.]+@(?:\w+[\.-]?)*\w+$/;
//static final String EMAIL_SERVER = "222.73.196.139"
static final String EMAIL_SERVER = "smtp.exmail.qq.com" static final String EMAIL_SERVER = "smtp.exmail.qq.com"
public static final DBCollection EMAIL_SEND_LOG = MongoUtils.getCollectionByName("goojia_common", "email_send_log", "log.mongo.db.fangjia.com", 52002); public final static DBCollection EMAIL_SEND_LOG = com.fangjia.core.util.MongoUtils.getDbCollection(Constants.SEAWATER_MONGO_URI, 'goojia_common', 'email_send_log')
public static void main(String[] args) { public static void main(String[] args) {
runBatch(new EmailConsumer(), args) runBatch(new EmailConsumer(), args)
@@ -45,7 +45,7 @@ public class Anshan {
// new String[]{"192.168.0.96", "3234"}, // new String[]{"192.168.0.96", "3234"},
// new String[]{"192.168.0.98", "3234"}, // new String[]{"192.168.0.98", "3234"},
// new String[]{"192.168.0.99", "3234"}, // new String[]{"192.168.0.99", "3234"},
// new String[]{"192.168.0.100", "3234"}, // new String[]{"192.168.0.80", "3234"},
// new String[]{"192.168.0.101", "3234"}, // new String[]{"192.168.0.101", "3234"},
// new String[]{"192.168.0.102", "3234"}, // new String[]{"192.168.0.102", "3234"},
// new String[]{"192.168.0.103", "3234"} // new String[]{"192.168.0.103", "3234"}
@@ -17,7 +17,7 @@ ExcelUtils.singleThreadingModify(excelFilePath, { List items ->
String address = items['B'] String address = items['B']
String url = "http://192.168.0.100:32080/FangJiaAddressService/villageIdentify"; String url = "http://192.168.0.80:32080/FangJiaAddressService/villageIdentify";
HttpRequest httpRequest = new HttpRequest(); HttpRequest httpRequest = new HttpRequest();
map = new HashMap<String, String>() map = new HashMap<String, String>()
@@ -24,7 +24,7 @@ ExcelUtils.multiThreadingModify(excelFilePath, { List items ->
String address = items['A'] String address = items['A']
<<<<<<< HEAD <<<<<<< HEAD
// if (province == null) { // if (province == null) {
String url = "http://192.168.0.100:32080/FangJiaAddressService/villageIdentify"; String url = "http://192.168.0.80:32080/FangJiaAddressService/villageIdentify";
HttpRequest httpRequest = new HttpRequest(); HttpRequest httpRequest = new HttpRequest();
map = new HashMap<String, String>() map = new HashMap<String, String>()
@@ -130,7 +130,7 @@ ExcelUtils.multiThreadingModify(excelFilePath, { List items ->
======= =======
String province = items['B'] String province = items['B']
if (province == null) { if (province == null) {
String url = "http://192.168.0.100:32080/FangJiaAddressService/villageIdentify"; String url = "http://192.168.0.80:32080/FangJiaAddressService/villageIdentify";
HttpRequest httpRequest = new HttpRequest(); HttpRequest httpRequest = new HttpRequest();
map = new HashMap<String, String>() map = new HashMap<String, String>()
@@ -13,7 +13,7 @@ ExcelUtils.singleThreadingModify(excelFilePath, { List items ->
println("已处理:"+count) println("已处理:"+count)
} }
String url = "http://192.168.0.100:32080/FangJiaAddressService/villageIdentify"; String url = "http://192.168.0.80:32080/FangJiaAddressService/villageIdentify";
HttpRequest httpRequest = new HttpRequest(); HttpRequest httpRequest = new HttpRequest();
map = new HashMap<String, String>() map = new HashMap<String, String>()
@@ -18,7 +18,7 @@ ExcelUtils.singleThreadingModify(excelFilePath, { List items ->
String address = items['A'] String address = items['A']
String tt = items['Y'] String tt = items['Y']
if (flag == null&&"地址有效".equals(tt)) { if (flag == null&&"地址有效".equals(tt)) {
String url = "http://192.168.0.100:32080/FangJiaAddressService/villageIdentify"; String url = "http://192.168.0.80:32080/FangJiaAddressService/villageIdentify";
HttpRequest httpRequest = new HttpRequest(); HttpRequest httpRequest = new HttpRequest();
map = new HashMap<String, String>() map = new HashMap<String, String>()
@@ -15,7 +15,7 @@ ExcelUtils.singleThreadingModify(excelFilePath, { List items ->
println("已处理:"+count) println("已处理:"+count)
} }
String url = "http://192.168.0.100:32080/FangJiaAddressService/villageIdentify"; String url = "http://192.168.0.80:32080/FangJiaAddressService/villageIdentify";
HttpRequest httpRequest = new HttpRequest(); HttpRequest httpRequest = new HttpRequest();
map = new HashMap<String, String>() map = new HashMap<String, String>()
@@ -38,7 +38,7 @@ class InvokeHttpRequest {
"192.168.0.93", "192.168.0.93",
"192.168.0.99", "192.168.0.99",
"192.168.0.94", "192.168.0.94",
"192.168.0.100" "192.168.0.80"
]; ];
// static int PROXY_USE_COUNT=0; // static int PROXY_USE_COUNT=0;
static AtomicInteger PROXY_USE_COUNT=new AtomicInteger(); static AtomicInteger PROXY_USE_COUNT=new AtomicInteger();
@@ -26,7 +26,7 @@ class Seawater2SeabirdSyncBatch extends BaseBatch {
CommonUtils.findAllCity().each { city -> CommonUtils.findAllCity().each { city ->
def endDate = DateUtil.truncateDay(new Date()).format("yyyy-MM-dd") def endDate = DateUtil.truncateDay(new Date()).format("yyyy-MM-dd")
def startDate = DateUtil.add(DateUtil.truncateDay(new Date()), -1).format("yyyy-MM-dd") def startDate = DateUtil.add(DateUtil.truncateDay(new Date()), -1).format("yyyy-MM-dd")
String sql = "select * from latest_seawater where city = '${city}' and cat = 'sell' and m_date >= '${startDate}' and m_date < '${endDate}'".toString() String sql = "select * from latest_seawater where city = '${city}' and m_date >= '${startDate}' and m_date < '${endDate}'".toString()
ElasticUtils.executeSqlQuery(sql,{Map house-> ElasticUtils.executeSqlQuery(sql,{Map house->
def seabird = new BasicDBObject() def seabird = new BasicDBObject()
seabird.put("city", city) seabird.put("city", city)
@@ -9,7 +9,7 @@ import com.mongodb.DBCollection
import org.apache.commons.collections.CollectionUtils import org.apache.commons.collections.CollectionUtils
import org.apache.commons.lang.StringUtils import org.apache.commons.lang.StringUtils
def ZS_MONGODB_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.100:30009"; def ZS_MONGODB_URL = "mongodb://admin:G00MONGOADMIN@192.168.0.80:30009";
final DBCollection ZS_REGION_CONN = MongoUtils.getCollectionByName2("fangjia", "region_block", ZS_MONGODB_URL) final DBCollection ZS_REGION_CONN = MongoUtils.getCollectionByName2("fangjia", "region_block", ZS_MONGODB_URL)
ZS_REGION_CONN.find(new BasicDBObject()).batchSize(1000).each {obj -> ZS_REGION_CONN.find(new BasicDBObject()).batchSize(1000).each {obj ->
@@ -26,7 +26,7 @@ import java.util.stream.Collectors
class GetPoiFromCommunity { class GetPoiFromCommunity {
static final ExecutorService executorService = Executors.newFixedThreadPool(10) static final ExecutorService executorService = Executors.newFixedThreadPool(10)
static final def URL = "http://192.168.0.100:38080/FangJiaDataService/saveAmapPoiDetail" static final def URL = "http://192.168.0.80:38080/FangJiaDataService/saveAmapPoiDetail"
// 住宅类 // 住宅类
static final String typecodes = "120000|120100|120200|120201|120202|120203|120300|120301|120302|120303|120304"; static final String typecodes = "120000|120100|120200|120201|120202|120203|120300|120301|120302|120303|120304";
@@ -17,7 +17,7 @@ import java.util.concurrent.atomic.AtomicLong
class GetPoiFromExcel { class GetPoiFromExcel {
static final ExecutorService executorService = Executors.newFixedThreadPool(10) static final ExecutorService executorService = Executors.newFixedThreadPool(10)
static final def URL = "http://192.168.0.100:38080/FangJiaDataService/saveAmapPoiDetail" static final def URL = "http://192.168.0.80:38080/FangJiaDataService/saveAmapPoiDetail"
// 住宅类 // 住宅类
static final String typecodes = "120000|120100|120200|120201|120202|120203|120300|120301|120302|120303|120304"; static final String typecodes = "120000|120100|120200|120201|120202|120203|120300|120301|120302|120303|120304";

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