16
16
import org .cdlib .ill .report .vdx .procedures .SpVdxBorrowingTatRepository ;
17
17
import org .cdlib .ill .report .vdx .procedures .SpVdxBorrowingUC ;
18
18
import org .cdlib .ill .report .vdx .procedures .SpVdxBorrowingUCRepository ;
19
+ import org .cdlib .ill .report .vdx .procedures .SpVdxBorrowingUnfilledSummary ;
20
+ import org .cdlib .ill .report .vdx .procedures .SpVdxBorrowingUnfilledSummaryRepository ;
19
21
import org .cdlib .ill .report .vdx .procedures .SpVdxCopyright ;
20
22
import org .cdlib .ill .report .vdx .procedures .SpVdxCopyrightRepository ;
21
23
import org .cdlib .ill .report .vdx .procedures .SpVdxJournalBorrowing ;
28
30
import org .cdlib .ill .report .vdx .procedures .SpVdxLendingSummaryRepository ;
29
31
import org .cdlib .ill .report .vdx .procedures .SpVdxLendingTat ;
30
32
import org .cdlib .ill .report .vdx .procedures .SpVdxLendingTatRepository ;
33
+ import org .cdlib .ill .report .vdx .procedures .SpVdxLendingUnfilledSummary ;
34
+ import org .cdlib .ill .report .vdx .procedures .SpVdxLendingUnfilledSummaryRepository ;
31
35
import org .springframework .beans .factory .annotation .Autowired ;
32
36
import org .springframework .format .annotation .DateTimeFormat ;
33
37
import org .springframework .stereotype .Controller ;
@@ -66,7 +70,66 @@ public class XLSXController {
66
70
private SpVdxCopyrightRepository spVdxCopyrightRepo ;
67
71
@ Autowired
68
72
private SpVdxJournalBorrowingRepository spVdxJournalBorrowingRepo ;
73
+ @ Autowired
74
+ private SpVdxBorrowingUnfilledSummaryRepository spVdxBorrowingUnfilledSummaryRepo ;
75
+ @ Autowired
76
+ private SpVdxLendingUnfilledSummaryRepository spVdxLendingUnfilledSummaryRepo ;
69
77
78
+ @ RequestMapping (
79
+ value = "{campusCode}/borrowing_unfilled_summary.xlsx" ,
80
+ produces = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" )
81
+ public void getBorrowingUnfilledSummary (
82
+ @ PathVariable ("campusCode" ) String campusCode ,
83
+ OutputStream output ,
84
+ @ RequestParam (required = false , name = "startDate" , defaultValue = "1900-01-01" ) @ DateTimeFormat (pattern = "yyyy-MM-dd" ) LocalDate startDate ,
85
+ @ RequestParam (required = false , name = "endDate" , defaultValue = "2100-01-01" ) @ DateTimeFormat (pattern = "yyyy-MM-dd" ) LocalDate endDate ) throws IOException {
86
+ ReportWorkbookBuilder .newWorkbook (SpVdxBorrowingUnfilledSummary .class )
87
+ .fieldText ("Borrowing Campus" , summary -> summary .getReqCampus ().getCode ())
88
+ .fieldText ("Borrowing Library" , summary -> summary .getReqName ())
89
+ .fieldText ("Lending Library" , summary -> summary .getRespName ())
90
+ .fieldText ("Service Type" , summary -> summary .getServiceTp ().getCode ())
91
+ .fieldNum ("Total" , summary -> summary .getCount ())
92
+ .data (spVdxBorrowingUnfilledSummaryRepo .getBorrowingUnfilledSummary (
93
+ VdxCampus .fromCode (campusCode ).map (VdxCampus ::getCode ).orElse ("%" ),
94
+ startDate ,
95
+ endDate ).collect (Collectors .toList ()))
96
+ .pivotRow (0 )
97
+ .pivotRow (1 )
98
+ .pivotColumn (3 )
99
+ .pivotValue (4 , DataConsolidateFunction .SUM , "# of Unfilled Requests" )
100
+ .build ()
101
+ .write (output );
102
+ }
103
+
104
+ @ RequestMapping (
105
+ value = "{campusCode}/lending_unfilled_summary.xlsx" ,
106
+ produces = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" )
107
+ public void getLendingUnfilledSummary (
108
+ @ PathVariable ("campusCode" ) String campusCode ,
109
+ OutputStream output ,
110
+ @ RequestParam (required = false , name = "startDate" , defaultValue = "1900-01-01" ) @ DateTimeFormat (pattern = "yyyy-MM-dd" ) LocalDate startDate ,
111
+ @ RequestParam (required = false , name = "endDate" , defaultValue = "2100-01-01" ) @ DateTimeFormat (pattern = "yyyy-MM-dd" ) LocalDate endDate ) throws IOException {
112
+ ReportWorkbookBuilder .newWorkbook (SpVdxLendingUnfilledSummary .class )
113
+ .fieldText ("Lending Campus" , summary -> summary .getRespCampus ().getCode ())
114
+ .fieldText ("Lending Library" , SpVdxLendingUnfilledSummary ::getRespName )
115
+ .fieldText ("Borrowing Library Type" , SpVdxLendingUnfilledSummary ::getReqLoctype )
116
+ .fieldText ("Borrowing Library" , SpVdxLendingUnfilledSummary ::getReqName )
117
+ .fieldText ("Service Type" , summary -> summary .getServiceTp ().getCode ())
118
+ .fieldNum ("Total" , summary -> summary .getCount ())
119
+ .data (spVdxLendingUnfilledSummaryRepo .getLendingUnfilledSummary (
120
+ VdxCampus .fromCode (campusCode ).map (VdxCampus ::getCode ).orElse ("%" ),
121
+ startDate ,
122
+ endDate ).collect (Collectors .toList ()))
123
+ .pivotRow (0 )
124
+ .pivotRow (1 )
125
+ .pivotRow (2 )
126
+ .pivotRow (3 )
127
+ .pivotColumn (4 )
128
+ .pivotValue (5 , DataConsolidateFunction .SUM , "# of Unfilled Responses" )
129
+ .build ()
130
+ .write (output );
131
+ }
132
+
70
133
@ RequestMapping (
71
134
value = "{campusCode}/borrowing_summary.xlsx" ,
72
135
produces = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" )
@@ -78,7 +141,7 @@ public void getBorrowingSummary(
78
141
ReportWorkbookBuilder .newWorkbook (SpVdxBorrowingSummary .class )
79
142
.fieldText ("Borrowing Campus" , summary -> summary .getReqCampus ().getCode ())
80
143
.fieldText ("Borrowing Library" , summary -> summary .getReqName ())
81
- .fieldText ("Lender Category" , summary -> summary .getRespCategory ().getCode ())
144
+ .fieldText ("Lender Category" , summary -> summary .getRespCategory ().getDescr ())
82
145
.fieldNum ("Total" , summary -> summary .getCount ())
83
146
.data (spVdxBorrowingSummaryRepo .getBorrowingSummary (
84
147
VdxCampus .fromCode (campusCode ).map (VdxCampus ::getCode ).orElse ("%" ),
@@ -103,7 +166,7 @@ public void getLendingSummary(
103
166
ReportWorkbookBuilder .newWorkbook (SpVdxLendingSummary .class )
104
167
.fieldText ("Lending Campus" , summary -> summary .getRespCampus ().getCode ())
105
168
.fieldText ("Lending Library" , summary -> summary .getRespName ())
106
- .fieldText ("Borrower Category" , summary -> summary .getReqCategory ().getCode ())
169
+ .fieldText ("Borrower Category" , summary -> summary .getReqCategory ().getDescr ())
107
170
.fieldNum ("Total" , summary -> summary .getCount ())
108
171
.data (spVdxLendingSummaryRepo .getLendingSummary (
109
172
VdxCampus .fromCode (campusCode ).map (VdxCampus ::getCode ).orElse ("%" ),
0 commit comments