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
35474 135 d 16 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/ Optimize selectTodayOrders query: Replace OR with UNION ALL to avoid sort_union operation for today_po endpoint  
35473 135 d 16 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/entity/transaction/ Optimize selectTodayOrdersRBM query: Replace OR with UNION ALL to avoid sort_union operation and improve query performance  
35472 135 d 17 h vikas /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/dtr/ Leads Follow ups  
35471 135 d 18 h vikas /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/dtr/ Leads Follow ups  
35470 135 d 20 h vikas /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/dtr/ Leads Follow ups  
35469 135 d 20 h vikas /trunk/profitmandi-web/src/main/java/com/spice/profitmandi/web/controller/ Leads Follow ups  
35468 135 d 20 h vikas /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/dtr/ Leads Follow ups  
35467 135 d 21 h amit /trunk/ Optimize /lead-description endpoint

- Add null check for authUser to prevent NPE
- Move visitRequests query inside followUp block
- Move Comparator outside loop
- Rewrite selectLeadsScheduledBetweenDate using Criteria API with Predicates
- Single query joins Lead + LeadActivity with filters in DB
- Remove in-memory filtering of assignTo
 
35466 136 d 3 h amit /trunk/ Optimize getActivatedImeiUpdationDate endpoint

- Add 30-day date filter to reduce table scan
- Replace LineItemImeiView with direct LineItemImei table
- Merge results with master brands/warehouses to show all combinations
- Display '-' for missing timestamps instead of hiding rows
 
35465 136 d 12 h amit /trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/controller/monitors/ Optimize today_po_rbm: single-pass iteration for warehouseWalletAmountModels

- Replace two separate stream operations with single loop
- Use EnumSet for efficient WalletReferenceType lookup
- Use Map.merge() for cleaner aggregation
 
35464 136 d 12 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/ Optimize /getActivatedModelByBrand and related activation queries

- Add date range filtering in WHERE clause to use activation_timestamp index
- Replace concat(year,month) with direct date comparisons for better performance
- Optimize getAuthFofoIds to avoid unnecessary DB call when user found in cache
- Use anyMatch() instead of filter().count() for short-circuit evaluation
 
35463 136 d 12 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/ Optimize /getMobileBrandWise and /getMobileLMSGraph queries

- Replace concat(year(), month()) pattern with date range comparisons
- Enables index usage on create_timestamp and activation_timestamp columns
- Update repository methods to pass date range parameters instead of string patterns
 
35462 136 d 13 h amit /trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/controller/ Fix LockAcquisitionException: Use bulk partner type fetch in controllers

Use getTypesForFofoIds() bulk method to avoid N+1 queries in:
- IndentController
- PlacementPlanController
- OrderManagementController
 
35461 136 d 13 h amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Fix LockAcquisitionException: Use bulk partner type fetch in ScheduledTasks

Use getTypesForFofoIds() bulk method in rollOutUpgardedMargins to avoid N+1 queries
 
35460 136 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
 
35459 136 d 20 h amit /trunk/ Revert non-Java file changes from r35458  
35458 136 d 20 h amit /trunk/ Revert @Transactional(readOnly=true) - keep @Transactional only at Controller level

Changes:
- profitmandi-web: Controllers use @Transactional(rollbackFor = Throwable.class) at class level, removed method-level @Transactional(readOnly = true)
- profitmandi-fofo: Controllers use @Transactional(rollbackFor = Throwable.class) at class level, removed method-level @Transactional
- profitmandi-dao: Removed @Transactional from services/repositories

Exceptions (called from interceptors, need own transaction):
- RoleManager: @Transactional(readOnly = true) - called from interceptor for auth
- PartnerTypeChangeServiceImpl.getBestPartner(): @Transactional - called from JWTUtil via interceptor

Fixed javax.transaction.Transactional to org.springframework.transaction.annotation.Transactional
Fixed rollbackOn to rollbackFor for Spring compatibility
 
35457 136 d 21 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/fofo/ Fixed method thats not readonly  
35456 136 d 21 h amit /trunk/profitmandi-web/src/main/java/com/spice/profitmandi/web/controller/ Fixed method thats not readonly  
35455 136 d 23 h ranu /trunk/profitmandi-web/src/main/java/com/spice/profitmandi/web/controller/checkout/ order controller @Transaction roll back for current  

Show All