修复同步无法刷新缓存的问题
This commit is contained in:
parent
cba5af2478
commit
41a87ab348
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue