1.组织批量新增接口
<h3>功能描述</h3>
<ul>
<li>该接口用于:批量新增组织数据。</li>
</ul>
<p><code>判重条件:组织编码不为空时不允许重复,为空时不做判重校验,同一父节点下组织名不能重复。</code></p>
<h3>接口定义</h3>
<table>
<thead>
<tr>
<th style="text-align: center;">服务名称</th>
<th style="text-align: center;">批量交易</th>
<th style="text-align: center;">接口类型</th>
<th style="text-align: center;">接口uri(同确认接口)</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center;">组织批量新增接口</td>
<td style="text-align: center;">支持</td>
<td style="text-align: center;">接入/POST</td>
<td style="text-align: center;">/public/organization/v1/batchInsert</td>
</tr>
</tbody>
</table>
<h3>元素<请求></h3>
<ul>
<li><strong>主体</strong></li>
</ul>
<table>
<thead>
<tr>
<th style="text-align: center;">序号</th>
<th style="text-align: center;">字段名</th>
<th style="text-align: center;">类型(约束)</th>
<th style="text-align: center;">必填</th>
<th style="text-align: center;">默认值</th>
<th style="text-align: left;">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center;">1</td>
<td style="text-align: center;">companyId</td>
<td style="text-align: center;">String(20)</td>
<td style="text-align: center;">是</td>
<td style="text-align: center;">分配客户sendAppId。</td>
</tr>
<tr>
<td style="text-align: center;">2</td>
<td style="text-align: center;">organizationList</td>
<td style="text-align: center;">List<organizationInfo></td>
<td style="text-align: center;">是</td>
<td style="text-align: center;">组织数据集合。</td>
</tr>
</tbody>
</table>
<ul>
<li><strong>organizationInfo 说明</strong></li>
</ul>
<table>
<thead>
<tr>
<th style="text-align: center;">序号</th>
<th style="text-align: center;">字段名</th>
<th style="text-align: center;">类型(约束)</th>
<th style="text-align: center;">必填</th>
<th style="text-align: center;">默认值</th>
<th style="text-align: left;">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center;">1</td>
<td style="text-align: center;">organizationName</td>
<td style="text-align: center;">String(64)</td>
<td style="text-align: center;">是</td>
<td style="text-align: center;">组织名称。</td>
</tr>
<tr>
<td style="text-align: center;">2</td>
<td style="text-align: center;">organizationLevel</td>
<td style="text-align: center;">Number(2)</td>
<td style="text-align: center;">是</td>
<td style="text-align: center;">组织层级。组织所在的层级,如:根组织是1,二级组织是2。注:根组织为系统自动生成,无法导入。</td>
</tr>
<tr>
<td style="text-align: center;">3</td>
<td style="text-align: center;">organizationCode</td>
<td style="text-align: center;">String(64)</td>
<td style="text-align: center;">否</td>
<td style="text-align: center;">组织编码。不允许重复,为空时自动生成,建议自行填写。</td>
</tr>
<tr>
<td style="text-align: center;">4</td>
<td style="text-align: center;">parentCode</td>
<td style="text-align: center;">String(64)</td>
<td style="text-align: center;">是</td>
<td style="text-align: center;">父组织编码。上级组织的组织编码。根组织组织编码请向顺丰接口人获取。</td>
</tr>
<tr>
<td style="text-align: center;">5</td>
<td style="text-align: center;">custId</td>
<td style="text-align: center;">String(4000)</td>
<td style="text-align: center;">否</td>
<td style="text-align: center;">月结卡号。上下级组织的月结卡号需为包含关系,即上级组织的月结卡号数据需包含下级组织的月结卡号数据。若有多个,需英文分号隔开。</td>
</tr>
<tr>
<td style="text-align: center;">6</td>
<td style="text-align: center;">custGlobalUse</td>
<td style="text-align: center;">Number(2)</td>
<td style="text-align: center;">否</td>
<td style="text-align: center;">0</td>
<td style="text-align: left;">月结卡号是否全组织使用(0/其它:否,1:是,默认是0)</td>
</tr>
<tr>
<td style="text-align: center;">6</td>
<td style="text-align: center;">contactNo</td>
<td style="text-align: center;">String(20)</td>
<td style="text-align: center;">否</td>
<td style="text-align: center;">组织负责人工号。</td>
</tr>
<tr>
<td style="text-align: center;">7</td>
<td style="text-align: center;">contactName</td>
<td style="text-align: center;">String(20)</td>
<td style="text-align: center;">否</td>
<td style="text-align: center;">组织负责人姓名。</td>
</tr>
<tr>
<td style="text-align: center;">8</td>
<td style="text-align: center;">contactPhone</td>
<td style="text-align: center;">String(20)</td>
<td style="text-align: center;">否</td>
<td style="text-align: center;">组织负责人电话。</td>
</tr>
<tr>
<td style="text-align: center;">9</td>
<td style="text-align: center;">remark</td>
<td style="text-align: center;">String(128)</td>
<td style="text-align: center;">否</td>
<td style="text-align: center;">备注。</td>
</tr>
<tr>
<td style="text-align: center;">10</td>
<td style="text-align: center;">senderWhether</td>
<td style="text-align: center;">Number(1)</td>
<td style="text-align: center;">否</td>
<td style="text-align: center;">审批规则:寄件个数限制。需要使用时需传值,0-否,1-是。默认为否。</td>
</tr>
<tr>
<td style="text-align: center;">11</td>
<td style="text-align: center;">senderNumber</td>
<td style="text-align: center;">Number(10)</td>
<td style="text-align: center;">条件</td>
<td style="text-align: center;">寄件个数限制数量。当xx传1时必填,输入正整数,如:10000,超过限制数量时,寄件会自动触发审批流程。</td>
</tr>
<tr>
<td style="text-align: center;">12</td>
<td style="text-align: center;">freightWhether</td>
<td style="text-align: center;">Number(1)</td>
<td style="text-align: center;">否</td>
<td style="text-align: center;">审批规则:寄件运费限制。需要使用时需传值,0-否,1-是。默认为否。</td>
</tr>
<tr>
<td style="text-align: center;">13</td>
<td style="text-align: center;">freight</td>
<td style="text-align: center;">Number(10,2)</td>
<td style="text-align: center;">条件</td>
<td style="text-align: center;">寄件运费限制金额。当xx传1时必填,如:10000.01,超过限制金额时,寄件会自动触发审批流程。</td>
</tr>
</tbody>
</table>
<h3>元素<响应></h3>
<ul>
<li><strong>主体</strong></li>
</ul>
<table>
<thead>
<tr>
<th style="text-align: center;">序号</th>
<th style="text-align: center;">字段名</th>
<th style="text-align: center;">类型(约束)</th>
<th style="text-align: center;">必填</th>
<th style="text-align: center;">字段说明</th>
<th style="text-align: left;">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center;">1</td>
<td style="text-align: center;">msg</td>
<td style="text-align: center;">String(200)</td>
<td style="text-align: center;">否</td>
<td style="text-align: center;">信息</td>
<td style="text-align: left;">提示信息</td>
</tr>
<tr>
<td style="text-align: center;">2</td>
<td style="text-align: center;">succ</td>
<td style="text-align: center;">String(10)</td>
<td style="text-align: center;">是</td>
<td style="text-align: center;">状态码</td>
<td style="text-align: left;">返回成功或失败信息(ok/fail)</td>
</tr>
<tr>
<td style="text-align: center;">3</td>
<td style="text-align: center;">result</td>
<td style="text-align: center;">List<errorInfo></td>
<td style="text-align: center;">是</td>
<td style="text-align: center;">错误数据集合</td>
<td style="text-align: left;">succ = ok时为空;succ = fail时不为空;</td>
</tr>
</tbody>
</table>
<ul>
<li><strong>errorInfo 说明</strong></li>
</ul>
<table>
<thead>
<tr>
<th style="text-align: center;">序号</th>
<th style="text-align: center;">字段名</th>
<th style="text-align: center;">类型(约束)</th>
<th style="text-align: center;">必填</th>
<th style="text-align: center;">字段说明</th>
<th style="text-align: left;">描述</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: center;">1</td>
<td style="text-align: center;">rowNo</td>
<td style="text-align: center;">Number(10)</td>
<td style="text-align: center;">是</td>
<td style="text-align: center;">错误数据所在行号</td>
</tr>
<tr>
<td style="text-align: center;">2</td>
<td style="text-align: center;">organizationName</td>
<td style="text-align: center;">String(64)</td>
<td style="text-align: center;">是</td>
<td style="text-align: center;">组织名称</td>
</tr>
<tr>
<td style="text-align: center;">3</td>
<td style="text-align: center;">organizationCode</td>
<td style="text-align: center;">String(64)</td>
<td style="text-align: center;">是</td>
<td style="text-align: center;">组织编码</td>
</tr>
<tr>
<td style="text-align: center;">4</td>
<td style="text-align: center;">cause</td>
<td style="text-align: center;">String(100)</td>
<td style="text-align: center;">是</td>
<td style="text-align: center;">错误原因</td>
</tr>
</tbody>
</table>
<h3>报文范例</h3>
<ul>
<li>
<p><strong>请求报文</strong></p>
<pre><code>{
&quot;companyId&quot;:&quot;201905140011898&quot;,
&quot;organizationList&quot;: [
{
&quot;organizationName&quot;: &quot;IT部&quot;,
&quot;organizationLevel&quot;: 2,
&quot;organizationCode&quot;: &quot;IT0001&quot;,
&quot;parentCode&quot;: &quot;SFKDGJ&quot;,
&quot;custId&quot;: &quot;1234567890,1234567891,1234567892&quot;,
&quot;custGlobalUse&quot;:&quot;0&quot;,
&quot;contactNo&quot;: &quot;123465&quot;,
&quot;contactName&quot;: &quot;张三&quot;,
&quot;contactPhone&quot;: &quot;15012345678&quot;,
&quot;remark&quot;: &quot;这是一个相当NB的部门&quot;,
&quot;senderWhether&quot;: 1,
&quot;senderNumber&quot;: 100,
&quot;freightWhether&quot;: 1,
&quot;freight&quot;: 1000
},
{
&quot;organizationName&quot;: &quot;行政部&quot;,
&quot;organizationLevel&quot;: 2,
&quot;organizationCode&quot;: &quot;XZ0001&quot;,
&quot;parentCode&quot;: &quot;SFKDGJ&quot;,
&quot;custId&quot;: &quot;1234567893&quot;,
&quot;custGlobalUse&quot;:&quot;1&quot;,
&quot;contactNo&quot;: &quot;654987&quot;,
&quot;contactName&quot;: &quot;赵四&quot;,
&quot;contactPhone&quot;: &quot;15012345678&quot;,
&quot;remark&quot;: &quot;尼古拉斯家族&quot;,
&quot;senderWhether&quot;: 0,
&quot;freightWhether&quot;: 0
}
]
}</code></pre>
</li>
<li><strong>响应报文</strong>
<ul>
<li>成功报文
<pre><code>{
&quot;succ&quot;: &quot;ok&quot;,
&quot;msg&quot;: &quot;&quot;,
&quot;result&quot;: null
}</code></pre></li>
<li>失败报文-范例1
<pre><code>{
&quot;succ&quot;: &quot;fail&quot;,
&quot;msg&quot;:&quot;数据校验不通过&quot;,
&quot;result&quot;: [
{
&quot;rowNo&quot;: 2,
&quot;organizationName&quot;: &quot;行政部&quot;,
&quot;organizationCode&quot;: &quot;XZ0001&quot;,
&quot;cause&quot;: &quot;上级组织无此月结卡号!&quot;
},
{
&quot;rowNo&quot;: 4,
&quot;organizationName&quot;: &quot;人资部&quot;,
&quot;organizationCode&quot;: &quot;RZ0001&quot;,
&quot;cause&quot;: &quot;组织负责人电话格式错误!&quot;
}
]
}</code></pre></li>
<li>失败报文-范例2
<pre><code>{
&quot;succ&quot;: &quot;fail&quot;,
&quot;msg&quot;:&quot;数据校验不通过&quot;,
&quot;result&quot;: &quot;未接收到组织数据&quot;
}</code></pre></li>
</ul></li>
</ul>