fix(order): optimize dish replacement logic and update payment transaction ID
Showing
3 changed files
with
7 additions
and
1 deletions
| ... | @@ -18,6 +18,9 @@ public class PaymentCallbackResult { | ... | @@ -18,6 +18,9 @@ public class PaymentCallbackResult { |
| 18 | @JacksonXmlProperty(localName = "TransSN") | 18 | @JacksonXmlProperty(localName = "TransSN") |
| 19 | private String transSN; | 19 | private String transSN; |
| 20 | 20 | ||
| 21 | + @JacksonXmlProperty(localName = "TradeReferenceNo") | ||
| 22 | + private String tradeReferenceNo; | ||
| 23 | + | ||
| 21 | @JacksonXmlProperty(localName = "TransType") | 24 | @JacksonXmlProperty(localName = "TransType") |
| 22 | private String transType; | 25 | private String transType; |
| 23 | 26 | ... | ... |
| ... | @@ -396,6 +396,9 @@ public class OrderServiceRpcClient { | ... | @@ -396,6 +396,9 @@ public class OrderServiceRpcClient { |
| 396 | // 替换菜品的操作记录 | 396 | // 替换菜品的操作记录 |
| 397 | List<SingleOperationDto> operations = new ArrayList<>(); | 397 | List<SingleOperationDto> operations = new ArrayList<>(); |
| 398 | for (OrderDetailDto originalDetail : originalOrderDetails) { | 398 | for (OrderDetailDto originalDetail : originalOrderDetails) { |
| 399 | + if (!idsOfNeedUpdateMenuDetails.contains(originalDetail.getId()) && !idsOfAddCount.contains(originalDetail.getId())) { | ||
| 400 | + continue; | ||
| 401 | + } | ||
| 399 | OrderOperationType orderOperationType = OrderOperationType.UNKNOWN_OPERATION_TYPE; | 402 | OrderOperationType orderOperationType = OrderOperationType.UNKNOWN_OPERATION_TYPE; |
| 400 | if (idsOfNeedUpdateMenuDetails.contains(originalDetail.getId())) { | 403 | if (idsOfNeedUpdateMenuDetails.contains(originalDetail.getId())) { |
| 401 | orderOperationType = OrderOperationType.REPLACE_DISHES; | 404 | orderOperationType = OrderOperationType.REPLACE_DISHES; | ... | ... |
| ... | @@ -201,7 +201,7 @@ public class PayServiceClient { | ... | @@ -201,7 +201,7 @@ public class PayServiceClient { |
| 201 | .setShouldUpdateStatus(true) | 201 | .setShouldUpdateStatus(true) |
| 202 | .setStatus(OrderStatusEnum.PREPARING) | 202 | .setStatus(OrderStatusEnum.PREPARING) |
| 203 | .setShouldUpdateTransactionId(true) | 203 | .setShouldUpdateTransactionId(true) |
| 204 | - .setTransactionId(paymentCallbackResult.getTransSN()) | 204 | + .setTransactionId(paymentCallbackResult.getTradeReferenceNo()) |
| 205 | .build(); | 205 | .build(); |
| 206 | final var updateResponse = | 206 | final var updateResponse = |
| 207 | orderServiceRpcClient.updateClientCustomerOrderPaymentResult(orderById, build); | 207 | orderServiceRpcClient.updateClientCustomerOrderPaymentResult(orderById, build); | ... | ... |
-
Please register or login to post a comment