GWM
This commit is contained in:
parent
2d5f73f2e8
commit
f1c5ef15d4
@ -72,7 +72,7 @@ exports.SanctionAmtAndReplaceOfDeptDetailsList =async (req, res) =>
|
||||
});
|
||||
|
||||
var query = "Select a.id,a.facility_type,a.total_amt,a.total_count,a.open_total_amt,a.open_total_count,a.closed_total_amt,a.closed_total_count "+select_items+" FROM out_sanction_amt_and_replacement_of_debt_p a "+sub_query+" WHERE a.losid = '"+req.query.losid+"' and ref_no = '"+req.query.ref_no+"'";
|
||||
console.log(query);
|
||||
|
||||
sequelize.query(query).then(async(data) => {
|
||||
SanctionData = {monthRange : monthRangeArray ,SanctionAmountData : data};
|
||||
res.send({'status':200 , message:"Success." ,'data':SanctionData});
|
||||
@ -211,8 +211,8 @@ exports.ConsolidatedSanctionAmtAndReplaceOfDeptDetailsList =async (req, res) =>
|
||||
|
||||
});
|
||||
|
||||
var query = "Select a.facility_type,SUM(a.total_amt) as total_amt,SUM(a.total_count) as total_count,SUM(a.open_total_amt) as open_total_amt,SUM(a.open_total_count) as open_total_count ,SUM(a.closed_total_amt) as closed_total_amt,SUM(a.closed_total_count) as closed_total_count "+select_items+" FROM out_sanction_amt_and_replacement_of_debt_p a "+sub_query+" WHERE a.losid = '"+req.query.losid+"' group by a.facility_type,a.total_amt,a.total_count,a.open_total_amt,a.open_total_count,a.closed_total_amt,a.closed_total_count";
|
||||
|
||||
var query = "Select a.facility_type,SUM(a.total_amt) as total_amt,SUM(a.total_count) as total_count,SUM(a.open_total_amt) as open_total_amt,SUM(a.open_total_count) as open_total_count ,SUM(a.closed_total_amt) as closed_total_amt,SUM(a.closed_total_count) as closed_total_count "+select_items+" FROM out_sanction_amt_and_replacement_of_debt_p a "+sub_query+" WHERE a.losid = '"+req.query.losid+"' group by a.facility_type";
|
||||
console.log(query);
|
||||
sequelize.query(query).then(async(data) => {
|
||||
SanctionData = {monthRange : monthRangeArray ,SanctionAmountData : data};
|
||||
res.send({'status':200 , message:"Success." ,'data':SanctionData});
|
||||
@ -257,7 +257,7 @@ exports.ConsolidatedEnquirySummaryDetailsList =async (req, res) =>
|
||||
|
||||
});
|
||||
|
||||
var query = "Select a.facility_type,SUM(a.total_amt) as total_amt,SUM(a.total_count) as total_count "+select_items+" FROM out_enquity_amount_p a "+sub_query+" WHERE a.losid = '"+req.query.losid+"' group by a.facility_type,a.total_amt,a.total_count ";
|
||||
var query = "Select a.facility_type,SUM(a.total_amt) as total_amt,SUM(a.total_count) as total_count "+select_items+" FROM out_enquity_amount_p a "+sub_query+" WHERE a.losid = '"+req.query.losid+"' group by a.facility_type ";
|
||||
|
||||
sequelize.query(query).then(async(data) => {
|
||||
EnquiryData = {monthRange : monthRangeArray ,EnquiryAmountData : data};
|
||||
@ -294,6 +294,34 @@ exports.ConsolidatedSummaryViewOfCreditFacilities =async (req, res) =>
|
||||
|
||||
|
||||
|
||||
} catch(err) {
|
||||
res.status(500).send({'status':404,
|
||||
message: err.message || "Some error occurred while inserting statements." ,'data': "No data"
|
||||
}); } //end of try catch
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
exports.EnquiryAmountSplitUp =async (req, res) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
query = "SELECT MemberReferenceNumber as ref_no,DateOfEnquiry,EnquiryPurpose,EnquiryAmount FROM con_enquiry_detail where losid ='"+req.query.losid+"' and MemberReferenceNumber = "+req.query.ref_no+" and EnquiryPurpose = '"+req.query.facility_type+"' order by DateOfEnquiry DESC";
|
||||
sequelize.query(query).then(async(data) => {
|
||||
|
||||
res.send({'status':200 , message:"Success." ,'data':data});
|
||||
|
||||
}).catch(err=>{
|
||||
|
||||
res.send({'status':400 , message: "Failed" ,'data': "Nodata"});
|
||||
})
|
||||
|
||||
|
||||
|
||||
} catch(err) {
|
||||
res.status(500).send({'status':404,
|
||||
message: err.message || "Some error occurred while inserting statements." ,'data': "No data"
|
||||
|
||||
@ -217,6 +217,37 @@ router.get("/consolidatedEnquirySummaryDetailsList", Cibilcontroller.Consolidate
|
||||
*/
|
||||
router.get("/consolidatedSummaryViewOfCreditFacilities", Cibilcontroller.ConsolidatedSummaryViewOfCreditFacilities);
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /api/enquiryAmountSplitUp:
|
||||
* get:
|
||||
* summary: Enquiry Amount Split Up
|
||||
* description:
|
||||
* parameters:
|
||||
* - in: query
|
||||
* name: losid
|
||||
* schema:
|
||||
* type: string
|
||||
* required: true
|
||||
* example: MW112233
|
||||
* - in: query
|
||||
* name: ref_no
|
||||
* schema:
|
||||
* type: integer
|
||||
* required: true
|
||||
* example: 000000
|
||||
* - in: query
|
||||
* name: facility_type
|
||||
* schema:
|
||||
* type: string
|
||||
* required: true
|
||||
* example: Other
|
||||
* responses:
|
||||
* 200:
|
||||
* description: success
|
||||
*/
|
||||
router.get("/enquiryAmountSplitUp", Cibilcontroller.EnquiryAmountSplitUp);
|
||||
|
||||
|
||||
// routes started here
|
||||
app.use('/api', router);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user