Subversion Repositories SmartDukaan

Rev

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

Rev 27007 Rev 27085
Line 16... Line 16...
16
import java.util.HashSet;
16
import java.util.HashSet;
17
import java.util.List;
17
import java.util.List;
18
import java.util.Map;
18
import java.util.Map;
19
import java.util.Optional;
19
import java.util.Optional;
20
import java.util.Set;
20
import java.util.Set;
-
 
21
import java.util.function.Function;
21
import java.util.stream.Collectors;
22
import java.util.stream.Collectors;
22
 
23
 
23
import javax.mail.MessagingException;
24
import javax.mail.MessagingException;
24
import javax.mail.internet.InternetAddress;
25
import javax.mail.internet.InternetAddress;
25
import javax.mail.internet.MimeMessage;
26
import javax.mail.internet.MimeMessage;
Line 82... Line 83...
82
import com.spice.profitmandi.dao.entity.fofo.FofoOrder;
83
import com.spice.profitmandi.dao.entity.fofo.FofoOrder;
83
import com.spice.profitmandi.dao.entity.fofo.FofoOrderItem;
84
import com.spice.profitmandi.dao.entity.fofo.FofoOrderItem;
84
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
85
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
85
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
86
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
86
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
87
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
-
 
88
import com.spice.profitmandi.dao.entity.fofo.PartnerTypeChange;
87
import com.spice.profitmandi.dao.entity.fofo.Purchase;
89
import com.spice.profitmandi.dao.entity.fofo.Purchase;
88
import com.spice.profitmandi.dao.entity.fofo.ScanRecord;
90
import com.spice.profitmandi.dao.entity.fofo.ScanRecord;
89
import com.spice.profitmandi.dao.entity.fofo.SchemeInOut;
91
import com.spice.profitmandi.dao.entity.fofo.SchemeInOut;
90
import com.spice.profitmandi.dao.entity.transaction.PriceDrop;
92
import com.spice.profitmandi.dao.entity.transaction.PriceDrop;
91
import com.spice.profitmandi.dao.entity.transaction.PriceDropIMEI;
93
import com.spice.profitmandi.dao.entity.transaction.PriceDropIMEI;
Line 1987... Line 1989...
1987
			}
1989
			}
1988
 
1990
 
1989
			List<String> brands = mongoClient.getMongoBrands(fofoId, null, 3).stream().map(x -> (String) x.get("name"))
1991
			List<String> brands = mongoClient.getMongoBrands(fofoId, null, 3).stream().map(x -> (String) x.get("name"))
1990
					.collect(Collectors.toList());
1992
					.collect(Collectors.toList());
1991
 
1993
 
-
 
1994
			PartnerTypeChange ptc = partnerTypeChangeRepository.selectPartnerType(fofoId, LocalDate.now());
-
 
1995
 
1992
			List<Integer> focusedModelCatalogId = focusedModelRepository.selectAll().stream().map(x -> x.getCatalogId())
1996
			List<Integer> focusedModelCatalogId = focusedModelRepository.selectAllByPartnerType(ptc.getPartnerType())
1993
					.collect(Collectors.toList());
1997
					.stream().map(x -> x.getCatalogId()).collect(Collectors.toList());
1994
			Map<String, Object> equalsMap = new HashMap<>();
1998
			Map<String, Object> equalsMap = new HashMap<>();
1995
			equalsMap.put("categoryId", 10006);
1999
			equalsMap.put("categoryId", 10006);
1996
			equalsMap.put("brand", brands);
2000
			equalsMap.put("brand", brands);
1997
 
2001
 
1998
			Map<String, List<?>> notEqualsMap = new HashMap<>();
2002
			Map<String, List<?>> notEqualsMap = new HashMap<>();
Line 2005... Line 2009...
2005
			List<Integer> catalogIds = itemRepository
2009
			List<Integer> catalogIds = itemRepository
2006
					.selectItems(FocusedModel.class, "catalogItemId", "catalogId", equalsMap, notEqualsMap,
2010
					.selectItems(FocusedModel.class, "catalogItemId", "catalogId", equalsMap, notEqualsMap,
2007
							equalsJoinMap, notEqualsJoinMap, "minimumQty")
2011
							equalsJoinMap, notEqualsJoinMap, "minimumQty")
2008
					.stream().map(x -> x.getCatalogId()).collect(Collectors.toList());
2012
					.stream().map(x -> x.getCatalogId()).collect(Collectors.toList());
2009
 
2013
 
2010
			Map<Integer, Integer> focusedCatalogIdAndQtyMap = focusedModelRepository.selectByCatalogIdsl(catalogIds)
2014
			Map<Integer, Integer> focusedCatalogIdAndQtyMap = focusedModelRepository
-
 
2015
					.selectByCatalogIdsAndPartnerType(catalogIds, ptc.getPartnerType()).stream()
2011
					.stream().collect(Collectors.toMap(x -> x.getCatalogId(), x -> x.getMinimumQty()));
2016
					.collect(Collectors.toMap(x -> x.getCatalogId(), x -> x.getMinimumQty()));
2012
 
2017
 
2013
			/*
2018
			/*
2014
			 * Map<Integer, Integer> focusedCatalogIdAndQtyMap =
2019
			 * Map<Integer, Integer> focusedCatalogIdAndQtyMap =
2015
			 * focusedModelRepository.selectAll().stream() .collect(Collectors.toMap(x ->
2020
			 * focusedModelRepository.selectAll().stream() .collect(Collectors.toMap(x ->
2016
			 * x.getCatalogId(), x -> x.getMinimumQty()));
2021
			 * x.getCatalogId(), x -> x.getMinimumQty()));