wtt
2024-10-18 cd50e79ee0899945e12c0092b83b105649e70e84
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
using System;
using System.Xml.Serialization;
using System.Collections.Generic;
using Top.Api.Util;
using Top.Api;
using Top.Api.DingTalk;
 
namespace DingTalk.Api.Request
{
    /// <summary>
    /// TOP API: dingtalk.smartwork.bpms.processinstance.create
    /// </summary>
    public class SmartworkBpmsProcessinstanceCreateRequest : BaseDingTalkRequest<DingTalk.Api.Response.SmartworkBpmsProcessinstanceCreateResponse>
    {
        /// <summary>
        /// 企业微应用标识
        /// </summary>
        public Nullable<long> AgentId { get; set; }
 
        /// <summary>
        /// 审批人userid列表
        /// </summary>
        public string Approvers { get; set; }
 
        /// <summary>
        /// 抄送人userid列表
        /// </summary>
        public string CcList { get; set; }
 
        /// <summary>
        /// 抄送时间,分为(START,FINISH,START_FINISH)
        /// </summary>
        public string CcPosition { get; set; }
 
        /// <summary>
        /// 发起人所在的部门
        /// </summary>
        public Nullable<long> DeptId { get; set; }
 
        /// <summary>
        /// 审批流表单参数
        /// </summary>
        public string FormComponentValues { get; set; }
 
        public List<FormComponentValueVoDomain> FormComponentValues_ { set { this.FormComponentValues = TopUtils.ObjectToJson(value); } } 
 
        /// <summary>
        /// 审批实例发起人的userid
        /// </summary>
        public string OriginatorUserId { get; set; }
 
        /// <summary>
        /// 审批流的唯一码
        /// </summary>
        public string ProcessCode { get; set; }
 
        #region IDingTalkRequest Members
 
        public override string GetApiName()
        {
            return "dingtalk.smartwork.bpms.processinstance.create";
        }
 
        public override string GetApiCallType()
        {
            return DingTalkConstants.CALL_TYPE_TOP;
        }
 
        public override IDictionary<string, string> GetParameters()
        {
            TopDictionary parameters = new TopDictionary();
            parameters.Add("agent_id", this.AgentId);
            parameters.Add("approvers", this.Approvers);
            parameters.Add("cc_list", this.CcList);
            parameters.Add("cc_position", this.CcPosition);
            parameters.Add("dept_id", this.DeptId);
            parameters.Add("form_component_values", this.FormComponentValues);
            parameters.Add("originator_user_id", this.OriginatorUserId);
            parameters.Add("process_code", this.ProcessCode);
            if (this.otherParams != null)
            {
                parameters.AddAll(this.otherParams);
            }
            return parameters;
        }
 
        public override void Validate()
        {
            RequestValidator.ValidateRequired("approvers", this.Approvers);
            RequestValidator.ValidateMaxListSize("approvers", this.Approvers, 20);
            RequestValidator.ValidateMaxListSize("cc_list", this.CcList, 20);
            RequestValidator.ValidateRequired("dept_id", this.DeptId);
            RequestValidator.ValidateRequired("form_component_values", this.FormComponentValues);
            RequestValidator.ValidateObjectMaxListSize("form_component_values", this.FormComponentValues, 20);
            RequestValidator.ValidateRequired("originator_user_id", this.OriginatorUserId);
            RequestValidator.ValidateRequired("process_code", this.ProcessCode);
        }
 
    /// <summary>
/// FormComponentValueVoDomain Data Structure.
/// </summary>
[Serializable]
 
public class FormComponentValueVoDomain : TopObject
{
            /// <summary>
            /// 扩展值
            /// </summary>
            [XmlElement("ext_value")]
            public string ExtValue { get; set; }
    
            /// <summary>
            /// 表单每一栏的名称
            /// </summary>
            [XmlElement("name")]
            public string Name { get; set; }
    
            /// <summary>
            /// 表单每一栏的值
            /// </summary>
            [XmlElement("value")]
            public string Value { get; set; }
}
 
        #endregion
    }
}