发布:将已验 TEST 功能更新至既有生产灰度(2026-10-23) #30

Merged
admin merged 122 commits from test into main 2026-10-23 10:51:23 +08:00
2 changed files with 20 additions and 1 deletions
Showing only changes of commit 0fd523e740 - Show all commits
@@ -859,7 +859,8 @@ public class RelabelApplicationService implements WalletResultHandler {
if ("COMPLETED".equals(application.getStatus())) return;
if (!READY_FOR_OUTBOUND.equals(application.getStatus())
|| !"OUTBOUNDED".equals(application.getFulfillmentStatus())
|| !Set.of("FROZEN", "NOT_REQUIRED").contains(application.getWalletStatus())) {
// PDA 完工已发起结算;转运收货只结束履约,不能拒绝已结算的原单或再次扣款。
|| !Set.of("FROZEN", "NOT_REQUIRED", "SETTLE_PENDING", "SETTLED").contains(application.getWalletStatus())) {
throw conflict("本票换标尚未完成出库或资金冻结");
}
List<LastlegOrder> linkedOrders = tailOrders(application);
@@ -1164,6 +1164,24 @@ class RelabelApplicationServiceTest {
verify(inventoryCommands, never()).release(any(), any(), any());
}
@Test
void receivedTransferAfterPdaSettlementCompletesWithoutDuplicateFinancialCommands() {
RelabelApplication app = transferCompletionFixture();
for (String walletStatus : List.of("SETTLE_PENDING", "SETTLED")) {
app.setStatus(RelabelApplicationService.READY_FOR_OUTBOUND); app.setFulfillmentStatus("OUTBOUNDED");
app.setWalletStatus(walletStatus);
service.completeWarehouseTransferFulfillment("10001", app.getRelabelNo(), 91L, "operator-1");
service.completeWarehouseTransferFulfillment("10001", app.getRelabelNo(), 91L, "operator-1");
assertEquals("COMPLETED", app.getStatus()); assertEquals("COMPLETED", app.getFulfillmentStatus());
assertEquals(walletStatus, app.getWalletStatus());
}
verify(histories, times(2)).insert(any(RelabelStatusHistory.class));
verify(feeSources, never()).publishApproved(any(), any(), any());
verify(walletCommands, never()).publish(any(), anyLong(), any(), any(), any(), any(), anyLong());
verify(inventoryCommands, never()).release(any(), any(), any());
verify(inventoryCommands, never()).releaseTransferRelabel(any(), any(), any(), any(), any());
}
@Test
void transferCompletionRejectsWrongLinkUnreceivedStockMissingConfirmationOrFailedFreeze() {
RelabelApplication app = transferCompletionFixture();