[il] - 연계 db 표준화로 인한 소스 수정

This commit is contained in:
100JM
2026-09-16 14:52:38 +09:00
parent 4d20a68f93
commit 241222dcd1
16 changed files with 257 additions and 203 deletions
@@ -1,61 +1,62 @@
import { z } from "zod";
import { z } from "zod";
import type { PageableParams, PageableList } from "@/shared/model";
export interface Link {
link_sn: string;
intg_link_sn: string;
link_nm: string;
link_clsf_cd: string;
link_url: string;
link_srvr_ip: string;
link_db_cd: string;
link_key: string;
link_id: string;
link_pswd: string;
link_cycle_stng: string;
srvc_usg: string;
last_link_rslt_cd: string;
link_url_addr: string;
link_srvr_ip_addr: string;
link_db_nm: string;
link_api_no: string;
link_cntn_nm: string;
link_cntn_tkn_no: string;
link_cycle_stng_nm: string;
srvc_usg_nm: string;
last_link_rslt_nm: string;
last_link_excn_dt: string;
next_link_excn_dt: string;
last_link_err_cd: string;
last_link_err_nm: string;
mdfcn_dt: string;
mdfr_id_id: string;
link_cycle_mi: string;
link_key_expry_ymd: string;
mdfr_uuid: string;
link_cycle_no: string;
link_expry_ymd: string;
}
export interface LinkLog {
rownum: number;
link_sn: string;
intg_link_sn: string;
link_nm: string;
link_rslt_cd: string;
link_rslt_nm: string;
err_cn: string;
link_err_cd: string;
link_err_nm: string;
log_crt_dt: string;
link_exec_step: string;
}
export interface LinkInfo extends LinkFormData {
link_sn: string;
intg_link_sn: string;
link_nm: string;
link_clsf_cd: string;
link_url: string;
link_srvr_ip: string;
link_db_cd: string;
link_key: string;
link_id: string;
link_pswd: string;
srvc_usg: string;
last_link_rslt_cd: string;
link_url_addr: string;
link_srvr_ip_addr: string;
link_db_nm: string;
link_api_no: string;
link_cntn_nm: string;
link_cntn_tkn_no: string;
srvc_usg_nm: string;
last_link_rslt_nm: string;
last_link_excn_dt: string;
next_link_excn_dt: string;
last_link_err_cd: string;
last_link_err_nm: string;
mdfcn_dt: string;
mdfr_id: string;
link_cycle_mi: number;
link_key_expry_ymd: string;
mdfr_uuid: string;
link_cycle_no: number;
link_expry_ymd: string;
}
export interface LinkStats {
link_sn: string;
intg_link_sn: string;
link_nm: string;
count: number;
}
@@ -63,16 +64,16 @@ export interface LinkStats {
export interface LinkVrbl {
link_vrbl_sn: string;
link_vrbl_nm: string;
link_vrbl_vl: string;
link_vrbl_cd: string;
link_vrbl_vl_cn: string;
link_vrbl_cd_nm: string;
link_vrbl_expln: string;
mdfcn_dt: string;
mdfr_id: string;
mdfr_uuid: string;
}
export interface LinkTable {
link_nm: string;
link_sn: string;
intg_link_sn: string;
tbl_sn: string;
sou_tbl_nm: string;
sou_tbl_korn_nm: string;
@@ -87,16 +88,16 @@ export interface LinkTableColumns {
col_sn: string;
sou_col_nm: string;
sou_col_korn_nm: string;
sou_col_data_frm: string;
sou_col_frm_nm: string;
sou_col_sz: number;
trsf_col_nm: string;
trsf_col_korn_nm: string;
trsf_col_data_frm: string;
trsf_col_frm_nm: string;
trsf_col_sz: number
pk_yn: string;
col_seq: number;
mdfcn_dt: string;
mdfr_id: string;
mdfr_uuid: string;
}
export const linkFormSchema = z.object({
@@ -106,48 +107,48 @@ export const linkFormSchema = z.object({
}, {
message: "연계 분류를 선택해주세요"
}),
link_sn: z.string().max(50).nullable().optional(),
intg_link_sn: z.string().max(50).nullable().optional(),
link_nm: z.string().max(40, { message: '연계명은 40자 이하로 입력해 주세요.' }).nonempty({ message: '연계명은 필수입니다.' }),
link_url: z.string().max(1000, { message: '연계 URL은 1000자 이하로 입력해 주세요.' }).nonempty({ message: '연계 URL은 필수입니다.' }),
link_srvr_ip: z.string().max(20).nullable().optional(),
link_db_cd: z.string().max(10).nullable().optional(),
link_key: z.string().max(100, { message: '연계 KEY는 100자 이하로 입력해 주세요.' }).nonempty({ message: '연계 KEY는 필수입니다.' }),
link_id: z.string().max(20).nullable().optional(),
link_pswd: z.string().max(128).nullable().optional(),
srvc_usg: z.string().max(40).nullable().optional(),
last_link_rslt_cd: z.string().max(4).nullable().optional(),
link_url_addr: z.string().max(1000, { message: '연계 URL은 1000자 이하로 입력해 주세요.' }).nonempty({ message: '연계 URL은 필수입니다.' }),
link_srvr_ip_addr: z.string().max(20).nullable().optional(),
link_db_nm: z.string().max(10).nullable().optional(),
link_api_no: z.string().max(100, { message: '연계 KEY는 100자 이하로 입력해 주세요.' }).nonempty({ message: '연계 KEY는 필수입니다.' }),
link_cntn_nm: z.string().max(20).nullable().optional(),
link_cntn_tkn_no: z.string().max(128).nullable().optional(),
srvc_usg_nm: z.string().max(40).nullable().optional(),
last_link_rslt_nm: z.string().max(4).nullable().optional(),
last_link_excn_dt: z.string().max(40).nullable().optional(),
next_link_excn_dt: z.string().max(40).nullable().optional(),
last_link_err_cd: z.string().max(50, { message: '마지막 연계 오류 코드는 50자 이하입니다.' }).nullable().optional(),
last_link_err_nm: z.string().max(50, { message: '마지막 연계 오류 코드는 50자 이하입니다.' }).nullable().optional(),
mdfcn_dt: z.string().nullable().optional(),
mdfr_id: z.string().nullable().optional(),
link_cycle_mi: z.coerce.number().nullable().optional().refine((val) => {
mdfr_uuid: z.string().nullable().optional(),
link_cycle_no: z.coerce.number().nullable().optional().refine((val) => {
if (val == null) return true;
return val >= 5;
}, {
message: "연계 주기는 5분 이상이어야 합니다."
}),
link_key_expry_ymd: z.string().nullable().optional(),
link_expry_ymd: z.string().nullable().optional(),
});
export const linkVrblFormSchema = z.object({
link_sn: z.string().max(50).nullable().optional(),
intg_link_sn: z.string().max(50).nullable().optional(),
link_vrbl_sn: z.string().max(50).nullable().optional(),
link_vrbl_nm: z.string().max(40, { message: '변수명은 40자 이하로 입력해 주세요.' }).nonempty({ message: '변수명은 필수입니다.' }),
link_vrbl_expln: z.string().max(4000, { message: '설명은 400자 이하로 입력해 주세요.' }).nullable().optional(),
link_vrbl_cd: z.string().max(10, { message: '변수코드는 10자 이하로 입력해 주세요.' }).nullable().optional(),
link_vrbl_vl: z.string().max(1000, { message: '변수값은 1000자 이하로 입력해 주세요.' }).nonempty({ message: '변수값은 필수입니다.' }),
link_vrbl_cd_nm: z.string().max(10, { message: '변수코드는 10자 이하로 입력해 주세요.' }).nullable().optional(),
link_vrbl_vl_cn: z.string().max(1000, { message: '변수값은 1000자 이하로 입력해 주세요.' }).nonempty({ message: '변수값은 필수입니다.' }),
mdfcn_dt: z.string().nullable().optional(),
mdfr_id: z.string().nullable().optional(),
mdfr_uuid: z.string().nullable().optional(),
});
export const LinkTableColumnsSchema = z.object({
link_sn: z.string().max(50).nullable().optional(),
intg_link_sn: z.string().max(50).nullable().optional(),
tbl_sn: z.string().max(50).nullable().optional(),
col_sn: z.string().max(50).nullable().optional(),
sou_col_nm: z.string().max(40, { message: '40자 이하로 입력해 주세요.' }).nullable().optional(),
sou_col_korn_nm: z.string().max(40, { message: '40자 이하로 입력해 주세요.' }).nullable().optional(),
sou_col_data_frm: z.string().max(40, { message: '40자 이하로 입력해 주세요.' }).nullable().optional(),
sou_col_frm_nm: z.string().max(40, { message: '40자 이하로 입력해 주세요.' }).nullable().optional(),
sou_col_sz: z.coerce.number().nullable().optional().refine((val) => {
if (val == null) return true;
return val.toString().replace('.', '').length <= 14;
@@ -157,7 +158,7 @@ export const LinkTableColumnsSchema = z.object({
pk_yn: z.string().max(1).nonempty(),
trsf_col_nm: z.string().max(40, { message: '40자 이하로 입력해 주세요.' }).nonempty({ message: '변환컬럼명은 필수입니다.' }),
trsf_col_korn_nm: z.string().max(40, { message: '40자 이하로 입력해 주세요.' }).nonempty({ message: '변환컬럼 한글명은 필수입니다.' }),
trsf_col_data_frm: z.string().max(40, { message: '40자 이하로 입력해 주세요.' }).nonempty({ message: '변환컬럼 데이터 형식은 필수입니다.' }),
trsf_col_frm_nm: z.string().max(40, { message: '40자 이하로 입력해 주세요.' }).nonempty({ message: '변환컬럼 데이터 형식은 필수입니다.' }),
trsf_col_sz: z.coerce.number().nullable().optional().refine((val) => {
if (val == null) return true;
return val.toString().replace('.', '').length <= 14;
@@ -166,11 +167,11 @@ export const LinkTableColumnsSchema = z.object({
}),
col_seq: z.coerce.number().nullable().optional(),
mdfcn_dt: z.string().nullable().optional(),
mdfr_id: z.string().nullable().optional(),
mdfr_uuid: z.string().nullable().optional(),
});
export const LinkTableSchema = z.object({
link_sn: z.string().max(50).nullable().optional(),
intg_link_sn: z.string().max(50).nullable().optional(),
tbl_sn: z.string().max(50).nullable().optional(),
link_nm: z.string().max(50).nullable().optional(),
sou_tbl_nm: z.string().max(40, { message: '40자 이하로 입력해 주세요.' }).nullable().optional(),
@@ -180,7 +181,7 @@ export const LinkTableSchema = z.object({
trsf_tbl_korn_nm: z.string().max(40, { message: '40자 이하로 입력해 주세요.' }).nonempty({ message: '변환테이블 한글명은 필수입니다.' }),
trsf_tbl_expln: z.string().max(2000, { message: '설명은 2000자 이하로 입력해 주세요.' }).nullable().optional(),
mdfcn_dt: z.string().nullable().optional(),
mdfr_id: z.string().nullable().optional(),
mdfr_uuid: z.string().nullable().optional(),
});
interface LinkStatsListObject {
@@ -195,6 +196,7 @@ export interface LinkSearchParam extends PageableParams {
endDate?: string;
isSucc?: string;
linkClfsCd?: string;
linkExecStep?: string;
}
export type LinkFormData = z.infer<typeof linkFormSchema>;
+14 -14
View File
@@ -1,4 +1,4 @@
import dayjs from "dayjs";
import dayjs from "dayjs";
import { createColumnHelper } from "@tanstack/react-table";
import { type Link } from "@/entities/link";
import QuickStartButton from "../ui/QuickStartButton";
@@ -35,39 +35,39 @@ const columns = [
id: 'no',
header: 'NO',
}),
columnHelper.accessor('link_sn', {
id: 'link_sn',
columnHelper.accessor('intg_link_sn', {
id: 'intg_link_sn',
header: '연계일련번호',
}),
columnHelper.accessor('link_nm', {
id: 'link_nm',
header: '연계 명',
}),
columnHelper.accessor('link_url', {
id: 'link_url',
columnHelper.accessor('link_url_addr', {
id: 'link_url_addr',
header: '연계 URL',
cell: (info) => (info.getValue() ? info.getValue() : '-'),
}),
columnHelper.accessor('link_srvr_ip', {
id: 'link_srvr_ip',
columnHelper.accessor('link_srvr_ip_addr', {
id: 'link_srvr_ip_addr',
header: '연계서버 IP',
cell: (info) => (info.getValue() ? info.getValue() : '-'),
}),
columnHelper.accessor('link_cycle_mi', {
id: 'link_cycle_mi',
columnHelper.accessor('link_cycle_no', {
id: 'link_cycle_no',
header: '연계 주기',
cell: (info) => convertMinutesToPeriod(Number(info.getValue())),
}),
columnHelper.accessor('srvc_usg', {
id: 'srvc_usg',
columnHelper.accessor('srvc_usg_nm', {
id: 'srvc_usg_nm',
header: '서비스용도',
cell: (info) => (info.getValue() ? info.getValue() : '-'),
}),
columnHelper.display({
id: 'last_link_rslt_cd',
id: 'last_link_rslt_nm',
header: '연계상태',
cell: (info) => {
const resultCd = info.row.original.last_link_rslt_cd;
const resultCd = info.row.original.last_link_rslt_nm;
return <span className={`${(resultCd === 'SUCC') ? 'text-[rgb(53,162,235)]' : (resultCd === 'FAIL' ? 'text-[rgb(255,99,132)]' : 'text-[rgba(31,208,120,1)]')}`}>{resultCd === 'SUCC' ? '성공' : (resultCd === 'FAIL' ? '실패' : (resultCd === 'RUNN' ? '진행중' : '대기'))}</span>
},
}),
@@ -80,7 +80,7 @@ const columns = [
id: 'quick_start_btn',
header: '즉시 실행',
cell: (info) => {
return <QuickStartButton linkSn={info.row.original.link_sn} />
return <QuickStartButton linkSn={info.row.original.intg_link_sn} />
}
})
];
@@ -1,4 +1,4 @@
import type { Link, LinkList } from "@/entities/link/model/link-interface";
import type { Link, LinkList } from "@/entities/link/model/link-interface";
import {
Button,
DropdownMenu,
@@ -18,11 +18,11 @@ const LinkExpiredAlert = ({ linkList }: { linkList: UseQueryResult<LinkList> })
useEffect(() => {
if (linkList?.data?.content) {
const expriedLinks = linkList.data.content.filter((l) => {
if (l.link_key_expry_ymd === 'none' || !l.link_key_expry_ymd) {
if (l.link_expry_ymd === 'none' || !l.link_expry_ymd) {
return false;
}
const expryDate = dayjs(l.link_key_expry_ymd, 'YYMMDD');
const expryDate = dayjs(l.link_expry_ymd, 'YYMMDD');
const today = dayjs();
const daysDiff = expryDate.diff(today, 'day');
@@ -56,11 +56,11 @@ const LinkExpiredAlert = ({ linkList }: { linkList: UseQueryResult<LinkList> })
{expriedLinkList.length > 0 ?
<DropdownMenuContent className="max-h-[400px] overflow-y-auto">
{expriedLinkList.map((l) => {
const expryDate = dayjs(l.link_key_expry_ymd, 'YYMMDD');
const expryDate = dayjs(l.link_expry_ymd, 'YYMMDD');
const today = dayjs();
const daysDiff = expryDate.diff(today, 'day');
return <DropdownMenuItem key={l.link_sn} className="p-1 cursor-pointer" onClick={() => router.push(`link/register/${l.link_sn}`)}>
return <DropdownMenuItem key={l.intg_link_sn} className="p-1 cursor-pointer" onClick={() => router.push(`link/register/${l.intg_link_sn}`)}>
<div className="card-border p-4 w-full grid grid-cols-1 gap-y-2 rounded-sm hover:bg-gray-100">
{daysDiff > 0 ?
<p className="text-xl">{l.link_nm} API KEY 만료 <span className="text-red-600">{daysDiff}일전</span></p>
+21 -21
View File
@@ -1,4 +1,4 @@
import {
import {
Button,
Input,
Table,
@@ -55,7 +55,7 @@ const LinkForm = ({ form, linkSn, updateLinkInfo, handleInsertLink, deleteLink,
const newData = {
...data,
link_key_expry_ymd: isNoExprie ? 'none' :dayjs(expryDate).format('YYYYMMDD'),
link_expry_ymd: isNoExprie ? 'none' :dayjs(expryDate).format('YYYYMMDD'),
};
await handleConfirm(async () => {
@@ -133,7 +133,7 @@ const LinkForm = ({ form, linkSn, updateLinkInfo, handleInsertLink, deleteLink,
<TableCell>
<FormField
control={form.control}
name="link_sn"
name="intg_link_sn"
render={({ field }) => (
<FormItem>
<FormControl>
@@ -222,7 +222,7 @@ const LinkForm = ({ form, linkSn, updateLinkInfo, handleInsertLink, deleteLink,
<TableCell>
<FormField
control={form.control}
name="link_url"
name="link_url_addr"
render={({ field }) => (
<FormItem>
<FormControl>
@@ -233,9 +233,9 @@ const LinkForm = ({ form, linkSn, updateLinkInfo, handleInsertLink, deleteLink,
autoComplete="off"
/>
</FormControl>
{form.formState.errors.link_url && (
{form.formState.errors.link_url_addr && (
<p className="text-red-500 text-base pt-2">
{form.formState.errors.link_url.message}
{form.formState.errors.link_url_addr.message}
</p>
)}
</FormItem>
@@ -250,7 +250,7 @@ const LinkForm = ({ form, linkSn, updateLinkInfo, handleInsertLink, deleteLink,
<TableCell>
<FormField
control={form.control}
name="link_srvr_ip"
name="link_srvr_ip_addr"
render={({ field }) => (
<FormItem>
<FormControl>
@@ -277,7 +277,7 @@ const LinkForm = ({ form, linkSn, updateLinkInfo, handleInsertLink, deleteLink,
<TableCell>
<FormField
control={form.control}
name="link_key"
name="link_api_no"
render={({ field }) => (
<FormItem>
<FormControl>
@@ -288,9 +288,9 @@ const LinkForm = ({ form, linkSn, updateLinkInfo, handleInsertLink, deleteLink,
autoComplete="off"
/>
</FormControl>
{form.formState.errors.link_key && (
{form.formState.errors.link_api_no && (
<p className="text-red-500 text-base pt-2">
{form.formState.errors.link_key.message}
{form.formState.errors.link_api_no.message}
</p>
)}
</FormItem>
@@ -303,7 +303,7 @@ const LinkForm = ({ form, linkSn, updateLinkInfo, handleInsertLink, deleteLink,
<TableCell>
<FormField
control={form.control}
name="link_key_expry_ymd"
name="link_expry_ymd"
render={({ field }) => (
<FormItem>
<FormControl>
@@ -333,9 +333,9 @@ const LinkForm = ({ form, linkSn, updateLinkInfo, handleInsertLink, deleteLink,
</div>
</div>
</FormControl>
{form.formState.errors.link_key_expry_ymd && (
{form.formState.errors.link_expry_ymd && (
<p className="text-red-500 text-base pt-2">
{form.formState.errors.link_key_expry_ymd.message}
{form.formState.errors.link_expry_ymd.message}
</p>
)}
</FormItem>
@@ -348,7 +348,7 @@ const LinkForm = ({ form, linkSn, updateLinkInfo, handleInsertLink, deleteLink,
<TableCell>
<FormField
control={form.control}
name="link_id"
name="link_cntn_nm"
render={({ field }) => (
<FormItem>
<FormControl>
@@ -369,7 +369,7 @@ const LinkForm = ({ form, linkSn, updateLinkInfo, handleInsertLink, deleteLink,
<TableCell>
<FormField
control={form.control}
name="link_pswd"
name="link_cntn_tkn_no"
render={({ field }) => (
<FormItem>
<FormControl>
@@ -391,7 +391,7 @@ const LinkForm = ({ form, linkSn, updateLinkInfo, handleInsertLink, deleteLink,
<TableCell>
<FormField
control={form.control}
name="srvc_usg"
name="srvc_usg_nm"
render={({ field }) => (
<FormItem>
<FormControl>
@@ -412,7 +412,7 @@ const LinkForm = ({ form, linkSn, updateLinkInfo, handleInsertLink, deleteLink,
<TableCell>
<FormField
control={form.control}
name="link_cycle_mi"
name="link_cycle_no"
render={({ field }) => {
const timeParts = convertMinutesToPeriod(Number(field.value));
return (
@@ -510,9 +510,9 @@ const LinkForm = ({ form, linkSn, updateLinkInfo, handleInsertLink, deleteLink,
</div>
</div>
</FormControl>
{form.formState.errors.link_cycle_mi && (
{form.formState.errors.link_cycle_no && (
<p className="text-red-500 text-base pt-2">
{form.formState.errors.link_cycle_mi.message}
{form.formState.errors.link_cycle_no.message}
</p>
)}
</FormItem>
@@ -528,7 +528,7 @@ const LinkForm = ({ form, linkSn, updateLinkInfo, handleInsertLink, deleteLink,
<TableCell>
<FormField
control={form.control}
name="last_link_rslt_cd"
name="last_link_rslt_nm"
render={({ field }) => {
return (
<FormItem>
@@ -596,7 +596,7 @@ const LinkForm = ({ form, linkSn, updateLinkInfo, handleInsertLink, deleteLink,
<TableCell>
<FormField
control={form.control}
name="mdfr_id"
name="mdfr_uuid"
render={({ field }) => (
<FormItem>
<FormControl>
+2 -2
View File
@@ -1,4 +1,4 @@
"use client";
"use client";
import "@common/assets/styles/grid.css";
@@ -78,7 +78,7 @@ function LinkPage() {
`${process.env.NEXT_PUBLIC_LINK_BACKEND_API_HOST}/getLinkInfo`,
],
});
router.push(`link/register/${link.link_sn}`);
router.push(`link/register/${link.intg_link_sn}`);
};
const handleClickRegist = () => {
+5 -5
View File
@@ -1,4 +1,4 @@
"use client";
"use client";
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
import { LinkApi, linkFormSchema, type LinkFormData } from "@/entities/link";
@@ -37,7 +37,7 @@ function ModifyLinkPage({ linkSn }: { linkSn: string }) {
mutationFn: (data: LinkFormData) => LinkApi.updateLinkInfo({
...data,
link_clsf_cd: data.link_clsf_cd !== 'none' ? data.link_clsf_cd : null,
mdfr_id: userUniqId
mdfr_uuid: userUniqId
}),
onSuccess: () => {
alert('수정되었습니다.');
@@ -75,17 +75,17 @@ function ModifyLinkPage({ linkSn }: { linkSn: string }) {
if (linkInfo) {
let newData = { ...linkInfo };
if (linkInfo.mdfr_id) {
if (linkInfo.mdfr_uuid) {
const userName = await fetchUserInfo();
newData = {
...linkInfo,
mdfr_id: userName,
mdfr_uuid: userName,
};
}
form.reset(newData);
setInitialIsNoExprie(newData.link_key_expry_ymd === 'none');
setInitialIsNoExprie(newData.link_expry_ymd === 'none');
}
};
+11 -11
View File
@@ -1,4 +1,4 @@
"use client";
"use client";
import { LinkApi, type LinkFormData, linkFormSchema } from "@/entities/link";
import LinkForm from "./link-form";
@@ -20,14 +20,14 @@ function RegistLinkPage() {
resolver: zodResolver(linkFormSchema),
defaultValues: {
link_nm: '',
link_url: '',
link_srvr_ip: '',
link_db_cd: '',
link_key: '',
link_id: '',
link_pswd: '',
srvc_usg: '',
link_cycle_mi: 5,
link_url_addr: '',
link_srvr_ip_addr: '',
link_db_nm: '',
link_api_no: '',
link_cntn_nm: '',
link_cntn_tkn_no: '',
srvc_usg_nm: '',
link_cycle_no: 5,
link_clsf_cd: 'none',
},
});
@@ -44,8 +44,8 @@ function RegistLinkPage() {
const insertData = {
...data,
link_clsf_cd: data.link_clsf_cd !== 'none' ? data.link_clsf_cd : null,
next_link_excn_dt: dayjs().add(Number(data.link_cycle_mi), 'minute').format('YYYY-MM-DD HH:mm:ss'),
mdfr_id: userUniqId,
next_link_excn_dt: dayjs().add(Number(data.link_cycle_no), 'minute').format('YYYY-MM-DD HH:mm:ss'),
mdfr_uuid: userUniqId,
};
insertLinkInfo(insertData);
@@ -1,4 +1,4 @@
import dayjs from "dayjs";
import dayjs from "dayjs";
import { createColumnHelper } from "@tanstack/react-table";
import { type LinkLog } from "@/entities/link";
@@ -9,24 +9,29 @@ const columns = [
id: 'rownum',
header: 'NO',
}),
columnHelper.accessor('link_sn', {
id: 'link_sn',
columnHelper.accessor('intg_link_sn', {
id: 'intg_link_sn',
header: '연계일련번호',
}),
columnHelper.accessor('link_nm', {
id: 'link_nm',
header: '연계 명',
}),
columnHelper.accessor('link_exec_step', {
id: 'link_exec_step',
header: '연계실행단계',
cell: (info) => (info.getValue() ? info.getValue() : '-'),
}),
columnHelper.display({
id: 'link_rslt_cd',
id: 'link_rslt_nm',
header: '연계실행결과',
cell: (info) => {
const isSucc = info.row.original.link_rslt_cd.trim() === 'SUCC';
const isSucc = info.row.original.link_rslt_nm.trim() === 'SUCC';
return <span className={`${isSucc ? 'text-[rgb(53,162,235)]' : 'text-[rgb(255,99,132)]'}`}>{isSucc ? '성공' : '실패'}</span>
},
}),
columnHelper.accessor('link_err_cd', {
id: 'link_err_cd',
columnHelper.accessor('link_err_nm', {
id: 'link_err_nm',
header: '연계오류코드',
cell: (info) => (info.getValue() ? info.getValue() : '-'),
}),
@@ -33,6 +33,7 @@ function LinkLogPage() {
const [linkSn, setLinkSn] = useState<string>("");
const [linkNm, setLinkNm] = useState<string>("");
const [linkExecStep, setLinkExecStep] = useState<string>("ALL");
const [isSucc, setIsSucc] = useState<string>("ALL");
const [startDate, setStartDate] = useState<string>(
dayjs().subtract(7, "day").format("YYYY-MM-DD"),
@@ -42,6 +43,7 @@ function LinkLogPage() {
const [linkSearchParam, setLinkSearchParam] = useState<LinkSearchParam>({
linkSn: "",
linkNm: "",
linkExecStep: "",
isSucc: "",
startDate: "",
endDate: "",
@@ -65,6 +67,7 @@ function LinkLogPage() {
...linkSearchParam,
page: pagination.pageIndex,
size: pagination.pageSize,
linkExecStep,
isSucc,
startDate,
endDate,
@@ -91,6 +94,7 @@ function LinkLogPage() {
});
const handleResetSearchParam = () => {
setLinkExecStep("ALL");
setIsSucc("ALL");
setLinkNm("");
setLinkSn("");
@@ -100,6 +104,7 @@ function LinkLogPage() {
...linkSearchParam,
linkSn: "",
linkNm: "",
linkExecStep: "ALL",
isSucc: "ALL",
startDate: dayjs().subtract(7, "day").format("YYYY-MM-DD"),
endDate: dayjs().format("YYYY-MM-DD"),
@@ -122,6 +127,7 @@ function LinkLogPage() {
...linkSearchParam,
linkSn,
linkNm,
linkExecStep,
isSucc,
startDate,
endDate,
@@ -157,6 +163,24 @@ function LinkLogPage() {
onChange={(e) => setLinkNm(e.target.value)}
autoComplete="off"
/>
<Label htmlFor="linkExecStep" className="mr-2 text-label">
실행단계
</Label>
<Select onValueChange={(e) => setLinkExecStep(e)} value={linkExecStep}>
<SelectTrigger id="linkExecStep" className="mr-4 w-[10rem]">
<SelectValue placeholder="전체"></SelectValue>
</SelectTrigger>
<SelectContent>
<SelectItem value="ALL">전체</SelectItem>
<SelectItem value="API요청">API요청</SelectItem>
<SelectItem value="API응답확인">API응답확인</SelectItem>
<SelectItem value="DB연결">DB연결</SelectItem>
<SelectItem value="DB데이터적재">DB데이터적재</SelectItem>
<SelectItem value="적재완료">적재완료</SelectItem>
<SelectItem value="DB연결종료">DB연결종료</SelectItem>
<SelectItem value="연계종료">연계종료</SelectItem>
</SelectContent>
</Select>
<Label htmlFor="liResultCode" className="mr-2 text-label">
실행결과
</Label>
@@ -1,4 +1,4 @@
import { createColumnHelper } from "@tanstack/react-table";
import { createColumnHelper } from "@tanstack/react-table";
import { type Link } from "@/entities/link";
const columnHelper = createColumnHelper<Link>();
@@ -8,16 +8,16 @@ const columns = [
id: 'no',
header: 'NO',
}),
columnHelper.accessor('link_sn', {
id: 'link_sn',
columnHelper.accessor('intg_link_sn', {
id: 'intg_link_sn',
header: '연계 일련번호',
}),
columnHelper.accessor('link_nm', {
id: 'link_nm',
header: '연계 명',
}),
columnHelper.accessor('srvc_usg', {
id: 'srvc_usg',
columnHelper.accessor('srvc_usg_nm', {
id: 'srvc_usg_nm',
header: '서비스용도',
cell: (info) => (info.getValue() ? info.getValue() : '-'),
}),
@@ -1,4 +1,4 @@
import { createColumnHelper } from "@tanstack/react-table";
import { createColumnHelper } from "@tanstack/react-table";
import { type LinkVrbl } from "@/entities/link";
import { Checkbox } from "@common/components";
@@ -70,15 +70,22 @@ function vrblColumns({
id: "link_vrbl_nm",
header: "변수 명",
}),
columnHelper.accessor("link_vrbl_cd", {
id: "link_vrbl_cd",
columnHelper.accessor("link_vrbl_cd_nm", {
id: "link_vrbl_cd_nm",
header: "변수코드",
cell: (info) => (info.getValue() ? info.getValue() : '-'),
}),
columnHelper.accessor("link_vrbl_vl", {
id: "link_vrbl_vl",
columnHelper.accessor("link_vrbl_vl_cn", {
id: "link_vrbl_vl_cn",
header: "변수 값",
cell: (info) => (info.getValue() === 'now' ? '요청일자' : info.getValue() === 'nowMonth' ? '요청월' : info.getValue()),
cell: (info) => {
const value = info.getValue();
if (value === 'now') return '요청일자';
if (value === 'nowMonth') return '요청월';
if (value === 'nowHour') return '요청일자(시간포함)';
if (value === 'nowHourMin') return '요청일자(시분포함)';
return value;
},
}),
columnHelper.accessor("link_vrbl_expln", {
id: "link_vrbl_expln",
@@ -1,4 +1,4 @@
'use client';
'use client';
import {
Dialog,
@@ -71,21 +71,29 @@ function LinkParamsDialog({ selectedLink, form, insertLinkVrbl, dialogOpen, onOp
if (await confirm(confirmMsg)) {
if (isModifyMode) {
updateLinkVrbl(isToday ? { ...cleanData, link_vrbl_vl: checkNowMonth } : cleanData);
updateLinkVrbl(isToday ? { ...cleanData, link_vrbl_vl_cn: checkNowMonth } : cleanData);
} else {
insertLinkVrbl(isToday ? { ...cleanData, link_vrbl_vl: checkNowMonth } : cleanData);
insertLinkVrbl(isToday ? { ...cleanData, link_vrbl_vl_cn: checkNowMonth } : cleanData);
}
}
});
};
const getTodayValueLabel = (value: string) => {
if (value === 'now') return '요청일자';
if (value === 'nowMonth') return '요청월';
if (value === 'nowHour') return '요청일자(시간포함)';
if (value === 'nowHourMin') return '요청일자(시분포함)';
return value;
};
const handleCheckTodayValue = (check: boolean | string) => {
if (check) {
setIsToday(true);
form.setValue('link_vrbl_vl', (checkNowMonth === 'now' ? '요청일자' : '요청월'));
form.setValue('link_vrbl_vl_cn', getTodayValueLabel(checkNowMonth));
} else {
setIsToday(false);
form.setValue('link_vrbl_vl', '');
form.setValue('link_vrbl_vl_cn', '');
}
};
@@ -96,14 +104,14 @@ function LinkParamsDialog({ selectedLink, form, insertLinkVrbl, dialogOpen, onOp
form.reset({
link_vrbl_nm: '',
link_vrbl_expln: '',
link_vrbl_cd: '',
link_vrbl_vl: '',
link_vrbl_cd_nm: '',
link_vrbl_vl_cn: '',
});
}
if (isModifyMode && (form.getValues('link_vrbl_vl') === 'now' || form.getValues('link_vrbl_vl') === 'nowMonth')) {
if (isModifyMode && ['now', 'nowMonth', 'nowHour', 'nowHourMin'].includes(form.getValues('link_vrbl_vl_cn') ?? '')) {
setIsToday(true);
setCheckNowMonth(form.getValues('link_vrbl_vl'));
setCheckNowMonth(form.getValues('link_vrbl_vl_cn'));
}
}, [dialogOpen]);
@@ -118,7 +126,7 @@ function LinkParamsDialog({ selectedLink, form, insertLinkVrbl, dialogOpen, onOp
<DialogTrigger asChild>
<Button color="green" className="h-[3.2rem]" onClick={() => onOpenChange(true)}>행 추가</Button>
</DialogTrigger>
<DialogContent className="sm:max-w-[55rem]">
<DialogContent className="sm:max-w-[55rem] md:min-w-[90rem]">
<DialogHeader>
<DialogTitle>
{selectedLink.linkNm} ({selectedLink.linkSn})
@@ -213,7 +221,7 @@ function LinkParamsDialog({ selectedLink, form, insertLinkVrbl, dialogOpen, onOp
<TableCell>
<FormField
control={form.control}
name="link_vrbl_cd"
name="link_vrbl_cd_nm"
render={({ field }) => (
<FormItem>
<FormControl>
@@ -224,9 +232,9 @@ function LinkParamsDialog({ selectedLink, form, insertLinkVrbl, dialogOpen, onOp
autoComplete="off"
/>
</FormControl>
{form.formState.errors.link_vrbl_cd && (
{form.formState.errors.link_vrbl_cd_nm && (
<p className="text-red-500 text-base pt-2">
{form.formState.errors.link_vrbl_cd.message}
{form.formState.errors.link_vrbl_cd_nm.message}
</p>
)}
</FormItem>
@@ -239,7 +247,7 @@ function LinkParamsDialog({ selectedLink, form, insertLinkVrbl, dialogOpen, onOp
<TableCell>
<FormField
control={form.control}
name="link_vrbl_vl"
name="link_vrbl_vl_cn"
render={({ field }) => (
<FormItem>
<div className="flex items-center gap-x-2 mb-4">
@@ -252,7 +260,7 @@ function LinkParamsDialog({ selectedLink, form, insertLinkVrbl, dialogOpen, onOp
name="checkNowMonth"
onValueChange={(value) => {
setCheckNowMonth(value);
form.setValue('link_vrbl_vl', (value === 'now' ? '요청일자' : '요청월'));
form.setValue('link_vrbl_vl_cn', getTodayValueLabel(value));
}}
>
<div className="flex items-center space-x-2">
@@ -263,21 +271,29 @@ function LinkParamsDialog({ selectedLink, form, insertLinkVrbl, dialogOpen, onOp
<RadioGroupItem value="nowMonth" id="nowMonth" checked={checkNowMonth === 'nowMonth'} />
<Label htmlFor="nowMonth">요청월(YYYY-MM)</Label>
</div>
<div className="flex items-center space-x-2">
<RadioGroupItem value="nowHour" id="nowHour" checked={checkNowMonth === 'nowHour'} />
<Label htmlFor="nowHour">요청일자(시간포함)</Label>
</div>
<div className="flex items-center space-x-2">
<RadioGroupItem value="nowHourMin" id="nowHourMin" checked={checkNowMonth === 'nowHourMin'} />
<Label htmlFor="nowHourMin">요청일자(시분포함)</Label>
</div>
</RadioGroup>
</div>
}
<FormControl>
<Input
{...field}
value={field.value ? (field.value === 'now' ? '요청일자' : field.value === 'nowMonth' ? '요청월' : field.value) : ''}
value={field.value ? getTodayValueLabel(field.value) : ''}
className={`!text-[1.3rem] ${isToday ? 'bg-gray-100' : ''}`}
autoComplete="off"
disabled={isToday}
/>
</FormControl>
{form.formState.errors.link_vrbl_vl && (
{form.formState.errors.link_vrbl_vl_cn && (
<p className="text-red-500 text-base pt-2">
{form.formState.errors.link_vrbl_vl.message}
{form.formState.errors.link_vrbl_vl_cn.message}
</p>
)}
</FormItem>
@@ -292,7 +308,7 @@ function LinkParamsDialog({ selectedLink, form, insertLinkVrbl, dialogOpen, onOp
<TableCell>
<FormField
control={form.control}
name="mdfr_id"
name="mdfr_uuid"
render={({ field }) => (
<FormItem>
<FormControl>
@@ -1,4 +1,4 @@
"use client";
"use client";
import { useState, useMemo } from "react";
import {
@@ -123,8 +123,8 @@ function LinkParamsPage() {
mutationFn: async (data: LinkVrblFormData) =>
await LinkApi.insertLinkVrbl({
...data,
link_sn: selectedLink.linkSn,
mdfr_id: userUniqId,
intg_link_sn: selectedLink.linkSn,
mdfr_uuid: userUniqId,
}),
onSuccess: async () => {
// 쿼리 무효화를 통한 최신 데이터 가져오기
@@ -140,8 +140,8 @@ function LinkParamsPage() {
mutationFn: async (data: LinkVrblFormData) =>
await LinkApi.updateLinkVrblInfo({
...data,
link_sn: selectedLink.linkSn,
mdfr_id: userUniqId,
intg_link_sn: selectedLink.linkSn,
mdfr_uuid: userUniqId,
}),
onSuccess: async () => {
await queryClient.invalidateQueries({
@@ -191,7 +191,7 @@ function LinkParamsPage() {
const handleRowClick = async (link: Link) => {
setSelectedLink({
linkSn: link.link_sn,
linkSn: link.intg_link_sn,
linkNm: link.link_nm,
});
@@ -242,11 +242,11 @@ function LinkParamsPage() {
if (linkVrblInfo) {
let newData = { ...linkVrblInfo };
if (linkVrblInfo.mdfr_id) {
if (linkVrblInfo.mdfr_uuid) {
const userName = await fetchUserInfo();
newData = {
...linkVrblInfo,
mdfr_id: userName,
mdfr_uuid: userName,
};
}
@@ -1,4 +1,4 @@
"use client";
"use client";
import { useState, useEffect, useRef } from "react";
import dayjs from "dayjs";
@@ -255,7 +255,7 @@ function LinkStatsPage() {
setLogQueryParam({
isSucc: "SUCC",
linkNm: linkStatsList.linkSuccStats[index]?.link_nm,
linkSn: linkStatsList.linkSuccStats[index]?.link_sn,
linkSn: linkStatsList.linkSuccStats[index]?.intg_link_sn,
});
}
};
@@ -284,7 +284,7 @@ function LinkStatsPage() {
setLogQueryParam({
isSucc: "FAIL",
linkNm: linkStatsList.linkFailStats[index]?.link_nm,
linkSn: linkStatsList.linkFailStats[index]?.link_sn,
linkSn: linkStatsList.linkFailStats[index]?.intg_link_sn,
});
}
};
@@ -1,4 +1,4 @@
'use client';
'use client';
import {
Dialog,
@@ -61,13 +61,13 @@ function LinkTableDialog({ dialogOpen, onOpenChange, form, tableInfo, insertLink
if (!isModifyMode) {
insertLinkTableCol({
...data,
link_sn: tableInfo.link_sn,
intg_link_sn: tableInfo.intg_link_sn,
tbl_sn: tableInfo.tbl_sn,
});
} else {
updateLinkTableCol({
...data,
link_sn: tableInfo.link_sn,
intg_link_sn: tableInfo.intg_link_sn,
tbl_sn: tableInfo.tbl_sn,
});
}
@@ -92,16 +92,16 @@ function LinkTableDialog({ dialogOpen, onOpenChange, form, tableInfo, insertLink
col_sn: '',
sou_col_nm: '',
sou_col_korn_nm: '',
sou_col_data_frm: '',
sou_col_frm_nm: '',
sou_col_sz: null,
trsf_col_nm: '',
trsf_col_korn_nm: '',
trsf_col_data_frm: '',
trsf_col_frm_nm: '',
trsf_col_sz: null,
col_seq: null,
pk_yn: 'N',
mdfcn_dt: '',
mdfr_id: '',
mdfr_uuid: '',
});
}
@@ -216,7 +216,7 @@ function LinkTableDialog({ dialogOpen, onOpenChange, form, tableInfo, insertLink
<TableCell>
<FormField
control={form.control}
name="sou_col_data_frm"
name="sou_col_frm_nm"
render={({ field }) => (
<FormItem>
<FormControl>
@@ -227,9 +227,9 @@ function LinkTableDialog({ dialogOpen, onOpenChange, form, tableInfo, insertLink
autoComplete="off"
/>
</FormControl>
{form.formState.errors.sou_col_data_frm && (
{form.formState.errors.sou_col_frm_nm && (
<p className="text-red-500 text-base pt-2">
{form.formState.errors.sou_col_data_frm.message}
{form.formState.errors.sou_col_frm_nm.message}
</p>
)}
</FormItem>
@@ -349,7 +349,7 @@ function LinkTableDialog({ dialogOpen, onOpenChange, form, tableInfo, insertLink
<TableCell>
<FormField
control={form.control}
name="trsf_col_data_frm"
name="trsf_col_frm_nm"
render={({ field }) => (
<FormItem>
<FormControl>
@@ -360,9 +360,9 @@ function LinkTableDialog({ dialogOpen, onOpenChange, form, tableInfo, insertLink
autoComplete="off"
/>
</FormControl>
{form.formState.errors.trsf_col_data_frm && (
{form.formState.errors.trsf_col_frm_nm && (
<p className="text-red-500 text-base pt-2">
{form.formState.errors.trsf_col_data_frm.message}
{form.formState.errors.trsf_col_frm_nm.message}
</p>
)}
</FormItem>
@@ -444,7 +444,7 @@ function LinkTableDialog({ dialogOpen, onOpenChange, form, tableInfo, insertLink
<TableCell>
<FormField
control={form.control}
name="mdfr_id"
name="mdfr_uuid"
render={({ field }) => (
<FormItem>
<FormControl>
@@ -1,4 +1,4 @@
"use client";
"use client";
import { useState, useMemo } from "react";
import {
@@ -97,7 +97,7 @@ function LinkTablePage() {
mutationFn: async (data: LinkTableColData) =>
await LinkApi.insertLinkTableCol({
...data,
mdfr_id: userUniqId,
mdfr_uuid: userUniqId,
}),
onSuccess: async () => {
if (selectedTableInfo) {
@@ -113,10 +113,10 @@ function LinkTablePage() {
});
const tableData = await LinkApi.getLinkTableInfo(
selectedTableInfo.link_sn,
selectedTableInfo.intg_link_sn,
);
const tableColList = await LinkApi.getLinkTableColList(
selectedTableInfo.link_sn,
selectedTableInfo.intg_link_sn,
);
setSelectedTableInfo(tableData);
@@ -132,7 +132,7 @@ function LinkTablePage() {
mutationFn: async (data: LinkTableColData) =>
await LinkApi.updateLinkTableCol({
...data,
mdfr_id: userUniqId,
mdfr_uuid: userUniqId,
}),
onSuccess: async () => {
if (selectedTableInfo) {
@@ -148,10 +148,10 @@ function LinkTablePage() {
});
const tableData = await LinkApi.getLinkTableInfo(
selectedTableInfo.link_sn,
selectedTableInfo.intg_link_sn,
);
const tableColList = await LinkApi.getLinkTableColList(
selectedTableInfo.link_sn,
selectedTableInfo.intg_link_sn,
);
setSelectedTableInfo(tableData);
@@ -180,10 +180,10 @@ function LinkTablePage() {
});
const tableData = await LinkApi.getLinkTableInfo(
selectedTableInfo.link_sn,
selectedTableInfo.intg_link_sn,
);
const tableColList = await LinkApi.getLinkTableColList(
selectedTableInfo.link_sn,
selectedTableInfo.intg_link_sn,
);
setSelectedTableInfo(tableData);
@@ -212,14 +212,14 @@ function LinkTablePage() {
});
const tableData = await LinkApi.getLinkTableInfo(
selectedTableInfo.link_sn,
selectedTableInfo.intg_link_sn,
);
const tableColList = await LinkApi.getLinkTableColList(
selectedTableInfo.link_sn,
selectedTableInfo.intg_link_sn,
);
tableForm.reset({
link_sn: tableData.link_sn,
intg_link_sn: tableData.intg_link_sn,
link_nm: tableData.link_nm,
tbl_sn: tableData.tbl_sn ?? "",
sou_tbl_nm: tableData.sou_tbl_nm ?? "",
@@ -254,10 +254,10 @@ function LinkTablePage() {
});
const tableData = await LinkApi.getLinkTableInfo(
selectedTableInfo.link_sn,
selectedTableInfo.intg_link_sn,
);
const tableColList = await LinkApi.getLinkTableColList(
selectedTableInfo.link_sn,
selectedTableInfo.intg_link_sn,
);
setSelectedTableInfo(tableData);
@@ -316,15 +316,15 @@ function LinkTablePage() {
};
const handleRowClick = async (data: Link) => {
const tableData = await LinkApi.getLinkTableInfo(data.link_sn);
const tableColList = await LinkApi.getLinkTableColList(data.link_sn);
const tableData = await LinkApi.getLinkTableInfo(data.intg_link_sn);
const tableColList = await LinkApi.getLinkTableColList(data.intg_link_sn);
setSelectedTableInfo(tableData);
setTableColList(tableColList.content);
setSelectedColIds([]);
tableForm.reset({
link_sn: tableData.link_sn,
intg_link_sn: tableData.intg_link_sn,
link_nm: tableData.link_nm,
tbl_sn: tableData.tbl_sn ?? "",
sou_tbl_nm: tableData.sou_tbl_nm ?? "",
@@ -345,11 +345,11 @@ function LinkTablePage() {
if (colInfo) {
let newData = { ...colInfo };
if (colInfo.mdfr_id) {
if (colInfo.mdfr_uuid) {
const userName = await fetchUserInfo();
newData = {
...colInfo,
mdfr_id: userName,
mdfr_uuid: userName,
};
}
@@ -387,7 +387,7 @@ function LinkTablePage() {
if (await confirm(confirmMsg)) {
insertLinkTableInfo({
...data,
mdfr_id: userUniqId,
mdfr_uuid: userUniqId,
tbl_sn: regTblInfo.count > 0 ? regTblInfo.tbl_sn : "",
});
}
@@ -398,7 +398,7 @@ function LinkTablePage() {
updateLinkTableInfo({
...data,
tbl_sn: regTblInfo.count > 0 ? regTblInfo.tbl_sn : "",
mdfr_id: userUniqId,
mdfr_uuid: userUniqId,
});
}
});
@@ -511,7 +511,7 @@ function LinkTablePage() {
{selectedTableInfo ? (
<FormField
control={tableForm.control}
name="link_sn"
name="intg_link_sn"
render={({ field }) => (
<FormItem>
<FormControl>