@ -328,6 +328,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
private RPayMerchantMapper rPayMerchantMapper ;
@Resource
private SysClientUpayProfileMapper sysClientUpayProfileMapper ;
@Resource
private ClientCardFlowMapper clientCardFlowMapper ;
@Resource
private SmsSender smsSender ;
private static final String SOURCE_AGREE_FILE = "source_agree_file" ;
@ -434,7 +438,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
client . putAll ( clientConfig ) ;
JSONObject upayInfo = sysClientUpayProfileMapper . findInfo ( client . getIntValue ( "client_id" ) ) ;
if ( null ! = upayInfo ) {
client . putAll ( upayInfo ) ;
}
client . put ( "unsubscribe" , mailUnsubMapper . findOneByClientMoniker ( clientMoniker ) = = null ? false : true ) ;
client . put ( "show_all_permission" , true ) ;
int role = manager ! = null ? manager . getIntValue ( "role" ) : 0 ;
@ -488,12 +494,24 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client . put ( "min_customer_surcharge_rate" , client . getBigDecimal ( "rate_value" ) . add ( new BigDecimal ( "0.1" ) ) ) ;
}
// 商户 审核过程日志
PageList < JSONObject > audit_logs = clientAuditProcessMapper . getAuditLog ( client . getIntValue ( "client_id" ) ,
// 商户 跨境支付 审核过程日志
PageList < JSONObject > audit_logs = clientAuditProcessMapper . getAuditLog ( client . getIntValue ( "client_id" ) , 1 ,
new PageBounds ( Order . formString ( "create_time" ) ) ) ;
if ( audit_logs ! = null & & ! audit_logs . isEmpty ( ) ) {
client . put ( "audit_logs" , audit_logs ) ;
}
//商户卡支付审核过程日志
PageList < JSONObject > audit_card_logs = clientAuditProcessMapper . getAuditLog ( client . getIntValue ( "client_id" ) , 2 ,
new PageBounds ( Order . formString ( "create_time" ) ) ) ;
if ( audit_card_logs ! = null & & ! audit_card_logs . isEmpty ( ) ) {
client . put ( "audit_card_logs" , audit_card_logs ) ;
}
//插入卡支付审核状态
JSONObject cardFlowInfo = clientCardFlowMapper . findClient ( client . getInteger ( "client_id" ) ) ;
if ( null ! = cardFlowInfo ) {
client . put ( "card_flow_info" , cardFlowInfo ) ;
}
//HF支付链接二维码
if ( client . getString ( "hf_pay_url" ) ! = null ) {
@ -568,6 +586,10 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
partner . put ( "expiry_time" , DateUtils . addDays ( partner . getDate ( "approve_time" ) , authDays ) ) ;
partner . put ( "pass_timeout" , DateUtils . addDays ( partner . getDate ( "approve_time" ) , authDays ) . compareTo ( new Date ( ) ) < 0 ) ;
}
JSONObject cardFlowInfo = clientCardFlowMapper . findClient ( partner . getInteger ( "client_id" ) ) ;
if ( null ! = cardFlowInfo ) {
partner . put ( "card_approve_flow_info" , cardFlowInfo ) ;
}
}
return PageListUtils . buildPageListResult ( partners ) ;
}
@ -1161,30 +1183,71 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clientModifySupport . processClientModify ( auditModify ) ;
sendCommissionWechatMessage ( client ) ; // wxMessage
if ( pass = = 1 ) {
createKycAuthStatus ( manager , client ) ;
createKycAuthStatus ( manager , client ) ;
clientModifySupport . processClientConfigModify ( new SwitchPermissionModify ( manager , clientMoniker , "skip_clearing" , false ) ) ;
if ( client . getIntValue ( "source" ) = = 4 | | client . getIntValue ( "source" ) = = 5 ) {
List < JSONObject > accounts = clientAccountMapper . listAdminAccounts ( client . getIntValue ( "client_id" ) ) ;
JSONObject account = accounts . get ( 0 ) ;
sendInitEmail ( client , account . getString ( "username" ) , "*****" ) ;
// sendInitEmail(manager, client, account.getString("username"), "*****");
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , open_status , 5 , "合规通过" , manager );
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , open_status , 5 , "合规通过" , manager ,1 );
clientModifySupport . processClientConfigModify ( new SwitchPermissionModify ( manager , clientMoniker , "skip_clearing" , false ) ) ;
clientModifySupport . processClientConfigModify ( new SwitchPermissionModify ( manager , clientMoniker , "common_sub_merchant_id" , false ) ) ;
gatewayMerchantApply . notifyOrgMerchantStatus ( client ) ;
} else if ( checkGreenChannel & & client . getIntValue ( "open_status" ) = = 5 ) {
// 绿色通道通过后不发邮件
logger . info ( "PASS 绿色通道:" + clientMoniker ) ;
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , open_status , 5 , "合规通过" , manager );
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , open_status , 5 , "合规通过" , manager ,1 );
} else {
initAdminUserAndSendEmail ( manager , clientMoniker , client ) ;
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , open_status , 5 , "合规通过" , manager ) ;
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , open_status , 5 , "合规通过" , manager , 1 ) ;
}
}
clientInfoCacheSupport . clearClientCache ( client . getIntValue ( "client_id" ) ) ;
}
@Override
public void auditCardClient ( JSONObject manager , String clientMoniker , int pass ) {
JSONObject client = getClientInfoByMoniker ( clientMoniker ) ;
if ( client = = null ) {
throw new InvalidShortIdException ( ) ;
}
//检查商户是否进入平台黑名单
int clientId = client . getIntValue ( "client_id" ) ;
isRiskyMerchant ( client , clientBankAccountMapper . clientBankAccounts ( clientId ) . get ( 0 ) ) ;
if ( client . getString ( "sub_merchant_id" ) = = null | | client . getString ( "sub_merchant_id" ) . equals ( "" ) ) {
throw new BadRequestException ( "该商户未设置微信 Sub Merchant ID!" ) ;
}
JSONObject cardFlowInfo = clientCardFlowMapper . findClient ( clientId ) ;
client . putAll ( clientConfigService . find ( client . getIntValue ( "client_id" ) ) ) ;
Integer open_status_to = cardFlowInfo ! = null ? cardFlowInfo . getIntValue ( "open_status" ) : null ;
cardFlowInfo . put ( "open_status" , 5 ) ;
cardFlowInfo . put ( "approve_result" , 1 ) ;
clientCardFlowMapper . update ( cardFlowInfo ) ;
sendCardCommissionWechatMessage ( client ) ; // wxMessage
if ( pass = = 1 ) {
createKycAuthStatus ( manager , client ) ;
clientModifySupport . processClientConfigModify ( new SwitchPermissionModify ( manager , clientMoniker , "skip_clearing" , false ) ) ;
if ( client . getIntValue ( "source" ) = = 4 | | client . getIntValue ( "source" ) = = 5 ) {
List < JSONObject > accounts = clientAccountMapper . listAdminAccounts ( client . getIntValue ( "client_id" ) ) ;
JSONObject account = accounts . get ( 0 ) ;
//TODO 发送卡支付开通邮件 1.判断商户是否已开通跨境支付, 若没有开通, init账号
// sendInitEmail(client, account.getString("username"), "*****");
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , open_status_to , 5 , "合规通过" , manager , 2 ) ;
clientModifySupport . processClientConfigModify ( new SwitchPermissionModify ( manager , clientMoniker , "skip_clearing" , false ) ) ;
// gatewayMerchantApply.notifyOrgMerchantStatus(client);
} else {
//TODO 发送卡支付开通邮件 1.判断商户是否已开通跨境支付, 若没有开通, init账号
// initAdminUserAndSendEmail(manager, clientMoniker, client);
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , open_status_to , 5 , "合规通过" , manager , 2 ) ;
}
}
clientInfoCacheSupport . clearClientCache ( client . getIntValue ( "client_id" ) ) ;
}
private void createKycAuthStatus ( JSONObject manager , JSONObject client ) {
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" ) ) ;
@ -1227,7 +1290,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
throw new BadRequestException ( "该商户未设置微信 Sub Merchant ID!" ) ;
}
clientModifySupport . processClientModify ( new GreenChannelModify ( manager , clientMoniker , manager . getString ( "manager_id" ) ) ) ;
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , 10 , 1 , "绿色通道申请通过" , manager );
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , 10 , 1 , "绿色通道申请通过" , manager ,1 );
sendCommissionWechatMessage ( client ) ;
initAdminUserAndSendEmail ( manager , clientMoniker , client ) ;
}
@ -2051,7 +2114,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clientRateMapper . updateConfig ( rateLog ) ;
}
if ( StringUtils . equalsIgnoreCase ( "rpaypmt_card" , config . getString ( "type" ) ) ) {
JSONObject extRateParams = new JSONObject ( ) { {
JSONObject extRateParams = new JSONObject ( ) { {
put ( "domestic_rate_value" , config . getBigDecimal ( "rate_value" ) ) ;
put ( "overseas_rate_value" , config . getJSONObject ( "ext_rates" ) . getBigDecimal ( "international_rate_value" ) ) ;
} } ;
@ -2088,7 +2151,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
int clientId = client . getIntValue ( "client_id" ) ;
JSONObject changeRate = merchantInfoProvider . clientCurrentRate ( clientId , new Date ( ) , "Wechat" ) ;
int cleanDays = changeRate . getIntValue ( "clean_days" ) ;
if ( cleanDays ! = client . getIntValue ( "clean_days" ) & & StringUtils . equalsIgnoreCase ( "Wechat" , config . getRateName ( ) ) ) {
if ( cleanDays ! = client . getIntValue ( "clean_days" ) & & StringUtils . equalsIgnoreCase ( "Wechat" , config . getRateName ( ) ) ) {
clientModifySupport . processClientConfigModify ( new ClearDaysModify ( manager , clientMoniker , cleanDays ) ) ;
}
// clientMapper.updateCleanDays(clientId, config.getCleanDays());
@ -2127,7 +2190,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
checkOrgPermission ( manager , client ) ;
List < JSONObject > listChildClients = clientMapper . listChildClients ( client . getIntValue ( "client_id" ) ) ;
JSONObject mchConfig = merchantInfoProvider . getMchExtParams ( client . getIntValue ( "client_id" ) ) ;
if ( mchConfig . getBooleanValue ( "hide_sub_mch" ) ) {
if ( mchConfig . getBooleanValue ( "hide_sub_mch" ) ) {
return new ArrayList < > ( ) ;
}
if ( mchConfig . getBooleanValue ( "level3_mch_config" ) ) {
@ -2145,7 +2208,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
public JSONObject listSubClientsByPage ( JSONObject manager , String clientMoniker , String searchText , int page ) {
public JSONObject listSubClientsByPage ( JSONObject manager , String clientMoniker , String searchText , int page ) {
JSONObject client = getClientInfoByMoniker ( clientMoniker ) ;
if ( client = = null ) {
throw new InvalidShortIdException ( ) ;
@ -2153,7 +2216,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
checkOrgPermission ( manager , client ) ;
PageBounds pageBounds ;
pageBounds = new PageBounds ( page , 20 , Order . formString ( "create_time.desc" ) ) ;
pageBounds = new PageBounds ( page , 20 , Order . formString ( "create_time.desc" ) ) ;
JSONObject params = new JSONObject ( ) { {
put ( "parent_client_id" , client . getIntValue ( "client_id" ) ) ;
} } ;
@ -2753,7 +2816,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if ( client_ids ! = null ) {
params . put ( "client_ids" , Arrays . asList ( client_ids ) ) ;
params . remove ( "client_id" ) ;
} else {
} else {
queryModifyClientIds ( client . getIntValue ( "client_id" ) , params ) ;
}
List < JSONObject > deviceIds = clientDeviceMapper . listClientDeviceIds ( params ) ;
@ -3304,7 +3367,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
if ( manager ! = null ) {
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , 1 , 2 , "Compliance合同制作中" , manager );
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , 1 , 2 , "Compliance合同制作中" , manager ,1 );
}
}
}
@ -3321,7 +3384,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
client . put ( "open_status" , 3 ) ;
clientModifySupport . processClientModify ( new OpenStatusModify ( manager , clientMoniker , 3 ) ) ;
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , 2 , 3 , "合同制作完成, 等待BD处理" , manager );
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , 2 , 3 , "合同制作完成, 等待BD处理" , manager ,1 );
// sendAgreeFileMsgToBD(client,null);
sendCommissionWechatMessage ( client ) ;
}
@ -3514,7 +3577,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if ( client = = null ) {
throw new InvalidShortIdException ( ) ;
}
clientModifySupport . processClientModify ( new SwitchAllowSurchargeCreditModify ( manager , clientMoniker , "enable_presettle" , presettle ) ) ;
clientModifySupport . processClientModify ( new SwitchAllowSurchargeCreditModify ( manager , clientMoniker , "enable_presettle" , presettle ) ) ;
}
@Override
@ -3567,7 +3630,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
throw new InvalidShortIdException ( ) ;
}
params . put ( "display_name" , manager . getString ( "display_name" ) ) ;
clientApproveIdInfo ( params , client ) ;
clientApproveIdInfo ( params , client ) ;
}
@Override
@ -3659,7 +3722,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Override
public JSONObject getAllAuthFiles ( JSONObject manager , String clientMoniker ) {
JSONObject client = getClientInfoByMoniker ( clientMoniker ) ;
String [ ] fileKeys = { "client_bank_file" , "client_company_file" , "client_id_file" , "client_agree_file" , "client_apply_file" , "kyc_utility_bill_file" } ;
String [ ] fileKeys = { "client_bank_file" , "client_company_file" , "client_id_file" , "client_agree_file" , "client_apply_file" , "kyc_utility_bill_file" } ;
if ( client = = null ) {
throw new InvalidShortIdException ( ) ;
}
@ -3714,7 +3777,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
List < JSONObject > clientFiles = clientFilesMapper . findClientFile ( client . getIntValue ( "client_id" ) ) ;
JSONObject fileJson = new JSONObject ( ) ;
JSONObject companyFile = clientComplianceCompanyMapper . findKycFileByClientId ( client . getIntValue ( "client_id" ) ) ;
fileJson . put ( "companyFile" , companyFile ) ;
fileJson . put ( "companyFile" , companyFile ) ;
if ( clientFiles ! = null & & clientFiles . size ( ) > 0 ) {
for ( String fileKey : fileKeys ) {
List < JSONObject > clientFileUrl = clientFiles . stream ( )
@ -3925,7 +3988,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Override
@Transactional
public List < JSONObject > uploadKycFilesForWaitComplianceForApp ( JSONObject account , String clientMoniker , JSONObject filesInfo , String fileType ) {
public List < JSONObject > uploadKycFilesForWaitComplianceForApp ( JSONObject account , String clientMoniker , JSONObject filesInfo , String fileType ) {
JSONObject client = getClientInfoByMoniker ( clientMoniker ) ;
List < JSONObject > fileResult = new ArrayList < > ( ) ;
if ( client = = null ) {
@ -3933,7 +3996,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
int clientId = client . getIntValue ( "client_id" ) ;
try {
updateFilesForWaitAuditWithoutRepeatForApp ( account , clientId , fileType , filesInfo . getString ( "url" ) , fileResult ) ;
updateFilesForWaitAuditWithoutRepeatForApp ( account , clientId , fileType , filesInfo . getString ( "url" ) , fileResult ) ;
} catch ( Exception e ) {
logger . error ( "上传KYC文件失败" , e ) ;
throw new BadRequestException ( "上传KYC文件失败" + e . getMessage ( ) ) ;
@ -3942,7 +4005,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
@Transactional
public void commitAuthFilesToCompliance ( String clientMoniker , JSONObject account , String source ) {
@ -4521,14 +4583,14 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
client . put ( "open_status" , 4 ) ;
clientModifySupport . processClientModify ( openStatusModify ) ;
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , open_status_from , 4 , "BD完成签字提交compliance审核" , manager );
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , open_status_from , 4 , "BD完成签字提交compliance审核" , manager ,1 );
if ( manager ! = null ) {
// sendMessagetoCompliance(client, manager.getString("display_name"));
sendCommissionWechatMessage ( client ) ;
}
}
private void saveClientAuditProcess ( int client_id , Integer open_status_form , Integer open_status_to , String remark , JSONObject manager ) {
private void saveClientAuditProcess ( int client_id , Integer open_status_form , Integer open_status_to , String remark , JSONObject manager ,int type ) {
JSONObject log = new JSONObject ( ) ;
try {
log . put ( "client_id" , client_id ) ;
@ -4539,6 +4601,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
log . put ( "operator_id" , StringUtils . isNotEmpty ( manager . getString ( "manager_id" ) ) ? manager . getString ( "manager_id" ) : manager . getString ( "account_id" ) ) ;
log . put ( "operator" , manager . getString ( "display_name" ) ) ;
log . put ( "create_time" , new Date ( ) ) ;
log . put ( "type" , type ) ;
log . put ( "remark" , remark ) ;
clientAuditProcessMapper . save ( log ) ;
} catch ( Exception e ) {
@ -4554,6 +4617,54 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
throw new InvalidShortIdException ( ) ;
}
client . putAll ( clientConfigService . find ( client . getIntValue ( "client_id" ) ) ) ;
beforeCommitToDoAgreeValid ( client , manager ) ;
OpenStatusModify openStatusModify = new OpenStatusModify ( manager , clientMoniker , 1 ) ;
openStatusModify . setApprove_result ( 4 ) ;
openStatusModify . setApprove_time ( new Date ( ) ) ;
clientModifySupport . processClientModify ( openStatusModify ) ;
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , null , 1 , "提交Card Payment Compliance制作合同" , manager , 1 ) ;
if ( manager ! = null ) {
// sendAgreeFileMsgtoCompliance(client, manager.getString("display_name"));
sendCommissionWechatMessage ( client ) ;
}
}
@Override
@Transactional
public void commitToDoCardAgreeFile ( String clientMoniker , JSONObject manager ) {
JSONObject client = getClientInfoByMoniker ( clientMoniker ) ;
if ( client = = null ) {
throw new InvalidShortIdException ( ) ;
}
int clientId = client . getIntValue ( "client_id" ) ;
client . putAll ( clientConfigService . find ( clientId ) ) ;
beforeCommitToDoAgreeValid ( client , manager ) ;
JSONObject cardFlowInfo = clientCardFlowMapper . findClient ( clientId ) ;
if ( null ! = cardFlowInfo ) {
JSONObject cardFlow = new JSONObject ( ) { {
put ( "client_id" , clientId ) ;
put ( "approve_result" , 4 ) ;
put ( "open_status" , 1 ) ;
put ( "approve_time" , new Date ( ) ) ;
} } ;
clientCardFlowMapper . update ( cardFlow ) ;
} else {
JSONObject cardFlow = new JSONObject ( ) { {
put ( "client_id" , clientId ) ;
put ( "open_status" , 1 ) ;
put ( "approve_result" , 4 ) ;
put ( "approve_time" , new Date ( ) ) ;
} } ;
clientCardFlowMapper . save ( cardFlow ) ;
}
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , null , 1 , "提交Compliance制作合同" , manager , 2 ) ;
}
private void beforeCommitToDoAgreeValid ( JSONObject client , JSONObject manager ) {
if ( manager ! = null & & ManagerRole . BD_USER . hasRole ( manager . getIntValue ( "role" ) ) ) {
int bdOperatClientRole = clientBDMapper . checkBDPermission ( client . getIntValue ( "client_id" ) , manager . getString ( "manager_id" ) ) ;
if ( bdOperatClientRole < = 0 ) {
@ -4570,15 +4681,6 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if ( account = = null | | account . size ( ) < = 0 ) {
throw new BadRequestException ( "The Partner's Bank Account is not config!" ) ;
}
OpenStatusModify openStatusModify = new OpenStatusModify ( manager , clientMoniker , 1 ) ;
openStatusModify . setApprove_result ( 4 ) ;
openStatusModify . setApprove_time ( new Date ( ) ) ;
clientModifySupport . processClientModify ( openStatusModify ) ;
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , null , 1 , "提交Compliance制作合同" , manager ) ;
if ( manager ! = null ) {
// sendAgreeFileMsgtoCompliance(client, manager.getString("display_name"));
sendCommissionWechatMessage ( client ) ;
}
}
@Override
@ -4610,7 +4712,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
openStatusModify . setApprove_result ( 4 ) ;
openStatusModify . setApprove_time ( new Date ( ) ) ;
clientModifySupport . processClientModify ( openStatusModify ) ;
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , open_status_from , 10 , "提交绿色通道申请Compliance审核" , manager );
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , open_status_from , 10 , "提交绿色通道申请Compliance审核" , manager ,1 );
if ( manager ! = null ) {
// sendGreenChannelMessagetoCompliance(client, manager.getString("display_name"));
sendCommissionWechatMessage ( client ) ;
@ -4900,7 +5002,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if ( refuse_remark ! = null & & ! refuse_remark . isEmpty ( ) ) {
auditModify . setRefuse_remark ( refuse_remark ) ;
}
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , open_status , client . getInteger ( "open_status" ) , "打回," + refuse_remark , manager );
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , open_status , client . getInteger ( "open_status" ) , "打回," + refuse_remark , manager ,1 );
clientModifySupport . processClientModify ( auditModify ) ;
try {
@ -4925,6 +5027,55 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
}
@Override
public void cardRefusePartner ( String clientMoniker , JSONObject manager , String refuse_remark ) {
JSONObject client = getClientInfoByMoniker ( clientMoniker ) ;
if ( client = = null ) {
throw new InvalidShortIdException ( ) ;
}
Integer clientId = client . getInteger ( "client_id" ) ;
JSONObject cardFlowInfo = clientCardFlowMapper . findClient ( clientId ) ;
Integer open_status = null ;
if ( null ! = cardFlowInfo ) {
open_status = cardFlowInfo . getIntValue ( "open_status" ) ;
if ( open_status = = 1 ) {
cardFlowInfo . put ( "open_status" , null ) ;
} else {
cardFlowInfo . put ( "open_status" , open_status - 1 ) ;
}
if ( cardFlowInfo . getIntValue ( "approve_result" ) = = 4 | | client . getIntValue ( "source" ) = = 4 ) {
cardFlowInfo . put ( "approve_result" , 5 ) ;
}
if ( refuse_remark ! = null & & ! refuse_remark . isEmpty ( ) ) {
cardFlowInfo . put ( "refuse_remark" , refuse_remark ) ;
}
} else {
cardFlowInfo . put ( "open_status" , null ) ;
}
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , open_status , cardFlowInfo . getIntValue ( "open_status" ) , "打回," + refuse_remark , manager , 2 ) ;
clientCardFlowMapper . update ( cardFlowInfo ) ;
try {
if ( client . getIntValue ( "source" ) = = 4 ) {
String contact_phone = client . getString ( "contact_phone" ) ;
if ( contact_phone . startsWith ( "+61" ) ) {
ArrayList < String > param = new ArrayList < > ( ) ;
param . add ( refuse_remark ) ;
try {
smsSender . getSender ( ) . sendWithParam ( "61" , contact_phone . replace ( "+61" , "" ) , REFUSE_CLIENT_TEMPLID , param , "RoyalPay" , "" , "" ) ;
} catch ( Exception ignore ) {
throw new ServerErrorException ( "Phone number is wrong :" + contact_phone ) ;
}
}
}
if ( client . getIntValue ( "source" ) = = 5 ) {
gatewayMerchantApply . notifyOrgMerchantStatus ( client ) ;
}
} catch ( Exception e ) {
logger . error ( "RefusePartnerError=======:" + clientMoniker + "," + e . getMessage ( ) ) ;
}
}
@Override
@Cacheable ( value = ":all_clients:" , key = "''+#clientId" )
public JSONArray getAllClientIds ( int clientId ) {
@ -5442,6 +5593,94 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
private void sendCardCommissionWechatMessage ( JSONObject client ) {
String bd_user_name = client . getString ( "bd_user_name" ) ;
String client_moniker = "[" + client . getString ( "client_moniker" ) + "]" ;
String short_name = client . getString ( "short_name" ) ;
JSONObject cardFlowInfo = clientCardFlowMapper . findClient ( client . getInteger ( "client_id" ) ) ;
if ( null = = cardFlowInfo ) {
return ;
}
if ( cardFlowInfo . getIntValue ( "open_status" ) = = 1 ) {
List < JSONObject > complianceList = managerMapper . getOnlyCompliance ( ) ;
if ( complianceList ! = null & & complianceList . size ( ) > 0 ) {
for ( JSONObject compliance : complianceList ) {
String wxopenid = compliance . getString ( "wx_openid" ) ;
try {
MpWechatApi paymentApi = mpWechatApiProvider . getNewPaymentApi ( ) ;
TemplateMessage msg = initSendCommissionTemplate ( wxopenid , paymentApi . getTemplateId ( "commission" ) , "BD申请制作卡支付合同" + client_moniker ,
bd_user_name , "制作卡支付合同申请" , "BD申请制作" + short_name + "的卡支付合同" ) ;
paymentApi . sendTemplateMessage ( msg ) ;
} 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 ) ) ;
}
}
}
return ;
}
if ( cardFlowInfo . getIntValue ( "open_status" ) = = 3 ) {
List < JSONObject > bds = clientBDMapper . listClientBDInfoAvailable ( client . getIntValue ( "client_id" ) , new Date ( ) ) ;
for ( JSONObject bd : bds ) {
String wxopenid = bd . getString ( "wx_openid" ) ;
if ( wxopenid ! = null ) {
try {
MpWechatApi paymentApi = mpWechatApiProvider . getNewPaymentApi ( ) ;
TemplateMessage msg = initSendCommissionTemplate ( wxopenid , paymentApi . getTemplateId ( "commission" ) , client_moniker + "卡支付合同制作完成" ,
"Compliance" , "合规材料" , "上传完整合规材料,商户:" + short_name ) ;
paymentApi . sendTemplateMessage ( msg ) ;
} catch ( WechatException e ) {
logger . error ( "Wechat Message Error,open_status=3" + e . getMessage ( ) ) ;
publisher . publishEvent ( new WechatExceptionEvent ( this , e , "Audit,open_status=3,openid=" + wxopenid ) ) ;
}
}
}
return ;
}
if ( cardFlowInfo . getIntValue ( "open_status" ) = = 4 ) {
if ( client . getIntValue ( "source" ) = = 4 & & ! StringUtils . isNotEmpty ( bd_user_name ) ) {
bd_user_name = "自助开通商户" ;
}
List < JSONObject > complianceList = managerMapper . getOnlyCompliance ( ) ;
if ( complianceList ! = null & & complianceList . size ( ) > 0 ) {
for ( JSONObject compliance : complianceList ) {
String wxopenid = compliance . getString ( "wx_openid" ) ;
try {
MpWechatApi paymentApi = mpWechatApiProvider . getNewPaymentApi ( ) ;
TemplateMessage msg = initSendCommissionTemplate ( wxopenid , paymentApi . getTemplateId ( "commission" ) , client_moniker + "卡支付合规材料已提交" ,
bd_user_name , "审核材料" , "已提交合规材料,等待审核" ) ;
paymentApi . sendTemplateMessage ( msg ) ;
} 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 ( ) ) ;
}
}
}
return ;
}
if ( cardFlowInfo . getIntValue ( "open_status" ) = = 5 ) {
List < JSONObject > bds = clientBDMapper . listClientBDInfoAvailable ( client . getIntValue ( "client_id" ) , new Date ( ) ) ;
for ( JSONObject bd : bds ) {
String wxopenid = bd . getString ( "wx_openid" ) ;
if ( wxopenid ! = null ) {
try {
TemplateMessage msg = initTaskFinishTemplate ( wxopenid , client_moniker + "已正式开通" , "Card Payment Compliance审核通过" , "" ) ;
MpWechatApi paymentApi = mpWechatApiProvider . getNewPaymentApi ( ) ;
paymentApi . sendTemplateMessage ( msg ) ;
} catch ( WechatException e ) {
logger . error ( "Wechat Message Error,open_status=5" + e . getMessage ( ) ) ;
publisher . publishEvent ( new WechatExceptionEvent ( this , e , "Audit,open_status=5,openid=" + wxopenid ) ) ;
}
}
}
return ;
}
}
@Override
@Cacheable ( value = ":all_sub_merchant_id_applices:" , key = "#clientMoniker" )
public List < JSONObject > listSubMerchantIdApplys ( JSONObject manager , String clientMoniker ) {
@ -6048,7 +6287,7 @@ 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 );
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , open_status_from , 4 , "自助开通商户提交compliance审核" , client_account ,1 );
if ( params ! = null ) {
params . put ( "display_name" , client_account . getString ( "display_name" ) ) ;
@ -6648,7 +6887,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
public JSONObject isLessFiles ( JSONObject partner ) {
public JSONObject isLessFiles ( JSONObject partner ) {
JSONObject client = clientMapper . findClientByMoniker ( partner . getString ( "client_moniker" ) ) ;
if ( client = = null ) {
throw new InvalidShortIdException ( ) ;
@ -6656,7 +6895,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
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 ) ;
@ -6679,14 +6918,14 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
throw new InvalidShortIdException ( ) ;
}
JSONObject KycFilesAuth = clientComplianceCompanyMapper . findKycFileComplete ( client . getIntValue ( "client_id" ) ) ;
if ( KycFilesAuth ! = null ) {
if ( KycFilesAuth ! = null ) {
lessKycFiles = false ;
}
return lessKycFiles ;
}
@Override
public JSONObject partnerIncrementalServiceInfo ( String clientMoniker , String channel ) {
public JSONObject partnerIncrementalServiceInfo ( String clientMoniker , String channel ) {
JSONObject client = clientMapper . findClientByMoniker ( clientMoniker ) ;
if ( client = = null ) {
throw new InvalidShortIdException ( ) ;
@ -6700,16 +6939,16 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
public JSONObject getClientIncrementalServiceLoginToken ( JSONObject account , String sourceCode ) {
public JSONObject getClientIncrementalServiceLoginToken ( JSONObject account , String sourceCode ) {
JSONObject client = clientMapper . findClient ( account . getIntValue ( "client_id" ) ) ;
if ( client = = null ) {
throw new InvalidShortIdException ( ) ;
}
JSONObject clientConfig = clientConfigMapper . find ( account . getIntValue ( "client_id" ) ) ;
if ( ! clientConfig . getBooleanValue ( "geek_shop_status" ) ) {
if ( ! clientConfig . getBooleanValue ( "geek_shop_status" ) ) {
throw new BadRequestException ( "Merchant service not opened" ) ;
}
return retailRSvcService . getGeekSsoTokenInfo ( sourceCode , client . getString ( "client_moniker" ) ) ;
return retailRSvcService . getGeekSsoTokenInfo ( sourceCode , client . getString ( "client_moniker" ) ) ;
}
@Override
@ -6913,18 +7152,18 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
public void changeExtParams ( String clientMoniker , JSONObject manager , JSONObject params ) {
public void changeExtParams ( String clientMoniker , JSONObject manager , JSONObject params ) {
JSONObject client = getClientInfoByMoniker ( clientMoniker ) ;
if ( client = = null ) {
throw new InvalidShortIdException ( ) ;
}
JSONObject extParmas = JSONObject . parseObject ( client . getString ( "ext_params" ) ) ;
if ( "true" . equals ( params . getString ( "value" ) ) | | "false" . equals ( params . getString ( "value" ) ) ) {
extParmas . put ( params . getString ( "key" ) , params . getBoolean ( "value" ) ) ;
} else {
extParmas . put ( params . getString ( "key" ) , params . getString ( "value" ) ) ;
if ( "true" . equals ( params . getString ( "value" ) ) | | "false" . equals ( params . getString ( "value" ) ) ) {
extParmas . put ( params . getString ( "key" ) , params . getBoolean ( "value" ) ) ;
} else {
extParmas . put ( params . getString ( "key" ) , params . getString ( "value" ) ) ;
}
client . put ( "ext_params" , extParmas . toString ( ) ) ;
client . put ( "ext_params" , extParmas . toString ( ) ) ;
clientMapper . update ( client ) ;
}
@ -6970,7 +7209,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
public void selectBillCodeVersion ( JSONObject manager , String clientMoniker , String version ) {
public void selectBillCodeVersion ( JSONObject manager , String clientMoniker , String version ) {
JSONObject client = getClientInfoByMoniker ( clientMoniker ) ;
if ( client = = null ) {
throw new InvalidShortIdException ( ) ;
@ -6981,26 +7220,26 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
@Override
public void exportLetterOfferPDF ( String clientMoniker , HttpServletResponse response ) {
public void exportLetterOfferPDF ( String clientMoniker , HttpServletResponse response ) {
JSONObject info = convertClientLetterOfferInfo ( clientMoniker ) ;
String pdfPath = this . getClass ( ) . getClassLoader ( ) . getResource ( "" ) . getPath ( ) + "/templates/pdf/letter_of_offer.pdf" ;
String fileName = clientMoniker + "_Letter_of_Offer.pdf" ;
publishExcelCardPDFFile ( fileName , pdfPath , info , response ) ;
String fileName = clientMoniker + "_Letter_of_Offer.pdf" ;
publishExcelCardPDFFile ( fileName , pdfPath , info , response ) ;
}
private JSONObject convertClientLetterOfferInfo ( String clientMoniker ) {
private JSONObject convertClientLetterOfferInfo ( String clientMoniker ) {
JSONObject client = getClientInfoByMoniker ( clientMoniker ) ;
if ( client = = null ) {
throw new InvalidShortIdException ( ) ;
}
//合规状态
if ( client . getIntValue ( "approve_result" ) ! = 1 & & client . getIntValue ( "approve_result" ) = = 3 ) {
if ( client . getIntValue ( "approve_result" ) ! = 1 & & client . getIntValue ( "approve_result" ) = = 3 ) {
throw new BadRequestException ( "The merchant failed the audit!" ) ;
}
//获取数据源
int clientId = client . getInteger ( "client_id" ) ;
JSONObject clientRate = clientRateMapper . latestChannelCleanDays ( "rpaypmt_card" , clientId ) ;
if ( clientRate = = null ) {
if ( clientRate = = null ) {
throw new BadRequestException ( "rpaypmt_card rate Not configured" ) ;
}
JSONObject cardRate = clientRate . getJSONObject ( "ext_rates" ) ;
@ -7008,84 +7247,84 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
//装在数据
JSONObject info = new JSONObject ( ) ;
info . put ( "down_date" , convertDateEnglish ( new Date ( ) ) ) ; //下载文件日期
info . put ( "bussiness_name" , client . getString ( "business_name" ) + " ABN" ) ; //商圈类型
info . put ( "partner_address" , client . getString ( "address" ) ) ; //商家店铺地址
info . put ( "partner_country" , client . getString ( "country" ) ) ; //国家
info . put ( "partner_state" , client . getString ( "state" ) ) ; //洲
info . put ( "partner_bussiness_name" , client . getString ( "business_name" ) ) ; //商户商用名称
info . put ( "clean_days" , client . getInteger ( "clean_days" ) ) ; //T+规则清算天数
info . put ( "partner_industry_mcc" , client . getInteger ( "industry" ) ) ; //商户行业编码
info . put ( "legal_bussiness" , client . getString ( "contact_person" ) + " AS " + client . getString ( "business_name" ) + " ABN " + client . getString ( "abn" ) ) ; //拼接规则:法人名 AS 商用名称 ABD 编码
info . put ( "annual_rate" , "0" ) ; //年费率
info . put ( "cost_per_transaction" , clientRate . getString ( "transaction_fee" ) ) ; //每次交易成本
info . put ( "domestic_fee" , cardRate . getString ( "domestic_rate_value" ) ) ; //国内服务费
info . put ( "international_fee" , cardRate . getString ( "overseas_rate_value" ) ) ; //国际服务费
info . put ( "account_reserve" , "1000" ) ; //账户储备金
info . put ( "down_date" , convertDateEnglish ( new Date ( ) ) ) ; //下载文件日期
info . put ( "bussiness_name" , client . getString ( "business_name" ) + " ABN" ) ; //商圈类型
info . put ( "partner_address" , client . getString ( "address" ) ) ; //商家店铺地址
info . put ( "partner_country" , client . getString ( "country" ) ) ; //国家
info . put ( "partner_state" , client . getString ( "state" ) ) ; //洲
info . put ( "partner_bussiness_name" , client . getString ( "business_name" ) ) ; //商户商用名称
info . put ( "clean_days" , client . getInteger ( "clean_days" ) ) ; //T+规则清算天数
info . put ( "partner_industry_mcc" , client . getInteger ( "industry" ) ) ; //商户行业编码
info . put ( "legal_bussiness" , client . getString ( "contact_person" ) + " AS " + client . getString ( "business_name" ) + " ABN " + client . getString ( "abn" ) ) ; //拼接规则:法人名 AS 商用名称 ABD 编码
info . put ( "annual_rate" , "0" ) ; //年费率
info . put ( "cost_per_transaction" , clientRate . getString ( "transaction_fee" ) ) ; //每次交易成本
info . put ( "domestic_fee" , cardRate . getString ( "domestic_rate_value" ) ) ; //国内服务费
info . put ( "international_fee" , cardRate . getString ( "overseas_rate_value" ) ) ; //国际服务费
info . put ( "account_reserve" , "1000" ) ; //账户储备金
//银行账号信息
info . put ( "account_name" , bankAccountInfo . getString ( "account_name" ) ) ; //
info . put ( "bsb" , bankAccountInfo . getString ( "bsb_no" ) ) ;
info . put ( "account_no" , bankAccountInfo . getString ( "account_no" ) ) ;
info . put ( "card_acceptor_name" , "xxxxxxxxxxxxx" ) ;
info . put ( "account_name" , bankAccountInfo . getString ( "account_name" ) ) ; //
info . put ( "bsb" , bankAccountInfo . getString ( "bsb_no" ) ) ;
info . put ( "account_no" , bankAccountInfo . getString ( "account_no" ) ) ;
info . put ( "card_acceptor_name" , "xxxxxxxxxxxxx" ) ;
return info ;
}
@Override
public void exportPromotionalOfferPDF ( String clientMoniker , String date , HttpServletResponse response ) {
JSONObject info = convertPromotionalOfferInfo ( clientMoniker , date ) ;
JSONObject info = convertPromotionalOfferInfo ( clientMoniker , date ) ;
String pdfPath = this . getClass ( ) . getClassLoader ( ) . getResource ( "" ) . getPath ( ) + "/templates/pdf/promotional_offer.pdf" ;
String fileName = clientMoniker + "_Promotional_Offer.pdf" ;
publishExcelCardPDFFile ( fileName , pdfPath , info , response ) ;
String fileName = clientMoniker + "_Promotional_Offer.pdf" ;
publishExcelCardPDFFile ( fileName , pdfPath , info , response ) ;
}
private JSONObject convertPromotionalOfferInfo ( String clientMoniker , String date ) {
private JSONObject convertPromotionalOfferInfo ( String clientMoniker , String date ) {
JSONObject client = getClientInfoByMoniker ( clientMoniker ) ;
if ( client = = null ) {
throw new InvalidShortIdException ( ) ;
}
//合规状态
if ( client . getIntValue ( "approve_result" ) ! = 1 & & client . getIntValue ( "approve_result" ) = = 3 ) {
if ( client . getIntValue ( "approve_result" ) ! = 1 & & client . getIntValue ( "approve_result" ) = = 3 ) {
throw new BadRequestException ( "The merchant failed the audit!" ) ;
}
int clientId = client . getInteger ( "client_id" ) ;
JSONObject clientRate = clientRateMapper . latestChannelCleanDays ( "rpaypmt_card" , clientId ) ;
if ( clientRate = = null ) {
if ( clientRate = = null ) {
throw new BadRequestException ( "rpaypmt_card rate Not configured" ) ;
}
JSONObject cardRate = clientRate . getJSONObject ( "ext_rates" ) ;
JSONObject bankAccountInfo = clientBankAccountMapper . clientBankAccounts ( clientId ) . get ( 0 ) ;
JSONObject info = new JSONObject ( ) ;
info . put ( "down_date" , convertDateEnglish ( new Date ( ) ) ) ; //下载文件日期
info . put ( "bussiness_name" , client . getString ( "business_name" ) + " ABN" ) ; //商圈类型
info . put ( "partner_address" , client . getString ( "address" ) ) ; //商家店铺地址
info . put ( "partner_country" , client . getString ( "country" ) ) ; //国家
info . put ( "partner_state" , client . getString ( "state" ) ) ; //洲
info . put ( "partner_bussiness_name" , client . getString ( "business_name" ) ) ; //商户商用名称
info . put ( "letter_offer_sub_time" , date ) ;
info . put ( "legal_bussiness" , client . getString ( "contact_person" ) + " AS " + client . getString ( "business_name" ) + " ABN " + client . getString ( "abn" ) ) ; //拼接规则:法人名 AS 商用名称 ABD 编码
info . put ( "domestic_fee" , cardRate . getString ( "domestic_rate_value" ) ) ; //国内服务费
info . put ( "international_fee" , cardRate . getString ( "overseas_rate_value" ) ) ; //国际服务费
info . put ( "promotional_effective_date" , "xxxxxxxxx" ) ;
info . put ( "promotional_period" , "xxxxxxxxx" ) ;
info . put ( "down_date" , convertDateEnglish ( new Date ( ) ) ) ; //下载文件日期
info . put ( "bussiness_name" , client . getString ( "business_name" ) + " ABN" ) ; //商圈类型
info . put ( "partner_address" , client . getString ( "address" ) ) ; //商家店铺地址
info . put ( "partner_country" , client . getString ( "country" ) ) ; //国家
info . put ( "partner_state" , client . getString ( "state" ) ) ; //洲
info . put ( "partner_bussiness_name" , client . getString ( "business_name" ) ) ; //商户商用名称
info . put ( "letter_offer_sub_time" , date ) ;
info . put ( "legal_bussiness" , client . getString ( "contact_person" ) + " AS " + client . getString ( "business_name" ) + " ABN " + client . getString ( "abn" ) ) ; //拼接规则:法人名 AS 商用名称 ABD 编码
info . put ( "domestic_fee" , cardRate . getString ( "domestic_rate_value" ) ) ; //国内服务费
info . put ( "international_fee" , cardRate . getString ( "overseas_rate_value" ) ) ; //国际服务费
info . put ( "promotional_effective_date" , "xxxxxxxxx" ) ;
info . put ( "promotional_period" , "xxxxxxxxx" ) ;
return info ;
}
@Override
public void exportTermsConditionsPDF ( String clientMoniker , HttpServletResponse response ) {
public void exportTermsConditionsPDF ( String clientMoniker , HttpServletResponse response ) {
JSONObject client = getClientInfoByMoniker ( clientMoniker ) ;
if ( client = = null ) {
throw new InvalidShortIdException ( ) ;
}
if ( client . getIntValue ( "approve_result" ) ! = 1 & & client . getIntValue ( "approve_result" ) = = 3 ) {
if ( client . getIntValue ( "approve_result" ) ! = 1 & & client . getIntValue ( "approve_result" ) = = 3 ) {
throw new BadRequestException ( "The merchant failed the audit!" ) ;
}
String pdfPath = this . getClass ( ) . getClassLoader ( ) . getResource ( "" ) . getPath ( ) + "/templates/pdf/terms_and_conditions.pdf" ;
String fileName = clientMoniker + "_Terms_And_Conditions.pdf" ;
publishExcelCardPDFFile ( fileName , pdfPath , new JSONObject ( ) , response ) ;
String fileName = clientMoniker + "_Terms_And_Conditions.pdf" ;
publishExcelCardPDFFile ( fileName , pdfPath , new JSONObject ( ) , response ) ;
}
private void publishExcelCardPDFFile ( String fileName , String pdfPath , JSONObject info , HttpServletResponse response ) {
private void publishExcelCardPDFFile ( String fileName , String pdfPath , JSONObject info , HttpServletResponse response ) {
response . setContentType ( "application/pdf" ) ;
response . setHeader ( "Content-Disposition" , "attachment;fileName=" + fileName + ".pdf" ) ;
try {
@ -7105,14 +7344,14 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
}
private String convertDateEnglish ( Date date ) {
String [ ] months = { "Jan" , "Feb" , "Mar" , "Apr" , "May" , "Jun" , "Jul" , "Aug" , "Spt" , "Oct" , "Nov" , "Dec" } ;
private String convertDateEnglish ( Date date ) {
String [ ] months = { "Jan" , "Feb" , "Mar" , "Apr" , "May" , "Jun" , "Jul" , "Aug" , "Spt" , "Oct" , "Nov" , "Dec" } ;
Calendar calendar = Calendar . getInstance ( ) ;
calendar . setTime ( date ) ;
int year = calendar . get ( Calendar . YEAR ) ;
int month = calendar . get ( Calendar . MONTH ) ;
int day = calendar . get ( Calendar . DAY_OF_MONTH ) ;
return day + " " + months [ month ] + " " + year ;
return day + " " + months [ month ] + " " + year ;
}
public void saveLegalAndMarketingInfo ( JSONObject partner ) {