You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
2.0 KiB
33 lines
2.0 KiB
/**
|
|
* 文件作用:记录一次发票批量上传与识别任务。
|
|
* 职责范围:保存上传人、来源、批次处理状态和统计数量。
|
|
* 不负责:保存单张发票字段或执行发票判重。
|
|
*/
|
|
'use strict';
|
|
|
|
module.exports = dc => {
|
|
const DataTypes = dc.ORM;
|
|
const FinanceInvoiceUploadBatch = dc.orm.define('FinanceInvoiceUploadBatch', {
|
|
id: { type: DataTypes.BIGINT, primaryKey: true, autoIncrement: true },
|
|
batchNo: { type: DataTypes.STRING(32), allowNull: false, unique: true, field: 'batch_no' },
|
|
uploaderId: { type: DataTypes.BIGINT, allowNull: false, field: 'uploader_id' },
|
|
uploaderName: { type: DataTypes.STRING(100), allowNull: false, field: 'uploader_name' },
|
|
uploaderDepartmentId: { type: DataTypes.BIGINT, field: 'uploader_department_id' },
|
|
uploaderDepartmentName: { type: DataTypes.STRING(100), field: 'uploader_department_name' },
|
|
source: { type: DataTypes.STRING(20), allowNull: false, defaultValue: 'web' },
|
|
status: { type: DataTypes.STRING(20), allowNull: false, defaultValue: 'recognizing' },
|
|
totalCount: { type: DataTypes.INTEGER, allowNull: false, defaultValue: 0, field: 'total_count' },
|
|
successCount: { type: DataTypes.INTEGER, allowNull: false, defaultValue: 0, field: 'success_count' },
|
|
duplicateCount: { type: DataTypes.INTEGER, allowNull: false, defaultValue: 0, field: 'duplicate_count' },
|
|
invalidCount: { type: DataTypes.INTEGER, allowNull: false, defaultValue: 0, field: 'invalid_count' },
|
|
confirmedAt: { type: DataTypes.DATE, field: 'confirmed_at' },
|
|
createdAt: { type: DataTypes.DATE, allowNull: false, defaultValue: dc.orm.literal('CURRENT_TIMESTAMP'), field: 'created_at' },
|
|
updatedAt: { type: DataTypes.DATE, allowNull: false, defaultValue: dc.orm.literal('CURRENT_TIMESTAMP'), field: 'updated_at' },
|
|
}, {
|
|
tableName: 'finance_invoice_upload_batch',
|
|
timestamps: false,
|
|
comment: '财务发票上传批次',
|
|
});
|
|
dc.models.FinanceInvoiceUploadBatch = FinanceInvoiceUploadBatch;
|
|
return FinanceInvoiceUploadBatch;
|
|
};
|
|
|