feat: Filter/Sorter表からViewパラメータを組み立てるBuildViewFromSheetを追加
This commit is contained in:
parent
4dc4b0cc1d
commit
b8ef165fdf
@ -257,6 +257,42 @@ Private Function CollectionToArray(Byval col As Collection) As Variant
|
|||||||
CollectionToArray = arr
|
CollectionToArray = arr
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
'******************************************************************************
|
||||||
|
'基本情報シートのFilter表(F2:G2見出し、F3以降データ)・Sorter表(H2:I2見出し、H3以降データ)を読み取り、
|
||||||
|
'APIリクエストのViewパラメータに渡すDictionaryを組み立てる。
|
||||||
|
'Filter・Sorterともに0件の場合はNothingを返す(Viewパラメータ自体を付与しないため)
|
||||||
|
Function BuildViewFromSheet() As Object
|
||||||
|
Dim colFilter As New Dictionary
|
||||||
|
Dim r As Long
|
||||||
|
r = 3
|
||||||
|
Do While Trim(defaultSh.Cells(r, "F").Value) <> ""
|
||||||
|
colFilter.Add defaultSh.Cells(r, "F").Value, defaultSh.Cells(r, "G").Value
|
||||||
|
r = r + 1
|
||||||
|
Loop
|
||||||
|
|
||||||
|
Dim colSorter As New Dictionary
|
||||||
|
r = 3
|
||||||
|
Do While Trim(defaultSh.Cells(r, "H").Value) <> ""
|
||||||
|
colSorter.Add defaultSh.Cells(r, "H").Value, defaultSh.Cells(r, "I").Value
|
||||||
|
r = r + 1
|
||||||
|
Loop
|
||||||
|
|
||||||
|
If colFilter.count = 0 And colSorter.count = 0 Then
|
||||||
|
Set BuildViewFromSheet = Nothing
|
||||||
|
Exit Function
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim viewObj As New Dictionary
|
||||||
|
If colFilter.count > 0 Then
|
||||||
|
viewObj.Add "ColumnFilterHash", colFilter
|
||||||
|
End If
|
||||||
|
If colSorter.count > 0 Then
|
||||||
|
viewObj.Add "ColumnSorterHash", colSorter
|
||||||
|
End If
|
||||||
|
|
||||||
|
Set BuildViewFromSheet = viewObj
|
||||||
|
End Function
|
||||||
|
|
||||||
'******************************************************************************
|
'******************************************************************************
|
||||||
'REST API呼出処理
|
'REST API呼出処理
|
||||||
' method GetかPOSTか
|
' method GetかPOSTか
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user