Merge remote-tracking branch 'origin/iipbs/st/dev' into feature/review-skeleton-sein

This commit is contained in:
2026-02-05 15:26:13 +09:00
16 changed files with 821 additions and 108 deletions
@@ -4,6 +4,11 @@ export interface Sido {
bsnmCd: string;
}
export interface SearchCondition {
yearList: string[];
sidoList: Sido[];
}
export interface Sgg {
adstDstrCd: string;
gugun: string;
@@ -17,6 +22,6 @@ export interface ApiResponse<T> {
}
export interface StatisticsService {
getSidoList(): Promise<ApiResponse<Sido[]>>;
getSidoList(): Promise<ApiResponse<SearchCondition>>;
getSggList(sidoName: string): Promise<ApiResponse<Sgg[]>>;
}
@@ -83,7 +83,7 @@ export type SewerageSupplyRateReviewApiResponse = ApiResponse<SewerageSupplyRate
export interface SewerageSupplyRateReviewRequestParams {
sido?: string;
gugun?: string;
yr?: number;
yr?: string;
bsnmCd?: string;
}
@@ -0,0 +1,120 @@
import { ValueType } from "realgrid";
import type { ColumnInfo } from "@rsone/components";
/** 검증 이력 그리드 컬럼 설정 */
export const verificationHistoryColumnInfo: ColumnInfo = {
columns: [
{
name: "executedAt",
fieldName: "executedAt",
header: { text: "검증 실행 일시" },
editable: false,
sortdisable: false,
},
{
name: "progressStatus",
fieldName: "progressStatus",
header: { text: "진행 상태" },
editable: false,
sortdisable: false,
},
{
name: "endedAt",
fieldName: "endedAt",
header: { text: "종료 일시" },
editable: false,
sortdisable: false,
},
{
name: "verificationYear",
fieldName: "verificationYear",
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",
header: { text: "정상건수" },
editable: false,
sortdisable: false,
valueType: ValueType.NUMBER,
dataFormat: "#,##0",
},
{
name: "excludedCount",
fieldName: "excludedCount",
header: { text: "제외건수" },
editable: false,
sortdisable: false,
valueType: ValueType.NUMBER,
dataFormat: "#,##0",
},
{
name: "abnormalCount",
fieldName: "abnormalCount",
header: { text: "이상건수" },
editable: false,
sortdisable: false,
valueType: ValueType.NUMBER,
dataFormat: "#,##0",
},
],
columnLayout: [
"executedAt",
"progressStatus",
"endedAt",
"verificationYear",
"mu",
"percentile",
"a",
"c",
"target",
"normalCount",
"excludedCount",
"abnormalCount",
],
};
@@ -0,0 +1,27 @@
/** 검증 이력 한 건 (그리드 행 데이터) */
export interface VerificationHistoryItem {
/** 검증 실행 일시 */
executedAt: string;
/** 진행 상태 */
progressStatus: string;
/** 종료 일시 */
endedAt: string;
/** 검증년도 */
verificationYear: string;
/** μ */
mu: number;
/** Percentile */
percentile: number;
/** A */
a: number;
/** C */
c: number;
/** 검증 대상 */
target: string;
/** 정상건수 */
normalCount: number;
/** 제외건수 */
excludedCount: number;
/** 이상건수 */
abnormalCount: number;
}
@@ -0,0 +1,67 @@
import { fakerKO as faker } from "@faker-js/faker";
import type { VerificationHistoryItem } from "./verification-history-interface";
const VERIFICATION_TARGETS = [
"하수도 보급률",
"하수관로",
"하수관로 유지관리",
"하수저류시설 및 빗물펌프장",
"펌프장",
"공공하수처리시설",
"분뇨처리시설",
"개인하수처리시설",
"하수도재정",
"물 재이용",
"하수도 서비스 수준",
];
const PROGRESS_STATUSES = ["대기", "진행중", "완료", "실패"];
function formatDateTime(date: Date): string {
const y = date.getFullYear();
const m = String(date.getMonth() + 1).padStart(2, "0");
const d = String(date.getDate()).padStart(2, "0");
const h = String(date.getHours()).padStart(2, "0");
const min = String(date.getMinutes()).padStart(2, "0");
return `${y}-${m}-${d} ${h}:${min}`;
}
/** 검증 이력 목데이터 생성 (그리드 행 형식) */
export function createVerificationHistoryMock(
count = 10,
): Record<string, string | number>[] {
faker.seed(42);
return Array.from({ length: count }, () => {
const executedAt = faker.date.recent({ days: 90 });
const durationMinutes = faker.number.int({ min: 1, max: 120 });
const endedAt = new Date(
executedAt.getTime() + durationMinutes * 60 * 1000,
);
const status = faker.helpers.arrayElement(PROGRESS_STATUSES);
const normalCount = faker.number.int({ min: 0, max: 500 });
const excludedCount = faker.number.int({ min: 0, max: 50 });
const abnormalCount = faker.number.int({ min: 0, max: 30 });
const item: VerificationHistoryItem = {
executedAt: formatDateTime(executedAt),
progressStatus: status,
endedAt: formatDateTime(endedAt),
verificationYear: String(executedAt.getFullYear()),
mu: faker.number.float({ min: 0, max: 1, fractionDigits: 3 }),
percentile: faker.number.float({
min: 0,
max: 100,
fractionDigits: 2,
}),
a: faker.number.float({ min: 0, max: 10, fractionDigits: 3 }),
c: faker.number.float({ min: 0, max: 10, fractionDigits: 3 }),
target: faker.helpers.arrayElement(VERIFICATION_TARGETS),
normalCount,
excludedCount,
abnormalCount,
};
return { ...item } as Record<string, string | number>;
});
}
/** 검증 이력 기본 목데이터 (10건) */
export const verificationHistoryMockData = createVerificationHistoryMock(10);