diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictSellStatBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictSellStatBatch.groovy index 47a6ec543..084ff8148 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictSellStatBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/fuzhou/DistrictSellStatBatch.groovy @@ -69,14 +69,16 @@ class DistrictSellStatBatch extends BaseBatch { def weekend = obj.weekend def startMonth = DateUtils.formatDateByPattern(weekend, "yyyyMM").toInteger() def months = DateUtils.getMonthList(startMonth) - months = months[1..(months.size()-1)] - println months - for(def month : months){ - def curDate = DateUtils.parseFromTightByPattern(month.toString()+"01", "yyyyMMdd") - calcMonthlyPriceByName(curDate, command.city, command.region, command.name) - } - //ɾ³ýÃüÁî - COMMAND_COLL.remove(new BasicDBObject("_id", id)) + if(months.size()>1){ + months = months[1..(months.size()-1)] + println months + for(def month : months){ + def curDate = DateUtils.parseFromTightByPattern(month.toString()+"01", "yyyyMMdd") + calcMonthlyPriceByName(curDate, command.city, command.region, command.name) + } + //ɾ³ýÃüÁî + COMMAND_COLL.remove(new BasicDBObject("_id", id)) + } } } }