| Line 63... |
Line 63... |
| 63 |
import com.spice.profitmandi.dao.entity.fofo.Purchase;
|
63 |
import com.spice.profitmandi.dao.entity.fofo.Purchase;
|
| 64 |
import com.spice.profitmandi.dao.entity.fofo.SaleHeadDetails;
|
64 |
import com.spice.profitmandi.dao.entity.fofo.SaleHeadDetails;
|
| 65 |
import com.spice.profitmandi.dao.entity.fofo.ScanRecord;
|
65 |
import com.spice.profitmandi.dao.entity.fofo.ScanRecord;
|
| 66 |
import com.spice.profitmandi.dao.entity.fofo.SchemeInOut;
|
66 |
import com.spice.profitmandi.dao.entity.fofo.SchemeInOut;
|
| 67 |
import com.spice.profitmandi.dao.entity.transaction.PriceDrop;
|
67 |
import com.spice.profitmandi.dao.entity.transaction.PriceDrop;
|
| - |
|
68 |
import com.spice.profitmandi.dao.entity.transaction.UserWalletHistory;
|
| 68 |
import com.spice.profitmandi.dao.entity.user.Address;
|
69 |
import com.spice.profitmandi.dao.entity.user.Address;
|
| 69 |
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
|
70 |
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
|
| 70 |
import com.spice.profitmandi.dao.enumuration.fofo.ScanType;
|
71 |
import com.spice.profitmandi.dao.enumuration.fofo.ScanType;
|
| 71 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
72 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| 72 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
73 |
import com.spice.profitmandi.dao.repository.catalog.ItemRepository;
|
| Line 88... |
Line 89... |
| 88 |
import com.spice.profitmandi.dao.repository.fofo.PurchaseRepository;
|
89 |
import com.spice.profitmandi.dao.repository.fofo.PurchaseRepository;
|
| 89 |
import com.spice.profitmandi.dao.repository.fofo.ScanRecordRepository;
|
90 |
import com.spice.profitmandi.dao.repository.fofo.ScanRecordRepository;
|
| 90 |
import com.spice.profitmandi.dao.repository.fofo.SchemeInOutRepository;
|
91 |
import com.spice.profitmandi.dao.repository.fofo.SchemeInOutRepository;
|
| 91 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
92 |
import com.spice.profitmandi.dao.repository.transaction.OrderRepository;
|
| 92 |
import com.spice.profitmandi.dao.repository.transaction.PriceDropRepository;
|
93 |
import com.spice.profitmandi.dao.repository.transaction.PriceDropRepository;
|
| - |
|
94 |
import com.spice.profitmandi.dao.repository.transaction.UserWalletHistoryRepository;
|
| 93 |
import com.spice.profitmandi.dao.repository.user.AddressRepository;
|
95 |
import com.spice.profitmandi.dao.repository.user.AddressRepository;
|
| 94 |
import com.spice.profitmandi.service.PartnerInvestmentService;
|
96 |
import com.spice.profitmandi.service.PartnerInvestmentService;
|
| 95 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
97 |
import com.spice.profitmandi.service.inventory.InventoryService;
|
| 96 |
import com.spice.profitmandi.service.order.OrderService;
|
98 |
import com.spice.profitmandi.service.order.OrderService;
|
| 97 |
import com.spice.profitmandi.service.pricing.PriceDropService;
|
99 |
import com.spice.profitmandi.service.pricing.PriceDropService;
|
| Line 180... |
Line 182... |
| 180 |
@Autowired
|
182 |
@Autowired
|
| 181 |
private RechargeProviderCreditWalletHistoryRepository rechargeProviderCreditWalletHistoryRepository;
|
183 |
private RechargeProviderCreditWalletHistoryRepository rechargeProviderCreditWalletHistoryRepository;
|
| 182 |
|
184 |
|
| 183 |
@Autowired
|
185 |
@Autowired
|
| 184 |
private FofoOrderRepository fofoOrderRepository;
|
186 |
private FofoOrderRepository fofoOrderRepository;
|
| - |
|
187 |
|
| - |
|
188 |
@Autowired
|
| - |
|
189 |
private UserWalletHistoryRepository userWalletHistoryRepository;
|
| 185 |
|
190 |
|
| 186 |
@Autowired
|
191 |
@Autowired
|
| 187 |
private InventoryItemRepository inventoryItemRepository;
|
192 |
private InventoryItemRepository inventoryItemRepository;
|
| 188 |
|
193 |
|
| 189 |
@Autowired
|
194 |
@Autowired
|
| Line 792... |
Line 797... |
| 792 |
}
|
797 |
}
|
| 793 |
}
|
798 |
}
|
| 794 |
|
799 |
|
| 795 |
}
|
800 |
}
|
| 796 |
|
801 |
|
| - |
|
802 |
public void schemewalletmismatch() {
|
| - |
|
803 |
LocalDate dateToReconcile = LocalDate.of(2018, 4, 1);
|
| - |
|
804 |
while(dateToReconcile.isBefore(LocalDate.now())) {
|
| - |
|
805 |
reconcileSchemes(dateToReconcile);
|
| - |
|
806 |
//reconcileOrders(dateTime);
|
| - |
|
807 |
//reconcileRecharges(dateTime);
|
| - |
|
808 |
dateToReconcile = dateToReconcile.plusDays(1);
|
| - |
|
809 |
}
|
| - |
|
810 |
}
|
| - |
|
811 |
|
| - |
|
812 |
private void reconcileSchemes(LocalDate date) {
|
| - |
|
813 |
LocalDateTime startDate = date.atStartOfDay();
|
| - |
|
814 |
LocalDateTime endDate = startDate.plusDays(1);
|
| - |
|
815 |
List<SchemeInOut> siosCreated = schemeInOutRepository.selectAllByCreateDate(startDate, endDate);
|
| - |
|
816 |
List<SchemeInOut> siosRefunded = schemeInOutRepository.selectAllByRefundDate(startDate, endDate);
|
| - |
|
817 |
double totalSchemeDisbursed = siosCreated.stream().mapToDouble(x->x.getAmount()).sum();
|
| - |
|
818 |
double totalSchemeRolledback = siosRefunded.stream().mapToDouble(x->x.getAmount()).sum();
|
| - |
|
819 |
double netSchemeDisbursed = totalSchemeDisbursed - totalSchemeRolledback;
|
| - |
|
820 |
List<WalletReferenceType> walletReferenceTypes = Arrays.asList(WalletReferenceType.SCHEME_IN, WalletReferenceType.SCHEME_OUT);
|
| - |
|
821 |
List<UserWalletHistory> history = userWalletHistoryRepository.selectAllByDateType(startDate, endDate, walletReferenceTypes);
|
| - |
|
822 |
double schemeAmountWalletTotal = history.stream().mapToDouble(x->x.getAmount()).sum();
|
| - |
|
823 |
if(Math.abs(netSchemeDisbursed-schemeAmountWalletTotal) > 10d) {
|
| - |
|
824 |
LOGGER.info("Scheme Amount mismatched for Date {}", date);
|
| - |
|
825 |
}
|
| - |
|
826 |
|
| - |
|
827 |
|
| - |
|
828 |
}
|
| - |
|
829 |
|
| 797 |
/*
|
830 |
/*
|
| 798 |
* public void processSchemeForModel(String string) { pricingService
|
831 |
* public void processSchemeForModel(String string) { pricingService
|
| 799 |
*
|
832 |
*
|
| 800 |
* }
|
833 |
* }
|
| 801 |
*/
|
834 |
*/
|