【R】商户端&运营端订单source处理

master
liuxinxin 5 years ago
parent 29873c5006
commit 1054f018b0

@ -5,6 +5,7 @@ import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
import au.com.royalpay.payment.core.tasksupport.SettlementSupport;
import au.com.royalpay.payment.manage.management.clearing.core.CleanService;
import au.com.royalpay.payment.manage.mappers.log.*;
import au.com.royalpay.payment.manage.mappers.payment.SysClientIncrementalMapper;
import au.com.royalpay.payment.manage.mappers.payment.TaskManualSettleMapper;
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
import au.com.royalpay.payment.manage.mappers.system.*;
@ -133,6 +134,8 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
@Resource
private ClearingDistributedSurchargeMapper clearingDistributedSurchargeMapper;
@Resource
private SysClientIncrementalMapper sysClientIncrementalMapper;
@Resource
private Locker locker;
@Resource
@ -727,6 +730,10 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
}
List<JSONObject> transactions = transactionMapper.listTransactionsOfClearingOrder(clearClient.getIntValue("clear_detail_id"),
new PageBounds(Order.formString("order_id.asc")));
for (JSONObject transaction : transactions) {
transaction.put("rate_value",StringUtils.defaultString(sysClientIncrementalMapper.findByChannelAndClientId(transaction.getString("client_id"),transaction.getString("source")) ,"0"));
}
String timezone_client = client.getString("timezone");
if (timezone_client != null) {
transactions.parallelStream().forEach(p -> {

@ -803,6 +803,7 @@ public class TradeLogServiceImpl implements TradeLogService {
row.createCell(18, Cell.CELL_TYPE_STRING).setCellValue(data.getString("gateway"));
row.createCell(19, Cell.CELL_TYPE_STRING).setCellValue(data.getString("order_detail"));
row.createCell(20, Cell.CELL_TYPE_STRING).setCellValue(data.getString("dev_id"));
row.createCell(21, Cell.CELL_TYPE_STRING).setCellValue(StringUtils.defaultString(data.getString("incremental_surcharge"),"0.0000"));
}
@Override
@ -1452,7 +1453,7 @@ public class TradeLogServiceImpl implements TradeLogService {
String[] title = {"Transaction Time", "Client Order ID", "System Order ID", "Client Moniker", "Short Name",
"Order ID", "Channel", "Input Amount", "Transaction Amount", "Transaction Currency", "Clearing Amount",
"Settle Amount", "Surcharge", "GST", "Settle Date", "Exchange Rate",
"Transaction Type", "Clearing Status", "Gateway", "Remark", "Dev No"};
"Transaction Type", "Clearing Status", "Gateway", "Remark", "Dev No","Incremental Surcharge"};
for (int j = 0; j < title.length; j++) {
row.createCell(j, Cell.CELL_TYPE_STRING).setCellValue(title[j]);
}

@ -587,6 +587,10 @@
display_amount,
ifnull(sum(if(l.transaction_type='Credit' and l.refund_id is null and l.currency!='CNY',l.incremental_surcharge,0)),0)
incremental_surcharge,
ifnull(sum(if(l.transaction_type='Debit' and l.refund_id is not null and l.currency!='CNY',l.incremental_surcharge,0)),0)
refund_incremental_surcharge,
ifnull(sum(if(l.currency!='CNY',l.incremental_surcharge,0)),0)
all_incremental_surcharge,
ifnull(sum(if(l.transaction_type='Credit' and l.refund_id is null and l.currency!='CNY' and
l.pre_authorization=1,l.display_amount,0)),0) pre_display_amount,
ifnull(sum(if(l.transaction_type='Credit' and l.refund_id is null and l.currency='CNY',l.display_amount,0)),0)

@ -949,13 +949,15 @@
<select id="listTransactionsOfClearingOrder" resultType="com.alibaba.fastjson.JSONObject">
<![CDATA[
SELECT t.*,
IFNULL(t.incremental_surcharge, 0.00),
o.display_amount,
o.client_order_id,
o.gateway,
r.out_refund_id,
r.client_refund_id,
o.order_detail,
o.dev_id
o.dev_id,
o.source
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

@ -337,6 +337,7 @@
<span class="info-box-number box-number_font"
ng-bind="analysis.incremental_surcharge|currency:'AUD '">
</span>
<span style="color: red" ng-if="analysis.refund_incremental_surcharge">({{analysis.all_incremental_surcharge}} - {{analysis.refund_incremental_surcharge}} = {{analysis.incremental_surcharge}}) </span>
</div>
</div>
</div>
@ -426,4 +427,4 @@
</div>
</div>
</div>
</div>
</div>

@ -295,6 +295,7 @@
<span class="info-box-number box-number_font"
ng-bind="analysis.incremental_surcharge|currency:'AUD '">
</span>
<span style="color: red" ng-if="analysis.refund_incremental_surcharge">({{analysis.all_incremental_surcharge}} - {{analysis.refund_incremental_surcharge}} = {{analysis.incremental_surcharge}}) </span>
</div>
</div>
</div>

@ -205,8 +205,12 @@
<th>Currency</th>
<th>Input Amount</th>
<th>Total Amount</th>
<th>Surcharge Rate</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>
@ -215,14 +219,20 @@
<tbody>
<tr ng-repeat="tr in report.report|propsFilter:{transaction_type:'Credit',channel:ctrl.channel,transaction_time:ctrl.day}:true">
<td>
<img src="/static/images/royalpay_sign_s.png" uib-tooltip="RoyalPay" ng-if="tr.source=='system'"/>
<img src="/static/images/yangmatou_sign.png" uib-tooltip="YangMaTou" ng-if="tr.source=='yangmatou'"/>
<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.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>

Loading…
Cancel
Save