package com.dxhy.customs.model;

import java.util.List;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dxhy.api.model.config.UserInfo;
import com.dxhy.common.util.UserInfoUtil;
import com.dxhy.customs.entity.CommonEntity;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author dxhy
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class TdxCustomsRecordDTO extends CommonEntity {
    private String gfName;
    private String createDateBegin;
    private String createDateEnd;
    private String fillInDateBegin;
    private String fillInDateEnd;
    private String qsDateBegin;
    private String qsDateEnd;
    private String qsStatus;
    private String qsType;
    private String notes;
    private String remark;
    private String customsCode;
    private String gfTaxNo;
    private String createDate;
    private String applyCheck;
    private String checkStatus;
    private String auditStatus;
    private String dataSources;
    private String collectUploadStatus;
    private String exceptionFlag;
    private String normalFlag;
    private String businessCode;
    private String businessName;
    private String departId;
    private String deptId;
    private String departName;
    private String deptName;
    private String userAccount;
    private String userName;
    private List<String> gfTaxNoList;
    private List<String> ids;
    private String entryFlag;

    public void setParam(Page page) {

        if (this.isAll(this.getGfTaxNo())) {
            this.gfTaxNo = null;
        }
        if (this.isAll(this.getApplyCheck())) {
            this.applyCheck = null;
        }
        if (this.isAll(this.getCheckStatus())) {
            this.checkStatus = null;
        }
        if (this.isAll(this.getAuditStatus())) {
            this.auditStatus = null;
        }
        if (this.isAll(this.getDataSources())) {
            this.dataSources = null;
        }
        if (this.isAll(this.getUserAccount())) {
            this.userAccount = null;
        }
        if (this.isAll(this.getQsType())) {
            this.qsType = null;
        }
        if (this.isAll(this.getQsStatus())) {
            this.qsStatus = null;
        }
        if (this.isAll(this.getBusinessCode())) {
            this.businessCode = null;
        }
        if (this.isAll(this.getCollectUploadStatus())) {
            this.collectUploadStatus = null;
        }
        this.setPage(page);
    }

    public void setBuyTaxNoFromUser(UserInfo userInfo) {
        this.gfTaxNoList = UserInfoUtil.getGfshAll(userInfo.getOrg());
    }
}
