添加汇付支付

This commit is contained in:
韩鹏辉
2024-01-16 13:41:41 +08:00
parent ae925b0ebb
commit f930f5a274
13 changed files with 251 additions and 163 deletions

View File

@@ -1,6 +1,7 @@
package com.chaozhanggui.admin.system.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.chaozhanggui.merchant.service.HfMerService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
@@ -35,6 +36,26 @@ public class NotifyController {
return "SUCCESS";
}
@PostMapping("testFeedCallBack")
public String feedCallBack(@RequestBody JSONObject object){
log.info(object.toJSONString());
String type = object.getString("type");
//验签请参data
String data = object.getString("data");
//验签请参sign
String sign = object.getString("sign");
hfMerService.callBack(type.substring(1,type.length()-1),data.substring(1,data.length()-1),sign.substring(1,sign.length()-1));
return "SUCCESS";
}
@PostMapping("authUser")
public String authUser(@RequestParam("requestId") String requestId){
hfMerService.authInfo(requestId);
return "SUCCESS";
}
@PostMapping("merchantResident")
public String merchantResident(@RequestParam("userId") String userId){
hfMerService.merchantResident(userId,null);

View File

@@ -39,7 +39,10 @@ public class LoginInterceptor implements HandlerInterceptor {
// 获取进过拦截器的路径
String requestURI = request.getRequestURI();
if("/admin/notifyCallback/feedCallBack".equals(requestURI)||"/admin/notifyCallback/merchantResident".equals(requestURI)){
if("/admin/notifyCallback/feedCallBack".equals(requestURI)||"/admin/notifyCallback/merchantResident".equals(requestURI)
||"/admin/notifyCallback/testFeedCallBack".equals(requestURI)
||"/admin/notifyCallback/authUser".equals(requestURI)
){
return true;
}

View File

@@ -10,9 +10,9 @@ spring:
maxWait: 60000
redis:
# redis数据库索引默认为0我们使用索引为3的数据库避免和其他数据库冲突
database: 1
database: 0
# redis服务器地址默认为localhost
host: 127.0.0.1
host: 101.37.12.135
# redis端口默认为6379
port: 6379
# redis访问密码默认为空

View File

@@ -1,6 +1,6 @@
spring:
datasource:
url: jdbc:mysql://127.0.0.1:3306/ysk_test?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useJDBCCompliantTimezoneShift=true&serverTimezone=CTT&useSSL=false
url: jdbc:mysql://101.37.12.135:3306/ysk_test?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useJDBCCompliantTimezoneShift=true&serverTimezone=CTT&useSSL=false
username: ysk_test
password: mysqlroot@123
driver-class-name: com.mysql.cj.jdbc.Driver
@@ -12,7 +12,7 @@ spring:
# redis数据库索引默认为0我们使用索引为3的数据库避免和其他数据库冲突
database: 0
# redis服务器地址默认为localhost
host: 127.0.0.1
host: 101.37.12.135
# redis端口默认为6379
port: 6379
# redis访问密码默认为空
@@ -33,9 +33,9 @@ spring:
max-request-size: 30MB
hf:
account:
backUrl: http://newadminapi.sxczgkj.cn/admin/notifyCallback/feedCallBack
backUrl: https://p40312246f.goho.co/admin/notifyCallback/feedCallBack
wxLite:
appId: wxfc7bd92a462eb191
wxPub:
appId: wxfc7bd92a462eb191
path: https://ky.sxczgkj.cn/wap/api/trans/pay
path: http://admintestapi.sxczgkj.cn/wap/api/trans/pay

View File

@@ -1,6 +1,6 @@
spring:
profiles:
active: dev
active: test
server:
port: 18071
servlet:

View File

@@ -1,9 +1,11 @@
package com.chaozhanggui.common.system.config;
import com.alibaba.fastjson.JSONObject;
import com.chaozhanggui.common.system.util.ExceptionUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
import java.util.Objects;
//命名区别于ResponseBody注解
@@ -20,6 +22,8 @@ public class RespBody {
setMessage(ExceptionUtil.map.get(code));
}
public RespBody(Exception e) {
if(e.getMessage().substring(0,1).equals("!")){
setMessage(e.getMessage(),"-60009");
@@ -40,25 +44,21 @@ public class RespBody {
}
public RespBody(String code,Object data){
this.code=code;
this.data=data;
this.code = code;
this.data = data;
setMessage(ExceptionUtil.map.get(code));
}
public RespBody(String code,String message){
this.code=code;
this.message=message;
this.code = code;
this.message = message;
}
public RespBody(String code){
this.code=code;
setMessage(ExceptionUtil.map.get(code));
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
setMessage(ExceptionUtil.map.get(code));
@@ -75,7 +75,7 @@ public class RespBody {
public void setMessage(String message,String code) {
this.message = message;
this.code=code;
this.code = code;
}
public Object getData() {
@@ -85,4 +85,5 @@ public class RespBody {
public void setData(Object data) {
this.data = data;
}
}

View File

@@ -102,7 +102,6 @@ public class StringUtil extends StringUtils {
*/
public static synchronized String getBillno() {
StringBuilder billno = new StringBuilder();
// 日期(格式:20080524)
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmssSSS");
billno.append(format.format(new Date()));

View File

@@ -20,7 +20,7 @@ public interface TbPlussMerchantHfInfoMapper {
int updateByPrimaryKey(TbPlussMerchantHfInfo record);
TbPlussMerchantHfInfo selectByMerchantCodeAndSubApiKey(@Param("merchantCode") String merchantCode,@Param("liveApiKey") String liveApiKey);
TbPlussMerchantHfInfo selectByMerchantCodeAndSubApiKey(@Param("merchantCode") String merchantCode, @Param("liveApiKey") String liveApiKey);
TbPlussMerchantHfInfo selectByMerchantCode(String merchantCode);

View File

@@ -20,6 +20,10 @@ public class TbPlussMerchantHfInfo implements Serializable {
private String appName;
private String pucKey;
private String privKey;
private String loginPwd;
private Date createTime;
@@ -92,6 +96,22 @@ public class TbPlussMerchantHfInfo implements Serializable {
this.appName = appName == null ? null : appName.trim();
}
public String getPucKey() {
return pucKey;
}
public void setPucKey(String pucKey) {
this.pucKey = pucKey == null ? null : pucKey.trim();
}
public String getPrivKey() {
return privKey;
}
public void setPrivKey(String privKey) {
this.privKey = privKey == null ? null : privKey.trim();
}
public String getLoginPwd() {
return loginPwd;
}

View File

@@ -53,7 +53,7 @@
<!-- 要生成的表tableName是数据库中的表名或视图名 domainObjectName是实体类名-->
<!-- <table tableName="%" schema="mining" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" ></table>-->
<table tableName="tb_pluss_citys_hf" domainObjectName="TbPlussCitysHf"
<table tableName="tb_pluss_merchant_hf_info" domainObjectName="TbPlussMerchantHfInfo"
enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
enableSelectByExample="false" selectByExampleQueryId="false" >
</table>

View File

@@ -10,13 +10,15 @@
<result column="app_id_list" jdbcType="VARCHAR" property="appIdList" />
<result column="app_id" jdbcType="VARCHAR" property="appId" />
<result column="app_name" jdbcType="VARCHAR" property="appName" />
<result column="puc_key" jdbcType="VARCHAR" property="pucKey" />
<result column="priv_key" jdbcType="VARCHAR" property="privKey" />
<result column="login_pwd" jdbcType="VARCHAR" property="loginPwd" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
</resultMap>
<sql id="Base_Column_List">
id, merchant_code, status, test_api_key, live_api_key, app_id_list, app_id, app_name,
login_pwd, create_time, update_time
puc_key, priv_key, login_pwd, create_time, update_time
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
@@ -24,6 +26,19 @@
from tb_pluss_merchant_hf_info
where id = #{id,jdbcType=INTEGER}
</select>
<select id="selectByMerchantCodeAndSubApiKey" resultMap="BaseResultMap">
select * from tb_pluss_merchant_hf_info where merchant_code=#{merchantCode} and live_api_key=#{liveApiKey}
</select>
<select id="selectByMerchantCode" resultMap="BaseResultMap">
select * from tb_pluss_merchant_hf_info where merchant_code=#{merchantCode} order by id desc limit 1
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tb_pluss_merchant_hf_info
where id = #{id,jdbcType=INTEGER}
@@ -31,12 +46,14 @@
<insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantHfInfo">
insert into tb_pluss_merchant_hf_info (id, merchant_code, status,
test_api_key, live_api_key, app_id_list,
app_id, app_name, login_pwd,
create_time, update_time)
app_id, app_name, puc_key,
priv_key, login_pwd, create_time,
update_time)
values (#{id,jdbcType=INTEGER}, #{merchantCode,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
#{testApiKey,jdbcType=VARCHAR}, #{liveApiKey,jdbcType=VARCHAR}, #{appIdList,jdbcType=VARCHAR},
#{appId,jdbcType=VARCHAR}, #{appName,jdbcType=VARCHAR}, #{loginPwd,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
#{appId,jdbcType=VARCHAR}, #{appName,jdbcType=VARCHAR}, #{pucKey,jdbcType=VARCHAR},
#{privKey,jdbcType=VARCHAR}, #{loginPwd,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantHfInfo">
insert into tb_pluss_merchant_hf_info
@@ -65,6 +82,12 @@
<if test="appName != null">
app_name,
</if>
<if test="pucKey != null">
puc_key,
</if>
<if test="privKey != null">
priv_key,
</if>
<if test="loginPwd != null">
login_pwd,
</if>
@@ -100,6 +123,12 @@
<if test="appName != null">
#{appName,jdbcType=VARCHAR},
</if>
<if test="pucKey != null">
#{pucKey,jdbcType=VARCHAR},
</if>
<if test="privKey != null">
#{privKey,jdbcType=VARCHAR},
</if>
<if test="loginPwd != null">
#{loginPwd,jdbcType=VARCHAR},
</if>
@@ -135,6 +164,12 @@
<if test="appName != null">
app_name = #{appName,jdbcType=VARCHAR},
</if>
<if test="pucKey != null">
puc_key = #{pucKey,jdbcType=VARCHAR},
</if>
<if test="privKey != null">
priv_key = #{privKey,jdbcType=VARCHAR},
</if>
<if test="loginPwd != null">
login_pwd = #{loginPwd,jdbcType=VARCHAR},
</if>
@@ -156,17 +191,11 @@
app_id_list = #{appIdList,jdbcType=VARCHAR},
app_id = #{appId,jdbcType=VARCHAR},
app_name = #{appName,jdbcType=VARCHAR},
puc_key = #{pucKey,jdbcType=VARCHAR},
priv_key = #{privKey,jdbcType=VARCHAR},
login_pwd = #{loginPwd,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="selectByMerchantCodeAndSubApiKey" resultMap="BaseResultMap">
select * from tb_pluss_merchant_hf_info where merchant_code=#{merchantCode} and live_api_key=#{liveApiKey}
</select>
<select id="selectByMerchantCode" resultMap="BaseResultMap">
select * from tb_pluss_merchant_hf_info where merchant_code=#{merchantCode} order by id desc limit 1
</select>
</mapper>

View File

@@ -2049,6 +2049,16 @@ public class HfMerService {
tbPlussMerchantChannelStatusMapper.updateByPrimaryKeySelective(channelStatus);
}
TbPlussMerchantHfInfo hfInfo=new TbPlussMerchantHfInfo();
hfInfo.setMerchantCode(baseInfo.getMerchantcode());
hfInfo.setStatus("0");
hfInfo.setPrivKey(privateKey);
hfInfo.setPucKey(publicKey);
hfInfo.setCreateTime(new Date());
tbPlussMerchantHfInfoMapper.insert(hfInfo);
TbPlussMerchantAuditRecord merchantAuditRecord = new TbPlussMerchantAuditRecord();
merchantAuditRecord.setStatus("1");
merchantAuditRecord.setMerchantcode(baseInfo.getMerchantcode());
@@ -2072,20 +2082,22 @@ public class HfMerService {
String publicKey= AdapayCore.PUBLIC_KEY;
try {
Map map=(Map) JSON.parse(data);
// Map map=(Map) JSON.parseArray(data).get(0);
String requestId=map.get("request_id").toString();
if(AdapaySign.verifySign(data,sign,publicKey)){
// if(true){
switch (type){
case "userEntry.succeeded":
TbPlussMerchantAuditRecord record= tbPlussMerchantAuditRecordMapper.selectByApplicationid(requestId);
if(ObjectUtil.isNotEmpty(record)){
TbPlussMerchantChannelStatus channelStatus= tbPlussMerchantChannelStatusMapper.selectByMerchantCode(record.getMerchantcode(),7);
TbPlussMerchantHfInfo tbPlussMerchantHfInfo=tbPlussMerchantHfInfoMapper.selectByMerchantCodeAndSubApiKey(channelStatus.getMerchantcode(),map.get("live_api_key").toString());
TbPlussMerchantHfInfo tbPlussMerchantHfInfo=tbPlussMerchantHfInfoMapper.selectByMerchantCode(channelStatus.getMerchantcode());
if(ObjectUtil.isNotEmpty(channelStatus)){
if(ObjectUtil.isEmpty(tbPlussMerchantHfInfo)){
tbPlussMerchantHfInfo=new TbPlussMerchantHfInfo();
tbPlussMerchantHfInfo.setMerchantCode(record.getMerchantcode());
if(ObjectUtil.isNotEmpty(tbPlussMerchantHfInfo)){
tbPlussMerchantHfInfo.setTestApiKey(map.get("test_api_key").toString());
tbPlussMerchantHfInfo.setLiveApiKey(map.get("live_api_key").toString());
List app_id_list = (List) map.get("app_id_list");
@@ -2094,9 +2106,9 @@ public class HfMerService {
tbPlussMerchantHfInfo.setAppId(app.get("app_id").toString());
tbPlussMerchantHfInfo.setAppName(app.get("app_name").toString());
tbPlussMerchantHfInfo.setStatus("1"); //开户成功
tbPlussMerchantHfInfo.setLoginPwd(MD5Util.md5("hf".concat(map.get("login_pwd").toString())));
tbPlussMerchantHfInfo.setLoginPwd((map.get("login_pwd").toString()));
tbPlussMerchantHfInfo.setCreateTime(new Date());
tbPlussMerchantHfInfoMapper.insert(tbPlussMerchantHfInfo);
tbPlussMerchantHfInfoMapper.updateByPrimaryKeySelective(tbPlussMerchantHfInfo);
channelStatus.setMerchantid(map.get("live_api_key").toString());
channelStatus.setApplicationid(requestId);
@@ -2109,14 +2121,6 @@ public class HfMerService {
merchantResident(baseInfo,tbPlussMerchantHfInfo.getLiveApiKey(),tbPlussMerchantHfInfo.getAppId(),tbPlussMerchantHfInfo);
}
}
record.setStatus("9");
record.setUpdatetime(new Date());
}
}
break;
@@ -2133,122 +2137,7 @@ public class HfMerService {
}
break;
case "resident.succeeded":
record= tbPlussMerchantAuditRecordMapper.selectByApplicationid(requestId);
if(ObjectUtil.isNotEmpty(record)&&!"5".equals(record.getThirdstatus())){
TbPlussMerchantHfInfo hfInfo= tbPlussMerchantHfInfoMapper.selectByMerchantCodeAndSubApiKey(record.getMerchantcode(),record.getMerchantid());
hfInfo.setStatus("3"); //入驻成功
hfInfo.setUpdateTime(new Date());
tbPlussMerchantHfInfoMapper.updateByPrimaryKey(hfInfo);
record.setThirdstatus("5");
record.setUpdatetime(new Date());
tbPlussMerchantAuditRecordMapper.updateByPrimaryKeySelective(record);
//上传证照
TbPlussMerchantBaseInfo baseInfo= tbPlussMerchantBaseInfoMapper.selectByMerchantcode(record.getMerchantcode());
if(ObjectUtil.isNotEmpty(baseInfo)){
map=new HashMap<>();
TbPlussAccount account= tbPlussAccountMapper.selectByUser(baseInfo.getUserid(),"D1");
MsgException.checkNull(account,"结算信息未提交");
TbPlussBankCard bankCard= tbPlussBankCardMapper.selectByPrimaryKey(Integer.valueOf(account.getBankcardid()));
MsgException.checkNull(bankCard, "结算卡信息未提交");
TbPlussIdCard idCard=tbPlussIdCardMapper.selectCertByUserId(baseInfo.getUserid(),baseInfo.getMerchanttype().equals("3")?"03":"01");
MsgException.checkNull(idCard, "商户基本信息不完整");
Map<String,Object> f=HfMerService.fileUpload(idCard.getImgpositive(),"03",record.getMerchantid());
if(ObjectUtil.isNotEmpty(f)&&"succeeded".equals(f.get("status"))){
map.put("legalCertIdBackId",f.get("pic_id"));
}
Map<String,Object> z=HfMerService.fileUpload(idCard.getImgnegative(),"02",record.getMerchantid());
if(ObjectUtil.isNotEmpty(z)&&"succeeded".equals(z.get("status"))){
map.put("legalCertIdFrontId",z.get("pic_id"));
}
Map<String,Object> cz=null;
Map<String,Object> yyzz=null;
if(baseInfo.getMerchanttype().equals("3")){
TbPlussMerchantImage image= tbPlussMerchantImageMapper.selectByMerchantCodeType(baseInfo.getMerchantcode(),"03");
MsgException.checkNull(image, "营业执照不存在");
yyzz= HfMerService.fileUpload(idCard.getImgpositive(),"02",record.getMerchantid());
if(ObjectUtil.isNotEmpty(yyzz)&&"succeeded".equals(yyzz.get("status"))){
map.put("socialCreditCodeId",yyzz.get("pic_id"));
}
cz=HfMerService.fileUpload(bankCard.getLicenseurl(),"05",record.getMerchantid());
yyzz=HfMerService.fileUpload(image.getPicUrl1(),"01",record.getMerchantid());
}else {
cz=HfMerService.fileUpload(bankCard.getImgurl(),"05",record.getMerchantid());
StringBuffer sb=new StringBuffer();
TbPlussMerchantImage image =tbPlussMerchantImageMapper.selectByMerchantCodeType(baseInfo.getMerchantcode(),"06");
MsgException.checkNull(image, "门头照片不存在");
Map<String,Object> mtz=HfMerService.fileUpload(image.getPicurl(),"04",record.getMerchantid());
if(ObjectUtil.isNotEmpty(mtz)&&"succeeded".equals(mtz.get("status"))){
sb.append(mtz.get("pic_id"));
}
image =tbPlussMerchantImageMapper.selectByMerchantCodeType(baseInfo.getMerchantcode(),"09");
MsgException.checkNull(image, "商铺内部照片不存在");
Map<String,Object> mtzz=HfMerService.fileUpload(image.getPicurl(),"04",record.getMerchantid());
if(ObjectUtil.isNotEmpty(mtzz)&&"succeeded".equals(mtzz.get("status"))){
sb.append("|");
sb.append(mtzz.get("pic_id"));
}
image =tbPlussMerchantImageMapper.selectByMerchantCodeType(baseInfo.getMerchantcode(),"08");
MsgException.checkNull(image, "收银台照片不存在");
Map<String,Object> mtzzzz=HfMerService.fileUpload(image.getPicurl(),"04",record.getMerchantid());
if(ObjectUtil.isNotEmpty(mtzzzz)&&"succeeded".equals(mtzzzz.get("status"))){
sb.append("|");
sb.append(mtzzzz.get("pic_id"));
}
if(ObjectUtil.isNotEmpty(sb)){
map.put("storeId",sb.toString());
}
}
if(ObjectUtil.isNotEmpty(cz)&&"succeeded".equals(cz.get("status"))){
map.put("accountOpeningPermitId",cz.get("pic_id"));
}
if(ObjectUtil.isNotEmpty(yyzz)&&"succeeded".equals(yyzz.get("status"))){
map.put("socialCreditCodeId",yyzz.get("pic_id"));
}
log.info("request:{}",JSON.toJSONString(map));
Map<String,Object> response= commitUpload(map,record.getMerchantid());
if(ObjectUtil.isNotEmpty(response)&&(response.get("audit_status").equals("I")&&"p".equals(response.get("audit_status")))){
hfInfo.setStatus("4"); //商户证照一提交
hfInfo.setUpdateTime(new Date());
tbPlussMerchantHfInfoMapper.updateByPrimaryKey(hfInfo);
record.setThirdstatus("5");
record.setUpdatetime(new Date());
tbPlussMerchantAuditRecordMapper.updateByPrimaryKeySelective(record);
// if(response.get("audit_status").equals("P")){
// //提交实名
// }
}
}
}
authInfo(requestId);
break;
case "resident.failed":
record= tbPlussMerchantAuditRecordMapper.selectByApplicationid(requestId);
@@ -2280,6 +2169,129 @@ public class HfMerService {
}
public void authInfo(String requestId){
TbPlussMerchantAuditRecord record= tbPlussMerchantAuditRecordMapper.selectByApplicationid(requestId);
if(ObjectUtil.isNotEmpty(record)){
TbPlussMerchantChannelStatus channelStatus= tbPlussMerchantChannelStatusMapper.selectByMerchantCode(record.getMerchantcode(),7);
TbPlussMerchantHfInfo hfInfo= tbPlussMerchantHfInfoMapper.selectByMerchantCodeAndSubApiKey(record.getMerchantcode(),record.getMerchantid());
hfInfo.setStatus("3"); //入驻成功
hfInfo.setUpdateTime(new Date());
tbPlussMerchantHfInfoMapper.updateByPrimaryKey(hfInfo);
record.setThirdstatus("5");
record.setUpdatetime(new Date());
tbPlussMerchantAuditRecordMapper.updateByPrimaryKeySelective(record);
channelStatus.setStatus("3");
channelStatus.setStatus("00");
channelStatus.setMercname(null);
tbPlussMerchantChannelStatusMapper.updateByPrimaryKeySelective(channelStatus);
Map map=null;
//上传证照
TbPlussMerchantBaseInfo baseInfo= tbPlussMerchantBaseInfoMapper.selectByMerchantcode(record.getMerchantcode());
if(ObjectUtil.isNotEmpty(baseInfo)){
map=new HashMap<>();
TbPlussAccount account= tbPlussAccountMapper.selectByUser(baseInfo.getUserid(),"D1");
MsgException.checkNull(account,"结算信息未提交");
TbPlussBankCard bankCard= tbPlussBankCardMapper.selectByPrimaryKey(Integer.valueOf(account.getBankcardid()));
MsgException.checkNull(bankCard, "结算卡信息未提交");
TbPlussIdCard idCard=tbPlussIdCardMapper.selectCertByUserId(baseInfo.getUserid(),baseInfo.getMerchanttype().equals("3")?"03":"01");
MsgException.checkNull(idCard, "商户基本信息不完整");
Map<String,Object> f=HfMerService.fileUpload(idCard.getImgpositive(),"03",record.getMerchantid());
if(ObjectUtil.isNotEmpty(f)&&"succeeded".equals(f.get("status"))){
map.put("legalCertIdBackId",f.get("pic_id"));
}
Map<String,Object> z=HfMerService.fileUpload(idCard.getImgnegative(),"02",record.getMerchantid());
if(ObjectUtil.isNotEmpty(z)&&"succeeded".equals(z.get("status"))){
map.put("legalCertIdFrontId",z.get("pic_id"));
}
Map<String,Object> cz=null;
Map<String,Object> yyzz=null;
if(baseInfo.getMerchanttype().equals("3")){
TbPlussMerchantImage image= tbPlussMerchantImageMapper.selectByMerchantCodeType(baseInfo.getMerchantcode(),"03");
MsgException.checkNull(image, "营业执照不存在");
yyzz= HfMerService.fileUpload(idCard.getImgpositive(),"02",record.getMerchantid());
if(ObjectUtil.isNotEmpty(yyzz)&&"succeeded".equals(yyzz.get("status"))){
map.put("socialCreditCodeId",yyzz.get("pic_id"));
}
cz=HfMerService.fileUpload(bankCard.getLicenseurl(),"05",record.getMerchantid());
yyzz=HfMerService.fileUpload(image.getPicUrl1(),"01",record.getMerchantid());
}else {
cz=HfMerService.fileUpload(bankCard.getImgurl(),"05",record.getMerchantid());
StringBuffer sb=new StringBuffer();
TbPlussMerchantImage image =tbPlussMerchantImageMapper.selectByMerchantCodeType(baseInfo.getMerchantcode(),"06");
MsgException.checkNull(image, "门头照片不存在");
Map<String,Object> mtz=HfMerService.fileUpload(image.getPicurl(),"04",record.getMerchantid());
if(ObjectUtil.isNotEmpty(mtz)&&"succeeded".equals(mtz.get("status"))){
sb.append(mtz.get("pic_id"));
}
image =tbPlussMerchantImageMapper.selectByMerchantCodeType(baseInfo.getMerchantcode(),"09");
MsgException.checkNull(image, "商铺内部照片不存在");
Map<String,Object> mtzz=HfMerService.fileUpload(image.getPicurl(),"04",record.getMerchantid());
if(ObjectUtil.isNotEmpty(mtzz)&&"succeeded".equals(mtzz.get("status"))){
sb.append("|");
sb.append(mtzz.get("pic_id"));
}
image =tbPlussMerchantImageMapper.selectByMerchantCodeType(baseInfo.getMerchantcode(),"08");
MsgException.checkNull(image, "收银台照片不存在");
Map<String,Object> mtzzzz=HfMerService.fileUpload(image.getPicurl(),"04",record.getMerchantid());
if(ObjectUtil.isNotEmpty(mtzzzz)&&"succeeded".equals(mtzzzz.get("status"))){
sb.append("|");
sb.append(mtzzzz.get("pic_id"));
}
if(ObjectUtil.isNotEmpty(sb)){
map.put("storeId",sb.toString());
}
}
if(ObjectUtil.isNotEmpty(cz)&&"succeeded".equals(cz.get("status"))){
map.put("accountOpeningPermitId",cz.get("pic_id"));
}
if(ObjectUtil.isNotEmpty(yyzz)&&"succeeded".equals(yyzz.get("status"))){
map.put("socialCreditCodeId",yyzz.get("pic_id"));
}
log.info("request:{}",JSON.toJSONString(map));
Map<String,Object> response= commitUpload(map,record.getMerchantid());
if(ObjectUtil.isNotEmpty(response)&&(response.get("audit_status").equals("I")&&"p".equals(response.get("audit_status")))){
hfInfo.setStatus("4"); //商户证照一提交
hfInfo.setUpdateTime(new Date());
tbPlussMerchantHfInfoMapper.updateByPrimaryKey(hfInfo);
record.setThirdstatus("5");
record.setUpdatetime(new Date());
tbPlussMerchantAuditRecordMapper.updateByPrimaryKeySelective(record);
}
}
}
}
// public void authUser(){

View File

@@ -90,6 +90,9 @@ public class RSAUtils {
return outStr;
}
public static void main(String[] args) throws Exception {
long temp = System.currentTimeMillis();
//生成公钥和私钥