# JournalDTO.java

    package cloud.wconnect.frontoffice.pojo.dto.adjustment;

    import cloud.wconnect.frontoffice.entity.adjustment.AdRequest;
    import lombok.Data;

    import java.math.BigDecimal;

    /**
     * Journal 报告数据
     *
     * @author lichen
     * @date 2025/12/4
     */
    @Data
    public class JournalDTO {

        /**
         * 业务日期，格式yyyyMMdd。调账数据与PMS报告配对成功后，数据在PMS报告中的业务日期
         */
        private Integer businessDate;
        /**
         * 客人姓名或公司名
         */
        private String guestName;
        /**
         * 房间号
         */
        private String roomNumber;
        /**
         * 需调整金额
         */
        private BigDecimal adjustedDollar;
        /**
         * 交易代码
         */
        private String trxCode;
        /**
         * 交易描述
         */
        private String trxDesc;
        /**
         * 创建时间
         */
        private Long createTime;
        /**
         * PMS 系统账户
         */
        private String pmsAccount;
        /**
         * 账户编号
         */
        private String accountNumber;
        /**
         * Conf. Num.
         */
        private String confNumber;

        /**
         * 根据matchType生成签名字段
         *
         * @param matchType 匹配方式
         * @return java.lang.String
         * @author lichen
         * @date 2026/1/9
         */
        public String signByMatchType(int matchType) {
            AdRequest adRequest = new AdRequest();
            adRequest.setGuestName(this.getGuestName());
            adRequest.setRoomNumber(this.getRoomNumber());
            adRequest.setTrxCode(this.getTrxCode());
            adRequest.setAdjustedDollar(this.getAdjustedDollar());
            adRequest.setConfNumber(this.getConfNumber());
            return adRequest.signByMatchType(matchType);
        }

        /**
         * 使用GuestName、RoomNumber、TrxCode、AdjustedDollar、ConfNumber签名
         *
         * @return java.lang.String
         * @author lichen
         * @date 2026/2/5
         */
        public String signByCancel() {
            AdRequest adRequest = new AdRequest();
            adRequest.setGuestName(this.getGuestName());
            adRequest.setRoomNumber(this.getRoomNumber());
            adRequest.setTrxCode(this.getTrxCode());
            adRequest.setAdjustedDollar(this.getAdjustedDollar());
            adRequest.setConfNumber(this.getConfNumber());
            adRequest.setPmsAccount(this.getPmsAccount());
            return adRequest.signByCancel();
        }

    }