feat:同步高德打车如果行程已过期会提醒用户。

This commit is contained in:
lulz1 2024-06-28 21:13:44 +08:00
parent 18a12df8bb
commit c2e172aff3
1 changed files with 5 additions and 3 deletions

View File

@ -2,10 +2,7 @@ package com.chint.domain.service.order_sync;
import com.chint.domain.aggregates.order.*;
import com.chint.domain.aggregates.supplier.AmapRouteRelationship;
import com.chint.domain.aggregates.supplier.Supplier;
import com.chint.domain.aggregates.supplier.SupplierProductStandardLevel;
import com.chint.domain.aggregates.user.User;
import com.chint.domain.exceptions.AuthException;
import com.chint.domain.exceptions.CommandException;
import com.chint.domain.repository.AmapPolicyRepository;
import com.chint.domain.repository.AmapRouteRelationshipRepository;
@ -71,6 +68,7 @@ public class AmapOrderSyncAdapter implements SupplierOrderSync {
TravelApplicationDto dto = new TravelApplicationDto();
TravelApplicationDto travelApplicationDto = generateTravelApplicationInfo(dto, routeRequest);
Optional<AmapRouteRelationship> byOutApplyRecordId = amapRouteRelationshipRepository
.findByOutApplyRecordId(routeRequest.getRouteRequestNo());
TravelApplicationDtoResponse response;
@ -88,6 +86,10 @@ public class AmapOrderSyncAdapter implements SupplierOrderSync {
amapRouteRelationshipRepository.save(amapRouteRelationship);
}
if (response.getMessage().equals("endTime 已过期")) {
throw new CommandException("你的行程已过期,请添加新的行程");
}
if (!response.getCode().equals(1)) {
Gson gson = new Gson();
log.error(gson.toJson(response));