tradelog page

master
yixian 7 years ago
parent 7982c078cd
commit 7cd41b90ee

@ -32,6 +32,7 @@ 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;
@ -67,6 +68,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
@ -422,11 +424,16 @@ public class TradeLogServiceImpl implements TradeLogService {
clientManager.validateClients(client_id, params);
params.put("client_id", client_id);
PageList<JSONObject> logs = transactionMapper.listTransFlowPage(params,
new PageBounds(query.getPage(), query.getLimit(), Order.formString("transaction_time.desc")));
List<JSONObject> logs = transactionMapper.listTransFlow(params);
TimeZoneUtils.switchTimeZone(logs, timezone, "create_time", "confirm_time", "transaction_time");
JSONObject result = PageListUtils.buildPageListResult(logs);
JSONObject analysis = analysisTransLogs(logs);
Paginator paginator = new Paginator(query.getPage(), query.getLimit(), logs.size());
List<JSONObject> pagedLogsList = logs.stream()
.sorted((log1, log2) -> log2.getDate("transaction_time").compareTo(log1.getDate("transaction_time")))
.skip(paginator.getOffset()).limit(paginator.getLimit())
.collect(Collectors.toList());
PageList<JSONObject> pagedLogs = new PageList<>(pagedLogsList, paginator);
JSONObject result = PageListUtils.buildPageListResult(pagedLogs);
JSONObject analysis = transactionMapper.analysisTransFlow(params);
if (analysis.containsKey("paid_fee") && analysis.containsKey("refund_fee")) {
analysis.put("actual_fee", analysis.getBigDecimal("paid_fee").add(analysis.getBigDecimal("refund_fee")));
}

Loading…
Cancel
Save