主页
<p>Jeecg 接口文档:
<a href="http://192.168.1.161:8080/jeecg-boot/doc.html#/home">http://192.168.1.161:8080/jeecg-boot/doc.html#/home</a></p>
<p>Gitee 仓库地址:
<a href="https://gitee.com/GuWj1/jeecg">https://gitee.com/GuWj1/jeecg</a></p>
<hr />
<p>[TOC]</p>
<hr />
<h3><strong>1. 登录认证</strong></h3>
<h5>简要描述</h5>
<ul>
<li>用户登录获取token</li>
</ul>
<h5>请求URL</h5>
<ul>
<li><code>http://192.168.1.161:8080/jeecg-boot/sys/login</code></li>
</ul>
<h5>请求方式</h5>
<ul>
<li>POST</li>
</ul>
<h5>参数</h5>
<table>
<thead>
<tr>
<th>参数名</th>
<th>必选</th>
<th>请求类型</th>
<th>数据类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>username</td>
<td>是</td>
<td>body</td>
<td>string</td>
<td>登录账号</td>
</tr>
<tr>
<td>password</td>
<td>是</td>
<td>body</td>
<td>string</td>
<td>登录密码</td>
</tr>
<tr>
<td>captcha</td>
<td>是</td>
<td>body</td>
<td>string</td>
<td>验证码</td>
</tr>
<tr>
<td>checkKey</td>
<td>是</td>
<td>body</td>
<td>string</td>
<td>验证码KEY</td>
</tr>
</tbody>
</table>
<h5>返回示例</h5>
<pre><code class="language-json">{
&quot;success&quot;: true,
&quot;message&quot;: &quot;登录成功&quot;,
&quot;code&quot;: 200,
&quot;result&quot;: {
&quot;token&quot;: &quot;eyJhbGciOi...&quot;,
&quot;userInfo&quot;: {
&quot;id&quot;: &quot;user001&quot;,
&quot;org_code&quot;: &quot;dept01&quot;
}
},
&quot;timestamp&quot;: 1696123456
}</code></pre>
<h5>返回参数说明</h5>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>token</td>
<td>string</td>
<td>授权token</td>
</tr>
<tr>
<td>userInfo.id</td>
<td>string</td>
<td>用户ID</td>
</tr>
<tr>
<td>org_code</td>
<td>string</td>
<td>所属部门编码</td>
</tr>
</tbody>
</table>
<hr />
<h3><strong>2. 验证码获取</strong></h3>
<h5>简要描述</h5>
<ul>
<li>获取图形验证码</li>
</ul>
<h5>请求URL</h5>
<ul>
<li><code>http://192.168.1.161:8080/jeecg-boot/sys/randomImage/{key}</code></li>
</ul>
<h5>请求方式</h5>
<ul>
<li>GET</li>
</ul>
<h5>参数</h5>
<table>
<thead>
<tr>
<th>参数名</th>
<th>必选</th>
<th>请求类型</th>
<th>数据类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>key</td>
<td>是</td>
<td>path</td>
<td>string</td>
<td>随机字符串</td>
</tr>
</tbody>
</table>
<h5>返回示例</h5>
<pre><code class="language-json">{
&quot;success&quot;: true,
&quot;result&quot;: {
&quot;image&quot;: &quot;base64图片数据&quot;,
&quot;checkKey&quot;: &quot;a1b2c3d4&quot;
}
}</code></pre>
<hr />
<h3><strong>3. 角色权限查询</strong></h3>
<h5>简要描述</h5>
<ul>
<li>根据用户ID查询角色权限</li>
</ul>
<h5>请求URL</h5>
<ul>
<li><code>http://192.168.1.161:8080/jeecg-boot/sys/sysDepartRole/queryById</code></li>
</ul>
<h5>请求方式</h5>
<ul>
<li>GET</li>
</ul>
<h5>参数</h5>
<table>
<thead>
<tr>
<th>参数名</th>
<th>必选</th>
<th>请求类型</th>
<th>数据类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>id</td>
<td>是</td>
<td>query</td>
<td>string</td>
<td>用户ID</td>
</tr>
</tbody>
</table>
<h5>返回示例</h5>
<pre><code class="language-json">{
&quot;success&quot;: true,
&quot;result&quot;: {
&quot;roles&quot;: [&quot;综合岗&quot;, &quot;复核岗&quot;],
&quot;depart&quot;: &quot;财务部&quot;
}
}</code></pre>
<hr />
<h3><strong>4. 创建流程</strong></h3>
<h5>简要描述</h5>
<ul>
<li>结算岗发起新流程</li>
</ul>
<h5>请求URL</h5>
<ul>
<li><code>http://yourdomain.com/api/workflow/processes</code></li>
</ul>
<h5>请求方式</h5>
<ul>
<li>POST</li>
</ul>
<h5>Header</h5>
<table>
<thead>
<tr>
<th>参数名</th>
<th>必选</th>
<th>值</th>
</tr>
</thead>
<tbody>
<tr>
<td>Authorization</td>
<td>是</td>
<td>Bearer {token}</td>
</tr>
</tbody>
</table>
<h5>参数</h5>
<table>
<thead>
<tr>
<th>参数名</th>
<th>必选</th>
<th>请求类型</th>
<th>数据类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>flow_type</td>
<td>是</td>
<td>body</td>
<td>string</td>
<td>流程类型</td>
</tr>
<tr>
<td>title</td>
<td>是</td>
<td>body</td>
<td>string</td>
<td>流程标题</td>
</tr>
<tr>
<td>customers</td>
<td>是</td>
<td>body</td>
<td>array</td>
<td>客户数据</td>
</tr>
</tbody>
</table>
<h5>请求示例</h5>
<pre><code class="language-json">{
&quot;flow_type&quot;: &quot;settlement&quot;,
&quot;title&quot;: &quot;结算审批-20231001&quot;,
&quot;customers&quot;: [
{&quot;customer_code&quot;: &quot;90001&quot;, &quot;fee_rate&quot;: 0.35}
]
}</code></pre>
<h5>返回参数说明</h5>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>process_id</td>
<td>string</td>
<td>流程实例ID</td>
</tr>
<tr>
<td>current_node</td>
<td>string</td>
<td>当前节点</td>
</tr>
</tbody>
</table>
<hr />
<h3><strong>5. 获取待办任务</strong></h3>
<h5>简要描述</h5>
<ul>
<li>按岗位类型查询待办列表</li>
</ul>
<h5>请求URL</h5>
<ul>
<li><code>http://yourdomain.com/api/workflow/todos</code></li>
</ul>
<h5>请求方式</h5>
<ul>
<li>GET</li>
</ul>
<h5>参数</h5>
<table>
<thead>
<tr>
<th>参数名</th>
<th>必选</th>
<th>请求类型</th>
<th>数据类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>node_type</td>
<td>是</td>
<td>query</td>
<td>string</td>
<td>岗位类型:edit/verify等</td>
</tr>
</tbody>
</table>
<h5>返回示例</h5>
<pre><code class="language-json">{
&quot;data&quot;: [{
&quot;process_id&quot;: &quot;p-001&quot;,
&quot;title&quot;: &quot;结算审批-张三&quot;,
&quot;reject_reason&quot;: &quot;税率错误&quot;,
&quot;reject_time&quot;: &quot;2023-10-01 10:00:00&quot;
}]
}</code></pre>
<hr />
<h3><strong>6. 提交审批操作</strong></h3>
<h5>简要描述</h5>
<ul>
<li>处理通过/退回操作</li>
</ul>
<h5>请求URL</h5>
<ul>
<li><code>http://yourdomain.com/api/workflow/nodes/actions</code></li>
</ul>
<h5>请求方式</h5>
<ul>
<li>POST</li>
</ul>
<h5>参数</h5>
<table>
<thead>
<tr>
<th>参数名</th>
<th>必选</th>
<th>请求类型</th>
<th>数据类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>process_id</td>
<td>是</td>
<td>body</td>
<td>string</td>
<td>流程ID</td>
</tr>
<tr>
<td>action</td>
<td>是</td>
<td>body</td>
<td>string</td>
<td>approve/reject</td>
</tr>
<tr>
<td>comment</td>
<td>否</td>
<td>body</td>
<td>string</td>
<td>退回原因(必填)</td>
</tr>
</tbody>
</table>
<h5>返回参数</h5>
<table>
<thead>
<tr>
<th>参数名</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>next_node</td>
<td>string</td>
<td>下一节点</td>
</tr>
<tr>
<td>rejected</td>
<td>bool</td>
<td>是否退回操作</td>
</tr>
</tbody>
</table>
<hr />
<h3><strong>接口关系图</strong></h3>
<pre><code class="language-mermaid">graph TD
A[登录] --&gt; B[创建流程]
B --&gt; C[获取待办]
C --&gt; D[提交审批]
D --&gt; E{操作类型}
E --&gt;|通过| F[下一节点]
E --&gt;|退回| G[上一节点]
H[客户查询] --&gt; B</code></pre>
<hr />
<h3><strong>注意事项</strong></h3>
<ol>
<li>所有工作流接口需携带 <code>Authorization</code> 头</li>
<li>退回操作必须填写 <code>comment</code> 字段</li>
<li>财务岗的退回按钮应在前端禁用</li>
<li>验证码有效期5分钟</li>
</ol>