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
import { requestClient } from '#/api/request';
 
export namespace MesDvStatisticsApi {
  /** 设备使用统计分析 */
  export interface MachineryStatistics {
    machineryId?: number; // 设备编号
    machineryCode?: string; // 设备编码
    machineryName?: string; // 设备名称
    machineryTypeName?: string; // 设备类型
    workshopName?: string; // 所属车间
    processName?: string; // 所属工序
    status?: number; // 设备状态
    checkCount?: number; // 点检次数
    maintenCount?: number; // 保养次数
    repairCount?: number; // 故障(维修)次数
    borrowCount?: number; // 借用次数
    repairHours?: number; // 累计维修耗时(小时)
    downHours?: number; // 停机时长(小时)
    usageRate?: number; // 使用率(%)
    lastRepairTime?: Date; // 最近报修时间
  }
}
 
/** 查询设备使用率与故障频次统计 */
export function getMachineryStatistics(params: {
  beginDate?: string;
  endDate?: string;
  machineryId?: number;
}) {
  return requestClient.get<MesDvStatisticsApi.MachineryStatistics[]>(
    '/mes/dv/statistics/machinery',
    { params },
  );
}