refs #5712 fix(workerDms): filter
gitea/salix/pipeline/head There was a failure building this commit
Details
gitea/salix/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
4f616397a2
commit
1a18ba66a9
|
@ -28,5 +28,12 @@
|
|||
"findById": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
"dmsType": {
|
||||
"type": "belongsTo",
|
||||
"model": "DmsType",
|
||||
"foreignKey": "dmsTypeFk"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,22 +62,25 @@ module.exports = Self => {
|
|||
where: {code: 'hr', action: 'find'}
|
||||
});
|
||||
const docuwareDmsType = docuware.dmsTypeFk;
|
||||
let workerDocuware;
|
||||
if (!(docuwareDmsType && !await models.DmsType.hasReadRole(ctx, docuwareDmsType))) {
|
||||
const worker = await models.Worker.findById(id, {fields: ['fi', 'firstName', 'lastName']});
|
||||
const docuwareParse = {
|
||||
'Filename': 'dmsFk',
|
||||
'Tipo Documento': 'description',
|
||||
'Stored on': 'created',
|
||||
'Document ID': 'id'
|
||||
};
|
||||
const workerDocuware =
|
||||
workerDocuware =
|
||||
await models.Docuware.getById('hr', worker.lastName + worker.firstName, docuwareParse);
|
||||
for (document of workerDocuware) {
|
||||
const defaultData = {
|
||||
file: document.dmsFk + '.png',
|
||||
file: 'dw' + document.id + '.png',
|
||||
isDocuware: true,
|
||||
hardCopyNumber: null,
|
||||
hasFile: false,
|
||||
reference: worker.fi
|
||||
reference: worker.fi,
|
||||
dmsFk: 'DW' + document.id
|
||||
};
|
||||
|
||||
document = Object.assign(document, defaultData);
|
||||
|
|
Loading…
Reference in New Issue