+15
-28
@@ -8,6 +8,7 @@ import com.fangjia.script.Watcher
|
|||||||
import com.fangjia.script.commData.CommonDatautils
|
import com.fangjia.script.commData.CommonDatautils
|
||||||
import com.fangjia.script.gj.ccb.CcbCodeUtils
|
import com.fangjia.script.gj.ccb.CcbCodeUtils
|
||||||
import com.fangjia.script.gj.ccb.FileUtils
|
import com.fangjia.script.gj.ccb.FileUtils
|
||||||
|
import com.fangjia.script.gj.district.FangjiaClientUtils
|
||||||
import com.fangjia.script.util.DateUtils
|
import com.fangjia.script.util.DateUtils
|
||||||
import com.fangjia.script.util.ExcelUtils
|
import com.fangjia.script.util.ExcelUtils
|
||||||
import com.fangjia.script.util.OpenApiClient
|
import com.fangjia.script.util.OpenApiClient
|
||||||
@@ -175,38 +176,25 @@ class BigdataCommunityBatch extends BaseBatch{
|
|||||||
ret << "pa101"
|
ret << "pa101"
|
||||||
ret << ""
|
ret << ""
|
||||||
if(dist.address){
|
if(dist.address){
|
||||||
if(dist.address.toString().contains("弄")){
|
def jsonObj = null
|
||||||
String number = DataUtil.match(dist.address, Pattern.compile("\\d+弄"))
|
if(dist.address){
|
||||||
if(number){
|
jsonObj = FangjiaClientUtils.addressStructure(dist.city, dist.address)
|
||||||
ret << dist.address.toString().substring(0, dist.address.toString().indexOf(number))
|
}
|
||||||
ret << dist.address.toString().substring(dist.address.toString().indexOf(number), dist.address.toString().size())
|
if(jsonObj && jsonObj.street){
|
||||||
|
if(jsonObj.street){
|
||||||
|
ret << jsonObj.street
|
||||||
}else{
|
}else{
|
||||||
ret << ""
|
ret << ""
|
||||||
|
}
|
||||||
|
|
||||||
|
if(jsonObj.streetNumber){
|
||||||
|
ret << jsonObj.streetNumber
|
||||||
|
}else{
|
||||||
ret << ""
|
ret << ""
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
def jsonObj = null
|
ret << ""
|
||||||
if(dist.address){
|
ret << ""
|
||||||
// jsonObj = OpenApiClient.addressMatch(dist.city, dist.address, "property", false, dist.region, dist.name)
|
|
||||||
jsonObj = OpenApiClient.standard1Action(dist.city, dist.address)
|
|
||||||
}
|
|
||||||
if(jsonObj && jsonObj.street){
|
|
||||||
if(jsonObj.street){
|
|
||||||
ret << jsonObj.street
|
|
||||||
}else{
|
|
||||||
ret << ""
|
|
||||||
}
|
|
||||||
|
|
||||||
if(jsonObj.streetNumber){
|
|
||||||
ret << jsonObj.streetNumber
|
|
||||||
}else{
|
|
||||||
ret << ""
|
|
||||||
}
|
|
||||||
|
|
||||||
}else{
|
|
||||||
ret << ""
|
|
||||||
ret << ""
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
ret << ""
|
ret << ""
|
||||||
@@ -225,7 +213,6 @@ class BigdataCommunityBatch extends BaseBatch{
|
|||||||
println dist.city + " "+dist.name+" error"
|
println dist.city + " "+dist.name+" error"
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
-1
@@ -448,7 +448,6 @@ class BigdataForsaleBatch extends BaseBatch{
|
|||||||
if(!alias.contains(newName)){
|
if(!alias.contains(newName)){
|
||||||
alias << newName
|
alias << newName
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(alias && alias.size()>0){
|
if(alias && alias.size()>0){
|
||||||
|
|||||||
+8
@@ -3,6 +3,7 @@ package com.fangjia.script.ccbevaluation
|
|||||||
import com.fangjia.script.common.DataHandleUtils
|
import com.fangjia.script.common.DataHandleUtils
|
||||||
import com.fangjia.script.jiangnanblank.SFTP
|
import com.fangjia.script.jiangnanblank.SFTP
|
||||||
import com.jcraft.jsch.ChannelSftp
|
import com.jcraft.jsch.ChannelSftp
|
||||||
|
import com.jcraft.jsch.SftpATTRS
|
||||||
import org.apache.commons.codec.digest.DigestUtils
|
import org.apache.commons.codec.digest.DigestUtils
|
||||||
|
|
||||||
class CcbFtpUtils {
|
class CcbFtpUtils {
|
||||||
@@ -64,6 +65,13 @@ class CcbFtpUtils {
|
|||||||
return files
|
return files
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static def getFileLength(String path, String month){
|
||||||
|
sftpChannel = reConnect();
|
||||||
|
def size = sftp.getFileSize(ftpPath+ month+"/"+path, sftpChannel)
|
||||||
|
return size
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static main(args) {
|
static main(args) {
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+19
-19
@@ -30,24 +30,24 @@ class ExportOracleData {
|
|||||||
def lastMonthStr = DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyy-MM"), -1, "yyyy-MM")
|
def lastMonthStr = DateUtils.addMonth(DateUtils.formatDateByPattern(new Date(), "yyyy-MM"), -1, "yyyy-MM")
|
||||||
def new_dists = []
|
def new_dists = []
|
||||||
//不会变 10.25
|
//不会变 10.25
|
||||||
// exportEvaluationRateData()
|
exportEvaluationRateData()
|
||||||
// exportBigdataPoiData()//
|
exportBigdataPoiData()//
|
||||||
// exportBigdataDistrictData()//
|
exportBigdataDistrictData()//
|
||||||
//
|
|
||||||
// exportGuidedPrice()//随人工改变//
|
exportGuidedPrice()//随人工改变//
|
||||||
// exportCommunityGuidedPrice(lastMonth.toString()+"28")//随政策//
|
exportCommunityGuidedPrice(lastMonth.toString()+"28")//随政策//
|
||||||
//
|
|
||||||
//// //处理小区情况
|
// //处理小区情况
|
||||||
// exportBigdataCommunity()//
|
exportBigdataCommunity()//
|
||||||
// exportCommunityStaging()//没cityid
|
exportCommunityStaging()//没cityid
|
||||||
exportCommunityBuileType()//
|
exportCommunityBuileType()//
|
||||||
//
|
|
||||||
// exportThirdPartyPrice2(lastMonth, new_dists)//
|
exportThirdPartyPrice2(lastMonth, new_dists)//
|
||||||
// exportBigdataForsale(lastMonthStr +"-19", new_dists) //2022-07-19
|
exportBigdataForsale(lastMonthStr +"-19", new_dists) //2022-07-19
|
||||||
// exportBigdataDeal(lastMonthStr + "-01", new_dists) //2022-07-01
|
exportBigdataDeal(lastMonthStr + "-01", new_dists) //2022-07-01
|
||||||
//
|
|
||||||
// //第三方网站权重表
|
//第三方网站权重表
|
||||||
// exportWebsiteRate();
|
exportWebsiteRate();
|
||||||
//
|
//
|
||||||
//
|
//
|
||||||
// //计算结果相关
|
// //计算结果相关
|
||||||
@@ -229,8 +229,8 @@ class ExportOracleData {
|
|||||||
|
|
||||||
FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false);
|
FileUtils.batchCreateFile(allRows, fileName, headers, "utf-8", false);
|
||||||
println "BIGDATA_COMMBUILDTYPE_GJ 数据文件输出完成......"
|
println "BIGDATA_COMMBUILDTYPE_GJ 数据文件输出完成......"
|
||||||
// CcbFtpUtils.ftpUpload(null, fileName, curDate)
|
CcbFtpUtils.ftpUpload(null, fileName, curDate)
|
||||||
// println "BIGDATA_COMMBUILDTYPE_GJ 上传Ftp完成......"
|
println "BIGDATA_COMMBUILDTYPE_GJ 上传Ftp完成......"
|
||||||
}
|
}
|
||||||
|
|
||||||
def exportBigdataDistrictData() {
|
def exportBigdataDistrictData() {
|
||||||
|
|||||||
+17
@@ -67,6 +67,7 @@ class FangjiaClientUtils {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//分词 省,市,区
|
||||||
public static def addressStand(def city, def address){
|
public static def addressStand(def city, def address){
|
||||||
def jsonObj = null
|
def jsonObj = null
|
||||||
def content = null
|
def content = null
|
||||||
@@ -84,6 +85,22 @@ class FangjiaClientUtils {
|
|||||||
return jsonObj;
|
return jsonObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//分词基础上的标准化,complete=false 不不全 short=true 省市区返回简拼
|
||||||
|
public static def addressStructure(def city, def address){
|
||||||
|
def jsonObj = null
|
||||||
|
def content = null
|
||||||
|
try {
|
||||||
|
address = address.replace("{","")
|
||||||
|
def url = "http://192.168.0.19:31080/FangJiaAddressService/structure/v2?address="+URLEncoder.encode(address,"UTF-8")+"&city="+URLEncoder.encode(city,"UTF-8")
|
||||||
|
content = new HttpRequest().newGet(url, null, "utf-8")
|
||||||
|
jsonObj = JSONObject.fromObject(content)
|
||||||
|
} catch (Exception e) {
|
||||||
|
println address +" "+content
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return jsonObj;
|
||||||
|
}
|
||||||
|
|
||||||
public static def arroundPrice(city,address){
|
public static def arroundPrice(city,address){
|
||||||
def jsonObj = null
|
def jsonObj = null
|
||||||
def content = null
|
def content = null
|
||||||
|
|||||||
@@ -209,4 +209,20 @@ class SFTP {
|
|||||||
return isDirExistFlag;
|
return isDirExistFlag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public long getFileSize(String srcSftpFilePath, ChannelSftp sftp) {
|
||||||
|
long fileSize;//文件大于等于0则存在
|
||||||
|
try {
|
||||||
|
SftpATTRS sftpATTRS = sftp.lstat(srcSftpFilePath);
|
||||||
|
fileSize = sftpATTRS.getSize();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace()
|
||||||
|
fileSize = -1;//获取文件大小异常
|
||||||
|
if (e.getMessage().toLowerCase().equals("no such file")) {
|
||||||
|
fileSize = -2;//文件不存在
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return fileSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -210,7 +210,7 @@ class ThirdDataToGatherBatch extends BaseBatch{
|
|||||||
DBObject udata = new BasicDBObject()
|
DBObject udata = new BasicDBObject()
|
||||||
// udata.put("level",d.level);
|
// udata.put("level",d.level);
|
||||||
// udata.put("last_price", d.last_price);
|
// udata.put("last_price", d.last_price);
|
||||||
udata.put("district_id", d._id.toString())
|
udata.put("seaweed_id", d._id.toString())
|
||||||
udata.put("fangjia_price", d.fangjia_price);
|
udata.put("fangjia_price", d.fangjia_price);
|
||||||
|
|
||||||
fieldMap.each{k,v->
|
fieldMap.each{k,v->
|
||||||
|
|||||||
@@ -364,6 +364,7 @@ public class OpenApiClient {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//此接口地址标准化,带补全
|
||||||
public static JSONObject standard1Action(String city, String address) {
|
public static JSONObject standard1Action(String city, String address) {
|
||||||
try {
|
try {
|
||||||
Map<String, String> params = new HashMap<String, String>();
|
Map<String, String> params = new HashMap<String, String>();
|
||||||
|
|||||||
Reference in New Issue
Block a user