# HotelKpiMetricsDTO.java

    package cloud.wconnect.workperformance.pojo.dto.hotelkpi.old.kpi;

    import cloud.wconnect.workperformance.pojo.dto.hotelkpi.old.kpi.explain.HotelKpiExplainMainDTO;
    import com.google.common.collect.Lists;
    import lombok.AllArgsConstructor;
    import lombok.Builder;
    import lombok.Data;

    import java.util.List;
    import java.util.Objects;

    /**
     * DTO: Hotel KPI Metrics
     *
     * @author zc
     * @date 2024/06/24
     */
    @Data
    @Builder
    @AllArgsConstructor
    public class HotelKpiMetricsDTO {

        /**
         * 日期
         */
        private Long date;

        /**
         * 指标类型
         */
        private Integer metricsType;

        /**
         * 指标名称
         */
        private String title;

        /**
         * 指标描述
         */
        private String description;

        /**
         * 指标是否停用（true:已停用 false:未停用）
         */
        private Boolean disabled;

        /**
         * 指标单位
         */
        private String unit;

        /**
         * 指标对比条件
         */
        private HotelKpiComparisonDTO comparison;

        /**
         * 指标警示备注数量
         */
        private Long warningCount;

        /**
         * 指标解释说明内容
         */
        private HotelKpiExplainMainDTO explain;

        /**
         * 指标实际值
         */
        private HotelKpiValueDTO actual;

        /**
         * 指标目标值
         */
        private HotelKpiValueDTO target;

        /**
         * 指标修正值(达标值)
         */
        private HotelKpiValueDTO cure;

        public HotelKpiMetricsDTO() {
            this.comparison = new HotelKpiComparisonDTO();
            this.explain = new HotelKpiExplainMainDTO();
            this.actual = new HotelKpiValueDTO();
            this.target = new HotelKpiValueDTO();
            this.cure = new HotelKpiValueDTO();
        }

        /**
         * 汇总用户 id
         *
         * @return 用户 id 集合
         * @author zc
         * @date 2024/6/25
         */
        public List<Integer> summaryUserIds() {
            List<Integer> userIds = Lists.newArrayListWithExpectedSize(3);
            if (Objects.nonNull(actual.getUpdatedBy()) && actual.getUpdatedBy() > 0) {
                userIds.add(actual.getUpdatedBy());
            }
            if (Objects.nonNull(target.getUpdatedBy()) && target.getUpdatedBy() > 0) {
                userIds.add(target.getUpdatedBy());
            }
            if (Objects.nonNull(cure.getUpdatedBy()) && cure.getUpdatedBy() > 0) {
                userIds.add(cure.getUpdatedBy());
            }
            return userIds;
        }
    }