-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
235 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
export interface userLoginRequestDto { | ||
accountId: string; | ||
password: string; | ||
} | ||
|
||
export interface saveExcelRequestDto { | ||
type: "WAR_VETERAN" | "WAR_VETERAN_SPOUSE" | "HONORABLE_ALLOWANCE"; | ||
file: File; | ||
} | ||
|
||
export interface editExcelTargetRequestDto { | ||
excelLine: { | ||
serial_number: number; | ||
hang_jung_dong: string; | ||
veterans_number: string; | ||
resident_registration_number: string; | ||
name: string; | ||
address: string; | ||
deposit_type: string; | ||
bank_name: string; | ||
account_holder: string; | ||
bank_account_number: string; | ||
sibi: string; | ||
gubi: string; | ||
allowance_type: string; | ||
note: string; | ||
}; | ||
id: number; | ||
} | ||
|
||
export interface editExcelCashRequestDto { | ||
excelLine: { | ||
serial_number: number; | ||
hang_jung_dong: string; | ||
veterans_number: string; | ||
resident_registration_number: string; | ||
name: string; | ||
address: string; | ||
deposit_type: string; | ||
sibi: number; | ||
gubi: number; | ||
allowance_type: string; | ||
note: string; | ||
}; | ||
id: number; | ||
} | ||
|
||
export interface editExcelNewcomerRequestDto { | ||
excelLine: { | ||
serial_number: number; | ||
hang_jung_dong: string; | ||
veterans_number: string; | ||
resident_registration_number: string; | ||
name: string; | ||
address: string; | ||
deposit_type: string; | ||
bank_name: string; | ||
account_holder: string; | ||
bank_account_number: string; | ||
allowance_type: string; | ||
note: string; | ||
transfer_reason: string; | ||
transfer_date: string; | ||
}; | ||
id: number; | ||
} | ||
|
||
export interface editExcelStoppedRequestDto { | ||
excelLine: { | ||
serial_number: number; | ||
hang_jung_dong: string; | ||
veterans_number: string; | ||
resident_registration_number: string; | ||
name: string; | ||
address: string; | ||
deposit_type: string; | ||
bank_name: string; | ||
account_holder: string; | ||
bank_account_number: string; | ||
sibi: string; | ||
gubi: string; | ||
allowance_type: string; | ||
note: string; | ||
stopped_reason: string; | ||
stopped_date: string; | ||
transfer_address: string; | ||
}; | ||
id: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
export interface userLoginResponseDto { | ||
access_token: ""; | ||
access_token_exp: ""; | ||
} | ||
|
||
export interface getExcelType { | ||
serialNumber: string; | ||
hangJungDong: string; | ||
veteransNumber: string; | ||
residentRegistrationNumber: string; | ||
name: string; | ||
address: string; | ||
depositType: string; | ||
bankName: string; | ||
accountHolder: string; | ||
bankAccountNumber: string; | ||
sibi: number; | ||
gubi: number; | ||
note: string; | ||
} | ||
|
||
export interface getExcelResponseDto { | ||
paymentTargetTab: getExcelType[]; | ||
} | ||
|
||
export interface parsingExcel { | ||
serialNumber: number; | ||
hangJungDong: string; | ||
veteransNumber: string; | ||
residentRegistrationNumber: string; | ||
name: string; | ||
address: string; | ||
depositType: string; | ||
bankName: string; | ||
accountHolder: string; | ||
bankAccountNumber: string; | ||
sibi: number; | ||
gubi: number; | ||
note: string; | ||
} | ||
|
||
export interface parsingExcelResponseDto { | ||
paymentTargetTab: parsingExcel[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import { | ||
editExcelCashRequestDto, | ||
editExcelNewcomerRequestDto, | ||
editExcelStoppedRequestDto, | ||
editExcelTargetRequestDto, | ||
saveExcelRequestDto, | ||
} from "../../models/request"; | ||
import { | ||
getExcelResponseDto, | ||
parsingExcelResponseDto, | ||
} from "../../models/response"; | ||
import instance from "../axios"; | ||
|
||
export const saveExcel = async (request: saveExcelRequestDto) => { | ||
const { type, file } = request; | ||
const formData: FormData = new FormData(); | ||
formData.append("file", file); | ||
|
||
return await instance.put(`/allowance/?type=${type}`, formData, { | ||
headers: { | ||
"Content-Type": "multipart/form-data", | ||
}, | ||
}); | ||
}; | ||
|
||
export const getExcel = async ( | ||
type: "WAR_VETERAN" | "WAR_VETERAN_SPOUSE" | "HONORABLE_ALLOWANCE" //참전유공자 명예수당, 참전유공자 배우자수당, 보훈 예우수당 | ||
) => { | ||
const response = await instance.get<getExcelResponseDto>( | ||
`/allowance/?type=${type}` | ||
); | ||
return response.data; | ||
}; | ||
|
||
export const exportExcel = async ( | ||
type: "WAR_VETERAN" | "WAR_VETERAN_SPOUSE" | "HONORABLE_ALLOWANCE" | ||
) => { | ||
const response = await instance.get<File>(`/allowance/export/?type=${type}`); | ||
return response.data; | ||
}; | ||
|
||
export const parsingExcel = async (file: File) => { | ||
const formData: FormData = new FormData(); | ||
formData.append("file", file); | ||
|
||
const response = await instance.post<parsingExcelResponseDto>( | ||
`/excel/parse`, | ||
formData, | ||
{ | ||
headers: { | ||
"Content-Type": "multipart/form-data", | ||
}, | ||
} | ||
); | ||
return response.data; | ||
}; | ||
|
||
//보훈수당 엑셀 파일 수정-대상자 현황 | ||
export const editExcelTarget = async (request: editExcelTargetRequestDto) => { | ||
return await instance.patch( | ||
`/allowance/target/${request.id}`, | ||
request.excelLine | ||
); | ||
}; | ||
|
||
//보훈수당 엑셀 파일 수정-현금 지급 | ||
export const editExcelCash = async (request: editExcelCashRequestDto) => { | ||
return await instance.patch( | ||
`/allowance/cash/${request.id}`, | ||
request.excelLine | ||
); | ||
}; | ||
|
||
//보훈수당 엑셀 파일 수정-신규자 | ||
export const editExcelNewcomer = async ( | ||
request: editExcelNewcomerRequestDto | ||
) => { | ||
return await instance.patch( | ||
`/allowance/cash/${request.id}`, | ||
request.excelLine | ||
); | ||
}; | ||
|
||
//보훈수당 엑셀 파일 수정-지급중지자 | ||
export const editExcelStopped = async (request: editExcelStoppedRequestDto) => { | ||
return await instance.patch( | ||
`/allowance/cash/${request.id}`, | ||
request.excelLine | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { userLoginRequestDto } from "../../models/request"; | ||
import { userLoginResponseDto } from "../../models/response"; | ||
import instance from "../axios"; | ||
|
||
export const userLogin = async (request: userLoginRequestDto) => { | ||
const { accountId, password } = request; | ||
|
||
return await instance.post<userLoginResponseDto>("/auth/admin/token", { | ||
accountId: accountId, | ||
password: password, | ||
}); | ||
}; |