修改进件接口

This commit is contained in:
韩鹏辉 2023-06-17 10:35:54 +08:00
parent 0e926adf3d
commit d22b69d8c0
7 changed files with 965 additions and 206 deletions

View File

@ -625,9 +625,20 @@ public class DateUtils {
}
}
public static String convertString(String str){
StringBuilder stringBuilder=new StringBuilder();
stringBuilder.append(str.substring(0,4));
stringBuilder.append("-");
stringBuilder.append(str.substring(4,6));
stringBuilder.append("-");
stringBuilder.append(str.substring(6,8));
return stringBuilder.toString();
}
public static void main(String[] args) throws ParseException {
System.out.println(convertDate("20230603163342"));
System.out.println(DateUtils.convertString("20380306"));
//List<String> last6Months = getLast6Months();
// List<String> last6Months = new ArrayList<>();
// last6Months.add("2019-11");

View File

@ -0,0 +1,462 @@
<html xmlns="http://www.w3.org/1999/html">
<head>
<meta charset="UTF-8">
<style>
.alert-ti {
width: 100%;
margin: 0 auto;
margin-top: .5rem;
font-size: .7rem;
height: 7%;
font-weight: 600;
text-align: center;
}
.tb-title {
text-align: center;
font-weight: 800;
background: rgb(177, 178, 177);
font-size: 14px;
}
.ag-title {
text-align: center;
font-weight: 600;
padding-top: 32px;
padding-bottom: 16px;
}
body {
font-size: 14px;
font-family: Helvetica, Arial, "Hiragino Sans GB", "Microsoft Yahei", "微软雅黑", STHeiti, "华文细黑", sans-serif;
padding: 8px;
}
.feeWrite {
font-weight: 600;
text-decoration: underline;
}
.feeWrite2 {
font-weight: 600;
font-size: 16px;
text-decoration: underline;
}
b {
font-weight: 800;
}
.ag-content-content {
margin-bottom: 8px;
}
.ag-content-content-title {
display: block;
text-indent: 2em;
}
.ag-content-content-title-span {
text-indent: 2em;
}
table {
background: #000;
font-size: 11px;
width: 100%;
text-indent: 0;
}
table td {
background: white;
line-height: 20px;
height: 20px;
}
.table-title {
text-align: center;
}
.tb-con {
padding: 20px;
display: block;
}
</style>
</head>
<body>
<div class="alert-as" style="width: 100%; height: auto">
<div class="alert-content">
<div class="ag-all">
<div class="ag-all-content">
<div style="width: 100%;" class="ag-img">
<div class="ag-title">
<b>特约商户支付服务合作协议</b>
</div>
<div class="ag-content">
<div class="ag-content-content">
<div class="ag-content-content-title" style="text-indent: 2em; ">
《特约商户支付服务合作协议》(以下简称“本协议”)是拉卡拉支付股份有限公司(正文部分简称“乙方”)与您(是指接受拉卡拉支付服务的个人或公司法人及相关单位组织等,正文部分简称“甲方”)就“支付服务业务”服务(以下简称“本服务”)所订立的有效合约。
您在使用本服务之前,请仔细阅读本协议(特别是以<b>粗体</b>标注的内容),<b>您在拉卡拉客户经理向您展示的本协议上签字,即表示您同意接受本协议的全部内容</b>。如果您不同意本协议的任意内容,或者无法准确理解相关条款,请不要签字。
</div>
</div>
<div class="ag-content-content">
<div style="text-indent: 2em; line-height: ">甲方:(特约商户)<span class="feeWrite">${customerName}</span>
</div>
<div style="text-indent: 2em; line-height: ">乙方:(支付机构)拉卡拉支付股份有限公司</div>
</div>
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第一条</b> 业务服务及费用:</div>
<div class="ag-content-content-title-span">1双方确认乙方向甲方提供支付服务。</div>
<div class="ag-content-content-title-span">
2甲方使用本服务将会产生相应的收单手续费详见《拉卡拉商户注册登记表》甲方也可通过APP查询收单手续费。
</div>
<div class="ag-content-content-title-span">
3乙方保留调整本协议项下的费用之权利如本协议项下的费用调整乙方将以公告方式在拉卡拉网站提示并予以公示而无需另行通知甲方调整后的费用标准在公告期届满之日起生效。若甲方在费用标准调整后继续使用本服务的视为甲方接受费用标准的调整。若甲方不同意调整后的费用标准应停止使用本服务并与乙方联系。
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第二条</b>
甲方如使用移动通讯受理终端含内置Esim卡甲方应向乙方另行支付运营服务费详见《拉卡拉商户注册登记表》运营服务包括终端网络维护质量管理应急响应等服务期自终端入网之日起1年。甲方应自本协议生效之日起1个工作日内向乙方支付首年运营服务费首年服务到期30日前向乙方支付次年运营服务费以此类推。
</div>
<div class="ag-content-content-title-span"></div>
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第三条</b>
乙方应将甲方的交易资金在扣除本协议约定的手续费和其他款项后在约定的结算周期详见《拉卡拉商户注册登记表》向甲方指定的结算账户划付资金境外卡支付业务在3个工作日内划付资金。甲方可根据需求选择开通交易发生日结算乙方审核通过后将另行扣收相应的快速结算手续费<sup>1</sup>具体以拉卡拉商户通APP展示的为准。
</div>
</div>
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第四条</b>
甲方默认开通退货功能当甲方发生退货、撤销、冲正交易情形时乙方有权采用以下一或多种模式将退款资金扣除1从甲方退款终端交易资金中直接扣除2从甲方退款商户交易资金中直接扣除3从甲方退货账户资金中直接扣除4从甲方合作平台/集团商户退货账户资金中直接扣除。如甲方需关闭退货功能甲方可拨打乙方客服电话95016关闭退货功能。
</div>
<div class="ag-content-content-title-span">
对甲方、合作平台/集团商户退货账户进行扣款后,甲方同意并授权乙方依据实际情况将甲方交易资金回充至相应退货账户。甲方因退货操作错误等原因造成的资金风险及损失由甲方承担。
</div>
</div>
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第五条</b>
乙方应按国家法律法规履行支付机构相关责任与义务。
</div>
</div>
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第六条</b>
乙方(含乙方分支机构、合作方,下同)为甲方提供的受理终端(包含收款码)仅限甲方在固定地区使用。
甲方应提供符合受理终端安装要求的场地条件,并妥善保管和使用,如因甲方管理或使用不当造成终端损坏或遗失的,甲方应按市场价向乙方赔偿,<b>赔付方式为现金、转账或授权乙方从甲方终端押金、交易资金等途径扣除。</b>
双方协议终止时,乙方有权收回放置在甲方的受理终端或关闭网络支付接口。
</div>
</div>
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第七条</b>
受理终端收费标准由乙方与甲方另行约定。固定受理终端、移动受理终端、扫码受理终端数量及型号以拉卡拉客户端及拉卡拉商户通APP展示的数量及型号为准。
</div>
</div>
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第八条</b>
甲方应准确填写附件《拉卡拉商户注册登记表》中的相关信息,当甲方的工商注册名称、主营业务、法定代表人或负责人、结算账户信息等重要信息发生变更时,甲方应通过乙方官方渠道方式告知乙方,乙方有权重新审核甲方支付业务受理资质。
当乙方认为甲方不再具备受理资质时,乙方有权单方面终止本协议。 甲方申请成为乙方特约商户,应主动如实提供经营资质材料及身份证明文件。
甲方应保证上述资料完整、真实、合法、有效。若身份证明文件存在有效期,应在有效期前主动向乙方提供新的证明文件,证明文件失效且经乙方提示仍无合理理由拒绝更新的,乙方有权对甲方采取交易限制措施或终止向甲方提供本协议项下相关的服务。
</div>
</div>
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第九条</b>
甲方应当履行以下基本义务:
<div class="ag-content-content-title-span">
1基于真实的商品或服务交易背景受理银行卡并遵守相应银行卡品牌的受理要求不得歧视和拒绝同一银行卡品牌的不同发卡银行的持卡人
</div>
<div class="ag-content-content-title-span">
2按规定使用受理终端网络支付接口和收单结算账户不得利用其从事或协助他人从事非法活动
</div>
<div class="ag-content-content-title-span">3妥善处理交易数据信息、保存交易凭证保障交易信息安全
</div>
<div class="ag-content-content-title-span">
4不得因持卡人使用银行卡而向持卡人收取或变相收取附加费用或降低服务水平
</div>
<div class="ag-content-content-title-span">
5不得存储持卡人银行卡的磁道信息或芯片信息、验证码、有效期、密码等敏感信息
</div>
<div class="ag-content-content-title-span">6确保网络支付指令的真实性、准确性、合法性</div>
<div class="ag-content-content-title-span">
7仅在中华人民共和国境内不包含香港特别行政区、澳门特别行政区及台湾地区使用本支付服务。
</div>
</div>
</div>
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第十条 </b>
对经<b>查实</b>的交易差错或甲方需调整的账务,乙方负责按照中国银联或其他卡组织差错处理的有关规定进行相应处理。对有疑议的交易,乙方有权向甲方调单。
</div>
</div>
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第十一条 </b>
甲方需保存所有交易的签购单及其他的交易证明材料,<b>保存期限自交易日起至少2年</b>,如因甲方资料保存不善造成的风险损失由甲方自行承担。
</div>
</div>
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第十二条</b>
在出现交易纠纷、持卡人调退单或乙方有合理理由认定交易有可疑之处时,乙方有权查验甲方原始交易签购单及相关交易证明材料,并影印留存。
甲方应根据乙方要求提供真实的交易受理情况对于乙方提出的调取交易证明材料的要求甲方应自乙方通知之日起3个工作日内提供有效交易证明材料。
</div>
</div>
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第十三条</b>
<b>甲方发生以下情况时乙方有权采取暂缓甲方全部或部分交易资金结算至少180天以上</b>
</div>
<div class="ag-content-content-title-span"><b>1发卡行发起调、退单</b></div>
<div class="ag-content-content-title-span"><b>2超出约定地理范围使用终端或终端位置无法监测的</b>
</div>
<div class="ag-content-content-title-span">
<b>3交易金额、时间、频率与甲方经营范围、规模不相符等异常情形</b></div>
<div class="ag-content-content-title-span"><b>4疑似虚假申请、银行卡套现、洗钱、欺诈、移机、留存或泄漏持卡人账户信息等风险事件</b>
</div>
<div class="ag-content-content-title-span"><b>5从事其他违反国家法律法规规定的犯罪、违法活动</b>
</div>
<div class="ag-content-content-title-span"><b>6乙方认为甲方调退单比例过高、交易纠纷比例过高或有合理理由认定交易存在可疑之处或有合理根据怀疑甲方违反本协议的其他行为</b>
</div>
<div class="ag-content-content-title-span"><b>7被工商等管理部门吊销营业执照或行政许可等从而丧失本协议所列经营资格的</b>
</div>
<div class="ag-content-content-title-span"><b>8将乙方支付接口用于非本协议约定业务或提供给本协议约定外的第三人使用。</b>
</div>
<div class="ag-content-content-title-span">
<b>甲方发生以上第2-8项情况时乙方同时有权设置收款限额、暂停银行卡交易、收回受理终端、关闭网络支付接口、单方面无条件终止本协议等措施由此带给乙方的相关损失和风险责任由甲方承担。
且乙方有权将甲方相关信息报送至中国银联或其他卡组织风险信息共享系统及中国支付清算协会风险信息共享系统,并向执法、监管部门、相关征信机构通报,发现甲方涉嫌电信网络新型违法犯罪的,乙方还有权立即向公安机关报告。</b>
</div>
</div>
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第十四条
发生以下情况时,乙方有权从甲方押金、保证金及交易资金中抵扣相应款项,如前述款项不足抵扣的,甲方应根据乙方要求补足差额资金。对因甲方原因造成的乙方垫款或损失,乙方有权向甲方追索。</b>
<div class="ag-content-content-title-span"><b>1甲方发生退货、冲正、撤销交易</b></div>
<div class="ag-content-content-title-span"><b>2由于计算错误或其它原因导致乙方向甲方多支付的款项或其它经甲方确认的长款</b>
</div>
<div class="ag-content-content-title-span">
<b>3因甲方原因导致的发卡机构退单或卡组织追究乙方违约金</b></div>
<div class="ag-content-content-title-span"><b>4名义经营范围与实际情况不符而造成的本协议项下的费用差额补偿部分补偿部分的时限为自发现日起前180天</b>
</div>
<div class="ag-content-content-title-span">
<b>5甲方违反本协议约定导致乙方先行垫付相关方赔偿还款的</b></div>
<div class="ag-content-content-title-span"><b>6其它应由甲方支付的款项。</b></div>
<div class="ag-content-content-title-span"><b>本条款不随双方协议终止而终止,乙方在法律规定的诉讼时效内,均有权就合作期间甲方因本条款给乙方造成的损失向甲方追索。</b>
</div>
</div>
</div>
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第十五条</b>
乙方有权对甲方进行风险评级,如甲方风险等级较高,乙方对其开通的受理卡种和交易类型进行限制,并采取强化交易监测、设置交易限额、延迟结算、增加检查频率、建立特约商户风险准备金等风险管理措施。
</div>
</div>
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第十六条</b>
乙方有权对甲方经营场所进行现场检查,如甲方无固定经营场所,乙方有权要求甲方定期上传经营影像或照片。
</div>
</div>
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第十七条</b>
如甲方连续3个月未发生交易的乙方有权重新核验甲方商户身份如无法核实或核实后不再具备受理资质时乙方有权单方面终止本协议
<b>如甲方连续12个月未发生交易的乙方有权单方面终止本协议。</b>
</div>
</div>
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第十八条
乙方除有权根据本协议及附件约定外,还有权根据中国人民银行、中国银联、境外卡组织、中国清算协会已发布的及后续发布的各类通知、要求、指导意见等规范性文件内容对甲方进行监督管理并采取必要措施。</b>
</div>
</div>
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第十九条 </b>甲方所有在线操作包括在乙方网站、业务系统、微信服务平台、APP等的操作和交易甲方的登录账号和密码是乙方验证甲方身份的重要印签甲方对此负有保密责任。
<b>凡使用甲方登录账号和密码进行的线上操作和交易均视为甲方亲自办理的有效委托,具有同书面委托同等的法律效力。
甲方对使用甲方登录账号和密码进行的所有线上操作及交易结果承担全部经济和法律责任,有证据证明系乙方原因导致甲方账号、密码泄露的情形除外。</b>
</div>
</div>
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第二十条
甲方同意并指定数据处理方(含其分支机构及总公司,详见《拉卡拉商户注册登记表》)为其提供数据处理服务,同意并授权数据处理方为终端布放与受理标识张贴、终端维护、商户培训、耗材配送、交易证明材料调取、对账目的收集、
存储并向乙方传送甲方通过线下或线上方式提供的入网信息(包括但不限于《拉卡拉商户注册登记表》中的信息、商户提交的电子版及纸质版资料以及监管部门要求的其他信息),同意并授权乙方将甲方金融信息(包括甲方企业名称、统一社会信用代码、法定代表人姓名及证件号码、经营地址、联系人姓名及证件号码、联系人手机号、联系人电子邮箱、结算账户信息、交易数据、入账信息、对账单明细数据,下同)提供给数据处理方,同意并授权数据处理方从乙方接收并处理前述甲方相关信息。
乙方已要求数据处理方按照国家法律法规规定对该等信息采取安全保护措施。若甲方不同意前述授权甲方可拨打乙方客服电话95016取消授权。</b>
</div>
</div>
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第二十一条
甲方同意并授权乙方直接或通过数据处理方接收并按以下方式使用甲方信息将甲方通过线下或线上方式提供的入网信息(包括但不限于《拉卡拉商户注册登记表》中的信息、商户提交的电子版及纸质版资料以及监管部门要求的其他信息)用于乙方支付业务特约商户入网审核、反洗钱管理、实名制管理、风控评估。
同时,甲方同意并授权乙方以加密传输方式将甲方信息共享给具备提供验证服务资质的第三方机构进行一致性比对并输出核验结果,同意并授权第三方机构使用甲方的信息用于验证服务并以加密传输的方式向乙方返回核验结果。</b>
</div>
</div>
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第二十二条
鉴于甲方结算账户所属银行会不定期开展商户手续费补贴等营销活动甲方同意乙方推荐甲方参加结算行账户所属银行的营销活动将甲方金融信息提供给甲方结算账户所属银行包括该银行相关分支行用于评估甲方是否符合活动要求对营销活动期间相关数据进行风控管理、考核对账的目的甲方同意并授权银行从乙方接收并处理前述甲方相关信息。乙方已要求银行按照国家法律法规规定对该等信息采取安全保护措施。若甲方不同意前述授权甲方可拨打乙方客服电话95016取消授权。</b>
</div>
</div>
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第二十三条</b>
乙方将对甲方金融信息严格保密,除本协议约定情形外,不会泄露或者非法向他人提供甲方金融信息。
</div>
</div>
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第二十四条
本协议执行过程中,如中国人民银行、中国银联、境外卡组织等相关监管机构或行业组织的相关规定或乙方业务规则、市场政策发生变化,导致支付业务规则发生变化或者本协议项下的费用发生变化,乙方可以单方面调整相关条款约定。</b>
</div>
<div class="ag-content-content-title-span"><b>甲方理解并同意乙方采取在官方网站公告、电子服务渠道信息推送、邮件或短信通知等方式向甲方发起变更通知。如甲方不同意该变更后的内容,应停止使用乙方服务;
如甲方在获知或在合理时限内应当获知乙方变更通知后,仍继续使用乙方服务的,视为同意对协议涉及条款进行变更。</b></div>
</div>
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第二十五条</b>
甲方可通过【拉卡拉商户通APP】或客服热线95016进行业务咨询、查账、投诉等操作。
</div>
</div>
<div class="ag-content-content">
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第二十六条</b>
任何一方违反本协议约定,另一方有权要求在合理期限内纠正,要求赔偿因此遭受的直接经济损失。但<b>任何一方均无须向对方的间接损失、预期利益承担赔偿责任。</b>
</div>
</div>
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第二十七条</b>
除本协议另有约定外双方均有权根据业务需要单方解除或终止本协议但应提前30天通知对方。
</div>
</div>
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第二十八条</b> 通知</div>
<div class="ag-content-content-title-span">
1甲方确认其在《拉卡拉商户注册登记表》中指定的“联系人”、“联系地址”、“联系人电子邮箱”、“联系人电话”等联系信息可用于乙方处理本协议项下事务时向甲方履行通知、文件物品递送义务。
其中,“联系人”负责对本协议所涉事务的沟通、文件物品的签收、移交等事宜。乙方发送到甲方指定的“联系地址”、“联系人电子邮箱”即视为对甲方的有效送达。
</div>
<div class="ag-content-content-title-span">
2甲方确认其变更《拉卡拉商户注册登记表》中指定的联系信息时应至少提前5个工作日以书面方式通知乙方。因甲方未及时通知导致乙方依照本协议约定联系信息履行通知、文件物品递送义务的乙方的通知、文件物品包括但不限于设备、文件及资料等自发送之日起第3个工作日视为乙方送达之日。</b></div>
</div>
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第二十九条</b> 争议解决
<div class="ag-content-content-title-span">
1双方在履行本协议过程中发生的任何争议双方应首先协商解决协商不成任何一方可将该争议<b>提请上海国际经济贸易仲裁委员会按照该会仲裁规则进行仲裁。</b>
</div>
<div class="ag-content-content-title-span">
2由于计算错误或其它原因导致乙方向甲方多支付的款项或其它经甲方确认的长款。
</div>
<div class="ag-content-content-title-span">
3因甲方原因导致的发卡机构退单或卡组织追究乙方违约金。
</div>
</div>
</div>
<div class="ag-content-content">
<div class="ag-content-content-title"><b>第三十条</b> 协议生效</div>
<div class="ag-content-content-title-span">1. 本协议自甲方签字后生效,有效期为一年。
有效期届满后如双方无任何书面异议,本协议将自动延期,每次延期一年,依此类推。若甲乙任何一方对延期有异议,应于协议当次届满前一个月向对方书面提出异议。
甲乙双方过往签订的协议如与本协议有冲突以本协议为准。
</div>
<div class="ag-content-content-title-span">2.
本协议未尽事宜,双方可另行协商签订补充协议,本协议附件及补充协议是本协议不可分割的组成部分。
</div>
<b>
<div class="ag-content-content-title-span">3.
本协议附件包括《银行卡支付业务服务条款》、《拉卡拉扫码支付业务条款》、《境外银行卡支付业务条款》、《互联网支付服务条款》及其子附件(《代付服务基本条款》、《互联网快捷支付服务基本条款》、
《网银B2C/B2B支付服务基本条款》、《协议支付服务基本条款》、《第三方支付服务基本条款》、《拉卡拉用户隐私政策》上述附件由甲方登陆拉卡拉官方网站www.lakala.com查阅、下载并留存。
上述附件内容与本协议约定冲突的,以本协议约定为准。
</div>
<div class="ag-content-content-title-span">4.
本协议中,乙方遵照监管规范,按照最少必要原则收集、使用甲方的金融信息,用以向甲方提供服务、保障服务质量、保障甲方的账户和资金安全以及符合国家法律法规及监管规定要求,如果不同意,可能会影响服务的开通和部分服务的使用。
更多关于用户金融信息保护的内容,请查阅《拉卡拉用户隐私政策》
</div>
</b>
</div>
<div class="ag-content-content">
<div class="ag-content-content-title">
<b>甲方声明:乙方已采取合理方式提请甲方注意本协议、附件及官方网站公示内容的条款,并详细说明;甲方在本协议上签字视为同意本协议、附件及官方网站公示内容的条款。</b>
</div>
</div>
<div class="ag-content-content">
<div class="ag-content-content-title">
<div class="table">
<br/>
<br/>
<div class="table-title"><b>拉卡拉商户注册登记表</b></div>
<br/>
<br/>
<div class="table-content">
<table style="text-align: center" border="0"
cellspacing="1"
cellpadding="4">
<tr colspan="4">
<td colspan="4" class="tb-title"><b>执照信息</b></td>
</tr>
<tr style="width: 100%;">
<td style=""><span class="td-con"> 营业执照号</span>
</td>
<td style="">${licenseNo}</td>
<td style=""><span class="td-con"> 法人</span>
</td>
<td style="">${legalName}</td>
</tr>
<tr>
<td style="">执照名/商户名</td>
<td style="">${licenseName}</td>
<td style="">身份证号</td>
<td style="">${identityNo}</td>
</tr>
<tr>
<td style="">所在区域</td>
<td style="">${address}</td>
<td style="">有效期</td>
<td style="">${identityNoExpire}</td>
</tr>
<tr>
<td style="">详细地址</td>
<td colspan="3" style="">${receiveDetail}</td>
</tr>
<tr colspan="4">
<td colspan="4" class="tb-title"><b>结算信息</b></td>
</tr>
<tr>
<td style="">入账户名</td>
<td style="">${accountName}</td>
<td style="}">身份证号</td>
<td style="">${accountIdCard}</td>
</tr>
<tr>
<td style="">入款账号</td>
<td style="">${accountNo}</td>
<td style="">有效期</td>
<td style="">${accountIdDtEnd}</td>
</tr>
<tr>
<td style="">开户行</td>
<td colspan="3">${bankName}</td>
</tr>
<tr colspan="4">
<td colspan="4" class="tb-title"><b>商户信息</b></td>
</tr>
<tr>
<td style="">签购单名称</td>
<td style="">${licenseName}</td>
<td style="">对账单邮箱</td>
<td style="">${mail}</td>
</tr>
<tr>
<td style="">联系人</td>
<td style="">${contactManName}</td>
<td style="">商户类别</td>
<td style="">${channelType}</td>
</tr>
<tr>
<td style="">手机号</td>
<td style="">${phone}</td>
<td style="">商户地址</td>
<td style="">${receiveDetail}</td>
</tr>
<tr>
<td style="">数据处理方</td>
<td colspan="3">${agencyName}</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -349,7 +349,7 @@ public class MerchantChannelStatus {
String status = merchantChannelStatus.getStatus();
String thirdStatus = merchantChannelStatus.getThirdStatus();
if (!MerchantChannelStatus.AUDIT_STATUS_EXAMINING.equals(status) || !AUDIT_THIRD_STATUS_WAITING.equals(thirdStatus)) {
if (MerchantChannelStatus.AUDIT_STATUS_REJECT.equals(status)||!MerchantChannelStatus.AUDIT_STATUS_EXAMINING.equals(status) || !AUDIT_THIRD_STATUS_WAITING.equals(thirdStatus)) {
MsgException.throwException("不符合商户审核条件");
}
}

View File

@ -1,6 +1,8 @@
package cn.pluss.platform.klk.service.impl;
import cn.hutool.core.io.resource.UrlResource;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.json.JSONUtil;
import cn.pluss.platform.BankCardService;
import cn.pluss.platform.IdCardService;
@ -11,20 +13,24 @@ import cn.pluss.platform.entity.*;
import cn.pluss.platform.exception.MsgException;
import cn.pluss.platform.klk.LakalaConfig;
import cn.pluss.platform.klk.service.*;
import cn.pluss.platform.klk.util.HtmlUtil;
import cn.pluss.platform.klk.util.RSAUtil;
import cn.pluss.platform.klk.vo.*;
import cn.pluss.platform.mapper.MerchantChannelFeeMapper;
import cn.pluss.platform.mapper.MerchantChannelStatusMapper;
import cn.pluss.platform.mapper.MerchantImageMapper;
import cn.pluss.platform.mcc.MccReflectService;
import cn.pluss.platform.merchant.AccountService;
import cn.pluss.platform.merchant.MerchantBaseInfoService;
import cn.pluss.platform.merchantChannelStatus.MerchantChannelStatusService;
import cn.pluss.platform.userApp.UserAppService;
import cn.pluss.platform.util.DateUtils;
import cn.pluss.platform.util.StringUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import freemarker.template.TemplateException;
import lombok.Data;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
@ -100,6 +106,10 @@ public class LaKalaInterfaceImpl {
@Autowired
LakalaConfig lakalaConfig;
@Lazy
@Autowired
MerchantImageMapper merchantImageMapper;
private static final String client_id = "chaozhanggui";
private static final String client_secret = "Y54Gqy6aLpxld3dp";
private static final String grant_type = "client_credentials";
@ -148,14 +158,13 @@ public class LaKalaInterfaceImpl {
// private static final String tuoKeToken = "https://test.wsmsd.cn/sit/htkauth/oauth/token";
/**
* 拉卡拉模式进件
*/
/**
* 拉卡拉拓客进件
* */
*/
public void createTuoKeInfo(String userId) {
// UserApp userapp=userAppService.getById(userId);
@ -166,21 +175,24 @@ public class LaKalaInterfaceImpl {
MerchantBaseInfo merchantBaseInfo = mbiService.getMerchantBaseInfoByUserId(userId);
IdCard idCard = idCardService.getCertIdCard(userId); //获取法人身份证信息
MsgException.checkNull(idCard,"商户基本信息不完整");
MsgException.checkNull(idCard, "商户基本信息不完整");
MerchantChannelStatus mcs = mcsService.getByMerchantCodeNoChannel(merchantBaseInfo.getMerchantCode());
if(ObjectUtil.isEmpty(mcs)){
log.info("审核失败,重新审核数据:{}",merchantBaseInfo.getMerchantCode());
QueryWrapper<MerchantChannelStatus> queryWrapper=new QueryWrapper<>();
queryWrapper.eq("merchantCode",merchantBaseInfo.getMerchantCode());
queryWrapper.eq("channel","5");
queryWrapper.eq("status",2);
mcs=merchantChannelStatusMapper.selectOne(queryWrapper);
if (ObjectUtil.isEmpty(mcs)) {
log.info("审核失败,重新审核数据:{}", merchantBaseInfo.getMerchantCode());
QueryWrapper<MerchantChannelStatus> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("merchantCode", merchantBaseInfo.getMerchantCode());
queryWrapper.eq("channel", "5");
List<String> list = new ArrayList<>();
list.add("1");
list.add("2");
queryWrapper.in("status", list);
mcs = merchantChannelStatusMapper.selectOne(queryWrapper);
}
String status=mcs.getStatus();
String thirdStatus=mcs.getThirdStatus();
MsgException.checkNull(mcs,"商户未提交审核");
String status = mcs.getStatus();
String thirdStatus = mcs.getThirdStatus();
MsgException.checkNull(mcs, "商户未提交审核");
if (status.equals(MerchantChannelStatus.AUDIT_STATUS_EXAMINING) && !thirdStatus.equals(MerchantChannelStatus.AUDIT_THIRD_STATUS_WAITING)) {
MsgException.throwException("进件审核中,请等待审核结果");
}
@ -190,45 +202,66 @@ public class LaKalaInterfaceImpl {
}
JSONObject object1 = new JSONObject();
JSONObject object2 = new JSONObject();
object1.put("userNo", userNo); //合作机构信息 由拓客SAAS提供
object1.put("email", "chaozhanggui2023@163.com"); //商户邮箱
object1.put("busiCode", "WECHAT_PAY");//业务类型 BPOS:传统POS, ZPOS:电签,ZPOS4G4G电签,SUPER_POS:智能pos,B_WIZARD:蓝精灵,PAPER_CODE:码牌,WECHAT_PAY:专业化扫码,KLYX:云音箱,QRCODE:收款王,MONEY_BOX:收钱宝盒根据业务开放取值
object1.put("merRegName", merchantBaseInfo.getAlias()); //商户注册名称 不能少于七个中文
object1.put("merType", (merchantBaseInfo.getMerchantType().equals(1)||merchantBaseInfo.getMerchantType().equals("2"))?"TP_PERSONAL":"TP_MERCHANT"); //商户注册类型 TP_MERCHANT:企业 TP_PERSONAL:微个
object1.put("merType", (merchantBaseInfo.getMerchantType().equals(1) || merchantBaseInfo.getMerchantType().equals("2")) ? "TP_PERSONAL" : "TP_MERCHANT"); //商户注册类型 TP_MERCHANT:企业 TP_PERSONAL:微个
object1.put("merName", merchantBaseInfo.getAlias()); //商户名称(经营名称) 不能少于七个中文
object1.put("merAddr", merchantBaseInfo.getAddress()); //去掉省市区后的详细地址
object1.put("provinceCode", tbPlussRegionLklService.getOne(new QueryWrapper<TbPlussRegionLklEntity>().likeRight("name",merchantBaseInfo.getProvince()).last("limit 1")).getCode()); //省代码 通过地区信息获取地区查询接口获取 对应 code字段
object1.put("cityCode", tbPlussRegionLklService.getOne(new QueryWrapper<TbPlussRegionLklEntity>().likeRight("name",merchantBaseInfo.getCity()).last("limit 1")).getCode()); // 市代码 通过地区信息获取地区查询接口获取 对应 code字段
object1.put("countyCode", tbPlussRegionLklService.getOne(new QueryWrapper<TbPlussRegionLklEntity>().likeRight("name",merchantBaseInfo.getDistrict()).last("limit 1")).getCode()); // 区县代码 通过地区信息获取地区查询接口获取 对应 code字段
if(!merchantBaseInfo.getMerchantType().equals("1")){
object1.put("provinceCode", tbPlussRegionLklService.getOne(new QueryWrapper<TbPlussRegionLklEntity>().likeRight("name", merchantBaseInfo.getProvince()).last("limit 1")).getCode()); //省代码 通过地区信息获取地区查询接口获取 对应 code字段
object1.put("cityCode", tbPlussRegionLklService.getOne(new QueryWrapper<TbPlussRegionLklEntity>().likeRight("name", merchantBaseInfo.getCity()).last("limit 1")).getCode()); // 市代码 通过地区信息获取地区查询接口获取 对应 code字段
object1.put("countyCode", tbPlussRegionLklService.getOne(new QueryWrapper<TbPlussRegionLklEntity>().likeRight("name", merchantBaseInfo.getDistrict()).last("limit 1")).getCode()); // 区县代码 通过地区信息获取地区查询接口获取 对应 code字段
Set<Object> attchmentsVoSet = new HashSet<>();
QueryWrapper<Account> accountQueryWrapper1 = new QueryWrapper<>();
accountQueryWrapper1.eq("userId", userId);
accountQueryWrapper1.eq("channelType", "D1");
Account accountServiceOne1 = accountService.getOne(accountQueryWrapper1);
MsgException.checkNull(accountServiceOne1, "结算信息未提交");
QueryWrapper<BankCard> bankCardWrapper = new QueryWrapper<>();
bankCardWrapper.eq("id", accountServiceOne1.getBankCardId());
BankCard userBrakCard = bankCardService.getOne(bankCardWrapper);
MsgException.checkNull(userBrakCard, "结算卡信息未提交");
QueryWrapper<MccReflect> userAppQueryWrapper = new QueryWrapper();
userAppQueryWrapper.eq("standard_mcc_code", merchantBaseInfo.getMcc()).eq("channel_id", "5").last("limit 1");
MccReflect mccReflect = service.getOne(userAppQueryWrapper);
if (!merchantBaseInfo.getMerchantType().equals("1")) {
object1.put("merRegName", merchantBaseInfo.getMerchantName());
object1.put("merName", merchantBaseInfo.getMerchantName());
object1.put("licenseName", merchantBaseInfo.getBussAuthName()); //营业执照名称
object1.put("licenseNo", merchantBaseInfo.getBussAuthNum()); //营业执照号码 微商户可不传 其他必传
StringBuffer startSb=new StringBuffer();
StringBuffer endSb=new StringBuffer();
StringBuffer startSb = new StringBuffer();
StringBuffer endSb = new StringBuffer();
if(merchantBaseInfo.getBussAuthStartTime().contains("")){
startSb.append(merchantBaseInfo.getBussAuthStartTime().substring(0,4));
if (merchantBaseInfo.getBussAuthStartTime().contains("")) {
startSb.append(merchantBaseInfo.getBussAuthStartTime().substring(0, 4));
startSb.append("-");
startSb.append(merchantBaseInfo.getBussAuthStartTime().substring(5,7));
startSb.append(merchantBaseInfo.getBussAuthStartTime().substring(5, 7));
startSb.append("-");
startSb.append(merchantBaseInfo.getBussAuthStartTime().substring(8,10));
}else {
startSb.append(merchantBaseInfo.getBussAuthStartTime().substring(8, 10));
} else {
startSb.append(merchantBaseInfo.getBussAuthStartTime());
}
if(ObjectUtil.isEmpty(merchantBaseInfo.getBussAuthEndTime()) ||"长期".equals(merchantBaseInfo.getBuslicType())){
if (ObjectUtil.isEmpty(merchantBaseInfo.getBussAuthEndTime()) || "长期".equals(merchantBaseInfo.getBuslicType())) {
endSb.append("2099-12-31");
}else {
if(merchantBaseInfo.getBussAuthEndTime().contains("")){
endSb.append(merchantBaseInfo.getBussAuthEndTime().substring(0,4));
} else {
if (merchantBaseInfo.getBussAuthEndTime().contains("")) {
endSb.append(merchantBaseInfo.getBussAuthEndTime().substring(0, 4));
endSb.append("-");
endSb.append(merchantBaseInfo.getBussAuthEndTime().substring(5,7));
endSb.append(merchantBaseInfo.getBussAuthEndTime().substring(5, 7));
endSb.append("-");
endSb.append(merchantBaseInfo.getBussAuthEndTime().substring(8,10));
}else {
endSb.append(merchantBaseInfo.getBussAuthEndTime().substring(8, 10));
} else {
endSb.append(merchantBaseInfo.getBussAuthEndTime());
}
@ -238,6 +271,61 @@ public class LaKalaInterfaceImpl {
object1.put("licenseDtStart", startSb); //营业执照开始时间微商户可不传 其他必传格式yyyy-MM-dd
object1.put("licenseDtEnd", endSb); //微商户可不传 其他必传格式yyyy-MM-dd
QueryWrapper<MerchantImage> imageQueryWrapper = new QueryWrapper<>();
imageQueryWrapper.eq("merchantCode", merchantBaseInfo.getMerchantCode());
imageQueryWrapper.eq("photoType", "03");
MerchantImage image = merchantImageMapper.selectOne(imageQueryWrapper);
MsgException.checkNull(image, "营业执照不存在");
//营业执照
AttchmentsVo business_licence = new AttchmentsVo(); //图片set
business_licence.setId(laKaLaFileUpload(image.getPicUrl(), "BUSINESS_LICENCE"));//营业执照
business_licence.setType("BUSINESS_LICENCE");//营业执照
attchmentsVoSet.add(business_licence);
//开户许可证
AttchmentsVo opening_permit = new AttchmentsVo(); //图片set
opening_permit.setId(laKaLaFileUpload(userBrakCard.getLicenseUrl(), "OPENING_PERMIT"));//开户许可证
opening_permit.setType("OPENING_PERMIT");//开户许可证
attchmentsVoSet.add(opening_permit);
Map<String, Object> data = new HashMap<>();
data.put("customerName", merchantBaseInfo.getMerchantName());
data.put("licenseNo", merchantBaseInfo.getBussAuthNum());
data.put("legalName", idCard.getCertName());
data.put("licenseName", merchantBaseInfo.getMerchantName());
data.put("identityNo", idCard.getCertNo());
data.put("address", merchantBaseInfo.getProvince().concat(merchantBaseInfo.getCity()).concat(merchantBaseInfo.getDistrict()));
data.put("receiveDetail", merchantBaseInfo.getProvince().concat(merchantBaseInfo.getCity()).concat(merchantBaseInfo.getDistrict()).concat(merchantBaseInfo.getAddress()));
data.put("identityNoExpire", endSb);
data.put("accountName", userBrakCard.getBankHolder());
data.put("accountIdCard", idCard.getCertNo());
data.put("accountNo", userBrakCard.getBankCardNo());
data.put("accountIdDtEnd", idCard.getCertEndTime().equals("长期") ? "2099-12-31" : DateUtils.convertString(idCard.getCertEndTime()));
data.put("bankName", userBrakCard.getBankName());
data.put("mail", "chaozhanggui2023@163.com");
data.put("contactManName", userBrakCard.getPhone());
data.put("channelType", ObjectUtils.isEmpty(mccReflect) ? "7399" : mccReflect.getMccCode());
data.put("phone", userBrakCard.getPhone());
data.put("agencyName", merchantBaseInfo.getBussAuthNum());
// //协议
AttchmentsVo agree_ment = new AttchmentsVo(); //图片set
try {
agree_ment.setId(laKaLaFileUpload(HtmlUtil.createAgreementPicture(HtmlUtil.writeHtml(data)),"AGREE_MENT"));//协议
agree_ment.setType("AGREE_MENT");//协议
attchmentsVoSet.add(agree_ment);
} catch (IOException e) {
throw new RuntimeException(e);
} catch (TemplateException e) {
throw new RuntimeException(e);
}
}
object1.put("latitude", "108.94647"); //经度 进件所在地址经度error
@ -254,23 +342,10 @@ public class LaKalaInterfaceImpl {
object1.put("contactName", merchantBaseInfo.getContactName()); //商户联系姓名
QueryWrapper<Account> accountQueryWrapper1 = new QueryWrapper<>();
accountQueryWrapper1.eq("userId", userId);
accountQueryWrapper1.eq("channelType", "D1");
Account accountServiceOne1 = accountService.getOne(accountQueryWrapper1);
MsgException.checkNull(accountServiceOne1,"结算信息未提交");
QueryWrapper<BankCard> bankCardWrapper = new QueryWrapper<>();
bankCardWrapper.eq("id", accountServiceOne1.getBankCardId());
BankCard userBrakCard = bankCardService.getOne(bankCardWrapper);
MsgException.checkNull(userBrakCard,"结算卡信息未提交");
QueryWrapper<TbPlussBankBranchLklEntity> lklEntityQueryWrapper = new QueryWrapper<>();
lklEntityQueryWrapper.eq("branch_bank_no", userBrakCard.getContactLine());
TbPlussBankBranchLklEntity lakalaBranchInfo = tbPlussBankBranchLklService.getOne(lklEntityQueryWrapper);
MsgException.checkNull(lakalaBranchInfo,"结算卡对应的分行支行信息不存在");
MsgException.checkNull(lakalaBranchInfo, "结算卡对应的分行支行信息不存在");
object1.put("openningBankCode", lakalaBranchInfo.getBranchBankNo()); //结算账户开户 通过银行列表查询接口获取 对应 branchBankNo字段
object1.put("openningBankName", lakalaBranchInfo.getBranchBankName()); //结算账户开户名称 通过银行列表查询接口获取 对应 branchBankName字段
@ -280,11 +355,11 @@ public class LaKalaInterfaceImpl {
QueryWrapper<TbPlussBankRegionLklEntity> regionLklEntityQueryWrapper = new QueryWrapper<>();
regionLklEntityQueryWrapper.eq("code", lakalaBranchInfo.getAreaCode());
TbPlussBankRegionLklEntity bankParentCode = regionLklService.getOne(regionLklEntityQueryWrapper); //市code name
MsgException.checkNull(bankParentCode,"结算卡对应的省份信息不存在");
MsgException.checkNull(bankParentCode, "结算卡对应的省份信息不存在");
regionLklEntityQueryWrapper.clear();
regionLklEntityQueryWrapper.eq("code", bankParentCode.getParentCode());
TbPlussBankRegionLklEntity parentCode = regionLklService.getOne(regionLklEntityQueryWrapper); //省code 名称
MsgException.checkNull(bankParentCode,"结算卡对应的城市信息不存在");
MsgException.checkNull(bankParentCode, "结算卡对应的城市信息不存在");
object1.put("settleProvinceCode", parentCode.getCode()); //结算信息省份名称 通过地区信息获取银行地区查询接口获取 对应 code字段
object1.put("settleProvinceName", parentCode.getName()); //结算信息省份代码 通过地区信息获取银行地区查询接口获取 对应 name字段
@ -292,16 +367,55 @@ public class LaKalaInterfaceImpl {
object1.put("settleCityName", bankParentCode.getName()); //结算信息城市代码 通过地区信息获取银行地区查询接口获取 对应 name字段
AccountDTO accountV4 = getAccountV4(userId, "D1"); //结算人
MsgException.checkNull(accountV4,"结算信息不存在");
MsgException.checkNull(accountV4, "结算信息不存在");
object1.put("accountNo", accountV4.getBankCard().getBankCardNo()); //结算人银行卡号
object1.put("accountName", accountV4.getBankCard().getBankHolder()); //结算人账户名称
object1.put("accountType", accountV4.getBankCard().getAccountType().equals("01")?"58":"57"); //结算账户类型 57 对公 58 对私
object1.put("accountType", accountV4.getBankCard().getAccountType().equals("01") ? "58" : "57"); //结算账户类型 57 对公 58 对私
// object1.put("accountIdType",tuoKeVo.getUserNo()); //结算证件类型 为空同法
object1.put("accountIdCard", accountV4.getIdcard().getCertNo()); //结算证件号码
if (!accountV4.getBankCard().getAccountType().equals("1")) {
QueryWrapper<MerchantImage> imageQueryWrapper = new QueryWrapper<>();
imageQueryWrapper.eq("merchantCode", merchantBaseInfo.getMerchantCode());
imageQueryWrapper.eq("photoType", "08");
MerchantImage image = merchantImageMapper.selectOne(imageQueryWrapper);
MsgException.checkNull(image, "收银台照片不存在");
JSONArray array=new JSONArray();
//对公收银台照片
AttchmentsVo checkstand_img = new AttchmentsVo();
checkstand_img.setId(laKaLaFileUpload(accountV4.getIdcard().getImgNegative(), "CHECKSTAND_IMG")); //收银台照片
checkstand_img.setType("CHECKSTAND_IMG");//收银台照片
attchmentsVoSet.add(checkstand_img);
imageQueryWrapper.clear();
imageQueryWrapper.eq("merchantCode", merchantBaseInfo.getMerchantCode());
imageQueryWrapper.eq("photoType", "06");
image = merchantImageMapper.selectOne(imageQueryWrapper);
MsgException.checkNull(image, "门头照片不存在");
//门头照片
AttchmentsVo shop_outside_img = new AttchmentsVo();
shop_outside_img.setId(laKaLaFileUpload(image.getPicUrl(), "SHOP_OUTSIDE_IMG"));//门头照片
shop_outside_img.setType("SHOP_OUTSIDE_IMG");
attchmentsVoSet.add(shop_outside_img);
imageQueryWrapper.clear();
imageQueryWrapper.eq("merchantCode", merchantBaseInfo.getMerchantCode());
imageQueryWrapper.eq("photoType", "09");
image = merchantImageMapper.selectOne(imageQueryWrapper);
MsgException.checkNull(image, "商铺内部照片不存在");
//商铺内部照片
AttchmentsVo shop_inside_img = new AttchmentsVo();
shop_inside_img.setId(laKaLaFileUpload(image.getPicUrl(), "SHOP_INSIDE_IMG"));//商铺内部照片
shop_inside_img.setType("SHOP_INSIDE_IMG");
attchmentsVoSet.add(shop_inside_img);
}
JSONArray array = new JSONArray();
Set<FeesSetVo> feesSet = new HashSet<>();
FeesSetVo w = new FeesSetVo();
@ -325,22 +439,19 @@ public class LaKalaInterfaceImpl {
object2.put("termNum", "5"); //终端数量 1-5 5个终端
object2.put("fees", feesSet); //费率集合
QueryWrapper<MccReflect> userAppQueryWrapper = new QueryWrapper();
userAppQueryWrapper.eq("standard_mcc_code", merchantBaseInfo.getMcc()).eq("channel_id", "5").last("limit 1");
MccReflect mccReflect = service.getOne(userAppQueryWrapper);
object2.put("mcc", ObjectUtils.isEmpty(mccReflect)?"7399":mccReflect.getMccCode()); //商户MCC编号 通过 商户类别查询查询小类接口获取 对应 code字段
object2.put("activityId","37"); //归属活动信息 由拓客SAAS分配
object2.put("mcc", ObjectUtils.isEmpty(mccReflect) ? "7399" : mccReflect.getMccCode()); //商户MCC编号 通过 商户类别查询查询小类接口获取 对应 code字段
object2.put("activityId", "37"); //归属活动信息 由拓客SAAS分配
object1.put("bizContent", object2); //业务扩展信息 业务扩展信息
Set<Object> attchmentsVoSet = new HashSet<>();
AttchmentsVo frontLegalPerson = new AttchmentsVo(); //图片set
frontLegalPerson.setId(laKaLaFileUpload(accountV4.getIdcard().getImgPositive()));//法人身份证图片地址
frontLegalPerson.setId(laKaLaFileUpload(accountV4.getIdcard().getImgPositive(), "ID_CARD_FRONT"));//法人身份证图片地址
frontLegalPerson.setType("ID_CARD_FRONT");//身份证正
attchmentsVoSet.add(frontLegalPerson);
AttchmentsVo reverseLegalPerson = new AttchmentsVo();
reverseLegalPerson.setId(accountV4.getIdcard().getImgNegative()); //法人身份证图片地址
reverseLegalPerson.setId(laKaLaFileUpload(accountV4.getIdcard().getImgNegative(), "ID_CARD_BEHIND")); //法人身份证图片地址
reverseLegalPerson.setType("ID_CARD_BEHIND");//身份证反
attchmentsVoSet.add(reverseLegalPerson);
@ -351,26 +462,29 @@ public class LaKalaInterfaceImpl {
System.out.println("请求报文: " + object1);
/**获取拓客accessToken**/
Map map = getToken();
String result="";
try{
String result = "";
try {
result = cn.hutool.http.HttpRequest.post(tuoKeMerchat)
.header("Authorization", "bearer " + map.get("access_token")).header("content-type", "application/json")
.body(object1.toString()).execute().body();
System.out.println("返回结果:"+result);
System.out.println("返回结果:" + result);
Map arry = (Map) JSONArray.parse(result);
if (String.valueOf(arry.get("status")).equals("WAIT_AUDI")){
PlussMerchantLklEntity plussMerchantLklEntity =new PlussMerchantLklEntity();
if (String.valueOf(arry.get("status")).equals("WAIT_AUDI")) {
PlussMerchantLklEntity plussMerchantLklEntity = new PlussMerchantLklEntity();
plussMerchantLklEntity.setMerchantId(merchantBaseInfo.getMerchantCode());
plussMerchantLklEntity.setMerchantlkl(String.valueOf(arry.get("merchantNo")));
plussMerchantLklEntity.setType("0");
merchantLklService.save(plussMerchantLklEntity);
QueryWrapper<MerchantChannelFee> feeQueryWrapper=new QueryWrapper<>();
feeQueryWrapper.eq("channel","5");
feeQueryWrapper.eq("merchant_code",mcs.getMerchantCode());
MerchantChannelFee merchantChannelFee= merchantChannelFeeMapper.selectOne(feeQueryWrapper);
if(ObjectUtil.isEmpty(merchantChannelFee)){
QueryWrapper<MerchantChannelFee> feeQueryWrapper = new QueryWrapper<>();
feeQueryWrapper.eq("channel", "5");
feeQueryWrapper.eq("merchant_code", mcs.getMerchantCode());
MerchantChannelFee merchantChannelFee = merchantChannelFeeMapper.selectOne(feeQueryWrapper);
if (ObjectUtil.isEmpty(merchantChannelFee)) {
merchantChannelFee = new MerchantChannelFee();
merchantChannelFee.setChannel(5);
merchantChannelFee.setMerchantCode(merchantBaseInfo.getMerchantCode());
merchantChannelFee.setFeeStr(array.toJSONString());
@ -379,7 +493,6 @@ public class LaKalaInterfaceImpl {
}
mcs.setChannel(5);
mcs.setUpdateTime(new Date());
mcs.setMerchantCode(merchantBaseInfo.getMerchantCode());
@ -406,11 +519,11 @@ public class LaKalaInterfaceImpl {
System.out.println(">>>>>>>>>>>>>>>");
}else {
JSONObject object=JSONObject.parseObject(result);
} else {
JSONObject object = JSONObject.parseObject(result);
MsgException.throwException(object.getString("message"));
}
}catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
Map arry = (Map) JSONArray.parse(result);
new MsgException(String.valueOf(arry.get("message")));
@ -418,51 +531,49 @@ public class LaKalaInterfaceImpl {
}
public void merchantAudit(String userId){
public void merchantAudit(String userId) {
MerchantBaseInfo merchantBaseInfo = mbiService.getMerchantBaseInfoByUserId(userId);
MsgException.checkNull(merchantBaseInfo,"商户进件信息不存在");
MsgException.checkNull(merchantBaseInfo, "商户进件信息不存在");
QueryWrapper<MerchantChannelStatus> queryWrapper=new QueryWrapper<>();
queryWrapper.eq("channel","5");
List<Integer> list=new ArrayList<>();
QueryWrapper<MerchantChannelStatus> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("channel", "5");
List<Integer> list = new ArrayList<>();
list.add(1);
list.add(6);
queryWrapper.in("status",list);
queryWrapper.eq("merchantCode",merchantBaseInfo.getMerchantCode());
MerchantChannelStatus mcs =merchantChannelStatusMapper.selectOne(queryWrapper);
MsgException.checkNull(mcs,"对应的商户信息不存在");
queryWrapper.in("status", list);
queryWrapper.eq("merchantCode", merchantBaseInfo.getMerchantCode());
MerchantChannelStatus mcs = merchantChannelStatusMapper.selectOne(queryWrapper);
MsgException.checkNull(mcs, "对应的商户信息不存在");
AccountDTO accountV4 = getAccountV4(userId, "D1"); //结算人
MsgException.checkNull(accountV4,"结算信息不存在");
MsgException.checkNull(accountV4, "结算信息不存在");
JSONObject object=new JSONObject();
object.put("accountKind",accountV4.getBankCard().getAccountType().equals("01")?"58":"57");
JSONObject object = new JSONObject();
object.put("accountKind", accountV4.getBankCard().getAccountType().equals("01") ? "58" : "57");
object.put("accountNo", accountV4.getBankCard().getBankCardNo()); //结算人银行卡号
object.put("accountName", accountV4.getBankCard().getBankHolder()); //结算人账户名称
Set<ConcurrentMap<String,String>> attchmentsVoSet=new HashSet<>();
ConcurrentMap<String,String> frontLegalPersonMap=new ConcurrentHashMap<>();
frontLegalPersonMap.put("imgPath",laKaLaFileUpload(accountV4.getIdcard().getImgPositive()));
frontLegalPersonMap.put("imgType","ID_CARD_FRONT");
Set<ConcurrentMap<String, String>> attchmentsVoSet = new HashSet<>();
ConcurrentMap<String, String> frontLegalPersonMap = new ConcurrentHashMap<>();
frontLegalPersonMap.put("imgPath", laKaLaFileUpload(accountV4.getIdcard().getImgPositive(), "ID_CARD_FRONT"));
frontLegalPersonMap.put("imgType", "ID_CARD_FRONT");
attchmentsVoSet.add(frontLegalPersonMap);
ConcurrentMap<String,String> reverseLegalPersonMap=new ConcurrentHashMap<>();
reverseLegalPersonMap.put("imgPath",laKaLaFileUpload(accountV4.getIdcard().getImgNegative()));
reverseLegalPersonMap.put("imgType","ID_CARD_BEHIND");
ConcurrentMap<String, String> reverseLegalPersonMap = new ConcurrentHashMap<>();
reverseLegalPersonMap.put("imgPath", laKaLaFileUpload(accountV4.getIdcard().getImgNegative(), "ID_CARD_BEHIND"));
reverseLegalPersonMap.put("imgType", "ID_CARD_BEHIND");
attchmentsVoSet.add(reverseLegalPersonMap);
object.put("attachments",attchmentsVoSet);
object.put("attachments", attchmentsVoSet);
QueryWrapper<Account> accountQueryWrapper1 = new QueryWrapper<>();
accountQueryWrapper1.eq("userId", userId);
accountQueryWrapper1.eq("channelType", "D1");
Account accountServiceOne1 = accountService.getOne(accountQueryWrapper1);
MsgException.checkNull(accountServiceOne1,"结算信息未提交");
MsgException.checkNull(accountServiceOne1, "结算信息未提交");
QueryWrapper<BankCard> bankCardWrapper = new QueryWrapper<>();
@ -473,30 +584,30 @@ public class LaKalaInterfaceImpl {
QueryWrapper<TbPlussBankBranchLklEntity> lklEntityQueryWrapper = new QueryWrapper<>();
lklEntityQueryWrapper.eq("branch_bank_no", userBrakCard.getContactLine());
TbPlussBankBranchLklEntity lakalaBranchInfo = tbPlussBankBranchLklService.getOne(lklEntityQueryWrapper);
MsgException.checkNull(lakalaBranchInfo,"结算卡对应的分行支行信息不存在");
MsgException.checkNull(lakalaBranchInfo, "结算卡对应的分行支行信息不存在");
object.put("bankNo", lakalaBranchInfo.getBranchBankNo()); //结算账户开户 通过银行列表查询接口获取 对应 branchBankNo字段
object.put("bankName", lakalaBranchInfo.getBranchBankName()); //结算账户开户名称 通过银行列表查询接口获取 对应 branchBankName字段
object.put("clearingBankNo", lakalaBranchInfo.getClearNo()); //结算账户清算 通过银行列表查询接口获取 对应 clearNo字段
JSONObject req=new JSONObject();
req.put("dto",object);
req.put("customerNo",Integer.valueOf(mcs.getMerchantId()));
JSONObject req = new JSONObject();
req.put("dto", object);
req.put("customerNo", Integer.valueOf(mcs.getMerchantId()));
Map map = getModifyToken("19191703856","klb1qaz");
String result="";
Map map = getModifyToken("19191703856", "klb1qaz");
String result = "";
try {
String url="https://tkapi.lakala.com/htkmerchants/channel/customer/update/settle/";
String url = "https://tkapi.lakala.com/htkmerchants/channel/customer/update/settle/";
result = cn.hutool.http.HttpRequest.post(url.concat(mcs.getMerchantId()))
.header("Authorization", "bearer " + map.get("access_token")).header("content-type", "application/json")
.body(req.toString()).execute().body();
System.out.println("返回结果:" + result);
Map arry = (Map) JSONArray.parse(result);
if(arry.containsKey("message")&&"SUCCESS".equals(arry.get("message")+"")){
if (arry.containsKey("message") && "SUCCESS".equals(arry.get("message") + "")) {
// 保存商户进件修改记录
MerchantAuditRecord updateRecord = new MerchantAuditRecord();
updateRecord.setMerchantId(mcs.getMerchantId());
updateRecord.setApplicationId(arry.get("reviewRelatedId")+"");
updateRecord.setApplicationId(arry.get("reviewRelatedId") + "");
updateRecord.setChannel(5);
updateRecord.setStatus("1");
updateRecord.setMerchantCode(merchantBaseInfo.getMerchantCode());
@ -504,96 +615,94 @@ public class LaKalaInterfaceImpl {
merchAuditRecService.save(updateRecord);
// 修改商户状态
mcs.setStatus(MerchantChannelStatus.AUDIT_STATUS_DATA_EDIT);
mcs.setApplicationId(arry.get("reviewRelatedId")+"");
mcs.setApplicationId(arry.get("reviewRelatedId") + "");
mcsService.updateById(mcs);
}else {
} else {
MsgException.throwException("修改进件信息失败");
}
}catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
}
}
@Autowired
@Lazy
MerchantChannelFeeMapper merchantChannelFeeMapper;
public void merchAuditFee(String userId){
public void merchAuditFee(String userId) {
MerchantBaseInfo merchantBaseInfo = mbiService.getMerchantBaseInfoByUserId(userId);
MsgException.checkNull(merchantBaseInfo,"商户进件信息不存在");
MsgException.checkNull(merchantBaseInfo, "商户进件信息不存在");
QueryWrapper<MerchantChannelStatus> queryWrapper=new QueryWrapper<>();
queryWrapper.eq("channel","5");
List<Integer> list=new ArrayList<>();
QueryWrapper<MerchantChannelStatus> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("channel", "5");
List<Integer> list = new ArrayList<>();
list.add(1);
list.add(6);
queryWrapper.in("status",list);
queryWrapper.eq("merchantCode",merchantBaseInfo.getMerchantCode());
MerchantChannelStatus mcs =merchantChannelStatusMapper.selectOne(queryWrapper);
MsgException.checkNull(mcs,"对应的商户信息不存在");
queryWrapper.in("status", list);
queryWrapper.eq("merchantCode", merchantBaseInfo.getMerchantCode());
MerchantChannelStatus mcs = merchantChannelStatusMapper.selectOne(queryWrapper);
MsgException.checkNull(mcs, "对应的商户信息不存在");
QueryWrapper<MerchantChannelFee> feeQueryWrapper=new QueryWrapper<>();
feeQueryWrapper.eq("channel","5");
feeQueryWrapper.eq("merchant_code",merchantBaseInfo.getMerchantCode());
QueryWrapper<MerchantChannelFee> feeQueryWrapper = new QueryWrapper<>();
feeQueryWrapper.eq("channel", "5");
feeQueryWrapper.eq("merchant_code", merchantBaseInfo.getMerchantCode());
MerchantChannelFee fee= merchantChannelFeeMapper.selectOne(feeQueryWrapper);
MsgException.checkNull(fee,"费率值为空");
JSONArray array=JSONArray.parseArray(fee.getFeeStr());
JSONArray feeAarray=new JSONArray();
for(int i =0;i< array.size();i++){
JSONObject req=array.getJSONObject(i);
JSONObject object=new JSONObject();
object.put("fee",req.getDoubleValue("feeValue"));
object.put("feeType",req.getString("feeCode"));
MerchantChannelFee fee = merchantChannelFeeMapper.selectOne(feeQueryWrapper);
MsgException.checkNull(fee, "费率值为空");
JSONArray array = JSONArray.parseArray(fee.getFeeStr());
JSONArray feeAarray = new JSONArray();
for (int i = 0; i < array.size(); i++) {
JSONObject req = array.getJSONObject(i);
JSONObject object = new JSONObject();
object.put("fee", req.getDoubleValue("feeValue"));
object.put("feeType", req.getString("feeCode"));
feeAarray.add(object);
}
JSONObject request=new JSONObject();
JSONObject request = new JSONObject();
// JSONObject o=new JSONObject();
// o.put("fees",feeAarray);
request.put("settleType",mcs.getVirChannelFlag());
request.put("fees",feeAarray);
request.put("customerNo",Integer.valueOf(mcs.getMerchantId()));
request.put("settleType", mcs.getVirChannelFlag());
request.put("fees", feeAarray);
request.put("customerNo", Integer.valueOf(mcs.getMerchantId()));
Map map = getModifyToken("19191703856","klb1qaz");
String result="";
Map map = getModifyToken("19191703856", "klb1qaz");
String result = "";
try {
String url="https://tkapi.lakala.com/htkmerchants/channel/customer/update/fee/";
String url = "https://tkapi.lakala.com/htkmerchants/channel/customer/update/fee/";
result = cn.hutool.http.HttpRequest.post(url.concat(mcs.getMerchantId()))
.header("Authorization", "bearer " + map.get("access_token")).header("content-type", "application/json")
.body(request.toString()).execute().body();
System.out.println("返回结果:" + result);
Map arry = (Map) JSONArray.parse(result);
if(arry.containsKey("message")&&"SUCCESS".equals(arry.get("message")+"")){
if (arry.containsKey("message") && "SUCCESS".equals(arry.get("message") + "")) {
// 保存商户进件修改记录
MerchantAuditRecord updateRecord = new MerchantAuditRecord();
updateRecord.setMerchantId(mcs.getMerchantId());
updateRecord.setApplicationId(arry.get("reviewRelatedId")+"");
updateRecord.setApplicationId(arry.get("reviewRelatedId") + "");
updateRecord.setChannel(5);
updateRecord.setStatus("1");
updateRecord.setMerchantCode(merchantBaseInfo.getMerchantCode());
// 文档上没有返回状态码
merchAuditRecService.save(updateRecord);
// 修改商户状态
mcs.setApplicationId(arry.get("reviewRelatedId")+"");
mcs.setApplicationId(arry.get("reviewRelatedId") + "");
mcsService.updateById(mcs);
}else {
} else {
MsgException.throwException("修改进件信息失败");
}
}catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 获取拓客accessToken
*/
@ -617,9 +726,7 @@ public class LaKalaInterfaceImpl {
}
public static Map getModifyToken(String userName,String password) {
public static Map getModifyToken(String userName, String password) {
RestTemplate client = new RestTemplate();
HttpHeaders headers = new HttpHeaders();
// 表单提交
@ -632,7 +739,7 @@ public class LaKalaInterfaceImpl {
params.add("password", password);
HttpEntity<MultiValueMap<String, String>> requestEntity = new HttpEntity<MultiValueMap<String, String>>(params, headers);
// 执行HTTP请求
String url="https://htkapi.lakala.com/auth/oauth/token";
String url = "https://htkapi.lakala.com/auth/oauth/token";
ResponseEntity<String> response = client.exchange(url, HttpMethod.POST, requestEntity, String.class);
Map map = (Map) JSONArray.parse(response.getBody());
@ -640,39 +747,32 @@ public class LaKalaInterfaceImpl {
}
public Map queryMerchat(String customerNo,String externalCustomerNo){
public Map queryMerchat(String customerNo, String externalCustomerNo) {
Map map = getToken();
try{
JSONObject object=new JSONObject();
if(ObjectUtil.isNotEmpty(customerNo)){
object.put("customerNo",customerNo);
try {
JSONObject object = new JSONObject();
if (ObjectUtil.isNotEmpty(customerNo)) {
object.put("customerNo", customerNo);
}
if(ObjectUtil.isNotEmpty(externalCustomerNo)){
object.put("externalCustomerNo",externalCustomerNo);
if (ObjectUtil.isNotEmpty(externalCustomerNo)) {
object.put("externalCustomerNo", externalCustomerNo);
}
JSONObject req=new JSONObject();
JSONObject req = new JSONObject();
byte[] privateKey = Base64.decodeBase64(lakalaConfig.getPrivateKey());
byte[] bytes = RSAUtil.encryptByPrivateKey(object.toString().getBytes(), privateKey);
req.put("data", Base64.encodeBase64String(bytes));
req.put("data", Base64.encodeBase64String(bytes));
log.info("请求参数:加密前:{},加密后:{}",object.toString(),req.toString());
log.info("请求参数:加密前:{},加密后:{}", object.toString(), req.toString());
String result = cn.hutool.http.HttpRequest.post("https://tkapi.lakala.com/htkmerchants/open/merchant/info")
.header("Authorization", "bearer " + map.get("access_token")).header("content-type", "application/json")
.body(req.toJSONString()).execute().body();
Map arry = (Map) JSONArray.parse(result);
log.info("返回参数:",JSONUtil.toJsonStr(arry));
log.info("返回参数:", JSONUtil.toJsonStr(arry));
return arry;
}catch (Exception e){
} catch (Exception e) {
e.printStackTrace();
}
@ -715,14 +815,14 @@ public class LaKalaInterfaceImpl {
*/
public AccountDTO getAccountV4(String userId, String type) {
UserApp userApp= userAppService.getById(userId);
if (type == null) {
UserApp userApp = userAppService.getById(userId);
if (type == null) {
MerchantChannelStatus mcs = mcsService.getValidData(userApp.getMerchantCode());
if (mcs == null || !Objects.equals(mcs.getChannel(), 4)) {
type=Account.CHANNEL_TYPE_D1;
type = Account.CHANNEL_TYPE_D1;
} else {
type=Account.CHANNEL_TYPE_D0;
type = Account.CHANNEL_TYPE_D0;
}
}
AccountDTO accountDTO = accountService.getRealAccount(userId);
@ -851,7 +951,7 @@ public class LaKalaInterfaceImpl {
// 表单提交
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
Map parse =getToken();
Map parse = getToken();
HttpHeaders header = new HttpHeaders();
header.set("Authorization", "bearer " + parse.get("access_token"));
// 封装参数
@ -873,10 +973,9 @@ public class LaKalaInterfaceImpl {
* 拓客文件上传接口
*/
@SneakyThrows
public String laKaLaFileUpload(String url1) {
RestTemplate restTemplate = new RestTemplate();
public static String laKaLaFileUpload(String url1, String type) {
String url = fileUpload;
MultiValueMap<String, Object> params = new LinkedMultiValueMap<>();
Map<String, Object> params = new HashMap<>();
// String url1 = "https://czg-oss.oss-cn-hangzhou.aliyuncs.com/images/9b42a8f68e2b4682bdb72490abe131fe.png?Expires=1994642722&OSSAccessKeyId=LTAI5tPdEfYSZcqHbjCrtPRD&Signature=cTcS0ey%2F6NYWQnyvVCMQsO6rZMU%3D";
URI uri = null;
@ -888,36 +987,56 @@ public class LaKalaInterfaceImpl {
RestTemplate restTemplate1 = new RestTemplate();
ResponseEntity<byte[]> exchange = restTemplate1.exchange(uri, HttpMethod.GET, null, byte[].class);
MultipartFile file1 = new MockMultipartFile("file", exchange.getBody());
ByteArrayResource fileAsResource = new ByteArrayResource(file1.getBytes()) {
@Override
public String getFilename() {
File file = convert(file1);
params.put("file", file);
params.put("imgType", type);
params.put("sourcechnl", "0");
params.put("isOcr", "false");
return file1.getOriginalFilename();
// return null;
}
@Override
public long contentLength() {
// return 0L;
return file1.getSize();
}
};
params.add("file", fileAsResource);
params.add("imgType", "ID_CARD_FRONT");
params.add("sourcechnl", "1");
params.add("isOcr", "false");
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.MULTIPART_FORM_DATA);
Map token = getToken();
headers.set("Authorization", "bearer " + token.get("access_token"));
HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(params, headers);
String result = restTemplate.postForObject(url, requestEntity, String.class);
String result = HttpRequest.post(url)
.header("Authorization", "bearer " + token.get("access_token"))
.form(params).execute().body();
Map parse = (Map) JSONArray.parse(result);
log.info("拉卡拉图片上传返回信息:{}", result);
return parse.get("url").toString();
}
@SneakyThrows
public static String laKaLaFileUpload(File file, String type) {
RestTemplate restTemplate = new RestTemplate();
String url = fileUpload;
Map<String, Object> params = new HashMap<>();
params.put("file", file);
params.put("imgType", type);
params.put("sourcechnl", "0");
params.put("isOcr", "false");
Map token = getToken();
String result = HttpRequest.post(url)
.header("Authorization", "bearer " + token.get("access_token"))
.form(params).execute().body();
Map parse = (Map) JSONArray.parse(result);
log.info("拉卡拉图片上传返回信息:{}", result);
return parse.get("url").toString();
}
public static File convert(MultipartFile multipartFile) throws IOException {
InputStream inputStream = multipartFile.getInputStream();
File file = File.createTempFile(ObjectUtil.isEmpty(multipartFile.getOriginalFilename()) ? System.currentTimeMillis() + "" : multipartFile.getOriginalFilename(), ".png");
FileOutputStream outputStream = new FileOutputStream(file);
byte[] buffer = new byte[1024];
int bytesRead = 0;
while ((bytesRead = inputStream.read(buffer)) != -1) {
outputStream.write(buffer, 0, bytesRead);
}
outputStream.close();
file.deleteOnExit();
return file;
}
/**
@ -972,8 +1091,10 @@ public class LaKalaInterfaceImpl {
public static void main(String[] args) {
Map map = getToken();
System.out.println(JSONUtil.toJsonStr(map));
// Map map = getToken();
// System.out.println(JSONUtil.toJsonStr(map));
System.out.println(laKaLaFileUpload("https://czg-oss.oss-cn-hangzhou.aliyuncs.com/images/819abf620cfe4e6f9e2c432a998090ab.png?Expires=2002093384&OSSAccessKeyId=LTAI5tPdEfYSZcqHbjCrtPRD&Signature=8%2FQMRnkTQmQF8jp93XxayPZbPuU%3D", "BUSINESS_LICENCE"));
// System.out.println(new LaKalaInterfaceImpl().getRegistrationChid());
// String result="";
@ -991,7 +1112,6 @@ public class LaKalaInterfaceImpl {
// }
// LaKalaInterfaceImpl laKalaInterface = new LaKalaInterfaceImpl();
// laKalaInterface.getOrganCode("1");
// try {

View File

@ -0,0 +1,165 @@
package cn.pluss.platform.klk.util;
import cn.hutool.core.io.FileUtil;
import freemarker.template.Template;
import freemarker.template.TemplateException;
import lombok.extern.slf4j.Slf4j;
import net.coobird.thumbnailator.Thumbnails;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
@Component
@Slf4j
public class HtmlUtil {
@Autowired
FreeMarkerConfigurer freeMarkerConfigurer;
static Template template =null;
@Bean
public void initHtml(){
try {
template = freeMarkerConfigurer.getConfiguration().getTemplate("indexHTKWECHAT_PAY.html");
System.out.println(template.getName());
} catch (IOException e) {
throw new RuntimeException(e);
}
}
//html 替换占位符
public static File writeHtml(Map<String, Object> data) throws IOException, TemplateException {
String fileName = UUID.randomUUID().toString();
File htmlFile = new File(FileUtil.getTmpDir(), fileName + ".html");
FileWriter sw = new FileWriter(htmlFile);
log.info("生成协议html, 地址:{}, 参数:{} ", htmlFile.getAbsolutePath(), data);
template.process(data, sw);
return htmlFile;
}
//html 转png 示例代码
public static File createAgreementPicture(File htmlFile) throws IOException {
File outputFile = new File(FileUtil.getTmpDir(), htmlFile.getName() + ".jpg");
log.info("生成图片开始, HTML地址 {}, 图片地址:{}", htmlFile.getAbsolutePath(), outputFile.getAbsolutePath());
String commandProcess = "wkhtmltoimage --width 400 --quality 94 " + htmlFile.getPath() + " " + outputFile.getPath();
log.info("协议执行procommand:{}", commandProcess);
long startTime = System.currentTimeMillis(); //获取开始时间
Process process = Runtime.getRuntime().exec(commandProcess);
try {
int exitVal = process.waitFor();
log.info("协议html转换png结果:{}", exitVal);
} catch (InterruptedException e) {
e.printStackTrace();
log.info("协议html转换png错误:{}", e.getMessage());
throw new IOException(e);
}
long endTime = System.currentTimeMillis(); //获取结束时间
log.info("程序运行时间: " + (endTime - startTime) + "ms");
log.info("生成图片结束,地址: {}", outputFile.getPath());
Thumbnails.of(outputFile).scale(1).outputQuality(0.9).toFile(outputFile);
return outputFile;
}
// 合并两张图片示例代码
public BufferedImage mergeImage(BufferedImage img1, BufferedImage img2, boolean isHorizontal) throws IOException {
int w1 = img1.getWidth();
int h1 = img1.getHeight();
int w2 = img2.getWidth();
int h2 = img2.getHeight();
// 从图片中读取RGB
int[] ImageArrayOne = new int[w1 * h1];
ImageArrayOne = img1.getRGB(0, 0, w1, h1, ImageArrayOne, 0, w1); // 逐行扫描图像中各个像素的RGB到数组中
int[] ImageArrayTwo = new int[w2 * h2];
ImageArrayTwo = img2.getRGB(0, 0, w2, h2, ImageArrayTwo, 0, w2);
// 生成新图片
BufferedImage DestImage = null;
if (isHorizontal) { // 水平方向合并
// DestImage = new BufferedImage(w1+w2, h1, BufferedImage.TYPE_INT_RGB);
Graphics2D g2d = null;
if (h1 >= h2) {
DestImage = new BufferedImage(w1 + w2, h1, BufferedImage.TYPE_INT_RGB);
g2d = DestImage.createGraphics();
g2d.setPaint(Color.WHITE);
g2d.fillRect(0, 0, w1 + w2, h1);
g2d.dispose();
} else {
DestImage = new BufferedImage(w2, h1, BufferedImage.TYPE_INT_RGB);// TYPE_INT_RGB
g2d = DestImage.createGraphics();
g2d.setPaint(Color.WHITE);
g2d.fillRect(0, 0, w2 + w1, h1);
g2d.dispose();
}
DestImage.setRGB(0, 0, w1, h1, ImageArrayOne, 0, w1); // 设置上半部分或左半部分的RGB
DestImage.setRGB(w1, 0, w2, h2, ImageArrayTwo, 0, w2);
} else { // 垂直方向合并
Graphics2D g2d = null;
if (w1 >= w2) {
DestImage = new BufferedImage(w1, h1 + h2, BufferedImage.TYPE_INT_RGB);// TYPE_INT_RGB
g2d = DestImage.createGraphics();
g2d.setPaint(Color.WHITE);
g2d.fillRect(0, 0, w1 + w2, h1 + h2);
g2d.dispose();
} else {
DestImage = new BufferedImage(w2, h1 + h2, BufferedImage.TYPE_INT_RGB);// TYPE_INT_RGB
g2d = DestImage.createGraphics();
g2d.setPaint(Color.WHITE);
g2d.fillRect(0, 0, w2 + w1, h1 + h2);
g2d.dispose();
}
DestImage.setRGB(0, 0, w1, h1, ImageArrayOne, 0, w1); // 设置上半部分或左半部分的RGB
DestImage.setRGB(0, h1, w2, h2, ImageArrayTwo, 0, w2); // 设置下半部分的RGB
}
return DestImage;
}
@Test
public void mytest(){
Map<String, Object> data=new HashMap<>();
data.put("fee.customerName","西安菲慕斯博市场营销策划有限公司");
data.put("licenseNo","91610131MA6TXACP28");
data.put("legalName","蔺佳佳");
data.put("licenseName","西安菲慕斯博市场营销策划有限公司");
data.put("identityNo","612501199212187875");
data.put("address","陕西省西安是");
data.put("identityNoExpire","2099-12-31");
data.put("accountName","西安菲慕斯博市场营销策划有限公司");
data.put("accountIdCard","612501199212187875");
data.put("accountNo","611011580000054186");
data.put("accountIdDtEnd","2099-12-31");
data.put("bankName","西安银行股份有限公司");
data.put("licenseName","西安菲慕斯博市场营销策划有限公司");
data.put("mail","11235@163.com");
data.put("contactManName","13201467820");
data.put("channelType","民营");
data.put("phone","1321462310");
data.put("receiveDetail","西安");
data.put("receiveDetail","西安");
try {
writeHtml(data);
} catch (IOException e) {
throw new RuntimeException(e);
} catch (TemplateException e) {
throw new RuntimeException(e);
}
}
}

View File

@ -34,8 +34,7 @@ public class LklMerAuditServiceImpl {
public String merchantAuditCallback(Map<String,Object> map){
log.info("拉卡拉进件回调:{}", JSONUtil.toJsonStr(map));
log.info("拉卡拉进件回调:{}", JSONUtil.toJsonStr(map));
try {
String data = LaKaLaUtility.decrypt(lakalaConfig.getPubKey(),map.get("data").toString());
Map arryMap = (Map) JSONArray.parse(data);

View File

@ -1,6 +1,7 @@
package cn.pluss.platform.task;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil;
import cn.pluss.platform.MerchantAuditRecordService;
import cn.pluss.platform.entity.*;
import cn.pluss.platform.exception.MsgException;
@ -105,6 +106,7 @@ public class LklMerAuditHandler {
public void execute(Map<String, Object> map) {
log.info("拉卡拉开户通知接口返回解密数据:{}", JSONUtil.toJsonStr(map));
if (ObjectUtil.isEmpty(map) || !map.containsKey("status")) {
log.error("回调数据为空");
@ -245,7 +247,7 @@ public class LklMerAuditHandler {
"\t\"code\": \"" + map.get("status") + "\",\n" +
"\t\"msg\": \"" + map.get("remark") + "\"\n" +
"}"));
merchantChannelStatus.setRemark("成功");
merchantChannelStatus.setRemark(map.get("remark")+"");
merchantChannelStatus.setUpdateTime(new Date());
MerchantAuditRecord lastRecord = merchantAuditRecordService.getLastRecord(merchantChannelStatus.getMerchantCode());