get api of manage fee
This commit is contained in:
parent
19fb06d7f9
commit
5e7be5ca17
@ -218,3 +218,53 @@ Content-Type: application/json
|
||||
}
|
||||
|
||||
###
|
||||
|
||||
|
||||
// GetBasicFeeRates
|
||||
|
||||
GET http://localhost:3000/oracle/GetBasicFeeRates/12
|
||||
|
||||
###
|
||||
|
||||
|
||||
// GetBondRates
|
||||
|
||||
GET http://localhost:3000/oracle/GetBondRates/12
|
||||
|
||||
###
|
||||
|
||||
|
||||
// GetCargoRates
|
||||
|
||||
GET http://localhost:3000/oracle/GetCargoRates/12
|
||||
|
||||
###
|
||||
|
||||
|
||||
// GetCfFeeRates
|
||||
|
||||
GET http://localhost:3000/oracle/GetCfFeeRates/12
|
||||
|
||||
###
|
||||
|
||||
|
||||
// GetCsFeeRates
|
||||
|
||||
GET http://localhost:3000/oracle/GetCsFeeRates/12
|
||||
|
||||
###
|
||||
|
||||
|
||||
// GetEfFeeRates
|
||||
|
||||
GET http://localhost:3000/oracle/GetEfFeeRates/12
|
||||
|
||||
###
|
||||
|
||||
|
||||
// GetFeeComm
|
||||
|
||||
GET http://localhost:3000/oracle/GetFeeComm/12
|
||||
|
||||
###
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ export class ManageFeeService {
|
||||
|
||||
let connection;
|
||||
try {
|
||||
// Connect to the Oracle database using oracledb
|
||||
|
||||
connection = await this.oracleDBService.getConnection()
|
||||
if (!connection) {
|
||||
throw new Error('No DB Connected')
|
||||
@ -78,7 +78,7 @@ export class ManageFeeService {
|
||||
async CREATEBONDRATE(body: CreateBondRateDTO) {
|
||||
let connection;
|
||||
try {
|
||||
// Connect to the Oracle database using oracledb
|
||||
|
||||
connection = await this.oracleDBService.getConnection()
|
||||
if (!connection) {
|
||||
throw new Error('No DB Connected')
|
||||
@ -152,7 +152,7 @@ export class ManageFeeService {
|
||||
async CREATECARGORATE(body: CreateCargoRateDTO) {
|
||||
let connection;
|
||||
try {
|
||||
// Connect to the Oracle database using oracledb
|
||||
|
||||
connection = await this.oracleDBService.getConnection()
|
||||
if (!connection) {
|
||||
throw new Error('No DB Connected')
|
||||
@ -222,7 +222,7 @@ export class ManageFeeService {
|
||||
|
||||
let connection;
|
||||
try {
|
||||
// Connect to the Oracle database using oracledb
|
||||
|
||||
connection = await this.oracleDBService.getConnection()
|
||||
if (!connection) {
|
||||
throw new Error('No DB Connected')
|
||||
@ -297,7 +297,7 @@ export class ManageFeeService {
|
||||
async CREATECSFEE(body: CreateCsFeeDTO) {
|
||||
let connection;
|
||||
try {
|
||||
// Connect to the Oracle database using oracledb
|
||||
|
||||
connection = await this.oracleDBService.getConnection()
|
||||
if (!connection) {
|
||||
throw new Error('No DB Connected')
|
||||
@ -361,7 +361,7 @@ export class ManageFeeService {
|
||||
async CREATEEFFEE(body: CreateEfFeeDTO) {
|
||||
let connection;
|
||||
try {
|
||||
// Connect to the Oracle database using oracledb
|
||||
|
||||
connection = await this.oracleDBService.getConnection()
|
||||
if (!connection) {
|
||||
throw new Error('No DB Connected')
|
||||
@ -441,7 +441,7 @@ export class ManageFeeService {
|
||||
|
||||
let connection;
|
||||
try {
|
||||
// Connect to the Oracle database using oracledb
|
||||
|
||||
connection = await this.oracleDBService.getConnection()
|
||||
if (!connection) {
|
||||
throw new Error('No DB Connected')
|
||||
@ -498,19 +498,14 @@ export class ManageFeeService {
|
||||
} finally { }
|
||||
|
||||
}
|
||||
async GETBASICFEERATES() { }
|
||||
async GETBONDRATES() { }
|
||||
async GETCARGORATES() { }
|
||||
async GETCFFEERATES() { }
|
||||
async GETCSFEERATES() { }
|
||||
async GETEFFEERATES() { }
|
||||
async GETFEECOMM() { }
|
||||
|
||||
// update
|
||||
|
||||
async UPDATEBASICFEE(body: UpdateBasicFeeDTO) {
|
||||
|
||||
let connection;
|
||||
try {
|
||||
// Connect to the Oracle database using oracledb
|
||||
|
||||
connection = await this.oracleDBService.getConnection()
|
||||
if (!connection) {
|
||||
throw new Error('No DB Connected')
|
||||
@ -567,7 +562,7 @@ export class ManageFeeService {
|
||||
|
||||
let connection;
|
||||
try {
|
||||
// Connect to the Oracle database using oracledb
|
||||
|
||||
connection = await this.oracleDBService.getConnection()
|
||||
if (!connection) {
|
||||
throw new Error('No DB Connected')
|
||||
@ -624,7 +619,7 @@ export class ManageFeeService {
|
||||
|
||||
let connection;
|
||||
try {
|
||||
// Connect to the Oracle database using oracledb
|
||||
|
||||
connection = await this.oracleDBService.getConnection()
|
||||
if (!connection) {
|
||||
throw new Error('No DB Connected')
|
||||
@ -680,7 +675,7 @@ export class ManageFeeService {
|
||||
async UPDATECFFEE(body: UpdateCfFeeDTO) {
|
||||
let connection;
|
||||
try {
|
||||
// Connect to the Oracle database using oracledb
|
||||
|
||||
connection = await this.oracleDBService.getConnection()
|
||||
if (!connection) {
|
||||
throw new Error('No DB Connected')
|
||||
@ -737,7 +732,7 @@ export class ManageFeeService {
|
||||
|
||||
let connection;
|
||||
try {
|
||||
// Connect to the Oracle database using oracledb
|
||||
|
||||
connection = await this.oracleDBService.getConnection()
|
||||
if (!connection) {
|
||||
throw new Error('No DB Connected')
|
||||
@ -795,7 +790,7 @@ export class ManageFeeService {
|
||||
|
||||
let connection;
|
||||
try {
|
||||
// Connect to the Oracle database using oracledb
|
||||
|
||||
connection = await this.oracleDBService.getConnection()
|
||||
if (!connection) {
|
||||
throw new Error('No DB Connected')
|
||||
@ -851,7 +846,7 @@ export class ManageFeeService {
|
||||
|
||||
let connection;
|
||||
try {
|
||||
// Connect to the Oracle database using oracledb
|
||||
|
||||
connection = await this.oracleDBService.getConnection()
|
||||
if (!connection) {
|
||||
throw new Error('No DB Connected')
|
||||
@ -904,4 +899,364 @@ export class ManageFeeService {
|
||||
|
||||
|
||||
}
|
||||
|
||||
// get
|
||||
|
||||
async GETBASICFEERATES(P_SPID: Number) {
|
||||
let connection;
|
||||
let rows = [];
|
||||
try {
|
||||
|
||||
connection = await this.oracleDBService.getConnection()
|
||||
if (!connection) {
|
||||
throw new Error('No DB Connected')
|
||||
}
|
||||
|
||||
const result = await connection.execute(
|
||||
`BEGIN
|
||||
MANAGEFEE_SETUP_PKG.GETBASICFEERATES(:P_SPID,:p_cursor);
|
||||
END;`,
|
||||
{
|
||||
P_SPID: {
|
||||
val: P_SPID,
|
||||
type: oracledb.DB_TYPE_NUMBER,
|
||||
},
|
||||
p_cursor: {
|
||||
type: oracledb.CURSOR,
|
||||
dir: oracledb.BIND_OUT
|
||||
}
|
||||
},
|
||||
{
|
||||
outFormat: oracledb.OUT_FORMAT_OBJECT
|
||||
}
|
||||
);
|
||||
|
||||
if (result.outBinds && result.outBinds.p_cursor) {
|
||||
const cursor = result.outBinds.p_cursor;
|
||||
let rowsBatch;
|
||||
|
||||
do {
|
||||
rowsBatch = await cursor.getRows(100);
|
||||
rows = rows.concat(rowsBatch);
|
||||
} while (rowsBatch.length > 0);
|
||||
|
||||
|
||||
await cursor.close();
|
||||
} else {
|
||||
throw new Error('No cursor returned from the stored procedure');
|
||||
}
|
||||
|
||||
return rows;
|
||||
|
||||
} catch (err) {
|
||||
console.error('Error fetching users: ', err);
|
||||
throw new Error('Error fetching users');
|
||||
} finally { }
|
||||
}
|
||||
async GETBONDRATES(P_SPID: Number) {
|
||||
let connection;
|
||||
let rows = [];
|
||||
try {
|
||||
|
||||
connection = await this.oracleDBService.getConnection()
|
||||
if (!connection) {
|
||||
throw new Error('No DB Connected')
|
||||
}
|
||||
|
||||
const result = await connection.execute(
|
||||
`BEGIN
|
||||
MANAGEFEE_SETUP_PKG.GETBONDRATES(:P_SPID,:p_cursor);
|
||||
END;`,
|
||||
{
|
||||
P_SPID: {
|
||||
val: P_SPID,
|
||||
type: oracledb.DB_TYPE_NUMBER,
|
||||
},
|
||||
p_cursor: {
|
||||
type: oracledb.CURSOR,
|
||||
dir: oracledb.BIND_OUT
|
||||
}
|
||||
},
|
||||
{
|
||||
outFormat: oracledb.OUT_FORMAT_OBJECT
|
||||
}
|
||||
);
|
||||
|
||||
if (result.outBinds && result.outBinds.p_cursor) {
|
||||
const cursor = result.outBinds.p_cursor;
|
||||
let rowsBatch;
|
||||
|
||||
do {
|
||||
rowsBatch = await cursor.getRows(100);
|
||||
rows = rows.concat(rowsBatch);
|
||||
} while (rowsBatch.length > 0);
|
||||
|
||||
|
||||
await cursor.close();
|
||||
} else {
|
||||
throw new Error('No cursor returned from the stored procedure');
|
||||
}
|
||||
|
||||
return rows;
|
||||
|
||||
} catch (err) {
|
||||
console.error('Error fetching users: ', err);
|
||||
throw new Error('Error fetching users');
|
||||
} finally { }
|
||||
}
|
||||
async GETCARGORATES(P_SPID: Number) {
|
||||
let connection;
|
||||
let rows = [];
|
||||
try {
|
||||
|
||||
connection = await this.oracleDBService.getConnection()
|
||||
if (!connection) {
|
||||
throw new Error('No DB Connected')
|
||||
}
|
||||
|
||||
const result = await connection.execute(
|
||||
`BEGIN
|
||||
MANAGEFEE_SETUP_PKG.GETCARGORATES(:P_SPID,:p_cursor);
|
||||
END;`,
|
||||
{
|
||||
P_SPID: {
|
||||
val: P_SPID,
|
||||
type: oracledb.DB_TYPE_NUMBER,
|
||||
},
|
||||
p_cursor: {
|
||||
type: oracledb.CURSOR,
|
||||
dir: oracledb.BIND_OUT
|
||||
}
|
||||
},
|
||||
{
|
||||
outFormat: oracledb.OUT_FORMAT_OBJECT
|
||||
}
|
||||
);
|
||||
|
||||
if (result.outBinds && result.outBinds.p_cursor) {
|
||||
const cursor = result.outBinds.p_cursor;
|
||||
let rowsBatch;
|
||||
|
||||
do {
|
||||
rowsBatch = await cursor.getRows(100);
|
||||
rows = rows.concat(rowsBatch);
|
||||
} while (rowsBatch.length > 0);
|
||||
|
||||
|
||||
await cursor.close();
|
||||
} else {
|
||||
throw new Error('No cursor returned from the stored procedure');
|
||||
}
|
||||
|
||||
return rows;
|
||||
|
||||
} catch (err) {
|
||||
console.error('Error fetching users: ', err);
|
||||
throw new Error('Error fetching users');
|
||||
} finally { }
|
||||
}
|
||||
async GETCFFEERATES(P_SPID: Number) {
|
||||
let connection;
|
||||
let rows = [];
|
||||
try {
|
||||
|
||||
connection = await this.oracleDBService.getConnection()
|
||||
if (!connection) {
|
||||
throw new Error('No DB Connected')
|
||||
}
|
||||
|
||||
const result = await connection.execute(
|
||||
`BEGIN
|
||||
MANAGEFEE_SETUP_PKG.GETCFFEERATES(:P_SPID,:p_cursor);
|
||||
END;`,
|
||||
{
|
||||
P_SPID: {
|
||||
val: P_SPID,
|
||||
type: oracledb.DB_TYPE_NUMBER,
|
||||
},
|
||||
p_cursor: {
|
||||
type: oracledb.CURSOR,
|
||||
dir: oracledb.BIND_OUT
|
||||
}
|
||||
},
|
||||
{
|
||||
outFormat: oracledb.OUT_FORMAT_OBJECT
|
||||
}
|
||||
);
|
||||
|
||||
if (result.outBinds && result.outBinds.p_cursor) {
|
||||
const cursor = result.outBinds.p_cursor;
|
||||
let rowsBatch;
|
||||
|
||||
do {
|
||||
rowsBatch = await cursor.getRows(100);
|
||||
rows = rows.concat(rowsBatch);
|
||||
} while (rowsBatch.length > 0);
|
||||
|
||||
|
||||
await cursor.close();
|
||||
} else {
|
||||
throw new Error('No cursor returned from the stored procedure');
|
||||
}
|
||||
|
||||
return rows;
|
||||
|
||||
} catch (err) {
|
||||
console.error('Error fetching users: ', err);
|
||||
throw new Error('Error fetching users');
|
||||
} finally { }
|
||||
}
|
||||
async GETCSFEERATES(P_SPID: Number) {
|
||||
let connection;
|
||||
let rows = [];
|
||||
try {
|
||||
|
||||
connection = await this.oracleDBService.getConnection()
|
||||
if (!connection) {
|
||||
throw new Error('No DB Connected')
|
||||
}
|
||||
|
||||
const result = await connection.execute(
|
||||
`BEGIN
|
||||
MANAGEFEE_SETUP_PKG.GETCSFEERATES(:P_SPID,:p_cursor);
|
||||
END;`,
|
||||
{
|
||||
P_SPID: {
|
||||
val: P_SPID,
|
||||
type: oracledb.DB_TYPE_NUMBER,
|
||||
},
|
||||
p_cursor: {
|
||||
type: oracledb.CURSOR,
|
||||
dir: oracledb.BIND_OUT
|
||||
}
|
||||
},
|
||||
{
|
||||
outFormat: oracledb.OUT_FORMAT_OBJECT
|
||||
}
|
||||
);
|
||||
|
||||
if (result.outBinds && result.outBinds.p_cursor) {
|
||||
const cursor = result.outBinds.p_cursor;
|
||||
let rowsBatch;
|
||||
|
||||
do {
|
||||
rowsBatch = await cursor.getRows(100);
|
||||
rows = rows.concat(rowsBatch);
|
||||
} while (rowsBatch.length > 0);
|
||||
|
||||
|
||||
await cursor.close();
|
||||
} else {
|
||||
throw new Error('No cursor returned from the stored procedure');
|
||||
}
|
||||
|
||||
return rows;
|
||||
|
||||
} catch (err) {
|
||||
console.error('Error fetching users: ', err);
|
||||
throw new Error('Error fetching users');
|
||||
} finally { }
|
||||
}
|
||||
async GETEFFEERATES(P_SPID: Number) {
|
||||
let connection;
|
||||
let rows = [];
|
||||
try {
|
||||
|
||||
connection = await this.oracleDBService.getConnection()
|
||||
if (!connection) {
|
||||
throw new Error('No DB Connected')
|
||||
}
|
||||
|
||||
const result = await connection.execute(
|
||||
`BEGIN
|
||||
MANAGEFEE_SETUP_PKG.GETEFFEERATES(:P_SPID,:p_cursor);
|
||||
END;`,
|
||||
{
|
||||
P_SPID: {
|
||||
val: P_SPID,
|
||||
type: oracledb.DB_TYPE_NUMBER,
|
||||
},
|
||||
p_cursor: {
|
||||
type: oracledb.CURSOR,
|
||||
dir: oracledb.BIND_OUT
|
||||
}
|
||||
},
|
||||
{
|
||||
outFormat: oracledb.OUT_FORMAT_OBJECT
|
||||
}
|
||||
);
|
||||
|
||||
if (result.outBinds && result.outBinds.p_cursor) {
|
||||
const cursor = result.outBinds.p_cursor;
|
||||
let rowsBatch;
|
||||
|
||||
do {
|
||||
rowsBatch = await cursor.getRows(100);
|
||||
rows = rows.concat(rowsBatch);
|
||||
} while (rowsBatch.length > 0);
|
||||
|
||||
|
||||
await cursor.close();
|
||||
} else {
|
||||
throw new Error('No cursor returned from the stored procedure');
|
||||
}
|
||||
|
||||
return rows;
|
||||
|
||||
} catch (err) {
|
||||
console.error('Error fetching users: ', err);
|
||||
throw new Error('Error fetching users');
|
||||
} finally { }
|
||||
}
|
||||
async GETFEECOMM(P_SPID: Number) {
|
||||
let connection;
|
||||
let rows = [];
|
||||
try {
|
||||
|
||||
connection = await this.oracleDBService.getConnection()
|
||||
if (!connection) {
|
||||
throw new Error('No DB Connected')
|
||||
}
|
||||
|
||||
const result = await connection.execute(
|
||||
`BEGIN
|
||||
MANAGEFEE_SETUP_PKG.GETFEECOMM(:P_SPID,:p_cursor);
|
||||
END;`,
|
||||
{
|
||||
P_SPID: {
|
||||
val: P_SPID,
|
||||
type: oracledb.DB_TYPE_NUMBER,
|
||||
},
|
||||
p_cursor: {
|
||||
type: oracledb.CURSOR,
|
||||
dir: oracledb.BIND_OUT
|
||||
}
|
||||
},
|
||||
{
|
||||
outFormat: oracledb.OUT_FORMAT_OBJECT
|
||||
}
|
||||
);
|
||||
|
||||
if (result.outBinds && result.outBinds.p_cursor) {
|
||||
const cursor = result.outBinds.p_cursor;
|
||||
let rowsBatch;
|
||||
|
||||
do {
|
||||
rowsBatch = await cursor.getRows(100);
|
||||
rows = rows.concat(rowsBatch);
|
||||
} while (rowsBatch.length > 0);
|
||||
|
||||
|
||||
await cursor.close();
|
||||
} else {
|
||||
throw new Error('No cursor returned from the stored procedure');
|
||||
}
|
||||
|
||||
return rows;
|
||||
|
||||
} catch (err) {
|
||||
console.error('Error fetching users: ', err);
|
||||
throw new Error('Error fetching users');
|
||||
} finally { }
|
||||
}
|
||||
}
|
||||
@ -274,4 +274,39 @@ export class OracleController {
|
||||
return this.manageFeeService.UPDATEFEECOMM(body)
|
||||
}
|
||||
|
||||
@Get('/GetBasicFeeRates/:id')
|
||||
GetBasicFeeRates(@Param('id', ParseIntPipe) id: number) {
|
||||
return this.manageFeeService.GETBASICFEERATES(id)
|
||||
}
|
||||
|
||||
@Get('/GetBondRates/:id')
|
||||
GetBondRates( @Param('id', ParseIntPipe) id: number) {
|
||||
return this.manageFeeService.GETBONDRATES(id)
|
||||
}
|
||||
|
||||
@Get('/GetCargoRates/:id')
|
||||
GetCargoRates( @Param('id', ParseIntPipe) id: number) {
|
||||
return this.manageFeeService.GETCARGORATES(id)
|
||||
}
|
||||
|
||||
@Get('/GetCfFeeRates/:id')
|
||||
GetCfFeeRates( @Param('id', ParseIntPipe) id: number) {
|
||||
return this.manageFeeService.GETCFFEERATES(id)
|
||||
}
|
||||
|
||||
@Get('/GetCsFeeRates/:id')
|
||||
GetCsFeeRates( @Param('id', ParseIntPipe) id: number) {
|
||||
return this.manageFeeService.GETCSFEERATES(id)
|
||||
}
|
||||
|
||||
@Get('/GetEfFeeRates/:id')
|
||||
GetEfFeeRates( @Param('id', ParseIntPipe) id: number) {
|
||||
return this.manageFeeService.GETEFFEERATES(id)
|
||||
}
|
||||
|
||||
@Get('/GetFeeComm/:id')
|
||||
GetFeeComm( @Param('id', ParseIntPipe) id: number) {
|
||||
return this.manageFeeService.GETFEECOMM(id)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user