Compare commits
27
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c72c48e9dc | ||
|
|
d1c7da0a8c | ||
|
|
880b13177e | ||
|
|
a390867b5e | ||
|
|
f206943e03 | ||
|
|
84525b7e87 | ||
|
|
687de61668 | ||
|
|
a730db95dd | ||
|
|
f2999f60f2 | ||
|
|
0307ee9fd6 | ||
|
|
8087ed343c | ||
|
|
eaf0a618a0 | ||
|
|
4329eafa9b | ||
|
|
411e490b5d | ||
|
|
b5f5938e51 | ||
|
|
038b2d441e | ||
|
|
2ec58f1f5b | ||
|
|
3cf3617513 | ||
|
|
b611538180 | ||
|
|
1cffe06cf9 | ||
|
|
9a24e4aa23 | ||
|
|
3732c9380b | ||
|
|
9e15b23eda | ||
|
|
6f300918cd | ||
|
|
619878bc03 | ||
|
|
9f0e03c151 | ||
|
|
471a431af5 |
@@ -0,0 +1,28 @@
|
||||
FROM node:20-alpine
|
||||
|
||||
# pnpm 설치
|
||||
RUN corepack enable && corepack prepare pnpm@8.15.5 --activate
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# 모든 소스 복사
|
||||
COPY . .
|
||||
|
||||
# .env.production 파일 생성
|
||||
RUN mkdir -p /app/apps/st && \
|
||||
echo "NODE_ENV=production" > /app/apps/st/.env.production && \
|
||||
echo "PORT=3000" >> /app/apps/st/.env.production && \
|
||||
echo "NEXT_PUBLIC_PORT=3000" >> /app/apps/st/.env.production && \
|
||||
echo "SERVER_API_URL=http://dev.onasys.co.kr:8000" >> /app/apps/st/.env.production && \
|
||||
echo "NEXT_PUBLIC_PROXY_HOST=https://st.apps.rsonesoft.com" >> /app/apps/st/.env.production && \
|
||||
echo "NEXT_PUBLIC_TINY_API_KEY=t9nc4z6inquvvd5pq1vea8wcp7lb01qmqseh6egms9vpaju2" >> /app/apps/st/.env.production && \
|
||||
echo "NEXT_PUBLIC_ST_SERVICE_URL=https://apigateway.apps.rsonesoft.com" >> /app/apps/st/.env.production && \
|
||||
echo "NEXT_PUBLIC_ST_REALGRID_KEY=upVcPE+wPOmtLjqyBIh9RkM/nBOseBrflwxYpzGZyYnkTzf7Gmn/c+YNYZY36ZjDHoLUQjrb+Zx6JscIKXc6ti45WUEqxvh/kkzVSHLUHquykNuBw5QDg+AQvETEhgujkdwMl8bfXmKFzr6UT9cAmQ==" >> /app/apps/st/.env.production && \
|
||||
echo "NEXT_PUBLIC_SITE_ID=ST" >> /app/apps/st/.env.production
|
||||
|
||||
RUN pnpm install --filter=st...
|
||||
RUN pnpm build --filter=st...
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["sh", "-c", "pnpm --filter st start & wait"]
|
||||
@@ -4,11 +4,16 @@ interface SubmitButtonProps {
|
||||
submitFunc: () => void;
|
||||
/** 버튼 문구 (기본: 제출) */
|
||||
text?: string;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
const SubmitButton = ({ submitFunc, text = "제출" }: SubmitButtonProps) => {
|
||||
const SubmitButton = ({ submitFunc, text = "제출", disabled = false }: SubmitButtonProps) => {
|
||||
return (
|
||||
<Button className="h-[3.2rem] min-w-[96px] px-4" onClick={submitFunc}>
|
||||
<Button
|
||||
className="h-[3.2rem] min-w-[96px] px-4"
|
||||
onClick={submitFunc}
|
||||
disabled={disabled}
|
||||
>
|
||||
<i className="diveicon di-upload" />
|
||||
<span>{text}</span>
|
||||
</Button>
|
||||
|
||||
@@ -33,6 +33,7 @@ import {
|
||||
hasAdmdstCdColumn,
|
||||
isExcelImportAdmdstCdInvalid,
|
||||
mergeExcelImportWithExistingRows,
|
||||
parseExcelImportCellValue,
|
||||
prepareGridColumnsForExcelExport,
|
||||
releaseFixedOptionsForExcelExport,
|
||||
resolveColumnStyleName,
|
||||
@@ -252,7 +253,12 @@ declare module "realgrid" {
|
||||
setOptions(options: {
|
||||
footer?: { visible?: boolean };
|
||||
summaryMode?: "aggregate" | "statistical" | "none";
|
||||
checkBar?: { visible?: boolean; exclusive?: boolean; syncHeadCheck?: boolean };
|
||||
checkBar?: {
|
||||
visible?: boolean;
|
||||
exclusive?: boolean;
|
||||
syncHeadCheck?: boolean;
|
||||
checkableOnly?: boolean;
|
||||
};
|
||||
}): void;
|
||||
}
|
||||
}
|
||||
@@ -289,14 +295,28 @@ type GridViewWithSetColumnProperty = {
|
||||
};
|
||||
|
||||
type GridViewWithEditOptions = {
|
||||
setEditOptions?: (options: { commitWhenLeave?: boolean }) => void;
|
||||
setEditOptions?: (options: {
|
||||
commitWhenLeave?: boolean;
|
||||
appendable?: boolean;
|
||||
insertable?: boolean;
|
||||
}) => void;
|
||||
setPasteOptions?: (options: { enableAppend?: boolean }) => void;
|
||||
};
|
||||
|
||||
/** 포커스가 그리드 밖으로 나갈 때 편집 중인 값을 자동 commit */
|
||||
function applyDefaultGridEditOptions(
|
||||
gridView: GridViewWithEditOptions | null | undefined,
|
||||
options?: { preventRowAppend?: boolean },
|
||||
) {
|
||||
gridView?.setEditOptions?.({ commitWhenLeave: true });
|
||||
gridView?.setEditOptions?.({
|
||||
commitWhenLeave: true,
|
||||
...(options?.preventRowAppend
|
||||
? { appendable: false, insertable: false }
|
||||
: {}),
|
||||
});
|
||||
if (options?.preventRowAppend) {
|
||||
gridView?.setPasteOptions?.({ enableAppend: false });
|
||||
}
|
||||
}
|
||||
|
||||
function isDateEditorColumn(column: {
|
||||
@@ -417,6 +437,7 @@ type GridViewWithCheckApi = {
|
||||
checkEvent?: boolean,
|
||||
) => void;
|
||||
setAllCheck?: (checked: boolean) => void;
|
||||
setCheckable?: (itemIndex: number, checkable: boolean) => void;
|
||||
};
|
||||
|
||||
function isRowCheckedFlag(value: unknown): boolean {
|
||||
@@ -832,6 +853,7 @@ const DataGrid = ({
|
||||
isExcelExport = true,
|
||||
fixedColumns,
|
||||
showHeaderCheckbox = false,
|
||||
checkableCallback,
|
||||
rowData,
|
||||
setRowData,
|
||||
getGridDataRef,
|
||||
@@ -853,6 +875,7 @@ const DataGrid = ({
|
||||
gridHeight = 55, // vh 단위
|
||||
headerHeight = 60,
|
||||
fitStyle = GridFitStyle.EVEN,
|
||||
preventRowAppend = true,
|
||||
}: DataGridProps) => {
|
||||
const { columns, columnLayout } = columnInfo;
|
||||
const fixedColumnNameSet = useMemo(
|
||||
@@ -886,6 +909,7 @@ const DataGrid = ({
|
||||
const onItemCheckedRef = useRef<typeof onItemChecked>(onItemChecked);
|
||||
const onItemAllCheckedRef =
|
||||
useRef<typeof onItemAllChecked>(onItemAllChecked);
|
||||
const checkableCallbackRef = useRef<typeof checkableCallback>(checkableCallback);
|
||||
const isSyncingChecksFromRowDataRef = useRef(false);
|
||||
const columnsFieldsSigRef = useRef("");
|
||||
const emptyCellHoverKeyRef = useRef("");
|
||||
@@ -907,6 +931,7 @@ const DataGrid = ({
|
||||
onScrollToBottomRef.current = onScrollToBottom;
|
||||
onItemCheckedRef.current = onItemChecked;
|
||||
onItemAllCheckedRef.current = onItemAllChecked;
|
||||
checkableCallbackRef.current = checkableCallback;
|
||||
onCellEditedRef.current = onCellEdited;
|
||||
onDataCellClickRef.current = onDataCellClick;
|
||||
|
||||
@@ -1331,6 +1356,11 @@ useEffect(() => {
|
||||
columnLayout,
|
||||
{ skipNonEditable: false },
|
||||
);
|
||||
const valueTypeByFieldName = new Map(
|
||||
columns
|
||||
.filter((c) => c.fieldName)
|
||||
.map((c) => [c.fieldName as string, c.valueType]),
|
||||
);
|
||||
|
||||
// 데이터 행 읽기
|
||||
const dataRows: Record<string, string | number>[] = [];
|
||||
@@ -1352,36 +1382,13 @@ useEffect(() => {
|
||||
];
|
||||
const fieldName = excelColumnFieldNames[colIndex];
|
||||
const allFieldName = excelColumnFieldNamesAll[colIndex];
|
||||
|
||||
let cellValue: string | number = "";
|
||||
if (
|
||||
cell &&
|
||||
cell.v !== undefined &&
|
||||
cell.v !== null
|
||||
) {
|
||||
// 엑셀 셀 타입이 숫자이거나 값이 숫자인 경우 숫자로 변환
|
||||
if (
|
||||
cell.t === "n" ||
|
||||
(typeof cell.v === "number" &&
|
||||
!isNaN(cell.v))
|
||||
) {
|
||||
cellValue = cell.v as number;
|
||||
} else {
|
||||
const stringValue = String(cell.v);
|
||||
// 문자열이지만 숫자로 변환 가능한 경우 숫자로 변환
|
||||
const numericValue = Number(
|
||||
stringValue.replace(/,/g, ""),
|
||||
);
|
||||
if (
|
||||
!isNaN(numericValue) &&
|
||||
stringValue.trim() !== ""
|
||||
) {
|
||||
cellValue = numericValue;
|
||||
} else {
|
||||
cellValue = stringValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
const typeFieldName = fieldName || allFieldName;
|
||||
const cellValue = parseExcelImportCellValue(
|
||||
cell,
|
||||
typeFieldName
|
||||
? valueTypeByFieldName.get(typeFieldName)
|
||||
: undefined,
|
||||
);
|
||||
|
||||
if (allFieldName === "admdstCd" && cellValue !== "") {
|
||||
rowAdmdstCd = cellValue;
|
||||
@@ -1467,7 +1474,9 @@ useEffect(() => {
|
||||
const scheduleFooterTask = (task: () => void, delayMs: number) => {
|
||||
footerTimerIds.push(setTimeout(task, delayMs));
|
||||
};
|
||||
applyDefaultGridEditOptions(gridView as GridViewWithEditOptions);
|
||||
applyDefaultGridEditOptions(gridView as GridViewWithEditOptions, {
|
||||
preventRowAppend,
|
||||
});
|
||||
|
||||
const columnsFieldsSig = columns.map((c) => c.fieldName).join("\u0001");
|
||||
if (columnsFieldsSig !== columnsFieldsSigRef.current) {
|
||||
@@ -1608,7 +1617,12 @@ useEffect(() => {
|
||||
|
||||
// 헤더 체크박스 표시 여부 설정
|
||||
gridView.setOptions({
|
||||
checkBar: { visible: showHeaderCheckbox, exclusive: false, syncHeadCheck: true },
|
||||
checkBar: {
|
||||
visible: showHeaderCheckbox,
|
||||
exclusive: false,
|
||||
syncHeadCheck: true,
|
||||
checkableOnly: true,
|
||||
},
|
||||
rowIndicator: { visible: false },
|
||||
});
|
||||
|
||||
@@ -1990,6 +2004,7 @@ useEffect(() => {
|
||||
fitStyle,
|
||||
enableSort,
|
||||
footerVerificationResult,
|
||||
preventRowAppend,
|
||||
]);
|
||||
|
||||
// 행·셀 클릭 이벤트 (검증 오류 툴팁은 hover만 — onShowTooltip / 빈 셀 오버레이)
|
||||
@@ -2271,6 +2286,17 @@ useEffect(() => {
|
||||
if (onItemChecked) {
|
||||
gridView.onItemChecked = (_grid, itemIndex, checked) => {
|
||||
if (isSyncingChecksFromRowDataRef.current) return;
|
||||
const row = rowDataRef.current[itemIndex];
|
||||
if (
|
||||
row &&
|
||||
checkableCallbackRef.current &&
|
||||
!checkableCallbackRef.current(row, itemIndex)
|
||||
) {
|
||||
if (checked) {
|
||||
(_grid as GridViewWithCheckApi).checkItem?.(itemIndex, false, false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
onItemCheckedRef.current?.(itemIndex, checked);
|
||||
};
|
||||
} else {
|
||||
@@ -2306,7 +2332,15 @@ useEffect(() => {
|
||||
gridView.checkAll?.(false, false, false, false);
|
||||
gridView.setAllCheck?.(false);
|
||||
rowData.forEach((row, itemIndex) => {
|
||||
if (!isRowCheckedFlag((row as Record<string, unknown>).__checked)) return;
|
||||
const checkable =
|
||||
checkableCallbackRef.current?.(row, itemIndex) ?? true;
|
||||
gridView.setCheckable?.(itemIndex, checkable);
|
||||
if (
|
||||
!checkable ||
|
||||
!isRowCheckedFlag((row as Record<string, unknown>).__checked)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
if (gridView.checkItem) {
|
||||
gridView.checkItem(itemIndex, true, false);
|
||||
return;
|
||||
@@ -2527,6 +2561,7 @@ useEffect(() => {
|
||||
const gridView = gridRef.current?.gridView ?? grid;
|
||||
applyDefaultGridEditOptions(
|
||||
gridView as GridViewWithEditOptions,
|
||||
{ preventRowAppend },
|
||||
);
|
||||
if (!gridView?.columnByName) return;
|
||||
setTimeout(() => {
|
||||
|
||||
@@ -136,7 +136,7 @@ const SearchForm = (props: SearchFormProps = {}) => {
|
||||
const { setMessage: alert } = useAlertStore((state) => state);
|
||||
const userInfo = useUserStore((state) => state.userInfo);
|
||||
const mergedProps = { ...defaultSearchFormProps, ...props };
|
||||
const instSeCd = userInfo?.instSeCd ?? "";
|
||||
const instSeCd = userInfo?.laeSeCd ?? "";
|
||||
const sidoSelectText =
|
||||
props.sidoSelectText && props.sidoSelectText.trim() !== ""
|
||||
? props.sidoSelectText
|
||||
|
||||
@@ -53,6 +53,7 @@ import {
|
||||
hasAdmdstCdColumn,
|
||||
isExcelImportAdmdstCdInvalid,
|
||||
mergeExcelImportWithExistingRows,
|
||||
parseExcelImportCellValue,
|
||||
prepareGridColumnsForExcelExport,
|
||||
releaseFixedOptionsForExcelExport,
|
||||
resolveColumnStyleName,
|
||||
@@ -611,6 +612,11 @@ const TabDataGrid = ({
|
||||
columnLayout,
|
||||
{ skipNonEditable: false },
|
||||
);
|
||||
const valueTypeByFieldName = new Map(
|
||||
columns
|
||||
.filter((c) => c.fieldName)
|
||||
.map((c) => [c.fieldName as string, c.valueType]),
|
||||
);
|
||||
|
||||
// 데이터 행 읽기
|
||||
const dataRows: Record<string, string | number>[] = [];
|
||||
@@ -625,23 +631,13 @@ const TabDataGrid = ({
|
||||
const cell = worksheet[XLSX.utils.encode_cell({ r: row, c: col })];
|
||||
const fieldName = excelColumnFieldNames[colIndex];
|
||||
const allFieldName = excelColumnFieldNamesAll[colIndex];
|
||||
|
||||
let cellValue: string | number = '';
|
||||
if (cell && cell.v !== undefined && cell.v !== null) {
|
||||
// 엑셀 셀 타입이 숫자이거나 값이 숫자인 경우 숫자로 변환
|
||||
if (cell.t === 'n' || (typeof cell.v === 'number' && !isNaN(cell.v))) {
|
||||
cellValue = cell.v as number;
|
||||
} else {
|
||||
const stringValue = String(cell.v);
|
||||
// 문자열이지만 숫자로 변환 가능한 경우 숫자로 변환
|
||||
const numericValue = Number(stringValue.replace(/,/g, ''));
|
||||
if (!isNaN(numericValue) && stringValue.trim() !== '') {
|
||||
cellValue = numericValue;
|
||||
} else {
|
||||
cellValue = stringValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
const typeFieldName = fieldName || allFieldName;
|
||||
const cellValue = parseExcelImportCellValue(
|
||||
cell,
|
||||
typeFieldName
|
||||
? valueTypeByFieldName.get(typeFieldName)
|
||||
: undefined,
|
||||
);
|
||||
|
||||
if (allFieldName === 'admdstCd' && cellValue !== '') {
|
||||
rowAdmdstCd = cellValue;
|
||||
|
||||
@@ -14,6 +14,10 @@ import {
|
||||
import type { RealGridReact } from "realgrid-react";
|
||||
|
||||
import { useAlertStore } from "@/shared/lib";
|
||||
import {
|
||||
isJeonnamGwangjuHeadquartersOperableRow,
|
||||
shouldRestrictFinanceVerificationToHeadquarters,
|
||||
} from "@/entities/statistics";
|
||||
import { statisticsApi } from "@/entities/statistics/api/statistics-service";
|
||||
import type { VerificationResultListRequest, VerificationResultReportItem } from "@/entities/statistics/model/statistics-interface";
|
||||
import {
|
||||
@@ -91,6 +95,14 @@ function verificationMthdCellStyle({
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function isResultRowOperable(
|
||||
restrictHeadquarters: boolean,
|
||||
row: { sewerBzmnCd?: string | number | null; admdstNm?: string | number | null },
|
||||
): boolean {
|
||||
if (!restrictHeadquarters) return true;
|
||||
return isJeonnamGwangjuHeadquartersOperableRow(row);
|
||||
}
|
||||
|
||||
/** History와 동일 + 구분(검증유형) + 편집 가능한 처리의견(예외사유) */
|
||||
const verificationSubmitResultColumnInfo: ColumnInfo = {
|
||||
columns: [
|
||||
@@ -171,6 +183,12 @@ export function VerificationResultDialog({
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [errorMessage, setErrorMessage] = useState<string | null>(null);
|
||||
|
||||
const restrictHeadquarters = shouldRestrictFinanceVerificationToHeadquarters(
|
||||
stableQueryContext?.statsCd,
|
||||
stableQueryContext?.sewerBzmnCd,
|
||||
stableQueryContext?.sggNm,
|
||||
);
|
||||
|
||||
const [rows, setRows] = useState<VerificationResultGridRow[]>([]);
|
||||
const [checkedIndices, setCheckedIndices] = useState<Set<number>>(() => new Set());
|
||||
|
||||
@@ -180,6 +198,11 @@ export function VerificationResultDialog({
|
||||
|
||||
const onPrcsOpnnExplnEdited = useCallback((params: CellEditedCallbackParams) => {
|
||||
if (params.fieldName !== "prcsOpnnExpln") return;
|
||||
const row = rows[params.itemIndex];
|
||||
if (row && !isResultRowOperable(restrictHeadquarters, row)) {
|
||||
setRowCheckByItemIndex(gridRef, params.itemIndex, false);
|
||||
return;
|
||||
}
|
||||
const text = String(params.newValue ?? "");
|
||||
const hasValue = text.trim().length > 0;
|
||||
setRowCheckByItemIndex(gridRef, params.itemIndex, hasValue);
|
||||
@@ -189,7 +212,7 @@ export function VerificationResultDialog({
|
||||
else next.delete(params.itemIndex);
|
||||
return next;
|
||||
});
|
||||
}, []);
|
||||
}, [restrictHeadquarters, rows]);
|
||||
|
||||
const resetState = useCallback(() => {
|
||||
setPageIndex(0);
|
||||
@@ -206,6 +229,7 @@ export function VerificationResultDialog({
|
||||
vrfcSn: item.vrfcSn,
|
||||
vrfcMthdCd,
|
||||
vrfcMthdNm: VRFC_MTHD_NAME_MAP[vrfcMthdCd] ?? item.vrfcMthdNm,
|
||||
sewerBzmnCd: item.sewerBzmnCd ?? "",
|
||||
ctpvNm: item.ctpvNm,
|
||||
admdstNm: item.admdstNm ?? item.sggNm ?? "-",
|
||||
fcltNm: item.fcltNm ?? "-",
|
||||
@@ -307,6 +331,11 @@ export function VerificationResultDialog({
|
||||
setCheckedIndices((prev) => {
|
||||
const next = new Set(prev);
|
||||
rows.forEach((row, itemIndex) => {
|
||||
if (!isResultRowOperable(restrictHeadquarters, row)) {
|
||||
setRowCheckByItemIndex(gridRef, itemIndex, false);
|
||||
next.delete(itemIndex);
|
||||
return;
|
||||
}
|
||||
const has = String(row.prcsOpnnExpln ?? "").trim().length > 0;
|
||||
setRowCheckByItemIndex(gridRef, itemIndex, has);
|
||||
if (has) next.add(itemIndex);
|
||||
@@ -315,7 +344,7 @@ export function VerificationResultDialog({
|
||||
});
|
||||
});
|
||||
return () => cancelAnimationFrame(id);
|
||||
}, [rows, loading]);
|
||||
}, [rows, loading, restrictHeadquarters]);
|
||||
|
||||
const handleExceptionSubmitClick = useCallback(async () => {
|
||||
if (checkedIndices.size === 0) {
|
||||
@@ -326,6 +355,11 @@ export function VerificationResultDialog({
|
||||
const gridRows = getGridDataRef.current?.() ?? [];
|
||||
const payload: VerificationExceptionSubmitItem[] = [];
|
||||
for (const idx of checkedIndices) {
|
||||
const row = rows[idx] ?? gridRows[idx];
|
||||
if (row && !isResultRowOperable(restrictHeadquarters, row)) {
|
||||
alert("전남광주통합특별시는 본청 데이터만 조작할 수 있습니다.");
|
||||
return;
|
||||
}
|
||||
const prcsOpnnExpln = String(gridRows[idx]?.prcsOpnnExpln ?? "").trim();
|
||||
if (!prcsOpnnExpln) {
|
||||
alert("예외 제출 사유를 작성해주세요.");
|
||||
@@ -373,6 +407,7 @@ export function VerificationResultDialog({
|
||||
rows,
|
||||
onExceptionSubmitted,
|
||||
onOpenChange,
|
||||
restrictHeadquarters,
|
||||
stableQueryContext,
|
||||
]);
|
||||
|
||||
@@ -419,9 +454,30 @@ export function VerificationResultDialog({
|
||||
getGridRef={gridRef}
|
||||
getGridDataRef={getGridDataRef}
|
||||
onCellEdited={onPrcsOpnnExplnEdited}
|
||||
cellStyleCallback={verificationMthdCellStyle}
|
||||
cellStyleCallback={(params) => {
|
||||
const mthdStyle = verificationMthdCellStyle(params);
|
||||
if (!isResultRowOperable(restrictHeadquarters, params.row)) {
|
||||
const mthdName =
|
||||
typeof mthdStyle === "string" ? mthdStyle : undefined;
|
||||
return {
|
||||
styleName: ["rg-cell-readonly", mthdName]
|
||||
.filter(Boolean)
|
||||
.join(" "),
|
||||
editable: false,
|
||||
readOnly: true,
|
||||
};
|
||||
}
|
||||
return mthdStyle;
|
||||
}}
|
||||
checkableCallback={(row) =>
|
||||
isResultRowOperable(restrictHeadquarters, row)
|
||||
}
|
||||
cellTooltipCallback={cellContentTooltip}
|
||||
onItemChecked={(itemIndex, checked) => {
|
||||
const row = rows[itemIndex];
|
||||
if (checked && row && !isResultRowOperable(restrictHeadquarters, row)) {
|
||||
return;
|
||||
}
|
||||
setCheckedIndices((prev) => {
|
||||
const next = new Set(prev);
|
||||
if (checked) next.add(itemIndex);
|
||||
@@ -431,7 +487,15 @@ export function VerificationResultDialog({
|
||||
}}
|
||||
onItemAllChecked={(checked) => {
|
||||
setCheckedIndices(
|
||||
checked ? new Set(rows.map((_, i) => i)) : new Set(),
|
||||
checked
|
||||
? new Set(
|
||||
rows.flatMap((row, i) =>
|
||||
isResultRowOperable(restrictHeadquarters, row)
|
||||
? [i]
|
||||
: [],
|
||||
),
|
||||
)
|
||||
: new Set(),
|
||||
);
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -14,6 +14,10 @@ import {
|
||||
import type { RealGridReact } from "realgrid-react";
|
||||
|
||||
import { useAlertStore } from "@/shared/lib";
|
||||
import {
|
||||
isJeonnamGwangjuHeadquartersOperableRow,
|
||||
shouldRestrictFinanceVerificationToHeadquarters,
|
||||
} from "@/entities/statistics";
|
||||
import { statisticsApi } from "@/entities/statistics/api/statistics-service";
|
||||
import type { VerificationResultListRequest, VerificationResultReportItem } from "@/entities/statistics/model/statistics-interface";
|
||||
import {
|
||||
@@ -137,6 +141,14 @@ function verificationPrcsYnNmCellStyle({ fieldName, row }: CellStyleCallbackPara
|
||||
return "rg-cell-vrf-prcs-ok";
|
||||
}
|
||||
|
||||
function isHistoryRowOperable(
|
||||
restrictHeadquarters: boolean,
|
||||
row: { sewerBzmnCd?: string | number | null; admdstNm?: string | number | null },
|
||||
): boolean {
|
||||
if (!restrictHeadquarters) return true;
|
||||
return isJeonnamGwangjuHeadquartersOperableRow(row);
|
||||
}
|
||||
|
||||
const verificationResultColumnInfo: ColumnInfo = {
|
||||
columns: [
|
||||
{ name: "ctpvNm", fieldName: "ctpvNm", header: { text: "시도" }, editable: false },
|
||||
@@ -227,6 +239,12 @@ export function VerificationResultHistoryDialog({
|
||||
const [resetSubmitting, setResetSubmitting] = useState(false);
|
||||
const [checkedVrfcByTab, setCheckedVrfcByTab] = useState(createEmptyCheckedVrfcByTab);
|
||||
|
||||
const restrictHeadquarters = shouldRestrictFinanceVerificationToHeadquarters(
|
||||
stableQueryContext?.statsCd,
|
||||
stableQueryContext?.sewerBzmnCd,
|
||||
stableQueryContext?.sggNm,
|
||||
);
|
||||
|
||||
const nvGridRef = useRef<RealGridReact | null>(null);
|
||||
const imrGridRef = useRef<RealGridReact | null>(null);
|
||||
const hbGridRef = useRef<RealGridReact | null>(null);
|
||||
@@ -375,10 +393,12 @@ export function VerificationResultHistoryDialog({
|
||||
(entries: VerificationResultReportItem[], checkedMap: Map<number, string>): VerificationResultGridRow[] =>
|
||||
entries.map((item) => {
|
||||
const vrfcSn = Number(item.vrfcSn);
|
||||
const isChecked = Number.isFinite(vrfcSn) && checkedMap.has(vrfcSn);
|
||||
const operable = isHistoryRowOperable(restrictHeadquarters, item);
|
||||
const isChecked = operable && Number.isFinite(vrfcSn) && checkedMap.has(vrfcSn);
|
||||
return {
|
||||
vrfcSn: item.vrfcSn,
|
||||
__checked: isChecked ? 1 : 0,
|
||||
sewerBzmnCd: item.sewerBzmnCd ?? "",
|
||||
ctpvNm: item.ctpvNm ?? "-",
|
||||
admdstNm: item.admdstNm ?? item.sggNm ?? "-",
|
||||
fcltNm: item.fcltNm ?? "-",
|
||||
@@ -395,7 +415,7 @@ export function VerificationResultHistoryDialog({
|
||||
mdfcnDt: (item.mdfcnDt ?? "").slice(0, 16),
|
||||
};
|
||||
}),
|
||||
[],
|
||||
[restrictHeadquarters],
|
||||
);
|
||||
|
||||
/** 페이지(entries) 변경 시에만 __checked 반영 — 클릭마다 rowData를 바꾸지 않아 체크 UI가 안정적 */
|
||||
@@ -432,6 +452,13 @@ export function VerificationResultHistoryDialog({
|
||||
return;
|
||||
}
|
||||
setCheckedVrfcByTab((prev) => ({ ...prev, [tab]: syncedMap }));
|
||||
for (const vrfcSn of syncedMap.keys()) {
|
||||
const onPage = currentEntries.find((e) => Number(e.vrfcSn) === vrfcSn);
|
||||
if (onPage && !isHistoryRowOperable(restrictHeadquarters, onPage)) {
|
||||
alert("전남광주통합특별시는 본청 데이터만 조작할 수 있습니다.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
const vrfcSnList = Array.from(syncedMap.keys());
|
||||
let mdfrUuid: string;
|
||||
try {
|
||||
@@ -477,6 +504,7 @@ export function VerificationResultHistoryDialog({
|
||||
entriesByTab,
|
||||
loadTabPage,
|
||||
onExceptionResetSubmitted,
|
||||
restrictHeadquarters,
|
||||
stableQueryContext,
|
||||
tabPages,
|
||||
]);
|
||||
@@ -487,6 +515,18 @@ export function VerificationResultHistoryDialog({
|
||||
const { pageIndex, pageCount } = tabPages[tab];
|
||||
const loading = loadingByTab[tab];
|
||||
const gridRef = gridRefByTab[tab];
|
||||
const historyCellStyle = (params: CellStyleCallbackParams) => {
|
||||
const statusStyle = verificationPrcsYnNmCellStyle(params);
|
||||
if (!isHistoryRowOperable(restrictHeadquarters, params.row)) {
|
||||
const statusName = typeof statusStyle === "string" ? statusStyle : undefined;
|
||||
return {
|
||||
styleName: ["rg-cell-readonly", statusName].filter(Boolean).join(" "),
|
||||
editable: false,
|
||||
readOnly: true,
|
||||
};
|
||||
}
|
||||
return statusStyle;
|
||||
};
|
||||
|
||||
if (!loading && rows.length === 0) {
|
||||
return <p className="p-6 text-center text-[1.3rem] text-muted-foreground h-[65vh] flex justify-center items-center">{emptyMessage}</p>;
|
||||
@@ -504,13 +544,18 @@ export function VerificationResultHistoryDialog({
|
||||
showHeaderCheckbox
|
||||
enableSort={false}
|
||||
getGridRef={gridRef}
|
||||
cellStyleCallback={verificationPrcsYnNmCellStyle}
|
||||
cellStyleCallback={historyCellStyle}
|
||||
checkableCallback={(row) => isHistoryRowOperable(restrictHeadquarters, row)}
|
||||
cellTooltipCallback={cellContentTooltip}
|
||||
onItemChecked={(itemIndex, checked) => {
|
||||
const entry = entries[itemIndex];
|
||||
if (!entry) return;
|
||||
const vrfcSn = Number(entry.vrfcSn);
|
||||
if (!Number.isFinite(vrfcSn)) return;
|
||||
if (checked && !isHistoryRowOperable(restrictHeadquarters, entry)) {
|
||||
uncheckGridRow(gridRef, itemIndex);
|
||||
return;
|
||||
}
|
||||
if (checked && !canExceptionReset(entry.vrfcSttsCd)) {
|
||||
alert(EXCEPTION_RESET_ONLY_PRCS_YN_2_MESSAGE);
|
||||
uncheckGridRow(gridRef, itemIndex);
|
||||
@@ -530,6 +575,10 @@ export function VerificationResultHistoryDialog({
|
||||
map.delete(vrfcSn);
|
||||
return;
|
||||
}
|
||||
if (!isHistoryRowOperable(restrictHeadquarters, entry)) {
|
||||
uncheckGridRow(gridRef, itemIndex);
|
||||
return;
|
||||
}
|
||||
if (canExceptionReset(entry.vrfcSttsCd)) {
|
||||
map.set(vrfcSn, String(entry.vrfcSttsCd ?? ""));
|
||||
} else {
|
||||
|
||||
@@ -16,10 +16,12 @@ import { useAlertStore, useGlobalProgressStore, useStatisticsInputToolbarGroupGa
|
||||
import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation";
|
||||
import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation";
|
||||
import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
|
||||
import { filterSggOptionsBySearchGugun } from "@/components/util/input/filter-sgg-options-by-search";
|
||||
import { nullableTrimmedString } from "@/components/util/input/nullableString";
|
||||
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";
|
||||
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
|
||||
import {
|
||||
EXCRETA_TREATMENT_FACILITY_STATS_CD,
|
||||
type ExcretaTreatmentFacilityItem,
|
||||
@@ -75,7 +77,11 @@ import { toGridRows } from "@/components/util/grid/gridFunction";
|
||||
import { formatCompactYmdForGrid, toCompactYmdOrNull } from "@/components/util/grid/ymdFormat";
|
||||
import { toExcelExportSearchContextFromSearchForm } from "@/components/util/gridExcelExport";
|
||||
import { isVerificationFailedFromCommonInfo } from "@/components/util/input/verification-failed-flag";
|
||||
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display";
|
||||
import {
|
||||
formatVerificationTooltip,
|
||||
normalizeVerificationResultMap,
|
||||
type VerificationResultLikeMap,
|
||||
} from "@/components/util/input/verification-result-display";
|
||||
import { useAdminStore } from "@/store/admin-store";
|
||||
import { useTabStore } from "@/store/tab-store";
|
||||
|
||||
@@ -139,8 +145,7 @@ function computeTabToolbarSnapshot(
|
||||
(hasRowData || treatAsSearched) &&
|
||||
(showSaveInToolbar ||
|
||||
showEnterableToolbarButtons ||
|
||||
showSubmittedInInputPeriodToolbar ||
|
||||
(isSubmitted && isAdminInfo));
|
||||
showSubmittedInInputPeriodToolbar);
|
||||
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
|
||||
}
|
||||
|
||||
@@ -207,7 +212,7 @@ function mapExcretaTreatmentFacilityListToGridRows(
|
||||
},
|
||||
])[0] as GridRowWithVerification;
|
||||
if (item.verificationResult) {
|
||||
row.verificationResult = item.verificationResult;
|
||||
row.verificationResult = normalizeVerificationResultMap(item.verificationResult);
|
||||
}
|
||||
return row;
|
||||
});
|
||||
@@ -439,7 +444,11 @@ const ExcretaTreatmentFacilityInp = () => {
|
||||
return { ...col, editable: false as const };
|
||||
}
|
||||
if (col.fieldName === "sggNm" && enterable) {
|
||||
return buildSggNmColumn(col, true, sggOptions);
|
||||
return buildSggNmColumn(
|
||||
col,
|
||||
true,
|
||||
filterSggOptionsBySearchGugun(sggOptions, lastSearchedValues?.gugun),
|
||||
);
|
||||
}
|
||||
return col;
|
||||
})
|
||||
@@ -452,7 +461,7 @@ const ExcretaTreatmentFacilityInp = () => {
|
||||
columns,
|
||||
columnLayout: ExcretaTreatFactInpColumn.columnLayout ?? [],
|
||||
};
|
||||
}, [statusInfo, inputPeriodEnterable, isAdminInfo, sggOptions, columnGuidesByEngCol]);
|
||||
}, [statusInfo, inputPeriodEnterable, isAdminInfo, sggOptions, lastSearchedValues?.gugun, columnGuidesByEngCol]);
|
||||
|
||||
const canEditGrid =
|
||||
(computeTabEnterable(statusInfo, inputPeriodEnterable) || isAdminInfo) && inputPeriodEnterable;
|
||||
@@ -502,7 +511,9 @@ const ExcretaTreatmentFacilityInp = () => {
|
||||
setStatusInfo(nextStatusInfo);
|
||||
setStatsCd(commonInfo.statsCd);
|
||||
setIsVerificationFailed(isVerificationFailedFromCommonInfo(commonInfo));
|
||||
setFooterVerificationResult(commonInfo.verificationResult ?? null);
|
||||
setFooterVerificationResult(
|
||||
normalizeVerificationResultMap(commonInfo.verificationResult) ?? null,
|
||||
);
|
||||
if (overrides?.mode !== "PRE") {
|
||||
setIsNotApplicable(gridRows.length === 0);
|
||||
} else if (gridRows.length > 0) {
|
||||
@@ -813,7 +824,13 @@ const ExcretaTreatmentFacilityInp = () => {
|
||||
};
|
||||
|
||||
try {
|
||||
const imrResponse = await statisticsApi.callImrService(imrParam);
|
||||
const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
|
||||
statsYr: lastSearchedValues.year ?? "",
|
||||
statsCd: statsCdForSubmit,
|
||||
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
|
||||
rollbackStatusCode: statusInfo?.lclgvSbmsnSttsCd ?? "",
|
||||
mdfrUuid: userInfo.userUnqId,
|
||||
});
|
||||
if (imrResponse.job_id) {
|
||||
await waitForImrJobCompleted(
|
||||
imrResponse.job_id,
|
||||
@@ -952,19 +969,7 @@ const ExcretaTreatmentFacilityInp = () => {
|
||||
if (!verification) return;
|
||||
const errors = verification[fieldName];
|
||||
if (Array.isArray(errors) && errors.length > 0) {
|
||||
return errors
|
||||
.map((e) => {
|
||||
const prefix =
|
||||
e.vrfcCd === "IMR"
|
||||
? "시계열 검증 - "
|
||||
: e.vrfcCd === "NV"
|
||||
? "일반검증 - "
|
||||
: "모집단 검증 -";
|
||||
return `${prefix}${e.rsnExpln}
|
||||
(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
|
||||
})
|
||||
.filter(Boolean)
|
||||
.join("\n");
|
||||
return formatVerificationTooltip(errors);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1043,7 +1048,7 @@ const ExcretaTreatmentFacilityInp = () => {
|
||||
{submitOk && <SubmitButton submitFunc={submitFunc} />}
|
||||
</>
|
||||
)}
|
||||
{statusInfo?.lclgvSbmsnSttsCd === "2" && submitOk && (
|
||||
{statusInfo?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
|
||||
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
|
||||
)}
|
||||
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
|
||||
|
||||
@@ -9,6 +9,7 @@ import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
|
||||
import { statisticsInputPrivateSewageFacilityApi } from "@/entities/statistics/api/input/statistics-input-private-sewage-facility-service";
|
||||
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
|
||||
import { statisticsApi } from "@/entities/statistics/api/statistics-service";
|
||||
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
|
||||
import type {
|
||||
PrivateSewageDesigStatusItem,
|
||||
PrivateSewageDesigStatusSaveItem,
|
||||
@@ -68,7 +69,11 @@ import {
|
||||
patchFooterVerificationByTab,
|
||||
patchVerificationFailedByTab,
|
||||
} from "@/components/util/input/verification-failed-flag";
|
||||
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display";
|
||||
import {
|
||||
formatVerificationTooltip,
|
||||
normalizeVerificationResultMap,
|
||||
type VerificationResultLikeMap,
|
||||
} from "@/components/util/input/verification-result-display";
|
||||
import { nullableTrimmedString } from "@/components/util/input/nullableString";
|
||||
import { useAdminStore } from "@/store/admin-store";
|
||||
import { useTabStore } from "@/store/tab-store";
|
||||
@@ -156,8 +161,7 @@ function computeTabToolbarSnapshot(
|
||||
(hasRowData || treatAsSearched) &&
|
||||
(showSaveInToolbar ||
|
||||
showEnterableToolbarButtons ||
|
||||
showSubmittedInInputPeriodToolbar ||
|
||||
(isSubmitted && isAdminInfo));
|
||||
showSubmittedInInputPeriodToolbar);
|
||||
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
|
||||
}
|
||||
|
||||
@@ -175,7 +179,9 @@ function mapRegionalListToGridRows<
|
||||
return filterBySelectedAdmdstCd(list, sidoListRef.current, values).map((item) => {
|
||||
const { verificationResult, ...rest } = item;
|
||||
const row = toGridRows([{ ctpvNm, ...rest }])[0] as GridRowWithVerification;
|
||||
if (verificationResult) row.verificationResult = verificationResult;
|
||||
if (verificationResult) {
|
||||
row.verificationResult = normalizeVerificationResultMap(verificationResult);
|
||||
}
|
||||
return row;
|
||||
});
|
||||
}
|
||||
@@ -888,7 +894,13 @@ const PrivateSewageFacilityInp = () => {
|
||||
};
|
||||
|
||||
try {
|
||||
const imrResponse = await statisticsApi.callImrService(imrParam);
|
||||
const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
|
||||
statsYr: lastSearchedValues.year ?? "",
|
||||
statsCd: statsCdForTab,
|
||||
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
|
||||
rollbackStatusCode: activeTabStatus?.lclgvSbmsnSttsCd ?? "",
|
||||
mdfrUuid: userInfo.userUnqId,
|
||||
});
|
||||
if (imrResponse.job_id) {
|
||||
await waitForImrJobCompleted(
|
||||
imrResponse.job_id,
|
||||
@@ -1144,18 +1156,7 @@ const PrivateSewageFacilityInp = () => {
|
||||
if (!verification) return;
|
||||
const errors = verification[fieldName];
|
||||
if (Array.isArray(errors) && errors.length > 0) {
|
||||
return errors
|
||||
.map((e) => {
|
||||
const prefix =
|
||||
e.vrfcCd === "IMR"
|
||||
? "시계열 검증 - "
|
||||
: e.vrfcCd === "NV"
|
||||
? "일반검증 - "
|
||||
: "모집단 검증 - ";
|
||||
return `${prefix}${e.rsnExpln}(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
|
||||
})
|
||||
.filter(Boolean)
|
||||
.join("\n");
|
||||
return formatVerificationTooltip(errors);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1198,7 +1199,7 @@ const PrivateSewageFacilityInp = () => {
|
||||
{submitOk && <SubmitButton submitFunc={submitFunc} />}
|
||||
</>
|
||||
)}
|
||||
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && (
|
||||
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
|
||||
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
|
||||
)}
|
||||
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
|
||||
|
||||
@@ -8,6 +8,7 @@ import { useStatisticsInputPendingNavigation } from '@/shared/lib/use-statistics
|
||||
import { statisticsInputSewSupplyRateApi } from '@/entities/statistics/api/input/statistics-input-sew-supply-rate-service';
|
||||
import { statisticsInputPublicSewageFacilityApiService } from '@/entities/statistics/api/input/statistics-public-sewage-facility-input-service';
|
||||
import { statisticsApi } from '@/entities/statistics/api/statistics-service';
|
||||
import { callImrServiceWithRollbackOnFailure } from '@/components/util/input/call-imr-with-rollback';
|
||||
import type {
|
||||
PublicSewageFacilityRequestParams,
|
||||
PublicSewageFacilitySaveItem,
|
||||
@@ -52,7 +53,11 @@ import { fetchColumnGuidesRecord } from '@/components/util/grid/columnGuides';
|
||||
import { toGridRows } from '@/components/util/grid/gridFunction';
|
||||
import { toExcelExportSearchContextFromSearchForm } from "@/components/util/gridExcelExport";
|
||||
import { patchFooterVerificationByTab,patchVerificationFailedByTab } from '@/components/util/input/verification-failed-flag';
|
||||
import type { VerificationResultLikeMap } from '@/components/util/input/verification-result-display';
|
||||
import {
|
||||
formatVerificationTooltip,
|
||||
withNormalizedVerificationResult,
|
||||
type VerificationResultLikeMap,
|
||||
} from '@/components/util/input/verification-result-display';
|
||||
import { nullableTrimmedString } from '@/components/util/input/nullableString';
|
||||
import { useAdminStore } from '@/store/admin-store';
|
||||
import { useTabStore } from '@/store/tab-store';
|
||||
@@ -116,8 +121,7 @@ function computeTabToolbarSnapshot(
|
||||
(hasRowData || treatAsSearched) &&
|
||||
(showSaveInToolbar ||
|
||||
showEnterableToolbarButtons ||
|
||||
showSubmittedInInputPeriodToolbar ||
|
||||
(isSubmitted && isAdminInfo));
|
||||
showSubmittedInInputPeriodToolbar);
|
||||
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
|
||||
}
|
||||
|
||||
@@ -306,7 +310,6 @@ const PublicSewageFacilityInp = () => {
|
||||
swtrmtFcltCd: nullableTrimmedString(d.swtrmtFcltCd),
|
||||
swtrmtFcltNm: nullableTrimmedString(d.swtrmtFcltNm),
|
||||
fcltSn: nullableTrimmedString(d.fcltSn),
|
||||
fcltPstnCn: nullableTrimmedString(d.fcltPstnCn),
|
||||
inflwSwagePhysQnt: toNumber(d.inflwSwagePhysQnt),
|
||||
inflwSwageBoilQnt: toNumber(d.inflwSwageBoilQnt),
|
||||
inflwSwageAltdQnt: toNumber(d.inflwSwageAltdQnt),
|
||||
@@ -438,7 +441,13 @@ const PublicSewageFacilityInp = () => {
|
||||
};
|
||||
|
||||
try {
|
||||
const imrResponse = await statisticsApi.callImrService(imrParam);
|
||||
const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
|
||||
statsYr: lastSearchedValues.year ?? '',
|
||||
statsCd: statsCdForTab,
|
||||
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? '',
|
||||
rollbackStatusCode: activeTabStatus?.lclgvSbmsnSttsCd ?? '',
|
||||
mdfrUuid: userInfo.userUnqId,
|
||||
});
|
||||
if (imrResponse.job_id) {
|
||||
await waitForImrJobCompleted(
|
||||
imrResponse.job_id,
|
||||
@@ -789,11 +798,13 @@ const PublicSewageFacilityInp = () => {
|
||||
sidoListRef.current,
|
||||
searchContext,
|
||||
);
|
||||
const convertedData = list.map((item) => ({
|
||||
ctpvNm: commonInfo.ctpvNm,
|
||||
...item,
|
||||
rmrk: item.rmrk ?? null,
|
||||
}));
|
||||
const convertedData = list.map((item) =>
|
||||
withNormalizedVerificationResult({
|
||||
ctpvNm: commonInfo.ctpvNm,
|
||||
...item,
|
||||
rmrk: item.rmrk ?? null,
|
||||
}),
|
||||
);
|
||||
|
||||
if (list.length === 0) {
|
||||
setShowIsNotApplicable(true);
|
||||
@@ -1323,7 +1334,7 @@ const PublicSewageFacilityInp = () => {
|
||||
{submitOk && <SubmitButton submitFunc={submitFunc} />}
|
||||
</>
|
||||
)}
|
||||
{!isMainFacilityTab && activeTabStatus?.lclgvSbmsnSttsCd === '2' && submitOk && (
|
||||
{!isMainFacilityTab && activeTabStatus?.lclgvSbmsnSttsCd === '2' && submitOk && inputPeriodEnterable && (
|
||||
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
|
||||
)}
|
||||
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
|
||||
@@ -1575,17 +1586,7 @@ const PublicSewageFacilityInp = () => {
|
||||
if (!verification) return;
|
||||
const errors = verification[fieldName];
|
||||
if (Array.isArray(errors) && errors.length > 0) {
|
||||
return errors
|
||||
.map((e) => {
|
||||
const prefix =
|
||||
e.vrfcCd === "IMR" ? "시계열 검증 - " : (e.vrfcCd === "NV" ? "일반검증 - " : "모집단 검증 - ");
|
||||
const comp = e.cmprCn ?? "";
|
||||
const now = e.nowCn ?? "";
|
||||
return `${prefix}${e.rsnExpln}
|
||||
(검증 기준값: ${comp} / 현재 입력값: ${now})`;
|
||||
})
|
||||
.filter(Boolean)
|
||||
.join("\n");
|
||||
return formatVerificationTooltip(errors);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -16,10 +16,12 @@ import { useAlertStore, useGlobalProgressStore, useStatisticsInputToolbarGroupGa
|
||||
import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation";
|
||||
import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation";
|
||||
import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
|
||||
import { filterSggOptionsBySearchGugun } from "@/components/util/input/filter-sgg-options-by-search";
|
||||
import { nullableTrimmedString } from "@/components/util/input/nullableString";
|
||||
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";
|
||||
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
|
||||
import {
|
||||
PUMPING_STATION_STATS_CD,
|
||||
type PumpingStationItem,
|
||||
@@ -75,7 +77,11 @@ import { toGridRows } from "@/components/util/grid/gridFunction";
|
||||
import { formatCompactYmdForGrid, toCompactYmdOrNull } from "@/components/util/grid/ymdFormat";
|
||||
import { toExcelExportSearchContextFromSearchForm } from "@/components/util/gridExcelExport";
|
||||
import { isVerificationFailedFromCommonInfo } from "@/components/util/input/verification-failed-flag";
|
||||
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display";
|
||||
import {
|
||||
formatVerificationTooltip,
|
||||
normalizeVerificationResultMap,
|
||||
type VerificationResultLikeMap,
|
||||
} from "@/components/util/input/verification-result-display";
|
||||
import { useAdminStore } from "@/store/admin-store";
|
||||
import { useTabStore } from "@/store/tab-store";
|
||||
|
||||
@@ -139,8 +145,7 @@ function computeTabToolbarSnapshot(
|
||||
(hasRowData || treatAsSearched) &&
|
||||
(showSaveInToolbar ||
|
||||
showEnterableToolbarButtons ||
|
||||
showSubmittedInInputPeriodToolbar ||
|
||||
(isSubmitted && isAdminInfo));
|
||||
showSubmittedInInputPeriodToolbar);
|
||||
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
|
||||
}
|
||||
|
||||
@@ -206,7 +211,7 @@ function mapPumpingStationListToGridRows(
|
||||
},
|
||||
])[0] as GridRowWithVerification;
|
||||
if (item.verificationResult) {
|
||||
row.verificationResult = item.verificationResult;
|
||||
row.verificationResult = normalizeVerificationResultMap(item.verificationResult);
|
||||
}
|
||||
return row;
|
||||
});
|
||||
@@ -433,7 +438,11 @@ const PumpingStationInp = () => {
|
||||
return { ...col, editable: false as const };
|
||||
}
|
||||
if (col.fieldName === "sggNm" && enterable) {
|
||||
return buildSggNmColumn(col, true, sggOptions);
|
||||
return buildSggNmColumn(
|
||||
col,
|
||||
true,
|
||||
filterSggOptionsBySearchGugun(sggOptions, lastSearchedValues?.gugun),
|
||||
);
|
||||
}
|
||||
return col;
|
||||
})
|
||||
@@ -446,7 +455,7 @@ const PumpingStationInp = () => {
|
||||
columns,
|
||||
columnLayout: PumpingStationInpColumn.columnLayout ?? [],
|
||||
};
|
||||
}, [statusInfo, inputPeriodEnterable, isAdminInfo, sggOptions, columnGuidesByEngCol]);
|
||||
}, [statusInfo, inputPeriodEnterable, isAdminInfo, sggOptions, lastSearchedValues?.gugun, columnGuidesByEngCol]);
|
||||
|
||||
const canEditGrid =
|
||||
(computeTabEnterable(statusInfo, inputPeriodEnterable) || isAdminInfo) && inputPeriodEnterable;
|
||||
@@ -493,7 +502,9 @@ const PumpingStationInp = () => {
|
||||
setStatusInfo(nextStatusInfo);
|
||||
setStatsCd(commonInfo.statsCd);
|
||||
setIsVerificationFailed(isVerificationFailedFromCommonInfo(commonInfo));
|
||||
setFooterVerificationResult(commonInfo.verificationResult ?? null);
|
||||
setFooterVerificationResult(
|
||||
normalizeVerificationResultMap(commonInfo.verificationResult) ?? null,
|
||||
);
|
||||
if (overrides?.mode !== "PRE") {
|
||||
setIsNotApplicable(gridRows.length === 0);
|
||||
} else if (gridRows.length > 0) {
|
||||
@@ -796,7 +807,13 @@ const PumpingStationInp = () => {
|
||||
};
|
||||
|
||||
try {
|
||||
const imrResponse = await statisticsApi.callImrService(imrParam);
|
||||
const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
|
||||
statsYr: lastSearchedValues.year ?? "",
|
||||
statsCd: statsCdForSubmit,
|
||||
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
|
||||
rollbackStatusCode: statusInfo?.lclgvSbmsnSttsCd ?? "",
|
||||
mdfrUuid: userInfo.userUnqId,
|
||||
});
|
||||
if (imrResponse.job_id) {
|
||||
await waitForImrJobCompleted(
|
||||
imrResponse.job_id,
|
||||
@@ -935,19 +952,7 @@ const PumpingStationInp = () => {
|
||||
if (!verification) return;
|
||||
const errors = verification[fieldName];
|
||||
if (Array.isArray(errors) && errors.length > 0) {
|
||||
return errors
|
||||
.map((e) => {
|
||||
const prefix =
|
||||
e.vrfcCd === "IMR"
|
||||
? "시계열 검증 - "
|
||||
: e.vrfcCd === "NV"
|
||||
? "일반검증 - "
|
||||
: "모집단 검증 -";
|
||||
return `${prefix}${e.rsnExpln}
|
||||
(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
|
||||
})
|
||||
.filter(Boolean)
|
||||
.join("\n");
|
||||
return formatVerificationTooltip(errors);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1026,7 +1031,7 @@ const PumpingStationInp = () => {
|
||||
{submitOk && <SubmitButton submitFunc={submitFunc} />}
|
||||
</>
|
||||
)}
|
||||
{statusInfo?.lclgvSbmsnSttsCd === "2" && submitOk && (
|
||||
{statusInfo?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
|
||||
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
|
||||
)}
|
||||
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
|
||||
|
||||
@@ -5,14 +5,16 @@ import { useConfirm } from "@frontend-opensource/use-react-hooks";
|
||||
import { ValueType } from "realgrid";
|
||||
import type { RealGridReact } from "realgrid-react";
|
||||
|
||||
import { useAlertStore, useGlobalProgressStore, useStatisticsInputToolbarGroupGate, useSearchConditionSidoList } from "@/shared/lib";
|
||||
import { useAlertStore, useGlobalProgressStore, useStatisticsInputToolbarGroupGate, useSearchConditionSidoList, useUserStore } from "@/shared/lib";
|
||||
import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation";
|
||||
import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation";
|
||||
import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
|
||||
import { filterSggOptionsBySearchGugun } from "@/components/util/input/filter-sgg-options-by-search";
|
||||
import { nullableTrimmedString } from "@/components/util/input/nullableString";
|
||||
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
|
||||
import { statisticsInputSewageExcretaRelatedApi } from "@/entities/statistics/api/input/statistics-input-sewage-excreta-related-service";
|
||||
import { statisticsApi } from "@/entities/statistics/api/statistics-service";
|
||||
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
|
||||
import type {
|
||||
ExcretaRelatedIndustrySaveItem,
|
||||
PrivateSewageTreatRelatedIndustrySaveItem,
|
||||
@@ -40,7 +42,12 @@ import type {
|
||||
import {
|
||||
filterBySelectedAdmdstCd,
|
||||
isGugunOkForToolbar,
|
||||
isJeonnamGwangjuSggNotApplicableSearch,
|
||||
isJeonnamGwangjuSidoAllSearch,
|
||||
isJeonnamGwangjuSidoAllToolbarException,
|
||||
isSubmitOkForToolbar,
|
||||
JEONNAM_GWANGJU_HEADQUARTERS_ADMDST_NM,
|
||||
JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE,
|
||||
resolveNoApplicableForRequest,
|
||||
toInputSearchRegion,
|
||||
} from "@/entities/statistics";
|
||||
@@ -84,7 +91,11 @@ import {
|
||||
patchFooterVerificationByTab,
|
||||
patchVerificationFailedByTab,
|
||||
} from "@/components/util/input/verification-failed-flag";
|
||||
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display";
|
||||
import {
|
||||
formatVerificationTooltip,
|
||||
normalizeVerificationResultMap,
|
||||
type VerificationResultLikeMap,
|
||||
} from "@/components/util/input/verification-result-display";
|
||||
import { useAdminStore } from "@/store/admin-store";
|
||||
import { useTabStore } from "@/store/tab-store";
|
||||
|
||||
@@ -168,12 +179,84 @@ const computeTabEnterable = (
|
||||
};
|
||||
|
||||
const sidoListRef: { current: Sido[] } = { current: [] };
|
||||
const relatedToolbarUserIdRef: { current: string } = { current: "" };
|
||||
|
||||
function buildGugunOkForToolbar(values: SearchFormValues | null): boolean {
|
||||
function isJeonnamGwangjuSidoAllToolbarTab(tabKey: string | null | undefined): boolean {
|
||||
return Boolean(tabKey && ARTICLE_EDIT_TAB_KEYS.has(tabKey));
|
||||
}
|
||||
|
||||
function isJeonnamGwangjuHeadquartersGridRow(
|
||||
row: Record<string, string | number>,
|
||||
): boolean {
|
||||
return (
|
||||
String(row.admdstNm ?? "").trim() === JEONNAM_GWANGJU_HEADQUARTERS_ADMDST_NM ||
|
||||
String(row.sggNm ?? "").trim() === JEONNAM_GWANGJU_HEADQUARTERS_ADMDST_NM
|
||||
);
|
||||
}
|
||||
|
||||
function hasJeonnamGwangjuHeadquartersGridRows(
|
||||
rows: readonly Record<string, string | number>[],
|
||||
): boolean {
|
||||
return rows.some(isJeonnamGwangjuHeadquartersGridRow);
|
||||
}
|
||||
|
||||
function isOnlyJeonnamGwangjuHeadquartersGridRows(
|
||||
rows: readonly Record<string, string | number>[],
|
||||
): boolean {
|
||||
return rows.length > 0 && rows.every(isJeonnamGwangjuHeadquartersGridRow);
|
||||
}
|
||||
|
||||
function isJeonnamGwangjuSggHeadquartersOnlyNotApplicable(
|
||||
searchContext: SearchFormValues | null,
|
||||
rows: readonly Record<string, string | number>[],
|
||||
): boolean {
|
||||
return (
|
||||
isJeonnamGwangjuSggNotApplicableSearch(searchContext) &&
|
||||
isOnlyJeonnamGwangjuHeadquartersGridRows(rows)
|
||||
);
|
||||
}
|
||||
|
||||
function isEmptyForNotApplicable(
|
||||
searchContext: SearchFormValues | null,
|
||||
rows: readonly Record<string, string | number>[],
|
||||
): boolean {
|
||||
return (
|
||||
rows.length === 0 ||
|
||||
isJeonnamGwangjuSggHeadquartersOnlyNotApplicable(searchContext, rows)
|
||||
);
|
||||
}
|
||||
|
||||
function buildGugunOkForToolbar(
|
||||
values: SearchFormValues | null,
|
||||
tabKey?: string | null,
|
||||
): boolean {
|
||||
if (
|
||||
isJeonnamGwangjuSidoAllToolbarTab(tabKey) &&
|
||||
isJeonnamGwangjuSidoAllToolbarException(
|
||||
sidoListRef.current,
|
||||
values,
|
||||
relatedToolbarUserIdRef.current,
|
||||
)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return isGugunOkForToolbar(sidoListRef.current, values);
|
||||
}
|
||||
|
||||
function buildSubmitOkForToolbar(values: SearchFormValues | null): boolean {
|
||||
function buildSubmitOkForToolbar(
|
||||
values: SearchFormValues | null,
|
||||
tabKey?: string | null,
|
||||
): boolean {
|
||||
if (
|
||||
isJeonnamGwangjuSidoAllToolbarTab(tabKey) &&
|
||||
isJeonnamGwangjuSidoAllToolbarException(
|
||||
sidoListRef.current,
|
||||
values,
|
||||
relatedToolbarUserIdRef.current,
|
||||
)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return isSubmitOkForToolbar(sidoListRef.current, values);
|
||||
}
|
||||
|
||||
@@ -181,7 +264,9 @@ function buildNoApplicableForRequest(
|
||||
values: SearchFormValues | null,
|
||||
checked: boolean,
|
||||
isSaveListEmpty: boolean,
|
||||
tabKey?: string | null,
|
||||
): boolean {
|
||||
if (buildSubmitOkForToolbar(values, tabKey)) return checked;
|
||||
return resolveNoApplicableForRequest(sidoListRef.current, values, checked, isSaveListEmpty);
|
||||
}
|
||||
|
||||
@@ -192,8 +277,9 @@ function computeTabToolbarSnapshot(
|
||||
searchContext: SearchFormValues | null,
|
||||
periodEnterable: boolean,
|
||||
isAdminInfo: boolean,
|
||||
tabKey?: string | null,
|
||||
): TabToolbarSnapshot {
|
||||
const gugunOk = buildGugunOkForToolbar(searchContext);
|
||||
const gugunOk = buildGugunOkForToolbar(searchContext, tabKey);
|
||||
const enterable = computeTabEnterable(statusInfo, periodEnterable);
|
||||
const isSubmitted = statusInfo?.lclgvSbmsnSttsCd === "2";
|
||||
const showSaveInToolbar = (enterable || isAdminInfo) && periodEnterable && gugunOk;
|
||||
@@ -203,8 +289,7 @@ function computeTabToolbarSnapshot(
|
||||
(hasRowData || treatAsSearched) &&
|
||||
(showSaveInToolbar ||
|
||||
showEnterableToolbarButtons ||
|
||||
showSubmittedInInputPeriodToolbar ||
|
||||
(isSubmitted && isAdminInfo));
|
||||
showSubmittedInInputPeriodToolbar);
|
||||
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
|
||||
}
|
||||
|
||||
@@ -552,19 +637,7 @@ function verificationCellTooltip({
|
||||
if (!verification) return;
|
||||
const errors = verification[fieldName];
|
||||
if (Array.isArray(errors) && errors.length > 0) {
|
||||
return errors
|
||||
.map((e) => {
|
||||
const prefix =
|
||||
e.vrfcCd === "IMR"
|
||||
? "시계열 검증 - "
|
||||
: e.vrfcCd === "NV"
|
||||
? "일반검증 - "
|
||||
: "모집단 검증 - ";
|
||||
return `${prefix}${e.rsnExpln}
|
||||
(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
|
||||
})
|
||||
.filter(Boolean)
|
||||
.join("\n");
|
||||
return formatVerificationTooltip(errors);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -588,7 +661,7 @@ function mapListToGridRows<T extends { verificationResult?: SewageExcretaRelated
|
||||
return filterBySelectedAdmdstCd(list, sidoListRef.current, values).map((item) => {
|
||||
const row = toGridRows([{ ctpvNm, ...item }])[0] as GridRowWithVerification;
|
||||
if (item.verificationResult) {
|
||||
row.verificationResult = item.verificationResult;
|
||||
row.verificationResult = normalizeVerificationResultMap(item.verificationResult);
|
||||
}
|
||||
return row;
|
||||
});
|
||||
@@ -623,6 +696,8 @@ async function waitForImrJobCompleted(
|
||||
const SewageExcretaRelatedInp = () => {
|
||||
const { sidoList } = useSearchConditionSidoList({ isInput: true });
|
||||
sidoListRef.current = sidoList;
|
||||
const userId = useUserStore((state) => state.userInfo?.userId ?? "");
|
||||
relatedToolbarUserIdRef.current = userId;
|
||||
const { setMessage: alert } = useAlertStore((state) => state);
|
||||
const { confirm } = useConfirm();
|
||||
const isAdminInfo = useAdminStore((state) => state.isAdminInfo);
|
||||
@@ -686,6 +761,8 @@ const SewageExcretaRelatedInp = () => {
|
||||
/** ST00120001·ST00120002 — 전년도(PRE) 조회로 로드된 ognzSn */
|
||||
const preYearArticleOgnzSnByTabRef = useRef<Map<string, ArticleOgnzSnSet>>(new Map());
|
||||
const sggOptionsSidoRef = useRef<string | null>(null);
|
||||
const sggHeadOptionsRef = useRef<Sgg[]>([]);
|
||||
const sggHeadOptionsSidoRef = useRef<string | null>(null);
|
||||
activeTabRef.current = activeTab;
|
||||
|
||||
const activeTabId = useTabStore((s) => s.activeTabId);
|
||||
@@ -716,11 +793,29 @@ const SewageExcretaRelatedInp = () => {
|
||||
tabKey: string,
|
||||
hasRows: boolean,
|
||||
statusInfo: SewerageStatusInfo | null | undefined,
|
||||
): boolean =>
|
||||
NOT_APPLICABLE_TAB_KEYS.has(tabKey) &&
|
||||
hasSearched &&
|
||||
!hasRows &&
|
||||
computeTabEnterable(statusInfo, inputPeriodEnterable);
|
||||
rows: readonly Record<string, string | number>[] = [],
|
||||
searchContext: SearchFormValues | null = null,
|
||||
): boolean => {
|
||||
if (
|
||||
!NOT_APPLICABLE_TAB_KEYS.has(tabKey) ||
|
||||
!hasSearched ||
|
||||
!computeTabEnterable(statusInfo, inputPeriodEnterable)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
if (!hasRows) return true;
|
||||
if (
|
||||
ARTICLE_EDIT_TAB_KEYS.has(tabKey) &&
|
||||
isJeonnamGwangjuSggHeadquartersOnlyNotApplicable(searchContext, rows)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return (
|
||||
ARTICLE_EDIT_TAB_KEYS.has(tabKey) &&
|
||||
isJeonnamGwangjuSidoAllSearch(sidoListRef.current, searchContext) &&
|
||||
!hasJeonnamGwangjuHeadquartersGridRows(rows)
|
||||
);
|
||||
};
|
||||
|
||||
const setIsNotApplicableForTab = useCallback((tabKey: string, nextValue: boolean) => {
|
||||
setIsNotApplicableByTab((prev) => {
|
||||
@@ -754,6 +849,22 @@ const SewageExcretaRelatedInp = () => {
|
||||
}
|
||||
}, []);
|
||||
|
||||
const loadSggHeadOptions = useCallback(async (sido: string): Promise<Sgg[]> => {
|
||||
if (!sido || sido === "ALL") {
|
||||
sggHeadOptionsRef.current = [];
|
||||
return [];
|
||||
}
|
||||
try {
|
||||
const res = await statisticsApi.getSggAllHeadList(sido);
|
||||
const list = parseSggListFromResponse(res);
|
||||
sggHeadOptionsRef.current = list;
|
||||
return list;
|
||||
} catch {
|
||||
sggHeadOptionsRef.current = [];
|
||||
return [];
|
||||
}
|
||||
}, []);
|
||||
|
||||
const commitToolbarSnapshotForLoadedTab = (
|
||||
tabKey: string,
|
||||
statusInfo: SewerageStatusInfo | null,
|
||||
@@ -771,6 +882,7 @@ const SewageExcretaRelatedInp = () => {
|
||||
searchContext,
|
||||
periodEnterableRef.current,
|
||||
isAdminInfo,
|
||||
tabKey,
|
||||
),
|
||||
);
|
||||
return next;
|
||||
@@ -1078,6 +1190,8 @@ const SewageExcretaRelatedInp = () => {
|
||||
);
|
||||
setSggOptions([]);
|
||||
sggOptionsSidoRef.current = null;
|
||||
sggHeadOptionsRef.current = [];
|
||||
sggHeadOptionsSidoRef.current = null;
|
||||
setVerificationHistoryOpen(false);
|
||||
};
|
||||
|
||||
@@ -1273,16 +1387,23 @@ const SewageExcretaRelatedInp = () => {
|
||||
alert("먼저 조회를 진행해주세요.");
|
||||
return;
|
||||
}
|
||||
if (!buildGugunOkForToolbar(lastSearchedValues)) {
|
||||
if (!buildGugunOkForToolbar(lastSearchedValues, tabKey)) {
|
||||
alert("시군구를 선택해주세요.");
|
||||
return;
|
||||
}
|
||||
|
||||
commitActiveGrid();
|
||||
const noApplicable = buildNoApplicableForRequest(searchContextByTab.get(tabKey) ?? lastSearchedValues, isNotApplicableByTab.get(tabKey) ?? false, getTabGridRows(tabKey).length === 0);
|
||||
const noApplicable = buildNoApplicableForRequest(searchContextByTab.get(tabKey) ?? lastSearchedValues, isNotApplicableByTab.get(tabKey) ?? false, getTabGridRows(tabKey).length === 0, tabKey);
|
||||
const currentData = getTabGridRows(tabKey);
|
||||
if (NOT_APPLICABLE_TAB_KEYS.has(tabKey)) {
|
||||
if (!noApplicable && currentData.length === 0 && buildSubmitOkForToolbar(searchContextByTab.get(tabKey) ?? lastSearchedValues)) {
|
||||
if (
|
||||
!noApplicable &&
|
||||
isEmptyForNotApplicable(
|
||||
searchContextByTab.get(tabKey) ?? lastSearchedValues,
|
||||
currentData,
|
||||
) &&
|
||||
buildSubmitOkForToolbar(searchContextByTab.get(tabKey) ?? lastSearchedValues, tabKey)
|
||||
) {
|
||||
alert("해당사항 없음을 체크해주세요.");
|
||||
return;
|
||||
}
|
||||
@@ -1291,7 +1412,12 @@ const SewageExcretaRelatedInp = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (await confirm("제출 하시겠습니까?")) {
|
||||
const submitConfirmMessage =
|
||||
ARTICLE_EDIT_TAB_KEYS.has(tabKey) &&
|
||||
isJeonnamGwangjuSidoAllSearch(sidoListRef.current, lastSearchedValues)
|
||||
? JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE
|
||||
: "제출 하시겠습니까?";
|
||||
if (await confirm(submitConfirmMessage)) {
|
||||
setShowSubmitDialog(true);
|
||||
}
|
||||
})();
|
||||
@@ -1307,7 +1433,7 @@ const SewageExcretaRelatedInp = () => {
|
||||
alert("먼저 조회를 진행해주세요.");
|
||||
return;
|
||||
}
|
||||
if (!buildGugunOkForToolbar(lastSearchedValues)) {
|
||||
if (!buildGugunOkForToolbar(lastSearchedValues, tabKey)) {
|
||||
alert("시군구를 선택해주세요.");
|
||||
return;
|
||||
}
|
||||
@@ -1316,7 +1442,7 @@ const SewageExcretaRelatedInp = () => {
|
||||
|
||||
const isDistrictRowTab = DISTRICT_ROW_TAB_KEYS.has(tabKey);
|
||||
const isPublicInstitutionTab = ARTICLE_EDIT_TAB_KEYS.has(tabKey);
|
||||
const noApplicable = buildNoApplicableForRequest(searchContextByTab.get(tabKey) ?? lastSearchedValues, isNotApplicableByTab.get(tabKey) ?? false, getTabGridRows(tabKey).length === 0);
|
||||
const noApplicable = buildNoApplicableForRequest(searchContextByTab.get(tabKey) ?? lastSearchedValues, isNotApplicableByTab.get(tabKey) ?? false, getTabGridRows(tabKey).length === 0, tabKey);
|
||||
const currentData = getTabGridRows(tabKey);
|
||||
const mapRows = rowDataMap.get(tabKey) ?? [];
|
||||
|
||||
@@ -1387,7 +1513,15 @@ const SewageExcretaRelatedInp = () => {
|
||||
)
|
||||
.map((row) => buildPublicInstitutionIndustrySaveItem(row, list));
|
||||
|
||||
if (!noApplicable && submitList.length === 0 && buildSubmitOkForToolbar(searchContextByTab.get(tabKey) ?? lastSearchedValues)) {
|
||||
if (
|
||||
!noApplicable &&
|
||||
(submitList.length === 0 ||
|
||||
isJeonnamGwangjuSggHeadquartersOnlyNotApplicable(
|
||||
searchContextByTab.get(tabKey) ?? lastSearchedValues,
|
||||
currentData,
|
||||
)) &&
|
||||
buildSubmitOkForToolbar(searchContextByTab.get(tabKey) ?? lastSearchedValues, tabKey)
|
||||
) {
|
||||
alert("해당사항 없음을 체크해주세요.");
|
||||
return;
|
||||
}
|
||||
@@ -1503,7 +1637,13 @@ const SewageExcretaRelatedInp = () => {
|
||||
};
|
||||
|
||||
try {
|
||||
const imrResponse = await statisticsApi.callImrService(imrParam);
|
||||
const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
|
||||
statsYr: lastSearchedValues.year ?? "",
|
||||
statsCd: statsCdForTab,
|
||||
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
|
||||
rollbackStatusCode: activeTabStatus?.lclgvSbmsnSttsCd ?? "",
|
||||
mdfrUuid: userInfo.userUnqId,
|
||||
});
|
||||
if (imrResponse.job_id) {
|
||||
await waitForImrJobCompleted(
|
||||
imrResponse.job_id,
|
||||
@@ -1559,7 +1699,7 @@ const SewageExcretaRelatedInp = () => {
|
||||
alert("먼저 조회를 진행해주세요.");
|
||||
return;
|
||||
}
|
||||
if (!buildGugunOkForToolbar(lastSearchedValues)) {
|
||||
if (!buildGugunOkForToolbar(lastSearchedValues, tabKey)) {
|
||||
alert("시군구를 선택해주세요.");
|
||||
return;
|
||||
}
|
||||
@@ -1567,13 +1707,19 @@ const SewageExcretaRelatedInp = () => {
|
||||
alert("해당 탭은 저장 기능이 준비되지 않았습니다.");
|
||||
return;
|
||||
}
|
||||
if (!(await confirm("저장 하시겠습니까?"))) return;
|
||||
const saveConfirmMessage =
|
||||
ARTICLE_EDIT_TAB_KEYS.has(tabKey) &&
|
||||
isJeonnamGwangjuSidoAllSearch(sidoListRef.current, lastSearchedValues)
|
||||
? JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE
|
||||
: "저장 하시겠습니까?";
|
||||
if (!(await confirm(saveConfirmMessage))) return;
|
||||
|
||||
commitActiveGrid();
|
||||
|
||||
const isDistrictRowTab = DISTRICT_ROW_TAB_KEYS.has(tabKey);
|
||||
const isPublicInstitutionTab = ARTICLE_EDIT_TAB_KEYS.has(tabKey);
|
||||
const noApplicable = buildNoApplicableForRequest(searchContextByTab.get(tabKey) ?? lastSearchedValues, isNotApplicableByTab.get(tabKey) ?? false, getTabGridRows(tabKey).length === 0);
|
||||
const notApplicableChecked = isNotApplicableByTab.get(tabKey) ?? false;
|
||||
const noApplicable = buildNoApplicableForRequest(searchContextByTab.get(tabKey) ?? lastSearchedValues, notApplicableChecked, getTabGridRows(tabKey).length === 0, tabKey);
|
||||
const currentData = getTabGridRows(tabKey);
|
||||
const mapRows = rowDataMap.get(tabKey) ?? [];
|
||||
|
||||
@@ -1663,7 +1809,30 @@ const SewageExcretaRelatedInp = () => {
|
||||
)
|
||||
.map((row) => buildPublicInstitutionIndustrySaveItem(row, list));
|
||||
|
||||
if (!noApplicable && saveList.length === 0 && buildSubmitOkForToolbar(searchContextByTab.get(tabKey) ?? lastSearchedValues)) {
|
||||
if (
|
||||
isJeonnamGwangjuSidoAllSearch(
|
||||
sidoListRef.current,
|
||||
lastSearchedValues,
|
||||
) &&
|
||||
!notApplicableChecked &&
|
||||
!hasJeonnamGwangjuHeadquartersGridRows(currentData)
|
||||
) {
|
||||
alert("본청 데이터 제거 시 해당사항 없음을 체크해주세요.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
!noApplicable &&
|
||||
(saveList.length === 0 ||
|
||||
isJeonnamGwangjuSggHeadquartersOnlyNotApplicable(
|
||||
searchContextByTab.get(tabKey) ?? lastSearchedValues,
|
||||
currentData,
|
||||
)) &&
|
||||
buildSubmitOkForToolbar(
|
||||
searchContextByTab.get(tabKey) ?? lastSearchedValues,
|
||||
tabKey,
|
||||
)
|
||||
) {
|
||||
alert("해당사항 없음을 체크해주세요.");
|
||||
return;
|
||||
}
|
||||
@@ -1726,21 +1895,20 @@ const SewageExcretaRelatedInp = () => {
|
||||
alert("먼저 조회를 진행해주세요.");
|
||||
return;
|
||||
}
|
||||
if (!buildGugunOkForToolbar(ctx)) {
|
||||
const tabKey = activeTabRef.current;
|
||||
if (!buildGugunOkForToolbar(ctx, tabKey)) {
|
||||
alert("시군구를 선택해주세요.");
|
||||
return;
|
||||
}
|
||||
|
||||
const tabKey = activeTabRef.current;
|
||||
if (!ARTICLE_EDIT_TAB_KEYS.has(tabKey)) {
|
||||
alert("항목을 추가할 수 없는 탭입니다.");
|
||||
return;
|
||||
}
|
||||
|
||||
let list = sggOptions;
|
||||
if (sggOptionsSidoRef.current !== ctx.sido || list.length === 0) {
|
||||
list = await loadSggOptions(ctx.sido);
|
||||
sggOptionsSidoRef.current = ctx.sido;
|
||||
let list = sggHeadOptionsRef.current;
|
||||
if (sggHeadOptionsSidoRef.current !== ctx.sido || list.length === 0) {
|
||||
list = await loadSggHeadOptions(ctx.sido);
|
||||
sggHeadOptionsSidoRef.current = ctx.sido;
|
||||
}
|
||||
if (list.length === 0) {
|
||||
alert("시군구 목록을 불러오지 못했습니다.");
|
||||
@@ -1808,7 +1976,7 @@ const SewageExcretaRelatedInp = () => {
|
||||
alert("먼저 조회를 진행해주세요.");
|
||||
return;
|
||||
}
|
||||
if (!buildGugunOkForToolbar(ctx)) {
|
||||
if (!buildGugunOkForToolbar(ctx, tabKey)) {
|
||||
alert("시군구를 선택해주세요.");
|
||||
return;
|
||||
}
|
||||
@@ -1888,7 +2056,11 @@ const SewageExcretaRelatedInp = () => {
|
||||
SGG_NM_DROPDOWN_TAB_KEYS.has(tabKey) &&
|
||||
col.fieldName === "sggNm"
|
||||
) {
|
||||
next = buildSggNmColumn(col, canEdit, sggOptions);
|
||||
next = buildSggNmColumn(
|
||||
col,
|
||||
canEdit,
|
||||
filterSggOptionsBySearchGugun(sggOptions, lastSearchedValues?.gugun),
|
||||
);
|
||||
} else if (col.fieldName === "sggNm") {
|
||||
next = { ...col, editable: false as const, styleName: "rg-cell-readonly" };
|
||||
}
|
||||
@@ -1901,7 +2073,7 @@ const SewageExcretaRelatedInp = () => {
|
||||
});
|
||||
}
|
||||
return map;
|
||||
}, [tabStatusInfoMap, inputPeriodEnterable, isAdminInfo, columnGuidesByTab, sggOptions]);
|
||||
}, [tabStatusInfoMap, inputPeriodEnterable, isAdminInfo, columnGuidesByTab, sggOptions, lastSearchedValues?.gugun]);
|
||||
|
||||
const publicInstitutionArticleCellStyleCallback = useCallback<CellStyleCallback>(
|
||||
({ fieldName, row }) => {
|
||||
@@ -1938,6 +2110,7 @@ const SewageExcretaRelatedInp = () => {
|
||||
searchContextForToolbar,
|
||||
inputPeriodEnterable,
|
||||
isAdminInfo,
|
||||
activeTab,
|
||||
);
|
||||
|
||||
const showSaveInToolbar = activeTabToolbar.showSaveInToolbar && toolbarGroupAllowed;
|
||||
@@ -1948,12 +2121,25 @@ const SewageExcretaRelatedInp = () => {
|
||||
(activeTabToolbar.showActionToolbarCard || (hasSearched && loadedTabKeys.has(activeTab)));
|
||||
const showArticleEditButtons =
|
||||
ARTICLE_EDIT_TAB_KEYS.has(activeTab) && showEnterableToolbarButtons;
|
||||
const gugunOk = buildGugunOkForToolbar(searchContextForToolbar);
|
||||
const submitOk = buildSubmitOkForToolbar(searchContextForToolbar);
|
||||
const gugunOk = buildGugunOkForToolbar(searchContextForToolbar, activeTab);
|
||||
const submitOk = buildSubmitOkForToolbar(searchContextForToolbar, activeTab);
|
||||
const disableSubmit =
|
||||
isJeonnamGwangjuSidoAllToolbarTab(activeTab) &&
|
||||
isJeonnamGwangjuSidoAllToolbarException(
|
||||
sidoListRef.current,
|
||||
searchContextForToolbar,
|
||||
relatedToolbarUserIdRef.current,
|
||||
);
|
||||
const showNotApplicableForActiveTab =
|
||||
NOT_APPLICABLE_TAB_KEYS.has(activeTab) &&
|
||||
loadedTabKeys.has(activeTab) &&
|
||||
shouldShowNotApplicable(activeTab, activeTabHasRowData, activeTabStatus) &&
|
||||
shouldShowNotApplicable(
|
||||
activeTab,
|
||||
activeTabHasRowData,
|
||||
activeTabStatus,
|
||||
rowDataMap.get(activeTab) ?? [],
|
||||
searchContextForToolbar,
|
||||
) &&
|
||||
submitOk;
|
||||
const showSecondaryToolbarCard =
|
||||
hasSearched &&
|
||||
@@ -2021,10 +2207,12 @@ const SewageExcretaRelatedInp = () => {
|
||||
<LastYearDataButton
|
||||
getLastYearDataFunc={() => void lastYearDataFunc()}
|
||||
/>
|
||||
{submitOk && <SubmitButton submitFunc={submitFunc} />}
|
||||
{submitOk && (
|
||||
<SubmitButton submitFunc={submitFunc} disabled={disableSubmit} />
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && (
|
||||
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
|
||||
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
|
||||
)}
|
||||
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
|
||||
|
||||
@@ -17,10 +17,12 @@ import { useAlertStore, useGlobalProgressStore, useStatisticsInputToolbarGroupGa
|
||||
import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation";
|
||||
import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation";
|
||||
import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
|
||||
import { filterSggOptionsBySearchGugun } from "@/components/util/input/filter-sgg-options-by-search";
|
||||
import { nullableTrimmedString } from "@/components/util/input/nullableString";
|
||||
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
|
||||
import { statisticsInputSewageExcretaSlurgeApi } from "@/entities/statistics/api/input/statistics-input-sewage-excreta-slurge-service";
|
||||
import { statisticsApi } from "@/entities/statistics/api/statistics-service";
|
||||
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
|
||||
import type {
|
||||
DigestorOperatingStatusSaveItem,
|
||||
ExcretaSlurgeProcessingStatusSaveItem,
|
||||
@@ -59,6 +61,7 @@ import LastYearDataButton from "@/components/button/LastYearDataButton";
|
||||
import NotApplicableCheckButton from "@/components/button/NotApplicableCheckButton";
|
||||
import SaveButton from "@/components/button/SaveButton";
|
||||
import SubmitButton from "@/components/button/SumitButton";
|
||||
import UpdateOperateDataButton from "@/components/button/UpdateOperateDataButton";
|
||||
import VerificationResultButton from "@/components/button/VerificationResultButton";
|
||||
import DataGrid from "@/components/module/DataGrid";
|
||||
import { openVerificationResultDialogIfNeeded } from "@/components/module/post-submit-verification-results";
|
||||
@@ -90,7 +93,11 @@ import {
|
||||
patchFooterVerificationByTab,
|
||||
patchVerificationFailedByTab,
|
||||
} from "@/components/util/input/verification-failed-flag";
|
||||
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display";
|
||||
import {
|
||||
formatVerificationTooltip,
|
||||
normalizeVerificationResultMap,
|
||||
type VerificationResultLikeMap,
|
||||
} from "@/components/util/input/verification-result-display";
|
||||
import { useAdminStore } from "@/store/admin-store";
|
||||
import { useTabStore } from "@/store/tab-store";
|
||||
|
||||
@@ -148,19 +155,7 @@ function verificationCellTooltip({
|
||||
if (!verification) return;
|
||||
const errors = verification[fieldName];
|
||||
if (Array.isArray(errors) && errors.length > 0) {
|
||||
return errors
|
||||
.map((e) => {
|
||||
const prefix =
|
||||
e.vrfcCd === "IMR"
|
||||
? "시계열 검증 - "
|
||||
: e.vrfcCd === "NV"
|
||||
? "일반검증 - "
|
||||
: "모집단 검증 - ";
|
||||
return `${prefix}${e.rsnExpln}
|
||||
(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
|
||||
})
|
||||
.filter(Boolean)
|
||||
.join("\n");
|
||||
return formatVerificationTooltip(errors);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,16 +180,16 @@ function mapListToGridRows<T extends { verificationResult?: SewageExcretaSlurgeV
|
||||
return filterBySelectedAdmdstCd(list, sidoListRef.current, values).map((item) => {
|
||||
const row = toGridRows([{ ctpvNm, ...item }])[0] as GridRowWithVerification;
|
||||
if (item.verificationResult) {
|
||||
row.verificationResult = item.verificationResult;
|
||||
row.verificationResult = normalizeVerificationResultMap(item.verificationResult);
|
||||
}
|
||||
return row;
|
||||
});
|
||||
}
|
||||
|
||||
const SewageExcretaSlurgeInpTabList = [
|
||||
SlurgeProcessingFacStatusInpColumn,
|
||||
DigestorOperatingStatusInpColumn,
|
||||
SewageSlurgeProcessingFacStatusInpColumn,
|
||||
const SewageExcretaSlurgeInpTabList = [
|
||||
SlurgeProcessingFacStatusInpColumn,
|
||||
DigestorOperatingStatusInpColumn,
|
||||
SewageSlurgeProcessingFacStatusInpColumn,
|
||||
ExcretaSlurgeProcessingStatusInpColumn,
|
||||
] as const;
|
||||
|
||||
@@ -389,8 +384,7 @@ function computeTabToolbarSnapshot(
|
||||
(hasRowData || treatAsSearched) &&
|
||||
(showSaveInToolbar ||
|
||||
showEnterableToolbarButtons ||
|
||||
showSubmittedInInputPeriodToolbar ||
|
||||
(isSubmitted && isAdminInfo));
|
||||
showSubmittedInInputPeriodToolbar);
|
||||
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
|
||||
}
|
||||
|
||||
@@ -627,7 +621,6 @@ function buildExcretaSlurgeProcessingStatusSaveItem(
|
||||
rcycQnt: toGridNumber(row.rcycQnt),
|
||||
olandLfvlm: toGridNumber(row.olandLfvlm),
|
||||
incnrQnt: toGridNumber(row.incnrQnt),
|
||||
oceanInputQnt: toGridNumber(row.oceanInputQnt),
|
||||
fuelQnt: toGridNumber(row.fuelQnt),
|
||||
etcQnt: toGridNumber(row.etcQnt),
|
||||
unprcsQnt: toGridNumber(row.unprcsQnt),
|
||||
@@ -1349,18 +1342,18 @@ const SewageExcretaSlurgeInp = () => {
|
||||
noApplicable || !isSewageSlurgeFacTab
|
||||
? []
|
||||
: rowsForSubmit.map((row) =>
|
||||
buildSewageSlurgeProcessingFacStatusSaveItem(row, list),
|
||||
);
|
||||
buildSewageSlurgeProcessingFacStatusSaveItem(row, list),
|
||||
);
|
||||
const excretaSlurgeSubmitList =
|
||||
noApplicable || !isExcretaSlurgeTab
|
||||
? []
|
||||
: rowsForSubmit.map((row) =>
|
||||
buildExcretaSlurgeProcessingStatusSaveItem(row, list),
|
||||
);
|
||||
buildExcretaSlurgeProcessingStatusSaveItem(row, list),
|
||||
);
|
||||
const sewageSlurgeFacDeleteList = isSewageSlurgeFacTab
|
||||
? (deleteListByTab.get(tabKey) ?? [])
|
||||
.filter((row) => isPersistedArticleRowForTab(tabKey, row))
|
||||
.map((row) => buildSewageSlurgeProcessingFacStatusSaveItem(row, list))
|
||||
.filter((row) => isPersistedArticleRowForTab(tabKey, row))
|
||||
.map((row) => buildSewageSlurgeProcessingFacStatusSaveItem(row, list))
|
||||
: [];
|
||||
|
||||
if (
|
||||
@@ -1381,10 +1374,10 @@ const SewageExcretaSlurgeInp = () => {
|
||||
(isDigestorTab
|
||||
? SEWAGE_EXCRETA_DIGESTOR_OPERATING_STATS_CD
|
||||
: isSewageSlurgeFacTab
|
||||
? SEWAGE_EXCRETA_SEWAGE_SLURGE_FAC_STATUS_STATS_CD
|
||||
: isExcretaSlurgeTab
|
||||
? SEWAGE_EXCRETA_EXCRETA_SLURGE_PROCESSING_STATS_CD
|
||||
: SEWAGE_EXCRETA_SLURGE_PROCESSING_FAC_STATUS_STATS_CD);
|
||||
? SEWAGE_EXCRETA_SEWAGE_SLURGE_FAC_STATUS_STATS_CD
|
||||
: isExcretaSlurgeTab
|
||||
? SEWAGE_EXCRETA_EXCRETA_SLURGE_PROCESSING_STATS_CD
|
||||
: SEWAGE_EXCRETA_SLURGE_PROCESSING_FAC_STATUS_STATS_CD);
|
||||
|
||||
const verificationQuery = {
|
||||
...toInputSearchRegion(sidoListRef.current, lastSearchedValues),
|
||||
@@ -1436,32 +1429,32 @@ const SewageExcretaSlurgeInp = () => {
|
||||
setGlobalProgressLabel("일반 검증 진행 중...");
|
||||
const response = isSlurgeFacTab
|
||||
? await statisticsInputSewageExcretaSlurgeApi.submitSlurgeProcessingFacStatus({
|
||||
...submitRequestBase,
|
||||
userUuid: userInfo.userUnqId,
|
||||
submitList: slurgeSubmitList,
|
||||
})
|
||||
...submitRequestBase,
|
||||
userUuid: userInfo.userUnqId,
|
||||
submitList: slurgeSubmitList,
|
||||
})
|
||||
: isDigestorTab
|
||||
? await statisticsInputSewageExcretaSlurgeApi.submitDigestorOperatingStatus({
|
||||
? await statisticsInputSewageExcretaSlurgeApi.submitDigestorOperatingStatus({
|
||||
...submitRequestBase,
|
||||
userUuid: userInfo.userUnqId,
|
||||
submitList: digestorSubmitList,
|
||||
})
|
||||
: isSewageSlurgeFacTab
|
||||
? await statisticsInputSewageExcretaSlurgeApi.submitSewageSlurgeProcessingFacStatus(
|
||||
{
|
||||
...submitRequestBase,
|
||||
userUuid: userInfo.userUnqId,
|
||||
submitList: sewageSlurgeFacSubmitList,
|
||||
deleteList: sewageSlurgeFacDeleteList,
|
||||
},
|
||||
)
|
||||
: await statisticsInputSewageExcretaSlurgeApi.submitExcretaSlurgeProcessingStatus(
|
||||
{
|
||||
...submitRequestBase,
|
||||
userUuid: userInfo.userUnqId,
|
||||
submitList: excretaSlurgeSubmitList,
|
||||
},
|
||||
);
|
||||
: isSewageSlurgeFacTab
|
||||
? await statisticsInputSewageExcretaSlurgeApi.submitSewageSlurgeProcessingFacStatus(
|
||||
{
|
||||
...submitRequestBase,
|
||||
userUuid: userInfo.userUnqId,
|
||||
submitList: sewageSlurgeFacSubmitList,
|
||||
deleteList: sewageSlurgeFacDeleteList,
|
||||
},
|
||||
)
|
||||
: await statisticsInputSewageExcretaSlurgeApi.submitExcretaSlurgeProcessingStatus(
|
||||
{
|
||||
...submitRequestBase,
|
||||
userUuid: userInfo.userUnqId,
|
||||
submitList: excretaSlurgeSubmitList,
|
||||
},
|
||||
);
|
||||
|
||||
if (response.status !== "success") {
|
||||
alert(response.message ?? "데이터 제출 중 오류가 발생했습니다.");
|
||||
@@ -1486,7 +1479,13 @@ const SewageExcretaSlurgeInp = () => {
|
||||
};
|
||||
|
||||
try {
|
||||
const imrResponse = await statisticsApi.callImrService(imrParam);
|
||||
const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
|
||||
statsYr: lastSearchedValues.year ?? "",
|
||||
statsCd: statsCdForSubmit,
|
||||
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
|
||||
rollbackStatusCode: activeTabStatus?.lclgvSbmsnSttsCd ?? "",
|
||||
mdfrUuid: userInfo.userUnqId,
|
||||
});
|
||||
if (imrResponse.job_id) {
|
||||
await waitForImrJobCompleted(
|
||||
imrResponse.job_id,
|
||||
@@ -1535,6 +1534,61 @@ const SewageExcretaSlurgeInp = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const updateOperateDataButtonFunc = () => {
|
||||
void (async () => {
|
||||
if (!lastSearchedValues) {
|
||||
alert("먼저 조회를 진행해주세요.");
|
||||
return;
|
||||
}
|
||||
if (!(await confirm("자체발생량·함수율·자체 1차 처리량이 운영 데이터로 덮어씁니다."))) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
showGlobalProgress({ label: "운영 데이터 업데이트 중...", progress: 0 });
|
||||
const userInfo = await getUserInfo();
|
||||
const request = {
|
||||
statsYr: lastSearchedValues.year ?? "",
|
||||
ctpvNm: lastSearchedValues.sido ?? "",
|
||||
...toInputSearchRegion(sidoListRef.current, lastSearchedValues),
|
||||
userUuid: userInfo.userUnqId,
|
||||
};
|
||||
|
||||
const response =
|
||||
await statisticsInputSewageExcretaSlurgeApi.updateSlurgeProcessingFacStatusOperationData(
|
||||
request,
|
||||
);
|
||||
if (response.status !== "success") {
|
||||
alert(
|
||||
response.message ||
|
||||
"운영 데이터 업데이트 중 오류가 발생했습니다.",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
setGlobalProgress(50);
|
||||
const tabKey = SlurgeProcessingFacStatusInpColumn.tabKey;
|
||||
const param =
|
||||
searchParamRef.current ??
|
||||
buildSewageExcretaSlurgeSearchParam(lastSearchedValues);
|
||||
await loadActiveTabData(tabKey, param, lastSearchedValues, true, false);
|
||||
setGlobalProgress(100);
|
||||
alert("운영 데이터가 업데이트되었습니다.");
|
||||
} catch (error) {
|
||||
const message =
|
||||
error &&
|
||||
typeof error === "object" &&
|
||||
"response" in error
|
||||
? (error as { response?: { data?: { message?: string } } })
|
||||
.response?.data?.message
|
||||
: undefined;
|
||||
alert(message || "운영 데이터 업데이트 중 오류가 발생했습니다.");
|
||||
} finally {
|
||||
hideGlobalProgress();
|
||||
}
|
||||
})();
|
||||
};
|
||||
|
||||
const cnacelSubmitFunc = () => {
|
||||
void (async () => {
|
||||
try {
|
||||
@@ -1646,8 +1700,8 @@ const SewageExcretaSlurgeInp = () => {
|
||||
const saveList = noApplicable
|
||||
? []
|
||||
: rowsForSave.map((row) =>
|
||||
buildSlurgeProcessingFacStatusSaveItem(row, list),
|
||||
);
|
||||
buildSlurgeProcessingFacStatusSaveItem(row, list),
|
||||
);
|
||||
|
||||
if (!noApplicable && saveList.length === 0 && buildSubmitOkForToolbar(searchContextByTab.get(tabKey) ?? lastSearchedValues)) {
|
||||
alert("해당사항 없음을 체크해주세요.");
|
||||
@@ -1672,8 +1726,8 @@ const SewageExcretaSlurgeInp = () => {
|
||||
const saveList = noApplicable
|
||||
? []
|
||||
: rowsForSave.map((row) =>
|
||||
buildDigestorOperatingStatusSaveItem(row, list),
|
||||
);
|
||||
buildDigestorOperatingStatusSaveItem(row, list),
|
||||
);
|
||||
|
||||
if (!noApplicable && saveList.length === 0 && buildSubmitOkForToolbar(searchContextByTab.get(tabKey) ?? lastSearchedValues)) {
|
||||
alert("해당사항 없음을 체크해주세요.");
|
||||
@@ -1695,8 +1749,8 @@ const SewageExcretaSlurgeInp = () => {
|
||||
const saveList = noApplicable
|
||||
? []
|
||||
: rowsForSave.map((row) =>
|
||||
buildSewageSlurgeProcessingFacStatusSaveItem(row, list),
|
||||
);
|
||||
buildSewageSlurgeProcessingFacStatusSaveItem(row, list),
|
||||
);
|
||||
const deleteList = (deleteListByTab.get(tabKey) ?? [])
|
||||
.filter((row) => isPersistedArticleRowForTab(tabKey, row))
|
||||
.map((row) => buildSewageSlurgeProcessingFacStatusSaveItem(row, list));
|
||||
@@ -1725,8 +1779,8 @@ const SewageExcretaSlurgeInp = () => {
|
||||
const saveList = noApplicable
|
||||
? []
|
||||
: rowsForSave.map((row) =>
|
||||
buildExcretaSlurgeProcessingStatusSaveItem(row, list),
|
||||
);
|
||||
buildExcretaSlurgeProcessingStatusSaveItem(row, list),
|
||||
);
|
||||
|
||||
if (!noApplicable && saveList.length === 0 && buildSubmitOkForToolbar(searchContextByTab.get(tabKey) ?? lastSearchedValues)) {
|
||||
alert("해당사항 없음을 체크해주세요.");
|
||||
@@ -1778,17 +1832,17 @@ const SewageExcretaSlurgeInp = () => {
|
||||
const getCheckedItemIndexesFromGrid = (rowCount: number): number[] => {
|
||||
const gridView = getGridRef.current?.gridView as
|
||||
| {
|
||||
getCheckedItems?: () => number[];
|
||||
getCheckedRows?: () => number[];
|
||||
}
|
||||
getCheckedItems?: () => number[];
|
||||
getCheckedRows?: () => number[];
|
||||
}
|
||||
| undefined;
|
||||
|
||||
const checked =
|
||||
(typeof gridView?.getCheckedItems === "function"
|
||||
? gridView.getCheckedItems()
|
||||
: typeof gridView?.getCheckedRows === "function"
|
||||
? gridView.getCheckedRows()
|
||||
: []) ?? [];
|
||||
? gridView.getCheckedRows()
|
||||
: []) ?? [];
|
||||
|
||||
return checked.filter(
|
||||
(idx) => Number.isInteger(idx) && idx >= 0 && idx < rowCount,
|
||||
@@ -1860,10 +1914,10 @@ const SewageExcretaSlurgeInp = () => {
|
||||
checkedIndexes.length > 0
|
||||
? new Set(checkedIndexes)
|
||||
: new Set(
|
||||
currentRows
|
||||
.map((row, idx) => (isCheckedRow(row) ? idx : -1))
|
||||
.filter((idx) => idx >= 0),
|
||||
);
|
||||
currentRows
|
||||
.map((row, idx) => (isCheckedRow(row) ? idx : -1))
|
||||
.filter((idx) => idx >= 0),
|
||||
);
|
||||
|
||||
const removedRows = currentRows.filter((_, idx) => checkedIndexSet.has(idx));
|
||||
const nextRows = currentRows.filter((_, idx) => !checkedIndexSet.has(idx));
|
||||
@@ -1922,7 +1976,11 @@ const SewageExcretaSlurgeInp = () => {
|
||||
SGG_NM_DROPDOWN_TAB_KEYS.has(tabKey) &&
|
||||
col.fieldName === "sggNm"
|
||||
) {
|
||||
next = buildSggNmColumn(col, canEdit, sggOptions);
|
||||
next = buildSggNmColumn(
|
||||
col,
|
||||
canEdit,
|
||||
filterSggOptionsBySearchGugun(sggOptions, lastSearchedValues?.gugun),
|
||||
);
|
||||
} else if (col.fieldName === "sggNm") {
|
||||
next = { ...col, editable: false as const, styleName: "rg-cell-readonly" };
|
||||
}
|
||||
@@ -2082,8 +2140,8 @@ const SewageExcretaSlurgeInp = () => {
|
||||
onValuesChange={setSearchValues}
|
||||
/>
|
||||
{showActionToolbarCard && (
|
||||
<div className="card !py-0">
|
||||
<div className="flex justify-end items-center gap-[0.6rem] m-[0.6rem]">
|
||||
<div className="card !py-0">
|
||||
<div className="flex justify-end items-center gap-[0.6rem] m-[0.6rem]">
|
||||
<VerificationResultButton
|
||||
VerificationResultButtonFunc={openVerificationHistoryDialog}
|
||||
isVerificationFailed={
|
||||
@@ -2095,19 +2153,24 @@ const SewageExcretaSlurgeInp = () => {
|
||||
<LastYearDataButton
|
||||
getLastYearDataFunc={() => void lastYearDataFunc()}
|
||||
/>
|
||||
{submitOk && <SubmitButton submitFunc={submitFunc} />}
|
||||
{activeTab === SEWAGE_EXCRETA_SLURGE_PROCESSING_FAC_STATUS_STATS_CD && (
|
||||
<UpdateOperateDataButton
|
||||
updateOperateDataButtonFunc={updateOperateDataButtonFunc}
|
||||
/>
|
||||
)}
|
||||
{submitOk && <SubmitButton submitFunc={submitFunc} />}
|
||||
</>
|
||||
)}
|
||||
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && (
|
||||
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
|
||||
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
|
||||
)}
|
||||
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{showSecondaryToolbarCard && (
|
||||
<div className="card !py-0">
|
||||
<div className="flex justify-end items-center gap-[0.6rem] m-[0.6rem]">
|
||||
<div className="card !py-0">
|
||||
<div className="flex justify-end items-center gap-[0.6rem] m-[0.6rem]">
|
||||
{showNotApplicableForActiveTab && (
|
||||
<NotApplicableCheckButton
|
||||
isCheck={isNotApplicableForActiveTab}
|
||||
@@ -2116,12 +2179,12 @@ const SewageExcretaSlurgeInp = () => {
|
||||
)}
|
||||
{showArticleEditButtons && (
|
||||
<>
|
||||
<AddArticleButton addArticleFunc={addArticleFunc} />
|
||||
<DeleteArticleButton deleteArticleFunc={deleteArticleFunc} />
|
||||
<AddArticleButton addArticleFunc={addArticleFunc} />
|
||||
<DeleteArticleButton deleteArticleFunc={deleteArticleFunc} />
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{isLoading && (
|
||||
<div className="absolute inset-0 z-50 [data-theme='black']:bg-transparent rounded-lg p-10 flex justify-center items-center">
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
|
||||
import { statisticsInputSewPipeApiService } from "@/entities/statistics/api/input/statistics-sewage-pipe-input-service";
|
||||
import { statisticsApi } from "@/entities/statistics/api/statistics-service";
|
||||
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
|
||||
import type {
|
||||
SeweragePipeInputFactInstallStatusSaveRequest,
|
||||
SeweragePipeInputFactInstallStatusSubmitRequest,
|
||||
@@ -70,7 +71,10 @@ import type { SearchFormValues } from "@/components/type/SearchForm.type";
|
||||
import { FactInstallStatusInpColumn } from "@/components/util/column/input/sewagePipe/FactInstallStatusInpColumn";
|
||||
import { ManholeStatusInpColumn } from "@/components/util/column/input/sewagePipe/ManholeStatusInpColumn";
|
||||
import { PipeDiameterStatusInpColumn } from "@/components/util/column/input/sewagePipe/PipeDiameterStatusInpColumn";
|
||||
import { PipeTypeStatusInpColumn } from "@/components/util/column/input/sewagePipe/PipeTypeStatusInpColumn";
|
||||
import {
|
||||
getPipeTypeStatusInpColumn,
|
||||
resolvePipeTypeColumnEndYear,
|
||||
} from "@/components/util/column/input/sewagePipe/PipeTypeStatusInpColumn";
|
||||
import { RegionalFactStatusInpColumn } from "@/components/util/column/input/sewagePipe/RegionalFactStatusInpColumn";
|
||||
import { SewagePipeInpColumnInfoList } from "@/components/util/column/input/sewagePipe/SewagePipeInpColumn";
|
||||
import { fetchColumnGuidesRecord } from "@/components/util/grid/columnGuides";
|
||||
@@ -82,7 +86,10 @@ import {
|
||||
} from "@/components/util/input/verification-failed-flag";
|
||||
import { nullableTrimmedString } from "@/components/util/input/nullableString";
|
||||
import {
|
||||
formatVerificationTooltip,
|
||||
getVerificationErrorsForField,
|
||||
normalizeVerificationResultMap,
|
||||
withNormalizedVerificationResult,
|
||||
type VerificationResultLikeMap,
|
||||
} from "@/components/util/input/verification-result-display";
|
||||
import { useAdminStore } from "@/store/admin-store";
|
||||
@@ -115,11 +122,6 @@ function buildSewagePipeSearchParam(
|
||||
};
|
||||
}
|
||||
|
||||
const getPipeTypeLastDataYear = () => {
|
||||
const lastDataYear = new Date().getFullYear() - 1;
|
||||
return Math.max(1995, lastDataYear);
|
||||
};
|
||||
|
||||
const PIPE_TYPE_STATUS_TAB_KEY = "ST00020003";
|
||||
|
||||
/** 조회 연도(statsYr)에 해당하는 연도 (y{year}* 필드용) */
|
||||
@@ -127,7 +129,7 @@ const resolvePipeTypeEditableYear = (statsYr: string | null | undefined): number
|
||||
if (!statsYr) return null;
|
||||
const year = Number(statsYr);
|
||||
if (!Number.isFinite(year)) return null;
|
||||
return Math.min(getPipeTypeLastDataYear(), Math.max(1995, year));
|
||||
return Math.min(resolvePipeTypeColumnEndYear(statsYr), Math.max(1995, year));
|
||||
};
|
||||
|
||||
/** 조회 연도(statsYr)에 해당하는 연도별 매설연장 필드명 (y{year}LyngPrlg) */
|
||||
@@ -253,8 +255,9 @@ function getSewagePipeRowVerificationErrors(
|
||||
function normalizePipeTypeStatusRow(
|
||||
row: SeweragePipeInputPipeTypeStatusItem,
|
||||
ctpvNm: string,
|
||||
statsYr?: string | number | null,
|
||||
): Record<string, string | number | SeweragePipeInputVerificationResult | undefined> {
|
||||
const lastDataYear = getPipeTypeLastDataYear();
|
||||
const lastDataYear = resolvePipeTypeColumnEndYear(statsYr);
|
||||
const {
|
||||
yearlyStatList,
|
||||
lyngPrlgWhol,
|
||||
@@ -272,8 +275,8 @@ function normalizePipeTypeStatusRow(
|
||||
|
||||
for (const y of yearlyStatList ?? []) {
|
||||
const year = Number(y.lyngYr);
|
||||
if (!Number.isFinite(year)) continue;
|
||||
const targetYear = Math.min(lastDataYear, Math.max(1995, year));
|
||||
if (!Number.isFinite(year) || year > lastDataYear) continue;
|
||||
const targetYear = Math.max(1995, year);
|
||||
yearFields[`y${targetYear}PrlgWhol`] =
|
||||
(yearFields[`y${targetYear}PrlgWhol`] ?? 0) + Number(y.pipeWholPrlg ?? 0);
|
||||
yearFields[`y${targetYear}LyngPrlg`] =
|
||||
@@ -289,7 +292,10 @@ function normalizePipeTypeStatusRow(
|
||||
lyngPrlg: Number(lyngPrlgWhol ?? 0),
|
||||
dmltnPrlg: Number(dmltnPrlgWhol ?? 0),
|
||||
...yearFields,
|
||||
verificationResult: remapPipeTypePrlgWholVerification(verificationResult) ?? undefined,
|
||||
verificationResult:
|
||||
normalizeVerificationResultMap(
|
||||
remapPipeTypePrlgWholVerification(verificationResult),
|
||||
) ?? undefined,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -446,8 +452,7 @@ function computeTabToolbarSnapshot(
|
||||
(hasRowData || treatAsSearched) &&
|
||||
(showSaveInToolbar ||
|
||||
showEnterableToolbarButtons ||
|
||||
showSubmittedInInputPeriodToolbar ||
|
||||
(isSubmitted && isAdminInfo));
|
||||
showSubmittedInInputPeriodToolbar);
|
||||
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
|
||||
}
|
||||
|
||||
@@ -608,10 +613,14 @@ const SewagePipeInp = () => {
|
||||
};
|
||||
});
|
||||
return SewagePipeInpColumnInfoList.map((tab: ColumnInfoList) => {
|
||||
const canEdit =
|
||||
(computeTabEnterable(tabStatusInfoMap.get(tab.tabKey) ?? null, inputPeriodEnterable) || isAdminInfo) && inputPeriodEnterable;
|
||||
const applyEditable = (cols: ColumnConfig[] | undefined) =>
|
||||
const sourceTab =
|
||||
tab.tabKey === PIPE_TYPE_STATUS_TAB_KEY
|
||||
? getPipeTypeStatusInpColumn(lastSearchedYear)
|
||||
: tab;
|
||||
const canEdit =
|
||||
(computeTabEnterable(tabStatusInfoMap.get(sourceTab.tabKey) ?? null, inputPeriodEnterable) || isAdminInfo) && inputPeriodEnterable;
|
||||
const applyEditable = (cols: ColumnConfig[] | undefined) =>
|
||||
sourceTab.tabKey === PIPE_TYPE_STATUS_TAB_KEY
|
||||
? applyPipeTypeStatusEditableColumns(
|
||||
cols,
|
||||
canEdit,
|
||||
@@ -629,20 +638,20 @@ const SewagePipeInp = () => {
|
||||
},
|
||||
);
|
||||
|
||||
if (tab.left && tab.right) {
|
||||
if (sourceTab.left && sourceTab.right) {
|
||||
return {
|
||||
...tab,
|
||||
left: { ...tab.left, columns: applyColumnGuides(applyEditable(tab.left.columns), tab.tabKey) },
|
||||
right: { ...tab.right, columns: applyColumnGuides(applyEditable(tab.right.columns), tab.tabKey) },
|
||||
...sourceTab,
|
||||
left: { ...sourceTab.left, columns: applyColumnGuides(applyEditable(sourceTab.left.columns), sourceTab.tabKey) },
|
||||
right: { ...sourceTab.right, columns: applyColumnGuides(applyEditable(sourceTab.right.columns), sourceTab.tabKey) },
|
||||
};
|
||||
}
|
||||
return {
|
||||
...tab,
|
||||
columns: applyColumnGuides(applyEditable(tab.columns), tab.tabKey),
|
||||
...(tab.tabKey === PIPE_TYPE_STATUS_TAB_KEY && tab.columnLayout
|
||||
...sourceTab,
|
||||
columns: applyColumnGuides(applyEditable(sourceTab.columns), sourceTab.tabKey),
|
||||
...(sourceTab.tabKey === PIPE_TYPE_STATUS_TAB_KEY && sourceTab.columnLayout
|
||||
? {
|
||||
columnLayout: applyPipeTypeStatusColumnLayout(
|
||||
tab.columnLayout,
|
||||
sourceTab.columnLayout,
|
||||
shouldHidePipeTypeEditableYearDmltn(
|
||||
canEdit,
|
||||
inputPeriodEnterable,
|
||||
@@ -719,10 +728,12 @@ const SewagePipeInp = () => {
|
||||
const response = await statisticsInputSewPipeApiService.getRegionalFactStatus(searchParam);
|
||||
if (response.status === 'success') {
|
||||
const commonInfo = response.data.commonInfo;
|
||||
const convertedData = filterFetched(response.data.regionalFactStatusList).map((d) => ({
|
||||
ctpvNm: commonInfo.ctpvNm,
|
||||
...d,
|
||||
}));
|
||||
const convertedData = filterFetched(response.data.regionalFactStatusList).map((d) =>
|
||||
withNormalizedVerificationResult({
|
||||
ctpvNm: commonInfo.ctpvNm,
|
||||
...d,
|
||||
}),
|
||||
);
|
||||
applyRowMap((m) => m.set('ST00020001', toGridRows(convertedData)));
|
||||
setTabStatusInfoMap((prev) => new Map(prev).set(tabKey, response.data.statusInfo));
|
||||
setTabStatsCdMap((prev) => new Map(prev).set(tabKey, commonInfo.statsCd));
|
||||
@@ -749,10 +760,12 @@ const SewagePipeInp = () => {
|
||||
const response = await statisticsInputSewPipeApiService.getFactInstallStatus(searchParam);
|
||||
if (response.status === 'success') {
|
||||
const commonInfo = response.data.commonInfo;
|
||||
const convertedData = filterFetched(response.data.factInstallStatusList).map((d) => ({
|
||||
ctpvNm: commonInfo.ctpvNm,
|
||||
...d,
|
||||
}));
|
||||
const convertedData = filterFetched(response.data.factInstallStatusList).map((d) =>
|
||||
withNormalizedVerificationResult({
|
||||
ctpvNm: commonInfo.ctpvNm,
|
||||
...d,
|
||||
}),
|
||||
);
|
||||
if (convertedData.length === 0) {
|
||||
const alreadyHandledForSameSearch =
|
||||
factInstallNoDataHandledKeyRef.current === searchConditionKey;
|
||||
@@ -797,7 +810,11 @@ const SewagePipeInp = () => {
|
||||
if (response.status === 'success') {
|
||||
const commonInfo = response.data.commonInfo;
|
||||
const convertedData = filterFetched(response.data.pipeTypeStatusList).map((d) =>
|
||||
normalizePipeTypeStatusRow(d, commonInfo.ctpvNm),
|
||||
normalizePipeTypeStatusRow(
|
||||
d,
|
||||
commonInfo.ctpvNm,
|
||||
searchParam.statsYr ?? values.year,
|
||||
),
|
||||
);
|
||||
applyRowMap((m) => m.set('ST00020003', toGridRows(convertedData)));
|
||||
setTabStatusInfoMap((prev) => new Map(prev).set(tabKey, response.data.statusInfo));
|
||||
@@ -829,10 +846,12 @@ const SewagePipeInp = () => {
|
||||
const response = await statisticsInputSewPipeApiService.getPipeDiameterStatus(searchParam);
|
||||
if (response.status === 'success') {
|
||||
const commonInfo = response.data.commonInfo;
|
||||
const convertedData = filterFetched(response.data.pipeDiameterStatusList).map((d) => ({
|
||||
ctpvNm: commonInfo.ctpvNm,
|
||||
...d,
|
||||
}));
|
||||
const convertedData = filterFetched(response.data.pipeDiameterStatusList).map((d) =>
|
||||
withNormalizedVerificationResult({
|
||||
ctpvNm: commonInfo.ctpvNm,
|
||||
...d,
|
||||
}),
|
||||
);
|
||||
applyRowMap((m) => m.set('ST00020004', toGridRows(convertedData)));
|
||||
setTabStatusInfoMap((prev) => new Map(prev).set(tabKey, response.data.statusInfo));
|
||||
setTabStatsCdMap((prev) => new Map(prev).set(tabKey, commonInfo.statsCd));
|
||||
@@ -859,10 +878,12 @@ const SewagePipeInp = () => {
|
||||
const response = await statisticsInputSewPipeApiService.getManholeStatus(searchParam);
|
||||
if (response.status === 'success') {
|
||||
const commonInfo = response.data.commonInfo;
|
||||
const convertedData = filterFetched(response.data.manholeStatusList).map((d) => ({
|
||||
ctpvNm: commonInfo.ctpvNm,
|
||||
...d,
|
||||
}));
|
||||
const convertedData = filterFetched(response.data.manholeStatusList).map((d) =>
|
||||
withNormalizedVerificationResult({
|
||||
ctpvNm: commonInfo.ctpvNm,
|
||||
...d,
|
||||
}),
|
||||
);
|
||||
applyRowMap((m) => m.set('ST00020005', toGridRows(convertedData)));
|
||||
setTabStatusInfoMap((prev) => new Map(prev).set(tabKey, response.data.statusInfo));
|
||||
setTabStatsCdMap((prev) => new Map(prev).set(tabKey, commonInfo.statsCd));
|
||||
@@ -889,13 +910,15 @@ const SewagePipeInp = () => {
|
||||
const response = await statisticsInputSewPipeApiService.getConnectionStatus(searchParam);
|
||||
if (response.status === 'success') {
|
||||
const commonInfo = response.data.commonInfo;
|
||||
const facilityConvertedData = filterFetched(response.data.facilityConnectionList).map((d) => ({
|
||||
...d,
|
||||
}));
|
||||
const adminConvertedData = filterFetched(response.data.adminAreaConnectionList).map((d) => ({
|
||||
...d,
|
||||
ctpvNm: d.ctpvNm || commonInfo.ctpvNm,
|
||||
}));
|
||||
const facilityConvertedData = filterFetched(response.data.facilityConnectionList).map((d) =>
|
||||
withNormalizedVerificationResult({ ...d }),
|
||||
);
|
||||
const adminConvertedData = filterFetched(response.data.adminAreaConnectionList).map((d) =>
|
||||
withNormalizedVerificationResult({
|
||||
...d,
|
||||
ctpvNm: d.ctpvNm || commonInfo.ctpvNm,
|
||||
}),
|
||||
);
|
||||
applyRowMap((m) => {
|
||||
m.set('treatmentPlantConnectionInp', toGridRows(facilityConvertedData));
|
||||
m.set('adminAreaConnectionInp', toGridRows(adminConvertedData));
|
||||
@@ -1304,7 +1327,7 @@ const SewagePipeInp = () => {
|
||||
return;
|
||||
}
|
||||
const columnFormatMap = new Map<string, string>();
|
||||
PipeTypeStatusInpColumn.columns.forEach((col) => {
|
||||
getPipeTypeStatusInpColumn(values.year).columns.forEach((col) => {
|
||||
if (col.fieldName && col.dataFormat) columnFormatMap.set(col.fieldName, col.dataFormat);
|
||||
});
|
||||
const formatNumber = (value: string | number | null | undefined, fieldName: string): number => {
|
||||
@@ -1316,7 +1339,7 @@ const SewagePipeInp = () => {
|
||||
const decimalPlaces = format.match(/\.(\d+)/)?.[1]?.length ?? 0;
|
||||
return decimalPlaces > 0 ? parseFloat(num.toFixed(decimalPlaces)) : Math.round(num);
|
||||
};
|
||||
const lastDataYear = getPipeTypeLastDataYear();
|
||||
const lastDataYear = resolvePipeTypeColumnEndYear(values.year);
|
||||
const submitList = currentData.map((d) => {
|
||||
const yearlyStatList = [];
|
||||
for (let year = 1995; year <= lastDataYear; year++) {
|
||||
@@ -1338,7 +1361,6 @@ const SewagePipeInp = () => {
|
||||
rmrk: nullableTrimmedString(d.rmrk),
|
||||
lyngPrlgWhol: formatNumber(d.lyngPrlg, "lyngPrlg"),
|
||||
dmltnPrlgWhol: formatNumber(d.dmltnPrlg, "dmltnPrlg"),
|
||||
pipeByPrstWhol: formatNumber(d.pipeByPrstWhol, "pipeByPrstWhol"),
|
||||
};
|
||||
});
|
||||
const requestData: SeweragePipeInputPipeTypeStatusSubmitRequest = {
|
||||
@@ -1455,7 +1477,13 @@ const SewagePipeInp = () => {
|
||||
};
|
||||
|
||||
try {
|
||||
const imrResponse = await statisticsApi.callImrService(imrParam);
|
||||
const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
|
||||
statsYr: values.year ?? "",
|
||||
statsCd: statsCdForTab,
|
||||
sewerBzmnCd: values?.bsnmCd ?? "",
|
||||
rollbackStatusCode: statusForTab?.lclgvSbmsnSttsCd ?? "",
|
||||
mdfrUuid: userInfo.userUnqId,
|
||||
});
|
||||
if (imrResponse.job_id) {
|
||||
await waitForImrJobCompleted(
|
||||
imrResponse.job_id,
|
||||
@@ -1782,7 +1810,7 @@ const SewagePipeInp = () => {
|
||||
}
|
||||
|
||||
const columnFormatMap = new Map<string, string>();
|
||||
PipeTypeStatusInpColumn.columns.forEach((col) => {
|
||||
getPipeTypeStatusInpColumn(values.year).columns.forEach((col) => {
|
||||
if (col.fieldName && col.dataFormat) {
|
||||
columnFormatMap.set(col.fieldName, col.dataFormat);
|
||||
}
|
||||
@@ -1798,7 +1826,7 @@ const SewagePipeInp = () => {
|
||||
return decimalPlaces > 0 ? parseFloat(num.toFixed(decimalPlaces)) : Math.round(num);
|
||||
};
|
||||
|
||||
const lastDataYear = getPipeTypeLastDataYear();
|
||||
const lastDataYear = resolvePipeTypeColumnEndYear(values.year);
|
||||
|
||||
const saveList = currentData.map((d) => {
|
||||
const yearlyStatList = [];
|
||||
@@ -1830,7 +1858,6 @@ const SewagePipeInp = () => {
|
||||
rmrk: nullableTrimmedString(d.rmrk),
|
||||
lyngPrlgWhol: formatNumber(d.lyngPrlg, "lyngPrlg"),
|
||||
dmltnPrlgWhol: formatNumber(d.dmltnPrlg, "dmltnPrlg"),
|
||||
pipeByPrstWhol: formatNumber(d.pipeByPrstWhol, "pipeByPrstWhol"),
|
||||
};
|
||||
});
|
||||
|
||||
@@ -2041,7 +2068,7 @@ const SewagePipeInp = () => {
|
||||
{submitOk && <SubmitButton submitFunc={() => void submitFunc(false)} />}
|
||||
</>
|
||||
)}
|
||||
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && (
|
||||
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
|
||||
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
|
||||
)}
|
||||
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
|
||||
@@ -2173,7 +2200,11 @@ const SewagePipeInp = () => {
|
||||
return (
|
||||
<TabsContent key={tabKey} value={tabKey}>
|
||||
<DataGrid
|
||||
key={tabKey}
|
||||
key={
|
||||
tabKey === PIPE_TYPE_STATUS_TAB_KEY
|
||||
? `${tabKey}-${lastSearchedYear ?? ""}`
|
||||
: tabKey
|
||||
}
|
||||
columnInfo={gridColumnInfo}
|
||||
rowStartNum={info.rowStartNum}
|
||||
excelExportFileSuffix={info.tabLabel || tabKey}
|
||||
@@ -2237,17 +2268,7 @@ const SewagePipeInp = () => {
|
||||
tabKey,
|
||||
);
|
||||
if (Array.isArray(errors) && errors.length > 0) {
|
||||
return errors
|
||||
.map((e) => {
|
||||
const prefix =
|
||||
e.vrfcCd === "IMR" ? "시계열 검증 - " : (e.vrfcCd === "NV" ? "일반검증 - " : "모집단 검증 - ");
|
||||
const comp = e.cmprCn ?? "";
|
||||
const now = e.nowCn ?? "";
|
||||
return `${prefix}${e.rsnExpln}
|
||||
(검증 기준값: ${comp} / 현재 입력값: ${now})`;
|
||||
})
|
||||
.filter(Boolean)
|
||||
.join("\n");
|
||||
return formatVerificationTooltip(errors);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -11,6 +11,7 @@ import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
|
||||
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
|
||||
import { sewagePipeMaintainApiService } from "@/entities/statistics/api/input/statistics-input-sewage-pipe-maintain-service";
|
||||
import { statisticsApi } from "@/entities/statistics/api/statistics-service";
|
||||
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
|
||||
import type {
|
||||
SewagePipeMaintainDredgingSaveItem,
|
||||
SewagePipeMaintainDredgingSaveRequest,
|
||||
@@ -69,7 +70,11 @@ import {
|
||||
patchFooterVerificationByTab,
|
||||
patchVerificationFailedByTab,
|
||||
} from "@/components/util/input/verification-failed-flag";
|
||||
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display";
|
||||
import {
|
||||
formatVerificationTooltip,
|
||||
withNormalizedVerificationResult,
|
||||
type VerificationResultLikeMap,
|
||||
} from "@/components/util/input/verification-result-display";
|
||||
import { nullableTrimmedString } from "@/components/util/input/nullableString";
|
||||
import { useAdminStore } from "@/store/admin-store";
|
||||
import { useStatisticsInputFocusStore } from "@/store/statistics-input-focus-store";
|
||||
@@ -151,8 +156,7 @@ function computeTabToolbarSnapshot(
|
||||
(hasRowData || treatAsSearched) &&
|
||||
(showSaveInToolbar ||
|
||||
showEnterableToolbarButtons ||
|
||||
showSubmittedInInputPeriodToolbar ||
|
||||
(isSubmitted && isAdminInfo));
|
||||
showSubmittedInInputPeriodToolbar);
|
||||
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
|
||||
}
|
||||
|
||||
@@ -444,10 +448,12 @@ const SewagePipeMaintainInp = () => {
|
||||
repairStatusList ?? [],
|
||||
sidoListRef.current,
|
||||
searchContext,
|
||||
).map((d) => ({
|
||||
ctpvNm: commonInfo.ctpvNm,
|
||||
...d,
|
||||
}));
|
||||
).map((d) =>
|
||||
withNormalizedVerificationResult({
|
||||
ctpvNm: commonInfo.ctpvNm,
|
||||
...d,
|
||||
}),
|
||||
);
|
||||
const gridRows = toGridRows(convertedData);
|
||||
|
||||
applyRowMap(mergeIntoExistingMap, (m) => {
|
||||
@@ -487,10 +493,12 @@ const SewagePipeMaintainInp = () => {
|
||||
pipeDredgingStatusList ?? [],
|
||||
sidoListRef.current,
|
||||
searchContext,
|
||||
).map((d) => ({
|
||||
ctpvNm: commonInfo.ctpvNm,
|
||||
...d,
|
||||
}));
|
||||
).map((d) =>
|
||||
withNormalizedVerificationResult({
|
||||
ctpvNm: commonInfo.ctpvNm,
|
||||
...d,
|
||||
}),
|
||||
);
|
||||
const gridRows = toGridRows(convertedData);
|
||||
|
||||
applyRowMap(mergeIntoExistingMap, (m) => {
|
||||
@@ -678,7 +686,13 @@ const SewagePipeMaintainInp = () => {
|
||||
};
|
||||
|
||||
try {
|
||||
const imrResponse = await statisticsApi.callImrService(imrParam);
|
||||
const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
|
||||
statsYr: lastSearchedValues.year ?? "",
|
||||
statsCd: statsCdForTab,
|
||||
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
|
||||
rollbackStatusCode: activeTabStatus?.lclgvSbmsnSttsCd ?? "",
|
||||
mdfrUuid: userInfo.userUnqId,
|
||||
});
|
||||
if (imrResponse.job_id) {
|
||||
await waitForImrJobCompleted(
|
||||
imrResponse.job_id,
|
||||
@@ -1103,14 +1117,7 @@ const SewagePipeMaintainInp = () => {
|
||||
if (!verification) return;
|
||||
const errors = verification[fieldName];
|
||||
if (Array.isArray(errors) && errors.length > 0) {
|
||||
return errors
|
||||
.map((e) => {
|
||||
const prefix =
|
||||
e.vrfcCd === "IMR" ? "시계열 검증 - " : e.vrfcCd === "NV" ? "일반검증 - " : "모집단 검증 - ";
|
||||
return `${prefix}${e.rsnExpln}(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
|
||||
})
|
||||
.filter(Boolean)
|
||||
.join("\n");
|
||||
return formatVerificationTooltip(errors);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1142,7 +1149,7 @@ const SewagePipeMaintainInp = () => {
|
||||
{submitOk && <SubmitButton submitFunc={submitFunc} />}
|
||||
</>
|
||||
)}
|
||||
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && (
|
||||
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
|
||||
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
|
||||
)}
|
||||
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
|
||||
|
||||
@@ -17,10 +17,12 @@ import { useAlertStore, useGlobalProgressStore, useStatisticsInputToolbarGroupGa
|
||||
import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation";
|
||||
import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation";
|
||||
import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
|
||||
import { filterSggOptionsBySearchGugun } from "@/components/util/input/filter-sgg-options-by-search";
|
||||
import { nullableTrimmedString } from "@/components/util/input/nullableString";
|
||||
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
|
||||
import { statisticsInputSewageReservoirPumpApi } from "@/entities/statistics/api/input/statistics-input-sewage-reservoir-pump-service";
|
||||
import { statisticsApi } from "@/entities/statistics/api/statistics-service";
|
||||
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
|
||||
import {
|
||||
type RainfallPumpStationItem,
|
||||
type RainfallPumpStationSaveItem,
|
||||
@@ -89,7 +91,11 @@ import {
|
||||
patchFooterVerificationByTab,
|
||||
patchVerificationFailedByTab,
|
||||
} from "@/components/util/input/verification-failed-flag";
|
||||
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display";
|
||||
import {
|
||||
formatVerificationTooltip,
|
||||
normalizeVerificationResultMap,
|
||||
type VerificationResultLikeMap,
|
||||
} from "@/components/util/input/verification-result-display";
|
||||
import { useAdminStore } from "@/store/admin-store";
|
||||
import { useTabStore } from "@/store/tab-store";
|
||||
|
||||
@@ -171,8 +177,7 @@ function computeTabToolbarSnapshot(
|
||||
(hasRowData || treatAsSearched) &&
|
||||
(showSaveInToolbar ||
|
||||
showEnterableToolbarButtons ||
|
||||
showSubmittedInInputPeriodToolbar ||
|
||||
(isSubmitted && isAdminInfo));
|
||||
showSubmittedInInputPeriodToolbar);
|
||||
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
|
||||
}
|
||||
|
||||
@@ -279,7 +284,7 @@ function mapSewageReservoirListToGridRows(
|
||||
},
|
||||
])[0] as GridRowWithVerification;
|
||||
if (item.verificationResult) {
|
||||
row.verificationResult = item.verificationResult;
|
||||
row.verificationResult = normalizeVerificationResultMap(item.verificationResult);
|
||||
}
|
||||
return row;
|
||||
});
|
||||
@@ -435,7 +440,7 @@ function mapRainfallPumpStationListToGridRows(
|
||||
])[0] as GridRowWithVerification;
|
||||
|
||||
if (item.verificationResult) {
|
||||
row.verificationResult = item.verificationResult;
|
||||
row.verificationResult = normalizeVerificationResultMap(item.verificationResult);
|
||||
}
|
||||
return row;
|
||||
});
|
||||
@@ -864,7 +869,13 @@ const SewageReservoirPumpInp = () => {
|
||||
};
|
||||
|
||||
try {
|
||||
const imrResponse = await statisticsApi.callImrService(imrParam);
|
||||
const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
|
||||
statsYr: lastSearchedValues.year ?? "",
|
||||
statsCd: statsCdForTab,
|
||||
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
|
||||
rollbackStatusCode: activeTabStatus?.lclgvSbmsnSttsCd ?? "",
|
||||
mdfrUuid: userInfo.userUnqId,
|
||||
});
|
||||
if (imrResponse.job_id) {
|
||||
await waitForImrJobCompleted(
|
||||
imrResponse.job_id,
|
||||
@@ -1480,7 +1491,11 @@ const SewageReservoirPumpInp = () => {
|
||||
col.fieldName === "sggNm" &&
|
||||
canEdit
|
||||
) {
|
||||
return buildSggNmColumn(col, true, sggOptions);
|
||||
return buildSggNmColumn(
|
||||
col,
|
||||
true,
|
||||
filterSggOptionsBySearchGugun(sggOptions, lastSearchedValues?.gugun),
|
||||
);
|
||||
}
|
||||
return col;
|
||||
}).map((col) => {
|
||||
@@ -1493,7 +1508,7 @@ const SewageReservoirPumpInp = () => {
|
||||
});
|
||||
}
|
||||
return map;
|
||||
}, [tabStatusInfoMap, inputPeriodEnterable, isAdminInfo, sggOptions, columnGuidesByTab]);
|
||||
}, [tabStatusInfoMap, inputPeriodEnterable, isAdminInfo, sggOptions, lastSearchedValues?.gugun, columnGuidesByTab]);
|
||||
|
||||
const verificationCellStyle = ({
|
||||
fieldName,
|
||||
@@ -1516,19 +1531,7 @@ const SewageReservoirPumpInp = () => {
|
||||
if (!verification) return;
|
||||
const errors = verification[fieldName];
|
||||
if (Array.isArray(errors) && errors.length > 0) {
|
||||
return errors
|
||||
.map((e) => {
|
||||
const prefix =
|
||||
e.vrfcCd === "IMR"
|
||||
? "시계열 검증 - "
|
||||
: e.vrfcCd === "NV"
|
||||
? "일반검증 - "
|
||||
: "모집단 검증 -";
|
||||
return `${prefix}${e.rsnExpln}
|
||||
(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
|
||||
})
|
||||
.filter(Boolean)
|
||||
.join("\n");
|
||||
return formatVerificationTooltip(errors);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1584,7 +1587,7 @@ const SewageReservoirPumpInp = () => {
|
||||
{submitOk && <SubmitButton submitFunc={submitFunc} />}
|
||||
</>
|
||||
)}
|
||||
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && (
|
||||
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
|
||||
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
|
||||
)}
|
||||
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
|
||||
|
||||
@@ -2,12 +2,13 @@ import { useEffect, useMemo, useRef, useState } from "react";
|
||||
|
||||
import { useConfirm } from "@frontend-opensource/use-react-hooks";
|
||||
|
||||
import { useAlertStore, useGlobalProgressStore, useSearchConditionSidoList } from "@/shared/lib";
|
||||
import { useAlertStore, useGlobalProgressStore, useSearchConditionSidoList, useUserStore } from "@/shared/lib";
|
||||
import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation";
|
||||
import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation";
|
||||
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
|
||||
import { statisticsInputSewerageFinanceApi } from "@/entities/statistics/api/input/statistics-input-sewerage-finance-service";
|
||||
import { statisticsApi } from "@/entities/statistics/api/statistics-service";
|
||||
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
|
||||
import type {
|
||||
CauserBurdenItem,
|
||||
CauserBurdenSaveItem,
|
||||
@@ -40,7 +41,10 @@ import type {
|
||||
import {
|
||||
filterBySelectedAdmdstCd,
|
||||
isGugunOkForToolbar,
|
||||
isJeonnamGwangjuSidoAllSearch,
|
||||
isJeonnamGwangjuSidoAllToolbarException,
|
||||
isSubmitOkForToolbar,
|
||||
JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE,
|
||||
toInputSearchRegion,
|
||||
} from "@/entities/statistics";
|
||||
|
||||
@@ -73,7 +77,11 @@ import {
|
||||
patchFooterVerificationByTab,
|
||||
patchVerificationFailedByTab,
|
||||
} from "@/components/util/input/verification-failed-flag";
|
||||
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display";
|
||||
import {
|
||||
formatVerificationTooltip,
|
||||
normalizeVerificationResultMap,
|
||||
type VerificationResultLikeMap,
|
||||
} from "@/components/util/input/verification-result-display";
|
||||
import { nullableTrimmedString } from "@/components/util/input/nullableString";
|
||||
import { useAdminStore } from "@/store/admin-store";
|
||||
import { useTabStore } from "@/store/tab-store";
|
||||
@@ -128,12 +136,31 @@ const computeTabEnterable = (
|
||||
};
|
||||
|
||||
const sidoListRef: { current: Sido[] } = { current: [] };
|
||||
const financeToolbarUserIdRef: { current: string } = { current: "" };
|
||||
|
||||
function buildGugunOkForToolbar(values: SearchFormValues | null): boolean {
|
||||
if (
|
||||
isJeonnamGwangjuSidoAllToolbarException(
|
||||
sidoListRef.current,
|
||||
values,
|
||||
financeToolbarUserIdRef.current,
|
||||
)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return isGugunOkForToolbar(sidoListRef.current, values);
|
||||
}
|
||||
|
||||
function buildSubmitOkForToolbar(values: SearchFormValues | null): boolean {
|
||||
if (
|
||||
isJeonnamGwangjuSidoAllToolbarException(
|
||||
sidoListRef.current,
|
||||
values,
|
||||
financeToolbarUserIdRef.current,
|
||||
)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return isSubmitOkForToolbar(sidoListRef.current, values);
|
||||
}
|
||||
|
||||
@@ -155,8 +182,7 @@ function computeTabToolbarSnapshot(
|
||||
(hasRowData || treatAsSearched) &&
|
||||
(showSaveInToolbar ||
|
||||
showEnterableToolbarButtons ||
|
||||
showSubmittedInInputPeriodToolbar ||
|
||||
(isSubmitted && isAdminInfo));
|
||||
showSubmittedInInputPeriodToolbar);
|
||||
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
|
||||
}
|
||||
|
||||
@@ -174,7 +200,9 @@ function mapRegionalListToGridRows<
|
||||
return filterBySelectedAdmdstCd(list, sidoListRef.current, values).map((item) => {
|
||||
const { verificationResult, ...rest } = item;
|
||||
const row = toGridRows([{ ctpvNm, ...rest }])[0] as GridRowWithVerification;
|
||||
if (verificationResult) row.verificationResult = verificationResult;
|
||||
if (verificationResult) {
|
||||
row.verificationResult = normalizeVerificationResultMap(verificationResult);
|
||||
}
|
||||
return row;
|
||||
});
|
||||
}
|
||||
@@ -350,6 +378,8 @@ async function waitForImrJobCompleted(
|
||||
const SewerageFinanceInp = () => {
|
||||
const { sidoList } = useSearchConditionSidoList({ isInput: true });
|
||||
sidoListRef.current = sidoList;
|
||||
const userId = useUserStore((state) => state.userInfo?.userId ?? "");
|
||||
financeToolbarUserIdRef.current = userId;
|
||||
const { setMessage: alert } = useAlertStore((state) => state);
|
||||
const { confirm } = useConfirm();
|
||||
const { isAdminInfo } = useAdminStore();
|
||||
@@ -818,7 +848,13 @@ const SewerageFinanceInp = () => {
|
||||
alert("제출할 데이터가 없습니다.");
|
||||
return;
|
||||
}
|
||||
if (await confirm("제출 하시겠습니까?")) {
|
||||
const submitConfirmMessage = isJeonnamGwangjuSidoAllSearch(
|
||||
sidoListRef.current,
|
||||
lastSearchedValues,
|
||||
)
|
||||
? JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE
|
||||
: "제출 하시겠습니까?";
|
||||
if (await confirm(submitConfirmMessage)) {
|
||||
setShowSubmitDialog(true);
|
||||
}
|
||||
})();
|
||||
@@ -940,7 +976,13 @@ const SewerageFinanceInp = () => {
|
||||
};
|
||||
|
||||
try {
|
||||
const imrResponse = await statisticsApi.callImrService(imrParam);
|
||||
const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
|
||||
statsYr: lastSearchedValues.year ?? "",
|
||||
statsCd: statsCdForTab,
|
||||
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
|
||||
rollbackStatusCode: activeTabStatus?.lclgvSbmsnSttsCd ?? "",
|
||||
mdfrUuid: userInfo.userUnqId,
|
||||
});
|
||||
if (imrResponse.job_id) {
|
||||
await waitForImrJobCompleted(
|
||||
imrResponse.job_id,
|
||||
@@ -1009,7 +1051,13 @@ const SewerageFinanceInp = () => {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!(await confirm("저장 하시겠습니까?"))) return;
|
||||
const saveConfirmMessage = isJeonnamGwangjuSidoAllSearch(
|
||||
sidoListRef.current,
|
||||
lastSearchedValues,
|
||||
)
|
||||
? JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE
|
||||
: "저장 하시겠습니까?";
|
||||
if (!(await confirm(saveConfirmMessage))) return;
|
||||
|
||||
const currentData = getTabGridRows(tabKey);
|
||||
if (!currentData.length) {
|
||||
@@ -1187,6 +1235,11 @@ const SewerageFinanceInp = () => {
|
||||
const { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard } =
|
||||
activeTabToolbar;
|
||||
const submitOk = buildSubmitOkForToolbar(searchContextForToolbar);
|
||||
const disableSubmit = isJeonnamGwangjuSidoAllToolbarException(
|
||||
sidoListRef.current,
|
||||
searchContextForToolbar,
|
||||
financeToolbarUserIdRef.current,
|
||||
);
|
||||
|
||||
const verificationCellStyle = ({
|
||||
fieldName,
|
||||
@@ -1215,18 +1268,7 @@ const SewerageFinanceInp = () => {
|
||||
if (!verification) return;
|
||||
const errors = verification[fieldName];
|
||||
if (Array.isArray(errors) && errors.length > 0) {
|
||||
return errors
|
||||
.map((e) => {
|
||||
const prefix =
|
||||
e.vrfcCd === "IMR"
|
||||
? "시계열 검증 - "
|
||||
: e.vrfcCd === "NV"
|
||||
? "일반검증 - "
|
||||
: "모집단 검증 - ";
|
||||
return `${prefix}${e.rsnExpln}(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
|
||||
})
|
||||
.filter(Boolean)
|
||||
.join("\n");
|
||||
return formatVerificationTooltip(errors);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1266,10 +1308,12 @@ const SewerageFinanceInp = () => {
|
||||
<LastYearDataButton
|
||||
getLastYearDataFunc={() => void lastYearDataFunc()}
|
||||
/>
|
||||
{submitOk && <SubmitButton submitFunc={submitFunc} />}
|
||||
{submitOk && (
|
||||
<SubmitButton submitFunc={submitFunc} disabled={disableSubmit} />
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && (
|
||||
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
|
||||
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
|
||||
)}
|
||||
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
|
||||
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
|
||||
import { statisticsApi } from "@/entities/statistics/api/statistics-service";
|
||||
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
|
||||
import {
|
||||
type CheckInputPeriodItem,
|
||||
getVerificationPeriodActionBlockedMessage,
|
||||
@@ -58,7 +59,11 @@ import { toGridRows } from "@/components/util/grid/gridFunction";
|
||||
import { toExcelExportSearchContextFromSearchForm } from "@/components/util/gridExcelExport";
|
||||
import { nullableTrimmedString } from "@/components/util/input/nullableString";
|
||||
import { isVerificationFailedFromCommonInfo } from "@/components/util/input/verification-failed-flag";
|
||||
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display";
|
||||
import {
|
||||
formatVerificationTooltip,
|
||||
normalizeVerificationResultMap,
|
||||
type VerificationResultLikeMap,
|
||||
} from "@/components/util/input/verification-result-display";
|
||||
import { useAdminStore } from "@/store/admin-store";
|
||||
import { useStatisticsInputFocusStore } from "@/store/statistics-input-focus-store";
|
||||
import { useTabStore } from "@/store/tab-store";
|
||||
@@ -87,7 +92,7 @@ const remapCommonInfoVerificationToGridFields = (
|
||||
// API 키로도 조회 가능하도록 유지
|
||||
if (gridField !== key) remapped[key] = errors;
|
||||
}
|
||||
return remapped;
|
||||
return normalizeVerificationResultMap(remapped) ?? remapped;
|
||||
};
|
||||
|
||||
/** 컬럼 가이드 API 조회용 통계코드 (하수도 보급률) */
|
||||
@@ -302,7 +307,11 @@ const SeweragePenetrationRateInp = () => {
|
||||
setRowData(
|
||||
convertedData.map((d) => {
|
||||
const row = toGridRows([d])[0] as GridRowWithVerification;
|
||||
if (d.verificationResult) row.verificationResult = d.verificationResult;
|
||||
if (d.verificationResult) {
|
||||
row.verificationResult = normalizeVerificationResultMap(
|
||||
d.verificationResult,
|
||||
);
|
||||
}
|
||||
return row;
|
||||
})
|
||||
);
|
||||
@@ -558,7 +567,13 @@ const SeweragePenetrationRateInp = () => {
|
||||
};
|
||||
|
||||
try {
|
||||
const imrResponse = await statisticsApi.callImrService(imrParam);
|
||||
const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
|
||||
statsYr: searchValues?.year ?? "",
|
||||
statsCd,
|
||||
sewerBzmnCd: searchValues?.bsnmCd ?? "",
|
||||
rollbackStatusCode: statusInfo?.lclgvSbmsnSttsCd ?? "",
|
||||
mdfrUuid: userInfo.userUnqId,
|
||||
});
|
||||
if (imrResponse.job_id) {
|
||||
await waitForImrJobCompleted(imrResponse.job_id, (id) =>
|
||||
statisticsApi.getImrStatus(id),
|
||||
@@ -800,8 +815,7 @@ const SeweragePenetrationRateInp = () => {
|
||||
toolbarGroupAllowed &&
|
||||
(baseShowSaveInToolbar ||
|
||||
baseShowEnterableToolbarButtons ||
|
||||
showSubmittedInInputPeriodToolbar ||
|
||||
(isSubmitted && isAdminInfo));
|
||||
showSubmittedInInputPeriodToolbar);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -827,7 +841,7 @@ const SeweragePenetrationRateInp = () => {
|
||||
{submitOk && <SubmitButton submitFunc={() => submitFunc(false)} />}
|
||||
</>
|
||||
)}
|
||||
{statusInfo?.lclgvSbmsnSttsCd === '2' && submitOk && <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />}
|
||||
{statusInfo?.lclgvSbmsnSttsCd === '2' && submitOk && inputPeriodCurrent && <CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />}
|
||||
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
|
||||
</div>
|
||||
</div>
|
||||
@@ -867,14 +881,7 @@ const SeweragePenetrationRateInp = () => {
|
||||
if (!verification) return;
|
||||
const errors = verification[fieldName];
|
||||
if (Array.isArray(errors) && errors.length > 0) {
|
||||
return errors
|
||||
.map((e) => {
|
||||
const prefix = e.vrfcCd === 'IMR' ? '시계열 검증 - ' : (e.vrfcCd === 'NV' ? '일반검증 - ' : '모집단 검증 -');
|
||||
return `${prefix}${e.rsnExpln}
|
||||
(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
|
||||
})
|
||||
.filter(Boolean)
|
||||
.join('\n');
|
||||
return formatVerificationTooltip(errors);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
||||
@@ -9,6 +9,7 @@ import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
|
||||
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
|
||||
import { statisticsInputSewerageServiceLevelApi } from "@/entities/statistics/api/input/statistics-input-sewerage-service-level-service";
|
||||
import { statisticsApi } from "@/entities/statistics/api/statistics-service";
|
||||
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
|
||||
import {
|
||||
SEWERAGE_SERVICE_LEVEL_COMPLAINT_STATS_CD,
|
||||
SEWERAGE_SERVICE_LEVEL_RESIDENT_FRIENDLY_FACT_STATS_CD,
|
||||
@@ -63,7 +64,11 @@ import {
|
||||
patchFooterVerificationByTab,
|
||||
patchVerificationFailedByTab,
|
||||
} from "@/components/util/input/verification-failed-flag";
|
||||
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display";
|
||||
import {
|
||||
formatVerificationTooltip,
|
||||
normalizeVerificationResultMap,
|
||||
type VerificationResultLikeMap,
|
||||
} from "@/components/util/input/verification-result-display";
|
||||
import { nullableTrimmedString } from "@/components/util/input/nullableString";
|
||||
import { useAdminStore } from "@/store/admin-store";
|
||||
import { useTabStore } from "@/store/tab-store";
|
||||
@@ -164,8 +169,7 @@ function computeTabToolbarSnapshot(
|
||||
(hasRowData || treatAsSearched) &&
|
||||
(showSaveInToolbar ||
|
||||
showEnterableToolbarButtons ||
|
||||
showSubmittedInInputPeriodToolbar ||
|
||||
(isSubmitted && isAdminInfo));
|
||||
showSubmittedInInputPeriodToolbar);
|
||||
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
|
||||
}
|
||||
|
||||
@@ -187,7 +191,9 @@ function mapServiceLevelListToGridRows<
|
||||
return filterBySelectedAdmdstCd(list, sidoListRef.current, values).map((item) => {
|
||||
const { verificationResult, ...rest } = item;
|
||||
const row = toGridRows([{ ctpvNm, ...rest }])[0] as GridRowWithVerification;
|
||||
if (verificationResult) row.verificationResult = verificationResult;
|
||||
if (verificationResult) {
|
||||
row.verificationResult = normalizeVerificationResultMap(verificationResult);
|
||||
}
|
||||
return row;
|
||||
});
|
||||
}
|
||||
@@ -839,7 +845,13 @@ const SewerageServiceLevelInp = () => {
|
||||
};
|
||||
|
||||
try {
|
||||
const imrResponse = await statisticsApi.callImrService(imrParam);
|
||||
const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
|
||||
statsYr: lastSearchedValues.year ?? "",
|
||||
statsCd: statsCdForTab,
|
||||
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
|
||||
rollbackStatusCode: activeTabStatus?.lclgvSbmsnSttsCd ?? "",
|
||||
mdfrUuid: userInfo.userUnqId,
|
||||
});
|
||||
if (imrResponse.job_id) {
|
||||
await waitForImrJobCompleted(
|
||||
imrResponse.job_id,
|
||||
@@ -1146,18 +1158,7 @@ const SewerageServiceLevelInp = () => {
|
||||
if (!verification) return;
|
||||
const errors = verification[fieldName];
|
||||
if (Array.isArray(errors) && errors.length > 0) {
|
||||
return errors
|
||||
.map((e) => {
|
||||
const prefix =
|
||||
e.vrfcCd === "IMR"
|
||||
? "시계열 검증 - "
|
||||
: e.vrfcCd === "NV"
|
||||
? "일반검증 - "
|
||||
: "모집단 검증 - ";
|
||||
return `${prefix}${e.rsnExpln}(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
|
||||
})
|
||||
.filter(Boolean)
|
||||
.join("\n");
|
||||
return formatVerificationTooltip(errors);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1200,7 +1201,7 @@ const SewerageServiceLevelInp = () => {
|
||||
{submitOk && <SubmitButton submitFunc={submitFunc} />}
|
||||
</>
|
||||
)}
|
||||
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && (
|
||||
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
|
||||
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
|
||||
)}
|
||||
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
|
||||
|
||||
@@ -20,8 +20,8 @@ const StatisticsReviewHistory = () => {
|
||||
{ name: "ctpvNm", fieldName: "ctpvNm", header: { text: "시도" }, editable: false },
|
||||
{ name: "sggNm", fieldName: "sggNm", header: { text: "시군구" }, editable: false },
|
||||
{ name: "menuNm", fieldName: "menuNm", header: { text: "통계항목" }, editable: false },
|
||||
{ name: "chckerOpinionSm", fieldName: "chckerOpinionSm", header: { text: "검토자의견" }, editable: false },
|
||||
{ name: "wrterOpinionSm", fieldName: "wrterOpinionSm", header: { text: "처리내역" }, editable: false },
|
||||
{ name: "splmntOpnnCn", fieldName: "splmntOpnnCn", header: { text: "검토자의견" }, editable: false },
|
||||
{ name: "rjctOpnnCn", fieldName: "rjctOpnnCn", header: { text: "반려의견" }, editable: false },
|
||||
];
|
||||
|
||||
const columnLayout = [
|
||||
@@ -29,8 +29,8 @@ const StatisticsReviewHistory = () => {
|
||||
"ctpvNm",
|
||||
"sggNm",
|
||||
"menuNm",
|
||||
"chckerOpinionSm",
|
||||
"wrterOpinionSm",
|
||||
"splmntOpnnCn",
|
||||
"rjctOpnnCn",
|
||||
];
|
||||
|
||||
const handleSearch = async (values: SearchFormValues) => {
|
||||
|
||||
@@ -17,10 +17,12 @@ import { useAlertStore, useGlobalProgressStore, useStatisticsInputToolbarGroupGa
|
||||
import { STATISTICS_INPUT_URL_PATH } from "@/shared/lib/stats-cd-input-navigation";
|
||||
import { useStatisticsInputPendingNavigation } from "@/shared/lib/use-statistics-input-pending-navigation";
|
||||
import { ConfirmDialog } from "@/shared/ui/confirm-dialog";
|
||||
import { filterSggOptionsBySearchGugun } from "@/components/util/input/filter-sgg-options-by-search";
|
||||
import { nullableTrimmedString } from "@/components/util/input/nullableString";
|
||||
import { statisticsInputSewSupplyRateApi } from "@/entities/statistics/api/input/statistics-input-sew-supply-rate-service";
|
||||
import { statisticsInputWaterReuseApi } from "@/entities/statistics/api/input/statistics-input-water-reuse-service";
|
||||
import { statisticsApi } from "@/entities/statistics/api/statistics-service";
|
||||
import { callImrServiceWithRollbackOnFailure } from "@/components/util/input/call-imr-with-rollback";
|
||||
import {
|
||||
type PublicSewageTreatWaterReuseItem,
|
||||
type PublicSewageTreatWaterReuseSaveItem,
|
||||
@@ -93,7 +95,11 @@ import {
|
||||
patchFooterVerificationByTab,
|
||||
patchVerificationFailedByTab,
|
||||
} from "@/components/util/input/verification-failed-flag";
|
||||
import type { VerificationResultLikeMap } from "@/components/util/input/verification-result-display";
|
||||
import {
|
||||
formatVerificationTooltip,
|
||||
normalizeVerificationResultMap,
|
||||
type VerificationResultLikeMap,
|
||||
} from "@/components/util/input/verification-result-display";
|
||||
import { useAdminStore } from "@/store/admin-store";
|
||||
import { useTabStore } from "@/store/tab-store";
|
||||
|
||||
@@ -203,8 +209,7 @@ function computeTabToolbarSnapshot(
|
||||
(hasRowData || treatAsSearched) &&
|
||||
(showSaveInToolbar ||
|
||||
showEnterableToolbarButtons ||
|
||||
showSubmittedInInputPeriodToolbar ||
|
||||
(isSubmitted && isAdminInfo));
|
||||
showSubmittedInInputPeriodToolbar);
|
||||
return { showSaveInToolbar, showEnterableToolbarButtons, showActionToolbarCard };
|
||||
}
|
||||
|
||||
@@ -443,7 +448,9 @@ function mapPublicSewageTreatWaterReuseListToGridRows(
|
||||
instlAprvYmd: formatCompactYmdForGrid(item.instlAprvYmd),
|
||||
},
|
||||
])[0] as GridRowWithVerification;
|
||||
if (verificationResult) row.verificationResult = verificationResult;
|
||||
if (verificationResult) {
|
||||
row.verificationResult = normalizeVerificationResultMap(verificationResult);
|
||||
}
|
||||
return row;
|
||||
});
|
||||
}
|
||||
@@ -462,7 +469,9 @@ function mapRecycledWaterStatusListToGridRows(
|
||||
oprtngStrtYmd: formatCompactYmdForGrid(item.oprtngStrtYmd),
|
||||
},
|
||||
])[0] as GridRowWithVerification;
|
||||
if (verificationResult) row.verificationResult = verificationResult;
|
||||
if (verificationResult) {
|
||||
row.verificationResult = normalizeVerificationResultMap(verificationResult);
|
||||
}
|
||||
return row;
|
||||
});
|
||||
}
|
||||
@@ -480,7 +489,9 @@ function mapRainFallUtilFactStatusListToGridRows(
|
||||
cmptnYmd: formatCompactYmdForGrid(item.cmptnYmd),
|
||||
},
|
||||
])[0] as GridRowWithVerification;
|
||||
if (verificationResult) row.verificationResult = verificationResult;
|
||||
if (verificationResult) {
|
||||
row.verificationResult = normalizeVerificationResultMap(verificationResult);
|
||||
}
|
||||
return row;
|
||||
});
|
||||
}
|
||||
@@ -497,7 +508,9 @@ function mapTreatWaterReuseStatusListToGridRows<
|
||||
coRegYmd: formatCompactYmdForGrid(item.coRegYmd),
|
||||
},
|
||||
])[0] as GridRowWithVerification;
|
||||
if (verificationResult) row.verificationResult = verificationResult;
|
||||
if (verificationResult) {
|
||||
row.verificationResult = normalizeVerificationResultMap(verificationResult);
|
||||
}
|
||||
return row;
|
||||
});
|
||||
}
|
||||
@@ -1355,7 +1368,13 @@ const WaterReuseInp = () => {
|
||||
};
|
||||
|
||||
try {
|
||||
const imrResponse = await statisticsApi.callImrService(imrParam);
|
||||
const imrResponse = await callImrServiceWithRollbackOnFailure(imrParam, {
|
||||
statsYr: lastSearchedValues.year ?? "",
|
||||
statsCd: statsCdForTab,
|
||||
sewerBzmnCd: lastSearchedValues?.bsnmCd ?? "",
|
||||
rollbackStatusCode: activeTabStatus?.lclgvSbmsnSttsCd ?? "",
|
||||
mdfrUuid: userInfo.userUnqId,
|
||||
});
|
||||
if (imrResponse.job_id) {
|
||||
await waitForImrJobCompleted(
|
||||
imrResponse.job_id,
|
||||
@@ -1963,7 +1982,11 @@ const WaterReuseInp = () => {
|
||||
ARTICLE_EDIT_TAB_KEYS.has(tabKey) &&
|
||||
col.fieldName === "sggNm"
|
||||
) {
|
||||
next = buildSggNmColumn(col, canEdit, sggOptions);
|
||||
next = buildSggNmColumn(
|
||||
col,
|
||||
canEdit,
|
||||
filterSggOptionsBySearchGugun(sggOptions, lastSearchedValues?.gugun),
|
||||
);
|
||||
}
|
||||
const guide = columnGuidesByTab[tabKey]?.[col.fieldName]?.trim();
|
||||
return guide ? { ...next, tooltip: guide } : next;
|
||||
@@ -1974,7 +1997,7 @@ const WaterReuseInp = () => {
|
||||
});
|
||||
}
|
||||
return map;
|
||||
}, [tabStatusInfoMap, inputPeriodEnterable, isAdminInfo, columnGuidesByTab, sggOptions]);
|
||||
}, [tabStatusInfoMap, inputPeriodEnterable, isAdminInfo, columnGuidesByTab, sggOptions, lastSearchedValues?.gugun]);
|
||||
|
||||
const searchContextForToolbar = searchContextByTab.get(activeTab) ?? lastSearchedValues;
|
||||
const activeTabStatus = tabStatusInfoMap.get(activeTab) ?? null;
|
||||
@@ -2063,18 +2086,7 @@ const WaterReuseInp = () => {
|
||||
if (!verification) return;
|
||||
const errors = verification[fieldName];
|
||||
if (Array.isArray(errors) && errors.length > 0) {
|
||||
return errors
|
||||
.map((e) => {
|
||||
const prefix =
|
||||
e.vrfcCd === "IMR"
|
||||
? "시계열 검증 - "
|
||||
: e.vrfcCd === "NV"
|
||||
? "일반검증 - "
|
||||
: "모집단 검증 - ";
|
||||
return `${prefix}${e.rsnExpln}(검증 기준값: ${e.cmprCn} / 현재 입력값: ${e.nowCn})`;
|
||||
})
|
||||
.filter(Boolean)
|
||||
.join("\n");
|
||||
return formatVerificationTooltip(errors);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2117,7 +2129,7 @@ const WaterReuseInp = () => {
|
||||
{submitOk && <SubmitButton submitFunc={submitFunc} />}
|
||||
</>
|
||||
)}
|
||||
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && (
|
||||
{activeTabStatus?.lclgvSbmsnSttsCd === "2" && submitOk && inputPeriodEnterable && (
|
||||
<CancelSubmitButton cnacelSubmitFunc={cnacelSubmitFunc} />
|
||||
)}
|
||||
{showSaveInToolbar && <SaveButton saveFunc={saveFunc} />}
|
||||
|
||||
@@ -19,7 +19,6 @@ import {
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
Input,
|
||||
InputDatePicker,
|
||||
Label,
|
||||
Select,
|
||||
SelectContent,
|
||||
@@ -48,9 +47,32 @@ function normalizeStatsYrInput(raw: string): string {
|
||||
function formatDateToYmd(d: Date | undefined): string | null {
|
||||
if (!d || Number.isNaN(d.getTime())) return null;
|
||||
const y = d.getFullYear();
|
||||
if (y < 1000 || y > 9999) return null;
|
||||
const m = String(d.getMonth() + 1).padStart(2, "0");
|
||||
const day = String(d.getDate()).padStart(2, "0");
|
||||
return `${y}${m}${day}`;
|
||||
return `${String(y).padStart(4, "0")}${m}${day}`;
|
||||
}
|
||||
|
||||
/** Chrome `type="date"`는 max가 없으면 연도를 6자리까지 받음 */
|
||||
const PERIOD_DATE_INPUT_MIN = "1000-01-01";
|
||||
const PERIOD_DATE_INPUT_MAX = "9999-12-31";
|
||||
|
||||
function formatDateToInputValue(d: Date | undefined): string {
|
||||
if (!d || Number.isNaN(d.getTime())) return "";
|
||||
const ymd = formatDateToYmd(d);
|
||||
if (!ymd) return "";
|
||||
return `${ymd.slice(0, 4)}-${ymd.slice(4, 6)}-${ymd.slice(6, 8)}`;
|
||||
}
|
||||
|
||||
function parseFourDigitYearDate(raw: string): Date | undefined {
|
||||
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(raw);
|
||||
if (!match) return undefined;
|
||||
const year = Number(match[1]);
|
||||
const month = Number(match[2]);
|
||||
const day = Number(match[3]);
|
||||
const parsed = new Date(year, month - 1, day);
|
||||
if (Number.isNaN(parsed.getTime()) || parsed.getFullYear() !== year) return undefined;
|
||||
return parsed;
|
||||
}
|
||||
|
||||
export interface StatisticsInputPeriodDialogProps {
|
||||
@@ -281,18 +303,26 @@ export function StatisticsInputPeriodDialog({
|
||||
)}
|
||||
<div className="flex flex-col gap-2">
|
||||
<Label className="text-label">시작일</Label>
|
||||
<InputDatePicker
|
||||
value={bgngYmd}
|
||||
onChange={setBgngYmd}
|
||||
className="w-full"
|
||||
<Input
|
||||
type="date"
|
||||
min={PERIOD_DATE_INPUT_MIN}
|
||||
max={PERIOD_DATE_INPUT_MAX}
|
||||
value={formatDateToInputValue(bgngYmd)}
|
||||
onChange={(e) => setBgngYmd(parseFourDigitYearDate(e.target.value))}
|
||||
disabled={isSubmitting}
|
||||
className="!text-[1.3rem] w-full"
|
||||
/>
|
||||
</div>
|
||||
<div className="flex flex-col gap-2">
|
||||
<Label className="text-label">종료일</Label>
|
||||
<InputDatePicker
|
||||
value={endYmd}
|
||||
onChange={setEndYmd}
|
||||
className="w-full"
|
||||
<Input
|
||||
type="date"
|
||||
min={PERIOD_DATE_INPUT_MIN}
|
||||
max={PERIOD_DATE_INPUT_MAX}
|
||||
value={formatDateToInputValue(endYmd)}
|
||||
onChange={(e) => setEndYmd(parseFourDigitYearDate(e.target.value))}
|
||||
disabled={isSubmitting}
|
||||
className="!text-[1.3rem] w-full"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -49,7 +49,6 @@ const ExcretaTreatmentFacilityRvw = () => {
|
||||
const [reviewOpinionContext, setReviewOpinionContext] =
|
||||
useState<ReviewOpinionDialogContext | null>(null);
|
||||
const [latestReviewOpinion, setLatestReviewOpinion] = useState("");
|
||||
const [latestProcessHistory, setLatestProcessHistory] = useState("");
|
||||
const [lastSearchValues, setLastSearchValues] = useState<SearchFormValues | null>(null);
|
||||
|
||||
const columnInfo = useMemo(() => {
|
||||
@@ -98,7 +97,7 @@ const ExcretaTreatmentFacilityRvw = () => {
|
||||
return null;
|
||||
}
|
||||
|
||||
const instSeCd = userInfo?.instSeCd ?? "";
|
||||
const instSeCd = userInfo?.laeSeCd?? "";
|
||||
if (!instSeCd) {
|
||||
return null;
|
||||
}
|
||||
@@ -109,14 +108,13 @@ const ExcretaTreatmentFacilityRvw = () => {
|
||||
statsCd: reviewOpinionContext.statsCd,
|
||||
instSeCd,
|
||||
};
|
||||
}, [reviewOpinionContext, userInfo?.instSeCd]);
|
||||
}, [reviewOpinionContext, userInfo?.laeSeCd]);
|
||||
|
||||
const handleReset = () => {
|
||||
setRowData([]);
|
||||
setStatsStatusInfo({});
|
||||
setReviewOpinionContext(null);
|
||||
setLatestReviewOpinion("");
|
||||
setLatestProcessHistory("");
|
||||
setLastSearchValues(null);
|
||||
setReviewOpinionOpen(false);
|
||||
setReturnDialogOpen(false);
|
||||
@@ -170,14 +168,12 @@ const ExcretaTreatmentFacilityRvw = () => {
|
||||
statsCd: statsInfo.statsCd ?? "",
|
||||
});
|
||||
setLatestReviewOpinion(statsInfo.splmntOpnnCn ?? "");
|
||||
setLatestProcessHistory(statsInfo.splmntRsltCn ?? "");
|
||||
setRowData(toGridRows(convertedData as unknown as object[]));
|
||||
} else {
|
||||
setRowData([]);
|
||||
setStatsStatusInfo({});
|
||||
setReviewOpinionContext(null);
|
||||
setLatestReviewOpinion("");
|
||||
setLatestProcessHistory("");
|
||||
alert(response.message || "데이터가 없습니다.");
|
||||
}
|
||||
} catch {
|
||||
@@ -216,7 +212,6 @@ const ExcretaTreatmentFacilityRvw = () => {
|
||||
|
||||
const row = detailRes.data?.[0];
|
||||
setLatestReviewOpinion(row?.splmntOpnnCn ?? "");
|
||||
setLatestProcessHistory(row?.splmntRsltCn ?? "");
|
||||
setReviewOpinionOpen(true);
|
||||
} catch {
|
||||
alert("검토의견 조회 중 오류가 발생했습니다.");
|
||||
@@ -234,10 +229,8 @@ const ExcretaTreatmentFacilityRvw = () => {
|
||||
setStatsStatusInfo((prev) => ({
|
||||
...prev,
|
||||
splmntOpnnCn: param.splmntOpnnCn,
|
||||
splmntRsltCn: param.splmntRsltCn,
|
||||
}));
|
||||
setLatestReviewOpinion(param.splmntOpnnCn);
|
||||
setLatestProcessHistory(param.splmntRsltCn);
|
||||
} catch {
|
||||
alert("저장 중 오류가 발생했습니다.");
|
||||
}
|
||||
@@ -297,7 +290,6 @@ const ExcretaTreatmentFacilityRvw = () => {
|
||||
onOpenChange={setReviewOpinionOpen}
|
||||
context={reviewOpinionContext}
|
||||
initialReviewOpinion={latestReviewOpinion}
|
||||
initialProcessHistory={latestProcessHistory}
|
||||
onSave={saveReviewOpinion}
|
||||
/>
|
||||
<ReviewSubmitDialog
|
||||
|
||||
@@ -102,7 +102,6 @@ const PrivateSewageFacilityRvw = () => {
|
||||
}, [activeStatsStatusInfo.statsCd, lastSearchValues]);
|
||||
|
||||
const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? "";
|
||||
const latestProcessHistory = activeStatsStatusInfo.splmntRsltCn ?? "";
|
||||
|
||||
const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => {
|
||||
if (lastSearchValues == null) return null;
|
||||
@@ -110,7 +109,7 @@ const PrivateSewageFacilityRvw = () => {
|
||||
const statsYr = lastSearchValues.year ?? "";
|
||||
const sewerBzmnCd = lastSearchValues.bsnmCd ?? "";
|
||||
const statsCd = activeStatsStatusInfo.statsCd ?? "";
|
||||
const instSeCd = userInfo?.instSeCd ?? "";
|
||||
const instSeCd = userInfo?.laeSeCd?? "";
|
||||
|
||||
if (!statsYr || !sewerBzmnCd || !statsCd || !instSeCd) {
|
||||
return null;
|
||||
@@ -122,7 +121,7 @@ const PrivateSewageFacilityRvw = () => {
|
||||
statsCd,
|
||||
instSeCd,
|
||||
};
|
||||
}, [activeStatsStatusInfo.statsCd, lastSearchValues, userInfo?.instSeCd]);
|
||||
}, [activeStatsStatusInfo.statsCd, lastSearchValues, userInfo?.laeSeCd]);
|
||||
|
||||
const { showReviewOpinionButton, showReturnButton, showSubmitButton } = useMemo(() => {
|
||||
const statsStatusInfo = activeStatsStatusInfo;
|
||||
@@ -284,7 +283,6 @@ const PrivateSewageFacilityRvw = () => {
|
||||
next.set(activeTab, {
|
||||
...(next.get(activeTab) ?? {}),
|
||||
splmntOpnnCn: row?.splmntOpnnCn ?? "",
|
||||
splmntRsltCn: row?.splmntRsltCn ?? "",
|
||||
});
|
||||
return next;
|
||||
});
|
||||
@@ -307,7 +305,6 @@ const PrivateSewageFacilityRvw = () => {
|
||||
next.set(activeTab, {
|
||||
...(next.get(activeTab) ?? {}),
|
||||
splmntOpnnCn: param.splmntOpnnCn,
|
||||
splmntRsltCn: param.splmntRsltCn,
|
||||
});
|
||||
return next;
|
||||
});
|
||||
@@ -411,7 +408,6 @@ const PrivateSewageFacilityRvw = () => {
|
||||
onOpenChange={setReviewOpinionOpen}
|
||||
context={reviewOpinionContext}
|
||||
initialReviewOpinion={latestReviewOpinion}
|
||||
initialProcessHistory={latestProcessHistory}
|
||||
onSave={saveReviewOpinion}
|
||||
/>
|
||||
<ReviewSubmitDialog
|
||||
|
||||
@@ -41,7 +41,6 @@ const PublicSewageFacilityRvw = () => {
|
||||
const [reviewOpinionContext, setReviewOpinionContext] =
|
||||
useState<ReviewOpinionDialogContext | null>(null);
|
||||
const [latestReviewOpinion, setLatestReviewOpinion] = useState("");
|
||||
const [latestProcessHistory, setLatestProcessHistory] = useState("");
|
||||
const [lastSearchValues, setLastSearchValues] = useState<SearchFormValues | null>(null);
|
||||
|
||||
const columnInfo = useMemo(() => {
|
||||
@@ -82,7 +81,7 @@ const PublicSewageFacilityRvw = () => {
|
||||
return null;
|
||||
}
|
||||
|
||||
const instSeCd = userInfo?.instSeCd ?? "";
|
||||
const instSeCd = userInfo?.laeSeCd?? "";
|
||||
if (!instSeCd) {
|
||||
return null;
|
||||
}
|
||||
@@ -93,14 +92,13 @@ const PublicSewageFacilityRvw = () => {
|
||||
statsCd: reviewOpinionContext.statsCd,
|
||||
instSeCd,
|
||||
};
|
||||
}, [reviewOpinionContext, userInfo?.instSeCd]);
|
||||
}, [reviewOpinionContext, userInfo?.laeSeCd]);
|
||||
|
||||
const handleReset = () => {
|
||||
setRowData([]);
|
||||
setStatsStatusInfo({});
|
||||
setReviewOpinionContext(null);
|
||||
setLatestReviewOpinion("");
|
||||
setLatestProcessHistory("");
|
||||
setLastSearchValues(null);
|
||||
setSubmitDialogOpen(false);
|
||||
};
|
||||
@@ -143,16 +141,12 @@ const PublicSewageFacilityRvw = () => {
|
||||
setLatestReviewOpinion(
|
||||
response.data.statsStatusInfo.splmntOpnnCn ?? "",
|
||||
);
|
||||
setLatestProcessHistory(
|
||||
response.data.statsStatusInfo.splmntRsltCn ?? "",
|
||||
);
|
||||
setRowData(toGridRows(convertedData as unknown as object[]));
|
||||
} else {
|
||||
setRowData([]);
|
||||
setStatsStatusInfo({});
|
||||
setReviewOpinionContext(null);
|
||||
setLatestReviewOpinion("");
|
||||
setLatestProcessHistory("");
|
||||
alert(response.message || "데이터가 없습니다.");
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -192,7 +186,6 @@ const PublicSewageFacilityRvw = () => {
|
||||
|
||||
const row = detailRes.data?.[0];
|
||||
setLatestReviewOpinion(row?.splmntOpnnCn ?? "");
|
||||
setLatestProcessHistory(row?.splmntRsltCn ?? "");
|
||||
setReviewOpinionOpen(true);
|
||||
} catch {
|
||||
alert("검토의견 조회 중 오류가 발생했습니다.");
|
||||
@@ -210,10 +203,8 @@ const PublicSewageFacilityRvw = () => {
|
||||
setStatsStatusInfo((prev) => ({
|
||||
...prev,
|
||||
splmntOpnnCn: param.splmntOpnnCn,
|
||||
splmntRsltCn: param.splmntRsltCn,
|
||||
}));
|
||||
setLatestReviewOpinion(param.splmntOpnnCn);
|
||||
setLatestProcessHistory(param.splmntRsltCn);
|
||||
} catch {
|
||||
alert("저장 중 오류가 발생했습니다.");
|
||||
}
|
||||
@@ -267,7 +258,6 @@ const PublicSewageFacilityRvw = () => {
|
||||
onOpenChange={setReviewOpinionOpen}
|
||||
context={reviewOpinionContext}
|
||||
initialReviewOpinion={latestReviewOpinion}
|
||||
initialProcessHistory={latestProcessHistory}
|
||||
onSave={saveReviewOpinion}
|
||||
/>
|
||||
<ReviewSubmitDialog
|
||||
|
||||
@@ -47,7 +47,6 @@ const PumpingStationRvw = () => {
|
||||
const [reviewOpinionContext, setReviewOpinionContext] =
|
||||
useState<ReviewOpinionDialogContext | null>(null);
|
||||
const [latestReviewOpinion, setLatestReviewOpinion] = useState("");
|
||||
const [latestProcessHistory, setLatestProcessHistory] = useState("");
|
||||
const [lastSearchValues, setLastSearchValues] = useState<SearchFormValues | null>(null);
|
||||
|
||||
const columnInfo = useMemo(() => {
|
||||
@@ -93,7 +92,7 @@ const PumpingStationRvw = () => {
|
||||
return null;
|
||||
}
|
||||
|
||||
const instSeCd = userInfo?.instSeCd ?? "";
|
||||
const instSeCd = userInfo?.laeSeCd?? "";
|
||||
if (!instSeCd) {
|
||||
return null;
|
||||
}
|
||||
@@ -104,14 +103,13 @@ const PumpingStationRvw = () => {
|
||||
statsCd: reviewOpinionContext.statsCd,
|
||||
instSeCd,
|
||||
};
|
||||
}, [reviewOpinionContext, userInfo?.instSeCd]);
|
||||
}, [reviewOpinionContext, userInfo?.laeSeCd]);
|
||||
|
||||
const handleReset = () => {
|
||||
setRowData([]);
|
||||
setStatsStatusInfo({});
|
||||
setReviewOpinionContext(null);
|
||||
setLatestReviewOpinion("");
|
||||
setLatestProcessHistory("");
|
||||
setLastSearchValues(null);
|
||||
setReviewOpinionOpen(false);
|
||||
setReturnDialogOpen(false);
|
||||
@@ -157,14 +155,12 @@ const PumpingStationRvw = () => {
|
||||
statsCd: statsInfo.statsCd ?? "",
|
||||
});
|
||||
setLatestReviewOpinion(statsInfo.splmntOpnnCn ?? "");
|
||||
setLatestProcessHistory(statsInfo.splmntRsltCn ?? "");
|
||||
setRowData(toGridRows(convertedData));
|
||||
} else {
|
||||
setRowData([]);
|
||||
setStatsStatusInfo({});
|
||||
setReviewOpinionContext(null);
|
||||
setLatestReviewOpinion("");
|
||||
setLatestProcessHistory("");
|
||||
alert(response.message || "데이터가 없습니다.");
|
||||
}
|
||||
} catch {
|
||||
@@ -203,7 +199,6 @@ const PumpingStationRvw = () => {
|
||||
|
||||
const row = detailRes.data?.[0];
|
||||
setLatestReviewOpinion(row?.splmntOpnnCn ?? "");
|
||||
setLatestProcessHistory(row?.splmntRsltCn ?? "");
|
||||
setReviewOpinionOpen(true);
|
||||
} catch {
|
||||
alert("검토의견 조회 중 오류가 발생했습니다.");
|
||||
@@ -221,10 +216,8 @@ const PumpingStationRvw = () => {
|
||||
setStatsStatusInfo((prev) => ({
|
||||
...prev,
|
||||
splmntOpnnCn: param.splmntOpnnCn,
|
||||
splmntRsltCn: param.splmntRsltCn,
|
||||
}));
|
||||
setLatestReviewOpinion(param.splmntOpnnCn);
|
||||
setLatestProcessHistory(param.splmntRsltCn);
|
||||
} catch {
|
||||
alert("저장 중 오류가 발생했습니다.");
|
||||
}
|
||||
@@ -284,7 +277,6 @@ const PumpingStationRvw = () => {
|
||||
onOpenChange={setReviewOpinionOpen}
|
||||
context={reviewOpinionContext}
|
||||
initialReviewOpinion={latestReviewOpinion}
|
||||
initialProcessHistory={latestProcessHistory}
|
||||
onSave={saveReviewOpinion}
|
||||
/>
|
||||
<ReviewSubmitDialog
|
||||
|
||||
@@ -30,8 +30,6 @@ export interface ReviewOpinionDialogProps {
|
||||
context: ReviewOpinionDialogContext | null;
|
||||
/** 다이얼로그 열릴 때 검토의견 초기값 */
|
||||
initialReviewOpinion?: string;
|
||||
/** 다이얼로그 열릴 때 처리내역 초기값 */
|
||||
initialProcessHistory?: string;
|
||||
/** 저장 시 생성된 param 전달 (API 호출 등) */
|
||||
onSave?: (param: ReviewOpinionSaveRequest) => void | Promise<void>;
|
||||
}
|
||||
@@ -41,18 +39,15 @@ export function ReviewOpinionDialog({
|
||||
onOpenChange,
|
||||
context,
|
||||
initialReviewOpinion = "",
|
||||
initialProcessHistory = "",
|
||||
onSave,
|
||||
}: ReviewOpinionDialogProps) {
|
||||
const { setMessage: alert } = useAlertStore((state) => state);
|
||||
const [reviewOpinion, setReviewOpinion] = useState("");
|
||||
const [processHistory, setProcessHistory] = useState("");
|
||||
const [isSaving, setIsSaving] = useState(false);
|
||||
const [reviewOpinionError, setReviewOpinionError] = useState(false);
|
||||
|
||||
const resetForm = () => {
|
||||
setReviewOpinion("");
|
||||
setProcessHistory("");
|
||||
setReviewOpinionError(false);
|
||||
};
|
||||
|
||||
@@ -64,8 +59,7 @@ export function ReviewOpinionDialog({
|
||||
useEffect(() => {
|
||||
if (!open) return;
|
||||
setReviewOpinion(initialReviewOpinion);
|
||||
setProcessHistory(initialProcessHistory);
|
||||
}, [open, initialReviewOpinion, initialProcessHistory]);
|
||||
}, [open, initialReviewOpinion]);
|
||||
|
||||
const handleSave = async () => {
|
||||
if (reviewOpinion.trim() === "") {
|
||||
@@ -96,7 +90,6 @@ export function ReviewOpinionDialog({
|
||||
sewerBzmnCd: context.sewerBzmnCd,
|
||||
statsCd: context.statsCd,
|
||||
splmntOpnnCn: reviewOpinion,
|
||||
splmntRsltCn: processHistory,
|
||||
mdfrUuid: userInfo.userUnqId,
|
||||
};
|
||||
await onSave?.(param);
|
||||
@@ -136,16 +129,6 @@ export function ReviewOpinionDialog({
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex flex-col gap-2">
|
||||
<Label className="text-label mb-2">처리내역</Label>
|
||||
<Textarea
|
||||
value={processHistory}
|
||||
onChange={(e) => setProcessHistory(e.target.value)}
|
||||
className="min-h-[10rem] resize-y !text-[1.3rem] !leading-6"
|
||||
placeholder="처리내역을 입력하세요."
|
||||
disabled={isSaving}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<DialogFooter>
|
||||
<DialogClose asChild>
|
||||
|
||||
@@ -30,8 +30,8 @@ export interface ReviewSubmitDialogProps {
|
||||
context: ReviewerInfoRequest | null;
|
||||
onSubmitted?: () => void | Promise<void>;
|
||||
/**
|
||||
* true면 검토의견·처리내역 UI를 숨기고
|
||||
* submit body에 statsCd / splmntOpnnCn / splmntRsltCn을 넣지 않음
|
||||
* true면 검토의견 UI를 숨기고
|
||||
* submit body에 statsCd / splmntOpnnCn을 넣지 않음
|
||||
*/
|
||||
hideOpinionFields?: boolean;
|
||||
}
|
||||
@@ -116,7 +116,6 @@ export function ReviewSubmitDialog({
|
||||
statsCd: context.statsCd,
|
||||
mdfrUuid: userInfo.userUnqId,
|
||||
splmntOpnnCn: reviewerInfo?.splmntOpnnCn ?? "",
|
||||
splmntRsltCn: reviewerInfo?.splmntRsltCn ?? "",
|
||||
};
|
||||
|
||||
const response = await statisticsApi.submitReview(submitParam);
|
||||
@@ -175,14 +174,6 @@ export function ReviewSubmitDialog({
|
||||
className="min-h-[10rem] p-2 resize-none !text-xl"
|
||||
/>
|
||||
</div>
|
||||
<div className="col-span-2 flex flex-col gap-2">
|
||||
<Label className="text-label">처리내역</Label>
|
||||
<Textarea
|
||||
value={reviewerInfo?.splmntRsltCn ?? "-"}
|
||||
readOnly
|
||||
className="min-h-[10rem] p-2 resize-none !text-xl"
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -105,7 +105,6 @@ const SewageExcretaRelatedRvw = () => {
|
||||
}, [activeStatsStatusInfo.statsCd, lastSearchValues]);
|
||||
|
||||
const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? "";
|
||||
const latestProcessHistory = activeStatsStatusInfo.splmntRsltCn ?? "";
|
||||
|
||||
const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => {
|
||||
if (lastSearchValues == null) return null;
|
||||
@@ -113,7 +112,7 @@ const SewageExcretaRelatedRvw = () => {
|
||||
const statsYr = lastSearchValues.year ?? "";
|
||||
const sewerBzmnCd = lastSearchValues.bsnmCd ?? "";
|
||||
const statsCd = activeStatsStatusInfo.statsCd ?? "";
|
||||
const instSeCd = userInfo?.instSeCd ?? "";
|
||||
const instSeCd = userInfo?.laeSeCd?? "";
|
||||
|
||||
if (!statsYr || !sewerBzmnCd || !statsCd || !instSeCd) {
|
||||
return null;
|
||||
@@ -125,7 +124,7 @@ const SewageExcretaRelatedRvw = () => {
|
||||
statsCd,
|
||||
instSeCd,
|
||||
};
|
||||
}, [activeStatsStatusInfo.statsCd, lastSearchValues, userInfo?.instSeCd]);
|
||||
}, [activeStatsStatusInfo.statsCd, lastSearchValues, userInfo?.laeSeCd]);
|
||||
|
||||
const { showReviewOpinionButton, showReturnButton, showSubmitButton } = useMemo(() => {
|
||||
const statsStatusInfo = activeStatsStatusInfo;
|
||||
@@ -289,7 +288,6 @@ const SewageExcretaRelatedRvw = () => {
|
||||
next.set(activeTab, {
|
||||
...(next.get(activeTab) ?? {}),
|
||||
splmntOpnnCn: row?.splmntOpnnCn ?? "",
|
||||
splmntRsltCn: row?.splmntRsltCn ?? "",
|
||||
});
|
||||
return next;
|
||||
});
|
||||
@@ -312,7 +310,6 @@ const SewageExcretaRelatedRvw = () => {
|
||||
next.set(activeTab, {
|
||||
...(next.get(activeTab) ?? {}),
|
||||
splmntOpnnCn: param.splmntOpnnCn,
|
||||
splmntRsltCn: param.splmntRsltCn,
|
||||
});
|
||||
return next;
|
||||
});
|
||||
@@ -416,7 +413,6 @@ const SewageExcretaRelatedRvw = () => {
|
||||
onOpenChange={setReviewOpinionOpen}
|
||||
context={reviewOpinionContext}
|
||||
initialReviewOpinion={latestReviewOpinion}
|
||||
initialProcessHistory={latestProcessHistory}
|
||||
onSave={saveReviewOpinion}
|
||||
/>
|
||||
<ReviewSubmitDialog
|
||||
|
||||
@@ -105,7 +105,6 @@ const SewageExcretaSlurgeRvw = () => {
|
||||
}, [activeStatsStatusInfo.statsCd, lastSearchValues]);
|
||||
|
||||
const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? "";
|
||||
const latestProcessHistory = activeStatsStatusInfo.splmntRsltCn ?? "";
|
||||
|
||||
const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => {
|
||||
if (lastSearchValues == null) return null;
|
||||
@@ -113,7 +112,7 @@ const SewageExcretaSlurgeRvw = () => {
|
||||
const statsYr = lastSearchValues.year ?? "";
|
||||
const sewerBzmnCd = lastSearchValues.bsnmCd ?? "";
|
||||
const statsCd = activeStatsStatusInfo.statsCd ?? "";
|
||||
const instSeCd = userInfo?.instSeCd ?? "";
|
||||
const instSeCd = userInfo?.laeSeCd?? "";
|
||||
|
||||
if (!statsYr || !sewerBzmnCd || !statsCd || !instSeCd) {
|
||||
return null;
|
||||
@@ -125,7 +124,7 @@ const SewageExcretaSlurgeRvw = () => {
|
||||
statsCd,
|
||||
instSeCd,
|
||||
};
|
||||
}, [activeStatsStatusInfo.statsCd, lastSearchValues, userInfo?.instSeCd]);
|
||||
}, [activeStatsStatusInfo.statsCd, lastSearchValues, userInfo?.laeSeCd]);
|
||||
|
||||
const { showReviewOpinionButton, showReturnButton, showSubmitButton } = useMemo(() => {
|
||||
const statsStatusInfo = activeStatsStatusInfo;
|
||||
@@ -290,7 +289,6 @@ const SewageExcretaSlurgeRvw = () => {
|
||||
next.set(activeTab, {
|
||||
...(next.get(activeTab) ?? {}),
|
||||
splmntOpnnCn: row?.splmntOpnnCn ?? "",
|
||||
splmntRsltCn: row?.splmntRsltCn ?? "",
|
||||
});
|
||||
return next;
|
||||
});
|
||||
@@ -313,7 +311,6 @@ const SewageExcretaSlurgeRvw = () => {
|
||||
next.set(activeTab, {
|
||||
...(next.get(activeTab) ?? {}),
|
||||
splmntOpnnCn: param.splmntOpnnCn,
|
||||
splmntRsltCn: param.splmntRsltCn,
|
||||
});
|
||||
return next;
|
||||
});
|
||||
@@ -417,7 +414,6 @@ const SewageExcretaSlurgeRvw = () => {
|
||||
onOpenChange={setReviewOpinionOpen}
|
||||
context={reviewOpinionContext}
|
||||
initialReviewOpinion={latestReviewOpinion}
|
||||
initialProcessHistory={latestProcessHistory}
|
||||
onSave={saveReviewOpinion}
|
||||
/>
|
||||
<ReviewSubmitDialog
|
||||
|
||||
@@ -120,7 +120,6 @@ const SewagePipeMaintainRvw = () => {
|
||||
}, [activeStatsStatusInfo.statsCd, lastSearchValues]);
|
||||
|
||||
const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? "";
|
||||
const latestProcessHistory = activeStatsStatusInfo.splmntRsltCn ?? "";
|
||||
|
||||
const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => {
|
||||
if (lastSearchValues == null) return null;
|
||||
@@ -128,7 +127,7 @@ const SewagePipeMaintainRvw = () => {
|
||||
const statsYr = lastSearchValues.year ?? "";
|
||||
const sewerBzmnCd = lastSearchValues.bsnmCd ?? "";
|
||||
const statsCd = activeStatsStatusInfo.statsCd ?? "";
|
||||
const instSeCd = userInfo?.instSeCd ?? "";
|
||||
const instSeCd = userInfo?.laeSeCd?? "";
|
||||
|
||||
if (!statsYr || !sewerBzmnCd || !statsCd || !instSeCd) {
|
||||
return null;
|
||||
@@ -140,7 +139,7 @@ const SewagePipeMaintainRvw = () => {
|
||||
statsCd,
|
||||
instSeCd,
|
||||
};
|
||||
}, [activeStatsStatusInfo.statsCd, lastSearchValues, userInfo?.instSeCd]);
|
||||
}, [activeStatsStatusInfo.statsCd, lastSearchValues, userInfo?.laeSeCd]);
|
||||
|
||||
const { showReviewOpinionButton, showReturnButton, showSubmitButton } = useMemo(() => {
|
||||
const statsStatusInfo = activeStatsStatusInfo;
|
||||
@@ -302,7 +301,6 @@ const SewagePipeMaintainRvw = () => {
|
||||
next.set(activeTab, {
|
||||
...(next.get(activeTab) ?? {}),
|
||||
splmntOpnnCn: row?.splmntOpnnCn ?? "",
|
||||
splmntRsltCn: row?.splmntRsltCn ?? "",
|
||||
});
|
||||
return next;
|
||||
});
|
||||
@@ -325,7 +323,6 @@ const SewagePipeMaintainRvw = () => {
|
||||
next.set(activeTab, {
|
||||
...(next.get(activeTab) ?? {}),
|
||||
splmntOpnnCn: param.splmntOpnnCn,
|
||||
splmntRsltCn: param.splmntRsltCn,
|
||||
});
|
||||
return next;
|
||||
});
|
||||
@@ -429,7 +426,6 @@ const SewagePipeMaintainRvw = () => {
|
||||
onOpenChange={setReviewOpinionOpen}
|
||||
context={reviewOpinionContext}
|
||||
initialReviewOpinion={latestReviewOpinion}
|
||||
initialProcessHistory={latestProcessHistory}
|
||||
onSave={saveReviewOpinion}
|
||||
/>
|
||||
<ReviewSubmitDialog
|
||||
|
||||
@@ -181,14 +181,13 @@ const SewagePipeRvw = () => {
|
||||
};
|
||||
}, [activeStatsStatusInfo.statsCd, lastSearchValues]);
|
||||
const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? "";
|
||||
const latestProcessHistory = activeStatsStatusInfo.splmntRsltCn ?? "";
|
||||
const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => {
|
||||
if (lastSearchValues == null) return null;
|
||||
|
||||
const statsYr = lastSearchValues.year ?? "";
|
||||
const sewerBzmnCd = lastSearchValues.bsnmCd ?? "";
|
||||
const statsCd = activeStatsStatusInfo.statsCd ?? "";
|
||||
const instSeCd = userInfo?.instSeCd ?? "";
|
||||
const instSeCd = userInfo?.laeSeCd?? "";
|
||||
|
||||
if (!statsYr || !sewerBzmnCd || !statsCd || !instSeCd) {
|
||||
return null;
|
||||
@@ -200,7 +199,7 @@ const SewagePipeRvw = () => {
|
||||
statsCd,
|
||||
instSeCd,
|
||||
};
|
||||
}, [activeStatsStatusInfo.statsCd, lastSearchValues, userInfo?.instSeCd]);
|
||||
}, [activeStatsStatusInfo.statsCd, lastSearchValues, userInfo?.laeSeCd]);
|
||||
|
||||
const { showReviewOpinionButton, showReturnButton, showSubmitButton } = useMemo(() => {
|
||||
const statsStatusInfo = activeStatsStatusInfo;
|
||||
@@ -362,7 +361,6 @@ const SewagePipeRvw = () => {
|
||||
next.set(activeTab, {
|
||||
...(next.get(activeTab) ?? {}),
|
||||
splmntOpnnCn: row?.splmntOpnnCn ?? "",
|
||||
splmntRsltCn: row?.splmntRsltCn ?? "",
|
||||
});
|
||||
return next;
|
||||
});
|
||||
@@ -385,7 +383,6 @@ const SewagePipeRvw = () => {
|
||||
next.set(activeTab, {
|
||||
...(next.get(activeTab) ?? {}),
|
||||
splmntOpnnCn: param.splmntOpnnCn,
|
||||
splmntRsltCn: param.splmntRsltCn,
|
||||
});
|
||||
return next;
|
||||
});
|
||||
@@ -488,7 +485,6 @@ const SewagePipeRvw = () => {
|
||||
onOpenChange={setReviewOpinionOpen}
|
||||
context={reviewOpinionContext}
|
||||
initialReviewOpinion={latestReviewOpinion}
|
||||
initialProcessHistory={latestProcessHistory}
|
||||
onSave={saveReviewOpinion}
|
||||
/>
|
||||
<ReviewSubmitDialog
|
||||
|
||||
@@ -126,7 +126,6 @@ const SewageReservoirPumpRvw = () => {
|
||||
}, [activeStatsCd, lastSearchValues]);
|
||||
|
||||
const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? "";
|
||||
const latestProcessHistory = activeStatsStatusInfo.splmntRsltCn ?? "";
|
||||
|
||||
const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => {
|
||||
if (lastSearchValues == null) return null;
|
||||
@@ -134,7 +133,7 @@ const SewageReservoirPumpRvw = () => {
|
||||
const statsYr = lastSearchValues.year ?? "";
|
||||
const sewerBzmnCd = lastSearchValues.bsnmCd ?? "";
|
||||
const statsCd = activeStatsCd;
|
||||
const instSeCd = userInfo?.instSeCd ?? "";
|
||||
const instSeCd = userInfo?.laeSeCd?? "";
|
||||
|
||||
if (!statsYr || !sewerBzmnCd || !statsCd || !instSeCd) {
|
||||
return null;
|
||||
@@ -146,7 +145,7 @@ const SewageReservoirPumpRvw = () => {
|
||||
statsCd,
|
||||
instSeCd,
|
||||
};
|
||||
}, [activeStatsCd, lastSearchValues, userInfo?.instSeCd]);
|
||||
}, [activeStatsCd, lastSearchValues, userInfo?.laeSeCd]);
|
||||
|
||||
const { showReviewOpinionButton, showReturnButton, showSubmitButton } = useMemo(() => {
|
||||
const statsStatusInfo = activeStatsStatusInfo;
|
||||
@@ -308,7 +307,6 @@ const SewageReservoirPumpRvw = () => {
|
||||
next.set(activeTab, {
|
||||
...(next.get(activeTab) ?? {}),
|
||||
splmntOpnnCn: row?.splmntOpnnCn ?? "",
|
||||
splmntRsltCn: row?.splmntRsltCn ?? "",
|
||||
});
|
||||
return next;
|
||||
});
|
||||
@@ -331,7 +329,6 @@ const SewageReservoirPumpRvw = () => {
|
||||
next.set(activeTab, {
|
||||
...(next.get(activeTab) ?? {}),
|
||||
splmntOpnnCn: param.splmntOpnnCn,
|
||||
splmntRsltCn: param.splmntRsltCn,
|
||||
});
|
||||
return next;
|
||||
});
|
||||
@@ -435,7 +432,6 @@ const SewageReservoirPumpRvw = () => {
|
||||
onOpenChange={setReviewOpinionOpen}
|
||||
context={reviewOpinionContext}
|
||||
initialReviewOpinion={latestReviewOpinion}
|
||||
initialProcessHistory={latestProcessHistory}
|
||||
onSave={saveReviewOpinion}
|
||||
/>
|
||||
<ReviewSubmitDialog
|
||||
|
||||
@@ -105,7 +105,6 @@ const SewerageFinanceRvw = () => {
|
||||
}, [activeStatsStatusInfo.statsCd, lastSearchValues]);
|
||||
|
||||
const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? "";
|
||||
const latestProcessHistory = activeStatsStatusInfo.splmntRsltCn ?? "";
|
||||
|
||||
const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => {
|
||||
if (lastSearchValues == null) return null;
|
||||
@@ -113,7 +112,7 @@ const SewerageFinanceRvw = () => {
|
||||
const statsYr = lastSearchValues.year ?? "";
|
||||
const sewerBzmnCd = lastSearchValues.bsnmCd ?? "";
|
||||
const statsCd = activeStatsStatusInfo.statsCd ?? "";
|
||||
const instSeCd = userInfo?.instSeCd ?? "";
|
||||
const instSeCd = userInfo?.laeSeCd?? "";
|
||||
|
||||
if (!statsYr || !sewerBzmnCd || !statsCd || !instSeCd) {
|
||||
return null;
|
||||
@@ -125,7 +124,7 @@ const SewerageFinanceRvw = () => {
|
||||
statsCd,
|
||||
instSeCd,
|
||||
};
|
||||
}, [activeStatsStatusInfo.statsCd, lastSearchValues, userInfo?.instSeCd]);
|
||||
}, [activeStatsStatusInfo.statsCd, lastSearchValues, userInfo?.laeSeCd]);
|
||||
|
||||
const { showReviewOpinionButton, showReturnButton, showSubmitButton } = useMemo(() => {
|
||||
const statsStatusInfo = activeStatsStatusInfo;
|
||||
@@ -287,7 +286,6 @@ const SewerageFinanceRvw = () => {
|
||||
next.set(activeTab, {
|
||||
...(next.get(activeTab) ?? {}),
|
||||
splmntOpnnCn: row?.splmntOpnnCn ?? "",
|
||||
splmntRsltCn: row?.splmntRsltCn ?? "",
|
||||
});
|
||||
return next;
|
||||
});
|
||||
@@ -310,7 +308,6 @@ const SewerageFinanceRvw = () => {
|
||||
next.set(activeTab, {
|
||||
...(next.get(activeTab) ?? {}),
|
||||
splmntOpnnCn: param.splmntOpnnCn,
|
||||
splmntRsltCn: param.splmntRsltCn,
|
||||
});
|
||||
return next;
|
||||
});
|
||||
@@ -414,7 +411,6 @@ const SewerageFinanceRvw = () => {
|
||||
onOpenChange={setReviewOpinionOpen}
|
||||
context={reviewOpinionContext}
|
||||
initialReviewOpinion={latestReviewOpinion}
|
||||
initialProcessHistory={latestProcessHistory}
|
||||
onSave={saveReviewOpinion}
|
||||
/>
|
||||
<ReviewSubmitDialog
|
||||
|
||||
@@ -40,7 +40,6 @@ const SeweragePenetrationRateRvw = () => {
|
||||
const [reviewOpinionContext, setReviewOpinionContext] =
|
||||
useState<ReviewOpinionDialogContext | null>(null);
|
||||
const [latestReviewOpinion, setLatestReviewOpinion] = useState("");
|
||||
const [latestProcessHistory, setLatestProcessHistory] = useState("");
|
||||
const [lastSearchValues, setLastSearchValues] = useState<SearchFormValues | null>(null);
|
||||
|
||||
const columnInfo = useMemo(() => {
|
||||
@@ -82,7 +81,7 @@ const SeweragePenetrationRateRvw = () => {
|
||||
return null;
|
||||
}
|
||||
|
||||
const instSeCd = userInfo?.instSeCd ?? "";
|
||||
const instSeCd = userInfo?.laeSeCd?? "";
|
||||
if (!instSeCd) {
|
||||
return null;
|
||||
}
|
||||
@@ -93,14 +92,13 @@ const SeweragePenetrationRateRvw = () => {
|
||||
statsCd: reviewOpinionContext.statsCd,
|
||||
instSeCd,
|
||||
};
|
||||
}, [reviewOpinionContext, userInfo?.instSeCd]);
|
||||
}, [reviewOpinionContext, userInfo?.laeSeCd]);
|
||||
|
||||
const handleReset = () => {
|
||||
setRowData([]);
|
||||
setStatsStatusInfo({});
|
||||
setReviewOpinionContext(null);
|
||||
setLatestReviewOpinion("");
|
||||
setLatestProcessHistory("");
|
||||
setLastSearchValues(null);
|
||||
};
|
||||
|
||||
@@ -139,15 +137,11 @@ const SeweragePenetrationRateRvw = () => {
|
||||
setLatestReviewOpinion(
|
||||
response.data.statsStatusInfo.splmntOpnnCn ?? "",
|
||||
);
|
||||
setLatestProcessHistory(
|
||||
response.data.statsStatusInfo.splmntRsltCn ?? "",
|
||||
);
|
||||
setRowData(toGridRows(convertedData));
|
||||
} else {
|
||||
setRowData([]);
|
||||
setReviewOpinionContext(null);
|
||||
setLatestReviewOpinion("");
|
||||
setLatestProcessHistory("");
|
||||
alert(response.message || "데이터가 없습니다.");
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -187,7 +181,6 @@ const SeweragePenetrationRateRvw = () => {
|
||||
|
||||
const row = detailRes.data?.[0];
|
||||
setLatestReviewOpinion(row?.splmntOpnnCn ?? "");
|
||||
setLatestProcessHistory(row?.splmntRsltCn ?? "");
|
||||
setReviewOpinionOpen(true);
|
||||
} catch {
|
||||
alert("검토의견 조회 중 오류가 발생했습니다.");
|
||||
@@ -205,10 +198,8 @@ const SeweragePenetrationRateRvw = () => {
|
||||
setStatsStatusInfo((prev) => ({
|
||||
...prev,
|
||||
splmntOpnnCn: param.splmntOpnnCn,
|
||||
splmntRsltCn: param.splmntRsltCn,
|
||||
}));
|
||||
setLatestReviewOpinion(param.splmntOpnnCn);
|
||||
setLatestProcessHistory(param.splmntRsltCn);
|
||||
} catch {
|
||||
alert("저장 중 오류가 발생했습니다.");
|
||||
}
|
||||
@@ -264,7 +255,6 @@ const SeweragePenetrationRateRvw = () => {
|
||||
onOpenChange={setReviewOpinionOpen}
|
||||
context={reviewOpinionContext}
|
||||
initialReviewOpinion={latestReviewOpinion}
|
||||
initialProcessHistory={latestProcessHistory}
|
||||
onSave={saveReviewOpinion}
|
||||
/>
|
||||
<ReviewSubmitDialog
|
||||
|
||||
@@ -103,7 +103,6 @@ const SewerageServiceLevelRvw = () => {
|
||||
}, [activeStatsStatusInfo.statsCd, lastSearchValues]);
|
||||
|
||||
const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? "";
|
||||
const latestProcessHistory = activeStatsStatusInfo.splmntRsltCn ?? "";
|
||||
|
||||
const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => {
|
||||
if (lastSearchValues == null) return null;
|
||||
@@ -111,7 +110,7 @@ const SewerageServiceLevelRvw = () => {
|
||||
const statsYr = lastSearchValues.year ?? "";
|
||||
const sewerBzmnCd = lastSearchValues.bsnmCd ?? "";
|
||||
const statsCd = activeStatsStatusInfo.statsCd ?? "";
|
||||
const instSeCd = userInfo?.instSeCd ?? "";
|
||||
const instSeCd = userInfo?.laeSeCd?? "";
|
||||
|
||||
if (!statsYr || !sewerBzmnCd || !statsCd || !instSeCd) {
|
||||
return null;
|
||||
@@ -123,7 +122,7 @@ const SewerageServiceLevelRvw = () => {
|
||||
statsCd,
|
||||
instSeCd,
|
||||
};
|
||||
}, [activeStatsStatusInfo.statsCd, lastSearchValues, userInfo?.instSeCd]);
|
||||
}, [activeStatsStatusInfo.statsCd, lastSearchValues, userInfo?.laeSeCd]);
|
||||
|
||||
const { showReviewOpinionButton, showReturnButton, showSubmitButton } = useMemo(() => {
|
||||
const statsStatusInfo = activeStatsStatusInfo;
|
||||
@@ -288,7 +287,6 @@ const SewerageServiceLevelRvw = () => {
|
||||
next.set(activeTab, {
|
||||
...(next.get(activeTab) ?? {}),
|
||||
splmntOpnnCn: row?.splmntOpnnCn ?? "",
|
||||
splmntRsltCn: row?.splmntRsltCn ?? "",
|
||||
});
|
||||
return next;
|
||||
});
|
||||
@@ -311,7 +309,6 @@ const SewerageServiceLevelRvw = () => {
|
||||
next.set(activeTab, {
|
||||
...(next.get(activeTab) ?? {}),
|
||||
splmntOpnnCn: param.splmntOpnnCn,
|
||||
splmntRsltCn: param.splmntRsltCn,
|
||||
});
|
||||
return next;
|
||||
});
|
||||
@@ -415,7 +412,6 @@ const SewerageServiceLevelRvw = () => {
|
||||
onOpenChange={setReviewOpinionOpen}
|
||||
context={reviewOpinionContext}
|
||||
initialReviewOpinion={latestReviewOpinion}
|
||||
initialProcessHistory={latestProcessHistory}
|
||||
onSave={saveReviewOpinion}
|
||||
/>
|
||||
<ReviewSubmitDialog
|
||||
|
||||
@@ -39,22 +39,14 @@ import { toGridRows } from "@/components/util/grid/gridFunction";
|
||||
|
||||
type ReviewHistoryRow = ReviewHistoryResponse["data"][number];
|
||||
|
||||
const checkPrvnStatusCd = (code: string) => {
|
||||
return (code === '0' || code === '1') ? '미작성' : (code === '2' ? '제출완료' : (code === '3' ? '승인완료' : '반려'));
|
||||
};
|
||||
|
||||
const checkSubmitStatusCd = (code: string) => {
|
||||
return code === '0' ? '미작성' : (code === '1' ? '작성중' : (code === '2' ? '제출완료' : (code === '3' ? '승인완료' : '보완요청')));
|
||||
};
|
||||
|
||||
const isStatsInputStatusRowApprovable = (row: Record<string, string | number>) =>
|
||||
String(row.submitStatusCd ?? "") === "3" && (String(row.prvnStatusCd ?? "") === "2" || String(row.prvnStatusCd ?? "") === "3");
|
||||
String(row.lclgvSbmsnSttsCd ?? "") === "3" &&
|
||||
(String(row.mctpvPicSbmsnSttsCd ?? "") === "2" ||
|
||||
String(row.mctpvPicSbmsnSttsCd ?? "") === "3");
|
||||
|
||||
const mapSewerageListToGridRows = (rawList: StatsInputStatusReviewItem[]) =>
|
||||
rawList.map((r) => ({
|
||||
...r,
|
||||
prvnStatusNm: checkPrvnStatusCd(r.prvnStatusCd || "0"),
|
||||
submitStatusNm: checkSubmitStatusCd(r.submitStatusCd || "0"),
|
||||
reviewHistory: "검토이력",
|
||||
}));
|
||||
|
||||
@@ -97,7 +89,7 @@ const StatsInputStatusRvw = () => {
|
||||
const reviewHistoryColumns = useMemo(() => {
|
||||
const col = createColumnHelper<ReviewHistoryRow>();
|
||||
return [
|
||||
col.accessor("logDt", {
|
||||
col.accessor("regDt", {
|
||||
header: "등록일",
|
||||
cell: (info) => info.getValue(),
|
||||
}),
|
||||
@@ -238,23 +230,23 @@ const StatsInputStatusRvw = () => {
|
||||
const allSubmitStatusApproved = useMemo(
|
||||
() =>
|
||||
rowData.length > 0 &&
|
||||
rowData.every((row) => String(row.submitStatusCd ?? "") === "3"),
|
||||
rowData.every((row) => String(row.lclgvSbmsnSttsCd ?? "") === "3"),
|
||||
[rowData],
|
||||
);
|
||||
|
||||
/** 진행상태(prvn) 코드가 모두 승인완료(3) */
|
||||
/** 진행상태(광역) 코드가 모두 승인완료(3) */
|
||||
const allPrvnStatusApproved = useMemo(
|
||||
() =>
|
||||
rowData.length > 0 &&
|
||||
rowData.every((row) => String(row.prvnStatusCd ?? "") === "3"),
|
||||
rowData.every((row) => String(row.mctpvPicSbmsnSttsCd ?? "") === "3"),
|
||||
[rowData],
|
||||
);
|
||||
|
||||
/** 진행상태(prvn) 코드가 모두 제출완료(2) */
|
||||
/** 진행상태(광역) 코드가 모두 제출완료(2) */
|
||||
const allPrvnStatusSubmitted = useMemo(
|
||||
() =>
|
||||
rowData.length > 0 &&
|
||||
rowData.every((row) => String(row.prvnStatusCd ?? "") === "2"),
|
||||
rowData.every((row) => String(row.mctpvPicSbmsnSttsCd ?? "") === "2"),
|
||||
[rowData],
|
||||
);
|
||||
|
||||
@@ -279,7 +271,7 @@ const StatsInputStatusRvw = () => {
|
||||
|
||||
const statsYr = lastSearchedValues.year ?? "";
|
||||
const sewerBzmnCd = lastSearchedValues.bsnmCd ?? "";
|
||||
const instSeCd = userInfo?.instSeCd ?? "";
|
||||
const instSeCd = userInfo?.laeSeCd?? "";
|
||||
|
||||
if (!statsYr || !sewerBzmnCd || !instSeCd) {
|
||||
return null;
|
||||
@@ -290,7 +282,7 @@ const StatsInputStatusRvw = () => {
|
||||
sewerBzmnCd,
|
||||
instSeCd,
|
||||
};
|
||||
}, [lastSearchedValues, userInfo?.instSeCd]);
|
||||
}, [lastSearchedValues, userInfo?.laeSeCd]);
|
||||
|
||||
const submitFunc = () => {
|
||||
if (submitDialogContext == null) {
|
||||
@@ -392,8 +384,8 @@ const StatsInputStatusRvw = () => {
|
||||
setRowData={setRowData}
|
||||
onDataCellClick={handleReviewHistoryCellClick}
|
||||
cellStyleCallback={({ row, fieldName }) => {
|
||||
if (fieldName === "submitStatusNm") {
|
||||
const statusCd = String(row.submitStatusCd ?? "");
|
||||
if (fieldName === "lclgvSbmsnSttsNm") {
|
||||
const statusCd = String(row.lclgvSbmsnSttsCd ?? "");
|
||||
|
||||
if (statusCd === "0" || statusCd === "1") {
|
||||
return "rg-cell-stats-status-pending";
|
||||
@@ -408,8 +400,8 @@ const StatsInputStatusRvw = () => {
|
||||
return "rg-cell-stats-status-rejected";
|
||||
}
|
||||
return undefined;
|
||||
} else if (fieldName === "prvnStatusNm") {
|
||||
const statusCd = String(row.prvnStatusCd ?? "");
|
||||
} else if (fieldName === "mctpvPicSbmsnSttsNm") {
|
||||
const statusCd = String(row.mctpvPicSbmsnSttsCd ?? "");
|
||||
|
||||
if (statusCd === "0" || statusCd === "1") {
|
||||
return "rg-cell-stats-status-pending";
|
||||
|
||||
@@ -108,7 +108,6 @@ const WaterReuseRvw = () => {
|
||||
}, [activeStatsStatusInfo.statsCd, lastSearchValues]);
|
||||
|
||||
const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? "";
|
||||
const latestProcessHistory = activeStatsStatusInfo.splmntRsltCn ?? "";
|
||||
|
||||
const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => {
|
||||
if (lastSearchValues == null) return null;
|
||||
@@ -116,7 +115,7 @@ const WaterReuseRvw = () => {
|
||||
const statsYr = lastSearchValues.year ?? "";
|
||||
const sewerBzmnCd = lastSearchValues.bsnmCd ?? "";
|
||||
const statsCd = activeStatsStatusInfo.statsCd ?? "";
|
||||
const instSeCd = userInfo?.instSeCd ?? "";
|
||||
const instSeCd = userInfo?.laeSeCd?? "";
|
||||
|
||||
if (!statsYr || !sewerBzmnCd || !statsCd || !instSeCd) {
|
||||
return null;
|
||||
@@ -128,7 +127,7 @@ const WaterReuseRvw = () => {
|
||||
statsCd,
|
||||
instSeCd,
|
||||
};
|
||||
}, [activeStatsStatusInfo.statsCd, lastSearchValues, userInfo?.instSeCd]);
|
||||
}, [activeStatsStatusInfo.statsCd, lastSearchValues, userInfo?.laeSeCd]);
|
||||
|
||||
const { showReviewOpinionButton, showReturnButton, showSubmitButton } = useMemo(() => {
|
||||
const statsStatusInfo = activeStatsStatusInfo;
|
||||
@@ -291,7 +290,6 @@ const WaterReuseRvw = () => {
|
||||
next.set(activeTab, {
|
||||
...(next.get(activeTab) ?? {}),
|
||||
splmntOpnnCn: row?.splmntOpnnCn ?? "",
|
||||
splmntRsltCn: row?.splmntRsltCn ?? "",
|
||||
});
|
||||
return next;
|
||||
});
|
||||
@@ -314,7 +312,6 @@ const WaterReuseRvw = () => {
|
||||
next.set(activeTab, {
|
||||
...(next.get(activeTab) ?? {}),
|
||||
splmntOpnnCn: param.splmntOpnnCn,
|
||||
splmntRsltCn: param.splmntRsltCn,
|
||||
});
|
||||
return next;
|
||||
});
|
||||
@@ -418,7 +415,6 @@ const WaterReuseRvw = () => {
|
||||
onOpenChange={setReviewOpinionOpen}
|
||||
context={reviewOpinionContext}
|
||||
initialReviewOpinion={latestReviewOpinion}
|
||||
initialProcessHistory={latestProcessHistory}
|
||||
onSave={saveReviewOpinion}
|
||||
/>
|
||||
<ReviewSubmitDialog
|
||||
|
||||
@@ -158,7 +158,7 @@ const ImrVerificationHistory = () => {
|
||||
});
|
||||
|
||||
const userInfo = useUserStore((state) => state.userInfo);
|
||||
const userInstSeCd = userInfo?.instSeCd;
|
||||
const userInstSeCd = userInfo?.laeSeCd;
|
||||
const { data: sidoData } = useSidoList({ instSeCd: userInstSeCd });
|
||||
const sidoOptions = sidoData?.sidoList ?? [];
|
||||
const selectedSidoBsnmCd =
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
import {
|
||||
Button,
|
||||
Dialog,
|
||||
DialogClose,
|
||||
DialogContent,
|
||||
DialogFooter,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
Label,
|
||||
Textarea,
|
||||
} from "@common/components";
|
||||
|
||||
export interface RejectReasonInputDialogProps {
|
||||
open: boolean;
|
||||
onOpenChange: (open: boolean) => void;
|
||||
onConfirm?: (reason: string) => void | Promise<void>;
|
||||
}
|
||||
|
||||
export function RejectReasonInputDialog({
|
||||
open,
|
||||
onOpenChange,
|
||||
onConfirm,
|
||||
}: RejectReasonInputDialogProps) {
|
||||
const [reason, setReason] = useState("");
|
||||
const [reasonError, setReasonError] = useState(false);
|
||||
const [isSubmitting, setIsSubmitting] = useState(false);
|
||||
|
||||
const resetForm = () => {
|
||||
setReason("");
|
||||
setReasonError(false);
|
||||
};
|
||||
|
||||
const handleDialogOpenChange = (nextOpen: boolean) => {
|
||||
if (!nextOpen) resetForm();
|
||||
onOpenChange(nextOpen);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (!open) resetForm();
|
||||
}, [open]);
|
||||
|
||||
const handleConfirm = async () => {
|
||||
const trimmed = reason.trim();
|
||||
if (!trimmed) {
|
||||
setReasonError(true);
|
||||
return;
|
||||
}
|
||||
try {
|
||||
setIsSubmitting(true);
|
||||
await onConfirm?.(trimmed);
|
||||
} finally {
|
||||
setIsSubmitting(false);
|
||||
}
|
||||
};
|
||||
|
||||
const canSubmit = reason.trim().length > 0 && !isSubmitting;
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={handleDialogOpenChange}>
|
||||
<DialogContent
|
||||
className="max-w-[56rem]"
|
||||
aria-describedby={undefined}
|
||||
>
|
||||
<DialogHeader>
|
||||
<DialogTitle>반려</DialogTitle>
|
||||
</DialogHeader>
|
||||
<div className="flex flex-col gap-4 py-2">
|
||||
<div className="flex flex-col gap-2">
|
||||
<Label className="text-label mb-2">반려 사유</Label>
|
||||
<Textarea
|
||||
value={reason}
|
||||
onChange={(e) => {
|
||||
setReason(e.target.value);
|
||||
if (reasonError) setReasonError(false);
|
||||
}}
|
||||
className="min-h-[12rem] resize-y !text-[1.3rem] !leading-6"
|
||||
placeholder="반려 사유를 입력하세요."
|
||||
disabled={isSubmitting}
|
||||
/>
|
||||
{reasonError && (
|
||||
<p className="text-[1.2rem] text-red-500">
|
||||
반려 사유를 작성해주세요.
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<DialogFooter>
|
||||
<DialogClose asChild>
|
||||
<Button
|
||||
type="button"
|
||||
color="gray"
|
||||
disabled={isSubmitting}
|
||||
>
|
||||
취소
|
||||
</Button>
|
||||
</DialogClose>
|
||||
<Button
|
||||
type="button"
|
||||
color="red"
|
||||
disabled={!canSubmit}
|
||||
onClick={() => void handleConfirm()}
|
||||
>
|
||||
반려
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
@@ -16,6 +16,7 @@ import {
|
||||
type RejectRequest,
|
||||
type ReportStatusResponseDto,
|
||||
statisticsApprovalApi,
|
||||
type VrfcSttsRejectRequest,
|
||||
type StatisticsVerificationFilterState,
|
||||
statisticsVerificationReportColumnInfo,
|
||||
statisticsVerificationResultColumnInfo,
|
||||
@@ -52,6 +53,7 @@ import {
|
||||
type ApprovalFormData,
|
||||
ApprovalInputDialog,
|
||||
} from "@/components/statistics/verification/ApprovalInputDialog";
|
||||
import { RejectReasonInputDialog } from "@/components/statistics/verification/RejectReasonInputDialog";
|
||||
import type { CellEditedCallbackParams } from "@/components/type/DataGrid.type";
|
||||
import { doList } from "@/components/util/column/input/DoList";
|
||||
import { toGridRows } from "@/components/util/grid/gridFunction";
|
||||
@@ -181,6 +183,7 @@ function StatisticsVerificationReport() {
|
||||
VerifyResultItem[]
|
||||
>([]);
|
||||
const [approvalDialogOpen, setApprovalDialogOpen] = useState(false);
|
||||
const [rejectDialogOpen, setRejectDialogOpen] = useState(false);
|
||||
const editedResultRowMapRef = useRef<Map<number, VerifyResultItem>>(
|
||||
new Map(),
|
||||
);
|
||||
@@ -188,7 +191,7 @@ function StatisticsVerificationReport() {
|
||||
const prevLengthRef = useRef(0);
|
||||
const rejectedVrfcSnRef = useRef<Set<number>>(new Set());
|
||||
|
||||
const userInstSeCd = userInfo?.instSeCd;
|
||||
const userInstSeCd = userInfo?.laeSeCd;
|
||||
const { data: sidoData } = useSidoList({ instSeCd: userInstSeCd });
|
||||
const sidoList = sidoData?.sidoList ?? [];
|
||||
const selectedSidoBsnmCd = filters.ctpvSewerBzmnCd ?? "";
|
||||
@@ -383,6 +386,11 @@ function StatisticsVerificationReport() {
|
||||
},
|
||||
});
|
||||
|
||||
const { mutateAsync: onVrfcSttsRejectStats } = useMutationWrapper({
|
||||
mutationFn: (rejectRequests: VrfcSttsRejectRequest[]) =>
|
||||
statisticsApprovalApi.VrfcSttsRejectStats(rejectRequests),
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (!statisticsVerificationReportQuery.isError) return;
|
||||
alert("통계검증리포트 조회 중 오류가 발생했습니다.");
|
||||
@@ -593,6 +601,58 @@ function StatisticsVerificationReport() {
|
||||
}
|
||||
}
|
||||
|
||||
function handleVrfcSttsReject() {
|
||||
if (selectedReportRows.length === 0) return;
|
||||
setRejectDialogOpen(true);
|
||||
}
|
||||
|
||||
async function handleVrfcSttsRejectConfirm(reason: string) {
|
||||
const rjctOpnnCn = reason.trim();
|
||||
if (!rjctOpnnCn) {
|
||||
alert("반려 사유를 작성해주세요.");
|
||||
return;
|
||||
}
|
||||
|
||||
const rejectRequests: VrfcSttsRejectRequest[] = selectedReportRows.map(
|
||||
(row) => ({
|
||||
statsYr: filters.statsYr,
|
||||
sewerBzmnCd: row.sewerBzmnCd ?? "",
|
||||
statsCd: row.statsCd ?? "",
|
||||
rjctOpnnCn,
|
||||
mdfrUuid: userInfo?.userUnqId ?? "",
|
||||
}),
|
||||
);
|
||||
|
||||
try {
|
||||
const data = await onVrfcSttsRejectStats(rejectRequests);
|
||||
if (
|
||||
data.resultCode &&
|
||||
data.resultCode.toLowerCase() !== "success"
|
||||
) {
|
||||
alert(data.message || "반려 중 오류가 발생했습니다.");
|
||||
return;
|
||||
}
|
||||
alert(data.message ?? "반려가 완료되었습니다.");
|
||||
setRejectDialogOpen(false);
|
||||
setSelectedReportRows([]);
|
||||
resetResultState();
|
||||
await Promise.all([
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: [ENDPOINT.ST_SERVICE.INPUT, "validation-report"],
|
||||
}),
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: [
|
||||
ENDPOINT.ST_SERVICE.INPUTVERIFY,
|
||||
"verify-results",
|
||||
],
|
||||
}),
|
||||
]);
|
||||
} catch {
|
||||
alert("반려 중 오류가 발생했습니다.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function handleReportRefresh() {
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: [ENDPOINT.ST_SERVICE.INPUT, "validation-report"],
|
||||
@@ -612,6 +672,11 @@ function StatisticsVerificationReport() {
|
||||
onOpenChange={setApprovalDialogOpen}
|
||||
onConfirm={handleApprovalConfirm}
|
||||
/>
|
||||
<RejectReasonInputDialog
|
||||
open={rejectDialogOpen}
|
||||
onOpenChange={setRejectDialogOpen}
|
||||
onConfirm={handleVrfcSttsRejectConfirm}
|
||||
/>
|
||||
<div className="flex justify-between p-2">
|
||||
<div className="flex items-center gap-6">
|
||||
<FilterSelect
|
||||
@@ -679,6 +744,18 @@ function StatisticsVerificationReport() {
|
||||
>
|
||||
승인
|
||||
</Button>
|
||||
<Button
|
||||
color="red"
|
||||
onClick={handleVrfcSttsReject}
|
||||
disabled={selectedReportRows.length === 0 ||
|
||||
!selectedReportRows.every(
|
||||
(row) =>
|
||||
row.mctpvPicSbmsnSttsCd === "3" && row.pbcpSbmsnSttsCd !== "3",
|
||||
)
|
||||
}
|
||||
>
|
||||
반려
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
+7
-4
@@ -554,17 +554,20 @@ const DetailComponent = ({
|
||||
const userInfo = await getUserInfo();
|
||||
let response;
|
||||
|
||||
const vrfcSn = detailInfo?.commonInfo.vrfcSn;
|
||||
if (vrfcSn == null) {
|
||||
alert("검증 일련번호가 없습니다.");
|
||||
return;
|
||||
}
|
||||
if (!hasPersistedDetails) {
|
||||
response =
|
||||
await generalverificationApiService.RegistVrfcDetail({
|
||||
vrfcSn: detailInfo?.commonInfo.vrfcSn ?? null,
|
||||
await generalverificationApiService.RegistVrfcDetail(vrfcSn, {
|
||||
detailList: rows,
|
||||
rgtrUuid: userInfo.userUnqId,
|
||||
});
|
||||
} else {
|
||||
response =
|
||||
await generalverificationApiService.UpdateVrfcDetail({
|
||||
vrfcSn: detailInfo?.commonInfo.vrfcSn ?? null,
|
||||
await generalverificationApiService.UpdateVrfcDetail(vrfcSn, {
|
||||
detailList: rows,
|
||||
mdfrUuid: userInfo.userUnqId,
|
||||
});
|
||||
|
||||
+14
-7
@@ -146,9 +146,15 @@ const RegistDialog = memo(
|
||||
}
|
||||
};
|
||||
|
||||
const handleUpdateVrfcMaster = async (data: GeneralVerificationMasterSubmitFormData) => {
|
||||
const handleUpdateVrfcMaster = async (
|
||||
updateVrfcSn: number,
|
||||
body: UpdateVrfcMasterRequest,
|
||||
) => {
|
||||
try {
|
||||
const response = await generalverificationApiService.UpdateVrfcMaster(data as UpdateVrfcMasterRequest);
|
||||
const response = await generalverificationApiService.UpdateVrfcMaster(
|
||||
updateVrfcSn,
|
||||
body,
|
||||
);
|
||||
|
||||
if (response.status === 'success') {
|
||||
alert('수정되었습니다.');
|
||||
@@ -258,8 +264,11 @@ const RegistDialog = memo(
|
||||
if (await confirm(confirmMessage)) {
|
||||
const userInfo = await getUserInfo();
|
||||
if (isVrfcSn) {
|
||||
const updateData = {
|
||||
vrfcSn: data.vrfcSn,
|
||||
if (data.vrfcSn == null) {
|
||||
alert('수정 대상이 없습니다.');
|
||||
return;
|
||||
}
|
||||
await handleUpdateVrfcMaster(data.vrfcSn, {
|
||||
vrfcNm: data.vrfcNm,
|
||||
vrfcClsfCd: data.vrfcClsfCd,
|
||||
dcptDgt: data.dcptDgt,
|
||||
@@ -267,10 +276,8 @@ const RegistDialog = memo(
|
||||
...(data.dcptDgt === 0
|
||||
? {}
|
||||
: { dcptPrcsMthCd: data.dcptPrcsMthCd }),
|
||||
trgtStatsCd: data.trgtStatsCd,
|
||||
mdfrUuid: userInfo.userUnqId,
|
||||
};
|
||||
await handleUpdateVrfcMaster(updateData);
|
||||
});
|
||||
} else {
|
||||
const registData = {
|
||||
vrfcNm: data.vrfcNm,
|
||||
|
||||
@@ -481,6 +481,11 @@ export type DataGridProps = {
|
||||
headerHeight?: number;
|
||||
/** RealGrid `displayOptions.fitStyle` (기본 EVEN). 컬럼별 width 유지 시 NONE */
|
||||
fitStyle?: GridFitStyle;
|
||||
/**
|
||||
* true면 붙여넣기·편집으로 행을 추가하지 않음.
|
||||
* 검증 결과처럼 조회 행 수가 고정된 그리드에서 사용.
|
||||
*/
|
||||
preventRowAppend?: boolean;
|
||||
};
|
||||
|
||||
export type TabDataGridProps = {
|
||||
|
||||
@@ -8,6 +8,7 @@ export const doList = [
|
||||
"4600000000",
|
||||
"4700000000",
|
||||
"4800000000",
|
||||
"5000000000",
|
||||
];
|
||||
|
||||
export const needBsnmFrgnrPoplSmSidoList = [
|
||||
|
||||
-4
@@ -27,7 +27,6 @@ export const ExcretaSlurgeProcessingStatusInpColumn = {
|
||||
'rcycQnt',
|
||||
'olandLfvlm',
|
||||
'incnrQnt',
|
||||
'oceanInputQnt',
|
||||
'fuelQnt',
|
||||
'etcQnt',
|
||||
'unprcsQnt'
|
||||
@@ -51,7 +50,6 @@ export const ExcretaSlurgeProcessingStatusInpColumn = {
|
||||
'rcycQnt',
|
||||
'olandLfvlm',
|
||||
'incnrQnt',
|
||||
'oceanInputQnt',
|
||||
'fuelQnt',
|
||||
'etcQnt',
|
||||
],
|
||||
@@ -61,7 +59,6 @@ export const ExcretaSlurgeProcessingStatusInpColumn = {
|
||||
{ name: 'rcycQnt', fieldName: 'rcycQnt', header: { text: '재활용' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
|
||||
{ name: 'olandLfvlm', fieldName: 'olandLfvlm', header: { text: '육상매립' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
|
||||
{ name: 'incnrQnt', fieldName: 'incnrQnt', header: { text: '소각' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
|
||||
{ name: 'oceanInputQnt', fieldName: 'oceanInputQnt', header: { text: '해양투기' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
|
||||
{ name: 'fuelQnt', fieldName: 'fuelQnt', header: { text: '연료화' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
|
||||
{ name: 'etcQnt', fieldName: 'etcQnt', header: { text: '기타' }, footer: footerDecimal1, valueType: ValueType.NUMBER, dataFormat: '#,##0.0' },
|
||||
|
||||
@@ -100,7 +97,6 @@ export const ExcretaSlurgeProcessingStatusInpColumn = {
|
||||
'rcycQnt',
|
||||
'olandLfvlm',
|
||||
'incnrQnt',
|
||||
'oceanInputQnt',
|
||||
'fuelQnt',
|
||||
'etcQnt'
|
||||
]
|
||||
|
||||
@@ -49,6 +49,43 @@ export const ManholeStatusInpColumn = {
|
||||
styleName: "rg-cell-readonly",
|
||||
footer: { text: "합계" },
|
||||
},
|
||||
{
|
||||
name: "wholMnhlCntSum",
|
||||
fieldName: "wholMnhlCntSum",
|
||||
header: { text: "맨홀총계" },
|
||||
footer: footerInt,
|
||||
editable: false,
|
||||
valueType: ValueType.NUMBER,
|
||||
dataFormat: "#,##0",
|
||||
styleName: "rg-cell-readonly",
|
||||
},
|
||||
{
|
||||
name: "frlvlMnhlCntSum",
|
||||
fieldName: "frlvlMnhlCntSum",
|
||||
header: { text: "주철계" },
|
||||
footer: footerInt,
|
||||
editable: false,
|
||||
valueType: ValueType.NUMBER,
|
||||
dataFormat: "#,##0",
|
||||
styleName: "rg-cell-readonly",
|
||||
},
|
||||
{
|
||||
name: "thlvlMnhlCntSum",
|
||||
fieldName: "thlvlMnhlCntSum",
|
||||
header: { text: "콘크리트계" },
|
||||
footer: footerInt,
|
||||
editable: false,
|
||||
valueType: ValueType.NUMBER,
|
||||
dataFormat: "#,##0",
|
||||
styleName: "rg-cell-readonly",
|
||||
},
|
||||
{
|
||||
name: "picNm",
|
||||
fieldName: "picNm",
|
||||
header: { text: "담당자명" },
|
||||
editable: false,
|
||||
styleName: "rg-cell-readonly",
|
||||
},
|
||||
{
|
||||
...intCol("wholMnhlCnt", "계", false),
|
||||
computed: {
|
||||
@@ -88,6 +125,12 @@ export const ManholeStatusInpColumn = {
|
||||
},
|
||||
"admdstNm",
|
||||
"emphsMngSeNm",
|
||||
{
|
||||
name: "adminRefGroup",
|
||||
hideChildHeaders: false,
|
||||
header: { text: "행정참고자료" },
|
||||
items: ["wholMnhlCntSum", "frlvlMnhlCntSum", "thlvlMnhlCntSum", "picNm"],
|
||||
},
|
||||
{
|
||||
name: "mtrlGroup",
|
||||
hideChildHeaders: false,
|
||||
|
||||
@@ -1,19 +1,26 @@
|
||||
import { ValueType } from "realgrid";
|
||||
|
||||
import type { ColumnConfig, ColumnLayoutItem } from "@/components/type/DataGrid.type";
|
||||
import type { ColumnConfig, ColumnInfoList, ColumnLayoutItem } from "@/components/type/DataGrid.type";
|
||||
import { footerDecimal2 } from "@/components/util/grid/footerSummary";
|
||||
|
||||
// 하수도 통계 관리 > 02.하수관로 > tab 3. 관종별 현황
|
||||
// SeweragePipeInputPipeTypeStatusItem + commonInfo.ctpvNm (그리드 행에 병합)
|
||||
//
|
||||
// 연도 그룹: y1995 = 1996년 이전, y1996 = 1996년 …
|
||||
// 표시 구간: 1996년 ~ (현재 연도 − 1) 까지.
|
||||
// 표시 구간: 1996년 ~ 조회 연도(statsYr) 까지.
|
||||
|
||||
/** 이 모듈이 로드될 때의 “데이터 기준 마지막 연도” (현재 연도 − 1) */
|
||||
const lastDataYear = new Date().getFullYear() - 1;
|
||||
const firstGroupedYear = 1995;
|
||||
const firstVisibleYear = 1996;
|
||||
|
||||
/** 조회 연도까지 연도 컬럼을 그림. 조회 전이면 현재 연도 − 1. */
|
||||
export function resolvePipeTypeColumnEndYear(statsYr?: string | number | null): number {
|
||||
const parsed = Number(statsYr);
|
||||
if (Number.isFinite(parsed) && parsed > 0) {
|
||||
return Math.max(firstGroupedYear, Math.floor(parsed));
|
||||
}
|
||||
return Math.max(firstGroupedYear, new Date().getFullYear() - 1);
|
||||
}
|
||||
|
||||
const yearField = (year: number, suffix: "PrlgWhol" | "LyngPrlg" | "DmltnPrlg") =>
|
||||
`y${year}${suffix}`;
|
||||
|
||||
@@ -61,17 +68,25 @@ const yearCols = (
|
||||
];
|
||||
};
|
||||
|
||||
const visibleYears =
|
||||
lastDataYear < firstVisibleYear
|
||||
? []
|
||||
: Array.from(
|
||||
{ length: lastDataYear - firstVisibleYear + 1 },
|
||||
(_, i) => firstVisibleYear + i,
|
||||
);
|
||||
function buildVisibleYears(lastDataYear: number): number[] {
|
||||
if (lastDataYear < firstVisibleYear) return [];
|
||||
return Array.from(
|
||||
{ length: lastDataYear - firstVisibleYear + 1 },
|
||||
(_, i) => firstVisibleYear + i,
|
||||
);
|
||||
}
|
||||
|
||||
const yearLayoutItems: ColumnLayoutItem[] = [];
|
||||
for (const y of visibleYears) {
|
||||
yearLayoutItems.push({
|
||||
export type PipeTypeStatusInpColumnConfig = ColumnInfoList & {
|
||||
columns: ColumnConfig[];
|
||||
columnLayout: ColumnLayoutItem[];
|
||||
};
|
||||
|
||||
export function getPipeTypeStatusInpColumn(
|
||||
statsYr?: string | number | null,
|
||||
): PipeTypeStatusInpColumnConfig {
|
||||
const lastDataYear = resolvePipeTypeColumnEndYear(statsYr);
|
||||
const visibleYears = buildVisibleYears(lastDataYear);
|
||||
const yearLayoutItems: ColumnLayoutItem[] = visibleYears.map((y) => ({
|
||||
name: `year${y}`,
|
||||
hideChildHeaders: false,
|
||||
header: { text: `${y}년` },
|
||||
@@ -80,145 +95,147 @@ for (const y of visibleYears) {
|
||||
yearField(y, "LyngPrlg"),
|
||||
yearField(y, "DmltnPrlg"),
|
||||
],
|
||||
});
|
||||
}));
|
||||
|
||||
return {
|
||||
columns: [
|
||||
{
|
||||
name: "ctpvNm",
|
||||
fieldName: "ctpvNm",
|
||||
header: { text: "시도" },
|
||||
footer: { text: "합계" },
|
||||
editable: false,
|
||||
styleName: "rg-cell-readonly",
|
||||
},
|
||||
{
|
||||
name: "sggNm",
|
||||
fieldName: "sggNm",
|
||||
header: { text: "시군구" },
|
||||
editable: false,
|
||||
styleName: "rg-cell-readonly",
|
||||
},
|
||||
{
|
||||
name: "pipeSeNm",
|
||||
fieldName: "pipeSeNm",
|
||||
header: { text: "관종" },
|
||||
footer: { text: "합계" },
|
||||
editable: false,
|
||||
styleName: "rg-cell-readonly",
|
||||
},
|
||||
{
|
||||
name: "admdstNm",
|
||||
fieldName: "admdstNm",
|
||||
header: { text: "행정구역명" },
|
||||
editable: false,
|
||||
styleName: "rg-cell-readonly",
|
||||
},
|
||||
{
|
||||
name: "pipeByPrstWhol",
|
||||
fieldName: "pipeByPrstWhol",
|
||||
header: { text: "계" },
|
||||
styleName: "rg-cell-total",
|
||||
footer: footerDecimal2,
|
||||
editable: false,
|
||||
valueType: ValueType.NUMBER,
|
||||
dataFormat: "#,##0.00",
|
||||
computed: {
|
||||
minuendFields: [
|
||||
yearField(firstGroupedYear, "LyngPrlg"),
|
||||
...visibleYears.map((year) => yearField(year, "LyngPrlg")),
|
||||
],
|
||||
subtrahendFields: [
|
||||
yearField(firstGroupedYear, "DmltnPrlg"),
|
||||
...visibleYears.map((year) => yearField(year, "DmltnPrlg")),
|
||||
],
|
||||
type: "differenceOfSums" as const,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "lyngPrlg",
|
||||
fieldName: "lyngPrlg",
|
||||
header: { text: "매설연장(m)" },
|
||||
styleName: "rg-cell-total",
|
||||
footer: footerDecimal2,
|
||||
editable: false,
|
||||
valueType: ValueType.NUMBER,
|
||||
dataFormat: "#,##0.00",
|
||||
},
|
||||
{
|
||||
name: "dmltnPrlg",
|
||||
fieldName: "dmltnPrlg",
|
||||
header: { text: "철거연장(m)" },
|
||||
styleName: "rg-cell-total",
|
||||
footer: footerDecimal2,
|
||||
editable: false,
|
||||
valueType: ValueType.NUMBER,
|
||||
dataFormat: "#,##0.00",
|
||||
computed: {
|
||||
fields: [
|
||||
yearField(firstGroupedYear, "DmltnPrlg"),
|
||||
...visibleYears.map((year) => yearField(year, "DmltnPrlg")),
|
||||
],
|
||||
type: "sum" as const,
|
||||
},
|
||||
},
|
||||
...yearCols(firstGroupedYear, { footer: footerDecimal2 }),
|
||||
...visibleYears.map((year) =>
|
||||
yearCols(year, {
|
||||
footer: footerDecimal2,
|
||||
}),
|
||||
).flat(),
|
||||
{ name: "rmrk", fieldName: "rmrk", header: { text: "비고" } },
|
||||
{
|
||||
name: "admdstCd",
|
||||
fieldName: "admdstCd",
|
||||
header: { text: "행정구역코드" },
|
||||
visible: false,
|
||||
editable: false,
|
||||
styleName: "rg-cell-readonly",
|
||||
},
|
||||
{
|
||||
name: "pipeSeCd",
|
||||
fieldName: "pipeSeCd",
|
||||
header: { text: "관종코드" },
|
||||
visible: false,
|
||||
editable: false,
|
||||
styleName: "rg-cell-readonly",
|
||||
},
|
||||
] as ColumnConfig[],
|
||||
columnLayout: [
|
||||
{
|
||||
name: "adminArea",
|
||||
hideChildHeaders: false,
|
||||
header: { text: "행정구역" },
|
||||
items: [{ column: "ctpvNm", footerUserSpans: [{ colspan: 2 }] }, "sggNm"],
|
||||
},
|
||||
"pipeSeNm",
|
||||
"admdstNm",
|
||||
{
|
||||
name: "totalGroup",
|
||||
hideChildHeaders: false,
|
||||
header: { text: "총계" },
|
||||
items: ["pipeByPrstWhol", "lyngPrlg", "dmltnPrlg"],
|
||||
},
|
||||
{
|
||||
name: "year1996Before",
|
||||
hideChildHeaders: false,
|
||||
header: { text: "1996년 이전" },
|
||||
items: [
|
||||
yearField(firstGroupedYear, "PrlgWhol"),
|
||||
yearField(firstGroupedYear, "LyngPrlg"),
|
||||
yearField(firstGroupedYear, "DmltnPrlg"),
|
||||
],
|
||||
},
|
||||
...yearLayoutItems,
|
||||
"rmrk",
|
||||
"admdstCd",
|
||||
"pipeSeCd",
|
||||
] as ColumnLayoutItem[],
|
||||
rowStartNum: 2,
|
||||
fixedColumns: 2,
|
||||
tabKey: "ST00020003",
|
||||
tabLabel: "관종별 현황",
|
||||
};
|
||||
}
|
||||
|
||||
export const PipeTypeStatusInpColumn = {
|
||||
columns: [
|
||||
{
|
||||
name: "ctpvNm",
|
||||
fieldName: "ctpvNm",
|
||||
header: { text: "시도" },
|
||||
footer: { text: "합계" },
|
||||
editable: false,
|
||||
styleName: "rg-cell-readonly",
|
||||
},
|
||||
{
|
||||
name: "sggNm",
|
||||
fieldName: "sggNm",
|
||||
header: { text: "시군구" },
|
||||
editable: false,
|
||||
styleName: "rg-cell-readonly",
|
||||
},
|
||||
{
|
||||
name: "pipeSeNm",
|
||||
fieldName: "pipeSeNm",
|
||||
header: { text: "관종" },
|
||||
footer: { text: "합계" },
|
||||
editable: false,
|
||||
styleName: "rg-cell-readonly",
|
||||
},
|
||||
{
|
||||
name: "admdstNm",
|
||||
fieldName: "admdstNm",
|
||||
header: { text: "행정구역명" },
|
||||
editable: false,
|
||||
styleName: "rg-cell-readonly",
|
||||
},
|
||||
{
|
||||
name: "pipeByPrstWhol",
|
||||
fieldName: "pipeByPrstWhol",
|
||||
header: { text: "계" },
|
||||
styleName: "rg-cell-total",
|
||||
footer: footerDecimal2,
|
||||
editable: false,
|
||||
valueType: ValueType.NUMBER,
|
||||
dataFormat: "#,##0.00",
|
||||
computed: {
|
||||
minuendFields: [
|
||||
yearField(firstGroupedYear, "LyngPrlg"),
|
||||
...visibleYears.map((year) => yearField(year, "LyngPrlg")),
|
||||
],
|
||||
subtrahendFields: [
|
||||
yearField(firstGroupedYear, "DmltnPrlg"),
|
||||
...visibleYears.map((year) => yearField(year, "DmltnPrlg")),
|
||||
],
|
||||
type: "differenceOfSums" as const,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "lyngPrlg",
|
||||
fieldName: "lyngPrlg",
|
||||
header: { text: "매설연장(m)" },
|
||||
styleName: "rg-cell-total",
|
||||
footer: footerDecimal2,
|
||||
editable: false,
|
||||
valueType: ValueType.NUMBER,
|
||||
dataFormat: "#,##0.00",
|
||||
},
|
||||
{
|
||||
name: "dmltnPrlg",
|
||||
fieldName: "dmltnPrlg",
|
||||
header: { text: "철거연장(m)" },
|
||||
styleName: "rg-cell-total",
|
||||
footer: footerDecimal2,
|
||||
editable: false,
|
||||
valueType: ValueType.NUMBER,
|
||||
dataFormat: "#,##0.00",
|
||||
computed: {
|
||||
fields: [
|
||||
yearField(firstGroupedYear, "DmltnPrlg"),
|
||||
...visibleYears.map((year) => yearField(year, "DmltnPrlg")),
|
||||
],
|
||||
type: "sum" as const,
|
||||
},
|
||||
},
|
||||
...yearCols(firstGroupedYear, { footer: footerDecimal2 }),
|
||||
...visibleYears.map((year) =>
|
||||
yearCols(year, {
|
||||
footer: footerDecimal2,
|
||||
}),
|
||||
).flat(),
|
||||
{ name: "rmrk", fieldName: "rmrk", header: { text: "비고" } },
|
||||
{
|
||||
name: "admdstCd",
|
||||
fieldName: "admdstCd",
|
||||
header: { text: "행정구역코드" },
|
||||
visible: false,
|
||||
editable: false,
|
||||
styleName: "rg-cell-readonly",
|
||||
},
|
||||
{
|
||||
name: "pipeSeCd",
|
||||
fieldName: "pipeSeCd",
|
||||
header: { text: "관종코드" },
|
||||
visible: false,
|
||||
editable: false,
|
||||
styleName: "rg-cell-readonly",
|
||||
},
|
||||
] as ColumnConfig[],
|
||||
columnLayout: [
|
||||
{
|
||||
name: "adminArea",
|
||||
hideChildHeaders: false,
|
||||
header: { text: "행정구역" },
|
||||
items: [{ column: "ctpvNm", footerUserSpans: [{ colspan: 2 }] }, "sggNm"],
|
||||
},
|
||||
"pipeSeNm",
|
||||
"admdstNm",
|
||||
{
|
||||
name: "totalGroup",
|
||||
hideChildHeaders: false,
|
||||
header: { text: "총계" },
|
||||
items: ["pipeByPrstWhol", "lyngPrlg", "dmltnPrlg"],
|
||||
},
|
||||
{
|
||||
name: "year1996Before",
|
||||
hideChildHeaders: false,
|
||||
header: { text: "1996년 이전" },
|
||||
items: [
|
||||
yearField(firstGroupedYear, "PrlgWhol"),
|
||||
yearField(firstGroupedYear, "LyngPrlg"),
|
||||
yearField(firstGroupedYear, "DmltnPrlg"),
|
||||
],
|
||||
},
|
||||
...yearLayoutItems,
|
||||
'rmrk',
|
||||
'admdstCd',
|
||||
'pipeSeCd'
|
||||
] as ColumnLayoutItem[],
|
||||
rowStartNum: 2,
|
||||
fixedColumns: 2,
|
||||
tabKey: "ST00020003",
|
||||
tabLabel: "관종별 현황",
|
||||
};
|
||||
export const PipeTypeStatusInpColumn = getPipeTypeStatusInpColumn();
|
||||
|
||||
+2
@@ -75,6 +75,8 @@ export const PublicSewageTreatWaterReuseInpColumn = {
|
||||
name: 'lglYn',
|
||||
fieldName: 'lglYn',
|
||||
header: { text: '법적의무대상(대상/미대상)' },
|
||||
editable: false,
|
||||
styleName: 'rg-cell-readonly'
|
||||
},
|
||||
PUBLIC_SEWAGE_TREAT_WATER_REUSE_LGL_YN_VALUES,
|
||||
),
|
||||
|
||||
@@ -32,11 +32,11 @@ export const getGeneralVerificationColumns = (
|
||||
},
|
||||
{
|
||||
accessorKey: "vrfcClsfNm",
|
||||
header: "검증분류",
|
||||
header: "검증 분류",
|
||||
},
|
||||
{
|
||||
accessorKey: "useYn",
|
||||
header: "사용여부",
|
||||
header: "사용 여부",
|
||||
},
|
||||
{
|
||||
accessorKey: "regDt",
|
||||
|
||||
@@ -346,7 +346,6 @@ const rawSludgeList = [
|
||||
decimal1Col("rcycQnt", "재활용"),
|
||||
decimal1Col("olandLfvlm", "육상매립"),
|
||||
decimal1Col("incnrQnt", "소각"),
|
||||
decimal1Col("oceanInputQnt", "해양투기"),
|
||||
decimal1Col("fuelQnt", "연료화"),
|
||||
decimal1Col("etcQnt", "기타"),
|
||||
decimal1Col("unprcsQnt", "미처분량\n(이월량)(C)"),
|
||||
@@ -366,7 +365,6 @@ const rawSludgeList = [
|
||||
"rcycQnt",
|
||||
"olandLfvlm",
|
||||
"incnrQnt",
|
||||
"oceanInputQnt",
|
||||
"fuelQnt",
|
||||
"etcQnt",
|
||||
],
|
||||
|
||||
@@ -491,6 +491,10 @@ const rawList = [
|
||||
{ name: 'sggNm', fieldName: 'sggNm', header: { text: '시군구' }, mergeCells: true, sortdisable: true },
|
||||
{ name: 'admdstNm', fieldName: 'admdstNm', header: { text: '행정구역명' }, mergeCells: true, sortdisable: true },
|
||||
{ name: 'emphsMngSeNm', fieldName: 'emphsMngSeNm', header: { text: '집중강우\n중점관리\n구역구분' }, mergeCells: true },
|
||||
{ name: 'wholMnhlCntSum', fieldName: 'wholMnhlCntSum', header: { text: '맨홀총계' }, footer: footerIntArrayByDivision, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
|
||||
{ name: 'frlvlMnhlCntSum', fieldName: 'frlvlMnhlCntSum', header: { text: '주철계' }, footer: footerIntArrayByDivision, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
|
||||
{ name: 'thlvlMnhlCntSum', fieldName: 'thlvlMnhlCntSum', header: { text: '콘크리트계' }, footer: footerIntArrayByDivision, valueType: ValueType.NUMBER, dataFormat: '#,##0' },
|
||||
{ name: 'picNm', fieldName: 'picNm', header: { text: '담당자명' } },
|
||||
{
|
||||
name: 'displayYear',
|
||||
fieldName: 'displayYear',
|
||||
@@ -544,6 +548,12 @@ const rawList = [
|
||||
],
|
||||
},
|
||||
'emphsMngSeNm',
|
||||
{
|
||||
name: 'adminRefGroup',
|
||||
hideChildHeaders: false,
|
||||
header: { text: '행정참고자료' },
|
||||
items: ['wholMnhlCntSum', 'frlvlMnhlCntSum', 'thlvlMnhlCntSum', 'picNm'],
|
||||
},
|
||||
'displayYear',
|
||||
{
|
||||
name: 'mtrlGroup',
|
||||
|
||||
@@ -17,12 +17,12 @@ const StatsInputStatusInfoColumnRaw = {
|
||||
styleName: 'rg-cell-outline-action-btn',
|
||||
},
|
||||
|
||||
{ name: 'chargerNm', fieldName: 'chargerNm', header: { text: '제출자' } },
|
||||
{ name: 'chargerCttpc', fieldName: 'chargerCttpc', header: { text: '연락처' } },
|
||||
{ name: 'submitStatusNm', fieldName: 'submitStatusNm', header: { text: '지자체진행상태' } },
|
||||
{ name: 'submitStatusCd', fieldName: 'submitStatusCd', header: { text: '지자체진행상태코드' }, visible: false },
|
||||
{ name: 'prvnStatusNm', fieldName: 'prvnStatusNm', header: { text: '진행상태' } },
|
||||
{ name: 'prvnStatusCd', fieldName: 'prvnStatusCd', header: { text: '진행상태코드' }, visible: false },
|
||||
{ name: 'lclgvPicNm', fieldName: 'lclgvPicNm', header: { text: '제출자' } },
|
||||
{ name: 'lclgvPicTelnoCn', fieldName: 'lclgvPicTelnoCn', header: { text: '연락처' } },
|
||||
{ name: 'lclgvSbmsnSttsNm', fieldName: 'lclgvSbmsnSttsNm', header: { text: '지자체진행상태' } },
|
||||
{ name: 'lclgvSbmsnSttsCd', fieldName: 'lclgvSbmsnSttsCd', header: { text: '지자체진행상태코드' }, visible: false },
|
||||
{ name: 'mctpvPicSbmsnSttsNm', fieldName: 'mctpvPicSbmsnSttsNm', header: { text: '진행상태' } },
|
||||
{ name: 'mctpvPicSbmsnSttsCd', fieldName: 'mctpvPicSbmsnSttsCd', header: { text: '진행상태코드' }, visible: false },
|
||||
],
|
||||
|
||||
columnLayout: [
|
||||
@@ -30,14 +30,14 @@ const StatsInputStatusInfoColumnRaw = {
|
||||
'sggNm',
|
||||
'tabNm',
|
||||
'reviewHistory',
|
||||
'chargerNm',
|
||||
'chargerCttpc',
|
||||
'submitStatusNm',
|
||||
'prvnStatusNm',
|
||||
'lclgvPicNm',
|
||||
'lclgvPicTelnoCn',
|
||||
'lclgvSbmsnSttsNm',
|
||||
'mctpvPicSbmsnSttsNm',
|
||||
'statsCd',
|
||||
'sewerBzmnCd',
|
||||
'submitStatusCd',
|
||||
'prvnStatusCd'
|
||||
'lclgvSbmsnSttsCd',
|
||||
'mctpvPicSbmsnSttsCd',
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
@@ -710,6 +710,10 @@ const rawSewagePipeTotList = [
|
||||
{ name: "sggNm", fieldName: "sggNm", header: { text: "시군구" }, editable: false },
|
||||
{ name: "admdstNm", fieldName: "admdstNm", header: { text: "행정구역명" }, editable: false },
|
||||
{ name: "emphsMngSeNm", fieldName: "emphsMngSeNm", header: { text: "집중강우\n중점관리\n구역구분" }, editable: false },
|
||||
{ name: "wholMnhlCntSum", fieldName: "wholMnhlCntSum", header: { text: "맨홀총계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
|
||||
{ name: "frlvlMnhlCntSum", fieldName: "frlvlMnhlCntSum", header: { text: "주철계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
|
||||
{ name: "thlvlMnhlCntSum", fieldName: "thlvlMnhlCntSum", header: { text: "콘크리트계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
|
||||
{ name: "picNm", fieldName: "picNm", header: { text: "담당자명" }, editable: false },
|
||||
{ name: "wholMnhlCnt", fieldName: "wholMnhlCnt", header: { text: "계" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
|
||||
{ name: "frlvlMnhlCnt", fieldName: "frlvlMnhlCnt", header: { text: "주철" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
|
||||
{ name: "sclvlMnhlCnt", fieldName: "sclvlMnhlCnt", header: { text: "주철(조화)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0", editable: false },
|
||||
@@ -720,6 +724,11 @@ const rawSewagePipeTotList = [
|
||||
columnLayout: [
|
||||
{ name: "addrGroup", header: { text: "행정구역" }, items: ["ctpvNm", "sggNm", "admdstNm"] },
|
||||
"emphsMngSeNm",
|
||||
{
|
||||
name: "adminRefGroup",
|
||||
header: { text: "행정참고자료" },
|
||||
items: ["wholMnhlCntSum", "frlvlMnhlCntSum", "thlvlMnhlCntSum", "picNm"],
|
||||
},
|
||||
{
|
||||
name: "mtrlGroup",
|
||||
header: { text: "맨홀뚜껑 재질(개)" },
|
||||
|
||||
+1
-2
@@ -16,7 +16,6 @@ export const HumanWasteSludgeTab4ColumnConfig = {
|
||||
{ name: "rcycQnt", fieldName: "rcycQnt", header: { text: "재활용" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
|
||||
{ name: "olandLfvlm", fieldName: "olandLfvlm", header: { text: "육상매립" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
|
||||
{ name: "incnrQnt", fieldName: "incnrQnt", header: { text: "소각" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
|
||||
{ name: "oceanInputQnt", fieldName: "oceanInputQnt", header: { text: "해양투기" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
|
||||
{ name: "fuelQnt", fieldName: "fuelQnt", header: { text: "연료화" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
|
||||
{ name: "etcQnt", fieldName: "etcQnt", header: { text: "기타" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
|
||||
{ name: "unprcsQnt", fieldName: "unprcsQnt", header: { text: "미처분량\n(이월량)(C)" }, valueType: ValueType.NUMBER, dataFormat: "#,##0.0", editable: false },
|
||||
@@ -29,7 +28,7 @@ export const HumanWasteSludgeTab4ColumnConfig = {
|
||||
{
|
||||
name: "dspsGroup",
|
||||
header: { text: "처분량" },
|
||||
items: ["wholDspsQnt", "rcycQnt", "olandLfvlm", "incnrQnt", "oceanInputQnt", "fuelQnt", "etcQnt"]
|
||||
items: ["wholDspsQnt", "rcycQnt", "olandLfvlm", "incnrQnt", "fuelQnt", "etcQnt"]
|
||||
},
|
||||
"unprcsQnt",
|
||||
"swtrmtFcltNm"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { GridView } from "realgrid";
|
||||
import { type GridView, ValueType } from "realgrid";
|
||||
|
||||
import type {
|
||||
ColumnConfig,
|
||||
@@ -124,6 +124,82 @@ export function getNonEditableColumnFieldNames(
|
||||
return fieldNames;
|
||||
}
|
||||
|
||||
type ExcelImportCell = {
|
||||
t?: string;
|
||||
v?: unknown;
|
||||
w?: string;
|
||||
};
|
||||
|
||||
/** 엑셀 셀 → 그리드 값. NUMBER 컬럼만 숫자화하고, 코드(01)는 문자열로 유지 */
|
||||
export function parseExcelImportCellValue(
|
||||
cell: ExcelImportCell | undefined,
|
||||
valueType?: ColumnConfig["valueType"],
|
||||
): string | number {
|
||||
if (!cell || cell.v === undefined || cell.v === null || cell.v === "") {
|
||||
return "";
|
||||
}
|
||||
|
||||
if (valueType === ValueType.NUMBER) {
|
||||
if (typeof cell.v === "number" && !Number.isNaN(cell.v)) {
|
||||
return cell.v;
|
||||
}
|
||||
const stringValue = String(cell.v);
|
||||
const numericValue = Number(stringValue.replace(/,/g, ""));
|
||||
if (!Number.isNaN(numericValue) && stringValue.trim() !== "") {
|
||||
return numericValue;
|
||||
}
|
||||
return stringValue;
|
||||
}
|
||||
|
||||
const formatted = typeof cell.w === "string" ? cell.w.trim() : "";
|
||||
if (/^0\d+$/.test(formatted)) {
|
||||
return formatted;
|
||||
}
|
||||
return String(cell.v);
|
||||
}
|
||||
|
||||
function collectZeroPaddedCodeWidths(
|
||||
rows: Record<string, string | number>[],
|
||||
): Map<string, number> {
|
||||
const widthByField = new Map<string, number>();
|
||||
for (const row of rows) {
|
||||
for (const [field, value] of Object.entries(row)) {
|
||||
const s = String(value ?? "").trim();
|
||||
if (!/^0\d+$/.test(s)) continue;
|
||||
widthByField.set(field, Math.max(widthByField.get(field) ?? 0, s.length));
|
||||
}
|
||||
}
|
||||
return widthByField;
|
||||
}
|
||||
|
||||
function restoreImportedCodeLeadingZeros(
|
||||
importedRow: Record<string, string | number>,
|
||||
existingRow: Record<string, string | number> | undefined,
|
||||
codeWidthByField: Map<string, number>,
|
||||
): Record<string, string | number> {
|
||||
const next: Record<string, string | number> = { ...importedRow };
|
||||
for (const [field, value] of Object.entries(next)) {
|
||||
if (value === "" || value == null) continue;
|
||||
if (typeof value === "number" && !Number.isInteger(value)) continue;
|
||||
const importedStr = String(value).trim();
|
||||
if (!/^\d+$/.test(importedStr)) continue;
|
||||
|
||||
const existingStr =
|
||||
existingRow != null ? String(existingRow[field] ?? "").trim() : "";
|
||||
let width = codeWidthByField.get(field);
|
||||
if (!width && /^0\d+$/.test(existingStr)) {
|
||||
width = existingStr.length;
|
||||
}
|
||||
if (!width && field.endsWith("Cd") && importedStr.length <= 2) {
|
||||
width = 2;
|
||||
}
|
||||
if (width && importedStr.length < width) {
|
||||
next[field] = importedStr.padStart(width, "0");
|
||||
}
|
||||
}
|
||||
return next;
|
||||
}
|
||||
|
||||
/** 엑셀 import 결과를 기존 행과 병합 — preserveFieldNames는 기존 그리드 값 유지 */
|
||||
export function mergeExcelImportWithExistingRows(
|
||||
existingRows: Record<string, string | number>[],
|
||||
@@ -134,14 +210,20 @@ export function mergeExcelImportWithExistingRows(
|
||||
options?.preserveFieldNames && options.preserveFieldNames.length > 0
|
||||
? new Set(options.preserveFieldNames)
|
||||
: null;
|
||||
const codeWidthByField = collectZeroPaddedCodeWidths(existingRows);
|
||||
|
||||
return importedRows.map((importedRow, index) => {
|
||||
const existingRow = existingRows[index];
|
||||
if (!existingRow) return { ...importedRow };
|
||||
const normalizedImported = restoreImportedCodeLeadingZeros(
|
||||
importedRow,
|
||||
existingRow,
|
||||
codeWidthByField,
|
||||
);
|
||||
if (!existingRow) return normalizedImported;
|
||||
|
||||
const merged: Record<string, string | number> = {
|
||||
...existingRow,
|
||||
...importedRow,
|
||||
...normalizedImported,
|
||||
};
|
||||
if (preserveSet) {
|
||||
for (const fieldName of preserveSet) {
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
import { statisticsApi } from "@/entities/statistics/api/statistics-service";
|
||||
import type {
|
||||
ImrRequest,
|
||||
ImrResponse,
|
||||
rollbackStatusRequest,
|
||||
} from "@/entities/statistics/model/statistics-interface";
|
||||
|
||||
/** 제출 직후 IMR 요청이 실패하면 검증 이전 상태로 롤백 */
|
||||
export async function callImrServiceWithRollbackOnFailure(
|
||||
imrParam: ImrRequest,
|
||||
rollbackParam: rollbackStatusRequest,
|
||||
): Promise<ImrResponse> {
|
||||
try {
|
||||
return await statisticsApi.callImrService(imrParam);
|
||||
} catch (error) {
|
||||
try {
|
||||
await statisticsApi.rollbackStatus(rollbackParam);
|
||||
} catch {
|
||||
// 롤백 실패는 IMR 실패를 가리지 않음
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
import type { Sgg } from "@/entities/statistics/model/statistics-interface";
|
||||
|
||||
/** 조회 시군구가 전체(ALL)면 시도의 전체 옵션, 특정 구면 해당 구만 */
|
||||
export function filterSggOptionsBySearchGugun(
|
||||
sggOptions: readonly Sgg[],
|
||||
gugun: string | null | undefined,
|
||||
): Sgg[] {
|
||||
const selected = gugun?.trim();
|
||||
if (!selected || selected === "ALL") {
|
||||
return [...sggOptions];
|
||||
}
|
||||
return sggOptions.filter((s) => s.gugun === selected);
|
||||
}
|
||||
@@ -1,6 +1,9 @@
|
||||
import type { StatisticsInputCommonInfoBase } from "@/entities/statistics/model/statistics-interface";
|
||||
|
||||
import type { VerificationResultLikeMap } from "./verification-result-display";
|
||||
import {
|
||||
normalizeVerificationResultMap,
|
||||
type VerificationResultLikeMap,
|
||||
} from "./verification-result-display";
|
||||
|
||||
export function isVerificationFailedFromCommonInfo(
|
||||
commonInfo: Pick<StatisticsInputCommonInfoBase, "isVerificationFailed"> | null | undefined,
|
||||
@@ -28,6 +31,9 @@ export function patchFooterVerificationByTab(
|
||||
| undefined,
|
||||
): Map<string, VerificationResultLikeMap | null> {
|
||||
const next = new Map(prev);
|
||||
next.set(tabKey, commonInfo?.verificationResult ?? null);
|
||||
next.set(
|
||||
tabKey,
|
||||
normalizeVerificationResultMap(commonInfo?.verificationResult) ?? null,
|
||||
);
|
||||
return next;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,49 @@ export type VerificationResultLikeMap = Record<
|
||||
VerificationResultLikeItem[]
|
||||
>;
|
||||
|
||||
/** 입력 조회 verificationResult의 기준값/입력값이 null이면 "-" */
|
||||
export function displayVerificationCn(
|
||||
value: string | null | undefined,
|
||||
): string {
|
||||
if (value == null || String(value).trim() === "") return "-";
|
||||
return String(value);
|
||||
}
|
||||
|
||||
export function normalizeVerificationResultItem<T extends VerificationResultLikeItem>(
|
||||
item: T,
|
||||
): T {
|
||||
return {
|
||||
...item,
|
||||
nowCn: displayVerificationCn(item.nowCn ?? item.nowVlCn),
|
||||
cmprCn: displayVerificationCn(item.cmprCn ?? item.compVlCn),
|
||||
};
|
||||
}
|
||||
|
||||
export function normalizeVerificationResultMap<T extends VerificationResultLikeMap>(
|
||||
result: T | null | undefined,
|
||||
): T | undefined {
|
||||
if (!result || typeof result !== "object") return undefined;
|
||||
const next = {} as T;
|
||||
for (const [key, items] of Object.entries(result)) {
|
||||
(next as VerificationResultLikeMap)[key] = Array.isArray(items)
|
||||
? items.map((item) => normalizeVerificationResultItem(item))
|
||||
: [];
|
||||
}
|
||||
return next;
|
||||
}
|
||||
|
||||
/** 조회 행/객체에 붙은 verificationResult의 cmprCn·nowCn null을 "-"로 바꿈 */
|
||||
export function withNormalizedVerificationResult<T extends object>(item: T): T {
|
||||
if (!("verificationResult" in item) || item.verificationResult == null) {
|
||||
return item;
|
||||
}
|
||||
const verificationResult = normalizeVerificationResultMap(
|
||||
item.verificationResult as VerificationResultLikeMap,
|
||||
);
|
||||
if (!verificationResult) return item;
|
||||
return { ...item, verificationResult };
|
||||
}
|
||||
|
||||
/** 검증 오류 배열 → RealGrid styleName */
|
||||
export function getVerificationStyleName(
|
||||
errors: VerificationResultLikeItem[] | null | undefined,
|
||||
@@ -37,8 +80,8 @@ export function formatVerificationTooltip(
|
||||
: e.vrfcCd === "NV"
|
||||
? "일반검증 - "
|
||||
: "모집단 검증 - ";
|
||||
const comp = e.cmprCn ?? e.compVlCn ?? "";
|
||||
const now = e.nowCn ?? e.nowVlCn ?? "";
|
||||
const comp = displayVerificationCn(e.cmprCn ?? e.compVlCn);
|
||||
const now = displayVerificationCn(e.nowCn ?? e.nowVlCn);
|
||||
return `${prefix}${e.rsnExpln}\n(검증 기준값: ${comp} / 현재 입력값: ${now})`;
|
||||
})
|
||||
.filter(Boolean)
|
||||
|
||||
@@ -56,10 +56,11 @@ export class GeneralverificationApiService implements GeneralverificationService
|
||||
}
|
||||
|
||||
public async UpdateVrfcMaster(
|
||||
vrfcSn: number,
|
||||
param: UpdateVrfcMasterRequest,
|
||||
): Promise<UpdateVrfcMasterResponse> {
|
||||
const response = await stClient.put<UpdateVrfcMasterResponse>(
|
||||
`${ENDPOINT.ST_SERVICE.INPUTVERIFY}/masters/${param.vrfcSn}`,
|
||||
`${ENDPOINT.ST_SERVICE.INPUTVERIFY}/masters/${vrfcSn}`,
|
||||
param,
|
||||
);
|
||||
return response.data;
|
||||
@@ -127,20 +128,22 @@ export class GeneralverificationApiService implements GeneralverificationService
|
||||
}
|
||||
|
||||
public async RegistVrfcDetail(
|
||||
vrfcSn: number,
|
||||
param: VerifyDetailRegistRequest,
|
||||
): Promise<RegistVrfcMasterResponse> {
|
||||
const response = await stClient.post<RegistVrfcMasterResponse>(
|
||||
`${ENDPOINT.ST_SERVICE.INPUTVERIFY}/${param.vrfcSn}/details`,
|
||||
`${ENDPOINT.ST_SERVICE.INPUTVERIFY}/${vrfcSn}/details`,
|
||||
param,
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
public async UpdateVrfcDetail(
|
||||
vrfcSn: number,
|
||||
param: VerifyDetailUpdateRequest,
|
||||
): Promise<RegistVrfcMasterResponse> {
|
||||
const response = await stClient.put<RegistVrfcMasterResponse>(
|
||||
`${ENDPOINT.ST_SERVICE.INPUTVERIFY}/${param.vrfcSn}/details`,
|
||||
`${ENDPOINT.ST_SERVICE.INPUTVERIFY}/${vrfcSn}/details`,
|
||||
param,
|
||||
);
|
||||
return response.data;
|
||||
|
||||
+14
@@ -22,6 +22,8 @@ import type {
|
||||
SewageSlurgeProcessingFacStatusSubmitRequest,
|
||||
SewageSlurgeProcessingFacStatusSubmitResponse,
|
||||
SlurgeProcessingFacStatusApiResponse,
|
||||
SlurgeProcessingFacStatusOperationDataUpdateRequest,
|
||||
SlurgeProcessingFacStatusOperationDataUpdateResponse,
|
||||
SlurgeProcessingFacStatusSaveRequest,
|
||||
SlurgeProcessingFacStatusSaveResponse,
|
||||
SlurgeProcessingFacStatusSubmitRequest,
|
||||
@@ -68,6 +70,18 @@ export class StatisticsInputSewageExcretaSlurgeApiService implements StatisticsI
|
||||
return response.data;
|
||||
}
|
||||
|
||||
/** 찌꺼기(슬러지)처리시설현황 운영 데이터 업데이트 — ST00110001 */
|
||||
public async updateSlurgeProcessingFacStatusOperationData(
|
||||
request: SlurgeProcessingFacStatusOperationDataUpdateRequest,
|
||||
): Promise<SlurgeProcessingFacStatusOperationDataUpdateResponse> {
|
||||
const response =
|
||||
await stClient.put<SlurgeProcessingFacStatusOperationDataUpdateResponse>(
|
||||
`${BASE}/slurge-processing-fac-status/operation-data/update`,
|
||||
request,
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
/** 소화조 운영현황 조회 — ST00110002 */
|
||||
public async getDigestorOperatingStatusList(
|
||||
params: SewageExcretaSlurgeRequestParams,
|
||||
|
||||
@@ -6,6 +6,8 @@ import type {
|
||||
ApproveRequest,
|
||||
RejectRequest,
|
||||
StatisticsApprovalService,
|
||||
VrfcSttsRejectRequest,
|
||||
VrfcSttsRejectResponse,
|
||||
} from "../model/statistics-approval-interface";
|
||||
|
||||
class StatisticsApprovalApiService implements StatisticsApprovalService {
|
||||
@@ -28,6 +30,14 @@ class StatisticsApprovalApiService implements StatisticsApprovalService {
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
public async VrfcSttsRejectStats(params: VrfcSttsRejectRequest[]): Promise<VrfcSttsRejectResponse> {
|
||||
const response = await client.post<VrfcSttsRejectResponse>(
|
||||
`${ENDPOINT.ST_SERVICE.APPROVAL}/reject?type=VRFC_STTS`,
|
||||
params,
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
}
|
||||
|
||||
export const statisticsApprovalApi = new StatisticsApprovalApiService();
|
||||
|
||||
@@ -16,6 +16,8 @@ import {
|
||||
type ImrStatusResponse,
|
||||
type ReviewerInfoRequest,
|
||||
type ReviewerInfoResponse,
|
||||
type rollbackStatusRequest,
|
||||
type rollbackStatusResponse,
|
||||
type ReviewInputSaveRequest,
|
||||
type ReviewOpinionSaveRequest,
|
||||
type ReviewOpinionSaveResponse,
|
||||
@@ -100,6 +102,17 @@ export class StatisticsApiService implements StatisticsService {
|
||||
return response.data;
|
||||
}
|
||||
|
||||
public async getSggAllHeadList(
|
||||
sidoName: string,
|
||||
params?: { instSeCd?: string; gugunSkipYn?: "Y" | "N" },
|
||||
): Promise<ApiResponse<Sgg[]>> {
|
||||
const response = await stClient.get<ApiResponse<Sgg[]>>(
|
||||
`${ENDPOINT.ST_SERVICE.COMMON}/sgg-all-head`,
|
||||
{ params: { sidoName, ...params } },
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
/** 통계 입력 기간(연도·분류별) 목록 조회 — 경로는 백엔드 스펙에 맞게 수정 */
|
||||
public async getStatsInputPeriodList(
|
||||
params?: StatsInputPeriodListRequest,
|
||||
@@ -156,6 +169,17 @@ export class StatisticsApiService implements StatisticsService {
|
||||
return response.data;
|
||||
}
|
||||
|
||||
// 입력 - 검증 이전 상태로 롤백
|
||||
public async rollbackStatus(
|
||||
param: rollbackStatusRequest,
|
||||
): Promise<rollbackStatusResponse> {
|
||||
const response = await stClient.put<rollbackStatusResponse>(
|
||||
`${ENDPOINT.ST_SERVICE.INPUTCOMMON}/rollback-status`,
|
||||
param,
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
public async callImrService(param: ImrRequest): Promise<ImrResponse> {
|
||||
const response = await client.post<ImrResponse>(
|
||||
`${ENDPOINT.STATVERIFY_SERVICE.IMR}`,
|
||||
|
||||
@@ -10,6 +10,18 @@ export { dashboardApi } from "./api/dashboard/dashboard-service";
|
||||
export { useScheduleInfo } from "./api/dashboard/schedule-info-queries";
|
||||
export { scheduleInfoApi } from "./api/dashboard/schedule-info-service";
|
||||
export { imrApi } from "./api/imr-api";
|
||||
export {
|
||||
JEONNAM_GWANGJU_HEADQUARTERS_ADMDST_NM,
|
||||
JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE,
|
||||
JEONNAM_GWANGJU_SGG_NOT_APPLICABLE_SEWER_BZMN_CD_SET,
|
||||
JEONNAM_GWANGJU_UNIFIED_SIDO_CD,
|
||||
isJeonnamGwangjuHeadquartersOperableRow,
|
||||
isJeonnamGwangjuSggNotApplicableSearch,
|
||||
isJeonnamGwangjuSidoAllSearch,
|
||||
isJeonnamGwangjuSidoAllToolbarException,
|
||||
isSewerageFinanceStatsCd,
|
||||
shouldRestrictFinanceVerificationToHeadquarters,
|
||||
} from "./lib/jeonnam-gwangju-sido-all-toolbar";
|
||||
export {
|
||||
filterBySelectedAdmdstCd,
|
||||
findSidoBySearch,
|
||||
@@ -141,6 +153,7 @@ export {
|
||||
type ApprovalResponse,
|
||||
type ApproveRequest,
|
||||
type RejectRequest,
|
||||
type VrfcSttsRejectRequest,
|
||||
} from "./model/statistics-approval-interface";
|
||||
export {
|
||||
type SearchCondition,
|
||||
|
||||
@@ -0,0 +1,114 @@
|
||||
import { findSidoBySearch, type SidoGugunLookup } from "./sido-gugun";
|
||||
|
||||
import type { Sido } from "../model/statistics-interface";
|
||||
|
||||
/** 전남광주통합특별시 — 도 목록에 있어 시군구 전체 조회 시 버튼이 숨겨짐 */
|
||||
export const JEONNAM_GWANGJU_UNIFIED_SIDO_CD = "1200000000";
|
||||
|
||||
export const JEONNAM_GWANGJU_HEADQUARTERS_ADMDST_NM = "본청";
|
||||
|
||||
/** 12-1·12-2 — 본청만 남아도 해당사항 없음 조건을 적용하는 전남광주 시군구 */
|
||||
export const JEONNAM_GWANGJU_SGG_NOT_APPLICABLE_SEWER_BZMN_CD_SET = new Set([
|
||||
"1221000000",
|
||||
"1224000000",
|
||||
"1227000000",
|
||||
"1230000000",
|
||||
"1233000000",
|
||||
]);
|
||||
|
||||
export function isJeonnamGwangjuSggNotApplicableSearch(
|
||||
values: SidoGugunLookup | null | undefined,
|
||||
): boolean {
|
||||
return JEONNAM_GWANGJU_SGG_NOT_APPLICABLE_SEWER_BZMN_CD_SET.has(
|
||||
(values?.bsnmCd ?? "").trim(),
|
||||
);
|
||||
}
|
||||
|
||||
/** 입력 9-1 ~ 9-4 */
|
||||
export const SEWERAGE_FINANCE_STATS_CD_SET = new Set([
|
||||
"ST00090001",
|
||||
"ST00090002",
|
||||
"ST00090003",
|
||||
"ST00090004",
|
||||
]);
|
||||
|
||||
/** 입력 12-1, 12-2 */
|
||||
export const SEWAGE_EXCRETA_RELATED_PUBLIC_STATS_CD_SET = new Set([
|
||||
"ST00120001",
|
||||
"ST00120002",
|
||||
]);
|
||||
|
||||
export const SIDO_ALL_TOOLBAR_USER_IDS = new Set(["CLEANWATER", "S3291"]);
|
||||
|
||||
function isEmptyOrAllGugun(values: SidoGugunLookup | null | undefined): boolean {
|
||||
const gugun = values?.gugun?.trim() ?? "";
|
||||
return !gugun || gugun === "ALL";
|
||||
}
|
||||
|
||||
function isJeonnamGwangjuUnifiedSido(
|
||||
sidoList: readonly Sido[] | undefined,
|
||||
values: SidoGugunLookup | null | undefined,
|
||||
): boolean {
|
||||
if (!values) return false;
|
||||
const sido = findSidoBySearch(sidoList, values);
|
||||
const cd = (sido?.bsnmCd ?? values.bsnmCd ?? "").trim();
|
||||
if (cd === JEONNAM_GWANGJU_UNIFIED_SIDO_CD) return true;
|
||||
return (values.sido ?? "").trim() === "전남광주통합특별시";
|
||||
}
|
||||
|
||||
export const JEONNAM_GWANGJU_SIDO_ALL_SAVE_SUBMIT_MESSAGE =
|
||||
"전남광주통합특별시는 시군구를 선택하지 않고 저장 및 제출 시 본청 데이터만 반영됩니다.\n각 시군구의 데이터는 선택 후 새로 조회하여 작성해주세요.";
|
||||
|
||||
export function isJeonnamGwangjuSidoAllSearch(
|
||||
sidoList: readonly Sido[] | undefined,
|
||||
values: SidoGugunLookup | null | undefined,
|
||||
): boolean {
|
||||
return isJeonnamGwangjuUnifiedSido(sidoList, values) && isEmptyOrAllGugun(values);
|
||||
}
|
||||
|
||||
export function isJeonnamGwangjuSidoAllToolbarException(
|
||||
sidoList: readonly Sido[] | undefined,
|
||||
values: SidoGugunLookup | null | undefined,
|
||||
userId: string | null | undefined,
|
||||
): boolean {
|
||||
if (!SIDO_ALL_TOOLBAR_USER_IDS.has((userId ?? "").trim().toUpperCase())) {
|
||||
return false;
|
||||
}
|
||||
return isJeonnamGwangjuSidoAllSearch(sidoList, values);
|
||||
}
|
||||
|
||||
export function isSewerageFinanceStatsCd(statsCd: string | null | undefined): boolean {
|
||||
return SEWERAGE_FINANCE_STATS_CD_SET.has((statsCd ?? "").trim());
|
||||
}
|
||||
|
||||
export function isSewageExcretaRelatedPublicStatsCd(
|
||||
statsCd: string | null | undefined,
|
||||
): boolean {
|
||||
return SEWAGE_EXCRETA_RELATED_PUBLIC_STATS_CD_SET.has((statsCd ?? "").trim());
|
||||
}
|
||||
|
||||
/** 9-1~4·12-1·12-2 + 전남광주(1200000000) 시군구 전체 조회 시, 검증 결과에서 본청만 조작 */
|
||||
export function shouldRestrictFinanceVerificationToHeadquarters(
|
||||
statsCd: string | null | undefined,
|
||||
sewerBzmnCd: string | null | undefined,
|
||||
sggNm?: string | null,
|
||||
): boolean {
|
||||
const sgg = String(sggNm ?? "").trim();
|
||||
const isAllSgg = !sgg || sgg === "ALL";
|
||||
return (
|
||||
(isSewerageFinanceStatsCd(statsCd) ||
|
||||
isSewageExcretaRelatedPublicStatsCd(statsCd)) &&
|
||||
String(sewerBzmnCd ?? "").trim() === JEONNAM_GWANGJU_UNIFIED_SIDO_CD &&
|
||||
isAllSgg
|
||||
);
|
||||
}
|
||||
|
||||
export function isJeonnamGwangjuHeadquartersOperableRow(row: {
|
||||
sewerBzmnCd?: string | number | null;
|
||||
admdstNm?: string | number | null;
|
||||
}): boolean {
|
||||
return (
|
||||
String(row.sewerBzmnCd ?? "").trim() === JEONNAM_GWANGJU_UNIFIED_SIDO_CD &&
|
||||
String(row.admdstNm ?? "").trim() === JEONNAM_GWANGJU_HEADQUARTERS_ADMDST_NM
|
||||
);
|
||||
}
|
||||
@@ -27,7 +27,7 @@ export interface VrfcReportSelect {
|
||||
statsNm: string;
|
||||
rsnExpln: string;
|
||||
admdstNm: string;
|
||||
nowCN: string;
|
||||
nowCn: string;
|
||||
cmprCn: string | null;
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,6 @@ export interface CheckVerificationNameResponse {
|
||||
}
|
||||
|
||||
export interface UpdateVrfcMasterRequest {
|
||||
vrfcSn?: number | null;
|
||||
vrfcNm?: string | null;
|
||||
vrfcClsfCd?: string | null;
|
||||
dcptDgt?: number | null;
|
||||
@@ -184,13 +183,11 @@ export interface VerifyDetailRegistData {
|
||||
}
|
||||
|
||||
export interface VerifyDetailRegistRequest {
|
||||
vrfcSn: number | null;
|
||||
detailList: VerifyDetailRegistData[];
|
||||
rgtrUuid: string;
|
||||
}
|
||||
|
||||
export interface VerifyDetailUpdateRequest {
|
||||
vrfcSn: number | null;
|
||||
detailList: VerifyDetailRegistData[];
|
||||
mdfrUuid: string;
|
||||
}
|
||||
@@ -297,6 +294,7 @@ export interface GeneralverificationService {
|
||||
param: CheckVerificationNameRequest,
|
||||
): Promise<CheckVerificationNameResponse>;
|
||||
UpdateVrfcMaster(
|
||||
vrfcSn: number,
|
||||
param: UpdateVrfcMasterRequest,
|
||||
): Promise<UpdateVrfcMasterResponse>;
|
||||
RegistVrfcMaster(
|
||||
@@ -315,9 +313,11 @@ export interface GeneralverificationService {
|
||||
param: string,
|
||||
): Promise<VerifyColumnListResponse>;
|
||||
RegistVrfcDetail(
|
||||
vrfcSn: number,
|
||||
param: VerifyDetailRegistRequest,
|
||||
): Promise<RegistVrfcMasterResponse>;
|
||||
UpdateVrfcDetail(
|
||||
vrfcSn: number,
|
||||
param: VerifyDetailUpdateRequest,
|
||||
): Promise<RegistVrfcMasterResponse>;
|
||||
CopyVrfcData(
|
||||
|
||||
+21
-1
@@ -205,6 +205,23 @@ export interface SlurgeProcessingFacStatusSubmitResponse {
|
||||
};
|
||||
}
|
||||
|
||||
/** ST00110001 운영 데이터 업데이트 요청 */
|
||||
export interface SlurgeProcessingFacStatusOperationDataUpdateRequest {
|
||||
statsYr: string;
|
||||
ctpvNm: string;
|
||||
/** 도에서만 사용, 특·광역시는 빈 값 */
|
||||
sggNm?: string;
|
||||
sewerBzmnCd: string;
|
||||
userUuid: string;
|
||||
}
|
||||
|
||||
/** ST00110001 운영 데이터 업데이트 응답 */
|
||||
export interface SlurgeProcessingFacStatusOperationDataUpdateResponse {
|
||||
status: string;
|
||||
message?: string;
|
||||
data?: unknown | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* ST00110002 조회 `data.digestorOperatingStatusList[]` 한 행.
|
||||
* `DigestorOperatingStatusInpColumn` fieldName과 동일 (`ctpvNm` 그리드 값은 `commonInfo.ctpvNm` 시도명).
|
||||
@@ -437,7 +454,6 @@ export interface ExcretaSlurgeProcessingStatusItem {
|
||||
rcycQnt: number;
|
||||
olandLfvlm: number;
|
||||
incnrQnt: number;
|
||||
oceanInputQnt: number;
|
||||
fuelQnt: number;
|
||||
etcQnt: number;
|
||||
unprcsQnt: number;
|
||||
@@ -562,6 +578,10 @@ export interface StatisticsInputSewageExcretaSlurgeService {
|
||||
submitSlurgeProcessingFacStatus(
|
||||
request: SlurgeProcessingFacStatusSubmitRequest,
|
||||
): Promise<SlurgeProcessingFacStatusSubmitResponse>;
|
||||
/** 찌꺼기(슬러지)처리시설현황 운영 데이터 업데이트 — ST00110001 */
|
||||
updateSlurgeProcessingFacStatusOperationData(
|
||||
request: SlurgeProcessingFacStatusOperationDataUpdateRequest,
|
||||
): Promise<SlurgeProcessingFacStatusOperationDataUpdateResponse>;
|
||||
/** 소화조 운영현황 조회 — ST00110002 */
|
||||
getDigestorOperatingStatusList(
|
||||
params: SewageExcretaSlurgeRequestParams,
|
||||
|
||||
@@ -81,7 +81,6 @@ export interface ReportStatusResponseDto {
|
||||
lastCfmtnPicTelnoCn?: string | null;
|
||||
lastCfmtnPicDeptNm?: string | null;
|
||||
lastCfmtnPicJbgdNm?: string | null;
|
||||
splmntRsltCn?: string | null;
|
||||
splmntOpnnCn?: string | null;
|
||||
rjctOpnnCn?: string | null;
|
||||
}
|
||||
|
||||
-1
@@ -211,7 +211,6 @@ export interface PublicSewageFacilitySaveItem {
|
||||
swtrmtFcltCd: string | null;
|
||||
swtrmtFcltNm: string | null;
|
||||
fcltSn: string | null;
|
||||
fcltPstnCn: string | null;
|
||||
|
||||
inflwSwagePhysQnt: number;
|
||||
inflwSwageBoilQnt: number;
|
||||
|
||||
+4
-1
@@ -308,7 +308,6 @@ export interface SeweragePipeInputPipeTypeStatusSaveItem {
|
||||
rmrk: string | null;
|
||||
lyngPrlgWhol: number;
|
||||
dmltnPrlgWhol: number;
|
||||
pipeByPrstWhol: number;
|
||||
}
|
||||
|
||||
/** 관종별 현황 저장 API 요청 */
|
||||
@@ -420,6 +419,10 @@ export interface SeweragePipeInputManholeStatusItem {
|
||||
folvlMnhlCnt: number;
|
||||
filvlMnhlCnt: number;
|
||||
rmrk: string;
|
||||
wholMnhlCntSum: number;
|
||||
frlvlMnhlCntSum: number;
|
||||
thlvlMnhlCntSum: number;
|
||||
picNm: string | null;
|
||||
verificationResult?: SeweragePipeInputVerificationResult;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,23 @@ export interface ApprovalResponse {
|
||||
exceptionCnt: number;
|
||||
}
|
||||
|
||||
|
||||
export interface VrfcSttsRejectRequest {
|
||||
statsYr: string;
|
||||
sewerBzmnCd: string;
|
||||
statsCd: string;
|
||||
rjctOpnnCn: string;
|
||||
mdfrUuid: string;
|
||||
}
|
||||
|
||||
export interface VrfcSttsRejectResponse {
|
||||
message: string;
|
||||
resultCode: string;
|
||||
updatedStts: string;
|
||||
}
|
||||
|
||||
export interface StatisticsApprovalService {
|
||||
approveStats(params: ApproveRequest[]): Promise<ApprovalResponse>;
|
||||
rejectStats(params: RejectRequest[]): Promise<ApprovalResponse>;
|
||||
VrfcSttsRejectStats(params: VrfcSttsRejectRequest[]): Promise<VrfcSttsRejectResponse>;
|
||||
}
|
||||
|
||||
@@ -9,12 +9,12 @@ export interface StatsInputStatusReviewItem {
|
||||
sewerBzmnCd?: string;
|
||||
tabNm?: string;
|
||||
statsCd?: string;
|
||||
submitStatusNm?: string;
|
||||
prvnStatusNm?: string;
|
||||
chargerNm?: string;
|
||||
chargerCttpc?: string;
|
||||
submitStatusCd?: string;
|
||||
prvnStatusCd?: string;
|
||||
lclgvPicNm?: string;
|
||||
lclgvPicTelnoCn?: string;
|
||||
lclgvSbmsnSttsCd?: string;
|
||||
lclgvSbmsnSttsNm?: string;
|
||||
mctpvPicSbmsnSttsCd?: string;
|
||||
mctpvPicSbmsnSttsNm?: string;
|
||||
}
|
||||
|
||||
export interface StatsInputStatusReviewResponseData {
|
||||
@@ -37,7 +37,7 @@ export interface ReviewHistoryResponse {
|
||||
status: string;
|
||||
message?: string;
|
||||
data: {
|
||||
logDt: string;
|
||||
regDt: string;
|
||||
historyContent: string;
|
||||
}[]
|
||||
}
|
||||
|
||||
@@ -31,6 +31,21 @@ export interface cancelSubmitResponse {
|
||||
message?: string;
|
||||
}
|
||||
|
||||
/** 검증 이전 상태로 롤백 요청 */
|
||||
export interface rollbackStatusRequest {
|
||||
statsYr: string;
|
||||
statsCd: string;
|
||||
sewerBzmnCd: string;
|
||||
rollbackStatusCode: string;
|
||||
mdfrUuid: string;
|
||||
}
|
||||
|
||||
/** 검증 이전 상태로 롤백 응답 */
|
||||
export interface rollbackStatusResponse {
|
||||
status: string;
|
||||
message?: string;
|
||||
}
|
||||
|
||||
export interface ApiResponse<T> {
|
||||
status: string;
|
||||
data?: T;
|
||||
@@ -327,7 +342,6 @@ export interface ReviewOpinionDetailItem {
|
||||
sewerBzmnCd: string;
|
||||
statsCd: string;
|
||||
splmntOpnnCn: string | null;
|
||||
splmntRsltCn: string | null;
|
||||
mdfrUuid: string | null;
|
||||
}
|
||||
|
||||
@@ -343,7 +357,6 @@ export interface ReviewOpinionSaveRequest {
|
||||
sewerBzmnCd: string;
|
||||
statsCd: string;
|
||||
splmntOpnnCn: string;
|
||||
splmntRsltCn: string;
|
||||
mdfrUuid: string;
|
||||
}
|
||||
|
||||
@@ -388,7 +401,6 @@ export interface ReviewSubmitRequest {
|
||||
/** 통계항목 단위 제출 시 사용 (통계 입력 현황 일괄 제출에는 미사용) */
|
||||
statsCd?: string;
|
||||
splmntOpnnCn?: string;
|
||||
splmntRsltCn?: string;
|
||||
}
|
||||
|
||||
export interface ReviewSubmitResponse {
|
||||
@@ -454,7 +466,6 @@ export interface ReviewerInfoResponse {
|
||||
dpmNm: string;
|
||||
cps: string;
|
||||
splmntOpnnCn: string;
|
||||
splmntRsltCn: string;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -478,9 +489,8 @@ export interface StatiscicsManagementReviewHistoryItem {
|
||||
ctpvNm: string;
|
||||
sggNm: string;
|
||||
menuNm: string;
|
||||
wrterOpinionSm: string | null;
|
||||
chckerOpinionSm: string | null;
|
||||
returnOpinionSm: string | null;
|
||||
splmntOpnnCn: string | null;
|
||||
rjctOpnnCn: string | null;
|
||||
}
|
||||
|
||||
export interface StatiscicsManagementReviewHistoryResponse {
|
||||
@@ -552,11 +562,13 @@ export interface StatisticsService {
|
||||
getSidoListInput(params?: { instSeCd?: string }): Promise<ApiResponse<SearchCondition>>;
|
||||
getSggList(sidoName: string, params?: { instSeCd?: string; gugunSkipYn?: "Y" | "N" }): Promise<ApiResponse<Sgg[]>>;
|
||||
getSggAllList(sidoName: string, params?: { instSeCd?: string; gugunSkipYn?: "Y" | "N" }): Promise<ApiResponse<Sgg[]>>;
|
||||
getSggAllHeadList(sidoName: string, params?: { instSeCd?: string; gugunSkipYn?: "Y" | "N" }): Promise<ApiResponse<Sgg[]>>;
|
||||
getStatsInputPeriodList(params?: StatsInputPeriodListRequest): Promise<StatsInputPeriodListApiResponse>;
|
||||
getStatsInputPeriodDetail(param: StatsInputPeriodDetailRequest): Promise<StatsInputPeriodDetailResponse>;
|
||||
saveStatsInputPeriod(param: StatsInputPeriodSaveRequest): Promise<StatsInputPeriodSaveApiResponse>;
|
||||
deleteStatsInputPeriod(param: StatsInputPeriodDeleteRequest): Promise<StatsInputPeriodDeleteApiResponse>;
|
||||
cancelSubmit(param: cancelSubmitRequest): Promise<cancelSubmitResponse>;
|
||||
rollbackStatus(param: rollbackStatusRequest): Promise<rollbackStatusResponse>;
|
||||
callImrService(param: ImrRequest): Promise<ImrResponse>;
|
||||
submitException(param: SubmitExceptionRequest): Promise<SubmitExceptionResponse>;
|
||||
getLogList(param: StatisticsLogRequest): Promise<StatisticsLogResponse>;
|
||||
|
||||
-2
@@ -127,7 +127,6 @@ export interface HumanWasteSludgeReviewItem {
|
||||
rcycQnt: number | null;
|
||||
olandLfvlm: number | null;
|
||||
incnrQnt: number | null;
|
||||
oceanInputQnt: number | null;
|
||||
fuelQnt: number | null;
|
||||
etcQnt: number | null;
|
||||
unprcsQnt: number | null;
|
||||
@@ -218,7 +217,6 @@ export function mapSewageExcretaSlurgeReviewRows(list: unknown[]): object[] {
|
||||
rcycQnt: row.rcycQnt ?? 0,
|
||||
olandLfvlm: row.olandLfvlm ?? 0,
|
||||
incnrQnt: row.incnrQnt ?? 0,
|
||||
oceanInputQnt: row.oceanInputQnt ?? 0,
|
||||
fuelQnt: row.fuelQnt ?? 0,
|
||||
etcQnt: row.etcQnt ?? 0,
|
||||
unprcsQnt: row.unprcsQnt ?? 0,
|
||||
|
||||
@@ -108,5 +108,4 @@ export interface StatsStatusInfo {
|
||||
mctpvPicSbmsnSttsCd?: string;
|
||||
rjctOpnnCn?: string;
|
||||
splmntOpnnCn?: string;
|
||||
splmntRsltCn?: string;
|
||||
}
|
||||
@@ -247,6 +247,10 @@ export interface SewagePipeReviewManholeItem {
|
||||
folvlMnhlCnt: number;
|
||||
filvlMnhlCnt: number;
|
||||
rmrk: string | null;
|
||||
wholMnhlCntSum: number;
|
||||
frlvlMnhlCntSum: number;
|
||||
thlvlMnhlCntSum: number;
|
||||
picNm: string | null;
|
||||
}
|
||||
|
||||
export interface SewagePipeManholeResponseData {
|
||||
@@ -266,5 +270,4 @@ export interface StatsStatusInfo {
|
||||
mctpvPicSbmsnSttsCd?: string;
|
||||
rjctOpnnCn?: string;
|
||||
splmntOpnnCn?: string;
|
||||
splmntRsltCn?: string;
|
||||
}
|
||||
-1
@@ -59,7 +59,6 @@ export interface statsStatusInfo {
|
||||
mctpvPicSbmsnSttsCd?: string;
|
||||
rjctOpnnCn?: string;
|
||||
splmntOpnnCn?: string;
|
||||
splmntRsltCn?: string;
|
||||
}
|
||||
|
||||
export interface SewerageSupplyRateReviewResponseData {
|
||||
|
||||
+4
@@ -168,6 +168,10 @@ export interface FcltyManholeSummaryItem {
|
||||
thlvlMnhlCnt: number;
|
||||
folvlMnhlCnt: number;
|
||||
filvlMnhlCnt: number;
|
||||
wholMnhlCntSum: number;
|
||||
frlvlMnhlCntSum: number;
|
||||
thlvlMnhlCntSum: number;
|
||||
picNm: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
-1
@@ -135,7 +135,6 @@ export interface HumanWasteSludgeStatusTotalItem {
|
||||
rcycQnt: number;
|
||||
olandLfvlm: number;
|
||||
incnrQnt: number;
|
||||
oceanInputQnt: number;
|
||||
fuelQnt: number;
|
||||
etcQnt: number;
|
||||
unprcsQnt: number;
|
||||
|
||||
@@ -19,14 +19,14 @@ interface StatsSubmissionPanelProps {
|
||||
const STATUS_LEVEL_TEXT_COLOR = {
|
||||
GREAT: "text-blue-500",
|
||||
GOOD: "text-green-500",
|
||||
WARNING: "text-yellow-500",
|
||||
NORMAL: "text-yellow-500",
|
||||
BAD: "text-red-500",
|
||||
};
|
||||
|
||||
const STATUS_LEVEL_EMOJI = {
|
||||
GREAT: <Laugh size={160} className={STATUS_LEVEL_TEXT_COLOR.GREAT} />,
|
||||
GOOD: <Smile size={160} className={STATUS_LEVEL_TEXT_COLOR.GOOD} />,
|
||||
WARNING: <Meh size={160} className={STATUS_LEVEL_TEXT_COLOR.WARNING} />,
|
||||
NORMAL: <Meh size={160} className={STATUS_LEVEL_TEXT_COLOR.NORMAL} />,
|
||||
BAD: <Frown size={160} className={STATUS_LEVEL_TEXT_COLOR.BAD} />,
|
||||
};
|
||||
|
||||
|
||||
@@ -113,8 +113,8 @@ export function VrfcReportPanel({ params }: VrfcReportPanelProps) {
|
||||
<div className="flex justify-between text-lg text-muted-foreground">
|
||||
<span>{item.admdstNm}</span>
|
||||
<span>
|
||||
{/* TBD: 증감 표시 방법 (nowCN - cmprCn 계산?) */}
|
||||
현재: {item.nowCN ?? "-"}{" "}
|
||||
{/* TBD: 증감 표시 방법 (nowCn - cmprCn 계산?) */}
|
||||
현재:{" "}{item.nowCn ?? "-"}
|
||||
/ 비교:{" "}
|
||||
{item.cmprCn ?? "-"}
|
||||
</span>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
export const STATISTICS_ROUTE = "/statistics";
|
||||
export const STATISTICS_TAB_QUERY_KEY = "tab";
|
||||
/** 기본 화면(대시보드) 도움말 매칭용. URL에는 넣지 않음 */
|
||||
export const STATISTICS_DASHBOARD_TAB_ID = "Dashboard";
|
||||
|
||||
export function buildStatisticsTabUrl(tabId: string): string {
|
||||
return `${STATISTICS_ROUTE}?${STATISTICS_TAB_QUERY_KEY}=${encodeURIComponent(tabId)}`;
|
||||
|
||||
@@ -47,7 +47,7 @@ export function useSearchConditionSidoList(options?: { isInput?: boolean }): {
|
||||
sidoList: Sido[];
|
||||
isReady: boolean;
|
||||
} {
|
||||
const instSeCd = useUserStore((state) => state.userInfo?.instSeCd ?? "");
|
||||
const instSeCd = useUserStore((state) => state.userInfo?.laeSeCd ?? "");
|
||||
const kind: SearchConditionKind = options?.isInput ? "input" : "default";
|
||||
const { data } = useSWR(
|
||||
SEARCH_CONDITION_SWR_KEY(instSeCd, kind),
|
||||
|
||||
@@ -1,13 +1,20 @@
|
||||
import { PageTitle } from "@common/components";
|
||||
|
||||
import { findMenuItemByUrlPath } from "@/shared/lib/stats-cd-input-navigation";
|
||||
import { STATISTICS_DASHBOARD_TAB_ID } from "@/shared/lib/statistics-tab-url";
|
||||
|
||||
import { TabBar } from "./tab-bar";
|
||||
|
||||
import { useTabStore } from "@/store/tab-store";
|
||||
|
||||
function StatisticsPageLayout({ children }: { children: React.ReactNode }) {
|
||||
const { activeTabId, tabs } = useTabStore();
|
||||
const { activeTabId, tabs, menuList } = useTabStore();
|
||||
|
||||
const pageTitle = tabs.find((t) => t.id === activeTabId);
|
||||
const dashboardMenu =
|
||||
!pageTitle && menuList
|
||||
? findMenuItemByUrlPath(menuList, STATISTICS_DASHBOARD_TAB_ID)
|
||||
: null;
|
||||
|
||||
const menuPaths = pageTitle?.path?.split(">").map((path) => path.trim());
|
||||
|
||||
@@ -16,7 +23,7 @@ function StatisticsPageLayout({ children }: { children: React.ReactNode }) {
|
||||
<TabBar />
|
||||
<PageTitle
|
||||
title={pageTitle?.label ?? ""}
|
||||
menuCd={pageTitle?.menuItem?.menuCd}
|
||||
menuCd={pageTitle?.menuItem?.menuCd ?? dashboardMenu?.menuCd}
|
||||
menuPaths={menuPaths ?? []}
|
||||
/>
|
||||
{children}
|
||||
|
||||
@@ -73,7 +73,10 @@ function Calendar({
|
||||
"has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",
|
||||
defaultClassNames.dropdown_root,
|
||||
),
|
||||
dropdown: cn("absolute inset-0 opacity-0", defaultClassNames.dropdown),
|
||||
dropdown: cn(
|
||||
"absolute inset-0 opacity-0 [&_option]:bg-background [&_option]:text-foreground",
|
||||
defaultClassNames.dropdown,
|
||||
),
|
||||
caption_label: cn(
|
||||
"select-none font-medium",
|
||||
captionLayout === "label"
|
||||
|
||||
Reference in New Issue
Block a user