diff --git a/src/commands/dm/create.ts b/src/commands/dm/create.ts index fc46afc..50371e5 100644 --- a/src/commands/dm/create.ts +++ b/src/commands/dm/create.ts @@ -72,23 +72,22 @@ export function buildDmCreateCommand(): Command { autoIncrement: 0, identity: 0, primaryKey: 0, - index: '0', columnName: f.field, ...f, })) // v10.6+ JNPF runtime 要求 9 系统列 (硬编码 SQL 引用) + 复合主键 const sysCols = [ - { field: 'f_id', fieldName: '主键', dataType: 'varchar', dataLength: '50', primaryKey: 1, allowNull: 0, autoIncrement: 0, identity: 0, columnName: 'f_id', index: '0' }, - { field: 'f_tenant_id', fieldName: '租户id', dataType: 'varchar', dataLength: '50', primaryKey: 1, allowNull: 0, autoIncrement: 0, identity: 0, columnName: 'f_tenant_id', index: '0' }, - { field: 'f_flow_task_id', fieldName: '流程任务ID', dataType: 'varchar', dataLength: '50', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_flow_task_id', index: '0' }, - { field: 'f_flow_id', fieldName: '流程ID', dataType: 'varchar', dataLength: '50', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_flow_id', index: '0' }, - { field: 'f_flow_state', fieldName: '流程状态', dataType: 'int', dataLength: '0', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_flow_state', index: '0' }, - { field: 'f_sort_code', fieldName: '排序', dataType: 'bigint', dataLength: '0', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_sort_code', index: '0' }, - { field: 'f_create_user', fieldName: '创建人', dataType: 'varchar', dataLength: '50', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_create_user', index: '0' }, - { field: 'f_create_time', fieldName: '创建时间', dataType: 'datetime', dataLength: '0', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_create_time', index: '0' }, - { field: 'f_modify_user', fieldName: '修改人', dataType: 'varchar', dataLength: '50', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_modify_user', index: '0' }, - { field: 'f_modify_time', fieldName: '修改时间', dataType: 'datetime', dataLength: '0', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_modify_time', index: '0' }, - { field: 'f_description', fieldName: '描述', dataType: 'text', dataLength: '0', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_description', index: '0' }, + { field: 'f_id', fieldName: '主键', dataType: 'varchar', dataLength: '50', primaryKey: 1, allowNull: 0, autoIncrement: 0, identity: 0, columnName: 'f_id' }, + { field: 'f_tenant_id', fieldName: '租户id', dataType: 'varchar', dataLength: '50', primaryKey: 1, allowNull: 0, autoIncrement: 0, identity: 0, columnName: 'f_tenant_id' }, + { field: 'f_flow_task_id', fieldName: '流程任务ID', dataType: 'varchar', dataLength: '50', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_flow_task_id' }, + { field: 'f_flow_id', fieldName: '流程ID', dataType: 'varchar', dataLength: '50', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_flow_id' }, + { field: 'f_flow_state', fieldName: '流程状态', dataType: 'int', dataLength: '0', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_flow_state' }, + { field: 'f_sort_code', fieldName: '排序', dataType: 'bigint', dataLength: '0', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_sort_code' }, + { field: 'f_create_user', fieldName: '创建人', dataType: 'varchar', dataLength: '50', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_create_user' }, + { field: 'f_create_time', fieldName: '创建时间', dataType: 'datetime', dataLength: '0', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_create_time' }, + { field: 'f_modify_user', fieldName: '修改人', dataType: 'varchar', dataLength: '50', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_modify_user' }, + { field: 'f_modify_time', fieldName: '修改时间', dataType: 'datetime', dataLength: '0', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_modify_time' }, + { field: 'f_description', fieldName: '描述', dataType: 'text', dataLength: '0', primaryKey: 0, allowNull: 1, autoIncrement: 0, identity: 0, columnName: 'f_description' }, ] const allFields = [...fields, ...sysCols] // JNPF dmpost body 结构: { tableInfo:{...}, tableFieldList:[...] } @@ -97,10 +96,7 @@ export function buildDmCreateCommand(): Command { table: opts.table, tableName: opts.tableName, newTable: opts.table, - primaryKeyPolicy: 1, - logicalDelete: false, - concurrencyLock: false, - }, + }, tableFieldList: allFields, } log.info(`POST /system/DataModel/${dbLinkId}/Table table=${opts.table} fields=${allFields.length} (含9系统列)`)