taylor.dang 6 years ago
commit 2c919c18f6

@ -58,7 +58,7 @@ public class ABAFile {
} }
public String getTotalSettleAmountStr() { public String getTotalSettleAmountStr() {
DecimalFormat format = new DecimalFormat("#.##0.00"); DecimalFormat format = new DecimalFormat("#,##0.00");
return format.format(totalSettleAmount); return format.format(totalSettleAmount);
} }

@ -834,10 +834,11 @@ public class TradeLogServiceImpl implements TradeLogService {
JSONObject result = PageListUtils.buildPageListResult(logs); JSONObject result = PageListUtils.buildPageListResult(logs);
result.put("analysis", transactionMapper.getClientAmountAnalysis(params)); result.put("analysis", transactionMapper.getClientAmountAnalysis(params));
if (query.getPage() == 1) { if (query.getPage() == 1) {
if (!logs.isEmpty() && logs.size() > 0) { if (!logs.isEmpty()) {
JSONObject clearingDetail = clearingDetailMapper.findByDetailId(logs.get(0).getIntValue("clear_detail_id")); JSONObject clearingDetail = clearingDetailMapper.findByDetailId(logs.get(0).getIntValue("clear_detail_id"));
if (clearingDetail!=null){ if (clearingDetail!=null){
JSONObject clearingLog = clearingLogMapper.findById(clearingDetail.getIntValue("clearing_id")); JSONObject clearingLog = clearingLogMapper.findById(clearingDetail.getIntValue("clearing_id"));
if(clearingLog.getBooleanValue("editable")){ if(clearingLog.getBooleanValue("editable")){
result.put("padding", true); result.put("padding", true);
logs.get(0).put("padding",true); logs.get(0).put("padding",true);

@ -280,14 +280,17 @@
<select id="listSettlementLog" resultType="com.alibaba.fastjson.JSONObject"> <select id="listSettlementLog" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[ <![CDATA[
SELECT t.client_id,DATE(t.transaction_time) clearing_time,SUM(t.clearing_amount) total, SELECT t.client_id,DATE(t.transaction_time) clearing_time,
sum(if(LOCATE('MERCHANT',t.system_transaction_id),clearing_amount,0)) income, ifnull(cd.report_date,date(t.transaction_time)) report_date,
sum(if(LOCATE('SURCHARGE',t.system_transaction_id),clearing_amount,0)) fee, SUM(t.clearing_amount) total,
sum(if(LOCATE('MERCHANT',t.system_transaction_id),t.clearing_amount,0)) income,
sum(if(LOCATE('SURCHARGE',t.system_transaction_id),t.clearing_amount,0)) fee,
(SELECT min(r.rate_value) FROM sys_client_rates r WHERE r.client_id = t.client_id (SELECT min(r.rate_value) FROM sys_client_rates r WHERE r.client_id = t.client_id
AND date(r.expiry_time) >= DATE(t.clearing_time) AND date(r.expiry_time) >= DATE(t.clearing_time)
AND date(r.active_time) <= DATE(t.clearing_time)) rate, AND date(r.active_time) <= DATE(t.clearing_time)) rate,
t.clearing_order clear_detail_id t.clearing_order clear_detail_id
FROM pmt_transactions t FROM pmt_transactions t
left join log_clearing_detail cd on cd.clear_detail_id=t.clearing_order
WHERE t.channel='Settlement' WHERE t.channel='Settlement'
]]> ]]>
<if test="client_ids!=null"> <if test="client_ids!=null">

@ -10,7 +10,7 @@ require.config({
uiBootstrap: 'static/lib/angular-plugins/ui-bootstrap-tpls-1.2.4.min', uiBootstrap: 'static/lib/angular-plugins/ui-bootstrap-tpls-1.2.4.min',
uiRouter: 'static/lib/angular-plugins/angular-ui-router.min', uiRouter: 'static/lib/angular-plugins/angular-ui-router.min',
angularChecklist: 'static/lib/angular-plugins/checklist-model', angularChecklist: 'static/lib/angular-plugins/checklist-model',
angular: 'static/lib/angularjs/angular', angular: 'static/lib/angularjs/angular.min',
angularAnimate: 'static/lib/angularjs/angular-animate.min', angularAnimate: 'static/lib/angularjs/angular-animate.min',
angularMessages: 'static/lib/angularjs/angular-messages.min', angularMessages: 'static/lib/angularjs/angular-messages.min',
angularSanitize: 'static/lib/angularjs/angular-sanitize.min', angularSanitize: 'static/lib/angularjs/angular-sanitize.min',

@ -0,0 +1,43 @@
package au.com.royalpay.payment.manage.task;
import au.com.royalpay.payment.manage.management.clearing.core.CleanService;
import au.com.royalpay.payment.manage.support.abafile.ABAFile;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringRunner;
import org.thymeleaf.context.Context;
import org.thymeleaf.spring4.SpringTemplateEngine;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
/**
* Create by yixian at 2018-08-21 9:55
*/
@SpringBootTest
@ActiveProfiles({ "proxy", "alipay", "wechat", "jd", "bestpay" })
@RunWith(SpringRunner.class)
public class SettleMailTest {
@Resource
private CleanService cleanService;
@Resource
private SpringTemplateEngine thymeleaf;
@Test
public void parse() throws IOException {
Date date = DateUtils.truncate(new Date(), Calendar.DATE);
List<ABAFile> abaFileList = cleanService.getAba(date, "CBA");
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);
}
}
Loading…
Cancel
Save