@ -17,6 +17,7 @@ import au.com.royalpay.payment.manage.customers.core.CouponValidateService;
import au.com.royalpay.payment.manage.device.core.DeviceManager ;
import au.com.royalpay.payment.manage.fund.core.impls.XPlanFundConfigServiceImpl ;
import au.com.royalpay.payment.manage.kyc.core.KycService ;
import au.com.royalpay.payment.manage.kyc.enums.FilesAuthStatusEnum ;
import au.com.royalpay.payment.manage.kyc.enums.FilesAuthTypeEnum ;
import au.com.royalpay.payment.manage.management.clearing.core.CleanService ;
import au.com.royalpay.payment.manage.mappers.client.AuthAppMessageMapper ;
@ -224,6 +225,8 @@ public class RetailAppServiceImp implements RetailAppService {
@Resource
private ClientFilesMapper clientFilesMapper ;
@Resource
private RetailAppService retailAppService ;
@Resource
private DeviceManager deviceManager ;
private final String CBBANK_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2019/08/05/1564972204689_uwZvpTBjtLUMcN8c540xcZvux1Rd3O.pdf" ;
private final String IMG_AGGREGATE_FILE = "https://file.royalpay.com.au/open/2019/10/22/1571723034726_5xK6A0FGv5aQPbMIDJzXJrUPKHFutv.pdf" ;
@ -2524,6 +2527,8 @@ public class RetailAppServiceImp implements RetailAppService {
return null ;
}
if ( complianceFilesNotice ! = null ) {
JSONObject complianceStatus = retailAppService . getClientAuthFileStatus ( device ) ;
complianceFilesNotice . putAll ( complianceStatus ) ;
supplement_array . add ( complianceFilesNotice ) ;
}
if ( kycFilesNotice ! = null ) {
@ -2546,6 +2551,9 @@ public class RetailAppServiceImp implements RetailAppService {
JSONObject file = checkKycFileStatusForApp ( client ) ;
JSONObject compliance = clientComplianceCompanyMapper . findKycFileByClientId ( device . getIntValue ( "client_id" ) ) ;
file . put ( "file_company" , compliance ) ;
if ( compliance ! = null ) {
file . put ( "id_type" , compliance . getString ( "id_type" ) ) ;
}
return file ;
}
@ -2562,7 +2570,8 @@ public class RetailAppServiceImp implements RetailAppService {
result . put ( "help_success" , messageSource . getMessage ( "client.auth.file.help_success" , null , RequestEnvironment . getLocale ( ) ) ) ;
result . put ( "client_less_file" , lessKycFiles ) ;
if ( lessKycFiles ) {
JSONObject compliance = clientComplianceCompanyMapper . findKycFileByClientId ( client . getIntValue ( "client_id" ) ) ;
if ( lessKycFiles | | compliance ! = null ) {
List < JSONObject > kycFiles = new ArrayList < > ( ) ;
kycFiles = clientFilesMapper . findKycClientFileByClient ( client . getIntValue ( "client_id" ) ) ;
for ( JSONObject file : kycFiles ) {
@ -2593,19 +2602,22 @@ public class RetailAppServiceImp implements RetailAppService {
JSONObject complianceFilesNotice = new JSONObject ( ) ;
JSONObject complianceFileStatus = signInAccountService . checkAuthFileStatus ( client ) ;
if ( ! complianceFileStatus . getBoolean ( "client_less_file" ) ) {
/ * if ( ! complianceFileStatus . getBoolean ( "client_less_file" ) ) {
return null ;
}
} * /
JSONObject compliance = clientComplianceCompanyMapper . findFileByClientId ( account . getIntValue ( "client_id" ) ) ;
complianceFilesNotice . put ( "auth_type" , FilesAuthTypeEnum . COMPLIANCE . getAuthType ( ) ) ;
complianceFilesNotice . put ( "type" , messageSource . getMessage ( "client.auth.file.compliance.type" , null , RequestEnvironment . getLocale ( ) ) ) ;
complianceFilesNotice . put ( "deadline" , "2020-01-31" ) ;
/* complianceFilesNotice.put("root_url","111");*/
/*complianceFilesNotice.put("deadline","2020-01-31");*/
/* complianceFilesNotice.put("root_url","111");*/
complianceFilesNotice . put ( "client_less_file" , complianceFileStatus . getBoolean ( "client_less_file" ) ) ;
if ( compliance ! = null ) {
complianceFilesNotice . put ( " refused _reason", compliance . getString ( "description" ) ) ;
complianceFilesNotice . put ( " client_ refuse_reason", compliance . getString ( "description" ) ) ;
complianceFilesNotice . put ( "status" , compliance . getString ( "status" ) ) ;
complianceFilesNotice . put ( "status_type" , FilesAuthStatusEnum . STATUS . getAuthStatus ( compliance . getIntValue ( "status" ) ) ) ;
} else {
complianceFilesNotice . put ( "status_type" , FilesAuthStatusEnum . STATUS . getAuthStatus ( - 1 ) ) ;
}
return complianceFilesNotice ;
@ -2616,18 +2628,21 @@ public class RetailAppServiceImp implements RetailAppService {
JSONObject kycFileStatus = signInAccountService . checkKycFileStatusForApp ( client , account ) ;
JSONObject compliance = clientComplianceCompanyMapper . findKycFileByClientId ( account . getIntValue ( "client_id" ) ) ;
if ( ! kycFileStatus . getBoolean ( "client_less_file" ) ) {
/ * if ( ! kycFileStatus . getBoolean ( "client_less_file" ) ) {
return null ;
}
} * /
kycFilesNotice . put ( "auth_type" , FilesAuthTypeEnum . KYC . getAuthType ( ) ) ;
kycFilesNotice . put ( "type" , messageSource . getMessage ( "client.auth.file.kyc.type" , null , RequestEnvironment . getLocale ( ) ) ) ;
kycFilesNotice . put ( "deadline" , "2020-01-31" ) ;
/* kycFilesNotice.put("deadline", "2020-01-31");*/
/* kycFilesNotice.put("root_url","111");*/
kycFilesNotice . put ( "client_less_file" , kycFileStatus . getBoolean ( "client_less_file" ) ) ;
if ( compliance ! = null ) {
kycFilesNotice . put ( " refused _reason", compliance . getString ( "description" ) ) ;
kycFilesNotice . put ( " client_ refuse_reason", compliance . getString ( "description" ) ) ;
kycFilesNotice . put ( "status" , compliance . getString ( "status" ) ) ;
kycFilesNotice . put ( "status_type" , FilesAuthStatusEnum . STATUS . getAuthStatus ( compliance . getIntValue ( "status" ) ) ) ;
} else {
kycFilesNotice . put ( "status_type" , FilesAuthStatusEnum . STATUS . getAuthStatus ( - 1 ) ) ;
}
return kycFilesNotice ;
}