|
|
|
@ -10,16 +10,13 @@ import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
|
|
|
|
|
import au.com.royalpay.payment.core.exceptions.OrderNotMatchException;
|
|
|
|
|
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.log.ClearingLogMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.log.LogSettleMailMapper;
|
|
|
|
|
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.*;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.payment.*;
|
|
|
|
|
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;
|
|
|
|
|
import au.com.royalpay.payment.manage.organizations.core.OrgManager;
|
|
|
|
|
import au.com.royalpay.payment.manage.tradelog.beans.PreRefundQueryBean;
|
|
|
|
@ -33,13 +30,11 @@ 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;
|
|
|
|
@ -47,34 +42,25 @@ 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.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 net.sf.jasperreports.export.*;
|
|
|
|
|
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.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.usermodel.*;
|
|
|
|
|
import org.apache.poi.hssf.util.HSSFColor;
|
|
|
|
|
import org.apache.poi.ss.usermodel.*;
|
|
|
|
|
import org.apache.poi.xssf.usermodel.XSSFSheet;
|
|
|
|
|
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
|
|
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;
|
|
|
|
@ -87,13 +73,11 @@ import java.util.ArrayList;
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -118,8 +102,6 @@ public class TradeLogServiceImpl implements TradeLogService {
|
|
|
|
|
@Resource
|
|
|
|
|
private ClearingDetailMapper clearingDetailMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
private ClearingDetailAnalysisMapper clearingDetailAnalysisMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
private MpPaymentApi mpPaymentApi;
|
|
|
|
|
@Resource
|
|
|
|
|
private TransactionMapper transactionMapper;
|
|
|
|
@ -134,10 +116,9 @@ public class TradeLogServiceImpl implements TradeLogService {
|
|
|
|
|
@Resource
|
|
|
|
|
private ClientCustomersMapper clientCustomersMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
LogSettleMailMapper logSettleMailMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
private ClearingLogMapper clearingLogMapper;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private StringRedisTemplate stringRedisTemplate;
|
|
|
|
|
@Resource
|
|
|
|
|
private OrgManager orgManager;
|
|
|
|
|
|
|
|
|
@ -1181,7 +1162,6 @@ public class TradeLogServiceImpl implements TradeLogService {
|
|
|
|
|
int count = 0;
|
|
|
|
|
for (JSONObject object : logs) {
|
|
|
|
|
if (object.getIntValue("clearing_status") == 2 && object.getIntValue("client_id") == client.getIntValue("client_id")) {
|
|
|
|
|
System.out.println(object.getString("order_id"));
|
|
|
|
|
JSONObject updation = new JSONObject();
|
|
|
|
|
updation.put("transaction_id", object.getString("transaction_id"));
|
|
|
|
|
updation.put("clearing_status", 0);
|
|
|
|
@ -1199,8 +1179,15 @@ public class TradeLogServiceImpl implements TradeLogService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public PageList<JSONObject> listPreRefundClients(PreRefundQueryBean params) {
|
|
|
|
|
return transactionMapper.listPreRefundClients(new PageBounds(params.getPage(), params.getLimit()));
|
|
|
|
|
public JSONObject listPreRefundClients(PreRefundQueryBean params) {
|
|
|
|
|
String preRefundDataStr = stringRedisTemplate.boundValueOps("payment:pre_refund_data").get();
|
|
|
|
|
if (StringUtils.isEmpty(preRefundDataStr)) {
|
|
|
|
|
JSONObject preRefundData = PageListUtils.buildPageListResult(transactionMapper.listPreRefundClients(new PageBounds(params.getPage(), params.getLimit())));
|
|
|
|
|
stringRedisTemplate.boundValueOps("payment:pre_refund_data").set(preRefundData.toJSONString(), 6, TimeUnit.HOURS);
|
|
|
|
|
return preRefundData;
|
|
|
|
|
} else {
|
|
|
|
|
return JSONObject.parseObject(preRefundDataStr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|