- 新增 order.packing.list: 打包任务列表查询,支持分页/筛选/排序,关联工作台/视频/运单 - 新增 order.packing.get: 打包任务详情查询 - 新增 order.packing.setEndTime: 设置结束时间,未完成任务自动标记为已完成 - 新增 order.packing.forceRecord: 强制重新录制,推送打印服务 - pack_task_video Model status 从 TINYINT 改为 STRING(20) 匹配 DB ENUM - 视频 URL 拼接 CDN 前缀: http://w{warehouseId}-c{computerId}.o.gztbyc.com{videoPath} - 录制电脑从 wms_print_computer(is_recording=true) + Redis 在线校验获取 - 更新 methods/system.json 与 methods/changes/system.json 文档
84 lines
2.0 KiB
JavaScript
84 lines
2.0 KiB
JavaScript
'use strict';
|
||
|
||
module.exports = app => {
|
||
const { STRING, BIGINT, DATE } = app.Sequelize;
|
||
|
||
const PackTaskVideo = app.model.define('pack_task_video', {
|
||
id: {
|
||
type: BIGINT(20).UNSIGNED,
|
||
primaryKey: true,
|
||
autoIncrement: true,
|
||
comment: '主键ID',
|
||
},
|
||
pack_task_id: {
|
||
type: BIGINT(20).UNSIGNED,
|
||
allowNull: false,
|
||
comment: '打包任务ID,关联 wms_pack_task.id',
|
||
},
|
||
camera_id: {
|
||
type: BIGINT(20).UNSIGNED,
|
||
allowNull: true,
|
||
comment: '摄像头设备ID,关联 wms_camera.id',
|
||
},
|
||
video_url: {
|
||
type: STRING(500),
|
||
allowNull: false,
|
||
comment: '视频地址(录像回放URL)',
|
||
},
|
||
status: {
|
||
type: STRING(20),
|
||
allowNull: false,
|
||
defaultValue: 'created',
|
||
comment: '状态:created-已创建 recording-录制中 completed-已完成 failed-失败',
|
||
},
|
||
remark: {
|
||
type: STRING(500),
|
||
allowNull: true,
|
||
comment: '备注',
|
||
},
|
||
created_at: {
|
||
type: DATE,
|
||
allowNull: false,
|
||
comment: '创建时间',
|
||
},
|
||
updated_at: {
|
||
type: DATE,
|
||
allowNull: false,
|
||
comment: '更新时间',
|
||
},
|
||
deleted_at: {
|
||
type: DATE,
|
||
allowNull: true,
|
||
comment: '软删除时间',
|
||
},
|
||
}, {
|
||
tableName: 'wms_pack_task_video',
|
||
timestamps: true,
|
||
createdAt: 'created_at',
|
||
updatedAt: 'updated_at',
|
||
paranoid: true,
|
||
deletedAt: 'deleted_at',
|
||
comment: '打包任务视频记录表',
|
||
indexes: [
|
||
{ name: 'idx_pack_task_id', fields: [ 'pack_task_id' ] },
|
||
{ name: 'idx_camera_id', fields: [ 'camera_id' ] },
|
||
{ name: 'idx_deleted_at', fields: [ 'deleted_at' ] },
|
||
],
|
||
});
|
||
|
||
PackTaskVideo.associate = () => {
|
||
app.model.PackTaskVideo.belongsTo(app.model.PackTask, {
|
||
foreignKey: 'pack_task_id',
|
||
targetKey: 'id',
|
||
as: 'packTask',
|
||
});
|
||
app.model.PackTaskVideo.belongsTo(app.model.Camera, {
|
||
foreignKey: 'camera_id',
|
||
targetKey: 'id',
|
||
as: 'camera',
|
||
});
|
||
};
|
||
|
||
return PackTaskVideo;
|
||
};
|