import request from '@/utils/request' // =========================== 状态定义相关 =========================== /** * 获取所有状态定义及其当前值(用于初始化缓存) * 返回数据结构: * { * id: 定义ID (对应VALUE字段编号,如id=14对应VALUE14), * name: 指标名称, * units: 单位, * comments: 说明, * currentValue: 当前值, * currentInsdate: 当前值时间 * } */ export function getAllPlantStateDefines() { return request({ url: '/pocket/proPlantStateDefine/allWithValues', method: 'get' }) } // =========================== 当前数据相关 =========================== // 查询设备状态当前数据列表 export function listPlantStateCurrent(query) { return request({ url: '/pocket/proPlantStateCurrent/selectAll', method: 'get', params: query }) } // 查询单条设备状态当前数据 export function getPlantStateCurrent(type, insdate) { return request({ url: '/pocket/proPlantStateCurrent/one', method: 'get', params: { type, insdate } }) } // 查询设备状态历史数据列表 export function listPlantStateHistory(query) { return request({ url: '/pocket/proPlantStateHistory/list', method: 'get', params: query }) } // 查询设备状态历史数据详情 export function getPlantStateHistory(insdate) { return request({ url: '/pocket/proPlantStateHistory/' + insdate, method: 'get' }) } // 查询停机列表 export function listStoppage(query) { return request({ url: '/pocket/proStoppage/list', method: 'get', params: query }) } // 查询停机详情 export function getStoppage(stopId) { return request({ url: '/pocket/proStoppage/' + stopId, method: 'get' }) } // =========================== 班组信息相关 =========================== /** * 获取当前班组信息 * 返回数据结构: * { * shift: 班次 (如:A/B/C 或 早/中/晚), * crew: 班组编号, * seqNum: 序列号, * sysTime: 系统时间 * } */ export function getCurrentShift() { return request({ url: '/pocket/shiftCurrent/current', method: 'get' }) } // =========================== 生产统计相关 =========================== /** * 获取生产统计汇总数据 * @param {string} startDate - 开始日期 (yyyy-MM-dd) * @param {string} endDate - 结束日期 (yyyy-MM-dd) */ export function getProductionSummary(startDate, endDate) { return request({ url: '/pocket/productionStatistics/summary', method: 'get', params: { startDate, endDate } }) } /** * 获取班组产量统计 * @param {string} startDate - 开始日期 * @param {string} endDate - 结束日期 */ export function getCrewProduction(startDate, endDate) { return request({ url: '/pocket/productionStatistics/crewProduction', method: 'get', params: { startDate, endDate } }) } /** * 获取厚度分布统计 * @param {string} startDate - 开始日期 * @param {string} endDate - 结束日期 */ export function getThicknessDistribution(startDate, endDate) { return request({ url: '/pocket/productionStatistics/thicknessDistribution', method: 'get', params: { startDate, endDate } }) } /** * 获取宽度分布统计 * @param {string} startDate - 开始日期 * @param {string} endDate - 结束日期 */ export function getWidthDistribution(startDate, endDate) { return request({ url: '/pocket/productionStatistics/widthDistribution', method: 'get', params: { startDate, endDate } }) } /** * 获取班组绩效统计 * @param {string} startDate - 开始日期 * @param {string} endDate - 结束日期 */ export function getTeamPerformance(startDate, endDate) { return request({ url: '/pocket/productionStatistics/teamPerformance', method: 'get', params: { startDate, endDate } }) }