st: feat: 하수도보급률 입력 저장, 체출 로직 작업, 도-시 조회 시 버튼 조건 추가

This commit is contained in:
2026-02-25 14:39:40 +09:00
parent f51f6e58d8
commit cc3c5c5d68
9 changed files with 628 additions and 288 deletions
@@ -38,6 +38,15 @@ export class StatisticsInputAPiService implements StatisticsInputService {
return response.data;
}
public async submitSewerageSupplyRate(params: SewerageSupplyRateSaveRequest): Promise<SewerageSupplyRateSaveApiResponse> {
const response = await axios.post<SewerageSupplyRateSaveApiResponse> (
`${ENDPOINT.ST_SERVICE.INPUT}/sewerage-supply-rate/submit`,
params
);
return response.data;
}
}
export const statisticsInputAPi = new StatisticsInputAPiService();
@@ -2,120 +2,83 @@ import type { ApiResponse } from "./statistics-interface";
// 하수도 보급률 데이터 항목
export interface SewerageSupplyRateStatusInfo {
locgStatus: string;
locgDt: string;
locgCharger: string;
locgCttpc: string;
prvnStatus: string;
dcsnStatus: string;
locgStatus: string | null;
locgDt: string | null;
locgCharger: string | null;
locgCttpc: string | null;
locgJob: string | null;
prvnStatus: string | null;
dcsnStatus: string | null;
wrterOpinionSm: string | null;
chckerOpinionSm: string | null;
returnOpinionSm: string | null;
locgCnfirmDept: string | null;
locgCnfirmJob: string | null;
locgCnfirmNm: string | null;
locgCnfirmPh: string | null;
locgDept: string | null;
}
export interface SewerageSupplyRateCommonInfo {
bsnmArea: number;
bsnmCd: string;
bsnmFrgnrPoplSm: number;
bsnmPoplSm: number;
bsnmTotalPopl: number;
sewerBzmnArea: number;
sewerBzmnCd: string;
sewerBzmnFrgnrPoplSm: number;
sewerBzmnPoplSm: number;
sewerBzmnTotalPopl: number;
piplFcltyExtn: number;
piplPlanExtn: number;
piplSupprt: number;
sido: string;
yr: string;
swagePplPsplyRt: number;
ctpvNm: string;
statsYr: string;
}
/** 검증 결과 한 건 (필드별 메시지) */
export interface VerificationResultItem {
type: string;
rsn: string;
vrfcCd: string;
rsnExpln: string;
}
/** 필드명 → 검증 결과 배열. 예: { popltnSm: [{ type, rsn }], wstrPrmTrt: [...] } */
export type SewerageSupplyRateVerificationResult = Record<string, VerificationResultItem[]>;
/** 하수도 보급률 목록 API 응답 한 행 (실제 응답 필드만) */
export interface SewerageSupplyRateItem {
sido: string;
gugun: string;
adstDong: string;
rgnNm: string;
adstCd: string;
yr: string;
bsnmCd: string;
rvbsn: string;
lgbsn: string;
admdstCd: string;
sggNm: string;
admdstNm: string;
rvbsn: string | null;
trbtrNm: string;
mdbsn: string;
lgbsn: string;
mdmbsn: string;
spcCtpnRgnCn: string | null;
totalPopl: number;
poplSm: number;
frgnrPoplSm: number;
area: number;
bsnmTotalPopl: number;
bsnmPoplSm: number;
bsnmFrgnrPoplSm: number;
bsnmArea: number;
piplPlanExtn: number;
piplFcltyExtn: number;
piplSupprt: number;
wrssm: string | null;
bstrm: string;
speclCntrplnAr: string | null;
popltnSm: number;
arSm: number;
swgeProcZoneInnerSm: number;
pblswrgPopltnSm: number;
pblswrgPrmTrt: number;
pblswrgScdTrt: number;
pblswrgTertTrt: number;
wstrPopltnSm: number;
wstrPrmTrt: number;
wstrScdTrt: number;
wstrTertTrt: number;
swgeProcZoneInnerAr: number;
swgeProcZoneOuterSm: number;
townUnprocPopltn: number;
townSwttPopltn: number;
townWrrtnPopltn: number;
uptownUnprPopltn: number;
uptownSwttPopltn: number;
uptownWrrtnPopltn: number;
swgeProcZoneOuterAr: number;
pblswrgPopltnSuprt: number;
adtrtPopltnSuprt: number;
swrgInstlrt: number;
wrterOpinion: string | null;
chckerOpinion: string | null;
notConectPopltn: number;
rmk: string;
chkWrssm: string;
chkBstrm: string;
chkSpeclCntrplnAr: string;
chkPopltnSm: string;
chkArSm: string;
chkSwgeProcZoneInnerSm: string;
chkPblswrgPopltnSm: string;
chkPblswrgPrmTrt: string;
chkPblswrgScdTrt: string;
chkPblswrgTertTrt: string;
chkWstrPopltnSm: string;
chkWstrPrmTrt: string;
chkWstrScdTrt: string;
chkWstrTertTrt: string;
chkSwgeProcZoneInnerAr: string;
chkSwgeProcZoneOuterSm: string;
chkTownUnprocPopltn: string;
chkTownSwttPopltn: string;
chkTownWrrtnPopltn: string;
chkUptownUnprPopltn: string;
chkUptownSwttPopltn: string;
chkUptownWrrtnPopltn: string;
chkSwgeProcZoneOuterAr: string;
chkPblswrgPopltnSuprt: string;
chkAdtrtPopltnSuprt: string;
chkSwrgInstlrt: string;
chkNotConectPopltn: string;
verificationResult?: SewerageSupplyRateVerificationResult;
refArea: number;
wholPpltnCnt: number;
wholArea: number;
wholSwtrmtPpltnCnt: number;
wholPblSwtrmtPpltnCnt: number;
ts1SwtrmtPpltnCnt: number;
ts2SwtrmtPpltnCnt: number;
ts3SwtrmtPpltnCnt: number;
wholWwtPrcsPpltnCnt: number;
ts1WwtPrcsPpltnCnt: number;
ts2WwtPrcsPpltnCnt: number;
ts3WwtPrcsPpltnCnt: number;
yetCntnPpltnCnt: number;
staaArea: number;
wholStaaExcpPpltnCnt: number;
unprcsPpltnCnt: number;
drtwPrcsPpltnCnt: number;
spctnkPpltnCnt: number;
staaExcpArea: number;
staaPsplyRt: number;
altdPrcsPsplyRt: number;
sewerInstlRt: number;
rmrk: string | null;
verificationResult?: SewerageSupplyRateVerificationResult | null;
}
export interface SewerageSupplyRateResponseData {
@@ -129,55 +92,63 @@ export type SewerageSupplyRateApiResponse = ApiResponse<SewerageSupplyRateRespon
}
export interface SewerageSupplyRateRequestParams {
sido?: string;
gugun?: string;
bsnmCd?: string;
yr?: string;
ctpvNm?: string;
sggNm?: string;
sewerBzmnCd?: string;
statsYr?: string;
mode?: string;
}
/** 하수도 보급률 저장 API 요청 body (한 행) */
export interface SewerageSupplyRateSaveItem {
gugun: string | null;
adstCd: string;
adstDong: string;
bstrm: string;
speclCntrplnAr: string | null;
pblswrgPrmTrt: number;
pblswrgScdTrt: number;
pblswrgTertTrt: number;
wstrPrmTrt: number;
wstrScdTrt: number;
wstrTertTrt: number;
notConectPopltn: number;
swgeProcZoneInnerAr: number;
townUnprocPopltn: number;
townSwttPopltn: number;
townWrrtnPopltn: number;
swgeProcZoneOuterAr: number;
rmk: string;
popltnSm: number;
arSm: number;
swgeProcZoneInnerSm: number;
pblswrgPopltnSm: number;
wstrPopltnSm: number;
swgeProcZoneOuterSm: number;
pblswrgPopltnSuprt: number;
adtrtPopltnSuprt: number;
swrgInstlrt: number;
sggNm: string | null;
admdstCd: string;
admdstNm: string;
trbtrNm: string;
spcCtpnRgnCn: string | null;
ts1SwtrmtPpltnCnt: number;
ts2SwtrmtPpltnCnt: number;
ts3SwtrmtPpltnCnt: number;
ts1WwtPrcsPpltnCnt: number;
ts2WwtPrcsPpltnCnt: number;
ts3WwtPrcsPpltnCnt: number;
yetCntnPpltnCnt: number;
staaArea: number;
unprcsPpltnCnt: number;
drtwPrcsPpltnCnt: number;
spctnkPpltnCnt: number;
staaExcpArea: number;
rmrk: string;
wholPpltnCnt: number;
wholArea: number;
wholSwtrmtPpltnCnt: number;
wholPblSwtrmtPpltnCnt: number;
wholWwtPrcsPpltnCnt: number;
wholStaaExcpPpltnCnt: number;
staaPsplyRt: number;
altdPrcsPsplyRt: number;
sewerInstlRt: number;
}
export interface SewerageSupplyRateSaveRequest {
yr: string;
sido: string;
bsnmCd: string;
statsYr: string;
ctpvNm: string;
sewerBzmnCd: string;
userId: string;
saveList: SewerageSupplyRateSaveItem[];
sewerBzmnFrgnrPoplSm?: number;
saveList?: SewerageSupplyRateSaveItem[];
submitList?: SewerageSupplyRateSaveItem[];
locgCharger?: string;
locgJob?: string;
locgDept?: string;
locgCttpc?: string;
locgCnfirmNm?: string;
locgCnfirmJob?: string;
locgCnfirmDept?: string;
locgCnfirmPh?: string;
}
export interface SewerageSupplyRateSaveData {
hasMismatch?: boolean;
mismatchIdList?: string[];
httpStatus?: number;
code?: string;
}
@@ -195,4 +166,5 @@ export interface StatisticsInputService {
getSewerageSupplyRateList(params: SewerageSupplyRateRequestParams): Promise<SewerageSupplyRateApiResponse>;
checkInputPeriod(params: string): Promise<CheckInputPeriodResponse>;
saveSewerageSupplyRate(params: SewerageSupplyRateSaveRequest): Promise<SewerageSupplyRateSaveApiResponse>;
submitSewerageSupplyRate(params: SewerageSupplyRateSaveRequest): Promise<SewerageSupplyRateSaveApiResponse>;
}
@@ -0,0 +1,17 @@
import { z } from "zod";
export const statisticsInputSubmitInfoSchema = z.object({
// 작성자 명, 작성자 직제, 작성자 부서, 작성자 연락처, 승인자명, 승인자 직제, 승인자 부서, 승인자 연락처 (전부 필수)
locgCharger: z.string().min(1, "작성자 명을 입력하세요"),
locgJob: z.string().min(1, "작성자 직제를 입력하세요"),
locgDept: z.string().min(1, "작성자 부서를 입력하세요"),
locgCttpc: z.string().min(1, "작성자 연락처를 입력하세요"),
locgCnfirmNm: z.string().min(1, "승인자명을 입력하세요"),
locgCnfirmJob: z.string().min(1, "승인자 직제를 입력하세요"),
locgCnfirmDept: z.string().min(1, "승인자 부서를 입력하세요"),
locgCnfirmPh: z.string().min(1, "승인자 연락처를 입력하세요"),
});
export type StatisticsInputSubmitInfoFormData = z.infer<
typeof statisticsInputSubmitInfoSchema
>;