添加汇付支付
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package com.chaozhanggui.admin.system.controller;
|
package com.chaozhanggui.admin.system.controller;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.chaozhanggui.merchant.service.HfMerService;
|
import com.chaozhanggui.merchant.service.HfMerService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
@@ -35,6 +36,26 @@ public class NotifyController {
|
|||||||
return "SUCCESS";
|
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")
|
@PostMapping("merchantResident")
|
||||||
public String merchantResident(@RequestParam("userId") String userId){
|
public String merchantResident(@RequestParam("userId") String userId){
|
||||||
hfMerService.merchantResident(userId,null);
|
hfMerService.merchantResident(userId,null);
|
||||||
|
|||||||
@@ -39,7 +39,10 @@ public class LoginInterceptor implements HandlerInterceptor {
|
|||||||
// 获取进过拦截器的路径
|
// 获取进过拦截器的路径
|
||||||
String requestURI = request.getRequestURI();
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ spring:
|
|||||||
maxWait: 60000
|
maxWait: 60000
|
||||||
redis:
|
redis:
|
||||||
# redis数据库索引(默认为0),我们使用索引为3的数据库,避免和其他数据库冲突
|
# redis数据库索引(默认为0),我们使用索引为3的数据库,避免和其他数据库冲突
|
||||||
database: 1
|
database: 0
|
||||||
# redis服务器地址(默认为localhost)
|
# redis服务器地址(默认为localhost)
|
||||||
host: 127.0.0.1
|
host: 101.37.12.135
|
||||||
# redis端口(默认为6379)
|
# redis端口(默认为6379)
|
||||||
port: 6379
|
port: 6379
|
||||||
# redis访问密码(默认为空)
|
# redis访问密码(默认为空)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
spring:
|
spring:
|
||||||
datasource:
|
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
|
username: ysk_test
|
||||||
password: mysqlroot@123
|
password: mysqlroot@123
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
@@ -12,7 +12,7 @@ spring:
|
|||||||
# redis数据库索引(默认为0),我们使用索引为3的数据库,避免和其他数据库冲突
|
# redis数据库索引(默认为0),我们使用索引为3的数据库,避免和其他数据库冲突
|
||||||
database: 0
|
database: 0
|
||||||
# redis服务器地址(默认为localhost)
|
# redis服务器地址(默认为localhost)
|
||||||
host: 127.0.0.1
|
host: 101.37.12.135
|
||||||
# redis端口(默认为6379)
|
# redis端口(默认为6379)
|
||||||
port: 6379
|
port: 6379
|
||||||
# redis访问密码(默认为空)
|
# redis访问密码(默认为空)
|
||||||
@@ -33,9 +33,9 @@ spring:
|
|||||||
max-request-size: 30MB
|
max-request-size: 30MB
|
||||||
hf:
|
hf:
|
||||||
account:
|
account:
|
||||||
backUrl: http://newadminapi.sxczgkj.cn/admin/notifyCallback/feedCallBack
|
backUrl: https://p40312246f.goho.co/admin/notifyCallback/feedCallBack
|
||||||
wxLite:
|
wxLite:
|
||||||
appId: wxfc7bd92a462eb191
|
appId: wxfc7bd92a462eb191
|
||||||
wxPub:
|
wxPub:
|
||||||
appId: wxfc7bd92a462eb191
|
appId: wxfc7bd92a462eb191
|
||||||
path: https://ky.sxczgkj.cn/wap/api/trans/pay
|
path: http://admintestapi.sxczgkj.cn/wap/api/trans/pay
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
spring:
|
spring:
|
||||||
profiles:
|
profiles:
|
||||||
active: dev
|
active: test
|
||||||
server:
|
server:
|
||||||
port: 18071
|
port: 18071
|
||||||
servlet:
|
servlet:
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
package com.chaozhanggui.common.system.config;
|
package com.chaozhanggui.common.system.config;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.chaozhanggui.common.system.util.ExceptionUtil;
|
import com.chaozhanggui.common.system.util.ExceptionUtil;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
//命名区别于ResponseBody注解
|
//命名区别于ResponseBody注解
|
||||||
@@ -20,6 +22,8 @@ public class RespBody {
|
|||||||
setMessage(ExceptionUtil.map.get(code));
|
setMessage(ExceptionUtil.map.get(code));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public RespBody(Exception e) {
|
public RespBody(Exception e) {
|
||||||
if(e.getMessage().substring(0,1).equals("!")){
|
if(e.getMessage().substring(0,1).equals("!")){
|
||||||
setMessage(e.getMessage(),"-60009");
|
setMessage(e.getMessage(),"-60009");
|
||||||
@@ -40,25 +44,21 @@ public class RespBody {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public RespBody(String code,Object data){
|
public RespBody(String code,Object data){
|
||||||
this.code=code;
|
this.code = code;
|
||||||
this.data=data;
|
this.data = data;
|
||||||
setMessage(ExceptionUtil.map.get(code));
|
setMessage(ExceptionUtil.map.get(code));
|
||||||
}
|
}
|
||||||
|
|
||||||
public RespBody(String code,String message){
|
public RespBody(String code,String message){
|
||||||
this.code=code;
|
this.code = code;
|
||||||
this.message=message;
|
this.message = message;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RespBody(String code){
|
public RespBody(String code){
|
||||||
this.code=code;
|
this.code=code;
|
||||||
setMessage(ExceptionUtil.map.get(code));
|
setMessage(ExceptionUtil.map.get(code));
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCode() {
|
public String getCode() {
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCode(String code) {
|
public void setCode(String code) {
|
||||||
this.code = code;
|
this.code = code;
|
||||||
setMessage(ExceptionUtil.map.get(code));
|
setMessage(ExceptionUtil.map.get(code));
|
||||||
@@ -75,7 +75,7 @@ public class RespBody {
|
|||||||
|
|
||||||
public void setMessage(String message,String code) {
|
public void setMessage(String message,String code) {
|
||||||
this.message = message;
|
this.message = message;
|
||||||
this.code=code;
|
this.code = code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object getData() {
|
public Object getData() {
|
||||||
@@ -85,4 +85,5 @@ public class RespBody {
|
|||||||
public void setData(Object data) {
|
public void setData(Object data) {
|
||||||
this.data = data;
|
this.data = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,7 +102,6 @@ public class StringUtil extends StringUtils {
|
|||||||
*/
|
*/
|
||||||
public static synchronized String getBillno() {
|
public static synchronized String getBillno() {
|
||||||
StringBuilder billno = new StringBuilder();
|
StringBuilder billno = new StringBuilder();
|
||||||
|
|
||||||
// 日期(格式:20080524)
|
// 日期(格式:20080524)
|
||||||
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmssSSS");
|
SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmssSSS");
|
||||||
billno.append(format.format(new Date()));
|
billno.append(format.format(new Date()));
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ public interface TbPlussMerchantHfInfoMapper {
|
|||||||
|
|
||||||
int updateByPrimaryKey(TbPlussMerchantHfInfo record);
|
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);
|
TbPlussMerchantHfInfo selectByMerchantCode(String merchantCode);
|
||||||
|
|||||||
@@ -20,6 +20,10 @@ public class TbPlussMerchantHfInfo implements Serializable {
|
|||||||
|
|
||||||
private String appName;
|
private String appName;
|
||||||
|
|
||||||
|
private String pucKey;
|
||||||
|
|
||||||
|
private String privKey;
|
||||||
|
|
||||||
private String loginPwd;
|
private String loginPwd;
|
||||||
|
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
@@ -92,6 +96,22 @@ public class TbPlussMerchantHfInfo implements Serializable {
|
|||||||
this.appName = appName == null ? null : appName.trim();
|
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() {
|
public String getLoginPwd() {
|
||||||
return loginPwd;
|
return loginPwd;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@
|
|||||||
|
|
||||||
<!-- 要生成的表tableName是数据库中的表名或视图名 domainObjectName是实体类名-->
|
<!-- 要生成的表tableName是数据库中的表名或视图名 domainObjectName是实体类名-->
|
||||||
<!-- <table tableName="%" schema="mining" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" ></table>-->
|
<!-- <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"
|
enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false"
|
||||||
enableSelectByExample="false" selectByExampleQueryId="false" >
|
enableSelectByExample="false" selectByExampleQueryId="false" >
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -10,13 +10,15 @@
|
|||||||
<result column="app_id_list" jdbcType="VARCHAR" property="appIdList" />
|
<result column="app_id_list" jdbcType="VARCHAR" property="appIdList" />
|
||||||
<result column="app_id" jdbcType="VARCHAR" property="appId" />
|
<result column="app_id" jdbcType="VARCHAR" property="appId" />
|
||||||
<result column="app_name" jdbcType="VARCHAR" property="appName" />
|
<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="login_pwd" jdbcType="VARCHAR" property="loginPwd" />
|
||||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<sql id="Base_Column_List">
|
<sql id="Base_Column_List">
|
||||||
id, merchant_code, status, test_api_key, live_api_key, app_id_list, app_id, app_name,
|
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>
|
</sql>
|
||||||
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||||
select
|
select
|
||||||
@@ -24,6 +26,19 @@
|
|||||||
from tb_pluss_merchant_hf_info
|
from tb_pluss_merchant_hf_info
|
||||||
where id = #{id,jdbcType=INTEGER}
|
where id = #{id,jdbcType=INTEGER}
|
||||||
</select>
|
</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 id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
||||||
delete from tb_pluss_merchant_hf_info
|
delete from tb_pluss_merchant_hf_info
|
||||||
where id = #{id,jdbcType=INTEGER}
|
where id = #{id,jdbcType=INTEGER}
|
||||||
@@ -31,12 +46,14 @@
|
|||||||
<insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantHfInfo">
|
<insert id="insert" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantHfInfo">
|
||||||
insert into tb_pluss_merchant_hf_info (id, merchant_code, status,
|
insert into tb_pluss_merchant_hf_info (id, merchant_code, status,
|
||||||
test_api_key, live_api_key, app_id_list,
|
test_api_key, live_api_key, app_id_list,
|
||||||
app_id, app_name, login_pwd,
|
app_id, app_name, puc_key,
|
||||||
create_time, update_time)
|
priv_key, login_pwd, create_time,
|
||||||
|
update_time)
|
||||||
values (#{id,jdbcType=INTEGER}, #{merchantCode,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
|
values (#{id,jdbcType=INTEGER}, #{merchantCode,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
|
||||||
#{testApiKey,jdbcType=VARCHAR}, #{liveApiKey,jdbcType=VARCHAR}, #{appIdList,jdbcType=VARCHAR},
|
#{testApiKey,jdbcType=VARCHAR}, #{liveApiKey,jdbcType=VARCHAR}, #{appIdList,jdbcType=VARCHAR},
|
||||||
#{appId,jdbcType=VARCHAR}, #{appName,jdbcType=VARCHAR}, #{loginPwd,jdbcType=VARCHAR},
|
#{appId,jdbcType=VARCHAR}, #{appName,jdbcType=VARCHAR}, #{pucKey,jdbcType=VARCHAR},
|
||||||
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
|
#{privKey,jdbcType=VARCHAR}, #{loginPwd,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
|
||||||
|
#{updateTime,jdbcType=TIMESTAMP})
|
||||||
</insert>
|
</insert>
|
||||||
<insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantHfInfo">
|
<insert id="insertSelective" parameterType="com.chaozhanggui.dao.system.entity.TbPlussMerchantHfInfo">
|
||||||
insert into tb_pluss_merchant_hf_info
|
insert into tb_pluss_merchant_hf_info
|
||||||
@@ -65,6 +82,12 @@
|
|||||||
<if test="appName != null">
|
<if test="appName != null">
|
||||||
app_name,
|
app_name,
|
||||||
</if>
|
</if>
|
||||||
|
<if test="pucKey != null">
|
||||||
|
puc_key,
|
||||||
|
</if>
|
||||||
|
<if test="privKey != null">
|
||||||
|
priv_key,
|
||||||
|
</if>
|
||||||
<if test="loginPwd != null">
|
<if test="loginPwd != null">
|
||||||
login_pwd,
|
login_pwd,
|
||||||
</if>
|
</if>
|
||||||
@@ -100,6 +123,12 @@
|
|||||||
<if test="appName != null">
|
<if test="appName != null">
|
||||||
#{appName,jdbcType=VARCHAR},
|
#{appName,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
|
<if test="pucKey != null">
|
||||||
|
#{pucKey,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
|
<if test="privKey != null">
|
||||||
|
#{privKey,jdbcType=VARCHAR},
|
||||||
|
</if>
|
||||||
<if test="loginPwd != null">
|
<if test="loginPwd != null">
|
||||||
#{loginPwd,jdbcType=VARCHAR},
|
#{loginPwd,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
@@ -135,6 +164,12 @@
|
|||||||
<if test="appName != null">
|
<if test="appName != null">
|
||||||
app_name = #{appName,jdbcType=VARCHAR},
|
app_name = #{appName,jdbcType=VARCHAR},
|
||||||
</if>
|
</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">
|
<if test="loginPwd != null">
|
||||||
login_pwd = #{loginPwd,jdbcType=VARCHAR},
|
login_pwd = #{loginPwd,jdbcType=VARCHAR},
|
||||||
</if>
|
</if>
|
||||||
@@ -156,17 +191,11 @@
|
|||||||
app_id_list = #{appIdList,jdbcType=VARCHAR},
|
app_id_list = #{appIdList,jdbcType=VARCHAR},
|
||||||
app_id = #{appId,jdbcType=VARCHAR},
|
app_id = #{appId,jdbcType=VARCHAR},
|
||||||
app_name = #{appName,jdbcType=VARCHAR},
|
app_name = #{appName,jdbcType=VARCHAR},
|
||||||
|
puc_key = #{pucKey,jdbcType=VARCHAR},
|
||||||
|
priv_key = #{privKey,jdbcType=VARCHAR},
|
||||||
login_pwd = #{loginPwd,jdbcType=VARCHAR},
|
login_pwd = #{loginPwd,jdbcType=VARCHAR},
|
||||||
create_time = #{createTime,jdbcType=TIMESTAMP},
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
||||||
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
update_time = #{updateTime,jdbcType=TIMESTAMP}
|
||||||
where id = #{id,jdbcType=INTEGER}
|
where id = #{id,jdbcType=INTEGER}
|
||||||
</update>
|
</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>
|
</mapper>
|
||||||
@@ -2049,6 +2049,16 @@ public class HfMerService {
|
|||||||
tbPlussMerchantChannelStatusMapper.updateByPrimaryKeySelective(channelStatus);
|
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();
|
TbPlussMerchantAuditRecord merchantAuditRecord = new TbPlussMerchantAuditRecord();
|
||||||
merchantAuditRecord.setStatus("1");
|
merchantAuditRecord.setStatus("1");
|
||||||
merchantAuditRecord.setMerchantcode(baseInfo.getMerchantcode());
|
merchantAuditRecord.setMerchantcode(baseInfo.getMerchantcode());
|
||||||
@@ -2072,20 +2082,22 @@ public class HfMerService {
|
|||||||
String publicKey= AdapayCore.PUBLIC_KEY;
|
String publicKey= AdapayCore.PUBLIC_KEY;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
Map map=(Map) JSON.parse(data);
|
Map map=(Map) JSON.parse(data);
|
||||||
|
// Map map=(Map) JSON.parseArray(data).get(0);
|
||||||
|
|
||||||
|
|
||||||
String requestId=map.get("request_id").toString();
|
String requestId=map.get("request_id").toString();
|
||||||
if(AdapaySign.verifySign(data,sign,publicKey)){
|
if(AdapaySign.verifySign(data,sign,publicKey)){
|
||||||
|
// if(true){
|
||||||
switch (type){
|
switch (type){
|
||||||
case "userEntry.succeeded":
|
case "userEntry.succeeded":
|
||||||
TbPlussMerchantAuditRecord record= tbPlussMerchantAuditRecordMapper.selectByApplicationid(requestId);
|
TbPlussMerchantAuditRecord record= tbPlussMerchantAuditRecordMapper.selectByApplicationid(requestId);
|
||||||
if(ObjectUtil.isNotEmpty(record)){
|
if(ObjectUtil.isNotEmpty(record)){
|
||||||
TbPlussMerchantChannelStatus channelStatus= tbPlussMerchantChannelStatusMapper.selectByMerchantCode(record.getMerchantcode(),7);
|
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.isNotEmpty(channelStatus)){
|
||||||
if(ObjectUtil.isEmpty(tbPlussMerchantHfInfo)){
|
if(ObjectUtil.isNotEmpty(tbPlussMerchantHfInfo)){
|
||||||
tbPlussMerchantHfInfo=new TbPlussMerchantHfInfo();
|
|
||||||
tbPlussMerchantHfInfo.setMerchantCode(record.getMerchantcode());
|
|
||||||
tbPlussMerchantHfInfo.setTestApiKey(map.get("test_api_key").toString());
|
tbPlussMerchantHfInfo.setTestApiKey(map.get("test_api_key").toString());
|
||||||
tbPlussMerchantHfInfo.setLiveApiKey(map.get("live_api_key").toString());
|
tbPlussMerchantHfInfo.setLiveApiKey(map.get("live_api_key").toString());
|
||||||
List app_id_list = (List) map.get("app_id_list");
|
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.setAppId(app.get("app_id").toString());
|
||||||
tbPlussMerchantHfInfo.setAppName(app.get("app_name").toString());
|
tbPlussMerchantHfInfo.setAppName(app.get("app_name").toString());
|
||||||
tbPlussMerchantHfInfo.setStatus("1"); //开户成功
|
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());
|
tbPlussMerchantHfInfo.setCreateTime(new Date());
|
||||||
tbPlussMerchantHfInfoMapper.insert(tbPlussMerchantHfInfo);
|
tbPlussMerchantHfInfoMapper.updateByPrimaryKeySelective(tbPlussMerchantHfInfo);
|
||||||
|
|
||||||
channelStatus.setMerchantid(map.get("live_api_key").toString());
|
channelStatus.setMerchantid(map.get("live_api_key").toString());
|
||||||
channelStatus.setApplicationid(requestId);
|
channelStatus.setApplicationid(requestId);
|
||||||
@@ -2109,14 +2121,6 @@ public class HfMerService {
|
|||||||
merchantResident(baseInfo,tbPlussMerchantHfInfo.getLiveApiKey(),tbPlussMerchantHfInfo.getAppId(),tbPlussMerchantHfInfo);
|
merchantResident(baseInfo,tbPlussMerchantHfInfo.getLiveApiKey(),tbPlussMerchantHfInfo.getAppId(),tbPlussMerchantHfInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
record.setStatus("9");
|
|
||||||
record.setUpdatetime(new Date());
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -2133,122 +2137,7 @@ public class HfMerService {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "resident.succeeded":
|
case "resident.succeeded":
|
||||||
record= tbPlussMerchantAuditRecordMapper.selectByApplicationid(requestId);
|
authInfo(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")){
|
|
||||||
// //提交实名
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case "resident.failed":
|
case "resident.failed":
|
||||||
record= tbPlussMerchantAuditRecordMapper.selectByApplicationid(requestId);
|
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(){
|
// public void authUser(){
|
||||||
|
|||||||
@@ -90,6 +90,9 @@ public class RSAUtils {
|
|||||||
return outStr;
|
return outStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
long temp = System.currentTimeMillis();
|
long temp = System.currentTimeMillis();
|
||||||
//生成公钥和私钥
|
//生成公钥和私钥
|
||||||
|
|||||||
Reference in New Issue
Block a user