package com.yuchen.saas.flow.api.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

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

@Data
public class Node {
    @ApiModelProperty(name = "id", value = "前端维护进来")
    private String id;
    @ApiModelProperty(name = "parentId", value = "父节点id前端维护进来")
    private String parentId;
    @ApiModelProperty(name = "tailId", value = "无需处理")
    private String headId;

    @ApiModelProperty(name = "tailId", value = "无需处理")
    private String tailId;

    @ApiModelProperty(name = "placeHolder", value = "节点显示('操作人类型:操作人' lv:用户:姓名1,姓名2)")
    private String placeHolder;

    @ApiModelProperty(name = "refuse", value = "流程拒绝操作设置")
    private Refuse refuse;

    /**
     *  ROOT( "根节点",0,false),
     *     END( "结束节点",-1,false),
     *
     *     APPROVAL( "审批节点",1,false),
     *     CC( "抄送节点",2,false),
     *     EXCLUSIVE_GATEWAY( "条件分支",4,true),
     *
     *     PARALLEL_GATEWAY( "并行分支",5,true),
     *     EMPTY( "空",3,false),
     */
    @ApiModelProperty(name = "type", value = "节点:0跟节点,-1结束节点,1审批节点,2抄送节点,4条件分支,5并行分支")
    private Integer type;

    @ApiModelProperty(name = "nodeName", value = "节点名称")
    private String nodeName;

    @ApiModelProperty(name = "error", value = "无需处理")
    private Boolean error;

    @ApiModelProperty(name = "childNode", value = "子节点")
    private Node childNode;

    /** 详见 {@link com.yuchen.saas.flow.service.constants.ProcessInstanceConstant.AssignedTypeClass}
     */
    @ApiModelProperty(name = "assignedType", value = "操作人类型:1指定用户,11系统自动拒绝,5发气人自己,8表单人员,9表单部门,10指定部门主管,2指定主管,7联系多级主管,4发起人自选,3角色")
    private Integer assignedType;

    @ApiModelProperty(name = "multiple", value = "无需处理-是否多选根据assignedType=4时(发起人自选)本期暂时不做")
    private Boolean multiple;

    @ApiModelProperty(name = "multipleMode", value = "审批方式:1会签,2或签,3顺签")
    private Integer multipleMode;

    @ApiModelProperty(name = "deptLeaderLevel", value = "几级主管,assignedType=2时联动显示,其他默认1")
    private Integer deptLeaderLevel;
    /**
     * 几级主管 需要关联表单中提交的部门字段,
     */
    @ApiModelProperty(name = "deptFormName", value = "assignedType=2时联动显示,选择表单字段的唯一标识")
    private String deptFormName;

    @ApiModelProperty(name = "formUserId", value = "assignedType=8表单人员时联动显示,选择表单人员字段的唯一标识(本期需求先不处理)")
    private String formUserId;

    @ApiModelProperty(name = "deptUserType", value = "默认值allUser,assignedType=9表单部门时联动显示,allUser部门人员,leader部门主管")
    private String deptUserType;

    @ApiModelProperty(name = "formUserName", value = "assignedType=8表单人员时联动显示,选择表单人员字段名称(本期需求先不处理)")
    private String formUserName;

    @ApiModelProperty(name = "nodeUserList", value = "操作对象(lv:审批人,审批部门)")
    private List<NodeUser> nodeUserList;

    @ApiModelProperty(name = "conditionNodes", value = "条件分支node,结合type=4跟5时设置值")
    private List<Node> conditionNodes;

    @ApiModelProperty(name = "formPerms", value = "表单权限,格式{表单id:value}; value:H(隐藏),R(只读),E(编辑)")
    private Map<String,String> formPerms;

    @ApiModelProperty(name = "nobody", value = "没有操作人时处理策略")
    private Nobody nobody;

    @ApiModelProperty(name = "groupMode", value = "条件设置->false或,true且")
    private Boolean groupMode;


    @ApiModelProperty(name = "conditionList", value = "分支条件组")
    private List<GroupCondition> conditionList;

}
