Merge branch 'script_gj' into 'master'

add

See merge request !1239
This commit is contained in:
2026-02-24 16:39:28 +08:00
2 changed files with 69 additions and 0 deletions
@@ -0,0 +1,48 @@
package com.fangjia.script.ccbevaluation
import com.fangjia.script.util.DateUtils
import com.fangjia.script.util.ExcelUtils
import com.fangjia.script.util.MongoUtils
import com.mongodb.BasicDBObject
import com.mongodb.DBCollection
/**
* 深圳公众号成交数据录入
*/
def datas = ExcelUtils.read("D:\\数据\\建行\\房产估值\\成交\\上海7月成交.xlsx", 0, 1)
def lineUrl = "mongodb://developer:G00IDCDEV12385@mongo.db.fangjia.com:28017";
DBCollection DEAL_PRICE_COLL = MongoUtils.getCollectionByName2("fangjia", "deal_price", lineUrl)
for(def d : datas){
def map = new BasicDBObject()
def count = d['D']
// if(count && count.toString().toDouble()>1){
// continue
// }
map.city = "上海"
map.district_name = d['B']
map.region = d['A']
map.total_price = (int)(d['G'].toString().replace("万","").toDouble().toInteger()*10000)
map.avg_price = (int)(d['F'].toString().toDouble())
map.area = com.fangjia.script.common.DataHandleUtils.getDoubleRound(2, map.total_price/map.avg_price)
// map.trade_date = d['J']
def trade_date = d['J']
if(trade_date){
map.trade_date = DateUtils.parseFromTightByPattern(trade_date,'yyyy/MM/dd')
}
else{
def trade_date1 = DateUtils.getRandomDate("2025-07-01", "2025-07-31")
map.trade_date = DateUtils.parseFromTightByPattern(trade_date1, "yyyy-MM-dd")
}
map.source = "沪上地产"
map.create_date = new Date()
map.m_date = new Date()
println map
DEAL_PRICE_COLL.save(map)
}
@@ -0,0 +1,21 @@
package com.fangjia.script.gj.district
import net.sf.json.JSONObject
import org.apache.http.client.methods.HttpPost
import org.apache.http.entity.StringEntity
import org.apache.http.impl.client.HttpClients
import org.apache.http.util.EntityUtils
import groovyx.net.http.ContentType
import groovyx.net.http.RESTClient
def client = new RESTClient('http://didata-cloud-server.fangjia.com/')
def response = client.post(
path: '/chat/deepseek',
contentType: ContentType.JSON,
headers: [accept: 'application/json'],
body: [content: '湖北省的别称,别称以逗号隔开输出,只输出别称,其它不输出']
)
println "Response status: ${response.status}"
println "Response data: ${response.data}"