소스 검색

update 分润设置

周箭河 5 년 전
부모
커밋
5f7feeacf4
1개의 변경된 파일8개의 추가작업 그리고 4개의 파일을 삭제
  1. 8 4
      mec-biz/src/main/java/com/ym/mec/biz/service/impl/PayServiceImpl.java

+ 8 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/impl/PayServiceImpl.java

@@ -263,7 +263,7 @@ public class PayServiceImpl implements PayService {
         SysPaymentConfig paymentConfig = sysPaymentConfigService.findPaymentConfigByOrganId(organId);
         if (paymentConfig == null || StringUtils.isBlank(paymentConfig.getRouteScale())) {
             String paymentChannel = sysConfigDao.findConfigValue("payment_channel");
-            if(paymentConfig != null){
+            if (paymentConfig != null) {
                 paymentChannel = paymentConfig.getPayType().getCode();
             }
             List<RouteScaleDto> routeScaleDtos = new ArrayList<>();
@@ -311,11 +311,15 @@ public class PayServiceImpl implements PayService {
             while (iterator.hasNext()) {
                 RouteScaleDto routeScaleDto = iterator.next();
                 Integer num = routeScaleDto.getScale();
+                boolean flag = false;
                 if (rem > scale && rem <= scale + num) {
                     routeScaleDto.setScale(100);
-                    continue;
+                    flag = true;
                 }
                 scale += num;
+                if (flag) {
+                    continue;
+                }
                 iterator.remove();
             }
         }
@@ -442,12 +446,12 @@ public class PayServiceImpl implements PayService {
         paymentChannelList.add(PaymentChannelEnum.ADAPAY);
 
         BigDecimal monthHasReceipt = studentPaymentRouteOrderDao.getRouteOrderAmount(organId, paymentChannelList, monthStartTime);
-        monthHasReceipt  = monthHasReceipt == null ? BigDecimal.ZERO : monthHasReceipt;
+        monthHasReceipt = monthHasReceipt == null ? BigDecimal.ZERO : monthHasReceipt;
         if (amount.add(monthHasReceipt).compareTo(monthMaxReceipt) >= 0) {
             return true;
         }
         BigDecimal totalHasReceipt = studentPaymentRouteOrderDao.getRouteOrderAmount(organId, paymentChannelList, null);
-        totalHasReceipt  = totalHasReceipt == null ? BigDecimal.ZERO : totalHasReceipt;
+        totalHasReceipt = totalHasReceipt == null ? BigDecimal.ZERO : totalHasReceipt;
         if (amount.add(totalHasReceipt).compareTo(totalMaxReceipt) >= 0) {
             return true;
         }