|
@@ -63,6 +63,7 @@ import java.util.Set;
|
|
|
import java.util.concurrent.CountDownLatch;
|
|
import java.util.concurrent.CountDownLatch;
|
|
|
import java.util.concurrent.ExecutorService;
|
|
import java.util.concurrent.ExecutorService;
|
|
|
import java.util.concurrent.Executors;
|
|
import java.util.concurrent.Executors;
|
|
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 对账单
|
|
* 对账单
|
|
@@ -560,7 +561,6 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
|
|
|
customer.setThisMonthDoneCount(thisMonthDoneTrades);
|
|
customer.setThisMonthDoneCount(thisMonthDoneTrades);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- vendors.stream().filter(vendor -> null != vendor.getThisMonthCount());
|
|
|
|
|
setVendorSPage(params, vendors, vendorSPage);
|
|
setVendorSPage(params, vendors, vendorSPage);
|
|
|
}
|
|
}
|
|
|
return vendorSPage;
|
|
return vendorSPage;
|
|
@@ -574,16 +574,17 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
public void setVendorSPage(PageParams params, List<Vendor> vendors, SPage<Vendor> vendorSPage) {
|
|
public void setVendorSPage(PageParams params, List<Vendor> vendors, SPage<Vendor> vendorSPage) {
|
|
|
- List<Vendor> vendorList;
|
|
|
|
|
|
|
+ List<Vendor> filterVendors = vendors.stream()
|
|
|
|
|
+ .filter(vendor -> (null != vendor.getThisMonthCount() && !CollectionUtils.isEmpty(vendor.getThisMonthCount()))).collect(Collectors.toList());
|
|
|
int startIndex = (params.getPage() - 1) * params.getCount();
|
|
int startIndex = (params.getPage() - 1) * params.getCount();
|
|
|
int endIndex = params.getPage() * params.getCount();
|
|
int endIndex = params.getPage() * params.getCount();
|
|
|
- int totalCount = vendors.size();
|
|
|
|
|
|
|
+ int totalCount = filterVendors.size();
|
|
|
int totalPage = (int) Math.ceil(totalCount / params.getCount());
|
|
int totalPage = (int) Math.ceil(totalCount / params.getCount());
|
|
|
- vendorSPage.setTotalElement(vendors.size());
|
|
|
|
|
|
|
+ vendorSPage.setTotalElement(filterVendors.size());
|
|
|
vendorSPage.setTotalPage(totalPage);
|
|
vendorSPage.setTotalPage(totalPage);
|
|
|
vendorSPage.setPage(params.getPage());
|
|
vendorSPage.setPage(params.getPage());
|
|
|
vendorSPage.setSize(params.getCount());
|
|
vendorSPage.setSize(params.getCount());
|
|
|
- vendorList = vendors.subList(startIndex, endIndex > totalCount ? totalCount : endIndex);
|
|
|
|
|
|
|
+ List<Vendor> vendorList = filterVendors.subList(startIndex, endIndex > totalCount ? totalCount : endIndex);
|
|
|
vendorSPage.setContent(vendorList);
|
|
vendorSPage.setContent(vendorList);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -640,7 +641,7 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
|
|
|
public List<ApCheckAmount> getThisMonthTodoTrade(Long enUU, Long customerUU, String checkDate, Long fromDate, Long endDate) throws InterruptedException {
|
|
public List<ApCheckAmount> getThisMonthTodoTrade(Long enUU, Long customerUU, String checkDate, Long fromDate, Long endDate) throws InterruptedException {
|
|
|
DateFilter filter = erpProdIODetailService.initFilter(fromDate, endDate, checkDate);
|
|
DateFilter filter = erpProdIODetailService.initFilter(fromDate, endDate, checkDate);
|
|
|
List<ApCheckAmount> totalTrades = new ArrayList<>();
|
|
List<ApCheckAmount> totalTrades = new ArrayList<>();
|
|
|
- final CountDownLatch threadsSignal = new CountDownLatch(15);
|
|
|
|
|
|
|
+ final CountDownLatch threadsSignal = new CountDownLatch(5);
|
|
|
// 货款调账
|
|
// 货款调账
|
|
|
executor.submitTask(() -> {
|
|
executor.submitTask(() -> {
|
|
|
List<ApCheckAmount> trades = commonDao.query(ApCheckeTodoCountSqls.THISMONTH_ADJUSTMENT_COUNT_SQL, ApCheckAmount.class, enUU, customerUU, filter.getFromDate(), filter.getEndDate());
|
|
List<ApCheckAmount> trades = commonDao.query(ApCheckeTodoCountSqls.THISMONTH_ADJUSTMENT_COUNT_SQL, ApCheckAmount.class, enUU, customerUU, filter.getFromDate(), filter.getEndDate());
|
|
@@ -671,6 +672,7 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
|
|
|
totalTrades.addAll(trades);
|
|
totalTrades.addAll(trades);
|
|
|
threadsSignal.countDown();
|
|
threadsSignal.countDown();
|
|
|
});
|
|
});
|
|
|
|
|
+ threadsSignal.await();
|
|
|
return groupCountByCurrency(totalTrades);
|
|
return groupCountByCurrency(totalTrades);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -745,6 +747,7 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
|
|
|
totalTrades.addAll(trades);
|
|
totalTrades.addAll(trades);
|
|
|
threadsSignal.countDown();
|
|
threadsSignal.countDown();
|
|
|
});
|
|
});
|
|
|
|
|
+ threadsSignal.await();
|
|
|
return groupCountByCurrency(totalTrades);
|
|
return groupCountByCurrency(totalTrades);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -793,6 +796,7 @@ public class PurchaseApCheckServiceImpl implements PurchaseApCheckService {
|
|
|
totalTrades.addAll(trades);
|
|
totalTrades.addAll(trades);
|
|
|
threadsSignal.countDown();
|
|
threadsSignal.countDown();
|
|
|
});
|
|
});
|
|
|
|
|
+ threadsSignal.await();
|
|
|
return groupCountByCurrency(totalTrades);
|
|
return groupCountByCurrency(totalTrades);
|
|
|
}
|
|
}
|
|
|
|
|
|