Files
ExperionCrawler/plans/추출결과PANE-컬럼추가-작업.md

167 lines
7.0 KiB
Markdown

웹 UI P&ID 추출 pane에 sub_area, from_at, to_at 컬럼 추가 해줘,
태그번호(40%축소가능), 장비명(30%축소가능), 유형(60%축소가능)
태그번호,장비명,유형,카테고리,ROLE,FROM,FROM_at,TO,TO_at, SUB_AREA, 나머지 동일 순으로 표시
+ Thought: 797ms
│ Explore Task — Find PID pane files
└ 25 toolcalls · 24.9s
ctrl+x down view subagents
▣ Build · Big Pickle · interrupted
추출 결과 PANE 말하는 거임
+ Thought: 611ms
✱ Glob "wwwroot/panes/*pid*"
✱ Glob "wwwroot/panes/*.html"
✱ Glob "wwwroot/js/*pid*"
+ Thought: 431ms
→ Read src/Web/wwwroot
+ Thought: 384ms
→ Read src/Web/wwwroot/panes
✱ Glob "wwwroot/js/*.js"
✱ Glob "wwwroot/**/pid*"
+ Thought: 346ms
→ Read src/Web/wwwroot/js
→ Read src/Web/wwwroot/panes/pid.html
+ Thought: 1.7s
→ Read src/Web/wwwroot/js/pid.js
+ Thought: 662ms
✱ Grep "sub_area|subArea|from_at|fromAt|to_at|toAt" in src
✱ Grep "class.*PidEquipment|pid_equipment" in src (39 matches)
+ Thought: 393ms
→ Read src/Core/Domain/Entities/PidEquipment.cs
→ Read src/Core/Application/DTOs/PidResponse.cs
→ Read src/Web/Controllers/PidController.cs
+ Thought: 7.6s
✱ Grep "sub_area|from_at|to_at|FromAt|ToAt" in src (51 matches)
+ Thought: 3.6s
✱ Grep "GetEquipmentAsync" in src (1 match)
→ Read src/Core/Application/Services/PidExtractorService.cs [offset=387, limit=100]
+ Thought: 9.7s
✱ Grep "tag_metadata|TagMetadata|Set<" in src (44 matches)
+ Thought: 6.2s
✱ Grep "class UpdateEquipmentRequest|UpdateEquipmentRequest|FromAt|ToAt" in src (5 matches)
✱ Grep "class UpdateEquipmentRequest" in src
+ Thought: 515ms
✱ Grep "UpdateEquipmentRequest|CreateEquipmentRequest" in src (8 matches)
→ Read src/Core/Application/DTOs/PidEquipmentDto.cs
+ Thought: 8.8s
Now I have the full picture. The entity already has FromAt/ToAt fields — just need to expose them in the API and UI. For SubArea, it lives in tag_metadata so I'll add a [NotMapped] property and batch-join it. Let me make all the changes.
# Todos
[•] Add [NotMapped] SubArea to PidEquipment entity
[ ] Add FromAt/ToAt to Create/Update DTOs
[ ] Update PidExtractorService: GetEquipmentAsync batch sub_area, Update/Create handle FromAt/ToAt
[ ] Update PidController response: add fromAt, toAt, subArea
[ ] Update pid.html table headers: new column order + sub_area, from_at, to_at
[ ] Update pid.js table row rendering for new columns
[ ] Update pid.js add-row and save-row for FromAt/ToAt
[ ] Build and verify
+ Thought: 314ms
← Edit src/Core/Domain/Entities/PidEquipment.cs
[MaxLength(255)]
[Column("drawing_file")]
public string? DrawingFile { get; set; }
// ── UI 전용 (DB 컬럼 없음, API 응답 시 tag_metadata LEFT JOIN) ──
[System.ComponentModel.DataAnnotations.Schema.NotMapped]
public string? SubArea { get; set; }
}
+ Thought: 281ms
→ Read src/Core/Domain/Entities/PidEquipment.cs [limit=5]
+ Thought: 363ms
# Todos
[✓] Add [NotMapped] SubArea to PidEquipment entity
[•] Add FromAt/ToAt to Create/Update DTOs
[ ] Update PidExtractorService: GetEquipmentAsync batch sub_area, Update/Create handle FromAt/ToAt
[ ] Update PidController response: add fromAt, toAt, subArea
[ ] Update pid.html table headers: new column order + sub_area, from_at, to_at
[ ] Update pid.js table row rendering for new columns
[ ] Update pid.js add-row and save-row for FromAt/ToAt
[ ] Build and verify
← Edit src/Core/Application/DTOs/PidEquipmentDto.cs
bool? TagDcs = null,
string? Role = null,
string? FromTag = null,
string? ToTag = null,
string? FromAt = null,
string? ToAt = null,
string? TagClass = null);
public record UpdateEquipmentRequest(
string? TagNo = null,
bool? TagDcs = null,
string? Role = null,
string? FromTag = null,
string? ToTag = null,
string? FromAt = null,
string? ToAt = null,
string? TagClass = null);
+ Thought: 701ms
→ Read src/Core/Application/Services/PidExtractorService.cs [offset=387, limit=100]
+ Thought: 549ms
→ Read src/Core/Application/Services/PidExtractorService.cs [offset=486, limit=30]
+ Thought: 840ms
→ Read src/Core/Application/Services/PidExtractorService.cs [limit=20]
+ Thought: 770ms
# Todos
[✓] Add [NotMapped] SubArea to PidEquipment entity
[✓] Add FromAt/ToAt to Create/Update DTOs
[•] Update PidExtractorService: GetEquipmentAsync batch sub_area, Update/Create handle FromAt/ToAt
[ ] Update PidController response: add fromAt, toAt, subArea
[ ] Update pid.html table headers: new column order + sub_area, from_at, to_at
[ ] Update pid.js table row rendering for new columns
[ ] Update pid.js add-row and save-row for FromAt/ToAt
[ ] Build and verify
+ Thought: 492ms
← Edit src/Core/Application/Services/PidExtractorService.cs
{
items = await q.OrderByDescending(e => e.ExtractedAt)
.Skip((page - 1) * pageSize).Take(pageSize).ToListAsync();
}
// batch-load sub_area from tag_metadata
if (items.Count > 0)
{
var tagNos = items.Select(e => e.TagNo.ToLowerInvariant()).ToHashSet();
var subAreas = await _dbContext.TagMetadata
.Where(m => tagNos.Contains(m.BaseTag) && m.Attribute == "sub_area")
.Select(m => new { m.BaseTag, m.Value })
.ToListAsync();
var subMap = subAreas.ToDictionary(sa => sa.BaseTag, sa => sa.Value);
foreach (var e in items)
{
if (subMap.TryGetValue(e.TagNo.ToLowerInvariant(), out var sa))
e.SubArea = sa;
}
}
return (total, items);
}
private static string TagSortKey(string tagNo)
+ Thought: 361ms
← Edit src/Core/Application/Services/PidExtractorService.cs
TagDcs = request.TagDcs ?? false,
Role = request.Role,
FromTag = request.FromTag,
ToTag = request.ToTag,
FromAt = request.FromAt,
ToAt = request.ToAt,
TagClass = request.TagClass ?? ClassifyTagClass(request.Category, request.TagDcs ?? false),
IsActive = true,
Confidence = 1.0,
ExtractedAt = DateTime.UtcNow,
+ Thought: 273ms
← Edit src/Core/Application/Services/PidExtractorService.cs
if (request.TagDcs.HasValue) e.TagDcs = request.TagDcs.Value;
if (request.Role != null) e.Role = request.Role;
if (request.FromTag != null) e.FromTag = request.FromTag;
if (request.ToTag != null) e.ToTag = request.ToTag;
if (request.FromAt != null) e.FromAt = request.FromAt;
if (request.ToAt != null) e.ToAt = request.ToAt;
if (request.TagClass != null) e.TagClass = request.TagClass;
if (request.Category != null || request.TagDcs.HasValue)
e.TagClass = ClassifyTagClass(e.Category, e.TagDcs);
if (request.FromTag != null || request.ToTag != null)
+ Thought: 476ms
# Todos
[✓] Add [NotMapped] SubArea to PidEquipment entity
[✓] Add FromAt/ToAt to Create/Update DTOs
[✓] Update PidExtractorService: GetEquipmentAsync batch sub_area, Update/Create handle FromAt/ToAt
[•] Update PidController response: add fromAt, toAt, subArea
[ ] Update pid.html table headers: new column order + sub_area, from_at, to_at
[ ] Update pid.js table row rendering for new columns
[ ] Update pid.js add-row and save-row for FromAt/ToAt
[ ] Build and verify