账单文件清算时间、描述添加

master
dell 5 years ago
parent 6e2d8397fd
commit 72a06e8987

@ -1048,7 +1048,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
Sheet sheet = wb.createSheet("Merchant_Settlement_Info_" + DateFormatUtils.format(reportDate, "yyyyMMdd")); Sheet sheet = wb.createSheet("Merchant_Settlement_Info_" + DateFormatUtils.format(reportDate, "yyyyMMdd"));
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 = {"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"}; "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)"}; 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++) {
@ -1062,53 +1062,58 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
continue; continue;
} }
row = sheet.createRow(++rowNum); row = sheet.createRow(++rowNum);
row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("order_id")); Date cleartime = (Date) settle.get("clearing_time");
row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("client_order_id")); 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"); 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(4, 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(5, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("channel"));
if (settle.getInteger("gateway") != null) { 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 { } 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()); row.createCell(7, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("exchange_rate").setScale(5, BigDecimal.ROUND_DOWN).toPlainString());
cell = row.createCell(6, Cell.CELL_TYPE_STRING); cell = row.createCell(8, Cell.CELL_TYPE_STRING);
cell.setCellValue(settle.getString("transaction_type")); cell.setCellValue(settle.getString("transaction_type"));
cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null); cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null);
row.createCell(7, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("transaction_currency")); row.createCell(9, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("transaction_currency"));
cell = row.createCell(8, Cell.CELL_TYPE_STRING); cell = row.createCell(10, Cell.CELL_TYPE_STRING);
cell.setCellValue(settle.getBigDecimal("display_amount") == null ? "" cell.setCellValue(settle.getBigDecimal("display_amount") == null ? ""
: "Credit".equals(settle.getString("transaction_type")) ? : "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() :
"-" + 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.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 ? "" cell.setCellValue(settle.getBigDecimal("transaction_amount") == null ? ""
: "Credit".equals(settle.getString("transaction_type")) ? : "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() :
"-" + 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.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 ? "" cell.setCellValue(settle.getBigDecimal("clearing_amount") == null ? ""
: "Credit".equals(settle.getString("transaction_type")) ? : "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() :
"-" + 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); 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() + "%"); : channels.getJSONObject(settle.getString("channel")).getBigDecimal("rate").toPlainString() + "%");
//手续费 + gst //手续费 + 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()); : 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()); : 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 ? "" 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(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"), "-"); String clientDevId = StringUtils.defaultString(settle.getString("dev_id"), "-");
JSONObject device = clientDeviceMapper.find(settle.getString("dev_id")); JSONObject device = clientDeviceMapper.find(settle.getString("dev_id"));
String clientDevRemark = "-"; String clientDevRemark = "-";
@ -1116,8 +1121,8 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
clientDevId = device.getString("client_dev_id"); clientDevId = device.getString("client_dev_id");
clientDevRemark = device.getString("remark"); clientDevRemark = device.getString("remark");
} }
row.createCell(16, Cell.CELL_TYPE_STRING).setCellValue(clientDevId); row.createCell(18, Cell.CELL_TYPE_STRING).setCellValue(clientDevId);
row.createCell(17, Cell.CELL_TYPE_STRING).setCellValue(clientDevRemark); row.createCell(19, Cell.CELL_TYPE_STRING).setCellValue(clientDevRemark);
} }
row = sheet.createRow(++rowNum); row = sheet.createRow(++rowNum);
for (int i = 0; i < analysis.length; i++) { for (int i = 0; i < analysis.length; i++) {

@ -1154,6 +1154,7 @@
round((t.incremental_surcharge * 0.1),2) as incremental_tax, round((t.incremental_surcharge * 0.1),2) as incremental_tax,
(t.tax_amount - round((t.incremental_surcharge * 0.1),2)) as royalpay_tax, (t.tax_amount - round((t.incremental_surcharge * 0.1),2)) as royalpay_tax,
IFNULL(t.incremental_surcharge, 0.00) incremental_surcharge_settle, IFNULL(t.incremental_surcharge, 0.00) incremental_surcharge_settle,
CONCAT(lcd.account_no, lcd.account_name) as description,
o.display_amount, o.display_amount,
o.client_order_id, o.client_order_id,
o.gateway, o.gateway,
@ -1167,6 +1168,7 @@
LEFT JOIN pmt_orders o ON o.order_id = t.order_id 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 pmt_refunds r ON r.refund_id = t.refund_id
LEFT JOIN sys_client_incremental sci on sci.client_id = t.client_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' WHERE t.channel != 'Settlement'
AND t.clearing_order = #{clearing_order} AND t.clearing_order = #{clearing_order}
]]> ]]>

Loading…
Cancel
Save