pd_id:GWM

This commit is contained in:
sriramv 2022-08-23 09:45:40 +05:30
parent a49daa3c39
commit 21b7fad232
2 changed files with 50 additions and 14 deletions

View File

@ -110,6 +110,15 @@ exports.PullSalesPdData = async (req, res) =>
}; };
exports.PullSalesPdPhotographsData = async (req, res) => exports.PullSalesPdPhotographsData = async (req, res) =>
{ {
try try
@ -139,6 +148,17 @@ exports.PullSalesPdPhotographsData = async (req, res) =>
}; };
exports.imageView = async (req, res) => exports.imageView = async (req, res) =>
{ {
try try
@ -153,6 +173,16 @@ exports.imageView = async (req, res) =>
} //end of try catch } //end of try catch
}; };
exports.DownloadPdReport = async (req, res) => exports.DownloadPdReport = async (req, res) =>
{ {
try try
@ -166,9 +196,9 @@ exports.DownloadPdReport = async (req, res) =>
url: url, url: url,
method: "GET" method: "GET"
}, function (error, response, body) { console.log(body); }, function (error, response, body) {
if (body != undefined) { if (body != undefined) {
data = JSON.parse(body); data = JSON.parse(body);
if ( data.status == 200) { if ( data.status == 200) {
link = data.records; link = data.records;
@ -176,7 +206,10 @@ exports.DownloadPdReport = async (req, res) =>
}else{ }else{
res.send({'status':404,'message':"failed",'data':"No data"}); res.send({'status':404,'message':"failed",'data':"No data"});
} }
}
}else{
res.send({'status':404,'message':"failed",'data':"No data"});
}
}); });
@ -232,12 +265,14 @@ exports.SectionList = async (req, res) =>
{ {
try try
{ {
applicantDetails = await ApiCallHelper.MainApplicantDetails(req.query.losid); // applicantDetails = await ApiCallHelper.MainApplicantDetails(req.query.losid);
MainApplicantDetails = JSON.parse(applicantDetails); // MainApplicantDetails = JSON.parse(applicantDetails);
// if(MainApplicantDetails.status == 200)
if(MainApplicantDetails.status == 200) // {
{ // main_loan_applicant = MainApplicantDetails.data.name;
GeneralSection.findAll({ where:{main_loan_applicant:MainApplicantDetails.data.name,is_active : 1},
pdId = req.query.pd_id;
GeneralSection.findAll({ where:{ref_no:pdId,is_active : 1},
include: [ {model: FundRequirement }, {model: DetailsOfKeyShareHolder }, {model: FinancialInformation }, {model: FinalRemarks }, {model: BriefOfBusiness }, {model: PropertyInformation }, {model: OfficerDetails }, {model: Photograph }] }) include: [ {model: FundRequirement }, {model: DetailsOfKeyShareHolder }, {model: FinancialInformation }, {model: FinalRemarks }, {model: BriefOfBusiness }, {model: PropertyInformation }, {model: OfficerDetails }, {model: Photograph }] })
.then(data => .then(data =>
{ {
@ -280,11 +315,11 @@ exports.SectionList = async (req, res) =>
res.send({'status':404,message: err.message || "Some error occurred while retrieving data" ,'data': "No data" }); res.send({'status':404,message: err.message || "Some error occurred while retrieving data" ,'data': "No data" });
}); });
} // }
else // else
{ // {
res.send({'status':404,'message':"failed",'data':"No data"}); // res.send({'status':404,'message':"failed",'data':"No data"});
} // }
} catch(err) { } catch(err) {

View File

@ -33,6 +33,7 @@ module.exports = (sequelize, DataTypes) => {
current_residence_address: { type: DataTypes.STRING }, current_residence_address: { type: DataTypes.STRING },
current_residence_ownership: { type: DataTypes.STRING }, current_residence_ownership: { type: DataTypes.STRING },
business_office_address: { type: DataTypes.STRING }, business_office_address: { type: DataTypes.STRING },
remarks: { type: DataTypes.STRING },
createdby: { type: DataTypes.INTEGER }, createdby: { type: DataTypes.INTEGER },
updatedby: { type: DataTypes.INTEGER } updatedby: { type: DataTypes.INTEGER }