fix:修复因地理信息确实导致无法审批的问题
This commit is contained in:
parent
546a07f008
commit
d97da29c2f
|
@ -150,15 +150,18 @@ public class OrderQuery {
|
||||||
|
|
||||||
//根据系统标识进行筛选
|
//根据系统标识进行筛选
|
||||||
routeOrders = sysCodeFilter(routeOrders, queryData.getSysCode());
|
routeOrders = sysCodeFilter(routeOrders, queryData.getSysCode());
|
||||||
|
|
||||||
//将已结束的行程放到最后
|
//将已结束的行程放到最后
|
||||||
Comparator<RouteOrder> statusComparator = Comparator.comparing(
|
Comparator<RouteOrder> statusComparator = Comparator.comparing(
|
||||||
(RouteOrder order) -> order.getOrderStatus().equals(ORDER_STATUS_FINISH),
|
(RouteOrder order) -> order.getOrderStatus().equals(ORDER_STATUS_FINISH),
|
||||||
Comparator.reverseOrder()
|
Comparator.reverseOrder()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
int total = routeOrders.size();
|
int total = routeOrders.size();
|
||||||
routeApprovalDomainService.checkApprovalPermissions(routeOrders);
|
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
|
List<RouteOrderPageRes> orders = routeOrders
|
||||||
.stream()
|
.stream()
|
||||||
.sorted(statusComparator.thenComparing(RouteOrder::getUpdateTime).reversed())
|
.sorted(statusComparator.thenComparing(RouteOrder::getUpdateTime).reversed())
|
||||||
|
@ -170,13 +173,13 @@ public class OrderQuery {
|
||||||
return getRouteOrderPageRes(routeOrder, user);
|
return getRouteOrderPageRes(routeOrder, user);
|
||||||
})
|
})
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
//这里按照业务要求,尝试进行自动确认结束行程
|
//这里按照业务要求,尝试进行自动确认结束行程
|
||||||
orders.forEach(it -> {
|
orders.forEach(it -> {
|
||||||
if (it.getIfCanBeFinished().equals("1") && !it.getOrderStatus().equals(ORDER_STATUS_FINISH)) {
|
if (it.getIfCanBeFinished().equals("1") && !it.getOrderStatus().equals(ORDER_STATUS_FINISH)) {
|
||||||
orderDomainService.finishOrder(it.getRouteId());
|
orderDomainService.finishOrder(it);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return new PageResult<>(total, orders);
|
return new PageResult<>(total, orders);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -244,6 +244,7 @@ public class LegDomainService {
|
||||||
!it.getLegApprovalStatus().equals(LEG_APPROVAL_STATUS_PREPARE))
|
!it.getLegApprovalStatus().equals(LEG_APPROVAL_STATUS_PREPARE))
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
|
|
||||||
// 根据供应商名称查找供应商并进行处理
|
// 根据供应商名称查找供应商并进行处理
|
||||||
return supplierRepository.findBySupplierName(supplierName)
|
return supplierRepository.findBySupplierName(supplierName)
|
||||||
.map(supplier -> {
|
.map(supplier -> {
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.chint.domain.service;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import com.chint.application.commands.*;
|
import com.chint.application.commands.*;
|
||||||
|
import com.chint.application.dtos.response.RouteOrderPageRes;
|
||||||
import com.chint.domain.aggregates.order.*;
|
import com.chint.domain.aggregates.order.*;
|
||||||
import com.chint.domain.aggregates.user.User;
|
import com.chint.domain.aggregates.user.User;
|
||||||
import com.chint.domain.exceptions.OrderException;
|
import com.chint.domain.exceptions.OrderException;
|
||||||
|
@ -279,6 +280,14 @@ public class OrderDomainService {
|
||||||
return false;
|
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) {
|
private void cTripFlightRefundAndChangeOrder(String orderNo) {
|
||||||
SearchOrderResponse response = cTripOrderSearchRequest.searchOrderResponseByOrderId(orderNo);
|
SearchOrderResponse response = cTripOrderSearchRequest.searchOrderResponseByOrderId(orderNo);
|
||||||
FlightOrderInfoEntity flightOrderInfoEntity = response.getItineraryList().get(0).getFlightOrderInfoList().get(0);
|
FlightOrderInfoEntity flightOrderInfoEntity = response.getItineraryList().get(0).getFlightOrderInfoList().get(0);
|
||||||
|
|
|
@ -8,6 +8,7 @@ import com.chint.domain.exceptions.AuthException;
|
||||||
import com.chint.domain.exceptions.CommandException;
|
import com.chint.domain.exceptions.CommandException;
|
||||||
import com.chint.domain.service.supplier.SupplierAdapter;
|
import com.chint.domain.service.supplier.SupplierAdapter;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.chint.infrastructure.repository.cache;
|
||||||
|
|
||||||
import com.chint.domain.aggregates.base.PermissionConfig;
|
import com.chint.domain.aggregates.base.PermissionConfig;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.cache.annotation.CacheEvict;
|
||||||
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
@ -45,7 +46,7 @@ public class CachePermissionConfigRepository {
|
||||||
return permissionConfig;
|
return permissionConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Cacheable(value = "PermissionConfig", key = "#permissionName")
|
@CacheEvict(value = "PermissionConfig", key = "#permissionName")
|
||||||
public void cacheEvictByName(String permissionName) {
|
public void cacheEvictByName(String permissionName) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue