package com.zcloud.basic.info.domain.model;

import com.jjb.saas.framework.domain.model.BaseE;
import com.zcloud.gbscommon.utils.UuidUtil;
import lombok.Data;

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

/**
 * web-domain
 *
 * @Author SondonYong
 * @Date 2025-10-31 17:24:04
 */
@Data
public class PostE extends BaseE {
    //主键
    private Long id;
    //业务主键id
    private String postId;
    //部门id
    private Long departmentId;
    //岗位名称
    private String postName;
    //岗位职责
    private String remarks;
    //企业id
    private Long corpinfoId;
    //企业名称
    private String corpinfoName;
    //是否监管岗位 0-否, 1-是
//    private Integer supervisionFlag;

    // 添加关联部门行为
//    public List<PostDepartmentE> addDepartmentIds(Long postId, Long[] departmentIds) {
//        if(Objects.isNull(departmentIds) || departmentIds.length == 0){
//            // 没有部门id集合, 可能是没有给部门权限
//            return new ArrayList<>();
//        }
//        List<PostDepartmentE> postDepartmentEList = new ArrayList<>();
//        for (Long departmentId : departmentIds) {
//            PostDepartmentE e = new PostDepartmentE();
//            e.setPostDepartmentId(UuidUtil.get32UUID());
//            e.setPostId(postId);
//            e.setDepartmentId(departmentId);
//            postDepartmentEList.add(e);
//        }
//        return postDepartmentEList;
//    }
}

