package com.yihu.jw.entity.care.lifeCare;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.jw.entity.UuidIdentityEntityWithOperator;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * Created by yeshijie on 2021/3/26.
 */
@Entity
@Table(name = "base_life_care_order")
public class LifeCareOrderDO extends UuidIdentityEntityWithOperator {
    /**
     * 工单状态
     */
    public enum Status {

        cancel(-1, "已取消"),
        waitForPay(0, "待支付"),
        waitForAccept(1, "待（医生）接单"),//待服务
        signIn(3, "已签到"),//conclusionTime有值 即登记服务小结
        complete(2,"已完成");

        private Integer type;
        private String desc;

        Status(Integer type, String desc) {
            this.type = type;
            this.desc = desc;
        }

        public Integer getType() {
            return type;
        }

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

    }

    /**
     * 取消类型
     */
    public enum CancelType {

        patient(2,"居民取消"),
        doctor(3, "医生取消");

        private Integer type;
        private String desc;

        CancelType(Integer type, String desc) {
            this.type = type;
            this.desc = desc;
        }

        public Integer getType() {
            return type;
        }

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

    }

    /**
     * 支付状态
     */
    public enum payStatus {

        waitForPay(0, "待支付"),
        paid(1, "已支付"),
        Refunded(1, "已退款");

        private Integer type;
        private String desc;

        payStatus(Integer type, String desc) {
            this.type = type;
            this.desc = desc;
        }

        public Integer getType() {
            return type;
        }

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

    /**
     * 服务编号
     */
    private String number;

    /**
     * 代理发起工单的居民code，替父母，孩子等发起工单
     */
    private String proxyPatient;

    /**
     * 代理发起工单的居民code，替父母，孩子等发起工单
     */
    private String proxyPatientName;

    /**
     * 代理发起工单的居民联系电话
     */
    private String proxyPatientPhone;

    /**
     * 被服务的居民code，发起工单的居民的亲属
     */
    private String patient;

    /**
     * 被服务的居民姓名，发起工单的居民的亲属
     */
    private String patientName;

    /**
     * 被服务的居民联系电话
     */
    private String patientPhone;

    /**
     * 发起人与被服务人的关系：自己，父亲，母亲，儿子等
     */
    private String patientRelation;

    /**
     * 居民期望服务时间
     */
    private String patientExpectedServeTime;

    /**
     * 居民自己服务描述
     */
    private String serveDesc;

    /**
     * 服务的区
     */
    private String serveTown;

    /**
     * 服务详细地址
     */
    private String serveAddress;

    /**
     * 服务地址纬度
     */
    private String serveLat;

    /**
     * 服务地址经度
     */
    private String serveLon;

    /**
     * 调度员备注
     */
    private String remark;


    /**
     * 服务总费用
     */
    private BigDecimal totalFee;

    /**
     * 居民期望服务的医生姓名
     */
    private String expectedDoctorName;

    /**
     * 接单的医生code
     */
    private String doctor;

    /**
     * 接单的医生name
     */
    private String doctorName;

    /**
     * 接单的医生类型：医生，健管师，护士等
     */
    private String doctorType;

    /**
     * 医生完成现场照片，最多6张，逗号分隔
     */
    private String completeImgs;
    /**
     * 服务完成笔记
     */
    private String completeRemark;

    /**
     * 小结照片，最多6张，逗号分隔
     */
    private String conclusionImgs;
    /**
     * 服务小结
     */
    private String conclusionRemark;
    /**
     * 工单结时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date conclusionTime;

    /**
     * 工单状态：
     * 待服务 1、已完成 2 、已取消 -1 已签到 3、
     */
    private Integer status;

    /**
     * 工单完成时间（对工单评价完即工单完成）
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date completeTime;

    /**
     * 取消类型：2-居民取消
     */
    private Integer cancelType;

    /**
     * 取消理由
     */
    private String cancelReason;

    /**
     * 取消时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date cancelTime;

    /**
     * 付款方式：1-微信支付，2-线下支付（居民自己向医院支付，具体怎么支付由医院来定）
     */
    private Integer payWay;

    /**
     * 支付流水号
     */
    private String payNumber;

    /**
     * 支付时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date payTime;

    /**
     * 工单对应的服务项
     */
    private List<LifeCareFeeDetailDO> feeDetailList;

    /**
     * 患者性别
     */
    private String sex;

    /**
     * 患者年龄
     */
    private Integer age;

    /**
     * 患者头像
     */
    private String photo;

    /**
     * 会话id
     */
    private String sessionId;

    /**
     * 服务机构
     */
    private String hospital;
    private String hospitalName;
    private Integer type;//发起工单类型（1本人发起 2家人待预约 3医生代预约 4家属预约）
    private String relationCode;//业务关联
    /**
     * 医生签到时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date doctorSignTime;

    /**
     * 医生签到方式：1-定位，2-扫码
     */
    private Integer doctorSignWay;

    /**
     * 医生签到位置，记录详细地址
     */
    private String doctorSignLocation;

    /**
     * 医生签到照片
     */
    private String doctorSignImg;
    /**
     *
     */
    private String signDoctor;
    /**
     * 签到医生姓名
     */
    private String signDoctorName;
    /**
     * 0待扣费 1已扣费 2已退费
     */
    private Integer payStatus;//支付状态

    private String doctorPhone;//医生手机信息

    @Column(name = "number")
    public String getNumber() {
        return number;
    }
    public void setNumber(String number) {
        this.number = number;
    }

    @Column(name = "proxy_patient")
    public String getProxyPatient() {
        return proxyPatient;
    }
    public void setProxyPatient(String proxyPatient) {
        this.proxyPatient = proxyPatient;
    }

    @Column(name = "proxy_patient_name")
    public String getProxyPatientName() {
        return proxyPatientName;
    }
    public void setProxyPatientName(String proxyPatientName) {
        this.proxyPatientName = proxyPatientName;
    }

    @Column(name = "proxy_patient_phone")
    public String getProxyPatientPhone() {
        return proxyPatientPhone;
    }
    public void setProxyPatientPhone(String proxyPatientPhone) {
        this.proxyPatientPhone = proxyPatientPhone;
    }

    @Column(name = "patient")
    public String getPatient() {
        return patient;
    }
    public void setPatient(String patient) {
        this.patient = patient;
    }

    @Column(name = "patient_name")
    public String getPatientName() {
        return patientName;
    }
    public void setPatientName(String patientName) {
        this.patientName = patientName;
    }

    @Column(name = "patient_phone")
    public String getPatientPhone() {
        return patientPhone;
    }
    public void setPatientPhone(String patientPhone) {
        this.patientPhone = patientPhone;
    }

    @Column(name = "patient_relation")
    public String getPatientRelation() {
        return patientRelation;
    }
    public void setPatientRelation(String patientRelation) {
        this.patientRelation = patientRelation;
    }


    @Column(name = "patient_expected_serve_time")
    public String getPatientExpectedServeTime() {
        return patientExpectedServeTime;
    }
    public void setPatientExpectedServeTime(String patientExpectedServeTime) {
        this.patientExpectedServeTime = patientExpectedServeTime;
    }

    @Column(name = "serve_desc")
    public String getServeDesc() {
        return serveDesc;
    }
    public void setServeDesc(String serveDesc) {
        this.serveDesc = serveDesc;
    }

    @Column(name = "serve_town")
    public String getServeTown() {
        return serveTown;
    }
    public void setServeTown(String serveTown) {
        this.serveTown = serveTown;
    }

    @Column(name = "serve_address")
    public String getServeAddress() {
        return serveAddress;
    }
    public void setServeAddress(String serveAddress) {
        this.serveAddress = serveAddress;
    }

    @Column(name = "serve_lat")
    public String getServeLat() {
        return serveLat;
    }
    public void setServeLat(String serveLat) {
        this.serveLat = serveLat;
    }

    @Column(name = "serve_lon")
    public String getServeLon() {
        return serveLon;
    }
    public void setServeLon(String serveLon) {
        this.serveLon = serveLon;
    }

    @Column(name = "remark")
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Column(name = "expected_doctor_name")
    public String getExpectedDoctorName() {
        return expectedDoctorName;
    }

    public void setExpectedDoctorName(String expectedDoctorName) {
        this.expectedDoctorName = expectedDoctorName;
    }

    @Column(name = "total_fee")
    public BigDecimal getTotalFee() {
        return totalFee;
    }
    public void setTotalFee(BigDecimal totalFee) {
        this.totalFee = totalFee;
    }

    @Column(name = "doctor")
    public String getDoctor() {
        return doctor;
    }
    public void setDoctor(String doctor) {
        this.doctor = doctor;
    }

    @Column(name = "doctor_name")
    public String getDoctorName() {
        return doctorName;
    }
    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }

    @Column(name = "doctor_type")
    public String getDoctorType() {
        return doctorType;
    }
    public void setDoctorType(String doctorType) {
        this.doctorType = doctorType;
    }

    @Column(name = "complete_imgs")
    public String getCompleteImgs() {
        return completeImgs;
    }

    public void setCompleteImgs(String completeImgs) {
        this.completeImgs = completeImgs;
    }

    @Column(name = "complete_remark")
    public String getCompleteRemark() {
        return completeRemark;
    }

    public void setCompleteRemark(String completeRemark) {
        this.completeRemark = completeRemark;
    }

    @Column(name = "status")
    public Integer getStatus() {
        return status;
    }
    public void setStatus(Integer status) {
        this.status = status;
    }

    @Column(name = "complete_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getCompleteTime() {
        return completeTime;
    }
    public void setCompleteTime(Date completeTime) {
        this.completeTime = completeTime;
    }

    @Column(name = "cancel_type")
    public Integer getCancelType() {
        return cancelType;
    }
    public void setCancelType(Integer cancelType) {
        this.cancelType = cancelType;
    }

    @Column(name = "cancel_reason")
    public String getCancelReason() {
        return cancelReason;
    }
    public void setCancelReason(String cancelReason) {
        this.cancelReason = cancelReason;
    }

    @Column(name = "cancel_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getCancelTime() {
        return cancelTime;
    }
    public void setCancelTime(Date cancelTime) {
        this.cancelTime = cancelTime;
    }

    @Column(name = "pay_way")
    public Integer getPayWay() {
        return payWay;
    }
    public void setPayWay(Integer payWay) {
        this.payWay = payWay;
    }

    @Column(name = "pay_number")
    public String getPayNumber() {
        return payNumber;
    }
    public void setPayNumber(String payNumber) {
        this.payNumber = payNumber;
    }

    @Column(name = "pay_time")
    public Date getPayTime() {
        return payTime;
    }
    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    @Column(name = "hospital")
    public String getHospital() {
        return hospital;
    }

    public void setHospital(String hospital) {
        this.hospital = hospital;
    }

    @Column(name = "hospital_name")
    public String getHospitalName() {
        return hospitalName;
    }

    public void setHospitalName(String hospitalName) {
        this.hospitalName = hospitalName;
    }

    @Transient
    public List<LifeCareFeeDetailDO> getFeeDetailList() {
        return feeDetailList;
    }

    public void setFeeDetailList(List<LifeCareFeeDetailDO> feeDetailList) {
        this.feeDetailList = feeDetailList;
    }

    @Transient
    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    @Transient
    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Transient
    public String getPhoto() {
        return photo;
    }

    public void setPhoto(String photo) {
        this.photo = photo;
    }

    @Transient
    public String getSessionId() {
        return sessionId;
    }

    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }

    public Integer getType() {
        return type;
    }

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

    @Column(name = "relation_code")
    public String getRelationCode() {
        return relationCode;
    }

    public void setRelationCode(String relationCode) {
        this.relationCode = relationCode;
    }

    @Column(name = "doctor_sign_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getDoctorSignTime() {
        return doctorSignTime;
    }
    public void setDoctorSignTime(Date doctorSignTime) {
        this.doctorSignTime = doctorSignTime;
    }

    @Column(name = "doctor_sign_way")
    public Integer getDoctorSignWay() {
        return doctorSignWay;
    }
    public void setDoctorSignWay(Integer doctorSignWay) {
        this.doctorSignWay = doctorSignWay;
    }

    @Column(name = "doctor_sign_location")
    public String getDoctorSignLocation() {
        return doctorSignLocation;
    }
    public void setDoctorSignLocation(String doctorSignLocation) {
        this.doctorSignLocation = doctorSignLocation;
    }

    @Column(name = "doctor_sign_img")
    public String getDoctorSignImg() {
        return doctorSignImg;
    }
    public void setDoctorSignImg(String doctorSignImg) {
        this.doctorSignImg = doctorSignImg;
    }

    @Column(name = "sign_doctor")
    public String getSignDoctor() {
        return signDoctor;
    }

    public void setSignDoctor(String signDoctor) {
        this.signDoctor = signDoctor;
    }

    @Column(name = "sign_doctor_name")
    public String getSignDoctorName() {
        return signDoctorName;
    }

    public void setSignDoctorName(String signDoctorName) {
        this.signDoctorName = signDoctorName;
    }

    @Column(name = "conclusion_imgs")
    public String getConclusionImgs() {
        return conclusionImgs;
    }

    public void setConclusionImgs(String conclusionImgs) {
        this.conclusionImgs = conclusionImgs;
    }

    @Column(name = "conclusion_remark")
    public String getConclusionRemark() {
        return conclusionRemark;
    }

    public void setConclusionRemark(String conclusionRemark) {
        this.conclusionRemark = conclusionRemark;
    }

    @Column(name = "conclusion_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    public Date getConclusionTime() {
        return conclusionTime;
    }

    public void setConclusionTime(Date conclusionTime) {
        this.conclusionTime = conclusionTime;
    }

    public Integer getPayStatus() {
        return payStatus;
    }

    public void setPayStatus(Integer payStatus) {
        this.payStatus = payStatus;
    }

    @Transient
    public String getDoctorPhone() {
        return doctorPhone;
    }

    public void setDoctorPhone(String doctorPhone) {
        this.doctorPhone = doctorPhone;
    }
}
