|
|
|
@ -1,18 +1,12 @@
|
|
|
|
|
package au.com.royalpay.payment.manage.dev.web;
|
|
|
|
|
|
|
|
|
|
import au.com.royalpay.payment.channels.alipay.config.AlipayConfig;
|
|
|
|
|
import au.com.royalpay.payment.channels.alipay.config.AlipayEnvironment;
|
|
|
|
|
import au.com.royalpay.payment.channels.alipay.runtime.AlipayOnlineApi;
|
|
|
|
|
import au.com.royalpay.payment.channels.alipay.runtime.AlipayRetailApi;
|
|
|
|
|
import au.com.royalpay.payment.channels.wechat.runtime.beans.SubMerchantInfoInheritance;
|
|
|
|
|
import au.com.royalpay.payment.channels.wechat.runtime.impls.WxPayMerchantRegister;
|
|
|
|
|
import au.com.royalpay.payment.channels.wechat.runtime.mappers.PaymentChannelMccGoodMapper;
|
|
|
|
|
import au.com.royalpay.payment.core.PaymentApi;
|
|
|
|
|
import au.com.royalpay.payment.core.PaymentDevHelper;
|
|
|
|
|
import au.com.royalpay.payment.core.beans.EmptyMerchantApplication;
|
|
|
|
|
import au.com.royalpay.payment.core.exceptions.InvalidShortIdException;
|
|
|
|
|
import au.com.royalpay.payment.core.impls.MerchantChannelApplicationManager;
|
|
|
|
|
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.DashboardService;
|
|
|
|
|
import au.com.royalpay.payment.manage.analysis.core.PlatformClearService;
|
|
|
|
@ -23,6 +17,8 @@ import au.com.royalpay.payment.manage.dev.bean.SendWechatMessage;
|
|
|
|
|
import au.com.royalpay.payment.manage.dev.core.AliforexcelService;
|
|
|
|
|
import au.com.royalpay.payment.manage.dev.core.AlipayRegisterService;
|
|
|
|
|
import au.com.royalpay.payment.manage.dev.core.WechatMessageService;
|
|
|
|
|
import au.com.royalpay.payment.manage.management.clearing.beans.CustomizedSettleRequest;
|
|
|
|
|
import au.com.royalpay.payment.manage.management.clearing.core.SettleTasksService;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.payment.OrderMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.payment.RefundMapper;
|
|
|
|
|
import au.com.royalpay.payment.manage.mappers.system.*;
|
|
|
|
@ -69,12 +65,13 @@ import javax.validation.Valid;
|
|
|
|
|
import java.io.ByteArrayOutputStream;
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.math.RoundingMode;
|
|
|
|
|
import java.security.InvalidParameterException;
|
|
|
|
|
import java.text.ParseException;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.Calendar;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Optional;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Created by yixian on 2016-07-06.
|
|
|
|
@ -106,6 +103,8 @@ public class TestController {
|
|
|
|
|
@Resource
|
|
|
|
|
private PaymentApi paymentApi;
|
|
|
|
|
@Resource
|
|
|
|
|
private SettleTasksService settleTasksService;
|
|
|
|
|
@Resource
|
|
|
|
|
private TradeLogService tradeLogService;
|
|
|
|
|
@Resource
|
|
|
|
|
private RetailAppService retailAppService;
|
|
|
|
@ -127,8 +126,6 @@ public class TestController {
|
|
|
|
|
@Resource
|
|
|
|
|
private PaymentDevHelper paymentDevHelper;
|
|
|
|
|
@Resource
|
|
|
|
|
private PmtCustomReportMapper pmtCustomReportsMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
private SysWxMerchantApplyMapper sysWxMerchantApplyMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
private PaymentChannelMccGoodMapper paymentChannelMccGoodMapper;
|
|
|
|
@ -259,13 +256,13 @@ public class TestController {
|
|
|
|
|
}
|
|
|
|
|
JSONObject alipayApsCashierRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), PayChannel.ALIPAY_APS_CASHIER.getChannelCode());
|
|
|
|
|
if (alipayApsCashierRate != null) {
|
|
|
|
|
client.put("aps_cashier_rate", alipayApsCashierRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)+"%");
|
|
|
|
|
client.put("aps_cashier_service_rate", alipayApsCashierRate.getBigDecimal("transaction_fee").multiply(BigDecimal.valueOf(100)).setScale(2, RoundingMode.DOWN)+"%");
|
|
|
|
|
client.put("aps_cashier_rate", alipayApsCashierRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN) + "%");
|
|
|
|
|
client.put("aps_cashier_service_rate", alipayApsCashierRate.getBigDecimal("transaction_fee").multiply(CommonConsts.HUNDRED).setScale(2, RoundingMode.DOWN) + "%");
|
|
|
|
|
}
|
|
|
|
|
JSONObject alipayApsInstoreRate = merchantInfoProvider.clientCurrentRate(client.getIntValue("client_id"), new Date(), PayChannel.ALIPAY_APS_IN_STORE.getChannelCode());
|
|
|
|
|
if (alipayApsInstoreRate != null) {
|
|
|
|
|
client.put("aps_instore_rate", alipayApsInstoreRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN)+"%");
|
|
|
|
|
client.put("aps_instore_service_rate",alipayApsInstoreRate.getBigDecimal("transaction_fee").multiply(BigDecimal.valueOf(100)).setScale(2, RoundingMode.DOWN)+"%");
|
|
|
|
|
client.put("aps_instore_rate", alipayApsInstoreRate.getBigDecimal("rate_value").setScale(2, RoundingMode.DOWN) + "%");
|
|
|
|
|
client.put("aps_instore_service_rate", alipayApsInstoreRate.getBigDecimal("transaction_fee").multiply(CommonConsts.HUNDRED).setScale(2, RoundingMode.DOWN) + "%");
|
|
|
|
|
client.put("alipayplus_clean", alipayApsInstoreRate.getString("clean_days"));
|
|
|
|
|
}
|
|
|
|
|
} catch (Exception ignored) {
|
|
|
|
@ -436,6 +433,11 @@ public class TestController {
|
|
|
|
|
aliforexcelService.registerRangeAlipayOnlineMerchant(start, end);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ManagerMapping(value = "/customized_settle", method = RequestMethod.POST, role = ManagerRole.DEVELOPER)
|
|
|
|
|
public JSONObject sendCustomizedSettle(@ModelAttribute(CommonConsts.MANAGER_STATUS) JSONObject manager, @RequestBody CustomizedSettleRequest req) {
|
|
|
|
|
return settleTasksService.submitCustomizedSettle(req, manager);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@GetMapping(value = "/register/alipayGms")
|
|
|
|
|
public void registerAlipayMerchant() {
|
|
|
|
|
aliforexcelService.registerAlipayMerchant();
|
|
|
|
@ -824,14 +826,14 @@ public class TestController {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int st=0;
|
|
|
|
|
int st = 0;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 批量更新支付宝子商户号报备
|
|
|
|
|
*/
|
|
|
|
|
@GetMapping(value = "/batch_update_alipayapply")
|
|
|
|
|
public void batchUpdateAlipayApply() {
|
|
|
|
|
if(st>0){
|
|
|
|
|
if (st > 0) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
st++;
|
|
|
|
|