|
|
@@ -225,17 +225,16 @@ public class AliPayCommonServiceImpl implements AliPayCommonService {
|
|
|
.eq(GoodsDonCategoryRelate::getCategory, 1)
|
|
|
.eq(GoodsDonCategoryRelate::getGoodsId, goodsId));
|
|
|
List<ZfbShopOrderDayLimit> orderDayLimits = null;
|
|
|
- //Ai订单 优先分配给崇宇
|
|
|
- if (aiCount > 0) {
|
|
|
- orderDayLimits = zfbShopOrderDayLimitMapper.selectList(Wrappers.lambdaQuery(ZfbShopOrderDayLimit.class)
|
|
|
- .le(ZfbShopOrderDayLimit::getHourStart, hour)
|
|
|
- .ge(ZfbShopOrderDayLimit::getHourEnd, hour)
|
|
|
- .gt(ZfbShopOrderDayLimit::getDayRemainOrders, 0)
|
|
|
- .gt(ZfbShopOrderDayLimit::getHourRemainOrders, 0)
|
|
|
- .eq(ZfbShopOrderDayLimit::getStatus, 1)
|
|
|
- .in(ZfbShopOrderDayLimit::getScope, scope)
|
|
|
- .in(ZfbShopOrderDayLimit::getPayCategory, payCategorys)
|
|
|
- .eq(ZfbShopOrderDayLimit::getAppId, Constant.CY_SHOP_ID));
|
|
|
+ //崇宇支付宝每月限制收款18w
|
|
|
+ ShopConfig shopConfig = shopConfigMapper.selectOne(Wrappers.lambdaQuery(ShopConfig.class).eq(ShopConfig::getAppId, Constant.CY_SHOP_ID).last("limit 1"));
|
|
|
+ DateTime now = DateTime.now();
|
|
|
+ String filterShopId = null;
|
|
|
+ if (shopConfig.getMonthMoneyLimit() != null) {
|
|
|
+ BigDecimal thisShopIdMonthMoney = orderDonMapper.getSumMoneyZfbThisMonth(Constant.CY_SHOP_ID, DateUtil.beginOfMonth(now), DateUtil.endOfMonth(now));
|
|
|
+ //超过每月收款额度
|
|
|
+ if (shopConfig.getMonthMoneyLimit().compareTo(thisShopIdMonthMoney) <= 0) {
|
|
|
+ filterShopId = Constant.CY_SHOP_ID;
|
|
|
+ }
|
|
|
}
|
|
|
if (CollUtil.isEmpty(orderDayLimits)) {
|
|
|
orderDayLimits = zfbShopOrderDayLimitMapper.selectList(Wrappers.lambdaQuery(ZfbShopOrderDayLimit.class)
|
|
|
@@ -246,7 +245,9 @@ public class AliPayCommonServiceImpl implements AliPayCommonService {
|
|
|
.eq(ZfbShopOrderDayLimit::getStatus, 1)
|
|
|
.in(ZfbShopOrderDayLimit::getScope, scope)
|
|
|
.in(ZfbShopOrderDayLimit::getPayCategory, payCategorys)
|
|
|
- .ne(aiCount > 0, ZfbShopOrderDayLimit::getAppId, Constant.SY_SHOP_ID));
|
|
|
+ .ne(aiCount > 0, ZfbShopOrderDayLimit::getAppId, Constant.SY_SHOP_ID)
|
|
|
+ //超过每月收款额 不分配
|
|
|
+ .ne(filterShopId != null, ZfbShopOrderDayLimit::getAppId, filterShopId));
|
|
|
}
|
|
|
if (orderDayLimits.isEmpty()) {
|
|
|
return null;
|