fix: complete development acceptance paths

This commit is contained in:
2026-09-03 19:10:18 +08:00
parent 4df0ae4811
commit 2063d29d16
13 changed files with 203 additions and 79 deletions
@@ -86,7 +86,7 @@ public class BusinessFeeSourceEventService {
system, source.sourceType(), feeId);
jdbc.update("UPDATE fin_cost SET status='VOIDED',voided_at=CURRENT_TIMESTAMP(3),void_reason='来源版本已替代',version=version+1,updated_by=0 WHERE cost_origin='BUSINESS_DIRECT_PAID' AND source_system=? AND source_type=? AND source_fee_id=? AND status='CONFIRMED'",
system, source.sourceType(), feeId);
jdbc.update("INSERT INTO fin_fee_source(source_system,source_fee_id,source_fee_version,customer_id,source_type,source_no,business_type,business_id,business_no,inbound_code,warehouse_id,direction,order_id,inbound_id,container_id,container_booking_id,container_no,fee_item_code,fee_item_name,amount,currency_code,settlement_mode,paid_at,payment_method,payment_reference_no,payment_voucher_file_ids,source_hash,source_snapshot,status) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, 'AVAILABLE')",
jdbc.update("INSERT INTO fin_fee_source(source_system,source_fee_id,source_fee_version,customer_id,source_type,source_no,business_type,business_id,business_no,inbound_code,warehouse_id,direction,order_id,inbound_id,container_id,container_booking_id,container_no,fee_item_code,fee_item_name,amount,currency_code,settlement_mode,paid_at,payment_method,payment_reference_no,payment_voucher_file_ids,source_hash,source_snapshot,review_status,status) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, 'APPROVED','AVAILABLE')",
system, feeId, source.sourceVersion(), positive(source.customerId(), "customerId"),
source.sourceType(), trim(source.sourceNo()), trim(source.businessType()), number(source.businessId()),
trim(source.businessNo()), trim(source.inboundCode()), number(source.warehouseId()), source.direction(),
@@ -23,6 +23,7 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.argThat;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.startsWith;
import static org.mockito.Mockito.mock;
@@ -50,7 +51,8 @@ class BusinessFeeSourceEventServiceTest {
assertThat(service.consume(event)).isEqualTo(901L);
ArgumentCaptor<Object[]> values = ArgumentCaptor.forClass(Object[].class);
verify(jdbc).update(startsWith("INSERT INTO fin_fee_source"), values.capture());
verify(jdbc).update(argThat(sql -> sql.startsWith("INSERT INTO fin_fee_source")
&& sql.contains("review_status,status") && sql.contains("'APPROVED','AVAILABLE'")), values.capture());
assertThat(values.getValue()[3]).isEqualTo(10001L);
assertThat(values.getValue()[5]).isEqualTo("PO-US-001");
assertThat(values.getValue()[9]).isNull();