jdk版本升级,数据跑完后,需还原
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.fangjia</groupId>
|
<groupId>com.fangjia</groupId>
|
||||||
<artifactId>fangjia-core</artifactId>
|
<artifactId>fangjia-core</artifactId>
|
||||||
@@ -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>
|
||||||
@@ -105,15 +105,15 @@
|
|||||||
<version>3.5.0</version>
|
<version>3.5.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.sourceforge.pinyin4j</groupId>
|
<groupId>net.sourceforge.pinyin4j</groupId>
|
||||||
<artifactId>pinyin4j</artifactId>
|
<artifactId>pinyin4j</artifactId>
|
||||||
<version>2.5.0</version>
|
<version>2.5.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.ibm.icu</groupId>
|
<groupId>com.ibm.icu</groupId>
|
||||||
<artifactId>icu4j</artifactId>
|
<artifactId>icu4j</artifactId>
|
||||||
<version>3.4.4</version>
|
<version>3.4.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.sf.json-lib</groupId>
|
<groupId>net.sf.json-lib</groupId>
|
||||||
<artifactId>json-lib</artifactId>
|
<artifactId>json-lib</artifactId>
|
||||||
@@ -155,11 +155,11 @@
|
|||||||
<artifactId>hanlp</artifactId>
|
<artifactId>hanlp</artifactId>
|
||||||
<version>portable-1.6.6</version>
|
<version>portable-1.6.6</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.codehaus.jackson</groupId>
|
<groupId>org.codehaus.jackson</groupId>
|
||||||
<artifactId>jackson-mapper-asl</artifactId>
|
<artifactId>jackson-mapper-asl</artifactId>
|
||||||
<version>1.9.13</version>
|
<version>1.9.13</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba.nacos</groupId>
|
<groupId>com.alibaba.nacos</groupId>
|
||||||
<artifactId>nacos-client</artifactId>
|
<artifactId>nacos-client</artifactId>
|
||||||
@@ -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>
|
||||||
|
|||||||
+108
-73
@@ -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,80 +404,94 @@ 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 dist = CommonDatautils.findDistrictById(d['G'])
|
def rows = findEvaluationIdExists(d['L'].toString().toDouble().toInteger())
|
||||||
if (dist) {
|
if(!rows){
|
||||||
def ret = []
|
def dist = CommonDatautils.findDistrictById(d['G'])
|
||||||
ret << d['L'].toString().toDouble().toInteger()
|
if (dist) {
|
||||||
def houses = []
|
def ret = []
|
||||||
if(["住宅","别墅","公寓"].contains(d["B"])){
|
ret << d['L'].toString().toDouble().toInteger()
|
||||||
def propertyType = 0
|
def houses = []
|
||||||
if(d["B"] == "别墅"){
|
if(["住宅","别墅","公寓"].contains(d["B"])){
|
||||||
propertyType = 1
|
def propertyType = 0
|
||||||
|
if(d["B"] == "别墅"){
|
||||||
|
propertyType = 1
|
||||||
|
}
|
||||||
|
def avgPrice = d['K']
|
||||||
|
def minPrice = null
|
||||||
|
def maxPrice = null
|
||||||
|
if(avgPrice){
|
||||||
|
minPrice = avgPrice
|
||||||
|
maxPrice = (int)(avgPrice + avgPrice * 0.1)
|
||||||
|
}
|
||||||
|
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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
def avgPrice = d['K']
|
if(houses){
|
||||||
def minPrice = null
|
ret << createHouse(houses)
|
||||||
def maxPrice = null
|
}else{
|
||||||
if(avgPrice){
|
ret << []
|
||||||
minPrice = (int)(avgPrice - avgPrice * 0.1)
|
}
|
||||||
maxPrice = (int)(avgPrice + avgPrice * 0.1)
|
if(d['K']){
|
||||||
|
ret << createTrend(d['K'].toString().toDouble().toInteger(), d['A'])
|
||||||
|
}else{
|
||||||
|
ret << '{"trendSvg":""}'
|
||||||
}
|
}
|
||||||
houses = OpenApiClient.newHouseAction(dist.city, dist.region, dist.name, propertyType.toString(), minPrice, maxPrice, 5)
|
|
||||||
}
|
|
||||||
if(houses){
|
|
||||||
ret << houses
|
|
||||||
}else{
|
|
||||||
ret << []
|
ret << []
|
||||||
|
ret << "上海宏信建设发展有限公司"
|
||||||
|
ret << new Date()
|
||||||
|
ret << new Date()
|
||||||
|
ret << 1
|
||||||
|
ret << d['A']
|
||||||
|
ret << createAttachment(detailList, d['G'], d['B'], dist)
|
||||||
|
// rets.add(ret)
|
||||||
|
saveEvaluationEditData(ret)
|
||||||
|
|
||||||
}
|
}
|
||||||
if(d['K']){
|
|
||||||
ret << createTrend(d['K'].toString().toDouble().toInteger(), d['A'])
|
|
||||||
}else{
|
|
||||||
ret << '{"trendSvg":""}'
|
|
||||||
}
|
|
||||||
ret << []
|
|
||||||
ret << "上海宏信建设发展有限公司"
|
|
||||||
ret << new Date()
|
|
||||||
ret << new Date()
|
|
||||||
ret << 1
|
|
||||||
ret << d['A']
|
|
||||||
ret << [createAttachment(detailList, d['G'], d['B'], dist)]
|
|
||||||
|
|
||||||
rets.add(ret)
|
|
||||||
|
|
||||||
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->
|
|
||||||
for(def r : rets) {
|
|
||||||
|
|
||||||
def houseSamplesJson = null
|
|
||||||
if (r[1]) {
|
|
||||||
// 修复中文转义
|
|
||||||
houseSamplesJson = fixUnicodeEscapes(JsonOutput.toJson(r[1]))
|
|
||||||
}
|
|
||||||
def marketAnalysisJson = null
|
|
||||||
if (r[2]) {
|
|
||||||
// 修复中文转义
|
|
||||||
marketAnalysisJson = fixUnicodeEscapes(JsonOutput.toJson(r[2]))
|
|
||||||
}
|
|
||||||
|
|
||||||
def customPropertiesJson = r[1] ? JsonOutput.toJson(r[3]) : null
|
|
||||||
def attachmentsJson = null
|
|
||||||
if(r[9]){
|
|
||||||
// 修复中文转义
|
|
||||||
attachmentsJson = fixUnicodeEscapes(JsonOutput.toJson(r[9]))
|
|
||||||
}
|
|
||||||
|
|
||||||
ps.addBatch(r[0], houseSamplesJson, marketAnalysisJson, customPropertiesJson, r[4], r[5], r[6], r[7], r[8], attachmentsJson)
|
|
||||||
ps.toString()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
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 (?,?,?,?,?,?,?,?,?,?)"
|
||||||
|
|
||||||
|
sql.withBatch(1, sqlstring){ ps->
|
||||||
|
def houseSamplesJson = null
|
||||||
|
if (r[1]) {
|
||||||
|
// 修复中文转义
|
||||||
|
houseSamplesJson = fixUnicodeEscapes(JsonOutput.toJson(r[1]))
|
||||||
|
}
|
||||||
|
def marketAnalysisJson = null
|
||||||
|
if (r[2]) {
|
||||||
|
// 修复中文转义
|
||||||
|
marketAnalysisJson = fixUnicodeEscapes(JsonOutput.toJson(r[2]))
|
||||||
|
}
|
||||||
|
|
||||||
|
def customPropertiesJson = r[1] ? JsonOutput.toJson(r[3]) : null
|
||||||
|
def attachmentsJson = null
|
||||||
|
if(r[9]){
|
||||||
|
// 修复中文转义
|
||||||
|
attachmentsJson = fixUnicodeEscapes(JsonOutput.toJson(r[9]))
|
||||||
|
}
|
||||||
|
|
||||||
|
ps.addBatch(r[0], houseSamplesJson, marketAnalysisJson, customPropertiesJson, r[4], r[5], r[6], r[7], r[8], attachmentsJson)
|
||||||
|
ps.toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
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]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def time = new Date().getTime()
|
if(items.size()>1){
|
||||||
def resMap = ["id":"attachment_"+time, "title": "出售资产价格清单","type": 1,"editing": false,"items":items]
|
def time = new Date().getTime()
|
||||||
return resMap
|
def resMap = ["id":"attachment_"+time, "title": "出售资产价格清单","type": 1,"editing": false,"items":items]
|
||||||
|
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