| Line 29... |
Line 29... |
| 29 |
import com.spice.profitmandi.dao.entity.fofo.FofoOrderItem;
|
29 |
import com.spice.profitmandi.dao.entity.fofo.FofoOrderItem;
|
| 30 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
30 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
| 31 |
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
|
31 |
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
|
| 32 |
import com.spice.profitmandi.dao.entity.fofo.PartnerTarget;
|
32 |
import com.spice.profitmandi.dao.entity.fofo.PartnerTarget;
|
| 33 |
import com.spice.profitmandi.dao.entity.fofo.PartnerTargetDetails;
|
33 |
import com.spice.profitmandi.dao.entity.fofo.PartnerTargetDetails;
|
| - |
|
34 |
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
|
| 34 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
35 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
| 35 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
36 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
| 36 |
import com.spice.profitmandi.dao.repository.dtr.InsurancePolicyRepository;
|
37 |
import com.spice.profitmandi.dao.repository.dtr.InsurancePolicyRepository;
|
| 37 |
import com.spice.profitmandi.dao.repository.dtr.InsuranceProviderRepository;
|
38 |
import com.spice.profitmandi.dao.repository.dtr.InsuranceProviderRepository;
|
| 38 |
import com.spice.profitmandi.dao.repository.dtr.Mongo;
|
39 |
import com.spice.profitmandi.dao.repository.dtr.Mongo;
|
| Line 40... |
Line 41... |
| 40 |
import com.spice.profitmandi.dao.repository.dtr.RechargeTransactionRepository;
|
41 |
import com.spice.profitmandi.dao.repository.dtr.RechargeTransactionRepository;
|
| 41 |
import com.spice.profitmandi.dao.repository.fofo.CurrentInventorySnapshotRepository;
|
42 |
import com.spice.profitmandi.dao.repository.fofo.CurrentInventorySnapshotRepository;
|
| 42 |
import com.spice.profitmandi.dao.repository.fofo.FofoOrderItemRepository;
|
43 |
import com.spice.profitmandi.dao.repository.fofo.FofoOrderItemRepository;
|
| 43 |
import com.spice.profitmandi.dao.repository.fofo.PartnerDailyInvestmentRepository;
|
44 |
import com.spice.profitmandi.dao.repository.fofo.PartnerDailyInvestmentRepository;
|
| 44 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTargetRepository;
|
45 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTargetRepository;
|
| - |
|
46 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
|
| 45 |
import com.spice.profitmandi.dao.repository.fofo.TargetSlabRepository;
|
47 |
import com.spice.profitmandi.dao.repository.fofo.TargetSlabRepository;
|
| 46 |
import com.spice.profitmandi.service.PartnerInvestmentService;
|
48 |
import com.spice.profitmandi.service.PartnerInvestmentService;
|
| 47 |
import com.spice.profitmandi.service.authentication.RoleManager;
|
49 |
import com.spice.profitmandi.service.authentication.RoleManager;
|
| 48 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
50 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
| 49 |
import com.spice.profitmandi.service.slab.TargetSlabService;
|
51 |
import com.spice.profitmandi.service.slab.TargetSlabService;
|
| Line 121... |
Line 123... |
| 121 |
@Autowired
|
123 |
@Autowired
|
| 122 |
private FofoOrderItemRepository fofoOrderItemRepository;
|
124 |
private FofoOrderItemRepository fofoOrderItemRepository;
|
| 123 |
|
125 |
|
| 124 |
@Autowired
|
126 |
@Autowired
|
| 125 |
private InsuranceProviderRepository insuranceProviderRepository;
|
127 |
private InsuranceProviderRepository insuranceProviderRepository;
|
| - |
|
128 |
@Autowired
|
| - |
|
129 |
private PartnerTypeChangeService partnerTypeChangeService;
|
| 126 |
|
130 |
|
| 127 |
@Autowired
|
131 |
@Autowired
|
| 128 |
private Mongo mongoClient;
|
132 |
private Mongo mongoClient;
|
| 129 |
|
133 |
|
| 130 |
private static final Logger LOGGER = LogManager.getLogger(DashboardController.class);
|
134 |
private static final Logger LOGGER = LogManager.getLogger(DashboardController.class);
|
| Line 247... |
Line 251... |
| 247 |
if (isAdmin) {
|
251 |
if (isAdmin) {
|
| 248 |
return "dashboard1";
|
252 |
return "dashboard1";
|
| 249 |
} else {
|
253 |
} else {
|
| 250 |
try {
|
254 |
try {
|
| 251 |
fofoStore = fofoStoreRepository.selectByRetailerId(loginDetails.getFofoId());
|
255 |
fofoStore = fofoStoreRepository.selectByRetailerId(loginDetails.getFofoId());
|
| - |
|
256 |
PartnerType partnerType = partnerTypeChangeService.getTypeOnDate(fofoStore.getId(), LocalDate.now());
|
| 252 |
if (!fofoStore.isActive()) {
|
257 |
if (!fofoStore.isActive()) {
|
| 253 |
return "redirect:/login";
|
258 |
return "redirect:/login";
|
| 254 |
}
|
259 |
}
|
| - |
|
260 |
LOGGER.info("partnerType {}", partnerType);
|
| - |
|
261 |
|
| - |
|
262 |
model.addAttribute("partnerType", partnerType);
|
| 255 |
model.addAttribute("fofoStore", fofoStore);
|
263 |
model.addAttribute("fofoStore", fofoStore);
|
| - |
|
264 |
model.addAttribute("partnerType", partnerType);
|
| 256 |
model.addAttribute("hasGift", hasGift(loginDetails.getFofoId()));
|
265 |
model.addAttribute("hasGift", hasGift(loginDetails.getFofoId()));
|
| 257 |
model.addAttribute("giftItemId", ProfitMandiConstants.GIFT_ID);
|
266 |
model.addAttribute("giftItemId", ProfitMandiConstants.GIFT_ID);
|
| 258 |
|
267 |
|
| 259 |
model.addAttribute("brandStockPrices", this.getBrandStockPrices(loginDetails.getFofoId()));
|
268 |
model.addAttribute("brandStockPrices", this.getBrandStockPrices(loginDetails.getFofoId()));
|
| 260 |
model.addAttribute("salesMap", this.getSales(loginDetails.getFofoId()));
|
269 |
model.addAttribute("salesMap", this.getSales(loginDetails.getFofoId()));
|