@@ -1,19 +1,14 @@
package com.chaozhanggui.merchant.service ;
package com.chaozhanggui.merchant.service ;
import cn.hutool.core.io.FileUtil ;
import cn.hutool.core.util.ObjectUtil ;
import cn.hutool.core.util.ObjectUtil ;
import cn.hutool.http.HttpRequest ;
import com.alibaba.fastjson.JSON ;
import com.alibaba.fastjson.JSON ;
import com.alibaba.fastjson.JSONArray ;
import com.alibaba.fastjson.JSONObject ;
import com.chaozhanggui.common.system.config.MsgException ;
import com.chaozhanggui.common.system.config.MsgException ;
import com.chaozhanggui.common.system.util.MD5Util ;
import com.chaozhanggui.common.system.util.MD5Util ;
import com.chaozhanggui.dao.system.dao.* ;
import com.chaozhanggui.dao.system.dao.* ;
import com.chaozhanggui.dao.system.entity.* ;
import com.chaozhanggui.dao.system.entity.* ;
import com.chaozhanggui.merchant.util.RSAUtils ;
import com.chaozhanggui.merchant.util.RSAUtils ;
import com.chaozhanggui.merchant.util.SnowFlakeUtil ;
import com.chaozhanggui.merchant.util.SnowFlakeUtil ;
import com.fasterxml.jackson.databind.ObjectMapper ;
import com.huifu.adapay.Adapay ;
import com.huifu.adapay.Adapay ;
import com.huifu.adapay.core.AdapayCore ;
import com.huifu.adapay.core.AdapayCore ;
import com.huifu.adapay.core.exception.BaseAdaPayException ;
import com.huifu.adapay.core.exception.BaseAdaPayException ;
@@ -25,6 +20,7 @@ import com.huifu.adapay.merchant.model.MerchantResident;
import lombok.SneakyThrows ;
import lombok.SneakyThrows ;
import lombok.extern.slf4j.Slf4j ;
import lombok.extern.slf4j.Slf4j ;
import org.springframework.beans.factory.annotation.Autowired ;
import org.springframework.beans.factory.annotation.Autowired ;
import org.springframework.beans.factory.annotation.Value ;
import org.springframework.http.HttpMethod ;
import org.springframework.http.HttpMethod ;
import org.springframework.http.ResponseEntity ;
import org.springframework.http.ResponseEntity ;
import org.springframework.mock.web.MockMultipartFile ;
import org.springframework.mock.web.MockMultipartFile ;
@@ -89,6 +85,20 @@ public class HfMerService {
TbPlussMerchantImageMapper tbPlussMerchantImageMapper ;
TbPlussMerchantImageMapper tbPlussMerchantImageMapper ;
@Value ( " ${hf.account.backUrl} " )
private String backUrl ;
@Value ( " ${hf.account.wxLite.appId} " )
private String wxLiteAppId ;
@Value ( " ${hf.account.wxPub.appId} " )
private String wxPubAppId ;
@Value ( " ${hf.account.wxPub.path} " )
private String wxPubPath ;
private static List < Prov > provList = null ;
private static List < Prov > provList = null ;
@@ -1971,7 +1981,7 @@ public class HfMerService {
merchantEntryParams . put ( " rsa_public_key " , keyMap . get ( 0 ) ) ; //商户RSA公钥
merchantEntryParams . put ( " rsa_public_key " , keyMap . get ( 0 ) ) ; //商户RSA公钥
merchantEntryParams . put ( " entry_mer_type " , baseInfo . getMerchanttype ( ) . equals ( " 3 " ) ? " 1 " : " 2 " ) ; //1-企业; 2-小微。默认为企业
merchantEntryParams . put ( " entry_mer_type " , baseInfo . getMerchanttype ( ) . equals ( " 3 " ) ? " 1 " : " 2 " ) ; //1-企业; 2-小微。默认为企业
merchantEntryParams . put ( " notify_url " , " https://p40312246f.goho.co/admin/notifyCallback/feedCallBack " ) ;
merchantEntryParams . put ( " notify_url " , backUrl ) ;
merchantEntryParams . put ( " fee_rate_list " , " [{ \ n " +
merchantEntryParams . put ( " fee_rate_list " , " [{ \ n " +
" \" rate_channel \" : \" wx_pub_online \" , \ n " +
" \" rate_channel \" : \" wx_pub_online \" , \ n " +
" \" fee_rate \" : \" 0.007 \" \ n " +
" \" fee_rate \" : \" 0.007 \" \ n " +
@@ -2202,7 +2212,7 @@ public class HfMerService {
image = tbPlussMerchantImageMapper . selectByMerchantCodeType ( baseInfo . getMerchantcode ( ) , " 08 " ) ;
image = tbPlussMerchantImageMapper . selectByMerchantCodeType ( baseInfo . getMerchantcode ( ) , " 08 " ) ;
MsgException . checkNull ( image , " 收银台照片不存在 " ) ;
MsgException . checkNull ( image , " 收银台照片不存在 " ) ;
Map < String , Object > mtzzzz = HfMerService . fileUpload ( idCard . getImgnegative ( ) , " 04 " , record . getMerchantid ( ) ) ;
Map < String , Object > mtzzzz = HfMerService . fileUpload ( image . getPicurl ( ) , " 04 " , record . getMerchantid ( ) ) ;
if ( ObjectUtil . isNotEmpty ( mtzzzz ) & & " succeeded " . equals ( mtzzzz . get ( " status " ) ) ) {
if ( ObjectUtil . isNotEmpty ( mtzzzz ) & & " succeeded " . equals ( mtzzzz . get ( " status " ) ) ) {
sb . append ( " | " ) ;
sb . append ( " | " ) ;
sb . append ( mtzzzz . get ( " pic_id " ) ) ;
sb . append ( mtzzzz . get ( " pic_id " ) ) ;
@@ -2333,8 +2343,8 @@ public class HfMerService {
TbPlussCitysHf district_code = tbPlussCitysHfMapper . selectByCodeAndParentCode ( baseInfo . getDistrict ( ) , city . getCityCode ( ) ) ;
TbPlussCitysHf district_code = tbPlussCitysHfMapper . selectByCodeAndParentCode ( baseInfo . getDistrict ( ) , city . getCityCode ( ) ) ;
merchantEntryParams . put ( " district_code " , district_code . getCityCode ( ) ) ; //区县编码 黄埔310101
merchantEntryParams . put ( " district_code " , district_code . getCityCode ( ) ) ; //区县编码 黄埔310101
merchantEntryParams . put ( " add_value_list " , " { \" wx_lite \" :{ \" appid \" : \" wxfc7bd92a462eb191 \" }, \" wx_scan \" : \" \" , \" alipay \" : \" \" , \" alipay_wap \" : \" \" , \" alipay_lite \" : \" \" , \" alipay_qr \" : \" \" , \" alipay_scan \" : \" \" } " ) ;
merchantEntryParams . put ( " add_value_list " , " { \" wx_lite \" :{ \" appid \" : \" " + wxLiteAppId + " \" }, \" wx_pub \" :{ \" appid \" : \" " + wxPubAppId + " \" , \" path \" : \" " + wxPubPath + " \" }, \" wx_scan \" : \" \" , \" alipay \" : \" \" , \" alipay_wap \" : \" \" , \" alipay_lite \" : \" \" , \" alipay_qr \" : \" \" , \" alipay_scan \" : \" \" } " ) ;
merchantEntryParams . put ( " notify_url " , " https://p40312246f.goho.co/admin/notifyCallback/feedCallBack " ) ;
merchantEntryParams . put ( " notify_url " , backUrl ) ;
//调用sdk商户配置方法, 得到商户配置返回对象
//调用sdk商户配置方法, 得到商户配置返回对象
Map < String , Object > merchantResident = null ;
Map < String , Object > merchantResident = null ;