tablas dms

This commit is contained in:
Javi Gallego 2019-04-25 18:30:11 +02:00
parent 47e55580ad
commit a920bc1d8f
8 changed files with 165 additions and 0 deletions

View File

@ -37,6 +37,12 @@
},
"EmailUser": {
"dataSource": "vn"
},
"Dms": {
"dataSource": "vn"
},
"DmsType": {
"dataSource": "vn"
}
}

51
back/models/dms.json Normal file
View File

@ -0,0 +1,51 @@
{
"name": "Dms",
"description": "Documental Managment system",
"base": "VnModel",
"options": {
"mysql": {
"table": "dms"
}
},
"properties": {
"id": {
"type": "Number",
"id": true,
"description": "Identifier"
},
"file": {
"type": "string"
},
"reference": {
"type": "string"
},
"description": {
"type": "string"
},
"created": {
"type": "Date"
}
},
"relations": {
"dmsType": {
"type": "belongsTo",
"model": "DmsType",
"foreignKey": "dmsTypeFk"
},
"worker": {
"type": "belongsTo",
"model": "Worker",
"foreignKey": "workerFk"
},
"warehouse": {
"type": "belongsTo",
"model": "Warehouse",
"foreignKey": "warehouseFk"
},
"company": {
"type": "belongsTo",
"model": "Company",
"foreignKey": "companyFk"
}
}
}

33
back/models/dmsType.json Normal file
View File

@ -0,0 +1,33 @@
{
"name": "DmsType",
"description": "Documental Managment system types",
"base": "VnModel",
"options": {
"mysql": {
"table": "dmsType"
}
},
"properties": {
"id": {
"type": "Number",
"id": true,
"description": "Identifier"
},
"name": {
"type": "string",
"required": true
},
"path": {
"type": "string",
"required": true
}
},
"acls": [
{
"accessType": "READ",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
}
]
}

View File

@ -0,0 +1,20 @@
USE `vn`;
CREATE
OR REPLACE ALGORITHM = UNDEFINED
DEFINER = `root`@`%`
SQL SECURITY DEFINER
VIEW `vn`.`dms` AS
SELECT
`g`.`id` AS `id`,
`g`.`gesttip_id` AS `dmsTypeFk`,
`g`.`file` AS `file`,
`g`.`trabajador_id` AS `workerFk`,
`g`.`warehouse_id` AS `warehouseFk`,
`g`.`emp_id` AS `companyFk`,
`g`.`orden` AS `priority`,
`g`.`file` AS `hasFile`,
`g`.`sref` AS `reference`,
`g`.`brief` AS `description`,
`g`.`odbc_date` AS `created`
FROM
`vn2008`.`gestdoc` `g`

View File

@ -0,0 +1,11 @@
DROP VIEW IF EXISTS `vn`.`dmsTicket` ;
USE `vn`;
CREATE
OR REPLACE ALGORITHM = UNDEFINED
DEFINER = `root`@`%`
SQL SECURITY DEFINER
VIEW `vn`.`ticketDms` AS
SELECT
`g`.`Id_Ticket` AS `ticketFk`, `g`.`gestdoc_id` AS `dmsFk`
FROM
`vn2008`.`tickets_gestdoc` `g`;

View File

@ -0,0 +1,3 @@
ALTER TABLE `vn2008`.`gesttip`
ADD COLUMN `writeRoleFk` INT(10) UNSIGNED NULL AFTER `path`,
ADD COLUMN `ReadRoleFk` INT(10) UNSIGNED NULL AFTER `writeRoleFk`;

View File

@ -38,6 +38,9 @@
"Ticket": {
"dataSource": "vn"
},
"TicketDms": {
"dataSource": "vn"
},
"TicketLog": {
"dataSource": "vn"
},

View File

@ -0,0 +1,38 @@
{
"name": "TicketDms",
"base": "Loggable",
"log": {
"model": "TicketLog",
"relation": "ticket",
"showField": "dmsFk"
},
"options": {
"mysql": {
"table": "ticketDms"
}
},
"properties": {
"ticketFk": {
"type": "Number",
"id": true,
"required": true
},
"dmsFk": {
"type": "Number",
"id": true,
"required": true
}
},
"relations": {
"ticket": {
"type": "belongsTo",
"model": "Ticket",
"foreignKey": "ticketFk"
},
"dms": {
"type": "belongsTo",
"model": "Dms",
"foreignKey": "dmsFk"
}
}
}