fuliqi
2024-09-10 7d5ea3631d163343b652bd6bd40b94b34c4194eb
ycl-server/src/main/java/com/ycl/calculate/IndexCalculationUtils.java
@@ -16,11 +16,11 @@
@Slf4j
public class IndexCalculationUtils {
    //检查是否存在当日数据
    public <I extends CheckIndex> I getCheckIndex(String key, List<I> checkIndexList, Class<I> clazz) {
        I checkIndex;
    public <T extends CheckIndex> T getCheckIndex(String key, List<T> checkIndexList, Class<T> clazz) {
        T checkIndex;
        // 检查是否已存在今日数据
        Optional<I> existingIndex = checkIndexList.stream()
        Optional<T> existingIndex = checkIndexList.stream()
                .filter(index -> key.startsWith(ApiConstants.Province) ?
                        CheckConstants.Examine_Tag_Province.equals(index.getExamineTag()) && key.split("_")[1].equals(index.getDeptId().toString())
                        : CheckConstants.Examine_Tag_County.equals(index.getExamineTag()) && key.equals(index.getDeptId().toString()))