修改系统bug
This commit is contained in:
+1
-1
@@ -2773,7 +2773,7 @@ public class AddressController {
|
|||||||
if(json.getInt("code")==200){
|
if(json.getInt("code")==200){
|
||||||
JSONObject resultJson = json.getJSONObject("result");
|
JSONObject resultJson = json.getJSONObject("result");
|
||||||
JSONObject searchAddress = resultJson.getJSONObject("searchAddress");
|
JSONObject searchAddress = resultJson.getJSONObject("searchAddress");
|
||||||
if(resultJson.getInt("credit")>0){
|
if(resultJson.getDouble("credit")>0){
|
||||||
District district = districtService.findByNameAndAlias(resultJson.getString("city"), resultJson.getString("district"), resultJson.getString("name"), "district");
|
District district = districtService.findByNameAndAlias(resultJson.getString("city"), resultJson.getString("district"), resultJson.getString("name"), "district");
|
||||||
if(district != null){
|
if(district != null){
|
||||||
resultMap.put("riskLevel","A");
|
resultMap.put("riskLevel","A");
|
||||||
|
|||||||
+35
-9
@@ -1,16 +1,42 @@
|
|||||||
package com.fangjia.script.wenyan.temp
|
package com.fangjia.script.wenyan.temp
|
||||||
|
|
||||||
|
import com.fangjia.core.RegionData
|
||||||
|
import com.fangjia.core.util.MongoUtils
|
||||||
|
import com.fangjia.script.common.ServerAreaData
|
||||||
|
import com.fangjia.script.util.CommonUtils
|
||||||
import com.fangjia.script.util.DbUtils
|
import com.fangjia.script.util.DbUtils
|
||||||
|
import com.fangjia.script.util.ElasticUtils
|
||||||
import com.fangjia.script.util.ExcelUtils
|
import com.fangjia.script.util.ExcelUtils
|
||||||
|
import com.fangjia.script.util.OpenApiClient
|
||||||
import com.mongodb.BasicDBObject
|
import com.mongodb.BasicDBObject
|
||||||
|
import net.sf.json.JSONObject
|
||||||
|
|
||||||
def data = [["城市", "区域", "小区名", "别名", "地址", "地址别名"]]
|
//city_sell_stat = MongoUtils.getDbCollection("fangjia_stat", "city_sell_stat")
|
||||||
["ID", "北京", "重庆", "哈尔滨"].each {def city->
|
//data = [["城市", "202101", "202106"]]
|
||||||
DbUtils.seaweed.find(DbUtils.buildSeaweedQuery(city)).each {BasicDBObject district->
|
//CommonUtils.findAllCity().each {def city->
|
||||||
def item = [district._id.toString(), district.city, district.region, district.name, district.alias?.join(","), district.address, district.addr_alias?.join(",")]
|
// BasicDBObject serverArea = ServerAreaData.getServerAreaByDisplay(city)
|
||||||
println(item)
|
// if(!serverArea.ranking || !serverArea.ranking.toString().contains("县级行政单位")){
|
||||||
data << item
|
// BasicDBObject pre = city_sell_stat.findOne(new BasicDBObject("city", city).append("date", 202101))
|
||||||
|
// BasicDBObject now = city_sell_stat.findOne(new BasicDBObject("city", city).append("date", 202106))
|
||||||
|
// println([serverArea.display, pre?.avg_price, now?.avg_price])
|
||||||
|
// data << [serverArea.display, pre?.avg_price, now?.avg_price]
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
//ExcelUtils.write("D:\\城市均价数据.xlsx", data, "城市均价")
|
||||||
|
|
||||||
|
//ExcelUtils.multiThreadingModify("C:\\Users\\wenyan\\Downloads\\经纬度错误数据修正.xlsx",{List item->
|
||||||
|
// String city = item["B"]
|
||||||
|
// String region = RegionData.formatRegion(city, item["D"])
|
||||||
|
// String sql = "select count(1) as count from latest_seawater where cat='sell' and city='${item["B"]}' and region='${region}' and district_name='${item["F"]}'"
|
||||||
|
// ElasticUtils.executeSqlQuery(sql,{Map result->
|
||||||
|
// item["P"] = result.get("count")
|
||||||
|
// })
|
||||||
|
// println(item)
|
||||||
|
//})
|
||||||
|
ExcelUtils.multiThreadingModify("D:\\Users\\wenyan\\Desktop\\装修案例.xlsx",{List item->
|
||||||
|
JSONObject json = OpenApiClient.addressMatch("西安", item["H"], "property", false, item["C"])
|
||||||
|
if(json.name){
|
||||||
|
item["I"] = json.district
|
||||||
|
item["J"] = json.name
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
ExcelUtils.write("D:\\待抓取小区.xlsx", data, "数据")
|
|
||||||
+3
-3
@@ -11,8 +11,8 @@ import org.bson.Document
|
|||||||
import static com.mongodb.client.model.Filters.*
|
import static com.mongodb.client.model.Filters.*
|
||||||
|
|
||||||
MongoCollection<Document> OPEN_URI_LOG = Mongo3Utils.getDbCollection(Constants.SEAWATER_MONGO_URI, "business", "open_uri_log")
|
MongoCollection<Document> OPEN_URI_LOG = Mongo3Utils.getDbCollection(Constants.SEAWATER_MONGO_URI, "business", "open_uri_log")
|
||||||
def startDate = DateUtil.parseDate("20210501", "yyyyMMdd")
|
def startDate = DateUtil.parseDate("20210901", "yyyyMMdd")
|
||||||
def endDate = DateUtil.parseDate("20210601", "yyyyMMdd")
|
def endDate = DateUtil.parseDate("20211001", "yyyyMMdd")
|
||||||
Calendar calendar = Calendar.getInstance()
|
Calendar calendar = Calendar.getInstance()
|
||||||
calendar.setTime(startDate)
|
calendar.setTime(startDate)
|
||||||
def count = 0
|
def count = 0
|
||||||
@@ -22,7 +22,7 @@ while (startDate.before(endDate)) {
|
|||||||
calendar.add(Calendar.DATE, 1)
|
calendar.add(Calendar.DATE, 1)
|
||||||
def nextDate = calendar.getTime()
|
def nextDate = calendar.getTime()
|
||||||
count++
|
count++
|
||||||
OPEN_URI_LOG.find(and(eq("user_id", "1007757"), eq("request_uri", "/property/detail"), eq("data_status", 1), lt("c_date", nextDate), gte("c_date", startDate))).each { Document doc ->
|
OPEN_URI_LOG.find(and(eq("user_id", "1007705"), eq("request_uri", "/property/detail"), eq("data_status", 1), lt("c_date", nextDate), gte("c_date", startDate))).each { Document doc ->
|
||||||
def result = JSONObject.fromObject(doc.res_map.result)
|
def result = JSONObject.fromObject(doc.res_map.result)
|
||||||
if (!hashSet.contains(result)) {
|
if (!hashSet.contains(result)) {
|
||||||
def item = ["60a3202c0b42a00001aad385", "qlkjgx", doc.ip, doc.request_uri, doc.c_date.format("yyyy-MM-dd HH:mm:ss"), doc.data_status, doc.code, doc.msg, JSONObject.fromObject(doc.parameter_map).toString(), result.toString()]
|
def item = ["60a3202c0b42a00001aad385", "qlkjgx", doc.ip, doc.request_uri, doc.c_date.format("yyyy-MM-dd HH:mm:ss"), doc.data_status, doc.code, doc.msg, JSONObject.fromObject(doc.parameter_map).toString(), result.toString()]
|
||||||
|
|||||||
+2
-2
@@ -11,8 +11,8 @@ import org.bson.Document
|
|||||||
import static com.mongodb.client.model.Filters.*
|
import static com.mongodb.client.model.Filters.*
|
||||||
|
|
||||||
MongoCollection<Document> OPEN_URI_LOG = Mongo3Utils.getDbCollection(Constants.SEAWATER_MONGO_URI, "business", "open_uri_log")
|
MongoCollection<Document> OPEN_URI_LOG = Mongo3Utils.getDbCollection(Constants.SEAWATER_MONGO_URI, "business", "open_uri_log")
|
||||||
def startDate = DateUtil.parseDate("20210601", "yyyyMMdd")
|
def startDate = DateUtil.parseDate("20210901", "yyyyMMdd")
|
||||||
def endDate = DateUtil.parseDate("20210701", "yyyyMMdd")
|
def endDate = DateUtil.parseDate("20211001", "yyyyMMdd")
|
||||||
Calendar calendar = Calendar.getInstance()
|
Calendar calendar = Calendar.getInstance()
|
||||||
calendar.setTime(startDate)
|
calendar.setTime(startDate)
|
||||||
def count = 0
|
def count = 0
|
||||||
|
|||||||
+13
-12
@@ -261,15 +261,16 @@ import org.dom4j.io.SAXReader
|
|||||||
// data << [dbo.parameter_map.city, dbo.parameter_map.address, dbo.res_map.result.province, dbo.res_map.result.city, dbo.res_map.result.district, dbo.res_map.result.developmentZone, dbo.res_map.result.township, dbo.res_map.result.street,dbo.res_map.result.streetNumber,dbo.res_map.result.name,dbo.res_map.result.buildingNumber,dbo.res_map.result.unitNumber,dbo.res_map.result.roomNumber,dbo.res_map.result.formattedAddress]
|
// data << [dbo.parameter_map.city, dbo.parameter_map.address, dbo.res_map.result.province, dbo.res_map.result.city, dbo.res_map.result.district, dbo.res_map.result.developmentZone, dbo.res_map.result.township, dbo.res_map.result.street,dbo.res_map.result.streetNumber,dbo.res_map.result.name,dbo.res_map.result.buildingNumber,dbo.res_map.result.unitNumber,dbo.res_map.result.roomNumber,dbo.res_map.result.formattedAddress]
|
||||||
//}
|
//}
|
||||||
//ExcelUtils.write("D:\\建行测试地址.xlsx", data, "结果")
|
//ExcelUtils.write("D:\\建行测试地址.xlsx", data, "结果")
|
||||||
DBCollection SQMETRE_RENT_COLL = MongoUtils.getCollectionByName("fangjia", "sqmetre_rent", "mongo.db.fangjia.com")
|
//DBCollection SQMETRE_RENT_COLL = MongoUtils.getCollectionByName("fangjia", "sqmetre_rent", "mongo.db.fangjia.com")
|
||||||
def query = new BasicDBObject()
|
//def query = new BasicDBObject()
|
||||||
query.cat = "region"
|
//query.cat = "region"
|
||||||
query.city= "上海"
|
//query.city= "上海"
|
||||||
query.weekend = Date.parse("yyyyMMdd", "20210228")
|
//query.weekend = Date.parse("yyyyMMdd", "20210228")
|
||||||
def doc = []
|
//def doc = []
|
||||||
def prices = []
|
//def prices = []
|
||||||
SQMETRE_RENT_COLL.find(query, new BasicDBObject("region", 1).append("avg_price", 1)).each {
|
//SQMETRE_RENT_COLL.find(query, new BasicDBObject("region", 1).append("avg_price", 1)).each {
|
||||||
doc.add(new BasicDBObject("name", it.region+"区").append("value", it.avg_price))
|
// doc.add(new BasicDBObject("name", it.region+"区").append("value", it.avg_price))
|
||||||
prices << it.avg_price
|
// prices << it.avg_price
|
||||||
}
|
//}
|
||||||
println(JSONArray.fromObject(doc).toString())
|
//println(JSONArray.fromObject(doc).toString())
|
||||||
|
DbUtils.seaweed.remove(new BasicDBObject("_id", DbUtils.seaweed.findById("6103bf1c64baf60001e7e1d0")._id))
|
||||||
-1
@@ -912,7 +912,6 @@ public class EvaluationRateServiceImpl implements EvaluationRateService {
|
|||||||
evaluatePrice = (long) (evaluatePrice * houseFloorRate);
|
evaluatePrice = (long) (evaluatePrice * houseFloorRate);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
int mid = evaluation.getHeight()/2;
|
int mid = evaluation.getHeight()/2;
|
||||||
double num = getFloorRate(mid, flag);
|
double num = getFloorRate(mid, flag);
|
||||||
evaluatePrice = (long) (evaluatePrice * num * houseFloorRate);
|
evaluatePrice = (long) (evaluatePrice * num * houseFloorRate);
|
||||||
|
|||||||
Reference in New Issue
Block a user