Subversion Repositories SmartDukaan

Rev

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

Rev 31051 Rev 31147
Line 4... Line 4...
4
import com.spice.profitmandi.common.model.CustomAddress;
4
import com.spice.profitmandi.common.model.CustomAddress;
5
import com.spice.profitmandi.common.model.CustomCustomer;
5
import com.spice.profitmandi.common.model.CustomCustomer;
6
import com.spice.profitmandi.common.model.ProfitMandiConstants;
6
import com.spice.profitmandi.common.model.ProfitMandiConstants;
7
import com.spice.profitmandi.common.solr.SolrService;
7
import com.spice.profitmandi.common.solr.SolrService;
8
import com.spice.profitmandi.common.web.util.ResponseSender;
8
import com.spice.profitmandi.common.web.util.ResponseSender;
-
 
9
import com.spice.profitmandi.dao.entity.catalog.CustomerOffer;
9
import com.spice.profitmandi.dao.entity.catalog.CustomerOfferItem;
10
import com.spice.profitmandi.dao.entity.catalog.CustomerOfferItem;
10
import com.spice.profitmandi.dao.entity.catalog.Item;
11
import com.spice.profitmandi.dao.entity.catalog.Item;
11
import com.spice.profitmandi.dao.entity.fofo.*;
12
import com.spice.profitmandi.dao.entity.fofo.*;
12
import com.spice.profitmandi.dao.model.CustomerOrderDetail;
13
import com.spice.profitmandi.dao.model.CustomerOrderDetail;
13
import com.spice.profitmandi.dao.model.UserCart;
14
import com.spice.profitmandi.dao.model.UserCart;
Line 258... Line 259...
258
							} else {
259
							} else {
259
								customerOrderDetail.setInsurance(false);
260
								customerOrderDetail.setInsurance(false);
260
							}
261
							}
261
						}
262
						}
262
 
263
 
263
						List<Integer> offerIds = customerOfferRepository
264
						List<CustomerOffer> customerOffers = customerOfferRepository
264
								.selectOffersByDate(LocalDateTime.now().toLocalDate().atStartOfDay()).stream()
265
								.getCustomerOffer(LocalDateTime.now().toLocalDate().atStartOfDay()).get(uc.getUserId());
265
								.map(x -> x.getId()).collect(Collectors.toList());
-
 
266
 
266
 
267
						LOGGER.info("offerIds" + offerIds);
-
 
268
						long offerCount = 0;
267
						long offerCount = 0;
269
						if (!offerIds.isEmpty()) {
268
						if (!customerOffers.isEmpty()) {
-
 
269
							List<Integer> offerIds = customerOffers.stream().map(x -> x.getId())
-
 
270
									.collect(Collectors.toList());
270
 
271
 
271
							List<CustomerOfferItem> customerOfferItems = customerOfferItemRepository
272
							List<CustomerOfferItem> customerOfferItems = customerOfferItemRepository
272
									.selectByOfferIds(offerIds, item.getCatalogItemId());
273
									.selectByOfferIds(offerIds, item.getCatalogItemId(), LocalDate.now());
273
 
274
 
274
							offerCount = customerOfferItems.stream().collect(Collectors.counting());
275
							offerCount = customerOfferItems.stream().collect(Collectors.counting());
275
						}
276
						}
276
 
277
 
277
						customerOrderDetail.setOfferCount(offerCount);
278
						customerOrderDetail.setOfferCount(offerCount);