| | |
| | | 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; |
| | |
| | | |
| | | /** |
| | | * cus_barcode_sync_view:barcode 即为物料号(含 # 等字符亦原样),对应 man_matnr.code。与 {@link CusItemSyncViewQueryService} 独立。 |
| | | * 查询不启事务;{@code NOT_SUPPORTED} 挂起外层事务,避免主库连接占用导致副库路由失效。 |
| | | */ |
| | | @UseDataSource(DataSourceNames.DJ_CLOUD_WMS) |
| | | @Service |
| | |
| | | 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(); |
| | |
| | | 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(); |