diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/util/CommonUtils.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/util/CommonUtils.groovy index 21887e3db..ac9704830 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/util/CommonUtils.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/util/CommonUtils.groovy @@ -1,6 +1,7 @@ package com.fangjia.script.util import com.fangjia.core.RegionData +import com.fangjia.core.util.HttpRequest import com.mongodb.BasicDBObject import com.mongodb.DBCollection import com.mongodb.DBObject @@ -192,6 +193,19 @@ public class CommonUtils { } } + static void recalcAverage(String city, String region, String name, Integer count =1 , String category="sell", Boolean retainHistory=true){ + def url = "http://192.168.0.100:38080/FangJiaDataService/districtPriceCalculate"; + def params = new HashMap(); + params.city = city; + params.region = region; + params.name = name; + params.count = count.toString(); + params.category = category; + params.retainHistory = retainHistory.toString(); + HttpRequest request = new HttpRequest(); + println(request.get(url, params, "UTF-8")) + } + /** * 重算小区均价 * @param city @@ -221,7 +235,7 @@ public class CommonUtils { cmd.put("name", name) cmd.put('estate_type', estateType) cmd.put("calc_date", calcDate) - cmd.put("calc_type", 0) + cmd.put("calc_type", calcType) println(cmd) DBObject data = new BasicDBObject() data.put("category", "sell")