fix: 无法删除行程的bug
This commit is contained in:
parent
286aad6c14
commit
296bc287f0
|
@ -202,10 +202,25 @@ public class OrderApplicationService {
|
|||
|
||||
|
||||
public RouteOrder deleteLegToOrder(DeleteLegData deleteLegData) {
|
||||
RouteOrder order = Optional.ofNullable(routeRepository.queryById(deleteLegData.getRouteId()))
|
||||
.orElseThrow(() -> new NotFoundException(NOT_FOUND)).reloadStatus();
|
||||
order.deleteLeg(deleteLegData.getLegNo());
|
||||
return orderDomainService.saveOrder(order);
|
||||
String legNo = deleteLegData.getLegNo();
|
||||
RouteOrder routeOrder = null;
|
||||
if (legNo.contains("&")) {
|
||||
String[] split = legNo.split("&");
|
||||
routeOrder = routeRepository.findTempRouteOrderBySysCodeAndBillCode(split[1], split[2]);
|
||||
}
|
||||
if (routeOrder == null) {
|
||||
routeOrder = Optional.ofNullable(routeRepository.queryById(deleteLegData.getRouteId()))
|
||||
.orElseThrow(() -> new NotFoundException(NOT_FOUND)).reloadStatus();
|
||||
}
|
||||
if (routeOrder != null) {
|
||||
routeOrder.reloadStatus();
|
||||
if (!routeOrder.getApprovalStatusCode().equals(APPROVAL_EVENT_PREPARE)) {
|
||||
return routeRepository.saveTempRouteOrder(routeOrder, 24L);
|
||||
} else {
|
||||
return routeRepository.save(routeOrder);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
|
|
Loading…
Reference in New Issue