SHARE
TWEET

Untitled

a guest Feb 27th, 2020 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         // sync card product status
  2.         List<UserProduct> productToSync = subscriber.getProductList().stream()
  3.                 .filter(x -> (SvaStatus.ACTIVE.getValue().equals(x.getStatus())
  4.                         || SvaStatus.TO_BE_ACTIVATED.getValue().equals(x.getStatus())
  5.                         || SvaStatus.BLOCKED.getValue().equals(x.getStatus()))
  6.                         && ProductType.CARD_PRODUCT.getValue().equals(x.getType()))
  7.                 .collect(Collectors.toList());
  8.  
  9.         SvaProductManager productManager = SvaProductManager.getInstance();
  10.         if (CollectionUtils.isNotEmpty(productToSync)) {
  11.             for (UserProduct p : productToSync) {
  12.                 SvaProduct product = productManager.whereId(p.getId());
  13.                 LOGGER.info("Syncing card product " + p.getId());
  14.                 try {
  15.                     SyncCardStatusAction.syncCardStatusAction(subscriber, product);
  16.                 } catch (Exception e) {
  17.                     LOGGER.error("####### Impossibile syncCardStatus --> ", e);
  18.                 }
  19.  
  20.             }
  21.         }
  22.  
  23.         // add user products
  24.         List<UserProduct> userProducts = subscriber.getProductList().stream()
  25.                 .filter(x -> !SvaStatus.CLOSED.getValue().equals(x.getStatus())
  26.                         && !SvaStatus.REJECTED.getValue().equals(x.getStatus()))
  27.                 .collect(Collectors.toList());
  28.         userOut.add("userProducts", new Gson().toJsonTree(userProducts));
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top