package com.yunfeiyun.agmp.fms.domain.resvo;

import com.yunfeiyun.agmp.common.enums.DictTypeEnums;
import com.yunfeiyun.agmp.common.utils.DictUtils;
import com.yunfeiyun.agmp.fms.domain.vo.WmsAssetgoodsVo;
import lombok.Data;
import org.springframework.util.CollectionUtils;

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

@Data
public class WmsGoodsAppMapResVo {
    private String id;
    private String name;
    private List<WmsAssetgoodsVo> contents;

    public String getName() {
        return DictUtils.getDictLabel(DictTypeEnums.WMS_GOODS_TYPE.getCode(), id);
    }

    public List<WmsAssetgoodsVo> getContents() {
        if (CollectionUtils.isEmpty(contents)) {
            this.contents = new ArrayList<>();
        }
        return contents;
    }
}
