- 부가서비스: KeyIn결제 목업 API 연결
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { DefaulResponsePagination } from '@/entities/common/model/types';
|
import { DefaulResponsePagination, DefaultRequestPagination } from '@/entities/common/model/types';
|
||||||
|
|
||||||
export enum FundTransferTabKeys {
|
export enum FundTransferTabKeys {
|
||||||
RequestList = 'RequestList',
|
RequestList = 'RequestList',
|
||||||
@@ -31,8 +31,8 @@ export enum ProcessResult {
|
|||||||
export enum KeyInPaymentTransactionStatus {
|
export enum KeyInPaymentTransactionStatus {
|
||||||
ALL = 'ALL',
|
ALL = 'ALL',
|
||||||
APPROVE = 'APPROVE',
|
APPROVE = 'APPROVE',
|
||||||
BF_CANCEL = 'BF_CANCEL',
|
ALL_CANCEL = 'ALL_CANCEL',
|
||||||
AF_CANCEL = 'AF_CANCEL'
|
AFTER_CANCEL = 'AFTER_CANCEL'
|
||||||
}
|
}
|
||||||
export enum AccountHolderSearchType {
|
export enum AccountHolderSearchType {
|
||||||
ALL = 'ALL',
|
ALL = 'ALL',
|
||||||
@@ -82,15 +82,9 @@ export enum AdditionalServiceCategory {
|
|||||||
// 각 서비스별 개별 타입들
|
// 각 서비스별 개별 타입들
|
||||||
export interface KeyInPaymentListItem {
|
export interface KeyInPaymentListItem {
|
||||||
tid?: string;
|
tid?: string;
|
||||||
mid?: string;
|
paymentDate?: string;
|
||||||
stateDate?: string;
|
paymentStatus?: string;
|
||||||
stateCode?: string;
|
amount?: number;
|
||||||
stateName?: string;
|
|
||||||
installmentMonth?: string;
|
|
||||||
serviceCode?: string;
|
|
||||||
serviceName?: string;
|
|
||||||
serviceDetailName?: string;
|
|
||||||
goodsAmount?: number;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AccountHolderSearchListItem {
|
export interface AccountHolderSearchListItem {
|
||||||
@@ -227,9 +221,10 @@ export interface ExtensionListResponse extends DefaulResponsePagination {
|
|||||||
export interface ExtensionKeyinListParams extends ExtensionRequestParams {
|
export interface ExtensionKeyinListParams extends ExtensionRequestParams {
|
||||||
fromDate: string;
|
fromDate: string;
|
||||||
toDate: string;
|
toDate: string;
|
||||||
paymentStatus: string;
|
paymentStatus: KeyInPaymentTransactionStatus;
|
||||||
minAmount: number;
|
minAmount?: number | string;
|
||||||
maxAmount: number;
|
maxAmount?: number | string;
|
||||||
|
page?: DefaultRequestPagination;
|
||||||
};
|
};
|
||||||
export interface ExtensionKeyinListItemProps {
|
export interface ExtensionKeyinListItemProps {
|
||||||
tid: string;
|
tid: string;
|
||||||
@@ -241,11 +236,11 @@ export interface ExtensionKeyinListResponse extends DefaulResponsePagination {
|
|||||||
content: Array<ExtensionKeyinListItemProps>
|
content: Array<ExtensionKeyinListItemProps>
|
||||||
};
|
};
|
||||||
export interface ExtensionKeyinDownloadExcelParams extends ExtensionRequestParams {
|
export interface ExtensionKeyinDownloadExcelParams extends ExtensionRequestParams {
|
||||||
fromDate: string;
|
fromDate?: string;
|
||||||
toDate: string;
|
toDate?: string;
|
||||||
paymentStatus: string;
|
paymentStatus?: string;
|
||||||
minAmount: number;
|
minAmount?: number | string;
|
||||||
maxAmount: number;
|
maxAmount?: number | string;
|
||||||
};
|
};
|
||||||
export interface ExtensionKeyinDownloadExcelResponse {
|
export interface ExtensionKeyinDownloadExcelResponse {
|
||||||
|
|
||||||
|
|||||||
@@ -66,8 +66,8 @@ export const KeyInPaymentFilter = ({
|
|||||||
let transactionStatusOption = [
|
let transactionStatusOption = [
|
||||||
{ name: '전체', value: KeyInPaymentTransactionStatus.ALL },
|
{ name: '전체', value: KeyInPaymentTransactionStatus.ALL },
|
||||||
{ name: '승인', value: KeyInPaymentTransactionStatus.APPROVE },
|
{ name: '승인', value: KeyInPaymentTransactionStatus.APPROVE },
|
||||||
{ name: '전취소', value: KeyInPaymentTransactionStatus.BF_CANCEL },
|
{ name: '전취소', value: KeyInPaymentTransactionStatus.ALL_CANCEL },
|
||||||
{ name: '후취소', value: KeyInPaymentTransactionStatus.AF_CANCEL },
|
{ name: '후취소', value: KeyInPaymentTransactionStatus.AFTER_CANCEL },
|
||||||
]
|
]
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
import { PATHS } from '@/shared/constants/paths';
|
||||||
|
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||||
|
import { KeyInPaymentListProps } from '../../model/types'
|
||||||
|
import { ListDateGroup } from '../list-date-group';
|
||||||
|
|
||||||
|
export const KeyInPaymentList = ({
|
||||||
|
additionalServiceCategory,
|
||||||
|
listItems
|
||||||
|
}: KeyInPaymentListProps ) => {
|
||||||
|
const { navigate } = useNavigate();
|
||||||
|
|
||||||
|
const getListDateGroup = () => {
|
||||||
|
let rs = [];
|
||||||
|
for (const [key, value] of Object.entries(listItems)) {
|
||||||
|
rs.push(
|
||||||
|
<ListDateGroup
|
||||||
|
additionalServiceCategory ={ additionalServiceCategory }
|
||||||
|
key={ key }
|
||||||
|
date={ key }
|
||||||
|
items={ value }
|
||||||
|
></ListDateGroup>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return rs;
|
||||||
|
};
|
||||||
|
|
||||||
|
const onClickToNavigate = () => {
|
||||||
|
navigate(PATHS.additionalService.keyInPayment.request)
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className="transaction-list">
|
||||||
|
{ getListDateGroup() }
|
||||||
|
<div className="apply-row">
|
||||||
|
<button
|
||||||
|
className="btn-50 btn-blue flex-1"
|
||||||
|
onClick={ () => onClickToNavigate() }
|
||||||
|
>결제 신청</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
import { PATHS } from '@/shared/constants/paths';
|
|
||||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
|
||||||
|
|
||||||
interface LinkPaymentPendingItemProps {
|
|
||||||
transactionId: string;
|
|
||||||
customerName: string;
|
|
||||||
status: string;
|
|
||||||
channel: string;
|
|
||||||
amount: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const LinkPaymentPendingItem = ({
|
|
||||||
transactionId,
|
|
||||||
customerName,
|
|
||||||
status,
|
|
||||||
channel,
|
|
||||||
amount
|
|
||||||
}: LinkPaymentPendingItemProps) => {
|
|
||||||
const { navigate } = useNavigate();
|
|
||||||
|
|
||||||
const onClickToNavigate = () => {
|
|
||||||
navigate(PATHS.additionalService.linkPayment.pendingDetail, {
|
|
||||||
state: {
|
|
||||||
transactionId: transactionId
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const getStatusDotClass = () => {
|
|
||||||
if (status === '발송요청') {
|
|
||||||
return 'status-dot blue';
|
|
||||||
}
|
|
||||||
return 'status-dot gray';
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<div
|
|
||||||
className="transaction-item approved"
|
|
||||||
onClick={() => onClickToNavigate()}
|
|
||||||
>
|
|
||||||
<div className="transaction-status">
|
|
||||||
<div className={getStatusDotClass()}></div>
|
|
||||||
</div>
|
|
||||||
<div className="transaction-content">
|
|
||||||
<div className="transaction-title">{customerName}</div>
|
|
||||||
<div className="transaction-details">
|
|
||||||
<span>{status}</span>
|
|
||||||
<span className="separator">ㅣ</span>
|
|
||||||
<span>{channel}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="transaction-amount">{amount.toLocaleString()}원</div>
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
@@ -2,6 +2,7 @@ import { LinkPaymentPendingListProps } from '../../model/types';
|
|||||||
import { ListDateGroup } from '../list-date-group';
|
import { ListDateGroup } from '../list-date-group';
|
||||||
|
|
||||||
export const LinkPaymentPendingList = ({
|
export const LinkPaymentPendingList = ({
|
||||||
|
additionalServiceCategory,
|
||||||
listItems
|
listItems
|
||||||
}: LinkPaymentPendingListProps) => {
|
}: LinkPaymentPendingListProps) => {
|
||||||
|
|
||||||
@@ -10,11 +11,12 @@ export const LinkPaymentPendingList = ({
|
|||||||
for (const [key, value] of Object.entries(listItems)) {
|
for (const [key, value] of Object.entries(listItems)) {
|
||||||
rs.push(
|
rs.push(
|
||||||
<ListDateGroup
|
<ListDateGroup
|
||||||
|
additionalServiceCategory={additionalServiceCategory}
|
||||||
key={key}
|
key={key}
|
||||||
date={key}
|
date={key}
|
||||||
items={value}
|
items={value}
|
||||||
/>
|
></ListDateGroup>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return rs;
|
return rs;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
|||||||
import { PATHS } from "@/shared/constants/paths";
|
import { PATHS } from "@/shared/constants/paths";
|
||||||
import { LinkPaymentPendingList } from "./link-payment-pending-list";
|
import { LinkPaymentPendingList } from "./link-payment-pending-list";
|
||||||
import { AdditionalServiceCategory, LinkPaymentSearchType, LinkPaymentSendingStatus, LinkPaymentSendMethod, SortByKeys } from "../../model/types";
|
import { AdditionalServiceCategory, LinkPaymentSearchType, LinkPaymentSendingStatus, LinkPaymentSendMethod, SortByKeys } from "../../model/types";
|
||||||
import { SortOptionsBox } from './sort-options-box';
|
import { SortOptionsBox } from '../sort-options-box';
|
||||||
|
|
||||||
const sendingStatusBtnGrouup = [
|
const sendingStatusBtnGrouup = [
|
||||||
{ name: '전체', value: LinkPaymentSendingStatus.ALL },
|
{ name: '전체', value: LinkPaymentSendingStatus.ALL },
|
||||||
|
|||||||
@@ -1,62 +0,0 @@
|
|||||||
import { PATHS } from '@/shared/constants/paths';
|
|
||||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
|
||||||
import moment from 'moment';
|
|
||||||
|
|
||||||
interface LinkPaymentItemProps {
|
|
||||||
transactionId: string;
|
|
||||||
customerName: string;
|
|
||||||
status: string;
|
|
||||||
channel: string;
|
|
||||||
paymentMethod: string;
|
|
||||||
amount: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const LinkPaymentItem = ({
|
|
||||||
transactionId,
|
|
||||||
customerName,
|
|
||||||
status,
|
|
||||||
channel,
|
|
||||||
paymentMethod,
|
|
||||||
amount
|
|
||||||
}: LinkPaymentItemProps) => {
|
|
||||||
const { navigate } = useNavigate();
|
|
||||||
|
|
||||||
const onClickToNavigate = () => {
|
|
||||||
navigate(PATHS.additionalService.linkPayment.detail, {
|
|
||||||
state: {
|
|
||||||
transactionId: transactionId
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
const getStatusDotClass = () => {
|
|
||||||
if (status === '결제완료' || status === '입금요청') {
|
|
||||||
return 'status-dot blue';
|
|
||||||
}
|
|
||||||
return 'status-dot gray';
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<div
|
|
||||||
className="transaction-item approved"
|
|
||||||
onClick={() => onClickToNavigate()}
|
|
||||||
>
|
|
||||||
<div className="transaction-status">
|
|
||||||
<div className={getStatusDotClass()}></div>
|
|
||||||
</div>
|
|
||||||
<div className="transaction-content">
|
|
||||||
<div className="transaction-title">{customerName}</div>
|
|
||||||
<div className="transaction-details">
|
|
||||||
<span>{status}</span>
|
|
||||||
<span className="separator">ㅣ</span>
|
|
||||||
<span>{channel}</span>
|
|
||||||
<span className="separator">ㅣ</span>
|
|
||||||
<span>{paymentMethod}</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="transaction-amount">{amount.toLocaleString()}원</div>
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
@@ -2,6 +2,7 @@ import { LinkPaymentShippingListProps } from '../../model/types';
|
|||||||
import { ListDateGroup } from '../list-date-group';
|
import { ListDateGroup } from '../list-date-group';
|
||||||
|
|
||||||
export const LinkPaymentSHippingHistoryList = ({
|
export const LinkPaymentSHippingHistoryList = ({
|
||||||
|
additionalServiceCategory,
|
||||||
listItems
|
listItems
|
||||||
}: LinkPaymentShippingListProps) => {
|
}: LinkPaymentShippingListProps) => {
|
||||||
|
|
||||||
@@ -10,11 +11,12 @@ export const LinkPaymentSHippingHistoryList = ({
|
|||||||
for (const [key, value] of Object.entries(listItems)) {
|
for (const [key, value] of Object.entries(listItems)) {
|
||||||
rs.push(
|
rs.push(
|
||||||
<ListDateGroup
|
<ListDateGroup
|
||||||
|
additionalServiceCategory={additionalServiceCategory}
|
||||||
key={key}
|
key={key}
|
||||||
date={key}
|
date={key}
|
||||||
items={value}
|
items={value}
|
||||||
/>
|
></ListDateGroup>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return rs;
|
return rs;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { LinkPaymentShippingHistoryFilter } from "./filter/link-payment-shipping
|
|||||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||||
import { PATHS } from "@/shared/constants/paths";
|
import { PATHS } from "@/shared/constants/paths";
|
||||||
import { LinkPaymentSHippingHistoryList } from "./link-payment-shipping-history-list";
|
import { LinkPaymentSHippingHistoryList } from "./link-payment-shipping-history-list";
|
||||||
import { SortOptionsBox } from "./sort-options-box";
|
import { SortOptionsBox } from "../sort-options-box";
|
||||||
import { AdditionalServiceCategory, LinkPaymentSendMethod, LinkPaymentTransactionStatus, ProcessResult, SortByKeys } from "../../model/types";
|
import { AdditionalServiceCategory, LinkPaymentSendMethod, LinkPaymentTransactionStatus, ProcessResult, SortByKeys } from "../../model/types";
|
||||||
import { LinkPaymentSearchType, } from "../../model/types";
|
import { LinkPaymentSearchType, } from "../../model/types";
|
||||||
|
|
||||||
|
|||||||
@@ -24,15 +24,8 @@ export const ListDateGroup = ({
|
|||||||
additionalServiceCategory={ additionalServiceCategory }
|
additionalServiceCategory={ additionalServiceCategory }
|
||||||
key={ key }
|
key={ key }
|
||||||
tid={ items[i]?.tid }
|
tid={ items[i]?.tid }
|
||||||
mid={ items[i]?.mid }
|
paymentDate= { items[i]?.paymentDate}
|
||||||
stateDate={ items[i]?.stateDate }
|
paymentStatus={ items[i]?.paymentStatus}
|
||||||
stateCode={ items[i]?.stateCode }
|
|
||||||
stateName={ items[i]?.stateName }
|
|
||||||
installmentMonth={ items[i]?.installmentMonth }
|
|
||||||
serviceCode={ items[i]?.serviceCode }
|
|
||||||
serviceName={ items[i]?.serviceName }
|
|
||||||
serviceDetailName={ items[i]?.serviceDetailName }
|
|
||||||
goodsAmount={ items[i]?.goodsAmount }
|
|
||||||
|
|
||||||
requestId={ items[i]?.requestId }
|
requestId={ items[i]?.requestId }
|
||||||
requestDate={ items[i]?.requestDate }
|
requestDate={ items[i]?.requestDate }
|
||||||
|
|||||||
@@ -6,9 +6,7 @@ import moment from 'moment';
|
|||||||
|
|
||||||
export const ListItem = ({
|
export const ListItem = ({
|
||||||
additionalServiceCategory,
|
additionalServiceCategory,
|
||||||
tid, mid, stateDate, stateCode, stateName,
|
tid, paymentDate, paymentStatus,
|
||||||
installmentMonth, serviceCode, serviceName,
|
|
||||||
serviceDetailName, goodsAmount,
|
|
||||||
|
|
||||||
requestId, requestDate, bank, accountNumber,
|
requestId, requestDate, bank, accountNumber,
|
||||||
accountHolder, processResult,
|
accountHolder, processResult,
|
||||||
@@ -19,13 +17,16 @@ export const ListItem = ({
|
|||||||
const { navigate } = useNavigate();
|
const { navigate } = useNavigate();
|
||||||
const getItemClass = () => {
|
const getItemClass = () => {
|
||||||
let rs = '';
|
let rs = '';
|
||||||
if(stateCode === '0'){
|
if (paymentStatus === '') {
|
||||||
rs = '';
|
rs = '';
|
||||||
}
|
}
|
||||||
else if(stateCode === '1'){
|
else if (paymentStatus === "APPROVAL") {
|
||||||
rs = 'approved';
|
rs = 'approved';
|
||||||
}
|
}
|
||||||
else if(stateCode === '2'){
|
else if (paymentStatus === "ALL_CANCEL") {
|
||||||
|
rs = 'refund';
|
||||||
|
}
|
||||||
|
else if (paymentStatus === 'AFTER_CANCEL') {
|
||||||
rs = 'refund';
|
rs = 'refund';
|
||||||
}
|
}
|
||||||
return rs;
|
return rs;
|
||||||
@@ -33,66 +34,65 @@ export const ListItem = ({
|
|||||||
|
|
||||||
const getDotClass = (str?: string) => {
|
const getDotClass = (str?: string) => {
|
||||||
let rs = '';
|
let rs = '';
|
||||||
if(stateCode === '0'){
|
if (paymentStatus === '') {
|
||||||
rs = '';
|
rs = '';
|
||||||
}
|
}
|
||||||
else if(stateCode === '1'){
|
else if (paymentStatus === "APPROVAL") {
|
||||||
rs = 'blue';
|
rs = 'blue';
|
||||||
}
|
}
|
||||||
else if(stateCode === '2'){
|
else if (paymentStatus === "ALL_CANCEL") {
|
||||||
|
rs = 'gray';
|
||||||
|
}
|
||||||
|
else if (paymentStatus === 'AFTER_CANCEL') {
|
||||||
rs = 'gray';
|
rs = 'gray';
|
||||||
}
|
}
|
||||||
return rs;
|
return rs;
|
||||||
};
|
};
|
||||||
|
|
||||||
const onClickToNavigate = () => {
|
const onClickToNavigate = () => {
|
||||||
if(additionalServiceCategory === AdditionalServiceCategory.KeyInPayment){
|
if (additionalServiceCategory === AdditionalServiceCategory.KeyInPayment) {
|
||||||
navigate(PATHS.additionalService.keyInPayment, {
|
|
||||||
state: {
|
return;
|
||||||
tid: tid,
|
|
||||||
serviceCode: serviceCode
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
else if(additionalServiceCategory === AdditionalServiceCategory.AccountHolderSearch){
|
else if (additionalServiceCategory === AdditionalServiceCategory.AccountHolderSearch) {
|
||||||
navigate(PATHS.additionalService.accountHolderSearch.detail, {
|
navigate(PATHS.additionalService.accountHolderSearch.detail, {
|
||||||
state: {
|
state: {
|
||||||
requestId: requestId
|
requestId: requestId
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if(additionalServiceCategory === AdditionalServiceCategory.LinkPaymentShipping){
|
else if (additionalServiceCategory === AdditionalServiceCategory.LinkPaymentShipping) {
|
||||||
navigate(PATHS.additionalService.linkPayment.detail, {
|
navigate(PATHS.additionalService.linkPayment.detail, {
|
||||||
state: {
|
state: {
|
||||||
transactionId: transactionId
|
transactionId: transactionId
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else if(additionalServiceCategory === AdditionalServiceCategory.LinkPaymentPending){
|
else if (additionalServiceCategory === AdditionalServiceCategory.LinkPaymentPending) {
|
||||||
navigate(PATHS.additionalService.linkPayment.detail, {
|
navigate(PATHS.additionalService.linkPayment.detail, {
|
||||||
state: {
|
state: {
|
||||||
transactionId: transactionId
|
transactionId: transactionId
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
alert('additionalServiceCategory가 존재하지 않습니다.');
|
alert('additionalServiceCategory가 존재하지 않습니다.');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const getTime = () => {
|
const getTime = () => {
|
||||||
let timeStr = '';
|
let timeStr = '';
|
||||||
if(additionalServiceCategory === AdditionalServiceCategory.KeyInPayment){
|
if (additionalServiceCategory === AdditionalServiceCategory.KeyInPayment) {
|
||||||
let time = stateDate?.substring(8, 12);
|
let time = paymentDate?.substring(8, 12);
|
||||||
timeStr = time?.substring(0, 2) + ':' + time?.substring(2, 4);
|
timeStr = time?.substring(0, 2) + ':' + time?.substring(2, 4);
|
||||||
}
|
}
|
||||||
else if(additionalServiceCategory === AdditionalServiceCategory.AccountHolderSearch){
|
else if (additionalServiceCategory === AdditionalServiceCategory.AccountHolderSearch) {
|
||||||
timeStr = moment(requestDate).format('HH:mm');
|
timeStr = moment(requestDate).format('HH:mm');
|
||||||
}
|
}
|
||||||
else if(additionalServiceCategory === AdditionalServiceCategory.LinkPaymentShipping){
|
else if (additionalServiceCategory === AdditionalServiceCategory.LinkPaymentShipping) {
|
||||||
timeStr = moment(transactionDate).format('HH:mm');
|
timeStr = moment(transactionDate).format('HH:mm');
|
||||||
}
|
}
|
||||||
else if(additionalServiceCategory === AdditionalServiceCategory.LinkPaymentPending){
|
else if (additionalServiceCategory === AdditionalServiceCategory.LinkPaymentPending) {
|
||||||
timeStr = moment(sendDate).format('HH:mm');
|
timeStr = moment(sendDate).format('HH:mm');
|
||||||
}
|
}
|
||||||
return timeStr
|
return timeStr
|
||||||
@@ -100,16 +100,16 @@ export const ListItem = ({
|
|||||||
|
|
||||||
const getTitle = () => {
|
const getTitle = () => {
|
||||||
let str = '';
|
let str = '';
|
||||||
if(additionalServiceCategory === AdditionalServiceCategory.KeyInPayment){
|
if (additionalServiceCategory === AdditionalServiceCategory.KeyInPayment) {
|
||||||
str = `${serviceName}(${serviceDetailName})`;
|
str = `${tid}(${amount})`;
|
||||||
}
|
}
|
||||||
else if(additionalServiceCategory === AdditionalServiceCategory.AccountHolderSearch){
|
else if (additionalServiceCategory === AdditionalServiceCategory.AccountHolderSearch) {
|
||||||
str = `${accountHolder}(${accountNumber})`
|
str = `${accountHolder}(${accountNumber})`
|
||||||
}
|
}
|
||||||
else if(additionalServiceCategory === AdditionalServiceCategory.LinkPaymentShipping){
|
else if (additionalServiceCategory === AdditionalServiceCategory.LinkPaymentShipping) {
|
||||||
str = `${customerName}(${transactionId})`
|
str = `${customerName}(${transactionId})`
|
||||||
}
|
}
|
||||||
else if(additionalServiceCategory === AdditionalServiceCategory.LinkPaymentPending){
|
else if (additionalServiceCategory === AdditionalServiceCategory.LinkPaymentPending) {
|
||||||
str = `${customerName}(${transactionId})`
|
str = `${customerName}(${transactionId})`
|
||||||
}
|
}
|
||||||
return str;
|
return str;
|
||||||
@@ -117,54 +117,45 @@ export const ListItem = ({
|
|||||||
|
|
||||||
const getDetail = () => {
|
const getDetail = () => {
|
||||||
let rs = [];
|
let rs = [];
|
||||||
if(additionalServiceCategory === AdditionalServiceCategory.KeyInPayment){
|
if (additionalServiceCategory === AdditionalServiceCategory.KeyInPayment) {
|
||||||
rs.push(
|
rs.push(
|
||||||
<div className="transaction-details">
|
<div className="transaction-details">
|
||||||
<span>{ getTime() }</span>
|
<span>{getTime()}</span>
|
||||||
<span className="separator">|</span>
|
<span className="separator">|</span>
|
||||||
<span>{ stateName }</span>
|
<span>{paymentStatus}</span>
|
||||||
<span className="separator">|</span>
|
|
||||||
<span>{ mid }</span>
|
|
||||||
{
|
|
||||||
(!!installmentMonth && parseInt(installmentMonth) > 1) &&
|
|
||||||
<>
|
|
||||||
<span className="separator">|</span>
|
|
||||||
<span>{ installmentMonth }개월 할부</span>
|
|
||||||
</>
|
|
||||||
}
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if(additionalServiceCategory === AdditionalServiceCategory.AccountHolderSearch){
|
else if (additionalServiceCategory === AdditionalServiceCategory.AccountHolderSearch) {
|
||||||
rs.push(
|
rs.push(
|
||||||
<div className="transaction-details">
|
<div className="transaction-details">
|
||||||
<span>{ getTime() }</span>
|
<span>{getTime()}</span>
|
||||||
<span className="separator">|</span>
|
<span className="separator">|</span>
|
||||||
<span>{ bank }</span>
|
<span>{bank}</span>
|
||||||
<span className="separator">|</span>
|
<span className="separator">|</span>
|
||||||
<span>{ processResult }</span>
|
<span>{processResult}</span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if(additionalServiceCategory === AdditionalServiceCategory.LinkPaymentShipping){
|
else if (additionalServiceCategory === AdditionalServiceCategory.LinkPaymentShipping) {
|
||||||
rs.push(
|
rs.push(
|
||||||
<div className="transaction-details">
|
<div className="transaction-details">
|
||||||
<span>{ getTime() }</span>
|
<span>{getTime()}</span>
|
||||||
<span className="separator">|</span>
|
<span className="separator">|</span>
|
||||||
<span>{ status }</span>
|
<span>{status}</span>
|
||||||
<span className="separator">|</span>
|
<span className="separator">|</span>
|
||||||
<span>{ channel }</span>
|
<span>{channel}</span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else if(additionalServiceCategory === AdditionalServiceCategory.LinkPaymentPending){
|
else if (additionalServiceCategory === AdditionalServiceCategory.LinkPaymentPending) {
|
||||||
rs.push(
|
rs.push(
|
||||||
<div className="transaction-details">
|
<div className="transaction-details">
|
||||||
<span>{ getTime() }</span>
|
<span>{getTime()}</span>
|
||||||
<span className="separator">|</span>
|
<span className="separator">|</span>
|
||||||
<span>{ status }</span>
|
<span>{status}</span>
|
||||||
<span className="separator">|</span>
|
<span className="separator">|</span>
|
||||||
<span>{ channel }</span>
|
<span>{channel}</span>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -174,22 +165,22 @@ export const ListItem = ({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
className={ `transaction-item ${getItemClass()}` }
|
className={`transaction-item ${getItemClass()}`}
|
||||||
onClick={ () => onClickToNavigate() }
|
onClick={() => onClickToNavigate()}
|
||||||
>
|
>
|
||||||
<div className="transaction-status">
|
<div className="transaction-status">
|
||||||
<div className={ `status-dot ${getDotClass()}`}></div>
|
<div className={`status-dot ${getDotClass()}`}></div>
|
||||||
</div>
|
</div>
|
||||||
<div className="transaction-content">
|
<div className="transaction-content">
|
||||||
<div className="transaction-title">{ getTitle() }</div>
|
<div className="transaction-title">{getTitle()}</div>
|
||||||
{ getDetail() }
|
{getDetail()}
|
||||||
</div>
|
</div>
|
||||||
<div className="transaction-amount">
|
<div className="transaction-amount">
|
||||||
<NumericFormat
|
<NumericFormat
|
||||||
value={ goodsAmount || amount }
|
value={amount}
|
||||||
thousandSeparator
|
thousandSeparator
|
||||||
displayType="text"
|
displayType="text"
|
||||||
suffix={ '원' }
|
suffix={'원'}
|
||||||
></NumericFormat>
|
></NumericFormat>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
SortByKeys,
|
SortByKeys,
|
||||||
SortOptionsBoxProps
|
SortOptionsBoxProps
|
||||||
} from '../../model/types';
|
} from '../model/types';
|
||||||
export const SortOptionsBox = ({
|
export const SortOptionsBox = ({
|
||||||
sortBy,
|
sortBy,
|
||||||
onClickToSort
|
onClickToSort
|
||||||
@@ -6,21 +6,24 @@ import { HeaderType } from '@/entities/common/model/types';
|
|||||||
import {
|
import {
|
||||||
useSetHeaderTitle,
|
useSetHeaderTitle,
|
||||||
useSetHeaderType,
|
useSetHeaderType,
|
||||||
useSetFooterMode
|
useSetFooterMode,
|
||||||
|
useSetOnBack
|
||||||
} from '@/widgets/sub-layout/use-sub-layout';
|
} from '@/widgets/sub-layout/use-sub-layout';
|
||||||
import { PATHS } from '@/shared/constants/paths';
|
import { PATHS } from '@/shared/constants/paths';
|
||||||
import { useExtensionKeyinDownloadExcelMutation } from '@/entities/additional-service/api/use-extension-keyin-download-excel-mutation';
|
import { useExtensionKeyinDownloadExcelMutation } from '@/entities/additional-service/api/use-extension-keyin-download-excel-mutation';
|
||||||
import { KeyInPaymentFilter } from '@/entities/additional-service/ui/key-in-payment/filter/key-in-payment-filter';
|
import { KeyInPaymentFilter } from '@/entities/additional-service/ui/key-in-payment/filter/key-in-payment-filter';
|
||||||
import { KeyInPaymentTransactionStatus, SortByKeys } from '@/entities/additional-service/model/types';
|
import { AdditionalServiceCategory, KeyInPaymentListItem, KeyInPaymentTransactionStatus, SortByKeys } from '@/entities/additional-service/model/types';
|
||||||
import { SortOptionsBox } from '@/entities/additional-service/ui/link-payment/sort-options-box';
|
import { SortOptionsBox } from '@/entities/additional-service/ui/sort-options-box';
|
||||||
import { useExtensionKeyinListMutation } from '@/entities/additional-service/api/use-extension-keyin-list-mutation';
|
import { useExtensionKeyinListMutation } from '@/entities/additional-service/api/use-extension-keyin-list-mutation';
|
||||||
import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constants';
|
import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constants';
|
||||||
|
import { KeyInPaymentList } from '@/entities/additional-service/ui/key-in-payment/key-in-payment-list';
|
||||||
|
|
||||||
|
// contant로 옮기기
|
||||||
const requestStatusBtnGroup = [
|
const requestStatusBtnGroup = [
|
||||||
{ name: '전체', value: KeyInPaymentTransactionStatus.ALL },
|
{ name: '전체', value: KeyInPaymentTransactionStatus.ALL },
|
||||||
{ name: '승인', value: KeyInPaymentTransactionStatus.APPROVE },
|
{ name: '승인', value: KeyInPaymentTransactionStatus.APPROVE },
|
||||||
{ name: '전취소', value: KeyInPaymentTransactionStatus.BF_CANCEL },
|
{ name: '전취소', value: KeyInPaymentTransactionStatus.ALL_CANCEL },
|
||||||
{ name: '후취소', value: KeyInPaymentTransactionStatus.AF_CANCEL }
|
{ name: '후취소', value: KeyInPaymentTransactionStatus.AFTER_CANCEL }
|
||||||
];
|
];
|
||||||
|
|
||||||
export const KeyInPaymentPage = () => {
|
export const KeyInPaymentPage = () => {
|
||||||
@@ -42,43 +45,99 @@ export const KeyInPaymentPage = () => {
|
|||||||
useSetHeaderTitle('KEY-IN 결제');
|
useSetHeaderTitle('KEY-IN 결제');
|
||||||
useSetHeaderType(HeaderType.LeftArrow);
|
useSetHeaderType(HeaderType.LeftArrow);
|
||||||
useSetFooterMode(false);
|
useSetFooterMode(false);
|
||||||
|
useSetOnBack(() => {
|
||||||
|
navigate(PATHS.home);
|
||||||
|
});
|
||||||
|
|
||||||
const { mutateAsync: keyinList } = useExtensionKeyinListMutation();
|
const { mutateAsync: keyinList } = useExtensionKeyinListMutation();
|
||||||
const { mutateAsync: downloadExcel } = useExtensionKeyinDownloadExcelMutation();
|
const { mutateAsync: downloadExcel } = useExtensionKeyinDownloadExcelMutation();
|
||||||
|
|
||||||
|
const callList = (option?: {
|
||||||
|
sortBy?: string,
|
||||||
|
val?: string
|
||||||
|
}) => {
|
||||||
|
pageParam.sortBy = (option?.sortBy) ? option.sortBy : sortBy;
|
||||||
|
setPageParam(pageParam);
|
||||||
|
let newMinAmount = minAmount;
|
||||||
|
if (!!minAmount && typeof (minAmount) === 'string') {
|
||||||
|
newMinAmount = parseInt(minAmount);
|
||||||
|
}
|
||||||
|
let newMaxAmount = maxAmount;
|
||||||
|
if (!!maxAmount && typeof (maxAmount) === 'string') {
|
||||||
|
newMaxAmount = parseInt(maxAmount);
|
||||||
|
}
|
||||||
|
let listParams = {
|
||||||
|
mid: mid,
|
||||||
|
fromDate: startDate,
|
||||||
|
toDate: endDate,
|
||||||
|
paymentStatus: transactionStatus,
|
||||||
|
minAmount: newMinAmount,
|
||||||
|
maxAmount: newMaxAmount,
|
||||||
|
page: pageParam
|
||||||
|
};
|
||||||
|
|
||||||
|
keyinList(listParams).then((rs) => {
|
||||||
|
setListItems(assembleData(rs.content));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const assembleData = (content: Array<KeyInPaymentListItem>) => {
|
||||||
|
console.log('rs.content:', content)
|
||||||
|
let data: any = {};
|
||||||
|
if (content && content.length > 0) {
|
||||||
|
for (let i = 0; i < content?.length; i++) {
|
||||||
|
let paymentDate = content[i]?.paymentDate?.substring(0, 8);
|
||||||
|
let groupDate = moment(paymentDate).format('YYYYMMDD');
|
||||||
|
if (!!groupDate && !data.hasOwnProperty(groupDate)) {
|
||||||
|
data[groupDate] = [];
|
||||||
|
}
|
||||||
|
if (!!groupDate && data.hasOwnProperty(groupDate)) {
|
||||||
|
data[groupDate].push(content[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log('Data : ', data)
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
const onClickToOpenFilter = () => {
|
const onClickToOpenFilter = () => {
|
||||||
setFilterOn(!filterOn);
|
setFilterOn(!filterOn);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onClickToDownloadExcel = () => {
|
const onClickToDownloadExcel = () => {
|
||||||
// downloadExcel({
|
let newMinAmount = minAmount;
|
||||||
// mid,
|
if (!!minAmount && typeof (minAmount) === 'string') {
|
||||||
// fromDate: '',
|
newMinAmount = parseInt(minAmount);
|
||||||
// toDate: '',
|
}
|
||||||
// paymentStatus: '',
|
let newMaxAmount = maxAmount;
|
||||||
// minAmount: 0,
|
if (!!maxAmount && typeof (maxAmount) === 'string') {
|
||||||
// maxAmount: 0
|
newMaxAmount = parseInt(maxAmount);
|
||||||
// }).then((rs) => {
|
}
|
||||||
|
downloadExcel({
|
||||||
|
mid: mid,
|
||||||
|
fromDate: startDate,
|
||||||
|
toDate: endDate,
|
||||||
|
paymentStatus: transactionStatus,
|
||||||
|
minAmount: minAmount,
|
||||||
|
maxAmount: maxAmount
|
||||||
|
}).then((rs) => {
|
||||||
|
|
||||||
// });
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const onClickToSort = (sort: SortByKeys) => {
|
const onClickToSort = (sort: SortByKeys) => {
|
||||||
setSortBy(sort);
|
setSortBy(sort);
|
||||||
// TODO : callList 구현
|
callList({ sortBy: sort })
|
||||||
};
|
};
|
||||||
|
|
||||||
const onClickToTransactionStatus = (val: KeyInPaymentTransactionStatus) => {
|
const onClickToTransactionStatus = (val: KeyInPaymentTransactionStatus) => {
|
||||||
setTransactionStatus(val);
|
setTransactionStatus(val);
|
||||||
// TODO : callList 구현
|
callList({ val: val });
|
||||||
};
|
};
|
||||||
|
|
||||||
const onClickToNavigation = () => {
|
|
||||||
navigate(PATHS.additionalService.keyInPayment.request)
|
|
||||||
}
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// TODO : callList();
|
callList();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -92,7 +151,7 @@ export const KeyInPaymentPage = () => {
|
|||||||
<input
|
<input
|
||||||
className="credit-period"
|
className="credit-period"
|
||||||
type="text"
|
type="text"
|
||||||
value={ moment(startDate).format('YYYY.MM.DD') + '-' + moment(endDate).format('YYYY.MM.DD') }
|
value={moment(startDate).format('YYYY.MM.DD') + '-' + moment(endDate).format('YYYY.MM.DD')}
|
||||||
readOnly={true}
|
readOnly={true}
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
@@ -109,6 +168,7 @@ export const KeyInPaymentPage = () => {
|
|||||||
<button
|
<button
|
||||||
className="download-btn"
|
className="download-btn"
|
||||||
aria-label="다운로드"
|
aria-label="다운로드"
|
||||||
|
onClick={() => onClickToDownloadExcel()}
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
src={IMAGE_ROOT + '/ico_download.svg'}
|
src={IMAGE_ROOT + '/ico_download.svg'}
|
||||||
@@ -138,102 +198,29 @@ export const KeyInPaymentPage = () => {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<KeyInPaymentList
|
||||||
<section className="transaction-list">
|
listItems={listItems}
|
||||||
<div className="date-group">
|
additionalServiceCategory={AdditionalServiceCategory.KeyInPayment}
|
||||||
<div className="date-header">2025.06.08(일)</div>
|
></KeyInPaymentList>
|
||||||
|
|
||||||
<div className="transaction-item approved">
|
|
||||||
<div className="transaction-status">
|
|
||||||
<div className="status-dot blue"></div>
|
|
||||||
</div>
|
|
||||||
<div className="transaction-content">
|
|
||||||
<div className="transaction-title">김*환(7000)</div>
|
|
||||||
<div className="transaction-details">
|
|
||||||
<span>20:00ㅣ승인</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="transaction-amount">5,254,000원</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="transaction-item refund">
|
|
||||||
<div className="transaction-status">
|
|
||||||
<div className="status-dot gray"></div>
|
|
||||||
</div>
|
|
||||||
<div className="transaction-content">
|
|
||||||
<div className="transaction-title">최*길(7000)</div>
|
|
||||||
<div className="transaction-details">
|
|
||||||
<span>08:35ㅣ승인</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="transaction-amount">23,845,000원</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="transaction-item approved">
|
|
||||||
<div className="transaction-status">
|
|
||||||
<div className="status-dot blue"></div>
|
|
||||||
</div>
|
|
||||||
<div className="transaction-content">
|
|
||||||
<div className="transaction-title">김*환(7000)</div>
|
|
||||||
<div className="transaction-details">
|
|
||||||
<span>20:00ㅣ승인</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="transaction-amount">5,254,000원</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="transaction-item approved">
|
|
||||||
<div className="transaction-status">
|
|
||||||
<div className="status-dot blue"></div>
|
|
||||||
</div>
|
|
||||||
<div className="transaction-content">
|
|
||||||
<div className="transaction-title">김*환(7000)</div>
|
|
||||||
<div className="transaction-details">
|
|
||||||
<span>20:00ㅣ후취소</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="transaction-amount">5,254,000원</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div className="transaction-item refund">
|
|
||||||
<div className="transaction-status">
|
|
||||||
<div className="status-dot gray"></div>
|
|
||||||
</div>
|
|
||||||
<div className="transaction-content">
|
|
||||||
<div className="transaction-title">최*길(7000)</div>
|
|
||||||
<div className="transaction-details">
|
|
||||||
<span>20:00ㅣ후취소</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="transaction-amount">23,845,000원</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
<div className="apply-row">
|
|
||||||
<button
|
|
||||||
className="btn-50 btn-blue flex-1"
|
|
||||||
onClick={() => onClickToNavigation()}
|
|
||||||
>결제 신청</button>
|
|
||||||
</div>
|
|
||||||
<KeyInPaymentFilter
|
|
||||||
filterOn={filterOn}
|
|
||||||
setFilterOn={setFilterOn}
|
|
||||||
mid={mid}
|
|
||||||
startDate={startDate}
|
|
||||||
endDate={endDate}
|
|
||||||
transactionStatus={transactionStatus}
|
|
||||||
minAmount={minAmount}
|
|
||||||
maxAmount={maxAmount}
|
|
||||||
setMid={setMid}
|
|
||||||
setStartDate={setStartDate}
|
|
||||||
setEndDate={setEndDate}
|
|
||||||
setTransactionStatus={setTransactionStatus}
|
|
||||||
setMinAmount={setMinAmount}
|
|
||||||
setMaxAmount={setMaxAmount}
|
|
||||||
></KeyInPaymentFilter>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
<KeyInPaymentFilter
|
||||||
|
filterOn={filterOn}
|
||||||
|
setFilterOn={setFilterOn}
|
||||||
|
mid={mid}
|
||||||
|
startDate={startDate}
|
||||||
|
endDate={endDate}
|
||||||
|
transactionStatus={transactionStatus}
|
||||||
|
minAmount={minAmount}
|
||||||
|
maxAmount={maxAmount}
|
||||||
|
setMid={setMid}
|
||||||
|
setStartDate={setStartDate}
|
||||||
|
setEndDate={setEndDate}
|
||||||
|
setTransactionStatus={setTransactionStatus}
|
||||||
|
setMinAmount={setMinAmount}
|
||||||
|
setMaxAmount={setMaxAmount}
|
||||||
|
></KeyInPaymentFilter>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -38,7 +38,7 @@ export const KeyInPaymentRequestPage = () => {
|
|||||||
moid: 'SMS',
|
moid: 'SMS',
|
||||||
};
|
};
|
||||||
keyInApply(keyInApplyParams).then((rs) => {
|
keyInApply(keyInApplyParams).then((rs) => {
|
||||||
navigate(PATHS.additionalService.arsCardPayment.requestSuccess);
|
navigate(PATHS.additionalService.keyInPayment.requestSuccess);
|
||||||
console.log(rs)
|
console.log(rs)
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user