Merge branch 'master' of bitbucket.org:venbainformationtechnology/smc_cet_cibil_staging
This commit is contained in:
commit
4e1abee61d
@ -28,7 +28,8 @@ exports.SanctionAmtAndReplaceOfDeptDetailsList =async (req, res) =>
|
||||
SanctionAmtData.OutSanctionAmt_Cs.forEach((value,index) => {
|
||||
monthRange = value.dataValues.months_range;
|
||||
monthRange_aliseName = monthRange.replace(/[->]/g , '_');
|
||||
monthRangeArray.push(monthRange_aliseName);
|
||||
obj = { "key" : monthRange_aliseName , "name" : monthRange}
|
||||
monthRangeArray.push(obj);
|
||||
key_addition = index + 1;
|
||||
alisename = words[key_addition];
|
||||
select_items += ","+alisename+".amt as amt_"+monthRange_aliseName+","+alisename+".count as count_"+monthRange_aliseName+","+alisename+".opening_amt as opening_amt_"+monthRange_aliseName+","+alisename+".opening_count as opening_count_"+monthRange_aliseName+","+alisename+".closing_amt as closing_amt_"+monthRange_aliseName+","+alisename+".closing_count as closing_count_"+monthRange_aliseName+" ";
|
||||
@ -73,7 +74,8 @@ exports.EnquirySummaryDetailsList =async (req, res) =>
|
||||
EnquiryAmtData.OutEnquiryAmountCs.forEach((value,index) => {
|
||||
monthRange = value.dataValues.months_range;
|
||||
monthRange_aliseName = monthRange.replace(/[->]/g , '_');
|
||||
monthRangeArray.push(monthRange_aliseName);
|
||||
obj = { "key" : monthRange_aliseName , "name" : monthRange}
|
||||
monthRangeArray.push(obj);
|
||||
key_addition = index + 1;
|
||||
alisename = words[key_addition];
|
||||
select_items += ","+alisename+".amt as amt_"+monthRange_aliseName+","+alisename+".count as count_"+monthRange_aliseName+" ";
|
||||
@ -97,7 +99,31 @@ exports.EnquirySummaryDetailsList =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
|
||||
}); } //end of try catch
|
||||
|
||||
};
|
||||
|
||||
|
||||
exports.SummaryViewOfCreditFacilities =async (req, res) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
sequelize.query("select count(*) as total_accounts_count,count(case when overdue_amount > 0 then 1 else null end) as overdue_amount_count,count(case when current_balance = 0 then 1 else null end) as zero_balance_count,count(case when overdue_amount <= 0 then 1 else null end) as nill_overdue_amount_count,MAX(sanctioned_amount) as high_credit,SUM(current_balance) as sum_current_balance ,SUM(overdue_amount) as sum_overdue_amount ,MAX(opened_date) as latest_opened_date ,MIN(opened_date) as oldest_opened_date from out_active_and_closed_loans_details where losid = '"+req.query.losid+"' and is_active = 1").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"
|
||||
}); } //end of try catch
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -70,6 +70,26 @@ router.get("/enquirySummaryDetailsList", Cibilcontroller.EnquirySummaryDetailsLi
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @swagger
|
||||
* /api/summaryViewOfCreditFacilities:
|
||||
* get:
|
||||
* summary: summary View Of Credit Facilities
|
||||
* description:
|
||||
* parameters:
|
||||
* - in: query
|
||||
* name: losid
|
||||
* schema:
|
||||
* type: string
|
||||
* required: true
|
||||
* example: MW112233
|
||||
* responses:
|
||||
* 200:
|
||||
* description: success
|
||||
*/
|
||||
router.get("/summaryViewOfCreditFacilities", Cibilcontroller.SummaryViewOfCreditFacilities);
|
||||
|
||||
|
||||
|
||||
|
||||
// routes started here
|
||||
|
||||
Loading…
Reference in New Issue
Block a user