|
|
@ -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++) {
|
|
|
|