package com.casic.PgInterface.devTable.dto;

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

public class PgDeviceTypeStaticClassify {

    private String devType;
    private int num;
    private List<PgDeviceTypeStatisticDto> pgDeviceTypeStatisticDtoList;

    public String getDevType() {
        return devType;
    }

    public void setDevType(String devType) {
        this.devType = devType;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public List<PgDeviceTypeStatisticDto> getPgDeviceTypeStatisticDtoList() {
        return pgDeviceTypeStatisticDtoList;
    }

    public void setPgDeviceTypeStatisticDtoList(List<PgDeviceTypeStatisticDto> pgDeviceTypeStatisticDtoList) {
        this.pgDeviceTypeStatisticDtoList = pgDeviceTypeStatisticDtoList;
    }

    public static List<PgDeviceTypeStaticClassify> getDeviceTypeStativClassify(List<PgDeviceTypeStatisticDto> pgDeviceTypeStatisticDtoList){

        List<PgDeviceTypeStaticClassify> pgDeviceTypeStaticClassifyList=getStaticClassifyList();

        for(PgDeviceTypeStatisticDto pgDeviceTypeStatisticDto:pgDeviceTypeStatisticDtoList){
            switch(pgDeviceTypeStatisticDto.getDevType())
            {
                case "潜污泵控制箱（单泵）":
                    pgDeviceTypeStaticClassifyList.get(0).pgDeviceTypeStatisticDtoList.add(pgDeviceTypeStatisticDto);
                    break;
                case "潜污泵控制箱（双泵）":
                    pgDeviceTypeStaticClassifyList.get(0).pgDeviceTypeStatisticDtoList.add(pgDeviceTypeStatisticDto);
                    break;
                case "电力井盖":
                    pgDeviceTypeStaticClassifyList.get(0).pgDeviceTypeStatisticDtoList.add(pgDeviceTypeStatisticDto);
                    break;
                case "配电柜":
                    pgDeviceTypeStaticClassifyList.get(0).pgDeviceTypeStatisticDtoList.add(pgDeviceTypeStatisticDto);
                    break;
                case "风机":
                    pgDeviceTypeStaticClassifyList.get(0).pgDeviceTypeStatisticDtoList.add(pgDeviceTypeStatisticDto);
                    break;
                case "普通荧光灯":
                    pgDeviceTypeStaticClassifyList.get(0).pgDeviceTypeStatisticDtoList.add(pgDeviceTypeStatisticDto);
                    break;
                case "液位开关":
                    pgDeviceTypeStaticClassifyList.get(0).pgDeviceTypeStatisticDtoList.add(pgDeviceTypeStatisticDto);
                    break;
                case "光纤电话主机":
                    pgDeviceTypeStaticClassifyList.get(1).pgDeviceTypeStatisticDtoList.add(pgDeviceTypeStatisticDto);
                    break;
                case "光纤电话分机":
                    pgDeviceTypeStaticClassifyList.get(1).pgDeviceTypeStatisticDtoList.add(pgDeviceTypeStatisticDto);
                    break;
                case "号角扬声器":
                    pgDeviceTypeStaticClassifyList.get(1).pgDeviceTypeStatisticDtoList.add(pgDeviceTypeStatisticDto);
                    break;
                case "球机":
                    pgDeviceTypeStaticClassifyList.get(2).pgDeviceTypeStatisticDtoList.add(pgDeviceTypeStatisticDto);
                    break;
                case "枪机":
                    pgDeviceTypeStaticClassifyList.get(2).pgDeviceTypeStatisticDtoList.add(pgDeviceTypeStatisticDto);
                    break;
                case "温湿度检测仪":
                    pgDeviceTypeStaticClassifyList.get(2).pgDeviceTypeStatisticDtoList.add(pgDeviceTypeStatisticDto);
                    break;
                case "硫化氢检测仪":
                    pgDeviceTypeStaticClassifyList.get(2).pgDeviceTypeStatisticDtoList.add(pgDeviceTypeStatisticDto);
                    break;
                case "一氧化碳检测仪":
                    pgDeviceTypeStaticClassifyList.get(2).pgDeviceTypeStatisticDtoList.add(pgDeviceTypeStatisticDto);
                    break;
                case "氧气检测仪":
                    pgDeviceTypeStaticClassifyList.get(2).pgDeviceTypeStatisticDtoList.add(pgDeviceTypeStatisticDto);
                    break;
                case "甲烷检测仪":
                    pgDeviceTypeStaticClassifyList.get(2).pgDeviceTypeStatisticDtoList.add(pgDeviceTypeStatisticDto);
                    break;
                case "红外对射":
                    pgDeviceTypeStaticClassifyList.get(2).pgDeviceTypeStatisticDtoList.add(pgDeviceTypeStatisticDto);
                    break;
                case "无线AP":
                    pgDeviceTypeStaticClassifyList.get(2).pgDeviceTypeStatisticDtoList.add(pgDeviceTypeStatisticDto);
                    break;
                case "气体灭火主机":
                    pgDeviceTypeStaticClassifyList.get(3).pgDeviceTypeStatisticDtoList.add(pgDeviceTypeStatisticDto);
                    break;
                case "烟感":
                    pgDeviceTypeStaticClassifyList.get(3).pgDeviceTypeStatisticDtoList.add(pgDeviceTypeStatisticDto);
                    break;
                case "紧急启动按钮":
                    pgDeviceTypeStaticClassifyList.get(3).pgDeviceTypeStatisticDtoList.add(pgDeviceTypeStatisticDto);
                    break;
                case "火灾报警主机":
                    pgDeviceTypeStaticClassifyList.get(3).pgDeviceTypeStatisticDtoList.add(pgDeviceTypeStatisticDto);
                    break;
                case "气体灭火输入模块":
                    pgDeviceTypeStaticClassifyList.get(3).pgDeviceTypeStatisticDtoList.add(pgDeviceTypeStatisticDto);
                    break;
                case "手动报警按钮":
                    pgDeviceTypeStaticClassifyList.get(3).pgDeviceTypeStatisticDtoList.add(pgDeviceTypeStatisticDto);
                    break;
                case "声光报警器":
                    pgDeviceTypeStaticClassifyList.get(3).pgDeviceTypeStatisticDtoList.add(pgDeviceTypeStatisticDto);
                    break;
                case "气体声光报警器":
                    pgDeviceTypeStaticClassifyList.get(3).pgDeviceTypeStatisticDtoList.add(pgDeviceTypeStatisticDto);
                    break;
                case "放气指示灯":
                    pgDeviceTypeStaticClassifyList.get(3).pgDeviceTypeStatisticDtoList.add(pgDeviceTypeStatisticDto);
                    break;
                default:
                    break;
            }
        }

        for(PgDeviceTypeStaticClassify pgDeviceTypeStaticClassify:pgDeviceTypeStaticClassifyList){
            if(pgDeviceTypeStaticClassify.getPgDeviceTypeStatisticDtoList()==null)
                pgDeviceTypeStaticClassify.setNum(0);
            else
                for(PgDeviceTypeStatisticDto pgDeviceTypeStatisticDto:pgDeviceTypeStaticClassify.getPgDeviceTypeStatisticDtoList())
                    pgDeviceTypeStaticClassify.num+=Integer.valueOf(pgDeviceTypeStatisticDto.getNum());
        }
        return pgDeviceTypeStaticClassifyList;
    }

    private static List<PgDeviceTypeStaticClassify> getStaticClassifyList(){
        List<PgDeviceTypeStaticClassify> pgDeviceTypeStaticClassifyList=new ArrayList<>();
        PgDeviceTypeStaticClassify pgDeviceTypeStaticClassify=new PgDeviceTypeStaticClassify();
        pgDeviceTypeStaticClassify.setDevType("可控设备");
        pgDeviceTypeStaticClassify.pgDeviceTypeStatisticDtoList=new ArrayList<>();
        pgDeviceTypeStaticClassifyList.add(pgDeviceTypeStaticClassify);

        PgDeviceTypeStaticClassify pgDeviceTypeStaticClassify1=new PgDeviceTypeStaticClassify();
        pgDeviceTypeStaticClassify1.setDevType("通讯设备");
        pgDeviceTypeStaticClassify1.pgDeviceTypeStatisticDtoList=new ArrayList<>();
        pgDeviceTypeStaticClassifyList.add(pgDeviceTypeStaticClassify1);

        PgDeviceTypeStaticClassify pgDeviceTypeStaticClassify2=new PgDeviceTypeStaticClassify();
        pgDeviceTypeStaticClassify2.setDevType("监测设备");
        pgDeviceTypeStaticClassify2.pgDeviceTypeStatisticDtoList=new ArrayList<>();
        pgDeviceTypeStaticClassifyList.add(pgDeviceTypeStaticClassify2);

        PgDeviceTypeStaticClassify pgDeviceTypeStaticClassify3=new PgDeviceTypeStaticClassify();
        pgDeviceTypeStaticClassify3.setDevType("消防设备");
        pgDeviceTypeStaticClassify3.pgDeviceTypeStatisticDtoList=new ArrayList<>();
        pgDeviceTypeStaticClassifyList.add(pgDeviceTypeStaticClassify3);

        return pgDeviceTypeStaticClassifyList;
    }
}
