Merge branch 'script_gj' of http://gitlab.fangjia.com/dev0/main into script_gj
This commit is contained in:
+22
@@ -1,5 +1,6 @@
|
|||||||
package com.fangjia.script.fuzhou
|
package com.fangjia.script.fuzhou
|
||||||
|
|
||||||
|
import com.fangjia.core.util.DataUtil
|
||||||
import com.fangjia.script.BaseBatch
|
import com.fangjia.script.BaseBatch
|
||||||
import com.fangjia.script.BatchOwner
|
import com.fangjia.script.BatchOwner
|
||||||
import com.fangjia.script.Watcher
|
import com.fangjia.script.Watcher
|
||||||
@@ -118,6 +119,7 @@ class DistrictPriceExportBatch extends BaseBatch{
|
|||||||
def createNewDatas(def city){
|
def createNewDatas(def city){
|
||||||
def districts = null
|
def districts = null
|
||||||
def curDate = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM"));
|
def curDate = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM"));
|
||||||
|
def lastMonth = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -2, "yyyyMM"));
|
||||||
|
|
||||||
def day = new Date().getDate()
|
def day = new Date().getDate()
|
||||||
def startMDate = DateUtils.truncateDay(new Date()-1)
|
def startMDate = DateUtils.truncateDay(new Date()-1)
|
||||||
@@ -133,6 +135,8 @@ class DistrictPriceExportBatch extends BaseBatch{
|
|||||||
}
|
}
|
||||||
|
|
||||||
def curPriceMap = findFzDistrictSellStat("福州",curDate)
|
def curPriceMap = findFzDistrictSellStat("福州",curDate)
|
||||||
|
def lastPriceMap = findFzDistrictStat("福州",lastMonth)
|
||||||
|
|
||||||
def result = []
|
def result = []
|
||||||
for(def rMap : districts){
|
for(def rMap : districts){
|
||||||
def curPrice = 0
|
def curPrice = 0
|
||||||
@@ -141,6 +145,22 @@ class DistrictPriceExportBatch extends BaseBatch{
|
|||||||
if(curPriceMap.containsKey(rMap.get("_id").toString())){
|
if(curPriceMap.containsKey(rMap.get("_id").toString())){
|
||||||
dbo = curPriceMap.get(rMap.get("_id").toString())
|
dbo = curPriceMap.get(rMap.get("_id").toString())
|
||||||
curPrice = dbo.avg_price
|
curPrice = dbo.avg_price
|
||||||
|
|
||||||
|
def lastMonthPrice = lastPriceMap.get(rMap.get("_id").toString())
|
||||||
|
if(curPrice && lastMonthPrice){
|
||||||
|
if(dbo.value_type != 1){
|
||||||
|
def mom = (curPrice - lastMonthPrice)/lastMonthPrice
|
||||||
|
if(Math.abs(mom)*100>=6){
|
||||||
|
def randMarkup = nextDouble(2, 6)
|
||||||
|
if(mom < 0){
|
||||||
|
mom = DataUtil.roundDouble(randMarkup*(-1)/100, 4)
|
||||||
|
}else{
|
||||||
|
mom = DataUtil.roundDouble(randMarkup/100, 4)
|
||||||
|
}
|
||||||
|
curPrice = (int)(lastMonthPrice*mom + lastMonthPrice)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
curPrice = specialDistsPriceMap.get(rMap.name)
|
curPrice = specialDistsPriceMap.get(rMap.name)
|
||||||
if(curPrice){
|
if(curPrice){
|
||||||
@@ -177,6 +197,8 @@ class DistrictPriceExportBatch extends BaseBatch{
|
|||||||
m << "周边楼盘"
|
m << "周边楼盘"
|
||||||
}else if(dbo.value_type == 6){
|
}else if(dbo.value_type == 6){
|
||||||
m << "推导"
|
m << "推导"
|
||||||
|
}else if(dbo.value_type == 8) {
|
||||||
|
m << "新模型"
|
||||||
}else if(dbo.value_type == 9){
|
}else if(dbo.value_type == 9){
|
||||||
m << "神经网络"
|
m << "神经网络"
|
||||||
}else if(dbo.value_type == 10){
|
}else if(dbo.value_type == 10){
|
||||||
|
|||||||
@@ -739,6 +739,45 @@ class OpenApiUtils {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//源地址的完整性进行验证
|
||||||
|
static def addrVerifyNanjing(city, address, type){
|
||||||
|
address = URLEncoder.encode(address, "utf-8");
|
||||||
|
def url = "http://open.fangjia.com/addrSvc/njcbVillageIdentify?address=${address}&type=${type}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"
|
||||||
|
// def url = "http://localhost:8080/fangjia-open/addrSvc/njcbVillageIdentify?address=${address}&type=${type}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"
|
||||||
|
if(city){
|
||||||
|
url = url + "&city=${city}"
|
||||||
|
}
|
||||||
|
String content = new HttpRequest().get(url, "utf-8");
|
||||||
|
if(content){
|
||||||
|
def doc = new JsonSlurper().parseText(content)
|
||||||
|
if(doc && doc.code ==200 && doc.result){
|
||||||
|
def dtos = doc.result
|
||||||
|
return dtos
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static def addrVerifyXiameng(city, address, type){
|
||||||
|
address = URLEncoder.encode(address, "utf-8");
|
||||||
|
def url = "http://192.168.0.100:32080/FangJiaAddressService/v7/villageIdentify?address=${address}&type=${type}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"
|
||||||
|
// def url = "http://localhost:8080/fangjia-open/addrSvc/njcbVillageIdentify?address=${address}&type=${type}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"
|
||||||
|
if(city){
|
||||||
|
url = url + "&city=${city}"
|
||||||
|
}
|
||||||
|
String content = new HttpRequest().get(url, "utf-8");
|
||||||
|
if(content){
|
||||||
|
def doc = new JsonSlurper().parseText(content)
|
||||||
|
if(doc && doc.msgCode ==200 && doc.result){
|
||||||
|
def dtos = doc.result
|
||||||
|
return dtos
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
// 省、市、区、街道、社区居委、POI补全
|
// 省、市、区、街道、社区居委、POI补全
|
||||||
static def complete(city, address){
|
static def complete(city, address){
|
||||||
def url = "http://open.fangjia.com/addrSvc/complete?city=${city}&address=${address}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"
|
def url = "http://open.fangjia.com/addrSvc/complete?city=${city}&address=${address}&token=F54F52381C49BB9EB4A33EB1B65604AE4B71A28AEE53518A94A2F360408B9056D57553931D15CE6DDE765562DAD286BA38E05A4CDAFC51C3D527A4959BF8E75A3B95DB7108FCEA340DDE61925616DB55118E1851E67D83EAD800460D100D6B667A4ED8EE67C8F7FB"
|
||||||
|
|||||||
+16
-16
@@ -94,22 +94,22 @@ class DevProcess {
|
|||||||
|
|
||||||
def aiDevTown(){
|
def aiDevTown(){
|
||||||
ExcelUtils.multiThreadingModify("D:\\数据\\数据建设\\开发区\\河北省开发区-ai结果.xlsx", { d ->
|
ExcelUtils.multiThreadingModify("D:\\数据\\数据建设\\开发区\\河北省开发区-ai结果.xlsx", { d ->
|
||||||
// def res = FangjiaClientUtils.aiResult("河北省哪些乡镇街道完全隶属于"+d['E']+",有则以逗号隔开方式输出,无则输出无,其它信息不输出")
|
def res = FangjiaClientUtils.aiResult("河北省哪些乡镇街道完全隶属于"+d['E']+",有则以逗号隔开方式输出,无则输出无,其它信息不输出")
|
||||||
// def message = res.data.replaceAll("\n", "")
|
def message = res.data.replaceAll("\n", "")
|
||||||
// d['F'] = res.code
|
d['F'] = res.code
|
||||||
// d['G'] = message
|
d['G'] = message
|
||||||
// println d['E'] +" "+res.code + " "+message
|
println d['E'] +" "+res.code + " "+message
|
||||||
def q = new BasicDBObject("name", d['E']).append("type","乡镇街道")
|
// def q = new BasicDBObject("name", d['E']).append("type","乡镇街道")
|
||||||
def dbcursor = DEV_MAPPING_CONN.find(q)
|
// def dbcursor = DEV_MAPPING_CONN.find(q)
|
||||||
if(dbcursor.count()>0){
|
// if(dbcursor.count()>0){
|
||||||
def list = []
|
// def list = []
|
||||||
for(def db : dbcursor){
|
// for(def db : dbcursor){
|
||||||
list << db.township
|
// list << db.township
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
d['H']= list.join(",")
|
// d['H']= list.join(",")
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+48
@@ -0,0 +1,48 @@
|
|||||||
|
package com.fangjia.script.gj.village
|
||||||
|
|
||||||
|
import com.fangjia.script.gj.OpenApiUtils
|
||||||
|
import com.fangjia.script.util.ExcelUtils
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore
|
||||||
|
|
||||||
|
class NanjiangVillage {
|
||||||
|
static main(args) {
|
||||||
|
def task = new NanjiangVillage();
|
||||||
|
task.run()
|
||||||
|
}
|
||||||
|
|
||||||
|
def run(){
|
||||||
|
ExcelUtils.multiThreadingModify("D:\\数据\\南京银行\\县城清洗-结果.xlsx",{d->
|
||||||
|
|
||||||
|
if(!d['F']){
|
||||||
|
def dto = OpenApiUtils.addrVerifyNanjing(null, d['A'], 2)
|
||||||
|
if(dto){
|
||||||
|
// def dto = jsonObj.result
|
||||||
|
d['F'] = dto.province
|
||||||
|
d['G'] = dto.provinceCode
|
||||||
|
d['H'] = dto.city
|
||||||
|
d['I'] = dto.cityCode
|
||||||
|
d['J'] = dto.district
|
||||||
|
d['K'] = dto.districtCode
|
||||||
|
d['L'] = dto.town
|
||||||
|
d['M'] = dto.townCode
|
||||||
|
d['N'] = dto.committee
|
||||||
|
d['O'] = dto.committeeCode
|
||||||
|
d['P'] = dto.typeCode
|
||||||
|
d['Q'] = dto.typeName
|
||||||
|
d['R'] = dto.verifyFlag//涉农标识
|
||||||
|
d['S'] = dto.addrVerify//地址是否有效信息
|
||||||
|
d['T'] = dto.countyLevelCity//是否为县级市
|
||||||
|
d['U'] = dto.countyGov//是否为县政府
|
||||||
|
d['V'] = dto.addrArea //所属区域 农村区域 城市区域 县城城区(对公)
|
||||||
|
d['W'] = dto.devDistrict//是否为开发区
|
||||||
|
d['X'] = dto.devDistrictName//开发区
|
||||||
|
d['Y'] = dto.devLevel//开发区等级
|
||||||
|
d['Z']= dto.administrativeTowns;//是否市辖建制
|
||||||
|
d['AA'] = dto.prefectureLevelOrAbove ;// 是否为地级市以上行政区划
|
||||||
|
d['AB'] = dto.countyGovTown; //县政府所在镇
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
+17
@@ -32,6 +32,9 @@ class DistrictLevelBatch extends BaseBatch{
|
|||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void process(Object args) {
|
public void process(Object args) {
|
||||||
|
|
||||||
|
updateNoCommid() //修改没有小区id的数据
|
||||||
|
|
||||||
def keys = new BasicDBObject("comm_id", 1)
|
def keys = new BasicDBObject("comm_id", 1)
|
||||||
keys.put("city", 1)
|
keys.put("city", 1)
|
||||||
keys.put("region", 1)
|
keys.put("region", 1)
|
||||||
@@ -57,6 +60,20 @@ class DistrictLevelBatch extends BaseBatch{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def updateNoCommid(){
|
||||||
|
def q = new BasicDBObject()
|
||||||
|
q.put("comm_id", new BasicDBObject('$exists', false))
|
||||||
|
def dbcursor = ZS_LEVEL_CONN.find(q)
|
||||||
|
for(def dbo : dbcursor){
|
||||||
|
def dist = CommonDatautils.findDistrict(dbo.city, dbo.region, dbo.district_name, "district")
|
||||||
|
if(dist){
|
||||||
|
def udata = new BasicDBObject()
|
||||||
|
udata.put("comm_id", dist._id.toString())
|
||||||
|
ZS_LEVEL_CONN.update(new BasicDBObject("_id",dbo._id), new BasicDBObject('$set',udata))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
def addPriceData(dists, priceMap){
|
def addPriceData(dists, priceMap){
|
||||||
def newLists = []
|
def newLists = []
|
||||||
for(def d : dists){
|
for(def d : dists){
|
||||||
|
|||||||
Reference in New Issue
Block a user