Subversion Repositories SmartDukaan

Rev

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

Rev 21867 Rev 21870
Line 38... Line 38...
38
	@Autowired
38
	@Autowired
39
	TagListingRepository tagListingRepository;
39
	TagListingRepository tagListingRepository;
40
	
40
	
41
	@SuppressWarnings("unchecked")
41
	@SuppressWarnings("unchecked")
42
	@Override
42
	@Override
43
	public float getPrice(int itemId, int retailerId) {
43
	public float getPrice(Set<Integer> itemIds, int retailerId) {
44
		float price = Float.MAX_VALUE;
44
		float price = Float.MAX_VALUE;
45
		int addressId;
45
		int addressId;
46
		try {
46
		try {
47
			
47
			
48
			addressId = retailerRegisteredAddressRepository.selectAddressIdByRetailerId(retailerId);
48
			addressId = retailerRegisteredAddressRepository.selectAddressIdByRetailerId(retailerId);
Line 74... Line 74...
74
			Set<Integer> userUnion = (Set<Integer>)CollectionUtils.union(retailerTagIds, userPositiveTagIds);
74
			Set<Integer> userUnion = (Set<Integer>)CollectionUtils.union(retailerTagIds, userPositiveTagIds);
75
			Set<Integer> filterUserTagIds = (Set<Integer>)CollectionUtils.subtract(userUnion, userIntersection);
75
			Set<Integer> filterUserTagIds = (Set<Integer>)CollectionUtils.subtract(userUnion, userIntersection);
76
			if(filterUserTagIds.isEmpty()){
76
			if(filterUserTagIds.isEmpty()){
77
				return price;
77
				return price;
78
			}
78
			}
79
			List<TagListing> tagListings = tagListingRepository.selectByItemIdAndTagIds(itemId, filterUserTagIds);
79
			List<TagListing> tagListings = tagListingRepository.selectByItemIdsAndTagIds(itemIds, filterUserTagIds);
80
			if(tagListings.isEmpty()){
80
			if(tagListings.isEmpty()){
81
				return price;
81
				return price;
82
			}
82
			}
83
			for(TagListing tagListing : tagListings){
83
			for(TagListing tagListing : tagListings){
84
				if(price > tagListing.getSellingPrice()){
84
				if(price > tagListing.getSellingPrice()){