diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/AddShDealData.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/AddShDealData.groovy new file mode 100644 index 000000000..3bb3e7b81 --- /dev/null +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/ccbevaluation/AddShDealData.groovy @@ -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) +} + diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/Test.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/Test.groovy new file mode 100644 index 000000000..2db3745ca --- /dev/null +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/district/Test.groovy @@ -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}" \ No newline at end of file