From c687dc2ebe4fb38c1e7a41298ad1c5267f67c8fa Mon Sep 17 00:00:00 2001 From: wangning <164851225@qq.com> Date: Tue, 10 Apr 2018 17:56:05 +0800 Subject: [PATCH] update --- .../core/impls/TradeLogServiceImpl.java | 35 ++++++++++++++++--- .../mappers/payment/TransactionMapper.xml | 7 +++- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java index 18b0afe68..3440327ae 100644 --- a/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java +++ b/src/main/java/au/com/royalpay/payment/manage/tradelog/core/impls/TradeLogServiceImpl.java @@ -12,7 +12,11 @@ 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.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.CustomerMapper; import au.com.royalpay.payment.manage.mappers.system.CustomerRelationAlipayMapper; @@ -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.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; @@ -40,13 +46,24 @@ 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.*; +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.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.*; +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.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -54,8 +71,6 @@ import org.springframework.beans.factory.annotation.Value; 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; @@ -72,6 +87,9 @@ 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; @@ -448,6 +466,13 @@ public class TradeLogServiceImpl implements TradeLogService { clientManager.validateClients(client_id, params); params.put("client_id", client_id); List 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")); final JSONObject analysis = analysisTransLogs(logs); diff --git a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml index a2d1d9285..8da9b1616 100644 --- a/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml +++ b/src/main/resources/au/com/royalpay/payment/manage/mappers/payment/TransactionMapper.xml @@ -52,9 +52,14 @@ WHEN 1 THEN 'Cleared' WHEN 2 THEN 'Preauthorised' END) clear_status, - o.order_detail,o.display_amount,o.channel,o.currency,o.pre_authorization + o.order_detail,o.display_amount,o.channel,o.currency,o.pre_authorization, + CASE o.channel + WHEN 'Alipay' THEN ra.login_id + WHEN 'AlipayOnline' THEN ra.login_email + END login_id FROM pmt_transactions t LEFT JOIN pmt_orders o ON o.order_id=t.order_id + left join sys_customer_relation_alipay ra on ra.alipay_uid = o.customer_id AND t.client_id IN