package com.zcloud.fire.check.domain.model;

import com.jjb.saas.framework.domain.model.BaseE;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;
import java.util.stream.Collectors;

/**
 * web-domain
 *
 * @Author zhaokai
 * @Date 2025-12-11 15:32:49
 */
@Data
public class FireCheckListUserE extends BaseE {
    //主键
    private Long id;
    //业务主键id
    private String fireCheckListUserId;
    //点检表id
    private String fireCheckId;
    //企业id
    private Long corpinfoId;
    //负责部门
    private Long departmentId;
    //负责人
    private Long userId;
    //乐观锁
    private Integer version;
    //创建人
    private Long createId;
    //创建人姓名
    private String createName;
    //创建时间
    private LocalDateTime createTime;
    //更新人
    private Long updateId;
    //修改人名称
    private String updateName;
    //更新时间
    private LocalDateTime updateTime;
    //描述
    private String remarks;
    //是否删除
    private String deleteEnum;
    //租户ID
    private Long tenantId;
    //机构ID
    private Long orgId;
    //环境
    private String env;

    public List<FireCheckListUserE> initUser(List<Long> userIdList, Long departmentId, FireCheckListE fireCheckListE) {
      List<FireCheckListUserE> fireCheckListUserEList = userIdList.stream().map(userId -> {
          FireCheckListUserE fireCheckListUserE = new FireCheckListUserE();
          fireCheckListUserE.setFireCheckId(fireCheckListE.getFireCheckId());
          fireCheckListUserE.setDepartmentId(departmentId);
          fireCheckListUserE.setUserId(userId);
          return fireCheckListUserE;
      }).collect(Collectors.toList());
      return fireCheckListUserEList;
    }
}

