| | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | import java.util.stream.IntStream; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | } |
| | | } |
| | | |
| | | public boolean hasConsecutiveDuplicates(List<CalculateItemDTO> calculateItemList) { |
| | | return IntStream.range(1, calculateItemList.size()) |
| | | .anyMatch(i -> calculateItemList.get(i - 1).getValueType() |
| | | .equals(calculateItemList.get(i).getValueType())); |
| | | public static boolean hasConsecutiveDuplicates(List<CalculateItemDTO> calculateItemList) { |
| | | for (int i = 0; i < calculateItemList.size() - 1; i++) { |
| | | if (calculateItemList.get(i).getValueType() |
| | | .equals(calculateItemList.get(i + 1).getValueType()) && !calculateItemList.get( |
| | | i + 1) |
| | | .getContent().equals("(")) { |
| | | return true; |
| | | } |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | |
| | | private String getFieldIdStr(List<CalculateItemDTO> calculateItemList, |
| | | TbBasicDataConfig tbBasicDataConfig) { |
| | | if (CollUtils.isEmpty(calculateItemList)) { |