|
|
|
@ -1986,18 +1986,20 @@ public class TradeLogServiceImpl implements TradeLogService {
|
|
|
|
|
}
|
|
|
|
|
clientManager.queryModifyClientIds(client.getIntValue("client_id"), params);
|
|
|
|
|
List<JSONObject> clientOrderList = transactionMapper.getClientOrderByTransactionTime(params);
|
|
|
|
|
List<Integer> clientOrders = new ArrayList<>(clientOrderList.size());
|
|
|
|
|
clientOrderList.parallelStream().forEach(p -> clientOrders.add(p.getInteger("clearing_order")));
|
|
|
|
|
List<JSONObject> settlementLogDetailList = transactionMapper.getSettlementLogDetailList(clientOrders);
|
|
|
|
|
TimeZoneUtils.switchTimeZoneToString(settlementLogDetailList, timezone, "yyyy-MM-dd HH:mm:ss", Collections.singletonList("transaction_time"));
|
|
|
|
|
try {
|
|
|
|
|
JSONObject parmerters = new JSONObject();
|
|
|
|
|
parmerters.put("dateRange", "(Statement Period " + begin + "~"
|
|
|
|
|
+ end + ")");
|
|
|
|
|
parmerters.put("clientName", client.getString("company_name"));
|
|
|
|
|
parmerters.put("clientAddress", client.getString("address"));
|
|
|
|
|
parmerters.put("clientLocation", client.getString("suburb") + "," + client.getString("state") + "," + client.getString("postcode"));
|
|
|
|
|
List<JSONObject> settlementLogDetailList = new ArrayList<>();
|
|
|
|
|
try {
|
|
|
|
|
parmerters.put("logo", logo.getInputStream());
|
|
|
|
|
if (clientOrderList.size() > 0) {
|
|
|
|
|
List<Integer> clientOrders = new ArrayList<>(clientOrderList.size());
|
|
|
|
|
clientOrderList.parallelStream().forEach(p -> clientOrders.add(p.getInteger("clearing_order")));
|
|
|
|
|
settlementLogDetailList = transactionMapper.getSettlementLogDetailList(clientOrders);
|
|
|
|
|
TimeZoneUtils.switchTimeZoneToString(settlementLogDetailList, timezone, "yyyy-MM-dd HH:mm:ss", Collections.singletonList("transaction_time"));
|
|
|
|
|
settlementLogDetailList.parallelStream().forEach(item -> {
|
|
|
|
|
scaleDecimalVal(item, "display_amount", item.getString("transaction_currency"));
|
|
|
|
|
String platformCurrency = PlatformEnvironment.getEnv().getForeignCurrency();
|
|
|
|
@ -2009,8 +2011,6 @@ public class TradeLogServiceImpl implements TradeLogService {
|
|
|
|
|
item.put("gateway", item.getInteger("gateway") == null ? "-" : TradeType.fromGatewayNumber(item.getIntValue("gateway")).getTradeType());
|
|
|
|
|
item.put("rate", item.getBigDecimal("rate") == null ? "-" : item.getBigDecimal("rate").toPlainString() + "%");
|
|
|
|
|
});
|
|
|
|
|
if (settlementLogDetailList == null) {
|
|
|
|
|
settlementLogDetailList = new ArrayList<>();
|
|
|
|
|
}
|
|
|
|
|
JRDataSource jrDataSource = new JRBeanCollectionDataSource(settlementLogDetailList);
|
|
|
|
|
return JasperRunManager.runReportToPdf(partner_settlement_flow.getInputStream(), parmerters, jrDataSource);
|
|
|
|
|