@@ -89,7 +89,7 @@ public List<Integer> getActiveTransactionIds(String chargeBoxId) {
89
89
}
90
90
91
91
@ Override
92
- public TransactionDetails getDetails (int transactionPk , boolean firstArrivingMeterValueIfMultiple ) {
92
+ public TransactionDetails getDetails (int transactionPk ) {
93
93
94
94
// -------------------------------------------------------------------------
95
95
// Step 1: Collect general data about transaction
@@ -176,20 +176,7 @@ public TransactionDetails getDetails(int transactionPk, boolean firstArrivingMet
176
176
//
177
177
Table <ConnectorMeterValueRecord > t1 = transactionQuery .union (timestampQuery ).asTable ("t1" );
178
178
179
- // -------------------------------------------------------------------------
180
- // Step 3: Charging station might send meter vales at fixed intervals (e.g.
181
- // every 15 min) regardless of the fact that connector's meter value did not
182
- // change (e.g. vehicle is fully charged, but cable is still connected). This
183
- // yields multiple entries in db with the same value but different timestamp.
184
- // We are only interested in the first (or last) arriving entry.
185
- // -------------------------------------------------------------------------
186
-
187
- Field <DateTime > dateTimeField ;
188
- if (firstArrivingMeterValueIfMultiple ) {
189
- dateTimeField = DSL .min (t1 .field (2 , DateTime .class )).as ("min" );
190
- } else {
191
- dateTimeField = DSL .max (t1 .field (2 , DateTime .class )).as ("max" );
192
- }
179
+ Field <DateTime > dateTimeField = t1 .field (2 , DateTime .class );
193
180
194
181
List <TransactionDetails .MeterValues > values =
195
182
ctx .select (
@@ -202,14 +189,6 @@ public TransactionDetails getDetails(int transactionPk, boolean firstArrivingMet
202
189
t1 .field (8 , String .class ),
203
190
t1 .field (9 , String .class ))
204
191
.from (t1 )
205
- .groupBy (
206
- t1 .field (3 ),
207
- t1 .field (4 ),
208
- t1 .field (5 ),
209
- t1 .field (6 ),
210
- t1 .field (7 ),
211
- t1 .field (8 ),
212
- t1 .field (9 ))
213
192
.orderBy (dateTimeField )
214
193
.fetch ()
215
194
.map (r -> TransactionDetails .MeterValues .builder ()
0 commit comments