fix:修复因地理信息确实导致无法审批的问题

This commit is contained in:
lulz1 2024-07-04 18:49:35 +08:00
parent 546a07f008
commit d97da29c2f
5 changed files with 19 additions and 4 deletions

View File

@ -150,15 +150,18 @@ public class OrderQuery {
//根据系统标识进行筛选
routeOrders = sysCodeFilter(routeOrders, queryData.getSysCode());
//将已结束的行程放到最后
Comparator<RouteOrder> statusComparator = Comparator.comparing(
(RouteOrder order) -> order.getOrderStatus().equals(ORDER_STATUS_FINISH),
Comparator.reverseOrder()
);
int total = routeOrders.size();
routeApprovalDomainService.checkApprovalPermissions(routeOrders);
// Set<String> employeeNoSet = routeOrders.stream().filter(it -> it.getApproveOrderNo() != null)
// .flatMap(it -> Stream.of(it.getUserId(), it.getApproveOrderNo().getCreator()))
// .collect(Collectors.toSet());
List<RouteOrderPageRes> orders = routeOrders
.stream()
.sorted(statusComparator.thenComparing(RouteOrder::getUpdateTime).reversed())
@ -170,13 +173,13 @@ public class OrderQuery {
return getRouteOrderPageRes(routeOrder, user);
})
.toList();
//这里按照业务要求尝试进行自动确认结束行程
orders.forEach(it -> {
if (it.getIfCanBeFinished().equals("1") && !it.getOrderStatus().equals(ORDER_STATUS_FINISH)) {
orderDomainService.finishOrder(it.getRouteId());
orderDomainService.finishOrder(it);
}
});
return new PageResult<>(total, orders);
}

View File

@ -244,6 +244,7 @@ public class LegDomainService {
!it.getLegApprovalStatus().equals(LEG_APPROVAL_STATUS_PREPARE))
.toList();
// 根据供应商名称查找供应商并进行处理
return supplierRepository.findBySupplierName(supplierName)
.map(supplier -> {

View File

@ -2,6 +2,7 @@ package com.chint.domain.service;
import cn.hutool.core.bean.BeanUtil;
import com.chint.application.commands.*;
import com.chint.application.dtos.response.RouteOrderPageRes;
import com.chint.domain.aggregates.order.*;
import com.chint.domain.aggregates.user.User;
import com.chint.domain.exceptions.OrderException;
@ -279,6 +280,14 @@ public class OrderDomainService {
return false;
}
public boolean finishOrder(RouteOrderPageRes routeOrderPageRes) {
if (DateTimeUtil.endOfDay(routeOrderPageRes.getEndTime()).isAfter(LocalDateTime.now())) {
return finishOrder(routeOrderPageRes.getRouteId());
}
return false;
}
private void cTripFlightRefundAndChangeOrder(String orderNo) {
SearchOrderResponse response = cTripOrderSearchRequest.searchOrderResponseByOrderId(orderNo);
FlightOrderInfoEntity flightOrderInfoEntity = response.getItineraryList().get(0).getFlightOrderInfoList().get(0);

View File

@ -8,6 +8,7 @@ import com.chint.domain.exceptions.AuthException;
import com.chint.domain.exceptions.CommandException;
import com.chint.domain.service.supplier.SupplierAdapter;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

View File

@ -2,6 +2,7 @@ package com.chint.infrastructure.repository.cache;
import com.chint.domain.aggregates.base.PermissionConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Repository;
@ -45,7 +46,7 @@ public class CachePermissionConfigRepository {
return permissionConfig;
}
@Cacheable(value = "PermissionConfig", key = "#permissionName")
@CacheEvict(value = "PermissionConfig", key = "#permissionName")
public void cacheEvictByName(String permissionName) {
}
}