package cn.com.ty.lift.business.library.dao.entity.model;

import lombok.Data;

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

/**
 * <p>
 *     导入电梯，解析记录接收数据的model
 * </p>
 * @author wcz
 * @since  2019/12/27 13:39
 */
@Data
public class LiftImportModel {

    //电梯类型
    List<String> liftTypes = Arrays.asList("无","直梯","扶梯");
    //电梯类别
    List<String> categories = Arrays.asList("无","曳引梯","液压梯","杂物梯","自动扶梯","自动人行道");
    //设备用途
    List<String> deviceUsages = Arrays.asList("货梯","客梯","医梯","观光梯","杂物梯","别墅梯","无","无","无","无","扶梯","人行道");
    //安全钳类型
    List<String> clampTypes = Arrays.asList("无","瞬时式安全钳","渐进式安全钳");
    //顶升型式
    List<String> topTypes = Arrays.asList("无","直接顶式","间接顶式");

    /**
     * 注册代码
     */
    private String registrationCode;

    /**
     * 电梯类型(1:直梯;2:扶梯)
     */
    private String liftTypeStr;

    private Integer liftType;

    public Integer getLiftType(){
        int index = liftTypes.indexOf(liftTypeStr);
        return index;
    }

    /**
     * 电梯类别字符串
     */
    private String categoryStr;
    /**
     * 电梯类别(1:曳引梯;2:液压梯;3:杂物梯;4:自动扶梯;5:自动人行道)
     */
    private Integer category;
    public Integer getCategory(){
        return categories.indexOf(categoryStr);
    }
    /**
     * 设备用途(11:货梯;12:客梯;13:医梯;14:观光梯;15:杂物梯;16:别墅梯;21:扶梯;22:人行道)
     */
    private String deviceUsageStr;

    private Integer deviceUsage;

    public Integer getDeviceUsage(){
        return deviceUsages.indexOf(deviceUsageStr) + 11;
    }

    /**
     * 提升高度m
     */
    private BigDecimal promoteHeight;
    /**
     * 安全钳类型(1:瞬时式安全钳;2:渐进式安全钳)
     */
    private String clampTypeStr;

    private Integer clampType;

    public Integer getClampType(){
        return clampTypes.indexOf(clampTypeStr);
    }
    /**
     * 电梯载重
     */
    private Integer ratedLoad;
    /**
     * 层站门
     */
    private String layerStationDoor;
    /**
     * 油缸型式
     */
    private String cylinderType;
    /**
     * 油缸数量
     */
    private Integer cylinderNum;
    /**
     * 顶升型式 1 直接顶式,2 间接顶式
     */
    private String topTypeStr;

    private Integer topType;

    public Integer getTopType(){
        int index = topTypes.indexOf(topTypeStr);
        if(index == -1){
            index = 0;
        }
        return index;
    }
    /**
     * 控制方式
     */
    private String controlType;
    /**
     * 液压系统满负荷值
     */
    private Integer mpa;
    /**
     * 电梯品牌
     */
    private String liftBrand;
    /**
     * 电梯型号
     */
    private String liftModel;
    /**
     * 年检日期
     */
    private Date annualInspectionDate;

    /**
     * 设备使用地点
     */
    private String devicePosition;

    /**
     * 首保时间
     */
    private Date firstTime;

    /**
     * 电梯维保负责人
     */
    private String workerName;

    /**
     * 额定速度m/s
     */
    private BigDecimal ratedSpeed;
    /**
     * 单位设备编号
     */
    private String useCompanyCode;

}
