2. 实时看板数据接口
<p>[TOC]</p>
<h5>简要描述</h5>
<ul>
<li>实时看板数据接口 </li>
</ul>
<h5>请求URL</h5>
<ul>
<li><code>http://172.17.10.52:8000/pyapi/kanban</code></li>
</ul>
<h5>负责人:谭自强</h5>
<h5>请求方式</h5>
<ul>
<li>POST </li>
</ul>
<h5>请求参数</h5>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">类型</th>
<th style="text-align: left;">说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">timeRange</td>
<td style="text-align: left;">nvarchar</td>
<td style="text-align: left;">时间范围: date, week, month</td>
</tr>
<tr>
<td style="text-align: left;">ID</td>
<td style="text-align: left;">bigint</td>
<td style="text-align: left;">产品ID</td>
</tr>
</tbody>
</table>
<h5>请求示例</h5>
<pre><code>{
&quot;timeRange&quot;: &quot;month&quot;,
&quot;ID&quot;: 5002536798799265793
}</code></pre>
<h5>返回示例</h5>
<pre><code># &quot;timeRange&quot;: &quot;week&quot; or &quot;month&quot;
{
&quot;code&quot;: 200,
&quot;data&quot;: {
&quot;production_chart&quot;: {
&quot;x_axis&quot;: [
&quot;2022-07-06&quot;,
&quot;2022-07-08&quot;,
&quot;2022-07-12&quot;,
&quot;2022-07-14&quot;
],
&quot;y_axis_chk&quot;: [
0.0,
0.0,
1.0,
0.0
],
&quot;y_axis_pred&quot;: [
0.0,
0.0,
0.0,
11.0
],
&quot;y_axis_prod&quot;: [
1.0,
11.0,
0.0,
11.0
]
},
&quot;statistic&quot;: {
&quot;chk_num&quot;: 1,
&quot;chk_rate&quot;: 4.2,
&quot;ng_num&quot;: 12,
&quot;ng_rate&quot;: 52.2,
&quot;pass_num&quot;: 11,
&quot;pass_rate&quot;: 47.8,
&quot;total_num&quot;: 23
}
},
&quot;msg&quot;: &quot;success&quot;
}
# &quot;timeRange&quot;: &quot;date&quot;
{
&quot;code&quot;: 200,
&quot;data&quot;: {
&quot;production_chart&quot;: null,
&quot;statistic&quot;: {
&quot;chk_num&quot;: 0,
&quot;chk_rate&quot;: 0.0,
&quot;ng_num&quot;: 11,
&quot;ng_rate&quot;: 10.0,
&quot;pass_num&quot;: 99,
&quot;pass_rate&quot;: 90.0,
&quot;total_num&quot;: 110
}
},
&quot;msg&quot;: &quot;success&quot;
}</code></pre>
<h5>返回参数说明</h5>
<table>
<thead>
<tr>
<th style="text-align: left;">参数名</th>
<th style="text-align: left;">类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">data</td>
<td style="text-align: left;">dict</td>
<td>返回production_chart/statistic数据包</td>
</tr>
<tr>
<td style="text-align: left;">production_chart</td>
<td style="text-align: left;">dict</td>
<td>{"X坐标值": x_axis, "Y轴-总产量": y_axis_prod, "Y轴-预测量": y_axis_pred, "Y轴-抽检量": y_axis_chk};在查询本天数据时该字段为None</td>
</tr>
<tr>
<td style="text-align: left;">statistic</td>
<td style="text-align: left;">dict</td>
<td>{"总产量": total_num, "PASS数": pass_num, "NG数": ng_num, "抽检量": chk_num, "PASS率": pass_rate, "NG率": ng_rate, "抽检率": check_rate}</td>
</tr>
</tbody>
</table>
<h5>备注</h5>