| | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalTime; |
| | | import java.util.ArrayList; |
| | | import java.util.Comparator; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | |
| | | return isFirstElementValid || !isTimeContinuous; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean isStrategyPriceConsistent(List<TAccountingStrategyDetail> accountingStrategyDetails) { |
| | | Map<Integer, BigDecimal> phaseToServiceFee = new HashMap<>(); |
| | | for (TAccountingStrategyDetail detail : accountingStrategyDetails) { |
| | | Integer type = detail.getType(); |
| | | BigDecimal serviceFee = detail.getServiceCharge(); |
| | | |
| | | if (phaseToServiceFee.containsKey(type)) { |
| | | BigDecimal existingFee = phaseToServiceFee.get(type); |
| | | if (!existingFee.equals(serviceFee)) { |
| | | return false; // 发现不一致的服务费 |
| | | } |
| | | } else { |
| | | phaseToServiceFee.put(type, serviceFee); |
| | | } |
| | | } |
| | | return true; // 所有相同阶段的服务费一致 |
| | | } |
| | | } |