| | |
| | | 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.ArrayList; |
| | |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * cus_item_sync_view 查询;仅使用副库视图 |
| | | * cus_item_sync_view 查询;仅使用副库视图。查询不启事务,{@code NOT_SUPPORTED} 挂起外层以利路由副库。 |
| | | */ |
| | | @UseDataSource(DataSourceNames.DJ_CLOUD_WMS) |
| | | @Service |
| | |
| | | /** |
| | | * 取视图前若干行 |
| | | */ |
| | | @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.REQUIRES_NEW, readOnly = true) |
| | | public List<Map<String, Object>> listByItemNos(Collection<String> itemNos) { |
| | | if (itemNos == null || itemNos.isEmpty()) { |
| | | return Collections.emptyList(); |