[Y] 商户欠款功能优化

master
taylor.dang 6 years ago
parent 7edefd0a0d
commit 2755cd516e

@ -85,6 +85,6 @@ public class LogRiskController {
@GetMapping(value = "/pre_refund/list")
public JSONObject listPreRefund(PreRefundQueryBean preRefundQueryBean) {
return PageListUtils.buildPageListResult(tradeLogService.listPreRefundClients(preRefundQueryBean));
return tradeLogService.listPreRefundClients(preRefundQueryBean);
}
}

@ -3,7 +3,6 @@ package au.com.royalpay.payment.manage.tradelog.core;
import au.com.royalpay.payment.manage.tradelog.beans.PreRefundQueryBean;
import au.com.royalpay.payment.manage.tradelog.beans.TradeLogQuery;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import org.springframework.ui.Model;
import javax.servlet.http.HttpServletResponse;
@ -49,7 +48,7 @@ public interface TradeLogService {
void fullReleasePreAuthorization(JSONObject account, TradeLogQuery query)throws Exception;
PageList<JSONObject> listPreRefundClients(PreRefundQueryBean params);
JSONObject listPreRefundClients(PreRefundQueryBean params);
void exportSettlementLog(TradeLogQuery query, JSONObject partner, HttpServletResponse response);

@ -10,16 +10,13 @@ import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
import au.com.royalpay.payment.core.exceptions.OrderNotMatchException;
import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
import au.com.royalpay.payment.manage.mappers.client.ClientCustomersMapper;
import au.com.royalpay.payment.manage.mappers.log.ClearingDetailAnalysisMapper;
import au.com.royalpay.payment.manage.mappers.log.ClearingDetailMapper;
import au.com.royalpay.payment.manage.mappers.log.ClearingLogMapper;
import au.com.royalpay.payment.manage.mappers.log.LogSettleMailMapper;
import au.com.royalpay.payment.manage.mappers.payment.AustracDataMapper;
import au.com.royalpay.payment.manage.mappers.payment.OrderMapper;
import au.com.royalpay.payment.manage.mappers.payment.RefundAuditionMapper;
import au.com.royalpay.payment.manage.mappers.payment.RefundMapper;
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
import au.com.royalpay.payment.manage.mappers.system.*;
import au.com.royalpay.payment.manage.mappers.payment.*;
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientDeviceMapper;
import au.com.royalpay.payment.manage.mappers.system.CustomerMapper;
import au.com.royalpay.payment.manage.mappers.system.ManagerCustomerRelationAlipayMapper;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.organizations.core.OrgManager;
import au.com.royalpay.payment.manage.tradelog.beans.PreRefundQueryBean;
@ -33,13 +30,11 @@ import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
import au.com.royalpay.payment.tools.utils.CurrencyAmountUtils;
import au.com.royalpay.payment.tools.utils.PageListUtils;
import au.com.royalpay.payment.tools.utils.TimeZoneUtils;
import com.alibaba.fastjson.JSONObject;
import com.github.miemiedev.mybatis.paginator.domain.Order;
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.github.miemiedev.mybatis.paginator.domain.PageList;
import com.github.miemiedev.mybatis.paginator.domain.Paginator;
import net.sf.jasperreports.engine.JRDataSource;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
@ -47,34 +42,25 @@ import net.sf.jasperreports.engine.JasperRunManager;
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
import net.sf.jasperreports.engine.export.JRXlsExporter;
import net.sf.jasperreports.engine.export.ooxml.JRXlsxExporter;
import net.sf.jasperreports.export.ExporterInput;
import net.sf.jasperreports.export.OutputStreamExporterOutput;
import net.sf.jasperreports.export.SimpleExporterInput;
import net.sf.jasperreports.export.SimpleOutputStreamExporterOutput;
import net.sf.jasperreports.export.SimpleXlsxReportConfiguration;
import net.sf.jasperreports.export.*;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringEscapeUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFFont;
import org.apache.poi.hssf.usermodel.HSSFRichTextString;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.hssf.usermodel.*;
import org.apache.poi.hssf.util.HSSFColor;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.OutputStream;
@ -87,13 +73,11 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import static au.com.royalpay.payment.manage.permission.utils.OrgCheckUtils.checkOrgPermission;
@ -118,8 +102,6 @@ public class TradeLogServiceImpl implements TradeLogService {
@Resource
private ClearingDetailMapper clearingDetailMapper;
@Resource
private ClearingDetailAnalysisMapper clearingDetailAnalysisMapper;
@Resource
private MpPaymentApi mpPaymentApi;
@Resource
private TransactionMapper transactionMapper;
@ -134,10 +116,9 @@ public class TradeLogServiceImpl implements TradeLogService {
@Resource
private ClientCustomersMapper clientCustomersMapper;
@Resource
LogSettleMailMapper logSettleMailMapper;
@Resource
private ClearingLogMapper clearingLogMapper;
@Resource
private StringRedisTemplate stringRedisTemplate;
@Resource
private OrgManager orgManager;
@ -1181,7 +1162,6 @@ public class TradeLogServiceImpl implements TradeLogService {
int count = 0;
for (JSONObject object : logs) {
if (object.getIntValue("clearing_status") == 2 && object.getIntValue("client_id") == client.getIntValue("client_id")) {
System.out.println(object.getString("order_id"));
JSONObject updation = new JSONObject();
updation.put("transaction_id", object.getString("transaction_id"));
updation.put("clearing_status", 0);
@ -1199,8 +1179,15 @@ public class TradeLogServiceImpl implements TradeLogService {
}
@Override
public PageList<JSONObject> listPreRefundClients(PreRefundQueryBean params) {
return transactionMapper.listPreRefundClients(new PageBounds(params.getPage(), params.getLimit()));
public JSONObject listPreRefundClients(PreRefundQueryBean params) {
String preRefundDataStr = stringRedisTemplate.boundValueOps("payment:pre_refund_data").get();
if (StringUtils.isEmpty(preRefundDataStr)) {
JSONObject preRefundData = PageListUtils.buildPageListResult(transactionMapper.listPreRefundClients(new PageBounds(params.getPage(), params.getLimit())));
stringRedisTemplate.boundValueOps("payment:pre_refund_data").set(preRefundData.toJSONString(), 6, TimeUnit.HOURS);
return preRefundData;
} else {
return JSONObject.parseObject(preRefundDataStr);
}
}
@Override

@ -1,10 +1,10 @@
<section class="content-header">
<h1>Pre Refund</h1>
<h1>商户欠款|Pre Refund</h1>
<ol class="breadcrumb">
<li>
<i class="fa fa-list-alt"></i> Transaction
</li>
<li class="active">Pre Refund</li>
<li class="active">商户欠款|Pre Refund</li>
</ol>
</section>
<section class="content">
@ -14,19 +14,17 @@
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th>Partner</th>
<th>Amount</th>
<th>Last Refund Time</th>
<th>商户编码</th>
<th>欠费金额(AUD)</th>
<th>最后交易时间</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="log in log_risk" ng-class="{warning:trade.clearing_status==2}">
<td>
{{log.client_moniker}}
<tr ng-repeat="log in log_risk">
<td ng-bind="log.client_moniker">
</td>
<td>{{log.amount}}</td>
<td>{{log.transation_time}}</td>
<td ng-bind="log.amount"></td>
<td ng-bind="log.transation_time |date:'yyyy-MM-dd HH:mm:ss'"></td>
</tr>
</tbody>
</table>
@ -43,7 +41,9 @@
first-text="&laquo;"
last-text="&raquo;"></uib-pagination>
<div class="row">
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total Pages:{{pagination.totalPages}}</div>
<div class="col-xs-12">Total Records:{{pagination.totalCount}};Total
Pages:{{pagination.totalPages}}
</div>
</div>
</div>
</div>

@ -10,13 +10,6 @@
<section class="content">
<div class="box box-default">
<div class="box-header">
<!-- <div uib-dropdown>
<button class="btn btn-primary" uib-dropdown-toggle type="button" ng-bind="params.year"></button>
<ul class="dropdown-menu" uib-dropdown-menu role="menu">
<li ng-repeat="year in availableYears" role="menuitem"><a role="button" ng-click="initMonth(year)" ng-bind="year"></a></li>
</ul>
</div>-->
<div ng-repeat="year in availableYears" style="display: inline">
<button class="btn btn-info"
ng-click="initMonth(year)"

Loading…
Cancel
Save