优化车位比及绿化率导出
This commit is contained in:
+5
@@ -1,5 +1,6 @@
|
|||||||
package com.fangjia.script.temp.shenjian.cqrcb
|
package com.fangjia.script.temp.shenjian.cqrcb
|
||||||
|
|
||||||
|
import com.fangjia.script.util.ExcelUtils
|
||||||
import com.fangjia.script.util.MongoUtils
|
import com.fangjia.script.util.MongoUtils
|
||||||
import com.mongodb.BasicDBObject
|
import com.mongodb.BasicDBObject
|
||||||
import com.mongodb.DBCollection
|
import com.mongodb.DBCollection
|
||||||
@@ -18,6 +19,10 @@ class POIRule {
|
|||||||
static DBCollection poiConn = MongoUtils.getCollectionByName("address_analytics", "gaode_address_poi", "192.168.0.43", 28017)
|
static DBCollection poiConn = MongoUtils.getCollectionByName("address_analytics", "gaode_address_poi", "192.168.0.43", 28017)
|
||||||
|
|
||||||
static void main(String[] args) {
|
static void main(String[] args) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static void changeSchool() {
|
||||||
// 小学校转为学校
|
// 小学校转为学校
|
||||||
poiConn.find(new BasicDBObject("typecode", "141203").append("status", 0)).batchSize(1000).each {obj ->
|
poiConn.find(new BasicDBObject("typecode", "141203").append("status", 0)).batchSize(1000).each {obj ->
|
||||||
if (obj.name.indexOf('小学校') != -1 ) {
|
if (obj.name.indexOf('小学校') != -1 ) {
|
||||||
|
|||||||
+14
-5
@@ -1,6 +1,8 @@
|
|||||||
package com.fangjia.script.temp.shenjian.cqrcb
|
package com.fangjia.script.temp.shenjian.cqrcb
|
||||||
|
|
||||||
import com.fangjia.core.util.DateUtil
|
import com.fangjia.core.util.DateUtil
|
||||||
|
import com.fangjia.script.common.DataHandleUtils
|
||||||
|
import com.fangjia.script.datastore.FieldValidatorUtils
|
||||||
import com.fangjia.script.util.DbUtils
|
import com.fangjia.script.util.DbUtils
|
||||||
import com.fangjia.script.util.ExcelUtils
|
import com.fangjia.script.util.ExcelUtils
|
||||||
import com.fangjia.script.util.MongoUtils
|
import com.fangjia.script.util.MongoUtils
|
||||||
@@ -85,9 +87,6 @@ class SeaweedExport {
|
|||||||
ret[0] = obj.developer
|
ret[0] = obj.developer
|
||||||
ret[1] = obj.estate_company
|
ret[1] = obj.estate_company
|
||||||
ret[2] = obj.cubage_percent
|
ret[2] = obj.cubage_percent
|
||||||
if (obj.developer == '重庆汇凯置业有限公司') {
|
|
||||||
println('重庆汇凯置业有限公司')
|
|
||||||
}
|
|
||||||
ret[3] = virescencePercentValidator(obj.virescence_percent)
|
ret[3] = virescencePercentValidator(obj.virescence_percent)
|
||||||
|
|
||||||
if (obj.alias) {
|
if (obj.alias) {
|
||||||
@@ -99,7 +98,17 @@ class SeaweedExport {
|
|||||||
ret[4] = temp.join(",")
|
ret[4] = temp.join(",")
|
||||||
}
|
}
|
||||||
ret[5] = obj.car_site_count
|
ret[5] = obj.car_site_count
|
||||||
ret[6] = ""
|
if (com.fangjia.script.datastore.FieldValidatorUtils.householdCountValidator(obj.household_count)
|
||||||
|
&& FieldValidatorUtils.carSiteValidator(obj.car_site_count)) {
|
||||||
|
double val = DataHandleUtils.getDoubleRound(1, (Double.valueOf(obj.car_site_count) / Double.valueOf(obj.household_count)))
|
||||||
|
if (val == 0.0) {
|
||||||
|
val = DataHandleUtils.getDoubleRound(2, (Double.valueOf(obj.car_site_count) / Double.valueOf(obj.household_count)))
|
||||||
|
}
|
||||||
|
if (val == 0.0) {
|
||||||
|
val = DataHandleUtils.getDoubleRound(3, (Double.valueOf(obj.car_site_count) / Double.valueOf(obj.household_count)))
|
||||||
|
}
|
||||||
|
ret[6] = "1:" + val
|
||||||
|
}
|
||||||
ret[7] = ""
|
ret[7] = ""
|
||||||
ret[8] = obj.all_area
|
ret[8] = obj.all_area
|
||||||
ret[9] = obj.loudong_count
|
ret[9] = obj.loudong_count
|
||||||
@@ -146,7 +155,7 @@ class SeaweedExport {
|
|||||||
def value = com.fangjia.script.datastore.DistrictFieldNumberic.checkValue(virescence_percent);
|
def value = com.fangjia.script.datastore.DistrictFieldNumberic.checkValue(virescence_percent);
|
||||||
if(value){
|
if(value){
|
||||||
if(value>=10 && value<=100){
|
if(value>=10 && value<=100){
|
||||||
return value;
|
return com.fangjia.script.common.DataHandleUtils.getDoubleRound(2, Double.valueOf(value))
|
||||||
} else if (value > 0 && value < 1) {
|
} else if (value > 0 && value < 1) {
|
||||||
return com.fangjia.script.common.DataHandleUtils.getDoubleRound(2, Double.valueOf(value) * 100)
|
return com.fangjia.script.common.DataHandleUtils.getDoubleRound(2, Double.valueOf(value) * 100)
|
||||||
} else{
|
} else{
|
||||||
|
|||||||
Reference in New Issue
Block a user