@ -183,6 +183,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
@Resource
private ClientIncrementalMapper clientIncrementalMapper ;
@Value ( "${client_card.account_reserve}" )
private String cardAccountReserve ;
@Value ( "${client_card.annual_rate}" )
private String cardAnnualRate ;
@Value ( "${app.redis.prefix}" )
private String redisPrefix ;
private ApplicationEventPublisher publisher ;
@ -340,6 +345,13 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
private static final String CLIENT_AGREE_FILE = "client_agree_file" ;
private static final String CLIENT_COMPANY_FILE = "client_company_file" ;
private static final String CLIENT_APPLY_FILE = "client_apply_file" ;
//卡支付合同文件
private static final String LETTER_OF_OFFER_FILE = "letter_of_offer_file" ;
private static final String PROMOTIONAL_OFFER_FILE = "promotional_offer_file" ;
private static final String TERMS_AND_CONDITIONS_FILE = "terms_and_conditions_file" ;
private static final List < String > tags = new ArrayList < > ( ) ;
private static final String KYC_UTILITY_BILL_FILE = "kyc_utility_bill_file" ;
@ -1642,7 +1654,9 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if ( client = = null ) {
throw new InvalidShortIdException ( ) ;
}
clientModifySupport . processClientConfigModify ( new SwitchPermissionModify ( manager , clientMoniker , permissionKey , allow ) ) ;
JSONObject upayProfileInfo = sysClientUpayProfileMapper . findInfo ( client . getInteger ( "client_id" ) ) ;
upayProfileInfo . put ( permissionKey , allow ) ;
sysClientUpayProfileMapper . update ( upayProfileInfo ) ;
}
@Override
@ -3157,6 +3171,35 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
}
@Override
@Transactional
public void getAggregateCardAgreeFile ( String clientMoniker , JSONObject manager , boolean renewal ) {
JSONObject client = clientMapper . findClientByMoniker ( clientMoniker ) ;
if ( client = = null ) {
throw new InvalidShortIdException ( ) ;
}
exportLetterOfferPDF ( clientMoniker , manager ) ;
exportTermsConditionsPDF ( clientMoniker , manager ) ;
if ( ! renewal ) {
JSONObject cardFlow = clientCardFlowMapper . findClient ( client . getInteger ( "client_id" ) ) ;
cardFlow . put ( "open_status" , 2 ) ;
clientCardFlowMapper . update ( cardFlow ) ;
}
if ( manager ! = null ) {
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , 1 , 2 , "Compliance合同制作中" , manager , 2 ) ;
}
}
@Override
@Transactional
public void getAggregateCardPromotionaAgreeFile ( String clientMoniker , JSONObject manager , boolean renewal , Date promotionalEffectiveDate , int promotionalPeriod ) {
JSONObject client = clientMapper . findClientByMoniker ( clientMoniker ) ;
if ( client = = null ) {
throw new InvalidShortIdException ( ) ;
}
exportPromotionalOfferPDF ( clientMoniker , manager , promotionalEffectiveDate , promotionalPeriod ) ;
}
@Override
public void getNewAggregateAgreeFile ( String clientMoniker , JSONObject manager , boolean renewal ) throws Exception {
JSONObject client = getClientInfoByMoniker ( clientMoniker ) ;
@ -3376,6 +3419,24 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
sendCommissionWechatMessage ( client ) ;
}
@Override
public void cardCompleteAgree ( String clientMoniker , JSONObject manager ) {
JSONObject client = getClientInfoByMoniker ( clientMoniker ) ;
if ( client = = null ) {
throw new InvalidShortIdException ( ) ;
}
List < JSONObject > existLeffterFiles = clientFilesMapper . findFileByClientAndType ( client . getIntValue ( "client_id" ) , LETTER_OF_OFFER_FILE ) ;
List < JSONObject > existConditionsFiles = clientFilesMapper . findFileByClientAndType ( client . getIntValue ( "client_id" ) , TERMS_AND_CONDITIONS_FILE ) ;
if ( CollectionUtils . isEmpty ( existLeffterFiles ) & & CollectionUtils . isEmpty ( existConditionsFiles ) ) {
throw new BadRequestException ( "The Agree File is not Complete!" ) ;
}
JSONObject cardFlowInfo = clientCardFlowMapper . findClient ( client . getInteger ( "client_id" ) ) ;
cardFlowInfo . put ( "open_status" , 3 ) ;
clientCardFlowMapper . update ( cardFlowInfo ) ;
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , 2 , 3 , "合同制作完成, 等待BD处理" , manager , 2 ) ;
sendCardCommissionWechatMessage ( client ) ;
}
@Override
public void downloadComplianceZip ( String clientMoniker , HttpServletResponse response ) throws Exception {
JSONObject client = getClientInfoByMoniker ( clientMoniker ) ;
@ -3711,6 +3772,19 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return sourceFile ;
}
@Override
public JSONObject getSourceCardAgreeFiles ( String clientMoniker , JSONObject manager , String fileName ) {
JSONObject client = getClientInfoByMoniker ( clientMoniker ) ;
if ( client = = null ) {
throw new InvalidShortIdException ( ) ;
}
JSONObject sourceFile = clientFilesMapper . getSourceCardAgreeFilesByClientId ( client . getIntValue ( "client_id" ) , fileName ) ;
if ( sourceFile ! = null ) {
sourceFile . put ( sourceFile . getString ( "file_name" ) , sourceFile . getString ( "file_value" ) ) ;
}
return sourceFile ;
}
@Override
public JSONObject getAllAuthFiles ( JSONObject manager , String clientMoniker ) {
JSONObject client = getClientInfoByMoniker ( clientMoniker ) ;
@ -4588,6 +4662,45 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
}
@Override
@Transactional
public void commitToCardCompliance ( String clientMoniker , JSONObject manager ) {
JSONObject client = getClientInfoByMoniker ( clientMoniker ) ;
if ( client = = null ) {
throw new InvalidShortIdException ( ) ;
}
client . putAll ( clientConfigService . find ( client . getIntValue ( "client_id" ) ) ) ;
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 ) {
throw new ForbiddenException ( ) ;
}
}
// 提交合规启用银行、费率验证 add by Tayl0r 2017/06/13
JSONObject rate = merchantInfoProvider . clientCurrentRate ( client . getIntValue ( "client_id" ) , new Date ( ) , "rpaypmt_card" ) ;
if ( rate = = null ) {
throw new BadRequestException ( "The Partner's Rate is not config!" ) ;
}
List < JSONObject > clientFiles = clientFilesMapper . findClientFile ( client . getIntValue ( "client_id" ) ) ;
if ( clientFiles = = null | | clientFiles . equals ( "" ) ) {
throw new BadRequestException ( "The Compliance File Must Be Uploaded!" ) ;
}
JSONObject account = getBankAccountByClientId ( client . getIntValue ( "client_id" ) ) ;
if ( account = = null ) {
throw new BadRequestException ( "The Partner's Bank Account is not config!" ) ;
}
JSONObject cardFlowInfo = clientCardFlowMapper . findClient ( client . getInteger ( "client_id" ) ) ;
int open_status_from = cardFlowInfo . getIntValue ( "open_status" ) ;
cardFlowInfo . put ( "approve_time" , new Date ( ) ) ;
cardFlowInfo . put ( "approve_result" , 4 ) ;
cardFlowInfo . put ( "open_status" , 4 ) ;
clientCardFlowMapper . update ( cardFlowInfo ) ;
saveClientAuditProcess ( client . getIntValue ( "client_id" ) , open_status_from , 4 , "BD完成签字提交compliance审核" , manager , 2 ) ;
if ( manager ! = null ) {
sendCardCommissionWechatMessage ( client ) ;
}
}
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 {
@ -4640,6 +4753,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
client . putAll ( clientConfigService . find ( clientId ) ) ;
beforeCommitToDoAgreeValid ( client , manager ) ;
JSONObject surCharge = merchantInfoProvider . clientCurrentRate ( client . getIntValue ( "client_id" ) , new Date ( ) , "rpaypmt_card" ) ;
if ( surCharge = = null | | surCharge . size ( ) < = 0 ) {
throw new BadRequestException ( "The Partner's Rpaypmt Card Rate is not config!" ) ;
}
JSONObject cardFlowInfo = clientCardFlowMapper . findClient ( clientId ) ;
if ( null ! = cardFlowInfo ) {
JSONObject cardFlow = new JSONObject ( ) { {
@ -5606,7 +5724,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
String wxopenid = compliance . getString ( "wx_openid" ) ;
try {
MpWechatApi paymentApi = mpWechatApiProvider . getNewPaymentApi ( ) ;
TemplateMessage msg = initSendCommissionTemplate ( wxopenid , paymentApi . getTemplateId ( "commission" ) , "BD申请制作 卡支付合同" + client_moniker ,
TemplateMessage msg = initSendCommissionTemplate ( wxopenid , paymentApi . getTemplateId ( "commission" ) , "BD申请制作 信用 卡支付合同" + client_moniker ,
bd_user_name , "制作卡支付合同申请" , "BD申请制作" + short_name + "的卡支付合同" ) ;
paymentApi . sendTemplateMessage ( msg ) ;
} catch ( WechatException e ) {
@ -5624,7 +5742,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
if ( wxopenid ! = null ) {
try {
MpWechatApi paymentApi = mpWechatApiProvider . getNewPaymentApi ( ) ;
TemplateMessage msg = initSendCommissionTemplate ( wxopenid , paymentApi . getTemplateId ( "commission" ) , client_moniker + " 卡支付合同制作完成",
TemplateMessage msg = initSendCommissionTemplate ( wxopenid , paymentApi . getTemplateId ( "commission" ) , client_moniker + " 信用 卡支付合同制作完成",
"Compliance" , "合规材料" , "上传完整合规材料,商户:" + short_name ) ;
paymentApi . sendTemplateMessage ( msg ) ;
} catch ( WechatException e ) {
@ -5647,7 +5765,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
String wxopenid = compliance . getString ( "wx_openid" ) ;
try {
MpWechatApi paymentApi = mpWechatApiProvider . getNewPaymentApi ( ) ;
TemplateMessage msg = initSendCommissionTemplate ( wxopenid , paymentApi . getTemplateId ( "commission" ) , client_moniker + " 卡支付合规材料已提交",
TemplateMessage msg = initSendCommissionTemplate ( wxopenid , paymentApi . getTemplateId ( "commission" ) , client_moniker + " 信用卡 卡支付合规材料已提交",
bd_user_name , "审核材料" , "已提交合规材料,等待审核" ) ;
paymentApi . sendTemplateMessage ( msg ) ;
} catch ( WechatException e ) {
@ -7217,12 +7335,11 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
clientInfoCacheSupport . clearClientCache ( client . getIntValue ( "client_id" ) ) ;
}
@Override
public void exportLetterOfferPDF ( String clientMoniker , HttpServletResponse response ) {
private void exportLetterOfferPDF ( String clientMoniker , JSONObject manage ) {
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 ) ;
publishExcelCardPDFFile ( clientMoniker, manage , fileName, pdfPath , info , LETTER_OF_OFFER_FILE ) ;
}
private JSONObject convertClientLetterOfferInfo ( String clientMoniker ) {
@ -7236,46 +7353,45 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
//获取数据源
int clientId = client . getInteger ( "client_id" ) ;
JSONObject clientRate = clientRateMapper . latestC hannelCleanDays( "rpaypmt_card" , clientId ) ;
JSONObject clientRate = clientRateMapper . latestC ardC hannelCleanDays( "rpaypmt_card" , clientId ) ;
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 upayProfileInfo = sysClientUpayProfileMapper . findInfo ( clientId ) ;
//装在数据
JSONObject info = new JSONObject ( ) ;
info . put ( "down_date" , convertDateEnglish ( new Date ( ) ) ) ; //下载文件日期
info . put ( "bussiness_name" , client . getString ( "business_name" ) + " ABN" ) ; //商圈类型
info . put ( "bussiness_name" , ( client . containsKey ( "business_name" ) ? client . getString ( "business_name" ) : client . getString ( "contact_person" ) ) + " 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 ( "partner_industry_mcc" , upayProfileInfo. getString ( "mv_industy" ) ) ; //信用卡注册 商户行业编码
info . put ( "legal_bussiness" , client . getString ( "contact_person" ) + " AS " + ( client . containsKey ( "business_name" ) ? client . getString ( "business_name" ) : client . getString ( "contact_person" ) ) + " ABN " + client . getString ( "abn" ) ) ; //拼接规则:法人名 AS 商用名称 ABD 编码
info . put ( "annual_rate" , cardAnnualRate ) ; //年费率
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_reserve" , cardAccountReserve ) ; //账户储备金
//银行账号信息
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 ( "card_acceptor_name" , upayProfileInfo . getString ( "acceptor_name" ) ) ;
return info ;
}
@Override
public void exportPromotionalOfferPDF ( String clientMoniker , String date , HttpServletResponse response ) {
JSONObject info = convertPromotionalOfferInfo ( clientMoniker , date ) ;
private void exportPromotionalOfferPDF ( String clientMoniker , JSONObject manager , Date promotionalEffectiveDate , int promotionalPeriod ) {
JSONObject info = convertPromotionalOfferInfo ( clientMoniker , convertDateEnglish ( promotionalEffectiveDate ) , promotionalPeriod ) ;
String pdfPath = this . getClass ( ) . getClassLoader ( ) . getResource ( "" ) . getPath ( ) + "/templates/pdf/promotional_offer.pdf" ;
String fileName = clientMoniker + "_Promotional_Offer.pdf" ;
publishExcelCardPDFFile ( fileName, pdfPath , info , response ) ;
publishExcelCardPDFFile ( clientMoniker, manager , fileName, pdfPath , info , PROMOTIONAL_OFFER_FILE ) ;
}
private JSONObject convertPromotionalOfferInfo ( String clientMoniker , String date ) {
private JSONObject convertPromotionalOfferInfo ( String clientMoniker , String promotionalEffectiveDate , int promotionalPeriod ) {
JSONObject client = getClientInfoByMoniker ( clientMoniker ) ;
if ( client = = null ) {
throw new InvalidShortIdException ( ) ;
@ -7285,7 +7401,7 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
throw new BadRequestException ( "The merchant failed the audit!" ) ;
}
int clientId = client . getInteger ( "client_id" ) ;
JSONObject clientRate = clientRateMapper . latestC hannelCleanDays( "rpaypmt_card" , clientId ) ;
JSONObject clientRate = clientRateMapper . latestC ardC hannelCleanDays( "rpaypmt_card" , clientId ) ;
if ( clientRate = = null ) {
throw new BadRequestException ( "rpaypmt_card rate Not configured" ) ;
}
@ -7294,22 +7410,20 @@ 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 ( "bussiness_name" , ( client . containsKey ( "business_name" ) ? client . getString ( "business_name" ) : client . getString ( "contact_person" ) ) + " 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 ( "legal_bussiness" , client . getString ( "contact_person" ) + " AS " + ( client . containsKey ( "business_name" ) ? client . getString ( "business_name" ) : client . getString ( "contact_person" ) ) + " 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 ( "promotional_effective_date" , promotionalEffectiveDate ) ;
info . put ( "promotional_period" , promotionalPeriod ) ;
return info ;
}
@Override
public void exportTermsConditionsPDF ( String clientMoniker , HttpServletResponse response ) {
private void exportTermsConditionsPDF ( String clientMoniker , JSONObject manage ) {
JSONObject client = getClientInfoByMoniker ( clientMoniker ) ;
if ( client = = null ) {
throw new InvalidShortIdException ( ) ;
@ -7319,24 +7433,26 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
}
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 ) ;
publishExcelCardPDFFile ( clientMoniker, manage , fileName, pdfPath , new JSONObject ( ) , TERMS_AND_CONDITIONS_FILE ) ;
}
private void publishExcelCardPDFFile ( String fileName , String pdfPath , JSONObject info , HttpServletResponse response ) {
response . setContentType ( "application/pdf" ) ;
response . setHeader ( "Content-Disposition" , "attachment;fileName=" + fileName + ".pdf" ) ;
private void publishExcelCardPDFFile ( String clientMoniker , JSONObject manager , String fileName , String pdfPath , JSONObject info , String fileLabel ) {
try {
OutputStream outs = response . getOutputStream ( ) ;
PdfUtils pdu = new PdfUtils ( ) ;
pdu . setTemplatePdfPath ( pdfPath ) ;
pdu . setPdfTemplate ( info ) ;
File file = new File ( fileName ) ;
ByteArrayOutputStream bos = pdu . templetPdfBos ( file , "" , "" ) ;
outs . write ( bos . toByteArray ( ) , 0 , bos . toByteArray ( ) . length ) ;
outs . flush ( ) ;
outs . close ( ) ;
} catch ( IOException e ) {
e . printStackTrace ( ) ;
try {
File file = new File ( fileName ) ;
ByteArrayOutputStream bos = pdu . templetPdfBos ( file ) ;
InputStream stream = new ByteArrayInputStream ( bos . toByteArray ( ) ) ;
JSONObject fileRes = attachmentClient . uploadFile ( stream , fileName , false ) ;
if ( fileRes ! = null ) {
importCardAgreeFile ( clientMoniker , manager , fileRes . getString ( "url" ) , fileLabel ) ;
}
stream . close ( ) ;
} catch ( Exception e ) {
logger . error ( "合同制作出现问题:" , e ) ;
}
} catch ( Exception e ) {
e . printStackTrace ( ) ;
}
@ -7352,6 +7468,41 @@ public class ClientManagerImpl implements ClientManager, ManagerTodoNoticeProvid
return day + " " + months [ month ] + " " + year ;
}
private void importCardAgreeFile ( String clientMoniker , JSONObject manager , String sourceFile , String fileLabel ) {
JSONObject client = getClientInfoByMoniker ( clientMoniker ) ;
if ( client = = null ) {
throw new InvalidShortIdException ( ) ;
}
if ( sourceFile ! = null ) {
List < JSONObject > existFiles = clientFilesMapper . findFileByClientAndType ( client . getIntValue ( "client_id" ) , fileLabel ) ;
JSONObject existFile = null ;
if ( ! CollectionUtils . isEmpty ( existFiles ) ) {
existFile = existFiles . get ( 0 ) ;
}
Date now = new Date ( ) ;
JSONObject file = new JSONObject ( ) ;
file . put ( "file_name" , fileLabel ) ;
file . put ( "file_value" , sourceFile ) ;
file . put ( "client_id" , client . getIntValue ( "client_id" ) ) ;
file . put ( "last_update_date" , now ) ;
file . put ( "status" , 1 ) ;
file . put ( "is_valid" , 1 ) ;
if ( manager = = null ) {
file . put ( "last_update_by" , "System Import" ) ;
} else {
file . put ( "last_update_by" , manager . getString ( "display_name" ) ) ;
}
JSONObject contract = clientsContractMapper . findByClientId ( client . getIntValue ( "client_id" ) ) ;
if ( contract = = null | | now . compareTo ( contract . getDate ( "expiry_date" ) ) > 0 | | ! contract . getBoolean ( "has_sign" ) | | existFile = = null
| | existFile . isEmpty ( ) ) {
clientFilesMapper . save ( file ) ;
} else {
file . put ( "file_id" , existFile . getString ( "file_id" ) ) ;
clientFilesMapper . update ( file ) ;
}
}
}
public void saveLegalAndMarketingInfo ( JSONObject partner ) {
JSONObject representativeInfo = new JSONObject ( ) ;
representativeInfo . put ( "client_id" , partner . getIntValue ( "client_id" ) ) ;