[st] feat: 통계 검증 리포트 목록 조회 API 수정
This commit is contained in:
@@ -14,12 +14,12 @@ import { CodeApi, CodeSelect } from "@/entities/code";
|
||||
import {
|
||||
type ApproveRequest,
|
||||
type RejectRequest,
|
||||
type ReportStatusResponseDto,
|
||||
statisticsApprovalApi,
|
||||
type StatisticsVerificationFilterState,
|
||||
statisticsVerificationReportColumnInfo,
|
||||
statisticsVerificationResultColumnInfo,
|
||||
type StatisticsVerificationSubFilterState,
|
||||
type StatsInputStatusList,
|
||||
useSggList,
|
||||
useSidoList,
|
||||
useStatsVrfcRptData,
|
||||
@@ -72,8 +72,8 @@ const getYearOptions = () => {
|
||||
};
|
||||
|
||||
function isSameStatsInputStatusRow(
|
||||
a: StatsInputStatusList,
|
||||
b: StatsInputStatusList,
|
||||
a: ReportStatusResponseDto,
|
||||
b: ReportStatusResponseDto,
|
||||
): boolean {
|
||||
return (
|
||||
a.ctpvNm === b.ctpvNm && a.sggNm === b.sggNm && a.statsCd === b.statsCd
|
||||
@@ -132,11 +132,12 @@ const DEFAULT_FILTERS: StatisticsVerificationFilterState = {
|
||||
statsYr: String(dayjs().year() - 1),
|
||||
sewerBzmnCd: null,
|
||||
statsCd: null,
|
||||
laeSbmsnSttsCd: "3",
|
||||
pbcpSbmsnSttsCd: "3",
|
||||
};
|
||||
|
||||
const DEFAULT_SUB_FILTERS: StatisticsVerificationSubFilterState = {
|
||||
...DEFAULT_FILTERS,
|
||||
laeSbmsnSttsCd: "3",
|
||||
prcsYnList: "1,2",
|
||||
rejectCode: "0",
|
||||
pbcpAprvYn: "N",
|
||||
@@ -153,6 +154,13 @@ const REJECT_STATUS_OPTIONS = [
|
||||
{ label: "공단반려", value: "2" },
|
||||
];
|
||||
|
||||
const PBCP_SBMSN_STTS_OPTIONS = [
|
||||
{ label: "미작성", value: "0" },
|
||||
{ label: "작성중", value: "1" },
|
||||
{ label: "승인", value: "3" },
|
||||
{ label: "반려", value: "4" },
|
||||
];
|
||||
|
||||
function StatisticsVerificationReport() {
|
||||
const queryClient = useQueryClient();
|
||||
const userInfo = useUserStore((state) => state.userInfo);
|
||||
@@ -163,7 +171,7 @@ function StatisticsVerificationReport() {
|
||||
const [subFilters, setSubFilters] =
|
||||
useState<StatisticsVerificationSubFilterState>(DEFAULT_SUB_FILTERS);
|
||||
const [selectedReportRows, setSelectedReportRows] = useState<
|
||||
StatsInputStatusList[]
|
||||
ReportStatusResponseDto[]
|
||||
>([]);
|
||||
const [selectedResultRows, setSelectedResultRows] = useState<
|
||||
VerifyResultItem[]
|
||||
@@ -227,9 +235,6 @@ function StatisticsVerificationReport() {
|
||||
const statisticsVerificationReportQuery = useStatsVrfcRptData(
|
||||
statisticsVerificationReportFilters,
|
||||
);
|
||||
const statisticsVerificationResultQuery =
|
||||
useStatsVrfcRsltData(detailParams);
|
||||
|
||||
const statisticsVerificationReportData =
|
||||
statisticsVerificationReportQuery.data ?? [];
|
||||
const statisticsVerificationReportGridRows = useMemo(
|
||||
@@ -237,6 +242,8 @@ function StatisticsVerificationReport() {
|
||||
[statisticsVerificationReportData],
|
||||
);
|
||||
|
||||
const statisticsVerificationResultQuery =
|
||||
useStatsVrfcRsltData(detailParams);
|
||||
const statisticsVerificationResultData = useMemo(
|
||||
() =>
|
||||
statisticsVerificationResultQuery.data?.pages.flatMap(
|
||||
@@ -560,7 +567,7 @@ function StatisticsVerificationReport() {
|
||||
|
||||
function handleReportRefresh() {
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: [ENDPOINT.ST_SERVICE.INPUT, "statistics-input-status"],
|
||||
queryKey: [ENDPOINT.ST_SERVICE.INPUT, "validation-report"],
|
||||
});
|
||||
}
|
||||
|
||||
@@ -605,6 +612,12 @@ function StatisticsVerificationReport() {
|
||||
onChange={handleFilterChange("statsYr")}
|
||||
options={getYearOptions()}
|
||||
/>
|
||||
<FilterSelect
|
||||
label="공단진행상태"
|
||||
value={filters.pbcpSbmsnSttsCd ?? ""}
|
||||
onChange={handleFilterChange("pbcpSbmsnSttsCd")}
|
||||
options={PBCP_SBMSN_STTS_OPTIONS}
|
||||
/>
|
||||
<div className="flex items-center gap-2">
|
||||
<Label>통계지표</Label>
|
||||
<CodeSelect
|
||||
@@ -645,7 +658,7 @@ function StatisticsVerificationReport() {
|
||||
setRowData={() => {}}
|
||||
showHeaderCheckbox={true}
|
||||
gridHeight={30}
|
||||
onRowClick={(row: StatsInputStatusList) => {
|
||||
onRowClick={(row: ReportStatusResponseDto) => {
|
||||
setSubFilters((prev) => ({
|
||||
...prev,
|
||||
ctpvNm: row?.ctpvNm ?? "",
|
||||
|
||||
@@ -2,6 +2,8 @@ import { stClient } from "@/shared/api";
|
||||
import { ENDPOINT } from "@/shared/config";
|
||||
|
||||
import type {
|
||||
ReportSearchRequestDto,
|
||||
ReportStatusListApiResponse,
|
||||
StatisticsInputStatusService,
|
||||
StatsInputStatusListApiResponse,
|
||||
StatsInputStatusListRequestParams,
|
||||
@@ -17,6 +19,16 @@ export class StatisticsInputStatusApiService implements StatisticsInputStatusSer
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
|
||||
public async getStatsValidationReport(
|
||||
request: ReportSearchRequestDto,
|
||||
): Promise<ReportStatusListApiResponse> {
|
||||
const response = await stClient.get<ReportStatusListApiResponse>(
|
||||
`${ENDPOINT.ST_SERVICE.INPUT}/stats-input-status/validation-report`,
|
||||
{ params: request },
|
||||
);
|
||||
return response.data;
|
||||
}
|
||||
}
|
||||
|
||||
export const StatisticsInputStatusApi = new StatisticsInputStatusApiService();
|
||||
|
||||
@@ -122,18 +122,24 @@ export const useStatsVrfcRptData = (
|
||||
return useQuery({
|
||||
queryKey: [
|
||||
ENDPOINT.ST_SERVICE.INPUT,
|
||||
"statistics-input-status",
|
||||
"validation-report",
|
||||
submittedMainFilters?.statsYr ?? "",
|
||||
submittedMainFilters?.ctpvNm ?? "",
|
||||
submittedMainFilters?.sggNm ?? "",
|
||||
submittedMainFilters?.sewerBzmnCd ?? "",
|
||||
submittedMainFilters?.statsCd ?? "",
|
||||
submittedMainFilters?.pbcpSbmsnSttsCd ?? "",
|
||||
],
|
||||
queryFn: async () => {
|
||||
if (!submittedMainFilters) return [];
|
||||
const {
|
||||
ctpvSewerBzmnCd: _ctpvSewerBzmnCd,
|
||||
sggSewerBzmnCd: _sggSewerBzmnCd,
|
||||
...request
|
||||
} = submittedMainFilters;
|
||||
const response =
|
||||
await StatisticsInputStatusApi.getStatisticsInputStatusList(
|
||||
submittedMainFilters,
|
||||
await StatisticsInputStatusApi.getStatsValidationReport(
|
||||
request,
|
||||
);
|
||||
if (response.status !== "success")
|
||||
throw new Error(response.message);
|
||||
|
||||
@@ -76,7 +76,11 @@ export {
|
||||
type ImrLogResponse,
|
||||
} from "./model/imr/imr-interface";
|
||||
export { imrVerificationHistoryColumns } from "./model/imr/imr-verification-history-columns";
|
||||
export { type StatsInputStatusList } from "./model/input/statistics-input-status-interface";
|
||||
export {
|
||||
type ReportSearchRequestDto,
|
||||
type ReportStatusResponseDto,
|
||||
type StatsInputStatusList,
|
||||
} from "./model/input/statistics-input-status-interface";
|
||||
export { userListColumns } from "./model/notice-talk/notice-talk-sending-columns";
|
||||
export {
|
||||
type BusinessSendRequest,
|
||||
|
||||
@@ -33,8 +33,63 @@ export type StatsInputStatusListApiResponse = ApiResponse<
|
||||
message: string;
|
||||
};
|
||||
|
||||
/** 통계 검증 리포트 RequestDto */
|
||||
export interface ReportSearchRequestDto {
|
||||
sewerBzmnCd?: string | null;
|
||||
ctpvNm?: string | null;
|
||||
sggNm?: string | null;
|
||||
statsYr: string;
|
||||
statsCd?: string | null;
|
||||
/** 공단 상태 코드 (0:미작성, 1:작성중, 2:제출, 3:승인, 4:반려, 5:검토중) */
|
||||
pbcpSbmsnSttsCd?: string | null;
|
||||
}
|
||||
|
||||
/** 통계 검증 리포트 현황 조회 ResponseDto */
|
||||
export interface ReportStatusResponseDto {
|
||||
ctpvNm?: string;
|
||||
sggNm?: string;
|
||||
sewerBzmnCd?: string;
|
||||
statsCd?: string;
|
||||
menuTabName?: string;
|
||||
laeSbmsnSttsCd?: string;
|
||||
laeSbmsnSttsNm?: string;
|
||||
laeSbmsnYmd?: string;
|
||||
statPicSbmsnSttsCd?: string;
|
||||
statPicSbmsnSttsNm?: string;
|
||||
ctpvSbmsnYmd?: string;
|
||||
pbcpSbmsnSttsCd?: string;
|
||||
pbcpSbmsnSttsNm?: string;
|
||||
pbcpCfmtnYmd?: string;
|
||||
laePicNm?: string;
|
||||
laePicTelNo?: string;
|
||||
laeKbrdrDeptNm?: string;
|
||||
laeKbrdrJbgdNm?: string;
|
||||
laeIdfrNm?: string;
|
||||
laeIdfrTelNo?: string;
|
||||
laeIdfrDeptNm?: string;
|
||||
laeIdfrJbgdNm?: string;
|
||||
mctpvIdfrNm?: string;
|
||||
mctpvIdfrTelNo?: string;
|
||||
mctpvIdfrDeptNm?: string;
|
||||
mctpvIdfrJbgdNm?: string;
|
||||
lastCfmtnPicNm?: string;
|
||||
lastCfmtnPicTelNo?: string;
|
||||
lastCfmtnPicDeptNm?: string;
|
||||
lastCfmtnPicJbgdNm?: string;
|
||||
rjctOpnnCn?: string;
|
||||
}
|
||||
|
||||
export type ReportStatusListApiResponse = ApiResponse<
|
||||
ReportStatusResponseDto[]
|
||||
> & {
|
||||
message: string;
|
||||
};
|
||||
|
||||
export interface StatisticsInputStatusService {
|
||||
getStatisticsInputStatusList(
|
||||
param: StatsInputStatusListRequestParams,
|
||||
): Promise<StatsInputStatusListApiResponse>;
|
||||
getStatsValidationReport(
|
||||
request: ReportSearchRequestDto,
|
||||
): Promise<ReportStatusListApiResponse>;
|
||||
}
|
||||
|
||||
+27
-3
@@ -29,14 +29,14 @@ export const statisticsVerificationReportColumnInfo: ColumnInfo = {
|
||||
{
|
||||
name: "laePicNm",
|
||||
fieldName: "laePicNm",
|
||||
header: { text: "작성자" },
|
||||
header: { text: "지자체작성자" },
|
||||
styleName: READ_ONLY_STYLE,
|
||||
editable: false,
|
||||
},
|
||||
{
|
||||
name: "laePicTelNo",
|
||||
fieldName: "laePicTelNo",
|
||||
header: { text: "작성자연락처" },
|
||||
header: { text: "연락처" },
|
||||
width: 130,
|
||||
styleName: READ_ONLY_STYLE,
|
||||
editable: false,
|
||||
@@ -58,7 +58,7 @@ export const statisticsVerificationReportColumnInfo: ColumnInfo = {
|
||||
{
|
||||
name: "laeIdfrNm",
|
||||
fieldName: "laeIdfrNm",
|
||||
header: { text: "승인자" },
|
||||
header: { text: "지자체승인자" },
|
||||
styleName: READ_ONLY_STYLE,
|
||||
editable: false,
|
||||
},
|
||||
@@ -76,6 +76,27 @@ export const statisticsVerificationReportColumnInfo: ColumnInfo = {
|
||||
styleName: READ_ONLY_STYLE,
|
||||
editable: false,
|
||||
},
|
||||
{
|
||||
name: "lastCfmtnPicNm",
|
||||
fieldName: "lastCfmtnPicNm",
|
||||
header: { text: "공단확인자" },
|
||||
styleName: READ_ONLY_STYLE,
|
||||
editable: false,
|
||||
},
|
||||
{
|
||||
name: "lastCfmtnPicDeptNm",
|
||||
fieldName: "lastCfmtnPicDeptNm",
|
||||
header: { text: "부서" },
|
||||
styleName: READ_ONLY_STYLE,
|
||||
editable: false,
|
||||
},
|
||||
{
|
||||
name: "lastCfmtnPicJbgdNm",
|
||||
fieldName: "lastCfmtnPicJbgdNm",
|
||||
header: { text: "직급" },
|
||||
styleName: READ_ONLY_STYLE,
|
||||
editable: false,
|
||||
},
|
||||
{
|
||||
name: "rjctOpnnCn",
|
||||
fieldName: "rjctOpnnCn",
|
||||
@@ -108,6 +129,9 @@ export const statisticsVerificationReportColumnInfo: ColumnInfo = {
|
||||
"laeIdfrNm",
|
||||
"laeIdfrDeptNm",
|
||||
"laeIdfrJbgdNm",
|
||||
"lastCfmtnPicNm",
|
||||
"lastCfmtnPicDeptNm",
|
||||
"lastCfmtnPicJbgdNm",
|
||||
"rjctOpnnCn",
|
||||
"sewerBzmnCd",
|
||||
"statsCd",
|
||||
|
||||
+6
-7
@@ -1,12 +1,11 @@
|
||||
import type { VerifyResultSearchRequest } from "../general-verification-interface";
|
||||
import type { StatsInputStatusListRequestParams } from "../input/statistics-input-status-interface";
|
||||
import type { ReportSearchRequestDto } from "../input/statistics-input-status-interface";
|
||||
|
||||
export type StatisticsVerificationFilterState =
|
||||
StatsInputStatusListRequestParams & {
|
||||
// 셀렉트 표시용 시도, 시군구 코드
|
||||
ctpvSewerBzmnCd?: string | null;
|
||||
sggSewerBzmnCd?: string | null;
|
||||
};
|
||||
export type StatisticsVerificationFilterState = ReportSearchRequestDto & {
|
||||
// 셀렉트 표시용 시도, 시군구 코드
|
||||
ctpvSewerBzmnCd?: string | null;
|
||||
sggSewerBzmnCd?: string | null;
|
||||
};
|
||||
|
||||
export type StatisticsVerificationSubFilterState = VerifyResultSearchRequest;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user