Subversion Repositories SmartDukaan

Rev

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

Rev 28491 Rev 28492
Line 40... Line 40...
40
import com.spice.profitmandi.common.model.SchemeModel;
40
import com.spice.profitmandi.common.model.SchemeModel;
41
import com.spice.profitmandi.common.util.ExcelUtils;
41
import com.spice.profitmandi.common.util.ExcelUtils;
42
import com.spice.profitmandi.common.util.FormattingUtils;
42
import com.spice.profitmandi.common.util.FormattingUtils;
43
import com.spice.profitmandi.common.util.StringUtils;
43
import com.spice.profitmandi.common.util.StringUtils;
44
import com.spice.profitmandi.common.web.util.ResponseSender;
44
import com.spice.profitmandi.common.web.util.ResponseSender;
-
 
45
import com.spice.profitmandi.dao.entity.catalog.Item;
45
import com.spice.profitmandi.dao.entity.catalog.Scheme;
46
import com.spice.profitmandi.dao.entity.catalog.Scheme;
46
import com.spice.profitmandi.dao.entity.catalog.TagListing;
47
import com.spice.profitmandi.dao.entity.catalog.TagListing;
47
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
48
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
48
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
49
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
49
import com.spice.profitmandi.dao.entity.fofo.SchemeItem;
50
import com.spice.profitmandi.dao.entity.fofo.SchemeItem;
Line 345... Line 346...
345
		}
346
		}
346
 
347
 
347
		else if (searchItem > 0) {
348
		else if (searchItem > 0) {
348
			TagListing tagListing = null;
349
			TagListing tagListing = null;
349
			tagListing = tagListingRepository.selectByItemId(searchItem);
350
			tagListing = tagListingRepository.selectByItemId(searchItem);
-
 
351
			Item item = itemRepository.selectById(searchItem);
350
			if (tagListing != null) {
352
			if (tagListing != null) {
351
				model.addAttribute("dp", tagListing.getSellingPrice());
353
				model.addAttribute("dp", tagListing.getSellingPrice());
352
				model.addAttribute("mop", tagListing.getMop());
354
				model.addAttribute("mop", tagListing.getMop());
353
			}
355
			}
354
			schemes = schemeService.selectSchemeByPartnerType(partnerType, date, searchItem, isAdmin, offset, limit);
356
			schemes = schemeService.selectSchemeByPartnerType(partnerType, date, searchItem, isAdmin, offset, limit);
355
			model.addAttribute("schemes", schemes);
357
			model.addAttribute("schemes", schemes);
356
			if (schemes.size() == 0) {
358
			if (schemes.size() == 0) {
357
				return "schemes";
359
				return "schemes";
358
			}
360
			}
359
			//For 7720(HR) remove investment
361
			//For 7720(HR) remove investment
360
			if(fofoStoreRepository.getWarehousePartnerMap().get(7720).stream().filter(x->x.getId()==loginDetails.getFofoId()).count() > 0) {
362
			if(item.getBrand().equals("Vivo") && fofoStoreRepository.getWarehousePartnerMap().get(7720).stream().filter(x->x.getId()==loginDetails.getFofoId()).count() > 0) {
361
				schemes = schemes.stream().filter(x->!x.getType().equals(SchemeType.INVESTMENT)).collect(Collectors.toList());
363
				schemes = schemes.stream().filter(x->!x.getType().equals(SchemeType.INVESTMENT)).collect(Collectors.toList());
362
			}
364
			}
363
			for (Scheme scheme : schemes) {
365
			for (Scheme scheme : schemes) {
364
				if (scheme.getAmountType().equals(AmountType.PERCENTAGE)) {
366
				if (scheme.getAmountType().equals(AmountType.PERCENTAGE)) {
365
					if (tagListing != null) {
367
					if (tagListing != null) {