|
@@ -249,7 +249,7 @@ public class PayServiceImpl implements PayService {
|
|
|
List<RouteScaleDto> routeScaleDtos = null;
|
|
|
//使用配置开关
|
|
|
if (usePaymentConfig.equals("0")) {
|
|
|
- routeScaleDtos = noUsePaymentConfig(organId, amount);
|
|
|
+ routeScaleDtos = noUsePaymentConfig(amount);
|
|
|
}
|
|
|
|
|
|
//根据金额获取分润
|
|
@@ -268,12 +268,12 @@ public class PayServiceImpl implements PayService {
|
|
|
return getPayRoute(amount, balanceAmount, orderNo, notifyUrl, returnUrl, orderSubject, orderBody, routeScaleDtos);
|
|
|
}
|
|
|
|
|
|
- private List<RouteScaleDto> noUsePaymentConfig(Integer organId, BigDecimal amount) {
|
|
|
+ private List<RouteScaleDto> noUsePaymentConfig(BigDecimal amount) {
|
|
|
String paymentChannel = sysConfigDao.findConfigValue("payment_channel");
|
|
|
List<RouteScaleDto> routeScaleDtos = new ArrayList<>();
|
|
|
RouteScaleDto routeScaleDto = new RouteScaleDto();
|
|
|
routeScaleDto.setAmount(amount);
|
|
|
- routeScaleDto.setOrganId(organId);
|
|
|
+ routeScaleDto.setOrganId(ConfigInit.organId);
|
|
|
routeScaleDto.setScale(100);
|
|
|
if (paymentChannel.equals("YQPAY")) {
|
|
|
routeScaleDto.setMerNo(YqPayUtil.merNo);
|
|
@@ -289,22 +289,20 @@ public class PayServiceImpl implements PayService {
|
|
|
|
|
|
private List<RouteScaleDto> getPaymentConfigChannel(Integer organId, BigDecimal amount) {
|
|
|
SysPaymentConfig paymentConfig = sysPaymentConfigService.findPaymentConfigByOrganId(organId);
|
|
|
- if (paymentConfig == null || StringUtils.isBlank(paymentConfig.getRouteScale())) {
|
|
|
- String paymentChannel = sysConfigDao.findConfigValue("payment_channel");
|
|
|
- if (paymentConfig != null) {
|
|
|
- paymentChannel = paymentConfig.getPayType().getCode();
|
|
|
- }
|
|
|
+ if (paymentConfig == null) {
|
|
|
+ return noUsePaymentConfig(amount);
|
|
|
+ }
|
|
|
+ if (StringUtils.isBlank(paymentConfig.getRouteScale())) {
|
|
|
List<RouteScaleDto> routeScaleDtos = new ArrayList<>();
|
|
|
RouteScaleDto routeScaleDto = new RouteScaleDto();
|
|
|
routeScaleDto.setAmount(amount);
|
|
|
routeScaleDto.setOrganId(organId);
|
|
|
routeScaleDto.setScale(100);
|
|
|
- if (paymentChannel.equals("YQPAY")) {
|
|
|
- routeScaleDto.setMerNo(YqPayUtil.merNo);
|
|
|
- routeScaleDto.setPayType(PaymentChannelEnum.YQPAY);
|
|
|
+ routeScaleDto.setPayType(paymentConfig.getPayType());
|
|
|
+ if (paymentConfig.getPayType().equals(PaymentChannelEnum.YQPAY)) {
|
|
|
+ routeScaleDto.setMerNo(paymentConfig.getYqMerNo());
|
|
|
} else {
|
|
|
- routeScaleDto.setMerNo(ConfigInit.merNo);
|
|
|
- routeScaleDto.setPayType(PaymentChannelEnum.ADAPAY);
|
|
|
+ routeScaleDto.setMerNo(paymentConfig.getHfMerNo());
|
|
|
}
|
|
|
routeScaleDto.setFeeFlag("Y");
|
|
|
routeScaleDtos.add(routeScaleDto);
|