package cn.com.ty.lift.business.maintenance.dao.entity.model.response;

import cn.com.ty.lift.business.evaluation.dao.entity.Evaluation;
import cn.com.ty.lift.business.maintenance.dao.entity.MaintenanceOption;
import cn.com.ty.lift.business.maintenance.dao.entity.MaintenanceRecord;
import cn.com.ty.lift.business.maintenance.dao.entity.MtRecordImg;
import cn.hutool.core.date.BetweenFormater;
import cn.hutool.core.date.DateUtil;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Collection;
import java.util.List;

/**
 * <p>保养信息返回体</p>
 * @author wcz
 * @since  2020/1/17
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class MtRecordResponse extends MaintenanceRecord {

    /**
     * 项目名
     */
    private String projectName;
    /**
     * 项目编号
     */
    private String projectCode;

    /**
     * 维保公司名
     */
    private String mtCompanyName;

    /**
     * 单位设备编号
     */
    private String useCompanyCode;
    /**
     * 电梯类别(1:曳引梯;2:液压梯;3:杂物梯;4:自动扶梯;5:自动人行道)
     */
    private Integer category;

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

    /**
     * 维保工
     */
    private String workerName;

    /**
     * 维修时长秒数
     */
    private long repairDiff;

    private String repairDuration;
    /**
     * 重新getter方法，换算时长
     * XX天XX小时XX分XX秒
     * @return
     */
    public String getRepairDuration() {
        return DateUtil.formatBetween(this.repairDiff, BetweenFormater.Level.SECOND);
    }

    private Integer starLevel;

    private Collection<MaintenanceOption> mtOptions;

    private List<MtRecordImg> mtRecordImgs;

    private Evaluation evaluation;
}
