package thyyxxk.webserver.entity.inpatient.charge;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import thyyxxk.webserver.constants.ZyDepositFileStatusEnum;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
 * (ZyDepositFile)表实体类
 *
 * @author lihong
 * @since 2024-09-11 09:01:04
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName("zy_deposit_file")
public class ZyDepositFile  implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 入院
     */
    public static String IN_HOSPITAL = "1";
    /**
     * 计价
     */
    public static String VALUATION = "2";
    /**
     * 新计价
     */
    public static String NEW_VALUATION = "3";

    private String inpatientNo;
    private String patientId;
    private String name;
    private Integer admissTimes;
    /** 1 联机刷卡 0 不联机 直接输凭证号 */
    private Integer autoFlag;
    /** 事务流水号(该病人该次住院) */
    private Integer depoTimes;
    private Integer ledgerSn;
    /** 事务发生日期 */
    private Date depoDate;
    /** 操作员 编号 */
    private String opIdCode;
    private String opIdCodeName;
    /** 金额 */
    private BigDecimal depoAmount;
    /** 支付类型 对应表 zd_cheque_type  */
    private String depoType;
    private String depoTypeName;
    /** 1 预交 2直退 3中间结算  4出院 5补  对应枚举  ZyDepositFileStatusEnum  */
    private String status;
    @TableField(exist = false)
    private String statusName;
    /** 支票号 */
    private String chequeNo;
          
    private Integer printed;;
    /** 暂存款收据号 */
    private String receiptNo;
    /** 1 入院  2计价 */
    private String windowNo;
    /** 1 作废 */
    private String deleted;
    /** 住院流水号*/
    private String zySerialNo;
          
    private String reportFlag;
          
    private String hsr;
    private String admissDeptName;
    private String depoAmountDx;

    private Date hsTime;

    /**
     * 0未结算  1是出院结算  3是中间结算  4是已出纳 账页结算状态
     */
    private String settleType;
    //操作员名称
    private String opIdName;

    //退费类型 0 现金退费 1 原路退费
    private Integer refundType;

    //金额字符串
    private String amountStr;
    //重打显示标识
    private Boolean rePrintFlag;

    //订单号
    private String psordnum;
    //流水号
    private String agtordnum;
    //
    private String hisrefundnum;

    public void setDepoAmount(BigDecimal depoAmount) {
        this.depoAmount = depoAmount;
        if(depoAmount!=null){
            this.amountStr = depoAmount.toString();
        }
    }

    public String getStatusName() {
        if(status == null){
            return statusName;
        }
        ZyDepositFileStatusEnum zyDepositFileStatusEnum = ZyDepositFileStatusEnum.geteZyDepositFileStatusByCode(status);
        return zyDepositFileStatusEnum.name;
    }

    /**
     * 判断是否是数字人民币支付
     */     
    private String parChannel;
     /**
     * 交易日期（MMDD
     */     
    private String transDate;
     /**
     * 凭证号
     */     
    private String traceNo;

    }

