Subversion Repositories SmartDukaan

Rev

Rev 33182 | Rev 33306 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 33182 Rev 33248
Line 24... Line 24...
24
import com.spice.profitmandi.dao.repository.cs.CsService;
24
import com.spice.profitmandi.dao.repository.cs.CsService;
25
import com.spice.profitmandi.dao.repository.cs.RegionRepository;
25
import com.spice.profitmandi.dao.repository.cs.RegionRepository;
26
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
26
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
27
import com.spice.profitmandi.dao.repository.dtr.Mongo;
27
import com.spice.profitmandi.dao.repository.dtr.Mongo;
28
import com.spice.profitmandi.dao.repository.fofo.*;
28
import com.spice.profitmandi.dao.repository.fofo.*;
29
import com.spice.profitmandi.dao.repository.fofo.ActivatedImeiRepository;
-
 
30
import com.spice.profitmandi.dao.repository.transaction.PriceDropIMEIRepository;
29
import com.spice.profitmandi.dao.repository.transaction.PriceDropIMEIRepository;
31
import com.spice.profitmandi.dao.repository.transaction.PriceDropRepository;
30
import com.spice.profitmandi.dao.repository.transaction.PriceDropRepository;
32
import com.spice.profitmandi.dao.repository.transaction.TransactionRepository;
31
import com.spice.profitmandi.dao.repository.transaction.TransactionRepository;
33
import com.spice.profitmandi.service.authentication.RoleManager;
32
import com.spice.profitmandi.service.authentication.RoleManager;
34
import com.spice.profitmandi.service.inventory.InventoryService;
33
import com.spice.profitmandi.service.inventory.InventoryService;
Line 626... Line 625...
626
            double netEarnings = 0;
625
            double netEarnings = 0;
627
            if (inventoryItem != null) {
626
            if (inventoryItem != null) {
628
                // Offer payout
627
                // Offer payout
629
                List<OfferPayout> offerPayouts = offerPayoutRepository.selectAllBySerialNumber(fofoId, searchImei);
628
                List<OfferPayout> offerPayouts = offerPayoutRepository.selectAllBySerialNumber(fofoId, searchImei);
630
                Map<Integer, CreateOfferRequest> offerRequestMap = offerPayouts.stream().map(x -> x.getOfferId())
629
                Map<Integer, CreateOfferRequest> offerRequestMap = offerPayouts.stream().map(x -> x.getOfferId())
-
 
630
                        .distinct().map(offerId -> {
-
 
631
                            try {
631
                        .distinct().map(offerId -> offerService.getOffer(fofoId, offerId.intValue())).collect(Collectors.toMap(x -> x.getId(), x -> x));
632
                                return offerService.getOffer(fofoId, offerId.intValue());
-
 
633
                            } catch (ProfitMandiBusinessException e) {
-
 
634
                                throw new RuntimeException(e);
-
 
635
                            }
-
 
636
                        }).collect(Collectors.toMap(x -> x.getId(), x -> x));
632
 
637
 
633
                schemeInOuts = schemeInOutRepository.selectByInventoryItemIds(new HashSet<>(Arrays.asList(inventoryItem.getId())));
638
                schemeInOuts = schemeInOutRepository.selectByInventoryItemIds(new HashSet<>(Arrays.asList(inventoryItem.getId())));
634
                ActivatedImei activatedImei = activatedImeiRepository.selectBySerialNumber(searchImei);
639
                ActivatedImei activatedImei = activatedImeiRepository.selectBySerialNumber(searchImei);
635
 
640
 
636
                if (!schemeInOuts.isEmpty()) {
641
                if (!schemeInOuts.isEmpty()) {
Line 772... Line 777...
772
                priceDropController.getPriceCircularView(priceCircularModel, model);*/
777
                priceDropController.getPriceCircularView(priceCircularModel, model);*/
773
                // Offer payout
778
                // Offer payout
774
                List<OfferPayout> offerPayouts = offerPayoutRepository.selectAllBySerialNumber(loginDetails.getFofoId(),
779
                List<OfferPayout> offerPayouts = offerPayoutRepository.selectAllBySerialNumber(loginDetails.getFofoId(),
775
                        searchImei);
780
                        searchImei);
776
                Map<Integer, CreateOfferRequest> offerRequestMap = offerPayouts.stream()
781
                Map<Integer, CreateOfferRequest> offerRequestMap = offerPayouts.stream()
-
 
782
                        .map(x -> {
-
 
783
                            try {
777
                        .map(x -> offerService.getOffer(loginDetails.getFofoId(), (int) x.getOfferId()))
784
                                return offerService.getOffer(loginDetails.getFofoId(), (int) x.getOfferId());
-
 
785
                            } catch (ProfitMandiBusinessException e) {
-
 
786
                                throw new RuntimeException(e);
-
 
787
                            }
-
 
788
                        })
778
                        .collect(Collectors.toMap(x -> x.getId(), x -> x));
789
                        .collect(Collectors.toMap(x -> x.getId(), x -> x));
779
 
790
 
780
                schemeInOuts = schemeInOutRepository
791
                schemeInOuts = schemeInOutRepository
781
                        .selectByInventoryItemIds(new HashSet<>(Arrays.asList(inventoryItem.getId())));
792
                        .selectByInventoryItemIds(new HashSet<>(Arrays.asList(inventoryItem.getId())));
782
 
793