Showing
1 changed file
with
13 additions
and
1 deletions
| ... | @@ -187,7 +187,19 @@ public class OrderServiceRpcClient { | ... | @@ -187,7 +187,19 @@ public class OrderServiceRpcClient { |
| 187 | .setUpdateSource(updateOrderDto.getUpdatedSource()) | 187 | .setUpdateSource(updateOrderDto.getUpdatedSource()) |
| 188 | .setModification(modification) | 188 | .setModification(modification) |
| 189 | .build(); | 189 | .build(); |
| 190 | - return orderServiceRpcBlockingStub.updateClientCustomerOrder(request); | 190 | + final UpdateClientCustomerOrderRpcResponse updateClientCustomerOrderRpcResponse = orderServiceRpcBlockingStub.updateClientCustomerOrder(request); |
| 191 | + if (updateClientCustomerOrderRpcResponse.getIsUpdated() && updateOrderDto.getStatus() == OrderStatusEnum.ORDER_CANCELED) { | ||
| 192 | + final var orderById = getOrderById(updateOrderDto.getId()); | ||
| 193 | + if (orderById != null && orderById.getCloseTimeType() == CloseTimeType.IMMEDIATELY) { | ||
| 194 | + final var orderDetails = getOrderDetailsByOrderId(orderById.getId()); | ||
| 195 | + final var isSuccess = addSkusSellQuantities(orderById.getEnterpriseId(), orderById.getStallId(), orderDetails.stream().map(e -> AddSkusSellQuantityBO.builder() | ||
| 196 | + .skuId(e.getSkuId()) | ||
| 197 | + .quantity(-e.getCount()) | ||
| 198 | + .build()).collect(Collectors.toList())); | ||
| 199 | + log.info("Order {} returnSkusSellQuantities result: {}", orderById.getId(), isSuccess); | ||
| 200 | + } | ||
| 201 | + } | ||
| 202 | + return updateClientCustomerOrderRpcResponse; | ||
| 191 | } | 203 | } |
| 192 | 204 | ||
| 193 | public boolean updateClientCustomerOrderCancel(int enterpriseId, int id) { | 205 | public boolean updateClientCustomerOrderCancel(int enterpriseId, int id) { | ... | ... |
-
Please register or login to post a comment