| | |
| | | } |
| | | resolve(_fields) |
| | | }) |
| | | } else { |
| | | resolve(_fields) |
| | | } |
| | | }).then(_fields => { |
| | | let _usefulfields = ['BID', 'ID', 'LoginUID', 'SessionUid', 'UserID', 'Appkey', 'UserName', 'FullName', 'BillCode', 'BVoucher', 'FIBVoucherDate', 'FiYear', 'ModularDetailCode'] |
| | |
| | | } |
| | | }) |
| | | |
| | | if (!hasBid) { // 表单中增加BID |
| | | if (!hasBid && (card.sqlType === 'insert' || card.sqlType === 'insertOrUpdate')) { // 表单中增加BID |
| | | _fields.unshift({ uuid: 'BID', field: 'BID', label: 'BID', type: 'text' }) |
| | | fieldArr.push('bid') |
| | | _declare.push(`@bid nvarchar(50)`) |
| | | _select.push(`@bid=''`) |
| | | |
| | | } |
| | | |
| | | let hasColumn = false |
| | |
| | | if (!item.field) return |
| | | |
| | | keys.push(item.field.toLowerCase()) |
| | | values.push('@' + item.field) |
| | | |
| | | if (item.field.toLowerCase() === 'bid' && item.uuid === 'BID') { |
| | | values.push('@BID@') |
| | | } else { |
| | | values.push('@' + item.field) |
| | | } |
| | | }) |
| | | |
| | | if (config.setting.primaryKey && !keys.includes(config.setting.primaryKey.toLowerCase())) { |
| | |
| | | values = values.join(', ') |
| | | _insertsql = `insert into ${card.sql} (${keys}) select ${values};` |
| | | } |
| | | |
| | | |
| | | if (card.sqlType === 'update' || card.sqlType === 'audit' || card.sqlType === 'insertOrUpdate') { |
| | | let _form = [] |
| | | let _arr = [] |
| | |
| | | ${_updatesql} |
| | | end |
| | | ` |
| | | } else if (card.sqlType === 'LogicDelete') { |
| | | } else if (card.sqlType === 'LogicDelete' || card.sqlType === 'custom') { |
| | | _defaultsql = `update ${card.sql} set deleted=1,modifydate=getdate(),modifyuserid=@userid@ where ${config.setting.primaryKey}${card.Ot !== 'requiredOnce' ? '=@ID@' : ' in (select ID from dbo.SplitComma(@ID@))'};` |
| | | } else if (card.sqlType === 'delete') { |
| | | let _msg = '' |