From 39e44c076d88018a5ef55c1920eae71ecc63a7c8 Mon Sep 17 00:00:00 2001 From: yixian Date: Wed, 17 Oct 2018 14:25:44 +0800 Subject: [PATCH] ABAfile comment update --- .../clearing/core/impl/CleanServiceImpl.java | 4 ++-- .../payment/manage/support/abafile/ABAFile.java | 10 ++++++---- 2 files changed, 8 insertions(+), 6 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 5c3cbaea3..e4e9e4e11 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 @@ -515,7 +515,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider if (settle.getBigDecimal("clearing_amount").compareTo(BigDecimal.ZERO) == 0) { continue; } - aba.addSettleMerchant(settle.getString("bsb_no"), settle.getString("account_no"), settle.getString("account_name"), + aba.addSettleMerchant(settle.getString("client_moniker"), settle.getString("bsb_no"), settle.getString("account_no"), settle.getString("account_name"), settle.getBigDecimal("clearing_amount")); } return aba; @@ -1016,7 +1016,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider // String mailId = mailService.sendEmail(title, "164851225@qq.com", "1029811920@qq.com", content, // attachList); JSONObject config = sysConfigManager.getSysConfig(); - String mailId = mailService.sendEmail(title, config.getString("settle_mail_to"),config.getString("settle_mail_cc"), content, attachList); + String mailId = mailService.sendEmail(title, config.getString("settle_mail_to"), config.getString("settle_mail_cc"), content, attachList); if (settleMail == null) { JSONObject settleMailRecord = new JSONObject(); diff --git a/src/main/java/au/com/royalpay/payment/manage/support/abafile/ABAFile.java b/src/main/java/au/com/royalpay/payment/manage/support/abafile/ABAFile.java index 24ccab615..5e893936b 100644 --- a/src/main/java/au/com/royalpay/payment/manage/support/abafile/ABAFile.java +++ b/src/main/java/au/com/royalpay/payment/manage/support/abafile/ABAFile.java @@ -29,8 +29,8 @@ public class ABAFile { totalSettleAmount = BigDecimal.ZERO; } - public void addSettleMerchant(String bsbNo, String accountNo, String accountName, BigDecimal settleAmount) { - settlements.add(new SettleMerchantInfo(bsbNo, accountNo, accountName, settleAmount)); + public void addSettleMerchant(String clientMoniker, String bsbNo, String accountNo, String accountName, BigDecimal settleAmount) { + settlements.add(new SettleMerchantInfo(clientMoniker, bsbNo, accountNo, accountName, settleAmount)); totalSettleAmount = totalSettleAmount.add(settleAmount); } @@ -129,12 +129,14 @@ public class ABAFile { } private class SettleMerchantInfo { + private final String clientMoniker; private final String bsbNo; private final String accountNo; private final String accountName; private final BigDecimal settleAmount; - public SettleMerchantInfo(String bsbNo, String accountNo, String accountName, BigDecimal settleAmount) { + public SettleMerchantInfo(String clientMoniker, String bsbNo, String accountNo, String accountName, BigDecimal settleAmount) { + this.clientMoniker = clientMoniker; this.bsbNo = bsbNo; this.accountNo = accountNo.replaceAll("\\D", ""); this.accountName = accountName; @@ -149,7 +151,7 @@ public class ABAFile { lineBuilder.replace(18, 20, "50"); lineBuilder.replace(20, 30, getSettleAmount()); lineBuilder.replace(30, 62, getAccountName()); - lineBuilder.replace(62, 80, StringUtils.rightPad("RoyalPay" + DateFormatUtils.format(settleDate, "yyyyMMdd"), 18)); + lineBuilder.replace(62, 80, StringUtils.rightPad("RoyalPay" + DateFormatUtils.format(settleDate, "MMdd") + clientMoniker, 18)); lineBuilder.replace(80, 87, bsbNo(base.getBsb())); lineBuilder.replace(87, 96, StringUtils.leftPad(base.getAccountNo(), 9)); lineBuilder.replace(96, 112, StringUtils.left(StringUtils.rightPad(base.getAccountName(), 16), 16));