Remove relevant console log,

This commit is contained in:
Eudes Inácio
2022-04-28 09:32:27 +01:00
parent 3021e8b0e1
commit 2826cea9df
153 changed files with 1001 additions and 1132 deletions
+70 -73
View File
@@ -32,18 +32,18 @@ export class SqliteService {
}
databaseConn() {
console.log('SQLDBConnect')
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
} else {
console.log('SQLDBConnect22')
this.platform.ready().then(async () => {
console.log('SQLDBConnect33')
this.sqlite.create({
name: this.db_name,
location: 'default'
}).then(async (sqLite: SQLiteObject) => {
this.dbInstance = sqLite;
console.log('SQLITE INSTACE ',this.dbInstance);
await sqLite.executeSql(`
CREATE TABLE IF NOT EXISTS ${this.events} (
EventId varchar(255) PRIMARY KEY,
@@ -70,9 +70,9 @@ export class SqliteService {
HumanDate varchar(255)
)`, [])
.then((res) => {
console.log("Sucess Events Table created: ", res)
})
.catch((error) => console.log(JSON.stringify(error)));
.catch((error) => console.error(error));
await sqLite.executeSql(`
CREATE TABLE IF NOT EXISTS ${this.expedientes} (
@@ -92,9 +92,9 @@ export class SqliteService {
workflowName varchar(255)
)`, [])
.then((res) => {
console.log("Sucess Espedientes Table created: ", res)
})
.catch((error) => console.log(JSON.stringify(error)));
.catch((error) => console.error(error));
await sqLite.executeSql(`
CREATE TABLE IF NOT EXISTS ${this.allprocess} (
@@ -115,9 +115,9 @@ export class SqliteService {
interveners Text
)`, [])
.then((res) => {
console.log("Sucess AllProcess Table created: ", res)
})
.catch((error) => console.log(JSON.stringify(error)));
.catch((error) => console.error(error));
await sqLite.executeSql(`
CREATE TABLE IF NOT EXISTS ${this.actions} (
@@ -131,9 +131,9 @@ export class SqliteService {
publicationsDetails Text
)`, [])
.then((res) => {
console.log("Sucess action Table created: ", res)
})
.catch((error) => console.log(JSON.stringify(error)));
.catch((error) => console.error(error));
await sqLite.executeSql(`
CREATE TABLE IF NOT EXISTS ${this.chatlistroom} (
@@ -146,9 +146,8 @@ export class SqliteService {
name varchar(255)
)`, [])
.then((res) => {
console.log("Sucess chat list room Table created: ", res)
})
.catch((error) => console.log(JSON.stringify(error)));
.catch((error) => console.error(error));
await sqLite.executeSql(`
CREATE TABLE IF NOT EXISTS ${this.chatlistUsers} (
@@ -158,9 +157,8 @@ export class SqliteService {
)`, [])
.then((res) => {
console.log("Sucess chat list users Table created: ", res)
})
.catch((error) => console.log(JSON.stringify(error)));
.catch((error) => console.error(error));
await sqLite.executeSql(`
CREATE TABLE IF NOT EXISTS ${this.chatmsg} (
@@ -177,32 +175,31 @@ export class SqliteService {
image_url Text
)`, [])
.then((res) => {
console.log("Sucess chat msg Table created: ", res)
})
.catch((error) => console.log(JSON.stringify(error)));
.catch((error) => console.error(error));
})
.catch((error) => console.log(JSON.stringify(error)));
.catch((error) => console.error(error));
}).catch((error) => {
console.log('Platform ready error', error)
console.error( error)
});
}
}
//addactions
public addactions(data) {
console.log('Action insert', data)
this.dbInstance.executeSql(`
INSERT OR IGNORE INTO ${this.actions} (ActionType,DateBegin,DateEnd,Description,Detail,ProcessId,publications,publicationsDetails)
VALUES ('${data.ActionType}','${data.DateBegin}', '${data.DateEnd}','${data.Description}','${data.Detail}','${data.ProcessId}','${data.publications}','${data.publicationsDetails}')`, [])
.then(() => {
console.log("action add with Success");
}, (e) => {
console.log(JSON.stringify(e.err));
});
}
@@ -213,10 +210,10 @@ export class SqliteService {
VALUES ('${data.EventId}','${data.Subject}','${data.HasAttachments}','${data.Location}','${data.CalendarId}','${data.CalendarName}','${data.StartDate}','${data.EndDate}','${data.EventType}','${data.Attendees}','${data.IsMeeting}','${data.IsRecurring}',
'${data.IsAllDayEvent}','${data.AppointmentState}','${data.TimeZone}','${data.Organizer}','${data.Category}','${data.EventRecurrence}','${data.Attachments}','${data.Body}','${data.Profile}','${data.HumanDate}')`, [])
.then(() => {
console.log("event add with Success");
}, (e) => {
console.log(JSON.stringify(e));
});
}
@@ -227,10 +224,10 @@ export class SqliteService {
VALUES ('${data.serialNumber}','${data.workflowInstanceFolio}', '${data.Documents}','${data.actions}','${data.activityInstanceName}','${data.formURL}','${data.originator}','${data.taskStartDate}','${data.totalDocuments}','${data.workflowDisplayName}','${data.workflowID}',
'${data.workflowInstanceDataFields}','${data.workflowInstanceID}','${data.workflowName}')`, [])
.then(() => {
console.log("expediente add with Success");
}, (e) => {
console.log(JSON.stringify(e.err));
});
}
@@ -241,52 +238,52 @@ export class SqliteService {
VALUES ('${data.serialNumber}','${data.workflowInstanceFolio}', '${JSON.stringify(data.Documents)}','${JSON.stringify(data.actions)}','${data.activityInstanceName}','${data.formURL}','${JSON.stringify(data.originator)}','${data.taskStartDate}','${data.totalDocuments}','${data.workflowDisplayName}','${data.workflowID}',
'${JSON.stringify(data.workflowInstanceDataFields)}','${data.workflowInstanceID}','${data.workflowName}')`, [])
.then(() => {
console.log("process add with Success");
}, (e) => {
console.log(JSON.stringify(e.err));
});
}
//chatlistroom
public addChatListRoom(data) {
console.log('INSIDE DB CHAT LIST ROOM',data,)
this.dbInstance.executeSql(`
INSERT OR REPLACE INTO ${this.chatlistroom} (Id,Uids,Usernames,LastMessage,UpdatedAt,customFields,name)
VALUES ('${data.id}','${JSON.stringify(data.uids)}','${JSON.stringify(data.usernames)}','${JSON.stringify(data.lastMessage)}','${data.updatedat}','${JSON.stringify(data.customFields)}','${data.name}')`, [])
.then(() => {
console.log("chat room add with Success");
}, (e) => {
console.log(JSON.stringify(e.err));
});
}
//chatlistusers
public addChatListUsers(data) {
console.log('INSIDE DB CHAT LIST ROOM',data,)
this.dbInstance.executeSql(`
INSERT OR REPLACE INTO ${this.chatlistUsers} (Id,Name,Username)
VALUES ('${data.id}','${data.name}','${data.username}')`, [])
.then(() => {
console.log("chat users add with Success");
}, (e) => {
console.log(JSON.stringify(e.err));
});
}
//chatlistusers
public addChatMSG(data) {
console.log('INSIDE DB CHAT MSG',data,)
this.dbInstance.executeSql(`
INSERT OR IGNORE INTO ${this.chatmsg} (Id,Attachments,Channels,File,Mentions,Msg,Rid, Ts ,U, UpdatedAt)
VALUES ('${data._id}','${JSON.stringify(data.attachments)}','${JSON.stringify(data.channels)}','${JSON.stringify(data.file)}','${JSON.stringify(data.mentions)}','${data.msg}','${data.rid}','${data.ts}','${JSON.stringify(data.u)}','${JSON.stringify(data._updatedAt)}')`, [])
.then(() => {
console.log("chat msg add with Success");
}, (e) => {
console.log(JSON.stringify(e.err));
});
}
@@ -297,24 +294,24 @@ export class SqliteService {
VALUES ('${data.EventId}','${data.Subject}','${data.HasAttachments}','${data.Location}','${data.CalendarId}','${data.CalendarName}','${data.StartDate}','${data.EndDate}','${data.EventType}','${data.Attendees}','${data.IsMeeting}','${data.IsRecurring}',
'${data.IsAllDayEvent}','${data.AppointmentState}','${data.TimeZone}','${data.Organizer}','${data.Category}','${data.EventRecurrence}','${data.Attachments}','${data.Body}','${data.Profile}','${data.HumanDate}')`, [])
.then(() => {
console.log("event update with Success");
}, (e) => {
console.log(JSON.stringify(e));
});
}
//updateActions
public updateactions(id, data) {
try {
console.log("update action data", data)
this.dbInstance.executeSql(`
UPDATE ${this.actions} SET publications = ? WHERE ProcessId = ${id}`, [data])
.then(() => {
console.log("action update with Success");
}, (e) => {
console.log(JSON.stringify(e.err));
});
} catch(error) {}
@@ -323,14 +320,14 @@ export class SqliteService {
//updatePublicationsDetails
public updatePublicationsDetails(id, data) {
try {
console.log("update action data", data)
this.dbInstance.executeSql(`
UPDATE ${this.actions} SET publicationsDetails = ? WHERE ProcessId = ${id}`, [data])
.then(() => {
console.log("action update with Success");
}, (e) => {
console.log(JSON.stringify(e.err));
});
} catch(error) {}
@@ -341,14 +338,14 @@ export class SqliteService {
let jsonId = JSON.stringify(id)
let jsondata = JSON.stringify(data)
try {
console.log("update action data", data)
this.dbInstance.executeSql(`
UPDATE ${this.chatmsg} SET image_url = ? WHERE Id = ${jsonId}`, [jsondata])
.then(() => {
console.log("ChatMsg update with Success");
}, (e) => {
console.log(JSON.stringify(e.err));
});
} catch(error) {}
@@ -362,10 +359,10 @@ export class SqliteService {
VALUES ('${data.serialNumber}','${data.workflowInstanceFolio}', '${JSON.stringify(data.Documents)}','${JSON.stringify(data.actions)}','${data.activityInstanceName}','${data.formURL}','${JSON.stringify(data.originator)}','${data.taskStartDate}','${data.totalDocuments}','${data.workflowDisplayName}','${data.workflowID}',
'${JSON.stringify(data.workflowInstanceDataFields)}','${data.workflowInstanceID}','${data.workflowName}')`, [])
.then(() => {
console.log("process add with Success");
}, (e) => {
console.log(JSON.stringify(e.err));
});
}
@@ -373,14 +370,14 @@ export class SqliteService {
updateUser(id, document,) {
let data = [document];
return this.dbInstance.executeSql(`UPDATE ${this.allprocess} SET Documents = ? WHERE serialNumber = ${id}`, [document]).then(() => {
console.log("process attachment updated")
})
}
//updateAttachment
updateProcessInterveners(id, interveners,) {
let data = [document];
return this.dbInstance.executeSql(`UPDATE ${this.allprocess} SET interveners = ? WHERE serialNumber = ${id}`, [interveners]).then(() => {
console.log("process interveners updated")
})
}
//getAllEvents
@@ -435,7 +432,7 @@ export class SqliteService {
return this.EVENTS;
}
}, (e) => {
console.log(" Get all events error", JSON.stringify(e));
});
}
@@ -449,7 +446,7 @@ export class SqliteService {
return this.EXPEDIENTES;
}
}, (e) => {
console.log(" Get all expedientes error", JSON.stringify(e));
});
}
@@ -463,7 +460,7 @@ export class SqliteService {
return this.ALLPROCESS;
}
}, (e) => {
console.log(" Get all process error", JSON.stringify(e));
});
}
@@ -478,7 +475,7 @@ export class SqliteService {
return this.ALLACTIONS;
}
}, (e) => {
console.log(" Get all actions error", JSON.stringify(e));
});
}
@@ -493,7 +490,7 @@ export class SqliteService {
return this.ALLChatROOM;
}
}, (e) => {
console.log(" Get all chat room error", JSON.stringify(e));
});
}
@@ -508,7 +505,7 @@ export class SqliteService {
return this.ALLChatUSERs;
}
}, (e) => {
console.log(" Get all chat users error", JSON.stringify(e));
});
}
@@ -523,7 +520,7 @@ export class SqliteService {
return this.ALLCHATMSG;
}
}, (e) => {
console.log(" Get all chat users error", JSON.stringify(e));
});
}
//getlistOfEventAprove
@@ -537,7 +534,7 @@ export class SqliteService {
return this.ALLPROCESS;
}
}, (e) => {
console.log(" Get all process error", JSON.stringify(e));
});
}
@@ -552,7 +549,7 @@ export class SqliteService {
return this.ALLPROCESS;
}
}, (e) => {
console.log(" Get all process error", JSON.stringify(e));
});
}
@@ -563,12 +560,12 @@ export class SqliteService {
if (res.rows.length > 0) {
for (var i = 0; i < res.rows.length; i++) {
this.ALLPROCESS.push(res.rows.item(i));
console.log('getEXPEDIENTE DB LOOP')
}
return this.ALLPROCESS;
}
}, (e) => {
console.log(" Get all process error", JSON.stringify(e));
});
}
@@ -583,7 +580,7 @@ export class SqliteService {
return this.ALLPROCESS;
}
}, (e) => {
console.log(" Get all process error", JSON.stringify(e));
});
}
@@ -597,7 +594,7 @@ export class SqliteService {
return this.PROCESS;
}
}, (e) => {
console.log(" Get process by serial error", JSON.stringify(e));
});
}
@@ -612,7 +609,7 @@ export class SqliteService {
return this.ALLACTIONS;
}
}, (e) => {
console.log(" Get actions by processId error", JSON.stringify(e));
});
}
@@ -690,7 +687,7 @@ export class SqliteService {
return this.EVENTS;
}
}, (e) => {
console.log(" Get events by id error", JSON.stringify(e));
});
}
@@ -700,30 +697,30 @@ export class SqliteService {
this.deleteactionsTable();
this.deletepublicationsTable();
console.log('All tables deleted')
}
deleteeventsTable() {
return this.dbInstance.executeSql("DELETE from "+ this.events).then((res) => {
console.log('DELETE EVENT TABLE RESULT ', res)
});
}
deleteallprocessTable() {
return this.dbInstance.executeSql("DELETE from "+ this.allprocess).then((res) => {
console.log('DELETE ALLPROCESS TABLE RESULT ', res)
});
}
deleteactionsTable() {
return this.dbInstance.executeSql("DELETE from "+ this.actions).then((res) => {
console.log('DELETE actions TABLE RESULT ', res)
});
}
deletepublicationsTable() {
return this.dbInstance.executeSql("DELETE from "+ this.publications).then((res) => {
console.log('DELETE publications TABLE RESULT ', res)
});
}
}