|
|
@ -1,12 +1,8 @@
|
|
|
|
package au.com.royalpay.payment.manage.dev.web;
|
|
|
|
package au.com.royalpay.payment.manage.dev.web;
|
|
|
|
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.channels.alipay.config.AlipayEnvironment;
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.channels.alipay.runtime.AlipayClient;
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.channels.rpay.runtime.RpayClient;
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.channels.wechat.runtime.WxPayClient;
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.core.PaymentApi;
|
|
|
|
import au.com.royalpay.payment.core.PaymentApi;
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.core.PaymentDevHelper;
|
|
|
|
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
|
|
|
|
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
|
|
|
|
import au.com.royalpay.payment.core.exceptions.OrderNotExistsException;
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.core.mappers.PmtCustomReportMapper;
|
|
|
|
import au.com.royalpay.payment.core.mappers.PmtCustomReportMapper;
|
|
|
|
import au.com.royalpay.payment.manage.analysis.core.ATOReportService;
|
|
|
|
import au.com.royalpay.payment.manage.analysis.core.ATOReportService;
|
|
|
|
import au.com.royalpay.payment.manage.analysis.core.DashboardService;
|
|
|
|
import au.com.royalpay.payment.manage.analysis.core.DashboardService;
|
|
|
@ -31,31 +27,23 @@ import au.com.royalpay.payment.manage.tradelog.core.TradeLogService;
|
|
|
|
import au.com.royalpay.payment.tools.CommonConsts;
|
|
|
|
import au.com.royalpay.payment.tools.CommonConsts;
|
|
|
|
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi;
|
|
|
|
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApi;
|
|
|
|
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider;
|
|
|
|
import au.com.royalpay.payment.tools.connections.mpsupport.MpWechatApiProvider;
|
|
|
|
import au.com.royalpay.payment.tools.defines.TradeType;
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.tools.env.PlatformEnvironment;
|
|
|
|
import au.com.royalpay.payment.tools.env.PlatformEnvironment;
|
|
|
|
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
|
|
|
|
import au.com.royalpay.payment.tools.exceptions.BadRequestException;
|
|
|
|
import au.com.royalpay.payment.tools.exceptions.NotFoundException;
|
|
|
|
import au.com.royalpay.payment.tools.exceptions.NotFoundException;
|
|
|
|
import au.com.royalpay.payment.tools.http.HttpUtils;
|
|
|
|
import au.com.royalpay.payment.tools.http.HttpUtils;
|
|
|
|
import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
|
|
|
|
import au.com.royalpay.payment.tools.merchants.core.MerchantInfoProvider;
|
|
|
|
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
|
|
|
|
import au.com.royalpay.payment.tools.permission.enums.ManagerRole;
|
|
|
|
import au.com.royalpay.payment.tools.scheduler.SynchronizedScheduler;
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.tools.utils.PdfUtils;
|
|
|
|
import au.com.royalpay.payment.tools.utils.PdfUtils;
|
|
|
|
import au.com.royalpay.payment.tools.utils.TimeZoneUtils;
|
|
|
|
import au.com.royalpay.payment.tools.utils.TimeZoneUtils;
|
|
|
|
import au.com.royalpay.payment.tools.utils.XmlFormatUtils;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
import com.alibaba.fastjson.serializer.SerializerFeature;
|
|
|
|
|
|
|
|
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.dom4j.Element;
|
|
|
|
|
|
|
|
import org.joda.time.DateTime;
|
|
|
|
import org.joda.time.DateTime;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
|
import org.springframework.data.mongodb.core.MongoTemplate;
|
|
|
|
|
|
|
|
import org.springframework.ui.Model;
|
|
|
|
import org.springframework.ui.Model;
|
|
|
|
import org.springframework.util.Assert;
|
|
|
|
|
|
|
|
import org.springframework.validation.Errors;
|
|
|
|
import org.springframework.validation.Errors;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
@ -68,7 +56,6 @@ import java.io.ByteArrayOutputStream;
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.io.IOException;
|
|
|
|
import java.math.RoundingMode;
|
|
|
|
import java.math.RoundingMode;
|
|
|
|
import java.net.URISyntaxException;
|
|
|
|
|
|
|
|
import java.text.ParseException;
|
|
|
|
import java.text.ParseException;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
import java.util.Calendar;
|
|
|
|
import java.util.Calendar;
|
|
|
@ -81,7 +68,7 @@ import java.util.List;
|
|
|
|
@RestController
|
|
|
|
@RestController
|
|
|
|
@RequestMapping("/dev")
|
|
|
|
@RequestMapping("/dev")
|
|
|
|
public class TestController {
|
|
|
|
public class TestController {
|
|
|
|
private Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
|
private final Logger logger = LoggerFactory.getLogger(getClass());
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private OrderMapper orderMapper;
|
|
|
|
private OrderMapper orderMapper;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
@ -103,12 +90,6 @@ public class TestController {
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private PaymentApi paymentApi;
|
|
|
|
private PaymentApi paymentApi;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private WxPayClient wxPayClient;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private AlipayClient alipayClient;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private RpayClient rpayClient;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private TradeLogService tradeLogService;
|
|
|
|
private TradeLogService tradeLogService;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private RetailAppService retailAppService;
|
|
|
|
private RetailAppService retailAppService;
|
|
|
@ -124,16 +105,13 @@ public class TestController {
|
|
|
|
private SysClientLegalPersonMapper sysClientLegalPersonMapper;
|
|
|
|
private SysClientLegalPersonMapper sysClientLegalPersonMapper;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private TradeSecureService tradeSecureService;
|
|
|
|
private TradeSecureService tradeSecureService;
|
|
|
|
private final static String EMAIL = "lily.tao@royalpay.com.au,bella.sun@royalpay.com.au,astro.dai@royalpay.com.au,taylor.dang@royalpay.com.au";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private DashboardService dashboardService;
|
|
|
|
private DashboardService dashboardService;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private SynchronizedScheduler synchronizedScheduler;
|
|
|
|
private PaymentDevHelper paymentDevHelper;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private PmtCustomReportMapper pmtCustomReportsMapper;
|
|
|
|
private PmtCustomReportMapper pmtCustomReportsMapper;
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private MongoTemplate mongoTemplate;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ManagerMapping(value = "/{clientMoniker}/export/agreepdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR})
|
|
|
|
@ManagerMapping(value = "/{clientMoniker}/export/agreepdf", method = RequestMethod.GET, role = {ManagerRole.ADMIN, ManagerRole.DIRECTOR, ManagerRole.OPERATOR})
|
|
|
|
public void exportAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception {
|
|
|
|
public void exportAgreeFile(@PathVariable String clientMoniker, @ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, HttpServletResponse httpResponse) throws Exception {
|
|
|
@ -268,7 +246,7 @@ public class TestController {
|
|
|
|
String orderChannel = StringUtils.defaultIfEmpty(order.getString("order_channel"), order.getString("channel"));
|
|
|
|
String orderChannel = StringUtils.defaultIfEmpty(order.getString("order_channel"), order.getString("channel"));
|
|
|
|
paymentApi.checkOrderStatus(order.getString("order_id"), orderChannel, true);
|
|
|
|
paymentApi.checkOrderStatus(order.getString("order_id"), orderChannel, true);
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
logger.error("fix transaction error:" + order.getString("order_id"));
|
|
|
|
logger.error("fix transaction error:{}", order.getString("order_id"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -280,7 +258,7 @@ public class TestController {
|
|
|
|
String orderChannel = StringUtils.defaultIfEmpty(order.getString("order_channel"), order.getString("channel"));
|
|
|
|
String orderChannel = StringUtils.defaultIfEmpty(order.getString("order_channel"), order.getString("channel"));
|
|
|
|
paymentApi.checkOrderStatus(order.getString("order_id"), orderChannel, true);
|
|
|
|
paymentApi.checkOrderStatus(order.getString("order_id"), orderChannel, true);
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
logger.error("fix transaction error:" + order.getString("order_id"));
|
|
|
|
logger.error("fix transaction error:{}", order.getString("order_id"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
List<JSONObject> refunds = refundMapper.listConfirmedRefundsWithNoTransactions();
|
|
|
|
List<JSONObject> refunds = refundMapper.listConfirmedRefundsWithNoTransactions();
|
|
|
@ -290,71 +268,17 @@ public class TestController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ManagerMapping(value = "/orders/{orderId}/detail", method = RequestMethod.GET, role = ManagerRole.DEVELOPER)
|
|
|
|
@ManagerMapping(value = "/orders/{orderId}/detail", method = RequestMethod.GET, role = ManagerRole.DEVELOPER)
|
|
|
|
public JSONObject checkOrderDetail(@PathVariable String orderId) throws URISyntaxException, IOException {
|
|
|
|
public JSONObject checkOrderDetail(@PathVariable String orderId) {
|
|
|
|
JSONObject order = orderMapper.find(orderId);
|
|
|
|
|
|
|
|
if (order == null) {
|
|
|
|
|
|
|
|
throw new OrderNotExistsException();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
String channel = StringUtils.defaultIfEmpty(order.getString("order_channel"), order.getString("channel"));
|
|
|
|
|
|
|
|
JSONObject res = new JSONObject();
|
|
|
|
JSONObject res = new JSONObject();
|
|
|
|
switch (channel) {
|
|
|
|
res.put("xml", paymentDevHelper.devCheckOrder(orderId));
|
|
|
|
case "Wechat":
|
|
|
|
|
|
|
|
Element elem = wxPayClient.checkOrderStatus(orderId, order.getString("merchant_id"), order.getString("sub_merchant_id"));
|
|
|
|
|
|
|
|
String xmlStr = XmlFormatUtils.formatXml(elem);
|
|
|
|
|
|
|
|
res.put("xml", xmlStr);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "Alipay":
|
|
|
|
|
|
|
|
elem = alipayClient.checkRetailOrderStatusByOrderId(orderId, AlipayEnvironment.getEnv().getAlipayRetailMerchant().getPid());
|
|
|
|
|
|
|
|
xmlStr = XmlFormatUtils.formatXml(elem);
|
|
|
|
|
|
|
|
res.put("xml", xmlStr);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "AlipayOnline":
|
|
|
|
|
|
|
|
elem = alipayClient.checkOnlineOrderStatusByOrderId(orderId, AlipayEnvironment.getEnv().getAlipayOnlineMerchant().getPid());
|
|
|
|
|
|
|
|
xmlStr = XmlFormatUtils.formatXml(elem);
|
|
|
|
|
|
|
|
res.put("xml", xmlStr);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "Rpay":
|
|
|
|
|
|
|
|
JSONObject orderInfo = rpayClient.queryOrderStatus(orderId);
|
|
|
|
|
|
|
|
String rpayjson = JSON.toJSONString(orderInfo, SerializerFeature.PrettyFormat);
|
|
|
|
|
|
|
|
res.put("xml", rpayjson);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
throw new BadRequestException("Not Support channel:" + channel);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return res;
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ManagerMapping(value = "/order_refunds/{refundId}/detail", method = RequestMethod.GET, role = ManagerRole.DEVELOPER)
|
|
|
|
@ManagerMapping(value = "/order_refunds/{refundId}/detail", method = RequestMethod.GET, role = ManagerRole.DEVELOPER)
|
|
|
|
public JSONObject checkRefundDetail(@PathVariable String refundId) {
|
|
|
|
public JSONObject checkRefundDetail(@PathVariable String refundId) {
|
|
|
|
JSONObject refundOrder = refundMapper.findByOutRefundId(refundId);
|
|
|
|
|
|
|
|
if (refundOrder == null) {
|
|
|
|
|
|
|
|
throw new BadRequestException("退款单不存在");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
JSONObject order = orderMapper.find(refundOrder.getString("order_id"));
|
|
|
|
|
|
|
|
Assert.notNull(order, "order not exists");
|
|
|
|
|
|
|
|
String channel = order.getString("order_channel");
|
|
|
|
|
|
|
|
JSONObject res = new JSONObject();
|
|
|
|
JSONObject res = new JSONObject();
|
|
|
|
TradeType type = TradeType.fromGatewayNumber(order.getIntValue("gateway"));
|
|
|
|
res.put("xml", paymentDevHelper.devCheckRefund(refundId));
|
|
|
|
switch (channel) {
|
|
|
|
|
|
|
|
case "Wechat":
|
|
|
|
|
|
|
|
Element elem = wxPayClient.checkRefundStatus(refundId, order.getString("merchant_id"), order.getString("sub_merchant_id"));
|
|
|
|
|
|
|
|
String xml = XmlFormatUtils.formatXml(elem);
|
|
|
|
|
|
|
|
res.put("xml", xml);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "Alipay":
|
|
|
|
|
|
|
|
elem = alipayClient.retailRefund(type, refundOrder.getBigDecimal("refund_exchange_rate"), refundOrder, AlipayEnvironment.getEnv().getAlipayRetailMerchant().getPid());
|
|
|
|
|
|
|
|
String xmlStr = XmlFormatUtils.formatXml(elem);
|
|
|
|
|
|
|
|
res.put("xml", xmlStr);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case "AlipayOnline":
|
|
|
|
|
|
|
|
elem = alipayClient.onlineRefund(refundOrder, AlipayEnvironment.getEnv().getAlipayOnlineMerchant().getPid(), type == TradeType.GATEWAY_H5);
|
|
|
|
|
|
|
|
xmlStr = XmlFormatUtils.formatXml(elem);
|
|
|
|
|
|
|
|
res.put("xml", xmlStr);
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
throw new BadRequestException("Not Support channel:" + channel);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return res;
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -403,17 +327,6 @@ public class TestController {
|
|
|
|
clientManager.updateAllPartnerPassword("PINE");
|
|
|
|
clientManager.updateAllPartnerPassword("PINE");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// @ManagerMapping(value = "/getPineAccoutPasswd", method = RequestMethod.GET, role = ManagerRole.DEVELOPER)
|
|
|
|
|
|
|
|
// public List<JSONObject> getPineAccountPasswd() {
|
|
|
|
|
|
|
|
// Query query = new Query();
|
|
|
|
|
|
|
|
// List<TestMerchantAccountInfo> accountInfos = mongoTemplate.find(query,TestMerchantAccountInfo.class);
|
|
|
|
|
|
|
|
// List<JSONObject> accounts = new ArrayList<>();
|
|
|
|
|
|
|
|
// for (TestMerchantAccountInfo accountInfo : accountInfos) {
|
|
|
|
|
|
|
|
// accounts.add(accountInfo.toJSON());
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// return accounts;
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ManagerMapping(value = "/secure/hanyin_reports/{date}", role = ManagerRole.DEVELOPER, method = RequestMethod.GET)
|
|
|
|
@ManagerMapping(value = "/secure/hanyin_reports/{date}", role = ManagerRole.DEVELOPER, method = RequestMethod.GET)
|
|
|
|
public void downloadHanyinSecureReports(@PathVariable String date, @RequestParam(defaultValue = "false") boolean upload, HttpServletResponse resp) {
|
|
|
|
public void downloadHanyinSecureReports(@PathVariable String date, @RequestParam(defaultValue = "false") boolean upload, HttpServletResponse resp) {
|
|
|
|
tradeSecureService.manualDownloadHanyinSecureReport(DateTime.parse(date).toDate(), upload, resp);
|
|
|
|
tradeSecureService.manualDownloadHanyinSecureReport(DateTime.parse(date).toDate(), upload, resp);
|
|
|
@ -530,20 +443,7 @@ public class TestController {
|
|
|
|
|
|
|
|
|
|
|
|
@ManagerMapping(value = "/custom_declare_check/{reportId}/detail", method = RequestMethod.GET, role = ManagerRole.DEVELOPER)
|
|
|
|
@ManagerMapping(value = "/custom_declare_check/{reportId}/detail", method = RequestMethod.GET, role = ManagerRole.DEVELOPER)
|
|
|
|
public JSONObject checkCustomDeclareOrderDetail(@PathVariable String reportId) {
|
|
|
|
public JSONObject checkCustomDeclareOrderDetail(@PathVariable String reportId) {
|
|
|
|
JSONObject report = pmtCustomReportsMapper.findCustomReport(reportId);
|
|
|
|
String declareResp = paymentDevHelper.devQueryCustomsReport(reportId);
|
|
|
|
if (report == null || report.isEmpty()) {
|
|
|
|
|
|
|
|
throw new NotFoundException("Report Not Exists");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
JSONObject order = orderMapper.find(report.getString("order_id"));
|
|
|
|
|
|
|
|
String declareResp;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (StringUtils.equals("Wechat", report.getString("channel"))) {
|
|
|
|
|
|
|
|
declareResp = XmlFormatUtils.formatXml(wxPayClient.declareCustomQuery(order.getString("merchant_id"), report, null, false));
|
|
|
|
|
|
|
|
} else if (StringUtils.equals("Alipay", report.getString("channel"))) {
|
|
|
|
|
|
|
|
declareResp = XmlFormatUtils.formatXml(alipayClient.queryCustomStatus(order.getString("merchant_id"), report, null, false));
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
throw new BadRequestException("Invalid Channel:" + report.getString("channel"));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
JSONObject res = new JSONObject();
|
|
|
|
JSONObject res = new JSONObject();
|
|
|
|
res.put("xml", declareResp);
|
|
|
|
res.put("xml", declareResp);
|
|
|
|
return res;
|
|
|
|
return res;
|
|
|
@ -585,18 +485,19 @@ public class TestController {
|
|
|
|
public void sendSecurePaySettleFile(@RequestParam String dateStr) {
|
|
|
|
public void sendSecurePaySettleFile(@RequestParam String dateStr) {
|
|
|
|
tradeSecureService.sendSecurePaySettleFile(dateStr);
|
|
|
|
tradeSecureService.sendSecurePaySettleFile(dateStr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/securepay/invoice/file")
|
|
|
|
@GetMapping(value = "/securepay/invoice/file")
|
|
|
|
public void sendSecurePayInvoiceFile() {
|
|
|
|
public void sendSecurePayInvoiceFile() {
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
|
|
|
|
//获取前一个月第一天
|
|
|
|
//获取前一个月第一天
|
|
|
|
Calendar calendar1 = Calendar.getInstance();
|
|
|
|
Calendar calendar1 = Calendar.getInstance();
|
|
|
|
calendar1.add(Calendar.MONTH, -1);
|
|
|
|
calendar1.add(Calendar.MONTH, -1);
|
|
|
|
calendar1.set(Calendar.DAY_OF_MONTH,1);
|
|
|
|
calendar1.set(Calendar.DAY_OF_MONTH, 1);
|
|
|
|
String firstDay = sdf.format(calendar1.getTime());
|
|
|
|
String firstDay = sdf.format(calendar1.getTime());
|
|
|
|
//获取前一个月最后一天
|
|
|
|
//获取前一个月最后一天
|
|
|
|
Calendar calendar2 = Calendar.getInstance();
|
|
|
|
Calendar calendar2 = Calendar.getInstance();
|
|
|
|
calendar2.set(Calendar.DAY_OF_MONTH, 0);
|
|
|
|
calendar2.set(Calendar.DAY_OF_MONTH, 0);
|
|
|
|
String lastDay = sdf.format(calendar2.getTime());
|
|
|
|
String lastDay = sdf.format(calendar2.getTime());
|
|
|
|
tradeSecureService.sendSecurePayInvoiceFile(firstDay,lastDay);
|
|
|
|
tradeSecureService.sendSecurePayInvoiceFile(firstDay, lastDay);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|