导出时间修改
This commit is contained in:
+3
-3
@@ -23,7 +23,7 @@ class ExportOracleData {
|
||||
def run() {
|
||||
// def curMonth = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), 0, "yyyyMM"));
|
||||
def lastMonth = Integer.parseInt(DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyyMM"), -1, "yyyyMM"));
|
||||
def new_dists = ["350604","350605","410307","410308","450181"]
|
||||
def new_dists = []
|
||||
//不会变
|
||||
exportEvaluationRateData()
|
||||
exportBigdataPoiData()
|
||||
@@ -38,8 +38,8 @@ class ExportOracleData {
|
||||
exportCommunityBuileType()
|
||||
|
||||
exportThirdPartyPrice2(lastMonth, new_dists)
|
||||
exportBigdataForsale("2022-05-19", new_dists)
|
||||
exportBigdataDeal("2022-05-01", new_dists)
|
||||
exportBigdataForsale("2022-06-19", new_dists)
|
||||
exportBigdataDeal("2022-06-01", new_dists)
|
||||
|
||||
|
||||
//计算结果相关
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ class GuiDingPriceBatch extends BaseBatch{
|
||||
def distCodeMap = CcbCommonUtils.findAllDistrictCodeValue(city)
|
||||
|
||||
//添加自己库中的人工指导价
|
||||
def prices = CcbCommonUtils.findPersonPrice(city, "2022-05-1", "2022-06-1")
|
||||
def prices = CcbCommonUtils.findPersonPrice(city, "2022-06-1", "2022-07-21")
|
||||
if(prices){
|
||||
def distMap = getDistrictMap(city)
|
||||
def rets = createCityDatas(cityCodeDatas, distCodeMap, distMap, prices)
|
||||
|
||||
+21
-13
@@ -24,7 +24,7 @@ class LoadGuide {
|
||||
|
||||
def run(){
|
||||
// addName("D:\\数据\\建行\\房产估值\\人工指导价更新.xlsx")
|
||||
addPersonGuided("D:\\数据\\建行\\房产估值\\人工指导价更新.xlsx")
|
||||
addPersonGuided("D:\\数据\\建行\\房产估值\\指导价\\7月人工指导价.xlsx")
|
||||
// match("D:\\数据\\建行\\房产估值\\指导价\\西安指导价2-103.xlsx")
|
||||
|
||||
// saveDongGuangPrice("D:\\数据\\建行\\房产估值\\指导价\\东莞指导价218.xlsx")
|
||||
@@ -54,13 +54,13 @@ class LoadGuide {
|
||||
}
|
||||
|
||||
def addPersonGuided(filename){
|
||||
ExcelUtils.modify(filename, { d ->
|
||||
def city = d['B']
|
||||
ExcelUtils.modify(filename, { r ->
|
||||
def city = r['B']
|
||||
if(city){
|
||||
def cityCodeDatas = CcbCommonUtils.findCityCodeValue()
|
||||
|
||||
def distCodeMap = CcbCommonUtils.findAllDistrictCodeValue(city)
|
||||
createSql( d, cityCodeDatas, distCodeMap)
|
||||
createSql( r, cityCodeDatas, distCodeMap)
|
||||
}
|
||||
|
||||
})
|
||||
@@ -70,23 +70,31 @@ class LoadGuide {
|
||||
def id = new ObjectId()
|
||||
def commid = d['A']
|
||||
def cityId = cityCodeDatas.get(d['B'])
|
||||
def sampleRegion = d['C'].replace("街道","").replace("镇","")
|
||||
def distRegion = distCodeMap.get(sampleRegion)
|
||||
|
||||
def cityName = d['B']
|
||||
def distName = d['C']
|
||||
def commName = d['D']
|
||||
def price = d['E'].toDouble().toInteger()
|
||||
|
||||
def dist = CommonDatautils.findDistrict(cityName, sampleRegion, commName, "district")
|
||||
//def dist = CommonDatautils.findDistrict(cityName, sampleRegion, commName, "district")
|
||||
def dist = CommonDatautils.findDistrictById(commid)
|
||||
|
||||
if(dist){
|
||||
def createtime = DateUtils.formatDateByPattern(new Date(), "yyyy-MM-dd HH:mm:ss")
|
||||
def dealDate = DateUtils.formatDateByPattern(new Date(), "yyyy-MM-dd")
|
||||
|
||||
def sampleRegion = dist.region
|
||||
def distRegion = distCodeMap.get(sampleRegion)
|
||||
if(distRegion){
|
||||
def createtime = DateUtils.formatDateByPattern(new Date(), "yyyy-MM-dd HH:mm:ss")
|
||||
def dealDate = DateUtils.formatDateByPattern(new Date(), "yyyy-MM-dd")
|
||||
|
||||
def sql = "insert into guided_price_gj(ID,COMMID,COMMNAME,CITYID,CITYNAME,DISTID,DISTNAME,DEALDATE,AVG_PRICE,GUIDING_PERSON,REMARK,CREATETIME,UPDATETIME,SOURCECODE) VALUES " +
|
||||
"('${id.toString()}','${dist._id.toString()}', '${commName}','${cityId}','${cityName}','${distRegion.district_code}','${distName}',to_date('${dealDate}','yyyy-mm-dd'),${price},'房价网','',to_date('${createtime}','yyyy-mm-dd hh24:mi:ss'),to_date('${createtime}','yyyy-mm-dd hh24:mi:ss'),'FJW')"
|
||||
println sql
|
||||
sqlInstance.executeUpdate(sql)
|
||||
}else{
|
||||
println "区域未标准化"
|
||||
}
|
||||
|
||||
def sql = "insert into guided_price_gj(ID,COMMID,COMMNAME,CITYID,CITYNAME,DISTID,DISTNAME,DEALDATE,AVG_PRICE,GUIDING_PERSON,REMARK,CREATETIME,UPDATETIME,SOURCECODE) VALUES " +
|
||||
"('${id.toString()}','${dist._id.toString()}', '${commName}','${cityId}','${cityName}','${distRegion.district_code}','${distName}',to_date('${dealDate}','yyyy-mm-dd'),${price},'房价网','',to_date('${createtime}','yyyy-mm-dd hh24:mi:ss'),to_date('${createtime}','yyyy-mm-dd hh24:mi:ss'),'FJW')"
|
||||
println sql
|
||||
sqlInstance.executeUpdate(sql)
|
||||
}else{
|
||||
println " 没查到 "+commName
|
||||
}
|
||||
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package com.fangjia.script.ccbevaluation
|
||||
|
||||
import com.fangjia.script.util.DbUtils
|
||||
import com.mongodb.BasicDBObject
|
||||
import groovy.sql.Sql
|
||||
|
||||
class UpdateData {
|
||||
|
||||
static def sqlInstance = Sql.newInstance("jdbc:oracle:thin:@192.168.0.236:1521:orcl",
|
||||
"GOOJIA", "GOOJIA", "oracle.jdbc.driver.OracleDriver")
|
||||
|
||||
static main(args) {
|
||||
def task = new UpdateData();
|
||||
task.run()
|
||||
}
|
||||
|
||||
def run(){
|
||||
def city = "¶«Ý¸"
|
||||
def cityCodeDataMap = CcbCommonUtils.findCityCodeValue()
|
||||
def dists = CcbCommonUtils.findAllDistrictByCity(city, "district", ["city","region", "name", "address","lat", "lng","all_area","build_area","virescence_percent","cubage_percent","car_site_count","finish_building_date","estate_type2","household_count","status","c_date","m_date","name_cat","quality"])
|
||||
println city +" Ð¡ÇøÁ¿£º"+dists.size()
|
||||
def commids = findOracleData(cityCodeDataMap.get(city))
|
||||
println "oracle ÊýÁ¿£º"+commids.size()
|
||||
def index = 0
|
||||
for(def dist : dists){
|
||||
if(!commids.contains(dist._id.toString()) && dist.quality){
|
||||
index ++
|
||||
|
||||
def udata = new BasicDBObject()
|
||||
udata.put("name_cat", 11)
|
||||
DbUtils.seaweed.update(new BasicDBObject('_id',dist._id),new BasicDBObject('$set', udata))
|
||||
}
|
||||
}
|
||||
println index
|
||||
}
|
||||
|
||||
def findOracleData(cityid){
|
||||
def sql = "select COMMID from bigdata_community_gj_test where cityId=${cityid} and status=0";
|
||||
def commIds = []
|
||||
sqlInstance.eachRow(sql,{r->
|
||||
commIds << r.COMMID
|
||||
});
|
||||
return commIds
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user