Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -78,7 +78,7 @@ class PoseidonOnce {
|
||||
// DBCursor cur = coll.find()
|
||||
// println cur.count()
|
||||
String url = "http://www.fangjia.com";
|
||||
DBCollection coll = MongoUtils.getCollectionByName("fangjia", "test2", "192.168.0.188")
|
||||
DBCollection coll = MongoUtils.getCollectionByName("fangjia", "FiveLevelTest", "192.168.0.188")
|
||||
// for(int i=426000;i<1000000;i++) {
|
||||
// String s = url + i + "_" + url.hashCode()
|
||||
// DBObject dbo = new BasicDBObject()
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ class MsbPocTest {
|
||||
// match(inputfile)
|
||||
// matchOld(inputfile)
|
||||
// addPrice("D:\\数据\\美术宝\\美术宝测试数据(价格).xlsx")
|
||||
// test("D:\\数据\\美术宝\\test2.xlsx")
|
||||
// test("D:\\数据\\美术宝\\FiveLevelTest.xlsx")
|
||||
|
||||
// cityPrice()
|
||||
// mergeMatchPrice("D:\\数据\\美术宝\\美术宝-新接口价格.xlsx")
|
||||
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
package com.fangjia.script.hubingliang
|
||||
|
||||
import com.fangjia.core.Constants
|
||||
import com.fangjia.core.util.DateUtil
|
||||
import groovy.sql.Sql
|
||||
|
||||
@@ -23,7 +24,7 @@ import com.mongodb.DBObject
|
||||
@BatchOwner(Watcher.Hubingliang)
|
||||
class ApiInvokeStatistics extends BaseBatch{
|
||||
final static def mongoDomain = "mongo.db.fangjia.com"
|
||||
public static final DBCollection OPEN_URI_LOG = MongoUtils.getCollectionByName("business", "open_uri_log", "seawater.mongo.db.fangjia.com", 27020)
|
||||
public static final DBCollection OPEN_URI_LOG = com.fangjia.core.util.MongoUtils.getDbCollection(Constants.SEAWATER_MONGO_URI,"business", "open_uri_log")
|
||||
public static final DBCollection OPEN_URI_LOG_COUNT = MongoUtils.getCollectionByName("business", "api_invoke_statistical", "mongo.db.fangjia.com", 27017)
|
||||
static final dbFangjia = Sql.newInstance("jdbc:mysql://mysql.db.fangjia.com:4306/fangjia?autoReconnect=true&characterEncoding=utf-8&autoReconnect=true", "sa", "G00jia", "com.mysql.jdbc.Driver");
|
||||
static main(args) {
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
package com.fangjia.script.majintao
|
||||
|
||||
import com.fangjia.core.util.HttpRequest
|
||||
import com.fangjia.script.util.ExcelUtils
|
||||
import net.sf.json.JSONObject
|
||||
|
||||
|
||||
String excelFilePath = "F:\\估家\\文件\\北交所\\testcopy1.xlsx";
|
||||
ExcelUtils.removeEmptyRow(excelFilePath)
|
||||
ExcelUtils.singleThreadingModify(excelFilePath, { List items ->
|
||||
|
||||
String comprehensiveUrl = "http://localhost:9180/comprehensiveQuery/houseValueInformation";
|
||||
String communityUrl = "http://open.fangjia.com/addrSvc/avgPrice";
|
||||
String valueUrl = "http://open.fangjia.com/property/addressEvaluate";
|
||||
String caseUrl = "http://open.fangjia.com/house/case";
|
||||
String poiUrl = "http://open.fangjia.com/district/addrFacilitys";
|
||||
|
||||
HttpRequest httpRequest = new HttpRequest();
|
||||
map = new HashMap<String, String>()
|
||||
|
||||
String city = items['A']
|
||||
String address = items['B']
|
||||
double size = items['C']
|
||||
|
||||
System.out.println(city + "---" + address + "----" + size);
|
||||
|
||||
map.put("city", city)
|
||||
map.put("address", address)
|
||||
map.put("size", size.toString())
|
||||
map.put("strctureArea", size.toString())
|
||||
map.put("token", "F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB")
|
||||
|
||||
if (!address.contains("%")) {
|
||||
// 发送HTTP请求
|
||||
long start
|
||||
long end
|
||||
|
||||
// start = System.currentTimeMillis();
|
||||
// httpRequest.getJsonContent(communityUrl, map, "UTF-8")
|
||||
//
|
||||
//
|
||||
// end = System.currentTimeMillis();
|
||||
// items['D'] = String.valueOf(end - start);
|
||||
//
|
||||
// start = System.currentTimeMillis();
|
||||
// httpRequest.getJsonContent(valueUrl, map, "UTF-8")
|
||||
// end = System.currentTimeMillis();
|
||||
// items['E'] = String.valueOf(end - start);
|
||||
//
|
||||
// start = System.currentTimeMillis();
|
||||
// httpRequest.getJsonContent(caseUrl, map, "UTF-8")
|
||||
// end = System.currentTimeMillis();
|
||||
// items['F'] = String.valueOf(end - start);
|
||||
//
|
||||
// start = System.currentTimeMillis();
|
||||
// httpRequest.getJsonContent(poiUrl, map, "UTF-8")
|
||||
// end = System.currentTimeMillis();
|
||||
// items['G'] = String.valueOf(end - start);
|
||||
|
||||
start = System.currentTimeMillis();
|
||||
def content = httpRequest.getJsonContent(comprehensiveUrl, map, "UTF-8")
|
||||
end = System.currentTimeMillis();
|
||||
items['H'] = String.valueOf(end - start);
|
||||
println content.get("msg")
|
||||
if(content.get("msg").contains("该地址不支持估价!")) {
|
||||
items['I'] = "该地址不支持估价!"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
import org.bson.types.ObjectId
|
||||
|
||||
a = new ObjectId()
|
||||
print(a)
|
||||
+2
-1
@@ -1,5 +1,6 @@
|
||||
package com.fangjia.script.openApi
|
||||
|
||||
import com.fangjia.core.Constants
|
||||
import groovy.sql.Sql;
|
||||
import java.util.regex.Matcher
|
||||
import java.util.regex.Pattern
|
||||
@@ -24,7 +25,7 @@ import com.fangjia.script.Watcher
|
||||
class OpenApiLogAnalyBatch extends BaseBatch{
|
||||
|
||||
|
||||
static DBCollection OPEN_URI_LOG_COLL = MongoUtils.getCollectionByName("business", "open_uri_log", "seawater.mongo.db.fangjia.com",27020);
|
||||
static DBCollection OPEN_URI_LOG_COLL = com.fangjia.core.util.MongoUtils.getDbCollection(Constants.SEAWATER_MONGO_URI,"business", "open_uri_log")
|
||||
static DBCollection OPEN_URI_ANALY_COLL = MongoUtils.getCollectionByName("business", "open_uri_analy", "mongo.db.fangjia.com");
|
||||
final Sql USER_CONN = Sql.newInstance("jdbc:mysql://mysql.db.fangjia.com:4306/fangjia?useUnicode=true&characterEncoding=utf-8&autoReconnect=true", "sa", "G00jia", "com.mysql.jdbc.Driver")
|
||||
|
||||
|
||||
+3
-2
@@ -16,6 +16,7 @@ import org.apache.commons.lang.StringUtils
|
||||
import org.elasticsearch.action.bulk.BulkProcessor
|
||||
import org.elasticsearch.action.index.IndexRequest
|
||||
import java.util.concurrent.TimeUnit
|
||||
import com.fangjia.core.Constants
|
||||
|
||||
/**
|
||||
* 功能说明:
|
||||
@@ -24,7 +25,7 @@ import java.util.concurrent.TimeUnit
|
||||
class AnalysisOpenUriLogSyncBatch extends BaseBatch {
|
||||
|
||||
|
||||
DBCollection OPEN_URI_LOG_COLL = MongoUtils.getCollectionByName("business", "open_uri_log", "192.168.0.206",27020)
|
||||
DBCollection OPEN_URI_LOG_COLL = com.fangjia.core.util.MongoUtils.getDbCollection(Constants.SEAWATER_MONGO_URI,"business", "open_uri_log")
|
||||
static final def SQL = Sql.newInstance("jdbc:mysql://mysql.db.fangjia.com:4306/goojia_fangjia?&characterEncoding=utf8", "sa", "G00jia", "com.mysql.jdbc.Driver");
|
||||
|
||||
|
||||
@@ -53,7 +54,7 @@ class AnalysisOpenUriLogSyncBatch extends BaseBatch {
|
||||
void process(Object args) {
|
||||
|
||||
Map userInfo = getUserInfo()
|
||||
def startDate = DateUtil.truncateDay(DateUtil.add(new Date(), -3))
|
||||
def startDate = DateUtil.truncateDay(DateUtil.add(new Date(), -30))
|
||||
def endDate = DateUtil.truncateDay(new Date())
|
||||
BasicDBObject query = new BasicDBObject()
|
||||
query.append("c_date", new BasicDBObject('$gte', startDate).append('$lt', endDate))
|
||||
|
||||
+6
-18
@@ -1,28 +1,16 @@
|
||||
package com.fangjia.script.trade
|
||||
|
||||
|
||||
import java.util.regex.Matcher
|
||||
|
||||
package com.fangjia.script.sync
|
||||
|
||||
import com.fangjia.core.Constants
|
||||
import com.fangjia.script.BaseBatch;
|
||||
import com.fangjia.script.BatchOwner
|
||||
import com.fangjia.script.util.DateUtils;
|
||||
|
||||
import java.util.regex.Pattern
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import com.fangjia.core.util.StringUtil;
|
||||
import com.fangjia.datastore.driver.DSCollection;
|
||||
import com.fangjia.datastore.driver.DSCursor
|
||||
import com.fangjia.datastore.driver.DataStore
|
||||
import com.fangjia.script.util.DateUtils
|
||||
import com.mongodb.BasicDBObject
|
||||
import com.mongodb.DBCollection;
|
||||
import com.mongodb.DBObject
|
||||
import com.fangjia.script.util.MongoUtils;
|
||||
import com.fangjia.core.util.MongoUtils;
|
||||
import com.fangjia.script.Watcher;
|
||||
import com.mongodb.Bytes
|
||||
import org.apache.commons.io.FileUtils
|
||||
|
||||
/**
|
||||
* ½«ÏßÉÏopen uriÊý¾Ýͬ²½µ½192.168.0.60ÉÏ
|
||||
* @author gaojuan
|
||||
@@ -31,7 +19,7 @@ import org.apache.commons.io.FileUtils
|
||||
class CopyOpenUriLog extends BaseBatch{
|
||||
|
||||
|
||||
static DBCollection DESC_OPEN = MongoUtils.getCollectionByName("business", "open_uri_log", "seawater.mongo.db.fangjia.com", 27020)
|
||||
static DBCollection DESC_OPEN = MongoUtils.getDbCollection(Constants.SEAWATER_MONGO_URI, "business", "open_uri_log")
|
||||
public static final DBCollection SOURCE_OPEN = MongoUtils.getCollectionByName("business", "open_uri_log", "log.mongo.db.fangjia.com", 52002)
|
||||
static main(String[] args){
|
||||
runBatch(new CopyOpenUriLog(), args)
|
||||
@@ -43,15 +43,15 @@ class Test {
|
||||
|
||||
static main(args) {
|
||||
// String test1 = " qwdwqd ssss ";
|
||||
// String test2 = " qwdwqd ss";
|
||||
// String FiveLevelTest = " qwdwqd ss";
|
||||
// String test3 = "qwdwqd dd";
|
||||
//
|
||||
// test1 = test1.replaceAll(" |\\s+", " ");
|
||||
// test2 = test2.replaceAll(" |\\s+", " ");
|
||||
// FiveLevelTest = FiveLevelTest.replaceAll(" |\\s+", " ");
|
||||
// test3 = test3.replaceAll(" |\\s+", " ");
|
||||
//
|
||||
// String[] arrs1 = test1.split("\\s+")
|
||||
// String[] arrs2 = test2.split("\\s+")
|
||||
// String[] arrs2 = FiveLevelTest.split("\\s+")
|
||||
// String[] arrs3 = test3.split("\\s+")
|
||||
//
|
||||
// println arrs1
|
||||
|
||||
Reference in New Issue
Block a user