package com.bonus.canteen.core.order.android.vo;

import cn.hutool.core.collection.CollUtil;
import com.bonus.canteen.core.account.v3.api.vo.AccInfoDetailVO;
import com.bonus.canteen.core.common.utils.SysUtil;
import com.bonus.canteen.core.customer.vo.CustPayVO;
import io.swagger.annotations.ApiModelProperty;

import java.util.List;

public class OrderTakeAndroidVO {
   private Long custId;
   private String custNum;
   private String custName;
   private String mobile;
   private String orgFullName;
   private String custPhotoUrl;
   @ApiModelProperty("个人钱包余额 分")
   private Integer walletBal;
   @ApiModelProperty("补贴钱包余额 分")
   private Integer subsidyBal;
   @ApiModelProperty("红包余额 分")
   private Integer redEnvelope;
   @ApiModelProperty("账户余额 分")
   private Integer accBal;
   private Integer needTakeNum;
   private Integer alreadyTakeNum;
   private List<OrderListAndroidVO> needTakeOrderList = CollUtil.newArrayList(new OrderListAndroidVO[0]);
   private List<OrderListAndroidVO> alreadyTakeOrderList = CollUtil.newArrayList(new OrderListAndroidVO[0]);

   public Integer getNeedTakeNum() {
      return CollUtil.size(this.needTakeOrderList);
   }

   public Integer getAlreadyTakeNum() {
      return CollUtil.size(this.alreadyTakeOrderList);
   }

   public String getCustPhotoUrl() {
      return SysUtil.getCutFileUrl(this.custPhotoUrl);
   }

   public static OrderTakeAndroidVO of(CustPayVO custPayVO, AccInfoDetailVO accInfoDetail) {
      OrderTakeAndroidVO orderTakeAndroidVO = new OrderTakeAndroidVO();
      orderTakeAndroidVO.setCustId(custPayVO.getCustId());
      orderTakeAndroidVO.setCustNum(custPayVO.getCustNum());
      orderTakeAndroidVO.setCustName(custPayVO.getCustName());
      orderTakeAndroidVO.setMobile(custPayVO.getMobile());
      orderTakeAndroidVO.setOrgFullName(custPayVO.getOrgFullName());
      orderTakeAndroidVO.setCustPhotoUrl(custPayVO.getCustPhotoUrl());
      orderTakeAndroidVO.setWalletBal(accInfoDetail.getWalletBal() != null ? accInfoDetail.getWalletBal().intValue() : 0);
      orderTakeAndroidVO.setSubsidyBal(accInfoDetail.getSubsidyBal() != null ? accInfoDetail.getSubsidyBal().intValue() : 0);
      orderTakeAndroidVO.setRedEnvelope(accInfoDetail.getRedEnvelope() != null ? accInfoDetail.getRedEnvelope().intValue() : 0);
      orderTakeAndroidVO.setAccBal(accInfoDetail.getAccAllBal() != null ? accInfoDetail.getAccAllBal().intValue() : 0);
      return orderTakeAndroidVO;
   }

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

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

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

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

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

   public Integer getWalletBal() {
      return this.walletBal;
   }

   public Integer getSubsidyBal() {
      return this.subsidyBal;
   }

   public Integer getRedEnvelope() {
      return this.redEnvelope;
   }

   public Integer getAccBal() {
      return this.accBal;
   }

   public List<OrderListAndroidVO> getNeedTakeOrderList() {
      return this.needTakeOrderList;
   }

   public List<OrderListAndroidVO> getAlreadyTakeOrderList() {
      return this.alreadyTakeOrderList;
   }

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

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

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

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

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

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

   public void setWalletBal(final Integer walletBal) {
      this.walletBal = walletBal;
   }

   public void setSubsidyBal(final Integer subsidyBal) {
      this.subsidyBal = subsidyBal;
   }

   public void setRedEnvelope(final Integer redEnvelope) {
      this.redEnvelope = redEnvelope;
   }

   public void setAccBal(final Integer accBal) {
      this.accBal = accBal;
   }

   public void setNeedTakeNum(final Integer needTakeNum) {
      this.needTakeNum = needTakeNum;
   }

   public void setAlreadyTakeNum(final Integer alreadyTakeNum) {
      this.alreadyTakeNum = alreadyTakeNum;
   }

   public void setNeedTakeOrderList(final List<OrderListAndroidVO> needTakeOrderList) {
      this.needTakeOrderList = needTakeOrderList;
   }

   public void setAlreadyTakeOrderList(final List<OrderListAndroidVO> alreadyTakeOrderList) {
      this.alreadyTakeOrderList = alreadyTakeOrderList;
   }

}
