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