package org.dromara.elevator.domain.vo;

import lombok.Data;

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

/**
 * 电梯统计
 *
 * @author ym
 * @version 1.0.0
 * @date 2024-09-27 14:27
 */
@Data
public class ElevatorBehaviorStatisticsVo {

    /**
     * 时间段
     */
    private List<Integer> timeLineList;

    /**
     * 上行次数
     */
    private List<Integer> upNumList;

    /**
     * 下行次数
     */
    private List<Integer> downNumList;

    /**
     * 开关门次数
     */
    private List<Integer> openCloseNumList;

    /**
     * 停站次数
     */
    private List<Integer> stopStationNumList;

    /**
     * 运行距离
     */
    private List<BigDecimal> runMileageList;

    /**
     * 楼层
     */
    private List<Integer> floorList;

    /**
     * 楼层停站次数
     */
    private List<Integer> floorStopStationNumList;

    /**
     * 每日(时)楼层停靠信息
     */
    private List<FloorStatistics> floorStatisticsList;

    /**
     * 繁忙时段个数
     */
    private Integer busyNum;
    /**
     * 适中时段个数
     */
    private Integer moderateNum;
    /**
     * 较闲时段个数
     */
    private Integer idleNum;

    public ElevatorBehaviorStatisticsVo() {
        this.busyNum = 0;
        this.moderateNum = 0;
        this.idleNum = 0;
        this.floorStopStationNumList = new ArrayList<>();
        this.floorList = new ArrayList<>();
        this.runMileageList = new ArrayList<>();
        this.stopStationNumList = new ArrayList<>();
        this.openCloseNumList = new ArrayList<>();
        this.downNumList = new ArrayList<>();
        this.upNumList = new ArrayList<>();
        this.timeLineList = new ArrayList<>();
        this.floorStatisticsList = new ArrayList<>();
    }

    @Data
    public static class FloorStatistics {

        /**
         * 时间点
         */
        private Integer timePoint;

        /**
         * 统计时间
         */
        private Date statisticsTime;

        /**
         * 楼层停站信息
         */
        private List<FloorStopStation> stopStationList;
    }

    @Data
    public static class FloorStopStation {

        /**
         * 楼层
         */
        private Integer floor;

        /**
         * 停梯次数
         */
        private Integer stopStationNum;

        public FloorStopStation() {
            this.stopStationNum = 0;
        }

        public FloorStopStation(Integer floor) {
            this.floor = floor;
            this.stopStationNum = 0;
        }
    }

}
