fix: 无法删除行程的bug
This commit is contained in:
parent
dd98051feb
commit
89e91d9d39
|
@ -81,7 +81,7 @@ public class OrderPublicController {
|
||||||
@ApiOperation("根据行程节点号删除")
|
@ApiOperation("根据行程节点号删除")
|
||||||
@PostMapping("/leg/delete/legNo")
|
@PostMapping("/leg/delete/legNo")
|
||||||
public Result<String> deleteLeg(@RequestBody DeleteLegData deleteLegData) {
|
public Result<String> deleteLeg(@RequestBody DeleteLegData deleteLegData) {
|
||||||
orderApplicationService.deleteByLegNo(deleteLegData);
|
legDomainService.deleteByLegNo(deleteLegData.getLegNo());
|
||||||
return Result.Success(SUCCESS);
|
return Result.Success(SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -200,18 +200,18 @@ public class OrderApplicationService {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteByLegNo(DeleteLegData deleteLegData) {
|
// public void deleteByLegNo(DeleteLegData deleteLegData) {
|
||||||
String legNo = deleteLegData.getLegNo();
|
// String legNo = deleteLegData.getLegNo();
|
||||||
RouteOrder routeOrder = null;
|
// RouteOrder routeOrder = null;
|
||||||
if (legNo.contains("&")) {
|
// if (legNo.contains("&")) {
|
||||||
String[] split = legNo.split("&");
|
// String[] split = legNo.split("&");
|
||||||
routeOrder = routeRepository.findTempRouteOrderBySysCodeAndBillCode(split[1], split[2]);
|
// routeOrder = routeRepository.findTempRouteOrderBySysCodeAndBillCode(split[1], split[2]);
|
||||||
}
|
// }
|
||||||
if (routeOrder != null && routeOrder.getOrderStatus().equals(ORDER_STATUS_PREPARE)){
|
// if (routeOrder != null && routeOrder.getOrderStatus().equals(ORDER_STATUS_PREPARE)){
|
||||||
routeOrder.deleteLeg(legNo);
|
// routeOrder.deleteLeg(legNo);
|
||||||
routeRepository.saveTempRouteOrder(routeOrder, 24L);
|
// routeRepository.saveTempRouteOrder(routeOrder, 24L);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
public RouteOrder deleteLegToOrder(DeleteLegData deleteLegData) {
|
public RouteOrder deleteLegToOrder(DeleteLegData deleteLegData) {
|
||||||
|
|
|
@ -110,13 +110,14 @@ public class LegDomainService {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteByLegNo(String legNo) {
|
public void deleteByLegNo(String legNo) {
|
||||||
Leg byLegNo = legRepository.findByLegNo(legNo);
|
RouteOrder routeOrder = null;
|
||||||
if (byLegNo == null) {
|
if (legNo.contains("&")) {
|
||||||
return;
|
String[] split = legNo.split("&");
|
||||||
|
routeOrder = routeRepository.findTempRouteOrderBySysCodeAndBillCode(split[1], split[2]);
|
||||||
}
|
}
|
||||||
RouteOrder routeOrder = routeRepository.queryById(byLegNo.getRouteId()).reloadStatus();
|
if (routeOrder != null && routeOrder.getOrderStatus().equals(ORDER_STATUS_PREPARE)){
|
||||||
if (routeOrder.getOrderStatus().equals(ORDER_STATUS_PREPARE)) {
|
routeOrder.deleteLeg(legNo);
|
||||||
legRepository.deleteById(byLegNo);
|
routeRepository.saveTempRouteOrder(routeOrder, 24L);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue