package com.ho.business.service.impl;

import com.ho.business.service.InverterMethodService;
import com.ho.business.vo.resp.InverterResp.InverterPvValueRespVO;
import com.ho.business.vo.resp.InverterResp.ModelNewInverter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * @author gyan
 * @desc: TODO
 * @DateTime: 2023/2/14 9:51
 */
@Service
@Slf4j
public class InverterMethodServiceImpl implements InverterMethodService {

    @Override
    //禾望逆变器（一个电压对两个电流：1-->1、2）
    public List<InverterPvValueRespVO> getInverterHW(ModelNewInverter modelInverter) {
        //返回值
        List<InverterPvValueRespVO> list = new ArrayList<>();
        InverterPvValueRespVO inverter1 = new InverterPvValueRespVO();
        //电压

        if (modelInverter.getPv1U() == null || modelInverter.getPv1U().getValue() == null) {
            inverter1.setVoltage(BigDecimal.ZERO);
        } else {
            inverter1.setVoltage(modelInverter.getPv1U().getValue());
        }
        //电流
        if (modelInverter.getPv1I() == null || modelInverter.getPv1I().getValue() == null) {
            inverter1.setCurrent(BigDecimal.ZERO);
        } else {
            inverter1.setCurrent(modelInverter.getPv1I().getValue());
        }
        inverter1.setName("PV1");
        list.add(inverter1);
        //pv2
        InverterPvValueRespVO inverter2 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv1U() == null || modelInverter.getPv1U().getValue() == null) {
            inverter2.setVoltage(BigDecimal.ZERO);
        } else {
            inverter2.setVoltage(modelInverter.getPv1U().getValue());
        }
        //电流
        if (modelInverter.getPv2I() == null || modelInverter.getPv2I().getValue() == null) {
            inverter2.setCurrent(BigDecimal.ZERO);
        } else {
            inverter2.setCurrent(modelInverter.getPv2I().getValue());
        }
        inverter2.setName("PV2");
        list.add(inverter2);
        //pv3
        InverterPvValueRespVO inverter3 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv1U() == null || modelInverter.getPv1U().getValue() == null) {
            inverter3.setVoltage(BigDecimal.ZERO);
        } else {
            inverter3.setVoltage(modelInverter.getPv1U().getValue());
        }
        //电流
        if (modelInverter.getPv3I() == null || modelInverter.getPv3I().getValue() == null) {
            inverter3.setCurrent(BigDecimal.ZERO);
        } else {
            inverter3.setCurrent(modelInverter.getPv3I().getValue());
        }
        inverter3.setName("PV3");
        list.add(inverter3);
        //pv4
        InverterPvValueRespVO inverter4 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv1U() == null || modelInverter.getPv1U().getValue() == null) {
            inverter4.setVoltage(BigDecimal.ZERO);
        } else {
            inverter4.setVoltage(modelInverter.getPv1U().getValue());
        }
        //电流
        if (modelInverter.getPv4I() == null || modelInverter.getPv4I().getValue() == null) {
            inverter4.setCurrent(BigDecimal.ZERO);
        } else {
            inverter4.setCurrent(modelInverter.getPv4I().getValue());
        }
        inverter4.setName("PV4");
        list.add(inverter4);
        //pv5
        InverterPvValueRespVO inverter5 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv1U() == null || modelInverter.getPv1U().getValue() == null) {
            inverter5.setVoltage(BigDecimal.ZERO);
        } else {
            inverter5.setVoltage(modelInverter.getPv1U().getValue());
        }
        //电流
        if (modelInverter.getPv5I() == null || modelInverter.getPv5I().getValue() == null) {
            inverter5.setCurrent(BigDecimal.ZERO);
        } else {
            inverter5.setCurrent(modelInverter.getPv5I().getValue());
        }
        inverter5.setName("PV5");
        list.add(inverter5);

        //pv6
        InverterPvValueRespVO inverter6 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv2U() == null || modelInverter.getPv2U().getValue() == null) {
            inverter6.setVoltage(BigDecimal.ZERO);
        } else {
            inverter6.setVoltage(modelInverter.getPv2U().getValue());
        }
        //电流
        if (modelInverter.getPv6I() == null || modelInverter.getPv6I().getValue() == null) {
            inverter6.setCurrent(BigDecimal.ZERO);
        } else {
            inverter6.setCurrent(modelInverter.getPv6I().getValue());
        }
        inverter6.setName("PV6");
        list.add(inverter6);

        //pv7
        InverterPvValueRespVO inverter7 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv2U() == null || modelInverter.getPv2U().getValue() == null) {
            inverter7.setVoltage(BigDecimal.ZERO);
        } else {
            inverter7.setVoltage(modelInverter.getPv2U().getValue());
        }
        //电流
        if (modelInverter.getPv7I() == null || modelInverter.getPv7I().getValue() == null) {
            inverter7.setCurrent(BigDecimal.ZERO);
        } else {
            inverter7.setCurrent(modelInverter.getPv7I().getValue());
        }
        inverter7.setName("PV7");
        list.add(inverter7);
        //pv8
        InverterPvValueRespVO inverter8 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv2U() == null || modelInverter.getPv2U().getValue() == null) {
            inverter8.setVoltage(BigDecimal.ZERO);
        } else {
            inverter8.setVoltage(modelInverter.getPv2U().getValue());
        }
        //电流
        if (modelInverter.getPv8I() == null || modelInverter.getPv8I().getValue() == null) {
            inverter8.setCurrent(BigDecimal.ZERO);
        } else {
            inverter8.setCurrent(modelInverter.getPv8I().getValue());
        }
        inverter8.setName("PV8");
        list.add(inverter8);

        //pv9
        InverterPvValueRespVO inverter9 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv2U() == null || modelInverter.getPv2U().getValue() == null) {
            inverter9.setVoltage(BigDecimal.ZERO);
        } else {
            inverter9.setVoltage(modelInverter.getPv2U().getValue());
        }
        //电流
        if (modelInverter.getPv9I() == null || modelInverter.getPv9I().getValue() == null) {
            inverter9.setCurrent(BigDecimal.ZERO);
        } else {
            inverter9.setCurrent(modelInverter.getPv9I().getValue());
        }
        inverter9.setName("PV9");
        list.add(inverter9);

        //pv10
        InverterPvValueRespVO inverter10 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv2U() == null || modelInverter.getPv2U().getValue() == null) {
            inverter10.setVoltage(BigDecimal.ZERO);
        } else {
            inverter10.setVoltage(modelInverter.getPv2U().getValue());
        }
        //电流
        if (modelInverter.getPv10I() == null || modelInverter.getPv10I().getValue() == null) {
            inverter10.setCurrent(BigDecimal.ZERO);
        } else {
            inverter10.setCurrent(modelInverter.getPv10I().getValue());
        }
        inverter10.setName("PV10");
        list.add(inverter10);

        //pv11
        InverterPvValueRespVO inverter11 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv3U() == null || modelInverter.getPv3U().getValue() == null) {
            inverter11.setVoltage(BigDecimal.ZERO);
        } else {
            inverter11.setVoltage(modelInverter.getPv3U().getValue());
        }
        //电流
        if (modelInverter.getPv11I() == null || modelInverter.getPv11I().getValue() == null) {
            inverter11.setCurrent(BigDecimal.ZERO);
        } else {
            inverter11.setCurrent(modelInverter.getPv11I().getValue());
        }
        inverter11.setName("PV11");
        list.add(inverter11);

        //pv12
        InverterPvValueRespVO inverter12 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv3U() == null || modelInverter.getPv3U().getValue() == null) {
            inverter12.setVoltage(BigDecimal.ZERO);
        } else {
            inverter12.setVoltage(modelInverter.getPv3U().getValue());
        }
        //电流
        if (modelInverter.getPv12I() == null || modelInverter.getPv12I().getValue() == null) {
            inverter12.setCurrent(BigDecimal.ZERO);
        } else {
            inverter12.setCurrent(modelInverter.getPv12I().getValue());
        }
        inverter12.setName("PV12");
        list.add(inverter12);

        //pv13
        InverterPvValueRespVO inverter13 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv3U() == null || modelInverter.getPv3U().getValue() == null) {
            inverter13.setVoltage(BigDecimal.ZERO);
        } else {
            inverter13.setVoltage(modelInverter.getPv3U().getValue());
        }
        //电流
        if (modelInverter.getPv13I() == null || modelInverter.getPv13I().getValue() == null) {
            inverter13.setCurrent(BigDecimal.ZERO);
        } else {
            inverter13.setCurrent(modelInverter.getPv13I().getValue());
        }
        inverter13.setName("PV13");
        list.add(inverter13);

        //pv14
        InverterPvValueRespVO inverter14 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv3U() == null || modelInverter.getPv3U().getValue() == null) {
            inverter14.setVoltage(BigDecimal.ZERO);
        } else {
            inverter14.setVoltage(modelInverter.getPv3U().getValue());
        }
        //电流
        if (modelInverter.getPv14I() == null || modelInverter.getPv14I().getValue() == null) {
            inverter14.setCurrent(BigDecimal.ZERO);
        } else {
            inverter14.setCurrent(modelInverter.getPv14I().getValue());
        }
        inverter14.setName("PV14");
        list.add(inverter14);

        //pv15
        InverterPvValueRespVO inverter15 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv3U() == null || modelInverter.getPv3U().getValue() == null) {
            inverter15.setVoltage(BigDecimal.ZERO);
        } else {
            inverter15.setVoltage(modelInverter.getPv3U().getValue());
        }
        //电流
        if (modelInverter.getPv15I() == null || modelInverter.getPv15I().getValue() == null) {
            inverter15.setCurrent(BigDecimal.ZERO);
        } else {
            inverter15.setCurrent(modelInverter.getPv15I().getValue());
        }
        inverter15.setName("PV15");
        list.add(inverter15);

        //pv16
        InverterPvValueRespVO inverter16 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv4U() == null || modelInverter.getPv4U().getValue() == null) {
            inverter16.setVoltage(BigDecimal.ZERO);
        } else {
            inverter16.setVoltage(modelInverter.getPv4U().getValue());
        }
        //电流
        if (modelInverter.getPv16I() == null || modelInverter.getPv16I().getValue() == null) {
            inverter16.setCurrent(BigDecimal.ZERO);
        } else {
            inverter16.setCurrent(modelInverter.getPv16I().getValue());
        }
        inverter16.setName("PV16");
        list.add(inverter16);

        //pv17
        InverterPvValueRespVO inverter17 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv4U() == null || modelInverter.getPv4U().getValue() == null) {
            inverter17.setVoltage(BigDecimal.ZERO);
        } else {
            inverter17.setVoltage(modelInverter.getPv4U().getValue());
        }
        //电流
        if (modelInverter.getPv17I() == null || modelInverter.getPv17I().getValue() == null) {
            inverter17.setCurrent(BigDecimal.ZERO);
        } else {
            inverter17.setCurrent(modelInverter.getPv17I().getValue());
        }
        inverter17.setName("PV17");
        list.add(inverter17);

        //pv18
        InverterPvValueRespVO inverter18 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv4U() == null || modelInverter.getPv4U().getValue() == null) {
            inverter18.setVoltage(BigDecimal.ZERO);
        } else {
            inverter18.setVoltage(modelInverter.getPv4U().getValue());
        }
        //电流
        if (modelInverter.getPv18I() == null || modelInverter.getPv18I().getValue() == null) {
            inverter18.setCurrent(BigDecimal.ZERO);
        } else {
            inverter18.setCurrent(modelInverter.getPv18I().getValue());
        }
        inverter18.setName("PV18");
        list.add(inverter18);
        //pv19
        InverterPvValueRespVO inverter19 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv4U() == null || modelInverter.getPv4U().getValue() == null) {
            inverter19.setVoltage(BigDecimal.ZERO);
        } else {
            inverter19.setVoltage(modelInverter.getPv4U().getValue());
        }
        //电流
        if (modelInverter.getPv19I() == null || modelInverter.getPv19I().getValue() == null) {
            inverter19.setCurrent(BigDecimal.ZERO);
        } else {
            inverter19.setCurrent(modelInverter.getPv19I().getValue());
        }
        inverter19.setName("PV19");
        list.add(inverter19);

        //pv20
        InverterPvValueRespVO inverter20 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv4U() == null || modelInverter.getPv4U().getValue() == null) {
            inverter20.setVoltage(BigDecimal.ZERO);
        } else {
            inverter20.setVoltage(modelInverter.getPv4U().getValue());
        }
        //电流
        if (modelInverter.getPv20I() == null || modelInverter.getPv20I().getValue() == null) {
            inverter20.setCurrent(BigDecimal.ZERO);
        } else {
            inverter20.setCurrent(modelInverter.getPv20I().getValue());
        }
        inverter20.setName("PV20");
        list.add(inverter20);

        return list;
    }

    @Override
    //禾望逆变器不存在时的处理方法
    public List<InverterPvValueRespVO> copeNotExistHw() {
        List<InverterPvValueRespVO> list = new ArrayList<>();
        InverterPvValueRespVO inverter1 = new InverterPvValueRespVO();
        inverter1.setName("PV1");
        inverter1.setVoltage(BigDecimal.ZERO);
        inverter1.setCurrent(BigDecimal.ZERO);
        list.add(inverter1);
        InverterPvValueRespVO inverter2 = new InverterPvValueRespVO();
        inverter2.setName("PV2");
        inverter2.setVoltage(BigDecimal.ZERO);
        inverter2.setCurrent(BigDecimal.ZERO);
        list.add(inverter2);
        InverterPvValueRespVO inverter3 = new InverterPvValueRespVO();
        inverter3.setName("PV3");
        inverter3.setVoltage(BigDecimal.ZERO);
        inverter3.setCurrent(BigDecimal.ZERO);
        list.add(inverter3);
        InverterPvValueRespVO inverter4 = new InverterPvValueRespVO();
        inverter4.setName("PV4");
        inverter4.setVoltage(BigDecimal.ZERO);
        inverter4.setCurrent(BigDecimal.ZERO);
        list.add(inverter4);
        InverterPvValueRespVO inverter5 = new InverterPvValueRespVO();
        inverter5.setName("PV5");
        inverter5.setVoltage(BigDecimal.ZERO);
        inverter5.setCurrent(BigDecimal.ZERO);
        list.add(inverter5);

        InverterPvValueRespVO inverter6 = new InverterPvValueRespVO();
        inverter6.setName("PV6");
        inverter6.setVoltage(BigDecimal.ZERO);
        inverter6.setCurrent(BigDecimal.ZERO);
        list.add(inverter6);
        InverterPvValueRespVO inverter7 = new InverterPvValueRespVO();
        inverter7.setName("PV7");
        inverter7.setVoltage(BigDecimal.ZERO);
        inverter7.setCurrent(BigDecimal.ZERO);
        list.add(inverter7);
        InverterPvValueRespVO inverter8 = new InverterPvValueRespVO();
        inverter8.setName("PV8");
        inverter8.setVoltage(BigDecimal.ZERO);
        inverter8.setCurrent(BigDecimal.ZERO);
        list.add(inverter8);

        InverterPvValueRespVO inverter9 = new InverterPvValueRespVO();
        inverter9.setName("PV9");
        inverter9.setVoltage(BigDecimal.ZERO);
        inverter9.setCurrent(BigDecimal.ZERO);
        list.add(inverter9);
        InverterPvValueRespVO inverter10 = new InverterPvValueRespVO();
        inverter10.setName("PV10");
        inverter10.setVoltage(BigDecimal.ZERO);
        inverter10.setCurrent(BigDecimal.ZERO);
        list.add(inverter10);
        InverterPvValueRespVO inverter11 = new InverterPvValueRespVO();
        inverter11.setName("PV11");
        inverter11.setVoltage(BigDecimal.ZERO);
        inverter11.setCurrent(BigDecimal.ZERO);
        list.add(inverter11);
        InverterPvValueRespVO inverter12 = new InverterPvValueRespVO();
        inverter12.setName("PV12");
        inverter12.setVoltage(BigDecimal.ZERO);
        inverter12.setCurrent(BigDecimal.ZERO);
        list.add(inverter12);
        InverterPvValueRespVO inverter13 = new InverterPvValueRespVO();
        inverter13.setName("PV13");
        inverter13.setVoltage(BigDecimal.ZERO);
        inverter13.setCurrent(BigDecimal.ZERO);
        list.add(inverter13);
        InverterPvValueRespVO inverter14 = new InverterPvValueRespVO();
        inverter14.setName("PV14");
        inverter14.setVoltage(BigDecimal.ZERO);
        inverter14.setCurrent(BigDecimal.ZERO);
        list.add(inverter14);
        InverterPvValueRespVO inverter15 = new InverterPvValueRespVO();
        inverter15.setName("PV15");
        inverter15.setVoltage(BigDecimal.ZERO);
        inverter15.setCurrent(BigDecimal.ZERO);
        list.add(inverter15);
        InverterPvValueRespVO inverter16 = new InverterPvValueRespVO();
        inverter16.setName("PV16");
        inverter16.setVoltage(BigDecimal.ZERO);
        inverter16.setCurrent(BigDecimal.ZERO);
        list.add(inverter16);
        InverterPvValueRespVO inverter17 = new InverterPvValueRespVO();
        inverter17.setName("PV17");
        inverter17.setVoltage(BigDecimal.ZERO);
        inverter17.setCurrent(BigDecimal.ZERO);
        list.add(inverter17);
        InverterPvValueRespVO inverter18 = new InverterPvValueRespVO();
        inverter18.setName("PV18");
        inverter18.setVoltage(BigDecimal.ZERO);
        inverter18.setCurrent(BigDecimal.ZERO);
        list.add(inverter18);
        InverterPvValueRespVO inverter19 = new InverterPvValueRespVO();
        inverter19.setName("PV19");
        inverter19.setVoltage(BigDecimal.ZERO);
        inverter19.setCurrent(BigDecimal.ZERO);
        list.add(inverter19);
        InverterPvValueRespVO inverter20 = new InverterPvValueRespVO();
        inverter20.setName("PV20");
        inverter20.setVoltage(BigDecimal.ZERO);
        inverter20.setCurrent(BigDecimal.ZERO);
        list.add(inverter20);
        return list;
    }

    @Override
    //华为逆变器（一对一的关系 1-->1）
    public List<InverterPvValueRespVO> getInverterHuaWei(ModelNewInverter modelInverter) {
        //返回值
        List<InverterPvValueRespVO> huaWList = new ArrayList<>();
        //pv1
        InverterPvValueRespVO inverter1 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv1U() == null || modelInverter.getPv1U().getValue() == null) {
            inverter1.setVoltage(BigDecimal.ZERO);
        } else {
            inverter1.setVoltage(modelInverter.getPv1U().getValue());
        }
        //电流
        if (modelInverter.getPv1I() == null || modelInverter.getPv1I().getValue() == null) {
            inverter1.setCurrent(BigDecimal.ZERO);
        } else {
            inverter1.setCurrent(modelInverter.getPv1I().getValue());
        }
        inverter1.setName("PV1");
        huaWList.add(inverter1);

        //pv2
        InverterPvValueRespVO inverter2 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv2U() == null || modelInverter.getPv2U().getValue() == null) {
            inverter2.setVoltage(BigDecimal.ZERO);
        } else {
            inverter2.setVoltage(modelInverter.getPv2U().getValue());
        }
        //电流
        if (modelInverter.getPv2I() == null || modelInverter.getPv2I().getValue() == null) {
            inverter2.setCurrent(BigDecimal.ZERO);
        } else {
            inverter2.setCurrent(modelInverter.getPv2I().getValue());
        }
        inverter2.setName("PV2");
        huaWList.add(inverter2);

        //pv3
        InverterPvValueRespVO inverter3 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv3U() == null || modelInverter.getPv3U().getValue() == null) {
            inverter3.setVoltage(BigDecimal.ZERO);
        } else {
            inverter3.setVoltage(modelInverter.getPv3U().getValue());
        }
        //电流
        if (modelInverter.getPv3I() == null || modelInverter.getPv3I().getValue() == null) {
            inverter3.setCurrent(BigDecimal.ZERO);
        } else {
            inverter3.setCurrent(modelInverter.getPv3I().getValue());
        }
        inverter3.setName("PV3");
        huaWList.add(inverter3);

        //pv4
        InverterPvValueRespVO inverter4 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv4U() == null || modelInverter.getPv4U().getValue() == null) {
            inverter4.setVoltage(BigDecimal.ZERO);
        } else {
            inverter4.setVoltage(modelInverter.getPv4U().getValue());
        }
        //电流
        if (modelInverter.getPv4I() == null || modelInverter.getPv4I().getValue() == null) {
            inverter4.setCurrent(BigDecimal.ZERO);
        } else {
            inverter4.setCurrent(modelInverter.getPv4I().getValue());
        }
        inverter4.setName("PV4");
        huaWList.add(inverter4);

        //pv5
        InverterPvValueRespVO inverter5 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv5U() == null || modelInverter.getPv5U().getValue() == null) {
            inverter5.setVoltage(BigDecimal.ZERO);
        } else {
            inverter5.setVoltage(modelInverter.getPv5U().getValue());
        }
        //电流
        if (modelInverter.getPv5I() == null || modelInverter.getPv5I().getValue() == null) {
            inverter5.setCurrent(BigDecimal.ZERO);
        } else {
            inverter5.setCurrent(modelInverter.getPv5I().getValue());
        }
        inverter5.setName("PV5");
        huaWList.add(inverter5);

        //pv6
        InverterPvValueRespVO inverter6 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv6U() == null || modelInverter.getPv6U().getValue() == null) {
            inverter6.setVoltage(BigDecimal.ZERO);
        } else {
            inverter6.setVoltage(modelInverter.getPv6U().getValue());
        }
        //电流
        if (modelInverter.getPv6I() == null || modelInverter.getPv6I().getValue() == null) {
            inverter6.setCurrent(BigDecimal.ZERO);
        } else {
            inverter6.setCurrent(modelInverter.getPv6I().getValue());
        }
        inverter6.setName("PV6");
        huaWList.add(inverter6);

        //pv7
        InverterPvValueRespVO inverter7 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv7U() == null || modelInverter.getPv7U().getValue() == null) {
            inverter7.setVoltage(BigDecimal.ZERO);
        } else {
            inverter7.setVoltage(modelInverter.getPv7U().getValue());
        }
        //电流
        if (modelInverter.getPv7I() == null || modelInverter.getPv7I().getValue() == null) {
            inverter7.setCurrent(BigDecimal.ZERO);
        } else {
            inverter7.setCurrent(modelInverter.getPv7I().getValue());
        }
        inverter7.setName("PV7");
        huaWList.add(inverter7);

        //pv8
        InverterPvValueRespVO inverter8 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv8U() == null || modelInverter.getPv8U().getValue() == null) {
            inverter8.setVoltage(BigDecimal.ZERO);
        } else {
            inverter8.setVoltage(modelInverter.getPv8U().getValue());
        }
        //电流
        if (modelInverter.getPv8I() == null || modelInverter.getPv8I().getValue() == null) {
            inverter8.setCurrent(BigDecimal.ZERO);
        } else {
            inverter8.setCurrent(modelInverter.getPv8I().getValue());
        }
        inverter8.setName("PV8");
        huaWList.add(inverter8);

        //pv9
        InverterPvValueRespVO inverter9 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv9U() == null || modelInverter.getPv9U().getValue() == null) {
            inverter9.setVoltage(BigDecimal.ZERO);
        } else {
            inverter9.setVoltage(modelInverter.getPv9U().getValue());
        }
        //电流
        if (modelInverter.getPv9I() == null || modelInverter.getPv9I().getValue() == null) {
            inverter9.setCurrent(BigDecimal.ZERO);
        } else {
            inverter9.setCurrent(modelInverter.getPv9I().getValue());
        }
        inverter9.setName("PV9");
        huaWList.add(inverter9);

        //pv10
        InverterPvValueRespVO inverter10 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv10U() == null || modelInverter.getPv10U().getValue() == null) {
            inverter10.setVoltage(BigDecimal.ZERO);
        } else {
            inverter10.setVoltage(modelInverter.getPv10U().getValue());
        }
        //电流
        if (modelInverter.getPv10I() == null || modelInverter.getPv10I().getValue() == null) {
            inverter10.setCurrent(BigDecimal.ZERO);
        } else {
            inverter10.setCurrent(modelInverter.getPv10I().getValue());
        }
        inverter10.setName("PV10");
        huaWList.add(inverter10);

        //pv11
        InverterPvValueRespVO inverter11 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv11U() == null || modelInverter.getPv11U().getValue() == null) {
            inverter11.setVoltage(BigDecimal.ZERO);
        } else {
            inverter11.setVoltage(modelInverter.getPv11U().getValue());
        }
        //电流
        if (modelInverter.getPv11I() == null || modelInverter.getPv11I().getValue() == null) {
            inverter11.setCurrent(BigDecimal.ZERO);
        } else {
            inverter11.setCurrent(modelInverter.getPv11I().getValue());
        }
        inverter11.setName("PV11");
        huaWList.add(inverter11);

        //pv12
        InverterPvValueRespVO inverter12 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv12U() == null || modelInverter.getPv12U().getValue() == null) {
            inverter12.setVoltage(BigDecimal.ZERO);
        } else {
            inverter12.setVoltage(modelInverter.getPv12U().getValue());
        }
        //电流
        if (modelInverter.getPv12I() == null || modelInverter.getPv12I().getValue() == null) {
            inverter12.setCurrent(BigDecimal.ZERO);
        } else {
            inverter12.setCurrent(modelInverter.getPv12I().getValue());
        }
        inverter12.setName("PV12");
        huaWList.add(inverter12);
        //pv13
        InverterPvValueRespVO inverter13 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv13U() == null || modelInverter.getPv13U().getValue() == null) {
            inverter13.setVoltage(BigDecimal.ZERO);
        } else {
            inverter13.setVoltage(modelInverter.getPv13U().getValue());
        }
        //电流
        if (modelInverter.getPv13I() == null || modelInverter.getPv13I().getValue() == null) {
            inverter13.setCurrent(BigDecimal.ZERO);
        } else {
            inverter13.setCurrent(modelInverter.getPv13I().getValue());
        }
        inverter13.setName("PV13");
        huaWList.add(inverter13);

        //pv14
        InverterPvValueRespVO inverter14 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv14U() == null || modelInverter.getPv14U().getValue() == null) {
            inverter14.setVoltage(BigDecimal.ZERO);
        } else {
            inverter14.setVoltage(modelInverter.getPv14U().getValue());
        }
        //电流
        if (modelInverter.getPv14I() == null || modelInverter.getPv14I().getValue() == null) {
            inverter14.setCurrent(BigDecimal.ZERO);
        } else {
            inverter14.setCurrent(modelInverter.getPv14I().getValue());
        }
        inverter14.setName("PV14");
        huaWList.add(inverter14);

        //pv15
        InverterPvValueRespVO inverter15 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv15U() == null || modelInverter.getPv15U().getValue() == null) {
            inverter15.setVoltage(BigDecimal.ZERO);
        } else {
            inverter15.setVoltage(modelInverter.getPv15U().getValue());
        }
        //电流
        if (modelInverter.getPv15I() == null || modelInverter.getPv15I().getValue() == null) {
            inverter15.setCurrent(BigDecimal.ZERO);
        } else {
            inverter15.setCurrent(modelInverter.getPv15I().getValue());
        }
        inverter15.setName("PV15");
        huaWList.add(inverter15);

        //pv16
        InverterPvValueRespVO inverter16 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv16U() == null || modelInverter.getPv16U().getValue() == null) {
            inverter16.setVoltage(BigDecimal.ZERO);
        } else {
            inverter16.setVoltage(modelInverter.getPv16U().getValue());
        }
        //电流
        if (modelInverter.getPv16I() == null || modelInverter.getPv16I().getValue() == null) {
            inverter16.setCurrent(BigDecimal.ZERO);
        } else {
            inverter16.setCurrent(modelInverter.getPv16I().getValue());
        }
        inverter16.setName("PV16");
        huaWList.add(inverter16);

        //pv17
        InverterPvValueRespVO inverter17 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv17U() == null || modelInverter.getPv17U().getValue() == null) {
            inverter17.setVoltage(BigDecimal.ZERO);
        } else {
            inverter17.setVoltage(modelInverter.getPv17U().getValue());
        }
        //电流
        if (modelInverter.getPv17I() == null || modelInverter.getPv17I().getValue() == null) {
            inverter17.setCurrent(BigDecimal.ZERO);
        } else {
            inverter17.setCurrent(modelInverter.getPv17I().getValue());
        }
        inverter17.setName("PV17");
        huaWList.add(inverter17);

        //pv18
        InverterPvValueRespVO inverter18 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv18U() == null || modelInverter.getPv18U().getValue() == null) {
            inverter18.setVoltage(BigDecimal.ZERO);
        } else {
            inverter18.setVoltage(modelInverter.getPv18U().getValue());
        }
        //电流
        if (modelInverter.getPv18I() == null || modelInverter.getPv18I().getValue() == null) {
            inverter18.setCurrent(BigDecimal.ZERO);
        } else {
            inverter18.setCurrent(modelInverter.getPv18I().getValue());
        }
        inverter18.setName("PV18");
        huaWList.add(inverter18);

        //pv19
        InverterPvValueRespVO inverter19 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv19U() == null || modelInverter.getPv19U().getValue() == null) {
            inverter19.setVoltage(BigDecimal.ZERO);
        } else {
            inverter19.setVoltage(modelInverter.getPv19U().getValue());
        }
        //电流
        if (modelInverter.getPv19I() == null || modelInverter.getPv19I().getValue() == null) {
            inverter19.setCurrent(BigDecimal.ZERO);
        } else {
            inverter19.setCurrent(modelInverter.getPv19I().getValue());
        }
        inverter19.setName("PV19");
        huaWList.add(inverter19);

        //pv20
        InverterPvValueRespVO inverter20 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv20U() == null || modelInverter.getPv20U().getValue() == null) {
            inverter20.setVoltage(BigDecimal.ZERO);
        } else {
            inverter20.setVoltage(modelInverter.getPv20U().getValue());
        }
        //电流
        if (modelInverter.getPv20I() == null || modelInverter.getPv20I().getValue() == null) {
            inverter20.setCurrent(BigDecimal.ZERO);
        } else {
            inverter20.setCurrent(modelInverter.getPv20I().getValue());
        }
        inverter20.setName("PV20");
        huaWList.add(inverter20);
        return huaWList;
    }

    @Override
    //华为逆变器不存在时的处理方法
    public List<InverterPvValueRespVO> copeNotExistHuaWei() {
        List<InverterPvValueRespVO> list = new ArrayList<>();
        InverterPvValueRespVO inverter1 = new InverterPvValueRespVO();
        inverter1.setName("PV1");
        inverter1.setVoltage(BigDecimal.ZERO);
        inverter1.setCurrent(BigDecimal.ZERO);
        list.add(inverter1);
        InverterPvValueRespVO inverter2 = new InverterPvValueRespVO();
        inverter2.setName("PV2");
        inverter2.setVoltage(BigDecimal.ZERO);
        inverter2.setCurrent(BigDecimal.ZERO);
        list.add(inverter2);
        InverterPvValueRespVO inverter3 = new InverterPvValueRespVO();
        inverter3.setName("PV3");
        inverter3.setVoltage(BigDecimal.ZERO);
        inverter3.setCurrent(BigDecimal.ZERO);
        list.add(inverter3);
        InverterPvValueRespVO inverter4 = new InverterPvValueRespVO();
        inverter4.setName("PV4");
        inverter4.setVoltage(BigDecimal.ZERO);
        inverter4.setCurrent(BigDecimal.ZERO);
        list.add(inverter4);
        InverterPvValueRespVO inverter5 = new InverterPvValueRespVO();
        inverter5.setName("PV5");
        inverter5.setVoltage(BigDecimal.ZERO);
        inverter5.setCurrent(BigDecimal.ZERO);
        list.add(inverter5);
        InverterPvValueRespVO inverter6 = new InverterPvValueRespVO();
        inverter6.setName("PV6");
        inverter6.setVoltage(BigDecimal.ZERO);
        inverter6.setCurrent(BigDecimal.ZERO);
        list.add(inverter6);
        InverterPvValueRespVO inverter7 = new InverterPvValueRespVO();
        inverter7.setName("PV7");
        inverter7.setVoltage(BigDecimal.ZERO);
        inverter7.setCurrent(BigDecimal.ZERO);
        list.add(inverter7);
        InverterPvValueRespVO inverter8 = new InverterPvValueRespVO();
        inverter8.setName("PV8");
        inverter8.setVoltage(BigDecimal.ZERO);
        inverter8.setCurrent(BigDecimal.ZERO);
        list.add(inverter8);
        InverterPvValueRespVO inverter9 = new InverterPvValueRespVO();
        inverter9.setName("PV9");
        inverter9.setVoltage(BigDecimal.ZERO);
        inverter9.setCurrent(BigDecimal.ZERO);
        list.add(inverter9);
        InverterPvValueRespVO inverter10 = new InverterPvValueRespVO();
        inverter10.setName("PV10");
        inverter10.setVoltage(BigDecimal.ZERO);
        inverter10.setCurrent(BigDecimal.ZERO);
        list.add(inverter10);
        InverterPvValueRespVO inverter11 = new InverterPvValueRespVO();
        inverter11.setName("PV11");
        inverter11.setVoltage(BigDecimal.ZERO);
        inverter11.setCurrent(BigDecimal.ZERO);
        list.add(inverter11);
        InverterPvValueRespVO inverter12 = new InverterPvValueRespVO();
        inverter12.setName("PV12");
        inverter12.setVoltage(BigDecimal.ZERO);
        inverter12.setCurrent(BigDecimal.ZERO);
        list.add(inverter12);
        InverterPvValueRespVO inverter13 = new InverterPvValueRespVO();
        inverter13.setName("PV13");
        inverter13.setVoltage(BigDecimal.ZERO);
        inverter13.setCurrent(BigDecimal.ZERO);
        list.add(inverter13);
        InverterPvValueRespVO inverter14 = new InverterPvValueRespVO();
        inverter14.setName("PV14");
        inverter14.setVoltage(BigDecimal.ZERO);
        inverter14.setCurrent(BigDecimal.ZERO);
        list.add(inverter14);
        InverterPvValueRespVO inverter15 = new InverterPvValueRespVO();
        inverter15.setName("PV15");
        inverter15.setVoltage(BigDecimal.ZERO);
        inverter15.setCurrent(BigDecimal.ZERO);
        list.add(inverter15);

        InverterPvValueRespVO inverter16 = new InverterPvValueRespVO();
        inverter16.setName("PV16");
        inverter16.setVoltage(BigDecimal.ZERO);
        inverter16.setCurrent(BigDecimal.ZERO);
        list.add(inverter16);
        InverterPvValueRespVO inverter17 = new InverterPvValueRespVO();
        inverter17.setName("PV17");
        inverter17.setVoltage(BigDecimal.ZERO);
        inverter17.setCurrent(BigDecimal.ZERO);
        list.add(inverter17);
        InverterPvValueRespVO inverter18 = new InverterPvValueRespVO();
        inverter18.setName("PV18");
        inverter18.setVoltage(BigDecimal.ZERO);
        inverter18.setCurrent(BigDecimal.ZERO);
        list.add(inverter18);

        InverterPvValueRespVO inverter19 = new InverterPvValueRespVO();
        inverter19.setName("PV19");
        inverter19.setVoltage(BigDecimal.ZERO);
        inverter19.setCurrent(BigDecimal.ZERO);
        list.add(inverter19);

        InverterPvValueRespVO inverter20 = new InverterPvValueRespVO();
        inverter20.setName("PV20");
        inverter20.setVoltage(BigDecimal.ZERO);
        inverter20.setCurrent(BigDecimal.ZERO);
        list.add(inverter20);
        return list;
    }

    @Override
    //阳光逆变器（一对一）
    public List<InverterPvValueRespVO> getInverterYG(ModelNewInverter modelInverter) {
        //返回值
        List<InverterPvValueRespVO> list = new ArrayList<>();
        //pv1
        InverterPvValueRespVO inverter1 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv1U() == null || modelInverter.getPv1U().getValue() == null) {
            inverter1.setVoltage(BigDecimal.ZERO);
        } else {
            inverter1.setVoltage(modelInverter.getPv1U().getValue());
        }
        //电流
        if (modelInverter.getPv1I() == null || modelInverter.getPv1I().getValue() == null) {
            inverter1.setCurrent(BigDecimal.ZERO);
        } else {
            inverter1.setCurrent(modelInverter.getPv1I().getValue());
        }
        inverter1.setName("PV1");
        list.add(inverter1);

        //pv2
        InverterPvValueRespVO inverter2 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv2U() == null || modelInverter.getPv2U().getValue() == null) {
            inverter2.setVoltage(BigDecimal.ZERO);
        } else {
            inverter2.setVoltage(modelInverter.getPv2U().getValue());
        }
        //电流
        if (modelInverter.getPv2I() == null || modelInverter.getPv2I().getValue() == null) {
            inverter2.setCurrent(BigDecimal.ZERO);
        } else {
            inverter2.setCurrent(modelInverter.getPv2I().getValue());
        }
        inverter2.setName("PV2");
        list.add(inverter2);

        //pv3
        InverterPvValueRespVO inverter3 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv3U() == null || modelInverter.getPv3U().getValue() == null) {
            inverter3.setVoltage(BigDecimal.ZERO);
        } else {
            inverter3.setVoltage(modelInverter.getPv3U().getValue());
        }
        //电流
        if (modelInverter.getPv3I() == null || modelInverter.getPv3I().getValue() == null) {
            inverter3.setCurrent(BigDecimal.ZERO);
        } else {
            inverter3.setCurrent(modelInverter.getPv3I().getValue());
        }
        inverter3.setName("PV3");
        list.add(inverter3);

        //pv4
        InverterPvValueRespVO inverter4 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv4U() == null || modelInverter.getPv4U().getValue() == null) {
            inverter4.setVoltage(BigDecimal.ZERO);
        } else {
            inverter4.setVoltage(modelInverter.getPv4U().getValue());
        }
        //电流
        if (modelInverter.getPv4I() == null || modelInverter.getPv4I().getValue() == null) {
            inverter4.setCurrent(BigDecimal.ZERO);
        } else {
            inverter4.setCurrent(modelInverter.getPv4I().getValue());
        }
        inverter4.setName("PV4");
        list.add(inverter4);
        //pv5
        InverterPvValueRespVO inverter5 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv5U() == null || modelInverter.getPv5U().getValue() == null) {
            inverter5.setVoltage(BigDecimal.ZERO);
        } else {
            inverter5.setVoltage(modelInverter.getPv5U().getValue());
        }
        //电流
        if (modelInverter.getPv5I() == null || modelInverter.getPv5I().getValue() == null) {
            inverter5.setCurrent(BigDecimal.ZERO);
        } else {
            inverter5.setCurrent(modelInverter.getPv5I().getValue());
        }
        inverter5.setName("PV5");
        list.add(inverter5);

        //pv6
        InverterPvValueRespVO inverter6 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv6U() == null || modelInverter.getPv6U().getValue() == null) {
            inverter6.setVoltage(BigDecimal.ZERO);
        } else {
            inverter6.setVoltage(modelInverter.getPv6U().getValue());
        }
        //电流
        if (modelInverter.getPv6I() == null || modelInverter.getPv6I().getValue() == null) {
            inverter6.setCurrent(BigDecimal.ZERO);
        } else {
            inverter6.setCurrent(modelInverter.getPv6I().getValue());
        }
        inverter6.setName("PV6");
        list.add(inverter6);

        //pv7
        InverterPvValueRespVO inverter7 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv7U() == null || modelInverter.getPv7U().getValue() == null) {
            inverter7.setVoltage(BigDecimal.ZERO);
        } else {
            inverter7.setVoltage(modelInverter.getPv7U().getValue());
        }
        //电流
        if (modelInverter.getPv7I() == null || modelInverter.getPv7I().getValue() == null) {
            inverter7.setCurrent(BigDecimal.ZERO);
        } else {
            inverter7.setCurrent(modelInverter.getPv7I().getValue());
        }
        inverter7.setName("PV7");
        list.add(inverter7);

        //pv8
        InverterPvValueRespVO inverter8 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv8U() == null || modelInverter.getPv8U().getValue() == null) {
            inverter8.setVoltage(BigDecimal.ZERO);
        } else {
            inverter8.setVoltage(modelInverter.getPv8U().getValue());
        }
        //电流
        if (modelInverter.getPv8I() == null || modelInverter.getPv8I().getValue() == null) {
            inverter8.setCurrent(BigDecimal.ZERO);
        } else {
            inverter8.setCurrent(modelInverter.getPv8I().getValue());
        }
        inverter8.setName("PV8");
        list.add(inverter8);

        //pv9
        InverterPvValueRespVO inverter9 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv9U() == null || modelInverter.getPv9U().getValue() == null) {
            inverter9.setVoltage(BigDecimal.ZERO);
        } else {
            inverter9.setVoltage(modelInverter.getPv9U().getValue());
        }
        //电流
        if (modelInverter.getPv9I() == null || modelInverter.getPv9I().getValue() == null) {
            inverter9.setCurrent(BigDecimal.ZERO);
        } else {
            inverter9.setCurrent(modelInverter.getPv9I().getValue());
        }
        inverter9.setName("PV9");
        list.add(inverter9);

        //pv10
        InverterPvValueRespVO inverter10 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv10U() == null || modelInverter.getPv10U().getValue() == null) {
            inverter10.setVoltage(BigDecimal.ZERO);
        } else {
            inverter10.setVoltage(modelInverter.getPv10U().getValue());
        }
        //电流
        if (modelInverter.getPv10I() == null || modelInverter.getPv10I().getValue() == null) {
            inverter10.setCurrent(BigDecimal.ZERO);
        } else {
            inverter10.setCurrent(modelInverter.getPv10I().getValue());
        }
        inverter10.setName("PV10");
        list.add(inverter10);
        //pv11
        InverterPvValueRespVO inverter11 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv11U() == null || modelInverter.getPv11U().getValue() == null) {
            inverter11.setVoltage(BigDecimal.ZERO);
        } else {
            inverter11.setVoltage(modelInverter.getPv11U().getValue());
        }
        //电流
        if (modelInverter.getPv11I() == null || modelInverter.getPv11I().getValue() == null) {
            inverter11.setCurrent(BigDecimal.ZERO);
        } else {
            inverter11.setCurrent(modelInverter.getPv11I().getValue());
        }
        inverter11.setName("PV11");
        list.add(inverter11);

        //pv12
        InverterPvValueRespVO inverter12 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv12U() == null || modelInverter.getPv12U().getValue() == null) {
            inverter12.setVoltage(BigDecimal.ZERO);
        } else {
            inverter12.setVoltage(modelInverter.getPv12U().getValue());
        }
        //电流
        if (modelInverter.getPv12I() == null || modelInverter.getPv12I().getValue() == null) {
            inverter12.setCurrent(BigDecimal.ZERO);
        } else {
            inverter12.setCurrent(modelInverter.getPv12I().getValue());
        }
        inverter12.setName("PV12");
        list.add(inverter12);

        //pv13
        InverterPvValueRespVO inverter13 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv13U() == null || modelInverter.getPv13U().getValue() == null) {
            inverter13.setVoltage(BigDecimal.ZERO);
        } else {
            inverter13.setVoltage(modelInverter.getPv13U().getValue());
        }
        //电流
        if (modelInverter.getPv13I() == null || modelInverter.getPv13I().getValue() == null) {
            inverter13.setCurrent(BigDecimal.ZERO);
        } else {
            inverter13.setCurrent(modelInverter.getPv13I().getValue());
        }
        inverter13.setName("PV13");
        list.add(inverter13);

        //pv14
        InverterPvValueRespVO inverter14 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv14U() == null || modelInverter.getPv14U().getValue() == null) {
            inverter14.setVoltage(BigDecimal.ZERO);
        } else {
            inverter14.setVoltage(modelInverter.getPv14U().getValue());
        }
        //电流
        if (modelInverter.getPv14I() == null || modelInverter.getPv14I().getValue() == null) {
            inverter14.setCurrent(BigDecimal.ZERO);
        } else {
            inverter14.setCurrent(modelInverter.getPv14I().getValue());
        }
        inverter14.setName("PV14");
        list.add(inverter14);

        //pv15
        InverterPvValueRespVO inverter15 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv15U() == null || modelInverter.getPv15U().getValue() == null) {
            inverter15.setVoltage(BigDecimal.ZERO);
        } else {
            inverter15.setVoltage(modelInverter.getPv15U().getValue());
        }
        //电流
        if (modelInverter.getPv15I() == null || modelInverter.getPv15I().getValue() == null) {
            inverter15.setCurrent(BigDecimal.ZERO);
        } else {
            inverter15.setCurrent(modelInverter.getPv15I().getValue());
        }
        inverter15.setName("PV15");
        list.add(inverter15);

        //pv16
        InverterPvValueRespVO inverter16 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv16U() == null || modelInverter.getPv16U().getValue() == null) {
            inverter16.setVoltage(BigDecimal.ZERO);
        } else {
            inverter16.setVoltage(modelInverter.getPv16U().getValue());
        }
        //电流
        if (modelInverter.getPv16I() == null || modelInverter.getPv16I().getValue() == null) {
            inverter16.setCurrent(BigDecimal.ZERO);
        } else {
            inverter16.setCurrent(modelInverter.getPv16I().getValue());
        }
        inverter16.setName("PV16");
        list.add(inverter16);
        return list;
    }

    @Override
    //阳光逆变器不存在时的处理方法
    public List<InverterPvValueRespVO> copeNotExistYG() {
        List<InverterPvValueRespVO> list = new ArrayList<>();
        InverterPvValueRespVO inverter1 = new InverterPvValueRespVO();
        inverter1.setName("PV1");
        inverter1.setVoltage(BigDecimal.ZERO);
        inverter1.setCurrent(BigDecimal.ZERO);
        list.add(inverter1);
        InverterPvValueRespVO inverter2 = new InverterPvValueRespVO();
        inverter2.setName("PV2");
        inverter2.setVoltage(BigDecimal.ZERO);
        inverter2.setCurrent(BigDecimal.ZERO);
        list.add(inverter2);
        InverterPvValueRespVO inverter3 = new InverterPvValueRespVO();
        inverter3.setName("PV3");
        inverter3.setVoltage(BigDecimal.ZERO);
        inverter3.setCurrent(BigDecimal.ZERO);
        list.add(inverter3);
        InverterPvValueRespVO inverter4 = new InverterPvValueRespVO();
        inverter4.setName("PV4");
        inverter4.setVoltage(BigDecimal.ZERO);
        inverter4.setCurrent(BigDecimal.ZERO);
        list.add(inverter4);
        InverterPvValueRespVO inverter5 = new InverterPvValueRespVO();
        inverter5.setName("PV5");
        inverter5.setVoltage(BigDecimal.ZERO);
        inverter5.setCurrent(BigDecimal.ZERO);
        list.add(inverter5);

        InverterPvValueRespVO inverter6 = new InverterPvValueRespVO();
        inverter6.setName("PV6");
        inverter6.setVoltage(BigDecimal.ZERO);
        inverter6.setCurrent(BigDecimal.ZERO);
        list.add(inverter6);
        InverterPvValueRespVO inverter7 = new InverterPvValueRespVO();
        inverter7.setName("PV7");
        inverter7.setVoltage(BigDecimal.ZERO);
        inverter7.setCurrent(BigDecimal.ZERO);
        list.add(inverter7);
        InverterPvValueRespVO inverter8 = new InverterPvValueRespVO();
        inverter8.setName("PV8");
        inverter8.setVoltage(BigDecimal.ZERO);
        inverter8.setCurrent(BigDecimal.ZERO);
        list.add(inverter8);

        InverterPvValueRespVO inverter9 = new InverterPvValueRespVO();
        inverter9.setName("PV9");
        inverter9.setVoltage(BigDecimal.ZERO);
        inverter9.setCurrent(BigDecimal.ZERO);
        list.add(inverter9);
        InverterPvValueRespVO inverter10 = new InverterPvValueRespVO();
        inverter10.setName("PV10");
        inverter10.setVoltage(BigDecimal.ZERO);
        inverter10.setCurrent(BigDecimal.ZERO);
        list.add(inverter10);
        InverterPvValueRespVO inverter11 = new InverterPvValueRespVO();
        inverter11.setName("PV11");
        inverter11.setVoltage(BigDecimal.ZERO);
        inverter11.setCurrent(BigDecimal.ZERO);
        list.add(inverter11);
        InverterPvValueRespVO inverter12 = new InverterPvValueRespVO();
        inverter12.setName("PV12");
        inverter12.setVoltage(BigDecimal.ZERO);
        inverter12.setCurrent(BigDecimal.ZERO);
        list.add(inverter12);
        InverterPvValueRespVO inverter13 = new InverterPvValueRespVO();
        inverter13.setName("PV13");
        inverter13.setVoltage(BigDecimal.ZERO);
        inverter13.setCurrent(BigDecimal.ZERO);
        list.add(inverter13);
        InverterPvValueRespVO inverter14 = new InverterPvValueRespVO();
        inverter14.setName("PV14");
        inverter14.setVoltage(BigDecimal.ZERO);
        inverter14.setCurrent(BigDecimal.ZERO);
        list.add(inverter14);
        InverterPvValueRespVO inverter15 = new InverterPvValueRespVO();
        inverter15.setName("PV15");
        inverter15.setVoltage(BigDecimal.ZERO);
        inverter15.setCurrent(BigDecimal.ZERO);
        list.add(inverter15);
        InverterPvValueRespVO inverter16 = new InverterPvValueRespVO();
        inverter16.setName("PV16");
        inverter16.setVoltage(BigDecimal.ZERO);
        inverter16.setCurrent(BigDecimal.ZERO);
        list.add(inverter16);
        return list;
    }

    @Override
    //固德威逆变器（一对一）
    public List<InverterPvValueRespVO> getInverterGdw(ModelNewInverter modelInverter) {
        //返回值
        List<InverterPvValueRespVO> list = new ArrayList<>();
        //pv1
        InverterPvValueRespVO inverter1 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv1U() == null || modelInverter.getPv1U().getValue() == null) {
            inverter1.setVoltage(BigDecimal.ZERO);
        } else {
            inverter1.setVoltage(modelInverter.getPv1U().getValue());
        }
        //电流
        if (modelInverter.getPv1I() == null || modelInverter.getPv1I().getValue() == null) {
            inverter1.setCurrent(BigDecimal.ZERO);
        } else {
            inverter1.setCurrent(modelInverter.getPv1I().getValue());
        }
        inverter1.setName("PV1");
        list.add(inverter1);

        //pv2
        InverterPvValueRespVO inverter2 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv2U() == null || modelInverter.getPv2U().getValue() == null) {
            inverter2.setVoltage(BigDecimal.ZERO);
        } else {
            inverter2.setVoltage(modelInverter.getPv2U().getValue());
        }
        //电流
        if (modelInverter.getPv2I() == null || modelInverter.getPv2I().getValue() == null) {
            inverter2.setCurrent(BigDecimal.ZERO);
        } else {
            inverter2.setCurrent(modelInverter.getPv2I().getValue());
        }
        inverter2.setName("PV2");
        list.add(inverter2);

        //pv3
        InverterPvValueRespVO inverter3 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv3U() == null || modelInverter.getPv3U().getValue() == null) {
            inverter3.setVoltage(BigDecimal.ZERO);
        } else {
            inverter3.setVoltage(modelInverter.getPv3U().getValue());
        }
        //电流
        if (modelInverter.getPv3I() == null || modelInverter.getPv3I().getValue() == null) {
            inverter3.setCurrent(BigDecimal.ZERO);
        } else {
            inverter3.setCurrent(modelInverter.getPv3I().getValue());
        }
        inverter3.setName("PV3");
        list.add(inverter3);

        //pv4
        InverterPvValueRespVO inverter4 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv4U() == null || modelInverter.getPv4U().getValue() == null) {
            inverter4.setVoltage(BigDecimal.ZERO);
        } else {
            inverter4.setVoltage(modelInverter.getPv4U().getValue());
        }
        //电流
        if (modelInverter.getPv4I() == null || modelInverter.getPv4I().getValue() == null) {
            inverter4.setCurrent(BigDecimal.ZERO);
        } else {
            inverter4.setCurrent(modelInverter.getPv4I().getValue());
        }
        inverter4.setName("PV4");
        list.add(inverter4);
        //pv5
        InverterPvValueRespVO inverter5 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv5U() == null || modelInverter.getPv5U().getValue() == null) {
            inverter5.setVoltage(BigDecimal.ZERO);
        } else {
            inverter5.setVoltage(modelInverter.getPv5U().getValue());
        }
        //电流
        if (modelInverter.getPv5I() == null || modelInverter.getPv5I().getValue() == null) {
            inverter5.setCurrent(BigDecimal.ZERO);
        } else {
            inverter5.setCurrent(modelInverter.getPv5I().getValue());
        }
        inverter5.setName("PV5");
        list.add(inverter5);

        //pv6
        InverterPvValueRespVO inverter6 = new InverterPvValueRespVO();
        //电压
        if (modelInverter.getPv6U() == null || modelInverter.getPv6U().getValue() == null) {
            inverter6.setVoltage(BigDecimal.ZERO);
        } else {
            inverter6.setVoltage(modelInverter.getPv6U().getValue());
        }
        //电流
        if (modelInverter.getPv6I() == null || modelInverter.getPv6I().getValue() == null) {
            inverter6.setCurrent(BigDecimal.ZERO);
        } else {
            inverter6.setCurrent(modelInverter.getPv6I().getValue());
        }
        inverter6.setName("PV6");
        list.add(inverter6);
        return list;
    }

    @Override
    //固德威逆变器不存在时的处理方法
    public List<InverterPvValueRespVO> copeNotExistGdw() {
        List<InverterPvValueRespVO> list = new ArrayList<>();
        InverterPvValueRespVO inverter1 = new InverterPvValueRespVO();
        inverter1.setName("PV1");
        inverter1.setVoltage(BigDecimal.ZERO);
        inverter1.setCurrent(BigDecimal.ZERO);
        list.add(inverter1);
        InverterPvValueRespVO inverter2 = new InverterPvValueRespVO();
        inverter2.setName("PV2");
        inverter2.setVoltage(BigDecimal.ZERO);
        inverter2.setCurrent(BigDecimal.ZERO);
        list.add(inverter2);
        InverterPvValueRespVO inverter3 = new InverterPvValueRespVO();
        inverter3.setName("PV3");
        inverter3.setVoltage(BigDecimal.ZERO);
        inverter3.setCurrent(BigDecimal.ZERO);
        list.add(inverter3);
        InverterPvValueRespVO inverter4 = new InverterPvValueRespVO();
        inverter4.setName("PV4");
        inverter4.setVoltage(BigDecimal.ZERO);
        inverter4.setCurrent(BigDecimal.ZERO);
        list.add(inverter4);
        InverterPvValueRespVO inverter5 = new InverterPvValueRespVO();
        inverter5.setName("PV5");
        inverter5.setVoltage(BigDecimal.ZERO);
        inverter5.setCurrent(BigDecimal.ZERO);
        list.add(inverter5);

        InverterPvValueRespVO inverter6 = new InverterPvValueRespVO();
        inverter6.setName("PV6");
        inverter6.setVoltage(BigDecimal.ZERO);
        inverter6.setCurrent(BigDecimal.ZERO);
        list.add(inverter6);
        return list;
    }
}
