puzhibing
2023-10-20 7fd3525256b0e4a0dbb6f08405368990619adf36
对接第三方分账接口
29个文件已修改
28个文件已添加
3862 ■■■■ 已修改文件
ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/vo/ShopAuthenticationHftxVo.java 358 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/RemoteShopFallbackFactory.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/service/RemoteShopService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-auth/src/main/resources/bootstrap.yml 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-gateway/src/main/resources/bootstrap.yml 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-file/src/main/resources/bootstrap.yml 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-goods/src/main/resources/bootstrap.yml 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-member/src/main/resources/bootstrap.yml 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-order/pom.xml 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/controller/business/MerOrderController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/controller/miniapp/AppOrderController.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/controller/miniapp/NotifyController.java 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/domain/dto/MgtShopHFTXAuthDto.java 141 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/domain/pojo/account/ProfitSharing.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/domain/vo/PaymentDelaytransHFTXVo.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/domain/vo/WeixinPaymentNotifyVo.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/domain/vo/WeixinPaymentRefundVo.java 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/account/ProfitSharingService.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/account/ProfitSharingServiceImpl.java 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/OrderServiceImpl.java 270 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/util/HuiFuTianXiaUtil.java 351 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-order/src/main/resources/bootstrap.yml 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/business/MerShopController.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/console/ShopController.java 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/management/MgtShopController.java 99 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/dto/BankBranchCodeGetDto.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/dto/BankListGetDto.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/dto/MerchantBasicdataSettlementDto.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/dto/MgtShopHFTXAuthDto.java 120 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/dto/MgtShopHFTXAuthGetDto.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/dto/MgtShopHFTXAuthPageDto.java 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/dto/MgtShopShareRatioSetDto.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/pojo/shop/BankBranchCode.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/pojo/shop/ShopAuthenticationHftx.java 457 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/vo/MerchantBasicDataNotifyVo.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/vo/MerchantBasicdataSettlementVo.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/vo/MerchantBasicdataVo.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/vo/MgtShopHFTXAuthGetVo.java 140 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/vo/MgtShopHFTXAuthPageVo.java 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/vo/PaymentDelaytransHFTXVo.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/vo/WeixinPaymentRefundVo.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/mapper/shop/BankBranchCodeMapper.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/mapper/shop/ShopAuthenticationHftxMapper.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/mapper/shop/ShopMapper.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/BankBranchCodeServiceImpl.java 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopAuthenticationHftxServiceImpl.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopServiceImpl.java 141 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/shop/BankBranchCodeService.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/shop/ShopAuthenticationHftxService.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/shop/ShopService.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/util/HuiFuTianXiaUtil.java 729 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/resources/bootstrap.yml 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/resources/mapper/shop/BankBranchCodeMapper.xml 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/resources/mapper/shop/ShopAuthenticationHftxMapper.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/resources/mapper/shop/ShopMapper.xml 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/test/java/com/ruioyi/shop/shopTest.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/domain/vo/ShopAuthenticationHftxVo.java
New file
@@ -0,0 +1,358 @@
package com.ruoyi.system.api.domain.vo;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import lombok.Data;
import java.util.Date;
/**
 * 商户进件(汇付天下)
 * @author zhibing.pu
 * @Date 2023/10/16 10:21
 */
@Data
public class ShopAuthenticationHftxVo {
    /**
     * 主键
     */
    private Integer id;
    /**
     * 添加时间
     */
    private Date insertTime;
    /**
     * 删除状态(0=否,1=是)
     */
    private Integer isDelete;
    /**
     * 业务流水号
     */
    private String reqSeqId;
    /**
     * 进件流水号
     */
    private String applyNo;
    /**
     * 商户号
     */
    private String huifuId;
    /**
     * 取现卡序列号
     */
    private String tokenNo;
    /**
     * 审核结果;Y:审核通过,N:审核拒绝,F:失败
     */
    private String auditStatus;
    /**
     * 审核描述
     */
    private String auditDesc;
    /**
     * 商户id
     */
    private Long shopId;
    /**
     * 分账比例
     */
    private Double shareRatio;
    /**
     * 进件类型(1=用户,2=企业)
     */
    private Integer type;
    /**
     * 商户名称
     */
    private String regName;
    /**
     * 商户简称
     */
    private String shortName;
    /**
     * 公司类型(1:政府机构,2:国营企业,3:私营企业,4:外资企业,5:个体工商户,7:事业单位)
     */
    private String entType;
    /**
     * 营业执照编号
     */
    private String licenseCode;
    /**
     * 营业执照有效期类型(0:非长期有效 ,1:长期有效)
     */
    private String licenseValidityType;
    /**
     * 营业执照有效期开始日期(日期格式:yyyyMMdd)
     */
    private String licenseBeginDate;
    /**
     * 营业执照有效期截止日期(日期格式:yyyyMMdd,当license_validity_type=0时必填 ;当license_validity_type=1时为空)
     */
    private String licenseEndDate;
    /**
     * 注册省(示例值:310000)
     */
    private String regProvId;
    /**
     * 注册市(示例值:310000)
     */
    private String regAreaId;
    /**
     * 注册区(示例值:310000)
     */
    private String regDistrictId;
    /**
     * 注册详细地址
     */
    private String regDetail;
    /**
     * 法人姓名
     */
    private String legalName;
    /**
     * 法人证件类型
     */
    private String legalCertType;
    /**
     * 法人证件号码
     */
    private String legalCertNo;
    /**
     * 法人证件有效期类型(1:长期有效;0:非长期有效 )
     */
    private String legalCertValidityType;
    /**
     * 法人证件有效期开始日期(日期格式:yyyyMMdd,以北京时间为准)
     */
    private String legalCertBeginDate;
    /**
     * 法人证件有效期截止日期(日期格式:yyyyMMdd,当legal_cert_validity_type=0时必填 ;当legal_cert_validity_type=1时为空 )
     */
    private String legalCertEndDate;
    /**
     * 经营省
     */
    private String provId;
    /**
     * 经营市
     */
    private String areaId;
    /**
     * 经营区
     */
    private String districtId;
    /**
     * 经营详细地址
     */
    private String detailAddr;
    /**
     * 联系人姓名
     */
    private String contactName;
    /**
     * 联系人手机号
     */
    private String contact_mobile_no;
    /**
     * 联系人电子邮箱
     */
    private String contact_email;
    /**
     * 客服电话
     */
    private String service_phone;
    /**
     * 小票名称
     */
    private String receiptName;
    /**
     * 结算账户类型(结算账户类型,个人商户/用户不支持填写对公账户和对私非法人账户0:对公账户 1:对私法人账户 2:对私非法人账户)
     */
    private String cardType;
    /**
     * 结算账户名(当card_type=0时填写企业名称当card_type=1时填写法人姓名,对私法人结算银行户名与法人姓名必需一致;当card_type=2时填写非法人姓名)
     */
    private String cardName;
    /**
     * 结算账号
     */
    private String cardNo;
    /**
     * 银行所在省
     */
    private String jsProvId;
    /**
     * 银行所在市
     */
    private String jsAreaId;
    /**
     * 联行号
     */
    private String branchCode;
    /**
     * 持卡人证件类型(当card_type=0时为空, 当card_type=1或2时必填)
     */
    private String certType;
    /**
     * 持卡人证件号码(对私结算必填;年龄不小于18岁且不能大于80岁;如持卡人证件类型为00:身份证,则填写身份证号码 )
     */
    private String certNo;
    /**
     * 持卡人证件类型(1:长期有效 0:非长期有效)
     */
    private String certValidityType;
    /**
     * 持卡人证件有效期开始(日期格式:yyyyMMdd,当cert_validity_type=0时必填;当cert_validity_type=1时为空)
     */
    private String certBeginDate;
    /**
     * 持卡人证件有效期截止日期(日期格式:yyyyMMdd,当cert_validity_type=0时必填;当cert_validity_type=1时为空)
     */
    private String certEndDate;
    /**
     * 银行卡绑定手机号(对私非法人结算必填,开通全域资金管理功能必填)
     */
    private String mp;
    /**
     * 商户ICP备案编号
     */
    private String merIcp;
    /**
     * 基本存款账户编号或核准号
     */
    private String openLicenceNo;
    /**
     * 开户许可证
     */
    private String regAcctPic;
    /**
     * 开户许可证文件编号
     */
    private String regAcctPicNo;
    /**
     * 结算卡正面
     */
    private String settleCardFrontPic;
    /**
     * 结算卡正面文件编号
     */
    private String settleCardFrontPicNo;
    /**
     * 结算人身份证国徽面
     */
    private String settleCertBackPic;
    /**
     * 结算人身份证国徽面文件编号
     */
    private String settleCertBackPicNo;
    /**
     * 结算人身份证人像面
     */
    private String settleCertFrontPic;
    /**
     * 结算人身份证人像面文件编号
     */
    private String settleCertFrontPicNo;
    /**
     * 税务登记证
     */
    private String taxRegPic;
    /**
     * 税务登记证文件编号
     */
    private String taxRegPicNo;
    /**
     * 法人身份证国徽面
     */
    private String legalCertBackPic;
    /**
     * 法人身份证国徽面文件编号
     */
    private String legalCertBackPicNo;
    /**
     * 法人身份证人像面
     */
    private String legalCertFrontPic;
    /**
     * 法人身份证人像面文件编号
     */
    private String legalCertFrontPicNo;
    /**
     * 营业执照图片
     */
    private String licensePic;
    /**
     * 营业执照图片文件编号
     */
    private String licensePicNo;
    /**
     * 授权委托书
     */
    private String authEnturstPic;
    /**
     * 授权委托书文件编号
     */
    private String authEnturstPicNo;
    /**
     * 注册资本
     */
    private String regCapital;
    /**
     * 经营范围
     */
    private String businessScope;
    /**
     * 成立时间,示例值:20091212
     */
    private String foundDate;
    /**
     * 线下经营-门头照
     */
    private String storeHeaderPic;
    /**
     * 线下经营-门头照文件编号
     */
    private String storeHeaderPicNo;
    /**
     * 线下经营-内景照
     */
    private String storeIndoorPic;
    /**
     * 线下经营-内景照文件编号
     */
    private String storeIndoorPicNo;
    /**
     * 线下经营-收银台
     */
    private String storeCashierDeskPic;
    /**
     * 线下经营-收银台文件编号
     */
    private String storeCashierDeskPicNo;
    /**
     * 线上经营-公司前台
     */
    private String onlineCompanyPic;
    /**
     * 线上经营-公司前台文件编号
     */
    private String onlineCompanyPicNo;
    /**
     * 线上经营-工作区域
     */
    private String onlineCompanyAreaPic;
    /**
     * 线上经营-工作区域文件编号
     */
    private String onlineCompanyAreaPicNo;
    /**
     * 法人手机号
     */
    private String legalMobileNo;
    /**
     * 法人身份证地址
     */
    private String legalAddr;
}
ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/RemoteShopFallbackFactory.java
@@ -12,6 +12,7 @@
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
@@ -42,6 +43,11 @@
            }
            @Override
            public R<ShopAuthenticationHftxVo> getShopHFTXSubMchId(@RequestBody Long shopId){
                return R.fail("获取微信商户号失败:" + throwable.getMessage());
            }
            @Override
            public R<ShopRelUserVo> getShopByUserId(Long userId) {
                return R.fail("获取商户失败:" + throwable.getMessage());
            }
ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/service/RemoteShopService.java
@@ -25,6 +25,11 @@
    public R<String> getShopSubMchId(@RequestBody Long shopId);
    @PostMapping("/shop/getShopHFTXSubMchId")
    public R<ShopAuthenticationHftxVo> getShopHFTXSubMchId(@RequestBody Long shopId);
    @PostMapping("/shop/getShopByUserId")
    public R<ShopRelUserVo> getShopByUserId(@RequestBody Long userId);
ruoyi-auth/src/main/resources/bootstrap.yml
@@ -14,20 +14,20 @@
    nacos:
      discovery:
        # 服务注册地址
        server-addr: 47.109.78.184:5000
        #server-addr: 127.0.0.1:8848
#        server-addr: 47.109.78.184:5000
        server-addr: 127.0.0.1:8848
        #pro
        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
#        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
        #dev
        #namespace: d39a744d-116f-4280-8445-0502dd1a3116
        namespace: 6857cbd9-6088-4fe8-bb58-2b516d99876f
      config:
        # 配置中心地址
        server-addr: 47.109.78.184:5000
        #server-addr: 127.0.0.1:8848
#        server-addr: 47.109.78.184:5000
        server-addr: 127.0.0.1:8848
        #pro
        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
#        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
        #dev
        #namespace: d39a744d-116f-4280-8445-0502dd1a3116
        namespace: 6857cbd9-6088-4fe8-bb58-2b516d99876f
        # 配置文件格式
        file-extension: yml
        # 共享配置
ruoyi-gateway/src/main/resources/bootstrap.yml
@@ -1,6 +1,6 @@
# Tomcat
server:
  port: 8020
  port: 1500
# Spring
spring: 
@@ -14,20 +14,20 @@
    nacos:
      discovery:
        # 服务注册地址
        server-addr: 47.109.78.184:5000
        #server-addr: 127.0.0.1:8848
#        server-addr: 47.109.78.184:5000
        server-addr: 127.0.0.1:8848
        #pro
        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
#        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
        #dev
        #namespace: d39a744d-116f-4280-8445-0502dd1a3116
        namespace: 6857cbd9-6088-4fe8-bb58-2b516d99876f
      config:
        # 配置中心地址
        server-addr: 47.109.78.184:5000
        #server-addr: 127.0.0.1:8848
#        server-addr: 47.109.78.184:5000
        server-addr: 127.0.0.1:8848
        #pro
        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
#        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
        #dev
        #namespace: d39a744d-116f-4280-8445-0502dd1a3116
        namespace: 6857cbd9-6088-4fe8-bb58-2b516d99876f
        # 配置文件格式
        file-extension: yml
        # 共享配置
@@ -43,8 +43,8 @@
      datasource:
        ds1:
          nacos:
            server-addr: 47.109.78.184:5000
            #server-addr: 127.0.0.1:8848
#            server-addr: 47.109.78.184:5000
            server-addr: 127.0.0.1:8848
            dataId: sentinel-ruoyi-gateway
            groupId: DEFAULT_GROUP
            data-type: json
ruoyi-modules/ruoyi-file/src/main/resources/bootstrap.yml
@@ -19,20 +19,20 @@
    nacos:
      discovery:
        # 服务注册地址
        server-addr: 47.109.78.184:5000
        #server-addr: 127.0.0.1:8848
#        server-addr: 47.109.78.184:5000
        server-addr: 127.0.0.1:8848
        #pro
        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
#        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
        #dev
        #namespace: d39a744d-116f-4280-8445-0502dd1a3116
        namespace: 6857cbd9-6088-4fe8-bb58-2b516d99876f
      config:
        # 配置中心地址
        server-addr: 47.109.78.184:5000
        #server-addr: 127.0.0.1:8848
#        server-addr: 47.109.78.184:5000
        server-addr: 127.0.0.1:8848
        #pro
        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
#        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
        #dev
        #namespace: d39a744d-116f-4280-8445-0502dd1a3116
        namespace: 6857cbd9-6088-4fe8-bb58-2b516d99876f
        # 配置文件格式
        file-extension: yml
        # 共享配置
ruoyi-modules/ruoyi-goods/src/main/resources/bootstrap.yml
@@ -14,20 +14,20 @@
    nacos:
      discovery:
        # 服务注册地址
        server-addr: 47.109.78.184:5000
        #server-addr: 127.0.0.1:8848
#        server-addr: 47.109.78.184:5000
        server-addr: 127.0.0.1:8848
        #pro
        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
#        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
        #dev
        #namespace: d39a744d-116f-4280-8445-0502dd1a3116
        namespace: 6857cbd9-6088-4fe8-bb58-2b516d99876f
      config:
        # 配置中心地址
        server-addr: 47.109.78.184:5000
        #server-addr: 127.0.0.1:8848
#        server-addr: 47.109.78.184:5000
        server-addr: 127.0.0.1:8848
        #pro
        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
#        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
        #dev
        #namespace: d39a744d-116f-4280-8445-0502dd1a3116
        namespace: 6857cbd9-6088-4fe8-bb58-2b516d99876f
        # 配置文件格式
        file-extension: yml
        # 共享配置
ruoyi-modules/ruoyi-member/src/main/resources/bootstrap.yml
@@ -14,20 +14,20 @@
    nacos:
      discovery:
        # 服务注册地址
        server-addr: 47.109.78.184:5000
        #server-addr: 127.0.0.1:8848
#        server-addr: 47.109.78.184:5000
        server-addr: 127.0.0.1:8848
        #pro
        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
#        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
        #dev
        #namespace: d39a744d-116f-4280-8445-0502dd1a3116
        namespace: 6857cbd9-6088-4fe8-bb58-2b516d99876f
      config:
        # 配置中心地址
        server-addr: 47.109.78.184:5000
        #server-addr: 127.0.0.1:8848
#        server-addr: 47.109.78.184:5000
        server-addr: 127.0.0.1:8848
        #pro
        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
#        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
        #dev
        #namespace: d39a744d-116f-4280-8445-0502dd1a3116
        namespace: 6857cbd9-6088-4fe8-bb58-2b516d99876f
        # 配置文件格式
        file-extension: yml
        # 共享配置
ruoyi-modules/ruoyi-order/pom.xml
@@ -150,6 +150,11 @@
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>cn.hutool</groupId>
            <artifactId>hutool-all</artifactId>
            <version>5.8.22</version>
        </dependency>
    </dependencies>
    <build>
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/controller/business/MerOrderController.java
@@ -75,7 +75,7 @@
    }
    @RequestMapping(value = "/sureVerifyOrder", method = RequestMethod.POST)
    @ApiOperation(value = "核销订单")
    @ApiOperation(value = "核销订单") //todo 分账
    public R<MerVerifyOrderVo> sureVerifyOrder(@RequestBody MerVerifyOrderDto merVerifyOrderDto) {
        Long userId = SecurityUtils.getUserId();
        merVerifyOrderDto.setUserId(userId);
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/controller/miniapp/AppOrderController.java
@@ -75,13 +75,13 @@
    }
    @RequestMapping(value = "/placeOrder", method = RequestMethod.POST)
    @ApiOperation(value = "创建订单")
    @ApiOperation(value = "创建订单")//todo 支付
    public R<AppPlaceOrderVo> placeOrder(@RequestBody AppPlaceOrderDto appPlaceOrderDto) {
        LoginUser loginUser = SecurityUtils.getLoginUser();
        Long userId = loginUser.getUserid();
        if(1==1){
            throw new ServiceException("支付功能尚未开通,请联系客服");
        }
//        if(1==1){
//            throw new ServiceException("支付功能尚未开通,请联系客服");
//        }
        appPlaceOrderDto.setUserId(userId);
        appPlaceOrderDto.setSpbillCreateIp(loginUser.getIpaddr());
        AppPlaceOrderVo appPlaceOrderVo = orderService.placeOrder(appPlaceOrderDto);
@@ -93,9 +93,9 @@
    public R<AppPlaceOrderVo> placeActivityOrder(@Validated @RequestBody AppPlaceActivityDto appPlaceActivityDto) {
        LoginUser loginUser = SecurityUtils.getLoginUser();
        Long userId = loginUser.getUserid();
        if(1==1){
            throw new ServiceException("支付功能尚未开通,请联系客服");
        }
//        if(1==1){
//            throw new ServiceException("支付功能尚未开通,请联系客服");
//        }
        appPlaceActivityDto.setUserId(userId);
        appPlaceActivityDto.setSpbillCreateIp(loginUser.getIpaddr());
        AppPlaceOrderVo appPlaceOrderVo = orderService.placeActivityOrder(appPlaceActivityDto);
@@ -136,7 +136,7 @@
    }
    @RequestMapping(value = "/payOrder", method = RequestMethod.POST)
    @ApiOperation(value = "支付订单")
    @ApiOperation(value = "支付订单")//todo 支付
    public R<AppPlaceOrderVo> payOrder(@RequestBody AppBaseGetDto appBaseGetDto) {
        Long userId = SecurityUtils.getUserId();
        AppPlaceOrderVo appPlaceOrderVo = orderService.payOrder(appBaseGetDto.getId());
@@ -144,7 +144,7 @@
    }
    @RequestMapping(value = "/cancelOrder", method = RequestMethod.POST)
    @ApiOperation(value = "取消订单")
    @ApiOperation(value = "取消订单")//todo 退款
    public R cancelOrder(@RequestBody AppBaseGetDto appBaseGetDto) {
        Long userId = SecurityUtils.getUserId();
        orderService.cancelOrder(appBaseGetDto.getId());
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/controller/miniapp/NotifyController.java
@@ -1,5 +1,6 @@
package com.ruoyi.order.controller.miniapp;
import com.alibaba.fastjson.JSONObject;
import com.github.binarywang.wxpay.bean.ecommerce.*;
import com.github.binarywang.wxpay.bean.notify.WxPayNotifyV3Response;
import com.github.binarywang.wxpay.bean.profitsharingV3.ProfitSharingNotifyData;
@@ -11,11 +12,19 @@
import com.github.binarywang.wxpay.v3.util.AesUtils;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.order.domain.pojo.account.OrderRefund;
import com.ruoyi.order.domain.vo.ProfitSharingNotifyNewResult;
import com.ruoyi.order.domain.vo.WeixinPaymentNotifyVo;
import com.ruoyi.order.domain.vo.WeixinPaymentRefundVo;
import com.ruoyi.order.enums.RefundStatusEnum;
import com.ruoyi.order.enums.WxPayNotifyEventTypeEnum;
import com.ruoyi.order.enums.dict.IDict;
import com.ruoyi.order.service.account.BackMessageService;
import com.ruoyi.order.service.account.OrderRefundService;
import com.ruoyi.order.service.order.OrderService;
import com.ruoyi.order.util.HuiFuTianXiaUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.log4j.Log4j2;
@@ -26,6 +35,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;
import java.security.GeneralSecurityException;
import java.util.Collection;
@@ -59,6 +69,9 @@
    private WxPayService wxService;
    @Resource
    private BackMessageService backMessageService;
    @Resource
    private OrderRefundService orderRefundService;
    @PostMapping(value = "/payNotify")
    @ApiOperation(value = "微信支付/退款通知")
@@ -211,4 +224,71 @@
        return signatureHeader;
    }
    @RequestMapping(value = "/wechatPaymentCallback", method = RequestMethod.POST)
    @ApiOperation(value = "微信支付通知(汇付天下)")
    public void wechatPaymentCallback(@RequestBody JSONObject jsonObject, HttpServletResponse response){
        R<WeixinPaymentNotifyVo> r = HuiFuTianXiaUtil.weixinPaymentNotify(jsonObject);
        if(r.getCode() == 200){
            WeixinPaymentNotifyVo data = r.getData();
            String transStat = data.getTransStat();
            if("S".equals(transStat)){
                PartnerTransactionsResult transaction = new PartnerTransactionsResult();
                transaction.setOutTradeNo(data.getReqSeqId());
                //开始处理业务数据
                orderService.payBack(transaction);
                response.setStatus(200);
                PrintWriter out = null;
                try {
                    out = response.getWriter();
                    out.print("RECV_ORD_ID_" + data.getReqSeqId());
                    out.flush();
                } catch (IOException e) {
                    e.printStackTrace();
                }finally {
                    out.close();
                }
            }
        }
    }
    @RequestMapping(value = "/wechatPaymentRefundCallback", method = RequestMethod.POST)
    @ApiOperation(value = "微信支付退款通知(汇付天下)")
    public void wechatPaymentRefundCallback(@RequestBody JSONObject jsonObject, HttpServletResponse response){
        R<WeixinPaymentRefundVo> r = HuiFuTianXiaUtil.weixinPaymentRefundNotify(jsonObject);
        if(r.getCode() == 200){
            WeixinPaymentRefundVo data = r.getData();
            String transStat = data.getTransStat();
            if("S".equals(transStat)){
                //开始处理业务数据
                String reqSeqId = data.getReqSeqId();
                OrderRefund orderRefund = orderRefundService.getById(reqSeqId);
                if(null != orderRefund){
                    orderRefund.setWxRefundId(data.getPartyOrderId());
                    orderRefund.setBackTime(data.getTransDate() + data.getTransTime());
                    orderRefund.setRefundStatus(2);
                    orderRefundService.saveOrUpdate(orderRefund);
                }
                response.setStatus(200);
                PrintWriter out = null;
                try {
                    out = response.getWriter();
                    out.print("RECV_ORD_ID_" + data.getReqSeqId());
                    out.flush();
                } catch (IOException e) {
                    e.printStackTrace();
                }finally {
                    out.close();
                }
            }
        }
    }
}
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/domain/dto/MgtShopHFTXAuthDto.java
New file
@@ -0,0 +1,141 @@
package com.ruoyi.order.domain.dto;
import com.ruoyi.system.api.domain.dto.MgtBaseDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @ClassName Mgt
 * @Description TODO
 * @Author jqs
 * @Date 2023/6/19 10:57
 * @Version 1.0
 */
@Data
public class MgtShopHFTXAuthDto extends MgtBaseDto {
    @ApiModelProperty(value = "商户id", dataType = "long", required = true)
    private Integer shopId;
    @ApiModelProperty(value = "进件类型(1=用户,2=企业)", dataType = "int", required = true)
    private Integer type;
    @ApiModelProperty(value = "商户名称", dataType = "string", required = true)
    private String regName;
    @ApiModelProperty(value = "商户简称", dataType = "string", required = true)
    private String shortName;
    @ApiModelProperty(value = "公司类型(1:政府机构,2:国营企业,3:私营企业,4:外资企业,5:个体工商户,7:事业单位)", dataType = "string", required = true)
    private String entType;
    @ApiModelProperty(value = "营业执照编号", dataType = "string", required = true)
    private String licenseCode;
    @ApiModelProperty(value = "营业执照有效期类型(0:非长期有效 ,1:长期有效)", dataType = "string", required = true)
    private String licenseValidityType;
    @ApiModelProperty(value = "营业执照有效期开始日期(日期格式:yyyyMMdd)", dataType = "string", required = true)
    private String licenseBeginDate;
    @ApiModelProperty(value = "营业执照有效期截止日期(日期格式:yyyyMMdd,当license_validity_type=0时必填 ;当license_validity_type=1时为空)", dataType = "string", required = true)
    private String licenseEndDate;
    @ApiModelProperty(value = "注册省(示例值:310000)", dataType = "string", required = true)
    private String regProvId;
    @ApiModelProperty(value = "注册市(示例值:310000)", dataType = "string", required = true)
    private String regAreaId;
    @ApiModelProperty(value = "注册区(示例值:310000)", dataType = "string", required = true)
    private String regDistrictId;
    @ApiModelProperty(value = "注册详细地址", dataType = "string", required = true)
    private String regDetail;
    @ApiModelProperty(value = "法人姓名", dataType = "string", required = true)
    private String legalName;
    @ApiModelProperty(value = "法人证件类型", dataType = "string", required = true)
    private String legalCertType;
    @ApiModelProperty(value = "法人证件号码", dataType = "string", required = true)
    private String legalCertNo;
    @ApiModelProperty(value = "法人证件有效期类型(1:长期有效;0:非长期有效 )", dataType = "string", required = true)
    private String legalCertValidityType;
    @ApiModelProperty(value = "法人证件有效期开始日期(日期格式:yyyyMMdd,以北京时间为准)", dataType = "string", required = true)
    private String legalCertBeginDate;
    @ApiModelProperty(value = "法人证件有效期截止日期(日期格式:yyyyMMdd,当legal_cert_validity_type=0时必填 ;当legal_cert_validity_type=1时为空 )", dataType = "string", required = true)
    private String legalCertEndDate;
    @ApiModelProperty(value = "经营省", dataType = "string", required = true)
    private String provId;
    @ApiModelProperty(value = "经营市", dataType = "string", required = true)
    private String areaId;
    @ApiModelProperty(value = "经营区", dataType = "string", required = true)
    private String districtId;
    @ApiModelProperty(value = "经营详细地址", dataType = "string", required = true)
    private String detailAddr;
    @ApiModelProperty(value = "联系人姓名", dataType = "string", required = true)
    private String contactName;
    @ApiModelProperty(value = "联系人手机号", dataType = "string", required = true)
    private String contactMobileNo;
    @ApiModelProperty(value = "联系人电子邮箱", dataType = "string", required = true)
    private String contactEmail;
    @ApiModelProperty(value = "客服电话", dataType = "string", required = true)
    private String servicePhone;
    @ApiModelProperty(value = "小票名称", dataType = "string", required = true)
    private String receiptName;
    @ApiModelProperty(value = "结算账户类型(结算账户类型,个人商户/用户不支持填写对公账户和对私非法人账户\n" +
            "0:对公账户 1:对私法人账户 2:对私非法人账户)", dataType = "string", required = true)
    private String cardType;
    @ApiModelProperty(value = "结算账户名(当card_type=0时填写企业名称\n" +
            "当card_type=1时填写法人姓名,对私法人结算银行户名与法人姓名必需一致;\n" +
            "当card_type=2时填写非法人姓名)", dataType = "string", required = true)
    private String cardName;
    @ApiModelProperty(value = "结算账号", dataType = "string", required = true)
    private String cardNo;
    @ApiModelProperty(value = "银行所在省", dataType = "string", required = true)
    private String jsProvId;
    @ApiModelProperty(value = "银行所在市", dataType = "string", required = true)
    private String jsAreaId;
    @ApiModelProperty(value = "联行号", dataType = "string", required = true)
    private String branchCode;
    @ApiModelProperty(value = "持卡人证件类型(当card_type=0时为空, 当card_type=1或2时必填)", dataType = "string", required = true)
    private String certType;
    @ApiModelProperty(value = "持卡人证件号码(对私结算必填;年龄不小于18岁且不能大于80岁;如持卡人证件类型为00:身份证,则填写身份证号码 )", dataType = "string", required = true)
    private String certNo;
    @ApiModelProperty(value = "持卡人证件类型(1:长期有效 0:非长期有效)", dataType = "string", required = true)
    private String certValidityType;
    @ApiModelProperty(value = "持卡人证件有效期开始(日期格式:yyyyMMdd,当cert_validity_type=0时必填;当cert_validity_type=1时为空)", dataType = "string", required = true)
    private String certBeginDate;
    @ApiModelProperty(value = "持卡人证件有效期截止日期(日期格式:yyyyMMdd,当cert_validity_type=0时必填;当cert_validity_type=1时为空)", dataType = "string", required = true)
    private String certEndDate;
    @ApiModelProperty(value = "银行卡绑定手机号(对私非法人结算必填,开通全域资金管理功能必填)", dataType = "string", required = true)
    private String mp;
    @ApiModelProperty(value = "商户ICP备案编号", dataType = "string", required = true)
    private String merIcp;
    @ApiModelProperty(value = "基本存款账户编号或核准号", dataType = "string", required = true)
    private String openLicenceNo;
    @ApiModelProperty(value = "开户许可证", dataType = "string", required = true)
    private String regAcctPic;
    @ApiModelProperty(value = "结算卡正面", dataType = "string", required = true)
    private String settleCardFrontPic;
    @ApiModelProperty(value = "结算人身份证国徽面", dataType = "string", required = true)
    private String settleCertBackPic;
    @ApiModelProperty(value = "结算人身份证人像面", dataType = "string", required = true)
    private String settleCertFrontPic;
    @ApiModelProperty(value = "税务登记证", dataType = "string", required = true)
    private String taxRegPic;
    @ApiModelProperty(value = "法人身份证国徽面", dataType = "string", required = true)
    private String legalCertBackPic;
    @ApiModelProperty(value = "法人身份证人像面", dataType = "string", required = true)
    private String legalCertFrontPic;
    @ApiModelProperty(value = "营业执照图片", dataType = "string", required = true)
    private String licensePic;
    @ApiModelProperty(value = "授权委托书", dataType = "string", required = true)
    private String authEnturstPic;
    @ApiModelProperty(value = "注册资本", dataType = "string", required = true)
    private String regCapital;
    @ApiModelProperty(value = "经营范围", dataType = "string", required = true)
    private String businessScope;
    @ApiModelProperty(value = "成立时间,示例值:20091212", dataType = "string", required = true)
    private String foundDate;
    @ApiModelProperty(value = "线下经营-门头照", dataType = "string", required = true)
    private String storeHeaderPic;
    @ApiModelProperty(value = "线下经营-内景照", dataType = "string", required = true)
    private String storeIndoorPic;
    @ApiModelProperty(value = "线下经营-收银台", dataType = "string", required = true)
    private String storeCashierDeskPic;
    @ApiModelProperty(value = "线上经营-公司前台", dataType = "string", required = true)
    private String onlineCompanyPic;
    @ApiModelProperty(value = "线上经营-工作区域", dataType = "string", required = true)
    private String onlineCompanyAreaPic;
    @ApiModelProperty(value = "法人手机号", dataType = "string", required = true)
    private String legalMobileNo;
    @ApiModelProperty(value = "法人身份证地址", dataType = "string", required = true)
    private String legalAddr;
}
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/domain/pojo/account/ProfitSharing.java
@@ -41,6 +41,7 @@
    /**
     * 1:PROCESSING:处理中
        2:FINISHED:分账完成
     3:FINISHED:失败
     */
    @TableField("share_status")
    private Integer shareStatus;
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/domain/vo/PaymentDelaytransHFTXVo.java
New file
@@ -0,0 +1,31 @@
package com.ruoyi.order.domain.vo;
import lombok.Data;
/**
 * @author zhibing.pu
 * @Date 2023/10/16 17:20
 */
@Data
public class PaymentDelaytransHFTXVo {
    /**
     * 交易状态(P:处理中;S:成功;F:失败;示例值:S)
     */
    private String transStat;
    /**
     * 业务响应信息
     */
    private String respDesc;
    /**
     * 业务请求流水号
     */
    private String reqSeqId;
    /**
     * 全局流水号
     */
    private String hfSeqId;
    /**
     * 支付交易业务请求流水号
     */
    private String orgReqSeqId;
}
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/domain/vo/WeixinPaymentNotifyVo.java
New file
@@ -0,0 +1,35 @@
package com.ruoyi.order.domain.vo;
import lombok.Data;
/**
 * @author zhibing.pu
 * @Date 2023/10/17 10:00
 */
@Data
public class WeixinPaymentNotifyVo {
    /**
     * 请求流水号
     */
    private String reqSeqId;
    /**
     * 请求时间
     */
    private String reqDate;
    /**
     * 交易金额
     */
    private String transAmt;
    /**
     * 实付金额
     */
    private String payAmt;
    /**
     * 支付完成时间 yyyyMMddHHmmss
     */
    private String endTime;
    /**
     * 交易状态 S:成功、F:失败
     */
    private String transStat;
}
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/domain/vo/WeixinPaymentRefundVo.java
New file
@@ -0,0 +1,51 @@
package com.ruoyi.order.domain.vo;
import lombok.Data;
/**
 * @author zhibing.pu
 * @Date 2023/10/16 19:34
 */
@Data
public class WeixinPaymentRefundVo {
    /**
     * 请求流水号
     */
    private String reqSeqId;
    /**
     * 微信支付宝的商户单号
     */
    private String partyOrderId;
    /**
     * 请求日期
     */
    private String reqDate;
    /**
     * 退款交易发生日期
     */
    private String transDate;
    /**
     * 退款交易发生时间
     */
    private String transTime;
    /**
     * 交易状态 P:处理中、S:成功、F:失败
     */
    private String transStat;
    /**
     * 退款金额
     */
    private String ordAmt;
    /**
     * 实际退款金额
     */
    private String actualRefAmt;
    /**
     * 原交易累计退款金额
     */
    private String totalRefAmt;
    /**
     * 累计退款次数
     */
    private String refCut;
}
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/account/ProfitSharingService.java
@@ -3,6 +3,7 @@
import com.github.binarywang.wxpay.bean.ecommerce.ProfitSharingResult;
import com.ruoyi.order.domain.pojo.account.ProfitSharing;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.order.domain.vo.PaymentDelaytransHFTXVo;
import java.math.BigDecimal;
@@ -25,6 +26,17 @@
     */
    void saveProfitSharing(Long shopId, String orderId, BigDecimal orderMoney, ProfitSharingResult result);
    /**
     * 创建按分账记录
     * @param shopId
     * @param orderId
     * @param orderMoney
     * @param result
     */
    void saveProfitSharing1(Long shopId, String orderId, BigDecimal orderMoney, String huifuId, Double amount, PaymentDelaytransHFTXVo result);
    /**
     * @description  通过订单id获取
     * @author  jqs
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/account/ProfitSharingServiceImpl.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.binarywang.wxpay.bean.ecommerce.ProfitSharingResult;
import com.ruoyi.order.domain.pojo.account.ProfitSharing;
import com.ruoyi.order.domain.vo.PaymentDelaytransHFTXVo;
import com.ruoyi.order.mapper.account.ProfitSharingMapper;
import com.ruoyi.order.service.account.ProfitSharingService;
import org.springframework.stereotype.Service;
@@ -52,6 +53,28 @@
        this.saveOrUpdate(profitSharing);
    }
    @Override
    public void saveProfitSharing1(Long shopId, String orderId, BigDecimal orderMoney, String huifuId, Double amount, PaymentDelaytransHFTXVo result) {
        ProfitSharing profitSharing = new ProfitSharing();
        profitSharing.setShareId(result.getReqSeqId());
        profitSharing.setDelFlag(0);
        profitSharing.setShareStatus("P".equals(result.getTransStat()) ? 1 : "S".equals(result.getTransStat()) ? 2 : 3);
        profitSharing.setShopId(shopId);
        profitSharing.setOrderId(orderId);
        profitSharing.setOrderMoney(orderMoney);
        profitSharing.setReceiverAccount(huifuId);
        profitSharing.setReceiverAmount(new BigDecimal(amount));
        profitSharing.setFinishFlag("S".equals(result.getTransStat()) ? 1 : 0);
        profitSharing.setFailReason(result.getRespDesc());
        profitSharing.setDetailId(result.getReqSeqId());
        profitSharing.setCreateTime(new Date());
        this.saveOrUpdate(profitSharing);
    }
    /**
     * @description  通过订单id获取
     * @author  jqs
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/order/OrderServiceImpl.java
@@ -1,5 +1,7 @@
package com.ruoyi.order.service.impl.order;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -39,6 +41,7 @@
import com.ruoyi.order.service.account.PaymentMessageService;
import com.ruoyi.order.service.account.ProfitSharingService;
import com.ruoyi.order.service.order.*;
import com.ruoyi.order.util.HuiFuTianXiaUtil;
import com.ruoyi.system.api.constant.AppErrorConstant;
import com.ruoyi.system.api.constant.DelayTaskEnum;
import com.ruoyi.system.api.constant.SecurityConstant;
@@ -60,12 +63,14 @@
import lombok.extern.log4j.Log4j2;
import org.redisson.api.RLock;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
@@ -145,6 +150,9 @@
    @Resource
    private OrderRefundService orderRefundService;
    @Value("${wx.pay.callbackPath}")
    private String callbackPath;
    /**
@@ -781,8 +789,13 @@
            if (null != goodsNameList) {
                goodsName = String.join(",", goodsNameList);
            }
            // 小程序微信下单支付
            createWxPayInfo(appPlaceOrderVo, userId, order.getShopId(), goodsName, outTradeNo,
//            // 小程序微信下单支付
//            createWxPayInfo(appPlaceOrderVo, userId, order.getShopId(), goodsName, outTradeNo,
//                    orderId, order.getPayMoney(), appPlaceOrderDto.getOpenid(),
//                    appPlaceOrderDto.getSpbillCreateIp());
            // 小程序微信下单支付 TODO 更换支付渠道(汇付天下)
            createWxPayInfo1(appPlaceOrderVo, userId, order.getShopId(), goodsName, outTradeNo,
                    orderId, order.getPayMoney(), appPlaceOrderDto.getOpenid(),
                    appPlaceOrderDto.getSpbillCreateIp());
            //生成自动取消订单延时任务
@@ -921,36 +934,47 @@
     * @param payerClientIp
     */
//    private void createWxPayInfo(AppPlaceOrderVo appPlaceOrderVo, Long userId, Long shopId,
//                                 String goodsName, String outTradeNo,
//                                 String orderId, BigDecimal payMoney,
//                                 String openid, String payerClientIp){
//        try {
//
//
//
//            // 支付相关信息返回
//            appPlaceOrderVo.setAppId(result.getAppId());
//            appPlaceOrderVo.setMchId(config.getMchId());
//            appPlaceOrderVo.setTimeStamp(result.getTimeStamp());
//            appPlaceOrderVo.setNonceStr(result.getNonceStr());
//            appPlaceOrderVo.setPackageStr(result.getPackageValue());
//            appPlaceOrderVo.setSignType(result.getSignType());
//            appPlaceOrderVo.setPaySign(result.getPaySign());
//            appPlaceOrderVo.setPrepayId(result.getPackageValue());
//
//            // 保存支付订单统一下单日志
//            paymentMessageService.savePaymentMessage("1", orderId, payRequestJson, payResponseJson);
//
//            // 保存支付订单统一下单支付记录
//            orderPaymentService.saveOrderPayment(userId, shopId, mainMchId, orderId, outTradeNo, payMoney,
//                    appPlaceOrderVo.getEndTime(), "Y", openid,
//                    goodsName, result.getPackageValue());
//        }catch (Exception e){
//            e.printStackTrace();
//        }
//
//    }
    private void createWxPayInfo1(AppPlaceOrderVo appPlaceOrderVo, Long userId, Long shopId,
                                 String goodsName, String outTradeNo,
                                 String orderId, BigDecimal payMoney,
                                 String openid, String payerClientIp){
        try {
            WxPayConfig config = wxService.getConfig();
            PartnerTransactionsRequest request = new PartnerTransactionsRequest();
            request.setSpAppid(config.getAppId());
            request.setSpMchid(config.getMchId());
            request.setSubMchid(config.getSubMchId());
            //  商品描述    body
            String description = goodsName + "-商品购买";
            request.setDescription(description);
            request.setOutTradeNo(outTradeNo);
            request.setNotifyUrl(callbackPath + "/order/app/notify/wechatPaymentCallback");
            R<com.alibaba.fastjson.JSONObject> r = HuiFuTianXiaUtil.weixinPayment(outTradeNo, description, payMoney.doubleValue(), openid, request.getNotifyUrl());
            com.alibaba.fastjson.JSONObject data = r.getData();
            String mainMchId = WxPayConfiguration.getPlatformTyMacId();
            // 支付相关信息返回
            appPlaceOrderVo.setAppId(data.getString("appId"));
            appPlaceOrderVo.setMchId(config.getMchId());
            appPlaceOrderVo.setTimeStamp(data.getString("timeStamp"));
            appPlaceOrderVo.setNonceStr(data.getString("nonceStr"));
            appPlaceOrderVo.setPackageStr(data.getString("package"));
            appPlaceOrderVo.setSignType(data.getString("signType"));
            appPlaceOrderVo.setPaySign(data.getString("paySign"));
            // 保存支付订单统一下单日志
            paymentMessageService.savePaymentMessage("1", orderId, JSON.toJSONString(request), data.toJSONString());
            // 保存支付订单统一下单支付记录
            orderPaymentService.saveOrderPayment(userId, shopId, mainMchId, orderId, outTradeNo, payMoney,
                    appPlaceOrderVo.getEndTime(), "Y", openid,
                    goodsName, appPlaceOrderVo.getPackageStr());
        }catch (Exception e){
            e.printStackTrace();
        }
    }
@@ -1871,7 +1895,9 @@
        this.saveOrUpdate(order);
        // 订单金额大于0时进行分账
        if (order.getOnlinePayMoney().compareTo(BigDecimal.ZERO)>0) {
            submitProfitSharing(orderId, order.getOrderNo(), order.getShopId(), order.getOnlinePayMoney(),order.getOrderFrom());
            // TODO: 2023/10/17  更换分账渠道(汇付天下)
//            submitProfitSharing(orderId, order.getOrderNo(), order.getShopId(), order.getOnlinePayMoney(),order.getOrderFrom());
            submitProfitSharing1(orderId, order.getOrderNo(), order.getShopId(), order.getOnlinePayMoney(),order.getOrderFrom());
        }
        //创建支付记录
        if(merVerifyOrderDto.getRelPayMoney().compareTo(BigDecimal.ZERO)>0){
@@ -1994,6 +2020,120 @@
        // 保存分账信息
        paymentMessageService.savePaymentMessage("4", orderId, sendMessage, resultMessage);
    }
    /**
     * @description  分账实现
     * @author  jqs
     * @date    2023/9/8 11:56
     * @param orderId
     * @param orderNo
     * @param shopId
     * @param orderMoney
     * @param orderFrom
     * @return  void
     */
    private void submitProfitSharing1(String orderId, String orderNo, Long shopId, BigDecimal orderMoney, Integer orderFrom) {
        String sendMessage = "";
        String resultMessage = "";
        try {
            // 核销完成 开始分账(平台收取服务费)
            OrderPayment payment = orderPaymentService.getByOrderId(orderId);
            String transactionId = payment.getTransactionId();
            String outTradeNo = payment.getOutTradeNo();
            R<ShopAuthenticationHftxVo> resultMch = remoteShopService.getShopHFTXSubMchId(shopId);
            ShopAuthenticationHftxVo vo = resultMch.getData();
            if (StringUtils.isEmpty(vo.getHuifuId())) {
                throw new ServiceException("获取商户号失败");
            }
            // 平台特约商户号,用户平台收取服务费 2023-09-05改变分账方式
            String platformTyMacId = WxPayConfiguration.getPlatformTyMacId();
            if (!StringUtils.isEmpty(platformTyMacId)) {
                WxPayConfig config = wxService.getConfig();
                ShopProportionVo shopProportion = null;
                BigDecimal proportionPercent = null;
                //商户订单获取统一分成 活动订单获取活动分成
                if(orderFrom==1){
                    proportionPercent = new BigDecimal(vo.getShareRatio());
                }else{
                    R<ShopProportionVo> resultShopProportion = remoteShopService.getShopProportion(shopId);
                    shopProportion = resultShopProportion.getData();
                    proportionPercent = shopProportion.getProportionPercent();
                }
                if (null != proportionPercent) {
                    ProfitSharingRequest request = new ProfitSharingRequest();
                    request.setAppid(config.getAppId());
                    request.setSubMchid(platformTyMacId);
                    request.setTransactionId(transactionId);
                    request.setOutOrderNo(IdUtils.simpleUUID());
                    List<ProfitSharingRequest.Receiver> receiverList = new ArrayList<>();
                    String description = "订单:" + orderNo + " 平台分账";
                    //商户分成
                    if(proportionPercent.compareTo(BigDecimal.ZERO)>0){
                        PaymentDelaytransHFTXVo result = new PaymentDelaytransHFTXVo();
                        // 计算分成金额
                        int amount = orderMoney.multiply(proportionPercent).setScale(0, RoundingMode.UP).intValue();
                        BigDecimal multiply = orderMoney.multiply(proportionPercent.divide(new BigDecimal(100))).setScale(2, RoundingMode.HALF_EVEN);
                        log.info("订单分账:{} 分账金额: {}", orderNo, amount);
                        if (amount > 0) {
                            // 分账创建
                            ProfitSharingRequest.Receiver receiver = new ProfitSharingRequest.Receiver();
                            receiver.setType("MERCHANT_ID");
                            receiver.setReceiverAccount(vo.getHuifuId());
                            receiver.setAmount(amount);
                            receiver.setDescription(description);
                            receiverList.add(receiver);
                            request.setReceivers(receiverList);
                            // 分账完成
                            request.setFinish(true);
                            NumberFormat numberFormat = NumberFormat.getInstance();
                            numberFormat.setMaximumFractionDigits(2);
                            //分账对象
                            JSONArray acctInfos = new JSONArray();
                            JSONObject jsonObject = new JSONObject();
                            jsonObject.put("div_amt", numberFormat.format(multiply.doubleValue()));
                            jsonObject.put("huifu_id", vo.getHuifuId());
                            //平台商户
                            double pt_amount = orderMoney.subtract(multiply).setScale(2, RoundingMode.HALF_EVEN).doubleValue();
                            JSONObject jsonObject1 = new JSONObject();
                            jsonObject1.put("div_amt", numberFormat.format(pt_amount));
                            jsonObject1.put("huifu_id", HuiFuTianXiaUtil.huifu_id);
                            acctInfos.add(jsonObject1);
                            R<PaymentDelaytransHFTXVo> hftxVoR = HuiFuTianXiaUtil.paymentDelaytrans(request.getOutOrderNo(), outTradeNo, acctInfos);
                            if(hftxVoR.getCode() != 200){
                                throw new ServiceException(hftxVoR.getMsg());
                            }
                            result = hftxVoR.getData();
                            // 创建分账记录
                            profitSharingService.saveProfitSharing1(shopId, orderId, orderMoney, vo.getHuifuId(), multiply.doubleValue(), result);
                        }
                        // 保存请求信息
                        sendMessage = JSONObject.toJSONString(request);
                        resultMessage = JSONObject.toJSONString(result);
                    }
                } else {
                    resultMessage = String.format("订单分账:%s 获取商户分成失败", orderNo);
                    log.info(resultMessage);
                }
            } else {
                resultMessage = String.format("订单分账:%s 获取微信商户号失败", orderNo);
                log.info(resultMessage);
            }
        } catch (Exception e) {
            resultMessage = String.format("订单分账:%s 分账失败:%s", orderNo, e.getMessage());
            log.info(resultMessage);
            throw new ServiceException(resultMessage);
        }
        // 保存分账信息
        paymentMessageService.savePaymentMessage("4", orderId, sendMessage, resultMessage);
    }
    /**
     * @param merVerifyCouponDto
@@ -5307,7 +5447,9 @@
        if(BigDecimal.ZERO.compareTo(onlinePayMoney) < 0){
            log.info("订单支付金额大于0,可发起退款");
            // 订单支付金额大于0,可发起退款
            orderWxApplyRefund(orderId, refundId, onlinePayMoney, orderRefund);
//            orderWxApplyRefund(orderId, refundId, onlinePayMoney, orderRefund);
            // 订单支付金额大于0,可发起退款 todo 修改渠道(汇付天下)
            orderWxApplyRefund1(orderId, refundId, onlinePayMoney, orderRefund);
        }
        orderRefund.setRefundStatus(1);
@@ -5364,6 +5506,66 @@
        }
    }
    /**
     * 申请退款API
     */
    private void orderWxApplyRefund1(String orderId, String outRefundNo, BigDecimal payMoney, OrderRefund orderRefund){
        try {
            // 创建支付订单
            OrderPayment orderPayment = orderPaymentService.getByOrderId(orderId);
            if (null == orderPayment) {
                return;
            }
            log.info("调用微信退款---发起退款");
            String subMchId = orderPayment.getSubMchId();
            WxPayConfig config = wxService.getConfig();
            RefundsRequest request = new RefundsRequest();
            request.setSpAppid(config.getAppId());
            request.setSubMchid(subMchId);
            request.setTransactionId(orderPayment.getTransactionId());
            request.setOutRefundNo(outRefundNo);
            request.setReason("用户取消订单");
            // 订单金额
            int total = orderPayment.getPayMoney().multiply(new BigDecimal(100)).intValue();
            RefundsRequest.Amount amount = RefundsRequest.Amount.builder().refund(total).total(total).currency("CNY").build();
            request.setAmount(amount);
            request.setNotifyUrl(callbackPath + "/order/app/notify/wechatPaymentRefundCallback");
            RefundsResult result = wxService.getEcommerceService().refunds(request);
            SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
            String org_req_date = sdf.format(orderPayment.getCreateTime());
            String outTradeNo = orderPayment.getOutTradeNo();
            R<String> r = HuiFuTianXiaUtil.weixinPaymentRefund(outRefundNo, orderPayment.getPayMoney().doubleValue(), org_req_date, outTradeNo, request.getNotifyUrl());
            if(r.getCode() != 200){
                throw new ServiceException(r.getMsg());
            }
            // 微信退款id
            orderRefund.setWxRefundId(r.getData());
            // 请求参数
            Gson gson = new Gson();
            String refundRequestJson = gson.toJson(request);
            // 返回参数
            String refundResponseJson = gson.toJson(result);
            log.info("调用微信退款返回参数---{}", refundResponseJson);
            // 保存支付订单统一下单日志
            paymentMessageService.savePaymentMessage("3", orderId, refundRequestJson, refundResponseJson);
        } catch (WxPayException e) {
            throw new ServiceException(e.getMessage());
        }
    }
    /**
     * @param staffTotalDto
     * @return StaffActivityOrderTotalVo
ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/util/HuiFuTianXiaUtil.java
New file
@@ -0,0 +1,351 @@
package com.ruoyi.order.util;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.order.domain.vo.PaymentDelaytransHFTXVo;
import com.ruoyi.order.domain.vo.WeixinPaymentNotifyVo;
import com.ruoyi.order.domain.vo.WeixinPaymentRefundVo;
import org.springframework.util.StringUtils;
import java.security.KeyFactory;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.Signature;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.*;
/**
 * 汇付天下工具类
 * @author zhibing.pu
 * @Date 2023/10/12 0:02
 */
public class HuiFuTianXiaUtil {
    //私钥(Base64编码)
    private static String privateKeyBase64 = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCs658vv/6VdoSGyxr7gVNxlsFGKC2RE4I3S3C78f7t29t6oSm7tdRUr+B/I1VtV1Ps2SQMqG+gUpLiVbHEj+U8PjrvSht6cBNpqhnUjBASEhO0zeCJXNj3zqEDj7CnzDbUzuZWZDyLEaSLRaVb/DSW34D0GDsGWpIMLui/lnubXCYMNsUJBgRmV/tSv7vApVok3aKDoYkZMDhfnKrbxTtWkDfwNLDCInB300YbGeN7hhECRestktymHw0I78x3g+pdzOKOSofqdHyBCemVgOBt2h+oulVU65jc5ok0vwhx7sk2+i3Dw/S/hx3fpnOAToLhpFSTCqArG5wOhiOTX5RRAgMBAAECggEAT+uu7VDdh5L5eZtR40BIos08kwJq3QyZOJlDh3o3ixP8gtcOBNXrRyDqr5hTGXAtN+C8SqVmwkCn5rgYq3KeTpOshYBI5vP55PJbceMyYke8l+o3hwVEunPj81NsIIHALedaij9VxCjpVf1gif0tCTZP0YGJdkxSCBN+O15/zrOred2xkbAGXCNM2j+uIOZ5LTQ064jUAm9KWO4JvVnlNCQPiJCfe652i4RE9adgTlT7d9XffQ/oZDZcDkD1OVUO4ErsSgvjsjPW9Qk8zAVm/C+ycs27GUbVf6yh3zMoL4JDshzoMYAVDqP3VkpYGiW71PzcOZqktcjbtCom4/gpqQKBgQDgHrsQVzMwr18gRAWl8PsgHyMvhyivzk7uPvm6nK9mvEGg7wnrCMKHkpEOCi4mHWnW6H9ptrkeAQbHN7H8Qd6JZm/H0VN8N8fg4IFarlrLWXET6s7or9btCf4aq8DGrU9C+7fcngSfuqlrSxy9e+9InmzUFGKVLBtYIJbG1r00qwKBgQDFhHhhc4WC1MrWLSGhpaNp+swPstfzUBeX2MtZOIv6yXTYPvJ77AAZoLnW482eUZucltCAUucEtTsop25dKdhbdhbVJ/YRRnaklBL2rai4HX+fjoV29tepJhrOrq3Ey+vqvDEsqrBz2C6YyJ6d9aaPPwCFsnDRO+g7tK9S4ZfC8wKBgGlhKbXqOnCW1RSXx0waPgoBegrb816OlABj7go3qCWXOQiRvMkdilIysS+3y7EyPVTGZzpupyYbd3Nulaq10gwq9T4wB6Atnjb3ePsJZjmdKZUi3/z6yQUVoLwrq+3/CXjGYNJEHop4Ozbuz2ms/3rWuvcRSrU3UvgiAqMlzzsXAoGAJY7xDSbYZm5sO5nNYV2L22UzVHDfm4bJVbiFwmt8Qq34J/6gQWw5AKaNcA1VVhuSiY4sC5q4Dy8fFrXvyItidtHXuaSlp9dMTDNT/9A52vjRAdgqDNsXWzTBuDeDF37nV3V9rE6wyvZ6tdbAQq0phOeoA8RQq5jGqkPLauk24H0CgYEAn92Ru9UuloMmTrJbpeeLmMkwCzKff4SpYSY3WzidjdlfHpyNqBUMYb5Ym3OplrSONT9o2H5mEQipjatiu0teILBT7j+f9ZJYQ3vUurAXbmKtthHuEV4lueylNUgmkv+dm295n2x79w1mk/0emJ/Qr9tz43dpSV/kRCxc+lX+OFk=";
    //公钥(Base64编码)
    private static String publicKeyBase64 = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArOufL7/+lXaEhssa+4FTcZbBRigtkROCN0twu/H+7dvbeqEpu7XUVK/gfyNVbVdT7NkkDKhvoFKS4lWxxI/lPD4670obenATaaoZ1IwQEhITtM3giVzY986hA4+wp8w21M7mVmQ8ixGki0WlW/w0lt+A9Bg7BlqSDC7ov5Z7m1wmDDbFCQYEZlf7Ur+7wKVaJN2ig6GJGTA4X5yq28U7VpA38DSwwiJwd9NGGxnje4YRAkXrLZLcph8NCO/Md4PqXczijkqH6nR8gQnplYDgbdofqLpVVOuY3OaJNL8Ice7JNvotw8P0v4cd36ZzgE6C4aRUkwqgKxucDoYjk1+UUQIDAQAB";
    //汇付公钥
    private static String publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAral1nmqS1vswaeFp3dAfUY4a/ql07382AMH4NOwewtf9iuiZa608hDVzGYIXYAr+mxj1WwJpSCp9Sn+zSJs4+9iGodMa9qfUQ4oi32zGKR1ND7OZwpXYZudqQrUfC8/0j1DjOWBlKWyqwIh2JLXOiJLrU+dbDJxCqyHv+rO55egjD5yVLEJLkB/n1peIsfbqozKu7rpkx4bUAP1PvMmP913np2gYKsTrjGo7B/NqzkQ98mtL/VMOIbha0qN+MpEWImT/mOlgxvmr7YnTr3e7Iu/gSm8HR/5kLqmO4WmHALnoq7vDnOWpyM7c+awIxRTwoT8mwCuxPTLBUZ5UEmpIYwIDAQAB";
    //商户号
    public static String huifu_id = "6666000141279152";
    //产品号
    private static String product_id = "KAZX";
    //微信小程序appid
    private static String sub_appid = "wxb7f0ea286fc4e535";
    //控制台地址https://dashboard.huifu.com/customers/login,用户名为hh-hrt,最新密码为xw123456
    //接口文档https://paas.huifu.com/partners/api/#/
    /**
     * 微信小程序支付
     * @param req_seq_id    支付流水号
     * @param goods_desc    商品描述
     * @param trans_amt     支付金额
     * @param sub_openid    微信小程序用户openid
     * @param notify_url    异步通知回调地址
     */
    public static R<JSONObject> weixinPayment(String req_seq_id, String goods_desc, Double trans_amt, String sub_openid, String notify_url){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
        NumberFormat numberInstance = NumberFormat.getInstance();
        //最大两位小数
        numberInstance.setMaximumFractionDigits(2);
        String url = "https://api.huifu.com/v2/trade/payment/jspay";
        JSONObject data = new JSONObject();
        data.put("req_date", sdf.format(new Date()));
        data.put("req_seq_id", req_seq_id);
        data.put("huifu_id", huifu_id);
        data.put("goods_desc", goods_desc);
        data.put("trade_type", "T_MINIAPP");
        data.put("trans_amt", numberInstance.format(trans_amt));
        JSONObject wx_data = new JSONObject();
        wx_data.put("sub_appid", sub_appid);
        wx_data.put("sub_openid", sub_openid);
        data.put("wx_data", wx_data.toJSONString());
        data.put("notify_url", notify_url);
        data.put("delay_acct_flag", "Y");
        JSONObject body = new JSONObject();
        body.put("sys_id", huifu_id);
        body.put("product_id", product_id);
        body.put("sign", sign(data.toJSONString()));
        body.put("data", data);
        HttpRequest post = HttpUtil.createPost(url);
        Map<String, String> headers = new HashMap<>();
        headers.put("Content-type","application/json; charset=utf-8");
        headers.put("Accept", "application/json");
        post.addHeaders(headers);
        post.body(body.toJSONString());
        HttpResponse execute = post.execute();
        String result1 = execute.body();
        execute.close();
        if(StringUtils.hasLength(result1)){
            JSONObject result = JSONObject.parseObject(result1);
            String result_data = result.getString("data");
            String result_sign = result.getString("sign");
            boolean verify = verify(result_data, result_sign);
            if(!verify){
                return R.fail("结果验签失败");
            }
            JSONObject resultData = result.getJSONObject("data");
            String resp_code = resultData.getString("resp_code");
            String resp_desc = resultData.getString("resp_desc");
            //交易受理成功;注:交易状态以trans_stat为准;
            String success1 = "00000000";
            String success2 = "00000100";
            if(success1.equals(resp_code) || success2.equals(resp_code)){
                JSONObject pay_info = resultData.getJSONObject("pay_info");
                return R.ok(pay_info);
            }
            return R.fail(resp_desc);
        }
        return R.fail("请求异常");
    }
    /**
     * 微信支付回调数据处理
     * @param jsonObject
     * @return
     */
    public static R<WeixinPaymentNotifyVo> weixinPaymentNotify(JSONObject jsonObject){
        String sign = jsonObject.getString("sign");
        JSONObject resp_data = jsonObject.getJSONObject("resp_data");
        String resp_code = jsonObject.getString("resp_code");
        String resp_desc = jsonObject.getString("resp_desc");
        if("00000000".equals(resp_code)){
            String code = resp_data.getString("resp_code");
            String desc = resp_data.getString("resp_desc");
            if("00000000".equals(code)){
                return R.fail(desc);
            }
            WeixinPaymentNotifyVo vo = new WeixinPaymentNotifyVo();
            vo.setReqSeqId(resp_data.getString("req_seq_id"));
            vo.setReqDate(resp_data.getString("req_date"));
            vo.setTransAmt(resp_data.getString("trans_amt"));
            vo.setPayAmt(resp_data.getString("pay_amt"));
            vo.setEndTime(resp_data.getString("end_time"));
            vo.setTransStat(resp_data.getString("trans_stat"));
            return R.ok(vo);
        }
        return R.fail(resp_desc);
    }
    /**
     * 微信小程序支付退款
     * @param req_seq_id            请求流水号
     * @param ord_amt               退款金额
     * @param org_req_date          原交易请求日期yyyyMMdd
     * @param org_party_order_id    原交易微信支付宝的商户单号
     * @param notify_url            异步通知地址
     * @return
     */
    public static R<String> weixinPaymentRefund(String req_seq_id, Double ord_amt, String org_req_date, String org_party_order_id, String notify_url){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
        NumberFormat numberInstance = NumberFormat.getInstance();
        //最大两位小数
        numberInstance.setMaximumFractionDigits(2);
        String url = "https://api.huifu.com/v2/trade/payment/scanpay/refund";
        JSONObject data = new JSONObject();
        data.put("req_date", sdf.format(new Date()));
        data.put("req_seq_id", req_seq_id);
        data.put("huifu_id", huifu_id);
        data.put("ord_amt", ord_amt);
        data.put("org_req_date", org_req_date);
        data.put("org_party_order_id", org_party_order_id);
        data.put("notify_url", notify_url);
        JSONObject body = new JSONObject();
        body.put("sys_id", huifu_id);
        body.put("product_id", product_id);
        body.put("sign", sign(data.toJSONString()));
        body.put("data", data);
        HttpRequest post = HttpUtil.createPost(url);
        Map<String, String> headers = new HashMap<>();
        headers.put("Content-type","application/json; charset=utf-8");
        headers.put("Accept", "application/json");
        post.addHeaders(headers);
        post.body(body.toJSONString());
        HttpResponse execute = post.execute();
        String result1 = execute.body();
        execute.close();
        if(StringUtils.hasLength(result1)){
            JSONObject result = JSONObject.parseObject(result1);
            String result_data = result.getString("data");
            String result_sign = result.getString("sign");
            boolean verify = verify(result_data, result_sign);
            if(!verify){
                return R.fail("结果验签失败");
            }
            JSONObject resultData = result.getJSONObject("data");
            String resp_code = resultData.getString("resp_code");
            String resp_desc = resultData.getString("resp_desc");
            //交易受理成功;注:交易状态以trans_stat为准;
            String success1 = "00000000";
            if(success1.equals(resp_code)){
                String req_seq_id1 = resultData.getString("req_seq_id");
                return R.ok(req_seq_id1);
            }
            return R.fail(resp_desc);
        }
        return R.fail("请求异常");
    }
    /**
     * 微信支付退款回调通知
     * @param jsonObject
     * @return
     */
    public static R<WeixinPaymentRefundVo> weixinPaymentRefundNotify(JSONObject jsonObject){
        String sign = jsonObject.getString("sign");
        JSONObject data = jsonObject.getJSONObject("data");
        String resp_code = data.getString("resp_code");
        String resp_desc = data.getString("resp_desc");
        if("00000000".equals(resp_code)){
            WeixinPaymentRefundVo vo = new WeixinPaymentRefundVo();
            vo.setReqSeqId(data.getString("req_seq_id"));
            vo.setPartyOrderId(data.getString("party_order_id"));
            vo.setReqDate(data.getString("req_date"));
            vo.setTransDate(data.getString("trans_date"));
            vo.setTransTime(data.getString("trans_time"));
            vo.setTransStat(data.getString("trans_stat"));
            vo.setOrdAmt(data.getString("ord_amt"));
            vo.setActualRefAmt(data.getString("actual_ref_amt"));
            vo.setTotalRefAmt(data.getString("total_ref_amt"));
            vo.setRefCut(data.getString("ref_cut"));
            return R.ok(vo);
        }
        return R.fail(resp_desc);
    }
    /**
     * RSA私钥签名:签名方式SHA256WithRSA
     * @param data 待签名字符串
     * @return 签名byte[]
     * @throws Exception
     */
    public static String sign(String data) {
        //先对该json对象数据按照参数字典顺序(参数名ASCII码从小到大排序,参数名区分大小写)排序生成字符串,再进行加签和验签。
        data = JSON.toJSONString(JSONObject.parseObject(data, TreeMap.class));
        // Base64 --> Key
        try {
            byte[] bytes = Base64.getDecoder().decode(privateKeyBase64);
            PKCS8EncodedKeySpec keySpec = new PKCS8EncodedKeySpec(bytes);
            KeyFactory keyFactory;
            keyFactory = KeyFactory.getInstance("RSA");
            PrivateKey privateKey = keyFactory.generatePrivate(keySpec);
            // Sign
            Signature signature = Signature.getInstance("SHA256WithRSA");
            signature.initSign(privateKey);
            signature.update(data.getBytes("UTF-8"));
            return Base64.getEncoder().encodeToString(signature.sign());
        } catch (Exception e) {
            return null;
        }
    }
    /**
     * 使用汇付RSA公钥验签
     * @param data 待签名字符串
     * @return 验签结果
     * @throws Exception
     */
    public static boolean verify(String data, String sign) {
        //先对该json对象数据按照参数字典顺序(参数名ASCII码从小到大排序,参数名区分大小写)排序生成字符串,再进行加签和验签。
        data = JSON.toJSONString(JSONObject.parseObject(data, TreeMap.class));
        // Base64 --> Key
        try {
            byte[] bytes = Base64.getDecoder().decode(publicKeyBase64);
            X509EncodedKeySpec keySpec = new X509EncodedKeySpec(bytes);
            KeyFactory keyFactory;
            keyFactory = KeyFactory.getInstance("RSA");
            PublicKey publicKey = keyFactory.generatePublic(keySpec);
            // verify
            Signature signature = Signature.getInstance("SHA256WithRSA");
            signature.initVerify(publicKey);
            signature.update(data.getBytes("UTF-8"));
            return signature.verify(Base64.getDecoder().decode(sign));
        } catch (Exception e) {
            e.printStackTrace();
            return false;
        }
    }
    /**
     * 确认交易
     * @param req_seq_id        流水号
     * @param org_req_seq_id    原交易请求流水号
     * @param acctInfos        分账明细
     * @return
     */
    public static R<PaymentDelaytransHFTXVo> paymentDelaytrans(String req_seq_id, String org_req_seq_id, JSONArray acctInfos){
        String url = "https://api.huifu.com/v2/trade/payment/delaytrans/confirm";
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
        JSONObject data = new JSONObject();
        data.put("req_seq_id", req_seq_id);
        data.put("req_date", sdf.format(new Date()));
        data.put("huifu_id", huifu_id);
        data.put("org_req_seq_id", org_req_seq_id);
        JSONObject acct_infos = new JSONObject();
        acct_infos.put("acct_infos", acctInfos);
        data.put("acct_split_bunch", acct_infos.toJSONString());
        JSONObject body = new JSONObject();
        body.put("sys_id", huifu_id);
        body.put("product_id", product_id);
        body.put("sign", sign(data.toJSONString()));
        body.put("data", data);
        HttpRequest post = HttpUtil.createPost(url);
        Map<String, String> headers = new HashMap<>();
        headers.put("Content-type","application/json; charset=utf-8");
        headers.put("Accept", "application/json");
        post.addHeaders(headers);
        post.body(body.toJSONString());
        HttpResponse execute = post.execute();
        String result = execute.body();
        execute.close();
        if(!StringUtils.hasLength(result)){
            return R.fail("请求异常");
        }
        JSONObject resultData = JSON.parseObject(result).getJSONObject("data");
        String resp_code = resultData.getString("resp_code");
        String resp_desc = resultData.getString("resp_desc");
        //处理成功
        String success1 = "00000000";
        //交易正在处理中
        String success2 = "00000100";
        //审核中
        String success3 = "90000000";
        if(success1.equals(resp_code) || success2.equals(resp_code) || success3.equals(resp_code)){
            PaymentDelaytransHFTXVo vo = new PaymentDelaytransHFTXVo();
            vo.setTransStat(resultData.getString("trans_stat"));
            vo.setReqSeqId(resultData.getString("req_seq_id"));
            vo.setHfSeqId(resultData.getString("hf_seq_id"));
            vo.setOrgReqSeqId(resultData.getString("org_req_seq_id"));
            return R.ok(vo);
        }
        return R.fail(resp_desc);
    }
}
ruoyi-modules/ruoyi-order/src/main/resources/bootstrap.yml
@@ -14,20 +14,20 @@
    nacos:
      discovery:
        # 服务注册地址
        server-addr: 47.109.78.184:5000
        #server-addr: 127.0.0.1:8848
#        server-addr: 47.109.78.184:5000
        server-addr: 127.0.0.1:8848
        #pro
        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
#        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
        #dev
        #namespace: d39a744d-116f-4280-8445-0502dd1a3116
        namespace: 6857cbd9-6088-4fe8-bb58-2b516d99876f
      config:
        # 配置中心地址
        server-addr: 47.109.78.184:5000
        #server-addr: 127.0.0.1:8848
#        server-addr: 47.109.78.184:5000
        server-addr: 127.0.0.1:8848
        #pro
        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
#        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
        #dev
        #namespace: d39a744d-116f-4280-8445-0502dd1a3116
        namespace: 6857cbd9-6088-4fe8-bb58-2b516d99876f
        # 配置文件格式
        file-extension: yml
        # 共享配置
@@ -46,5 +46,6 @@
    apiV3Key: J8v9JDHKJYDHW9bdk30o2bdjy6z9mn1A
    privateKeyPath: /home/cert/apiclient_key.pem
    privateCertPath: /home/cert/apiclient_cert.pem
    callbackPath: http://221.182.45.100:1500
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/business/MerShopController.java
@@ -3,14 +3,12 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.shop.domain.dto.MerAgencyPageDto;
import com.ruoyi.shop.domain.dto.MerShopCertificateEditDto;
import com.ruoyi.shop.domain.dto.MerShopCertificateListDto;
import com.ruoyi.shop.domain.dto.MerShopSuggestDto;
import com.ruoyi.shop.domain.dto.*;
import com.ruoyi.shop.domain.pojo.shop.ShopRelUser;
import com.ruoyi.shop.domain.vo.MerAgencyPageVo;
import com.ruoyi.shop.domain.vo.MerShopCertificateListVo;
import com.ruoyi.shop.domain.vo.MerShopSuggestVo;
import com.ruoyi.shop.domain.vo.MerchantBasicdataSettlementVo;
import com.ruoyi.shop.service.shop.*;
import com.ruoyi.system.api.domain.dto.*;
import com.ruoyi.system.api.domain.poji.shop.Shop;
@@ -19,6 +17,7 @@
import com.ruoyi.system.api.domain.vo.MgtSimpleShopVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -162,4 +161,12 @@
        List<MgtSimpleShopVo> mgtShopListSimpleVos = shopService.listShopByShop(merBaseDto.getShopId());
        return R.ok(mgtShopListSimpleVos);
    }
    @RequestMapping(value = "/getShopMerchantBasicDataSettlement", method = RequestMethod.POST)
    @ApiOperation(value = "获取提现记录(汇付天下)")
    public R<List<MerchantBasicdataSettlementVo>> getMerchantBasicDataSettlement(@Validated @RequestBody MerchantBasicdataSettlementDto mgtShopShareRatioSetDto){
        return shopService.getMerchantBasicDataSettlement(mgtShopShareRatioSetDto);
    }
}
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/console/ShopController.java
@@ -1,15 +1,14 @@
package com.ruoyi.shop.controller.console;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.ruoyi.common.core.constant.CacheConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.exception.ServiceException;
import com.ruoyi.common.core.utils.bean.BeanUtils;
import com.ruoyi.common.redis.service.RedisService;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.shop.domain.pojo.shop.ShopAuthentication;
import com.ruoyi.shop.domain.pojo.shop.ShopProportion;
import com.ruoyi.shop.domain.pojo.shop.ShopRelUser;
import com.ruoyi.shop.domain.pojo.shop.ShopStaff;
import com.ruoyi.shop.domain.pojo.shop.*;
import com.ruoyi.shop.service.shop.*;
import com.ruoyi.shop.service.task.MemberTaskService;
import com.ruoyi.shop.service.task.ShopTaskService;
@@ -22,6 +21,7 @@
import com.ruoyi.system.api.model.QwH5LoginVo;
import com.ruoyi.system.api.model.QwUserDetailDto;
import com.ruoyi.system.api.service.RemoteUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@@ -74,6 +74,12 @@
    @Resource
    private RedisService redisService;
    @Autowired
    private ShopAuthenticationHftxService shopAuthenticationHftxService;
    /**
     * 企业微信H5登录
     * @param qwUserDetail
@@ -122,6 +128,17 @@
    }
    @PostMapping("/getShopHFTXSubMchId")
    public R<ShopAuthenticationHftxVo> getShopHFTXSubMchId(@RequestBody Long shopId){
        ShopAuthenticationHftx shopAuthenticationHftx = shopAuthenticationHftxService.getOne(new QueryWrapper<ShopAuthenticationHftx>()
                .eq("isDelete", 0).eq("shop_id", shopId));
        ShopAuthenticationHftxVo vo = new ShopAuthenticationHftxVo();
        BeanUtils.copyProperties(shopAuthenticationHftx, vo);
        return R.ok(vo, "");
    }
    /**
     * 获取商户分成
     * @param shopId
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/management/MgtShopController.java
@@ -1,5 +1,6 @@
package com.ruoyi.shop.controller.management;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
@@ -7,6 +8,7 @@
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.shop.domain.dto.*;
import com.ruoyi.shop.domain.pojo.shop.BankBranchCode;
import com.ruoyi.shop.domain.vo.*;
import com.ruoyi.shop.service.shop.*;
import com.ruoyi.system.api.domain.dto.MgtBaseGetDto;
@@ -21,7 +23,10 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;
import java.util.Map;
/**
 * @author jqs34
@@ -49,6 +54,12 @@
    @Resource
    private ShopCertificateService shopCertificateService;
    @Resource
    private BankBranchCodeService bankBranchCodeService;
    @RequestMapping(value = "/listMgtShopSimpleVo", method = RequestMethod.POST)
    @ApiOperation(value = "获取简易商户列表")
@@ -282,18 +293,6 @@
    }
    @RequestMapping(value = "/mgtShopHFTXAuth", method = RequestMethod.POST)
    @Log(title = "商户进件管理", businessType = BusinessType.UPDATE,operContent = "商户进件")
    @ApiOperation(value = "平台商户进件")
    public R mgtShopHFTXAuth(@Validated @RequestBody MgtShopHFTXAuthDto mgtShopAuthDto) {
        Long userId = SecurityUtils.getUserId();
        mgtShopAuthDto.setUserId(userId);
        shopService.mgtShopHFTXAuth(mgtShopAuthDto);
        return R.ok();
    }
    @RequestMapping(value = "/getMgtShopAuth", method = RequestMethod.POST)
    @ApiOperation(value = "获取商户进件信息")
    public R<MgtShopAuthGetVo> getMgtShopAuth(@RequestBody MgtShopAuthGetDto mgtShopAuthGetDto) {
@@ -319,6 +318,82 @@
    }
    @RequestMapping(value = "/pageMgtShopHFTXAuth", method = RequestMethod.POST)
    @ApiOperation(value = "分页获取商户进件列表(汇付天下)")
    public R<Page<MgtShopHFTXAuthPageVo>> pageMgtShopHFTXAuth(@RequestBody MgtShopHFTXAuthPageDto mgtShopAuthPageDto) {
        Page<MgtShopHFTXAuthPageVo> page = new Page<>();
        page.setSize(mgtShopAuthPageDto.getPageSize());
        page.setCurrent(mgtShopAuthPageDto.getPageNum());
        List<MgtShopHFTXAuthPageVo> mgtShopHFTXAuthPageVos = shopService.pageMgtShopHFTXAuth(page, mgtShopAuthPageDto);
        return R.ok(page.setRecords(mgtShopHFTXAuthPageVos));
    }
    @RequestMapping(value = "/mgtShopHFTXAuth", method = RequestMethod.POST)
    @Log(title = "商户进件管理", businessType = BusinessType.UPDATE,operContent = "商户进件")
    @ApiOperation(value = "平台商户进件(汇付天下)")
    public R mgtShopHFTXAuth(@Validated @RequestBody MgtShopHFTXAuthDto mgtShopHFTXAuthDto) {
        Long userId = SecurityUtils.getUserId();
        mgtShopHFTXAuthDto.setUserId(userId);
        shopService.mgtShopHFTXAuth(mgtShopHFTXAuthDto);
        return R.ok();
    }
    @RequestMapping(value = "/merchantBasicdataNotify", method = RequestMethod.POST)
    @Log(title = "商户进件回调通知(汇付天下)", businessType = BusinessType.UPDATE,operContent = "商户进件")
    public void merchantBasicdataNotify(@Validated @RequestBody JSONObject jsonObject, HttpServletResponse response){
        R<String> r = shopService.merchantBasicdataNotify(jsonObject);
        if(r.getCode() == 200){
            response.setStatus(200);
            PrintWriter out = null;
            try {
                out = response.getWriter();
                out.print("RECV_ORD_ID_" + r.getData());
                out.flush();
            } catch (IOException e) {
                e.printStackTrace();
            }finally {
                out.close();
            }
        }
    }
    @RequestMapping(value = "/getMgtShopHFTXAuthInfo", method = RequestMethod.POST)
    @ApiOperation(value = "获取商户进件信息(汇付天下)")
    public R<MgtShopHFTXAuthGetVo> getMgtShopHFTXAuthInfo(@Validated @RequestBody MgtShopHFTXAuthGetDto mgtShopHFTXAuthGetDto){
        MgtShopHFTXAuthGetVo mgtShopHFTXAuthInfo = shopService.getMgtShopHFTXAuthInfo(mgtShopHFTXAuthGetDto.getShopId());
        return R.ok(mgtShopHFTXAuthInfo);
    }
    @RequestMapping(value = "/setMgtShopShareRatio", method = RequestMethod.POST)
    @ApiOperation(value = "设置分账比例(汇付天下)")
    public R setMgtShopShareRatio(@Validated @RequestBody MgtShopShareRatioSetDto mgtShopShareRatioSetDto){
        return shopService.setMgtShopShareRatio(mgtShopShareRatioSetDto);
    }
    @RequestMapping(value = "/getMerchantBasicDataSettlement", method = RequestMethod.POST)
    @ApiOperation(value = "获取提现记录(汇付天下)")
    public R<List<MerchantBasicdataSettlementVo>> getMerchantBasicDataSettlement(@Validated @RequestBody MerchantBasicdataSettlementDto mgtShopShareRatioSetDto){
        return shopService.getMerchantBasicDataSettlement(mgtShopShareRatioSetDto);
    }
    @RequestMapping(value = "/getBankList", method = RequestMethod.POST)
    @ApiOperation(value = "获取银行列表(汇付天下)")
    public R<List<Map<String, String>>> getBankList(@Validated @RequestBody BankListGetDto dto){
        List<Map<String, String>> bankList = bankBranchCodeService.getBankList(dto.getName());
        return R.ok(bankList);
    }
    @RequestMapping(value = "/getBankBranchCode", method = RequestMethod.POST)
    @ApiOperation(value = "获取银行分行列表(汇付天下)")
    public R<List<Map<String, String>>> getBankBranchCode(@Validated @RequestBody BankBranchCodeGetDto dto){
        List<Map<String, String>> bankBranchCode = bankBranchCodeService.getBankBranchCode(dto.getBankNumber());
        return R.ok(bankBranchCode);
    }
}
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/dto/BankBranchCodeGetDto.java
New file
@@ -0,0 +1,14 @@
package com.ruoyi.shop.domain.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @author zhibing.pu
 * @Date 2023/10/17 16:06
 */
@Data
public class BankBranchCodeGetDto {
    @ApiModelProperty("银行号")
    private String bankNumber;
}
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/dto/BankListGetDto.java
New file
@@ -0,0 +1,14 @@
package com.ruoyi.shop.domain.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @author zhibing.pu
 * @Date 2023/10/17 17:25
 */
@Data
public class BankListGetDto {
    @ApiModelProperty("名称")
    private String name;
}
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/dto/MerchantBasicdataSettlementDto.java
New file
@@ -0,0 +1,22 @@
package com.ruoyi.shop.domain.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @author zhibing.pu
 * @Date 2023/10/16 17:54
 */
@Data
public class MerchantBasicdataSettlementDto {
    @ApiModelProperty(value = "商户id")
    private Long shopId;
    @ApiModelProperty("开始时间yyyyMMdd")
    private String startTime;
    @ApiModelProperty("结束时间开始时间yyyyMMdd")
    private String endTime;
    @ApiModelProperty("页码,首页1")
    private Integer pageNum;
    @ApiModelProperty("页查询条数")
    private Integer pageSize;
}
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/dto/MgtShopHFTXAuthDto.java
@@ -15,127 +15,129 @@
 */
@Data
public class MgtShopHFTXAuthDto extends MgtBaseDto {
    @ApiModelProperty(value = "商户id", dataType = "long", required = true)
    private Long shopId;
    @ApiModelProperty(value = "进件类型(1=用户,2=企业)", dataType = "int", required = true)
    private Integer type;
    @ApiModelProperty(value = "商户名称", dataType = "string", required = true)
    private String reg_name;
    private String regName;
    @ApiModelProperty(value = "商户简称", dataType = "string", required = true)
    private String short_name;
    private String shortName;
    @ApiModelProperty(value = "公司类型(1:政府机构,2:国营企业,3:私营企业,4:外资企业,5:个体工商户,7:事业单位)", dataType = "string", required = true)
    private String ent_type;
    private String entType;
    @ApiModelProperty(value = "营业执照编号", dataType = "string", required = true)
    private String license_code;
    private String licenseCode;
    @ApiModelProperty(value = "营业执照有效期类型(0:非长期有效 ,1:长期有效)", dataType = "string", required = true)
    private String license_validity_type;
    private String licenseValidityType;
    @ApiModelProperty(value = "营业执照有效期开始日期(日期格式:yyyyMMdd)", dataType = "string", required = true)
    private String license_begin_date;
    private String licenseBeginDate;
    @ApiModelProperty(value = "营业执照有效期截止日期(日期格式:yyyyMMdd,当license_validity_type=0时必填 ;当license_validity_type=1时为空)", dataType = "string", required = true)
    private String license_end_date;
    private String licenseEndDate;
    @ApiModelProperty(value = "注册省(示例值:310000)", dataType = "string", required = true)
    private String reg_prov_id;
    @ApiModelProperty(value = "注册省(注册市:310000)", dataType = "string", required = true)
    private String reg_area_id;
    private String regProvId;
    @ApiModelProperty(value = "注册市(示例值:310000)", dataType = "string", required = true)
    private String regAreaId;
    @ApiModelProperty(value = "注册区(示例值:310000)", dataType = "string", required = true)
    private String reg_district_id;
    private String regDistrictId;
    @ApiModelProperty(value = "注册详细地址", dataType = "string", required = true)
    private String reg_detail;
    private String regDetail;
    @ApiModelProperty(value = "法人姓名", dataType = "string", required = true)
    private String legal_name;
    private String legalName;
    @ApiModelProperty(value = "法人证件类型", dataType = "string", required = true)
    private String legal_cert_type;
    private String legalCertType;
    @ApiModelProperty(value = "法人证件号码", dataType = "string", required = true)
    private String legal_cert_no;
    private String legalCertNo;
    @ApiModelProperty(value = "法人证件有效期类型(1:长期有效;0:非长期有效 )", dataType = "string", required = true)
    private String legal_cert_validity_type;
    private String legalCertValidityType;
    @ApiModelProperty(value = "法人证件有效期开始日期(日期格式:yyyyMMdd,以北京时间为准)", dataType = "string", required = true)
    private String legal_cert_begin_date;
    private String legalCertBeginDate;
    @ApiModelProperty(value = "法人证件有效期截止日期(日期格式:yyyyMMdd,当legal_cert_validity_type=0时必填 ;当legal_cert_validity_type=1时为空 )", dataType = "string", required = true)
    private String legal_cert_end_date;
    private String legalCertEndDate;
    @ApiModelProperty(value = "经营省", dataType = "string", required = true)
    private String prov_id;
    private String provId;
    @ApiModelProperty(value = "经营市", dataType = "string", required = true)
    private String area_id;
    private String areaId;
    @ApiModelProperty(value = "经营区", dataType = "string", required = true)
    private String district_id;
    private String districtId;
    @ApiModelProperty(value = "经营详细地址", dataType = "string", required = true)
    private String detail_addr;
    private String detailAddr;
    @ApiModelProperty(value = "联系人姓名", dataType = "string", required = true)
    private String contact_name;
    private String contactName;
    @ApiModelProperty(value = "联系人手机号", dataType = "string", required = true)
    private String contact_mobile_no;
    private String contactMobileNo;
    @ApiModelProperty(value = "联系人电子邮箱", dataType = "string", required = true)
    private String contact_email;
    private String contactEmail;
    @ApiModelProperty(value = "客服电话", dataType = "string", required = true)
    private String service_phone;
    private String servicePhone;
    @ApiModelProperty(value = "小票名称", dataType = "string", required = true)
    private String receipt_name;
    private String receiptName;
    @ApiModelProperty(value = "结算账户类型(结算账户类型,个人商户/用户不支持填写对公账户和对私非法人账户\n" +
            "0:对公账户 1:对私法人账户 2:对私非法人账户)", dataType = "string", required = true)
    private String card_type;
    private String cardType;
    @ApiModelProperty(value = "结算账户名(当card_type=0时填写企业名称\n" +
            "当card_type=1时填写法人姓名,对私法人结算银行户名与法人姓名必需一致;\n" +
            "当card_type=2时填写非法人姓名)", dataType = "string", required = true)
    private String card_name;
    private String cardName;
    @ApiModelProperty(value = "结算账号", dataType = "string", required = true)
    private String card_no;
    private String cardNo;
    @ApiModelProperty(value = "银行所在省", dataType = "string", required = true)
    private String js_prov_id;
    private String jsProvId;
    @ApiModelProperty(value = "银行所在市", dataType = "string", required = true)
    private String js_area_id;
    private String jsAreaId;
    @ApiModelProperty(value = "联行号", dataType = "string", required = true)
    private String branch_code;
    private String branchCode;
    @ApiModelProperty(value = "持卡人证件类型(当card_type=0时为空, 当card_type=1或2时必填)", dataType = "string", required = true)
    private String cert_type;
    private String certType;
    @ApiModelProperty(value = "持卡人证件号码(对私结算必填;年龄不小于18岁且不能大于80岁;如持卡人证件类型为00:身份证,则填写身份证号码 )", dataType = "string", required = true)
    private String cert_no;
    private String certNo;
    @ApiModelProperty(value = "持卡人证件类型(1:长期有效 0:非长期有效)", dataType = "string", required = true)
    private String cert_validity_type;
    private String certValidityType;
    @ApiModelProperty(value = "持卡人证件有效期开始(日期格式:yyyyMMdd,当cert_validity_type=0时必填;当cert_validity_type=1时为空)", dataType = "string", required = true)
    private String cert_begin_date;
    private String certBeginDate;
    @ApiModelProperty(value = "持卡人证件有效期截止日期(日期格式:yyyyMMdd,当cert_validity_type=0时必填;当cert_validity_type=1时为空)", dataType = "string", required = true)
    private String cert_end_date;
    private String certEndDate;
    @ApiModelProperty(value = "银行卡绑定手机号(对私非法人结算必填,开通全域资金管理功能必填)", dataType = "string", required = true)
    private String mp;
    @ApiModelProperty(value = "商户ICP备案编号", dataType = "string", required = true)
    private String mer_icp;
    private String merIcp;
    @ApiModelProperty(value = "基本存款账户编号或核准号", dataType = "string", required = true)
    private String open_licence_no;
    private String openLicenceNo;
    @ApiModelProperty(value = "开户许可证", dataType = "string", required = true)
    private String reg_acct_pic;
    private String regAcctPic;
    @ApiModelProperty(value = "结算卡正面", dataType = "string", required = true)
    private String settle_card_front_pic;
    private String settleCardFrontPic;
    @ApiModelProperty(value = "结算人身份证国徽面", dataType = "string", required = true)
    private String settle_cert_back_pic;
    private String settleCertBackPic;
    @ApiModelProperty(value = "结算人身份证人像面", dataType = "string", required = true)
    private String settle_cert_front_pic;
    private String settleCertFrontPic;
    @ApiModelProperty(value = "税务登记证", dataType = "string", required = true)
    private String tax_reg_pic;
    private String taxRegPic;
    @ApiModelProperty(value = "法人身份证国徽面", dataType = "string", required = true)
    private String legal_cert_back_pic;
    private String legalCertBackPic;
    @ApiModelProperty(value = "法人身份证人像面", dataType = "string", required = true)
    private String legal_cert_front_pic;
    private String legalCertFrontPic;
    @ApiModelProperty(value = "营业执照图片", dataType = "string", required = true)
    private String license_pic;
    private String licensePic;
    @ApiModelProperty(value = "授权委托书", dataType = "string", required = true)
    private String auth_enturst_pic;
    private String authEnturstPic;
    @ApiModelProperty(value = "注册资本", dataType = "string", required = true)
    private String reg_capital;
    private String regCapital;
    @ApiModelProperty(value = "经营范围", dataType = "string", required = true)
    private String business_scope;
    private String businessScope;
    @ApiModelProperty(value = "成立时间,示例值:20091212", dataType = "string", required = true)
    private String found_date;
    private String foundDate;
    @ApiModelProperty(value = "线下经营-门头照", dataType = "string", required = true)
    private String store_header_pic;
    private String storeHeaderPic;
    @ApiModelProperty(value = "线下经营-内景照", dataType = "string", required = true)
    private String store_indoor_pic;
    private String storeIndoorPic;
    @ApiModelProperty(value = "线下经营-收银台", dataType = "string", required = true)
    private String store_cashier_desk_pic;
    private String storeCashierDeskPic;
    @ApiModelProperty(value = "线上经营-公司前台", dataType = "string", required = true)
    private String online_company_pic;
    private String onlineCompanyPic;
    @ApiModelProperty(value = "线上经营-工作区域", dataType = "string", required = true)
    private String online_company_area_pic;
    private String onlineCompanyAreaPic;
    @ApiModelProperty(value = "法人手机号", dataType = "string", required = true)
    private String legal_mobile_no;
    private String legalMobileNo;
    @ApiModelProperty(value = "法人身份证地址", dataType = "string", required = true)
    private String legal_addr;
    private String legalAddr;
}
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/dto/MgtShopHFTXAuthGetDto.java
New file
@@ -0,0 +1,20 @@
package com.ruoyi.shop.domain.dto;
import com.ruoyi.system.api.domain.dto.MgtBaseDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @ClassName MgtShopAuthGetDto
 * @Description TODO
 * @Author jqs
 * @Date 2023/6/25 10:42
 * @Version 1.0
 */
@Data
public class MgtShopHFTXAuthGetDto extends MgtBaseDto {
    @ApiModelProperty(value = "商户id")
    private Long shopId;
}
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/dto/MgtShopHFTXAuthPageDto.java
New file
@@ -0,0 +1,34 @@
package com.ruoyi.shop.domain.dto;
import com.ruoyi.system.api.domain.dto.MgtPageDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @author jqs34
 * @version 1.0
 * @classname MgtShopAuthPageDto
 * @description: TODO
 * @date 2023 2023/6/14 22:18
 */
@Data
public class MgtShopHFTXAuthPageDto extends MgtPageDto {
    @ApiModelProperty(value = "商户名称")
    private String shopName;
    @ApiModelProperty(value="店主姓名")
    private String shopownerName;
    @ApiModelProperty(value="店主联系方式")
    private String shopownerPhone;
    @ApiModelProperty(value="认证类型 1个人 2企业")
    private Integer mainType;
    @ApiModelProperty(value="审核状态 U:审核中,Y:审核通过,N:审核拒绝,F:失败")
    private Integer auditStatus;
    @ApiModelProperty(value="商户状态")
    private Integer shopStatus;
}
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/dto/MgtShopShareRatioSetDto.java
New file
@@ -0,0 +1,16 @@
package com.ruoyi.shop.domain.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @author zhibing.pu
 * @Date 2023/10/16 16:26
 */
@Data
public class MgtShopShareRatioSetDto {
    @ApiModelProperty(value = "商户id")
    private Long shopId;
    @ApiModelProperty(value = "分账比例")
    private Double shareRatio;
}
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/pojo/shop/BankBranchCode.java
New file
@@ -0,0 +1,41 @@
package com.ruoyi.shop.domain.pojo.shop;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
/**
 * @author zhibing.pu
 * @Date 2023/10/17 15:58
 */
@Data
@TableName("t_bank_branch_code")
public class BankBranchCode {
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 联行号
     */
    @TableField("correspondent_number")
    private String correspondentNumber;
    /**
     * 联行号名称
     */
    @TableField("correspondent_number_name")
    private String correspondentNumberName;
    /**
     * 银行号
     */
    @TableField("bank_number")
    private String bankNumber;
    /**
     * 银行名称
     */
    @TableField("bank_name")
    private String bankName;
}
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/pojo/shop/ShopAuthenticationHftx.java
New file
@@ -0,0 +1,457 @@
package com.ruoyi.shop.domain.pojo.shop;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.io.Serializable;
import java.util.Date;
/**
 * 商户进件(汇付天下)
 * @author zhibing.pu
 * @Date 2023/10/16 10:21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_shop_authentication_hftx")
public class ShopAuthenticationHftx extends Model<ShopAuthenticationHftx> {
    private static final long serialVersionUID = 1L;
    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 添加时间
     */
    @TableField("insert_time")
    private Date insertTime;
    /**
     * 删除状态(0=否,1=是)
     */
    @TableField("is_delete")
    private Integer isDelete;
    /**
     * 业务流水号
     */
    @TableField("req_seq_id")
    private String reqSeqId;
    /**
     * 进件流水号
     */
    @TableField("apply_no")
    private String applyNo;
    /**
     * 商户号
     */
    @TableField("huifu_id")
    private String huifuId;
    /**
     * 取现卡序列号
     */
    @TableField("token_no")
    private String tokenNo;
    /**
     * 审核结果;Y:审核通过,N:审核拒绝,F:失败
     */
    @TableField("audit_status")
    private String auditStatus;
    /**
     * 审核描述
     */
    @TableField("audit_desc")
    private String auditDesc;
    /**
     * 商户id
     */
    @TableField("shop_id")
    private Long shopId;
    /**
     * 分账比例
     */
    @TableField("share_ratio")
    private Double shareRatio;
    /**
     * 进件类型(1=用户,2=企业)
     */
    @TableField(value = "type")
    private Integer type;
    /**
     * 商户名称
     */
    @TableField(value = "reg_name")
    private String regName;
    /**
     * 商户简称
     */
    @TableField(value = "short_name")
    private String shortName;
    /**
     * 公司类型(1:政府机构,2:国营企业,3:私营企业,4:外资企业,5:个体工商户,7:事业单位)
     */
    @TableField(value = "ent_type")
    private String entType;
    /**
     * 营业执照编号
     */
    @TableField(value = "license_code")
    private String licenseCode;
    /**
     * 营业执照有效期类型(0:非长期有效 ,1:长期有效)
     */
    @TableField(value = "license_validity_type")
    private String licenseValidityType;
    /**
     * 营业执照有效期开始日期(日期格式:yyyyMMdd)
     */
    @TableField(value = "license_begin_date")
    private String licenseBeginDate;
    /**
     * 营业执照有效期截止日期(日期格式:yyyyMMdd,当license_validity_type=0时必填 ;当license_validity_type=1时为空)
     */
    @TableField(value = "license_end_date")
    private String licenseEndDate;
    /**
     * 注册省(示例值:310000)
     */
    @TableField(value = "reg_prov_id")
    private String regProvId;
    /**
     * 注册市(示例值:310000)
     */
    @TableField(value = "reg_area_id")
    private String regAreaId;
    /**
     * 注册区(示例值:310000)
     */
    @TableField(value = "reg_district_id")
    private String regDistrictId;
    /**
     * 注册详细地址
     */
    @TableField(value = "reg_detail")
    private String regDetail;
    /**
     * 法人姓名
     */
    @TableField(value = "legal_name")
    private String legalName;
    /**
     * 法人证件类型
     */
    @TableField(value = "legal_cert_type")
    private String legalCertType;
    /**
     * 法人证件号码
     */
    @TableField(value = "legal_cert_no")
    private String legalCertNo;
    /**
     * 法人证件有效期类型(1:长期有效;0:非长期有效 )
     */
    @TableField(value = "legal_cert_validity_type")
    private String legalCertValidityType;
    /**
     * 法人证件有效期开始日期(日期格式:yyyyMMdd,以北京时间为准)
     */
    @TableField(value = "legal_cert_begin_date")
    private String legalCertBeginDate;
    /**
     * 法人证件有效期截止日期(日期格式:yyyyMMdd,当legal_cert_validity_type=0时必填 ;当legal_cert_validity_type=1时为空 )
     */
    @TableField(value = "legal_cert_end_date")
    private String legalCertEndDate;
    /**
     * 经营省
     */
    @TableField(value = "prov_id")
    private String provId;
    /**
     * 经营市
     */
    @TableField(value = "area_id")
    private String areaId;
    /**
     * 经营区
     */
    @TableField(value = "district_id")
    private String districtId;
    /**
     * 经营详细地址
     */
    @TableField(value = "detail_addr")
    private String detailAddr;
    /**
     * 联系人姓名
     */
    @TableField(value = "contact_name")
    private String contactName;
    /**
     * 联系人手机号
     */
    @TableField(value = "contact_mobile_no")
    private String contactMobileNo;
    /**
     * 联系人电子邮箱
     */
    @TableField(value = "contact_email")
    private String contactEmail;
    /**
     * 客服电话
     */
    @TableField(value = "service_phone")
    private String servicePhone;
    /**
     * 小票名称
     */
    @TableField(value = "receipt_name")
    private String receiptName;
    /**
     * 结算账户类型(结算账户类型,个人商户/用户不支持填写对公账户和对私非法人账户0:对公账户 1:对私法人账户 2:对私非法人账户)
     */
    @TableField(value = "card_type")
    private String cardType;
    /**
     * 结算账户名(当card_type=0时填写企业名称当card_type=1时填写法人姓名,对私法人结算银行户名与法人姓名必需一致;当card_type=2时填写非法人姓名)
     */
    @TableField(value = "card_name")
    private String cardName;
    /**
     * 结算账号
     */
    @TableField(value = "card_no")
    private String cardNo;
    /**
     * 银行所在省
     */
    @TableField(value = "js_prov_id")
    private String jsProvId;
    /**
     * 银行所在市
     */
    @TableField(value = "js_area_id")
    private String jsAreaId;
    /**
     * 联行号
     */
    @TableField(value = "branch_code")
    private String branchCode;
    /**
     * 持卡人证件类型(当card_type=0时为空, 当card_type=1或2时必填)
     */
    @TableField(value = "cert_type")
    private String certType;
    /**
     * 持卡人证件号码(对私结算必填;年龄不小于18岁且不能大于80岁;如持卡人证件类型为00:身份证,则填写身份证号码 )
     */
    @TableField(value = "cert_no")
    private String certNo;
    /**
     * 持卡人证件类型(1:长期有效 0:非长期有效)
     */
    @TableField(value = "cert_validity_type")
    private String certValidityType;
    /**
     * 持卡人证件有效期开始(日期格式:yyyyMMdd,当cert_validity_type=0时必填;当cert_validity_type=1时为空)
     */
    @TableField(value = "cert_begin_date")
    private String certBeginDate;
    /**
     * 持卡人证件有效期截止日期(日期格式:yyyyMMdd,当cert_validity_type=0时必填;当cert_validity_type=1时为空)
     */
    @TableField(value = "cert_end_date")
    private String certEndDate;
    /**
     * 银行卡绑定手机号(对私非法人结算必填,开通全域资金管理功能必填)
     */
    @TableField(value = "mp")
    private String mp;
    /**
     * 商户ICP备案编号
     */
    @TableField(value = "mer_icp")
    private String merIcp;
    /**
     * 基本存款账户编号或核准号
     */
    @TableField(value = "open_licence_no")
    private String openLicenceNo;
    /**
     * 开户许可证
     */
    @TableField(value = "reg_acct_pic")
    private String regAcctPic;
    /**
     * 开户许可证文件编号
     */
    @TableField(value = "reg_acct_pic_no")
    private String regAcctPicNo;
    /**
     * 结算卡正面
     */
    @TableField(value = "settle_card_front_pic")
    private String settleCardFrontPic;
    /**
     * 结算卡正面文件编号
     */
    @TableField(value = "settle_card_front_pic_no")
    private String settleCardFrontPicNo;
    /**
     * 结算人身份证国徽面
     */
    @TableField(value = "settle_cert_back_pic")
    private String settleCertBackPic;
    /**
     * 结算人身份证国徽面文件编号
     */
    @TableField(value = "settle_cert_back_pic_no")
    private String settleCertBackPicNo;
    /**
     * 结算人身份证人像面
     */
    @TableField(value = "settle_cert_front_pic")
    private String settleCertFrontPic;
    /**
     * 结算人身份证人像面文件编号
     */
    @TableField(value = "settle_cert_front_pic_no")
    private String settleCertFrontPicNo;
    /**
     * 税务登记证
     */
    @TableField(value = "tax_reg_pic")
    private String taxRegPic;
    /**
     * 税务登记证文件编号
     */
    @TableField(value = "tax_reg_pic_no")
    private String taxRegPicNo;
    /**
     * 法人身份证国徽面
     */
    @TableField(value = "legal_cert_back_pic")
    private String legalCertBackPic;
    /**
     * 法人身份证国徽面文件编号
     */
    @TableField(value = "legal_cert_back_pic_no")
    private String legalCertBackPicNo;
    /**
     * 法人身份证人像面
     */
    @TableField(value = "legal_cert_front_pic")
    private String legalCertFrontPic;
    /**
     * 法人身份证人像面文件编号
     */
    @TableField(value = "legal_cert_front_pic_no")
    private String legalCertFrontPicNo;
    /**
     * 营业执照图片
     */
    @TableField(value = "license_pic")
    private String licensePic;
    /**
     * 营业执照图片文件编号
     */
    @TableField(value = "license_pic_no")
    private String licensePicNo;
    /**
     * 授权委托书
     */
    @TableField(value = "auth_enturst_pic")
    private String authEnturstPic;
    /**
     * 授权委托书文件编号
     */
    @TableField(value = "auth_enturst_pic_no")
    private String authEnturstPicNo;
    /**
     * 注册资本
     */
    @TableField(value = "reg_capital")
    private String regCapital;
    /**
     * 经营范围
     */
    @TableField(value = "business_scope")
    private String businessScope;
    /**
     * 成立时间,示例值:20091212
     */
    @TableField(value = "found_date")
    private String foundDate;
    /**
     * 线下经营-门头照
     */
    @TableField(value = "store_header_pic")
    private String storeHeaderPic;
    /**
     * 线下经营-门头照文件编号
     */
    @TableField(value = "store_header_pic_no")
    private String storeHeaderPicNo;
    /**
     * 线下经营-内景照
     */
    @TableField(value = "store_indoor_pic")
    private String storeIndoorPic;
    /**
     * 线下经营-内景照文件编号
     */
    @TableField(value = "store_indoor_pic_no")
    private String storeIndoorPicNo;
    /**
     * 线下经营-收银台
     */
    @TableField(value = "store_cashier_desk_pic")
    private String storeCashierDeskPic;
    /**
     * 线下经营-收银台文件编号
     */
    @TableField(value = "store_cashier_desk_pic_no")
    private String storeCashierDeskPicNo;
    /**
     * 线上经营-公司前台
     */
    @TableField(value = "online_company_pic")
    private String onlineCompanyPic;
    /**
     * 线上经营-公司前台文件编号
     */
    @TableField(value = "online_company_pic_no")
    private String onlineCompanyPicNo;
    /**
     * 线上经营-工作区域
     */
    @TableField(value = "online_company_area_pic")
    private String onlineCompanyAreaPic;
    /**
     * 线上经营-工作区域文件编号
     */
    @TableField(value = "online_company_area_pic_no")
    private String onlineCompanyAreaPicNo;
    /**
     * 法人手机号
     */
    @TableField(value = "legal_mobile_no")
    private String legalMobileNo;
    /**
     * 法人身份证地址
     */
    @TableField(value = "legal_addr")
    private String legalAddr;
    @Override
    protected Serializable pkVal() {
        return this.id;
    }
}
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/vo/MerchantBasicDataNotifyVo.java
New file
@@ -0,0 +1,27 @@
package com.ruoyi.shop.domain.vo;
import lombok.Data;
/**
 * @author zhibing.pu
 * @Date 2023/10/19 11:16
 */
@Data
public class MerchantBasicDataNotifyVo {
    /**
     * 网关返回码
     */
    private String resp_code;
    /**
     * 网关返回描述
     */
    private String resp_desc;
    /**
     * 签名
     */
    private String sign;
    /**
     * 交易响应内容体
     */
    private String data;
}
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/vo/MerchantBasicdataSettlementVo.java
New file
@@ -0,0 +1,24 @@
package com.ruoyi.shop.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @author zhibing.pu
 * @Date 2023/10/16 17:31
 */
@Data
public class MerchantBasicdataSettlementVo {
    @ApiModelProperty("流水号")
    private String transId;
    @ApiModelProperty("结算日期")
    private String transDate;
    @ApiModelProperty("银行卡号")
    private String cardNo;
    @ApiModelProperty("交易金额")
    private String transAmt;
    @ApiModelProperty("手续费")
    private String feeAmt;
    @ApiModelProperty("结算状态(I:处理中 F:结算失败 S:结算成功,为空则未返回结算状态)")
    private String transStat;
}
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/vo/MerchantBasicdataVo.java
@@ -13,23 +13,27 @@
     */
    private Integer status;
    /**
     * 请求流水号
     */
    private String reqSeqId;
    /**
     * 审核结果;Y:审核通过,N:审核拒绝,F:失败
     */
    private String audit_status;
    private String auditStatus;
    /**
     * 审核描述,审核人员编辑的审核描述
     */
    private String audit_desc;
    private String auditDesc;
    /**
     * 商户号
     */
    private String huifu_id;
    private String huifuId;
    /**
     * 取现卡序列号
     */
    private String token_no;
    private String tokenNo;
    /**
     * 申请单号
     */
    private String apply_no;
    private String applyNo;
}
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/vo/MgtShopHFTXAuthGetVo.java
New file
@@ -0,0 +1,140 @@
package com.ruoyi.shop.domain.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @ClassName MgtShopAuthDto
 * @Description TODO
 * @Author jqs
 * @Date 2023/6/19 10:21
 * @Version 1.0
 */
@Data
public class MgtShopHFTXAuthGetVo {
    @ApiModelProperty(value = "企业id", dataType = "long", required = true)
    private Integer shopId;
    @ApiModelProperty(value = "进件类型(1=用户,2=企业)", dataType = "int", required = true)
    private Integer type;
    @ApiModelProperty(value = "商户名称", dataType = "string", required = true)
    private String regName;
    @ApiModelProperty(value = "商户简称", dataType = "string", required = true)
    private String shortName;
    @ApiModelProperty(value = "公司类型(1:政府机构,2:国营企业,3:私营企业,4:外资企业,5:个体工商户,7:事业单位)", dataType = "string", required = true)
    private String entType;
    @ApiModelProperty(value = "营业执照编号", dataType = "string", required = true)
    private String licenseCode;
    @ApiModelProperty(value = "营业执照有效期类型(0:非长期有效 ,1:长期有效)", dataType = "string", required = true)
    private String licenseValidityType;
    @ApiModelProperty(value = "营业执照有效期开始日期(日期格式:yyyyMMdd)", dataType = "string", required = true)
    private String licenseBeginDate;
    @ApiModelProperty(value = "营业执照有效期截止日期(日期格式:yyyyMMdd,当license_validity_type=0时必填 ;当license_validity_type=1时为空)", dataType = "string", required = true)
    private String licenseEndDate;
    @ApiModelProperty(value = "注册省(示例值:310000)", dataType = "string", required = true)
    private String regProvId;
    @ApiModelProperty(value = "注册市(示例值:310000)", dataType = "string", required = true)
    private String regAreaId;
    @ApiModelProperty(value = "注册区(示例值:310000)", dataType = "string", required = true)
    private String regDistrictId;
    @ApiModelProperty(value = "注册详细地址", dataType = "string", required = true)
    private String regDetail;
    @ApiModelProperty(value = "法人姓名", dataType = "string", required = true)
    private String legalName;
    @ApiModelProperty(value = "法人证件类型", dataType = "string", required = true)
    private String legalCertType;
    @ApiModelProperty(value = "法人证件号码", dataType = "string", required = true)
    private String legalCertNo;
    @ApiModelProperty(value = "法人证件有效期类型(1:长期有效;0:非长期有效 )", dataType = "string", required = true)
    private String legalCertValidityType;
    @ApiModelProperty(value = "法人证件有效期开始日期(日期格式:yyyyMMdd,以北京时间为准)", dataType = "string", required = true)
    private String legalCertBeginDate;
    @ApiModelProperty(value = "法人证件有效期截止日期(日期格式:yyyyMMdd,当legal_cert_validity_type=0时必填 ;当legal_cert_validity_type=1时为空 )", dataType = "string", required = true)
    private String legalCertEndDate;
    @ApiModelProperty(value = "经营省", dataType = "string", required = true)
    private String provId;
    @ApiModelProperty(value = "经营市", dataType = "string", required = true)
    private String areaId;
    @ApiModelProperty(value = "经营区", dataType = "string", required = true)
    private String districtId;
    @ApiModelProperty(value = "经营详细地址", dataType = "string", required = true)
    private String detailAddr;
    @ApiModelProperty(value = "联系人姓名", dataType = "string", required = true)
    private String contactName;
    @ApiModelProperty(value = "联系人手机号", dataType = "string", required = true)
    private String contactMobileNo;
    @ApiModelProperty(value = "联系人电子邮箱", dataType = "string", required = true)
    private String contactEmail;
    @ApiModelProperty(value = "客服电话", dataType = "string", required = true)
    private String servicePhone;
    @ApiModelProperty(value = "小票名称", dataType = "string", required = true)
    private String receiptName;
    @ApiModelProperty(value = "结算账户类型(结算账户类型,个人商户/用户不支持填写对公账户和对私非法人账户\n" +
            "0:对公账户 1:对私法人账户 2:对私非法人账户)", dataType = "string", required = true)
    private String cardType;
    @ApiModelProperty(value = "结算账户名(当card_type=0时填写企业名称\n" +
            "当card_type=1时填写法人姓名,对私法人结算银行户名与法人姓名必需一致;\n" +
            "当card_type=2时填写非法人姓名)", dataType = "string", required = true)
    private String cardName;
    @ApiModelProperty(value = "结算账号", dataType = "string", required = true)
    private String cardNo;
    @ApiModelProperty(value = "银行所在省", dataType = "string", required = true)
    private String jsProvId;
    @ApiModelProperty(value = "银行所在市", dataType = "string", required = true)
    private String jsAreaId;
    @ApiModelProperty(value = "联行号", dataType = "string", required = true)
    private String branchCode;
    @ApiModelProperty(value = "持卡人证件类型(当card_type=0时为空, 当card_type=1或2时必填)", dataType = "string", required = true)
    private String certType;
    @ApiModelProperty(value = "持卡人证件号码(对私结算必填;年龄不小于18岁且不能大于80岁;如持卡人证件类型为00:身份证,则填写身份证号码 )", dataType = "string", required = true)
    private String certNo;
    @ApiModelProperty(value = "持卡人证件类型(1:长期有效 0:非长期有效)", dataType = "string", required = true)
    private String certValidityType;
    @ApiModelProperty(value = "持卡人证件有效期开始(日期格式:yyyyMMdd,当cert_validity_type=0时必填;当cert_validity_type=1时为空)", dataType = "string", required = true)
    private String certBeginDate;
    @ApiModelProperty(value = "持卡人证件有效期截止日期(日期格式:yyyyMMdd,当cert_validity_type=0时必填;当cert_validity_type=1时为空)", dataType = "string", required = true)
    private String certEndDate;
    @ApiModelProperty(value = "银行卡绑定手机号(对私非法人结算必填,开通全域资金管理功能必填)", dataType = "string", required = true)
    private String mp;
    @ApiModelProperty(value = "商户ICP备案编号", dataType = "string", required = true)
    private String merIcp;
    @ApiModelProperty(value = "基本存款账户编号或核准号", dataType = "string", required = true)
    private String openLicenceNo;
    @ApiModelProperty(value = "开户许可证", dataType = "string", required = true)
    private String regAcctPic;
    @ApiModelProperty(value = "结算卡正面", dataType = "string", required = true)
    private String settleCardFrontPic;
    @ApiModelProperty(value = "结算人身份证国徽面", dataType = "string", required = true)
    private String settleCertBackPic;
    @ApiModelProperty(value = "结算人身份证人像面", dataType = "string", required = true)
    private String settleCertFrontPic;
    @ApiModelProperty(value = "税务登记证", dataType = "string", required = true)
    private String taxRegPic;
    @ApiModelProperty(value = "法人身份证国徽面", dataType = "string", required = true)
    private String legalCertBackPic;
    @ApiModelProperty(value = "法人身份证人像面", dataType = "string", required = true)
    private String legalCertFrontPic;
    @ApiModelProperty(value = "营业执照图片", dataType = "string", required = true)
    private String licensePic;
    @ApiModelProperty(value = "授权委托书", dataType = "string", required = true)
    private String authEnturstPic;
    @ApiModelProperty(value = "注册资本", dataType = "string", required = true)
    private String regCapital;
    @ApiModelProperty(value = "经营范围", dataType = "string", required = true)
    private String businessScope;
    @ApiModelProperty(value = "成立时间,示例值:20091212", dataType = "string", required = true)
    private String foundDate;
    @ApiModelProperty(value = "线下经营-门头照", dataType = "string", required = true)
    private String storeHeaderPic;
    @ApiModelProperty(value = "线下经营-内景照", dataType = "string", required = true)
    private String storeIndoorPic;
    @ApiModelProperty(value = "线下经营-收银台", dataType = "string", required = true)
    private String storeCashierDeskPic;
    @ApiModelProperty(value = "线上经营-公司前台", dataType = "string", required = true)
    private String onlineCompanyPic;
    @ApiModelProperty(value = "线上经营-工作区域", dataType = "string", required = true)
    private String onlineCompanyAreaPic;
    @ApiModelProperty(value = "法人手机号", dataType = "string", required = true)
    private String legalMobileNo;
    @ApiModelProperty(value = "法人身份证地址", dataType = "string", required = true)
    private String legalAddr;
}
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/vo/MgtShopHFTXAuthPageVo.java
New file
@@ -0,0 +1,33 @@
package com.ruoyi.shop.domain.vo;
import com.ruoyi.system.api.domain.dto.MgtPageDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
 * @author zhibing.pu
 * @Date 2023/10/16 11:56
 */
@Data
@ApiModel
public class MgtShopHFTXAuthPageVo extends MgtPageDto {
    @ApiModelProperty("商户id")
    private Integer shopId;
    @ApiModelProperty(value = "商户名称")
    private String shopName;
    @ApiModelProperty(value="店主姓名")
    private String shopownerName;
    @ApiModelProperty(value="店主联系方式")
    private String shopownerPhone;
    @ApiModelProperty(value="认证类型")
    private String mainType;
    @ApiModelProperty("审核状态(Y:审核通过,N:审核拒绝,F:失败)")
    private String auditStatus;
    @ApiModelProperty("审核说明")
    private String auditDesc;
    @ApiModelProperty("分账比例")
    private String shareRatio;
    @ApiModelProperty("状态(1=待进件,2=已进件)")
    private Integer status;
}
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/vo/PaymentDelaytransHFTXVo.java
New file
@@ -0,0 +1,27 @@
package com.ruoyi.shop.domain.vo;
import lombok.Data;
/**
 * @author zhibing.pu
 * @Date 2023/10/16 17:20
 */
@Data
public class PaymentDelaytransHFTXVo {
    /**
     * 交易状态(P:处理中;S:成功;F:失败;示例值:S)
     */
    private String transStat;
    /**
     * 业务请求流水号
     */
    private String reqSeqId;
    /**
     * 全局流水号
     */
    private String hfSeqId;
    /**
     * 支付交易业务请求流水号
     */
    private String orgReqSeqId;
}
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/domain/vo/WeixinPaymentRefundVo.java
New file
@@ -0,0 +1,47 @@
package com.ruoyi.shop.domain.vo;
import lombok.Data;
/**
 * @author zhibing.pu
 * @Date 2023/10/16 19:34
 */
@Data
public class WeixinPaymentRefundVo {
    /**
     * 请求流水号
     */
    private String reqSeqId;
    /**
     * 请求日期
     */
    private String reqDate;
    /**
     * 退款交易发生日期
     */
    private String transDate;
    /**
     * 退款交易发生时间
     */
    private String transTime;
    /**
     * 交易状态 P:处理中、S:成功、F:失败
     */
    private String transStat;
    /**
     * 退款金额
     */
    private String ordAmt;
    /**
     * 实际退款金额
     */
    private String actualRefAmt;
    /**
     * 原交易累计退款金额
     */
    private String totalRefAmt;
    /**
     * 累计退款次数
     */
    private String refCut;
}
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/mapper/shop/BankBranchCodeMapper.java
New file
@@ -0,0 +1,30 @@
package com.ruoyi.shop.mapper.shop;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.shop.domain.pojo.shop.BankBranchCode;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
 * @author zhibing.pu
 * @Date 2023/10/17 16:02
 */
public interface BankBranchCodeMapper extends BaseMapper<BankBranchCode> {
    /**
     * 获取银行列表
     * @return
     */
    List<Map<String, String>> getBankList(@Param("name") String name);
    /**
     * 获取银行分行列表
     * @param bankNumber
     * @return
     */
    List<Map<String, String>> getBankBranchCode(@Param("bankNumber") String bankNumber);
}
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/mapper/shop/ShopAuthenticationHftxMapper.java
New file
@@ -0,0 +1,11 @@
package com.ruoyi.shop.mapper.shop;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.shop.domain.pojo.shop.ShopAuthenticationHftx;
/**
 * @author zhibing.pu
 * @Date 2023/10/16 10:44
 */
public interface ShopAuthenticationHftxMapper extends BaseMapper<ShopAuthenticationHftx> {
}
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/mapper/shop/ShopMapper.java
@@ -123,6 +123,17 @@
     */
    List<MgtShopAuthPageVo> pageMgtShopAuth(Page page, @Param("param")MgtShopAuthPageDto mgtShopAuthPageDto);
    /**
     * 商户进件列表数据(汇付天下)
     * @param page
     * @param mgtShopAuthPageDto
     * @return
     */
    List<MgtShopHFTXAuthPageVo> pageMgtShopHFTXAuth(Page page, @Param("param") MgtShopHFTXAuthPageDto mgtShopAuthPageDto);
    /**
    * @description shopTotal
    * @param
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/BankBranchCodeServiceImpl.java
New file
@@ -0,0 +1,40 @@
package com.ruoyi.shop.service.impl.shop;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.shop.domain.dto.BankListGetDto;
import com.ruoyi.shop.domain.pojo.shop.BankBranchCode;
import com.ruoyi.shop.mapper.shop.BankBranchCodeMapper;
import com.ruoyi.shop.service.shop.BankBranchCodeService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
/**
 * @author zhibing.pu
 * @Date 2023/10/17 16:03
 */
@Service
public class BankBranchCodeServiceImpl extends ServiceImpl<BankBranchCodeMapper, BankBranchCode> implements BankBranchCodeService {
    /**
     * 获取银行列表
     * @return
     */
    @Override
    public List<Map<String, String>> getBankList(String name) {
        return this.baseMapper.getBankList(name);
    }
    /**
     * 获取银行分行列表
     * @param bankNumber
     * @return
     */
    @Override
    public List<Map<String, String>> getBankBranchCode(String bankNumber) {
        return this.baseMapper.getBankBranchCode(bankNumber);
    }
}
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopAuthenticationHftxServiceImpl.java
New file
@@ -0,0 +1,15 @@
package com.ruoyi.shop.service.impl.shop;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.shop.domain.pojo.shop.ShopAuthenticationHftx;
import com.ruoyi.shop.mapper.shop.ShopAuthenticationHftxMapper;
import com.ruoyi.shop.service.shop.ShopAuthenticationHftxService;
import org.springframework.stereotype.Service;
/**
 * @author zhibing.pu
 * @Date 2023/10/16 10:44
 */
@Service
public class ShopAuthenticationHftxServiceImpl extends ServiceImpl<ShopAuthenticationHftxMapper, ShopAuthenticationHftx> implements ShopAuthenticationHftxService {
}
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/impl/shop/ShopServiceImpl.java
@@ -1,17 +1,21 @@
package com.ruoyi.shop.service.impl.shop;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson2.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.github.binarywang.wxpay.bean.ecommerce.ApplymentsResult;
import com.github.binarywang.wxpay.bean.ecommerce.ApplymentsStatusResult;
import com.github.binarywang.wxpay.bean.ecommerce.ProfitSharingReceiverRequest;
import com.github.binarywang.wxpay.bean.ecommerce.ProfitSharingReceiverResult;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.ruoyi.common.core.constant.CacheConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.exception.ServiceException;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.StringUtils;
@@ -30,6 +34,7 @@
import com.ruoyi.shop.service.task.MemberTaskService;
import com.ruoyi.shop.service.task.ShopFileService;
import com.ruoyi.shop.service.task.ShopTaskService;
import com.ruoyi.shop.util.HuiFuTianXiaUtil;
import com.ruoyi.shop.util.WechatPayUtils;
import com.ruoyi.system.api.constant.AppErrorConstant;
import com.ruoyi.system.api.constant.SecurityConstant;
@@ -41,12 +46,16 @@
import com.ruoyi.system.api.domain.vo.*;
import com.ruoyi.system.api.service.*;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.rmi.ServerException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@@ -100,6 +109,9 @@
    private ShopAuthenticationService shopAuthenticationService;
    @Resource
    private ShopAuthenticationHftxService shopAuthenticationHftxService;
    @Resource
    private ShopProportionService shopProportionService;
    @Resource
@@ -134,6 +146,9 @@
    @Resource
    private RemoteUserService remoteUserService;
    @Value("${callback_path}")
    private String callback_path;
@@ -1015,6 +1030,17 @@
    }
    /**
     * 商户进件列表数据(汇付天下)
     * @param page
     * @param mgtShopAuthPageDto
     * @return
     */
    @Override
    public List<MgtShopHFTXAuthPageVo> pageMgtShopHFTXAuth(Page page, MgtShopHFTXAuthPageDto mgtShopAuthPageDto) {
        return shopMapper.pageMgtShopHFTXAuth(page, mgtShopAuthPageDto);
    }
    /**
     * @description boardShopTotal
     * @param
     * @return MgtBulletinBoardVo
@@ -1070,7 +1096,70 @@
     */
    @Override
    public void mgtShopHFTXAuth(MgtShopHFTXAuthDto mgtShopHFTXAuthDto) {
        ShopAuthenticationHftx shopAuthenticationHftx = shopAuthenticationHftxService.getOne(new QueryWrapper<ShopAuthenticationHftx>().eq("shop_id", mgtShopHFTXAuthDto.getShopId()));
        if(null != shopAuthenticationHftx && "Y".equals(shopAuthenticationHftx.getAuditStatus())){
            throw new ServiceException("不能重复进件");
        }
        if(null == shopAuthenticationHftx){
            shopAuthenticationHftx = new ShopAuthenticationHftx();
            shopAuthenticationHftx.setIsDelete(0);
            shopAuthenticationHftx.setInsertTime(new Date());
        }
        BeanUtils.copyProperties(mgtShopHFTXAuthDto, shopAuthenticationHftx);
        shopAuthenticationHftx.setReqSeqId(IdUtils.simpleUUID());
        shopAuthenticationHftx.setAuditStatus("");
        shopAuthenticationHftx.setAuditDesc("");
        /**
         * 开始调起进件接口
         */
        R<MerchantBasicdataVo> r = null;
        //用户
        if(mgtShopHFTXAuthDto.getType() == 1){
            r = HuiFuTianXiaUtil.merchantBasicdataIndv(mgtShopHFTXAuthDto, shopAuthenticationHftx, callback_path + "/shop/mgt/shop/merchantBasicdataNotify");
        }
        //企业进件
        if(mgtShopHFTXAuthDto.getType() == 2){
            r = HuiFuTianXiaUtil.merchantBasicdataEnt(mgtShopHFTXAuthDto, shopAuthenticationHftx, callback_path + "/shop/mgt/shop/merchantBasicdataNotify");
        }
        if(null == r){
            throw new ServiceException("参数异常");
        }
        if(r.getCode() == 200){
            MerchantBasicdataVo data = r.getData();
            shopAuthenticationHftx.setAuditStatus("U");
            shopAuthenticationHftx.setHuifuId(data.getHuifuId());
            shopAuthenticationHftx.setTokenNo(data.getTokenNo());
            shopAuthenticationHftx.setApplyNo(data.getApplyNo());
            shopAuthenticationHftxService.saveOrUpdate(shopAuthenticationHftx);
        }else{
            throw new ServiceException(r.getMsg());
        }
    }
    /**
     * 商户进件异步通知
     * @param jsonObject
     * @return
     */
    @Override
    public R<String> merchantBasicdataNotify(JSONObject jsonObject) {
        R<MerchantBasicdataVo> merchantBasicdataVoR = HuiFuTianXiaUtil.merchantBasicDataNotify(jsonObject);
        if(merchantBasicdataVoR.getCode() != 200){
            return R.fail(merchantBasicdataVoR.getMsg());
        }
        MerchantBasicdataVo data = merchantBasicdataVoR.getData();
        ShopAuthenticationHftx shopAuthenticationHftx = shopAuthenticationHftxService.getOne(new QueryWrapper<ShopAuthenticationHftx>().eq("req_seq_id", data.getReqSeqId()));
        if(!org.springframework.util.StringUtils.hasLength(shopAuthenticationHftx.getAuditStatus())){
            shopAuthenticationHftx.setAuditStatus(data.getAuditStatus());
            shopAuthenticationHftx.setAuditDesc(data.getAuditDesc());
            shopAuthenticationHftx.setHuifuId(data.getHuifuId());
            shopAuthenticationHftx.setTokenNo(data.getTokenNo());
            shopAuthenticationHftx.setApplyNo(data.getApplyNo());
            shopAuthenticationHftxService.updateById(shopAuthenticationHftx);
        }
        return R.ok(data.getReqSeqId());
    }
    /**
@@ -1209,6 +1298,23 @@
            }
        }
        return shopAuthGetVo;
    }
    /**
     * 获取商户审核资料(汇付天下)
     * @param shopId
     * @return
     */
    @Override
    public MgtShopHFTXAuthGetVo getMgtShopHFTXAuthInfo(Long shopId) {
        ShopAuthenticationHftx shopAuthenticationHftx = shopAuthenticationHftxService.getOne(new QueryWrapper<ShopAuthenticationHftx>().eq("shop_id", shopId));
        MgtShopHFTXAuthGetVo mgtShopHFTXAuthGetVo = new MgtShopHFTXAuthGetVo();
        if(null == shopAuthenticationHftx){
            return mgtShopHFTXAuthGetVo;
        }
        BeanUtils.copyProperties(shopAuthenticationHftx, mgtShopHFTXAuthGetVo);
        return mgtShopHFTXAuthGetVo;
    }
    /**
@@ -1650,4 +1756,39 @@
        return shopMapper.getTaskMsgList();
    }
    /**
     * 设置商户分账比例
     * @param mgtShopShareRatioSetDto
     * @return
     */
    @Override
    public R setMgtShopShareRatio(MgtShopShareRatioSetDto mgtShopShareRatioSetDto) {
        ShopAuthenticationHftx shopAuthenticationHftx = shopAuthenticationHftxService.getOne(new QueryWrapper<ShopAuthenticationHftx>()
                .eq("shop_id", mgtShopShareRatioSetDto.getShopId()).eq("is_delete", 0));
        shopAuthenticationHftx.setShareRatio(mgtShopShareRatioSetDto.getShareRatio());
        shopAuthenticationHftxService.updateById(shopAuthenticationHftx);
        return R.ok();
    }
    /**
     * 查询结算记录
     * @param merchantBasicdataSettlementDto
     * @return
     */
    @Override
    public R<List<MerchantBasicdataSettlementVo>> getMerchantBasicDataSettlement(MerchantBasicdataSettlementDto merchantBasicdataSettlementDto) {
        ShopAuthenticationHftx shopAuthenticationHftx = shopAuthenticationHftxService.getOne(new QueryWrapper<ShopAuthenticationHftx>()
                .eq("shop_id", merchantBasicdataSettlementDto.getShopId()).eq("is_delete", 0));
        if(null == shopAuthenticationHftx){
            return R.ok(new ArrayList<>());
        }
        String huifuId = shopAuthenticationHftx.getHuifuId();
        String startTime = merchantBasicdataSettlementDto.getStartTime();
        String endTime = merchantBasicdataSettlementDto.getEndTime();
        Integer pageNum = merchantBasicdataSettlementDto.getPageNum();
        Integer pageSize = merchantBasicdataSettlementDto.getPageSize();
        return HuiFuTianXiaUtil.getMerchantBasicdataSettlement(IdUtils.randomUUID(), huifuId, startTime, endTime, pageNum.toString(), pageSize.toString());
    }
}
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/shop/BankBranchCodeService.java
New file
@@ -0,0 +1,31 @@
package com.ruoyi.shop.service.shop;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.shop.domain.dto.BankBranchCodeGetDto;
import com.ruoyi.shop.domain.dto.BankListGetDto;
import com.ruoyi.shop.domain.pojo.shop.BankBranchCode;
import java.util.List;
import java.util.Map;
/**
 * @author zhibing.pu
 * @Date 2023/10/17 16:03
 */
public interface BankBranchCodeService extends IService<BankBranchCode> {
    /**
     * 获取银行列表
     * @return
     */
    List<Map<String, String>> getBankList(String name);
    /**
     * 获取银行分行列表
     * @param bankNumber
     * @return
     */
    List<Map<String, String>> getBankBranchCode(String bankNumber);
}
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/shop/ShopAuthenticationHftxService.java
New file
@@ -0,0 +1,11 @@
package com.ruoyi.shop.service.shop;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.shop.domain.pojo.shop.ShopAuthenticationHftx;
/**
 * @author zhibing.pu
 * @Date 2023/10/16 10:43
 */
public interface ShopAuthenticationHftxService extends IService<ShopAuthenticationHftx> {
}
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/service/shop/ShopService.java
@@ -1,9 +1,11 @@
package com.ruoyi.shop.service.shop;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.github.binarywang.wxpay.bean.ecommerce.ProfitSharingReceiverRequest;
import com.github.binarywang.wxpay.bean.ecommerce.ProfitSharingReceiverResult;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.shop.domain.dto.*;
import com.ruoyi.shop.domain.vo.*;
import com.ruoyi.system.api.domain.dto.MerBaseDto;
@@ -190,6 +192,16 @@
    */
    List<MgtShopAuthPageVo> pageMgtShopAuth(Page page,  MgtShopAuthPageDto mgtShopAuthPageDto);
    /**
     * 商户进件列表数据(汇付天下)
     * @param page
     * @param mgtShopAuthPageDto
     * @return
     */
    List<MgtShopHFTXAuthPageVo> pageMgtShopHFTXAuth(Page page,  MgtShopHFTXAuthPageDto mgtShopAuthPageDto);
    /**
    * @description boardShopTotal
    * @param
@@ -219,6 +231,14 @@
    void mgtShopHFTXAuth(MgtShopHFTXAuthDto mgtShopHFTXAuthDto);
    /**
     * 商户进件回调异步通知
     * @param jsonObject
     * @return
     */
    R<String> merchantBasicdataNotify(JSONObject vo);
    /**
     * @description  获取平台商户统计
@@ -246,6 +266,14 @@
     * @return  MgtShopAuthGetVo
     */
    MgtShopAuthGetVo getMgtShopAuth(String authId);
    /**
     * 获取商户审核资料(汇付天下)
     * @param shopId
     * @return
     */
    MgtShopHFTXAuthGetVo getMgtShopHFTXAuthInfo(Long shopId);
    /**
     * @description  获取商户验证信息
@@ -397,4 +425,19 @@
     * @return  void
     */
    void addProfitSharingReceiver(MgtShopAuthGetDto mgtShopAuthGetDto);
    /**
     * 设置分账比例
     * @param mgtShopShareRatioSetDto
     * @return
     */
    R setMgtShopShareRatio(MgtShopShareRatioSetDto mgtShopShareRatioSetDto);
    /**
     * 查询结算记录-第三方
     * @param merchantBasicdataSettlementDto
     * @return
     */
    R<List<MerchantBasicdataSettlementVo>> getMerchantBasicDataSettlement(MerchantBasicdataSettlementDto merchantBasicdataSettlementDto);
}
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/util/HuiFuTianXiaUtil.java
@@ -5,8 +5,13 @@
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.utils.uuid.IdUtils;
import com.ruoyi.shop.domain.dto.MgtShopHFTXAuthDto;
import com.ruoyi.shop.domain.pojo.shop.ShopAuthenticationHftx;
import com.ruoyi.shop.domain.vo.MerchantBasicdataSettlementVo;
import com.ruoyi.shop.domain.vo.MerchantBasicdataVo;
import com.ruoyi.shop.domain.vo.PaymentDelaytransHFTXVo;
import com.ruoyi.shop.domain.vo.WeixinPaymentRefundVo;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
@@ -18,6 +23,7 @@
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
import java.security.KeyFactory;
import java.security.PrivateKey;
@@ -36,20 +42,23 @@
 */
public class HuiFuTianXiaUtil {
    //私钥(Base64编码)
    private static String privateKeyBase64 = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCB7Flp+4FuRBvW4FLx5FoR/Hbj1UWJbgt9JAgO5iCFR9MhxXu783hvP88STFWyNkCeAh9EIwVcJxm80Kmt87KH4Nwo1ejfqF8kUkK02byVby39fqTJlyqeDYKjqqc04GpnL7vi4iD4rKGvjyJIFxekCcOSTFWVl879fbPn9+ljsVrrjoyzbPMvPJHPuc2dzkWP98C+y5QFDIdjyS8NrVOpJcwVFrcxkmCmK6azTi6LJeI/wH9MsJHmnF9ZilqY1x00XbTMxE4EfTgXgmv6dvRac6VrqQowUCqIrHpVJIdet1w56vmz3IpxORIOPzU2nY9ziZrMIgGkJ1bLQRbLK2RXAgMBAAECggEAKA4i/u7AV6t93cBpMhRRxIvOZ61/87/OoPUz2swOKKkdKaNF44tLjRjiEWUhYoEhaNWEqDAX3fJcF/9I4M1qNEQZ/Cj+072IH52Q3UrnvjZ5ulaKHXCSfgnyRd0+EapCg6+OwIMw4Rnv+z0ot4sPCc7M0dTg6e7UrQhNJ+4hsU8yZAMzmQyUu7pE6tvbE+u5QdRZRMQIYPgzwpy5Yta0gtRSmMQ9jneUYwEJ5eu8ZhAXRzEWqAA9GgOLgAwC2Ma1xkVyiBS/7pfd0fwbxapzMZMQMbCsv+UrYGYkXDp/1XwrpNWavfHpSCc9fkK2auEqYJtYlhELoa87+WrBOHhkkQKBgQDMi73gDw47XH0T6zuJn2ieDDc7IU1DV9RXXNJNxgcB0yBM8HaI8lv27eThphlEU13KWKTHAylm/q7v4dp88aC+iA3GhIbmE1sWxiSJvwGR2xqmWvIHTadJtQFdXJN+/GmG1fJuCRwkZSyGdUXUdmx3PBATEqUwuSQQDQkMvxYjrwKBgQCimxdXNEZrZKHCbHWTHx0nUu0lF7skgi8x+xLbDT096WvqpeNxOZXVZVhU7yHn2ePF9iFipg8uHviUIJyB2Rzr1M2busY3yoRutXlugZJ9ZVUlxpIpNI94ntcOZUctgfd1quhlgqEwcF1PJ5lkogrKHvLoV30fvgkYpA763ZNr2QKBgDgDkKS6GsCgzFPXGD/Q2pplZ/6WWQ03ERw3fBP2Rdb3FSJcu2k3TX3qmcI9dS/j0IxoB//D2uOsnQVuCSIsHUPwCC2z/ykkZc5vxnO+TdS+dqbVwu/DESu7GLuTbYTZ5KAbGL+PWRiSaEYN+Wh8YampVhGTCo+0M679ktvdvFdbAoGACtCz+bnhYS09URgzrchpAP+UBF6StPfvuaxQcb9srlyDMAU+nn5NB/eIq4WIRMqKStV3HP+cjN3EfN26ayyMrublkhEXNAjFTDPH0uDNZIfD5RJTEGiNjmFKPovf8xfs5Kesc2v/2p/upOAmZLoea5kpYOjIyr6yDjCDSo5ISukCgYBtOo2AgFXyzW1ti8MCsz77BtCJ9MgVoPF4y4Ah8l/6Dwe+cevdlWuOYckIAJqJ9g2FYwp9AAevK7k17xsgBgrdqlI77p3wQb7p/znJnNU6qz78FwUzd8t5WvqFh+3mTxjG7Iyj6brLzEUt8McdmGlwbFJqKgUxBKS4mY7T399L5Q==";
    private static String privateKeyBase64 = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCs658vv/6VdoSGyxr7gVNxlsFGKC2RE4I3S3C78f7t29t6oSm7tdRUr+B/I1VtV1Ps2SQMqG+gUpLiVbHEj+U8PjrvSht6cBNpqhnUjBASEhO0zeCJXNj3zqEDj7CnzDbUzuZWZDyLEaSLRaVb/DSW34D0GDsGWpIMLui/lnubXCYMNsUJBgRmV/tSv7vApVok3aKDoYkZMDhfnKrbxTtWkDfwNLDCInB300YbGeN7hhECRestktymHw0I78x3g+pdzOKOSofqdHyBCemVgOBt2h+oulVU65jc5ok0vwhx7sk2+i3Dw/S/hx3fpnOAToLhpFSTCqArG5wOhiOTX5RRAgMBAAECggEAT+uu7VDdh5L5eZtR40BIos08kwJq3QyZOJlDh3o3ixP8gtcOBNXrRyDqr5hTGXAtN+C8SqVmwkCn5rgYq3KeTpOshYBI5vP55PJbceMyYke8l+o3hwVEunPj81NsIIHALedaij9VxCjpVf1gif0tCTZP0YGJdkxSCBN+O15/zrOred2xkbAGXCNM2j+uIOZ5LTQ064jUAm9KWO4JvVnlNCQPiJCfe652i4RE9adgTlT7d9XffQ/oZDZcDkD1OVUO4ErsSgvjsjPW9Qk8zAVm/C+ycs27GUbVf6yh3zMoL4JDshzoMYAVDqP3VkpYGiW71PzcOZqktcjbtCom4/gpqQKBgQDgHrsQVzMwr18gRAWl8PsgHyMvhyivzk7uPvm6nK9mvEGg7wnrCMKHkpEOCi4mHWnW6H9ptrkeAQbHN7H8Qd6JZm/H0VN8N8fg4IFarlrLWXET6s7or9btCf4aq8DGrU9C+7fcngSfuqlrSxy9e+9InmzUFGKVLBtYIJbG1r00qwKBgQDFhHhhc4WC1MrWLSGhpaNp+swPstfzUBeX2MtZOIv6yXTYPvJ77AAZoLnW482eUZucltCAUucEtTsop25dKdhbdhbVJ/YRRnaklBL2rai4HX+fjoV29tepJhrOrq3Ey+vqvDEsqrBz2C6YyJ6d9aaPPwCFsnDRO+g7tK9S4ZfC8wKBgGlhKbXqOnCW1RSXx0waPgoBegrb816OlABj7go3qCWXOQiRvMkdilIysS+3y7EyPVTGZzpupyYbd3Nulaq10gwq9T4wB6Atnjb3ePsJZjmdKZUi3/z6yQUVoLwrq+3/CXjGYNJEHop4Ozbuz2ms/3rWuvcRSrU3UvgiAqMlzzsXAoGAJY7xDSbYZm5sO5nNYV2L22UzVHDfm4bJVbiFwmt8Qq34J/6gQWw5AKaNcA1VVhuSiY4sC5q4Dy8fFrXvyItidtHXuaSlp9dMTDNT/9A52vjRAdgqDNsXWzTBuDeDF37nV3V9rE6wyvZ6tdbAQq0phOeoA8RQq5jGqkPLauk24H0CgYEAn92Ru9UuloMmTrJbpeeLmMkwCzKff4SpYSY3WzidjdlfHpyNqBUMYb5Ym3OplrSONT9o2H5mEQipjatiu0teILBT7j+f9ZJYQ3vUurAXbmKtthHuEV4lueylNUgmkv+dm295n2x79w1mk/0emJ/Qr9tz43dpSV/kRCxc+lX+OFk=";
    //公钥(Base64编码)
    private static String publicKeyBase64 = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgexZafuBbkQb1uBS8eRaEfx249VFiW4LfSQIDuYghUfTIcV7u/N4bz/PEkxVsjZAngIfRCMFXCcZvNCprfOyh+DcKNXo36hfJFJCtNm8lW8t/X6kyZcqng2Co6qnNOBqZy+74uIg+Kyhr48iSBcXpAnDkkxVlZfO/X2z5/fpY7Fa646Ms2zzLzyRz7nNnc5Fj/fAvsuUBQyHY8kvDa1TqSXMFRa3MZJgpiums04uiyXiP8B/TLCR5pxfWYpamNcdNF20zMROBH04F4Jr+nb0WnOla6kKMFAqiKx6VSSHXrdcOer5s9yKcTkSDj81Np2Pc4mazCIBpCdWy0EWyytkVwIDAQAB";
    private static String publicKeyBase64 = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArOufL7/+lXaEhssa+4FTcZbBRigtkROCN0twu/H+7dvbeqEpu7XUVK/gfyNVbVdT7NkkDKhvoFKS4lWxxI/lPD4670obenATaaoZ1IwQEhITtM3giVzY986hA4+wp8w21M7mVmQ8ixGki0WlW/w0lt+A9Bg7BlqSDC7ov5Z7m1wmDDbFCQYEZlf7Ur+7wKVaJN2ig6GJGTA4X5yq28U7VpA38DSwwiJwd9NGGxnje4YRAkXrLZLcph8NCO/Md4PqXczijkqH6nR8gQnplYDgbdofqLpVVOuY3OaJNL8Ice7JNvotw8P0v4cd36ZzgE6C4aRUkwqgKxucDoYjk1+UUQIDAQAB";
    //汇付公钥
    private static String publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAgmGZVY0i5r17BnHiLeL7TbqojpuOmR947JIUB5zYcc/TTYijkCsjtshmvxWslZBdkV6K8/1CmHRAY92+4GZnem6MVO34xn1wTCq65+wMC1oypjJy9T6N0WXoGaf+Wn0nxPdJLvnwpOo6epEES3kQKx+i/Qar7oDwlXMQ6b2QwR/id9cYudN0RmdRLzkmrwEOkjv+WcWCQdoAXv4JWJwU+iwJffoJrWn5pGeVFWFrH1fRJ0IB4YdaL9aWMn2YM5pu+/mcOKQogmNYzsHkZDapX3AF+es0TN+v/qOCgU3OVTVa7ltDAiLuPtMeu/72pQiM0nxunRVnAJDo2BQ5mu6z4wIDAQAB";
    private static String publicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAral1nmqS1vswaeFp3dAfUY4a/ql07382AMH4NOwewtf9iuiZa608hDVzGYIXYAr+mxj1WwJpSCp9Sn+zSJs4+9iGodMa9qfUQ4oi32zGKR1ND7OZwpXYZudqQrUfC8/0j1DjOWBlKWyqwIh2JLXOiJLrU+dbDJxCqyHv+rO55egjD5yVLEJLkB/n1peIsfbqozKu7rpkx4bUAP1PvMmP913np2gYKsTrjGo7B/NqzkQ98mtL/VMOIbha0qN+MpEWImT/mOlgxvmr7YnTr3e7Iu/gSm8HR/5kLqmO4WmHALnoq7vDnOWpyM7c+awIxRTwoT8mwCuxPTLBUZ5UEmpIYwIDAQAB";
    //商户号
    private static String huifu_id = "6666000140729384";
    private static String huifu_id = "6666000141279152";
    //渠道号
    private static String channel_id = "6666000140729384";
    //产品号
    private static String product_id = "KAZX";
    //微信小程序appid
    private static String sub_appid = "";
    private static String sub_appid = "wxb7f0ea286fc4e535";
    //本地文件存储位置
    private static String path = "";
    //控制台地址https://dashboard.huifu.com/partners/login,用户名为hongrt,最新密码为xw123456
    private static String path = "D:\\file";
    //控制台地址https://dashboard.huifu.com/customers/login,用户名为hongruitang,最新密码为xw123456
    //接口文档https://paas.huifu.com/partners/api/#/
@@ -60,9 +69,8 @@
     * @param trans_amt     支付金额
     * @param sub_openid    微信小程序用户openid
     * @param notify_url    异步通知回调地址
     * @param acct_split_bunch  分账对象[{"div_amt":"0.10","huifu_id":"6666000123120001"}]
     */
    public static R weixinPayment(String req_seq_id, String goods_desc, Double trans_amt, String sub_openid, String notify_url, JSONArray acct_split_bunch){
    public static R weixinPayment(String req_seq_id, String goods_desc, Double trans_amt, String sub_openid, String notify_url){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
        NumberFormat numberInstance = NumberFormat.getInstance();
        //最大两位小数
@@ -81,7 +89,69 @@
        wx_data.put("sub_openid", sub_openid);
        data.put("wx_data", wx_data.toJSONString());
        data.put("notify_url", notify_url);
        data.put("acct_split_bunch", acct_split_bunch.toJSONString());
        data.put("delay_acct_flag", "Y");
        JSONObject body = new JSONObject();
        body.put("sys_id", huifu_id);
        body.put("product_id", product_id);
        body.put("sign", sign(data.toJSONString()));
        body.put("data", data);
        System.out.print(JSON.toJSONString(body));
        HttpRequest post = HttpUtil.createPost(url);
        Map<String, String> headers = new HashMap<>();
        headers.put("Content-type","application/json; charset=utf-8");
        headers.put("Accept", "application/json");
        post.addHeaders(headers);
        post.body(body.toJSONString());
        HttpResponse execute = post.execute();
        String result1 = execute.body();
        execute.close();
        if(StringUtils.hasLength(result1)){
            JSONObject result = JSONObject.parseObject(result1);
            String result_data = result.getString("data");
            String result_sign = result.getString("sign");
            boolean verify = verify(result_data, result_sign);
            if(!verify){
                return R.fail("结果验签失败");
            }
            JSONObject resultData = result.getJSONObject("data");
            String resp_code = resultData.getString("resp_code");
            String resp_desc = resultData.getString("resp_desc");
            //交易受理成功;注:交易状态以trans_stat为准;
            String success1 = "00000000";
            String success2 = "00000100";
            if(success1.equals(resp_code) || success2.equals(resp_code)){
            }
            return R.fail(resp_desc);
        }
        return R.fail("请求异常");
    }
    /**
     * 微信小程序支付退款
     * @param req_seq_id            请求流水号
     * @param ord_amt               退款金额
     * @param org_req_date          原交易请求日期yyyyMMdd
     * @param org_party_order_id    原交易微信支付宝的商户单号
     * @param notify_url            异步通知地址
     * @return
     */
    public static R<String> weixinPaymentRefund(String req_seq_id, Double ord_amt, String org_req_date, String org_party_order_id, String notify_url){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
        NumberFormat numberInstance = NumberFormat.getInstance();
        //最大两位小数
        numberInstance.setMaximumFractionDigits(2);
        String url = "https://api.huifu.com/v2/trade/payment/scanpay/refund";
        JSONObject data = new JSONObject();
        data.put("req_date", sdf.format(new Date()));
        data.put("req_seq_id", req_seq_id);
        data.put("huifu_id", huifu_id);
        data.put("ord_amt", ord_amt);
        data.put("org_req_date", org_req_date);
        data.put("org_party_order_id", org_party_order_id);
        data.put("notify_url", notify_url);
        JSONObject body = new JSONObject();
        body.put("sys_id", huifu_id);
@@ -106,78 +176,46 @@
                return R.fail("结果验签失败");
            }
            JSONObject resultData = result.getJSONObject("data");
            /**
             * 00000000    交易受理成功;注:交易状态以trans_stat为准;
             * 00000100    下单成功
             * 10000000    产品号不能为空
             * 10000000    交易类型不能为空
             * 10000000    %s不能为空(%s代指报错参数名)
             * 10000000    %s长度固定%d位(%s代指报错参数名、%d代指字段长度)
             * 10000000    %s最大长度为%d位(%s代指报错参数名、%d代指字段长度)
             * 10000000    %s的传入枚举[%s]不存在(%s代指报错参数名)
             * 10000000    %s不符合%s格式(%s代指报错参数名)。如:交易金额不符合金额格式
             * 10000000    订单已超时
             * 20000000    重复交易
             * 21000000    手续费金额、手续费收取方式、手续费扣款标识、手续费子客户号、手续费账户号,必须同时为空或同时必填
             * 22000000    产品号不存在
             * 22000000    产品号状态异常
             * 22000002    商户信息不存在
             * 22000002    商户状态异常
             * 22000003    延迟账户不存在
             * 22000003    商户账户信息不存在
             * 22000004    暂未开通分账权限
             * 22000004    暂未开通%s权限(%s代指报错参数名)
             * 22000004    暂未开通延迟入账权限
             * 22000005    手续费承担方必须参与分账
             * 22000005    分账列表必须包含主交易账户
             * 22000005    其他商户分账比例过高
             * 22000005    商户入驻信息配置有误(多通道)
             * 22000005    商户分期贴息未激活
             * 22000005    分期交易不能重复激活
             * 22000005    手续费配置有误
             * 22000005    商户贴息信息未配置
             * 22000005    花呗分期费率配置有误
             * 22000005    分账配置有误
             * 22000005    分账配置未包含手续费承担方
             * 22000005    商户入驻配置信息有误
             * 22000005    商户支付宝/微信入驻信息配置有误
             * 22000005    商户银联入驻信息配置有误
             * 22000005    商户贴息分期费率未配置渠道号
             * 22000005    商户贴息分期费率未配置费率类型
             * 22000005    商户贴息分期费率配置有误
             * 22000005    手续费费率未配置
             * 22000005    手续费计算错误
             * 22000005    商户贴息信息配置有误
             * 22000005    商户未报名活动或活动已过期
             * 22000005    数字货币手续费费率未配置
             * 22000005    数字货币手续费配置有误
             * 22000005    商户未配置默认入驻信息(多通道)
             * 23000003    交易金额不足以支付内扣手续费
             * 23000003    优惠金额大于交易金额
             * 23000004    交易类型不支持
             * 23000004    当前交易类型不支持商户贴息
             * 90000000    业务执行失败;如:账户可用余额不足
             * 90000000    该功能已关闭,请联系客服
             * 90000000    交易失败,单日金额超限,请联系额服提额
             * 90000000    交易存在风险
             * 91111119    通道异常,请稍后重试
             * 98888888    系统错误
             */
            String resp_code = resultData.getString("resp_code");
            String resp_desc = resultData.getString("resp_desc");
            //交易状态 P: 处理中、S: 成功、F: 失败
            String trans_stat = resultData.getString("trans_stat");
            //交易受理成功;注:交易状态以trans_stat为准;
            String success1 = "00000000";
            //下单成功
            String success2 = "00000100";
            if(success1.equals(resp_code) || success2.equals(resp_code)){
            if(success1.equals(resp_code)){
                String req_seq_id1 = resultData.getString("req_seq_id");
                return R.ok(req_seq_id1);
            }
            return R.fail(resp_desc);
        }
        return R.fail("请求异常");
    }
    /**
     * 微信支付退款回调通知
     * @param jsonObject
     * @return
     */
    public static R<WeixinPaymentRefundVo> weixinPaymentRefundNotify(JSONObject jsonObject){
        String sign = jsonObject.getString("sign");
        JSONObject data = jsonObject.getJSONObject("data");
        String resp_code = data.getString("resp_code");
        String resp_desc = data.getString("resp_desc");
        if("00000000".equals(resp_code)){
            WeixinPaymentRefundVo vo = new WeixinPaymentRefundVo();
            vo.setReqSeqId(data.getString("req_seq_id"));
            vo.setReqDate(data.getString("req_date"));
            vo.setTransDate(data.getString("trans_date"));
            vo.setTransTime(data.getString("trans_time"));
            vo.setTransStat(data.getString("trans_stat"));
            vo.setOrdAmt(data.getString("ord_amt"));
            vo.setActualRefAmt(data.getString("actual_ref_amt"));
            vo.setTotalRefAmt(data.getString("total_ref_amt"));
            vo.setRefCut(data.getString("ref_cut"));
            return R.ok(vo);
        }
        return R.fail(resp_desc);
    }
@@ -239,111 +277,190 @@
    /**
     * 商户进价
     * 商户进件
     * @param dto
     * @param req_seq_id            流水号
     * @param async_return_url      异步通知回调地址
     * @return
     */
    public static R<MerchantBasicdataVo> merchantBasicdataEnt(MgtShopHFTXAuthDto dto, String req_seq_id, String async_return_url){
    public static R<MerchantBasicdataVo> merchantBasicdataEnt(MgtShopHFTXAuthDto dto, ShopAuthenticationHftx shopAuthenticationHftx, String async_return_url){
        String url = "https://api.huifu.com/v2/merchant/basicdata/ent";
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
        JSONObject data = new JSONObject();
        data.put("req_seq_id", req_seq_id);
        data.put("req_seq_id", shopAuthenticationHftx.getReqSeqId());
        data.put("req_date", sdf.format(new Date()));
        data.put("upper_huifu_id", huifu_id);
        data.put("reg_name", dto.getReg_name());
        data.put("short_name", dto.getShort_name());
        data.put("ent_type", dto.getEnt_type());
        data.put("license_code", dto.getLicense_code());
        data.put("license_validity_type", dto.getLicense_validity_type());
        data.put("license_begin_date", dto.getLicense_begin_date());
        if("0".equals(dto.getLicense_validity_type())){
            data.put("license_end_date", dto.getLicense_end_date());
        data.put("upper_huifu_id", channel_id);
        data.put("reg_name", dto.getRegName());
        data.put("short_name", dto.getShortName());
        data.put("ent_type", dto.getEntType());
        data.put("license_code", dto.getLicenseCode());
        data.put("license_validity_type", dto.getLicenseValidityType());
        data.put("license_begin_date", dto.getLicenseBeginDate());
        if("0".equals(dto.getLicenseValidityType())){
            data.put("license_end_date", dto.getLicenseEndDate());
        }
        data.put("reg_prov_id", dto.getReg_prov_id());
        data.put("reg_area_id", dto.getReg_area_id());
        data.put("reg_district_id", dto.getReg_district_id());
        data.put("reg_detail", dto.getReg_detail());
        data.put("legal_name", dto.getLegal_name());
        data.put("legal_cert_type", dto.getLegal_cert_type());
        data.put("legal_cert_no", dto.getLegal_cert_no());
        data.put("legal_cert_validity_type", dto.getLegal_cert_validity_type());
        data.put("legal_cert_begin_date", dto.getLegal_cert_begin_date());
        if("0".equals(dto.getLegal_cert_validity_type())){
            data.put("legal_cert_end_date", dto.getLegal_cert_end_date());
        data.put("reg_prov_id", dto.getRegProvId());
        data.put("reg_area_id", dto.getRegAreaId());
        data.put("reg_district_id", dto.getRegDistrictId());
        data.put("reg_detail", dto.getRegDetail());
        data.put("legal_name", dto.getLegalName());
        data.put("legal_cert_type", dto.getLegalCertType());
        data.put("legal_cert_no", dto.getLegalCertNo());
        data.put("legal_cert_validity_type", dto.getLegalCertValidityType());
        data.put("legal_cert_begin_date", dto.getLegalCertBeginDate());
        if("0".equals(dto.getLegalCertValidityType())){
            data.put("legal_cert_end_date", dto.getLegalCertEndDate());
        }
        data.put("prov_id", dto.getProv_id());
        data.put("area_id", dto.getArea_id());
        data.put("district_id", dto.getDistrict_id());
        data.put("detail_addr", dto.getDetail_addr());
        data.put("contact_name", dto.getContact_name());
        data.put("contact_mobile_no", dto.getContact_mobile_no());
        data.put("contact_email", dto.getContact_email());
        data.put("service_phone", dto.getService_phone());
        data.put("prov_id", dto.getProvId());
        data.put("area_id", dto.getAreaId());
        data.put("district_id", dto.getDistrictId());
        data.put("detail_addr", dto.getDetailAddr());
        data.put("contact_name", dto.getContactName());
        data.put("contact_mobile_no", dto.getContactMobileNo());
        data.put("contact_email", dto.getContactEmail());
        data.put("service_phone", dto.getServicePhone());
        data.put("busi_type", "1");
        data.put("receipt_name", dto.getReceipt_name());
        data.put("receipt_name", dto.getReceiptName());
        data.put("mcc", "7297");
        //结算卡信息配置
        dto.setCertType("00");
        dto.setCertValidityType("1");
        if(StringUtils.hasLength(dto.getCertEndDate())){
            dto.setCertValidityType("0");
        }
        JSONObject card_info = new JSONObject();
        card_info.put("card_type", dto.getCard_type());
        card_info.put("card_name", dto.getCard_name());
        card_info.put("card_no", dto.getCard_no());
        if(!"0".equals(dto.getCard_type())){
            card_info.put("prov_id", dto.getJs_prov_id());
            card_info.put("area_id", dto.getJs_area_id());
            card_info.put("cert_type", dto.getCert_type());
        card_info.put("card_type", dto.getCardType());
        card_info.put("card_name", dto.getCardName());
        card_info.put("card_no", dto.getCardNo());
        if(!"0".equals(dto.getCardType())){
            card_info.put("prov_id", dto.getJsProvId());
            card_info.put("area_id", dto.getJsAreaId());
            card_info.put("cert_type", dto.getCertType());
        }
        if("0".equals(dto.getCard_type())){
            card_info.put("branch_code", dto.getBranch_code());
        if("0".equals(dto.getCardType())){
            card_info.put("branch_code", dto.getBranchCode());
        }
        card_info.put("cert_no", dto.getCert_no());
        card_info.put("cert_validity_type", dto.getCert_validity_type());
        if("0".equals(dto.getCert_validity_type())){
            card_info.put("cert_end_date", dto.getCert_end_date());
        card_info.put("cert_no", dto.getCertNo());
        card_info.put("cert_validity_type", dto.getCertValidityType());
        if("0".equals(dto.getCertValidityType())){
            card_info.put("cert_end_date", dto.getCertEndDate());
        }
        card_info.put("mp", dto.getMp());
        data.put("card_info", card_info.toJSONString());
        //取现信息配置
        JSONArray jsonArray = new JSONArray();
        JSONObject cash_config = new JSONObject();
        cash_config.put("cash_type", "T1");
        cash_config.put("fix_amt", "0.00");
        data.put("cash_config", cash_config.toJSONString());
        jsonArray.add(cash_config);
        data.put("cash_config", jsonArray.toJSONString());
        //结算规则配置
        JSONObject settle_config = new JSONObject();
        cash_config.put("settle_cycle", "T1");
        cash_config.put("settle_pattern", "P0");
        cash_config.put("settle_batch_no", "0");
        cash_config.put("constant_amt", "0.00");
        settle_config.put("settle_cycle", "T1");
        settle_config.put("settle_pattern", "P0");
        settle_config.put("settle_batch_no", "0");
        settle_config.put("constant_amt", "0.00");
        data.put("settle_config", settle_config.toJSONString());
        data.put("async_return_url", async_return_url);
        data.put("mer_icp", dto.getMer_icp());
        data.put("open_licence_no", dto.getOpen_licence_no());
//        data.put("mer_icp", dto.getMerIcp());
        data.put("mer_icp", "");
        data.put("open_licence_no", dto.getOpenLicenceNo());
        data.put("head_huifu_id", huifu_id);
        data.put("reg_acct_pic", dto.getReg_acct_pic());
        data.put("settle_card_front_pic", dto.getSettle_card_front_pic());
        data.put("settle_cert_back_pic", dto.getSettle_cert_back_pic());
        data.put("settle_cert_front_pic", dto.getSettle_cert_front_pic());
        data.put("tax_reg_pic", dto.getTax_reg_pic());
        data.put("legal_cert_back_pic", dto.getLegal_cert_back_pic());
        data.put("legal_cert_front_pic", dto.getLegal_cert_front_pic());
        data.put("license_pic", dto.getLicense_pic());
        data.put("auth_enturst_pic", dto.getAuth_enturst_pic());
        data.put("reg_capital", dto.getReg_capital());
        data.put("business_scope", dto.getBusiness_scope());
        data.put("found_date", dto.getFound_date());
        data.put("scene_type", "ALL");
        data.put("store_header_pic", dto.getStore_header_pic());
        data.put("store_indoor_pic", dto.getStore_indoor_pic());
        data.put("store_cashier_desk_pic", dto.getStore_cashier_desk_pic());
        data.put("online_company_pic", dto.getOnline_company_pic());
        data.put("online_company_area_pic", dto.getOnline_company_area_pic());
        data.put("legal_mobile_no", dto.getLegal_mobile_no());
        data.put("legal_addr", dto.getLegal_addr());
        R<String> r = supplementaryPicture(dto.getRegAcctPic(), IdUtils.simpleUUID(), "F08");
        if(r.getCode() == 200){
            data.put("reg_acct_pic", r.getData());
            shopAuthenticationHftx.setRegAcctPicNo(r.getData());
        }else{
            return R.fail(r.getMsg());
        }
        r = supplementaryPicture(dto.getSettleCardFrontPic(), IdUtils.simpleUUID(), "F13");
        if(r.getCode() == 200){
            data.put("settle_card_front_pic", r.getData());
            shopAuthenticationHftx.setSettleCardFrontPicNo(r.getData());
        }else{
            return R.fail(r.getMsg());
        }
        r = supplementaryPicture(dto.getSettleCertBackPic(), IdUtils.simpleUUID(), "F56");
        if(r.getCode() == 200){
            data.put("settle_cert_back_pic", r.getData());
            shopAuthenticationHftx.setSettleCertBackPicNo(r.getData());
        }else{
            return R.fail(r.getMsg());
        }
        r = supplementaryPicture(dto.getSettleCertFrontPic(), IdUtils.simpleUUID(), "F55");
        if(r.getCode() == 200){
            data.put("settle_cert_front_pic", r.getData());
            shopAuthenticationHftx.setSettleCertFrontPicNo(r.getData());
        }else{
            return R.fail(r.getMsg());
        }
        r = supplementaryPicture(dto.getTaxRegPic(), IdUtils.simpleUUID(), "F58");
        if(r.getCode() == 200){
            data.put("tax_reg_pic", r.getData());
            shopAuthenticationHftx.setTaxRegPicNo(r.getData());
        }else{
            return R.fail(r.getMsg());
        }
        r = supplementaryPicture(dto.getLegalCertBackPic(), IdUtils.simpleUUID(), "F03");
        if(r.getCode() == 200){
            data.put("legal_cert_back_pic", r.getData());
            shopAuthenticationHftx.setLegalCertBackPicNo(r.getData());
        }else{
            return R.fail(r.getMsg());
        }
        r = supplementaryPicture(dto.getLegalCertFrontPic(), IdUtils.simpleUUID(), "F02");
        if(r.getCode() == 200){
            data.put("legal_cert_front_pic", r.getData());
            shopAuthenticationHftx.setLegalCertFrontPicNo(r.getData());
        }else{
            return R.fail(r.getMsg());
        }
        r = supplementaryPicture(dto.getLicensePic(), IdUtils.simpleUUID(), "F07");
        if(r.getCode() == 200){
            data.put("license_pic", r.getData());
            shopAuthenticationHftx.setLicensePicNo(r.getData());
        }else{
            return R.fail(r.getMsg());
        }
        if(!dto.getLegalName().equals(dto.getCardName())){
            r = supplementaryPicture(dto.getAuthEnturstPic(), IdUtils.simpleUUID(), "F15");
            if(r.getCode() == 200){
                data.put("auth_enturst_pic", r.getData());
                shopAuthenticationHftx.setAuthEnturstPicNo(r.getData());
            }else{
                return R.fail(r.getMsg());
            }
        }
        data.put("reg_capital", dto.getRegCapital());
        data.put("business_scope", dto.getBusinessScope());
        data.put("found_date", dto.getFoundDate());
        data.put("scene_type", "OFFLINE");
        r = supplementaryPicture(dto.getStoreHeaderPic(), IdUtils.simpleUUID(), "F22");
        if(r.getCode() == 200){
            data.put("store_header_pic", r.getData());
            shopAuthenticationHftx.setStoreHeaderPicNo(r.getData());
        }else{
            return R.fail(r.getMsg());
        }
        r = supplementaryPicture(dto.getStoreIndoorPic(), IdUtils.simpleUUID(), "F24");
        if(r.getCode() == 200){
            data.put("store_indoor_pic", r.getData());
            shopAuthenticationHftx.setStoreIndoorPicNo(r.getData());
        }else{
            return R.fail(r.getMsg());
        }
        r = supplementaryPicture(dto.getStoreCashierDeskPic(), IdUtils.simpleUUID(), "F105");
        if(r.getCode() == 200){
            data.put("store_cashier_desk_pic", r.getData());
            shopAuthenticationHftx.setStoreCashierDeskPicNo(r.getData());
        }else{
            return R.fail(r.getMsg());
        }
        data.put("legal_mobile_no", dto.getLegalMobileNo());
        data.put("legal_addr", dto.getLegalAddr());
        JSONObject body = new JSONObject();
        body.put("sys_id", huifu_id);
@@ -356,13 +473,15 @@
        headers.put("Accept", "application/json");
        post.addHeaders(headers);
        post.body(body.toJSONString());
        System.out.println(JSON.toJSONString(body));
        HttpResponse execute = post.execute();
        String result = execute.body();
        execute.close();
        if(!StringUtils.hasLength(result)){
            return R.fail("请求异常");
        }
        JSONObject resultData = JSON.parseObject(result);
        JSONObject jsonObject = JSON.parseObject(result);
        JSONObject resultData = jsonObject.getJSONObject("data");
        String resp_code = resultData.getString("resp_code");
        String resp_desc = resultData.getString("resp_desc");
        //处理成功
@@ -374,9 +493,9 @@
        MerchantBasicdataVo vo = new MerchantBasicdataVo();
        if(success1.equals(resp_code) || success2.equals(resp_code) || success3.equals(resp_code)){
            vo.setStatus(success1.equals(resp_code) ? 1 : success3.equals(resp_code) ? 2 : 3);
            vo.setHuifu_id(resultData.getString("huifu_id"));
            vo.setApply_no(resultData.getString("apply_no"));
            vo.setToken_no(resultData.getString("token_no"));
            vo.setHuifuId(resultData.getString("huifu_id"));
            vo.setApplyNo(resultData.getString("apply_no"));
            vo.setTokenNo(resultData.getString("token_no"));
            return R.ok(vo);
        }
        return R.fail(resp_desc);
@@ -388,7 +507,7 @@
     * @param jsonObject
     * @return
     */
    public static R<MerchantBasicdataVo> merchantBasicdataEntNotify(JSONObject jsonObject){
    public static R<MerchantBasicdataVo> merchantBasicDataNotify(JSONObject jsonObject){
        String ok = "200";
        String success = "10000";
        String resp_code = jsonObject.getString("resp_code");
@@ -405,11 +524,12 @@
            MerchantBasicdataVo vo = new MerchantBasicdataVo();
            if(success1.equals(sub_resp_code) || success2.equals(sub_resp_code) || success3.equals(sub_resp_code)){
                vo.setStatus(success1.equals(sub_resp_code) ? 1 : success3.equals(sub_resp_code) ? 2 : 3);
                vo.setAudit_status(data.getString("audit_status"));
                vo.setAudit_desc(data.getString("audit_desc"));
                vo.setHuifu_id(data.getString("huifu_id"));
                vo.setApply_no(data.getString("apply_no"));
                vo.setToken_no(data.getString("token_no"));
                vo.setAuditStatus(data.getString("audit_status"));
                vo.setAuditDesc(data.getString("audit_desc"));
                vo.setHuifuId(data.getString("huifu_id"));
                vo.setApplyNo(data.getString("apply_no"));
                vo.setTokenNo(data.getString("token_no"));
                vo.setReqSeqId(data.getString("req_seq_id"));
                return R.ok(vo);
            }
            return R.fail(sub_resp_desc);
@@ -422,76 +542,129 @@
    /**
     * 个人商户进件
     * @param dto
     * @param req_seq_id            流水号
     * @param async_return_url      异步通知回调地址
     * @return
     */
    public static R<MerchantBasicdataVo> merchantBasicdataIndv(MgtShopHFTXAuthDto dto, String req_seq_id, String async_return_url){
    public static R<MerchantBasicdataVo> merchantBasicdataIndv(MgtShopHFTXAuthDto dto, ShopAuthenticationHftx shopAuthenticationHftx, String async_return_url){
        String url = "https://api.huifu.com/v2/merchant/basicdata/indv";
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
        JSONObject data = new JSONObject();
        data.put("req_seq_id", req_seq_id);
        data.put("req_seq_id", shopAuthenticationHftx.getReqSeqId());
        data.put("req_date", sdf.format(new Date()));
        data.put("upper_huifu_id", huifu_id);
        data.put("reg_name", dto.getReg_name());
        data.put("prov_id", dto.getProv_id());
        data.put("area_id", dto.getArea_id());
        data.put("district_id", dto.getDistrict_id());
        data.put("detail_addr", dto.getDetail_addr());
        data.put("contact_name", dto.getContact_name());
        data.put("contact_mobile_no", dto.getContact_mobile_no());
        data.put("contact_email", dto.getContact_email());
        data.put("upper_huifu_id", channel_id);
        data.put("reg_name", dto.getRegName());
        data.put("prov_id", dto.getProvId());
        data.put("area_id", dto.getAreaId());
        data.put("district_id", dto.getDistrictId());
        data.put("detail_addr", dto.getDetailAddr());
        data.put("contact_name", dto.getContactName());
        data.put("contact_mobile_no", dto.getContactMobileNo());
        data.put("contact_email", dto.getContactEmail());
        //结算卡信息配置
        dto.setCertType("00");
        dto.setCertValidityType("1");
        if(StringUtils.hasLength(dto.getCertEndDate())){
            dto.setCertValidityType("0");
        }
        JSONObject card_info = new JSONObject();
        card_info.put("card_name", dto.getCard_name());
        card_info.put("card_no", dto.getCard_no());
        card_info.put("prov_id", dto.getJs_prov_id());
        card_info.put("area_id", dto.getJs_area_id());
        card_info.put("cert_type", dto.getCert_type());
        card_info.put("cert_no", dto.getCert_no());
        card_info.put("cert_validity_type", dto.getCert_validity_type());
        card_info.put("cert_begin_date", dto.getCert_begin_date());
        card_info.put("cert_end_date", dto.getCert_end_date());
        card_info.put("card_name", dto.getCardName());
        card_info.put("card_no", dto.getCardNo());
        card_info.put("prov_id", dto.getJsProvId());
        card_info.put("area_id", dto.getJsAreaId());
        card_info.put("cert_type", dto.getCertType());
        card_info.put("cert_no", dto.getCertNo());
        card_info.put("cert_validity_type", dto.getCertValidityType());
        card_info.put("cert_begin_date", dto.getCertBeginDate());
        card_info.put("cert_end_date", dto.getCertEndDate());
        card_info.put("mp", dto.getMp());
        data.put("card_info", card_info.toJSONString());
        //取现信息配置
        JSONArray jsonArray = new JSONArray();
        JSONObject cash_config = new JSONObject();
        cash_config.put("cash_type", "T1");
        cash_config.put("fix_amt", "0.00");
        data.put("cash_config", cash_config.toJSONString());
        jsonArray.add(cash_config);
        data.put("cash_config", jsonArray.toJSONString());
        //结算规则配置
        JSONObject settle_config = new JSONObject();
        cash_config.put("settle_cycle", "T1");
        cash_config.put("settle_pattern", "P0");
        cash_config.put("settle_batch_no", "0");
        cash_config.put("constant_amt", "0.00");
        settle_config.put("settle_cycle", "T1");
        settle_config.put("settle_pattern", "P0");
        settle_config.put("settle_batch_no", "0");
        settle_config.put("constant_amt", "0.00");
        data.put("settle_config", settle_config.toJSONString());
        data.put("async_return_url", async_return_url);
        data.put("mer_icp", dto.getMer_icp());
        data.put("scene_type", "ALL");
        data.put("legal_cert_no", dto.getLegal_cert_no());
        data.put("legal_cert_validity_type", dto.getLegal_cert_validity_type());
        data.put("legal_cert_begin_date", dto.getLegal_cert_begin_date());
        data.put("legal_cert_end_date", dto.getLegal_cert_end_date());
        data.put("legal_addr", dto.getLegal_addr());
        data.put("legal_cert_back_pic", dto.getLegal_cert_back_pic());
        data.put("legal_cert_front_pic", dto.getLegal_cert_front_pic());
        data.put("mer_icp", dto.getMerIcp());
        data.put("scene_type", "OFFLINE");
        data.put("legal_cert_no", dto.getLegalCertNo());
        data.put("legal_cert_validity_type", dto.getLegalCertValidityType());
        data.put("legal_cert_begin_date", dto.getLegalCertBeginDate());
        data.put("legal_cert_end_date", dto.getLegalCertEndDate());
        data.put("legal_addr", dto.getLegalAddr());
        R<String> r = supplementaryPicture(dto.getLegalCertBackPic(), IdUtils.simpleUUID(), "F03");
        if(r.getCode() == 200){
            data.put("legal_cert_back_pic", r.getData());
            shopAuthenticationHftx.setLegalCertBackPicNo(r.getData());
        }else{
            return R.fail("【legalCertBackPic】" + r.getMsg());
        }
        r = supplementaryPicture(dto.getLegalCertFrontPic(), IdUtils.simpleUUID(), "F02");
        if(r.getCode() == 200){
            data.put("legal_cert_front_pic", r.getData());
            shopAuthenticationHftx.setLegalCertFrontPicNo(r.getData());
        }else{
            return R.fail("【legalCertFrontPic】" + r.getMsg());
        }
        data.put("mcc", "7297");
        data.put("store_header_pic", dto.getStore_header_pic());
        data.put("store_indoor_pic", dto.getStore_indoor_pic());
        data.put("store_cashier_desk_pic", dto.getStore_cashier_desk_pic());
        data.put("settle_card_front_pic", dto.getSettle_card_front_pic());
        data.put("auth_enturst_pic", dto.getAuth_enturst_pic());
        r = supplementaryPicture(dto.getStoreHeaderPic(), IdUtils.simpleUUID(), "F22");
        if(r.getCode() == 200){
            data.put("store_header_pic", r.getData());
            shopAuthenticationHftx.setStoreHeaderPicNo(r.getData());
        }else{
            return R.fail("【storeHeaderPic】" + r.getMsg());
        }
        r = supplementaryPicture(dto.getStoreIndoorPic(), IdUtils.simpleUUID(), "F24");
        if(r.getCode() == 200){
            data.put("store_indoor_pic", r.getData());
            shopAuthenticationHftx.setStoreIndoorPicNo(r.getData());
        }else{
            return R.fail("【storeIndoorPic】" + r.getMsg());
        }
        r = supplementaryPicture(dto.getStoreCashierDeskPic(), IdUtils.simpleUUID(), "F105");
        if(r.getCode() == 200){
            data.put("store_cashier_desk_pic", r.getData());
            shopAuthenticationHftx.setStoreCashierDeskPicNo(r.getData());
        }else{
            return R.fail("【storeCashierDeskPic】" + r.getMsg());
        }
        r = supplementaryPicture(dto.getSettleCardFrontPic(), IdUtils.simpleUUID(), "F13");
        if(r.getCode() == 200){
            data.put("settle_card_front_pic", r.getData());
            shopAuthenticationHftx.setSettleCardFrontPicNo(r.getData());
        }else{
            return R.fail("【settleCardFrontPic】" + r.getMsg());
        }
        //法人和结算卡户名不是同一个人需要授权委托书
        if(!dto.getLegalName().equals(dto.getCardName())){
            r = supplementaryPicture(dto.getAuthEnturstPic(), IdUtils.simpleUUID(), "F15");
            if(r.getCode() == 200){
                data.put("auth_enturst_pic", r.getData());
                shopAuthenticationHftx.setAuthEnturstPicNo(r.getData());
            }else{
                return R.fail("【authEnturstPic】" + r.getMsg());
            }
        }
        JSONObject body = new JSONObject();
        body.put("sys_id", huifu_id);
        body.put("product_id", product_id);
        body.put("sign", sign(data.toJSONString()));
        body.put("data", data);
        System.out.println(JSON.toJSONString(body));
        HttpRequest post = HttpUtil.createPost(url);
        Map<String, String> headers = new HashMap<>();
        headers.put("Content-type","application/json; charset=utf-8");
@@ -504,7 +677,8 @@
        if(!StringUtils.hasLength(result)){
            return R.fail("请求异常");
        }
        JSONObject resultData = JSON.parseObject(result);
        JSONObject jsonObject = JSON.parseObject(result);
        JSONObject resultData = jsonObject.getJSONObject("data");
        String resp_code = resultData.getString("resp_code");
        String resp_desc = resultData.getString("resp_desc");
        //处理成功
@@ -516,9 +690,9 @@
        MerchantBasicdataVo vo = new MerchantBasicdataVo();
        if(success1.equals(resp_code) || success2.equals(resp_code) || success3.equals(resp_code)){
            vo.setStatus(success1.equals(resp_code) ? 1 : success3.equals(resp_code) ? 2 : 3);
            vo.setHuifu_id(resultData.getString("huifu_id"));
            vo.setApply_no(resultData.getString("apply_no"));
            vo.setToken_no(resultData.getString("token_no"));
            vo.setHuifuId(resultData.getString("huifu_id"));
            vo.setApplyNo(resultData.getString("apply_no"));
            vo.setTokenNo(resultData.getString("token_no"));
            return R.ok(vo);
        }
        return R.fail(resp_desc);
@@ -526,39 +700,6 @@
    /**
     * 个人商户进件通知回调处理
     * @param jsonObject
     * @return
     */
    public static R<MerchantBasicdataVo> merchantBasicdataIndvNotify(JSONObject jsonObject){
        String ok = "200";
        String success = "10000";
        String resp_code = jsonObject.getString("resp_code");
        if(ok.equals(resp_code) || success.equals(resp_code)){
            JSONObject data = jsonObject.getJSONObject("data");
            String sub_resp_code = data.getString("sub_resp_code");
            String sub_resp_desc = data.getString("sub_resp_desc");
            //处理成功
            String success1 = "00000000";
            //交易正在处理中
            String success2 = "00000100";
            //审核中
            String success3 = "90000000";
            MerchantBasicdataVo vo = new MerchantBasicdataVo();
            if(success1.equals(sub_resp_code) || success2.equals(sub_resp_code) || success3.equals(sub_resp_code)){
                vo.setStatus(success1.equals(sub_resp_code) ? 1 : success3.equals(sub_resp_code) ? 2 : 3);
                vo.setAudit_status(data.getString("audit_status"));
                vo.setAudit_desc(data.getString("audit_desc"));
                vo.setHuifu_id(data.getString("huifu_id"));
                vo.setApply_no(data.getString("apply_no"));
                vo.setToken_no(data.getString("token_no"));
                return R.ok(vo);
            }
            return R.fail(sub_resp_desc);
        }
        return R.fail(jsonObject.getString("resp_desc"));
    }
    /**
@@ -593,7 +734,6 @@
            mEntityBuilder.addTextBody("product_id", product_id, contentType);
            mEntityBuilder.addTextBody("data", data, contentType);
            mEntityBuilder.addBinaryBody("file", file);
            httpPost.setEntity(mEntityBuilder.build());
            response = httpclient1.execute(httpPost);
            int statusCode = response.getStatusLine().getStatusCode();
@@ -623,40 +763,24 @@
    /**
     * 商户分账配置
     * 确认交易
     * @param req_seq_id            流水号
     * @param huifuId               商户号
     * @param apply_ratio           最大分账比例
     * @param async_return_url      回调通知
     * @param org_req_seq_id    原交易请求流水号
     * @param acctInfos        分账明细
     * @return
     */
    public static R<String> merchantSplitConfig(String req_seq_id, String huifuId, Double apply_ratio, String async_return_url){
        NumberFormat numberInstance = NumberFormat.getInstance();
        //最大两位小数
        numberInstance.setMaximumFractionDigits(2);
        String url = "https://api.huifu.com/v2/merchant/split/config";
    public static R<PaymentDelaytransHFTXVo> paymentDelaytrans(String req_seq_id, String org_req_seq_id, JSONArray acctInfos){
        String url = "https://api.huifu.com/v2/trade/payment/delaytrans/confirm";
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
        JSONObject data = new JSONObject();
        data.put("req_seq_id", req_seq_id);
        data.put("req_date", sdf.format(new Date()));
        data.put("huifu_id", huifuId);
        data.put("rule_origin", "01");
        data.put("div_flag", "Y");
        data.put("apply_ratio", numberInstance.format(apply_ratio));
        data.put("start_type", "0");
        data.put("async_return_url", async_return_url);
        data.put("scene", "");
        data.put("huifu_id", huifu_id);
        data.put("org_req_seq_id", org_req_seq_id);
        JSONObject file_list = new JSONObject();
        file_list.put("file_id", "");
        data.put("file_list", file_list.toJSONString());
        JSONObject split_ext_info = new JSONObject();
        split_ext_info.put("busi_instruction", "");
        split_ext_info.put("capital_instruction", "");
        split_ext_info.put("function_instruction", "");
        data.put("split_ext_info", split_ext_info.toJSONString());
        data.put("online_busi_type", "");
        JSONObject acct_infos = new JSONObject();
        acct_infos.put("acct_infos", acctInfos);
        data.put("acct_split_bunch", acct_infos.toJSONString());
        JSONObject body = new JSONObject();
        body.put("sys_id", huifu_id);
@@ -685,36 +809,81 @@
        //审核中
        String success3 = "90000000";
        if(success1.equals(resp_code) || success2.equals(resp_code) || success3.equals(resp_code)){
            return R.ok(resultData.getString("apply_no"));
            PaymentDelaytransHFTXVo vo = new PaymentDelaytransHFTXVo();
            vo.setTransStat(resultData.getString("trans_stat"));
            vo.setReqSeqId(resultData.getString("req_seq_id"));
            vo.setHfSeqId(resultData.getString("hf_seq_id"));
            vo.setOrgReqSeqId(resultData.getString("org_req_seq_id"));
            return R.ok(vo);
        }
        return R.fail(resp_desc);
    }
    /**
     * 商户分账配置回调处理
     * @param jsonObject
     * 查询结算记录
     * @param req_seq_id    流水号
     * @param huifu_id      商户号
     * @param begin_date    开始日期
     * @param end_date      结束日期
     * @param page_num      分页页码,不传则默认为第1页
     * @param page_size     分页条数
     * @return
     */
    public static R<MerchantBasicdataVo> merchantSplitConfigNotify(JSONObject jsonObject){
        String sub_resp_code = jsonObject.getString("sub_resp_code");
        String sub_resp_desc = jsonObject.getString("sub_resp_desc");
    public static R<List<MerchantBasicdataSettlementVo>> getMerchantBasicdataSettlement(String req_seq_id, String huifu_id, String begin_date, String end_date, String page_num, String page_size){
        String url = "https://api.huifu.com/v2/merchant/basicdata/settlement/query";
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
        JSONObject data = new JSONObject();
        data.put("req_seq_id", req_seq_id);
        data.put("req_date", sdf.format(new Date()));
        data.put("huifu_id", huifu_id);
        data.put("begin_date", begin_date);
        data.put("end_date", end_date);
        data.put("page_num", page_num);
        data.put("page_size", page_size);
        data.put("sort_order", "DESC");
        JSONObject body = new JSONObject();
        body.put("sys_id", huifu_id);
        body.put("product_id", product_id);
        body.put("sign", sign(data.toJSONString()));
        body.put("data", data);
        HttpRequest post = HttpUtil.createPost(url);
        Map<String, String> headers = new HashMap<>();
        headers.put("Content-type","application/json; charset=utf-8");
        headers.put("Accept", "application/json");
        post.addHeaders(headers);
        post.body(body.toJSONString());
        HttpResponse execute = post.execute();
        String result = execute.body();
        execute.close();
        if(!StringUtils.hasLength(result)){
            return R.fail("请求异常");
        }
        JSONObject resultData = JSON.parseObject(result).getJSONObject("data");
        String resp_code = resultData.getString("resp_code");
        String resp_desc = resultData.getString("resp_desc");
        //处理成功
        String success1 = "00000000";
        //交易正在处理中
        String success2 = "00000100";
        //审核中
        String success3 = "90000000";
        MerchantBasicdataVo vo = new MerchantBasicdataVo();
        if(success1.equals(sub_resp_code) || success2.equals(sub_resp_code) || success3.equals(sub_resp_code)){
            vo.setStatus(success1.equals(sub_resp_code) ? 1 : success3.equals(sub_resp_code) ? 2 : 3);
            vo.setAudit_status(jsonObject.getString("audit_status"));
            vo.setAudit_desc(jsonObject.getString("audit_desc"));
            vo.setHuifu_id(jsonObject.getString("huifu_id"));
            vo.setApply_no(jsonObject.getString("apply_no"));
            return R.ok(vo);
        if(success1.equals(resp_code)){
            JSONArray trans_log_result_list = resultData.getJSONArray("trans_log_result_list");
            List<MerchantBasicdataSettlementVo> list = new ArrayList<>();
            if(null ==  trans_log_result_list){
                return R.ok(list);
        }
        return R.fail(sub_resp_desc);
            for (int i = 0; i < trans_log_result_list.size(); i++) {
                JSONObject jsonObject = trans_log_result_list.getJSONObject(i);
                MerchantBasicdataSettlementVo vo = new MerchantBasicdataSettlementVo();
                vo.setTransId(jsonObject.getString("trans_id"));
                vo.setTransDate(jsonObject.getString("trans_date"));
                vo.setCardNo(jsonObject.getString("card_no"));
                vo.setTransAmt(jsonObject.getString("trans_amt"));
                vo.setFeeAmt(jsonObject.getString("fee_amt"));
                vo.setTransStat(jsonObject.getString("trans_stat"));
                list.add(vo);
    }
            return R.ok(list);
        }
        return R.fail(resp_desc);
    }
}
ruoyi-modules/ruoyi-shop/src/main/resources/bootstrap.yml
@@ -14,20 +14,20 @@
    nacos:
      discovery:
        # 服务注册地址
        server-addr: 47.109.78.184:5000
        #server-addr: 127.0.0.1:8848
#        server-addr: 47.109.78.184:5000
        server-addr: 127.0.0.1:8848
        #pro
        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
#        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
        #dev
        #namespace: d39a744d-116f-4280-8445-0502dd1a3116
        namespace: 6857cbd9-6088-4fe8-bb58-2b516d99876f
      config:
        # 配置中心地址
        server-addr: 47.109.78.184:5000
        #server-addr: 127.0.0.1:8848
#        server-addr: 47.109.78.184:5000
        server-addr: 127.0.0.1:8848
        #pro
        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
#        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
        #dev
        #namespace: d39a744d-116f-4280-8445-0502dd1a3116
        namespace: 6857cbd9-6088-4fe8-bb58-2b516d99876f
        # 配置文件格式
        file-extension: yml
        # 共享配置
@@ -46,3 +46,5 @@
    apiV3Key: J8v9JDHKJYDHW9bdk30o2bdjy6z9mn1A
    privateKeyPath: /home/cert/apiclient_key.pem
    privateCertPath: /home/cert/apiclient_cert.pem
callback_path: http://221.182.45.100:1500
ruoyi-modules/ruoyi-shop/src/main/resources/mapper/shop/BankBranchCodeMapper.xml
New file
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.shop.mapper.shop.BankBranchCodeMapper">
    <select id="getBankList" resultType="map">
        select * from (
          select
          bank_number as `code`,
          bank_name as `name`
          from t_bank_branch_code
          where 1 = 1
          <if test="null != name and '' != name">
              and bank_name like CONCAT('%', #{name}, '%')
          </if>
          group by bank_number, bank_name
        ) as a order by a.`code`
    </select>
    <select id="getBankBranchCode" resultType="map">
        select
        correspondent_number as `code`,
        correspondent_number_name as `name`
        from t_bank_branch_code
        where bank_number = #{bankNumber} order by correspondent_number
    </select>
</mapper>
ruoyi-modules/ruoyi-shop/src/main/resources/mapper/shop/ShopAuthenticationHftxMapper.xml
New file
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.shop.mapper.shop.ShopAuthenticationHftxMapper">
</mapper>
ruoyi-modules/ruoyi-shop/src/main/resources/mapper/shop/ShopMapper.xml
@@ -579,6 +579,45 @@
        ORDER BY auditStatusSort ASC,ts.create_time DESC
    </select>
    <select id="pageMgtShopHFTXAuth" resultType="com.ruoyi.shop.domain.vo.MgtShopHFTXAuthPageVo">
        select
        a.shop_id as shopId,
        a.shop_name as shopName,
        a.shopowner_name as shopownerName,
        a.shopowner_phone as shopownerPhone,
        CASE b.type WHEN 1 THEN '个人' WHEN 2 THEN '企业' END mainType,
        CASE b.audit_status WHEN 'U' THEN '审核中' WHEN 'Y' THEN '审核通过' WHEN 'N' THEN '审核拒绝' WHEN 'F' THEN '失败' END auditStatus,
        b.audit_desc as auditDesc,
        b.share_ratio as shareRatio,
        if(b.id is null, 1, 2) as status
        from t_shop a
        left join t_shop_authentication_hftx b on (a.shop_id = b.shop_id)
        where a.del_flag = 0
        <if test="param.shopName!=null and param.shopName!=''">
            AND a.shop_name LIKE CONCAT('%',#{param.shopName},'%')
        </if>
        <if test="param.shopownerName!=null and param.shopownerName!=''">
            AND a.shopowner_name LIKE CONCAT('%',#{param.shopownerName},'%')
        </if>
        <if test="param.shopownerPhone!=null and param.shopownerPhone!=''">
            AND a.shopowner_phone LIKE CONCAT('%',#{param.shopownerPhone},'%')
        </if>
        <if test="param.mainType!=null and param.mainType!=''">
            AND b.type = #{param.mainType}
        </if>
        <if test="param.auditStatus!=null">
            AND b.audit_status = #{param.auditStatus}
        </if>
        <if test="param.shopStatus!=null and param.shopStatus!=''">
            AND a.shop_status = #{param.shopStatus}
        </if>
        ORDER BY a.create_time DESC
    </select>
    <select id="shopTotal" resultType="com.ruoyi.system.api.domain.vo.MgtBulletinBoardVo">
        SELECT
            COUNT(shop_id) AS shopTotal,
ruoyi-modules/ruoyi-shop/src/test/java/com/ruioyi/shop/shopTest.java
@@ -1,13 +1,19 @@
package com.ruioyi.shop;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.utils.uuid.IdUtils;
import com.ruoyi.shop.RuoYiShopApplication;
import com.ruoyi.shop.domain.vo.MerchantBasicdataSettlementVo;
import com.ruoyi.shop.service.task.AgencyTaskService;
import com.ruoyi.shop.util.HuiFuTianXiaUtil;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import javax.annotation.Resource;
import java.util.List;
/**
 * @ClassName systemTest
@@ -23,5 +29,10 @@
    @Resource
    private AgencyTaskService agencyTaskService;
    @Test
    public void test(){
        R r = HuiFuTianXiaUtil.weixinPayment(IdUtils.simpleUUID(), "支付测试", 0.01D, "oRett5nJInl1AsxEEwHGPBpRKwzw", "");
//        R<List<MerchantBasicdataSettlementVo>> merchantBasicdataSettlement = HuiFuTianXiaUtil.getMerchantBasicdataSettlement(IdUtils.simpleUUID(), "6666000140729384", "20231001", "20231015", "1", "10");
}
}
ruoyi-modules/ruoyi-system/src/main/resources/bootstrap.yml
@@ -18,20 +18,20 @@
    nacos:
      discovery:
        # 服务注册地址
        server-addr: 47.109.78.184:5000
        #server-addr: 127.0.0.1:8848
#        server-addr: 47.109.78.184:5000
        server-addr: 127.0.0.1:8848
        #pro
        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
#        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
        #dev
        #namespace: d39a744d-116f-4280-8445-0502dd1a3116
        namespace: 6857cbd9-6088-4fe8-bb58-2b516d99876f
      config:
        # 配置中心地址
        server-addr: 47.109.78.184:5000
        #server-addr: 127.0.0.1:8848
#        server-addr: 47.109.78.184:5000
        server-addr: 127.0.0.1:8848
        #pro
        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
#        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
        #dev
        #namespace: d39a744d-116f-4280-8445-0502dd1a3116
        namespace: 6857cbd9-6088-4fe8-bb58-2b516d99876f
        # 配置文件格式
        file-extension: yml
        # 共享配置