From 82ad8dbfe7a7008d7250dae279457a2b7c13d8bf Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Mon, 9 Sep 2019 16:54:22 +0530 Subject: [PATCH] Fairoj: IMGC changes and PD Report issue resolved --- .../list-pd/add-pd/add-pd.component.html | 6 +- .../list-pd/add-pd/add-pd.component.ts | 22 +++++-- .../edit-pd-master.component.html | 7 +- .../edit-pd-master.component.ts | 27 +++++++- .../pd-report/pd-report.component.html | 13 ++-- .../list-pd/pd-report/pd-report.component.ts | 65 ++++++++++++++++--- .../list-pd/view-pd/view-pd.component.html | 4 +- .../list-pd/view-pd/view-pd.component.ts | 3 +- .../pd-service/pd-triger.service.ts | 13 ++++ 9 files changed, 134 insertions(+), 26 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html index dd8aa1f..76a2d0e 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html @@ -58,7 +58,11 @@ - + + + Select + {{insti.institute_name}} +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts index 3b595d9..feb608c 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts @@ -60,6 +60,7 @@ export class AddPdComponent implements OnInit, OnDestroy { @ViewChild(AdminLayoutComponent) adminLayout:AdminLayoutComponent; loadControl: boolean; + finInstitutionList: any; constructor(notifier: NotifierService, private _fb: FormBuilder, private route: ActivatedRoute, private router: Router, private _pd: PdTrigerService, private _aws: AwsService, private ListPdComponent: ListPdComponent, private titleCase : TitleCasePipe,private userService:UserService) { @@ -77,23 +78,36 @@ export class AddPdComponent implements OnInit, OnDestroy { this.ListPdComponent.showListView(false); this.getUserDetails(); - this.getProductsList(); - this.getCustomerSegmentList(); + // this.getProductsList(); + // this.getCustomerSegmentList(); this.getStateCityList(); - this.getPDTypeList(); + // this.getPDTypeList(); + this.getRelationMaster(); this.getTitleMaster(); } + getProCusType(){ + console.log("u",this.userDetails) + this._pd.getEntityPreferences(this.userDetails.fk_entity_id).subscribe(Response=>{ + if(Response['dataStatus']){ + this.pdTypeList=Response['records'].pd_types + this.customerSegmentAllList=Response['records'].customer_segments + this.productAllList=Response['records'].products + this.finInstitutionList=Response['records'].financial_institutions + } + this.loadFormData(); + }) + } getUserDetails(){ this.userService.getroles().subscribe(res=>{ if(res['dataStatus']){ this.userDetails=res['records'][0]; } // console.log(this.userDetails) - this.loadFormData(); + this.getProCusType() this.sales_and_credit_person.credit_person=[{userid:this.userDetails.userid,user_name:this.userDetails.user_first_name+' '+this.userDetails.user_last_name}] }) } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html index a19ae03..a795359 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.html @@ -64,7 +64,12 @@ - + + + + Select + {{insti.institute_name}} + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts index ec9f829..87dceb6 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/edit-pd-master/edit-pd-master.component.ts @@ -65,9 +65,11 @@ export class EditPdMasterComponent implements OnInit { sales_and_credit_person: any=[]; userDetails: any; + finInstitutionList: any=[]; constructor(private _fb: FormBuilder, private _pd: PdTrigerService, notifier: NotifierService,private dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: any,private titleCase : TitleCasePipe,private userService:UserService) { + // console.log("hsdf",this.data) this.notifier=notifier this.currentPDStatus = data.records.pd_status; this.pdid = data.records.pd_id; @@ -79,7 +81,7 @@ export class EditPdMasterComponent implements OnInit { } ngOnInit() { - this.getProductsList() + // this.getProductsList() // this.draftStatus="DRAFT"; // this.PDTriggerStatus="TRIGGERED"; @@ -87,7 +89,7 @@ export class EditPdMasterComponent implements OnInit { // this.getProductsList(); this.getStateCityList(); - this.getPDTypeList(); + // this.getPDTypeList(); // this.getAddresses(); this.applicantLength=this.data.applicantLength; @@ -100,9 +102,30 @@ export class EditPdMasterComponent implements OnInit { } // console.log(this.userDetails) // this.loadFormData(); + this.getProCusType() this.sales_and_credit_person.credit_person=[{userid:this.userDetails.userid,user_name:this.userDetails.user_first_name+' '+this.userDetails.user_last_name}] }) } + getProCusType(){ + console.log("u",this.userDetails) + this._pd.getEntityPreferences(this.userDetails.fk_entity_id).subscribe(Response=>{ + if(Response['dataStatus']){ + this.pdTypeList=Response['records'].pd_types + this.customerSegmentAllList=Response['records'].customer_segments + this.productAllList=Response['records'].products + if(this.data.records.fk_product_id){ + // console.log(this.data.fk_product_id) + // console.log("vv",this.productAllList.filter(val=>val.product_id == this.data.records.fk_product_id).length > 0) + if(this.productAllList.filter(val=>val.product_id == this.data.records.fk_product_id).length > 0){ + this.getSubproductList(this.data.records.fk_product_id,1); + } + } + this.finInstitutionList=Response['records'].financial_institutions + } + this.getLenderList(); + // this.loadFormData(); + }) + } getLenderList(){ this._pd.getLenderDetails().subscribe( diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.html index 9d99fce..b35947b 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.html @@ -13,7 +13,7 @@
- +
@@ -36,7 +36,7 @@ - + PD Report + +
@@ -51,10 +53,11 @@ - - + + - + +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.ts index 7c53516..feaa0db 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-report/pd-report.component.ts @@ -38,7 +38,7 @@ export class PdReportComponent implements OnInit { public reGenerateBtn: Boolean = false; public pdReportVersionList = []; // public src; - pdReportRecords: any; + pdReportRecords: any=''; latestPDDetails: any; message: any; selectedIndex: Number; @@ -58,7 +58,7 @@ export class PdReportComponent implements OnInit { let encryptReportRandomString = this.route.snapshot.params['string']; this.reportRandomString = this.apiUrl+'getPDReportHTML/'+encryptReportRandomString+'/'+this.startPD; - console.log("dd",this.reportRandomString) + // console.log("dd",this.reportRandomString) this.getPdReportDetails(); // this.src = 'https://lender7.s3.ap-south-1.amazonaws.com/pd1/pd_report_original_version.pdf?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ3QDSPT3LDSWRYUQ%2F20181210%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20181210T073026Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=35aa183cbbfc835f96719a5e9aa552c79b3a1b7d8bca043f7d738d730755dcbb'; // this.src = this.sanitizer.bypassSecurityTrustResourceUrl("https://lender7.s3.ap-south-1.amazonaws.com/pd1/pd_report_original_version.pdf?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ3QDSPT3LDSWRYUQ%2F20181210%2Fap-south-1%2Fs3%2Faws4_request&X-Amz-Date=20181210T053116Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=6e25703a1e339dd5f081fa8aca5b8b2d81ba161d8cfd708759de899abf72146b"); @@ -70,18 +70,12 @@ export class PdReportComponent implements OnInit { } ngAfterViewInit(){ - let encryptReportRandomString = this.route.snapshot.params['string']; - this.pdTrigerService.getPDReportHTML(encryptReportRandomString,this.startPD).subscribe(response=>{ - - this.dataContainer.nativeElement.innerHTML = response - console.log("data",this.dataContainer) - // this.loadComponent=true - }) + } ngOnInit() { this.listPDComponent.showListView(false); - this.getPdReportVersionList(); + // this.getPdReportVersionList(); // start // end @@ -98,6 +92,16 @@ export class PdReportComponent implements OnInit { // this.previous = 2; } + getHTMLPDReport(){ + let encryptReportRandomString = this.route.snapshot.params['string']; + this.pdTrigerService.getPDReportHTML(encryptReportRandomString,this.startPD).subscribe(response=>{ + + this.dataContainer.nativeElement.innerHTML = response + // console.log("data",this.dataContainer) + // this.loadComponent=true + }) + } + isMac(): boolean { let bool = false; @@ -157,6 +161,7 @@ export class PdReportComponent implements OnInit { this.qcStatus = data.records.pdstatus; // alert(JSON.stringify(this.latestPDDetails)); this.reGenerateBtn = true; + this.getHTMLPDReport() } else { // this.reGenerateBtn = true; this.generateBtn = true; @@ -172,6 +177,7 @@ export class PdReportComponent implements OnInit { if (data.status == 200) { // this.pdReportRecords = data.records.question_answers; this.pdReportRecords = data.records; + this.getPdReportVersionList() // this.pdReportRecords = data.records.qu; } }, err => { @@ -320,6 +326,43 @@ export class PdReportComponent implements OnInit { } }) } + + downloadPDReport(){ + let data = { + "pd_id": this.startPD, + "random_string":this.route.snapshot.params['string'] + }; + this.pdTrigerService.generatePDReportPDF(data).subscribe(data => { + if (data.dataStatus) { + window.open(data.records); + this.notifier.notify('success', 'Done Successfully..!'); + } else { + this.notifier.notify('warning', 'Something Went Wrong Try Again.!'); + } + }, err => { + this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (err.error_type == 2 ? err.error_status + ' ( ' + err.error_text + ' ) ' : ' ( ' + err.error_text + ' ) ') +'\" Error Occur.!'); + // alert(err.html_format); + }); + } + + archivePDImages(){ + let data = { + "pd_id": this.startPD, + "form_id":"", + "random_string":this.route.snapshot.params['string'] + }; + this.pdTrigerService.archivePDImages(data).subscribe(data => { + if (data.dataStatus) { + window.open(data.records); + this.notifier.notify('success', 'Downloaded Successfully..!'); + } else { + this.notifier.notify('warning', 'Something Went Wrong Try Again.!'); + } + }, err => { + this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (err.error_type == 2 ? err.error_status + ' ( ' + err.error_text + ' ) ' : ' ( ' + err.error_text + ' ) ') +'\" Error Occur.!'); + // alert(err.html_format); + }); + } } @@ -360,4 +403,6 @@ export class DialogChangeCurrentVenrsion implements OnInit { this.dialogRef.close(confim); } + + } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html index d16bcbe..a9a6133 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html @@ -378,7 +378,7 @@ - + PD History
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts index db8213c..ed349b1 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts @@ -357,6 +357,7 @@ export class ViewPdComponent implements OnInit, OnDestroy { directTriggerPD(data: any, masterdetail: any) { let pdid = masterdetail.pd_id; + let random_string=masterdetail.random_string let getValues = data.filter(val => val).map(Val => Val); this.FilteredFieldNames = getValues.map(x => { let findIndex = this.localMandatoryFields.map(val => val.backEnd_FieldName).indexOf(x); @@ -368,7 +369,7 @@ export class ViewPdComponent implements OnInit, OnDestroy { this.editPdMaster(masterdetail, this.localcount); } else { - let lenderMasterArray = { "pd_id": pdid } + let lenderMasterArray = { "pd_id": pdid,random_string:random_string } this._pd.editPdMasterDetails(lenderMasterArray, this.pdStatusCheck.TRIGGERED).subscribe(result => { if (result.status == 200) { this.notifier.notify('success', 'PD Status Updated.'); diff --git a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts index 3628b4c..a04b023 100755 --- a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts +++ b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts @@ -758,5 +758,18 @@ export class PdTrigerService { getPDReportPDFpreview(random_string,pd_id,htmlData){ return this._http.post(this.apiUrl+'getPDReportPDFpreview/'+random_string+'/'+pd_id,{records:{"pdid":pd_id,"myData":htmlData}},{responseType:'json'}) } +//FOR TRIGGER PD PAGE MASTER FOR PRODUCT,CUS SEG,PD TYPE + getEntityPreferences(entity_id){ + return this._http.get(this.apiUrl+'getEntityPreferences/'+entity_id) + } + +//FOR REPORT +generatePDReportPDF(pdId: any): Observable { + pdId.fk_createdby = this._aws.getlocale(); + return this._http.post(this.apiUrl + "generatePDReportPDF", { "records": pdId }); +} +archivePDImages(Dtl : any): Observable { + return this._http.post(this.apiUrl + "archivePDImages", { "records": Dtl }); +} }