Commit 2d33f521 by guojuxing

转账审批添加两个字段:回调接口路径和回调接口名称。如果需要回调

parent 5fc3a761
......@@ -121,6 +121,16 @@ public class TabTransferAccountsApproval {
*/
private Integer orderType;
/**
* 回调接口路径,例如 com.gic.enterprise.service.BillingPayInfoApiService
*/
private String callbackInterface;
/**
* 回调接口名称,例如 offlineCallBack
*/
private String callbackMethod;
public Integer getTransferApprovalId() {
return transferApprovalId;
}
......@@ -304,4 +314,20 @@ public class TabTransferAccountsApproval {
public void setOrderType(Integer orderType) {
this.orderType = orderType;
}
public String getCallbackInterface() {
return callbackInterface;
}
public void setCallbackInterface(String callbackInterface) {
this.callbackInterface = callbackInterface;
}
public String getCallbackMethod() {
return callbackMethod;
}
public void setCallbackMethod(String callbackMethod) {
this.callbackMethod = callbackMethod;
}
}
\ No newline at end of file
package com.gic.finance.service.outer.impl;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.apache.commons.lang.StringUtils;
......@@ -230,19 +229,11 @@ public class TransferAccountsApprovalApiServiceImpl implements TransferAccountsA
private void callBack(TabTransferAccountsApproval tab) {
LOGGER.info("转账审批回调:{}" ,JSONObject.toJSONString(tab));
int orderType = tab.getOrderType().intValue();
boolean isBilling = orderType == OrderTypeEnum.RECHARGE.getCode() ||
orderType == OrderTypeEnum.SHORT_MESSAGE_PACKAGE.getCode();
String interfaceUrl = "";
String method = "";
if (isBilling) {
interfaceUrl = "com.gic.enterprise.service.BillingPayInfoApiService";
method = "offlineCallBack";
} else if (orderType == OrderTypeEnum.SERVICE.getCode()) {
//服务类型
interfaceUrl = "com.gic.open.api.service.market.PayCallbackApiService";
method = "payCallbackTransfer";
String interfaceUrl = tab.getCallbackInterface();
String method = tab.getCallbackMethod();
if (StringUtils.isBlank(interfaceUrl) || StringUtils.isBlank(method)) {
return;
}
RegistryConfig registry = new RegistryConfig();
......
......@@ -25,12 +25,15 @@
<result column="company_name" jdbcType="VARCHAR" property="companyName" />
<result column="logo" jdbcType="VARCHAR" property="logo" />
<result column="order_type" jdbcType="INTEGER" property="orderType" />
<result column="callback_interface" jdbcType="VARCHAR" property="callbackInterface" />
<result column="callback_method" jdbcType="VARCHAR" property="callbackMethod" />
</resultMap>
<sql id="Base_Column_List">
transfer_approval_id, order_number, platform_type, initiator_type, initiator_name,
enterprise_id, planned_amount, bad_amount, account_amount, verify_code, approval_number,
approval_status, approval_id, approval_name, approval_time, create_time, update_time,
approval_phone, approval_phone_area_code, enterprise_name, company_name, logo, order_type
approval_phone, approval_phone_area_code, enterprise_name, company_name, logo, order_type,
callback_interface, callback_method
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
......@@ -50,7 +53,7 @@
approval_status, approval_id, approval_name,
approval_time, create_time, update_time,
approval_phone, approval_phone_area_code, enterprise_name,
company_name, logo, order_type
company_name, logo, order_type, callback_interface, callback_method
)
values (#{transferApprovalId,jdbcType=INTEGER}, #{orderNumber,jdbcType=VARCHAR},
#{platformType,jdbcType=INTEGER}, #{initiatorType,jdbcType=INTEGER}, #{initiatorName,jdbcType=VARCHAR},
......@@ -59,7 +62,8 @@
#{approvalStatus,jdbcType=INTEGER}, #{approvalId,jdbcType=VARCHAR}, #{approvalName,jdbcType=VARCHAR},
#{approvalTime,jdbcType=TIMESTAMP}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
#{approvalPhone,jdbcType=VARCHAR}, #{approvalPhoneAreaCode,jdbcType=VARCHAR}, #{enterpriseName,jdbcType=VARCHAR},
#{companyName,jdbcType=VARCHAR}, #{logo,jdbcType=VARCHAR}, #{orderType,jdbcType=INTEGER}
#{companyName,jdbcType=VARCHAR}, #{logo,jdbcType=VARCHAR}, #{orderType,jdbcType=INTEGER},
#{callbackInterface,jdbcType=VARCHAR}, #{callbackMethod,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.gic.finance.entity.TabTransferAccountsApproval">
......@@ -134,6 +138,12 @@
<if test="orderType != null">
order_type,
</if>
<if test="callbackInterface != null">
callback_interface,
</if>
<if test="callbackMethod != null">
callback_method,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="transferApprovalId != null">
......@@ -205,6 +215,12 @@
<if test="orderType != null">
#{orderType,jdbcType=INTEGER},
</if>
<if test="callbackInterface != null">
#{callbackInterface,jdbcType=VARCHAR},
</if>
<if test="callbackMethod != null">
#{callbackMethod,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.finance.entity.TabTransferAccountsApproval">
......@@ -276,6 +292,12 @@
<if test="orderType != null">
order_type = #{orderType,jdbcType=INTEGER},
</if>
<if test="callbackInterface != null">
callback_interface = #{callbackInterface,jdbcType=VARCHAR},
</if>
<if test="callbackMethod != null">
callback_method = #{callbackMethod,jdbcType=VARCHAR},
</if>
</set>
where transfer_approval_id = #{transferApprovalId,jdbcType=INTEGER}
</update>
......@@ -302,7 +324,9 @@
enterprise_name = #{enterpriseName,jdbcType=VARCHAR},
company_name = #{companyName,jdbcType=VARCHAR},
logo = #{logo,jdbcType=VARCHAR},
order_type = #{orderType,jdbcType=INTEGER}
order_type = #{orderType,jdbcType=INTEGER},
callback_interface = #{callbackInterface,jdbcType=VARCHAR},
callback_method = #{callbackMethod,jdbcType=VARCHAR}
where transfer_approval_id = #{transferApprovalId,jdbcType=INTEGER}
</update>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment