package com.casic.PgInterface.maintenance.dto;

import com.casic.PgInterface.maintenance.domain.PgMaintanceRecordHead;

import java.util.ArrayList;
import java.util.List;

public class PgMaintanceRecordHeadDto {
    private Long id;
    private String planName;//维修柏安阳名称
    private String recordNo;//维修保养单号
    private String reoairMan;//维修人
    private String maintenanceDate;//维修保养日期
    private String buildCabin;//舱室
    private String project;//所属项目
    private String createDate;//创建时间
    private String creator;//创建人

    public Long getId() {
        return id;
    }

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

    public String getPlanName() {
        return planName;
    }

    public void setPlanName(String planName) {
        this.planName = planName;
    }

    public String getRecordNo() {
        return recordNo;
    }

    public void setRecordNo(String recordNo) {
        this.recordNo = recordNo;
    }

    public String getReoairMan() {
        return reoairMan;
    }

    public void setReoairMan(String reoairMan) {
        this.reoairMan = reoairMan;
    }

    public String getMaintenanceDate() {
        return maintenanceDate;
    }

    public void setMaintenanceDate(String maintenanceDate) {
        this.maintenanceDate = maintenanceDate;
    }

    public String getBuildCabin() {
        return buildCabin;
    }

    public void setBuildCabin(String buildCabin) {
        this.buildCabin = buildCabin;
    }

    public String getProject() {
        return project;
    }

    public void setProject(String project) {
        this.project = project;
    }

    public String getCreateDate() {
        return createDate;
    }

    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }


    public static PgMaintanceRecordHeadDto ConvertToDto(PgMaintanceRecordHead pgMaintanceRecordHead){
        PgMaintanceRecordHeadDto pgMaintanceRecordHeadDto=new PgMaintanceRecordHeadDto();

        pgMaintanceRecordHeadDto.setId(pgMaintanceRecordHead.getId());
        pgMaintanceRecordHeadDto.setPlanName(pgMaintanceRecordHead.getPlanName());
        pgMaintanceRecordHeadDto.setRecordNo(pgMaintanceRecordHead.getRecordNo());
        pgMaintanceRecordHeadDto.setReoairMan(pgMaintanceRecordHead.getReoairMan());
        pgMaintanceRecordHeadDto.setMaintenanceDate(pgMaintanceRecordHead.getMaintenanceDate());
        pgMaintanceRecordHeadDto.setBuildCabin(pgMaintanceRecordHead.getBuildCabin());
        pgMaintanceRecordHeadDto.setProject(pgMaintanceRecordHead.getProject());
        pgMaintanceRecordHeadDto.setCreateDate(pgMaintanceRecordHead.getCreateDate());
        pgMaintanceRecordHeadDto.setCreator(pgMaintanceRecordHead.getCreator());

        return pgMaintanceRecordHeadDto;
    }

    public static List<PgMaintanceRecordHeadDto> ConvertToDtoList(List<PgMaintanceRecordHead> pgMaintanceRecordHeadList){

        List<PgMaintanceRecordHeadDto> pgMaintanceRecordHeadDtoList=new ArrayList<>();
        for(PgMaintanceRecordHead pgMaintanceRecordHead : pgMaintanceRecordHeadList){
            pgMaintanceRecordHeadDtoList.add(ConvertToDto(pgMaintanceRecordHead));
        }

        return pgMaintanceRecordHeadDtoList;
    }
}


