Subversion Repositories SmartDukaan

Rev

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

Filtering Options

Rev Age Author Path Log message Diff
35848 77 d 17 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 125 d 8 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 125 d 15 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 144 d 5 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 148 d 7 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Improved performance  
33505 683 d 15 h amit.gupta /trunk/ Fixed sanction  
32436 972 d 1 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/ Scheduled Task  
32435 972 d 16 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/ Fixed rbm missing in detailed report  
32430 972 d 23 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/ Fixed front end related issues with add/remove row  
32429 972 d 23 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/ Fixed front end related issues with add/remove row  
32421 973 d 20 h amit.gupta /trunk/ Added rmbs data in PartnerDetailModel  
31569 1189 d 16 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/ Fixed SD Credit  
31567 1189 d 19 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/ Fixed Stats logic removed internal ids  
31285 1243 d 17 h tejbeer /trunk/ change  
28617 1764 d 21 h tejbeer /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/  
28377 1827 d 13 h tejbeer /trunk/ chnages  
27907 1895 d 21 h amit.gupta /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/  
27903 1896 d 15 h tejbeer /trunk/ chnage  
27893 1896 d 21 h tejbeer /trunk/ secondary changes  
27749 1922 d 18 h tejbeer /trunk/ change  

Show All