package com.cool.store.vo.inspection.setting;

import com.cool.store.entity.HyInspectionSettingDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.List;
import java.util.Objects;

/**
 * @author zhangchenbiao
 * @FileName: InspectionSettingPageVO
 * @Description:
 * @date 2023-07-17 14:32
 */
@Data
public class InspectionSettingDetailVO {

    @ApiModelProperty("id")
    private Long inspectionSettingId;

    @ApiModelProperty("区域名称")
    private String zoneName;

    @ApiModelProperty("稽核人id")
    private String inspectionUserId;

    @ApiModelProperty("稽核人名称")
    private String inspectionUserName;

    @ApiModelProperty("归属地ids")
    private List<Long> openAreaMappingIds;

    public static InspectionSettingDetailVO convertVO(HyInspectionSettingDO param, String inspectionUserName, List<Long> openAreaMappingIds){
        if(Objects.isNull(param)){
            return null;
        }
        InspectionSettingDetailVO result = new InspectionSettingDetailVO();
        result.setInspectionSettingId(param.getId());
        result.setZoneName(param.getZoneName());
        result.setInspectionUserId(param.getInspectionUserId());
        result.setInspectionUserName(inspectionUserName);
        result.setOpenAreaMappingIds(openAreaMappingIds);
        return result;
    }

}
