|
|
@ -799,7 +799,9 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
|
|
|
|
analysis.put("total_credit", total_credit.setScale(2, RoundingMode.HALF_UP));
|
|
|
|
analysis.put("total_credit", total_credit.setScale(2, RoundingMode.HALF_UP));
|
|
|
|
analysis.put("total_debit", total_debit.setScale(2, RoundingMode.HALF_UP));
|
|
|
|
analysis.put("total_debit", total_debit.setScale(2, RoundingMode.HALF_UP));
|
|
|
|
analysis.put("net_amount", net_amount_credit.subtract(net_amount_debit).setScale(2, RoundingMode.HALF_UP));
|
|
|
|
analysis.put("net_amount", net_amount_credit.subtract(net_amount_debit).setScale(2, RoundingMode.HALF_UP));
|
|
|
|
|
|
|
|
analysis.put("clearing_amount", net_amount_credit.subtract(net_amount_debit).setScale(2, RoundingMode.HALF_UP));
|
|
|
|
analysis.put("tax_amount", tax_amount.setScale(2, RoundingMode.HALF_UP));
|
|
|
|
analysis.put("tax_amount", tax_amount.setScale(2, RoundingMode.HALF_UP));
|
|
|
|
|
|
|
|
analysis.put("total_surcharge", total_charge_credit.subtract(total_charge_debit).setScale(2, RoundingMode.HALF_UP));
|
|
|
|
analysis.put("total_charge", total_charge_credit.subtract(total_charge_debit).add(tax_amount).setScale(2, RoundingMode.HALF_UP));
|
|
|
|
analysis.put("total_charge", total_charge_credit.subtract(total_charge_debit).add(tax_amount).setScale(2, RoundingMode.HALF_UP));
|
|
|
|
analysis.put("gross_amount", total_credit.subtract(total_debit).setScale(2, RoundingMode.HALF_UP));
|
|
|
|
analysis.put("gross_amount", total_credit.subtract(total_debit).setScale(2, RoundingMode.HALF_UP));
|
|
|
|
dayAnalysisMap.put(entry.getKey(), analysis);
|
|
|
|
dayAnalysisMap.put(entry.getKey(), analysis);
|
|
|
@ -837,15 +839,13 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
|
|
|
|
int rowNum = 0;
|
|
|
|
int rowNum = 0;
|
|
|
|
Row row = sheet.createRow(rowNum);
|
|
|
|
Row row = sheet.createRow(rowNum);
|
|
|
|
String[] title = {"order Id", "Client Order Id", "Transaction Time", "Channel", "Gateway", "Exchange Rate", "Transaction Type", "Currency",
|
|
|
|
String[] title = {"order Id", "Client Order Id", "Transaction Time", "Channel", "Gateway", "Exchange Rate", "Transaction Type", "Currency",
|
|
|
|
"Input Amount", "Total Amount", "Clearing Amount", "Sruchange Rate", "Settle Amount", "Remark", "Dev No"};
|
|
|
|
"Input Amount", "Total Amount", "Clearing Amount(AUD)", "Sruchange Rate", "Surcharge(AUD)", "GST(AUD)", "Settle Amount(AUD)", "Remark", "Dev No"};
|
|
|
|
String[] analysis = {"Total Credit", "Total Debit", "Gross Amount", "Total Charge", "Net Amount"};
|
|
|
|
String[] analysis = {"Total Credit(AUD)", "Total Debit(AUD)", "Gross Amount(AUD)", "Total GST(AUD)", "Total Charge(AUD)", "Net Amount(AUD)"};
|
|
|
|
for (int i = 0; i < title.length; i++) {
|
|
|
|
for (int i = 0; i < title.length; i++) {
|
|
|
|
row.createCell(i, Cell.CELL_TYPE_STRING).setCellValue(title[i]);
|
|
|
|
row.createCell(i, Cell.CELL_TYPE_STRING).setCellValue(title[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
JSONObject channels = clearTransation.getJSONObject("channels");
|
|
|
|
JSONObject channels = clearTransation.getJSONObject("channels");
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject device;
|
|
|
|
|
|
|
|
String clientDevId = "";
|
|
|
|
|
|
|
|
for (Object o : clearTransation.getJSONArray("report")) {
|
|
|
|
for (Object o : clearTransation.getJSONArray("report")) {
|
|
|
|
JSONObject settle = (JSONObject) o;
|
|
|
|
JSONObject settle = (JSONObject) o;
|
|
|
|
if (settle.getBigDecimal("clearing_amount").compareTo(BigDecimal.ZERO) == 0) {
|
|
|
|
if (settle.getBigDecimal("clearing_amount").compareTo(BigDecimal.ZERO) == 0) {
|
|
|
@ -887,17 +887,23 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
|
|
|
|
cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type"))?analysisStyle2:null);
|
|
|
|
cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type"))?analysisStyle2:null);
|
|
|
|
row.createCell(11, Cell.CELL_TYPE_STRING).setCellValue(channels.getString(settle.getString("channel")) == null ? ""
|
|
|
|
row.createCell(11, Cell.CELL_TYPE_STRING).setCellValue(channels.getString(settle.getString("channel")) == null ? ""
|
|
|
|
: channels.getJSONObject(settle.getString("channel")).getBigDecimal("rate").toPlainString() + "%");
|
|
|
|
: channels.getJSONObject(settle.getString("channel")).getBigDecimal("rate").toPlainString() + "%");
|
|
|
|
cell = row.createCell(12, Cell.CELL_TYPE_STRING);
|
|
|
|
//手续费 + gst
|
|
|
|
|
|
|
|
row.createCell(12, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("total_surcharge") == null ? ""
|
|
|
|
|
|
|
|
: settle.getBigDecimal("total_surcharge").setScale(2, RoundingMode.DOWN).toPlainString());
|
|
|
|
|
|
|
|
row.createCell(13, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("tax_amount") == null ? ""
|
|
|
|
|
|
|
|
: settle.getBigDecimal("tax_amount").setScale(2, RoundingMode.DOWN).toPlainString());
|
|
|
|
|
|
|
|
cell = row.createCell(14, Cell.CELL_TYPE_STRING);
|
|
|
|
cell.setCellValue(settle.getBigDecimal("settle_amount") == null ? ""
|
|
|
|
cell.setCellValue(settle.getBigDecimal("settle_amount") == null ? ""
|
|
|
|
: "Credit".equals(settle.getString("transaction_type")) ?
|
|
|
|
: "Credit".equals(settle.getString("transaction_type")) ?
|
|
|
|
settle.getBigDecimal("settle_amount").setScale(2, BigDecimal.ROUND_DOWN).toPlainString() :
|
|
|
|
settle.getBigDecimal("settle_amount").setScale(2, BigDecimal.ROUND_DOWN).toPlainString() :
|
|
|
|
"-" + settle.getBigDecimal("settle_amount").setScale(2, BigDecimal.ROUND_DOWN).toPlainString());
|
|
|
|
"-" + settle.getBigDecimal("settle_amount").setScale(2, BigDecimal.ROUND_DOWN).toPlainString());
|
|
|
|
cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null);
|
|
|
|
cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null);
|
|
|
|
row.createCell(13, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("order_detail"));
|
|
|
|
row.createCell(15, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("order_detail"));
|
|
|
|
device = clientDeviceMapper.find(settle.getString("dev_id"));
|
|
|
|
String clientDevId = StringUtils.defaultString(settle.getString("dev_id"), "-");
|
|
|
|
|
|
|
|
JSONObject device = clientDeviceMapper.find(settle.getString("dev_id"));
|
|
|
|
if (device != null)
|
|
|
|
if (device != null)
|
|
|
|
clientDevId = device.getString("client_dev_id");
|
|
|
|
clientDevId = device.getString("client_dev_id");
|
|
|
|
row.createCell(14, Cell.CELL_TYPE_STRING).setCellValue(clientDevId);
|
|
|
|
row.createCell(16, Cell.CELL_TYPE_STRING).setCellValue(clientDevId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
row = sheet.createRow(++rowNum);
|
|
|
|
row = sheet.createRow(++rowNum);
|
|
|
|
for (int i = 0; i < analysis.length; i++) {
|
|
|
|
for (int i = 0; i < analysis.length; i++) {
|
|
|
@ -909,9 +915,9 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
|
|
|
|
row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(clearTransation.getString("total_payment"));
|
|
|
|
row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(clearTransation.getString("total_payment"));
|
|
|
|
row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(clearTransation.getString("total_refund"));
|
|
|
|
row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(clearTransation.getString("total_refund"));
|
|
|
|
row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(clearTransation.getString("gross_amount"));
|
|
|
|
row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(clearTransation.getString("gross_amount"));
|
|
|
|
row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(clearTransation.getBigDecimal("total_charge").add(clearTransation.getBigDecimal("tax_amount")).toPlainString());
|
|
|
|
row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(clearTransation.getString("tax_amount"));
|
|
|
|
row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(clearTransation.getString("clearing_amount"));
|
|
|
|
row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(clearTransation.getString("total_charge"));
|
|
|
|
|
|
|
|
row.createCell(5, Cell.CELL_TYPE_STRING).setCellValue(clearTransation.getString("clearing_amount"));
|
|
|
|
wb.write(ous);
|
|
|
|
wb.write(ous);
|
|
|
|
ous.flush();
|
|
|
|
ous.flush();
|
|
|
|
} catch (IOException e) {
|
|
|
|
} catch (IOException e) {
|
|
|
|