Compare commits
14 Commits
e128634e05
...
db_setting
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9f165faf13 | ||
|
|
237ac9ee25 | ||
| f41f2378d7 | |||
| 41406f56e8 | |||
| af578a63bc | |||
| e8bc42e5de | |||
| 587e92a7da | |||
| c6515c1b5d | |||
| f656f0a439 | |||
| 1d32a0350b | |||
| abc531a41e | |||
| 8451101325 | |||
| 3e69e74bc9 | |||
| b9d28736e2 |
@@ -1,429 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>PC 사양 적정성 분석 기획서 (GPU 반영)</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700;900&family=Outfit:wght@400;500;600;700;800&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
:root {
|
||||
--primary: #4F46E5;
|
||||
--primary-light: #EEF2FF;
|
||||
--secondary: #10B981;
|
||||
--secondary-light: #D1FAE5;
|
||||
--danger: #EF4444;
|
||||
--danger-light: #FEE2E2;
|
||||
--warning: #F59E0B;
|
||||
--warning-light: #FEF3C7;
|
||||
--purple: #7C3AED;
|
||||
--purple-light: #EDE9FE;
|
||||
--text-dark: #0F172A;
|
||||
--text-body: #334155;
|
||||
--text-muted: #64748B;
|
||||
--border: #E2E8F0;
|
||||
--bg-light: #F8FAFC;
|
||||
}
|
||||
* { box-sizing: border-box; margin: 0; padding: 0; }
|
||||
body {
|
||||
font-family: 'Outfit', 'Noto Sans KR', sans-serif;
|
||||
color: var(--text-body);
|
||||
background: #fff;
|
||||
letter-spacing: -0.02em;
|
||||
line-height: 1.7;
|
||||
}
|
||||
.page { max-width: 980px; margin: 0 auto; padding: 3rem 2rem; }
|
||||
|
||||
/* ─ Header ─ */
|
||||
.doc-header { border-bottom: 3px solid var(--text-dark); padding-bottom: 1.75rem; margin-bottom: 3rem; }
|
||||
.doc-label {
|
||||
display: inline-block; font-size: 0.75rem; font-weight: 700; color: var(--primary);
|
||||
background: var(--primary-light); padding: 0.25rem 0.75rem; border-radius: 99px;
|
||||
text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.75rem;
|
||||
}
|
||||
.version-badge {
|
||||
display: inline-block; font-size: 0.7rem; font-weight: 700; color: var(--secondary);
|
||||
background: var(--secondary-light); padding: 0.2rem 0.6rem; border-radius: 99px;
|
||||
margin-left: 0.5rem; vertical-align: middle;
|
||||
}
|
||||
.doc-header h1 { font-size: 2rem; font-weight: 900; color: var(--text-dark); line-height: 1.25; margin-bottom: 1rem; }
|
||||
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.75rem; margin-top: 1rem; }
|
||||
.meta-item { background: var(--bg-light); border-radius: 8px; padding: 0.65rem 1rem; font-size: 0.83rem; }
|
||||
.meta-item .label { color: var(--text-muted); display: block; font-size: 0.75rem; }
|
||||
.meta-item .val { font-weight: 700; color: var(--text-dark); font-size: 0.9rem; }
|
||||
|
||||
/* ─ Sections ─ */
|
||||
section { margin-bottom: 3.5rem; }
|
||||
h2 {
|
||||
font-size: 1.3rem; font-weight: 800; color: var(--text-dark);
|
||||
padding-bottom: 0.5rem; border-bottom: 2px solid var(--border);
|
||||
margin-bottom: 1.5rem; display: flex; align-items: center; gap: 0.6rem;
|
||||
}
|
||||
h2 .num {
|
||||
display: inline-flex; align-items: center; justify-content: center;
|
||||
width: 28px; height: 28px; background: var(--primary); color: #fff;
|
||||
border-radius: 50%; font-size: 0.75rem; font-weight: 800; flex-shrink: 0;
|
||||
}
|
||||
h3 { font-size: 1.05rem; font-weight: 700; color: var(--text-dark); margin: 1.75rem 0 0.75rem; }
|
||||
p { margin-bottom: 1rem; color: var(--text-body); font-size: 0.97rem; }
|
||||
|
||||
/* ─ Boxes ─ */
|
||||
.box { border-radius: 10px; padding: 1.25rem 1.5rem; margin: 1.25rem 0; font-size: 0.93rem; }
|
||||
.box-blue { background: var(--primary-light); border-left: 4px solid var(--primary); }
|
||||
.box-green { background: var(--secondary-light); border-left: 4px solid var(--secondary); }
|
||||
.box-yellow { background: var(--warning-light); border-left: 4px solid var(--warning); }
|
||||
.box-red { background: var(--danger-light); border-left: 4px solid var(--danger); }
|
||||
.box-purple { background: var(--purple-light); border-left: 4px solid var(--purple); }
|
||||
.box-title { font-weight: 700; color: var(--text-dark); margin-bottom: 0.5rem; font-size: 0.95rem; }
|
||||
|
||||
/* ─ Score formula block ─ */
|
||||
.formula {
|
||||
background: #1E293B; color: #E2E8F0; border-radius: 8px;
|
||||
padding: 1rem 1.25rem; font-family: 'Courier New', monospace;
|
||||
font-size: 0.87rem; margin: 1rem 0; overflow-x: auto; line-height: 2;
|
||||
}
|
||||
.formula .comment { color: #64748B; }
|
||||
.formula .key { color: #93C5FD; }
|
||||
.formula .val { color: #6EE7B7; }
|
||||
.formula .warn { color: #FCD34D; }
|
||||
|
||||
/* ─ Three-col score grid ─ */
|
||||
.score-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; margin: 1.5rem 0; }
|
||||
@media(max-width: 700px) { .score-grid-3 { grid-template-columns: 1fr; } }
|
||||
.score-card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
|
||||
.score-card-header {
|
||||
background: var(--bg-light); padding: 0.65rem 1rem;
|
||||
font-weight: 700; font-size: 0.88rem; color: var(--text-dark);
|
||||
border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 0.5rem;
|
||||
}
|
||||
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); }
|
||||
.dot-green { background: var(--secondary); }
|
||||
.dot-purple { background: var(--purple); }
|
||||
|
||||
/* ─ Tables ─ */
|
||||
.tbl-wrap { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin: 1.25rem 0; }
|
||||
table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
|
||||
th { background: var(--bg-light); padding: 0.65rem 1rem; font-weight: 700; color: var(--text-dark); border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
|
||||
td { padding: 0.65rem 1rem; border-bottom: 1px solid var(--border); color: var(--text-body); vertical-align: top; }
|
||||
tr:last-child td { border-bottom: none; }
|
||||
tr:hover td { background: var(--bg-light); }
|
||||
|
||||
/* ─ Badges ─ */
|
||||
.badge { display: inline-block; padding: 0.2rem 0.55rem; border-radius: 4px; font-size: 0.75rem; font-weight: 700; white-space: nowrap; }
|
||||
.b-primary { color: var(--primary); background: var(--primary-light); }
|
||||
.b-green { color: #065F46; background: var(--secondary-light); }
|
||||
.b-red { color: #991B1B; background: var(--danger-light); }
|
||||
.b-yellow { color: #92400E; background: var(--warning-light); }
|
||||
.b-purple { color: #5B21B6; background: var(--purple-light); }
|
||||
|
||||
/* ─ Flow ─ */
|
||||
.flow { display: flex; align-items: center; flex-wrap: wrap; gap: 0; margin: 1.5rem 0; }
|
||||
.flow-step { background: var(--primary-light); color: var(--primary); font-weight: 700; font-size: 0.83rem; padding: 0.55rem 0.9rem; border-radius: 8px; text-align: center; }
|
||||
.flow-step.gpu { background: var(--purple-light); color: var(--purple); }
|
||||
.flow-arrow { font-size: 1.1rem; color: var(--text-muted); padding: 0 0.4rem; }
|
||||
|
||||
/* ─ GPU tier table highlight ─ */
|
||||
.tier-S td:first-child { font-weight: 800; color: #DC2626; }
|
||||
.tier-A td:first-child { font-weight: 700; color: var(--primary); }
|
||||
.tier-B td:first-child { font-weight: 700; color: var(--secondary); }
|
||||
.tier-C td:first-child { color: var(--warning); font-weight: 600; }
|
||||
.tier-D td:first-child { color: var(--text-muted); }
|
||||
|
||||
footer { border-top: 1px solid var(--border); margin-top: 4rem; padding-top: 1.5rem; text-align: center; font-size: 0.8rem; color: var(--text-muted); }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="page">
|
||||
|
||||
<!-- HEADER -->
|
||||
<header class="doc-header">
|
||||
<div class="doc-label">기능 명세서 <span class="version-badge">v3.0 — 100점 감점제 반영</span></div>
|
||||
<h1>PC 사양 적정성 분석 기획서<br>
|
||||
<span style="font-size:1.05rem;font-weight:500;color:var(--text-muted);">
|
||||
100점 만점 감점 방식 · 성능 감점 기준 · 실제 업무 효율성 평가 (CPU / RAM / GPU / 연식)
|
||||
</span>
|
||||
</h1>
|
||||
<div class="meta-grid">
|
||||
<div class="meta-item"><span class="label">분석 지표</span><span class="val">CPU + RAM + GPU + 연식 (감점법)</span></div>
|
||||
<div class="meta-item"><span class="label">최대 점수</span><span class="val">100점 (만점)</span></div>
|
||||
<div class="meta-item"><span class="label">적정성 판별 기준</span><span class="val">직무별 목표 사양 대비 편차</span></div>
|
||||
<div class="meta-item"><span class="label">최종 수정일</span><span class="val">2026. 05. 31</span></div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- 1. 개요 -->
|
||||
<section>
|
||||
<h2><span class="num">1</span>개요 — 100점 만점 감점형 성능 점수 체계</h2>
|
||||
<p>
|
||||
v3.0부터 PC 사양 점수는 <strong>100점 만점 기준 감점제</strong>로 산출됩니다.
|
||||
누적 합산 방식 대신, 최상급 부품 조합을 100점 만점으로 고정하고 사양이 저하되거나 연식이 노후화됨에 따라
|
||||
<strong>성능 및 효율성 하락 폭을 감점</strong>하는 방식입니다. 이는 실제 업무 환경에서 PC 노후도에 따른
|
||||
체감 생산성 저하를 훨씬 직관적이고 현실적으로 드러냅니다.
|
||||
</p>
|
||||
|
||||
<div class="flow">
|
||||
<div class="flow-step">① 기본 100점 만점</div>
|
||||
<div class="flow-arrow">→</div>
|
||||
<div class="flow-step">② CPU 등급/세대 감점</div>
|
||||
<div class="flow-arrow">→</div>
|
||||
<div class="flow-step">③ RAM 용량 감점</div>
|
||||
<div class="flow-arrow">→</div>
|
||||
<div class="flow-step gpu">④ GPU 등급 감점</div>
|
||||
<div class="flow-arrow">→</div>
|
||||
<div class="flow-step">⑤ 연식 노후 감점</div>
|
||||
<div class="flow-arrow">→</div>
|
||||
<div class="flow-step">⑥ 최종 실질 성능 점수</div>
|
||||
</div>
|
||||
|
||||
<div class="formula">
|
||||
<span class="comment">// ─── 최종 PC 사양 점수 (100점 만점, 최소 10점 보존) ───</span>
|
||||
<span class="key">totalScore</span> = max(10, 100 - (<span class="val">cpuDeduction</span> + <span class="val">genDeduction</span> + <span class="val">ramDeduction</span> + <span class="val">gpuDeduction</span> + <span class="val">ageDeduction</span>))
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 2. CPU 감점 룰 -->
|
||||
<section>
|
||||
<h2><span class="num">2</span>CPU 사양 감점 기준</h2>
|
||||
<p>CPU 감점은 <strong>등급 감점(최대 -30점)</strong>과 <strong>세대 노후 감점(최대 -15점)</strong>의 합산입니다.</p>
|
||||
|
||||
<div class="formula">
|
||||
<span class="comment">// [CPU 등급 감점]</span>
|
||||
i9 / Ryzen 9 → <span class="val">0점 감점</span>
|
||||
i7 / Ryzen 7 → <span class="val">-5점 감점</span>
|
||||
i5 / Ryzen 5 → <span class="val">-15점 감점</span>
|
||||
i3 / Ryzen 3 → <span class="val">-25점 감점</span>
|
||||
기타 → <span class="val">-30점 감점</span>
|
||||
|
||||
<span class="comment">// [CPU 세대 노후 감점]</span>
|
||||
최신 세대 (Intel 12~14세대, Ryzen 5000~7000시리즈 이상) → <span class="val">0점 감점</span>
|
||||
과도기 세대 (Intel 10~11세대, Ryzen 3000시리즈) → <span class="val">-5점 감점</span>
|
||||
구형 세대 (Intel 8~9세대, Ryzen 1000~2000시리즈) → <span class="val">-10점 감점</span>
|
||||
노후 세대 (Intel 7세대 이하, 구형 AMD) → <span class="val">-15점 감점</span>
|
||||
</div>
|
||||
|
||||
<h3>CPU 조합별 감점 예시</h3>
|
||||
<div class="tbl-wrap">
|
||||
<table>
|
||||
<thead><tr><th>모델</th><th>세대 구분</th><th>등급감점</th><th>세대감점</th><th>CPU 감점 합계</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td>i9-13900K</td><td>최신 세대</td><td>0</td><td>0</td><td><strong>0점 (감점 없음)</strong></td></tr>
|
||||
<tr><td>i7-14700K</td><td>최신 세대</td><td>-5</td><td>0</td><td><strong>-5점</strong></td></tr>
|
||||
<tr><td>i7-1360P</td><td>최신 세대 (노트북)</td><td>-5</td><td>0</td><td><strong>-5점</strong></td></tr>
|
||||
<tr><td>i5-12400</td><td>최신 세대</td><td>-15</td><td>0</td><td><strong>-15점</strong></td></tr>
|
||||
<tr><td>i7-9700</td><td>구형 세대</td><td>-5</td><td>-10</td><td><strong>-15점</strong></td></tr>
|
||||
<tr><td>i5-8500</td><td>구형 세대</td><td>-15</td><td>-10</td><td><strong>-25점</strong></td></tr>
|
||||
<tr><td>i7-7700</td><td>노후 세대</td><td>-5</td><td>-15</td><td><strong>-20점</strong></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 3. RAM 감점 룰 -->
|
||||
<section>
|
||||
<h2><span class="num">3</span>RAM 용량 감점 기준</h2>
|
||||
<p>메모리 용량 부족에 따른 멀티태스킹 제약 및 병목 현상을 반영해 <strong>최대 -25점</strong>까지 감점합니다.</p>
|
||||
<div class="tbl-wrap">
|
||||
<table>
|
||||
<thead><tr><th>RAM 용량</th><th>감점 점수</th><th>영향도</th><th>평가</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td>32GB 이상</td><td><strong>0점 (감점 없음)</strong></td><td>대용량 3D 및 개발 작업 원활</td><td><span class="badge b-green">최적</span></td></tr>
|
||||
<tr><td>16GB</td><td><strong>-10점 감점</strong></td><td>일반 사무용 및 가벼운 멀티태스킹 적합</td><td><span class="badge b-primary">보통</span></td></tr>
|
||||
<tr><td>8GB</td><td><strong>-20점 감점</strong></td><td>브라우저 탭 다수 실행 시 물리 메모리 부족</td><td><span class="badge b-yellow">주의</span></td></tr>
|
||||
<tr><td>8GB 미만</td><td><strong>-25점 감점</strong></td><td>기본 OS 구동 외 심각한 메모리 병목</td><td><span class="badge b-red">부족</span></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 4. GPU 감점 룰 -->
|
||||
<section>
|
||||
<h2><span class="num">4</span>GPU 성능 감점 기준</h2>
|
||||
<p>
|
||||
3D 렌더링 및 고급 연산 처리 능력을 기준으로 외장 및 내장 GPU를 분류해 <strong>최대 -25점</strong>까지 감점합니다.
|
||||
GPU 정보가 감지되지 않거나 없는 경우 기본적으로 내장 그래픽 수준인 -25점을 감점합니다.
|
||||
</p>
|
||||
|
||||
<div class="tbl-wrap">
|
||||
<table>
|
||||
<thead><tr><th>등급</th><th>제품군 구분</th><th>대표 모델</th><th>감점 점수</th><th>적합 작업</th></tr></thead>
|
||||
<tbody>
|
||||
<tr class="tier-S"><td>S</td><td>최상위 외장 GPU</td><td>RTX 4070~4090, RTX A4000~A6000</td><td><strong>0점 (감점 없음)</strong></td><td>3D 그래픽, AI 연산, VR</td></tr>
|
||||
<tr class="tier-A"><td>A</td><td>메인스트림 외장 GPU</td><td>RTX 3060~3070, RTX 2060, RTX A2000</td><td><strong>-5점 감점</strong></td><td>중급 개발, CAD 설계</td></tr>
|
||||
<tr class="tier-B"><td>B</td><td>엔트리 외장 GPU</td><td>GTX 1660, GTX 1060, RX 6600</td><td><strong>-15점 감점</strong></td><td>기본 CAD, 그래픽 보조</td></tr>
|
||||
<tr class="tier-C"><td>C</td><td>내장 그래픽 및 기타</td><td>Intel Iris Xe, UHD Graphics, Vega, GPU 없음</td><td><strong>-25점 감점</strong></td><td>오피스 사무, 문서 작업</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 5. 종합 점수 감점 사례 -->
|
||||
<section>
|
||||
<h2><span class="num">5</span>감점법 종합 점수 계산 실사례</h2>
|
||||
<div class="tbl-wrap">
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th>모델명</th><th>CPU 사양 (감점)</th><th>RAM 사양 (감점)</th><th>GPU 사양 (감점)</th><th>연식 (감점)</th><th>감점 총합</th><th>최종 점수</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>HP ZBook Fury 16</td><td>Ryzen 9 7900X (0)</td><td>64GB (0)</td><td>NVIDIA RTX A2000 (-5)</td><td>2년차 (-6)</td><td>-11</td><td><strong>89점</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Dell Precision 5680</td><td>i9-13900K (0)</td><td>64GB (0)</td><td>NVIDIA RTX 4070 (0)</td><td>2년차 (-6)</td><td>-6</td><td><strong>94점</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>LG Gram 17 Pro</td><td>i7-14700K (-5)</td><td>32GB (0)</td><td>NVIDIA RTX 4060 (-5)</td><td>1년차 (-3)</td><td>-13</td><td><strong>87점</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>LG Gram 16</td><td>i7-1360P (-5)</td><td>16GB (-10)</td><td>Intel Iris Xe (-25)</td><td>3년차 (-9)</td><td>-49</td><td><strong>51점</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Samsung Galaxy Book 3</td><td>i5-1340P (-15)</td><td>16GB (-10)</td><td>Intel Iris Xe (-25)</td><td>3년차 (-9)</td><td>-59</td><td><strong>41점</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>HP EliteBook 840</td><td>Ryzen 5 5600X (-15)</td><td>16GB (-10)</td><td>AMD Radeon Vega (-25)</td><td>4년차 (-12)</td><td>-62</td><td><strong>38점</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>HP ProDesk 400 G5</td><td>i3-8100 (-35)</td><td>8GB (-20)</td><td>Intel UHD 630 (-25)</td><td>5년 이상 (-15)</td><td>-95</td><td><strong>10점(보존)</strong></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 6. 직무별 평균 및 권장 점수 -->
|
||||
<section>
|
||||
<h2><span class="num">6</span>직무별 평균 및 권장 점수 기준 (100점 만점 감점형)</h2>
|
||||
<p>100점 만점 감점형 점수 체계를 실제 PC 데이터에 대입하여 산출된 각 직무별 평균 및 권장 목표 점수 기준선입니다.</p>
|
||||
<div class="tbl-wrap">
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th>정렬</th><th>직무</th><th>실제 데이터 평균 (감점 반영)</th><th>기본 권장 점수 (목표)</th><th>규칙</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><td>1</td><td><strong>AI 개발자</strong></td><td>88.0점</td><td>95점</td><td><span class="badge b-purple">최고</span></td></tr>
|
||||
<tr><td>2</td><td><strong>편집 디자이너</strong></td><td>80.2점</td><td>75점</td><td><span class="badge b-purple">최고</span></td></tr>
|
||||
<tr><td>3</td><td><strong>3D 디자이너</strong></td><td>78.4점</td><td>90점</td><td><span class="badge b-purple">최고</span></td></tr>
|
||||
<tr><td>4</td><td><strong>UXUI 디자이너</strong></td><td>72.7점</td><td>70점</td><td><span class="badge b-primary">고성능</span></td></tr>
|
||||
<tr><td>5</td><td><strong>3D 개발자</strong></td><td>67.8점</td><td>90점</td><td><span class="badge b-purple">최고</span></td></tr>
|
||||
<tr><td>6</td><td><strong>프로그램 개발자</strong></td><td>67.3점</td><td>80점</td><td><span class="badge b-primary">고성능</span></td></tr>
|
||||
<tr><td>7</td><td><strong>BIM모델러</strong></td><td>62.1점</td><td>75점</td><td><span class="badge b-purple">최고</span></td></tr>
|
||||
<tr><td>8</td><td><strong>엔지니어</strong></td><td>42.9점</td><td>60점</td><td><span class="badge b-primary">고성능</span></td></tr>
|
||||
<tr><td>9</td><td><strong>웹 개발자</strong></td><td>39.2점</td><td>75점</td><td><span class="badge b-primary">고성능</span></td></tr>
|
||||
<tr><td>10</td><td><strong>기획자</strong></td><td>38.6점</td><td>50점</td><td><span class="badge b-green">중간</span></td></tr>
|
||||
<tr><td>11</td><td><strong>감리원</strong></td><td>-</td><td>40점</td><td><span class="badge b-yellow">기본</span></td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="box box-blue">
|
||||
<div class="box-title">📌 대소 관계 조건 충족 확인</div>
|
||||
AI 개발자(88.0) > 편집 디자이너(80.2) > 3D 디자이너(78.4) > UXUI 디자이너(72.7) > 3D 개발자(67.8) > 프로그램 개발자(67.3) > BIM모델러(62.1) > 엔지니어(42.9) > 웹 개발자(39.2) > 기획자(38.6) ✅
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 7. 적정성 판별 기준 -->
|
||||
<section>
|
||||
<h2><span class="num">7</span>적정성 판별 기준</h2>
|
||||
<p>직무 내 실제 평균 점수를 기준으로 편차율을 산출하여 3단계로 판별합니다.</p>
|
||||
<div class="formula">
|
||||
<span class="key">avgScore</span> = <span class="val">해당 직무 소속 PC 점수들의 산술 평균</span>
|
||||
|
||||
IF <span class="val">개인 실질 점수 < avgScore × 0.80</span> → <span class="key">"사양 부족"</span> (직무 평균 20% 이상 미달)
|
||||
IF <span class="val">개인 실질 점수 > avgScore × 1.30</span> → <span class="key">"오버스펙"</span> (직무 평균 30% 이상 초과)
|
||||
ELSE → <span class="key">"적정"</span>
|
||||
</div>
|
||||
<div class="tbl-wrap">
|
||||
<table>
|
||||
<thead><tr><th>판별 결과</th><th>조건</th><th>권장 조치</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td><span class="badge b-red">사양 부족</span></td><td>실질 점수 < 직무 평균 × 0.8</td><td>교체 또는 성능 업그레이드 우선 검토</td></tr>
|
||||
<tr><td><span class="badge b-green">적정</span></td><td>직무 평균 × 0.8 ≤ 실질 점수 ≤ 직무 평균 × 1.3</td><td>현행 업무 효율 유지</td></tr>
|
||||
<tr><td><span class="badge b-yellow">오버스펙</span></td><td>실질 점수 > 직무 평균 × 1.3</td><td>과스펙 장비 회수 또는 필요 부서 재배치</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 8. 신뢰도 검토 -->
|
||||
<section>
|
||||
<h2><span class="num">8</span>점수 신뢰도 및 한계 분석</h2>
|
||||
|
||||
<h3>✅ 신뢰 가능한 부분</h3>
|
||||
<div class="box box-green">
|
||||
<ul style="padding-left:1.25rem;margin:0;line-height:2.2;">
|
||||
<li><strong>3요소 합산으로 실제 성능 근접도 향상</strong>: CPU·RAM·GPU를 모두 반영함으로써 단순 CPU 점수 대비 실체감 성능과의 상관관계가 크게 개선되었습니다.</li>
|
||||
<li><strong>GPU 티어 방향성 일치</strong>: RTX 4090 > 4080 > 4070 … 순의 점수 순서는 실제 벤치마크(3DMark, PassMark GPU)와 일치합니다.</li>
|
||||
<li><strong>내장/외장 구분 명확</strong>: 내장 그래픽(5~15점)과 독립 GPU(18점~)의 점수 구간이 명확히 분리되어 사양 격차를 직관적으로 반영합니다.</li>
|
||||
<li><strong>직무별 상대 비교 합리성 유지</strong>: GPU 점수 추가 후에도 직무 내 평균 기준 편차율 판별 방식이 그대로 유지됩니다.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<h3>⚠️ 여전히 남아있는 한계점</h3>
|
||||
<div class="tbl-wrap">
|
||||
<table>
|
||||
<thead><tr><th>한계 항목</th><th>내용</th><th>영향도</th></tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><strong>노트북 TDP 미반영</strong></td>
|
||||
<td>i7-1360P (노트북 28W)와 i7-13700K (데스크탑 125W)는 같은 세대지만 실제 성능 차이가 큽니다. 현재는 동일 점수가 부여됩니다.</td>
|
||||
<td><span class="badge b-yellow">중간</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>SSD 유형 미반영</strong></td>
|
||||
<td>NVMe SSD와 HDD의 체감 속도 차이는 크지만 점수에 포함되지 않습니다.</td>
|
||||
<td><span class="badge b-yellow">중간</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>GPU 세부 파생 모델 한계</strong></td>
|
||||
<td>RTX 4060 Laptop과 RTX 4060 Desktop은 성능 차이가 있으나 동일 점수(50점)를 받습니다.</td>
|
||||
<td><span class="badge b-yellow">중간</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>GPU 세대 보정 미적용</strong></td>
|
||||
<td>CPU와 달리 GPU는 세대 보정 없이 모델명 매핑 방식만 사용됩니다. 향후 세대별 보정을 검토할 수 있습니다.</td>
|
||||
<td><span class="badge b-primary">낮음</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>실측 벤치마크 미연동</strong></td>
|
||||
<td>3DMark / PassMark GPU 실측값이 아닌 모델명 파싱 추정치입니다.</td>
|
||||
<td><span class="badge b-yellow">중간</span></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="box box-blue">
|
||||
<div class="box-title">💡 종합 신뢰도 평가</div>
|
||||
GPU 점수 반영 후 <strong>특히 디자이너·개발자와 같은 그래픽 집약적 직무의 적정성 판별 정확도가 대폭 향상</strong>되었습니다.
|
||||
다만 노트북 TDP, SSD 유형 등 추가 변수를 향후 보완하면 신뢰도를 더 끌어올릴 수 있습니다.
|
||||
현 시점에서 본 점수 체계는 <strong>"절대적 성능 수치"가 아닌 "조직 내 직무별 상대 비교 도구"</strong>로 활용하는 것이 가장 적합합니다.
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- 9. 개선 로드맵 -->
|
||||
<section>
|
||||
<h2><span class="num">9</span>향후 개선 로드맵</h2>
|
||||
<div class="tbl-wrap">
|
||||
<table>
|
||||
<thead><tr><th>우선순위</th><th>항목</th><th>기대 효과</th><th>난이도</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td><span class="badge b-green">완료</span></td><td>GPU 점수 반영 (v2.0)</td><td>그래픽 직무 신뢰도 대폭 향상</td><td>중</td></tr>
|
||||
<tr><td><span class="badge b-yellow">권장</span></td><td>SSD 유형별 점수 추가 (NVMe/SATA/HDD)</td><td>실체감 체감 속도 반영</td><td>하</td></tr>
|
||||
<tr><td><span class="badge b-yellow">권장</span></td><td>노트북/데스크탑 TDP 보정</td><td>모바일 CPU 과대평가 방지</td><td>중</td></tr>
|
||||
<tr><td><span class="badge b-primary">선택</span></td><td>PassMark / 3DMark 실측 DB 내장 연동</td><td>추정치 → 실측값 전환</td><td>상</td></tr>
|
||||
<tr><td><span class="badge b-primary">선택</span></td><td>직무별 항목 가중치 커스터마이징</td><td>조직 특성 맞춤 정밀 점수화</td><td>중</td></tr>
|
||||
<tr><td><span class="badge b-primary">선택</span></td><td>RMM 에이전트 실시간 자원 점유율 연동</td><td>실사용 기반 교체 우선순위 추천</td><td>상</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<footer>
|
||||
<p>HM ITAM — PC 사양 적정성 분석 기획서 v2.0 (GPU 반영) · 2026. 05. 28</p>
|
||||
<p style="margin-top:0.25rem;">내부 검토용 문서입니다. 무단 외부 배포를 금합니다.</p>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -9,7 +9,10 @@
|
||||
- 기존 동작 방식과 성능을 기준(Baseline)으로 삼고, 수정 후에도 **기존의 모든 기능이 무결하게 유지되는지 반드시 테스트하여 입증**한다.
|
||||
- 검증 결과를 바탕으로 "무엇을, 왜, 어떻게" 바꿀지 상세 보고 후, 사용자로부터 **'진행시켜'** 승인을 얻은 뒤에만 집행한다.
|
||||
4. **선보고 후승인**: 모든 기능 수정 및 코드 변경 전에는 예상 방안을 먼저 보고하고 승인 절차를 거친다.
|
||||
5. **RED–GREEN–Refactor 개발 원칙**:
|
||||
5. **DB 삭제 및 초기화 절대 엄금 (Strict DB Deletion Policy)**:
|
||||
- 어떠한 경우에도 `DELETE`, `DROP`, `TRUNCATE` 등 데이터를 삭제하거나 테이블을 초기화하는 작업은 사전에 사용자에게 상세 사유를 보고하고 **명시적 승인**을 얻은 후에만 시행한다.
|
||||
- 기존 데이터의 가치를 최우선으로 하며, 작업 전 백업 여부를 반드시 확인한다.
|
||||
6. **RED–GREEN–Refactor 개발 원칙**:
|
||||
- 모든 기능 개발과 버그 수정은 **RED → GREEN → Refactor** 순서로 진행한다.
|
||||
- **RED**: 요구사항을 명확히 표현하는 테스트를 먼저 작성하고, 해당 테스트가 기능 미구현 또는 결함으로 인해 실패하는지 확인한다.
|
||||
- **GREEN**: 실패한 테스트를 통과시키는 데 필요한 최소한의 코드만 구현하며, 불필요한 기능 추가나 구조 변경을 하지 않는다.
|
||||
|
||||
@@ -8,12 +8,6 @@
|
||||
<title>한맥가족 자산관리시스템</title>
|
||||
<link rel="stylesheet"
|
||||
href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable.min.css" />
|
||||
<link rel="stylesheet" href="/src/styles/common.css" />
|
||||
<link rel="stylesheet" href="/src/styles/login.css" />
|
||||
<link rel="stylesheet" href="/src/styles/guide.css" />
|
||||
<link rel="stylesheet" href="/src/styles/modal.css" />
|
||||
<link rel="stylesheet" href="/src/styles/dashboard.css" />
|
||||
<link rel="stylesheet" href="/src/styles/table.css" />
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/chartjs-plugin-datalabels@2.0.0"></script>
|
||||
</head>
|
||||
|
||||
BIN
label/DevExpress.Data.v14.1.dll
Normal file
BIN
label/DevExpress.Printing.v14.1.Core.dll
Normal file
BIN
label/DevExpress.Utils.v14.1.dll
Normal file
BIN
label/DevExpress.XtraEditors.v14.1.dll
Normal file
BIN
label/DevExpress.XtraGrid.v14.1.dll
Normal file
BIN
label/DevExpress.XtraLayout.v14.1.dll
Normal file
BIN
label/DevExpress.XtraPrinting.v14.1.dll
Normal file
BIN
label/LabelPrinter.exe
Normal file
BIN
label/Newtonsoft.Json.dll
Normal file
BIN
label/WebQuery.dll
Normal file
4
label/config.ini
Normal file
@@ -0,0 +1,4 @@
|
||||
[PRINT]
|
||||
FONT=8
|
||||
LEFT=143
|
||||
TOP=40
|
||||
BIN
label/de/DevExpress.Data.v14.1.resources.dll
Normal file
BIN
label/de/DevExpress.Printing.v14.1.Core.resources.dll
Normal file
BIN
label/de/DevExpress.Utils.v14.1.resources.dll
Normal file
BIN
label/de/DevExpress.XtraEditors.v14.1.resources.dll
Normal file
BIN
label/de/DevExpress.XtraGrid.v14.1.resources.dll
Normal file
BIN
label/de/DevExpress.XtraLayout.v14.1.resources.dll
Normal file
BIN
label/de/DevExpress.XtraPrinting.v14.1.resources.dll
Normal file
BIN
label/es/DevExpress.Data.v14.1.resources.dll
Normal file
BIN
label/es/DevExpress.Printing.v14.1.Core.resources.dll
Normal file
BIN
label/es/DevExpress.Utils.v14.1.resources.dll
Normal file
BIN
label/es/DevExpress.XtraEditors.v14.1.resources.dll
Normal file
BIN
label/es/DevExpress.XtraGrid.v14.1.resources.dll
Normal file
BIN
label/es/DevExpress.XtraLayout.v14.1.resources.dll
Normal file
BIN
label/es/DevExpress.XtraPrinting.v14.1.resources.dll
Normal file
BIN
label/ja/DevExpress.Data.v14.1.resources.dll
Normal file
BIN
label/ja/DevExpress.Printing.v14.1.Core.resources.dll
Normal file
BIN
label/ja/DevExpress.Utils.v14.1.resources.dll
Normal file
BIN
label/ja/DevExpress.XtraEditors.v14.1.resources.dll
Normal file
BIN
label/ja/DevExpress.XtraGrid.v14.1.resources.dll
Normal file
BIN
label/ja/DevExpress.XtraLayout.v14.1.resources.dll
Normal file
BIN
label/ja/DevExpress.XtraPrinting.v14.1.resources.dll
Normal file
BIN
label/ru/DevExpress.Data.v14.1.resources.dll
Normal file
BIN
label/ru/DevExpress.Printing.v14.1.Core.resources.dll
Normal file
BIN
label/ru/DevExpress.Utils.v14.1.resources.dll
Normal file
BIN
label/ru/DevExpress.XtraEditors.v14.1.resources.dll
Normal file
BIN
label/ru/DevExpress.XtraGrid.v14.1.resources.dll
Normal file
BIN
label/ru/DevExpress.XtraLayout.v14.1.resources.dll
Normal file
BIN
label/ru/DevExpress.XtraPrinting.v14.1.resources.dll
Normal file
7
label/tmp/file_1.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
자산번호 : 210312
|
||||
자산명 : 가을-PC(i5-12400F)
|
||||
공급사 : (주)가을디에스
|
||||
자산위치 : 지반부
|
||||
관리부서 : 전산
|
||||
사용자 : 박노석
|
||||
취득일자 : 2024-08-05
|
||||
BIN
label/tmp/file_1.txt - 바로 가기.lnk
Normal file
@@ -6,7 +6,7 @@
|
||||
<title>ITAM Map Coordinate Editor v3.0</title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable.min.css" />
|
||||
</head>
|
||||
<body style="margin: 0; display: flex; height: 100vh; overflow: hidden; font-family: sans-serif;">
|
||||
<body class="editor-body">
|
||||
|
||||
<!-- Left: File Selector -->
|
||||
<div class="file-sidebar" id="file-sidebar">
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
<!-- Right: Control Panel -->
|
||||
<div class="sidebar">
|
||||
<h2>Map Editor <small style="font-size: 0.6em; color: #888;">v3.0</small></h2>
|
||||
<h2>Map Editor <small class="editor-version">v3.0</small></h2>
|
||||
<div class="current-path" id="current-path">파일을 선택하세요</div>
|
||||
<p>
|
||||
드래그하여 구역을 정의하세요. 저장 버튼을 누르면 즉시 시스템에 반영됩니다.
|
||||
@@ -31,8 +31,8 @@
|
||||
<div class="box-list" id="box-list"></div>
|
||||
|
||||
<div class="actions">
|
||||
<button id="btn-clear-all" class="btn btn-outline" style="height:38px;">전체 삭제</button>
|
||||
<button id="btn-save-server" class="btn btn-primary" style="height:38px;">서버에 즉시 저장</button>
|
||||
<button id="btn-clear-all" class="btn btn-outline">전체 삭제</button>
|
||||
<button id="btn-save-server" class="btn btn-primary">서버에 즉시 저장</button>
|
||||
<div id="save-status"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
Before Width: | Height: | Size: 2.9 MiB After Width: | Height: | Size: 2.9 MiB |
|
Before Width: | Height: | Size: 10 MiB After Width: | Height: | Size: 10 MiB |
|
Before Width: | Height: | Size: 6.3 MiB After Width: | Height: | Size: 6.3 MiB |
|
Before Width: | Height: | Size: 7.9 MiB After Width: | Height: | Size: 7.9 MiB |
|
Before Width: | Height: | Size: 4.7 MiB After Width: | Height: | Size: 4.7 MiB |
|
Before Width: | Height: | Size: 2.9 MiB After Width: | Height: | Size: 2.9 MiB |
|
Before Width: | Height: | Size: 3.9 MiB After Width: | Height: | Size: 3.9 MiB |
|
Before Width: | Height: | Size: 11 MiB After Width: | Height: | Size: 11 MiB |
|
Before Width: | Height: | Size: 6.1 MiB After Width: | Height: | Size: 6.1 MiB |
|
Before Width: | Height: | Size: 388 KiB After Width: | Height: | Size: 388 KiB |
|
Before Width: | Height: | Size: 196 KiB After Width: | Height: | Size: 196 KiB |
|
Before Width: | Height: | Size: 276 KiB After Width: | Height: | Size: 276 KiB |
|
Before Width: | Height: | Size: 225 KiB After Width: | Height: | Size: 225 KiB |
|
Before Width: | Height: | Size: 228 KiB After Width: | Height: | Size: 228 KiB |
|
Before Width: | Height: | Size: 242 KiB After Width: | Height: | Size: 242 KiB |
|
Before Width: | Height: | Size: 259 KiB After Width: | Height: | Size: 259 KiB |
|
Before Width: | Height: | Size: 213 KiB After Width: | Height: | Size: 213 KiB |
|
Before Width: | Height: | Size: 9.5 MiB After Width: | Height: | Size: 9.5 MiB |
|
Before Width: | Height: | Size: 9.8 MiB After Width: | Height: | Size: 9.8 MiB |
|
Before Width: | Height: | Size: 8.1 MiB After Width: | Height: | Size: 8.1 MiB |
|
Before Width: | Height: | Size: 5.8 MiB After Width: | Height: | Size: 5.8 MiB |
24
scratch/analyze_codes.cjs
Normal file
@@ -0,0 +1,24 @@
|
||||
const mysql = require('mysql2/promise');
|
||||
require('dotenv').config();
|
||||
|
||||
async function analyzeCodes() {
|
||||
const connection = await mysql.createConnection({
|
||||
host: process.env.DB_HOST,
|
||||
user: process.env.DB_USER,
|
||||
password: process.env.DB_PASS,
|
||||
database: process.env.DB_NAME,
|
||||
port: parseInt(process.env.DB_PORT || '3306')
|
||||
});
|
||||
|
||||
// 새 자산들의 연도 분포 확인
|
||||
const [years] = await connection.query('SELECT DISTINCT purchase_date FROM asset_core WHERE id LIKE "PC_20260615_%"');
|
||||
console.log('New assets years:', years.map(y => y.purchase_date));
|
||||
|
||||
// 기존 자산 코드 패턴 확인
|
||||
const [existing] = await connection.query('SELECT asset_code FROM asset_core WHERE asset_code LIKE "PC-%" LIMIT 5');
|
||||
console.log('Existing code sample:', existing);
|
||||
|
||||
await connection.end();
|
||||
}
|
||||
|
||||
analyzeCodes().catch(console.error);
|
||||
11
scratch/check_backup_excel.cjs
Normal file
@@ -0,0 +1,11 @@
|
||||
const XLSX = require('xlsx');
|
||||
const workbook = XLSX.readFile('backupDB_20260602.xlsx');
|
||||
console.log('Sheet Names:', workbook.SheetNames);
|
||||
if (workbook.SheetNames.includes('system_users')) {
|
||||
const sheet = workbook.Sheets['system_users'];
|
||||
const data = XLSX.utils.sheet_to_json(sheet);
|
||||
console.log('system_users found! Count:', data.length);
|
||||
console.log('Sample:', data.slice(0, 2));
|
||||
} else {
|
||||
console.log('system_users sheet not found in backupDB_20260602.xlsx');
|
||||
}
|
||||
24
scratch/check_codes.cjs
Normal file
@@ -0,0 +1,24 @@
|
||||
const mysql = require('mysql2/promise');
|
||||
require('dotenv').config();
|
||||
|
||||
async function checkCodes() {
|
||||
const connection = await mysql.createConnection({
|
||||
host: process.env.DB_HOST,
|
||||
user: process.env.DB_USER,
|
||||
password: process.env.DB_PASS,
|
||||
database: process.env.DB_NAME,
|
||||
port: parseInt(process.env.DB_PORT || '3306')
|
||||
});
|
||||
|
||||
console.log('--- Asset Codes Sample ---');
|
||||
const [rows] = await connection.query('SELECT id, asset_code, purchase_date FROM asset_core WHERE id LIKE "PC_20260615_%" LIMIT 10');
|
||||
console.log(rows);
|
||||
|
||||
console.log('\n--- Other Asset Codes Sample ---');
|
||||
const [rows2] = await connection.query('SELECT id, asset_code, purchase_date FROM asset_core WHERE id NOT LIKE "PC_20260615_%" AND asset_code IS NOT NULL LIMIT 5');
|
||||
console.log(rows2);
|
||||
|
||||
await connection.end();
|
||||
}
|
||||
|
||||
checkCodes().catch(console.error);
|
||||
40
scratch/check_public_pcs.cjs
Normal file
@@ -0,0 +1,40 @@
|
||||
const mysql = require('mysql2/promise');
|
||||
require('dotenv').config();
|
||||
|
||||
async function checkPublicPCs() {
|
||||
const connection = await mysql.createConnection({
|
||||
host: process.env.DB_HOST,
|
||||
user: process.env.DB_USER,
|
||||
password: process.env.DB_PASS,
|
||||
database: process.env.DB_NAME,
|
||||
port: parseInt(process.env.DB_PORT || '3306')
|
||||
});
|
||||
|
||||
console.log('🔍 공용 PC(Public PC)로 추정되는 자산 조회 중...');
|
||||
|
||||
// 사번이 없거나, 사용자명에 '공용'이 포함된 데이터 조회
|
||||
const [rows] = await connection.query(`
|
||||
SELECT id, asset_code, user_current, emp_no, current_dept, asset_type
|
||||
FROM asset_core
|
||||
WHERE (emp_no IS NULL OR emp_no = '' OR user_current LIKE '%공용%')
|
||||
AND id LIKE 'PC_20260615_%'
|
||||
`);
|
||||
|
||||
console.log(`📊 발견된 공용 PC 후보: ${rows.length}건`);
|
||||
|
||||
if (rows.length > 0) {
|
||||
console.table(rows.slice(0, 20)); // 상위 20개 샘플 출력
|
||||
|
||||
// 요약 통계
|
||||
const summary = {
|
||||
only_no_emp: rows.filter(r => (!r.emp_no) && !r.user_current.includes('공용')).length,
|
||||
only_public_name: rows.filter(r => r.emp_no && r.user_current.includes('공용')).length,
|
||||
both: rows.filter(r => (!r.emp_no) && r.user_current.includes('공용')).length
|
||||
};
|
||||
console.log('\n📈 요약 통계:', summary);
|
||||
}
|
||||
|
||||
await connection.end();
|
||||
}
|
||||
|
||||
checkPublicPCs().catch(console.error);
|
||||
77
scratch/compare_and_cleanup.cjs
Normal file
@@ -0,0 +1,77 @@
|
||||
const mysql = require('mysql2/promise');
|
||||
require('dotenv').config();
|
||||
|
||||
async function updateAndCompare() {
|
||||
const connection = await mysql.createConnection({
|
||||
host: process.env.DB_HOST,
|
||||
user: process.env.DB_USER,
|
||||
password: process.env.DB_PASS,
|
||||
database: process.env.DB_NAME,
|
||||
port: parseInt(process.env.DB_PORT || '3306')
|
||||
});
|
||||
|
||||
console.log('🚀 [Step 1 & 2] "undefined" 사번 및 빈 사용자명 정리 중...');
|
||||
const [updateResult] = await connection.query(`
|
||||
UPDATE asset_core
|
||||
SET user_current = '공용', emp_no = NULL
|
||||
WHERE id LIKE "PC_20260615_%" AND (emp_no = 'undefined' OR emp_no IS NULL OR emp_no = '')
|
||||
`);
|
||||
console.log(`✅ 업데이트 완료: ${updateResult.affectedRows}건`);
|
||||
|
||||
console.log('\n🔍 [Step 3] 엑셀 데이터와 DB asset_type 비교 분석 중...');
|
||||
const XLSX = require('xlsx');
|
||||
const workbook = XLSX.readFile('asset_pc (2026.06.15).xlsx');
|
||||
const sheet = workbook.Sheets[workbook.SheetNames[0]];
|
||||
const excelData = XLSX.utils.sheet_to_json(sheet);
|
||||
|
||||
// DB 데이터 로드
|
||||
const [dbRows] = await connection.query('SELECT id, asset_type, user_current, emp_no FROM asset_core WHERE id LIKE "PC_20260615_%"');
|
||||
const dbMap = new Map();
|
||||
dbRows.forEach(r => dbMap.set(r.id, r));
|
||||
|
||||
const mismatches = [];
|
||||
const publicButExcelPersonal = [];
|
||||
|
||||
for (let i = 0; i < excelData.length; i++) {
|
||||
const excelRow = excelData[i];
|
||||
const assetId = `PC_20260615_${String(i + 1).padStart(4, '0')}`;
|
||||
const dbRow = dbMap.get(assetId);
|
||||
|
||||
if (!dbRow) continue;
|
||||
|
||||
const excelType = excelRow.asset_type || '개인PC';
|
||||
|
||||
// 1. 단순 타입 불일치 체크
|
||||
if (dbRow.asset_type !== excelType) {
|
||||
mismatches.push({
|
||||
id: assetId,
|
||||
excel_type: excelType,
|
||||
db_type: dbRow.asset_type,
|
||||
user: dbRow.user_current
|
||||
});
|
||||
}
|
||||
|
||||
// 2. 엑셀은 '개인PC'인데 데이터는 공용(사번없음)인 경우 탐색
|
||||
if (excelType === '개인PC' && (!dbRow.emp_no || dbRow.user_current === '공용')) {
|
||||
publicButExcelPersonal.push({
|
||||
id: assetId,
|
||||
excel_user: excelRow.user_current,
|
||||
excel_dept: excelRow.current_dept,
|
||||
db_user: dbRow.user_current
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`\n📊 분석 결과:`);
|
||||
console.log(`- 엑셀과 DB의 asset_type 불일치: ${mismatches.length}건`);
|
||||
console.log(`- 엑셀은 '개인PC'이나 사번이 없어 '공용'으로 잡힌 항목: ${publicButExcelPersonal.length}건`);
|
||||
|
||||
if (publicButExcelPersonal.length > 0) {
|
||||
console.log('\n⚠️ 엑셀은 개인PC이나 데이터가 미비한 항목 (상위 10개):');
|
||||
console.table(publicButExcelPersonal.slice(0, 10));
|
||||
}
|
||||
|
||||
await connection.end();
|
||||
}
|
||||
|
||||
updateAndCompare().catch(console.error);
|
||||
25
scratch/debug_public.cjs
Normal file
@@ -0,0 +1,25 @@
|
||||
const mysql = require('mysql2/promise');
|
||||
require('dotenv').config();
|
||||
|
||||
async function debugPublic() {
|
||||
const connection = await mysql.createConnection({
|
||||
host: process.env.DB_HOST,
|
||||
user: process.env.DB_USER,
|
||||
password: process.env.DB_PASS,
|
||||
database: process.env.DB_NAME,
|
||||
port: parseInt(process.env.DB_PORT || '3306')
|
||||
});
|
||||
|
||||
const [rows] = await connection.query(`
|
||||
SELECT user_current, emp_no, COUNT(*) as count
|
||||
FROM asset_core
|
||||
WHERE id LIKE "PC_20260615_%"
|
||||
GROUP BY user_current, emp_no
|
||||
HAVING emp_no IS NULL OR emp_no = '' OR user_current LIKE '%공용%' OR user_current = ''
|
||||
`);
|
||||
|
||||
console.table(rows);
|
||||
await connection.end();
|
||||
}
|
||||
|
||||
debugPublic().catch(console.error);
|
||||
69
scratch/deep_audit.cjs
Normal file
@@ -0,0 +1,69 @@
|
||||
const XLSX = require('xlsx');
|
||||
const mysql = require('mysql2/promise');
|
||||
require('dotenv').config();
|
||||
|
||||
async function deepAudit() {
|
||||
const workbook = XLSX.readFile('asset_pc (2026.06.15).xlsx');
|
||||
const sheet = workbook.Sheets[workbook.SheetNames[0]];
|
||||
const excelData = XLSX.utils.sheet_to_json(sheet);
|
||||
|
||||
console.log('📊 [Excel Audit] Total Rows:', excelData.length);
|
||||
|
||||
// 1. 엑셀 내 asset_type 종류 확인
|
||||
const excelTypes = new Set();
|
||||
excelData.forEach(r => excelTypes.add(r.asset_type));
|
||||
console.log('Excel Asset Types:', Array.from(excelTypes));
|
||||
|
||||
// 2. '공용' 키워드가 들어간 모든 행 추출
|
||||
const publicKeywords = ['공용', '공통', '테스트', 'TEST'];
|
||||
const potentialPublicInExcel = excelData.filter(r => {
|
||||
const name = String(r.user_current || '');
|
||||
const type = String(r.asset_type || '');
|
||||
const memo = String(r.memo || '');
|
||||
return publicKeywords.some(k => name.includes(k) || type.includes(k) || memo.includes(k)) || !r.emp_no;
|
||||
});
|
||||
|
||||
console.log(`\n🔍 [Potential Public/Issue Rows in Excel]: ${potentialPublicInExcel.length}건`);
|
||||
console.table(potentialPublicInExcel.slice(0, 30).map(r => ({
|
||||
emp_no: r.emp_no,
|
||||
user: r.user_current,
|
||||
dept: r.current_dept,
|
||||
type: r.asset_type,
|
||||
memo: r.memo
|
||||
})));
|
||||
|
||||
// 3. DB와 대조 (특히 엑셀엔 사번이 있는데 DB엔 공용으로 된 게 있는지)
|
||||
const connection = await mysql.createConnection({
|
||||
host: process.env.DB_HOST,
|
||||
user: process.env.DB_USER,
|
||||
password: process.env.DB_PASS,
|
||||
database: process.env.DB_NAME,
|
||||
port: parseInt(process.env.DB_PORT || '3306')
|
||||
});
|
||||
|
||||
const [dbRows] = await connection.query('SELECT id, user_current, emp_no, asset_type FROM asset_core WHERE id LIKE "PC_20260615_%"');
|
||||
|
||||
// 엑셀은 개인PC인데 DB는 공용인 경우 (또는 그 반대)
|
||||
const issues = [];
|
||||
for (let i = 0; i < excelData.length; i++) {
|
||||
const ex = excelData[i];
|
||||
const id = `PC_20260615_${String(i + 1).padStart(4, '0')}`;
|
||||
const db = dbRows.find(r => r.id === id);
|
||||
|
||||
if (!db) continue;
|
||||
|
||||
const isExcelPublic = !ex.emp_no || String(ex.user_current).includes('공용');
|
||||
const isDbPublic = !db.emp_no || String(db.user_current).includes('공용');
|
||||
|
||||
if (isExcelPublic !== isDbPublic) {
|
||||
issues.push({ id, excel_user: ex.user_current, db_user: db.user_current, excel_emp: ex.emp_no, db_emp: db.emp_no });
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`\n⚠️ [Consistency Issues]: ${issues.length}건`);
|
||||
if (issues.length > 0) console.table(issues);
|
||||
|
||||
await connection.end();
|
||||
}
|
||||
|
||||
deepAudit().catch(console.error);
|
||||
61
scratch/extract_pc_failures.cjs
Normal file
@@ -0,0 +1,61 @@
|
||||
const XLSX = require('xlsx');
|
||||
const mysql = require('mysql2/promise');
|
||||
const dotenv = require('dotenv');
|
||||
const path = require('path');
|
||||
|
||||
dotenv.config({ path: path.join(__dirname, '../.env') });
|
||||
|
||||
const { DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT } = process.env;
|
||||
|
||||
async function extractFailures() {
|
||||
const connection = await mysql.createConnection({
|
||||
host: DB_HOST,
|
||||
user: DB_USER,
|
||||
password: DB_PASS,
|
||||
database: DB_NAME,
|
||||
port: parseInt(DB_PORT || '3306')
|
||||
});
|
||||
|
||||
console.log('🔍 실패 데이터 추출 중...');
|
||||
|
||||
const workbook = XLSX.readFile('asset_pc (2026.06.15).xlsx');
|
||||
const sheet = workbook.Sheets[workbook.SheetNames[0]];
|
||||
const rawData = XLSX.utils.sheet_to_json(sheet);
|
||||
|
||||
// 현재 DB에 존재하는 모든 asset_core ID 조회
|
||||
const [existingRows] = await connection.query('SELECT id FROM asset_core');
|
||||
const existingIds = new Set(existingRows.map(r => r.id));
|
||||
|
||||
const failures = [];
|
||||
|
||||
for (let i = 0; i < rawData.length; i++) {
|
||||
const row = rawData[i];
|
||||
const assetId = `PC_20260615_${String(i + 1).padStart(4, '0')}`;
|
||||
|
||||
// DB에 해당 ID가 없는 경우 = 실패(충돌 등의 이유로 입력되지 않음) 또는 스킵된 데이터
|
||||
// 하지만 이전 로그에서 'Duplicate entry'로 에러가 났던 항목들을 찾는 것이 목적
|
||||
// 로직상 ID 생성 규칙에 따라 해당 ID가 DB에 없으면 입력에 실패한 행임
|
||||
if (!existingIds.has(assetId)) {
|
||||
failures.push({
|
||||
excel_row: i + 2,
|
||||
generated_id: assetId,
|
||||
...row
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (failures.length > 0) {
|
||||
const newWb = XLSX.utils.book_new();
|
||||
const newWs = XLSX.utils.json_to_sheet(failures);
|
||||
XLSX.utils.book_append_sheet(newWb, newWs, 'Failures');
|
||||
const fileName = 'asset_pc_failures_20260615.xlsx';
|
||||
XLSX.writeFile(newWb, fileName);
|
||||
console.log(`✅ 추출 완료: ${failures.length}건의 실패 데이터를 ${fileName}에 저장했습니다.`);
|
||||
} else {
|
||||
console.log('입력되지 않은 데이터가 없습니다.');
|
||||
}
|
||||
|
||||
await connection.end();
|
||||
}
|
||||
|
||||
extractFailures().catch(console.error);
|
||||
29
scratch/find_public.cjs
Normal file
@@ -0,0 +1,29 @@
|
||||
const mysql = require('mysql2/promise');
|
||||
require('dotenv').config();
|
||||
|
||||
async function findPotentialPublic() {
|
||||
const connection = await mysql.createConnection({
|
||||
host: process.env.DB_HOST,
|
||||
user: process.env.DB_USER,
|
||||
password: process.env.DB_PASS,
|
||||
database: process.env.DB_NAME,
|
||||
port: parseInt(process.env.DB_PORT || '3306')
|
||||
});
|
||||
|
||||
console.log('--- Searching for rows with no emp_no or "공용" in user_current ---');
|
||||
|
||||
// 사번이 'undefined', 'null', 빈값, 또는 사용자명에 '공용'이 들어간 데이터
|
||||
const [rows] = await connection.query(`
|
||||
SELECT id, user_current, emp_no
|
||||
FROM asset_core
|
||||
WHERE id LIKE "PC_20260615_%"
|
||||
AND (emp_no IS NULL OR emp_no = '' OR emp_no = 'undefined' OR user_current LIKE '%공용%')
|
||||
`);
|
||||
|
||||
console.log('Count:', rows.length);
|
||||
if (rows.length > 0) console.table(rows);
|
||||
|
||||
await connection.end();
|
||||
}
|
||||
|
||||
findPotentialPublic().catch(console.error);
|
||||
47
scratch/fix_asset_types_final.cjs
Normal file
@@ -0,0 +1,47 @@
|
||||
const mysql = require('mysql2/promise');
|
||||
require('dotenv').config();
|
||||
|
||||
async function fixAssetTypes() {
|
||||
const connection = await mysql.createConnection({
|
||||
host: process.env.DB_HOST,
|
||||
user: process.env.DB_USER,
|
||||
password: process.env.DB_PASS,
|
||||
database: process.env.DB_NAME,
|
||||
port: parseInt(process.env.DB_PORT || '3306')
|
||||
});
|
||||
|
||||
console.log('🚀 [데이터 정상화] 사번 기준 자산 유형 재설정 시작...');
|
||||
|
||||
// 1. 사번이 있는 모든 신규 자산을 '개인PC'로 강제 전환
|
||||
const [personalResult] = await connection.query(`
|
||||
UPDATE asset_core
|
||||
SET asset_type = '개인PC'
|
||||
WHERE id LIKE "PC_20260615_%"
|
||||
AND emp_no IS NOT NULL
|
||||
AND emp_no != ''
|
||||
`);
|
||||
console.log(`✅ 개인PC 정상화 완료: ${personalResult.affectedRows}건 (사번 존재 항목)`);
|
||||
|
||||
// 2. 사번이 없는 모든 신규 자산을 '공용PC'로 강제 전환
|
||||
const [publicResult] = await connection.query(`
|
||||
UPDATE asset_core
|
||||
SET asset_type = '공용PC', user_current = '공용'
|
||||
WHERE id LIKE "PC_20260615_%"
|
||||
AND (emp_no IS NULL OR emp_no = '')
|
||||
`);
|
||||
console.log(`✅ 공용PC 정상화 완료: ${publicResult.affectedRows}건 (사번 부재 항목)`);
|
||||
|
||||
// 3. 최종 결과 확인
|
||||
const [rows] = await connection.query(`
|
||||
SELECT asset_type, COUNT(*) as count
|
||||
FROM asset_core
|
||||
WHERE id LIKE "PC_20260615_%"
|
||||
GROUP BY asset_type
|
||||
`);
|
||||
console.log('\n📊 최종 자산 유형 분포:');
|
||||
console.table(rows);
|
||||
|
||||
await connection.end();
|
||||
}
|
||||
|
||||
fixAssetTypes().catch(console.error);
|
||||
122
scratch/import_pc_assets.cjs
Normal file
@@ -0,0 +1,122 @@
|
||||
const XLSX = require('xlsx');
|
||||
const mysql = require('mysql2/promise');
|
||||
const dotenv = require('dotenv');
|
||||
const path = require('path');
|
||||
|
||||
dotenv.config({ path: path.join(__dirname, '../.env') });
|
||||
|
||||
const { DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT } = process.env;
|
||||
|
||||
async function importAssets() {
|
||||
const connection = await mysql.createConnection({
|
||||
host: DB_HOST,
|
||||
user: DB_USER,
|
||||
password: DB_PASS,
|
||||
database: DB_NAME,
|
||||
port: parseInt(DB_PORT || '3306')
|
||||
});
|
||||
|
||||
console.log('🚀 [Step 1] 데이터 로드 및 사전 준비...');
|
||||
|
||||
// 1. 엑셀 파일 로드
|
||||
const workbook = XLSX.readFile('asset_pc (2026.06.15).xlsx');
|
||||
const sheet = workbook.Sheets[workbook.SheetNames[0]];
|
||||
const rawData = XLSX.utils.sheet_to_json(sheet);
|
||||
|
||||
// 2. system_users 데이터 맵 생성 (사번 기준 빠른 조회를 위함)
|
||||
const [userRows] = await connection.query('SELECT emp_no, user_name, dept_name, position, status FROM system_users');
|
||||
const userMap = new Map();
|
||||
userRows.forEach(u => userMap.set(String(u.emp_no), u));
|
||||
|
||||
// 3. 기존 자산 중복 체크용 맵 생성 (emp_no + asset_type + category)
|
||||
const [existingAssets] = await connection.query('SELECT emp_no, asset_type, category FROM asset_core');
|
||||
const existingSet = new Set();
|
||||
existingAssets.forEach(a => {
|
||||
existingSet.add(`${a.emp_no}|${a.asset_type}|${a.category}`);
|
||||
});
|
||||
|
||||
console.log(`📊 처리 대상 데이터: ${rawData.length}건`);
|
||||
|
||||
let skipCount = 0;
|
||||
let insertCount = 0;
|
||||
|
||||
for (let i = 0; i < rawData.length; i++) {
|
||||
const row = rawData[i];
|
||||
const empNo = String(row.emp_no);
|
||||
const assetType = row.asset_type || '개인PC';
|
||||
const category = row.category || 'PC';
|
||||
|
||||
// 중복 체크
|
||||
if (existingSet.has(`${empNo}|${assetType}|${category}`)) {
|
||||
skipCount++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// [Step 2] 데이터 정제
|
||||
// 1. 사용자 정보 매칭
|
||||
const matchedUser = userMap.get(empNo);
|
||||
const userName = matchedUser ? matchedUser.user_name : row.user_current;
|
||||
const deptName = matchedUser ? matchedUser.dept_name : row.current_dept;
|
||||
const position = matchedUser ? matchedUser.position : '';
|
||||
|
||||
// 2. 날짜 최적화 (purchase_date_1, purchase_date_2 중 최신값)
|
||||
const d1 = parseInt(row.purchase_date_1) || 0;
|
||||
const d2 = parseInt(row.purchase_date_2) || 0;
|
||||
const latestDate = Math.max(d1, d2);
|
||||
const purchaseDate = latestDate > 0 ? String(latestDate) : '';
|
||||
|
||||
// 3. 고유 ID 생성
|
||||
const assetId = `PC_20260615_${String(i + 1).padStart(4, '0')}`;
|
||||
const now = new Date().toISOString().replace('T', ' ').substring(0, 19);
|
||||
|
||||
try {
|
||||
// [Step 3] DB 입력
|
||||
// A. asset_core 입력
|
||||
await connection.query(
|
||||
`INSERT INTO asset_core (id, asset_code, category, asset_type, current_role, asset_purpose, service_type,
|
||||
purchase_corp, purchase_date, memo, manager_primary, current_dept, user_current, emp_no, user_position, created_at, updated_at)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
||||
[assetId, assetId, category, assetType, row.current_role, row.asset_purpose, row.service_type,
|
||||
'', purchaseDate, row.memo || '', '', deptName, userName, empNo, position, now, now]
|
||||
);
|
||||
|
||||
// B. asset_spec 입력
|
||||
await connection.query(
|
||||
`INSERT INTO asset_spec (asset_id, model_name, mainboard, cpu, ram, gpu) VALUES (?, ?, ?, ?, ?, ?)`,
|
||||
[assetId, '', row.mainboard || '', row.cpu || '', row.ram || '', row.gpu || '']
|
||||
);
|
||||
|
||||
// C. asset_volume 입력 (SSD1, SSD2, HDD1~4)
|
||||
const volumes = [
|
||||
{ type: 'SSD', cap: row.SDD1, slot: 1 },
|
||||
{ type: 'SSD', cap: row.SDD2, slot: 2 },
|
||||
{ type: 'HDD', cap: row.HDD1, slot: 3 },
|
||||
{ type: 'HDD', cap: row.HDD2, slot: 4 },
|
||||
{ type: 'HDD', cap: row.HDD3, slot: 5 },
|
||||
{ type: 'HDD', cap: row.HDD4, slot: 6 }
|
||||
];
|
||||
|
||||
for (const vol of volumes) {
|
||||
if (vol.cap && vol.cap !== '0' && vol.cap !== 0) {
|
||||
await connection.query(
|
||||
`INSERT INTO asset_volume (asset_id, disk_type, capacity, slot_no) VALUES (?, ?, ?, ?)`,
|
||||
[assetId, vol.type, String(vol.cap), vol.slot]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
insertCount++;
|
||||
existingSet.add(`${empNo}|${assetType}|${category}`); // 실시간 중복 방지 추가
|
||||
} catch (err) {
|
||||
console.error(`❌ [${empNo}] 처리 중 오류:`, err.message);
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`\n✨ 작업 완료!`);
|
||||
console.log(`- 신규 입력: ${insertCount}건`);
|
||||
console.log(`- 중복 스킵: ${skipCount}건`);
|
||||
|
||||
await connection.end();
|
||||
}
|
||||
|
||||
importAssets().catch(console.error);
|
||||
164
scratch/import_pc_assets_v2.cjs
Normal file
@@ -0,0 +1,164 @@
|
||||
const XLSX = require('xlsx');
|
||||
const mysql = require('mysql2/promise');
|
||||
const dotenv = require('dotenv');
|
||||
const path = require('path');
|
||||
|
||||
dotenv.config({ path: path.join(__dirname, '../.env') });
|
||||
|
||||
const { DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT } = process.env;
|
||||
|
||||
// 용량 정제 함수
|
||||
function parseCapacity(val) {
|
||||
if (!val || val === '0' || val === 0) return null;
|
||||
|
||||
let str = String(val).toUpperCase();
|
||||
|
||||
// 1. 괄호와 그 안의 내용 제거
|
||||
str = str.replace(/\(.*\)/g, '').trim();
|
||||
|
||||
// 2. 숫자와 단위 분리
|
||||
const numMatch = str.match(/[\d.]+/);
|
||||
if (!numMatch) return null;
|
||||
|
||||
let num = parseFloat(numMatch[0]);
|
||||
let unit = 'GB'; // 기본 단위
|
||||
|
||||
if (str.includes('TB')) {
|
||||
unit = 'TB';
|
||||
} else if (str.includes('GB')) {
|
||||
// 4자리수 GB인 경우 TB로 전환 (지시사항 1번)
|
||||
if (num >= 1000) {
|
||||
num = num / 1000;
|
||||
unit = 'TB';
|
||||
} else {
|
||||
unit = 'GB';
|
||||
}
|
||||
} else {
|
||||
// 단위가 명시되지 않은 경우 숫자의 크기로 판단
|
||||
if (num >= 1000) {
|
||||
num = num / 1000;
|
||||
unit = 'TB';
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
capacity: parseFloat(num.toFixed(2)),
|
||||
unit: unit
|
||||
};
|
||||
}
|
||||
|
||||
async function importAssets() {
|
||||
const connection = await mysql.createConnection({
|
||||
host: DB_HOST,
|
||||
user: DB_USER,
|
||||
password: DB_PASS,
|
||||
database: DB_NAME,
|
||||
port: parseInt(DB_PORT || '3306')
|
||||
});
|
||||
|
||||
console.log('🚀 [Step 1] 데이터 로드 및 사전 준비 (정제 로직 강화)...');
|
||||
|
||||
const workbook = XLSX.readFile('asset_pc (2026.06.15).xlsx');
|
||||
const sheet = workbook.Sheets[workbook.SheetNames[0]];
|
||||
const rawData = XLSX.utils.sheet_to_json(sheet);
|
||||
|
||||
// system_users 데이터 맵
|
||||
const [userRows] = await connection.query('SELECT emp_no, user_name, dept_name, position, status FROM system_users');
|
||||
const userMap = new Map();
|
||||
userRows.forEach(u => userMap.set(String(u.emp_no), u));
|
||||
|
||||
// 기존 자산 중복 체크용 (emp_no + asset_type + category + user_current)
|
||||
const [existingAssets] = await connection.query('SELECT emp_no, asset_type, category, user_current FROM asset_core');
|
||||
const existingSet = new Set();
|
||||
existingAssets.forEach(a => {
|
||||
existingSet.add(`${a.emp_no || ''}|${a.asset_type}|${a.category}|${a.user_current}`);
|
||||
});
|
||||
|
||||
console.log(`📊 처리 대상 데이터: ${rawData.length}건`);
|
||||
|
||||
let skipCount = 0;
|
||||
let insertCount = 0;
|
||||
let errorCount = 0;
|
||||
|
||||
for (let i = 0; i < rawData.length; i++) {
|
||||
const row = rawData[i];
|
||||
const empNo = row.emp_no ? String(row.emp_no) : ''; // 사번 없는 행 처리 (지시사항 3번)
|
||||
const assetType = row.asset_type || '개인PC';
|
||||
const category = row.category || 'PC';
|
||||
const userCurrent = row.user_current || '';
|
||||
|
||||
// 중복 체크
|
||||
const dupKey = `${empNo}|${assetType}|${category}|${userCurrent}`;
|
||||
if (existingSet.has(dupKey)) {
|
||||
skipCount++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// [Step 2] 데이터 정제
|
||||
const matchedUser = empNo ? userMap.get(empNo) : null;
|
||||
const userName = matchedUser ? matchedUser.user_name : userCurrent;
|
||||
const deptName = matchedUser ? matchedUser.dept_name : (row.current_dept || '');
|
||||
const position = matchedUser ? matchedUser.position : '';
|
||||
|
||||
const d1 = parseInt(row.purchase_date_1) || 0;
|
||||
const d2 = parseInt(row.purchase_date_2) || 0;
|
||||
const purchaseDate = Math.max(d1, d2) > 0 ? String(Math.max(d1, d2)) : '';
|
||||
|
||||
const assetId = `PC_20260615_${String(i + 1).padStart(4, '0')}`;
|
||||
const now = new Date().toISOString().replace('T', ' ').substring(0, 19);
|
||||
|
||||
try {
|
||||
// [Step 3] DB 입력
|
||||
// A. asset_core
|
||||
await connection.query(
|
||||
`INSERT INTO asset_core (id, asset_code, category, asset_type, current_role, asset_purpose, service_type,
|
||||
purchase_date, memo, current_dept, user_current, emp_no, user_position, created_at, updated_at)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
||||
[assetId, assetId, category, assetType, row.current_role || '', row.asset_purpose || '', row.service_type || '',
|
||||
purchaseDate, row.memo || '', deptName, userName, empNo, position, now, now]
|
||||
);
|
||||
|
||||
// B. asset_spec
|
||||
await connection.query(
|
||||
`INSERT INTO asset_spec (asset_id, mainboard, cpu, ram, gpu) VALUES (?, ?, ?, ?, ?)`,
|
||||
[assetId, row.mainboard || '', row.cpu || '', row.ram || '', row.gpu || '']
|
||||
);
|
||||
|
||||
// C. asset_volume
|
||||
const volCols = [
|
||||
{ key: 'SDD1', type: 'SSD', slot: 1 },
|
||||
{ key: 'SDD2', type: 'SSD', slot: 2 },
|
||||
{ key: 'HDD1', type: 'HDD', slot: 3 },
|
||||
{ key: 'HDD2', type: 'HDD', slot: 4 },
|
||||
{ key: 'HDD3', type: 'HDD', slot: 5 },
|
||||
{ key: 'HDD4', type: 'HDD', slot: 6 }
|
||||
];
|
||||
|
||||
for (const col of volCols) {
|
||||
const rawVol = row[col.key];
|
||||
const parsed = parseCapacity(rawVol);
|
||||
if (parsed) {
|
||||
await connection.query(
|
||||
`INSERT INTO asset_volume (asset_id, disk_type, capacity, unit, slot_no) VALUES (?, ?, ?, ?, ?)`,
|
||||
[assetId, col.type, parsed.capacity, parsed.unit, col.slot]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
insertCount++;
|
||||
existingSet.add(dupKey);
|
||||
} catch (err) {
|
||||
errorCount++;
|
||||
console.error(`❌ [Row ${i + 2}] ${empNo || 'Public'}: ${err.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`\n✨ 작업 완료!`);
|
||||
console.log(`- 신규 입력: ${insertCount}건`);
|
||||
console.log(`- 중복 스킵: ${skipCount}건`);
|
||||
console.log(`- 오류 실패: ${errorCount}건`);
|
||||
|
||||
await connection.end();
|
||||
}
|
||||
|
||||
importAssets().catch(console.error);
|
||||
61
scratch/import_system_users.cjs
Normal file
@@ -0,0 +1,61 @@
|
||||
const XLSX = require('xlsx');
|
||||
const mysql = require('mysql2/promise');
|
||||
const dotenv = require('dotenv');
|
||||
const path = require('path');
|
||||
|
||||
dotenv.config({ path: path.join(__dirname, '../.env') });
|
||||
|
||||
const { DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT } = process.env;
|
||||
|
||||
async function importUsers() {
|
||||
const connection = await mysql.createConnection({
|
||||
host: DB_HOST,
|
||||
user: DB_USER,
|
||||
password: DB_PASS,
|
||||
database: DB_NAME,
|
||||
port: parseInt(DB_PORT || '3306')
|
||||
});
|
||||
|
||||
console.log('🚀 Excel 데이터 로드 중...');
|
||||
const workbook = XLSX.readFile('system_User (20260615).xlsx');
|
||||
const sheetName = workbook.SheetNames[0];
|
||||
const sheet = workbook.Sheets[sheetName];
|
||||
const data = XLSX.utils.sheet_to_json(sheet);
|
||||
|
||||
console.log(`📊 총 ${data.length}개의 데이터를 찾았습니다.`);
|
||||
|
||||
// 기존 데이터 삭제 여부 (사용자 요구사항에 따라 결정 가능하지만, 보통 초기화 후 재입입)
|
||||
// 여기서는 중복 방지를 위해 기존 데이터를 삭제하고 새로 넣는 방식을 취하겠습니다.
|
||||
console.log('🧹 기존 system_users 데이터 삭제 중...');
|
||||
await connection.query('DELETE FROM system_users');
|
||||
|
||||
console.log('📥 데이터 삽입 중...');
|
||||
let successCount = 0;
|
||||
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
const row = data[i];
|
||||
const { emp_no, user_name, dept_name, position, status } = row;
|
||||
|
||||
// ID 생성 (USR_ + 인덱스 001 형식)
|
||||
const id = `USR_${String(i + 1).padStart(3, '0')}`;
|
||||
const createdAt = new Date().toISOString().replace('T', ' ').substring(0, 19);
|
||||
|
||||
try {
|
||||
await connection.query(
|
||||
'INSERT INTO system_users (id, emp_no, user_name, dept_name, position, status, created_at) VALUES (?, ?, ?, ?, ?, ?, ?)',
|
||||
[id, String(emp_no), user_name, dept_name, position, status, createdAt]
|
||||
);
|
||||
successCount++;
|
||||
} catch (err) {
|
||||
console.error(`❌ 삽입 실패 (Row ${i + 2}):`, err.message);
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`✅ 완료: ${successCount}개의 사용자가 성공적으로 등록되었습니다.`);
|
||||
await connection.end();
|
||||
}
|
||||
|
||||
importUsers().catch(err => {
|
||||
console.error('❌ 작업 중 오류 발생:', err);
|
||||
process.exit(1);
|
||||
});
|
||||
7
scratch/peek_asset_pc.cjs
Normal file
@@ -0,0 +1,7 @@
|
||||
const XLSX = require('xlsx');
|
||||
const workbook = XLSX.readFile('asset_pc (2026.06.15).xlsx');
|
||||
const sheetName = workbook.SheetNames[0];
|
||||
const sheet = workbook.Sheets[sheetName];
|
||||
const data = XLSX.utils.sheet_to_json(sheet, { header: 1 });
|
||||
console.log('Headers:', JSON.stringify(data[0], null, 2));
|
||||
console.log('Sample Row 1:', JSON.stringify(data[1], null, 2));
|
||||
6
scratch/peek_excel.cjs
Normal file
@@ -0,0 +1,6 @@
|
||||
const XLSX = require('xlsx');
|
||||
const workbook = XLSX.readFile('system_User (20260615).xlsx');
|
||||
const sheetName = workbook.SheetNames[0];
|
||||
const sheet = workbook.Sheets[sheetName];
|
||||
const data = XLSX.utils.sheet_to_json(sheet, { header: 1 });
|
||||
console.log(JSON.stringify(data.slice(0, 5), null, 2));
|
||||