fix(order):修复订单取消状态判断逻辑
- 在判断订单是否取消时增加空值检查 - 避免因状态为空导致的潜在空指针异常- 确保只有在状态明确为已取消时才执行后续操作
Showing
1 changed file
with
1 additions
and
1 deletions
| ... | @@ -190,7 +190,7 @@ public class OrderServiceRpcClient { | ... | @@ -190,7 +190,7 @@ public class OrderServiceRpcClient { |
| 190 | .setModification(modification) | 190 | .setModification(modification) |
| 191 | .build(); | 191 | .build(); |
| 192 | final UpdateClientCustomerOrderRpcResponse updateClientCustomerOrderRpcResponse = orderServiceRpcBlockingStub.updateClientCustomerOrder(request); | 192 | final UpdateClientCustomerOrderRpcResponse updateClientCustomerOrderRpcResponse = orderServiceRpcBlockingStub.updateClientCustomerOrder(request); |
| 193 | - if (updateClientCustomerOrderRpcResponse.getIsUpdated() && updateOrderDto.getStatus() == OrderStatusEnum.ORDER_CANCELED) { | 193 | + if (updateClientCustomerOrderRpcResponse.getIsUpdated() && updateOrderDto.getStatus() != null && updateOrderDto.getStatus() == OrderStatusEnum.ORDER_CANCELED) { |
| 194 | final var orderById = getOrderById(updateOrderDto.getId()); | 194 | final var orderById = getOrderById(updateOrderDto.getId()); |
| 195 | if (orderById != null && orderById.getCloseTimeType() == CloseTimeType.IMMEDIATELY) { | 195 | if (orderById != null && orderById.getCloseTimeType() == CloseTimeType.IMMEDIATELY) { |
| 196 | final var orderDetails = getOrderDetailsByOrderId(orderById.getId()); | 196 | final var orderDetails = getOrderDetailsByOrderId(orderById.getId()); | ... | ... |
-
Please register or login to post a comment