update task scrap service
This commit is contained in:
parent
5c9ea7d721
commit
f7c257b379
|
|
@ -191,7 +191,8 @@ export class TasksService {
|
|||
|
||||
await this.runProcess(processName);
|
||||
|
||||
const ramKeywords = ['DDR4', 'DDR5', 'DDR4|', 'DDR5|'];
|
||||
const ramPrefixes = ['DDR4|', 'DDR5|'];
|
||||
const ramKeywords = ['DDR4', 'DDR5', ...ramPrefixes];
|
||||
|
||||
// Khi process kết thúc => gửi mail
|
||||
const startOfDay = new Date();
|
||||
|
|
@ -209,16 +210,16 @@ export class TasksService {
|
|||
order: { updated_at: 'DESC' },
|
||||
});
|
||||
|
||||
const qb = this.scrapConfigService.scrapConfigRepo.createQueryBuilder('sc');
|
||||
const productConfigQb =
|
||||
this.scrapConfigService.scrapConfigRepo.createQueryBuilder('sc');
|
||||
|
||||
ramKeywords.forEach((k, index) => {
|
||||
qb.andWhere(`sc.keywords NOT LIKE :kw${index}`, {
|
||||
[`kw${index}`]: `%${k}%`,
|
||||
ramPrefixes.forEach((k, i) => {
|
||||
productConfigQb.andWhere(`sc.keywords NOT LIKE :rk${i}`, {
|
||||
[`rk${i}`]: `${k}%`,
|
||||
});
|
||||
});
|
||||
|
||||
// Product Config
|
||||
const productConfigs = await qb.getMany();
|
||||
const productConfigs = await productConfigQb.getMany();
|
||||
|
||||
// Data Not Ram
|
||||
const rams = await this.scrapItemsService.scrapItemRepo.find({
|
||||
|
|
|
|||
Loading…
Reference in New Issue