package cn.wise.sc.energy.power.plant.business.task;

import cn.wise.sc.energy.power.plant.business.domain.vo.CharacterParamInfoVo;
import cn.wise.sc.energy.power.plant.business.service.ICharacterParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author neo.shu
 * @since 2020/9/17 17:36
 */

@Service
public class TaskCacheDataService {

    @Autowired
    ICharacterParamService iCharacterParamService;

    @Cacheable(value = "hydroge-character", key = "#deviceId")
    public List<CharacterParamInfoVo> cacheHydrogeCha(String deviceId) {
        List<String> characterNames = new ArrayList<>();
        characterNames.add("发电机机内氢压");
        characterNames.add("机内氢气湿度");
        characterNames.add("漏氢含量");
        characterNames.add("汽端发电机冷氢温度");
        List<CharacterParamInfoVo> characterParamInfoVos =
                iCharacterParamService.getCharacterByName(characterNames, "", deviceId);
        return characterParamInfoVos;
    }

    @Cacheable(value = "oil-character", key = "#deviceId")
    public List<CharacterParamInfoVo> cacheOilCPI(String deviceId) {
        List<String> characterNames = new ArrayList<>();

        //左上角
        characterNames.add("空侧交流密封油泵进出口压差");
        characterNames.add("空侧直流密封油泵进出口压差");
        characterNames.add("密封油油氢压差");
        characterNames.add("密封油油氢压差");
        characterNames.add("氢侧交流油泵进出口压差");
        characterNames.add("氢侧直流油泵进出口压差");

        //左下角
        characterNames.add("励端轴承氢侧密封油温度");
        characterNames.add("汽端轴承氢侧密封油温度");
        characterNames.add("空侧冷却器密封油出口温度");
        characterNames.add("氢侧冷却器密封油出口温度");

        //右上角
        characterNames.add("汽轮机备用油差压阀进口压力");
        characterNames.add("排油烟机1号进口压力");
        characterNames.add("排油烟机2号进口压力");


        List<CharacterParamInfoVo> characterParamInfoVos =
                iCharacterParamService.getCharacterByName(characterNames, "", deviceId);
        return characterParamInfoVos;
    }

    @Cacheable(value = "index-character")
    public List<CharacterParamInfoVo> cacheIndexCPI() {
        List<String> characterNames = new ArrayList<>();
        //右上
        characterNames.add("发电机定子A相电流");
        characterNames.add("发电机定子B相电流");
        characterNames.add("发电机定子C相电流");
        characterNames.add("发电机定子AB线电压");
        characterNames.add("发电机定子BC线电压");
        characterNames.add("发电机定子CA线电压");
        //右中
        characterNames.add("汽端座振X");
        characterNames.add("汽端轴振X");
        characterNames.add("励端座振X");
        characterNames.add("励端轴振X");
        //右下
        characterNames.add("排油温度");
        List<CharacterParamInfoVo> characterParamInfoVos =
                iCharacterParamService.getCharacterByName(characterNames, "", "");
        return characterParamInfoVos;
    }

    @Cacheable(value = "water-character", key = "#deviceId")
    public List<CharacterParamInfoVo> cacheWaterCPI(String deviceId) {
        List<String> characterNames = new ArrayList<>();

        //左下 小时
        characterNames.add("转子冷却水流量");
        characterNames.add("定子冷却水流量");

        //左上
        characterNames.add("转子冷却水泵A出口压力");
        characterNames.add("转子冷却水泵B出口压力");
        //右上
        characterNames.add("定子线圈进水温度");
        characterNames.add("定子线圈出水温度");
        characterNames.add("转子线圈进水温度");
        characterNames.add("转子线圈出水温度");
        //右下
        characterNames.add("定子线圈进水电导率");
        characterNames.add("定子线圈进水pH值");
        characterNames.add("转子线圈进水电导率");
        characterNames.add("转子线圈进水pH值");

        List<CharacterParamInfoVo> characterParamInfoVos =
                iCharacterParamService.getCharacterByName(characterNames, "", deviceId);
        return characterParamInfoVos;
    }


}
