package com.jiayue.ipp.idp;

import com.jiayue.ipp.common.data.entity.AccuracyCalculation;
import com.jiayue.ipp.idp.service.impl.AccuracyCalculationServiceImpl;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

@SpringBootTest
class IppIdpApplicationTests {
    @Autowired
    AccuracyCalculationServiceImpl accuracyCalculationService;

    public static void main(String[] args) {
        List<AccuracyCalculation> list = new ArrayList<>();
        for (int i = 0; i < 10; i++) {
            AccuracyCalculation accuracyCalculation = new AccuracyCalculation();
            accuracyCalculation.setShortTermAccuracy("12");
            accuracyCalculation.setUltraShortTermAccuracy("13");
            list.add(accuracyCalculation);
        }
        AccuracyCalculation accuracyCalculation = new AccuracyCalculation();
        accuracyCalculation.setShortTermAccuracy("无可用数据计算");
        accuracyCalculation.setUltraShortTermAccuracy("无可用数据计算");
        list.add(accuracyCalculation);
        AccuracyCalculation accuracyCalculations = new AccuracyCalculation();
        accuracyCalculations.setShortTermAccuracy("无计算公式");
        accuracyCalculations.setUltraShortTermAccuracy("无计算公式");
        list.add(accuracyCalculations);
        List<String> shortCollect = list.stream().map(AccuracyCalculation::getShortTermAccuracy).collect(Collectors.toList());
        List<String> shortA = shortCollect.stream().filter(s -> !s.equals("无可用数据计算") && !s.equals("无计算公式")).collect(Collectors.toList());
        List<String> uShortCollect = list.stream().map(AccuracyCalculation::getUltraShortTermAccuracy).collect(Collectors.toList());
        List<String> uSShortA = uShortCollect.stream().filter(s -> !s.equals("无可用数据计算") && !s.equals("无计算公式")).collect(Collectors.toList());
        System.out.println(1);
    }

    @Test
    public void main() {
//        List<AccuracyCalculation> a = accuracyCalculationService.homePageAccuracy();
        System.out.println(1);
    }

}
