Merge remote-tracking branch 'origin/master'
This commit is contained in:
+6
-3
@@ -37,7 +37,9 @@ class SynchAdministrativeMappingDataBatch extends BaseBatch{
|
||||
//删除旧的,再同步新的
|
||||
ADMINISTRATIVE_MAPPING_COLL_100.remove(new BasicDBObject())
|
||||
|
||||
def dbcursor = ADMINISTRATIVE_MAPPING_COLL.find(new BasicDBObject()).batchSize(1000)
|
||||
def q = new BasicDBObject()
|
||||
// q.put("shape.type","MultiPolygon")
|
||||
def dbcursor = ADMINISTRATIVE_MAPPING_COLL.find(q).batchSize(1000)
|
||||
def datas = []
|
||||
def retMap = [:]
|
||||
for(def d : dbcursor){
|
||||
@@ -59,6 +61,7 @@ class SynchAdministrativeMappingDataBatch extends BaseBatch{
|
||||
|
||||
def synchToEs(retMap, host, indexName){
|
||||
QueryBuilder queryBuilder = QueryBuilders.boolQuery()
|
||||
// queryBuilder.must(QueryBuilders.termQuery("street", "喀拉玛盖镇"))
|
||||
def oldIds = new CopyOnWriteArrayList()
|
||||
|
||||
ElasticUtils89.queryUpdate(host, indexName, queryBuilder, { String id, doc->
|
||||
@@ -69,11 +72,11 @@ class SynchAdministrativeMappingDataBatch extends BaseBatch{
|
||||
if(!["id","_id","c_date","m_date","polyline_source","operator","city_simple_pinyin","prefecture_level_city"].contains(k)){
|
||||
def val = doc.get(k)
|
||||
if(val!=v){
|
||||
if(k!="shape" || (k=="shape" && v.type!="MultiPolygon")){
|
||||
// if(k!="shape" || (k=="shape" && v.type!="MultiPolygon")){
|
||||
println k +" 修改 "+id
|
||||
updateFieldCount++
|
||||
doc.put(k,v)
|
||||
}
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-2
@@ -35,7 +35,8 @@ class SynchDevDataBatch extends BaseBatch{
|
||||
}
|
||||
|
||||
def synchDevTo100(){
|
||||
def dbcursor = DEVELOPMENT_ZONE_43_COLL.find()
|
||||
def q = new BasicDBObject()
|
||||
def dbcursor = DEVELOPMENT_ZONE_43_COLL.find(q)
|
||||
def rets = []
|
||||
def devMap = [:]
|
||||
for(def r : dbcursor){
|
||||
@@ -87,7 +88,7 @@ class SynchDevDataBatch extends BaseBatch{
|
||||
QueryBuilder queryBuilder = QueryBuilders.boolQuery()
|
||||
def oldIds = new CopyOnWriteArrayList()
|
||||
|
||||
ElasticUtils89.executeQuery(host, indexName, queryBuilder, { String id, doc->
|
||||
ElasticUtils89.queryUpdate(host, indexName, queryBuilder, { String id, doc->
|
||||
oldIds << id
|
||||
def mongoObj = devMap.get(id)
|
||||
def updateFieldCount = 0
|
||||
|
||||
+22
@@ -30,6 +30,28 @@ class DingDingMessageUtil {
|
||||
}
|
||||
}
|
||||
|
||||
static void sendTextMessageAndAt(String access_token, String msg, String atMobile) throws Exception {
|
||||
HttpRequest request = new HttpRequest();
|
||||
HttpPost httppost = new HttpPost("https://oapi.dingtalk.com/robot/send?access_token=" + access_token);
|
||||
httppost.addHeader("Content-Type", "application/json; charset=utf-8");
|
||||
|
||||
// 创建消息体,只包含一个手机号
|
||||
String textMsg = "{ " +
|
||||
"\"msgtype\": \"text\", " +
|
||||
"\"text\": {\"content\": \"" + msg + "\"}, " +
|
||||
"\"at\": {\"atMobiles\": [\"" + atMobile + "\"]}" + // 只 @ 一个手机号
|
||||
"}";
|
||||
|
||||
StringEntity se = new StringEntity(textMsg, "utf-8");
|
||||
httppost.setEntity(se);
|
||||
HttpResponse response = request.getHttpClient().execute(httppost);
|
||||
|
||||
if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
|
||||
String result = EntityUtils.toString(response.getEntity(), "utf-8");
|
||||
System.out.println("消息发送结果:" + result);
|
||||
}
|
||||
}
|
||||
|
||||
static void sendMarkdownMessage(String access_token, String title, String msg){
|
||||
HttpRequest request = new HttpRequest()
|
||||
JSONObject requestBody = new JSONObject()
|
||||
|
||||
Reference in New Issue
Block a user