refactor(@vben/web-antd): 工单操作接口按业务线拆分(保洁/安保)
后端 OpsOrderController 移除了 assign/cancel/complete/create 通用接口, 改由 CleanWorkOrderController 和 SecurityOrderController 各自提供 manual-* 系列接口。 - 新增 api/ops/security/index.ts 安保工单操作 API - cleaning/index.ts 新增 manualCreate/Dispatch/Cancel/UpgradePriority - order-center/index.ts 移除 assignOrder/cancelOrder - 表单组件按工单类型路由到对应 API - cancel-form/upgrade-priority-form 支持 orderType 区分调用路径 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -21,6 +21,29 @@ export namespace OpsCleaningApi {
|
||||
reason: string; // 升级原因
|
||||
}
|
||||
|
||||
/** 手动创建保洁工单请求 */
|
||||
export interface ManualCreateReq {
|
||||
title: string; // 工单标题
|
||||
description?: string; // 工单描述
|
||||
priority?: number; // 优先级
|
||||
areaId: number; // 区域ID
|
||||
cleaningType?: string; // 保洁类型
|
||||
expectedDuration?: number; // 预计作业时长(分钟)
|
||||
}
|
||||
|
||||
/** 手动派单请求 */
|
||||
export interface ManualDispatchReq {
|
||||
orderId: number; // 工单ID
|
||||
assigneeId: number; // 目标设备ID(工牌设备ID)
|
||||
remark?: string; // 派单备注
|
||||
}
|
||||
|
||||
/** 手动取消工单请求 */
|
||||
export interface ManualCancelReq {
|
||||
orderId: number; // 工单ID
|
||||
reason: string; // 取消原因
|
||||
}
|
||||
|
||||
/** 工牌通知请求 */
|
||||
export interface DeviceNotifyReq {
|
||||
badgeId: number; // 工牌设备ID
|
||||
@@ -143,11 +166,6 @@ export function getIotDeviceProperties(deviceId: number) {
|
||||
|
||||
// ==================== 保洁专属接口 ====================
|
||||
|
||||
/** 升级工单优先级 (P0 插队) */
|
||||
export function upgradePriority(data: OpsCleaningApi.UpgradePriorityReq) {
|
||||
return requestClient.post('/ops/clean/order/upgrade-priority', data);
|
||||
}
|
||||
|
||||
/** 发送工牌通知 (语音/震动) */
|
||||
export function sendDeviceNotify(data: OpsCleaningApi.DeviceNotifyReq) {
|
||||
return requestClient.post('/ops/clean/device/notify', data);
|
||||
@@ -189,3 +207,23 @@ export function getOrderBusinessLogs(orderId: number | string) {
|
||||
`/ops/order/business-logs/${orderId}`,
|
||||
);
|
||||
}
|
||||
|
||||
/** 手动创建保洁工单 */
|
||||
export function manualCreateOrder(data: OpsCleaningApi.ManualCreateReq) {
|
||||
return requestClient.post<number>('/ops/clean/order/manual-create', data);
|
||||
}
|
||||
|
||||
/** 手动派单(保洁) */
|
||||
export function manualDispatchOrder(data: OpsCleaningApi.ManualDispatchReq) {
|
||||
return requestClient.post('/ops/clean/order/manual-dispatch', data);
|
||||
}
|
||||
|
||||
/** 手动取消工单(保洁) */
|
||||
export function manualCancelOrder(data: OpsCleaningApi.ManualCancelReq) {
|
||||
return requestClient.post('/ops/clean/order/manual-cancel', data);
|
||||
}
|
||||
|
||||
/** 手动升级优先级(保洁,规范路径) */
|
||||
export function manualUpgradePriority(data: OpsCleaningApi.UpgradePriorityReq) {
|
||||
return requestClient.post('/ops/clean/order/manual-upgrade-priority', data);
|
||||
}
|
||||
|
||||
@@ -144,13 +144,6 @@ export namespace OpsOrderCenterApi {
|
||||
onlineBadgeCount: number; // 在线工牌数量
|
||||
}
|
||||
|
||||
/** 分配工单请求 */
|
||||
export interface AssignOrderReq {
|
||||
orderId: number; // 工单ID
|
||||
assigneeId: number; // 执行人ID
|
||||
remark?: string; // 备注
|
||||
}
|
||||
|
||||
/** 暂停工单请求 */
|
||||
export interface PauseOrderReq {
|
||||
orderId: number; // 工单ID
|
||||
@@ -164,11 +157,6 @@ export namespace OpsOrderCenterApi {
|
||||
userId: number; // 操作人ID
|
||||
}
|
||||
|
||||
/** 取消工单请求 */
|
||||
export interface CancelOrderReq {
|
||||
id: number; // 工单ID
|
||||
reason: string; // 取消原因
|
||||
}
|
||||
}
|
||||
|
||||
// ==================== 工单查询接口 ====================
|
||||
@@ -322,11 +310,9 @@ export function getTrafficTrend() {
|
||||
}
|
||||
|
||||
// ==================== 工单操作接口 ====================
|
||||
|
||||
/** 重新分配/派单 */
|
||||
export function assignOrder(data: OpsOrderCenterApi.AssignOrderReq) {
|
||||
return requestClient.post('/ops/order/assign', data);
|
||||
}
|
||||
// 注意: assignOrder 和 cancelOrder 已移至各业务线控制器
|
||||
// 保洁: 使用 cleaning/index.ts 中的 manualDispatchOrder / manualCancelOrder
|
||||
// 安保: 使用 security/index.ts 中的 manualDispatchSecurityOrder / manualCancelSecurityOrder
|
||||
|
||||
/** 暂停工单 */
|
||||
export function pauseOrder(data: OpsOrderCenterApi.PauseOrderReq) {
|
||||
@@ -337,8 +323,3 @@ export function pauseOrder(data: OpsOrderCenterApi.PauseOrderReq) {
|
||||
export function resumeOrder(data: OpsOrderCenterApi.ResumeOrderReq) {
|
||||
return requestClient.post('/ops/order/resume', data);
|
||||
}
|
||||
|
||||
/** 取消工单 */
|
||||
export function cancelOrder(data: OpsOrderCenterApi.CancelOrderReq) {
|
||||
return requestClient.post('/ops/order/cancel', data);
|
||||
}
|
||||
|
||||
90
apps/web-antd/src/api/ops/security/index.ts
Normal file
90
apps/web-antd/src/api/ops/security/index.ts
Normal file
@@ -0,0 +1,90 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace OpsSecurityOrderApi {
|
||||
/** 手动创建安保工单请求 */
|
||||
export interface ManualCreateReq {
|
||||
title: string; // 工单标题
|
||||
description?: string; // 工单描述
|
||||
priority?: number; // 优先级(0=P0紧急 1=P1重要 2=P2普通)
|
||||
areaId: number; // 区域ID
|
||||
imageUrl?: string; // 相关图片URL
|
||||
sourceType?: string; // 来源类型(ALARM=告警触发/MANUAL=手动创建)
|
||||
// 以下字段仅用于告警自动触发场景,手动创建时不传
|
||||
alarmId?: string; // 关联告警ID
|
||||
alarmType?: string; // 告警类型(intrusion/leave_post/fire/fence)
|
||||
cameraId?: string; // 摄像头ID
|
||||
cameraName?: string; // 摄像头名称
|
||||
roiId?: string; // ROI区域ID
|
||||
}
|
||||
|
||||
/** 手动派单请求 */
|
||||
export interface ManualDispatchReq {
|
||||
orderId: number; // 工单ID
|
||||
assigneeId: number; // 指定安保人员ID
|
||||
remark?: string; // 派单备注
|
||||
}
|
||||
|
||||
/** 手动取消工单请求 */
|
||||
export interface ManualCancelReq {
|
||||
orderId: number; // 工单ID
|
||||
reason: string; // 取消原因
|
||||
}
|
||||
|
||||
/** 手动完单请求 */
|
||||
export interface ManualCompleteReq {
|
||||
orderId: number; // 工单ID
|
||||
result: string; // 处理结果描述
|
||||
resultImgUrls?: string[]; // 处理结果图片URL列表
|
||||
}
|
||||
|
||||
/** 手动升级优先级请求 */
|
||||
export interface ManualUpgradePriorityReq {
|
||||
orderId: number; // 工单ID
|
||||
priority: number; // 目标优先级(0=P0, 1=P1, 2=P2)
|
||||
}
|
||||
}
|
||||
|
||||
// ========== 安保工单操作 API ==========
|
||||
// 后端控制器: SecurityOrderController
|
||||
// 后端路径前缀: /ops/security/order
|
||||
|
||||
/** 手动创建安保工单 */
|
||||
export function manualCreateSecurityOrder(
|
||||
data: OpsSecurityOrderApi.ManualCreateReq,
|
||||
) {
|
||||
return requestClient.post<number>(
|
||||
'/ops/security/order/manual-create',
|
||||
data,
|
||||
);
|
||||
}
|
||||
|
||||
/** 手动派单(安保) */
|
||||
export function manualDispatchSecurityOrder(
|
||||
data: OpsSecurityOrderApi.ManualDispatchReq,
|
||||
) {
|
||||
return requestClient.post('/ops/security/order/manual-dispatch', data);
|
||||
}
|
||||
|
||||
/** 手动取消工单(安保) */
|
||||
export function manualCancelSecurityOrder(
|
||||
data: OpsSecurityOrderApi.ManualCancelReq,
|
||||
) {
|
||||
return requestClient.post('/ops/security/order/manual-cancel', data);
|
||||
}
|
||||
|
||||
/** 手动完单(安保) */
|
||||
export function manualCompleteSecurityOrder(
|
||||
data: OpsSecurityOrderApi.ManualCompleteReq,
|
||||
) {
|
||||
return requestClient.post('/ops/security/order/manual-complete', data);
|
||||
}
|
||||
|
||||
/** 手动升级优先级(安保) */
|
||||
export function manualUpgradePrioritySecurityOrder(
|
||||
data: OpsSecurityOrderApi.ManualUpgradePriorityReq,
|
||||
) {
|
||||
return requestClient.post(
|
||||
'/ops/security/order/manual-upgrade-priority',
|
||||
data,
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user