package com.sifang.modules.order.entity;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
*工单信息表实体诶
 * @author lzp
 * @version 2019-11-13
*/

@Entity
@Table(name = "crm_order")
public class CrmOrder implements Serializable{

    public static final String ORDERTYPE_ZERO = "0";
    public static final String ORDERTYPE_ONE = "1";
    public static final String ORDERTYPETWO = "2";
    public static final String ORDERTYPETHREE = "3";
    public static final String FOUR = "4";
    public static final String FIVE= "5";
    public static final String SIX = "6";
    public static final String SEVEN = "7";
    private static  final BigDecimal BIGONT = new BigDecimal("0.00");


    private String id;  // 工单id
     private String number; // 工单编号，生成规则:WX（维修）、 AN（安装）年月日时分+随机四位（工单编号不可重复）,例如WX2019041012247567
     private String orderType; // 工单来源类型：1.用户在线报修 2.平台录入 3.其他 默认2 ,4电商
     private Date createTime; // 工单创建时间
     private Date repairTime; // 工单报修时间
     private String createBy; // 工单创建人user_id
     private String applianceBrand; // 设备品牌
     private String applianceCategory; // 设备类型
     private String applianceModel; // 设备型号
     private String applianceBarcode; // 设备条码
     private Date applianceBuyTime; // 投运日期
    private BigDecimal applianceCapacity; // 设备容量
     private String applianceMachineCode; // 设备序列号
     private String customerName; // 用户姓名
     private String province; // 省
     private String city; // 市
     private String area; // 区
     private String customerAddress; // 用户详细地址
     private String customerMobile; // 用户联系方式一
     private String customerTelephone; // 用户联系方式二
     private String customerLnglat;// 用户的坐标信息：（格式：纬度，经度）
     private Date promiseTime;// 预约时间
     private String promiseLimit;// 时间要求，6:00-8:00，8:00-10:00，10:00-12:00，12:00-14:00，14:00-16:00，16:00-18:00，18:00-20:00，20:00-22:00
     private String warrantyType;// 保修类型：1.保内 2.保外
    private String serviceType;// 服务类型: 安装/维修 （暂时就两种）
     private String serviceMeasures;// 服务措施
     private String remarks;// 备注(故障描述)
     private String promiseFlag;// 预约标记：0未预约 1已预约
     private String complaintFlag;// 投诉标记：0无投诉 1有投诉（默认为0）
    private String fittingFlag;// 配件标记，0无备件 1待发备件 2已发备件
    private String bdImgs;// 报修图片 多张用逗号" , " 隔开
     private String flag;// 标记类型id
     private String siteId;// 服务商id
     private String siteName;// 服务商名称
     private String employeId;// 工程师id
     private String employeName;// 工程师姓名
     private String employeMobile;// 工程师手机号码
     private Date updateTime;// 工单更新时间，对工单的每次操作都对该值进行更新
     private String updateName;// 更新人姓名
     private String latestProcess;// 最新过程：如 修改预约时间、上门维修、缺件等
     private Date latestProcessTime;// 最新过程时间
     private Integer complaintCount;// 投诉次数
    private BigDecimal siteCost;// 服务商结算费
    private BigDecimal accountsReceivable;// 应收金额
    private String siteStatus;// 工单服务商操作状态:0尚未指派给服务商 1待服务商接单 2服务商已拒单 3待服务商派工 4待工程师接单 5待上门 6服务中 7已完工 8派工取消 9无效工单
    private String status;// 工单平台操作状态：1.待派工 2.服务中 3.待回访 4.待结算 5.已完成 6.无效工单 7.取消工单，默认1
    private Date dispatchTime;// 平台派工时间
    private Date processTime;// 服务商接单时间
    private Date siteDispatchTime;// 服务商派工时间
    private Date siteProcessTime;// 工程师接单时间
    private Date endTime;// 服务商的服务完工时间
    private Date dropInTime;// 服务商的工程师上门时间
    private String disableResource;// 无效原因
    private String callbackResult;// 回访结果 1已完成、2仍需上门
    private BigDecimal mileage;// 工单的里程
    private BigDecimal mileCost;// 里程费
    private BigDecimal serviceCost;// 服务费
    private String powerStationName;// 电站名称
     private String level;// 重要程度:1.紧急 2.一般
    private String pleaseReferMall;// 销售商
    private String invoice;// 发票号码
    private String memoNote;


    private String specialInstallation;// 特殊安装单（渠道安装单） 1否 、2是 默认为 1
    private BigDecimal totalCollections;// 收款总额
    private BigDecimal fittingCost;// 备件费用


    private String customerId; // 用户id

    public BigDecimal getFittingCost() {
        return fittingCost;
    }

    public void setFittingCost(BigDecimal fittingCost) {
        this.fittingCost = fittingCost;
    }

    private String warrantyFlag;
    public CrmOrder() {
        super();
        this.createTime = new Date();
        this.orderType = ORDERTYPE_ONE;
        this.status = ORDERTYPE_ONE;
        this.complaintFlag = ORDERTYPE_ZERO;
        this.siteStatus = ORDERTYPE_ZERO;
        this.complaintCount = 0;
        this.siteCost = BIGONT;
        this.accountsReceivable = BIGONT;
        this.mileage = BIGONT;
        this.fittingFlag="0";
        this.totalCollections=BIGONT;
        this.specialInstallation="1";
        this.warrantyFlag="0";
        this.mileCost = BIGONT;
        this.serviceCost = BIGONT;
        this.fittingCost = BIGONT;
    }

    public String getMemoNote() {
        return memoNote;
    }

    public void setMemoNote(String memoNote) {
        this.memoNote = memoNote;
    }

    public BigDecimal getMileCost() {
        return mileCost;
    }

    public void setMileCost(BigDecimal mileCost) {
        this.mileCost = mileCost;
    }

    public BigDecimal getServiceCost() {
        return serviceCost;
    }

    public void setServiceCost(BigDecimal serviceCost) {
        this.serviceCost = serviceCost;
    }

    public String getWarrantyFlag() {
        return warrantyFlag;
    }

    public void setWarrantyFlag(String warrantyFlag) {
        this.warrantyFlag = warrantyFlag;
    }


    public BigDecimal getMileage() {
        return mileage;
    }

    public void setMileage(BigDecimal mileage) {
        this.mileage = mileage;
    }

    public String getPowerStationName() {
        return powerStationName;
    }

    public void setPowerStationName(String powerStationName) {
        this.powerStationName = powerStationName;
    }

    public String getLevel() {
        return level;
    }

    public void setLevel(String level) {
        this.level = level;
    }

    public String getPromiseFlag() {
        return promiseFlag;
    }

    public void setPromiseFlag(String promiseFlag) {
        this.promiseFlag = promiseFlag;
    }

    public Date getSiteProcessTime() {
        return siteProcessTime;
    }

    public void setSiteProcessTime(Date siteProcessTime) {
        this.siteProcessTime = siteProcessTime;
    }

    public String getCallbackResult() {
        return callbackResult;
    }

    public void setCallbackResult(String callbackResult) {
        this.callbackResult = callbackResult;
    }

    public String getServiceMeasures() {
        return serviceMeasures;
    }

    public void setServiceMeasures(String serviceMeasures) {
        this.serviceMeasures = serviceMeasures;
    }

    @Id
    @GeneratedValue(generator = "idGenerator")
    @GenericGenerator(name = "idGenerator", strategy = "uuid")
    public String getId() {
        return id;
    }

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

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getOrderType() {
        return orderType;
    }

    public void setOrderType(String orderType) {
        this.orderType = orderType;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getRepairTime() {
        return repairTime;
    }

    public void setRepairTime(Date repairTime) {
        this.repairTime = repairTime;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public String getApplianceBrand() {
        return applianceBrand;
    }

    public void setApplianceBrand(String applianceBrand) {
        this.applianceBrand = applianceBrand;
    }

    public String getApplianceCategory() {
        return applianceCategory;
    }

    public void setApplianceCategory(String applianceCategory) {
        this.applianceCategory = applianceCategory;
    }

    public String getApplianceModel() {
        return applianceModel;
    }

    public void setApplianceModel(String applianceModel) {
        this.applianceModel = applianceModel;
    }

    public String getApplianceBarcode() {
        return applianceBarcode;
    }

    public void setApplianceBarcode(String applianceBarcode) {
        this.applianceBarcode = applianceBarcode;
    }

    public Date getApplianceBuyTime() {
        return applianceBuyTime;
    }

    public void setApplianceBuyTime(Date applianceBuyTime) {
        this.applianceBuyTime = applianceBuyTime;
    }


    public String getApplianceMachineCode() {
        return applianceMachineCode;
    }

    public void setApplianceMachineCode(String applianceMachineCode) {
        this.applianceMachineCode = applianceMachineCode;
    }

    public Date getSiteDispatchTime() {
        return siteDispatchTime;
    }

    public void setSiteDispatchTime(Date siteDispatchTime) {
        this.siteDispatchTime = siteDispatchTime;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public String getCustomerAddress() {
        return customerAddress;
    }

    public void setCustomerAddress(String customerAddress) {
        this.customerAddress = customerAddress;
    }

    public String getCustomerMobile() {
        return customerMobile;
    }

    public void setCustomerMobile(String customerMobile) {
        this.customerMobile = customerMobile;
    }

    public String getCustomerTelephone() {
        return customerTelephone;
    }

    public void setCustomerTelephone(String customerTelephone) {
        this.customerTelephone = customerTelephone;
    }


    public String getCustomerLnglat() {
        return customerLnglat;
    }

    public void setCustomerLnglat(String customerLnglat) {
        this.customerLnglat = customerLnglat;
    }


    public Date getPromiseTime() {
        return promiseTime;
    }

    public void setPromiseTime(Date promiseTime) {
        this.promiseTime = promiseTime;
    }

    public String getPromiseLimit() {
        return promiseLimit;
    }

    public void setPromiseLimit(String promiseLimit) {
        this.promiseLimit = promiseLimit;
    }

    public String getWarrantyType() {
        return warrantyType;
    }

    public void setWarrantyType(String warrantyType) {
        this.warrantyType = warrantyType;
    }

    public String getServiceType() {
        return serviceType;
    }

    public void setServiceType(String serviceType) {
        this.serviceType = serviceType;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public String getComplaintFlag() {
        return complaintFlag;
    }

    public void setComplaintFlag(String complaintFlag) {
        this.complaintFlag = complaintFlag;
    }

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    public String getSiteId() {
        return siteId;
    }

    public void setSiteId(String siteId) {
        this.siteId = siteId;
    }

    public String getSiteName() {
        return siteName;
    }

    public void setSiteName(String siteName) {
        this.siteName = siteName;
    }

    public String getEmployeId() {
        return employeId;
    }

    public void setEmployeId(String employeId) {
        this.employeId = employeId;
    }

    public String getEmployeName() {
        return employeName;
    }

    public void setEmployeName(String employeName) {
        this.employeName = employeName;
    }

    public String getEmployeMobile() {
        return employeMobile;
    }

    public void setEmployeMobile(String employeMobile) {
        this.employeMobile = employeMobile;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getUpdateName() {
        return updateName;
    }

    public void setUpdateName(String updateName) {
        this.updateName = updateName;
    }


    public String getLatestProcess() {
        return latestProcess;
    }

    public void setLatestProcess(String latestProcess) {
        this.latestProcess = latestProcess;
    }

    public Date getLatestProcessTime() {
        return latestProcessTime;
    }

    public void setLatestProcessTime(Date latestProcessTime) {
        this.latestProcessTime = latestProcessTime;
    }

    public String getSiteStatus() {
        return siteStatus;
    }

    public void setSiteStatus(String siteStatus) {
        this.siteStatus = siteStatus;
    }

    public Integer getComplaintCount() {
        return complaintCount;
    }

    public void setComplaintCount(Integer complaintCount) {
        this.complaintCount = complaintCount;
    }

    public BigDecimal getSiteCost() {
        return siteCost;
    }

    public void setSiteCost(BigDecimal siteCost) {
        this.siteCost = siteCost;
    }

    public BigDecimal getAccountsReceivable() {
        return accountsReceivable;
    }

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

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Date getDispatchTime() {
        return dispatchTime;
    }

    public void setDispatchTime(Date dispatchTime) {
        this.dispatchTime = dispatchTime;
    }

    public Date getProcessTime() {
        return processTime;
    }

    public void setProcessTime(Date processTime) {
        this.processTime = processTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public Date getDropInTime() {
        return dropInTime;
    }

    public void setDropInTime(Date dropInTime) {
        this.dropInTime = dropInTime;
    }

    public String getDisableResource() {
        return disableResource;
    }

    public void setDisableResource(String disableResource) {
        this.disableResource = disableResource;
    }
    public String getPleaseReferMall() {
        return pleaseReferMall;
    }

    public void setPleaseReferMall(String pleaseReferMall) {
        this.pleaseReferMall = pleaseReferMall;
    }

    public String getInvoice() {
        return invoice;
    }

    public void setInvoice(String invoice) {
        this.invoice = invoice;
    }

    public BigDecimal getApplianceCapacity() {
        return applianceCapacity;
    }

    public void setApplianceCapacity(BigDecimal applianceCapacity) {
        this.applianceCapacity = applianceCapacity;
    }

    public String getFittingFlag() {
        return fittingFlag;
    }

    public void setFittingFlag(String fittingFlag) {
        this.fittingFlag = fittingFlag;
    }

    public String getBdImgs() {
        return bdImgs;
    }

    public void setBdImgs(String bdImgs) {
        this.bdImgs = bdImgs;
    }

    public BigDecimal getTotalCollections() {
        return totalCollections;
    }

    public void setTotalCollections(BigDecimal totalCollections) {
        this.totalCollections = totalCollections;
    }
    public String getSpecialInstallation() {
        return specialInstallation;
    }

    public void setSpecialInstallation(String specialInstallation) {
        this.specialInstallation = specialInstallation;
    }

    public String getCustomerId() {
        return customerId;
    }

    public void setCustomerId(String customerId) {
        this.customerId = customerId;
    }
}
