|
@@ -28,10 +28,12 @@ import com.ym.mec.biz.dal.entity.StudentPaymentRouteOrder;
|
|
import com.ym.mec.biz.dal.entity.SysConfig;
|
|
import com.ym.mec.biz.dal.entity.SysConfig;
|
|
import com.ym.mec.biz.dal.entity.SysPaymentConfig;
|
|
import com.ym.mec.biz.dal.entity.SysPaymentConfig;
|
|
import com.ym.mec.biz.dal.enums.FeeTypeEnum;
|
|
import com.ym.mec.biz.dal.enums.FeeTypeEnum;
|
|
|
|
+import com.ym.mec.biz.dal.enums.OrderTypeEnum;
|
|
import com.ym.mec.biz.dal.enums.PaymentChannelEnum;
|
|
import com.ym.mec.biz.dal.enums.PaymentChannelEnum;
|
|
import com.ym.mec.biz.service.PayService;
|
|
import com.ym.mec.biz.service.PayService;
|
|
import com.ym.mec.biz.service.SellOrderService;
|
|
import com.ym.mec.biz.service.SellOrderService;
|
|
import com.ym.mec.biz.service.StudentPaymentOrderService;
|
|
import com.ym.mec.biz.service.StudentPaymentOrderService;
|
|
|
|
+import com.ym.mec.biz.service.SysConfigService;
|
|
import com.ym.mec.biz.service.SysPaymentConfigService;
|
|
import com.ym.mec.biz.service.SysPaymentConfigService;
|
|
import com.ym.mec.common.exception.BizException;
|
|
import com.ym.mec.common.exception.BizException;
|
|
import com.ym.mec.common.redis.service.RedisCache;
|
|
import com.ym.mec.common.redis.service.RedisCache;
|
|
@@ -108,6 +110,49 @@ public class PayServiceImpl implements PayService {
|
|
return unionPay;
|
|
return unionPay;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //如果当前是买的小课/网管课
|
|
|
|
+ if (studentPaymentOrder.getType() == OrderTypeEnum.SMALL_CLASS_TO_BUY || studentPaymentOrder.getType() == OrderTypeEnum.PRACTICE_GROUP_BUY
|
|
|
|
+ || studentPaymentOrder.getType() == OrderTypeEnum.PRACTICE_GROUP_RENEW) {
|
|
|
|
+
|
|
|
|
+ // 是否由平台收款
|
|
|
|
+ String isPlatformCollection = sysConfigDao.findConfigValue(SysConfigService.IS_OPEN_SMALL_CLASS_INCOME_TO_PLATFORM);
|
|
|
|
+
|
|
|
|
+ if (StringUtils.equals("1", isPlatformCollection)) {
|
|
|
|
+ Date date = new Date();
|
|
|
|
+
|
|
|
|
+ String merNo = sysConfigDao.findConfigValue(SysConfigService.PLATFORM_PAYEE_ACCOUNT);
|
|
|
|
+
|
|
|
|
+ if(StringUtils.isBlank(merNo)){
|
|
|
|
+ throw new BizException("平台收款账户查询失败");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ StudentPaymentRouteOrder studentPaymentRouteOrder = new StudentPaymentRouteOrder();
|
|
|
|
+ studentPaymentRouteOrder.setOrderNo(orderNo);
|
|
|
|
+ studentPaymentRouteOrder.setRouteOrganId(organId);
|
|
|
|
+ studentPaymentRouteOrder.setFeeFlag("Y");
|
|
|
|
+ studentPaymentRouteOrder.setRouteAmount(amount);
|
|
|
|
+ studentPaymentRouteOrder.setRouteBalanceAmount(balanceAmount);
|
|
|
|
+ studentPaymentRouteOrder.setMerNo(merNo);
|
|
|
|
+ studentPaymentRouteOrder.setSaleAmount(BigDecimal.ZERO);
|
|
|
|
+ studentPaymentRouteOrder.setServiceAmount(amount);
|
|
|
|
+ studentPaymentRouteOrder.setCreateTime(date);
|
|
|
|
+ studentPaymentRouteOrder.setUpdateTime(date);
|
|
|
|
+ studentPaymentRouteOrderDao.insert(studentPaymentRouteOrder);
|
|
|
|
+
|
|
|
|
+ Map<String, Object> unionPay = new HashMap<>();
|
|
|
|
+ Map<String, Object> payMap = Payment.getPayMap(amount, orderNo, notifyUrl, returnUrl, orderSubject, orderBody);
|
|
|
|
+
|
|
|
|
+ PaymentChannelEnum payType = PaymentChannelEnum.ADAPAY;
|
|
|
|
+
|
|
|
|
+ unionPay.put("orderNo", orderNo);
|
|
|
|
+ unionPay.put("type", payType.getCode());
|
|
|
|
+ unionPay.put("payMap", payMap);
|
|
|
|
+ unionPay.put("routingMerNos", merNo);
|
|
|
|
+ return unionPay;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
String usePaymentConfig = sysConfigDao.findConfigValue("use_payment_config");// 是否用收费配置(1:使用 0:不使用)
|
|
String usePaymentConfig = sysConfigDao.findConfigValue("use_payment_config");// 是否用收费配置(1:使用 0:不使用)
|
|
List<RouteScaleDto> routeScaleDtos = null;
|
|
List<RouteScaleDto> routeScaleDtos = null;
|
|
//使用配置开关
|
|
//使用配置开关
|
|
@@ -145,7 +190,7 @@ public class PayServiceImpl implements PayService {
|
|
public Map<String, Object> getPayToPlatformMap(PaymentChannelEnum paymentChannel, BigDecimal amount, BigDecimal balanceAmount, String orderNo, String notifyUrl, String returnUrl,
|
|
public Map<String, Object> getPayToPlatformMap(PaymentChannelEnum paymentChannel, BigDecimal amount, BigDecimal balanceAmount, String orderNo, String notifyUrl, String returnUrl,
|
|
String orderSubject, String orderBody) throws Exception {
|
|
String orderSubject, String orderBody) throws Exception {
|
|
|
|
|
|
- SysConfig config = sysConfigDao.findByParamName("platform_collection_organ");
|
|
|
|
|
|
+ /*SysConfig config = sysConfigDao.findByParamName("platform_collection_organ");
|
|
if (Objects.isNull(config)) {
|
|
if (Objects.isNull(config)) {
|
|
throw new BizException("平台收款账户没有设置[platform_collection_organ]");
|
|
throw new BizException("平台收款账户没有设置[platform_collection_organ]");
|
|
}
|
|
}
|
|
@@ -156,7 +201,13 @@ public class PayServiceImpl implements PayService {
|
|
throw new BizException("分部[{}]没有设置收款账号", config.getParanValue());
|
|
throw new BizException("分部[{}]没有设置收款账号", config.getParanValue());
|
|
}
|
|
}
|
|
|
|
|
|
- String payeeMerNo = sysPaymentConfig.getHfMerNo();
|
|
|
|
|
|
+ String payeeMerNo = sysPaymentConfig.getHfMerNo();*/
|
|
|
|
+
|
|
|
|
+ String payeeMerNo = sysConfigDao.findConfigValue(SysConfigService.PLATFORM_PAYEE_ACCOUNT);
|
|
|
|
+
|
|
|
|
+ if(StringUtils.isBlank(payeeMerNo)){
|
|
|
|
+ throw new BizException("平台收款账户查询失败");
|
|
|
|
+ }
|
|
|
|
|
|
Map<String, Object> payMap = null;
|
|
Map<String, Object> payMap = null;
|
|
|
|
|