parent
91a89dcc51
commit
6acf488ce6
@ -0,0 +1,9 @@
|
|||||||
|
package au.com.royalpay.payment.manage.dev.core;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
|
||||||
|
public interface HfClearAmountService {
|
||||||
|
|
||||||
|
JSONObject hfjsonobject(String dateto,String datefrom);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,52 @@
|
|||||||
|
package au.com.royalpay.payment.manage.dev.core.impl;
|
||||||
|
|
||||||
|
import au.com.royalpay.payment.manage.dev.core.HfClearAmountService;
|
||||||
|
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class HfClearAmountServiceImpl implements HfClearAmountService{
|
||||||
|
private final DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:MM:ss");
|
||||||
|
@Resource
|
||||||
|
private TransactionMapper transactionMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public JSONObject hfjsonobject(String dateto,String datefrom) {
|
||||||
|
JSONObject hfAmountInfo = new JSONObject();
|
||||||
|
JSONObject parms = new JSONObject();
|
||||||
|
parms.put("dateto", dateto + " 02:00:00");
|
||||||
|
parms.put("datefrom", datefrom + " 02:00:00");
|
||||||
|
List<JSONObject> hflist = transactionMapper.getHfClearAmount(parms);
|
||||||
|
Double payallAmount = 0.0;
|
||||||
|
Double refundAllAmount = 0.0;
|
||||||
|
Double paySurAmount = 0.0;
|
||||||
|
Double refundSurAllAmount = 0.0;
|
||||||
|
if (hflist.isEmpty()) {
|
||||||
|
hfAmountInfo.put("PayAmount", 0);
|
||||||
|
hfAmountInfo.put("RefundAmount", 0);
|
||||||
|
}
|
||||||
|
for(JSONObject hfAmount : hflist){
|
||||||
|
if ("Credit".equals(hfAmount.getString("transaction_type"))) {
|
||||||
|
hfAmountInfo.put("PayAmount",hfAmount.getBigDecimal("clearingamount").setScale(4, BigDecimal.ROUND_HALF_UP).doubleValue());
|
||||||
|
payallAmount = hfAmount.getDouble("clearingamount");
|
||||||
|
paySurAmount = hfAmount.getDouble("suramount");
|
||||||
|
}
|
||||||
|
if ("Debit".equals(hfAmount.getString("transaction_type"))) {
|
||||||
|
hfAmountInfo.put("RefundAmount",hfAmount.getBigDecimal("clearingamount").setScale(4, BigDecimal.ROUND_HALF_UP).doubleValue());
|
||||||
|
refundAllAmount = hfAmount.getDouble("clearingamount");
|
||||||
|
refundSurAllAmount = hfAmount.getDouble("suramount");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
hfAmountInfo.put("realAmount", new BigDecimal(payallAmount - refundAllAmount).setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue());
|
||||||
|
hfAmountInfo.put("surAmount", new BigDecimal(paySurAmount - refundSurAllAmount).setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue());
|
||||||
|
hfAmountInfo.put("hfAmount", new BigDecimal(((payallAmount - refundAllAmount) - (paySurAmount - refundSurAllAmount))).setScale(4,BigDecimal.ROUND_HALF_UP).doubleValue());
|
||||||
|
return hfAmountInfo;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
<section class="content-header">
|
||||||
|
<h1>HF清算金额统计</h1>
|
||||||
|
<ol class="breadcrumb">
|
||||||
|
<li>
|
||||||
|
<i class="fa fa-cog"></i> Basic Config
|
||||||
|
</li>
|
||||||
|
<li><a ui-sref="^">Dev Tools</a></li>
|
||||||
|
<li class="active">hfClearAmount</li>
|
||||||
|
</ol>
|
||||||
|
</section>
|
||||||
|
<section class="content">
|
||||||
|
<div class="box">
|
||||||
|
<div class="box-body">
|
||||||
|
<div style="display: inline-block">
|
||||||
|
<input class="form-control" id="date-from-input"
|
||||||
|
ng-model="params.datefrom"
|
||||||
|
uib-datepicker-popup size="10" placeholder="From"
|
||||||
|
is-open="dateBegin.open" ng-click="dateBegin.open=true"
|
||||||
|
datepicker-options="{maxDate:params.dateto||today}">
|
||||||
|
</div>
|
||||||
|
~
|
||||||
|
<div style="display: inline-block">
|
||||||
|
<input class="form-control" id="date-to-input"
|
||||||
|
ng-model="params.dateto"
|
||||||
|
uib-datepicker-popup size="10" placeholder="To"
|
||||||
|
is-open="dateTo.open" ng-click="dateTo.open=true"
|
||||||
|
datepicker-options="{minDate:params.datefrom,maxDate:today}">
|
||||||
|
</div>   
|
||||||
|
<button class="btn btn-primary" ng-click="select()">Select</button> <label ng-hide="selecttotal" style="padding-left: 30px">请稍后</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="padding-left: 3%;padding-top: 2%" ng-hide="totalhide">
|
||||||
|
<label>付款金额:</label>
|
||||||
|
<label><u>{{PayAmount}}</u></label> <br>
|
||||||
|
<label> 退款金额:</label>
|
||||||
|
<label><u>{{RefundAmount}}</u></label><br>
|
||||||
|
<label>实际交易金额:</label>
|
||||||
|
<label><u>{{realAmount}}</u></label><br>
|
||||||
|
<label>手续费:</label>
|
||||||
|
<label><u>{{surAmount}}</u></label><br>
|
||||||
|
<label>应转款金额:</label>
|
||||||
|
<label><u>{{hfAmount}}</u></label>
|
||||||
|
</div>
|
||||||
|
</section>
|
Loading…
Reference in new issue