scripts/index.js集成getCompanies脚本

This commit is contained in:
秦秋旭 2026-01-22 16:05:11 +08:00
parent f11b997db4
commit 06d90c19a2
4 changed files with 22 additions and 14 deletions

View File

@ -2480,8 +2480,8 @@
"资质等级": "二级", "资质等级": "二级",
"核准预售套数": 1940, "核准预售套数": 1940,
"核准预售面积": "0", "核准预售面积": "0",
"已售总套数": 1400, "已售总套数": 1401,
"未售总套数": 540, "未售总套数": 539,
"已售总面积": "0", "已售总面积": "0",
"未售总面积": "0", "未售总面积": "0",
"楼盘销售部地址": "", "楼盘销售部地址": "",
@ -2613,7 +2613,7 @@
"楼幢": [ "楼幢": [
{ {
"楼幢名称": "5幢", "楼幢名称": "5幢",
"成交均价": "6989.8", "成交均价": "6979.05",
"bid": "1099720" "bid": "1099720"
} }
], ],
@ -2624,7 +2624,7 @@
"批准时间": "2025-10-29", "批准时间": "2025-10-29",
"所在区域": "普宁市", "所在区域": "普宁市",
"总套数": 195, "总套数": 195,
"可售套数": 120, "可售套数": 119,
"许可证链接": "http://120.236.48.169:89/HPMS/PresellDetailsInfo.aspx?d0BkXtgEYDqryDaPrKItzg%3D%3D" "许可证链接": "http://120.236.48.169:89/HPMS/PresellDetailsInfo.aspx?d0BkXtgEYDqryDaPrKItzg%3D%3D"
}, },
{ {
@ -3084,8 +3084,8 @@
"资质等级": "二级", "资质等级": "二级",
"核准预售套数": 1538, "核准预售套数": 1538,
"核准预售面积": "0", "核准预售面积": "0",
"已售总套数": 238, "已售总套数": 239,
"未售总套数": 1300, "未售总套数": 1299,
"已售总面积": "0", "已售总面积": "0",
"未售总面积": "0", "未售总面积": "0",
"楼盘销售部地址": "", "楼盘销售部地址": "",
@ -3103,7 +3103,7 @@
}, },
{ {
"楼幢名称": "6幢", "楼幢名称": "6幢",
"成交均价": "7057.94", "成交均价": "7055.93",
"bid": "1099632" "bid": "1099632"
}, },
{ {
@ -3129,7 +3129,7 @@
"批准时间": "2024-12-26", "批准时间": "2024-12-26",
"所在区域": "普宁市", "所在区域": "普宁市",
"总套数": 1538, "总套数": 1538,
"可售套数": 1300, "可售套数": 1299,
"许可证链接": "http://120.236.48.169:89/HPMS/PresellDetailsInfo.aspx?PLvPi3qJjOJDsVq8ylD0hw%3D%3D" "许可证链接": "http://120.236.48.169:89/HPMS/PresellDetailsInfo.aspx?PLvPi3qJjOJDsVq8ylD0hw%3D%3D"
} }
] ]

View File

@ -236,7 +236,7 @@
"批准时间": "2025-10-29", "批准时间": "2025-10-29",
"所在区域": "普宁市", "所在区域": "普宁市",
"总套数": 195, "总套数": 195,
"可售套数": 120, "可售套数": 119,
"许可证链接": "http://120.236.48.169:89/HPMS/PresellDetailsInfo.aspx?d0BkXtgEYDqryDaPrKItzg%3D%3D" "许可证链接": "http://120.236.48.169:89/HPMS/PresellDetailsInfo.aspx?d0BkXtgEYDqryDaPrKItzg%3D%3D"
}, },
{ {
@ -548,7 +548,7 @@
"批准时间": "2024-12-26", "批准时间": "2024-12-26",
"所在区域": "普宁市", "所在区域": "普宁市",
"总套数": 1538, "总套数": 1538,
"可售套数": 1300, "可售套数": 1299,
"许可证链接": "http://120.236.48.169:89/HPMS/PresellDetailsInfo.aspx?PLvPi3qJjOJDsVq8ylD0hw%3D%3D" "许可证链接": "http://120.236.48.169:89/HPMS/PresellDetailsInfo.aspx?PLvPi3qJjOJDsVq8ylD0hw%3D%3D"
}, },
{ {

View File

@ -1992,7 +1992,7 @@
"楼幢": [ "楼幢": [
{ {
"楼幢名称": "5幢", "楼幢名称": "5幢",
"成交均价": "6989.8", "成交均价": "6979.05",
"bid": "1099720" "bid": "1099720"
} }
] ]
@ -2383,7 +2383,7 @@
}, },
{ {
"楼幢名称": "6幢", "楼幢名称": "6幢",
"成交均价": "7057.94", "成交均价": "7055.93",
"bid": "1099632" "bid": "1099632"
}, },
{ {

View File

@ -2,6 +2,7 @@ import fs from 'fs/promises';
import path from 'path'; import path from 'path';
import { main as getProject } from './getProject.js'; import { main as getProject } from './getProject.js';
import { main as getPreSaleLicense } from './getPreSaleLicense.js'; import { main as getPreSaleLicense } from './getPreSaleLicense.js';
import { main as getCompanies } from './getCompanies.js';
// 检查数据文件是否存在 // 检查数据文件是否存在
async function checkDataFileExists(dataPath) { async function checkDataFileExists(dataPath) {
@ -134,11 +135,18 @@ async function main() {
throw new Error('预售许可证抓取失败'); throw new Error('预售许可证抓取失败');
} }
// 步骤3: 合并数据 // 步骤3: 获取公司数据
const companyDataPath = path.join(process.cwd(), 'data', 'companies.json');
const companySuccess = await runScript(getCompanies, '公司信息抓取脚本', companyDataPath);
if (!companySuccess) {
throw new Error('公司信息抓取失败');
}
// 步骤4: 合并数据
await mergeLicenseData(); await mergeLicenseData();
console.log('\n🎉 所有数据处理完成!'); console.log('\n🎉 所有数据处理完成!');
console.log('📁 输出文件: data/merged_data.json'); console.log('📁 输出文件: data/merged_data.json, data/companies.json');
} catch (error) { } catch (error) {
console.error('\n💥 处理过程中发生错误:', error.message); console.error('\n💥 处理过程中发生错误:', error.message);