|
|
@@ -244,19 +244,16 @@ public class PurchaseApBillServiceImpl implements PurchaseApBillService {
|
|
|
List<Vendor> vendors = findVendorByPage(params, keyword);
|
|
|
SPage<Vendor> vendorSPage = new SPage<>();
|
|
|
if (!org.springframework.util.CollectionUtils.isEmpty(vendors)) {
|
|
|
- List<Vendor> filterVendors = vendors.stream().filter(customer -> null != customer.getApcheck() && customer.getApcheck() == 1).collect(Collectors.toList());
|
|
|
+ vendors.stream().filter(customer -> null != customer.getApcheck() && customer.getApcheck() == 1).collect(Collectors.toList());
|
|
|
final CountDownLatch threadsSignal = new CountDownLatch(1);
|
|
|
- filterVendors.forEach(customer -> {
|
|
|
- try {
|
|
|
- executor.submitTask(() -> {
|
|
|
- purchaseApCheckService.countApCheck(customer, checkDate, fromDate, endDate);
|
|
|
- threadsSignal.countDown();
|
|
|
- });
|
|
|
- threadsSignal.await();
|
|
|
- } catch (InterruptedException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- });
|
|
|
+ List<Runnable> runnableList = new ArrayList<>();
|
|
|
+ vendors.forEach(customer ->
|
|
|
+ runnableList.add(() ->
|
|
|
+ purchaseApCheckService.countApCheck(customer, checkDate, fromDate, endDate)
|
|
|
+ )
|
|
|
+ );
|
|
|
+ executor.submitTasks(runnableList, threadsSignal);
|
|
|
+ threadsSignal.await();
|
|
|
purchaseApCheckService.setVendorSPage(params, vendors, vendorSPage);
|
|
|
}
|
|
|
return vendorSPage;
|