Update link ip and dns, update view AI
This commit is contained in:
parent
46f72decd3
commit
a356552d5b
|
|
@ -32,7 +32,7 @@ export default class AuthController {
|
||||||
const user = await User.query().where('user_name', userName).first()
|
const user = await User.query().where('user_name', userName).first()
|
||||||
|
|
||||||
if (!user) {
|
if (!user) {
|
||||||
const remoteUrl = process.env.ERP_URL || 'https://stage.nswteam.net'
|
const remoteUrl = process.env.ERP_URL_AUTH || 'https://stage.nswteam.net'
|
||||||
const remoteResp = await axios.post(remoteUrl + '/api/login', {
|
const remoteResp = await axios.post(remoteUrl + '/api/login', {
|
||||||
userEmail: userName,
|
userEmail: userName,
|
||||||
password: password,
|
password: password,
|
||||||
|
|
|
||||||
|
|
@ -924,7 +924,7 @@ export default class LineConnection {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
const remoteUrl = process.env.ERP_URL || 'https://stage.nswteam.net'
|
const remoteUrl = process.env.ERP_URL_AUTH || 'https://stage.nswteam.net'
|
||||||
const remoteResp = await axios.post(
|
const remoteResp = await axios.post(
|
||||||
remoteUrl + '/api/transferPostData',
|
remoteUrl + '/api/transferPostData',
|
||||||
{
|
{
|
||||||
|
|
@ -937,7 +937,6 @@ export default class LineConnection {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
console.log('AI detect log response:', remoteResp.data)
|
|
||||||
return remoteResp.data?.Status === 'OK' ? remoteResp.data?.data : ''
|
return remoteResp.data?.Status === 'OK' ? remoteResp.data?.data : ''
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
console.log('[ERROR] Detect log from AI', error)
|
console.log('[ERROR] Detect log from AI', error)
|
||||||
|
|
@ -1059,7 +1058,7 @@ export default class LineConnection {
|
||||||
await sendMessageToMail(
|
await sendMessageToMail(
|
||||||
`[ATC] - [${this.config.stationName} - Line: ${this.config.lineNumber}] - Raw log issue ${result?.errors?.some((e) => e.category === 'SPECIAL_KEYWORD') ? '+ Special keywords' : ''}`,
|
`[ATC] - [${this.config.stationName} - Line: ${this.config.lineNumber}] - Raw log issue ${result?.errors?.some((e) => e.category === 'SPECIAL_KEYWORD') ? '+ Special keywords' : ''}`,
|
||||||
tableHTML +
|
tableHTML +
|
||||||
`${`
|
`${`
|
||||||
<hr />
|
<hr />
|
||||||
<p>Logs:</p>
|
<p>Logs:</p>
|
||||||
<div style="white-space: break-spaces; background-color: #f5f5f5; color: black; padding: 8px; max-height: 500px; overflow-y: scroll; border: 1px #ccc solid;"><span style="color: black;">
|
<div style="white-space: break-spaces; background-color: #f5f5f5; color: black; padding: 8px; max-height: 500px; overflow-y: scroll; border: 1px #ccc solid;"><span style="color: black;">
|
||||||
|
|
@ -1100,9 +1099,9 @@ export default class LineConnection {
|
||||||
<td style="padding:6px; text-align:center;">${r.rule}</td>
|
<td style="padding:6px; text-align:center;">${r.rule}</td>
|
||||||
<td style="padding:6px; text-align:center;">${r.message}</td>
|
<td style="padding:6px; text-align:center;">${r.message}</td>
|
||||||
<td style="padding:6px; font-family:monospace;">${escapeHtml(r.log.trim())
|
<td style="padding:6px; font-family:monospace;">${escapeHtml(r.log.trim())
|
||||||
.split('*')
|
.split('*')
|
||||||
.filter((el) => el)
|
.filter((el) => el)
|
||||||
.join('<br/>*')}</td>
|
.join('<br/>*')}</td>
|
||||||
</tr>
|
</tr>
|
||||||
`
|
`
|
||||||
)
|
)
|
||||||
|
|
@ -1479,7 +1478,7 @@ Ports Missing/Down: ${missing.length}\n\n`
|
||||||
await sendMessageToMail(
|
await sendMessageToMail(
|
||||||
`[ATC] - [${this.config.stationName} - Line: ${this.config.lineNumber}] - Load IOS Report`,
|
`[ATC] - [${this.config.stationName} - Line: ${this.config.lineNumber}] - Load IOS Report`,
|
||||||
body +
|
body +
|
||||||
`${`
|
`${`
|
||||||
<hr />
|
<hr />
|
||||||
<p>Logs:</p>
|
<p>Logs:</p>
|
||||||
<div style="white-space: break-spaces; background-color: #f5f5f5; color: black; padding: 8px; max-height: 500px; overflow-y: scroll; border: 1px #ccc solid;"><span style="color: black;">
|
<div style="white-space: break-spaces; background-color: #f5f5f5; color: black; padding: 8px; max-height: 500px; overflow-y: scroll; border: 1px #ccc solid;"><span style="color: black;">
|
||||||
|
|
@ -1517,7 +1516,7 @@ Ports Missing/Down: ${missing.length}\n\n`
|
||||||
await sendMessageToMail(
|
await sendMessageToMail(
|
||||||
`[ATC] - [${this.config.stationName} - Line: ${this.config.lineNumber}] - Load License Report`,
|
`[ATC] - [${this.config.stationName} - Line: ${this.config.lineNumber}] - Load License Report`,
|
||||||
body +
|
body +
|
||||||
`${`
|
`${`
|
||||||
<hr />
|
<hr />
|
||||||
<p>Logs:</p>
|
<p>Logs:</p>
|
||||||
<div style="white-space: break-spaces; background-color: #f5f5f5; color: black; padding: 8px; max-height: 500px; overflow-y: scroll; border: 1px #ccc solid;"><span style="color: black;">
|
<div style="white-space: break-spaces; background-color: #f5f5f5; color: black; padding: 8px; max-height: 500px; overflow-y: scroll; border: 1px #ccc solid;"><span style="color: black;">
|
||||||
|
|
@ -1767,7 +1766,7 @@ Ports Missing/Down: ${missing.length}\n\n`
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
const remoteUrl = process.env.ERP_URL || 'https://stage.nswteam.net'
|
const remoteUrl = process.env.ERP_URL_AUTH || 'https://stage.nswteam.net'
|
||||||
const remoteResp = await axios.post(
|
const remoteResp = await axios.post(
|
||||||
remoteUrl + '/api/transferPostData',
|
remoteUrl + '/api/transferPostData',
|
||||||
{
|
{
|
||||||
|
|
@ -1806,15 +1805,15 @@ Ports Missing/Down: ${missing.length}\n\n`
|
||||||
<hr />
|
<hr />
|
||||||
<div style="white-space: break-spaces; background-color: #f5f5f5; color: black; padding: 8px; max-height: 500px; overflow-y: scroll; border: 1px #ccc solid;"><span style="color: black;">
|
<div style="white-space: break-spaces; background-color: #f5f5f5; color: black; padding: 8px; max-height: 500px; overflow-y: scroll; border: 1px #ccc solid;"><span style="color: black;">
|
||||||
${escapeHtml(output)
|
${escapeHtml(output)
|
||||||
.replace('show ver', '')
|
.replace('show ver', '')
|
||||||
.replace('sh ver', '')
|
.replace('sh ver', '')
|
||||||
.replace('show version', '')
|
.replace('show version', '')
|
||||||
.replace('sh version', '')
|
.replace('sh version', '')
|
||||||
.replace(mem, `<span style="color: ${isWarningRAM ? 'red' : 'black'};">${mem}</span>`)
|
.replace(mem, `<span style="color: ${isWarningRAM ? 'red' : 'black'};">${mem}</span>`)
|
||||||
.replace(
|
.replace(
|
||||||
flash,
|
flash,
|
||||||
`<span style="color: ${isWarningFlash ? 'red' : 'black'};">${flash}</span>`
|
`<span style="color: ${isWarningFlash ? 'red' : 'black'};">${flash}</span>`
|
||||||
)}</span></div>
|
)}</span></div>
|
||||||
`
|
`
|
||||||
await sendMessageToMail(subject, body)
|
await sendMessageToMail(subject, body)
|
||||||
}
|
}
|
||||||
|
|
@ -1891,37 +1890,34 @@ Ports Missing/Down: ${missing.length}\n\n`
|
||||||
IOS: <b>${dataShowVersion?.SOFTWARE_IMAGE ?? ''}</b> <b>${dataShowVersion?.VERSION ?? ''}</b><br/>
|
IOS: <b>${dataShowVersion?.SOFTWARE_IMAGE ?? ''}</b> <b>${dataShowVersion?.VERSION ?? ''}</b><br/>
|
||||||
MEM: <b>${dataShowVersion?.MEMORY ? convertFromKilobytesString(dataShowVersion?.MEMORY) : ''}</b><br/>
|
MEM: <b>${dataShowVersion?.MEMORY ? convertFromKilobytesString(dataShowVersion?.MEMORY) : ''}</b><br/>
|
||||||
FLASH: <b>${dataShowVersion?.USB_FLASH ? convertFromKilobytesString(dataShowVersion?.USB_FLASH) : ''}</b><br/>
|
FLASH: <b>${dataShowVersion?.USB_FLASH ? convertFromKilobytesString(dataShowVersion?.USB_FLASH) : ''}</b><br/>
|
||||||
Licenses: <b>${
|
Licenses: <b>${dataShowLic
|
||||||
dataShowLic
|
? dataShowLic
|
||||||
? dataShowLic
|
?.filter((el) => el.LICENSE_TYPE?.toLowerCase()?.includes('permanent'))
|
||||||
?.filter((el) => el.LICENSE_TYPE?.toLowerCase()?.includes('permanent'))
|
?.map((v) => v.FEATURE)
|
||||||
?.map((v) => v.FEATURE)
|
?.join(', ')
|
||||||
?.join(', ')
|
: ''
|
||||||
: ''
|
}</b><br/>
|
||||||
}</b><br/>
|
|
||||||
Detect from AI: <b style="color: 'black';">${issue?.length ? `<br>- ` + issue.join(`<br>`) : 'No issues detected.'}</b><br/>
|
Detect from AI: <b style="color: 'black';">${issue?.length ? `<br>- ` + issue.join(`<br>`) : 'No issues detected.'}</b><br/>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
Total Ports: ${portPhysical?.length}<br/>
|
Total Ports: ${portPhysical?.length}<br/>
|
||||||
Ports Tested (Link UP): <b style="color: #008000;">${tested.length} (${testedPoE?.length} PoE, ${testedSFP?.length} SFP)</b><br/>
|
Ports Tested (Link UP): <b style="color: #008000;">${tested.length} (${testedPoE?.length} PoE, ${testedSFP?.length} SFP)</b><br/>
|
||||||
Ports Missing/Down: <b style="color: #ff0000;">${missing.length}</b><br/>
|
Ports Missing/Down: <b style="color: #ff0000;">${missing.length}</b><br/>
|
||||||
${
|
${missingPoE?.length
|
||||||
missingPoE?.length
|
? `
|
||||||
? `
|
|
||||||
<br/><b style="color: #ff0000;">Ports Missing PoE</b><br/>
|
<br/><b style="color: #ff0000;">Ports Missing PoE</b><br/>
|
||||||
────────────────────────────────<br/>
|
────────────────────────────────<br/>
|
||||||
<div style="column-count: 6;">${missingPoE.map((p) => physicalTest.normalizePortName(p.name)).join('<br/>')}</div>
|
<div style="column-count: 6;">${missingPoE.map((p) => physicalTest.normalizePortName(p.name)).join('<br/>')}</div>
|
||||||
`
|
`
|
||||||
: ''
|
: ''
|
||||||
}
|
}
|
||||||
${
|
${missingSFP?.length
|
||||||
missingSFP?.length
|
? `
|
||||||
? `
|
|
||||||
<br/><b style="color: #ff0000;">Ports Missing SFP</b><br/>
|
<br/><b style="color: #ff0000;">Ports Missing SFP</b><br/>
|
||||||
────────────────────────────────<br/>
|
────────────────────────────────<br/>
|
||||||
<div style="column-count: 6;">${missingSFP.map((p) => physicalTest.normalizePortName(p.name)).join('<br/>')}</div>`
|
<div style="column-count: 6;">${missingSFP.map((p) => physicalTest.normalizePortName(p.name)).join('<br/>')}</div>`
|
||||||
: ''
|
: ''
|
||||||
}
|
}
|
||||||
${reasonSkipPhysical}
|
${reasonSkipPhysical}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
@ -2059,25 +2055,27 @@ Ports Missing/Down: ${missing.length}\n\n`
|
||||||
// AI issue rows (one per real AI issue, fall back to file's hardcoded row when none)
|
// AI issue rows (one per real AI issue, fall back to file's hardcoded row when none)
|
||||||
const aiIssueRowsHtml =
|
const aiIssueRowsHtml =
|
||||||
issues.length > 0
|
issues.length > 0
|
||||||
? issues
|
? issues.length > 1
|
||||||
|
? issues
|
||||||
.slice(0, 1)
|
.slice(0, 1)
|
||||||
.map(
|
.map(
|
||||||
(issue) =>
|
(issue) =>
|
||||||
`<table cellpadding="0" cellspacing="0" border="0" width="100%" style="background:#f5f3ff;border:1px solid #c4b5fd;border-radius:6px;margin-bottom:5px;border-collapse:separate;"><tr><td style="padding:7px 12px;font-size:12px;color:#5f6978;font-weight:500;"><span style="display:inline-block;background:#7c3aed;color:#fff;font-size:9px;font-weight:700;letter-spacing:.5px;padding:2px 6px;border-radius:4px;vertical-align:middle;">★ AI</span><span style="margin-left:8px;vertical-align:middle;">${escapeHtml(issue)}</span></td><td align="right" style="padding:7px 12px;width:90px;"></td></tr></table>`
|
`<table cellpadding="0" cellspacing="0" border="0" width="100%" style="background:#f5f3ff;border:1px solid #c4b5fd;border-radius:6px;margin-bottom:5px;border-collapse:separate;"><tr><td style="padding:7px 12px;font-size:12px;color:#5f6978;font-weight:500;"><span style="display:inline-block;background:#7c3aed;color:#fff;font-size:9px;font-weight:700;letter-spacing:.5px;padding:2px 6px;border-radius:4px;vertical-align:middle;">★ AI</span><span style="margin-left:8px;vertical-align:middle;">${escapeHtml(issue)}</span></td><td align="right" style="padding:7px 12px;width:90px;"></td></tr></table>`
|
||||||
)
|
)
|
||||||
.join('')
|
.join('')
|
||||||
|
: `<table cellpadding="0" cellspacing="0" border="0" width="100%" style="background:#f5f3ff;border:1px solid #c4b5fd;border-radius:6px;margin-bottom:5px;border-collapse:separate;"><tr><td style="padding:7px 12px;font-size:12px;color:#5f6978;font-weight:500;"><span style="display:inline-block;background:#7c3aed;color:#fff;font-size:9px;font-weight:700;letter-spacing:.5px;padding:2px 6px;border-radius:4px;vertical-align:middle;">★ AI</span><span style="margin-left:8px;vertical-align:middle;">${escapeHtml(issues[0].split('\n')[0] || '')}</span></td><td align="right" style="padding:7px 12px;width:90px;"></td></tr></table>`
|
||||||
: ``
|
: ``
|
||||||
|
|
||||||
// License boxes (real licenses if available, else file's hardcoded boxes)
|
// License boxes (real licenses if available, else file's hardcoded boxes)
|
||||||
const licenseBoxesHtml =
|
const licenseBoxesHtml =
|
||||||
dataShowLic && dataShowLic.length > 0
|
dataShowLic && dataShowLic.length > 0
|
||||||
? dataShowLic
|
? dataShowLic
|
||||||
.filter((l) => l.LICENSE_TYPE && l.FEATURE)
|
.filter((l) => l.LICENSE_TYPE && l.FEATURE)
|
||||||
.map(
|
.map(
|
||||||
(l: any) =>
|
(l: any) =>
|
||||||
`<div style="background:#f9fafb;border:1px solid #f0f1f3;border-radius:6px;padding:8px 12px;margin-bottom:6px;"><div style="font-weight:700;color:#3b82f6;font-size:13px;">${escapeHtml(String(l.FEATURE || ''))}</div><div style="font-size:10px;color:#9ca3af;">${escapeHtml(String(l.LICENSE_TYPE || ''))}${l.STATUS ? ' · ' + escapeHtml(String(l.STATUS)) : ''}</div></div>`
|
`<div style="background:#f9fafb;border:1px solid #f0f1f3;border-radius:6px;padding:8px 12px;margin-bottom:6px;"><div style="font-weight:700;color:#3b82f6;font-size:13px;">${escapeHtml(String(l.FEATURE || ''))}</div><div style="font-size:10px;color:#9ca3af;">${escapeHtml(String(l.LICENSE_TYPE || ''))}${l.STATUS ? ' · ' + escapeHtml(String(l.STATUS)) : ''}</div></div>`
|
||||||
)
|
)
|
||||||
.join('')
|
.join('')
|
||||||
: ``
|
: ``
|
||||||
|
|
||||||
// Port stat values (real numbers if any port data, else file's defaults)
|
// Port stat values (real numbers if any port data, else file's defaults)
|
||||||
|
|
@ -2152,7 +2150,7 @@ Ports Missing/Down: ${missing.length}\n\n`
|
||||||
const image = imageList[idx]
|
const image = imageList[idx]
|
||||||
const label = imageLabels[idx]
|
const label = imageLabels[idx]
|
||||||
return image && image.url
|
return image && image.url
|
||||||
? imageCellHtml(process.env.ERP_URL + image.url, label)
|
? imageCellHtml(process.env.ERP_URL_AUTH + image.url, label)
|
||||||
: photoCellHtml(label)
|
: photoCellHtml(label)
|
||||||
}
|
}
|
||||||
const photoGridRowsHtml = `
|
const photoGridRowsHtml = `
|
||||||
|
|
@ -2460,14 +2458,13 @@ Ports Missing/Down: ${missing.length}\n\n`
|
||||||
<td width="33%" valign="top" style="padding-right:8px;">
|
<td width="33%" valign="top" style="padding-right:8px;">
|
||||||
<div style="font-size:10px;font-weight:700;text-transform:uppercase;color:#9ca3af;letter-spacing:.5px;margin-bottom:8px;">Hardware Inventory</div>
|
<div style="font-size:10px;font-weight:700;text-transform:uppercase;color:#9ca3af;letter-spacing:.5px;margin-bottom:8px;">Hardware Inventory</div>
|
||||||
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="font-size:11px;">
|
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="font-size:11px;">
|
||||||
${
|
${this.config?.inventory?.listInventory
|
||||||
this.config?.inventory?.listInventory
|
?.map(
|
||||||
?.map(
|
(item: any) => `
|
||||||
(item: any) => `
|
|
||||||
<tr><td style="margin-top:4px;padding:4px 0;border-bottom:1px solid #f0f1f3;font-weight:600;color:#5f6978;">${item.pid}</td><td style="padding:2px 0;border-bottom:1px solid #f0f1f3;font-family:Consolas,monospace;color:#9ca3af;text-align:right;"><a href="#${item.sn}" style="text-decoration: underline;">${item.sn}</a></td></tr>`
|
<tr><td style="margin-top:4px;padding:4px 0;border-bottom:1px solid #f0f1f3;font-weight:600;color:#5f6978;">${item.pid}</td><td style="padding:2px 0;border-bottom:1px solid #f0f1f3;font-family:Consolas,monospace;color:#9ca3af;text-align:right;"><a href="#${item.sn}" style="text-decoration: underline;">${item.sn}</a></td></tr>`
|
||||||
)
|
)
|
||||||
.join('') || ''
|
.join('') || ''
|
||||||
}
|
}
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
<td width="33%" valign="top" style="padding:0 4px;">
|
<td width="33%" valign="top" style="padding:0 4px;">
|
||||||
|
|
@ -2483,7 +2480,6 @@ Ports Missing/Down: ${missing.length}\n\n`
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td width="50%" style="padding:0 3px 0 0;"><table cellpadding="0" cellspacing="0" border="0" width="100%" style="background:#f8fafc;border:1px solid #e2e8f0;border-radius:6px;border-collapse:separate;"><tr><td align="center" style="padding:6px;"><div style="font-weight:800;font-size:14px;color: ${missingSFP.length > 0 || missingPoE.length > 0 ? '#f59e0b' : '#10b981'};">${missingSFP.length > 0 || missingPoE.length > 0 ? 'WARN' : 'PASS'}</div><div style="font-size:9px;font-weight:600;color:#9ca3af;text-transform:uppercase;">PoE+ Test</div></td></tr></table></td>
|
<td width="50%" style="padding:0 3px 0 0;"><table cellpadding="0" cellspacing="0" border="0" width="100%" style="background:#f8fafc;border:1px solid #e2e8f0;border-radius:6px;border-collapse:separate;"><tr><td align="center" style="padding:6px;"><div style="font-weight:800;font-size:14px;color: ${missingSFP.length > 0 || missingPoE.length > 0 ? '#f59e0b' : '#10b981'};">${missingSFP.length > 0 || missingPoE.length > 0 ? 'WARN' : 'PASS'}</div><div style="font-size:9px;font-weight:600;color:#9ca3af;text-transform:uppercase;">PoE+ Test</div></td></tr></table></td>
|
||||||
<td width="50%" style="padding:0 0 0 3px;"><table cellpadding="0" cellspacing="0" border="0" width="100%" style="background:#f8fafc;border:1px solid #e2e8f0;border-radius:6px;border-collapse:separate;"><tr><td align="center" style="padding:6px;"><div style="font-weight:800;font-size:14px;color: ${missingSFP.length > 0 || missingPoE.length > 0 ? '#f59e0b' : '#10b981'};">${totalPoE + totalSFP === 0 ? 100 : Math.round(((totalPoE + totalSFP - (missingPoE.length + missingSFP.length)) / (totalPoE + totalSFP)) * 100)}%</div><div style="font-size:9px;font-weight:600;color:#9ca3af;text-transform:uppercase;">Throughput</div></td></tr></table></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
${missingDetailsHtml}
|
${missingDetailsHtml}
|
||||||
|
|
|
||||||
|
|
@ -681,13 +681,29 @@ export async function updateNoteToERP(sn: string, note: string) {
|
||||||
const header = {
|
const header = {
|
||||||
Authorization: 'Bearer ' + process.env.ERP_TOKEN,
|
Authorization: 'Bearer ' + process.env.ERP_TOKEN,
|
||||||
}
|
}
|
||||||
|
// const responseDataSN = await axios.post(
|
||||||
|
// 'https://stage.nswteam.net/api/transferGetData',
|
||||||
|
// {
|
||||||
|
// urlAPI: '/api/stock-model-serial/get-list-for-test-log',
|
||||||
|
// filter: {
|
||||||
|
// where: {
|
||||||
|
// _q: 'FOC1425Z3RN',
|
||||||
|
// },
|
||||||
|
// orgId: ['5fadc798f070e4b64b53ac9c', '5fadc7b0f070e4b64b53ac9d'],
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// headers: header,
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
|
||||||
const responseDataSN = await axios.get(
|
const responseDataSN = await axios.get(
|
||||||
remoteUrl + '/api/stock-model-serial/get-list-for-test-log',
|
remoteUrl + '/api/stock-model-serial/get-list-for-test-log',
|
||||||
{
|
{
|
||||||
params: {
|
params: {
|
||||||
filter: {
|
filter: {
|
||||||
where: {
|
where: {
|
||||||
_q: 'FOC1425Z3RN',
|
_q: sn,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
orgId: ['5fadc798f070e4b64b53ac9c', '5fadc7b0f070e4b64b53ac9d'],
|
orgId: ['5fadc798f070e4b64b53ac9c', '5fadc7b0f070e4b64b53ac9d'],
|
||||||
|
|
@ -716,13 +732,9 @@ export async function updateNoteToERP(sn: string, note: string) {
|
||||||
testNotes: note + (dataSN?.testNotes || ''),
|
testNotes: note + (dataSN?.testNotes || ''),
|
||||||
}
|
}
|
||||||
// console.log(payload)
|
// console.log(payload)
|
||||||
await axios.post(
|
await axios.post(remoteUrl + '/api/stock-model-serial/data-save-for-test-log', payload, {
|
||||||
remoteUrl + '/api/stock-model-serial/data-save-for-test-log',
|
headers: header,
|
||||||
payload,
|
})
|
||||||
{
|
|
||||||
headers: header,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('updateNoteToERP', error)
|
console.log('updateNoteToERP', error)
|
||||||
}
|
}
|
||||||
|
|
@ -1441,6 +1453,21 @@ export async function getIncomingInfoBySN(sn: string) {
|
||||||
const header = {
|
const header = {
|
||||||
Authorization: 'Bearer ' + process.env.ERP_TOKEN,
|
Authorization: 'Bearer ' + process.env.ERP_TOKEN,
|
||||||
}
|
}
|
||||||
|
// const responseDataSN = await axios.post(
|
||||||
|
// 'https://stage.nswteam.net/api/transferGetData',
|
||||||
|
// {
|
||||||
|
// urlAPI: '/api/package-po/get-incoming-by-sn',
|
||||||
|
// filter: {
|
||||||
|
// where: {
|
||||||
|
// serialNumber: sn,
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// headers: header,
|
||||||
|
// }
|
||||||
|
// )
|
||||||
|
|
||||||
const responseDataSN = await axios.get(
|
const responseDataSN = await axios.get(
|
||||||
remoteUrl + '/api/package-po/get-incoming-by-sn',
|
remoteUrl + '/api/package-po/get-incoming-by-sn',
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue