修复变更行程bug
This commit is contained in:
parent
49478aa83b
commit
5f96250f53
5
pom.xml
5
pom.xml
|
@ -88,6 +88,11 @@
|
||||||
<version>1.0</version>
|
<version>1.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-cache</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -89,6 +89,5 @@ public class LocationController {
|
||||||
dto.setInternationalCitys(internationalLocationRes);
|
dto.setInternationalCitys(internationalLocationRes);
|
||||||
|
|
||||||
return Result.Success(SUCCESS, dto);
|
return Result.Success(SUCCESS, dto);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -90,7 +90,7 @@ public class OrderApplicationService {
|
||||||
LegData legData = addLegData.getLegData();
|
LegData legData = addLegData.getLegData();
|
||||||
List<Leg> legs = processLegData(legData, order);
|
List<Leg> legs = processLegData(legData, order);
|
||||||
orderDomainService.queryLocation(legs);
|
orderDomainService.queryLocation(legs);
|
||||||
|
RouteOrder routeOrder = orderDomainService.saveOrder(order);
|
||||||
legs.forEach(leg -> {
|
legs.forEach(leg -> {
|
||||||
leg.reloadStatus();
|
leg.reloadStatus();
|
||||||
legDomainService.addPreEvent(leg);
|
legDomainService.addPreEvent(leg);
|
||||||
|
@ -106,24 +106,13 @@ public class OrderApplicationService {
|
||||||
leg = legDomainService.addApproveEvent(leg);
|
leg = legDomainService.addApproveEvent(leg);
|
||||||
}
|
}
|
||||||
|
|
||||||
order.addLeg(leg);
|
legRepository.save(leg);
|
||||||
|
|
||||||
if (!order.getOrderStatus().equals(ORDER_STATUS_PREPARE)) {
|
if (!order.getOrderStatus().equals(ORDER_STATUS_PREPARE)) {
|
||||||
Command.of(BPMLegChangeCommand.class).routeOrder(order).newleg(leg.reloadStatus()).routeId(order.getRouteId()).changeType(0).sendToQueue();
|
Command.of(BPMLegChangeCommand.class).routeOrder(order).newleg(leg.reloadStatus()).routeId(order.getRouteId()).changeType(0).sendToQueue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
//异步操作-如果是当前的状态已经进行过匹配,那么就要订单同步到供应商一次
|
return routeOrder; // 仅在所有操作完成后保存一次
|
||||||
// if (order.getOrderStatus() >= ORDER_STATUS_NOT_ORDERED) {
|
|
||||||
// CompletableFuture.runAsync(() -> {
|
|
||||||
// Command
|
|
||||||
// .of(LegSyncCommand.class)
|
|
||||||
// .data(SyncLegData.of(routeOrder.getRouteId(), routeOrder.getSupplierName()))
|
|
||||||
// .sendToQueue();
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
return orderDomainService.saveOrder(order); // 仅在所有操作完成后保存一次
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
|
|
|
@ -236,16 +236,7 @@ class RouteApplicationTests {
|
||||||
|
|
||||||
// @Test
|
// @Test
|
||||||
void deleteRouteOrder() {
|
void deleteRouteOrder() {
|
||||||
routeRepository.deleteById(15L);
|
routeRepository.deleteById(785L);
|
||||||
routeRepository.deleteById(17L);
|
|
||||||
routeRepository.deleteById(18L);
|
|
||||||
routeRepository.deleteById(19L);
|
|
||||||
routeRepository.deleteById(19L);
|
|
||||||
routeRepository.deleteById(19L);
|
|
||||||
routeRepository.deleteById(19L);
|
|
||||||
routeRepository.deleteById(19L);
|
|
||||||
routeRepository.deleteById(19L);
|
|
||||||
routeRepository.deleteById(19L);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Test
|
// @Test
|
||||||
|
|
Loading…
Reference in New Issue