|
|
@@ -51,6 +51,8 @@ public class PayServiceImpl implements PayService {
|
|
|
routeScaleDtos = noUsePaymentConfig(amount);
|
|
|
}
|
|
|
|
|
|
+ //根据费用类型
|
|
|
+
|
|
|
//根据金额获取分润
|
|
|
if (routeScaleDtos == null) {
|
|
|
routeScaleDtos = getAmountChannel(organId, amount, receiver);
|
|
|
@@ -364,4 +366,38 @@ public class PayServiceImpl implements PayService {
|
|
|
return unionPay;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param organId
|
|
|
+ * @param orderNo
|
|
|
+ * @param amount
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private List<RouteScaleDto> getTypeRouteChannel(Integer organId, String orderNo, BigDecimal amount) {
|
|
|
+ SysPaymentConfig paymentConfig = sysPaymentConfigService.findPaymentConfigByOrganId(organId);
|
|
|
+ if (paymentConfig == null || StringUtils.isBlank(paymentConfig.getTypeRouteScale())) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ String typeRouteScale = paymentConfig.getTypeRouteScale();
|
|
|
+ List<RouteScaleDto> routeScaleDtos = JSON.parseArray(typeRouteScale, RouteScaleDto.class);
|
|
|
+ List<Integer> organIds = routeScaleDtos.stream().map(RouteScaleDto::getOrganId).collect(Collectors.toList());
|
|
|
+ List<SysPaymentConfig> paymentConfigByOrganIds = sysPaymentConfigService.findPaymentConfigByOrganIds(organIds);
|
|
|
+
|
|
|
+ for (RouteScaleDto routeScaleDto : routeScaleDtos) {
|
|
|
+ routeScaleDto.setPayType(paymentConfig.getPayType());
|
|
|
+ routeScaleDto.setAmount(amount);
|
|
|
+ for (SysPaymentConfig paymentConfigByOrganId : paymentConfigByOrganIds) {
|
|
|
+ if (!paymentConfigByOrganId.getOrganId().equals(routeScaleDto.getOrganId())) continue;
|
|
|
+ if (paymentConfig.getPayType().equals(PaymentChannelEnum.YQPAY)) {
|
|
|
+ routeScaleDto.setMerNo(paymentConfigByOrganId.getYqMerNo());
|
|
|
+ } else {
|
|
|
+ routeScaleDto.setMerNo(paymentConfigByOrganId.getHfMerNo());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return routeScaleDtos;
|
|
|
+ }
|
|
|
+
|
|
|
}
|