cl
2026-04-21 fc634e5b62b85396196e2dd8f51bfe5ba7337522
rsf-server/src/main/java/com/vincent/rsf/server/manager/service/CusBarcodeSyncViewQueryService.java
@@ -13,6 +13,8 @@
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.sql.DataSource;
import java.util.Collection;
@@ -25,6 +27,7 @@
/**
 * cus_barcode_sync_view:barcode 即为物料号(含 # 等字符亦原样),对应 man_matnr.code。与 {@link CusItemSyncViewQueryService} 独立。
 * 查询不启事务;{@code NOT_SUPPORTED} 挂起外层事务,避免主库连接占用导致副库路由失效。
 */
@UseDataSource(DataSourceNames.DJ_CLOUD_WMS)
@Service
@@ -65,6 +68,8 @@
        return viewItems.stream().anyMatch(r -> rowMatchesOrderMatnr(oc, Objects.toString(r.get("barcode"), null)));
    }
    /** 挂起外层事务,查询本身不包事务 */
    @Transactional(propagation = Propagation.NOT_SUPPORTED)
    public List<Map<String, Object>> probeSample(int limit) {
        if (cusItemSyncDataSourceProvider.getIfAvailable() == null) {
            return Collections.emptyList();
@@ -81,6 +86,7 @@
        return toViewMaps(page.getRecords());
    }
    @Transactional(propagation = Propagation.NOT_SUPPORTED)
    public List<Map<String, Object>> listByItemNos(Collection<String> itemNos) {
        if (itemNos == null || itemNos.isEmpty()) {
            return Collections.emptyList();