package com.bonus.core.customer.vo;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.text.CharSequenceUtil;
import com.bonus.core.common.encrypt.LeNiuDecryptDataProcess;
import com.bonus.core.common.encrypt.LeNiuDecryptField;
import com.bonus.core.common.utils.SysUtil;
import com.bonus.core.customer.model.CustInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDate;
import java.util.List;

@ApiModel("支付有关人员资料VO")
@LeNiuDecryptDataProcess
@Data
public class CustPayVO implements Serializable {
   @ApiModelProperty("人员id")
   private Long custId;
   @ApiModelProperty("人员类别")
   private Integer psnType;
   @ApiModelProperty("人员类别名称")
   private String psnTypeName;
   @ApiModelProperty("人员所属组织id")
   private Long orgId;
   @ApiModelProperty("第三方人员id")
   private String custThirdId;
   @ApiModelProperty("人员状态 1-正常 2-注销")
   private Integer custState;
   @ApiModelProperty("人员编号")
   private String custNum;
   @ApiModelProperty("人员姓名")
   @LeNiuDecryptField
   private String custName;
   @ApiModelProperty("机构全称")
   private String orgNum;
   @ApiModelProperty("机构全称")
   private String orgFullName;
   @ApiModelProperty("人脸照片地址")
   private String custPhotoUrl;
   @ApiModelProperty("手机号")
   @LeNiuDecryptField
   private String mobile;
   @ApiModelProperty("卡号")
   private String serialNum;
   @ApiModelProperty("第三方卡号")
   private String thirdSerialNum;
   @ApiModelProperty("卡状态")
   private Integer cardStatus;
   @ApiModelProperty("卡片有效期")
   private LocalDate validityDate;
   @ApiModelProperty("支付宝签约号")
   private String alipayContractNum;
   private List<CardInfoVO> cardInfos;
   @ApiModelProperty("头像地址")
   private String headPortraitUrl;

   public String getCustPhotoUrl() {
      return CharSequenceUtil.isNotBlank(this.headPortraitUrl) ? SysUtil.getCutFileUrl(this.headPortraitUrl) : SysUtil.getCutFileUrl(this.custPhotoUrl);
   }

   public static CustPayVO of(CustInfo custInfo) {
      return (CustPayVO)BeanUtil.copyProperties(custInfo, CustPayVO.class, new String[0]);
   }

   public String getHeadPortraitUrl() {
      return SysUtil.getCutFileUrl(this.headPortraitUrl);
   }

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

   public Integer getPsnType() {
      return this.psnType;
   }

   public String getPsnTypeName() {
      return this.psnTypeName;
   }

   public Long getOrgId() {
      return this.orgId;
   }

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

   public Integer getCustState() {
      return this.custState;
   }

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

   public String getCustName() {
      return this.custName;
   }

   public String getOrgNum() {
      return this.orgNum;
   }

   public String getOrgFullName() {
      return this.orgFullName;
   }

   public String getMobile() {
      return this.mobile;
   }

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

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

   public Integer getCardStatus() {
      return this.cardStatus;
   }

   public LocalDate getValidityDate() {
      return this.validityDate;
   }

   public String getAlipayContractNum() {
      return this.alipayContractNum;
   }

   public List<CardInfoVO> getCardInfos() {
      return this.cardInfos;
   }

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

   public void setPsnType(final Integer psnType) {
      this.psnType = psnType;
   }

   public void setPsnTypeName(final String psnTypeName) {
      this.psnTypeName = psnTypeName;
   }

   public void setOrgId(final Long orgId) {
      this.orgId = orgId;
   }

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

   public void setCustState(final Integer custState) {
      this.custState = custState;
   }

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

   public void setCustName(final String custName) {
      this.custName = custName;
   }

   public void setOrgNum(final String orgNum) {
      this.orgNum = orgNum;
   }

   public void setOrgFullName(final String orgFullName) {
      this.orgFullName = orgFullName;
   }

   public void setCustPhotoUrl(final String custPhotoUrl) {
      this.custPhotoUrl = custPhotoUrl;
   }

   public void setMobile(final String mobile) {
      this.mobile = mobile;
   }

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

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

   public void setCardStatus(final Integer cardStatus) {
      this.cardStatus = cardStatus;
   }

   public void setValidityDate(final LocalDate validityDate) {
      this.validityDate = validityDate;
   }

   public void setAlipayContractNum(final String alipayContractNum) {
      this.alipayContractNum = alipayContractNum;
   }

   public void setCardInfos(final List<CardInfoVO> cardInfos) {
      this.cardInfos = cardInfos;
   }

   public void setHeadPortraitUrl(final String headPortraitUrl) {
      this.headPortraitUrl = headPortraitUrl;
   }





   static class CardInfoVO implements Serializable {
      @ApiModelProperty("卡号")
      private String serialNum;
      @ApiModelProperty("第三方卡号")
      private String thirdSerialNum;
      @ApiModelProperty("卡状态")
      private Integer cardStatus;
      @ApiModelProperty("卡片有效期")
      private LocalDate validityDate;

      public CardInfoVO() {
      }

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

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

      public Integer getCardStatus() {
         return this.cardStatus;
      }

      public LocalDate getValidityDate() {
         return this.validityDate;
      }

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

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

      public void setCardStatus(final Integer cardStatus) {
         this.cardStatus = cardStatus;
      }

      public void setValidityDate(final LocalDate validityDate) {
         this.validityDate = validityDate;
      }


   }
}
