6078_workerActivty #2130
|
@ -94,6 +94,9 @@
|
|||
"Module": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"MrwConfig": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"Notification": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
|
@ -166,10 +169,10 @@
|
|||
"VnRole": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"MrwConfig": {
|
||||
"WorkerActivity": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"WorkerActivityType": {
|
||||
"dataSource": "vn"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
"name": "WorkerActivity",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "workerActivity"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"id": true,
|
||||
"type": "number"
|
||||
},
|
||||
"created": {
|
||||
"type": "date"
|
||||
},
|
||||
"model": {
|
||||
"type": "string"
|
||||
},
|
||||
"event": {
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string"
|
||||
},
|
||||
"relations": {
|
||||
"workerFk": {
|
||||
"type": "belongsTo",
|
||||
"model": "Worker",
|
||||
"foreignKey": "workerFk"
|
||||
},
|
||||
"workerActivityTypeFk": {
|
||||
"type": "belongsTo",
|
||||
"model": "WorkerActivityType",
|
||||
"foreignKey": "workerActivityTypeFk"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"name": "WorkerActivityType",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "workerActivityType"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"code": {
|
||||
"id": true,
|
||||
"type": "string"
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"required": false
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
USE vn;
|
||||
|
||||
CREATE OR REPLACE TABLE vn.workerActivityType (
|
||||
`code` varchar(20) NOT NULL,
|
||||
`description` varchar(45) NOT NULL,
|
||||
PRIMARY KEY (`code`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;
|
||||
|
||||
ALTER TABLE vn.department ADD workerActivityTypeFk varchar(20) NULL COMMENT 'Indica la actitividad que desempeña por defecto ese departamento';
|
||||
ALTER TABLE vn.department ADD CONSTRAINT department_workerActivityType_FK FOREIGN KEY (workerActivityTypeFk) REFERENCES vn.workerActivityType(code) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
|
||||
|
||||
INSERT INTO vn.workerActivityType (code, description) VALUES('ON_CHECKING', 'REVISION');
|
||||
INSERT INTO vn.workerActivityType (code, description) VALUES('PREVIOUS_CAM', 'CAMARA');
|
||||
INSERT INTO vn.workerActivityType (code, description) VALUES('PREVIOUS_ART', 'ARTIFICIAL');
|
||||
INSERT INTO vn.workerActivityType (code, description) VALUES('ON_PREPARATION', 'SACADO');
|
||||
INSERT INTO vn.workerActivityType (code, description) VALUES('PACKING', 'ENCAJADO');
|
||||
INSERT INTO vn.workerActivityType (code, description) VALUES('FIELD', 'CAMPOS');
|
||||
INSERT INTO vn.workerActivityType (code, description) VALUES('DELIVERY', 'REPARTO');
|
||||
INSERT INTO vn.workerActivityType (code, description) VALUES('STORAGE', 'ALMACENAJE');
|
||||
INSERT INTO vn.workerActivityType (code, description) VALUES('PALLETIZING', 'PALETIZADO');
|
||||
INSERT INTO vn.workerActivityType (code, description) VALUES('STOP', 'PARADA');
|
||||
|
||||
|
||||
INSERT INTO salix.ACL ( model, property, accessType, permission, principalType, principalId) VALUES('WorkerActivityType', '*', 'READ', 'ALLOW', 'ROLE', 'production');
|
||||
INSERT INTO salix.ACL ( model, property, accessType, permission, principalType, principalId) VALUES('WorkerActivity', '*', '*', 'ALLOW', 'ROLE', 'production');
|
||||
|
||||
|
||||
ALTER TABLE vn.workerActivity MODIFY COLUMN event enum('open','close','insert','delete','update','refresh') CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NULL;
|
||||
ALTER TABLE vn.workerActivity MODIFY COLUMN model enum('COM','ENT','TPV','ENC','LAB','ETI','APP') CHARACTER SET utf8mb3 COLLATE utf8mb3_unicode_ci NOT NULL;
|
||||
|
||||
|
||||
ALTER TABLE vn.workerActivity ADD workerActivityTypeFk varchar(20) NULL;
|
||||
ALTER TABLE vn.workerActivity ADD CONSTRAINT workerActivity_workerActivityType_FK FOREIGN KEY (workerActivityTypeFk) REFERENCES vn.workerActivityType(code) ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
|
@ -62,6 +62,11 @@
|
|||
"type": "belongsTo",
|
||||
"model": "Worker",
|
||||
"foreignKey": "workerFk"
|
||||
},
|
||||
"workerActivity": {
|
||||
"type": "belongsTo",
|
||||
"model": "Worker",
|
||||
"foreignKey": "workerActivityTypeFk"
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue