设置指导价修改时间

This commit is contained in:
2024-03-05 15:16:26 +08:00
10 changed files with 61 additions and 81 deletions
@@ -29,7 +29,7 @@ class HouseChangingMonitorBatch extends BaseBatch {
DBCollection COLLECTION = MongoUtils.getCollectionByName("fangjia_log", "house_changing_monitor", "log.mongo.db.fangjia.com")
Jms jms = Jms.create('tcp://jms.db.fangjia.com:61616');
def EMAILS = [
'duxiaoyu@fangjia.com'
'gaojuan@fangjia.com'
]
public static void main(String[] args){
@@ -39,7 +39,7 @@ class WebAverageLabor extends BaseBatch{
public static final def CITIES = ["上海", "成都", "北京", "广州", "深圳"]
public static final def EMAILS = ["duxiaoyu@fangjia.com"]
public static final def EMAILS = ["wangwenyan@fangjia.com"]
static Jms jms = Jms.create('tcp://jms.db.fangjia.com:61616');
@@ -24,16 +24,16 @@ class DistrictDataCoverBatch extends BaseBatch {
public DSCollection dsCollection = new DataStore("seaweed.db.fangjia.com", 27007).getCollection("fangjia.seaweed")
public DBCollection mongoColl = MongoUtils.getCollectionByName("fangjia", "district_facilitys", "mongo.db.fangjia.com")
public static final def EMAILS =[
"duxiaoyu@fangjia.com",
"ruanyadong@fangjia.com",
"xiamin@fangjia.com",
"zhutianli@fangjia.com",
"joe@fangjia.com",
"yukai@fangjia.com",
"jiangxiaochun@fangjia.com",
// "duxiaoyu@fangjia.com",
// "ruanyadong@fangjia.com",
// "xiamin@fangjia.com",
// "zhutianli@fangjia.com",
// "joe@fangjia.com",
// "yukai@fangjia.com",
// "jiangxiaochun@fangjia.com",
"gaojuan@fangjia.com",
"liuxingwang@fangjia.com",
"xiaohai@fangjia.com",
// "liuxingwang@fangjia.com",
// "xiaohai@fangjia.com",
]
static def FIELDS_MAP = [
@@ -33,10 +33,7 @@ class DistrictFieldCoverBatch extends BaseBatch {
final static String coverDomain = "mongo.db.fangjia.com"
final static String datastoreDomain = "seaweed.db.fangjia.com"
final static def emails = [
"duxiaoyu@fangjia.com",
"joe@fangjia.com", "yukai@fangjia.com", "yanzhou@fangjia.com",
"gaojuan@fangjia.com", "yuanyadong@fangjia.com", "liuxingwang@fangjia.com",
"xiamin@fangjia.com", "zhutianli@fangjia.com"
"gaojuan@fangjia.com"
]
// final static def emails = [
@@ -1,9 +1,10 @@
package com.fangjia.script.district
import com.fangjia.script.commData.CommonDatautils
import com.fangjia.script.util.MongoUtils
import com.mongodb.DBCursor
import org.apache.commons.lang3.StringUtils
import org.bson.types.ObjectId
import java.util.List
@@ -41,6 +42,19 @@ class DistrictHouseBatch extends BaseBatch {
@Override
public void process(Object args) {
// DBObject q = new BasicDBObject();
// q.put("_id", new ObjectId("6501174f6f5638447b264189"));
// def obj = CommonDatautils.getHouseDataStoreConnection().findOne(q)
// obj.put("c_date", new Date())
// CommonDatautils.getHouseDataStoreConnection().save(obj)
// CommonDatautils.getHouseDataStoreConnection().find(new BasicDBObject("districtname_key","新城帝景南区_武进_常州")).each{
// println(it)
// }
def cityList = cityList();
int c = 0
@@ -53,18 +67,28 @@ class DistrictHouseBatch extends BaseBatch {
Map<String, Long> rentCountMap = facetDistrictInHouse("rent", city);
println c + "\t" + city + "\t" + "\tsn:" + sn + "\t" + districts.size() + "\t" + DateUtil.formatToTightYYYYMMDDhhmmss(new Date())
for(DBObject district : districts) {
String key = district.get("name").toString().trim() + "_" + district.get("region") + "_" + district.get("city")
long sellCount = sellCountMap.get(key) ? sellCountMap.get(key) : 0
long rentCount = rentCountMap.get(key) ? rentCountMap.get(key) : 0
if(district.alias != null){
for(String alia: district.alias){
if(StringUtils.isNotBlank(alia)){
key = alia.trim() + "_" + district.get("region") + "_" + district.get("city")
sellCount = sellCount + (sellCountMap.get(key)? sellCountMap.get(key) : 0)
rentCount = rentCount + (rentCountMap.get(key)? rentCountMap.get(key) : 0)
def names = []
names << district.name
if(district.alias && districts.size()>0){
for(def name : district.alias){
if(!names.contains(name)){
names << name
}
}
}
long sellCount = 0
long rentCount = 0
for(def name : names){
String key = name.toString().trim() + "_" + district.get("region") + "_" + district.get("city")
if(!sellCount){
sellCount = sellCountMap.get(key) ? sellCountMap.get(key) : 0
}
if(!rentCount){
rentCount = rentCountMap.get(key) ? rentCountMap.get(key) : 0
}
}
saveToDistrictHouse(district.get('city'), district.get("region"), district.get("name"), sellCount, rentCount, sn)
}
@@ -85,6 +109,7 @@ class DistrictHouseBatch extends BaseBatch {
sellQuery.put('$facet', facet)
sellQuery.put('city', city)
sellQuery.put('cat',cat)
// sellQuery.put("district_name","新城帝景南区")
// sellQuery.put('visible',0)
DSCursor sellDSCursor = SEABIRD.find(sellQuery).skip(0).limit(0)
List<FacetResult> sellFacetResult = sellDSCursor.getFacetResults();
@@ -120,13 +145,13 @@ class DistrictHouseBatch extends BaseBatch {
fields.put("region", 1)
fields.put("name", 1)
fields.put("alias", 1)
def ret = []
DBObject q = new BasicDBObject()
q.put('city', city)
q.put('cat', 'district')
q.put('visible', 0)
// q.put("name","新城帝景")
DSCursor cur = SEAWEED.find(q, fields).batchSize(2000)
Iterator<DBObject> iter = cur.iterator()
@@ -29,9 +29,7 @@ class EvaluationFieldProcent extends BaseBatch{
public static final DBCollection EVALUA_COLL = MongoUtils.getCollectionByName("fangjia", "evaluation", "mongo.db.fangjia.com")
public static final DBCollection EVALUA_COVER_COLL = MongoUtils.getCollectionByName("fangjia", "evaluation_field_coverage", "mongo.db.fangjia.com")
final static def emails = ["xiaohai@fangjia.com","jiangxiaochun@fangjia.com","limingmin@fangjia.com","duxiaoyu@fangjia.com",
"joe@fangjia.com", "yukai@fangjia.com", "gaojuan@fangjia.com", "yuanyadong@fangjia.com",
"xiamin@fangjia.com", "zhutianli@fangjia.com"]
final static def emails = [ "gaojuan@fangjia.com"]
@@ -30,7 +30,7 @@ class FjtAnalyCrawlerIp extends BaseBatch{
public static final def lineUrl = "mongodb://developer:G00IDCDEV12385@mongo.db.fangjia.com:28017";
public static final DBCollection addressMatchLogColl = MongoUtils.getCollectionByName2("fangjia", "address_match_log", lineUrl)
final static def emails = ["gaojuan@fangjia.com","jiangxiaochun@fangjia.com","duxiaoyu@fangjia.com","wangwenyan@fangjia.com","luxuping@fangjia.com","yaojiayi@fangjia.com"]
final static def emails = ["gaojuan@fangjia.com"]
static Jms jms = Jms.create('tcp://jms.db.fangjia.com:61616');
static main(args) {
@@ -39,7 +39,7 @@ class DBHelper {
static final emailsGroup0 = ['gaojuan@fangjia.com'];
static final emailsFangjiaWang = ['all.list@fangjia.com'];
static final mobilesYanzhou = ['13621626685'];
static final emailsYanzhou = ['duxiaoyu@fangjia.com'];
static final emailsYanzhou = ['wangwenyan@fangjia.com'];
static List<String> getCityNames(){
DBObject dbObject = new BasicDBObject("status",0);
@@ -3,9 +3,9 @@ package com.fangjia.script.wenyan
public enum Watcher {
//ÔÚְͬÊÂ
DuXiaoYu('13621626685', 'duxiaoyu@fangjia.com'),
DuXiaoYu('13621626685', 'wangwenyan@fangjia.com'),
WangWenYan('13916076378','wangwenyan@fangjia.com'),
Tomzhao('15021021464','zhaoshumao@fangjia.com'),
Tomzhao('15021021464','wangwenyan@fangjia.com'),
GaoJuan('15021384995','gaojuan@fangjia.com');
private final String mobile;
@@ -1,51 +1,11 @@
package com.fangjia.script.wenyan.test
import com.aliyuncs.DefaultAcsClient
import com.aliyuncs.IAcsClient
import com.aliyuncs.address_purification.model.v20191118.GetAddressSimilarityRequest
import com.aliyuncs.address_purification.model.v20191118.GetAddressSimilarityResponse
import com.aliyuncs.profile.DefaultProfile
import com.fangjia.core.util.HttpRequest
import com.fangjia.script.util.ExcelUtils
import net.sf.json.JSONObject
def strt(String addr){
}
ExcelUtils.modify("D:\\nextcloud\\数据\\地址类服务测试\\建行地址相似度评级测试.xlsx",{List item->
def city = item["A"]
def address1 = item["B"]
def address2 = item["C"]
HttpRequest http = new HttpRequest()
def params = new HashMap()
params["city"] = city
params["address_1"] = address1
params["address_2"] = address2
params["token"]= "F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"
JSONObject json = http.getJsonContent("http://open.fangjia.com/address/similarity", params, "UTF-8")
JSONObject result = json.result
item["D"] = result?.level
item["E"] = result?.formattedAddress_1
item["F"] = result?.formattedAddress_2
item["G"] = result?.isSameAddress
DefaultProfile profile = DefaultProfile.getProfile(
"cn-hangzhou",
"LTAIdaj4eSO79gzz",
"xw6EsvqydZ9HC6zAvIB3ruQqVHynxf");
IAcsClient client = new DefaultAcsClient(profile);
GetAddressSimilarityRequest request = new GetAddressSimilarityRequest();
request.setServiceCode("addrp")
request.setAppKey("Xcgtyhupey0h")
request.setText("${address1};${address2}")
GetAddressSimilarityResponse response = client.getAcsResponse(request)
String data = response.getData()
json = JSONObject.fromObject(data)
item["H"] = json["sim_level"]["level"]
item["I"] = json["sim_level"]["address_a"]
item["J"] = json["sim_level"]["address_b"]
item["K"] = json["sim_level"]["is_same"]
println(json)
})
import com.fangjia.datastore.driver.DSCollection
import com.fangjia.datastore.driver.DataStore
import com.fangjia.script.util.DbUtils
import com.mongodb.BasicDBObject
DSCollection seabird = new DataStore("192.168.0.38", 27007).getCollection("fangjia.seaweed")
seabird.find(DbUtils.buildSeaweedQuery("³£ÖÝ", "äàÑô", "ÎáÔù㳡").append("if_sell", 1)).each {
println(it)
}