package com.zcloud.zcGbsServicer.domain.model;

import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.cola.domain.Entity;
import com.jjb.saas.framework.domain.model.BaseE;
import com.zcloud.zcGbsServicer.domain.enums.PersonTypeEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDate;
import java.util.List;

/**
* web-domain
* @Author makejava
* @Date 2026-01-21 17:23:00
*/
@Data
public class RescueTeamE extends BaseE {
    //业务主键ID
    private String teamId;
    //救援队名称
    private String teamName;
    //类型(字典码)
    private String teamType;
    //负责人单位或部门
    private String chargeOrgDept;
    //队长
    private String captainName;
    //队长电话
    private String captainPhone;
    //建立日期
    private LocalDate establishDate;
    //所属区域或范围(字典码)
    private String regionScope;
    //职责和任务范围
    private String dutyScope;

    //消防队员
    private List<ResourcePersonE> teamMembers;


    public void addInit() {
        if (StrUtil.isBlank(this.teamId)) {
            this.teamId = IdUtil.simpleUUID();
        }
        if (CollectionUtil.isNotEmpty(this.teamMembers)) {
            for (ResourcePersonE member : this.teamMembers) {
                member.setBizId(this.teamId);
                member.setBizType(PersonTypeEnum.RESCUE_TEAM.getCode());
            }
        }
    }

    public void memberInfo (List<ResourcePersonE> teamMembers){
        if (CollectionUtil.isNotEmpty(teamMembers)) {
            this.teamMembers = teamMembers;
        }
    }

}

