From d22b69d8c056cf19b4a947fe47c0a65b042e59db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9F=A9=E9=B9=8F=E8=BE=89?= <18322780655@163.com> Date: Sat, 17 Jun 2023 10:35:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=BF=9B=E4=BB=B6=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/pluss/platform/util/DateUtils.java | 13 +- .../resources/temp/indexHTKWECHAT_PAY.html | 462 ++++++++++++++++ .../entity/MerchantChannelStatus.java | 2 +- .../klk/service/impl/LaKalaInterfaceImpl.java | 522 +++++++++++------- .../cn/pluss/platform/klk/util/HtmlUtil.java | 165 ++++++ .../sxf/audit/LklMerAuditServiceImpl.java | 3 +- .../platform/task/LklMerAuditHandler.java | 4 +- 7 files changed, 965 insertions(+), 206 deletions(-) create mode 100644 pluss-manage-page/src/main/resources/temp/indexHTKWECHAT_PAY.html create mode 100644 pluss-service-bundle/src/main/java/cn/pluss/platform/klk/util/HtmlUtil.java diff --git a/pluss-common-bundle/src/main/java/cn/pluss/platform/util/DateUtils.java b/pluss-common-bundle/src/main/java/cn/pluss/platform/util/DateUtils.java index 9d44c3a..40bfdd9 100644 --- a/pluss-common-bundle/src/main/java/cn/pluss/platform/util/DateUtils.java +++ b/pluss-common-bundle/src/main/java/cn/pluss/platform/util/DateUtils.java @@ -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 last6Months = getLast6Months(); // List last6Months = new ArrayList<>(); // last6Months.add("2019-11"); diff --git a/pluss-manage-page/src/main/resources/temp/indexHTKWECHAT_PAY.html b/pluss-manage-page/src/main/resources/temp/indexHTKWECHAT_PAY.html new file mode 100644 index 0000000..135eeea --- /dev/null +++ b/pluss-manage-page/src/main/resources/temp/indexHTKWECHAT_PAY.html @@ -0,0 +1,462 @@ + + + + + + +
+
+
+
+
+
+ 特约商户支付服务合作协议 +
+
+
+
+ 《特约商户支付服务合作协议》(以下简称“本协议”)是拉卡拉支付股份有限公司(正文部分简称“乙方”)与您(是指接受拉卡拉支付服务的个人或公司法人及相关单位组织等,正文部分简称“甲方”)就“支付服务业务”服务(以下简称“本服务”)所订立的有效合约。 + 您在使用本服务之前,请仔细阅读本协议(特别是以粗体标注的内容),您在拉卡拉客户经理向您展示的本协议上签字,即表示您同意接受本协议的全部内容。如果您不同意本协议的任意内容,或者无法准确理解相关条款,请不要签字。 +
+
+
+
甲方:(特约商户)${customerName} +
+
乙方:(支付机构)拉卡拉支付股份有限公司
+
+
+
第一条 业务服务及费用:
+
1.双方确认,乙方向甲方提供支付服务。
+
+ 2.甲方使用本服务将会产生相应的收单手续费(详见《拉卡拉商户注册登记表》),甲方也可通过APP查询收单手续费。 +
+
+ 3.乙方保留调整本协议项下的费用之权利,如本协议项下的费用调整,乙方将以公告方式在拉卡拉网站提示并予以公示,而无需另行通知甲方,调整后的费用标准在公告期届满之日起生效。若甲方在费用标准调整后继续使用本服务的,视为甲方接受费用标准的调整。若甲方不同意调整后的费用标准,应停止使用本服务并与乙方联系。 +
+
第二条 + 甲方如使用移动通讯受理终端(含内置Esim卡),甲方应向乙方另行支付运营服务费(详见《拉卡拉商户注册登记表》),运营服务包括终端网络维护,质量管理,应急响应等,服务期自终端入网之日起1年。甲方应自本协议生效之日起1个工作日内向乙方支付首年运营服务费,首年服务到期30日前向乙方支付次年运营服务费,以此类推。 +
+
+
+
第三条 + 乙方应将甲方的交易资金在扣除本协议约定的手续费和其他款项后,在约定的结算周期(详见《拉卡拉商户注册登记表》)内,向甲方指定的结算账户划付资金,境外卡支付业务在3个工作日内划付资金。甲方可根据需求选择开通交易发生日结算,乙方审核通过后,将另行扣收相应的快速结算手续费1,具体以拉卡拉商户通APP展示的为准。 +
+
+
+
第四条 + 甲方默认开通退货功能,当甲方发生退货、撤销、冲正交易情形时,乙方有权采用以下一或多种模式将退款资金扣除:(1)从甲方退款终端交易资金中直接扣除;(2)从甲方退款商户交易资金中直接扣除;(3)从甲方退货账户资金中直接扣除;(4)从甲方合作平台/集团商户退货账户资金中直接扣除。如甲方需关闭退货功能,甲方可拨打乙方客服电话95016关闭退货功能。 +
+
+ 对甲方、合作平台/集团商户退货账户进行扣款后,甲方同意并授权乙方依据实际情况将甲方交易资金回充至相应退货账户。甲方因退货操作错误等原因造成的资金风险及损失由甲方承担。 +
+
+
+
第五条 + 乙方应按国家法律法规履行支付机构相关责任与义务。 +
+
+
+
第六条 + 乙方(含乙方分支机构、合作方,下同)为甲方提供的受理终端(包含收款码)仅限甲方在固定地区使用。 + 甲方应提供符合受理终端安装要求的场地条件,并妥善保管和使用,如因甲方管理或使用不当造成终端损坏或遗失的,甲方应按市场价向乙方赔偿,赔付方式为现金、转账或授权乙方从甲方终端押金、交易资金等途径扣除。 + 双方协议终止时,乙方有权收回放置在甲方的受理终端或关闭网络支付接口。 +
+
+
+
第七条 + 受理终端收费标准由乙方与甲方另行约定。固定受理终端、移动受理终端、扫码受理终端数量及型号以拉卡拉客户端及拉卡拉商户通APP展示的数量及型号为准。 +
+
+
+
第八条 + 甲方应准确填写附件《拉卡拉商户注册登记表》中的相关信息,当甲方的工商注册名称、主营业务、法定代表人或负责人、结算账户信息等重要信息发生变更时,甲方应通过乙方官方渠道方式告知乙方,乙方有权重新审核甲方支付业务受理资质。 + 当乙方认为甲方不再具备受理资质时,乙方有权单方面终止本协议。 甲方申请成为乙方特约商户,应主动如实提供经营资质材料及身份证明文件。 + 甲方应保证上述资料完整、真实、合法、有效。若身份证明文件存在有效期,应在有效期前主动向乙方提供新的证明文件,证明文件失效且经乙方提示仍无合理理由拒绝更新的,乙方有权对甲方采取交易限制措施或终止向甲方提供本协议项下相关的服务。 +
+
+
+
第九条 + 甲方应当履行以下基本义务: +
+ 1.基于真实的商品或服务交易背景受理银行卡,并遵守相应银行卡品牌的受理要求,不得歧视和拒绝同一银行卡品牌的不同发卡银行的持卡人; +
+
+ 2.按规定使用受理终端(网络支付接口)和收单结算账户,不得利用其从事或协助他人从事非法活动; +
+
3.妥善处理交易数据信息、保存交易凭证,保障交易信息安全; +
+
+ 4.不得因持卡人使用银行卡而向持卡人收取或变相收取附加费用,或降低服务水平; +
+
+ 5.不得存储持卡人银行卡的磁道信息或芯片信息、验证码、有效期、密码等敏感信息; +
+
6.确保网络支付指令的真实性、准确性、合法性;
+
+ 7.仅在中华人民共和国境内(不包含香港特别行政区、澳门特别行政区及台湾地区)使用本支付服务。 +
+
+
+
+
第十条 + 对经查实的交易差错或甲方需调整的账务,乙方负责按照中国银联或其他卡组织差错处理的有关规定进行相应处理。对有疑议的交易,乙方有权向甲方调单。 +
+
+
+
第十一条 + 甲方需保存所有交易的签购单及其他的交易证明材料,保存期限自交易日起至少2年,如因甲方资料保存不善造成的风险损失由甲方自行承担。 +
+
+
+
第十二条 + 在出现交易纠纷、持卡人调退单或乙方有合理理由认定交易有可疑之处时,乙方有权查验甲方原始交易签购单及相关交易证明材料,并影印留存。 + 甲方应根据乙方要求提供真实的交易受理情况,对于乙方提出的调取交易证明材料的要求,甲方应自乙方通知之日(含)起3个工作日内提供有效交易证明材料。 +
+
+
+
第十三条 + 甲方发生以下情况时,乙方有权采取暂缓甲方全部或部分交易资金结算至少180天以上: +
+
1.发卡行发起调、退单;
+
2.超出约定地理范围使用终端或终端位置无法监测的; +
+
+ 3.交易金额、时间、频率与甲方经营范围、规模不相符等异常情形;
+
4.疑似虚假申请、银行卡套现、洗钱、欺诈、移机、留存或泄漏持卡人账户信息等风险事件; +
+
5.从事其他违反国家法律法规规定的犯罪、违法活动; +
+
6.乙方认为甲方调退单比例过高、交易纠纷比例过高或有合理理由认定交易存在可疑之处,或有合理根据怀疑甲方违反本协议的其他行为; +
+
7.被工商等管理部门吊销营业执照或行政许可等,从而丧失本协议所列经营资格的; +
+
8.将乙方支付接口用于非本协议约定业务或提供给本协议约定外的第三人使用。 +
+
+ 甲方发生以上第2-8项情况时,乙方同时有权设置收款限额、暂停银行卡交易、收回受理终端、关闭网络支付接口、单方面无条件终止本协议等措施,由此带给乙方的相关损失和风险责任由甲方承担。 + 且乙方有权将甲方相关信息报送至中国银联或其他卡组织风险信息共享系统及中国支付清算协会风险信息共享系统,并向执法、监管部门、相关征信机构通报,发现甲方涉嫌电信网络新型违法犯罪的,乙方还有权立即向公安机关报告。 +
+
+
+
第十四条 + 发生以下情况时,乙方有权从甲方押金、保证金及交易资金中抵扣相应款项,如前述款项不足抵扣的,甲方应根据乙方要求补足差额资金。对因甲方原因造成的乙方垫款或损失,乙方有权向甲方追索。 +
1.甲方发生退货、冲正、撤销交易;
+
2.由于计算错误或其它原因导致乙方向甲方多支付的款项或其它经甲方确认的长款; +
+
+ 3.因甲方原因导致的发卡机构退单或卡组织追究乙方违约金;
+
4.名义经营范围与实际情况不符而造成的本协议项下的费用差额补偿部分(补偿部分的时限为自发现日起前180天); +
+
+ 5.甲方违反本协议约定,导致乙方先行垫付相关方赔偿还款的;
+
6.其它应由甲方支付的款项。
+
本条款不随双方协议终止而终止,乙方在法律规定的诉讼时效内,均有权就合作期间甲方因本条款给乙方造成的损失向甲方追索。 +
+
+
+
+
第十五条 + 乙方有权对甲方进行风险评级,如甲方风险等级较高,乙方对其开通的受理卡种和交易类型进行限制,并采取强化交易监测、设置交易限额、延迟结算、增加检查频率、建立特约商户风险准备金等风险管理措施。 +
+
+
+
第十六条 + 乙方有权对甲方经营场所进行现场检查,如甲方无固定经营场所,乙方有权要求甲方定期上传经营影像或照片。 +
+
+
+
第十七条 + 如甲方连续3个月未发生交易的,乙方有权重新核验甲方商户身份,如无法核实或核实后不再具备受理资质时,乙方有权单方面终止本协议; + 如甲方连续12个月未发生交易的,乙方有权单方面终止本协议。 +
+
+
+
第十八条 + 乙方除有权根据本协议及附件约定外,还有权根据中国人民银行、中国银联、境外卡组织、中国清算协会已发布的及后续发布的各类通知、要求、指导意见等规范性文件内容对甲方进行监督管理并采取必要措施。 +
+
+
+
第十九条 甲方所有在线操作包括在乙方网站、业务系统、微信服务平台、APP等的操作和交易,甲方的登录账号和密码是乙方验证甲方身份的重要印签,甲方对此负有保密责任。 + 凡使用甲方登录账号和密码进行的线上操作和交易均视为甲方亲自办理的有效委托,具有同书面委托同等的法律效力。 + 甲方对使用甲方登录账号和密码进行的所有线上操作及交易结果承担全部经济和法律责任,有证据证明系乙方原因导致甲方账号、密码泄露的情形除外。 +
+ +
+
+
第二十条 + 甲方同意并指定数据处理方(含其分支机构及总公司,详见《拉卡拉商户注册登记表》)为其提供数据处理服务,同意并授权数据处理方为终端布放与受理标识张贴、终端维护、商户培训、耗材配送、交易证明材料调取、对账目的收集、 + 存储并向乙方传送甲方通过线下或线上方式提供的入网信息(包括但不限于《拉卡拉商户注册登记表》中的信息、商户提交的电子版及纸质版资料以及监管部门要求的其他信息),同意并授权乙方将甲方金融信息(包括甲方企业名称、统一社会信用代码、法定代表人姓名及证件号码、经营地址、联系人姓名及证件号码、联系人手机号、联系人电子邮箱、结算账户信息、交易数据、入账信息、对账单明细数据,下同)提供给数据处理方,同意并授权数据处理方从乙方接收并处理前述甲方相关信息。 + 乙方已要求数据处理方按照国家法律法规规定对该等信息采取安全保护措施。若甲方不同意前述授权,甲方可拨打乙方客服电话95016,取消授权。 +
+
+
+
第二十一条 + 甲方同意并授权乙方直接或通过数据处理方接收并按以下方式使用甲方信息将甲方通过线下或线上方式提供的入网信息(包括但不限于《拉卡拉商户注册登记表》中的信息、商户提交的电子版及纸质版资料以及监管部门要求的其他信息)用于乙方支付业务特约商户入网审核、反洗钱管理、实名制管理、风控评估。 + 同时,甲方同意并授权乙方以加密传输方式将甲方信息共享给具备提供验证服务资质的第三方机构进行一致性比对并输出核验结果,同意并授权第三方机构使用甲方的信息用于验证服务并以加密传输的方式向乙方返回核验结果。 +
+
+
+
第二十二条 + 鉴于甲方结算账户所属银行会不定期开展商户手续费补贴等营销活动,甲方同意乙方推荐甲方参加结算行账户所属银行的营销活动,将甲方金融信息提供给甲方结算账户所属银行(包括该银行相关分支行),用于评估甲方是否符合活动要求,对营销活动期间相关数据进行风控管理、考核对账的目的,甲方同意并授权银行从乙方接收并处理前述甲方相关信息。乙方已要求银行按照国家法律法规规定对该等信息采取安全保护措施。若甲方不同意前述授权,甲方可拨打乙方客服电话95016,取消授权。 +
+
+
+
第二十三条 + 乙方将对甲方金融信息严格保密,除本协议约定情形外,不会泄露或者非法向他人提供甲方金融信息。 +
+
+
+
第二十四条 + 本协议执行过程中,如中国人民银行、中国银联、境外卡组织等相关监管机构或行业组织的相关规定或乙方业务规则、市场政策发生变化,导致支付业务规则发生变化或者本协议项下的费用发生变化,乙方可以单方面调整相关条款约定。 +
+
甲方理解并同意乙方采取在官方网站公告、电子服务渠道信息推送、邮件或短信通知等方式向甲方发起变更通知。如甲方不同意该变更后的内容,应停止使用乙方服务; + 如甲方在获知或在合理时限内应当获知乙方变更通知后,仍继续使用乙方服务的,视为同意对协议涉及条款进行变更。
+
+
+
第二十五条 + 甲方可通过【拉卡拉商户通APP】或客服热线95016进行业务咨询、查账、投诉等操作。 +
+
+
+
+
第二十六条 + 任何一方违反本协议约定,另一方有权要求在合理期限内纠正,要求赔偿因此遭受的直接经济损失。但任何一方均无须向对方的间接损失、预期利益承担赔偿责任。 +
+
+
+
第二十七条 + 除本协议另有约定外,双方均有权根据业务需要单方解除或终止本协议,但应提前30天通知对方。 +
+
+
+
第二十八条 通知
+
+ 1.甲方确认,其在《拉卡拉商户注册登记表》中指定的“联系人”、“联系地址”、“联系人电子邮箱”、“联系人电话”等联系信息可用于乙方处理本协议项下事务时向甲方履行通知、文件物品递送义务。 + 其中,“联系人”负责对本协议所涉事务的沟通、文件物品的签收、移交等事宜。乙方发送到甲方指定的“联系地址”、“联系人电子邮箱”即视为对甲方的有效送达。 +
+
+ 2.甲方确认,其变更《拉卡拉商户注册登记表》中指定的联系信息时,应至少提前5个工作日以书面方式通知乙方。因甲方未及时通知导致乙方依照本协议约定联系信息履行通知、文件物品递送义务的,乙方的通知、文件物品(包括但不限于设备、文件及资料等)自发送之日起第3个工作日(含)视为乙方送达之日。
+
+
+
第二十九条 争议解决 +
+ 1.双方在履行本协议过程中发生的任何争议双方应首先协商解决,协商不成,任何一方可将该争议提请上海国际经济贸易仲裁委员会按照该会仲裁规则进行仲裁。 +
+
+ 2.由于计算错误或其它原因导致乙方向甲方多支付的款项或其它经甲方确认的长款。 +
+
+ 3.因甲方原因导致的发卡机构退单或卡组织追究乙方违约金。 +
+
+
+
+
第三十条 协议生效
+
1. 本协议自甲方签字后生效,有效期为一年。 + 有效期届满后如双方无任何书面异议,本协议将自动延期,每次延期一年,依此类推。若甲乙任何一方对延期有异议,应于协议当次届满前一个月向对方书面提出异议。 + 甲乙双方过往签订的协议如与本协议有冲突以本协议为准。 +
+
2. + 本协议未尽事宜,双方可另行协商签订补充协议,本协议附件及补充协议是本协议不可分割的组成部分。 +
+ +
3. + 本协议附件包括《银行卡支付业务服务条款》、《拉卡拉扫码支付业务条款》、《境外银行卡支付业务条款》、《互联网支付服务条款》及其子附件(《代付服务基本条款》、《互联网快捷支付服务基本条款》、 + 《网银B2C/B2B支付服务基本条款》、《协议支付服务基本条款》、《第三方支付服务基本条款》)、《拉卡拉用户隐私政策》,上述附件由甲方登陆拉卡拉官方网站(www.lakala.com)查阅、下载并留存。 + 上述附件内容与本协议约定冲突的,以本协议约定为准。 +
+
4. + 本协议中,乙方遵照监管规范,按照最少必要原则收集、使用甲方的金融信息,用以向甲方提供服务、保障服务质量、保障甲方的账户和资金安全以及符合国家法律法规及监管规定要求,如果不同意,可能会影响服务的开通和部分服务的使用。 + 更多关于用户金融信息保护的内容,请查阅《拉卡拉用户隐私政策》 +
+
+
+
+
+ 甲方声明:乙方已采取合理方式提请甲方注意本协议、附件及官方网站公示内容的条款,并详细说明;甲方在本协议上签字视为同意本协议、附件及官方网站公示内容的条款。 +
+
+
+
+
+
+
+
拉卡拉商户注册登记表
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
执照信息
营业执照号 + ${licenseNo} 法人 + ${legalName}
执照名/商户名${licenseName}身份证号${identityNo}
所在区域${address}有效期${identityNoExpire}
详细地址${receiveDetail}
结算信息
入账户名${accountName}身份证号${accountIdCard}
入款账号${accountNo}有效期${accountIdDtEnd}
开户行${bankName}
商户信息
签购单名称${licenseName}对账单邮箱${mail}
联系人${contactManName}商户类别${channelType}
手机号${phone}商户地址${receiveDetail}
数据处理方${agencyName}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + diff --git a/pluss-model-bundle/src/main/java/cn/pluss/platform/entity/MerchantChannelStatus.java b/pluss-model-bundle/src/main/java/cn/pluss/platform/entity/MerchantChannelStatus.java index d17decf..2f88f00 100644 --- a/pluss-model-bundle/src/main/java/cn/pluss/platform/entity/MerchantChannelStatus.java +++ b/pluss-model-bundle/src/main/java/cn/pluss/platform/entity/MerchantChannelStatus.java @@ -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("不符合商户审核条件"); } } diff --git a/pluss-service-bundle/src/main/java/cn/pluss/platform/klk/service/impl/LaKalaInterfaceImpl.java b/pluss-service-bundle/src/main/java/cn/pluss/platform/klk/service/impl/LaKalaInterfaceImpl.java index 84a80a6..169391a 100644 --- a/pluss-service-bundle/src/main/java/cn/pluss/platform/klk/service/impl/LaKalaInterfaceImpl.java +++ b/pluss-service-bundle/src/main/java/cn/pluss/platform/klk/service/impl/LaKalaInterfaceImpl.java @@ -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 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 queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("merchantCode", merchantBaseInfo.getMerchantCode()); + queryWrapper.eq("channel", "5"); + List 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:电签,ZPOS4G:4G电签,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().likeRight("name",merchantBaseInfo.getProvince()).last("limit 1")).getCode()); //省代码 通过【地区信息→获取地区查询】接口获取 对应 code字段 - object1.put("cityCode", tbPlussRegionLklService.getOne(new QueryWrapper().likeRight("name",merchantBaseInfo.getCity()).last("limit 1")).getCode()); // 市代码 通过【地区信息→获取地区查询】接口获取 对应 code字段 - object1.put("countyCode", tbPlussRegionLklService.getOne(new QueryWrapper().likeRight("name",merchantBaseInfo.getDistrict()).last("limit 1")).getCode()); // 区县代码 通过【地区信息→获取地区查询】接口获取 对应 code字段 - if(!merchantBaseInfo.getMerchantType().equals("1")){ + object1.put("provinceCode", tbPlussRegionLklService.getOne(new QueryWrapper().likeRight("name", merchantBaseInfo.getProvince()).last("limit 1")).getCode()); //省代码 通过【地区信息→获取地区查询】接口获取 对应 code字段 + object1.put("cityCode", tbPlussRegionLklService.getOne(new QueryWrapper().likeRight("name", merchantBaseInfo.getCity()).last("limit 1")).getCode()); // 市代码 通过【地区信息→获取地区查询】接口获取 对应 code字段 + object1.put("countyCode", tbPlussRegionLklService.getOne(new QueryWrapper().likeRight("name", merchantBaseInfo.getDistrict()).last("limit 1")).getCode()); // 区县代码 通过【地区信息→获取地区查询】接口获取 对应 code字段 + Set attchmentsVoSet = new HashSet<>(); + QueryWrapper accountQueryWrapper1 = new QueryWrapper<>(); + accountQueryWrapper1.eq("userId", userId); + accountQueryWrapper1.eq("channelType", "D1"); + Account accountServiceOne1 = accountService.getOne(accountQueryWrapper1); + MsgException.checkNull(accountServiceOne1, "结算信息未提交"); + + + QueryWrapper bankCardWrapper = new QueryWrapper<>(); + bankCardWrapper.eq("id", accountServiceOne1.getBankCardId()); + BankCard userBrakCard = bankCardService.getOne(bankCardWrapper); + + MsgException.checkNull(userBrakCard, "结算卡信息未提交"); + + + QueryWrapper 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 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 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 accountQueryWrapper1 = new QueryWrapper<>(); - accountQueryWrapper1.eq("userId", userId); - accountQueryWrapper1.eq("channelType", "D1"); - Account accountServiceOne1 = accountService.getOne(accountQueryWrapper1); - MsgException.checkNull(accountServiceOne1,"结算信息未提交"); - - - QueryWrapper bankCardWrapper = new QueryWrapper<>(); - bankCardWrapper.eq("id", accountServiceOne1.getBankCardId()); - BankCard userBrakCard = bankCardService.getOne(bankCardWrapper); - - MsgException.checkNull(userBrakCard,"结算卡信息未提交"); - QueryWrapper 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 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 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 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 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 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 feeQueryWrapper=new QueryWrapper<>(); - feeQueryWrapper.eq("channel","5"); - feeQueryWrapper.eq("merchant_code",mcs.getMerchantCode()); - MerchantChannelFee merchantChannelFee= merchantChannelFeeMapper.selectOne(feeQueryWrapper); - if(ObjectUtil.isEmpty(merchantChannelFee)){ + QueryWrapper 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 queryWrapper=new QueryWrapper<>(); - queryWrapper.eq("channel","5"); - List list=new ArrayList<>(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("channel", "5"); + List 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> attchmentsVoSet=new HashSet<>(); - ConcurrentMap frontLegalPersonMap=new ConcurrentHashMap<>(); - frontLegalPersonMap.put("imgPath",laKaLaFileUpload(accountV4.getIdcard().getImgPositive())); - frontLegalPersonMap.put("imgType","ID_CARD_FRONT"); + Set> attchmentsVoSet = new HashSet<>(); + ConcurrentMap frontLegalPersonMap = new ConcurrentHashMap<>(); + frontLegalPersonMap.put("imgPath", laKaLaFileUpload(accountV4.getIdcard().getImgPositive(), "ID_CARD_FRONT")); + frontLegalPersonMap.put("imgType", "ID_CARD_FRONT"); attchmentsVoSet.add(frontLegalPersonMap); - ConcurrentMap reverseLegalPersonMap=new ConcurrentHashMap<>(); - reverseLegalPersonMap.put("imgPath",laKaLaFileUpload(accountV4.getIdcard().getImgNegative())); - reverseLegalPersonMap.put("imgType","ID_CARD_BEHIND"); + ConcurrentMap 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 accountQueryWrapper1 = new QueryWrapper<>(); accountQueryWrapper1.eq("userId", userId); accountQueryWrapper1.eq("channelType", "D1"); Account accountServiceOne1 = accountService.getOne(accountQueryWrapper1); - MsgException.checkNull(accountServiceOne1,"结算信息未提交"); - + MsgException.checkNull(accountServiceOne1, "结算信息未提交"); QueryWrapper bankCardWrapper = new QueryWrapper<>(); @@ -473,30 +584,30 @@ public class LaKalaInterfaceImpl { QueryWrapper 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 queryWrapper=new QueryWrapper<>(); - queryWrapper.eq("channel","5"); - List list=new ArrayList<>(); + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("channel", "5"); + List 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 feeQueryWrapper=new QueryWrapper<>(); - feeQueryWrapper.eq("channel","5"); - feeQueryWrapper.eq("merchant_code",merchantBaseInfo.getMerchantCode()); + QueryWrapper 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> requestEntity = new HttpEntity>(params, headers); // 执行HTTP请求 - String url="https://htkapi.lakala.com/auth/oauth/token"; + String url = "https://htkapi.lakala.com/auth/oauth/token"; ResponseEntity 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 params = new LinkedMultiValueMap<>(); + Map 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 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> 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 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 { diff --git a/pluss-service-bundle/src/main/java/cn/pluss/platform/klk/util/HtmlUtil.java b/pluss-service-bundle/src/main/java/cn/pluss/platform/klk/util/HtmlUtil.java new file mode 100644 index 0000000..cd36393 --- /dev/null +++ b/pluss-service-bundle/src/main/java/cn/pluss/platform/klk/util/HtmlUtil.java @@ -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 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 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); + } + } + + + +} diff --git a/pluss-service-bundle/src/main/java/cn/pluss/platform/sxf/audit/LklMerAuditServiceImpl.java b/pluss-service-bundle/src/main/java/cn/pluss/platform/sxf/audit/LklMerAuditServiceImpl.java index bdcb3ae..ee4328f 100644 --- a/pluss-service-bundle/src/main/java/cn/pluss/platform/sxf/audit/LklMerAuditServiceImpl.java +++ b/pluss-service-bundle/src/main/java/cn/pluss/platform/sxf/audit/LklMerAuditServiceImpl.java @@ -34,8 +34,7 @@ public class LklMerAuditServiceImpl { public String merchantAuditCallback(Map 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); diff --git a/pluss-service-bundle/src/main/java/cn/pluss/platform/task/LklMerAuditHandler.java b/pluss-service-bundle/src/main/java/cn/pluss/platform/task/LklMerAuditHandler.java index ed528d4..b76bb48 100644 --- a/pluss-service-bundle/src/main/java/cn/pluss/platform/task/LklMerAuditHandler.java +++ b/pluss-service-bundle/src/main/java/cn/pluss/platform/task/LklMerAuditHandler.java @@ -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 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());