|
|
@@ -218,7 +218,7 @@ public class AliPayCommonServiceImpl implements AliPayCommonService {
|
|
|
return aliPayParams;
|
|
|
}
|
|
|
|
|
|
- private ZfbShopOrderDayLimit getZfbShopOrdersDayLimit(Long goodsId, List<Integer> scope) {
|
|
|
+ private ZfbShopOrderDayLimit getZfbShopOrdersDayLimit(Long goodsId, List<Integer> scope, List<Integer> payCategorys) {
|
|
|
int hour = DateUtil.hour(DateTime.now(), true);
|
|
|
//如果是ai订单 不分配给善缘
|
|
|
Integer aiCount = goodsDonCategoryRelateMapper.selectCount(Wrappers.lambdaQuery(GoodsDonCategoryRelate.class)
|
|
|
@@ -234,6 +234,7 @@ public class AliPayCommonServiceImpl implements AliPayCommonService {
|
|
|
.gt(ZfbShopOrderDayLimit::getHourRemainOrders, 0)
|
|
|
.eq(ZfbShopOrderDayLimit::getStatus, 1)
|
|
|
.in(ZfbShopOrderDayLimit::getScope, scope)
|
|
|
+ .in(ZfbShopOrderDayLimit::getPayCategory, payCategorys)
|
|
|
.eq(ZfbShopOrderDayLimit::getAppId, Constant.CY_SHOP_ID));
|
|
|
}
|
|
|
if (CollUtil.isEmpty(orderDayLimits)) {
|
|
|
@@ -244,6 +245,7 @@ public class AliPayCommonServiceImpl implements AliPayCommonService {
|
|
|
.gt(ZfbShopOrderDayLimit::getHourRemainOrders, 0)
|
|
|
.eq(ZfbShopOrderDayLimit::getStatus, 1)
|
|
|
.in(ZfbShopOrderDayLimit::getScope, scope)
|
|
|
+ .in(ZfbShopOrderDayLimit::getPayCategory, payCategorys)
|
|
|
.ne(aiCount > 0, ZfbShopOrderDayLimit::getAppId, Constant.SY_SHOP_ID));
|
|
|
}
|
|
|
if (orderDayLimits.isEmpty()) {
|
|
|
@@ -599,8 +601,15 @@ public class AliPayCommonServiceImpl implements AliPayCommonService {
|
|
|
} else scope.add(2);
|
|
|
//排除推广链接
|
|
|
if (StrUtil.isEmpty(appId)) {
|
|
|
+ Long goodsId = orderDon.getGoodsId();
|
|
|
+ //是否是AI订单
|
|
|
+ Integer selectCount = goodsDonCategoryRelateMapper.selectCount(Wrappers.lambdaQuery(GoodsDonCategoryRelate.class).eq(GoodsDonCategoryRelate::getGoodsId, goodsId).eq(GoodsDonCategoryRelate::getCategory, 2));
|
|
|
+ List<Integer> payCategorys = Lists.newArrayList(0);
|
|
|
+ if (selectCount > 0) {
|
|
|
+ payCategorys.add(2);
|
|
|
+ }
|
|
|
//获取每日订单限制 支付宝商户
|
|
|
- ZfbShopOrderDayLimit dayLimit = getZfbShopOrdersDayLimit(orderDon.getGoodsId(), scope);
|
|
|
+ ZfbShopOrderDayLimit dayLimit = getZfbShopOrdersDayLimit(orderDon.getGoodsId(), scope, payCategorys);
|
|
|
if (dayLimit == null) {
|
|
|
//获取支付宝默认商户
|
|
|
appId = sysConfigService.getDefaultShopConfigByType("zfb");
|