Subversion Repositories SmartDukaan

Rev

Show changed files | Details | Compare with Previous | Blame | RSS feed

Filtering Options

Rev Age Author Path Log message Diff
35848 123 d 1 h amit /trunk/ Refactor investment logic to use own investment (total - utilized), remove minimumInvestmentOld, add OK_INVESTMENT_SHORT_PERCENTAGE constant, update thresholds CUTOFF_INVESTMENT=10 MIN_INVESTMENT_PERCENTAGE=5  
35537 170 d 16 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Optimize getAllPartnerStats: combine 5 tertiary queries into 1 using CASE WHEN pattern

- Added PartnerTertiarySalesModel to hold combined tertiary data
- Added FofoOrder.selectPartnerTertiarySales named query using CASE WHEN
- Added selectPartnerTertiarySales() batch method in FofoOrderItemRepository
- Updated PartnerStatsServiceImpl to use single combined query
- Reduces 5 DB queries to 1 for tertiary sales data (lmtd, mtd, lms, today, last3days)
 
35536 170 d 23 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Optimize fetchParnterStats() - fix N+1 query issues

Performance improvements:
- Use batch method getAuthUserAndEsclationByPartnerIds() instead of N+1 loop
- Add new batch method getInvestmentsForFofoStores() to replace N+1 getInvestment() calls
- Add batch query selectActivatedGrnPendingAmountByFofoIds in ActivatedImeiRepository

Before: ~900 queries for 100 stores
After: ~7 queries for 100 stores
 
35460 189 d 13 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Fix LockAcquisitionException: Add bulk partner type fetch with MAX(base, current_sales) logic

Problem:
- N+1 queries calling getTypeOnDate caused concurrent persist operations
- This led to LockAcquisitionException during high concurrency

Solution:
- Add getTypesForFofoIds() bulk read method for N+1 scenarios
- Add getBaseTypesForFofoIds() to fetch base types (first record of month)
- Implement MAX(base, current_sales) logic:
- Partner can upgrade mid-month based on current sales
- Partner can downgrade from upgrade but NOT below base
- Base type = previous month's sales tier
- Reduce cache from 1 day to 30 minutes for faster upgrade propagation
 
35394 193 d 15 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Improved performance  
33505 728 d 23 h amit.gupta /trunk/ Fixed sanction  
32436 1017 d 9 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/ Scheduled Task  
32435 1018 d 0 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/ Fixed rbm missing in detailed report  
32430 1018 d 7 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/ Fixed front end related issues with add/remove row  
32429 1018 d 8 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/ Fixed front end related issues with add/remove row  
32421 1019 d 4 h amit.gupta /trunk/ Added rmbs data in PartnerDetailModel  
31569 1235 d 1 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/ Fixed SD Credit  
31567 1235 d 3 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/ Fixed Stats logic removed internal ids  
31285 1289 d 1 h tejbeer /trunk/ change  
28617 1810 d 5 h tejbeer /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/  
28377 1872 d 22 h tejbeer /trunk/ chnages  
27907 1941 d 5 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/  
27903 1941 d 23 h tejbeer /trunk/ chnage  
27893 1942 d 5 h tejbeer /trunk/ secondary changes  
27749 1968 d 3 h tejbeer /trunk/ change  
27733 1973 d 0 h tejbeer /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/  
27732 1973 d 0 h tejbeer /trunk/ change  
27660 1986 d 21 h tejbeer /trunk/ change  
27635 1991 d 23 h tejbeer /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/ change  
27632 1991 d 23 h tejbeer /trunk/ chnage  
27628 1992 d 21 h tejbeer /trunk/ change  
27559 2004 d 22 h tejbeer /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/ change  
27552 2006 d 21 h tejbeer /trunk/  
27550 2006 d 22 h tejbeer /trunk/ change  
27549 2007 d 0 h tejbeer /trunk/ change  
27548 2007 d 3 h tejbeer /trunk/ change  
27545 2007 d 21 h tejbeer /trunk/ change  
27124 2090 d 21 h amit.gupta /trunk/ Fixed escalation  
27016 2123 d 21 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/  
26479 2292 d 20 h amit.gupta /trunk/  
26470 2292 d 21 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/  
26466 2292 d 22 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/  
26465 2292 d 22 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/  
26464 2292 d 22 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/  
26463 2292 d 23 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/