# BadGuest.java

    package cloud.wconnect.frontoffice.entity.badguest;

    import com.baomidou.mybatisplus.annotation.IdType;
    import com.baomidou.mybatisplus.annotation.TableId;
    import com.baomidou.mybatisplus.annotation.TableName;
    import lombok.Data;
    import lombok.EqualsAndHashCode;
    import lombok.experimental.Accessors;

    import java.io.Serializable;

    /**
     * <p>
     * 黑名单用户
     * </p>
     *
     * @author lichen
     * @since 2023-03-20
     */
    @Data
    @EqualsAndHashCode(callSuper = false)
    @Accessors(chain = true)
    @TableName("bad_guest_v2")
    public class BadGuest implements Serializable {

        private static final long serialVersionUID = 1L;

        /**
         * 主键
         */
        @TableId(value = "id", type = IdType.AUTO)
        private Long id;

        /**
         * 资产id
         */
        private Integer propertyId;

        /**
         * First Name
         */
        private String firstName;

        /**
         * Last Name
         */
        private String lastName;

        /**
         * 入住日期
         */
        private Long checkInDate;

        /**
         * 退房日期
         */
        private Long checkOutDate;

        /**
         * Folio Number
         */
        private String folioNumber;

        /**
         * What happened
         */
        private String whatHappened;

        /**
         * Reported to
         */
        private String reportedTo;

        /**
         * Results
         */
        private String results;

        /**
         * 创建人
         */
        private Integer createdBy;

        /**
         * 创建时间
         */
        private Long createdTime;

        /**
         * 修改人
         */
        private Integer lastUpdatedBy;

        /**
         * 修改时间
         */
        private Long lastUpdatedTime;

        /**
         * Last Stay Check-in Date
         */
        private Long lastCheckInDate;

        /**
         * Last Stay Check-out Date
         */
        private Long lastCheckOutDate;

        /**
         * 附件集合
         */
        private String attachments;

        /**
         * 审批状态 1：pending 待送审 2:Approvaing 审核中 3: Approved 审核结束 4:rejected 审核驳回 5:作废
         */
        private Integer approveStatus;
        /**
         * 审批层级索引
         */
        private Integer approveIndex;
        /**
         * 审批批次id
         */
        private Long batchId;

        /**
         * chargeback功能的case编号
         */
        private String caseNumber;

        /**
         * 1-住房客人 2-会议/宴会房间
         */
        private Integer type;
        /**
         * 黑名单原因（chargeback来源的黑名单数据此值不为空）
         */
        private String caseReason;
        /**
         * 作废原因
         */
        private String cancellationReason;

        /**
         * 生成唯一key
         *
         * @return java.lang.String
         * @author lichen
         * @date 2023/9/25
         */
        public static String generateKey(String firstName, String lastName, Long checkInDate) {
            return firstName + "_" + lastName + "_" + checkInDate;
        }

        /**
         * 根据firstName 和 lastName生成key
         *
         * @param firstName 姓
         * @param lastName  名
         * @return java.lang.String
         * @author lichen
         * @date 2024/4/22
         */
        public static String generateKeyByFirstNameAndLastName(final String firstName, final String lastName) {
            return firstName.toLowerCase() + ":" + lastName.toLowerCase();
        }
    }