|
|
|
@ -209,6 +209,7 @@ public class DailyReportImp implements DailyReport {
|
|
|
|
|
JSONObject report = new JSONObject();
|
|
|
|
|
List<JSONObject> settles = transactionMapper.getSettleDataDailyReport(beginTime,endTime);
|
|
|
|
|
JSONObject yesterdayTotal = this.computerTotalAmount(settles);
|
|
|
|
|
BigDecimal yesterday_settle_amount = yesterdayTotal.getBigDecimal("total_settle_amount");
|
|
|
|
|
BigDecimal yesterday_credit_amount = yesterdayTotal.getBigDecimal("total_credit_amount");
|
|
|
|
|
BigDecimal yesterday_debit_amount = yesterdayTotal.getBigDecimal("total_debit_amount");
|
|
|
|
|
BigDecimal yesterday_net_trading = yesterdayTotal.getBigDecimal("total_net_trading");
|
|
|
|
@ -219,6 +220,7 @@ public class DailyReportImp implements DailyReport {
|
|
|
|
|
|
|
|
|
|
List<JSONObject> last_settle = transactionMapper.getSettleDataDailyReport(DateUtils.addDays(beginTime,-1),DateUtils.addDays(endTime,-1));
|
|
|
|
|
JSONObject lastTotal = this.computerTotalAmount(last_settle);
|
|
|
|
|
BigDecimal last_settle_amount = lastTotal.getBigDecimal("total_settle_amount");
|
|
|
|
|
BigDecimal last_total_credit = lastTotal.getBigDecimal("total_credit_amount");
|
|
|
|
|
BigDecimal last_debit_amount = lastTotal.getBigDecimal("total_debit_amount");
|
|
|
|
|
BigDecimal last_net_trading = lastTotal.getBigDecimal("total_net_trading");
|
|
|
|
@ -227,6 +229,7 @@ public class DailyReportImp implements DailyReport {
|
|
|
|
|
BigDecimal last_channel_surcharge = lastTotal.getBigDecimal("total_channel_surcharge");
|
|
|
|
|
BigDecimal last_tax_amount = lastTotal.getBigDecimal("total_tax_amount");
|
|
|
|
|
|
|
|
|
|
JSONObject percentage_yesterday_settle_amount = this.percentage(yesterday_settle_amount, last_settle_amount);
|
|
|
|
|
JSONObject percentage_yesterday_total_credit = this.percentage(yesterday_credit_amount, last_total_credit);
|
|
|
|
|
JSONObject percentage_yesterday_debit_amount = this.percentage(yesterday_debit_amount, last_debit_amount);
|
|
|
|
|
JSONObject percentage_yesterday_net_trading = this.percentage(yesterday_net_trading, last_net_trading);
|
|
|
|
@ -236,6 +239,10 @@ public class DailyReportImp implements DailyReport {
|
|
|
|
|
JSONObject percentage_yesterday_tax_amount = this.percentage(yesterday_tax_amount, last_tax_amount);
|
|
|
|
|
|
|
|
|
|
report.put("channels",settles);
|
|
|
|
|
report.put("total_settle_amount",new JSONObject(){{
|
|
|
|
|
put("amount",yesterday_settle_amount);
|
|
|
|
|
put("compare",percentage_yesterday_settle_amount);
|
|
|
|
|
}});
|
|
|
|
|
report.put("total_credit_amount",new JSONObject(){{
|
|
|
|
|
put("amount",yesterday_credit_amount);
|
|
|
|
|
put("compare",percentage_yesterday_total_credit);
|
|
|
|
@ -265,10 +272,11 @@ public class DailyReportImp implements DailyReport {
|
|
|
|
|
put("compare",percentage_yesterday_tax_amount);
|
|
|
|
|
}});
|
|
|
|
|
|
|
|
|
|
return report;
|
|
|
|
|
return report;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private JSONObject computerTotalAmount(List<JSONObject> settles){
|
|
|
|
|
BigDecimal total_settle_amount = new BigDecimal("0.00");
|
|
|
|
|
BigDecimal total_credit_amount = new BigDecimal("0.00");
|
|
|
|
|
BigDecimal total_debit_amount = new BigDecimal("0.00");
|
|
|
|
|
BigDecimal total_net_trading = new BigDecimal("0.00");
|
|
|
|
@ -281,6 +289,10 @@ public class DailyReportImp implements DailyReport {
|
|
|
|
|
for (int i=0;i<settles.size();i++){
|
|
|
|
|
JSONObject jsonObject = settles.get(i);
|
|
|
|
|
|
|
|
|
|
BigDecimal settle_amount = jsonObject.getBigDecimal("settle_amount");
|
|
|
|
|
total_settle_amount = total_settle_amount.add(settle_amount);
|
|
|
|
|
jsonObject.put("settle_amount",df1.format(settle_amount));
|
|
|
|
|
|
|
|
|
|
BigDecimal credit_amount = jsonObject.getBigDecimal("credit_amount");
|
|
|
|
|
total_credit_amount = total_credit_amount.add(credit_amount);
|
|
|
|
|
jsonObject.put("credit_amount",df1.format(credit_amount));
|
|
|
|
@ -310,6 +322,7 @@ public class DailyReportImp implements DailyReport {
|
|
|
|
|
total_tax_amount = total_tax_amount.add(tax_amount);
|
|
|
|
|
jsonObject.put("tax_amount",df1.format(tax_amount));
|
|
|
|
|
}
|
|
|
|
|
String finalTotal_settle_amount = df1.format(total_settle_amount);
|
|
|
|
|
String finalTotal_credit_amount = df1.format(total_credit_amount);
|
|
|
|
|
String finalTotal_debit_amount = df1.format(total_debit_amount);
|
|
|
|
|
String finalTotal_net_trading = df1.format(total_net_trading);
|
|
|
|
@ -318,6 +331,7 @@ public class DailyReportImp implements DailyReport {
|
|
|
|
|
String finalTotal_channel_surcharge = df1.format(total_channel_surcharge);
|
|
|
|
|
String finalTotal_tax_amount = df1.format(total_tax_amount);
|
|
|
|
|
return new JSONObject(){{
|
|
|
|
|
put("total_settle_amount",finalTotal_settle_amount);
|
|
|
|
|
put("total_credit_amount", finalTotal_credit_amount);
|
|
|
|
|
put("total_debit_amount", finalTotal_debit_amount);
|
|
|
|
|
put("total_net_trading", finalTotal_net_trading);
|
|
|
|
|