diff --git a/app/Controllers/Http/ErpsController.ts b/app/Controllers/Http/ErpsController.ts index b093096..eff2dd5 100644 --- a/app/Controllers/Http/ErpsController.ts +++ b/app/Controllers/Http/ErpsController.ts @@ -5,8 +5,7 @@ import Env from "@ioc:Adonis/Core/Env"; const path = require("path"); const BASE_URL = Env.get("BASE_URL_LOG"); -const BASE_URL_AUTO = Env.get(`${BASE_URL}/AUTOlog/`); - +const BASE_URL_AUTO = `${BASE_URL}/AUTOlog/`; export default class ErpsController { /** * Controller do tim cac serial number trong cac log trong khoang thoi gian xac dinh @@ -20,10 +19,10 @@ export default class ErpsController { const { from, to } = request.all(); const getListLog = async (from, to) => { try { - // console.log("check!") const listLog: string[] = []; const response = await axios.get(BASE_URL); const responseAUTO = await axios.get(BASE_URL_AUTO); + console.log("check!!!!!!!!!!!!!!!!!!!!!") let data1 = response.data .split("\n") @@ -140,6 +139,20 @@ export default class ErpsController { } } + if (cleanedLine.includes("System serial num")) { + const PCB_SN = extractSN(cleanedLine.split(":")[1]); + if (PCB_SN) { + results.push({ + PID: "", + VID: "", + SN: PCB_SN, + line: [index + 1], + fileName: fName, + warehouse: getWarehouse(fName), + }); + } + } + // Processor board ID if (cleanedLine.includes("Processor board ID")) { const PBID = extractSN(cleanedLine.split(" ").pop());