月份修改
This commit is contained in:
+9
-8
@@ -23,6 +23,7 @@ import java.sql.ResultSet
|
||||
import java.util.concurrent.CountDownLatch
|
||||
import java.util.concurrent.ExecutorService
|
||||
import java.util.concurrent.Executors
|
||||
import java.util.concurrent.TimeUnit
|
||||
import java.util.concurrent.atomic.AtomicLong
|
||||
|
||||
@BatchOwner(Watcher.GaoJuan)
|
||||
@@ -90,6 +91,7 @@ class ImportIndexStats extends BaseBatch{
|
||||
def map = [:]
|
||||
map.year = year
|
||||
map.month = month
|
||||
map.date = date
|
||||
runDates << map
|
||||
s = DateUtils.addMonth(date, 1, "yyyyMM")
|
||||
|
||||
@@ -98,14 +100,14 @@ class ImportIndexStats extends BaseBatch{
|
||||
}
|
||||
}
|
||||
for(def map : runDates){
|
||||
calculatePriceIndex(map.year, map.month);
|
||||
calculatePriceIndex(map.year, map.month, map.date);
|
||||
}
|
||||
}
|
||||
|
||||
//计算统计局没有发布的城市的价格指数
|
||||
def calculatePriceIndex(def year, def month){
|
||||
def calculatePriceIndex(def year, def month, def date){
|
||||
def citys =CommonDatautils.findAllCity();
|
||||
def date = createDateString(year, month, 0, "");
|
||||
// def date = createDateString(year, month, 0, "");
|
||||
def haveIndexCitys = findPriceIndexCitys(date.toInteger());
|
||||
|
||||
def totalCount = new AtomicLong()
|
||||
@@ -130,7 +132,7 @@ class ImportIndexStats extends BaseBatch{
|
||||
void run() {
|
||||
try{
|
||||
totalCount.addAndGet(1)
|
||||
def result = calculating(city, year, month);
|
||||
def result = calculating(city, year, month, date);
|
||||
println result
|
||||
println "${city}[${totalCount.get()}/${total}]运行......"+year+"-"+month+" 完成"
|
||||
|
||||
@@ -142,11 +144,10 @@ class ImportIndexStats extends BaseBatch{
|
||||
}
|
||||
});
|
||||
}
|
||||
latch.await()
|
||||
return addCount.get();
|
||||
latch.await(5, TimeUnit.MINUTES);
|
||||
}
|
||||
|
||||
def calculating(city, year, month){
|
||||
def calculating(city, year, month, date){
|
||||
def result = [:];
|
||||
calculateAvgPriceIndex(city, year, month, result);
|
||||
|
||||
@@ -157,7 +158,7 @@ class ImportIndexStats extends BaseBatch{
|
||||
checkPriceIndex(result);//涨跌幅控制
|
||||
if(result){
|
||||
result.city = city;
|
||||
result.yearmonth = (year.toString()+month.toString()).toInteger();
|
||||
result.yearmonth = date;
|
||||
result.source = 2;
|
||||
result.remark = "均价计算";
|
||||
result.cat = "district";
|
||||
|
||||
Reference in New Issue
Block a user