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 745a34693..b419e9a95 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
@@ -943,9 +943,6 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
model.put("date", DateFormatUtils.format(date, "dd-MM-yyyy"));
// todo themeleaf
- Context ctx = new Context();
- ctx.setVariable("date", DateFormatUtils.format(date, "dd-MM-yyyy"));
- final String content = thymeleaf.process("mail/settlement_mail", ctx);
// final String content = VelocityEngineUtils.mergeTemplateIntoString(velocityEngine,
// "mail/settlement_mail.vm", "utf-8", model);
@@ -984,6 +981,11 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
}
attach2.put("name", fileName2);
attachList.add(attach2);
+
+ Context ctx = new Context();
+ ctx.setVariable("date", DateFormatUtils.format(date, "dd-MM-yyyy"));
+ ctx.setVariable("abaFiles", abaFileList);
+ final String content = thymeleaf.process("mail/settlement_mail", ctx);
// 测试用地址
// String mailId = mailService.sendEmail(title, "164851225@qq.com", "1029811920@qq.com", content,
// attachList);
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 7c55303b1..b0be420c8 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
@@ -9,6 +9,7 @@ import org.springframework.util.Assert;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.math.BigDecimal;
+import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
@@ -56,6 +57,11 @@ public class ABAFile {
return out.toString().getBytes();
}
+ public String getTotalSettleAmountStr() {
+ DecimalFormat format = new DecimalFormat("#.##0.00");
+ return format.format(totalSettleAmount);
+ }
+
private String generateFinalLine() {
StringBuilder lineBuilder = new StringBuilder(baseLine);
lineBuilder.replace(0, 1, "7");
diff --git a/src/main/resources/templates/mail/settlement_mail.html b/src/main/resources/templates/mail/settlement_mail.html
index 2646fe311..5ed1b6648 100644
--- a/src/main/resources/templates/mail/settlement_mail.html
+++ b/src/main/resources/templates/mail/settlement_mail.html
@@ -1,22 +1,29 @@
-
Dear Flexewallet,
-
-
-
Please find the attached settlement files data up to
-
-
-
Best Regards,
-
RoyalPay Finance team
-
Tunnel Show Pty Ltd trading as RoyalPay
-
Representative of AFS Licensee 448066
-
------------------------------
-
Lv.11,15 William Street, Melbourne 3000
-
Lv.14, 383 Kent Street, Sydney, NSW 2000
-
P: 1300 1077 50
-
E: settlement@royalpay.com.au
-
www.royalpay.com.au
+
Dear Flexewallet,
+
+
+
Please find the attached settlement files data up to
+
+
File Validation:
+
+
+ - ${aba.filename()} : ${aba.getTotalSettleAmountStr()}
+
+
+
+
+
Best Regards,
+
RoyalPay Finance team
+
Tunnel Show Pty Ltd trading as RoyalPay
+
Representative of AFS Licensee 448066
+
------------------------------
+
Lv.11,15 William Street, Melbourne 3000
+
Lv.14, 383 Kent Street, Sydney, NSW 2000
+
P: 1300 1077 50
+
E: settlement@royalpay.com.au
+
www.royalpay.com.au
diff --git a/src/test/java/au/com/royalpay/payment/manage/process/alipay/FixAlipayData.java b/src/test/java/au/com/royalpay/payment/manage/process/alipay/FixAlipayData.java
new file mode 100644
index 000000000..e223a5c45
--- /dev/null
+++ b/src/test/java/au/com/royalpay/payment/manage/process/alipay/FixAlipayData.java
@@ -0,0 +1,94 @@
+package au.com.royalpay.payment.manage.process.alipay;
+
+import com.alibaba.fastjson.JSONObject;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
+import org.apache.poi.ss.usermodel.*;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.test.context.ActiveProfiles;
+import org.springframework.test.context.junit4.SpringRunner;
+
+import javax.annotation.Resource;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.math.BigDecimal;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+
+/**
+ * Create by yixian at 2018-08-14 21:41
+ */
+@SpringBootTest
+@ActiveProfiles({"proxy"})
+@RunWith(SpringRunner.class)
+public class FixAlipayData {
+ @Resource
+ private JdbcTemplate jdbcTemplate;
+ private String fileLocation = "C:\\Users\\yixian\\Documents\\royalpay\\2018\\alipayfix\\2088721525235246_20180815110000000032102003900557154_result - 副本.xls";
+ private String fileTarget = "C:\\Users\\yixian\\Documents\\royalpay\\2018\\alipayfix\\fixed_2088721525235246_20180815110000000032102003900557154_result.xls";
+ private Logger logger = LoggerFactory.getLogger(getClass());
+
+ @Test
+ public void fix() throws IOException, InvalidFormatException {
+ Workbook wb = WorkbookFactory.create(new File(fileLocation));
+ Sheet sheet = wb.getSheetAt(0);
+ final int startRow = 6;
+ int rowNum = startRow;
+ String compName;
+ while ((compName = mchCompName(sheet, rowNum)) != null) {
+ logger.info("row:" + rowNum + ",company name=" + compName);
+ final String corpName = compName;
+ Row row = sheet.getRow(rowNum++);
+ String shortName = row.getCell(2).getStringCellValue();
+ List