Subversion Repositories SmartDukaan

Rev

Show changed files | Directory listing | RSS feed

Filtering Options

Rev Age Author Path Log message Diff
36304 2 h 27 m aman /trunk/profitmandi-fofo/src/main/webapp/WEB-INF/views/ftl/ Fix:Show ICICI Bank Ltd in fullstock req pannel  
36303 2 h 58 m aman /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Feat:Separate partner name and code into different columns in Partner Credit Report  
36302 3 h 22 m amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/catalog/ Add 2-min cache on Catalog.selectAllGoodStockBrandWise

Hottest query right now on the DB: 3851 execs x 297ms = ~1143 s over
2.9h uptime. Fired once per target-slab in TodayOfferServiceImpl's
findAllTodayOffer loop whenever the slab has no explicit catalog IDs.

Input is a single String brand (only ~10 brands), output is a list of
Catalog entities with no associations (all primitive/String columns,
no lazy-init risk) and the caller only invokes getBrand/getId on the
results. Safe to cache in the existing in-memory Caffeine
twoMintimeoutCacheManager.

Default Spring key (= brand) is stable; unless skips empty results.
 
36301 4 h 6 m ranu /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/model/ code optimization of today po rbm page  
36300 5 h 0 m amit /trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/config/ Bump JS version to 331 to bust cache for GRN correction auto-approve UI change  
36299 5 h 12 m amit /trunk/profitmandi-fofo/src/main/ GRN correction: surface autoApproved flag to UI

Controller returns {status, autoApproved} JSON; JS shows an
'auto-approved' message when the request bypasses approval, otherwise
the existing 'raised for approval' message. Pairs with dao r36298.
 
36298 5 h 12 m amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/service/warehouse/ GRN correction: auto-approve IMEI-only and color-only changes

When a correction request contains only IMEI swaps or item swaps where
old and new items share modelName+modelNumber (color-only change), the
request is persisted as APPROVED with requester as approver and applied
immediately. Mixed/model/qty changes continue to go through the existing
PENDING approval flow.
 
36297 6 h 2 m amit /trunk/profitmandi-fofo/src/main/java/com/spice/profitmandi/web/controller/monitors/ Fix MonitorController autowiring after @Cacheable proxy

UserWalletRepositoryImpl now has @Cacheable (r36296), which makes Spring
wrap it in a JDK interface proxy. MonitorController autowired the concrete
class, breaking startup with BeanNotOfRequiredTypeException. Switch to the
interface UserWalletRepository, matching every other repository injection
in the file.
 
36296 6 h 14 m amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Add 2-min cache on dashboard-family queries

Three queries dominate dashboard DB time (~830 s / 30 min combined) because
they re-execute on every dashboard refresh with near-identical parameters:

- OrderRepositoryImpl.selectPartnersBilledBetweenDates: dynamic endDate is
LocalDateTime.now(), so cache key bucketed to 2-minute boundaries via SpEL
(endDate.toEpochSecond / 120) so calls in the same bucket share an entry.
- UserWalletRepositoryImpl.getPartnerWiseCollectionAchievement and
RbmTargetServiceImpl.getWeeklyBillingDataForMonth: default Spring key
(fofoIds + startDate) is stable, no bucketing needed.

All three use the existing Caffeine 'twoMintimeoutCacheManager' (in-memory,
per-JVM, expireAfterWrite=2min). unless clause skips caching empty results
so legitimately-empty responses don't pin a bad entry.
 
36295 6 h 41 m amit /trunk/profitmandi-common/src/main/java/com/spice/profitmandi/common/web/client/ Plug response-entity leak in RestClient

Apache HttpClient connections are released back to the PoolingConnectionManager
only when the response entity is fully consumed. Error paths in execute(),
executeMandii(), and executeJson() threw before consumeQuietly was called,
leaking pool slots and accumulating CLOSE_WAIT sockets against Solr, Tomcat,
and external APIs. Wrap each in try/finally with EntityUtils.consumeQuietly
so the connection is always returned. Methods that return raw HttpResponse
(getResponse, postResponse) are still caller-close responsibility.
 
36294 7 h 50 m amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/transaction/ Remove @Cacheable from getFirstBillingDate

Temporary revert while cache null-handling is reviewed end-to-end.
The method returns null for partners with no billing history; the
Redis cache (disableCachingNullValues) was causing log noise even
after unless="#result == null" was added. Reverting to direct DB
lookup until a proper caching strategy (e.g. per-cache nulls or
Optional return type) is decided.
 
36293 7 h 57 m amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/transaction/ Fix IllegalArgumentException when caching null firstBillingDate

Redis cache manager (redisEternalCacheManager) has disableCachingNullValues,
so every partner with no billing history threw IllegalArgumentException
from RedisCache.put. Added unless="#result == null" to skip cache writes
for null results; non-null results still cache normally.
 
36292 8 h 21 m amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ Reduce DB scan pressure from runaway IMEI and IRN crons

- IRN cron (updateIrnsToInvoices): fixedDelay 2s -> 5s; migration cron
has finished but keeps full-scanning 821k orders every 2s for 0 rows
(every billed order already has irnGenerated populated true/false).
- IMEI activation crons: fixedDelay 60s -> 5min across all 6 methods
(vivoImeiActivation, vivoImeiActivationTertiary, oppo, oppoTertiary,
realme, realmeTertiary). Each was scanning orders since 2021-01-01
every minute; 5min is well within activation-latency tolerance.
 
36291 8 h 21 m amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/repository/ Optimize slow DB queries: split fan-out join, FORCE INDEX on wallet history

- CurrentInventorySnapshotRepositoryImpl.getSpilitStockBatch: split
LEFT-JOIN fan-out into two independent aggregates (~8x faster);
fixes SUM(DISTINCT) undercounting bug where same availability/qty
values across items collapsed into one.
- UserWalletRepositoryImpl.getWarehousewiseCollection: HQL -> native
SQL with FORCE INDEX(idx_uwh_wallet_timestamp) so timestamp range
filters at index level instead of row filter (~4x faster, 3.1s -> 722ms).
- PartnerCollectionPlanRepositoryImpl.getCommitmentCollectionSummary:
Criteria 3-Root CROSS JOIN -> explicit INNER JOIN + FORCE INDEX
(idx_uwh_wallet_timestamp) (~3.5x faster).
 
36290 8 h 24 m aman /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ Fix:Finance code to finance team after code creation  
36289 8 h 59 m amit /trunk/profitmandi-cron/src/main/java/com/smartdukaan/cron/scheduled/ hadb1 perf: add SD_CREDIT_LOCK to prevent deadlock on sd_credit_requirement, sort updatePartnerLimit by fofoId  
36288 9 h 0 m amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/ hadb1 perf: cache firstBillingDate, fix N+1 item query, push eInvoice filter to SQL, sort updateRisk by fofoId  
36287 1 d 1 h ranu /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/ sales dispostion updated  
36286 1 d 1 h ranu /trunk/profitmandi-web/src/main/java/com/spice/profitmandi/web/controller/ sales dispostion updated  
36285 1 d 1 h amit /trunk/profitmandi-dao/src/main/java/com/spice/profitmandi/dao/ Force idx_order_customer_billing index on spilitStock queries — optimizer picks wrong index (978K global scan vs 902 rows per partner)  

Show All