|
|
@ -12,10 +12,14 @@ import au.com.royalpay.payment.core.exceptions.ParamInvalidException;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.client.ClientCustomersMapper;
|
|
|
|
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.ClearingDetailAnalysisMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.log.ClearingDetailMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.log.ClearingDetailMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.payment.*;
|
|
|
|
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.ClientAccountMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ClientAccountMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.CustomerMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.CustomerMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.CustomerRelationAlipayMapper;
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.ManagerCustomerRelationAlipayMapper;
|
|
|
|
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
|
|
|
|
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
|
|
|
|
import au.com.royalpay.payment.manage.organizations.core.OrgManager;
|
|
|
|
import au.com.royalpay.payment.manage.organizations.core.OrgManager;
|
|
|
|
import au.com.royalpay.payment.manage.tradelog.beans.PreRefundQueryBean;
|
|
|
|
import au.com.royalpay.payment.manage.tradelog.beans.PreRefundQueryBean;
|
|
|
@ -28,11 +32,13 @@ import au.com.royalpay.payment.tools.permission.enums.PartnerRole;
|
|
|
|
import au.com.royalpay.payment.tools.utils.CurrencyAmountUtils;
|
|
|
|
import au.com.royalpay.payment.tools.utils.CurrencyAmountUtils;
|
|
|
|
import au.com.royalpay.payment.tools.utils.PageListUtils;
|
|
|
|
import au.com.royalpay.payment.tools.utils.PageListUtils;
|
|
|
|
import au.com.royalpay.payment.tools.utils.TimeZoneUtils;
|
|
|
|
import au.com.royalpay.payment.tools.utils.TimeZoneUtils;
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.github.miemiedev.mybatis.paginator.domain.Order;
|
|
|
|
import com.github.miemiedev.mybatis.paginator.domain.Order;
|
|
|
|
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
|
|
|
|
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
|
|
|
|
import com.github.miemiedev.mybatis.paginator.domain.PageList;
|
|
|
|
import com.github.miemiedev.mybatis.paginator.domain.PageList;
|
|
|
|
import com.github.miemiedev.mybatis.paginator.domain.Paginator;
|
|
|
|
import com.github.miemiedev.mybatis.paginator.domain.Paginator;
|
|
|
|
|
|
|
|
|
|
|
|
import net.sf.jasperreports.engine.JRDataSource;
|
|
|
|
import net.sf.jasperreports.engine.JRDataSource;
|
|
|
|
import net.sf.jasperreports.engine.JasperFillManager;
|
|
|
|
import net.sf.jasperreports.engine.JasperFillManager;
|
|
|
|
import net.sf.jasperreports.engine.JasperPrint;
|
|
|
|
import net.sf.jasperreports.engine.JasperPrint;
|
|
|
@ -40,13 +46,24 @@ import net.sf.jasperreports.engine.JasperRunManager;
|
|
|
|
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
|
|
|
|
import net.sf.jasperreports.engine.data.JRBeanCollectionDataSource;
|
|
|
|
import net.sf.jasperreports.engine.export.JRXlsExporter;
|
|
|
|
import net.sf.jasperreports.engine.export.JRXlsExporter;
|
|
|
|
import net.sf.jasperreports.engine.export.ooxml.JRXlsxExporter;
|
|
|
|
import net.sf.jasperreports.engine.export.ooxml.JRXlsxExporter;
|
|
|
|
import net.sf.jasperreports.export.*;
|
|
|
|
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 org.apache.commons.io.IOUtils;
|
|
|
|
import org.apache.commons.io.IOUtils;
|
|
|
|
import org.apache.commons.lang3.StringEscapeUtils;
|
|
|
|
import org.apache.commons.lang3.StringEscapeUtils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
|
|
|
import org.apache.commons.lang3.time.DateFormatUtils;
|
|
|
|
import org.apache.commons.lang3.time.DateUtils;
|
|
|
|
import org.apache.commons.lang3.time.DateUtils;
|
|
|
|
import org.apache.poi.hssf.usermodel.*;
|
|
|
|
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.util.HSSFColor;
|
|
|
|
import org.apache.poi.hssf.util.HSSFColor;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
@ -54,8 +71,6 @@ import org.springframework.beans.factory.annotation.Value;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.ui.Model;
|
|
|
|
import org.springframework.ui.Model;
|
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
|
|
|
import java.io.ByteArrayOutputStream;
|
|
|
|
import java.io.ByteArrayOutputStream;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.OutputStream;
|
|
|
|
import java.io.OutputStream;
|
|
|
@ -72,6 +87,9 @@ import java.util.stream.Collectors;
|
|
|
|
import java.util.zip.ZipEntry;
|
|
|
|
import java.util.zip.ZipEntry;
|
|
|
|
import java.util.zip.ZipOutputStream;
|
|
|
|
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;
|
|
|
|
import static au.com.royalpay.payment.manage.permission.utils.OrgCheckUtils.checkOrgPermission;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -108,7 +126,7 @@ public class TradeLogServiceImpl implements TradeLogService {
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private CustomerMapper customerMapper;
|
|
|
|
private CustomerMapper customerMapper;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private CustomerRelationAlipayMapper customerRelationAlipayMapper;
|
|
|
|
private ManagerCustomerRelationAlipayMapper managerCustomerRelationAlipayMapper;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private ClientCustomersMapper clientCustomersMapper;
|
|
|
|
private ClientCustomersMapper clientCustomersMapper;
|
|
|
|
|
|
|
|
|
|
|
@ -298,7 +316,7 @@ public class TradeLogServiceImpl implements TradeLogService {
|
|
|
|
order.put("nickname", customer.getString("nickname"));
|
|
|
|
order.put("nickname", customer.getString("nickname"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject customerAlipay = customerRelationAlipayMapper.findCustomerByUserId(order.getString("customer_id"));
|
|
|
|
JSONObject customerAlipay = managerCustomerRelationAlipayMapper.findCustomerByUserId(order.getString("customer_id"));
|
|
|
|
if (customerAlipay != null) {
|
|
|
|
if (customerAlipay != null) {
|
|
|
|
order.put("headimg", customerAlipay.getString("headimg"));
|
|
|
|
order.put("headimg", customerAlipay.getString("headimg"));
|
|
|
|
order.put("nickname", customerAlipay.getString("nickname"));
|
|
|
|
order.put("nickname", customerAlipay.getString("nickname"));
|
|
|
@ -371,7 +389,7 @@ public class TradeLogServiceImpl implements TradeLogService {
|
|
|
|
order.put("nickname", customer.getString("nickname"));
|
|
|
|
order.put("nickname", customer.getString("nickname"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
JSONObject customerAlipay = customerRelationAlipayMapper.findCustomerByUserId(order.getString("customer_id"));
|
|
|
|
JSONObject customerAlipay = managerCustomerRelationAlipayMapper.findCustomerByUserId(order.getString("customer_id"));
|
|
|
|
if (customerAlipay != null) {
|
|
|
|
if (customerAlipay != null) {
|
|
|
|
order.put("headimg", customerAlipay.getString("headimg"));
|
|
|
|
order.put("headimg", customerAlipay.getString("headimg"));
|
|
|
|
order.put("nickname", customerAlipay.getString("nickname"));
|
|
|
|
order.put("nickname", customerAlipay.getString("nickname"));
|
|
|
@ -448,6 +466,13 @@ public class TradeLogServiceImpl implements TradeLogService {
|
|
|
|
clientManager.validateClients(client_id, params);
|
|
|
|
clientManager.validateClients(client_id, params);
|
|
|
|
params.put("client_id", client_id);
|
|
|
|
params.put("client_id", client_id);
|
|
|
|
List<JSONObject> logs = transactionMapper.listTransFlow(params);
|
|
|
|
List<JSONObject> logs = transactionMapper.listTransFlow(params);
|
|
|
|
|
|
|
|
logs.stream().forEach(p->{
|
|
|
|
|
|
|
|
String login_id = p.getString("login_id");
|
|
|
|
|
|
|
|
if(StringUtils.isNotEmpty(login_id)) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
p.put("order_detail", StringUtils.isEmpty(p.getString("order_detail"))?"":p.getString("order_detail") +"(alipay_id:"+login_id+")");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
TimeZoneUtils.switchTimeZoneToString(logs, timezone, "dd/MM/yyyy HH:mm:ss", Arrays.asList("transaction_time"));
|
|
|
|
TimeZoneUtils.switchTimeZoneToString(logs, timezone, "dd/MM/yyyy HH:mm:ss", Arrays.asList("transaction_time"));
|
|
|
|
|
|
|
|
|
|
|
|
final JSONObject analysis = analysisTransLogs(logs);
|
|
|
|
final JSONObject analysis = analysisTransLogs(logs);
|
|
|
@ -515,7 +540,7 @@ public class TradeLogServiceImpl implements TradeLogService {
|
|
|
|
.reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
|
|
|
|
.reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
|
|
|
|
analysis.put("total_surcharge", logs.parallelStream()
|
|
|
|
analysis.put("total_surcharge", logs.parallelStream()
|
|
|
|
.filter(log -> log.getBigDecimal("settle_amount") != null)
|
|
|
|
.filter(log -> log.getBigDecimal("settle_amount") != null)
|
|
|
|
.map(log -> getSymbol(log).multiply(log.getBigDecimal("total_surcharge")))
|
|
|
|
.map(log -> getSymbol(log).multiply(log.getBigDecimal("total_surcharge").add(log.getBigDecimal("tax_amount"))))
|
|
|
|
.reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
|
|
|
|
.reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
|
|
|
|
analysis.put("wechat_fee", logs.parallelStream()
|
|
|
|
analysis.put("wechat_fee", logs.parallelStream()
|
|
|
|
.filter(log -> log.getBigDecimal("settle_amount") != null)
|
|
|
|
.filter(log -> log.getBigDecimal("settle_amount") != null)
|
|
|
|