From 1236a24b6107a22f7f3266e57c1e62c75b1d4084 Mon Sep 17 00:00:00 2001 From: rsone001 Date: Tue, 30 Jun 2026 15:56:47 +0900 Subject: [PATCH] =?UTF-8?q?[st]=20-=20fix:=20=EC=9E=85=EB=A0=A5=EB=8B=A8?= =?UTF-8?q?=20=EB=82=A0=EC=A7=9C=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EA=B0=92?= =?UTF-8?q?=20=EC=97=86=EC=9D=84=20=EC=8B=9C=20null=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../input/ExcretaTreatmentFacilityInp.tsx | 6 ++-- .../statistics/input/PumpingStationInp.tsx | 4 +-- .../input/SewageReservoirPumpInp.tsx | 6 ++-- .../statistics/input/WaterReuseInp.tsx | 16 +++++----- apps/st/src/components/util/grid/ymdFormat.ts | 8 +++++ ...ut-excreta-treatment-facility-interface.ts | 7 +++-- ...tistics-input-pumping-station-interface.ts | 5 +++- ...s-input-sewage-reservoir-pump-interface.ts | 12 +++++--- .../statistics-input-water-reuse-interface.ts | 29 ++++++++++++------- 9 files changed, 60 insertions(+), 33 deletions(-) diff --git a/apps/st/src/components/statistics/input/ExcretaTreatmentFacilityInp.tsx b/apps/st/src/components/statistics/input/ExcretaTreatmentFacilityInp.tsx index 560f67edd..6304f1f9c 100644 --- a/apps/st/src/components/statistics/input/ExcretaTreatmentFacilityInp.tsx +++ b/apps/st/src/components/statistics/input/ExcretaTreatmentFacilityInp.tsx @@ -38,7 +38,7 @@ import type { import type { SearchFormValues } from "@/components/type/SearchForm.type"; import { doList } from "@/components/util/column/input/DoList"; import { toGridRows } from "@/components/util/grid/gridFunction"; -import { formatCompactYmdForGrid, toCompactYmd } from "@/components/util/grid/ymdFormat"; +import { formatCompactYmdForGrid, toCompactYmdOrNull } from "@/components/util/grid/ymdFormat"; import { statisticsInputExcretaTreatmentFacilityApi } from "@/entities/statistics/api/input/statistics-input-excreta-treatment-facility-service"; import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service"; @@ -199,8 +199,8 @@ function toGridNumber(value: string | number | null | undefined): number { return Number.isFinite(n) ? n : 0; } -function toApiYmd(value: string | number | Date | null | undefined): string { - return toCompactYmd(value); +function toApiYmd(value: string | number | Date | null | undefined): string | null { + return toCompactYmdOrNull(value); } function resolveExcretaTreatmentFacilityAdmdst( diff --git a/apps/st/src/components/statistics/input/PumpingStationInp.tsx b/apps/st/src/components/statistics/input/PumpingStationInp.tsx index 421405505..fe35e2a63 100644 --- a/apps/st/src/components/statistics/input/PumpingStationInp.tsx +++ b/apps/st/src/components/statistics/input/PumpingStationInp.tsx @@ -38,7 +38,7 @@ import type { import type { SearchFormValues } from "@/components/type/SearchForm.type"; import { doList } from "@/components/util/column/input/DoList"; import { toGridRows } from "@/components/util/grid/gridFunction"; -import { formatCompactYmdForGrid, toCompactYmd } from "@/components/util/grid/ymdFormat"; +import { formatCompactYmdForGrid, toCompactYmdOrNull } from "@/components/util/grid/ymdFormat"; import { statisticsInputPumpingStationApi } from "@/entities/statistics/api/input/statistics-input-pumping-station-service"; import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service"; @@ -230,7 +230,7 @@ function buildPumpingStationSaveItem( fcltNm: String(row.fcltNm ?? ""), pumpSeNm: String(row.pumpSeNm ?? ""), fcltPstnCn: String(row.fcltPstnCn ?? ""), - oprtngStrtYmd: toCompactYmd(row.oprtngStrtYmd), + oprtngStrtYmd: toCompactYmdOrNull(row.oprtngStrtYmd), planMltvArea: toGridNumber(row.planMltvArea), sndyArea: toGridNumber(row.sndyArea), rainArea: toGridNumber(row.rainArea), diff --git a/apps/st/src/components/statistics/input/SewageReservoirPumpInp.tsx b/apps/st/src/components/statistics/input/SewageReservoirPumpInp.tsx index 15aafdd95..21a498c4e 100644 --- a/apps/st/src/components/statistics/input/SewageReservoirPumpInp.tsx +++ b/apps/st/src/components/statistics/input/SewageReservoirPumpInp.tsx @@ -45,7 +45,7 @@ import { toGridRows } from "@/components/util/grid/gridFunction"; import { formatCompactYmdForGrid, normalizeOxYnValue, - toCompactYmd, + toCompactYmdOrNull, } from "@/components/util/grid/ymdFormat"; import { statisticsInputSewageReservoirPumpApi } from "@/entities/statistics/api/input/statistics-input-sewage-reservoir-pump-service"; import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service"; @@ -308,7 +308,7 @@ function buildSewageReservoirSaveItem( fcltSn: fcltSn, fcltNm: String(row.fcltNm ?? ""), fcltPstnCn: String(row.fcltPstnCn ?? ""), - oprtngStrtYmd: toCompactYmd(row.oprtngStrtYmd), + oprtngStrtYmd: toCompactYmdOrNull(row.oprtngStrtYmd), planDesignFreqCnt: toGridNumber(row.planDesignFreqCnt), fldngPrvtnYn: normalizeOxYnValue(row.fldngPrvtnYn), wqPlltnMtgtYn: normalizeOxYnValue(row.wqPlltnMtgtYn), @@ -363,7 +363,7 @@ function buildRainfallPumpStationSaveItem( fcltNm: String(row.fcltNm ?? ""), fcltPstnCn: String(row.fcltPstnCn ?? ""), fcltyKndCn: String(row.fcltyKndCn ?? ""), - oprtngStrtYmd: toCompactYmd(row.oprtngStrtYmd), + oprtngStrtYmd: toCompactYmdOrNull(row.oprtngStrtYmd), planDesignFreqCnt: toGridNumber(row.planDesignFreqCnt), wtrStrgZoneArea: toGridNumber(row.wtrStrgZoneArea), rsvrYn: String(row.rsvrYn ? (row.rsvrYn === "무" ? "N" : "Y") : ""), diff --git a/apps/st/src/components/statistics/input/WaterReuseInp.tsx b/apps/st/src/components/statistics/input/WaterReuseInp.tsx index 2308dc948..6b86dbf03 100644 --- a/apps/st/src/components/statistics/input/WaterReuseInp.tsx +++ b/apps/st/src/components/statistics/input/WaterReuseInp.tsx @@ -38,7 +38,7 @@ import { RecycledWaterStatusInpColumn } from "@/components/util/column/input/wat import { TreatWaterReuseBusinessApprStatusInpColumn } from "@/components/util/column/input/waterReuse/TreatWaterReuseBusinessApprStatusInpColumn"; import { TreatWaterReuseDesignConstStatusInpColumn } from "@/components/util/column/input/waterReuse/TreatWaterReuseDesignConstStatusInpColumn"; import { toGridRows } from "@/components/util/grid/gridFunction"; -import { formatCompactYmdForGrid, toCompactYmd } from "@/components/util/grid/ymdFormat"; +import { formatCompactYmdForGrid, toCompactYmdOrNull } from "@/components/util/grid/ymdFormat"; import { statisticsInputWaterReuseApi } from "@/entities/statistics/api/input/statistics-input-water-reuse-service"; import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service"; import { statisticsApi } from "@/entities/statistics/api/statistics-service"; @@ -297,8 +297,8 @@ function buildRecycledWaterStatusSaveItem( bldgSeCn: String(row.bldgSeCn ?? "").trim(), fcltPstnCn: String(row.fcltPstnCn ?? "").trim(), lglTrgtYn: String(row.lglTrgtYn ?? "").trim(), - cmptnStrtYmd: toCompactYmd(row.cmptnStrtYmd), - oprtngStrtYmd: toCompactYmd(row.oprtngStrtYmd), + cmptnStrtYmd: toCompactYmdOrNull(row.cmptnStrtYmd), + oprtngStrtYmd: toCompactYmdOrNull(row.oprtngStrtYmd), archWholArea: toGridNumber(row.archWholArea), prcsCpct: toGridNumber(row.prcsCpct), wtrUseQnt: toGridNumber(row.wtrUseQnt), @@ -323,7 +323,7 @@ function buildRainFallUtilFactStatusSaveItem( bdstTypCn: String(row.bdstTypCn ?? "").trim(), fcltPstnCn: String(row.fcltPstnCn ?? "").trim(), lglTrgtYn: String(row.lglTrgtYn ?? "").trim(), - cmptYmd: toCompactYmd(row.cmptYmd), + cmptYmd: toCompactYmdOrNull(row.cmptYmd), instlAmt: toGridNumber(row.instlAmt), rcptMynCn: String(row.rcptMynCn ?? "").trim(), filtrPrcsFcltYnExpln: String(row.filtrPrcsFcltYnExpln ?? "").trim(), @@ -347,7 +347,7 @@ function buildTreatWaterReuseDesignConstStatusSaveItem( bplcNm: String(row.bplcNm ?? "").trim(), rprsvNm: String(row.rprsvNm ?? "").trim(), bplcPstnCn: String(row.bplcPstnCn ?? "").trim(), - coRegYmd: toCompactYmd(row.coRegYmd), + coRegYmd: toCompactYmdOrNull(row.coRegYmd), rmrk: nullableTrimmedString(row.rmrk), }; } @@ -364,7 +364,7 @@ function buildTreatWaterReuseBusinessApprStatusSaveItem( bplcNm: String(row.bplcNm ?? "").trim(), rprsvNm: String(row.rprsvNm ?? "").trim(), bplcPstnCn: String(row.bplcPstnCn ?? "").trim(), - coRegYmd: toCompactYmd(row.coRegYmd), + coRegYmd: toCompactYmdOrNull(row.coRegYmd), rmrk: nullableTrimmedString(row.rmrk), }; } @@ -381,8 +381,8 @@ function buildPublicSewageTreatWaterReuseSaveItem( wholPrcsQnt: toGridNumber(row.wholPrcsQnt), lglYn: String(row.lglYn ?? "").trim(), instlYn: String(row.instlYn ?? "").trim(), - oprtngStrtYmd: toCompactYmd(row.oprtngStrtYmd), - instlAprvYmd: toCompactYmd(row.instlAprvYmd), + oprtngStrtYmd: toCompactYmdOrNull(row.oprtngStrtYmd), + instlAprvYmd: toCompactYmdOrNull(row.instlAprvYmd), rprcsFcltCpct: toGridNumber(row.rprcsFcltCpct), mtcnsNm: String(row.mtcnsNm ?? "").trim(), ruswtPplLen: toGridNumber(row.ruswtPplLen), diff --git a/apps/st/src/components/util/grid/ymdFormat.ts b/apps/st/src/components/util/grid/ymdFormat.ts index 16c98384e..d0c5f60af 100644 --- a/apps/st/src/components/util/grid/ymdFormat.ts +++ b/apps/st/src/components/util/grid/ymdFormat.ts @@ -62,6 +62,14 @@ export function toCompactYmd( return ""; } +/** 그리드·API 값 → 8자리 일자(yyyyMMdd). 없거나 유효하지 않으면 null */ +export function toCompactYmdOrNull( + value: string | number | Date | null | undefined, +): string | null { + const compact = toCompactYmd(value); + return compact === "" ? null : compact; +} + /** 설치목적 등 O/X 표기 → 대문자 O 또는 X (그 외는 원문 유지) */ export function normalizeOxYnValue( value: string | number | null | undefined, diff --git a/apps/st/src/entities/statistics/model/input/statistics-input-excreta-treatment-facility-interface.ts b/apps/st/src/entities/statistics/model/input/statistics-input-excreta-treatment-facility-interface.ts index 662c2d30a..07d5c3c00 100644 --- a/apps/st/src/entities/statistics/model/input/statistics-input-excreta-treatment-facility-interface.ts +++ b/apps/st/src/entities/statistics/model/input/statistics-input-excreta-treatment-facility-interface.ts @@ -97,8 +97,11 @@ export interface ExcretaTreatmentFacilityRequestParams { */ export type ExcretaTreatmentFacilitySaveItem = Omit< ExcretaTreatmentFacilityItem, - "sggNm" | "verificationResult" ->; + "sggNm" | "verificationResult" | "cmptnStrtYmd" | "oprtngStrtYmd" +> & { + cmptnStrtYmd: string | null; + oprtngStrtYmd: string | null; +}; /** 분뇨처리시설(ST00070001) 저장 API 요청 */ export interface ExcretaTreatmentFacilitySaveRequest { diff --git a/apps/st/src/entities/statistics/model/input/statistics-input-pumping-station-interface.ts b/apps/st/src/entities/statistics/model/input/statistics-input-pumping-station-interface.ts index 4114fc728..105eb1214 100644 --- a/apps/st/src/entities/statistics/model/input/statistics-input-pumping-station-interface.ts +++ b/apps/st/src/entities/statistics/model/input/statistics-input-pumping-station-interface.ts @@ -106,7 +106,10 @@ export type PumpingStationSaveItem = Omit< | "exlnQnt" | "drtwPumpGrssPpqty" | "exlnPumpGrssPpqty" ->; + | "oprtngStrtYmd" +> & { + oprtngStrtYmd: string | null; +}; /** 펌프장(ST00050001) 저장 API 요청 */ export interface PumpingStationSaveRequest { diff --git a/apps/st/src/entities/statistics/model/input/statistics-input-sewage-reservoir-pump-interface.ts b/apps/st/src/entities/statistics/model/input/statistics-input-sewage-reservoir-pump-interface.ts index e2b78f8df..4a5d0bd66 100644 --- a/apps/st/src/entities/statistics/model/input/statistics-input-sewage-reservoir-pump-interface.ts +++ b/apps/st/src/entities/statistics/model/input/statistics-input-sewage-reservoir-pump-interface.ts @@ -172,8 +172,10 @@ export interface SewageReservoirRequestParams { */ export type SewageReservoirSaveItem = Omit< SewageReservoirItem, - "sggNm" | "verificationResult" ->; + "sggNm" | "verificationResult" | "oprtngStrtYmd" +> & { + oprtngStrtYmd: string | null; +}; /** 하수저류시설(ST00040001) 저장 API 요청 */ export interface SewageReservoirSaveRequest { @@ -229,8 +231,10 @@ export interface SewageReservoirSubmitResponse { */ export type RainfallPumpStationSaveItem = Omit< RainfallPumpStationItem, - "sggNm" | "verificationResult" ->; + "sggNm" | "verificationResult" | "oprtngStrtYmd" +> & { + oprtngStrtYmd: string | null; +}; /** * 빗물펌프장(ST00040002) 저장 API 요청 diff --git a/apps/st/src/entities/statistics/model/input/statistics-input-water-reuse-interface.ts b/apps/st/src/entities/statistics/model/input/statistics-input-water-reuse-interface.ts index 87cf5addf..e157b9a68 100644 --- a/apps/st/src/entities/statistics/model/input/statistics-input-water-reuse-interface.ts +++ b/apps/st/src/entities/statistics/model/input/statistics-input-water-reuse-interface.ts @@ -113,8 +113,8 @@ export interface PublicSewageTreatWaterReuseSaveItem { wholPrcsQnt: number; lglYn: string; instlYn: string; - oprtngStrtYmd: string; - instlAprvYmd: string; + oprtngStrtYmd: string | null; + instlAprvYmd: string | null; rprcsFcltCpct: number; mtcnsNm: string; ruswtPplLen: number; @@ -209,8 +209,11 @@ export type RecycledWaterStatusApiResponse = ApiResponse; + "sggNm" | "verificationResult" | "cmptnStrtYmd" | "oprtngStrtYmd" +> & { + cmptnStrtYmd: string | null; + oprtngStrtYmd: string | null; +}; /** ST00100002 저장 API 요청 */ export interface RecycledWaterStatusSaveRequest { @@ -300,8 +303,10 @@ export type RainFallUtilFactStatusApiResponse = /** ST00100003 저장 — `saveList` / `deleteList` 항목 (`sggNm`·검증결과 제외) */ export type RainFallUtilFactStatusSaveItem = Omit< RainFallUtilFactStatusItem, - "sggNm" | "verificationResult" ->; + "sggNm" | "verificationResult" | "cmptYmd" +> & { + cmptYmd: string | null; +}; /** ST00100003 저장 API 요청 */ export interface RainFallUtilFactStatusSaveRequest { @@ -383,8 +388,10 @@ export type TreatWaterReuseDesignConstStatusApiResponse = /** ST00100004 저장 — `saveList` / `deleteList` 항목 (`sggNm`·검증결과 제외) */ export type TreatWaterReuseDesignConstStatusSaveItem = Omit< TreatWaterReuseDesignConstStatusItem, - "sggNm" | "verificationResult" ->; + "sggNm" | "verificationResult" | "coRegYmd" +> & { + coRegYmd: string | null; +}; /** ST00100004 저장 API 요청 */ export interface TreatWaterReuseDesignConstStatusSaveRequest { @@ -467,8 +474,10 @@ export type TreatWaterReuseBusinessApprStatusApiResponse = /** ST00100005 저장 — `saveList` / `deleteList` 항목 (`sggNm`·검증결과 제외) */ export type TreatWaterReuseBusinessApprStatusSaveItem = Omit< TreatWaterReuseBusinessApprStatusItem, - "sggNm" | "verificationResult" ->; + "sggNm" | "verificationResult" | "coRegYmd" +> & { + coRegYmd: string | null; +}; /** ST00100005 저장 API 요청 */ export interface TreatWaterReuseBusinessApprStatusSaveRequest {