From 72a06e8987e8320320761e83e187c8d3e10d2fcd Mon Sep 17 00:00:00 2001 From: dell Date: Tue, 26 May 2020 12:05:54 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A6=E5=8D=95=E6=96=87=E4=BB=B6=E6=B8=85?= =?UTF-8?q?=E7=AE=97=E6=97=B6=E9=97=B4=E3=80=81=E6=8F=8F=E8=BF=B0=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../clearing/core/impl/CleanServiceImpl.java | 45 ++++++++++--------- .../mappers/payment/TransactionMapper.xml | 2 + 2 files changed, 27 insertions(+), 20 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java index ac308ef7b..90c1afcf9 100644 --- a/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/management/clearing/core/impl/CleanServiceImpl.java @@ -1048,7 +1048,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider Sheet sheet = wb.createSheet("Merchant_Settlement_Info_" + DateFormatUtils.format(reportDate, "yyyyMMdd")); int rowNum = 0; Row row = sheet.createRow(rowNum); - String[] title = {"order Id", "Client Order Id", "Transaction Time", "Channel", "Gateway", "Exchange Rate", "Transaction Type", "Currency", + String[] title = {"process date","description","order Id", "Client Order Id", "Transaction Time", "Channel", "Gateway", "Exchange Rate", "Transaction Type", "Currency", "Input Amount", "Total Amount", "Clearing Amount(AUD)", "Sruchange Rate", "Surcharge(AUD)", "GST(AUD)", "Settle Amount(AUD)", "Remark", "Dev No", "Dev Remark"}; 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++) { @@ -1062,53 +1062,58 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider continue; } row = sheet.createRow(++rowNum); - row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("order_id")); - row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("client_order_id")); + Date cleartime = (Date) settle.get("clearing_time"); + row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(DateFormatUtils.format(cleartime, "yyyy-MM-dd")); + + + row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("description")); + row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("order_id")); + row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("client_order_id")); Calendar calendar = (Calendar) settle.get("transaction_time"); - row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(DateFormatUtils.format(calendar, "yyyy-MM-dd HH:mm:ss", calendar.getTimeZone())); - row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("channel")); + row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(DateFormatUtils.format(calendar, "yyyy-MM-dd HH:mm:ss", calendar.getTimeZone())); + row.createCell(5, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("channel")); if (settle.getInteger("gateway") != null) { - row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(TradeType.fromGatewayNumber(settle.getIntValue("gateway")).getTradeType()); + row.createCell(6, Cell.CELL_TYPE_STRING).setCellValue(TradeType.fromGatewayNumber(settle.getIntValue("gateway")).getTradeType()); } else { - row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue("-"); + row.createCell(6, Cell.CELL_TYPE_STRING).setCellValue("-"); } - row.createCell(5, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("exchange_rate").setScale(5, BigDecimal.ROUND_DOWN).toPlainString()); - cell = row.createCell(6, Cell.CELL_TYPE_STRING); + row.createCell(7, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("exchange_rate").setScale(5, BigDecimal.ROUND_DOWN).toPlainString()); + cell = row.createCell(8, Cell.CELL_TYPE_STRING); cell.setCellValue(settle.getString("transaction_type")); cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null); - row.createCell(7, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("transaction_currency")); - cell = row.createCell(8, Cell.CELL_TYPE_STRING); + row.createCell(9, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("transaction_currency")); + cell = row.createCell(10, Cell.CELL_TYPE_STRING); cell.setCellValue(settle.getBigDecimal("display_amount") == null ? "" : "Credit".equals(settle.getString("transaction_type")) ? settle.getBigDecimal("display_amount").setScale(2, BigDecimal.ROUND_DOWN).toPlainString() : "-" + settle.getBigDecimal("display_amount").setScale(2, BigDecimal.ROUND_DOWN).toPlainString()); cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null); - cell = row.createCell(9, Cell.CELL_TYPE_STRING); + cell = row.createCell(11, Cell.CELL_TYPE_STRING); cell.setCellValue(settle.getBigDecimal("transaction_amount") == null ? "" : "Credit".equals(settle.getString("transaction_type")) ? settle.getBigDecimal("transaction_amount").setScale(2, BigDecimal.ROUND_DOWN).toPlainString() : "-" + settle.getBigDecimal("transaction_amount").setScale(2, BigDecimal.ROUND_DOWN).toPlainString()); cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null); - cell = row.createCell(10, Cell.CELL_TYPE_STRING); + cell = row.createCell(12, Cell.CELL_TYPE_STRING); cell.setCellValue(settle.getBigDecimal("clearing_amount") == null ? "" : "Credit".equals(settle.getString("transaction_type")) ? settle.getBigDecimal("clearing_amount").setScale(2, BigDecimal.ROUND_DOWN).toPlainString() : "-" + settle.getBigDecimal("clearing_amount").setScale(2, BigDecimal.ROUND_DOWN).toPlainString()); 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(13, Cell.CELL_TYPE_STRING).setCellValue(channels.getString(settle.getString("channel")) == null ? "" : channels.getJSONObject(settle.getString("channel")).getBigDecimal("rate").toPlainString() + "%"); //手续费 + gst - row.createCell(12, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("total_surcharge") == null ? "" + row.createCell(14, 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 ? "" + row.createCell(15, 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 = row.createCell(16, Cell.CELL_TYPE_STRING); cell.setCellValue(settle.getBigDecimal("settle_amount") == null ? "" : "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()); cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null); - row.createCell(15, Cell.CELL_TYPE_STRING).setCellValue(settle.containsKey("order_detail") ? settle.getString("order_detail") : settle.getString("remark")); + row.createCell(17, Cell.CELL_TYPE_STRING).setCellValue(settle.containsKey("order_detail") ? settle.getString("order_detail") : settle.getString("remark")); String clientDevId = StringUtils.defaultString(settle.getString("dev_id"), "-"); JSONObject device = clientDeviceMapper.find(settle.getString("dev_id")); String clientDevRemark = "-"; @@ -1116,8 +1121,8 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider clientDevId = device.getString("client_dev_id"); clientDevRemark = device.getString("remark"); } - row.createCell(16, Cell.CELL_TYPE_STRING).setCellValue(clientDevId); - row.createCell(17, Cell.CELL_TYPE_STRING).setCellValue(clientDevRemark); + row.createCell(18, Cell.CELL_TYPE_STRING).setCellValue(clientDevId); + row.createCell(19, Cell.CELL_TYPE_STRING).setCellValue(clientDevRemark); } row = sheet.createRow(++rowNum); for (int i = 0; i < analysis.length; i++) { diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml index b7508e323..95eaededa 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml @@ -1154,6 +1154,7 @@ round((t.incremental_surcharge * 0.1),2) as incremental_tax, (t.tax_amount - round((t.incremental_surcharge * 0.1),2)) as royalpay_tax, IFNULL(t.incremental_surcharge, 0.00) incremental_surcharge_settle, + CONCAT(lcd.account_no, lcd.account_name) as description, o.display_amount, o.client_order_id, o.gateway, @@ -1167,6 +1168,7 @@ LEFT JOIN pmt_orders o ON o.order_id = t.order_id LEFT JOIN pmt_refunds r ON r.refund_id = t.refund_id LEFT JOIN sys_client_incremental sci on sci.client_id = t.client_id + INNER JOIN log_clearing_detail lcd ON t.clearing_order = lcd.clear_detail_id WHERE t.channel != 'Settlement' AND t.clearing_order = #{clearing_order} ]]>