package com.wms_main.model.vo.wms;

import com.wms_main.model.po.TAppStand;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 站台视图对象
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class StandVo {
    
    /**
     * 站台号
     */
    private String standId;
    
    /**
     * 站台名称
     */
    private String standName;
    
    /**
     * 站台类型 1:入库 2:出库
     */
    private Integer standType;
    
    /**
     * 站台状态 0:可用 1:不可用
     */
    private Integer standStatus;
    
    /**
     * 站台电脑的IP
     */
    private String standIp;
    
    /**
     * 站台描述
     */
    private String standDesc;
    
    /**
     * 上次更新时间
     */
    private LocalDateTime lastUpdateTime;
    
    /**
     * 上次更新用户
     */
    private String lastUpdateUser;
    
    /**
     * 将TAppStand转换为StandVo
     * 
     * @param stand 站台实体
     * @return 站台视图对象
     */
    public static StandVo of(TAppStand stand) {
        if (stand == null) {
            return null;
        }
        
        StandVo standVo = new StandVo();
        standVo.setStandId(stand.getStandId());
        standVo.setStandName(stand.getStandName());
        standVo.setStandType(stand.getStandType());
        standVo.setStandStatus(stand.getStandStatus());
        standVo.setStandIp(stand.getStandIp());
        standVo.setStandDesc(stand.getStandDesc());
        standVo.setLastUpdateTime(stand.getLastUpdateTime());
        standVo.setLastUpdateUser(stand.getLastUpdateUser());
        
        return standVo;
    }
}
