jdk版本升级,数据跑完后,需还原
This commit is contained in:
@@ -17,8 +17,8 @@
|
|||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>2.3.2</version>
|
<version>2.3.2</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<source>1.6</source>
|
<source>8</source>
|
||||||
<target>1.6</target>
|
<target>8</target>
|
||||||
<encoding>GBK</encoding>
|
<encoding>GBK</encoding>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
@@ -170,5 +170,11 @@
|
|||||||
<artifactId>json</artifactId>
|
<artifactId>json</artifactId>
|
||||||
<version>RELEASE</version>
|
<version>RELEASE</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<version>1.18.20</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
+53
-18
@@ -379,7 +379,7 @@ class TestEvaluation {
|
|||||||
cat = 6
|
cat = 6
|
||||||
}
|
}
|
||||||
def date = new Date()
|
def date = new Date()
|
||||||
rets << [d['E'], dist.city, dist.region, dist.name, dist.address,buildType,d['I'], d['J'].toString().toDouble().toInteger(), lng, lat, d['F'], date, date, cat, d['K'].toString().toDouble().toInteger()]
|
rets << [d['E'], dist.city, dist.region, dist.name, dist.address,buildType,d['I'], d['J'].toString().toDouble().toInteger(), lng, lat, d['F'], date, date, cat, d['K'].toString().toDouble().toInteger(), 2]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},1)
|
},1)
|
||||||
@@ -388,11 +388,11 @@ class TestEvaluation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
def addDataToDB(rows){
|
def addDataToDB(rows){
|
||||||
def sqlstring = "insert into evaluation(user_id, city, region, district_name, address, build_type, house_area, total_price, lng, lat, org_code, create_time, update_time, cat, unit_price ) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
|
def sqlstring = "insert into evaluation(user_id, city, region, district_name, address, build_type, house_area, total_price, lng, lat, org_code, create_time, update_time, cat, unit_price,report_type,average_price ) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"
|
||||||
|
|
||||||
sql.withBatch(1, sqlstring){ ps->
|
sql.withBatch(1, sqlstring){ ps->
|
||||||
for(def r : rows) {
|
for(def r : rows) {
|
||||||
ps.addBatch(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8], r[9], r[10], r[11], r[12], r[13], r[14])
|
ps.addBatch(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], r[8], r[9], r[10], r[11], r[12], r[13], r[14], r[15],r[14])
|
||||||
ps.toString()
|
ps.toString()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -404,7 +404,9 @@ class TestEvaluation {
|
|||||||
|
|
||||||
def detailList = ExcelUtils.read("D:\\数据\\宏信息\\宏信房源台账-基准价-详情.xlsx", 0 , 1)
|
def detailList = ExcelUtils.read("D:\\数据\\宏信息\\宏信房源台账-基准价-详情.xlsx", 0 , 1)
|
||||||
ExcelUtils.modify("D:\\数据\\宏信息\\宏信项目-最终.xlsx", { d ->
|
ExcelUtils.modify("D:\\数据\\宏信息\\宏信项目-最终.xlsx", { d ->
|
||||||
if (d['G']) {
|
if (d['G'] && d['L'] && d['L'].toString().toDouble().toInteger()>=3472507) {
|
||||||
|
def rows = findEvaluationIdExists(d['L'].toString().toDouble().toInteger())
|
||||||
|
if(!rows){
|
||||||
def dist = CommonDatautils.findDistrictById(d['G'])
|
def dist = CommonDatautils.findDistrictById(d['G'])
|
||||||
if (dist) {
|
if (dist) {
|
||||||
def ret = []
|
def ret = []
|
||||||
@@ -419,13 +421,21 @@ class TestEvaluation {
|
|||||||
def minPrice = null
|
def minPrice = null
|
||||||
def maxPrice = null
|
def maxPrice = null
|
||||||
if(avgPrice){
|
if(avgPrice){
|
||||||
minPrice = (int)(avgPrice - avgPrice * 0.1)
|
minPrice = avgPrice
|
||||||
maxPrice = (int)(avgPrice + avgPrice * 0.1)
|
maxPrice = (int)(avgPrice + avgPrice * 0.1)
|
||||||
}
|
}
|
||||||
houses = OpenApiClient.newHouseAction(dist.city, dist.region, dist.name, propertyType.toString(), minPrice, maxPrice, 5)
|
houses = OpenApiClient.newHouseAction(dist.city, dist.region, dist.name, propertyType.toString(), minPrice, maxPrice, 5)
|
||||||
|
|
||||||
|
if(houses.size()<5){
|
||||||
|
if(avgPrice){
|
||||||
|
minPrice = avgPrice
|
||||||
|
maxPrice = (int)(avgPrice + avgPrice * 0.2)
|
||||||
|
}
|
||||||
|
houses = OpenApiClient.newHouseAction(dist.city, dist.region, dist.name, propertyType.toString(), minPrice, maxPrice, 15)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(houses){
|
if(houses){
|
||||||
ret << houses
|
ret << createHouse(houses)
|
||||||
}else{
|
}else{
|
||||||
ret << []
|
ret << []
|
||||||
}
|
}
|
||||||
@@ -440,15 +450,21 @@ class TestEvaluation {
|
|||||||
ret << new Date()
|
ret << new Date()
|
||||||
ret << 1
|
ret << 1
|
||||||
ret << d['A']
|
ret << d['A']
|
||||||
ret << [createAttachment(detailList, d['G'], d['B'], dist)]
|
ret << createAttachment(detailList, d['G'], d['B'], dist)
|
||||||
|
// rets.add(ret)
|
||||||
|
saveEvaluationEditData(ret)
|
||||||
|
|
||||||
rets.add(ret)
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
def saveEvaluationEditData(r){
|
||||||
|
|
||||||
def sqlstring = "insert into evaluation_edit_data(evaluation_id, house_samples, market_analysis, custom_properties, company, create_time, update_time, validity_period, subject_name, attachments) values (?,?,?,?,?,?,?,?,?,?)"
|
def sqlstring = "insert into evaluation_edit_data(evaluation_id, house_samples, market_analysis, custom_properties, company, create_time, update_time, validity_period, subject_name, attachments) values (?,?,?,?,?,?,?,?,?,?)"
|
||||||
|
|
||||||
sql.withBatch(1, sqlstring){ ps->
|
sql.withBatch(1, sqlstring){ ps->
|
||||||
for(def r : rets) {
|
|
||||||
|
|
||||||
def houseSamplesJson = null
|
def houseSamplesJson = null
|
||||||
if (r[1]) {
|
if (r[1]) {
|
||||||
// 修复中文转义
|
// 修复中文转义
|
||||||
@@ -473,11 +489,9 @@ class TestEvaluation {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
def findEvaluationIdExists(evaluationId){
|
||||||
}
|
def query = "SELECT * FROM evaluation_edit_data WHERE evaluation_id = ? LIMIT 1"
|
||||||
});
|
return sql.firstRow(query, [evaluationId])
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def createTrend(price, name){
|
def createTrend(price, name){
|
||||||
@@ -509,14 +523,24 @@ class TestEvaluation {
|
|||||||
def items = []
|
def items = []
|
||||||
for(def data : detailList){
|
for(def data : detailList){
|
||||||
if(data["I"]==id && type==data['D']){
|
if(data["I"]==id && type==data['D']){
|
||||||
def totalPrice = (int)(data['H'] * data['N'])
|
def totalPrice = 0
|
||||||
items << ["city":dist.city, "district":dist.region, "address":data['B'], "area":data['H'], "unitPrice":data['N'].toString().toDouble().toInteger(), "totalPrice":totalPrice]
|
if (data['H'] && data['N']){
|
||||||
|
totalPrice = (int)(data['H'] * data['N'])
|
||||||
|
}
|
||||||
|
def unitPrice = 0
|
||||||
|
if(data['N']){
|
||||||
|
unitPrice = data['N'].toString().toDouble().toInteger()
|
||||||
|
}
|
||||||
|
items << ["city":dist.city, "district":dist.region, "address":data['B'], "area":data['H'], "unitPrice":unitPrice, "totalPrice":totalPrice]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(items.size()>1){
|
||||||
def time = new Date().getTime()
|
def time = new Date().getTime()
|
||||||
def resMap = ["id":"attachment_"+time, "title": "出售资产价格清单","type": 1,"editing": false,"items":items]
|
def resMap = ["id":"attachment_"+time, "title": "出售资产价格清单","type": 1,"editing": false,"items":items]
|
||||||
return resMap
|
return [resMap]
|
||||||
|
}
|
||||||
|
return []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -556,5 +580,16 @@ class TestEvaluation {
|
|||||||
return result.toString()
|
return result.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def createHouse(houses){
|
||||||
|
def rets = []
|
||||||
|
def i = 0
|
||||||
|
def time = new Date().getTime()
|
||||||
|
for(def h : houses){
|
||||||
|
def pdate = h.caseDate.replace("-","").substring(0,6)
|
||||||
|
rets << ["city":h.city, "district":h.district, "name":h.name, "publishDate":pdate, "unitPrice":h.unitPrice, "_uid":"sample_"+time+"_"+i,"source":h.source, "area":h.size, "distance":h.distance, "totalPrice":h.totalPrice]
|
||||||
|
i++
|
||||||
|
}
|
||||||
|
return rets;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-11
@@ -1617,20 +1617,20 @@ public class OpenApiClient {
|
|||||||
params.put("token", TOKEN);
|
params.put("token", TOKEN);
|
||||||
params.put("propertyType", propertyType)
|
params.put("propertyType", propertyType)
|
||||||
params.put("showSource", "1")
|
params.put("showSource", "1")
|
||||||
// if(minPrice){
|
if(minPrice){
|
||||||
// params.put("minPrice", minPrice)
|
params.put("minPrice", minPrice.toString())
|
||||||
// }
|
}
|
||||||
// if(maxPrice){
|
if(maxPrice){
|
||||||
// params.put("maxPrice", maxPrice)
|
params.put("maxPrice", maxPrice.toString())
|
||||||
// }
|
}
|
||||||
// if(pageSize){
|
if(pageSize){
|
||||||
// params.put("maxPrice", pageSize)
|
params.put("pageSize", pageSize.toString())
|
||||||
// }
|
}
|
||||||
|
|
||||||
String content = new HttpRequest().get("http://open.fangjia.com/property/sellCase", params, "utf-8")
|
String content = new HttpRequest().get("http://localhost:8080/property/sellCase", params, "utf-8")
|
||||||
JSONObject result = JSONObject.fromObject(content);
|
JSONObject result = JSONObject.fromObject(content);
|
||||||
while (result == null) {
|
while (result == null) {
|
||||||
result = HttpRequestUtil.getJsonContent("http://open.fangjia.com/property/sellCase", params, "utf-8")
|
result = HttpRequestUtil.getJsonContent("http://localhost:8080/property/sellCase", params, "utf-8")
|
||||||
println("${city} ${name} 程序调用异常")
|
println("${city} ${name} 程序调用异常")
|
||||||
Thread.sleep(6000)
|
Thread.sleep(6000)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user