# SalesKpiMonthlyBasicDTO.java

    package cloud.wconnect.workperformance.pojo.dto.saleskpi.monthly.basic;

    import com.google.common.collect.Lists;
    import lombok.AllArgsConstructor;
    import lombok.Builder;
    import lombok.Data;
    import lombok.NoArgsConstructor;

    import java.util.List;

    /**
     * DTO: Monthly Basic
     *
     * @author zc
     * @date 2023/9/7
     */
    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    public class SalesKpiMonthlyBasicDTO {
        /**
         * 指标 id
         */
        private Integer itemId;

        /**
         * 指标标题
         */
        private String itemTitle;

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

        /**
         * actual
         */
        private SalesKpiMonthlyValueBasicDTO actual;

        /**
         * target
         */
        private SalesKpiMonthlyValueBasicDTO target;

        /**
         * attachment
         */
        private SalesKpiAttachmentBasicDTO attachment;

        /**
         * 类型（1：普通 item  2：员工绑定 segment）
         */
        private Integer type;

        /**
         * 提取用户 id
         *
         * @return 用户 id 集合
         * @author zc
         * @date 2023/9/7
         */
        public List<Integer> summaryUserIds() {
            List<Integer> userIds = Lists.newArrayListWithExpectedSize(3);

            if (actual != null) {
                Integer updateUid = actual.getUpdateUid();
                if (updateUid != null) {
                    userIds.add(updateUid);
                }
            }
            if (target != null) {
                Integer updateUid = target.getUpdateUid();
                if (updateUid != null) {
                    userIds.add(updateUid);
                }
            }
            if (attachment != null) {
                Integer updateUid = attachment.getUpdateUid();
                if (updateUid != null) {
                    userIds.add(updateUid);
                }
            }

            return userIds;
        }

    }