Compare commits
3
Commits
deploy
...
iipbs/st/dev
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
411e490b5d | ||
|
|
b5f5938e51 | ||
|
|
038b2d441e |
@@ -33,6 +33,7 @@ import {
|
||||
hasAdmdstCdColumn,
|
||||
isExcelImportAdmdstCdInvalid,
|
||||
mergeExcelImportWithExistingRows,
|
||||
parseExcelImportCellValue,
|
||||
prepareGridColumnsForExcelExport,
|
||||
releaseFixedOptionsForExcelExport,
|
||||
resolveColumnStyleName,
|
||||
@@ -1346,6 +1347,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>[] = [];
|
||||
@@ -1367,36 +1373,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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -620,7 +620,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),
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
@@ -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(() => {
|
||||
@@ -116,7 +115,6 @@ const ExcretaTreatmentFacilityRvw = () => {
|
||||
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;
|
||||
@@ -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(() => {
|
||||
@@ -100,7 +99,6 @@ const PublicSewageFacilityRvw = () => {
|
||||
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(() => {
|
||||
@@ -111,7 +110,6 @@ const PumpingStationRvw = () => {
|
||||
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;
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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,7 +181,6 @@ const SewagePipeRvw = () => {
|
||||
};
|
||||
}, [activeStatsStatusInfo.statsCd, lastSearchValues]);
|
||||
const latestReviewOpinion = activeStatsStatusInfo.splmntOpnnCn ?? "";
|
||||
const latestProcessHistory = activeStatsStatusInfo.splmntRsltCn ?? "";
|
||||
const submitDialogContext = useMemo<ReviewerInfoRequest | null>(() => {
|
||||
if (lastSearchValues == null) return null;
|
||||
|
||||
@@ -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;
|
||||
@@ -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;
|
||||
@@ -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(() => {
|
||||
@@ -100,7 +99,6 @@ const SeweragePenetrationRateRvw = () => {
|
||||
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;
|
||||
@@ -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],
|
||||
);
|
||||
|
||||
@@ -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;
|
||||
@@ -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
|
||||
|
||||
-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'
|
||||
]
|
||||
|
||||
+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",
|
||||
],
|
||||
|
||||
@@ -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',
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
+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) {
|
||||
|
||||
-1
@@ -437,7 +437,6 @@ export interface ExcretaSlurgeProcessingStatusItem {
|
||||
rcycQnt: number;
|
||||
olandLfvlm: number;
|
||||
incnrQnt: number;
|
||||
oceanInputQnt: number;
|
||||
fuelQnt: number;
|
||||
etcQnt: number;
|
||||
unprcsQnt: number;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}[]
|
||||
}
|
||||
|
||||
@@ -342,7 +342,6 @@ export interface ReviewOpinionDetailItem {
|
||||
sewerBzmnCd: string;
|
||||
statsCd: string;
|
||||
splmntOpnnCn: string | null;
|
||||
splmntRsltCn: string | null;
|
||||
mdfrUuid: string | null;
|
||||
}
|
||||
|
||||
@@ -358,7 +357,6 @@ export interface ReviewOpinionSaveRequest {
|
||||
sewerBzmnCd: string;
|
||||
statsCd: string;
|
||||
splmntOpnnCn: string;
|
||||
splmntRsltCn: string;
|
||||
mdfrUuid: string;
|
||||
}
|
||||
|
||||
@@ -403,7 +401,6 @@ export interface ReviewSubmitRequest {
|
||||
/** 통계항목 단위 제출 시 사용 (통계 입력 현황 일괄 제출에는 미사용) */
|
||||
statsCd?: string;
|
||||
splmntOpnnCn?: string;
|
||||
splmntRsltCn?: string;
|
||||
}
|
||||
|
||||
export interface ReviewSubmitResponse {
|
||||
@@ -469,7 +466,6 @@ export interface ReviewerInfoResponse {
|
||||
dpmNm: string;
|
||||
cps: string;
|
||||
splmntOpnnCn: string;
|
||||
splmntRsltCn: string;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -493,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 {
|
||||
|
||||
-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;
|
||||
}
|
||||
@@ -270,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 {
|
||||
|
||||
-1
@@ -135,7 +135,6 @@ export interface HumanWasteSludgeStatusTotalItem {
|
||||
rcycQnt: number;
|
||||
olandLfvlm: number;
|
||||
incnrQnt: number;
|
||||
oceanInputQnt: number;
|
||||
fuelQnt: number;
|
||||
etcQnt: number;
|
||||
unprcsQnt: number;
|
||||
|
||||
Reference in New Issue
Block a user