|
@@ -3,6 +3,7 @@ package com.cyksj.service.pay.impl;
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.date.DateTime;
|
|
import cn.hutool.core.date.DateTime;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.RandomUtil;
|
|
import cn.hutool.core.util.RandomUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alipay.api.AlipayApiException;
|
|
import com.alipay.api.AlipayApiException;
|
|
@@ -144,12 +145,16 @@ public class AliPayCommonServiceImpl implements AliPayCommonService {
|
|
|
SysConfig realGoodsPayShopIdConfig = sysConfigService.getOne(Wrappers.lambdaQuery(SysConfig.class).eq(SysConfig::getSysKey, Constant.REAL_GOODS_PAY_SHOP_ID).last("limit 1"));
|
|
SysConfig realGoodsPayShopIdConfig = sysConfigService.getOne(Wrappers.lambdaQuery(SysConfig.class).eq(SysConfig::getSysKey, Constant.REAL_GOODS_PAY_SHOP_ID).last("limit 1"));
|
|
|
orderDon.setShopId(realGoodsPayShopIdConfig != null ? realGoodsPayShopIdConfig.getSysValue() : ShopConfig.ZFB_DEFAULT_APP_ID);
|
|
orderDon.setShopId(realGoodsPayShopIdConfig != null ? realGoodsPayShopIdConfig.getSysValue() : ShopConfig.ZFB_DEFAULT_APP_ID);
|
|
|
}
|
|
}
|
|
|
|
|
+ boolean priceDifferGoods = isPriceDifferGoods(orderDon.getGoodsId());
|
|
|
|
|
+ if (priceDifferGoods) {
|
|
|
|
|
+ orderDon.setShopId(Constant.CY_SHOP_ID);
|
|
|
|
|
+ }
|
|
|
String appId = orderDon.getShopId();
|
|
String appId = orderDon.getShopId();
|
|
|
if (StrUtil.isEmpty(appId)) {
|
|
if (StrUtil.isEmpty(appId)) {
|
|
|
appId = getZfbDayLimitShopId(orderDon);
|
|
appId = getZfbDayLimitShopId(orderDon);
|
|
|
}
|
|
}
|
|
|
//若切换支付环境
|
|
//若切换支付环境
|
|
|
- if (StrUtil.isNotBlank(orderDon.getShopId()) && isWebPay != orderDon.getIsWebPay()) {
|
|
|
|
|
|
|
+ if (!priceDifferGoods && StrUtil.isNotBlank(orderDon.getShopId()) && isWebPay != orderDon.getIsWebPay()) {
|
|
|
//当前支付宝商户 不支持所有环境 使用默认支付宝
|
|
//当前支付宝商户 不支持所有环境 使用默认支付宝
|
|
|
ZfbShopOrderDayLimit dayLimit = zfbShopOrderDayLimitMapper.selectOne(Wrappers.lambdaQuery(ZfbShopOrderDayLimit.class)
|
|
ZfbShopOrderDayLimit dayLimit = zfbShopOrderDayLimitMapper.selectOne(Wrappers.lambdaQuery(ZfbShopOrderDayLimit.class)
|
|
|
.eq(ZfbShopOrderDayLimit::getAppId, orderDon.getShopId())
|
|
.eq(ZfbShopOrderDayLimit::getAppId, orderDon.getShopId())
|
|
@@ -625,4 +630,11 @@ public class AliPayCommonServiceImpl implements AliPayCommonService {
|
|
|
}
|
|
}
|
|
|
return appId;
|
|
return appId;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ private boolean isPriceDifferGoods(Long goodsId) {
|
|
|
|
|
+ if (goodsId == null) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ return ObjectUtil.equals(Constant.DIFF_PRICE_GOODS_ID, goodsId);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|