| Line 1... |
Line 1... |
| 1 |
package com.spice.profitmandi.service;
|
1 |
package com.spice.profitmandi.service;
|
| 2 |
|
2 |
|
| 3 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
3 |
import com.spice.profitmandi.common.exception.ProfitMandiBusinessException;
|
| - |
|
4 |
import com.spice.profitmandi.dao.entity.inventory.SalesTargets;
|
| 4 |
import com.spice.profitmandi.dao.model.*;
|
5 |
import com.spice.profitmandi.dao.model.*;
|
| 5 |
import org.springframework.stereotype.Service;
|
6 |
import org.springframework.stereotype.Service;
|
| 6 |
|
7 |
|
| 7 |
import java.time.LocalDate;
|
8 |
import java.time.LocalDate;
|
| 8 |
import java.util.List;
|
9 |
import java.util.List;
|
| Line 26... |
Line 27... |
| 26 |
|
27 |
|
| 27 |
List<RbmBrandPartnerCountModel> getBrandPartnerCountByRbm(int authId, int warehouseId, LocalDate startDate, LocalDate endDate);
|
28 |
List<RbmBrandPartnerCountModel> getBrandPartnerCountByRbm(int authId, int warehouseId, LocalDate startDate, LocalDate endDate);
|
| 28 |
|
29 |
|
| 29 |
List<WarehouseBuyingByMovementModel> getWarehouseBuyingByMovement(int warehouseId, LocalDate startDate, LocalDate endDate);
|
30 |
List<WarehouseBuyingByMovementModel> getWarehouseBuyingByMovement(int warehouseId, LocalDate startDate, LocalDate endDate);
|
| 30 |
|
31 |
|
| - |
|
32 |
/**
|
| - |
|
33 |
* Daily writer for Sales-hierarchy targets (mirrors {@link #setMovementWiseRbmTargets}).
|
| - |
|
34 |
* Reads today's persisted RBM snapshots from inventory.rbm_targets, rolls them up per
|
| - |
|
35 |
* (sales_auth_id × warehouse_id) for every active Sales person whose downline contains
|
| - |
|
36 |
* at least one RBM, and inserts one row per (sales, warehouse) into inventory.sales_targets.
|
| - |
|
37 |
* Intended to run once daily via the cron flag {@code pushSalesTargets},
|
| - |
|
38 |
* chained after {@code pushRbmTargets}.
|
| - |
|
39 |
*/
|
| - |
|
40 |
void setSalesTargets();
|
| - |
|
41 |
|
| - |
|
42 |
/**
|
| - |
|
43 |
* Same as {@link #setSalesTargets()} but for a specific date — reads that
|
| - |
|
44 |
* day's persisted RBM snapshots and writes Sales snapshots stamped to that
|
| - |
|
45 |
* day. Useful for backfilling missed cron runs or seeding local/staging
|
| - |
|
46 |
* data without needing today's RBM snapshot.
|
| - |
|
47 |
*/
|
| - |
|
48 |
void setSalesTargetsForDate(LocalDate date);
|
| - |
|
49 |
|
| - |
|
50 |
List<SalesTargets> getSalesTargetsByDates(LocalDate startDate, LocalDate endDate);
|
| - |
|
51 |
|
| - |
|
52 |
/**
|
| - |
|
53 |
* Historical snapshot writer for Sales-hierarchy achievement (mirrors
|
| - |
|
54 |
* {@link #setMovementWiseRbmAchievement}). Rolls up today's live order
|
| - |
|
55 |
* ACH into one row per (Sales person × warehouse) and persists to
|
| - |
|
56 |
* {@code inventory.sales_achievements} for later reconciliation.
|
| - |
|
57 |
* The DRR dashboard reads ACH LIVE from orders — this table is audit only.
|
| - |
|
58 |
*/
|
| - |
|
59 |
void setSalesAchievements();
|
| - |
|
60 |
|
| - |
|
61 |
/**
|
| - |
|
62 |
* Dated variant of {@link #setSalesAchievements()} for backfill.
|
| - |
|
63 |
*/
|
| - |
|
64 |
void setSalesAchievementsForDate(LocalDate date);
|
| - |
|
65 |
|
| 31 |
List<RbmTargetAndAchievementsModel> getRbmTargetsAndAchievemnts(LocalDate startDate, LocalDate endDate);
|
66 |
List<RbmTargetAndAchievementsModel> getRbmTargetsAndAchievemnts(LocalDate startDate, LocalDate endDate);
|
| 32 |
|
67 |
|
| 33 |
List<RbmArrViewModel> getRbmTodayArr(LocalDate todayDate) throws Exception;
|
68 |
List<RbmArrViewModel> getRbmTodayArr(LocalDate todayDate) throws Exception;
|
| 34 |
|
69 |
|
| 35 |
List<RbmArrViewModel> getRbmTodayArr() throws Exception;
|
70 |
List<RbmArrViewModel> getRbmTodayArr() throws Exception;
|