|
|
|
@ -682,11 +682,11 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
|
|
|
|
|
}
|
|
|
|
|
List<String> dateKeysList = new ArrayList<>();
|
|
|
|
|
dateKeysList.add("transaction_time");
|
|
|
|
|
if (timezone_client == null) {
|
|
|
|
|
if (timezone_client != null) {
|
|
|
|
|
transactions.parallelStream().forEach(p -> {
|
|
|
|
|
TimeZoneUtils.switchTimeZone(p, timezone_client, "transaction_time");
|
|
|
|
|
});
|
|
|
|
|
//TimeZoneUtils.switchTimeZoneToString(transactions,timezone_client,TimeZoneUtils.PATTERN_DATE,dateKeysList);
|
|
|
|
|
TimeZoneUtils.switchTimeZoneToString(transactions,timezone_client,TimeZoneUtils.PATTERN_DATE,dateKeysList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Map<String,List<JSONObject>> dayTransactionsMap = transactions.stream().collect(Collectors.groupingBy(x -> x.getString("transaction_time").substring(0,10)));
|
|
|
|
@ -694,9 +694,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
|
|
|
|
|
for (Map.Entry<String, List<JSONObject>> entry : dayTransactionsMap.entrySet()){
|
|
|
|
|
JSONObject analysis = new JSONObject();
|
|
|
|
|
List<JSONObject> transactionsOfDay = entry.getValue();
|
|
|
|
|
/*if(entry.getKey().equals("2017-11-20")){
|
|
|
|
|
int i = 0;
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
BigDecimal total_credit = transactionsOfDay.stream().filter(t->t.getString("transaction_type").equals("Credit")).filter(t->t.containsKey("clearing_amount")).map(t-> t.getBigDecimal("clearing_amount")).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
|
BigDecimal total_debit = transactionsOfDay.stream().filter(t->t.getString("transaction_type").equals("Debit")).filter(t->t.containsKey("clearing_amount")).map(t-> t.getBigDecimal("clearing_amount")).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
|
BigDecimal total_charge_credit = transactionsOfDay.stream().filter(t->t.getString("transaction_type").equals("Credit")).filter(t->t.containsKey("total_surcharge")).map(t-> t.getBigDecimal("total_surcharge")).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
|