| | |
| | | @Override |
| | | public Boolean isStrategyPriceConsistent(List<TAccountingStrategyDetail> accountingStrategyDetails) { |
| | | Map<Integer, BigDecimal> phaseToServiceFee = new HashMap<>(); |
| | | Map<Integer, BigDecimal> phaseToCostServiceFee = new HashMap<>(); |
| | | for (TAccountingStrategyDetail detail : accountingStrategyDetails) { |
| | | Integer type = detail.getType(); |
| | | BigDecimal serviceFee = detail.getServiceCharge(); |
| | | BigDecimal costServiceCharge = detail.getCostServiceCharge(); |
| | | |
| | | if (phaseToServiceFee.containsKey(type)) { |
| | | BigDecimal existingFee = phaseToServiceFee.get(type); |
| | | if (!existingFee.equals(serviceFee)) { |
| | | BigDecimal existingCostServiceCharge = phaseToCostServiceFee.get(type); |
| | | if (existingFee.compareTo(serviceFee) != 0) { |
| | | return false; // 发现不一致的服务费 |
| | | } |
| | | if (existingCostServiceCharge.compareTo(costServiceCharge) != 0) { |
| | | return false; // 发现不一致的原价服务费 |
| | | } |
| | | } else { |
| | | phaseToServiceFee.put(type, serviceFee); |
| | | phaseToCostServiceFee.put(type, costServiceCharge); |
| | | } |
| | | } |
| | | return true; // 所有相同阶段的服务费一致 |