优化写字楼接口
This commit is contained in:
+3
-3
@@ -532,7 +532,7 @@ public class OfficeController {
|
|||||||
}
|
}
|
||||||
model.setRegion(district.getRegion());
|
model.setRegion(district.getRegion());
|
||||||
model.setDistrictName(district.getName());
|
model.setDistrictName(district.getName());
|
||||||
|
model.setCity(district.getCity());
|
||||||
OfficeEvaluationDto evaluation = officeService.evaluateRent(district, buildEvaluation(model, request));
|
OfficeEvaluationDto evaluation = officeService.evaluateRent(district, buildEvaluation(model, request));
|
||||||
|
|
||||||
if (evaluation.getUnitPrice() != null && evaluation.getUnitPrice() != 0) {
|
if (evaluation.getUnitPrice() != null && evaluation.getUnitPrice() != 0) {
|
||||||
@@ -783,7 +783,7 @@ public class OfficeController {
|
|||||||
|
|
||||||
model.setRegion(district.getRegion());
|
model.setRegion(district.getRegion());
|
||||||
model.setDistrictName(district.getName());
|
model.setDistrictName(district.getName());
|
||||||
|
model.setCity(district.getCity());
|
||||||
OfficeEvaluationDto evaluation = officeService.evaluateRent(district, buildEvaluation(model, request));
|
OfficeEvaluationDto evaluation = officeService.evaluateRent(district, buildEvaluation(model, request));
|
||||||
|
|
||||||
if (evaluation.getUnitPrice() != null && evaluation.getUnitPrice() != 0) {
|
if (evaluation.getUnitPrice() != null && evaluation.getUnitPrice() != 0) {
|
||||||
@@ -865,7 +865,7 @@ public class OfficeController {
|
|||||||
|
|
||||||
model.setRegion(district.getRegion());
|
model.setRegion(district.getRegion());
|
||||||
model.setDistrictName(district.getName());
|
model.setDistrictName(district.getName());
|
||||||
|
model.setCity(district.getCity());
|
||||||
OfficeEvaluationDto evaluation = officeService.evaluateRent(district, buildEvaluation(model, request));
|
OfficeEvaluationDto evaluation = officeService.evaluateRent(district, buildEvaluation(model, request));
|
||||||
Double minPrice = null;
|
Double minPrice = null;
|
||||||
Double maxPrice = null;
|
Double maxPrice = null;
|
||||||
|
|||||||
+3
-2
@@ -313,7 +313,7 @@ public class OfficeSellController {
|
|||||||
}
|
}
|
||||||
model.setRegion(district.getRegion());
|
model.setRegion(district.getRegion());
|
||||||
model.setDistrictName(district.getName());
|
model.setDistrictName(district.getName());
|
||||||
|
model.setCity(district.getCity());
|
||||||
OfficeEvaluationDto evaluation = officeService.evaluateSell(district, buildEvaluation(model, request));
|
OfficeEvaluationDto evaluation = officeService.evaluateSell(district, buildEvaluation(model, request));
|
||||||
|
|
||||||
if (evaluation.getUnitPrice() != null && evaluation.getUnitPrice() != 0) {
|
if (evaluation.getUnitPrice() != null && evaluation.getUnitPrice() != 0) {
|
||||||
@@ -507,7 +507,7 @@ public class OfficeSellController {
|
|||||||
return mav;
|
return mav;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
model.setCity(district.getCity());
|
||||||
model.setRegion(district.getRegion());
|
model.setRegion(district.getRegion());
|
||||||
model.setDistrictName(district.getName());
|
model.setDistrictName(district.getName());
|
||||||
OfficeEvaluationDto evaluation = officeService.evaluateSell(district, buildEvaluation(model, request));
|
OfficeEvaluationDto evaluation = officeService.evaluateSell(district, buildEvaluation(model, request));
|
||||||
@@ -603,6 +603,7 @@ public class OfficeSellController {
|
|||||||
|
|
||||||
model.setRegion(district.getRegion());
|
model.setRegion(district.getRegion());
|
||||||
model.setDistrictName(district.getName());
|
model.setDistrictName(district.getName());
|
||||||
|
model.setCity(district.getCity());
|
||||||
OfficeEvaluationDto evaluation = officeService.evaluateSell(district, buildEvaluation(model, request));
|
OfficeEvaluationDto evaluation = officeService.evaluateSell(district, buildEvaluation(model, request));
|
||||||
if (evaluation.getUnitPrice() != null && evaluation.getUnitPrice() != 0) {
|
if (evaluation.getUnitPrice() != null && evaluation.getUnitPrice() != 0) {
|
||||||
|
|
||||||
|
|||||||
+22
-52
@@ -1,63 +1,33 @@
|
|||||||
import com.fangjia.datastore.driver.DSObject
|
|
||||||
import com.fangjia.script.commData.CommonDatautils
|
|
||||||
import com.fangjia.script.util.CommonUtils
|
|
||||||
import com.fangjia.script.util.DbUtils
|
|
||||||
import com.fangjia.script.util.ExcelUtils
|
import com.fangjia.script.util.ExcelUtils
|
||||||
import com.fangjia.script.util.GeoHelper
|
|
||||||
import com.fangjia.script.util.MongoUtils
|
|
||||||
import com.fangjia.script.util.OpenApiClient
|
import com.fangjia.script.util.OpenApiClient
|
||||||
import com.mongodb.BasicDBObject
|
|
||||||
import com.mongodb.DBCollection
|
|
||||||
import com.mongodb.DBCursor
|
|
||||||
import com.mongodb.DBObject
|
|
||||||
import com.mongodb.QueryOperators
|
|
||||||
import net.sf.json.JSONObject
|
import net.sf.json.JSONObject
|
||||||
|
|
||||||
//ExcelUtils.multiThreadingModify("D:\\业务数据\\四川锦程\\四川锦程测试数据.xlsx",{List item->
|
ExcelUtils.multiThreadingModify("C:\\Users\\wenyan\\Desktop\\地址分区域-20260522.xls",{List item->
|
||||||
// if(item["K"] == null){
|
if(item["C"]){
|
||||||
// JSONObject json = OpenApiClient.addressMatch(item["B"], item["G"], "district", false, item["C"] )
|
JSONObject json = OpenApiClient.addressStandard("", item["C"])
|
||||||
// if(json.getDouble("credit") > 0){
|
if(json){
|
||||||
// item["I"] = json.city
|
if(json.province){
|
||||||
// item["J"] = json.district
|
item["D"]=json.province
|
||||||
// item["K"] = json.name
|
|
||||||
// println(item)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//})
|
|
||||||
//ExcelUtils.multiThreadingModify("D:\\业务数据\\四川锦程\\四川锦程测试数据.xlsx",{List item->
|
|
||||||
// if(item["K"] == null){
|
|
||||||
// JSONObject json = OpenApiClient.addressMatch(item["B"], item["G"], "district", false, item["C"] )
|
|
||||||
// if(json.getDouble("credit") > 0){
|
|
||||||
// item["I"] = json.city
|
|
||||||
// item["J"] = json.district
|
|
||||||
// item["K"] = json.name
|
|
||||||
// println(item)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//})
|
|
||||||
ExcelUtils.multiThreadingModify("D:\\业务数据\\四川锦程\\四川锦程测试数据(人工介入).xlsx",{List item->
|
|
||||||
def city = item["I"]
|
|
||||||
def region = item["J"]
|
|
||||||
def name = item["K"]
|
|
||||||
if(name){
|
|
||||||
BasicDBObject seaweed = DbUtils.seaweed.findOne(DbUtils.buildSeaweedQuery(city, region, name))
|
|
||||||
if(seaweed){
|
|
||||||
def propertyType = 0
|
|
||||||
if(seaweed.estate_type2.toString().contains("别墅")){
|
|
||||||
propertyType = 1
|
|
||||||
}
|
}
|
||||||
JSONObject res = OpenApiClient.evaluateDistrictPrice(city, region, name, item["H"], propertyType)
|
if(json.city){
|
||||||
if(res.getDouble("credit") > 0){
|
item["E"] =json.city
|
||||||
item["L"] = res.avgPrice
|
|
||||||
item["M"] = res.totalPrice
|
|
||||||
}else {
|
|
||||||
CommonUtils.recalculationAverage(city, region, name, seaweed.estate_type2, new Date(), false)
|
|
||||||
}
|
}
|
||||||
item["N"] = CommonUtils.getDistrictBuildYear(seaweed)
|
if(json.district){
|
||||||
}else{
|
item["F"]= json.district
|
||||||
println("################" + item)
|
}
|
||||||
|
if(json.provinceCode){
|
||||||
|
item["G"]= json.provinceCode.toString().substring(0, 6)
|
||||||
|
}
|
||||||
|
if(json.cityCode){
|
||||||
|
item["H"] =json.cityCode.toString().substring(0, 6)
|
||||||
|
}
|
||||||
|
if(json.districtCode){
|
||||||
|
item["I"] =json.districtCode.toString().substring(0, 6)
|
||||||
|
}
|
||||||
|
println(json)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
println(item)
|
println(item)
|
||||||
})
|
})
|
||||||
+2
-3
@@ -157,7 +157,7 @@ public class OfficeServiceImpl implements OfficeService {
|
|||||||
Integer startDate = Integer.valueOf(DateUtil.formatByPattern(DateUtil.addMonthToDate(new Date(), -12), "yyyyMMdd"));
|
Integer startDate = Integer.valueOf(DateUtil.formatByPattern(DateUtil.addMonthToDate(new Date(), -12), "yyyyMMdd"));
|
||||||
query.setStartDate(startDate);
|
query.setStartDate(startDate);
|
||||||
query.setEndDate(endDate);
|
query.setEndDate(endDate);
|
||||||
|
query.setCityDisplay(RegionData.formatCity(evaluation.getCity()));
|
||||||
query.setCityDisplay(evaluation.getCity());
|
query.setCityDisplay(evaluation.getCity());
|
||||||
Pager pager = new Pager();
|
Pager pager = new Pager();
|
||||||
pager.setStartRow(0);
|
pager.setStartRow(0);
|
||||||
@@ -255,8 +255,7 @@ public class OfficeServiceImpl implements OfficeService {
|
|||||||
Integer startDate = Integer.valueOf(DateUtil.formatByPattern(DateUtil.addMonthToDate(new Date(), -12), "yyyyMMdd"));
|
Integer startDate = Integer.valueOf(DateUtil.formatByPattern(DateUtil.addMonthToDate(new Date(), -12), "yyyyMMdd"));
|
||||||
query.setStartDate(startDate);
|
query.setStartDate(startDate);
|
||||||
query.setEndDate(endDate);
|
query.setEndDate(endDate);
|
||||||
|
query.setCityDisplay(RegionData.formatCity(evaluation.getCity()));
|
||||||
query.setCityDisplay(evaluation.getCity());
|
|
||||||
Pager pager = new Pager();
|
Pager pager = new Pager();
|
||||||
pager.setStartRow(0);
|
pager.setStartRow(0);
|
||||||
pager.setPageSize(100);
|
pager.setPageSize(100);
|
||||||
|
|||||||
Reference in New Issue
Block a user