package com.mvc.othermodel.sjhjb;

import com.mvc.constant.sthjb.WaterUsageType;

import java.math.BigDecimal;
import java.util.*;

/**
 * 用水计量逻辑模型
 */
public class WaterMeteringLogicModel {
    private String displayName;
    private WaterUsageType waterUsageType;
    private Map<String, Integer> stationCodeMap;//站码,类型(1:加,-1:减)
    private BigDecimal usageValue;//用水量
    private BigDecimal usageRatio;//用水占比

    private int type;//1:在用途中展示的,2:其它

    public String getDisplayName() {
        return displayName;
    }

    public void setDisplayName(String displayName) {
        this.displayName = displayName;
    }

    public WaterUsageType getWaterUsageType() {
        return waterUsageType;
    }

    public void setWaterUsageType(WaterUsageType waterUsageType) {
        this.waterUsageType = waterUsageType;
    }

    public Map<String, Integer> getStationCodeMap() {
        return stationCodeMap;
    }

    public void setStationCodeMap(Map<String, Integer> stationCodeMap) {
        this.stationCodeMap = stationCodeMap;
    }

    public BigDecimal getUsageValue() {
        return usageValue;
    }

    public void setUsageValue(BigDecimal usageValue) {
        this.usageValue = usageValue;
    }

    public BigDecimal getUsageRatio() {
        return usageRatio;
    }

    public void setUsageRatio(BigDecimal usageRatio) {
        this.usageRatio = usageRatio;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    /**
     * 获取食堂水量模拟结构数据
     * @return
     */
    public static WaterMeteringLogicModel getMockData_Canteen() {
        //16#+44# (16有两块)
        WaterMeteringLogicModel model = new WaterMeteringLogicModel();
        model.setDisplayName(WaterUsageType.CANTEEN_WATER.getDescription());
        model.setWaterUsageType(WaterUsageType.CANTEEN_WATER);
        model.setType(1);
        Map<String, Integer> map = new HashMap<>();
        map.put("2506100008",1);
        map.put("2506100009",1);
        map.put("2506100026",1);
        model.setStationCodeMap(map);
        return model;
    }

    public static WaterMeteringLogicModel getMockData_Green() {
        //35# + 36# + 78# (78两块)
        WaterMeteringLogicModel model = new WaterMeteringLogicModel();
        model.setDisplayName(WaterUsageType.GREEN_WATER.getDescription());
        model.setWaterUsageType(WaterUsageType.GREEN_WATER);
        model.setType(1);
        Map<String, Integer> map = new HashMap<>();
        map.put("2506100024",1);
        map.put("2506100024",1);
        map.put("2506100036",1);
        //map.put("2506100037",1);//这块表有问题,暂时先不计算
        model.setStationCodeMap(map);
        return model;
    }

    //冷却塔补水量
    public static WaterMeteringLogicModel getMockData_CoolingTower() {
        WaterMeteringLogicModel model = new WaterMeteringLogicModel();
        model.setDisplayName(WaterUsageType.COOLING_TOWER_WATER.getDescription());
        model.setWaterUsageType(WaterUsageType.COOLING_TOWER_WATER);
        model.setType(1);
        Map<String, Integer> map = new HashMap<>();
        map.put("2506100027",1);
        model.setStationCodeMap(map);
        return model;
    }

    //空调补水量
    public static WaterMeteringLogicModel getMockData_AirConditioning() {
        WaterMeteringLogicModel model = new WaterMeteringLogicModel();
        model.setDisplayName(WaterUsageType.AIR_CONDITIONING_WATER.getDescription());
        model.setWaterUsageType(WaterUsageType.AIR_CONDITIONING_WATER);
        model.setType(1);

        Map<String, Integer> map = new HashMap<>();
        map.put("2506100003",1);//5
        map.put("2506100004",1);//6
        map.put("2506100005",1);//7
        map.put("2506100006",1);//8
        map.put("2506100007",1);//9
        map.put("2506100014",1);//25
        map.put("2506100010",1);//17
        map.put("2506100026",-1);//-40 ,注意是减
        map.put("2506100028",1);//44
        map.put("2506100029",1);//45
        map.put("2506100030",1);//46
        map.put("2506100031",1);//47
        map.put("2506100032",1);//48
        map.put("2506100033",1);//49
        map.put("2506100034",1);//50
        map.put("2506100039",1);//80
        model.setStationCodeMap(map);

        return model;
    }

    //热力软化水量
    public static WaterMeteringLogicModel getMockData_HeatingStation() {
        WaterMeteringLogicModel model = new WaterMeteringLogicModel();
        model.setDisplayName(WaterUsageType.HEATING_STATION_WATER.getDescription());
        model.setWaterUsageType(WaterUsageType.HEATING_STATION_WATER);
        model.setType(1);

        Map<String, Integer> map = new HashMap<>();
        map.put("2506100038",1);//79
        model.setStationCodeMap(map);

        return model;
    }

    //2号办公楼
    public static WaterMeteringLogicModel getMockData_Building2(){
        WaterMeteringLogicModel model = new WaterMeteringLogicModel();
        model.setDisplayName("2号楼办公用水量");
        model.setWaterUsageType(WaterUsageType.OFFICE_WATER);
        model.setType(2);

        Map<String, Integer> map = new HashMap<>();
        map.put("2506100012",1);//23
        map.put("2506100013",1);//24
        map.put("2506100015",1);//26
        map.put("2506100035",1);//77
        model.setStationCodeMap(map);

        return model;
    }

    //3号办公楼
    public static WaterMeteringLogicModel getMockData_Building3(){
        WaterMeteringLogicModel model = new WaterMeteringLogicModel();
        model.setDisplayName("3号楼办公用水量");
        model.setWaterUsageType(WaterUsageType.OFFICE_WATER);
        model.setType(2);

        Map<String, Integer> map = new HashMap<>();
        map.put("2506100016",1);//27
        map.put("2506100017",1);//28
        map.put("2506100018",1);//29
        map.put("2506100019",1);//30
        map.put("2506100020",1);//31
        map.put("2506100021",-1);//32
        map.put("2506100022",1);//33
        map.put("2506100023",1);//34
        model.setStationCodeMap(map);

        return model;
    }

    //单位位总用水量/一级表
    public static WaterMeteringLogicModel getMockData_Total(){
        WaterMeteringLogicModel model = new WaterMeteringLogicModel();
        model.setDisplayName("单位总表");
        model.setWaterUsageType(WaterUsageType.OFFICE_WATER);

        Map<String, Integer> map = new HashMap<>();
        map.put("2506100001",1);//27
        model.setStationCodeMap(map);

        return model;
    }

    //二级水表
    public static WaterMeteringLogicModel getMockData_SecondaryWaterMeter(){
        WaterMeteringLogicModel model = new WaterMeteringLogicModel();
        model.setDisplayName("二级水表");
        model.setType(2);

        Map<String, Integer> map = new HashMap<>();
        map.put("2506100002",1);//1号楼东侧总水表
        map.put("2506100012",1);//23
        map.put("2506100013",1);//24
        map.put("2506100014",1);//25
        map.put("2506100015",1);//26
        map.put("2506100016",1);//27
        map.put("2506100017",1);//28
        map.put("2506100018",1);//29
        map.put("2506100019",1);//30
        map.put("2506100020",1);//31
        map.put("2506100021",1);//32
        map.put("2506100022",1);//33
        map.put("2506100023",1);//34

        map.put("2506100024",1);//35
        map.put("2506100025",1);//36

        model.setStationCodeMap(map);

        return model;
    }

    //以下两类不能直接通过站码计算
    //办公用水总量=单位总水量-食堂用水量-绿化用水量-冷却塔补水量-空调补水量-热力软化水量
    //1号楼办公用水量=办公用水总量-2号楼办公用水量-3号楼办公用水量
}
