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

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.util.Date;

/**
 * 安防监护 服务工单
 * Created by yeshijie on 2021/4/1.
 */
@Entity
@Table(name = "base_security_monitoring_order")
public class SecurityMonitoringOrderDO extends UuidIdentityEntityWithOperator {
    /**
     * 工单状态：
     */
    /**
     * 工单状态：
     */
    public enum Status {

        ErrorWarning(-2, "误报警"),
        cancel(-1, "已取消"),
        complete(0, "已完成"),
        apply(1, "申请中");

        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 ExamPaperUploadWay {

        photo(1, "拍照补录"),
        interfaceData(2,"接口数据");

        private Integer type;
        private String desc;

        ExamPaperUploadWay(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 DoctorSignWay {

        locate(1, "定位"),
        sacn(2,"扫码");

        private Integer type;
        private String desc;

        DoctorSignWay(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 patient;

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

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

    /**
     * 服务描述 关联security_server_dict
     */
    private String serveDesc;

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

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

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

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

    /**
     * 备注
     */
    private String remark;

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

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

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

    /**
     * 医生预计到达时间
     */
    private String doctorArrivingTime;

    /**
     * 医生签到时间
     */
    @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;


    /**
     * 医生诊疗现场照片，最多9张，逗号分隔
     */
    private String presentImgs;

    /**
     * 是否需要上传补录报告：0-不需要，1-需要，待补录；2-需要，已补录
     */
    private Integer examPaperStatus;

    /**
     * 医生上传居民的化验检查报告照片
     */
    private String examPaperImgs;

    /**
     * 化验检查报告补录时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date examPaperUploadTime;

    /**
     * 化验检查报告补录方式，1-拍照补录，2-接口数据
     */
    private Integer examPaperUploadWay;

    /**
     * 工单状态：
     */
    private Integer status;

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

    /**
     * 取消类型：1-医生取消，2-居民取消
     */
    private Integer cancelType;

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

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

    /**
     * 服务小结
     */
    private EmergencyWarnConclusionDO emergencyWarnConclusionDO;

    /**
     * 服务医生响应时间（第一条咨询或者接单时间）
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date serviceResponseTime;


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

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

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

    /**
     * 人群类型名称
     */
    private String typeValue;

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

    /**
     * 服务机构
     */
    private String hospital;
    private Integer conclusionStatus;//服务小结登记状态：1待补录；2-已补录
    private Integer type;//发起工单类型（1本人发起 2家人待预约 3医生代预约）
    private String authorizeImage;//电子健康卡授权图片
    private String relationCode;//业务关联
    private String serviceStatus;//服务类型 1-预约项目 2-即时项目
    private String orderInfo;//工单详情 0-未推送 1-未确认 2-已确认
    private String doctorConfirmFinishImg;
    private Integer orderSource;//工单发起来源状态 1APP 2手环 3居家报警 4监控器发起 5睡眠带 6气感报警器 7 烟感报警器 8拐杖发起
    private Integer emergencyCancel;// 紧急预警工单误报警原因 字典emergency_cancel
    private String topicItem;//安防工单所属专题 base_system_dict_entry表service_item
    private String sceneImg;//现场照片
    private String deviceSn;//设备sn  设备触发是才有该字段值
    private String warnInfo;//触发工单时信息如 烟雾心率等

    /**
     * 医生确认医生结束服务时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date doctorConfirmFinishTime;



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

    @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 = "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 = "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 = "doctor_arriving_time")
    public String getDoctorArrivingTime() {
        return doctorArrivingTime;
    }
    public void setDoctorArrivingTime(String doctorArrivingTime) {
        this.doctorArrivingTime = doctorArrivingTime;
    }

    @Column(name = "doctor_sign_time")
    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 = "present_imgs")
    public String getPresentImgs() {
        return presentImgs;
    }
    public void setPresentImgs(String presentImgs) {
        this.presentImgs = presentImgs;
    }

    @Column(name = "exam_paper_status")
    public Integer getExamPaperStatus() {
        return examPaperStatus;
    }
    public void setExamPaperStatus(Integer examPaperStatus) {
        this.examPaperStatus = examPaperStatus;
    }

    @Column(name = "exam_paper_imgs")
    public String getExamPaperImgs() {
        return examPaperImgs;
    }
    public void setExamPaperImgs(String examPaperImgs) {
        this.examPaperImgs = examPaperImgs;
    }

    @Column(name = "exam_paper_upload_time")
    public Date getExamPaperUploadTime() {
        return examPaperUploadTime;
    }
    public void setExamPaperUploadTime(Date examPaperUploadTime) {
        this.examPaperUploadTime = examPaperUploadTime;
    }

    @Column(name = "exam_paper_upload_way")
    public Integer getExamPaperUploadWay() {
        return examPaperUploadWay;
    }
    public void setExamPaperUploadWay(Integer examPaperUploadWay) {
        this.examPaperUploadWay = examPaperUploadWay;
    }

    @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 = "hospital")
    public String getHospital() {
        return hospital;
    }

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

    @Transient
    public EmergencyWarnConclusionDO getEmergencyWarnConclusionDO() {
        return emergencyWarnConclusionDO;
    }

    public void setEmergencyWarnConclusionDO(EmergencyWarnConclusionDO emergencyWarnConclusionDO) {
        this.emergencyWarnConclusionDO = emergencyWarnConclusionDO;
    }

    @Column(name = "service_response_time")
    public Date getServiceResponseTime() {
        return serviceResponseTime;
    }

    public void setServiceResponseTime(Date serviceResponseTime) {
        this.serviceResponseTime = serviceResponseTime;
    }

    @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 getTypeValue() {
        return typeValue;
    }

    public void setTypeValue(String typeValue) {
        this.typeValue = typeValue;
    }

    @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;
    }

    public String getAuthorizeImage() {
        return authorizeImage;
    }

    public void setAuthorizeImage(String authorizeImage) {
        this.authorizeImage = authorizeImage;
    }

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

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

    @Column(name = "service_status")
    public String getServiceStatus() {
        return serviceStatus;
    }

    public void setServiceStatus(String serviceStatus) {
        this.serviceStatus = serviceStatus;
    }

    @Column(name = "order_info")
    public String getOrderInfo() {
        return orderInfo;
    }

    public void setOrderInfo(String orderInfo) {
        this.orderInfo = orderInfo;
    }

    public Integer getConclusionStatus() {
        return conclusionStatus;
    }

    public void setConclusionStatus(Integer conclusionStatus) {
        this.conclusionStatus = conclusionStatus;
    }

    public String getDoctorConfirmFinishImg() {
        return doctorConfirmFinishImg;
    }

    public void setDoctorConfirmFinishImg(String doctorConfirmFinishImg) {
        this.doctorConfirmFinishImg = doctorConfirmFinishImg;
    }

    public Date getDoctorConfirmFinishTime() {
        return doctorConfirmFinishTime;
    }

    public void setDoctorConfirmFinishTime(Date doctorConfirmFinishTime) {
        this.doctorConfirmFinishTime = doctorConfirmFinishTime;
    }

    public Integer getOrderSource() {
        return orderSource;
    }

    public void setOrderSource(Integer orderSource) {
        this.orderSource = orderSource;
    }

    public Integer getEmergencyCancel() {
        return emergencyCancel;
    }

    public void setEmergencyCancel(Integer emergencyCancel) {
        this.emergencyCancel = emergencyCancel;
    }

    public String getTopicItem() {
        return topicItem;
    }

    public void setTopicItem(String topicItem) {
        this.topicItem = topicItem;
    }

    public String getSceneImg() {
        return sceneImg;
    }

    public void setSceneImg(String sceneImg) {
        this.sceneImg = sceneImg;
    }

    public String getDeviceSn() {
        return deviceSn;
    }

    public void setDeviceSn(String deviceSn) {
        this.deviceSn = deviceSn;
    }

    public String getWarnInfo() {
        return warnInfo;
    }

    public void setWarnInfo(String warnInfo) {
        this.warnInfo = warnInfo;
    }
}
