Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
wanglf3 2024-03-14 08:49:10 +08:00
commit 019513cb09
1 changed files with 10 additions and 6 deletions

View File

@ -2,7 +2,6 @@ package com.chint.infrastructure.repository;
import com.chint.application.dtos.OrderDetailQueryParam;
import com.chint.domain.aggregates.order.OrderDetail;
import com.chint.domain.aggregates.order.RouteOrder;
import com.chint.domain.exceptions.NotFoundException;
import com.chint.domain.repository.OrderDetailRepository;
import com.chint.infrastructure.cache.RouteCacheService;
@ -53,8 +52,14 @@ public class OrderDetailRepositoryImpl implements OrderDetailRepository {
@Override
public OrderDetail save(OrderDetail orderDetail) {
routeCacheService.invalidateRouteCache(orderDetail.getRouteId());
return orderDetailRepository.save(orderDetail);
if (orderDetail.getRouteId() != null) {
routeCacheService.invalidateRouteCache(orderDetail.getRouteId());
}
OrderDetail detail = orderDetailRepository.save(orderDetail);
if (detail.getRouteId() != null) {
routeCacheService.invalidateRouteCache(orderDetail.getRouteId());
}
return detail;
}
@Override
@ -63,9 +68,8 @@ public class OrderDetailRepositoryImpl implements OrderDetailRepository {
}
@Override
public List<OrderDetail> findByUpdateTimeBetween(LocalDateTime createTimeStart, LocalDateTime createTimeEnd){
return orderDetailRepository.findByCreateTimeBetween(createTimeStart,createTimeEnd);
public List<OrderDetail> findByUpdateTimeBetween(LocalDateTime createTimeStart, LocalDateTime createTimeEnd) {
return orderDetailRepository.findByCreateTimeBetween(createTimeStart, createTimeEnd);
}
}