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

This commit is contained in:
lulz1 2024-07-04 16:40:19 +08:00
parent e1c3e640fe
commit 38a66b1037
4 changed files with 12 additions and 3 deletions

View File

@ -122,7 +122,6 @@ public class ApprovalPlatformAN implements ApprovalPlatform {
.filter(it -> it.getApprovalRecordNo().equals(approvalData.getApprovalRecordNo()))
.findFirst()
.ifPresent(it -> approvalScheduleParam.setRemark(it.getApprovalReason()));
List<ScheduleItem> scheduleItemList = new ArrayList<>();
for (Pair<Leg, Leg> legPair : approvalData.getChangeLegList()) {
Leg newLeg = legPair.getFirst();

View File

@ -11,6 +11,8 @@ import java.util.List;
public interface RouteRepository {
RouteOrder queryById(Long orderId);
RouteOrder queryById(Long orderId, boolean ifUpdateCache);
List<RouteOrder> queryByIdIn(List<Long> routeIds);
List<RouteOrder> queryAllInOneDayAndEffective(LocalDateTime start, LocalDateTime end);

View File

@ -13,6 +13,7 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import static com.chint.infrastructure.constant.CommonMessageConstant.LEG_CHANGE_MAX_ERROR;
import static com.chint.infrastructure.constant.LegConstant.*;
@ -170,11 +171,13 @@ public class LegDomainService {
legExtensionField.setLocationList(byNameList);
}
}
if (leg.getOriginId() != null && leg.getOriginLocation() == null) {
if (leg.getOriginId() != null && (leg.getOriginLocation() == null ||
!Objects.equals(leg.getOriginLocation().getLocationId(), leg.getOriginId()))) {
leg.setOriginLocation(locationRepository.findByLocationId(leg.getOriginId()));
}
if (leg.getDestinationId() != null && leg.getDestinationLocation() == null) {
if (leg.getDestinationId() != null && (leg.getDestinationLocation() == null ||
!Objects.equals(leg.getDestinationLocation().getLocationId(), leg.getDestinationId()))) {
leg.setDestinationLocation(locationRepository.findByLocationId(leg.getDestinationId()));
}
});

View File

@ -44,6 +44,11 @@ public class RouteRepositoryImpl implements RouteRepository {
return routeOrder;
}
@Override
public RouteOrder queryById(Long orderId, boolean ifUpdateCache) {
return null;
}
@Override
public List<RouteOrder> queryByIdIn(List<Long> routeIds) {
List<RouteOrder> routeOrders = new java.util.ArrayList<>(routeCacheService.queryByIdIn(routeIds)