融合时间修改
This commit is contained in:
+67
-17
@@ -45,6 +45,56 @@ DBCollection POLYLINECOLL = MongoUtils.getCollectionByAuth20190102("fangjia_craw
|
|||||||
def offlineUrl = "mongodb://developer:G00IDCDEV12385@192.168.0.136:28017";
|
def offlineUrl = "mongodb://developer:G00IDCDEV12385@192.168.0.136:28017";
|
||||||
def DBCollection youda_esfhouse_coll = MongoUtils.getCollectionByName2("business", "res_esfdealprice", offlineUrl)
|
def DBCollection youda_esfhouse_coll = MongoUtils.getCollectionByName2("business", "res_esfdealprice", offlineUrl)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def citys = ['苏州','杭州','宁波','温州','嘉兴','湖州','绍兴','金华','衢州','舟山','台州','丽水']
|
||||||
|
|
||||||
|
def cityCodeDataMap = CcbCommonUtils.findCityCodeValue()
|
||||||
|
def rets = []
|
||||||
|
for(def c : citys){
|
||||||
|
def citycode = cityCodeDataMap.get(c)
|
||||||
|
def datas = findAllData(sqlInstance236, citycode)
|
||||||
|
def totalCount = datas.size()
|
||||||
|
def landareaCount = 0;
|
||||||
|
def buildareaCount = 0
|
||||||
|
def greeningrateCount = 0
|
||||||
|
def plotratioCount = 0
|
||||||
|
for(def m : datas){
|
||||||
|
if(m.landarea){
|
||||||
|
landareaCount ++
|
||||||
|
}
|
||||||
|
if(m.buildarea){
|
||||||
|
buildareaCount++
|
||||||
|
}
|
||||||
|
if(m.greeningrate){
|
||||||
|
greeningrateCount++
|
||||||
|
}
|
||||||
|
if(m.plotratio){
|
||||||
|
plotratioCount++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def landAreaPre = landareaCount*100/totalCount
|
||||||
|
def buildAreaPre = buildareaCount*100/totalCount
|
||||||
|
def greeningratePre = greeningrateCount*100/totalCount
|
||||||
|
def plotratioPre = plotratioCount*100/totalCount
|
||||||
|
rets << [c, totalCount, landAreaPre, buildAreaPre, greeningratePre, plotratioPre]
|
||||||
|
}
|
||||||
|
|
||||||
|
ExcelUtils.write("D:\\数据\\建行\\测试\\12城覆盖率统计.xlsx",rets, "覆盖率")
|
||||||
|
|
||||||
|
def findAllData(sqlInstance236, citycode){
|
||||||
|
def sql = "select landarea,buildarea,greeningrate,plotratio from bigdata_community_fjw where cityid='${citycode}'"
|
||||||
|
def rets = []
|
||||||
|
sqlInstance236.eachRow(sql,{r->
|
||||||
|
rets << ["landarea":r.landarea, "buildarea":r.buildarea, "greeningrate":r.greeningrate, "plotratio":r.plotratio]
|
||||||
|
});
|
||||||
|
return rets
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
////def url = "https://sh.anjuke.com"
|
////def url = "https://sh.anjuke.com"
|
||||||
////def s = DataHandleUtils.findMatchPattern(name, "https://\\w+.anjuke.com")
|
////def s = DataHandleUtils.findMatchPattern(name, "https://\\w+.anjuke.com")
|
||||||
////println s
|
////println s
|
||||||
@@ -447,23 +497,23 @@ def DBCollection youda_esfhouse_coll = MongoUtils.getCollectionByName2("business
|
|||||||
////},0)
|
////},0)
|
||||||
//
|
//
|
||||||
|
|
||||||
ExcelUtils.multiThreadingModify("D:\\数据\\建行\\二期\\252个城市删除小区.xlsx",{d->
|
//ExcelUtils.multiThreadingModify("D:\\数据\\建行\\二期\\252个城市删除小区.xlsx",{d->
|
||||||
if(d['A']){
|
// if(d['A']){
|
||||||
def dbo = CommonDatautils.findDistrictById(d['D'])
|
// def dbo = CommonDatautils.findDistrictById(d['D'])
|
||||||
if(dbo){
|
// if(dbo){
|
||||||
def udata = new BasicDBObject()
|
// def udata = new BasicDBObject()
|
||||||
// udata.put("name_cat", 11)
|
//// udata.put("name_cat", 11)
|
||||||
udata.put("status", 1)
|
// udata.put("status", 1)
|
||||||
udata.put("m_date",new Date())
|
// udata.put("m_date",new Date())
|
||||||
|
//
|
||||||
def q = new BasicDBObject()
|
// def q = new BasicDBObject()
|
||||||
q.put("_id", dbo._id)
|
// q.put("_id", dbo._id)
|
||||||
DbUtils.seaweed.update(q, new BasicDBObject('$set', udata))
|
// DbUtils.seaweed.update(q, new BasicDBObject('$set', udata))
|
||||||
}else{
|
// }else{
|
||||||
println dbo._id.toString() +" 没找到"
|
// println dbo._id.toString() +" 没找到"
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
},0)
|
//},0)
|
||||||
|
|
||||||
//def citys = ["海口","三亚","三沙","五指山","琼海","儋州","文昌","万宁","东方","定安","屯昌","澄迈","临高","白沙","昌江","乐东","陵水","保亭","琼中"]
|
//def citys = ["海口","三亚","三沙","五指山","琼海","儋州","文昌","万宁","东方","定安","屯昌","澄迈","临高","白沙","昌江","乐东","陵水","保亭","琼中"]
|
||||||
//for(def c : citys){
|
//for(def c : citys){
|
||||||
|
|||||||
+29
-25
@@ -26,35 +26,37 @@ class ExportDistrictRongHeTest extends BaseBatch{
|
|||||||
@Override
|
@Override
|
||||||
void process(Object args) {
|
void process(Object args) {
|
||||||
citys = CcbCommonUtils.getRunningCitys(args)
|
citys = CcbCommonUtils.getRunningCitys(args)
|
||||||
def curDate = "20221110"//DateUtils.formatDateByPattern(new Date()+1, "yyyyMMdd")
|
def curDate = "20221210"//DateUtils.formatDateByPattern(new Date()+1, "yyyyMMdd")
|
||||||
def new_dists = []//["350604","350605","410307","410308","450181"]
|
def new_dists = []//["350604","350605","410307","410308","450181"]
|
||||||
//按天导(每天一个文件夹)
|
//按天导(每天一个文件夹)
|
||||||
// exportBigdataDealFJW2(curDate, DateUtils.formatDateByPattern(DateUtils.getFirstDayOfMonth(new Date()+1,-1), "yyyy-MM-dd"), new_dists)
|
// exportBigdataDealFJW2(curDate, DateUtils.formatDateByPattern(DateUtils.getFirstDayOfMonth(new Date()+1,-1), "yyyy-MM-dd"), new_dists)
|
||||||
|
|
||||||
// if(curDate.toString().endsWith("10")){
|
// if(curDate.toString().endsWith("10")){
|
||||||
|
|
||||||
// exportBigdataBuildprojFjw()
|
exportBigdataBuildprojFjw()
|
||||||
// exportBigdataCommlayoutpicFjw()
|
exportBigdataCommlayoutpicFjw()
|
||||||
// exportEvaluateRate()
|
exportEvaluateRate()
|
||||||
//
|
|
||||||
// exportBigdataCommunityGJRH()//
|
|
||||||
// exportBigdataBuildingFJW()//
|
|
||||||
// exportBigdataCommfeeGj()//
|
|
||||||
//
|
|
||||||
// exportBigdataCommbuildstruGJ()//
|
|
||||||
// exportBigdataCommhousetypeGJ()//
|
|
||||||
// exportBigdataCommbuildyearGj()//
|
|
||||||
// exportBigdataCommhouseuseGJ()//
|
|
||||||
// exportBigdataPositionGJ()//
|
|
||||||
// exportBigdataDistrictFJW()//
|
|
||||||
// exportBigdataAliasFJW()//
|
|
||||||
|
|
||||||
// def queryDate = DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM").toInteger()
|
exportBigdataCommunityGJRH()//
|
||||||
// exportBigdataCityPrice(queryDate)
|
exportBigdataBuildingFJW()//
|
||||||
// exportBigdataDistPrice(queryDate)
|
exportBigdataCommfeeGj()//
|
||||||
// exportBigdataCommPrice(queryDate)
|
|
||||||
|
|
||||||
exportInOk()
|
exportBigdataCommbuildstruGJ()//
|
||||||
|
exportBigdataCommhousetypeGJ()//
|
||||||
|
exportBigdataCommbuildyearGj()//
|
||||||
|
exportBigdataCommhouseuseGJ()//
|
||||||
|
exportBigdataPositionGJ()//
|
||||||
|
exportBigdataDistrictFJW()//
|
||||||
|
exportBigdataAliasFJW()//
|
||||||
|
|
||||||
|
|
||||||
|
//本12.10上传10,11月所有数据,23年1月需改为所有城市按日期同步一期数据
|
||||||
|
def queryDate = DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM").toInteger()
|
||||||
|
exportBigdataCityPrice(queryDate)
|
||||||
|
exportBigdataDistPrice(queryDate)
|
||||||
|
exportBigdataCommPrice(queryDate)
|
||||||
|
|
||||||
|
exportInOk()
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@@ -469,7 +471,7 @@ class ExportDistrictRongHeTest extends BaseBatch{
|
|||||||
stop = true
|
stop = true
|
||||||
}
|
}
|
||||||
FileUtils.batchCreateFile(allRows, fileName, [], "utf-8", false);
|
FileUtils.batchCreateFile(allRows, fileName, [], "utf-8", false);
|
||||||
CcbFtpTestUtils.ftpUpload("rh", fileName, curDate)
|
CcbFtpTestUtils.ftpUpload("ccb_ronghe", fileName, curDate)
|
||||||
println "BIGDATA_DEAL_FJW 上传Ftp完成......${curStartStr}"
|
println "BIGDATA_DEAL_FJW 上传Ftp完成......${curStartStr}"
|
||||||
def curEndStr = DateUtils.add(curStartStr, 1)
|
def curEndStr = DateUtils.add(curStartStr, 1)
|
||||||
curStartDateStr = curEndStr
|
curStartDateStr = curEndStr
|
||||||
@@ -751,7 +753,9 @@ class ExportDistrictRongHeTest extends BaseBatch{
|
|||||||
def allRows = []
|
def allRows = []
|
||||||
for(def city : citys) {
|
for(def city : citys) {
|
||||||
def cityCode = cityCodeMap.get(city)
|
def cityCode = cityCodeMap.get(city)
|
||||||
def sql = "select CITYID, YMID, SALEPRICE,RENTPRICE,SALECOUNT,RENTCOUNT, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME, HOUSEUSE,SALEBLDGAREA,RENTBLDGAREA,SALETOTALPRICE,RENTTOTALPRICE,DATATYPE,SDATERANGE,RDATERANGE,SOURCECODE from BIGDATA_CITYPRICE where CITYID='${cityCode}' and YMID=${queryDate}";//
|
// def sql = "select CITYID, YMID, SALEPRICE,RENTPRICE,SALECOUNT,RENTCOUNT, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME, HOUSEUSE,SALEBLDGAREA,RENTBLDGAREA,SALETOTALPRICE,RENTTOTALPRICE,DATATYPE,SDATERANGE,RDATERANGE,SOURCECODE from BIGDATA_CITYPRICE where CITYID='${cityCode}' and YMID=${queryDate}";//
|
||||||
|
def sql = "select CITYID, YMID, SALEPRICE,RENTPRICE,SALECOUNT,RENTCOUNT, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME, HOUSEUSE,SALEBLDGAREA,RENTBLDGAREA,SALETOTALPRICE,RENTTOTALPRICE,DATATYPE,SDATERANGE,RDATERANGE,SOURCECODE from BIGDATA_CITYPRICE where CITYID='${cityCode}'";//
|
||||||
|
|
||||||
sqlInstance.eachRow(sql,{r->
|
sqlInstance.eachRow(sql,{r->
|
||||||
def data = []
|
def data = []
|
||||||
data << r.CITYID
|
data << r.CITYID
|
||||||
@@ -797,7 +801,7 @@ class ExportDistrictRongHeTest extends BaseBatch{
|
|||||||
def allRows = []
|
def allRows = []
|
||||||
for(def city : citys) {
|
for(def city : citys) {
|
||||||
def cityCode = cityCodeMap.get(city)
|
def cityCode = cityCodeMap.get(city)
|
||||||
def sql = "select CITYID,DISTID, YMID, SALEPRICE,RENTPRICE,SALECOUNT,RENTCOUNT, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME, HOUSEUSE,SALEBLDGAREA,RENTBLDGAREA,SALETOTALPRICE,RENTTOTALPRICE,DATATYPE,SDATERANGE,RDATERANGE,SOURCECODE from BIGDATA_DISTPRICE where CITYID='${cityCode}' and YMID=${queryDate} ";//
|
def sql = "select CITYID,DISTID, YMID, SALEPRICE,RENTPRICE,SALECOUNT,RENTCOUNT, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME, HOUSEUSE,SALEBLDGAREA,RENTBLDGAREA,SALETOTALPRICE,RENTTOTALPRICE,DATATYPE,SDATERANGE,RDATERANGE,SOURCECODE from BIGDATA_DISTPRICE where CITYID='${cityCode}'";// and YMID=${queryDate}
|
||||||
sqlInstance.eachRow(sql,{r->
|
sqlInstance.eachRow(sql,{r->
|
||||||
def data = []
|
def data = []
|
||||||
data << r.CITYID
|
data << r.CITYID
|
||||||
@@ -844,7 +848,7 @@ class ExportDistrictRongHeTest extends BaseBatch{
|
|||||||
def allRows = []
|
def allRows = []
|
||||||
for(def city : citys) {
|
for(def city : citys) {
|
||||||
def cityCode = cityCodeMap.get(city)
|
def cityCode = cityCodeMap.get(city)
|
||||||
def sql = "select CITYID, YMID,COMMID, SALEPRICE,RENTPRICE,SALECOUNT,RENTCOUNT, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME, HOUSEUSE,SALEBLDGAREA,RENTBLDGAREA,SALETOTALPRICE,RENTTOTALPRICE,DATATYPE,SDATERANGE,RDATERANGE,SOURCECODE from BIGDATA_COMMPRICE where CITYID='${cityCode}' and YMID=${queryDate}";//
|
def sql = "select CITYID, YMID,COMMID, SALEPRICE,RENTPRICE,SALECOUNT,RENTCOUNT, to_char(UPDATETIME,'yyyy-mm-dd hh24:mi:ss') as UPDATETIME, HOUSEUSE,SALEBLDGAREA,RENTBLDGAREA,SALETOTALPRICE,RENTTOTALPRICE,DATATYPE,SDATERANGE,RDATERANGE,SOURCECODE from BIGDATA_COMMPRICE where CITYID='${cityCode}' ";// and YMID=${queryDate}
|
||||||
sqlInstance.eachRow(sql,{r->
|
sqlInstance.eachRow(sql,{r->
|
||||||
def data = []
|
def data = []
|
||||||
data << r.CITYID
|
data << r.CITYID
|
||||||
|
|||||||
Reference in New Issue
Block a user