package com.goafanti.order.bo;

import com.goafanti.common.constant.AFTConstants;
import com.goafanti.common.model.TOrderNew;
import com.goafanti.order.enums.NewOrderDunType;
import com.goafanti.order.enums.OrderDunSubject;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateFormatUtils;

import java.math.BigDecimal;
import java.util.List;

public class TOrderNewBo extends TOrderNew{
	private String id;
	private String signDate;
	private String userName;
	private String nickname;
	private String salesmanName;
	private String managerName;
	private String managerId;
	private String financeName;
	private String consultantName;
	private String dunSubject;
	private String startDate;
	private String financeMobile;
	private String salesmanMobile;
	private Integer backStatus;
	private String initiateName;
	private String reason;
	private String backDate;
	private String backId;
	private String uid;
	private String email;
	private String depName;
	//应收款
	private BigDecimal accountsReceivable;
	private BigDecimal uncollectedAmount;
	private Integer locationProvince;
	private Integer locationCity;
	private Integer locationArea;
	private String postalAddress;
	private BigDecimal invoiceAmount;
	private String NowFinance;
	private String  NowFinanceMobile;
	private String oldSalesmanName;
	private String oldSalesmanMobile;
	private Integer projectType;
	private Integer maxStatus;
	private Double actualDuration;
	private Integer dunType;
	private Integer dunStatus;
	private BigDecimal appropriationRatio;
	private BigDecimal setUpAmount;

	private List<?> dunList;
	private List<?> taskList;
	/**
	 * 是否变更 0否 1是
	 */
	private Integer ischange;
	/**
	 * 当前审核
	 */
	private Integer myExamine;
	private Integer stopProject;

	/**
	 * 知识产权服务 1已签 2企业已经拥有可申报高新的知识产权 3企业自行申报/已有其他合作的代理机构申报 0其他
	 */
	private Integer knowledgeServices;

	/**
	 * 审计服务 1已签 2企业已经有符合申报的年审/专审 3 业自行找会计事务所出具报告 0其他
	 */
	private Integer auditServices;

	/**
	 * 加计扣除服务 1已签 2企业不符合加计扣除范围 3企业自己已经做了加计扣除 4企业自行找其他机构做了加计扣除 0其他
	 */
	private Integer addDeductionServices;

	/**
	 * 知识产权服务其他描述
	 */
	private String knowledgeOther;

	/**
	 * 审计服务其他描述
	 */
	private String auditOther;

	/**
	 * 加计扣除服务其他描述
	 */
	private String addDeductionOther;
	private Integer approvalStatus;
	private Integer scoreStatus;
	private String approvalAid;
	private String approvalName;
	private String operationGuaranteeId;
	private String operationGuaranteeName;

	private String typeExplain;

	private String type;

	private Integer maxType;
	private Double maxDuration;


    @Override
    public Integer getScoreStatus() {
        return scoreStatus;
    }

    @Override
    public void setScoreStatus(Integer scoreStatus) {
        this.scoreStatus = scoreStatus;
    }
	public Double getMaxDuration() {
		return maxDuration;
	}

	public void setMaxDuration(Double maxDuration) {
		this.maxDuration = maxDuration;
	}

	public Integer getMaxType() {
		return maxType;
	}

	public void setMaxType(Integer maxType) {
		this.maxType = maxType;
	}

	public Integer getMaxStatus() {
		return maxStatus;
	}

	public void setMaxStatus(Integer maxStatus) {
		this.maxStatus = maxStatus;
	}

	public Double getActualDuration() {
		return actualDuration;
	}

	public void setActualDuration(Double actualDuration) {
		this.actualDuration = actualDuration;
	}

	public String getTypeExplain() {
		return typeExplain;
	}

	public void setTypeExplain(String typeExplain) {
		this.typeExplain = typeExplain;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getOperationGuaranteeId() {
		return operationGuaranteeId;
	}

	public void setOperationGuaranteeId(String operationGuaranteeId) {
		this.operationGuaranteeId = operationGuaranteeId;
	}

	public String getOperationGuaranteeName() {
		return operationGuaranteeName;
	}

	public void setOperationGuaranteeName(String operationGuaranteeName) {
		this.operationGuaranteeName = operationGuaranteeName;
	}

	public String getApprovalName() {
		return approvalName;
	}

	public void setApprovalName(String approvalName) {
		this.approvalName = approvalName;
	}

	public Integer getApprovalStatus() {
		return approvalStatus;
	}

	public void setApprovalStatus(Integer approvalStatus) {
		this.approvalStatus = approvalStatus;
	}

	public String getApprovalAid() {
		return approvalAid;
	}

	public void setApprovalAid(String approvalAid) {
		this.approvalAid = approvalAid;
	}

	public Integer getMyExamine() {
		return myExamine;
	}

	public void setMyExamine(Integer myExamine) {
		this.myExamine = myExamine;
	}

	public String getManagerId() {
		return managerId;
	}

	public void setManagerId(String managerId) {
		this.managerId = managerId;
	}

	public String getManagerName() {
		return managerName;
	}

	public void setManagerName(String managerName) {
		this.managerName = managerName;
	}

	public Integer getKnowledgeServices() {
		return knowledgeServices;
	}

	public void setKnowledgeServices(Integer knowledgeServices) {
		this.knowledgeServices = knowledgeServices;
	}

	public Integer getAuditServices() {
		return auditServices;
	}

	public void setAuditServices(Integer auditServices) {
		this.auditServices = auditServices;
	}

	public Integer getAddDeductionServices() {
		return addDeductionServices;
	}

	public void setAddDeductionServices(Integer addDeductionServices) {
		this.addDeductionServices = addDeductionServices;
	}

	public String getKnowledgeOther() {
		return knowledgeOther;
	}

	public void setKnowledgeOther(String knowledgeOther) {
		this.knowledgeOther = knowledgeOther;
	}

	public String getAuditOther() {
		return auditOther;
	}

	public void setAuditOther(String auditOther) {
		this.auditOther = auditOther;
	}

	public String getAddDeductionOther() {
		return addDeductionOther;
	}

	public void setAddDeductionOther(String addDeductionOther) {
		this.addDeductionOther = addDeductionOther;
	}

	public Integer getStopProject() {
		return stopProject;
	}

	public void setStopProject(Integer stopProject) {
		this.stopProject = stopProject;
	}

	public String getDunSubject() {
		if(getDunType()!=null&&getProjectType()!=null)return NewOrderDunType.getValueByCode(Integer.valueOf(""+getProjectType()+getDunType()));
		if(dunSubject!=null)return OrderDunSubject.getValueByCode(Integer.valueOf(dunSubject));
		return dunSubject;
	}
	public Integer getLocationProvince() {
		return locationProvince;
	}

	public void setLocationProvince(Integer locationProvince) {
		this.locationProvince = locationProvince;
	}

	public Integer getLocationCity() {
		return locationCity;
	}

	public void setLocationCity(Integer locationCity) {
		this.locationCity = locationCity;
	}

	public Integer getLocationArea() {
		return locationArea;
	}

	public void setLocationArea(Integer locationArea) {
		this.locationArea = locationArea;
	}

	public String getPostalAddress() {
		return postalAddress;
	}

	public void setPostalAddress(String postalAddress) {
		this.postalAddress = postalAddress;
	}

	public String getSignDate() {
		if (StringUtils.isBlank(signDate)&&super.getSignTime()!=null) {
			return DateFormatUtils.format(super.getSignTime(), AFTConstants.YYYYMMDD);
		}
		return signDate;
	}

	public void setSignDate(String signDate) {
		this.signDate = signDate;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getSalesmanName() {
		return salesmanName;
	}

	public void setSalesmanName(String salesmanName) {
		this.salesmanName = salesmanName;
	}

	public String getFinanceName() {
		return financeName;
	}

	public void setFinanceName(String financeName) {
		this.financeName = financeName;
	}

	public String getCreateDate() {
		if (super.getCreateTime() == null) {
			return null;
		} else {
			return DateFormatUtils.format(super.getCreateTime(), AFTConstants.YYYYMMDDHHMMSS);
		}
	}

	public String getUpdateDate() {
		if (super.getUpdateTime() == null) {
			return null;
		} else {
			return DateFormatUtils.format(super.getUpdateTime(), AFTConstants.YYYYMMDDHHMMSS);
		}
	}

	public String getStartDate() {
		return startDate;
	}

	public void setStartDate(String startDate) {
		this.startDate = startDate;
	}

	/*public String getDunSubject() {
		return dunSubject;
	}*/

	public void setDunSubject(String dunSubject) {
		this.dunSubject = dunSubject;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getFinanceMobile() {
		return financeMobile;
	}

	public void setFinanceMobile(String financeMobile) {
		this.financeMobile = financeMobile;
	}

	public String getSalesmanMobile() {
		return salesmanMobile;
	}

	public void setSalesmanMobile(String salesmanMobile) {
		this.salesmanMobile = salesmanMobile;
	}

	public Integer getBackStatus() {
		return backStatus;
	}

	public void setBackStatus(Integer backStatus) {
		this.backStatus = backStatus;
	}

	public String getInitiateName() {
		return initiateName;
	}

	public void setInitiateName(String initiateName) {
		this.initiateName = initiateName;
	}

	public String getReason() {
		return reason;
	}

	public void setReason(String reason) {
		this.reason = reason;
	}

	public String getBackDate() {
		return backDate;
	}

	public void setBackDate(String backDate) {
		this.backDate = backDate;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}
	public String getUid() {
		return uid;
	}

	public void setUid(String uid) {
		this.uid = uid;
	}

	public String getConsultantName() {
		return consultantName;
	}

	public void setConsultantName(String consultantName) {
		this.consultantName = consultantName;
	}

	public String getBackId() {
		return backId;
	}

	public void setBackId(String backId) {
		this.backId = backId;
	}

	public String getDepName() {
		return depName;
	}

	public void setDepName(String depName) {
		this.depName = depName;
	}

	public BigDecimal getAccountsReceivable() {
		if(getDunSubject()!=null&&getDunSubject().equals("33")&&accountsReceivable==null&&appropriationRatio !=null &&setUpAmount!=null) {
			return setUpAmount.multiply(accountsReceivable);
		}
		return accountsReceivable;
	}

	public void setAccountsReceivable(BigDecimal accountsReceivable) {
		this.accountsReceivable = accountsReceivable;
	}

	public BigDecimal getUncollectedAmount() {
		return uncollectedAmount;
	}

	public void setUncollectedAmount(BigDecimal uncollectedAmount) {
		this.uncollectedAmount = uncollectedAmount;
	}

	public String getNowFinance() {
		return NowFinance;
	}

	public void setNowFinance(String nowFinance) {
		NowFinance = nowFinance;
	}

	public String getNowFinanceMobile() {
		return NowFinanceMobile;
	}

	public void setNowFinanceMobile(String nowFinanceMobile) {
		NowFinanceMobile = nowFinanceMobile;
	}

	public String getOldSalesmanName() {
		return oldSalesmanName;
	}

	public void setOldSalesmanName(String oldSalesmanName) {
		this.oldSalesmanName = oldSalesmanName;
	}

	public String getOldSalesmanMobile() {
		return oldSalesmanMobile;
	}

	public void setOldSalesmanMobile(String oldSalesmanMobile) {
		this.oldSalesmanMobile = oldSalesmanMobile;
	}
	public Integer getProjectType() {
		return projectType;
	}
	public void setProjectType(Integer projectType) {
		this.projectType = projectType;
	}
	public Integer getDunType() {
		return dunType;
	}
	public void setDunType(Integer dunType) {
		this.dunType = dunType;
	}
	public Integer getDunStatus() {
		return dunStatus;
	}
	public void setDunStatus(Integer dunStatus) {
		this.dunStatus = dunStatus;
	}
	public BigDecimal getInvoiceAmount() {
		if (invoiceAmount==null) {
			return new BigDecimal(0);
		}
		return invoiceAmount;
	}
	public void setInvoiceAmount(BigDecimal invoiceAmount) {
		this.invoiceAmount = invoiceAmount;
	}
	public BigDecimal getAppropriationRatio() {
		return appropriationRatio;
	}
	public void setAppropriationRatio(BigDecimal appropriationRatio) {
		this.appropriationRatio = appropriationRatio;
	}
	public BigDecimal getSetUpAmount() {
		return setUpAmount;
	}
	public void setSetUpAmount(BigDecimal setUpAmount) {
		this.setUpAmount = setUpAmount;
	}
	public Integer getIschange() {
		return ischange;
	}
	public void setIschange(Integer ischange) {
		this.ischange = ischange;
	}
	public List<?> getDunList() {
		return dunList;
	}
	public void setDunList(List<?> dunList) {
		this.dunList = dunList;
	}
	public List<?> getTaskList() {
		return taskList;
	}
	public void setTaskList(List<?> taskList) {
		this.taskList = taskList;
	}
	public String getNickname() {
		return nickname;
	}
	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

}
