package com.bonus.canteen.core.pay.common.vo;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.text.CharSequenceUtil;
import cn.hutool.core.util.ArrayUtil;
import com.bonus.canteen.core.customer.vo.CustPayVO;
import com.bonus.canteen.core.order.utils.LeNumUtil;
import com.bonus.canteen.core.pay.common.constants.PayTypeEnum;
import com.bonus.canteen.core.pay.common.dto.third.ThirdPaySupportDTO;

public class PayChannelSelectDTO {
   private Integer nuClearMode;
   private Integer payType;
   private Long custId;
   private String couponNum;
   private String openId;
   private String serialNum;
   private String authCode;
   private Long canteenId;
   private Long stallId;
   private Integer onlineState;
   private Integer sourceType;
   private String custThirdId;
   private String custNum;
   private String machineSn;
   private String machineNum;
   private String thirdSerialNum;

   public boolean ifEqualPayType(PayTypeEnum... payTypes) {
      return !ArrayUtil.isEmpty(payTypes) && LeNumUtil.isValidId(this.payType) ? ArrayUtil.contains(payTypes, PayTypeEnum.getEnum(this.payType)) : false;
   }

   public ThirdPaySupportDTO convertToThirdPaySupportDTO(CustPayVO custPayVO) {
      ThirdPaySupportDTO thirdPaySupportDTO = (ThirdPaySupportDTO)BeanUtil.copyProperties(this, ThirdPaySupportDTO.class, new String[0]);
      if (custPayVO != null) {
         if (thirdPaySupportDTO.getCustId() == null) {
            thirdPaySupportDTO.setCustId(custPayVO.getCustId());
         }

         if (CharSequenceUtil.isBlank(thirdPaySupportDTO.getCustThirdId())) {
            thirdPaySupportDTO.setCustThirdId(custPayVO.getCustThirdId());
         }

         if (CharSequenceUtil.isBlank(thirdPaySupportDTO.getCustNum())) {
            thirdPaySupportDTO.setCustNum(custPayVO.getCustNum());
         }

         if (CharSequenceUtil.isBlank(thirdPaySupportDTO.getSerialNum())) {
            thirdPaySupportDTO.setSerialNum(custPayVO.getSerialNum());
         }

         if (CharSequenceUtil.isBlank(thirdPaySupportDTO.getThirdSerialNum())) {
            thirdPaySupportDTO.setThirdSerialNum(custPayVO.getThirdSerialNum());
         }
      }

      return thirdPaySupportDTO;
   }

   public Integer getNuClearMode() {
      return this.nuClearMode;
   }

   public Integer getPayType() {
      return this.payType;
   }

   public Long getCustId() {
      return this.custId;
   }

   public String getCouponNum() {
      return this.couponNum;
   }

   public String getOpenId() {
      return this.openId;
   }

   public String getSerialNum() {
      return this.serialNum;
   }

   public String getAuthCode() {
      return this.authCode;
   }

   public Long getCanteenId() {
      return this.canteenId;
   }

   public Long getStallId() {
      return this.stallId;
   }

   public Integer getOnlineState() {
      return this.onlineState;
   }

   public Integer getSourceType() {
      return this.sourceType;
   }

   public String getCustThirdId() {
      return this.custThirdId;
   }

   public String getCustNum() {
      return this.custNum;
   }

   public String getMachineSn() {
      return this.machineSn;
   }

   public String getMachineNum() {
      return this.machineNum;
   }

   public String getThirdSerialNum() {
      return this.thirdSerialNum;
   }

   public void setNuClearMode(final Integer nuClearMode) {
      this.nuClearMode = nuClearMode;
   }

   public void setPayType(final Integer payType) {
      this.payType = payType;
   }

   public void setCustId(final Long custId) {
      this.custId = custId;
   }

   public void setCouponNum(final String couponNum) {
      this.couponNum = couponNum;
   }

   public void setOpenId(final String openId) {
      this.openId = openId;
   }

   public void setSerialNum(final String serialNum) {
      this.serialNum = serialNum;
   }

   public void setAuthCode(final String authCode) {
      this.authCode = authCode;
   }

   public void setCanteenId(final Long canteenId) {
      this.canteenId = canteenId;
   }

   public void setStallId(final Long stallId) {
      this.stallId = stallId;
   }

   public void setOnlineState(final Integer onlineState) {
      this.onlineState = onlineState;
   }

   public void setSourceType(final Integer sourceType) {
      this.sourceType = sourceType;
   }

   public void setCustThirdId(final String custThirdId) {
      this.custThirdId = custThirdId;
   }

   public void setCustNum(final String custNum) {
      this.custNum = custNum;
   }

   public void setMachineSn(final String machineSn) {
      this.machineSn = machineSn;
   }

   public void setMachineNum(final String machineNum) {
      this.machineNum = machineNum;
   }

   public void setThirdSerialNum(final String thirdSerialNum) {
      this.thirdSerialNum = thirdSerialNum;
   }

}
