package com.yuchen.saas.device.api.vo.assets;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import org.nest.springwrap.core.tool.node.INode;

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


@Getter
@Setter
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "SaasAssetsAddressTreeVO", description = "SaasAssetsAddressTreeVO")
public class SaasAssetsAddressTreeVO extends SaasAssetsAddressVO implements INode<SaasAssetsAddressTreeVO> {
	private static final long serialVersionUID = 1L;

	@JsonSerialize(using = ToStringSerializer.class)
	private Long id;

	@JsonSerialize(using = ToStringSerializer.class)
	private Long parentId;

	@JsonInclude(JsonInclude.Include.NON_EMPTY)
	private List<SaasAssetsAddressTreeVO> children;

	@JsonInclude(JsonInclude.Include.NON_EMPTY)
	private Boolean hasChildren;

	@ApiModelProperty(name = "checkAssetsNum", value = "盘点状态数量,0未盘,1 已盘 2盘盈、3盘亏、4存疑")
	private Map<Integer,Integer> checkAssetsNum;

	@Override
	public List<SaasAssetsAddressTreeVO> getChildren() {
		if (this.children == null) {
			this.children = new ArrayList<>();
		}
		return this.children;
	}




}
