[fix]excel添加设备名

master
lujian 6 years ago
parent 8ce96a7a83
commit 03302dbdc5

@ -11,10 +11,7 @@ import au.com.royalpay.payment.manage.mappers.log.LogSettleMailMapper;
import au.com.royalpay.payment.manage.mappers.log.ValidationLogMapper;
import au.com.royalpay.payment.manage.mappers.payment.TaskManualSettleMapper;
import au.com.royalpay.payment.manage.mappers.payment.TransactionMapper;
import au.com.royalpay.payment.manage.mappers.system.CalendarMapper;
import au.com.royalpay.payment.manage.mappers.system.ClientRateMapper;
import au.com.royalpay.payment.manage.mappers.system.ManagerMapper;
import au.com.royalpay.payment.manage.mappers.system.RateMapper;
import au.com.royalpay.payment.manage.mappers.system.*;
import au.com.royalpay.payment.manage.merchants.core.ClientConfigService;
import au.com.royalpay.payment.manage.merchants.core.ClientManager;
import au.com.royalpay.payment.manage.notice.core.MailService;
@ -157,6 +154,9 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
@Resource
private SysConfigManager sysConfigManager;
@Resource
private ClientDeviceMapper clientDeviceMapper;
@Value("${app.settlement.email-to}")
private String settlementEmailTo;
@Value("${app.settlement.email-cc}")
@ -828,13 +828,15 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
int rowNum = 0;
Row row = sheet.createRow(rowNum);
String[] title = {"order Id", "Client Order Id", "Transaction Time", "Channel", "Gateway", "Exchange Rate", "Transaction Type", "Currency",
"Input Amount", "Total Amount", "Clearing Amount", "Sruchange Rate", "Settle Amount", "Remark"};
"Input Amount", "Total Amount", "Clearing Amount", "Sruchange Rate", "Settle Amount", "Remark", "Dev No"};
String[] analysis = {"Total Credit", "Total Debit", "Gross Amount", "Total Charge", "Net Amount"};
for (int i = 0; i < title.length; i++) {
row.createCell(i, Cell.CELL_TYPE_STRING).setCellValue(title[i]);
}
JSONObject channels = clearTransation.getJSONObject("channels");
JSONObject device;
String clientDevId = "";
for (Object o : clearTransation.getJSONArray("report")) {
JSONObject settle = (JSONObject) o;
if (settle.getBigDecimal("clearing_amount").compareTo(BigDecimal.ZERO) == 0) {
@ -865,6 +867,10 @@ public class CleanServiceImpl implements CleanService, ManagerTodoNoticeProvider
row.createCell(12, Cell.CELL_TYPE_STRING).setCellValue(settle.getBigDecimal("settle_amount") == null ? ""
: settle.getBigDecimal("settle_amount").setScale(2, BigDecimal.ROUND_DOWN).toPlainString());
row.createCell(13, Cell.CELL_TYPE_STRING).setCellValue(settle.getString("order_detail"));
device = clientDeviceMapper.find(settle.getString("dev_id"));
if (device != null)
clientDevId = device.getString("client_dev_id");
row.createCell(14, Cell.CELL_TYPE_STRING).setCellValue(clientDevId);
}
row = sheet.createRow(++rowNum);
for (int i = 0; i < analysis.length; i++) {

@ -20,6 +20,7 @@ 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.merchants.core.ClientManager;
@ -139,6 +140,9 @@ public class TradeLogServiceImpl implements TradeLogService {
@Resource
private OrgManager orgManager;
@Resource
private ClientDeviceMapper clientDeviceMapper;
// @Value("classpath:/jasper/trans_flow.jasper")
// @Value("classpath:/jasper/trans_flow_new.jasper")
@Value("classpath:/jasper/partner_invoice_gst.jasper")
@ -671,6 +675,7 @@ public class TradeLogServiceImpl implements TradeLogService {
try {
List<JSONObject> dataList = (List<JSONObject>) transFlow.get("data");
String transType;
JSONObject device;
int status;
for (JSONObject data : dataList) {
transType = data.getString("trans_type");
@ -683,6 +688,9 @@ public class TradeLogServiceImpl implements TradeLogService {
transType = "Fully " + transType;
}
data.put("trans_type", transType);
device = clientDeviceMapper.find(data.getString("order_dev_id"));
if (device != null)
data.put("dev_id", device.getString("client_dev_id"));
}
JSONObject parmerters = new JSONObject();
parmerters.put("dateFrom", StringUtils.isNotBlank(query.getDatefrom()) ? query.getDatefrom() : "");

@ -52,6 +52,7 @@
<select id="listTransFlow" resultType="com.alibaba.fastjson.JSONObject">
SELECT t.*,
o.status,
o.dev_id order_dev_id,
ifnull(o.client_order_id,'--') client_order_id,
if(t.channel='Settlement','clearing',
if(t.transaction_type='Credit','payment','refund')) trans_type,
@ -845,7 +846,8 @@ select sum(if(temp.transaction_type='Credit',temp.clearing_amount*d.proportion,
o.gateway,
r.out_refund_id,
r.client_refund_id,
o.order_detail
o.order_detail,
o.dev_id
FROM pmt_transactions t
LEFT JOIN pmt_orders o ON o.order_id = t.order_id
LEFT JOIN pmt_refunds r ON r.refund_id = t.refund_id

Loading…
Cancel
Save