|
|
|
@ -19,10 +19,7 @@ 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.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.mappers.system.*;
|
|
|
|
|
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;
|
|
|
|
@ -1208,18 +1205,16 @@ public class TradeLogServiceImpl implements TradeLogService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void exportSettlementLog(TradeLogQuery query, JSONObject partner, HttpServletResponse resp) {
|
|
|
|
|
int client_id = partner.getIntValue("client_id");
|
|
|
|
|
String begin = query.getDatefrom() == null ?"":query.getDatefrom();
|
|
|
|
|
String end = query.getDateto() == null ?"":query.getDateto();
|
|
|
|
|
String timezone = partner.getJSONObject("client").getString("timezone");
|
|
|
|
|
JSONObject params = query.toParams(timezone);
|
|
|
|
|
params.put("client_id", client_id);
|
|
|
|
|
List<JSONObject> clientOrderList = transactionMapper.getClientOrderByTransactionTime(params);
|
|
|
|
|
List<Integer> clientOrders = new ArrayList<>(clientOrderList.size());
|
|
|
|
|
clientOrderList.parallelStream().forEach(p->{
|
|
|
|
|
clientOrders.add(p.getInteger("clearing_order"));
|
|
|
|
|
});
|
|
|
|
|
List<JSONObject> settlementLogDetailList = transactionMapper.getSettlementLogDetailList(clientOrders, client_id);
|
|
|
|
|
List<JSONObject> settlementLogDetailList = transactionMapper.getSettlementLogDetailList(clientOrders);
|
|
|
|
|
OutputStream ous = null;
|
|
|
|
|
try {
|
|
|
|
|
JSONObject clearDetailTotal = transactionMapper.getClearDetailTotal(params);
|
|
|
|
@ -1288,7 +1283,7 @@ public class TradeLogServiceImpl implements TradeLogService {
|
|
|
|
|
row.createCell(0, Cell.CELL_TYPE_STRING).setCellValue(clearDetailTotal.getString("total_payment"));
|
|
|
|
|
row.createCell(1, Cell.CELL_TYPE_STRING).setCellValue(clearDetailTotal.getString("total_refund"));
|
|
|
|
|
row.createCell(2, Cell.CELL_TYPE_STRING).setCellValue(clearDetailTotal.getString("gross_amount"));
|
|
|
|
|
row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(clearDetailTotal.getString("total_charge"));
|
|
|
|
|
row.createCell(3, Cell.CELL_TYPE_STRING).setCellValue(clearDetailTotal.getBigDecimal("total_charge").add(clearDetailTotal.getBigDecimal("tax_amount")).toPlainString());
|
|
|
|
|
row.createCell(4, Cell.CELL_TYPE_STRING).setCellValue(clearDetailTotal.getString("clearing_amount"));
|
|
|
|
|
|
|
|
|
|
wb.write(ous);
|
|
|
|
@ -1302,19 +1297,17 @@ public class TradeLogServiceImpl implements TradeLogService {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void exportPDFSettlement(TradeLogQuery query, JSONObject partner, HttpServletResponse response) {
|
|
|
|
|
int client_id = partner.getIntValue("client_id");
|
|
|
|
|
String begin = query.getDatefrom() == null ?"":query.getDatefrom();
|
|
|
|
|
String end = query.getDateto() == null ?"":query.getDateto();
|
|
|
|
|
JSONObject client = partner.getJSONObject("client");
|
|
|
|
|
String timezone = client.getString("timezone");
|
|
|
|
|
JSONObject params = query.toParams(timezone);
|
|
|
|
|
params.put("client_id", client_id);
|
|
|
|
|
List<JSONObject> clientOrderList = transactionMapper.getClientOrderByTransactionTime(params);
|
|
|
|
|
List<Integer> clientOrders = new ArrayList<>(clientOrderList.size());
|
|
|
|
|
clientOrderList.parallelStream().forEach(p->{
|
|
|
|
|
clientOrders.add(p.getInteger("clearing_order"));
|
|
|
|
|
});
|
|
|
|
|
List<JSONObject> settlementLogDetailList = transactionMapper.getSettlementLogDetailList(clientOrders, client_id);
|
|
|
|
|
List<JSONObject> settlementLogDetailList = transactionMapper.getSettlementLogDetailList(clientOrders);
|
|
|
|
|
TimeZoneUtils.switchTimeZoneToString(settlementLogDetailList, timezone, "yyyy-MM-dd HH:mm:ss", Arrays.asList("transaction_time"));
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|