@ -1141,16 +1141,28 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clientInfoCacheSupport . clearClientCache ( client . getIntValue ( "client_id" ) ) ;
}
public void createKycAuthStatus ( JSONObject manager , JSONObject client ) {
JSONObject fileComp = new JSONObject ( ) ;
fileComp . put ( "client_id" , client . getIntValue ( "client_id" ) ) ;
fileComp . put ( "submit_time" , new Date ( ) ) ;
fileComp . put ( "status" , 1 ) ;
fileComp . put ( "source" , 2 ) ;
fileComp . put ( "commit_by_id" , manager . getString ( "display_name" ) ) ;
fileComp . put ( "type" , 2 ) ;
fileComp . put ( "is_valid" , 1 ) ;
clientComplianceCompanyMapper . save ( fileComp ) ;
private void createKycAuthStatus ( JSONObject manager , JSONObject client ) {
JSONObject compliance = clientComplianceCompanyMapper . findKycFileByClientId ( client . getIntValue ( "client_id" ) ) ;
if ( compliance ! = null ) {
compliance . put ( "client_id" , client . getIntValue ( "client_id" ) ) ;
compliance . put ( "submit_time" , new Date ( ) ) ;
compliance . put ( "status" , 1 ) ;
compliance . put ( "source" , 2 ) ;
compliance . put ( "commit_by_id" , manager . getString ( "display_name" ) ) ;
compliance . put ( "type" , 2 ) ;
compliance . put ( "is_valid" , 1 ) ;
clientComplianceCompanyMapper . update ( compliance ) ;
} else {
compliance = new JSONObject ( ) ;
compliance . put ( "client_id" , client . getIntValue ( "client_id" ) ) ;
compliance . put ( "submit_time" , new Date ( ) ) ;
compliance . put ( "status" , 1 ) ;
compliance . put ( "source" , 2 ) ;
compliance . put ( "commit_by_id" , manager . getString ( "display_name" ) ) ;
compliance . put ( "type" , 2 ) ;
compliance . put ( "is_valid" , 1 ) ;
clientComplianceCompanyMapper . save ( compliance ) ;
}
}
@Override
@ -3395,6 +3407,16 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clientModifySupport . processClientModify ( new DisableModify ( manager , clientMoniker , true ) ) ;
}
@Override
public void updateClientIdInfo ( String clientMoniker , JSONObject params , JSONObject manager ) {
JSONObject client = getClientInfoByMoniker ( clientMoniker ) ;
if ( client = = null ) {
throw new InvalidShortIdException ( ) ;
}
params . put ( "display_name" , manager . getString ( "display_name" ) ) ;
clientApproveIdInfo ( params , client ) ;
}
@Override
public void checkTodo ( JSONObject manager , List < TodoNotice > notices ) {
if ( ManagerRole . OPERATOR . hasRole ( manager . getIntValue ( "role" ) ) ) {
@ -3449,7 +3471,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
}
}
JSONObject compliance = clientComplianceCompanyMapper . findKycFileByClientId ( client . getIntValue ( "client_id" ) ) ;
if ( compliance ! = null ) {
fileJson . putAll ( compliance ) ;
}
fileJson . put ( "beneficiary_id_title_list" , "Ultimate beneficiary owner,CEO,Director,General Manager,Other" ) ;
return fileJson ;
}
@ -3492,6 +3518,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
}
}
JSONObject compliance = clientComplianceCompanyMapper . findKycFileByClientId ( client . getIntValue ( "client_id" ) ) ;
if ( compliance ! = null ) {
fileJson . putAll ( compliance ) ;
}
fileJson . put ( "beneficiary_id_title_list" , "Ultimate beneficiary owner,CEO,Director,General Manager,Other" ) ;
return fileJson ;
}
@ -3599,6 +3630,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
// client.put("approve_result", 3);
// clientMapper.update(client);
// }
JSONObject params = filesInfo . toIdInfoJson ( ) ;
if ( params ! = null ) {
params . put ( "display_name" , manager . getString ( "display_name" ) ) ;
clientApproveIdInfo ( params , client ) ;
}
}
@Override
@ -5101,6 +5137,8 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
} catch ( WechatException e ) {
logger . error ( "Wechat Message Error,open_status=1" + e . getMessage ( ) ) ;
publisher . publishEvent ( new WechatExceptionEvent ( this , e , "Audit,open_status=1,openid=" + wxopenid ) ) ;
} catch ( Exception e ) {
logger . error ( "Wechat Message Error,open_status=1" + e . getMessage ( ) ) ;
}
}
}
@ -5705,7 +5743,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
public void applyToCompliance ( String client_moniker , JSONObject client_account ) {
public void applyToCompliance ( String client_moniker , JSONObject client_account , JSONObject params ) {
JSONObject client = getClientInfoByMoniker ( client_moniker ) ;
if ( client = = null ) {
throw new InvalidShortIdException ( ) ;
@ -5752,6 +5790,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client . put ( "open_status" , 4 ) ;
clientModifySupport . processClientModify ( openStatusModify ) ;
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , open_status_from , 4 , "自助开通商户提交compliance审核" , client_account ) ;
if ( params ! = null ) {
params . put ( "display_name" , client_account . getString ( "display_name" ) ) ;
clientApproveIdInfo ( params , client ) ;
}
if ( client_account ! = null ) {
// sendMessagetoCompliance(client, manager.getString("display_name"));
sendCommissionWechatMessage ( client ) ;
@ -6352,11 +6395,18 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if ( client = = null ) {
throw new InvalidShortIdException ( ) ;
}
if ( client . getIntValue ( "approve_result" ) = = 1 & & ( "PINE" . equals ( client . getString ( "client_moniker" ) )
| | "LEOH" . equals ( client . getString ( "client_moniker" ) ) ) ) {
if ( ( client . getIntValue ( "approve_result" ) = = 2 | | client . getIntValue ( "open_status" ) = = 10 | | client . getIntValue ( "approve_result" ) = = 1 | | client . getIntValue ( "open_status" ) = = 5 ) ) {
boolean lessKycFiles = isPartnerKycfilesComplete ( partner . getString ( "client_moniker" ) ) ;
partner . put ( "lessKycFiles" , lessKycFiles ) ;
partner . put ( "lessComplianceFiles" , signInAccountService . checkAuthFileStatus ( partner . getJSONObject ( "client" ) ) . getBoolean ( "client_less_file" ) ) ;
partner . put ( "lessComplianceFiles" , signInAccountService . checkAuthFileStatus ( partner . getJSONObject ( "client" ) ) . getBoolean ( "client_less_file" ) ) ;
}
partner . put ( "lessKycFiles" , false ) ;
partner . put ( "lessComplianceFiles" , false ) ;
//todo debug
if ( "PINE" . equals ( partner . getString ( "client_moniker" ) ) | | "LEOH" . equals ( partner . getString ( "client_moniker" ) ) ) {
partner . put ( "lessKycFiles" , isPartnerKycfilesComplete ( partner . getString ( "client_moniker" ) ) ) ;
partner . put ( "lessComplianceFiles" , signInAccountService . checkAuthFileStatus ( partner . getJSONObject ( "client" ) ) . getBoolean ( "client_less_file" ) ) ;
}
return partner ;
}
@ -6478,4 +6528,34 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return svcMchBean ;
}
private void clientApproveIdInfo ( JSONObject params , JSONObject client ) {
if ( StringUtils . isBlank ( params . getString ( "id_type" ) ) ) {
params . remove ( "id_type" ) ;
}
if ( StringUtils . isBlank ( params . getString ( "beneficiary_id_title" ) ) ) {
params . remove ( "beneficiary_id_title" ) ;
}
if ( StringUtils . isBlank ( params . getString ( "other_id_title_desc" ) ) ) {
params . remove ( "other_id_title_desc" ) ;
}
JSONObject compliance = clientComplianceCompanyMapper . findKycFileByClientId ( client . getIntValue ( "client_id" ) ) ;
if ( compliance ! = null ) {
params . put ( "submit_time" , new Date ( ) ) ;
params . put ( "commit_by_id" , params . getString ( "display_name" ) ) ;
params . put ( "status" , 1 ) ;
compliance . putAll ( params ) ;
clientComplianceCompanyMapper . update ( compliance ) ;
} else {
params . put ( "client_id" , client . getIntValue ( "client_id" ) ) ;
params . put ( "submit_time" , new Date ( ) ) ;
params . put ( "status" , 1 ) ;
params . put ( "source" , 2 ) ;
params . put ( "commit_by_id" , params . getString ( "display_name" ) ) ;
params . put ( "type" , 2 ) ;
params . put ( "is_valid" , 1 ) ;
clientComplianceCompanyMapper . save ( params ) ;
}
}
}