Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Show changed files | Directory listing | RSS feed

Filtering Options

Rev Age Author Path Log message Diff
35494 119 d 21 h amit /trunk/profitmandi-web/src/main/java/com/spice/profitmandi/web/controller/checkout/ N+1 query optimization for B2B order creation flow

- OrderController: Pre-fetch items and tagListings before cart line loop
- OrderController: Reuse brand stock data for both limit checks (3 queries instead of 6)

Performance improvement: ~20-30 DB queries reduced per order
 
35493 119 d 21 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ N+1 query optimization for B2B order creation flow

- OrderServiceImpl: Batch fetch PendingOrderItems before validation loop (line 402)
- OrderServiceImpl: Batch update opening stock using minusOpeningStockBatch
- OrderServiceImpl: Pre-fetch tagListings and GST rates before createAndGetFofoOrderItem loop
- OrderServiceImpl: Batch fetch PendingOrderItems for status update (line 719)
- CartServiceImpl: Pre-fetch items before getCartValidation loop
- SchemeServiceImpl: Batch fetch SchemeInOut records in processSchemeOut
- SmartCartService: Added minusOpeningStockBatch method for batch updates
- TagListingRepository: Added selectByItemIds batch method
- FofoOpeningStockRepository: Added findByFofoIdAndCatalogIds batch method
- PendingOrderItemRepository: Added selectByIds batch method

Performance improvement: ~70-100 DB queries reduced per order (10 items avg)
 
35492 120 d 1 h ranu /trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/controller/ givemn fin service access to alok  
35491 120 d 4 h ranu /trunk/profitmandi-web/src/main/java/com/spice/profitmandi/web/controller/ out of stock allocation  
35490 121 d 1 h ranu /trunk/ given brandwise placement acesseries qty instead of value  
35489 121 d 2 h aman /trunk/ Fix:Trial Activation Mail  
35488 121 d 4 h ranu /trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/config/ place ment plan page show catalog status wise  
35487 121 d 4 h ranu /trunk/ place ment plan page show catalog status wise  
35486 121 d 7 h vikas /trunk/profitmandi-web/src/main/java/com/spice/profitmandi/web/controller/ Listing Error: List should not be empty  
35485 121 d 9 h aman /trunk/ Fix:Trial Add required to assign asm and bm in trial form and also add tarun sir in bcc  
35484 122 d 1 h ranu /trunk/profitmandi-fofo/src/main/ in brnd wise placement showed qty instead of stock value as per tarun sir  
35483 122 d 5 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Default null partnerType to Rising Star (PartnerType.NEW) in PartnerDetailModel.getPartnerType()  
35482 122 d 5 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/ Default null partnerType to Rising Star (PartnerType.NEW) in getAllStatePartnerType  
35481 122 d 5 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/ Fix NPE in getAllStatePartnerType - add null checks for PartnerDetailModel and partnerType  
35480 122 d 5 h amit /trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/controller/ Fix NPE in getWarehousePartners when warehouseId=0 and show all partner stats; add stack trace logging to GlobalExceptionHandler  
35479 122 d 18 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/model/ Optimize Aging.SoldAgingModel query and fix column mapping

- Changed DATEDIFF(NOW(), inv.invoiceDate) > 15 to sargable condition
- Fixed trailing spaces in column names (SLOWMOVING_Billed, RUNNING_Billed, etc.)
- Enables index usage on invoiceDate column

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
 
35478 122 d 18 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/model/ Fix Aging.15DaysOurStock query - remove invalid p.warehouseId column

- Removed po.warehouseId = p.warehouseId (purchase table has no warehouseId)
- The warehouseId match is already handled in ii2 join: ii2.physicalWarehouseId = po.warehouseId
- Verified results match original query exactly

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
 
35477 122 d 18 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/model/ Fix FASTMOVING column name trailing space in SqlResultSetMapping

- Removed trailing space from "FASTMOVING " to "FASTMOVING"
- This was causing SQLGrammarException: could not extract ResultSet

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
 
35476 122 d 18 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/model/ Optimize Aging.15DaysOurStock query for better performance

- Restructured query to start from invoice table with sargable date filter
- Changed DATEDIFF(now(), inv.invoiceDate) > 15 to inv.invoiceDate < DATE_SUB(CURDATE(), INTERVAL 15 DAY)
- Reordered JOINs for better query execution plan
- Allows MySQL to use index on invoiceDate for initial filtering

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
 
35475 122 d 19 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/transaction/ Optimize selectTodayOrdersRBM: Replace derived table subquery with direct JOINs - 33x faster (78s -> 2.3s)  

Show All