| 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;
|
| 31 |
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
|
32 |
import com.spice.profitmandi.dao.entity.fofo.PartnerDailyInvestment;
|
| 32 |
import com.spice.profitmandi.dao.entity.fofo.PartnerTarget;
|
33 |
import com.spice.profitmandi.dao.entity.fofo.PartnerTarget;
|
| 33 |
import com.spice.profitmandi.dao.entity.fofo.PartnerTargetDetails;
|
34 |
import com.spice.profitmandi.dao.entity.fofo.PartnerTargetDetails;
|
| 34 |
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
|
35 |
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
|
| 35 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
36 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
| Line 39... |
Line 40... |
| 39 |
import com.spice.profitmandi.dao.repository.dtr.Mongo;
|
40 |
import com.spice.profitmandi.dao.repository.dtr.Mongo;
|
| 40 |
import com.spice.profitmandi.dao.repository.dtr.NotificationPanelRepository;
|
41 |
import com.spice.profitmandi.dao.repository.dtr.NotificationPanelRepository;
|
| 41 |
import com.spice.profitmandi.dao.repository.dtr.RechargeTransactionRepository;
|
42 |
import com.spice.profitmandi.dao.repository.dtr.RechargeTransactionRepository;
|
| 42 |
import com.spice.profitmandi.dao.repository.fofo.CurrentInventorySnapshotRepository;
|
43 |
import com.spice.profitmandi.dao.repository.fofo.CurrentInventorySnapshotRepository;
|
| 43 |
import com.spice.profitmandi.dao.repository.fofo.FofoOrderItemRepository;
|
44 |
import com.spice.profitmandi.dao.repository.fofo.FofoOrderItemRepository;
|
| - |
|
45 |
import com.spice.profitmandi.dao.repository.fofo.HygieneDataRepository;
|
| 44 |
import com.spice.profitmandi.dao.repository.fofo.PartnerDailyInvestmentRepository;
|
46 |
import com.spice.profitmandi.dao.repository.fofo.PartnerDailyInvestmentRepository;
|
| 45 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTargetRepository;
|
47 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTargetRepository;
|
| 46 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
|
48 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
|
| 47 |
import com.spice.profitmandi.dao.repository.fofo.TargetSlabRepository;
|
49 |
import com.spice.profitmandi.dao.repository.fofo.TargetSlabRepository;
|
| 48 |
import com.spice.profitmandi.service.PartnerInvestmentService;
|
50 |
import com.spice.profitmandi.service.PartnerInvestmentService;
|
| Line 127... |
Line 129... |
| 127 |
private InsuranceProviderRepository insuranceProviderRepository;
|
129 |
private InsuranceProviderRepository insuranceProviderRepository;
|
| 128 |
@Autowired
|
130 |
@Autowired
|
| 129 |
private PartnerTypeChangeService partnerTypeChangeService;
|
131 |
private PartnerTypeChangeService partnerTypeChangeService;
|
| 130 |
|
132 |
|
| 131 |
@Autowired
|
133 |
@Autowired
|
| - |
|
134 |
private HygieneDataRepository hygieneDataRepository;
|
| - |
|
135 |
|
| - |
|
136 |
@Autowired
|
| 132 |
private Mongo mongoClient;
|
137 |
private Mongo mongoClient;
|
| 133 |
|
138 |
|
| 134 |
private static final Logger LOGGER = LogManager.getLogger(DashboardController.class);
|
139 |
private static final Logger LOGGER = LogManager.getLogger(DashboardController.class);
|
| 135 |
|
140 |
|
| 136 |
@RequestMapping(value = "/12dashboard34", method = RequestMethod.GET)
|
141 |
@RequestMapping(value = "/12dashboard34", method = RequestMethod.GET)
|
| Line 166... |
Line 171... |
| 166 |
investments.put("today", investment.getTotalInvestment());
|
171 |
investments.put("today", investment.getTotalInvestment());
|
| 167 |
investments.put("investment", investment);
|
172 |
investments.put("investment", investment);
|
| 168 |
investments.put("inStock", investment.getInStockAmount());
|
173 |
investments.put("inStock", investment.getInStockAmount());
|
| 169 |
investments.put("minimum", investment.getMinInvestmentString());
|
174 |
investments.put("minimum", investment.getMinInvestmentString());
|
| 170 |
investments.put("short", investment.getShortPercentage());
|
175 |
investments.put("short", investment.getShortPercentage());
|
| 171 |
investments.put("okDays", okInvestmentDays + (currentMonthStart.lengthOfMonth() - currentMonthInvestments.size()));
|
176 |
investments.put("okDays",okInvestmentDays + (currentMonthStart.lengthOfMonth() - currentMonthInvestments.size()));
|
| 172 |
return investments;
|
177 |
return investments;
|
| 173 |
}
|
178 |
}
|
| 174 |
|
179 |
|
| 175 |
private Map<String, Object> getSales(int fofoId) {
|
180 |
private Map<String, Object> getSales(int fofoId) {
|
| 176 |
Map<String, Object> salesMap = new LinkedHashMap<>();
|
181 |
Map<String, Object> salesMap = new LinkedHashMap<>();
|
| Line 275... |
Line 280... |
| 275 |
} catch (ProfitMandiBusinessException e) {
|
280 |
} catch (ProfitMandiBusinessException e) {
|
| 276 |
LOGGER.error("FofoStore Code not found of fofoId {}", loginDetails.getFofoId());
|
281 |
LOGGER.error("FofoStore Code not found of fofoId {}", loginDetails.getFofoId());
|
| 277 |
|
282 |
|
| 278 |
}
|
283 |
}
|
| 279 |
}
|
284 |
}
|
| - |
|
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);
|
| 280 |
model.addAttribute("monthDays", LocalDate.now().minusDays(1).lengthOfMonth());
|
302 |
model.addAttribute("monthDays", LocalDate.now().minusDays(1).lengthOfMonth());
|
| 281 |
model.addAttribute("dayOfMonth", LocalDate.now().minusDays(1).getDayOfMonth());
|
303 |
model.addAttribute("dayOfMonth", LocalDate.now().minusDays(1).getDayOfMonth());
|
| 282 |
return "dashboard1";
|
304 |
return "dashboard1";
|
| 283 |
}
|
305 |
}
|
| 284 |
|
306 |
|