add ap清算文件 报表增加商户编码和简称

master
luoyang 5 years ago
parent 529be0e353
commit 08328d4370

@ -9,7 +9,7 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>manage</artifactId>
<version>1.4.24</version>
<version>1.4.25</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jib-maven-plugin.version>1.8.0</jib-maven-plugin.version>

@ -1170,7 +1170,7 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
Sheet sheet = wb.createSheet("Merchant_Settlement_Info_" + reportDate);
int rowNum = 0;
Row row = sheet.createRow(rowNum);
String[] title = {"order Id", "Client Order Id", "Transaction Time", "Channel", "Gateway", "Exchange Rate", "Transaction Type", "Currency",
String[] title = {"Client Moniker","Short Name","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"};
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++) {
@ -1184,53 +1184,55 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
continue;
}
row = sheet.createRow(++rowNum);
row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("order_id"));
row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("client_order_id"));
row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("client_moniker"));
row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("short_name"));
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");
row.createCell(2, 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(4, Cell.CELL_TYPE_STRING).setCellValue(DateFormatUtils.format(calendar, "yyyy-MM-dd HH:mm:ss", calendar.getTimeZone()));
row.createCell(5, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("channel"));
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 {
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());
cell = row.createCell(6, Cell.CELL_TYPE_STRING);
row.createCell(7, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("exchange_rate").setScale(5, BigDecimal.ROUND_DOWN).toPlainString());
cell = row.createCell(8, Cell.CELL_TYPE_STRING);
cell.setCellValue(settle.getString("transaction_type"));
cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null);
row.createCell(7, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("transaction_currency"));
cell = row.createCell(8, Cell.CELL_TYPE_STRING);
row.createCell(9, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("transaction_currency"));
cell = row.createCell(10, Cell.CELL_TYPE_STRING);
cell.setCellValue(settle.getBigDecimal("display_amount") == null ? ""
: "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());
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 ? ""
: "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());
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 ? ""
: "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());
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() + "%");
//手续费 + 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());
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());
cell = row.createCell(14, Cell.CELL_TYPE_STRING);
cell = row.createCell(16, Cell.CELL_TYPE_STRING);
cell.setCellValue(settle.getBigDecimal("settle_amount") == null ? ""
: "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());
cell.setCellStyle(!"Credit".equals(settle.getString("transaction_type")) ? analysisStyle2 : null);
row.createCell(15, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("order_detail"));
row.createCell(17, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("order_detail"));
String clientDevId = StringUtils.defaultString(settle.getString("dev_id"), "-");
JSONObject device = clientDeviceMapper.find(settle.getString("dev_id"));
String clientDevRemark = "-";
@ -1238,8 +1240,8 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
clientDevId = device.getString("client_dev_id");
clientDevRemark = device.getString("remark");
}
row.createCell(16, Cell.CELL_TYPE_STRING).setCellValue(clientDevId);
row.createCell(17, Cell.CELL_TYPE_STRING).setCellValue(clientDevRemark);
row.createCell(18, Cell.CELL_TYPE_STRING).setCellValue(clientDevId);
row.createCell(19, Cell.CELL_TYPE_STRING).setCellValue(clientDevRemark);
}
row = sheet.createRow(++rowNum);
for (int i = 0; i < analysis.length; i++) {

@ -1168,7 +1168,9 @@
r.client_refund_id,
o.order_detail,
o.dev_id,
o.source
o.source,
c.client_moniker,
c.short_name
FROM pmt_transactions t
LEFT JOIN pmt_orders o ON o.order_id = t.order_id
LEFT JOIN pmt_refunds r ON r.refund_id = t.refund_id

@ -21,7 +21,7 @@ define(['../app','decimal'], function (app,Decimal) {
}
function openDetailOfMergeSettle(url,client_id) {
$uibModal.open({
templateUrl: '/static/payment/tradelog/templates/partner_settlement_dialog.html',
templateUrl: '/static/payment/tradelog/templates/partner_settlement_merge_settle_dialog.html',
controller: 'clearingDetailOfMergeSettleCtrl',
resolve: {
detail: ['$http', function ($http) {

@ -0,0 +1,239 @@
<div class="modal-header">
<h4>Transactions{{report.client_moniker?'('+report.client_moniker+')':''}}</h4>
</div>
<div class="modal-body">
<div class="box box-warning">
<div class="box-body">
<ul class="nav nav-pills">
<li ng-class="{active:ctrl.channel==null}">
<a role="button" ng-click="ctrl.channel=null;channelAndDayOfAnalysis()" title="All">
<img src="/static/images/royalpay_sign.png">
</a>
</li>
<li ng-class="{active:ctrl.channel=='Wechat'}" ng-if="report.channels.Wechat">
<a role="button" ng-click="ctrl.channel='Wechat';channelAndDayOfAnalysis()" title="Wechat">
<img src="/static/images/wechatpay_sign_lg.png">
</a>
</li>
<li ng-class="{active:ctrl.channel=='Alipay'}" ng-if="report.channels.Alipay">
<a role="button" ng-click="ctrl.channel='Alipay';channelAndDayOfAnalysis()" title="Alipay">
<img src="/static/images/alipay_sign_lg.png">
</a>
</li>
<li ng-class="{active:ctrl.channel=='AlipayOnline'}" ng-if="report.channels.AlipayOnline">
<a role="button" ng-click="ctrl.channel='AlipayOnline';channelAndDayOfAnalysis()" title="AlipayOnline">
<img src="/static/images/alipay_online.png" class="channel-icon-lg">
</a>
</li>
<li ng-class="{active:ctrl.channel=='Bestpay'}" ng-if="report.channels.Bestpay">
<a role="button" ng-click="ctrl.channel='Bestpay';channelAndDayOfAnalysis()" title="Bestpay">
<img src="/static/images/bestpay_sign_lg.png">
</a>
</li>
<li ng-class="{active:ctrl.channel=='jd'}" ng-if="report.channels.jd">
<a role="button" ng-click="ctrl.channel='jd';channelAndDayOfAnalysis()" title="JD Pay">
<img src="/static/images/jd_sign_lg.png">
</a>
</li>
<li ng-class="{active:ctrl.channel=='hf'}" ng-if="report.channels.hf">
<a role="button" ng-click="ctrl.channel='hf';channelAndDayOfAnalysis()" title="HF Pay">
<img src="/static/images/hf_sign_lg.png">
</a>
</li>
<li ng-class="{active:ctrl.channel=='Rpay'}" ng-if="report.channels.Rpay">
<a role="button" ng-click="ctrl.channel='Rpay';channelAndDayOfAnalysis()" title="Rpay Pay">
<img src="/static/images/rpayplus_sign_lg.png">
</a>
</li>
<li ng-class="{active:ctrl.channel=='Yeepay'}" ng-if="report.channels.Yeepay">
<a role="button" ng-click="ctrl.channel='Yeepay';channelAndDayOfAnalysis()" title="Yeepay">
<img src="/static/images/yeepay_sign_lg.png">
</a>
</li>
<li ng-class="{active:ctrl.channel=='LakalaPay'}" ng-if="report.channels.LakalaPay">
<a role="button" ng-click="ctrl.channel='LakalaPay';channelAndDayOfAnalysis()" title="LakalaPay">
<img src="/static/images/lakalapay_sign_lg.png">
</a>
</li>
</ul>
</div>
</div>
<div class="box box-warning">
<uib-tabset active="index">
<uib-tab index="0" heading="Analysis" ng-click="ctrl.day=null">
<div class="box-body">
<div class="row">
<!--<div class="col-xs-6 col-sm-3">-->
<!--<span class="col-xs-6 text-bold">Rate</span>-->
<!--<span class="col-xs-6" ng-bind="report.rate+'%'"></span>-->
<!--</div>-->
<div class="col-xs-6 col-sm-3">
<span class="col-xs-6 text-bold">Total Credit</span>
<span ng-if="ctrl.channel==null" class="col-xs-6" ng-bind="report.total_payment|currency:''"></span>
<span ng-if="ctrl.channel!=null"class="col-xs-6" ng-bind="report.channels[ctrl.channel].total_credit|currency:''"></span>
</div>
<div class="col-xs-6 col-sm-3">
<span class="col-xs-6 text-bold">Total Debit</span>
<span ng-if="ctrl.channel==null" class="col-xs-6" ng-bind="report.total_refund|currency:''"></span>
<span ng-if="ctrl.channel!=null" class="col-xs-6" ng-bind="report.channels[ctrl.channel].total_debit|currency:''"></span>
</div>
<div class="col-xs-6 col-sm-3">
<span class="col-xs-6 text-bold">Gross Amount</span>
<span ng-if="ctrl.channel==null" class="col-xs-6" ng-bind="report.gross_amount|currency:''"></span>
<span ng-if="ctrl.channel!=null" class="col-xs-6" ng-bind="report.channels[ctrl.channel].gross_amount|currency:''"></span>
</div>
</div>
<div class="row">
<div class="col-xs-6 col-sm-3">
<span class="col-xs-6 text-bold">Tax Amount</span>
<span ng-if="ctrl.channel==null" class="col-xs-6" ng-bind="report.tax_amount|currency:''"></span>
<span ng-if="ctrl.channel!=null" class="col-xs-6" ng-bind="report.channels[ctrl.channel].tax_amount|currency:''"></span>
</div>
<div class="col-xs-6 col-sm-3">
<span class="col-xs-6 text-bold">Total Charge</span>
<span ng-if="ctrl.channel==null" class="col-xs-6" ng-bind="report.total_charge|currency:''"></span>
<span ng-if="ctrl.channel!=null" class="col-xs-6" ng-bind="report.channels[ctrl.channel].total_charge|currency:''"></span>
</div>
<div class="col-xs-6 col-sm-3" ng-if="!is_partner">
<span class="col-xs-6 text-bold">Channel Charge</span>
<span ng-if="ctrl.channel==null" class="col-xs-6" ng-bind="report.wechat_charge|currency:''"></span>
<span ng-if="ctrl.channel!=null" class="col-xs-6" ng-bind="report.channels[ctrl.channel].third_charge|currency:''"></span>
</div>
<div class="col-xs-6 col-sm-3" ng-if="!is_partner">
<span class="col-xs-6 text-bold">RoyalPay Charge</span>
<span ng-if="ctrl.channel==null" class="col-xs-6" ng-bind="report.royalpay_charge|currency:''"></span>
<span ng-if="ctrl.channel!=null" class="col-xs-6"
ng-bind="report.channels[ctrl.channel].royalpay_charge|currency:''"></span>
</div>
<div class="col-xs-6 col-sm-3">
<span class="col-xs-6 text-bold">Net Amount</span>
<span ng-if="ctrl.channel==null" class="col-xs-6"
ng-bind="report.clearing_amount|currency:''"></span>
<span ng-if="ctrl.channel!=null" class="col-xs-6"
ng-bind="(report.channels[ctrl.channel].gross_amount - report.channels[ctrl.channel].total_charge-report.channels[ctrl.channel].tax_amount)|currency:''"></span>
</div>
</div>
</div>
</uib-tab>
<uib-tab ng-repeat="(key,analysis) in channelAndDayMap" heading="{{key}}" ng-click="ctrl.day=key">
<div class="box-body" >
<div class="row">
<div class="col-xs-6 col-sm-3">
<span class="col-xs-6 text-bold">Total Credit</span>
<span class="col-xs-6" ng-bind="analysis.total_credit|currency:''"></span>
</div>
<div class="col-xs-6 col-sm-3">
<span class="col-xs-6 text-bold">Total Debit</span>
<span class="col-xs-6" ng-bind="analysis.total_debit|currency:''"></span>
</div>
<div class="col-xs-6 col-sm-3">
<span class="col-xs-6 text-bold">Gross Amount</span>
<span class="col-xs-6" ng-bind="analysis.gross_amount|currency:''"></span>
</div>
</div>
<div class="row">
<div class="col-xs-6 col-sm-3">
<span class="col-xs-6 text-bold">Tax Amount</span>
<span class="col-xs-6" ng-bind="analysis.tax_amount|currency:''"></span>
</div>
<div class="col-xs-6 col-sm-3">
<span class="col-xs-6 text-bold">Total Charge</span>
<span class="col-xs-6" ng-bind="analysis.total_surcharge|currency:''"></span>
</div>
<div class="col-xs-6 col-sm-3">
<span class="col-xs-6 text-bold">Net Amount</span>
<span class="col-xs-6" ng-bind="analysis.net_amount|currency:''"></span>
</div>
</div>
</div>
</uib-tab>
</uib-tabset>
</div>
<div class="box box-default">
<div class="box-header">Credits</div>
<div class="box-body">
<div class="table-responsive col-sm-12">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>Client Moniker</th>
<th>Short Name</th>
<th>Order Id</th>
<th>Transaction Time</th>
<th>Currency</th>
<th>Input Amount</th>
<th>Total Amount</th>
<!--<th>Surcharge Rate</th>-->
<th>Surcharge Amount</th>
<th>System Rate</th>
<th>System Profit</th>
<th>Incremental Rate</th>
<th>Incremental Profit</th>
<th>Tax Amount</th>
<th ng-if="report.report[0].settle_amount!=null">Settle Amount</th>
<th>Remark</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="tr in report.report|propsFilter:{transaction_type:'Credit',channel:ctrl.channel,transaction_time:ctrl.day}:true">
<td ng-bind="tr.client_moniker"></td>
<td ng-bind="tr.short_name"></td>
<td>
<img src="/static/images/royalpay_sign_s.png" uib-tooltip="RoyalPay" ng-if="tr.source=='system'"/>
<img src="/static/images/yangmaimai_sign.png" uib-tooltip="RP跨境商城" ng-if="tr.source=='RP跨境商城'"/>
<img class="channel-icon" ng-src="{{tr.channel|channel_image}}">{{tr.order_id}}
</td>
<td ng-bind="tr.transaction_time"></td>
<td ng-bind="tr.transaction_currency"></td>
<td ng-bind="tr.display_amount"></td>
<td ng-bind="tr.transaction_amount"></td>
<!--<td ng-bind="tr.surcharge_rate?(tr.surcharge_rate|percentage:1):report.channels[tr.channel].rate+'%'"></td>-->
<td ng-bind="tr.total_surcharge?tr.total_surcharge:0"></td>
<td>{{(tr.surcharge_rate * 100 - tr.rate_value)| number : 2}}<span ng-if="tr.surcharge_rate">%</span></td>
<td>{{(tr.total_surcharge-tr.incremental_surcharge) | number : 2 | currency:tr.currency}}</td>
<td><span ng-if="tr.rate_value">{{tr.source}}:{{(tr.rate_value) | number : 2}}%</span></td>
<td>{{tr.source}}:<span ng-if="tr.incremental_surcharge">{{tr.incremental_surcharge | currency:tr.currency}}</span><span ng-if="!tr.incremental_surcharge">{{0.00 | currency:tr.currency}}</span></td>
<td ng-bind="tr.tax_amount"></td>
<td ng-if="tr.settle_amount!=null" ng-bind="tr.settle_amount|currency:''"></td>
<td ng-bind="tr.remark"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="box box-default">
<div class="box-header">Debits</div>
<div class="box-body">
<div class="table-responsive col-sm-12">
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>Client Moniker</th>
<th>Short Name</th>
<th>Order Id</th>
<th>Transaction Time</th>
<th>Currency</th>
<th>Total Amount</th>
<th>Settle Amount</th>
<th>Remark</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="tr in report.report|propsFilter:{transaction_type:'Debit',channel:ctrl.channel,transaction_time:ctrl.day}:true">
<td ng-bind="tr.client_moniker"></td>
<td ng-bind="tr.short_name"></td>
<td ng-bind="tr.order_id"></td>
<td ng-bind="tr.transaction_time"></td>
<td ng-bind="tr.transaction_currency"></td>
<td ng-bind="tr.transaction_amount"></td>
<td ng-bind="tr.settle_amount"></td>
<td ng-bind="tr.remark"></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
Loading…
Cancel
Save