|  | @@ -17,6 +17,7 @@ import com.ym.mec.thirdparty.adapay.Payment;
 | 
											
												
													
														|  |  import com.ym.mec.thirdparty.union.UnionPay;
 |  |  import com.ym.mec.thirdparty.union.UnionPay;
 | 
											
												
													
														|  |  import com.ym.mec.thirdparty.union.UnionPayFeignService;
 |  |  import com.ym.mec.thirdparty.union.UnionPayFeignService;
 | 
											
												
													
														|  |  import com.ym.mec.thirdparty.yqpay.YqPayUtil;
 |  |  import com.ym.mec.thirdparty.yqpay.YqPayUtil;
 | 
											
												
													
														|  | 
 |  | +import com.ym.mec.util.date.DateUtil;
 | 
											
												
													
														|  |  import org.apache.commons.lang3.StringUtils;
 |  |  import org.apache.commons.lang3.StringUtils;
 | 
											
												
													
														|  |  import org.springframework.beans.factory.annotation.Autowired;
 |  |  import org.springframework.beans.factory.annotation.Autowired;
 | 
											
												
													
														|  |  import org.springframework.data.redis.core.RedisTemplate;
 |  |  import org.springframework.data.redis.core.RedisTemplate;
 | 
											
										
											
												
													
														|  | @@ -370,19 +371,33 @@ public class PayServiceImpl implements PayService {
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          Map<String, String> channel = (Map<String, String>) JSON.parseObject(SporadicChannel, Map.class);
 |  |          Map<String, String> channel = (Map<String, String>) JSON.parseObject(SporadicChannel, Map.class);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        BigDecimal minReceiptMoney = new BigDecimal(channel.get("minReceiptMoney")); //最小接收的金额(不包含)
 | 
											
												
													
														|  | 
 |  | +        if (amount.compareTo(minReceiptMoney) <= 0) {
 | 
											
												
													
														|  | 
 |  | +            return null;
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |          Integer organId = Integer.parseInt(channel.get("organId"));
 |  |          Integer organId = Integer.parseInt(channel.get("organId"));
 | 
											
												
													
														|  | -        BigDecimal maxReceipt = new BigDecimal(channel.get("maxReceipt"));
 |  | 
 | 
											
												
													
														|  | 
 |  | +        BigDecimal monthMaxReceipt = new BigDecimal(channel.get("maxReceipt")); //每月限定金额
 | 
											
												
													
														|  | 
 |  | +        BigDecimal totalMaxReceipt = new BigDecimal(channel.get("totalMaxReceipt")); //总限定金额(500W)
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +        Date monthStartTime = DateUtil.getFirstDayOfMonth(new Date());
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          //已收金额
 |  |          //已收金额
 | 
											
												
													
														|  |          List<PaymentChannelEnum> paymentChannelList = new ArrayList<>();
 |  |          List<PaymentChannelEnum> paymentChannelList = new ArrayList<>();
 | 
											
												
													
														|  |          paymentChannelList.add(PaymentChannelEnum.YQPAY);
 |  |          paymentChannelList.add(PaymentChannelEnum.YQPAY);
 | 
											
												
													
														|  |          paymentChannelList.add(PaymentChannelEnum.ADAPAY);
 |  |          paymentChannelList.add(PaymentChannelEnum.ADAPAY);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -        BigDecimal hasReceipt = studentPaymentRouteOrderDao.getRouteOrderAmount(organId, paymentChannelList);
 |  | 
 | 
											
												
													
														|  | -        if (hasReceipt.compareTo(maxReceipt) >= 0) {
 |  | 
 | 
											
												
													
														|  | 
 |  | +        BigDecimal monthHasReceipt = studentPaymentRouteOrderDao.getRouteOrderAmount(organId, paymentChannelList, monthStartTime);
 | 
											
												
													
														|  | 
 |  | +        if (monthHasReceipt.compareTo(monthMaxReceipt) >= 0) {
 | 
											
												
													
														|  |              return null;
 |  |              return null;
 | 
											
												
													
														|  |          }
 |  |          }
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  | 
 |  | +        BigDecimal totalHasReceipt = studentPaymentRouteOrderDao.getRouteOrderAmount(organId, paymentChannelList, null);
 | 
											
												
													
														|  | 
 |  | +        if (totalHasReceipt.compareTo(totalMaxReceipt) >= 0) {
 | 
											
												
													
														|  | 
 |  | +            return null;
 | 
											
												
													
														|  | 
 |  | +        }
 | 
											
												
													
														|  | 
 |  | +        
 | 
											
												
													
														|  |          SysPaymentConfig paymentConfig = sysPaymentConfigService.findPaymentConfigByOrganId(organId);
 |  |          SysPaymentConfig paymentConfig = sysPaymentConfigService.findPaymentConfigByOrganId(organId);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |          RouteScaleDto routeScaleDto = new RouteScaleDto();
 |  |          RouteScaleDto routeScaleDto = new RouteScaleDto();
 |