suseendhiran
This commit is contained in:
parent
a100f01283
commit
4a544eca9a
@ -18,10 +18,10 @@ exports.PullCreditPdData = async (req, res) => {
|
|||||||
GenInfoObj = {};
|
GenInfoObj = {};
|
||||||
temp_array = [];
|
temp_array = [];
|
||||||
// create creditGeneralInormationData
|
// create creditGeneralInormationData
|
||||||
Object.assign(obj, { ref_no: req.body.pdid , product :req.body.product , case_no :req.body.caseno});
|
Object.assign(obj, { ref_no: tempData[0].pdid , product :tempData[0].product , case_no :tempData[0].caseno});
|
||||||
PDID = await CreditGeneralInformation.create(obj)
|
PDID = await CreditGeneralInformation.create(obj);
|
||||||
logMsg.info("GeneralInformation insert success ,PdId= "+PDID.dataValues.pd_id);
|
logMsg.info("GeneralInformation insert success ,PdId= "+PDID.dataValues.pd_id);
|
||||||
for (var [OverallKey, OverallValue] of Object.entries(tempData)) {
|
for (var [OverallKey, OverallValue] of Object.entries(tempData[0].data)) {
|
||||||
table_name = await CreditFilterTable.findAll({ raw: true, attributes: [ 'table_name'], where : { section : OverallKey , is_active : 1 } , group: ['table_name']})
|
table_name = await CreditFilterTable.findAll({ raw: true, attributes: [ 'table_name'], where : { section : OverallKey , is_active : 1 } , group: ['table_name']})
|
||||||
obj = { };
|
obj = { };
|
||||||
temp_array.length = 0 ;
|
temp_array.length = 0 ;
|
||||||
@ -55,14 +55,16 @@ exports.PullCreditPdData = async (req, res) => {
|
|||||||
{
|
{
|
||||||
temp_array.forEach(async(element) => {
|
temp_array.forEach(async(element) => {
|
||||||
Object.assign(element , {pd_id : PDID.dataValues.pd_id} ); Object.assign(element ,obj );
|
Object.assign(element , {pd_id : PDID.dataValues.pd_id} ); Object.assign(element ,obj );
|
||||||
var index = table_name[0].table_name; var tableName = arr[index]
|
var index = table_name[0].table_name;
|
||||||
|
var tableName = arr[index];
|
||||||
await tableName.create(element); logMsg.info(OverallKey+" insert success ,PdId= "+PDID.dataValues.pd_id);
|
await tableName.create(element); logMsg.info(OverallKey+" insert success ,PdId= "+PDID.dataValues.pd_id);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Object.assign(obj , {pd_id : PDID.dataValues.pd_id} );
|
Object.assign(obj , {pd_id : PDID.dataValues.pd_id} );
|
||||||
var index = table_name[0].table_name; var tableName = arr[index]
|
var index = table_name[0].table_name;
|
||||||
|
var tableName = arr[index];
|
||||||
tableName.create(obj);logMsg.info(OverallKey+" insert success ,PdId= "+PDID.dataValues.pd_id);
|
tableName.create(obj);logMsg.info(OverallKey+" insert success ,PdId= "+PDID.dataValues.pd_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -238,12 +240,59 @@ exports.GetCreditPdData = async (req, res) =>
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
// // test
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// exports.GetCreditPdData__1 = async (req, res) =>
|
||||||
|
// {
|
||||||
|
// try
|
||||||
|
// {
|
||||||
|
// applicantDetails = await Credit_PdHelper.MainApplicantDetails(req.query.losid);
|
||||||
|
// MainApplicantDetails = JSON.parse(applicantDetails);
|
||||||
|
// if(MainApplicantDetails.status == 200)
|
||||||
|
// {
|
||||||
|
// CreditGeneralInformation.findAll({ where : { pd_id :407,is_active : 1},
|
||||||
|
// include : [
|
||||||
|
// {model: CreditAddressDetail }, {model: CreditFuturePlans },
|
||||||
|
// {model : CreditBorrowerAndGuarantorDetails },
|
||||||
|
// {model: CreditBusinessAndPersonalBankingDetails }, {model: BusinessAsset },
|
||||||
|
// {model: CreditFinancialInformation }, {model: CreditKeyShareholder },
|
||||||
|
// {model: CreditKeyProductBusinessContribution }, {model: EmployeeStrength },
|
||||||
|
// {model: ClientDetail }, {model: StockDetail },
|
||||||
|
// {model: CreditExistingLoanObligation },
|
||||||
|
// {model: FamilyMemberInvolvedInBusiness },
|
||||||
|
// {model : CreditManager },
|
||||||
|
// {model: Photograph },
|
||||||
|
// {model: CreditFinalRemarks }, {model: CreditLoanDetail },
|
||||||
|
// {model: CreditGeneralBusinessInformation },
|
||||||
|
// {model: SupplierDetail }
|
||||||
|
// ]
|
||||||
|
// })
|
||||||
|
// .then((data)=>{
|
||||||
|
// if (data.length > 0)
|
||||||
|
// {
|
||||||
|
// res.send({'status':200,'message':"success",'data':data});
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// res.send({'status':404,'message':"failed",'data':"No data"});
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// res.send({'status':404,'message':"failed",'data':"No data"});
|
||||||
|
// }
|
||||||
|
|
||||||
|
// } catch(err) {
|
||||||
|
// res.status(500).send({'status':404,
|
||||||
|
// message: err.message || "Some error occurred while inserting statements." ,'data': "No data"
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
|
// };
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -189,7 +189,7 @@ router.get('/imageView',CreditPdController.imageView);
|
|||||||
router.get('/GetCreditPdData',CreditPdController.GetCreditPdData)
|
router.get('/GetCreditPdData',CreditPdController.GetCreditPdData)
|
||||||
|
|
||||||
|
|
||||||
|
// router.get('/GetCreditPdData__1',CreditPdController.GetCreditPdData__1)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user