Subversion Repositories SmartDukaan

Rev

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

Rev 27634 Rev 27636
Line 46... Line 46...
46
import com.mongodb.DBObject;
46
import com.mongodb.DBObject;
47
import com.spice.profitmandi.common.enumuration.ContentType;
47
import com.spice.profitmandi.common.enumuration.ContentType;
48
import com.spice.profitmandi.common.enumuration.MessageType;
48
import com.spice.profitmandi.common.enumuration.MessageType;
49
import com.spice.profitmandi.common.enumuration.ReporticoProject;
49
import com.spice.profitmandi.common.enumuration.ReporticoProject;
50
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
50
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
-
 
51
import com.spice.profitmandi.common.model.ActivateItemModel;
51
import com.spice.profitmandi.common.model.BrandStockPrice;
52
import com.spice.profitmandi.common.model.BrandStockPrice;
52
import com.spice.profitmandi.common.model.ChartModel;
53
import com.spice.profitmandi.common.model.ChartModel;
53
import com.spice.profitmandi.common.model.CustomRetailer;
54
import com.spice.profitmandi.common.model.CustomRetailer;
54
import com.spice.profitmandi.common.model.DataModel;
55
import com.spice.profitmandi.common.model.DataModel;
55
import com.spice.profitmandi.common.model.DatasetModel;
56
import com.spice.profitmandi.common.model.DatasetModel;
Line 64... Line 65...
64
import com.spice.profitmandi.dao.entity.auth.Menu;
65
import com.spice.profitmandi.dao.entity.auth.Menu;
65
import com.spice.profitmandi.dao.entity.catalog.Item;
66
import com.spice.profitmandi.dao.entity.catalog.Item;
66
import com.spice.profitmandi.dao.entity.catalog.Offer;
67
import com.spice.profitmandi.dao.entity.catalog.Offer;
67
import com.spice.profitmandi.dao.entity.catalog.OfferPartner;
68
import com.spice.profitmandi.dao.entity.catalog.OfferPartner;
68
import com.spice.profitmandi.dao.entity.catalog.Offermargin;
69
import com.spice.profitmandi.dao.entity.catalog.Offermargin;
-
 
70
import com.spice.profitmandi.dao.entity.catalog.TagListing;
69
import com.spice.profitmandi.dao.entity.cs.Position;
71
import com.spice.profitmandi.dao.entity.cs.Position;
70
import com.spice.profitmandi.dao.entity.dtr.Document;
72
import com.spice.profitmandi.dao.entity.dtr.Document;
71
import com.spice.profitmandi.dao.entity.dtr.NotificationCampaign;
73
import com.spice.profitmandi.dao.entity.dtr.NotificationCampaign;
72
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
74
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
-
 
75
import com.spice.profitmandi.dao.entity.fofo.InventoryItem;
73
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
76
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
74
import com.spice.profitmandi.dao.entity.fofo.PartnerTargetDetails;
77
import com.spice.profitmandi.dao.entity.fofo.PartnerTargetDetails;
75
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
78
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
76
import com.spice.profitmandi.dao.entity.inventory.ReporticoCacheTable;
79
import com.spice.profitmandi.dao.entity.inventory.ReporticoCacheTable;
77
import com.spice.profitmandi.dao.entity.transaction.Order;
80
import com.spice.profitmandi.dao.entity.transaction.Order;
Line 1516... Line 1519...
1516
 
1519
 
1517
		model.addAttribute("partnerPendingIndent", partnerPendingIndent);
1520
		model.addAttribute("partnerPendingIndent", partnerPendingIndent);
1518
		return "partner-pending-indent-item";
1521
		return "partner-pending-indent-item";
1519
	}
1522
	}
1520
 
1523
 
-
 
1524
	@RequestMapping(value = "/getPartnerInvestment", method = RequestMethod.GET)
-
 
1525
	public String getPartnerInvestment(HttpServletRequest request,
-
 
1526
			@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
-
 
1527
		Map<Integer, PartnerDetailModel> partnerStats = this.getPartnersStatDataFromFile();
-
 
1528
		PartnerDetailModel partnerDetailModel = partnerStats.get(fofoId);
-
 
1529
		CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
-
 
1530
		model.addAttribute("partnerDetailModel", partnerDetailModel);
-
 
1531
		model.addAttribute("customRetailer", customRetailer);
-
 
1532
		return "partner-investment";
-
 
1533
	}
-
 
1534
 
-
 
1535
	@RequestMapping(value = "/getPatnerActivateStock", method = RequestMethod.GET)
-
 
1536
	public String getPartnerActivateStockItem(HttpServletRequest request,
-
 
1537
			@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
-
 
1538
		List<ActivateItemModel> activateStocks = new ArrayList<>();
-
 
1539
		List<InventoryItem> inventoryItems = inventoryItemRepository.selectByActivatedNotSold(fofoId);
-
 
1540
		CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
-
 
1541
 
-
 
1542
		for (InventoryItem inventoryItem : inventoryItems) {
-
 
1543
			TagListing tagListing = tagListingRepository.selectByItemId(inventoryItem.getItemId());
-
 
1544
			Item item = itemRepository.selectById(inventoryItem.getItemId());
-
 
1545
			ActivateItemModel aim = new ActivateItemModel();
-
 
1546
			aim.setFofoId(inventoryItem.getFofoId());
-
 
1547
			aim.setQuantity(inventoryItem.getGoodQuantity());
-
 
1548
			aim.setAmount(tagListing.getSellingPrice());
-
 
1549
			aim.setItemDescription(item.getItemDescription());
-
 
1550
			aim.setItemId(inventoryItem.getItemId());
-
 
1551
			activateStocks.add(aim);
-
 
1552
		}
-
 
1553
 
-
 
1554
		model.addAttribute("activateStocks", activateStocks);
-
 
1555
		model.addAttribute("customRetailer", customRetailer);
-
 
1556
		return "partner-activate-stock";
-
 
1557
	}
-
 
1558
 
-
 
1559
	@RequestMapping(value = "/getPatnerBrandWiseMTDSale", method = RequestMethod.GET)
-
 
1560
	public String getPatnerBrandWiseMTDSale(HttpServletRequest request,
-
 
1561
			@RequestParam(name = ProfitMandiConstants.FOFO_ID) int fofoId, Model model) throws Exception {
-
 
1562
		LocalDateTime curDate = LocalDate.now().atStartOfDay();
-
 
1563
		CustomRetailer customRetailer = retailerService.getFofoRetailer(fofoId);
-
 
1564
		Map<String, Double> brandMtdAmount = fofoOrderItemRepository
-
 
1565
				.selectSumAmountGroupByBrand(curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), fofoId);
-
 
1566
 
-
 
1567
		Double accesoriesmtdsale = fofoOrderRepository.selectSumSaleGroupByFofoIdsForMobileOrAccessories(fofoId,
-
 
1568
				curDate.withDayOfMonth(1), curDate.with(LocalTime.MAX), Optional.of(false)).get(fofoId);
-
 
1569
		LOGGER.info("accesoriesmtdsale" + accesoriesmtdsale);
-
 
1570
		model.addAttribute("brandMtdAmount", brandMtdAmount);
-
 
1571
		model.addAttribute("accesoriesmtdsale", accesoriesmtdsale);
-
 
1572
		model.addAttribute("customRetailer", customRetailer);
-
 
1573
		return "partner-brand-mtd-sale";
-
 
1574
	}
-
 
1575
 
1521
}
1576
}