package com.persagy.bdtp.adm.entity;

import cn.hutool.core.collection.CollUtil;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.persagy.bdtp.adm.entity.db.*;
import com.persagy.dmp.common.model.entity.BaseEntity;
import com.persagy.dmp.digital.entity.ObjectRelation;
import lombok.Data;

import java.util.List;

/**
 * 按建筑下载的数据结构
 */
@Data
public class BuildingData extends DownLoadData {

	private String buildingId;

	private List objects;

	/** 按建筑筛选关系比较困难，待定 */
	private List relations;

	private List<AdmPipe> pipes;

	private List<AdmJobSpace> jobSpace;

	private List<AdmProblemArch> problemArch;

	private List<AdmProblemEquip> problemEquip;

	private List<AdmFile> file;

	private List<AdmQrCode> qrCode;

	private List<AdmServeArea> serveArea;

	/** 待废弃 */
	private String timestamp;

	@Override
	public void buildDownloadTs() {
		long ts = getMaxTs(objects, relations);
		if(ts > 0)
			bdtpDownloadTs = ts;

		ts = getMaxTs(pipes, jobSpace, problemArch, problemEquip, file, qrCode, serveArea);
		if(ts > 0)
			admDownloadTs = ts;
	}

}
