| Line 26... |
Line 26... |
| 26 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
26 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| 27 |
import com.spice.profitmandi.common.model.BrandStockPrice;
|
27 |
import com.spice.profitmandi.common.model.BrandStockPrice;
|
| 28 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
28 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 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.HygieneData;
|
- |
|
| 32 |
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
|
31 |
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
|
| 33 |
import com.spice.profitmandi.dao.entity.fofo.PartnerTarget;
|
32 |
import com.spice.profitmandi.dao.entity.fofo.PartnerTarget;
|
| 34 |
import com.spice.profitmandi.dao.entity.fofo.PartnerTargetDetails;
|
33 |
import com.spice.profitmandi.dao.entity.fofo.PartnerTargetDetails;
|
| 35 |
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
|
34 |
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
|
| 36 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
35 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
| Line 40... |
Line 39... |
| 40 |
import com.spice.profitmandi.dao.repository.dtr.Mongo;
|
39 |
import com.spice.profitmandi.dao.repository.dtr.Mongo;
|
| 41 |
import com.spice.profitmandi.dao.repository.dtr.NotificationPanelRepository;
|
40 |
import com.spice.profitmandi.dao.repository.dtr.NotificationPanelRepository;
|
| 42 |
import com.spice.profitmandi.dao.repository.dtr.RechargeTransactionRepository;
|
41 |
import com.spice.profitmandi.dao.repository.dtr.RechargeTransactionRepository;
|
| 43 |
import com.spice.profitmandi.dao.repository.fofo.CurrentInventorySnapshotRepository;
|
42 |
import com.spice.profitmandi.dao.repository.fofo.CurrentInventorySnapshotRepository;
|
| 44 |
import com.spice.profitmandi.dao.repository.fofo.FofoOrderItemRepository;
|
43 |
import com.spice.profitmandi.dao.repository.fofo.FofoOrderItemRepository;
|
| 45 |
import com.spice.profitmandi.dao.repository.fofo.HygieneDataRepository;
|
- |
|
| 46 |
import com.spice.profitmandi.dao.repository.fofo.PartnerDailyInvestmentRepository;
|
44 |
import com.spice.profitmandi.dao.repository.fofo.PartnerDailyInvestmentRepository;
|
| 47 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTargetRepository;
|
45 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTargetRepository;
|
| 48 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
|
46 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
|
| 49 |
import com.spice.profitmandi.dao.repository.fofo.TargetSlabRepository;
|
47 |
import com.spice.profitmandi.dao.repository.fofo.TargetSlabRepository;
|
| 50 |
import com.spice.profitmandi.service.PartnerInvestmentService;
|
48 |
import com.spice.profitmandi.service.PartnerInvestmentService;
|
| Line 129... |
Line 127... |
| 129 |
private InsuranceProviderRepository insuranceProviderRepository;
|
127 |
private InsuranceProviderRepository insuranceProviderRepository;
|
| 130 |
@Autowired
|
128 |
@Autowired
|
| 131 |
private PartnerTypeChangeService partnerTypeChangeService;
|
129 |
private PartnerTypeChangeService partnerTypeChangeService;
|
| 132 |
|
130 |
|
| 133 |
@Autowired
|
131 |
@Autowired
|
| 134 |
private HygieneDataRepository hygieneDataRepository;
|
- |
|
| 135 |
|
- |
|
| 136 |
@Autowired
|
- |
|
| 137 |
private Mongo mongoClient;
|
132 |
private Mongo mongoClient;
|
| 138 |
|
133 |
|
| 139 |
private static final Logger LOGGER = LogManager.getLogger(DashboardController.class);
|
134 |
private static final Logger LOGGER = LogManager.getLogger(DashboardController.class);
|
| 140 |
|
135 |
|
| 141 |
@RequestMapping(value = "/12dashboard34", method = RequestMethod.GET)
|
136 |
@RequestMapping(value = "/12dashboard34", method = RequestMethod.GET)
|
| Line 171... |
Line 166... |
| 171 |
investments.put("today", investment.getTotalInvestment());
|
166 |
investments.put("today", investment.getTotalInvestment());
|
| 172 |
investments.put("investment", investment);
|
167 |
investments.put("investment", investment);
|
| 173 |
investments.put("inStock", investment.getInStockAmount());
|
168 |
investments.put("inStock", investment.getInStockAmount());
|
| 174 |
investments.put("minimum", investment.getMinInvestmentString());
|
169 |
investments.put("minimum", investment.getMinInvestmentString());
|
| 175 |
investments.put("short", investment.getShortPercentage());
|
170 |
investments.put("short", investment.getShortPercentage());
|
| 176 |
investments.put("okDays",okInvestmentDays + (currentMonthStart.lengthOfMonth() - currentMonthInvestments.size()));
|
171 |
investments.put("okDays", okInvestmentDays + (yesterDate.getDayOfMonth() - currentMonthInvestments.size()));
|
| 177 |
return investments;
|
172 |
return investments;
|
| 178 |
}
|
173 |
}
|
| 179 |
|
174 |
|
| 180 |
private Map<String, Object> getSales(int fofoId) {
|
175 |
private Map<String, Object> getSales(int fofoId) {
|
| 181 |
Map<String, Object> salesMap = new LinkedHashMap<>();
|
176 |
Map<String, Object> salesMap = new LinkedHashMap<>();
|
| Line 280... |
Line 275... |
| 280 |
} catch (ProfitMandiBusinessException e) {
|
275 |
} catch (ProfitMandiBusinessException e) {
|
| 281 |
LOGGER.error("FofoStore Code not found of fofoId {}", loginDetails.getFofoId());
|
276 |
LOGGER.error("FofoStore Code not found of fofoId {}", loginDetails.getFofoId());
|
| 282 |
|
277 |
|
| 283 |
}
|
278 |
}
|
| 284 |
}
|
279 |
}
|
| 285 |
|
- |
|
| 286 |
LocalDateTime currentMonth = LocalDateTime.now().withDayOfMonth(1);
|
- |
|
| 287 |
List<HygieneData> hygieneData = hygieneDataRepository
|
- |
|
| 288 |
.selectAll(loginDetails.getFofoId(), currentMonth, LocalDateTime.now().plusMonths(1).withDayOfMonth(1))
|
- |
|
| 289 |
.stream().filter(x -> x.getDisposedTimestamp() != null).collect(Collectors.toList());
|
- |
|
| 290 |
|
- |
|
| 291 |
LOGGER.info("hygieneData" + hygieneData);
|
- |
|
| 292 |
int successHygieneData = hygieneData.stream().filter(x -> x.getHygieneRating() == true)
|
- |
|
| 293 |
.collect(Collectors.toList()).size();
|
- |
|
| 294 |
int unsuccessfullHygieneData = hygieneData.stream().filter(x -> x.getHygieneRating() == false)
|
- |
|
| 295 |
.collect(Collectors.toList()).size();
|
- |
|
| 296 |
|
- |
|
| 297 |
LOGGER.info("successHygieneData" + successHygieneData);
|
- |
|
| 298 |
LOGGER.info("fullHygieneData" + successHygieneData + unsuccessfullHygieneData);
|
- |
|
| 299 |
|
- |
|
| 300 |
model.addAttribute("successHygieneData", successHygieneData);
|
- |
|
| 301 |
model.addAttribute("fullHygieneData", successHygieneData + unsuccessfullHygieneData);
|
- |
|
| 302 |
model.addAttribute("monthDays", LocalDate.now().minusDays(1).lengthOfMonth());
|
280 |
model.addAttribute("monthDays", LocalDate.now().minusDays(1).lengthOfMonth());
|
| 303 |
model.addAttribute("dayOfMonth", LocalDate.now().minusDays(1).getDayOfMonth());
|
281 |
model.addAttribute("dayOfMonth", LocalDate.now().minusDays(1).getDayOfMonth());
|
| 304 |
return "dashboard1";
|
282 |
return "dashboard1";
|
| 305 |
}
|
283 |
}
|
| 306 |
|
284 |
|