Ajustes para simplifique
All checks were successful
Deploy NestJS API / build-and-push-deploy (push) Successful in 2m9s
All checks were successful
Deploy NestJS API / build-and-push-deploy (push) Successful in 2m9s
This commit is contained in:
@@ -93,7 +93,7 @@ export class UserService {
|
|||||||
' WHERE PCEMPR.CODFILIAL = PCFILIAL.CODIGO (+)' +
|
' WHERE PCEMPR.CODFILIAL = PCFILIAL.CODIGO (+)' +
|
||||||
' AND PCPARAMFILIAL.CODFILIAL = \'99\' ' +
|
' AND PCPARAMFILIAL.CODFILIAL = \'99\' ' +
|
||||||
' AND PCPARAMFILIAL.NOME = \'CON_CODSETORGERENTELOJA\' ' +
|
' AND PCPARAMFILIAL.NOME = \'CON_CODSETORGERENTELOJA\' ' +
|
||||||
' AND PCEMPR.EMAIL = :username AND PCEMPR.SENHABD = CRYPT(:password, USUARIOBD)';
|
' AND PCEMPR.USUARIOBD = :username AND PCEMPR.SENHABD = CRYPT(:password, USUARIOBD)';
|
||||||
|
|
||||||
const users = await queryRunner.manager
|
const users = await queryRunner.manager
|
||||||
.query(sql, [user.email, user.password]);
|
.query(sql, [user.email, user.password]);
|
||||||
|
|||||||
@@ -1622,8 +1622,8 @@ export class Pcclient {
|
|||||||
@Column({ name: 'CODCONDCOMERCIAL' })
|
@Column({ name: 'CODCONDCOMERCIAL' })
|
||||||
codcondcomercial: string;
|
codcondcomercial: string;
|
||||||
|
|
||||||
@Column({ name: 'MEIOCOMUNICACAO' })
|
// @Column({ name: 'MEIOCOMUNICACAO' })
|
||||||
meiocomunicacao: string;
|
// meiocomunicacao: string;
|
||||||
|
|
||||||
@Column({ name: 'CODGRUPOCOMERCIALMED' })
|
@Column({ name: 'CODGRUPOCOMERCIALMED' })
|
||||||
codgrupocomercialmed: number;
|
codgrupocomercialmed: number;
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export class CustomerService {
|
|||||||
' ,pccidade.codibge as "ibgeCode" ' +
|
' ,pccidade.codibge as "ibgeCode" ' +
|
||||||
' ,pcclient.dtnasc as "birthdate" ' +
|
' ,pcclient.dtnasc as "birthdate" ' +
|
||||||
' ,pcclient.codatv1 as "ramoId" ' +
|
' ,pcclient.codatv1 as "ramoId" ' +
|
||||||
' ,pcclient.meiocomunicacao as "communicate" ' +
|
// ' ,pcclient.meiocomunicacao as "communicate" ' +
|
||||||
' ,pcclient.latitude as "latitude" ' +
|
' ,pcclient.latitude as "latitude" ' +
|
||||||
' ,pcclient.longitude as "longitude" ' +
|
' ,pcclient.longitude as "longitude" ' +
|
||||||
' ,pcclient.codmunicipio as "ibgeCode" ' +
|
' ,pcclient.codmunicipio as "ibgeCode" ' +
|
||||||
@@ -102,14 +102,14 @@ export class CustomerService {
|
|||||||
' ,pcclient.telent as "phone" ' +
|
' ,pcclient.telent as "phone" ' +
|
||||||
' ,pcclient.telcelent as "cellPhone" ' +
|
' ,pcclient.telcelent as "cellPhone" ' +
|
||||||
' ,pcclient.ieent as "numberState" ' +
|
' ,pcclient.ieent as "numberState" ' +
|
||||||
' ,pcclient.codcategoria as "categoryId" ' +
|
// ' ,pcclient.codcategoria as "categoryId" ' +
|
||||||
' ,pcclient.codsubcategoria as "subCategoryId" ' +
|
// ' ,pcclient.codsubcategoria as "subCategoryId" ' +
|
||||||
' ,pcclient.codpraca as "placeId" ' +
|
' ,pcclient.codpraca as "placeId" ' +
|
||||||
' ,pcclient.codusur1 as "sellerId" ' +
|
' ,pcclient.codusur1 as "sellerId" ' +
|
||||||
' ,pccidade.codibge as "ibgeCode" ' +
|
' ,pccidade.codibge as "ibgeCode" ' +
|
||||||
' ,pcclient.dtnasc as "birthdate" ' +
|
' ,pcclient.dtnasc as "birthdate" ' +
|
||||||
' ,pcclient.codatv1 as "ramoId" ' +
|
' ,pcclient.codatv1 as "ramoId" ' +
|
||||||
' ,pcclient.meiocomunicacao as "communicate" ' +
|
// ' ,pcclient.meiocomunicacao as "communicate" ' +
|
||||||
' ,pcclient.latitude as "latitude" ' +
|
' ,pcclient.latitude as "latitude" ' +
|
||||||
' ,pcclient.longitude as "longitude" ' +
|
' ,pcclient.longitude as "longitude" ' +
|
||||||
' ,pcclient.codmunicipio as "ibgeCode" ' +
|
' ,pcclient.codmunicipio as "ibgeCode" ' +
|
||||||
@@ -158,7 +158,7 @@ export class CustomerService {
|
|||||||
' ,pccidade.codibge as "ibgeCode" ' +
|
' ,pccidade.codibge as "ibgeCode" ' +
|
||||||
' ,pcclient.dtnasc as "birthdate" ' +
|
' ,pcclient.dtnasc as "birthdate" ' +
|
||||||
' ,pcclient.codatv1 as "ramoId" ' +
|
' ,pcclient.codatv1 as "ramoId" ' +
|
||||||
' ,pcclient.meiocomunicacao as "communicate" ' +
|
//' ,pcclient.meiocomunicacao as "communicate" ' +
|
||||||
' ,pcclient.latitude as "latitude" ' +
|
' ,pcclient.latitude as "latitude" ' +
|
||||||
' ,pcclient.longitude as "longitude" ' +
|
' ,pcclient.longitude as "longitude" ' +
|
||||||
' ,pcclient.codmunicipio as "ibgeCode" ' +
|
' ,pcclient.codmunicipio as "ibgeCode" ' +
|
||||||
@@ -317,7 +317,7 @@ export class CustomerService {
|
|||||||
newCustomer.codmunicipio = Number.parseInt(customer.ibgeCode);
|
newCustomer.codmunicipio = Number.parseInt(customer.ibgeCode);
|
||||||
newCustomer.codcidadecom = newCustomer.codcidade;
|
newCustomer.codcidadecom = newCustomer.codcidade;
|
||||||
newCustomer.dtnasc = customer.birthdate;
|
newCustomer.dtnasc = customer.birthdate;
|
||||||
newCustomer.meiocomunicacao = customer.communicate;
|
// newCustomer.meiocomunicacao = customer.communicate;
|
||||||
newCustomer.codfunccad = customer.idUser;
|
newCustomer.codfunccad = customer.idUser;
|
||||||
newCustomer.codfunccadastro = customer.idUser;
|
newCustomer.codfunccadastro = customer.idUser;
|
||||||
newCustomer.codfuncultalter = customer.idUser;
|
newCustomer.codfuncultalter = customer.idUser;
|
||||||
@@ -341,7 +341,7 @@ export class CustomerService {
|
|||||||
city: customer.city, state: customer.state,
|
city: customer.city, state: customer.state,
|
||||||
allowMessage: customer.allowMessage, cellPhone: customer.cellPhone,
|
allowMessage: customer.allowMessage, cellPhone: customer.cellPhone,
|
||||||
category: customer.category, subCategory: customer.subCategory,
|
category: customer.category, subCategory: customer.subCategory,
|
||||||
place: customer.place, ramo: customer.ramo, meiocomunicacao: customer.communicate,
|
place: customer.place, ramo: customer.ramo, /*meiocomunicacao: customer.communicate,*/
|
||||||
latitude: customer.latitude, longitude: customer.longitude, ibgeCode: customer.ibgeCode,
|
latitude: customer.latitude, longitude: customer.longitude, ibgeCode: customer.ibgeCode,
|
||||||
addressType: customer.addressType,
|
addressType: customer.addressType,
|
||||||
};
|
};
|
||||||
@@ -361,7 +361,7 @@ export class CustomerService {
|
|||||||
city: customer.city, state: customer.state,
|
city: customer.city, state: customer.state,
|
||||||
allowMessage: customer.allowMessage, cellPhone: customer.cellPhone,
|
allowMessage: customer.allowMessage, cellPhone: customer.cellPhone,
|
||||||
category: customer.category, subCategory: customer.subCategory,
|
category: customer.category, subCategory: customer.subCategory,
|
||||||
place: customer.place, meiocomunicacao: customer.communicate,
|
place: customer.place, /*meiocomunicacao: customer.communicate,*/
|
||||||
ramo: customer.ramo, latitude: customer.latitude, longitude: customer.longitude,
|
ramo: customer.ramo, latitude: customer.latitude, longitude: customer.longitude,
|
||||||
ibgeCode: customer.ibgeCode, addressType: customer.addressType,
|
ibgeCode: customer.ibgeCode, addressType: customer.addressType,
|
||||||
};
|
};
|
||||||
@@ -378,7 +378,7 @@ export class CustomerService {
|
|||||||
await queryRunner.connect();
|
await queryRunner.connect();
|
||||||
await queryRunner.startTransaction();
|
await queryRunner.startTransaction();
|
||||||
try {
|
try {
|
||||||
console.log("MEIO DE COMUNICACAO: " + client.meiocomunicacao);
|
//console.log("MEIO DE COMUNICACAO: " + client.meiocomunicacao);
|
||||||
await queryRunner.manager
|
await queryRunner.manager
|
||||||
.createQueryBuilder()
|
.createQueryBuilder()
|
||||||
.update(Pcclient)
|
.update(Pcclient)
|
||||||
@@ -419,7 +419,7 @@ export class CustomerService {
|
|||||||
codcidadecom: client.codcidade,
|
codcidadecom: client.codcidade,
|
||||||
dtnasc: client.dtnasc,
|
dtnasc: client.dtnasc,
|
||||||
codatv1: client.codatv1,
|
codatv1: client.codatv1,
|
||||||
meiocomunicacao: client.meiocomunicacao,
|
// meiocomunicacao: client.meiocomunicacao,
|
||||||
codfuncultalter: client.codfuncultalter,
|
codfuncultalter: client.codfuncultalter,
|
||||||
dtultalter: client.dtultalter,
|
dtultalter: client.dtultalter,
|
||||||
latitude: client.latitude,
|
latitude: client.latitude,
|
||||||
|
|||||||
@@ -1211,15 +1211,15 @@ export class SalesService {
|
|||||||
const lockKey = 'departments_lock';
|
const lockKey = 'departments_lock';
|
||||||
const lockTimeout = 30;
|
const lockTimeout = 30;
|
||||||
|
|
||||||
try {
|
// try {
|
||||||
const cachedDepartments = await this.redisClient.get(cacheKey);
|
// const cachedDepartments = await this.redisClient.get(cacheKey);
|
||||||
if (cachedDepartments) {
|
// if (cachedDepartments) {
|
||||||
console.log('Buscando departamentos no Redis');
|
// console.log('Buscando departamentos no Redis');
|
||||||
return JSON.parse(cachedDepartments);
|
// return JSON.parse(cachedDepartments);
|
||||||
}
|
// }
|
||||||
} catch (err) {
|
// } catch (err) {
|
||||||
console.error('Erro ao acessar o Redis (cache):', err);
|
// console.error('Erro ao acessar o Redis (cache):', err);
|
||||||
}
|
// }
|
||||||
const lockValue = Date.now() + lockTimeout * 1000 + 1;
|
const lockValue = Date.now() + lockTimeout * 1000 + 1;
|
||||||
const acquiredLock = await this.redisClient.set(lockKey, lockValue, 'NX', 'EX', lockTimeout);
|
const acquiredLock = await this.redisClient.set(lockKey, lockValue, 'NX', 'EX', lockTimeout);
|
||||||
|
|
||||||
@@ -1234,7 +1234,7 @@ export class SalesService {
|
|||||||
.getRepository(Esvdepartamento)
|
.getRepository(Esvdepartamento)
|
||||||
.createQueryBuilder('Esvdepartamento')
|
.createQueryBuilder('Esvdepartamento')
|
||||||
.innerJoinAndSelect('Esvdepartamento.secoes', 'secoes')
|
.innerJoinAndSelect('Esvdepartamento.secoes', 'secoes')
|
||||||
.innerJoinAndSelect('secoes.categorias', 'categorias')
|
.leftJoinAndSelect('secoes.categorias', 'categorias')
|
||||||
.where('"Esvdepartamento".tituloecommerce is not null')
|
.where('"Esvdepartamento".tituloecommerce is not null')
|
||||||
.orderBy('"Esvdepartamento".tituloecommerce, "secoes".tituloecommerce, "categorias".tituloecommerce')
|
.orderBy('"Esvdepartamento".tituloecommerce, "secoes".tituloecommerce, "categorias".tituloecommerce')
|
||||||
.getMany();
|
.getMany();
|
||||||
|
|||||||
Reference in New Issue
Block a user