diff --git a/apps/st/src/components/statistics/verification/HbStatisticsVerification.tsx b/apps/st/src/components/statistics/verification/HbStatisticsVerification.tsx index 67787c264..2a356aa43 100644 --- a/apps/st/src/components/statistics/verification/HbStatisticsVerification.tsx +++ b/apps/st/src/components/statistics/verification/HbStatisticsVerification.tsx @@ -34,10 +34,7 @@ import type { AnalysisRequestPayload, AnalysisResponseDto, } from "@/entities/statistics/model/analysis-interface"; -import type { - StAnlsMstResponse, - StAnlsOutlierListResponse, -} from "@/entities/statistics/model/analysis-history-interface"; +import type { StAnlsOutlierListResponse } from "@/entities/statistics/model/analysis-history-interface"; import { ENDPOINT } from "@/shared/config"; import { useAlertStore } from "@/shared/lib"; import { CodeApi } from "@/entities/code"; @@ -72,31 +69,6 @@ function toNumber(value: string): number { return Number.isNaN(parsed) ? 0 : parsed; } -function mapHistoryToRow( - item: StAnlsMstResponse, -): Record { - const executedAt = item.anlsBgngDt ?? ""; - const endedAt = item.anlsEndDt ?? ""; - const verificationYear = - executedAt && executedAt.length >= 4 ? executedAt.slice(0, 4) : ""; - - return { - executedAt, - progressStatus: item.anlsSttsNm ?? "", - endedAt, - verificationYear, - mu: 0, - percentile: 0, - a: 0, - c: 0, - target: "", - normalCount: item.nmlDataNocs ?? 0, - excludedCount: item.exclDataNocs ?? 0, - abnormalCount: item.otlrDataNocs ?? 0, - anlsSn: item.anlsSn, - }; -} - const HbStatisticsVerification = () => { const { setMessage: alert } = useAlertStore((state) => state); const queryClient = useQueryClient(); @@ -140,13 +112,11 @@ const HbStatisticsVerification = () => { }, }); - const historyRowData: Record[] = useMemo( - () => - (analysisHistory?.content ?? []).map((item) => - mapHistoryToRow(item as StAnlsMstResponse), - ), - [analysisHistory], - ); + const historyRowData = + (analysisHistory?.content ?? []) as unknown as Record< + string, + string | number + >[]; const { data: outlierList, isLoading: isLoadingOutlier } = useQuery({ queryKey: [ @@ -243,7 +213,7 @@ const HbStatisticsVerification = () => { } function handleHistoryRowClick(row: Record) { - const abnormalCount = Number(row.abnormalCount ?? 0); + const abnormalCount = Number(row.otlrDataNocs ?? 0); const anlsSn = Number(row.anlsSn ?? 0); if (!anlsSn || abnormalCount <= 0) return; setOutlierDialog({ open: true, anlsSn }); @@ -460,8 +430,8 @@ const HbStatisticsVerification = () => { showHeaderCheckbox={false} onRowClick={handleHistoryRowClick} cellStyleCallback={({ row, fieldName }) => { - if (fieldName === "abnormalCount") { - const abnormal = Number(row.abnormalCount ?? 0); + if (fieldName === "otlrDataNocs") { + const abnormal = Number(row.otlrDataNocs ?? 0); if (abnormal > 0) return "rg-cell-verify-error"; } return ""; diff --git a/apps/st/src/entities/statistics/model/verification-history-column.ts b/apps/st/src/entities/statistics/model/verification-history-column.ts index aea9b7f4f..e6c635a54 100644 --- a/apps/st/src/entities/statistics/model/verification-history-column.ts +++ b/apps/st/src/entities/statistics/model/verification-history-column.ts @@ -5,79 +5,36 @@ import type { ColumnInfo } from "@rsone/components"; export const verificationHistoryColumnInfo: ColumnInfo = { columns: [ { - name: "executedAt", - fieldName: "executedAt", + name: "anlsBgngDt", + fieldName: "anlsBgngDt", header: { text: "검증 실행 일시" }, editable: false, sortdisable: false, }, { - name: "progressStatus", - fieldName: "progressStatus", + name: "anlsSttsNm", + fieldName: "anlsSttsNm", header: { text: "진행 상태" }, editable: false, sortdisable: false, }, { - name: "endedAt", - fieldName: "endedAt", + name: "anlsEndDt", + fieldName: "anlsEndDt", header: { text: "종료 일시" }, editable: false, sortdisable: false, }, { - name: "verificationYear", - fieldName: "verificationYear", - header: { text: "검증년도" }, + name: "rgtrNm", + fieldName: "rgtrNm", + header: { text: "검증자" }, editable: false, sortdisable: false, }, { - name: "mu", - fieldName: "mu", - header: { text: "μ" }, - editable: false, - sortdisable: false, - valueType: ValueType.NUMBER, - dataFormat: "#,##0.###", - }, - { - name: "percentile", - fieldName: "percentile", - header: { text: "Percentile" }, - editable: false, - sortdisable: false, - valueType: ValueType.NUMBER, - dataFormat: "#,##0.###", - }, - { - name: "a", - fieldName: "a", - header: { text: "A" }, - editable: false, - sortdisable: false, - valueType: ValueType.NUMBER, - dataFormat: "#,##0.###", - }, - { - name: "c", - fieldName: "c", - header: { text: "C" }, - editable: false, - sortdisable: false, - valueType: ValueType.NUMBER, - dataFormat: "#,##0.###", - }, - { - name: "target", - fieldName: "target", - header: { text: "검증 대상" }, - editable: false, - sortdisable: false, - }, - { - name: "normalCount", - fieldName: "normalCount", + name: "nmlDataNocs", + fieldName: "nmlDataNocs", header: { text: "정상건수" }, editable: false, sortdisable: false, @@ -85,8 +42,8 @@ export const verificationHistoryColumnInfo: ColumnInfo = { dataFormat: "#,##0", }, { - name: "excludedCount", - fieldName: "excludedCount", + name: "exclDataNocs", + fieldName: "exclDataNocs", header: { text: "제외건수" }, editable: false, sortdisable: false, @@ -94,8 +51,8 @@ export const verificationHistoryColumnInfo: ColumnInfo = { dataFormat: "#,##0", }, { - name: "abnormalCount", - fieldName: "abnormalCount", + name: "otlrDataNocs", + fieldName: "otlrDataNocs", header: { text: "이상건수" }, editable: false, sortdisable: false, @@ -104,17 +61,12 @@ export const verificationHistoryColumnInfo: ColumnInfo = { }, ], columnLayout: [ - "executedAt", - "progressStatus", - "endedAt", - "verificationYear", - "mu", - "percentile", - "a", - "c", - "target", - "normalCount", - "excludedCount", - "abnormalCount", + "anlsBgngDt", + "anlsSttsNm", + "anlsEndDt", + "rgtrNm", + "nmlDataNocs", + "exclDataNocs", + "otlrDataNocs", ], };